pi-lens 4.4.7 → 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.
Files changed (167) hide show
  1. package/CHANGELOG.md +149 -0
  2. package/README.md +12 -2
  3. package/config/markdownlint/run-no-fix.mjs +36 -0
  4. package/dist/{chunk-WME2OQST.js → chunk-2453RRJ2.js} +11 -6
  5. package/dist/{chunk-FZKFVUEC.js → chunk-2BKUFQKR.js} +276 -208
  6. package/dist/chunk-2TS4GLOJ.js +31 -0
  7. package/dist/{chunk-QHSNL7B2.js → chunk-2ZE3AUJQ.js} +12 -14
  8. package/dist/{chunk-MPKRJBPK.js → chunk-35WKJWO5.js} +28 -30
  9. package/dist/chunk-3JAHQBSY.js +27 -0
  10. package/dist/{chunk-4LM3VAZH.js → chunk-3O5EII3W.js} +2 -2
  11. package/dist/chunk-447YZL4S.js +25 -0
  12. package/dist/{chunk-H7OR7DFZ.js → chunk-4B2YFN4U.js} +25 -21
  13. package/dist/{chunk-OSTKYB55.js → chunk-4BKU7PV3.js} +1 -1
  14. package/dist/{chunk-RRV3FNNM.js → chunk-4LL2VRNY.js} +27 -28
  15. package/dist/{chunk-BZARLRJW.js → chunk-4NBWFYWW.js} +9 -9
  16. package/dist/{chunk-KKCK636N.js → chunk-4QG55RRC.js} +12 -12
  17. package/dist/{chunk-RQS4QQSD.js → chunk-4W52ZKZX.js} +2 -2
  18. package/dist/{chunk-Z2XAOKHK.js → chunk-565VRUP4.js} +2 -2
  19. package/dist/{chunk-HWDAVBFU.js → chunk-57X2CDRX.js} +23 -23
  20. package/dist/{chunk-MB6PXBUA.js → chunk-5F3XF3SX.js} +7 -15
  21. package/dist/{chunk-O4BJFESU.js → chunk-5RNB4HVK.js} +1 -1
  22. package/dist/{chunk-ZMAUPOMG.js → chunk-5T5A6YAJ.js} +35 -34
  23. package/dist/{chunk-4ZYJHQMB.js → chunk-6FIRFP6A.js} +12 -12
  24. package/dist/{chunk-4YHYPW2G.js → chunk-6GMGEKQN.js} +9 -5
  25. package/dist/{chunk-4LOE5R5P.js → chunk-6LJOJ6EO.js} +20 -15
  26. package/dist/{chunk-3YY7IXIL.js → chunk-6YUNI7B5.js} +3 -3
  27. package/dist/{chunk-PKES3ISE.js → chunk-7ANZ7XDD.js} +2 -2
  28. package/dist/{chunk-FB5SCCPT.js → chunk-7CGIDRIK.js} +16 -15
  29. package/dist/{chunk-L3CMBQMH.js → chunk-7MAD5ZAY.js} +16 -17
  30. package/dist/{chunk-WDBICWH3.js → chunk-7TNILKGY.js} +1 -1
  31. package/dist/{chunk-RORGS5II.js → chunk-A5GRLYPZ.js} +9 -9
  32. package/dist/{chunk-MNJIXFX4.js → chunk-AGGUWKRK.js} +1 -1
  33. package/dist/{chunk-ABPKUVA4.js → chunk-BBET6HD6.js} +1 -1
  34. package/dist/{chunk-L5JYIU47.js → chunk-BHWW6FAX.js} +14 -13
  35. package/dist/{chunk-URCQWAQ4.js → chunk-BOPDQ7AZ.js} +23 -21
  36. package/dist/{chunk-KDX35VXP.js → chunk-BQG2QFVO.js} +158 -133
  37. package/dist/{chunk-CB4WHS4H.js → chunk-BUZIQDFS.js} +3 -3
  38. package/dist/{chunk-2PHMIAKO.js → chunk-CM73PPGD.js} +4 -4
  39. package/dist/{chunk-DH5JPM3K.js → chunk-CUDD35TW.js} +10 -9
  40. package/dist/{chunk-AWDSEDER.js → chunk-CZL44WFN.js} +2 -2
  41. package/dist/{chunk-N5WSK2K7.js → chunk-DIWK3LBC.js} +12 -15
  42. package/dist/{chunk-24BILSZW.js → chunk-DYRZGUMA.js} +2 -2
  43. package/dist/{chunk-PR6PO3ES.js → chunk-FHEV6T4L.js} +22 -18
  44. package/dist/{chunk-DQZFQSR5.js → chunk-FRLAUP2B.js} +4 -4
  45. package/dist/{chunk-RZOXUSPC.js → chunk-G5GV2Q7K.js} +2 -2
  46. package/dist/{chunk-EKWX4WD3.js → chunk-G6JKM4O7.js} +7 -7
  47. package/dist/chunk-GGYOZWHW.js +27 -0
  48. package/dist/{chunk-XT2HTCJ5.js → chunk-GIRBSBGL.js} +6 -5
  49. package/dist/{chunk-PQJFG24Z.js → chunk-GMROJJRN.js} +1292 -946
  50. package/dist/{chunk-U6VN4NVL.js → chunk-HHR7WGCI.js} +3 -3
  51. package/dist/{chunk-TIQJPRDD.js → chunk-HKIL6DCL.js} +3 -2
  52. package/dist/{chunk-SNDXCFRS.js → chunk-HUAM7QG3.js} +11 -11
  53. package/dist/{chunk-QOE342SU.js → chunk-HXFUTMX2.js} +2 -2
  54. package/dist/{chunk-U7BD2QL7.js → chunk-I22THIHI.js} +12 -12
  55. package/dist/chunk-IE5D3RA5.js +58 -0
  56. package/dist/{chunk-DPGEAHZT.js → chunk-IYVYZQRL.js} +10 -16
  57. package/dist/{chunk-3F6BMY53.js → chunk-JBP7KESM.js} +1 -1
  58. package/dist/{chunk-U5HPROLA.js → chunk-JE6HKLC7.js} +2 -2
  59. package/dist/{chunk-ZE3KXHS7.js → chunk-JPRDTY5S.js} +85 -3
  60. package/dist/{chunk-HO6LWE2E.js → chunk-JYLOYTZD.js} +17 -1
  61. package/dist/{chunk-KW5JQPO5.js → chunk-JZRP4DGP.js} +2 -2
  62. package/dist/{chunk-CPSR3AVL.js → chunk-KZ4ALBCH.js} +2 -2
  63. package/dist/{chunk-6IR3ZYIB.js → chunk-L3CLUGDY.js} +3 -3
  64. package/dist/{chunk-LV4UMYVH.js → chunk-L4NEVZ4T.js} +28 -27
  65. package/dist/chunk-LPYTPNOJ.js +22 -0
  66. package/dist/{chunk-WGRJOXED.js → chunk-LSFXZLPW.js} +1016 -636
  67. package/dist/{chunk-LBLBAFG3.js → chunk-MC6VB2E5.js} +4 -4
  68. package/dist/{chunk-U2SDMG7C.js → chunk-NM2NWH55.js} +5 -5
  69. package/dist/{chunk-T7A2HK2B.js → chunk-NSPVR3FN.js} +19 -18
  70. package/dist/{chunk-ZGSJDWQU.js → chunk-O2ARHQKF.js} +2 -2
  71. package/dist/{chunk-OXOI55RU.js → chunk-O4N5BQ3T.js} +10 -10
  72. package/dist/{chunk-3FRLWYBG.js → chunk-OC7VWJBZ.js} +39 -40
  73. package/dist/chunk-OFNMHPBT.js +89 -0
  74. package/dist/{chunk-HR3OJ3TH.js → chunk-OWTG6UMO.js} +21 -21
  75. package/dist/{chunk-75GAYVNO.js → chunk-OY7WZI7Q.js} +6 -6
  76. package/dist/{chunk-ZJTT47IG.js → chunk-OZWXLJMX.js} +2 -2
  77. package/dist/{chunk-F6X3YJWD.js → chunk-PIQQM32Y.js} +2 -2
  78. package/dist/chunk-PKLB2XJL.js +8 -0
  79. package/dist/{chunk-EAOK7MIZ.js → chunk-PKSUMEPT.js} +17 -4
  80. package/dist/{chunk-YISME6ON.js → chunk-PPKECBPP.js} +1 -1
  81. package/dist/{chunk-4L36HG27.js → chunk-R2QQC33W.js} +14 -14
  82. package/dist/{chunk-LUBPZN36.js → chunk-R4QWJQ2H.js} +11 -11
  83. package/dist/{chunk-V63BC55Q.js → chunk-RGGH6M34.js} +1 -1
  84. package/dist/{chunk-Y7F7IEE3.js → chunk-RZG472YW.js} +65 -7
  85. package/dist/{chunk-PUZ3E2J4.js → chunk-SDFKOLSF.js} +6 -6
  86. package/dist/{chunk-YHC2O2WO.js → chunk-SFLHSL5R.js} +9 -9
  87. package/dist/{chunk-CCV2EU7T.js → chunk-SP4TFY5F.js} +14 -13
  88. package/dist/{chunk-J6JP25XU.js → chunk-SQC7K3SP.js} +4 -3
  89. package/dist/{chunk-3K2F6UDZ.js → chunk-T2S3FNNJ.js} +44 -42
  90. package/dist/{chunk-2TF6RXWB.js → chunk-TV6RXRYH.js} +10 -10
  91. package/dist/{chunk-GNSIWBAT.js → chunk-U3AS2FR6.js} +3 -3
  92. package/dist/{chunk-F7K5IBZG.js → chunk-UHHLR2VY.js} +40 -40
  93. package/dist/chunk-UYXV5NIS.js +20 -0
  94. package/dist/{chunk-VSFLRN5Y.js → chunk-VLQ7UKZH.js} +1 -1
  95. package/dist/{chunk-VUZWQ7UG.js → chunk-VN3L2JWZ.js} +46 -72
  96. package/dist/{chunk-NA7SEXHE.js → chunk-VOP4PJKA.js} +7 -7
  97. package/dist/{chunk-F5Z6URKM.js → chunk-VOXTCULR.js} +2 -2
  98. package/dist/{chunk-LLS45EWB.js → chunk-VPLBLWFO.js} +6 -8
  99. package/dist/chunk-W3BGKBBK.js +27 -0
  100. package/dist/{chunk-ZKXQKGWZ.js → chunk-WC6WRNQT.js} +4 -3
  101. package/dist/{chunk-YVHBNSME.js → chunk-WMDUT4KH.js} +1148 -1132
  102. package/dist/{chunk-KXF5R4UN.js → chunk-WQV6BI4Q.js} +1 -1
  103. package/dist/chunk-WXUDRAG6.js +24 -0
  104. package/dist/{chunk-KPPJTH44.js → chunk-X35S7HSB.js} +28 -10
  105. package/dist/{chunk-JMEKXFOL.js → chunk-X66YJ2SS.js} +40 -34
  106. package/dist/{chunk-CE6VMBCB.js → chunk-XOMGO63G.js} +22 -21
  107. package/dist/{chunk-LS3QJRUB.js → chunk-XWIME22V.js} +13 -13
  108. package/dist/{chunk-R5MOQM2H.js → chunk-XYLC35E4.js} +119 -87
  109. package/dist/{chunk-OE5ZBP7F.js → chunk-YHGYAEFH.js} +18 -18
  110. package/dist/{chunk-7E2563GA.js → chunk-ZFORSIED.js} +13 -13
  111. package/dist/{chunk-E7HJ56Y7.js → chunk-ZKLTNLAW.js} +64 -73
  112. package/dist/chunk-ZONZ6YY3.js +74 -0
  113. package/dist/chunk-ZSM35JF4.js +30 -0
  114. package/dist/{chunk-RC2Z6K47.js → chunk-ZZDIOAAJ.js} +15 -6
  115. package/dist/index.js +6993 -5396
  116. package/dist/mcp/analyze-cli.js +10 -10
  117. package/dist/mcp/cli.js +44 -42
  118. package/dist/mcp/server.js +1627 -504
  119. package/dist/mcp/worker.js +62 -61
  120. package/dist/probes/installer.js +20 -19
  121. package/docs/adr/0003-git-guard-latch-writer.md +11 -6
  122. package/docs/agent-tools.md +18 -8
  123. package/docs/alignment-families.md +29 -0
  124. package/docs/ast-grep_rules_catalog.md +6 -4
  125. package/docs/ci-bot-pr-checks.md +126 -0
  126. package/docs/configuration.md +99 -3
  127. package/docs/defect-shapes.md +55 -12
  128. package/docs/engineering-principles.md +27 -2
  129. package/docs/features.md +2 -2
  130. package/docs/invariants/git-guard-host.md +7 -3
  131. package/docs/invariants/language-config.md +15 -4
  132. package/docs/invariants/lsp-trust-exec.md +16 -2
  133. package/docs/invariants/paths-os.md +4 -2
  134. package/docs/lsp-capability-matrix.md +119 -39
  135. package/docs/merge-queue-rollout.md +1 -1
  136. package/docs/pi-lens-fixer.md +24 -17
  137. package/docs/pi-lens-merge-policy.md +20 -11
  138. package/docs/pi-lens-monitor.md +9 -0
  139. package/docs/pi-lens-orchestration.md +4 -1
  140. package/docs/pi-lens-reviewer.md +5 -5
  141. package/docs/pi-lens-subagent.md +6 -3
  142. package/docs/public-api-stability.md +18 -2
  143. package/docs/schema/pi-lens-config-v1.json +10 -0
  144. package/docs/settings.md +10 -6
  145. package/docs/word-index.md +17 -5
  146. package/package.json +5 -3
  147. package/rules/ast-grep-rules/rule-tests/no-accumulating-spread-js-test.yml +37 -0
  148. package/rules/ast-grep-rules/rule-tests/ts-redundant-filter-map-test.yml +12 -1
  149. package/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-js-test.yml +12 -0
  150. package/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-test.yml +25 -0
  151. package/rules/ast-grep-rules/rules/no-accumulating-spread-js.yml +49 -1
  152. package/rules/ast-grep-rules/rules/ts-redundant-filter-map.yml +9 -1
  153. package/rules/ast-grep-rules/rules-disabled/filter-then-map-js.yml +17 -0
  154. package/rules/ast-grep-rules/rules-disabled/filter-then-map.yml +36 -0
  155. package/rules/ast-grep-rules/self-scan-baseline.json +1 -1
  156. package/dist/chunk-46TNM7XZ.js +0 -88
  157. package/dist/chunk-72OKUXSD.js +0 -31
  158. package/dist/chunk-7GLOLOSH.js +0 -57
  159. package/dist/chunk-AKUUMGD5.js +0 -26
  160. package/dist/chunk-ASUXV767.js +0 -22
  161. package/dist/chunk-CTADOKYM.js +0 -25
  162. package/dist/chunk-JJ2RRESP.js +0 -58
  163. package/dist/chunk-LSC3VADM.js +0 -23
  164. package/dist/chunk-SHLDT3OI.js +0 -27
  165. package/dist/chunk-UF7RTZSO.js +0 -27
  166. package/dist/chunk-W4WP2ERB.js +0 -30
  167. package/dist/chunk-YES5CACN.js +0 -73
