pi-lens 4.4.1 → 4.4.2
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 +63 -0
- package/config/dependency-cruiser-eager-allowlist.json +3 -1
- package/dist/{chunk-BJF25SUG.js → chunk-23WOO7TX.js} +11 -10
- package/dist/{chunk-WATC3IQR.js → chunk-2B73ZPOK.js} +3 -3
- package/dist/{chunk-N2IRDBZI.js → chunk-2BBLFX75.js} +101 -11
- package/dist/{chunk-TA5L5KWQ.js → chunk-2CD5RS6M.js} +2 -2
- package/dist/{chunk-3TTPKMEF.js → chunk-2ZGIZPDG.js} +38 -37
- package/dist/{chunk-LNOMA3MP.js → chunk-34WSVGEM.js} +29 -3
- package/dist/chunk-3JNKMP3B.js +17 -0
- package/dist/{chunk-H2W2AXD3.js → chunk-3UUPUE3O.js} +41 -35
- package/dist/{chunk-6P54TMWL.js → chunk-3VPVG5SU.js} +6 -6
- package/dist/chunk-3WA4HP4I.js +55 -0
- package/dist/chunk-466Z26MG.js +30 -0
- package/dist/{chunk-PCHDGUKT.js → chunk-4UNXBNE2.js} +12 -11
- package/dist/{chunk-J7WJZ6W7.js → chunk-4W4VLAPJ.js} +12 -11
- package/dist/{chunk-F5VLZHUW.js → chunk-52FUZI6K.js} +4 -2
- package/dist/chunk-5JM2524W.js +84 -0
- package/dist/{chunk-H5EV3VMF.js → chunk-5NGR67U5.js} +2 -2
- package/dist/{chunk-YLN4K6WD.js → chunk-66SXUJCA.js} +6 -6
- package/dist/{chunk-LD7WFTRX.js → chunk-66VMUL7Q.js} +16 -16
- package/dist/{chunk-BHWHXMQ2.js → chunk-67WMNWEE.js} +9 -8
- package/dist/{chunk-USHG4DLH.js → chunk-6C7JWPCP.js} +7 -7
- package/dist/{chunk-VPWKF3GN.js → chunk-6GFRNVYR.js} +11 -10
- package/dist/{chunk-3JL6IFD7.js → chunk-6SDEP3AJ.js} +9 -8
- package/dist/{chunk-KJCWXUUS.js → chunk-724UL2TJ.js} +6 -4
- package/dist/{chunk-MQA2YBAH.js → chunk-76MWC2K6.js} +3 -3
- package/dist/{chunk-XHSCVSOL.js → chunk-7DYBLXYA.js} +3 -3
- package/dist/{chunk-AFZYMAIV.js → chunk-7ULNCDCO.js} +37 -35
- package/dist/{chunk-VSMJK3ZJ.js → chunk-AOHZU2BM.js} +1 -1
- package/dist/{chunk-ZETYB3XG.js → chunk-ARJ6PLFH.js} +44 -28
- package/dist/{chunk-T4QZ6FEH.js → chunk-AW7R2GWG.js} +65 -8
- package/dist/{chunk-GAYGGICG.js → chunk-BKE7E7TC.js} +10 -9
- package/dist/{chunk-EUT3B22Y.js → chunk-BRGDSBJE.js} +13 -12
- package/dist/{chunk-T54VJRAD.js → chunk-C34ZXZ7O.js} +55 -11
- package/dist/{chunk-CBD2B5CP.js → chunk-CF24OIYI.js} +21 -20
- package/dist/{chunk-UGSMCQ4D.js → chunk-CHOW74WE.js} +1 -1
- package/dist/{chunk-OZJINN4O.js → chunk-CO2G5PHH.js} +2 -2
- package/dist/{chunk-OC7LYAU5.js → chunk-EETY4LF7.js} +24 -10
- package/dist/{chunk-KJN4IOEJ.js → chunk-EJIUXPBX.js} +1 -1
- package/dist/{chunk-IQZXOZ7S.js → chunk-ESBQHFMJ.js} +549 -271
- package/dist/{chunk-CFYISHUW.js → chunk-FLKWCIZH.js} +8 -5
- package/dist/{chunk-IUKPRZER.js → chunk-GAEGEPOC.js} +2 -2
- package/dist/{chunk-6XX5HCLK.js → chunk-GBPP5P7X.js} +4 -4
- package/dist/{chunk-3FERWMCH.js → chunk-GHB6AYCP.js} +27 -26
- package/dist/{chunk-NFXP47RV.js → chunk-GOYRYZ2R.js} +26 -24
- package/dist/{chunk-TQFBZVCG.js → chunk-GXW6K4YJ.js} +1 -1
- package/dist/{chunk-N7YNJE5R.js → chunk-GZYBXISR.js} +9 -9
- package/dist/{chunk-3JSEWUWI.js → chunk-IBGIOBEE.js} +3 -3
- package/dist/{chunk-OYTMZXRF.js → chunk-IBRALRBR.js} +15 -14
- package/dist/{chunk-5JHXUETW.js → chunk-IXXDFY73.js} +3 -3
- package/dist/chunk-IZSHAIJ7.js +26 -0
- package/dist/{chunk-7ELY2CSM.js → chunk-JAU72XNY.js} +16 -14
- package/dist/chunk-JMYYOTQG.js +77 -0
- package/dist/{chunk-ELVWJYRV.js → chunk-JSQFTSC6.js} +12 -11
- package/dist/{chunk-3P4PF2BX.js → chunk-JWA5I3SR.js} +34 -20
- package/dist/{chunk-J6DFZDFA.js → chunk-KBG47GHP.js} +4 -4
- package/dist/{chunk-XGUL4SLQ.js → chunk-L3BLXZG7.js} +2 -2
- package/dist/chunk-LOP6GRPH.js +31 -0
- package/dist/chunk-MQLUAEOC.js +162 -0
- package/dist/{chunk-3MRXIJ6I.js → chunk-MRXKYPCS.js} +2 -2
- package/dist/{chunk-G3RLJYA2.js → chunk-N2H3ZPZY.js} +47 -1
- package/dist/{chunk-HREZQCT3.js → chunk-N3X6Q4YT.js} +3 -3
- package/dist/{chunk-NJF2X5XF.js → chunk-NW7BOILN.js} +19 -17
- package/dist/{chunk-ZZUFZUQZ.js → chunk-ODBNXWT4.js} +275 -90
- package/dist/{chunk-HSIRMK2D.js → chunk-OG5UUPN7.js} +13 -13
- package/dist/{chunk-ZOEYVXSV.js → chunk-OXXKQCSV.js} +6 -6
- package/dist/{chunk-S6AMWKPC.js → chunk-P7266HLM.js} +2 -2
- package/dist/{chunk-JONGANYH.js → chunk-PFNSLWU5.js} +31 -30
- package/dist/{chunk-64LU2OVH.js → chunk-PHDMFAKM.js} +12 -2
- package/dist/{chunk-IMSQR4WO.js → chunk-PNQDPDRC.js} +1 -1
- package/dist/{chunk-MTDRLSI7.js → chunk-PV6LR5P5.js} +5398 -1156
- package/dist/{chunk-N77WFUL7.js → chunk-Q6ZWTCLY.js} +24 -22
- package/dist/{chunk-IUR76K6A.js → chunk-Q7DUK4LX.js} +5 -5
- package/dist/{chunk-CULQYFLU.js → chunk-QGQ5CCCG.js} +2 -2
- package/dist/{chunk-UEAHAMEI.js → chunk-QHJ6DQ2R.js} +11 -11
- package/dist/{chunk-BNKLYOOO.js → chunk-QILIYSJF.js} +1 -1
- package/dist/{chunk-VYKKMYVT.js → chunk-QOBUHWHX.js} +11 -6
- package/dist/{chunk-3PNFWVHT.js → chunk-QQNQ7SJW.js} +2 -75
- package/dist/{chunk-OEX24ECI.js → chunk-QZVW3AAK.js} +50 -41
- package/dist/{chunk-7M4T5N3V.js → chunk-R3PCY3YS.js} +14 -13
- package/dist/{chunk-MGIWSROG.js → chunk-RPLINGVB.js} +7 -7
- package/dist/{chunk-CMU4RMJB.js → chunk-RWWYJ623.js} +10 -1
- package/dist/{chunk-7BX5DWSA.js → chunk-SAEFPSB6.js} +11 -11
- package/dist/{chunk-6UYA642J.js → chunk-TYM6OUIT.js} +13 -12
- package/dist/{chunk-ALQRYH6O.js → chunk-UXGETRP4.js} +13 -12
- package/dist/{chunk-FGALODG3.js → chunk-UZ3TUTRV.js} +1 -1
- package/dist/{chunk-J3FZR3YY.js → chunk-VCHXCQFG.js} +3 -3
- package/dist/{chunk-DMS52BEP.js → chunk-VITUCP5A.js} +5 -5
- package/dist/{chunk-O7HZX7CA.js → chunk-VRZP76YM.js} +1 -1
- package/dist/{chunk-VZHJS6DR.js → chunk-VSSBEUFT.js} +16 -15
- package/dist/{chunk-U52SAGRM.js → chunk-VWCXW2E7.js} +1 -1
- package/dist/{chunk-WW5BLB74.js → chunk-WOA4LN2R.js} +2 -2
- package/dist/{chunk-IR6XFA5P.js → chunk-WOKKRCJ5.js} +15 -14
- package/dist/{chunk-ZMOMPX2Z.js → chunk-WU567RSC.js} +11 -10
- package/dist/{chunk-WSEWKCXU.js → chunk-XCJN5IJU.js} +4 -4
- package/dist/{chunk-D65GOCJB.js → chunk-XKIZ2HNN.js} +15 -14
- package/dist/{chunk-OYOB3ZFG.js → chunk-XMSXXAHW.js} +2 -2
- package/dist/chunk-XPZPXCBV.js +28 -0
- package/dist/{chunk-34OCDWOS.js → chunk-XTMJ7XDT.js} +1 -1
- package/dist/{chunk-Z6BB4JLQ.js → chunk-XVF2VVXP.js} +5 -3
- package/dist/chunk-Z527N6YQ.js +28 -0
- package/dist/{chunk-D6YF5HKX.js → chunk-ZANLILYD.js} +22 -2
- package/dist/{chunk-2UMYMRI3.js → chunk-ZGDGW2V3.js} +2 -2
- package/dist/{chunk-6B5I6ICN.js → chunk-ZHFZWTZV.js} +12 -11
- package/dist/{chunk-AXKPQ6ZI.js → chunk-ZXYDQ3TZ.js} +5 -5
- package/dist/index.js +72740 -70136
- package/dist/mcp/analyze-cli.js +18 -8
- package/dist/mcp/cli.js +48 -37
- package/dist/mcp/server.js +564 -394
- package/dist/mcp/worker.js +66 -55
- package/dist/probes/installer.js +20 -19
- package/docs/astplayground.md +1 -1
- package/docs/configuration.md +29 -0
- package/docs/dependencies.md +3 -0
- package/docs/features.md +2 -2
- package/docs/globalconfig.md +2 -0
- package/docs/language-coverage.md +2 -1
- package/docs/lsp-capability-matrix.md +29 -7
- package/docs/lsp-idle-eviction.md +38 -47
- package/docs/pi-lens-fixer.md +4 -0
- package/docs/pi-lens-merge-policy.md +5 -0
- package/docs/pi-lens-retro.md +2 -1
- package/docs/pi-lens-reviewer.md +15 -0
- package/docs/pi-lens-subagent.md +2 -0
- package/docs/real-harness.md +17 -0
- package/docs/schema/pi-lens-config-v1.json +37 -2
- package/docs/servercapabilities.md +15 -4
- package/docs/settings.md +2 -1
- package/package.json +1 -1
- package/dist/chunk-2FQ62SPM.js +0 -83
- package/dist/chunk-7AXO3ZDF.js +0 -30
- package/dist/chunk-KMGPUKFD.js +0 -25
- package/dist/chunk-RJFED73B.js +0 -79
- package/dist/chunk-RTQNRM5X.js +0 -27
- package/dist/chunk-V5MEBST3.js +0 -4139
- package/dist/chunk-VGEVL5EQ.js +0 -29
- package/dist/chunk-WPE5FPGR.js +0 -54
- package/dist/chunk-Z7QQA2KT.js +0 -27
|
@@ -2,48 +2,53 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
|
|
|
2
2
|
import {
|
|
3
3
|
stripAnsi
|
|
4
4
|
} from "./chunk-FC4RP4I2.js";
|
|
5
|
-
import {
|
|
6
|
-
resolveGitCheckout
|
|
7
|
-
} from "./chunk-IMSQR4WO.js";
|
|
8
5
|
import {
|
|
9
6
|
emitBounded
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CO2G5PHH.js";
|
|
8
|
+
import {
|
|
9
|
+
resolveGitCheckout
|
|
10
|
+
} from "./chunk-PNQDPDRC.js";
|
|
11
11
|
import {
|
|
12
12
|
augmentPythonEnvironment,
|
|
13
13
|
detectPythonEnvironment
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-34WSVGEM.js";
|
|
15
15
|
import {
|
|
16
16
|
PathKeyedMap
|
|
17
17
|
} from "./chunk-Z3CCVDUB.js";
|
|
18
18
|
import {
|
|
19
19
|
resolveToolCwd
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-Q7DUK4LX.js";
|
|
21
|
+
import {
|
|
22
|
+
findGlobalBinary,
|
|
23
|
+
findLocalBinAt,
|
|
24
|
+
localBinPath
|
|
25
|
+
} from "./chunk-AW7R2GWG.js";
|
|
21
26
|
import {
|
|
22
|
-
|
|
23
|
-
} from "./chunk-
|
|
27
|
+
getIsolatedNpxSpawnOptions
|
|
28
|
+
} from "./chunk-RWWYJ623.js";
|
|
24
29
|
import {
|
|
25
30
|
resolveLanguageRootForFile
|
|
26
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-QOBUHWHX.js";
|
|
27
32
|
import {
|
|
28
33
|
safeSpawn,
|
|
29
34
|
safeSpawnAsync
|
|
30
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-C34ZXZ7O.js";
|
|
31
36
|
import {
|
|
32
37
|
detectFileKind
|
|
33
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-PHDMFAKM.js";
|
|
34
39
|
import {
|
|
35
40
|
detectFileRole
|
|
36
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-2BBLFX75.js";
|
|
37
42
|
import {
|
|
38
43
|
findNearestDirWithAnyBasename
|
|
39
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-XVF2VVXP.js";
|
|
40
45
|
import {
|
|
41
46
|
LEDGER_FIELD_MAX,
|
|
42
47
|
recordDegradationOnce
|
|
43
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-JAU72XNY.js";
|
|
44
49
|
import {
|
|
45
50
|
createSubsystemLogger
|
|
46
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-XTMJ7XDT.js";
|
|
47
52
|
import {
|
|
48
53
|
BoundedFifoMap
|
|
49
54
|
} from "./chunk-ABBOA7UD.js";
|
|
@@ -56,7 +61,7 @@ import {
|
|
|
56
61
|
normalizeMapKey,
|
|
57
62
|
pathsEqual,
|
|
58
63
|
toPosix
|
|
59
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-N2H3ZPZY.js";
|
|
60
65
|
|
|
61
66
|
// dist/clients/test-runner-client.js
|
|
62
67
|
import { createHash } from "node:crypto";
|
|
@@ -1137,6 +1142,9 @@ var TestRunnerClient = class {
|
|
|
1137
1142
|
cwd: spawnCwd,
|
|
1138
1143
|
timeout: 6e4,
|
|
1139
1144
|
env,
|
|
1145
|
+
// ONE neutral-cwd seam for npx/bunx fallbacks (#4193, #4268
|
|
1146
|
+
// acceptance 3); a resolved runner binary keeps the project cwd.
|
|
1147
|
+
...command === "npx" || command === "bunx" ? getIsolatedNpxSpawnOptions() : {},
|
|
1140
1148
|
// #2522 R2 F1. `safeSpawnAsync` resolves `options.signal ?? ambient`,
|
|
1141
1149
|
// so an absent batch signal keeps the pre-#2522 ambient behaviour.
|
|
1142
1150
|
signal
|
|
@@ -2135,8 +2143,11 @@ ${stderr}`;
|
|
|
2135
2143
|
}
|
|
2136
2144
|
if (runner === "phpunit") {
|
|
2137
2145
|
const suffix2 = process.platform === "win32" ? ".bat" : "";
|
|
2138
|
-
const vendorBin =
|
|
2139
|
-
|
|
2146
|
+
const vendorBin = localBinPath(findLocalBinAt("phpunit", cwd, {
|
|
2147
|
+
windowsExt: suffix2,
|
|
2148
|
+
binDirs: [path.join("vendor", "bin")]
|
|
2149
|
+
}));
|
|
2150
|
+
if (vendorBin) {
|
|
2140
2151
|
return {
|
|
2141
2152
|
command: vendorBin,
|
|
2142
2153
|
args: config.args(testFile, spawnCwd),
|
|
@@ -2151,8 +2162,11 @@ ${stderr}`;
|
|
|
2151
2162
|
}
|
|
2152
2163
|
const binName = config.binName ?? runner;
|
|
2153
2164
|
const suffix = process.platform === "win32" ? ".cmd" : "";
|
|
2154
|
-
const localBin =
|
|
2155
|
-
|
|
2165
|
+
const localBin = localBinPath(findLocalBinAt(binName, cwd, {
|
|
2166
|
+
windowsExt: suffix,
|
|
2167
|
+
binDirs: [path.join("node_modules", ".bin")]
|
|
2168
|
+
}));
|
|
2169
|
+
if (localBin) {
|
|
2156
2170
|
return {
|
|
2157
2171
|
command: localBin,
|
|
2158
2172
|
args: stripWrapperArgs(binName, config.args(testFile, spawnCwd)),
|
|
@@ -2,17 +2,17 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
|
|
|
2
2
|
import {
|
|
3
3
|
freshnessFromMtime,
|
|
4
4
|
resolveRunnerPath
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-L3BLXZG7.js";
|
|
6
6
|
import {
|
|
7
7
|
translateGuidanceToolNames
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JAU72XNY.js";
|
|
9
9
|
import {
|
|
10
10
|
logLatency
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QQNQ7SJW.js";
|
|
12
12
|
import {
|
|
13
13
|
normalizeMapKey,
|
|
14
14
|
toProjectRelativePath
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-N2H3ZPZY.js";
|
|
16
16
|
|
|
17
17
|
// dist/clients/advisory-provenance.js
|
|
18
18
|
import { createHash } from "node:crypto";
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
} from "./chunk-2EECBNC5.js";
|
|
6
6
|
import {
|
|
7
7
|
incrementDegradationCount
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JAU72XNY.js";
|
|
9
9
|
import {
|
|
10
10
|
normalizeMapKey
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-N2H3ZPZY.js";
|
|
12
12
|
|
|
13
13
|
// dist/clients/mcp/ipc.js
|
|
14
14
|
import * as crypto from "node:crypto";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
calcCyclomaticComplexity,
|
|
4
|
+
functionFactProvider
|
|
5
|
+
} from "./chunk-76MWC2K6.js";
|
|
6
|
+
import "./chunk-GXW6K4YJ.js";
|
|
7
|
+
import "./chunk-5W3R6LFT.js";
|
|
8
|
+
import "./chunk-QHJ6DQ2R.js";
|
|
9
|
+
import "./chunk-Z54ZSOBZ.js";
|
|
10
|
+
import "./chunk-724UL2TJ.js";
|
|
11
|
+
import "./chunk-QOZXJ4NA.js";
|
|
12
|
+
import "./chunk-VRZP76YM.js";
|
|
13
|
+
import "./chunk-C34ZXZ7O.js";
|
|
14
|
+
import "./chunk-PHDMFAKM.js";
|
|
15
|
+
import "./chunk-2BBLFX75.js";
|
|
16
|
+
import "./chunk-XVF2VVXP.js";
|
|
17
|
+
import "./chunk-ZANLILYD.js";
|
|
18
|
+
import "./chunk-2EECBNC5.js";
|
|
19
|
+
import "./chunk-JAU72XNY.js";
|
|
20
|
+
import "./chunk-XTMJ7XDT.js";
|
|
21
|
+
import "./chunk-JMYYOTQG.js";
|
|
22
|
+
import "./chunk-QQNQ7SJW.js";
|
|
23
|
+
import "./chunk-AOHZU2BM.js";
|
|
24
|
+
import "./chunk-LJDODBBZ.js";
|
|
25
|
+
import "./chunk-ABBOA7UD.js";
|
|
26
|
+
import "./chunk-N2H3ZPZY.js";
|
|
27
|
+
import "./chunk-NXL4FFQQ.js";
|
|
28
|
+
export {
|
|
29
|
+
calcCyclomaticComplexity,
|
|
30
|
+
functionFactProvider
|
|
31
|
+
};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
logLatency
|
|
4
|
+
} from "./chunk-QQNQ7SJW.js";
|
|
5
|
+
import {
|
|
6
|
+
getProcessSingleton
|
|
7
|
+
} from "./chunk-AOHZU2BM.js";
|
|
8
|
+
|
|
9
|
+
// dist/clients/lsp/workspace-sweep-hold.js
|
|
10
|
+
var SWEEP_IDLE_SAFETY_MARGIN_MS = 6e4;
|
|
11
|
+
var WORKSPACE_SWEEP_HOLD_FAMILY = "lsp.workspace-sweep-hold";
|
|
12
|
+
var WORKSPACE_SWEEP_HOLD_VERSION = 1;
|
|
13
|
+
function state() {
|
|
14
|
+
return getProcessSingleton(WORKSPACE_SWEEP_HOLD_FAMILY, WORKSPACE_SWEEP_HOLD_VERSION, () => ({ holds: /* @__PURE__ */ new Map(), nextHoldId: 1, idleWaiters: [] }));
|
|
15
|
+
}
|
|
16
|
+
function flushIdleWaitersIfEmpty() {
|
|
17
|
+
const current = state();
|
|
18
|
+
if (current.holds.size > 0)
|
|
19
|
+
return;
|
|
20
|
+
if (current.idleWaiters.length === 0)
|
|
21
|
+
return;
|
|
22
|
+
const waiters = current.idleWaiters;
|
|
23
|
+
current.idleWaiters = [];
|
|
24
|
+
for (const waiter of waiters) {
|
|
25
|
+
try {
|
|
26
|
+
waiter();
|
|
27
|
+
} catch {
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function getWorkspaceSweepMaxHoldAgeMs() {
|
|
32
|
+
return getFullScanWallClockMs() + SWEEP_IDLE_SAFETY_MARGIN_MS;
|
|
33
|
+
}
|
|
34
|
+
function reapStaleHolds() {
|
|
35
|
+
const current = state();
|
|
36
|
+
if (current.holds.size === 0)
|
|
37
|
+
return;
|
|
38
|
+
const maxAgeMs = getWorkspaceSweepMaxHoldAgeMs();
|
|
39
|
+
const now = Date.now();
|
|
40
|
+
for (const [holdId, acquiredAt] of current.holds) {
|
|
41
|
+
const ageMs = now - acquiredAt;
|
|
42
|
+
if (ageMs <= maxAgeMs)
|
|
43
|
+
continue;
|
|
44
|
+
current.holds.delete(holdId);
|
|
45
|
+
logLatency({
|
|
46
|
+
type: "phase",
|
|
47
|
+
phase: "lsp_workspace_sweep_hold_force_released",
|
|
48
|
+
filePath: "",
|
|
49
|
+
durationMs: ageMs,
|
|
50
|
+
metadata: { holdId, maxHoldAgeMs: maxAgeMs }
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
flushIdleWaitersIfEmpty();
|
|
54
|
+
}
|
|
55
|
+
function acquireWorkspaceSweepHold() {
|
|
56
|
+
const current = state();
|
|
57
|
+
const holdId = current.nextHoldId++;
|
|
58
|
+
current.holds.set(holdId, Date.now());
|
|
59
|
+
return () => {
|
|
60
|
+
if (!state().holds.delete(holdId))
|
|
61
|
+
return;
|
|
62
|
+
flushIdleWaitersIfEmpty();
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function isWorkspaceSweepActive() {
|
|
66
|
+
reapStaleHolds();
|
|
67
|
+
return state().holds.size > 0;
|
|
68
|
+
}
|
|
69
|
+
function runWhenWorkspaceSweepIdle(cb) {
|
|
70
|
+
reapStaleHolds();
|
|
71
|
+
const current = state();
|
|
72
|
+
if (current.holds.size === 0) {
|
|
73
|
+
cb();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
current.idleWaiters.push(cb);
|
|
77
|
+
}
|
|
78
|
+
function clearWorkspaceSweepHoldForSessionStart() {
|
|
79
|
+
const current = state();
|
|
80
|
+
if (current.holds.size === 0)
|
|
81
|
+
return;
|
|
82
|
+
logLatency({
|
|
83
|
+
type: "phase",
|
|
84
|
+
phase: "lsp_workspace_sweep_hold_session_reset",
|
|
85
|
+
filePath: "",
|
|
86
|
+
durationMs: 0,
|
|
87
|
+
metadata: { clearedHolds: current.holds.size }
|
|
88
|
+
});
|
|
89
|
+
current.holds.clear();
|
|
90
|
+
flushIdleWaitersIfEmpty();
|
|
91
|
+
}
|
|
92
|
+
function getFullScanWallClockMs() {
|
|
93
|
+
const raw = Number(process.env.PI_LENS_LENS_DIAGNOSTICS_FULL_TIMEOUT_MS);
|
|
94
|
+
return Number.isFinite(raw) && raw > 0 ? raw : 3e5;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// dist/clients/lsp/service-singleton.js
|
|
98
|
+
var LSP_SERVICE_FAMILY = "lsp.service";
|
|
99
|
+
var LSP_SERVICE_VERSION = 2;
|
|
100
|
+
function state2() {
|
|
101
|
+
return getProcessSingleton(LSP_SERVICE_FAMILY, LSP_SERVICE_VERSION, () => ({
|
|
102
|
+
service: null,
|
|
103
|
+
generationHandoff: void 0,
|
|
104
|
+
lifecycle: void 0
|
|
105
|
+
}), (value) => {
|
|
106
|
+
const previous = value;
|
|
107
|
+
const service = previous.service;
|
|
108
|
+
if (!service || typeof service.shutdown !== "function")
|
|
109
|
+
return;
|
|
110
|
+
void Promise.resolve(service.shutdown({
|
|
111
|
+
fast: true,
|
|
112
|
+
reason: "process_singleton_reset"
|
|
113
|
+
})).catch(() => void 0);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function configureLspServiceLifecycle(lifecycle) {
|
|
117
|
+
state2().lifecycle = lifecycle;
|
|
118
|
+
}
|
|
119
|
+
function getOwnedLspService() {
|
|
120
|
+
const current = state2();
|
|
121
|
+
if (!current.lifecycle) {
|
|
122
|
+
throw new Error("LSP service lifecycle is not configured");
|
|
123
|
+
}
|
|
124
|
+
if (!current.service) {
|
|
125
|
+
current.service = current.lifecycle.create(current.generationHandoff);
|
|
126
|
+
}
|
|
127
|
+
return current.service;
|
|
128
|
+
}
|
|
129
|
+
function peekOwnedLspService() {
|
|
130
|
+
return state2().service ?? void 0;
|
|
131
|
+
}
|
|
132
|
+
function resetOwnedLspService(options = {}) {
|
|
133
|
+
const current = state2();
|
|
134
|
+
if (options.reason === "session_start") {
|
|
135
|
+
clearWorkspaceSweepHoldForSessionStart();
|
|
136
|
+
}
|
|
137
|
+
current.lifecycle?.beforeReset(options);
|
|
138
|
+
const retiringService = current.service;
|
|
139
|
+
current.service = null;
|
|
140
|
+
if (!retiringService || !current.lifecycle)
|
|
141
|
+
return;
|
|
142
|
+
const teardown = current.lifecycle.destroy(retiringService, options);
|
|
143
|
+
const pending = current.generationHandoff ? [current.generationHandoff, teardown] : [teardown];
|
|
144
|
+
const handoff = Promise.allSettled(pending).then(() => void 0);
|
|
145
|
+
current.generationHandoff = handoff;
|
|
146
|
+
void handoff.then(() => {
|
|
147
|
+
if (current.generationHandoff === handoff)
|
|
148
|
+
current.generationHandoff = void 0;
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export {
|
|
153
|
+
SWEEP_IDLE_SAFETY_MARGIN_MS,
|
|
154
|
+
acquireWorkspaceSweepHold,
|
|
155
|
+
isWorkspaceSweepActive,
|
|
156
|
+
runWhenWorkspaceSweepIdle,
|
|
157
|
+
getFullScanWallClockMs,
|
|
158
|
+
configureLspServiceLifecycle,
|
|
159
|
+
getOwnedLspService,
|
|
160
|
+
peekOwnedLspService,
|
|
161
|
+
resetOwnedLspService
|
|
162
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
createToolchainAvailability
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7DYBLXYA.js";
|
|
5
5
|
import {
|
|
6
6
|
createSubsystemLogger
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XTMJ7XDT.js";
|
|
8
8
|
|
|
9
9
|
// dist/clients/rust-client.js
|
|
10
10
|
import * as path from "node:path";
|
|
@@ -2321,6 +2321,50 @@ function matchesWorkspaceMemberPattern(pattern, relativePath, dialect, onCap) {
|
|
|
2321
2321
|
const steps = compileWorkspaceMemberPattern(normalized, dialect);
|
|
2322
2322
|
return steps !== void 0 && matchesWorkspaceMemberSteps(steps, relativePath, onCap);
|
|
2323
2323
|
}
|
|
2324
|
+
var HOST_UNICODE_SPACES = /[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g;
|
|
2325
|
+
function hostNormalizeWindowsShellPath(filePath) {
|
|
2326
|
+
if (!filePath.startsWith("/") || filePath.startsWith("//") || filePath.includes("\\")) {
|
|
2327
|
+
return filePath;
|
|
2328
|
+
}
|
|
2329
|
+
const match2 = filePath.match(/^\/(?:mnt\/|cygdrive\/)?([a-z])(?:\/(.*))?$/i);
|
|
2330
|
+
if (!match2)
|
|
2331
|
+
return filePath;
|
|
2332
|
+
const suffix = match2[2]?.replaceAll("/", "\\");
|
|
2333
|
+
return `${match2[1].toUpperCase()}:\\${suffix ?? ""}`;
|
|
2334
|
+
}
|
|
2335
|
+
function normalizeHostToolPath(input, options = {}) {
|
|
2336
|
+
let normalized = input;
|
|
2337
|
+
if (options.normalizeUnicodeSpaces) {
|
|
2338
|
+
normalized = normalized.replace(HOST_UNICODE_SPACES, " ");
|
|
2339
|
+
}
|
|
2340
|
+
if (options.stripAtPrefix && normalized.startsWith("@")) {
|
|
2341
|
+
normalized = normalized.slice(1);
|
|
2342
|
+
}
|
|
2343
|
+
if (process.platform === "win32") {
|
|
2344
|
+
normalized = hostNormalizeWindowsShellPath(normalized);
|
|
2345
|
+
}
|
|
2346
|
+
if (normalized === "~")
|
|
2347
|
+
return os.homedir();
|
|
2348
|
+
if (normalized.startsWith("~/") || process.platform === "win32" && normalized.startsWith("~\\")) {
|
|
2349
|
+
return path2.join(os.homedir(), normalized.slice(2));
|
|
2350
|
+
}
|
|
2351
|
+
if (normalized.startsWith("file://")) {
|
|
2352
|
+
try {
|
|
2353
|
+
return fileURLToPath(normalized);
|
|
2354
|
+
} catch {
|
|
2355
|
+
return normalized;
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
return normalized;
|
|
2359
|
+
}
|
|
2360
|
+
function resolveHostToolPath(input, baseDir) {
|
|
2361
|
+
const normalized = normalizeHostToolPath(input, {
|
|
2362
|
+
normalizeUnicodeSpaces: true,
|
|
2363
|
+
stripAtPrefix: true
|
|
2364
|
+
});
|
|
2365
|
+
const normalizedBaseDir = normalizeHostToolPath(baseDir);
|
|
2366
|
+
return path2.isAbsolute(normalized) ? path2.resolve(normalized) : path2.resolve(normalizedBaseDir, normalized);
|
|
2367
|
+
}
|
|
2324
2368
|
|
|
2325
2369
|
export {
|
|
2326
2370
|
minimatch,
|
|
@@ -2348,11 +2392,13 @@ export {
|
|
|
2348
2392
|
isAtOrAboveHomeDir,
|
|
2349
2393
|
homeRelativePath,
|
|
2350
2394
|
isUnderDir,
|
|
2395
|
+
isVendorPath,
|
|
2351
2396
|
isExternalOrVendorFile,
|
|
2352
2397
|
nameMatchesMarkerGlob,
|
|
2353
2398
|
direntsHaveMarkerGlobMatch,
|
|
2354
2399
|
CARGO_WORKSPACE_MEMBER_DIALECT,
|
|
2355
2400
|
UV_WORKSPACE_MEMBERS_DIALECT,
|
|
2356
2401
|
UV_WORKSPACE_EXCLUDE_DIALECT,
|
|
2357
|
-
matchesWorkspaceMemberPattern
|
|
2402
|
+
matchesWorkspaceMemberPattern,
|
|
2403
|
+
resolveHostToolPath
|
|
2358
2404
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
createSubsystemLogger
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-XTMJ7XDT.js";
|
|
5
|
+
import "./chunk-AOHZU2BM.js";
|
|
6
|
+
import "./chunk-N2H3ZPZY.js";
|
|
7
7
|
import "./chunk-NXL4FFQQ.js";
|
|
8
8
|
|
|
9
9
|
// dist/clients/metrics-client.js
|
|
@@ -9,28 +9,30 @@ import {
|
|
|
9
9
|
getDeadCodeClients,
|
|
10
10
|
parseVultureOutput,
|
|
11
11
|
stableFindingKey
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OG5UUPN7.js";
|
|
13
13
|
import "./chunk-7U2IDNXN.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-VCHXCQFG.js";
|
|
15
|
+
import "./chunk-2CD5RS6M.js";
|
|
16
|
+
import "./chunk-UZ3TUTRV.js";
|
|
17
|
+
import "./chunk-PNQDPDRC.js";
|
|
18
|
+
import "./chunk-P7266HLM.js";
|
|
19
|
+
import "./chunk-AW7R2GWG.js";
|
|
20
|
+
import "./chunk-RWWYJ623.js";
|
|
21
|
+
import "./chunk-VRZP76YM.js";
|
|
22
|
+
import "./chunk-C34ZXZ7O.js";
|
|
23
23
|
import "./chunk-BW5KFIQC.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-2BBLFX75.js";
|
|
25
|
+
import "./chunk-XVF2VVXP.js";
|
|
26
|
+
import "./chunk-ZANLILYD.js";
|
|
26
27
|
import "./chunk-2EECBNC5.js";
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-JAU72XNY.js";
|
|
29
|
+
import "./chunk-XTMJ7XDT.js";
|
|
30
|
+
import "./chunk-JMYYOTQG.js";
|
|
31
|
+
import "./chunk-QQNQ7SJW.js";
|
|
32
|
+
import "./chunk-AOHZU2BM.js";
|
|
31
33
|
import "./chunk-LJDODBBZ.js";
|
|
32
34
|
import "./chunk-ABBOA7UD.js";
|
|
33
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-N2H3ZPZY.js";
|
|
34
36
|
import "./chunk-NXL4FFQQ.js";
|
|
35
37
|
export {
|
|
36
38
|
DEAD_CODE_DELTA_MAX_SHOWN,
|