@pi-outpost/embed 0.60.0 → 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 +6 -6
- package/dist/pi-outpost-embed.js +482 -471
- 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 = () => {
|
|
@@ -6741,9 +6752,9 @@ function to({ preview: e, busy: t, error: n, onApply: r, onCancel: i }) {
|
|
|
6741
6752
|
});
|
|
6742
6753
|
}
|
|
6743
6754
|
function no(e) {
|
|
6744
|
-
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(() => {
|
|
6745
6756
|
let e = o.trim().toLocaleLowerCase();
|
|
6746
|
-
return
|
|
6757
|
+
return oe.flatMap((t) => {
|
|
6747
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;
|
|
6748
6759
|
if (o === 0 && !(n && c === "all") || u && (!("repository" in t) || ![
|
|
6749
6760
|
"updateable",
|
|
@@ -6761,14 +6772,14 @@ function no(e) {
|
|
|
6761
6772
|
}] : [];
|
|
6762
6773
|
});
|
|
6763
6774
|
}, [
|
|
6764
|
-
|
|
6775
|
+
oe,
|
|
6765
6776
|
u,
|
|
6766
6777
|
c,
|
|
6767
6778
|
o
|
|
6768
|
-
]),
|
|
6769
|
-
if (
|
|
6779
|
+
]), M = se.find((e) => e.id === i) ?? se[0] ?? null;
|
|
6780
|
+
if (L(() => {
|
|
6770
6781
|
n.current = e.onClose;
|
|
6771
|
-
}, [e.onClose]),
|
|
6782
|
+
}, [e.onClose]), L(() => {
|
|
6772
6783
|
A((t) => {
|
|
6773
6784
|
let n = {}, r = !1;
|
|
6774
6785
|
for (let [i, a] of Object.entries(t)) {
|
|
@@ -6777,49 +6788,49 @@ function no(e) {
|
|
|
6777
6788
|
}
|
|
6778
6789
|
return r ? n : t;
|
|
6779
6790
|
});
|
|
6780
|
-
}, [e.inventory]),
|
|
6791
|
+
}, [e.inventory]), L(() => {
|
|
6781
6792
|
e.open && t.current?.focus();
|
|
6782
|
-
}, [e.open]),
|
|
6793
|
+
}, [e.open]), L(() => {
|
|
6783
6794
|
if (!e.open) return;
|
|
6784
6795
|
let t = (e) => {
|
|
6785
6796
|
e.key === "Escape" && n.current();
|
|
6786
6797
|
};
|
|
6787
6798
|
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
6788
|
-
}, [e.open]),
|
|
6799
|
+
}, [e.open]), L(() => {
|
|
6789
6800
|
let t = e.operations.clonePath;
|
|
6790
6801
|
t?.status === "ready" && t.path && !E && T(t.path);
|
|
6791
|
-
}, [E, e.operations.clonePath]),
|
|
6802
|
+
}, [E, e.operations.clonePath]), L(() => {
|
|
6792
6803
|
e.operations.enrollment?.status === "ready" && p(null);
|
|
6793
|
-
}, [e.operations.enrollment]),
|
|
6804
|
+
}, [e.operations.enrollment]), L(() => {
|
|
6794
6805
|
e.applyState?.status === "applying" ? r.current = !0 : r.current && e.applyState === null && (r.current = !1, p(null), h(null), x(!1));
|
|
6795
6806
|
}, [e.applyState]), !e.open) return null;
|
|
6796
|
-
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 = () => {
|
|
6797
6808
|
let t = v.trim();
|
|
6798
6809
|
t && (g === "skill" ? e.onUpdateConfig({ userSkillPaths: [.../* @__PURE__ */ new Set([...e.userSkillPaths, t])] }) : e.onUpdateConfig({ userExtensionPaths: [.../* @__PURE__ */ new Set([...e.userExtensionPaths, t])] }));
|
|
6799
|
-
},
|
|
6810
|
+
}, R = (t) => {
|
|
6800
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) }));
|
|
6801
|
-
},
|
|
6812
|
+
}, z = (t, n = !1) => {
|
|
6802
6813
|
let r = t.assessment;
|
|
6803
6814
|
r.token && r.localRevision && r.upstreamRevision && e.onUpdate(t.id, r.token, r.localRevision, r.upstreamRevision, n);
|
|
6804
|
-
}, le =
|
|
6805
|
-
if (!
|
|
6806
|
-
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;
|
|
6807
6818
|
A((n) => {
|
|
6808
6819
|
let r = { ...n };
|
|
6809
6820
|
return qa(e, B) ? delete r[t] : r[t] = [...e], r;
|
|
6810
6821
|
});
|
|
6811
6822
|
}, he = () => {
|
|
6812
|
-
if (!
|
|
6813
|
-
let e =
|
|
6823
|
+
if (!N) return;
|
|
6824
|
+
let e = N.id;
|
|
6814
6825
|
A((t) => {
|
|
6815
6826
|
let n = { ...t };
|
|
6816
6827
|
return delete n[e], n;
|
|
6817
6828
|
});
|
|
6818
6829
|
}, ge = () => {
|
|
6819
|
-
if (!
|
|
6830
|
+
if (!N || !le) return;
|
|
6820
6831
|
let t = new Set(le.skills.filter((e) => e.state !== "on-missing").map((e) => e.relativePath));
|
|
6821
|
-
e.onSetSkills(
|
|
6822
|
-
}, _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";
|
|
6823
6834
|
return /* @__PURE__ */ G("div", {
|
|
6824
6835
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/45 p-4",
|
|
6825
6836
|
role: "presentation",
|
|
@@ -6892,10 +6903,10 @@ function no(e) {
|
|
|
6892
6903
|
}),
|
|
6893
6904
|
/* @__PURE__ */ G("div", {
|
|
6894
6905
|
className: "mt-3 min-h-0 flex-1 space-y-1 overflow-y-auto",
|
|
6895
|
-
children: [
|
|
6906
|
+
children: [se.map((e) => /* @__PURE__ */ G("button", {
|
|
6896
6907
|
type: "button",
|
|
6897
6908
|
onClick: () => a(e.id),
|
|
6898
|
-
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"}`,
|
|
6899
6910
|
children: [/* @__PURE__ */ G("span", {
|
|
6900
6911
|
className: "flex items-center justify-between gap-2 text-sm font-medium",
|
|
6901
6912
|
children: [/* @__PURE__ */ W("span", {
|
|
@@ -6909,7 +6920,7 @@ function no(e) {
|
|
|
6909
6920
|
className: "mt-1 block text-xs text-zinc-500",
|
|
6910
6921
|
children: "repository" in e ? Ya[e.repository.assessment.status] : e.reason
|
|
6911
6922
|
})]
|
|
6912
|
-
}, e.id)),
|
|
6923
|
+
}, e.id)), se.length === 0 ? /* @__PURE__ */ W("p", {
|
|
6913
6924
|
className: "px-2 py-4 text-xs text-zinc-500",
|
|
6914
6925
|
children: "No matching resources"
|
|
6915
6926
|
}) : null]
|
|
@@ -6933,15 +6944,15 @@ function no(e) {
|
|
|
6933
6944
|
]
|
|
6934
6945
|
}), /* @__PURE__ */ G("main", {
|
|
6935
6946
|
className: "min-w-0 overflow-y-auto p-6",
|
|
6936
|
-
children: [
|
|
6947
|
+
children: [ie && _e ? /* @__PURE__ */ G("div", {
|
|
6937
6948
|
role: ve ? "alert" : "status",
|
|
6938
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"}`,
|
|
6939
6950
|
children: [/* @__PURE__ */ W("p", {
|
|
6940
6951
|
className: "min-w-0 break-words",
|
|
6941
|
-
children: Ja(
|
|
6952
|
+
children: Ja(ie.name, _e)
|
|
6942
6953
|
}), _e.status === "loading" ? null : /* @__PURE__ */ W("button", {
|
|
6943
6954
|
type: "button",
|
|
6944
|
-
onClick: () =>
|
|
6955
|
+
onClick: () => ae(null),
|
|
6945
6956
|
className: "shrink-0 text-xs underline",
|
|
6946
6957
|
children: "Dismiss"
|
|
6947
6958
|
})]
|
|
@@ -7027,7 +7038,7 @@ function no(e) {
|
|
|
7027
7038
|
}), /* @__PURE__ */ W("button", {
|
|
7028
7039
|
type: "button",
|
|
7029
7040
|
disabled: !v.trim() || e.applyState?.status === "applying" || g === "extension" && (!b || e.extensionLock),
|
|
7030
|
-
onClick:
|
|
7041
|
+
onClick: ce,
|
|
7031
7042
|
className: "rounded-md bg-zinc-900 px-3 py-1.5 text-xs text-white disabled:opacity-50",
|
|
7032
7043
|
children: e.applyState?.status === "applying" ? "Applying…" : "Add folder"
|
|
7033
7044
|
})]
|
|
@@ -7137,7 +7148,7 @@ function no(e) {
|
|
|
7137
7148
|
})]
|
|
7138
7149
|
})
|
|
7139
7150
|
] })
|
|
7140
|
-
}) :
|
|
7151
|
+
}) : M ? /* @__PURE__ */ G(U, { children: [
|
|
7141
7152
|
/* @__PURE__ */ G("div", {
|
|
7142
7153
|
className: "flex items-start justify-between gap-4",
|
|
7143
7154
|
children: [/* @__PURE__ */ G("div", {
|
|
@@ -7147,74 +7158,74 @@ function no(e) {
|
|
|
7147
7158
|
className: "flex items-center gap-2",
|
|
7148
7159
|
children: [/* @__PURE__ */ W("h3", {
|
|
7149
7160
|
className: "text-xl font-semibold",
|
|
7150
|
-
children:
|
|
7151
|
-
}),
|
|
7161
|
+
children: M.name
|
|
7162
|
+
}), N ? /* @__PURE__ */ W("span", {
|
|
7152
7163
|
className: "rounded-full border px-2 py-0.5 text-[11px]",
|
|
7153
|
-
children: Ya[
|
|
7164
|
+
children: Ya[N.assessment.status]
|
|
7154
7165
|
}) : null]
|
|
7155
7166
|
}),
|
|
7156
7167
|
/* @__PURE__ */ W("p", {
|
|
7157
7168
|
className: "mt-1 truncate font-mono text-xs text-zinc-500",
|
|
7158
|
-
children: "repository" in
|
|
7169
|
+
children: "repository" in M ? M.path : M.reason
|
|
7159
7170
|
}),
|
|
7160
|
-
|
|
7171
|
+
F?.branch ? /* @__PURE__ */ G("p", {
|
|
7161
7172
|
className: "mt-1 text-xs text-zinc-400",
|
|
7162
|
-
children: [
|
|
7173
|
+
children: [F.branch, F.upstream ? ` → ${F.upstream}` : ""]
|
|
7163
7174
|
}) : null,
|
|
7164
|
-
|
|
7175
|
+
N?.removal && !N.removal.allowed ? /* @__PURE__ */ W("p", {
|
|
7165
7176
|
className: "mt-1 text-xs text-zinc-500",
|
|
7166
|
-
children:
|
|
7177
|
+
children: N.removal.reason
|
|
7167
7178
|
}) : null
|
|
7168
7179
|
]
|
|
7169
|
-
}),
|
|
7180
|
+
}), N ? /* @__PURE__ */ G("div", {
|
|
7170
7181
|
className: "flex gap-2",
|
|
7171
7182
|
children: [
|
|
7172
|
-
|
|
7183
|
+
N.removal?.allowed ? /* @__PURE__ */ W("button", {
|
|
7173
7184
|
type: "button",
|
|
7174
|
-
disabled: e.operations.removals?.[
|
|
7175
|
-
onClick: () =>
|
|
7185
|
+
disabled: e.operations.removals?.[N.id]?.status === "loading",
|
|
7186
|
+
onClick: () => re(N),
|
|
7176
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",
|
|
7177
7188
|
children: "Remove repository"
|
|
7178
7189
|
}) : null,
|
|
7179
7190
|
/* @__PURE__ */ W("button", {
|
|
7180
7191
|
type: "button",
|
|
7181
7192
|
disabled: e.operations.refresh?.status === "loading",
|
|
7182
|
-
onClick: () => e.onRefresh(
|
|
7193
|
+
onClick: () => e.onRefresh(N.id),
|
|
7183
7194
|
className: "rounded-md border px-3 py-1.5 text-xs",
|
|
7184
7195
|
children: "Check"
|
|
7185
7196
|
}),
|
|
7186
|
-
|
|
7197
|
+
I || P?.status === "loading" ? /* @__PURE__ */ W("button", {
|
|
7187
7198
|
type: "button",
|
|
7188
|
-
disabled:
|
|
7189
|
-
onClick: () =>
|
|
7199
|
+
disabled: P?.status === "loading",
|
|
7200
|
+
onClick: () => N.containsExtensions ? k(N) : z(N),
|
|
7190
7201
|
className: "rounded-md bg-zinc-900 px-3 py-1.5 text-xs text-white disabled:opacity-50",
|
|
7191
|
-
children:
|
|
7202
|
+
children: P?.status === "loading" ? "Updating…" : "Update repository"
|
|
7192
7203
|
}) : null
|
|
7193
7204
|
]
|
|
7194
7205
|
}) : null]
|
|
7195
7206
|
}),
|
|
7196
|
-
|
|
7197
|
-
className: `mt-5 rounded-lg border p-3 text-sm ${
|
|
7198
|
-
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", {
|
|
7199
7210
|
className: "mt-1 text-xs",
|
|
7200
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."
|
|
7201
7212
|
}) : null]
|
|
7202
7213
|
}) : null,
|
|
7203
|
-
|
|
7214
|
+
F?.hasSubmodules ? /* @__PURE__ */ W("p", {
|
|
7204
7215
|
className: "mt-3 rounded border border-amber-200 bg-amber-50 p-2 text-xs text-amber-800",
|
|
7205
7216
|
children: "This repository declares submodules. Their working trees will not be initialized or updated."
|
|
7206
7217
|
}) : null,
|
|
7207
|
-
|
|
7218
|
+
P?.status === "ready" ? /* @__PURE__ */ W("p", {
|
|
7208
7219
|
role: "status",
|
|
7209
7220
|
className: "mt-3 text-xs text-zinc-600",
|
|
7210
|
-
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
|
|
7211
7222
|
}) : null,
|
|
7212
|
-
|
|
7223
|
+
P?.status === "error" ? /* @__PURE__ */ W("p", {
|
|
7213
7224
|
role: "alert",
|
|
7214
7225
|
className: "mt-3 text-xs text-red-600",
|
|
7215
|
-
children:
|
|
7226
|
+
children: P.message
|
|
7216
7227
|
}) : null,
|
|
7217
|
-
le &&
|
|
7228
|
+
le && N && c !== "extension" ? /* @__PURE__ */ G("div", {
|
|
7218
7229
|
className: "mt-6 space-y-4",
|
|
7219
7230
|
children: [
|
|
7220
7231
|
fe > 0 || pe?.status === "loading" ? /* @__PURE__ */ G("div", {
|
|
@@ -7248,25 +7259,25 @@ function no(e) {
|
|
|
7248
7259
|
onChange: me,
|
|
7249
7260
|
disabled: pe?.status === "loading",
|
|
7250
7261
|
...le.bound ? { bound: le.bound } : {}
|
|
7251
|
-
},
|
|
7252
|
-
|
|
7262
|
+
}, N.id),
|
|
7263
|
+
M.resources.some((e) => e.kind === "extension") ? /* @__PURE__ */ W(eo, {
|
|
7253
7264
|
kind: "extension",
|
|
7254
|
-
resources:
|
|
7265
|
+
resources: M.resources.filter((e) => e.kind === "extension"),
|
|
7255
7266
|
removalLocked: e.extensionLock,
|
|
7256
|
-
onRemove:
|
|
7267
|
+
onRemove: R
|
|
7257
7268
|
}) : null
|
|
7258
7269
|
]
|
|
7259
7270
|
}) : /* @__PURE__ */ G("div", {
|
|
7260
7271
|
className: "mt-6 grid grid-cols-2 gap-4",
|
|
7261
7272
|
children: [/* @__PURE__ */ W(eo, {
|
|
7262
7273
|
kind: "skill",
|
|
7263
|
-
resources:
|
|
7264
|
-
onRemove:
|
|
7274
|
+
resources: M.resources.filter((e) => e.kind === "skill"),
|
|
7275
|
+
onRemove: R
|
|
7265
7276
|
}), /* @__PURE__ */ W(eo, {
|
|
7266
7277
|
kind: "extension",
|
|
7267
|
-
resources:
|
|
7278
|
+
resources: M.resources.filter((e) => e.kind === "extension"),
|
|
7268
7279
|
removalLocked: e.extensionLock,
|
|
7269
|
-
onRemove:
|
|
7280
|
+
onRemove: R
|
|
7270
7281
|
})]
|
|
7271
7282
|
})
|
|
7272
7283
|
] }) : /* @__PURE__ */ W("p", {
|
|
@@ -7310,7 +7321,7 @@ function no(e) {
|
|
|
7310
7321
|
}), /* @__PURE__ */ W("button", {
|
|
7311
7322
|
type: "button",
|
|
7312
7323
|
onClick: () => {
|
|
7313
|
-
|
|
7324
|
+
z(te, !0), k(null);
|
|
7314
7325
|
},
|
|
7315
7326
|
className: "rounded bg-amber-600 px-3 py-1.5 text-xs font-medium text-white",
|
|
7316
7327
|
children: "Confirm executable update"
|
|
@@ -7364,16 +7375,16 @@ function no(e) {
|
|
|
7364
7375
|
className: "mt-4 flex justify-end gap-2",
|
|
7365
7376
|
children: [/* @__PURE__ */ W("button", {
|
|
7366
7377
|
type: "button",
|
|
7367
|
-
onClick: () =>
|
|
7378
|
+
onClick: () => re(null),
|
|
7368
7379
|
className: "rounded border px-3 py-1.5 text-xs",
|
|
7369
7380
|
children: "Cancel"
|
|
7370
7381
|
}), /* @__PURE__ */ W("button", {
|
|
7371
7382
|
type: "button",
|
|
7372
7383
|
onClick: () => {
|
|
7373
|
-
e.onRemoveRepository(j.id),
|
|
7384
|
+
e.onRemoveRepository(j.id), ae({
|
|
7374
7385
|
id: j.id,
|
|
7375
7386
|
name: j.name
|
|
7376
|
-
}),
|
|
7387
|
+
}), re(null);
|
|
7377
7388
|
},
|
|
7378
7389
|
className: "rounded bg-red-600 px-3 py-1.5 text-xs font-medium text-white",
|
|
7379
7390
|
children: j.removal?.deletesFiles ? "Delete and remove" : "Remove repository"
|
|
@@ -7565,39 +7576,39 @@ function fo({ credentials: e, login: t, onStartLogin: n, onAnswerLogin: r, onCan
|
|
|
7565
7576
|
updates: {},
|
|
7566
7577
|
skills: {},
|
|
7567
7578
|
removals: {}
|
|
7568
|
-
}, versions: A, onBrowseServerPath: j, onCloseServerBrowser:
|
|
7569
|
-
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) => {
|
|
7570
7581
|
if (t && !t.done) {
|
|
7571
7582
|
i?.(), a?.();
|
|
7572
7583
|
let e = le.current.get(t.provider);
|
|
7573
7584
|
e && (e.open = !1);
|
|
7574
7585
|
} else n?.(e, r);
|
|
7575
7586
|
};
|
|
7576
|
-
|
|
7587
|
+
L(() => {
|
|
7577
7588
|
ee && ye !== null && be(null);
|
|
7578
7589
|
}, [ee, ye]);
|
|
7579
7590
|
let Se = Un(() => {
|
|
7580
|
-
(
|
|
7591
|
+
(I || ye !== null) && Ae();
|
|
7581
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;
|
|
7582
|
-
|
|
7593
|
+
L(() => {
|
|
7583
7594
|
C && (pe(C.root), he(C.writableRoot ?? ""), _e(C.allowWrite), K(C.allowBash));
|
|
7584
7595
|
}, [C]);
|
|
7585
7596
|
let ke = V(!1);
|
|
7586
|
-
|
|
7597
|
+
L(() => {
|
|
7587
7598
|
ke.current && te === null && Ae(), ke.current = De;
|
|
7588
7599
|
}, [te, De]);
|
|
7589
7600
|
function Ae() {
|
|
7590
|
-
|
|
7601
|
+
z(!1), ce(!1), be(null), re();
|
|
7591
7602
|
}
|
|
7592
7603
|
function je(e, t) {
|
|
7593
7604
|
O?.(), be(e), j(t.trim() || "/");
|
|
7594
7605
|
}
|
|
7595
7606
|
function Me(e) {
|
|
7596
|
-
ye === "root" ? pe(e) : ye === "writableRoot" && he(e), be(null),
|
|
7607
|
+
ye === "root" ? pe(e) : ye === "writableRoot" && he(e), be(null), re();
|
|
7597
7608
|
}
|
|
7598
7609
|
let Ne = C !== null && (fe !== C.root || (me.trim() || void 0) !== (C.writableRoot || void 0) || ge !== C.allowWrite || ve !== C.allowBash);
|
|
7599
7610
|
function Pe() {
|
|
7600
|
-
C && Ne &&
|
|
7611
|
+
C && Ne && ie({ sandbox: {
|
|
7601
7612
|
root: fe,
|
|
7602
7613
|
allowWrite: ge,
|
|
7603
7614
|
allowBash: ve,
|
|
@@ -7610,7 +7621,7 @@ function fo({ credentials: e, login: t, onStartLogin: n, onAnswerLogin: r, onCan
|
|
|
7610
7621
|
onBrowse: j,
|
|
7611
7622
|
onSelect: Me,
|
|
7612
7623
|
onCancel: () => {
|
|
7613
|
-
be(null),
|
|
7624
|
+
be(null), re();
|
|
7614
7625
|
}
|
|
7615
7626
|
});
|
|
7616
7627
|
return /* @__PURE__ */ G("div", {
|
|
@@ -7621,29 +7632,29 @@ function fo({ credentials: e, login: t, onStartLogin: n, onAnswerLogin: r, onCan
|
|
|
7621
7632
|
ref: de,
|
|
7622
7633
|
type: "button",
|
|
7623
7634
|
onClick: () => {
|
|
7624
|
-
|
|
7635
|
+
z(!1), I ? Ae() : ce(!0);
|
|
7625
7636
|
},
|
|
7626
7637
|
title: "Settings",
|
|
7627
7638
|
"aria-label": "Settings",
|
|
7628
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`,
|
|
7629
7640
|
children: "⚙"
|
|
7630
7641
|
}),
|
|
7631
|
-
|
|
7642
|
+
I && /* @__PURE__ */ G("div", {
|
|
7632
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",
|
|
7633
7644
|
children: [/* @__PURE__ */ G("div", {
|
|
7634
7645
|
className: "border-b border-zinc-200 px-4 py-3 dark:border-zinc-800",
|
|
7635
|
-
children: [
|
|
7646
|
+
children: [R && /* @__PURE__ */ W("button", {
|
|
7636
7647
|
type: "button",
|
|
7637
|
-
onClick: () =>
|
|
7648
|
+
onClick: () => z(!1),
|
|
7638
7649
|
className: "mb-2 text-xs text-zinc-600 hover:underline dark:text-zinc-400",
|
|
7639
7650
|
children: "← Back to settings"
|
|
7640
7651
|
}), /* @__PURE__ */ W("h2", {
|
|
7641
7652
|
className: "text-sm font-semibold text-zinc-800 dark:text-zinc-200",
|
|
7642
|
-
children:
|
|
7653
|
+
children: R ? "Credits" : "Settings"
|
|
7643
7654
|
})]
|
|
7644
7655
|
}), /* @__PURE__ */ W("div", {
|
|
7645
7656
|
className: "min-h-0 overflow-y-auto p-4",
|
|
7646
|
-
children:
|
|
7657
|
+
children: R ? /* @__PURE__ */ W(Da, {}) : /* @__PURE__ */ G(U, { children: [
|
|
7647
7658
|
T && /* @__PURE__ */ G("section", {
|
|
7648
7659
|
className: "mb-4",
|
|
7649
7660
|
"data-testid": "git-unavailable",
|
|
@@ -7805,7 +7816,7 @@ function fo({ credentials: e, login: t, onStartLogin: n, onAnswerLogin: r, onCan
|
|
|
7805
7816
|
type: "button",
|
|
7806
7817
|
"aria-label": "Manage agent resources",
|
|
7807
7818
|
onClick: () => {
|
|
7808
|
-
|
|
7819
|
+
ce(!1), B(!0);
|
|
7809
7820
|
},
|
|
7810
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",
|
|
7811
7822
|
children: "Manage agent resources"
|
|
@@ -8048,7 +8059,7 @@ function fo({ credentials: e, login: t, onStartLogin: n, onAnswerLogin: r, onCan
|
|
|
8048
8059
|
}),
|
|
8049
8060
|
/* @__PURE__ */ W("button", {
|
|
8050
8061
|
type: "button",
|
|
8051
|
-
onClick: () =>
|
|
8062
|
+
onClick: () => z(!0),
|
|
8052
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",
|
|
8053
8064
|
children: "Credits →"
|
|
8054
8065
|
})
|
|
@@ -8065,20 +8076,20 @@ function fo({ credentials: e, login: t, onStartLogin: n, onAnswerLogin: r, onCan
|
|
|
8065
8076
|
serverBrowse: D,
|
|
8066
8077
|
applyState: te,
|
|
8067
8078
|
onClose: () => {
|
|
8068
|
-
B(!1),
|
|
8079
|
+
B(!1), re(), de.current?.focus();
|
|
8069
8080
|
},
|
|
8070
8081
|
onBrowseServerPath: (e) => {
|
|
8071
8082
|
O?.(), j(e);
|
|
8072
8083
|
},
|
|
8073
|
-
onCloseServerBrowser:
|
|
8074
|
-
onUpdateConfig:
|
|
8075
|
-
onSuggestClonePath:
|
|
8076
|
-
onCloneRepository:
|
|
8077
|
-
onEnrollRepository:
|
|
8078
|
-
onSetSkills:
|
|
8079
|
-
onRemoveRepository:
|
|
8080
|
-
onRefresh:
|
|
8081
|
-
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
|
|
8082
8093
|
})
|
|
8083
8094
|
]
|
|
8084
8095
|
});
|
|
@@ -8203,7 +8214,7 @@ function _o({ row: e, laneCount: t, isStreaming: n, onNavigate: r, onFork: i, on
|
|
|
8203
8214
|
}
|
|
8204
8215
|
function vo({ tree: e, isStreaming: t, onListTree: n, onNavigate: r, onFork: i }) {
|
|
8205
8216
|
let [a, o] = H(!1), [s, c] = H(""), l = Un(() => o(!1));
|
|
8206
|
-
|
|
8217
|
+
L(() => {
|
|
8207
8218
|
a && e === null && n();
|
|
8208
8219
|
}, [a, e]);
|
|
8209
8220
|
let u = ue(() => e && e.length > 0 ? po(e) : null, [e]), d = ue(() => {
|
|
@@ -8416,7 +8427,7 @@ function xo({ session: e, isCurrent: t, renaming: n, onSwitch: r, onDelete: i, o
|
|
|
8416
8427
|
}
|
|
8417
8428
|
function So({ sessions: e, sessionSearch: t, sessionId: n, onSwitchSession: r, onDeleteSession: i, onListSessions: a, onRenameSession: o, onSearchSessions: s, onClearSessionSearch: c }) {
|
|
8418
8429
|
let [l, u] = H(!1), [d, f] = H(""), [p, m] = H(null), h = Un(() => u(!1)), g = d.trim(), _ = g.length >= 2;
|
|
8419
|
-
|
|
8430
|
+
L(() => {
|
|
8420
8431
|
if (!l) return;
|
|
8421
8432
|
if (!_) {
|
|
8422
8433
|
c();
|
|
@@ -8586,7 +8597,7 @@ function wo({ statuses: e, bar: t }) {
|
|
|
8586
8597
|
}
|
|
8587
8598
|
function To({ theme: e, preference: t = e, onToggle: n, onSetTheme: r }) {
|
|
8588
8599
|
let [i, a] = H(!1), o = V(null), s = Un(() => a(!1));
|
|
8589
|
-
|
|
8600
|
+
L(() => {
|
|
8590
8601
|
i && s.current?.querySelector("[aria-checked=\"true\"]")?.focus();
|
|
8591
8602
|
}, [i]);
|
|
8592
8603
|
let c = {
|
|
@@ -8814,7 +8825,7 @@ function Eo(e) {
|
|
|
8814
8825
|
//#region ../ui/src/useWorkspaceNotifications.ts
|
|
8815
8826
|
function Do(e, t) {
|
|
8816
8827
|
let n = V(/* @__PURE__ */ new Map());
|
|
8817
|
-
|
|
8828
|
+
L(() => {
|
|
8818
8829
|
if (typeof Notification > "u") return;
|
|
8819
8830
|
let r = e.filter((e) => e.needsAttention), i = r.filter((e) => Dt(e) !== t);
|
|
8820
8831
|
for (let e of [...n.current.keys()]) r.some((t) => Dt(t) === e) || n.current.delete(e);
|
|
@@ -9001,7 +9012,7 @@ function Io({ usage: e }) {
|
|
|
9001
9012
|
}
|
|
9002
9013
|
function Lo({ thinkingLevel: e, thinkingLevels: t, isStreaming: n, onSetThinking: r }) {
|
|
9003
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;
|
|
9004
|
-
return
|
|
9015
|
+
return L(() => {
|
|
9005
9016
|
if (!i) return;
|
|
9006
9017
|
function e(e) {
|
|
9007
9018
|
o.current && !Hn(e, o.current) && a(!1);
|
|
@@ -9341,7 +9352,7 @@ function Vo({ title: e, credentials: t, onSetCredential: n, onStartLogin: r, log
|
|
|
9341
9352
|
//#region ../ui/src/components/ContentSearchPanel.tsx
|
|
9342
9353
|
function Ho({ query: e, onQueryChange: t, search: n, onSearch: r, onOpenHit: i, onClose: a }) {
|
|
9343
9354
|
let o = V(null);
|
|
9344
|
-
|
|
9355
|
+
L(() => {
|
|
9345
9356
|
o.current?.focus();
|
|
9346
9357
|
}, []);
|
|
9347
9358
|
let s = Wo(n?.hits ?? []);
|
|
@@ -9479,7 +9490,7 @@ function Qo(e, t) {
|
|
|
9479
9490
|
}
|
|
9480
9491
|
function $o({ dir: e, depth: t, creation: n }) {
|
|
9481
9492
|
let [r, i] = H(""), a = V(null), o = n.localError ?? n.serverError;
|
|
9482
|
-
return
|
|
9493
|
+
return L(() => {
|
|
9483
9494
|
a.current?.focus();
|
|
9484
9495
|
}, []), /* @__PURE__ */ G("div", {
|
|
9485
9496
|
style: { paddingLeft: t * 12 + 4 },
|
|
@@ -9506,7 +9517,7 @@ function $o({ dir: e, depth: t, creation: n }) {
|
|
|
9506
9517
|
}
|
|
9507
9518
|
function es({ path: e, name: t, depth: n, rename: r }) {
|
|
9508
9519
|
let [i, a] = H(t), o = V(null), s = r.localError ?? r.serverError;
|
|
9509
|
-
return
|
|
9520
|
+
return L(() => {
|
|
9510
9521
|
o.current?.focus(), o.current?.select();
|
|
9511
9522
|
}, []), /* @__PURE__ */ G("div", {
|
|
9512
9523
|
style: { paddingLeft: n * 12 + 16 },
|
|
@@ -9760,11 +9771,11 @@ function as(e) {
|
|
|
9760
9771
|
})();
|
|
9761
9772
|
}
|
|
9762
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;
|
|
9763
|
-
|
|
9774
|
+
L(() => {
|
|
9764
9775
|
h !== null && T !== null && T === os(h.dir, h.name) && (f(null), g(null), m(null));
|
|
9765
9776
|
}, [h, T]);
|
|
9766
9777
|
let E = e.fileOperation?.status === "error" && e.fileOperation.operation === "rename_file" && x === e.fileOperation.path ? e.fileOperation.message : null;
|
|
9767
|
-
|
|
9778
|
+
L(() => {
|
|
9768
9779
|
let t = e.fileOperation;
|
|
9769
9780
|
t?.status === "succeeded" && t.operation === "rename_file" && x === t.path && (v(null), S(null), b(null));
|
|
9770
9781
|
}, [x, e.fileOperation]);
|
|
@@ -9884,7 +9895,7 @@ function os(e, t) {
|
|
|
9884
9895
|
//#region ../ui/src/components/Sidebar.tsx
|
|
9885
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 }) {
|
|
9886
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");
|
|
9887
|
-
return
|
|
9898
|
+
return L(() => {
|
|
9888
9899
|
t[""] === void 0 && o("");
|
|
9889
9900
|
}, []), /* @__PURE__ */ G("aside", {
|
|
9890
9901
|
"aria-label": "Files",
|
|
@@ -10070,16 +10081,16 @@ function ds(e) {
|
|
|
10070
10081
|
return t === null || t === "" || /^(?:[\\/]|[a-z]:[\\/])/i.test(t) || t.replaceAll("\\", "/").split("/").includes("..") ? null : t;
|
|
10071
10082
|
}
|
|
10072
10083
|
function fs({ plan: e, open: t, onToggle: n, onOpenWorkspace: r, requestedTaskId: i, onTaskRequestHandled: a }) {
|
|
10073
|
-
let o =
|
|
10074
|
-
|
|
10084
|
+
let o = R(), [s, c] = H(!1), [l, u] = H(null), [d, f] = H(null);
|
|
10085
|
+
L(() => {
|
|
10075
10086
|
i && (e.tasks.some((e) => e.id === i) ? (u(i), f(null)) : (u(null), f(i)), a?.());
|
|
10076
10087
|
}, [
|
|
10077
10088
|
e.tasks,
|
|
10078
10089
|
i,
|
|
10079
10090
|
a
|
|
10080
|
-
]),
|
|
10091
|
+
]), L(() => {
|
|
10081
10092
|
l !== null && !e.tasks.some((e) => e.id === l) && u(null);
|
|
10082
|
-
}, [e, l]),
|
|
10093
|
+
}, [e, l]), L(() => {
|
|
10083
10094
|
if (!s) return;
|
|
10084
10095
|
let e = (e) => {
|
|
10085
10096
|
e.key === "Escape" && c(!1);
|
|
@@ -13970,17 +13981,17 @@ var zd = class {
|
|
|
13970
13981
|
for (v = r[0] + 1; v < r[1]; v++) k &&= i === this._isCellInSelection(v, t);
|
|
13971
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];
|
|
13972
13983
|
}
|
|
13973
|
-
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;
|
|
13974
13985
|
this._decorationService.forEachDecorationAtCell(O, t, void 0, (e) => {
|
|
13975
|
-
|
|
13986
|
+
ae = !0;
|
|
13976
13987
|
});
|
|
13977
|
-
let
|
|
13978
|
-
if (
|
|
13979
|
-
else if (g && (j && w || !j && !w && A.bg === y) && (j && w && p.selectionForeground || A.fg === b) && A.extended.ext === x &&
|
|
13980
|
-
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++;
|
|
13981
13992
|
continue;
|
|
13982
13993
|
} else g && (h.textContent = _), h = this._document.createElement("span"), g = 0, _ = "";
|
|
13983
|
-
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) {
|
|
13984
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");
|
|
13985
13996
|
else if (i) switch (i) {
|
|
13986
13997
|
case "outline":
|
|
@@ -14002,41 +14013,41 @@ var zd = class {
|
|
|
14002
14013
|
this._optionsService.rawOptions.drawBoldTextInBrightColors && A.isBold() && e < 8 && (e += 8), h.style.textDecorationColor = p.ansi[e].css;
|
|
14003
14014
|
}
|
|
14004
14015
|
}
|
|
14005
|
-
A.isOverline() && (D.push("xterm-overline"), _ === " " && (_ = "\xA0")), A.isStrikethrough() && D.push("xterm-strikethrough"),
|
|
14006
|
-
let
|
|
14007
|
-
if (
|
|
14008
|
-
let e =
|
|
14009
|
-
|
|
14010
|
-
let t =
|
|
14011
|
-
|
|
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;
|
|
14012
14023
|
}
|
|
14013
|
-
let
|
|
14024
|
+
let I, ce, L = !1;
|
|
14014
14025
|
this._decorationService.forEachDecorationAtCell(O, t, void 0, (e) => {
|
|
14015
|
-
e.options.layer !== "top" &&
|
|
14016
|
-
}), !
|
|
14017
|
-
let
|
|
14018
|
-
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) {
|
|
14019
14030
|
case 16777216:
|
|
14020
14031
|
case 33554432:
|
|
14021
|
-
|
|
14032
|
+
R = p.ansi[N], D.push(`xterm-bg-${N}`);
|
|
14022
14033
|
break;
|
|
14023
14034
|
case 50331648:
|
|
14024
|
-
|
|
14035
|
+
R = Td.toColor(N >> 16, N >> 8 & 255, N & 255), this._addStyle(h, `background-color:#${Bd((N >>> 0).toString(16), "0", 6)}`);
|
|
14025
14036
|
break;
|
|
14026
|
-
default:
|
|
14037
|
+
default: F ? (R = p.foreground, D.push("xterm-bg-257")) : R = p.background;
|
|
14027
14038
|
}
|
|
14028
|
-
switch (
|
|
14039
|
+
switch (I || A.isDim() && (I = Ed.multiplyOpacity(R, .5)), M) {
|
|
14029
14040
|
case 16777216:
|
|
14030
14041
|
case 33554432:
|
|
14031
|
-
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}`);
|
|
14032
14043
|
break;
|
|
14033
14044
|
case 50331648:
|
|
14034
|
-
let e = Td.toColor(
|
|
14035
|
-
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)}`);
|
|
14036
14047
|
break;
|
|
14037
|
-
default: this._applyMinimumContrast(h,
|
|
14048
|
+
default: this._applyMinimumContrast(h, R, p.foreground, A, I, ce) || F && D.push("xterm-fg-257");
|
|
14038
14049
|
}
|
|
14039
|
-
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;
|
|
14040
14051
|
}
|
|
14041
14052
|
return h && g && (h.textContent = _), d;
|
|
14042
14053
|
}
|
|
@@ -19663,7 +19674,7 @@ function bh(e) {
|
|
|
19663
19674
|
return t.length <= 3 ? e : "…/" + t.slice(-3).join("/");
|
|
19664
19675
|
}
|
|
19665
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 }) {
|
|
19666
|
-
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({
|
|
19667
19678
|
cwd: n,
|
|
19668
19679
|
openTerminal: o,
|
|
19669
19680
|
sendTerminalInput: s,
|
|
@@ -19684,9 +19695,9 @@ function xh({ id: e, shellId: t, cwd: n, isActive: r, isPanelOpen: i, renaming:
|
|
|
19684
19695
|
subscribeTerminal: f,
|
|
19685
19696
|
onCwdUpdate: p,
|
|
19686
19697
|
registerClear: m
|
|
19687
|
-
},
|
|
19698
|
+
}, L(() => {
|
|
19688
19699
|
g.current && (g.current.options.theme = v ? vh : yh);
|
|
19689
|
-
}, [v]),
|
|
19700
|
+
}, [v]), L(() => {
|
|
19690
19701
|
if (!h.current) return;
|
|
19691
19702
|
let n = new sh({
|
|
19692
19703
|
cursorBlink: !0,
|
|
@@ -19732,7 +19743,7 @@ function xh({ id: e, shellId: t, cwd: n, isActive: r, isPanelOpen: i, renaming:
|
|
|
19732
19743
|
return l.observe(h.current), () => {
|
|
19733
19744
|
s.dispose(), c(), l.disconnect(), n.dispose(), y.current.closeTerminal?.(e);
|
|
19734
19745
|
};
|
|
19735
|
-
}, [e]),
|
|
19746
|
+
}, [e]), L(() => {
|
|
19736
19747
|
if (!a && i && r && _.current && g.current && h.current) {
|
|
19737
19748
|
y.current.getTerminalCwd?.(e);
|
|
19738
19749
|
let t = setTimeout(() => {
|
|
@@ -19754,27 +19765,27 @@ function xh({ id: e, shellId: t, cwd: n, isActive: r, isPanelOpen: i, renaming:
|
|
|
19754
19765
|
}
|
|
19755
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 }) {
|
|
19756
19767
|
let [m, h] = H(""), g = e?.some((e) => e.id === m) ? m : "", [_, v] = H(t);
|
|
19757
|
-
|
|
19768
|
+
L(() => {
|
|
19758
19769
|
t && v(!0);
|
|
19759
19770
|
}, [t]);
|
|
19760
19771
|
let [y, b] = H([{
|
|
19761
19772
|
id: "term-1",
|
|
19762
19773
|
title: "terminal 1"
|
|
19763
|
-
}]), [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) => {
|
|
19764
19775
|
j.current.set(e, t);
|
|
19765
|
-
}, []),
|
|
19776
|
+
}, []), ie = I((e, t) => {
|
|
19766
19777
|
ee((n) => ({
|
|
19767
19778
|
...n,
|
|
19768
19779
|
[e]: t
|
|
19769
19780
|
}));
|
|
19770
|
-
}, []),
|
|
19781
|
+
}, []), ae = I(() => {
|
|
19771
19782
|
let e = y.length + 1, t = `term-${crypto.randomUUID()}`, n = {
|
|
19772
19783
|
id: t,
|
|
19773
19784
|
title: `terminal ${e}`,
|
|
19774
19785
|
...g ? { shellId: g } : {}
|
|
19775
19786
|
};
|
|
19776
19787
|
b((e) => [...e, n]), S(t);
|
|
19777
|
-
}, [y.length, g]),
|
|
19788
|
+
}, [y.length, g]), oe = I((e, t) => {
|
|
19778
19789
|
t.stopPropagation(), y.length <= 1 ? n() : (b((t) => {
|
|
19779
19790
|
let n = t.filter((t) => t.id !== e);
|
|
19780
19791
|
if (x === e) {
|
|
@@ -19790,9 +19801,9 @@ function Sh({ shells: e, open: t, onClose: n, cwd: r, confinedRoot: i, confineme
|
|
|
19790
19801
|
y.length,
|
|
19791
19802
|
x,
|
|
19792
19803
|
n
|
|
19793
|
-
]),
|
|
19804
|
+
]), se = (e, t) => {
|
|
19794
19805
|
t.stopPropagation(), w(e.id), E(e.title);
|
|
19795
|
-
},
|
|
19806
|
+
}, M = () => {
|
|
19796
19807
|
if (C) {
|
|
19797
19808
|
let e = T.trim();
|
|
19798
19809
|
e && b((t) => t.map((t) => t.id === C ? {
|
|
@@ -19800,12 +19811,12 @@ function Sh({ shells: e, open: t, onClose: n, cwd: r, confinedRoot: i, confineme
|
|
|
19800
19811
|
title: e
|
|
19801
19812
|
} : t)), w(null);
|
|
19802
19813
|
}
|
|
19803
|
-
},
|
|
19804
|
-
e.key === "Enter" ?
|
|
19805
|
-
},
|
|
19814
|
+
}, N = (e) => {
|
|
19815
|
+
e.key === "Enter" ? M() : e.key === "Escape" && w(null);
|
|
19816
|
+
}, P = I(() => {
|
|
19806
19817
|
let e = j.current.get(x);
|
|
19807
19818
|
e && e();
|
|
19808
|
-
}, [x]),
|
|
19819
|
+
}, [x]), F = D[x] || r || "";
|
|
19809
19820
|
return _ ? /* @__PURE__ */ G("div", {
|
|
19810
19821
|
style: {
|
|
19811
19822
|
height: O ? "85vh" : k.width,
|
|
@@ -19832,7 +19843,7 @@ function Sh({ shells: e, open: t, onClose: n, cwd: r, confinedRoot: i, confineme
|
|
|
19832
19843
|
let t = e.id === x, n = e.id === C;
|
|
19833
19844
|
return /* @__PURE__ */ G("div", {
|
|
19834
19845
|
onClick: () => S(e.id),
|
|
19835
|
-
onDoubleClick: (t) =>
|
|
19846
|
+
onDoubleClick: (t) => se(e, t),
|
|
19836
19847
|
title: "Double-click to rename tab",
|
|
19837
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"}`,
|
|
19838
19849
|
children: [n ? /* @__PURE__ */ W("input", {
|
|
@@ -19841,11 +19852,11 @@ function Sh({ shells: e, open: t, onClose: n, cwd: r, confinedRoot: i, confineme
|
|
|
19841
19852
|
value: T,
|
|
19842
19853
|
autoFocus: !0,
|
|
19843
19854
|
onChange: (e) => E(e.target.value),
|
|
19844
|
-
onBlur:
|
|
19845
|
-
onKeyDown:
|
|
19855
|
+
onBlur: M,
|
|
19856
|
+
onKeyDown: N,
|
|
19846
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"
|
|
19847
19858
|
}) : /* @__PURE__ */ W("span", { children: e.title }), y.length > 1 && /* @__PURE__ */ W("span", {
|
|
19848
|
-
onClick: (t) =>
|
|
19859
|
+
onClick: (t) => oe(e.id, t),
|
|
19849
19860
|
role: "button",
|
|
19850
19861
|
tabIndex: 0,
|
|
19851
19862
|
"aria-label": "Close terminal tab",
|
|
@@ -19881,7 +19892,7 @@ function Sh({ shells: e, open: t, onClose: n, cwd: r, confinedRoot: i, confineme
|
|
|
19881
19892
|
}, e.id))]
|
|
19882
19893
|
}),
|
|
19883
19894
|
/* @__PURE__ */ W("button", {
|
|
19884
|
-
onClick:
|
|
19895
|
+
onClick: ae,
|
|
19885
19896
|
type: "button",
|
|
19886
19897
|
title: "New Terminal Tab",
|
|
19887
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",
|
|
@@ -19908,26 +19919,26 @@ function Sh({ shells: e, open: t, onClose: n, cwd: r, confinedRoot: i, confineme
|
|
|
19908
19919
|
surface: "terminal",
|
|
19909
19920
|
root: bh(i)
|
|
19910
19921
|
}),
|
|
19911
|
-
|
|
19922
|
+
F && /* @__PURE__ */ W("div", {
|
|
19912
19923
|
className: "hidden md:flex items-center space-x-1.5 px-2 text-xs font-mono text-zinc-500 dark:text-zinc-400",
|
|
19913
19924
|
children: s && /* @__PURE__ */ W("button", {
|
|
19914
19925
|
onClick: () => {
|
|
19915
|
-
if (
|
|
19916
|
-
if ((
|
|
19917
|
-
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);
|
|
19918
19929
|
}
|
|
19919
19930
|
},
|
|
19920
19931
|
type: "button",
|
|
19921
|
-
title: `Open "${
|
|
19932
|
+
title: `Open "${F}" as the workspace project and reposition the LLM agent`,
|
|
19922
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"}`,
|
|
19923
|
-
children: /* @__PURE__ */ W("span", { children: ne ? "✓ Project opened" : `📁 ${bh(
|
|
19934
|
+
children: /* @__PURE__ */ W("span", { children: ne ? "✓ Project opened" : `📁 ${bh(F)} → open as project` })
|
|
19924
19935
|
})
|
|
19925
19936
|
}),
|
|
19926
19937
|
/* @__PURE__ */ G("div", {
|
|
19927
19938
|
className: "flex items-center space-x-1 text-zinc-500 dark:text-zinc-400",
|
|
19928
19939
|
children: [
|
|
19929
19940
|
/* @__PURE__ */ W("button", {
|
|
19930
|
-
onClick:
|
|
19941
|
+
onClick: P,
|
|
19931
19942
|
type: "button",
|
|
19932
19943
|
title: "Clear Terminal Output",
|
|
19933
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",
|
|
@@ -20021,8 +20032,8 @@ function Sh({ shells: e, open: t, onClose: n, cwd: r, confinedRoot: i, confineme
|
|
|
20021
20032
|
resizeTerminal: d,
|
|
20022
20033
|
closeTerminal: f,
|
|
20023
20034
|
subscribeTerminal: p,
|
|
20024
|
-
onCwdUpdate:
|
|
20025
|
-
registerClear:
|
|
20035
|
+
onCwdUpdate: ie,
|
|
20036
|
+
registerClear: re
|
|
20026
20037
|
}, e.id))
|
|
20027
20038
|
})
|
|
20028
20039
|
]
|
|
@@ -21866,25 +21877,25 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
21866
21877
|
let [i, a] = B(Bh, Ph), o = V(null), [s, c] = H(0), l = V(null), u = V(null);
|
|
21867
21878
|
s === 0 && l.current === null && (l.current = t ?? (n ? kh() : Oh()));
|
|
21868
21879
|
let d = V(i.fileTree), f = V(i.openFile);
|
|
21869
|
-
|
|
21880
|
+
L(() => {
|
|
21870
21881
|
d.current = i.fileTree;
|
|
21871
|
-
}, [i.fileTree]),
|
|
21882
|
+
}, [i.fileTree]), L(() => {
|
|
21872
21883
|
f.current = i.openFile;
|
|
21873
21884
|
}, [i.openFile]);
|
|
21874
21885
|
let p = V(null);
|
|
21875
|
-
|
|
21886
|
+
L(() => {
|
|
21876
21887
|
p.current = i.gitDiff?.path ?? null;
|
|
21877
21888
|
}, [i.gitDiff]);
|
|
21878
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);
|
|
21879
|
-
|
|
21890
|
+
L(() => {
|
|
21880
21891
|
y.current = i.sessionId;
|
|
21881
21892
|
}, [i.sessionId]);
|
|
21882
21893
|
let b = V(!1), x = V(i.olderHistory);
|
|
21883
|
-
|
|
21894
|
+
L(() => {
|
|
21884
21895
|
x.current = i.olderHistory;
|
|
21885
21896
|
}, [i.olderHistory]);
|
|
21886
21897
|
let C = V(i.writableRoot);
|
|
21887
|
-
|
|
21898
|
+
L(() => {
|
|
21888
21899
|
C.current = i.writableRoot;
|
|
21889
21900
|
}, [i.writableRoot]);
|
|
21890
21901
|
let w = V(!1), T = V(/* @__PURE__ */ new Map()), E = V(/* @__PURE__ */ new Map()), D = i.workspace ? Dt(i.workspace) : null, O = V({
|
|
@@ -21895,13 +21906,13 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
21895
21906
|
workspaceRoot: D,
|
|
21896
21907
|
sessionId: i.sessionId
|
|
21897
21908
|
});
|
|
21898
|
-
|
|
21909
|
+
L(() => {
|
|
21899
21910
|
A.current = {
|
|
21900
21911
|
workspaceRoot: D,
|
|
21901
21912
|
sessionId: i.sessionId
|
|
21902
21913
|
};
|
|
21903
21914
|
}, [D, i.sessionId]);
|
|
21904
|
-
let j =
|
|
21915
|
+
let j = I((e) => {
|
|
21905
21916
|
[
|
|
21906
21917
|
"switch_workspace",
|
|
21907
21918
|
"open_project",
|
|
@@ -21910,17 +21921,17 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
21910
21921
|
].includes(e.type) && k.current++;
|
|
21911
21922
|
let t = o.current;
|
|
21912
21923
|
t && t.readyState === WebSocket.OPEN && t.send(JSON.stringify(e));
|
|
21913
|
-
}, []),
|
|
21914
|
-
|
|
21915
|
-
}, []),
|
|
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(() => {
|
|
21916
21927
|
let e = o.current;
|
|
21917
21928
|
if (!e || e.readyState !== WebSocket.OPEN) return;
|
|
21918
|
-
if (
|
|
21919
|
-
|
|
21929
|
+
if (ie.current !== null) {
|
|
21930
|
+
ae.current = !0;
|
|
21920
21931
|
return;
|
|
21921
21932
|
}
|
|
21922
21933
|
let t = `outcome:${$()}`;
|
|
21923
|
-
|
|
21934
|
+
ie.current = t;
|
|
21924
21935
|
let n = A.current;
|
|
21925
21936
|
a({
|
|
21926
21937
|
type: "outcome_started",
|
|
@@ -21929,20 +21940,20 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
21929
21940
|
}), j({
|
|
21930
21941
|
type: "get_outcome",
|
|
21931
21942
|
requestId: t
|
|
21932
|
-
}),
|
|
21933
|
-
|
|
21943
|
+
}), oe.current = setTimeout(() => {
|
|
21944
|
+
ie.current === t && (M(), ae.current = !1, a({
|
|
21934
21945
|
type: "outcome_failed",
|
|
21935
21946
|
requestId: t,
|
|
21936
21947
|
message: "The Outcome took too long to answer — try again."
|
|
21937
21948
|
}));
|
|
21938
21949
|
}, Gh);
|
|
21939
|
-
}, [j,
|
|
21940
|
-
|
|
21941
|
-
let
|
|
21942
|
-
|
|
21943
|
-
}, []),
|
|
21944
|
-
|
|
21945
|
-
}, [
|
|
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) => {
|
|
21946
21957
|
e === "" && (w.current = !0);
|
|
21947
21958
|
let n = `dir:${$()}`;
|
|
21948
21959
|
a({
|
|
@@ -21955,7 +21966,7 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
21955
21966
|
path: e,
|
|
21956
21967
|
requestId: n
|
|
21957
21968
|
});
|
|
21958
|
-
}, [j]),
|
|
21969
|
+
}, [j]), R = V(!1), z = V(null), le = I((e, t) => {
|
|
21959
21970
|
let n = `gitlog:${$()}`;
|
|
21960
21971
|
a({
|
|
21961
21972
|
type: "git_log_started",
|
|
@@ -21968,11 +21979,11 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
21968
21979
|
requestId: n
|
|
21969
21980
|
});
|
|
21970
21981
|
}, [j]), de = V([]);
|
|
21971
|
-
|
|
21982
|
+
L(() => {
|
|
21972
21983
|
de.current = i.gitStatus?.repos ?? [];
|
|
21973
21984
|
}, [i.gitStatus]);
|
|
21974
|
-
let U = V(/* @__PURE__ */ new Set()), W = V(/* @__PURE__ */ new Set()), G = V(/* @__PURE__ */ new Map()), fe =
|
|
21975
|
-
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;
|
|
21976
21987
|
let t = e ?? "";
|
|
21977
21988
|
if (U.current.has(t)) {
|
|
21978
21989
|
W.current.add(t);
|
|
@@ -21985,26 +21996,26 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
21985
21996
|
...e === void 0 ? {} : { repo: e },
|
|
21986
21997
|
requestId: n
|
|
21987
21998
|
});
|
|
21988
|
-
}, [j]), pe =
|
|
21999
|
+
}, [j]), pe = I((e) => {
|
|
21989
22000
|
let t = G.current.get(e) ?? "";
|
|
21990
22001
|
G.current.delete(e), U.current.delete(t), W.current.delete(t) && fe(t === "" ? void 0 : t);
|
|
21991
|
-
}, [fe]), me =
|
|
21992
|
-
d.current[e] !== void 0 &&
|
|
21993
|
-
}, [
|
|
21994
|
-
|
|
22002
|
+
}, [fe]), me = I((e) => {
|
|
22003
|
+
d.current[e] !== void 0 && ce(e, !0);
|
|
22004
|
+
}, [ce]), he = I(() => {
|
|
22005
|
+
ce("", !0);
|
|
21995
22006
|
for (let e of Object.keys(d.current)) e !== "" && me(e);
|
|
21996
|
-
}, [me,
|
|
21997
|
-
|
|
21998
|
-
i.connected && w.current && d.current[""] === void 0 &&
|
|
22007
|
+
}, [me, ce]);
|
|
22008
|
+
L(() => {
|
|
22009
|
+
i.connected && w.current && d.current[""] === void 0 && ce("");
|
|
21999
22010
|
}, [
|
|
22000
22011
|
i.connected,
|
|
22001
22012
|
i.fileTree,
|
|
22002
|
-
|
|
22003
|
-
]),
|
|
22004
|
-
i.connected &&
|
|
22013
|
+
ce
|
|
22014
|
+
]), L(() => {
|
|
22015
|
+
i.connected && re.current && ie.current === null && se.current();
|
|
22005
22016
|
}, [i.connected]);
|
|
22006
22017
|
let ge = i.openFile?.path ?? null, _e = ge === null ? void 0 : i.gitStatus?.files[ge], ve = i.gitBaseline !== null;
|
|
22007
|
-
|
|
22018
|
+
L(() => {
|
|
22008
22019
|
let e = _e === "modified" || _e === "added" || _e === "conflicted";
|
|
22009
22020
|
if (!i.connected || ge === null || !e) {
|
|
22010
22021
|
ve && a({ type: "git_baseline_cleared" });
|
|
@@ -22026,7 +22037,7 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22026
22037
|
_e,
|
|
22027
22038
|
i.gitStatus,
|
|
22028
22039
|
j
|
|
22029
|
-
]),
|
|
22040
|
+
]), L(() => {
|
|
22030
22041
|
let t = !1;
|
|
22031
22042
|
return fetch(`${e}/branding`, { headers: l.current ? { Authorization: `Bearer ${l.current}` } : {} }).then((e) => e.ok ? e.json() : null).then((e) => {
|
|
22032
22043
|
t || a(e ? {
|
|
@@ -22038,7 +22049,7 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22038
22049
|
}), () => {
|
|
22039
22050
|
t = !0;
|
|
22040
22051
|
};
|
|
22041
|
-
}, [e, s]),
|
|
22052
|
+
}, [e, s]), L(() => {
|
|
22042
22053
|
let t, n = !1;
|
|
22043
22054
|
function i() {
|
|
22044
22055
|
let s = new WebSocket(Vh(e, l.current, r));
|
|
@@ -22108,7 +22119,7 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22108
22119
|
let e = h.current.get(t.requestId);
|
|
22109
22120
|
h.current.delete(t.requestId), e.reject(new Sn(t.message, t.reason));
|
|
22110
22121
|
} else if (t.type === "file_changed") {
|
|
22111
|
-
|
|
22122
|
+
P();
|
|
22112
22123
|
for (let e of _.current.get(t.path) ?? []) e();
|
|
22113
22124
|
me(jh(t.path));
|
|
22114
22125
|
let e = f.current;
|
|
@@ -22131,7 +22142,7 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22131
22142
|
requestId: `gitdiff:${$()}`
|
|
22132
22143
|
}), fe(gn(de.current, t.path)?.repo);
|
|
22133
22144
|
} else if (t.type === "directory_changed") {
|
|
22134
|
-
|
|
22145
|
+
P();
|
|
22135
22146
|
for (let [e, n] of _.current) if (jh(e) === t.path) for (let e of n) e();
|
|
22136
22147
|
me(t.path);
|
|
22137
22148
|
let e = f.current;
|
|
@@ -22161,15 +22172,15 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22161
22172
|
requestId: `gitdiff:${$()}`
|
|
22162
22173
|
}), fe();
|
|
22163
22174
|
} else {
|
|
22164
|
-
if ((t.type === "hello" || t.type === "session_replaced" || t.type === "workspace_switched" || t.type === "workspace_starting") && (
|
|
22165
|
-
|
|
22166
|
-
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;
|
|
22167
22178
|
e !== null && e.repo === t.repo && le(e.repo, e.limit);
|
|
22168
22179
|
}
|
|
22169
|
-
if ((t.type === "git_status" || t.type === "git_error" && t.requestId.startsWith("git:")) && pe(t.requestId), t.type === "work_plan_changed" &&
|
|
22170
|
-
|
|
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;
|
|
22171
22182
|
let e = A.current, n = t.sessionId === e.sessionId, r = (t.workspace ? Dt(t.workspace) : null) === e.workspaceRoot;
|
|
22172
|
-
|
|
22183
|
+
re.current && n && r && queueMicrotask(() => se.current());
|
|
22173
22184
|
}
|
|
22174
22185
|
if (t.type === "file_operation_result") {
|
|
22175
22186
|
let e = t.previousPath ?? t.path, n = f.current;
|
|
@@ -22181,12 +22192,12 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22181
22192
|
a({
|
|
22182
22193
|
type: "server",
|
|
22183
22194
|
message: t
|
|
22184
|
-
}), t.type === "session_replaced" &&
|
|
22195
|
+
}), t.type === "session_replaced" && ce("");
|
|
22185
22196
|
}
|
|
22186
22197
|
}
|
|
22187
22198
|
}, s.onclose = (e) => {
|
|
22188
22199
|
if (o.current === s) {
|
|
22189
|
-
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;
|
|
22190
22201
|
for (let e of h.current.values()) e.reject(new Sn("The connection dropped before the upload finished"));
|
|
22191
22202
|
h.current.clear();
|
|
22192
22203
|
for (let e of g.current.values()) e.reject(new m("The connection dropped before the server answered"));
|
|
@@ -22207,14 +22218,14 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22207
22218
|
fe,
|
|
22208
22219
|
pe,
|
|
22209
22220
|
me,
|
|
22210
|
-
|
|
22211
|
-
|
|
22212
|
-
|
|
22221
|
+
ce,
|
|
22222
|
+
P,
|
|
22223
|
+
M,
|
|
22213
22224
|
s,
|
|
22214
22225
|
r,
|
|
22215
22226
|
le
|
|
22216
22227
|
]);
|
|
22217
|
-
let K =
|
|
22228
|
+
let K = I((e, t) => {
|
|
22218
22229
|
let n = o.current;
|
|
22219
22230
|
if (!n || n.readyState !== WebSocket.OPEN) return Promise.reject(new S("not connected to the server", "failed"));
|
|
22220
22231
|
let r = `history:${$()}`;
|
|
@@ -22235,7 +22246,7 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22235
22246
|
requestId: r
|
|
22236
22247
|
});
|
|
22237
22248
|
});
|
|
22238
|
-
}, [j]), ye =
|
|
22249
|
+
}, [j]), ye = I(async () => {
|
|
22239
22250
|
let e = x.current;
|
|
22240
22251
|
if (!(!e || e.loading || b.current || e.remaining <= 0)) {
|
|
22241
22252
|
b.current = !0, a({ type: "history_load_started" });
|
|
@@ -22316,8 +22327,8 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22316
22327
|
}
|
|
22317
22328
|
};
|
|
22318
22329
|
}, [j]),
|
|
22319
|
-
setOutcomeActive:
|
|
22320
|
-
refreshOutcome:
|
|
22330
|
+
setOutcomeActive: F,
|
|
22331
|
+
refreshOutcome: N,
|
|
22321
22332
|
authToken: l.current,
|
|
22322
22333
|
switchWorkspace: (e, t) => {
|
|
22323
22334
|
((t ?? e) !== D || i.switching) && (a({ type: "workspace_switching" }), j({
|
|
@@ -22527,7 +22538,7 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22527
22538
|
type: "dismiss_notification",
|
|
22528
22539
|
id: e
|
|
22529
22540
|
}),
|
|
22530
|
-
listDirectory: (e) =>
|
|
22541
|
+
listDirectory: (e) => ce(e),
|
|
22531
22542
|
refreshFileTree: he,
|
|
22532
22543
|
readFile: (e, t, n) => {
|
|
22533
22544
|
let r = `file:${$()}`;
|
|
@@ -22587,7 +22598,7 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22587
22598
|
i(new Cn());
|
|
22588
22599
|
return;
|
|
22589
22600
|
}
|
|
22590
|
-
|
|
22601
|
+
ce(n, !0);
|
|
22591
22602
|
}
|
|
22592
22603
|
r(e);
|
|
22593
22604
|
}),
|
|
@@ -22744,13 +22755,13 @@ function Jh(e = "", t, n = !1, r) {
|
|
|
22744
22755
|
},
|
|
22745
22756
|
clearGitDiff: () => a({ type: "git_diff_cleared" }),
|
|
22746
22757
|
fetchGitLog: (e, t) => {
|
|
22747
|
-
|
|
22758
|
+
z.current = {
|
|
22748
22759
|
repo: e,
|
|
22749
22760
|
limit: t
|
|
22750
22761
|
}, le(e, t);
|
|
22751
22762
|
},
|
|
22752
22763
|
closeGitLog: () => {
|
|
22753
|
-
|
|
22764
|
+
z.current = null, a({ type: "git_log_closed" });
|
|
22754
22765
|
},
|
|
22755
22766
|
fetchGitShow: (e, t) => j({
|
|
22756
22767
|
type: "git_show",
|
|
@@ -23012,25 +23023,25 @@ function Xh({ label: e }) {
|
|
|
23012
23023
|
})
|
|
23013
23024
|
});
|
|
23014
23025
|
}
|
|
23015
|
-
var Zh =
|
|
23016
|
-
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);
|
|
23017
23028
|
Do(c.workspaces, c.workspace ? Dt(c.workspace) : null);
|
|
23018
23029
|
let wt = c.workspace ? Dt(c.workspace) : null;
|
|
23019
|
-
|
|
23030
|
+
L(() => {
|
|
23020
23031
|
Ft([]), zn([]), ar.current && (ar.current.scrollTop = 0);
|
|
23021
23032
|
}, [wt]);
|
|
23022
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) => {
|
|
23023
23034
|
let n = Jt.current[wt ?? ""]?.trim(), r = n ? `${n}\n\n${e}` : e;
|
|
23024
|
-
t ?
|
|
23035
|
+
t ? ie(r, t) : ie(r);
|
|
23025
23036
|
}, Xt = c.queuedEditRefused;
|
|
23026
|
-
|
|
23037
|
+
L(() => {
|
|
23027
23038
|
Xt && Yt(Xt.text);
|
|
23028
23039
|
}, [Xt?.nonce]);
|
|
23029
23040
|
let Zt = V({
|
|
23030
23041
|
key: null,
|
|
23031
23042
|
drafts: /* @__PURE__ */ new Map()
|
|
23032
23043
|
});
|
|
23033
|
-
|
|
23044
|
+
L(() => {
|
|
23034
23045
|
let e = Zt.current;
|
|
23035
23046
|
if (e.key !== wt) {
|
|
23036
23047
|
Zt.current = {
|
|
@@ -23051,11 +23062,11 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23051
23062
|
draft: n
|
|
23052
23063
|
});
|
|
23053
23064
|
}, $t = V([]), [en, tn] = H(!1), nn = V({
|
|
23054
|
-
readFile:
|
|
23065
|
+
readFile: R,
|
|
23055
23066
|
openNative: me
|
|
23056
23067
|
});
|
|
23057
23068
|
nn.current = {
|
|
23058
|
-
readFile:
|
|
23069
|
+
readFile: R,
|
|
23059
23070
|
openNative: me
|
|
23060
23071
|
};
|
|
23061
23072
|
let rn = ue(() => ({
|
|
@@ -23065,13 +23076,13 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23065
23076
|
tn(!1), nn.current.readFile(e);
|
|
23066
23077
|
},
|
|
23067
23078
|
onOpenNative: (e) => nn.current.openNative(e)
|
|
23068
|
-
}), [e, xt]), [an, sn] = H(pn), ln =
|
|
23079
|
+
}), [e, xt]), [an, sn] = H(pn), ln = I((e, t) => {
|
|
23069
23080
|
mn(e, t), sn((n) => ({
|
|
23070
23081
|
...n,
|
|
23071
23082
|
[e]: t
|
|
23072
23083
|
}));
|
|
23073
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;
|
|
23074
|
-
|
|
23085
|
+
L(() => {
|
|
23075
23086
|
let e = window.matchMedia("(max-width: 767px)"), t = () => {
|
|
23076
23087
|
let t = e.matches;
|
|
23077
23088
|
t && xn(!1), yn(t);
|
|
@@ -23079,13 +23090,13 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23079
23090
|
return t(), e.addEventListener("change", t), window.addEventListener("resize", t), () => {
|
|
23080
23091
|
e.removeEventListener("change", t), window.removeEventListener("resize", t);
|
|
23081
23092
|
};
|
|
23082
|
-
}, []),
|
|
23093
|
+
}, []), L(() => {
|
|
23083
23094
|
let e = (e) => {
|
|
23084
23095
|
Tn && (e.ctrlKey || e.metaKey) && e.key === "`" && (e.preventDefault(), wn((e) => !e));
|
|
23085
23096
|
};
|
|
23086
23097
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
23087
23098
|
}, [Tn]);
|
|
23088
|
-
let [En, On] = H(!1), [kn, An] = H(null), jn =
|
|
23099
|
+
let [En, On] = H(!1), [kn, An] = H(null), jn = I(() => An(null), []);
|
|
23089
23100
|
function Mn() {
|
|
23090
23101
|
let e = !un;
|
|
23091
23102
|
dn(e), e && (hn(!1), xn(!1), On(!1));
|
|
@@ -23103,12 +23114,12 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23103
23114
|
let e = !En;
|
|
23104
23115
|
On(e), e && (dn(!1), hn(!1), xn(!1));
|
|
23105
23116
|
}
|
|
23106
|
-
|
|
23117
|
+
L(() => (_t(En), () => _t(!1)), [
|
|
23107
23118
|
En,
|
|
23108
23119
|
_t,
|
|
23109
23120
|
c.sessionId,
|
|
23110
23121
|
wt
|
|
23111
|
-
]),
|
|
23122
|
+
]), L(() => {
|
|
23112
23123
|
On(!1), An(null);
|
|
23113
23124
|
}, [wt]);
|
|
23114
23125
|
let [In, Ln] = H([]), [Rn, zn] = H([]), Hn = V(0), Un = V(0), [Wn, Gn] = H(0);
|
|
@@ -23128,7 +23139,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23128
23139
|
}
|
|
23129
23140
|
}
|
|
23130
23141
|
}
|
|
23131
|
-
|
|
23142
|
+
L(() => {
|
|
23132
23143
|
$t.current = Pt;
|
|
23133
23144
|
}, [Pt]);
|
|
23134
23145
|
function qn() {
|
|
@@ -23158,18 +23169,18 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23158
23169
|
e.preventDefault(), Gn(0), e.dataTransfer.files.length > 0 && Kn(Array.from(e.dataTransfer.files));
|
|
23159
23170
|
}
|
|
23160
23171
|
let { theme: tr, preference: nr, toggle: rr, setTheme: ir } = _e(c.branding.defaultTheme ?? "system", c.branding.allowThemeToggle !== !1, s, n);
|
|
23161
|
-
|
|
23162
|
-
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) => {
|
|
23163
23174
|
ar.current = e, cr(e);
|
|
23164
|
-
}, []), 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) => {
|
|
23165
23176
|
e !== fr.current && hr(e), fr.current = e;
|
|
23166
|
-
}, []), _r =
|
|
23177
|
+
}, []), _r = I(() => {
|
|
23167
23178
|
let e = ar.current;
|
|
23168
23179
|
e && gr(e.scrollHeight - e.scrollTop - e.clientHeight < Yh);
|
|
23169
|
-
}, [gr]), vr = V(null), yr =
|
|
23180
|
+
}, [gr]), vr = V(null), yr = I(() => {
|
|
23170
23181
|
let e = ar.current;
|
|
23171
23182
|
e && (e.scrollHeight - e.scrollTop - e.clientHeight < Yh || (vr.current = e.scrollTop));
|
|
23172
|
-
}, []), br =
|
|
23183
|
+
}, []), br = I(() => {
|
|
23173
23184
|
let e = ar.current;
|
|
23174
23185
|
if (!e) return;
|
|
23175
23186
|
let t = e.scrollHeight - e.scrollTop - e.clientHeight < Yh, n = vr.current;
|
|
@@ -23182,7 +23193,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23182
23193
|
function xr() {
|
|
23183
23194
|
vr.current = null;
|
|
23184
23195
|
}
|
|
23185
|
-
|
|
23196
|
+
L(() => {
|
|
23186
23197
|
let e = sr;
|
|
23187
23198
|
if (!e) return;
|
|
23188
23199
|
let t = () => {
|
|
@@ -23200,12 +23211,12 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23200
23211
|
br,
|
|
23201
23212
|
yr
|
|
23202
23213
|
]);
|
|
23203
|
-
let Cr =
|
|
23214
|
+
let Cr = I(() => {
|
|
23204
23215
|
gr(!0), yr();
|
|
23205
23216
|
let e = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? !1;
|
|
23206
23217
|
dr.current?.scrollIntoView({ behavior: e ? "auto" : "smooth" });
|
|
23207
23218
|
}, [gr, yr]);
|
|
23208
|
-
|
|
23219
|
+
L(() => {
|
|
23209
23220
|
fr.current ? (yr(), dr.current?.scrollIntoView({ behavior: "smooth" })) : _r();
|
|
23210
23221
|
}, [
|
|
23211
23222
|
c.items,
|
|
@@ -23214,18 +23225,18 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23214
23225
|
]);
|
|
23215
23226
|
let wr = ue(() => Mt(c.items), [c.items]), Tr = ue(() => un ? Ht(c.items) : null, [un, c.items]), Er = ue(() => Le({
|
|
23216
23227
|
readFile: (e, t) => {
|
|
23217
|
-
tn(!1),
|
|
23228
|
+
tn(!1), R(e, t);
|
|
23218
23229
|
},
|
|
23219
23230
|
fetchGitFileHistory: (e) => ke(e),
|
|
23220
23231
|
fetchGitDiff: (e) => {
|
|
23221
|
-
tn(!0),
|
|
23232
|
+
tn(!0), R(e);
|
|
23222
23233
|
},
|
|
23223
23234
|
searchFiles: (e) => xe(e)
|
|
23224
23235
|
}), [
|
|
23225
|
-
|
|
23236
|
+
R,
|
|
23226
23237
|
ke,
|
|
23227
23238
|
xe
|
|
23228
|
-
]), Dr =
|
|
23239
|
+
]), Dr = I(() => ln("tools", !0), [ln]), Or = I((e) => {
|
|
23229
23240
|
let t = ar.current;
|
|
23230
23241
|
if (t) {
|
|
23231
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;
|
|
@@ -23239,14 +23250,14 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23239
23250
|
c.sessionName,
|
|
23240
23251
|
c.sessions,
|
|
23241
23252
|
c.sessionId
|
|
23242
|
-
]), Pr =
|
|
23253
|
+
]), Pr = I(async () => {
|
|
23243
23254
|
Mr(null), Ar("preparing…");
|
|
23244
23255
|
try {
|
|
23245
|
-
let { exportConversation: t } = await import("./conversationExport-
|
|
23256
|
+
let { exportConversation: t } = await import("./conversationExport-C761zW6H.js");
|
|
23246
23257
|
await t({
|
|
23247
23258
|
items: c.items,
|
|
23248
23259
|
olderItems: c.olderHistory?.remaining ?? 0,
|
|
23249
|
-
...c.olderHistory ? { fetchOlderItems:
|
|
23260
|
+
...c.olderHistory ? { fetchOlderItems: se } : {},
|
|
23250
23261
|
connection: {
|
|
23251
23262
|
serverUrl: e,
|
|
23252
23263
|
token: d,
|
|
@@ -23271,7 +23282,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23271
23282
|
c.workspace,
|
|
23272
23283
|
c.model,
|
|
23273
23284
|
Nr,
|
|
23274
|
-
|
|
23285
|
+
se,
|
|
23275
23286
|
e,
|
|
23276
23287
|
d,
|
|
23277
23288
|
Ct
|
|
@@ -23281,13 +23292,13 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23281
23292
|
hideTools: !an.tools,
|
|
23282
23293
|
onShowTools: Dr,
|
|
23283
23294
|
onJump: Or
|
|
23284
|
-
}), Lr = V(null), Rr = V(c.olderHistory?.have ?? 0), zr =
|
|
23295
|
+
}), Lr = V(null), Rr = V(c.olderHistory?.have ?? 0), zr = I(() => {
|
|
23285
23296
|
let e = ar.current;
|
|
23286
23297
|
e && (Lr.current = {
|
|
23287
23298
|
height: e.scrollHeight,
|
|
23288
23299
|
top: e.scrollTop
|
|
23289
|
-
}),
|
|
23290
|
-
}, [
|
|
23300
|
+
}), oe();
|
|
23301
|
+
}, [oe]);
|
|
23291
23302
|
if (le(() => {
|
|
23292
23303
|
let e = c.olderHistory?.have ?? 0, t = Rr.current;
|
|
23293
23304
|
Rr.current = e;
|
|
@@ -23295,7 +23306,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23295
23306
|
if (Lr.current = null, !n || e <= t) return;
|
|
23296
23307
|
let r = ar.current;
|
|
23297
23308
|
r && (r.scrollTop = n.top + (r.scrollHeight - n.height));
|
|
23298
|
-
}, [c.olderHistory?.have]),
|
|
23309
|
+
}, [c.olderHistory?.have]), L(() => {
|
|
23299
23310
|
if (!o) {
|
|
23300
23311
|
let e = c.extensionTitle ?? c.branding.title ?? "pi";
|
|
23301
23312
|
document.title = c.workspace ? `${c.workspace.name} — ${e}` : e;
|
|
@@ -23365,14 +23376,14 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23365
23376
|
writableRoot: c.writableRoot,
|
|
23366
23377
|
gitFiles: c.gitStatus?.files,
|
|
23367
23378
|
attachedPaths: Jn,
|
|
23368
|
-
onExpand:
|
|
23379
|
+
onExpand: F,
|
|
23369
23380
|
onSelectDirectory: Wt,
|
|
23370
|
-
onRefresh:
|
|
23381
|
+
onRefresh: ce,
|
|
23371
23382
|
onSelectFile: (e) => {
|
|
23372
|
-
tn(!1), Wt(e),
|
|
23383
|
+
tn(!1), Wt(e), R(e);
|
|
23373
23384
|
},
|
|
23374
23385
|
onSelectDiff: (e) => {
|
|
23375
|
-
tn(!0), Wt(e),
|
|
23386
|
+
tn(!0), Wt(e), R(e);
|
|
23376
23387
|
},
|
|
23377
23388
|
onToggleAttachPath: Xn,
|
|
23378
23389
|
onCreateFile: (e) => {
|
|
@@ -23391,7 +23402,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23391
23402
|
contentSearch: c.contentSearch,
|
|
23392
23403
|
onSearchContent: B,
|
|
23393
23404
|
onOpenSearchHit: (e, t) => {
|
|
23394
|
-
tn(!1), Wt(e.path),
|
|
23405
|
+
tn(!1), Wt(e.path), R(e.path, void 0, e.kind === "line" ? {
|
|
23395
23406
|
query: t,
|
|
23396
23407
|
line: e.line
|
|
23397
23408
|
} : {
|
|
@@ -23547,7 +23558,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23547
23558
|
open: Sn,
|
|
23548
23559
|
onToggle: Nn,
|
|
23549
23560
|
onOpenWorkspace: (e) => {
|
|
23550
|
-
tn(!1),
|
|
23561
|
+
tn(!1), R(e);
|
|
23551
23562
|
},
|
|
23552
23563
|
requestedTaskId: kn,
|
|
23553
23564
|
onTaskRequestHandled: jn
|
|
@@ -23557,7 +23568,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23557
23568
|
onClose: () => On(!1),
|
|
23558
23569
|
onRefresh: bt,
|
|
23559
23570
|
onTarget: (e) => {
|
|
23560
|
-
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));
|
|
23561
23572
|
}
|
|
23562
23573
|
}),
|
|
23563
23574
|
c.openFile && /* @__PURE__ */ W(ki, {
|
|
@@ -23575,7 +23586,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23575
23586
|
inRepository: gn(c.gitStatus?.repos ?? [], c.openFile.path) !== null,
|
|
23576
23587
|
onOpenGitHistory: ke,
|
|
23577
23588
|
onClose: qn,
|
|
23578
|
-
onReload:
|
|
23589
|
+
onReload: R,
|
|
23579
23590
|
onSave: de,
|
|
23580
23591
|
serverUrl: e,
|
|
23581
23592
|
token: d,
|
|
@@ -23653,7 +23664,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23653
23664
|
token: d,
|
|
23654
23665
|
workspace: Ct,
|
|
23655
23666
|
onOpenFile: (e) => {
|
|
23656
|
-
tn(!1),
|
|
23667
|
+
tn(!1), R(e);
|
|
23657
23668
|
}
|
|
23658
23669
|
}));
|
|
23659
23670
|
}),
|
|
@@ -23697,7 +23708,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23697
23708
|
isStreaming: c.isStreaming,
|
|
23698
23709
|
count: c.queue.length,
|
|
23699
23710
|
canSend: c.queue.every((e) => e.editable) && c.connected,
|
|
23700
|
-
onSend:
|
|
23711
|
+
onSend: re
|
|
23701
23712
|
}),
|
|
23702
23713
|
In.map((e, t) => /* @__PURE__ */ W("div", {
|
|
23703
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",
|
|
@@ -23763,10 +23774,10 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23763
23774
|
className: "mx-auto max-w-3xl",
|
|
23764
23775
|
children: [Br && /* @__PURE__ */ W(or, {
|
|
23765
23776
|
request: Br,
|
|
23766
|
-
onRespond:
|
|
23777
|
+
onRespond: M
|
|
23767
23778
|
}, Br.id), Vr && /* @__PURE__ */ W(ur, {
|
|
23768
23779
|
request: Vr,
|
|
23769
|
-
onRespond:
|
|
23780
|
+
onRespond: N
|
|
23770
23781
|
}, Vr.id)]
|
|
23771
23782
|
}), /* @__PURE__ */ G("div", {
|
|
23772
23783
|
className: "mx-auto max-w-3xl",
|
|
@@ -23817,7 +23828,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23817
23828
|
isCompacting: c.isCompacting,
|
|
23818
23829
|
onSetModel: y,
|
|
23819
23830
|
onSetThinking: b,
|
|
23820
|
-
onCompact:
|
|
23831
|
+
onCompact: ae
|
|
23821
23832
|
})
|
|
23822
23833
|
]
|
|
23823
23834
|
})]
|
|
@@ -23827,7 +23838,7 @@ var Zh = P(function({ serverUrl: e = "", rootElement: t, initialTheme: n, token:
|
|
|
23827
23838
|
]
|
|
23828
23839
|
}), /* @__PURE__ */ W(mr, {
|
|
23829
23840
|
notifications: c.notifications,
|
|
23830
|
-
onDismiss:
|
|
23841
|
+
onDismiss: P
|
|
23831
23842
|
})]
|
|
23832
23843
|
})
|
|
23833
23844
|
})
|
|
@@ -23852,8 +23863,8 @@ function tg(e, t = {}) {
|
|
|
23852
23863
|
}
|
|
23853
23864
|
let r = document.createElement("div");
|
|
23854
23865
|
r.id = "root", n.appendChild(r);
|
|
23855
|
-
let i =
|
|
23856
|
-
return a.render(
|
|
23866
|
+
let i = M(), a = de(r);
|
|
23867
|
+
return a.render(se(Zh, {
|
|
23857
23868
|
ref: i,
|
|
23858
23869
|
serverUrl: t.serverUrl,
|
|
23859
23870
|
rootElement: e,
|