@staff0rd/assist 0.1190.1 → 0.1190.3
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/.build-files +13 -13
- package/dist/built-version +1 -1
- package/dist/{chunk-JRIJ5TC2.js → chunk-E47YUHYL.js} +108 -38
- package/dist/{chunk-AIEDVYID.js → chunk-FJSVCSF2.js} +1 -1
- package/dist/{chunk-QUW7O7OA.js → chunk-FSXFCN77.js} +1 -1
- package/dist/{chunk-TO2PEQKB.js → chunk-GHMXF3PZ.js} +1 -1
- package/dist/{chunk-24PO57QI.js → chunk-JW7RH6UO.js} +1 -1
- package/dist/{chunk-HKALJ6A7.js → chunk-SQ32XJCS.js} +1 -1
- package/dist/commands/sessions/web/bundle.js +432 -432
- package/dist/{doctorNodes-HQMT3M2F.js → doctorNodes-GTAW2T5A.js} +3 -3
- package/dist/index.js +11 -11
- package/dist/{restartNode-4VCW6E63.js → restartNode-JTMKMTB7.js} +5 -5
- package/dist/{runDaemon-USZWF2C6.js → runDaemon-ZTJ734QT.js} +2 -2
- package/dist/{signExtension-QX4OEZFI.js → signExtension-JLTUANO7.js} +1 -1
- package/dist/{updateNode-Z4VF7RNS.js → updateNode-ICDHHRSS.js} +5 -5
- package/dist/{web-EJ5IN72X.js → web-QCFMGH4C.js} +5 -5
- package/dist/{web-KNBXQ6QF.js → web-XHULOCAS.js} +5 -5
- package/package.json +1 -1
package/dist/.build-files
CHANGED
|
@@ -30,7 +30,6 @@ check-ID7FFCHZ.js
|
|
|
30
30
|
checkBuildLocks-UBGUSNX5.js
|
|
31
31
|
chunk-22EV6N3N.js
|
|
32
32
|
chunk-233FYQ37.js
|
|
33
|
-
chunk-24PO57QI.js
|
|
34
33
|
chunk-25RUFQVZ.js
|
|
35
34
|
chunk-2EW62DM5.js
|
|
36
35
|
chunk-2JYMVJGZ.js
|
|
@@ -92,7 +91,6 @@ chunk-ADLCDG2V.js
|
|
|
92
91
|
chunk-AEDF2LCO.js
|
|
93
92
|
chunk-AFQMD7AO.js
|
|
94
93
|
chunk-AH7XVN5D.js
|
|
95
|
-
chunk-AIEDVYID.js
|
|
96
94
|
chunk-ALAS5LZJ.js
|
|
97
95
|
chunk-APZ6ZTDA.js
|
|
98
96
|
chunk-AVLELL42.js
|
|
@@ -130,6 +128,7 @@ chunk-DS2YJZZY.js
|
|
|
130
128
|
chunk-DUNO7WBT.js
|
|
131
129
|
chunk-DZGYHAE7.js
|
|
132
130
|
chunk-E36L7ASL.js
|
|
131
|
+
chunk-E47YUHYL.js
|
|
133
132
|
chunk-EEFDZ4FS.js
|
|
134
133
|
chunk-EITOI7YF.js
|
|
135
134
|
chunk-EM5TGZYD.js
|
|
@@ -148,17 +147,20 @@ chunk-F7QYFJB2.js
|
|
|
148
147
|
chunk-FAYB2ZL6.js
|
|
149
148
|
chunk-FCH7H3EL.js
|
|
150
149
|
chunk-FGCGH2CT.js
|
|
150
|
+
chunk-FJSVCSF2.js
|
|
151
151
|
chunk-FKM6PT3Q.js
|
|
152
152
|
chunk-FLDRXYEM.js
|
|
153
153
|
chunk-FOPR6LRY.js
|
|
154
154
|
chunk-FPWL4VRC.js
|
|
155
155
|
chunk-FQZ6D3OJ.js
|
|
156
|
+
chunk-FSXFCN77.js
|
|
156
157
|
chunk-FVZP4ULO.js
|
|
157
158
|
chunk-FYYZG4GY.js
|
|
158
159
|
chunk-G3CJH2XK.js
|
|
159
160
|
chunk-G3ROBZ4I.js
|
|
160
161
|
chunk-G5GN2KBP.js
|
|
161
162
|
chunk-G7UI2W7U.js
|
|
163
|
+
chunk-GHMXF3PZ.js
|
|
162
164
|
chunk-GIHVMELY.js
|
|
163
165
|
chunk-GL5GKF5A.js
|
|
164
166
|
chunk-GNNMJOUE.js
|
|
@@ -173,7 +175,6 @@ chunk-HBEQCMHL.js
|
|
|
173
175
|
chunk-HEFN57NV.js
|
|
174
176
|
chunk-HI6T3DND.js
|
|
175
177
|
chunk-HIOA4WIF.js
|
|
176
|
-
chunk-HKALJ6A7.js
|
|
177
178
|
chunk-HKGCLAZ7.js
|
|
178
179
|
chunk-HN7MFXZ7.js
|
|
179
180
|
chunk-HR7HIPYM.js
|
|
@@ -211,11 +212,11 @@ chunk-JNCFHWBK.js
|
|
|
211
212
|
chunk-JNEYUOQ3.js
|
|
212
213
|
chunk-JPM7HCLI.js
|
|
213
214
|
chunk-JPRADR2E.js
|
|
214
|
-
chunk-JRIJ5TC2.js
|
|
215
215
|
chunk-JS2XXDJN.js
|
|
216
216
|
chunk-JUVR4JSY.js
|
|
217
217
|
chunk-JVG5AJA2.js
|
|
218
218
|
chunk-JVTCXR7C.js
|
|
219
|
+
chunk-JW7RH6UO.js
|
|
219
220
|
chunk-JWZXZBPN.js
|
|
220
221
|
chunk-K45LIKCT.js
|
|
221
222
|
chunk-K5JPUERO.js
|
|
@@ -291,7 +292,6 @@ chunk-QO3TSFL2.js
|
|
|
291
292
|
chunk-QRTB7PVR.js
|
|
292
293
|
chunk-QS2S63AF.js
|
|
293
294
|
chunk-QU6OQZJ2.js
|
|
294
|
-
chunk-QUW7O7OA.js
|
|
295
295
|
chunk-R62CNGZO.js
|
|
296
296
|
chunk-R72E45HQ.js
|
|
297
297
|
chunk-RFMBA6WA.js
|
|
@@ -307,6 +307,7 @@ chunk-S6XYTJU2.js
|
|
|
307
307
|
chunk-SDMBTSYP.js
|
|
308
308
|
chunk-SHWMHL7S.js
|
|
309
309
|
chunk-SO3IBV6J.js
|
|
310
|
+
chunk-SQ32XJCS.js
|
|
310
311
|
chunk-SQX66MN6.js
|
|
311
312
|
chunk-SSKHLBQB.js
|
|
312
313
|
chunk-SURCYYQ6.js
|
|
@@ -318,7 +319,6 @@ chunk-T7ZPGAB5.js
|
|
|
318
319
|
chunk-TEBEVYZR.js
|
|
319
320
|
chunk-TJGF3Z72.js
|
|
320
321
|
chunk-TJM6UIF2.js
|
|
321
|
-
chunk-TO2PEQKB.js
|
|
322
322
|
chunk-TSRTRJU4.js
|
|
323
323
|
chunk-TUPSNHFZ.js
|
|
324
324
|
chunk-TVQY3HPZ.js
|
|
@@ -474,7 +474,7 @@ deps-RSUOIZPE.js
|
|
|
474
474
|
docsConfirm-AQGXUXUM.js
|
|
475
475
|
docsScreenshots-VV5F5SK5.js
|
|
476
476
|
docsUnlock-JTCIE32Q.js
|
|
477
|
-
doctorNodes-
|
|
477
|
+
doctorNodes-GTAW2T5A.js
|
|
478
478
|
done-YSG44MAX.js
|
|
479
479
|
drainDaemon-ZHP2VY7D.js
|
|
480
480
|
dropRetiredTables-JBLALSG5.js
|
|
@@ -581,7 +581,7 @@ repos-HRCIMY6J.js
|
|
|
581
581
|
resolveHarness-CRWWVE4U.js
|
|
582
582
|
resolveModel-2I3SVZKR.js
|
|
583
583
|
restartDaemon-Y7V2QF3N.js
|
|
584
|
-
restartNode-
|
|
584
|
+
restartNode-JTMKMTB7.js
|
|
585
585
|
restructure-S6KIV6TM.js
|
|
586
586
|
review-Q2HDUBAA.js
|
|
587
587
|
reviewPrComments-PX4MPOTQ.js
|
|
@@ -589,7 +589,7 @@ rewindPhase-TCQMOWKB.js
|
|
|
589
589
|
rulesAdd-DR25M5KY.js
|
|
590
590
|
run-D7UQIGJU.js
|
|
591
591
|
run-DRGU5WNL.js
|
|
592
|
-
runDaemon-
|
|
592
|
+
runDaemon-ZTJ734QT.js
|
|
593
593
|
runExtract-7H2MKKFQ.js
|
|
594
594
|
runParallelPhase-6GQMW5NT.js
|
|
595
595
|
runRefine-K764J34T.js
|
|
@@ -611,7 +611,7 @@ show-GUW62FKK.js
|
|
|
611
611
|
show-IWLHTZEP.js
|
|
612
612
|
showClaudeCodeIcon-E4SAM3GN.js
|
|
613
613
|
showCodexIcon-YUAKV4NI.js
|
|
614
|
-
signExtension-
|
|
614
|
+
signExtension-JLTUANO7.js
|
|
615
615
|
simulateDivergence-VB4UL4UR.js
|
|
616
616
|
skip-7Q3IVOBV.js
|
|
617
617
|
slack-VILAGICW.js
|
|
@@ -639,7 +639,7 @@ unlinkNode-RKC44U2T.js
|
|
|
639
639
|
unstar-YQDZUJV7.js
|
|
640
640
|
update-FHGTCK6N.js
|
|
641
641
|
update-W7ANHGDR.js
|
|
642
|
-
updateNode-
|
|
642
|
+
updateNode-ICDHHRSS.js
|
|
643
643
|
updatePhase-JEVJRAOR.js
|
|
644
644
|
updatePlan-QZVWDL2U.js
|
|
645
645
|
version-5K75T67C.js
|
|
@@ -647,8 +647,8 @@ viewIssue-N6W53LSK.js
|
|
|
647
647
|
watchLoop-MV7DVGC6.js
|
|
648
648
|
watchReport-A4W7UOAJ.js
|
|
649
649
|
watchWait-5Y2J5VQY.js
|
|
650
|
-
web-
|
|
651
|
-
web-
|
|
650
|
+
web-QCFMGH4C.js
|
|
651
|
+
web-XHULOCAS.js
|
|
652
652
|
withPool-LEJ76IOJ.js
|
|
653
653
|
wontdo-XAQGHSR5.js
|
|
654
654
|
wontfix-XV5XJADI.js
|
package/dist/built-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1190.
|
|
1
|
+
0.1190.3
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-JM57BCD6.js";
|
|
11
11
|
import {
|
|
12
12
|
firstBrokenHop
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SQ32XJCS.js";
|
|
14
14
|
import {
|
|
15
15
|
describePeerError,
|
|
16
16
|
fetchPeerJson
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
import {
|
|
48
48
|
ASSIST_VERSION,
|
|
49
49
|
PROTOCOL_VERSION
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-FJSVCSF2.js";
|
|
51
51
|
import {
|
|
52
52
|
findLinkSpec
|
|
53
53
|
} from "./chunk-J2PPCMCR.js";
|
|
@@ -2748,12 +2748,81 @@ async function getReviewSynthesis(req, res) {
|
|
|
2748
2748
|
}
|
|
2749
2749
|
}
|
|
2750
2750
|
|
|
2751
|
-
// src/commands/sessions/web/
|
|
2751
|
+
// src/commands/sessions/web/githubAttachment.ts
|
|
2752
2752
|
import { execFile as execFile4 } from "child_process";
|
|
2753
2753
|
import { promisify as promisify4 } from "util";
|
|
2754
|
+
|
|
2755
|
+
// src/commands/sessions/web/signedAttachmentUrl.ts
|
|
2756
|
+
var ASSET_ID = /^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i;
|
|
2757
|
+
var SIGNED_HOST = "private-user-images.githubusercontent.com";
|
|
2758
|
+
function isAttachmentAssetId(assetId) {
|
|
2759
|
+
return ASSET_ID.test(assetId);
|
|
2760
|
+
}
|
|
2761
|
+
function signedAttachmentUrl(bodyHtml, assetId) {
|
|
2762
|
+
let unsigned = null;
|
|
2763
|
+
for (const [, raw] of bodyHtml.matchAll(/\b(?:src|href)="(https:[^"]+)"/g)) {
|
|
2764
|
+
const url = raw.replace(/&/g, "&");
|
|
2765
|
+
if (!url.toLowerCase().includes(assetId.toLowerCase())) continue;
|
|
2766
|
+
const { hostname } = new URL(url);
|
|
2767
|
+
if (hostname === SIGNED_HOST) return url;
|
|
2768
|
+
if (hostname === "github.com") unsigned ??= url;
|
|
2769
|
+
}
|
|
2770
|
+
return unsigned;
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
// src/commands/sessions/web/githubAttachment.ts
|
|
2754
2774
|
var execFileAsync4 = promisify4(execFile4);
|
|
2755
|
-
var MAX_FILE_BYTES2 = 2 * 1024 * 1024;
|
|
2756
2775
|
var REPO = /^[\w.-]+\/[\w.-]+$/;
|
|
2776
|
+
var PR = /^\d+$/;
|
|
2777
|
+
var CACHE_TTL_MS2 = 6e4;
|
|
2778
|
+
var bodyHtmlCache = /* @__PURE__ */ new Map();
|
|
2779
|
+
async function prBodyHtml(repo, pr) {
|
|
2780
|
+
const key = `${repo}#${pr}`;
|
|
2781
|
+
const now = Date.now();
|
|
2782
|
+
const cached2 = bodyHtmlCache.get(key);
|
|
2783
|
+
if (cached2 && cached2.expires > now) return cached2.html;
|
|
2784
|
+
const { stdout } = await execFileAsync4(
|
|
2785
|
+
"gh",
|
|
2786
|
+
[
|
|
2787
|
+
"api",
|
|
2788
|
+
"-H",
|
|
2789
|
+
"Accept: application/vnd.github.html+json",
|
|
2790
|
+
`repos/${repo}/issues/${pr}`,
|
|
2791
|
+
"--jq",
|
|
2792
|
+
'.body_html // ""'
|
|
2793
|
+
],
|
|
2794
|
+
{ encoding: "utf8", windowsHide: true, maxBuffer: 8 * 1024 * 1024 }
|
|
2795
|
+
);
|
|
2796
|
+
bodyHtmlCache.set(key, { html: stdout, expires: now + CACHE_TTL_MS2 });
|
|
2797
|
+
return stdout;
|
|
2798
|
+
}
|
|
2799
|
+
async function githubAttachment(req, res) {
|
|
2800
|
+
const params = new URL(req.url ?? "/", "http://localhost").searchParams;
|
|
2801
|
+
const repo = params.get("repo") ?? "";
|
|
2802
|
+
const pr = params.get("pr") ?? "";
|
|
2803
|
+
const asset = params.get("asset") ?? "";
|
|
2804
|
+
if (!REPO.test(repo) || !PR.test(pr) || !isAttachmentAssetId(asset)) {
|
|
2805
|
+
respondJson(res, 400, { error: "Invalid repo, pr or asset" });
|
|
2806
|
+
return;
|
|
2807
|
+
}
|
|
2808
|
+
try {
|
|
2809
|
+
const signed = signedAttachmentUrl(await prBodyHtml(repo, pr), asset);
|
|
2810
|
+
res.writeHead(302, {
|
|
2811
|
+
Location: signed ?? `https://github.com/user-attachments/assets/${asset}`,
|
|
2812
|
+
"Cache-Control": "no-store"
|
|
2813
|
+
});
|
|
2814
|
+
res.end();
|
|
2815
|
+
} catch (error) {
|
|
2816
|
+
respondJson(res, 502, { error: ghFailure(error) });
|
|
2817
|
+
}
|
|
2818
|
+
}
|
|
2819
|
+
|
|
2820
|
+
// src/commands/sessions/web/githubFileContent.ts
|
|
2821
|
+
import { execFile as execFile5 } from "child_process";
|
|
2822
|
+
import { promisify as promisify5 } from "util";
|
|
2823
|
+
var execFileAsync5 = promisify5(execFile5);
|
|
2824
|
+
var MAX_FILE_BYTES2 = 2 * 1024 * 1024;
|
|
2825
|
+
var REPO2 = /^[\w.-]+\/[\w.-]+$/;
|
|
2757
2826
|
var SHA = /^[0-9a-f]{7,40}$/i;
|
|
2758
2827
|
function validPath(path7) {
|
|
2759
2828
|
return path7.length > 0 && !path7.startsWith("/") && path7.split("/").every((part) => part !== "" && part !== "..");
|
|
@@ -2763,13 +2832,13 @@ async function githubFileContent(req, res) {
|
|
|
2763
2832
|
const repo = params.get("repo") ?? "";
|
|
2764
2833
|
const sha = params.get("sha") ?? "";
|
|
2765
2834
|
const path7 = params.get("path") ?? "";
|
|
2766
|
-
if (!
|
|
2835
|
+
if (!REPO2.test(repo) || !SHA.test(sha) || !validPath(path7)) {
|
|
2767
2836
|
respondJson(res, 400, { error: "Invalid repo, sha or path" });
|
|
2768
2837
|
return;
|
|
2769
2838
|
}
|
|
2770
2839
|
const encodedPath = path7.split("/").map(encodeURIComponent).join("/");
|
|
2771
2840
|
try {
|
|
2772
|
-
const { stdout } = await
|
|
2841
|
+
const { stdout } = await execFileAsync5(
|
|
2773
2842
|
"gh",
|
|
2774
2843
|
[
|
|
2775
2844
|
"api",
|
|
@@ -2796,7 +2865,7 @@ function githubUrl(req, res) {
|
|
|
2796
2865
|
}
|
|
2797
2866
|
|
|
2798
2867
|
// src/commands/sessions/web/gitBranchInfo.ts
|
|
2799
|
-
var
|
|
2868
|
+
var CACHE_TTL_MS3 = 3e4;
|
|
2800
2869
|
var EMPTY = {
|
|
2801
2870
|
branch: null,
|
|
2802
2871
|
defaultBranch: null,
|
|
@@ -2833,7 +2902,7 @@ async function gitBranchInfo(cwd) {
|
|
|
2833
2902
|
} catch {
|
|
2834
2903
|
value = EMPTY;
|
|
2835
2904
|
}
|
|
2836
|
-
cache2.set(cwd, { value, expires: now +
|
|
2905
|
+
cache2.set(cwd, { value, expires: now + CACHE_TTL_MS3 });
|
|
2837
2906
|
return value;
|
|
2838
2907
|
}
|
|
2839
2908
|
|
|
@@ -3645,13 +3714,13 @@ function linkRefKey({ owner, repo, number }) {
|
|
|
3645
3714
|
}
|
|
3646
3715
|
|
|
3647
3716
|
// src/commands/sessions/web/linkStatus/linkStateCache.ts
|
|
3648
|
-
var
|
|
3717
|
+
var CACHE_TTL_MS4 = 5 * 6e4;
|
|
3649
3718
|
var entries = /* @__PURE__ */ new Map();
|
|
3650
3719
|
var linkStateCache = {
|
|
3651
3720
|
get(key) {
|
|
3652
3721
|
const hit = entries.get(key);
|
|
3653
3722
|
if (!hit) return void 0;
|
|
3654
|
-
if (Date.now() - hit.at <
|
|
3723
|
+
if (Date.now() - hit.at < CACHE_TTL_MS4) return hit.state;
|
|
3655
3724
|
entries.delete(key);
|
|
3656
3725
|
return void 0;
|
|
3657
3726
|
},
|
|
@@ -3682,7 +3751,7 @@ async function fetchLinkStateChunks(refs, query) {
|
|
|
3682
3751
|
}
|
|
3683
3752
|
|
|
3684
3753
|
// src/commands/sessions/web/linkStatus/queryLinkStates.ts
|
|
3685
|
-
import { execFile as
|
|
3754
|
+
import { execFile as execFile6 } from "child_process";
|
|
3686
3755
|
|
|
3687
3756
|
// src/commands/sessions/web/linkStatus/linkItemState.ts
|
|
3688
3757
|
function issueState({ state, stateReason }) {
|
|
@@ -3724,7 +3793,7 @@ function linkStatusQuery(refs) {
|
|
|
3724
3793
|
// src/commands/sessions/web/linkStatus/queryLinkStates.ts
|
|
3725
3794
|
function runGraphql(input) {
|
|
3726
3795
|
return new Promise((resolve3, reject) => {
|
|
3727
|
-
const child2 =
|
|
3796
|
+
const child2 = execFile6(
|
|
3728
3797
|
"gh",
|
|
3729
3798
|
["api", "graphql", "--input", "-"],
|
|
3730
3799
|
{ encoding: "utf8", windowsHide: true, maxBuffer: 16 * 1024 * 1024 },
|
|
@@ -3842,7 +3911,7 @@ function rankFilePaths(paths, query, limit) {
|
|
|
3842
3911
|
|
|
3843
3912
|
// src/commands/sessions/web/listFiles.ts
|
|
3844
3913
|
var MAX_RESULTS = 20;
|
|
3845
|
-
var
|
|
3914
|
+
var CACHE_TTL_MS5 = 5e3;
|
|
3846
3915
|
var LS_FILES_MAX_BUFFER = 32 * 1024 * 1024;
|
|
3847
3916
|
var fileListCache = /* @__PURE__ */ new Map();
|
|
3848
3917
|
async function repoFiles(cwd) {
|
|
@@ -3854,7 +3923,7 @@ async function repoFiles(cwd) {
|
|
|
3854
3923
|
{ maxBuffer: LS_FILES_MAX_BUFFER }
|
|
3855
3924
|
);
|
|
3856
3925
|
const files = [...new Set(output.split(/\r?\n/).filter(Boolean))];
|
|
3857
|
-
fileListCache.set(cwd, { files, expires: Date.now() +
|
|
3926
|
+
fileListCache.set(cwd, { files, expires: Date.now() + CACHE_TTL_MS5 });
|
|
3858
3927
|
return files;
|
|
3859
3928
|
}
|
|
3860
3929
|
async function listFiles(req, res) {
|
|
@@ -3979,7 +4048,7 @@ async function fetchFeeds(urls, onProgress) {
|
|
|
3979
4048
|
}
|
|
3980
4049
|
|
|
3981
4050
|
// src/commands/sessions/web/listNewsItems.ts
|
|
3982
|
-
var
|
|
4051
|
+
var CACHE_TTL_MS6 = 15 * 6e4;
|
|
3983
4052
|
var cache3;
|
|
3984
4053
|
async function listNewsItems(_req, res) {
|
|
3985
4054
|
const { orm } = await getReady();
|
|
@@ -3988,7 +4057,7 @@ async function listNewsItems(_req, res) {
|
|
|
3988
4057
|
const now = Date.now();
|
|
3989
4058
|
if (!cache3 || cache3.feedsKey !== feedsKey || cache3.expires <= now) {
|
|
3990
4059
|
const items2 = fetchFeeds(urls);
|
|
3991
|
-
cache3 = { feedsKey, expires: now +
|
|
4060
|
+
cache3 = { feedsKey, expires: now + CACHE_TTL_MS6, items: items2 };
|
|
3992
4061
|
items2.catch(() => {
|
|
3993
4062
|
if (cache3?.items === items2) cache3 = void 0;
|
|
3994
4063
|
});
|
|
@@ -4003,10 +4072,10 @@ function newsNavConfig(_req, res) {
|
|
|
4003
4072
|
}
|
|
4004
4073
|
|
|
4005
4074
|
// src/commands/sessions/web/releases/ghJson.ts
|
|
4006
|
-
import { execFile as
|
|
4007
|
-
import { promisify as
|
|
4008
|
-
var
|
|
4009
|
-
var
|
|
4075
|
+
import { execFile as execFile7 } from "child_process";
|
|
4076
|
+
import { promisify as promisify6 } from "util";
|
|
4077
|
+
var execFileAsync6 = promisify6(execFile7);
|
|
4078
|
+
var CACHE_TTL_MS7 = 3e4;
|
|
4010
4079
|
var cache4 = /* @__PURE__ */ new Map();
|
|
4011
4080
|
function partialGraphqlData(error) {
|
|
4012
4081
|
const stdout = error.stdout;
|
|
@@ -4020,7 +4089,7 @@ function partialGraphqlData(error) {
|
|
|
4020
4089
|
}
|
|
4021
4090
|
async function runGh(cwd, args) {
|
|
4022
4091
|
try {
|
|
4023
|
-
const { stdout } = await
|
|
4092
|
+
const { stdout } = await execFileAsync6("gh", args, {
|
|
4024
4093
|
encoding: "utf8",
|
|
4025
4094
|
windowsHide: true,
|
|
4026
4095
|
cwd,
|
|
@@ -4036,7 +4105,7 @@ async function runGh(cwd, args) {
|
|
|
4036
4105
|
function ghJson(cwd, args) {
|
|
4037
4106
|
const key = [cwd, ...args].join("\0");
|
|
4038
4107
|
const hit = cache4.get(key);
|
|
4039
|
-
if (hit && Date.now() - hit.at <
|
|
4108
|
+
if (hit && Date.now() - hit.at < CACHE_TTL_MS7)
|
|
4040
4109
|
return hit.result;
|
|
4041
4110
|
const result = runGh(cwd, args);
|
|
4042
4111
|
cache4.set(key, { at: Date.now(), result });
|
|
@@ -5456,8 +5525,8 @@ function listUsageJobs(req, res) {
|
|
|
5456
5525
|
|
|
5457
5526
|
// src/commands/sessions/web/openInCode.ts
|
|
5458
5527
|
import { exec } from "child_process";
|
|
5459
|
-
import { promisify as
|
|
5460
|
-
var execAsync =
|
|
5528
|
+
import { promisify as promisify7 } from "util";
|
|
5529
|
+
var execAsync = promisify7(exec);
|
|
5461
5530
|
async function openInCode(req, res) {
|
|
5462
5531
|
const cwd = getCwdParam(req, res);
|
|
5463
5532
|
if (!cwd) return;
|
|
@@ -5473,10 +5542,10 @@ async function openInCode(req, res) {
|
|
|
5473
5542
|
}
|
|
5474
5543
|
|
|
5475
5544
|
// src/commands/sessions/web/createCachedGhJson.ts
|
|
5476
|
-
import { execFile as
|
|
5477
|
-
import { promisify as
|
|
5478
|
-
var
|
|
5479
|
-
var
|
|
5545
|
+
import { execFile as execFile8 } from "child_process";
|
|
5546
|
+
import { promisify as promisify8 } from "util";
|
|
5547
|
+
var execFileAsync7 = promisify8(execFile8);
|
|
5548
|
+
var CACHE_TTL_MS8 = 3e4;
|
|
5480
5549
|
function createCachedGhJson(args, parse, fallback, options = {}) {
|
|
5481
5550
|
const { cacheFallback = true } = options;
|
|
5482
5551
|
const cache5 = /* @__PURE__ */ new Map();
|
|
@@ -5487,7 +5556,7 @@ function createCachedGhJson(args, parse, fallback, options = {}) {
|
|
|
5487
5556
|
if (cached2 && cached2.expires > now) return cached2.value;
|
|
5488
5557
|
let value = fallback;
|
|
5489
5558
|
try {
|
|
5490
|
-
const { stdout } = await
|
|
5559
|
+
const { stdout } = await execFileAsync7("gh", [...args, ...extraArgs], {
|
|
5491
5560
|
encoding: "utf8",
|
|
5492
5561
|
windowsHide: true,
|
|
5493
5562
|
cwd
|
|
@@ -5497,7 +5566,7 @@ function createCachedGhJson(args, parse, fallback, options = {}) {
|
|
|
5497
5566
|
value = fallback;
|
|
5498
5567
|
}
|
|
5499
5568
|
if (cacheFallback || value !== fallback)
|
|
5500
|
-
cache5.set(key, { value, expires: now +
|
|
5569
|
+
cache5.set(key, { value, expires: now + CACHE_TTL_MS8 });
|
|
5501
5570
|
return value;
|
|
5502
5571
|
};
|
|
5503
5572
|
}
|
|
@@ -5556,12 +5625,12 @@ async function previewImage(req, res) {
|
|
|
5556
5625
|
}
|
|
5557
5626
|
|
|
5558
5627
|
// src/commands/sessions/web/getCurrentBranch.ts
|
|
5559
|
-
import { execFile as
|
|
5560
|
-
import { promisify as
|
|
5561
|
-
var
|
|
5628
|
+
import { execFile as execFile9 } from "child_process";
|
|
5629
|
+
import { promisify as promisify9 } from "util";
|
|
5630
|
+
var execFileAsync8 = promisify9(execFile9);
|
|
5562
5631
|
async function getCurrentBranch(cwd) {
|
|
5563
5632
|
try {
|
|
5564
|
-
const { stdout } = await
|
|
5633
|
+
const { stdout } = await execFileAsync8(
|
|
5565
5634
|
"git",
|
|
5566
5635
|
["rev-parse", "--abbrev-ref", "HEAD"],
|
|
5567
5636
|
{ encoding: "utf8", windowsHide: true, cwd }
|
|
@@ -7176,11 +7245,11 @@ async function uploadPrImage(req, res) {
|
|
|
7176
7245
|
import { readFile as readFile2, stat as stat3, writeFile } from "fs/promises";
|
|
7177
7246
|
|
|
7178
7247
|
// src/commands/sessions/web/formatWithOxfmt.ts
|
|
7179
|
-
import { execFile as
|
|
7248
|
+
import { execFile as execFile10 } from "child_process";
|
|
7180
7249
|
import { existsSync as existsSync7 } from "fs";
|
|
7181
7250
|
import { dirname as dirname2, join as join7 } from "path";
|
|
7182
|
-
import { promisify as
|
|
7183
|
-
var
|
|
7251
|
+
import { promisify as promisify10 } from "util";
|
|
7252
|
+
var execFileAsync9 = promisify10(execFile10);
|
|
7184
7253
|
var TIMEOUT_MS = 15e3;
|
|
7185
7254
|
function findOxfmtScript(root) {
|
|
7186
7255
|
let dir = root;
|
|
@@ -7195,7 +7264,7 @@ function findOxfmtScript(root) {
|
|
|
7195
7264
|
async function formatWithOxfmt(target, root) {
|
|
7196
7265
|
const script = findOxfmtScript(root);
|
|
7197
7266
|
if (!script) return;
|
|
7198
|
-
await
|
|
7267
|
+
await execFileAsync9(process.execPath, [script, target], {
|
|
7199
7268
|
cwd: root,
|
|
7200
7269
|
windowsHide: true,
|
|
7201
7270
|
timeout: TIMEOUT_MS
|
|
@@ -7387,6 +7456,7 @@ var routes2 = {
|
|
|
7387
7456
|
"POST /api/self-update": selfUpdate,
|
|
7388
7457
|
"GET /api/github-url": githubUrl,
|
|
7389
7458
|
"GET /api/github-file": githubFileContent,
|
|
7459
|
+
"GET /api/github-attachment": githubAttachment,
|
|
7390
7460
|
"GET /api/git-status": gitStatus,
|
|
7391
7461
|
"GET /api/diff": diff,
|
|
7392
7462
|
"GET /api/diff-scopes": diffScopes,
|