pi-lens 4.4.11 → 4.5.0
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 +12 -12
- package/CHANGELOG.md +202 -0
- package/README.md +104 -217
- package/dist/{chunk-34RXPR7M.js → chunk-27JQHK7Y.js} +1 -1
- package/dist/{chunk-W6VLB6LL.js → chunk-2APSZHHI.js} +61 -3
- package/dist/{chunk-NLRKB32C.js → chunk-2H5GHZKC.js} +8 -8
- package/dist/{chunk-BJDB7PXU.js → chunk-2H7NFZ4Q.js} +11 -11
- package/dist/{chunk-OC4ZGVMH.js → chunk-37IDWT6O.js} +65 -19
- package/dist/{chunk-A4HKPAEN.js → chunk-3PAS2ERX.js} +8 -8
- package/dist/{chunk-DNB4ZQGN.js → chunk-3PO4YYOX.js} +9 -17
- package/dist/{chunk-SQBDX6IO.js → chunk-3QXFUP6T.js} +11 -11
- package/dist/{chunk-YVPB5YGO.js → chunk-3TSMQZG6.js} +32 -11
- package/dist/{chunk-3C6ZZAB2.js → chunk-4DAHGU3V.js} +16 -17
- package/dist/{chunk-BN36MQW5.js → chunk-4IZZEN63.js} +33 -36
- package/dist/{chunk-OYXD2MOM.js → chunk-5HBQL7DH.js} +2 -2
- package/dist/{chunk-B4FAFEBP.js → chunk-5JB4WENL.js} +1 -1
- package/dist/chunk-5YJXF2IS.js +56 -0
- package/dist/{chunk-AVOUHMCS.js → chunk-6CFSDLHE.js} +22 -18
- package/dist/{chunk-C4ICGFEO.js → chunk-6E5QLMWI.js} +24 -22
- package/dist/{chunk-WBXCIRVI.js → chunk-6GLMMGCX.js} +2 -2
- package/dist/{chunk-C2REOMPO.js → chunk-74AMPWNC.js} +2 -2
- package/dist/{chunk-K2GV34T2.js → chunk-7CLWC2UH.js} +26 -37
- package/dist/{chunk-NQFXN5U7.js → chunk-7DPXUPRF.js} +2 -2
- package/dist/{chunk-QAM2Q3VO.js → chunk-7U36VQL6.js} +2 -2
- package/dist/{chunk-2SD2CGVH.js → chunk-7WKVCZI4.js} +1 -1
- package/dist/{chunk-R2VUZZPJ.js → chunk-7ZVTFLCC.js} +10 -10
- package/dist/{chunk-IT7MFVGP.js → chunk-ADYQRETD.js} +2 -2
- package/dist/{chunk-532X3OCZ.js → chunk-ARTYCUGF.js} +28 -15
- package/dist/{chunk-DBAHJFBU.js → chunk-AXAR5ZW2.js} +228 -112
- package/dist/{chunk-KNP4ENFT.js → chunk-AZG5UJYY.js} +1 -1
- package/dist/{chunk-ITAPXBIB.js → chunk-B2OXE4AH.js} +60 -21
- package/dist/{chunk-PSUXESQ5.js → chunk-B42AIWPJ.js} +2 -2
- package/dist/{chunk-AJ62EQIQ.js → chunk-BBSDJTOV.js} +18 -16
- package/dist/{chunk-R2UF54ON.js → chunk-BKWFDWYM.js} +16 -16
- package/dist/{chunk-ZD4KVFXI.js → chunk-C5PLBTNR.js} +172 -3
- package/dist/{chunk-SRXYSLMW.js → chunk-CQY2HEH7.js} +1 -1
- package/dist/{chunk-7424ANRU.js → chunk-CXQYK4YT.js} +1 -1
- package/dist/{chunk-WXMUGUZV.js → chunk-CZJGAOKL.js} +8 -7
- package/dist/{chunk-QUZYRDT6.js → chunk-DCA2MXVQ.js} +11 -11
- package/dist/{chunk-HASJPQBC.js → chunk-DFKOA74L.js} +9 -9
- package/dist/{chunk-AYDE7RFV.js → chunk-DI4AZZNY.js} +2 -2
- package/dist/{chunk-GL6J5R34.js → chunk-G53LBDNU.js} +99 -5
- package/dist/chunk-GCSDF5IE.js +27 -0
- package/dist/{chunk-KBSC5Z3G.js → chunk-H5API74E.js} +6 -6
- package/dist/chunk-HBX55MWO.js +27 -0
- package/dist/{chunk-6RXMQYNU.js → chunk-HIJ4CHFF.js} +2 -2
- package/dist/{chunk-NWK7KKNO.js → chunk-HIRBC72R.js} +4 -4
- package/dist/{chunk-4WWPDMRA.js → chunk-HRLF35WL.js} +8 -8
- package/dist/{chunk-NR4KQOXZ.js → chunk-I2FYOZNW.js} +9 -9
- package/dist/{chunk-VDMF7Q2P.js → chunk-I3NZVAMN.js} +9 -9
- package/dist/{chunk-DPDA3ILA.js → chunk-INBK3HIT.js} +3 -3
- package/dist/{chunk-VI3BJMZO.js → chunk-J2ZB5MDS.js} +22 -24
- package/dist/{chunk-6XNVY3FW.js → chunk-JGUDT5KD.js} +4 -4
- package/dist/chunk-JOIKBUQN.js +88 -0
- package/dist/{chunk-VTXJAO5R.js → chunk-K4Z7MK6T.js} +169 -165
- package/dist/{chunk-GTNO6F6K.js → chunk-K7O6AHSJ.js} +10 -10
- package/dist/{chunk-WMCAEP2K.js → chunk-KNJH6WJQ.js} +6 -6
- package/dist/{chunk-SUIZOCSY.js → chunk-KNSOA43J.js} +1 -1
- package/dist/{chunk-OP5BMZKK.js → chunk-KXGTLAUW.js} +2 -2
- package/dist/{chunk-BLL4VYGZ.js → chunk-KZ732ZVW.js} +1 -1
- package/dist/{chunk-TRYOYWWU.js → chunk-L6BDRYUK.js} +19 -17
- package/dist/{chunk-FVEEEEIM.js → chunk-LGH2HHZG.js} +24 -6
- package/dist/{chunk-3R3Z54J7.js → chunk-LOEJFTF2.js} +1 -1
- package/dist/{chunk-HGEE5LDW.js → chunk-LQQNFCQJ.js} +1 -1
- package/dist/chunk-LVLPA32Q.js +810 -0
- package/dist/chunk-M2YMBT5G.js +73 -0
- package/dist/{chunk-KX4DF6XX.js → chunk-MJRGPEQ5.js} +11 -11
- package/dist/{chunk-3QCI3V6C.js → chunk-MOAVEPC4.js} +10 -10
- package/dist/{chunk-AFNPNHJV.js → chunk-NGNBJIUO.js} +7 -7
- package/dist/{chunk-AGEQRJ5A.js → chunk-NHA5K226.js} +1 -1
- package/dist/{chunk-HTUG7ZFK.js → chunk-NNEQOC3U.js} +31 -59
- package/dist/{chunk-6K4X7IIF.js → chunk-O2MHF7QM.js} +35 -38
- package/dist/{chunk-4HNBY7S7.js → chunk-OLWGYBYT.js} +15 -18
- package/dist/{chunk-IBEYUBCM.js → chunk-OZQQ3AIR.js} +17 -20
- package/dist/{chunk-LXE7JAMV.js → chunk-P5MSLVUW.js} +10 -10
- package/dist/{chunk-TBE4OLPA.js → chunk-PFJLYRO3.js} +37 -40
- package/dist/chunk-PKWEBMCA.js +2957 -0
- package/dist/{chunk-LHU6NG5Z.js → chunk-PPQHMSPH.js} +16 -15
- package/dist/{chunk-6EIV3H7O.js → chunk-PQF6YGYB.js} +12 -5
- package/dist/{chunk-BBJXIZ3X.js → chunk-PQXUZYTQ.js} +6 -35
- package/dist/{chunk-IJ55MYO6.js → chunk-Q7J3JYJ2.js} +13 -12
- package/dist/{chunk-BMMRLJA4.js → chunk-QE5DJ7MX.js} +27 -10
- package/dist/{chunk-E6Z3CJT2.js → chunk-QE7BJQ6K.js} +7 -7
- package/dist/{chunk-UY3WWW5R.js → chunk-QMWKSYWB.js} +4 -4
- package/dist/{chunk-QJ4T73J5.js → chunk-QV3JPCMK.js} +1 -1
- package/dist/{chunk-3NVGBFJS.js → chunk-R4L7KZ7R.js} +5 -5
- package/dist/{chunk-KDMJ2DJD.js → chunk-RIH3UBK4.js} +10 -10
- package/dist/{chunk-T5EGSBM2.js → chunk-RJ3APNIP.js} +3 -3
- package/dist/{chunk-D5L7Q57Z.js → chunk-S6MCMD27.js} +35 -12
- package/dist/{chunk-LPM6NKVI.js → chunk-SCU62JLX.js} +6 -6
- package/dist/{chunk-LHCDWFDB.js → chunk-SDYLT45T.js} +3 -3
- package/dist/chunk-TFKN5EIR.js +27 -0
- package/dist/{chunk-TPMBNWHO.js → chunk-TKOFTLGB.js} +34 -26
- package/dist/chunk-TQWRH25U.js +35 -0
- package/dist/{chunk-QBUSONNE.js → chunk-TWEOJE3D.js} +307 -74
- package/dist/{chunk-5RLEDUUE.js → chunk-UN72ZAJ5.js} +8 -8
- package/dist/{chunk-LIDFFCZZ.js → chunk-UNP6Y4JV.js} +16 -16
- package/dist/{chunk-HIUVHRLM.js → chunk-VGRGW4UL.js} +63 -57
- package/dist/{chunk-AOQKQWZU.js → chunk-VSQT6IHZ.js} +2 -2
- package/dist/{chunk-B4K6OSLL.js → chunk-VWEBZ2JV.js} +39 -40
- package/dist/chunk-W26QZ3OM.js +355 -0
- package/dist/{chunk-KDGKKK7A.js → chunk-XDNWR7SG.js} +2 -2
- package/dist/{chunk-TTGDTNSN.js → chunk-XSC3BCN3.js} +5 -5
- package/dist/{chunk-ME6MF2N2.js → chunk-YCR6ZYTE.js} +1 -1
- package/dist/{chunk-QDZ3ZZMY.js → chunk-ZI7YHV6I.js} +5 -5
- package/dist/{chunk-E3PNZDPH.js → chunk-ZQSSO7LO.js} +33 -1
- package/dist/{chunk-ECYUBKYX.js → chunk-ZULZS2I6.js} +391 -410
- package/dist/index.js +7314 -5703
- package/dist/mcp/analyze-cli.js +11 -13
- package/dist/mcp/cli.js +39 -40
- package/dist/mcp/server.js +618 -360
- package/dist/mcp/worker.js +57 -60
- package/dist/probes/installer.js +19 -17
- package/docs/agent-tools.md +54 -12
- package/docs/architecture.md +113 -0
- package/docs/ast-grep_rules_catalog.md +2 -2
- package/docs/ci.md +18 -4
- package/docs/configuration.md +3 -3
- package/docs/defect-shapes.md +41 -3
- package/docs/dependencies.md +10 -10
- package/docs/features.md +3 -3
- package/docs/globalconfig.md +8 -1
- package/docs/invariants/dispatch-runners.md +13 -1
- package/docs/invariants/lsp-trust-exec.md +26 -0
- package/docs/language-coverage.md +39 -0
- package/docs/lsp-capability-matrix.md +10 -4
- package/docs/lsp-idle-eviction.md +1 -1
- package/docs/mcp.md +2 -1
- package/docs/pi-lens-fixer.md +4 -0
- package/docs/pi-lens-merge-policy.md +1 -1
- package/docs/pi-lens-reviewer.md +4 -5
- package/docs/pi-lens-subagent.md +5 -2
- package/docs/prose-standard.md +112 -0
- package/docs/servercapabilities.md +1 -1
- package/docs/usage.md +51 -1
- package/package.json +1 -1
- package/rules/ast-grep-rules/rule-tests/array-callback-return-js-test.yml +23 -0
- package/rules/ast-grep-rules/rule-tests/array-callback-return-test.yml +23 -0
- package/rules/ast-grep-rules/rule-tests/no-negation-in-equality-check-js-test.yml +8 -0
- package/rules/ast-grep-rules/rule-tests/no-negation-in-equality-check-test.yml +8 -0
- package/rules/ast-grep-rules/rule-tests/unchecked-throwing-call-js-test.yml +16 -0
- package/rules/ast-grep-rules/rule-tests/unchecked-throwing-call-test.yml +16 -0
- package/rules/ast-grep-rules/rules/array-callback-return-js.yml +8 -0
- package/rules/ast-grep-rules/rules/array-callback-return.yml +8 -0
- package/rules/ast-grep-rules/rules/no-negation-in-equality-check-js.yml +17 -5
- package/rules/ast-grep-rules/rules/no-negation-in-equality-check.yml +17 -5
- package/rules/ast-grep-rules/rules/unchecked-throwing-call-js.yml +8 -1
- package/rules/ast-grep-rules/rules/unchecked-throwing-call.yml +8 -1
- package/rules/tree-sitter-queries/typescript/ts-react-antipatterns.yml +8 -0
- package/dist/chunk-3HZ6MNB2.js +0 -140
- package/dist/chunk-43KD3PPM.js +0 -162
- package/dist/chunk-5YTDZ5WP.js +0 -38
- package/dist/chunk-CKEQFGLT.js +0 -32
- package/dist/chunk-F37CCZUA.js +0 -27
- package/dist/chunk-JSQK5DH3.js +0 -256
- package/dist/chunk-R5BNSOIV.js +0 -29
- package/dist/chunk-RV5VX2XW.js +0 -29
- package/dist/chunk-UELHWF5I.js +0 -1037
- package/dist/chunk-UG4YLCJ5.js +0 -58
- package/dist/chunk-UQ6OZYTO.js +0 -91
- package/dist/chunk-V7IPIAE5.js +0 -74
- package/dist/chunk-YUF4DRYB.js +0 -2417
|
@@ -1,40 +1,26 @@
|
|
|
1
1
|
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
resolveOpengrepConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7WKVCZI4.js";
|
|
5
5
|
import {
|
|
6
6
|
PYTHON_COMPILE_VERDICT_SERVER_ID,
|
|
7
7
|
augmentPythonEnvironment,
|
|
8
8
|
detectPythonEnvironment,
|
|
9
9
|
pythonEnvironmentToolCandidates
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2H5GHZKC.js";
|
|
11
11
|
import {
|
|
12
12
|
scannerReportParentDir
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
hasCargoWorkspaceTable,
|
|
16
|
-
readCargoWorkspaceExclude,
|
|
17
|
-
readCargoWorkspaceMembers,
|
|
18
|
-
readTextFileOrUndefined
|
|
19
|
-
} from "./chunk-SUIZOCSY.js";
|
|
13
|
+
} from "./chunk-QV3JPCMK.js";
|
|
20
14
|
import {
|
|
21
15
|
getUserRuleRoot,
|
|
22
|
-
ruleCorpusFingerprintForCycle
|
|
23
|
-
} from "./chunk-5YTDZ5WP.js";
|
|
24
|
-
import {
|
|
25
16
|
load,
|
|
26
|
-
resolvePackagePath
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
HOOK_WALL_BUDGET_MS
|
|
30
|
-
} from "./chunk-CKEQFGLT.js";
|
|
17
|
+
resolvePackagePath,
|
|
18
|
+
ruleCorpusFingerprintForCycle
|
|
19
|
+
} from "./chunk-ZQSSO7LO.js";
|
|
31
20
|
import {
|
|
32
21
|
extensionsForLanguage,
|
|
33
22
|
isTypeScriptFile
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import {
|
|
36
|
-
bounded
|
|
37
|
-
} from "./chunk-3HZ6MNB2.js";
|
|
23
|
+
} from "./chunk-DI4AZZNY.js";
|
|
38
24
|
import {
|
|
39
25
|
ensureTool,
|
|
40
26
|
findManagedToolBinary,
|
|
@@ -44,15 +30,21 @@ import {
|
|
|
44
30
|
isZizmorAuditTarget,
|
|
45
31
|
logSessionStart,
|
|
46
32
|
resolveZizmorGitHubToken
|
|
47
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-B2OXE4AH.js";
|
|
48
34
|
import {
|
|
49
35
|
resolveToolCwd
|
|
50
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-LVLPA32Q.js";
|
|
51
37
|
import {
|
|
52
38
|
commandSearchReachesProject,
|
|
53
39
|
findGlobalBinary,
|
|
54
40
|
isProjectLocalBinPath
|
|
55
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-LGH2HHZG.js";
|
|
42
|
+
import {
|
|
43
|
+
hasCargoWorkspaceTable,
|
|
44
|
+
readCargoWorkspaceExclude,
|
|
45
|
+
readCargoWorkspaceMembers,
|
|
46
|
+
readTextFileOrUndefined
|
|
47
|
+
} from "./chunk-KNSOA43J.js";
|
|
56
48
|
import {
|
|
57
49
|
classifyFinderFailure,
|
|
58
50
|
classifyProbeFailure,
|
|
@@ -60,10 +52,10 @@ import {
|
|
|
60
52
|
describeInstallAttempt,
|
|
61
53
|
logAvailabilityDecision,
|
|
62
54
|
startHostStallSampler
|
|
63
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-6GLMMGCX.js";
|
|
64
56
|
import {
|
|
65
57
|
readDirEntriesSafeAsync
|
|
66
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-74AMPWNC.js";
|
|
67
59
|
import {
|
|
68
60
|
OWNER_TAG_ENV,
|
|
69
61
|
SpawnFailureError,
|
|
@@ -92,13 +84,13 @@ import {
|
|
|
92
84
|
safeSpawnAsync,
|
|
93
85
|
statIsFile,
|
|
94
86
|
trustScopedEnvironment
|
|
95
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-3PO4YYOX.js";
|
|
96
88
|
import {
|
|
97
89
|
DOTNET_CSHARP_ROOT_MARKERS,
|
|
98
90
|
DOTNET_FSHARP_ROOT_MARKERS,
|
|
99
91
|
KIND_EXTENSIONS,
|
|
100
92
|
LEAN_ROOT_MARKERS
|
|
101
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-CQY2HEH7.js";
|
|
102
94
|
import {
|
|
103
95
|
boundedKeyLabel,
|
|
104
96
|
finalizeRecords,
|
|
@@ -110,7 +102,7 @@ import {
|
|
|
110
102
|
reportPiLensConfigRecords,
|
|
111
103
|
resolvePiLensConfig,
|
|
112
104
|
summarizeConfigResolution
|
|
113
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-PQF6YGYB.js";
|
|
114
106
|
import {
|
|
115
107
|
FRESHNESS_CADENCE_MS,
|
|
116
108
|
LSP_NAMESPACE_KEY,
|
|
@@ -121,17 +113,19 @@ import {
|
|
|
121
113
|
getDirectoryMarkers,
|
|
122
114
|
getPiLensGlobalConfigPath,
|
|
123
115
|
unknownDirMtimeRecords
|
|
124
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-LOEJFTF2.js";
|
|
125
117
|
import {
|
|
118
|
+
HOOK_WALL_BUDGET_MS,
|
|
119
|
+
bounded,
|
|
126
120
|
getProjectTrustGeneration,
|
|
127
121
|
getProjectTrustState
|
|
128
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-W26QZ3OM.js";
|
|
129
123
|
import {
|
|
130
124
|
getDegradationLedgerGeneration,
|
|
131
125
|
incrementDegradationCount,
|
|
132
126
|
logExtension,
|
|
133
127
|
recordDegradationOnce
|
|
134
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-NHA5K226.js";
|
|
135
129
|
import {
|
|
136
130
|
claimPhaseOncePerSession,
|
|
137
131
|
currentSessionRecordId,
|
|
@@ -142,7 +136,7 @@ import {
|
|
|
142
136
|
logLatency,
|
|
143
137
|
redactSecrets,
|
|
144
138
|
releasePhaseClaim
|
|
145
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-7CLWC2UH.js";
|
|
146
140
|
import {
|
|
147
141
|
STAGE_TMP_PATTERN
|
|
148
142
|
} from "./chunk-LJDODBBZ.js";
|
|
@@ -1008,8 +1002,7 @@ function recordUntrustedLspExecution(request, trust) {
|
|
|
1008
1002
|
});
|
|
1009
1003
|
}
|
|
1010
1004
|
}
|
|
1011
|
-
function refuseUntrustedLspExecution(request) {
|
|
1012
|
-
const trust = getProjectTrustState();
|
|
1005
|
+
function refuseUntrustedLspExecution(request, trust = getProjectTrustState()) {
|
|
1013
1006
|
const needsTrust = request.kind === "project-code-server" ? trust !== "trusted" : !admitProjectSuppliedTsserver(request.resolvedCommand, request.cwd, true);
|
|
1014
1007
|
if (!needsTrust)
|
|
1015
1008
|
return;
|
|
@@ -1313,6 +1306,9 @@ async function launchLSP(command, args = [], options = {}) {
|
|
|
1313
1306
|
args
|
|
1314
1307
|
};
|
|
1315
1308
|
}
|
|
1309
|
+
async function launchViaNode(scriptPath, args = [], options = {}) {
|
|
1310
|
+
return launchLSP(process.execPath, [scriptPath, ...args], options);
|
|
1311
|
+
}
|
|
1316
1312
|
|
|
1317
1313
|
// dist/clients/lsp/config.js
|
|
1318
1314
|
function asRecord(value) {
|
|
@@ -2047,13 +2043,25 @@ var SERVER_DIAGNOSTIC_STRATEGIES = {
|
|
|
2047
2043
|
// applies this flag to a native-ts7 instance.
|
|
2048
2044
|
silentOnClean: true
|
|
2049
2045
|
},
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2046
|
+
// rust (rust-analyzer) has NO row on purpose (#5485). The row that stood
|
|
2047
|
+
// here was keyed `rust-analyzer`, the display name, not the registry id, so
|
|
2048
|
+
// it never applied and rust (a `mode=pull` server) waited on
|
|
2049
|
+
// DEFAULT_STRATEGY; its 3000 / 500 / second-push values were a design
|
|
2050
|
+
// guess (commit 3bf9ff93b), never measured. Re-keyed as they were, a cold
|
|
2051
|
+
// `lsp_touch_file` still reads clean: 0 of 5 cold touches returned the
|
|
2052
|
+
// fixture's type error at 3000 / 500 (and 0 of 5 on the default), because
|
|
2053
|
+
// rust-analyzer answers an EMPTY authoritative report for ~0.4 s and the
|
|
2054
|
+
// finding lands at 3.6-3.9 s. The `lsp_diagnostics` route differs only in
|
|
2055
|
+
// degree (review r1, default: 3 of 5 cold runs found it, 2 returned clean).
|
|
2056
|
+
// Only a pull-retry budget above that catches it (7000 / 6000: 3 of 3 on the
|
|
2057
|
+
// touch seam), and the retry loop cannot tell a clean file from a loading
|
|
2058
|
+
// one, so every clean touch then pays the whole budget (6.7-6.9 s vs 0.9 s
|
|
2059
|
+
// on the touch seam; 12.6-12.8 s vs 1.1-1.7 s on `lsp_diagnostics`). That
|
|
2060
|
+
// trade is a maintainer decision, not a key rename. #5487 closed the false
|
|
2061
|
+
// clean without it: the client asks rust-analyzer for
|
|
2062
|
+
// `experimental/serverStatus` and holds a pull to its `quiescent` flag, so
|
|
2063
|
+
// a cold touch is inconclusive (`server-loading`), never clean. Raw numbers:
|
|
2064
|
+
// tests/fixtures/lsp-wait-measurements/rust-5485.json.
|
|
2057
2065
|
// PythonServer (pyright / basedpyright) — openFilesOnly mode: lazy per-file
|
|
2058
2066
|
// analysis, startup similar to jedi. seedFirstPush: true because pyright's
|
|
2059
2067
|
// first publishDiagnostics after didOpen is the complete result for that file.
|
|
@@ -2076,13 +2084,6 @@ var SERVER_DIAGNOSTIC_STRATEGIES = {
|
|
|
2076
2084
|
aggregateWaitMs: 3e3,
|
|
2077
2085
|
expectSemanticSecondPush: false
|
|
2078
2086
|
},
|
|
2079
|
-
eslint: {
|
|
2080
|
-
seedFirstPush: true,
|
|
2081
|
-
pullRetryBudgetMs: 0,
|
|
2082
|
-
debounceMs: 200,
|
|
2083
|
-
aggregateWaitMs: 2e3,
|
|
2084
|
-
expectSemanticSecondPush: false
|
|
2085
|
-
},
|
|
2086
2087
|
// Opengrep security scanner (cross-language LSP). It pushes an EMPTY result
|
|
2087
2088
|
// during the one-time rule-load window at startup, then the real scan after
|
|
2088
2089
|
// `semgrep/rulesRefreshed` — so never seed the first push, and hold that
|
|
@@ -2357,6 +2358,35 @@ var SERVER_DIAGNOSTIC_STRATEGIES = {
|
|
|
2357
2358
|
aggregateWaitMs: 6e3,
|
|
2358
2359
|
expectSemanticSecondPush: false
|
|
2359
2360
|
},
|
|
2361
|
+
// deno (the typescript alternate) is a PULL server (`mode=pull`,
|
|
2362
|
+
// docs/lsp-capability-matrix.md) that answers every cold touch, but the
|
|
2363
|
+
// answer can take longer than DEFAULT_STRATEGY's 1500ms: the pull is
|
|
2364
|
+
// abandoned and the touch reads `touched=0` (#5464). MEASURED over the
|
|
2365
|
+
// nightly tool-smoke `LSP handshake layer` row, spawn + initialize + pull:
|
|
2366
|
+
// * green 1.27, 1.59, 1.57, 3.80, 3.42s (five runs, 2026-11-06..08);
|
|
2367
|
+
// * red at the 1500 default: 4.60s (d8bd7a331) and 4.15s (242b2e3d2) —
|
|
2368
|
+
// same runner image and deno 2.9.8 on both sides, so the touch time
|
|
2369
|
+
// moved, not the code.
|
|
2370
|
+
// A CPU-starved local host (one core shared with 4 busy loops, cold HOME)
|
|
2371
|
+
// reproduced the red 3 of 3 at the default and completed in 3.86, 4.02 and
|
|
2372
|
+
// 5.49s once the cap was lifted (two further runs ran past an 8000ms pull
|
|
2373
|
+
// and are not covered by any budget under the gate's ceiling). Raw numbers:
|
|
2374
|
+
// tests/fixtures/lsp-wait-measurements/deno-5464.json, pinned by
|
|
2375
|
+
// tests/clients/lsp/server-strategies.test.ts. 7000 = 1.25 x the slowest
|
|
2376
|
+
// COMPLETED touch (5.49s). It is a ceiling, not a delay: a pull server that
|
|
2377
|
+
// answers returns at once, so a warm or fast touch pays nothing, and the
|
|
2378
|
+
// budget is only paid in full when deno never answers an uncapped call.
|
|
2379
|
+
// The CI runner was not instrumented for this row: the CI figures are
|
|
2380
|
+
// run-log timestamps, the starved ones are this host's.
|
|
2381
|
+
// Every other field is DEFAULT_STRATEGY's on purpose: nothing measured
|
|
2382
|
+
// deno's pull retry or debounce, so this entry moves the one field that was.
|
|
2383
|
+
deno: {
|
|
2384
|
+
seedFirstPush: false,
|
|
2385
|
+
pullRetryBudgetMs: 250,
|
|
2386
|
+
debounceMs: 150,
|
|
2387
|
+
aggregateWaitMs: 7e3,
|
|
2388
|
+
expectSemanticSecondPush: false
|
|
2389
|
+
},
|
|
2360
2390
|
cue: {
|
|
2361
2391
|
seedFirstPush: true,
|
|
2362
2392
|
pullRetryBudgetMs: 0,
|
|
@@ -4011,12 +4041,45 @@ async function findTsserverPath(root, allowInstall, options) {
|
|
|
4011
4041
|
}));
|
|
4012
4042
|
return tsserverForTsc(repairedTsc);
|
|
4013
4043
|
}
|
|
4044
|
+
function typeScriptMajor(version) {
|
|
4045
|
+
const majorText = version.split(".", 1)[0] ?? "";
|
|
4046
|
+
return /^\d+$/.test(majorText) ? Number(majorText) : Number.NaN;
|
|
4047
|
+
}
|
|
4048
|
+
async function findTypeScriptNativeAlias(nodeModulesDir) {
|
|
4049
|
+
const aliasDir = path8.join(nodeModulesDir, "@typescript", "native");
|
|
4050
|
+
let manifest;
|
|
4051
|
+
try {
|
|
4052
|
+
manifest = JSON.parse(await readFile(path8.join(aliasDir, "package.json"), "utf8"));
|
|
4053
|
+
} catch {
|
|
4054
|
+
return void 0;
|
|
4055
|
+
}
|
|
4056
|
+
if (typeof manifest !== "object" || manifest === null)
|
|
4057
|
+
return void 0;
|
|
4058
|
+
const { name, version, bin } = manifest;
|
|
4059
|
+
if (name !== "typescript")
|
|
4060
|
+
return void 0;
|
|
4061
|
+
if (typeof version !== "string" || !(typeScriptMajor(version) >= 7)) {
|
|
4062
|
+
return void 0;
|
|
4063
|
+
}
|
|
4064
|
+
const tsc = typeof bin === "object" && bin !== null ? bin.tsc : void 0;
|
|
4065
|
+
if (typeof tsc !== "string" || !tsc)
|
|
4066
|
+
return void 0;
|
|
4067
|
+
const command = path8.resolve(aliasDir, tsc);
|
|
4068
|
+
try {
|
|
4069
|
+
if (!(await stat(command)).isFile())
|
|
4070
|
+
return void 0;
|
|
4071
|
+
} catch {
|
|
4072
|
+
return void 0;
|
|
4073
|
+
}
|
|
4074
|
+
return { command, version };
|
|
4075
|
+
}
|
|
4014
4076
|
async function findNativeTypeScriptLsp(root) {
|
|
4015
4077
|
const home = realpathOrResolve(os6.homedir());
|
|
4016
4078
|
for (const currentDir of walkUpDirs(root, { spelling: true })) {
|
|
4017
4079
|
if (isAtOrAboveHomeDir(realpathOrResolve(currentDir), home))
|
|
4018
4080
|
break;
|
|
4019
|
-
const
|
|
4081
|
+
const nodeModulesDir = path8.join(currentDir, "node_modules");
|
|
4082
|
+
const typescriptDir = path8.join(nodeModulesDir, "typescript");
|
|
4020
4083
|
const packageJsonPath = path8.join(typescriptDir, "package.json");
|
|
4021
4084
|
let packageJsonText;
|
|
4022
4085
|
try {
|
|
@@ -4043,11 +4106,14 @@ async function findNativeTypeScriptLsp(root) {
|
|
|
4043
4106
|
} catch {
|
|
4044
4107
|
return void 0;
|
|
4045
4108
|
}
|
|
4046
|
-
const
|
|
4047
|
-
|
|
4048
|
-
if (!Number.isFinite(major) || major < 7)
|
|
4109
|
+
const major = typeScriptMajor(version);
|
|
4110
|
+
if (!Number.isFinite(major))
|
|
4049
4111
|
return void 0;
|
|
4050
|
-
|
|
4112
|
+
if (major < 7) {
|
|
4113
|
+
const alias = await findTypeScriptNativeAlias(nodeModulesDir);
|
|
4114
|
+
return alias && { ...alias, entry: "node-script", nodeModulesDir };
|
|
4115
|
+
}
|
|
4116
|
+
const localTsc = path8.join(nodeModulesDir, ".bin", "tsc");
|
|
4051
4117
|
const candidates = process.platform === "win32" ? [`${localTsc}.cmd`, `${localTsc}.exe`, localTsc] : [localTsc];
|
|
4052
4118
|
for (const command of candidates) {
|
|
4053
4119
|
try {
|
|
@@ -4055,7 +4121,8 @@ async function findNativeTypeScriptLsp(root) {
|
|
|
4055
4121
|
return {
|
|
4056
4122
|
command,
|
|
4057
4123
|
version,
|
|
4058
|
-
|
|
4124
|
+
entry: "bin-link",
|
|
4125
|
+
nodeModulesDir
|
|
4059
4126
|
};
|
|
4060
4127
|
} catch {
|
|
4061
4128
|
}
|
|
@@ -4064,6 +4131,59 @@ async function findNativeTypeScriptLsp(root) {
|
|
|
4064
4131
|
}
|
|
4065
4132
|
return void 0;
|
|
4066
4133
|
}
|
|
4134
|
+
async function launchNativeTypeScript(nativeLsp, root, options) {
|
|
4135
|
+
if (!admitProjectSuppliedTsserver(nativeLsp.command, root, true, options?.projectCodeAllowed)) {
|
|
4136
|
+
return void 0;
|
|
4137
|
+
}
|
|
4138
|
+
const env = await getToolEnvironment();
|
|
4139
|
+
logSessionStart(`lsp typescript-native: version=${nativeLsp.version} command=${nativeLsp.command} entry=${nativeLsp.entry}`);
|
|
4140
|
+
const args = ["--lsp", "--stdio"];
|
|
4141
|
+
if (nativeLsp.entry !== "node-script") {
|
|
4142
|
+
const proc2 = await launchLSP(nativeLsp.command, args, { cwd: root, env });
|
|
4143
|
+
return { process: proc2, source: "direct", launchVariant: "native-ts7" };
|
|
4144
|
+
}
|
|
4145
|
+
const classicInstead = async (failure, why) => {
|
|
4146
|
+
const classic = await launchClassicTypeScript(root, options);
|
|
4147
|
+
if (!classic)
|
|
4148
|
+
return void 0;
|
|
4149
|
+
const detail = failure instanceof Error ? failure.message : String(failure);
|
|
4150
|
+
recordDegradationOnce({
|
|
4151
|
+
kind: "lsp-registry-decision",
|
|
4152
|
+
subject: `typescript-native-alias:g${getDegradationLedgerGeneration()}:${root}`,
|
|
4153
|
+
reason: `the @typescript/native alias failed to start, using the classic launch: ${detail}`,
|
|
4154
|
+
metadata: { field: "typescript-native-alias", launchVariant: "classic" }
|
|
4155
|
+
});
|
|
4156
|
+
logSessionStart(`lsp typescript-native: alias ${why}, falling back to classic: ${detail}`);
|
|
4157
|
+
return classic;
|
|
4158
|
+
};
|
|
4159
|
+
let proc;
|
|
4160
|
+
try {
|
|
4161
|
+
proc = await launchViaNode(nativeLsp.command, args, { cwd: root, env });
|
|
4162
|
+
} catch (launchFailure) {
|
|
4163
|
+
logSessionStart(`lsp typescript-native: alias failed to launch: ${launchFailure instanceof Error ? launchFailure.message : String(launchFailure)}`);
|
|
4164
|
+
const classic = await classicInstead(launchFailure, "failed to launch");
|
|
4165
|
+
if (classic)
|
|
4166
|
+
return classic;
|
|
4167
|
+
throw launchFailure;
|
|
4168
|
+
}
|
|
4169
|
+
return {
|
|
4170
|
+
process: proc,
|
|
4171
|
+
source: "direct",
|
|
4172
|
+
launchVariant: "native-ts7",
|
|
4173
|
+
initializeFallback: (failure) => classicInstead(failure, "failed to initialize")
|
|
4174
|
+
};
|
|
4175
|
+
}
|
|
4176
|
+
function recordEffectTsgoFallback(root, reason, failure) {
|
|
4177
|
+
recordDegradationOnce({
|
|
4178
|
+
kind: "lsp-registry-decision",
|
|
4179
|
+
subject: `effect-tsgo-launch:g${getDegradationLedgerGeneration()}:${root}`,
|
|
4180
|
+
reason: `${reason}: ${failure instanceof Error ? failure.message : String(failure)}`,
|
|
4181
|
+
metadata: {
|
|
4182
|
+
field: "effect-tsgo-launch",
|
|
4183
|
+
launchVariant: "effect-tsgo"
|
|
4184
|
+
}
|
|
4185
|
+
});
|
|
4186
|
+
}
|
|
4067
4187
|
async function findEffectTsgoLsp(nodeModulesDir) {
|
|
4068
4188
|
let release;
|
|
4069
4189
|
try {
|
|
@@ -4232,6 +4352,44 @@ var TypeScriptRoot = withRootMarkers(DenoExcludeRoot(async (file) => {
|
|
|
4232
4352
|
return projectRoot;
|
|
4233
4353
|
return FileDirRoot(file);
|
|
4234
4354
|
}), [...TS_CONFIG_MARKERS, ...TS_TOOLING_MARKERS]);
|
|
4355
|
+
async function launchClassicTypeScript(root, options) {
|
|
4356
|
+
let source = "direct";
|
|
4357
|
+
let lspPath = await findAncestorFileAmong(root, [
|
|
4358
|
+
["node_modules", ".bin", "typescript-language-server.cmd"],
|
|
4359
|
+
["node_modules", ".bin", "typescript-language-server"]
|
|
4360
|
+
]);
|
|
4361
|
+
if (!lspPath) {
|
|
4362
|
+
lspPath = await ensureTool("typescript-language-server", {
|
|
4363
|
+
allowInstall: canInstall(options?.allowInstall)
|
|
4364
|
+
});
|
|
4365
|
+
if (lspPath)
|
|
4366
|
+
source = "managed";
|
|
4367
|
+
if (!lspPath) {
|
|
4368
|
+
return void 0;
|
|
4369
|
+
}
|
|
4370
|
+
}
|
|
4371
|
+
const tsserverPath = await findTsserverPath(root, options?.allowInstall, options);
|
|
4372
|
+
if (!tsserverPath) {
|
|
4373
|
+
admitProjectSuppliedTsserver(void 0, root, true, options?.projectCodeAllowed);
|
|
4374
|
+
return void 0;
|
|
4375
|
+
}
|
|
4376
|
+
if (tsserverPath)
|
|
4377
|
+
source = "managed";
|
|
4378
|
+
const env = await getToolEnvironment();
|
|
4379
|
+
const proc = await launchLSP(lspPath, ["--stdio"], {
|
|
4380
|
+
cwd: root,
|
|
4381
|
+
env: {
|
|
4382
|
+
...env,
|
|
4383
|
+
TSSERVER_PATH: tsserverPath
|
|
4384
|
+
}
|
|
4385
|
+
});
|
|
4386
|
+
return {
|
|
4387
|
+
process: proc,
|
|
4388
|
+
source,
|
|
4389
|
+
initialization: { tsserver: { path: tsserverPath } },
|
|
4390
|
+
launchVariant: "classic"
|
|
4391
|
+
};
|
|
4392
|
+
}
|
|
4235
4393
|
var TypeScriptServer = {
|
|
4236
4394
|
id: "typescript",
|
|
4237
4395
|
idleEviction: "transparent",
|
|
@@ -4251,72 +4409,30 @@ var TypeScriptServer = {
|
|
|
4251
4409
|
const nativeLsp = await findNativeTypeScriptLsp(root);
|
|
4252
4410
|
const effectLsp = nativeLsp ? await findEffectTsgoLsp(nativeLsp.nodeModulesDir) : void 0;
|
|
4253
4411
|
if (nativeLsp && effectLsp && admitProjectSuppliedTsserver(effectLsp.command, root, true, options?.projectCodeAllowed)) {
|
|
4254
|
-
const
|
|
4412
|
+
const env = await getToolEnvironment();
|
|
4255
4413
|
try {
|
|
4256
|
-
const
|
|
4414
|
+
const proc = await launchLSP(effectLsp.command, ["tsc", "--lsp", "--stdio"], { cwd: root, env });
|
|
4257
4415
|
logSessionStart(`lsp typescript-effect-tsgo: version=${effectLsp.releaseTag} typescript=${nativeLsp.version} command=${effectLsp.command}`);
|
|
4258
4416
|
return {
|
|
4259
|
-
process:
|
|
4417
|
+
process: proc,
|
|
4260
4418
|
source: "direct",
|
|
4261
|
-
launchVariant: "effect-tsgo"
|
|
4419
|
+
launchVariant: "effect-tsgo",
|
|
4420
|
+
initializeFallback: async (failure) => {
|
|
4421
|
+
recordEffectTsgoFallback(root, "effect-tsgo failed to initialize, using the native launch", failure);
|
|
4422
|
+
logSessionStart(`lsp typescript-effect-tsgo: initialize failed, falling back to native: ${failure instanceof Error ? failure.message : String(failure)}`);
|
|
4423
|
+
return launchNativeTypeScript(nativeLsp, root, options);
|
|
4424
|
+
}
|
|
4262
4425
|
};
|
|
4263
4426
|
} catch (launchFailure) {
|
|
4264
|
-
|
|
4265
|
-
kind: "lsp-registry-decision",
|
|
4266
|
-
subject: `effect-tsgo-launch:g${getDegradationLedgerGeneration()}:${root}`,
|
|
4267
|
-
reason: `effect-tsgo launch failed, using the native launch: ${launchFailure instanceof Error ? launchFailure.message : String(launchFailure)}`,
|
|
4268
|
-
metadata: {
|
|
4269
|
-
field: "effect-tsgo-launch",
|
|
4270
|
-
launchVariant: "effect-tsgo"
|
|
4271
|
-
}
|
|
4272
|
-
});
|
|
4273
|
-
}
|
|
4274
|
-
}
|
|
4275
|
-
if (nativeLsp && admitProjectSuppliedTsserver(nativeLsp.command, root, true, options?.projectCodeAllowed)) {
|
|
4276
|
-
const env2 = await getToolEnvironment();
|
|
4277
|
-
logSessionStart(`lsp typescript-native: version=${nativeLsp.version} command=${nativeLsp.command}`);
|
|
4278
|
-
const proc2 = await launchLSP(nativeLsp.command, ["--lsp", "--stdio"], {
|
|
4279
|
-
cwd: root,
|
|
4280
|
-
env: env2
|
|
4281
|
-
});
|
|
4282
|
-
return { process: proc2, source: "direct", launchVariant: "native-ts7" };
|
|
4283
|
-
}
|
|
4284
|
-
let source = "direct";
|
|
4285
|
-
let lspPath = await findAncestorFileAmong(root, [
|
|
4286
|
-
["node_modules", ".bin", "typescript-language-server.cmd"],
|
|
4287
|
-
["node_modules", ".bin", "typescript-language-server"]
|
|
4288
|
-
]);
|
|
4289
|
-
if (!lspPath) {
|
|
4290
|
-
lspPath = await ensureTool("typescript-language-server", {
|
|
4291
|
-
allowInstall: canInstall(options?.allowInstall)
|
|
4292
|
-
});
|
|
4293
|
-
if (lspPath)
|
|
4294
|
-
source = "managed";
|
|
4295
|
-
if (!lspPath) {
|
|
4296
|
-
return void 0;
|
|
4427
|
+
recordEffectTsgoFallback(root, "effect-tsgo launch failed, using the native launch", launchFailure);
|
|
4297
4428
|
}
|
|
4298
4429
|
}
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4430
|
+
if (nativeLsp) {
|
|
4431
|
+
const native = await launchNativeTypeScript(nativeLsp, root, options);
|
|
4432
|
+
if (native)
|
|
4433
|
+
return native;
|
|
4303
4434
|
}
|
|
4304
|
-
|
|
4305
|
-
source = "managed";
|
|
4306
|
-
const env = await getToolEnvironment();
|
|
4307
|
-
const proc = await launchLSP(lspPath, ["--stdio"], {
|
|
4308
|
-
cwd: root,
|
|
4309
|
-
env: {
|
|
4310
|
-
...env,
|
|
4311
|
-
TSSERVER_PATH: tsserverPath
|
|
4312
|
-
}
|
|
4313
|
-
});
|
|
4314
|
-
return {
|
|
4315
|
-
process: proc,
|
|
4316
|
-
source,
|
|
4317
|
-
initialization: tsserverPath ? { tsserver: { path: tsserverPath } } : void 0,
|
|
4318
|
-
launchVariant: "classic"
|
|
4319
|
-
};
|
|
4435
|
+
return launchClassicTypeScript(root, options);
|
|
4320
4436
|
}
|
|
4321
4437
|
};
|
|
4322
4438
|
var DenoServer = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
getGlobalPiLensDir
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3PO4YYOX.js";
|
|
5
5
|
|
|
6
6
|
// dist/clients/opengrep-rule-pack.js
|
|
7
7
|
import * as fs from "node:fs";
|