pi-lens 4.4.6 → 4.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +232 -0
- package/README.md +17 -3
- package/config/markdownlint/run-no-fix.mjs +36 -0
- package/dist/{chunk-ZQ6NZZTB.js → chunk-2453RRJ2.js} +44 -6
- package/dist/{chunk-GZE7WOI4.js → chunk-2BKUFQKR.js} +696 -330
- package/dist/chunk-2TS4GLOJ.js +31 -0
- package/dist/{chunk-2DMLM3ZO.js → chunk-2ZE3AUJQ.js} +12 -14
- package/dist/{chunk-OJLTLYHB.js → chunk-35WKJWO5.js} +51 -33
- package/dist/chunk-3JAHQBSY.js +27 -0
- package/dist/{chunk-PO45POGF.js → chunk-3O5EII3W.js} +2 -2
- package/dist/chunk-447YZL4S.js +25 -0
- package/dist/{chunk-TIYGSODX.js → chunk-4B2YFN4U.js} +28 -22
- package/dist/{chunk-OSTKYB55.js → chunk-4BKU7PV3.js} +1 -1
- package/dist/{chunk-XQCSWV2G.js → chunk-4LL2VRNY.js} +27 -28
- package/dist/{chunk-MA77RSFN.js → chunk-4NBWFYWW.js} +9 -9
- package/dist/{chunk-75SY4F24.js → chunk-4QG55RRC.js} +12 -12
- package/dist/{chunk-K2YGBXOA.js → chunk-4W52ZKZX.js} +2 -2
- package/dist/{chunk-Z2XAOKHK.js → chunk-565VRUP4.js} +2 -2
- package/dist/{chunk-CFRQMBGP.js → chunk-57X2CDRX.js} +23 -23
- package/dist/{chunk-XAIT2YGS.js → chunk-5F3XF3SX.js} +7 -15
- package/dist/{chunk-UHGF5UT5.js → chunk-5RNB4HVK.js} +1 -1
- package/dist/{chunk-Q4EMRFNA.js → chunk-5T5A6YAJ.js} +35 -34
- package/dist/{chunk-W5LGKNET.js → chunk-6FIRFP6A.js} +12 -12
- package/dist/{chunk-KLQVC3XC.js → chunk-6GMGEKQN.js} +36 -9
- package/dist/{chunk-UN4TEBWN.js → chunk-6LJOJ6EO.js} +20 -15
- package/dist/{chunk-HK6JVFZC.js → chunk-6YUNI7B5.js} +3 -3
- package/dist/{chunk-PKES3ISE.js → chunk-7ANZ7XDD.js} +2 -2
- package/dist/{chunk-VQH24FIP.js → chunk-7CGIDRIK.js} +16 -15
- package/dist/{chunk-SCIUNBPF.js → chunk-7MAD5ZAY.js} +16 -17
- package/dist/{chunk-OOU2WZZE.js → chunk-7TNILKGY.js} +1 -1
- package/dist/{chunk-LEJOJDXL.js → chunk-A5GRLYPZ.js} +9 -9
- package/dist/{chunk-AE37FEGH.js → chunk-AGGUWKRK.js} +1 -1
- package/dist/{chunk-BWYQUPOS.js → chunk-BBET6HD6.js} +1 -1
- package/dist/{chunk-GAACZY6R.js → chunk-BHWW6FAX.js} +14 -13
- package/dist/{chunk-A3YNG5KP.js → chunk-BOPDQ7AZ.js} +23 -21
- package/dist/{chunk-MKVZQUEG.js → chunk-BQG2QFVO.js} +215 -134
- package/dist/{chunk-EVDGNG4F.js → chunk-BUZIQDFS.js} +3 -3
- package/dist/{chunk-2PHMIAKO.js → chunk-CM73PPGD.js} +4 -4
- package/dist/{chunk-63RIVFQI.js → chunk-CUDD35TW.js} +10 -9
- package/dist/{chunk-BM5GS6ZH.js → chunk-CZL44WFN.js} +2 -2
- package/dist/{chunk-QGSTQH4D.js → chunk-DIWK3LBC.js} +12 -15
- package/dist/{chunk-JL6CXUMW.js → chunk-DYRZGUMA.js} +2 -2
- package/dist/{chunk-NDMCVUYK.js → chunk-FHEV6T4L.js} +22 -18
- package/dist/{chunk-4PCQCU47.js → chunk-FRLAUP2B.js} +4 -4
- package/dist/{chunk-RZOXUSPC.js → chunk-G5GV2Q7K.js} +2 -2
- package/dist/{chunk-2RLWJO5K.js → chunk-G6JKM4O7.js} +7 -7
- package/dist/chunk-GGYOZWHW.js +27 -0
- package/dist/{chunk-DC4CFXM5.js → chunk-GIRBSBGL.js} +6 -5
- package/dist/{chunk-PQJFG24Z.js → chunk-GMROJJRN.js} +1292 -946
- package/dist/{chunk-ZUUI3ZSA.js → chunk-HHR7WGCI.js} +3 -3
- package/dist/{chunk-TIQJPRDD.js → chunk-HKIL6DCL.js} +3 -2
- package/dist/{chunk-VPBIMOAQ.js → chunk-HUAM7QG3.js} +15 -13
- package/dist/{chunk-ZYNI26MI.js → chunk-HXFUTMX2.js} +2 -2
- package/dist/{chunk-W5R5SABV.js → chunk-I22THIHI.js} +12 -12
- package/dist/chunk-IE5D3RA5.js +58 -0
- package/dist/{chunk-MT6BVNFW.js → chunk-IYVYZQRL.js} +10 -16
- package/dist/{chunk-ARD426WI.js → chunk-JBP7KESM.js} +1 -1
- package/dist/{chunk-MN7MHUXQ.js → chunk-JE6HKLC7.js} +2 -2
- package/dist/{chunk-3MYEA7QD.js → chunk-JPRDTY5S.js} +85 -3
- package/dist/{chunk-CJYKEW2L.js → chunk-JYLOYTZD.js} +17 -1
- package/dist/{chunk-5APMQ2IJ.js → chunk-JZRP4DGP.js} +2 -2
- package/dist/{chunk-AMXIUN2R.js → chunk-KZ4ALBCH.js} +2 -2
- package/dist/{chunk-W2V54OCL.js → chunk-L3CLUGDY.js} +3 -3
- package/dist/{chunk-DMSLNKF7.js → chunk-L4NEVZ4T.js} +28 -27
- package/dist/chunk-LPYTPNOJ.js +22 -0
- package/dist/{chunk-BI5LAQ3Y.js → chunk-LSFXZLPW.js} +2071 -1725
- package/dist/{chunk-2DDDCJDL.js → chunk-MC6VB2E5.js} +4 -4
- package/dist/{chunk-U2SDMG7C.js → chunk-NM2NWH55.js} +5 -5
- package/dist/{chunk-Q4FCYCRE.js → chunk-NSPVR3FN.js} +19 -18
- package/dist/{chunk-VG5JS5SW.js → chunk-O2ARHQKF.js} +2 -2
- package/dist/{chunk-KSR7RGQY.js → chunk-O4N5BQ3T.js} +10 -10
- package/dist/{chunk-5ZR3APIM.js → chunk-OC7VWJBZ.js} +39 -40
- package/dist/chunk-OFNMHPBT.js +89 -0
- package/dist/{chunk-YSBHPOY6.js → chunk-OWTG6UMO.js} +21 -21
- package/dist/{chunk-7RQXA5GG.js → chunk-OY7WZI7Q.js} +13 -12
- package/dist/{chunk-5CV5ITZF.js → chunk-OZWXLJMX.js} +2 -2
- package/dist/{chunk-F6X3YJWD.js → chunk-PIQQM32Y.js} +2 -2
- package/dist/chunk-PKLB2XJL.js +8 -0
- package/dist/{chunk-DQXSPYRI.js → chunk-PKSUMEPT.js} +17 -4
- package/dist/{chunk-YISME6ON.js → chunk-PPKECBPP.js} +1 -1
- package/dist/{chunk-4AVZ3TG7.js → chunk-R2QQC33W.js} +14 -14
- package/dist/{chunk-GMTFDAOK.js → chunk-R4QWJQ2H.js} +11 -11
- package/dist/{chunk-V63BC55Q.js → chunk-RGGH6M34.js} +1 -1
- package/dist/{chunk-SJJYRZB4.js → chunk-RZG472YW.js} +116 -26
- package/dist/{chunk-NIU2IPC5.js → chunk-SDFKOLSF.js} +6 -6
- package/dist/{chunk-H7HTEQUZ.js → chunk-SFLHSL5R.js} +9 -9
- package/dist/{chunk-FA5LDARD.js → chunk-SP4TFY5F.js} +14 -13
- package/dist/{chunk-J6JP25XU.js → chunk-SQC7K3SP.js} +4 -3
- package/dist/{chunk-T7FTXGS3.js → chunk-T2S3FNNJ.js} +44 -42
- package/dist/{chunk-S67UJDGQ.js → chunk-TV6RXRYH.js} +10 -10
- package/dist/{chunk-GNSIWBAT.js → chunk-U3AS2FR6.js} +3 -3
- package/dist/{chunk-WIZWZR4C.js → chunk-UHHLR2VY.js} +43 -41
- package/dist/chunk-UYXV5NIS.js +20 -0
- package/dist/{chunk-VSFLRN5Y.js → chunk-VLQ7UKZH.js} +1 -1
- package/dist/{chunk-FFL3A2VP.js → chunk-VN3L2JWZ.js} +46 -72
- package/dist/{chunk-Z7IGUAXL.js → chunk-VOP4PJKA.js} +12 -8
- package/dist/{chunk-F5Z6URKM.js → chunk-VOXTCULR.js} +2 -2
- package/dist/{chunk-NNKXDXXS.js → chunk-VPLBLWFO.js} +14 -8
- package/dist/chunk-W3BGKBBK.js +27 -0
- package/dist/{chunk-ZKXQKGWZ.js → chunk-WC6WRNQT.js} +4 -3
- package/dist/{chunk-Q3UZHW6N.js → chunk-WMDUT4KH.js} +1150 -1138
- package/dist/{chunk-KXF5R4UN.js → chunk-WQV6BI4Q.js} +1 -1
- package/dist/chunk-WXUDRAG6.js +24 -0
- package/dist/{chunk-OLAWH5UQ.js → chunk-X35S7HSB.js} +29 -10
- package/dist/{chunk-YBSONGSZ.js → chunk-X66YJ2SS.js} +40 -34
- package/dist/{chunk-U6OC3QEM.js → chunk-XOMGO63G.js} +22 -21
- package/dist/{chunk-WQOIR3QY.js → chunk-XWIME22V.js} +13 -13
- package/dist/{chunk-3WEPUD2V.js → chunk-XYLC35E4.js} +202 -103
- package/dist/{chunk-UCGQT677.js → chunk-YHGYAEFH.js} +18 -18
- package/dist/{chunk-V3APN3DY.js → chunk-ZFORSIED.js} +13 -13
- package/dist/{chunk-BHUWL2Y3.js → chunk-ZKLTNLAW.js} +64 -73
- package/dist/chunk-ZONZ6YY3.js +74 -0
- package/dist/chunk-ZSM35JF4.js +30 -0
- package/dist/{chunk-PPIBVH4R.js → chunk-ZZDIOAAJ.js} +15 -6
- package/dist/index.js +8817 -6239
- package/dist/mcp/analyze-cli.js +10 -10
- package/dist/mcp/cli.js +44 -42
- package/dist/mcp/server.js +2236 -861
- package/dist/mcp/worker.js +62 -61
- package/dist/probes/installer.js +20 -19
- package/docs/adr/0003-git-guard-latch-writer.md +11 -6
- package/docs/agent-tools.md +29 -11
- package/docs/alignment-families.md +29 -0
- package/docs/ast-grep_rules_catalog.md +6 -4
- package/docs/ci-bot-pr-checks.md +126 -0
- package/docs/configuration.md +99 -3
- package/docs/defect-shapes.md +68 -11
- package/docs/dependencies.md +1 -0
- package/docs/engineering-principles.md +27 -2
- package/docs/environment-variables.md +14 -0
- package/docs/features.md +13 -3
- package/docs/globalconfig.md +12 -1
- package/docs/invariants/git-guard-host.md +38 -0
- package/docs/invariants/language-config.md +15 -4
- package/docs/invariants/lsp-trust-exec.md +22 -2
- package/docs/invariants/paths-os.md +4 -2
- package/docs/invariants/session-telemetry.md +42 -2
- package/docs/lsp-capability-matrix.md +208 -84
- package/docs/lsp-idle-eviction.md +3 -5
- package/docs/merge-queue-rollout.md +1 -1
- package/docs/pi-lens-fixer.md +31 -17
- package/docs/pi-lens-merge-policy.md +27 -15
- package/docs/pi-lens-monitor.md +9 -0
- package/docs/pi-lens-orchestration.md +4 -1
- package/docs/pi-lens-reviewer.md +5 -5
- package/docs/pi-lens-subagent.md +13 -7
- package/docs/public-api-stability.md +18 -2
- package/docs/schema/pi-lens-config-v1.json +33 -0
- package/docs/servercapabilities.md +1 -1
- package/docs/settings.md +15 -6
- package/docs/usage.md +5 -0
- package/docs/word-index.md +17 -5
- package/package.json +5 -3
- package/rules/ast-grep-rules/rule-tests/no-accumulating-spread-js-test.yml +37 -0
- package/rules/ast-grep-rules/rule-tests/ts-redundant-filter-map-test.yml +12 -1
- package/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-js-test.yml +12 -0
- package/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-test.yml +25 -0
- package/rules/ast-grep-rules/rules/no-accumulating-spread-js.yml +49 -1
- package/rules/ast-grep-rules/rules/ts-redundant-filter-map.yml +9 -1
- package/rules/ast-grep-rules/rules-disabled/filter-then-map-js.yml +17 -0
- package/rules/ast-grep-rules/rules-disabled/filter-then-map.yml +36 -0
- package/rules/ast-grep-rules/self-scan-baseline.json +1 -1
- package/dist/chunk-2F47TQOA.js +0 -73
- package/dist/chunk-2X4VLOCC.js +0 -55
- package/dist/chunk-4WX4CTUE.js +0 -57
- package/dist/chunk-FJIVKLPH.js +0 -31
- package/dist/chunk-G2B7F6ZU.js +0 -88
- package/dist/chunk-GTAI2J6U.js +0 -27
- package/dist/chunk-IPDG45G5.js +0 -26
- package/dist/chunk-P4QNXS6I.js +0 -27
- package/dist/chunk-Q6D6VMI4.js +0 -22
- package/dist/chunk-SXGD4ANG.js +0 -25
- package/dist/chunk-XCUHKYCQ.js +0 -23
- package/dist/chunk-YRD4ISED.js +0 -30
|
@@ -1,36 +1,36 @@
|
|
|
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-DYRZGUMA.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-FHEV6T4L.js";
|
|
11
11
|
import {
|
|
12
12
|
hasCargoWorkspaceTable,
|
|
13
13
|
readCargoWorkspaceExclude,
|
|
14
14
|
readCargoWorkspaceMembers,
|
|
15
15
|
readTextFileOrUndefined
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WC6WRNQT.js";
|
|
17
17
|
import {
|
|
18
18
|
getUserRuleRoot,
|
|
19
19
|
ruleCorpusFingerprintForCycle
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-HHR7WGCI.js";
|
|
21
21
|
import {
|
|
22
22
|
load,
|
|
23
23
|
resolvePackagePath
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-HKIL6DCL.js";
|
|
25
25
|
import {
|
|
26
26
|
extensionsForLanguage
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-PPKECBPP.js";
|
|
28
28
|
import {
|
|
29
29
|
HOOK_WALL_BUDGET_MS
|
|
30
30
|
} from "./chunk-CKEQFGLT.js";
|
|
31
31
|
import {
|
|
32
32
|
bounded
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-JYLOYTZD.js";
|
|
34
34
|
import {
|
|
35
35
|
ensureTool,
|
|
36
36
|
findManagedToolBinary,
|
|
@@ -40,25 +40,25 @@ import {
|
|
|
40
40
|
isZizmorAuditTarget,
|
|
41
41
|
logSessionStart,
|
|
42
42
|
resolveZizmorGitHubToken
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-BQG2QFVO.js";
|
|
44
44
|
import {
|
|
45
45
|
resolveToolCwd
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-IYVYZQRL.js";
|
|
47
47
|
import {
|
|
48
48
|
commandSearchReachesProject,
|
|
49
49
|
findGlobalBinary,
|
|
50
50
|
isProjectLocalBinPath
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-VOP4PJKA.js";
|
|
52
52
|
import {
|
|
53
53
|
classifyProbeFailure,
|
|
54
54
|
createAvailabilityLatch,
|
|
55
55
|
describeInstallAttempt,
|
|
56
56
|
logAvailabilityDecision,
|
|
57
57
|
startHostStallSampler
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-JZRP4DGP.js";
|
|
59
59
|
import {
|
|
60
60
|
readDirEntriesSafeAsync
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-O2ARHQKF.js";
|
|
62
62
|
import {
|
|
63
63
|
OWNER_TAG_ENV,
|
|
64
64
|
SpawnFailureError,
|
|
@@ -87,13 +87,13 @@ import {
|
|
|
87
87
|
safeSpawnAsync,
|
|
88
88
|
statIsFile,
|
|
89
89
|
trustScopedEnvironment
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-WMDUT4KH.js";
|
|
91
91
|
import {
|
|
92
92
|
DOTNET_CSHARP_ROOT_MARKERS,
|
|
93
93
|
DOTNET_FSHARP_ROOT_MARKERS,
|
|
94
94
|
KIND_EXTENSIONS,
|
|
95
95
|
LEAN_ROOT_MARKERS
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-G5GV2Q7K.js";
|
|
97
97
|
import {
|
|
98
98
|
isRepoTier,
|
|
99
99
|
lspSectionOf,
|
|
@@ -103,40 +103,42 @@ import {
|
|
|
103
103
|
reportPiLensConfigRecords,
|
|
104
104
|
resolvePiLensConfig,
|
|
105
105
|
summarizeConfigResolution
|
|
106
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-X35S7HSB.js";
|
|
107
107
|
import {
|
|
108
108
|
FRESHNESS_CADENCE_MS,
|
|
109
109
|
LSP_NAMESPACE_KEY,
|
|
110
|
+
PROJECT_CONFIG_LOCATIONS,
|
|
110
111
|
dirMtimeIsRacy,
|
|
111
112
|
dirMtimeRecordsAsync,
|
|
112
113
|
dirMtimesStillFreshAsync,
|
|
114
|
+
getDirectoryMarkers,
|
|
113
115
|
getPiLensGlobalConfigPath,
|
|
114
116
|
unknownDirMtimeRecords
|
|
115
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-SQC7K3SP.js";
|
|
116
118
|
import {
|
|
117
119
|
getProjectTrustGeneration,
|
|
118
120
|
getProjectTrustState
|
|
119
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-JE6HKLC7.js";
|
|
120
122
|
import {
|
|
121
123
|
getDegradationLedgerGeneration,
|
|
122
124
|
incrementDegradationCount,
|
|
123
125
|
recordDegradationOnce
|
|
124
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-2453RRJ2.js";
|
|
125
127
|
import {
|
|
126
128
|
logExtension
|
|
127
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-WQV6BI4Q.js";
|
|
128
130
|
import {
|
|
129
131
|
claimPhaseOncePerSession,
|
|
130
132
|
currentSessionRecordId,
|
|
131
133
|
logLatency,
|
|
132
134
|
releasePhaseClaim
|
|
133
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-565VRUP4.js";
|
|
134
136
|
import {
|
|
135
137
|
getGlobalPiLensLogDir,
|
|
136
138
|
getProcessSingleton,
|
|
137
139
|
isTestMode,
|
|
138
140
|
redactSecrets
|
|
139
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-VLQ7UKZH.js";
|
|
140
142
|
import {
|
|
141
143
|
STAGE_TMP_PATTERN
|
|
142
144
|
} from "./chunk-LJDODBBZ.js";
|
|
@@ -146,19 +148,23 @@ import {
|
|
|
146
148
|
CARGO_WORKSPACE_MEMBER_DIALECT,
|
|
147
149
|
direntsHaveMarkerGlobMatch,
|
|
148
150
|
findLocalToolConfig,
|
|
151
|
+
isAbsoluteFilePath,
|
|
149
152
|
isAtOrAboveHomeDir,
|
|
150
153
|
isFullyQualified,
|
|
151
154
|
isUnderDir,
|
|
152
155
|
isVendorPath,
|
|
153
156
|
isWindowsPath,
|
|
157
|
+
isWithinForm,
|
|
154
158
|
matchesWorkspaceMemberPattern,
|
|
155
159
|
normalizeEphemeralMapKey,
|
|
156
160
|
normalizeFilePath,
|
|
157
161
|
normalizeMapKey,
|
|
158
162
|
pathsEqual,
|
|
159
163
|
realpathOrResolve,
|
|
160
|
-
toPosix
|
|
161
|
-
|
|
164
|
+
toPosix,
|
|
165
|
+
toProjectRelativePath,
|
|
166
|
+
walkUpDirs
|
|
167
|
+
} from "./chunk-GMROJJRN.js";
|
|
162
168
|
|
|
163
169
|
// dist/clients/analysis-root.js
|
|
164
170
|
import * as fs from "node:fs";
|
|
@@ -187,14 +193,11 @@ function hasProjectMarker(dir) {
|
|
|
187
193
|
});
|
|
188
194
|
}
|
|
189
195
|
function nearestProjectRoot(filePath) {
|
|
190
|
-
|
|
191
|
-
const filesystemRoot = nodePath.parse(dir).root;
|
|
192
|
-
while (dir !== filesystemRoot) {
|
|
196
|
+
for (const dir of walkUpDirs(nodePath.dirname(filePath))) {
|
|
193
197
|
if (hasProjectMarker(dir))
|
|
194
198
|
return dir;
|
|
195
|
-
dir = nodePath.dirname(dir);
|
|
196
199
|
}
|
|
197
|
-
return
|
|
200
|
+
return void 0;
|
|
198
201
|
}
|
|
199
202
|
function resolveAnalysisRootPath(filePath, sessionRoot, homeDirOverride) {
|
|
200
203
|
const resolved = realpathOrResolve(filePath);
|
|
@@ -244,6 +247,39 @@ function resolveAnalysisRoot(filePath, sessionRoot, homeDirOverride) {
|
|
|
244
247
|
function canWriteAnalysisRoot(mode) {
|
|
245
248
|
return mode === "session" || mode === "linked-worktree";
|
|
246
249
|
}
|
|
250
|
+
function resolveSessionConfigRoot(filePath, sessionRoot, homeDirOverride) {
|
|
251
|
+
const { mode, root } = classifyAnalysisRoot(filePath, sessionRoot, homeDirOverride);
|
|
252
|
+
if (root === void 0 || mode === "adopted" || mode === "none")
|
|
253
|
+
return { register: void 0, mode };
|
|
254
|
+
return {
|
|
255
|
+
register: configRootOnFileSpelling(filePath, root) ?? root,
|
|
256
|
+
mode
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
function configRootOnFileSpelling(filePath, root) {
|
|
260
|
+
let entry;
|
|
261
|
+
for (const dir of walkUpDirs(nodePath.dirname(nodePath.resolve(filePath)), {
|
|
262
|
+
spelling: true
|
|
263
|
+
})) {
|
|
264
|
+
if (!isUnderDir(dir, root))
|
|
265
|
+
return entry;
|
|
266
|
+
if (holdsProjectConfig(dir))
|
|
267
|
+
return dir;
|
|
268
|
+
entry = dir;
|
|
269
|
+
}
|
|
270
|
+
return entry;
|
|
271
|
+
}
|
|
272
|
+
function holdsProjectConfig(dir) {
|
|
273
|
+
return PROJECT_CONFIG_LOCATIONS.some((location) => {
|
|
274
|
+
let at = dir;
|
|
275
|
+
for (const segment of location.relativePath.split("/")) {
|
|
276
|
+
if (!getDirectoryMarkers(at).entryNames.has(segment))
|
|
277
|
+
return false;
|
|
278
|
+
at = nodePath.join(at, segment);
|
|
279
|
+
}
|
|
280
|
+
return true;
|
|
281
|
+
});
|
|
282
|
+
}
|
|
247
283
|
|
|
248
284
|
// dist/clients/lsp/file-server-match.js
|
|
249
285
|
import path from "node:path";
|
|
@@ -288,18 +324,11 @@ var SGCONFIG_NAMES = ["sgconfig.yml", "sgconfig.yaml"];
|
|
|
288
324
|
function findLocalSgconfig(startDir) {
|
|
289
325
|
return findLocalToolConfig(startDir, SGCONFIG_NAMES);
|
|
290
326
|
}
|
|
291
|
-
function canonicalDir(dir) {
|
|
292
|
-
try {
|
|
293
|
-
return fs2.realpathSync.native(dir);
|
|
294
|
-
} catch {
|
|
295
|
-
return path2.resolve(dir);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
327
|
function getAstGrepRuleSources(projectRoot = process.cwd()) {
|
|
299
328
|
const root = path2.resolve(projectRoot || process.cwd());
|
|
300
329
|
const packageRoot = resolvePackagePath(import.meta.url);
|
|
301
330
|
const candidates = [];
|
|
302
|
-
if (
|
|
331
|
+
if (realpathOrResolve(root) !== realpathOrResolve(packageRoot)) {
|
|
303
332
|
candidates.push({
|
|
304
333
|
dir: path2.join(root, "rules", "ast-grep-rules", "rules"),
|
|
305
334
|
origin: "project",
|
|
@@ -311,7 +340,7 @@ function getAstGrepRuleSources(projectRoot = process.cwd()) {
|
|
|
311
340
|
});
|
|
312
341
|
}
|
|
313
342
|
const userRoot = getUserRuleRoot();
|
|
314
|
-
if (
|
|
343
|
+
if (realpathOrResolve(userRoot) !== realpathOrResolve(root)) {
|
|
315
344
|
candidates.push({
|
|
316
345
|
dir: path2.join(userRoot, "ast-grep-rules", "rules"),
|
|
317
346
|
origin: "user",
|
|
@@ -335,7 +364,7 @@ function getAstGrepRuleSources(projectRoot = process.cwd()) {
|
|
|
335
364
|
return candidates.filter((source) => {
|
|
336
365
|
if (!fs2.existsSync(source.dir))
|
|
337
366
|
return false;
|
|
338
|
-
const key =
|
|
367
|
+
const key = realpathOrResolve(source.dir);
|
|
339
368
|
if (seen.has(key))
|
|
340
369
|
return false;
|
|
341
370
|
seen.add(key);
|
|
@@ -384,7 +413,7 @@ function parseRuleDocuments(content) {
|
|
|
384
413
|
}
|
|
385
414
|
var bundledSnapshots = /* @__PURE__ */ new Map();
|
|
386
415
|
function snapshotRuleSource(source) {
|
|
387
|
-
const cacheKey =
|
|
416
|
+
const cacheKey = realpathOrResolve(source.dir);
|
|
388
417
|
if (source.origin === "bundled") {
|
|
389
418
|
const cached = bundledSnapshots.get(cacheKey);
|
|
390
419
|
if (cached)
|
|
@@ -428,7 +457,7 @@ function sourceFingerprint(sources) {
|
|
|
428
457
|
hash.update("\0");
|
|
429
458
|
hash.update(source.tier);
|
|
430
459
|
hash.update("\0");
|
|
431
|
-
hash.update(
|
|
460
|
+
hash.update(realpathOrResolve(source.dir));
|
|
432
461
|
hash.update("\0");
|
|
433
462
|
hash.update(source.digest);
|
|
434
463
|
hash.update("\0");
|
|
@@ -473,7 +502,7 @@ function rootArtifactKey(root) {
|
|
|
473
502
|
return createHash("sha256").update(root).digest("hex").slice(0, 12);
|
|
474
503
|
}
|
|
475
504
|
function resolveBaselineSgconfig(projectRoot = process.cwd()) {
|
|
476
|
-
const root =
|
|
505
|
+
const root = realpathOrResolve(path2.resolve(projectRoot || process.cwd()));
|
|
477
506
|
const fingerprint = getAstGrepRuleFingerprint(root, { force: true });
|
|
478
507
|
const cached = cachedBaselines.get(root);
|
|
479
508
|
if (cached?.fingerprint === fingerprint && fs2.existsSync(cached.path) && fs2.existsSync(cached.mergedDir)) {
|
|
@@ -595,6 +624,9 @@ var ROLE_MEMBERS = {
|
|
|
595
624
|
auxiliary: "auxiliary"
|
|
596
625
|
};
|
|
597
626
|
var DEFAULT_LSP_SERVER_ROLE = "language";
|
|
627
|
+
function isTsgoLaunchVariant(variant) {
|
|
628
|
+
return variant === "native-ts7" || variant === "effect-tsgo";
|
|
629
|
+
}
|
|
598
630
|
function isAuxiliary(bearer) {
|
|
599
631
|
const declared = bearer?.role;
|
|
600
632
|
const role = typeof declared === "string" && Object.hasOwn(ROLE_MEMBERS, declared) ? ROLE_MEMBERS[declared] : DEFAULT_LSP_SERVER_ROLE;
|
|
@@ -1401,7 +1433,21 @@ function lspConfigOf(value, problems, provenance) {
|
|
|
1401
1433
|
}
|
|
1402
1434
|
return config;
|
|
1403
1435
|
}
|
|
1436
|
+
function customServerLaunch(config, id) {
|
|
1437
|
+
const { command } = config;
|
|
1438
|
+
if (typeof command === "string" && command !== "") {
|
|
1439
|
+
return { program: command, argv: config.args ?? ["--stdio"] };
|
|
1440
|
+
}
|
|
1441
|
+
if (Array.isArray(command) && typeof command[0] === "string" && command[0] !== "" && command.every((part) => typeof part === "string")) {
|
|
1442
|
+
return {
|
|
1443
|
+
program: command[0],
|
|
1444
|
+
argv: [...command.slice(1), ...config.args ?? []]
|
|
1445
|
+
};
|
|
1446
|
+
}
|
|
1447
|
+
throw new Error(`lsp.servers.${id}.command must be a non-empty string or a non-empty array of strings`);
|
|
1448
|
+
}
|
|
1404
1449
|
function createCustomServer(config, id) {
|
|
1450
|
+
const commandToken = typeof config.command === "string" ? config.command : Array.isArray(config.command) ? config.command[0] : void 0;
|
|
1405
1451
|
return {
|
|
1406
1452
|
id,
|
|
1407
1453
|
name: config.name,
|
|
@@ -1409,7 +1455,7 @@ function createCustomServer(config, id) {
|
|
|
1409
1455
|
// The own-command token the runner-coverage seam gates this row's
|
|
1410
1456
|
// covers claim on (#3968 F2): the declared covering lane's binary must
|
|
1411
1457
|
// be probeable before the claim can defer a CLI runner.
|
|
1412
|
-
command:
|
|
1458
|
+
...commandToken === void 0 ? {} : { command: commandToken },
|
|
1413
1459
|
extensions: config.extensions,
|
|
1414
1460
|
// A config-declared server is a language server. The public
|
|
1415
1461
|
// `lsp.servers.<id>.role` field is validated and projected by
|
|
@@ -1430,7 +1476,8 @@ function createCustomServer(config, id) {
|
|
|
1430
1476
|
...config.rootMarkers ? { rootMarkers: config.rootMarkers } : {}
|
|
1431
1477
|
}).cwd : async (file) => resolveToolCwd("lsp", id, file, { cwd: process.cwd() }).cwd,
|
|
1432
1478
|
async spawn(root) {
|
|
1433
|
-
const
|
|
1479
|
+
const { program, argv } = customServerLaunch(config, id);
|
|
1480
|
+
const proc = await launchLSP(program, argv, {
|
|
1434
1481
|
cwd: root,
|
|
1435
1482
|
env: config.env ? { ...process.env, ...config.env } : process.env
|
|
1436
1483
|
});
|
|
@@ -2264,7 +2311,7 @@ function overrideStrategy(serverId) {
|
|
|
2264
2311
|
return strategy;
|
|
2265
2312
|
}
|
|
2266
2313
|
function getStrategy(serverId, launchVariant) {
|
|
2267
|
-
if (serverId === "typescript" && launchVariant
|
|
2314
|
+
if (serverId === "typescript" && isTsgoLaunchVariant(launchVariant)) {
|
|
2268
2315
|
return NATIVE_TS7_DIAGNOSTIC_STRATEGY;
|
|
2269
2316
|
}
|
|
2270
2317
|
if (launchVariant === "override")
|
|
@@ -2822,8 +2869,12 @@ function isSameOrWithin(ancestor, candidate, deps = {}) {
|
|
|
2822
2869
|
caseInsensitive = posixFilesystemIsCaseInsensitive(resolvedAncestor);
|
|
2823
2870
|
}
|
|
2824
2871
|
}
|
|
2825
|
-
const
|
|
2826
|
-
|
|
2872
|
+
const fold = windowsShaped || caseInsensitive;
|
|
2873
|
+
const form = (resolved) => {
|
|
2874
|
+
const slashed = windowsShaped ? toPosix(resolved) : resolved;
|
|
2875
|
+
return fold ? slashed.toLowerCase() : slashed;
|
|
2876
|
+
};
|
|
2877
|
+
return isWithinForm(form(resolvedCandidate), form(resolvedAncestor));
|
|
2827
2878
|
}
|
|
2828
2879
|
function enforceLspRootCeiling(root, sessionCwd, filePath) {
|
|
2829
2880
|
const windowsShaped = isWindowsPath(root) || isWindowsPath(sessionCwd);
|
|
@@ -2867,11 +2918,9 @@ function hasAtomicStageSegment(dir) {
|
|
|
2867
2918
|
return pathSegments(dir).some((segment) => STAGE_TMP_PATTERN.test(segment));
|
|
2868
2919
|
}
|
|
2869
2920
|
async function findGitBoundary(dir, memo) {
|
|
2870
|
-
let current = path7.resolve(dir);
|
|
2871
|
-
const fsRoot = path7.parse(current).root;
|
|
2872
2921
|
const visited = [];
|
|
2873
2922
|
let found;
|
|
2874
|
-
|
|
2923
|
+
for (const current of walkUpDirs(dir, { spelling: true })) {
|
|
2875
2924
|
const key = normalizeMapKey(current);
|
|
2876
2925
|
if (memo?.has(key)) {
|
|
2877
2926
|
found = memo.get(key);
|
|
@@ -2882,9 +2931,6 @@ async function findGitBoundary(dir, memo) {
|
|
|
2882
2931
|
found = current;
|
|
2883
2932
|
break;
|
|
2884
2933
|
}
|
|
2885
|
-
if (current === fsRoot)
|
|
2886
|
-
break;
|
|
2887
|
-
current = path7.dirname(current);
|
|
2888
2934
|
}
|
|
2889
2935
|
for (const seen of visited)
|
|
2890
2936
|
memo?.set(seen, found);
|
|
@@ -2902,12 +2948,11 @@ async function isExcludedLspRoot(dir, gitBoundaries) {
|
|
|
2902
2948
|
return isPathIgnoredByProject(candidate, gitRoot, true);
|
|
2903
2949
|
}
|
|
2904
2950
|
async function nearestNonExcludedFallbackRoot(candidate, stopDir) {
|
|
2905
|
-
|
|
2906
|
-
const
|
|
2907
|
-
const fsRoot = path7.parse(current).root;
|
|
2951
|
+
const startDir = path7.resolve(candidate);
|
|
2952
|
+
const fsRoot = path7.parse(startDir).root;
|
|
2908
2953
|
let nearestAllowed;
|
|
2909
2954
|
const gitBoundaries = /* @__PURE__ */ new Map();
|
|
2910
|
-
|
|
2955
|
+
for (const current of walkUpDirs(startDir, { spelling: true })) {
|
|
2911
2956
|
if (!await isExcludedLspRoot(current, gitBoundaries)) {
|
|
2912
2957
|
nearestAllowed ??= current;
|
|
2913
2958
|
for (const marker of FALLBACK_PROJECT_MARKERS) {
|
|
@@ -2915,9 +2960,8 @@ async function nearestNonExcludedFallbackRoot(candidate, stopDir) {
|
|
|
2915
2960
|
return current;
|
|
2916
2961
|
}
|
|
2917
2962
|
}
|
|
2918
|
-
if (
|
|
2963
|
+
if (normalizeEphemeralMapKey(current) === stopDir)
|
|
2919
2964
|
break;
|
|
2920
|
-
current = path7.dirname(current);
|
|
2921
2965
|
}
|
|
2922
2966
|
if (stopDir !== void 0)
|
|
2923
2967
|
return nearestAllowed ?? startDir;
|
|
@@ -3558,7 +3602,7 @@ async function markerExists(dir, pattern) {
|
|
|
3558
3602
|
return false;
|
|
3559
3603
|
}
|
|
3560
3604
|
}
|
|
3561
|
-
const normalized = pattern
|
|
3605
|
+
const normalized = toPosix(pattern);
|
|
3562
3606
|
const slash = normalized.lastIndexOf("/");
|
|
3563
3607
|
const basenamePattern = slash >= 0 ? normalized.slice(slash + 1) : normalized;
|
|
3564
3608
|
if (!basenamePattern)
|
|
@@ -3601,10 +3645,9 @@ function NearestRoot(includePatterns, excludePatterns, stopDir) {
|
|
|
3601
3645
|
const probedDirs = [];
|
|
3602
3646
|
const walkedAt = Date.now();
|
|
3603
3647
|
const promise = (async () => {
|
|
3604
|
-
|
|
3605
|
-
const fsRoot = path7.parse(currentDir).root;
|
|
3648
|
+
const fsRoot = path7.parse(startDir).root;
|
|
3606
3649
|
const stop = stopDir ? realpathOrResolve(stopDir) : fsRoot;
|
|
3607
|
-
|
|
3650
|
+
for (const currentDir of walkUpDirs(startDir)) {
|
|
3608
3651
|
if (stop !== fsRoot && currentDir.startsWith(stop + path7.sep) === false && currentDir !== stop) {
|
|
3609
3652
|
break;
|
|
3610
3653
|
}
|
|
@@ -3622,10 +3665,8 @@ function NearestRoot(includePatterns, excludePatterns, stopDir) {
|
|
|
3622
3665
|
break;
|
|
3623
3666
|
}
|
|
3624
3667
|
}
|
|
3625
|
-
if (excluded)
|
|
3626
|
-
currentDir = path7.dirname(currentDir);
|
|
3668
|
+
if (excluded)
|
|
3627
3669
|
continue;
|
|
3628
|
-
}
|
|
3629
3670
|
}
|
|
3630
3671
|
for (const pattern of includePatterns) {
|
|
3631
3672
|
if (await markerExists(currentDir, pattern) && (pattern !== ".git" || currentDir !== realpathOrResolve(os7.tmpdir())) && !await isExcludedLspRoot(currentDir)) {
|
|
@@ -3635,7 +3676,6 @@ function NearestRoot(includePatterns, excludePatterns, stopDir) {
|
|
|
3635
3676
|
if (currentDir === stop || currentDir === fsRoot) {
|
|
3636
3677
|
break;
|
|
3637
3678
|
}
|
|
3638
|
-
currentDir = path7.dirname(currentDir);
|
|
3639
3679
|
}
|
|
3640
3680
|
return void 0;
|
|
3641
3681
|
})();
|
|
@@ -3677,8 +3717,10 @@ async function findAncestorFile(startDir, ...relativeSegments) {
|
|
|
3677
3717
|
}
|
|
3678
3718
|
async function findAncestorFileAmong(startDir, candidateSegmentLists) {
|
|
3679
3719
|
const fs6 = await import("node:fs/promises");
|
|
3680
|
-
|
|
3681
|
-
|
|
3720
|
+
const home = realpathOrResolve(os7.homedir());
|
|
3721
|
+
for (const currentDir of walkUpDirs(startDir, { spelling: true })) {
|
|
3722
|
+
if (isAtOrAboveHomeDir(realpathOrResolve(currentDir), home))
|
|
3723
|
+
break;
|
|
3682
3724
|
for (const segments of candidateSegmentLists) {
|
|
3683
3725
|
const candidate = path7.join(currentDir, ...segments);
|
|
3684
3726
|
try {
|
|
@@ -3687,10 +3729,6 @@ async function findAncestorFileAmong(startDir, candidateSegmentLists) {
|
|
|
3687
3729
|
} catch {
|
|
3688
3730
|
}
|
|
3689
3731
|
}
|
|
3690
|
-
const parent = path7.dirname(currentDir);
|
|
3691
|
-
if (parent === currentDir)
|
|
3692
|
-
break;
|
|
3693
|
-
currentDir = parent;
|
|
3694
3732
|
}
|
|
3695
3733
|
return void 0;
|
|
3696
3734
|
}
|
|
@@ -3815,8 +3853,10 @@ async function findTsserverPath(root, allowInstall, options) {
|
|
|
3815
3853
|
return tsserverForTsc(repairedTsc);
|
|
3816
3854
|
}
|
|
3817
3855
|
async function findNativeTypeScriptLsp(root) {
|
|
3818
|
-
|
|
3819
|
-
|
|
3856
|
+
const home = realpathOrResolve(os7.homedir());
|
|
3857
|
+
for (const currentDir of walkUpDirs(root, { spelling: true })) {
|
|
3858
|
+
if (isAtOrAboveHomeDir(realpathOrResolve(currentDir), home))
|
|
3859
|
+
break;
|
|
3820
3860
|
const typescriptDir = path7.join(currentDir, "node_modules", "typescript");
|
|
3821
3861
|
const packageJsonPath = path7.join(typescriptDir, "package.json");
|
|
3822
3862
|
let packageJsonText;
|
|
@@ -3832,10 +3872,6 @@ async function findNativeTypeScriptLsp(root) {
|
|
|
3832
3872
|
return void 0;
|
|
3833
3873
|
} catch {
|
|
3834
3874
|
}
|
|
3835
|
-
const parent = path7.dirname(currentDir);
|
|
3836
|
-
if (parent === currentDir)
|
|
3837
|
-
return void 0;
|
|
3838
|
-
currentDir = parent;
|
|
3839
3875
|
continue;
|
|
3840
3876
|
}
|
|
3841
3877
|
let version;
|
|
@@ -3857,7 +3893,11 @@ async function findNativeTypeScriptLsp(root) {
|
|
|
3857
3893
|
for (const command of candidates) {
|
|
3858
3894
|
try {
|
|
3859
3895
|
await access(command);
|
|
3860
|
-
return {
|
|
3896
|
+
return {
|
|
3897
|
+
command,
|
|
3898
|
+
version,
|
|
3899
|
+
nodeModulesDir: path7.join(currentDir, "node_modules")
|
|
3900
|
+
};
|
|
3861
3901
|
} catch {
|
|
3862
3902
|
}
|
|
3863
3903
|
}
|
|
@@ -3865,6 +3905,27 @@ async function findNativeTypeScriptLsp(root) {
|
|
|
3865
3905
|
}
|
|
3866
3906
|
return void 0;
|
|
3867
3907
|
}
|
|
3908
|
+
async function findEffectTsgoLsp(nodeModulesDir) {
|
|
3909
|
+
let release;
|
|
3910
|
+
try {
|
|
3911
|
+
const manifest = JSON.parse(await readFile(path7.join(nodeModulesDir, "@effect", "tsgo", "package.json"), "utf8"));
|
|
3912
|
+
release = typeof manifest === "object" && manifest !== null && "version" in manifest ? manifest.version : void 0;
|
|
3913
|
+
} catch {
|
|
3914
|
+
return void 0;
|
|
3915
|
+
}
|
|
3916
|
+
if (typeof release !== "string" || !release)
|
|
3917
|
+
return void 0;
|
|
3918
|
+
const localBin = path7.join(nodeModulesDir, ".bin", "effect-tsgo");
|
|
3919
|
+
const candidates = process.platform === "win32" ? [`${localBin}.cmd`, `${localBin}.exe`, localBin] : [localBin];
|
|
3920
|
+
for (const command of candidates) {
|
|
3921
|
+
try {
|
|
3922
|
+
await access(command);
|
|
3923
|
+
return { command, releaseTag: release };
|
|
3924
|
+
} catch {
|
|
3925
|
+
}
|
|
3926
|
+
}
|
|
3927
|
+
return void 0;
|
|
3928
|
+
}
|
|
3868
3929
|
function dotnetToolCandidates(tool) {
|
|
3869
3930
|
const home = os7.homedir();
|
|
3870
3931
|
return [
|
|
@@ -3955,9 +4016,9 @@ async function findExtensionBoundedRoot(file, extensionRootKey) {
|
|
|
3955
4016
|
const identity = realpathOrResolve(file);
|
|
3956
4017
|
const insideBoundary = isUnderDir(identity, extensionRootKey);
|
|
3957
4018
|
const boundaryKey = insideBoundary ? normalizeEphemeralMapKey(realpathOrResolve(extensionRootKey)) : extensionRootKey;
|
|
3958
|
-
|
|
4019
|
+
const start = path7.dirname(insideBoundary ? identity : path7.resolve(file));
|
|
3959
4020
|
const configMarkers = tsConfigMarkersForFile(file);
|
|
3960
|
-
|
|
4021
|
+
for (const currentDir of walkUpDirs(start, { spelling: true })) {
|
|
3961
4022
|
for (const pattern of configMarkers) {
|
|
3962
4023
|
try {
|
|
3963
4024
|
await stat(path7.join(currentDir, pattern));
|
|
@@ -3975,11 +4036,8 @@ async function findExtensionBoundedRoot(file, extensionRootKey) {
|
|
|
3975
4036
|
const currentKey = normalizeEphemeralMapKey(path7.resolve(currentDir));
|
|
3976
4037
|
if (currentKey === boundaryKey)
|
|
3977
4038
|
return void 0;
|
|
3978
|
-
const parent = path7.dirname(currentDir);
|
|
3979
|
-
if (parent === currentDir)
|
|
3980
|
-
return void 0;
|
|
3981
|
-
currentDir = parent;
|
|
3982
4039
|
}
|
|
4040
|
+
return void 0;
|
|
3983
4041
|
}
|
|
3984
4042
|
async function hasAgentLevelProjectMarker(extensionRootKey) {
|
|
3985
4043
|
const agentDir = path7.dirname(extensionRootKey);
|
|
@@ -4027,6 +4085,29 @@ var TypeScriptServer = {
|
|
|
4027
4085
|
rootMarkers: TypeScriptRoot.rootMarkers,
|
|
4028
4086
|
async spawn(root, options) {
|
|
4029
4087
|
const nativeLsp = await findNativeTypeScriptLsp(root);
|
|
4088
|
+
const effectLsp = nativeLsp ? await findEffectTsgoLsp(nativeLsp.nodeModulesDir) : void 0;
|
|
4089
|
+
if (nativeLsp && effectLsp && admitProjectSuppliedTsserver(effectLsp.command, root, true, options?.projectCodeAllowed)) {
|
|
4090
|
+
const env2 = await getToolEnvironment();
|
|
4091
|
+
try {
|
|
4092
|
+
const proc2 = await launchLSP(effectLsp.command, ["tsc", "--lsp", "--stdio"], { cwd: root, env: env2 });
|
|
4093
|
+
logSessionStart(`lsp typescript-effect-tsgo: version=${effectLsp.releaseTag} typescript=${nativeLsp.version} command=${effectLsp.command}`);
|
|
4094
|
+
return {
|
|
4095
|
+
process: proc2,
|
|
4096
|
+
source: "direct",
|
|
4097
|
+
launchVariant: "effect-tsgo"
|
|
4098
|
+
};
|
|
4099
|
+
} catch (launchFailure) {
|
|
4100
|
+
recordDegradationOnce({
|
|
4101
|
+
kind: "lsp-registry-decision",
|
|
4102
|
+
subject: `effect-tsgo-launch:g${getDegradationLedgerGeneration()}:${root}`,
|
|
4103
|
+
reason: `effect-tsgo launch failed, using the native launch: ${launchFailure instanceof Error ? launchFailure.message : String(launchFailure)}`,
|
|
4104
|
+
metadata: {
|
|
4105
|
+
field: "effect-tsgo-launch",
|
|
4106
|
+
launchVariant: "effect-tsgo"
|
|
4107
|
+
}
|
|
4108
|
+
});
|
|
4109
|
+
}
|
|
4110
|
+
}
|
|
4030
4111
|
if (nativeLsp && admitProjectSuppliedTsserver(nativeLsp.command, root, true, options?.projectCodeAllowed)) {
|
|
4031
4112
|
const env2 = await getToolEnvironment();
|
|
4032
4113
|
logSessionStart(`lsp typescript-native: version=${nativeLsp.version} command=${nativeLsp.command}`);
|
|
@@ -4279,8 +4360,8 @@ var GoServer = {
|
|
|
4279
4360
|
}
|
|
4280
4361
|
};
|
|
4281
4362
|
function cargoWorkspaceDeclaresMember(workspaceContent, parentDir, childDir) {
|
|
4282
|
-
const relativePath =
|
|
4283
|
-
if (relativePath
|
|
4363
|
+
const relativePath = toProjectRelativePath(childDir, parentDir);
|
|
4364
|
+
if (isAbsoluteFilePath(relativePath))
|
|
4284
4365
|
return false;
|
|
4285
4366
|
const matches = (pattern) => matchesWorkspaceMemberPattern(pattern, relativePath, CARGO_WORKSPACE_MEMBER_DIALECT, () => recordDegradationOnce({
|
|
4286
4367
|
kind: "workspace-glob-cap",
|
|
@@ -4303,9 +4384,8 @@ function RustWorkspaceRoot() {
|
|
|
4303
4384
|
return void 0;
|
|
4304
4385
|
const sessionCwd = process.cwd();
|
|
4305
4386
|
const stop = sessionHoistCeiling(sessionCwd, file);
|
|
4306
|
-
|
|
4307
|
-
const
|
|
4308
|
-
while (true) {
|
|
4387
|
+
const fsRoot = path7.parse(root).root;
|
|
4388
|
+
for (const current of walkUpDirs(root, { spelling: true })) {
|
|
4309
4389
|
if (stop !== void 0 && current === stop)
|
|
4310
4390
|
break;
|
|
4311
4391
|
const parent = path7.dirname(current);
|
|
@@ -4319,7 +4399,6 @@ function RustWorkspaceRoot() {
|
|
|
4319
4399
|
}
|
|
4320
4400
|
break;
|
|
4321
4401
|
}
|
|
4322
|
-
current = parent;
|
|
4323
4402
|
}
|
|
4324
4403
|
return root;
|
|
4325
4404
|
}, crateRoot.rootMarkers ?? []);
|
|
@@ -4363,24 +4442,20 @@ function JavaWorkspaceRoot() {
|
|
|
4363
4442
|
return root;
|
|
4364
4443
|
const sessionCwd = process.cwd();
|
|
4365
4444
|
const stop = sessionHoistCeiling(sessionCwd, file);
|
|
4366
|
-
let current = root;
|
|
4367
4445
|
let lastHop = root;
|
|
4368
|
-
const fsRoot = path7.parse(
|
|
4369
|
-
|
|
4446
|
+
const fsRoot = path7.parse(root).root;
|
|
4447
|
+
for (const current of walkUpDirs(root, { spelling: true })) {
|
|
4370
4448
|
if (stop !== void 0 && current === stop)
|
|
4371
4449
|
break;
|
|
4372
4450
|
const parent = path7.dirname(current);
|
|
4373
4451
|
if (parent === current || parent === fsRoot)
|
|
4374
4452
|
break;
|
|
4375
|
-
if (await markerExists(parent, "pom.xml"))
|
|
4376
|
-
const parentPom = path7.join(parent, "pom.xml");
|
|
4377
|
-
if (!await declaresMavenModule(parent, parentPom, lastHop))
|
|
4378
|
-
break;
|
|
4379
|
-
current = parent;
|
|
4380
|
-
lastHop = parent;
|
|
4453
|
+
if (!await markerExists(parent, "pom.xml"))
|
|
4381
4454
|
continue;
|
|
4382
|
-
|
|
4383
|
-
|
|
4455
|
+
const parentPom = path7.join(parent, "pom.xml");
|
|
4456
|
+
if (!await declaresMavenModule(parent, parentPom, lastHop))
|
|
4457
|
+
break;
|
|
4458
|
+
lastHop = parent;
|
|
4384
4459
|
}
|
|
4385
4460
|
return enforceLspRootCeiling(lastHop, sessionCwd, file);
|
|
4386
4461
|
}, moduleRoot.rootMarkers ?? []);
|
|
@@ -5451,6 +5526,25 @@ var TyposServer = {
|
|
|
5451
5526
|
},
|
|
5452
5527
|
autoInstall: async () => Boolean(await ensureTool("typos-lsp"))
|
|
5453
5528
|
};
|
|
5529
|
+
var FallowServer = {
|
|
5530
|
+
id: "fallow",
|
|
5531
|
+
idleEviction: "unmeasured",
|
|
5532
|
+
role: "auxiliary",
|
|
5533
|
+
name: "fallow TS/JS Code Health",
|
|
5534
|
+
extensions: JS_TS_LSP_EXTENSIONS,
|
|
5535
|
+
root: RootWithFallback(NearestRoot([".git"])),
|
|
5536
|
+
looseFileRoot: "decline",
|
|
5537
|
+
availabilityKey: "fallow-lsp",
|
|
5538
|
+
spawn(root, options) {
|
|
5539
|
+
return resolveAndLaunchTreeBinary({
|
|
5540
|
+
candidates: ["fallow-lsp"],
|
|
5541
|
+
bundleToolId: "fallow-lsp",
|
|
5542
|
+
binRelPath: "fallow-lsp",
|
|
5543
|
+
cwd: root,
|
|
5544
|
+
args: []
|
|
5545
|
+
}, options?.allowInstall);
|
|
5546
|
+
}
|
|
5547
|
+
};
|
|
5454
5548
|
var LSP_SERVERS = [
|
|
5455
5549
|
TypeScriptServer,
|
|
5456
5550
|
DenoServer,
|
|
@@ -5506,7 +5600,9 @@ var LSP_SERVERS = [
|
|
|
5506
5600
|
OpengrepServer,
|
|
5507
5601
|
AstGrepServer,
|
|
5508
5602
|
ZizmorServer,
|
|
5509
|
-
TyposServer
|
|
5603
|
+
TyposServer,
|
|
5604
|
+
FallowServer
|
|
5605
|
+
// opt-in (--lens-fallow), JS/TS only
|
|
5510
5606
|
];
|
|
5511
5607
|
function getServerById(id) {
|
|
5512
5608
|
return LSP_SERVERS.find((server) => server.id === id);
|
|
@@ -5594,11 +5690,14 @@ export {
|
|
|
5594
5690
|
getAstGrepRuleSources,
|
|
5595
5691
|
getAstGrepRuleFingerprint,
|
|
5596
5692
|
registerRunnerId,
|
|
5693
|
+
runnerIdentityPopulated,
|
|
5694
|
+
isKnownRunnerId,
|
|
5597
5695
|
withLspProjectCodePermission,
|
|
5598
5696
|
refuseUntrustedLspExecution,
|
|
5599
5697
|
resolveAnalysisRootPath,
|
|
5600
5698
|
resolveAnalysisRoot,
|
|
5601
5699
|
canWriteAnalysisRoot,
|
|
5700
|
+
resolveSessionConfigRoot,
|
|
5602
5701
|
BUILTIN_SERVER_RUNNER_COVERS,
|
|
5603
5702
|
isAuxiliary,
|
|
5604
5703
|
serverTraits,
|