pi-lens 4.4.9 → 4.4.10
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-USER.md +6 -6
- package/CHANGELOG.md +80 -0
- package/README.md +2 -0
- package/dist/{chunk-CM6BDY4E.js → chunk-2ADRLTM2.js} +2 -2
- package/dist/{chunk-XO756WE5.js → chunk-2LVJQU3I.js} +15 -14
- package/dist/{chunk-W5E72HJA.js → chunk-3FRI5H4T.js} +13 -1
- package/dist/{chunk-N5CEGQPG.js → chunk-3HM4BUHR.js} +11 -11
- package/dist/{chunk-UAKO2M6B.js → chunk-3QWVOBZJ.js} +30 -30
- package/dist/{chunk-QB7T2PHK.js → chunk-46TQJSUE.js} +3 -1
- package/dist/{chunk-ZZN74OGD.js → chunk-4ITEFRDH.js} +3 -2
- package/dist/{chunk-C3YRO3EU.js → chunk-4NCDHTFI.js} +6 -6
- package/dist/{chunk-G22UNQID.js → chunk-6I44EDNQ.js} +10 -10
- package/dist/{chunk-OUYAUXAT.js → chunk-6MDM5MQT.js} +169 -56
- package/dist/{chunk-CDFJF5YD.js → chunk-7JX3RNG4.js} +1 -1
- package/dist/{chunk-PIIUNJIT.js → chunk-7WJ55KBN.js} +1 -1
- package/dist/{chunk-ZMMHHXSW.js → chunk-A5TEJZGJ.js} +1 -0
- package/dist/{chunk-HEA3EM23.js → chunk-ALIZWXHZ.js} +8 -8
- package/dist/{chunk-MQ4PPCJB.js → chunk-AON2QIJF.js} +32 -36
- package/dist/{chunk-DGKFWQK4.js → chunk-B2YUE6YD.js} +7 -7
- package/dist/{chunk-GQTQUNCG.js → chunk-B6HXETWY.js} +20 -20
- package/dist/{chunk-KR5VGMVT.js → chunk-BDR5MEZY.js} +9 -9
- package/dist/{chunk-MRLH4MYU.js → chunk-BGLS5SDN.js} +1 -1
- package/dist/{chunk-PRHYIA6X.js → chunk-BRESRQBE.js} +4 -4
- package/dist/{chunk-5GEYJJHG.js → chunk-C6AODRNU.js} +7 -7
- package/dist/{chunk-ZZSJAR76.js → chunk-CTB5BAJI.js} +24 -11
- package/dist/{chunk-IICERRFF.js → chunk-CYUJB552.js} +4 -4
- package/dist/{chunk-THYHUIDR.js → chunk-CZAWWXP6.js} +1 -1
- package/dist/{chunk-QJJKOHLH.js → chunk-DBS736MA.js} +27 -27
- package/dist/{chunk-XLAI7UYY.js → chunk-DOUAWKLO.js} +8 -8
- package/dist/{chunk-LAHHGNAY.js → chunk-DVRJBQOJ.js} +12 -12
- package/dist/{chunk-KV6GQOGN.js → chunk-E4VXKTBR.js} +28 -28
- package/dist/{chunk-XKFO2SZV.js → chunk-F6FT6BVQ.js} +26 -26
- package/dist/{chunk-VWLSU3XV.js → chunk-FCQSZQAT.js} +1 -1
- package/dist/{chunk-X5BJ3G2P.js → chunk-FOEPIX76.js} +1 -1
- package/dist/{chunk-F6BEQWAK.js → chunk-GMC4ZGYR.js} +4 -4
- package/dist/{chunk-TOE2RRCS.js → chunk-GTTMQ6XB.js} +1 -1
- package/dist/{chunk-5YSEQHJN.js → chunk-GUGKKGG7.js} +1 -1
- package/dist/{chunk-OSEKJEUU.js → chunk-GVWIU7M7.js} +1 -1
- package/dist/{chunk-TMNUTMT5.js → chunk-H65TYP6V.js} +25 -4
- package/dist/{chunk-7R5GZIA6.js → chunk-HILZE4BQ.js} +5 -4
- package/dist/{chunk-HYSKJMZK.js → chunk-HSYFLOZY.js} +2 -2
- package/dist/{chunk-V2WDBOLZ.js → chunk-I32RSMH6.js} +7 -7
- package/dist/chunk-I74RQGKA.js +88 -0
- package/dist/{chunk-RNXOWDM6.js → chunk-IDCTDKIA.js} +3 -3
- package/dist/{chunk-TYHPVE5H.js → chunk-IK4YS3KC.js} +8 -8
- package/dist/{chunk-ZCQBNPRH.js → chunk-IL6PIV33.js} +2 -2
- package/dist/{chunk-6GPB3JLL.js → chunk-J6BR5XN2.js} +2 -2
- package/dist/{chunk-UC5AXW5Z.js → chunk-JKOZ2Z4U.js} +6 -6
- package/dist/{chunk-WSSLVMDA.js → chunk-JZQGRARR.js} +7 -7
- package/dist/{chunk-7UTSNTWM.js → chunk-K6WIBVMK.js} +4 -3
- package/dist/{chunk-QVBOXT3L.js → chunk-KDCIG23C.js} +6 -6
- package/dist/{chunk-NOWH2VA2.js → chunk-KFRDFAOE.js} +4 -4
- package/dist/{chunk-NMUSOZ2D.js → chunk-KJ3AHOCK.js} +6 -6
- package/dist/{chunk-E65WJVI5.js → chunk-KSTQ4VXT.js} +5 -5
- package/dist/{chunk-4ENEJHF4.js → chunk-MAD4QJTP.js} +9 -9
- package/dist/{chunk-KXMJLOZF.js → chunk-NBM7PNBP.js} +7 -7
- package/dist/{chunk-7YTRG6YW.js → chunk-NE4EFHJX.js} +1 -1
- package/dist/{chunk-AACN5GNE.js → chunk-NPNFGYLV.js} +3 -1
- package/dist/{chunk-H3BVMK47.js → chunk-OPFNQBS5.js} +5 -5
- package/dist/{chunk-WTB4GKMH.js → chunk-OTSTS7L2.js} +11 -2
- package/dist/{chunk-JUZ67QZQ.js → chunk-PTSA6QKL.js} +7 -7
- package/dist/{chunk-ZPM7ZIFL.js → chunk-Q2VCKC3X.js} +3 -3
- package/dist/{chunk-2VZ3VN3N.js → chunk-QHOTTC4A.js} +2 -2
- package/dist/{chunk-L7O774U7.js → chunk-QL37SGTS.js} +105 -13
- package/dist/{chunk-FRUBVFXV.js → chunk-QMV2APEH.js} +27 -27
- package/dist/{chunk-L4Y3ROKQ.js → chunk-QSCZAP24.js} +3 -3
- package/dist/{chunk-IILEH3ZC.js → chunk-QUPYLQA4.js} +4 -4
- package/dist/{chunk-3NPWO5UO.js → chunk-QUQY3IME.js} +4 -4
- package/dist/{chunk-FGNSESAC.js → chunk-QWTHFFU6.js} +8 -8
- package/dist/{chunk-EKNYSXFB.js → chunk-RQRKIRFY.js} +5 -5
- package/dist/{chunk-NCLO6E6N.js → chunk-S3WFVG5P.js} +14 -21
- package/dist/{chunk-RTFMDIKV.js → chunk-SG2JQ2YP.js} +1 -1
- package/dist/{chunk-VO4JFPTV.js → chunk-SJQUWQR6.js} +2 -2
- package/dist/{chunk-SLSMJPEF.js → chunk-SKVNHCT5.js} +32 -32
- package/dist/{chunk-3HTZDY3C.js → chunk-TJQSYX3J.js} +3 -3
- package/dist/{chunk-RNJFRXEN.js → chunk-TLWFZ66Y.js} +3 -3
- package/dist/{chunk-LWOM6LVS.js → chunk-TN5CWX5D.js} +26 -26
- package/dist/{chunk-UTJP6WOS.js → chunk-TQHOKMVZ.js} +11 -11
- package/dist/{chunk-N56BNAA6.js → chunk-TYHOEX4V.js} +15 -15
- package/dist/{chunk-QP33NKYC.js → chunk-UNBRHPHJ.js} +10 -10
- package/dist/{chunk-EY6LY2HO.js → chunk-UOO4D2TK.js} +11 -11
- package/dist/{chunk-47UCC4MM.js → chunk-UY745U35.js} +1 -1
- package/dist/{chunk-ZDMFGACN.js → chunk-V7F7JHS5.js} +71 -55
- package/dist/{chunk-PBZNYHMM.js → chunk-VGTBLTPN.js} +4 -4
- package/dist/{chunk-L6WBJGQS.js → chunk-VPFRU5IG.js} +1 -1
- package/dist/{chunk-Q6JQKWPK.js → chunk-VS2L7QDI.js} +8 -8
- package/dist/{chunk-PXQ45SGD.js → chunk-W4CUK5G6.js} +2 -2
- package/dist/{chunk-MKPDIAZH.js → chunk-WAA63ZJV.js} +1 -1
- package/dist/{chunk-J3Q2NYJR.js → chunk-WS3UFJOU.js} +1 -1
- package/dist/{chunk-T5QSLSMM.js → chunk-XAFZJEXY.js} +16 -16
- package/dist/{chunk-YOXCCJDF.js → chunk-XPGH5O74.js} +56 -46
- package/dist/{chunk-UXTQ3QPD.js → chunk-Y3EHLUPL.js} +2 -2
- package/dist/{chunk-HSOBIN22.js → chunk-YF4G5NN5.js} +2 -2
- package/dist/{chunk-SIQHOB6P.js → chunk-YQA34KAF.js} +7 -7
- package/dist/{chunk-V67D6TMU.js → chunk-YT2VR4SL.js} +4 -4
- package/dist/{chunk-CJS6WE66.js → chunk-ZOPXB2KK.js} +11 -11
- package/dist/{chunk-H6FLQ5NW.js → chunk-ZPFLHB3R.js} +11 -11
- package/dist/{chunk-ZVCDHYWZ.js → chunk-ZZDVGCGG.js} +6 -6
- package/dist/index.js +537 -269
- package/dist/mcp/analyze-cli.js +6 -6
- package/dist/mcp/cli.js +32 -32
- package/dist/mcp/server.js +109 -109
- package/dist/mcp/worker.js +49 -49
- package/dist/probes/installer.js +13 -13
- package/docs/agent-guide.md +2 -1
- package/docs/agent-tools.md +13 -2
- package/docs/configuration.md +9 -4
- package/docs/defect-shapes.md +15 -1
- package/docs/features.md +11 -1
- package/docs/globalconfig.md +13 -0
- package/docs/invariants/language-config.md +9 -1
- package/docs/language-coverage.md +66 -0
- package/docs/lsp-capability-matrix.md +66 -20
- package/docs/lsp-idle-eviction.md +17 -13
- package/docs/pi-lens-fixer.md +8 -6
- package/docs/pi-lens-merge-policy.md +5 -1
- package/docs/pi-lens-release.md +3 -2
- package/docs/pi-lens-reviewer.md +52 -11
- package/docs/servercapabilities.md +1 -1
- package/docs/settings.md +7 -4
- package/docs/usage.md +1 -0
- package/package.json +2 -2
- package/scripts/download-grammars.js +10 -0
- package/scripts/grammars.lock.json +7 -0
- package/vendor/grammars/tree-sitter-groovy.wasm +0 -0
- package/dist/chunk-TGQDAG4B.js +0 -88
package/dist/index.js
CHANGED
|
@@ -5679,6 +5679,14 @@ var init_lens_flag_registry = __esm({
|
|
|
5679
5679
|
default: false,
|
|
5680
5680
|
scope: "global"
|
|
5681
5681
|
},
|
|
5682
|
+
{
|
|
5683
|
+
name: "no-read-expansion",
|
|
5684
|
+
description: "Disable automatic read widening while keeping the read-before-edit monitor active. Also via readGuard.expandReads=false in ~/.pi-lens/config.json.",
|
|
5685
|
+
configKey: "readGuard.expandReads",
|
|
5686
|
+
negated: true,
|
|
5687
|
+
default: false,
|
|
5688
|
+
scope: "global"
|
|
5689
|
+
},
|
|
5682
5690
|
{
|
|
5683
5691
|
name: "no-lens-context",
|
|
5684
5692
|
description: "Disable automatic context injection (session-start guidance, turn-end & test findings) while keeping tools, LSP, read-guard, and formatting active. Toggle with /lens-context-toggle. Also via contextInjection.enabled=false in config or PI_LENS_NO_CONTEXT_INJECTION=1.",
|
|
@@ -5798,7 +5806,11 @@ var init_lens_flag_registry = __esm({
|
|
|
5798
5806
|
];
|
|
5799
5807
|
GLOBAL_ONLY_NON_FLAG_KEYS = [
|
|
5800
5808
|
"actionableWarnings.autoFix.maxFixes",
|
|
5801
|
-
"dispatch.runnerTimeoutFloorMs"
|
|
5809
|
+
"dispatch.runnerTimeoutFloorMs",
|
|
5810
|
+
// #5306: the explicit single-file diagnostics query's line limit. `lsp` is
|
|
5811
|
+
// recognized at project scope (the LSP loader's namespace), so a project file
|
|
5812
|
+
// carrying this is told it does nothing there.
|
|
5813
|
+
"lsp.queryMaxFileLines"
|
|
5802
5814
|
];
|
|
5803
5815
|
PROJECT_NON_FLAG_CONFIG_SECTIONS = [
|
|
5804
5816
|
"ignore",
|
|
@@ -14138,7 +14150,12 @@ async function sampleProcesses(pids) {
|
|
|
14138
14150
|
return await sampleProcessesWindows(valid);
|
|
14139
14151
|
}
|
|
14140
14152
|
try {
|
|
14141
|
-
const stats = await (0, import_pidusage.default)(valid)
|
|
14153
|
+
const stats = await (0, import_pidusage.default)(valid).catch((err) => {
|
|
14154
|
+
if (err instanceof Error && err.message === "No matching pid found") {
|
|
14155
|
+
return {};
|
|
14156
|
+
}
|
|
14157
|
+
throw err;
|
|
14158
|
+
});
|
|
14142
14159
|
for (const pid of valid) {
|
|
14143
14160
|
const stat6 = stats[String(pid)];
|
|
14144
14161
|
if (!stat6)
|
|
@@ -18759,6 +18776,15 @@ function loadPiLensGlobalConfig(configPath) {
|
|
|
18759
18776
|
if (startupConfig.mode !== void 0 || startupConfig.scans !== void 0)
|
|
18760
18777
|
config.startup = startupConfig;
|
|
18761
18778
|
}
|
|
18779
|
+
const lspSection = asConfigObject2(raw.lsp);
|
|
18780
|
+
if (lspSection && "queryMaxFileLines" in lspSection) {
|
|
18781
|
+
const lines = lspSection.queryMaxFileLines;
|
|
18782
|
+
if (typeof lines === "number" && Number.isInteger(lines) && lines >= LSP_QUERY_MAX_FILE_LINES_MIN && lines <= LSP_QUERY_MAX_FILE_LINES_MAX) {
|
|
18783
|
+
config.lsp = { ...config.lsp, queryMaxFileLines: lines };
|
|
18784
|
+
} else {
|
|
18785
|
+
warnInvalid(`lsp.queryMaxFileLines must be a whole number from ${LSP_QUERY_MAX_FILE_LINES_MIN} to ${LSP_QUERY_MAX_FILE_LINES_MAX}; ignored`, "PILENS_CFG_0005");
|
|
18786
|
+
}
|
|
18787
|
+
}
|
|
18762
18788
|
const dispatch = asConfigObject2(raw.dispatch);
|
|
18763
18789
|
if (dispatch) {
|
|
18764
18790
|
const floor = dispatch.runnerTimeoutFloorMs;
|
|
@@ -18839,6 +18865,9 @@ function getGlobalIgnorePatterns(configPath) {
|
|
|
18839
18865
|
function getGlobalActionableWarningMaxFixes(configPath) {
|
|
18840
18866
|
return loadPiLensGlobalConfig(configPath)?.actionableWarnings?.autoFix?.maxFixes;
|
|
18841
18867
|
}
|
|
18868
|
+
function getGlobalLspQueryMaxFileLines(configPath) {
|
|
18869
|
+
return loadPiLensGlobalConfig(configPath)?.lsp?.queryMaxFileLines;
|
|
18870
|
+
}
|
|
18842
18871
|
function resolvePiLensFlagWithSource(name2, value, config, projectConfig, editedFilePath, projectRoot) {
|
|
18843
18872
|
const spec = getLensFlagSpec(name2);
|
|
18844
18873
|
if (spec?.env && process.env[spec.env] === "1") {
|
|
@@ -18873,6 +18902,7 @@ function resolvePiLensFlagWithSource(name2, value, config, projectConfig, edited
|
|
|
18873
18902
|
function resolvePiLensFlag(name2, value, config, projectConfig, editedFilePath, projectRoot) {
|
|
18874
18903
|
return resolvePiLensFlagWithSource(name2, value, config, projectConfig, editedFilePath, projectRoot).value;
|
|
18875
18904
|
}
|
|
18905
|
+
var LSP_QUERY_MAX_FILE_LINES_MIN, LSP_QUERY_MAX_FILE_LINES_MAX;
|
|
18876
18906
|
var init_lens_config = __esm({
|
|
18877
18907
|
"dist/clients/lens-config.js"() {
|
|
18878
18908
|
"use strict";
|
|
@@ -18886,6 +18916,8 @@ var init_lens_config = __esm({
|
|
|
18886
18916
|
init_project_lens_config();
|
|
18887
18917
|
init_path_utils();
|
|
18888
18918
|
init_tool_config();
|
|
18919
|
+
LSP_QUERY_MAX_FILE_LINES_MIN = 5e3;
|
|
18920
|
+
LSP_QUERY_MAX_FILE_LINES_MAX = 4e4;
|
|
18889
18921
|
}
|
|
18890
18922
|
});
|
|
18891
18923
|
|
|
@@ -20335,6 +20367,7 @@ function describeBundledResourceHealth(health, dir, emptyDescription = `${dir} e
|
|
|
20335
20367
|
return `cannot read ${dir} (${health.fsErrorCode})`;
|
|
20336
20368
|
case "empty":
|
|
20337
20369
|
return emptyDescription;
|
|
20370
|
+
case "healthy":
|
|
20338
20371
|
default:
|
|
20339
20372
|
return `${dir}: unexpected health status`;
|
|
20340
20373
|
}
|
|
@@ -30980,6 +31013,8 @@ function describeInstallAttempt(attempt, options = {}) {
|
|
|
30980
31013
|
install: "unavailable",
|
|
30981
31014
|
...reason && { installReason: reason }
|
|
30982
31015
|
};
|
|
31016
|
+
case "declined":
|
|
31017
|
+
case "skipped":
|
|
30983
31018
|
default:
|
|
30984
31019
|
return {
|
|
30985
31020
|
install: "not-attempted",
|
|
@@ -32196,6 +32231,31 @@ var init_availability_probe_flight = __esm({
|
|
|
32196
32231
|
});
|
|
32197
32232
|
|
|
32198
32233
|
// dist/clients/package-manager.js
|
|
32234
|
+
var package_manager_exports = {};
|
|
32235
|
+
__export(package_manager_exports, {
|
|
32236
|
+
NODE_MODULES_BIN_DIRS: () => NODE_MODULES_BIN_DIRS,
|
|
32237
|
+
PROJECT_LOCAL_BIN_DIRS: () => PROJECT_LOCAL_BIN_DIRS,
|
|
32238
|
+
VENDOR_BIN_DIRS: () => VENDOR_BIN_DIRS,
|
|
32239
|
+
VENV_BIN_DIRS: () => VENV_BIN_DIRS,
|
|
32240
|
+
_resetPackageManagerCache: () => _resetPackageManagerCache,
|
|
32241
|
+
allAvailableGlobalBinDirs: () => allAvailableGlobalBinDirs,
|
|
32242
|
+
commandSearchReachesProject: () => commandSearchReachesProject,
|
|
32243
|
+
detectNodePackageManager: () => detectNodePackageManager,
|
|
32244
|
+
findGlobalBinary: () => findGlobalBinary,
|
|
32245
|
+
findLocalBinAt: () => findLocalBinAt,
|
|
32246
|
+
findLocalBinUpwards: () => findLocalBinUpwards,
|
|
32247
|
+
findLocalBinsAt: () => findLocalBinsAt,
|
|
32248
|
+
findNodeToolBinary: () => findNodeToolBinary,
|
|
32249
|
+
installArgs: () => installArgs,
|
|
32250
|
+
isLocalBinTrustRefusal: () => isLocalBinTrustRefusal,
|
|
32251
|
+
isProjectLocalBinPath: () => isProjectLocalBinPath,
|
|
32252
|
+
localBinPath: () => localBinPath,
|
|
32253
|
+
pmBinary: () => pmBinary,
|
|
32254
|
+
primeGlobalBinDirs: () => primeGlobalBinDirs,
|
|
32255
|
+
resolveNodePackageManager: () => resolveNodePackageManager,
|
|
32256
|
+
runScriptArgs: () => runScriptArgs,
|
|
32257
|
+
updateArgs: () => updateArgs
|
|
32258
|
+
});
|
|
32199
32259
|
import * as fs42 from "node:fs";
|
|
32200
32260
|
import * as os14 from "node:os";
|
|
32201
32261
|
import * as path48 from "node:path";
|
|
@@ -32400,6 +32460,10 @@ async function allAvailableGlobalBinDirs(onTransient) {
|
|
|
32400
32460
|
}
|
|
32401
32461
|
return dirs;
|
|
32402
32462
|
}
|
|
32463
|
+
function primeGlobalBinDirs() {
|
|
32464
|
+
allAvailableGlobalBinDirs().catch(() => {
|
|
32465
|
+
});
|
|
32466
|
+
}
|
|
32403
32467
|
async function findGlobalBinary(command, windowsExt = ".cmd") {
|
|
32404
32468
|
const candidates = onWindows() ? [`${command}${windowsExt}`, `${command}.exe`, command] : [command];
|
|
32405
32469
|
try {
|
|
@@ -32419,6 +32483,9 @@ async function findGlobalBinary(command, windowsExt = ".cmd") {
|
|
|
32419
32483
|
}
|
|
32420
32484
|
return void 0;
|
|
32421
32485
|
}
|
|
32486
|
+
function isLocalBinTrustRefusal(value) {
|
|
32487
|
+
return typeof value === "object" && value !== null && value.kind === "refused-by-trust";
|
|
32488
|
+
}
|
|
32422
32489
|
function localBinPath(value) {
|
|
32423
32490
|
return typeof value === "string" ? value : void 0;
|
|
32424
32491
|
}
|
|
@@ -35241,6 +35308,22 @@ function getArchiveBinaryCandidates(binaryName, platform, assetName) {
|
|
|
35241
35308
|
candidates.add(`${binaryName}.cmd`);
|
|
35242
35309
|
return [...candidates];
|
|
35243
35310
|
}
|
|
35311
|
+
async function firstVerifiedBinary(candidates, onTransient, verificationArgs, verificationTimeoutMs) {
|
|
35312
|
+
for (const candidate of candidates) {
|
|
35313
|
+
try {
|
|
35314
|
+
await fs46.access(candidate);
|
|
35315
|
+
if (isUntrustedProjectPath(candidate)) {
|
|
35316
|
+
recordProjectCommandRefusal(candidate);
|
|
35317
|
+
continue;
|
|
35318
|
+
}
|
|
35319
|
+
if (await verifyToolBinary(candidate, void 0, onTransient, verificationTimeoutMs, verificationArgs)) {
|
|
35320
|
+
return candidate;
|
|
35321
|
+
}
|
|
35322
|
+
} catch {
|
|
35323
|
+
}
|
|
35324
|
+
}
|
|
35325
|
+
return void 0;
|
|
35326
|
+
}
|
|
35244
35327
|
async function findNpmGlobalToolPath(binaryName, onTransient, verificationArgs = ["--version"], verificationTimeoutMs = 1e4) {
|
|
35245
35328
|
const isWindows3 = process.platform === "win32";
|
|
35246
35329
|
const binDirs = await getNpmGlobalBinCandidates(onTransient);
|
|
@@ -35249,19 +35332,9 @@ async function findNpmGlobalToolPath(binaryName, onTransient, verificationArgs =
|
|
|
35249
35332
|
path53.join(dir, `${binaryName}.cmd`),
|
|
35250
35333
|
path53.join(dir, `${binaryName}.exe`)
|
|
35251
35334
|
] : [path53.join(dir, binaryName)];
|
|
35252
|
-
|
|
35253
|
-
|
|
35254
|
-
|
|
35255
|
-
if (isUntrustedProjectPath(candidate)) {
|
|
35256
|
-
recordProjectCommandRefusal(candidate);
|
|
35257
|
-
continue;
|
|
35258
|
-
}
|
|
35259
|
-
if (await verifyToolBinary(candidate, void 0, onTransient, verificationTimeoutMs, verificationArgs)) {
|
|
35260
|
-
return candidate;
|
|
35261
|
-
}
|
|
35262
|
-
} catch {
|
|
35263
|
-
}
|
|
35264
|
-
}
|
|
35335
|
+
const verified = await firstVerifiedBinary(candidates, onTransient, verificationArgs, verificationTimeoutMs);
|
|
35336
|
+
if (verified)
|
|
35337
|
+
return verified;
|
|
35265
35338
|
}
|
|
35266
35339
|
return void 0;
|
|
35267
35340
|
}
|
|
@@ -35317,19 +35390,9 @@ async function findPipUserToolPath(binaryName, onTransient, verificationArgs = [
|
|
|
35317
35390
|
path53.join(dir, `${binaryName}.cmd`),
|
|
35318
35391
|
path53.join(dir, binaryName)
|
|
35319
35392
|
] : [path53.join(dir, binaryName)];
|
|
35320
|
-
|
|
35321
|
-
|
|
35322
|
-
|
|
35323
|
-
if (isUntrustedProjectPath(candidate)) {
|
|
35324
|
-
recordProjectCommandRefusal(candidate);
|
|
35325
|
-
continue;
|
|
35326
|
-
}
|
|
35327
|
-
if (await verifyToolBinary(candidate, void 0, onTransient, verificationTimeoutMs, verificationArgs)) {
|
|
35328
|
-
return candidate;
|
|
35329
|
-
}
|
|
35330
|
-
} catch {
|
|
35331
|
-
}
|
|
35332
|
-
}
|
|
35393
|
+
const verified = await firstVerifiedBinary(candidates, onTransient, verificationArgs, verificationTimeoutMs);
|
|
35394
|
+
if (verified)
|
|
35395
|
+
return verified;
|
|
35333
35396
|
}
|
|
35334
35397
|
}
|
|
35335
35398
|
return void 0;
|
|
@@ -38698,22 +38761,23 @@ async function buildAugmentedPath(basePath) {
|
|
|
38698
38761
|
return toAppend.join(path54.delimiter);
|
|
38699
38762
|
return `${basePath}${path54.delimiter}${toAppend.join(path54.delimiter)}`;
|
|
38700
38763
|
}
|
|
38701
|
-
function isCmdShimValid(cmdPath) {
|
|
38764
|
+
function isCmdShimValid(cmdPath, cwd) {
|
|
38765
|
+
const shimFile = cwd === void 0 ? cmdPath : path54.resolve(cwd, cmdPath);
|
|
38702
38766
|
try {
|
|
38703
|
-
const content = fs48.readFileSync(
|
|
38767
|
+
const content = fs48.readFileSync(shimFile, "utf-8");
|
|
38704
38768
|
const match2 = content.match(/"%~dp0[/\\]\.\.[/\\]((?:[\w./@-]|\\)+\.(?:mjs|cjs|js))"/i);
|
|
38705
38769
|
if (!match2)
|
|
38706
38770
|
return true;
|
|
38707
38771
|
const relPath = match2[1].replace(/[/\\]/g, path54.sep);
|
|
38708
|
-
const target = path54.resolve(path54.dirname(
|
|
38772
|
+
const target = path54.resolve(path54.dirname(shimFile), "..", relPath);
|
|
38709
38773
|
return fs48.existsSync(target);
|
|
38710
38774
|
} catch {
|
|
38711
|
-
return
|
|
38775
|
+
return statIsFile(shimFile);
|
|
38712
38776
|
}
|
|
38713
38777
|
}
|
|
38714
38778
|
function windowsCommandPresence(evidence) {
|
|
38715
38779
|
const { command, spawnCommand } = evidence;
|
|
38716
|
-
if (/\.(cmd|bat)$/i.test(spawnCommand) && isCmdShimValid(spawnCommand)) {
|
|
38780
|
+
if (/\.(cmd|bat)$/i.test(spawnCommand) && isCmdShimValid(spawnCommand, evidence.cwd)) {
|
|
38717
38781
|
return "present";
|
|
38718
38782
|
}
|
|
38719
38783
|
if (evidence.isBareCommand) {
|
|
@@ -38721,10 +38785,10 @@ function windowsCommandPresence(evidence) {
|
|
|
38721
38785
|
}
|
|
38722
38786
|
return statIsFile(spawnCommand) || resolveWindowsCommandForEnvironment(spawnCommand, evidence.cwd, evidence.env) ? "present" : "absent";
|
|
38723
38787
|
}
|
|
38724
|
-
function isMissingWindowsStartupCommand(spawnCommand, presence) {
|
|
38788
|
+
function isMissingWindowsStartupCommand(spawnCommand, presence, cwd) {
|
|
38725
38789
|
if (!isWindows2)
|
|
38726
38790
|
return false;
|
|
38727
|
-
if (/\.(cmd|bat)$/i.test(spawnCommand) && !isCmdShimValid(spawnCommand)) {
|
|
38791
|
+
if (/\.(cmd|bat)$/i.test(spawnCommand) && !isCmdShimValid(spawnCommand, cwd)) {
|
|
38728
38792
|
return true;
|
|
38729
38793
|
}
|
|
38730
38794
|
return presence === "absent";
|
|
@@ -38976,7 +39040,7 @@ async function launchLSP(command, args = [], options = {}) {
|
|
|
38976
39040
|
}
|
|
38977
39041
|
if (isBareCommand)
|
|
38978
39042
|
refuseProjectLookup(command, spawnCommand, cwd, env);
|
|
38979
|
-
if (isWindows2 && /\.(cmd|bat)$/i.test(spawnCommand) && !isCmdShimValid(spawnCommand)) {
|
|
39043
|
+
if (isWindows2 && /\.(cmd|bat)$/i.test(spawnCommand) && !isCmdShimValid(spawnCommand, cwd)) {
|
|
38980
39044
|
logSessionStart2(`lsp cmd-shim-invalid: ${spawnCommand} target missing \u2014 skipping candidate`);
|
|
38981
39045
|
const cause = Object.assign(new Error(`LSP .cmd shim target not found: ${spawnCommand}`), { code: "ENOENT" });
|
|
38982
39046
|
throw await classifySpawnFailure(cause, { command, cwd });
|
|
@@ -39014,7 +39078,7 @@ async function launchLSP(command, args = [], options = {}) {
|
|
|
39014
39078
|
if (proc.exitCode !== null || proc.killed) {
|
|
39015
39079
|
const message = `LSP server ${command} exited immediately (code: ${proc.exitCode}). The binary may be missing or corrupted.`;
|
|
39016
39080
|
const failure = new Error(message);
|
|
39017
|
-
if (proc.exitCode === 1 && isMissingWindowsStartupCommand(spawnCommand, commandPresence)) {
|
|
39081
|
+
if (proc.exitCode === 1 && isMissingWindowsStartupCommand(spawnCommand, commandPresence, cwd)) {
|
|
39018
39082
|
throw new SpawnFailureError("tool-not-found", message, failure);
|
|
39019
39083
|
}
|
|
39020
39084
|
throw failure;
|
|
@@ -39052,7 +39116,7 @@ async function launchLSP(command, args = [], options = {}) {
|
|
|
39052
39116
|
const errorMsg = isWindowsCmd && code === 1 ? `npm .cmd shim failed (underlying binary not installed). Run 'npm install' in this project or use a global installation.` : `The binary may be missing or corrupted.`;
|
|
39053
39117
|
const message = `LSP server ${command} exited immediately with code ${code}. ${errorMsg}${formatStartupStderr(startupStderr)}`;
|
|
39054
39118
|
const failure = new Error(message);
|
|
39055
|
-
if (code === 1 && isMissingWindowsStartupCommand(spawnCommand, commandPresence)) {
|
|
39119
|
+
if (code === 1 && isMissingWindowsStartupCommand(spawnCommand, commandPresence, cwd)) {
|
|
39056
39120
|
reject(new SpawnFailureError("tool-not-found", message, failure));
|
|
39057
39121
|
return;
|
|
39058
39122
|
}
|
|
@@ -39391,7 +39455,10 @@ function resolveLanguage(filePath) {
|
|
|
39391
39455
|
}
|
|
39392
39456
|
return void 0;
|
|
39393
39457
|
}
|
|
39394
|
-
|
|
39458
|
+
function isTypeScriptFile(filePath) {
|
|
39459
|
+
return TYPESCRIPT_EXTENSIONS.has(extensionOf(filePath));
|
|
39460
|
+
}
|
|
39461
|
+
var LANGUAGES, BY_EXTENSION, BY_FILENAME, FILENAME_PATTERNS, BY_ID, GRAMMAR_TO_EXTENSIONS, BY_KIND, TYPESCRIPT_EXTENSIONS, EXTENSION_TO_LSP_ID, EXTENSION_TO_GRAMMAR, KIND_TO_GRAMMAR, SCAN_LANGUAGE_PRIORITY;
|
|
39395
39462
|
var init_language_registry = __esm({
|
|
39396
39463
|
"dist/clients/language-registry.js"() {
|
|
39397
39464
|
"use strict";
|
|
@@ -39502,12 +39569,16 @@ var init_language_registry = __esm({
|
|
|
39502
39569
|
{ id: "go-mod", extensions: [".mod", ".sum"], lspId: "go" },
|
|
39503
39570
|
{ id: "graphql", extensions: [".graphql", ".gql"] },
|
|
39504
39571
|
// Groovy source plus the two named Gradle scripts and the Jenkins pipeline
|
|
39505
|
-
// entrypoint (#5235)
|
|
39572
|
+
// entrypoint (#5235). The vendored grammar reaches `.groovy .gvy .gy .gsh`
|
|
39573
|
+
// by extension and `Jenkinsfile`/`build.gradle`/`settings.gradle` by kind;
|
|
39574
|
+
// `.gradle` stays out of `grammarExtensions` because it would claim every
|
|
39575
|
+
// `.gradle` file, which `GROOVY_FILENAMES` deliberately does not.
|
|
39506
39576
|
{
|
|
39507
39577
|
id: "groovy",
|
|
39508
39578
|
kind: "groovy",
|
|
39509
39579
|
extensions: [".groovy", ".gvy", ".gy", ".gsh"],
|
|
39510
|
-
filenames: GROOVY_FILENAMES
|
|
39580
|
+
filenames: GROOVY_FILENAMES,
|
|
39581
|
+
grammar: "groovy"
|
|
39511
39582
|
},
|
|
39512
39583
|
{ id: "haskell", kind: "haskell", extensions: [".hs", ".lhs"] },
|
|
39513
39584
|
{ id: "helm", kind: "helm-template", extensions: [".tpl"] },
|
|
@@ -39751,6 +39822,7 @@ var init_language_registry = __esm({
|
|
|
39751
39822
|
BY_KIND.set(kind, resolved2);
|
|
39752
39823
|
}
|
|
39753
39824
|
}
|
|
39825
|
+
TYPESCRIPT_EXTENSIONS = new Set(LANGUAGES.flatMap((entry) => entry.id === "typescript" || entry.id === "typescriptreact" ? entry.extensions : []));
|
|
39754
39826
|
EXTENSION_TO_LSP_ID = Object.freeze(Object.fromEntries(LANGUAGES.flatMap((entry) => entry.extensions.map((extension) => [extension, lspLanguageId(entry)]))));
|
|
39755
39827
|
EXTENSION_TO_GRAMMAR = Object.freeze(Object.fromEntries(LANGUAGES.flatMap((entry) => grammarExtensionsOf(entry).map((extension) => [extension, entry.grammar]))));
|
|
39756
39828
|
KIND_TO_GRAMMAR = Object.freeze(Object.fromEntries([...BY_KIND.entries()].filter(([, entry]) => Boolean(entry.grammar)).map(([kind, entry]) => [kind, entry.grammar])));
|
|
@@ -40784,13 +40856,12 @@ var init_strategies = __esm({
|
|
|
40784
40856
|
// clean→clean edit (docs/lsp-capability-matrix.md, re-confirmed
|
|
40785
40857
|
// 2026-07-12). It's the lone core-set tier-3 server, which is exactly
|
|
40786
40858
|
// why the cascade lane's in-lane wait is worth skipping for it
|
|
40787
|
-
// specifically. Applies to the CLASSIC server only (#524/#529/#558)
|
|
40859
|
+
// specifically. Applies to the CLASSIC server only (#524/#529/#558/#5348)
|
|
40788
40860
|
// — TS7's native `tsc --lsp --stdio` variant shares this
|
|
40789
|
-
// "typescript" server id
|
|
40790
|
-
//
|
|
40791
|
-
//
|
|
40792
|
-
//
|
|
40793
|
-
// native-ts7 instance.
|
|
40861
|
+
// "typescript" server id; `getStrategy` answers it with
|
|
40862
|
+
// NATIVE_TS7_DIAGNOSTIC_STRATEGY and wait-policy/classification.ts's
|
|
40863
|
+
// classifier checks the live snapshot's launchVariant, so neither
|
|
40864
|
+
// applies this flag to a native-ts7 instance.
|
|
40794
40865
|
silentOnClean: true
|
|
40795
40866
|
},
|
|
40796
40867
|
"rust-analyzer": {
|
|
@@ -41126,8 +41197,12 @@ var init_strategies = __esm({
|
|
|
41126
41197
|
NATIVE_TS7_DIAGNOSTIC_STRATEGY = {
|
|
41127
41198
|
...SERVER_DIAGNOSTIC_STRATEGIES.typescript,
|
|
41128
41199
|
seedFirstPush: false,
|
|
41129
|
-
//
|
|
41130
|
-
//
|
|
41200
|
+
// #5348: the classic-only marker must not leak through the shared server id.
|
|
41201
|
+
// It turns a wait that lapses with no publish into a confirmed clean, and
|
|
41202
|
+
// nothing measures that a push-only TS7 build publishes a file's errors
|
|
41203
|
+
// inside the budget. Native TS7 7.0.2 and `effect-tsgo` (this strategy is
|
|
41204
|
+
// also its) are pull servers, so the marker is not read for them today (see
|
|
41205
|
+
// `silentOnClean`).
|
|
41131
41206
|
silentOnClean: false
|
|
41132
41207
|
};
|
|
41133
41208
|
DEFAULT_STRATEGY = {
|
|
@@ -42837,14 +42912,11 @@ function DenoExcludeRoot(primary2) {
|
|
|
42837
42912
|
return primary2(file);
|
|
42838
42913
|
};
|
|
42839
42914
|
}
|
|
42840
|
-
function isTsFamilyFile(file) {
|
|
42841
|
-
return TS_FAMILY_EXTENSIONS.has(path63.extname(file).toLowerCase());
|
|
42842
|
-
}
|
|
42843
42915
|
function tsConfigMarkersForFile(file) {
|
|
42844
|
-
return
|
|
42916
|
+
return isTypeScriptFile(file) ? ["tsconfig.json"] : TS_CONFIG_MARKERS;
|
|
42845
42917
|
}
|
|
42846
42918
|
async function findTypeScriptProjectRoot(file) {
|
|
42847
|
-
const configDetector =
|
|
42919
|
+
const configDetector = isTypeScriptFile(file) ? TypeScriptConfigRootTsOnly : TypeScriptConfigRootEither;
|
|
42848
42920
|
const [configRoot, toolingRoot] = await Promise.all([
|
|
42849
42921
|
configDetector(file),
|
|
42850
42922
|
TypeScriptToolingRoot(file)
|
|
@@ -42882,18 +42954,23 @@ async function findExtensionBoundedRoot(file, extensionRootKey) {
|
|
|
42882
42954
|
}
|
|
42883
42955
|
return void 0;
|
|
42884
42956
|
}
|
|
42885
|
-
async function
|
|
42957
|
+
async function classifyAgentLevelMarker(extensionRootKey, file) {
|
|
42886
42958
|
const agentDir = path63.dirname(extensionRootKey);
|
|
42887
42959
|
if (!agentDir || agentDir === extensionRootKey)
|
|
42888
|
-
return
|
|
42889
|
-
|
|
42960
|
+
return void 0;
|
|
42961
|
+
const configMarkers = tsConfigMarkersForFile(file);
|
|
42962
|
+
for (const pattern of [
|
|
42963
|
+
...configMarkers,
|
|
42964
|
+
...TS_CONFIG_MARKERS,
|
|
42965
|
+
...TS_TOOLING_MARKERS
|
|
42966
|
+
]) {
|
|
42890
42967
|
try {
|
|
42891
42968
|
await stat2(path63.join(agentDir, pattern));
|
|
42892
|
-
return
|
|
42969
|
+
return configMarkers.includes(pattern) ? "config" : "other";
|
|
42893
42970
|
} catch {
|
|
42894
42971
|
}
|
|
42895
42972
|
}
|
|
42896
|
-
return
|
|
42973
|
+
return void 0;
|
|
42897
42974
|
}
|
|
42898
42975
|
function pyrightInitialization(pythonPath) {
|
|
42899
42976
|
return {
|
|
@@ -43098,7 +43175,7 @@ function typosInitialization(root) {
|
|
|
43098
43175
|
function getServerById(id) {
|
|
43099
43176
|
return LSP_SERVERS.find((server) => server.id === id);
|
|
43100
43177
|
}
|
|
43101
|
-
var FIXTURE_ROOT_SEGMENTS, FALLBACK_PROJECT_MARKERS, PROJECT_BOUNDARY_MARKERS, PYTHON_BOUNDARY_MARKERS, PYTHON_EXTENSIONS, loggedRootCeilingClamps, posixCaseInsensitiveByPath, DIRECT_LSP_NEGATIVE_TTL_MS, directLspCommandUnavailableUntil, directLspCommandSkipLoggedUntil, LSP_SERVICE_GENERATION_FAMILY, LSP_SERVICE_GENERATION_VERSION, lspLaunchAvailabilityGeneration, PI_LENS_BIN_DIR2, FileDirRoot, PROJECT_FILE_SEARCH_MAX_DIRS, rootMtimeBound, createRootDetector, CLASSIC_TS_REPAIR_FAMILY, CLASSIC_TS_REPAIR_VERSION, JS_TS_LSP_EXTENSIONS, TS_CONFIG_MARKERS, TS_TOOLING_MARKERS,
|
|
43178
|
+
var FIXTURE_ROOT_SEGMENTS, FALLBACK_PROJECT_MARKERS, PROJECT_BOUNDARY_MARKERS, PYTHON_BOUNDARY_MARKERS, PYTHON_EXTENSIONS, loggedRootCeilingClamps, posixCaseInsensitiveByPath, DIRECT_LSP_NEGATIVE_TTL_MS, directLspCommandUnavailableUntil, directLspCommandSkipLoggedUntil, LSP_SERVICE_GENERATION_FAMILY, LSP_SERVICE_GENERATION_VERSION, lspLaunchAvailabilityGeneration, PI_LENS_BIN_DIR2, FileDirRoot, PROJECT_FILE_SEARCH_MAX_DIRS, rootMtimeBound, createRootDetector, CLASSIC_TS_REPAIR_FAMILY, CLASSIC_TS_REPAIR_VERSION, JS_TS_LSP_EXTENSIONS, TS_CONFIG_MARKERS, TS_TOOLING_MARKERS, TypeScriptConfigRootTsOnly, TypeScriptConfigRootEither, TypeScriptToolingRoot, TypeScriptRoot, TypeScriptServer, DenoServer, PythonServer, PythonJediServer, GoServer, RustServer, RubyServer, PHPServer, PowerShellServer, CSharpServer, OmniSharpServer, FSharpServer, JavaServer, KotlinServer, GROOVY_LANGUAGE_SERVER_JAR_ENV, GroovyServer, LeanServer, SwiftServer, DartServer, LuaServer, CppServer, ZigServer, HaskellServer, ElixirServer, ElixirExpertServer, GleamServer, TinymistServer, MarksmanServer, OCamlServer, ClojureServer, CueServer, TerraformServer, NixServer, BashServer, ShuckServer, FishServer, CMakeServer, DockerServer, DockerOfficialServer, YamlServer, JsonServer, HtmlServer, TomlServer, PrismaServer, VueServer, SvelteServer, CssServer, OPENGREP_KINDS, OPENGREP_EXTENSIONS, OpengrepServer, AST_GREP_KINDS, AST_GREP_EXTENSIONS, AstGrepServer, ZIZMOR_EXTENSIONS, ZizmorServer, TYPOS_EXTENSIONS, TyposServer, FallowServer, LSP_SERVERS;
|
|
43102
43179
|
var init_server = __esm({
|
|
43103
43180
|
"dist/clients/lsp/server.js"() {
|
|
43104
43181
|
"use strict";
|
|
@@ -43226,7 +43303,6 @@ var init_server = __esm({
|
|
|
43226
43303
|
"yarn.lock",
|
|
43227
43304
|
"package.json"
|
|
43228
43305
|
];
|
|
43229
|
-
TS_FAMILY_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".mts", ".cts"]);
|
|
43230
43306
|
TypeScriptConfigRootTsOnly = IgnoreHomeRoot(createRootDetector(["tsconfig.json"]));
|
|
43231
43307
|
TypeScriptConfigRootEither = IgnoreHomeRoot(createRootDetector([...TS_CONFIG_MARKERS]));
|
|
43232
43308
|
TypeScriptToolingRoot = IgnoreHomeRoot(createRootDetector([...TS_TOOLING_MARKERS]));
|
|
@@ -43236,7 +43312,11 @@ var init_server = __esm({
|
|
|
43236
43312
|
const bounded2 = await findExtensionBoundedRoot(file, extensionRootKey);
|
|
43237
43313
|
if (bounded2)
|
|
43238
43314
|
return bounded2;
|
|
43239
|
-
|
|
43315
|
+
const agentMarker = await classifyAgentLevelMarker(extensionRootKey, file);
|
|
43316
|
+
if (agentMarker === "config") {
|
|
43317
|
+
return realpathOrResolve(path63.dirname(extensionRootKey));
|
|
43318
|
+
}
|
|
43319
|
+
if (agentMarker === "other") {
|
|
43240
43320
|
return FileDirRoot(file);
|
|
43241
43321
|
}
|
|
43242
43322
|
return void 0;
|
|
@@ -49204,7 +49284,7 @@ function getToolCommandSpec(toolId) {
|
|
|
49204
49284
|
}
|
|
49205
49285
|
function getLinterPolicyForFile(filePath, context = {}) {
|
|
49206
49286
|
const ext2 = path70.extname(filePath).toLowerCase();
|
|
49207
|
-
if (
|
|
49287
|
+
if (isJstsFactFile(filePath)) {
|
|
49208
49288
|
const policy = getJstsLintPolicy({
|
|
49209
49289
|
hasEslintConfig: context.hasEslintConfig,
|
|
49210
49290
|
hasOxlintConfig: context.hasOxlintConfig,
|
|
@@ -49482,7 +49562,7 @@ function getLinterPolicyForCwd(filePath, cwd) {
|
|
|
49482
49562
|
}
|
|
49483
49563
|
function getAutofixPolicyForFile(filePath, context = {}) {
|
|
49484
49564
|
const ext2 = path70.extname(filePath).toLowerCase();
|
|
49485
|
-
if (
|
|
49565
|
+
if (isJstsFactFile(filePath)) {
|
|
49486
49566
|
if (context.hasEslintConfig) {
|
|
49487
49567
|
return {
|
|
49488
49568
|
toolNames: ["eslint", "oxlint", "biome"],
|
|
@@ -51604,7 +51684,6 @@ var init_tool_policy = __esm({
|
|
|
51604
51684
|
import * as fs58 from "node:fs";
|
|
51605
51685
|
import * as path71 from "node:path";
|
|
51606
51686
|
import { delimiter as delimiter4, resolve as resolveCommandPath } from "node:path";
|
|
51607
|
-
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
51608
51687
|
function lspPrimaryCoversFile(ctx, runnerId) {
|
|
51609
51688
|
if (ctx.pi?.getFlag?.("no-lsp"))
|
|
51610
51689
|
return void 0;
|
|
@@ -51912,6 +51991,8 @@ function sourceTagForToolId(toolId) {
|
|
|
51912
51991
|
return "archive-dist";
|
|
51913
51992
|
case "maven":
|
|
51914
51993
|
return "maven-jar";
|
|
51994
|
+
case "gem":
|
|
51995
|
+
case void 0:
|
|
51915
51996
|
default:
|
|
51916
51997
|
return void 0;
|
|
51917
51998
|
}
|
|
@@ -52512,7 +52593,7 @@ async function resolveLocalFirstAsync(toolName, cwd, windowsExt = ".cmd") {
|
|
|
52512
52593
|
function resolveRunnerCwd2(ctx, tool) {
|
|
52513
52594
|
return resolveToolCwd("runner", tool, ctx.filePath, ctx).cwd;
|
|
52514
52595
|
}
|
|
52515
|
-
var
|
|
52596
|
+
var managedBinaryVerdicts, managedVerifyInFlight, MANAGED_VERIFY_TIMEOUT_MS, MANAGED_VERIFY_COOLDOWN_MS, MANAGED_VERIFY_COOLDOWN_MAX_MS, installAttemptsByCwd, resolveInstallInFlightByCwd, correctedAvailabilityByCwd, uncorrectedEmissionsByCwd, latchedUnavailableByCwd, availabilityGeneration, getDispatchAvailabilityGeneration, checkerProbeFlights, cwdProbeFlights, pyright, ruff, biome;
|
|
52516
52597
|
var init_runner_helpers = __esm({
|
|
52517
52598
|
"dist/clients/dispatch/runners/utils/runner-helpers.js"() {
|
|
52518
52599
|
"use strict";
|
|
@@ -52530,7 +52611,6 @@ var init_runner_helpers = __esm({
|
|
|
52530
52611
|
init_server_covers();
|
|
52531
52612
|
init_server_traits();
|
|
52532
52613
|
init_package_manager();
|
|
52533
|
-
init_latency_logger();
|
|
52534
52614
|
init_safe_spawn();
|
|
52535
52615
|
init_tool_probe();
|
|
52536
52616
|
init_string_utils();
|
|
@@ -52540,12 +52620,6 @@ var init_runner_helpers = __esm({
|
|
|
52540
52620
|
init_availability_probe_flight();
|
|
52541
52621
|
init_availability_policy();
|
|
52542
52622
|
init_availability_policy();
|
|
52543
|
-
_realThisDir = (() => {
|
|
52544
|
-
if (typeof __dirname !== "undefined")
|
|
52545
|
-
return __dirname;
|
|
52546
|
-
return path71.dirname(fileURLToPath4(import.meta.url));
|
|
52547
|
-
})();
|
|
52548
|
-
_managedToolsDir = path71.join(getGlobalPiLensDir(), "tools");
|
|
52549
52623
|
managedBinaryVerdicts = /* @__PURE__ */ new Map();
|
|
52550
52624
|
managedVerifyInFlight = /* @__PURE__ */ new Map();
|
|
52551
52625
|
MANAGED_VERIFY_TIMEOUT_MS = 5e3;
|
|
@@ -52562,8 +52636,6 @@ var init_runner_helpers = __esm({
|
|
|
52562
52636
|
cwdProbeFlights = createAvailabilityProbeFlight({
|
|
52563
52637
|
generation: getDispatchAvailabilityGeneration
|
|
52564
52638
|
});
|
|
52565
|
-
sgLatch = createAvailabilityLatch();
|
|
52566
|
-
sgAvailabilityGeneration = availabilityGeneration.current();
|
|
52567
52639
|
pyright = createAvailabilityChecker("pyright", ".exe");
|
|
52568
52640
|
ruff = createAvailabilityChecker("ruff", ".exe");
|
|
52569
52641
|
biome = createAvailabilityChecker("biome");
|
|
@@ -54186,7 +54258,7 @@ __export(install_diagnostics_exports, {
|
|
|
54186
54258
|
import { createRequire as createRequire3 } from "node:module";
|
|
54187
54259
|
import * as fs62 from "node:fs";
|
|
54188
54260
|
import * as path75 from "node:path";
|
|
54189
|
-
import { fileURLToPath as
|
|
54261
|
+
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
54190
54262
|
function safe(fn, fallback) {
|
|
54191
54263
|
try {
|
|
54192
54264
|
return fn();
|
|
@@ -54212,7 +54284,7 @@ function installDiagnosticNotes(input) {
|
|
|
54212
54284
|
}
|
|
54213
54285
|
function collectInstallDiagnostics() {
|
|
54214
54286
|
const notes = [];
|
|
54215
|
-
const here = safe(() => path75.dirname(
|
|
54287
|
+
const here = safe(() => path75.dirname(fileURLToPath4(import.meta.url)), "");
|
|
54216
54288
|
const pkgDir = safe(() => path75.resolve(here, ".."), here);
|
|
54217
54289
|
let root = pkgDir;
|
|
54218
54290
|
for (let i = 0; i < 6; i++) {
|
|
@@ -54972,6 +55044,7 @@ function reachedNoVerdict(result) {
|
|
|
54972
55044
|
return true;
|
|
54973
55045
|
case "skipped":
|
|
54974
55046
|
return !isRunnerSkipReason(result.skipReason) || result.skipReason === "not-enabled";
|
|
55047
|
+
case "succeeded":
|
|
54975
55048
|
default:
|
|
54976
55049
|
return false;
|
|
54977
55050
|
}
|
|
@@ -59275,6 +59348,12 @@ var init_grammar_source = __esm({
|
|
|
59275
59348
|
commit: "dd7b90e0770ff18070c515937ba3c3d6d93db00e",
|
|
59276
59349
|
license: "MIT",
|
|
59277
59350
|
buildCommand: "npx tree-sitter-cli build --wasm"
|
|
59351
|
+
},
|
|
59352
|
+
"tree-sitter-groovy.wasm": {
|
|
59353
|
+
repo: "https://github.com/dekobon/tree-sitter-groovy",
|
|
59354
|
+
commit: "654e4c2d736571dbc512043a1dc26017c7aedc85",
|
|
59355
|
+
license: "MIT OR Apache-2.0",
|
|
59356
|
+
buildCommand: "npx tree-sitter-cli@0.25.10 build --wasm"
|
|
59278
59357
|
}
|
|
59279
59358
|
};
|
|
59280
59359
|
LANGUAGE_TO_GRAMMAR = {
|
|
@@ -59304,7 +59383,8 @@ var init_grammar_source = __esm({
|
|
|
59304
59383
|
vue: "tree-sitter-vue.wasm",
|
|
59305
59384
|
yaml: "tree-sitter-yaml.wasm",
|
|
59306
59385
|
zig: "tree-sitter-zig.wasm",
|
|
59307
|
-
cue: "tree-sitter-cue.wasm"
|
|
59386
|
+
cue: "tree-sitter-cue.wasm",
|
|
59387
|
+
groovy: "tree-sitter-groovy.wasm"
|
|
59308
59388
|
};
|
|
59309
59389
|
GRAMMAR_FILES = [
|
|
59310
59390
|
...new Set(Object.values(LANGUAGE_TO_GRAMMAR))
|
|
@@ -64848,7 +64928,11 @@ var init_tree_sitter_client = __esm({
|
|
|
64848
64928
|
scan(rootDir);
|
|
64849
64929
|
return files2;
|
|
64850
64930
|
}
|
|
64851
|
-
/**
|
|
64931
|
+
/**
|
|
64932
|
+
* Get file extensions for a language. Hand-kept sibling of the registry
|
|
64933
|
+
* (docs/invariants/language-config.md): a new row copies
|
|
64934
|
+
* `extensionsForLanguage(id)` until the table is folded onto it.
|
|
64935
|
+
*/
|
|
64852
64936
|
getExtensionsForLanguage(languageId) {
|
|
64853
64937
|
const mapping = {
|
|
64854
64938
|
typescript: [".ts", ".mts", ".cts"],
|
|
@@ -64863,7 +64947,8 @@ var init_tree_sitter_client = __esm({
|
|
|
64863
64947
|
c: [".c", ".h"],
|
|
64864
64948
|
cpp: [".cpp", ".hpp", ".cc", ".hh"],
|
|
64865
64949
|
elixir: [".ex", ".exs"],
|
|
64866
|
-
ruby: [".rb"]
|
|
64950
|
+
ruby: [".rb"],
|
|
64951
|
+
groovy: [".groovy", ".gvy", ".gy", ".gsh"]
|
|
64867
64952
|
};
|
|
64868
64953
|
return mapping[languageId] || [];
|
|
64869
64954
|
}
|
|
@@ -69046,6 +69131,12 @@ var init_runtime_config = __esm({
|
|
|
69046
69131
|
pipeline: {
|
|
69047
69132
|
lspMaxFileBytes: 2 * 1024 * 1024,
|
|
69048
69133
|
lspMaxFileLines: 5e3,
|
|
69134
|
+
// #5306: hard cap (ms) on the per-server diagnostics wait of the explicit
|
|
69135
|
+
// single-file `lens_diagnostics source=lsp` query when it passes an explicit
|
|
69136
|
+
// `waitMs` (`LSPTouchFileOptions.explicitQuery`). 30 s covers clangd on a
|
|
69137
|
+
// 20,000-line file (~11 s measured, investigation #5306) with margin, and
|
|
69138
|
+
// keeps one tool call from parking a turn for an arbitrary caller-chosen time.
|
|
69139
|
+
lspExplicitQueryMaxWaitMs: 3e4,
|
|
69049
69140
|
cascadeMaxFiles: 5,
|
|
69050
69141
|
cascadeMaxDiagnosticsPerFile: 20,
|
|
69051
69142
|
// Hard cap on how long the pipeline will wait for an LSP client to spawn.
|
|
@@ -69149,27 +69240,44 @@ var init_content_scan = __esm({
|
|
|
69149
69240
|
});
|
|
69150
69241
|
|
|
69151
69242
|
// dist/clients/lsp/content-limits.js
|
|
69152
|
-
function exceedsLspSyncLimits(content) {
|
|
69243
|
+
function exceedsLspSyncLimits(content, maxLines = LSP_MAX_FILE_LINES) {
|
|
69153
69244
|
const sizeBytes = Buffer.byteLength(content, "utf-8");
|
|
69154
69245
|
if (sizeBytes > LSP_MAX_FILE_BYTES) {
|
|
69155
69246
|
return {
|
|
69156
69247
|
tooLarge: true,
|
|
69157
|
-
reason: `${sizeBytes} bytes > ${LSP_MAX_FILE_BYTES} limit
|
|
69248
|
+
reason: `${sizeBytes} bytes > ${LSP_MAX_FILE_BYTES} limit`,
|
|
69249
|
+
bound: "bytes"
|
|
69158
69250
|
};
|
|
69159
69251
|
}
|
|
69160
69252
|
const lineCount3 = countLfNewlines(content) + 1;
|
|
69161
|
-
if (lineCount3 >
|
|
69253
|
+
if (lineCount3 > maxLines) {
|
|
69162
69254
|
return {
|
|
69163
69255
|
tooLarge: true,
|
|
69164
|
-
reason: `${lineCount3} lines > ${
|
|
69256
|
+
reason: `${lineCount3} lines > ${maxLines} limit`,
|
|
69257
|
+
bound: "lines"
|
|
69165
69258
|
};
|
|
69166
69259
|
}
|
|
69167
69260
|
return { tooLarge: false, reason: "" };
|
|
69168
69261
|
}
|
|
69262
|
+
function exceedsExplicitQueryLimits(content) {
|
|
69263
|
+
const shared = exceedsLspSyncLimits(content);
|
|
69264
|
+
if (shared.bound !== "lines")
|
|
69265
|
+
return shared;
|
|
69266
|
+
const maxLines = getGlobalLspQueryMaxFileLines() ?? LSP_MAX_FILE_LINES;
|
|
69267
|
+
const verdict = exceedsLspSyncLimits(content, maxLines);
|
|
69268
|
+
if (!verdict.tooLarge || maxLines >= LSP_QUERY_MAX_FILE_LINES_MAX) {
|
|
69269
|
+
return verdict;
|
|
69270
|
+
}
|
|
69271
|
+
return {
|
|
69272
|
+
...verdict,
|
|
69273
|
+
reason: `${verdict.reason}; this single-file query can raise its line limit with lsp.queryMaxFileLines in the user-level pi-lens config (up to ${LSP_QUERY_MAX_FILE_LINES_MAX})`
|
|
69274
|
+
};
|
|
69275
|
+
}
|
|
69169
69276
|
var LSP_MAX_FILE_BYTES, LSP_MAX_FILE_LINES;
|
|
69170
69277
|
var init_content_limits = __esm({
|
|
69171
69278
|
"dist/clients/lsp/content-limits.js"() {
|
|
69172
69279
|
"use strict";
|
|
69280
|
+
init_lens_config();
|
|
69173
69281
|
init_runtime_config();
|
|
69174
69282
|
init_content_scan();
|
|
69175
69283
|
LSP_MAX_FILE_BYTES = RUNTIME_CONFIG.pipeline.lspMaxFileBytes;
|
|
@@ -69695,7 +69803,7 @@ function findModuleForPath(graph, filePath) {
|
|
|
69695
69803
|
const normalized2 = normalizeMapKey(filePath);
|
|
69696
69804
|
let best;
|
|
69697
69805
|
for (const mod of graph.modules.values()) {
|
|
69698
|
-
if (normalized2
|
|
69806
|
+
if (isWithinForm(normalized2, mod.root)) {
|
|
69699
69807
|
if (!best || mod.root.length > best.root.length)
|
|
69700
69808
|
best = mod;
|
|
69701
69809
|
}
|
|
@@ -70638,6 +70746,70 @@ var init_tree_sitter_symbol_extractor = __esm({
|
|
|
70638
70746
|
refs: `
|
|
70639
70747
|
(command
|
|
70640
70748
|
name: (command_name (word) @callIdent)) @callRef
|
|
70749
|
+
`
|
|
70750
|
+
},
|
|
70751
|
+
// #5235: tree-sitter-groovy (dekobon v0.3.0, vendored as is). Node names
|
|
70752
|
+
// were probed against the committed wasm. A Spock feature name
|
|
70753
|
+
// (`def "adds two numbers"()`) parses as `quoted_identifier`, so the method
|
|
70754
|
+
// name keeps its quotes. Named closures are limited to class fields and
|
|
70755
|
+
// top-level script variables: a method-local `def c = {}` is also a
|
|
70756
|
+
// `local_variable_declaration`, and listing it would put locals in the
|
|
70757
|
+
// module outline. Closure-taking calls (`list.each { }`, DSL blocks) parse
|
|
70758
|
+
// as sibling statements or `command_chain`, not `method_invocation`, so
|
|
70759
|
+
// they yield no call ref; only `foo(1)`, `a.b(2)` and `new X()` do. The
|
|
70760
|
+
// grammar's known parse gaps are in docs/language-coverage.md.
|
|
70761
|
+
groovy: {
|
|
70762
|
+
defs: `
|
|
70763
|
+
(class_declaration
|
|
70764
|
+
name: (identifier) @className) @classDef
|
|
70765
|
+
|
|
70766
|
+
(trait_declaration
|
|
70767
|
+
name: (identifier) @className) @classDef
|
|
70768
|
+
|
|
70769
|
+
(enum_declaration
|
|
70770
|
+
name: (identifier) @className) @classDef
|
|
70771
|
+
|
|
70772
|
+
(record_declaration
|
|
70773
|
+
name: (identifier) @className) @classDef
|
|
70774
|
+
|
|
70775
|
+
(interface_declaration
|
|
70776
|
+
name: (identifier) @interfaceName) @interfaceDef
|
|
70777
|
+
|
|
70778
|
+
(method_declaration
|
|
70779
|
+
name: [(identifier) (quoted_identifier)] @methodName
|
|
70780
|
+
parameters: (formal_parameters) @methodParams) @methodDef
|
|
70781
|
+
|
|
70782
|
+
(constructor_declaration
|
|
70783
|
+
name: (identifier) @funcName
|
|
70784
|
+
parameters: (formal_parameters) @funcParams) @funcDef
|
|
70785
|
+
|
|
70786
|
+
(field_declaration
|
|
70787
|
+
(variable_declarator
|
|
70788
|
+
name: (identifier) @arrowName
|
|
70789
|
+
value: (closure))) @arrowDef
|
|
70790
|
+
|
|
70791
|
+
(source_file
|
|
70792
|
+
(local_variable_declaration
|
|
70793
|
+
(variable_declarator
|
|
70794
|
+
name: (identifier) @arrowName
|
|
70795
|
+
value: (closure))) @arrowDef)
|
|
70796
|
+
`,
|
|
70797
|
+
refs: `
|
|
70798
|
+
(method_invocation
|
|
70799
|
+
function: (identifier) @callIdent) @callRef
|
|
70800
|
+
|
|
70801
|
+
(method_invocation
|
|
70802
|
+
function: (field_access
|
|
70803
|
+
field: (identifier) @callMethod)) @callMethodRef
|
|
70804
|
+
|
|
70805
|
+
(object_creation_expression
|
|
70806
|
+
type: (type_identifier) @newIdent) @newRef
|
|
70807
|
+
|
|
70808
|
+
(object_creation_expression
|
|
70809
|
+
type: (generic_type
|
|
70810
|
+
base: (type_identifier) @newIdent)) @newRef
|
|
70811
|
+
|
|
70812
|
+
(type_identifier) @typeIdent
|
|
70641
70813
|
`
|
|
70642
70814
|
},
|
|
70643
70815
|
// #1522: tree-sitter-cue (eonpatapon/tree-sitter-cue, vendored per #1520) has
|
|
@@ -70828,6 +71000,9 @@ var init_tree_sitter_symbol_extractor = __esm({
|
|
|
70828
71000
|
(word) @importSource
|
|
70829
71001
|
(#match? @_m "^(source|\\.)$"))
|
|
70830
71002
|
`,
|
|
71003
|
+
// import a.b.C / import static a.b.C.m / import a.b.* — `name:` is the
|
|
71004
|
+
// qualified_name on every form, aliases (`as X`) included (#5235).
|
|
71005
|
+
groovy: `(import_declaration name: (qualified_name) @importSource)`,
|
|
70831
71006
|
// import "strings" / import x "encoding/json" — `import_spec`'s `path:`
|
|
70832
71007
|
// field is verified against the committed wasm. Block-form
|
|
70833
71008
|
// (`import (\n\t"strings"\n)`) nests each `import_spec` one level deeper,
|
|
@@ -71355,8 +71530,7 @@ function createImplicitScopeCheck(runtime2, cwd) {
|
|
|
71355
71530
|
return role;
|
|
71356
71531
|
};
|
|
71357
71532
|
const rootKey2 = normalizeMapKey(nodePath2.resolve(cwd));
|
|
71358
|
-
const
|
|
71359
|
-
const inRoot = (file) => file === rootKey2 || file.startsWith(rootPrefix);
|
|
71533
|
+
const inRoot = (file) => isWithinForm(file, rootKey2);
|
|
71360
71534
|
let scanned;
|
|
71361
71535
|
const feeding = [];
|
|
71362
71536
|
let newestUnknownTs = Number.NEGATIVE_INFINITY;
|
|
@@ -72399,6 +72573,95 @@ var init_session_state_store = __esm({
|
|
|
72399
72573
|
}
|
|
72400
72574
|
});
|
|
72401
72575
|
|
|
72576
|
+
// dist/clients/diagnostics-publish.js
|
|
72577
|
+
function wireDiagnosticsBusEmitterGetter(getter) {
|
|
72578
|
+
liveEmitter4.wireGetter(getter);
|
|
72579
|
+
}
|
|
72580
|
+
function capDiagnostics(diagnostics) {
|
|
72581
|
+
if (diagnostics.length <= MAX_DIAGNOSTICS_PER_FILE_EVENT) {
|
|
72582
|
+
return { capped: diagnostics, truncated: false };
|
|
72583
|
+
}
|
|
72584
|
+
const errors = diagnostics.filter((d) => d.severity === "error");
|
|
72585
|
+
const rest = diagnostics.filter((d) => d.severity !== "error");
|
|
72586
|
+
if (errors.length >= MAX_DIAGNOSTICS_PER_FILE_EVENT) {
|
|
72587
|
+
return {
|
|
72588
|
+
capped: errors.slice(0, MAX_DIAGNOSTICS_PER_FILE_EVENT),
|
|
72589
|
+
truncated: true
|
|
72590
|
+
};
|
|
72591
|
+
}
|
|
72592
|
+
return {
|
|
72593
|
+
capped: [
|
|
72594
|
+
...errors,
|
|
72595
|
+
...rest.slice(0, MAX_DIAGNOSTICS_PER_FILE_EVENT - errors.length)
|
|
72596
|
+
],
|
|
72597
|
+
truncated: true
|
|
72598
|
+
};
|
|
72599
|
+
}
|
|
72600
|
+
function publishDiagnostics(args) {
|
|
72601
|
+
if (args.origin === "bus")
|
|
72602
|
+
return;
|
|
72603
|
+
if (args.files.length === 0)
|
|
72604
|
+
return;
|
|
72605
|
+
publisher3.publish({
|
|
72606
|
+
event: BUS_DIAGNOSTICS_EVENT,
|
|
72607
|
+
enabled: isBusPublishEnabled(),
|
|
72608
|
+
cwd: args.cwd,
|
|
72609
|
+
build: (cwd) => {
|
|
72610
|
+
const fileEntries = args.files.map((f) => {
|
|
72611
|
+
const normPath = normalizeFilePath(f.path);
|
|
72612
|
+
const { capped, truncated } = capDiagnostics(f.diagnostics);
|
|
72613
|
+
if (capped.length > 0) {
|
|
72614
|
+
reportedDirtyPaths.add(normPath);
|
|
72615
|
+
} else {
|
|
72616
|
+
reportedDirtyPaths.delete(normPath);
|
|
72617
|
+
}
|
|
72618
|
+
const entry = {
|
|
72619
|
+
path: normPath,
|
|
72620
|
+
diagnostics: capped
|
|
72621
|
+
};
|
|
72622
|
+
if (truncated)
|
|
72623
|
+
entry.truncated = true;
|
|
72624
|
+
return entry;
|
|
72625
|
+
});
|
|
72626
|
+
seqCounter += 1;
|
|
72627
|
+
return {
|
|
72628
|
+
v: BUS_DIAGNOSTICS_VERSION,
|
|
72629
|
+
source: "pi-lens",
|
|
72630
|
+
cwd,
|
|
72631
|
+
seq: seqCounter,
|
|
72632
|
+
ts: Date.now(),
|
|
72633
|
+
files: fileEntries
|
|
72634
|
+
};
|
|
72635
|
+
},
|
|
72636
|
+
emittedFields: (payload) => ({
|
|
72637
|
+
fileCount: payload.files.length,
|
|
72638
|
+
seq: payload.seq
|
|
72639
|
+
}),
|
|
72640
|
+
dbg: args.dbg
|
|
72641
|
+
});
|
|
72642
|
+
}
|
|
72643
|
+
function wasPreviouslyReportedDirty(path235) {
|
|
72644
|
+
return reportedDirtyPaths.has(normalizeFilePath(path235));
|
|
72645
|
+
}
|
|
72646
|
+
var BUS_DIAGNOSTICS_EVENT, BUS_DIAGNOSTICS_VERSION, MAX_DIAGNOSTICS_PER_FILE_EVENT, liveEmitter4, publisher3, seqCounter, reportedDirtyPaths;
|
|
72647
|
+
var init_diagnostics_publish = __esm({
|
|
72648
|
+
"dist/clients/diagnostics-publish.js"() {
|
|
72649
|
+
"use strict";
|
|
72650
|
+
init_path_utils();
|
|
72651
|
+
init_live_bus_emitter();
|
|
72652
|
+
init_bus_publish();
|
|
72653
|
+
BUS_DIAGNOSTICS_EVENT = "pilens:diagnostics";
|
|
72654
|
+
BUS_DIAGNOSTICS_VERSION = 1;
|
|
72655
|
+
MAX_DIAGNOSTICS_PER_FILE_EVENT = 12;
|
|
72656
|
+
liveEmitter4 = createLiveBusEmitter();
|
|
72657
|
+
publisher3 = createBusPublisher(liveEmitter4, {
|
|
72658
|
+
module: "diagnostics-publish"
|
|
72659
|
+
});
|
|
72660
|
+
seqCounter = 0;
|
|
72661
|
+
reportedDirtyPaths = /* @__PURE__ */ new Set();
|
|
72662
|
+
}
|
|
72663
|
+
});
|
|
72664
|
+
|
|
72402
72665
|
// dist/clients/widget-state.js
|
|
72403
72666
|
import { readFileSync as readFileSync48 } from "node:fs";
|
|
72404
72667
|
import { stat as stat3 } from "node:fs/promises";
|
|
@@ -73422,6 +73685,7 @@ var init_widget_state = __esm({
|
|
|
73422
73685
|
init_degradation_ledger();
|
|
73423
73686
|
init_session_scope();
|
|
73424
73687
|
init_session_state_store();
|
|
73688
|
+
init_diagnostics_publish();
|
|
73425
73689
|
files = /* @__PURE__ */ new Map();
|
|
73426
73690
|
sessionLanguages = [];
|
|
73427
73691
|
requestRenderFn = null;
|
|
@@ -73453,7 +73717,31 @@ var init_widget_state = __esm({
|
|
|
73453
73717
|
if (!state9?.files)
|
|
73454
73718
|
return { itemsIn: 0, itemsKept: 0 };
|
|
73455
73719
|
const fresh = await dropStaleFiles(state9, ctx.savedAt);
|
|
73720
|
+
if (!_scope.isLive())
|
|
73721
|
+
return { itemsIn: state9.files.length, itemsKept: 0 };
|
|
73456
73722
|
importWidgetState(fresh);
|
|
73723
|
+
const files2 = getFileDiagnosticSummaries().map((f) => ({
|
|
73724
|
+
filePath: f.filePath,
|
|
73725
|
+
diagnostics: f.diagnostics.flatMap((d) => {
|
|
73726
|
+
const tier = classifyDiagnosticTier(d);
|
|
73727
|
+
if (d.stale === true || tier === void 0)
|
|
73728
|
+
return [];
|
|
73729
|
+
return [
|
|
73730
|
+
{
|
|
73731
|
+
severity: tier === "advisory" ? d.severity === "info" ? "info" : "hint" : tier,
|
|
73732
|
+
message: d.message,
|
|
73733
|
+
tool: d.tool ?? "unknown",
|
|
73734
|
+
...d.rule !== void 0 && { ruleId: d.rule },
|
|
73735
|
+
...d.line !== void 0 && { line: d.line },
|
|
73736
|
+
...d.col !== void 0 && { col: d.col }
|
|
73737
|
+
}
|
|
73738
|
+
];
|
|
73739
|
+
})
|
|
73740
|
+
}));
|
|
73741
|
+
publishDiagnostics({
|
|
73742
|
+
cwd: ctx.cwd,
|
|
73743
|
+
files: files2.filter((f) => f.diagnostics.length > 0 || wasPreviouslyReportedDirty(f.filePath)).map((f) => ({ path: f.filePath, diagnostics: f.diagnostics }))
|
|
73744
|
+
});
|
|
73457
73745
|
return { itemsIn: state9.files.length, itemsKept: fresh.files.length };
|
|
73458
73746
|
},
|
|
73459
73747
|
reset: () => clearWidgetState(),
|
|
@@ -85177,7 +85465,7 @@ var init_client_registry = __esm({
|
|
|
85177
85465
|
*/
|
|
85178
85466
|
async restartPrimaryClientsUnder(root) {
|
|
85179
85467
|
const rootKey2 = normalizeMapKey(root);
|
|
85180
|
-
const overlaps = (clientRoot) => clientRoot
|
|
85468
|
+
const overlaps = (clientRoot) => isWithinForm(clientRoot, rootKey2) || isWithinForm(rootKey2, clientRoot);
|
|
85181
85469
|
return this.withClientSpawnGate(async () => {
|
|
85182
85470
|
if (this.isDestroyed)
|
|
85183
85471
|
return [];
|
|
@@ -86087,7 +86375,7 @@ var init_environment_gap = __esm({
|
|
|
86087
86375
|
// dist/clients/lsp/inferred-project.js
|
|
86088
86376
|
import * as path118 from "node:path";
|
|
86089
86377
|
function isTsProjectFile(filePath) {
|
|
86090
|
-
return
|
|
86378
|
+
return isJstsFactFile(filePath);
|
|
86091
86379
|
}
|
|
86092
86380
|
function suggestTsconfigInclude(filePath, cwd) {
|
|
86093
86381
|
const relative26 = toProjectRelativePath(filePath, cwd);
|
|
@@ -86209,25 +86497,16 @@ async function demoteInferredProjectSweepResults(results, cwd, service, signal)
|
|
|
86209
86497
|
}
|
|
86210
86498
|
return changed ? out : results;
|
|
86211
86499
|
}
|
|
86212
|
-
var INFERRED_PROJECT_MARKER,
|
|
86500
|
+
var INFERRED_PROJECT_MARKER, INFERRED_PROJECT_PROBE_BUDGET;
|
|
86213
86501
|
var init_inferred_project = __esm({
|
|
86214
86502
|
"dist/clients/lsp/inferred-project.js"() {
|
|
86215
86503
|
"use strict";
|
|
86216
86504
|
init_tsserver_sync();
|
|
86505
|
+
init_file_kinds();
|
|
86217
86506
|
init_path_utils();
|
|
86218
86507
|
init_environment_gap();
|
|
86219
86508
|
init_latency_logger();
|
|
86220
86509
|
INFERRED_PROJECT_MARKER = "not in any tsconfig project \u2014 checked with inferred settings";
|
|
86221
|
-
TS_PROJECT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
86222
|
-
".ts",
|
|
86223
|
-
".tsx",
|
|
86224
|
-
".mts",
|
|
86225
|
-
".cts",
|
|
86226
|
-
".js",
|
|
86227
|
-
".jsx",
|
|
86228
|
-
".mjs",
|
|
86229
|
-
".cjs"
|
|
86230
|
-
]);
|
|
86231
86510
|
INFERRED_PROJECT_PROBE_BUDGET = 300;
|
|
86232
86511
|
}
|
|
86233
86512
|
});
|
|
@@ -87025,6 +87304,7 @@ var init_lsp = __esm({
|
|
|
87025
87304
|
init_degradation_ledger();
|
|
87026
87305
|
init_lsp_budget();
|
|
87027
87306
|
init_resource_sampler();
|
|
87307
|
+
init_runtime_config();
|
|
87028
87308
|
init_deadline_utils();
|
|
87029
87309
|
init_hook_budgets();
|
|
87030
87310
|
init_safe_spawn();
|
|
@@ -88265,7 +88545,7 @@ var init_lsp = __esm({
|
|
|
88265
88545
|
const separator = key4.indexOf(":");
|
|
88266
88546
|
const serverId = separator >= 0 ? key4.slice(0, separator) : key4;
|
|
88267
88547
|
const root = normalizeMapKey(client.root);
|
|
88268
|
-
const sameOrNested = root
|
|
88548
|
+
const sameOrNested = isWithinForm(root, normalizedCwd) || isWithinForm(normalizedCwd, root);
|
|
88269
88549
|
if (!sameOrNested)
|
|
88270
88550
|
continue;
|
|
88271
88551
|
entries.push({ clientKey: key4, serverId, client });
|
|
@@ -89604,29 +89884,33 @@ var init_lsp = __esm({
|
|
|
89604
89884
|
}
|
|
89605
89885
|
}
|
|
89606
89886
|
}
|
|
89887
|
+
const isSilentOnCleanServer = (entry) => {
|
|
89888
|
+
try {
|
|
89889
|
+
const snapshot = {
|
|
89890
|
+
serverId: entry.client.serverId,
|
|
89891
|
+
root: entry.client.root,
|
|
89892
|
+
operationSupport: entry.client.getOperationSupport(),
|
|
89893
|
+
workspaceDiagnosticsSupport: entry.client.getWorkspaceDiagnosticsSupport(),
|
|
89894
|
+
customServer: entry.info.custom,
|
|
89895
|
+
diagnosticsPublished: this.state.diagnosticsPublished.has(entry.info.id),
|
|
89896
|
+
diagnosticsUnsupported: this.state.diagnosticsUnsupported.has(entry.info.id),
|
|
89897
|
+
advertisedCommands: entry.client.getAdvertisedCommands(),
|
|
89898
|
+
rawCapabilityKeys: entry.client.getRawCapabilityKeys?.() ?? [],
|
|
89899
|
+
launchVariant: entry.client.getLaunchVariant?.()
|
|
89900
|
+
};
|
|
89901
|
+
return classifyServerWaitTier(entry.client.serverId, snapshot) === "tier3-silent";
|
|
89902
|
+
} catch {
|
|
89903
|
+
return false;
|
|
89904
|
+
}
|
|
89905
|
+
};
|
|
89607
89906
|
const silentCleanWarmupServers = /* @__PURE__ */ new Set();
|
|
89608
89907
|
if (options.warmupOverride && (options.warmupAttempt ?? 1) <= 1) {
|
|
89609
89908
|
for (const entry of spawned) {
|
|
89610
89909
|
const strategy = getStrategy(entry.client.serverId, entry.client.getLaunchVariant?.());
|
|
89611
89910
|
if (strategy.workspaceIndexing !== true)
|
|
89612
89911
|
continue;
|
|
89613
|
-
|
|
89614
|
-
|
|
89615
|
-
serverId: entry.client.serverId,
|
|
89616
|
-
root: entry.client.root,
|
|
89617
|
-
operationSupport: entry.client.getOperationSupport(),
|
|
89618
|
-
workspaceDiagnosticsSupport: entry.client.getWorkspaceDiagnosticsSupport(),
|
|
89619
|
-
customServer: entry.info.custom,
|
|
89620
|
-
diagnosticsPublished: this.state.diagnosticsPublished.has(entry.info.id),
|
|
89621
|
-
diagnosticsUnsupported: this.state.diagnosticsUnsupported.has(entry.info.id),
|
|
89622
|
-
advertisedCommands: entry.client.getAdvertisedCommands(),
|
|
89623
|
-
rawCapabilityKeys: entry.client.getRawCapabilityKeys?.() ?? [],
|
|
89624
|
-
launchVariant: entry.client.getLaunchVariant?.()
|
|
89625
|
-
};
|
|
89626
|
-
if (classifyServerWaitTier(entry.client.serverId, snapshot) === "tier3-silent") {
|
|
89627
|
-
silentCleanWarmupServers.add(entry.client.serverId);
|
|
89628
|
-
}
|
|
89629
|
-
} catch {
|
|
89912
|
+
if (isSilentOnCleanServer(entry)) {
|
|
89913
|
+
silentCleanWarmupServers.add(entry.client.serverId);
|
|
89630
89914
|
}
|
|
89631
89915
|
}
|
|
89632
89916
|
}
|
|
@@ -89639,6 +89923,9 @@ var init_lsp = __esm({
|
|
|
89639
89923
|
strategyWait = strategy.workspaceIndexingWarmWaitMs ?? Math.min(300, strategyWait);
|
|
89640
89924
|
}
|
|
89641
89925
|
if (callerCap !== void 0) {
|
|
89926
|
+
if (options.explicitQuery) {
|
|
89927
|
+
return Math.min(Math.max(callerCap, strategyWait > 0 ? strategyWait : 0), RUNTIME_CONFIG.pipeline.lspExplicitQueryMaxWaitMs);
|
|
89928
|
+
}
|
|
89642
89929
|
if (options.warmupOverride) {
|
|
89643
89930
|
if (silentCleanWarmupServers.has(serverId)) {
|
|
89644
89931
|
return Math.min(callerCap, strategyWait > 0 ? strategyWait : callerCap);
|
|
@@ -89703,6 +89990,7 @@ var init_lsp = __esm({
|
|
|
89703
89990
|
});
|
|
89704
89991
|
const firstContactCutOffServerIds = /* @__PURE__ */ new Set();
|
|
89705
89992
|
const firstContactErroredServerIds = /* @__PURE__ */ new Set();
|
|
89993
|
+
const expiredWaitServerIds = /* @__PURE__ */ new Set();
|
|
89706
89994
|
const answeredForThisTouch = (entry) => {
|
|
89707
89995
|
const baseline = diagnosticBaselines.get(entry.client);
|
|
89708
89996
|
const currentPathVersion = readPathVersion(entry.client);
|
|
@@ -89735,7 +90023,7 @@ var init_lsp = __esm({
|
|
|
89735
90023
|
const serverTimeout = perServerWaitTimeouts[entryIndex];
|
|
89736
90024
|
const baseline = diagnosticBaselines.get(entry.client);
|
|
89737
90025
|
const pullOnly = classifyServerWaitTier(entry.client.serverId, pressureSnapshots.find((snapshot) => snapshot.serverId === entry.client.serverId)) === "pull-capable";
|
|
89738
|
-
const waitForDiagnostics = () => !notifySkippedServerIds.has(entry.info.id) && Number.isFinite(baseline) ? entry.client.waitForDiagnostics(filePath, serverTimeout, {
|
|
90026
|
+
const waitForDiagnostics = () => (!notifySkippedServerIds.has(entry.info.id) && Number.isFinite(baseline) ? entry.client.waitForDiagnostics(filePath, serverTimeout, {
|
|
89739
90027
|
minVersion: baseline,
|
|
89740
90028
|
...pullOnly && { pullOnly: true },
|
|
89741
90029
|
...isWarmupTouch && { pullSettleSource: "pull-warmup" }
|
|
@@ -89744,7 +90032,12 @@ var init_lsp = __esm({
|
|
|
89744
90032
|
...isWarmupTouch && { pullSettleSource: "pull-warmup" }
|
|
89745
90033
|
}) : isWarmupTouch ? entry.client.waitForDiagnostics(filePath, serverTimeout, {
|
|
89746
90034
|
pullSettleSource: "pull-warmup"
|
|
89747
|
-
}) : entry.client.waitForDiagnostics(filePath, serverTimeout)
|
|
90035
|
+
}) : entry.client.waitForDiagnostics(filePath, serverTimeout)).then((outcome) => {
|
|
90036
|
+
if (outcome === "deadline-expired" && !isAuxiliary(entry.info) && !isSilentOnCleanServer(entry)) {
|
|
90037
|
+
expiredWaitServerIds.add(entry.info.id);
|
|
90038
|
+
}
|
|
90039
|
+
return outcome;
|
|
90040
|
+
});
|
|
89748
90041
|
const firstContact = entry.info.custom === true && !this.state.diagnosticsPublished.has(entry.info.id) && !this.state.diagnosticsUnsupported.has(entry.info.id) && entry.client.getWorkspaceDiagnosticsSupport().mode !== "pull";
|
|
89749
90042
|
if (!firstContact)
|
|
89750
90043
|
return waitForDiagnostics().catch(() => void 0);
|
|
@@ -90016,7 +90309,7 @@ var init_lsp = __esm({
|
|
|
90016
90309
|
savedVsBudgetMs: Math.max(0, timeoutMs - waitedMs)
|
|
90017
90310
|
}
|
|
90018
90311
|
});
|
|
90019
|
-
} else if (waitedMs + 20 >= timeoutMs || firstContactErroredServerIds.size > 0) {
|
|
90312
|
+
} else if (waitedMs + 20 >= timeoutMs || firstContactErroredServerIds.size > 0 || expiredWaitServerIds.size > 0) {
|
|
90020
90313
|
const waited = spawned.filter((entry) => !deferredResyncServerIds.has(entry.info.id) && !diagnosticsUnsupportedServerIds.includes(entry.info.id));
|
|
90021
90314
|
const unanswered2 = waited.filter((entry) => !answeredForThisTouch(entry));
|
|
90022
90315
|
diagnosticsUnansweredServerIds = unanswered2.map((e) => e.info.id);
|
|
@@ -93087,6 +93380,11 @@ function configOwnerFor(filePath, root) {
|
|
|
93087
93380
|
function resolveDispatchPolicyConfigForFile(filePath, root) {
|
|
93088
93381
|
return resolveDispatchPolicyConfig(configOwnerFor(filePath, root));
|
|
93089
93382
|
}
|
|
93383
|
+
function ruleThresholdFromResolution(resolution, ruleId) {
|
|
93384
|
+
const rules2 = resolution.value.rules;
|
|
93385
|
+
const threshold = rules2?.[ruleId]?.threshold;
|
|
93386
|
+
return typeof threshold === "number" && threshold > 0 ? threshold : void 0;
|
|
93387
|
+
}
|
|
93090
93388
|
function rulePolicyMapFromResolution(resolution, root) {
|
|
93091
93389
|
const rules2 = resolution.value.rules;
|
|
93092
93390
|
const map = rulePolicyMapFromConfig(rules2);
|
|
@@ -94561,6 +94859,9 @@ function createDispatchContext(filePath, cwd, pi, facts, blockingOnly, modifiedR
|
|
|
94561
94859
|
facts,
|
|
94562
94860
|
projectConfig,
|
|
94563
94861
|
rulePolicy,
|
|
94862
|
+
// Same resolution as `rulePolicy`, so a rule threshold follows the
|
|
94863
|
+
// edited file's nearest `.pi-lens.json` field by field (#5292).
|
|
94864
|
+
ruleThreshold: (ruleId) => ruleThresholdFromResolution(policyConfig, ruleId),
|
|
94564
94865
|
...disabledRunnerIds !== void 0 && { disabledRunnerIds },
|
|
94565
94866
|
blockingOnly,
|
|
94566
94867
|
modifiedRanges,
|
|
@@ -95570,7 +95871,7 @@ function looksLikeDiagnosticCodePath(value) {
|
|
|
95570
95871
|
const text = value.trim();
|
|
95571
95872
|
if (!text)
|
|
95572
95873
|
return false;
|
|
95573
|
-
const base = path125.basename(text
|
|
95874
|
+
const base = path125.basename(toPosix(text));
|
|
95574
95875
|
if (/^lsp:\d+(?::\d+)?$/i.test(text) || /^lsp:\d+(?::\d+)?$/i.test(base)) {
|
|
95575
95876
|
return true;
|
|
95576
95877
|
}
|
|
@@ -95716,6 +96017,7 @@ var init_dispatcher = __esm({
|
|
|
95716
96017
|
var fact_store_exports = {};
|
|
95717
96018
|
__export(fact_store_exports, {
|
|
95718
96019
|
FactStore: () => FactStore,
|
|
96020
|
+
MAX_SESSION_FACT_RECORDS: () => MAX_SESSION_FACT_RECORDS,
|
|
95719
96021
|
getFactStoreEvictionReporter: () => getFactStoreEvictionReporter,
|
|
95720
96022
|
setFactStoreEvictionReporter: () => setFactStoreEvictionReporter
|
|
95721
96023
|
});
|
|
@@ -98974,7 +99276,7 @@ import * as os30 from "node:os";
|
|
|
98974
99276
|
import * as path129 from "node:path";
|
|
98975
99277
|
import { Worker as Worker2 } from "node:worker_threads";
|
|
98976
99278
|
import { constants as zlibConstants, gunzipSync as gunzipSync2, gzipSync as gzipSync2 } from "node:zlib";
|
|
98977
|
-
import { fileURLToPath as
|
|
99279
|
+
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
98978
99280
|
function sourcePathMemo(cwd) {
|
|
98979
99281
|
const key4 = normalizeMapKey(path129.resolve(cwd));
|
|
98980
99282
|
const existing = _sourcePathMemos.get(key4);
|
|
@@ -100260,7 +100562,7 @@ function resolvePersistWorkerPath() {
|
|
|
100260
100562
|
];
|
|
100261
100563
|
for (const url of candidates) {
|
|
100262
100564
|
try {
|
|
100263
|
-
const resolved2 =
|
|
100565
|
+
const resolved2 = fileURLToPath6(url);
|
|
100264
100566
|
if (fs108.existsSync(resolved2))
|
|
100265
100567
|
return resolved2;
|
|
100266
100568
|
} catch {
|
|
@@ -102577,6 +102879,7 @@ function extractSymbolsAndRefsFromGraph(graph) {
|
|
|
102577
102879
|
case "property":
|
|
102578
102880
|
case "function":
|
|
102579
102881
|
return node.symbolKind;
|
|
102882
|
+
case void 0:
|
|
102580
102883
|
default:
|
|
102581
102884
|
return "function";
|
|
102582
102885
|
}
|
|
@@ -103220,12 +103523,13 @@ var init_comment_facts = __esm({
|
|
|
103220
103523
|
"dist/clients/dispatch/facts/comment-facts.js"() {
|
|
103221
103524
|
"use strict";
|
|
103222
103525
|
init_tree_sitter_facts();
|
|
103526
|
+
init_language_registry();
|
|
103223
103527
|
commentFactProvider = {
|
|
103224
103528
|
id: "fact.file.comments",
|
|
103225
103529
|
provides: ["file.comments"],
|
|
103226
103530
|
requires: ["file.content"],
|
|
103227
103531
|
appliesTo(ctx) {
|
|
103228
|
-
return
|
|
103532
|
+
return isTypeScriptFile(ctx.filePath);
|
|
103229
103533
|
},
|
|
103230
103534
|
async run(ctx, store) {
|
|
103231
103535
|
await extractFactsFromTree(ctx, store, commentFactProvider.id, { "file.comments": [] }, (root) => {
|
|
@@ -103282,6 +103586,7 @@ var init_try_catch_facts = __esm({
|
|
|
103282
103586
|
"dist/clients/dispatch/facts/try-catch-facts.js"() {
|
|
103283
103587
|
"use strict";
|
|
103284
103588
|
init_tree_sitter_facts();
|
|
103589
|
+
init_language_registry();
|
|
103285
103590
|
DEFAULT_VALUE_PATTERN = /\breturn\s+(null|undefined|false|true|0|""|''|``|\[\]|\{\}|new\s+\w+\(\))/;
|
|
103286
103591
|
STRUCTURED_ERROR_PATTERN = /\breturn\s+\{[^}]*(?:success\s*:\s*false|error\s*:)/;
|
|
103287
103592
|
EXPLAINING_COMMENT_PATTERN = /(?:\/\/\s*\S.{3,}|\/\*\s*\S[\s\S]{3,}?\*\/)/;
|
|
@@ -103295,7 +103600,7 @@ var init_try_catch_facts = __esm({
|
|
|
103295
103600
|
provides: ["file.tryCatchSummaries"],
|
|
103296
103601
|
requires: ["file.content"],
|
|
103297
103602
|
appliesTo(ctx) {
|
|
103298
|
-
return
|
|
103603
|
+
return isTypeScriptFile(ctx.filePath);
|
|
103299
103604
|
},
|
|
103300
103605
|
async run(ctx, store) {
|
|
103301
103606
|
await extractFactsFromTree(ctx, store, tryCatchFactProvider.id, { "file.tryCatchSummaries": [] }, (root) => {
|
|
@@ -103468,6 +103773,7 @@ function normalizeBiomeSeverity(raw) {
|
|
|
103468
103773
|
return "hint";
|
|
103469
103774
|
case "warning":
|
|
103470
103775
|
return "warning";
|
|
103776
|
+
case void 0:
|
|
103471
103777
|
default:
|
|
103472
103778
|
return "warning";
|
|
103473
103779
|
}
|
|
@@ -111265,11 +111571,12 @@ var init_async_noise = __esm({
|
|
|
111265
111571
|
"dist/clients/dispatch/rules/async-noise.js"() {
|
|
111266
111572
|
"use strict";
|
|
111267
111573
|
init_file_utils();
|
|
111574
|
+
init_language_registry();
|
|
111268
111575
|
asyncNoiseRule = {
|
|
111269
111576
|
id: "async-noise",
|
|
111270
111577
|
requires: ["file.functionSummaries"],
|
|
111271
111578
|
appliesTo(ctx) {
|
|
111272
|
-
return
|
|
111579
|
+
return isTypeScriptFile(ctx.filePath) && !isTestFile(ctx.filePath);
|
|
111273
111580
|
},
|
|
111274
111581
|
evaluate(ctx, store) {
|
|
111275
111582
|
const summaries = store.getFileFact(ctx.filePath, "file.functionSummaries");
|
|
@@ -111304,11 +111611,12 @@ var asyncUnnecessaryWrapperRule;
|
|
|
111304
111611
|
var init_async_unnecessary_wrapper = __esm({
|
|
111305
111612
|
"dist/clients/dispatch/rules/async-unnecessary-wrapper.js"() {
|
|
111306
111613
|
"use strict";
|
|
111614
|
+
init_language_registry();
|
|
111307
111615
|
asyncUnnecessaryWrapperRule = {
|
|
111308
111616
|
id: "async-unnecessary-wrapper",
|
|
111309
111617
|
requires: ["file.functionSummaries"],
|
|
111310
111618
|
appliesTo(ctx) {
|
|
111311
|
-
return
|
|
111619
|
+
return isTypeScriptFile(ctx.filePath);
|
|
111312
111620
|
},
|
|
111313
111621
|
evaluate(ctx, store) {
|
|
111314
111622
|
const fns = store.getFileFact(ctx.filePath, "file.functionSummaries") ?? [];
|
|
@@ -111339,11 +111647,12 @@ var corsWildcardRule;
|
|
|
111339
111647
|
var init_cors_wildcard = __esm({
|
|
111340
111648
|
"dist/clients/dispatch/rules/cors-wildcard.js"() {
|
|
111341
111649
|
"use strict";
|
|
111650
|
+
init_language_registry();
|
|
111342
111651
|
corsWildcardRule = {
|
|
111343
111652
|
id: "cors-wildcard",
|
|
111344
111653
|
requires: ["file.content"],
|
|
111345
111654
|
appliesTo(ctx) {
|
|
111346
|
-
return /\.(
|
|
111655
|
+
return isTypeScriptFile(ctx.filePath) || /\.(py|go)$/.test(ctx.filePath);
|
|
111347
111656
|
},
|
|
111348
111657
|
evaluate(ctx, store) {
|
|
111349
111658
|
const content = store.getFileFact(ctx.filePath, "file.content");
|
|
@@ -111391,11 +111700,12 @@ var errorObscuringRule;
|
|
|
111391
111700
|
var init_error_obscuring = __esm({
|
|
111392
111701
|
"dist/clients/dispatch/rules/error-obscuring.js"() {
|
|
111393
111702
|
"use strict";
|
|
111703
|
+
init_language_registry();
|
|
111394
111704
|
errorObscuringRule = {
|
|
111395
111705
|
id: "error-obscuring",
|
|
111396
111706
|
requires: ["file.tryCatchSummaries"],
|
|
111397
111707
|
appliesTo(ctx) {
|
|
111398
|
-
return
|
|
111708
|
+
return isTypeScriptFile(ctx.filePath);
|
|
111399
111709
|
},
|
|
111400
111710
|
evaluate(ctx, store) {
|
|
111401
111711
|
const summaries = store.getFileFact(ctx.filePath, "file.tryCatchSummaries");
|
|
@@ -111428,11 +111738,12 @@ var errorSwallowingRule;
|
|
|
111428
111738
|
var init_error_swallowing = __esm({
|
|
111429
111739
|
"dist/clients/dispatch/rules/error-swallowing.js"() {
|
|
111430
111740
|
"use strict";
|
|
111741
|
+
init_language_registry();
|
|
111431
111742
|
errorSwallowingRule = {
|
|
111432
111743
|
id: "error-swallowing",
|
|
111433
111744
|
requires: ["file.tryCatchSummaries"],
|
|
111434
111745
|
appliesTo(ctx) {
|
|
111435
|
-
return
|
|
111746
|
+
return isTypeScriptFile(ctx.filePath);
|
|
111436
111747
|
},
|
|
111437
111748
|
evaluate(ctx, store) {
|
|
111438
111749
|
const summaries = store.getFileFact(ctx.filePath, "file.tryCatchSummaries");
|
|
@@ -111519,7 +111830,7 @@ var init_high_complexity = __esm({
|
|
|
111519
111830
|
evaluate(ctx, store) {
|
|
111520
111831
|
const fns = store.getFileFact(ctx.filePath, "file.functionSummaries") ?? [];
|
|
111521
111832
|
const diagnostics = [];
|
|
111522
|
-
const configuredCcThreshold = ctx.
|
|
111833
|
+
const configuredCcThreshold = ctx.ruleThreshold?.("high-complexity");
|
|
111523
111834
|
const activeCcThreshold = configuredCcThreshold ?? DEFAULT_HIGH_COMPLEXITY_THRESHOLD;
|
|
111524
111835
|
for (const f of fns) {
|
|
111525
111836
|
if (isTestSuiteOrganizer(f.outgoingCalls))
|
|
@@ -111557,17 +111868,18 @@ var init_high_fan_out = __esm({
|
|
|
111557
111868
|
"dist/clients/dispatch/rules/high-fan-out.js"() {
|
|
111558
111869
|
"use strict";
|
|
111559
111870
|
init_framework_call_noise();
|
|
111871
|
+
init_language_registry();
|
|
111560
111872
|
DEFAULT_HIGH_FAN_OUT_THRESHOLD = 20;
|
|
111561
111873
|
highFanOutRule = {
|
|
111562
111874
|
id: "high-fan-out",
|
|
111563
111875
|
requires: ["file.functionSummaries"],
|
|
111564
111876
|
appliesTo(ctx) {
|
|
111565
|
-
return
|
|
111877
|
+
return isTypeScriptFile(ctx.filePath);
|
|
111566
111878
|
},
|
|
111567
111879
|
evaluate(ctx, store) {
|
|
111568
111880
|
const fns = store.getFileFact(ctx.filePath, "file.functionSummaries") ?? [];
|
|
111569
111881
|
const diagnostics = [];
|
|
111570
|
-
const configuredFanOutThreshold = ctx.
|
|
111882
|
+
const configuredFanOutThreshold = ctx.ruleThreshold?.("high-fan-out");
|
|
111571
111883
|
const activeFanOutThreshold = configuredFanOutThreshold ?? DEFAULT_HIGH_FAN_OUT_THRESHOLD;
|
|
111572
111884
|
for (const f of fns) {
|
|
111573
111885
|
if (isTestSuiteOrganizer(f.outgoingCalls))
|
|
@@ -111601,13 +111913,14 @@ var IMPORT_COUPLING_THRESHOLD, IMPORT_COUPLING_EXEMPT, highImportCouplingRule;
|
|
|
111601
111913
|
var init_high_import_coupling = __esm({
|
|
111602
111914
|
"dist/clients/dispatch/rules/high-import-coupling.js"() {
|
|
111603
111915
|
"use strict";
|
|
111916
|
+
init_language_registry();
|
|
111604
111917
|
IMPORT_COUPLING_THRESHOLD = 15;
|
|
111605
111918
|
IMPORT_COUPLING_EXEMPT = /[/\\](index|integration)\.[cm]?tsx?$/;
|
|
111606
111919
|
highImportCouplingRule = {
|
|
111607
111920
|
id: "high-import-coupling",
|
|
111608
111921
|
requires: ["file.imports"],
|
|
111609
111922
|
appliesTo(ctx) {
|
|
111610
|
-
return
|
|
111923
|
+
return isTypeScriptFile(ctx.filePath);
|
|
111611
111924
|
},
|
|
111612
111925
|
evaluate(ctx, store) {
|
|
111613
111926
|
if (IMPORT_COUPLING_EXEMPT.test(ctx.filePath))
|
|
@@ -111640,11 +111953,12 @@ var missingErrorPropagationRule;
|
|
|
111640
111953
|
var init_missing_error_propagation = __esm({
|
|
111641
111954
|
"dist/clients/dispatch/rules/missing-error-propagation.js"() {
|
|
111642
111955
|
"use strict";
|
|
111956
|
+
init_language_registry();
|
|
111643
111957
|
missingErrorPropagationRule = {
|
|
111644
111958
|
id: "missing-error-propagation",
|
|
111645
111959
|
requires: ["file.functionSummaries", "file.tryCatchSummaries"],
|
|
111646
111960
|
appliesTo(ctx) {
|
|
111647
|
-
return
|
|
111961
|
+
return isTypeScriptFile(ctx.filePath);
|
|
111648
111962
|
},
|
|
111649
111963
|
evaluate(ctx, store) {
|
|
111650
111964
|
const fns = store.getFileFact(ctx.filePath, "file.functionSummaries") ?? [];
|
|
@@ -111689,24 +112003,29 @@ var init_missing_error_propagation = __esm({
|
|
|
111689
112003
|
});
|
|
111690
112004
|
|
|
111691
112005
|
// dist/clients/dispatch/rules/no-commented-credentials.js
|
|
112006
|
+
function isCredentialsExempt(filePath) {
|
|
112007
|
+
return CREDENTIALS_EXEMPT_NAME.test(filePath) && (isTypeScriptFile(filePath) || CREDENTIALS_EXEMPT_DATA_EXTENSION.test(filePath));
|
|
112008
|
+
}
|
|
111692
112009
|
function isCommentLine(line) {
|
|
111693
112010
|
return line.startsWith("//") || line.startsWith("#") || line.startsWith("*");
|
|
111694
112011
|
}
|
|
111695
|
-
var CREDENTIAL_PATTERNS,
|
|
112012
|
+
var CREDENTIAL_PATTERNS, CREDENTIALS_EXEMPT_NAME, CREDENTIALS_EXEMPT_DATA_EXTENSION, commentedCredentialsRule;
|
|
111696
112013
|
var init_no_commented_credentials = __esm({
|
|
111697
112014
|
"dist/clients/dispatch/rules/no-commented-credentials.js"() {
|
|
111698
112015
|
"use strict";
|
|
112016
|
+
init_language_registry();
|
|
111699
112017
|
CREDENTIAL_PATTERNS = [
|
|
111700
112018
|
/password\s*[:=]\s*["'][^"']{3,}/i,
|
|
111701
112019
|
/(?:api[_-]?key|secret|token)\s*[:=]\s*["'][^"']{6,}/i,
|
|
111702
112020
|
/(?:aws|gcp|azure)[_-]?(?:key|secret|token)\s*[:=]\s*["'][^"']{6,}/i
|
|
111703
112021
|
];
|
|
111704
|
-
|
|
112022
|
+
CREDENTIALS_EXEMPT_NAME = /[/\\](secrets?[-_]?(scanner|detect|check)|scanner|fixture|mock)[^/\\]*$/i;
|
|
112023
|
+
CREDENTIALS_EXEMPT_DATA_EXTENSION = /\.(ya?ml|json|env)$/i;
|
|
111705
112024
|
commentedCredentialsRule = {
|
|
111706
112025
|
id: "no-commented-credentials",
|
|
111707
112026
|
requires: ["file.content"],
|
|
111708
112027
|
appliesTo(ctx) {
|
|
111709
|
-
return /\.(
|
|
112028
|
+
return (isTypeScriptFile(ctx.filePath) || /\.(py|go|rb|ya?ml|json|env)$/.test(ctx.filePath)) && !isCredentialsExempt(ctx.filePath);
|
|
111710
112029
|
},
|
|
111711
112030
|
evaluate(ctx, store) {
|
|
111712
112031
|
const content = store.getFileFact(ctx.filePath, "file.content");
|
|
@@ -111750,12 +112069,13 @@ var init_pass_through_wrappers = __esm({
|
|
|
111750
112069
|
"dist/clients/dispatch/rules/pass-through-wrappers.js"() {
|
|
111751
112070
|
"use strict";
|
|
111752
112071
|
init_file_utils();
|
|
112072
|
+
init_language_registry();
|
|
111753
112073
|
ALIAS_COMMENT_RE = /\b(alias|backward\s*compat|backwards\s*compat|compatibility|shim|adapter)\b/i;
|
|
111754
112074
|
passThroughWrappersRule = {
|
|
111755
112075
|
id: "pass-through-wrappers",
|
|
111756
112076
|
requires: ["file.functionSummaries", "file.comments"],
|
|
111757
112077
|
appliesTo(ctx) {
|
|
111758
|
-
return
|
|
112078
|
+
return isTypeScriptFile(ctx.filePath) && !isTestFile(ctx.filePath);
|
|
111759
112079
|
},
|
|
111760
112080
|
evaluate(ctx, store) {
|
|
111761
112081
|
const summaries = store.getFileFact(ctx.filePath, "file.functionSummaries");
|
|
@@ -111793,6 +112113,7 @@ var init_placeholder_comments = __esm({
|
|
|
111793
112113
|
"dist/clients/dispatch/rules/placeholder-comments.js"() {
|
|
111794
112114
|
"use strict";
|
|
111795
112115
|
init_file_utils();
|
|
112116
|
+
init_language_registry();
|
|
111796
112117
|
PLACEHOLDER_PATTERNS = [
|
|
111797
112118
|
/add\s+more\s+validation/i,
|
|
111798
112119
|
/handle\s+(additional|more)\s+cases?/i,
|
|
@@ -111806,7 +112127,7 @@ var init_placeholder_comments = __esm({
|
|
|
111806
112127
|
id: "placeholder-comments",
|
|
111807
112128
|
requires: ["file.comments"],
|
|
111808
112129
|
appliesTo(ctx) {
|
|
111809
|
-
return
|
|
112130
|
+
return isTypeScriptFile(ctx.filePath) && !isTestFile(ctx.filePath);
|
|
111810
112131
|
},
|
|
111811
112132
|
evaluate(ctx, store) {
|
|
111812
112133
|
const comments = store.getFileFact(ctx.filePath, "file.comments");
|
|
@@ -111867,6 +112188,7 @@ var IO_NAMESPACE_PREFIXES, IO_EXACT_CALLEES, CC_THRESHOLD, unsafeBoundaryRule;
|
|
|
111867
112188
|
var init_unsafe_boundary = __esm({
|
|
111868
112189
|
"dist/clients/dispatch/rules/unsafe-boundary.js"() {
|
|
111869
112190
|
"use strict";
|
|
112191
|
+
init_language_registry();
|
|
111870
112192
|
IO_NAMESPACE_PREFIXES = [
|
|
111871
112193
|
"db.",
|
|
111872
112194
|
"prisma.",
|
|
@@ -111908,7 +112230,7 @@ var init_unsafe_boundary = __esm({
|
|
|
111908
112230
|
id: "unsafe-boundary",
|
|
111909
112231
|
requires: ["file.functionSummaries", "file.tryCatchSummaries"],
|
|
111910
112232
|
appliesTo(ctx) {
|
|
111911
|
-
return
|
|
112233
|
+
return isTypeScriptFile(ctx.filePath);
|
|
111912
112234
|
},
|
|
111913
112235
|
evaluate(ctx, store) {
|
|
111914
112236
|
const fns = store.getFileFact(ctx.filePath, "file.functionSummaries") ?? [];
|
|
@@ -111971,7 +112293,7 @@ __export(integration_exports, {
|
|
|
111971
112293
|
});
|
|
111972
112294
|
import * as nodeFs6 from "node:fs";
|
|
111973
112295
|
import * as nodePath4 from "node:path";
|
|
111974
|
-
import { fileURLToPath as
|
|
112296
|
+
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
111975
112297
|
function applyProjectLensConfig(cwd) {
|
|
111976
112298
|
return loadPiLensProjectConfig(cwd);
|
|
111977
112299
|
}
|
|
@@ -112568,7 +112890,7 @@ async function computeCascadeForFile(filePath, cwd, options = {}) {
|
|
|
112568
112890
|
for (const ref of refs) {
|
|
112569
112891
|
let resolved2;
|
|
112570
112892
|
try {
|
|
112571
|
-
resolved2 = ref.uri.startsWith("file://") ?
|
|
112893
|
+
resolved2 = ref.uri.startsWith("file://") ? fileURLToPath7(ref.uri) : ref.uri;
|
|
112572
112894
|
} catch {
|
|
112573
112895
|
continue;
|
|
112574
112896
|
}
|
|
@@ -116609,7 +116931,7 @@ var init_format_service = __esm({
|
|
|
116609
116931
|
|
|
116610
116932
|
// dist/clients/lens-events.js
|
|
116611
116933
|
function initLensEventsGetter(getter) {
|
|
116612
|
-
|
|
116934
|
+
liveEmitter5.wireGetter(getter);
|
|
116613
116935
|
}
|
|
116614
116936
|
function truncateText(value, maxChars) {
|
|
116615
116937
|
if (value === void 0)
|
|
@@ -116631,7 +116953,7 @@ function normalizeDiagnostics2(diagnostics) {
|
|
|
116631
116953
|
}
|
|
116632
116954
|
function emitLensEvent(eventName, payload) {
|
|
116633
116955
|
setImmediate(() => {
|
|
116634
|
-
|
|
116956
|
+
publisher4.publish({
|
|
116635
116957
|
event: eventName,
|
|
116636
116958
|
cwd: payload.cwd ?? process.cwd(),
|
|
116637
116959
|
// Inter-extension events are observational. A listener must never break
|
|
@@ -116665,7 +116987,7 @@ function emitLensTurnFindings(payload) {
|
|
|
116665
116987
|
content: truncateText(payload.content, 8e3) ?? ""
|
|
116666
116988
|
});
|
|
116667
116989
|
}
|
|
116668
|
-
var LENS_EVENT_VERSION, LENS_EVENT_NAMES,
|
|
116990
|
+
var LENS_EVENT_VERSION, LENS_EVENT_NAMES, liveEmitter5, publisher4;
|
|
116669
116991
|
var init_lens_events = __esm({
|
|
116670
116992
|
"dist/clients/lens-events.js"() {
|
|
116671
116993
|
"use strict";
|
|
@@ -116677,8 +116999,8 @@ var init_lens_events = __esm({
|
|
|
116677
116999
|
findings: "pi-lens/findings",
|
|
116678
117000
|
turnFindings: "pi-lens/turn-findings"
|
|
116679
117001
|
};
|
|
116680
|
-
|
|
116681
|
-
|
|
117002
|
+
liveEmitter5 = createLiveBusEmitter();
|
|
117003
|
+
publisher4 = createBusPublisher(liveEmitter5, {
|
|
116682
117004
|
module: "lens-events",
|
|
116683
117005
|
onUnwired: (eventName) => logExtension({
|
|
116684
117006
|
subsystem: "lens-events",
|
|
@@ -127223,14 +127545,14 @@ var init_knip = __esm({
|
|
|
127223
127545
|
});
|
|
127224
127546
|
|
|
127225
127547
|
// dist/clients/test-target-roots.js
|
|
127226
|
-
import { dirname as
|
|
127548
|
+
import { dirname as dirname63 } from "node:path";
|
|
127227
127549
|
function createTurnEndTestRoots(sessionCwd) {
|
|
127228
127550
|
const session = resolveGitCheckout(sessionCwd);
|
|
127229
127551
|
const ownerByDir = /* @__PURE__ */ new Map();
|
|
127230
127552
|
return (absoluteFile) => {
|
|
127231
127553
|
if (session === null)
|
|
127232
127554
|
return sessionCwd;
|
|
127233
|
-
const dir =
|
|
127555
|
+
const dir = dirname63(absoluteFile);
|
|
127234
127556
|
let owner = ownerByDir.get(dir);
|
|
127235
127557
|
if (owner === void 0) {
|
|
127236
127558
|
owner = resolveLinkedWorktreeOwner(session, absoluteFile);
|
|
@@ -131705,7 +132027,7 @@ async function scanFileMajorRules(cwd, files2, signal) {
|
|
|
131705
132027
|
const ext2 = path219.extname(filePath);
|
|
131706
132028
|
const grammarId = TREE_SITTER_EXT_TO_LANG[ext2];
|
|
131707
132029
|
const langId = grammarId && hasTreeSitterRules(grammarId) ? grammarId : void 0;
|
|
131708
|
-
const factEligible =
|
|
132030
|
+
const factEligible = isJstsFactFile(filePath);
|
|
131709
132031
|
let astGrepLang;
|
|
131710
132032
|
if (sgModule && canHandle(filePath)) {
|
|
131711
132033
|
try {
|
|
@@ -131916,7 +132238,7 @@ async function scanProjectDiagnostics(options) {
|
|
|
131916
132238
|
saveProjectDiagnosticsSnapshot(cwd, snapshot);
|
|
131917
132239
|
return snapshot;
|
|
131918
132240
|
}
|
|
131919
|
-
var AST_GREP_MAX_FILE_BYTES, AST_GREP_SCAN_MAX_MATCHES_PER_RULE, AST_GREP_SCAN_MAX_DIAGNOSTICS_PER_FILE,
|
|
132241
|
+
var AST_GREP_MAX_FILE_BYTES, AST_GREP_SCAN_MAX_MATCHES_PER_RULE, AST_GREP_SCAN_MAX_DIAGNOSTICS_PER_FILE, TREE_SITTER_EXT_TO_LANG;
|
|
131920
132242
|
var init_scanner = __esm({
|
|
131921
132243
|
"dist/clients/project-diagnostics/scanner.js"() {
|
|
131922
132244
|
"use strict";
|
|
@@ -131941,14 +132263,6 @@ var init_scanner = __esm({
|
|
|
131941
132263
|
AST_GREP_MAX_FILE_BYTES = 1024 * 1024;
|
|
131942
132264
|
AST_GREP_SCAN_MAX_MATCHES_PER_RULE = 25;
|
|
131943
132265
|
AST_GREP_SCAN_MAX_DIAGNOSTICS_PER_FILE = 100;
|
|
131944
|
-
FACT_RULE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
131945
|
-
".ts",
|
|
131946
|
-
".tsx",
|
|
131947
|
-
".js",
|
|
131948
|
-
".jsx",
|
|
131949
|
-
".mjs",
|
|
131950
|
-
".cjs"
|
|
131951
|
-
]);
|
|
131952
132266
|
TREE_SITTER_EXT_TO_LANG = EXT_TO_LANG;
|
|
131953
132267
|
}
|
|
131954
132268
|
});
|
|
@@ -134452,6 +134766,9 @@ function computeTrust(graph, cwd, drift) {
|
|
|
134452
134766
|
case "name-only":
|
|
134453
134767
|
nameOnly += 1;
|
|
134454
134768
|
break;
|
|
134769
|
+
// unresolved and unset edges are not in the resolution sample.
|
|
134770
|
+
case "unresolved":
|
|
134771
|
+
case void 0:
|
|
134455
134772
|
default:
|
|
134456
134773
|
break;
|
|
134457
134774
|
}
|
|
@@ -136888,7 +137205,7 @@ init_cache_manager();
|
|
|
136888
137205
|
|
|
136889
137206
|
// dist/clients/skills-resolver.js
|
|
136890
137207
|
import * as path98 from "node:path";
|
|
136891
|
-
import { fileURLToPath as
|
|
137208
|
+
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
136892
137209
|
import * as fs83 from "node:fs";
|
|
136893
137210
|
|
|
136894
137211
|
// dist/scripts/lib/skills-predicate.mjs
|
|
@@ -136972,7 +137289,7 @@ function resolveSkillPaths(importMetaUrl) {
|
|
|
136972
137289
|
}
|
|
136973
137290
|
});
|
|
136974
137291
|
if (health.status !== "healthy") {
|
|
136975
|
-
const entryDir = path98.dirname(
|
|
137292
|
+
const entryDir = path98.dirname(fileURLToPath5(importMetaUrl));
|
|
136976
137293
|
const healthDescription = describeBundledResourceHealth(health, skillsDir, `no SKILL.md (or loadable .md) found under ${skillsDir}`);
|
|
136977
137294
|
const notifyReason = `${healthDescription} (entry loaded from ${entryDir})`;
|
|
136978
137295
|
const classification = health.status === "unreadable" ? `cannot read (${health.fsErrorCode})` : health.status === "empty" ? "no SKILL.md found" : "no such directory";
|
|
@@ -138048,91 +138365,7 @@ function baseName(p) {
|
|
|
138048
138365
|
init_project_lens_config();
|
|
138049
138366
|
init_lens_events();
|
|
138050
138367
|
init_bus_publish();
|
|
138051
|
-
|
|
138052
|
-
// dist/clients/diagnostics-publish.js
|
|
138053
|
-
init_path_utils();
|
|
138054
|
-
init_live_bus_emitter();
|
|
138055
|
-
init_bus_publish();
|
|
138056
|
-
var BUS_DIAGNOSTICS_EVENT = "pilens:diagnostics";
|
|
138057
|
-
var BUS_DIAGNOSTICS_VERSION = 1;
|
|
138058
|
-
var MAX_DIAGNOSTICS_PER_FILE_EVENT = 12;
|
|
138059
|
-
var liveEmitter5 = createLiveBusEmitter();
|
|
138060
|
-
var publisher4 = createBusPublisher(liveEmitter5, {
|
|
138061
|
-
module: "diagnostics-publish"
|
|
138062
|
-
});
|
|
138063
|
-
var seqCounter = 0;
|
|
138064
|
-
var reportedDirtyPaths = /* @__PURE__ */ new Set();
|
|
138065
|
-
function wireDiagnosticsBusEmitterGetter(getter) {
|
|
138066
|
-
liveEmitter5.wireGetter(getter);
|
|
138067
|
-
}
|
|
138068
|
-
function capDiagnostics(diagnostics) {
|
|
138069
|
-
if (diagnostics.length <= MAX_DIAGNOSTICS_PER_FILE_EVENT) {
|
|
138070
|
-
return { capped: diagnostics, truncated: false };
|
|
138071
|
-
}
|
|
138072
|
-
const errors = diagnostics.filter((d) => d.severity === "error");
|
|
138073
|
-
const rest = diagnostics.filter((d) => d.severity !== "error");
|
|
138074
|
-
if (errors.length >= MAX_DIAGNOSTICS_PER_FILE_EVENT) {
|
|
138075
|
-
return {
|
|
138076
|
-
capped: errors.slice(0, MAX_DIAGNOSTICS_PER_FILE_EVENT),
|
|
138077
|
-
truncated: true
|
|
138078
|
-
};
|
|
138079
|
-
}
|
|
138080
|
-
return {
|
|
138081
|
-
capped: [
|
|
138082
|
-
...errors,
|
|
138083
|
-
...rest.slice(0, MAX_DIAGNOSTICS_PER_FILE_EVENT - errors.length)
|
|
138084
|
-
],
|
|
138085
|
-
truncated: true
|
|
138086
|
-
};
|
|
138087
|
-
}
|
|
138088
|
-
function publishDiagnostics(args) {
|
|
138089
|
-
if (args.origin === "bus")
|
|
138090
|
-
return;
|
|
138091
|
-
if (args.files.length === 0)
|
|
138092
|
-
return;
|
|
138093
|
-
publisher4.publish({
|
|
138094
|
-
event: BUS_DIAGNOSTICS_EVENT,
|
|
138095
|
-
enabled: isBusPublishEnabled(),
|
|
138096
|
-
cwd: args.cwd,
|
|
138097
|
-
build: (cwd) => {
|
|
138098
|
-
const fileEntries = args.files.map((f) => {
|
|
138099
|
-
const normPath = normalizeFilePath(f.path);
|
|
138100
|
-
const { capped, truncated } = capDiagnostics(f.diagnostics);
|
|
138101
|
-
if (capped.length > 0) {
|
|
138102
|
-
reportedDirtyPaths.add(normPath);
|
|
138103
|
-
} else {
|
|
138104
|
-
reportedDirtyPaths.delete(normPath);
|
|
138105
|
-
}
|
|
138106
|
-
const entry = {
|
|
138107
|
-
path: normPath,
|
|
138108
|
-
diagnostics: capped
|
|
138109
|
-
};
|
|
138110
|
-
if (truncated)
|
|
138111
|
-
entry.truncated = true;
|
|
138112
|
-
return entry;
|
|
138113
|
-
});
|
|
138114
|
-
seqCounter += 1;
|
|
138115
|
-
return {
|
|
138116
|
-
v: BUS_DIAGNOSTICS_VERSION,
|
|
138117
|
-
source: "pi-lens",
|
|
138118
|
-
cwd,
|
|
138119
|
-
seq: seqCounter,
|
|
138120
|
-
ts: Date.now(),
|
|
138121
|
-
files: fileEntries
|
|
138122
|
-
};
|
|
138123
|
-
},
|
|
138124
|
-
emittedFields: (payload) => ({
|
|
138125
|
-
fileCount: payload.files.length,
|
|
138126
|
-
seq: payload.seq
|
|
138127
|
-
}),
|
|
138128
|
-
dbg: args.dbg
|
|
138129
|
-
});
|
|
138130
|
-
}
|
|
138131
|
-
function wasPreviouslyReportedDirty(path235) {
|
|
138132
|
-
return reportedDirtyPaths.has(normalizeFilePath(path235));
|
|
138133
|
-
}
|
|
138134
|
-
|
|
138135
|
-
// dist/index.js
|
|
138368
|
+
init_diagnostics_publish();
|
|
138136
138369
|
init_disposition_publish();
|
|
138137
138370
|
init_format_events_publish();
|
|
138138
138371
|
|
|
@@ -138864,6 +139097,7 @@ init_bounded_telemetry();
|
|
|
138864
139097
|
init_latency_logger();
|
|
138865
139098
|
init_lens_events();
|
|
138866
139099
|
init_bus_publish();
|
|
139100
|
+
init_diagnostics_publish();
|
|
138867
139101
|
init_lsp_lazy();
|
|
138868
139102
|
init_builder();
|
|
138869
139103
|
init_tree_sitter_client();
|
|
@@ -141639,12 +141873,12 @@ init_path_utils();
|
|
|
141639
141873
|
init_deadline_utils();
|
|
141640
141874
|
init_language_registry();
|
|
141641
141875
|
import * as fs135 from "node:fs";
|
|
141642
|
-
import { extname as
|
|
141876
|
+
import { extname as extname24 } from "node:path";
|
|
141643
141877
|
var EXPANSION_LIMIT_LINES = 100;
|
|
141644
141878
|
var EXPANDED_SIZE_CAP_LINES = 300;
|
|
141645
141879
|
var EXPANSION_BUDGET_MS = 200;
|
|
141646
141880
|
function readExpansionLanguage(filePath) {
|
|
141647
|
-
return EXTENSION_TO_GRAMMAR[
|
|
141881
|
+
return EXTENSION_TO_GRAMMAR[extname24(filePath).toLowerCase()];
|
|
141648
141882
|
}
|
|
141649
141883
|
var ENCLOSING_TYPES = {
|
|
141650
141884
|
typescript: [
|
|
@@ -141706,8 +141940,17 @@ var ENCLOSING_TYPES = {
|
|
|
141706
141940
|
lua: ["function_declaration", "function_definition"],
|
|
141707
141941
|
ocaml: ["value_definition", "module_definition"],
|
|
141708
141942
|
zig: ["function_declaration"],
|
|
141709
|
-
bash: ["function_definition"]
|
|
141943
|
+
bash: ["function_definition"],
|
|
141944
|
+
groovy: [
|
|
141945
|
+
"method_declaration",
|
|
141946
|
+
"constructor_declaration",
|
|
141947
|
+
"class_declaration",
|
|
141948
|
+
"interface_declaration",
|
|
141949
|
+
"enum_declaration",
|
|
141950
|
+
"trait_declaration"
|
|
141951
|
+
]
|
|
141710
141952
|
};
|
|
141953
|
+
var LANGUAGES_NAMING_TYPES_BY_TYPE_IDENTIFIER = /* @__PURE__ */ new Set(["kotlin", "swift"]);
|
|
141711
141954
|
function findEnclosingNodeForRange(node, startRow, endRow, types) {
|
|
141712
141955
|
const nodeStartRow = node.startPosition?.row ?? 0;
|
|
141713
141956
|
const nodeEndRow = node.endPosition?.row ?? nodeStartRow;
|
|
@@ -141720,21 +141963,33 @@ function findEnclosingNodeForRange(node, startRow, endRow, types) {
|
|
|
141720
141963
|
}
|
|
141721
141964
|
return types.includes(node.type) ? node : void 0;
|
|
141722
141965
|
}
|
|
141723
|
-
function getSymbolName(node) {
|
|
141966
|
+
function getSymbolName(node, languageId) {
|
|
141724
141967
|
for (const child of node.children ?? []) {
|
|
141725
|
-
if (child.type === "identifier" || child.type === "property_identifier" ||
|
|
141968
|
+
if (child.type === "identifier" || child.type === "property_identifier" || // Groovy Spock feature method: `def "adds two numbers"()` (#5235).
|
|
141969
|
+
child.type === "quoted_identifier" || // Kotlin and Swift spell a function name this (#5320). Census
|
|
141970
|
+
// (`grep -c -a -o simple_identifier grammars/*.wasm` over the 26
|
|
141971
|
+
// shipped wasm): the node type ships in exactly those two grammars, so
|
|
141972
|
+
// unlike `type_identifier` it needs no per-language gate. A Kotlin
|
|
141973
|
+
// extension function keeps its receiver type in a `user_type` node, so
|
|
141974
|
+
// the first `simple_identifier` child is still the name
|
|
141975
|
+
// (`fun String.shout()` children: fun, user_type, .,
|
|
141976
|
+
// simple_identifier(shout), function_value_parameters, …).
|
|
141977
|
+
child.type === "simple_identifier" || child.type === "name" || // Kotlin and Swift name a class with `type_identifier`, the same node
|
|
141978
|
+
// type a Java method uses for its return type, so it is consulted only
|
|
141979
|
+
// for the grammars checked for it (#5320).
|
|
141980
|
+
LANGUAGES_NAMING_TYPES_BY_TYPE_IDENTIFIER.has(languageId) && child.type === "type_identifier") {
|
|
141726
141981
|
return child.text;
|
|
141727
141982
|
}
|
|
141728
141983
|
}
|
|
141729
141984
|
return node.type;
|
|
141730
141985
|
}
|
|
141731
|
-
function buildAncestryChain(node, types) {
|
|
141986
|
+
function buildAncestryChain(node, types, languageId) {
|
|
141732
141987
|
const chain = [];
|
|
141733
141988
|
let current = node.parent;
|
|
141734
141989
|
while (current) {
|
|
141735
141990
|
if (types.includes(current.type)) {
|
|
141736
141991
|
chain.push({
|
|
141737
|
-
name: getSymbolName(current),
|
|
141992
|
+
name: getSymbolName(current, languageId),
|
|
141738
141993
|
kind: current.type,
|
|
141739
141994
|
startLine: (current.startPosition?.row ?? 0) + 1
|
|
141740
141995
|
});
|
|
@@ -141817,12 +142072,12 @@ async function tryExpandRead(filePath, requestedOffset, requestedLimit, totalLin
|
|
|
141817
142072
|
if (!node)
|
|
141818
142073
|
return void 0;
|
|
141819
142074
|
return {
|
|
141820
|
-
name: getSymbolName(node),
|
|
142075
|
+
name: getSymbolName(node, languageId),
|
|
141821
142076
|
kind: node.type,
|
|
141822
142077
|
startRow: node.startPosition.row,
|
|
141823
142078
|
// biome-ignore lint/suspicious/noExplicitAny: endPosition not in local interface
|
|
141824
142079
|
endRow: node.endPosition?.row ?? node.startPosition.row,
|
|
141825
|
-
ancestry: buildAncestryChain(node, enclosingTypes)
|
|
142080
|
+
ancestry: buildAncestryChain(node, enclosingTypes, languageId)
|
|
141826
142081
|
};
|
|
141827
142082
|
}, "read-expansion"), remaining);
|
|
141828
142083
|
const enclosing = parsed?.parsed ? parsed.value : void 0;
|
|
@@ -142014,6 +142269,7 @@ function renderPostAutofixNotice(notice, decision) {
|
|
|
142014
142269
|
return `\u26A0\uFE0F **File was modified by auto-format/fix. You MUST re-read ${notice.targetPath} before making any further edits \u2014 the authoritative content is too large to attach.**${fileList}`;
|
|
142015
142270
|
case "aggregate-budget-degraded":
|
|
142016
142271
|
return `\u26A0\uFE0F **File was modified by auto-format/fix. You MUST re-read ${notice.targetPath} before making any further edits \u2014 the aggregate authoritative content for this command is too large to attach.**${fileList}`;
|
|
142272
|
+
case "none":
|
|
142017
142273
|
default:
|
|
142018
142274
|
return `\u26A0\uFE0F **File was modified by auto-format/fix. You MUST re-read modified file(s) before making any further edits \u2014 the content on disk has changed (whitespace, indentation, quotes, or code). Editing from memory will produce mismatches.**${fileList}`;
|
|
142019
142275
|
}
|
|
@@ -145511,7 +145767,7 @@ async function handleToolCallImpl(deps) {
|
|
|
145511
145767
|
let enclosingSymbol;
|
|
145512
145768
|
if (toolName === "read" && toolCallId !== void 0)
|
|
145513
145769
|
runtime2.takeReadWidening(toolCallId);
|
|
145514
|
-
const readExpansionClient = toolName === "read" && !getFlag("no-lsp") && !getFlag("no-read-guard") && !isExternalOrVendor && filePath && readInput && requestedReadLimit != null && requestedReadLimit <= EXPANSION_LIMIT_LINES ? getTreeSitterClient() : null;
|
|
145770
|
+
const readExpansionClient = toolName === "read" && !getFlag("no-lsp") && !getFlag("no-read-guard") && !getFlag("no-read-expansion") && !isExternalOrVendor && filePath && readInput && requestedReadLimit != null && requestedReadLimit <= EXPANSION_LIMIT_LINES ? getTreeSitterClient() : null;
|
|
145515
145771
|
if (readExpansionClient && filePath && readInput && requestedReadLimit != null) {
|
|
145516
145772
|
try {
|
|
145517
145773
|
const expansion = await tryExpandRead(filePath, requestedReadOffset, requestedReadLimit, readTotalLines, readExpansionClient);
|
|
@@ -147140,6 +147396,7 @@ init_widget_state();
|
|
|
147140
147396
|
init_warm_attach();
|
|
147141
147397
|
init_language_registry();
|
|
147142
147398
|
init_content_limits();
|
|
147399
|
+
init_runtime_config();
|
|
147143
147400
|
init_created_import_targets();
|
|
147144
147401
|
var MAX_FILES2 = 100;
|
|
147145
147402
|
var MAX_BATCH_FILES = 100;
|
|
@@ -147404,13 +147661,13 @@ function createLspDiagnosticsTool(nextWriteIndex, onConfirmedNoBlockers, getServ
|
|
|
147404
147661
|
}
|
|
147405
147662
|
};
|
|
147406
147663
|
}
|
|
147407
|
-
async function collectDiagnosticsForFile(absPath, lspService, scanRoot, waitMs, serverScope = "all", excludeServerIds) {
|
|
147664
|
+
async function collectDiagnosticsForFile(absPath, lspService, scanRoot, waitMs, serverScope = "all", excludeServerIds, explicitQuery = false) {
|
|
147408
147665
|
let timedOut = false;
|
|
147409
147666
|
let content;
|
|
147410
147667
|
let touched;
|
|
147411
147668
|
try {
|
|
147412
147669
|
content = fs147.readFileSync(absPath, "utf-8");
|
|
147413
|
-
const contentLimit = exceedsLspSyncLimits(content);
|
|
147670
|
+
const contentLimit = explicitQuery ? exceedsExplicitQueryLimits(content) : exceedsLspSyncLimits(content);
|
|
147414
147671
|
if (contentLimit.tooLarge) {
|
|
147415
147672
|
const reason = `file too large for LSP diagnostics (${contentLimit.reason})`;
|
|
147416
147673
|
recordDegradationOnce({
|
|
@@ -147475,6 +147732,7 @@ async function collectDiagnosticsForFile(absPath, lspService, scanRoot, waitMs,
|
|
|
147475
147732
|
diagnostics: "document",
|
|
147476
147733
|
collectDiagnostics: true,
|
|
147477
147734
|
maxClientWaitMs: waitMs,
|
|
147735
|
+
...explicitQuery && { explicitQuery },
|
|
147478
147736
|
source: "lsp_diagnostics",
|
|
147479
147737
|
clientScope: serverScope,
|
|
147480
147738
|
excludeServerIds,
|
|
@@ -147836,7 +148094,7 @@ async function runFileDiagnostics(absPath, severity, lspService, waitMs, nextWri
|
|
|
147836
148094
|
const pythonCompileTarget = await detectPythonTargetVersion(absPath);
|
|
147837
148095
|
lspService.announceCreatedFiles(goPackageFilesToAnnounce([absPath]), await importTargetsToAnnounce(cwd, [absPath]));
|
|
147838
148096
|
const observedAt = Date.now();
|
|
147839
|
-
const { diagnostics: rawDiags, timedOut, confirmedByTouch, unconfirmedServerIds, diagnosticsUnsupportedServerIds, content: collectedContent, binding, tooLargeReason, skipReason, primaryUnavailable, projectIdentity } = await collectDiagnosticsForFile(absPath, lspService, cwd, waitMs, serverScope, excludeServerIds);
|
|
148097
|
+
const { diagnostics: rawDiags, timedOut, confirmedByTouch, unconfirmedServerIds, diagnosticsUnsupportedServerIds, content: collectedContent, binding, tooLargeReason, skipReason, primaryUnavailable, projectIdentity } = await collectDiagnosticsForFile(absPath, lspService, cwd, waitMs, serverScope, excludeServerIds, true);
|
|
147840
148098
|
if (tooLargeReason !== void 0) {
|
|
147841
148099
|
return {
|
|
147842
148100
|
content: [{ type: "text", text: tooLargeReason }],
|
|
@@ -147917,7 +148175,7 @@ async function runFileDiagnostics(absPath, severity, lspService, waitMs, nextWri
|
|
|
147917
148175
|
return `Primary LSP${primaryId ? ` (${primaryId})` : ""}: unconfirmed \u2014 a custom server with no pull provider has not published diagnostics yet. NOT the same as 0 diagnostics; it is checked again once the server publishes.`;
|
|
147918
148176
|
}
|
|
147919
148177
|
if (timedOut) {
|
|
147920
|
-
return
|
|
148178
|
+
return `Primary LSP: check timed out \u2014 NOT the same as 0 diagnostics; the file may still have errors that just hadn't been reported yet. Re-check after the server settles, or pass a larger waitMs (this single-file query honours it up to ${RUNTIME_CONFIG.pipeline.lspExplicitQueryMaxWaitMs} ms).`;
|
|
147921
148179
|
}
|
|
147922
148180
|
if (rootFallback) {
|
|
147923
148181
|
return `Primary LSP${primaryId ? ` (${primaryId})` : ""}: unconfirmed \u2014 ${describeRootFallback(rootFallback)}. NOT the same as 0 diagnostics; check the file from inside its project and re-run.`;
|
|
@@ -149222,7 +149480,7 @@ function resolvePathsScope(entries) {
|
|
|
149222
149480
|
const key4 = normalizeFilePath(path226.resolve(filePath));
|
|
149223
149481
|
if (fileKeys.has(key4))
|
|
149224
149482
|
return true;
|
|
149225
|
-
return dirPrefixes.some((prefix) => key4
|
|
149483
|
+
return dirPrefixes.some((prefix) => isWithinForm(key4, prefix));
|
|
149226
149484
|
};
|
|
149227
149485
|
return {
|
|
149228
149486
|
includeFile,
|
|
@@ -150739,6 +150997,7 @@ function astGrepRemediationHint(kind) {
|
|
|
150739
150997
|
return "Hint: the operation timed out \u2014 scope `paths` to specific files/folders, or narrow the pattern.";
|
|
150740
150998
|
case "json_parse_failed":
|
|
150741
150999
|
return "Hint: ast-grep produced output that could not be parsed \u2014 retry with a simpler pattern; the installed CLI version may be incompatible.";
|
|
151000
|
+
case "other":
|
|
150742
151001
|
default:
|
|
150743
151002
|
return "Hint: verify the pattern is a single valid AST node for this `lang` (use ast_grep_search with dump=true to discover node kinds), or fall back to grep for plain-text search.";
|
|
150744
151003
|
}
|
|
@@ -151947,7 +152206,7 @@ function createAstGrepOutlineTool(astGrepClient) {
|
|
|
151947
152206
|
// dist/tools/lsp-navigation.js
|
|
151948
152207
|
import * as nodeFs15 from "node:fs";
|
|
151949
152208
|
import * as path230 from "node:path";
|
|
151950
|
-
import { fileURLToPath as
|
|
152209
|
+
import { fileURLToPath as fileURLToPath9, pathToFileURL as pathToFileURL8 } from "node:url";
|
|
151951
152210
|
init_latency_logger();
|
|
151952
152211
|
init_lsp_mutation();
|
|
151953
152212
|
init_request_timeout_error();
|
|
@@ -151961,7 +152220,7 @@ init_diagnostic_binding();
|
|
|
151961
152220
|
init_capabilities();
|
|
151962
152221
|
|
|
151963
152222
|
// dist/tools/lsp-structured-output.js
|
|
151964
|
-
import { fileURLToPath as
|
|
152223
|
+
import { fileURLToPath as fileURLToPath8, pathToFileURL as pathToFileURL7 } from "node:url";
|
|
151965
152224
|
function asRecord3(value) {
|
|
151966
152225
|
return typeof value === "object" && value !== null ? value : void 0;
|
|
151967
152226
|
}
|
|
@@ -152005,7 +152264,7 @@ function lspToolLocationFromUriRange(uri, range2) {
|
|
|
152005
152264
|
try {
|
|
152006
152265
|
return {
|
|
152007
152266
|
uri,
|
|
152008
|
-
filePath:
|
|
152267
|
+
filePath: fileURLToPath8(uri),
|
|
152009
152268
|
// LLM-facing coordinates: 1-based, matching editor/tool params.
|
|
152010
152269
|
range: {
|
|
152011
152270
|
start: {
|
|
@@ -153062,7 +153321,7 @@ function searchReadFromUriRange(uri, range2) {
|
|
|
153062
153321
|
const endLine2 = rangeLike?.end?.line;
|
|
153063
153322
|
try {
|
|
153064
153323
|
return {
|
|
153065
|
-
file:
|
|
153324
|
+
file: fileURLToPath9(uri),
|
|
153066
153325
|
startLine: Math.max(1, Math.floor(startLine) + 1),
|
|
153067
153326
|
endLine: typeof endLine2 === "number" && Number.isFinite(endLine2) ? Math.max(1, Math.floor(endLine2) + 1) : void 0
|
|
153068
153327
|
};
|
|
@@ -156185,7 +156444,7 @@ init_path_utils();
|
|
|
156185
156444
|
init_git_identity();
|
|
156186
156445
|
import * as fs150 from "node:fs";
|
|
156187
156446
|
import * as path232 from "node:path";
|
|
156188
|
-
import { fileURLToPath as
|
|
156447
|
+
import { fileURLToPath as fileURLToPath10 } from "node:url";
|
|
156189
156448
|
function resolveOwnedCommit(root) {
|
|
156190
156449
|
const identity = resolveGitIdentity(root);
|
|
156191
156450
|
if (!identity)
|
|
@@ -156206,7 +156465,7 @@ function readPackageVersion(root) {
|
|
|
156206
156465
|
}
|
|
156207
156466
|
function statEntryMtime(entryImportMetaUrl) {
|
|
156208
156467
|
try {
|
|
156209
|
-
return fs150.statSync(
|
|
156468
|
+
return fs150.statSync(fileURLToPath10(entryImportMetaUrl)).mtime.toISOString();
|
|
156210
156469
|
} catch {
|
|
156211
156470
|
return "unknown";
|
|
156212
156471
|
}
|
|
@@ -157728,6 +157987,15 @@ ${degradationLines.join("\n")}` : "";
|
|
|
157728
157987
|
if (lensWidgetVisible) {
|
|
157729
157988
|
mountLensWidget(ctx.ui, readExtensionMode(ctx));
|
|
157730
157989
|
}
|
|
157990
|
+
if (lensEnabled) {
|
|
157991
|
+
setImmediate(() => {
|
|
157992
|
+
void Promise.resolve().then(() => (init_package_manager(), package_manager_exports)).then((packageManager) => packageManager.primeGlobalBinDirs()).catch((err) => logExtension({
|
|
157993
|
+
subsystem: "dispatch",
|
|
157994
|
+
level: "warn",
|
|
157995
|
+
message: `global bin dir prime failed: ${err}`
|
|
157996
|
+
}));
|
|
157997
|
+
});
|
|
157998
|
+
}
|
|
157731
157999
|
} catch (sessionErr) {
|
|
157732
158000
|
if (isStaleExtensionCtxError(sessionErr))
|
|
157733
158001
|
throw sessionErr;
|