pi-lens 4.4.4 → 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 +477 -0
- package/README.md +45 -3
- package/config/biome/core.jsonc +3 -3
- package/config/dependency-cruiser-eager-allowlist.json +1 -0
- package/dist/{chunk-UBOQLVT2.js → chunk-2DDDCJDL.js} +4 -4
- package/dist/{chunk-RKKOYPRA.js → chunk-2DMLM3ZO.js} +13 -15
- package/dist/chunk-2F47TQOA.js +73 -0
- package/dist/{chunk-O4NWQT6I.js → chunk-2PHMIAKO.js} +4 -4
- package/dist/{chunk-DGUKIYSI.js → chunk-2RLWJO5K.js} +8 -10
- package/dist/{chunk-S67KYG37.js → chunk-2X4VLOCC.js} +2 -2
- package/dist/{chunk-TIQ2PKDW.js → chunk-3MYEA7QD.js} +4 -4
- package/dist/{chunk-3DA2JDOL.js → chunk-3WEPUD2V.js} +551 -203
- package/dist/{chunk-AMERCH6V.js → chunk-4AVZ3TG7.js} +15 -16
- package/dist/{chunk-IYNJ6YPZ.js → chunk-4PCQCU47.js} +4 -4
- package/dist/chunk-4WX4CTUE.js +57 -0
- package/dist/{chunk-P63GXC37.js → chunk-5APMQ2IJ.js} +31 -4
- package/dist/{chunk-ZIVJBOO3.js → chunk-5CV5ITZF.js} +2 -2
- package/dist/{chunk-6DLWKFEX.js → chunk-5ZR3APIM.js} +41 -42
- package/dist/{chunk-XTBDCR27.js → chunk-63RIVFQI.js} +4 -4
- package/dist/{chunk-GSLNCYGG.js → chunk-75SY4F24.js} +13 -14
- package/dist/{chunk-U44DJXQP.js → chunk-7RQXA5GG.js} +15 -18
- package/dist/chunk-A3YNG5KP.js +45 -0
- package/dist/{chunk-5OFV52AM.js → chunk-AE37FEGH.js} +1 -1
- package/dist/{chunk-BWD5EPKO.js → chunk-AMXIUN2R.js} +4 -6
- package/dist/{chunk-3KAZU3VR.js → chunk-ARD426WI.js} +2 -2
- package/dist/{chunk-BW5KFIQC.js → chunk-AWQWXSW4.js} +1 -0
- package/dist/{chunk-YH5MVY2U.js → chunk-BHUWL2Y3.js} +7 -7
- package/dist/{chunk-CT4MN5IU.js → chunk-BI5LAQ3Y.js} +353 -359
- package/dist/{chunk-KAPJINKN.js → chunk-BM5GS6ZH.js} +2 -2
- package/dist/{chunk-TLX72JTG.js → chunk-BWYQUPOS.js} +1 -1
- package/dist/chunk-CFRQMBGP.js +49 -0
- package/dist/{chunk-RMLC67LF.js → chunk-CJYKEW2L.js} +2 -30
- package/dist/chunk-CKEQFGLT.js +32 -0
- package/dist/{chunk-IWDLU6K3.js → chunk-DC4CFXM5.js} +4 -6
- package/dist/{chunk-ZVUL7QYY.js → chunk-DMSLNKF7.js} +29 -32
- package/dist/{chunk-KN35K52N.js → chunk-DQXSPYRI.js} +3 -3
- package/dist/{chunk-HYGZEMX6.js → chunk-EVDGNG4F.js} +11 -5
- package/dist/{chunk-SRYEJNES.js → chunk-F5Z6URKM.js} +2 -2
- package/dist/{chunk-UMS2MFPZ.js → chunk-F6X3YJWD.js} +2 -3
- package/dist/{chunk-XYURS6EN.js → chunk-FA5LDARD.js} +15 -17
- package/dist/{chunk-24AKHFGP.js → chunk-FFL3A2VP.js} +6 -6
- package/dist/chunk-FJIVKLPH.js +31 -0
- package/dist/chunk-G2B7F6ZU.js +88 -0
- package/dist/{chunk-US7ECLD7.js → chunk-GAACZY6R.js} +131 -41
- package/dist/{chunk-MZGQNL3Y.js → chunk-GMTFDAOK.js} +12 -13
- package/dist/{chunk-VOOAPROD.js → chunk-GNSIWBAT.js} +3 -3
- package/dist/chunk-GTAI2J6U.js +27 -0
- package/dist/{chunk-RVK72CZX.js → chunk-GZE7WOI4.js} +1362 -459
- package/dist/{chunk-IUE7SSKV.js → chunk-H7HTEQUZ.js} +13 -7
- package/dist/{chunk-EUXZEFTV.js → chunk-HK6JVFZC.js} +3 -3
- package/dist/chunk-IPDG45G5.js +26 -0
- package/dist/{chunk-5HSRT26B.js → chunk-J6JP25XU.js} +16 -15
- package/dist/{chunk-HWCCCQNX.js → chunk-JL6CXUMW.js} +13 -6
- package/dist/{chunk-EBC36LNN.js → chunk-K2YGBXOA.js} +17 -17
- package/dist/{chunk-WMYE35PX.js → chunk-KLQVC3XC.js} +7 -5
- package/dist/{chunk-ATKJFDQN.js → chunk-KSR7RGQY.js} +12 -14
- package/dist/{chunk-POMLXPMY.js → chunk-KXF5R4UN.js} +1 -1
- package/dist/{chunk-LLJNQKQW.js → chunk-LEJOJDXL.js} +20 -13
- package/dist/{chunk-JUKMK5Y4.js → chunk-MA77RSFN.js} +10 -11
- package/dist/{chunk-GAQ7OQG6.js → chunk-MKVZQUEG.js} +85 -96
- package/dist/{chunk-2EECBNC5.js → chunk-MN7MHUXQ.js} +75 -0
- package/dist/{chunk-DEL2U6CM.js → chunk-MT6BVNFW.js} +16 -14
- package/dist/chunk-NDMCVUYK.js +507 -0
- package/dist/{chunk-HRNHZA3N.js → chunk-NIU2IPC5.js} +12 -16
- package/dist/{chunk-AGSS7277.js → chunk-NNKXDXXS.js} +7 -24
- package/dist/{chunk-V35JG4JB.js → chunk-OJLTLYHB.js} +152 -334
- package/dist/{chunk-J6MPGQTS.js → chunk-OLAWH5UQ.js} +81 -15
- package/dist/{chunk-T57LYLZT.js → chunk-OOU2WZZE.js} +1 -1
- package/dist/{chunk-CYRKQRPM.js → chunk-OSTKYB55.js} +2 -4
- package/dist/chunk-P4QNXS6I.js +27 -0
- package/dist/chunk-PKES3ISE.js +297 -0
- package/dist/{chunk-ROYSX2S5.js → chunk-PO45POGF.js} +2 -2
- package/dist/{chunk-T7FEBKXN.js → chunk-PPIBVH4R.js} +7 -9
- package/dist/{chunk-3RKP3FMS.js → chunk-PQJFG24Z.js} +295 -23
- package/dist/{chunk-KUA4OJ5Y.js → chunk-Q3UZHW6N.js} +846 -350
- package/dist/{chunk-N5FLEO7W.js → chunk-Q4EMRFNA.js} +37 -37
- package/dist/{chunk-5IUSNGOC.js → chunk-Q4FCYCRE.js} +28 -21
- package/dist/chunk-Q6D6VMI4.js +22 -0
- package/dist/{chunk-UZ2XCLYS.js → chunk-QGSTQH4D.js} +8 -8
- package/dist/{chunk-DUO2TU77.js → chunk-RZOXUSPC.js} +10 -4
- package/dist/{chunk-JMYYOTQG.js → chunk-S26LC76R.js} +13 -1
- package/dist/{chunk-GMX5OS7B.js → chunk-S67UJDGQ.js} +11 -12
- package/dist/chunk-SCIUNBPF.js +44 -0
- package/dist/{chunk-RKBXZN3A.js → chunk-SJJYRZB4.js} +2 -2
- package/dist/chunk-SXGD4ANG.js +25 -0
- package/dist/{chunk-YCWYO6TQ.js → chunk-T7FTXGS3.js} +48 -45
- package/dist/{chunk-FM4RDMKT.js → chunk-TIQJPRDD.js} +115 -61
- package/dist/{chunk-XHJBS436.js → chunk-TIYGSODX.js} +25 -25
- package/dist/{chunk-S2HEXIWI.js → chunk-U2SDMG7C.js} +10 -6
- package/dist/{chunk-2KXTHF3M.js → chunk-U6OC3QEM.js} +253 -33
- package/dist/{chunk-AWSCPCN2.js → chunk-UCGQT677.js} +19 -19
- package/dist/chunk-UHGF5UT5.js +32 -0
- package/dist/{chunk-JW3YWBVB.js → chunk-UN4TEBWN.js} +17 -19
- package/dist/{chunk-ZHH37KZL.js → chunk-V3APN3DY.js} +17 -17
- package/dist/{chunk-ED36RF6Y.js → chunk-V63BC55Q.js} +1 -1
- package/dist/{chunk-XBJVAEEO.js → chunk-VG5JS5SW.js} +3 -2
- package/dist/{chunk-W66O5E25.js → chunk-VPBIMOAQ.js} +13 -15
- package/dist/chunk-VQH24FIP.js +37 -0
- package/dist/{chunk-YNE3RP52.js → chunk-VSFLRN5Y.js} +8 -1
- package/dist/{chunk-7D6L4MTX.js → chunk-W2V54OCL.js} +3 -3
- package/dist/{chunk-2FN63LPV.js → chunk-W5LGKNET.js} +13 -14
- package/dist/{chunk-IQWN5JCP.js → chunk-W5R5SABV.js} +13 -14
- package/dist/{chunk-R3T7CLQ2.js → chunk-WIZWZR4C.js} +41 -41
- package/dist/{chunk-TOY6QKOH.js → chunk-WQOIR3QY.js} +17 -17
- package/dist/{chunk-Y6GZHWSJ.js → chunk-XAIT2YGS.js} +6 -6
- package/dist/chunk-XCUHKYCQ.js +23 -0
- package/dist/{chunk-GSM5UU7A.js → chunk-XQCSWV2G.js} +44 -35
- package/dist/{chunk-OHKJ7PQF.js → chunk-YBSONGSZ.js} +43 -39
- package/dist/{chunk-GXFV6MYU.js → chunk-YISME6ON.js} +72 -39
- package/dist/chunk-YRD4ISED.js +30 -0
- package/dist/{chunk-SD4I7ZO4.js → chunk-YSBHPOY6.js} +43 -53
- package/dist/{chunk-QBFBRV2B.js → chunk-Z2XAOKHK.js} +4 -2
- package/dist/{chunk-5VSF4UUQ.js → chunk-Z7IGUAXL.js} +34 -39
- package/dist/{chunk-MPNJLASA.js → chunk-ZKXQKGWZ.js} +10 -13
- package/dist/{chunk-J64T55EI.js → chunk-ZQ6NZZTB.js} +75 -9
- package/dist/chunk-ZUUI3ZSA.js +38 -0
- package/dist/{chunk-7HXE67BN.js → chunk-ZYNI26MI.js} +2 -2
- package/dist/index.js +32674 -27567
- package/dist/mcp/analyze-cli.js +11 -12
- package/dist/mcp/cli.js +46 -45
- package/dist/mcp/server.js +1210 -574
- package/dist/mcp/worker.js +65 -65
- package/dist/probes/installer.js +21 -23
- package/docs/adr/0010-trace-validation-session-lifecycle.md +390 -0
- package/docs/adr/README.md +1 -0
- package/docs/agent-tools.md +28 -7
- package/docs/ast-grep_rules_catalog.md +5 -3
- package/docs/configuration.md +12 -1
- package/docs/defect-shapes.md +738 -0
- package/docs/engineering-principles.md +12 -0
- package/docs/environment-variables.md +20 -0
- package/docs/features.md +16 -1
- package/docs/globalconfig.md +37 -8
- 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/lsp-capability-matrix.md +105 -12
- package/docs/lsp-idle-eviction.md +37 -18
- package/docs/pi-lens-fixer.md +24 -2
- package/docs/pi-lens-investigator.md +14 -0
- package/docs/pi-lens-merge-policy.md +32 -17
- package/docs/pi-lens-monitor.md +66 -10
- package/docs/pi-lens-orchestration.md +41 -0
- package/docs/pi-lens-release.md +20 -0
- package/docs/pi-lens-retro.md +5 -4
- package/docs/pi-lens-reviewer.md +54 -7
- package/docs/pi-lens-subagent.md +10 -3
- package/docs/release-qa-baseline.md +19 -7
- package/docs/servercapabilities.md +47 -47
- package/docs/settings.md +9 -5
- package/docs/subagent-compat.md +1 -1
- package/docs/usage.md +1 -0
- package/package.json +8 -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/lib/is-main-module.mjs +27 -0
- package/scripts/lib/scratch-home-env.mjs +21 -0
- package/scripts/rpc-load-check.mjs +4 -6
- package/scripts/warm-loader-cache.mjs +2 -5
- package/dist/chunk-3PTHXJXR.js +0 -28
- package/dist/chunk-3QED2P4V.js +0 -31
- package/dist/chunk-5WRPDP2A.js +0 -47
- package/dist/chunk-ABBOA7UD.js +0 -157
- package/dist/chunk-CUHSHSB6.js +0 -273
- package/dist/chunk-GL5LUMZE.js +0 -51
- package/dist/chunk-HAD7QRQI.js +0 -30
- package/dist/chunk-JORED7EX.js +0 -44
- package/dist/chunk-KYUB6QDC.js +0 -72
- package/dist/chunk-LZSEQW6A.js +0 -57
- package/dist/chunk-M2IFVFWU.js +0 -79
- package/dist/chunk-M2UD3LPU.js +0 -88
- package/dist/chunk-MBKQHGA7.js +0 -39
- package/dist/chunk-R7YOCSNV.js +0 -23
- package/dist/chunk-SKAMFC7A.js +0 -28
- package/dist/chunk-SYE6T2EB.js +0 -28
- package/dist/chunk-TRETHTQO.js +0 -26
- package/dist/chunk-UA7ZXYDR.js +0 -184
- package/dist/chunk-XTFDJI3T.js +0 -24
- package/dist/chunk-Z3CCVDUB.js +0 -76
|
@@ -2,7 +2,7 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
|
|
|
2
2
|
import {
|
|
3
3
|
getLazyInstallAttempt,
|
|
4
4
|
tryLazyInstall
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2DDDCJDL.js";
|
|
6
6
|
import {
|
|
7
7
|
findingsResult,
|
|
8
8
|
finishParsedRun,
|
|
@@ -14,26 +14,23 @@ import {
|
|
|
14
14
|
reachedNoVerdict,
|
|
15
15
|
skipUnlessToolRan,
|
|
16
16
|
spanOverlapsModifiedRanges
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import {
|
|
19
|
-
stripAnsi
|
|
20
|
-
} from "./chunk-6HWVI6MI.js";
|
|
17
|
+
} from "./chunk-SJJYRZB4.js";
|
|
21
18
|
import {
|
|
22
19
|
spawnFailedWithNoOutput
|
|
23
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-2X4VLOCC.js";
|
|
24
21
|
import {
|
|
25
22
|
computeImpactCascade
|
|
26
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-DQXSPYRI.js";
|
|
27
24
|
import {
|
|
28
25
|
goClient
|
|
29
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-PO45POGF.js";
|
|
30
27
|
import {
|
|
31
28
|
isTrivyEnabled,
|
|
32
29
|
resolveSeverityFloor
|
|
33
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-BHUWL2Y3.js";
|
|
34
31
|
import {
|
|
35
32
|
rustClient
|
|
36
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-K2YGBXOA.js";
|
|
37
34
|
import {
|
|
38
35
|
coveringLaneAvailable,
|
|
39
36
|
createAvailabilityChecker,
|
|
@@ -49,7 +46,7 @@ import {
|
|
|
49
46
|
resolveToolCommand,
|
|
50
47
|
resolveToolCommandWithInstallFallback,
|
|
51
48
|
resolveVendorToolCommand
|
|
52
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-V3APN3DY.js";
|
|
53
50
|
import {
|
|
54
51
|
biomeConfigArgs,
|
|
55
52
|
findCompiledClassesDir,
|
|
@@ -68,21 +65,21 @@ import {
|
|
|
68
65
|
hasYamllintConfig,
|
|
69
66
|
markdownlintConfigArgs,
|
|
70
67
|
ruffConfigArgs
|
|
71
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-XAIT2YGS.js";
|
|
72
69
|
import {
|
|
73
70
|
importFactProvider
|
|
74
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-4PCQCU47.js";
|
|
75
72
|
import {
|
|
76
73
|
functionFactProvider
|
|
77
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-HK6JVFZC.js";
|
|
78
75
|
import {
|
|
79
76
|
extractFactsFromTree
|
|
80
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-OOU2WZZE.js";
|
|
81
78
|
import {
|
|
82
79
|
buildOrUpdateGraph,
|
|
83
80
|
clearReviewGraphWorkspaceCache,
|
|
84
81
|
fileContentProvider
|
|
85
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-TIYGSODX.js";
|
|
86
83
|
import {
|
|
87
84
|
MAX_BLOCKING_RULE_COMPLEXITY,
|
|
88
85
|
PRIMARY_UNAVAILABLE_CAUSE,
|
|
@@ -95,8 +92,8 @@ import {
|
|
|
95
92
|
classifyDiagnosticTier,
|
|
96
93
|
clearPendingAuxiliaryCoverage,
|
|
97
94
|
combinePrimaryUnavailableCauses,
|
|
95
|
+
demoteLanguageServerRows,
|
|
98
96
|
enabledAuxiliaryLspServerIds,
|
|
99
|
-
fetchTsserverProjectIdentity,
|
|
100
97
|
getLSPService,
|
|
101
98
|
hasAnyDispositionMarks,
|
|
102
99
|
hasAuxiliaryLspPublishedForRoot,
|
|
@@ -113,40 +110,46 @@ import {
|
|
|
113
110
|
touchCoverageGap,
|
|
114
111
|
tryWarmAttachedCodeActions,
|
|
115
112
|
tryWarmAttachedDiagnostics
|
|
116
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-GZE7WOI4.js";
|
|
117
114
|
import {
|
|
118
115
|
ANY_POSITION,
|
|
119
116
|
retainRecordedFindings
|
|
120
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-DC4CFXM5.js";
|
|
121
118
|
import {
|
|
122
119
|
mapWithConcurrency
|
|
123
120
|
} from "./chunk-XIMYZ3JA.js";
|
|
124
121
|
import {
|
|
125
122
|
LSP_SERVERS,
|
|
123
|
+
canWriteAnalysisRoot,
|
|
126
124
|
disabledPrimaries,
|
|
127
125
|
getAstGrepRuleSources,
|
|
128
126
|
registerRunnerId,
|
|
129
127
|
resolveAnalysisRoot
|
|
130
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-3WEPUD2V.js";
|
|
131
129
|
import {
|
|
132
130
|
augmentPythonEnvironment,
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
describePythonCompileWithheld,
|
|
132
|
+
detectPythonEnvironment,
|
|
133
|
+
detectPythonTargetVersion,
|
|
134
|
+
emitBounded,
|
|
135
|
+
partitionOutrankedPythonCompileVerdicts,
|
|
136
|
+
recordPythonCompileVerdictDrop
|
|
137
|
+
} from "./chunk-NDMCVUYK.js";
|
|
135
138
|
import {
|
|
136
139
|
loadProjectSnapshot,
|
|
137
140
|
readJsonCache,
|
|
138
141
|
readJsonCacheAsync
|
|
139
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-PPIBVH4R.js";
|
|
140
143
|
import {
|
|
141
144
|
RUNTIME_CONFIG,
|
|
142
145
|
exceedsLspSyncLimits,
|
|
143
146
|
getRunnerTimeoutFloorMs,
|
|
144
147
|
loadAstGrepNapi
|
|
145
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-OJLTLYHB.js";
|
|
146
149
|
import {
|
|
147
150
|
buildModuleGraph,
|
|
148
151
|
clearModuleGraphCache
|
|
149
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-63RIVFQI.js";
|
|
150
153
|
import {
|
|
151
154
|
BUNDLED_QUERIES_ROOT,
|
|
152
155
|
classifyTreeSitterWasmError,
|
|
@@ -166,7 +169,10 @@ import {
|
|
|
166
169
|
ruleFilesForLanguage,
|
|
167
170
|
ruleSourceLanguages,
|
|
168
171
|
walk
|
|
169
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-GAACZY6R.js";
|
|
173
|
+
import {
|
|
174
|
+
stripAnsi
|
|
175
|
+
} from "./chunk-6HWVI6MI.js";
|
|
170
176
|
import {
|
|
171
177
|
WORD_INDEX_MAX_BYTES,
|
|
172
178
|
deserializeWordIndex,
|
|
@@ -175,35 +181,32 @@ import {
|
|
|
175
181
|
scheduleWordIndexPersist,
|
|
176
182
|
setWordIndexPublishedListener,
|
|
177
183
|
updateWordIndexDocumentForEdit
|
|
178
|
-
} from "./chunk-
|
|
179
|
-
import {
|
|
180
|
-
PathKeyedMap
|
|
181
|
-
} from "./chunk-Z3CCVDUB.js";
|
|
184
|
+
} from "./chunk-VPBIMOAQ.js";
|
|
182
185
|
import {
|
|
183
186
|
WARM_CODE_ACTION_LOOKUP_LIMIT,
|
|
184
187
|
contentHash
|
|
185
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-BM5GS6ZH.js";
|
|
186
189
|
import {
|
|
187
190
|
resolveRunnerPath,
|
|
188
191
|
toRunnerDisplayPath
|
|
189
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-NNKXDXXS.js";
|
|
190
193
|
import {
|
|
191
194
|
isSpawnableCommand
|
|
192
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-MKVZQUEG.js";
|
|
193
196
|
import {
|
|
194
197
|
logRunnerAdvisoryOnce,
|
|
195
198
|
resolveRunnerCwd,
|
|
196
199
|
resolveRunnerCwdWithReason
|
|
197
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-MT6BVNFW.js";
|
|
198
201
|
import {
|
|
199
202
|
findLocalBinUpwards,
|
|
200
203
|
localBinPath
|
|
201
|
-
} from "./chunk-
|
|
204
|
+
} from "./chunk-Z7IGUAXL.js";
|
|
202
205
|
import {
|
|
203
206
|
createAvailabilityProbeFlight,
|
|
204
207
|
getIsolatedNpxSpawnOptions,
|
|
205
208
|
probeToolAsync
|
|
206
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-ARD426WI.js";
|
|
207
210
|
import {
|
|
208
211
|
classifyProbeFailure,
|
|
209
212
|
createAvailabilityLatch,
|
|
@@ -213,12 +216,12 @@ import {
|
|
|
213
216
|
logAvailabilityDecision,
|
|
214
217
|
startHostStallSampler,
|
|
215
218
|
transientRetryDelayMs
|
|
216
|
-
} from "./chunk-
|
|
219
|
+
} from "./chunk-5APMQ2IJ.js";
|
|
217
220
|
import {
|
|
218
221
|
getLspCapableKinds,
|
|
219
222
|
getPrimaryDispatchGroup,
|
|
220
223
|
resolveLanguageRootForFile
|
|
221
|
-
} from "./chunk-
|
|
224
|
+
} from "./chunk-NIU2IPC5.js";
|
|
222
225
|
import {
|
|
223
226
|
getGlobalPiLensDir,
|
|
224
227
|
getProjectDataDir,
|
|
@@ -228,58 +231,59 @@ import {
|
|
|
228
231
|
noteSpawnTimeout,
|
|
229
232
|
resolvePiLensFlag,
|
|
230
233
|
safeSpawnAsync
|
|
231
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-Q3UZHW6N.js";
|
|
232
235
|
import {
|
|
236
|
+
DOTNET_CSHARP_PROJECT_MARKERS,
|
|
237
|
+
DOTNET_CSHARP_SOLUTION_MARKERS,
|
|
233
238
|
detectFileKind
|
|
234
|
-
} from "./chunk-
|
|
239
|
+
} from "./chunk-RZOXUSPC.js";
|
|
235
240
|
import {
|
|
241
|
+
PathKeyedMap,
|
|
236
242
|
classifyGeneratedOrArtifactDetailed,
|
|
237
243
|
detectFileRole,
|
|
238
244
|
loadPiLensProjectConfig,
|
|
239
245
|
resolvePiLensConfig
|
|
240
|
-
} from "./chunk-
|
|
246
|
+
} from "./chunk-OLAWH5UQ.js";
|
|
241
247
|
import {
|
|
242
248
|
findNearestDirWithAnyBasename,
|
|
243
249
|
findNearestDirWithMarker,
|
|
244
250
|
getPiLensGlobalConfigPath
|
|
245
|
-
} from "./chunk-
|
|
251
|
+
} from "./chunk-J6JP25XU.js";
|
|
246
252
|
import {
|
|
247
253
|
getProjectTrustState,
|
|
248
|
-
projectTrustDenialReason
|
|
249
|
-
} from "./chunk-M2IFVFWU.js";
|
|
250
|
-
import {
|
|
251
254
|
killedForOutputCap,
|
|
255
|
+
projectTrustDenialReason,
|
|
252
256
|
truncatedByOutputCap,
|
|
253
257
|
writeFileAtomic
|
|
254
|
-
} from "./chunk-
|
|
258
|
+
} from "./chunk-MN7MHUXQ.js";
|
|
255
259
|
import {
|
|
256
260
|
incrementDegradationCount,
|
|
257
261
|
recordDegradationOnce
|
|
258
|
-
} from "./chunk-
|
|
262
|
+
} from "./chunk-ZQ6NZZTB.js";
|
|
259
263
|
import {
|
|
260
264
|
createSubsystemLogger,
|
|
261
265
|
logExtension
|
|
262
|
-
} from "./chunk-
|
|
266
|
+
} from "./chunk-KXF5R4UN.js";
|
|
263
267
|
import {
|
|
264
268
|
logLatency,
|
|
265
269
|
phaseFinished,
|
|
266
270
|
phaseStarted
|
|
267
|
-
} from "./chunk-
|
|
271
|
+
} from "./chunk-Z2XAOKHK.js";
|
|
268
272
|
import {
|
|
269
273
|
createNdjsonLogger,
|
|
270
274
|
getGlobalPiLensLogDir,
|
|
271
275
|
getMaxLogSizeMB,
|
|
272
276
|
isTestMode
|
|
273
|
-
} from "./chunk-
|
|
277
|
+
} from "./chunk-VSFLRN5Y.js";
|
|
274
278
|
import {
|
|
275
279
|
FactStore,
|
|
276
280
|
setFactStoreEvictionReporter
|
|
277
|
-
} from "./chunk-
|
|
281
|
+
} from "./chunk-OSTKYB55.js";
|
|
278
282
|
import {
|
|
279
283
|
BoundedFifoMap,
|
|
280
|
-
BoundedLruCache
|
|
281
|
-
|
|
282
|
-
|
|
284
|
+
BoundedLruCache,
|
|
285
|
+
direntsHaveMarkerGlobMatch,
|
|
286
|
+
findLocalToolConfig,
|
|
283
287
|
findNearestContaining,
|
|
284
288
|
isAbsoluteFilePath,
|
|
285
289
|
isUnderDir,
|
|
@@ -287,13 +291,12 @@ import {
|
|
|
287
291
|
normalizeEphemeralMapKey,
|
|
288
292
|
normalizeLoggedPath,
|
|
289
293
|
normalizeMapKey,
|
|
290
|
-
pathsEqual
|
|
291
|
-
|
|
292
|
-
} from "./chunk-3RKP3FMS.js";
|
|
294
|
+
pathsEqual
|
|
295
|
+
} from "./chunk-PQJFG24Z.js";
|
|
293
296
|
|
|
294
297
|
// dist/clients/mcp/analyze.js
|
|
295
|
-
import * as
|
|
296
|
-
import * as
|
|
298
|
+
import * as fs18 from "node:fs";
|
|
299
|
+
import * as path49 from "node:path";
|
|
297
300
|
|
|
298
301
|
// dist/clients/cache-manager.js
|
|
299
302
|
import * as fs from "node:fs";
|
|
@@ -578,6 +581,44 @@ var CacheManager = class {
|
|
|
578
581
|
sessions: { ...envelope.sessions, [sessionId]: secondary }
|
|
579
582
|
}, cwd);
|
|
580
583
|
}
|
|
584
|
+
/**
|
|
585
|
+
* #4751: the primary's half of the turn_start role mirror above. The
|
|
586
|
+
* envelope's owner is the identity `resolveTurnStatePartition` reads the
|
|
587
|
+
* role from, so it must name the live primary. A departing primary keeps
|
|
588
|
+
* its worklist for successor replay, which left its id there: its
|
|
589
|
+
* in-process successor (pi's newSession, fork, clone, a resume of another
|
|
590
|
+
* session) was read as a secondary, wrote a partition no turn end of its
|
|
591
|
+
* own reads, and its turn end found no files. The claim admits two forms
|
|
592
|
+
* and refuses every other: a pi owner of THIS process with another id (an
|
|
593
|
+
* in-process predecessor, whose files the successor's turn end replays),
|
|
594
|
+
* and an envelope with no owner and no files. A predecessor past the
|
|
595
|
+
* #2504 stale bound (`isTurnStateOwnerStale`) is still claimed, or the
|
|
596
|
+
* successor's write would be stranded again, but its files are evicted
|
|
597
|
+
* here, as the turn end would evict them: they are not this turn's work.
|
|
598
|
+
* Files under another process's owner, or under no owner, stay for the
|
|
599
|
+
* liveness rule and the #2504 eviction at turn end.
|
|
600
|
+
*/
|
|
601
|
+
claimPrimaryTurnState(cwd, sessionId) {
|
|
602
|
+
const envelope = this.readTurnStateEnvelope(cwd);
|
|
603
|
+
const owner = envelope.owner;
|
|
604
|
+
const filesKept = Object.keys(envelope.files ?? {}).length;
|
|
605
|
+
const predecessor = owner?.kind === "pi" && owner.pid === process.pid && owner.id !== sessionId;
|
|
606
|
+
const arm = predecessor ? this.isTurnStateOwnerStale(owner) ? "evicted" : "predecessor" : owner === void 0 && filesKept === 0 ? "empty" : void 0;
|
|
607
|
+
if (arm === void 0)
|
|
608
|
+
return void 0;
|
|
609
|
+
const base = arm === "evicted" ? { ...envelope, ...DEFAULT_TURN_STATE, files: {} } : envelope;
|
|
610
|
+
this.writeTurnState({
|
|
611
|
+
...base,
|
|
612
|
+
sessionId,
|
|
613
|
+
owner: {
|
|
614
|
+
kind: "pi",
|
|
615
|
+
id: sessionId,
|
|
616
|
+
pid: process.pid,
|
|
617
|
+
lastSeen: (/* @__PURE__ */ new Date()).toISOString()
|
|
618
|
+
}
|
|
619
|
+
}, cwd);
|
|
620
|
+
return arm === "evicted" ? { from: owner?.id, arm, filesKept: 0, filesDropped: filesKept } : { from: owner?.id, arm, filesKept };
|
|
621
|
+
}
|
|
581
622
|
/** Resolve the persisted primary/secondary turn-state partition. */
|
|
582
623
|
resolveTurnStatePartition(cwd, sessionId) {
|
|
583
624
|
const envelope = this.readTurnStateEnvelope(cwd);
|
|
@@ -997,7 +1038,12 @@ if (bundledCodeRabbitRules) {
|
|
|
997
1038
|
RULE_ID_LANGUAGE_SUFFIXES.add(suffix);
|
|
998
1039
|
}
|
|
999
1040
|
}
|
|
1000
|
-
var LSP_SOURCE_PREFIXES = [
|
|
1041
|
+
var LSP_SOURCE_PREFIXES = [
|
|
1042
|
+
"ast-grep:",
|
|
1043
|
+
"shuck:",
|
|
1044
|
+
"Pyright:",
|
|
1045
|
+
"basedpyright:"
|
|
1046
|
+
];
|
|
1001
1047
|
function normalizeRuleId(ruleId) {
|
|
1002
1048
|
let normalized = ruleId;
|
|
1003
1049
|
for (const prefix of LSP_SOURCE_PREFIXES) {
|
|
@@ -1987,24 +2033,47 @@ function createDispatchContext(filePath, cwd, pi, facts, blockingOnly, modifiedR
|
|
|
1987
2033
|
function deltaBaselineFactKey(filePath) {
|
|
1988
2034
|
return `session.baseline.${filePath}`;
|
|
1989
2035
|
}
|
|
1990
|
-
function filterDelta(after, before,
|
|
1991
|
-
const
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
2036
|
+
function filterDelta(after, before, copyOf) {
|
|
2037
|
+
const namedBy = (side) => {
|
|
2038
|
+
const ids = new Set(side.map((d) => d.id));
|
|
2039
|
+
const lanesByKey = /* @__PURE__ */ new Map();
|
|
2040
|
+
for (const d of side) {
|
|
2041
|
+
const key2 = copyOf.key(d);
|
|
2042
|
+
const lanes = lanesByKey.get(key2) ?? /* @__PURE__ */ new Set();
|
|
2043
|
+
lanes.add(copyOf.lane(d));
|
|
2044
|
+
lanesByKey.set(key2, lanes);
|
|
2045
|
+
}
|
|
2046
|
+
return (d) => {
|
|
2047
|
+
if (ids.has(d.id))
|
|
2048
|
+
return true;
|
|
2049
|
+
const lane = copyOf.lane(d);
|
|
2050
|
+
for (const other of lanesByKey.get(copyOf.key(d)) ?? []) {
|
|
2051
|
+
if (other !== lane)
|
|
2052
|
+
return true;
|
|
2053
|
+
}
|
|
2054
|
+
return false;
|
|
2055
|
+
};
|
|
2056
|
+
};
|
|
2057
|
+
const inBefore = namedBy(before ?? []);
|
|
2058
|
+
const inAfter = namedBy(after);
|
|
2059
|
+
const fixed = (before ?? []).filter((d) => !inAfter(d));
|
|
2060
|
+
const newItems = after.filter((d) => !inBefore(d));
|
|
1995
2061
|
return { new: newItems, fixed };
|
|
1996
2062
|
}
|
|
1997
2063
|
function toolPriority(tool, defectClass) {
|
|
1998
2064
|
return getToolProfile(tool, defectClass).dedupPriority;
|
|
1999
2065
|
}
|
|
2066
|
+
function findingKey(d, defectClass = d.defectClass ?? classifyDiagnostic(d)) {
|
|
2067
|
+
const line = d.line ?? 1;
|
|
2068
|
+
const column = d.column ?? 1;
|
|
2069
|
+
const ruleKey = normalizeRuleId(d.rule || d.id || "unknown");
|
|
2070
|
+
return `${d.filePath}:${line}:${column}:${defectClass}:${ruleKey}`;
|
|
2071
|
+
}
|
|
2000
2072
|
function dedupeOverlappingDiagnostics(diagnostics) {
|
|
2001
2073
|
const byKey = /* @__PURE__ */ new Map();
|
|
2002
2074
|
for (const d of diagnostics) {
|
|
2003
2075
|
const defectClass = d.defectClass ?? classifyDiagnostic(d);
|
|
2004
|
-
const
|
|
2005
|
-
const column = d.column ?? 1;
|
|
2006
|
-
const ruleKey = d.rule || d.id || "unknown";
|
|
2007
|
-
const key2 = `${d.filePath}:${line}:${column}:${defectClass}:${ruleKey}`;
|
|
2076
|
+
const key2 = findingKey(d, defectClass);
|
|
2008
2077
|
const current = byKey.get(key2);
|
|
2009
2078
|
if (!current) {
|
|
2010
2079
|
byKey.set(key2, { ...d, defectClass });
|
|
@@ -2096,7 +2165,7 @@ function buildCoverageNotice(ctx, runnerLatencies, dedupe) {
|
|
|
2096
2165
|
const lspEnabled = !ctx.pi.getFlag("no-lsp");
|
|
2097
2166
|
const primary2 = getPrimaryDispatchGroup(ctx.kind, lspEnabled);
|
|
2098
2167
|
if (!primary2 || primary2.runnerIds.length === 0)
|
|
2099
|
-
return {};
|
|
2168
|
+
return { coverage: "unconfigured" };
|
|
2100
2169
|
const relevant = runnerLatencies.filter((r) => primary2.runnerIds.includes(r.runnerId));
|
|
2101
2170
|
if (relevant.length === 0)
|
|
2102
2171
|
return {};
|
|
@@ -2138,11 +2207,17 @@ function buildCoverageNotice(ctx, runnerLatencies, dedupe) {
|
|
|
2138
2207
|
};
|
|
2139
2208
|
}
|
|
2140
2209
|
const primaryHasCoverage = relevant.some(hasUsableResult);
|
|
2141
|
-
if (primaryHasCoverage)
|
|
2142
|
-
return {
|
|
2210
|
+
if (primaryHasCoverage) {
|
|
2211
|
+
return {
|
|
2212
|
+
coverage: "primary",
|
|
2213
|
+
...relevant.some((r) => r.runnerId === "lsp" && hasUsableResult(r)) && {
|
|
2214
|
+
primaryLspChecked: true
|
|
2215
|
+
}
|
|
2216
|
+
};
|
|
2217
|
+
}
|
|
2143
2218
|
const primaryStillInFlight = relevant.some((r) => r.status === "pending" || r.status === "deferred");
|
|
2144
2219
|
if (primaryStillInFlight)
|
|
2145
|
-
return {};
|
|
2220
|
+
return { coverage: "in_flight" };
|
|
2146
2221
|
const plan = getToolPlan(ctx.kind);
|
|
2147
2222
|
const fallbackRunnerIds = new Set((plan?.groups ?? []).filter((group) => !group.runnerIds.every((runnerId) => primary2.runnerIds.includes(runnerId))).flatMap((group) => group.runnerIds).filter((runnerId) => !primary2.runnerIds.includes(runnerId)));
|
|
2148
2223
|
const STRUCTURAL_RUNNERS = /* @__PURE__ */ new Set([
|
|
@@ -2155,7 +2230,7 @@ function buildCoverageNotice(ctx, runnerLatencies, dedupe) {
|
|
|
2155
2230
|
const TYPE_CAPABLE_FALLBACK_RUNNERS = /* @__PURE__ */ new Set(["mypy"]);
|
|
2156
2231
|
const anyFallbackHasCoverage = runnerLatencies.some((r) => fallbackRunnerIds.has(r.runnerId) && !STRUCTURAL_RUNNERS.has(r.runnerId) && hasUsableResult(r) && (!plan?.capabilities.includes("types") || TYPE_CAPABLE_FALLBACK_RUNNERS.has(r.runnerId)));
|
|
2157
2232
|
if (anyFallbackHasCoverage)
|
|
2158
|
-
return {};
|
|
2233
|
+
return { coverage: "fallback" };
|
|
2159
2234
|
const cause = combinePrimaryUnavailableCauses(relevant.flatMap((r) => r.primaryUnavailableCause ?? []));
|
|
2160
2235
|
const unconfirmedStatus = cause ? `no language server answered (${PRIMARY_UNAVAILABLE_CAUSE[cause]})` : "not fully checked (a language tool is missing, timed out, or failed to run)";
|
|
2161
2236
|
if (cause === "disabled" || cause === "disabledFallback") {
|
|
@@ -2484,6 +2559,9 @@ async function runGroup(ctx, group, registry, onRunnerResult) {
|
|
|
2484
2559
|
},
|
|
2485
2560
|
...result.disabledPrimaryServerIds !== void 0 && {
|
|
2486
2561
|
disabledPrimaryServerIds: result.disabledPrimaryServerIds
|
|
2562
|
+
},
|
|
2563
|
+
...result.withheldNotice !== void 0 && {
|
|
2564
|
+
withheldNotice: result.withheldNotice
|
|
2487
2565
|
}
|
|
2488
2566
|
});
|
|
2489
2567
|
logLatency({
|
|
@@ -2694,7 +2772,7 @@ async function dispatchForFile(ctx, groups, registry, onRunnerResult, options) {
|
|
|
2694
2772
|
const stillObserved = outOfEditScope.length > 0 ? applyOutputFilters(outOfEditScope).flatMap((d) => d.semantic === "blocking" ? [d] : []) : [];
|
|
2695
2773
|
let heldBackBlockers = [];
|
|
2696
2774
|
if (ctx.deltaMode && previousBaseline) {
|
|
2697
|
-
const filtered = filterDelta(visibleDiagnostics, applyOutputFilters(previousBaseline), (d) => d.
|
|
2775
|
+
const filtered = filterDelta(visibleDiagnostics, applyOutputFilters(previousBaseline), { key: (d) => findingKey(d), lane: (d) => d.tool });
|
|
2698
2776
|
const isNew = new Set(filtered.new);
|
|
2699
2777
|
heldBackBlockers = visibleDiagnostics.filter((d) => d.semantic === "blocking" && !isNew.has(d));
|
|
2700
2778
|
stillObserved.push(...promoteDeltaUnusedToBlockers(visibleDiagnostics.flatMap((d) => !isNew.has(d) && d.semantic !== "blocking" && isUnusedValueDiagnostic(d) ? [d] : [])));
|
|
@@ -2729,27 +2807,42 @@ async function dispatchForFile(ctx, groups, registry, onRunnerResult, options) {
|
|
|
2729
2807
|
provider: ctx.telemetryProvider
|
|
2730
2808
|
};
|
|
2731
2809
|
if (fixedItems.length > 0) {
|
|
2732
|
-
import("./chunk-
|
|
2810
|
+
import("./chunk-MA77RSFN.js").then(({ appendToWorklog }) => {
|
|
2733
2811
|
appendToWorklog(ctx.cwd, fixedItems, true, worklogIdentity);
|
|
2734
2812
|
}).catch(() => {
|
|
2735
2813
|
});
|
|
2736
2814
|
}
|
|
2737
2815
|
const fixableWarnings = warnings.filter((d) => d.fixable);
|
|
2738
2816
|
if (fixableWarnings.length > 0) {
|
|
2739
|
-
import("./chunk-
|
|
2817
|
+
import("./chunk-MA77RSFN.js").then(({ appendToWorklog }) => {
|
|
2740
2818
|
appendToWorklog(ctx.cwd, fixableWarnings, false, worklogIdentity);
|
|
2741
2819
|
}).catch(() => {
|
|
2742
2820
|
});
|
|
2743
2821
|
}
|
|
2744
2822
|
const inlineBlockers = blockers;
|
|
2745
2823
|
const inlineFixed = fixedItems;
|
|
2746
|
-
const { notice: coverageNotice, unconfirmedStatus } = buildCoverageNotice(ctx, runnerLatencies, options?.dedupeCoverageNotice ?? true);
|
|
2824
|
+
const { notice: coverageNotice, unconfirmedStatus, coverage, primaryLspChecked } = buildCoverageNotice(ctx, runnerLatencies, options?.dedupeCoverageNotice ?? true);
|
|
2747
2825
|
const blockerOutput = formatDiagnostics(inlineBlockers, "blocking");
|
|
2748
2826
|
let output = blockerOutput;
|
|
2749
2827
|
output += formatDiagnostics(inlineFixed, "fixed");
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2828
|
+
const withheldMessages = [
|
|
2829
|
+
...new Set(runnerLatencies.flatMap((r) => r.withheldNotice ?? []))
|
|
2830
|
+
];
|
|
2831
|
+
const withheldNotice = withheldMessages.length > 0 ? {
|
|
2832
|
+
id: `withheld-compile:${ctx.kind}:${path4.basename(ctx.filePath)}`,
|
|
2833
|
+
message: withheldMessages.join("\n"),
|
|
2834
|
+
filePath: ctx.filePath,
|
|
2835
|
+
severity: "warning",
|
|
2836
|
+
semantic: "warning",
|
|
2837
|
+
tool: "pi-lens"
|
|
2838
|
+
} : void 0;
|
|
2839
|
+
const inlineNotices = [
|
|
2840
|
+
...coverageNotice ? [coverageNotice] : [],
|
|
2841
|
+
...withheldNotice ? [withheldNotice] : []
|
|
2842
|
+
];
|
|
2843
|
+
if (inlineNotices.length > 0) {
|
|
2844
|
+
output += formatDiagnostics(inlineNotices, "warning", inlineNotices.length);
|
|
2845
|
+
warnings.push(...inlineNotices);
|
|
2753
2846
|
}
|
|
2754
2847
|
const pendingRunners = runnerLatencies.filter((runner) => runner.status === "pending").map((runner) => runner.runnerId);
|
|
2755
2848
|
if (pendingRunners.length > 0) {
|
|
@@ -2838,7 +2931,9 @@ async function dispatchForFile(ctx, groups, registry, onRunnerResult, options) {
|
|
|
2838
2931
|
collectLaterRunnerIds: [...collectLaterRunnerIds]
|
|
2839
2932
|
}
|
|
2840
2933
|
},
|
|
2841
|
-
...unconfirmedStatus !== void 0 && { unconfirmedStatus }
|
|
2934
|
+
...unconfirmedStatus !== void 0 && { unconfirmedStatus },
|
|
2935
|
+
...coverage !== void 0 && { coverage },
|
|
2936
|
+
...primaryLspChecked && { primaryLspChecked }
|
|
2842
2937
|
};
|
|
2843
2938
|
}
|
|
2844
2939
|
var RUNNER_TIMEOUT_MS = RUNTIME_CONFIG.dispatch.runnerTimeoutMs;
|
|
@@ -2868,10 +2963,15 @@ function normalizeDiagnosticFilePath(ctx, rawPath) {
|
|
|
2868
2963
|
return resolveRunnerPath(ctx.cwd, rawPath || ctx.filePath);
|
|
2869
2964
|
}
|
|
2870
2965
|
function failureRowMetadata(result) {
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2966
|
+
const inconclusive = result.inconclusive === true ? { inconclusive: true } : {};
|
|
2967
|
+
if (result.status === "failed" && result.failureKind) {
|
|
2968
|
+
return {
|
|
2969
|
+
failureKind: result.failureKind,
|
|
2970
|
+
failureMessage: result.failureMessage,
|
|
2971
|
+
...inconclusive
|
|
2972
|
+
};
|
|
2973
|
+
}
|
|
2974
|
+
return result.inconclusive === true ? inconclusive : void 0;
|
|
2875
2975
|
}
|
|
2876
2976
|
async function runRunner(ctx, runner, defaultSemantic) {
|
|
2877
2977
|
const timeoutMs = Math.max(runner.timeoutMs ?? RUNNER_TIMEOUT_MS, getRunnerTimeoutFloorMs());
|
|
@@ -5854,7 +5954,7 @@ function findDetektConfig(cwd) {
|
|
|
5854
5954
|
}
|
|
5855
5955
|
function parseDetektOutput(raw, filePath, cwd) {
|
|
5856
5956
|
const diagnostics = [];
|
|
5857
|
-
const pattern = /^(.+?):(\d+):(\d+): (error|warning): (.+?)(?:\s+\[([^\]]+)\])?$/gm;
|
|
5957
|
+
const pattern = /^(.+?):(\d+):(\d+): (?:(error|warning): )?(.+?)(?:\s+\[([^\]]+)\])?$/gm;
|
|
5858
5958
|
const absTarget = path13.resolve(cwd, filePath);
|
|
5859
5959
|
for (const match of raw.matchAll(pattern)) {
|
|
5860
5960
|
const [, file, lineStr, colStr, level, message, rule] = match;
|
|
@@ -5907,9 +6007,14 @@ var detektRunner = {
|
|
|
5907
6007
|
const run = parseToolRun("detekt", {
|
|
5908
6008
|
result,
|
|
5909
6009
|
output: raw,
|
|
5910
|
-
// EXIT TABLE (detekt 1.23
|
|
6010
|
+
// EXIT TABLE (detekt 1.23.8 captured fixtures): 0 clean; 2 findings on stdout with empty stderr.
|
|
6011
|
+
// Exit 1 is a tool error with NO findings (captured broken-config run: an invalid detekt.yml
|
|
6012
|
+
// prints InvalidConfigurationError on stderr), and also can follow printed findings (captured
|
|
6013
|
+
// findings-then-exit1 run: a non-numeric build.weights value fails after the report). Exit 1 is
|
|
6014
|
+
// therefore admitted, and skipWhenParsedNothing skips it only when the parser read no finding,
|
|
6015
|
+
// so a printed finding is kept. Any other nonzero exit is rejected.
|
|
5911
6016
|
exitCodes: { ran: [1, 2] }
|
|
5912
|
-
}, (out) => parseDetektOutput(out, ctx.filePath, cwd));
|
|
6017
|
+
}, (out) => parseDetektOutput(out, ctx.filePath, cwd), { skipWhenParsedNothing: true });
|
|
5913
6018
|
if (run.skipped)
|
|
5914
6019
|
return run.skipped;
|
|
5915
6020
|
const diagnostics = run.diagnostics;
|
|
@@ -5917,10 +6022,11 @@ var detektRunner = {
|
|
|
5917
6022
|
return { status: "succeeded", diagnostics: [], semantic: "none" };
|
|
5918
6023
|
}
|
|
5919
6024
|
const hasErrors = diagnostics.some((d) => d.severity === "error");
|
|
5920
|
-
|
|
6025
|
+
const verdict = findingsResult(diagnostics, {
|
|
5921
6026
|
status: hasErrors ? "failed" : "succeeded",
|
|
5922
6027
|
semantic: hasErrors ? "blocking" : "warning"
|
|
5923
6028
|
});
|
|
6029
|
+
return result.status === 1 ? { ...verdict, inconclusive: true } : verdict;
|
|
5924
6030
|
}
|
|
5925
6031
|
};
|
|
5926
6032
|
var detekt_default = detektRunner;
|
|
@@ -5930,11 +6036,16 @@ import * as fs10 from "node:fs";
|
|
|
5930
6036
|
import * as path14 from "node:path";
|
|
5931
6037
|
var dotnet = createAvailabilityChecker("dotnet", ".exe");
|
|
5932
6038
|
function findProjectTarget(cwd) {
|
|
5933
|
-
const entries = fs10.readdirSync(cwd);
|
|
5934
|
-
const
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
6039
|
+
const entries = fs10.readdirSync(cwd, { withFileTypes: true });
|
|
6040
|
+
for (const patterns of [
|
|
6041
|
+
DOTNET_CSHARP_SOLUTION_MARKERS,
|
|
6042
|
+
DOTNET_CSHARP_PROJECT_MARKERS
|
|
6043
|
+
]) {
|
|
6044
|
+
const hit = entries.find((entry) => patterns.some((pattern) => direntsHaveMarkerGlobMatch([entry], pattern)));
|
|
6045
|
+
if (hit)
|
|
6046
|
+
return hit.name;
|
|
6047
|
+
}
|
|
6048
|
+
return void 0;
|
|
5938
6049
|
}
|
|
5939
6050
|
function isDotnetRuleId(value) {
|
|
5940
6051
|
if (value.length < 2)
|
|
@@ -7772,126 +7883,6 @@ ${result.stderr ?? ""}`,
|
|
|
7772
7883
|
};
|
|
7773
7884
|
var ktlint_default = ktlintRunner;
|
|
7774
7885
|
|
|
7775
|
-
// dist/clients/lsp/inferred-project.js
|
|
7776
|
-
import * as path26 from "node:path";
|
|
7777
|
-
var INFERRED_PROJECT_MARKER = "not in any tsconfig project \u2014 checked with inferred settings";
|
|
7778
|
-
var TS_PROJECT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
7779
|
-
".ts",
|
|
7780
|
-
".tsx",
|
|
7781
|
-
".mts",
|
|
7782
|
-
".cts",
|
|
7783
|
-
".js",
|
|
7784
|
-
".jsx",
|
|
7785
|
-
".mjs",
|
|
7786
|
-
".cjs"
|
|
7787
|
-
]);
|
|
7788
|
-
var TYPESCRIPT_DIAGNOSTIC_SOURCES = /* @__PURE__ */ new Set(["typescript", "ts", "tsserver"]);
|
|
7789
|
-
function isTsProjectFile(filePath) {
|
|
7790
|
-
return TS_PROJECT_EXTENSIONS.has(path26.extname(filePath).toLowerCase());
|
|
7791
|
-
}
|
|
7792
|
-
function isTypeScriptSourcedDiagnostic(d) {
|
|
7793
|
-
return TYPESCRIPT_DIAGNOSTIC_SOURCES.has((d.source ?? "").toLowerCase());
|
|
7794
|
-
}
|
|
7795
|
-
function suggestTsconfigInclude(filePath, cwd) {
|
|
7796
|
-
const relative5 = toProjectRelativePath(filePath, cwd);
|
|
7797
|
-
if (path26.posix.isAbsolute(relative5) || /^[A-Za-z]:/.test(relative5)) {
|
|
7798
|
-
const dir = relative5.slice(0, relative5.lastIndexOf("/"));
|
|
7799
|
-
return dir ? `${dir}/**` : relative5;
|
|
7800
|
-
}
|
|
7801
|
-
const segments = relative5.split("/").filter(Boolean);
|
|
7802
|
-
return segments.length > 1 ? `${segments[0]}/**` : relative5;
|
|
7803
|
-
}
|
|
7804
|
-
function inferredProjectNotice(filePath, cwd) {
|
|
7805
|
-
return `[${INFERRED_PROJECT_MARKER}; add ${suggestTsconfigInclude(filePath, cwd)} to a tsconfig for authoritative checking]`;
|
|
7806
|
-
}
|
|
7807
|
-
function applyInferredProjectDemotion(diagnostics, filePath, cwd) {
|
|
7808
|
-
if (!diagnostics.some(isDemotableDiagnostic))
|
|
7809
|
-
return diagnostics;
|
|
7810
|
-
const notice = inferredProjectNotice(filePath, cwd);
|
|
7811
|
-
return diagnostics.map((d) => isDemotableDiagnostic(d) ? { ...d, severity: 2, message: `${d.message} ${notice}` } : d);
|
|
7812
|
-
}
|
|
7813
|
-
function isDemotableDiagnostic(d) {
|
|
7814
|
-
return d.severity === 1 && isTypeScriptSourcedDiagnostic(d);
|
|
7815
|
-
}
|
|
7816
|
-
async function demoteInferredProjectDiagnostics(diagnostics, options) {
|
|
7817
|
-
const { filePath, cwd, service } = options;
|
|
7818
|
-
if (!isTsProjectFile(filePath))
|
|
7819
|
-
return diagnostics;
|
|
7820
|
-
if (!diagnostics.some(isDemotableDiagnostic))
|
|
7821
|
-
return diagnostics;
|
|
7822
|
-
if (options.signal?.aborted)
|
|
7823
|
-
return diagnostics;
|
|
7824
|
-
const fetchIdentity = options.fetchIdentity ?? fetchTsserverProjectIdentity;
|
|
7825
|
-
const cache = options.identityCache;
|
|
7826
|
-
let identity;
|
|
7827
|
-
if (cache?.has(filePath)) {
|
|
7828
|
-
identity = cache.get(filePath);
|
|
7829
|
-
} else {
|
|
7830
|
-
identity = await fetchIdentity(service, filePath);
|
|
7831
|
-
cache?.set(filePath, identity);
|
|
7832
|
-
}
|
|
7833
|
-
if (identity?.projectKind !== "inferred")
|
|
7834
|
-
return diagnostics;
|
|
7835
|
-
return applyInferredProjectDemotion(diagnostics, filePath, cwd);
|
|
7836
|
-
}
|
|
7837
|
-
var INFERRED_PROJECT_PROBE_BUDGET = 300;
|
|
7838
|
-
async function demoteInferredProjectSweepResults(results, cwd, service, signal) {
|
|
7839
|
-
if (typeof service?.executeReadOnlyCommandOnLiveClient !== "function") {
|
|
7840
|
-
return results;
|
|
7841
|
-
}
|
|
7842
|
-
const startedAt = Date.now();
|
|
7843
|
-
const identityCache = /* @__PURE__ */ new Map();
|
|
7844
|
-
const out = [];
|
|
7845
|
-
let demotedFiles = 0;
|
|
7846
|
-
let demotedDiagnostics = 0;
|
|
7847
|
-
let budgetExhausted = false;
|
|
7848
|
-
let aborted = false;
|
|
7849
|
-
for (const result of results) {
|
|
7850
|
-
const diagnostics = result.diagnostics ?? [];
|
|
7851
|
-
if (signal?.aborted) {
|
|
7852
|
-
aborted = true;
|
|
7853
|
-
out.push(result);
|
|
7854
|
-
continue;
|
|
7855
|
-
}
|
|
7856
|
-
if (identityCache.size >= INFERRED_PROJECT_PROBE_BUDGET && !identityCache.has(result.filePath)) {
|
|
7857
|
-
budgetExhausted = true;
|
|
7858
|
-
out.push(result);
|
|
7859
|
-
continue;
|
|
7860
|
-
}
|
|
7861
|
-
const demoted = await demoteInferredProjectDiagnostics(diagnostics, {
|
|
7862
|
-
filePath: result.filePath,
|
|
7863
|
-
cwd,
|
|
7864
|
-
service,
|
|
7865
|
-
identityCache,
|
|
7866
|
-
signal
|
|
7867
|
-
});
|
|
7868
|
-
if (demoted === diagnostics) {
|
|
7869
|
-
out.push(result);
|
|
7870
|
-
continue;
|
|
7871
|
-
}
|
|
7872
|
-
demotedFiles += 1;
|
|
7873
|
-
demotedDiagnostics += demoted.filter((d, i) => d !== diagnostics[i]).length;
|
|
7874
|
-
out.push({ ...result, diagnostics: demoted });
|
|
7875
|
-
}
|
|
7876
|
-
if (demotedFiles > 0 || budgetExhausted || aborted) {
|
|
7877
|
-
logLatency({
|
|
7878
|
-
type: "phase",
|
|
7879
|
-
phase: "lsp_inferred_project_demote",
|
|
7880
|
-
filePath: cwd,
|
|
7881
|
-
durationMs: Date.now() - startedAt,
|
|
7882
|
-
metadata: {
|
|
7883
|
-
filesConsidered: results.length,
|
|
7884
|
-
filesProbed: identityCache.size,
|
|
7885
|
-
demotedFiles,
|
|
7886
|
-
demotedDiagnostics,
|
|
7887
|
-
budgetExhausted,
|
|
7888
|
-
aborted
|
|
7889
|
-
}
|
|
7890
|
-
});
|
|
7891
|
-
}
|
|
7892
|
-
return out;
|
|
7893
|
-
}
|
|
7894
|
-
|
|
7895
7886
|
// dist/clients/dispatch/runners/lsp.js
|
|
7896
7887
|
var LSP_SPAWN_BUDGET_MS = RUNTIME_CONFIG.pipeline.lspSpawnBudgetMs;
|
|
7897
7888
|
var LSP_DIAGNOSTICS_WAIT_MS = 2500;
|
|
@@ -7948,6 +7939,7 @@ var lspRunner = {
|
|
|
7948
7939
|
let unconfirmedServerIds = [];
|
|
7949
7940
|
let deferredServerIds = [];
|
|
7950
7941
|
let usedWarmAttach = false;
|
|
7942
|
+
let incumbentProjectIdentity;
|
|
7951
7943
|
let failureReason = "";
|
|
7952
7944
|
const readStamp = performance.now();
|
|
7953
7945
|
const content = readFileContent(ctx.filePath);
|
|
@@ -7961,6 +7953,9 @@ var lspRunner = {
|
|
|
7961
7953
|
try {
|
|
7962
7954
|
const attached = await tryWarmAttachedDiagnostics(ctx.filePath, content, Math.max(LSP_SPAWN_BUDGET_MS, LSP_DIAGNOSTICS_WAIT_MS));
|
|
7963
7955
|
usedWarmAttach = attached?.available === true;
|
|
7956
|
+
if (attached?.available) {
|
|
7957
|
+
incumbentProjectIdentity = attached.response.projectIdentity;
|
|
7958
|
+
}
|
|
7964
7959
|
const touched = attached?.available ? {
|
|
7965
7960
|
diags: attached.response.diagnostics,
|
|
7966
7961
|
...attached.response.unconfirmedServerIds !== void 0 && {
|
|
@@ -8020,6 +8015,16 @@ var lspRunner = {
|
|
|
8020
8015
|
});
|
|
8021
8016
|
}
|
|
8022
8017
|
}
|
|
8018
|
+
let withheldNotice;
|
|
8019
|
+
if (lspDiags.length > 0) {
|
|
8020
|
+
const declared = await detectPythonTargetVersion(diagnosticPath);
|
|
8021
|
+
const { kept, dropped } = partitionOutrankedPythonCompileVerdicts(lspDiags, declared);
|
|
8022
|
+
if (dropped > 0 && declared) {
|
|
8023
|
+
recordPythonCompileVerdictDrop(diagnosticPath, declared, dropped);
|
|
8024
|
+
lspDiags = kept;
|
|
8025
|
+
withheldNotice = describePythonCompileWithheld(dropped, declared);
|
|
8026
|
+
}
|
|
8027
|
+
}
|
|
8023
8028
|
if (serverFailed) {
|
|
8024
8029
|
return {
|
|
8025
8030
|
status: "failed",
|
|
@@ -8079,15 +8084,19 @@ var lspRunner = {
|
|
|
8079
8084
|
status: "succeeded",
|
|
8080
8085
|
diagnostics: [],
|
|
8081
8086
|
semantic: "none",
|
|
8082
|
-
rawOutput: "no-diagnostics"
|
|
8087
|
+
rawOutput: "no-diagnostics",
|
|
8088
|
+
...withheldNotice !== void 0 && { withheldNotice }
|
|
8083
8089
|
};
|
|
8084
8090
|
}
|
|
8085
8091
|
const rawValidLspDiags = lspDiags.filter((d) => d.range?.start?.line !== void 0);
|
|
8086
|
-
const validLspDiags =
|
|
8092
|
+
const validLspDiags = (await demoteLanguageServerRows(rawValidLspDiags, {
|
|
8087
8093
|
filePath: diagnosticPath,
|
|
8088
8094
|
cwd: ctx.cwd,
|
|
8089
|
-
service: lspService
|
|
8090
|
-
|
|
8095
|
+
...!usedWarmAttach && { service: lspService },
|
|
8096
|
+
...incumbentProjectIdentity !== void 0 && {
|
|
8097
|
+
identityCache: /* @__PURE__ */ new Map([[diagnosticPath, incumbentProjectIdentity]])
|
|
8098
|
+
}
|
|
8099
|
+
})).rows;
|
|
8091
8100
|
const fixSuggestionByIndex = /* @__PURE__ */ new Map();
|
|
8092
8101
|
const blockingDiagIndexes = rawValidLspDiags.map((d, idx) => ({ d, idx })).filter(({ d }) => d.severity === 1).slice(0, WARM_CODE_ACTION_LOOKUP_LIMIT);
|
|
8093
8102
|
if (usedWarmAttach) {
|
|
@@ -8144,14 +8153,15 @@ var lspRunner = {
|
|
|
8144
8153
|
...deferredServerIds.length > 0 && {
|
|
8145
8154
|
deferredServerIds: [...deferredServerIds]
|
|
8146
8155
|
},
|
|
8147
|
-
...outOfEditScope.length > 0 && { outOfEditScope }
|
|
8156
|
+
...outOfEditScope.length > 0 && { outOfEditScope },
|
|
8157
|
+
...withheldNotice !== void 0 && { withheldNotice }
|
|
8148
8158
|
};
|
|
8149
8159
|
}
|
|
8150
8160
|
};
|
|
8151
8161
|
var lsp_default = lspRunner;
|
|
8152
8162
|
|
|
8153
8163
|
// dist/clients/dispatch/runners/markdownlint.js
|
|
8154
|
-
import * as
|
|
8164
|
+
import * as path26 from "node:path";
|
|
8155
8165
|
var markdownlint = createAvailabilityChecker("markdownlint-cli2", ".cmd", [
|
|
8156
8166
|
"--no-globs",
|
|
8157
8167
|
"-"
|
|
@@ -8191,7 +8201,7 @@ var MARKDOWNLINT_FIXABLE_RULES = /* @__PURE__ */ new Set([
|
|
|
8191
8201
|
]);
|
|
8192
8202
|
function parseMarkdownlintOutput(raw, filePath, cwd) {
|
|
8193
8203
|
const diagnostics = [];
|
|
8194
|
-
const absTarget =
|
|
8204
|
+
const absTarget = path26.resolve(cwd, filePath);
|
|
8195
8205
|
for (const line of raw.split(/\r?\n/)) {
|
|
8196
8206
|
if (!line.trim())
|
|
8197
8207
|
continue;
|
|
@@ -8199,7 +8209,7 @@ function parseMarkdownlintOutput(raw, filePath, cwd) {
|
|
|
8199
8209
|
if (!match)
|
|
8200
8210
|
continue;
|
|
8201
8211
|
const [, reported, lineNum, col, ruleCode, message] = match;
|
|
8202
|
-
if (reported && !pathsEqual(
|
|
8212
|
+
if (reported && !pathsEqual(path26.resolve(cwd, reported), absTarget))
|
|
8203
8213
|
continue;
|
|
8204
8214
|
const ruleName = ruleCode.split("/")[0];
|
|
8205
8215
|
const fixable = MARKDOWNLINT_FIXABLE_RULES.has(ruleName);
|
|
@@ -8273,7 +8283,7 @@ var markdownlintRunner = {
|
|
|
8273
8283
|
var markdownlint_default = markdownlintRunner;
|
|
8274
8284
|
|
|
8275
8285
|
// dist/clients/dispatch/runners/mypy.js
|
|
8276
|
-
import * as
|
|
8286
|
+
import * as path27 from "node:path";
|
|
8277
8287
|
var mypy = createAvailabilityChecker("mypy", "");
|
|
8278
8288
|
var MYPY_EXIT_CODES = { ran: [1, 2] };
|
|
8279
8289
|
function parseMypyOutput(raw, fallbackPath, cwd) {
|
|
@@ -8287,7 +8297,7 @@ function parseMypyOutput(raw, fallbackPath, cwd) {
|
|
|
8287
8297
|
continue;
|
|
8288
8298
|
const severity = level === "error" ? "error" : "warning";
|
|
8289
8299
|
const rule = errorCode ?? "mypy";
|
|
8290
|
-
const filePath = file && file.trim() ?
|
|
8300
|
+
const filePath = file && file.trim() ? path27.isAbsolute(file) ? file : path27.resolve(cwd, file) : fallbackPath;
|
|
8291
8301
|
diagnostics.push({
|
|
8292
8302
|
id: `mypy-${lineNum}-${rule}`,
|
|
8293
8303
|
message: errorCode ? `[${errorCode}] ${message}` : message,
|
|
@@ -8338,7 +8348,7 @@ var mypyRunner = {
|
|
|
8338
8348
|
var mypy_default = mypyRunner;
|
|
8339
8349
|
|
|
8340
8350
|
// dist/clients/dispatch/runners/oxlint.js
|
|
8341
|
-
import * as
|
|
8351
|
+
import * as path28 from "node:path";
|
|
8342
8352
|
var MAX_OXLINT_OUTPUT_BYTES = 8 * 1024 * 1024;
|
|
8343
8353
|
var OXLINT_NO_FILES = /* @__PURE__ */ Symbol("oxlint-no-files");
|
|
8344
8354
|
var OXLINT_NO_FILES_UNCONFIRMED = /* @__PURE__ */ Symbol("oxlint-no-files-unconfirmed");
|
|
@@ -8582,9 +8592,9 @@ function parseOxlintJson(raw, filePath, cwd) {
|
|
|
8582
8592
|
if (!Array.isArray(parsed.diagnostics))
|
|
8583
8593
|
return [];
|
|
8584
8594
|
const diagnostics = [];
|
|
8585
|
-
const absTarget =
|
|
8595
|
+
const absTarget = path28.resolve(cwd, filePath);
|
|
8586
8596
|
for (const d of parsed.diagnostics) {
|
|
8587
|
-
if (!d.filename || !pathsEqual(
|
|
8597
|
+
if (!d.filename || !pathsEqual(path28.resolve(cwd, d.filename), absTarget)) {
|
|
8588
8598
|
continue;
|
|
8589
8599
|
}
|
|
8590
8600
|
const rule = extractOxlintRule(d.code);
|
|
@@ -8614,14 +8624,14 @@ function parseOxlintJson(raw, filePath, cwd) {
|
|
|
8614
8624
|
}
|
|
8615
8625
|
function parseOxlintUnix(raw, filePath, cwd) {
|
|
8616
8626
|
const diagnostics = [];
|
|
8617
|
-
const absTarget =
|
|
8627
|
+
const absTarget = path28.resolve(cwd, filePath);
|
|
8618
8628
|
for (const line of raw.split("\n")) {
|
|
8619
8629
|
const match = line.match(/^(.+):(\d+):(\d+):\s*(.+?)\s*\(([^)]+)\)$/);
|
|
8620
8630
|
if (match) {
|
|
8621
8631
|
const [, reportedPath, lineStr, _col, message, rule] = match;
|
|
8622
8632
|
if (!reportedPath || !lineStr || !message || !rule)
|
|
8623
8633
|
continue;
|
|
8624
|
-
if (!pathsEqual(
|
|
8634
|
+
if (!pathsEqual(path28.resolve(cwd, reportedPath), absTarget))
|
|
8625
8635
|
continue;
|
|
8626
8636
|
diagnostics.push({
|
|
8627
8637
|
id: `oxlint-${rule}-${lineStr}`,
|
|
@@ -8640,7 +8650,7 @@ function parseOxlintUnix(raw, filePath, cwd) {
|
|
|
8640
8650
|
var oxlint_default = oxlintRunner;
|
|
8641
8651
|
|
|
8642
8652
|
// dist/clients/dispatch/runners/php-lint.js
|
|
8643
|
-
import * as
|
|
8653
|
+
import * as path29 from "node:path";
|
|
8644
8654
|
var PHP_LINT_EXIT_CODES = { ran: [1, 255] };
|
|
8645
8655
|
var php = createAvailabilityChecker("php", ".exe");
|
|
8646
8656
|
function parsePhpLintOutput(raw, filePath, cwd) {
|
|
@@ -8650,7 +8660,7 @@ function parsePhpLintOutput(raw, filePath, cwd) {
|
|
|
8650
8660
|
const lineMatch = output.match(/on line (\d+)/i);
|
|
8651
8661
|
const messageMatch = output.match(/PHP Parse error:\s*(.+?)(?:\s+in\s+(.+?)\s+on line \d+)?$/im) ?? output.match(/Parse error:\s*(.+?)(?:\s+in\s+(.+?)\s+on line \d+)?$/im);
|
|
8652
8662
|
const reported = messageMatch?.[2]?.trim();
|
|
8653
|
-
if (reported && !pathsEqual(
|
|
8663
|
+
if (reported && !pathsEqual(path29.resolve(cwd, reported), path29.resolve(cwd, filePath)))
|
|
8654
8664
|
return [];
|
|
8655
8665
|
return [
|
|
8656
8666
|
{
|
|
@@ -8677,7 +8687,7 @@ var phpLintRunner = {
|
|
|
8677
8687
|
const cmd = ctx.analysisRootMode === "adopted" ? resolveAdoptedRootCommand("php", ctx, cwd) : await php.isAvailableAsync(cwd) ? php.getCommand(cwd) : null;
|
|
8678
8688
|
if (!cmd)
|
|
8679
8689
|
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
8680
|
-
const absPath =
|
|
8690
|
+
const absPath = path29.resolve(cwd, ctx.filePath);
|
|
8681
8691
|
const result = await safeSpawnAsync(cmd, ["-l", absPath], {
|
|
8682
8692
|
timeout: 15e3,
|
|
8683
8693
|
cwd
|
|
@@ -8702,7 +8712,7 @@ ${result.stderr ?? ""}`,
|
|
|
8702
8712
|
var php_lint_default = phpLintRunner;
|
|
8703
8713
|
|
|
8704
8714
|
// dist/clients/dispatch/runners/phpstan.js
|
|
8705
|
-
import * as
|
|
8715
|
+
import * as path30 from "node:path";
|
|
8706
8716
|
var PHPSTAN_EXIT_CODES = { ran: [1] };
|
|
8707
8717
|
var phpstan = createAvailabilityChecker("phpstan", ".phar");
|
|
8708
8718
|
function parsePhpstanJson(raw, fallbackPath, cwd) {
|
|
@@ -8710,7 +8720,7 @@ function parsePhpstanJson(raw, fallbackPath, cwd) {
|
|
|
8710
8720
|
const output = JSON.parse(raw);
|
|
8711
8721
|
const diagnostics = [];
|
|
8712
8722
|
for (const [file, fileErrors] of Object.entries(output.files ?? {})) {
|
|
8713
|
-
const filePath = file && file.trim() ?
|
|
8723
|
+
const filePath = file && file.trim() ? path30.isAbsolute(file) ? file : path30.resolve(cwd, file) : fallbackPath;
|
|
8714
8724
|
for (const err of fileErrors?.messages ?? []) {
|
|
8715
8725
|
diagnostics.push({
|
|
8716
8726
|
id: `phpstan:${err.line ?? 1}:${err.message.slice(0, 40)}`,
|
|
@@ -8769,7 +8779,7 @@ var phpstanRunner = {
|
|
|
8769
8779
|
const cmd = await resolvePhpstan(cwd);
|
|
8770
8780
|
if (!cmd)
|
|
8771
8781
|
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
8772
|
-
const absPath =
|
|
8782
|
+
const absPath = path30.resolve(cwd, ctx.filePath);
|
|
8773
8783
|
const result = await safeSpawnAsync(cmd, ["analyse", "--error-format=json", "--no-progress", absPath], { timeout: 3e4, cwd });
|
|
8774
8784
|
const run = parseToolRun("phpstan", { result, exitCodes: PHPSTAN_EXIT_CODES }, (out) => parsePhpstanJson(out, ctx.filePath, cwd), { parseOutput: result.stdout ?? "" });
|
|
8775
8785
|
if (run.skipped)
|
|
@@ -8787,7 +8797,7 @@ var phpstanRunner = {
|
|
|
8787
8797
|
var phpstan_default = phpstanRunner;
|
|
8788
8798
|
|
|
8789
8799
|
// dist/clients/dispatch/runners/prisma-validate.js
|
|
8790
|
-
import * as
|
|
8800
|
+
import * as path31 from "node:path";
|
|
8791
8801
|
var PRISMA_VALIDATION_REPORT = /\bValidation Error Count:\s*\d+/;
|
|
8792
8802
|
function parsePrismaValidateOutput(raw, filePath) {
|
|
8793
8803
|
const output = raw.split("\n").map((line) => line.trim()).filter(Boolean).filter((line) => !line.startsWith("Environment variables loaded")).filter((line) => !line.startsWith("Prisma schema loaded")).join(" ");
|
|
@@ -8818,7 +8828,7 @@ var prismaValidateRunner = {
|
|
|
8818
8828
|
async run(ctx) {
|
|
8819
8829
|
const cwd = resolveRunnerCwd(ctx, "prisma-validate");
|
|
8820
8830
|
const resolved = await resolveLocalFirstAsync("prisma", cwd);
|
|
8821
|
-
const absPath =
|
|
8831
|
+
const absPath = path31.resolve(cwd, ctx.filePath);
|
|
8822
8832
|
const result = await safeSpawnAsync(resolved.cmd, [...resolved.args, "validate", "--schema", absPath], {
|
|
8823
8833
|
timeout: 2e4,
|
|
8824
8834
|
// ONE neutral-cwd seam for npx fallbacks (#4193, #4268 acceptance 3),
|
|
@@ -8856,7 +8866,7 @@ var prisma_validate_default = prismaValidateRunner;
|
|
|
8856
8866
|
// dist/clients/dispatch/runners/psscriptanalyzer.js
|
|
8857
8867
|
import * as fs13 from "node:fs/promises";
|
|
8858
8868
|
import * as os2 from "node:os";
|
|
8859
|
-
import * as
|
|
8869
|
+
import * as path32 from "node:path";
|
|
8860
8870
|
var PS_SCRIPT = `
|
|
8861
8871
|
param([string]$FilePath)
|
|
8862
8872
|
Import-Module PSScriptAnalyzer -ErrorAction Stop
|
|
@@ -9048,8 +9058,8 @@ var psScriptAnalyzerRunner = {
|
|
|
9048
9058
|
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
9049
9059
|
}
|
|
9050
9060
|
const cwd = resolveRunnerCwd(ctx, "psscriptanalyzer");
|
|
9051
|
-
const absPath =
|
|
9052
|
-
const tmpScript =
|
|
9061
|
+
const absPath = path32.resolve(cwd, ctx.filePath);
|
|
9062
|
+
const tmpScript = path32.join(os2.tmpdir(), `pi-lens-psa-${process.pid}.ps1`);
|
|
9053
9063
|
await fs13.writeFile(tmpScript, PS_SCRIPT, "utf-8");
|
|
9054
9064
|
try {
|
|
9055
9065
|
const sampler = startHostStallSampler();
|
|
@@ -9180,7 +9190,7 @@ var pyrightRunner = {
|
|
|
9180
9190
|
cmd = installedPath;
|
|
9181
9191
|
}
|
|
9182
9192
|
if (!cmd) {
|
|
9183
|
-
const { findCommandAsync } = await import("./chunk-
|
|
9193
|
+
const { findCommandAsync } = await import("./chunk-LEJOJDXL.js");
|
|
9184
9194
|
const foundCmd = await findCommandAsync("pyright");
|
|
9185
9195
|
if (foundCmd)
|
|
9186
9196
|
cmd = foundCmd;
|
|
@@ -9277,7 +9287,7 @@ function parsePyrightOutput(data, _filePath) {
|
|
|
9277
9287
|
var pyright_default = pyrightRunner;
|
|
9278
9288
|
|
|
9279
9289
|
// dist/clients/dispatch/runners/rubocop.js
|
|
9280
|
-
import * as
|
|
9290
|
+
import * as path33 from "node:path";
|
|
9281
9291
|
var SEVERITY_MAP = {
|
|
9282
9292
|
fatal: "error",
|
|
9283
9293
|
error: "error",
|
|
@@ -9290,9 +9300,9 @@ function parseRubocopJson(raw, filePath, cwd) {
|
|
|
9290
9300
|
const output = JSON.parse(raw);
|
|
9291
9301
|
const autofix = getAutofixCapability("rubocop");
|
|
9292
9302
|
const diagnostics = [];
|
|
9293
|
-
const absTarget =
|
|
9303
|
+
const absTarget = path33.resolve(cwd, filePath);
|
|
9294
9304
|
for (const file of output.files) {
|
|
9295
|
-
if (file.path && !pathsEqual(
|
|
9305
|
+
if (file.path && !pathsEqual(path33.resolve(cwd, file.path), absTarget))
|
|
9296
9306
|
continue;
|
|
9297
9307
|
for (const offense of file.offenses) {
|
|
9298
9308
|
const severity = SEVERITY_MAP[offense.severity] ?? "warning";
|
|
@@ -9577,7 +9587,7 @@ var rust_clippy_default = rustClippyRunner;
|
|
|
9577
9587
|
// dist/clients/dispatch/runners/spotbugs.js
|
|
9578
9588
|
import * as fs14 from "node:fs";
|
|
9579
9589
|
import * as os3 from "node:os";
|
|
9580
|
-
import * as
|
|
9590
|
+
import * as path34 from "node:path";
|
|
9581
9591
|
var java = createAvailabilityChecker("java", ".exe", ["-version"]);
|
|
9582
9592
|
var spotbugs = createAvailabilityChecker("spotbugs", ".bat", ["-version"]);
|
|
9583
9593
|
var MAX_DIAGNOSTICS = 50;
|
|
@@ -9598,7 +9608,7 @@ function classesSignature(classesDir) {
|
|
|
9598
9608
|
continue;
|
|
9599
9609
|
}
|
|
9600
9610
|
for (const entry of entries) {
|
|
9601
|
-
const full =
|
|
9611
|
+
const full = path34.join(dir, entry.name);
|
|
9602
9612
|
if (entry.isDirectory()) {
|
|
9603
9613
|
stack.push(full);
|
|
9604
9614
|
} else if (entry.isFile() && entry.name.endsWith(".class")) {
|
|
@@ -9689,7 +9699,7 @@ function parseSpotbugsXml(raw) {
|
|
|
9689
9699
|
const message = shortMsg || longMsg || type;
|
|
9690
9700
|
const fixSuggestion = longMsg ? firstSentence(longMsg) : void 0;
|
|
9691
9701
|
diagnostics.push({
|
|
9692
|
-
id: `spotbugs:${type}:${
|
|
9702
|
+
id: `spotbugs:${type}:${path34.basename(filePath)}:${line}:${index}`,
|
|
9693
9703
|
message: `[${type}] ${message}`,
|
|
9694
9704
|
filePath,
|
|
9695
9705
|
line,
|
|
@@ -9739,7 +9749,7 @@ var spotbugsRunner = {
|
|
|
9739
9749
|
const cmd = await resolveAvailableOrInstall(spotbugs, "spotbugs", cwd);
|
|
9740
9750
|
if (!cmd)
|
|
9741
9751
|
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
9742
|
-
const tmpXml =
|
|
9752
|
+
const tmpXml = path34.join(os3.tmpdir(), `pi-lens-spotbugs-${process.pid}-${Date.now()}.xml`);
|
|
9743
9753
|
const result = await safeSpawnAsync(cmd, [
|
|
9744
9754
|
"-textui",
|
|
9745
9755
|
"-xml:withMessages",
|
|
@@ -9781,7 +9791,7 @@ var spotbugs_default = spotbugsRunner;
|
|
|
9781
9791
|
|
|
9782
9792
|
// dist/clients/dispatch/runners/shellcheck.js
|
|
9783
9793
|
import * as fs15 from "node:fs";
|
|
9784
|
-
import * as
|
|
9794
|
+
import * as path35 from "node:path";
|
|
9785
9795
|
var shellcheck = createAvailabilityChecker("shellcheck", ".exe");
|
|
9786
9796
|
var SHELLCHECK_EXIT_CODES = { ran: [1] };
|
|
9787
9797
|
var SHELLCHECK_DIALECTS = [
|
|
@@ -9823,7 +9833,7 @@ function resolveShellFileDialect(filePath) {
|
|
|
9823
9833
|
}
|
|
9824
9834
|
const directive = parseShellDirective(content);
|
|
9825
9835
|
const shebang = parseShebang(content);
|
|
9826
|
-
const parsed = directive ?? shebang ?? (
|
|
9836
|
+
const parsed = directive ?? shebang ?? (path35.extname(filePath).toLowerCase() === ".zsh" ? "zsh" : null);
|
|
9827
9837
|
return {
|
|
9828
9838
|
shebang,
|
|
9829
9839
|
directive,
|
|
@@ -9831,24 +9841,11 @@ function resolveShellFileDialect(filePath) {
|
|
|
9831
9841
|
};
|
|
9832
9842
|
}
|
|
9833
9843
|
function findShellcheckConfig(cwd) {
|
|
9834
|
-
|
|
9835
|
-
if (fs15.existsSync(local))
|
|
9836
|
-
return local;
|
|
9837
|
-
let current = path36.resolve(cwd);
|
|
9838
|
-
while (true) {
|
|
9839
|
-
const candidate = path36.join(current, ".shellcheckrc");
|
|
9840
|
-
if (fs15.existsSync(candidate))
|
|
9841
|
-
return candidate;
|
|
9842
|
-
const parent = path36.dirname(current);
|
|
9843
|
-
if (parent === current)
|
|
9844
|
-
break;
|
|
9845
|
-
current = parent;
|
|
9846
|
-
}
|
|
9847
|
-
return void 0;
|
|
9844
|
+
return findLocalToolConfig(cwd, [".shellcheckrc"]);
|
|
9848
9845
|
}
|
|
9849
9846
|
function parseShellcheckOutput(raw, filePath, cwd) {
|
|
9850
9847
|
const diagnostics = [];
|
|
9851
|
-
const absTarget =
|
|
9848
|
+
const absTarget = path35.resolve(cwd, filePath);
|
|
9852
9849
|
if (!raw.trim()) {
|
|
9853
9850
|
return diagnostics;
|
|
9854
9851
|
}
|
|
@@ -9860,7 +9857,7 @@ function parseShellcheckOutput(raw, filePath, cwd) {
|
|
|
9860
9857
|
for (const item of parsed) {
|
|
9861
9858
|
if (!item.message || !item.line)
|
|
9862
9859
|
continue;
|
|
9863
|
-
if (!item.file || !pathsEqual(
|
|
9860
|
+
if (!item.file || !pathsEqual(path35.resolve(cwd, item.file), absTarget))
|
|
9864
9861
|
continue;
|
|
9865
9862
|
const severityMap = {
|
|
9866
9863
|
error: "error",
|
|
@@ -10158,12 +10155,12 @@ var shfmtRunner = {
|
|
|
10158
10155
|
var shfmt_default = shfmtRunner;
|
|
10159
10156
|
|
|
10160
10157
|
// dist/clients/dispatch/runners/spellcheck.js
|
|
10161
|
-
import * as
|
|
10158
|
+
import * as path36 from "node:path";
|
|
10162
10159
|
var typos = createAvailabilityChecker("typos", ".exe");
|
|
10163
10160
|
var TYPOS_EXIT_CODES = { ran: [2] };
|
|
10164
10161
|
function parseTyposOutput(raw, filePath, cwd) {
|
|
10165
10162
|
const diagnostics = [];
|
|
10166
|
-
const absTarget =
|
|
10163
|
+
const absTarget = path36.resolve(cwd, filePath);
|
|
10167
10164
|
if (!raw.trim()) {
|
|
10168
10165
|
return diagnostics;
|
|
10169
10166
|
}
|
|
@@ -10173,7 +10170,7 @@ function parseTyposOutput(raw, filePath, cwd) {
|
|
|
10173
10170
|
const parsed = JSON.parse(line);
|
|
10174
10171
|
if (!parsed.typo || !parsed.line_num)
|
|
10175
10172
|
continue;
|
|
10176
|
-
if (parsed.path && !pathsEqual(
|
|
10173
|
+
if (parsed.path && !pathsEqual(path36.resolve(cwd, parsed.path), absTarget))
|
|
10177
10174
|
continue;
|
|
10178
10175
|
const corrections = parsed.corrections?.join(", ") || "no suggestions";
|
|
10179
10176
|
const message = `Typo: "${parsed.typo}" \u2192 ${corrections}`;
|
|
@@ -10231,7 +10228,7 @@ var spellcheckRunner = {
|
|
|
10231
10228
|
var spellcheck_default = spellcheckRunner;
|
|
10232
10229
|
|
|
10233
10230
|
// dist/clients/dispatch/runners/sqlfluff.js
|
|
10234
|
-
import * as
|
|
10231
|
+
import * as path37 from "node:path";
|
|
10235
10232
|
var sqlfluff = createAvailabilityChecker("sqlfluff", ".exe");
|
|
10236
10233
|
var SQLFLUFF_EXIT_CODES = { ran: [1] };
|
|
10237
10234
|
var SQLFLUFF_FIXABLE_RULES = /* @__PURE__ */ new Set([
|
|
@@ -10286,9 +10283,9 @@ function parseSqlfluffOutput(raw, filePath, cwd) {
|
|
|
10286
10283
|
if (!Array.isArray(parsed))
|
|
10287
10284
|
return [];
|
|
10288
10285
|
const diagnostics = [];
|
|
10289
|
-
const absTarget =
|
|
10286
|
+
const absTarget = path37.resolve(cwd, filePath);
|
|
10290
10287
|
for (const item of parsed) {
|
|
10291
|
-
if (item.filepath && !pathsEqual(
|
|
10288
|
+
if (item.filepath && !pathsEqual(path37.resolve(cwd, item.filepath), absTarget))
|
|
10292
10289
|
continue;
|
|
10293
10290
|
for (const v of item.violations ?? []) {
|
|
10294
10291
|
if (!v.description)
|
|
@@ -10363,7 +10360,7 @@ var sqlfluffRunner = {
|
|
|
10363
10360
|
var sqlfluff_default = sqlfluffRunner;
|
|
10364
10361
|
|
|
10365
10362
|
// dist/clients/dispatch/runners/stylelint.js
|
|
10366
|
-
import * as
|
|
10363
|
+
import * as path38 from "node:path";
|
|
10367
10364
|
var stylelint = createAvailabilityChecker("stylelint", ".cmd");
|
|
10368
10365
|
var STYLELINT_EXIT_CODES = { ran: [1, 2] };
|
|
10369
10366
|
function stylelintReport(stdout, stderr) {
|
|
@@ -10408,9 +10405,9 @@ function parseStylelintJson(raw, filePath, cwd) {
|
|
|
10408
10405
|
try {
|
|
10409
10406
|
const results = JSON.parse(raw);
|
|
10410
10407
|
const diagnostics = [];
|
|
10411
|
-
const absTarget =
|
|
10408
|
+
const absTarget = path38.resolve(cwd, filePath);
|
|
10412
10409
|
for (const result of results) {
|
|
10413
|
-
if (result.source && !pathsEqual(
|
|
10410
|
+
if (result.source && !pathsEqual(path38.resolve(cwd, result.source), absTarget))
|
|
10414
10411
|
continue;
|
|
10415
10412
|
for (const w of result.warnings) {
|
|
10416
10413
|
const severity = w.severity === "error" ? "error" : "warning";
|
|
@@ -10446,7 +10443,7 @@ var stylelintRunner = {
|
|
|
10446
10443
|
if (policy && !policy.preferredRunners.includes("stylelint")) {
|
|
10447
10444
|
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
10448
10445
|
}
|
|
10449
|
-
const fileDir =
|
|
10446
|
+
const fileDir = path38.dirname(path38.resolve(cwd, ctx.filePath));
|
|
10450
10447
|
const hasConfig = hasStylelintConfig(fileDir) || hasStylelintConfig(cwd);
|
|
10451
10448
|
if (!hasConfig) {
|
|
10452
10449
|
logRunnerAdvisoryOnce(ctx, "stylelint", cwd, "stylelint: no config detected, running with default rules");
|
|
@@ -10476,7 +10473,7 @@ var stylelintRunner = {
|
|
|
10476
10473
|
var stylelint_default = stylelintRunner;
|
|
10477
10474
|
|
|
10478
10475
|
// dist/clients/dispatch/runners/swiftlint.js
|
|
10479
|
-
import * as
|
|
10476
|
+
import * as path39 from "node:path";
|
|
10480
10477
|
var swiftlint = createAvailabilityChecker("swiftlint", ".exe");
|
|
10481
10478
|
var SWIFTLINT_FIXABLE_RULES = /* @__PURE__ */ new Set([
|
|
10482
10479
|
"closing_brace",
|
|
@@ -10539,7 +10536,7 @@ function parseSwiftLintOutput(raw, filePath, cwd) {
|
|
|
10539
10536
|
const diagnostics = [];
|
|
10540
10537
|
if (!raw.trim())
|
|
10541
10538
|
return diagnostics;
|
|
10542
|
-
const absTarget =
|
|
10539
|
+
const absTarget = path39.resolve(cwd, filePath);
|
|
10543
10540
|
try {
|
|
10544
10541
|
const parsed = JSON.parse(raw);
|
|
10545
10542
|
if (!Array.isArray(parsed))
|
|
@@ -10547,7 +10544,7 @@ function parseSwiftLintOutput(raw, filePath, cwd) {
|
|
|
10547
10544
|
for (const item of parsed) {
|
|
10548
10545
|
if (!item.reason)
|
|
10549
10546
|
continue;
|
|
10550
|
-
if (item.file && !pathsEqual(
|
|
10547
|
+
if (item.file && !pathsEqual(path39.resolve(cwd, item.file), absTarget))
|
|
10551
10548
|
continue;
|
|
10552
10549
|
const severityMap = {
|
|
10553
10550
|
error: "error",
|
|
@@ -10592,7 +10589,7 @@ var swiftlintRunner = {
|
|
|
10592
10589
|
}
|
|
10593
10590
|
if (!cmd)
|
|
10594
10591
|
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
10595
|
-
const result = await safeSpawnAsync(cmd, ["--reporter", "json",
|
|
10592
|
+
const result = await safeSpawnAsync(cmd, ["--reporter", "json", path39.resolve(cwd, ctx.filePath)], { cwd, timeout: 15e3 });
|
|
10596
10593
|
const run = parseToolRun("swiftlint", {
|
|
10597
10594
|
result,
|
|
10598
10595
|
// EXIT TABLE (SwiftLint 0.56 measured fixture): 0 clean; 1 findings; 2 error; other nonzero rejected.
|
|
@@ -10614,7 +10611,7 @@ var swiftlintRunner = {
|
|
|
10614
10611
|
var swiftlint_default = swiftlintRunner;
|
|
10615
10612
|
|
|
10616
10613
|
// dist/clients/dispatch/runners/taplo.js
|
|
10617
|
-
import * as
|
|
10614
|
+
import * as path40 from "node:path";
|
|
10618
10615
|
var taplo = createAvailabilityChecker("taplo", ".exe");
|
|
10619
10616
|
var TAPLO_EXIT_CODES = { ran: [1] };
|
|
10620
10617
|
var HEADER_PATTERN = /^\s*(error|warning):(.*)$/;
|
|
@@ -10622,7 +10619,7 @@ var LOCATION_LEAD = "\u250C\u2500";
|
|
|
10622
10619
|
var LOCATION_PATTERN = /^\s*┌─\s+(.+?):(\d+):(\d+)$/;
|
|
10623
10620
|
function parseTaploOutput(raw, filePath, cwd) {
|
|
10624
10621
|
const diagnostics = [];
|
|
10625
|
-
const absTarget =
|
|
10622
|
+
const absTarget = path40.resolve(cwd, filePath);
|
|
10626
10623
|
const lines = stripAnsi(raw ?? "").split(/\r?\n/);
|
|
10627
10624
|
for (let i = 0; i < lines.length; i++) {
|
|
10628
10625
|
const header = HEADER_PATTERN.exec(lines[i].trimEnd());
|
|
@@ -10640,7 +10637,7 @@ function parseTaploOutput(raw, filePath, cwd) {
|
|
|
10640
10637
|
const location = LOCATION_PATTERN.exec(lines[j].trimEnd());
|
|
10641
10638
|
if (!location)
|
|
10642
10639
|
continue;
|
|
10643
|
-
if (!pathsEqual(
|
|
10640
|
+
if (!pathsEqual(path40.resolve(cwd, location[1].trim()), absTarget))
|
|
10644
10641
|
continue;
|
|
10645
10642
|
line = Number.parseInt(location[2], 10) || 1;
|
|
10646
10643
|
column = Number.parseInt(location[3], 10) || 1;
|
|
@@ -10702,7 +10699,7 @@ var taploRunner = {
|
|
|
10702
10699
|
}
|
|
10703
10700
|
if (!cmd)
|
|
10704
10701
|
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
10705
|
-
const absPath =
|
|
10702
|
+
const absPath = path40.resolve(cwd, ctx.filePath);
|
|
10706
10703
|
const result = await safeSpawnAsync(cmd, ["check", "--colors", "never", absPath], { cwd, timeout: 15e3 });
|
|
10707
10704
|
const raw = result.stderr?.trim() ? result.stderr : result.stdout ?? "";
|
|
10708
10705
|
const run = parseToolRun("taplo", { result, output: raw, exitCodes: TAPLO_EXIT_CODES }, (out) => parseTaploOutput(out, ctx.filePath, cwd), { skipWhenParsedNothing: true });
|
|
@@ -10721,7 +10718,7 @@ var taploRunner = {
|
|
|
10721
10718
|
var taplo_default = taploRunner;
|
|
10722
10719
|
|
|
10723
10720
|
// dist/clients/dispatch/runners/terragrunt.js
|
|
10724
|
-
import * as
|
|
10721
|
+
import * as path41 from "node:path";
|
|
10725
10722
|
var terragrunt = createAvailabilityChecker("terragrunt", ".exe");
|
|
10726
10723
|
function normalizeSeverity(raw) {
|
|
10727
10724
|
if (typeof raw === "number")
|
|
@@ -10740,7 +10737,7 @@ function toRawDiagnostics(parsed) {
|
|
|
10740
10737
|
return [];
|
|
10741
10738
|
return invalidFiles.flatMap((f) => Array.isArray(f?.diagnostics) ? f.diagnostics : []);
|
|
10742
10739
|
}
|
|
10743
|
-
function parseTerragruntOutput(raw, filePath, absPath =
|
|
10740
|
+
function parseTerragruntOutput(raw, filePath, absPath = path41.resolve(filePath)) {
|
|
10744
10741
|
if (!raw.trim())
|
|
10745
10742
|
return [];
|
|
10746
10743
|
let parsed;
|
|
@@ -10749,13 +10746,13 @@ function parseTerragruntOutput(raw, filePath, absPath = path42.resolve(filePath)
|
|
|
10749
10746
|
} catch {
|
|
10750
10747
|
return [];
|
|
10751
10748
|
}
|
|
10752
|
-
const unitDir =
|
|
10749
|
+
const unitDir = path41.dirname(absPath);
|
|
10753
10750
|
const diagnostics = [];
|
|
10754
10751
|
for (const d of toRawDiagnostics(parsed)) {
|
|
10755
10752
|
if (!d || typeof d !== "object")
|
|
10756
10753
|
continue;
|
|
10757
10754
|
const diagFile = d.range?.filename;
|
|
10758
|
-
if (diagFile && !pathsEqual(
|
|
10755
|
+
if (diagFile && !pathsEqual(path41.resolve(unitDir, diagFile), absPath))
|
|
10759
10756
|
continue;
|
|
10760
10757
|
const line = d.range?.start?.line ?? 1;
|
|
10761
10758
|
const column = d.range?.start?.column ?? 1;
|
|
@@ -10801,8 +10798,8 @@ var terragruntRunner = {
|
|
|
10801
10798
|
}
|
|
10802
10799
|
if (!cmd)
|
|
10803
10800
|
return SKIPPED3;
|
|
10804
|
-
const absPath =
|
|
10805
|
-
const fileDir =
|
|
10801
|
+
const absPath = path41.resolve(cwd, ctx.filePath);
|
|
10802
|
+
const fileDir = path41.dirname(absPath);
|
|
10806
10803
|
const result = await safeSpawnAsync(cmd, ["hcl", "validate", "--json", "--non-interactive"], { cwd: fileDir, timeout: 3e4 });
|
|
10807
10804
|
if (spawnFailedWithNoOutput(result))
|
|
10808
10805
|
return SKIPPED3;
|
|
@@ -10825,22 +10822,22 @@ var terragruntRunner = {
|
|
|
10825
10822
|
var terragrunt_default = terragruntRunner;
|
|
10826
10823
|
|
|
10827
10824
|
// dist/clients/dispatch/runners/tflint.js
|
|
10828
|
-
import * as
|
|
10825
|
+
import * as path42 from "node:path";
|
|
10829
10826
|
var tflint = createAvailabilityChecker("tflint", ".exe");
|
|
10830
10827
|
var TFLINT_CONFIG = ".tflint.hcl";
|
|
10831
10828
|
function findTflintConfig(fileDir) {
|
|
10832
10829
|
if (process.env.TFLINT_CONFIG_FILE)
|
|
10833
10830
|
return null;
|
|
10834
10831
|
const dir = findNearestDirWithAnyBasename(fileDir, [TFLINT_CONFIG]);
|
|
10835
|
-
return dir ?
|
|
10832
|
+
return dir ? path42.join(dir, TFLINT_CONFIG) : null;
|
|
10836
10833
|
}
|
|
10837
10834
|
function parseTflintOutput(raw, filePath, toolCwd) {
|
|
10838
10835
|
try {
|
|
10839
10836
|
const parsed = JSON.parse(raw);
|
|
10840
10837
|
const issues = parsed.issues ?? [];
|
|
10841
|
-
const absTarget =
|
|
10838
|
+
const absTarget = path42.resolve(toolCwd, filePath);
|
|
10842
10839
|
return issues.flatMap((issue) => {
|
|
10843
|
-
if (issue.range?.filename && !pathsEqual(
|
|
10840
|
+
if (issue.range?.filename && !pathsEqual(path42.resolve(toolCwd, issue.range.filename), absTarget))
|
|
10844
10841
|
return [];
|
|
10845
10842
|
const severity = issue.rule.severity === "error" ? "error" : "warning";
|
|
10846
10843
|
return [
|
|
@@ -10883,12 +10880,12 @@ var tflintRunner = {
|
|
|
10883
10880
|
}
|
|
10884
10881
|
if (!cmd)
|
|
10885
10882
|
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
10886
|
-
const absPath =
|
|
10887
|
-
const fileDir =
|
|
10883
|
+
const absPath = path42.resolve(cwd, ctx.filePath);
|
|
10884
|
+
const fileDir = path42.dirname(absPath);
|
|
10888
10885
|
const args = [
|
|
10889
10886
|
"--format=json",
|
|
10890
10887
|
"--no-color",
|
|
10891
|
-
`--filter=${
|
|
10888
|
+
`--filter=${path42.basename(absPath)}`
|
|
10892
10889
|
];
|
|
10893
10890
|
const configPath = findTflintConfig(fileDir);
|
|
10894
10891
|
if (configPath)
|
|
@@ -10924,7 +10921,7 @@ var tflint_default = tflintRunner;
|
|
|
10924
10921
|
|
|
10925
10922
|
// dist/clients/dispatch/runners/trivy-config.js
|
|
10926
10923
|
import * as fs16 from "node:fs";
|
|
10927
|
-
import * as
|
|
10924
|
+
import * as path43 from "node:path";
|
|
10928
10925
|
var trivy2 = createAvailabilityChecker("trivy", ".exe");
|
|
10929
10926
|
function looksLikeKubernetesManifest(content) {
|
|
10930
10927
|
for (const doc of content.split(/^---\s*$/m)) {
|
|
@@ -10961,12 +10958,12 @@ function parseTrivyConfigOutput(raw, filePath, cwd = process.cwd()) {
|
|
|
10961
10958
|
if (!Array.isArray(results))
|
|
10962
10959
|
return [];
|
|
10963
10960
|
const diagnostics = [];
|
|
10964
|
-
const absTarget =
|
|
10961
|
+
const absTarget = path43.resolve(cwd, filePath);
|
|
10965
10962
|
for (const resultEntry of results) {
|
|
10966
10963
|
if (!resultEntry || typeof resultEntry !== "object")
|
|
10967
10964
|
continue;
|
|
10968
10965
|
const target = resultEntry.Target;
|
|
10969
|
-
if (typeof target !== "string" || !pathsEqual(
|
|
10966
|
+
if (typeof target !== "string" || !pathsEqual(path43.resolve(cwd, target), absTarget))
|
|
10970
10967
|
continue;
|
|
10971
10968
|
const rows = resultEntry.Misconfigurations;
|
|
10972
10969
|
if (!Array.isArray(rows))
|
|
@@ -11010,7 +11007,7 @@ var trivyConfigRunner = {
|
|
|
11010
11007
|
if (!isTrivyEnabled(cwd)) {
|
|
11011
11008
|
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
11012
11009
|
}
|
|
11013
|
-
const absPath =
|
|
11010
|
+
const absPath = path43.resolve(cwd, ctx.filePath);
|
|
11014
11011
|
if (ctx.kind === "yaml" || ctx.kind === "json") {
|
|
11015
11012
|
let content = "";
|
|
11016
11013
|
try {
|
|
@@ -11082,30 +11079,16 @@ var trivyConfigRunner = {
|
|
|
11082
11079
|
var trivy_config_default = trivyConfigRunner;
|
|
11083
11080
|
|
|
11084
11081
|
// dist/clients/dispatch/runners/vale.js
|
|
11085
|
-
import * as
|
|
11086
|
-
import * as path45 from "node:path";
|
|
11082
|
+
import * as path44 from "node:path";
|
|
11087
11083
|
var vale = createAvailabilityChecker("vale", ".exe");
|
|
11088
11084
|
function findValeConfig(cwd) {
|
|
11089
|
-
|
|
11090
|
-
if (fs17.existsSync(local))
|
|
11091
|
-
return local;
|
|
11092
|
-
let current = path45.resolve(cwd);
|
|
11093
|
-
while (true) {
|
|
11094
|
-
const candidate = path45.join(current, ".vale.ini");
|
|
11095
|
-
if (fs17.existsSync(candidate))
|
|
11096
|
-
return candidate;
|
|
11097
|
-
const parent = path45.dirname(current);
|
|
11098
|
-
if (parent === current)
|
|
11099
|
-
break;
|
|
11100
|
-
current = parent;
|
|
11101
|
-
}
|
|
11102
|
-
return void 0;
|
|
11085
|
+
return findLocalToolConfig(cwd, [".vale.ini"]);
|
|
11103
11086
|
}
|
|
11104
11087
|
function parseValeOutput(raw, filePath, cwd) {
|
|
11105
11088
|
const diagnostics = [];
|
|
11106
11089
|
if (!raw.trim())
|
|
11107
11090
|
return diagnostics;
|
|
11108
|
-
const absTarget =
|
|
11091
|
+
const absTarget = path44.resolve(cwd, filePath);
|
|
11109
11092
|
try {
|
|
11110
11093
|
const parsed = JSON.parse(raw);
|
|
11111
11094
|
if (!parsed || typeof parsed !== "object")
|
|
@@ -11113,7 +11096,7 @@ function parseValeOutput(raw, filePath, cwd) {
|
|
|
11113
11096
|
for (const [reported, alerts] of Object.entries(parsed)) {
|
|
11114
11097
|
if (!Array.isArray(alerts))
|
|
11115
11098
|
continue;
|
|
11116
|
-
if (reported && !pathsEqual(
|
|
11099
|
+
if (reported && !pathsEqual(path44.resolve(cwd, reported), absTarget))
|
|
11117
11100
|
continue;
|
|
11118
11101
|
for (const alert of alerts) {
|
|
11119
11102
|
if (!alert.Message)
|
|
@@ -11184,11 +11167,11 @@ var valeRunner = {
|
|
|
11184
11167
|
var vale_default = valeRunner;
|
|
11185
11168
|
|
|
11186
11169
|
// dist/clients/dispatch/runners/tree-sitter.js
|
|
11187
|
-
import * as
|
|
11170
|
+
import * as path46 from "node:path";
|
|
11188
11171
|
|
|
11189
11172
|
// dist/clients/cache/rule-cache.js
|
|
11190
|
-
import * as
|
|
11191
|
-
import * as
|
|
11173
|
+
import * as fs17 from "node:fs";
|
|
11174
|
+
import * as path45 from "node:path";
|
|
11192
11175
|
var CACHE_VERSION = "v7";
|
|
11193
11176
|
function reportBundledRulesRootHealth() {
|
|
11194
11177
|
reportBundledResourceDirHealth("tree-sitter-queries-dir-missing", BUNDLED_QUERIES_ROOT, getBundledQueriesRootHealth(), "bundled tree-sitter query rules");
|
|
@@ -11200,12 +11183,12 @@ var RuleCache = class {
|
|
|
11200
11183
|
constructor(language, rootDir = process.cwd()) {
|
|
11201
11184
|
this.language = language;
|
|
11202
11185
|
reportBundledRulesRootHealth();
|
|
11203
|
-
this.cacheDir =
|
|
11204
|
-
this.cacheFile =
|
|
11186
|
+
this.cacheDir = path45.join(getProjectDataDir(rootDir), "cache");
|
|
11187
|
+
this.cacheFile = path45.join(this.cacheDir, `${language}-rules-${CACHE_VERSION}.json`);
|
|
11205
11188
|
}
|
|
11206
11189
|
ensureCacheDir() {
|
|
11207
|
-
if (!
|
|
11208
|
-
|
|
11190
|
+
if (!fs17.existsSync(this.cacheDir)) {
|
|
11191
|
+
fs17.mkdirSync(this.cacheDir, { recursive: true });
|
|
11209
11192
|
}
|
|
11210
11193
|
}
|
|
11211
11194
|
computeRuleHash(ruleFiles) {
|
|
@@ -11214,7 +11197,7 @@ var RuleCache = class {
|
|
|
11214
11197
|
get(ruleFiles) {
|
|
11215
11198
|
try {
|
|
11216
11199
|
this.ensureCacheDir();
|
|
11217
|
-
if (!
|
|
11200
|
+
if (!fs17.existsSync(this.cacheFile))
|
|
11218
11201
|
return null;
|
|
11219
11202
|
const currentHash = this.computeRuleHash(ruleFiles);
|
|
11220
11203
|
const cached = readJsonCache(this.cacheFile, (parsed) => {
|
|
@@ -11248,11 +11231,11 @@ var RuleCache = class {
|
|
|
11248
11231
|
// on their own — nothing ever read or removed them again once the version
|
|
11249
11232
|
// bumped. Delete every sibling for this language that isn't the current file.
|
|
11250
11233
|
pruneStaleVersions() {
|
|
11251
|
-
const currentName =
|
|
11234
|
+
const currentName = path45.basename(this.cacheFile);
|
|
11252
11235
|
const pattern = new RegExp(`^${this.language}-rules-v\\d+\\.json$`);
|
|
11253
11236
|
let dirents;
|
|
11254
11237
|
try {
|
|
11255
|
-
dirents =
|
|
11238
|
+
dirents = fs17.readdirSync(this.cacheDir);
|
|
11256
11239
|
} catch {
|
|
11257
11240
|
return;
|
|
11258
11241
|
}
|
|
@@ -11260,15 +11243,15 @@ var RuleCache = class {
|
|
|
11260
11243
|
if (name === currentName || !pattern.test(name))
|
|
11261
11244
|
continue;
|
|
11262
11245
|
try {
|
|
11263
|
-
|
|
11246
|
+
fs17.unlinkSync(path45.join(this.cacheDir, name));
|
|
11264
11247
|
} catch {
|
|
11265
11248
|
}
|
|
11266
11249
|
}
|
|
11267
11250
|
}
|
|
11268
11251
|
clear() {
|
|
11269
11252
|
try {
|
|
11270
|
-
if (
|
|
11271
|
-
|
|
11253
|
+
if (fs17.existsSync(this.cacheFile)) {
|
|
11254
|
+
fs17.unlinkSync(this.cacheFile);
|
|
11272
11255
|
}
|
|
11273
11256
|
} catch {
|
|
11274
11257
|
}
|
|
@@ -11582,7 +11565,7 @@ var treeSitterRunner = {
|
|
|
11582
11565
|
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
11583
11566
|
}
|
|
11584
11567
|
const filePath = ctx.filePath;
|
|
11585
|
-
const ext =
|
|
11568
|
+
const ext = path46.extname(filePath).toLowerCase();
|
|
11586
11569
|
const languageId = resolveTreeSitterLanguage(filePath);
|
|
11587
11570
|
if (!languageId) {
|
|
11588
11571
|
logTreeSitter({
|
|
@@ -11816,18 +11799,18 @@ var treeSitterRunner = {
|
|
|
11816
11799
|
var tree_sitter_default = treeSitterRunner;
|
|
11817
11800
|
|
|
11818
11801
|
// dist/clients/dispatch/runners/yamllint.js
|
|
11819
|
-
import * as
|
|
11802
|
+
import * as path47 from "node:path";
|
|
11820
11803
|
var yamllint = createAvailabilityChecker("yamllint", ".exe");
|
|
11821
11804
|
function parseYamllintParsable(raw, filePath, cwd) {
|
|
11822
11805
|
const diagnostics = [];
|
|
11823
|
-
const absTarget =
|
|
11806
|
+
const absTarget = path47.resolve(cwd, filePath);
|
|
11824
11807
|
for (const line of raw.split(/\r?\n/)) {
|
|
11825
11808
|
if (!line.trim())
|
|
11826
11809
|
continue;
|
|
11827
11810
|
const match = line.match(/^(.*?):(\d+):(\d+):\s*\[(error|warning)\]\s*(.*?)\s*\(([^)]+)\)\s*$/i);
|
|
11828
11811
|
if (!match)
|
|
11829
11812
|
continue;
|
|
11830
|
-
if (!pathsEqual(
|
|
11813
|
+
if (!pathsEqual(path47.resolve(cwd, match[1]), absTarget))
|
|
11831
11814
|
continue;
|
|
11832
11815
|
const severity = match[4].toLowerCase() === "error" ? "error" : "warning";
|
|
11833
11816
|
diagnostics.push({
|
|
@@ -11892,17 +11875,17 @@ var yamllintRunner = {
|
|
|
11892
11875
|
var yamllint_default = yamllintRunner;
|
|
11893
11876
|
|
|
11894
11877
|
// dist/clients/dispatch/runners/zig-check.js
|
|
11895
|
-
import * as
|
|
11878
|
+
import * as path48 from "node:path";
|
|
11896
11879
|
var zig = createAvailabilityChecker("zig", ".exe", ["version"]);
|
|
11897
11880
|
function parseZigOutput(raw, filePath, cwd) {
|
|
11898
11881
|
const diagnostics = [];
|
|
11899
|
-
const absTarget =
|
|
11882
|
+
const absTarget = path48.resolve(cwd, filePath);
|
|
11900
11883
|
for (const line of raw.split(/\r?\n/)) {
|
|
11901
11884
|
const match = line.match(/^(.*?):(\d+):(\d+):\s*(error|warning|note):\s*(.+)$/);
|
|
11902
11885
|
if (!match)
|
|
11903
11886
|
continue;
|
|
11904
11887
|
const [, rawFile, lineStr, colStr, level, message] = match;
|
|
11905
|
-
if (!pathsEqual(
|
|
11888
|
+
if (!pathsEqual(path48.resolve(cwd, rawFile.trim()), absTarget))
|
|
11906
11889
|
continue;
|
|
11907
11890
|
const severity = level === "error" ? "error" : "warning";
|
|
11908
11891
|
diagnostics.push({
|
|
@@ -11933,7 +11916,7 @@ var zigCheckRunner = {
|
|
|
11933
11916
|
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
11934
11917
|
}
|
|
11935
11918
|
const cmd = zig.getCommand(cwd);
|
|
11936
|
-
const absPath =
|
|
11919
|
+
const absPath = path48.resolve(cwd, ctx.filePath);
|
|
11937
11920
|
const result = await safeSpawnAsync(cmd, ["build-exe", absPath, "-fno-emit-bin"], { cwd, timeout: 3e4 });
|
|
11938
11921
|
if (result.error && !result.stdout && !result.stderr) {
|
|
11939
11922
|
return { status: "skipped", diagnostics: [], semantic: "none" };
|
|
@@ -12697,7 +12680,7 @@ async function runAstGrepWarningScan(filePath, cwd, pi, logContext, facts = sess
|
|
|
12697
12680
|
try {
|
|
12698
12681
|
const group = {
|
|
12699
12682
|
mode: "all",
|
|
12700
|
-
runnerIds: ["ast-grep"],
|
|
12683
|
+
runnerIds: ["ast-grep-napi"],
|
|
12701
12684
|
filterKinds: ["jsts"]
|
|
12702
12685
|
};
|
|
12703
12686
|
await runProviders(ctx);
|
|
@@ -13010,7 +12993,7 @@ function usableWarmWordIndex(index) {
|
|
|
13010
12993
|
return index?.forward ? index : void 0;
|
|
13011
12994
|
}
|
|
13012
12995
|
function acquireWarmWordIndex(cwd) {
|
|
13013
|
-
const key2 =
|
|
12996
|
+
const key2 = path49.resolve(cwd);
|
|
13014
12997
|
let entry = warmWordIndexes.get(key2);
|
|
13015
12998
|
if (!entry) {
|
|
13016
12999
|
const snapshot = loadProjectSnapshot(key2);
|
|
@@ -13048,7 +13031,7 @@ function adoptPublishedWarmWordIndex(cwd, published, trigger) {
|
|
|
13048
13031
|
const index = usableWarmWordIndex(published);
|
|
13049
13032
|
if (!index)
|
|
13050
13033
|
return;
|
|
13051
|
-
const key2 =
|
|
13034
|
+
const key2 = path49.resolve(cwd);
|
|
13052
13035
|
const entry = warmWordIndexes.get(key2);
|
|
13053
13036
|
if (!entry || entry.index)
|
|
13054
13037
|
return;
|
|
@@ -13115,7 +13098,7 @@ async function warmLspForFile(absPath, host) {
|
|
|
13115
13098
|
return;
|
|
13116
13099
|
let content;
|
|
13117
13100
|
try {
|
|
13118
|
-
content =
|
|
13101
|
+
content = fs18.readFileSync(absPath, "utf8");
|
|
13119
13102
|
} catch {
|
|
13120
13103
|
return;
|
|
13121
13104
|
}
|
|
@@ -13138,16 +13121,17 @@ async function warmLspForFile(absPath, host) {
|
|
|
13138
13121
|
}
|
|
13139
13122
|
}
|
|
13140
13123
|
async function analyzeFile(filePath, cwd, options = {}) {
|
|
13141
|
-
const absPath =
|
|
13124
|
+
const absPath = path49.isAbsolute(filePath) ? filePath : path49.resolve(cwd, filePath);
|
|
13142
13125
|
const host = createMcpHost({ "no-delta": true, ...options.flags }, cwd);
|
|
13143
13126
|
const observedAt = Date.now();
|
|
13127
|
+
const analysisRootMode = resolveAnalysisRoot(absPath, cwd);
|
|
13144
13128
|
if (options.warmLsp !== false) {
|
|
13145
13129
|
await warmLspForFile(absPath, host);
|
|
13146
13130
|
}
|
|
13147
13131
|
const start = Date.now();
|
|
13148
13132
|
const result = await dispatchLintWithResult(absPath, cwd, host, void 0, void 0, {
|
|
13149
13133
|
blockingOnly: options.blockingOnly ?? false,
|
|
13150
|
-
analysisRootMode
|
|
13134
|
+
analysisRootMode,
|
|
13151
13135
|
// #3791: this is a pull surface. Each call is an independent question,
|
|
13152
13136
|
// so the synthetic coverage notice must come back on every call rather
|
|
13153
13137
|
// than being latched once per session by the dispatcher — otherwise a
|
|
@@ -13164,7 +13148,7 @@ async function analyzeFile(filePath, cwd, options = {}) {
|
|
|
13164
13148
|
}
|
|
13165
13149
|
if (options.registerTurnState) {
|
|
13166
13150
|
try {
|
|
13167
|
-
const lineCount =
|
|
13151
|
+
const lineCount = fs18.readFileSync(absPath, "utf8").split("\n").length;
|
|
13168
13152
|
new CacheManager().addModifiedRange(absPath, { start: 1, end: lineCount }, true, cwd, options.ownerId ?? MCP_TURN_STATE_OWNER_ID, "mcp");
|
|
13169
13153
|
} catch {
|
|
13170
13154
|
}
|
|
@@ -13182,17 +13166,28 @@ async function analyzeFile(filePath, cwd, options = {}) {
|
|
|
13182
13166
|
try {
|
|
13183
13167
|
if (warmIndex) {
|
|
13184
13168
|
try {
|
|
13185
|
-
const content =
|
|
13186
|
-
|
|
13187
|
-
|
|
13188
|
-
|
|
13189
|
-
|
|
13190
|
-
|
|
13191
|
-
|
|
13192
|
-
|
|
13169
|
+
const content = fs18.readFileSync(absPath, "utf8");
|
|
13170
|
+
if (!canWriteAnalysisRoot(analysisRootMode)) {
|
|
13171
|
+
emitBounded("adopted_root_writer_skipped", `${absPath}:word-index`, {
|
|
13172
|
+
filePath: absPath,
|
|
13173
|
+
durationMs: 0,
|
|
13174
|
+
metadata: { writer: "word-index" }
|
|
13175
|
+
}, {
|
|
13176
|
+
ledgerKind: "adopted-root-writer-skipped",
|
|
13177
|
+
risingEdgePer: "identity"
|
|
13193
13178
|
});
|
|
13179
|
+
} else {
|
|
13180
|
+
const byteLength = Buffer.byteLength(content, "utf-8");
|
|
13181
|
+
if (byteLength > WORD_INDEX_MAX_BYTES) {
|
|
13182
|
+
await removeWordIndexDocumentAsync(warmIndex, absPath);
|
|
13183
|
+
} else {
|
|
13184
|
+
await updateWordIndexDocumentForEdit(warmIndex, {
|
|
13185
|
+
path: absPath,
|
|
13186
|
+
content
|
|
13187
|
+
});
|
|
13188
|
+
}
|
|
13189
|
+
scheduleWordIndexPersist(cwd, warmIndex);
|
|
13194
13190
|
}
|
|
13195
|
-
scheduleWordIndexPersist(cwd, warmIndex);
|
|
13196
13191
|
} catch {
|
|
13197
13192
|
}
|
|
13198
13193
|
}
|
|
@@ -13249,6 +13244,7 @@ async function analyzeFile(filePath, cwd, options = {}) {
|
|
|
13249
13244
|
}
|
|
13250
13245
|
|
|
13251
13246
|
export {
|
|
13247
|
+
DEFAULT_MAX_AGE_MS,
|
|
13252
13248
|
MCP_TURN_STATE_OWNER_ID,
|
|
13253
13249
|
CacheManager,
|
|
13254
13250
|
getDiagnosticTracker,
|
|
@@ -13300,8 +13296,6 @@ export {
|
|
|
13300
13296
|
evaluateAstGrepRules,
|
|
13301
13297
|
runProviders,
|
|
13302
13298
|
evaluateRules,
|
|
13303
|
-
demoteInferredProjectDiagnostics,
|
|
13304
|
-
demoteInferredProjectSweepResults,
|
|
13305
13299
|
resetPsScriptAnalyzerAvailability,
|
|
13306
13300
|
resetDispatchBaselines,
|
|
13307
13301
|
getAvailableRunners,
|