pi-lens 4.5.0 → 4.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG-USER.md +12 -12
- package/CHANGELOG.md +253 -0
- package/README.md +11 -2
- package/config/dependency-cruiser-eager-allowlist.json +1 -0
- package/dist/{chunk-ZULZS2I6.js → chunk-2ERVW2UF.js} +1115 -423
- package/dist/{chunk-BBSDJTOV.js → chunk-2K7BUOKS.js} +13 -13
- package/dist/{chunk-I2FYOZNW.js → chunk-3JJ4OAJI.js} +10 -10
- package/dist/{chunk-5JB4WENL.js → chunk-3UHGSUVL.js} +1 -1
- package/dist/{chunk-W26QZ3OM.js → chunk-463WN3VP.js} +10 -10
- package/dist/{chunk-4IZZEN63.js → chunk-4X3ML2UQ.js} +31 -34
- package/dist/{chunk-I3NZVAMN.js → chunk-5BI5YP57.js} +10 -10
- package/dist/{chunk-7U36VQL6.js → chunk-5Z4XLUFF.js} +3 -3
- package/dist/{chunk-DCA2MXVQ.js → chunk-62AJH3IN.js} +51 -29
- package/dist/{chunk-37IDWT6O.js → chunk-6F34GMP7.js} +16 -14
- package/dist/{chunk-VSQT6IHZ.js → chunk-6LIUVGOR.js} +28 -4
- package/dist/{chunk-27JQHK7Y.js → chunk-6REF4GCO.js} +1 -1
- package/dist/{chunk-INBK3HIT.js → chunk-7KRR24GO.js} +3 -3
- package/dist/{chunk-OZQQ3AIR.js → chunk-7OMOMBEQ.js} +9 -9
- package/dist/{chunk-ARTYCUGF.js → chunk-7ZFXICNN.js} +123 -20
- package/dist/{chunk-K4Z7MK6T.js → chunk-ABKRQVOY.js} +28 -52
- package/dist/{chunk-C5PLBTNR.js → chunk-ANSLRJBG.js} +1 -1
- package/dist/{chunk-HRLF35WL.js → chunk-AWMFBPGJ.js} +9 -9
- package/dist/{chunk-CXQYK4YT.js → chunk-BG7KHGNX.js} +2 -2
- package/dist/{chunk-ZI7YHV6I.js → chunk-BK2R2223.js} +10 -8
- package/dist/chunk-BXXC6KRR.js +107 -0
- package/dist/{chunk-QMWKSYWB.js → chunk-CKJS2AUI.js} +4 -4
- package/dist/{chunk-PPQHMSPH.js → chunk-COGU5KQJ.js} +15 -15
- package/dist/{chunk-NHA5K226.js → chunk-CQNXALZJ.js} +27 -6
- package/dist/{chunk-KZ732ZVW.js → chunk-CSZESDPP.js} +1 -1
- package/dist/chunk-CZ5TCJPB.js +98 -0
- package/dist/{chunk-LOEJFTF2.js → chunk-D2LFEA5U.js} +9 -2
- package/dist/chunk-D3KLF5CD.js +50 -0
- package/dist/{chunk-4DAHGU3V.js → chunk-ENJ2M76Y.js} +31 -29
- package/dist/{chunk-ZQSSO7LO.js → chunk-EQKF6BAK.js} +3 -3
- package/dist/{chunk-PFJLYRO3.js → chunk-F2SAP2FM.js} +40 -47
- package/dist/{chunk-ADYQRETD.js → chunk-F6QAJXQV.js} +2 -2
- package/dist/chunk-GR2QDWH5.js +25 -0
- package/dist/{chunk-LVLPA32Q.js → chunk-GVE5VZYQ.js} +48 -11
- package/dist/{chunk-AZG5UJYY.js → chunk-GWZZOJD2.js} +1 -1
- package/dist/chunk-GZS6VPIE.js +27 -0
- package/dist/chunk-H4B4SC7I.js +71 -0
- package/dist/{chunk-YCR6ZYTE.js → chunk-HA6TUJOE.js} +1 -1
- package/dist/{chunk-DI4AZZNY.js → chunk-HKPJTI47.js} +2 -2
- package/dist/{chunk-O6LCSHHI.js → chunk-HPKC55MA.js} +1 -1
- package/dist/{chunk-LQQNFCQJ.js → chunk-I65CQLCG.js} +1 -1
- package/dist/{chunk-P5MSLVUW.js → chunk-IDKLWVKY.js} +11 -11
- package/dist/chunk-IUM2Q7NF.js +25 -0
- package/dist/{chunk-L6BDRYUK.js → chunk-J24IS3KZ.js} +5 -5
- package/dist/{chunk-KNSOA43J.js → chunk-J2DAHH4T.js} +2 -2
- package/dist/{chunk-7ZVTFLCC.js → chunk-JBDZVOFL.js} +11 -11
- package/dist/{chunk-HIJ4CHFF.js → chunk-JC6NFC57.js} +3 -3
- package/dist/{chunk-K7O6AHSJ.js → chunk-JTHEUTW7.js} +11 -11
- package/dist/{chunk-KXGTLAUW.js → chunk-JWW3ODBN.js} +2 -2
- package/dist/{chunk-HIRBC72R.js → chunk-K3ZIYLHT.js} +4 -4
- package/dist/{chunk-6GLMMGCX.js → chunk-KDPZA2UE.js} +2 -3
- package/dist/{chunk-AXAR5ZW2.js → chunk-KMY2OU4T.js} +553 -434
- package/dist/{chunk-DFKOA74L.js → chunk-KQF7VT26.js} +10 -10
- package/dist/{chunk-S6MCMD27.js → chunk-KVGA7X76.js} +3 -3
- package/dist/{chunk-74AMPWNC.js → chunk-KW7O72AK.js} +2 -2
- package/dist/{chunk-UN72ZAJ5.js → chunk-LEQTVRSV.js} +9 -9
- package/dist/{chunk-B42AIWPJ.js → chunk-LKPSBM6S.js} +3 -3
- package/dist/{chunk-R4L7KZ7R.js → chunk-LKW2HFSZ.js} +9 -9
- package/dist/{chunk-3PO4YYOX.js → chunk-LURFD4HD.js} +4240 -3734
- package/dist/{chunk-PQXUZYTQ.js → chunk-M6ELTECW.js} +4 -4
- package/dist/{chunk-3QXFUP6T.js → chunk-MGVVYYKW.js} +12 -12
- package/dist/{chunk-CZJGAOKL.js → chunk-MQBKGRSB.js} +7 -7
- package/dist/{chunk-NNEQOC3U.js → chunk-MVG2ZEAO.js} +9 -7
- package/dist/{chunk-VWEBZ2JV.js → chunk-MY4XNNTX.js} +39 -41
- package/dist/{chunk-RIH3UBK4.js → chunk-N4AJVFRF.js} +11 -11
- package/dist/{chunk-TKOFTLGB.js → chunk-OFKKMXWM.js} +31 -36
- package/dist/{chunk-3PAS2ERX.js → chunk-OFZE4ANN.js} +8 -8
- package/dist/chunk-OLXBUTJR.js +61 -0
- package/dist/{chunk-6CFSDLHE.js → chunk-OZGEHOSG.js} +38 -17
- package/dist/{chunk-3TSMQZG6.js → chunk-PKGOROPQ.js} +40 -2
- package/dist/{chunk-OLWGYBYT.js → chunk-Q6D5QKRG.js} +17 -17
- package/dist/{chunk-QE7BJQ6K.js → chunk-QECLJFHI.js} +12 -17
- package/dist/{chunk-RJ3APNIP.js → chunk-QJA33VD5.js} +4 -4
- package/dist/{chunk-MOAVEPC4.js → chunk-R5XVJ6AN.js} +11 -11
- package/dist/{chunk-ZRQMENT4.js → chunk-REZL4OM4.js} +1 -1
- package/dist/{chunk-PKWEBMCA.js → chunk-RK5RBREN.js} +251 -201
- package/dist/chunk-RP5ZQTHO.js +86 -0
- package/dist/{chunk-J2ZB5MDS.js → chunk-RURPX2YV.js} +23 -23
- package/dist/chunk-TB5MGZLS.js +53 -0
- package/dist/chunk-TC63XRYP.js +27 -0
- package/dist/chunk-TJOYHAXJ.js +69 -0
- package/dist/{chunk-Q7J3JYJ2.js → chunk-TRXKDCBP.js} +13 -13
- package/dist/{chunk-6E5QLMWI.js → chunk-TTK37D7R.js} +22 -23
- package/dist/{chunk-XDNWR7SG.js → chunk-UH3QHLR5.js} +2 -2
- package/dist/{chunk-SCU62JLX.js → chunk-UNTJJ7GN.js} +7 -7
- package/dist/{chunk-O2MHF7QM.js → chunk-UPAFSETJ.js} +58 -63
- package/dist/{chunk-PQF6YGYB.js → chunk-UX75PTQW.js} +50 -31
- package/dist/{chunk-TWEOJE3D.js → chunk-V353PYMK.js} +1233 -576
- package/dist/{chunk-CQY2HEH7.js → chunk-V4TFQY5G.js} +2 -2
- package/dist/{chunk-B2OXE4AH.js → chunk-VC3W54G3.js} +446 -293
- package/dist/{chunk-JGUDT5KD.js → chunk-VSBCJVPC.js} +5 -5
- package/dist/{chunk-5HBQL7DH.js → chunk-WAQQGXVV.js} +3 -3
- package/dist/{chunk-7DPXUPRF.js → chunk-WLEVWR7Y.js} +2 -2
- package/dist/{chunk-QE5DJ7MX.js → chunk-WPMPVP5I.js} +4 -4
- package/dist/{chunk-KNJH6WJQ.js → chunk-WXNLFOC2.js} +7 -7
- package/dist/{chunk-XSC3BCN3.js → chunk-Y3ZNOZZS.js} +6 -6
- package/dist/{chunk-VGRGW4UL.js → chunk-YL6JQTWC.js} +29 -32
- package/dist/{chunk-7CLWC2UH.js → chunk-YVE5Q2UU.js} +86 -217
- package/dist/{chunk-LGH2HHZG.js → chunk-YZNARDMM.js} +42 -28
- package/dist/{chunk-NGNBJIUO.js → chunk-ZDWNFZJ2.js} +8 -8
- package/dist/{chunk-X33QECRJ.js → chunk-ZEUF7BIN.js} +2 -2
- package/dist/{chunk-2H5GHZKC.js → chunk-ZIF4WLWR.js} +45 -25
- package/dist/{chunk-WLD6BGON.js → chunk-ZSPVF7KI.js} +231 -24
- package/dist/{chunk-SDYLT45T.js → chunk-ZX6OKBVO.js} +2 -2
- package/dist/index.js +10566 -6819
- package/dist/mcp/analyze-cli.js +8 -8
- package/dist/mcp/cli.js +39 -41
- package/dist/mcp/server.js +1083 -685
- package/dist/mcp/worker.js +68 -59
- package/dist/probes/installer.js +21 -22
- package/docs/ci-bot-pr-checks.md +18 -9
- package/docs/ci.md +7 -0
- package/docs/configuration.md +24 -10
- package/docs/defect-shapes.md +61 -30
- package/docs/environment-variables.md +18 -9
- package/docs/globalconfig.md +17 -0
- package/docs/invariants/dispatch-runners.md +22 -0
- package/docs/invariants/lsp-trust-exec.md +33 -3
- package/docs/lsp-capability-matrix.md +23 -10
- package/docs/lsp-idle-eviction.md +7 -1
- package/docs/module-report-read-symbol.md +6 -2
- package/docs/pi-lens-merge-policy.md +3 -2
- package/docs/pi-lens-orchestration.md +2 -1
- package/docs/pi-lens-subagent.md +2 -1
- package/docs/release-qa-baseline.md +22 -17
- package/docs/servercapabilities.md +1 -1
- package/docs/settings.md +10 -2
- package/docs/tools.md +1 -1
- package/docs/usage.md +1 -0
- package/package.json +3 -3
- package/dist/chunk-2H7NFZ4Q.js +0 -25
- package/dist/chunk-5YJXF2IS.js +0 -56
- package/dist/chunk-7WKVCZI4.js +0 -69
- package/dist/chunk-BKWFDWYM.js +0 -46
- package/dist/chunk-G53LBDNU.js +0 -255
- package/dist/chunk-GCSDF5IE.js +0 -27
- package/dist/chunk-H5API74E.js +0 -67
- package/dist/chunk-HBX55MWO.js +0 -27
- package/dist/chunk-JOIKBUQN.js +0 -88
- package/dist/chunk-M2YMBT5G.js +0 -73
- package/dist/chunk-MJRGPEQ5.js +0 -25
- package/dist/chunk-QV3JPCMK.js +0 -17
- package/dist/chunk-TFKN5EIR.js +0 -27
- package/dist/chunk-UNP6Y4JV.js +0 -38
|
@@ -4,20 +4,21 @@ import {
|
|
|
4
4
|
getServersForFileWithConfig,
|
|
5
5
|
isAuxiliary,
|
|
6
6
|
resolveAnalysisRootPath
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KMY2OU4T.js";
|
|
8
8
|
import {
|
|
9
9
|
emitBounded
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
loadProjectSnapshotWithoutWordIndex
|
|
13
|
-
} from "./chunk-NNEQOC3U.js";
|
|
10
|
+
} from "./chunk-ZIF4WLWR.js";
|
|
14
11
|
import {
|
|
15
12
|
resolvePackagePath
|
|
16
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-EQKF6BAK.js";
|
|
14
|
+
import {
|
|
15
|
+
loadProjectSnapshotWithoutWordIndex
|
|
16
|
+
} from "./chunk-MVG2ZEAO.js";
|
|
17
17
|
import {
|
|
18
18
|
skipped
|
|
19
19
|
} from "./chunk-2APSZHHI.js";
|
|
20
20
|
import {
|
|
21
|
+
TOOLS,
|
|
21
22
|
ensureTool,
|
|
22
23
|
findManagedToolBinary,
|
|
23
24
|
getInstallAttempt,
|
|
@@ -26,26 +27,25 @@ import {
|
|
|
26
27
|
isSpawnableCommand,
|
|
27
28
|
logSessionStart,
|
|
28
29
|
resetPathWalkMemo
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-VC3W54G3.js";
|
|
30
31
|
import {
|
|
31
32
|
hasToolConfig,
|
|
32
33
|
resolveToolCwd,
|
|
33
34
|
toolConfigDirs
|
|
34
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-GVE5VZYQ.js";
|
|
35
36
|
import {
|
|
36
|
-
findGlobalBinary,
|
|
37
37
|
findLocalBinAt,
|
|
38
38
|
findLocalBinUpwards,
|
|
39
39
|
isLocalBinTrustRefusal,
|
|
40
40
|
localBinPath
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-YZNARDMM.js";
|
|
42
42
|
import {
|
|
43
43
|
createAvailabilityProbeFlight,
|
|
44
44
|
probeToolAsync
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-JWW3ODBN.js";
|
|
46
46
|
import {
|
|
47
47
|
normalizeToml
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-J2DAHH4T.js";
|
|
49
49
|
import {
|
|
50
50
|
classifyProbeFailure,
|
|
51
51
|
createAvailabilityLatch,
|
|
@@ -54,9 +54,10 @@ import {
|
|
|
54
54
|
isLatchingOutcome,
|
|
55
55
|
logAvailabilityDecision,
|
|
56
56
|
startHostStallSampler
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-KDPZA2UE.js";
|
|
58
58
|
import {
|
|
59
59
|
NODE_MODULES_BIN_DIRS,
|
|
60
|
+
PROJECT_BIN_DIR_WINDOWS_EXT,
|
|
60
61
|
VENDOR_BIN_DIRS,
|
|
61
62
|
VENV_BIN_DIRS,
|
|
62
63
|
createGenerationSource,
|
|
@@ -64,33 +65,39 @@ import {
|
|
|
64
65
|
isInSpawnTimeoutCooldown,
|
|
65
66
|
resolveWindowsCommandForEnvironment,
|
|
66
67
|
safeSpawnAsync
|
|
67
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-LURFD4HD.js";
|
|
69
|
+
import {
|
|
70
|
+
PathKeyedMap
|
|
71
|
+
} from "./chunk-UX75PTQW.js";
|
|
68
72
|
import {
|
|
69
73
|
TERRAGRUNT_FILENAMES,
|
|
70
74
|
isJstsFactFile
|
|
71
|
-
} from "./chunk-
|
|
72
|
-
import {
|
|
73
|
-
PathKeyedMap
|
|
74
|
-
} from "./chunk-PQF6YGYB.js";
|
|
75
|
+
} from "./chunk-V4TFQY5G.js";
|
|
75
76
|
import {
|
|
77
|
+
getProjectTrustGeneration,
|
|
76
78
|
getProjectTrustState
|
|
77
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-463WN3VP.js";
|
|
78
80
|
import {
|
|
79
81
|
compareOrdinal,
|
|
80
82
|
incrementDegradationCount,
|
|
81
83
|
recordDegradationOnce
|
|
82
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-CQNXALZJ.js";
|
|
83
85
|
import {
|
|
84
86
|
isToolInstallDisabled,
|
|
85
87
|
logLatency
|
|
86
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-YVE5Q2UU.js";
|
|
87
89
|
import {
|
|
88
90
|
isUnderDir,
|
|
89
91
|
normalizeEphemeralMapKey,
|
|
90
92
|
normalizeMapKey,
|
|
91
93
|
relativeInside,
|
|
92
94
|
walkUpDirs
|
|
93
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-ZSPVF7KI.js";
|
|
96
|
+
|
|
97
|
+
// dist/clients/dispatch/runners/utils/runner-helpers.js
|
|
98
|
+
import * as fs2 from "node:fs";
|
|
99
|
+
import * as path2 from "node:path";
|
|
100
|
+
import { delimiter, resolve as resolveCommandPath } from "node:path";
|
|
94
101
|
|
|
95
102
|
// dist/clients/tool-policy.js
|
|
96
103
|
import * as fs from "node:fs";
|
|
@@ -802,15 +809,6 @@ for (const [ext, policy] of FORMATTER_POLICY_BY_EXTENSION) {
|
|
|
802
809
|
policy.formatterNames.push("oxfmt");
|
|
803
810
|
}
|
|
804
811
|
}
|
|
805
|
-
var AUTO_INSTALLABLE_DEFAULT_FORMATTERS = /* @__PURE__ */ new Map([
|
|
806
|
-
["biome", "biome"],
|
|
807
|
-
["ruff", "ruff"],
|
|
808
|
-
["prettier", "prettier"],
|
|
809
|
-
["shfmt", "shfmt"],
|
|
810
|
-
["taplo", "taplo"],
|
|
811
|
-
["ktlint", "ktlint"],
|
|
812
|
-
["typstyle", "typstyle"]
|
|
813
|
-
]);
|
|
814
812
|
var TERRAGRUNT_FORMATTER_POLICY = {
|
|
815
813
|
formatterNames: ["terragrunt-hcl"],
|
|
816
814
|
defaultFormatter: "terragrunt-hcl",
|
|
@@ -833,14 +831,8 @@ function getSmartDefaultFormatterName(filePath) {
|
|
|
833
831
|
return void 0;
|
|
834
832
|
return policy.defaultFormatter;
|
|
835
833
|
}
|
|
836
|
-
function getAutoInstallToolIdForFormatter(formatterName) {
|
|
837
|
-
return AUTO_INSTALLABLE_DEFAULT_FORMATTERS.get(formatterName);
|
|
838
|
-
}
|
|
839
|
-
function getToolExecutionPolicy(toolId) {
|
|
840
|
-
return TOOL_EXECUTION_POLICY.get(toolId);
|
|
841
|
-
}
|
|
842
834
|
function shouldAutoInstallTool(toolId) {
|
|
843
|
-
return
|
|
835
|
+
return TOOLS.some((tool) => tool.id === toolId && tool.autoInstall === true);
|
|
844
836
|
}
|
|
845
837
|
function getAutofixCapability(toolId) {
|
|
846
838
|
return AUTOFIX_CAPABILITIES.get(toolId);
|
|
@@ -906,62 +898,6 @@ var AUTOFIX_CAPABILITIES = /* @__PURE__ */ new Map([
|
|
|
906
898
|
{ toolSupportsFix: true, safePipelineAutofix: true, fixKind: "pipeline" }
|
|
907
899
|
]
|
|
908
900
|
]);
|
|
909
|
-
var TOOL_EXECUTION_POLICY = /* @__PURE__ */ new Map([
|
|
910
|
-
// Dispatch/LSP runners use the shared availability/install seam. These
|
|
911
|
-
// managed tools are missing-command repair candidates; probe failures still
|
|
912
|
-
// fail closed before this policy is consulted.
|
|
913
|
-
["pyright", { configEligibility: "smart-default", autoInstall: true }],
|
|
914
|
-
["shellcheck", { configEligibility: "smart-default", autoInstall: true }],
|
|
915
|
-
["shfmt", { configEligibility: "smart-default", autoInstall: true }],
|
|
916
|
-
["tflint", { configEligibility: "smart-default", autoInstall: true }],
|
|
917
|
-
["terragrunt", { configEligibility: "smart-default", autoInstall: true }],
|
|
918
|
-
["trivy", { configEligibility: "config-first", autoInstall: true }],
|
|
919
|
-
["biome", { configEligibility: "smart-default", autoInstall: true }],
|
|
920
|
-
["ruff", { configEligibility: "smart-default", autoInstall: true }],
|
|
921
|
-
["jscpd", { configEligibility: "smart-default", autoInstall: true }],
|
|
922
|
-
["madge", { configEligibility: "smart-default", autoInstall: true }],
|
|
923
|
-
["knip", { configEligibility: "smart-default", autoInstall: true }],
|
|
924
|
-
["ast-grep", { configEligibility: "smart-default", autoInstall: true }],
|
|
925
|
-
["oxlint", { configEligibility: "smart-default", autoInstall: true }],
|
|
926
|
-
["stylelint", { configEligibility: "smart-default", autoInstall: true }],
|
|
927
|
-
["sqlfluff", { configEligibility: "smart-default", autoInstall: true }],
|
|
928
|
-
["rubocop", { configEligibility: "smart-default", autoInstall: true }],
|
|
929
|
-
["yamllint", { configEligibility: "smart-default", autoInstall: true }],
|
|
930
|
-
["actionlint", { configEligibility: "smart-default", autoInstall: true }],
|
|
931
|
-
["markdownlint", { configEligibility: "smart-default", autoInstall: true }],
|
|
932
|
-
["mypy", { configEligibility: "config-first", autoInstall: true }],
|
|
933
|
-
["taplo", { configEligibility: "smart-default", autoInstall: true }],
|
|
934
|
-
["hadolint", { configEligibility: "smart-default", autoInstall: true }],
|
|
935
|
-
["helm", { configEligibility: "smart-default", autoInstall: true }],
|
|
936
|
-
["htmlhint", { configEligibility: "smart-default", autoInstall: true }],
|
|
937
|
-
["ktlint", { configEligibility: "smart-default", autoInstall: true }],
|
|
938
|
-
// ktfmt is opt-in (a project's explicit formatting choice), so it only runs
|
|
939
|
-
// when its config marker is present — config-first, but auto-installable via
|
|
940
|
-
// the maven-JAR strategy once elected (#129).
|
|
941
|
-
["ktfmt", { configEligibility: "config-first", autoInstall: true }],
|
|
942
|
-
["golangci-lint", { configEligibility: "config-first", autoInstall: true }],
|
|
943
|
-
// SpotBugs is opt-in (lens-spotbugs flag) + config-first (needs a Java build
|
|
944
|
-
// descriptor + compiled .class files), auto-installed via the archive
|
|
945
|
-
// strategy when elected (#133).
|
|
946
|
-
["spotbugs", { configEligibility: "config-first", autoInstall: true }],
|
|
947
|
-
// Opengrep is opt-in (lens-opengrep flag or a discovered rule file) and
|
|
948
|
-
// config-first, but auto-installable via the GitHub single-binary strategy
|
|
949
|
-
// once elected — no login/token required, unlike Semgrep (#111).
|
|
950
|
-
["opengrep", { configEligibility: "config-first", autoInstall: true }],
|
|
951
|
-
["phpstan", { configEligibility: "config-first", autoInstall: false }],
|
|
952
|
-
["eslint", { configEligibility: "config-first", autoInstall: false }],
|
|
953
|
-
["prettier", { configEligibility: "smart-default", autoInstall: true }],
|
|
954
|
-
["vale", { configEligibility: "config-first", autoInstall: false }],
|
|
955
|
-
["swiftlint", { configEligibility: "smart-default", autoInstall: true }],
|
|
956
|
-
// typstyle is the default Typst formatter, so it carries the same
|
|
957
|
-
// smart-default/auto-install row its AUTO_INSTALLABLE_DEFAULT_FORMATTERS
|
|
958
|
-
// entry implies. The formatter path in `clients/formatters.ts` is what
|
|
959
|
-
// installs it; the row exists so the policy table does not disagree with the
|
|
960
|
-
// formatter table about a tool it names (#5418). The row states what already
|
|
961
|
-
// runs, and changes no install decision: whether typstyle should auto-install
|
|
962
|
-
// at all is an open product decision this branch deliberately leaves open.
|
|
963
|
-
["typstyle", { configEligibility: "smart-default", autoInstall: true }]
|
|
964
|
-
]);
|
|
965
901
|
var TOOL_COMMAND_SPECS = new Map([
|
|
966
902
|
[
|
|
967
903
|
// No managedToolId: the installer registry has no `eslint` entry (the
|
|
@@ -974,6 +910,19 @@ var TOOL_COMMAND_SPECS = new Map([
|
|
|
974
910
|
versionArgs: ["--version"]
|
|
975
911
|
}
|
|
976
912
|
],
|
|
913
|
+
[
|
|
914
|
+
// The installer's pyright is an npm package (`.cmd` on Windows). A pip
|
|
915
|
+
// venv's `Scripts/pyright.exe` is matched through the bin dir's own
|
|
916
|
+
// extension (`PROJECT_BIN_DIR_WINDOWS_EXT`), not this row. Unprobed on
|
|
917
|
+
// Windows (#5410 S1).
|
|
918
|
+
"pyright",
|
|
919
|
+
{
|
|
920
|
+
command: "pyright",
|
|
921
|
+
windowsExt: ".cmd",
|
|
922
|
+
versionArgs: ["--version"],
|
|
923
|
+
managedToolId: "pyright"
|
|
924
|
+
}
|
|
925
|
+
],
|
|
977
926
|
[
|
|
978
927
|
"stylelint",
|
|
979
928
|
{
|
|
@@ -1024,7 +973,9 @@ var TOOL_COMMAND_SPECS = new Map([
|
|
|
1024
973
|
{
|
|
1025
974
|
command: "rubocop",
|
|
1026
975
|
versionArgs: ["--version"],
|
|
1027
|
-
managedToolId: "rubocop"
|
|
976
|
+
managedToolId: "rubocop",
|
|
977
|
+
// A Ruby start is slow; the bundler form's probe had this budget (#5410).
|
|
978
|
+
probeTimeoutMs: 1e4
|
|
1028
979
|
}
|
|
1029
980
|
],
|
|
1030
981
|
[
|
|
@@ -1137,6 +1088,61 @@ var TOOL_COMMAND_SPECS = new Map([
|
|
|
1137
1088
|
managedToolId: "golangci-lint"
|
|
1138
1089
|
}
|
|
1139
1090
|
],
|
|
1091
|
+
// The six install-capable runner tools (#5410 S2). Each `windowsExt` is the
|
|
1092
|
+
// one the runner's own checker carried, and each is the installer entry's
|
|
1093
|
+
// release launcher (`.exe`); unprobed on Windows. A project's
|
|
1094
|
+
// `node_modules/.bin` is matched through that dir's own extension
|
|
1095
|
+
// (`PROJECT_BIN_DIR_WINDOWS_EXT`), not these rows. `shfmt`'s row sits with
|
|
1096
|
+
// the formatter binaries below.
|
|
1097
|
+
[
|
|
1098
|
+
"shellcheck",
|
|
1099
|
+
{
|
|
1100
|
+
command: "shellcheck",
|
|
1101
|
+
windowsExt: ".exe",
|
|
1102
|
+
versionArgs: ["--version"],
|
|
1103
|
+
managedToolId: "shellcheck"
|
|
1104
|
+
}
|
|
1105
|
+
],
|
|
1106
|
+
[
|
|
1107
|
+
"tflint",
|
|
1108
|
+
{
|
|
1109
|
+
command: "tflint",
|
|
1110
|
+
windowsExt: ".exe",
|
|
1111
|
+
versionArgs: ["--version"],
|
|
1112
|
+
managedToolId: "tflint"
|
|
1113
|
+
}
|
|
1114
|
+
],
|
|
1115
|
+
[
|
|
1116
|
+
"terragrunt",
|
|
1117
|
+
{
|
|
1118
|
+
command: "terragrunt",
|
|
1119
|
+
windowsExt: ".exe",
|
|
1120
|
+
versionArgs: ["--version"],
|
|
1121
|
+
managedToolId: "terragrunt"
|
|
1122
|
+
}
|
|
1123
|
+
],
|
|
1124
|
+
[
|
|
1125
|
+
// `cue version`: the installer entry's own probe (v0.17.1 exits 0); the CLI
|
|
1126
|
+
// has no `--version`. cue has no execution-policy row, so the shared
|
|
1127
|
+
// ladder never installs it, as cue-vet never did.
|
|
1128
|
+
"cue",
|
|
1129
|
+
{
|
|
1130
|
+
command: "cue",
|
|
1131
|
+
windowsExt: ".exe",
|
|
1132
|
+
versionArgs: ["version"],
|
|
1133
|
+
managedToolId: "cue"
|
|
1134
|
+
}
|
|
1135
|
+
],
|
|
1136
|
+
[
|
|
1137
|
+
// The spellcheck runner's `typos` CLI. No managedToolId: the installer has
|
|
1138
|
+
// `typos-lsp`, a different binary, and no `typos` entry (#5418).
|
|
1139
|
+
"typos",
|
|
1140
|
+
{
|
|
1141
|
+
command: "typos",
|
|
1142
|
+
windowsExt: ".exe",
|
|
1143
|
+
versionArgs: ["--version"]
|
|
1144
|
+
}
|
|
1145
|
+
],
|
|
1140
1146
|
[
|
|
1141
1147
|
// No managedToolId: no installer entry for `detekt` exists, and it has no
|
|
1142
1148
|
// execution-policy row, so nothing installs it (#5410).
|
|
@@ -1158,6 +1164,48 @@ var TOOL_COMMAND_SPECS = new Map([
|
|
|
1158
1164
|
versionArgs: ["-version"]
|
|
1159
1165
|
}
|
|
1160
1166
|
],
|
|
1167
|
+
[
|
|
1168
|
+
// Rubocop's bundler form (`bundle exec rubocop`) is available when
|
|
1169
|
+
// bundler is. No managedToolId: pi-lens never installs bundler.
|
|
1170
|
+
"bundle",
|
|
1171
|
+
{
|
|
1172
|
+
command: "bundle",
|
|
1173
|
+
windowsExt: ".bat",
|
|
1174
|
+
versionArgs: ["--version"],
|
|
1175
|
+
probeTimeoutMs: 1e4
|
|
1176
|
+
}
|
|
1177
|
+
],
|
|
1178
|
+
[
|
|
1179
|
+
// The archive launcher is `bin/spotbugs`, which prints its version under
|
|
1180
|
+
// `-version` and rejects `--version` (installer entry, #133).
|
|
1181
|
+
"spotbugs",
|
|
1182
|
+
{
|
|
1183
|
+
command: "spotbugs",
|
|
1184
|
+
windowsExt: ".bat",
|
|
1185
|
+
versionArgs: ["-version"],
|
|
1186
|
+
managedToolId: "spotbugs"
|
|
1187
|
+
}
|
|
1188
|
+
],
|
|
1189
|
+
[
|
|
1190
|
+
// The prisma-validate runner's CLI. No managedToolId: the installer has no
|
|
1191
|
+
// `prisma` entry and pi-lens never installs it (#5410 D8).
|
|
1192
|
+
"prisma",
|
|
1193
|
+
{
|
|
1194
|
+
command: "prisma",
|
|
1195
|
+
windowsExt: ".cmd",
|
|
1196
|
+
versionArgs: ["--version"]
|
|
1197
|
+
}
|
|
1198
|
+
],
|
|
1199
|
+
[
|
|
1200
|
+
// Vite+'s `vp`, which the oxlint runner prefers when the project uses it.
|
|
1201
|
+
// No managedToolId: the installer has no `vp` entry (#5410 F4).
|
|
1202
|
+
"vp",
|
|
1203
|
+
{
|
|
1204
|
+
command: "vp",
|
|
1205
|
+
windowsExt: ".cmd",
|
|
1206
|
+
versionArgs: ["--version"]
|
|
1207
|
+
}
|
|
1208
|
+
],
|
|
1161
1209
|
[
|
|
1162
1210
|
"htmlhint",
|
|
1163
1211
|
{
|
|
@@ -1185,6 +1233,39 @@ var TOOL_COMMAND_SPECS = new Map([
|
|
|
1185
1233
|
managedToolId: "prettier"
|
|
1186
1234
|
}
|
|
1187
1235
|
],
|
|
1236
|
+
// The Node-CLI analyzers the clients (not a runner) own: madge, jscpd and
|
|
1237
|
+
// knip ask the same ladder for "is it usable" (#5410, #5666 item 1). Each
|
|
1238
|
+
// is its installer entry and its binary name; `.cmd` is the npm launcher,
|
|
1239
|
+
// unprobed on Windows. jscpd's `--version` is a cold-start Node load, so its
|
|
1240
|
+
// budget is the 1.5 s its private checker carried.
|
|
1241
|
+
[
|
|
1242
|
+
"madge",
|
|
1243
|
+
{
|
|
1244
|
+
command: "madge",
|
|
1245
|
+
windowsExt: ".cmd",
|
|
1246
|
+
versionArgs: ["--version"],
|
|
1247
|
+
managedToolId: "madge"
|
|
1248
|
+
}
|
|
1249
|
+
],
|
|
1250
|
+
[
|
|
1251
|
+
"jscpd",
|
|
1252
|
+
{
|
|
1253
|
+
command: "jscpd",
|
|
1254
|
+
windowsExt: ".cmd",
|
|
1255
|
+
versionArgs: ["--version"],
|
|
1256
|
+
managedToolId: "jscpd",
|
|
1257
|
+
probeTimeoutMs: 1500
|
|
1258
|
+
}
|
|
1259
|
+
],
|
|
1260
|
+
[
|
|
1261
|
+
"knip",
|
|
1262
|
+
{
|
|
1263
|
+
command: "knip",
|
|
1264
|
+
windowsExt: ".cmd",
|
|
1265
|
+
versionArgs: ["--version"],
|
|
1266
|
+
managedToolId: "knip"
|
|
1267
|
+
}
|
|
1268
|
+
],
|
|
1188
1269
|
// The formatter binaries (#5410): the formatters resolve these through the
|
|
1189
1270
|
// runners' ladder machinery (version-checked, one latch per cwd), in their
|
|
1190
1271
|
// own order, PATH before managed (#5492 r2). Each id is also its installer
|
|
@@ -1883,9 +1964,6 @@ function getJstsLintPolicyForCwd(cwd) {
|
|
|
1883
1964
|
}
|
|
1884
1965
|
|
|
1885
1966
|
// dist/clients/dispatch/runners/utils/runner-helpers.js
|
|
1886
|
-
import * as fs2 from "node:fs";
|
|
1887
|
-
import * as path2 from "node:path";
|
|
1888
|
-
import { delimiter, resolve as resolveCommandPath } from "node:path";
|
|
1889
1967
|
function toolAbsentSkip(cwd, tool = {}) {
|
|
1890
1968
|
const ownVerdict = "verdict" in tool;
|
|
1891
1969
|
const checker = ownVerdict ? void 0 : tool.checker ?? (tool.id ? toolBinaryChecker(tool.id, "managed-first") ?? void 0 : void 0);
|
|
@@ -2057,12 +2135,13 @@ function resolveAdoptedRootCommand(command, ctx, cwd) {
|
|
|
2057
2135
|
return null;
|
|
2058
2136
|
}
|
|
2059
2137
|
}
|
|
2060
|
-
function createVenvFinder(command, windowsExt = "", verificationArgs = ["--version"], allowProjectLocal = true, projectBinDirs = VENV_BIN_DIRS) {
|
|
2138
|
+
function createVenvFinder(command, windowsExt = "", verificationArgs = ["--version"], allowProjectLocal = true, projectBinDirs = VENV_BIN_DIRS, projectBinDirWindowsExt) {
|
|
2061
2139
|
return async (cwd) => {
|
|
2062
2140
|
if (allowProjectLocal) {
|
|
2063
2141
|
const venvBin = localBinPath(findLocalBinAt(command, cwd, {
|
|
2064
2142
|
windowsExt,
|
|
2065
|
-
binDirs: projectBinDirs
|
|
2143
|
+
binDirs: projectBinDirs,
|
|
2144
|
+
binDirWindowsExt: projectBinDirWindowsExt
|
|
2066
2145
|
}));
|
|
2067
2146
|
if (venvBin)
|
|
2068
2147
|
return { path: venvBin, rung: "venv" };
|
|
@@ -2133,7 +2212,6 @@ async function discoverManagedTool(toolId) {
|
|
|
2133
2212
|
var installAttemptsByCwd = new PathKeyedMap(normalizeMapKey);
|
|
2134
2213
|
var resolveInstallInFlightByCwd = new PathKeyedMap(normalizeEphemeralMapKey);
|
|
2135
2214
|
var correctedAvailabilityByCwd = new PathKeyedMap(normalizeMapKey);
|
|
2136
|
-
var uncorrectedEmissionsByCwd = new PathKeyedMap(normalizeMapKey);
|
|
2137
2215
|
var latchedUnavailableByCwd = new PathKeyedMap(normalizeMapKey);
|
|
2138
2216
|
var availabilityGeneration = createGenerationSource("dispatch-availability");
|
|
2139
2217
|
var getDispatchAvailabilityGeneration = () => availabilityGeneration.current();
|
|
@@ -2256,10 +2334,6 @@ function emitCompensatingAvailableRow(cwd, toolId, installStartedAt, installedPa
|
|
|
2256
2334
|
if (correctsLatchedRow) {
|
|
2257
2335
|
noteAvailabilityCorrected(cwd, toolId);
|
|
2258
2336
|
clearLatchedUnavailable(cwd, ...latchKeys);
|
|
2259
|
-
} else {
|
|
2260
|
-
if (hasId(uncorrectedEmissionsByCwd, cwd, toolId))
|
|
2261
|
-
return;
|
|
2262
|
-
addId(uncorrectedEmissionsByCwd, cwd, toolId);
|
|
2263
2337
|
}
|
|
2264
2338
|
const attempt = getInstallAttempt(toolId);
|
|
2265
2339
|
const installEvidence = describeInstallAttempt(attempt);
|
|
@@ -2299,7 +2373,6 @@ function resetDispatchAvailabilityState() {
|
|
|
2299
2373
|
installAttemptsByCwd.clear();
|
|
2300
2374
|
resolveInstallInFlightByCwd.clear();
|
|
2301
2375
|
correctedAvailabilityByCwd.clear();
|
|
2302
|
-
uncorrectedEmissionsByCwd.clear();
|
|
2303
2376
|
latchedUnavailableByCwd.clear();
|
|
2304
2377
|
managedBinaryVerdicts.clear();
|
|
2305
2378
|
managedVerifyInFlight.clear();
|
|
@@ -2318,12 +2391,13 @@ function createAvailabilityChecker(command, windowsExt = "", versionArgs = ["--v
|
|
|
2318
2391
|
const pathRung = () => ({ path: command, rung: "path" });
|
|
2319
2392
|
const projectRung = (cwd) => findLocalBinAt(command, cwd, {
|
|
2320
2393
|
windowsExt,
|
|
2321
|
-
binDirs: options.projectBinDirs ?? VENV_BIN_DIRS
|
|
2394
|
+
binDirs: options.projectBinDirs ?? VENV_BIN_DIRS,
|
|
2395
|
+
binDirWindowsExt: options.projectBinDirWindowsExt
|
|
2322
2396
|
});
|
|
2323
2397
|
const findCommand = options.pathOnly ? async () => pathRung() : pathFirst ? async (cwd) => {
|
|
2324
2398
|
const project = allowProjectLocal ? localBinPath(projectRung(cwd)) : void 0;
|
|
2325
2399
|
return project ? { path: project, rung: "venv" } : pathRung();
|
|
2326
|
-
} : createVenvFinder(command, windowsExt, versionArgs, allowProjectLocal, options.projectBinDirs);
|
|
2400
|
+
} : createVenvFinder(command, windowsExt, versionArgs, allowProjectLocal, options.projectBinDirs, options.projectBinDirWindowsExt);
|
|
2327
2401
|
const findBeyondProject = createVenvFinder(command, windowsExt, versionArgs, false);
|
|
2328
2402
|
async function nextRung(from, cwd) {
|
|
2329
2403
|
if (!pathFirst)
|
|
@@ -2362,23 +2436,29 @@ function createAvailabilityChecker(command, windowsExt = "", versionArgs = ["--v
|
|
|
2362
2436
|
cacheByCwd.set(key, created);
|
|
2363
2437
|
return created;
|
|
2364
2438
|
}
|
|
2365
|
-
function noteDecision(cache, resolvedCwd, verdict) {
|
|
2366
|
-
cache.elapsedMs = verdict.elapsedMs;
|
|
2367
|
-
cache.rejectedOutput = verdict.available ? void 0 : verdict.rejectedOutput;
|
|
2439
|
+
function noteDecision(cache, resolvedCwd, verdict, publishes) {
|
|
2368
2440
|
let retryAfterMs;
|
|
2369
|
-
if (
|
|
2370
|
-
cache.
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2441
|
+
if (publishes) {
|
|
2442
|
+
cache.elapsedMs = verdict.elapsedMs;
|
|
2443
|
+
cache.rejectedOutput = verdict.available ? void 0 : verdict.rejectedOutput;
|
|
2444
|
+
if (verdict.available) {
|
|
2445
|
+
if (verdict.command !== void 0)
|
|
2446
|
+
cache.command = verdict.command;
|
|
2447
|
+
cache.latch.noteAvailable(verdict.cause);
|
|
2448
|
+
} else {
|
|
2449
|
+
cache.command = null;
|
|
2450
|
+
const delay = cache.latch.noteUnavailable(verdict.outcome, verdict.cause);
|
|
2451
|
+
if (delay > 0)
|
|
2452
|
+
retryAfterMs = delay;
|
|
2453
|
+
}
|
|
2376
2454
|
}
|
|
2377
|
-
const latched = verdict.available || isLatchingOutcome(verdict.outcome);
|
|
2378
|
-
if (
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2455
|
+
const latched = publishes && (verdict.available || isLatchingOutcome(verdict.outcome));
|
|
2456
|
+
if (publishes) {
|
|
2457
|
+
if (!verdict.available && latched) {
|
|
2458
|
+
noteLatchedUnavailable(resolvedCwd, command);
|
|
2459
|
+
} else if (verdict.available) {
|
|
2460
|
+
clearLatchedUnavailable(resolvedCwd, ...latchKeysFor(command));
|
|
2461
|
+
}
|
|
2382
2462
|
}
|
|
2383
2463
|
logAvailabilityDecision({
|
|
2384
2464
|
tool: command,
|
|
@@ -2413,17 +2493,21 @@ function createAvailabilityChecker(command, windowsExt = "", versionArgs = ["--v
|
|
|
2413
2493
|
cache.command = null;
|
|
2414
2494
|
}
|
|
2415
2495
|
const key = path2.resolve(resolvedCwd);
|
|
2496
|
+
const trustGeneration = getProjectTrustGeneration();
|
|
2416
2497
|
const existing = inFlightByCwd.get(key);
|
|
2498
|
+
if (existing?.trustGeneration === trustGeneration)
|
|
2499
|
+
return existing.promise;
|
|
2417
2500
|
if (existing)
|
|
2418
|
-
|
|
2501
|
+
cache.latch.reset();
|
|
2419
2502
|
const promiseGeneration = checkerGeneration;
|
|
2420
2503
|
let promise;
|
|
2504
|
+
const note = (verdict) => noteDecision(cache, resolvedCwd, verdict, inFlightByCwd.get(key)?.promise === promise);
|
|
2421
2505
|
promise = (async () => {
|
|
2422
2506
|
const fastPath = await options.fastPath?.();
|
|
2423
2507
|
if (fastPath) {
|
|
2424
|
-
|
|
2425
|
-
noteDecision(cache, resolvedCwd, {
|
|
2508
|
+
note({
|
|
2426
2509
|
available: true,
|
|
2510
|
+
command: fastPath,
|
|
2427
2511
|
outcome: "success",
|
|
2428
2512
|
cause: "fast-path",
|
|
2429
2513
|
elapsedMs: 0,
|
|
@@ -2436,7 +2520,7 @@ function createAvailabilityChecker(command, windowsExt = "", versionArgs = ["--v
|
|
|
2436
2520
|
try {
|
|
2437
2521
|
const cwdStat = await fs2.promises.stat(resolvedCwd);
|
|
2438
2522
|
if (!cwdStat.isDirectory()) {
|
|
2439
|
-
|
|
2523
|
+
note({
|
|
2440
2524
|
available: false,
|
|
2441
2525
|
outcome: "non-installable",
|
|
2442
2526
|
cause: "bad-cwd",
|
|
@@ -2448,7 +2532,7 @@ function createAvailabilityChecker(command, windowsExt = "", versionArgs = ["--v
|
|
|
2448
2532
|
return false;
|
|
2449
2533
|
}
|
|
2450
2534
|
} catch {
|
|
2451
|
-
|
|
2535
|
+
note({
|
|
2452
2536
|
available: false,
|
|
2453
2537
|
outcome: "non-installable",
|
|
2454
2538
|
cause: "bad-cwd",
|
|
@@ -2463,7 +2547,7 @@ function createAvailabilityChecker(command, windowsExt = "", versionArgs = ["--v
|
|
|
2463
2547
|
for (; ; ) {
|
|
2464
2548
|
const cmd = resolution.path;
|
|
2465
2549
|
if (isInSpawnTimeoutCooldown(cmd)) {
|
|
2466
|
-
|
|
2550
|
+
note({
|
|
2467
2551
|
available: false,
|
|
2468
2552
|
outcome: "transient",
|
|
2469
2553
|
cause: "probe-timeout",
|
|
@@ -2483,7 +2567,7 @@ function createAvailabilityChecker(command, windowsExt = "", versionArgs = ["--v
|
|
|
2483
2567
|
let hostStallMs;
|
|
2484
2568
|
let probeJoined = false;
|
|
2485
2569
|
try {
|
|
2486
|
-
const shared = checkerProbeFlights.run(`checker:${command}|${versionArgs.join("|")}|${key}|${checkerFlightGeneration}|${windowsExt}|${cmd}|${JSON.stringify(Object.entries(env ?? {}).sort(([a], [b]) => compareOrdinal(a, b)))}`, () => (
|
|
2570
|
+
const shared = checkerProbeFlights.run(`checker:${command}|${versionArgs.join("|")}|${key}|${trustGeneration}|${checkerFlightGeneration}|${windowsExt}|${cmd}|${JSON.stringify(Object.entries(env ?? {}).sort(([a], [b]) => compareOrdinal(a, b)))}`, () => (
|
|
2487
2571
|
// A bare PATH-only probe goes through the cwd-less probe seam
|
|
2488
2572
|
// (#2894): nothing it answers is read out of a project.
|
|
2489
2573
|
options.pathOnly ? probeToolAsync(cmd, versionArgs, {
|
|
@@ -2505,9 +2589,9 @@ function createAvailabilityChecker(command, windowsExt = "", versionArgs = ["--v
|
|
|
2505
2589
|
const elapsedMs = Date.now() - startedAt;
|
|
2506
2590
|
recordAvailabilityProbeOverrun(command, resolvedCwd, elapsedMs, options.probeTimeout ?? 5e3, result.failure);
|
|
2507
2591
|
if (!result.error && result.status === 0) {
|
|
2508
|
-
|
|
2509
|
-
noteDecision(cache, resolvedCwd, {
|
|
2592
|
+
note({
|
|
2510
2593
|
available: true,
|
|
2594
|
+
command: cmd,
|
|
2511
2595
|
outcome: "success",
|
|
2512
2596
|
cause: "ok",
|
|
2513
2597
|
elapsedMs,
|
|
@@ -2536,7 +2620,7 @@ function createAvailabilityChecker(command, windowsExt = "", versionArgs = ["--v
|
|
|
2536
2620
|
}
|
|
2537
2621
|
if (result.spawnFailure?.kind === "tool-not-found")
|
|
2538
2622
|
resetPathWalkMemo();
|
|
2539
|
-
|
|
2623
|
+
note({
|
|
2540
2624
|
available: false,
|
|
2541
2625
|
outcome,
|
|
2542
2626
|
cause,
|
|
@@ -2551,11 +2635,11 @@ function createAvailabilityChecker(command, windowsExt = "", versionArgs = ["--v
|
|
|
2551
2635
|
return false;
|
|
2552
2636
|
}
|
|
2553
2637
|
})().finally(() => {
|
|
2554
|
-
if (checkerGeneration === promiseGeneration && inFlightByCwd.get(key) === promise) {
|
|
2638
|
+
if (checkerGeneration === promiseGeneration && inFlightByCwd.get(key)?.promise === promise) {
|
|
2555
2639
|
inFlightByCwd.delete(key);
|
|
2556
2640
|
}
|
|
2557
2641
|
});
|
|
2558
|
-
inFlightByCwd.set(key, promise);
|
|
2642
|
+
inFlightByCwd.set(key, { trustGeneration, promise });
|
|
2559
2643
|
return promise;
|
|
2560
2644
|
}
|
|
2561
2645
|
function getCommand(cwd) {
|
|
@@ -2765,7 +2849,11 @@ function toolBinaryChecker(toolId, order) {
|
|
|
2765
2849
|
return null;
|
|
2766
2850
|
const checker = createAvailabilityChecker(spec.command, spec.windowsExt ?? "", spec.versionArgs ?? ["--version"], {
|
|
2767
2851
|
projectBinDirs: [...VENV_BIN_DIRS, ...NODE_MODULES_BIN_DIRS],
|
|
2768
|
-
|
|
2852
|
+
projectBinDirWindowsExt: PROJECT_BIN_DIR_WINDOWS_EXT,
|
|
2853
|
+
...spec.probeTimeoutMs !== void 0 && {
|
|
2854
|
+
probeTimeout: spec.probeTimeoutMs
|
|
2855
|
+
},
|
|
2856
|
+
...order === "path-only" ? { pathOnly: true } : { order }
|
|
2769
2857
|
});
|
|
2770
2858
|
toolBinaryCheckers.set(key, checker);
|
|
2771
2859
|
return checker;
|
|
@@ -2776,6 +2864,18 @@ async function resolveToolCommandWithInstallFallback(cwd, toolId) {
|
|
|
2776
2864
|
return null;
|
|
2777
2865
|
return resolveAvailableOrInstall(checker, getToolCommandSpec(toolId)?.managedToolId ?? toolId, cwd);
|
|
2778
2866
|
}
|
|
2867
|
+
async function toolOnPath(toolId) {
|
|
2868
|
+
const checker = toolBinaryChecker(toolId, "path-only");
|
|
2869
|
+
if (!checker)
|
|
2870
|
+
return false;
|
|
2871
|
+
const trustGeneration = getProjectTrustGeneration();
|
|
2872
|
+
const onPath = await checker.isAvailableAsync();
|
|
2873
|
+
if (getProjectTrustGeneration() !== trustGeneration)
|
|
2874
|
+
return void 0;
|
|
2875
|
+
if (onPath)
|
|
2876
|
+
return true;
|
|
2877
|
+
return checker.getOutcome() === "transient" ? void 0 : false;
|
|
2878
|
+
}
|
|
2779
2879
|
var UNPROBED_VERDICT = {
|
|
2780
2880
|
outcome: null,
|
|
2781
2881
|
cause: null,
|
|
@@ -2796,51 +2896,14 @@ async function resolveInstalledToolCommand(cwd, toolId) {
|
|
|
2796
2896
|
const { cause, rejectedOutput } = checker.getVerdict(cwd);
|
|
2797
2897
|
return cause === "probe-rejected" ? { command: null, rejected: rejectedOutput ?? "" } : { command: null };
|
|
2798
2898
|
}
|
|
2799
|
-
async function
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
timeout,
|
|
2805
|
-
cwd,
|
|
2806
|
-
input: "",
|
|
2807
|
-
cooldown: false
|
|
2808
|
-
});
|
|
2809
|
-
if (!versionCheck.error && versionCheck.status === 0) {
|
|
2810
|
-
return command;
|
|
2811
|
-
}
|
|
2812
|
-
const { outcome, cause } = classifyProbeFailure(versionCheck, { command });
|
|
2813
|
-
onUnusable({ outcome, cause });
|
|
2814
|
-
return null;
|
|
2815
|
-
}
|
|
2816
|
-
if (!shouldAutoInstallTool(toolId))
|
|
2817
|
-
return null;
|
|
2818
|
-
const state = installStateFor(cwd, toolId);
|
|
2819
|
-
if (state.suppressed)
|
|
2820
|
-
return null;
|
|
2821
|
-
const installStartedAt = Date.now();
|
|
2822
|
-
const installed = await ensureTool(toolId);
|
|
2823
|
-
if (installed) {
|
|
2824
|
-
noteInstallSuccess(toolId, cwd);
|
|
2825
|
-
emitCompensatingAvailableRow(cwd, toolId, installStartedAt, installed, latchKeysFor(toolId, command));
|
|
2826
|
-
return installed;
|
|
2827
|
-
}
|
|
2828
|
-
noteInstallFailure(toolId, cwd);
|
|
2829
|
-
return null;
|
|
2830
|
-
}
|
|
2831
|
-
async function resolveCommandArgsWithInstallFallback(command, toolId, cwd, versionArgs = ["--version"], timeout = 5e3, onUnusable) {
|
|
2832
|
-
const versionCheck = await safeSpawnAsync(command.cmd, [...command.args, ...versionArgs], { timeout, cwd, input: "", cooldown: false });
|
|
2833
|
-
if (!versionCheck.error && versionCheck.status === 0) {
|
|
2834
|
-
return command;
|
|
2899
|
+
async function resolveRubocopCommand(form, cwd) {
|
|
2900
|
+
if (form.cmd === "bundle") {
|
|
2901
|
+
const bundle = await resolveToolCommandWithInstallFallback(cwd, "bundle");
|
|
2902
|
+
if (bundle)
|
|
2903
|
+
return { cmd: bundle, args: form.args };
|
|
2835
2904
|
}
|
|
2836
|
-
const
|
|
2837
|
-
|
|
2838
|
-
return null;
|
|
2839
|
-
}
|
|
2840
|
-
if (installed === command.cmd) {
|
|
2841
|
-
return command;
|
|
2842
|
-
}
|
|
2843
|
-
return { cmd: installed, args: [] };
|
|
2905
|
+
const cmd = await resolveToolCommandWithInstallFallback(cwd, "rubocop");
|
|
2906
|
+
return cmd ? { cmd, args: [] } : null;
|
|
2844
2907
|
}
|
|
2845
2908
|
async function resolveAvailableOrInstallUnshared(checker, toolId, cwd) {
|
|
2846
2909
|
const available = await checker.isAvailableAsync(cwd);
|
|
@@ -2891,24 +2954,6 @@ function resolveAvailableOrInstall(checker, toolId, cwd) {
|
|
|
2891
2954
|
byTool.set(toolId, promise);
|
|
2892
2955
|
return promise;
|
|
2893
2956
|
}
|
|
2894
|
-
async function resolveLocalFirstAsync(toolName, cwd, windowsExt = ".cmd") {
|
|
2895
|
-
const local = localBinPath(findLocalBinAt(toolName, cwd, { windowsExt }));
|
|
2896
|
-
if (local)
|
|
2897
|
-
return { cmd: local, args: [] };
|
|
2898
|
-
const globalBin = await findGlobalBinary(toolName, windowsExt);
|
|
2899
|
-
if (globalBin)
|
|
2900
|
-
return { cmd: globalBin, args: [] };
|
|
2901
|
-
const globalCheck = await probeToolAsync(toolName, ["--version"], {
|
|
2902
|
-
timeout: 3e3
|
|
2903
|
-
});
|
|
2904
|
-
if (!globalCheck.error && globalCheck.status === 0) {
|
|
2905
|
-
return { cmd: toolName, args: [] };
|
|
2906
|
-
}
|
|
2907
|
-
return { cmd: "npx", args: ["--no", toolName] };
|
|
2908
|
-
}
|
|
2909
|
-
var pyright = createAvailabilityChecker("pyright", ".exe");
|
|
2910
|
-
var ruff = createAvailabilityChecker("ruff", ".exe");
|
|
2911
|
-
var biome = createAvailabilityChecker("biome");
|
|
2912
2957
|
function resolveRunnerCwd(ctx, tool) {
|
|
2913
2958
|
return resolveToolCwd("runner", tool, ctx.filePath, ctx).cwd;
|
|
2914
2959
|
}
|
|
@@ -2917,7 +2962,7 @@ export {
|
|
|
2917
2962
|
OXFMT_SUPPORTED_EXTENSIONS,
|
|
2918
2963
|
getFormatterPolicyForFile,
|
|
2919
2964
|
getSmartDefaultFormatterName,
|
|
2920
|
-
|
|
2965
|
+
shouldAutoInstallTool,
|
|
2921
2966
|
getAutofixCapability,
|
|
2922
2967
|
getLinterPolicyForCwd,
|
|
2923
2968
|
hasNearestPackageJsonDependency,
|
|
@@ -2938,20 +2983,25 @@ export {
|
|
|
2938
2983
|
lspPrimaryCoversFile,
|
|
2939
2984
|
coveringLaneAvailable,
|
|
2940
2985
|
findManagedNodeToolBinary,
|
|
2986
|
+
findManagedReleaseBinary,
|
|
2941
2987
|
resolveAdoptedRootCommand,
|
|
2988
|
+
createVenvFinder,
|
|
2942
2989
|
resolveManagedToolClient,
|
|
2943
2990
|
getManagedToolEnvironment,
|
|
2944
2991
|
discoverManagedTool,
|
|
2992
|
+
getDispatchAvailabilityGeneration,
|
|
2993
|
+
recordAvailabilityProbeOverrun,
|
|
2945
2994
|
resetDispatchAvailabilityState,
|
|
2946
2995
|
createAvailabilityChecker,
|
|
2947
2996
|
createCwdCachedProbe,
|
|
2997
|
+
resolveNodeToolCommand,
|
|
2948
2998
|
resolveToolCommand,
|
|
2949
2999
|
resolveVendorToolCommand,
|
|
2950
3000
|
resolveToolCommandWithInstallFallback,
|
|
3001
|
+
toolOnPath,
|
|
2951
3002
|
toolBinaryVerdict,
|
|
2952
3003
|
resolveInstalledToolCommand,
|
|
2953
|
-
|
|
3004
|
+
resolveRubocopCommand,
|
|
2954
3005
|
resolveAvailableOrInstall,
|
|
2955
|
-
resolveLocalFirstAsync,
|
|
2956
3006
|
resolveRunnerCwd
|
|
2957
3007
|
};
|