pi-lens 4.4.5 → 4.4.6
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/CHANGELOG.md +37 -0
- package/README.md +32 -0
- package/config/biome/core.jsonc +3 -3
- package/dist/{chunk-K2GUZ4DN.js → chunk-2DDDCJDL.js} +4 -4
- package/dist/{chunk-DS2USX5G.js → chunk-2DMLM3ZO.js} +11 -11
- package/dist/chunk-2F47TQOA.js +73 -0
- package/dist/{chunk-YXDCRUKQ.js → chunk-2PHMIAKO.js} +4 -4
- package/dist/{chunk-PP2A5V2T.js → chunk-2RLWJO5K.js} +7 -7
- package/dist/{chunk-T4NGVFYI.js → chunk-2X4VLOCC.js} +2 -2
- package/dist/{chunk-QT66NEYN.js → chunk-3MYEA7QD.js} +3 -3
- package/dist/{chunk-7ZS7MC24.js → chunk-3WEPUD2V.js} +22 -22
- package/dist/{chunk-TL2TCJYL.js → chunk-4AVZ3TG7.js} +14 -14
- package/dist/{chunk-SNEUMLM7.js → chunk-4PCQCU47.js} +4 -4
- package/dist/chunk-4WX4CTUE.js +57 -0
- package/dist/{chunk-5LRUKYFA.js → chunk-5APMQ2IJ.js} +2 -2
- package/dist/{chunk-4U7GDSZQ.js → chunk-5CV5ITZF.js} +2 -2
- package/dist/{chunk-VUAVE3QC.js → chunk-5ZR3APIM.js} +36 -36
- package/dist/{chunk-CPZ5JJW6.js → chunk-63RIVFQI.js} +4 -4
- package/dist/{chunk-EDMLIW6W.js → chunk-75SY4F24.js} +12 -12
- package/dist/{chunk-RCHO5W7M.js → chunk-7RQXA5GG.js} +6 -6
- package/dist/{chunk-XHDBJODR.js → chunk-A3YNG5KP.js} +21 -21
- package/dist/{chunk-3WCEHYOI.js → chunk-AE37FEGH.js} +1 -1
- package/dist/{chunk-KPVLQHCZ.js → chunk-AMXIUN2R.js} +2 -2
- package/dist/{chunk-XI34NWDI.js → chunk-ARD426WI.js} +1 -1
- package/dist/{chunk-RG3MXTRI.js → chunk-BHUWL2Y3.js} +7 -7
- package/dist/{chunk-4ODSZ35Z.js → chunk-BI5LAQ3Y.js} +44 -44
- package/dist/{chunk-Q42LJANT.js → chunk-BM5GS6ZH.js} +2 -2
- package/dist/{chunk-CG5V25HX.js → chunk-BWYQUPOS.js} +1 -1
- package/dist/{chunk-HYVXA3BB.js → chunk-CFRQMBGP.js} +23 -23
- package/dist/{chunk-NLIVE7L6.js → chunk-CJYKEW2L.js} +1 -1
- package/dist/{chunk-MEFLGBCS.js → chunk-DC4CFXM5.js} +3 -3
- package/dist/{chunk-ASRAO7KG.js → chunk-DMSLNKF7.js} +27 -27
- package/dist/{chunk-YSDPVDFC.js → chunk-DQXSPYRI.js} +3 -3
- package/dist/{chunk-YKVDBNPO.js → chunk-EVDGNG4F.js} +3 -3
- package/dist/{chunk-2LDMXL2M.js → chunk-F5Z6URKM.js} +2 -2
- package/dist/{chunk-72J27ICO.js → chunk-F6X3YJWD.js} +2 -2
- package/dist/{chunk-YXGRRORB.js → chunk-FA5LDARD.js} +13 -13
- package/dist/{chunk-OMJ3OFBJ.js → chunk-FFL3A2VP.js} +6 -6
- package/dist/chunk-FJIVKLPH.js +31 -0
- package/dist/chunk-G2B7F6ZU.js +88 -0
- package/dist/{chunk-YWWG4AQA.js → chunk-GAACZY6R.js} +24 -25
- package/dist/{chunk-F7BO6FWH.js → chunk-GMTFDAOK.js} +11 -11
- package/dist/{chunk-UVY4TOJH.js → chunk-GNSIWBAT.js} +3 -3
- package/dist/chunk-GTAI2J6U.js +27 -0
- package/dist/{chunk-SJHC3BCZ.js → chunk-GZE7WOI4.js} +98 -111
- package/dist/{chunk-ZAPSUBLU.js → chunk-H7HTEQUZ.js} +7 -7
- package/dist/{chunk-ZPJM7DID.js → chunk-HK6JVFZC.js} +3 -3
- package/dist/chunk-IPDG45G5.js +26 -0
- package/dist/{chunk-ZSUX7KEM.js → chunk-J6JP25XU.js} +2 -2
- package/dist/{chunk-6XSESGWD.js → chunk-JL6CXUMW.js} +2 -2
- package/dist/{chunk-Y5KTA2OB.js → chunk-K2YGBXOA.js} +2 -2
- package/dist/{chunk-AHWA4AKM.js → chunk-KLQVC3XC.js} +4 -4
- package/dist/{chunk-27VWVB23.js → chunk-KSR7RGQY.js} +10 -10
- package/dist/{chunk-N3PLNNCW.js → chunk-KXF5R4UN.js} +1 -1
- package/dist/{chunk-GLW3YDZZ.js → chunk-LEJOJDXL.js} +9 -9
- package/dist/{chunk-Y2TPADJR.js → chunk-MA77RSFN.js} +9 -9
- package/dist/{chunk-IL7K66ZQ.js → chunk-MKVZQUEG.js} +15 -15
- package/dist/{chunk-EIKRZ32J.js → chunk-MN7MHUXQ.js} +2 -2
- package/dist/{chunk-4FHUGDKU.js → chunk-MT6BVNFW.js} +5 -5
- package/dist/{chunk-3SNDVPOR.js → chunk-NDMCVUYK.js} +8 -8
- package/dist/{chunk-63NMUNYP.js → chunk-NIU2IPC5.js} +6 -6
- package/dist/{chunk-APFJKOP6.js → chunk-NNKXDXXS.js} +2 -2
- package/dist/{chunk-FEDWAYDS.js → chunk-OJLTLYHB.js} +12 -12
- package/dist/{chunk-KJJAVH3X.js → chunk-OLAWH5UQ.js} +5 -5
- package/dist/{chunk-G224FADB.js → chunk-OOU2WZZE.js} +1 -1
- package/dist/{chunk-NFNVDDGB.js → chunk-OSTKYB55.js} +1 -1
- package/dist/chunk-P4QNXS6I.js +27 -0
- package/dist/{chunk-7IYC4ENJ.js → chunk-PKES3ISE.js} +2 -2
- package/dist/{chunk-UCVMSOXF.js → chunk-PO45POGF.js} +2 -2
- package/dist/{chunk-JWOVP5BL.js → chunk-PPIBVH4R.js} +6 -6
- package/dist/{chunk-EWXXLS26.js → chunk-PQJFG24Z.js} +82 -12
- package/dist/{chunk-TPYYEDP5.js → chunk-Q3UZHW6N.js} +45 -22
- package/dist/{chunk-5DKE4HGX.js → chunk-Q4EMRFNA.js} +34 -34
- package/dist/{chunk-XHLK33VM.js → chunk-Q4FCYCRE.js} +16 -16
- package/dist/chunk-Q6D6VMI4.js +22 -0
- package/dist/{chunk-Q4BKKOVC.js → chunk-QGSTQH4D.js} +8 -8
- package/dist/{chunk-GYRZ72R4.js → chunk-RZOXUSPC.js} +2 -2
- package/dist/{chunk-EN5AM7PX.js → chunk-S67UJDGQ.js} +10 -10
- package/dist/{chunk-YWNO5Q4R.js → chunk-SCIUNBPF.js} +17 -17
- package/dist/{chunk-VIDEKABZ.js → chunk-SJJYRZB4.js} +2 -2
- package/dist/chunk-SXGD4ANG.js +25 -0
- package/dist/{chunk-THEXI2QO.js → chunk-T7FTXGS3.js} +42 -42
- package/dist/{chunk-WUY4BZEP.js → chunk-TIQJPRDD.js} +106 -50
- package/dist/{chunk-EXVXBSGN.js → chunk-TIYGSODX.js} +17 -17
- package/dist/{chunk-2FYKETQJ.js → chunk-U2SDMG7C.js} +5 -5
- package/dist/{chunk-PJXNTPB2.js → chunk-U6OC3QEM.js} +21 -21
- package/dist/{chunk-LMCTHJ2H.js → chunk-UCGQT677.js} +18 -18
- package/dist/{chunk-UL5SXQVX.js → chunk-UHGF5UT5.js} +1 -1
- package/dist/{chunk-AI3GP74G.js → chunk-UN4TEBWN.js} +15 -15
- package/dist/{chunk-2SDHYHHO.js → chunk-V3APN3DY.js} +13 -13
- package/dist/{chunk-7FLRUH6B.js → chunk-V63BC55Q.js} +1 -1
- package/dist/{chunk-S55TEC7I.js → chunk-VG5JS5SW.js} +2 -2
- package/dist/{chunk-IEBJF3PN.js → chunk-VPBIMOAQ.js} +11 -11
- package/dist/{chunk-EX4EXBW7.js → chunk-VQH24FIP.js} +15 -15
- package/dist/{chunk-TVZRLTG6.js → chunk-VSFLRN5Y.js} +1 -1
- package/dist/{chunk-KCBRHV5E.js → chunk-W2V54OCL.js} +3 -3
- package/dist/{chunk-VITFDI3O.js → chunk-W5LGKNET.js} +12 -12
- package/dist/{chunk-OZNCKLOX.js → chunk-W5R5SABV.js} +12 -12
- package/dist/{chunk-ELZRSR5N.js → chunk-WIZWZR4C.js} +38 -38
- package/dist/{chunk-MKPCELNI.js → chunk-WQOIR3QY.js} +13 -13
- package/dist/{chunk-COOUUC5W.js → chunk-XAIT2YGS.js} +6 -6
- package/dist/chunk-XCUHKYCQ.js +23 -0
- package/dist/{chunk-KFXCL4OV.js → chunk-XQCSWV2G.js} +22 -23
- package/dist/{chunk-RU34BA4D.js → chunk-YBSONGSZ.js} +34 -34
- package/dist/{chunk-GTDSYEA2.js → chunk-YISME6ON.js} +1 -1
- package/dist/chunk-YRD4ISED.js +30 -0
- package/dist/{chunk-X3UTCXAA.js → chunk-YSBHPOY6.js} +12 -12
- package/dist/{chunk-XWFIHYCH.js → chunk-Z2XAOKHK.js} +2 -2
- package/dist/{chunk-K4SZB56V.js → chunk-Z7IGUAXL.js} +7 -7
- package/dist/{chunk-KX56K73G.js → chunk-ZKXQKGWZ.js} +2 -2
- package/dist/{chunk-FWZRGGGY.js → chunk-ZQ6NZZTB.js} +6 -4
- package/dist/{chunk-2Y6OJRSI.js → chunk-ZUUI3ZSA.js} +3 -3
- package/dist/{chunk-UO66IMVP.js → chunk-ZYNI26MI.js} +2 -2
- package/dist/index.js +571 -409
- package/dist/mcp/analyze-cli.js +10 -10
- package/dist/mcp/cli.js +42 -42
- package/dist/mcp/server.js +108 -108
- package/dist/mcp/worker.js +61 -61
- package/dist/probes/installer.js +19 -19
- package/docs/agent-tools.md +28 -7
- package/docs/configuration.md +3 -1
- package/docs/defect-shapes.md +738 -0
- package/docs/invariants/caches-stores.md +30 -0
- package/docs/invariants/dispatch-runners.md +164 -0
- package/docs/invariants/git-guard-host.md +53 -0
- package/docs/invariants/language-config.md +31 -0
- package/docs/invariants/lsp-trust-exec.md +286 -0
- package/docs/invariants/paths-os.md +59 -0
- package/docs/invariants/session-telemetry.md +74 -0
- package/docs/pi-lens-fixer.md +2 -1
- package/docs/pi-lens-merge-policy.md +10 -8
- package/docs/pi-lens-monitor.md +2 -2
- package/docs/pi-lens-orchestration.md +41 -0
- package/docs/pi-lens-release.md +20 -0
- package/docs/pi-lens-retro.md +3 -2
- package/docs/pi-lens-reviewer.md +6 -6
- package/docs/pi-lens-subagent.md +2 -2
- package/package.json +3 -2
- package/dist/chunk-22Y2BM7H.js +0 -23
- package/dist/chunk-44X7VIKR.js +0 -73
- package/dist/chunk-54NIOJJZ.js +0 -25
- package/dist/chunk-7WWQAW5P.js +0 -30
- package/dist/chunk-EA2ZRG44.js +0 -27
- package/dist/chunk-EKNWOL2I.js +0 -27
- package/dist/chunk-G5UCJFT7.js +0 -26
- package/dist/chunk-N5FBM25N.js +0 -22
- package/dist/chunk-P5XUGPIX.js +0 -31
- package/dist/chunk-PKOXJIVT.js +0 -88
- package/dist/chunk-RG7OODGM.js +0 -57
package/dist/index.js
CHANGED
|
@@ -2176,6 +2176,7 @@ var init_minimatch = __esm({
|
|
|
2176
2176
|
|
|
2177
2177
|
// dist/clients/path-utils.js
|
|
2178
2178
|
import { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
|
|
2179
|
+
import { lstat as lstatAsync, realpath as realpathNativeAsync } from "node:fs/promises";
|
|
2179
2180
|
import * as os from "node:os";
|
|
2180
2181
|
import * as path2 from "node:path";
|
|
2181
2182
|
import { win32 } from "node:path";
|
|
@@ -2276,24 +2277,54 @@ function getPathIdentityFallbacks() {
|
|
|
2276
2277
|
function resetPathIdentityFallbacks() {
|
|
2277
2278
|
pathIdentityFallbacks.clear();
|
|
2278
2279
|
}
|
|
2279
|
-
function
|
|
2280
|
+
function* identityCandidates(spelled, p) {
|
|
2280
2281
|
let current = spelled;
|
|
2281
|
-
const
|
|
2282
|
+
const missing = [];
|
|
2282
2283
|
for (; ; ) {
|
|
2284
|
+
yield { candidate: current, missing };
|
|
2285
|
+
const parent = p.dirname(current);
|
|
2286
|
+
if (parent === current)
|
|
2287
|
+
return;
|
|
2288
|
+
missing.push(p.basename(current));
|
|
2289
|
+
current = parent;
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2292
|
+
function recordIdentityRefusal(refusal, candidate) {
|
|
2293
|
+
if (isAbsenceRefusal(refusal))
|
|
2294
|
+
return;
|
|
2295
|
+
recordPathIdentityFallback(refusal?.code ?? "unknown", candidate);
|
|
2296
|
+
}
|
|
2297
|
+
function isAbsenceRefusal(refusal) {
|
|
2298
|
+
const code = refusal?.code;
|
|
2299
|
+
return code === "ENOENT" || code === "ENOTDIR";
|
|
2300
|
+
}
|
|
2301
|
+
function foldMissingTail(real, missing, p) {
|
|
2302
|
+
return missing.length === 0 ? real : p.join(real, ...missing.reverse());
|
|
2303
|
+
}
|
|
2304
|
+
function tailHasDotSegment(missing) {
|
|
2305
|
+
return missing.some((segment) => segment === "." || segment === "..");
|
|
2306
|
+
}
|
|
2307
|
+
function kernelAttempt(spelled, p) {
|
|
2308
|
+
for (const { candidate, missing } of identityCandidates(spelled, p)) {
|
|
2283
2309
|
try {
|
|
2284
|
-
const real = realpathSync.native(
|
|
2285
|
-
return
|
|
2310
|
+
const real = realpathSync.native(candidate);
|
|
2311
|
+
return {
|
|
2312
|
+
answer: foldMissingTail(real, missing, p),
|
|
2313
|
+
foldedTail: tailHasDotSegment(missing)
|
|
2314
|
+
};
|
|
2286
2315
|
} catch (refusal) {
|
|
2287
|
-
|
|
2288
|
-
if (code !== "ENOENT" && code !== "ENOTDIR")
|
|
2289
|
-
recordPathIdentityFallback(code ?? "unknown", current);
|
|
2290
|
-
const parent = p.dirname(current);
|
|
2291
|
-
if (parent === current)
|
|
2292
|
-
return void 0;
|
|
2293
|
-
tail.push(p.basename(current));
|
|
2294
|
-
current = parent;
|
|
2316
|
+
recordIdentityRefusal(refusal, candidate);
|
|
2295
2317
|
}
|
|
2296
2318
|
}
|
|
2319
|
+
return void 0;
|
|
2320
|
+
}
|
|
2321
|
+
function kernelRealPath(spelled, p) {
|
|
2322
|
+
const first = kernelAttempt(spelled, p);
|
|
2323
|
+
if (!first)
|
|
2324
|
+
return void 0;
|
|
2325
|
+
if (!first.foldedTail)
|
|
2326
|
+
return first.answer;
|
|
2327
|
+
return kernelAttempt(first.answer, p)?.answer ?? first.answer;
|
|
2297
2328
|
}
|
|
2298
2329
|
function posixPathIdentity(spelled) {
|
|
2299
2330
|
return kernelRealPath(spelled, path2.posix) ?? path2.posix.normalize(spelled);
|
|
@@ -2301,6 +2332,43 @@ function posixPathIdentity(spelled) {
|
|
|
2301
2332
|
function realpathOrResolve(filePath) {
|
|
2302
2333
|
return kernelRealPath(filePath, path2) ?? path2.resolve(filePath);
|
|
2303
2334
|
}
|
|
2335
|
+
async function realpathOrResolveAsync(filePath) {
|
|
2336
|
+
return (await kernelPathIdentityAsync(filePath))?.identity ?? path2.resolve(filePath);
|
|
2337
|
+
}
|
|
2338
|
+
async function kernelAttemptAsync(spelled) {
|
|
2339
|
+
let kernelConfirmed = true;
|
|
2340
|
+
for (const { candidate, missing } of identityCandidates(spelled, path2)) {
|
|
2341
|
+
try {
|
|
2342
|
+
const real = await realpathNativeAsync(candidate);
|
|
2343
|
+
return {
|
|
2344
|
+
answer: foldMissingTail(real, missing, path2),
|
|
2345
|
+
foldedTail: tailHasDotSegment(missing),
|
|
2346
|
+
kernelConfirmed
|
|
2347
|
+
};
|
|
2348
|
+
} catch (refusal) {
|
|
2349
|
+
recordIdentityRefusal(refusal, candidate);
|
|
2350
|
+
if (!isAbsenceRefusal(refusal))
|
|
2351
|
+
kernelConfirmed = false;
|
|
2352
|
+
else if (!await lstatAsync(candidate).then(() => false, (lstatRefusal) => {
|
|
2353
|
+
return isAbsenceRefusal(lstatRefusal);
|
|
2354
|
+
})) {
|
|
2355
|
+
recordPathIdentityFallback("ENOENT-DANGLING", candidate);
|
|
2356
|
+
kernelConfirmed = false;
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
}
|
|
2360
|
+
return void 0;
|
|
2361
|
+
}
|
|
2362
|
+
async function kernelPathIdentityAsync(filePath) {
|
|
2363
|
+
const first = await kernelAttemptAsync(filePath);
|
|
2364
|
+
if (!first)
|
|
2365
|
+
return void 0;
|
|
2366
|
+
const settled = first.foldedTail ? await kernelAttemptAsync(first.answer) : void 0;
|
|
2367
|
+
return {
|
|
2368
|
+
identity: settled?.answer ?? first.answer,
|
|
2369
|
+
kernelConfirmed: first.kernelConfirmed && (settled?.kernelConfirmed ?? true)
|
|
2370
|
+
};
|
|
2371
|
+
}
|
|
2304
2372
|
function normalizeLoggedPath(value) {
|
|
2305
2373
|
return isFullyQualifiedWin32(value) || isFullyQualifiedPosix(value) ? normalizeFilePath(value) : value;
|
|
2306
2374
|
}
|
|
@@ -4733,6 +4801,8 @@ var init_degradation_ledger = __esm({
|
|
|
4733
4801
|
MAX_METADATA_KEYS = 8;
|
|
4734
4802
|
INFORMATIONAL_DEGRADATION_KINDS = /* @__PURE__ */ new Set([
|
|
4735
4803
|
"log-sink-rotated",
|
|
4804
|
+
// Project-scoped autofix dedupe is intentional, not a failed fixer (#4862).
|
|
4805
|
+
"deferred-autofix-duplicate-scope",
|
|
4736
4806
|
// #2504 review round 8 (S1): both fire on the ordinary re-edit cadence
|
|
4737
4807
|
// (a carry-forward window closing, or a session boundary) and are
|
|
4738
4808
|
// self-healing -- the next turn's analysis or deferral re-observes the
|
|
@@ -4809,10 +4879,10 @@ function withDeadline(promise, options) {
|
|
|
4809
4879
|
promise.catch(() => {
|
|
4810
4880
|
});
|
|
4811
4881
|
let timer;
|
|
4812
|
-
const timeoutPromise = new Promise((
|
|
4882
|
+
const timeoutPromise = new Promise((resolve153, reject) => {
|
|
4813
4883
|
timer = setTimeout(() => {
|
|
4814
4884
|
if (onTimeout === "undefined")
|
|
4815
|
-
|
|
4885
|
+
resolve153(void 0);
|
|
4816
4886
|
else
|
|
4817
4887
|
reject(new Error(`Timeout after ${ms}ms`));
|
|
4818
4888
|
}, ms);
|
|
@@ -4846,10 +4916,10 @@ async function bounded(promise, options) {
|
|
|
4846
4916
|
let timer;
|
|
4847
4917
|
let onCallerAbort;
|
|
4848
4918
|
let onShutdownAbort;
|
|
4849
|
-
const abandoned = new Promise((
|
|
4919
|
+
const abandoned = new Promise((resolve153) => {
|
|
4850
4920
|
const fire = (reason) => {
|
|
4851
4921
|
cause ??= reason;
|
|
4852
|
-
|
|
4922
|
+
resolve153(BOUND_ABORTED);
|
|
4853
4923
|
};
|
|
4854
4924
|
if (signal?.aborted)
|
|
4855
4925
|
return fire("caller-abort");
|
|
@@ -6302,16 +6372,17 @@ function getBlockValue(input, start, end, indent, chomping, folded) {
|
|
|
6302
6372
|
}
|
|
6303
6373
|
const content = line.slice(textIndent);
|
|
6304
6374
|
const first = content.charCodeAt(0);
|
|
6305
|
-
if (folded)
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
atMoreIndented
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
if (
|
|
6313
|
-
|
|
6314
|
-
|
|
6375
|
+
if (folded) {
|
|
6376
|
+
if (first === 32 || first === 9) {
|
|
6377
|
+
atMoreIndented = true;
|
|
6378
|
+
result += "\n".repeat(didReadContent ? 1 + emptyLines : emptyLines);
|
|
6379
|
+
} else if (atMoreIndented) {
|
|
6380
|
+
atMoreIndented = false;
|
|
6381
|
+
result += "\n".repeat(emptyLines + 1);
|
|
6382
|
+
} else if (emptyLines === 0) {
|
|
6383
|
+
if (didReadContent) result += " ";
|
|
6384
|
+
} else result += "\n".repeat(emptyLines);
|
|
6385
|
+
} else result += "\n".repeat(didReadContent ? 1 + emptyLines : emptyLines);
|
|
6315
6386
|
result += content;
|
|
6316
6387
|
didReadContent = true;
|
|
6317
6388
|
emptyLines = 0;
|
|
@@ -6339,24 +6410,66 @@ function getScalarValue(input, scalar) {
|
|
|
6339
6410
|
return getPlainValue(input, valueStart, valueEnd);
|
|
6340
6411
|
}
|
|
6341
6412
|
}
|
|
6342
|
-
function
|
|
6343
|
-
return
|
|
6413
|
+
function percentByte(byte) {
|
|
6414
|
+
return "%" + HEX[byte >> 4] + HEX[byte & 15];
|
|
6415
|
+
}
|
|
6416
|
+
function tagPercentEncode(source, isSuffix) {
|
|
6417
|
+
const allowed = isSuffix ? TAG_SUFFIX_CHARS : TAG_URI_CHARS;
|
|
6418
|
+
let result = "";
|
|
6419
|
+
for (let index = 0; index < source.length; index++) {
|
|
6420
|
+
let ch = source.charCodeAt(index);
|
|
6421
|
+
if (ch >= 48 && ch <= 57 || ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || allowed.includes(source[index])) {
|
|
6422
|
+
result += source[index];
|
|
6423
|
+
continue;
|
|
6424
|
+
}
|
|
6425
|
+
if (ch >= 55296 && ch <= 56319) ch = 65536 + ((ch & 1023) << 10) + (source.charCodeAt(++index) & 1023);
|
|
6426
|
+
if (ch < 128) result += percentByte(ch);
|
|
6427
|
+
else if (ch < 2048) result += percentByte(192 | ch >> 6) + percentByte(128 | ch & 63);
|
|
6428
|
+
else if (ch < 65536) result += percentByte(224 | ch >> 12) + percentByte(128 | ch >> 6 & 63) + percentByte(128 | ch & 63);
|
|
6429
|
+
else result += percentByte(240 | ch >> 18) + percentByte(128 | ch >> 12 & 63) + percentByte(128 | ch >> 6 & 63) + percentByte(128 | ch & 63);
|
|
6430
|
+
}
|
|
6431
|
+
return result;
|
|
6432
|
+
}
|
|
6433
|
+
function tagPercentDecode(source) {
|
|
6434
|
+
let result = "";
|
|
6435
|
+
let index = 0;
|
|
6436
|
+
while (index < source.length) {
|
|
6437
|
+
if (source.charCodeAt(index) !== 37) {
|
|
6438
|
+
result += source[index++];
|
|
6439
|
+
continue;
|
|
6440
|
+
}
|
|
6441
|
+
let ch = parseInt(source.slice(index + 1, index + 3), 16);
|
|
6442
|
+
index += 3;
|
|
6443
|
+
if (ch >= 192) {
|
|
6444
|
+
let remaining = ch < 224 ? 1 : ch < 240 ? 2 : 3;
|
|
6445
|
+
ch &= (1 << 6 - remaining) - 1;
|
|
6446
|
+
while (remaining-- > 0) {
|
|
6447
|
+
ch = ch << 6 | parseInt(source.slice(index + 1, index + 3), 16) & 63;
|
|
6448
|
+
index += 3;
|
|
6449
|
+
}
|
|
6450
|
+
}
|
|
6451
|
+
if (ch < 65536) result += String.fromCharCode(ch);
|
|
6452
|
+
else {
|
|
6453
|
+
ch -= 65536;
|
|
6454
|
+
result += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023);
|
|
6455
|
+
}
|
|
6456
|
+
}
|
|
6457
|
+
return result;
|
|
6344
6458
|
}
|
|
6345
6459
|
function tagNameFull(rawTag2, tagHandlers) {
|
|
6346
|
-
if (rawTag2.startsWith("!<") && rawTag2.endsWith(">")) return
|
|
6460
|
+
if (rawTag2.startsWith("!<") && rawTag2.endsWith(">")) return tagPercentDecode(rawTag2.slice(2, -1));
|
|
6347
6461
|
const handleEnd = rawTag2.indexOf("!", 1);
|
|
6348
6462
|
const handle = handleEnd === -1 ? "!" : rawTag2.slice(0, handleEnd + 1);
|
|
6349
|
-
|
|
6350
|
-
return decodeURIComponent(prefix) + decodeURIComponent(rawTag2.slice(handle.length));
|
|
6463
|
+
return tagPercentDecode(tagHandlers?.[handle] ?? DEFAULT_TAG_HANDLERS[handle] ?? handle) + tagPercentDecode(rawTag2.slice(handle.length));
|
|
6351
6464
|
}
|
|
6352
6465
|
function tagNameShort(fullTag) {
|
|
6353
6466
|
let tag = fullTag;
|
|
6354
6467
|
if (tag.charCodeAt(0) === 33) {
|
|
6355
6468
|
tag = tag.slice(1);
|
|
6356
|
-
return `!${tagPercentEncode(tag)}`;
|
|
6469
|
+
return `!${tagPercentEncode(tag, true)}`;
|
|
6357
6470
|
}
|
|
6358
|
-
if (tag.slice(0, 18) === "tag:yaml.org,2002:") return `!!${tagPercentEncode(tag.slice(18))}`;
|
|
6359
|
-
return `!<${tagPercentEncode(tag)}>`;
|
|
6471
|
+
if (tag.slice(0, 18) === "tag:yaml.org,2002:") return `!!${tagPercentEncode(tag.slice(18), true)}`;
|
|
6472
|
+
return `!<${tagPercentEncode(tag, false)}>`;
|
|
6360
6473
|
}
|
|
6361
6474
|
function eventPosition$1(event) {
|
|
6362
6475
|
if ("tagStart" in event && event.tagStart !== NO_RANGE$2) return event.tagStart;
|
|
@@ -6792,7 +6905,11 @@ function skipUntilLineEnd(state9) {
|
|
|
6792
6905
|
while (ch !== 0 && !isEol(ch)) ch = state9.input.charCodeAt(++state9.position);
|
|
6793
6906
|
}
|
|
6794
6907
|
function checkPrintable(state9, start, end) {
|
|
6795
|
-
|
|
6908
|
+
const match2 = PATTERN_NON_PRINTABLE.exec(state9.input.slice(start, end));
|
|
6909
|
+
if (match2 !== null) {
|
|
6910
|
+
state9.position = start + match2.index + match2[0].length - 1;
|
|
6911
|
+
throwError(state9, "the stream contains non-printable characters");
|
|
6912
|
+
}
|
|
6796
6913
|
}
|
|
6797
6914
|
function readTagProperty(state9, props, inFlow) {
|
|
6798
6915
|
if (state9.input.charCodeAt(state9.position) !== 33) return false;
|
|
@@ -6819,12 +6936,14 @@ function readTagProperty(state9, props, inFlow) {
|
|
|
6819
6936
|
state9.position++;
|
|
6820
6937
|
} else {
|
|
6821
6938
|
while (ch !== 0 && !isWsOrEol(ch) && !(inFlow && isFlowIndicator(ch))) {
|
|
6822
|
-
if (ch === 33)
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6939
|
+
if (ch === 33) {
|
|
6940
|
+
if (!isNamed) {
|
|
6941
|
+
tagHandle = state9.input.slice(suffixStart - 1, state9.position + 1);
|
|
6942
|
+
if (!PATTERN_TAG_HANDLE.test(tagHandle)) throwError(state9, "named tag handle cannot contain such characters");
|
|
6943
|
+
isNamed = true;
|
|
6944
|
+
suffixStart = state9.position + 1;
|
|
6945
|
+
} else throwError(state9, "tag suffix cannot contain exclamation marks");
|
|
6946
|
+
}
|
|
6828
6947
|
ch = state9.input.charCodeAt(++state9.position);
|
|
6829
6948
|
}
|
|
6830
6949
|
tagName = state9.input.slice(suffixStart, state9.position);
|
|
@@ -7008,7 +7127,7 @@ function readBlockScalar(state9, parentIndent, props) {
|
|
|
7008
7127
|
function canStartPlainScalar(state9, nodeContext) {
|
|
7009
7128
|
const ch = state9.input.charCodeAt(state9.position);
|
|
7010
7129
|
const inFlow = nodeContext === CONTEXT_FLOW_IN;
|
|
7011
|
-
if (ch === 0 || isWsOrEol(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96 ||
|
|
7130
|
+
if (ch === 0 || isWsOrEol(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96 || isFlowIndicator(ch)) return false;
|
|
7012
7131
|
if (ch === 63 || ch === 45) {
|
|
7013
7132
|
const following = state9.input.charCodeAt(state9.position + 1);
|
|
7014
7133
|
if (isWsOrEolOrEnd(following) || inFlow && isFlowIndicator(following)) return false;
|
|
@@ -7280,19 +7399,20 @@ function parseNode(state9, parentIndent, nodeContext, allowToSeek, allowCompact,
|
|
|
7280
7399
|
if (indentStatus === 1 || nodeContext === CONTEXT_BLOCK_OUT) {
|
|
7281
7400
|
const flowIndent = nodeContext === CONTEXT_FLOW_IN || nodeContext === CONTEXT_FLOW_OUT ? parentIndent : parentIndent + 1;
|
|
7282
7401
|
const blockIndent = state9.position - state9.lineStart;
|
|
7283
|
-
if (indentStatus === 1)
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7402
|
+
if (indentStatus === 1) {
|
|
7403
|
+
if (allowBlockCollections && (readBlockSequence(state9, blockIndent, props) || readBlockMapping(state9, blockIndent, flowIndent, props)) || readFlowCollection(state9, flowIndent, props)) hasContent = true;
|
|
7404
|
+
else {
|
|
7405
|
+
const ch = state9.input.charCodeAt(state9.position);
|
|
7406
|
+
if (propertyStart !== null && allowPropertyMapping && allowBlockStyles && !allowBlockCollections && ch !== 124 && ch !== 62) {
|
|
7407
|
+
const fallbackState = snapshotState(state9);
|
|
7408
|
+
const propertyIndent = propertyStart.position - propertyStart.lineStart;
|
|
7409
|
+
restoreState(state9, propertyStart);
|
|
7410
|
+
if (readBlockMapping(state9, propertyIndent, flowIndent, emptyProperties()) && state9.events[fallbackState.eventsLength]?.type === EVENT_ID.MAPPING) hasContent = true;
|
|
7411
|
+
else restoreState(state9, fallbackState);
|
|
7412
|
+
}
|
|
7413
|
+
if (!hasContent && (allowBlockScalars && readBlockScalar(state9, flowIndent, props) || readSingleQuotedScalar(state9, flowIndent, props) || readDoubleQuotedScalar(state9, flowIndent, props) || readAlias(state9, props) || readPlainScalar(state9, flowIndent, nodeContext, props))) hasContent = true;
|
|
7292
7414
|
}
|
|
7293
|
-
|
|
7294
|
-
}
|
|
7295
|
-
else if (indentStatus === 0) hasContent = allowBlockCollections && readBlockSequence(state9, blockIndent, props);
|
|
7415
|
+
} else if (indentStatus === 0) hasContent = allowBlockCollections && readBlockSequence(state9, blockIndent, props);
|
|
7296
7416
|
}
|
|
7297
7417
|
allowBlockScalars = allowBlockScalars && !hasContent;
|
|
7298
7418
|
if (!hasContent && (props.anchorStart !== NO_RANGE$1 || props.tagStart !== NO_RANGE$1 || allowBlockScalars)) {
|
|
@@ -7586,7 +7706,6 @@ function visitNode(node, visitor, ctx) {
|
|
|
7586
7706
|
isKey: false
|
|
7587
7707
|
})) return true;
|
|
7588
7708
|
}
|
|
7589
|
-
break;
|
|
7590
7709
|
}
|
|
7591
7710
|
return false;
|
|
7592
7711
|
}
|
|
@@ -7965,8 +8084,10 @@ function writeBlockMapping(state9, level, node, compact) {
|
|
|
7965
8084
|
const keyHasLineBreak = key4.kind === "scalar" && key4.value.indexOf("\n") !== -1;
|
|
7966
8085
|
const keyIsTooLong = keyText.length > 1024 && /^[\s\S]{1025}/u.test(keyText);
|
|
7967
8086
|
const explicitPair = keyIsBlock || keyHasLineBreak || keyIsTooLong;
|
|
7968
|
-
if (explicitPair)
|
|
7969
|
-
|
|
8087
|
+
if (explicitPair) {
|
|
8088
|
+
if (keyText && CHAR_LINE_FEED === keyText.charCodeAt(0)) pairBuffer += "?";
|
|
8089
|
+
else pairBuffer += "? ";
|
|
8090
|
+
}
|
|
7970
8091
|
pairBuffer += keyText;
|
|
7971
8092
|
if (explicitPair) pairBuffer += generateNextLine(state9, level);
|
|
7972
8093
|
const valueText = writeNode(state9, level + 1, value, node, {
|
|
@@ -8002,12 +8123,15 @@ function writeNode(state9, level, node, parent, ctx) {
|
|
|
8002
8123
|
let body;
|
|
8003
8124
|
let shouldPrintTag = node.tagged;
|
|
8004
8125
|
const useBlockCollection = block && (node.kind === "mapping" || node.kind === "sequence") && node.style === COLLECTION_STYLE.BLOCK && node.items.length !== 0;
|
|
8005
|
-
if (node.kind === "mapping")
|
|
8006
|
-
|
|
8007
|
-
|
|
8008
|
-
else
|
|
8009
|
-
|
|
8010
|
-
|
|
8126
|
+
if (node.kind === "mapping") {
|
|
8127
|
+
if (useBlockCollection) body = writeBlockMapping(state9, level, node, compact);
|
|
8128
|
+
else body = writeFlowMapping(state9, level, node);
|
|
8129
|
+
} else if (node.kind === "sequence") {
|
|
8130
|
+
if (useBlockCollection) {
|
|
8131
|
+
if (state9.seqNoIndent && !isblockseq && level > 0) body = writeBlockSequence(state9, level - 1, node, compact);
|
|
8132
|
+
else body = writeBlockSequence(state9, level, node, compact);
|
|
8133
|
+
} else body = writeFlowSequence(state9, level, node);
|
|
8134
|
+
} else {
|
|
8011
8135
|
const layout = scalarLayout(state9, node, parent, level, iskey, !block);
|
|
8012
8136
|
detectAllowedStyles(layout);
|
|
8013
8137
|
for (const rule of state9.scalarStyleRules) rule(layout);
|
|
@@ -8258,7 +8382,7 @@ function eventsToAst(events, options) {
|
|
|
8258
8382
|
}
|
|
8259
8383
|
return state9.documents;
|
|
8260
8384
|
}
|
|
8261
|
-
var NOT_RESOLVED, strTag, NULL_VALUES$1, nullCoreTag, nullJsonTag, NULL_VALUES, nullYaml11Tag, TRUE_VALUES$2, FALSE_VALUES$2, boolCoreTag, TRUE_VALUES$1, FALSE_VALUES$1, boolJsonTag, TRUE_VALUES, FALSE_VALUES, boolYaml11Tag, YAML_INTEGER_IMPLICIT_PATTERN$1, YAML_INTEGER_EXPLICIT_PATTERN$1, intCoreTag, YAML_INTEGER_IMPLICIT_PATTERN, YAML_INTEGER_EXPLICIT_PATTERN, intJsonTag, YAML_INTEGER_PATTERN, intYaml11Tag, YAML_FLOAT_PATTERN$1, YAML_FLOAT_SPECIAL_PATTERN$1, floatCoreTag, YAML_FLOAT_IMPLICIT_PATTERN, YAML_FLOAT_EXPLICIT_PATTERN, floatJsonTag, YAML_FLOAT_PATTERN, YAML_FLOAT_SPECIAL_PATTERN, floatYaml11Tag, mergeTag, BASE64_PATTERN, binaryTag, YAML_DATE_REGEXP, YAML_TIMESTAMP_REGEXP, timestampTag, seqTag, omapTag, pairsTag, mapTag, setTag, Schema, FAILSAFE_SCHEMA, JSON_SCHEMA, CORE_SCHEMA, YAML11_SCHEMA, DUMP_SCHEMA, realMapTag, legacyMapTag, DEFAULT_SNIPPET_OPTIONS, YAMLException, EVENT_ID, SCALAR_STYLE, COLLECTION_STYLE, CHOMPING_MODE, NO_RANGE$3, simpleEscapeCheck, simpleEscapeMap, DEFAULT_TAG_HANDLERS, NO_RANGE$2, MERGE_TAG_NAME, DEFAULT_CONSTRUCTOR_OPTIONS, NO_RANGE$1, HAS_OWN, CONTEXT_FLOW_IN, CONTEXT_FLOW_OUT, CONTEXT_BLOCK_IN, CONTEXT_BLOCK_OUT, PATTERN_NON_PRINTABLE, PATTERN_FLOW_INDICATORS, PATTERN_TAG_HANDLE, NS_URI_CHAR, NS_TAG_CHAR, PATTERN_TAG_URI, PATTERN_TAG_SUFFIX, PATTERN_TAG_PREFIX, DEFAULT_PARSER_OPTIONS, DEFAULT_LOAD_OPTIONS, INVALID, VISIT_BREAK, VISIT_SKIP, DEFAULT_SCALAR_STYLE_RULES, SRC_C_PRINTABLE, SRC_B_CHAR, SRC_C_BYTE_ORDER_MARK, SRC_S_WHITE, SRC_NB_CHAR, SRC_NS_CHAR, SRC_NB_JSON, SRC_C_INDICATOR, SRC_C_FLOW_INDICATOR, SRC_NS_PLAIN_SAFE_FLOW_OUT, SRC_NS_PLAIN_SAFE_FLOW_IN, SRC_NS_PLAIN_FIRST_FLOW_OUT, SRC_NS_PLAIN_FIRST_FLOW_IN, SRC_NS_PLAIN_CHAR_FLOW_OUT, SRC_NS_PLAIN_CHAR_FLOW_IN, SRC_NB_NS_PLAIN_IN_LINE_FLOW_OUT, SRC_NB_NS_PLAIN_IN_LINE_FLOW_IN, SRC_NS_PLAIN_ONE_LINE_FLOW_OUT, SRC_NS_PLAIN_ONE_LINE_FLOW_IN, SRC_NS_PLAIN_ONE_LINE_BLOCK_KEY, SRC_NS_PLAIN_ONE_LINE_FLOW_KEY, SRC_S_NS_PLAIN_NEXT_LINE_FLOW_OUT, SRC_S_NS_PLAIN_NEXT_LINE_FLOW_IN, SRC_NS_PLAIN_MULTI_LINE_FLOW_OUT, SRC_NS_PLAIN_MULTI_LINE_FLOW_IN, NS_PLAIN_FLOW_OUT, NS_PLAIN_FLOW_IN, NS_PLAIN_BLOCK_KEY, NS_PLAIN_FLOW_KEY, NB_SINGLE_ONE_LINE, NB_SINGLE_MULTI_LINE, BLOCK_SCALAR_CONTENT, C_FORBIDDEN_FIRST_LINE, C_FORBIDDEN_CONTENT, CHARACTERS_TO_ESCAPE, CHAR_LINE_FEED, DEFAULT_PRESENTER_OPTIONS, DEFAULT_DUMP_OPTIONS, NO_RANGE, EVENT_DOCUMENT, EVENT_SEQUENCE, EVENT_MAPPING, EVENT_SCALAR, EVENT_ALIAS, EVENT_POP, SCALAR_STYLE_PLAIN, SCALAR_STYLE_SINGLE_QUOTED, SCALAR_STYLE_DOUBLE_QUOTED, SCALAR_STYLE_LITERAL_BLOCK, SCALAR_STYLE_FOLDED_BLOCK, COLLECTION_STYLE_BLOCK, COLLECTION_STYLE_FLOW, CHOMPING_CLIP, CHOMPING_STRIP, CHOMPING_KEEP;
|
|
8385
|
+
var NOT_RESOLVED, strTag, NULL_VALUES$1, nullCoreTag, nullJsonTag, NULL_VALUES, nullYaml11Tag, TRUE_VALUES$2, FALSE_VALUES$2, boolCoreTag, TRUE_VALUES$1, FALSE_VALUES$1, boolJsonTag, TRUE_VALUES, FALSE_VALUES, boolYaml11Tag, YAML_INTEGER_IMPLICIT_PATTERN$1, YAML_INTEGER_EXPLICIT_PATTERN$1, intCoreTag, YAML_INTEGER_IMPLICIT_PATTERN, YAML_INTEGER_EXPLICIT_PATTERN, intJsonTag, YAML_INTEGER_PATTERN, intYaml11Tag, YAML_FLOAT_PATTERN$1, YAML_FLOAT_SPECIAL_PATTERN$1, floatCoreTag, YAML_FLOAT_IMPLICIT_PATTERN, YAML_FLOAT_EXPLICIT_PATTERN, floatJsonTag, YAML_FLOAT_PATTERN, YAML_FLOAT_SPECIAL_PATTERN, floatYaml11Tag, mergeTag, BASE64_PATTERN, binaryTag, YAML_DATE_REGEXP, YAML_TIMESTAMP_REGEXP, timestampTag, seqTag, omapTag, pairsTag, mapTag, setTag, Schema, FAILSAFE_SCHEMA, JSON_SCHEMA, CORE_SCHEMA, YAML11_SCHEMA, DUMP_SCHEMA, realMapTag, legacyMapTag, DEFAULT_SNIPPET_OPTIONS, YAMLException, EVENT_ID, SCALAR_STYLE, COLLECTION_STYLE, CHOMPING_MODE, NO_RANGE$3, simpleEscapeCheck, simpleEscapeMap, DEFAULT_TAG_HANDLERS, TAG_SUFFIX_CHARS, TAG_URI_CHARS, HEX, NO_RANGE$2, MERGE_TAG_NAME, DEFAULT_CONSTRUCTOR_OPTIONS, NO_RANGE$1, HAS_OWN, CONTEXT_FLOW_IN, CONTEXT_FLOW_OUT, CONTEXT_BLOCK_IN, CONTEXT_BLOCK_OUT, PATTERN_NON_PRINTABLE, PATTERN_FLOW_INDICATORS, PATTERN_TAG_HANDLE, NS_URI_CHAR, NS_TAG_CHAR, PATTERN_TAG_URI, PATTERN_TAG_SUFFIX, PATTERN_TAG_PREFIX, DEFAULT_PARSER_OPTIONS, DEFAULT_LOAD_OPTIONS, INVALID, VISIT_BREAK, VISIT_SKIP, DEFAULT_SCALAR_STYLE_RULES, SRC_C_PRINTABLE, SRC_B_CHAR, SRC_C_BYTE_ORDER_MARK, SRC_S_WHITE, SRC_NB_CHAR, SRC_NS_CHAR, SRC_NB_JSON, SRC_C_INDICATOR, SRC_C_FLOW_INDICATOR, SRC_NS_PLAIN_SAFE_FLOW_OUT, SRC_NS_PLAIN_SAFE_FLOW_IN, SRC_NS_PLAIN_FIRST_FLOW_OUT, SRC_NS_PLAIN_FIRST_FLOW_IN, SRC_NS_PLAIN_CHAR_FLOW_OUT, SRC_NS_PLAIN_CHAR_FLOW_IN, SRC_NB_NS_PLAIN_IN_LINE_FLOW_OUT, SRC_NB_NS_PLAIN_IN_LINE_FLOW_IN, SRC_NS_PLAIN_ONE_LINE_FLOW_OUT, SRC_NS_PLAIN_ONE_LINE_FLOW_IN, SRC_NS_PLAIN_ONE_LINE_BLOCK_KEY, SRC_NS_PLAIN_ONE_LINE_FLOW_KEY, SRC_S_NS_PLAIN_NEXT_LINE_FLOW_OUT, SRC_S_NS_PLAIN_NEXT_LINE_FLOW_IN, SRC_NS_PLAIN_MULTI_LINE_FLOW_OUT, SRC_NS_PLAIN_MULTI_LINE_FLOW_IN, NS_PLAIN_FLOW_OUT, NS_PLAIN_FLOW_IN, NS_PLAIN_BLOCK_KEY, NS_PLAIN_FLOW_KEY, NB_SINGLE_ONE_LINE, NB_SINGLE_MULTI_LINE, BLOCK_SCALAR_CONTENT, C_FORBIDDEN_FIRST_LINE, C_FORBIDDEN_CONTENT, CHARACTERS_TO_ESCAPE, CHAR_LINE_FEED, DEFAULT_PRESENTER_OPTIONS, DEFAULT_DUMP_OPTIONS, NO_RANGE, EVENT_DOCUMENT, EVENT_SEQUENCE, EVENT_MAPPING, EVENT_SCALAR, EVENT_ALIAS, EVENT_POP, SCALAR_STYLE_PLAIN, SCALAR_STYLE_SINGLE_QUOTED, SCALAR_STYLE_DOUBLE_QUOTED, SCALAR_STYLE_LITERAL_BLOCK, SCALAR_STYLE_FOLDED_BLOCK, COLLECTION_STYLE_BLOCK, COLLECTION_STYLE_FLOW, CHOMPING_CLIP, CHOMPING_STRIP, CHOMPING_KEEP;
|
|
8262
8386
|
var init_js_yaml = __esm({
|
|
8263
8387
|
"node_modules/js-yaml/dist/js-yaml.mjs"() {
|
|
8264
8388
|
NOT_RESOLVED = /* @__PURE__ */ Symbol("NOT_RESOLVED");
|
|
@@ -8653,7 +8777,6 @@ var init_js_yaml = __esm({
|
|
|
8653
8777
|
case "mapping":
|
|
8654
8778
|
if (tag.matchByTagPrefix) prefix.mapping.push(tag);
|
|
8655
8779
|
else exact.mapping[tag.tagName] = tag;
|
|
8656
|
-
break;
|
|
8657
8780
|
}
|
|
8658
8781
|
}
|
|
8659
8782
|
const implicitScalarAnyFirstChar = implicitScalarTags.filter((tag) => tag.implicitFirstChars === null);
|
|
@@ -8910,6 +9033,9 @@ var init_js_yaml = __esm({
|
|
|
8910
9033
|
"!": "!",
|
|
8911
9034
|
"!!": "tag:yaml.org,2002:"
|
|
8912
9035
|
});
|
|
9036
|
+
TAG_SUFFIX_CHARS = "-#;/?:@&=+$_.~*'()";
|
|
9037
|
+
TAG_URI_CHARS = TAG_SUFFIX_CHARS + "!,[]";
|
|
9038
|
+
HEX = "0123456789ABCDEF";
|
|
8913
9039
|
NO_RANGE$2 = -1;
|
|
8914
9040
|
MERGE_TAG_NAME = "tag:yaml.org,2002:merge";
|
|
8915
9041
|
DEFAULT_CONSTRUCTOR_OPTIONS = {
|
|
@@ -9917,10 +10043,10 @@ var require_history = __commonJS({
|
|
|
9917
10043
|
var require_ps = __commonJS({
|
|
9918
10044
|
"node_modules/pidusage/lib/ps.js"(exports, module) {
|
|
9919
10045
|
"use strict";
|
|
9920
|
-
var
|
|
10046
|
+
var os38 = __require("os");
|
|
9921
10047
|
var bin = require_bin();
|
|
9922
10048
|
var history = require_history();
|
|
9923
|
-
var PLATFORM =
|
|
10049
|
+
var PLATFORM = os38.platform();
|
|
9924
10050
|
function parseTime(timestr, centisec) {
|
|
9925
10051
|
let time = 0;
|
|
9926
10052
|
const tpart = timestr.split(/-|:|\./);
|
|
@@ -9965,7 +10091,7 @@ var require_ps = __commonJS({
|
|
|
9965
10091
|
return done(new Error("pidusage ps command exited with code " + code));
|
|
9966
10092
|
}
|
|
9967
10093
|
const date = Date.now();
|
|
9968
|
-
stdout = stdout.split(
|
|
10094
|
+
stdout = stdout.split(os38.EOL);
|
|
9969
10095
|
const statistics = {};
|
|
9970
10096
|
for (let i = 1; i < stdout.length; i++) {
|
|
9971
10097
|
const line = stdout[i].trim().split(/\s+/);
|
|
@@ -10046,7 +10172,7 @@ var require_parallel = __commonJS({
|
|
|
10046
10172
|
// node_modules/pidusage/lib/helpers/cpu.js
|
|
10047
10173
|
var require_cpu = __commonJS({
|
|
10048
10174
|
"node_modules/pidusage/lib/helpers/cpu.js"(exports, module) {
|
|
10049
|
-
var
|
|
10175
|
+
var os38 = __require("os");
|
|
10050
10176
|
var fs152 = __require("fs");
|
|
10051
10177
|
var exec = __require("child_process").exec;
|
|
10052
10178
|
var parallel = require_parallel();
|
|
@@ -10079,7 +10205,7 @@ var require_cpu = __commonJS({
|
|
|
10079
10205
|
if (!process.env.PIDUSAGE_SILENT) {
|
|
10080
10206
|
console.warn("[pidusage] We couldn't find uptime from /proc/uptime, using os.uptime() value");
|
|
10081
10207
|
}
|
|
10082
|
-
return next(null,
|
|
10208
|
+
return next(null, os38.uptime() || /* @__PURE__ */ new Date() / 1e3);
|
|
10083
10209
|
}
|
|
10084
10210
|
return next(null, parseFloat(uptime.split(" ")[0]));
|
|
10085
10211
|
});
|
|
@@ -10240,7 +10366,7 @@ var require_procfile = __commonJS({
|
|
|
10240
10366
|
var require_wmic = __commonJS({
|
|
10241
10367
|
"node_modules/pidusage/lib/wmic.js"(exports, module) {
|
|
10242
10368
|
"use strict";
|
|
10243
|
-
var
|
|
10369
|
+
var os38 = __require("os");
|
|
10244
10370
|
var bin = require_bin();
|
|
10245
10371
|
var history = require_history();
|
|
10246
10372
|
function parseDate(datestr) {
|
|
@@ -10284,8 +10410,8 @@ var require_wmic = __commonJS({
|
|
|
10284
10410
|
return done(new Error("pidusage wmic command exited with code " + code));
|
|
10285
10411
|
}
|
|
10286
10412
|
const date = Date.now();
|
|
10287
|
-
const uptime = Math.floor(
|
|
10288
|
-
stdout = stdout.split(
|
|
10413
|
+
const uptime = Math.floor(os38.uptime() || date / 1e3);
|
|
10414
|
+
stdout = stdout.split(os38.EOL);
|
|
10289
10415
|
let again = false;
|
|
10290
10416
|
const statistics = {};
|
|
10291
10417
|
for (let i = 1; i < stdout.length; i++) {
|
|
@@ -10335,7 +10461,7 @@ var require_wmic = __commonJS({
|
|
|
10335
10461
|
var require_gwmi = __commonJS({
|
|
10336
10462
|
"node_modules/pidusage/lib/gwmi.js"(exports, module) {
|
|
10337
10463
|
"use strict";
|
|
10338
|
-
var
|
|
10464
|
+
var os38 = __require("os");
|
|
10339
10465
|
var bin = require_bin();
|
|
10340
10466
|
var history = require_history();
|
|
10341
10467
|
function parseDate(datestr) {
|
|
@@ -10374,8 +10500,8 @@ var require_gwmi = __commonJS({
|
|
|
10374
10500
|
return done(new Error("pidusage gwmi command exited with code " + code));
|
|
10375
10501
|
}
|
|
10376
10502
|
const date = Date.now();
|
|
10377
|
-
const uptime = Math.floor(
|
|
10378
|
-
stdout = stdout.split(
|
|
10503
|
+
const uptime = Math.floor(os38.uptime() || date / 1e3);
|
|
10504
|
+
stdout = stdout.split(os38.EOL).slice(1);
|
|
10379
10505
|
const index = stdout.findIndex((v) => !!v);
|
|
10380
10506
|
stdout = stdout.slice(index + 2);
|
|
10381
10507
|
if (!stdout.length) {
|
|
@@ -10433,7 +10559,7 @@ var require_stats = __commonJS({
|
|
|
10433
10559
|
"node_modules/pidusage/lib/stats.js"(exports, module) {
|
|
10434
10560
|
"use strict";
|
|
10435
10561
|
var fs152 = __require("fs");
|
|
10436
|
-
var
|
|
10562
|
+
var os38 = __require("os");
|
|
10437
10563
|
var path234 = __require("path");
|
|
10438
10564
|
var requireMap = {
|
|
10439
10565
|
ps: () => require_ps(),
|
|
@@ -10455,7 +10581,7 @@ var require_stats = __commonJS({
|
|
|
10455
10581
|
sunos: "ps",
|
|
10456
10582
|
win: "wmic"
|
|
10457
10583
|
};
|
|
10458
|
-
var platform =
|
|
10584
|
+
var platform = os38.platform();
|
|
10459
10585
|
if (fs152.existsSync("/etc/alpine-release")) {
|
|
10460
10586
|
platform = "alpine";
|
|
10461
10587
|
}
|
|
@@ -10483,7 +10609,7 @@ var require_stats = __commonJS({
|
|
|
10483
10609
|
fn = options.useGwmi === true || !hasWmic() ? requireMap.gwmi() : requireMap.wmic();
|
|
10484
10610
|
}
|
|
10485
10611
|
if (fn === void 0) {
|
|
10486
|
-
return callback(new Error(
|
|
10612
|
+
return callback(new Error(os38.platform() + " is not supported yet, please open an issue (https://github.com/soyuka/pidusage)"));
|
|
10487
10613
|
}
|
|
10488
10614
|
let single = false;
|
|
10489
10615
|
if (!Array.isArray(pids)) {
|
|
@@ -10535,10 +10661,10 @@ var require_pidusage = __commonJS({
|
|
|
10535
10661
|
stats(pids, options, callback);
|
|
10536
10662
|
return;
|
|
10537
10663
|
}
|
|
10538
|
-
return new Promise(function(
|
|
10664
|
+
return new Promise(function(resolve153, reject) {
|
|
10539
10665
|
stats(pids, options, function(err, data) {
|
|
10540
10666
|
if (err) return reject(err);
|
|
10541
|
-
|
|
10667
|
+
resolve153(data);
|
|
10542
10668
|
});
|
|
10543
10669
|
});
|
|
10544
10670
|
}
|
|
@@ -10907,7 +11033,7 @@ async function releaseQuarantineLock(lockPath, token) {
|
|
|
10907
11033
|
} catch (error) {
|
|
10908
11034
|
if (error.code !== "ENOENT" || attempt === 2)
|
|
10909
11035
|
return;
|
|
10910
|
-
await new Promise((
|
|
11036
|
+
await new Promise((resolve153) => setImmediate(resolve153));
|
|
10911
11037
|
}
|
|
10912
11038
|
}
|
|
10913
11039
|
if (!renamed)
|
|
@@ -11034,7 +11160,7 @@ async function acquireQuarantinePidFileLock(lockPath, options) {
|
|
|
11034
11160
|
}
|
|
11035
11161
|
throw new Error(options.timeoutMessage);
|
|
11036
11162
|
}
|
|
11037
|
-
await new Promise((
|
|
11163
|
+
await new Promise((resolve153) => setTimeout(resolve153, Math.min(options.retryMs, remaining)));
|
|
11038
11164
|
}
|
|
11039
11165
|
}
|
|
11040
11166
|
function createLegacyBoundedLock(lockPath, token) {
|
|
@@ -11203,7 +11329,7 @@ function unrefChildAndPipes(child) {
|
|
|
11203
11329
|
}
|
|
11204
11330
|
}
|
|
11205
11331
|
function spawnCollectStdoutResult(command, args, options, collectOptions = {}) {
|
|
11206
|
-
return new Promise((
|
|
11332
|
+
return new Promise((resolve153) => {
|
|
11207
11333
|
let settled = false;
|
|
11208
11334
|
let timer;
|
|
11209
11335
|
const settle = (result) => {
|
|
@@ -11212,7 +11338,7 @@ function spawnCollectStdoutResult(command, args, options, collectOptions = {}) {
|
|
|
11212
11338
|
settled = true;
|
|
11213
11339
|
if (timer)
|
|
11214
11340
|
clearTimeout(timer);
|
|
11215
|
-
|
|
11341
|
+
resolve153(result);
|
|
11216
11342
|
};
|
|
11217
11343
|
try {
|
|
11218
11344
|
const child = nodeSpawn(command, args, options);
|
|
@@ -11538,7 +11664,7 @@ async function withInstanceRegistryLock(target, op, waitMs = LOCK_WAIT_MS) {
|
|
|
11538
11664
|
return void 0;
|
|
11539
11665
|
if (hold === "busy") {
|
|
11540
11666
|
if (Date.now() <= deadline)
|
|
11541
|
-
await new Promise((
|
|
11667
|
+
await new Promise((resolve153) => setTimeout(resolve153, backoffMs()));
|
|
11542
11668
|
continue;
|
|
11543
11669
|
}
|
|
11544
11670
|
const holds = ownAsyncHolds();
|
|
@@ -12915,8 +13041,8 @@ function buildIdentityMatcher(identities) {
|
|
|
12915
13041
|
};
|
|
12916
13042
|
}
|
|
12917
13043
|
function sleepUnref(ms) {
|
|
12918
|
-
return new Promise((
|
|
12919
|
-
const timer = setTimeout(
|
|
13044
|
+
return new Promise((resolve153) => {
|
|
13045
|
+
const timer = setTimeout(resolve153, ms);
|
|
12920
13046
|
timer.unref();
|
|
12921
13047
|
});
|
|
12922
13048
|
}
|
|
@@ -12934,9 +13060,9 @@ async function killPidTree(pid, options = {}) {
|
|
|
12934
13060
|
stdio: "ignore"
|
|
12935
13061
|
});
|
|
12936
13062
|
unrefChildAndPipes(killer);
|
|
12937
|
-
await new Promise((
|
|
12938
|
-
killer.once("close", () =>
|
|
12939
|
-
killer.once("error", () =>
|
|
13063
|
+
await new Promise((resolve153) => {
|
|
13064
|
+
killer.once("close", () => resolve153());
|
|
13065
|
+
killer.once("error", () => resolve153());
|
|
12940
13066
|
});
|
|
12941
13067
|
} catch {
|
|
12942
13068
|
}
|
|
@@ -13652,9 +13778,9 @@ async function sampleProcessTreeCpuPercent(pid, windowMs = 1200, floorPercent =
|
|
|
13652
13778
|
}
|
|
13653
13779
|
};
|
|
13654
13780
|
const first = await readOnce();
|
|
13655
|
-
const second = await new Promise((
|
|
13781
|
+
const second = await new Promise((resolve153) => {
|
|
13656
13782
|
const timer = setTimeout(() => {
|
|
13657
|
-
void readOnce().then(
|
|
13783
|
+
void readOnce().then(resolve153);
|
|
13658
13784
|
}, windowMs);
|
|
13659
13785
|
timer.unref?.();
|
|
13660
13786
|
});
|
|
@@ -14470,10 +14596,10 @@ async function safeSpawnAsync(command, args, options) {
|
|
|
14470
14596
|
const callerSignal = options?.signal ?? (options?.ignoreAmbientSignal ? void 0 : ambientAbortSignal);
|
|
14471
14597
|
const scopedSignal = spawnAbortScope.getStore();
|
|
14472
14598
|
const abortSignal = scopedSignal && callerSignal ? AbortSignal.any([scopedSignal, callerSignal]) : scopedSignal ?? callerSignal;
|
|
14473
|
-
return new Promise((
|
|
14599
|
+
return new Promise((resolve153) => {
|
|
14474
14600
|
if (abortSignal?.aborted) {
|
|
14475
14601
|
const cause = new Error("Spawn aborted before start");
|
|
14476
|
-
|
|
14602
|
+
resolve153({
|
|
14477
14603
|
stdout: "",
|
|
14478
14604
|
stderr: "",
|
|
14479
14605
|
status: null,
|
|
@@ -14485,7 +14611,7 @@ async function safeSpawnAsync(command, args, options) {
|
|
|
14485
14611
|
}
|
|
14486
14612
|
if (timeout <= 0) {
|
|
14487
14613
|
const cause = new Error(`Process timed out after ${timeout}ms`);
|
|
14488
|
-
|
|
14614
|
+
resolve153({
|
|
14489
14615
|
stdout: "",
|
|
14490
14616
|
stderr: "",
|
|
14491
14617
|
status: null,
|
|
@@ -14618,7 +14744,7 @@ async function safeSpawnAsync(command, args, options) {
|
|
|
14618
14744
|
const isWindows3 = process.platform === "win32";
|
|
14619
14745
|
const admission = admitSpawn(command, options?.cwd, getSpawnEnvironment(options?.env, options?.stripNpmConfig));
|
|
14620
14746
|
if (!admission.admitted) {
|
|
14621
|
-
|
|
14747
|
+
resolve153(trustRefusalResult(command, admission.executable));
|
|
14622
14748
|
return;
|
|
14623
14749
|
}
|
|
14624
14750
|
const spawnEnv = admission.env;
|
|
@@ -14655,7 +14781,7 @@ async function safeSpawnAsync(command, args, options) {
|
|
|
14655
14781
|
void classifySpawnFailure(resolutionError, {
|
|
14656
14782
|
command,
|
|
14657
14783
|
cwd: options?.cwd
|
|
14658
|
-
}).then((spawnFailure) =>
|
|
14784
|
+
}).then((spawnFailure) => resolve153({
|
|
14659
14785
|
stdout: "",
|
|
14660
14786
|
stderr: "",
|
|
14661
14787
|
status: null,
|
|
@@ -14678,7 +14804,7 @@ async function safeSpawnAsync(command, args, options) {
|
|
|
14678
14804
|
});
|
|
14679
14805
|
} catch (err) {
|
|
14680
14806
|
const cause = toError(err);
|
|
14681
|
-
void classifySpawnFailure(cause, { command, cwd: options?.cwd }).then((spawnFailure) =>
|
|
14807
|
+
void classifySpawnFailure(cause, { command, cwd: options?.cwd }).then((spawnFailure) => resolve153({
|
|
14682
14808
|
stdout: "",
|
|
14683
14809
|
stderr: "",
|
|
14684
14810
|
status: null,
|
|
@@ -14971,7 +15097,7 @@ async function safeSpawnAsync(command, args, options) {
|
|
|
14971
15097
|
deathObservedAtMs: closedAtMs,
|
|
14972
15098
|
escalated: teardownEscalated
|
|
14973
15099
|
});
|
|
14974
|
-
|
|
15100
|
+
resolve153({
|
|
14975
15101
|
stdout,
|
|
14976
15102
|
stderr,
|
|
14977
15103
|
status: null,
|
|
@@ -14986,7 +15112,7 @@ async function safeSpawnAsync(command, args, options) {
|
|
|
14986
15112
|
});
|
|
14987
15113
|
} else if (aborted) {
|
|
14988
15114
|
const cause = new Error("Spawn aborted");
|
|
14989
|
-
|
|
15115
|
+
resolve153({
|
|
14990
15116
|
stdout,
|
|
14991
15117
|
stderr,
|
|
14992
15118
|
status: null,
|
|
@@ -15000,7 +15126,7 @@ async function safeSpawnAsync(command, args, options) {
|
|
|
15000
15126
|
});
|
|
15001
15127
|
} else if (signal) {
|
|
15002
15128
|
const cause = new Error(`Process killed by signal: ${signal}`);
|
|
15003
|
-
|
|
15129
|
+
resolve153({
|
|
15004
15130
|
stdout,
|
|
15005
15131
|
stderr,
|
|
15006
15132
|
status: null,
|
|
@@ -15018,7 +15144,7 @@ async function safeSpawnAsync(command, args, options) {
|
|
|
15018
15144
|
command,
|
|
15019
15145
|
cwd: options?.cwd
|
|
15020
15146
|
});
|
|
15021
|
-
|
|
15147
|
+
resolve153({
|
|
15022
15148
|
stdout,
|
|
15023
15149
|
stderr,
|
|
15024
15150
|
status: code,
|
|
@@ -15030,7 +15156,7 @@ async function safeSpawnAsync(command, args, options) {
|
|
|
15030
15156
|
resourceUsage
|
|
15031
15157
|
});
|
|
15032
15158
|
} else {
|
|
15033
|
-
|
|
15159
|
+
resolve153({
|
|
15034
15160
|
stdout,
|
|
15035
15161
|
stderr,
|
|
15036
15162
|
status: code,
|
|
@@ -15062,7 +15188,7 @@ async function safeSpawnAsync(command, args, options) {
|
|
|
15062
15188
|
else if (timedOut)
|
|
15063
15189
|
failure = "timeout";
|
|
15064
15190
|
const controlFailure = aborted ? new SpawnFailureError("killed", err.message, err) : timedOut ? new SpawnFailureError("timeout", err.message, err) : void 0;
|
|
15065
|
-
const finish = (spawnFailure) =>
|
|
15191
|
+
const finish = (spawnFailure) => resolve153({
|
|
15066
15192
|
stdout,
|
|
15067
15193
|
stderr,
|
|
15068
15194
|
status: null,
|
|
@@ -18345,7 +18471,9 @@ function classifyTmpDir(dir) {
|
|
|
18345
18471
|
const real = realpathOrResolve(dir);
|
|
18346
18472
|
let result = NOT_EPHEMERAL;
|
|
18347
18473
|
if (isUnderDir(real, tmpRoot)) {
|
|
18348
|
-
for (
|
|
18474
|
+
for (const current of walkUpDirs(real)) {
|
|
18475
|
+
if (current === tmpRoot)
|
|
18476
|
+
break;
|
|
18349
18477
|
if (isRealGitMarker(path26.join(current, ".git"))) {
|
|
18350
18478
|
result = { checkout: true };
|
|
18351
18479
|
break;
|
|
@@ -18798,10 +18926,16 @@ function readGitignorePatterns(rootDir, layer = "gitignore") {
|
|
|
18798
18926
|
return [];
|
|
18799
18927
|
}
|
|
18800
18928
|
}
|
|
18929
|
+
function containmentForm(value) {
|
|
18930
|
+
return isWindowsPath(value) ? toPosix(value).toLowerCase() : value;
|
|
18931
|
+
}
|
|
18932
|
+
function isWithinPathForm(child, parent) {
|
|
18933
|
+
return isWithinForm(containmentForm(child), containmentForm(parent));
|
|
18934
|
+
}
|
|
18801
18935
|
function ancestorDirsBetween(rootDir, targetDir) {
|
|
18802
|
-
|
|
18803
|
-
if (relative36.startsWith("..") || path27.isAbsolute(relative36))
|
|
18936
|
+
if (!isWithinPathForm(targetDir, rootDir))
|
|
18804
18937
|
return [];
|
|
18938
|
+
const relative36 = path27.relative(rootDir, targetDir);
|
|
18805
18939
|
const dirs = [rootDir];
|
|
18806
18940
|
if (!relative36)
|
|
18807
18941
|
return dirs;
|
|
@@ -18855,11 +18989,10 @@ function buildProjectIgnoreMatcher(resolvedRoot, patterns) {
|
|
|
18855
18989
|
};
|
|
18856
18990
|
const patternMemo = /* @__PURE__ */ new Map();
|
|
18857
18991
|
function dropVerdictsUnder(subtree) {
|
|
18858
|
-
const
|
|
18992
|
+
const subtreeForm = path27.resolve(subtree);
|
|
18859
18993
|
for (const key4 of patternMemo.keys()) {
|
|
18860
18994
|
const memoPath = key4.slice(2);
|
|
18861
|
-
|
|
18862
|
-
if (!relative36 || !relative36.startsWith("..") && !path27.isAbsolute(relative36)) {
|
|
18995
|
+
if (isWithinPathForm(memoPath, subtreeForm)) {
|
|
18863
18996
|
patternMemo.delete(key4);
|
|
18864
18997
|
}
|
|
18865
18998
|
}
|
|
@@ -18873,11 +19006,27 @@ function buildProjectIgnoreMatcher(resolvedRoot, patterns) {
|
|
|
18873
19006
|
}
|
|
18874
19007
|
return identity;
|
|
18875
19008
|
};
|
|
18876
|
-
const
|
|
18877
|
-
const
|
|
19009
|
+
const hasDotSegment = (spelling) => /(^|[\\/])\.\.?([\\/]|$)/.test(spelling);
|
|
19010
|
+
const projectPathKey = (spelling) => {
|
|
19011
|
+
const absolute = path27.resolve(spelling);
|
|
19012
|
+
if (!hasDotSegment(spelling)) {
|
|
19013
|
+
if (isUnderRootText(absolute))
|
|
19014
|
+
return absolute;
|
|
19015
|
+
return path27.join(identityOfDir(path27.dirname(absolute)), path27.basename(absolute));
|
|
19016
|
+
}
|
|
19017
|
+
const tail = path27.basename(spelling);
|
|
19018
|
+
if (tail === "." || tail === "..")
|
|
19019
|
+
return identityOfDir(spelling);
|
|
19020
|
+
return path27.join(identityOfDir(path27.dirname(spelling)), tail);
|
|
19021
|
+
};
|
|
19022
|
+
const isUnderRootText = (absolute) => isWithinPathForm(absolute, resolvedRoot);
|
|
18878
19023
|
const invalidateSubtree = (subtree) => {
|
|
18879
19024
|
const absolute = path27.resolve(subtree);
|
|
18880
|
-
|
|
19025
|
+
let local = absolute;
|
|
19026
|
+
if (hasDotSegment(subtree))
|
|
19027
|
+
local = identityOfDir(subtree);
|
|
19028
|
+
else if (!isUnderRootText(absolute))
|
|
19029
|
+
local = identityOfDir(absolute);
|
|
18881
19030
|
dropVerdictsUnder(local);
|
|
18882
19031
|
nestedCache.delete(local);
|
|
18883
19032
|
};
|
|
@@ -18913,13 +19062,11 @@ function buildProjectIgnoreMatcher(resolvedRoot, patterns) {
|
|
|
18913
19062
|
return collectTrackedFiles(resolvedRoot).then(() => void 0);
|
|
18914
19063
|
},
|
|
18915
19064
|
isIgnored(filePath, isDirectory2 = false) {
|
|
18916
|
-
const
|
|
18917
|
-
const resolved2 = isUnderRootText(spelled) ? spelled : path27.join(identityOfDir(path27.dirname(spelled)), path27.basename(spelled));
|
|
19065
|
+
const resolved2 = projectPathKey(filePath);
|
|
18918
19066
|
const memoKey = (isDirectory2 ? "D:" : "F:") + resolved2;
|
|
18919
19067
|
let verdict = patternMemo.get(memoKey);
|
|
18920
19068
|
if (verdict === void 0) {
|
|
18921
|
-
|
|
18922
|
-
if (!rootRelative || rootRelative.startsWith("..") || path27.isAbsolute(rootRelative)) {
|
|
19069
|
+
if (resolved2 === resolvedRoot || !isWithinPathForm(resolved2, resolvedRoot)) {
|
|
18923
19070
|
verdict = { ignored: false, layer: void 0 };
|
|
18924
19071
|
} else {
|
|
18925
19072
|
let ignored = false;
|
|
@@ -19043,7 +19190,7 @@ function invalidateProjectIgnoreMatcherForPath(filePath) {
|
|
|
19043
19190
|
projectIgnoreMatcherCache.delete(cachedRoot);
|
|
19044
19191
|
continue;
|
|
19045
19192
|
}
|
|
19046
|
-
cached.matcher.invalidateSubtree(path27.dirname(
|
|
19193
|
+
cached.matcher.invalidateSubtree(path27.dirname(filePath));
|
|
19047
19194
|
}
|
|
19048
19195
|
}
|
|
19049
19196
|
function isPathIgnoredByProject(filePath, rootDir, isDirectory2 = false) {
|
|
@@ -20911,8 +21058,6 @@ var init_path_birth = __esm({
|
|
|
20911
21058
|
});
|
|
20912
21059
|
|
|
20913
21060
|
// dist/clients/file-mutation-queue.js
|
|
20914
|
-
import { realpath } from "node:fs/promises";
|
|
20915
|
-
import { resolve as resolve15 } from "node:path";
|
|
20916
21061
|
function noteHostSessionManager(sessionManager) {
|
|
20917
21062
|
hostSessionManager = sessionManager;
|
|
20918
21063
|
}
|
|
@@ -20952,13 +21097,10 @@ function withHostFileMutationQueue(filePath, fn) {
|
|
|
20952
21097
|
const loader = loadHostSdk;
|
|
20953
21098
|
if (!loader)
|
|
20954
21099
|
return fn();
|
|
20955
|
-
return resolveHostQueue(loader).then((queue) => queue ?
|
|
21100
|
+
return resolveHostQueue(loader).then((queue) => queue ? realpathOrResolveAsync(filePath).then((key4) => queue(key4, fn)) : fn());
|
|
20956
21101
|
}
|
|
20957
21102
|
async function withHostFileMutationQueues(filePaths, fn) {
|
|
20958
|
-
const keys = await Promise.all(filePaths.map((filePath) =>
|
|
20959
|
-
const resolvedPath = resolve15(filePath);
|
|
20960
|
-
return realpath(resolvedPath).catch(() => resolvedPath);
|
|
20961
|
-
}));
|
|
21103
|
+
const keys = await Promise.all(filePaths.map((filePath) => realpathOrResolveAsync(filePath)));
|
|
20962
21104
|
return [...new Set(keys)].sort(compareOrdinal).reduceRight((inner, key4) => () => withHostFileMutationQueue(key4, inner), fn)();
|
|
20963
21105
|
}
|
|
20964
21106
|
function holdFileMutationQueue(filePath) {
|
|
@@ -21007,6 +21149,7 @@ var init_file_mutation_queue = __esm({
|
|
|
21007
21149
|
"use strict";
|
|
21008
21150
|
init_degradation_ledger();
|
|
21009
21151
|
init_extension_log();
|
|
21152
|
+
init_path_utils();
|
|
21010
21153
|
init_string_utils();
|
|
21011
21154
|
}
|
|
21012
21155
|
});
|
|
@@ -21973,7 +22116,7 @@ function createDeadline(budgetMs) {
|
|
|
21973
22116
|
async function yieldIfOverBudget(deadline) {
|
|
21974
22117
|
if (!deadline.expired())
|
|
21975
22118
|
return false;
|
|
21976
|
-
await new Promise((
|
|
22119
|
+
await new Promise((resolve153) => setImmediate(resolve153));
|
|
21977
22120
|
deadline.reset();
|
|
21978
22121
|
return true;
|
|
21979
22122
|
}
|
|
@@ -28165,8 +28308,8 @@ function createSingleFlight(options = {}) {
|
|
|
28165
28308
|
}
|
|
28166
28309
|
let settle;
|
|
28167
28310
|
let fail;
|
|
28168
|
-
const promise = new Promise((
|
|
28169
|
-
settle =
|
|
28311
|
+
const promise = new Promise((resolve153, reject) => {
|
|
28312
|
+
settle = resolve153;
|
|
28170
28313
|
fail = reject;
|
|
28171
28314
|
});
|
|
28172
28315
|
const flight = {
|
|
@@ -28208,6 +28351,7 @@ var init_single_flight = __esm({
|
|
|
28208
28351
|
|
|
28209
28352
|
// dist/clients/opaque-mutation-scan.js
|
|
28210
28353
|
import * as fs35 from "node:fs";
|
|
28354
|
+
import * as os11 from "node:os";
|
|
28211
28355
|
import * as path40 from "node:path";
|
|
28212
28356
|
import { createHash as createHash8 } from "node:crypto";
|
|
28213
28357
|
function shouldRunOpaqueRecovery(toolName, workspaceRoot) {
|
|
@@ -28258,18 +28402,24 @@ async function captureFileStats(root, options = {}) {
|
|
|
28258
28402
|
if (options.forcedUnknownReason !== void 0) {
|
|
28259
28403
|
return { unknownReason: options.forcedUnknownReason, scannedCount: 0 };
|
|
28260
28404
|
}
|
|
28405
|
+
if (isAtOrAboveHomeDir(realpathOrResolve(root), realpathOrResolve(os11.homedir())))
|
|
28406
|
+
return { unknownReason: "home-root", scannedCount: 0 };
|
|
28407
|
+
const rootKey2 = normalizeMapKey(root);
|
|
28408
|
+
if (overCapRootMemo.has(rootKey2))
|
|
28409
|
+
return { unknownReason: "file-cap-exceeded", scannedCount: 0 };
|
|
28261
28410
|
const budgetMs = options.budgetMs ?? 50;
|
|
28262
28411
|
try {
|
|
28263
28412
|
const walk3 = await collectSourceFilesWithBudgetAsync(root, {
|
|
28264
28413
|
maxFiles: OPAQUE_SCAN_MAX_FILES + 1,
|
|
28265
|
-
budgetMs
|
|
28414
|
+
budgetMs,
|
|
28415
|
+
...options.maxScanEntries === void 0 ? {} : { maxScanEntries: options.maxScanEntries }
|
|
28266
28416
|
});
|
|
28267
28417
|
const files2 = walk3.files;
|
|
28268
28418
|
if (walk3.entryBudgetExceeded || files2.length > OPAQUE_SCAN_MAX_FILES) {
|
|
28269
|
-
|
|
28270
|
-
|
|
28271
|
-
|
|
28272
|
-
};
|
|
28419
|
+
const unknownReason = walk3.entryBudgetExceeded ? "entry-budget-exceeded" : "file-cap-exceeded";
|
|
28420
|
+
if (unknownReason === "file-cap-exceeded")
|
|
28421
|
+
overCapRootMemo.set(rootKey2, true);
|
|
28422
|
+
return { unknownReason, scannedCount: files2.length };
|
|
28273
28423
|
}
|
|
28274
28424
|
const { snapshot } = await captureFileStatsForPaths(files2, options);
|
|
28275
28425
|
return { snapshot, scannedCount: snapshot.size };
|
|
@@ -28398,6 +28548,7 @@ function getOpaqueBaselineStore() {
|
|
|
28398
28548
|
function resetOpaqueMutationState() {
|
|
28399
28549
|
getOpaqueBaselineStore().takeAllForTest();
|
|
28400
28550
|
gitRepoMemo.clear();
|
|
28551
|
+
overCapRootMemo.clear();
|
|
28401
28552
|
gitToplevelMemo.clear();
|
|
28402
28553
|
headRecords.clear();
|
|
28403
28554
|
headLooks.clear();
|
|
@@ -28619,7 +28770,7 @@ async function recoverOpaqueChangesViaGit(root, startedAt, options = {}) {
|
|
|
28619
28770
|
...unknownStatusCount > 0 ? { unknownStatusCount } : {}
|
|
28620
28771
|
};
|
|
28621
28772
|
}
|
|
28622
|
-
var OPAQUE_HASH_BUDGET_BYTES, OPAQUE_SCAN_MAX_FILES, OPAQUE_MTIME_TOLERANCE_MS, MAX_GIT_STATUS_OUTPUT_BYTES, PI_BUILTIN_TOOL_WRITES, OPAQUE_RECOVERY_ROOT_CAP, ROOT_REFUSAL_REASONS, OPAQUE_BASELINE_PENDING_CAP, OpaqueBaselineStore, BASELINE_LOSS_REASONS, globalStoreSymbol, globalSlot, gitRepoMemo, HEAD_RECORD_CAP, headRecords, pendingHeadDiscards, headLooks, COMMIT_ID, gitToplevelMemo, UNMERGED_PORCELAIN_STATUSES, LEGAL_ORDINARY_PORCELAIN_STATUSES, PORCELAIN_STATUS_CHARS, SAME_HEAD_DIRTY_SET_CAP;
|
|
28773
|
+
var OPAQUE_HASH_BUDGET_BYTES, OPAQUE_SCAN_MAX_FILES, OPAQUE_MTIME_TOLERANCE_MS, MAX_GIT_STATUS_OUTPUT_BYTES, PI_BUILTIN_TOOL_WRITES, OPAQUE_RECOVERY_ROOT_CAP, ROOT_REFUSAL_REASONS, OPAQUE_BASELINE_PENDING_CAP, OpaqueBaselineStore, BASELINE_LOSS_REASONS, globalStoreSymbol, globalSlot, gitRepoMemo, overCapRootMemo, HEAD_RECORD_CAP, headRecords, pendingHeadDiscards, headLooks, COMMIT_ID, gitToplevelMemo, UNMERGED_PORCELAIN_STATUSES, LEGAL_ORDINARY_PORCELAIN_STATUSES, PORCELAIN_STATUS_CHARS, SAME_HEAD_DIRTY_SET_CAP;
|
|
28623
28774
|
var init_opaque_mutation_scan = __esm({
|
|
28624
28775
|
"dist/clients/opaque-mutation-scan.js"() {
|
|
28625
28776
|
"use strict";
|
|
@@ -28711,6 +28862,7 @@ var init_opaque_mutation_scan = __esm({
|
|
|
28711
28862
|
globalStoreSymbol = /* @__PURE__ */ Symbol.for("pi-lens:opaque-snapshot-store");
|
|
28712
28863
|
globalSlot = globalThis;
|
|
28713
28864
|
gitRepoMemo = /* @__PURE__ */ new Map();
|
|
28865
|
+
overCapRootMemo = new BoundedFifoMap(16);
|
|
28714
28866
|
HEAD_RECORD_CAP = 64;
|
|
28715
28867
|
headRecords = new BoundedFifoMap(HEAD_RECORD_CAP);
|
|
28716
28868
|
pendingHeadDiscards = new BoundedFifoMap(HEAD_RECORD_CAP);
|
|
@@ -30490,7 +30642,7 @@ var init_mutation_bridge = __esm({
|
|
|
30490
30642
|
|
|
30491
30643
|
// dist/clients/analysis-root.js
|
|
30492
30644
|
import * as fs38 from "node:fs";
|
|
30493
|
-
import * as
|
|
30645
|
+
import * as os12 from "node:os";
|
|
30494
30646
|
import * as nodePath from "node:path";
|
|
30495
30647
|
function hasProjectMarker(dir) {
|
|
30496
30648
|
return PROJECT_MARKERS.some((marker) => {
|
|
@@ -30515,7 +30667,7 @@ function nearestProjectRoot(filePath) {
|
|
|
30515
30667
|
function resolveAnalysisRootPath(filePath, sessionRoot, homeDirOverride) {
|
|
30516
30668
|
const resolved2 = realpathOrResolve(filePath);
|
|
30517
30669
|
const session = realpathOrResolve(sessionRoot);
|
|
30518
|
-
const tmp = realpathOrResolve(
|
|
30670
|
+
const tmp = realpathOrResolve(os12.tmpdir());
|
|
30519
30671
|
const data = process.env.PI_LENS_HOME ? realpathOrResolve(process.env.PI_LENS_HOME) : void 0;
|
|
30520
30672
|
if (isVendorPath(resolved2))
|
|
30521
30673
|
return void 0;
|
|
@@ -30530,7 +30682,7 @@ function resolveAnalysisRootPath(filePath, sessionRoot, homeDirOverride) {
|
|
|
30530
30682
|
const candidate = nearestProjectRoot(resolved2);
|
|
30531
30683
|
if (!candidate || candidate === nodePath.parse(candidate).root)
|
|
30532
30684
|
return void 0;
|
|
30533
|
-
const home = realpathOrResolve(homeDirOverride ??
|
|
30685
|
+
const home = realpathOrResolve(homeDirOverride ?? os12.homedir());
|
|
30534
30686
|
if (isAtOrAboveHomeDir(candidate, home))
|
|
30535
30687
|
return void 0;
|
|
30536
30688
|
if (candidate === tmp || isUnderDir(session, candidate))
|
|
@@ -31486,7 +31638,7 @@ async function collectSourceFilesForWarmup(rootDir, maxFiles = MAX_WARMUP_SOURCE
|
|
|
31486
31638
|
}
|
|
31487
31639
|
}
|
|
31488
31640
|
if (++processedSinceYield % yieldEvery === 0) {
|
|
31489
|
-
await new Promise((
|
|
31641
|
+
await new Promise((resolve153) => setImmediate(resolve153));
|
|
31490
31642
|
}
|
|
31491
31643
|
}
|
|
31492
31644
|
}
|
|
@@ -31625,7 +31777,7 @@ var init_language_profile = __esm({
|
|
|
31625
31777
|
});
|
|
31626
31778
|
|
|
31627
31779
|
// dist/clients/tool-cwd.js
|
|
31628
|
-
import * as
|
|
31780
|
+
import * as os13 from "node:os";
|
|
31629
31781
|
import { existsSync as existsSync15, readdirSync as readdirSync12 } from "node:fs";
|
|
31630
31782
|
import * as path46 from "node:path";
|
|
31631
31783
|
function _toolCwdEphemeralKey(parts) {
|
|
@@ -31711,7 +31863,7 @@ function resolveToolCwd(kind, tool, file, ctx) {
|
|
|
31711
31863
|
const dispatchRoot = path46.resolve(ctx.cwd ?? process.cwd());
|
|
31712
31864
|
const absoluteFile = realpathOrResolve(file);
|
|
31713
31865
|
const fileDir = path46.dirname(absoluteFile);
|
|
31714
|
-
const homeDir = ctx.homeDir ??
|
|
31866
|
+
const homeDir = ctx.homeDir ?? os13.homedir();
|
|
31715
31867
|
const homeCeiling = realpathOrResolve(homeDir);
|
|
31716
31868
|
const insideDispatch = isUnderDir(absoluteFile, dispatchRoot);
|
|
31717
31869
|
const markers = markersFor(kind, tool, absoluteFile, ctx);
|
|
@@ -31908,7 +32060,7 @@ var init_availability_probe_flight = __esm({
|
|
|
31908
32060
|
|
|
31909
32061
|
// dist/clients/package-manager.js
|
|
31910
32062
|
import * as fs42 from "node:fs";
|
|
31911
|
-
import * as
|
|
32063
|
+
import * as os14 from "node:os";
|
|
31912
32064
|
import * as path47 from "node:path";
|
|
31913
32065
|
import { resolve as resolvePath } from "node:path";
|
|
31914
32066
|
function onWindows() {
|
|
@@ -32072,7 +32224,7 @@ async function globalBinDirsFor(pm) {
|
|
|
32072
32224
|
}
|
|
32073
32225
|
async function probeGlobalBinDirs(pm, key4, scoped, generation) {
|
|
32074
32226
|
if (pm === "bun") {
|
|
32075
|
-
const base = process.env.BUN_INSTALL || path47.join(
|
|
32227
|
+
const base = process.env.BUN_INSTALL || path47.join(os14.homedir(), ".bun");
|
|
32076
32228
|
const dirs2 = [path47.join(base, "bin")];
|
|
32077
32229
|
generation.guardedWrite(key4, () => {
|
|
32078
32230
|
globalBinDirCache.set(key4, dirs2);
|
|
@@ -32082,7 +32234,7 @@ async function probeGlobalBinDirs(pm, key4, scoped, generation) {
|
|
|
32082
32234
|
const query = pm === "npm" ? ["config", "get", "prefix"] : pm === "pnpm" ? ["bin", "-g"] : ["global", "bin"];
|
|
32083
32235
|
const res = await safeSpawnAsync(pmBinary(pm), query, {
|
|
32084
32236
|
timeout: 5e3,
|
|
32085
|
-
...scoped && { cwd:
|
|
32237
|
+
...scoped && { cwd: os14.homedir() }
|
|
32086
32238
|
});
|
|
32087
32239
|
if (res.status !== 0 || res.error)
|
|
32088
32240
|
return [];
|
|
@@ -32175,7 +32327,7 @@ function* matchesInDir(dir, names, binDirs) {
|
|
|
32175
32327
|
}
|
|
32176
32328
|
}
|
|
32177
32329
|
function* localBinMatches(tools, startDir, options) {
|
|
32178
|
-
const { windowsExt = ".cmd", homeDir =
|
|
32330
|
+
const { windowsExt = ".cmd", homeDir = os14.homedir(), binDirs = NODE_MODULES_BIN_DIRS, isWindows: isWindows3 = onWindows(), ceiling = true } = options;
|
|
32179
32331
|
const names = expandCandidateNames(tools, windowsExt, isWindows3);
|
|
32180
32332
|
for (const dir of walkUpDirs(startDir, { spelling: true })) {
|
|
32181
32333
|
if (ceiling && isAtOrAboveHomeDir(dir, homeDir))
|
|
@@ -34021,7 +34173,7 @@ import fs46 from "node:fs/promises";
|
|
|
34021
34173
|
import { createHash as createHash11, randomUUID as randomUUID2 } from "node:crypto";
|
|
34022
34174
|
import https from "node:https";
|
|
34023
34175
|
import { createRequire } from "node:module";
|
|
34024
|
-
import
|
|
34176
|
+
import os15 from "node:os";
|
|
34025
34177
|
import path52 from "node:path";
|
|
34026
34178
|
import { createGunzip } from "node:zlib";
|
|
34027
34179
|
function getManagedToolsDir() {
|
|
@@ -34148,7 +34300,7 @@ async function acquireInstallLock() {
|
|
|
34148
34300
|
ownsLock: () => ownsTopGeneration(hold.generation)
|
|
34149
34301
|
};
|
|
34150
34302
|
}
|
|
34151
|
-
await new Promise((
|
|
34303
|
+
await new Promise((resolve153) => setTimeout(resolve153, 100));
|
|
34152
34304
|
}
|
|
34153
34305
|
return {
|
|
34154
34306
|
reason: `timed out after ${timeoutMs}ms waiting for shared tools install lock (${installLockOwner()})`
|
|
@@ -35010,7 +35162,7 @@ async function getNpmGlobalBinCandidates(onTransient) {
|
|
|
35010
35162
|
if (process.platform === "win32") {
|
|
35011
35163
|
add(path52.join(process.env.APPDATA || "", "npm"));
|
|
35012
35164
|
} else {
|
|
35013
|
-
add(path52.join(
|
|
35165
|
+
add(path52.join(os15.homedir(), ".npm-global", "bin"));
|
|
35014
35166
|
}
|
|
35015
35167
|
for (const dir of await allAvailableGlobalBinDirs(onTransient)) {
|
|
35016
35168
|
add(dir);
|
|
@@ -35070,7 +35222,7 @@ function userBaseProbeResult(result) {
|
|
|
35070
35222
|
async function probeUserBase(command) {
|
|
35071
35223
|
return userBaseProbeResult(await safeSpawnAsync(command, ["-m", "site", "--user-base"], {
|
|
35072
35224
|
timeout: USER_BASE_PROBE_TIMEOUT_MS,
|
|
35073
|
-
cwd:
|
|
35225
|
+
cwd: os15.homedir(),
|
|
35074
35226
|
ignoreAmbientSignal: true,
|
|
35075
35227
|
lifetimeCoupled: true
|
|
35076
35228
|
}));
|
|
@@ -35128,7 +35280,7 @@ function sameHost(a, b) {
|
|
|
35128
35280
|
}
|
|
35129
35281
|
}
|
|
35130
35282
|
function httpsGetWithMeta(url, maxRedirects = 5, headers = {}) {
|
|
35131
|
-
return new Promise((
|
|
35283
|
+
return new Promise((resolve153, reject) => {
|
|
35132
35284
|
https.get(url, { headers: { "User-Agent": "pi-lens/1.0", ...headers } }, (res) => {
|
|
35133
35285
|
if (res.statusCode && res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
|
|
35134
35286
|
if (maxRedirects === 0)
|
|
@@ -35138,12 +35290,12 @@ function httpsGetWithMeta(url, maxRedirects = 5, headers = {}) {
|
|
|
35138
35290
|
const { Authorization: _drop, ...rest } = headers;
|
|
35139
35291
|
return rest;
|
|
35140
35292
|
})();
|
|
35141
|
-
return
|
|
35293
|
+
return resolve153(httpsGetWithMeta(location, maxRedirects - 1, nextHeaders));
|
|
35142
35294
|
}
|
|
35143
35295
|
const etag = typeof res.headers.etag === "string" ? res.headers.etag : void 0;
|
|
35144
35296
|
if (res.statusCode === 304) {
|
|
35145
35297
|
res.resume();
|
|
35146
|
-
return
|
|
35298
|
+
return resolve153({ statusCode: 304, body: Buffer.alloc(0), etag });
|
|
35147
35299
|
}
|
|
35148
35300
|
if (res.statusCode !== 200) {
|
|
35149
35301
|
res.resume();
|
|
@@ -35151,7 +35303,7 @@ function httpsGetWithMeta(url, maxRedirects = 5, headers = {}) {
|
|
|
35151
35303
|
}
|
|
35152
35304
|
const chunks = [];
|
|
35153
35305
|
res.on("data", (chunk) => chunks.push(chunk));
|
|
35154
|
-
res.on("end", () =>
|
|
35306
|
+
res.on("end", () => resolve153({ statusCode: 200, body: Buffer.concat(chunks), etag }));
|
|
35155
35307
|
res.on("error", reject);
|
|
35156
35308
|
}).on("error", reject);
|
|
35157
35309
|
});
|
|
@@ -35260,11 +35412,11 @@ exec ${launcherRuntime} "$(dirname "$0")/${runtimeTarget}" "$@"
|
|
|
35260
35412
|
mode: isWindows3 ? void 0 : 488
|
|
35261
35413
|
});
|
|
35262
35414
|
} else if (assetName.endsWith(".gz") && !assetName.endsWith(".tar.gz")) {
|
|
35263
|
-
const decompressed = await new Promise((
|
|
35415
|
+
const decompressed = await new Promise((resolve153, reject) => {
|
|
35264
35416
|
const gunzip = createGunzip();
|
|
35265
35417
|
const chunks = [];
|
|
35266
35418
|
gunzip.on("data", (chunk) => chunks.push(chunk));
|
|
35267
|
-
gunzip.on("end", () =>
|
|
35419
|
+
gunzip.on("end", () => resolve153(Buffer.concat(chunks)));
|
|
35268
35420
|
gunzip.on("error", reject);
|
|
35269
35421
|
gunzip.end(assetBuffer);
|
|
35270
35422
|
});
|
|
@@ -36188,7 +36340,7 @@ async function pipConstraintEnvFor(toolId) {
|
|
|
36188
36340
|
return {};
|
|
36189
36341
|
const directories = [
|
|
36190
36342
|
path52.join(getGlobalPiLensDir(), "pip-constraints"),
|
|
36191
|
-
path52.join(
|
|
36343
|
+
path52.join(os15.tmpdir(), "pi-lens-pip-constraints")
|
|
36192
36344
|
];
|
|
36193
36345
|
const directory = directories.find((candidate) => !/\s/.test(candidate));
|
|
36194
36346
|
if (!directory) {
|
|
@@ -36297,7 +36449,7 @@ async function installPipTool(toolId, packageName, binaryName, options = {}) {
|
|
|
36297
36449
|
"--value",
|
|
36298
36450
|
"PIPX_BIN_DIR"
|
|
36299
36451
|
]);
|
|
36300
|
-
const binDir = location.status === 0 && location.stdout.trim() ? location.stdout.trim() : path52.join(
|
|
36452
|
+
const binDir = location.status === 0 && location.stdout.trim() ? location.stdout.trim() : path52.join(os15.homedir(), ".local", "bin");
|
|
36301
36453
|
const binaryPath = await addBinToPath(binDir);
|
|
36302
36454
|
if (binaryPath)
|
|
36303
36455
|
return succeeded("pipx", binaryPath);
|
|
@@ -37019,8 +37171,8 @@ var init_installer = __esm({
|
|
|
37019
37171
|
checkCommand: "jscpd",
|
|
37020
37172
|
checkArgs: ["--version"],
|
|
37021
37173
|
installStrategy: "npm",
|
|
37022
|
-
packageName: "jscpd@5.4.
|
|
37023
|
-
// v5.4.
|
|
37174
|
+
packageName: "jscpd@5.4.2",
|
|
37175
|
+
// v5.4.2 is the repository's exact devDependency; the v4 packaging defect that required the older v5.0.12 pin is gone, and parseReport() reads the unchanged clone-report fields.
|
|
37024
37176
|
binaryName: "jscpd"
|
|
37025
37177
|
},
|
|
37026
37178
|
// Structural search and dead code detection
|
|
@@ -38251,7 +38403,7 @@ var init_ruby_drive_dirs = __esm({
|
|
|
38251
38403
|
import { AsyncLocalStorage as AsyncLocalStorage4 } from "node:async_hooks";
|
|
38252
38404
|
import { spawn as nodeSpawn3 } from "node:child_process";
|
|
38253
38405
|
import fs48 from "node:fs";
|
|
38254
|
-
import
|
|
38406
|
+
import os16 from "node:os";
|
|
38255
38407
|
import path53 from "node:path";
|
|
38256
38408
|
function computeNeedsShell(resolvedCommand) {
|
|
38257
38409
|
return isWindows2 && (resolvedCommand.includes(" ") || /\.(cmd|bat)$/i.test(resolvedCommand) || !/\.(exe|cmd|bat)$/i.test(resolvedCommand));
|
|
@@ -38332,7 +38484,7 @@ async function buildAugmentedPath(basePath) {
|
|
|
38332
38484
|
candidates.push(nodeDir);
|
|
38333
38485
|
}
|
|
38334
38486
|
if (isWindows2) {
|
|
38335
|
-
const home =
|
|
38487
|
+
const home = os16.homedir();
|
|
38336
38488
|
const driveRoot = path53.parse(home).root;
|
|
38337
38489
|
candidates.push(path53.join(home, ".cargo", "bin"));
|
|
38338
38490
|
candidates.push(path53.join(home, "go", "bin"));
|
|
@@ -38704,7 +38856,7 @@ async function launchLSP(command, args = [], options = {}) {
|
|
|
38704
38856
|
};
|
|
38705
38857
|
proc.stderr?.on("data", onStartupStderr);
|
|
38706
38858
|
try {
|
|
38707
|
-
await new Promise((
|
|
38859
|
+
await new Promise((resolve153, reject) => {
|
|
38708
38860
|
let settled = false;
|
|
38709
38861
|
proc.on("error", (err) => {
|
|
38710
38862
|
if (!settled) {
|
|
@@ -38741,7 +38893,7 @@ async function launchLSP(command, args = [], options = {}) {
|
|
|
38741
38893
|
setTimeout(() => {
|
|
38742
38894
|
if (!settled) {
|
|
38743
38895
|
settled = true;
|
|
38744
|
-
|
|
38896
|
+
resolve153();
|
|
38745
38897
|
}
|
|
38746
38898
|
}, startupFailureWindowMs);
|
|
38747
38899
|
});
|
|
@@ -38831,7 +38983,7 @@ var init_file_server_match = __esm({
|
|
|
38831
38983
|
|
|
38832
38984
|
// dist/clients/cargo-manifest.js
|
|
38833
38985
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
38834
|
-
import * as
|
|
38986
|
+
import * as os17 from "node:os";
|
|
38835
38987
|
import * as path55 from "node:path";
|
|
38836
38988
|
async function readTextFileOrUndefined(filePath) {
|
|
38837
38989
|
try {
|
|
@@ -38961,7 +39113,7 @@ function readWorkspacePackageEdition(content) {
|
|
|
38961
39113
|
const workspaceSection = extractTomlTableSection(content, "workspace.package");
|
|
38962
39114
|
return parseTomlScalarString(workspaceSection, "edition");
|
|
38963
39115
|
}
|
|
38964
|
-
async function resolveCargoPackageEdition(filePath, homeDir =
|
|
39116
|
+
async function resolveCargoPackageEdition(filePath, homeDir = os17.homedir()) {
|
|
38965
39117
|
const startDir = path55.dirname(path55.resolve(filePath));
|
|
38966
39118
|
const packageDir = findNearestMarkerRoot(startDir, ["Cargo.toml"], {
|
|
38967
39119
|
homeDir
|
|
@@ -39454,7 +39606,7 @@ var init_language_registry = __esm({
|
|
|
39454
39606
|
|
|
39455
39607
|
// dist/clients/review-graph/tsconfig-paths.js
|
|
39456
39608
|
import * as fs49 from "node:fs";
|
|
39457
|
-
import * as
|
|
39609
|
+
import * as os18 from "node:os";
|
|
39458
39610
|
import * as path56 from "node:path";
|
|
39459
39611
|
function stripTrailingCommas(content) {
|
|
39460
39612
|
let output = "";
|
|
@@ -39674,7 +39826,7 @@ function collectReferencedProjects(configPath, result, visited) {
|
|
|
39674
39826
|
collectReferencedProjects(referencedConfig, result, visited);
|
|
39675
39827
|
}
|
|
39676
39828
|
}
|
|
39677
|
-
function parseTsconfigPaths(cwd, homeDir =
|
|
39829
|
+
function parseTsconfigPaths(cwd, homeDir = os18.homedir()) {
|
|
39678
39830
|
const normalizedCwd = path56.resolve(cwd);
|
|
39679
39831
|
const configDir = findGoverningTsconfigDir(normalizedCwd, homeDir);
|
|
39680
39832
|
const configPath = configDir ? path56.join(configDir, "tsconfig.json") : "";
|
|
@@ -39744,7 +39896,7 @@ var init_tsconfig_paths = __esm({
|
|
|
39744
39896
|
|
|
39745
39897
|
// dist/clients/python-environment.js
|
|
39746
39898
|
import { access, readFile as readFile3 } from "node:fs/promises";
|
|
39747
|
-
import
|
|
39899
|
+
import os19 from "node:os";
|
|
39748
39900
|
import path57, { dirname as dirname22, join as join45 } from "node:path";
|
|
39749
39901
|
async function findUvWorkspace(startDir, homeDir) {
|
|
39750
39902
|
let walkStart;
|
|
@@ -39795,7 +39947,7 @@ function isUvWorkspaceMember(workspace, projectRoot) {
|
|
|
39795
39947
|
function hasAmbientPythonEnvironment(env = process.env) {
|
|
39796
39948
|
return Object.values(AMBIENT_ENVIRONMENT_VARIABLES).some((name2) => Boolean(env[name2]));
|
|
39797
39949
|
}
|
|
39798
|
-
async function detectPythonEnvironment(projectRoot, homeDir =
|
|
39950
|
+
async function detectPythonEnvironment(projectRoot, homeDir = os19.homedir(), options = {}) {
|
|
39799
39951
|
const root = realpathOrResolve(projectRoot);
|
|
39800
39952
|
const uvWorkspace = await findUvWorkspace(root, homeDir);
|
|
39801
39953
|
const isProjectRoot = uvWorkspace?.isStartDir === true;
|
|
@@ -40085,7 +40237,7 @@ async function readPythonDeclarationInDirectory(dir, open) {
|
|
|
40085
40237
|
}
|
|
40086
40238
|
return { declaration: void 0, closed };
|
|
40087
40239
|
}
|
|
40088
|
-
async function detectPythonTargetVersion(filePath, homeDir =
|
|
40240
|
+
async function detectPythonTargetVersion(filePath, homeDir = os19.homedir()) {
|
|
40089
40241
|
if (resolveLanguage(filePath)?.id !== "python")
|
|
40090
40242
|
return void 0;
|
|
40091
40243
|
const open = new Set(PYTHON_DECLARATION_SOURCES);
|
|
@@ -40841,7 +40993,7 @@ var init_wait_policy = __esm({
|
|
|
40841
40993
|
|
|
40842
40994
|
// dist/clients/lsp/lombok.js
|
|
40843
40995
|
import * as fs50 from "node:fs";
|
|
40844
|
-
import * as
|
|
40996
|
+
import * as os20 from "node:os";
|
|
40845
40997
|
import * as path59 from "node:path";
|
|
40846
40998
|
function fileExists(filePath) {
|
|
40847
40999
|
if (!filePath)
|
|
@@ -40909,7 +41061,7 @@ function newestExistingJar(candidates) {
|
|
|
40909
41061
|
}
|
|
40910
41062
|
return best?.filePath;
|
|
40911
41063
|
}
|
|
40912
|
-
function mavenLocalLombokJar(home =
|
|
41064
|
+
function mavenLocalLombokJar(home = os20.homedir()) {
|
|
40913
41065
|
const base = path59.join(home, ".m2", "repository", "org", "projectlombok", "lombok");
|
|
40914
41066
|
let versions = [];
|
|
40915
41067
|
try {
|
|
@@ -40919,7 +41071,7 @@ function mavenLocalLombokJar(home = os19.homedir()) {
|
|
|
40919
41071
|
}
|
|
40920
41072
|
return newestExistingJar(versions.map((version) => path59.join(base, version, `lombok-${version}.jar`)));
|
|
40921
41073
|
}
|
|
40922
|
-
function gradleCacheLombokJar(home =
|
|
41074
|
+
function gradleCacheLombokJar(home = os20.homedir()) {
|
|
40923
41075
|
const base = path59.join(home, ".gradle", "caches", "modules-2", "files-2.1", "org.projectlombok", "lombok");
|
|
40924
41076
|
const candidates = [];
|
|
40925
41077
|
let versions = [];
|
|
@@ -40983,7 +41135,7 @@ var init_lombok = __esm({
|
|
|
40983
41135
|
|
|
40984
41136
|
// dist/clients/lsp/jvm-runtime.js
|
|
40985
41137
|
import { existsSync as existsSync19, readdirSync as readdirSync16 } from "node:fs";
|
|
40986
|
-
import
|
|
41138
|
+
import os21 from "node:os";
|
|
40987
41139
|
import path60 from "node:path";
|
|
40988
41140
|
function jdkHomeFrom(dir) {
|
|
40989
41141
|
if (existsSync19(path60.join(dir, "bin", JAVA_EXE)))
|
|
@@ -41008,7 +41160,7 @@ function childDirs(base) {
|
|
|
41008
41160
|
}
|
|
41009
41161
|
}
|
|
41010
41162
|
function candidateRoots() {
|
|
41011
|
-
const home =
|
|
41163
|
+
const home = os21.homedir();
|
|
41012
41164
|
const roots2 = [];
|
|
41013
41165
|
roots2.push(path60.join(home, ".jdks"));
|
|
41014
41166
|
roots2.push(path60.join(getGlobalPiLensDir(), "tools"));
|
|
@@ -41211,8 +41363,8 @@ var init_server_covers = __esm({
|
|
|
41211
41363
|
|
|
41212
41364
|
// dist/clients/lsp/server.js
|
|
41213
41365
|
import { existsSync as existsSync20, mkdirSync as mkdirSync8, statSync as statSync28 } from "node:fs";
|
|
41214
|
-
import { access as access2, readFile as readFile4, readdir as readdir2, realpath
|
|
41215
|
-
import
|
|
41366
|
+
import { access as access2, readFile as readFile4, readdir as readdir2, realpath, stat as stat2 } from "node:fs/promises";
|
|
41367
|
+
import os22 from "node:os";
|
|
41216
41368
|
import path61 from "node:path";
|
|
41217
41369
|
function withRootMarkers(root, markers) {
|
|
41218
41370
|
root.rootMarkers = markers;
|
|
@@ -41924,7 +42076,7 @@ function piAgentExtensionsRootKey(file) {
|
|
|
41924
42076
|
return dirKey.slice(0, index + marker.length);
|
|
41925
42077
|
}
|
|
41926
42078
|
function IgnoreHomeRoot(primary2) {
|
|
41927
|
-
const homeKey = normalizeEphemeralMapKey(realpathOrResolve(
|
|
42079
|
+
const homeKey = normalizeEphemeralMapKey(realpathOrResolve(os22.homedir()));
|
|
41928
42080
|
return withRootMarkers(async (file) => {
|
|
41929
42081
|
const root = await primary2(file);
|
|
41930
42082
|
if (!root)
|
|
@@ -41934,7 +42086,7 @@ function IgnoreHomeRoot(primary2) {
|
|
|
41934
42086
|
}
|
|
41935
42087
|
function rubyBinCandidates(baseName2) {
|
|
41936
42088
|
const candidates = [];
|
|
41937
|
-
const home =
|
|
42089
|
+
const home = os22.homedir();
|
|
41938
42090
|
const isWin = process.platform === "win32";
|
|
41939
42091
|
const ext2 = isWin ? ".bat" : "";
|
|
41940
42092
|
candidates.push(path61.join(home, ".local", "share", "mise", "installs", "ruby", "bin", `${baseName2}${ext2}`));
|
|
@@ -41991,8 +42143,8 @@ function createInteractiveServer(spec) {
|
|
|
41991
42143
|
function PriorityRoot(markerGroups, excludePatterns, stopDir) {
|
|
41992
42144
|
const resolvers = markerGroups.map((markers) => NearestRoot(markers, excludePatterns, stopDir));
|
|
41993
42145
|
return withRootMarkers(async (file) => {
|
|
41994
|
-
for (const
|
|
41995
|
-
const root = await
|
|
42146
|
+
for (const resolve153 of resolvers) {
|
|
42147
|
+
const root = await resolve153(file);
|
|
41996
42148
|
if (root)
|
|
41997
42149
|
return root;
|
|
41998
42150
|
}
|
|
@@ -42002,7 +42154,7 @@ function PriorityRoot(markerGroups, excludePatterns, stopDir) {
|
|
|
42002
42154
|
function declinesLooseFileRoot(server, root) {
|
|
42003
42155
|
if (server.looseFileRoot !== "decline")
|
|
42004
42156
|
return false;
|
|
42005
|
-
return isAtOrAboveHomeDir(realpathOrResolve(root), realpathOrResolve(
|
|
42157
|
+
return isAtOrAboveHomeDir(realpathOrResolve(root), realpathOrResolve(os22.homedir()));
|
|
42006
42158
|
}
|
|
42007
42159
|
async function declinesProjectlessRoot(server, root) {
|
|
42008
42160
|
if (server.spawnNeedsProjectFile !== true)
|
|
@@ -42124,7 +42276,7 @@ function NearestRoot(includePatterns, excludePatterns, stopDir) {
|
|
|
42124
42276
|
}
|
|
42125
42277
|
}
|
|
42126
42278
|
for (const pattern of includePatterns) {
|
|
42127
|
-
if (await markerExists(currentDir, pattern) && (pattern !== ".git" || currentDir !== realpathOrResolve(
|
|
42279
|
+
if (await markerExists(currentDir, pattern) && (pattern !== ".git" || currentDir !== realpathOrResolve(os22.tmpdir())) && !await isExcludedLspRoot(currentDir)) {
|
|
42128
42280
|
return enforceLspRootCeiling(currentDir, process.cwd(), identity);
|
|
42129
42281
|
}
|
|
42130
42282
|
}
|
|
@@ -42243,7 +42395,7 @@ async function absoluteCommandPath(command) {
|
|
|
42243
42395
|
if (!command || path61.isAbsolute(command))
|
|
42244
42396
|
return command;
|
|
42245
42397
|
const found = await findCommandAsync(command);
|
|
42246
|
-
return found ?
|
|
42398
|
+
return found ? realpath(found).catch(() => void 0) : void 0;
|
|
42247
42399
|
}
|
|
42248
42400
|
async function findTsserverPath(root, allowInstall, options) {
|
|
42249
42401
|
const fs152 = await import("node:fs/promises");
|
|
@@ -42359,7 +42511,7 @@ async function findNativeTypeScriptLsp(root) {
|
|
|
42359
42511
|
return void 0;
|
|
42360
42512
|
}
|
|
42361
42513
|
function dotnetToolCandidates(tool) {
|
|
42362
|
-
const home =
|
|
42514
|
+
const home = os22.homedir();
|
|
42363
42515
|
return [
|
|
42364
42516
|
path61.join(PI_LENS_BIN_DIR2, `${tool}.exe`),
|
|
42365
42517
|
path61.join(PI_LENS_BIN_DIR2, tool),
|
|
@@ -42381,11 +42533,11 @@ function binExeVariants(dir, tool) {
|
|
|
42381
42533
|
return admitted;
|
|
42382
42534
|
}
|
|
42383
42535
|
function goBinCandidates(tool) {
|
|
42384
|
-
const gopath = process.env.GOPATH?.split(path61.delimiter)[0] || path61.join(
|
|
42536
|
+
const gopath = process.env.GOPATH?.split(path61.delimiter)[0] || path61.join(os22.homedir(), "go");
|
|
42385
42537
|
return [tool, ...binExeVariants(path61.join(gopath, "bin"), tool)];
|
|
42386
42538
|
}
|
|
42387
42539
|
function cargoBinCandidates(tool) {
|
|
42388
|
-
const cargoHome = process.env.CARGO_HOME || path61.join(
|
|
42540
|
+
const cargoHome = process.env.CARGO_HOME || path61.join(os22.homedir(), ".cargo");
|
|
42389
42541
|
return [tool, ...binExeVariants(path61.join(cargoHome, "bin"), tool)];
|
|
42390
42542
|
}
|
|
42391
42543
|
async function tryGemInstall(gem) {
|
|
@@ -44212,7 +44364,7 @@ var init_session_roots = __esm({
|
|
|
44212
44364
|
});
|
|
44213
44365
|
|
|
44214
44366
|
// dist/clients/lsp/config.js
|
|
44215
|
-
import * as
|
|
44367
|
+
import * as os23 from "node:os";
|
|
44216
44368
|
import path63 from "node:path";
|
|
44217
44369
|
function asRecord2(value) {
|
|
44218
44370
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
@@ -44248,7 +44400,7 @@ function recordConfigResolved(cwd, resolution, lspConfig, homeDir, resolveMs) {
|
|
|
44248
44400
|
});
|
|
44249
44401
|
logSessionStart(`config resolved documents=${summary.documents.length} legacy=${legacyDocuments} records=${summary.recordCount} deniedServers=${deniedServers} resolveMs=${resolveMs} session=${sessionId} root=${root}`);
|
|
44250
44402
|
}
|
|
44251
|
-
async function loadLSPConfig(cwd, homeDir =
|
|
44403
|
+
async function loadLSPConfig(cwd, homeDir = os23.homedir(), options = {}) {
|
|
44252
44404
|
const reporting = options.report !== false;
|
|
44253
44405
|
publishConfigResolutionPending(cwd);
|
|
44254
44406
|
const resolveStartedAt = Date.now();
|
|
@@ -44593,7 +44745,7 @@ async function initLSPConfig(cwd) {
|
|
|
44593
44745
|
if (existing)
|
|
44594
44746
|
return existing;
|
|
44595
44747
|
const promise = (async () => {
|
|
44596
|
-
const config = registerLSPConfig(await loadLSPConfig(cwd,
|
|
44748
|
+
const config = registerLSPConfig(await loadLSPConfig(cwd, os23.homedir()));
|
|
44597
44749
|
forgetConfigResolvedClaims(setSessionRootConfig(normalizedCwd, config));
|
|
44598
44750
|
})();
|
|
44599
44751
|
configInFlight.set(normalizedCwd, promise);
|
|
@@ -48317,7 +48469,7 @@ function saveProjectSnapshot(cwd, snapshot) {
|
|
|
48317
48469
|
}
|
|
48318
48470
|
async function waitForProjectSnapshotPersistsForTests() {
|
|
48319
48471
|
for (let attempts2 = 0; attempts2 < 200 && (_snapshotWorkerRequests.size > 0 || _activeSnapshotPersists.size > 0 || _queuedSnapshotPersists.size > 0); attempts2++) {
|
|
48320
|
-
await new Promise((
|
|
48472
|
+
await new Promise((resolve153) => setTimeout(resolve153, 10));
|
|
48321
48473
|
}
|
|
48322
48474
|
}
|
|
48323
48475
|
function flushProjectSnapshotPersistsForTests() {
|
|
@@ -48879,8 +49031,7 @@ function getAutofixPolicyForFile(filePath, context = {}) {
|
|
|
48879
49031
|
defaultTool: "biome",
|
|
48880
49032
|
defaultWhenUnconfigured: true,
|
|
48881
49033
|
gate: "smart-default",
|
|
48882
|
-
safe: true
|
|
48883
|
-
scope: "cargo-project"
|
|
49034
|
+
safe: true
|
|
48884
49035
|
};
|
|
48885
49036
|
}
|
|
48886
49037
|
if ([".json", ".jsonc"].includes(ext2)) {
|
|
@@ -51967,12 +52118,12 @@ var init_runner_helpers = __esm({
|
|
|
51967
52118
|
});
|
|
51968
52119
|
|
|
51969
52120
|
// dist/clients/scanner-temp-root.js
|
|
51970
|
-
import * as
|
|
52121
|
+
import * as os24 from "node:os";
|
|
51971
52122
|
function scannerReportParentDir() {
|
|
51972
52123
|
if (!isTestMode() && process.env.PI_LENS_TEST_SCANNER_HARNESS !== "1")
|
|
51973
|
-
return
|
|
52124
|
+
return os24.tmpdir();
|
|
51974
52125
|
const override = process.env.PI_LENS_TEST_SCANNER_TMPDIR?.trim();
|
|
51975
|
-
return override && override.length > 0 ? override :
|
|
52126
|
+
return override && override.length > 0 ? override : os24.tmpdir();
|
|
51976
52127
|
}
|
|
51977
52128
|
var init_scanner_temp_root = __esm({
|
|
51978
52129
|
"dist/clients/scanner-temp-root.js"() {
|
|
@@ -52746,7 +52897,7 @@ ${lines.join("\n")}${suffix}`;
|
|
|
52746
52897
|
|
|
52747
52898
|
// dist/clients/ast-grep-client.js
|
|
52748
52899
|
import * as fs59 from "node:fs";
|
|
52749
|
-
import * as
|
|
52900
|
+
import * as os25 from "node:os";
|
|
52750
52901
|
import * as path71 from "node:path";
|
|
52751
52902
|
function reportAstGrepRulesHealth(bundledRuleDir) {
|
|
52752
52903
|
const health = checkAstGrepRulesHealth(bundledRuleDir);
|
|
@@ -53040,7 +53191,7 @@ var init_ast_grep_client = __esm({
|
|
|
53040
53191
|
* Dump the parsed tree-sitter AST for a snippet using ast-grep CLI.
|
|
53041
53192
|
*/
|
|
53042
53193
|
async dumpAst(source, lang, options = {}) {
|
|
53043
|
-
const tmpDir = fs59.mkdtempSync(path71.join(
|
|
53194
|
+
const tmpDir = fs59.mkdtempSync(path71.join(os25.tmpdir(), "pi-lens-ast-dump-"));
|
|
53044
53195
|
const tmpFile = path71.join(tmpDir, `snippet.${lang.replace(/[^a-z0-9_-]/gi, "") || "txt"}`);
|
|
53045
53196
|
try {
|
|
53046
53197
|
fs59.writeFileSync(tmpFile, source, "utf-8");
|
|
@@ -53070,7 +53221,7 @@ var init_ast_grep_client = __esm({
|
|
|
53070
53221
|
if (shapeError)
|
|
53071
53222
|
return { valid: false, error: shapeError };
|
|
53072
53223
|
const snippet = validationSnippetFor(lang);
|
|
53073
|
-
const tmpDir = fs59.mkdtempSync(path71.join(
|
|
53224
|
+
const tmpDir = fs59.mkdtempSync(path71.join(os25.tmpdir(), "pi-lens-sg-validate-"));
|
|
53074
53225
|
const tmpFile = path71.join(tmpDir, `snippet.${snippet.ext}`);
|
|
53075
53226
|
try {
|
|
53076
53227
|
fs59.writeFileSync(tmpFile, snippet.source, "utf-8");
|
|
@@ -53117,7 +53268,7 @@ var init_ast_grep_client = __esm({
|
|
|
53117
53268
|
return { valid: false, error: shapeError };
|
|
53118
53269
|
const language = extractRuleLanguage(ruleYaml) ?? "typescript";
|
|
53119
53270
|
const snippet = validationSnippetFor(language);
|
|
53120
|
-
const tmpDir = fs59.mkdtempSync(path71.join(
|
|
53271
|
+
const tmpDir = fs59.mkdtempSync(path71.join(os25.tmpdir(), "pi-lens-sg-rule-"));
|
|
53121
53272
|
try {
|
|
53122
53273
|
fs59.writeFileSync(path71.join(tmpDir, `snippet.${snippet.ext}`), snippet.source, "utf-8");
|
|
53123
53274
|
const result = await this.tempScanDetailed(tmpDir, ruleYaml, options);
|
|
@@ -60170,19 +60321,17 @@ function isGrammarLoadTimeout(err) {
|
|
|
60170
60321
|
return err instanceof Error && err.message === `Timeout after ${GRAMMAR_LOAD_TIMEOUT_MS}ms`;
|
|
60171
60322
|
}
|
|
60172
60323
|
function grammarWriteBlockedReason(dir) {
|
|
60173
|
-
|
|
60174
|
-
|
|
60175
|
-
|
|
60176
|
-
|
|
60177
|
-
|
|
60178
|
-
|
|
60179
|
-
|
|
60180
|
-
|
|
60181
|
-
|
|
60182
|
-
return void 0;
|
|
60183
|
-
} catch (err) {
|
|
60184
|
-
return err?.code ?? "EACCES";
|
|
60324
|
+
for (const candidate of walkUpDirs(dir)) {
|
|
60325
|
+
if (!fs72.existsSync(candidate))
|
|
60326
|
+
continue;
|
|
60327
|
+
try {
|
|
60328
|
+
fs72.accessSync(candidate, fs72.constants.W_OK);
|
|
60329
|
+
return void 0;
|
|
60330
|
+
} catch (err) {
|
|
60331
|
+
return err?.code ?? "EACCES";
|
|
60332
|
+
}
|
|
60185
60333
|
}
|
|
60334
|
+
return "ENOENT";
|
|
60186
60335
|
}
|
|
60187
60336
|
function grammarFileStamp(filePath) {
|
|
60188
60337
|
try {
|
|
@@ -60234,6 +60383,7 @@ var init_tree_sitter_client = __esm({
|
|
|
60234
60383
|
init_file_utils();
|
|
60235
60384
|
init_grammar_source();
|
|
60236
60385
|
init_package_root();
|
|
60386
|
+
init_path_utils();
|
|
60237
60387
|
init_web_tree_sitter_dir();
|
|
60238
60388
|
init_project_trust();
|
|
60239
60389
|
init_string_utils();
|
|
@@ -65410,7 +65560,7 @@ __export(govulncheck_client_exports, {
|
|
|
65410
65560
|
parseGovulncheckJson: () => parseGovulncheckJson
|
|
65411
65561
|
});
|
|
65412
65562
|
import * as fs75 from "node:fs";
|
|
65413
|
-
import * as
|
|
65563
|
+
import * as os26 from "node:os";
|
|
65414
65564
|
import * as path89 from "node:path";
|
|
65415
65565
|
function parseGovulncheckJson(stream) {
|
|
65416
65566
|
if (!stream.trim())
|
|
@@ -65710,7 +65860,7 @@ var init_govulncheck_client = __esm({
|
|
|
65710
65860
|
});
|
|
65711
65861
|
return true;
|
|
65712
65862
|
}
|
|
65713
|
-
const homeDir =
|
|
65863
|
+
const homeDir = os26.homedir();
|
|
65714
65864
|
const isWin = process.platform === "win32";
|
|
65715
65865
|
const ext2 = isWin ? ".exe" : "";
|
|
65716
65866
|
const candidates = [
|
|
@@ -66942,7 +67092,7 @@ __export(dead_code_client_exports, {
|
|
|
66942
67092
|
});
|
|
66943
67093
|
import * as fs79 from "node:fs";
|
|
66944
67094
|
import * as path94 from "node:path";
|
|
66945
|
-
import { resolve as
|
|
67095
|
+
import { resolve as resolve51 } from "node:path";
|
|
66946
67096
|
function emptyResult(language) {
|
|
66947
67097
|
return {
|
|
66948
67098
|
success: false,
|
|
@@ -67080,7 +67230,7 @@ var init_dead_code_client = __esm({
|
|
|
67080
67230
|
const root = this.resolveProjectRoot(cwd || process.cwd());
|
|
67081
67231
|
if (!root)
|
|
67082
67232
|
return null;
|
|
67083
|
-
return this.hardFailures.recent(
|
|
67233
|
+
return this.hardFailures.recent(resolve51(root));
|
|
67084
67234
|
}
|
|
67085
67235
|
get minConfidence() {
|
|
67086
67236
|
const raw = Number.parseInt(process.env.PI_LENS_VULTURE_MIN_CONFIDENCE ?? "60", 10);
|
|
@@ -69059,7 +69209,7 @@ import * as path99 from "node:path";
|
|
|
69059
69209
|
function resolveAgainstAncestors(cwd, filePath) {
|
|
69060
69210
|
filePath = normalizeHostToolPath(filePath);
|
|
69061
69211
|
if (path99.isAbsolute(filePath)) {
|
|
69062
|
-
return
|
|
69212
|
+
return filePath;
|
|
69063
69213
|
}
|
|
69064
69214
|
const normalizedRelative = filePath.replace(/\\/g, "/");
|
|
69065
69215
|
const cwdBaseName = path99.basename(path99.resolve(cwd)).replace(/\\/g, "/");
|
|
@@ -76177,8 +76327,8 @@ var require_semaphore = __commonJS({
|
|
|
76177
76327
|
this._waiting = [];
|
|
76178
76328
|
}
|
|
76179
76329
|
lock(thunk) {
|
|
76180
|
-
return new Promise((
|
|
76181
|
-
this._waiting.push({ thunk, resolve:
|
|
76330
|
+
return new Promise((resolve153, reject) => {
|
|
76331
|
+
this._waiting.push({ thunk, resolve: resolve153, reject });
|
|
76182
76332
|
this.runNext();
|
|
76183
76333
|
});
|
|
76184
76334
|
}
|
|
@@ -77804,9 +77954,9 @@ ${JSON.stringify(message, null, 4)}`);
|
|
|
77804
77954
|
if (typeof cancellationStrategy.sender.enableCancellation === "function") {
|
|
77805
77955
|
cancellationStrategy.sender.enableCancellation(requestMessage);
|
|
77806
77956
|
}
|
|
77807
|
-
return new Promise(async (
|
|
77957
|
+
return new Promise(async (resolve153, reject) => {
|
|
77808
77958
|
const resolveWithCleanup = (r) => {
|
|
77809
|
-
|
|
77959
|
+
resolve153(r);
|
|
77810
77960
|
cancellationStrategy.sender.cleanup(id);
|
|
77811
77961
|
disposable?.dispose();
|
|
77812
77962
|
};
|
|
@@ -78235,10 +78385,10 @@ var require_ril = __commonJS({
|
|
|
78235
78385
|
return api_1.Disposable.create(() => this.stream.off("end", listener));
|
|
78236
78386
|
}
|
|
78237
78387
|
write(data, encoding) {
|
|
78238
|
-
return new Promise((
|
|
78388
|
+
return new Promise((resolve153, reject) => {
|
|
78239
78389
|
const callback = (error) => {
|
|
78240
78390
|
if (error === void 0 || error === null) {
|
|
78241
|
-
|
|
78391
|
+
resolve153();
|
|
78242
78392
|
} else {
|
|
78243
78393
|
reject(error);
|
|
78244
78394
|
}
|
|
@@ -78375,7 +78525,7 @@ var require_main = __commonJS({
|
|
|
78375
78525
|
var ril_1 = __importDefault(require_ril());
|
|
78376
78526
|
ril_1.default.install();
|
|
78377
78527
|
var path234 = __importStar(__require("path"));
|
|
78378
|
-
var
|
|
78528
|
+
var os38 = __importStar(__require("os"));
|
|
78379
78529
|
var fs152 = __importStar(__require("fs"));
|
|
78380
78530
|
var crypto_1 = __require("crypto");
|
|
78381
78531
|
var net_1 = __require("net");
|
|
@@ -78517,7 +78667,7 @@ var require_main = __commonJS({
|
|
|
78517
78667
|
}
|
|
78518
78668
|
let randomLength = 32;
|
|
78519
78669
|
const fixedLength = "/lsp-.sock".length;
|
|
78520
|
-
const tmpDir = fs152.realpathSync(XDG_RUNTIME_DIR ??
|
|
78670
|
+
const tmpDir = fs152.realpathSync(XDG_RUNTIME_DIR ?? os38.tmpdir());
|
|
78521
78671
|
const limit = safeIpcPathLengths.get(process.platform);
|
|
78522
78672
|
if (limit !== void 0) {
|
|
78523
78673
|
randomLength = Math.min(limit - tmpDir.length - fixedLength, randomLength);
|
|
@@ -78530,10 +78680,10 @@ var require_main = __commonJS({
|
|
|
78530
78680
|
}
|
|
78531
78681
|
function createClientPipeTransport(pipeName, encoding = "utf-8") {
|
|
78532
78682
|
let connectResolve;
|
|
78533
|
-
const connected = new Promise((
|
|
78534
|
-
connectResolve =
|
|
78683
|
+
const connected = new Promise((resolve153, _reject) => {
|
|
78684
|
+
connectResolve = resolve153;
|
|
78535
78685
|
});
|
|
78536
|
-
return new Promise((
|
|
78686
|
+
return new Promise((resolve153, reject) => {
|
|
78537
78687
|
const server = (0, net_1.createServer)((socket) => {
|
|
78538
78688
|
server.close();
|
|
78539
78689
|
connectResolve([
|
|
@@ -78544,7 +78694,7 @@ var require_main = __commonJS({
|
|
|
78544
78694
|
server.on("error", reject);
|
|
78545
78695
|
server.listen(pipeName, () => {
|
|
78546
78696
|
server.removeListener("error", reject);
|
|
78547
|
-
|
|
78697
|
+
resolve153({
|
|
78548
78698
|
onConnected: () => {
|
|
78549
78699
|
return connected;
|
|
78550
78700
|
}
|
|
@@ -78561,10 +78711,10 @@ var require_main = __commonJS({
|
|
|
78561
78711
|
}
|
|
78562
78712
|
function createClientSocketTransport(port, encoding = "utf-8") {
|
|
78563
78713
|
let connectResolve;
|
|
78564
|
-
const connected = new Promise((
|
|
78565
|
-
connectResolve =
|
|
78714
|
+
const connected = new Promise((resolve153, _reject) => {
|
|
78715
|
+
connectResolve = resolve153;
|
|
78566
78716
|
});
|
|
78567
|
-
return new Promise((
|
|
78717
|
+
return new Promise((resolve153, reject) => {
|
|
78568
78718
|
const server = (0, net_1.createServer)((socket) => {
|
|
78569
78719
|
server.close();
|
|
78570
78720
|
connectResolve([
|
|
@@ -78581,7 +78731,7 @@ var require_main = __commonJS({
|
|
|
78581
78731
|
return;
|
|
78582
78732
|
}
|
|
78583
78733
|
const boundPort = address.port;
|
|
78584
|
-
|
|
78734
|
+
resolve153({
|
|
78585
78735
|
port: () => boundPort,
|
|
78586
78736
|
onConnected: () => {
|
|
78587
78737
|
return connected;
|
|
@@ -78643,14 +78793,14 @@ async function raceToCompletion(promises30, shouldComplete, options = { timeoutM
|
|
|
78643
78793
|
const languageCount = promises30.length - auxIndices.size;
|
|
78644
78794
|
let languageRemaining = languageCount;
|
|
78645
78795
|
let auxGraceStarted = false;
|
|
78646
|
-
return new Promise((
|
|
78796
|
+
return new Promise((resolve153) => {
|
|
78647
78797
|
const timeout = setTimeout(() => {
|
|
78648
78798
|
completed = true;
|
|
78649
78799
|
if (graceTimer)
|
|
78650
78800
|
clearTimeout(graceTimer);
|
|
78651
78801
|
if (auxGraceTimer)
|
|
78652
78802
|
clearTimeout(auxGraceTimer);
|
|
78653
|
-
|
|
78803
|
+
resolve153(results.filter((r) => r !== void 0));
|
|
78654
78804
|
}, options.timeoutMs);
|
|
78655
78805
|
const finalize = () => {
|
|
78656
78806
|
if (completed)
|
|
@@ -78661,7 +78811,7 @@ async function raceToCompletion(promises30, shouldComplete, options = { timeoutM
|
|
|
78661
78811
|
clearTimeout(graceTimer);
|
|
78662
78812
|
if (auxGraceTimer)
|
|
78663
78813
|
clearTimeout(auxGraceTimer);
|
|
78664
|
-
|
|
78814
|
+
resolve153(results.filter((r) => r !== void 0));
|
|
78665
78815
|
};
|
|
78666
78816
|
const startAuxGrace = () => {
|
|
78667
78817
|
if (auxGraceStarted || completed)
|
|
@@ -79471,27 +79621,14 @@ async function assertParentIsUsable(filePath, stateFor) {
|
|
|
79471
79621
|
current = parent;
|
|
79472
79622
|
}
|
|
79473
79623
|
}
|
|
79474
|
-
async function
|
|
79475
|
-
|
|
79476
|
-
|
|
79477
|
-
|
|
79478
|
-
|
|
79479
|
-
const resolved2 = await fs95.realpath(current);
|
|
79480
|
-
return path111.join(resolved2, ...tail.reverse());
|
|
79481
|
-
} catch (err) {
|
|
79482
|
-
const code = err.code;
|
|
79483
|
-
if (code !== "ENOENT" && code !== "ENOTDIR")
|
|
79484
|
-
throw err;
|
|
79485
|
-
const parent = path111.dirname(current);
|
|
79486
|
-
if (parent === current)
|
|
79487
|
-
throw err;
|
|
79488
|
-
tail.push(path111.basename(current));
|
|
79489
|
-
current = parent;
|
|
79490
|
-
}
|
|
79491
|
-
}
|
|
79624
|
+
async function requireKernelIdentity(filePath, subject) {
|
|
79625
|
+
const identity = await kernelPathIdentityAsync(filePath);
|
|
79626
|
+
if (identity === void 0 || !identity.kernelConfirmed)
|
|
79627
|
+
throw new Error(`workspace edit path identity is unresolvable: ${subject}`);
|
|
79628
|
+
return identity.identity;
|
|
79492
79629
|
}
|
|
79493
79630
|
async function createWorkspaceUriConfiner(cwd) {
|
|
79494
|
-
const root = await
|
|
79631
|
+
const root = await requireKernelIdentity(cwd, cwd);
|
|
79495
79632
|
return async (uri) => {
|
|
79496
79633
|
let filePath = "";
|
|
79497
79634
|
try {
|
|
@@ -79504,7 +79641,7 @@ async function createWorkspaceUriConfiner(cwd) {
|
|
|
79504
79641
|
}
|
|
79505
79642
|
if (!path111.isAbsolute(filePath))
|
|
79506
79643
|
throw new Error(`workspace edit path escapes workspace: ${uri}`);
|
|
79507
|
-
const resolved2 = await
|
|
79644
|
+
const resolved2 = await requireKernelIdentity(filePath, uri);
|
|
79508
79645
|
if (!isUnderDir(resolved2, root))
|
|
79509
79646
|
throw new Error(`workspace edit path escapes workspace: ${uri}`);
|
|
79510
79647
|
return filePath;
|
|
@@ -79578,7 +79715,7 @@ async function preflightWorkspaceEdit(planned, cwd, options) {
|
|
|
79578
79715
|
if (!physicalPath)
|
|
79579
79716
|
throw new Error(`text edit target does not exist: ${filePath}`);
|
|
79580
79717
|
const content = await fs95.readFile(physicalPath, "utf-8");
|
|
79581
|
-
const expected = options.expectedContent?.get(await
|
|
79718
|
+
const expected = options.expectedContent?.get(await realpathOrResolveAsync(physicalPath));
|
|
79582
79719
|
if (expected !== void 0 && expected !== content) {
|
|
79583
79720
|
refuseStaleWorkspaceEdit(filePath, "the file changed after the edit was computed from it");
|
|
79584
79721
|
}
|
|
@@ -80754,12 +80891,12 @@ var init_workspace_diagnostics_cache = __esm({
|
|
|
80754
80891
|
import { spawn as nodeSpawn4 } from "node:child_process";
|
|
80755
80892
|
import { EventEmitter } from "node:events";
|
|
80756
80893
|
import { access as access3, lstat, readFile as readFile5, stat as stat4 } from "node:fs/promises";
|
|
80757
|
-
import * as
|
|
80894
|
+
import * as os27 from "node:os";
|
|
80758
80895
|
import { pathToFileURL as pathToFileURL5 } from "node:url";
|
|
80759
80896
|
function extractSpawnMarker(args) {
|
|
80760
80897
|
if (!args)
|
|
80761
80898
|
return void 0;
|
|
80762
|
-
const tmpDir =
|
|
80899
|
+
const tmpDir = os27.tmpdir();
|
|
80763
80900
|
for (let i = 0; i < args.length - 1; i++) {
|
|
80764
80901
|
const flag = args[i];
|
|
80765
80902
|
if (flag === "--config" || flag === "-c") {
|
|
@@ -80855,8 +80992,8 @@ async function killProcessTree(proc, pid, options = {}) {
|
|
|
80855
80992
|
proc.unref?.();
|
|
80856
80993
|
return;
|
|
80857
80994
|
}
|
|
80858
|
-
await new Promise((
|
|
80859
|
-
killer.once("close", () =>
|
|
80995
|
+
await new Promise((resolve153) => {
|
|
80996
|
+
killer.once("close", () => resolve153());
|
|
80860
80997
|
killer.once("error", (err) => {
|
|
80861
80998
|
logLatency({
|
|
80862
80999
|
type: "phase",
|
|
@@ -80865,7 +81002,7 @@ async function killProcessTree(proc, pid, options = {}) {
|
|
|
80865
81002
|
durationMs: 0,
|
|
80866
81003
|
metadata: { pid, platform: "win32", taskkillError: String(err) }
|
|
80867
81004
|
});
|
|
80868
|
-
|
|
81005
|
+
resolve153();
|
|
80869
81006
|
});
|
|
80870
81007
|
});
|
|
80871
81008
|
} catch (err) {
|
|
@@ -80923,18 +81060,18 @@ async function killProcessTree(proc, pid, options = {}) {
|
|
|
80923
81060
|
proc.unref?.();
|
|
80924
81061
|
return;
|
|
80925
81062
|
}
|
|
80926
|
-
const exitedInTime = await new Promise((
|
|
81063
|
+
const exitedInTime = await new Promise((resolve153) => {
|
|
80927
81064
|
if (proc.exitCode != null || proc.signalCode != null) {
|
|
80928
|
-
|
|
81065
|
+
resolve153(true);
|
|
80929
81066
|
return;
|
|
80930
81067
|
}
|
|
80931
81068
|
const onExit = () => {
|
|
80932
81069
|
clearTimeout(timer);
|
|
80933
|
-
|
|
81070
|
+
resolve153(true);
|
|
80934
81071
|
};
|
|
80935
81072
|
const timer = setTimeout(() => {
|
|
80936
81073
|
proc.off?.("exit", onExit);
|
|
80937
|
-
|
|
81074
|
+
resolve153(false);
|
|
80938
81075
|
}, 1500);
|
|
80939
81076
|
proc.once?.("exit", onExit);
|
|
80940
81077
|
});
|
|
@@ -81560,7 +81697,8 @@ function setupIncomingHandlers(state9, initialization, onDiagnosticsPublished) {
|
|
|
81560
81697
|
emptyFirstPublish: strategy.emptyFirstPublish,
|
|
81561
81698
|
// `pubVersion`, the `[lsp-pub]` trace's own field name for the
|
|
81562
81699
|
// publish's LSP document version — not a lifecycle identity, and
|
|
81563
|
-
// not the retired glossary spelling (
|
|
81700
|
+
// not the retired glossary spelling (docs/defect-shapes.md "session, turn or
|
|
81701
|
+
// generation lifecycle").
|
|
81564
81702
|
pubVersion: docVersion ?? "push-unversioned"
|
|
81565
81703
|
}
|
|
81566
81704
|
});
|
|
@@ -82186,7 +82324,7 @@ async function clientWaitForDiagnostics(state9, filePath, timeoutMs, options = {
|
|
|
82186
82324
|
const retryBudgetMs = strategy.pullRetryBudgetMs > 0 ? Math.min(timeoutMs, strategy.pullRetryBudgetMs) : 0;
|
|
82187
82325
|
const startedAt = Date.now();
|
|
82188
82326
|
while (outcome.status !== "found" && Date.now() - startedAt < retryBudgetMs) {
|
|
82189
|
-
await new Promise((
|
|
82327
|
+
await new Promise((resolve153) => setTimeout(resolve153, PULL_DIAGNOSTICS_RETRY_INTERVAL_MS));
|
|
82190
82328
|
outcome = await clientRequestPullDiagnostics(state9, filePath, Math.max(0, retryBudgetMs - (Date.now() - startedAt)));
|
|
82191
82329
|
if (outcome.status === "clean")
|
|
82192
82330
|
sawClean = true;
|
|
@@ -82208,7 +82346,7 @@ async function clientWaitForDiagnostics(state9, filePath, timeoutMs, options = {
|
|
|
82208
82346
|
return;
|
|
82209
82347
|
}
|
|
82210
82348
|
const answerStored = () => hasFreshDiagnostics() && !isVersionStale() && (state9.pushDiagnostics.has(normalizedPath) || state9.documentPullDiagnostics.has(normalizedPath));
|
|
82211
|
-
return new Promise((
|
|
82349
|
+
return new Promise((resolve153) => {
|
|
82212
82350
|
let debounceTimer;
|
|
82213
82351
|
let settleDeferred = storedAnswerSettles();
|
|
82214
82352
|
const finish = () => {
|
|
@@ -82217,7 +82355,7 @@ async function clientWaitForDiagnostics(state9, filePath, timeoutMs, options = {
|
|
|
82217
82355
|
state9.diagnosticEmitter.off("diagnostics", onDiagnostics);
|
|
82218
82356
|
state9.diagnosticEmitter.off(PENDING_RECEIPT_DROPPED, onReceiptDropped);
|
|
82219
82357
|
clearTimeout(timeout);
|
|
82220
|
-
|
|
82358
|
+
resolve153();
|
|
82221
82359
|
};
|
|
82222
82360
|
const onDiagnostics = (fp) => {
|
|
82223
82361
|
if (normalizeMapKey(fp) !== normalizedPath)
|
|
@@ -82456,9 +82594,9 @@ function enqueueDocumentNotify(state9, normalizedPath, run, saved = false, readS
|
|
|
82456
82594
|
queue = { running: false, active: void 0 };
|
|
82457
82595
|
state9.notifyChangeQueues.set(normalizedPath, queue);
|
|
82458
82596
|
}
|
|
82459
|
-
return new Promise((
|
|
82597
|
+
return new Promise((resolve153, reject) => {
|
|
82460
82598
|
if (queue.closing && !close) {
|
|
82461
|
-
|
|
82599
|
+
resolve153(false);
|
|
82462
82600
|
return;
|
|
82463
82601
|
}
|
|
82464
82602
|
const previous = queue?.pending;
|
|
@@ -82472,7 +82610,7 @@ function enqueueDocumentNotify(state9, normalizedPath, run, saved = false, readS
|
|
|
82472
82610
|
const before = (a, b) => a !== void 0 && b !== void 0 && a < b;
|
|
82473
82611
|
const stale = previous !== void 0 && (saveOnly || before(readStamp, previous.readStamp) || before(readStamp, lastSent));
|
|
82474
82612
|
const heldStamp = before(previous?.readStamp, lastSent) ? void 0 : previous?.readStamp;
|
|
82475
|
-
waiters.push({ resolve:
|
|
82613
|
+
waiters.push({ resolve: resolve153, reject, stale });
|
|
82476
82614
|
queue.pending = {
|
|
82477
82615
|
run: stale ? previous.run : run,
|
|
82478
82616
|
saveOnly: stale ? previous.saveOnly : saveOnly,
|
|
@@ -83701,8 +83839,8 @@ async function safeSendRequest(connection, method, params, signal, settlement, r
|
|
|
83701
83839
|
if (signal) {
|
|
83702
83840
|
tokenSource = new import_node.CancellationTokenSource();
|
|
83703
83841
|
if (releaseOnAbort) {
|
|
83704
|
-
released = new Promise((
|
|
83705
|
-
release2 = () =>
|
|
83842
|
+
released = new Promise((resolve153) => {
|
|
83843
|
+
release2 = () => resolve153(RELEASED_ON_ABORT);
|
|
83706
83844
|
});
|
|
83707
83845
|
}
|
|
83708
83846
|
onAbort = () => {
|
|
@@ -84444,8 +84582,8 @@ var init_client_registry = __esm({
|
|
|
84444
84582
|
async withClientSpawnGate(operation) {
|
|
84445
84583
|
const previous = this.clientSpawnGate;
|
|
84446
84584
|
let release2;
|
|
84447
|
-
this.clientSpawnGate = new Promise((
|
|
84448
|
-
release2 =
|
|
84585
|
+
this.clientSpawnGate = new Promise((resolve153) => {
|
|
84586
|
+
release2 = resolve153;
|
|
84449
84587
|
});
|
|
84450
84588
|
await previous;
|
|
84451
84589
|
try {
|
|
@@ -85703,14 +85841,14 @@ var init_lsp_lazy = __esm({
|
|
|
85703
85841
|
import * as crypto5 from "node:crypto";
|
|
85704
85842
|
import * as fs99 from "node:fs";
|
|
85705
85843
|
import * as net from "node:net";
|
|
85706
|
-
import * as
|
|
85844
|
+
import * as os28 from "node:os";
|
|
85707
85845
|
import * as path118 from "node:path";
|
|
85708
85846
|
function ipcPathForCwd(cwd, platform = process.platform) {
|
|
85709
85847
|
const hash = workspaceHash(cwd, platform);
|
|
85710
85848
|
if (platform === "win32") {
|
|
85711
85849
|
return `\\\\.\\pipe\\pi-lens-mcp-${hash}`;
|
|
85712
85850
|
}
|
|
85713
|
-
return path118.join(
|
|
85851
|
+
return path118.join(os28.tmpdir(), `pi-lens-mcp-${hash}.sock`);
|
|
85714
85852
|
}
|
|
85715
85853
|
function workspaceHash(cwd, platform = process.platform) {
|
|
85716
85854
|
const resolved2 = path118.resolve(cwd);
|
|
@@ -85754,7 +85892,7 @@ function contentHash(content) {
|
|
|
85754
85892
|
return crypto5.createHash("sha256").update(content).digest("hex");
|
|
85755
85893
|
}
|
|
85756
85894
|
function requestOverWarmIpc(endpoint, timeoutMs, buildRequest, validate2) {
|
|
85757
|
-
return new Promise((
|
|
85895
|
+
return new Promise((resolve153) => {
|
|
85758
85896
|
let settled = false;
|
|
85759
85897
|
const finish = (value) => {
|
|
85760
85898
|
if (settled)
|
|
@@ -85762,7 +85900,7 @@ function requestOverWarmIpc(endpoint, timeoutMs, buildRequest, validate2) {
|
|
|
85762
85900
|
settled = true;
|
|
85763
85901
|
clearTimeout(timer);
|
|
85764
85902
|
socket.destroy();
|
|
85765
|
-
|
|
85903
|
+
resolve153(value);
|
|
85766
85904
|
};
|
|
85767
85905
|
const deadlineAt = Date.now() + timeoutMs;
|
|
85768
85906
|
const socket = net.createConnection(endpoint);
|
|
@@ -85841,7 +85979,7 @@ function requestWarmCodeActions(cwd, incumbentPid, file, expectedContentHash, ra
|
|
|
85841
85979
|
});
|
|
85842
85980
|
}
|
|
85843
85981
|
function turnEndStatusPathForCwd(cwd, platform = process.platform) {
|
|
85844
|
-
return path118.join(
|
|
85982
|
+
return path118.join(os28.tmpdir(), `pi-lens-turn-end-${workspaceHash(cwd, platform)}.json`);
|
|
85845
85983
|
}
|
|
85846
85984
|
function readTurnEndStatus(cwd, platform = process.platform) {
|
|
85847
85985
|
try {
|
|
@@ -87498,8 +87636,8 @@ var init_lsp = __esm({
|
|
|
87498
87636
|
return { outstandingMs: 0 };
|
|
87499
87637
|
}
|
|
87500
87638
|
let resolveSettled;
|
|
87501
|
-
const settled = new Promise((
|
|
87502
|
-
resolveSettled =
|
|
87639
|
+
const settled = new Promise((resolve153) => {
|
|
87640
|
+
resolveSettled = resolve153;
|
|
87503
87641
|
});
|
|
87504
87642
|
const token = {
|
|
87505
87643
|
startedAt: Date.now(),
|
|
@@ -87712,8 +87850,8 @@ var init_lsp = __esm({
|
|
|
87712
87850
|
const effectiveMaxWaitMs = hardCapMs !== void 0 ? serverBaseMs > 0 ? Math.min(serverBaseMs, hardCapMs) : hardCapMs : serverBaseMs;
|
|
87713
87851
|
let knownSlowResolve;
|
|
87714
87852
|
const knownSlowSentinel = /* @__PURE__ */ Symbol("lsp-client-wait-known-slow");
|
|
87715
|
-
const knownSlow = new Promise((
|
|
87716
|
-
knownSlowResolve = () =>
|
|
87853
|
+
const knownSlow = new Promise((resolve153) => {
|
|
87854
|
+
knownSlowResolve = () => resolve153(knownSlowSentinel);
|
|
87717
87855
|
});
|
|
87718
87856
|
const noteSpawnInFlight = (serverId) => {
|
|
87719
87857
|
const knownDurationMs = getSuccessfulLspSpawnDurationMs(serverId);
|
|
@@ -87804,8 +87942,8 @@ var init_lsp = __esm({
|
|
|
87804
87942
|
waitResult = await Promise.race([
|
|
87805
87943
|
withBudget2(),
|
|
87806
87944
|
knownSlow,
|
|
87807
|
-
new Promise((
|
|
87808
|
-
waitTimer = setTimeout(() =>
|
|
87945
|
+
new Promise((resolve153) => {
|
|
87946
|
+
waitTimer = setTimeout(() => resolve153(timeoutSentinel), effectiveMaxWaitMs);
|
|
87809
87947
|
})
|
|
87810
87948
|
]);
|
|
87811
87949
|
} finally {
|
|
@@ -88962,8 +89100,8 @@ var init_lsp = __esm({
|
|
|
88962
89100
|
let shared = this.firstContactWaits.get(entry.info.id);
|
|
88963
89101
|
if (!shared) {
|
|
88964
89102
|
let removeShutdownListener;
|
|
88965
|
-
const shutdown = new Promise((
|
|
88966
|
-
const onShutdown = () =>
|
|
89103
|
+
const shutdown = new Promise((resolve153) => {
|
|
89104
|
+
const onShutdown = () => resolve153("shutdown");
|
|
88967
89105
|
if (this.shutdownController.signal.aborted) {
|
|
88968
89106
|
onShutdown();
|
|
88969
89107
|
return;
|
|
@@ -89050,8 +89188,8 @@ var init_lsp = __esm({
|
|
|
89050
89188
|
};
|
|
89051
89189
|
}
|
|
89052
89190
|
let timer;
|
|
89053
|
-
const timeout = new Promise((
|
|
89054
|
-
timer = setTimeout(() =>
|
|
89191
|
+
const timeout = new Promise((resolve153) => {
|
|
89192
|
+
timer = setTimeout(() => resolve153(false), budgetMs);
|
|
89055
89193
|
if (typeof timer === "object" && "unref" in timer) {
|
|
89056
89194
|
timer.unref?.();
|
|
89057
89195
|
}
|
|
@@ -89149,8 +89287,8 @@ var init_lsp = __esm({
|
|
|
89149
89287
|
const graceMs = readTsserverSyncGraceMs();
|
|
89150
89288
|
const primaryClient = spawned[0].client;
|
|
89151
89289
|
const syncRacer = (async () => {
|
|
89152
|
-
await new Promise((
|
|
89153
|
-
const timer = setTimeout(
|
|
89290
|
+
await new Promise((resolve153) => {
|
|
89291
|
+
const timer = setTimeout(resolve153, graceMs);
|
|
89154
89292
|
timer.unref?.();
|
|
89155
89293
|
});
|
|
89156
89294
|
const publishedAt = primaryClient.getAllDiagnostics?.().get(normalizedPath)?.ts;
|
|
@@ -90865,12 +91003,12 @@ var init_lsp = __esm({
|
|
|
90865
91003
|
ms: timeoutMs,
|
|
90866
91004
|
onTimeout: "undefined"
|
|
90867
91005
|
}),
|
|
90868
|
-
new Promise((
|
|
91006
|
+
new Promise((resolve153) => {
|
|
90869
91007
|
if (options.signal.aborted) {
|
|
90870
|
-
|
|
91008
|
+
resolve153();
|
|
90871
91009
|
return;
|
|
90872
91010
|
}
|
|
90873
|
-
options.signal.addEventListener("abort", () =>
|
|
91011
|
+
options.signal.addEventListener("abort", () => resolve153(), {
|
|
90874
91012
|
once: true
|
|
90875
91013
|
});
|
|
90876
91014
|
})
|
|
@@ -90899,10 +91037,10 @@ var init_lsp = __esm({
|
|
|
90899
91037
|
if (failedServerIds.length > 0 && !options.signal?.aborted) {
|
|
90900
91038
|
const backoffMs2 = warmupRetryBackoffMs();
|
|
90901
91039
|
if (backoffMs2 > 0) {
|
|
90902
|
-
await new Promise((
|
|
90903
|
-
const timer = setTimeout(
|
|
91040
|
+
await new Promise((resolve153) => {
|
|
91041
|
+
const timer = setTimeout(resolve153, backoffMs2);
|
|
90904
91042
|
timer.unref?.();
|
|
90905
|
-
options.signal?.addEventListener("abort", () =>
|
|
91043
|
+
options.signal?.addEventListener("abort", () => resolve153(), {
|
|
90906
91044
|
once: true
|
|
90907
91045
|
});
|
|
90908
91046
|
});
|
|
@@ -91090,12 +91228,12 @@ var init_lsp = __esm({
|
|
|
91090
91228
|
})(), { ms: perFileMs, onTimeout: "undefined" });
|
|
91091
91229
|
await (signal ? Promise.race([
|
|
91092
91230
|
preOpenAttempt,
|
|
91093
|
-
new Promise((
|
|
91231
|
+
new Promise((resolve153) => {
|
|
91094
91232
|
if (signal.aborted) {
|
|
91095
|
-
|
|
91233
|
+
resolve153();
|
|
91096
91234
|
return;
|
|
91097
91235
|
}
|
|
91098
|
-
signal.addEventListener("abort", () =>
|
|
91236
|
+
signal.addEventListener("abort", () => resolve153(), {
|
|
91099
91237
|
once: true
|
|
91100
91238
|
});
|
|
91101
91239
|
})
|
|
@@ -92670,8 +92808,8 @@ async function drainPendingRunnerFindings(maxWaitMs = 2e3, currentSession, curre
|
|
|
92670
92808
|
if (maxWaitMs === 0)
|
|
92671
92809
|
await Promise.resolve();
|
|
92672
92810
|
if (maxWaitMs > 0 && current.some((entry) => !entry.settled)) {
|
|
92673
|
-
await new Promise((
|
|
92674
|
-
const timer = setTimeout(
|
|
92811
|
+
await new Promise((resolve153) => {
|
|
92812
|
+
const timer = setTimeout(resolve153, maxWaitMs);
|
|
92675
92813
|
timer.unref?.();
|
|
92676
92814
|
});
|
|
92677
92815
|
}
|
|
@@ -95762,8 +95900,8 @@ async function buildHeartbeatResourcePatchBounded() {
|
|
|
95762
95900
|
try {
|
|
95763
95901
|
return await Promise.race([
|
|
95764
95902
|
buildHeartbeatResourcePatch(),
|
|
95765
|
-
new Promise((
|
|
95766
|
-
timer = setTimeout(() =>
|
|
95903
|
+
new Promise((resolve153) => {
|
|
95904
|
+
timer = setTimeout(() => resolve153({}), HEARTBEAT_SAMPLE_TIMEOUT_MS);
|
|
95767
95905
|
})
|
|
95768
95906
|
]);
|
|
95769
95907
|
} finally {
|
|
@@ -97123,8 +97261,8 @@ async function getOpenDocumentSymbols(filePath, timeoutMs = LSP_DOCUMENT_SYMBOL_
|
|
|
97123
97261
|
try {
|
|
97124
97262
|
return await Promise.race([
|
|
97125
97263
|
spawned.client.documentSymbol(filePath),
|
|
97126
|
-
new Promise((
|
|
97127
|
-
timer = setTimeout(() =>
|
|
97264
|
+
new Promise((resolve153) => {
|
|
97265
|
+
timer = setTimeout(() => resolve153(void 0), timeoutMs);
|
|
97128
97266
|
})
|
|
97129
97267
|
]);
|
|
97130
97268
|
} catch {
|
|
@@ -99450,7 +99588,7 @@ function flushReviewGraphPersistsForTests() {
|
|
|
99450
99588
|
}
|
|
99451
99589
|
async function waitForReviewGraphPersistsForTests() {
|
|
99452
99590
|
for (let attempts2 = 0; attempts2 < 200 && (_workerRequests.size > 0 || _checkpointWorkerRequests.size > 0); attempts2++) {
|
|
99453
|
-
await new Promise((
|
|
99591
|
+
await new Promise((resolve153) => setTimeout(resolve153, 10));
|
|
99454
99592
|
}
|
|
99455
99593
|
}
|
|
99456
99594
|
async function terminateReviewGraphPersistWorkerForTests() {
|
|
@@ -101399,7 +101537,7 @@ var init_builder = __esm({
|
|
|
101399
101537
|
_retainedGraphSites = /* @__PURE__ */ new Map();
|
|
101400
101538
|
_cwdWorktreeCheckedCwds = /* @__PURE__ */ new Set();
|
|
101401
101539
|
STAT_YIELD_EVERY = 100;
|
|
101402
|
-
yieldToLoop = () => new Promise((
|
|
101540
|
+
yieldToLoop = () => new Promise((resolve153) => setImmediate(resolve153));
|
|
101403
101541
|
DEFAULT_REVIEW_GRAPH_SIZE_SKIP_TTL_MS = 15 * 6e4;
|
|
101404
101542
|
_sizeSkipTtl = lazyEnvNumber("PI_LENS_REVIEW_GRAPH_SIZE_SKIP_TTL_MS", DEFAULT_REVIEW_GRAPH_SIZE_SKIP_TTL_MS);
|
|
101405
101543
|
_resetReviewGraphSizeSkipTtlForTests = _sizeSkipTtl._resetForTests;
|
|
@@ -103781,7 +103919,7 @@ var init_diagnostic_parsers = __esm({
|
|
|
103781
103919
|
});
|
|
103782
103920
|
|
|
103783
103921
|
// dist/clients/dispatch/runners/go-vet.js
|
|
103784
|
-
import { relative as relative21, resolve as
|
|
103922
|
+
import { relative as relative21, resolve as resolve77, sep as sep14, posix as posix8 } from "node:path";
|
|
103785
103923
|
var goVetRunner, go_vet_default;
|
|
103786
103924
|
var init_go_vet = __esm({
|
|
103787
103925
|
"dist/clients/dispatch/runners/go-vet.js"() {
|
|
@@ -103828,10 +103966,10 @@ var init_go_vet = __esm({
|
|
|
103828
103966
|
if (result.status === 0 && !raw.trim()) {
|
|
103829
103967
|
return { status: "succeeded", diagnostics: [], semantic: "none" };
|
|
103830
103968
|
}
|
|
103831
|
-
const absTarget =
|
|
103969
|
+
const absTarget = resolve77(ctx.filePath);
|
|
103832
103970
|
const relevant = raw.split("\n").filter((line) => {
|
|
103833
103971
|
const m = line.match(GO_VET_LINE);
|
|
103834
|
-
return m != null && pathsEqual(
|
|
103972
|
+
return m != null && pathsEqual(resolve77(cwd, m[1].trim()), absTarget);
|
|
103835
103973
|
}).join("\n");
|
|
103836
103974
|
const diagnostics = parseGoVetOutput(relevant, ctx.filePath, cwd);
|
|
103837
103975
|
return diagnostics.length > 0 ? findingsResult(diagnostics, { status: "failed", semantic: "warning" }) : { status: "succeeded", diagnostics: [], semantic: "none" };
|
|
@@ -104201,7 +104339,7 @@ var init_helm_lint = __esm({
|
|
|
104201
104339
|
|
|
104202
104340
|
// dist/clients/dispatch/runners/helm-render.js
|
|
104203
104341
|
import * as fs114 from "node:fs";
|
|
104204
|
-
import * as
|
|
104342
|
+
import * as os29 from "node:os";
|
|
104205
104343
|
import * as path145 from "node:path";
|
|
104206
104344
|
function isWithin4(root, candidate) {
|
|
104207
104345
|
const relative36 = path145.relative(normalizeMapKey(root), normalizeMapKey(candidate));
|
|
@@ -104645,7 +104783,7 @@ async function renderAndValidate(chartRoot, cwd, filePath) {
|
|
|
104645
104783
|
const helmCmd = await resolveAvailableOrInstall(helm2, "helm", cwd);
|
|
104646
104784
|
if (!helmCmd)
|
|
104647
104785
|
return helmUnavailableResult(cwd);
|
|
104648
|
-
const outputDir = fs114.mkdtempSync(path145.join(
|
|
104786
|
+
const outputDir = fs114.mkdtempSync(path145.join(os29.tmpdir(), "pi-lens-helm-render-"));
|
|
104649
104787
|
try {
|
|
104650
104788
|
const render3 = await safeSpawnAsync(helmCmd, ["template", "pi-lens-render", chartRoot, "--output-dir", outputDir], {
|
|
104651
104789
|
cwd,
|
|
@@ -106225,7 +106363,7 @@ ${result.stderr ?? ""}`;
|
|
|
106225
106363
|
|
|
106226
106364
|
// dist/clients/dispatch/runners/psscriptanalyzer.js
|
|
106227
106365
|
import * as fs115 from "node:fs/promises";
|
|
106228
|
-
import * as
|
|
106366
|
+
import * as os30 from "node:os";
|
|
106229
106367
|
import * as path155 from "node:path";
|
|
106230
106368
|
function spawnPs(cmd, args, options) {
|
|
106231
106369
|
const { timeoutMs = PS_TIMEOUT_MS, cwd } = options;
|
|
@@ -106430,7 +106568,7 @@ $results | ConvertTo-Json -Depth 3 -Compress
|
|
|
106430
106568
|
}
|
|
106431
106569
|
const cwd = resolveRunnerCwd(ctx, "psscriptanalyzer");
|
|
106432
106570
|
const absPath = path155.resolve(cwd, ctx.filePath);
|
|
106433
|
-
const tmpScript = path155.join(
|
|
106571
|
+
const tmpScript = path155.join(os30.tmpdir(), `pi-lens-psa-${process.pid}.ps1`);
|
|
106434
106572
|
await fs115.writeFile(tmpScript, PS_SCRIPT, "utf-8");
|
|
106435
106573
|
try {
|
|
106436
106574
|
const sampler = startHostStallSampler();
|
|
@@ -106978,7 +107116,7 @@ var init_lazy_installer = __esm({
|
|
|
106978
107116
|
});
|
|
106979
107117
|
|
|
106980
107118
|
// dist/clients/dispatch/runners/rust-clippy.js
|
|
106981
|
-
import { isAbsolute as
|
|
107119
|
+
import { isAbsolute as isAbsolute20, resolve as resolve93 } from "node:path";
|
|
106982
107120
|
function getClippyProbe(cargoExe) {
|
|
106983
107121
|
return clippyAvailabilityByCargo.get(cargoExe) ?? refreshClippyProbe(cargoExe);
|
|
106984
107122
|
}
|
|
@@ -107019,7 +107157,7 @@ function parseClippyOutput(raw, fallbackPath, cargoDir) {
|
|
|
107019
107157
|
continue;
|
|
107020
107158
|
const fixableSpan = findMachineApplicableSpan(spans);
|
|
107021
107159
|
const rawFile = span.file || span.file_name;
|
|
107022
|
-
const filePath = rawFile ? cargoDir && !
|
|
107160
|
+
const filePath = rawFile ? cargoDir && !isAbsolute20(rawFile) ? resolve93(cargoDir, rawFile) : rawFile : fallbackPath;
|
|
107023
107161
|
const normalizedSeverity = normalizeClippyLevel(message.level);
|
|
107024
107162
|
diagnostics.push({
|
|
107025
107163
|
id: `clippy-${message.code?.code || "unknown"}`,
|
|
@@ -107118,8 +107256,8 @@ var init_rust_clippy = __esm({
|
|
|
107118
107256
|
return false;
|
|
107119
107257
|
}
|
|
107120
107258
|
});
|
|
107121
|
-
const absEdited =
|
|
107122
|
-
const diagnostics = allDiagnostics.filter((d) => pathsEqual(
|
|
107259
|
+
const absEdited = resolve93(ctx.filePath);
|
|
107260
|
+
const diagnostics = allDiagnostics.filter((d) => pathsEqual(resolve93(cargoDir, d.filePath), absEdited));
|
|
107123
107261
|
const hasBlocking = diagnostics.some((d) => d.semantic === "blocking");
|
|
107124
107262
|
const semantic = hasBlocking ? "blocking" : diagnostics.length > 0 ? "warning" : "none";
|
|
107125
107263
|
if (result.error || result.failure) {
|
|
@@ -107152,7 +107290,7 @@ var init_rust_clippy = __esm({
|
|
|
107152
107290
|
|
|
107153
107291
|
// dist/clients/dispatch/runners/spotbugs.js
|
|
107154
107292
|
import * as fs116 from "node:fs";
|
|
107155
|
-
import * as
|
|
107293
|
+
import * as os31 from "node:os";
|
|
107156
107294
|
import * as path157 from "node:path";
|
|
107157
107295
|
function classesSignature(classesDir) {
|
|
107158
107296
|
let count = 0;
|
|
@@ -107325,7 +107463,7 @@ var init_spotbugs = __esm({
|
|
|
107325
107463
|
const cmd = await resolveAvailableOrInstall(spotbugs, "spotbugs", cwd);
|
|
107326
107464
|
if (!cmd)
|
|
107327
107465
|
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
107328
|
-
const tmpXml = path157.join(
|
|
107466
|
+
const tmpXml = path157.join(os31.tmpdir(), `pi-lens-spotbugs-${process.pid}-${Date.now()}.xml`);
|
|
107329
107467
|
const result = await safeSpawnAsync(cmd, [
|
|
107330
107468
|
"-textui",
|
|
107331
107469
|
"-xml:withMessages",
|
|
@@ -107547,15 +107685,15 @@ var init_shellcheck = __esm({
|
|
|
107547
107685
|
});
|
|
107548
107686
|
|
|
107549
107687
|
// dist/clients/dispatch/runners/fish-indent.js
|
|
107550
|
-
import { resolve as
|
|
107688
|
+
import { resolve as resolve95 } from "node:path";
|
|
107551
107689
|
function parseSyntaxErrors(output, filePath, cwd) {
|
|
107552
107690
|
const diagnostics = [];
|
|
107553
107691
|
for (const line of output.split("\n")) {
|
|
107554
107692
|
const [, reported, lineText, message] = line.match(/^(.+) \(line (\d+)\): (.+)$/) ?? [];
|
|
107555
107693
|
if (!reported || !lineText || !message)
|
|
107556
107694
|
continue;
|
|
107557
|
-
const wanted =
|
|
107558
|
-
if (!pathsEqual(
|
|
107695
|
+
const wanted = resolve95(cwd, filePath);
|
|
107696
|
+
if (!pathsEqual(resolve95(cwd, reported), wanted) && !(reported.startsWith("~/") && wanted.endsWith(reported.slice(1))))
|
|
107559
107697
|
continue;
|
|
107560
107698
|
const lineNumber = Number(lineText);
|
|
107561
107699
|
diagnostics.push({
|
|
@@ -107630,7 +107768,7 @@ var init_fish_indent = __esm({
|
|
|
107630
107768
|
if (didNotRun)
|
|
107631
107769
|
return didNotRun;
|
|
107632
107770
|
}
|
|
107633
|
-
const stderrLine = (result.stderr ?? "").split("\n").find((l) => l.trim() && !pathsEqual(
|
|
107771
|
+
const stderrLine = (result.stderr ?? "").split("\n").find((l) => l.trim() && !pathsEqual(resolve95(cwd, l.trim()), resolve95(cwd, ctx.filePath)));
|
|
107634
107772
|
if (stderrLine) {
|
|
107635
107773
|
const lineMatch = stderrLine.match(/\(line\s+(\d+)\)/);
|
|
107636
107774
|
const line = lineMatch ? Number(lineMatch[1]) : 1;
|
|
@@ -112344,7 +112482,7 @@ var init_integration = __esm({
|
|
|
112344
112482
|
});
|
|
112345
112483
|
|
|
112346
112484
|
// dist/clients/gradle-ktfmt-style.js
|
|
112347
|
-
import * as
|
|
112485
|
+
import * as os32 from "node:os";
|
|
112348
112486
|
import * as path172 from "node:path";
|
|
112349
112487
|
function styleFromKtfmtBlockBody(body) {
|
|
112350
112488
|
let style;
|
|
@@ -112463,7 +112601,7 @@ async function stylesForGradleDir(gradleDir) {
|
|
|
112463
112601
|
}
|
|
112464
112602
|
return {};
|
|
112465
112603
|
}
|
|
112466
|
-
async function resolveKtfmtGradleStyle(filePath, homeDir =
|
|
112604
|
+
async function resolveKtfmtGradleStyle(filePath, homeDir = os32.homedir()) {
|
|
112467
112605
|
let searchDir = path172.dirname(path172.resolve(filePath));
|
|
112468
112606
|
for (let hop = 0; hop < MAX_GRADLE_ANCESTOR_HOPS; hop += 1) {
|
|
112469
112607
|
const gradleDir = findNearestMarkerRoot(searchDir, KTFMT_GRADLE_ROOT_FILES, {
|
|
@@ -113493,7 +113631,7 @@ __export(formatters_exports, {
|
|
|
113493
113631
|
});
|
|
113494
113632
|
import { AsyncLocalStorage as AsyncLocalStorage6 } from "node:async_hooks";
|
|
113495
113633
|
import * as fs121 from "node:fs/promises";
|
|
113496
|
-
import * as
|
|
113634
|
+
import * as os33 from "node:os";
|
|
113497
113635
|
import * as path175 from "node:path";
|
|
113498
113636
|
async function tryLazyInstallFormatterTool(tool, cwd) {
|
|
113499
113637
|
const ok = await tryLazyInstallForFormatter(tool, cwd);
|
|
@@ -113511,8 +113649,10 @@ async function fileExists3(filePath) {
|
|
|
113511
113649
|
}
|
|
113512
113650
|
async function findUp(targets, startDir, stopDir = path175.parse(startDir).root) {
|
|
113513
113651
|
const found = [];
|
|
113514
|
-
|
|
113515
|
-
|
|
113652
|
+
const stopIdentity = realpathOrResolve(stopDir);
|
|
113653
|
+
for (const currentDir of walkUpDirs(startDir)) {
|
|
113654
|
+
if (currentDir === stopIdentity)
|
|
113655
|
+
break;
|
|
113516
113656
|
let entries;
|
|
113517
113657
|
try {
|
|
113518
113658
|
entries = await fs121.readdir(currentDir);
|
|
@@ -113539,10 +113679,6 @@ async function findUp(targets, startDir, stopDir = path175.parse(startDir).root)
|
|
|
113539
113679
|
if (await fileExists3(candidate))
|
|
113540
113680
|
found.push(candidate);
|
|
113541
113681
|
}
|
|
113542
|
-
const parent = path175.dirname(currentDir);
|
|
113543
|
-
if (parent === currentDir)
|
|
113544
|
-
break;
|
|
113545
|
-
currentDir = parent;
|
|
113546
113682
|
}
|
|
113547
113683
|
return found;
|
|
113548
113684
|
}
|
|
@@ -113786,7 +113922,7 @@ async function indentationArgs(filePath, tool, cwd) {
|
|
|
113786
113922
|
}
|
|
113787
113923
|
return tab ? ["--indent-style", "tab"] : ["--indent-style", "space", "--indent-width", String(indentation.width)];
|
|
113788
113924
|
}
|
|
113789
|
-
function resolveFormatterCwd(absolutePath, formatterName, homeDir =
|
|
113925
|
+
function resolveFormatterCwd(absolutePath, formatterName, homeDir = os33.homedir()) {
|
|
113790
113926
|
return resolveToolCwd("formatter", formatterName ?? "unknown", absolutePath, {
|
|
113791
113927
|
// Formatter discovery historically walks above the file directory. The
|
|
113792
113928
|
// filesystem root is the neutral dispatch boundary; the seam's `$HOME`
|
|
@@ -115812,7 +115948,7 @@ async function buildActionableWarningsReport(args) {
|
|
|
115812
115948
|
}
|
|
115813
115949
|
};
|
|
115814
115950
|
const deferredWork2 = (async () => {
|
|
115815
|
-
await new Promise((
|
|
115951
|
+
await new Promise((resolve153) => setTimeout(resolve153, 0));
|
|
115816
115952
|
const deferredRecords = [...carried];
|
|
115817
115953
|
const deferredDeadline = Date.now() + ACTIONABLE_WARNINGS_DEFERRED_BUDGET_MS;
|
|
115818
115954
|
deferredDeps.deadlineAt = deferredDeadline;
|
|
@@ -118980,8 +119116,8 @@ var init_runtime_coordinator = __esm({
|
|
|
118980
119116
|
});
|
|
118981
119117
|
return entry;
|
|
118982
119118
|
});
|
|
118983
|
-
const timeout = new Promise((
|
|
118984
|
-
setTimeout(
|
|
119119
|
+
const timeout = new Promise((resolve153) => {
|
|
119120
|
+
setTimeout(resolve153, maxWaitMs).unref?.();
|
|
118985
119121
|
});
|
|
118986
119122
|
await Promise.race([
|
|
118987
119123
|
Promise.allSettled(tracked.map((t2) => t2.promise)),
|
|
@@ -120213,7 +120349,7 @@ __export(startup_scan_exports, {
|
|
|
120213
120349
|
resolveStartupScanContext: () => resolveStartupScanContext,
|
|
120214
120350
|
resolveStartupScanContextAsync: () => resolveStartupScanContextAsync
|
|
120215
120351
|
});
|
|
120216
|
-
import * as
|
|
120352
|
+
import * as os34 from "node:os";
|
|
120217
120353
|
import * as path192 from "node:path";
|
|
120218
120354
|
function isStartupScanVerdictFresh(verdict, now = Date.now()) {
|
|
120219
120355
|
if (verdict.reason !== "too-many-source-files" && verdict.reason !== "too-many-entries")
|
|
@@ -120299,7 +120435,7 @@ function resolveStartupScanContext(cwd, options = {}) {
|
|
|
120299
120435
|
}
|
|
120300
120436
|
function computeStartupScanContext(cwd, options = {}) {
|
|
120301
120437
|
const resolvedCwd = path192.resolve(cwd);
|
|
120302
|
-
const homeDir = path192.resolve(options.homeDir ??
|
|
120438
|
+
const homeDir = path192.resolve(options.homeDir ?? os34.homedir());
|
|
120303
120439
|
const maxSourceFiles = options.maxSourceFiles ?? getStartupScanMaxSourceFilesDerived(resolvedCwd);
|
|
120304
120440
|
const maxScanEntries = options.maxScanEntries ?? getStartupScanMaxEntries();
|
|
120305
120441
|
const projectRoot = findNearestProjectRoot(resolvedCwd);
|
|
@@ -120374,7 +120510,7 @@ async function resolveStartupScanContextAsync(cwd, options = {}) {
|
|
|
120374
120510
|
if (cached)
|
|
120375
120511
|
return cached;
|
|
120376
120512
|
const resolvedCwd = path192.resolve(cwd);
|
|
120377
|
-
const homeDir = path192.resolve(options.homeDir ??
|
|
120513
|
+
const homeDir = path192.resolve(options.homeDir ?? os34.homedir());
|
|
120378
120514
|
const maxSourceFiles = options.maxSourceFiles ?? getStartupScanMaxSourceFilesDerived(resolvedCwd);
|
|
120379
120515
|
const maxScanEntries = options.maxScanEntries ?? getStartupScanMaxEntries();
|
|
120380
120516
|
const projectRoot = findNearestProjectRoot(resolvedCwd);
|
|
@@ -121385,8 +121521,8 @@ async function readSequenceWithBudget(args) {
|
|
|
121385
121521
|
const { snapshotRoot, base, cwd, runtime: runtime2, sessionGeneration, dbg: dbg2, onDeferredSequenceResolved } = args;
|
|
121386
121522
|
const readPromise = readLatestProjectSequenceAsync(snapshotRoot, base);
|
|
121387
121523
|
let timeoutHandle;
|
|
121388
|
-
const timeoutPromise = new Promise((
|
|
121389
|
-
timeoutHandle = setTimeout(() =>
|
|
121524
|
+
const timeoutPromise = new Promise((resolve153) => {
|
|
121525
|
+
timeoutHandle = setTimeout(() => resolve153({ timedOut: true }), sequenceReadBudgetMs());
|
|
121390
121526
|
timeoutHandle.unref();
|
|
121391
121527
|
});
|
|
121392
121528
|
const raced = await Promise.race([
|
|
@@ -121791,7 +121927,7 @@ function scheduleStartupScansWithClients(deps, runtime2, sessionGeneration, anal
|
|
|
121791
121927
|
const delay = STARTUP_TASK_DEFER_MS[name2] ?? 0;
|
|
121792
121928
|
dbg2(`session_start task ${name2}: scheduled deferMs=${delay}`);
|
|
121793
121929
|
runtime2.markStartupScanInFlight(name2, sessionGeneration);
|
|
121794
|
-
const completion = new Promise((
|
|
121930
|
+
const completion = new Promise((resolve153) => {
|
|
121795
121931
|
const fire = () => {
|
|
121796
121932
|
const startedAt = Date.now();
|
|
121797
121933
|
dbg2(`session_start task ${name2}: start queuedMs=${startedAt - queuedAt}`);
|
|
@@ -121803,7 +121939,7 @@ function scheduleStartupScansWithClients(deps, runtime2, sessionGeneration, anal
|
|
|
121803
121939
|
}).finally(() => {
|
|
121804
121940
|
runtime2.clearStartupScanInFlight(name2, sessionGeneration);
|
|
121805
121941
|
dbg2(`session_start task ${name2}: end`);
|
|
121806
|
-
|
|
121942
|
+
resolve153();
|
|
121807
121943
|
});
|
|
121808
121944
|
};
|
|
121809
121945
|
if (delay > 0) {
|
|
@@ -123064,7 +123200,7 @@ var init_runtime_session = __esm({
|
|
|
123064
123200
|
|
|
123065
123201
|
// dist/clients/deferred-runner-blockers.js
|
|
123066
123202
|
import * as fs133 from "node:fs";
|
|
123067
|
-
import { resolve as
|
|
123203
|
+
import { resolve as resolve122 } from "node:path";
|
|
123068
123204
|
function judgeDeferredRunnerFindings(pending4, cwd, options = {}) {
|
|
123069
123205
|
const findings = pending4.result?.diagnostics ?? [];
|
|
123070
123206
|
if (findings.length === 0) {
|
|
@@ -123105,7 +123241,7 @@ function judgeDeferredRunnerFindings(pending4, cwd, options = {}) {
|
|
|
123105
123241
|
};
|
|
123106
123242
|
}
|
|
123107
123243
|
function recordDeferredRunnerBlockers(runtime2, pending4, survivors, bytes) {
|
|
123108
|
-
const blocking = stampLineHashes(withoutLaneCopies(runtime2, pending4, survivors).flatMap((d) => d.semantic === "blocking" ? [{ ...d, runnerId: d.runnerId ?? pending4.runnerId }] : []), bytes?.toString("utf-8"), (d) => !d.filePath ||
|
|
123244
|
+
const blocking = stampLineHashes(withoutLaneCopies(runtime2, pending4, survivors).flatMap((d) => d.semantic === "blocking" ? [{ ...d, runnerId: d.runnerId ?? pending4.runnerId }] : []), bytes?.toString("utf-8"), (d) => !d.filePath || resolve122(d.filePath) === resolve122(pending4.filePath));
|
|
123109
123245
|
if (blocking.length === 0)
|
|
123110
123246
|
return 0;
|
|
123111
123247
|
const recorded = runtime2.recordDeferredInlineBlockers(pending4.filePath, blocking, {
|
|
@@ -125135,7 +125271,7 @@ var init_delivery_holds = __esm({
|
|
|
125135
125271
|
});
|
|
125136
125272
|
|
|
125137
125273
|
// dist/clients/knip-scan-roots.js
|
|
125138
|
-
import { resolve as
|
|
125274
|
+
import { resolve as resolve130 } from "node:path";
|
|
125139
125275
|
function resolveKnipScanRoots(sessionCwd, modifiedFiles) {
|
|
125140
125276
|
const session = resolveGitCheckout(sessionCwd);
|
|
125141
125277
|
if (!session || modifiedFiles.length === 0) {
|
|
@@ -125144,7 +125280,7 @@ function resolveKnipScanRoots(sessionCwd, modifiedFiles) {
|
|
|
125144
125280
|
let sessionOwnsEdit = false;
|
|
125145
125281
|
const linked = [];
|
|
125146
125282
|
for (const file of modifiedFiles) {
|
|
125147
|
-
const owner = resolveLinkedWorktreeOwner(session,
|
|
125283
|
+
const owner = resolveLinkedWorktreeOwner(session, resolve130(sessionCwd, file));
|
|
125148
125284
|
if (owner === null) {
|
|
125149
125285
|
sessionOwnsEdit = true;
|
|
125150
125286
|
} else if (!linked.some((known) => pathsEqual(known.root, owner.root))) {
|
|
@@ -125922,7 +126058,7 @@ async function runTestTargetsBounded(args) {
|
|
|
125922
126058
|
});
|
|
125923
126059
|
void pool.catch(() => {
|
|
125924
126060
|
});
|
|
125925
|
-
await new Promise((
|
|
126061
|
+
await new Promise((resolve153) => {
|
|
125926
126062
|
let settled = false;
|
|
125927
126063
|
const finish = (reason) => {
|
|
125928
126064
|
if (settled)
|
|
@@ -125934,7 +126070,7 @@ async function runTestTargetsBounded(args) {
|
|
|
125934
126070
|
batchAbort.abort();
|
|
125935
126071
|
clearTimeout(timer);
|
|
125936
126072
|
args.signal?.removeEventListener("abort", onAbort);
|
|
125937
|
-
|
|
126073
|
+
resolve153();
|
|
125938
126074
|
};
|
|
125939
126075
|
const onAbort = () => finish("abort");
|
|
125940
126076
|
const timer = setTimeout(() => finish("budget"), budgetMs);
|
|
@@ -129686,7 +129822,7 @@ async function scanFileMajorRules(cwd, files2, signal) {
|
|
|
129686
129822
|
} finally {
|
|
129687
129823
|
facts.dropFileFacts(filePath);
|
|
129688
129824
|
}
|
|
129689
|
-
await new Promise((
|
|
129825
|
+
await new Promise((resolve153) => setImmediate(resolve153));
|
|
129690
129826
|
}
|
|
129691
129827
|
if (wasmAborted) {
|
|
129692
129828
|
astGrep.length = 0;
|
|
@@ -129866,7 +130002,7 @@ function resolveRebuildScript(serverFilePath) {
|
|
|
129866
130002
|
return serverFilePath.replace(/\\/g, "/").includes("/dist/") ? "build:dist" : "build";
|
|
129867
130003
|
}
|
|
129868
130004
|
function analyzeFileFresh(workerPath, file, cwd, options = {}, timeoutMs = 12e4) {
|
|
129869
|
-
return new Promise((
|
|
130005
|
+
return new Promise((resolve153) => {
|
|
129870
130006
|
const args = [workerPath, `--file=${file}`, `--cwd=${cwd}`];
|
|
129871
130007
|
if (options.flags)
|
|
129872
130008
|
args.push(`--flags=${JSON.stringify(options.flags)}`);
|
|
@@ -129876,7 +130012,7 @@ function analyzeFileFresh(workerPath, file, cwd, options = {}, timeoutMs = 12e4)
|
|
|
129876
130012
|
stdio: ["ignore", "pipe", "pipe"]
|
|
129877
130013
|
});
|
|
129878
130014
|
} catch (err) {
|
|
129879
|
-
|
|
130015
|
+
resolve153({
|
|
129880
130016
|
error: `failed to fork worker: ${err instanceof Error ? err.message : String(err)}`
|
|
129881
130017
|
});
|
|
129882
130018
|
return;
|
|
@@ -129889,7 +130025,7 @@ function analyzeFileFresh(workerPath, file, cwd, options = {}, timeoutMs = 12e4)
|
|
|
129889
130025
|
return;
|
|
129890
130026
|
settled = true;
|
|
129891
130027
|
clearTimeout(timer);
|
|
129892
|
-
|
|
130028
|
+
resolve153(outcome);
|
|
129893
130029
|
};
|
|
129894
130030
|
const timer = setTimeout(() => {
|
|
129895
130031
|
child.kill();
|
|
@@ -130258,10 +130394,10 @@ var init_session = __esm({
|
|
|
130258
130394
|
if (this.pending.length >= 1) {
|
|
130259
130395
|
return Promise.reject(new Error("turn_end queue is busy"));
|
|
130260
130396
|
}
|
|
130261
|
-
return new Promise((
|
|
130397
|
+
return new Promise((resolve153, reject) => {
|
|
130262
130398
|
const item = {
|
|
130263
130399
|
work,
|
|
130264
|
-
resolve:
|
|
130400
|
+
resolve: resolve153,
|
|
130265
130401
|
reject,
|
|
130266
130402
|
timer: setTimeout(() => {
|
|
130267
130403
|
const index = this.pending.indexOf(item);
|
|
@@ -132662,7 +132798,7 @@ var init_project_report = __esm({
|
|
|
132662
132798
|
});
|
|
132663
132799
|
|
|
132664
132800
|
// dist/clients/effective-config.js
|
|
132665
|
-
import * as
|
|
132801
|
+
import * as os37 from "node:os";
|
|
132666
132802
|
import * as path220 from "node:path";
|
|
132667
132803
|
function isEffectiveFileViewError(file) {
|
|
132668
132804
|
return "error" in file;
|
|
@@ -132728,7 +132864,7 @@ function decidedByOrNothing(entry) {
|
|
|
132728
132864
|
}
|
|
132729
132865
|
async function effectiveConfig(options = {}) {
|
|
132730
132866
|
const cwd = options.cwd ?? process.cwd();
|
|
132731
|
-
const homeDir = options.homeDir ??
|
|
132867
|
+
const homeDir = options.homeDir ?? os37.homedir();
|
|
132732
132868
|
const resolveAt = (dir) => resolvePiLensConfig({
|
|
132733
132869
|
cwd: dir,
|
|
132734
132870
|
globalDir: getGlobalPiLensDir(),
|
|
@@ -134261,7 +134397,7 @@ async function readPhaseLogTail(filePath, windowBytes, maxSamples, processId, se
|
|
|
134261
134397
|
for await (const line of lines) {
|
|
134262
134398
|
lineCount3 += 1;
|
|
134263
134399
|
if (lineCount3 % PARSE_YIELD_EVERY === 0) {
|
|
134264
|
-
await new Promise((
|
|
134400
|
+
await new Promise((resolve153) => setImmediate(resolve153));
|
|
134265
134401
|
}
|
|
134266
134402
|
if (discardPartialFirstLine) {
|
|
134267
134403
|
discardPartialFirstLine = false;
|
|
@@ -136418,6 +136554,7 @@ init_hook_budgets();
|
|
|
136418
136554
|
init_lsp_mutation();
|
|
136419
136555
|
init_lens_config();
|
|
136420
136556
|
init_server();
|
|
136557
|
+
import { createHash as createHash25 } from "node:crypto";
|
|
136421
136558
|
import * as nodeFs8 from "node:fs";
|
|
136422
136559
|
import * as path186 from "node:path";
|
|
136423
136560
|
|
|
@@ -136501,7 +136638,7 @@ async function snapshotDirInto(dir, ignoreMatcher, stack, snapshot, counter) {
|
|
|
136501
136638
|
} catch {
|
|
136502
136639
|
}
|
|
136503
136640
|
if (++counter.n % SNAPSHOT_YIELD_EVERY === 0) {
|
|
136504
|
-
await new Promise((
|
|
136641
|
+
await new Promise((resolve153) => setImmediate(resolve153));
|
|
136505
136642
|
}
|
|
136506
136643
|
}
|
|
136507
136644
|
}
|
|
@@ -138139,8 +138276,21 @@ async function handleAgentEnd({ signal, ctxCwd, getFlag, getFlagSource, notify,
|
|
|
138139
138276
|
hasKtlintConfig: hasKtlintConfig(record6.cwd)
|
|
138140
138277
|
});
|
|
138141
138278
|
const scopeKey = policy?.scope && policy.scope !== "file" ? `${policy.defaultTool ?? "unknown"}:${path186.resolve(record6.cwd)}` : `${policy?.defaultTool ?? "unknown"}:${filePath}`;
|
|
138142
|
-
if (executedAutofixScopes.has(scopeKey))
|
|
138279
|
+
if (executedAutofixScopes.has(scopeKey)) {
|
|
138280
|
+
recordDegradationOnce({
|
|
138281
|
+
kind: "deferred-autofix-duplicate-scope",
|
|
138282
|
+
subject: createHash25("sha256").update(scopeKey).digest("hex"),
|
|
138283
|
+
reason: "deferred autofix scope already attempted in this drain",
|
|
138284
|
+
metadata: {
|
|
138285
|
+
scopeKey,
|
|
138286
|
+
reason: "duplicate-scope",
|
|
138287
|
+
tool: policy?.defaultTool ?? "unknown",
|
|
138288
|
+
scope: policy?.scope ?? "file",
|
|
138289
|
+
filePath
|
|
138290
|
+
}
|
|
138291
|
+
});
|
|
138143
138292
|
continue;
|
|
138293
|
+
}
|
|
138144
138294
|
executedAutofixScopes.add(scopeKey);
|
|
138145
138295
|
retireChangedAuthorshipBeforeDrain(runtime2, session, filePath, getFlag);
|
|
138146
138296
|
const fixHold = holdFileMutationQueue(filePath);
|
|
@@ -138408,7 +138558,7 @@ async function handleAgentEnd({ signal, ctxCwd, getFlag, getFlagSource, notify,
|
|
|
138408
138558
|
for (const entry of work) {
|
|
138409
138559
|
if (!entry)
|
|
138410
138560
|
continue;
|
|
138411
|
-
await new Promise((
|
|
138561
|
+
await new Promise((resolve153) => setImmediate(resolve153));
|
|
138412
138562
|
const { record: record6, filePath, fileStart } = entry;
|
|
138413
138563
|
if (entry.missing) {
|
|
138414
138564
|
dbg2(`agent_end deferred_format skipped missing file: ${filePath}`);
|
|
@@ -139922,6 +140072,7 @@ function ensureDiskChangeSubscribers() {
|
|
|
139922
140072
|
init_bounded_cache();
|
|
139923
140073
|
init_degradation_ledger();
|
|
139924
140074
|
import { promises as fsp3 } from "node:fs";
|
|
140075
|
+
import * as os35 from "node:os";
|
|
139925
140076
|
import { join as join116 } from "node:path";
|
|
139926
140077
|
init_file_utils();
|
|
139927
140078
|
init_latency_logger();
|
|
@@ -140108,8 +140259,15 @@ function diffDeclarations(before, after) {
|
|
|
140108
140259
|
return changes;
|
|
140109
140260
|
}
|
|
140110
140261
|
function lookForOutOfBandChanges(root, trigger, runtime2, options = {}) {
|
|
140262
|
+
const homeRoot = isAtOrAboveHomeDir(realpathOrResolve(root), realpathOrResolve(os35.homedir()));
|
|
140263
|
+
if (homeRoot)
|
|
140264
|
+
recordDegradationOnce({
|
|
140265
|
+
kind: "lsp-declaration-look-capped",
|
|
140266
|
+
subject: "home-root",
|
|
140267
|
+
reason: "a session root that is the home folder or above it is not walked for declaration files changed outside pi-lens; such a change under it is not looked for (a dependency install still is)"
|
|
140268
|
+
});
|
|
140111
140269
|
const key4 = normalizeMapKey(root);
|
|
140112
|
-
return looks.run(key4, () => lookOnce(root, key4, trigger, runtime2, options));
|
|
140270
|
+
return looks.run(key4, () => lookOnce(root, key4, trigger, runtime2, options, homeRoot));
|
|
140113
140271
|
}
|
|
140114
140272
|
var CHANGE_TYPE = {
|
|
140115
140273
|
1: "created",
|
|
@@ -140137,10 +140295,10 @@ function outOfBandChange(root, installed, changes, at) {
|
|
|
140137
140295
|
at
|
|
140138
140296
|
};
|
|
140139
140297
|
}
|
|
140140
|
-
async function lookOnce(root, key4, trigger, runtime2, options) {
|
|
140298
|
+
async function lookOnce(root, key4, trigger, runtime2, options, skipWalk) {
|
|
140141
140299
|
const started = Date.now();
|
|
140142
140300
|
const prior = records.get(key4);
|
|
140143
|
-
const walkDue = options.walk === "interval" ? prior === void 0 || started - prior.walkedAt >= declarationLookIntervalMs() : trigger === "tool_result" || prior === void 0 || started - prior.walkedAt >= declarationLookIntervalMs();
|
|
140301
|
+
const walkDue = !skipWalk && (options.walk === "interval" ? prior === void 0 || started - prior.walkedAt >= declarationLookIntervalMs() : trigger === "tool_result" || prior === void 0 || started - prior.walkedAt >= declarationLookIntervalMs());
|
|
140144
140302
|
const [install, walked] = await Promise.all([
|
|
140145
140303
|
readInstallStamp(root),
|
|
140146
140304
|
walkDue ? walkDeclarations(root) : Promise.resolve(void 0)
|
|
@@ -141058,6 +141216,27 @@ async function handleToolResult(deps) {
|
|
|
141058
141216
|
}
|
|
141059
141217
|
});
|
|
141060
141218
|
}
|
|
141219
|
+
if (deps.readGuard && event.isError !== true && !getFlag("no-read-guard")) {
|
|
141220
|
+
const searchReads = [];
|
|
141221
|
+
const detailSearchReads = event.details?.searchReads;
|
|
141222
|
+
if (Array.isArray(detailSearchReads))
|
|
141223
|
+
searchReads.push(...detailSearchReads);
|
|
141224
|
+
if (event.toolName === "bash" && typeof event.input.command === "string") {
|
|
141225
|
+
const command = event.input.command;
|
|
141226
|
+
const output2 = event.content.map((part) => typeof part.text === "string" ? part.text : "").join("\n");
|
|
141227
|
+
searchReads.push(...extractGrepSearchReadsFromOutput(command, workspaceRoot, output2));
|
|
141228
|
+
}
|
|
141229
|
+
if (searchReads.length > 0) {
|
|
141230
|
+
registerSearchReads(deps.readGuard, searchReads, {
|
|
141231
|
+
projectRoot: workspaceRoot,
|
|
141232
|
+
turnIndex: runtime2.turnIndex,
|
|
141233
|
+
writeIndex: runtime2.peekWriteIndex(),
|
|
141234
|
+
...readEvidenceToolCallId !== void 0 && {
|
|
141235
|
+
toolCallId: readEvidenceToolCallId
|
|
141236
|
+
}
|
|
141237
|
+
});
|
|
141238
|
+
}
|
|
141239
|
+
}
|
|
141061
141240
|
let resolutionBasis;
|
|
141062
141241
|
if (attribution) {
|
|
141063
141242
|
resolutionBasis = attribution.originCwd;
|
|
@@ -141553,27 +141732,6 @@ async function handleToolResult(deps) {
|
|
|
141553
141732
|
}
|
|
141554
141733
|
}
|
|
141555
141734
|
}
|
|
141556
|
-
if (deps.readGuard && event.isError !== true && !getFlag("no-read-guard")) {
|
|
141557
|
-
const searchReads = [];
|
|
141558
|
-
const detailSearchReads = event.details?.searchReads;
|
|
141559
|
-
if (Array.isArray(detailSearchReads))
|
|
141560
|
-
searchReads.push(...detailSearchReads);
|
|
141561
|
-
if (event.toolName === "bash" && typeof event.input.command === "string") {
|
|
141562
|
-
const command = event.input.command;
|
|
141563
|
-
const output2 = event.content.map((part) => typeof part.text === "string" ? part.text : "").join("\n");
|
|
141564
|
-
searchReads.push(...extractGrepSearchReadsFromOutput(command, workspaceRoot, output2));
|
|
141565
|
-
}
|
|
141566
|
-
if (searchReads.length > 0) {
|
|
141567
|
-
registerSearchReads(deps.readGuard, searchReads, {
|
|
141568
|
-
projectRoot: workspaceRoot,
|
|
141569
|
-
turnIndex: runtime2.turnIndex,
|
|
141570
|
-
writeIndex: runtime2.peekWriteIndex(),
|
|
141571
|
-
...readEvidenceToolCallId !== void 0 && {
|
|
141572
|
-
toolCallId: readEvidenceToolCallId
|
|
141573
|
-
}
|
|
141574
|
-
});
|
|
141575
|
-
}
|
|
141576
|
-
}
|
|
141577
141735
|
if (deps.readGuard && event.toolName === "read" && event.isError !== true && filePath && !getFlag("no-read-guard") && !isExternalOrVendorFile(filePath, workspaceRoot)) {
|
|
141578
141736
|
const deliveredFilePath = attribution?.resolvedPath && nodeFs13.existsSync(attribution.resolvedPath) ? attribution.resolvedPath : filePath;
|
|
141579
141737
|
if (nodeFs13.existsSync(deliveredFilePath)) {
|
|
@@ -142388,6 +142546,8 @@ function getToolCallRawFilePath(toolName, event) {
|
|
|
142388
142546
|
return void 0;
|
|
142389
142547
|
}
|
|
142390
142548
|
if (toolName === "lsp_navigation") {
|
|
142549
|
+
if (typeof inputObj.path === "string")
|
|
142550
|
+
return inputObj.path;
|
|
142391
142551
|
return typeof inputObj.filePath === "string" ? inputObj.filePath : void 0;
|
|
142392
142552
|
}
|
|
142393
142553
|
return void 0;
|
|
@@ -142481,7 +142641,7 @@ function getNewContentFromToolCall(event) {
|
|
|
142481
142641
|
}
|
|
142482
142642
|
return void 0;
|
|
142483
142643
|
}
|
|
142484
|
-
async function captureOpaqueBaseline(root, sessionRoot, startedAt) {
|
|
142644
|
+
async function captureOpaqueBaseline(root, sessionRoot, startedAt, toolName) {
|
|
142485
142645
|
if (!sessionRoot)
|
|
142486
142646
|
return { state: { startedAt, strategy: "git" }, note: "git" };
|
|
142487
142647
|
if (await isGitWorktree(root)) {
|
|
@@ -142496,6 +142656,8 @@ async function captureOpaqueBaseline(root, sessionRoot, startedAt) {
|
|
|
142496
142656
|
};
|
|
142497
142657
|
}
|
|
142498
142658
|
const outcome = await captureFileStats(root, { withHashes: true });
|
|
142659
|
+
if (outcome.unknownReason === "home-root")
|
|
142660
|
+
recordOpaqueCaptureRefused("home-root", toolName);
|
|
142499
142661
|
return {
|
|
142500
142662
|
state: outcome.snapshot ? { startedAt, strategy: "stat-diff", stats: outcome.snapshot } : {
|
|
142501
142663
|
startedAt,
|
|
@@ -142615,7 +142777,7 @@ async function handleToolCallImpl(deps) {
|
|
|
142615
142777
|
};
|
|
142616
142778
|
let resultNote = "";
|
|
142617
142779
|
for (const [index, root] of scopes.roots.entries()) {
|
|
142618
|
-
const baseline = await captureOpaqueBaseline(root, index === 0, started);
|
|
142780
|
+
const baseline = await captureOpaqueBaseline(root, index === 0, started, toolName);
|
|
142619
142781
|
if (index === 0)
|
|
142620
142782
|
resultNote = baseline.note;
|
|
142621
142783
|
getOpaqueBaselineStore().record(opaqueBaselineSlot(root, runtime2.sessionGeneration), callId, baseline.state, turn);
|
|
@@ -143603,7 +143765,7 @@ init_govulncheck_client();
|
|
|
143603
143765
|
init_project_trust();
|
|
143604
143766
|
init_trivy_client();
|
|
143605
143767
|
import * as fs141 from "node:fs";
|
|
143606
|
-
import * as
|
|
143768
|
+
import * as os36 from "node:os";
|
|
143607
143769
|
import * as path214 from "node:path";
|
|
143608
143770
|
init_dead_code();
|
|
143609
143771
|
init_gitleaks();
|
|
@@ -143852,7 +144014,7 @@ async function fetchFreshProjectDiagnostics(cacheManager2, cwd, clients, signal,
|
|
|
143852
144014
|
analysisRoot = realpathOrResolve(cwd);
|
|
143853
144015
|
}
|
|
143854
144016
|
const unsafeRootReason = "the analysis root resolves at or above the home directory; heavyweight analyzers refuse to walk from there (#747)";
|
|
143855
|
-
const homeRoot = realpathOrResolve(options.homeDir ??
|
|
144017
|
+
const homeRoot = realpathOrResolve(options.homeDir ?? os36.homedir());
|
|
143856
144018
|
if (options.analysisRoot !== void 0) {
|
|
143857
144019
|
const unsafeExplicitRoot = !isSameOrWithin(homeRoot, analysisRoot) || isSameOrWithin(analysisRoot, homeRoot);
|
|
143858
144020
|
analysisRootValidation = unsafeExplicitRoot ? {
|
|
@@ -144211,12 +144373,12 @@ async function fetchFreshProjectDiagnostics(cacheManager2, cwd, clients, signal,
|
|
|
144211
144373
|
const allSettled = Promise.all(tasks).then(() => "completed").catch(() => "completed");
|
|
144212
144374
|
const outcome = signal ? await Promise.race([
|
|
144213
144375
|
allSettled,
|
|
144214
|
-
new Promise((
|
|
144376
|
+
new Promise((resolve153) => {
|
|
144215
144377
|
if (signal.aborted) {
|
|
144216
|
-
|
|
144378
|
+
resolve153("aborted");
|
|
144217
144379
|
return;
|
|
144218
144380
|
}
|
|
144219
|
-
signal.addEventListener("abort", () =>
|
|
144381
|
+
signal.addEventListener("abort", () => resolve153("aborted"), {
|
|
144220
144382
|
once: true
|
|
144221
144383
|
});
|
|
144222
144384
|
})
|
|
@@ -145355,12 +145517,12 @@ async function collectBatchDiagnostics(files2, severity, lspService, options) {
|
|
|
145355
145517
|
});
|
|
145356
145518
|
const result = options.signal ? await Promise.race([
|
|
145357
145519
|
bounded2,
|
|
145358
|
-
new Promise((
|
|
145520
|
+
new Promise((resolve153) => {
|
|
145359
145521
|
if (options.signal?.aborted) {
|
|
145360
|
-
|
|
145522
|
+
resolve153(void 0);
|
|
145361
145523
|
return;
|
|
145362
145524
|
}
|
|
145363
|
-
options.signal?.addEventListener("abort", () =>
|
|
145525
|
+
options.signal?.addEventListener("abort", () => resolve153(void 0), {
|
|
145364
145526
|
once: true
|
|
145365
145527
|
});
|
|
145366
145528
|
})
|
|
@@ -145797,7 +145959,7 @@ async function findFullScanBindingMismatches(results) {
|
|
|
145797
145959
|
sinceYield += 1;
|
|
145798
145960
|
if (sinceYield >= FULL_SCAN_BINDING_YIELD_EVERY) {
|
|
145799
145961
|
sinceYield = 0;
|
|
145800
|
-
await new Promise((
|
|
145962
|
+
await new Promise((resolve153) => setImmediate(resolve153));
|
|
145801
145963
|
}
|
|
145802
145964
|
}
|
|
145803
145965
|
return mismatched;
|
|
@@ -150447,7 +150609,7 @@ Note: ${snapshotWithheldLine}` : ""}`
|
|
|
150447
150609
|
const msg = err instanceof Error ? err.message : String(err);
|
|
150448
150610
|
if (rawPath && /No Project/i.test(msg)) {
|
|
150449
150611
|
await openFileBestEffort(lspService, filePath);
|
|
150450
|
-
await new Promise((
|
|
150612
|
+
await new Promise((resolve153) => setTimeout(resolve153, 120));
|
|
150451
150613
|
const retryRaw = await lspService.workspaceSymbol(query ?? "", filePath);
|
|
150452
150614
|
const retrySymbols = (Array.isArray(retryRaw) ? retryRaw : [retryRaw]).filter((s) => typeof s === "object" && s !== null);
|
|
150453
150615
|
return dedupeWorkspaceSymbols(retrySymbols);
|
|
@@ -151437,7 +151599,7 @@ init_degradation_ledger();
|
|
|
151437
151599
|
init_env_utils();
|
|
151438
151600
|
init_latency_logger();
|
|
151439
151601
|
init_string_utils();
|
|
151440
|
-
import { createHash as
|
|
151602
|
+
import { createHash as createHash26 } from "node:crypto";
|
|
151441
151603
|
var PROCESS_TURN_SCOPE = "process-global-runtime";
|
|
151442
151604
|
var SECONDARY_TURN_SCOPE = "unavailable-concurrent-secondary";
|
|
151443
151605
|
var MAX_HASHED_MESSAGES = 64;
|
|
@@ -151609,7 +151771,7 @@ function identityEvidence(value) {
|
|
|
151609
151771
|
const truncated = normalized2.length > MAX_LOGGED_IDENTITY_CHARS;
|
|
151610
151772
|
return {
|
|
151611
151773
|
display: normalized2.slice(0, MAX_LOGGED_IDENTITY_CHARS),
|
|
151612
|
-
hash:
|
|
151774
|
+
hash: createHash26("sha256").update(normalized2).digest("hex"),
|
|
151613
151775
|
status: truncated ? "truncated" : "complete"
|
|
151614
151776
|
};
|
|
151615
151777
|
}
|
|
@@ -151846,7 +152008,7 @@ function boundedHashValue(value, depth = 0, seen = /* @__PURE__ */ new Set(), st
|
|
|
151846
152008
|
}
|
|
151847
152009
|
}
|
|
151848
152010
|
function hashMessageSequence(messages) {
|
|
151849
|
-
const hash =
|
|
152011
|
+
const hash = createHash26("sha256");
|
|
151850
152012
|
const state9 = {
|
|
151851
152013
|
contentTruncated: false,
|
|
151852
152014
|
incomplete: false
|
|
@@ -151903,7 +152065,7 @@ function rollingMessageDigests(messages) {
|
|
|
151903
152065
|
if (count > MAX_ROLLING_DIGEST_MESSAGES)
|
|
151904
152066
|
return { complete: false, gap: "too-many-messages" };
|
|
151905
152067
|
const digests = Buffer.alloc(count * ROLLING_DIGEST_BYTES);
|
|
151906
|
-
const hash =
|
|
152068
|
+
const hash = createHash26("sha256");
|
|
151907
152069
|
let chars = 0;
|
|
151908
152070
|
for (let index = 0; index < count; index++) {
|
|
151909
152071
|
const serialized = JSON.stringify(messages[index]) ?? "undefined";
|
|
@@ -152386,7 +152548,7 @@ function canonicalJsonValue(value, seen) {
|
|
|
152386
152548
|
}
|
|
152387
152549
|
function hashFirstMessage(first) {
|
|
152388
152550
|
const serialized = canonicalJsonValue(first, /* @__PURE__ */ new Set());
|
|
152389
|
-
return
|
|
152551
|
+
return createHash26("sha256").update(serialized).digest("hex");
|
|
152390
152552
|
}
|
|
152391
152553
|
function toolNamesFrom(value) {
|
|
152392
152554
|
if (!Array.isArray(value))
|
|
@@ -152400,7 +152562,7 @@ function toolNamesFrom(value) {
|
|
|
152400
152562
|
return names;
|
|
152401
152563
|
}
|
|
152402
152564
|
function hashSystemMessages(messages) {
|
|
152403
|
-
const hash =
|
|
152565
|
+
const hash = createHash26("sha256");
|
|
152404
152566
|
const loadout = /* @__PURE__ */ new Map();
|
|
152405
152567
|
for (const message of messages) {
|
|
152406
152568
|
if (!message || typeof message !== "object" || message.role !== "system")
|
|
@@ -155274,5 +155436,5 @@ export {
|
|
|
155274
155436
|
/*! Bundled license information:
|
|
155275
155437
|
|
|
155276
155438
|
js-yaml/dist/js-yaml.mjs:
|
|
155277
|
-
(*! js-yaml 5.
|
|
155439
|
+
(*! js-yaml 5.5.0 https://github.com/nodeca/js-yaml @license MIT *)
|
|
155278
155440
|
*/
|