@hachej/boring-workspace 0.1.60 → 0.1.61
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-BMXXbAgy.js → FileTree-zGmxifl_.js} +1 -1
- package/dist/{MarkdownEditor-P47F3En6.js → MarkdownEditor-BykEKKxv.js} +1 -1
- package/dist/{WorkspaceLoadingState-D9v0oLDq.js → WorkspaceLoadingState-Dfnk7JjR.js} +3 -3
- package/dist/{WorkspaceProvider-Dxvh_Faj.js → WorkspaceProvider-kf-pjz6V.js} +617 -588
- package/dist/app-front.js +1205 -1155
- package/dist/boring-workspace.css +1 -1
- package/dist/testing.js +1 -1
- package/dist/workspace.css +105 -1
- package/dist/workspace.js +5 -5
- package/package.json +4 -4
|
@@ -2,18 +2,18 @@ var ii = Object.defineProperty;
|
|
|
2
2
|
var si = (e, t, n) => t in e ? ii(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var Q = (e, t, n) => si(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import * as ai from "react/jsx-runtime";
|
|
5
|
-
import { jsx as u, jsxs as
|
|
5
|
+
import { jsx as u, jsxs as C, Fragment as et } from "react/jsx-runtime";
|
|
6
6
|
import * as ci from "react";
|
|
7
|
-
import { lazy as Ht, useRef as O, useMemo as Y, useContext as
|
|
8
|
-
import { AlertTriangleIcon as ui, ImageIcon as rt, FileTextIcon as We, FileJsonIcon as Un, FileCodeIcon as
|
|
7
|
+
import { lazy as Ht, useRef as O, useMemo as Y, useContext as we, createContext as Ne, useSyncExternalStore as ut, useState as U, useCallback as I, Component as li, createElement as Se, useEffect as L, Suspense as Gt, Fragment as Wr, useLayoutEffect as Bn } from "react";
|
|
8
|
+
import { AlertTriangleIcon as ui, ImageIcon as rt, FileTextIcon as We, FileJsonIcon as Un, FileCodeIcon as ye, FileIcon as Vt, X as In, RefreshCw as di, Download as fi, RefreshCcw as pi, ExternalLink as zr, FolderTree as hi, MessageSquare as jr, TerminalIcon as Rn, ClockIcon as mi, MessageSquarePlus as gi, ArrowUp as vi, ArrowDown as wi, CornerDownLeft as yi, GripVertical as bi, Plus as ki, ChevronLeft as Si, ChevronRight as Br, Pin as xi, PanelLeftClose as Pi, Search as qn, PanelLeftOpen as Ci } from "lucide-react";
|
|
9
9
|
import { Notice as Ur, IconButton as _e, LoadingState as Ei, Input as qr, toast as He, ErrorState as vt, Skeleton as Ii, Spinner as Kt, Button as Ke, AlertDialog as Ri, AlertDialogContent as Ni, AlertDialogHeader as Ti, AlertDialogTitle as Ai, AlertDialogDescription as Di, AlertDialogFooter as Oi, AlertDialogCancel as _i, AlertDialogAction as $i, EmptyState as Hr, Kbd as mt, TooltipProvider as Li, Tooltip as Fi, TooltipTrigger as Mi, TooltipContent as Wi, Dialog as zi, DialogContent as ji, DialogHeader as Bi, DialogTitle as Ui, DialogDescription as qi, Command as Hi, CommandList as Gi, CommandEmpty as Vi, CommandInput as Ki, CommandGroup as Jt, CommandItem as Nt, CommandShortcut as Ji, Toaster as Yi } from "@hachej/boring-ui-kit";
|
|
10
10
|
import { useStore as tt, create as Xi } from "zustand";
|
|
11
11
|
import { persist as Qi } from "zustand/middleware";
|
|
12
|
-
import { z as
|
|
12
|
+
import { z as re } from "zod";
|
|
13
13
|
import { useQueryClient as Gr, QueryClient as Zi, QueryClientProvider as es, useQuery as Yt, useMutation as Xt } from "@tanstack/react-query";
|
|
14
14
|
import * as ts from "react-dom";
|
|
15
15
|
import { createPortal as Vr } from "react-dom";
|
|
16
|
-
import { c as
|
|
16
|
+
import { c as te } from "./utils-B6yFEsav.js";
|
|
17
17
|
import { Compartment as kt, EditorState as an } from "@codemirror/state";
|
|
18
18
|
import { EditorView as gt, lineNumbers as Hn, drawSelection as ns, highlightActiveLine as rs, keymap as os } from "@codemirror/view";
|
|
19
19
|
import { history as is, defaultKeymap as ss, historyKeymap as as } from "@codemirror/commands";
|
|
@@ -23,8 +23,8 @@ import { json as ls } from "@codemirror/lang-json";
|
|
|
23
23
|
import { yaml as us } from "@codemirror/lang-yaml";
|
|
24
24
|
import { markdown as ds } from "@codemirror/lang-markdown";
|
|
25
25
|
import { sql as fs } from "@codemirror/lang-sql";
|
|
26
|
-
import { syntaxHighlighting as Kr, HighlightStyle as ps, bracketMatching as hs, indentOnInput as ms, foldGutter as gs, foldKeymap as vs, defaultHighlightStyle as
|
|
27
|
-
import { highlightSelectionMatches as
|
|
26
|
+
import { syntaxHighlighting as Kr, HighlightStyle as ps, bracketMatching as hs, indentOnInput as ms, foldGutter as gs, foldKeymap as vs, defaultHighlightStyle as ws } from "@codemirror/language";
|
|
27
|
+
import { highlightSelectionMatches as ys, searchKeymap as bs } from "@codemirror/search";
|
|
28
28
|
import { tags as K } from "@lezer/highlight";
|
|
29
29
|
import { DockviewReact as Jr } from "dockview-react";
|
|
30
30
|
import "dockview-react/dist/styles/dockview.css";
|
|
@@ -476,7 +476,7 @@ class eo {
|
|
|
476
476
|
for (const t of [...this.listeners]) t();
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
-
const
|
|
479
|
+
const wt = Ne(null);
|
|
480
480
|
function Os({
|
|
481
481
|
panelRegistry: e,
|
|
482
482
|
workspaceSourceRegistry: t,
|
|
@@ -497,30 +497,30 @@ function Os({
|
|
|
497
497
|
}),
|
|
498
498
|
[e, d, n, c, f]
|
|
499
499
|
);
|
|
500
|
-
return /* @__PURE__ */ u(
|
|
500
|
+
return /* @__PURE__ */ u(wt.Provider, { value: p, children: i });
|
|
501
501
|
}
|
|
502
502
|
function Qt() {
|
|
503
|
-
const e =
|
|
503
|
+
const e = we(wt);
|
|
504
504
|
if (!e) throw new Error("useRegistry must be used within a RegistryProvider");
|
|
505
505
|
return e.panelRegistry;
|
|
506
506
|
}
|
|
507
507
|
function Nn() {
|
|
508
|
-
const e =
|
|
508
|
+
const e = we(wt);
|
|
509
509
|
if (!e) throw new Error("useWorkspaceSourceRegistry must be used within a RegistryProvider");
|
|
510
510
|
return e.workspaceSourceRegistry;
|
|
511
511
|
}
|
|
512
512
|
function Tn() {
|
|
513
|
-
const e =
|
|
513
|
+
const e = we(wt);
|
|
514
514
|
if (!e) throw new Error("useCommandRegistry must be used within a RegistryProvider");
|
|
515
515
|
return e.commandRegistry;
|
|
516
516
|
}
|
|
517
517
|
function Zt() {
|
|
518
|
-
const e =
|
|
518
|
+
const e = we(wt);
|
|
519
519
|
if (!e) throw new Error("useCatalogRegistry must be used within a RegistryProvider");
|
|
520
520
|
return e.catalogRegistry;
|
|
521
521
|
}
|
|
522
522
|
function to() {
|
|
523
|
-
const e =
|
|
523
|
+
const e = we(wt);
|
|
524
524
|
if (!e) throw new Error("useSurfaceResolverRegistry must be used within a RegistryProvider");
|
|
525
525
|
return e.surfaceResolverRegistry;
|
|
526
526
|
}
|
|
@@ -539,8 +539,8 @@ function Ls({ pluginId: e, message: t, kind: n }) {
|
|
|
539
539
|
tone: "error",
|
|
540
540
|
icon: /* @__PURE__ */ u(ui, { className: "size-4" }),
|
|
541
541
|
className: "py-2",
|
|
542
|
-
description: /* @__PURE__ */
|
|
543
|
-
/* @__PURE__ */
|
|
542
|
+
description: /* @__PURE__ */ C("span", { className: "block min-w-0 truncate", children: [
|
|
543
|
+
/* @__PURE__ */ C("span", { className: "font-medium", children: [
|
|
544
544
|
"[",
|
|
545
545
|
e,
|
|
546
546
|
"]"
|
|
@@ -564,7 +564,7 @@ function Fs({ children: e }) {
|
|
|
564
564
|
return /* @__PURE__ */ u(An.Provider, { value: o, children: e });
|
|
565
565
|
}
|
|
566
566
|
function $f() {
|
|
567
|
-
const e =
|
|
567
|
+
const e = we(An);
|
|
568
568
|
if (!e) throw new Error("usePluginErrors must be used within a PluginErrorProvider");
|
|
569
569
|
return e;
|
|
570
570
|
}
|
|
@@ -667,16 +667,16 @@ async function qs(e, t, n) {
|
|
|
667
667
|
function ro(e, t, n, r) {
|
|
668
668
|
const o = !!(n && Object.keys(n).length > 0), i = zs(e, !!t || o, r.allowCrossOriginBase), s = () => t ? { "x-boring-workspace-id": t } : {}, l = async (p, h, m, g) => {
|
|
669
669
|
var A;
|
|
670
|
-
const b = js(p),
|
|
670
|
+
const b = js(p), y = {
|
|
671
671
|
...n ?? {},
|
|
672
672
|
...h.headers,
|
|
673
673
|
...s()
|
|
674
674
|
};
|
|
675
|
-
(h.body === void 0 || h.body === null) && Us(
|
|
675
|
+
(h.body === void 0 || h.body === null) && Us(y, "content-type");
|
|
676
676
|
const $ = await fetch(`${i}${Bs(b, t)}`, {
|
|
677
677
|
credentials: "include",
|
|
678
678
|
...h,
|
|
679
|
-
headers:
|
|
679
|
+
headers: y
|
|
680
680
|
});
|
|
681
681
|
if (!$.ok)
|
|
682
682
|
throw new Error(await qs($, m, {
|
|
@@ -731,17 +731,17 @@ function Hs({
|
|
|
731
731
|
return Se(no.Provider, { value: o }, r);
|
|
732
732
|
}
|
|
733
733
|
function Ff() {
|
|
734
|
-
const e =
|
|
734
|
+
const e = we(no);
|
|
735
735
|
if (!e) throw new Error("useWorkspacePluginClient must be used within a WorkspaceProvider");
|
|
736
736
|
return e;
|
|
737
737
|
}
|
|
738
|
-
const Gs = 1024, Vs = 500, Ks = /^[a-zA-Z0-9_-]+$/, Js = 64, Ot = 50, Vn = 16384, Dn =
|
|
738
|
+
const Gs = 1024, Vs = 500, Ks = /^[a-zA-Z0-9_-]+$/, Js = 64, Ot = 50, Vn = 16384, Dn = re.string().min(1).max(Gs).refine((e) => !e.includes(".."), "path traversal not allowed").refine((e) => !e.includes("\0"), "null bytes not allowed"), Ys = re.object({
|
|
739
739
|
path: Dn,
|
|
740
|
-
mode:
|
|
741
|
-
}), Xs =
|
|
742
|
-
id:
|
|
743
|
-
component:
|
|
744
|
-
params:
|
|
740
|
+
mode: re.enum(["view", "edit", "diff"]).optional()
|
|
741
|
+
}), Xs = re.object({
|
|
742
|
+
id: re.string().max(Js).regex(Ks, "invalid panel ID"),
|
|
743
|
+
component: re.string().min(1),
|
|
744
|
+
params: re.record(re.unknown()).optional().refine(
|
|
745
745
|
(e) => {
|
|
746
746
|
if (!e) return !0;
|
|
747
747
|
try {
|
|
@@ -752,16 +752,16 @@ const Gs = 1024, Vs = 500, Ks = /^[a-zA-Z0-9_-]+$/, Js = 64, Ot = 50, Vn = 16384
|
|
|
752
752
|
},
|
|
753
753
|
`params must be JSON-serializable and under ${Vn} bytes`
|
|
754
754
|
),
|
|
755
|
-
title:
|
|
756
|
-
}), Qs =
|
|
757
|
-
id:
|
|
758
|
-
}), Zs =
|
|
759
|
-
msg:
|
|
760
|
-
level:
|
|
761
|
-
}), ea =
|
|
755
|
+
title: re.string().max(200).optional()
|
|
756
|
+
}), Qs = re.object({
|
|
757
|
+
id: re.string().min(1)
|
|
758
|
+
}), Zs = re.object({
|
|
759
|
+
msg: re.string().max(Vs),
|
|
760
|
+
level: re.enum(["info", "warn", "error"]).optional()
|
|
761
|
+
}), ea = re.object({
|
|
762
762
|
file: Dn,
|
|
763
|
-
line:
|
|
764
|
-
}), ta =
|
|
763
|
+
line: re.number().int().positive()
|
|
764
|
+
}), ta = re.object({
|
|
765
765
|
path: Dn
|
|
766
766
|
});
|
|
767
767
|
function na(e) {
|
|
@@ -947,20 +947,20 @@ function sa(e) {
|
|
|
947
947
|
onConnectionChange: d
|
|
948
948
|
} = e;
|
|
949
949
|
let c = null, f = null, p = null, h = null, m = !1, g = !1, b = 0;
|
|
950
|
-
function
|
|
950
|
+
function y(D) {
|
|
951
951
|
g || m !== D && (m = D, d == null || d(D));
|
|
952
952
|
}
|
|
953
953
|
async function $(D) {
|
|
954
954
|
if (g) return;
|
|
955
955
|
const H = ia(r, D);
|
|
956
956
|
try {
|
|
957
|
-
const
|
|
957
|
+
const E = await fetch(`${t}/api/v1/ui/state`, {
|
|
958
958
|
method: "PUT",
|
|
959
959
|
headers: Kn(o),
|
|
960
960
|
body: JSON.stringify(H)
|
|
961
961
|
});
|
|
962
962
|
if (g) return;
|
|
963
|
-
(
|
|
963
|
+
(E.status === 401 || E.status === 403) && (l == null || l(E.status));
|
|
964
964
|
} catch {
|
|
965
965
|
}
|
|
966
966
|
}
|
|
@@ -973,54 +973,54 @@ function sa(e) {
|
|
|
973
973
|
if (!g)
|
|
974
974
|
switch (D) {
|
|
975
975
|
case "init": {
|
|
976
|
-
|
|
976
|
+
y(!0), $("restore");
|
|
977
977
|
break;
|
|
978
978
|
}
|
|
979
979
|
case "command": {
|
|
980
|
-
let
|
|
980
|
+
let E;
|
|
981
981
|
try {
|
|
982
|
-
|
|
982
|
+
E = JSON.parse(H);
|
|
983
983
|
} catch {
|
|
984
984
|
return;
|
|
985
985
|
}
|
|
986
|
-
if (
|
|
987
|
-
a == null || a(
|
|
986
|
+
if (E.v !== 1) {
|
|
987
|
+
a == null || a(E.v);
|
|
988
988
|
return;
|
|
989
989
|
}
|
|
990
|
-
b++, Jn(n,
|
|
990
|
+
b++, Jn(n, E.kind, E.params).finally(() => {
|
|
991
991
|
b--;
|
|
992
992
|
});
|
|
993
993
|
break;
|
|
994
994
|
}
|
|
995
995
|
case "error": {
|
|
996
|
-
let
|
|
996
|
+
let E;
|
|
997
997
|
try {
|
|
998
|
-
|
|
998
|
+
E = JSON.parse(H);
|
|
999
999
|
} catch {
|
|
1000
1000
|
return;
|
|
1001
1001
|
}
|
|
1002
|
-
if (
|
|
1003
|
-
a == null || a(
|
|
1002
|
+
if (E.v !== 1) {
|
|
1003
|
+
a == null || a(E.v);
|
|
1004
1004
|
return;
|
|
1005
1005
|
}
|
|
1006
|
-
n.showNotification(
|
|
1006
|
+
n.showNotification(E.message, "error");
|
|
1007
1007
|
break;
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
1010
|
}
|
|
1011
1011
|
function _() {
|
|
1012
1012
|
const D = `${t}/api/v1/ui/commands/next`, H = new EventSource(D, { withCredentials: !0 });
|
|
1013
|
-
H.addEventListener("init", (
|
|
1014
|
-
x("init",
|
|
1015
|
-
}), H.addEventListener("command", (
|
|
1016
|
-
x("command",
|
|
1017
|
-
}), H.addEventListener("error", (
|
|
1018
|
-
|
|
1019
|
-
}), H.addEventListener("heartbeat", (
|
|
1020
|
-
x("heartbeat",
|
|
1013
|
+
H.addEventListener("init", (E) => {
|
|
1014
|
+
x("init", E.data);
|
|
1015
|
+
}), H.addEventListener("command", (E) => {
|
|
1016
|
+
x("command", E.data);
|
|
1017
|
+
}), H.addEventListener("error", (E) => {
|
|
1018
|
+
E.data ? x("error", E.data) : y(!1);
|
|
1019
|
+
}), H.addEventListener("heartbeat", (E) => {
|
|
1020
|
+
x("heartbeat", E.data);
|
|
1021
1021
|
}), c = H;
|
|
1022
1022
|
}
|
|
1023
|
-
async function
|
|
1023
|
+
async function w() {
|
|
1024
1024
|
if (!g)
|
|
1025
1025
|
try {
|
|
1026
1026
|
const D = `${t}/api/v1/ui/commands/next?poll=true`, H = await fetch(D, { headers: Kn(o) });
|
|
@@ -1030,9 +1030,9 @@ function sa(e) {
|
|
|
1030
1030
|
return;
|
|
1031
1031
|
}
|
|
1032
1032
|
if (!H.ok) return;
|
|
1033
|
-
const
|
|
1034
|
-
if (!Array.isArray(
|
|
1035
|
-
for (const F of
|
|
1033
|
+
const E = await H.json();
|
|
1034
|
+
if (!Array.isArray(E)) return;
|
|
1035
|
+
for (const F of E) {
|
|
1036
1036
|
if (g) return;
|
|
1037
1037
|
if (F.v !== 1) {
|
|
1038
1038
|
a == null || a(F.v);
|
|
@@ -1045,9 +1045,9 @@ function sa(e) {
|
|
|
1045
1045
|
b--;
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
|
-
|
|
1048
|
+
y(!0);
|
|
1049
1049
|
} catch {
|
|
1050
|
-
|
|
1050
|
+
y(!1);
|
|
1051
1051
|
}
|
|
1052
1052
|
}
|
|
1053
1053
|
function v() {
|
|
@@ -1059,10 +1059,10 @@ function sa(e) {
|
|
|
1059
1059
|
}
|
|
1060
1060
|
return {
|
|
1061
1061
|
connect() {
|
|
1062
|
-
g = !1, !i && typeof EventSource < "u" ? _() : (
|
|
1062
|
+
g = !1, !i && typeof EventSource < "u" ? _() : (w(), f = setInterval(w, s)), v();
|
|
1063
1063
|
},
|
|
1064
1064
|
disconnect() {
|
|
1065
|
-
c && (c.close(), c = null), f !== null && (clearInterval(f), f = null), p !== null && (clearTimeout(p), p = null), h && (h(), h = null),
|
|
1065
|
+
c && (c.close(), c = null), f !== null && (clearInterval(f), f = null), p !== null && (clearTimeout(p), p = null), h && (h(), h = null), y(!1), g = !0;
|
|
1066
1066
|
},
|
|
1067
1067
|
pushState(D) {
|
|
1068
1068
|
$(D);
|
|
@@ -1242,18 +1242,18 @@ function fa() {
|
|
|
1242
1242
|
}
|
|
1243
1243
|
return { on: t, emit: n, _reset: r };
|
|
1244
1244
|
}
|
|
1245
|
-
const pa = "workspace:ui.command", ha = "workspace:editor.save.start", ma = "workspace:editor.save.end", ga = "workspace:panel.update", va = "workspace:panel.close",
|
|
1245
|
+
const pa = "workspace:ui.command", ha = "workspace:editor.save.start", ma = "workspace:editor.save.end", ga = "workspace:panel.update", va = "workspace:panel.close", wa = "workspace:agent.data", $e = {
|
|
1246
1246
|
uiCommand: pa,
|
|
1247
1247
|
editorSaveStart: ha,
|
|
1248
1248
|
editorSaveEnd: ma,
|
|
1249
1249
|
panelUpdate: ga,
|
|
1250
1250
|
panelClose: va,
|
|
1251
|
-
agentData:
|
|
1251
|
+
agentData: wa
|
|
1252
1252
|
};
|
|
1253
1253
|
function dt() {
|
|
1254
1254
|
return { cause: "user", ts: Date.now() };
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1256
|
+
function ya(e) {
|
|
1257
1257
|
return { cause: "agent", toolCallId: e, ts: Date.now() };
|
|
1258
1258
|
}
|
|
1259
1259
|
function pt(e) {
|
|
@@ -1285,7 +1285,7 @@ function Ca(e) {
|
|
|
1285
1285
|
function b(A) {
|
|
1286
1286
|
A && typeof A == "object" && typeof A.kind == "string" && kn(A, n);
|
|
1287
1287
|
}
|
|
1288
|
-
function
|
|
1288
|
+
function y() {
|
|
1289
1289
|
if (d || g || !i) return;
|
|
1290
1290
|
g = !0;
|
|
1291
1291
|
const A = async () => {
|
|
@@ -1298,7 +1298,7 @@ function Ca(e) {
|
|
|
1298
1298
|
if (d) return;
|
|
1299
1299
|
if (x.ok) {
|
|
1300
1300
|
const _ = await x.json();
|
|
1301
|
-
if (Array.isArray(_)) for (const
|
|
1301
|
+
if (Array.isArray(_)) for (const w of _) b(w);
|
|
1302
1302
|
}
|
|
1303
1303
|
} catch {
|
|
1304
1304
|
} finally {
|
|
@@ -1312,7 +1312,7 @@ function Ca(e) {
|
|
|
1312
1312
|
function $() {
|
|
1313
1313
|
if (!d) {
|
|
1314
1314
|
if (!o) {
|
|
1315
|
-
|
|
1315
|
+
y();
|
|
1316
1316
|
return;
|
|
1317
1317
|
}
|
|
1318
1318
|
c = new o(Xn(`${t}/api/v1/ui/commands/next`, r)), c.addEventListener("command", (A) => {
|
|
@@ -1327,7 +1327,7 @@ function Ca(e) {
|
|
|
1327
1327
|
}), c.addEventListener("error", () => {
|
|
1328
1328
|
if (!d) {
|
|
1329
1329
|
if (c == null || c.close(), c = null, m += 1, m > l) {
|
|
1330
|
-
|
|
1330
|
+
y();
|
|
1331
1331
|
return;
|
|
1332
1332
|
}
|
|
1333
1333
|
h = setTimeout($, s * m);
|
|
@@ -1520,7 +1520,7 @@ async function Aa(e) {
|
|
|
1520
1520
|
return null;
|
|
1521
1521
|
}
|
|
1522
1522
|
}
|
|
1523
|
-
const Da = "filesystem:file.changed", Oa = "filesystem:file.created", _a = "filesystem:file.moved", $a = "filesystem:file.deleted",
|
|
1523
|
+
const Da = "filesystem:file.changed", Oa = "filesystem:file.created", _a = "filesystem:file.moved", $a = "filesystem:file.deleted", ne = {
|
|
1524
1524
|
changed: Da,
|
|
1525
1525
|
created: Oa,
|
|
1526
1526
|
moved: _a,
|
|
@@ -1577,9 +1577,9 @@ function Ma() {
|
|
|
1577
1577
|
o.delete(f), c();
|
|
1578
1578
|
}, za);
|
|
1579
1579
|
o.add(f);
|
|
1580
|
-
}, s = X.on(
|
|
1580
|
+
}, s = X.on(ne.changed, (c) => {
|
|
1581
1581
|
St(r, t, n, c.path);
|
|
1582
|
-
}), l = X.on(
|
|
1582
|
+
}), l = X.on(ne.created, (c) => {
|
|
1583
1583
|
er(e, t, n, {
|
|
1584
1584
|
name: Zn(c.path),
|
|
1585
1585
|
kind: c.kind,
|
|
@@ -1589,7 +1589,7 @@ function Ma() {
|
|
|
1589
1589
|
_t(r, t, n, c.path), c.kind === "file" && St(r, t, n, c.path);
|
|
1590
1590
|
};
|
|
1591
1591
|
f(), c.cause === "remote" && i(f);
|
|
1592
|
-
}), a = X.on(
|
|
1592
|
+
}), a = X.on(ne.moved, (c) => {
|
|
1593
1593
|
const f = Ba(e, t, n, c.from);
|
|
1594
1594
|
tr(e, t, n, c.from), f && er(e, t, n, {
|
|
1595
1595
|
...f,
|
|
@@ -1600,7 +1600,7 @@ function Ma() {
|
|
|
1600
1600
|
_t(r, t, n, c.from), _t(r, t, n, c.to), St(r, t, n, c.from), St(r, t, n, c.to), Ua(r, t, n, c.from), nr(r, t, n);
|
|
1601
1601
|
};
|
|
1602
1602
|
p(), c.cause === "remote" && i(p);
|
|
1603
|
-
}), d = X.on(
|
|
1603
|
+
}), d = X.on(ne.deleted, (c) => {
|
|
1604
1604
|
tr(e, t, n, c.path);
|
|
1605
1605
|
const f = () => {
|
|
1606
1606
|
_t(r, t, n, c.path), St(r, t, n, c.path), nr(r, t, n);
|
|
@@ -1721,16 +1721,16 @@ function qa() {
|
|
|
1721
1721
|
function Ha(e) {
|
|
1722
1722
|
switch (e.op) {
|
|
1723
1723
|
case "write":
|
|
1724
|
-
X.emit(
|
|
1724
|
+
X.emit(ne.created, { ...pt(), path: e.path, kind: "file" }), X.emit(ne.changed, { ...pt(), path: e.path });
|
|
1725
1725
|
return;
|
|
1726
1726
|
case "mkdir":
|
|
1727
|
-
X.emit(
|
|
1727
|
+
X.emit(ne.created, { ...pt(), path: e.path, kind: "dir" });
|
|
1728
1728
|
return;
|
|
1729
1729
|
case "unlink":
|
|
1730
|
-
X.emit(
|
|
1730
|
+
X.emit(ne.deleted, { ...pt(), path: e.path });
|
|
1731
1731
|
return;
|
|
1732
1732
|
case "rename":
|
|
1733
|
-
e.oldPath ? X.emit(
|
|
1733
|
+
e.oldPath ? X.emit(ne.moved, { ...pt(), from: e.oldPath, to: e.path }) : X.emit(ne.created, { ...pt(), path: e.path, kind: "file" });
|
|
1734
1734
|
return;
|
|
1735
1735
|
}
|
|
1736
1736
|
}
|
|
@@ -1750,18 +1750,18 @@ function Ka(e, t) {
|
|
|
1750
1750
|
}
|
|
1751
1751
|
const _n = Ne(null), ho = Ne(""), mo = Ne(null);
|
|
1752
1752
|
function Je() {
|
|
1753
|
-
const e =
|
|
1753
|
+
const e = we(_n);
|
|
1754
1754
|
if (!e) throw new Error("useDataClient must be used within a DataProvider");
|
|
1755
1755
|
return e;
|
|
1756
1756
|
}
|
|
1757
1757
|
function Mf() {
|
|
1758
|
-
return
|
|
1758
|
+
return we(_n) != null;
|
|
1759
1759
|
}
|
|
1760
1760
|
function st() {
|
|
1761
|
-
return
|
|
1761
|
+
return we(ho);
|
|
1762
1762
|
}
|
|
1763
1763
|
function at() {
|
|
1764
|
-
return
|
|
1764
|
+
return we(mo);
|
|
1765
1765
|
}
|
|
1766
1766
|
function Ja({
|
|
1767
1767
|
apiBaseUrl: e,
|
|
@@ -1784,7 +1784,7 @@ function Ja({
|
|
|
1784
1784
|
() => o ?? new Ta({ apiBaseUrl: e, authHeaders: t, onAuthError: n, timeout: r }),
|
|
1785
1785
|
[o, e, t, n, r]
|
|
1786
1786
|
), a = (t == null ? void 0 : t["x-boring-workspace-id"]) ?? (t == null ? void 0 : t["X-Boring-Workspace-Id"]) ?? null;
|
|
1787
|
-
return /* @__PURE__ */ u(es, { client: s.current, children: /* @__PURE__ */ u(ho.Provider, { value: e, children: /* @__PURE__ */ u(mo.Provider, { value: a, children: /* @__PURE__ */
|
|
1787
|
+
return /* @__PURE__ */ u(es, { client: s.current, children: /* @__PURE__ */ u(ho.Provider, { value: e, children: /* @__PURE__ */ u(mo.Provider, { value: a, children: /* @__PURE__ */ C(_n.Provider, { value: l, children: [
|
|
1788
1788
|
/* @__PURE__ */ u(Ya, {}),
|
|
1789
1789
|
i
|
|
1790
1790
|
] }) }) }) });
|
|
@@ -1823,7 +1823,7 @@ function tc(e, t = {}) {
|
|
|
1823
1823
|
if (i === void 0 || !(a instanceof Qe) || a.status !== 404) throw a;
|
|
1824
1824
|
if (s.aborted) throw new DOMException("Aborted", "AbortError");
|
|
1825
1825
|
const d = await n.writeFile(l, i);
|
|
1826
|
-
return X.emit(
|
|
1826
|
+
return X.emit(ne.created, { ...dt(), path: l, kind: "file" }), { content: i, mtimeMs: d.mtimeMs };
|
|
1827
1827
|
}
|
|
1828
1828
|
},
|
|
1829
1829
|
enabled: e != null,
|
|
@@ -1831,7 +1831,7 @@ function tc(e, t = {}) {
|
|
|
1831
1831
|
retry: i === void 0 ? nn : !1
|
|
1832
1832
|
});
|
|
1833
1833
|
}
|
|
1834
|
-
function
|
|
1834
|
+
function wo(e) {
|
|
1835
1835
|
const t = Je(), n = st(), r = at();
|
|
1836
1836
|
return Yt({
|
|
1837
1837
|
queryKey: [n, r, "tree", e],
|
|
@@ -1864,7 +1864,7 @@ function rc(e, t) {
|
|
|
1864
1864
|
retry: nn
|
|
1865
1865
|
});
|
|
1866
1866
|
}
|
|
1867
|
-
function
|
|
1867
|
+
function yo() {
|
|
1868
1868
|
const e = Je();
|
|
1869
1869
|
return Xt({
|
|
1870
1870
|
mutationFn: ({ path: t, content: n, expectedMtimeMs: r, returnMtimeMs: o }) => {
|
|
@@ -1875,7 +1875,7 @@ function wo() {
|
|
|
1875
1875
|
return e.writeFile(t, n, Object.keys(i).length > 0 ? i : void 0);
|
|
1876
1876
|
},
|
|
1877
1877
|
onSuccess: (t, { path: n }) => {
|
|
1878
|
-
X.emit(
|
|
1878
|
+
X.emit(ne.changed, { ...dt(), path: n });
|
|
1879
1879
|
}
|
|
1880
1880
|
});
|
|
1881
1881
|
}
|
|
@@ -1884,7 +1884,7 @@ function oc() {
|
|
|
1884
1884
|
return Xt({
|
|
1885
1885
|
mutationFn: ({ path: t }) => e.createDir(t),
|
|
1886
1886
|
onSuccess: (t, { path: n }) => {
|
|
1887
|
-
X.emit(
|
|
1887
|
+
X.emit(ne.created, { ...dt(), path: n, kind: "dir" });
|
|
1888
1888
|
}
|
|
1889
1889
|
});
|
|
1890
1890
|
}
|
|
@@ -1893,7 +1893,7 @@ function ic() {
|
|
|
1893
1893
|
return Xt({
|
|
1894
1894
|
mutationFn: ({ from: t, to: n }) => e.moveFile(t, n),
|
|
1895
1895
|
onSuccess: (t, { from: n, to: r }) => {
|
|
1896
|
-
X.emit(
|
|
1896
|
+
X.emit(ne.moved, { ...dt(), from: n, to: r });
|
|
1897
1897
|
}
|
|
1898
1898
|
});
|
|
1899
1899
|
}
|
|
@@ -1902,7 +1902,7 @@ function sc() {
|
|
|
1902
1902
|
return Xt({
|
|
1903
1903
|
mutationFn: ({ path: t }) => e.deleteFile(t),
|
|
1904
1904
|
onSuccess: (t, { path: n }) => {
|
|
1905
|
-
X.emit(
|
|
1905
|
+
X.emit(ne.deleted, { ...dt(), path: n });
|
|
1906
1906
|
}
|
|
1907
1907
|
});
|
|
1908
1908
|
}
|
|
@@ -1945,7 +1945,7 @@ function fc(e) {
|
|
|
1945
1945
|
);
|
|
1946
1946
|
}
|
|
1947
1947
|
function pc(e) {
|
|
1948
|
-
const t =
|
|
1948
|
+
const t = we(bo), n = e.panelInstanceId, r = I((i, s) => {
|
|
1949
1949
|
n != null && n.startsWith("self-test:") && t.report({
|
|
1950
1950
|
pluginId: e.pluginId,
|
|
1951
1951
|
panelId: e.panelId,
|
|
@@ -2121,26 +2121,26 @@ class hc {
|
|
|
2121
2121
|
}
|
|
2122
2122
|
}
|
|
2123
2123
|
const rr = {
|
|
2124
|
-
ts:
|
|
2125
|
-
tsx:
|
|
2126
|
-
js:
|
|
2127
|
-
jsx:
|
|
2128
|
-
mjs:
|
|
2129
|
-
cjs:
|
|
2130
|
-
py:
|
|
2131
|
-
rb:
|
|
2132
|
-
go:
|
|
2133
|
-
rs:
|
|
2134
|
-
java:
|
|
2135
|
-
c:
|
|
2136
|
-
cpp:
|
|
2137
|
-
h:
|
|
2138
|
-
cs:
|
|
2139
|
-
swift:
|
|
2140
|
-
kt:
|
|
2141
|
-
sh:
|
|
2142
|
-
bash:
|
|
2143
|
-
zsh:
|
|
2124
|
+
ts: ye,
|
|
2125
|
+
tsx: ye,
|
|
2126
|
+
js: ye,
|
|
2127
|
+
jsx: ye,
|
|
2128
|
+
mjs: ye,
|
|
2129
|
+
cjs: ye,
|
|
2130
|
+
py: ye,
|
|
2131
|
+
rb: ye,
|
|
2132
|
+
go: ye,
|
|
2133
|
+
rs: ye,
|
|
2134
|
+
java: ye,
|
|
2135
|
+
c: ye,
|
|
2136
|
+
cpp: ye,
|
|
2137
|
+
h: ye,
|
|
2138
|
+
cs: ye,
|
|
2139
|
+
swift: ye,
|
|
2140
|
+
kt: ye,
|
|
2141
|
+
sh: ye,
|
|
2142
|
+
bash: ye,
|
|
2143
|
+
zsh: ye,
|
|
2144
2144
|
json: Un,
|
|
2145
2145
|
jsonl: Un,
|
|
2146
2146
|
md: We,
|
|
@@ -2224,7 +2224,7 @@ function Gf() {
|
|
|
2224
2224
|
function vc(e) {
|
|
2225
2225
|
return "api" in e && e.api ? e.api : e;
|
|
2226
2226
|
}
|
|
2227
|
-
function
|
|
2227
|
+
function wc(e) {
|
|
2228
2228
|
const t = vc(e);
|
|
2229
2229
|
return {
|
|
2230
2230
|
id: t.id ?? ("id" in e ? e.id : void 0),
|
|
@@ -2234,7 +2234,7 @@ function yc(e) {
|
|
|
2234
2234
|
} : void 0
|
|
2235
2235
|
};
|
|
2236
2236
|
}
|
|
2237
|
-
function
|
|
2237
|
+
function yc(e) {
|
|
2238
2238
|
var r;
|
|
2239
2239
|
const t = (r = e.api.group) == null ? void 0 : r.panels;
|
|
2240
2240
|
if (Array.isArray(t)) return t;
|
|
@@ -2287,51 +2287,51 @@ function Pc(e) {
|
|
|
2287
2287
|
const { api: t } = e, n = e.tabLocation === "headerOverflow", [r, o] = U(t.title ?? t.id), [i, s] = U(null), l = O(null);
|
|
2288
2288
|
L(() => {
|
|
2289
2289
|
var W;
|
|
2290
|
-
const
|
|
2291
|
-
|
|
2292
|
-
const v = (W = t.onDidTitleChange) == null ? void 0 : W.call(t,
|
|
2290
|
+
const w = () => o(t.title ?? t.id);
|
|
2291
|
+
w();
|
|
2292
|
+
const v = (W = t.onDidTitleChange) == null ? void 0 : W.call(t, w);
|
|
2293
2293
|
return () => {
|
|
2294
2294
|
var D;
|
|
2295
2295
|
return (D = v == null ? void 0 : v.dispose) == null ? void 0 : D.call(v);
|
|
2296
2296
|
};
|
|
2297
2297
|
}, [t]), L(() => {
|
|
2298
2298
|
if (!i) return;
|
|
2299
|
-
function
|
|
2299
|
+
function w(v) {
|
|
2300
2300
|
l.current && !l.current.contains(v.target) && s(null);
|
|
2301
2301
|
}
|
|
2302
|
-
return document.addEventListener("pointerdown",
|
|
2302
|
+
return document.addEventListener("pointerdown", w), () => document.removeEventListener("pointerdown", w);
|
|
2303
2303
|
}, [i]);
|
|
2304
|
-
const a = r.endsWith(" ●"), d = a ? r.slice(0, -2) : r, c = mc(d), f = bc(e.params, "path") ?? kc(t.id), p =
|
|
2305
|
-
Sn($e.editorSaveStart, (
|
|
2306
|
-
|
|
2307
|
-
}), Sn($e.editorSaveEnd, (
|
|
2308
|
-
|
|
2304
|
+
const a = r.endsWith(" ●"), d = a ? r.slice(0, -2) : r, c = mc(d), f = bc(e.params, "path") ?? kc(t.id), p = yc(e).map(wc).filter((w) => w.close), h = p.filter((w) => w.id !== t.id), [m, g] = U(!1);
|
|
2305
|
+
Sn($e.editorSaveStart, (w) => {
|
|
2306
|
+
w.panelId === t.id && g(!0);
|
|
2307
|
+
}), Sn($e.editorSaveEnd, (w) => {
|
|
2308
|
+
w.panelId === t.id && g(!1);
|
|
2309
2309
|
});
|
|
2310
|
-
const b = (
|
|
2311
|
-
|
|
2312
|
-
},
|
|
2313
|
-
!f && h.length === 0 || (
|
|
2314
|
-
}, $ = (
|
|
2315
|
-
s(null), Sc(
|
|
2310
|
+
const b = (w) => {
|
|
2311
|
+
w.preventDefault(), w.stopPropagation(), n && w.nativeEvent.stopImmediatePropagation(), t.close(), n && xc();
|
|
2312
|
+
}, y = (w) => {
|
|
2313
|
+
!f && h.length === 0 || (w.preventDefault(), w.stopPropagation(), s({ x: w.clientX, y: w.clientY }));
|
|
2314
|
+
}, $ = (w) => {
|
|
2315
|
+
s(null), Sc(w);
|
|
2316
2316
|
}, A = () => {
|
|
2317
|
-
var
|
|
2318
|
-
s(null), (
|
|
2317
|
+
var w, v;
|
|
2318
|
+
s(null), (w = t.setActive) == null || w.call(t);
|
|
2319
2319
|
for (const W of h) (v = W.close) == null || v.call(W);
|
|
2320
2320
|
}, x = () => {
|
|
2321
|
-
var
|
|
2322
|
-
s(null), (
|
|
2321
|
+
var w, v;
|
|
2322
|
+
s(null), (w = t.setActive) == null || w.call(t);
|
|
2323
2323
|
for (const W of p) (v = W.close) == null || v.call(W);
|
|
2324
2324
|
}, _ = i && typeof document < "u" ? Vr(
|
|
2325
|
-
/* @__PURE__ */
|
|
2325
|
+
/* @__PURE__ */ C(
|
|
2326
2326
|
"div",
|
|
2327
2327
|
{
|
|
2328
2328
|
ref: l,
|
|
2329
2329
|
role: "menu",
|
|
2330
2330
|
className: "fixed z-[1000] min-w-[10rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
|
|
2331
2331
|
style: { left: i.x, top: i.y },
|
|
2332
|
-
onPointerDown: (
|
|
2333
|
-
onContextMenu: (
|
|
2334
|
-
|
|
2332
|
+
onPointerDown: (w) => w.stopPropagation(),
|
|
2333
|
+
onContextMenu: (w) => {
|
|
2334
|
+
w.preventDefault(), w.stopPropagation();
|
|
2335
2335
|
},
|
|
2336
2336
|
children: [
|
|
2337
2337
|
f ? /* @__PURE__ */ u(
|
|
@@ -2369,25 +2369,25 @@ function Pc(e) {
|
|
|
2369
2369
|
),
|
|
2370
2370
|
document.body
|
|
2371
2371
|
) : null;
|
|
2372
|
-
return /* @__PURE__ */
|
|
2373
|
-
/* @__PURE__ */
|
|
2372
|
+
return /* @__PURE__ */ C(Wr, { children: [
|
|
2373
|
+
/* @__PURE__ */ C(
|
|
2374
2374
|
"div",
|
|
2375
2375
|
{
|
|
2376
|
-
className:
|
|
2376
|
+
className: te(
|
|
2377
2377
|
"group relative flex h-full w-full min-w-0 items-center gap-2 px-3 select-none",
|
|
2378
2378
|
"text-[12.5px] leading-none tracking-tight",
|
|
2379
2379
|
"cursor-pointer transition-colors"
|
|
2380
2380
|
),
|
|
2381
2381
|
title: a ? `${d} (unsaved changes)` : d,
|
|
2382
|
-
onPointerDown: (
|
|
2383
|
-
|
|
2382
|
+
onPointerDown: (w) => {
|
|
2383
|
+
w.button === 2 && y(w);
|
|
2384
2384
|
},
|
|
2385
|
-
onContextMenu:
|
|
2385
|
+
onContextMenu: y,
|
|
2386
2386
|
children: [
|
|
2387
2387
|
/* @__PURE__ */ u(
|
|
2388
2388
|
c,
|
|
2389
2389
|
{
|
|
2390
|
-
className:
|
|
2390
|
+
className: te(
|
|
2391
2391
|
"h-3.5 w-3.5 shrink-0 text-muted-foreground/70",
|
|
2392
2392
|
"[.dv-active-tab_&]:text-[color:var(--accent)] [.active-tab_&]:text-[color:var(--accent)]"
|
|
2393
2393
|
),
|
|
@@ -2395,13 +2395,13 @@ function Pc(e) {
|
|
|
2395
2395
|
}
|
|
2396
2396
|
),
|
|
2397
2397
|
/* @__PURE__ */ u("span", { className: "min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap", children: d }),
|
|
2398
|
-
/* @__PURE__ */
|
|
2398
|
+
/* @__PURE__ */ C("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
2399
2399
|
a || m ? /* @__PURE__ */ u(
|
|
2400
2400
|
"span",
|
|
2401
2401
|
{
|
|
2402
2402
|
"data-testid": "tab-dirty-dot",
|
|
2403
2403
|
"aria-hidden": "true",
|
|
2404
|
-
className:
|
|
2404
|
+
className: te(
|
|
2405
2405
|
"h-1.5 w-1.5 shrink-0 rounded-full bg-foreground/35",
|
|
2406
2406
|
"[.dv-active-tab_&]:bg-foreground/45 [.active-tab_&]:bg-foreground/45"
|
|
2407
2407
|
)
|
|
@@ -2413,7 +2413,7 @@ function Pc(e) {
|
|
|
2413
2413
|
type: "button",
|
|
2414
2414
|
variant: "ghost",
|
|
2415
2415
|
size: "icon-xs",
|
|
2416
|
-
className:
|
|
2416
|
+
className: te(
|
|
2417
2417
|
"h-5 w-5 shrink-0 text-muted-foreground/80 opacity-0",
|
|
2418
2418
|
"focus-visible:opacity-100 group-hover:opacity-100",
|
|
2419
2419
|
"[.dv-active-tab_&]:opacity-55 [.active-tab_&]:opacity-55",
|
|
@@ -2452,7 +2452,7 @@ function or(e, t) {
|
|
|
2452
2452
|
return o;
|
|
2453
2453
|
}
|
|
2454
2454
|
function Vf() {
|
|
2455
|
-
const e =
|
|
2455
|
+
const e = we(So);
|
|
2456
2456
|
if (!e)
|
|
2457
2457
|
throw new Error(
|
|
2458
2458
|
"useDockviewApi must be used within a DockviewShell"
|
|
@@ -2635,14 +2635,14 @@ function Ac({
|
|
|
2635
2635
|
watermarkComponent: a
|
|
2636
2636
|
}) {
|
|
2637
2637
|
const d = Qt(), c = ut(d.subscribe, d.getSnapshot, d.getSnapshot), f = gc(), p = O(null), h = O(null), m = O(void 0), g = O(null), b = Y(() => {
|
|
2638
|
-
const x = d.getComponents(), _ = o ? Object.fromEntries(Object.entries(x).filter(([v]) => o.includes(v))) : x,
|
|
2639
|
-
if (
|
|
2640
|
-
const v = Object.keys(
|
|
2641
|
-
if (v.length === W.length && W.every((D) =>
|
|
2642
|
-
return
|
|
2638
|
+
const x = d.getComponents(), _ = o ? Object.fromEntries(Object.entries(x).filter(([v]) => o.includes(v))) : x, w = g.current;
|
|
2639
|
+
if (w) {
|
|
2640
|
+
const v = Object.keys(w), W = Object.keys(_);
|
|
2641
|
+
if (v.length === W.length && W.every((D) => w[D] === _[D]))
|
|
2642
|
+
return w;
|
|
2643
2643
|
}
|
|
2644
2644
|
return g.current = _, _;
|
|
2645
|
-
}, [d, c, o]),
|
|
2645
|
+
}, [d, c, o]), y = Y(() => Rc(p), []), $ = I(
|
|
2646
2646
|
(x) => {
|
|
2647
2647
|
var _;
|
|
2648
2648
|
(_ = m.current) == null || _.call(m), m.current = Tc(
|
|
@@ -2660,18 +2660,18 @@ function Ac({
|
|
|
2660
2660
|
var x;
|
|
2661
2661
|
return (x = m.current) == null ? void 0 : x.call(m);
|
|
2662
2662
|
}, []), L(() => {
|
|
2663
|
-
const x = X.on($e.panelUpdate, ({ match:
|
|
2663
|
+
const x = X.on($e.panelUpdate, ({ match: w, params: v, title: W }) => {
|
|
2664
2664
|
const D = p.current;
|
|
2665
2665
|
if (D)
|
|
2666
|
-
for (const H of or(D,
|
|
2666
|
+
for (const H of or(D, w))
|
|
2667
2667
|
v && H.api.updateParameters({
|
|
2668
2668
|
...H.params ?? {},
|
|
2669
2669
|
...v
|
|
2670
2670
|
}), W && H.api.setTitle(W);
|
|
2671
|
-
}), _ = X.on($e.panelClose, ({ match:
|
|
2671
|
+
}), _ = X.on($e.panelClose, ({ match: w }) => {
|
|
2672
2672
|
const v = p.current;
|
|
2673
2673
|
if (v)
|
|
2674
|
-
for (const W of or(v,
|
|
2674
|
+
for (const W of or(v, w))
|
|
2675
2675
|
v.removePanel(W);
|
|
2676
2676
|
});
|
|
2677
2677
|
return () => {
|
|
@@ -2690,7 +2690,7 @@ function Ac({
|
|
|
2690
2690
|
);
|
|
2691
2691
|
return L(() => {
|
|
2692
2692
|
f && h.current && ($(h.current), h.current = null);
|
|
2693
|
-
}, [f, $]), f ? /* @__PURE__ */ u(So.Provider, { value:
|
|
2693
|
+
}, [f, $]), f ? /* @__PURE__ */ u(So.Provider, { value: y, children: /* @__PURE__ */ u(
|
|
2694
2694
|
Jr,
|
|
2695
2695
|
{
|
|
2696
2696
|
className: `dv-shell ${i ?? ""}`,
|
|
@@ -2739,8 +2739,8 @@ function _c({
|
|
|
2739
2739
|
return Y(
|
|
2740
2740
|
() => i ? Oc(i) : null,
|
|
2741
2741
|
[i]
|
|
2742
|
-
), /* @__PURE__ */
|
|
2743
|
-
/* @__PURE__ */
|
|
2742
|
+
), /* @__PURE__ */ C("div", { className: te("flex h-full flex-col overflow-hidden", o), children: [
|
|
2743
|
+
/* @__PURE__ */ C("div", { className: "flex h-9 shrink-0 items-center gap-2 border-b border-border bg-muted/50 px-3", children: [
|
|
2744
2744
|
t && /* @__PURE__ */ u(t, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
|
|
2745
2745
|
/* @__PURE__ */ u("span", { className: "truncate text-sm font-medium", children: e }),
|
|
2746
2746
|
/* @__PURE__ */ u("div", { className: "flex-1" }),
|
|
@@ -2845,7 +2845,7 @@ async function sr(e) {
|
|
|
2845
2845
|
}
|
|
2846
2846
|
if (!n) throw new Error("Clipboard not available");
|
|
2847
2847
|
}
|
|
2848
|
-
const Po = () => import("./FileTree-
|
|
2848
|
+
const Po = () => import("./FileTree-zGmxifl_.js").then((e) => ({ default: e.FileTree }));
|
|
2849
2849
|
function Mc() {
|
|
2850
2850
|
Po();
|
|
2851
2851
|
}
|
|
@@ -2887,13 +2887,13 @@ function cr({
|
|
|
2887
2887
|
className: i
|
|
2888
2888
|
}) {
|
|
2889
2889
|
var ve;
|
|
2890
|
-
const s = Je(), { data: l, error: a, isLoading: d } =
|
|
2890
|
+
const s = Je(), { data: l, error: a, isLoading: d } = wo(e), [c, f] = U(/* @__PURE__ */ new Map()), [p, h] = U(/* @__PURE__ */ new Set()), m = cn(e), g = Y(
|
|
2891
2891
|
() => un(ln(l, c.get(m)), p),
|
|
2892
2892
|
[l, c, m, p]
|
|
2893
2893
|
), b = Y(
|
|
2894
2894
|
() => Lc(g, o),
|
|
2895
2895
|
[g, o]
|
|
2896
|
-
), { mutateAsync:
|
|
2896
|
+
), { mutateAsync: y } = yo(), { mutateAsync: $ } = oc(), { mutateAsync: A } = ic(), { mutateAsync: x } = sc(), [_, w] = U(/* @__PURE__ */ new Map()), v = Y(() => {
|
|
2897
2897
|
if (c.size === 0 && p.size === 0) return _;
|
|
2898
2898
|
const S = /* @__PURE__ */ new Map();
|
|
2899
2899
|
for (const [P, N] of _)
|
|
@@ -2904,29 +2904,29 @@ function cr({
|
|
|
2904
2904
|
V && S.set(P, V);
|
|
2905
2905
|
}
|
|
2906
2906
|
return S;
|
|
2907
|
-
}, [_, c, m, p]), W = O(null), [D, H] = U(400), [
|
|
2907
|
+
}, [_, c, m, p]), W = O(null), [D, H] = U(400), [E, F] = U(null), R = E && !E.isBackground && E.node.kind === "file" ? E.node.path : null, { data: j } = nc(R), [B, G] = U(null), de = O(null), [oe, se] = U(
|
|
2908
2908
|
((ve = n == null ? void 0 : n.getActiveFile) == null ? void 0 : ve.call(n)) ?? null
|
|
2909
2909
|
), [ee, be] = U(null), [xe, ze] = U(null), le = O(0), he = O(0), Ae = O(0), je = ((t == null ? void 0 : t.trim().length) ?? 0) > 0, { data: Le } = rc(
|
|
2910
2910
|
je ? xo(t ?? "") : "",
|
|
2911
2911
|
50
|
|
2912
2912
|
);
|
|
2913
2913
|
L(() => {
|
|
2914
|
-
if (!
|
|
2914
|
+
if (!E) return;
|
|
2915
2915
|
function S(P) {
|
|
2916
2916
|
de.current && !de.current.contains(P.target) && F(null);
|
|
2917
2917
|
}
|
|
2918
2918
|
return document.addEventListener("pointerdown", S), () => document.removeEventListener("pointerdown", S);
|
|
2919
|
-
}, [
|
|
2920
|
-
if (!
|
|
2919
|
+
}, [E]), Bn(() => {
|
|
2920
|
+
if (!E || !de.current) return;
|
|
2921
2921
|
const { x: S, y: P } = jc(
|
|
2922
|
-
|
|
2923
|
-
|
|
2922
|
+
E.x,
|
|
2923
|
+
E.y,
|
|
2924
2924
|
de.current.getBoundingClientRect(),
|
|
2925
2925
|
window.innerWidth,
|
|
2926
2926
|
window.innerHeight
|
|
2927
2927
|
);
|
|
2928
|
-
S ===
|
|
2929
|
-
}, [
|
|
2928
|
+
S === E.x && P === E.y || F((N) => !N || N.x === S && N.y === P ? N : { ...N, x: S, y: P });
|
|
2929
|
+
}, [E]), L(() => {
|
|
2930
2930
|
const S = W.current;
|
|
2931
2931
|
if (!S) return;
|
|
2932
2932
|
const P = new ResizeObserver(([N]) => {
|
|
@@ -2947,7 +2947,7 @@ function cr({
|
|
|
2947
2947
|
async (S) => {
|
|
2948
2948
|
try {
|
|
2949
2949
|
const P = await s.getTree(S), N = o.length === 0 ? P : P.filter((V) => !Cn(V.name, o));
|
|
2950
|
-
|
|
2950
|
+
w((V) => new Map(V).set(S, N));
|
|
2951
2951
|
} catch {
|
|
2952
2952
|
}
|
|
2953
2953
|
},
|
|
@@ -2968,7 +2968,7 @@ function cr({
|
|
|
2968
2968
|
}
|
|
2969
2969
|
})
|
|
2970
2970
|
);
|
|
2971
|
-
|
|
2971
|
+
w((q) => {
|
|
2972
2972
|
const ie = new Map(q);
|
|
2973
2973
|
for (const ce of V) {
|
|
2974
2974
|
if (!ce) continue;
|
|
@@ -2990,11 +2990,11 @@ function cr({
|
|
|
2990
2990
|
S.delete(Ie), Z(ce);
|
|
2991
2991
|
}, zc);
|
|
2992
2992
|
S.add(Ie);
|
|
2993
|
-
}, V = X.on(
|
|
2993
|
+
}, V = X.on(ne.created, (ce) => {
|
|
2994
2994
|
ce.cause !== "user" && N(P([ce.path]));
|
|
2995
|
-
}), q = X.on(
|
|
2995
|
+
}), q = X.on(ne.deleted, (ce) => {
|
|
2996
2996
|
ce.cause !== "user" && N(P([ce.path]));
|
|
2997
|
-
}), ie = X.on(
|
|
2997
|
+
}), ie = X.on(ne.moved, (ce) => {
|
|
2998
2998
|
ce.cause !== "user" && N(P([ce.from, ce.to]));
|
|
2999
2999
|
});
|
|
3000
3000
|
return () => {
|
|
@@ -3070,13 +3070,13 @@ function cr({
|
|
|
3070
3070
|
});
|
|
3071
3071
|
}, []);
|
|
3072
3072
|
L(() => {
|
|
3073
|
-
const S = (q) => q === m || fe.current.has(q), P = X.on(
|
|
3073
|
+
const S = (q) => q === m || fe.current.has(q), P = X.on(ne.created, (q) => {
|
|
3074
3074
|
if (Te(q.path), q.cause === "user") return;
|
|
3075
3075
|
const ie = Re(q.path);
|
|
3076
3076
|
S(ie) && Fe(ie, { name: Bc(q.path), kind: q.kind, path: q.path });
|
|
3077
|
-
}), N = X.on(
|
|
3077
|
+
}), N = X.on(ne.deleted, (q) => {
|
|
3078
3078
|
q.cause !== "user" && (ct(q.path), ke(Re(q.path), q.path));
|
|
3079
|
-
}), V = X.on(
|
|
3079
|
+
}), V = X.on(ne.moved, (q) => {
|
|
3080
3080
|
q.cause !== "user" && (ct(q.from), Te(q.to), ke(Re(q.from), q.from));
|
|
3081
3081
|
});
|
|
3082
3082
|
return () => {
|
|
@@ -3129,7 +3129,7 @@ function cr({
|
|
|
3129
3129
|
},
|
|
3130
3130
|
[A, Z, e, Me, Oe]
|
|
3131
3131
|
);
|
|
3132
|
-
function
|
|
3132
|
+
function yt(S) {
|
|
3133
3133
|
return () => {
|
|
3134
3134
|
F(null), (async () => {
|
|
3135
3135
|
try {
|
|
@@ -3144,12 +3144,12 @@ function cr({
|
|
|
3144
3144
|
};
|
|
3145
3145
|
}
|
|
3146
3146
|
const At = (S) => {
|
|
3147
|
-
const P =
|
|
3147
|
+
const P = E == null ? void 0 : E.node;
|
|
3148
3148
|
F(null);
|
|
3149
3149
|
const N = (P == null ? void 0 : P.kind) === "dir" ? P.path : P ? Re(P.path) : e, V = `__draft__:${++Ae.current}`;
|
|
3150
3150
|
be({ kind: S, parentDir: N, path: V });
|
|
3151
3151
|
}, jn = () => At("create-file"), bt = () => At("create-folder"), k = () => {
|
|
3152
|
-
const S =
|
|
3152
|
+
const S = E == null ? void 0 : E.node;
|
|
3153
3153
|
F(null), S && be({ kind: "rename", path: S.path, initialValue: S.name });
|
|
3154
3154
|
}, T = I(
|
|
3155
3155
|
async (S, P) => {
|
|
@@ -3173,7 +3173,7 @@ function cr({
|
|
|
3173
3173
|
kind: N.kind === "create-file" ? "file" : "dir",
|
|
3174
3174
|
path: ie
|
|
3175
3175
|
};
|
|
3176
|
-
Fe(q, qe), Ie = ie, N.kind === "create-file" ? (await
|
|
3176
|
+
Fe(q, qe), Ie = ie, N.kind === "create-file" ? (await y({ path: ie, content: "", returnMtimeMs: !1 }), X.emit(ne.created, {
|
|
3177
3177
|
...dt(),
|
|
3178
3178
|
path: ie,
|
|
3179
3179
|
kind: "file"
|
|
@@ -3193,7 +3193,7 @@ function cr({
|
|
|
3193
3193
|
[
|
|
3194
3194
|
ee,
|
|
3195
3195
|
A,
|
|
3196
|
-
|
|
3196
|
+
y,
|
|
3197
3197
|
$,
|
|
3198
3198
|
Z,
|
|
3199
3199
|
Me,
|
|
@@ -3204,9 +3204,9 @@ function cr({
|
|
|
3204
3204
|
]
|
|
3205
3205
|
), M = I(() => {
|
|
3206
3206
|
be(null);
|
|
3207
|
-
}, []), J =
|
|
3208
|
-
|
|
3209
|
-
}), ge =
|
|
3207
|
+
}, []), J = yt(async () => {
|
|
3208
|
+
E != null && E.node && (await sr(E.node.path), He.success({ title: "Path copied", description: E.node.path }));
|
|
3209
|
+
}), ge = yt(async () => {
|
|
3210
3210
|
if (!(j != null && j.enabled) || !j.url)
|
|
3211
3211
|
throw new Error((j == null ? void 0 : j.reason) ?? "Git URL unavailable");
|
|
3212
3212
|
await sr(j.url), He.success({ title: "Git URL copied", description: j.url });
|
|
@@ -3215,7 +3215,7 @@ function cr({
|
|
|
3215
3215
|
const S = B;
|
|
3216
3216
|
G(null), Me(S.path);
|
|
3217
3217
|
try {
|
|
3218
|
-
await x({ path: S.path }), ke(Re(S.path), S.path), S.kind === "dir" &&
|
|
3218
|
+
await x({ path: S.path }), ke(Re(S.path), S.path), S.kind === "dir" && w((P) => {
|
|
3219
3219
|
const N = new Map(P);
|
|
3220
3220
|
for (const V of N.keys())
|
|
3221
3221
|
(V === S.path || V.startsWith(`${S.path}/`)) && N.delete(V);
|
|
@@ -3237,7 +3237,7 @@ function cr({
|
|
|
3237
3237
|
Oe,
|
|
3238
3238
|
ke
|
|
3239
3239
|
]), Ee = !je && ((t == null ? void 0 : t.length) ?? 0) > 0 ? t : void 0;
|
|
3240
|
-
return /* @__PURE__ */
|
|
3240
|
+
return /* @__PURE__ */ C("div", { className: "flex h-full min-h-0 flex-col", children: [
|
|
3241
3241
|
a && /* @__PURE__ */ u(
|
|
3242
3242
|
vt,
|
|
3243
3243
|
{
|
|
@@ -3262,7 +3262,7 @@ function cr({
|
|
|
3262
3262
|
)) }) : /* @__PURE__ */ u(
|
|
3263
3263
|
Gt,
|
|
3264
3264
|
{
|
|
3265
|
-
fallback: /* @__PURE__ */
|
|
3265
|
+
fallback: /* @__PURE__ */ C("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
|
|
3266
3266
|
/* @__PURE__ */ u(Kt, { className: "size-3.5" }),
|
|
3267
3267
|
/* @__PURE__ */ u("span", { children: "Loading..." })
|
|
3268
3268
|
] }),
|
|
@@ -3287,25 +3287,25 @@ function cr({
|
|
|
3287
3287
|
onCancelEdit: M,
|
|
3288
3288
|
onDragDrop: sn,
|
|
3289
3289
|
height: D,
|
|
3290
|
-
className:
|
|
3290
|
+
className: te(i)
|
|
3291
3291
|
}
|
|
3292
3292
|
)
|
|
3293
3293
|
}
|
|
3294
3294
|
)
|
|
3295
3295
|
}
|
|
3296
3296
|
),
|
|
3297
|
-
|
|
3298
|
-
/* @__PURE__ */
|
|
3297
|
+
E && Vr(
|
|
3298
|
+
/* @__PURE__ */ C(
|
|
3299
3299
|
"div",
|
|
3300
3300
|
{
|
|
3301
3301
|
ref: de,
|
|
3302
3302
|
role: "menu",
|
|
3303
3303
|
className: "fixed z-50 min-w-[10rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
|
|
3304
|
-
style: { left:
|
|
3304
|
+
style: { left: E.x, top: E.y },
|
|
3305
3305
|
children: [
|
|
3306
3306
|
/* @__PURE__ */ u(Ke, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: jn, children: "New file" }),
|
|
3307
3307
|
/* @__PURE__ */ u(Ke, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: bt, children: "New folder" }),
|
|
3308
|
-
!
|
|
3308
|
+
!E.isBackground && /* @__PURE__ */ C(et, { children: [
|
|
3309
3309
|
/* @__PURE__ */ u(Ke, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: k, children: "Rename" }),
|
|
3310
3310
|
/* @__PURE__ */ u(
|
|
3311
3311
|
Ke,
|
|
@@ -3316,7 +3316,7 @@ function cr({
|
|
|
3316
3316
|
size: "sm",
|
|
3317
3317
|
className: "w-full justify-start text-destructive hover:bg-destructive/10 hover:text-destructive",
|
|
3318
3318
|
onClick: () => {
|
|
3319
|
-
G(
|
|
3319
|
+
G(E.node), F(null);
|
|
3320
3320
|
},
|
|
3321
3321
|
children: "Delete"
|
|
3322
3322
|
}
|
|
@@ -3340,16 +3340,16 @@ function cr({
|
|
|
3340
3340
|
onOpenChange: (S) => {
|
|
3341
3341
|
S || G(null);
|
|
3342
3342
|
},
|
|
3343
|
-
children: /* @__PURE__ */
|
|
3344
|
-
/* @__PURE__ */
|
|
3345
|
-
/* @__PURE__ */
|
|
3343
|
+
children: /* @__PURE__ */ C(Ni, { children: [
|
|
3344
|
+
/* @__PURE__ */ C(Ti, { children: [
|
|
3345
|
+
/* @__PURE__ */ C(Ai, { children: [
|
|
3346
3346
|
"Delete ",
|
|
3347
3347
|
B == null ? void 0 : B.name,
|
|
3348
3348
|
"?"
|
|
3349
3349
|
] }),
|
|
3350
3350
|
/* @__PURE__ */ u(Di, { children: "This action cannot be undone." })
|
|
3351
3351
|
] }),
|
|
3352
|
-
/* @__PURE__ */
|
|
3352
|
+
/* @__PURE__ */ C(Oi, { children: [
|
|
3353
3353
|
/* @__PURE__ */ u(_i, { children: "Cancel" }),
|
|
3354
3354
|
/* @__PURE__ */ u($i, { onClick: pe, children: "Delete" })
|
|
3355
3355
|
] })
|
|
@@ -3368,8 +3368,8 @@ function Uc({
|
|
|
3368
3368
|
chromeless: s = !1,
|
|
3369
3369
|
className: l
|
|
3370
3370
|
}) {
|
|
3371
|
-
const a = (e == null ? void 0 : e.rootDir) ?? t, d = (e == null ? void 0 : e.bridge) ?? o, c = (e == null ? void 0 : e.chromeless) ?? s, f = (e == null ? void 0 : e.revealFileTreeRequest) ?? null, p = (e == null ? void 0 : e.searchQuery) ?? (e == null ? void 0 : e.query) ?? n, h = r ?? i, [m, g] = U(""), [b,
|
|
3372
|
-
L(() => (clearTimeout($.current), $.current = setTimeout(() =>
|
|
3371
|
+
const a = (e == null ? void 0 : e.rootDir) ?? t, d = (e == null ? void 0 : e.bridge) ?? o, c = (e == null ? void 0 : e.chromeless) ?? s, f = (e == null ? void 0 : e.revealFileTreeRequest) ?? null, p = (e == null ? void 0 : e.searchQuery) ?? (e == null ? void 0 : e.query) ?? n, h = r ?? i, [m, g] = U(""), [b, y] = U(""), $ = O(void 0);
|
|
3372
|
+
L(() => (clearTimeout($.current), $.current = setTimeout(() => y(m), 200), () => clearTimeout($.current)), [m]);
|
|
3373
3373
|
const A = p !== void 0 ? p || void 0 : b || void 0;
|
|
3374
3374
|
return c ? /* @__PURE__ */ u(
|
|
3375
3375
|
cr,
|
|
@@ -3378,9 +3378,9 @@ function Uc({
|
|
|
3378
3378
|
searchQuery: A,
|
|
3379
3379
|
bridge: d,
|
|
3380
3380
|
revealFileTreeRequest: f,
|
|
3381
|
-
className:
|
|
3381
|
+
className: te("px-1 pt-1 [&_[role=treeitem]]:!indent-0", l)
|
|
3382
3382
|
}
|
|
3383
|
-
) : /* @__PURE__ */ u(_c, { title: "Files", panelApi: h, children: /* @__PURE__ */
|
|
3383
|
+
) : /* @__PURE__ */ u(_c, { title: "Files", panelApi: h, children: /* @__PURE__ */ C("div", { className: "flex h-full flex-col", children: [
|
|
3384
3384
|
/* @__PURE__ */ u("div", { className: "border-b border-border px-2 py-1.5", children: /* @__PURE__ */ u(
|
|
3385
3385
|
qr,
|
|
3386
3386
|
{
|
|
@@ -3408,14 +3408,14 @@ function qc(e) {
|
|
|
3408
3408
|
}
|
|
3409
3409
|
function Hc() {
|
|
3410
3410
|
return L(() => {
|
|
3411
|
-
const e = X.on(
|
|
3411
|
+
const e = X.on(ne.moved, ({ from: n, to: r, ...o }) => {
|
|
3412
3412
|
X.emit($e.panelUpdate, {
|
|
3413
3413
|
...o,
|
|
3414
3414
|
match: [{ id: `file:${n}` }, { param: "path", value: n }],
|
|
3415
3415
|
params: { path: r },
|
|
3416
3416
|
title: qc(r)
|
|
3417
3417
|
});
|
|
3418
|
-
}), t = X.on(
|
|
3418
|
+
}), t = X.on(ne.deleted, ({ path: n, ...r }) => {
|
|
3419
3419
|
X.emit($e.panelClose, {
|
|
3420
3420
|
...r,
|
|
3421
3421
|
match: [
|
|
@@ -3449,41 +3449,41 @@ function Vc(e) {
|
|
|
3449
3449
|
function Kc(e) {
|
|
3450
3450
|
const t = Vc(e);
|
|
3451
3451
|
if (!t) return;
|
|
3452
|
-
const n =
|
|
3452
|
+
const n = ya(t.toolCallId);
|
|
3453
3453
|
switch (t.op) {
|
|
3454
3454
|
case "rename":
|
|
3455
|
-
t.oldPath && X.emit(
|
|
3455
|
+
t.oldPath && X.emit(ne.moved, {
|
|
3456
3456
|
...n,
|
|
3457
3457
|
from: t.oldPath,
|
|
3458
3458
|
to: t.path
|
|
3459
3459
|
});
|
|
3460
3460
|
return;
|
|
3461
3461
|
case "unlink":
|
|
3462
|
-
X.emit(
|
|
3462
|
+
X.emit(ne.deleted, { ...n, path: t.path });
|
|
3463
3463
|
return;
|
|
3464
3464
|
case "mkdir":
|
|
3465
|
-
X.emit(
|
|
3465
|
+
X.emit(ne.created, { ...n, path: t.path, kind: "dir" });
|
|
3466
3466
|
return;
|
|
3467
3467
|
case "write":
|
|
3468
|
-
t.existsBefore === !1 ? X.emit(
|
|
3468
|
+
t.existsBefore === !1 ? X.emit(ne.created, {
|
|
3469
3469
|
...n,
|
|
3470
3470
|
path: t.path,
|
|
3471
3471
|
kind: "file"
|
|
3472
|
-
}) : X.emit(
|
|
3472
|
+
}) : X.emit(ne.changed, { ...n, path: t.path });
|
|
3473
3473
|
return;
|
|
3474
3474
|
case "edit":
|
|
3475
|
-
X.emit(
|
|
3475
|
+
X.emit(ne.changed, { ...n, path: t.path });
|
|
3476
3476
|
return;
|
|
3477
3477
|
}
|
|
3478
3478
|
}
|
|
3479
3479
|
function Jc(e, t = {}) {
|
|
3480
3480
|
const { skip: n, filesOnly: r = !0 } = t;
|
|
3481
|
-
Sn(
|
|
3481
|
+
Sn(ne.created, (o) => {
|
|
3482
3482
|
o.cause === "agent" && (r && o.kind !== "file" || n != null && n(o.path) || e(o.path));
|
|
3483
3483
|
});
|
|
3484
3484
|
}
|
|
3485
3485
|
function Kf(e) {
|
|
3486
|
-
return X.on(
|
|
3486
|
+
return X.on(ne.changed, e);
|
|
3487
3487
|
}
|
|
3488
3488
|
function Yc() {
|
|
3489
3489
|
return L(() => X.on($e.agentData, ({ part: e }) => {
|
|
@@ -3494,14 +3494,14 @@ function Yc() {
|
|
|
3494
3494
|
}
|
|
3495
3495
|
const Xc = 250, Qc = 3e3, Zc = 3e4;
|
|
3496
3496
|
function el(e, t) {
|
|
3497
|
-
const { adapter: n, panelId: r, onDirtyChange: o, serverMtime: i } = t, [s, l] = U(!1), [a, d] = U(!1), [c, f] = U(null), [p, h] = U(!1), [m, g] = U(!1), b = O(void 0),
|
|
3498
|
-
|
|
3497
|
+
const { adapter: n, panelId: r, onDirtyChange: o, serverMtime: i } = t, [s, l] = U(!1), [a, d] = U(!1), [c, f] = U(null), [p, h] = U(!1), [m, g] = U(!1), b = O(void 0), y = O(null), $ = O(0), A = O(null), x = O(0), _ = O(void 0), w = O(o);
|
|
3498
|
+
w.current = o;
|
|
3499
3499
|
const v = O(n);
|
|
3500
3500
|
v.current = n;
|
|
3501
3501
|
const W = I(async () => {
|
|
3502
3502
|
const G = v.current;
|
|
3503
3503
|
if (!G || !e || !G.isDirty()) return;
|
|
3504
|
-
if (
|
|
3504
|
+
if (y.current) return y.current;
|
|
3505
3505
|
const de = x.current;
|
|
3506
3506
|
let oe = null;
|
|
3507
3507
|
return oe = (async () => {
|
|
@@ -3517,25 +3517,25 @@ function el(e, t) {
|
|
|
3517
3517
|
ee
|
|
3518
3518
|
]);
|
|
3519
3519
|
if (x.current !== de) return;
|
|
3520
|
-
xe === "saved" && ($.current = Date.now(), f(Date.now()), l(!1), (be =
|
|
3520
|
+
xe === "saved" && ($.current = Date.now(), f(Date.now()), l(!1), (be = w.current) == null || be.call(w, e, !1));
|
|
3521
3521
|
} catch {
|
|
3522
3522
|
if (x.current !== de) return;
|
|
3523
3523
|
} finally {
|
|
3524
|
-
if (se && clearTimeout(se),
|
|
3524
|
+
if (se && clearTimeout(se), y.current === oe && (y.current = null), x.current !== de) return;
|
|
3525
3525
|
X.emit($e.editorSaveEnd, { panelId: r }), d(!1);
|
|
3526
3526
|
}
|
|
3527
|
-
})(),
|
|
3527
|
+
})(), y.current = oe, oe;
|
|
3528
3528
|
}, [e, r]), D = I(() => {
|
|
3529
3529
|
clearTimeout(b.current), b.current = setTimeout(W, Xc);
|
|
3530
3530
|
}, [W]), H = I(() => {
|
|
3531
3531
|
var G;
|
|
3532
|
-
e && (l(!0), (G =
|
|
3533
|
-
}, [e, D]),
|
|
3532
|
+
e && (l(!0), (G = w.current) == null || G.call(w, e, !0), D());
|
|
3533
|
+
}, [e, D]), E = I(() => {
|
|
3534
3534
|
var G;
|
|
3535
|
-
clearTimeout(b.current), l(!1), g(!1), e && ((G =
|
|
3535
|
+
clearTimeout(b.current), l(!1), g(!1), e && ((G = w.current) == null || G.call(w, e, !1));
|
|
3536
3536
|
}, [e]), F = I(async () => {
|
|
3537
3537
|
var G;
|
|
3538
|
-
if (clearTimeout(b.current),
|
|
3538
|
+
if (clearTimeout(b.current), y.current) return y.current;
|
|
3539
3539
|
if ((G = v.current) != null && G.isDirty())
|
|
3540
3540
|
return W();
|
|
3541
3541
|
}, [W]), R = I(() => h(!1), []), j = I(() => g(!1), []), B = I((G) => {
|
|
@@ -3560,13 +3560,13 @@ function el(e, t) {
|
|
|
3560
3560
|
_.current = e;
|
|
3561
3561
|
return;
|
|
3562
3562
|
}
|
|
3563
|
-
_.current !== e && (_.current = e, x.current += 1, clearTimeout(b.current),
|
|
3563
|
+
_.current !== e && (_.current = e, x.current += 1, clearTimeout(b.current), y.current && X.emit($e.editorSaveEnd, { panelId: r }), y.current = null, A.current = null, $.current = 0, l(!1), d(!1), h(!1), g(!1));
|
|
3564
3564
|
}, [e]), L(() => () => clearTimeout(b.current), []), {
|
|
3565
3565
|
isDirty: s,
|
|
3566
3566
|
isSaving: a,
|
|
3567
3567
|
lastSavedAt: c,
|
|
3568
3568
|
markDirty: H,
|
|
3569
|
-
markClean:
|
|
3569
|
+
markClean: E,
|
|
3570
3570
|
flushSave: F,
|
|
3571
3571
|
shouldSync: p,
|
|
3572
3572
|
ackSync: R,
|
|
@@ -3607,14 +3607,14 @@ function Jf(e) {
|
|
|
3607
3607
|
}
|
|
3608
3608
|
let rl = 0;
|
|
3609
3609
|
function Io(e) {
|
|
3610
|
-
const { path: t, panelId: n, initialContent: r = null, createIfMissing: o } = e, i = /\S/.test(t) ? t : null, s = O(n ?? `file-pane:${rl++}`), l = n ?? s.current, a = o === void 0 ? void 0 : { createIfMissing: o }, { data: d, isLoading: c, error: f, refetch: p } = tc(i, a), { mutateAsync: h } =
|
|
3610
|
+
const { path: t, panelId: n, initialContent: r = null, createIfMissing: o } = e, i = /\S/.test(t) ? t : null, s = O(n ?? `file-pane:${rl++}`), l = n ?? s.current, a = o === void 0 ? void 0 : { createIfMissing: o }, { data: d, isLoading: c, error: f, refetch: p } = tc(i, a), { mutateAsync: h } = yo(), [m, g] = U(r), b = O(""), y = O(!1), $ = O(null), A = O(null), x = O(null), _ = O(0), [w, v] = U(null);
|
|
3611
3611
|
L(() => {
|
|
3612
|
-
$.current !== t && (g(r), b.current = r ?? "",
|
|
3612
|
+
$.current !== t && (g(r), b.current = r ?? "", y.current = !1, A.current = null, _.current += 1, v(null), $.current = t);
|
|
3613
3613
|
}, [t, r]), L(() => {
|
|
3614
3614
|
(d == null ? void 0 : d.content) != null && m === null && (g(d.content), b.current = d.content, A.current = d.mtimeMs ?? null);
|
|
3615
3615
|
}, [d, m]);
|
|
3616
3616
|
const W = i && m != null ? {
|
|
3617
|
-
isDirty: () =>
|
|
3617
|
+
isDirty: () => y.current,
|
|
3618
3618
|
save: async () => {
|
|
3619
3619
|
var se;
|
|
3620
3620
|
const oe = ++_.current;
|
|
@@ -3625,7 +3625,7 @@ function Io(e) {
|
|
|
3625
3625
|
expectedMtimeMs: A.current ?? void 0
|
|
3626
3626
|
});
|
|
3627
3627
|
if (_.current !== oe) return;
|
|
3628
|
-
typeof ee.mtimeMs == "number" && (A.current = ee.mtimeMs, (se = x.current) == null || se.call(x, ee.mtimeMs)),
|
|
3628
|
+
typeof ee.mtimeMs == "number" && (A.current = ee.mtimeMs, (se = x.current) == null || se.call(x, ee.mtimeMs)), y.current = !1, v(null);
|
|
3629
3629
|
} catch (ee) {
|
|
3630
3630
|
throw _.current !== oe || ee instanceof It && (typeof ee.currentMtimeMs == "number" && (A.current = ee.currentMtimeMs), v(ee)), ee;
|
|
3631
3631
|
}
|
|
@@ -3638,29 +3638,29 @@ function Io(e) {
|
|
|
3638
3638
|
});
|
|
3639
3639
|
x.current = D.notifySaved, L(() => {
|
|
3640
3640
|
if (!(!D.shouldSync || (d == null ? void 0 : d.content) == null)) {
|
|
3641
|
-
if (
|
|
3641
|
+
if (y.current) {
|
|
3642
3642
|
D.ackSync();
|
|
3643
3643
|
return;
|
|
3644
3644
|
}
|
|
3645
|
-
g(d.content), b.current = d.content, A.current = d.mtimeMs ?? null,
|
|
3645
|
+
g(d.content), b.current = d.content, A.current = d.mtimeMs ?? null, y.current = !1, D.ackSync();
|
|
3646
3646
|
}
|
|
3647
3647
|
}, [D.shouldSync, D, d, g]), L(() => {
|
|
3648
3648
|
!D.externalChangeWhileDirty || (d == null ? void 0 : d.mtimeMs) == null || (v(new It(i ?? t, d.mtimeMs, A.current)), A.current = d.mtimeMs, D.ackExternalChange());
|
|
3649
3649
|
}, [i, D.externalChangeWhileDirty, D, d, t]);
|
|
3650
|
-
const H = i ? i.split("/").pop() ?? i : "", [
|
|
3650
|
+
const H = i ? i.split("/").pop() ?? i : "", [E, F] = U("");
|
|
3651
3651
|
L(() => {
|
|
3652
3652
|
const oe = H ? D.isDirty ? `${H} ●` : H : "";
|
|
3653
3653
|
F(oe);
|
|
3654
3654
|
}, [H, D.isDirty]);
|
|
3655
3655
|
const R = I((oe) => {
|
|
3656
|
-
g(oe), b.current = oe,
|
|
3656
|
+
g(oe), b.current = oe, y.current = !0, D.markDirty();
|
|
3657
3657
|
}, [g, D]), j = I(async () => {
|
|
3658
3658
|
var ee;
|
|
3659
3659
|
if (!i) return;
|
|
3660
3660
|
const oe = await p();
|
|
3661
3661
|
if (oe.status !== "success" || oe.data == null) return;
|
|
3662
3662
|
const se = oe.data;
|
|
3663
|
-
g(se.content), b.current = se.content, A.current = se.mtimeMs ?? null,
|
|
3663
|
+
g(se.content), b.current = se.content, A.current = se.mtimeMs ?? null, y.current = !1, D.markClean(), typeof se.mtimeMs == "number" && ((ee = x.current) == null || ee.call(x, se.mtimeMs)), v(null);
|
|
3664
3664
|
}, [i, D, p, g]), B = I(async () => {
|
|
3665
3665
|
var se;
|
|
3666
3666
|
const oe = ++_.current;
|
|
@@ -3668,11 +3668,11 @@ function Io(e) {
|
|
|
3668
3668
|
if (!i) return;
|
|
3669
3669
|
const ee = b.current, be = await h({ path: i, content: ee });
|
|
3670
3670
|
if (_.current !== oe) return;
|
|
3671
|
-
typeof be.mtimeMs == "number" && (A.current = be.mtimeMs, (se = x.current) == null || se.call(x, be.mtimeMs)),
|
|
3671
|
+
typeof be.mtimeMs == "number" && (A.current = be.mtimeMs, (se = x.current) == null || se.call(x, be.mtimeMs)), y.current = !1, v(null);
|
|
3672
3672
|
} catch {
|
|
3673
3673
|
}
|
|
3674
3674
|
}, [i, h]), G = I(async () => {
|
|
3675
|
-
!W || !
|
|
3675
|
+
!W || !y.current || await W.save();
|
|
3676
3676
|
}, [W]), de = I(async () => {
|
|
3677
3677
|
await D.flushSave();
|
|
3678
3678
|
}, [D]);
|
|
@@ -3681,14 +3681,14 @@ function Io(e) {
|
|
|
3681
3681
|
error: f,
|
|
3682
3682
|
content: m,
|
|
3683
3683
|
isDirty: D.isDirty,
|
|
3684
|
-
conflict:
|
|
3684
|
+
conflict: w,
|
|
3685
3685
|
onReloadFromServer: j,
|
|
3686
3686
|
onOverwrite: B,
|
|
3687
3687
|
setContent: R,
|
|
3688
3688
|
save: G,
|
|
3689
3689
|
flushSave: de,
|
|
3690
3690
|
fileName: H,
|
|
3691
|
-
tabTitle:
|
|
3691
|
+
tabTitle: E
|
|
3692
3692
|
};
|
|
3693
3693
|
}
|
|
3694
3694
|
function ol({ conflict: e, onReload: t, onOverwrite: n }) {
|
|
@@ -3699,7 +3699,7 @@ function ol({ conflict: e, onReload: t, onOverwrite: n }) {
|
|
|
3699
3699
|
tone: "accent",
|
|
3700
3700
|
className: "rounded-none border-x-0 border-t-0",
|
|
3701
3701
|
description: /* @__PURE__ */ u(et, { children: "This file has been modified outside the editor. Your unsaved changes will be lost if you reload, or will overwrite the latest version on disk if you save." }),
|
|
3702
|
-
actions: /* @__PURE__ */
|
|
3702
|
+
actions: /* @__PURE__ */ C(et, { children: [
|
|
3703
3703
|
/* @__PURE__ */ u(Ke, { type: "button", variant: "outline", size: "xs", onClick: () => void t(), children: "Reload" }),
|
|
3704
3704
|
/* @__PURE__ */ u(
|
|
3705
3705
|
Ke,
|
|
@@ -3735,11 +3735,11 @@ function Ro({
|
|
|
3735
3735
|
return /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(Hr, { className: "min-h-0 border-0", title: "No file selected", description: "Choose a file from the file tree to open an editor." }) });
|
|
3736
3736
|
if (r)
|
|
3737
3737
|
return /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(vt, { title: "Failed to load file", description: f ?? r.message }) });
|
|
3738
|
-
const h = c ?? /* @__PURE__ */
|
|
3738
|
+
const h = c ?? /* @__PURE__ */ C("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
|
|
3739
3739
|
/* @__PURE__ */ u(Kt, { className: "size-3.5" }),
|
|
3740
3740
|
/* @__PURE__ */ u("span", { children: "Loading file..." })
|
|
3741
3741
|
] });
|
|
3742
|
-
return /* @__PURE__ */
|
|
3742
|
+
return /* @__PURE__ */ C("div", { className: `flex h-full min-h-0 flex-col ${p ?? ""}`, children: [
|
|
3743
3743
|
o && /* @__PURE__ */ u(
|
|
3744
3744
|
ol,
|
|
3745
3745
|
{
|
|
@@ -3894,7 +3894,7 @@ function ul({
|
|
|
3894
3894
|
}) {
|
|
3895
3895
|
const l = O(null), a = O(null), d = O(t);
|
|
3896
3896
|
d.current = t;
|
|
3897
|
-
const c = O(!1), f = O(new kt()), p = O(new kt()), h = O(new kt()), m = O(new kt()), g = O(new kt()), b = e.length >= sl,
|
|
3897
|
+
const c = O(!1), f = O(new kt()), p = O(new kt()), h = O(new kt()), m = O(new kt()), g = O(new kt()), b = e.length >= sl, y = e.length >= al, $ = r || b, A = Y(() => {
|
|
3898
3898
|
const x = ll(), _ = [
|
|
3899
3899
|
p.current.of(an.readOnly.of($)),
|
|
3900
3900
|
h.current.of(o ? Hn() : []),
|
|
@@ -3905,22 +3905,22 @@ function ul({
|
|
|
3905
3905
|
hs(),
|
|
3906
3906
|
ms(),
|
|
3907
3907
|
is(),
|
|
3908
|
-
|
|
3908
|
+
ys(),
|
|
3909
3909
|
gs(),
|
|
3910
3910
|
os.of([...ss, ...as, ...vs, ...bs]),
|
|
3911
3911
|
g.current.of(lr()),
|
|
3912
|
-
Kr(
|
|
3912
|
+
Kr(ws, { fallback: !0 })
|
|
3913
3913
|
];
|
|
3914
3914
|
if (b)
|
|
3915
3915
|
_.push(f.current.of([]));
|
|
3916
3916
|
else {
|
|
3917
|
-
const
|
|
3918
|
-
_.push(f.current.of(
|
|
3917
|
+
const w = ur(n);
|
|
3918
|
+
_.push(f.current.of(w ?? []));
|
|
3919
3919
|
}
|
|
3920
3920
|
return _.push(
|
|
3921
|
-
gt.updateListener.of((
|
|
3921
|
+
gt.updateListener.of((w) => {
|
|
3922
3922
|
var v;
|
|
3923
|
-
|
|
3923
|
+
w.docChanged && !c.current && ((v = d.current) == null || v.call(d, w.state.doc.toString()));
|
|
3924
3924
|
})
|
|
3925
3925
|
), _;
|
|
3926
3926
|
}, []);
|
|
@@ -3969,19 +3969,19 @@ function ul({
|
|
|
3969
3969
|
const x = new MutationObserver(() => {
|
|
3970
3970
|
const _ = a.current;
|
|
3971
3971
|
if (!_) return;
|
|
3972
|
-
const
|
|
3972
|
+
const w = document.documentElement.getAttribute("data-theme") === "dark";
|
|
3973
3973
|
_.dispatch({
|
|
3974
|
-
effects: g.current.reconfigure(lr({ dark:
|
|
3974
|
+
effects: g.current.reconfigure(lr({ dark: w }))
|
|
3975
3975
|
});
|
|
3976
3976
|
});
|
|
3977
3977
|
return x.observe(document.documentElement, {
|
|
3978
3978
|
attributes: !0,
|
|
3979
3979
|
attributeFilter: ["data-theme"]
|
|
3980
3980
|
}), () => x.disconnect();
|
|
3981
|
-
}, []), b ? /* @__PURE__ */
|
|
3982
|
-
/* @__PURE__ */
|
|
3981
|
+
}, []), b ? /* @__PURE__ */ C("div", { className: te("flex h-full flex-col", s), children: [
|
|
3982
|
+
/* @__PURE__ */ C("div", { className: "flex items-center gap-2 border-b border-border bg-muted/50 px-3 py-2 text-sm text-muted-foreground", children: [
|
|
3983
3983
|
/* @__PURE__ */ u("span", { children: "Large file — editing disabled" }),
|
|
3984
|
-
|
|
3984
|
+
y && /* @__PURE__ */ u(
|
|
3985
3985
|
Ke,
|
|
3986
3986
|
{
|
|
3987
3987
|
type: "button",
|
|
@@ -3989,8 +3989,8 @@ function ul({
|
|
|
3989
3989
|
size: "xs",
|
|
3990
3990
|
className: "ml-auto",
|
|
3991
3991
|
onClick: () => {
|
|
3992
|
-
const x = new Blob([e], { type: "text/plain" }), _ = URL.createObjectURL(x),
|
|
3993
|
-
|
|
3992
|
+
const x = new Blob([e], { type: "text/plain" }), _ = URL.createObjectURL(x), w = document.createElement("a");
|
|
3993
|
+
w.href = _, w.download = "file.txt", w.click(), URL.revokeObjectURL(_);
|
|
3994
3994
|
},
|
|
3995
3995
|
children: "Download"
|
|
3996
3996
|
}
|
|
@@ -4001,7 +4001,7 @@ function ul({
|
|
|
4001
4001
|
"div",
|
|
4002
4002
|
{
|
|
4003
4003
|
ref: l,
|
|
4004
|
-
className:
|
|
4004
|
+
className: te("h-full overflow-hidden", s)
|
|
4005
4005
|
}
|
|
4006
4006
|
);
|
|
4007
4007
|
}
|
|
@@ -4060,7 +4060,7 @@ function dr({ params: e, api: t, className: n }) {
|
|
|
4060
4060
|
);
|
|
4061
4061
|
}
|
|
4062
4062
|
const fl = Ht(
|
|
4063
|
-
() => import("./MarkdownEditor-
|
|
4063
|
+
() => import("./MarkdownEditor-BykEKKxv.js").then((e) => ({ default: e.MarkdownEditor }))
|
|
4064
4064
|
);
|
|
4065
4065
|
function pl({ params: e, api: t, className: n }) {
|
|
4066
4066
|
const r = typeof (e == null ? void 0 : e.path) == "string" ? e.path : "", o = (e == null ? void 0 : e.mode) === "view", {
|
|
@@ -4109,21 +4109,21 @@ function ml({ path: e, kind: t, reloadKey: n = 0, onReload: r, className: o }) {
|
|
|
4109
4109
|
credentials: "include",
|
|
4110
4110
|
headers: b,
|
|
4111
4111
|
signal: m.signal
|
|
4112
|
-
}).then(async (
|
|
4113
|
-
if (!
|
|
4114
|
-
const $ = await
|
|
4112
|
+
}).then(async (y) => {
|
|
4113
|
+
if (!y.ok) throw new Error(`HTTP ${y.status}`);
|
|
4114
|
+
const $ = await y.blob();
|
|
4115
4115
|
g = URL.createObjectURL($), a(g);
|
|
4116
|
-
}).catch((
|
|
4117
|
-
m.signal.aborted || c(
|
|
4116
|
+
}).catch((y) => {
|
|
4117
|
+
m.signal.aborted || c(y instanceof Error ? y.message : "Failed to load preview");
|
|
4118
4118
|
}).finally(() => {
|
|
4119
4119
|
m.signal.aborted || p(!1);
|
|
4120
4120
|
}), () => {
|
|
4121
4121
|
m.abort(), g && URL.revokeObjectURL(g);
|
|
4122
4122
|
};
|
|
4123
|
-
}, [h, s]), e ? /* @__PURE__ */
|
|
4124
|
-
/* @__PURE__ */
|
|
4123
|
+
}, [h, s]), e ? /* @__PURE__ */ C("div", { className: te("flex h-full min-h-0 flex-col bg-background", o), children: [
|
|
4124
|
+
/* @__PURE__ */ C("div", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border/60 px-3 py-2", children: [
|
|
4125
4125
|
/* @__PURE__ */ u("div", { className: "min-w-0 truncate text-xs font-medium text-muted-foreground", title: e, children: ht(e) }),
|
|
4126
|
-
/* @__PURE__ */
|
|
4126
|
+
/* @__PURE__ */ C("div", { className: "flex items-center gap-1", children: [
|
|
4127
4127
|
/* @__PURE__ */ u(
|
|
4128
4128
|
"button",
|
|
4129
4129
|
{
|
|
@@ -4149,7 +4149,7 @@ function ml({ path: e, kind: t, reloadKey: n = 0, onReload: r, className: o }) {
|
|
|
4149
4149
|
) : null
|
|
4150
4150
|
] })
|
|
4151
4151
|
] }),
|
|
4152
|
-
/* @__PURE__ */ u("div", { className: "flex min-h-0 flex-1 items-center justify-center overflow-auto p-4", children: f ? /* @__PURE__ */
|
|
4152
|
+
/* @__PURE__ */ u("div", { className: "flex min-h-0 flex-1 items-center justify-center overflow-auto p-4", children: f ? /* @__PURE__ */ C("div", { className: "flex items-center justify-center gap-2 text-sm text-muted-foreground", children: [
|
|
4153
4153
|
/* @__PURE__ */ u(Kt, { className: "size-3.5" }),
|
|
4154
4154
|
/* @__PURE__ */ u("span", { children: "Loading preview..." })
|
|
4155
4155
|
] }) : d || !l ? /* @__PURE__ */ u(vt, { title: "Failed to load preview", description: d ?? "Preview unavailable." }) : t === "image" ? /* @__PURE__ */ u(
|
|
@@ -4175,11 +4175,11 @@ function gl({ path: e }) {
|
|
|
4175
4175
|
}, []);
|
|
4176
4176
|
return L(() => {
|
|
4177
4177
|
if (!e) return;
|
|
4178
|
-
const o = X.on(
|
|
4178
|
+
const o = X.on(ne.changed, (l) => {
|
|
4179
4179
|
l.path === e && r();
|
|
4180
|
-
}), i = X.on(
|
|
4180
|
+
}), i = X.on(ne.created, (l) => {
|
|
4181
4181
|
l.kind === "file" && l.path === e && r();
|
|
4182
|
-
}), s = X.on(
|
|
4182
|
+
}), s = X.on(ne.moved, (l) => {
|
|
4183
4183
|
l.to === e && r();
|
|
4184
4184
|
});
|
|
4185
4185
|
return () => {
|
|
@@ -4203,10 +4203,10 @@ function fr({ params: e, className: t }) {
|
|
|
4203
4203
|
}
|
|
4204
4204
|
);
|
|
4205
4205
|
}
|
|
4206
|
-
function
|
|
4206
|
+
function wl(e, t) {
|
|
4207
4207
|
return `${e.replace(/\/$/, "")}${t}`;
|
|
4208
4208
|
}
|
|
4209
|
-
function
|
|
4209
|
+
function yl(e) {
|
|
4210
4210
|
return e.split("/").pop() ?? e;
|
|
4211
4211
|
}
|
|
4212
4212
|
function bl(e) {
|
|
@@ -4239,7 +4239,7 @@ function To(e, t) {
|
|
|
4239
4239
|
}
|
|
4240
4240
|
function Ln(e, t, n) {
|
|
4241
4241
|
const r = new URLSearchParams({ path: t });
|
|
4242
|
-
return n && r.set("workspaceId", n),
|
|
4242
|
+
return n && r.set("workspaceId", n), wl(e, `/api/v1/files/raw?${r.toString()}`);
|
|
4243
4243
|
}
|
|
4244
4244
|
function Rt(e, t, n, r) {
|
|
4245
4245
|
const o = To(t, n);
|
|
@@ -4339,11 +4339,11 @@ function Pl({ path: e, className: t }) {
|
|
|
4339
4339
|
}).finally(() => {
|
|
4340
4340
|
m.signal.aborted || d(!1);
|
|
4341
4341
|
}), () => m.abort();
|
|
4342
|
-
}, [n, e, c, r, f]), e ? a ? /* @__PURE__ */
|
|
4342
|
+
}, [n, e, c, r, f]), e ? a ? /* @__PURE__ */ C("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
|
|
4343
4343
|
/* @__PURE__ */ u(Kt, { className: "size-3.5" }),
|
|
4344
4344
|
/* @__PURE__ */ u("span", { children: "Loading HTML preview..." })
|
|
4345
|
-
] }) : s || o === null ? /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(vt, { title: "Failed to load HTML preview", description: s ?? "Preview unavailable." }) }) : /* @__PURE__ */
|
|
4346
|
-
/* @__PURE__ */ u("div", { className: "flex shrink-0 items-center justify-end gap-3 border-b border-border/60 px-3 py-2", children: /* @__PURE__ */
|
|
4345
|
+
] }) : s || o === null ? /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(vt, { title: "Failed to load HTML preview", description: s ?? "Preview unavailable." }) }) : /* @__PURE__ */ C("div", { className: te("flex h-full min-h-0 flex-col bg-background", t), children: [
|
|
4346
|
+
/* @__PURE__ */ u("div", { className: "flex shrink-0 items-center justify-end gap-3 border-b border-border/60 px-3 py-2", children: /* @__PURE__ */ C("div", { className: "flex items-center gap-1", children: [
|
|
4347
4347
|
/* @__PURE__ */ u(
|
|
4348
4348
|
_e,
|
|
4349
4349
|
{
|
|
@@ -4374,7 +4374,7 @@ function Pl({ path: e, className: t }) {
|
|
|
4374
4374
|
"iframe",
|
|
4375
4375
|
{
|
|
4376
4376
|
srcDoc: o,
|
|
4377
|
-
title:
|
|
4377
|
+
title: yl(e),
|
|
4378
4378
|
sandbox: "allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox",
|
|
4379
4379
|
className: "min-h-0 flex-1 border-0 bg-white"
|
|
4380
4380
|
}
|
|
@@ -4565,7 +4565,7 @@ function _l({
|
|
|
4565
4565
|
function $l() {
|
|
4566
4566
|
return L(() => {
|
|
4567
4567
|
Mc();
|
|
4568
|
-
}, []),
|
|
4568
|
+
}, []), wo("."), null;
|
|
4569
4569
|
}
|
|
4570
4570
|
function Ll() {
|
|
4571
4571
|
const e = Je(), t = Zt();
|
|
@@ -4736,9 +4736,9 @@ function Ze({
|
|
|
4736
4736
|
side: n = "top",
|
|
4737
4737
|
children: r
|
|
4738
4738
|
}) {
|
|
4739
|
-
return /* @__PURE__ */ u(Li, { delayDuration: 0, skipDelayDuration: 300, children: /* @__PURE__ */
|
|
4739
|
+
return /* @__PURE__ */ u(Li, { delayDuration: 0, skipDelayDuration: 300, children: /* @__PURE__ */ C(Fi, { children: [
|
|
4740
4740
|
/* @__PURE__ */ u(Mi, { asChild: !0, children: r }),
|
|
4741
|
-
/* @__PURE__ */
|
|
4741
|
+
/* @__PURE__ */ C(Wi, { side: n, children: [
|
|
4742
4742
|
e,
|
|
4743
4743
|
t ? /* @__PURE__ */ u("span", { className: "ml-1.5 opacity-60", children: t }) : null
|
|
4744
4744
|
] })
|
|
@@ -4758,7 +4758,7 @@ function zl({ componentId: e, params: t, basePath: n }) {
|
|
|
4758
4758
|
return `${i}?${l.toString()}${a}`;
|
|
4759
4759
|
}
|
|
4760
4760
|
function Xf(e) {
|
|
4761
|
-
const t =
|
|
4761
|
+
const t = we(Do);
|
|
4762
4762
|
return Y(() => t ? zl({
|
|
4763
4763
|
componentId: e.componentId,
|
|
4764
4764
|
params: e.params,
|
|
@@ -4766,32 +4766,32 @@ function Xf(e) {
|
|
|
4766
4766
|
}) : null, [t, e.componentId, e.params]);
|
|
4767
4767
|
}
|
|
4768
4768
|
function jl() {
|
|
4769
|
-
return
|
|
4769
|
+
return we(Oo);
|
|
4770
4770
|
}
|
|
4771
4771
|
function Qf() {
|
|
4772
4772
|
return jl() === "full-page";
|
|
4773
4773
|
}
|
|
4774
|
-
const Bl =
|
|
4775
|
-
collapsed:
|
|
4776
|
-
width:
|
|
4777
|
-
}), Hl =
|
|
4778
|
-
root:
|
|
4779
|
-
width:
|
|
4780
|
-
height:
|
|
4781
|
-
orientation:
|
|
4782
|
-
}).passthrough(), Vl =
|
|
4774
|
+
const Bl = re.string().max(64).regex(/^[a-zA-Z0-9_-]+$/), Wt = re.string().max(1024), Ul = re.number().nonnegative(), ql = re.object({
|
|
4775
|
+
collapsed: re.boolean(),
|
|
4776
|
+
width: re.number().int().positive()
|
|
4777
|
+
}), Hl = re.record(Bl, Ul), Gl = re.object({
|
|
4778
|
+
root: re.unknown(),
|
|
4779
|
+
width: re.number().nonnegative().optional(),
|
|
4780
|
+
height: re.number().nonnegative().optional(),
|
|
4781
|
+
orientation: re.number().optional()
|
|
4782
|
+
}).passthrough(), Vl = re.object({
|
|
4783
4783
|
id: Wt,
|
|
4784
4784
|
contentComponent: Wt.optional(),
|
|
4785
4785
|
title: Wt.optional()
|
|
4786
|
-
}).passthrough(), Kl =
|
|
4786
|
+
}).passthrough(), Kl = re.object({
|
|
4787
4787
|
grid: Gl,
|
|
4788
|
-
panels:
|
|
4789
|
-
}).passthrough().nullable(), Jl =
|
|
4788
|
+
panels: re.record(Wt, Vl)
|
|
4789
|
+
}).passthrough().nullable(), Jl = re.object({
|
|
4790
4790
|
layout: Kl,
|
|
4791
4791
|
sidebar: ql,
|
|
4792
4792
|
panelSizes: Hl
|
|
4793
|
-
}), Yl =
|
|
4794
|
-
theme:
|
|
4793
|
+
}), Yl = re.object({
|
|
4794
|
+
theme: re.enum(["light", "dark"])
|
|
4795
4795
|
});
|
|
4796
4796
|
function Xl(e) {
|
|
4797
4797
|
const t = Jl.safeParse(e);
|
|
@@ -4802,9 +4802,9 @@ function Ql(e) {
|
|
|
4802
4802
|
return t.success ? t.data : (console.error("Preferences validation failed:", t.error.issues), null);
|
|
4803
4803
|
}
|
|
4804
4804
|
const gr = 1e5, vr = "2.0";
|
|
4805
|
-
let
|
|
4806
|
-
function
|
|
4807
|
-
if (!
|
|
4805
|
+
let wr = !1, Ct = null;
|
|
4806
|
+
function yr(e, t) {
|
|
4807
|
+
if (!wr)
|
|
4808
4808
|
try {
|
|
4809
4809
|
localStorage.setItem(e, t);
|
|
4810
4810
|
} catch (n) {
|
|
@@ -4813,7 +4813,7 @@ function wr(e, t) {
|
|
|
4813
4813
|
try {
|
|
4814
4814
|
localStorage.setItem(e, t);
|
|
4815
4815
|
} catch {
|
|
4816
|
-
|
|
4816
|
+
wr = !0, console.error(
|
|
4817
4817
|
"localStorage quota exceeded. Persistence disabled for this session."
|
|
4818
4818
|
), Ct == null || Ct();
|
|
4819
4819
|
}
|
|
@@ -4850,7 +4850,7 @@ function _o(e = {}) {
|
|
|
4850
4850
|
setSidebar: (c) => a({ sidebar: { ...d().sidebar, ...c } }),
|
|
4851
4851
|
setPanelSize: (c, f) => a({ panelSizes: { ...d().panelSizes, [c]: f } }),
|
|
4852
4852
|
setTheme: (c) => {
|
|
4853
|
-
a({ preferences: { theme: c } }), r ||
|
|
4853
|
+
a({ preferences: { theme: c } }), r || yr(
|
|
4854
4854
|
n,
|
|
4855
4855
|
JSON.stringify({ state: { theme: c }, version: 0 })
|
|
4856
4856
|
);
|
|
@@ -4931,7 +4931,7 @@ function _o(e = {}) {
|
|
|
4931
4931
|
const c = { ...d, version: vr }, f = JSON.stringify(c);
|
|
4932
4932
|
f.length > gr && console.warn(
|
|
4933
4933
|
`Workspace state serialized to ${f.length} bytes (budget: <${gr})`
|
|
4934
|
-
),
|
|
4934
|
+
), yr(a, f);
|
|
4935
4935
|
},
|
|
4936
4936
|
removeItem: (a) => {
|
|
4937
4937
|
localStorage.removeItem(a);
|
|
@@ -5077,8 +5077,8 @@ function ou({
|
|
|
5077
5077
|
}, m = (g) => {
|
|
5078
5078
|
const b = g.target;
|
|
5079
5079
|
if (!b) return;
|
|
5080
|
-
const
|
|
5081
|
-
|
|
5080
|
+
const y = document.querySelector('[data-slot="dialog-content"]');
|
|
5081
|
+
y && !y.contains(b) && (g.preventDefault(), g.stopPropagation(), t(!1));
|
|
5082
5082
|
};
|
|
5083
5083
|
return window.addEventListener("keydown", h, { capture: !0 }), window.addEventListener("pointerdown", m, { capture: !0 }), () => {
|
|
5084
5084
|
window.removeEventListener("keydown", h, { capture: !0 }), window.removeEventListener("pointerdown", m, { capture: !0 });
|
|
@@ -5260,11 +5260,11 @@ function du({ sessionSearch: e, apiBaseUrl: t, authHeaders: n } = {}) {
|
|
|
5260
5260
|
for (const G of (f == null ? void 0 : f.registeredPlugins) ?? [])
|
|
5261
5261
|
G.label && (B[G.id] = G.label);
|
|
5262
5262
|
return B;
|
|
5263
|
-
}, [f == null ? void 0 : f.registeredPlugins]), g = !!e, b = l === "chats",
|
|
5263
|
+
}, [f == null ? void 0 : f.registeredPlugins]), g = !!e, b = l === "chats", y = l === "catalogs", $ = l === "commands", A = i.trim(), x = iu({
|
|
5264
5264
|
catalogs: h,
|
|
5265
|
-
isCommandMode: !
|
|
5265
|
+
isCommandMode: !y,
|
|
5266
5266
|
searchQuery: A
|
|
5267
|
-
}), { inputRef: _, switchMode:
|
|
5267
|
+
}), { inputRef: _, switchMode: w, handleInputKeyDown: v } = ou({
|
|
5268
5268
|
open: r,
|
|
5269
5269
|
setOpen: o,
|
|
5270
5270
|
mode: l,
|
|
@@ -5278,7 +5278,7 @@ function du({ sessionSearch: e, apiBaseUrl: t, authHeaders: n } = {}) {
|
|
|
5278
5278
|
}
|
|
5279
5279
|
s(B);
|
|
5280
5280
|
}, []), D = Y(() => $ ? eu(c, A) : [], [c, $, A]), H = Y(() => !e || !b ? [] : (e.search ? e.search(e.sessions, A) : cu(e.sessions, A)).slice(0, 8), [b, A, e]), {
|
|
5281
|
-
recentEntries:
|
|
5281
|
+
recentEntries: E,
|
|
5282
5282
|
handleCatalogSelect: F,
|
|
5283
5283
|
handleCommandSelect: R,
|
|
5284
5284
|
handleRecentSelect: j
|
|
@@ -5289,37 +5289,36 @@ function du({ sessionSearch: e, apiBaseUrl: t, authHeaders: n } = {}) {
|
|
|
5289
5289
|
searchQuery: A,
|
|
5290
5290
|
close: () => o(!1)
|
|
5291
5291
|
});
|
|
5292
|
-
return /* @__PURE__ */ u(zi, { open: r, onOpenChange: o, children: /* @__PURE__ */
|
|
5292
|
+
return /* @__PURE__ */ u(zi, { open: r, onOpenChange: o, children: /* @__PURE__ */ C(
|
|
5293
5293
|
ji,
|
|
5294
5294
|
{
|
|
5295
5295
|
className: "cmdk-shell flex flex-col gap-0 overflow-hidden border-border/60 bg-background p-0 shadow-none backdrop-blur-0 [&>button.dialog-close]:hidden",
|
|
5296
5296
|
style: { height: 520, width: "min(640px, calc(100vw - 2rem))", maxWidth: 640 },
|
|
5297
5297
|
showCloseButton: !1,
|
|
5298
|
-
overlayClassName: "bg-transparent",
|
|
5299
5298
|
onPointerDownOutside: () => o(!1),
|
|
5300
5299
|
onEscapeKeyDown: () => o(!1),
|
|
5301
5300
|
children: [
|
|
5302
|
-
/* @__PURE__ */
|
|
5301
|
+
/* @__PURE__ */ C(Bi, { className: "sr-only", children: [
|
|
5303
5302
|
/* @__PURE__ */ u(Ui, { children: "Command Palette" }),
|
|
5304
5303
|
/* @__PURE__ */ u(qi, { children: "Search sources or switch to commands" })
|
|
5305
5304
|
] }),
|
|
5306
|
-
/* @__PURE__ */
|
|
5305
|
+
/* @__PURE__ */ C(Hi, { shouldFilter: !1, className: "flex min-h-0 flex-1 flex-col bg-transparent", children: [
|
|
5307
5306
|
/* @__PURE__ */ u(
|
|
5308
5307
|
fu,
|
|
5309
5308
|
{
|
|
5310
5309
|
inputRef: _,
|
|
5311
5310
|
hasChatMode: g,
|
|
5312
5311
|
isChatMode: b,
|
|
5313
|
-
isCatalogMode:
|
|
5312
|
+
isCatalogMode: y,
|
|
5314
5313
|
isCommandMode: $,
|
|
5315
5314
|
query: i,
|
|
5316
5315
|
onQueryChange: W,
|
|
5317
5316
|
onInputKeyDown: v,
|
|
5318
|
-
onSwitchMode:
|
|
5319
|
-
loading:
|
|
5317
|
+
onSwitchMode: w,
|
|
5318
|
+
loading: y && x.some((B) => B.loading)
|
|
5320
5319
|
}
|
|
5321
5320
|
),
|
|
5322
|
-
/* @__PURE__ */
|
|
5321
|
+
/* @__PURE__ */ C(
|
|
5323
5322
|
Gi,
|
|
5324
5323
|
{
|
|
5325
5324
|
className: "min-h-0 flex-1 overflow-y-auto py-1",
|
|
@@ -5329,8 +5328,8 @@ function du({ sessionSearch: e, apiBaseUrl: t, authHeaders: n } = {}) {
|
|
|
5329
5328
|
/* @__PURE__ */ u(
|
|
5330
5329
|
pu,
|
|
5331
5330
|
{
|
|
5332
|
-
isCatalogMode:
|
|
5333
|
-
recentEntries:
|
|
5331
|
+
isCatalogMode: y,
|
|
5332
|
+
recentEntries: E,
|
|
5334
5333
|
searchQuery: A,
|
|
5335
5334
|
onRecentSelect: j
|
|
5336
5335
|
}
|
|
@@ -5348,7 +5347,7 @@ function du({ sessionSearch: e, apiBaseUrl: t, authHeaders: n } = {}) {
|
|
|
5348
5347
|
mu,
|
|
5349
5348
|
{
|
|
5350
5349
|
catalogGroups: x,
|
|
5351
|
-
isCatalogMode:
|
|
5350
|
+
isCatalogMode: y,
|
|
5352
5351
|
onCatalogSelect: F
|
|
5353
5352
|
}
|
|
5354
5353
|
),
|
|
@@ -5364,7 +5363,7 @@ function du({ sessionSearch: e, apiBaseUrl: t, authHeaders: n } = {}) {
|
|
|
5364
5363
|
]
|
|
5365
5364
|
}
|
|
5366
5365
|
),
|
|
5367
|
-
/* @__PURE__ */ u(
|
|
5366
|
+
/* @__PURE__ */ u(wu, { mode: l })
|
|
5368
5367
|
] })
|
|
5369
5368
|
]
|
|
5370
5369
|
}
|
|
@@ -5382,9 +5381,9 @@ function fu({
|
|
|
5382
5381
|
onSwitchMode: a,
|
|
5383
5382
|
loading: d
|
|
5384
5383
|
}) {
|
|
5385
|
-
return /* @__PURE__ */
|
|
5386
|
-
/* @__PURE__ */
|
|
5387
|
-
/* @__PURE__ */
|
|
5384
|
+
return /* @__PURE__ */ C("div", { className: "relative shrink-0", children: [
|
|
5385
|
+
/* @__PURE__ */ C("div", { className: "relative flex items-stretch [&>[data-slot=command-input-wrapper]]:flex-1 [&>[data-slot=command-input-wrapper]]:h-auto", children: [
|
|
5386
|
+
/* @__PURE__ */ C(
|
|
5388
5387
|
"div",
|
|
5389
5388
|
{
|
|
5390
5389
|
role: "group",
|
|
@@ -5456,10 +5455,10 @@ function pu({
|
|
|
5456
5455
|
value: i,
|
|
5457
5456
|
onSelect: () => r(o),
|
|
5458
5457
|
className: "group flex items-center gap-3 rounded-md px-3 py-2 text-sm aria-selected:bg-[color:oklch(from_var(--accent)_l_c_h/0.10)] aria-selected:text-foreground",
|
|
5459
|
-
children: o.type === "catalog" ? /* @__PURE__ */
|
|
5458
|
+
children: o.type === "catalog" ? /* @__PURE__ */ C(et, { children: [
|
|
5460
5459
|
/* @__PURE__ */ u(mi, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
|
|
5461
5460
|
/* @__PURE__ */ u(jo, { row: o.rowSnapshot })
|
|
5462
|
-
] }) : /* @__PURE__ */
|
|
5461
|
+
] }) : /* @__PURE__ */ C(et, { children: [
|
|
5463
5462
|
/* @__PURE__ */ u(Rn, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
|
|
5464
5463
|
/* @__PURE__ */ u("span", { className: "flex-1 truncate", children: o.titleSnapshot }),
|
|
5465
5464
|
/* @__PURE__ */ u("span", { className: "shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: "command" })
|
|
@@ -5479,7 +5478,7 @@ function hu({
|
|
|
5479
5478
|
const o = new Set(t.openIds ?? []), i = t.activeId ?? null;
|
|
5480
5479
|
return /* @__PURE__ */ u(Jt, { heading: "Chats", children: n.map((s) => {
|
|
5481
5480
|
const l = s.title || "Untitled", a = s.id === i, d = o.has(s.id);
|
|
5482
|
-
return /* @__PURE__ */
|
|
5481
|
+
return /* @__PURE__ */ C(
|
|
5483
5482
|
Nt,
|
|
5484
5483
|
{
|
|
5485
5484
|
value: `chat-session:${s.id}:${l}`,
|
|
@@ -5489,7 +5488,7 @@ function hu({
|
|
|
5489
5488
|
className: "group flex items-center gap-3 rounded-md px-3 py-2 text-sm aria-selected:bg-[color:oklch(from_var(--accent)_l_c_h/0.10)] aria-selected:text-foreground",
|
|
5490
5489
|
children: [
|
|
5491
5490
|
/* @__PURE__ */ u(jr, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
|
|
5492
|
-
/* @__PURE__ */
|
|
5491
|
+
/* @__PURE__ */ C("span", { className: "flex min-w-0 flex-1 items-center gap-2 truncate", children: [
|
|
5493
5492
|
/* @__PURE__ */ u("span", { className: "truncate font-medium text-foreground", children: l }),
|
|
5494
5493
|
a ? /* @__PURE__ */ u("span", { className: "shrink-0 rounded bg-[color:oklch(from_var(--accent)_l_c_h/0.14)] px-1.5 py-0.5 text-[10px] font-medium text-[color:var(--accent)]", children: "active" }) : d ? /* @__PURE__ */ u("span", { className: "shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: "open" }) : null
|
|
5495
5494
|
] }),
|
|
@@ -5523,7 +5522,7 @@ function mu({
|
|
|
5523
5522
|
isCatalogMode: t,
|
|
5524
5523
|
onCatalogSelect: n
|
|
5525
5524
|
}) {
|
|
5526
|
-
return t ? /* @__PURE__ */ u(et, { children: e.filter((r) => r.error || r.rows.length > 0).map((r) => /* @__PURE__ */
|
|
5525
|
+
return t ? /* @__PURE__ */ u(et, { children: e.filter((r) => r.error || r.rows.length > 0).map((r) => /* @__PURE__ */ C(Jt, { heading: r.catalog.label, children: [
|
|
5527
5526
|
r.error ? /* @__PURE__ */ u(gu, { catalogId: r.catalog.id, error: r.error }) : null,
|
|
5528
5527
|
r.rows.map((o) => /* @__PURE__ */ u(
|
|
5529
5528
|
Nt,
|
|
@@ -5531,7 +5530,7 @@ function mu({
|
|
|
5531
5530
|
value: `${r.catalog.id}:${o.id}`,
|
|
5532
5531
|
onSelect: () => n(r.catalog, o),
|
|
5533
5532
|
className: "group flex items-center gap-3 rounded-md px-3 py-2 text-sm aria-selected:bg-[color:oklch(from_var(--accent)_l_c_h/0.10)] aria-selected:text-foreground",
|
|
5534
|
-
children: /* @__PURE__ */
|
|
5533
|
+
children: /* @__PURE__ */ C(
|
|
5535
5534
|
en,
|
|
5536
5535
|
{
|
|
5537
5536
|
pluginId: r.catalog.pluginId ?? r.catalog.id,
|
|
@@ -5549,7 +5548,7 @@ function mu({
|
|
|
5549
5548
|
] }, r.catalog.id)) }) : null;
|
|
5550
5549
|
}
|
|
5551
5550
|
function gu({ catalogId: e, error: t }) {
|
|
5552
|
-
return /* @__PURE__ */
|
|
5551
|
+
return /* @__PURE__ */ C(
|
|
5553
5552
|
Nt,
|
|
5554
5553
|
{
|
|
5555
5554
|
value: `${e}:error`,
|
|
@@ -5568,7 +5567,7 @@ function vu({
|
|
|
5568
5567
|
pluginLabelMap: n,
|
|
5569
5568
|
onCommandSelect: r
|
|
5570
5569
|
}) {
|
|
5571
|
-
return !t || e.length === 0 ? null : /* @__PURE__ */ u(Jt, { heading: "Commands", children: e.map((o) => /* @__PURE__ */
|
|
5570
|
+
return !t || e.length === 0 ? null : /* @__PURE__ */ u(Jt, { heading: "Commands", children: e.map((o) => /* @__PURE__ */ C(
|
|
5572
5571
|
Nt,
|
|
5573
5572
|
{
|
|
5574
5573
|
value: o.title,
|
|
@@ -5584,24 +5583,24 @@ function vu({
|
|
|
5584
5583
|
o.id
|
|
5585
5584
|
)) });
|
|
5586
5585
|
}
|
|
5587
|
-
function
|
|
5588
|
-
return /* @__PURE__ */
|
|
5586
|
+
function wu({ mode: e }) {
|
|
5587
|
+
return /* @__PURE__ */ C("div", { className: "flex items-center justify-between border-t border-border/50 bg-muted/30 px-3 py-2 text-[11px] text-muted-foreground", children: [
|
|
5589
5588
|
/* @__PURE__ */ u("span", { className: "font-medium tracking-wide uppercase", children: e === "commands" ? "Commands" : e === "chats" ? "Chats" : $o }),
|
|
5590
|
-
/* @__PURE__ */
|
|
5591
|
-
/* @__PURE__ */
|
|
5589
|
+
/* @__PURE__ */ C("div", { className: "flex items-center gap-3", children: [
|
|
5590
|
+
/* @__PURE__ */ C("span", { className: "flex items-center gap-1", children: [
|
|
5592
5591
|
/* @__PURE__ */ u(mt, { children: "tab" }),
|
|
5593
5592
|
/* @__PURE__ */ u("span", { children: "switch" })
|
|
5594
5593
|
] }),
|
|
5595
|
-
/* @__PURE__ */
|
|
5594
|
+
/* @__PURE__ */ C("span", { className: "flex items-center gap-1", children: [
|
|
5596
5595
|
/* @__PURE__ */ u(mt, { children: /* @__PURE__ */ u(vi, { className: "size-3" }) }),
|
|
5597
|
-
/* @__PURE__ */ u(mt, { children: /* @__PURE__ */ u(
|
|
5596
|
+
/* @__PURE__ */ u(mt, { children: /* @__PURE__ */ u(wi, { className: "size-3" }) }),
|
|
5598
5597
|
/* @__PURE__ */ u("span", { children: "navigate" })
|
|
5599
5598
|
] }),
|
|
5600
|
-
/* @__PURE__ */
|
|
5601
|
-
/* @__PURE__ */ u(mt, { children: /* @__PURE__ */ u(
|
|
5599
|
+
/* @__PURE__ */ C("span", { className: "flex items-center gap-1", children: [
|
|
5600
|
+
/* @__PURE__ */ u(mt, { children: /* @__PURE__ */ u(yi, { className: "size-3" }) }),
|
|
5602
5601
|
/* @__PURE__ */ u("span", { children: "open" })
|
|
5603
5602
|
] }),
|
|
5604
|
-
/* @__PURE__ */
|
|
5603
|
+
/* @__PURE__ */ C("span", { className: "flex items-center gap-1", children: [
|
|
5605
5604
|
/* @__PURE__ */ u(mt, { children: "esc" }),
|
|
5606
5605
|
/* @__PURE__ */ u("span", { children: "close" })
|
|
5607
5606
|
] })
|
|
@@ -5614,7 +5613,7 @@ function pn({
|
|
|
5614
5613
|
label: n,
|
|
5615
5614
|
onClick: r
|
|
5616
5615
|
}) {
|
|
5617
|
-
return /* @__PURE__ */
|
|
5616
|
+
return /* @__PURE__ */ C(
|
|
5618
5617
|
Ke,
|
|
5619
5618
|
{
|
|
5620
5619
|
type: "button",
|
|
@@ -5634,13 +5633,13 @@ function pn({
|
|
|
5634
5633
|
);
|
|
5635
5634
|
}
|
|
5636
5635
|
function jo({ row: e }) {
|
|
5637
|
-
return /* @__PURE__ */
|
|
5636
|
+
return /* @__PURE__ */ C("span", { className: "flex min-w-0 flex-1 items-baseline gap-2 truncate", children: [
|
|
5638
5637
|
/* @__PURE__ */ u("span", { className: "truncate font-medium text-foreground", children: e.title }),
|
|
5639
5638
|
e.subtitle ? /* @__PURE__ */ u("span", { className: "truncate text-xs text-muted-foreground/70", children: e.subtitle }) : null,
|
|
5640
5639
|
e.meta ? /* @__PURE__ */ u("span", { className: "ml-auto shrink-0 text-xs text-muted-foreground/70", children: e.meta }) : null
|
|
5641
5640
|
] });
|
|
5642
5641
|
}
|
|
5643
|
-
const Zf = ["/api/v1/tree?path=."],
|
|
5642
|
+
const Zf = ["/api/v1/tree?path=."], yu = /* @__PURE__ */ new Set([
|
|
5644
5643
|
"WORKSPACE_NOT_READY",
|
|
5645
5644
|
"AGENT_RUNTIME_NOT_READY",
|
|
5646
5645
|
"RUNTIME_PROVISIONING_LOCKED"
|
|
@@ -5680,7 +5679,7 @@ function xu(e) {
|
|
|
5680
5679
|
}
|
|
5681
5680
|
function rp(e) {
|
|
5682
5681
|
const t = xu(e);
|
|
5683
|
-
if (typeof (t == null ? void 0 : t.code) != "string" || !
|
|
5682
|
+
if (typeof (t == null ? void 0 : t.code) != "string" || !yu.has(t.code) || t.retryable !== !0) return null;
|
|
5684
5683
|
const n = typeof t.requirement == "string" && Su.has(t.requirement) ? t.requirement : void 0;
|
|
5685
5684
|
return n ? { requirement: n } : {};
|
|
5686
5685
|
}
|
|
@@ -5804,8 +5803,8 @@ function Tu(e) {
|
|
|
5804
5803
|
L(() => {
|
|
5805
5804
|
let g = !1;
|
|
5806
5805
|
const b = a ? { "x-boring-workspace-id": a } : {};
|
|
5807
|
-
return fetch(`${l}/api/v1/workspace/meta`, { headers: b }).then((
|
|
5808
|
-
g ||
|
|
5806
|
+
return fetch(`${l}/api/v1/workspace/meta`, { headers: b }).then((y) => y.ok ? y.json() : null).then((y) => {
|
|
5807
|
+
g || y && typeof y.workspaceRoot == "string" && (s.current = y.workspaceRoot);
|
|
5809
5808
|
}).catch(() => {
|
|
5810
5809
|
}), () => {
|
|
5811
5810
|
g = !0;
|
|
@@ -5813,9 +5812,9 @@ function Tu(e) {
|
|
|
5813
5812
|
}, [l, a]);
|
|
5814
5813
|
const d = I(
|
|
5815
5814
|
(g) => {
|
|
5816
|
-
var
|
|
5815
|
+
var y;
|
|
5817
5816
|
const b = bu(g, s.current);
|
|
5818
|
-
r && kn({ kind: "openFile", params: { path: b } }, r), (
|
|
5817
|
+
r && kn({ kind: "openFile", params: { path: b } }, r), (y = e.onOpenArtifact) == null || y.call(e, b);
|
|
5819
5818
|
},
|
|
5820
5819
|
[r, e.onOpenArtifact]
|
|
5821
5820
|
), c = Cr(i.requestHeaders), f = n.filter((g) => !g.sessionId || !i.sessionId || g.sessionId === i.sessionId);
|
|
@@ -5832,14 +5831,14 @@ function Tu(e) {
|
|
|
5832
5831
|
Eu({ sessionId: i.sessionId, reason: Ut.userStop }), (g = e.onComposerStop) == null || g.call(e);
|
|
5833
5832
|
}, [i.sessionId, e.onComposerStop]), h = I(
|
|
5834
5833
|
(g, b) => {
|
|
5835
|
-
const
|
|
5836
|
-
$u({ blockerId: g.id, actionId: b, blocker: g, sessionId:
|
|
5834
|
+
const y = g.sessionId ?? i.sessionId;
|
|
5835
|
+
$u({ blockerId: g.id, actionId: b, blocker: g, sessionId: y }), !(b !== "open" || !g.surfaceKind) && r && kn(
|
|
5837
5836
|
{
|
|
5838
5837
|
kind: "openSurface",
|
|
5839
5838
|
params: {
|
|
5840
5839
|
kind: g.surfaceKind,
|
|
5841
5840
|
target: g.target,
|
|
5842
|
-
meta:
|
|
5841
|
+
meta: y ? { sessionId: y, openOnlyWhenSessionOpen: !0 } : {}
|
|
5843
5842
|
}
|
|
5844
5843
|
},
|
|
5845
5844
|
r
|
|
@@ -5892,7 +5891,7 @@ const Fu = {
|
|
|
5892
5891
|
}
|
|
5893
5892
|
}, Uo = Ne(null);
|
|
5894
5893
|
function qo() {
|
|
5895
|
-
return
|
|
5894
|
+
return we(Uo) ?? Fu;
|
|
5896
5895
|
}
|
|
5897
5896
|
function Mu({ children: e }) {
|
|
5898
5897
|
const [t, n] = U([]), r = I((s) => {
|
|
@@ -6011,8 +6010,8 @@ function qu({
|
|
|
6011
6010
|
renderPane: n,
|
|
6012
6011
|
onActivePaneChange: r,
|
|
6013
6012
|
onClosePane: e.length > 1 ? o : void 0
|
|
6014
|
-
}), [e, h, i, n, r, o]), g = I((
|
|
6015
|
-
const $ =
|
|
6013
|
+
}), [e, h, i, n, r, o]), g = I((y) => {
|
|
6014
|
+
const $ = y.api;
|
|
6016
6015
|
a.current = $;
|
|
6017
6016
|
const { panes: A, activePaneId: x, storageKey: _ } = p.current;
|
|
6018
6017
|
d.current = !0;
|
|
@@ -6027,7 +6026,7 @@ function qu({
|
|
|
6027
6026
|
} finally {
|
|
6028
6027
|
d.current = !1;
|
|
6029
6028
|
}
|
|
6030
|
-
const
|
|
6029
|
+
const w = $.onDidActivePanelChange((F) => {
|
|
6031
6030
|
var j, B;
|
|
6032
6031
|
if (d.current) return;
|
|
6033
6032
|
const R = F == null ? void 0 : F.id;
|
|
@@ -6051,23 +6050,23 @@ function qu({
|
|
|
6051
6050
|
}), (oe = (de = p.current).onDropSession) == null || oe.call(de, R));
|
|
6052
6051
|
});
|
|
6053
6052
|
let H = null;
|
|
6054
|
-
const
|
|
6053
|
+
const E = $.onDidLayoutChange(() => {
|
|
6055
6054
|
const F = p.current.storageKey;
|
|
6056
6055
|
F && (H && clearTimeout(H), H = setTimeout(() => Uu(F, $.toJSON()), zu));
|
|
6057
6056
|
});
|
|
6058
6057
|
c.current = () => {
|
|
6059
|
-
H && clearTimeout(H),
|
|
6058
|
+
H && clearTimeout(H), w.dispose(), v.dispose(), W.dispose(), D.dispose(), E.dispose();
|
|
6060
6059
|
};
|
|
6061
6060
|
}, []);
|
|
6062
6061
|
return L(() => () => {
|
|
6063
|
-
var
|
|
6064
|
-
return (
|
|
6062
|
+
var y;
|
|
6063
|
+
return (y = c.current) == null ? void 0 : y.call(c);
|
|
6065
6064
|
}, []), L(() => {
|
|
6066
|
-
const
|
|
6067
|
-
if (
|
|
6065
|
+
const y = a.current;
|
|
6066
|
+
if (y) {
|
|
6068
6067
|
d.current = !0;
|
|
6069
6068
|
try {
|
|
6070
|
-
Ir(
|
|
6069
|
+
Ir(y, e, h, f.current);
|
|
6071
6070
|
} finally {
|
|
6072
6071
|
d.current = !1;
|
|
6073
6072
|
}
|
|
@@ -6093,7 +6092,7 @@ function qu({
|
|
|
6093
6092
|
) });
|
|
6094
6093
|
}
|
|
6095
6094
|
function Ko() {
|
|
6096
|
-
const e =
|
|
6095
|
+
const e = we(Go);
|
|
6097
6096
|
if (!e) throw new Error("Chat pane components must render inside ChatPaneStageDock");
|
|
6098
6097
|
return e;
|
|
6099
6098
|
}
|
|
@@ -6102,7 +6101,7 @@ function Hu(e) {
|
|
|
6102
6101
|
const t = Ko(), n = typeof ((s = e.params) == null ? void 0 : s.paneId) == "string" ? e.params.paneId : e.api.id, r = t.panes.find((l) => l.id === n);
|
|
6103
6102
|
if (!r) return null;
|
|
6104
6103
|
const o = n === t.activePaneId, i = n === t.flashPaneId;
|
|
6105
|
-
return /* @__PURE__ */
|
|
6104
|
+
return /* @__PURE__ */ C(
|
|
6106
6105
|
"div",
|
|
6107
6106
|
{
|
|
6108
6107
|
"data-boring-workspace-part": "chat-pane",
|
|
@@ -6142,10 +6141,10 @@ function Vu(e) {
|
|
|
6142
6141
|
};
|
|
6143
6142
|
}, [n]);
|
|
6144
6143
|
const i = t.panes.length > 1, s = !!t.onClosePane;
|
|
6145
|
-
return /* @__PURE__ */
|
|
6144
|
+
return /* @__PURE__ */ C(
|
|
6146
6145
|
"div",
|
|
6147
6146
|
{
|
|
6148
|
-
className:
|
|
6147
|
+
className: te(
|
|
6149
6148
|
"group flex h-full w-full min-w-0 select-none items-center gap-1.5 px-2 text-[12px] font-medium leading-none tracking-tight",
|
|
6150
6149
|
i && "cursor-grab active:cursor-grabbing"
|
|
6151
6150
|
),
|
|
@@ -6196,7 +6195,7 @@ function Ku({ dimmed: e, flash: t }) {
|
|
|
6196
6195
|
{
|
|
6197
6196
|
"aria-hidden": "true",
|
|
6198
6197
|
"data-boring-workspace-part": "chat-pane-focus-ring",
|
|
6199
|
-
className:
|
|
6198
|
+
className: te(
|
|
6200
6199
|
"pointer-events-none absolute inset-0 z-30",
|
|
6201
6200
|
"transition-[background-color,box-shadow] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
6202
6201
|
e && !t && "bg-[color:oklch(from_var(--foreground)_l_c_h/0.035)]",
|
|
@@ -6244,9 +6243,9 @@ function Yu(e) {
|
|
|
6244
6243
|
m >= n ? i.push(p) : m >= r ? s.push(p) : m >= o ? l.push(p) : a.push(p);
|
|
6245
6244
|
}
|
|
6246
6245
|
const c = (p, h) => {
|
|
6247
|
-
var b,
|
|
6246
|
+
var b, y;
|
|
6248
6247
|
const m = ((b = zt(p.updatedAt)) == null ? void 0 : b.getTime()) ?? 0;
|
|
6249
|
-
return (((
|
|
6248
|
+
return (((y = zt(h.updatedAt)) == null ? void 0 : y.getTime()) ?? 0) - m;
|
|
6250
6249
|
}, f = [];
|
|
6251
6250
|
return i.length && f.push({ key: "today", label: "Today", items: i.sort(c) }), s.length && f.push({ key: "yesterday", label: "Yesterday", items: s.sort(c) }), l.length && f.push({ key: "week", label: "This week", items: l.sort(c) }), a.length && f.push({ key: "earlier", label: "Earlier", items: a.sort(c) }), d.length && f.push({ key: "undated", label: "Other", items: d }), f;
|
|
6252
6251
|
}
|
|
@@ -6309,17 +6308,17 @@ function ed({
|
|
|
6309
6308
|
const m = Y(() => new Set(n ?? []), [n]), g = Y(() => new Set(r ?? []), [r]), b = Y(
|
|
6310
6309
|
() => (r ?? []).map((R) => e.find((j) => j.id === R)).filter((R) => !!R),
|
|
6311
6310
|
[r, e]
|
|
6312
|
-
),
|
|
6311
|
+
), y = Y(
|
|
6313
6312
|
() => (n ?? []).filter((R) => !g.has(R)).map((R) => e.find((j) => j.id === R)).filter((R) => !!R),
|
|
6314
6313
|
[n, g, e]
|
|
6315
6314
|
), $ = Y(
|
|
6316
6315
|
() => m.size > 0 || g.size > 0 ? e.filter((R) => !m.has(R.id) && !g.has(R.id)) : e,
|
|
6317
6316
|
[m, g, e]
|
|
6318
|
-
), A = Y(() => Yu($), [$]), [x, _] = U(!1), [
|
|
6317
|
+
), A = Y(() => Yu($), [$]), [x, _] = U(!1), [w, v] = U(!1), [W, D] = U(
|
|
6319
6318
|
() => ((n == null ? void 0 : n.length) ?? 0) > 0 || ((r == null ? void 0 : r.length) ?? 0) > 0
|
|
6320
|
-
), H = Ju(), { blockers:
|
|
6319
|
+
), H = Ju(), { blockers: E } = qo(), F = Y(() => {
|
|
6321
6320
|
const R = /* @__PURE__ */ new Map();
|
|
6322
|
-
for (const j of
|
|
6321
|
+
for (const j of E) {
|
|
6323
6322
|
if (!j.sessionId) continue;
|
|
6324
6323
|
const B = Lu(j);
|
|
6325
6324
|
if (!B) continue;
|
|
@@ -6327,32 +6326,32 @@ function ed({
|
|
|
6327
6326
|
(!G || (B.priority ?? 0) > (G.priority ?? 0)) && R.set(j.sessionId, B);
|
|
6328
6327
|
}
|
|
6329
6328
|
return R;
|
|
6330
|
-
}, [
|
|
6331
|
-
return /* @__PURE__ */
|
|
6329
|
+
}, [E]);
|
|
6330
|
+
return /* @__PURE__ */ C(
|
|
6332
6331
|
"div",
|
|
6333
6332
|
{
|
|
6334
6333
|
"data-boring-workspace-part": "session-list",
|
|
6335
|
-
className:
|
|
6334
|
+
className: te(
|
|
6336
6335
|
"flex h-full min-h-0 flex-col bg-[color:oklch(from_var(--background)_calc(l-0.01)_c_h)]",
|
|
6337
6336
|
h
|
|
6338
6337
|
),
|
|
6339
6338
|
role: "navigation",
|
|
6340
6339
|
"aria-label": "Session history",
|
|
6341
6340
|
children: [
|
|
6342
|
-
/* @__PURE__ */
|
|
6341
|
+
/* @__PURE__ */ C("div", { className: "flex h-11 items-center justify-between border-b border-border/60 px-3.5", children: [
|
|
6343
6342
|
/* @__PURE__ */ u("span", { className: "text-[12px] font-medium tracking-tight text-foreground/70", children: "Sessions" }),
|
|
6344
|
-
/* @__PURE__ */
|
|
6343
|
+
/* @__PURE__ */ C("div", { className: "flex items-center gap-0.5", children: [
|
|
6345
6344
|
l && /* @__PURE__ */ u(Ze, { label: "New chat", side: "bottom", children: /* @__PURE__ */ u(_e, { type: "button", variant: "ghost", size: "icon-xs", onClick: l, "aria-label": "New session", children: /* @__PURE__ */ u(ki, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }) }),
|
|
6346
6345
|
p && /* @__PURE__ */ u(Ze, { label: "Close sessions", hint: "⌘1", side: "bottom", children: /* @__PURE__ */ u(_e, { type: "button", variant: "ghost", size: "icon-xs", onClick: p, "aria-label": "Close sessions", children: /* @__PURE__ */ u(Si, { className: "h-4 w-4", strokeWidth: 1.75 }) }) })
|
|
6347
6346
|
] })
|
|
6348
6347
|
] }),
|
|
6349
|
-
/* @__PURE__ */
|
|
6350
|
-
e.length === 0 && /* @__PURE__ */
|
|
6348
|
+
/* @__PURE__ */ C("div", { className: "boring-scrollbar-discreet flex-1 overflow-y-auto py-2.5", children: [
|
|
6349
|
+
e.length === 0 && /* @__PURE__ */ C("div", { className: "px-3 py-8 text-center text-[13px] text-muted-foreground", children: [
|
|
6351
6350
|
"No sessions yet.",
|
|
6352
6351
|
/* @__PURE__ */ u("br", {}),
|
|
6353
6352
|
"Start a new chat to begin."
|
|
6354
6353
|
] }),
|
|
6355
|
-
b.length > 0 && /* @__PURE__ */
|
|
6354
|
+
b.length > 0 && /* @__PURE__ */ C("section", { "data-boring-workspace-part": "session-pinned-section", children: [
|
|
6356
6355
|
/* @__PURE__ */ u(
|
|
6357
6356
|
gn,
|
|
6358
6357
|
{
|
|
@@ -6380,18 +6379,18 @@ function ed({
|
|
|
6380
6379
|
R.id
|
|
6381
6380
|
)) })
|
|
6382
6381
|
] }),
|
|
6383
|
-
|
|
6382
|
+
y.length > 0 && /* @__PURE__ */ C("section", { "data-boring-workspace-part": "session-active-section", className: te(b.length > 0 && "mt-3"), children: [
|
|
6384
6383
|
/* @__PURE__ */ u(
|
|
6385
6384
|
gn,
|
|
6386
6385
|
{
|
|
6387
6386
|
label: "Active",
|
|
6388
|
-
count:
|
|
6389
|
-
attentionCount: mn(
|
|
6390
|
-
collapsed:
|
|
6387
|
+
count: y.length,
|
|
6388
|
+
attentionCount: mn(y, F),
|
|
6389
|
+
collapsed: w,
|
|
6391
6390
|
onToggle: () => v((R) => !R)
|
|
6392
6391
|
}
|
|
6393
6392
|
),
|
|
6394
|
-
!
|
|
6393
|
+
!w && /* @__PURE__ */ u("ul", { role: "list", className: "flex flex-col", children: y.map((R) => /* @__PURE__ */ u(
|
|
6395
6394
|
vn,
|
|
6396
6395
|
{
|
|
6397
6396
|
session: R,
|
|
@@ -6408,11 +6407,11 @@ function ed({
|
|
|
6408
6407
|
R.id
|
|
6409
6408
|
)) })
|
|
6410
6409
|
] }),
|
|
6411
|
-
A.length > 0 && /* @__PURE__ */
|
|
6410
|
+
A.length > 0 && /* @__PURE__ */ C(
|
|
6412
6411
|
"section",
|
|
6413
6412
|
{
|
|
6414
6413
|
"data-boring-workspace-part": "session-history-section",
|
|
6415
|
-
className:
|
|
6414
|
+
className: te(y.length > 0 && "mt-3"),
|
|
6416
6415
|
children: [
|
|
6417
6416
|
/* @__PURE__ */ u(
|
|
6418
6417
|
gn,
|
|
@@ -6424,9 +6423,9 @@ function ed({
|
|
|
6424
6423
|
onToggle: () => D((R) => !R)
|
|
6425
6424
|
}
|
|
6426
6425
|
),
|
|
6427
|
-
!W && /* @__PURE__ */
|
|
6428
|
-
A.map((R, j) => /* @__PURE__ */
|
|
6429
|
-
/* @__PURE__ */
|
|
6426
|
+
!W && /* @__PURE__ */ C(et, { children: [
|
|
6427
|
+
A.map((R, j) => /* @__PURE__ */ C("section", { className: te(j > 0 && "mt-2"), children: [
|
|
6428
|
+
/* @__PURE__ */ C("div", { className: "flex items-baseline justify-between gap-2 px-5 pb-2 pt-2 text-[11px] font-medium tracking-tight text-muted-foreground/60", children: [
|
|
6430
6429
|
/* @__PURE__ */ u("span", { children: R.label }),
|
|
6431
6430
|
/* @__PURE__ */ u("span", { "aria-hidden": "true", className: "text-[10.5px] tabular-nums text-muted-foreground/40", children: R.items.length })
|
|
6432
6431
|
] }),
|
|
@@ -6476,7 +6475,7 @@ function gn({
|
|
|
6476
6475
|
collapsed: r,
|
|
6477
6476
|
onToggle: o
|
|
6478
6477
|
}) {
|
|
6479
|
-
return /* @__PURE__ */
|
|
6478
|
+
return /* @__PURE__ */ C(
|
|
6480
6479
|
"button",
|
|
6481
6480
|
{
|
|
6482
6481
|
type: "button",
|
|
@@ -6485,12 +6484,12 @@ function gn({
|
|
|
6485
6484
|
"data-boring-workspace-part": "session-section-toggle",
|
|
6486
6485
|
className: "flex w-full items-baseline justify-between gap-2 px-3.5 pb-2 pt-2 text-[11px] font-medium tracking-tight text-muted-foreground/75 transition-colors hover:text-foreground/80",
|
|
6487
6486
|
children: [
|
|
6488
|
-
/* @__PURE__ */
|
|
6487
|
+
/* @__PURE__ */ C("span", { className: "flex items-center gap-1", children: [
|
|
6489
6488
|
/* @__PURE__ */ u(
|
|
6490
6489
|
Br,
|
|
6491
6490
|
{
|
|
6492
6491
|
"aria-hidden": "true",
|
|
6493
|
-
className:
|
|
6492
|
+
className: te("h-3 w-3 transition-transform duration-150", !r && "rotate-90"),
|
|
6494
6493
|
strokeWidth: 2
|
|
6495
6494
|
}
|
|
6496
6495
|
),
|
|
@@ -6523,22 +6522,22 @@ function vn({
|
|
|
6523
6522
|
onTogglePin: a,
|
|
6524
6523
|
onDelete: d
|
|
6525
6524
|
}) {
|
|
6526
|
-
const c = Zu(e.updatedAt);
|
|
6527
|
-
return /* @__PURE__ */
|
|
6525
|
+
const c = Zu(e.updatedAt), f = !!(i || o || c);
|
|
6526
|
+
return /* @__PURE__ */ C(
|
|
6528
6527
|
"li",
|
|
6529
6528
|
{
|
|
6530
6529
|
role: "listitem",
|
|
6531
6530
|
"data-boring-workspace-part": "session-row",
|
|
6532
6531
|
"data-boring-state": t ? "selected" : void 0,
|
|
6533
|
-
className:
|
|
6534
|
-
"group relative mx-2 mt-px flex items-center
|
|
6532
|
+
className: te(
|
|
6533
|
+
"group relative mx-2 mt-px flex items-center rounded-md px-2.5 py-1.5 text-[13px] transition-colors duration-150 ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
6535
6534
|
"cursor-pointer hover:bg-foreground/[0.04]",
|
|
6536
6535
|
t && "bg-foreground/[0.06] text-foreground"
|
|
6537
6536
|
),
|
|
6538
6537
|
onClick: () => s == null ? void 0 : s(e.id),
|
|
6539
6538
|
draggable: !0,
|
|
6540
|
-
onDragStart: (
|
|
6541
|
-
|
|
6539
|
+
onDragStart: (p) => {
|
|
6540
|
+
p.dataTransfer.setData(En, e.id), p.dataTransfer.setData("text/plain", e.title || e.id), p.dataTransfer.effectAllowed = "copyMove";
|
|
6542
6541
|
},
|
|
6543
6542
|
children: [
|
|
6544
6543
|
n && /* @__PURE__ */ u(
|
|
@@ -6546,98 +6545,128 @@ function vn({
|
|
|
6546
6545
|
{
|
|
6547
6546
|
"aria-hidden": "true",
|
|
6548
6547
|
"data-boring-workspace-part": "session-open-dot",
|
|
6549
|
-
className:
|
|
6550
|
-
"h-1.5 w-1.5 shrink-0 rounded-full",
|
|
6548
|
+
className: te(
|
|
6549
|
+
"mr-2 h-1.5 w-1.5 shrink-0 rounded-full",
|
|
6551
6550
|
t ? "bg-foreground/70" : "bg-foreground/30"
|
|
6552
6551
|
)
|
|
6553
6552
|
}
|
|
6554
6553
|
),
|
|
6555
|
-
/* @__PURE__ */
|
|
6556
|
-
|
|
6557
|
-
c && /* @__PURE__ */ u(
|
|
6558
|
-
"span",
|
|
6559
|
-
{
|
|
6560
|
-
className: re(
|
|
6561
|
-
"ml-1.5 tabular-nums text-[11px]",
|
|
6562
|
-
t ? "text-[color:var(--accent)]" : "text-muted-foreground/60"
|
|
6563
|
-
),
|
|
6564
|
-
children: c
|
|
6565
|
-
}
|
|
6566
|
-
)
|
|
6567
|
-
] }),
|
|
6568
|
-
i ? /* @__PURE__ */ E(
|
|
6554
|
+
/* @__PURE__ */ u("span", { className: "min-w-0 flex-1 truncate leading-5", title: e.title, children: /* @__PURE__ */ u("span", { className: te(t ? "font-medium text-foreground" : "text-foreground/90"), children: e.title || "Untitled" }) }),
|
|
6555
|
+
/* @__PURE__ */ C(
|
|
6569
6556
|
"span",
|
|
6570
6557
|
{
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
/* @__PURE__ */ u("span", { "aria-hidden": "true", className: re("h-1.5 w-1.5 animate-pulse rounded-full", Qu(i.tone)) }),
|
|
6576
|
-
i.label
|
|
6577
|
-
]
|
|
6578
|
-
}
|
|
6579
|
-
) : o ? /* @__PURE__ */ E(
|
|
6580
|
-
"span",
|
|
6581
|
-
{
|
|
6582
|
-
"data-boring-workspace-part": "session-badge",
|
|
6583
|
-
"data-boring-badge": "working",
|
|
6584
|
-
className: "inline-flex shrink-0 items-center gap-1 rounded-full bg-foreground/[0.07] px-1.5 py-0.5 text-[10px] font-medium leading-none text-muted-foreground",
|
|
6558
|
+
className: te(
|
|
6559
|
+
"flex shrink-0 items-center transition-[margin] duration-150 ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
6560
|
+
f || r ? "ml-2" : "ml-0 group-hover:ml-2 focus-within:ml-2"
|
|
6561
|
+
),
|
|
6585
6562
|
children: [
|
|
6586
|
-
/* @__PURE__ */
|
|
6587
|
-
|
|
6563
|
+
i ? /* @__PURE__ */ C(
|
|
6564
|
+
"span",
|
|
6565
|
+
{
|
|
6566
|
+
"data-boring-workspace-part": "session-badge",
|
|
6567
|
+
"data-boring-badge": i.kind,
|
|
6568
|
+
className: te("inline-flex shrink-0 items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] font-medium leading-none", Xu(i.tone)),
|
|
6569
|
+
children: [
|
|
6570
|
+
/* @__PURE__ */ u("span", { "aria-hidden": "true", className: te("h-1.5 w-1.5 animate-pulse rounded-full", Qu(i.tone)) }),
|
|
6571
|
+
i.label
|
|
6572
|
+
]
|
|
6573
|
+
}
|
|
6574
|
+
) : o ? /* @__PURE__ */ C(
|
|
6575
|
+
"span",
|
|
6576
|
+
{
|
|
6577
|
+
"data-boring-workspace-part": "session-badge",
|
|
6578
|
+
"data-boring-badge": "working",
|
|
6579
|
+
className: "inline-flex shrink-0 items-center gap-1 rounded-full bg-foreground/[0.07] px-1.5 py-0.5 text-[10px] font-medium leading-none text-muted-foreground",
|
|
6580
|
+
children: [
|
|
6581
|
+
/* @__PURE__ */ u("span", { "aria-hidden": "true", className: "h-1.5 w-1.5 animate-pulse rounded-full bg-[color:var(--accent)]" }),
|
|
6582
|
+
"working"
|
|
6583
|
+
]
|
|
6584
|
+
}
|
|
6585
|
+
) : c ? /* @__PURE__ */ u(
|
|
6586
|
+
"span",
|
|
6587
|
+
{
|
|
6588
|
+
"data-boring-workspace-part": "session-age",
|
|
6589
|
+
className: te(
|
|
6590
|
+
"shrink-0 tabular-nums text-[11px]",
|
|
6591
|
+
t ? "text-[color:var(--accent)]" : "text-muted-foreground/60"
|
|
6592
|
+
),
|
|
6593
|
+
children: c
|
|
6594
|
+
}
|
|
6595
|
+
) : null,
|
|
6596
|
+
a ? /* @__PURE__ */ u(
|
|
6597
|
+
"span",
|
|
6598
|
+
{
|
|
6599
|
+
"data-boring-workspace-part": "session-pin-action",
|
|
6600
|
+
className: te(
|
|
6601
|
+
"flex w-0 shrink-0 items-center overflow-hidden opacity-0 transition-[width,opacity,margin] duration-150 ease-[cubic-bezier(0.22,1,0.36,1)] group-hover:w-auto group-hover:opacity-100 focus-within:w-auto focus-within:opacity-100",
|
|
6602
|
+
f && "group-hover:ml-1.5 focus-within:ml-1.5",
|
|
6603
|
+
r && te("w-auto opacity-100", f && "ml-1.5")
|
|
6604
|
+
),
|
|
6605
|
+
children: /* @__PURE__ */ u(Ze, { label: r ? "Unpin session" : "Pin session", children: /* @__PURE__ */ u(
|
|
6606
|
+
_e,
|
|
6607
|
+
{
|
|
6608
|
+
type: "button",
|
|
6609
|
+
variant: "ghost",
|
|
6610
|
+
size: "icon-xs",
|
|
6611
|
+
"data-boring-workspace-part": "session-pin-toggle",
|
|
6612
|
+
"data-boring-state": r ? "pinned" : void 0,
|
|
6613
|
+
className: te(
|
|
6614
|
+
"shrink-0 focus-visible:opacity-100",
|
|
6615
|
+
r ? "text-[color:var(--accent)] hover:text-[color:var(--accent)]" : "text-muted-foreground/70 hover:text-foreground"
|
|
6616
|
+
),
|
|
6617
|
+
onClick: (p) => {
|
|
6618
|
+
p.stopPropagation(), a(e.id);
|
|
6619
|
+
},
|
|
6620
|
+
"aria-label": r ? `Unpin ${e.title || "session"}` : `Pin ${e.title || "session"}`,
|
|
6621
|
+
"aria-pressed": r,
|
|
6622
|
+
children: /* @__PURE__ */ u(xi, { className: te("h-3.5 w-3.5", r && "fill-current"), strokeWidth: 1.75 })
|
|
6623
|
+
}
|
|
6624
|
+
) })
|
|
6625
|
+
}
|
|
6626
|
+
) : null,
|
|
6627
|
+
/* @__PURE__ */ C(
|
|
6628
|
+
"span",
|
|
6629
|
+
{
|
|
6630
|
+
"data-boring-workspace-part": "session-actions",
|
|
6631
|
+
className: te(
|
|
6632
|
+
"flex w-0 shrink-0 items-center gap-1 overflow-hidden opacity-0 transition-[width,opacity,margin] duration-150 ease-[cubic-bezier(0.22,1,0.36,1)] group-hover:w-auto group-hover:opacity-100 focus-within:w-auto focus-within:opacity-100",
|
|
6633
|
+
(f || a) && "group-hover:ml-1 focus-within:ml-1"
|
|
6634
|
+
),
|
|
6635
|
+
children: [
|
|
6636
|
+
l && /* @__PURE__ */ u(Ze, { label: "Open in chat pane", children: /* @__PURE__ */ u(
|
|
6637
|
+
_e,
|
|
6638
|
+
{
|
|
6639
|
+
type: "button",
|
|
6640
|
+
variant: "ghost",
|
|
6641
|
+
size: "icon-xs",
|
|
6642
|
+
className: "shrink-0 text-muted-foreground/70 hover:text-foreground focus-visible:opacity-100",
|
|
6643
|
+
onClick: (p) => {
|
|
6644
|
+
p.stopPropagation(), l(e.id);
|
|
6645
|
+
},
|
|
6646
|
+
"aria-label": `Open ${e.title || "session"} in chat pane`,
|
|
6647
|
+
children: /* @__PURE__ */ u(zr, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
|
|
6648
|
+
}
|
|
6649
|
+
) }),
|
|
6650
|
+
d && /* @__PURE__ */ u(Ze, { label: "Delete session", children: /* @__PURE__ */ u(
|
|
6651
|
+
_e,
|
|
6652
|
+
{
|
|
6653
|
+
type: "button",
|
|
6654
|
+
variant: "ghost",
|
|
6655
|
+
size: "icon-xs",
|
|
6656
|
+
className: "shrink-0 text-muted-foreground hover:text-destructive focus-visible:opacity-100",
|
|
6657
|
+
onClick: (p) => {
|
|
6658
|
+
p.stopPropagation(), d(e.id);
|
|
6659
|
+
},
|
|
6660
|
+
"aria-label": `Delete ${e.title || "session"}`,
|
|
6661
|
+
children: /* @__PURE__ */ u("svg", { width: "12", height: "12", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: /* @__PURE__ */ u("path", { d: "M3.5 3.5l7 7M10.5 3.5l-7 7" }) })
|
|
6662
|
+
}
|
|
6663
|
+
) })
|
|
6664
|
+
]
|
|
6665
|
+
}
|
|
6666
|
+
)
|
|
6588
6667
|
]
|
|
6589
6668
|
}
|
|
6590
|
-
)
|
|
6591
|
-
a && /* @__PURE__ */ u(Ze, { label: r ? "Unpin session" : "Pin session", children: /* @__PURE__ */ u(
|
|
6592
|
-
_e,
|
|
6593
|
-
{
|
|
6594
|
-
type: "button",
|
|
6595
|
-
variant: "ghost",
|
|
6596
|
-
size: "icon-xs",
|
|
6597
|
-
"data-boring-workspace-part": "session-pin-toggle",
|
|
6598
|
-
"data-boring-state": r ? "pinned" : void 0,
|
|
6599
|
-
className: re(
|
|
6600
|
-
"shrink-0 focus-visible:opacity-100 group-hover:opacity-100",
|
|
6601
|
-
// A pinned session keeps its pin lit so the state is legible;
|
|
6602
|
-
// unpinned rows reveal the affordance on hover like the others.
|
|
6603
|
-
r ? "text-[color:var(--accent)] opacity-100 hover:text-[color:var(--accent)]" : "text-muted-foreground/70 opacity-0 hover:text-foreground"
|
|
6604
|
-
),
|
|
6605
|
-
onClick: (f) => {
|
|
6606
|
-
f.stopPropagation(), a(e.id);
|
|
6607
|
-
},
|
|
6608
|
-
"aria-label": r ? `Unpin ${e.title || "session"}` : `Pin ${e.title || "session"}`,
|
|
6609
|
-
"aria-pressed": r,
|
|
6610
|
-
children: /* @__PURE__ */ u(xi, { className: re("h-3.5 w-3.5", r && "fill-current"), strokeWidth: 1.75 })
|
|
6611
|
-
}
|
|
6612
|
-
) }),
|
|
6613
|
-
l && /* @__PURE__ */ u(Ze, { label: "Open in chat pane", children: /* @__PURE__ */ u(
|
|
6614
|
-
_e,
|
|
6615
|
-
{
|
|
6616
|
-
type: "button",
|
|
6617
|
-
variant: "ghost",
|
|
6618
|
-
size: "icon-xs",
|
|
6619
|
-
className: "shrink-0 text-muted-foreground/70 opacity-0 hover:text-foreground focus-visible:opacity-100 group-hover:opacity-100",
|
|
6620
|
-
onClick: (f) => {
|
|
6621
|
-
f.stopPropagation(), l(e.id);
|
|
6622
|
-
},
|
|
6623
|
-
"aria-label": `Open ${e.title || "session"} in chat pane`,
|
|
6624
|
-
children: /* @__PURE__ */ u(zr, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
|
|
6625
|
-
}
|
|
6626
|
-
) }),
|
|
6627
|
-
d && /* @__PURE__ */ u(Ze, { label: "Delete session", children: /* @__PURE__ */ u(
|
|
6628
|
-
_e,
|
|
6629
|
-
{
|
|
6630
|
-
type: "button",
|
|
6631
|
-
variant: "ghost",
|
|
6632
|
-
size: "icon-xs",
|
|
6633
|
-
className: "shrink-0 text-muted-foreground opacity-0 hover:text-destructive focus-visible:opacity-100 group-hover:opacity-100",
|
|
6634
|
-
onClick: (f) => {
|
|
6635
|
-
f.stopPropagation(), d(e.id);
|
|
6636
|
-
},
|
|
6637
|
-
"aria-label": `Delete ${e.title || "session"}`,
|
|
6638
|
-
children: /* @__PURE__ */ u("svg", { width: "12", height: "12", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: /* @__PURE__ */ u("path", { d: "M3.5 3.5l7 7M10.5 3.5l-7 7" }) })
|
|
6639
|
-
}
|
|
6640
|
-
) })
|
|
6669
|
+
)
|
|
6641
6670
|
]
|
|
6642
6671
|
}
|
|
6643
6672
|
);
|
|
@@ -6679,7 +6708,7 @@ function Jo({
|
|
|
6679
6708
|
type: "button",
|
|
6680
6709
|
"aria-label": e,
|
|
6681
6710
|
onClick: t,
|
|
6682
|
-
className:
|
|
6711
|
+
className: te(
|
|
6683
6712
|
"pointer-events-auto flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground transition-colors",
|
|
6684
6713
|
"hover:bg-background/70 hover:text-foreground",
|
|
6685
6714
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
@@ -6720,7 +6749,7 @@ function Xo({
|
|
|
6720
6749
|
m.subscribe,
|
|
6721
6750
|
m.getSnapshot,
|
|
6722
6751
|
m.getSnapshot
|
|
6723
|
-
),
|
|
6752
|
+
), y = ut(
|
|
6724
6753
|
g.subscribe,
|
|
6725
6754
|
g.getSnapshot,
|
|
6726
6755
|
g.getSnapshot
|
|
@@ -6729,7 +6758,7 @@ function Xo({
|
|
|
6729
6758
|
[b]
|
|
6730
6759
|
), A = Y(() => {
|
|
6731
6760
|
const z = [];
|
|
6732
|
-
for (const ae of
|
|
6761
|
+
for (const ae of y) {
|
|
6733
6762
|
const ue = ae.icon;
|
|
6734
6763
|
z.push({
|
|
6735
6764
|
id: ae.id,
|
|
@@ -6753,17 +6782,17 @@ function Xo({
|
|
|
6753
6782
|
});
|
|
6754
6783
|
}
|
|
6755
6784
|
return z;
|
|
6756
|
-
}, [$,
|
|
6785
|
+
}, [$, y]), [x, _] = U(n ?? ""), w = r ?? x, v = A.some((z) => z.id === w) ? w : ((Ue = A[0]) == null ? void 0 : Ue.id) ?? "", W = I((z) => {
|
|
6757
6786
|
r === void 0 && _(z), i == null || i(z);
|
|
6758
|
-
}, [r, i]), [D, H] = U(!1), [
|
|
6787
|
+
}, [r, i]), [D, H] = U(!1), [E, F] = U(""), [R, j] = U(""), B = O(null), [G, de] = U(null), oe = I((z) => {
|
|
6759
6788
|
de(z);
|
|
6760
6789
|
}, []), se = O(void 0);
|
|
6761
|
-
L(() => (clearTimeout(se.current), se.current = setTimeout(() => j(
|
|
6790
|
+
L(() => (clearTimeout(se.current), se.current = setTimeout(() => j(E), 180), () => clearTimeout(se.current)), [E]), L(() => {
|
|
6762
6791
|
var z;
|
|
6763
6792
|
D && ((z = B.current) == null || z.focus());
|
|
6764
6793
|
}, [D]), L(() => {
|
|
6765
|
-
A.length > 0 && !A.some((z) => z.id ===
|
|
6766
|
-
}, [
|
|
6794
|
+
A.length > 0 && !A.some((z) => z.id === w) && W(A[0].id);
|
|
6795
|
+
}, [w, W, A]), L(() => {
|
|
6767
6796
|
s && A.some((z) => z.id === Ar) && W(Ar);
|
|
6768
6797
|
}, [s, W, A]);
|
|
6769
6798
|
const ee = I((z) => {
|
|
@@ -6810,7 +6839,7 @@ function Xo({
|
|
|
6810
6839
|
revealFileTreeRequest: s
|
|
6811
6840
|
}),
|
|
6812
6841
|
[t, G, R, s, e]
|
|
6813
|
-
), Be = /* @__PURE__ */
|
|
6842
|
+
), Be = /* @__PURE__ */ C(
|
|
6814
6843
|
"nav",
|
|
6815
6844
|
{
|
|
6816
6845
|
className: "flex w-11 shrink-0 flex-col items-center gap-1 bg-muted/35 px-1.5 py-2",
|
|
@@ -6829,7 +6858,7 @@ function Xo({
|
|
|
6829
6858
|
onContextMenu: (fe) => {
|
|
6830
6859
|
a && (fe.preventDefault(), a());
|
|
6831
6860
|
},
|
|
6832
|
-
className:
|
|
6861
|
+
className: te(
|
|
6833
6862
|
"relative flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-background/70 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40"
|
|
6834
6863
|
),
|
|
6835
6864
|
style: Z ? { color: "var(--accent)", backgroundColor: "color-mix(in oklch, var(--foreground) 10%, transparent)" } : void 0,
|
|
@@ -6840,11 +6869,11 @@ function Xo({
|
|
|
6840
6869
|
]
|
|
6841
6870
|
}
|
|
6842
6871
|
);
|
|
6843
|
-
return p ? /* @__PURE__ */ u("div", { "data-boring-workspace-part": "workbench-left", className:
|
|
6872
|
+
return p ? /* @__PURE__ */ u("div", { "data-boring-workspace-part": "workbench-left", className: te("workbench-left-root flex h-full min-h-0", h), children: Be }) : /* @__PURE__ */ C("div", { "data-boring-workspace-part": "workbench-left", className: te("workbench-left-root flex h-full min-h-0", h), children: [
|
|
6844
6873
|
Be,
|
|
6845
|
-
/* @__PURE__ */
|
|
6846
|
-
!Ae && /* @__PURE__ */
|
|
6847
|
-
/* @__PURE__ */
|
|
6874
|
+
/* @__PURE__ */ C("div", { className: "flex h-full min-w-0 flex-1 flex-col bg-muted/35", children: [
|
|
6875
|
+
!Ae && /* @__PURE__ */ C("div", { className: "flex h-11 items-center gap-1 border-b border-border/60 bg-muted/35 px-2.5", children: [
|
|
6876
|
+
/* @__PURE__ */ C("div", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [
|
|
6848
6877
|
/* @__PURE__ */ u("span", { className: "shrink-0 text-foreground/80", children: le == null ? void 0 : le.icon }),
|
|
6849
6878
|
/* @__PURE__ */ u("div", { className: "truncate text-[14px] font-medium tracking-tight text-foreground", children: (le == null ? void 0 : le.title) ?? "Sources" })
|
|
6850
6879
|
] }),
|
|
@@ -6855,7 +6884,7 @@ function Xo({
|
|
|
6855
6884
|
variant: "ghost",
|
|
6856
6885
|
size: "icon-xs",
|
|
6857
6886
|
onClick: xe,
|
|
6858
|
-
className:
|
|
6887
|
+
className: te(D && "bg-foreground/5 text-foreground"),
|
|
6859
6888
|
"aria-label": "Search",
|
|
6860
6889
|
children: /* @__PURE__ */ u(qn, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
|
|
6861
6890
|
}
|
|
@@ -6869,21 +6898,21 @@ function Xo({
|
|
|
6869
6898
|
}
|
|
6870
6899
|
)
|
|
6871
6900
|
] }),
|
|
6872
|
-
!Ae && je && D && /* @__PURE__ */
|
|
6901
|
+
!Ae && je && D && /* @__PURE__ */ C("div", { className: "flex items-center gap-1 border-b border-border/60 px-2 py-1.5", children: [
|
|
6873
6902
|
/* @__PURE__ */ u(qn, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
6874
6903
|
/* @__PURE__ */ u(
|
|
6875
6904
|
qr,
|
|
6876
6905
|
{
|
|
6877
6906
|
ref: B,
|
|
6878
6907
|
type: "text",
|
|
6879
|
-
value:
|
|
6908
|
+
value: E,
|
|
6880
6909
|
onChange: (z) => F(z.target.value),
|
|
6881
6910
|
onKeyDown: ze,
|
|
6882
6911
|
placeholder: `Search ${((le == null ? void 0 : le.title) ?? "sources").toLowerCase()}...`,
|
|
6883
6912
|
className: "h-7 flex-1 border-0 bg-transparent px-0 py-0 text-xs shadow-none focus-visible:ring-0 dark:bg-transparent"
|
|
6884
6913
|
}
|
|
6885
6914
|
),
|
|
6886
|
-
|
|
6915
|
+
E && /* @__PURE__ */ u(
|
|
6887
6916
|
_e,
|
|
6888
6917
|
{
|
|
6889
6918
|
type: "button",
|
|
@@ -6900,7 +6929,7 @@ function Xo({
|
|
|
6900
6929
|
] });
|
|
6901
6930
|
}
|
|
6902
6931
|
function od({ title: e }) {
|
|
6903
|
-
return /* @__PURE__ */
|
|
6932
|
+
return /* @__PURE__ */ C("div", { className: "flex h-full flex-col items-center justify-center px-4 text-center text-[12px] text-muted-foreground", children: [
|
|
6904
6933
|
/* @__PURE__ */ u("div", { className: "mb-1 text-sm font-medium text-foreground", children: e }),
|
|
6905
6934
|
/* @__PURE__ */ u("div", { children: "Opened in the workspace." })
|
|
6906
6935
|
] });
|
|
@@ -7009,9 +7038,9 @@ function Zo({
|
|
|
7009
7038
|
}
|
|
7010
7039
|
if (h.status === "blocked-by-allowed-panels" && !dd(b))
|
|
7011
7040
|
return;
|
|
7012
|
-
const
|
|
7041
|
+
const y = { v: Qo, layout: b };
|
|
7013
7042
|
try {
|
|
7014
|
-
window.localStorage.setItem(t, JSON.stringify(
|
|
7043
|
+
window.localStorage.setItem(t, JSON.stringify(y));
|
|
7015
7044
|
} catch {
|
|
7016
7045
|
}
|
|
7017
7046
|
},
|
|
@@ -7020,7 +7049,7 @@ function Zo({
|
|
|
7020
7049
|
return e ? /* @__PURE__ */ u(
|
|
7021
7050
|
"div",
|
|
7022
7051
|
{
|
|
7023
|
-
className:
|
|
7052
|
+
className: te("h-full w-full", d),
|
|
7024
7053
|
"data-testid": "artifact-surface",
|
|
7025
7054
|
children: /* @__PURE__ */ u(
|
|
7026
7055
|
Ac,
|
|
@@ -7061,7 +7090,7 @@ function fd(e) {
|
|
|
7061
7090
|
target: jt(e.target)
|
|
7062
7091
|
};
|
|
7063
7092
|
}
|
|
7064
|
-
function
|
|
7093
|
+
function wn(e, t) {
|
|
7065
7094
|
return t.id ?? `surface:${e.kind}:${e.target}`;
|
|
7066
7095
|
}
|
|
7067
7096
|
const ei = "__boringFileBacked", pd = "files";
|
|
@@ -7091,10 +7120,10 @@ function gd(e) {
|
|
|
7091
7120
|
function vd(e) {
|
|
7092
7121
|
return e.mode !== "hidden" ? e : { mode: e.restoreMode, activeTab: e.activeTab };
|
|
7093
7122
|
}
|
|
7094
|
-
function
|
|
7123
|
+
function wd(e, t = e.activeTab) {
|
|
7095
7124
|
return { mode: "source", activeTab: t };
|
|
7096
7125
|
}
|
|
7097
|
-
function
|
|
7126
|
+
function yd(e, t = e.activeTab) {
|
|
7098
7127
|
return { mode: "rail", activeTab: t };
|
|
7099
7128
|
}
|
|
7100
7129
|
function bd(e, t) {
|
|
@@ -7115,7 +7144,7 @@ function $r(e, t) {
|
|
|
7115
7144
|
return typeof n == "string" ? n : null;
|
|
7116
7145
|
}
|
|
7117
7146
|
let ti = 0;
|
|
7118
|
-
function
|
|
7147
|
+
function yn(e, t, n) {
|
|
7119
7148
|
return {
|
|
7120
7149
|
...e ?? {},
|
|
7121
7150
|
path: typeof (e == null ? void 0 : e.path) == "string" ? e.path : t,
|
|
@@ -7145,7 +7174,7 @@ function kd({
|
|
|
7145
7174
|
initialPanels: p,
|
|
7146
7175
|
className: h
|
|
7147
7176
|
}) {
|
|
7148
|
-
const [m, g] = U(() => md(o, c)), b = m.mode === "hidden",
|
|
7177
|
+
const [m, g] = U(() => md(o, c)), b = m.mode === "hidden", y = m.mode === "source", $ = m.activeTab, A = I((k) => {
|
|
7149
7178
|
g((T) => bd(T, k));
|
|
7150
7179
|
}, []), [x, _] = U(() => {
|
|
7151
7180
|
if (!o) return t;
|
|
@@ -7157,7 +7186,7 @@ function kd({
|
|
|
7157
7186
|
} catch {
|
|
7158
7187
|
return t;
|
|
7159
7188
|
}
|
|
7160
|
-
}),
|
|
7189
|
+
}), w = O(null), v = O(null), W = O(null), [D, H] = U(null), [E, F] = U(null), [R, j] = U(null), B = O(i);
|
|
7161
7190
|
B.current = i;
|
|
7162
7191
|
const G = O(s);
|
|
7163
7192
|
G.current = s;
|
|
@@ -7185,14 +7214,14 @@ function kd({
|
|
|
7185
7214
|
}, []), Be = I(() => {
|
|
7186
7215
|
g(vd);
|
|
7187
7216
|
}, []), Ue = I((k) => {
|
|
7188
|
-
g((T) =>
|
|
7217
|
+
g((T) => wd(T, k));
|
|
7189
7218
|
}, []), z = I(() => {
|
|
7190
|
-
g(
|
|
7219
|
+
g(yd);
|
|
7191
7220
|
}, []), ae = I((k) => {
|
|
7192
7221
|
const T = he.current.get(k);
|
|
7193
7222
|
Yo(T == null ? void 0 : T.placement) && z();
|
|
7194
7223
|
}, [z]), ue = I((k) => {
|
|
7195
|
-
const T =
|
|
7224
|
+
const T = w.current;
|
|
7196
7225
|
if (!T) return !1;
|
|
7197
7226
|
const M = T.getPanel(k.id);
|
|
7198
7227
|
return M ? (k.params && M.api.updateParameters(k.params), M.api.setActive(), ae(k.component), !0) : (ae(k.component), T.addPanel({
|
|
@@ -7205,7 +7234,7 @@ function kd({
|
|
|
7205
7234
|
const T = _r(k.activePanel);
|
|
7206
7235
|
T && ae(T);
|
|
7207
7236
|
}, [ae]), fe = I((k, T) => {
|
|
7208
|
-
const M =
|
|
7237
|
+
const M = w.current;
|
|
7209
7238
|
if (!M) {
|
|
7210
7239
|
console.warn("[SurfaceShell] openFile: surface not ready (dockview not initialized)");
|
|
7211
7240
|
return;
|
|
@@ -7219,12 +7248,12 @@ function kd({
|
|
|
7219
7248
|
console.warn(`[SurfaceShell] openFile: resolver returned unknown panel "${pe.component}" for "${J}"`);
|
|
7220
7249
|
return;
|
|
7221
7250
|
}
|
|
7222
|
-
const ve =
|
|
7251
|
+
const ve = wn(ge, pe);
|
|
7223
7252
|
se.current.add(ve), ue({
|
|
7224
7253
|
id: ve,
|
|
7225
7254
|
component: pe.component,
|
|
7226
7255
|
title: pe.title ?? J.split("/").pop() ?? J,
|
|
7227
|
-
params:
|
|
7256
|
+
params: yn(pe.params, J, T)
|
|
7228
7257
|
});
|
|
7229
7258
|
return;
|
|
7230
7259
|
}
|
|
@@ -7248,9 +7277,9 @@ function kd({
|
|
|
7248
7277
|
`openSurface: unknown component "${M.component}". Registered panels: [${V}]. Register the component through a panel output before resolving to it.`
|
|
7249
7278
|
);
|
|
7250
7279
|
}
|
|
7251
|
-
const ge =
|
|
7280
|
+
const ge = wn(T, M);
|
|
7252
7281
|
T.kind === it && se.current.add(ge);
|
|
7253
|
-
const pe = ((P = T.meta) == null ? void 0 : P.closeWorkbenchOnDone) === !0, Ee = (N = T.meta) == null ? void 0 : N.mode, ve = T.kind === it ?
|
|
7282
|
+
const pe = ((P = T.meta) == null ? void 0 : P.closeWorkbenchOnDone) === !0, Ee = (N = T.meta) == null ? void 0 : N.mode, ve = T.kind === it ? yn(
|
|
7254
7283
|
M.params,
|
|
7255
7284
|
T.target,
|
|
7256
7285
|
Ee === "view" || Ee === "edit" || Ee === "diff" ? { mode: Ee } : void 0
|
|
@@ -7262,7 +7291,7 @@ function kd({
|
|
|
7262
7291
|
params: S
|
|
7263
7292
|
}) || console.warn("[SurfaceShell] openSurface: surface not ready (dockview not initialized)");
|
|
7264
7293
|
}, [ue]), De = I((k) => {
|
|
7265
|
-
const T =
|
|
7294
|
+
const T = w.current;
|
|
7266
7295
|
if (!T) return;
|
|
7267
7296
|
const M = T.getPanel(k.id);
|
|
7268
7297
|
if (M) {
|
|
@@ -7284,7 +7313,7 @@ function kd({
|
|
|
7284
7313
|
});
|
|
7285
7314
|
}, [ue]), Ce = I(() => {
|
|
7286
7315
|
var M;
|
|
7287
|
-
const k =
|
|
7316
|
+
const k = w.current;
|
|
7288
7317
|
return k ? { openTabs: k.panels.map((J) => {
|
|
7289
7318
|
const ge = _r(J);
|
|
7290
7319
|
return {
|
|
@@ -7312,7 +7341,7 @@ function kd({
|
|
|
7312
7341
|
getSnapshot: Ce
|
|
7313
7342
|
}), [Le, ke, Ce, fe, De, Pe]), Te = I(() => {
|
|
7314
7343
|
var Ee;
|
|
7315
|
-
const k =
|
|
7344
|
+
const k = w.current, T = k ? k.panels.map((ve) => ({
|
|
7316
7345
|
id: ve.id,
|
|
7317
7346
|
component: String(ve.component ?? ""),
|
|
7318
7347
|
params: ve.params ?? void 0
|
|
@@ -7336,7 +7365,7 @@ function kd({
|
|
|
7336
7365
|
T(k);
|
|
7337
7366
|
}, [Te]), me = O(!1), Me = I((k) => {
|
|
7338
7367
|
var M;
|
|
7339
|
-
if (
|
|
7368
|
+
if (w.current = k, H(k), !me.current) {
|
|
7340
7369
|
me.current = !0;
|
|
7341
7370
|
for (const J of p ?? [])
|
|
7342
7371
|
k.getPanel(J.id) || k.addPanel({ id: J.id, component: J.component, title: J.title, params: J.params });
|
|
@@ -7352,7 +7381,7 @@ function kd({
|
|
|
7352
7381
|
}, [Z, ct, Ce, ft]), Oe = I(
|
|
7353
7382
|
async (k, T) => {
|
|
7354
7383
|
try {
|
|
7355
|
-
const M =
|
|
7384
|
+
const M = w.current;
|
|
7356
7385
|
if (!M) return Ye("not-ready", "surface not ready");
|
|
7357
7386
|
const J = jt(k), ge = {
|
|
7358
7387
|
kind: it,
|
|
@@ -7364,12 +7393,12 @@ function kd({
|
|
|
7364
7393
|
"NO_SURFACE_PANEL",
|
|
7365
7394
|
`surface resolver "${ge.kind}" returned unknown panel "${pe.component}"`
|
|
7366
7395
|
);
|
|
7367
|
-
const ve =
|
|
7396
|
+
const ve = wn(ge, pe);
|
|
7368
7397
|
return se.current.add(ve), ue({
|
|
7369
7398
|
id: ve,
|
|
7370
7399
|
component: pe.component,
|
|
7371
7400
|
title: pe.title ?? J.split("/").pop() ?? J,
|
|
7372
|
-
params:
|
|
7401
|
+
params: yn(pe.params, J, T)
|
|
7373
7402
|
}), lt();
|
|
7374
7403
|
}
|
|
7375
7404
|
const Ee = Or(M, J);
|
|
@@ -7389,7 +7418,7 @@ function kd({
|
|
|
7389
7418
|
getVisibleFiles: () => Te().visibleFiles,
|
|
7390
7419
|
openFile: Oe,
|
|
7391
7420
|
openPanel: async (k) => {
|
|
7392
|
-
if (!
|
|
7421
|
+
if (!w.current) return Ye("not-ready", "surface not ready");
|
|
7393
7422
|
try {
|
|
7394
7423
|
return De(k), lt();
|
|
7395
7424
|
} catch (T) {
|
|
@@ -7397,7 +7426,7 @@ function kd({
|
|
|
7397
7426
|
}
|
|
7398
7427
|
},
|
|
7399
7428
|
closePanel: async (k) => {
|
|
7400
|
-
const T =
|
|
7429
|
+
const T = w.current;
|
|
7401
7430
|
if (!T) return Ye("not-ready", "surface not ready");
|
|
7402
7431
|
const M = T.getPanel(k);
|
|
7403
7432
|
return M ? (M.api.close(), lt()) : Ye("PANEL_NOT_FOUND", `panel "${k}" is not open`);
|
|
@@ -7426,10 +7455,10 @@ function kd({
|
|
|
7426
7455
|
}
|
|
7427
7456
|
}), [Le, Fe, ke, Te, Oe, De]), on = I(
|
|
7428
7457
|
(k) => {
|
|
7429
|
-
if (b || !
|
|
7458
|
+
if (b || !y) return;
|
|
7430
7459
|
k.preventDefault(), k.currentTarget.setPointerCapture(k.pointerId), W.current = { startX: k.clientX, startWidth: x };
|
|
7431
7460
|
},
|
|
7432
|
-
[b,
|
|
7461
|
+
[b, y, x]
|
|
7433
7462
|
), sn = I(
|
|
7434
7463
|
(k) => {
|
|
7435
7464
|
const T = W.current;
|
|
@@ -7438,15 +7467,15 @@ function kd({
|
|
|
7438
7467
|
_(J);
|
|
7439
7468
|
},
|
|
7440
7469
|
[n, r]
|
|
7441
|
-
),
|
|
7470
|
+
), yt = I((k) => {
|
|
7442
7471
|
W.current && (W.current = null, k.currentTarget.releasePointerCapture(k.pointerId));
|
|
7443
7472
|
}, []), At = I(
|
|
7444
7473
|
(k) => {
|
|
7445
|
-
if (b || !
|
|
7474
|
+
if (b || !y) return;
|
|
7446
7475
|
const T = k.shiftKey ? 32 : 16;
|
|
7447
7476
|
k.key === "ArrowLeft" ? (k.preventDefault(), _((M) => Math.max(n, M - T))) : k.key === "ArrowRight" ? (k.preventDefault(), _((M) => Math.min(r, M + T))) : k.key === "Home" ? (k.preventDefault(), _(n)) : k.key === "End" && (k.preventDefault(), _(r));
|
|
7448
7477
|
},
|
|
7449
|
-
[b,
|
|
7478
|
+
[b, y, n, r]
|
|
7450
7479
|
);
|
|
7451
7480
|
L(() => {
|
|
7452
7481
|
if (o)
|
|
@@ -7461,20 +7490,20 @@ function kd({
|
|
|
7461
7490
|
} catch {
|
|
7462
7491
|
}
|
|
7463
7492
|
}, [m, o]);
|
|
7464
|
-
const bt = b ? 0 :
|
|
7465
|
-
return /* @__PURE__ */
|
|
7493
|
+
const bt = b ? 0 : y ? x : 44;
|
|
7494
|
+
return /* @__PURE__ */ C(
|
|
7466
7495
|
"div",
|
|
7467
7496
|
{
|
|
7468
7497
|
ref: v,
|
|
7469
7498
|
"data-boring-workspace-part": "surface",
|
|
7470
|
-
className:
|
|
7499
|
+
className: te("flex h-full min-h-0 w-full bg-background", h),
|
|
7471
7500
|
"data-testid": "surface-shell",
|
|
7472
7501
|
children: [
|
|
7473
7502
|
/* @__PURE__ */ u(
|
|
7474
7503
|
"aside",
|
|
7475
7504
|
{
|
|
7476
7505
|
"data-boring-workspace-part": "surface-sidebar",
|
|
7477
|
-
"data-boring-state": b ? "collapsed" :
|
|
7506
|
+
"data-boring-state": b ? "collapsed" : y ? "expanded" : "rail",
|
|
7478
7507
|
className: "relative z-10 flex h-full min-h-0 flex-col overflow-hidden",
|
|
7479
7508
|
style: { width: bt, minWidth: bt, maxWidth: bt },
|
|
7480
7509
|
"aria-label": "Workbench left pane",
|
|
@@ -7485,7 +7514,7 @@ function kd({
|
|
|
7485
7514
|
bridge: rn,
|
|
7486
7515
|
defaultTab: c,
|
|
7487
7516
|
activeTab: $,
|
|
7488
|
-
activePanelId:
|
|
7517
|
+
activePanelId: E,
|
|
7489
7518
|
onActiveTabChange: A,
|
|
7490
7519
|
revealFileTreeRequest: R,
|
|
7491
7520
|
onOpenPanel: De,
|
|
@@ -7493,12 +7522,12 @@ function kd({
|
|
|
7493
7522
|
onCollapse: Le,
|
|
7494
7523
|
onExpand: Ue,
|
|
7495
7524
|
onCloseSourcePane: z,
|
|
7496
|
-
railOnly: !
|
|
7525
|
+
railOnly: !y
|
|
7497
7526
|
}
|
|
7498
7527
|
)
|
|
7499
7528
|
}
|
|
7500
7529
|
),
|
|
7501
|
-
!b &&
|
|
7530
|
+
!b && y && /* @__PURE__ */ u(
|
|
7502
7531
|
"div",
|
|
7503
7532
|
{
|
|
7504
7533
|
role: "separator",
|
|
@@ -7507,24 +7536,24 @@ function kd({
|
|
|
7507
7536
|
tabIndex: 0,
|
|
7508
7537
|
onPointerDown: on,
|
|
7509
7538
|
onPointerMove: sn,
|
|
7510
|
-
onPointerUp:
|
|
7511
|
-
onPointerCancel:
|
|
7539
|
+
onPointerUp: yt,
|
|
7540
|
+
onPointerCancel: yt,
|
|
7512
7541
|
onKeyDown: At,
|
|
7513
|
-
className:
|
|
7542
|
+
className: te(
|
|
7514
7543
|
"relative w-px shrink-0 cursor-col-resize bg-transparent transition-colors hover:bg-primary/40",
|
|
7515
7544
|
"focus-visible:outline-none focus-visible:bg-primary/50"
|
|
7516
7545
|
),
|
|
7517
7546
|
children: /* @__PURE__ */ u("span", { "aria-hidden": "true", className: "absolute inset-y-0 -left-1.5 -right-1.5" })
|
|
7518
7547
|
}
|
|
7519
7548
|
),
|
|
7520
|
-
/* @__PURE__ */
|
|
7549
|
+
/* @__PURE__ */ C("div", { className: "relative min-w-0 flex-1", children: [
|
|
7521
7550
|
/* @__PURE__ */ u(
|
|
7522
7551
|
"div",
|
|
7523
7552
|
{
|
|
7524
7553
|
"data-boring-workspace-part": "surface-tabs",
|
|
7525
|
-
"data-boring-state": b ? "collapsed" :
|
|
7554
|
+
"data-boring-state": b ? "collapsed" : y ? "expanded" : "rail",
|
|
7526
7555
|
className: "workbench-dockview h-full",
|
|
7527
|
-
"data-collapsed-sources":
|
|
7556
|
+
"data-collapsed-sources": y ? void 0 : "true",
|
|
7528
7557
|
"data-left-block-collapsed": b ? "true" : void 0,
|
|
7529
7558
|
children: /* @__PURE__ */ u(
|
|
7530
7559
|
Zo,
|
|
@@ -7536,7 +7565,7 @@ function kd({
|
|
|
7536
7565
|
)
|
|
7537
7566
|
}
|
|
7538
7567
|
),
|
|
7539
|
-
/* @__PURE__ */
|
|
7568
|
+
/* @__PURE__ */ C(
|
|
7540
7569
|
"div",
|
|
7541
7570
|
{
|
|
7542
7571
|
className: "pointer-events-none absolute inset-x-0 top-0 flex items-center justify-between",
|
|
@@ -7578,10 +7607,10 @@ function xd({ api: e }) {
|
|
|
7578
7607
|
return () => {
|
|
7579
7608
|
o.dispose(), i.dispose();
|
|
7580
7609
|
};
|
|
7581
|
-
}, [e]), t ? /* @__PURE__ */
|
|
7610
|
+
}, [e]), t ? /* @__PURE__ */ C(et, { children: [
|
|
7582
7611
|
/* @__PURE__ */ u("div", { className: "pointer-events-none absolute inset-x-0 top-0 flex items-center gap-0.5 border-b border-[color:oklch(from_var(--border)_l_c_h/0.4)] bg-background px-1", style: { height: 44 }, children: /* @__PURE__ */ u("div", { className: "flex-1" }) }),
|
|
7583
|
-
/* @__PURE__ */
|
|
7584
|
-
/* @__PURE__ */
|
|
7612
|
+
/* @__PURE__ */ C("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-start justify-center gap-2 px-6 pt-12 pb-10", children: [
|
|
7613
|
+
/* @__PURE__ */ C("div", { className: "flex items-center gap-2 text-[11px] font-medium tracking-tight text-muted-foreground/75", children: [
|
|
7585
7614
|
/* @__PURE__ */ u("span", { className: "inline-block h-px w-3 bg-[color:var(--accent)]", "aria-hidden": "true" }),
|
|
7586
7615
|
"Workbench"
|
|
7587
7616
|
] }),
|
|
@@ -7852,15 +7881,15 @@ function Vd(e) {
|
|
|
7852
7881
|
return;
|
|
7853
7882
|
}
|
|
7854
7883
|
let m = !1;
|
|
7855
|
-
const g = Ad(t, n, r, o, i), b = ni(Mn(e.apiBaseUrl ?? "", "/api/v1/agent-plugins/events"), e.workspaceId),
|
|
7884
|
+
const g = Ad(t, n, r, o, i), b = ni(Mn(e.apiBaseUrl ?? "", "/api/v1/agent-plugins/events"), e.workspaceId), y = new EventSource(b, { withCredentials: !0 }), $ = (w) => {
|
|
7856
7885
|
(async () => {
|
|
7857
7886
|
var D, H;
|
|
7858
7887
|
let v, W = !1;
|
|
7859
7888
|
try {
|
|
7860
|
-
if (v = JSON.parse(
|
|
7889
|
+
if (v = JSON.parse(w.data), m || v.workspaceId && e.workspaceId && v.workspaceId !== e.workspaceId) return;
|
|
7861
7890
|
v.replay && a.current.add(v.id);
|
|
7862
|
-
const
|
|
7863
|
-
if (!
|
|
7891
|
+
const E = h && v.replay === !0, F = s.current.get(v.id) ?? 0, R = l.current.get(v.id) ?? 0;
|
|
7892
|
+
if (!E && v.revision <= Math.max(F, R)) return;
|
|
7864
7893
|
l.current.set(v.id, v.revision);
|
|
7865
7894
|
const j = Lr(v, e.apiBaseUrl);
|
|
7866
7895
|
j && (W = !0, window.dispatchEvent(new CustomEvent(Ge, {
|
|
@@ -7889,7 +7918,7 @@ function Vd(e) {
|
|
|
7889
7918
|
error: G
|
|
7890
7919
|
};
|
|
7891
7920
|
}
|
|
7892
|
-
if (m || l.current.get(v.id) !== v.revision || !
|
|
7921
|
+
if (m || l.current.get(v.id) !== v.revision || !E && v.revision <= (s.current.get(v.id) ?? 0)) return;
|
|
7893
7922
|
if (!B) {
|
|
7894
7923
|
d.current.has(v.id) && (Lt(v.id, g), d.current.delete(v.id)), s.current.set(v.id, v.revision);
|
|
7895
7924
|
return;
|
|
@@ -7903,9 +7932,9 @@ function Vd(e) {
|
|
|
7903
7932
|
};
|
|
7904
7933
|
}
|
|
7905
7934
|
d.current.add(v.id), s.current.set(v.id, v.revision), window.dispatchEvent(new CustomEvent(Ge, { detail: v }));
|
|
7906
|
-
} catch (
|
|
7935
|
+
} catch (E) {
|
|
7907
7936
|
v && l.current.get(v.id) === v.revision && l.current.delete(v.id);
|
|
7908
|
-
const F = typeof
|
|
7937
|
+
const F = typeof E == "object" && E && "stage" in E && E.stage === "register" ? "register" : "import", R = typeof E == "object" && E && "error" in E ? E.error : E;
|
|
7909
7938
|
if (m) return;
|
|
7910
7939
|
const j = (v == null ? void 0 : v.id) ?? "<malformed>", B = R instanceof Error ? R.message : String(R);
|
|
7911
7940
|
if (console.error(`[boring-ui] failed to load plugin ${j}; keeping previous version`, R), v) {
|
|
@@ -7940,10 +7969,10 @@ function Vd(e) {
|
|
|
7940
7969
|
}));
|
|
7941
7970
|
}
|
|
7942
7971
|
})();
|
|
7943
|
-
}, A = (
|
|
7972
|
+
}, A = (w) => {
|
|
7944
7973
|
if (!m)
|
|
7945
7974
|
try {
|
|
7946
|
-
const v = JSON.parse(
|
|
7975
|
+
const v = JSON.parse(w.data);
|
|
7947
7976
|
if (v.workspaceId && e.workspaceId && v.workspaceId !== e.workspaceId) return;
|
|
7948
7977
|
const W = s.current.get(v.id) ?? 0, D = l.current.get(v.id) ?? 0;
|
|
7949
7978
|
if (v.revision <= Math.max(W, D)) return;
|
|
@@ -7951,10 +7980,10 @@ function Vd(e) {
|
|
|
7951
7980
|
} catch (v) {
|
|
7952
7981
|
console.error("[boring-ui] failed to process plugin unload event", v);
|
|
7953
7982
|
}
|
|
7954
|
-
}, x = (
|
|
7983
|
+
}, x = (w) => {
|
|
7955
7984
|
if (!m)
|
|
7956
7985
|
try {
|
|
7957
|
-
const v = JSON.parse(
|
|
7986
|
+
const v = JSON.parse(w.data);
|
|
7958
7987
|
if (v.workspaceId && e.workspaceId && v.workspaceId !== e.workspaceId) return;
|
|
7959
7988
|
console.error(`[boring-ui] plugin ${v.id} failed to reload: ${v.message}`), window.dispatchEvent(new CustomEvent(Ge, {
|
|
7960
7989
|
detail: {
|
|
@@ -7968,10 +7997,10 @@ function Vd(e) {
|
|
|
7968
7997
|
} catch (v) {
|
|
7969
7998
|
console.error("[boring-ui] failed to process plugin error event", v);
|
|
7970
7999
|
}
|
|
7971
|
-
}, _ = (
|
|
8000
|
+
}, _ = (w) => {
|
|
7972
8001
|
if (!m)
|
|
7973
8002
|
try {
|
|
7974
|
-
const v = JSON.parse(
|
|
8003
|
+
const v = JSON.parse(w.data);
|
|
7975
8004
|
if (v.workspaceId && e.workspaceId && v.workspaceId !== e.workspaceId) return;
|
|
7976
8005
|
const W = a.current;
|
|
7977
8006
|
for (const [D, H] of s.current.entries())
|
|
@@ -7989,12 +8018,12 @@ function Vd(e) {
|
|
|
7989
8018
|
console.error("[boring-ui] failed to process plugin replay-complete event", v);
|
|
7990
8019
|
}
|
|
7991
8020
|
};
|
|
7992
|
-
return
|
|
8021
|
+
return y.addEventListener("boring.plugin.load", $), y.addEventListener("boring.plugin.unload", A), y.addEventListener("boring.plugin.error", x), y.addEventListener("boring.plugin.replay-complete", _), () => {
|
|
7993
8022
|
if (m = !0, !p.current) {
|
|
7994
|
-
for (const
|
|
8023
|
+
for (const w of d.current) Lt(w, g);
|
|
7995
8024
|
d.current.clear(), s.current.clear(), l.current.clear(), a.current.clear();
|
|
7996
8025
|
}
|
|
7997
|
-
|
|
8026
|
+
y.close();
|
|
7998
8027
|
};
|
|
7999
8028
|
}, [e.apiBaseUrl, e.workspaceId, e.enabled, e.authHeaders, e.importFront, e.frontImportRetry, t, n, r, o, i, c]);
|
|
8000
8029
|
}
|
|
@@ -8025,7 +8054,7 @@ function ri() {
|
|
|
8025
8054
|
}
|
|
8026
8055
|
const Mr = "workspace-provider", Qd = "workspace-provider", Wn = Ne(null);
|
|
8027
8056
|
function pp() {
|
|
8028
|
-
const e =
|
|
8057
|
+
const e = we(Wn);
|
|
8029
8058
|
if (!e) throw new Error("useTheme must be used within a WorkspaceProvider");
|
|
8030
8059
|
return { theme: $n(), setTheme: e.setTheme, toggleTheme: e.toggleTheme };
|
|
8031
8060
|
}
|
|
@@ -8054,18 +8083,18 @@ function hp({ children: e, defaultTheme: t, onThemeChange: n }) {
|
|
|
8054
8083
|
}
|
|
8055
8084
|
const oi = Ne(null);
|
|
8056
8085
|
function mp() {
|
|
8057
|
-
const e =
|
|
8086
|
+
const e = we(oi);
|
|
8058
8087
|
if (!e) throw new Error("useWorkspaceBridge must be used within a WorkspaceProvider");
|
|
8059
8088
|
return e;
|
|
8060
8089
|
}
|
|
8061
8090
|
const zn = Ne(null);
|
|
8062
8091
|
function Zd() {
|
|
8063
|
-
const e =
|
|
8092
|
+
const e = we(zn);
|
|
8064
8093
|
if (!e) throw new Error("useWorkspaceContext must be used within a WorkspaceProvider");
|
|
8065
8094
|
return e;
|
|
8066
8095
|
}
|
|
8067
8096
|
function ef() {
|
|
8068
|
-
return
|
|
8097
|
+
return we(zn);
|
|
8069
8098
|
}
|
|
8070
8099
|
function tf() {
|
|
8071
8100
|
const { chatPanel: e } = Zd();
|
|
@@ -8202,17 +8231,17 @@ function gp({
|
|
|
8202
8231
|
onThemeChange: m,
|
|
8203
8232
|
workspaceId: g,
|
|
8204
8233
|
workspaceLabel: b,
|
|
8205
|
-
appTitle:
|
|
8234
|
+
appTitle: y,
|
|
8206
8235
|
storageKey: $,
|
|
8207
8236
|
persistenceEnabled: A = !0,
|
|
8208
8237
|
manageDocumentTitle: x = !0,
|
|
8209
8238
|
bridgeEndpoint: _,
|
|
8210
|
-
onAuthError:
|
|
8239
|
+
onAuthError: w,
|
|
8211
8240
|
onOpenFile: v,
|
|
8212
8241
|
debug: W = !1,
|
|
8213
8242
|
frontPluginHotReload: D = !1,
|
|
8214
8243
|
fullPageBasePath: H,
|
|
8215
|
-
commandPaletteSessionSearch:
|
|
8244
|
+
commandPaletteSessionSearch: E
|
|
8216
8245
|
}) {
|
|
8217
8246
|
const F = O(null);
|
|
8218
8247
|
if (!F.current) {
|
|
@@ -8227,8 +8256,8 @@ function gp({
|
|
|
8227
8256
|
}
|
|
8228
8257
|
const R = F.current, j = O(null), B = O(d);
|
|
8229
8258
|
B.current = d;
|
|
8230
|
-
const G = O(
|
|
8231
|
-
G.current =
|
|
8259
|
+
const G = O(w);
|
|
8260
|
+
G.current = w, L(() => () => {
|
|
8232
8261
|
var Z;
|
|
8233
8262
|
(Z = j.current) == null || Z.disconnect(), j.current = null, R.cleanup();
|
|
8234
8263
|
}, [R]), L(() => {
|
|
@@ -8318,8 +8347,8 @@ function gp({
|
|
|
8318
8347
|
[d, g]
|
|
8319
8348
|
);
|
|
8320
8349
|
L(() => {
|
|
8321
|
-
x && (document.title = Jd({ appTitle:
|
|
8322
|
-
}, [
|
|
8350
|
+
x && (document.title = Jd({ appTitle: y, workspaceLabel: b, workspaceId: g }));
|
|
8351
|
+
}, [y, x, g, b]);
|
|
8323
8352
|
const [Ue, z] = U(!1), ae = Y(
|
|
8324
8353
|
() => ({ connected: Ue }),
|
|
8325
8354
|
[Ue]
|
|
@@ -8335,13 +8364,13 @@ function gp({
|
|
|
8335
8364
|
commandRegistry: se,
|
|
8336
8365
|
catalogRegistry: ee,
|
|
8337
8366
|
surfaceResolverRegistry: be,
|
|
8338
|
-
children: /* @__PURE__ */ u(uc, { apiBaseUrl: a, workspaceId: g, authHeaders: Be, children: /* @__PURE__ */ u(Hs, { apiBaseUrl: a, workspaceId: g, authHeaders: Be, children: /* @__PURE__ */
|
|
8367
|
+
children: /* @__PURE__ */ u(uc, { apiBaseUrl: a, workspaceId: g, authHeaders: Be, children: /* @__PURE__ */ u(Hs, { apiBaseUrl: a, workspaceId: g, authHeaders: Be, children: /* @__PURE__ */ C(
|
|
8339
8368
|
af,
|
|
8340
8369
|
{
|
|
8341
8370
|
plugins: ze,
|
|
8342
8371
|
apiBaseUrl: a,
|
|
8343
8372
|
authHeaders: Be,
|
|
8344
|
-
onAuthError:
|
|
8373
|
+
onAuthError: w,
|
|
8345
8374
|
apiTimeout: c,
|
|
8346
8375
|
activeSessionId: f,
|
|
8347
8376
|
openSessionIds: p,
|
|
@@ -8360,7 +8389,7 @@ function gp({
|
|
|
8360
8389
|
/* @__PURE__ */ u(
|
|
8361
8390
|
du,
|
|
8362
8391
|
{
|
|
8363
|
-
sessionSearch:
|
|
8392
|
+
sessionSearch: E,
|
|
8364
8393
|
apiBaseUrl: a,
|
|
8365
8394
|
authHeaders: Be
|
|
8366
8395
|
}
|
|
@@ -8375,7 +8404,7 @@ function gp({
|
|
|
8375
8404
|
) }) }) }) }) }) });
|
|
8376
8405
|
}
|
|
8377
8406
|
export {
|
|
8378
|
-
|
|
8407
|
+
ne as $,
|
|
8379
8408
|
Zo as A,
|
|
8380
8409
|
ko as B,
|
|
8381
8410
|
Qr as C,
|
|
@@ -8497,5 +8526,5 @@ export {
|
|
|
8497
8526
|
Hs as w,
|
|
8498
8527
|
gp as x,
|
|
8499
8528
|
Zr as y,
|
|
8500
|
-
|
|
8529
|
+
ya as z
|
|
8501
8530
|
};
|