pi-lens 4.4.3 → 4.4.5
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 +721 -0
- package/README.md +25 -3
- package/config/dependency-cruiser-eager-allowlist.json +1 -0
- package/dist/chunk-22Y2BM7H.js +23 -0
- package/dist/{chunk-WU567RSC.js → chunk-27VWVB23.js} +16 -14
- package/dist/{chunk-FLKWCIZH.js → chunk-2FYKETQJ.js} +10 -6
- package/dist/{chunk-MQLUAEOC.js → chunk-2LDMXL2M.js} +2 -2
- package/dist/{chunk-YSZNHOBY.js → chunk-2SDHYHHO.js} +17 -17
- package/dist/chunk-2Y6OJRSI.js +38 -0
- package/dist/chunk-3SNDVPOR.js +507 -0
- package/dist/{chunk-EJIUXPBX.js → chunk-3WCEHYOI.js} +1 -1
- package/dist/chunk-44X7VIKR.js +73 -0
- package/dist/{chunk-Q7DUK4LX.js → chunk-4FHUGDKU.js} +16 -14
- package/dist/{chunk-H6MF6EVN.js → chunk-4ODSZ35Z.js} +1498 -534
- package/dist/{chunk-ZGDGW2V3.js → chunk-4U7GDSZQ.js} +2 -2
- package/dist/chunk-54NIOJJZ.js +25 -0
- package/dist/{chunk-ZWFS3OEF.js → chunk-5DKE4HGX.js} +38 -37
- package/dist/{chunk-VRZP76YM.js → chunk-5LRUKYFA.js} +34 -4
- package/dist/{chunk-QOBUHWHX.js → chunk-63NMUNYP.js} +12 -16
- package/dist/{chunk-VWCXW2E7.js → chunk-6XSESGWD.js} +13 -6
- package/dist/{chunk-QGQ5CCCG.js → chunk-72J27ICO.js} +2 -3
- package/dist/{chunk-CSHFH5IN.js → chunk-7FLRUH6B.js} +1 -1
- package/dist/chunk-7IYC4ENJ.js +297 -0
- package/dist/chunk-7WWQAW5P.js +30 -0
- package/dist/{chunk-EU63SDCG.js → chunk-7ZS7MC24.js} +885 -451
- package/dist/{chunk-KBG47GHP.js → chunk-AHWA4AKM.js} +18 -12
- package/dist/{chunk-FMSO6RDZ.js → chunk-AI3GP74G.js} +17 -19
- package/dist/chunk-APFJKOP6.js +67 -0
- package/dist/{chunk-RXCOMYPY.js → chunk-ASRAO7KG.js} +31 -33
- package/dist/{chunk-BW5KFIQC.js → chunk-AWQWXSW4.js} +1 -0
- package/dist/{chunk-QILIYSJF.js → chunk-CG5V25HX.js} +1 -1
- package/dist/chunk-CKEQFGLT.js +32 -0
- package/dist/{chunk-RPLINGVB.js → chunk-COOUUC5W.js} +6 -6
- package/dist/{chunk-GBPP5P7X.js → chunk-CPZ5JJW6.js} +4 -4
- package/dist/{chunk-OCAGUNBC.js → chunk-DS2USX5G.js} +13 -15
- package/dist/chunk-EA2ZRG44.js +27 -0
- package/dist/{chunk-ZHFZWTZV.js → chunk-EDMLIW6W.js} +13 -14
- package/dist/{chunk-2EECBNC5.js → chunk-EIKRZ32J.js} +75 -0
- package/dist/chunk-EKNWOL2I.js +27 -0
- package/dist/{chunk-CMMHNUZ2.js → chunk-ELZRSR5N.js} +65 -43
- package/dist/{chunk-BKE7E7TC.js → chunk-EN5AM7PX.js} +11 -12
- package/dist/{chunk-N2H3ZPZY.js → chunk-EWXXLS26.js} +227 -24
- package/dist/chunk-EX4EXBW7.js +37 -0
- package/dist/{chunk-YYOIQFRS.js → chunk-EXVXBSGN.js} +130 -52
- package/dist/{chunk-6GFRNVYR.js → chunk-F7BO6FWH.js} +12 -13
- package/dist/chunk-FEDWAYDS.js +2485 -0
- package/dist/{chunk-JAU72XNY.js → chunk-FWZRGGGY.js} +73 -9
- package/dist/{chunk-GXW6K4YJ.js → chunk-G224FADB.js} +1 -1
- package/dist/chunk-G5UCJFT7.js +26 -0
- package/dist/{chunk-67WMNWEE.js → chunk-GLW3YDZZ.js} +22 -13
- package/dist/{chunk-724UL2TJ.js → chunk-GTDSYEA2.js} +72 -39
- package/dist/{chunk-PHDMFAKM.js → chunk-GYRZ72R4.js} +10 -4
- package/dist/chunk-HYVXA3BB.js +49 -0
- package/dist/{chunk-SAEFPSB6.js → chunk-IEBJF3PN.js} +23 -15
- package/dist/chunk-IJYGIDF4.js +186 -0
- package/dist/{chunk-ACXEQZOU.js → chunk-IL7K66ZQ.js} +101 -109
- package/dist/{chunk-ZXYDQ3TZ.js → chunk-JWOVP5BL.js} +50 -19
- package/dist/{chunk-OXXKQCSV.js → chunk-K2GUZ4DN.js} +4 -4
- package/dist/{chunk-AW7R2GWG.js → chunk-K4SZB56V.js} +39 -39
- package/dist/{chunk-WOA4LN2R.js → chunk-KCBRHV5E.js} +3 -3
- package/dist/{chunk-3W7IEVVL.js → chunk-KFXCL4OV.js} +47 -45
- package/dist/{chunk-2BBLFX75.js → chunk-KJJAVH3X.js} +81 -15
- package/dist/{chunk-VCHXCQFG.js → chunk-KPVLQHCZ.js} +4 -6
- package/dist/{chunk-P7266HLM.js → chunk-KX56K73G.js} +10 -13
- package/dist/{chunk-VSSBEUFT.js → chunk-LMCTHJ2H.js} +19 -19
- package/dist/{chunk-IBGIOBEE.js → chunk-MEFLGBCS.js} +69 -8
- package/dist/{chunk-TYM6OUIT.js → chunk-MKPCELNI.js} +17 -17
- package/dist/{chunk-XTMJ7XDT.js → chunk-N3PLNNCW.js} +1 -1
- package/dist/chunk-N5FBM25N.js +22 -0
- package/dist/{chunk-CHOW74WE.js → chunk-NFNVDDGB.js} +7 -12
- package/dist/{chunk-52FUZI6K.js → chunk-NLIVE7L6.js} +2 -30
- package/dist/{chunk-SS36ZX4J.js → chunk-OMJ3OFBJ.js} +6 -6
- package/dist/{chunk-4W4VLAPJ.js → chunk-OZNCKLOX.js} +13 -14
- package/dist/chunk-P5XUGPIX.js +31 -0
- package/dist/{chunk-5UCAH366.js → chunk-PJXNTPB2.js} +253 -33
- package/dist/chunk-PKOXJIVT.js +88 -0
- package/dist/{chunk-6C7JWPCP.js → chunk-PP2A5V2T.js} +27 -26
- package/dist/{chunk-L3BLXZG7.js → chunk-Q42LJANT.js} +31 -70
- package/dist/{chunk-AB3YYG6N.js → chunk-Q4BKKOVC.js} +8 -8
- package/dist/{chunk-3EFKIGZN.js → chunk-QT66NEYN.js} +4 -4
- package/dist/{chunk-3VPVG5SU.js → chunk-RCHO5W7M.js} +19 -18
- package/dist/{chunk-77M37OKR.js → chunk-RG3MXTRI.js} +7 -7
- package/dist/chunk-RG7OODGM.js +57 -0
- package/dist/{chunk-T6CPIZNT.js → chunk-RU34BA4D.js} +44 -39
- package/dist/{chunk-JMYYOTQG.js → chunk-S26LC76R.js} +13 -1
- package/dist/{chunk-5NGR67U5.js → chunk-S55TEC7I.js} +33 -5
- package/dist/{chunk-M6HSLBWY.js → chunk-SJHC3BCZ.js} +7956 -8047
- package/dist/{chunk-XCJN5IJU.js → chunk-SNEUMLM7.js} +4 -4
- package/dist/{chunk-UZ3TUTRV.js → chunk-T4NGVFYI.js} +2 -2
- package/dist/{chunk-2VUQMUMT.js → chunk-THEXI2QO.js} +49 -43
- package/dist/{chunk-R3PCY3YS.js → chunk-TL2TCJYL.js} +15 -16
- package/dist/{chunk-C34ZXZ7O.js → chunk-TPYYEDP5.js} +838 -352
- package/dist/{chunk-AOHZU2BM.js → chunk-TVZRLTG6.js} +8 -1
- package/dist/{chunk-XMSXXAHW.js → chunk-UCVMSOXF.js} +2 -2
- package/dist/chunk-UL5SXQVX.js +32 -0
- package/dist/{chunk-GAEGEPOC.js → chunk-UO66IMVP.js} +2 -2
- package/dist/{chunk-N3X6Q4YT.js → chunk-UVY4TOJH.js} +3 -3
- package/dist/{chunk-2CD5RS6M.js → chunk-VIDEKABZ.js} +23 -2
- package/dist/{chunk-JSQFTSC6.js → chunk-VITFDI3O.js} +13 -14
- package/dist/{chunk-YIUAVF7E.js → chunk-VUAVE3QC.js} +42 -42
- package/dist/{chunk-QOZXJ4NA.js → chunk-WUY4BZEP.js} +21 -20
- package/dist/{chunk-VCO24T4L.js → chunk-X3UTCXAA.js} +43 -53
- package/dist/chunk-XHDBJODR.js +45 -0
- package/dist/{chunk-MXGY6KPT.js → chunk-XHLK33VM.js} +28 -21
- package/dist/{chunk-RWWYJ623.js → chunk-XI34NWDI.js} +2 -2
- package/dist/{chunk-QQNQ7SJW.js → chunk-XWFIHYCH.js} +12 -4
- package/dist/{chunk-6SDEP3AJ.js → chunk-Y2TPADJR.js} +10 -11
- package/dist/{chunk-MRXKYPCS.js → chunk-Y5KTA2OB.js} +17 -17
- package/dist/{chunk-7DYBLXYA.js → chunk-YKVDBNPO.js} +11 -5
- package/dist/{chunk-2B73ZPOK.js → chunk-YSDPVDFC.js} +3 -3
- package/dist/chunk-YWNO5Q4R.js +44 -0
- package/dist/{chunk-QHJ6DQ2R.js → chunk-YWWG4AQA.js} +165 -32
- package/dist/{chunk-3JNKMP3B.js → chunk-YXDCRUKQ.js} +4 -4
- package/dist/{chunk-UXGETRP4.js → chunk-YXGRRORB.js} +16 -17
- package/dist/{chunk-SQ4TVJBR.js → chunk-ZAPSUBLU.js} +13 -7
- package/dist/{chunk-76MWC2K6.js → chunk-ZPJM7DID.js} +90 -97
- package/dist/{chunk-XVF2VVXP.js → chunk-ZSUX7KEM.js} +16 -15
- package/dist/index.js +31038 -20893
- package/dist/mcp/analyze-cli.js +11 -11
- package/dist/mcp/cli.js +47 -43
- package/dist/mcp/server.js +2188 -906
- package/dist/mcp/worker.js +66 -63
- package/dist/probes/installer.js +21 -23
- package/dist/workers/project-snapshot-persist-worker.js +28 -9
- package/dist/workers/review-graph-persist-worker.js +1 -1
- package/docs/adr/0010-trace-validation-session-lifecycle.md +390 -0
- package/docs/adr/README.md +1 -0
- package/docs/ast-grep_rules_catalog.md +5 -3
- package/docs/configuration.md +20 -0
- package/docs/engineering-principles.md +44 -0
- package/docs/environment-variables.md +20 -0
- package/docs/features.md +16 -1
- package/docs/globalconfig.md +37 -8
- package/docs/lsp-capability-matrix.md +105 -12
- package/docs/lsp-idle-eviction.md +44 -36
- package/docs/pi-lens-fixer.md +139 -14
- package/docs/pi-lens-investigator.md +14 -0
- package/docs/pi-lens-merge-policy.md +120 -17
- package/docs/pi-lens-monitor.md +71 -9
- package/docs/pi-lens-retro.md +6 -3
- package/docs/pi-lens-reviewer.md +160 -5
- package/docs/pi-lens-subagent.md +29 -14
- package/docs/release-qa-baseline.md +21 -7
- package/docs/servercapabilities.md +53 -63
- package/docs/settings.md +9 -5
- package/docs/subagent-compat.md +1 -1
- package/docs/usage.md +1 -0
- package/package.json +9 -5
- package/rules/ast-grep-rules/rule-tests/no-return-value-in-generator-test.yml +17 -0
- package/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-js-test.yml +86 -0
- package/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-test.yml +86 -0
- package/rules/ast-grep-rules/rule-tests/unchecked-numeric-parse-python-test.yml +15 -0
- package/rules/ast-grep-rules/rules/no-return-value-in-generator.yml +9 -4
- package/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +119 -0
- package/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +119 -0
- package/rules/ast-grep-rules/rules/unchecked-numeric-parse-python.yml +13 -2
- package/rules/rule-catalog.json +25 -1
- package/scripts/analyze-pi-lens-logs.mjs +15 -5
- package/scripts/download-grammars.js +40 -7
- package/scripts/lib/is-main-module.mjs +27 -0
- package/scripts/lib/latency-log-phases.mjs +95 -0
- package/scripts/lib/scratch-home-env.mjs +21 -0
- package/scripts/rpc-load-check.mjs +568 -81
- package/scripts/warm-loader-cache.mjs +2 -5
- package/dist/chunk-23WOO7TX.js +0 -23
- package/dist/chunk-3YN6V5TV.js +0 -85
- package/dist/chunk-466Z26MG.js +0 -30
- package/dist/chunk-4UNXBNE2.js +0 -24
- package/dist/chunk-6STA6Z7I.js +0 -47
- package/dist/chunk-ABBOA7UD.js +0 -157
- package/dist/chunk-BRGDSBJE.js +0 -28
- package/dist/chunk-EC47DWFA.js +0 -56
- package/dist/chunk-FCSOVF55.js +0 -273
- package/dist/chunk-IZSHAIJ7.js +0 -26
- package/dist/chunk-KDERNTCQ.js +0 -28
- package/dist/chunk-KSX3TXSZ.js +0 -69
- package/dist/chunk-LOP6GRPH.js +0 -31
- package/dist/chunk-PNQDPDRC.js +0 -184
- package/dist/chunk-UOPVJQ4N.js +0 -103
- package/dist/chunk-XAGLWMJ4.js +0 -51
- package/dist/chunk-XIJZVPD5.js +0 -39
- package/dist/chunk-Z3CCVDUB.js +0 -76
- package/dist/chunk-Z527N6YQ.js +0 -28
- package/dist/chunk-ZANLILYD.js +0 -79
- /package/dist/{chunk-FC4RP4I2.js → chunk-6HWVI6MI.js} +0 -0
|
@@ -2,13 +2,10 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
|
|
|
2
2
|
import {
|
|
3
3
|
DEFAULT_MAX_OUTPUT_BYTES,
|
|
4
4
|
writeFileAtomic
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EIKRZ32J.js";
|
|
6
6
|
import {
|
|
7
7
|
incrementDegradationCount
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
normalizeMapKey
|
|
11
|
-
} from "./chunk-N2H3ZPZY.js";
|
|
8
|
+
} from "./chunk-FWZRGGGY.js";
|
|
12
9
|
|
|
13
10
|
// dist/clients/mcp/ipc.js
|
|
14
11
|
import * as crypto from "node:crypto";
|
|
@@ -34,7 +31,30 @@ function diagnosticsIpcPathForCwd(cwd, pid, platform = process.platform) {
|
|
|
34
31
|
const base = ipcPathForCwd(cwd, platform);
|
|
35
32
|
if (platform === "win32")
|
|
36
33
|
return `${base}-diagnostics-${pid}`;
|
|
37
|
-
|
|
34
|
+
const hash = workspaceHash(cwd, platform);
|
|
35
|
+
return path.join(path.dirname(base), `pi-lens-mcp-${pid}-diagnostics-${hash}.sock`);
|
|
36
|
+
}
|
|
37
|
+
function boundUnixSocketPath(endpoint, platform = process.platform) {
|
|
38
|
+
const limit = platform === "darwin" ? 104 : platform === "win32" ? 0 : 108;
|
|
39
|
+
const bytes = Buffer.from(endpoint);
|
|
40
|
+
if (limit === 0 || bytes.length <= limit)
|
|
41
|
+
return endpoint;
|
|
42
|
+
return bytes.subarray(0, limit).toString();
|
|
43
|
+
}
|
|
44
|
+
function unlinkStaleUnixSocket(endpoint, options = {}) {
|
|
45
|
+
if ((options.platform ?? process.platform) === "win32")
|
|
46
|
+
return "absent";
|
|
47
|
+
const bound = boundUnixSocketPath(endpoint, options.platform);
|
|
48
|
+
if (options.ownerPid !== void 0 && bound !== endpoint && !bound.includes(`${path.sep}pi-lens-mcp-${options.ownerPid}-`))
|
|
49
|
+
return "shared-name";
|
|
50
|
+
try {
|
|
51
|
+
if (!fs.lstatSync(bound).isSocket())
|
|
52
|
+
return "not-a-socket";
|
|
53
|
+
fs.unlinkSync(bound);
|
|
54
|
+
return "unlinked";
|
|
55
|
+
} catch {
|
|
56
|
+
return "absent";
|
|
57
|
+
}
|
|
38
58
|
}
|
|
39
59
|
function isNoListenerError(error) {
|
|
40
60
|
const code = error?.code;
|
|
@@ -44,7 +64,7 @@ function contentHash(content) {
|
|
|
44
64
|
return crypto.createHash("sha256").update(content).digest("hex");
|
|
45
65
|
}
|
|
46
66
|
function requestOverWarmIpc(endpoint, timeoutMs, buildRequest, validate) {
|
|
47
|
-
return new Promise((
|
|
67
|
+
return new Promise((resolve2) => {
|
|
48
68
|
let settled = false;
|
|
49
69
|
const finish = (value) => {
|
|
50
70
|
if (settled)
|
|
@@ -52,7 +72,7 @@ function requestOverWarmIpc(endpoint, timeoutMs, buildRequest, validate) {
|
|
|
52
72
|
settled = true;
|
|
53
73
|
clearTimeout(timer);
|
|
54
74
|
socket.destroy();
|
|
55
|
-
|
|
75
|
+
resolve2(value);
|
|
56
76
|
};
|
|
57
77
|
const deadlineAt = Date.now() + timeoutMs;
|
|
58
78
|
const socket = net.createConnection(endpoint);
|
|
@@ -206,14 +226,14 @@ function recordTurnEndOutcome(cwd, outcome, platform = process.platform) {
|
|
|
206
226
|
}
|
|
207
227
|
}
|
|
208
228
|
function requestWarmAnalyze(cwd, file, timeoutMs = 3e4) {
|
|
209
|
-
return new Promise((
|
|
229
|
+
return new Promise((resolve2) => {
|
|
210
230
|
let settled = false;
|
|
211
231
|
const finish = (value) => {
|
|
212
232
|
if (settled)
|
|
213
233
|
return;
|
|
214
234
|
settled = true;
|
|
215
235
|
clearTimeout(timer);
|
|
216
|
-
|
|
236
|
+
resolve2(value);
|
|
217
237
|
};
|
|
218
238
|
const socket = net.createConnection(ipcPathForCwd(cwd));
|
|
219
239
|
socket.setEncoding("utf8");
|
|
@@ -329,70 +349,11 @@ function createWarmIpcRequestQueue() {
|
|
|
329
349
|
};
|
|
330
350
|
}
|
|
331
351
|
|
|
332
|
-
// dist/clients/dispatch/runner-context.js
|
|
333
|
-
import * as fs2 from "node:fs";
|
|
334
|
-
import * as path2 from "node:path";
|
|
335
|
-
function resolveAgainstAncestors(cwd, filePath) {
|
|
336
|
-
if (path2.isAbsolute(filePath)) {
|
|
337
|
-
return path2.resolve(filePath);
|
|
338
|
-
}
|
|
339
|
-
const normalizedRelative = filePath.replace(/\\/g, "/");
|
|
340
|
-
const cwdBaseName = path2.basename(path2.resolve(cwd)).replace(/\\/g, "/");
|
|
341
|
-
if (cwdBaseName && (normalizedRelative === cwdBaseName || normalizedRelative.startsWith(`${cwdBaseName}/`))) {
|
|
342
|
-
const trimmedRelative = normalizedRelative === cwdBaseName ? "" : normalizedRelative.slice(cwdBaseName.length + 1);
|
|
343
|
-
const trimmedCandidate = trimmedRelative ? path2.resolve(cwd, trimmedRelative) : path2.resolve(cwd);
|
|
344
|
-
if (fs2.existsSync(trimmedCandidate)) {
|
|
345
|
-
return trimmedCandidate;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
const directCandidate = path2.resolve(cwd, filePath);
|
|
349
|
-
if (fs2.existsSync(directCandidate)) {
|
|
350
|
-
return directCandidate;
|
|
351
|
-
}
|
|
352
|
-
let current = path2.resolve(cwd);
|
|
353
|
-
const { root } = path2.parse(current);
|
|
354
|
-
while (current !== root) {
|
|
355
|
-
const parent = path2.dirname(current);
|
|
356
|
-
if (parent === current)
|
|
357
|
-
break;
|
|
358
|
-
const candidate = path2.resolve(parent, filePath);
|
|
359
|
-
if (fs2.existsSync(candidate)) {
|
|
360
|
-
return candidate;
|
|
361
|
-
}
|
|
362
|
-
current = parent;
|
|
363
|
-
}
|
|
364
|
-
return directCandidate;
|
|
365
|
-
}
|
|
366
|
-
function resolveRunnerPath(cwd, filePath) {
|
|
367
|
-
return normalizeMapKey(resolveAgainstAncestors(cwd, filePath));
|
|
368
|
-
}
|
|
369
|
-
function toRunnerDisplayPath(cwd, filePath) {
|
|
370
|
-
const cwdKey = normalizeMapKey(path2.resolve(cwd));
|
|
371
|
-
const fileKey = resolveRunnerPath(cwd, filePath);
|
|
372
|
-
const relative2 = path2.relative(cwdKey, fileKey).replace(/\\/g, "/");
|
|
373
|
-
if (relative2 && relative2 !== "." && !relative2.startsWith("../")) {
|
|
374
|
-
return relative2;
|
|
375
|
-
}
|
|
376
|
-
return fileKey;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
// dist/clients/freshness.js
|
|
380
|
-
var MTIME_DRIFT_TOLERANCE_MS = 50;
|
|
381
|
-
function freshnessFromMtime(input) {
|
|
382
|
-
const tolerance = input.toleranceMs ?? MTIME_DRIFT_TOLERANCE_MS;
|
|
383
|
-
if (input.mtimeMs === void 0) {
|
|
384
|
-
return { verdict: "indeterminate", reason: "no-mtime-evidence" };
|
|
385
|
-
}
|
|
386
|
-
return input.mtimeMs > input.referenceMs + tolerance ? { verdict: "stale", reason: "modified-after-reference" } : { verdict: "fresh" };
|
|
387
|
-
}
|
|
388
|
-
|
|
389
352
|
export {
|
|
390
|
-
resolveRunnerPath,
|
|
391
|
-
toRunnerDisplayPath,
|
|
392
|
-
freshnessFromMtime,
|
|
393
353
|
WARM_CODE_ACTION_LOOKUP_LIMIT,
|
|
394
354
|
ipcPathForCwd,
|
|
395
355
|
diagnosticsIpcPathForCwd,
|
|
356
|
+
unlinkStaleUnixSocket,
|
|
396
357
|
contentHash,
|
|
397
358
|
requestWarmDiagnostics,
|
|
398
359
|
requestWarmCodeActions,
|
|
@@ -4,32 +4,32 @@ import {
|
|
|
4
4
|
discoverManagedTool,
|
|
5
5
|
getManagedToolEnvironment,
|
|
6
6
|
resolveAvailableOrInstall
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2SDHYHHO.js";
|
|
8
8
|
import {
|
|
9
9
|
mapWithConcurrency
|
|
10
10
|
} from "./chunk-XIMYZ3JA.js";
|
|
11
11
|
import {
|
|
12
12
|
findNodeToolBinary
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-K4SZB56V.js";
|
|
14
14
|
import {
|
|
15
15
|
getIsolatedNpxSpawnOptions
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XI34NWDI.js";
|
|
17
17
|
import {
|
|
18
18
|
createAvailabilityLatch
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-5LRUKYFA.js";
|
|
20
20
|
import {
|
|
21
21
|
safeSpawnAsync
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-TPYYEDP5.js";
|
|
23
23
|
import {
|
|
24
24
|
compareOrdinal,
|
|
25
25
|
recordDegradationOnce
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-FWZRGGGY.js";
|
|
27
27
|
import {
|
|
28
28
|
createSubsystemLogger
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-N3PLNNCW.js";
|
|
30
30
|
import {
|
|
31
31
|
isFullyQualified
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-EWXXLS26.js";
|
|
33
33
|
|
|
34
34
|
// dist/clients/dependency-checker.js
|
|
35
35
|
import * as fs from "node:fs";
|
|
@@ -2,7 +2,7 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
|
|
|
2
2
|
import {
|
|
3
3
|
createAvailabilityProbeFlight,
|
|
4
4
|
probeToolAsync
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XI34NWDI.js";
|
|
6
6
|
import {
|
|
7
7
|
classifyProbeFailure,
|
|
8
8
|
createAvailabilityLatch,
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
describeProbeEvidence,
|
|
11
11
|
logAvailabilityDecision,
|
|
12
12
|
startHostStallSampler
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5LRUKYFA.js";
|
|
14
14
|
import {
|
|
15
15
|
createSingleFlight
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AWQWXSW4.js";
|
|
17
17
|
import {
|
|
18
18
|
createSubsystemLogger
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-N3PLNNCW.js";
|
|
20
20
|
|
|
21
21
|
// dist/clients/security-scan-client.js
|
|
22
22
|
import * as path from "node:path";
|
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
getStartupScanMaxSourceFilesDerived
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UO66IMVP.js";
|
|
5
5
|
import {
|
|
6
6
|
shouldRecurseIntoDir,
|
|
7
7
|
walkTreeStackAsync,
|
|
8
8
|
walkTreeStackSync
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-S55TEC7I.js";
|
|
10
10
|
import {
|
|
11
11
|
getProjectIgnoreMatcher
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TPYYEDP5.js";
|
|
13
13
|
import {
|
|
14
14
|
getDirectoryMarkers,
|
|
15
15
|
registerWorkspaceTopologyReset
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZSUX7KEM.js";
|
|
17
17
|
import {
|
|
18
18
|
lazyEnvNumber
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import {
|
|
21
|
-
BoundedLruCache
|
|
22
|
-
} from "./chunk-ABBOA7UD.js";
|
|
19
|
+
} from "./chunk-TVZRLTG6.js";
|
|
23
20
|
import {
|
|
21
|
+
BoundedLruCache,
|
|
24
22
|
isAtOrAboveHomeDir,
|
|
25
|
-
normalizeMapKey
|
|
26
|
-
|
|
23
|
+
normalizeMapKey,
|
|
24
|
+
walkUpDirs
|
|
25
|
+
} from "./chunk-EWXXLS26.js";
|
|
27
26
|
|
|
28
27
|
// dist/clients/startup-scan.js
|
|
29
28
|
import * as os from "node:os";
|
|
30
29
|
import * as path from "node:path";
|
|
30
|
+
|
|
31
|
+
// dist/clients/project-root-markers.js
|
|
31
32
|
var PROJECT_ROOT_MARKERS = [
|
|
32
33
|
".git",
|
|
33
34
|
"package.json",
|
|
@@ -36,6 +37,8 @@ var PROJECT_ROOT_MARKERS = [
|
|
|
36
37
|
"go.mod",
|
|
37
38
|
"composer.json"
|
|
38
39
|
];
|
|
40
|
+
|
|
41
|
+
// dist/clients/startup-scan.js
|
|
39
42
|
var MAX_STARTUP_SCAN_ENTRIES = 5e4;
|
|
40
43
|
var SOURCE_FILE_PATTERN = /\.(ts|tsx|js|jsx|py|go|rs|rb)$/;
|
|
41
44
|
var DEFAULT_STARTUP_SCAN_VERDICT_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
@@ -57,17 +60,15 @@ function isStartupScanVerdictFresh(verdict, now = Date.now()) {
|
|
|
57
60
|
return now - verdict.computedAt < getStartupScanVerdictTtlMs();
|
|
58
61
|
}
|
|
59
62
|
function findNearestProjectRoot(startDir) {
|
|
60
|
-
let
|
|
61
|
-
|
|
62
|
-
const entryNames = getDirectoryMarkers(
|
|
63
|
+
let root = null;
|
|
64
|
+
for (const dir of walkUpDirs(startDir, { spelling: true })) {
|
|
65
|
+
const entryNames = getDirectoryMarkers(dir).entryNames;
|
|
63
66
|
if (PROJECT_ROOT_MARKERS.some((marker) => entryNames.has(marker))) {
|
|
64
|
-
|
|
67
|
+
root = dir;
|
|
68
|
+
break;
|
|
65
69
|
}
|
|
66
|
-
const parent = path.dirname(current);
|
|
67
|
-
if (parent === current)
|
|
68
|
-
return null;
|
|
69
|
-
current = parent;
|
|
70
70
|
}
|
|
71
|
+
return root;
|
|
71
72
|
}
|
|
72
73
|
function makeSourceCountVisitor(state, ignoreMatcher, limit, maxEntries) {
|
|
73
74
|
return (entry, fullPath) => {
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
scannerReportParentDir
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7FLRUH6B.js";
|
|
5
5
|
import {
|
|
6
6
|
getScratchTreeGlobPatterns,
|
|
7
7
|
nestedWorktreeOffsets
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KPVLQHCZ.js";
|
|
9
9
|
import {
|
|
10
10
|
SecurityScanClient
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QT66NEYN.js";
|
|
12
12
|
import {
|
|
13
13
|
safeSpawnAsync
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TPYYEDP5.js";
|
|
15
15
|
import {
|
|
16
16
|
loadPiLensProjectConfig
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-KJJAVH3X.js";
|
|
18
18
|
import {
|
|
19
19
|
incrementDegradationCount
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-FWZRGGGY.js";
|
|
21
21
|
import {
|
|
22
22
|
toPosix
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-EWXXLS26.js";
|
|
24
24
|
|
|
25
25
|
// dist/clients/trivy-client.js
|
|
26
26
|
import * as fs from "node:fs";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
DependencyChecker,
|
|
4
|
+
buildMadgeArgs,
|
|
5
|
+
resetMadgeManagedPathMemo
|
|
6
|
+
} from "./chunk-Q4BKKOVC.js";
|
|
7
|
+
import "./chunk-2SDHYHHO.js";
|
|
8
|
+
import "./chunk-COOUUC5W.js";
|
|
9
|
+
import {
|
|
10
|
+
mapWithConcurrency
|
|
11
|
+
} from "./chunk-XIMYZ3JA.js";
|
|
12
|
+
import "./chunk-7ZS7MC24.js";
|
|
13
|
+
import "./chunk-6XSESGWD.js";
|
|
14
|
+
import "./chunk-3SNDVPOR.js";
|
|
15
|
+
import "./chunk-JWOVP5BL.js";
|
|
16
|
+
import "./chunk-7IYC4ENJ.js";
|
|
17
|
+
import "./chunk-KX56K73G.js";
|
|
18
|
+
import "./chunk-2Y6OJRSI.js";
|
|
19
|
+
import "./chunk-WUY4BZEP.js";
|
|
20
|
+
import "./chunk-GTDSYEA2.js";
|
|
21
|
+
import "./chunk-UL5SXQVX.js";
|
|
22
|
+
import "./chunk-CKEQFGLT.js";
|
|
23
|
+
import "./chunk-NLIVE7L6.js";
|
|
24
|
+
import "./chunk-IEBJF3PN.js";
|
|
25
|
+
import "./chunk-UO66IMVP.js";
|
|
26
|
+
import "./chunk-2BEMIWEW.js";
|
|
27
|
+
import "./chunk-IJYGIDF4.js";
|
|
28
|
+
import "./chunk-IL7K66ZQ.js";
|
|
29
|
+
import "./chunk-4FHUGDKU.js";
|
|
30
|
+
import "./chunk-K4SZB56V.js";
|
|
31
|
+
import "./chunk-XI34NWDI.js";
|
|
32
|
+
import "./chunk-5LRUKYFA.js";
|
|
33
|
+
import "./chunk-63NMUNYP.js";
|
|
34
|
+
import "./chunk-CG5V25HX.js";
|
|
35
|
+
import "./chunk-PP2A5V2T.js";
|
|
36
|
+
import "./chunk-S55TEC7I.js";
|
|
37
|
+
import "./chunk-TPYYEDP5.js";
|
|
38
|
+
import "./chunk-AWQWXSW4.js";
|
|
39
|
+
import "./chunk-QYF5S6P6.js";
|
|
40
|
+
import "./chunk-GYRZ72R4.js";
|
|
41
|
+
import "./chunk-KJJAVH3X.js";
|
|
42
|
+
import "./chunk-ZSUX7KEM.js";
|
|
43
|
+
import "./chunk-EIKRZ32J.js";
|
|
44
|
+
import "./chunk-FWZRGGGY.js";
|
|
45
|
+
import "./chunk-N3PLNNCW.js";
|
|
46
|
+
import "./chunk-S26LC76R.js";
|
|
47
|
+
import "./chunk-XWFIHYCH.js";
|
|
48
|
+
import "./chunk-TVZRLTG6.js";
|
|
49
|
+
import "./chunk-LJDODBBZ.js";
|
|
50
|
+
import "./chunk-EWXXLS26.js";
|
|
51
|
+
import "./chunk-NXL4FFQQ.js";
|
|
52
|
+
export {
|
|
53
|
+
DependencyChecker,
|
|
54
|
+
buildMadgeArgs,
|
|
55
|
+
mapWithConcurrency,
|
|
56
|
+
resetMadgeManagedPathMemo
|
|
57
|
+
};
|
|
@@ -2,58 +2,59 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
|
|
|
2
2
|
import {
|
|
3
3
|
createAvailabilityChecker,
|
|
4
4
|
resolveAvailableOrInstall
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2SDHYHHO.js";
|
|
6
6
|
import {
|
|
7
7
|
ruffConfigArgs
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-COOUUC5W.js";
|
|
9
|
+
import "./chunk-7ZS7MC24.js";
|
|
10
|
+
import "./chunk-6XSESGWD.js";
|
|
11
|
+
import "./chunk-3SNDVPOR.js";
|
|
12
|
+
import "./chunk-JWOVP5BL.js";
|
|
13
|
+
import "./chunk-7IYC4ENJ.js";
|
|
14
|
+
import "./chunk-KX56K73G.js";
|
|
15
|
+
import "./chunk-2Y6OJRSI.js";
|
|
16
|
+
import "./chunk-WUY4BZEP.js";
|
|
17
|
+
import "./chunk-GTDSYEA2.js";
|
|
18
|
+
import "./chunk-UL5SXQVX.js";
|
|
19
|
+
import "./chunk-CKEQFGLT.js";
|
|
20
|
+
import "./chunk-NLIVE7L6.js";
|
|
21
|
+
import "./chunk-IEBJF3PN.js";
|
|
22
|
+
import "./chunk-UO66IMVP.js";
|
|
21
23
|
import "./chunk-2BEMIWEW.js";
|
|
22
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-IJYGIDF4.js";
|
|
25
|
+
import "./chunk-IL7K66ZQ.js";
|
|
23
26
|
import {
|
|
24
27
|
resolveToolCwd
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-4FHUGDKU.js";
|
|
29
|
+
import "./chunk-K4SZB56V.js";
|
|
30
|
+
import "./chunk-XI34NWDI.js";
|
|
31
|
+
import "./chunk-5LRUKYFA.js";
|
|
32
|
+
import "./chunk-63NMUNYP.js";
|
|
33
|
+
import "./chunk-CG5V25HX.js";
|
|
34
|
+
import "./chunk-PP2A5V2T.js";
|
|
35
|
+
import "./chunk-S55TEC7I.js";
|
|
33
36
|
import {
|
|
34
37
|
safeSpawnAsync
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-
|
|
38
|
+
} from "./chunk-TPYYEDP5.js";
|
|
39
|
+
import "./chunk-AWQWXSW4.js";
|
|
37
40
|
import "./chunk-QYF5S6P6.js";
|
|
38
41
|
import {
|
|
39
42
|
isFileKind
|
|
40
|
-
} from "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-JAU72XNY.js";
|
|
43
|
+
} from "./chunk-GYRZ72R4.js";
|
|
44
|
+
import "./chunk-KJJAVH3X.js";
|
|
45
|
+
import "./chunk-ZSUX7KEM.js";
|
|
46
|
+
import "./chunk-EIKRZ32J.js";
|
|
47
|
+
import "./chunk-FWZRGGGY.js";
|
|
46
48
|
import {
|
|
47
49
|
createSubsystemLogger
|
|
48
|
-
} from "./chunk-
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
51
|
-
import "./chunk-
|
|
50
|
+
} from "./chunk-N3PLNNCW.js";
|
|
51
|
+
import "./chunk-S26LC76R.js";
|
|
52
|
+
import "./chunk-XWFIHYCH.js";
|
|
53
|
+
import "./chunk-TVZRLTG6.js";
|
|
52
54
|
import "./chunk-LJDODBBZ.js";
|
|
53
|
-
import "./chunk-ABBOA7UD.js";
|
|
54
55
|
import {
|
|
55
56
|
pathsEqual
|
|
56
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-EWXXLS26.js";
|
|
57
58
|
import "./chunk-NXL4FFQQ.js";
|
|
58
59
|
|
|
59
60
|
// dist/clients/ruff-client.js
|
|
@@ -123,8 +124,12 @@ var RuffClient = class {
|
|
|
123
124
|
"check",
|
|
124
125
|
"--output-format",
|
|
125
126
|
"json",
|
|
126
|
-
|
|
127
|
-
|
|
127
|
+
// No target-version override here (#4638): one made the pre-check
|
|
128
|
+
// parse at py310 while `check --fix` below (and the lint runner)
|
|
129
|
+
// read the project's own setting, so a 3.12-only line looked
|
|
130
|
+
// fixable to one pass and unparseable to the other. Ruff
|
|
131
|
+
// discovers the level from the project config itself; a value
|
|
132
|
+
// derived here would be a second owner of that decision.
|
|
128
133
|
...configArgs,
|
|
129
134
|
absolutePath
|
|
130
135
|
], { timeout: 1e4, cwd: ruffCwd });
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
2
|
|
|
3
|
+
// dist/clients/freshness.js
|
|
4
|
+
var MTIME_DRIFT_TOLERANCE_MS = 50;
|
|
5
|
+
function freshnessFromMtime(input) {
|
|
6
|
+
const tolerance = input.toleranceMs ?? MTIME_DRIFT_TOLERANCE_MS;
|
|
7
|
+
if (input.mtimeMs === void 0) {
|
|
8
|
+
return { verdict: "indeterminate", reason: "no-mtime-evidence" };
|
|
9
|
+
}
|
|
10
|
+
return input.mtimeMs > input.referenceMs + tolerance ? { verdict: "stale", reason: "modified-after-reference" } : { verdict: "fresh" };
|
|
11
|
+
}
|
|
12
|
+
|
|
3
13
|
// dist/clients/config-diagnostic-codes.js
|
|
4
14
|
var STABILITY_TIER_KEY = "x-stability";
|
|
5
15
|
var CONFIG_SCHEMA_ID = "https://raw.githubusercontent.com/apmantza/pi-lens/master/docs/schema/pi-lens-config-v1.json";
|
|
@@ -73,5 +83,7 @@ export {
|
|
|
73
83
|
CONFIG_SCHEMA_ID,
|
|
74
84
|
CONFIG_SCHEMA_ANCHOR_KEY,
|
|
75
85
|
withConfigDiagnosticCode,
|
|
76
|
-
DEPRECATED_CONFIG_SURFACES
|
|
86
|
+
DEPRECATED_CONFIG_SURFACES,
|
|
87
|
+
MTIME_DRIFT_TOLERANCE_MS,
|
|
88
|
+
freshnessFromMtime
|
|
77
89
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
isExcludedDirName
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TPYYEDP5.js";
|
|
5
5
|
import {
|
|
6
6
|
createDeadline,
|
|
7
7
|
yieldIfOverBudget
|
|
8
8
|
} from "./chunk-QYF5S6P6.js";
|
|
9
9
|
import {
|
|
10
10
|
isGeneratedArtifactDirectoryName
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-KJJAVH3X.js";
|
|
12
12
|
|
|
13
13
|
// dist/clients/source-walker.js
|
|
14
14
|
import * as fs from "node:fs";
|
|
@@ -41,6 +41,30 @@ function shouldRecurseIntoDir(entry, fullPath, policy, onGeneratedDirSkip) {
|
|
|
41
41
|
return false;
|
|
42
42
|
return true;
|
|
43
43
|
}
|
|
44
|
+
var DirectoryListing = class {
|
|
45
|
+
#entries;
|
|
46
|
+
#foldedNames;
|
|
47
|
+
constructor(entries) {
|
|
48
|
+
this.#entries = entries;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* False only when no entry of this directory could be the file at `target`
|
|
52
|
+
* on any filesystem, so a caller may treat it as absent without asking the
|
|
53
|
+
* filesystem. True means "possibly present": the caller still asks, which
|
|
54
|
+
* keeps the exact verdict for a directory-named twin, a broken symlink or a
|
|
55
|
+
* name that matches only case-sensitively. Names are case-folded and
|
|
56
|
+
* NFC-normalized so a case-insensitive filesystem (Windows, default macOS)
|
|
57
|
+
* or a normalization-insensitive one (macOS) never reports a real entry
|
|
58
|
+
* absent. `target` must lie directly in the listed directory.
|
|
59
|
+
*/
|
|
60
|
+
mayContain(target) {
|
|
61
|
+
this.#foldedNames ??= new Set(this.#entries.map((entry) => foldEntryName(entry.name)));
|
|
62
|
+
return this.#foldedNames.has(foldEntryName(path.basename(target)));
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
function foldEntryName(name) {
|
|
66
|
+
return name.normalize("NFC").toLowerCase();
|
|
67
|
+
}
|
|
44
68
|
function* walkTreeStackSteps(rootDir, visit, shouldStop) {
|
|
45
69
|
const stack = [rootDir];
|
|
46
70
|
while (stack.length > 0) {
|
|
@@ -50,10 +74,11 @@ function* walkTreeStackSteps(rootDir, visit, shouldStop) {
|
|
|
50
74
|
if (dir === void 0)
|
|
51
75
|
continue;
|
|
52
76
|
const entries = (yield dir) ?? [];
|
|
77
|
+
const listing = new DirectoryListing(entries);
|
|
53
78
|
const subDirs = [];
|
|
54
79
|
for (const entry of entries) {
|
|
55
80
|
const fullPath = path.join(dir, entry.name);
|
|
56
|
-
const disposition = visit(entry, fullPath);
|
|
81
|
+
const disposition = visit(entry, fullPath, listing);
|
|
57
82
|
if (disposition === "stop")
|
|
58
83
|
return true;
|
|
59
84
|
if (disposition === "recurse")
|
|
@@ -92,9 +117,11 @@ async function walkTreeStackAsync(rootDir, visit, opts) {
|
|
|
92
117
|
}
|
|
93
118
|
function walkTreeRecursiveSync(rootDir, visit) {
|
|
94
119
|
function scan(currentDir) {
|
|
95
|
-
|
|
120
|
+
const entries = readDirEntriesSafe(currentDir);
|
|
121
|
+
const listing = new DirectoryListing(entries);
|
|
122
|
+
for (const entry of entries) {
|
|
96
123
|
const fullPath = path.join(currentDir, entry.name);
|
|
97
|
-
const disposition = visit(entry, fullPath);
|
|
124
|
+
const disposition = visit(entry, fullPath, listing);
|
|
98
125
|
if (disposition === "stop")
|
|
99
126
|
return true;
|
|
100
127
|
if (disposition === "recurse" && scan(fullPath))
|
|
@@ -107,6 +134,7 @@ function walkTreeRecursiveSync(rootDir, visit) {
|
|
|
107
134
|
|
|
108
135
|
export {
|
|
109
136
|
readDirEntriesSafe,
|
|
137
|
+
readDirEntriesSafeAsync,
|
|
110
138
|
shouldRecurseIntoDir,
|
|
111
139
|
walkTreeStackSync,
|
|
112
140
|
walkTreeStackAsync,
|