pi-lens 4.4.2 → 4.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/{chunk-2ZGIZPDG.js → chunk-2VUQMUMT.js} +6 -6
- package/dist/{chunk-ARJ6PLFH.js → chunk-3W7IEVVL.js} +1 -1
- package/dist/{chunk-5JM2524W.js → chunk-3YN6V5TV.js} +16 -15
- package/dist/{chunk-CF24OIYI.js → chunk-5UCAH366.js} +1 -1
- package/dist/{chunk-NW7BOILN.js → chunk-6STA6Z7I.js} +2 -2
- package/dist/{chunk-66SXUJCA.js → chunk-77M37OKR.js} +5 -3
- package/dist/{chunk-EETY4LF7.js → chunk-AB3YYG6N.js} +1 -1
- package/dist/{chunk-66VMUL7Q.js → chunk-ACXEQZOU.js} +3 -3
- package/dist/{chunk-3UUPUE3O.js → chunk-CMMHNUZ2.js} +31 -29
- package/dist/chunk-CSHFH5IN.js +17 -0
- package/dist/{chunk-3WA4HP4I.js → chunk-EC47DWFA.js} +6 -5
- package/dist/{chunk-ESBQHFMJ.js → chunk-EU63SDCG.js} +187 -79
- package/dist/{chunk-34WSVGEM.js → chunk-FCSOVF55.js} +78 -0
- package/dist/{chunk-IBRALRBR.js → chunk-FMSO6RDZ.js} +3 -2
- package/dist/{chunk-ODBNXWT4.js → chunk-H6MF6EVN.js} +81 -42
- package/dist/{chunk-XPZPXCBV.js → chunk-KDERNTCQ.js} +2 -2
- package/dist/chunk-KSX3TXSZ.js +69 -0
- package/dist/{chunk-PV6LR5P5.js → chunk-M6HSLBWY.js} +198 -4362
- package/dist/{chunk-XKIZ2HNN.js → chunk-MXGY6KPT.js} +6 -4
- package/dist/{chunk-GHB6AYCP.js → chunk-RXCOMYPY.js} +2 -2
- package/dist/{chunk-GZYBXISR.js → chunk-SQ4TVJBR.js} +3 -3
- package/dist/{chunk-VITUCP5A.js → chunk-SS36ZX4J.js} +5 -3
- package/dist/{chunk-PFNSLWU5.js → chunk-T6CPIZNT.js} +5 -4
- package/dist/{chunk-JWA5I3SR.js → chunk-VCO24T4L.js} +3 -5
- package/dist/{chunk-Q6ZWTCLY.js → chunk-XAGLWMJ4.js} +2 -3
- package/dist/{chunk-WOKKRCJ5.js → chunk-XIJZVPD5.js} +3 -2
- package/dist/{chunk-7ULNCDCO.js → chunk-YIUAVF7E.js} +5 -5
- package/dist/{chunk-GOYRYZ2R.js → chunk-YSZNHOBY.js} +63 -11
- package/dist/chunk-YYOIQFRS.js +4139 -0
- package/dist/{chunk-QZVW3AAK.js → chunk-ZWFS3OEF.js} +5 -4
- package/dist/index.js +1628 -1482
- package/dist/mcp/analyze-cli.js +1 -1
- package/dist/mcp/cli.js +6 -6
- package/dist/mcp/server.js +62 -61
- package/dist/mcp/worker.js +16 -15
- package/dist/probes/installer.js +1 -1
- package/docs/pi-lens-merge-policy.md +12 -4
- package/docs/pi-lens-reviewer.md +3 -0
- package/docs/pi-lens-subagent.md +5 -0
- package/package.json +1 -1
- package/dist/chunk-CO2G5PHH.js +0 -84
- package/dist/{chunk-IXXDFY73.js → chunk-3EFKIGZN.js} +0 -0
- package/dist/{chunk-OG5UUPN7.js → chunk-OCAGUNBC.js} +3 -3
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
scannerReportParentDir
|
|
4
|
+
} from "./chunk-CSHFH5IN.js";
|
|
2
5
|
import {
|
|
3
6
|
getScratchTreeDirNames
|
|
4
7
|
} from "./chunk-VCHXCQFG.js";
|
|
5
8
|
import {
|
|
6
9
|
SecurityScanClient
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-PNQDPDRC.js";
|
|
10
|
+
} from "./chunk-3EFKIGZN.js";
|
|
9
11
|
import {
|
|
10
12
|
resolveOpengrepConfig
|
|
11
13
|
} from "./chunk-VWCXW2E7.js";
|
|
14
|
+
import "./chunk-PNQDPDRC.js";
|
|
12
15
|
import "./chunk-RWWYJ623.js";
|
|
13
16
|
import "./chunk-VRZP76YM.js";
|
|
14
17
|
import {
|
|
@@ -34,7 +37,6 @@ import "./chunk-NXL4FFQQ.js";
|
|
|
34
37
|
|
|
35
38
|
// dist/clients/opengrep-client.js
|
|
36
39
|
import * as fs from "node:fs";
|
|
37
|
-
import * as os from "node:os";
|
|
38
40
|
import * as path from "node:path";
|
|
39
41
|
import { mkdtempSync } from "node:fs";
|
|
40
42
|
var EMPTY_RESULT = {
|
|
@@ -84,7 +86,7 @@ var OpengrepClient = class _OpengrepClient extends SecurityScanClient {
|
|
|
84
86
|
const scannedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
85
87
|
const bin = this.binaryPath ?? "opengrep";
|
|
86
88
|
const resolved = _OpengrepClient.resolveConfig(cwd);
|
|
87
|
-
const outDir = mkdtempSync(path.join(
|
|
89
|
+
const outDir = mkdtempSync(path.join(scannerReportParentDir(), "pi-lens-opengrep-"));
|
|
88
90
|
const reportPath = path.join(outDir, "opengrep-report.json");
|
|
89
91
|
try {
|
|
90
92
|
const result = await safeSpawnAsync(bin, [
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
tryLazyInstallFormatterTool,
|
|
53
53
|
typstyleFormatter,
|
|
54
54
|
zigFormatter
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-3W7IEVVL.js";
|
|
56
56
|
import "./chunk-OXXKQCSV.js";
|
|
57
57
|
import "./chunk-FC4RP4I2.js";
|
|
58
58
|
import "./chunk-RPLINGVB.js";
|
|
@@ -63,7 +63,7 @@ import "./chunk-SAEFPSB6.js";
|
|
|
63
63
|
import "./chunk-GAEGEPOC.js";
|
|
64
64
|
import "./chunk-Z3CCVDUB.js";
|
|
65
65
|
import "./chunk-2BEMIWEW.js";
|
|
66
|
-
import "./chunk-
|
|
66
|
+
import "./chunk-ACXEQZOU.js";
|
|
67
67
|
import "./chunk-Q7DUK4LX.js";
|
|
68
68
|
import "./chunk-AW7R2GWG.js";
|
|
69
69
|
import "./chunk-RWWYJ623.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
SecurityScanClient
|
|
4
|
-
} from "./chunk-IXXDFY73.js";
|
|
5
2
|
import {
|
|
6
3
|
firstOutputLine,
|
|
7
4
|
spawnFailedWithNoOutput
|
|
8
5
|
} from "./chunk-UZ3TUTRV.js";
|
|
6
|
+
import {
|
|
7
|
+
SecurityScanClient
|
|
8
|
+
} from "./chunk-3EFKIGZN.js";
|
|
9
9
|
import {
|
|
10
10
|
probeToolAsync
|
|
11
11
|
} from "./chunk-RWWYJ623.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
scannerReportParentDir
|
|
4
|
+
} from "./chunk-CSHFH5IN.js";
|
|
2
5
|
import {
|
|
3
6
|
getSecretsLaneAllowlistPaths,
|
|
4
7
|
isUnderSecretsLaneScratchTree,
|
|
@@ -6,7 +9,7 @@ import {
|
|
|
6
9
|
} from "./chunk-VCHXCQFG.js";
|
|
7
10
|
import {
|
|
8
11
|
SecurityScanClient
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3EFKIGZN.js";
|
|
10
13
|
import {
|
|
11
14
|
collectTrackedFiles,
|
|
12
15
|
collectUntrackedIgnoredIds,
|
|
@@ -22,7 +25,6 @@ import {
|
|
|
22
25
|
|
|
23
26
|
// dist/clients/gitleaks-client.js
|
|
24
27
|
import * as fs from "node:fs";
|
|
25
|
-
import * as os from "node:os";
|
|
26
28
|
import * as path from "node:path";
|
|
27
29
|
import { mkdtempSync } from "node:fs";
|
|
28
30
|
var EMPTY_RESULT = {
|
|
@@ -185,7 +187,7 @@ var GitleaksClient = class _GitleaksClient extends SecurityScanClient {
|
|
|
185
187
|
async runScan(cwd) {
|
|
186
188
|
const scannedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
187
189
|
const bin = this.binaryPath ?? "gitleaks";
|
|
188
|
-
const outDir = mkdtempSync(path.join(
|
|
190
|
+
const outDir = mkdtempSync(path.join(scannerReportParentDir(), "pi-lens-gitleaks-"));
|
|
189
191
|
const reportPath = path.join(outDir, "gitleaks-report.json");
|
|
190
192
|
try {
|
|
191
193
|
const configPath = writeScopedGitleaksConfig(outDir, cwd);
|
|
@@ -2,13 +2,14 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
|
|
|
2
2
|
import {
|
|
3
3
|
createAvailabilityChecker,
|
|
4
4
|
resolveAvailableOrInstall
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YSZNHOBY.js";
|
|
6
6
|
import {
|
|
7
7
|
ruffConfigArgs
|
|
8
8
|
} from "./chunk-RPLINGVB.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-34WSVGEM.js";
|
|
9
|
+
import "./chunk-EU63SDCG.js";
|
|
11
10
|
import "./chunk-VWCXW2E7.js";
|
|
11
|
+
import "./chunk-FCSOVF55.js";
|
|
12
|
+
import "./chunk-PNQDPDRC.js";
|
|
12
13
|
import "./chunk-ZXYDQ3TZ.js";
|
|
13
14
|
import "./chunk-724UL2TJ.js";
|
|
14
15
|
import "./chunk-QOZXJ4NA.js";
|
|
@@ -18,7 +19,7 @@ import "./chunk-SAEFPSB6.js";
|
|
|
18
19
|
import "./chunk-GAEGEPOC.js";
|
|
19
20
|
import "./chunk-Z3CCVDUB.js";
|
|
20
21
|
import "./chunk-2BEMIWEW.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-ACXEQZOU.js";
|
|
22
23
|
import {
|
|
23
24
|
resolveToolCwd
|
|
24
25
|
} from "./chunk-Q7DUK4LX.js";
|
|
@@ -3,15 +3,13 @@ import {
|
|
|
3
3
|
stripAnsi
|
|
4
4
|
} from "./chunk-FC4RP4I2.js";
|
|
5
5
|
import {
|
|
6
|
+
augmentPythonEnvironment,
|
|
7
|
+
detectPythonEnvironment,
|
|
6
8
|
emitBounded
|
|
7
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FCSOVF55.js";
|
|
8
10
|
import {
|
|
9
11
|
resolveGitCheckout
|
|
10
12
|
} from "./chunk-PNQDPDRC.js";
|
|
11
|
-
import {
|
|
12
|
-
augmentPythonEnvironment,
|
|
13
|
-
detectPythonEnvironment
|
|
14
|
-
} from "./chunk-34WSVGEM.js";
|
|
15
13
|
import {
|
|
16
14
|
PathKeyedMap
|
|
17
15
|
} from "./chunk-Z3CCVDUB.js";
|
|
@@ -8,11 +8,10 @@ import {
|
|
|
8
8
|
isExcludedTestTarget,
|
|
9
9
|
isRunnerErrorResult,
|
|
10
10
|
stripWrapperArgs
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-VCO24T4L.js";
|
|
12
12
|
import "./chunk-FC4RP4I2.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-FCSOVF55.js";
|
|
14
14
|
import "./chunk-PNQDPDRC.js";
|
|
15
|
-
import "./chunk-34WSVGEM.js";
|
|
16
15
|
import "./chunk-P7266HLM.js";
|
|
17
16
|
import "./chunk-Z3CCVDUB.js";
|
|
18
17
|
import "./chunk-Q7DUK4LX.js";
|
|
@@ -7,9 +7,10 @@ import {
|
|
|
7
7
|
hasGitleaksSignal,
|
|
8
8
|
parseGitleaksReport,
|
|
9
9
|
writeScopedGitleaksConfig
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SS36ZX4J.js";
|
|
11
|
+
import "./chunk-CSHFH5IN.js";
|
|
11
12
|
import "./chunk-VCHXCQFG.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-3EFKIGZN.js";
|
|
13
14
|
import "./chunk-PNQDPDRC.js";
|
|
14
15
|
import "./chunk-RWWYJ623.js";
|
|
15
16
|
import "./chunk-VRZP76YM.js";
|
|
@@ -13,15 +13,15 @@ import {
|
|
|
13
13
|
findManagedNodeToolBinary,
|
|
14
14
|
getManagedToolEnvironment,
|
|
15
15
|
resolveAvailableOrInstall
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-YSZNHOBY.js";
|
|
17
17
|
import "./chunk-RPLINGVB.js";
|
|
18
|
+
import "./chunk-EU63SDCG.js";
|
|
19
|
+
import "./chunk-VWCXW2E7.js";
|
|
20
|
+
import "./chunk-FCSOVF55.js";
|
|
18
21
|
import {
|
|
19
22
|
canonicalDirectory,
|
|
20
23
|
listNestedLinkedWorktreeRoots
|
|
21
24
|
} from "./chunk-PNQDPDRC.js";
|
|
22
|
-
import "./chunk-ESBQHFMJ.js";
|
|
23
|
-
import "./chunk-34WSVGEM.js";
|
|
24
|
-
import "./chunk-VWCXW2E7.js";
|
|
25
25
|
import "./chunk-ZXYDQ3TZ.js";
|
|
26
26
|
import "./chunk-724UL2TJ.js";
|
|
27
27
|
import "./chunk-QOZXJ4NA.js";
|
|
@@ -33,7 +33,7 @@ import "./chunk-Z3CCVDUB.js";
|
|
|
33
33
|
import "./chunk-2BEMIWEW.js";
|
|
34
34
|
import {
|
|
35
35
|
logSessionStart
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-ACXEQZOU.js";
|
|
37
37
|
import "./chunk-Q7DUK4LX.js";
|
|
38
38
|
import {
|
|
39
39
|
findLocalBinUpwards,
|
|
@@ -6,8 +6,12 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
BUILTIN_SERVER_RUNNER_COVERS,
|
|
8
8
|
getServersForFileWithConfig,
|
|
9
|
-
isAuxiliary
|
|
10
|
-
|
|
9
|
+
isAuxiliary,
|
|
10
|
+
resolveAnalysisRootPath
|
|
11
|
+
} from "./chunk-EU63SDCG.js";
|
|
12
|
+
import {
|
|
13
|
+
emitBounded
|
|
14
|
+
} from "./chunk-FCSOVF55.js";
|
|
11
15
|
import {
|
|
12
16
|
PathKeyedMap
|
|
13
17
|
} from "./chunk-Z3CCVDUB.js";
|
|
@@ -20,7 +24,7 @@ import {
|
|
|
20
24
|
isSpawnableCommand,
|
|
21
25
|
logSessionStart,
|
|
22
26
|
resetPathWalkMemo
|
|
23
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-ACXEQZOU.js";
|
|
24
28
|
import {
|
|
25
29
|
resolveToolCwd
|
|
26
30
|
} from "./chunk-Q7DUK4LX.js";
|
|
@@ -50,6 +54,7 @@ import {
|
|
|
50
54
|
createGenerationSource,
|
|
51
55
|
getGlobalPiLensDir,
|
|
52
56
|
isInSpawnTimeoutCooldown,
|
|
57
|
+
resolveWindowsCommandForEnvironment,
|
|
53
58
|
safeSpawnAsync
|
|
54
59
|
} from "./chunk-C34ZXZ7O.js";
|
|
55
60
|
import {
|
|
@@ -60,6 +65,7 @@ import {
|
|
|
60
65
|
incrementDegradationCount
|
|
61
66
|
} from "./chunk-JAU72XNY.js";
|
|
62
67
|
import {
|
|
68
|
+
isUnderDir,
|
|
63
69
|
normalizeEphemeralMapKey,
|
|
64
70
|
normalizeMapKey
|
|
65
71
|
} from "./chunk-N2H3ZPZY.js";
|
|
@@ -67,6 +73,7 @@ import {
|
|
|
67
73
|
// dist/clients/dispatch/runners/utils/runner-helpers.js
|
|
68
74
|
import * as fs from "node:fs";
|
|
69
75
|
import * as path from "node:path";
|
|
76
|
+
import { delimiter, resolve as resolveCommandPath } from "node:path";
|
|
70
77
|
import { fileURLToPath } from "node:url";
|
|
71
78
|
function lspPrimaryCoversFile(ctx, runnerId) {
|
|
72
79
|
if (ctx.pi?.getFlag?.("no-lsp"))
|
|
@@ -189,14 +196,58 @@ async function findManagedReleaseBinary(tool, verificationArgs = ["--version"])
|
|
|
189
196
|
const verdict = await verifyManagedCandidate(candidate, verificationArgs);
|
|
190
197
|
return verdict === "ok" || verdict === "unverified" ? candidate : null;
|
|
191
198
|
}
|
|
192
|
-
function
|
|
199
|
+
function resolveAdoptedRootCommand(command, ctx, cwd) {
|
|
200
|
+
const candidates = managedNodeToolCandidates(command);
|
|
201
|
+
let selected = candidates.find((candidate) => candidate && fs.existsSync(candidate));
|
|
202
|
+
if (!selected) {
|
|
203
|
+
if (process.platform === "win32") {
|
|
204
|
+
selected = resolveWindowsCommandForEnvironment(command, cwd, process.env)?.resolvedPath;
|
|
205
|
+
} else {
|
|
206
|
+
selected = (process.env.PATH ?? "").split(delimiter).map((dir) => resolveCommandPath(cwd, dir, command)).find((candidate) => {
|
|
207
|
+
try {
|
|
208
|
+
fs.accessSync(candidate, fs.constants.X_OK);
|
|
209
|
+
return fs.statSync(candidate).isFile();
|
|
210
|
+
} catch {
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (!selected)
|
|
217
|
+
return null;
|
|
218
|
+
try {
|
|
219
|
+
const binary = fs.realpathSync.native(selected);
|
|
220
|
+
const session = ctx.projectRoot ?? ctx.cwd;
|
|
221
|
+
const adopted = resolveAnalysisRootPath(ctx.filePath, session);
|
|
222
|
+
if (!adopted)
|
|
223
|
+
return null;
|
|
224
|
+
const roots = [adopted, session].map((root) => fs.realpathSync.native(root));
|
|
225
|
+
if (roots.some((root) => binary === root || isUnderDir(binary, root) || isUnderDir(selected, root))) {
|
|
226
|
+
emitBounded("adopted_root_binary_refused", `${ctx.filePath}:${command}:${binary}`, {
|
|
227
|
+
filePath: ctx.filePath,
|
|
228
|
+
durationMs: 0,
|
|
229
|
+
metadata: { command, binary }
|
|
230
|
+
}, {
|
|
231
|
+
ledgerKind: "adopted-root-binary-refused",
|
|
232
|
+
risingEdgePer: "identity"
|
|
233
|
+
});
|
|
234
|
+
return null;
|
|
235
|
+
}
|
|
236
|
+
return binary;
|
|
237
|
+
} catch {
|
|
238
|
+
return null;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
function createVenvFinder(command, windowsExt = "", verificationArgs = ["--version"], allowProjectLocal = true) {
|
|
193
242
|
return async (cwd) => {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
243
|
+
if (allowProjectLocal) {
|
|
244
|
+
const venvBin = localBinPath(findLocalBinAt(command, cwd, {
|
|
245
|
+
windowsExt,
|
|
246
|
+
binDirs: VENV_BIN_DIRS
|
|
247
|
+
}));
|
|
248
|
+
if (venvBin)
|
|
249
|
+
return { path: venvBin, rung: "venv" };
|
|
250
|
+
}
|
|
200
251
|
const managed = await findManagedNodeToolBinary(command, verificationArgs);
|
|
201
252
|
if (managed)
|
|
202
253
|
return { path: managed, rung: "managed-dir" };
|
|
@@ -434,7 +485,7 @@ function createAvailabilityChecker(command, windowsExt = "", versionArgs = ["--v
|
|
|
434
485
|
const inFlightByCwd = new PathKeyedMap(normalizeEphemeralMapKey);
|
|
435
486
|
let checkerGeneration = availabilityGeneration.current();
|
|
436
487
|
let checkerFlightGeneration = 0;
|
|
437
|
-
const findCommand = createVenvFinder(command, windowsExt, versionArgs);
|
|
488
|
+
const findCommand = createVenvFinder(command, windowsExt, versionArgs, options.allowProjectLocal !== false);
|
|
438
489
|
function ensureCurrentGeneration() {
|
|
439
490
|
if (checkerGeneration === availabilityGeneration.current())
|
|
440
491
|
return;
|
|
@@ -982,6 +1033,7 @@ export {
|
|
|
982
1033
|
lspPrimaryCoversFile,
|
|
983
1034
|
coveringLaneAvailable,
|
|
984
1035
|
findManagedNodeToolBinary,
|
|
1036
|
+
resolveAdoptedRootCommand,
|
|
985
1037
|
resolveManagedToolClient,
|
|
986
1038
|
getManagedToolEnvironment,
|
|
987
1039
|
discoverManagedTool,
|