@pi-outpost/embed 0.59.1 → 0.60.1
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/{conversationExport-BWbYNcNf.js → conversationExport-C761zW6H.js} +1 -1
- package/dist/{conversationExport-DuKpkQDn.cjs → conversationExport-DaPkz-Eh.cjs} +1 -1
- package/dist/{conversationHistory-DXpSCV87.js → conversationHistory-DhOtJoSk.js} +647 -637
- package/dist/{conversationHistory-DIGz_MD4.cjs → conversationHistory-V6AR3Ga4.cjs} +3 -3
- package/dist/pi-outpost-embed.cjs +7 -7
- package/dist/pi-outpost-embed.js +507 -488
- package/package.json +1 -1
package/dist/pi-outpost-embed.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as e, D as t, E as n, I as r, L as i, M as a, N as o, O as s, P as c, R as l, T as u, _ as d, a as f, c as p, d as m, g as h, i as g, j as _, k as v, l as y, r as b, s as x, t as S, u as C, z as w } from "./conversationHistory-
|
|
1
|
+
import { A as e, D as t, E as n, I as r, L as i, M as a, N as o, O as s, P as c, R as l, T as u, _ as d, a as f, c as p, d as m, g as h, i as g, j as _, k as v, l as y, r as b, s as x, t as S, u as C, z as w } from "./conversationHistory-DhOtJoSk.js";
|
|
2
2
|
import { g as T, n as E, t as D } from "./lib-CSMo4o20.js";
|
|
3
|
-
import { a as ee, c as O, i as te, n as k, o as ne, r as A, s as j, t as
|
|
4
|
-
import { n as
|
|
5
|
-
import { Suspense as
|
|
3
|
+
import { a as ee, c as O, i as te, n as k, o as ne, r as A, s as j, t as re } from "./workspacePath-j4IUi8yY.js";
|
|
4
|
+
import { n as ie, t as ae } from "./findInPage-xFP831JH.js";
|
|
5
|
+
import { Suspense as oe, createElement as se, createRef as M, forwardRef as N, lazy as P, memo as F, useCallback as I, useContext as ce, useEffect as L, useId as R, useImperativeHandle as z, useLayoutEffect as le, useMemo as ue, useReducer as B, useRef as V, useState as H } from "react";
|
|
6
6
|
import { createRoot as de } from "react-dom/client";
|
|
7
7
|
import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
8
8
|
import { createPortal as fe } from "react-dom";
|
|
@@ -22,17 +22,25 @@ function ge(e) {
|
|
|
22
22
|
//#region ../ui/src/theme/useTheme.ts
|
|
23
23
|
function _e(e, t, n = document.documentElement, r) {
|
|
24
24
|
let i = t ? he() : null, [a, o] = H(r ?? i ?? e), s = V(r !== void 0 || i !== null);
|
|
25
|
-
|
|
25
|
+
L(() => {
|
|
26
26
|
s.current || o(e);
|
|
27
|
-
}, [e]),
|
|
27
|
+
}, [e]), L(() => {
|
|
28
28
|
function e(e) {
|
|
29
|
-
let t =
|
|
30
|
-
|
|
29
|
+
let t = window.parent === window ? window.location.origin : (() => {
|
|
30
|
+
try {
|
|
31
|
+
return new URL(document.referrer).origin;
|
|
32
|
+
} catch {
|
|
33
|
+
return "";
|
|
34
|
+
}
|
|
35
|
+
})();
|
|
36
|
+
if (e.source !== window.parent || e.origin !== t) return;
|
|
37
|
+
let n = e.data;
|
|
38
|
+
n?.type === "pi-outpost:set-theme" && (n.theme === "light" || n.theme === "dark" || n.theme === "system") && (s.current = !0, o(n.theme));
|
|
31
39
|
}
|
|
32
40
|
return window.addEventListener("message", e), () => window.removeEventListener("message", e);
|
|
33
41
|
}, []);
|
|
34
42
|
let [c, l] = H(me);
|
|
35
|
-
|
|
43
|
+
L(() => {
|
|
36
44
|
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = () => l(e.matches ? "dark" : "light");
|
|
37
45
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
38
46
|
}, []);
|
|
@@ -40,13 +48,13 @@ function _e(e, t, n = document.documentElement, r) {
|
|
|
40
48
|
le(() => {
|
|
41
49
|
n.dataset.theme = u;
|
|
42
50
|
}, [n, u]);
|
|
43
|
-
let d =
|
|
51
|
+
let d = I((e) => {
|
|
44
52
|
s.current = !0, o(e), t && ge(e);
|
|
45
53
|
}, [t]);
|
|
46
54
|
return {
|
|
47
55
|
theme: u,
|
|
48
56
|
preference: a,
|
|
49
|
-
toggle:
|
|
57
|
+
toggle: I(() => d(u === "dark" ? "light" : "dark"), [u, d]),
|
|
50
58
|
setTheme: d
|
|
51
59
|
};
|
|
52
60
|
}
|
|
@@ -255,11 +263,11 @@ function ke(e) {
|
|
|
255
263
|
let n = t.lastIndexOf(".");
|
|
256
264
|
if (!(n < 0)) return Oe[t.slice(n + 1).toLowerCase()];
|
|
257
265
|
}
|
|
258
|
-
var Ae =
|
|
266
|
+
var Ae = F(function({ code: e, path: t, onRendered: n }) {
|
|
259
267
|
let [r, i] = H(null), a = V(e);
|
|
260
268
|
a.current = e;
|
|
261
269
|
let o = V(n);
|
|
262
|
-
return o.current = n,
|
|
270
|
+
return o.current = n, L(() => {
|
|
263
271
|
let e = !1;
|
|
264
272
|
return i(null), De().then((n) => {
|
|
265
273
|
if (e) return;
|
|
@@ -320,17 +328,17 @@ function Ne({ lines: e }) {
|
|
|
320
328
|
//#region ../ui/src/components/UserMessage.tsx
|
|
321
329
|
function Pe({ item: e, canEdit: t, onEdit: n, queued: r }) {
|
|
322
330
|
let [i, a] = H(null), [o, s] = H(!1), c = V(null), l = t && e.entryId !== void 0 && !o, u = i !== null;
|
|
323
|
-
|
|
331
|
+
L(() => {
|
|
324
332
|
u && c.current?.focus();
|
|
325
|
-
}, [u]),
|
|
333
|
+
}, [u]), L(() => {
|
|
326
334
|
if (!o) return;
|
|
327
335
|
let e = setTimeout(() => s(!1), 3e3);
|
|
328
336
|
return () => clearTimeout(e);
|
|
329
337
|
}, [o]);
|
|
330
338
|
let d = r?.onDraftChange;
|
|
331
|
-
|
|
339
|
+
L(() => {
|
|
332
340
|
d?.(i);
|
|
333
|
-
}, [i, d]),
|
|
341
|
+
}, [i, d]), L(() => {
|
|
334
342
|
a(null);
|
|
335
343
|
}, [e.entryId, e.text]);
|
|
336
344
|
function f() {
|
|
@@ -872,7 +880,7 @@ function vt({ item: e, dispatch: t = Re }) {
|
|
|
872
880
|
let n = V(void 0), r = gt(e, n.current);
|
|
873
881
|
n.current = r.id;
|
|
874
882
|
let i = r.startsExpanded === !0, [a, o] = H(i);
|
|
875
|
-
|
|
883
|
+
L(() => {
|
|
876
884
|
o(i);
|
|
877
885
|
}, [i]);
|
|
878
886
|
let [s, c] = H(!1), l = V(null), u = r.compactHeader ? void 0 : e.callHtml, d = r.compactHeader ? "" : _t(e.args), f = r.Collapsed, p = !a && f !== void 0 && (r.hasCollapsed?.(e) ?? !0);
|
|
@@ -1779,10 +1787,10 @@ function on({ analysis: e, onJump: t, onClose: n }) {
|
|
|
1779
1787
|
var sn = 2e3;
|
|
1780
1788
|
function cn({ items: e, scrollerRef: t, hideTools: n, onShowTools: r, onJump: i }) {
|
|
1781
1789
|
let [a, o] = H(null), s = V(null), [c, l] = H(0), u = V(null);
|
|
1782
|
-
|
|
1790
|
+
L(() => () => {
|
|
1783
1791
|
u.current && clearTimeout(u.current);
|
|
1784
1792
|
}, []);
|
|
1785
|
-
let d =
|
|
1793
|
+
let d = I((t) => {
|
|
1786
1794
|
let i = e[t];
|
|
1787
1795
|
i && (i.kind === "tool" && n && r(), s.current = t, l((e) => e + 1));
|
|
1788
1796
|
}, [
|
|
@@ -1790,7 +1798,7 @@ function cn({ items: e, scrollerRef: t, hideTools: n, onShowTools: r, onJump: i
|
|
|
1790
1798
|
n,
|
|
1791
1799
|
r
|
|
1792
1800
|
]);
|
|
1793
|
-
return
|
|
1801
|
+
return L(() => {
|
|
1794
1802
|
let e = s.current;
|
|
1795
1803
|
if (e === null) return;
|
|
1796
1804
|
s.current = null;
|
|
@@ -1850,7 +1858,7 @@ function gn(e, t) {
|
|
|
1850
1858
|
//#region ../ui/src/components/SendQueueNow.tsx
|
|
1851
1859
|
function _n({ isStreaming: e, count: t, canSend: n = !0, onSend: r }) {
|
|
1852
1860
|
let [i, a] = H(!1);
|
|
1853
|
-
|
|
1861
|
+
L(() => {
|
|
1854
1862
|
(!e || !n) && a(!1);
|
|
1855
1863
|
}, [e, n]);
|
|
1856
1864
|
let o = t === 1 ? "send now" : `send all ${t} now`;
|
|
@@ -1935,7 +1943,7 @@ function Tn(e) {
|
|
|
1935
1943
|
});
|
|
1936
1944
|
}
|
|
1937
1945
|
function En(e) {
|
|
1938
|
-
return e.type.startsWith("image/") ? "image" : e.type === "application/pdf" || ee(e.name) ||
|
|
1946
|
+
return e.type.startsWith("image/") ? "image" : e.type === "application/pdf" || ee(e.name) || re(e.name) ? "extraction-tool" : e.size <= 524288 ? "inline-text" : kn(e) && e.size <= 26214400 ? "extraction-tool" : "unsupported";
|
|
1939
1947
|
}
|
|
1940
1948
|
function Dn(e) {
|
|
1941
1949
|
let t = En(e);
|
|
@@ -2079,7 +2087,7 @@ function Hn(e, t) {
|
|
|
2079
2087
|
}
|
|
2080
2088
|
function Un(e) {
|
|
2081
2089
|
let t = V(null);
|
|
2082
|
-
return
|
|
2090
|
+
return L(() => {
|
|
2083
2091
|
function n(n) {
|
|
2084
2092
|
t.current && !Hn(n, t.current) && e();
|
|
2085
2093
|
}
|
|
@@ -2108,13 +2116,13 @@ function Jn(e, t) {
|
|
|
2108
2116
|
}
|
|
2109
2117
|
function Yn({ isStreaming: e, connected: t, commands: n, fileSearch: r, prefill: i, attachments: a, pendingUploads: o = [], onAttach: s, onMentionPaths: c, onRemoveAttachment: l, onSend: u, onAbort: d, onSearchFiles: f, onClearFileSearch: p, initialDraft: m, onDraftChange: h }) {
|
|
2110
2118
|
let [g, _] = H(m ?? "");
|
|
2111
|
-
|
|
2119
|
+
L(() => {
|
|
2112
2120
|
h?.(g);
|
|
2113
2121
|
}, [g, h]);
|
|
2114
2122
|
let [v, y] = H(0), [b, x] = H(0), [S, C] = H(!1), w = V(null), T = V(null), E = V(null), D = V(null), ee = V(null);
|
|
2115
|
-
|
|
2123
|
+
L(() => {
|
|
2116
2124
|
i && _(i.text);
|
|
2117
|
-
}, [i?.nonce]),
|
|
2125
|
+
}, [i?.nonce]), L(() => {
|
|
2118
2126
|
ee.current !== null && (E.current?.focus(), E.current?.setSelectionRange(ee.current, ee.current), ee.current = null);
|
|
2119
2127
|
}, [g]), le(() => {
|
|
2120
2128
|
let e = E.current;
|
|
@@ -2129,7 +2137,7 @@ function Yn({ isStreaming: e, connected: t, commands: n, fileSearch: r, prefill:
|
|
|
2129
2137
|
return r?.observe(e, { box: "border-box" }), () => r?.disconnect();
|
|
2130
2138
|
}, [g]);
|
|
2131
2139
|
let O = ue(() => Ln(g), [g]);
|
|
2132
|
-
|
|
2140
|
+
L(() => {
|
|
2133
2141
|
c(O);
|
|
2134
2142
|
}, [O.join("\n")]);
|
|
2135
2143
|
let te = ue(() => {
|
|
@@ -2139,7 +2147,7 @@ function Yn({ isStreaming: e, connected: t, commands: n, fileSearch: r, prefill:
|
|
|
2139
2147
|
let n = e.name.toLowerCase().startsWith(te);
|
|
2140
2148
|
return n === t.name.toLowerCase().startsWith(te) ? Gn.compare(e.name, t.name) : n ? -1 : 1;
|
|
2141
2149
|
}).slice(0, Wn), [te, n]), ne = te === null ? Jn(g, v) : null;
|
|
2142
|
-
|
|
2150
|
+
L(() => {
|
|
2143
2151
|
if (!ne || ne.query.length === 0) {
|
|
2144
2152
|
p();
|
|
2145
2153
|
return;
|
|
@@ -2161,12 +2169,12 @@ function Yn({ isStreaming: e, connected: t, commands: n, fileSearch: r, prefill:
|
|
|
2161
2169
|
k,
|
|
2162
2170
|
ne,
|
|
2163
2171
|
r
|
|
2164
|
-
]), j = A !== null && !S,
|
|
2165
|
-
|
|
2172
|
+
]), j = A !== null && !S, re = te === null ? ne ? `file:${ne.query}` : null : `cmd:${te}`;
|
|
2173
|
+
L(() => {
|
|
2166
2174
|
x(0);
|
|
2167
|
-
}, [
|
|
2175
|
+
}, [re]), L(() => {
|
|
2168
2176
|
C(!1);
|
|
2169
|
-
}, [te === null ? ne ? "file" : null : "command"]),
|
|
2177
|
+
}, [te === null ? ne ? "file" : null : "command"]), L(() => {
|
|
2170
2178
|
if (!j) return;
|
|
2171
2179
|
let e = (e) => {
|
|
2172
2180
|
Hn(e, w.current) || C(!0);
|
|
@@ -2174,16 +2182,16 @@ function Yn({ isStreaming: e, connected: t, commands: n, fileSearch: r, prefill:
|
|
|
2174
2182
|
return document.addEventListener("mousedown", e), document.addEventListener("touchstart", e), () => {
|
|
2175
2183
|
document.removeEventListener("mousedown", e), document.removeEventListener("touchstart", e);
|
|
2176
2184
|
};
|
|
2177
|
-
}, [j]),
|
|
2185
|
+
}, [j]), L(() => {
|
|
2178
2186
|
T.current?.querySelector("[data-selected=\"true\"]")?.scrollIntoView({ block: "nearest" });
|
|
2179
2187
|
}, [b]);
|
|
2180
|
-
let
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
}, [
|
|
2184
|
-
function
|
|
2185
|
-
if (
|
|
2186
|
-
|
|
2188
|
+
let ie = o.length > 0, [ae, oe] = H(!1);
|
|
2189
|
+
L(() => {
|
|
2190
|
+
ie || oe(!1);
|
|
2191
|
+
}, [ie]);
|
|
2192
|
+
function se() {
|
|
2193
|
+
if (ie) {
|
|
2194
|
+
oe(!0);
|
|
2187
2195
|
return;
|
|
2188
2196
|
}
|
|
2189
2197
|
let e = Rn(g, a), t = a.filter((e) => e.kind === "image").map((e) => ({
|
|
@@ -2192,29 +2200,29 @@ function Yn({ isStreaming: e, connected: t, commands: n, fileSearch: r, prefill:
|
|
|
2192
2200
|
})), n = a.every((e) => e.kind === "path");
|
|
2193
2201
|
(g.trim() || !n && e || t.length !== 0) && (u(e, t.length > 0 ? t : void 0), _(""), p());
|
|
2194
2202
|
}
|
|
2195
|
-
function
|
|
2203
|
+
function M(e) {
|
|
2196
2204
|
let t = `/${e.name} `;
|
|
2197
2205
|
_(t), ee.current = t.length, y(t.length);
|
|
2198
2206
|
}
|
|
2199
|
-
function
|
|
2207
|
+
function N(e) {
|
|
2200
2208
|
if (!ne) return;
|
|
2201
2209
|
let t = g.slice(0, ne.start), n = g.slice(v), r = `@${e.path}${qn(e.type) ? "/" : " "}`, i = `${t}${r}${n}`;
|
|
2202
2210
|
_(i), p();
|
|
2203
2211
|
let a = t.length + r.length;
|
|
2204
2212
|
ee.current = a, y(a);
|
|
2205
2213
|
}
|
|
2206
|
-
function
|
|
2214
|
+
function P() {
|
|
2207
2215
|
if (A) {
|
|
2208
2216
|
if (A.kind === "command") {
|
|
2209
2217
|
let e = A.items[b];
|
|
2210
|
-
e &&
|
|
2218
|
+
e && M(e);
|
|
2211
2219
|
} else {
|
|
2212
2220
|
let e = A.items[b];
|
|
2213
|
-
e &&
|
|
2221
|
+
e && N(e);
|
|
2214
2222
|
}
|
|
2215
2223
|
}
|
|
2216
2224
|
}
|
|
2217
|
-
function
|
|
2225
|
+
function F(e) {
|
|
2218
2226
|
if (j && A) {
|
|
2219
2227
|
if (e.key === "ArrowDown") {
|
|
2220
2228
|
e.preventDefault(), x((e) => (e + 1) % A.items.length);
|
|
@@ -2225,7 +2233,7 @@ function Yn({ isStreaming: e, connected: t, commands: n, fileSearch: r, prefill:
|
|
|
2225
2233
|
return;
|
|
2226
2234
|
}
|
|
2227
2235
|
if (e.key === "Tab" || e.key === "Enter") {
|
|
2228
|
-
e.preventDefault(),
|
|
2236
|
+
e.preventDefault(), P();
|
|
2229
2237
|
return;
|
|
2230
2238
|
}
|
|
2231
2239
|
if (e.key === "Escape") {
|
|
@@ -2233,12 +2241,12 @@ function Yn({ isStreaming: e, connected: t, commands: n, fileSearch: r, prefill:
|
|
|
2233
2241
|
return;
|
|
2234
2242
|
}
|
|
2235
2243
|
}
|
|
2236
|
-
e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && (e.preventDefault(),
|
|
2244
|
+
e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && (e.preventDefault(), se());
|
|
2237
2245
|
}
|
|
2238
|
-
function
|
|
2246
|
+
function I(e) {
|
|
2239
2247
|
y(e.currentTarget.selectionStart ?? 0);
|
|
2240
2248
|
}
|
|
2241
|
-
function
|
|
2249
|
+
function ce(e) {
|
|
2242
2250
|
let t = Array.from(e.clipboardData.files);
|
|
2243
2251
|
t.length > 0 && (e.preventDefault(), s(t));
|
|
2244
2252
|
}
|
|
@@ -2246,7 +2254,7 @@ function Yn({ isStreaming: e, connected: t, commands: n, fileSearch: r, prefill:
|
|
|
2246
2254
|
ref: w,
|
|
2247
2255
|
className: "relative",
|
|
2248
2256
|
children: [
|
|
2249
|
-
(a.length > 0 ||
|
|
2257
|
+
(a.length > 0 || ie) && /* @__PURE__ */ G("div", {
|
|
2250
2258
|
className: "mb-2 flex flex-wrap gap-2",
|
|
2251
2259
|
children: [
|
|
2252
2260
|
o.map((e) => /* @__PURE__ */ G("span", {
|
|
@@ -2269,7 +2277,7 @@ function Yn({ isStreaming: e, connected: t, commands: n, fileSearch: r, prefill:
|
|
|
2269
2277
|
})
|
|
2270
2278
|
]
|
|
2271
2279
|
}, e.id)),
|
|
2272
|
-
|
|
2280
|
+
ae && /* @__PURE__ */ W("span", {
|
|
2273
2281
|
role: "status",
|
|
2274
2282
|
className: "flex items-center py-1 text-xs text-amber-600 dark:text-amber-400",
|
|
2275
2283
|
children: "waiting for the attachment to finish uploading…"
|
|
@@ -2309,7 +2317,7 @@ function Yn({ isStreaming: e, connected: t, commands: n, fileSearch: r, prefill:
|
|
|
2309
2317
|
type: "button",
|
|
2310
2318
|
"data-selected": t === b,
|
|
2311
2319
|
onMouseEnter: () => x(t),
|
|
2312
|
-
onClick: () =>
|
|
2320
|
+
onClick: () => M(e),
|
|
2313
2321
|
className: `flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-sm ${t === b ? "bg-zinc-100 dark:bg-zinc-800" : ""}`,
|
|
2314
2322
|
children: [
|
|
2315
2323
|
/* @__PURE__ */ G("span", {
|
|
@@ -2333,7 +2341,7 @@ function Yn({ isStreaming: e, connected: t, commands: n, fileSearch: r, prefill:
|
|
|
2333
2341
|
type: "button",
|
|
2334
2342
|
"data-selected": t === b,
|
|
2335
2343
|
onMouseEnter: () => x(t),
|
|
2336
|
-
onClick: () =>
|
|
2344
|
+
onClick: () => N(e),
|
|
2337
2345
|
className: `flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-sm ${t === b ? "bg-zinc-100 dark:bg-zinc-800" : ""}`,
|
|
2338
2346
|
children: /* @__PURE__ */ G("span", {
|
|
2339
2347
|
className: "min-w-0 flex-1 truncate font-mono text-zinc-800 dark:text-zinc-200",
|
|
@@ -2350,10 +2358,10 @@ function Yn({ isStreaming: e, connected: t, commands: n, fileSearch: r, prefill:
|
|
|
2350
2358
|
onChange: (e) => {
|
|
2351
2359
|
_(e.target.value), y(e.target.selectionStart ?? e.target.value.length);
|
|
2352
2360
|
},
|
|
2353
|
-
onKeyDown:
|
|
2354
|
-
onClick:
|
|
2355
|
-
onKeyUp:
|
|
2356
|
-
onPaste:
|
|
2361
|
+
onKeyDown: F,
|
|
2362
|
+
onClick: I,
|
|
2363
|
+
onKeyUp: I,
|
|
2364
|
+
onPaste: ce,
|
|
2357
2365
|
placeholder: t ? e ? "steer the agent… (Enter to send)" : "message pi… (/ for commands, @ for files, Enter to send, Shift+Enter for newline)" : "connecting…",
|
|
2358
2366
|
disabled: !t,
|
|
2359
2367
|
rows: 1,
|
|
@@ -2411,9 +2419,9 @@ function Yn({ isStreaming: e, connected: t, commands: n, fileSearch: r, prefill:
|
|
|
2411
2419
|
}),
|
|
2412
2420
|
/* @__PURE__ */ W("button", {
|
|
2413
2421
|
type: "button",
|
|
2414
|
-
onClick:
|
|
2415
|
-
disabled: !t ||
|
|
2416
|
-
title:
|
|
2422
|
+
onClick: se,
|
|
2423
|
+
disabled: !t || ie || !g.trim() && a.length === 0,
|
|
2424
|
+
title: ie ? "waiting for an attachment to finish uploading" : e ? "steer" : "send",
|
|
2417
2425
|
"aria-label": e ? "Steer the agent" : "Send message",
|
|
2418
2426
|
className: "rounded-lg bg-zinc-900 p-2 text-zinc-100 hover:bg-zinc-800 disabled:opacity-30 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-white",
|
|
2419
2427
|
children: e ? /* @__PURE__ */ G("svg", {
|
|
@@ -2497,7 +2505,7 @@ function ar(e) {
|
|
|
2497
2505
|
return `grid grid-cols-1 gap-2${e.length > 1 && e.every((e) => e.length <= 120) ? " @min-[41rem]:grid-cols-2" : ""}`;
|
|
2498
2506
|
}
|
|
2499
2507
|
function or({ request: e, onRespond: t }) {
|
|
2500
|
-
let n =
|
|
2508
|
+
let n = R(), [r, i] = H(e.method === "editor" ? e.prefill ?? "" : ""), [a, o] = H([]), s = (e.method === "select" || e.method === "confirm" || e.method === "input") && e.timeout, [c, l] = H(s ? Math.ceil(s / 1e3) : null), u = ir(e), { heading: d, body: f } = nr(e.title);
|
|
2501
2509
|
function p() {
|
|
2502
2510
|
t({
|
|
2503
2511
|
id: e.id,
|
|
@@ -2514,7 +2522,7 @@ function or({ request: e, onRespond: t }) {
|
|
|
2514
2522
|
value: n.length > 0 ? n : a.join(",")
|
|
2515
2523
|
});
|
|
2516
2524
|
}
|
|
2517
|
-
return
|
|
2525
|
+
return L(() => {
|
|
2518
2526
|
if (c === null) return;
|
|
2519
2527
|
if (c <= 0) {
|
|
2520
2528
|
t({
|
|
@@ -2726,8 +2734,8 @@ var sr = "rounded-md border px-3 py-1.5 text-sm border-zinc-200 hover:bg-zinc-10
|
|
|
2726
2734
|
minute: "2-digit"
|
|
2727
2735
|
});
|
|
2728
2736
|
function ur({ request: e, onRespond: t }) {
|
|
2729
|
-
let n =
|
|
2730
|
-
|
|
2737
|
+
let n = R(), [r, i] = H(null);
|
|
2738
|
+
L(() => i(null), [e.id]);
|
|
2731
2739
|
function a(n) {
|
|
2732
2740
|
r || (i(n), t(e.id, n));
|
|
2733
2741
|
}
|
|
@@ -2834,9 +2842,9 @@ var dr = {
|
|
|
2834
2842
|
}, fr = 6e3;
|
|
2835
2843
|
function pr({ notification: e, onDismiss: t }) {
|
|
2836
2844
|
let n = V(t);
|
|
2837
|
-
return
|
|
2845
|
+
return L(() => {
|
|
2838
2846
|
n.current = t;
|
|
2839
|
-
}),
|
|
2847
|
+
}), L(() => {
|
|
2840
2848
|
let e = setTimeout(() => n.current(), fr);
|
|
2841
2849
|
return () => clearTimeout(e);
|
|
2842
2850
|
}, [e.id]), /* @__PURE__ */ G("div", {
|
|
@@ -3019,7 +3027,7 @@ function Dr() {
|
|
|
3019
3027
|
throw Er = null, e;
|
|
3020
3028
|
}), Er;
|
|
3021
3029
|
}
|
|
3022
|
-
var Or =
|
|
3030
|
+
var Or = P(() => {
|
|
3023
3031
|
if (Tr !== null) {
|
|
3024
3032
|
let e = Tr;
|
|
3025
3033
|
return { then: (t) => t({ default: e.CodeEditor }) };
|
|
@@ -3138,14 +3146,17 @@ function zr(e) {
|
|
|
3138
3146
|
quot: "\""
|
|
3139
3147
|
})[t]);
|
|
3140
3148
|
}
|
|
3141
|
-
var Br =
|
|
3149
|
+
var Br = /<\\\/style/gi;
|
|
3150
|
+
function Vr(e) {
|
|
3151
|
+
return e.replace(/</g, "\\3C ");
|
|
3152
|
+
}
|
|
3142
3153
|
function Hr(e, t) {
|
|
3143
3154
|
let { html: n, css: r, format: i } = Lr(t), { width: a, height: o, paper: s } = Ar[i];
|
|
3144
3155
|
return `<!doctype html>
|
|
3145
3156
|
<html>
|
|
3146
3157
|
<head>
|
|
3147
3158
|
<meta charset="utf-8">
|
|
3148
|
-
<meta name="poster-format" content="${i}">
|
|
3159
|
+
<meta name="poster-format" content="${Rr(i)}">
|
|
3149
3160
|
<title>${Rr(e)}</title>
|
|
3150
3161
|
<style>
|
|
3151
3162
|
@page { size: ${s}; margin: 0; }
|
|
@@ -3155,7 +3166,7 @@ body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
|
|
|
3155
3166
|
.poster-page { width: ${a}px; height: ${o}px; overflow: hidden; position: relative; }
|
|
3156
3167
|
</style>
|
|
3157
3168
|
<style data-poster>
|
|
3158
|
-
${r
|
|
3169
|
+
${Vr(r)}
|
|
3159
3170
|
</style>
|
|
3160
3171
|
</head>
|
|
3161
3172
|
<body><div class="poster-page">${n}</div></body>
|
|
@@ -3182,7 +3193,7 @@ function qr(e) {
|
|
|
3182
3193
|
if (!i) throw new Nr("this is not a poster: it has no <div class=\"poster-page\"> holding its markup");
|
|
3183
3194
|
let a = e.slice(i.index + i[0].length), o = [...a.matchAll(new RegExp(Kr.source, "gi"))].at(-1);
|
|
3184
3195
|
if (!o || o.index === void 0) throw new Nr("this is not a poster: its <div class=\"poster-page\"> is not closed before </body>");
|
|
3185
|
-
let s = r.replace(/^\r?\n/, "").replace(/\r?\n$/, "").replace(
|
|
3196
|
+
let s = r.replace(/^\r?\n/, "").replace(/\r?\n$/, "").replace(Br, "</style"), c = {
|
|
3186
3197
|
html: a.slice(0, o.index),
|
|
3187
3198
|
css: s,
|
|
3188
3199
|
format: t
|
|
@@ -3219,13 +3230,13 @@ var Xr = 20971520, Zr = {
|
|
|
3219
3230
|
DRAWIO_EDIT: "pi-outpost:poster-drawio-edit",
|
|
3220
3231
|
PICTURE_LIST: "pi-outpost:poster-picture-list",
|
|
3221
3232
|
PICTURE_READ: "pi-outpost:poster-picture-read"
|
|
3222
|
-
}, Qr = "poster-editor.html", $r = 3e4, ei =
|
|
3233
|
+
}, Qr = "poster-editor.html", $r = 3e4, ei = N(function({ serverUrl: t }, n) {
|
|
3223
3234
|
let [r, i] = H(null), a = V(null), o = V(Promise.resolve()), s = V(null), c = V(0);
|
|
3224
3235
|
function l(e, t) {
|
|
3225
3236
|
let n = a.current;
|
|
3226
3237
|
n !== null && n.id === e && (clearTimeout(n.timer), a.current = null, i(null), t instanceof Error ? n.reject(t) : n.resolve(t));
|
|
3227
3238
|
}
|
|
3228
|
-
if (
|
|
3239
|
+
if (z(n, () => ({ draw(e) {
|
|
3229
3240
|
let t = () => new Promise((t, n) => {
|
|
3230
3241
|
let r = ++c.current, o = setTimeout(() => l(r, /* @__PURE__ */ Error("the draw.io viewer did not answer")), $r);
|
|
3231
3242
|
a.current = {
|
|
@@ -3239,7 +3250,7 @@ var Xr = 20971520, Zr = {
|
|
|
3239
3250
|
});
|
|
3240
3251
|
}), n = o.current.then(t, t);
|
|
3241
3252
|
return o.current = n.catch(() => void 0), n;
|
|
3242
|
-
} }), []),
|
|
3253
|
+
} }), []), L(() => () => {
|
|
3243
3254
|
let e = a.current;
|
|
3244
3255
|
e !== null && (clearTimeout(e.timer), a.current = null, e.reject(/* @__PURE__ */ Error("the poster was closed")));
|
|
3245
3256
|
}, []), r === null) return null;
|
|
@@ -3310,10 +3321,10 @@ function ai({ path: e, content: t, mtimeMs: n, writable: i, loadFile: o, fallbac
|
|
|
3310
3321
|
poster: v,
|
|
3311
3322
|
loadFile: o
|
|
3312
3323
|
};
|
|
3313
|
-
let [
|
|
3314
|
-
|
|
3315
|
-
let
|
|
3316
|
-
|
|
3324
|
+
let [re, ie] = H(null), ae = V(re);
|
|
3325
|
+
ae.current = re;
|
|
3326
|
+
let oe = V(!1), se = V(() => {});
|
|
3327
|
+
L(() => {
|
|
3317
3328
|
let e = !0, t = new URL(_).origin, n = (e) => h.current?.contentWindow?.postMessage(e, t), r = (t, r) => {
|
|
3318
3329
|
e && n({
|
|
3319
3330
|
type: Zr.ANSWER,
|
|
@@ -3321,7 +3332,7 @@ function ai({ path: e, content: t, mtimeMs: n, writable: i, loadFile: o, fallbac
|
|
|
3321
3332
|
value: r
|
|
3322
3333
|
});
|
|
3323
3334
|
};
|
|
3324
|
-
|
|
3335
|
+
se.current = r;
|
|
3325
3336
|
let a = 0;
|
|
3326
3337
|
async function o() {
|
|
3327
3338
|
let t = ++a, { path: r, content: o, mtimeMs: s, poster: c, dark: l } = j.current;
|
|
@@ -3420,7 +3431,7 @@ function ai({ path: e, content: t, mtimeMs: n, writable: i, loadFile: o, fallbac
|
|
|
3420
3431
|
ok: !1,
|
|
3421
3432
|
message: e
|
|
3422
3433
|
});
|
|
3423
|
-
if (
|
|
3434
|
+
if (ae.current !== null) return a("another diagram is open for touch-up");
|
|
3424
3435
|
let o = O(j.current.path, n);
|
|
3425
3436
|
if (!k(o)) return a(`"${n}" is not a .drawio file`);
|
|
3426
3437
|
if (u === void 0) return a("this view cannot read the project's files");
|
|
@@ -3430,7 +3441,7 @@ function ai({ path: e, content: t, mtimeMs: n, writable: i, loadFile: o, fallbac
|
|
|
3430
3441
|
} catch (e) {
|
|
3431
3442
|
return a(`"${n}" could not be opened: ${e instanceof Error ? e.message : String(e)}`);
|
|
3432
3443
|
}
|
|
3433
|
-
e && (
|
|
3444
|
+
e && (oe.current = !1, ie({
|
|
3434
3445
|
file: o,
|
|
3435
3446
|
page: i,
|
|
3436
3447
|
id: t,
|
|
@@ -3480,22 +3491,22 @@ function ai({ path: e, content: t, mtimeMs: n, writable: i, loadFile: o, fallbac
|
|
|
3480
3491
|
}
|
|
3481
3492
|
}
|
|
3482
3493
|
return window.addEventListener("message", w), () => {
|
|
3483
|
-
e = !1, ne.current = !1,
|
|
3494
|
+
e = !1, ne.current = !1, ie(null), D.current = () => {}, A.current?.(!1), window.removeEventListener("message", w);
|
|
3484
3495
|
};
|
|
3485
3496
|
}, [
|
|
3486
3497
|
_,
|
|
3487
3498
|
u,
|
|
3488
3499
|
i
|
|
3489
|
-
]),
|
|
3500
|
+
]), L(() => D.current(), [t, n]), L(() => {
|
|
3490
3501
|
ne.current && h.current?.contentWindow?.postMessage({
|
|
3491
3502
|
type: Zr.THEME,
|
|
3492
3503
|
theme: f ? "dark" : "light"
|
|
3493
3504
|
}, new URL(_).origin);
|
|
3494
3505
|
}, [f, _]);
|
|
3495
|
-
async function
|
|
3496
|
-
let e =
|
|
3497
|
-
if (e === null ||
|
|
3498
|
-
|
|
3506
|
+
async function M() {
|
|
3507
|
+
let e = ae.current;
|
|
3508
|
+
if (e === null || oe.current && !window.confirm(ri)) return;
|
|
3509
|
+
ie(null);
|
|
3499
3510
|
let t;
|
|
3500
3511
|
try {
|
|
3501
3512
|
t = {
|
|
@@ -3508,21 +3519,21 @@ function ai({ path: e, content: t, mtimeMs: n, writable: i, loadFile: o, fallbac
|
|
|
3508
3519
|
message: `the diagram could not be read again: ${e instanceof Error ? e.message : String(e)}`
|
|
3509
3520
|
};
|
|
3510
3521
|
}
|
|
3511
|
-
|
|
3522
|
+
se.current(e.id, t);
|
|
3512
3523
|
}
|
|
3513
|
-
let
|
|
3514
|
-
|
|
3515
|
-
if (
|
|
3516
|
-
|
|
3524
|
+
let N = V(null);
|
|
3525
|
+
L(() => {
|
|
3526
|
+
if (re === null) return;
|
|
3527
|
+
N.current?.focus();
|
|
3517
3528
|
function e(e) {
|
|
3518
|
-
e.key !== "Escape" || e.defaultPrevented || (e.preventDefault(), e.stopImmediatePropagation(),
|
|
3529
|
+
e.key !== "Escape" || e.defaultPrevented || (e.preventDefault(), e.stopImmediatePropagation(), P.current());
|
|
3519
3530
|
}
|
|
3520
3531
|
return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
|
|
3521
|
-
}, [
|
|
3522
|
-
let
|
|
3523
|
-
|
|
3524
|
-
let
|
|
3525
|
-
|
|
3532
|
+
}, [re]);
|
|
3533
|
+
let P = V(M);
|
|
3534
|
+
P.current = M;
|
|
3535
|
+
let F = I(() => void P.current(), []), ce = I((e) => {
|
|
3536
|
+
oe.current = e;
|
|
3526
3537
|
}, []);
|
|
3527
3538
|
return "problem" in v ? /* @__PURE__ */ G("div", {
|
|
3528
3539
|
"data-testid": "poster-unreadable",
|
|
@@ -3548,12 +3559,12 @@ function ai({ path: e, content: t, mtimeMs: n, writable: i, loadFile: o, fallbac
|
|
|
3548
3559
|
ref: g,
|
|
3549
3560
|
serverUrl: l
|
|
3550
3561
|
}),
|
|
3551
|
-
|
|
3552
|
-
ref:
|
|
3562
|
+
re !== null && r(h.current) !== void 0 && fe(/* @__PURE__ */ W("div", {
|
|
3563
|
+
ref: N,
|
|
3553
3564
|
tabIndex: -1,
|
|
3554
3565
|
role: "dialog",
|
|
3555
3566
|
"aria-modal": "true",
|
|
3556
|
-
"aria-label": `Touch up ${
|
|
3567
|
+
"aria-label": `Touch up ${re.file}`,
|
|
3557
3568
|
"data-testid": "poster-diagram-touch-up",
|
|
3558
3569
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4 outline-none",
|
|
3559
3570
|
children: /* @__PURE__ */ G("div", {
|
|
@@ -3563,20 +3574,20 @@ function ai({ path: e, content: t, mtimeMs: n, writable: i, loadFile: o, fallbac
|
|
|
3563
3574
|
children: [
|
|
3564
3575
|
/* @__PURE__ */ G("span", {
|
|
3565
3576
|
className: "min-w-0 flex-1 truncate font-medium",
|
|
3566
|
-
title:
|
|
3567
|
-
children: [
|
|
3577
|
+
title: re.file,
|
|
3578
|
+
children: [re.file, re.page === void 0 ? "" : ` — ${re.page}`]
|
|
3568
3579
|
}),
|
|
3569
3580
|
d && /* @__PURE__ */ W("button", {
|
|
3570
3581
|
type: "button",
|
|
3571
3582
|
className: "text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50",
|
|
3572
|
-
onClick: () => d(
|
|
3583
|
+
onClick: () => d(re.file),
|
|
3573
3584
|
title: "Open the diagram in draw.io desktop, for anything more than a touch-up; its saves come back here",
|
|
3574
3585
|
children: "↗ draw.io desktop"
|
|
3575
3586
|
}),
|
|
3576
3587
|
/* @__PURE__ */ W("button", {
|
|
3577
3588
|
type: "button",
|
|
3578
3589
|
className: "text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50",
|
|
3579
|
-
onClick: () => void
|
|
3590
|
+
onClick: () => void M(),
|
|
3580
3591
|
title: "Back to the poster, which takes the diagram as saved (Escape)",
|
|
3581
3592
|
children: "back to the poster"
|
|
3582
3593
|
})
|
|
@@ -3584,12 +3595,12 @@ function ai({ path: e, content: t, mtimeMs: n, writable: i, loadFile: o, fallbac
|
|
|
3584
3595
|
}), /* @__PURE__ */ W("div", {
|
|
3585
3596
|
className: "min-h-0 flex-1",
|
|
3586
3597
|
children: /* @__PURE__ */ W(x, {
|
|
3587
|
-
path:
|
|
3598
|
+
path: re.file,
|
|
3588
3599
|
variant: "viewer",
|
|
3589
|
-
page:
|
|
3600
|
+
page: re.page,
|
|
3590
3601
|
startTouchUp: !0,
|
|
3591
|
-
onTouchUpDirtyChange:
|
|
3592
|
-
onEscape:
|
|
3602
|
+
onTouchUpDirtyChange: ce,
|
|
3603
|
+
onEscape: F
|
|
3593
3604
|
})
|
|
3594
3605
|
})]
|
|
3595
3606
|
})
|
|
@@ -3740,7 +3751,7 @@ async function pi(e, t, n) {
|
|
|
3740
3751
|
var mi = "allow-scripts allow-popups allow-popups-to-escape-sandbox";
|
|
3741
3752
|
function hi({ source: e, path: t, load: n, onOpen: r }) {
|
|
3742
3753
|
let i = V(null), [a, o] = H(null);
|
|
3743
|
-
return
|
|
3754
|
+
return L(() => {
|
|
3744
3755
|
let r = !0;
|
|
3745
3756
|
return pi(e, t, n).then((e) => {
|
|
3746
3757
|
r && o(e);
|
|
@@ -3753,7 +3764,7 @@ function hi({ source: e, path: t, load: n, onOpen: r }) {
|
|
|
3753
3764
|
e,
|
|
3754
3765
|
t,
|
|
3755
3766
|
n
|
|
3756
|
-
]),
|
|
3767
|
+
]), L(() => {
|
|
3757
3768
|
function e(e) {
|
|
3758
3769
|
if (i.current === null || e.source !== i.current.contentWindow) return;
|
|
3759
3770
|
let n = e.data;
|
|
@@ -3777,7 +3788,7 @@ function hi({ source: e, path: t, load: n, onOpen: r }) {
|
|
|
3777
3788
|
//#region ../ui/src/components/FindBar.tsx
|
|
3778
3789
|
function gi({ query: e, onQueryChange: t, matchCount: n, truncated: r = !1, currentIndex: i, searching: a = !1, onNext: o, onPrev: s, onClose: c, inputRef: l }) {
|
|
3779
3790
|
let u = V(null), d = l ?? u;
|
|
3780
|
-
|
|
3791
|
+
L(() => {
|
|
3781
3792
|
d.current?.focus(), d.current?.select();
|
|
3782
3793
|
}, []);
|
|
3783
3794
|
let f = n === 0 ? a ? "searching…" : "0/0" : `${i + 1}/${n}${r ? "+" : ""}`;
|
|
@@ -3833,10 +3844,10 @@ function gi({ query: e, onQueryChange: t, matchCount: n, truncated: r = !1, curr
|
|
|
3833
3844
|
}
|
|
3834
3845
|
//#endregion
|
|
3835
3846
|
//#region ../ui/src/components/FileViewer.tsx
|
|
3836
|
-
var _i =
|
|
3847
|
+
var _i = P(() => import("./PdfViewer-DOE0n8FV.js")), vi = 250, yi = "(min-width: 768px)";
|
|
3837
3848
|
function bi() {
|
|
3838
3849
|
let [e, t] = H(() => window.matchMedia?.(yi).matches ?? !0);
|
|
3839
|
-
return
|
|
3850
|
+
return L(() => {
|
|
3840
3851
|
let e = window.matchMedia?.(yi);
|
|
3841
3852
|
if (e === void 0) return;
|
|
3842
3853
|
let n = () => t(e.matches);
|
|
@@ -3845,7 +3856,7 @@ function bi() {
|
|
|
3845
3856
|
}
|
|
3846
3857
|
function xi(e, t) {
|
|
3847
3858
|
let [n, r] = H(e);
|
|
3848
|
-
return
|
|
3859
|
+
return L(() => {
|
|
3849
3860
|
let n = window.setTimeout(() => r(e), t);
|
|
3850
3861
|
return () => window.clearTimeout(n);
|
|
3851
3862
|
}, [e, t]), n;
|
|
@@ -3868,20 +3879,20 @@ function Di(e) {
|
|
|
3868
3879
|
function Oi(e, t) {
|
|
3869
3880
|
return t === void 0 ? !0 : t === null ? !1 : t === "" || e === t || e.startsWith(`${t}/`);
|
|
3870
3881
|
}
|
|
3871
|
-
function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitState: u, initialShowGitDiff: f = !1, gitDiff: p, gitBaseline: m = null, onFetchGitDiff: g, onClearGitDiff: _, inRepository: v, onOpenGitHistory: y, onClose: b, onReload: S, onSave: C, serverUrl: w = "", token: k = null, workspace: A, docxTemplate: j, onImageLoad:
|
|
3872
|
-
let [
|
|
3882
|
+
function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitState: u, initialShowGitDiff: f = !1, gitDiff: p, gitBaseline: m = null, onFetchGitDiff: g, onClearGitDiff: _, inRepository: v, onOpenGitHistory: y, onClose: b, onReload: S, onSave: C, serverUrl: w = "", token: k = null, workspace: A, docxTemplate: j, onImageLoad: re, onPdfLoad: se, rawRevision: M = 0, onOpenNative: N }) {
|
|
3883
|
+
let [P, F] = H("rendered"), [ce, R] = H(null), [z, le] = H(f), [B, de] = H(r.status === "loaded" && r.justCreated ? {
|
|
3873
3884
|
draft: r.content,
|
|
3874
3885
|
baseContent: r.content,
|
|
3875
3886
|
baseMtimeMs: r.mtimeMs
|
|
3876
|
-
} : null), [fe, pe] = H("idle"), me = V(null), [he, ge] = H(0), _e =
|
|
3877
|
-
|
|
3887
|
+
} : null), [fe, pe] = H("idle"), me = V(null), [he, ge] = H(0), _e = I(() => ge((e) => e + 1), []), ve = V(null), K = r.status === "loaded" ? r : null, be = K !== null && wi(r.path), xe = K !== null && Di(r.path), Se = K !== null && Ei(r.path) && !xe, Ce = K !== null && Ti(r.path), we = te(r.path), Te = ee(r.path), Ee = ue(() => K === null ? void 0 : o(K.content), [K?.content]), De = Ee?.status === "valid", Oe = Ee?.status === "valid" || Ee?.status === "invalid", ke = Oe || be || Se || Ce, je = P === "source", Ne = bi(), Pe = Oi(r.path, a) && !Te, Fe = K !== null && !we && !Te;
|
|
3888
|
+
L(() => {
|
|
3878
3889
|
Fe && Dr().catch(() => {});
|
|
3879
3890
|
}, [Fe]);
|
|
3880
3891
|
let Ie = B !== null && B.draft !== B.baseContent, [Le, Re] = H(!1), ze = Ie || Le, Be = K?.pendingSave !== void 0, Ve = B !== null && K !== null && K.mtimeMs !== B.baseMtimeMs, He = K?.saveError?.conflict === !0 || Ve, Ue = B?.draft ?? K?.content ?? "", We = xi(Ue, vi), Ge = ue(() => K === null ? void 0 : o(We), [We, K === null]), [Ke, qe] = H(() => r.status === "loaded" ? Si(r.content) : void 0);
|
|
3881
|
-
|
|
3892
|
+
L(() => {
|
|
3882
3893
|
Ge?.status === "valid" && qe(Ge.envelope);
|
|
3883
3894
|
}, [Ge]);
|
|
3884
|
-
let Je = Ge !== void 0 && Ge.status !== "valid" && Ke !== void 0, Ye = Ge?.status === "invalid" ? We === K?.content && K.documentIssues !== void 0 ? K.documentIssues : Ge.issues : void 0, Xe = Ge?.status === "not-a-document" ? Ge.why === "unparseable" ? "This is not parseable JSON yet." : "This no longer declares a structured-exchange `schema`." : Ge?.status === "unsupported-version" ? `This declares ${Ge.schema}, which this version does not render.` : void 0, Ze =
|
|
3895
|
+
let Je = Ge !== void 0 && Ge.status !== "valid" && Ke !== void 0, Ye = Ge?.status === "invalid" ? We === K?.content && K.documentIssues !== void 0 ? K.documentIssues : Ge.issues : void 0, Xe = Ge?.status === "not-a-document" ? Ge.why === "unparseable" ? "This is not parseable JSON yet." : "This no longer declares a structured-exchange `schema`." : Ge?.status === "unsupported-version" ? `This declares ${Ge.schema}, which this version does not render.` : void 0, Ze = P === "split" && ke && !z && K !== null && Ne, Qe = z ? void 0 : Ze ? Oe ? Ke : void 0 : B === null && !je && Ee?.status === "valid" ? Ee.envelope : void 0, $e = V(null), et = B !== null, tt = K !== null && B === null && !Ze && !z && (!be || je) && (!De || je) && (!Se || je) && (!Ce || je) && (!xe || je), nt = z || Ze ? "none" : Te ? "pdf" : B !== null || tt ? "text" : K !== null && !we ? "dom" : "none", [rt, it] = H(!1), [at, ot] = H(""), [st, ct] = H(0), lt = V(null), ut = V(null), dt = V(null), [ft, pt] = H({
|
|
3885
3896
|
matchCount: 0,
|
|
3886
3897
|
currentIndex: -1,
|
|
3887
3898
|
searching: !1
|
|
@@ -3892,14 +3903,14 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
3892
3903
|
let t = yt.current[e]?.marks;
|
|
3893
3904
|
t?.[0]?.isConnected && t[0].scrollIntoView({ block: "center" });
|
|
3894
3905
|
}
|
|
3895
|
-
let Ct = rt ? at : "", wt = ue(() => nt === "text" ?
|
|
3906
|
+
let Ct = rt ? at : "", wt = ue(() => nt === "text" ? ae(Ue, Ct) : [], [
|
|
3896
3907
|
nt,
|
|
3897
3908
|
Ue,
|
|
3898
3909
|
Ct
|
|
3899
3910
|
]);
|
|
3900
|
-
|
|
3911
|
+
L(() => {
|
|
3901
3912
|
rt && nt === "none" && it(!1);
|
|
3902
|
-
}, [rt, nt]),
|
|
3913
|
+
}, [rt, nt]), L(() => {
|
|
3903
3914
|
function e() {
|
|
3904
3915
|
vt.current?.clear(), vt.current = null, yt.current = [], ht([]), _t(!1);
|
|
3905
3916
|
}
|
|
@@ -3909,7 +3920,7 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
3909
3920
|
return;
|
|
3910
3921
|
}
|
|
3911
3922
|
vt.current?.clear();
|
|
3912
|
-
let n =
|
|
3923
|
+
let n = ie(t, Ct);
|
|
3913
3924
|
vt.current = n, yt.current = n.matches, ht(n.matches), _t(n.truncated);
|
|
3914
3925
|
let r = Ct !== xt.current;
|
|
3915
3926
|
xt.current = Ct;
|
|
@@ -3918,16 +3929,16 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
3918
3929
|
}, [
|
|
3919
3930
|
nt,
|
|
3920
3931
|
Ct,
|
|
3921
|
-
|
|
3932
|
+
P,
|
|
3922
3933
|
je
|
|
3923
3934
|
]);
|
|
3924
3935
|
function Tt(e, t) {
|
|
3925
3936
|
let n = e[t];
|
|
3926
3937
|
n !== void 0 && me.current?.select(n.start, n.end);
|
|
3927
3938
|
}
|
|
3928
|
-
|
|
3939
|
+
L(() => {
|
|
3929
3940
|
if (nt !== "text" || !rt) return;
|
|
3930
|
-
let e =
|
|
3941
|
+
let e = ae(Ue, Ct), t = Ct !== xt.current;
|
|
3931
3942
|
xt.current = Ct;
|
|
3932
3943
|
let n = t ? 0 : Math.min(st, Math.max(e.length - 1, 0));
|
|
3933
3944
|
ct(n), e.length > 0 && Tt(e, n);
|
|
@@ -3937,7 +3948,7 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
3937
3948
|
rt,
|
|
3938
3949
|
et,
|
|
3939
3950
|
he
|
|
3940
|
-
]),
|
|
3951
|
+
]), L(() => {
|
|
3941
3952
|
me.current?.markMatches(nt === "text" ? wt : [], st);
|
|
3942
3953
|
}, [
|
|
3943
3954
|
nt,
|
|
@@ -3947,12 +3958,12 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
3947
3958
|
he
|
|
3948
3959
|
]);
|
|
3949
3960
|
let Et = K?.reveal, [Dt, Ot] = H(void 0);
|
|
3950
|
-
|
|
3961
|
+
L(() => {
|
|
3951
3962
|
if (Et !== void 0 && K !== null) {
|
|
3952
3963
|
if (Et.page !== void 0) Ot({ page: Et.page });
|
|
3953
3964
|
else if (Et.line !== void 0) {
|
|
3954
|
-
B === null &&
|
|
3955
|
-
let e =
|
|
3965
|
+
B === null && F("source");
|
|
3966
|
+
let e = ae(Ue, Et.query), t = Ai(Ue, Et.line), n = e.findIndex((e) => e.start >= t);
|
|
3956
3967
|
xt.current = Et.query, ct(n === -1 ? 0 : n);
|
|
3957
3968
|
}
|
|
3958
3969
|
ot(Et.query), it(!0);
|
|
@@ -4005,7 +4016,7 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4005
4016
|
currentIndex: mt.length > 0 ? Math.min(st, mt.length - 1) : -1,
|
|
4006
4017
|
truncated: gt,
|
|
4007
4018
|
searching: !1
|
|
4008
|
-
}, Pt = B === null ? null : /* @__PURE__ */ W(
|
|
4019
|
+
}, Pt = B === null ? null : /* @__PURE__ */ W(oe, {
|
|
4009
4020
|
fallback: /* @__PURE__ */ W("div", {
|
|
4010
4021
|
className: "p-4 text-sm text-zinc-400 dark:text-zinc-600",
|
|
4011
4022
|
children: "loading editor…"
|
|
@@ -4026,7 +4037,7 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4026
4037
|
})
|
|
4027
4038
|
}, "editor");
|
|
4028
4039
|
function Ft(e) {
|
|
4029
|
-
return K === null ? null : /* @__PURE__ */ W(
|
|
4040
|
+
return K === null ? null : /* @__PURE__ */ W(oe, {
|
|
4030
4041
|
fallback: /* @__PURE__ */ W("div", {
|
|
4031
4042
|
className: "p-4",
|
|
4032
4043
|
children: /* @__PURE__ */ W(Ae, {
|
|
@@ -4044,7 +4055,7 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4044
4055
|
})
|
|
4045
4056
|
}, "source");
|
|
4046
4057
|
}
|
|
4047
|
-
let It =
|
|
4058
|
+
let It = I((e) => fetch(ne(w, e, k, void 0, A)).then((e) => e.ok ? e.blob() : void 0, () => void 0), [
|
|
4048
4059
|
w,
|
|
4049
4060
|
k,
|
|
4050
4061
|
A
|
|
@@ -4091,24 +4102,24 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4091
4102
|
});
|
|
4092
4103
|
}
|
|
4093
4104
|
function Rt(e) {
|
|
4094
|
-
(
|
|
4105
|
+
(P !== "split" || e === "split" || !Ie || window.confirm("Discard unsaved changes?")) && (e === P || !Le || window.confirm("Discard unsaved changes?")) && (P === "split" && e !== "split" && de(null), R(null), F(e));
|
|
4095
4106
|
}
|
|
4096
4107
|
function zt() {
|
|
4097
4108
|
(!ze || window.confirm("Discard unsaved changes?")) && b();
|
|
4098
4109
|
}
|
|
4099
4110
|
function Bt() {
|
|
4100
|
-
K && (!Le || window.confirm("Discard unsaved changes?")) && (ke &&
|
|
4111
|
+
K && (!Le || window.confirm("Discard unsaved changes?")) && (ke && P === "rendered" ? (R("rendered"), F(Ne ? "split" : "source")) : xe && P === "rendered" && (R("rendered"), F("source")), de({
|
|
4101
4112
|
draft: K.content,
|
|
4102
4113
|
baseContent: K.content,
|
|
4103
4114
|
baseMtimeMs: K.mtimeMs
|
|
4104
4115
|
}));
|
|
4105
4116
|
}
|
|
4106
4117
|
function Vt() {
|
|
4107
|
-
|
|
4118
|
+
ce === null ? de(Ze && K !== null ? {
|
|
4108
4119
|
draft: K.content,
|
|
4109
4120
|
baseContent: K.content,
|
|
4110
4121
|
baseMtimeMs: K.mtimeMs
|
|
4111
|
-
} : null) : (de(null),
|
|
4122
|
+
} : null) : (de(null), F(ce), R(null));
|
|
4112
4123
|
}
|
|
4113
4124
|
function Ht(e = !1) {
|
|
4114
4125
|
K && B !== null && !Be && (ve.current = B.draft, C(r.path, B.draft, B.baseMtimeMs, e));
|
|
@@ -4117,16 +4128,16 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4117
4128
|
de(null), S(r.path);
|
|
4118
4129
|
}
|
|
4119
4130
|
function Wt() {
|
|
4120
|
-
let e = !
|
|
4131
|
+
let e = !z;
|
|
4121
4132
|
le(e), e ? g(r.path) : _();
|
|
4122
4133
|
}
|
|
4123
|
-
return
|
|
4134
|
+
return L(() => {
|
|
4124
4135
|
B !== null && K !== null && ve.current !== null && K.content === ve.current && K.mtimeMs !== B.baseMtimeMs && (ve.current = null, de({
|
|
4125
4136
|
...B,
|
|
4126
4137
|
baseContent: K.content,
|
|
4127
4138
|
baseMtimeMs: K.mtimeMs
|
|
4128
4139
|
}));
|
|
4129
|
-
}, [K?.mtimeMs]),
|
|
4140
|
+
}, [K?.mtimeMs]), L(() => {
|
|
4130
4141
|
function e(e) {
|
|
4131
4142
|
if (e.key === "Escape") rt ? At() : zt();
|
|
4132
4143
|
else if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "f") {
|
|
@@ -4135,7 +4146,7 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4135
4146
|
}
|
|
4136
4147
|
}
|
|
4137
4148
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
4138
|
-
}),
|
|
4149
|
+
}), L(() => {
|
|
4139
4150
|
Ze && Pe && B === null && K !== null && de({
|
|
4140
4151
|
draft: K.content,
|
|
4141
4152
|
baseContent: K.content,
|
|
@@ -4145,15 +4156,15 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4145
4156
|
Ze,
|
|
4146
4157
|
Pe,
|
|
4147
4158
|
K?.mtimeMs
|
|
4148
|
-
]),
|
|
4159
|
+
]), L(() => {
|
|
4149
4160
|
pe(s ? "streaming" : (e) => e === "streaming" ? "done" : e);
|
|
4150
|
-
}, [s]),
|
|
4161
|
+
}, [s]), L(() => (l(ze), () => l(!1)), [ze]), L(() => (f && g(r.path), () => _()), []), /* @__PURE__ */ G("div", {
|
|
4151
4162
|
className: "absolute inset-0 z-20 flex flex-col bg-white dark:bg-zinc-950",
|
|
4152
4163
|
children: [
|
|
4153
4164
|
/* @__PURE__ */ G("div", {
|
|
4154
4165
|
className: "flex items-center gap-2 border-b border-zinc-200 px-3 py-2 dark:border-zinc-800",
|
|
4155
4166
|
children: [
|
|
4156
|
-
(ke || xe) && !
|
|
4167
|
+
(ke || xe) && !z && /* @__PURE__ */ W("div", {
|
|
4157
4168
|
className: "flex shrink-0 items-center gap-0.5",
|
|
4158
4169
|
role: "group",
|
|
4159
4170
|
"aria-label": "How to show this document",
|
|
@@ -4176,18 +4187,18 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4176
4187
|
].filter(([e]) => !(xe && e === "split")).map(([e, t, n]) => /* @__PURE__ */ W("button", {
|
|
4177
4188
|
type: "button",
|
|
4178
4189
|
onClick: () => Rt(e),
|
|
4179
|
-
"aria-pressed":
|
|
4190
|
+
"aria-pressed": P === e,
|
|
4180
4191
|
title: n,
|
|
4181
|
-
className: `rounded px-1.5 py-0.5 text-xs ${
|
|
4192
|
+
className: `rounded px-1.5 py-0.5 text-xs ${P === e ? "bg-zinc-100 text-zinc-700 dark:bg-zinc-800 dark:text-zinc-200" : "text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300"}`,
|
|
4182
4193
|
children: t
|
|
4183
4194
|
}, e))
|
|
4184
4195
|
}),
|
|
4185
4196
|
u !== void 0 && B === null && /* @__PURE__ */ W("button", {
|
|
4186
4197
|
type: "button",
|
|
4187
4198
|
onClick: Wt,
|
|
4188
|
-
"aria-pressed":
|
|
4189
|
-
title:
|
|
4190
|
-
className: `shrink-0 rounded px-1.5 py-0.5 text-xs ${
|
|
4199
|
+
"aria-pressed": z,
|
|
4200
|
+
title: z ? "Show file content" : "Show uncommitted changes (vs HEAD)",
|
|
4201
|
+
className: `shrink-0 rounded px-1.5 py-0.5 text-xs ${z ? "bg-amber-100 text-amber-800 dark:bg-amber-950/60 dark:text-amber-300" : "text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300"}`,
|
|
4191
4202
|
children: "± diff"
|
|
4192
4203
|
}),
|
|
4193
4204
|
v && B === null && /* @__PURE__ */ W("button", {
|
|
@@ -4205,14 +4216,14 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4205
4216
|
children: "●"
|
|
4206
4217
|
})]
|
|
4207
4218
|
}),
|
|
4208
|
-
Ce &&
|
|
4219
|
+
Ce && N && /* @__PURE__ */ W("button", {
|
|
4209
4220
|
type: "button",
|
|
4210
|
-
onClick: () =>
|
|
4221
|
+
onClick: () => N(r.path),
|
|
4211
4222
|
title: "Open with the application associated with .drawio files — draw.io desktop, where it is installed",
|
|
4212
4223
|
className: "shrink-0 rounded border border-zinc-300 px-2 py-0.5 text-xs text-zinc-600 hover:border-zinc-400 hover:text-zinc-900 dark:border-zinc-700 dark:text-zinc-300 dark:hover:border-zinc-500 dark:hover:text-zinc-100",
|
|
4213
4224
|
children: "↗ open in draw.io"
|
|
4214
4225
|
}),
|
|
4215
|
-
K && !we && !Te && !Ce && !xe && !
|
|
4226
|
+
K && !we && !Te && !Ce && !xe && !z && !Oe && /* @__PURE__ */ W(kr, {
|
|
4216
4227
|
text: Ue,
|
|
4217
4228
|
path: r.path,
|
|
4218
4229
|
serverUrl: w,
|
|
@@ -4244,7 +4255,7 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4244
4255
|
children: "⤓ svg"
|
|
4245
4256
|
}),
|
|
4246
4257
|
K && B === null && /* @__PURE__ */ W(i, { text: K.content }),
|
|
4247
|
-
K && B === null && !
|
|
4258
|
+
K && B === null && !z && Pe && /* @__PURE__ */ W("button", {
|
|
4248
4259
|
type: "button",
|
|
4249
4260
|
onClick: Bt,
|
|
4250
4261
|
className: "shrink-0 rounded border border-zinc-300 px-2 py-0.5 text-xs text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-700 dark:text-zinc-400 dark:hover:border-zinc-500 dark:hover:text-zinc-200",
|
|
@@ -4320,7 +4331,7 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4320
4331
|
/* @__PURE__ */ G("div", {
|
|
4321
4332
|
className: "min-h-0 flex-1 overflow-auto",
|
|
4322
4333
|
children: [
|
|
4323
|
-
|
|
4334
|
+
z && B === null && /* @__PURE__ */ G("div", {
|
|
4324
4335
|
className: "p-4",
|
|
4325
4336
|
children: [
|
|
4326
4337
|
p?.path === r.path && "error" in p && /* @__PURE__ */ W("div", {
|
|
@@ -4337,9 +4348,9 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4337
4348
|
})
|
|
4338
4349
|
]
|
|
4339
4350
|
}),
|
|
4340
|
-
Te && B === null && !
|
|
4351
|
+
Te && B === null && !z && /* @__PURE__ */ W(n, {
|
|
4341
4352
|
label: "This PDF",
|
|
4342
|
-
children: /* @__PURE__ */ W(
|
|
4353
|
+
children: /* @__PURE__ */ W(oe, {
|
|
4343
4354
|
fallback: /* @__PURE__ */ W("div", {
|
|
4344
4355
|
className: "p-4 text-sm text-zinc-400 dark:text-zinc-600",
|
|
4345
4356
|
children: "loading…"
|
|
@@ -4350,24 +4361,24 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4350
4361
|
serverUrl: w,
|
|
4351
4362
|
token: k,
|
|
4352
4363
|
workspace: A,
|
|
4353
|
-
revision:
|
|
4364
|
+
revision: M,
|
|
4354
4365
|
findQuery: nt === "pdf" ? Ct : "",
|
|
4355
4366
|
onFindStateChange: pt,
|
|
4356
4367
|
...Dt ? { startAt: Dt } : {},
|
|
4357
|
-
...
|
|
4368
|
+
...se ? { onLoaded: se } : {}
|
|
4358
4369
|
})
|
|
4359
4370
|
})
|
|
4360
4371
|
}),
|
|
4361
|
-
we && B === null && !
|
|
4372
|
+
we && B === null && !z && /* @__PURE__ */ W("div", {
|
|
4362
4373
|
className: "flex h-full items-center justify-center p-4",
|
|
4363
4374
|
children: /* @__PURE__ */ W("img", {
|
|
4364
|
-
src: ne(w, r.path, k,
|
|
4375
|
+
src: ne(w, r.path, k, M, A),
|
|
4365
4376
|
alt: r.path,
|
|
4366
|
-
onLoad: () =>
|
|
4377
|
+
onLoad: () => re?.(r.path),
|
|
4367
4378
|
className: "max-h-full max-w-full rounded object-contain"
|
|
4368
4379
|
})
|
|
4369
4380
|
}),
|
|
4370
|
-
r.status === "loading" && B === null && !
|
|
4381
|
+
r.status === "loading" && B === null && !z && !we && !Te && /* @__PURE__ */ W("div", {
|
|
4371
4382
|
className: "p-4 text-sm text-zinc-400 dark:text-zinc-600",
|
|
4372
4383
|
children: "loading…"
|
|
4373
4384
|
}),
|
|
@@ -4376,11 +4387,11 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4376
4387
|
children: r.message
|
|
4377
4388
|
}),
|
|
4378
4389
|
B !== null && !Ze && Pt,
|
|
4379
|
-
K && B === null && !Ze && !
|
|
4390
|
+
K && B === null && !Ze && !z && be && !je && /* @__PURE__ */ W("div", {
|
|
4380
4391
|
ref: ut,
|
|
4381
4392
|
children: Lt(K.content)
|
|
4382
4393
|
}),
|
|
4383
|
-
K && B === null && !Ze && !
|
|
4394
|
+
K && B === null && !Ze && !z && Ce && !je && /* @__PURE__ */ W("div", {
|
|
4384
4395
|
className: "h-full",
|
|
4385
4396
|
"data-testid": "file-drawio",
|
|
4386
4397
|
children: /* @__PURE__ */ W(x, {
|
|
@@ -4391,7 +4402,7 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4391
4402
|
onTouchUpDirtyChange: Re
|
|
4392
4403
|
})
|
|
4393
4404
|
}),
|
|
4394
|
-
K && B === null && !Ze && !
|
|
4405
|
+
K && B === null && !Ze && !z && xe && !je && /* @__PURE__ */ W("div", {
|
|
4395
4406
|
className: "h-full",
|
|
4396
4407
|
"data-testid": "file-poster",
|
|
4397
4408
|
children: /* @__PURE__ */ W(ai, {
|
|
@@ -4404,7 +4415,7 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4404
4415
|
onTouchUpDirtyChange: Re
|
|
4405
4416
|
})
|
|
4406
4417
|
}),
|
|
4407
|
-
K && B === null && !Ze && !
|
|
4418
|
+
K && B === null && !Ze && !z && Se && !je && /* @__PURE__ */ W("div", {
|
|
4408
4419
|
className: "h-full",
|
|
4409
4420
|
"data-testid": "file-html",
|
|
4410
4421
|
children: /* @__PURE__ */ W(hi, {
|
|
@@ -4487,7 +4498,7 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4487
4498
|
] })
|
|
4488
4499
|
})]
|
|
4489
4500
|
}),
|
|
4490
|
-
K && B === null && !Ze && !
|
|
4501
|
+
K && B === null && !Ze && !z && De && !je && Ee?.status === "valid" && /* @__PURE__ */ W(n, {
|
|
4491
4502
|
label: "This diagram",
|
|
4492
4503
|
children: /* @__PURE__ */ W("div", {
|
|
4493
4504
|
className: "mx-auto max-w-5xl p-4",
|
|
@@ -4503,7 +4514,7 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4503
4514
|
})
|
|
4504
4515
|
})
|
|
4505
4516
|
}),
|
|
4506
|
-
K && B === null && !Ze && !
|
|
4517
|
+
K && B === null && !Ze && !z && Ee?.status === "invalid" && /* @__PURE__ */ G("div", {
|
|
4507
4518
|
"data-testid": "file-structured-exchange-invalid",
|
|
4508
4519
|
className: "mx-4 mt-4 rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-200",
|
|
4509
4520
|
children: [/* @__PURE__ */ W("p", {
|
|
@@ -4528,7 +4539,7 @@ function ki({ file: r, writableRoot: a, isStreaming: s, onDirtyChange: l, gitSta
|
|
|
4528
4539
|
})]
|
|
4529
4540
|
})]
|
|
4530
4541
|
}),
|
|
4531
|
-
K && B === null && !Ze && !
|
|
4542
|
+
K && B === null && !Ze && !z && Ee?.status === "unsupported-version" && /* @__PURE__ */ G("div", {
|
|
4532
4543
|
"data-testid": "file-structured-exchange-unsupported",
|
|
4533
4544
|
className: "mx-4 mt-4 rounded-lg border border-zinc-300 bg-zinc-50 px-3 py-2 text-sm text-zinc-600 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-400",
|
|
4534
4545
|
children: [
|
|
@@ -4598,7 +4609,7 @@ function ji(e) {
|
|
|
4598
4609
|
});
|
|
4599
4610
|
}
|
|
4600
4611
|
function Mi({ show: e, onClose: t }) {
|
|
4601
|
-
return
|
|
4612
|
+
return L(() => {
|
|
4602
4613
|
function e(e) {
|
|
4603
4614
|
e.key === "Escape" && (e.stopImmediatePropagation(), t());
|
|
4604
4615
|
}
|
|
@@ -4681,10 +4692,10 @@ function zi(e, t, n) {
|
|
|
4681
4692
|
//#endregion
|
|
4682
4693
|
//#region ../ui/src/components/PanelResizeHandle.tsx
|
|
4683
4694
|
function Bi(e, t = "x") {
|
|
4684
|
-
let [n, r] = H(() => Ri(e)), i = V(n), a = V(null), o =
|
|
4695
|
+
let [n, r] = H(() => Ri(e)), i = V(n), a = V(null), o = I((t) => {
|
|
4685
4696
|
let n = Ii(t, e);
|
|
4686
4697
|
return i.current = n, r(n), n;
|
|
4687
|
-
}, [e]), s =
|
|
4698
|
+
}, [e]), s = I(() => {
|
|
4688
4699
|
a.current !== null && (a.current = null, zi(i.current, e));
|
|
4689
4700
|
}, [e]);
|
|
4690
4701
|
return {
|
|
@@ -4943,15 +4954,15 @@ function ra({ history: e, diff: t, dirty: n, onFetchDiff: r, onClearDiff: i, onC
|
|
|
4943
4954
|
g.current = {
|
|
4944
4955
|
onFetchDiff: r,
|
|
4945
4956
|
onClose: a
|
|
4946
|
-
},
|
|
4957
|
+
}, L(() => {
|
|
4947
4958
|
function e(e) {
|
|
4948
4959
|
e.key === "Escape" && (e.stopImmediatePropagation(), g.current.onClose());
|
|
4949
4960
|
}
|
|
4950
4961
|
return document.addEventListener("keydown", e, !0), () => document.removeEventListener("keydown", e, !0);
|
|
4951
|
-
}, []),
|
|
4962
|
+
}, []), L(() => {
|
|
4952
4963
|
c === null || l === null || ta(c, l) || g.current.onFetchDiff(c, l);
|
|
4953
4964
|
}, [c, l]);
|
|
4954
|
-
let _ =
|
|
4965
|
+
let _ = I((e, t) => {
|
|
4955
4966
|
let n = na(e);
|
|
4956
4967
|
s((r) => {
|
|
4957
4968
|
if (t === "base") return {
|
|
@@ -4974,15 +4985,15 @@ function ra({ history: e, diff: t, dirty: n, onFetchDiff: r, onClearDiff: i, onC
|
|
|
4974
4985
|
target: n
|
|
4975
4986
|
};
|
|
4976
4987
|
});
|
|
4977
|
-
}, [m]), v =
|
|
4988
|
+
}, [m]), v = I(() => {
|
|
4978
4989
|
s({
|
|
4979
4990
|
base: null,
|
|
4980
4991
|
target: null
|
|
4981
4992
|
}), i();
|
|
4982
|
-
}, [i]), y =
|
|
4993
|
+
}, [i]), y = I(() => s((e) => ({
|
|
4983
4994
|
base: e.target,
|
|
4984
4995
|
target: e.base
|
|
4985
|
-
})), []), b =
|
|
4996
|
+
})), []), b = I((e) => {
|
|
4986
4997
|
d((t) => {
|
|
4987
4998
|
let n = Math.max(0, Math.min(m.length - 1, t + e));
|
|
4988
4999
|
return f.current[n]?.focus(), n;
|
|
@@ -5314,7 +5325,7 @@ function ha({ className: e }) {
|
|
|
5314
5325
|
}
|
|
5315
5326
|
function ga(e) {
|
|
5316
5327
|
let { workspace: t, workspaces: n, locked: r } = e, [i, a] = H(!1), o = V(null);
|
|
5317
|
-
if (
|
|
5328
|
+
if (L(() => {
|
|
5318
5329
|
if (!i) return;
|
|
5319
5330
|
let e = (e) => {
|
|
5320
5331
|
Hn(e, o.current) || a(!1);
|
|
@@ -5469,7 +5480,7 @@ function ga(e) {
|
|
|
5469
5480
|
//#region ../ui/src/components/ServerPathPicker.tsx
|
|
5470
5481
|
function _a({ label: e, browse: t, onBrowse: n, onSelect: r, onCancel: i }) {
|
|
5471
5482
|
let a = t?.path ?? "/", o = t?.entries ?? [], s = t?.status === "loading", [c, l] = H(a);
|
|
5472
|
-
return
|
|
5483
|
+
return L(() => {
|
|
5473
5484
|
l(a);
|
|
5474
5485
|
}, [a]), /* @__PURE__ */ G("div", {
|
|
5475
5486
|
className: "rounded-md border border-zinc-300 p-2 dark:border-zinc-700",
|
|
@@ -5563,9 +5574,9 @@ function va(e) {
|
|
|
5563
5574
|
}
|
|
5564
5575
|
function ya(e) {
|
|
5565
5576
|
let { sandbox: t, applyState: n, blocked: r = !1, onCloseBrowser: i } = e, [a, o] = H(!1), s = V(!1);
|
|
5566
|
-
if (
|
|
5577
|
+
if (L(() => {
|
|
5567
5578
|
r && a && (s.current = !1, o(!1));
|
|
5568
|
-
}, [r, a]),
|
|
5579
|
+
}, [r, a]), L(() => {
|
|
5569
5580
|
s.current && n?.status !== "applying" && (n?.status === "error" ? s.current = !1 : (s.current = !1, o(!1), i()));
|
|
5570
5581
|
}, [n, i]), !t) return /* @__PURE__ */ W("span", {
|
|
5571
5582
|
className: `${la} border-dashed border-zinc-300 text-zinc-400 dark:border-zinc-700 dark:text-zinc-500`,
|
|
@@ -5629,7 +5640,7 @@ function Sa({ status: e, selected: t, log: n, onFetchLog: r, onCloseLog: i, onSh
|
|
|
5629
5640
|
}, l = Un(() => {
|
|
5630
5641
|
o && c();
|
|
5631
5642
|
}), u = e?.repos ?? [], d = (t === null ? null : gn(u, t)) ?? (t === null && u.length === 1 ? u[0] : null), f = d && (d.ahead > 0 || d.behind > 0) ? ` ${d.ahead > 0 ? `↑${d.ahead}` : ""}${d.behind > 0 ? `↓${d.behind}` : ""}` : "", p = u.length > 1 && d !== null && d.repo !== "" ? `${xa(d.repo)} ` : "", m = e === null ? "…" : d?.branch ?? "—", h = d !== null && n?.repo === d.repo ? n : null, g = h?.entries ?? null, _ = h?.error ?? null, v = ue(() => g === null ? null : Xi(g), [g]);
|
|
5632
|
-
return
|
|
5643
|
+
return L(() => {
|
|
5633
5644
|
o && d !== null && n?.repo !== d.repo && r(d.repo);
|
|
5634
5645
|
}, [
|
|
5635
5646
|
o,
|
|
@@ -6113,9 +6124,9 @@ function Ra({ packages: e, update: t, locked: n, onCheck: r, onUpdate: i, edits:
|
|
|
6113
6124
|
}
|
|
6114
6125
|
function za({ edits: e, busy: t }) {
|
|
6115
6126
|
let [n, r] = H(!1), [i, a] = H(""), [o, s] = H("user"), c = V(null), { lookup: l, change: u } = e, d = u?.status === "pending" && u.action === "install" ? u : null, f = u && u.action === "install" && (u.status === "failed" || u.status === "refused") ? u.message : null, p = ka(i), m = l && l.name === p.name && l.version === p.version && l.scope === o ? l : null;
|
|
6116
|
-
|
|
6127
|
+
L(() => {
|
|
6117
6128
|
u?.action === "install" && u.status === "installed" && (r(!1), a(""), s("user"));
|
|
6118
|
-
}, [u]),
|
|
6129
|
+
}, [u]), L(() => {
|
|
6119
6130
|
n && m?.status !== "found" && c.current?.focus();
|
|
6120
6131
|
}, [n, m?.status]);
|
|
6121
6132
|
let h = () => {
|
|
@@ -6609,23 +6620,31 @@ function eo({ kind: e, resources: t, removalLocked: n = !1, onRemove: r }) {
|
|
|
6609
6620
|
className: "mt-3 space-y-2",
|
|
6610
6621
|
children: t.map((e) => /* @__PURE__ */ G("li", {
|
|
6611
6622
|
className: "rounded-lg bg-zinc-50 px-3 py-2 dark:bg-zinc-800/70",
|
|
6612
|
-
children: [
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6623
|
+
children: [
|
|
6624
|
+
/* @__PURE__ */ G("div", {
|
|
6625
|
+
className: "flex items-center justify-between gap-2",
|
|
6626
|
+
children: [/* @__PURE__ */ W("p", {
|
|
6627
|
+
className: "truncate text-sm font-medium text-zinc-700 dark:text-zinc-200",
|
|
6628
|
+
children: e.name
|
|
6629
|
+
}), e.userRoot && !n ? /* @__PURE__ */ W("button", {
|
|
6630
|
+
type: "button",
|
|
6631
|
+
"aria-label": `Remove ${e.userRoot}`,
|
|
6632
|
+
onClick: () => r(e),
|
|
6633
|
+
className: "text-xs text-zinc-500 hover:text-red-600",
|
|
6634
|
+
children: "Remove"
|
|
6635
|
+
}) : null]
|
|
6636
|
+
}),
|
|
6637
|
+
/* @__PURE__ */ W("p", {
|
|
6638
|
+
className: "mt-0.5 truncate font-mono text-[11px] text-zinc-400",
|
|
6639
|
+
title: e.path,
|
|
6640
|
+
children: e.path ?? e.unavailableReason ?? "Path unavailable"
|
|
6641
|
+
}),
|
|
6642
|
+
e.kind === "extension" && e.userRoot && e.userRoot !== e.path ? /* @__PURE__ */ G("p", {
|
|
6643
|
+
className: "mt-0.5 truncate font-mono text-[11px] text-zinc-500",
|
|
6644
|
+
title: e.userRoot,
|
|
6645
|
+
children: [/* @__PURE__ */ W("span", { children: "Folder: " }), /* @__PURE__ */ W("span", { children: e.userRoot })]
|
|
6646
|
+
}) : null
|
|
6647
|
+
]
|
|
6629
6648
|
}, e.id))
|
|
6630
6649
|
})]
|
|
6631
6650
|
});
|
|
@@ -6733,9 +6752,9 @@ function to({ preview: e, busy: t, error: n, onApply: r, onCancel: i }) {
|
|
|
6733
6752
|
});
|
|
6734
6753
|
}
|
|
6735
6754
|
function no(e) {
|
|
6736
|
-
let t = V(null), n = V(e.onClose), r = V(!1), [i, a] = H(null), [o, s] = H(""), [c, l] = H("all"), [u, d] = H(!1), [f, p] = H(null), [m, h] = H(null), [g, _] = H("skill"), [v, y] = H(""), [b, x] = H(!1), [S, C] = H(""), [w, T] = H(""), [E, D] = H(!1), [ee, O] = H(""), [te, k] = H(null), [ne, A] = H({}), [j,
|
|
6755
|
+
let t = V(null), n = V(e.onClose), r = V(!1), [i, a] = H(null), [o, s] = H(""), [c, l] = H("all"), [u, d] = H(!1), [f, p] = H(null), [m, h] = H(null), [g, _] = H("skill"), [v, y] = H(""), [b, x] = H(!1), [S, C] = H(""), [w, T] = H(""), [E, D] = H(!1), [ee, O] = H(""), [te, k] = H(null), [ne, A] = H({}), [j, re] = H(null), [ie, ae] = H(null), oe = ue(() => Xa(e.inventory), [e.inventory]), se = ue(() => {
|
|
6737
6756
|
let e = o.trim().toLocaleLowerCase();
|
|
6738
|
-
return
|
|
6757
|
+
return oe.flatMap((t) => {
|
|
6739
6758
|
let n = "repository" in t ? t.repository.collection : void 0, r = n ? t.resources.filter((e) => e.kind !== "skill") : t.resources, i = c === "all" ? r : r.filter((e) => e.kind === c), a = n && c !== "extension" ? n.skills : [], o = i.length + a.length;
|
|
6740
6759
|
if (o === 0 && !(n && c === "all") || u && (!("repository" in t) || ![
|
|
6741
6760
|
"updateable",
|
|
@@ -6753,14 +6772,14 @@ function no(e) {
|
|
|
6753
6772
|
}] : [];
|
|
6754
6773
|
});
|
|
6755
6774
|
}, [
|
|
6756
|
-
|
|
6775
|
+
oe,
|
|
6757
6776
|
u,
|
|
6758
6777
|
c,
|
|
6759
6778
|
o
|
|
6760
|
-
]),
|
|
6761
|
-
if (
|
|
6779
|
+
]), M = se.find((e) => e.id === i) ?? se[0] ?? null;
|
|
6780
|
+
if (L(() => {
|
|
6762
6781
|
n.current = e.onClose;
|
|
6763
|
-
}, [e.onClose]),
|
|
6782
|
+
}, [e.onClose]), L(() => {
|
|
6764
6783
|
A((t) => {
|
|
6765
6784
|
let n = {}, r = !1;
|
|
6766
6785
|
for (let [i, a] of Object.entries(t)) {
|
|
@@ -6769,49 +6788,49 @@ function no(e) {
|
|
|
6769
6788
|
}
|
|
6770
6789
|
return r ? n : t;
|
|
6771
6790
|
});
|
|
6772
|
-
}, [e.inventory]),
|
|
6791
|
+
}, [e.inventory]), L(() => {
|
|
6773
6792
|
e.open && t.current?.focus();
|
|
6774
|
-
}, [e.open]),
|
|
6793
|
+
}, [e.open]), L(() => {
|
|
6775
6794
|
if (!e.open) return;
|
|
6776
6795
|
let t = (e) => {
|
|
6777
6796
|
e.key === "Escape" && n.current();
|
|
6778
6797
|
};
|
|
6779
6798
|
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
6780
|
-
}, [e.open]),
|
|
6799
|
+
}, [e.open]), L(() => {
|
|
6781
6800
|
let t = e.operations.clonePath;
|
|
6782
6801
|
t?.status === "ready" && t.path && !E && T(t.path);
|
|
6783
|
-
}, [E, e.operations.clonePath]),
|
|
6802
|
+
}, [E, e.operations.clonePath]), L(() => {
|
|
6784
6803
|
e.operations.enrollment?.status === "ready" && p(null);
|
|
6785
|
-
}, [e.operations.enrollment]),
|
|
6804
|
+
}, [e.operations.enrollment]), L(() => {
|
|
6786
6805
|
e.applyState?.status === "applying" ? r.current = !0 : r.current && e.applyState === null && (r.current = !1, p(null), h(null), x(!1));
|
|
6787
6806
|
}, [e.applyState]), !e.open) return null;
|
|
6788
|
-
let
|
|
6807
|
+
let N = M && "repository" in M ? M.repository : null, P = N ? e.operations.updates[N.id] : void 0, F = N?.assessment, I = F?.status === "updateable" && F.token && F.localRevision && F.upstreamRevision, ce = () => {
|
|
6789
6808
|
let t = v.trim();
|
|
6790
6809
|
t && (g === "skill" ? e.onUpdateConfig({ userSkillPaths: [.../* @__PURE__ */ new Set([...e.userSkillPaths, t])] }) : e.onUpdateConfig({ userExtensionPaths: [.../* @__PURE__ */ new Set([...e.userExtensionPaths, t])] }));
|
|
6791
|
-
},
|
|
6810
|
+
}, R = (t) => {
|
|
6792
6811
|
t.userRoot && (t.kind === "skill" ? e.onUpdateConfig({ userSkillPaths: e.userSkillPaths.filter((e) => e !== t.userRoot) }) : e.onUpdateConfig({ userExtensionPaths: e.userExtensionPaths.filter((e) => e !== t.userRoot) }));
|
|
6793
|
-
},
|
|
6812
|
+
}, z = (t, n = !1) => {
|
|
6794
6813
|
let r = t.assessment;
|
|
6795
6814
|
r.token && r.localRevision && r.upstreamRevision && e.onUpdate(t.id, r.token, r.localRevision, r.upstreamRevision, n);
|
|
6796
|
-
}, le =
|
|
6797
|
-
if (!
|
|
6798
|
-
let t =
|
|
6815
|
+
}, le = N?.collection, B = le ? Ka(le) : [], de = new Set(N && ne[N.id] ? ne[N.id] : B), fe = le ? [.../* @__PURE__ */ new Set([...de, ...B])].filter((e) => de.has(e) !== B.includes(e)).length : 0, pe = N ? e.operations.skills?.[N.id] : void 0, me = (e) => {
|
|
6816
|
+
if (!N) return;
|
|
6817
|
+
let t = N.id;
|
|
6799
6818
|
A((n) => {
|
|
6800
6819
|
let r = { ...n };
|
|
6801
6820
|
return qa(e, B) ? delete r[t] : r[t] = [...e], r;
|
|
6802
6821
|
});
|
|
6803
6822
|
}, he = () => {
|
|
6804
|
-
if (!
|
|
6805
|
-
let e =
|
|
6823
|
+
if (!N) return;
|
|
6824
|
+
let e = N.id;
|
|
6806
6825
|
A((t) => {
|
|
6807
6826
|
let n = { ...t };
|
|
6808
6827
|
return delete n[e], n;
|
|
6809
6828
|
});
|
|
6810
6829
|
}, ge = () => {
|
|
6811
|
-
if (!
|
|
6830
|
+
if (!N || !le) return;
|
|
6812
6831
|
let t = new Set(le.skills.filter((e) => e.state !== "on-missing").map((e) => e.relativePath));
|
|
6813
|
-
e.onSetSkills(
|
|
6814
|
-
}, _e =
|
|
6832
|
+
e.onSetSkills(N.id, [...de].filter((e) => t.has(e)));
|
|
6833
|
+
}, _e = ie ? e.operations.removals?.[ie.id] : void 0, ve = _e?.status === "error" || _e?.result?.status === "removed-delete-failed";
|
|
6815
6834
|
return /* @__PURE__ */ G("div", {
|
|
6816
6835
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/45 p-4",
|
|
6817
6836
|
role: "presentation",
|
|
@@ -6884,10 +6903,10 @@ function no(e) {
|
|
|
6884
6903
|
}),
|
|
6885
6904
|
/* @__PURE__ */ G("div", {
|
|
6886
6905
|
className: "mt-3 min-h-0 flex-1 space-y-1 overflow-y-auto",
|
|
6887
|
-
children: [
|
|
6906
|
+
children: [se.map((e) => /* @__PURE__ */ G("button", {
|
|
6888
6907
|
type: "button",
|
|
6889
6908
|
onClick: () => a(e.id),
|
|
6890
|
-
className: `w-full rounded-lg px-3 py-2.5 text-left ${
|
|
6909
|
+
className: `w-full rounded-lg px-3 py-2.5 text-left ${M?.id === e.id ? "bg-white shadow-sm ring-1 ring-zinc-200 dark:bg-zinc-800 dark:ring-zinc-700" : "hover:bg-white/70 dark:hover:bg-zinc-900"}`,
|
|
6891
6910
|
children: [/* @__PURE__ */ G("span", {
|
|
6892
6911
|
className: "flex items-center justify-between gap-2 text-sm font-medium",
|
|
6893
6912
|
children: [/* @__PURE__ */ W("span", {
|
|
@@ -6901,7 +6920,7 @@ function no(e) {
|
|
|
6901
6920
|
className: "mt-1 block text-xs text-zinc-500",
|
|
6902
6921
|
children: "repository" in e ? Ya[e.repository.assessment.status] : e.reason
|
|
6903
6922
|
})]
|
|
6904
|
-
}, e.id)),
|
|
6923
|
+
}, e.id)), se.length === 0 ? /* @__PURE__ */ W("p", {
|
|
6905
6924
|
className: "px-2 py-4 text-xs text-zinc-500",
|
|
6906
6925
|
children: "No matching resources"
|
|
6907
6926
|
}) : null]
|
|
@@ -6925,15 +6944,15 @@ function no(e) {
|
|
|
6925
6944
|
]
|
|
6926
6945
|
}), /* @__PURE__ */ G("main", {
|
|
6927
6946
|
className: "min-w-0 overflow-y-auto p-6",
|
|
6928
|
-
children: [
|
|
6947
|
+
children: [ie && _e ? /* @__PURE__ */ G("div", {
|
|
6929
6948
|
role: ve ? "alert" : "status",
|
|
6930
6949
|
className: `mb-4 flex items-start justify-between gap-3 rounded-lg border p-3 text-sm ${ve ? "border-rose-200 bg-rose-50 text-rose-800" : "border-zinc-200 bg-zinc-50 text-zinc-700"}`,
|
|
6931
6950
|
children: [/* @__PURE__ */ W("p", {
|
|
6932
6951
|
className: "min-w-0 break-words",
|
|
6933
|
-
children: Ja(
|
|
6952
|
+
children: Ja(ie.name, _e)
|
|
6934
6953
|
}), _e.status === "loading" ? null : /* @__PURE__ */ W("button", {
|
|
6935
6954
|
type: "button",
|
|
6936
|
-
onClick: () =>
|
|
6955
|
+
onClick: () => ae(null),
|
|
6937
6956
|
className: "shrink-0 text-xs underline",
|
|
6938
6957
|
children: "Dismiss"
|
|
6939
6958
|
})]
|
|
@@ -7019,7 +7038,7 @@ function no(e) {
|
|
|
7019
7038
|
}), /* @__PURE__ */ W("button", {
|
|
7020
7039
|
type: "button",
|
|
7021
7040
|
disabled: !v.trim() || e.applyState?.status === "applying" || g === "extension" && (!b || e.extensionLock),
|
|
7022
|
-
onClick:
|
|
7041
|
+
onClick: ce,
|
|
7023
7042
|
className: "rounded-md bg-zinc-900 px-3 py-1.5 text-xs text-white disabled:opacity-50",
|
|
7024
7043
|
children: e.applyState?.status === "applying" ? "Applying…" : "Add folder"
|
|
7025
7044
|
})]
|
|
@@ -7129,7 +7148,7 @@ function no(e) {
|
|
|
7129
7148
|
})]
|
|
7130
7149
|
})
|
|
7131
7150
|
] })
|
|
7132
|
-
}) :
|
|
7151
|
+
}) : M ? /* @__PURE__ */ G(U, { children: [
|
|
7133
7152
|
/* @__PURE__ */ G("div", {
|
|
7134
7153
|
className: "flex items-start justify-between gap-4",
|
|
7135
7154
|
children: [/* @__PURE__ */ G("div", {
|
|
@@ -7139,74 +7158,74 @@ function no(e) {
|
|
|
7139
7158
|
className: "flex items-center gap-2",
|
|
7140
7159
|
children: [/* @__PURE__ */ W("h3", {
|
|
7141
7160
|
className: "text-xl font-semibold",
|
|
7142
|
-
children:
|
|
7143
|
-
}),
|
|
7161
|
+
children: M.name
|
|
7162
|
+
}), N ? /* @__PURE__ */ W("span", {
|
|
7144
7163
|
className: "rounded-full border px-2 py-0.5 text-[11px]",
|
|
7145
|
-
children: Ya[
|
|
7164
|
+
children: Ya[N.assessment.status]
|
|
7146
7165
|
}) : null]
|
|
7147
7166
|
}),
|
|
7148
7167
|
/* @__PURE__ */ W("p", {
|
|
7149
7168
|
className: "mt-1 truncate font-mono text-xs text-zinc-500",
|
|
7150
|
-
children: "repository" in
|
|
7169
|
+
children: "repository" in M ? M.path : M.reason
|
|
7151
7170
|
}),
|
|
7152
|
-
|
|
7171
|
+
F?.branch ? /* @__PURE__ */ G("p", {
|
|
7153
7172
|
className: "mt-1 text-xs text-zinc-400",
|
|
7154
|
-
children: [
|
|
7173
|
+
children: [F.branch, F.upstream ? ` → ${F.upstream}` : ""]
|
|
7155
7174
|
}) : null,
|
|
7156
|
-
|
|
7175
|
+
N?.removal && !N.removal.allowed ? /* @__PURE__ */ W("p", {
|
|
7157
7176
|
className: "mt-1 text-xs text-zinc-500",
|
|
7158
|
-
children:
|
|
7177
|
+
children: N.removal.reason
|
|
7159
7178
|
}) : null
|
|
7160
7179
|
]
|
|
7161
|
-
}),
|
|
7180
|
+
}), N ? /* @__PURE__ */ G("div", {
|
|
7162
7181
|
className: "flex gap-2",
|
|
7163
7182
|
children: [
|
|
7164
|
-
|
|
7183
|
+
N.removal?.allowed ? /* @__PURE__ */ W("button", {
|
|
7165
7184
|
type: "button",
|
|
7166
|
-
disabled: e.operations.removals?.[
|
|
7167
|
-
onClick: () =>
|
|
7185
|
+
disabled: e.operations.removals?.[N.id]?.status === "loading",
|
|
7186
|
+
onClick: () => re(N),
|
|
7168
7187
|
className: "rounded-md border border-red-200 px-3 py-1.5 text-xs text-red-700 disabled:opacity-50 dark:border-red-900 dark:text-red-400",
|
|
7169
7188
|
children: "Remove repository"
|
|
7170
7189
|
}) : null,
|
|
7171
7190
|
/* @__PURE__ */ W("button", {
|
|
7172
7191
|
type: "button",
|
|
7173
7192
|
disabled: e.operations.refresh?.status === "loading",
|
|
7174
|
-
onClick: () => e.onRefresh(
|
|
7193
|
+
onClick: () => e.onRefresh(N.id),
|
|
7175
7194
|
className: "rounded-md border px-3 py-1.5 text-xs",
|
|
7176
7195
|
children: "Check"
|
|
7177
7196
|
}),
|
|
7178
|
-
|
|
7197
|
+
I || P?.status === "loading" ? /* @__PURE__ */ W("button", {
|
|
7179
7198
|
type: "button",
|
|
7180
|
-
disabled:
|
|
7181
|
-
onClick: () =>
|
|
7199
|
+
disabled: P?.status === "loading",
|
|
7200
|
+
onClick: () => N.containsExtensions ? k(N) : z(N),
|
|
7182
7201
|
className: "rounded-md bg-zinc-900 px-3 py-1.5 text-xs text-white disabled:opacity-50",
|
|
7183
|
-
children:
|
|
7202
|
+
children: P?.status === "loading" ? "Updating…" : "Update repository"
|
|
7184
7203
|
}) : null
|
|
7185
7204
|
]
|
|
7186
7205
|
}) : null]
|
|
7187
7206
|
}),
|
|
7188
|
-
|
|
7189
|
-
className: `mt-5 rounded-lg border p-3 text-sm ${
|
|
7190
|
-
children: [
|
|
7207
|
+
F?.reason ? /* @__PURE__ */ G("div", {
|
|
7208
|
+
className: `mt-5 rounded-lg border p-3 text-sm ${F.status === "dirty" ? "border-rose-200 bg-rose-50 text-rose-800" : "border-zinc-200 bg-zinc-50 text-zinc-700"}`,
|
|
7209
|
+
children: [F.reason, F.status === "dirty" ? /* @__PURE__ */ W("p", {
|
|
7191
7210
|
className: "mt-1 text-xs",
|
|
7192
7211
|
children: "Review and resolve these local changes in an external terminal, then check again. This updater never commits, stashes, discards, rebases, or merges them."
|
|
7193
7212
|
}) : null]
|
|
7194
7213
|
}) : null,
|
|
7195
|
-
|
|
7214
|
+
F?.hasSubmodules ? /* @__PURE__ */ W("p", {
|
|
7196
7215
|
className: "mt-3 rounded border border-amber-200 bg-amber-50 p-2 text-xs text-amber-800",
|
|
7197
7216
|
children: "This repository declares submodules. Their working trees will not be initialized or updated."
|
|
7198
7217
|
}) : null,
|
|
7199
|
-
|
|
7218
|
+
P?.status === "ready" ? /* @__PURE__ */ W("p", {
|
|
7200
7219
|
role: "status",
|
|
7201
7220
|
className: "mt-3 text-xs text-zinc-600",
|
|
7202
|
-
children:
|
|
7221
|
+
children: P.result?.status === "updated" && P.result.reloads.some((e) => e.status === "restart-required") ? "Repository updated. Its skills are reloaded; its extension code runs after pi-outpost restarts — restart it from Settings." : P.result?.status === "updated" ? "Repository updated and runtimes reloaded." : P.result?.status === "updated-reload-failed" ? "Repository updated on disk, but at least one runtime failed to reload." : P.result?.reason
|
|
7203
7222
|
}) : null,
|
|
7204
|
-
|
|
7223
|
+
P?.status === "error" ? /* @__PURE__ */ W("p", {
|
|
7205
7224
|
role: "alert",
|
|
7206
7225
|
className: "mt-3 text-xs text-red-600",
|
|
7207
|
-
children:
|
|
7226
|
+
children: P.message
|
|
7208
7227
|
}) : null,
|
|
7209
|
-
le &&
|
|
7228
|
+
le && N && c !== "extension" ? /* @__PURE__ */ G("div", {
|
|
7210
7229
|
className: "mt-6 space-y-4",
|
|
7211
7230
|
children: [
|
|
7212
7231
|
fe > 0 || pe?.status === "loading" ? /* @__PURE__ */ G("div", {
|
|
@@ -7240,25 +7259,25 @@ function no(e) {
|
|
|
7240
7259
|
onChange: me,
|
|
7241
7260
|
disabled: pe?.status === "loading",
|
|
7242
7261
|
...le.bound ? { bound: le.bound } : {}
|
|
7243
|
-
},
|
|
7244
|
-
|
|
7262
|
+
}, N.id),
|
|
7263
|
+
M.resources.some((e) => e.kind === "extension") ? /* @__PURE__ */ W(eo, {
|
|
7245
7264
|
kind: "extension",
|
|
7246
|
-
resources:
|
|
7265
|
+
resources: M.resources.filter((e) => e.kind === "extension"),
|
|
7247
7266
|
removalLocked: e.extensionLock,
|
|
7248
|
-
onRemove:
|
|
7267
|
+
onRemove: R
|
|
7249
7268
|
}) : null
|
|
7250
7269
|
]
|
|
7251
7270
|
}) : /* @__PURE__ */ G("div", {
|
|
7252
7271
|
className: "mt-6 grid grid-cols-2 gap-4",
|
|
7253
7272
|
children: [/* @__PURE__ */ W(eo, {
|
|
7254
7273
|
kind: "skill",
|
|
7255
|
-
resources:
|
|
7256
|
-
onRemove:
|
|
7274
|
+
resources: M.resources.filter((e) => e.kind === "skill"),
|
|
7275
|
+
onRemove: R
|
|
7257
7276
|
}), /* @__PURE__ */ W(eo, {
|
|
7258
7277
|
kind: "extension",
|
|
7259
|
-
resources:
|
|
7278
|
+
resources: M.resources.filter((e) => e.kind === "extension"),
|
|
7260
7279
|
removalLocked: e.extensionLock,
|
|
7261
|
-
onRemove:
|
|
7280
|
+
onRemove: R
|
|
7262
7281
|
})]
|
|
7263
7282
|
})
|
|
7264
7283
|
] }) : /* @__PURE__ */ W("p", {
|
|
@@ -7302,7 +7321,7 @@ function no(e) {
|
|
|
7302
7321
|
}), /* @__PURE__ */ W("button", {
|
|
7303
7322
|
type: "button",
|
|
7304
7323
|
onClick: () => {
|
|
7305
|
-
|
|
7324
|
+
z(te, !0), k(null);
|
|
7306
7325
|
},
|
|
7307
7326
|
className: "rounded bg-amber-600 px-3 py-1.5 text-xs font-medium text-white",
|
|
7308
7327
|
children: "Confirm executable update"
|
|
@@ -7356,16 +7375,16 @@ function no(e) {
|
|
|
7356
7375
|
className: "mt-4 flex justify-end gap-2",
|
|
7357
7376
|
children: [/* @__PURE__ */ W("button", {
|
|
7358
7377
|
type: "button",
|
|
7359
|
-
onClick: () =>
|
|
7378
|
+
onClick: () => re(null),
|
|
7360
7379
|
className: "rounded border px-3 py-1.5 text-xs",
|
|
7361
7380
|
children: "Cancel"
|
|
7362
7381
|
}), /* @__PURE__ */ W("button", {
|
|
7363
7382
|
type: "button",
|
|
7364
7383
|
onClick: () => {
|
|
7365
|
-
e.onRemoveRepository(j.id),
|
|
7384
|
+
e.onRemoveRepository(j.id), ae({
|
|
7366
7385
|
id: j.id,
|
|
7367
7386
|
name: j.name
|
|
7368
|
-
}),
|
|
7387
|
+
}), re(null);
|
|
7369
7388
|
},
|
|
7370
7389
|
className: "rounded bg-red-600 px-3 py-1.5 text-xs font-medium text-white",
|
|
7371
7390
|
children: j.removal?.deletesFiles ? "Delete and remove" : "Remove repository"
|
|
@@ -7557,39 +7576,39 @@ function fo({ credentials: e, login: t, onStartLogin: n, onAnswerLogin: r, onCan
|
|
|
7557
7576
|
updates: {},
|
|
7558
7577
|
skills: {},
|
|
7559
7578
|
removals: {}
|
|
7560
|
-
}, versions: A, onBrowseServerPath: j, onCloseServerBrowser:
|
|
7561
|
-
let [
|
|
7579
|
+
}, versions: A, onBrowseServerPath: j, onCloseServerBrowser: re, onUpdateConfig: ie, onSuggestAgentResourceClonePath: ae = () => {}, onCloneAgentResourceRepository: oe = () => {}, onEnrollAgentResourceRepository: se = () => {}, onSetAgentResourceSkills: M = () => {}, onRemoveAgentResourceRepository: N = () => {}, onRefreshAgentResourceRepositories: P = () => {}, onUpdateAgentResourceRepository: F = () => {} }) {
|
|
7580
|
+
let [I, ce] = H(!1), [R, z] = H(!1), le = V(/* @__PURE__ */ new Map()), [ue, B] = H(!1), de = V(null), [fe, pe] = H(""), [me, he] = H(""), [ge, _e] = H(!1), [ve, K] = H(!1), [ye, be] = H(null), xe = (e, r) => {
|
|
7562
7581
|
if (t && !t.done) {
|
|
7563
7582
|
i?.(), a?.();
|
|
7564
7583
|
let e = le.current.get(t.provider);
|
|
7565
7584
|
e && (e.open = !1);
|
|
7566
7585
|
} else n?.(e, r);
|
|
7567
7586
|
};
|
|
7568
|
-
|
|
7587
|
+
L(() => {
|
|
7569
7588
|
ee && ye !== null && be(null);
|
|
7570
7589
|
}, [ee, ye]);
|
|
7571
7590
|
let Se = Un(() => {
|
|
7572
|
-
(
|
|
7591
|
+
(I || ye !== null) && Ae();
|
|
7573
7592
|
}), Ce = x.filter((e) => e.active), we = x.filter((e) => !e.active), Te = S.filter((e) => e.source === "skill"), Ee = [...x].sort((e, t) => e.name.localeCompare(t.name) || Number(t.active) - Number(e.active)), De = te?.status === "applying", Oe = te?.status === "error" ? te.message : null;
|
|
7574
|
-
|
|
7593
|
+
L(() => {
|
|
7575
7594
|
C && (pe(C.root), he(C.writableRoot ?? ""), _e(C.allowWrite), K(C.allowBash));
|
|
7576
7595
|
}, [C]);
|
|
7577
7596
|
let ke = V(!1);
|
|
7578
|
-
|
|
7597
|
+
L(() => {
|
|
7579
7598
|
ke.current && te === null && Ae(), ke.current = De;
|
|
7580
7599
|
}, [te, De]);
|
|
7581
7600
|
function Ae() {
|
|
7582
|
-
|
|
7601
|
+
z(!1), ce(!1), be(null), re();
|
|
7583
7602
|
}
|
|
7584
7603
|
function je(e, t) {
|
|
7585
7604
|
O?.(), be(e), j(t.trim() || "/");
|
|
7586
7605
|
}
|
|
7587
7606
|
function Me(e) {
|
|
7588
|
-
ye === "root" ? pe(e) : ye === "writableRoot" && he(e), be(null),
|
|
7607
|
+
ye === "root" ? pe(e) : ye === "writableRoot" && he(e), be(null), re();
|
|
7589
7608
|
}
|
|
7590
7609
|
let Ne = C !== null && (fe !== C.root || (me.trim() || void 0) !== (C.writableRoot || void 0) || ge !== C.allowWrite || ve !== C.allowBash);
|
|
7591
7610
|
function Pe() {
|
|
7592
|
-
C && Ne &&
|
|
7611
|
+
C && Ne && ie({ sandbox: {
|
|
7593
7612
|
root: fe,
|
|
7594
7613
|
allowWrite: ge,
|
|
7595
7614
|
allowBash: ve,
|
|
@@ -7602,7 +7621,7 @@ function fo({ credentials: e, login: t, onStartLogin: n, onAnswerLogin: r, onCan
|
|
|
7602
7621
|
onBrowse: j,
|
|
7603
7622
|
onSelect: Me,
|
|
7604
7623
|
onCancel: () => {
|
|
7605
|
-
be(null),
|
|
7624
|
+
be(null), re();
|
|
7606
7625
|
}
|
|
7607
7626
|
});
|
|
7608
7627
|
return /* @__PURE__ */ G("div", {
|
|
@@ -7613,29 +7632,29 @@ function fo({ credentials: e, login: t, onStartLogin: n, onAnswerLogin: r, onCan
|
|
|
7613
7632
|
ref: de,
|
|
7614
7633
|
type: "button",
|
|
7615
7634
|
onClick: () => {
|
|
7616
|
-
|
|
7635
|
+
z(!1), I ? Ae() : ce(!0);
|
|
7617
7636
|
},
|
|
7618
7637
|
title: "Settings",
|
|
7619
7638
|
"aria-label": "Settings",
|
|
7620
7639
|
className: `${la} border-zinc-300 text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200`,
|
|
7621
7640
|
children: "⚙"
|
|
7622
7641
|
}),
|
|
7623
|
-
|
|
7642
|
+
I && /* @__PURE__ */ G("div", {
|
|
7624
7643
|
className: "absolute right-0 top-full z-20 mt-1 flex max-h-[80vh] w-[380px] flex-col rounded-lg border border-zinc-200 bg-white shadow-xl dark:border-zinc-700 dark:bg-zinc-900",
|
|
7625
7644
|
children: [/* @__PURE__ */ G("div", {
|
|
7626
7645
|
className: "border-b border-zinc-200 px-4 py-3 dark:border-zinc-800",
|
|
7627
|
-
children: [
|
|
7646
|
+
children: [R && /* @__PURE__ */ W("button", {
|
|
7628
7647
|
type: "button",
|
|
7629
|
-
onClick: () =>
|
|
7648
|
+
onClick: () => z(!1),
|
|
7630
7649
|
className: "mb-2 text-xs text-zinc-600 hover:underline dark:text-zinc-400",
|
|
7631
7650
|
children: "← Back to settings"
|
|
7632
7651
|
}), /* @__PURE__ */ W("h2", {
|
|
7633
7652
|
className: "text-sm font-semibold text-zinc-800 dark:text-zinc-200",
|
|
7634
|
-
children:
|
|
7653
|
+
children: R ? "Credits" : "Settings"
|
|
7635
7654
|
})]
|
|
7636
7655
|
}), /* @__PURE__ */ W("div", {
|
|
7637
7656
|
className: "min-h-0 overflow-y-auto p-4",
|
|
7638
|
-
children:
|
|
7657
|
+
children: R ? /* @__PURE__ */ W(Da, {}) : /* @__PURE__ */ G(U, { children: [
|
|
7639
7658
|
T && /* @__PURE__ */ G("section", {
|
|
7640
7659
|
className: "mb-4",
|
|
7641
7660
|
"data-testid": "git-unavailable",
|
|
@@ -7797,7 +7816,7 @@ function fo({ credentials: e, login: t, onStartLogin: n, onAnswerLogin: r, onCan
|
|
|
7797
7816
|
type: "button",
|
|
7798
7817
|
"aria-label": "Manage agent resources",
|
|
7799
7818
|
onClick: () => {
|
|
7800
|
-
|
|
7819
|
+
ce(!1), B(!0);
|
|
7801
7820
|
},
|
|
7802
7821
|
className: "mt-3 w-full rounded-md border border-zinc-300 px-3 py-2 text-xs font-medium text-zinc-700 hover:bg-zinc-50 dark:border-zinc-700 dark:text-zinc-200 dark:hover:bg-zinc-800",
|
|
7803
7822
|
children: "Manage agent resources"
|
|
@@ -8040,7 +8059,7 @@ function fo({ credentials: e, login: t, onStartLogin: n, onAnswerLogin: r, onCan
|
|
|
8040
8059
|
}),
|
|
8041
8060
|
/* @__PURE__ */ W("button", {
|
|
8042
8061
|
type: "button",
|
|
8043
|
-
onClick: () =>
|
|
8062
|
+
onClick: () => z(!0),
|
|
8044
8063
|
className: "mt-4 w-full border-t border-zinc-200 pt-3 text-left text-sm text-zinc-600 hover:text-zinc-900 dark:border-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-100",
|
|
8045
8064
|
children: "Credits →"
|
|
8046
8065
|
})
|
|
@@ -8057,20 +8076,20 @@ function fo({ credentials: e, login: t, onStartLogin: n, onAnswerLogin: r, onCan
|
|
|
8057
8076
|
serverBrowse: D,
|
|
8058
8077
|
applyState: te,
|
|
8059
8078
|
onClose: () => {
|
|
8060
|
-
B(!1),
|
|
8079
|
+
B(!1), re(), de.current?.focus();
|
|
8061
8080
|
},
|
|
8062
8081
|
onBrowseServerPath: (e) => {
|
|
8063
8082
|
O?.(), j(e);
|
|
8064
8083
|
},
|
|
8065
|
-
onCloseServerBrowser:
|
|
8066
|
-
onUpdateConfig:
|
|
8067
|
-
onSuggestClonePath:
|
|
8068
|
-
onCloneRepository:
|
|
8069
|
-
onEnrollRepository:
|
|
8070
|
-
onSetSkills:
|
|
8071
|
-
onRemoveRepository:
|
|
8072
|
-
onRefresh:
|
|
8073
|
-
onUpdate:
|
|
8084
|
+
onCloseServerBrowser: re,
|
|
8085
|
+
onUpdateConfig: ie,
|
|
8086
|
+
onSuggestClonePath: ae,
|
|
8087
|
+
onCloneRepository: oe,
|
|
8088
|
+
onEnrollRepository: se,
|
|
8089
|
+
onSetSkills: M,
|
|
8090
|
+
onRemoveRepository: N,
|
|
8091
|
+
onRefresh: P,
|
|
8092
|
+
onUpdate: F
|
|
8074
8093
|
})
|
|
8075
8094
|
]
|
|
8076
8095
|
});
|
|
@@ -8195,7 +8214,7 @@ function _o({ row: e, laneCount: t, isStreaming: n, onNavigate: r, onFork: i, on
|
|
|
8195
8214
|
}
|
|
8196
8215
|
function vo({ tree: e, isStreaming: t, onListTree: n, onNavigate: r, onFork: i }) {
|
|
8197
8216
|
let [a, o] = H(!1), [s, c] = H(""), l = Un(() => o(!1));
|
|
8198
|
-
|
|
8217
|
+
L(() => {
|
|
8199
8218
|
a && e === null && n();
|
|
8200
8219
|
}, [a, e]);
|
|
8201
8220
|
let u = ue(() => e && e.length > 0 ? po(e) : null, [e]), d = ue(() => {
|
|
@@ -8408,7 +8427,7 @@ function xo({ session: e, isCurrent: t, renaming: n, onSwitch: r, onDelete: i, o
|
|
|
8408
8427
|
}
|
|
8409
8428
|
function So({ sessions: e, sessionSearch: t, sessionId: n, onSwitchSession: r, onDeleteSession: i, onListSessions: a, onRenameSession: o, onSearchSessions: s, onClearSessionSearch: c }) {
|
|
8410
8429
|
let [l, u] = H(!1), [d, f] = H(""), [p, m] = H(null), h = Un(() => u(!1)), g = d.trim(), _ = g.length >= 2;
|
|
8411
|
-
|
|
8430
|
+
L(() => {
|
|
8412
8431
|
if (!l) return;
|
|
8413
8432
|
if (!_) {
|
|
8414
8433
|
c();
|
|
@@ -8578,7 +8597,7 @@ function wo({ statuses: e, bar: t }) {
|
|
|
8578
8597
|
}
|
|
8579
8598
|
function To({ theme: e, preference: t = e, onToggle: n, onSetTheme: r }) {
|
|
8580
8599
|
let [i, a] = H(!1), o = V(null), s = Un(() => a(!1));
|
|
8581
|
-
|
|
8600
|
+
L(() => {
|
|
8582
8601
|
i && s.current?.querySelector("[aria-checked=\"true\"]")?.focus();
|
|
8583
8602
|
}, [i]);
|
|
8584
8603
|
let c = {
|
|
@@ -8806,7 +8825,7 @@ function Eo(e) {
|
|
|
8806
8825
|
//#region ../ui/src/useWorkspaceNotifications.ts
|
|
8807
8826
|
function Do(e, t) {
|
|
8808
8827
|
let n = V(/* @__PURE__ */ new Map());
|
|
8809
|
-
|
|
8828
|
+
L(() => {
|
|
8810
8829
|
if (typeof Notification > "u") return;
|
|
8811
8830
|
let r = e.filter((e) => e.needsAttention), i = r.filter((e) => Dt(e) !== t);
|
|
8812
8831
|
for (let e of [...n.current.keys()]) r.some((t) => Dt(t) === e) || n.current.delete(e);
|
|
@@ -8993,7 +9012,7 @@ function Io({ usage: e }) {
|
|
|
8993
9012
|
}
|
|
8994
9013
|
function Lo({ thinkingLevel: e, thinkingLevels: t, isStreaming: n, onSetThinking: r }) {
|
|
8995
9014
|
let [i, a] = H(!1), o = V(null), s = e !== "off", c = t && t.length > 0 ? t : b, l = c.indexOf(e), u = c.length > 1;
|
|
8996
|
-
return
|
|
9015
|
+
return L(() => {
|
|
8997
9016
|
if (!i) return;
|
|
8998
9017
|
function e(e) {
|
|
8999
9018
|
o.current && !Hn(e, o.current) && a(!1);
|
|
@@ -9333,7 +9352,7 @@ function Vo({ title: e, credentials: t, onSetCredential: n, onStartLogin: r, log
|
|
|
9333
9352
|
//#region ../ui/src/components/ContentSearchPanel.tsx
|
|
9334
9353
|
function Ho({ query: e, onQueryChange: t, search: n, onSearch: r, onOpenHit: i, onClose: a }) {
|
|
9335
9354
|
let o = V(null);
|
|
9336
|
-
|
|
9355
|
+
L(() => {
|
|
9337
9356
|
o.current?.focus();
|
|
9338
9357
|
}, []);
|
|
9339
9358
|
let s = Wo(n?.hits ?? []);
|
|
@@ -9471,7 +9490,7 @@ function Qo(e, t) {
|
|
|
9471
9490
|
}
|
|
9472
9491
|
function $o({ dir: e, depth: t, creation: n }) {
|
|
9473
9492
|
let [r, i] = H(""), a = V(null), o = n.localError ?? n.serverError;
|
|
9474
|
-
return
|
|
9493
|
+
return L(() => {
|
|
9475
9494
|
a.current?.focus();
|
|
9476
9495
|
}, []), /* @__PURE__ */ G("div", {
|
|
9477
9496
|
style: { paddingLeft: t * 12 + 4 },
|
|
@@ -9498,7 +9517,7 @@ function $o({ dir: e, depth: t, creation: n }) {
|
|
|
9498
9517
|
}
|
|
9499
9518
|
function es({ path: e, name: t, depth: n, rename: r }) {
|
|
9500
9519
|
let [i, a] = H(t), o = V(null), s = r.localError ?? r.serverError;
|
|
9501
|
-
return
|
|
9520
|
+
return L(() => {
|
|
9502
9521
|
o.current?.focus(), o.current?.select();
|
|
9503
9522
|
}, []), /* @__PURE__ */ G("div", {
|
|
9504
9523
|
style: { paddingLeft: n * 12 + 16 },
|
|
@@ -9752,11 +9771,11 @@ function as(e) {
|
|
|
9752
9771
|
})();
|
|
9753
9772
|
}
|
|
9754
9773
|
} : void 0, [d, f] = H(null), [p, m] = H(null), [h, g] = H(null), [_, v] = H(null), [y, b] = H(null), [x, S] = H(null), C = e.onCreateFile !== void 0 || e.onCreateDirectory !== void 0, w = e.createError && h && e.createError.path === os(h.dir, h.name) ? e.createError.message : null, T = e.created ?? null;
|
|
9755
|
-
|
|
9774
|
+
L(() => {
|
|
9756
9775
|
h !== null && T !== null && T === os(h.dir, h.name) && (f(null), g(null), m(null));
|
|
9757
9776
|
}, [h, T]);
|
|
9758
9777
|
let E = e.fileOperation?.status === "error" && e.fileOperation.operation === "rename_file" && x === e.fileOperation.path ? e.fileOperation.message : null;
|
|
9759
|
-
|
|
9778
|
+
L(() => {
|
|
9760
9779
|
let t = e.fileOperation;
|
|
9761
9780
|
t?.status === "succeeded" && t.operation === "rename_file" && x === t.path && (v(null), S(null), b(null));
|
|
9762
9781
|
}, [x, e.fileOperation]);
|
|
@@ -9876,7 +9895,7 @@ function os(e, t) {
|
|
|
9876
9895
|
//#region ../ui/src/components/Sidebar.tsx
|
|
9877
9896
|
function ss({ hidden: e, tree: t, openFile: n, writableRoot: r, gitFiles: i, attachedPaths: a, onExpand: o, onSelectDirectory: s, onRefresh: c, onSelectFile: l, onSelectDiff: u, onToggleAttachPath: d, onCreateFile: f, onCreateDirectory: p, onOpenNative: m, onRevealNative: h, onRenameFile: g, onDeleteFile: _, onMoveFile: v, onCopyFile: y, onUploadFile: b, onExternalDragEnter: x, fileOperation: S, createError: C, created: w, contentSearch: T = null, onSearchContent: E, onOpenSearchHit: D }) {
|
|
9878
9897
|
let ee = Bi(Ni), [O, te] = H(!1), [k, ne] = H(T?.query ?? ""), A = (e) => b !== void 0 && Array.from(e.types).includes("Files");
|
|
9879
|
-
return
|
|
9898
|
+
return L(() => {
|
|
9880
9899
|
t[""] === void 0 && o("");
|
|
9881
9900
|
}, []), /* @__PURE__ */ G("aside", {
|
|
9882
9901
|
"aria-label": "Files",
|
|
@@ -10062,16 +10081,16 @@ function ds(e) {
|
|
|
10062
10081
|
return t === null || t === "" || /^(?:[\\/]|[a-z]:[\\/])/i.test(t) || t.replaceAll("\\", "/").split("/").includes("..") ? null : t;
|
|
10063
10082
|
}
|
|
10064
10083
|
function fs({ plan: e, open: t, onToggle: n, onOpenWorkspace: r, requestedTaskId: i, onTaskRequestHandled: a }) {
|
|
10065
|
-
let o =
|
|
10066
|
-
|
|
10084
|
+
let o = R(), [s, c] = H(!1), [l, u] = H(null), [d, f] = H(null);
|
|
10085
|
+
L(() => {
|
|
10067
10086
|
i && (e.tasks.some((e) => e.id === i) ? (u(i), f(null)) : (u(null), f(i)), a?.());
|
|
10068
10087
|
}, [
|
|
10069
10088
|
e.tasks,
|
|
10070
10089
|
i,
|
|
10071
10090
|
a
|
|
10072
|
-
]),
|
|
10091
|
+
]), L(() => {
|
|
10073
10092
|
l !== null && !e.tasks.some((e) => e.id === l) && u(null);
|
|
10074
|
-
}, [e, l]),
|
|
10093
|
+
}, [e, l]), L(() => {
|
|
10075
10094
|
if (!s) return;
|
|
10076
10095
|
let e = (e) => {
|
|
10077
10096
|
e.key === "Escape" && c(!1);
|
|
@@ -13962,17 +13981,17 @@ var zd = class {
|
|
|
13962
13981
|
for (v = r[0] + 1; v < r[1]; v++) k &&= i === this._isCellInSelection(v, t);
|
|
13963
13982
|
k &&= !n || a < r[0] || a >= r[1], k ? (te = !0, A = new Md(this._workCell, e.translateToString(!0, r[0], r[1]), r[1] - r[0]), ne = r[1] - 1, m = A.getWidth()) : E = r[1];
|
|
13964
13983
|
}
|
|
13965
|
-
let j = this._isCellInSelection(O, t),
|
|
13984
|
+
let j = this._isCellInSelection(O, t), re = n && O === a, ie = ee && O >= l && O <= u, ae = !1;
|
|
13966
13985
|
this._decorationService.forEachDecorationAtCell(O, t, void 0, (e) => {
|
|
13967
|
-
|
|
13986
|
+
ae = !0;
|
|
13968
13987
|
});
|
|
13969
|
-
let
|
|
13970
|
-
if (
|
|
13971
|
-
else if (g && (j && w || !j && !w && A.bg === y) && (j && w && p.selectionForeground || A.fg === b) && A.extended.ext === x &&
|
|
13972
|
-
A.isInvisible() ? _ += Ns : _ +=
|
|
13988
|
+
let oe = A.getChars() || Ns;
|
|
13989
|
+
if (oe === " " && (A.isUnderline() || A.isOverline()) && (oe = "\xA0"), T = m * s - c.get(oe, A.isBold(), A.isItalic()), !h) h = this._document.createElement("span");
|
|
13990
|
+
else if (g && (j && w || !j && !w && A.bg === y) && (j && w && p.selectionForeground || A.fg === b) && A.extended.ext === x && ie === S && T === C && !re && !te && !ae && k) {
|
|
13991
|
+
A.isInvisible() ? _ += Ns : _ += oe, g++;
|
|
13973
13992
|
continue;
|
|
13974
13993
|
} else g && (h.textContent = _), h = this._document.createElement("span"), g = 0, _ = "";
|
|
13975
|
-
if (y = A.bg, b = A.fg, x = A.extended.ext, S =
|
|
13994
|
+
if (y = A.bg, b = A.fg, x = A.extended.ext, S = ie, C = T, w = j, te && a >= O && a <= ne && (a = O), !this._coreService.isCursorHidden && re && this._coreService.isCursorInitialized) {
|
|
13976
13995
|
if (D.push("xterm-cursor"), this._coreBrowserService.isFocused) o && D.push("xterm-cursor-blink"), D.push(r === "bar" ? "xterm-cursor-bar" : r === "underline" ? "xterm-cursor-underline" : "xterm-cursor-block");
|
|
13977
13996
|
else if (i) switch (i) {
|
|
13978
13997
|
case "outline":
|
|
@@ -13994,41 +14013,41 @@ var zd = class {
|
|
|
13994
14013
|
this._optionsService.rawOptions.drawBoldTextInBrightColors && A.isBold() && e < 8 && (e += 8), h.style.textDecorationColor = p.ansi[e].css;
|
|
13995
14014
|
}
|
|
13996
14015
|
}
|
|
13997
|
-
A.isOverline() && (D.push("xterm-overline"), _ === " " && (_ = "\xA0")), A.isStrikethrough() && D.push("xterm-strikethrough"),
|
|
13998
|
-
let
|
|
13999
|
-
if (
|
|
14000
|
-
let e =
|
|
14001
|
-
|
|
14002
|
-
let t =
|
|
14003
|
-
|
|
14016
|
+
A.isOverline() && (D.push("xterm-overline"), _ === " " && (_ = "\xA0")), A.isStrikethrough() && D.push("xterm-strikethrough"), ie && (h.style.textDecoration = "underline");
|
|
14017
|
+
let se = A.getFgColor(), M = A.getFgColorMode(), N = A.getBgColor(), P = A.getBgColorMode(), F = !!A.isInverse();
|
|
14018
|
+
if (F) {
|
|
14019
|
+
let e = se;
|
|
14020
|
+
se = N, N = e;
|
|
14021
|
+
let t = M;
|
|
14022
|
+
M = P, P = t;
|
|
14004
14023
|
}
|
|
14005
|
-
let
|
|
14024
|
+
let I, ce, L = !1;
|
|
14006
14025
|
this._decorationService.forEachDecorationAtCell(O, t, void 0, (e) => {
|
|
14007
|
-
e.options.layer !== "top" &&
|
|
14008
|
-
}), !
|
|
14009
|
-
let
|
|
14010
|
-
switch (
|
|
14026
|
+
e.options.layer !== "top" && L || (e.backgroundColorRGB && (P = 50331648, N = e.backgroundColorRGB.rgba >> 8 & 16777215, I = e.backgroundColorRGB), e.foregroundColorRGB && (M = 50331648, se = e.foregroundColorRGB.rgba >> 8 & 16777215, ce = e.foregroundColorRGB), L = e.options.layer === "top");
|
|
14027
|
+
}), !L && j && (I = this._coreBrowserService.isFocused ? p.selectionBackgroundOpaque : p.selectionInactiveBackgroundOpaque, N = I.rgba >> 8 & 16777215, P = 50331648, L = !0, p.selectionForeground && (M = 50331648, se = p.selectionForeground.rgba >> 8 & 16777215, ce = p.selectionForeground)), L && D.push("xterm-decoration-top");
|
|
14028
|
+
let R;
|
|
14029
|
+
switch (P) {
|
|
14011
14030
|
case 16777216:
|
|
14012
14031
|
case 33554432:
|
|
14013
|
-
|
|
14032
|
+
R = p.ansi[N], D.push(`xterm-bg-${N}`);
|
|
14014
14033
|
break;
|
|
14015
14034
|
case 50331648:
|
|
14016
|
-
|
|
14035
|
+
R = Td.toColor(N >> 16, N >> 8 & 255, N & 255), this._addStyle(h, `background-color:#${Bd((N >>> 0).toString(16), "0", 6)}`);
|
|
14017
14036
|
break;
|
|
14018
|
-
default:
|
|
14037
|
+
default: F ? (R = p.foreground, D.push("xterm-bg-257")) : R = p.background;
|
|
14019
14038
|
}
|
|
14020
|
-
switch (
|
|
14039
|
+
switch (I || A.isDim() && (I = Ed.multiplyOpacity(R, .5)), M) {
|
|
14021
14040
|
case 16777216:
|
|
14022
14041
|
case 33554432:
|
|
14023
|
-
A.isBold() &&
|
|
14042
|
+
A.isBold() && se < 8 && this._optionsService.rawOptions.drawBoldTextInBrightColors && (se += 8), this._applyMinimumContrast(h, R, p.ansi[se], A, I, void 0) || D.push(`xterm-fg-${se}`);
|
|
14024
14043
|
break;
|
|
14025
14044
|
case 50331648:
|
|
14026
|
-
let e = Td.toColor(
|
|
14027
|
-
this._applyMinimumContrast(h,
|
|
14045
|
+
let e = Td.toColor(se >> 16 & 255, se >> 8 & 255, se & 255);
|
|
14046
|
+
this._applyMinimumContrast(h, R, e, A, I, ce) || this._addStyle(h, `color:#${Bd(se.toString(16), "0", 6)}`);
|
|
14028
14047
|
break;
|
|
14029
|
-
default: this._applyMinimumContrast(h,
|
|
14048
|
+
default: this._applyMinimumContrast(h, R, p.foreground, A, I, ce) || F && D.push("xterm-fg-257");
|
|
14030
14049
|
}
|
|
14031
|
-
D.length &&= (h.className = D.join(" "), 0), !
|
|
14050
|
+
D.length &&= (h.className = D.join(" "), 0), !re && !te && !ae && k ? g++ : h.textContent = _, T !== this.defaultSpacing && (h.style.letterSpacing = `${T}px`), d.push(h), O = ne;
|
|
14032
14051
|
}
|
|
14033
14052
|
return h && g && (h.textContent = _), d;
|
|
14034
14053
|
}
|
|
@@ -19655,7 +19674,7 @@ function bh(e) {
|
|
|
19655
19674
|
return t.length <= 3 ? e : "…/" + t.slice(-3).join("/");
|
|
19656
19675
|
}
|
|
19657
19676
|
function xh({ id: e, shellId: t, cwd: n, isActive: r, isPanelOpen: i, renaming: a, openTerminal: o, sendTerminalInput: s, getTerminalCwd: c, resizeTerminal: u, closeTerminal: d, subscribeTerminal: f, onCwdUpdate: p, registerClear: m }) {
|
|
19658
|
-
let h = V(null), g = V(null), _ = V(null), v =
|
|
19677
|
+
let h = V(null), g = V(null), _ = V(null), v = ce(l) === "dark", y = V({
|
|
19659
19678
|
cwd: n,
|
|
19660
19679
|
openTerminal: o,
|
|
19661
19680
|
sendTerminalInput: s,
|
|
@@ -19676,9 +19695,9 @@ function xh({ id: e, shellId: t, cwd: n, isActive: r, isPanelOpen: i, renaming:
|
|
|
19676
19695
|
subscribeTerminal: f,
|
|
19677
19696
|
onCwdUpdate: p,
|
|
19678
19697
|
registerClear: m
|
|
19679
|
-
},
|
|
19698
|
+
}, L(() => {
|
|
19680
19699
|
g.current && (g.current.options.theme = v ? vh : yh);
|
|
19681
|
-
}, [v]),
|
|
19700
|
+
}, [v]), L(() => {
|
|
19682
19701
|
if (!h.current) return;
|
|
19683
19702
|
let n = new sh({
|
|
19684
19703
|
cursorBlink: !0,
|
|
@@ -19724,7 +19743,7 @@ function xh({ id: e, shellId: t, cwd: n, isActive: r, isPanelOpen: i, renaming:
|
|
|
19724
19743
|
return l.observe(h.current), () => {
|
|
19725
19744
|
s.dispose(), c(), l.disconnect(), n.dispose(), y.current.closeTerminal?.(e);
|
|
19726
19745
|
};
|
|
19727
|
-
}, [e]),
|
|
19746
|
+
}, [e]), L(() => {
|
|
19728
19747
|
if (!a && i && r && _.current && g.current && h.current) {
|
|
19729
19748
|
y.current.getTerminalCwd?.(e);
|
|
19730
19749
|
let t = setTimeout(() => {
|
|
@@ -19746,27 +19765,27 @@ function xh({ id: e, shellId: t, cwd: n, isActive: r, isPanelOpen: i, renaming:
|
|
|
19746
19765
|
}
|
|
19747
19766
|
function Sh({ shells: e, open: t, onClose: n, cwd: r, confinedRoot: i, confinement: a, unavailable: o, onSetWorkspaceRoot: s, openTerminal: c, sendTerminalInput: l, getTerminalCwd: u, resizeTerminal: d, closeTerminal: f, subscribeTerminal: p }) {
|
|
19748
19767
|
let [m, h] = H(""), g = e?.some((e) => e.id === m) ? m : "", [_, v] = H(t);
|
|
19749
|
-
|
|
19768
|
+
L(() => {
|
|
19750
19769
|
t && v(!0);
|
|
19751
19770
|
}, [t]);
|
|
19752
19771
|
let [y, b] = H([{
|
|
19753
19772
|
id: "term-1",
|
|
19754
19773
|
title: "terminal 1"
|
|
19755
|
-
}]), [x, S] = H("term-1"), [C, w] = H(null), [T, E] = H(""), [D, ee] = H({}), [O, te] = H(!1), k = Bi(Fi, "y"), [ne, A] = H(!1), j = V(/* @__PURE__ */ new Map()),
|
|
19774
|
+
}]), [x, S] = H("term-1"), [C, w] = H(null), [T, E] = H(""), [D, ee] = H({}), [O, te] = H(!1), k = Bi(Fi, "y"), [ne, A] = H(!1), j = V(/* @__PURE__ */ new Map()), re = I((e, t) => {
|
|
19756
19775
|
j.current.set(e, t);
|
|
19757
|
-
}, []),
|
|
19776
|
+
}, []), ie = I((e, t) => {
|
|
19758
19777
|
ee((n) => ({
|
|
19759
19778
|
...n,
|
|
19760
19779
|
[e]: t
|
|
19761
19780
|
}));
|
|
19762
|
-
}, []),
|
|
19781
|
+
}, []), ae = I(() => {
|
|
19763
19782
|
let e = y.length + 1, t = `term-${crypto.randomUUID()}`, n = {
|
|
19764
19783
|
id: t,
|
|
19765
19784
|
title: `terminal ${e}`,
|
|
19766
19785
|
...g ? { shellId: g } : {}
|
|
19767
19786
|
};
|
|
19768
19787
|
b((e) => [...e, n]), S(t);
|
|
19769
|
-
}, [y.length, g]),
|
|
19788
|
+
}, [y.length, g]), oe = I((e, t) => {
|
|
19770
19789
|
t.stopPropagation(), y.length <= 1 ? n() : (b((t) => {
|
|
19771
19790
|
let n = t.filter((t) => t.id !== e);
|
|
19772
19791
|
if (x === e) {
|
|
@@ -19782,9 +19801,9 @@ function Sh({ shells: e, open: t, onClose: n, cwd: r, confinedRoot: i, confineme
|
|
|
19782
19801
|
y.length,
|
|
19783
19802
|
x,
|
|
19784
19803
|
n
|
|
19785
|
-
]),
|
|
19804
|
+
]), se = (e, t) => {
|
|
19786
19805
|
t.stopPropagation(), w(e.id), E(e.title);
|
|
19787
|
-
},
|
|
19806
|
+
}, M = () => {
|
|
19788
19807
|
if (C) {
|
|
19789
19808
|
let e = T.trim();
|
|
19790
19809
|
e && b((t) => t.map((t) => t.id === C ? {
|
|
@@ -19792,12 +19811,12 @@ function Sh({ shells: e, open: t, onClose: n, cwd: r, confinedRoot: i, confineme
|
|
|
19792
19811
|
title: e
|
|
19793
19812
|
} : t)), w(null);
|
|
19794
19813
|
}
|
|
19795
|
-
},
|
|
19796
|
-
e.key === "Enter" ?
|
|
19797
|
-
},
|
|
19814
|
+
}, N = (e) => {
|
|
19815
|
+
e.key === "Enter" ? M() : e.key === "Escape" && w(null);
|
|
19816
|
+
}, P = I(() => {
|
|
19798
19817
|
let e = j.current.get(x);
|
|
19799
19818
|
e && e();
|
|
19800
|
-
}, [x]),
|
|
19819
|
+
}, [x]), F = D[x] || r || "";
|
|
19801
19820
|
return _ ? /* @__PURE__ */ G("div", {
|
|
19802
19821
|
style: {
|
|
19803
19822
|
height: O ? "85vh" : k.width,
|
|
@@ -19824,7 +19843,7 @@ function Sh({ shells: e, open: t, onClose: n, cwd: r, confinedRoot: i, confineme
|
|
|
19824
19843
|
let t = e.id === x, n = e.id === C;
|
|
19825
19844
|
return /* @__PURE__ */ G("div", {
|
|
19826
19845
|
onClick: () => S(e.id),
|
|
19827
|
-
onDoubleClick: (t) =>
|
|
19846
|
+
onDoubleClick: (t) => se(e, t),
|
|
19828
19847
|
title: "Double-click to rename tab",
|
|
19829
19848
|
className: `flex items-center space-x-1 px-2.5 py-1 rounded text-xs cursor-pointer transition-colors ${t ? "bg-zinc-200 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 font-medium shadow-sm" : "text-zinc-500 hover:text-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-200/50 dark:hover:bg-zinc-800/50"}`,
|
|
19830
19849
|
children: [n ? /* @__PURE__ */ W("input", {
|
|
@@ -19833,11 +19852,11 @@ function Sh({ shells: e, open: t, onClose: n, cwd: r, confinedRoot: i, confineme
|
|
|
19833
19852
|
value: T,
|
|
19834
19853
|
autoFocus: !0,
|
|
19835
19854
|
onChange: (e) => E(e.target.value),
|
|
19836
|
-
onBlur:
|
|
19837
|
-
onKeyDown:
|
|
19855
|
+
onBlur: M,
|
|
19856
|
+
onKeyDown: N,
|
|
19838
19857
|
className: "bg-transparent border border-sky-500 rounded px-1 py-0 text-xs font-mono outline-none text-zinc-900 dark:text-zinc-100 w-24"
|
|
19839
19858
|
}) : /* @__PURE__ */ W("span", { children: e.title }), y.length > 1 && /* @__PURE__ */ W("span", {
|
|
19840
|
-
onClick: (t) =>
|
|
19859
|
+
onClick: (t) => oe(e.id, t),
|
|
19841
19860
|
role: "button",
|
|
19842
19861
|
tabIndex: 0,
|
|
19843
19862
|
"aria-label": "Close terminal tab",
|
|
@@ -19873,7 +19892,7 @@ function Sh({ shells: e, open: t, onClose: n, cwd: r, confinedRoot: i, confineme
|
|
|
19873
19892
|
}, e.id))]
|
|
19874
19893
|
}),
|
|
19875
19894
|
/* @__PURE__ */ W("button", {
|
|
19876
|
-
onClick:
|
|
19895
|
+
onClick: ae,
|
|
19877
19896
|
type: "button",
|
|
19878
19897
|
title: "New Terminal Tab",
|
|
19879
19898
|
className: "p-1 rounded text-zinc-500 hover:text-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-200/60 dark:hover:bg-zinc-800/60",
|
|
@@ -19900,26 +19919,26 @@ function Sh({ shells: e, open: t, onClose: n, cwd: r, confinedRoot: i, confineme
|
|
|
19900
19919
|
surface: "terminal",
|
|
19901
19920
|
root: bh(i)
|
|
19902
19921
|
}),
|
|
19903
|
-
|
|
19922
|
+
F && /* @__PURE__ */ W("div", {
|
|
19904
19923
|
className: "hidden md:flex items-center space-x-1.5 px-2 text-xs font-mono text-zinc-500 dark:text-zinc-400",
|
|
19905
19924
|
children: s && /* @__PURE__ */ W("button", {
|
|
19906
19925
|
onClick: () => {
|
|
19907
|
-
if (
|
|
19908
|
-
if ((
|
|
19909
|
-
s(
|
|
19926
|
+
if (F && s) {
|
|
19927
|
+
if ((F === "/" || F === "\\" || /^[A-Za-z]:[\\/]?$/.test(F)) && !window.confirm(`Open root filesystem "${F}" as the workspace project?`)) return;
|
|
19928
|
+
s(F), A(!0), setTimeout(() => A(!1), 2e3);
|
|
19910
19929
|
}
|
|
19911
19930
|
},
|
|
19912
19931
|
type: "button",
|
|
19913
|
-
title: `Open "${
|
|
19932
|
+
title: `Open "${F}" as the workspace project and reposition the LLM agent`,
|
|
19914
19933
|
className: `flex items-center space-x-1 px-1.5 py-0.5 rounded text-[11px] font-sans transition-colors ${ne ? "bg-emerald-500 text-white font-medium" : "bg-zinc-200/80 hover:bg-sky-500 hover:text-white dark:bg-zinc-800 dark:hover:bg-sky-600 dark:hover:text-white text-zinc-700 dark:text-zinc-300"}`,
|
|
19915
|
-
children: /* @__PURE__ */ W("span", { children: ne ? "✓ Project opened" : `📁 ${bh(
|
|
19934
|
+
children: /* @__PURE__ */ W("span", { children: ne ? "✓ Project opened" : `📁 ${bh(F)} → open as project` })
|
|
19916
19935
|
})
|
|
19917
19936
|
}),
|
|
19918
19937
|
/* @__PURE__ */ G("div", {
|
|
19919
19938
|
className: "flex items-center space-x-1 text-zinc-500 dark:text-zinc-400",
|
|
19920
19939
|
children: [
|
|
19921
19940
|
/* @__PURE__ */ W("button", {
|
|
19922
|
-
onClick:
|
|
19941
|
+
onClick: P,
|
|
19923
19942
|
type: "button",
|
|
19924
19943
|
title: "Clear Terminal Output",
|
|
19925
19944
|
className: "p-1 rounded hover:text-zinc-800 dark:hover:text-zinc-200 hover:bg-zinc-200/60 dark:hover:bg-zinc-800/60",
|
|
@@ -20013,8 +20032,8 @@ function Sh({ shells: e, open: t, onClose: n, cwd: r, confinedRoot: i, confineme
|
|
|
20013
20032
|
resizeTerminal: d,
|
|
20014
20033
|
closeTerminal: f,
|
|
20015
20034
|
subscribeTerminal: p,
|
|
20016
|
-
onCwdUpdate:
|
|
20017
|
-
registerClear:
|
|
20035
|
+
onCwdUpdate: ie,
|
|
20036
|
+
registerClear: re
|
|
20018
20037
|
}, e.id))
|
|
20019
20038
|
})
|
|
20020
20039
|
]
|
|
@@ -21858,25 +21877,25 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
21858
21877
|
let [i, a] = B(Bh, Ph), o = V(null), [s, c] = H(0), l = V(null), u = V(null);
|
|
21859
21878
|
s === 0 && l.current === null && (l.current = t ?? (n ? kh() : Oh()));
|
|
21860
21879
|
let d = V(i.fileTree), f = V(i.openFile);
|
|
21861
|
-
|
|
21880
|
+
L(() => {
|
|
21862
21881
|
d.current = i.fileTree;
|
|
21863
|
-
}, [i.fileTree]),
|
|
21882
|
+
}, [i.fileTree]), L(() => {
|
|
21864
21883
|
f.current = i.openFile;
|
|
21865
21884
|
}, [i.openFile]);
|
|
21866
21885
|
let p = V(null);
|
|
21867
|
-
|
|
21886
|
+
L(() => {
|
|
21868
21887
|
p.current = i.gitDiff?.path ?? null;
|
|
21869
21888
|
}, [i.gitDiff]);
|
|
21870
21889
|
let h = V(/* @__PURE__ */ new Map()), g = V(/* @__PURE__ */ new Map()), _ = V(/* @__PURE__ */ new Map()), v = V(/* @__PURE__ */ new Map()), y = V(i.sessionId);
|
|
21871
|
-
|
|
21890
|
+
L(() => {
|
|
21872
21891
|
y.current = i.sessionId;
|
|
21873
21892
|
}, [i.sessionId]);
|
|
21874
21893
|
let b = V(!1), x = V(i.olderHistory);
|
|
21875
|
-
|
|
21894
|
+
L(() => {
|
|
21876
21895
|
x.current = i.olderHistory;
|
|
21877
21896
|
}, [i.olderHistory]);
|
|
21878
21897
|
let C = V(i.writableRoot);
|
|
21879
|
-
|
|
21898
|
+
L(() => {
|
|
21880
21899
|
C.current = i.writableRoot;
|
|
21881
21900
|
}, [i.writableRoot]);
|
|
21882
21901
|
let w = V(!1), T = V(/* @__PURE__ */ new Map()), E = V(/* @__PURE__ */ new Map()), D = i.workspace ? Dt(i.workspace) : null, O = V({
|
|
@@ -21887,13 +21906,13 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
21887
21906
|
workspaceRoot: D,
|
|
21888
21907
|
sessionId: i.sessionId
|
|
21889
21908
|
});
|
|
21890
|
-
|
|
21909
|
+
L(() => {
|
|
21891
21910
|
A.current = {
|
|
21892
21911
|
workspaceRoot: D,
|
|
21893
21912
|
sessionId: i.sessionId
|
|
21894
21913
|
};
|
|
21895
21914
|
}, [D, i.sessionId]);
|
|
21896
|
-
let j =
|
|
21915
|
+
let j = I((e) => {
|
|
21897
21916
|
[
|
|
21898
21917
|
"switch_workspace",
|
|
21899
21918
|
"open_project",
|
|
@@ -21902,17 +21921,17 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
21902
21921
|
].includes(e.type) && k.current++;
|
|
21903
21922
|
let t = o.current;
|
|
21904
21923
|
t && t.readyState === WebSocket.OPEN && t.send(JSON.stringify(e));
|
|
21905
|
-
}, []),
|
|
21906
|
-
|
|
21907
|
-
}, []),
|
|
21924
|
+
}, []), re = V(!1), ie = V(null), ae = V(!1), oe = V(null), se = V(() => {}), M = I(() => {
|
|
21925
|
+
ie.current = null, oe.current !== null && (clearTimeout(oe.current), oe.current = null);
|
|
21926
|
+
}, []), N = I(() => {
|
|
21908
21927
|
let e = o.current;
|
|
21909
21928
|
if (!e || e.readyState !== WebSocket.OPEN) return;
|
|
21910
|
-
if (
|
|
21911
|
-
|
|
21929
|
+
if (ie.current !== null) {
|
|
21930
|
+
ae.current = !0;
|
|
21912
21931
|
return;
|
|
21913
21932
|
}
|
|
21914
21933
|
let t = `outcome:${$()}`;
|
|
21915
|
-
|
|
21934
|
+
ie.current = t;
|
|
21916
21935
|
let n = A.current;
|
|
21917
21936
|
a({
|
|
21918
21937
|
type: "outcome_started",
|
|
@@ -21921,20 +21940,20 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
21921
21940
|
}), j({
|
|
21922
21941
|
type: "get_outcome",
|
|
21923
21942
|
requestId: t
|
|
21924
|
-
}),
|
|
21925
|
-
|
|
21943
|
+
}), oe.current = setTimeout(() => {
|
|
21944
|
+
ie.current === t && (M(), ae.current = !1, a({
|
|
21926
21945
|
type: "outcome_failed",
|
|
21927
21946
|
requestId: t,
|
|
21928
21947
|
message: "The Outcome took too long to answer — try again."
|
|
21929
21948
|
}));
|
|
21930
21949
|
}, Gh);
|
|
21931
|
-
}, [j,
|
|
21932
|
-
|
|
21933
|
-
let
|
|
21934
|
-
|
|
21935
|
-
}, []),
|
|
21936
|
-
|
|
21937
|
-
}, [
|
|
21950
|
+
}, [j, M]);
|
|
21951
|
+
se.current = N;
|
|
21952
|
+
let P = I(() => {
|
|
21953
|
+
re.current && se.current();
|
|
21954
|
+
}, []), F = I((e) => {
|
|
21955
|
+
re.current = e, e ? N() : ae.current = !1;
|
|
21956
|
+
}, [N]), ce = I((e, t = !1) => {
|
|
21938
21957
|
e === "" && (w.current = !0);
|
|
21939
21958
|
let n = `dir:${$()}`;
|
|
21940
21959
|
a({
|
|
@@ -21947,7 +21966,7 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
21947
21966
|
path: e,
|
|
21948
21967
|
requestId: n
|
|
21949
21968
|
});
|
|
21950
|
-
}, [j]),
|
|
21969
|
+
}, [j]), R = V(!1), z = V(null), le = I((e, t) => {
|
|
21951
21970
|
let n = `gitlog:${$()}`;
|
|
21952
21971
|
a({
|
|
21953
21972
|
type: "git_log_started",
|
|
@@ -21960,11 +21979,11 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
21960
21979
|
requestId: n
|
|
21961
21980
|
});
|
|
21962
21981
|
}, [j]), de = V([]);
|
|
21963
|
-
|
|
21982
|
+
L(() => {
|
|
21964
21983
|
de.current = i.gitStatus?.repos ?? [];
|
|
21965
21984
|
}, [i.gitStatus]);
|
|
21966
|
-
let U = V(/* @__PURE__ */ new Set()), W = V(/* @__PURE__ */ new Set()), G = V(/* @__PURE__ */ new Map()), fe =
|
|
21967
|
-
if (!
|
|
21985
|
+
let U = V(/* @__PURE__ */ new Set()), W = V(/* @__PURE__ */ new Set()), G = V(/* @__PURE__ */ new Map()), fe = I((e) => {
|
|
21986
|
+
if (!R.current) return;
|
|
21968
21987
|
let t = e ?? "";
|
|
21969
21988
|
if (U.current.has(t)) {
|
|
21970
21989
|
W.current.add(t);
|
|
@@ -21977,26 +21996,26 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
21977
21996
|
...e === void 0 ? {} : { repo: e },
|
|
21978
21997
|
requestId: n
|
|
21979
21998
|
});
|
|
21980
|
-
}, [j]), pe =
|
|
21999
|
+
}, [j]), pe = I((e) => {
|
|
21981
22000
|
let t = G.current.get(e) ?? "";
|
|
21982
22001
|
G.current.delete(e), U.current.delete(t), W.current.delete(t) && fe(t === "" ? void 0 : t);
|
|
21983
|
-
}, [fe]), me =
|
|
21984
|
-
d.current[e] !== void 0 &&
|
|
21985
|
-
}, [
|
|
21986
|
-
|
|
22002
|
+
}, [fe]), me = I((e) => {
|
|
22003
|
+
d.current[e] !== void 0 && ce(e, !0);
|
|
22004
|
+
}, [ce]), he = I(() => {
|
|
22005
|
+
ce("", !0);
|
|
21987
22006
|
for (let e of Object.keys(d.current)) e !== "" && me(e);
|
|
21988
|
-
}, [me,
|
|
21989
|
-
|
|
21990
|
-
i.connected && w.current && d.current[""] === void 0 &&
|
|
22007
|
+
}, [me, ce]);
|
|
22008
|
+
L(() => {
|
|
22009
|
+
i.connected && w.current && d.current[""] === void 0 && ce("");
|
|
21991
22010
|
}, [
|
|
21992
22011
|
i.connected,
|
|
21993
22012
|
i.fileTree,
|
|
21994
|
-
|
|
21995
|
-
]),
|
|
21996
|
-
i.connected &&
|
|
22013
|
+
ce
|
|
22014
|
+
]), L(() => {
|
|
22015
|
+
i.connected && re.current && ie.current === null && se.current();
|
|
21997
22016
|
}, [i.connected]);
|
|
21998
22017
|
let ge = i.openFile?.path ?? null, _e = ge === null ? void 0 : i.gitStatus?.files[ge], ve = i.gitBaseline !== null;
|
|
21999
|
-
|
|
22018
|
+
L(() => {
|
|
22000
22019
|
let e = _e === "modified" || _e === "added" || _e === "conflicted";
|
|
22001
22020
|
if (!i.connected || ge === null || !e) {
|
|
22002
22021
|
ve && a({ type: "git_baseline_cleared" });
|
|
@@ -22018,7 +22037,7 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22018
22037
|
_e,
|
|
22019
22038
|
i.gitStatus,
|
|
22020
22039
|
j
|
|
22021
|
-
]),
|
|
22040
|
+
]), L(() => {
|
|
22022
22041
|
let t = !1;
|
|
22023
22042
|
return fetch(`${e}/branding`, { headers: l.current ? { Authorization: `Bearer ${l.current}` } : {} }).then((e) => e.ok ? e.json() : null).then((e) => {
|
|
22024
22043
|
t || a(e ? {
|
|
@@ -22030,7 +22049,7 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22030
22049
|
}), () => {
|
|
22031
22050
|
t = !0;
|
|
22032
22051
|
};
|
|
22033
|
-
}, [e, s]),
|
|
22052
|
+
}, [e, s]), L(() => {
|
|
22034
22053
|
let t, n = !1;
|
|
22035
22054
|
function i() {
|
|
22036
22055
|
let s = new WebSocket(Vh(e, l.current, r));
|
|
@@ -22100,7 +22119,7 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22100
22119
|
let e = h.current.get(t.requestId);
|
|
22101
22120
|
h.current.delete(t.requestId), e.reject(new Sn(t.message, t.reason));
|
|
22102
22121
|
} else if (t.type === "file_changed") {
|
|
22103
|
-
|
|
22122
|
+
P();
|
|
22104
22123
|
for (let e of _.current.get(t.path) ?? []) e();
|
|
22105
22124
|
me(jh(t.path));
|
|
22106
22125
|
let e = f.current;
|
|
@@ -22123,7 +22142,7 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22123
22142
|
requestId: `gitdiff:${$()}`
|
|
22124
22143
|
}), fe(gn(de.current, t.path)?.repo);
|
|
22125
22144
|
} else if (t.type === "directory_changed") {
|
|
22126
|
-
|
|
22145
|
+
P();
|
|
22127
22146
|
for (let [e, n] of _.current) if (jh(e) === t.path) for (let e of n) e();
|
|
22128
22147
|
me(t.path);
|
|
22129
22148
|
let e = f.current;
|
|
@@ -22153,15 +22172,15 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22153
22172
|
requestId: `gitdiff:${$()}`
|
|
22154
22173
|
}), fe();
|
|
22155
22174
|
} else {
|
|
22156
|
-
if ((t.type === "hello" || t.type === "session_replaced" || t.type === "workspace_switched" || t.type === "workspace_starting") && (
|
|
22157
|
-
|
|
22158
|
-
let e =
|
|
22175
|
+
if ((t.type === "hello" || t.type === "session_replaced" || t.type === "workspace_switched" || t.type === "workspace_starting") && (R.current = t.gitAvailable === !0, t.type !== "session_replaced" && fe()), t.type === "agent_end" && (fe(), P()), t.type === "git_repositories_changed" && (P(), R.current = t.available, t.available && fe()), t.type === "git_changed") {
|
|
22176
|
+
P(), fe(t.repo === "" ? void 0 : t.repo);
|
|
22177
|
+
let e = z.current;
|
|
22159
22178
|
e !== null && e.repo === t.repo && le(e.repo, e.limit);
|
|
22160
22179
|
}
|
|
22161
|
-
if ((t.type === "git_status" || t.type === "git_error" && t.requestId.startsWith("git:")) && pe(t.requestId), t.type === "work_plan_changed" &&
|
|
22162
|
-
|
|
22180
|
+
if ((t.type === "git_status" || t.type === "git_error" && t.requestId.startsWith("git:")) && pe(t.requestId), t.type === "work_plan_changed" && P(), (t.type === "workspace_outcome" || t.type === "workspace_outcome_error") && ie.current === t.requestId && (M(), ae.current && (ae.current = !1, queueMicrotask(() => se.current()))), t.type === "hello" || t.type === "session_replaced" || t.type === "workspace_switched" || t.type === "workspace_starting" || t.type === "update_config_ack") {
|
|
22181
|
+
M(), ae.current = !1;
|
|
22163
22182
|
let e = A.current, n = t.sessionId === e.sessionId, r = (t.workspace ? Dt(t.workspace) : null) === e.workspaceRoot;
|
|
22164
|
-
|
|
22183
|
+
re.current && n && r && queueMicrotask(() => se.current());
|
|
22165
22184
|
}
|
|
22166
22185
|
if (t.type === "file_operation_result") {
|
|
22167
22186
|
let e = t.previousPath ?? t.path, n = f.current;
|
|
@@ -22173,12 +22192,12 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22173
22192
|
a({
|
|
22174
22193
|
type: "server",
|
|
22175
22194
|
message: t
|
|
22176
|
-
}), t.type === "session_replaced" &&
|
|
22195
|
+
}), t.type === "session_replaced" && ce("");
|
|
22177
22196
|
}
|
|
22178
22197
|
}
|
|
22179
22198
|
}, s.onclose = (e) => {
|
|
22180
22199
|
if (o.current === s) {
|
|
22181
|
-
k.current++, U.current.clear(), W.current.clear(), G.current.clear(),
|
|
22200
|
+
k.current++, U.current.clear(), W.current.clear(), G.current.clear(), M(), ae.current = !1;
|
|
22182
22201
|
for (let e of h.current.values()) e.reject(new Sn("The connection dropped before the upload finished"));
|
|
22183
22202
|
h.current.clear();
|
|
22184
22203
|
for (let e of g.current.values()) e.reject(new m("The connection dropped before the server answered"));
|
|
@@ -22199,14 +22218,14 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22199
22218
|
fe,
|
|
22200
22219
|
pe,
|
|
22201
22220
|
me,
|
|
22202
|
-
|
|
22203
|
-
|
|
22204
|
-
|
|
22221
|
+
ce,
|
|
22222
|
+
P,
|
|
22223
|
+
M,
|
|
22205
22224
|
s,
|
|
22206
22225
|
r,
|
|
22207
22226
|
le
|
|
22208
22227
|
]);
|
|
22209
|
-
let K =
|
|
22228
|
+
let K = I((e, t) => {
|
|
22210
22229
|
let n = o.current;
|
|
22211
22230
|
if (!n || n.readyState !== WebSocket.OPEN) return Promise.reject(new S("not connected to the server", "failed"));
|
|
22212
22231
|
let r = `history:${$()}`;
|
|
@@ -22227,7 +22246,7 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22227
22246
|
requestId: r
|
|
22228
22247
|
});
|
|
22229
22248
|
});
|
|
22230
|
-
}, [j]), ye =
|
|
22249
|
+
}, [j]), ye = I(async () => {
|
|
22231
22250
|
let e = x.current;
|
|
22232
22251
|
if (!(!e || e.loading || b.current || e.remaining <= 0)) {
|
|
22233
22252
|
b.current = !0, a({ type: "history_load_started" });
|
|
@@ -22308,8 +22327,8 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22308
22327
|
}
|
|
22309
22328
|
};
|
|
22310
22329
|
}, [j]),
|
|
22311
|
-
setOutcomeActive:
|
|
22312
|
-
refreshOutcome:
|
|
22330
|
+
setOutcomeActive: F,
|
|
22331
|
+
refreshOutcome: N,
|
|
22313
22332
|
authToken: l.current,
|
|
22314
22333
|
switchWorkspace: (e, t) => {
|
|
22315
22334
|
((t ?? e) !== D || i.switching) && (a({ type: "workspace_switching" }), j({
|
|
@@ -22519,7 +22538,7 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22519
22538
|
type: "dismiss_notification",
|
|
22520
22539
|
id: e
|
|
22521
22540
|
}),
|
|
22522
|
-
listDirectory: (e) =>
|
|
22541
|
+
listDirectory: (e) => ce(e),
|
|
22523
22542
|
refreshFileTree: he,
|
|
22524
22543
|
readFile: (e, t, n) => {
|
|
22525
22544
|
let r = `file:${$()}`;
|
|
@@ -22579,7 +22598,7 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22579
22598
|
i(new Cn());
|
|
22580
22599
|
return;
|
|
22581
22600
|
}
|
|
22582
|
-
|
|
22601
|
+
ce(n, !0);
|
|
22583
22602
|
}
|
|
22584
22603
|
r(e);
|
|
22585
22604
|
}),
|
|
@@ -22736,13 +22755,13 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22736
22755
|
},
|
|
22737
22756
|
clearGitDiff: () => a({ type: "git_diff_cleared" }),
|
|
22738
22757
|
fetchGitLog: (e, t) => {
|
|
22739
|
-
|
|
22758
|
+
z.current = {
|
|
22740
22759
|
repo: e,
|
|
22741
22760
|
limit: t
|
|
22742
22761
|
}, le(e, t);
|
|
22743
22762
|
},
|
|
22744
22763
|
closeGitLog: () => {
|
|
22745
|
-
|
|
22764
|
+
z.current = null, a({ type: "git_log_closed" });
|
|
22746
22765
|
},
|
|
22747
22766
|
fetchGitShow: (e, t) => j({
|
|
22748
22767
|
type: "git_show",
|
|
@@ -23004,25 +23023,25 @@ function Xh({ label: e }) {
|
|
|
23004
23023
|
})
|
|
23005
23024
|
});
|
|
23006
23025
|
}
|
|
23007
|
-
var Zh =
|
|
23008
|
-
let o = t !== void 0, s = t ?? document.documentElement, { state: c, authToken: d, submitToken: p, prompt: m, abort: h, cancelPendingPrompt: g, setModel: y, setThinking: b, newSession: x, switchSession: S, deleteSession: C, listSessions: w, renameSession: T, searchSessions: E, clearSessionSearch: D, listTree: ee, navigateTree: O, forkSession: te, editPrompt: k, editQueuedPrompt: ne, removeQueuedPrompt: A, sendQueueNow:
|
|
23026
|
+
var Zh = N(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token: r, workspace: i }, a) {
|
|
23027
|
+
let o = t !== void 0, s = t ?? document.documentElement, { state: c, authToken: d, submitToken: p, prompt: m, abort: h, cancelPendingPrompt: g, setModel: y, setThinking: b, newSession: x, switchSession: S, deleteSession: C, listSessions: w, renameSession: T, searchSessions: E, clearSessionSearch: D, listTree: ee, navigateTree: O, forkSession: te, editPrompt: k, editQueuedPrompt: ne, removeQueuedPrompt: A, sendQueueNow: re, prefillComposer: ie, compact: ae, loadOlderItems: oe, fetchOlderItems: se, respondToDialog: M, respondToGrant: N, dismissNotification: P, listDirectory: F, refreshFileTree: ce, readFile: R, searchContent: B, writeFile: de, createFile: U, createDirectory: fe, uploadFile: pe, openNative: me, revealNative: he, renameFile: ge, deleteFile: ve, moveFile: K, copyFile: ye, closeFilePreview: be, searchFiles: xe, clearFileSearch: Se, fetchGitDiff: Ce, clearGitDiff: we, fetchGitLog: Te, closeGitLog: Ee, fetchGitShow: De, clearGitShow: Oe, fetchGitFileHistory: ke, closeGitFileHistory: Ae, fetchGitFileDiff: je, clearGitFileDiff: Me, setCredential: Ne, startLogin: Fe, answerLogin: Ie, cancelLogin: Re, dismissLogin: ze, logoutProvider: Be, declareProvider: Ve, updateConfig: He, suggestAgentResourceClonePath: Ue, cloneAgentResourceRepository: We, enrollAgentResourceRepository: Ge, setAgentResourceSkills: Ke, removeAgentResourceRepository: qe, refreshAgentResourceRepositories: Je, updateAgentResourceRepository: Ye, browseServerDirectory: Xe, closeServerBrowser: Ze, switchWorkspace: Qe, openProject: $e, closeProject: et, openSideSession: tt, checkPiPackages: nt, updatePiPackage: rt, lookupPiPackage: it, closePiPackageLookup: at, installPiPackage: ot, removePiPackage: st, restorePiPackage: ct, restartServer: lt, restartSession: ut, openTerminal: dt, sendTerminalInput: ft, getTerminalCwd: pt, resizeTerminal: mt, closeTerminal: ht, subscribeTerminal: gt, setOutcomeActive: _t, refreshOutcome: bt, fileIo: xt } = Jh(e, r, o, i), Ct = j(c.workspace);
|
|
23009
23028
|
Do(c.workspaces, c.workspace ? Dt(c.workspace) : null);
|
|
23010
23029
|
let wt = c.workspace ? Dt(c.workspace) : null;
|
|
23011
|
-
|
|
23030
|
+
L(() => {
|
|
23012
23031
|
Ft([]), zn([]), ar.current && (ar.current.scrollTop = 0);
|
|
23013
23032
|
}, [wt]);
|
|
23014
23033
|
let [Tt, Ot] = H(!1), [jt, Nt] = H(!1), [Pt, Ft] = H([]), [It, Lt] = H([]), [Rt, zt] = H(!1), [Bt, Vt] = H(null), [Ut, Wt] = H(null), Gt = Bt === "project", Kt = (e) => Vt(e ? "project" : null), qt = c.embedWorkspaceControls === "projects" ? "projects" : c.embedWorkspaceControls === "root" ? "root" : "none", Jt = V({}), Yt = (e, t) => {
|
|
23015
23034
|
let n = Jt.current[wt ?? ""]?.trim(), r = n ? `${n}\n\n${e}` : e;
|
|
23016
|
-
t ?
|
|
23035
|
+
t ? ie(r, t) : ie(r);
|
|
23017
23036
|
}, Xt = c.queuedEditRefused;
|
|
23018
|
-
|
|
23037
|
+
L(() => {
|
|
23019
23038
|
Xt && Yt(Xt.text);
|
|
23020
23039
|
}, [Xt?.nonce]);
|
|
23021
23040
|
let Zt = V({
|
|
23022
23041
|
key: null,
|
|
23023
23042
|
drafts: /* @__PURE__ */ new Map()
|
|
23024
23043
|
});
|
|
23025
|
-
|
|
23044
|
+
L(() => {
|
|
23026
23045
|
let e = Zt.current;
|
|
23027
23046
|
if (e.key !== wt) {
|
|
23028
23047
|
Zt.current = {
|
|
@@ -23043,11 +23062,11 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23043
23062
|
draft: n
|
|
23044
23063
|
});
|
|
23045
23064
|
}, $t = V([]), [en, tn] = H(!1), nn = V({
|
|
23046
|
-
readFile:
|
|
23065
|
+
readFile: R,
|
|
23047
23066
|
openNative: me
|
|
23048
23067
|
});
|
|
23049
23068
|
nn.current = {
|
|
23050
|
-
readFile:
|
|
23069
|
+
readFile: R,
|
|
23051
23070
|
openNative: me
|
|
23052
23071
|
};
|
|
23053
23072
|
let rn = ue(() => ({
|
|
@@ -23057,13 +23076,13 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23057
23076
|
tn(!1), nn.current.readFile(e);
|
|
23058
23077
|
},
|
|
23059
23078
|
onOpenNative: (e) => nn.current.openNative(e)
|
|
23060
|
-
}), [e, xt]), [an, sn] = H(pn), ln =
|
|
23079
|
+
}), [e, xt]), [an, sn] = H(pn), ln = I((e, t) => {
|
|
23061
23080
|
mn(e, t), sn((n) => ({
|
|
23062
23081
|
...n,
|
|
23063
23082
|
[e]: t
|
|
23064
23083
|
}));
|
|
23065
23084
|
}, []), [un, dn] = H(!1), [fn, hn] = H(!0), [vn, yn] = H(() => typeof window < "u" && window.innerWidth < 768), [bn, xn] = H(!1), Sn = vn ? bn : fn, [Cn, wn] = H(!1), Tn = c.terminal?.enabled ?? !1;
|
|
23066
|
-
|
|
23085
|
+
L(() => {
|
|
23067
23086
|
let e = window.matchMedia("(max-width: 767px)"), t = () => {
|
|
23068
23087
|
let t = e.matches;
|
|
23069
23088
|
t && xn(!1), yn(t);
|
|
@@ -23071,13 +23090,13 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23071
23090
|
return t(), e.addEventListener("change", t), window.addEventListener("resize", t), () => {
|
|
23072
23091
|
e.removeEventListener("change", t), window.removeEventListener("resize", t);
|
|
23073
23092
|
};
|
|
23074
|
-
}, []),
|
|
23093
|
+
}, []), L(() => {
|
|
23075
23094
|
let e = (e) => {
|
|
23076
23095
|
Tn && (e.ctrlKey || e.metaKey) && e.key === "`" && (e.preventDefault(), wn((e) => !e));
|
|
23077
23096
|
};
|
|
23078
23097
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
23079
23098
|
}, [Tn]);
|
|
23080
|
-
let [En, On] = H(!1), [kn, An] = H(null), jn =
|
|
23099
|
+
let [En, On] = H(!1), [kn, An] = H(null), jn = I(() => An(null), []);
|
|
23081
23100
|
function Mn() {
|
|
23082
23101
|
let e = !un;
|
|
23083
23102
|
dn(e), e && (hn(!1), xn(!1), On(!1));
|
|
@@ -23095,12 +23114,12 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23095
23114
|
let e = !En;
|
|
23096
23115
|
On(e), e && (dn(!1), hn(!1), xn(!1));
|
|
23097
23116
|
}
|
|
23098
|
-
|
|
23117
|
+
L(() => (_t(En), () => _t(!1)), [
|
|
23099
23118
|
En,
|
|
23100
23119
|
_t,
|
|
23101
23120
|
c.sessionId,
|
|
23102
23121
|
wt
|
|
23103
|
-
]),
|
|
23122
|
+
]), L(() => {
|
|
23104
23123
|
On(!1), An(null);
|
|
23105
23124
|
}, [wt]);
|
|
23106
23125
|
let [In, Ln] = H([]), [Rn, zn] = H([]), Hn = V(0), Un = V(0), [Wn, Gn] = H(0);
|
|
@@ -23120,7 +23139,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23120
23139
|
}
|
|
23121
23140
|
}
|
|
23122
23141
|
}
|
|
23123
|
-
|
|
23142
|
+
L(() => {
|
|
23124
23143
|
$t.current = Pt;
|
|
23125
23144
|
}, [Pt]);
|
|
23126
23145
|
function qn() {
|
|
@@ -23150,18 +23169,18 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23150
23169
|
e.preventDefault(), Gn(0), e.dataTransfer.files.length > 0 && Kn(Array.from(e.dataTransfer.files));
|
|
23151
23170
|
}
|
|
23152
23171
|
let { theme: tr, preference: nr, toggle: rr, setTheme: ir } = _e(c.branding.defaultTheme ?? "system", c.branding.allowThemeToggle !== !1, s, n);
|
|
23153
|
-
|
|
23154
|
-
let ar = V(null), [sr, cr] = H(null), lr =
|
|
23172
|
+
z(a, () => ({ setTheme: ir }), [ir]);
|
|
23173
|
+
let ar = V(null), [sr, cr] = H(null), lr = I((e) => {
|
|
23155
23174
|
ar.current = e, cr(e);
|
|
23156
|
-
}, []), dr = V(null), fr = V(!0), [pr, hr] = H(!0), gr =
|
|
23175
|
+
}, []), dr = V(null), fr = V(!0), [pr, hr] = H(!0), gr = I((e) => {
|
|
23157
23176
|
e !== fr.current && hr(e), fr.current = e;
|
|
23158
|
-
}, []), _r =
|
|
23177
|
+
}, []), _r = I(() => {
|
|
23159
23178
|
let e = ar.current;
|
|
23160
23179
|
e && gr(e.scrollHeight - e.scrollTop - e.clientHeight < Yh);
|
|
23161
|
-
}, [gr]), vr = V(null), yr =
|
|
23180
|
+
}, [gr]), vr = V(null), yr = I(() => {
|
|
23162
23181
|
let e = ar.current;
|
|
23163
23182
|
e && (e.scrollHeight - e.scrollTop - e.clientHeight < Yh || (vr.current = e.scrollTop));
|
|
23164
|
-
}, []), br =
|
|
23183
|
+
}, []), br = I(() => {
|
|
23165
23184
|
let e = ar.current;
|
|
23166
23185
|
if (!e) return;
|
|
23167
23186
|
let t = e.scrollHeight - e.scrollTop - e.clientHeight < Yh, n = vr.current;
|
|
@@ -23174,7 +23193,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23174
23193
|
function xr() {
|
|
23175
23194
|
vr.current = null;
|
|
23176
23195
|
}
|
|
23177
|
-
|
|
23196
|
+
L(() => {
|
|
23178
23197
|
let e = sr;
|
|
23179
23198
|
if (!e) return;
|
|
23180
23199
|
let t = () => {
|
|
@@ -23192,12 +23211,12 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23192
23211
|
br,
|
|
23193
23212
|
yr
|
|
23194
23213
|
]);
|
|
23195
|
-
let Cr =
|
|
23214
|
+
let Cr = I(() => {
|
|
23196
23215
|
gr(!0), yr();
|
|
23197
23216
|
let e = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? !1;
|
|
23198
23217
|
dr.current?.scrollIntoView({ behavior: e ? "auto" : "smooth" });
|
|
23199
23218
|
}, [gr, yr]);
|
|
23200
|
-
|
|
23219
|
+
L(() => {
|
|
23201
23220
|
fr.current ? (yr(), dr.current?.scrollIntoView({ behavior: "smooth" })) : _r();
|
|
23202
23221
|
}, [
|
|
23203
23222
|
c.items,
|
|
@@ -23206,18 +23225,18 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23206
23225
|
]);
|
|
23207
23226
|
let wr = ue(() => Mt(c.items), [c.items]), Tr = ue(() => un ? Ht(c.items) : null, [un, c.items]), Er = ue(() => Le({
|
|
23208
23227
|
readFile: (e, t) => {
|
|
23209
|
-
tn(!1),
|
|
23228
|
+
tn(!1), R(e, t);
|
|
23210
23229
|
},
|
|
23211
23230
|
fetchGitFileHistory: (e) => ke(e),
|
|
23212
23231
|
fetchGitDiff: (e) => {
|
|
23213
|
-
tn(!0),
|
|
23232
|
+
tn(!0), R(e);
|
|
23214
23233
|
},
|
|
23215
23234
|
searchFiles: (e) => xe(e)
|
|
23216
23235
|
}), [
|
|
23217
|
-
|
|
23236
|
+
R,
|
|
23218
23237
|
ke,
|
|
23219
23238
|
xe
|
|
23220
|
-
]), Dr =
|
|
23239
|
+
]), Dr = I(() => ln("tools", !0), [ln]), Or = I((e) => {
|
|
23221
23240
|
let t = ar.current;
|
|
23222
23241
|
if (t) {
|
|
23223
23242
|
let n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), i = r.top >= n.top && r.bottom <= n.bottom, a = t.scrollHeight - t.scrollTop - t.clientHeight < Yh;
|
|
@@ -23231,14 +23250,14 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23231
23250
|
c.sessionName,
|
|
23232
23251
|
c.sessions,
|
|
23233
23252
|
c.sessionId
|
|
23234
|
-
]), Pr =
|
|
23253
|
+
]), Pr = I(async () => {
|
|
23235
23254
|
Mr(null), Ar("preparing…");
|
|
23236
23255
|
try {
|
|
23237
|
-
let { exportConversation: t } = await import("./conversationExport-
|
|
23256
|
+
let { exportConversation: t } = await import("./conversationExport-C761zW6H.js");
|
|
23238
23257
|
await t({
|
|
23239
23258
|
items: c.items,
|
|
23240
23259
|
olderItems: c.olderHistory?.remaining ?? 0,
|
|
23241
|
-
...c.olderHistory ? { fetchOlderItems:
|
|
23260
|
+
...c.olderHistory ? { fetchOlderItems: se } : {},
|
|
23242
23261
|
connection: {
|
|
23243
23262
|
serverUrl: e,
|
|
23244
23263
|
token: d,
|
|
@@ -23263,7 +23282,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23263
23282
|
c.workspace,
|
|
23264
23283
|
c.model,
|
|
23265
23284
|
Nr,
|
|
23266
|
-
|
|
23285
|
+
se,
|
|
23267
23286
|
e,
|
|
23268
23287
|
d,
|
|
23269
23288
|
Ct
|
|
@@ -23273,13 +23292,13 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23273
23292
|
hideTools: !an.tools,
|
|
23274
23293
|
onShowTools: Dr,
|
|
23275
23294
|
onJump: Or
|
|
23276
|
-
}), Lr = V(null), Rr = V(c.olderHistory?.have ?? 0), zr =
|
|
23295
|
+
}), Lr = V(null), Rr = V(c.olderHistory?.have ?? 0), zr = I(() => {
|
|
23277
23296
|
let e = ar.current;
|
|
23278
23297
|
e && (Lr.current = {
|
|
23279
23298
|
height: e.scrollHeight,
|
|
23280
23299
|
top: e.scrollTop
|
|
23281
|
-
}),
|
|
23282
|
-
}, [
|
|
23300
|
+
}), oe();
|
|
23301
|
+
}, [oe]);
|
|
23283
23302
|
if (le(() => {
|
|
23284
23303
|
let e = c.olderHistory?.have ?? 0, t = Rr.current;
|
|
23285
23304
|
Rr.current = e;
|
|
@@ -23287,7 +23306,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23287
23306
|
if (Lr.current = null, !n || e <= t) return;
|
|
23288
23307
|
let r = ar.current;
|
|
23289
23308
|
r && (r.scrollTop = n.top + (r.scrollHeight - n.height));
|
|
23290
|
-
}, [c.olderHistory?.have]),
|
|
23309
|
+
}, [c.olderHistory?.have]), L(() => {
|
|
23291
23310
|
if (!o) {
|
|
23292
23311
|
let e = c.extensionTitle ?? c.branding.title ?? "pi";
|
|
23293
23312
|
document.title = c.workspace ? `${c.workspace.name} — ${e}` : e;
|
|
@@ -23357,14 +23376,14 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23357
23376
|
writableRoot: c.writableRoot,
|
|
23358
23377
|
gitFiles: c.gitStatus?.files,
|
|
23359
23378
|
attachedPaths: Jn,
|
|
23360
|
-
onExpand:
|
|
23379
|
+
onExpand: F,
|
|
23361
23380
|
onSelectDirectory: Wt,
|
|
23362
|
-
onRefresh:
|
|
23381
|
+
onRefresh: ce,
|
|
23363
23382
|
onSelectFile: (e) => {
|
|
23364
|
-
tn(!1), Wt(e),
|
|
23383
|
+
tn(!1), Wt(e), R(e);
|
|
23365
23384
|
},
|
|
23366
23385
|
onSelectDiff: (e) => {
|
|
23367
|
-
tn(!0), Wt(e),
|
|
23386
|
+
tn(!0), Wt(e), R(e);
|
|
23368
23387
|
},
|
|
23369
23388
|
onToggleAttachPath: Xn,
|
|
23370
23389
|
onCreateFile: (e) => {
|
|
@@ -23383,7 +23402,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23383
23402
|
contentSearch: c.contentSearch,
|
|
23384
23403
|
onSearchContent: B,
|
|
23385
23404
|
onOpenSearchHit: (e, t) => {
|
|
23386
|
-
tn(!1), Wt(e.path),
|
|
23405
|
+
tn(!1), Wt(e.path), R(e.path, void 0, e.kind === "line" ? {
|
|
23387
23406
|
query: t,
|
|
23388
23407
|
line: e.line
|
|
23389
23408
|
} : {
|
|
@@ -23539,7 +23558,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23539
23558
|
open: Sn,
|
|
23540
23559
|
onToggle: Nn,
|
|
23541
23560
|
onOpenWorkspace: (e) => {
|
|
23542
|
-
tn(!1),
|
|
23561
|
+
tn(!1), R(e);
|
|
23543
23562
|
},
|
|
23544
23563
|
requestedTaskId: kn,
|
|
23545
23564
|
onTaskRequestHandled: jn
|
|
@@ -23549,7 +23568,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23549
23568
|
onClose: () => On(!1),
|
|
23550
23569
|
onRefresh: bt,
|
|
23551
23570
|
onTarget: (e) => {
|
|
23552
|
-
e.kind === "work-plan-task" ? (An(e.taskId), On(!1), dn(!1), hn(!0)) : e.kind === "workspace-file" ? (tn(!1),
|
|
23571
|
+
e.kind === "work-plan-task" ? (An(e.taskId), On(!1), dn(!1), hn(!0)) : e.kind === "workspace-file" ? (tn(!1), R(e.path)) : e.kind === "workspace-diff" && (tn(!0), R(e.path));
|
|
23553
23572
|
}
|
|
23554
23573
|
}),
|
|
23555
23574
|
c.openFile && /* @__PURE__ */ W(ki, {
|
|
@@ -23567,7 +23586,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23567
23586
|
inRepository: gn(c.gitStatus?.repos ?? [], c.openFile.path) !== null,
|
|
23568
23587
|
onOpenGitHistory: ke,
|
|
23569
23588
|
onClose: qn,
|
|
23570
|
-
onReload:
|
|
23589
|
+
onReload: R,
|
|
23571
23590
|
onSave: de,
|
|
23572
23591
|
serverUrl: e,
|
|
23573
23592
|
token: d,
|
|
@@ -23645,7 +23664,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23645
23664
|
token: d,
|
|
23646
23665
|
workspace: Ct,
|
|
23647
23666
|
onOpenFile: (e) => {
|
|
23648
|
-
tn(!1),
|
|
23667
|
+
tn(!1), R(e);
|
|
23649
23668
|
}
|
|
23650
23669
|
}));
|
|
23651
23670
|
}),
|
|
@@ -23689,7 +23708,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23689
23708
|
isStreaming: c.isStreaming,
|
|
23690
23709
|
count: c.queue.length,
|
|
23691
23710
|
canSend: c.queue.every((e) => e.editable) && c.connected,
|
|
23692
|
-
onSend:
|
|
23711
|
+
onSend: re
|
|
23693
23712
|
}),
|
|
23694
23713
|
In.map((e, t) => /* @__PURE__ */ W("div", {
|
|
23695
23714
|
className: "rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-700 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-300",
|
|
@@ -23755,10 +23774,10 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23755
23774
|
className: "mx-auto max-w-3xl",
|
|
23756
23775
|
children: [Br && /* @__PURE__ */ W(or, {
|
|
23757
23776
|
request: Br,
|
|
23758
|
-
onRespond:
|
|
23777
|
+
onRespond: M
|
|
23759
23778
|
}, Br.id), Vr && /* @__PURE__ */ W(ur, {
|
|
23760
23779
|
request: Vr,
|
|
23761
|
-
onRespond:
|
|
23780
|
+
onRespond: N
|
|
23762
23781
|
}, Vr.id)]
|
|
23763
23782
|
}), /* @__PURE__ */ G("div", {
|
|
23764
23783
|
className: "mx-auto max-w-3xl",
|
|
@@ -23809,7 +23828,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23809
23828
|
isCompacting: c.isCompacting,
|
|
23810
23829
|
onSetModel: y,
|
|
23811
23830
|
onSetThinking: b,
|
|
23812
|
-
onCompact:
|
|
23831
|
+
onCompact: ae
|
|
23813
23832
|
})
|
|
23814
23833
|
]
|
|
23815
23834
|
})]
|
|
@@ -23819,7 +23838,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23819
23838
|
]
|
|
23820
23839
|
}), /* @__PURE__ */ W(mr, {
|
|
23821
23840
|
notifications: c.notifications,
|
|
23822
|
-
onDismiss:
|
|
23841
|
+
onDismiss: P
|
|
23823
23842
|
})]
|
|
23824
23843
|
})
|
|
23825
23844
|
})
|
|
@@ -23844,8 +23863,8 @@ function tg(e, t = {}) {
|
|
|
23844
23863
|
}
|
|
23845
23864
|
let r = document.createElement("div");
|
|
23846
23865
|
r.id = "root", n.appendChild(r);
|
|
23847
|
-
let i =
|
|
23848
|
-
return a.render(
|
|
23866
|
+
let i = M(), a = de(r);
|
|
23867
|
+
return a.render(se(Zh, {
|
|
23849
23868
|
ref: i,
|
|
23850
23869
|
serverUrl: t.serverUrl,
|
|
23851
23870
|
rootElement: e,
|