@@ -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-24BILSZW.js";
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-PR6PO3ES.js";
10
+ } from "./chunk-FHEV6T4L.js";
11
11
  import {
12
12
  hasCargoWorkspaceTable,
13
13
  readCargoWorkspaceExclude,
14
14
  readCargoWorkspaceMembers,
15
15
  readTextFileOrUndefined
16
- } from "./chunk-ZKXQKGWZ.js";
16
+ } from "./chunk-WC6WRNQT.js";
17
17
  import {
18
18
  getUserRuleRoot,
19
19
  ruleCorpusFingerprintForCycle
20
- } from "./chunk-U6VN4NVL.js";
20
+ } from "./chunk-HHR7WGCI.js";
21
21
  import {
22
22
  load,
23
23
  resolvePackagePath
24
- } from "./chunk-TIQJPRDD.js";
24
+ } from "./chunk-HKIL6DCL.js";
25
25
  import {
26
26
  extensionsForLanguage
27
- } from "./chunk-YISME6ON.js";
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-HO6LWE2E.js";
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-KDX35VXP.js";
43
+ } from "./chunk-BQG2QFVO.js";
44
44
  import {
45
45
  resolveToolCwd
46
- } from "./chunk-DPGEAHZT.js";
46
+ } from "./chunk-IYVYZQRL.js";
47
47
  import {
48
48
  commandSearchReachesProject,
49
49
  findGlobalBinary,
50
50
  isProjectLocalBinPath
51
- } from "./chunk-NA7SEXHE.js";
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-KW5JQPO5.js";
58
+ } from "./chunk-JZRP4DGP.js";
59
59
  import {
60
60
  readDirEntriesSafeAsync
61
- } from "./chunk-ZGSJDWQU.js";
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-YVHBNSME.js";
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-RZOXUSPC.js";
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-KPPJTH44.js";
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-J6JP25XU.js";
117
+ } from "./chunk-SQC7K3SP.js";
116
118
  import {
117
119
  getProjectTrustGeneration,
118
120
  getProjectTrustState
119
- } from "./chunk-U5HPROLA.js";
121
+ } from "./chunk-JE6HKLC7.js";
120
122
  import {
121
123
  getDegradationLedgerGeneration,
122
124
  incrementDegradationCount,
123
125
  recordDegradationOnce
124
- } from "./chunk-WME2OQST.js";
126
+ } from "./chunk-2453RRJ2.js";
125
127
  import {
126
128
  logExtension
127
- } from "./chunk-KXF5R4UN.js";
129
+ } from "./chunk-WQV6BI4Q.js";
128
130
  import {
129
131
  claimPhaseOncePerSession,
130
132
  currentSessionRecordId,
131
133
  logLatency,
132
134
  releasePhaseClaim
133
- } from "./chunk-Z2XAOKHK.js";
135
+ } from "./chunk-565VRUP4.js";
134
136
  import {
135
137
  getGlobalPiLensLogDir,
136
138
  getProcessSingleton,
137
139
  isTestMode,
138
140
  redactSecrets
139
- } from "./chunk-VSFLRN5Y.js";
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
- } from "./chunk-PQJFG24Z.js";
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
- let dir = nodePath.dirname(nodePath.resolve(filePath));
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 hasProjectMarker(filesystemRoot) ? filesystemRoot : void 0;
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";
@@ -1397,7 +1433,21 @@ function lspConfigOf(value, problems, provenance) {
1397
1433
  }
1398
1434
  return config;
1399
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
+ }
1400
1449
  function createCustomServer(config, id) {
1450
+ const commandToken = typeof config.command === "string" ? config.command : Array.isArray(config.command) ? config.command[0] : void 0;
1401
1451
  return {
1402
1452
  id,
1403
1453
  name: config.name,
@@ -1405,7 +1455,7 @@ function createCustomServer(config, id) {
1405
1455
  // The own-command token the runner-coverage seam gates this row's
1406
1456
  // covers claim on (#3968 F2): the declared covering lane's binary must
1407
1457
  // be probeable before the claim can defer a CLI runner.
1408
- command: config.command,
1458
+ ...commandToken === void 0 ? {} : { command: commandToken },
1409
1459
  extensions: config.extensions,
1410
1460
  // A config-declared server is a language server. The public
1411
1461
  // `lsp.servers.<id>.role` field is validated and projected by
@@ -1426,7 +1476,8 @@ function createCustomServer(config, id) {
1426
1476
  ...config.rootMarkers ? { rootMarkers: config.rootMarkers } : {}
1427
1477
  }).cwd : async (file) => resolveToolCwd("lsp", id, file, { cwd: process.cwd() }).cwd,
1428
1478
  async spawn(root) {
1429
- const proc = await launchLSP(config.command, config.args ?? ["--stdio"], {
1479
+ const { program, argv } = customServerLaunch(config, id);
1480
+ const proc = await launchLSP(program, argv, {
1430
1481
  cwd: root,
1431
1482
  env: config.env ? { ...process.env, ...config.env } : process.env
1432
1483
  });
@@ -2818,8 +2869,12 @@ function isSameOrWithin(ancestor, candidate, deps = {}) {
2818
2869
  caseInsensitive = posixFilesystemIsCaseInsensitive(resolvedAncestor);
2819
2870
  }
2820
2871
  }
2821
- const relative2 = pathApi.relative(caseInsensitive ? resolvedAncestor.toLowerCase() : resolvedAncestor, caseInsensitive ? resolvedCandidate.toLowerCase() : resolvedCandidate);
2822
- return relative2 === "" || !relative2.startsWith("..") && !pathApi.isAbsolute(relative2);
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));
2823
2878
  }
2824
2879
  function enforceLspRootCeiling(root, sessionCwd, filePath) {
2825
2880
  const windowsShaped = isWindowsPath(root) || isWindowsPath(sessionCwd);
@@ -2863,11 +2918,9 @@ function hasAtomicStageSegment(dir) {
2863
2918
  return pathSegments(dir).some((segment) => STAGE_TMP_PATTERN.test(segment));
2864
2919
  }
2865
2920
  async function findGitBoundary(dir, memo) {
2866
- let current = path7.resolve(dir);
2867
- const fsRoot = path7.parse(current).root;
2868
2921
  const visited = [];
2869
2922
  let found;
2870
- while (true) {
2923
+ for (const current of walkUpDirs(dir, { spelling: true })) {
2871
2924
  const key = normalizeMapKey(current);
2872
2925
  if (memo?.has(key)) {
2873
2926
  found = memo.get(key);
@@ -2878,9 +2931,6 @@ async function findGitBoundary(dir, memo) {
2878
2931
  found = current;
2879
2932
  break;
2880
2933
  }
2881
- if (current === fsRoot)
2882
- break;
2883
- current = path7.dirname(current);
2884
2934
  }
2885
2935
  for (const seen of visited)
2886
2936
  memo?.set(seen, found);
@@ -2898,12 +2948,11 @@ async function isExcludedLspRoot(dir, gitBoundaries) {
2898
2948
  return isPathIgnoredByProject(candidate, gitRoot, true);
2899
2949
  }
2900
2950
  async function nearestNonExcludedFallbackRoot(candidate, stopDir) {
2901
- let current = path7.resolve(candidate);
2902
- const startDir = current;
2903
- const fsRoot = path7.parse(current).root;
2951
+ const startDir = path7.resolve(candidate);
2952
+ const fsRoot = path7.parse(startDir).root;
2904
2953
  let nearestAllowed;
2905
2954
  const gitBoundaries = /* @__PURE__ */ new Map();
2906
- while (true) {
2955
+ for (const current of walkUpDirs(startDir, { spelling: true })) {
2907
2956
  if (!await isExcludedLspRoot(current, gitBoundaries)) {
2908
2957
  nearestAllowed ??= current;
2909
2958
  for (const marker of FALLBACK_PROJECT_MARKERS) {
@@ -2911,9 +2960,8 @@ async function nearestNonExcludedFallbackRoot(candidate, stopDir) {
2911
2960
  return current;
2912
2961
  }
2913
2962
  }
2914
- if (current === fsRoot || normalizeEphemeralMapKey(current) === stopDir)
2963
+ if (normalizeEphemeralMapKey(current) === stopDir)
2915
2964
  break;
2916
- current = path7.dirname(current);
2917
2965
  }
2918
2966
  if (stopDir !== void 0)
2919
2967
  return nearestAllowed ?? startDir;
@@ -3554,7 +3602,7 @@ async function markerExists(dir, pattern) {
3554
3602
  return false;
3555
3603
  }
3556
3604
  }
3557
- const normalized = pattern.replace(/\\/g, "/");
3605
+ const normalized = toPosix(pattern);
3558
3606
  const slash = normalized.lastIndexOf("/");
3559
3607
  const basenamePattern = slash >= 0 ? normalized.slice(slash + 1) : normalized;
3560
3608
  if (!basenamePattern)
@@ -3597,10 +3645,9 @@ function NearestRoot(includePatterns, excludePatterns, stopDir) {
3597
3645
  const probedDirs = [];
3598
3646
  const walkedAt = Date.now();
3599
3647
  const promise = (async () => {
3600
- let currentDir = startDir;
3601
- const fsRoot = path7.parse(currentDir).root;
3648
+ const fsRoot = path7.parse(startDir).root;
3602
3649
  const stop = stopDir ? realpathOrResolve(stopDir) : fsRoot;
3603
- while (true) {
3650
+ for (const currentDir of walkUpDirs(startDir)) {
3604
3651
  if (stop !== fsRoot && currentDir.startsWith(stop + path7.sep) === false && currentDir !== stop) {
3605
3652
  break;
3606
3653
  }
@@ -3618,10 +3665,8 @@ function NearestRoot(includePatterns, excludePatterns, stopDir) {
3618
3665
  break;
3619
3666
  }
3620
3667
  }
3621
- if (excluded) {
3622
- currentDir = path7.dirname(currentDir);
3668
+ if (excluded)
3623
3669
  continue;
3624
- }
3625
3670
  }
3626
3671
  for (const pattern of includePatterns) {
3627
3672
  if (await markerExists(currentDir, pattern) && (pattern !== ".git" || currentDir !== realpathOrResolve(os7.tmpdir())) && !await isExcludedLspRoot(currentDir)) {
@@ -3631,7 +3676,6 @@ function NearestRoot(includePatterns, excludePatterns, stopDir) {
3631
3676
  if (currentDir === stop || currentDir === fsRoot) {
3632
3677
  break;
3633
3678
  }
3634
- currentDir = path7.dirname(currentDir);
3635
3679
  }
3636
3680
  return void 0;
3637
3681
  })();
@@ -3673,9 +3717,10 @@ async function findAncestorFile(startDir, ...relativeSegments) {
3673
3717
  }
3674
3718
  async function findAncestorFileAmong(startDir, candidateSegmentLists) {
3675
3719
  const fs6 = await import("node:fs/promises");
3676
- let currentDir = path7.resolve(startDir);
3677
3720
  const home = realpathOrResolve(os7.homedir());
3678
- while (!isAtOrAboveHomeDir(realpathOrResolve(currentDir), home)) {
3721
+ for (const currentDir of walkUpDirs(startDir, { spelling: true })) {
3722
+ if (isAtOrAboveHomeDir(realpathOrResolve(currentDir), home))
3723
+ break;
3679
3724
  for (const segments of candidateSegmentLists) {
3680
3725
  const candidate = path7.join(currentDir, ...segments);
3681
3726
  try {
@@ -3684,10 +3729,6 @@ async function findAncestorFileAmong(startDir, candidateSegmentLists) {
3684
3729
  } catch {
3685
3730
  }
3686
3731
  }
3687
- const parent = path7.dirname(currentDir);
3688
- if (parent === currentDir)
3689
- break;
3690
- currentDir = parent;
3691
3732
  }
3692
3733
  return void 0;
3693
3734
  }
@@ -3812,9 +3853,10 @@ async function findTsserverPath(root, allowInstall, options) {
3812
3853
  return tsserverForTsc(repairedTsc);
3813
3854
  }
3814
3855
  async function findNativeTypeScriptLsp(root) {
3815
- let currentDir = path7.resolve(root);
3816
3856
  const home = realpathOrResolve(os7.homedir());
3817
- while (!isAtOrAboveHomeDir(realpathOrResolve(currentDir), home)) {
3857
+ for (const currentDir of walkUpDirs(root, { spelling: true })) {
3858
+ if (isAtOrAboveHomeDir(realpathOrResolve(currentDir), home))
3859
+ break;
3818
3860
  const typescriptDir = path7.join(currentDir, "node_modules", "typescript");
3819
3861
  const packageJsonPath = path7.join(typescriptDir, "package.json");
3820
3862
  let packageJsonText;
@@ -3830,10 +3872,6 @@ async function findNativeTypeScriptLsp(root) {
3830
3872
  return void 0;
3831
3873
  } catch {
3832
3874
  }
3833
- const parent = path7.dirname(currentDir);
3834
- if (parent === currentDir)
3835
- return void 0;
3836
- currentDir = parent;
3837
3875
  continue;
3838
3876
  }
3839
3877
  let version;
@@ -3978,9 +4016,9 @@ async function findExtensionBoundedRoot(file, extensionRootKey) {
3978
4016
  const identity = realpathOrResolve(file);
3979
4017
  const insideBoundary = isUnderDir(identity, extensionRootKey);
3980
4018
  const boundaryKey = insideBoundary ? normalizeEphemeralMapKey(realpathOrResolve(extensionRootKey)) : extensionRootKey;
3981
- let currentDir = path7.dirname(insideBoundary ? identity : path7.resolve(file));
4019
+ const start = path7.dirname(insideBoundary ? identity : path7.resolve(file));
3982
4020
  const configMarkers = tsConfigMarkersForFile(file);
3983
- while (true) {
4021
+ for (const currentDir of walkUpDirs(start, { spelling: true })) {
3984
4022
  for (const pattern of configMarkers) {
3985
4023
  try {
3986
4024
  await stat(path7.join(currentDir, pattern));
@@ -3998,11 +4036,8 @@ async function findExtensionBoundedRoot(file, extensionRootKey) {
3998
4036
  const currentKey = normalizeEphemeralMapKey(path7.resolve(currentDir));
3999
4037
  if (currentKey === boundaryKey)
4000
4038
  return void 0;
4001
- const parent = path7.dirname(currentDir);
4002
- if (parent === currentDir)
4003
- return void 0;
4004
- currentDir = parent;
4005
4039
  }
4040
+ return void 0;
4006
4041
  }
4007
4042
  async function hasAgentLevelProjectMarker(extensionRootKey) {
4008
4043
  const agentDir = path7.dirname(extensionRootKey);
@@ -4325,8 +4360,8 @@ var GoServer = {
4325
4360
  }
4326
4361
  };
4327
4362
  function cargoWorkspaceDeclaresMember(workspaceContent, parentDir, childDir) {
4328
- const relativePath = path7.relative(parentDir, childDir).split(path7.sep).join("/");
4329
- if (relativePath === "" || relativePath.startsWith(".."))
4363
+ const relativePath = toProjectRelativePath(childDir, parentDir);
4364
+ if (isAbsoluteFilePath(relativePath))
4330
4365
  return false;
4331
4366
  const matches = (pattern) => matchesWorkspaceMemberPattern(pattern, relativePath, CARGO_WORKSPACE_MEMBER_DIALECT, () => recordDegradationOnce({
4332
4367
  kind: "workspace-glob-cap",
@@ -4349,9 +4384,8 @@ function RustWorkspaceRoot() {
4349
4384
  return void 0;
4350
4385
  const sessionCwd = process.cwd();
4351
4386
  const stop = sessionHoistCeiling(sessionCwd, file);
4352
- let current = root;
4353
- const fsRoot = path7.parse(current).root;
4354
- while (true) {
4387
+ const fsRoot = path7.parse(root).root;
4388
+ for (const current of walkUpDirs(root, { spelling: true })) {
4355
4389
  if (stop !== void 0 && current === stop)
4356
4390
  break;
4357
4391
  const parent = path7.dirname(current);
@@ -4365,7 +4399,6 @@ function RustWorkspaceRoot() {
4365
4399
  }
4366
4400
  break;
4367
4401
  }
4368
- current = parent;
4369
4402
  }
4370
4403
  return root;
4371
4404
  }, crateRoot.rootMarkers ?? []);
@@ -4409,24 +4442,20 @@ function JavaWorkspaceRoot() {
4409
4442
  return root;
4410
4443
  const sessionCwd = process.cwd();
4411
4444
  const stop = sessionHoistCeiling(sessionCwd, file);
4412
- let current = root;
4413
4445
  let lastHop = root;
4414
- const fsRoot = path7.parse(current).root;
4415
- while (true) {
4446
+ const fsRoot = path7.parse(root).root;
4447
+ for (const current of walkUpDirs(root, { spelling: true })) {
4416
4448
  if (stop !== void 0 && current === stop)
4417
4449
  break;
4418
4450
  const parent = path7.dirname(current);
4419
4451
  if (parent === current || parent === fsRoot)
4420
4452
  break;
4421
- if (await markerExists(parent, "pom.xml")) {
4422
- const parentPom = path7.join(parent, "pom.xml");
4423
- if (!await declaresMavenModule(parent, parentPom, lastHop))
4424
- break;
4425
- current = parent;
4426
- lastHop = parent;
4453
+ if (!await markerExists(parent, "pom.xml"))
4427
4454
  continue;
4428
- }
4429
- current = parent;
4455
+ const parentPom = path7.join(parent, "pom.xml");
4456
+ if (!await declaresMavenModule(parent, parentPom, lastHop))
4457
+ break;
4458
+ lastHop = parent;
4430
4459
  }
4431
4460
  return enforceLspRootCeiling(lastHop, sessionCwd, file);
4432
4461
  }, moduleRoot.rootMarkers ?? []);
@@ -5661,11 +5690,14 @@ export {
5661
5690
  getAstGrepRuleSources,
5662
5691
  getAstGrepRuleFingerprint,
5663
5692
  registerRunnerId,
5693
+ runnerIdentityPopulated,
5694
+ isKnownRunnerId,
5664
5695
  withLspProjectCodePermission,
5665
5696
  refuseUntrustedLspExecution,
5666
5697
  resolveAnalysisRootPath,
5667
5698
  resolveAnalysisRoot,
5668
5699
  canWriteAnalysisRoot,
5700
+ resolveSessionConfigRoot,
5669
5701
  BUILTIN_SERVER_RUNNER_COVERS,
5670
5702
  isAuxiliary,
5671
5703
  serverTraits,
@@ -1,8 +1,8 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  calcCyclomaticComplexity
4
- } from "./chunk-3YY7IXIL.js";
5
- import "./chunk-WDBICWH3.js";
4
+ } from "./chunk-6YUNI7B5.js";
5
+ import "./chunk-7TNILKGY.js";
6
6
  import "./chunk-5W3R6LFT.js";
7
7
  import {
8
8
  firstChildOfType,
@@ -11,27 +11,27 @@ import {
11
11
  resolveTreeSitterLanguage,
12
12
  walk,
13
13
  withTreeSitterRoot
14
- } from "./chunk-L5JYIU47.js";
14
+ } from "./chunk-BHWW6FAX.js";
15
15
  import "./chunk-Z54ZSOBZ.js";
16
- import "./chunk-U6VN4NVL.js";
17
- import "./chunk-TIQJPRDD.js";
18
- import "./chunk-YISME6ON.js";
19
- import "./chunk-HO6LWE2E.js";
20
- import "./chunk-KW5JQPO5.js";
21
- import "./chunk-YVHBNSME.js";
22
- import "./chunk-RZOXUSPC.js";
23
- import "./chunk-KPPJTH44.js";
24
- import "./chunk-J6JP25XU.js";
25
- import "./chunk-U5HPROLA.js";
26
- import "./chunk-WME2OQST.js";
16
+ import "./chunk-HHR7WGCI.js";
17
+ import "./chunk-HKIL6DCL.js";
18
+ import "./chunk-PPKECBPP.js";
19
+ import "./chunk-JYLOYTZD.js";
20
+ import "./chunk-JZRP4DGP.js";
21
+ import "./chunk-WMDUT4KH.js";
22
+ import "./chunk-G5GV2Q7K.js";
23
+ import "./chunk-X35S7HSB.js";
24
+ import "./chunk-SQC7K3SP.js";
25
+ import "./chunk-JE6HKLC7.js";
26
+ import "./chunk-2453RRJ2.js";
27
27
  import {
28
28
  createSubsystemLogger
29
- } from "./chunk-KXF5R4UN.js";
29
+ } from "./chunk-WQV6BI4Q.js";
30
30
  import "./chunk-S26LC76R.js";
31
- import "./chunk-Z2XAOKHK.js";
32
- import "./chunk-VSFLRN5Y.js";
31
+ import "./chunk-565VRUP4.js";
32
+ import "./chunk-VLQ7UKZH.js";
33
33
  import "./chunk-LJDODBBZ.js";
34
- import "./chunk-PQJFG24Z.js";
34
+ import "./chunk-GMROJJRN.js";
35
35
  import "./chunk-NXL4FFQQ.js";
36
36
 
37
37
  // dist/clients/complexity-client.js
@@ -2,16 +2,16 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  getToolCommandSpec,
4
4
  shouldAutoInstallTool
5
- } from "./chunk-MB6PXBUA.js";
5
+ } from "./chunk-5F3XF3SX.js";
6
6
  import {
7
7
  BUILTIN_SERVER_RUNNER_COVERS,
8
8
  getServersForFileWithConfig,
9
9
  isAuxiliary,
10
10
  resolveAnalysisRootPath
11
- } from "./chunk-R5MOQM2H.js";
11
+ } from "./chunk-XYLC35E4.js";
12
12
  import {
13
13
  emitBounded
14
- } from "./chunk-PR6PO3ES.js";
14
+ } from "./chunk-FHEV6T4L.js";
15
15
  import {
16
16
  ensureTool,
17
17
  findManagedToolBinary,
@@ -21,20 +21,20 @@ import {
21
21
  isSpawnableCommand,
22
22
  logSessionStart,
23
23
  resetPathWalkMemo
24
- } from "./chunk-KDX35VXP.js";
24
+ } from "./chunk-BQG2QFVO.js";
25
25
  import {
26
26
  resolveToolCwd
27
- } from "./chunk-DPGEAHZT.js";
27
+ } from "./chunk-IYVYZQRL.js";
28
28
  import {
29
29
  findGlobalBinary,
30
30
  findLocalBinAt,
31
31
  findLocalBinUpwards,
32
32
  localBinPath
33
- } from "./chunk-NA7SEXHE.js";
33
+ } from "./chunk-VOP4PJKA.js";
34
34
  import {
35
35
  createAvailabilityProbeFlight,
36
36
  probeToolAsync
37
- } from "./chunk-3F6BMY53.js";
37
+ } from "./chunk-JBP7KESM.js";
38
38
  import {
39
39
  classifyProbeFailure,
40
40
  createAvailabilityLatch,
@@ -44,7 +44,7 @@ import {
44
44
  logAvailabilityDecision,
45
45
  startHostStallSampler,
46
46
  transientRetryDelayMs
47
- } from "./chunk-KW5JQPO5.js";
47
+ } from "./chunk-JZRP4DGP.js";
48
48
  import {
49
49
  VENDOR_BIN_DIRS,
50
50
  VENV_BIN_DIRS,
@@ -53,22 +53,22 @@ import {
53
53
  isInSpawnTimeoutCooldown,
54
54
  resolveWindowsCommandForEnvironment,
55
55
  safeSpawnAsync
56
- } from "./chunk-YVHBNSME.js";
56
+ } from "./chunk-WMDUT4KH.js";
57
57
  import {
58
58
  PathKeyedMap
59
- } from "./chunk-KPPJTH44.js";
59
+ } from "./chunk-X35S7HSB.js";
60
60
  import {
61
61
  getProjectTrustState
62
- } from "./chunk-U5HPROLA.js";
62
+ } from "./chunk-JE6HKLC7.js";
63
63
  import {
64
64
  compareOrdinal,
65
65
  incrementDegradationCount
66
- } from "./chunk-WME2OQST.js";
66
+ } from "./chunk-2453RRJ2.js";
67
67
  import {
68
68
  isUnderDir,
69
69
  normalizeEphemeralMapKey,
70
70
  normalizeMapKey
71
- } from "./chunk-PQJFG24Z.js";
71
+ } from "./chunk-GMROJJRN.js";
72
72
 
73
73
  // dist/clients/dispatch/runners/utils/runner-helpers.js
74
74
  import * as fs from "node:fs";