@herbertgao/pi-extensions 2026.11.13 → 2026.11.15

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 (198) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +7 -7
  3. package/THIRD_PARTY_NOTICES.md +1 -1
  4. package/node_modules/@herbertgao/pi-cc-extensions/CHANGELOG.md +6 -0
  5. package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +3 -2
  6. package/node_modules/@herbertgao/pi-cc-extensions/README.md +3 -2
  7. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +5 -0
  8. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +9 -0
  9. package/node_modules/@herbertgao/pi-cc-extensions/extensions/index.ts +32 -2
  10. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/markdown-enhance.ts +26 -21
  11. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/table-copy.ts +753 -0
  12. package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/fullscreen-detect.ts +11 -0
  13. package/node_modules/@herbertgao/pi-cc-extensions/package.json +4 -4
  14. package/node_modules/@herbertgao/pi-inline-skill-commands/README.md +6 -2
  15. package/node_modules/@herbertgao/pi-inline-skill-commands/package.json +1 -1
  16. package/node_modules/@herbertgao/pi-inline-skill-commands/src/index.ts +41 -15
  17. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +16 -0
  18. package/node_modules/@herbertgao/pi-subagents/README.md +54 -22
  19. package/node_modules/@herbertgao/pi-subagents/docs/workflows.md +114 -35
  20. package/node_modules/@herbertgao/pi-subagents/package.json +9 -4
  21. package/node_modules/@herbertgao/pi-subagents/skills/workflow-authoring/SKILL.md +147 -0
  22. package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +48 -32
  23. package/node_modules/@herbertgao/pi-subagents/src/agent-runner.ts +34 -13
  24. package/node_modules/@herbertgao/pi-subagents/src/agent-types.ts +88 -0
  25. package/node_modules/@herbertgao/pi-subagents/src/custom-agents.ts +16 -6
  26. package/node_modules/@herbertgao/pi-subagents/src/index.ts +114 -98
  27. package/node_modules/@herbertgao/pi-subagents/src/mention-clone.ts +6 -2
  28. package/node_modules/@herbertgao/pi-subagents/src/mention.ts +5 -7
  29. package/node_modules/@herbertgao/pi-subagents/src/nested-tools.ts +18 -2
  30. package/node_modules/@herbertgao/pi-subagents/src/prompts.ts +25 -3
  31. package/node_modules/@herbertgao/pi-subagents/src/settings.ts +26 -0
  32. package/node_modules/@herbertgao/pi-subagents/src/structured-output.ts +13 -5
  33. package/node_modules/@herbertgao/pi-subagents/src/ui/fleet-list.ts +55 -8
  34. package/node_modules/@herbertgao/pi-subagents/src/ui/workflow-card-redraw.ts +86 -0
  35. package/node_modules/@herbertgao/pi-subagents/src/ui/workflow-card.ts +5 -5
  36. package/node_modules/@herbertgao/pi-subagents/src/ui/workflow-dialog.ts +478 -115
  37. package/node_modules/@herbertgao/pi-subagents/src/ui/workflow-menu.ts +77 -6
  38. package/node_modules/@herbertgao/pi-subagents/src/workflow/agent-detail.ts +148 -0
  39. package/node_modules/@herbertgao/pi-subagents/src/workflow/host.ts +88 -14
  40. package/node_modules/@herbertgao/pi-subagents/src/workflow/journal.ts +8 -0
  41. package/node_modules/@herbertgao/pi-subagents/src/workflow/json-schema.ts +507 -57
  42. package/node_modules/@herbertgao/pi-subagents/src/workflow/progress.ts +41 -11
  43. package/node_modules/@herbertgao/pi-subagents/src/workflow/runtime.ts +106 -34
  44. package/node_modules/@herbertgao/pi-subagents/src/workflow/task.ts +43 -5
  45. package/node_modules/@herbertgao/pi-subagents/src/workflow/tool-description.ts +93 -153
  46. package/node_modules/@herbertgao/pi-subagents/src/workflow/worker-source.ts +283 -71
  47. package/node_modules/@pi-plugins/fast-mode/dist/index.mjs +288 -177
  48. package/node_modules/@pi-plugins/fast-mode/dist/index.mjs.map +1 -1
  49. package/node_modules/@pi-plugins/fast-mode/package.json +7 -7
  50. package/node_modules/pi-commandcode-provider/CHANGELOG.md +20 -0
  51. package/node_modules/pi-commandcode-provider/README.md +1 -1
  52. package/node_modules/pi-commandcode-provider/index.ts +2 -1
  53. package/node_modules/pi-commandcode-provider/package.json +1 -1
  54. package/node_modules/pi-commandcode-provider/src/commandcode-catalog.ts +9 -2
  55. package/node_modules/pi-commandcode-provider/src/pricing.ts +5 -1
  56. package/node_modules/pi-commandcode-provider/src/responses-compat.ts +24 -1
  57. package/node_modules/pi-commandcode-provider/src/responses-stream.ts +99 -6
  58. package/node_modules/pi-lens/CHANGELOG-USER.md +6 -6
  59. package/node_modules/pi-lens/CHANGELOG.md +132 -0
  60. package/node_modules/pi-lens/README.md +2 -0
  61. package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +1 -0
  62. package/node_modules/pi-lens/dist/{chunk-LGH2HHZG.js → chunk-25CAONWT.js} +36 -25
  63. package/node_modules/pi-lens/dist/{chunk-ZQSSO7LO.js → chunk-2DWNYVUN.js} +3 -3
  64. package/node_modules/pi-lens/dist/{chunk-YCR6ZYTE.js → chunk-2RQREVGO.js} +1 -1
  65. package/node_modules/pi-lens/dist/{chunk-VWEBZ2JV.js → chunk-2XALJI2K.js} +40 -40
  66. package/node_modules/pi-lens/dist/{chunk-PQXUZYTQ.js → chunk-2YQ5LI7R.js} +4 -4
  67. package/node_modules/pi-lens/dist/{chunk-VSQT6IHZ.js → chunk-35UJUF27.js} +18 -4
  68. package/node_modules/pi-lens/dist/{chunk-OLWGYBYT.js → chunk-3IWMNN2S.js} +17 -17
  69. package/node_modules/pi-lens/dist/chunk-3UTDLQWO.js +88 -0
  70. package/node_modules/pi-lens/dist/chunk-3Z7Z3B7V.js +27 -0
  71. package/node_modules/pi-lens/dist/{chunk-UNP6Y4JV.js → chunk-4E4OCW3L.js} +16 -16
  72. package/node_modules/pi-lens/dist/{chunk-37IDWT6O.js → chunk-4GLSO2EM.js} +13 -11
  73. package/node_modules/pi-lens/dist/{chunk-QV3JPCMK.js → chunk-5HVDD7IA.js} +1 -1
  74. package/node_modules/pi-lens/dist/{chunk-ZRQMENT4.js → chunk-62PIU4TO.js} +1 -1
  75. package/node_modules/pi-lens/dist/{chunk-3TSMQZG6.js → chunk-6MDWNZ7E.js} +2 -2
  76. package/node_modules/pi-lens/dist/{chunk-WLD6BGON.js → chunk-6MWX2J5H.js} +4 -0
  77. package/node_modules/pi-lens/dist/{chunk-SCU62JLX.js → chunk-6MZLS6CK.js} +7 -7
  78. package/node_modules/pi-lens/dist/{chunk-B42AIWPJ.js → chunk-7BWPQZHE.js} +3 -3
  79. package/node_modules/pi-lens/dist/{chunk-I3NZVAMN.js → chunk-7JMEPY6P.js} +10 -10
  80. package/node_modules/pi-lens/dist/{chunk-7DPXUPRF.js → chunk-7ORBRDFY.js} +2 -2
  81. package/node_modules/pi-lens/dist/{chunk-6E5QLMWI.js → chunk-7WAQ3K26.js} +23 -23
  82. package/node_modules/pi-lens/dist/{chunk-2H5GHZKC.js → chunk-AB26NAHA.js} +7 -7
  83. package/node_modules/pi-lens/dist/{chunk-BBSDJTOV.js → chunk-AFSG6YUB.js} +13 -13
  84. package/node_modules/pi-lens/dist/{chunk-XDNWR7SG.js → chunk-ALTHJUZO.js} +2 -2
  85. package/node_modules/pi-lens/dist/{chunk-UN72ZAJ5.js → chunk-AOEVZXR6.js} +9 -9
  86. package/node_modules/pi-lens/dist/{chunk-HRLF35WL.js → chunk-ARTCVE6I.js} +9 -9
  87. package/node_modules/pi-lens/dist/{chunk-LQQNFCQJ.js → chunk-B2QO7GHY.js} +1 -1
  88. package/node_modules/pi-lens/dist/{chunk-I2FYOZNW.js → chunk-BJGWP4UX.js} +10 -10
  89. package/node_modules/pi-lens/dist/{chunk-G53LBDNU.js → chunk-BKJ6WZKP.js} +6 -6
  90. package/node_modules/pi-lens/dist/{chunk-P5MSLVUW.js → chunk-BQ72NQQM.js} +11 -11
  91. package/node_modules/pi-lens/dist/{chunk-K7O6AHSJ.js → chunk-BWGNVM33.js} +11 -11
  92. package/node_modules/pi-lens/dist/{chunk-ADYQRETD.js → chunk-BYIEU4E4.js} +2 -2
  93. package/node_modules/pi-lens/dist/{chunk-7ZVTFLCC.js → chunk-CDAJQBKJ.js} +11 -11
  94. package/node_modules/pi-lens/dist/{chunk-BKWFDWYM.js → chunk-D3UQWOCB.js} +16 -16
  95. package/node_modules/pi-lens/dist/{chunk-3PAS2ERX.js → chunk-DHFJS2I4.js} +8 -8
  96. package/node_modules/pi-lens/dist/{chunk-KNSOA43J.js → chunk-DKXIUGNA.js} +2 -2
  97. package/node_modules/pi-lens/dist/{chunk-LOEJFTF2.js → chunk-DLGJYQML.js} +2 -2
  98. package/node_modules/pi-lens/dist/{chunk-VGRGW4UL.js → chunk-DNJJVKJZ.js} +31 -31
  99. package/node_modules/pi-lens/dist/{chunk-5HBQL7DH.js → chunk-EBXCYEII.js} +3 -3
  100. package/node_modules/pi-lens/dist/chunk-EH6EHFW2.js +73 -0
  101. package/node_modules/pi-lens/dist/{chunk-W26QZ3OM.js → chunk-EKQDQPX6.js} +10 -10
  102. package/node_modules/pi-lens/dist/{chunk-TWEOJE3D.js → chunk-EXHSWN3P.js} +844 -377
  103. package/node_modules/pi-lens/dist/{chunk-4IZZEN63.js → chunk-F7BFIENK.js} +33 -33
  104. package/node_modules/pi-lens/dist/{chunk-ZI7YHV6I.js → chunk-FD4LJQ6Y.js} +5 -5
  105. package/node_modules/pi-lens/dist/{chunk-RIH3UBK4.js → chunk-GFCPPCNR.js} +11 -11
  106. package/node_modules/pi-lens/dist/{chunk-5JB4WENL.js → chunk-GIK6VUCY.js} +1 -1
  107. package/node_modules/pi-lens/dist/{chunk-PPQHMSPH.js → chunk-GNK2IHVG.js} +15 -15
  108. package/node_modules/pi-lens/dist/{chunk-CXQYK4YT.js → chunk-H6DNTQ4V.js} +2 -2
  109. package/node_modules/pi-lens/dist/{chunk-NGNBJIUO.js → chunk-HERQPNY6.js} +8 -8
  110. package/node_modules/pi-lens/dist/{chunk-INBK3HIT.js → chunk-HFIFEH46.js} +3 -3
  111. package/node_modules/pi-lens/dist/{chunk-J2ZB5MDS.js → chunk-HKRESBMC.js} +20 -20
  112. package/node_modules/pi-lens/dist/{chunk-AZG5UJYY.js → chunk-HMXWZUQW.js} +1 -1
  113. package/node_modules/pi-lens/dist/{chunk-XSC3BCN3.js → chunk-HOWHAKXO.js} +6 -6
  114. package/node_modules/pi-lens/dist/{chunk-7CLWC2UH.js → chunk-HUWW77QY.js} +1 -1
  115. package/node_modules/pi-lens/dist/{chunk-KZ732ZVW.js → chunk-IO6P3NBP.js} +1 -1
  116. package/node_modules/pi-lens/dist/{chunk-7WKVCZI4.js → chunk-J7VNGHLN.js} +2 -2
  117. package/node_modules/pi-lens/dist/{chunk-QE7BJQ6K.js → chunk-JGCBMCCS.js} +8 -8
  118. package/node_modules/pi-lens/dist/{chunk-PFJLYRO3.js → chunk-KIQSNH3F.js} +34 -34
  119. package/node_modules/pi-lens/dist/{chunk-JGUDT5KD.js → chunk-KSQJBGRO.js} +5 -5
  120. package/node_modules/pi-lens/dist/{chunk-RJ3APNIP.js → chunk-KXKM2DFP.js} +4 -4
  121. package/node_modules/pi-lens/dist/chunk-L3Q72QGQ.js +25 -0
  122. package/node_modules/pi-lens/dist/{chunk-6GLMMGCX.js → chunk-LDPY22FS.js} +2 -2
  123. package/node_modules/pi-lens/dist/{chunk-3PO4YYOX.js → chunk-M3QGXGY4.js} +3793 -3814
  124. package/node_modules/pi-lens/dist/{chunk-NNEQOC3U.js → chunk-MET776XM.js} +9 -7
  125. package/node_modules/pi-lens/dist/{chunk-X33QECRJ.js → chunk-MKQFSW2Q.js} +2 -2
  126. package/node_modules/pi-lens/dist/{chunk-7U36VQL6.js → chunk-MKW7ZUTT.js} +3 -3
  127. package/node_modules/pi-lens/dist/{chunk-PQF6YGYB.js → chunk-N2U644ZW.js} +4 -18
  128. package/node_modules/pi-lens/dist/{chunk-DI4AZZNY.js → chunk-NAACKIKT.js} +2 -2
  129. package/node_modules/pi-lens/dist/{chunk-O6LCSHHI.js → chunk-NHHS5T52.js} +1 -1
  130. package/node_modules/pi-lens/dist/{chunk-DCA2MXVQ.js → chunk-NIZKGBOU.js} +51 -27
  131. package/node_modules/pi-lens/dist/{chunk-PKWEBMCA.js → chunk-NNDZ7DOP.js} +194 -111
  132. package/node_modules/pi-lens/dist/{chunk-Q7J3JYJ2.js → chunk-NZ7NSKIW.js} +13 -13
  133. package/node_modules/pi-lens/dist/{chunk-S6MCMD27.js → chunk-OG3UCAHV.js} +3 -3
  134. package/node_modules/pi-lens/dist/{chunk-3QXFUP6T.js → chunk-OHTHVILU.js} +12 -12
  135. package/node_modules/pi-lens/dist/{chunk-NHA5K226.js → chunk-P7EV5ISR.js} +17 -2
  136. package/node_modules/pi-lens/dist/{chunk-L6BDRYUK.js → chunk-PVV27TOX.js} +5 -5
  137. package/node_modules/pi-lens/dist/{chunk-HIRBC72R.js → chunk-Q32RJDYC.js} +4 -4
  138. package/node_modules/pi-lens/dist/{chunk-QE5DJ7MX.js → chunk-Q4UQNTLB.js} +4 -4
  139. package/node_modules/pi-lens/dist/{chunk-SDYLT45T.js → chunk-QQGZY2BR.js} +2 -2
  140. package/node_modules/pi-lens/dist/{chunk-QMWKSYWB.js → chunk-S247BOH2.js} +4 -4
  141. package/node_modules/pi-lens/dist/{chunk-ARTYCUGF.js → chunk-S7KUDW73.js} +121 -18
  142. package/node_modules/pi-lens/dist/{chunk-6CFSDLHE.js → chunk-SJ2SR432.js} +17 -17
  143. package/node_modules/pi-lens/dist/{chunk-CQY2HEH7.js → chunk-SL4G67AP.js} +2 -2
  144. package/node_modules/pi-lens/dist/{chunk-LVLPA32Q.js → chunk-T2D2WWP6.js} +48 -11
  145. package/node_modules/pi-lens/dist/{chunk-HIJ4CHFF.js → chunk-T7KHGEJ5.js} +3 -3
  146. package/node_modules/pi-lens/dist/{chunk-74AMPWNC.js → chunk-TABDCX35.js} +2 -2
  147. package/node_modules/pi-lens/dist/chunk-TFSBHRL2.js +25 -0
  148. package/node_modules/pi-lens/dist/{chunk-KNJH6WJQ.js → chunk-TQKWR5AZ.js} +7 -7
  149. package/node_modules/pi-lens/dist/chunk-TWAQFMLW.js +110 -0
  150. package/node_modules/pi-lens/dist/{chunk-TKOFTLGB.js → chunk-UARVPNAU.js} +33 -33
  151. package/node_modules/pi-lens/dist/chunk-UWBD3JMH.js +56 -0
  152. package/node_modules/pi-lens/dist/{chunk-K4Z7MK6T.js → chunk-VEF3GFOL.js} +15 -15
  153. package/node_modules/pi-lens/dist/{chunk-4DAHGU3V.js → chunk-W2JPGW7Q.js} +27 -25
  154. package/node_modules/pi-lens/dist/{chunk-CZJGAOKL.js → chunk-W2YHHNY3.js} +7 -7
  155. package/node_modules/pi-lens/dist/{chunk-R4L7KZ7R.js → chunk-WA6U2URH.js} +9 -9
  156. package/node_modules/pi-lens/dist/{chunk-OZQQ3AIR.js → chunk-WAK2AXQQ.js} +9 -9
  157. package/node_modules/pi-lens/dist/{chunk-DFKOA74L.js → chunk-WH6O4IFD.js} +10 -10
  158. package/node_modules/pi-lens/dist/{chunk-27JQHK7Y.js → chunk-WJ7GY5WJ.js} +1 -1
  159. package/node_modules/pi-lens/dist/{chunk-KXGTLAUW.js → chunk-WWZLT6AM.js} +2 -2
  160. package/node_modules/pi-lens/dist/{chunk-O2MHF7QM.js → chunk-XRLZ75YY.js} +38 -38
  161. package/node_modules/pi-lens/dist/chunk-XWWFESYZ.js +27 -0
  162. package/node_modules/pi-lens/dist/chunk-XZSXSM4K.js +27 -0
  163. package/node_modules/pi-lens/dist/{chunk-C5PLBTNR.js → chunk-Y2LIOCA7.js} +1 -1
  164. package/node_modules/pi-lens/dist/{chunk-AXAR5ZW2.js → chunk-YIEHUKX2.js} +84 -169
  165. package/node_modules/pi-lens/dist/{chunk-B2OXE4AH.js → chunk-YOMLAKU6.js} +182 -180
  166. package/node_modules/pi-lens/dist/{chunk-MOAVEPC4.js → chunk-YV7XVYSJ.js} +11 -11
  167. package/node_modules/pi-lens/dist/{chunk-ZULZS2I6.js → chunk-ZVQUYCBU.js} +996 -365
  168. package/node_modules/pi-lens/dist/index.js +4911 -2376
  169. package/node_modules/pi-lens/dist/mcp/analyze-cli.js +8 -8
  170. package/node_modules/pi-lens/dist/mcp/cli.js +40 -40
  171. package/node_modules/pi-lens/dist/mcp/server.js +321 -234
  172. package/node_modules/pi-lens/dist/mcp/worker.js +58 -58
  173. package/node_modules/pi-lens/dist/probes/installer.js +21 -21
  174. package/node_modules/pi-lens/docs/ci-bot-pr-checks.md +18 -9
  175. package/node_modules/pi-lens/docs/ci.md +7 -0
  176. package/node_modules/pi-lens/docs/defect-shapes.md +43 -28
  177. package/node_modules/pi-lens/docs/globalconfig.md +1 -0
  178. package/node_modules/pi-lens/docs/invariants/dispatch-runners.md +15 -0
  179. package/node_modules/pi-lens/docs/lsp-capability-matrix.md +3 -3
  180. package/node_modules/pi-lens/docs/lsp-idle-eviction.md +3 -2
  181. package/node_modules/pi-lens/docs/module-report-read-symbol.md +6 -2
  182. package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +3 -2
  183. package/node_modules/pi-lens/docs/pi-lens-orchestration.md +2 -1
  184. package/node_modules/pi-lens/docs/pi-lens-subagent.md +2 -1
  185. package/node_modules/pi-lens/docs/servercapabilities.md +1 -1
  186. package/node_modules/pi-lens/docs/settings.md +1 -0
  187. package/node_modules/pi-lens/docs/usage.md +1 -0
  188. package/node_modules/pi-lens/package.json +1 -1
  189. package/package.json +9 -7
  190. package/node_modules/pi-lens/dist/chunk-2H7NFZ4Q.js +0 -25
  191. package/node_modules/pi-lens/dist/chunk-5YJXF2IS.js +0 -56
  192. package/node_modules/pi-lens/dist/chunk-GCSDF5IE.js +0 -27
  193. package/node_modules/pi-lens/dist/chunk-H5API74E.js +0 -67
  194. package/node_modules/pi-lens/dist/chunk-HBX55MWO.js +0 -27
  195. package/node_modules/pi-lens/dist/chunk-JOIKBUQN.js +0 -88
  196. package/node_modules/pi-lens/dist/chunk-M2YMBT5G.js +0 -73
  197. package/node_modules/pi-lens/dist/chunk-MJRGPEQ5.js +0 -25
  198. package/node_modules/pi-lens/dist/chunk-TFKN5EIR.js +0 -27
@@ -8,17 +8,17 @@ import {
8
8
  runCollectLater,
9
9
  runnerFlightKey,
10
10
  tryLazyInstall
11
- } from "./chunk-G53LBDNU.js";
11
+ } from "./chunk-BKJ6WZKP.js";
12
12
  import {
13
13
  computeImpactCascade
14
- } from "./chunk-HIJ4CHFF.js";
14
+ } from "./chunk-T7KHGEJ5.js";
15
15
  import {
16
16
  goClient
17
- } from "./chunk-7DPXUPRF.js";
17
+ } from "./chunk-7ORBRDFY.js";
18
18
  import {
19
19
  isTrivyEnabled,
20
20
  resolveSeverityFloor
21
- } from "./chunk-CZJGAOKL.js";
21
+ } from "./chunk-W2YHHNY3.js";
22
22
  import {
23
23
  faultIfCutShort,
24
24
  finishParsedRun,
@@ -28,10 +28,10 @@ import {
28
28
  skipUnlessToolRan,
29
29
  spawnFailedWithNoOutput,
30
30
  spawnTimedOut
31
- } from "./chunk-SDYLT45T.js";
31
+ } from "./chunk-QQGZY2BR.js";
32
32
  import {
33
33
  rustClient
34
- } from "./chunk-XDNWR7SG.js";
34
+ } from "./chunk-ALTHJUZO.js";
35
35
  import {
36
36
  biomeConfigArgs,
37
37
  coveringLaneAvailable,
@@ -46,9 +46,8 @@ import {
46
46
  markdownlintConfigArgs,
47
47
  optionSafeTargetArg,
48
48
  resolveAdoptedRootCommand,
49
- resolveAvailableOrInstall,
50
- resolveCommandArgsWithInstallFallback,
51
49
  resolveLocalFirstAsync,
50
+ resolveRubocopCommand,
52
51
  resolveRunnerCwd as resolveRunnerCwd2,
53
52
  resolveToolCommand,
54
53
  resolveToolCommandWithInstallFallback,
@@ -56,21 +55,21 @@ import {
56
55
  ruffConfigArgs,
57
56
  toolAbsentSkip,
58
57
  toolBinaryVerdict
59
- } from "./chunk-PKWEBMCA.js";
58
+ } from "./chunk-NNDZ7DOP.js";
60
59
  import {
61
60
  importFactProvider
62
- } from "./chunk-HIRBC72R.js";
61
+ } from "./chunk-Q32RJDYC.js";
63
62
  import {
64
63
  functionFactProvider
65
- } from "./chunk-PQXUZYTQ.js";
64
+ } from "./chunk-2YQ5LI7R.js";
66
65
  import {
67
66
  extractFactsFromTree
68
- } from "./chunk-KZ732ZVW.js";
67
+ } from "./chunk-IO6P3NBP.js";
69
68
  import {
70
69
  buildOrUpdateGraph,
71
70
  clearReviewGraphWorkspaceCache,
72
71
  fileContentProvider
73
- } from "./chunk-4DAHGU3V.js";
72
+ } from "./chunk-W2JPGW7Q.js";
74
73
  import {
75
74
  MAX_BLOCKING_RULE_COMPLEXITY,
76
75
  PRIMARY_UNAVAILABLE_CAUSE,
@@ -107,13 +106,13 @@ import {
107
106
  tryWarmAttachedCodeActions,
108
107
  tryWarmAttachedDiagnostics,
109
108
  warmAnswerBinding
110
- } from "./chunk-TWEOJE3D.js";
109
+ } from "./chunk-EXHSWN3P.js";
111
110
  import {
112
111
  ANY_POSITION,
113
112
  displayedMessage,
114
113
  hashText,
115
114
  retainRecordedFindings
116
- } from "./chunk-VSQT6IHZ.js";
115
+ } from "./chunk-35UJUF27.js";
117
116
  import {
118
117
  mapWithConcurrency
119
118
  } from "./chunk-XIMYZ3JA.js";
@@ -129,7 +128,7 @@ import {
129
128
  resolveSessionConfigRoot,
130
129
  resolveShellFileDialect,
131
130
  runnerIdentityPopulated
132
- } from "./chunk-AXAR5ZW2.js";
131
+ } from "./chunk-YIEHUKX2.js";
133
132
  import {
134
133
  augmentPythonEnvironment,
135
134
  describePythonCompileWithheld,
@@ -138,23 +137,20 @@ import {
138
137
  emitBounded,
139
138
  partitionOutrankedPythonCompileVerdicts,
140
139
  recordPythonCompileVerdictDrop
141
- } from "./chunk-2H5GHZKC.js";
140
+ } from "./chunk-AB26NAHA.js";
142
141
  import {
143
142
  scannerReportParentDir
144
- } from "./chunk-QV3JPCMK.js";
145
- import {
146
- loadProjectSnapshot
147
- } from "./chunk-NNEQOC3U.js";
143
+ } from "./chunk-5HVDD7IA.js";
148
144
  import {
149
145
  RUNTIME_CONFIG,
150
146
  exceedsLspSyncLimits,
151
147
  getRunnerTimeoutFloorMs,
152
148
  loadAstGrepNapi
153
- } from "./chunk-ARTYCUGF.js";
149
+ } from "./chunk-S7KUDW73.js";
154
150
  import {
155
151
  buildModuleGraph,
156
152
  clearModuleGraphCache
157
- } from "./chunk-JGUDT5KD.js";
153
+ } from "./chunk-KSQJBGRO.js";
158
154
  import {
159
155
  BUNDLED_QUERIES_ROOT,
160
156
  classifyTreeSitterWasmError,
@@ -174,13 +170,17 @@ import {
174
170
  ruleFilesForLanguage,
175
171
  ruleSourceLanguages,
176
172
  walk
177
- } from "./chunk-37IDWT6O.js";
173
+ } from "./chunk-4GLSO2EM.js";
178
174
  import {
175
+ js_yaml_default,
179
176
  resolvePackagePath
180
- } from "./chunk-ZQSSO7LO.js";
177
+ } from "./chunk-2DWNYVUN.js";
181
178
  import {
182
179
  stripAnsi
183
180
  } from "./chunk-6HWVI6MI.js";
181
+ import {
182
+ loadProjectSnapshot
183
+ } from "./chunk-MET776XM.js";
184
184
  import {
185
185
  WORD_INDEX_MAX_BYTES,
186
186
  deserializeWordIndex,
@@ -189,14 +189,14 @@ import {
189
189
  scheduleWordIndexPersist,
190
190
  setWordIndexPublishedListener,
191
191
  updateWordIndexDocumentForEdit
192
- } from "./chunk-P5MSLVUW.js";
192
+ } from "./chunk-BQ72NQQM.js";
193
193
  import {
194
194
  isTypeScriptFile
195
- } from "./chunk-DI4AZZNY.js";
195
+ } from "./chunk-NAACKIKT.js";
196
196
  import {
197
197
  WARM_CODE_ACTION_LOOKUP_LIMIT,
198
198
  contentHash
199
- } from "./chunk-3TSMQZG6.js";
199
+ } from "./chunk-6MDWNZ7E.js";
200
200
  import {
201
201
  IN_FLIGHT_REASON,
202
202
  NO_ANALYZER_REASON,
@@ -222,32 +222,29 @@ import {
222
222
  import {
223
223
  resolveRunnerPath,
224
224
  toRunnerDisplayPath
225
- } from "./chunk-ZRQMENT4.js";
225
+ } from "./chunk-62PIU4TO.js";
226
226
  import {
227
- findCommandOnPath,
228
227
  isSpawnableCommand
229
- } from "./chunk-B2OXE4AH.js";
228
+ } from "./chunk-YOMLAKU6.js";
230
229
  import {
230
+ configCeiling,
231
+ findCommandOnPath,
231
232
  findToolConfig,
232
233
  hasToolConfig,
233
234
  logRunnerAdvisoryOnce,
234
235
  readFileContent,
235
236
  resolveRunnerCwd,
236
237
  resolveRunnerCwdWithReason
237
- } from "./chunk-LVLPA32Q.js";
238
+ } from "./chunk-T2D2WWP6.js";
238
239
  import {
239
240
  findLocalBinUpwards,
240
241
  isLocalBinTrustRefusal,
241
242
  localBinPath
242
- } from "./chunk-LGH2HHZG.js";
243
+ } from "./chunk-25CAONWT.js";
243
244
  import {
244
245
  getIsolatedNpxSpawnOptions,
245
246
  probeToolAsync
246
- } from "./chunk-KXGTLAUW.js";
247
- import {
248
- readJsonCache,
249
- readJsonCacheAsync
250
- } from "./chunk-TQWRH25U.js";
247
+ } from "./chunk-WWZLT6AM.js";
251
248
  import {
252
249
  classifyProbeFailure,
253
250
  createAvailabilityLatch,
@@ -256,12 +253,16 @@ import {
256
253
  isLatchingOutcome,
257
254
  logAvailabilityDecision,
258
255
  startHostStallSampler
259
- } from "./chunk-6GLMMGCX.js";
256
+ } from "./chunk-LDPY22FS.js";
260
257
  import {
261
258
  getLspCapableKinds,
262
259
  getPrimaryDispatchGroup,
263
260
  resolveLanguageRootForFile
264
- } from "./chunk-XSC3BCN3.js";
261
+ } from "./chunk-HOWHAKXO.js";
262
+ import {
263
+ readJsonCache,
264
+ readJsonCacheAsync
265
+ } from "./chunk-TQWRH25U.js";
265
266
  import {
266
267
  getGlobalPiLensDir,
267
268
  getProjectDataDir,
@@ -272,13 +273,7 @@ import {
272
273
  realIsPidAlive,
273
274
  resolvePiLensFlag,
274
275
  safeSpawnAsync
275
- } from "./chunk-3PO4YYOX.js";
276
- import {
277
- DOTNET_CSHARP_PROJECT_MARKERS,
278
- DOTNET_CSHARP_SOLUTION_MARKERS,
279
- detectFileKind,
280
- isJstsFactFile
281
- } from "./chunk-CQY2HEH7.js";
276
+ } from "./chunk-M3QGXGY4.js";
282
277
  import {
283
278
  PathKeyedMap,
284
279
  boundedKeyLabel,
@@ -289,13 +284,18 @@ import {
289
284
  migrationSubject,
290
285
  reportPiLensConfigRecords,
291
286
  resolveOnePiLensConfigDocument,
292
- resolvePiLensConfig,
293
- spawnCooldownScope
294
- } from "./chunk-PQF6YGYB.js";
287
+ resolvePiLensConfig
288
+ } from "./chunk-N2U644ZW.js";
289
+ import {
290
+ DOTNET_CSHARP_PROJECT_MARKERS,
291
+ DOTNET_CSHARP_SOLUTION_MARKERS,
292
+ detectFileKind,
293
+ isJstsFactFile
294
+ } from "./chunk-SL4G67AP.js";
295
295
  import {
296
296
  findNearestDirWithMarker,
297
297
  getPiLensGlobalConfigPath
298
- } from "./chunk-LOEJFTF2.js";
298
+ } from "./chunk-DLGJYQML.js";
299
299
  import {
300
300
  getProjectTrustState,
301
301
  killedForOutputCap,
@@ -303,13 +303,14 @@ import {
303
303
  truncatedByOutputCap,
304
304
  withBudget,
305
305
  writeFileAtomic
306
- } from "./chunk-W26QZ3OM.js";
306
+ } from "./chunk-EKQDQPX6.js";
307
307
  import {
308
308
  createSubsystemLogger,
309
309
  incrementDegradationCount,
310
310
  logExtension,
311
- recordDegradationOnce
312
- } from "./chunk-NHA5K226.js";
311
+ recordDegradationOnce,
312
+ spawnCooldownScope
313
+ } from "./chunk-P7EV5ISR.js";
313
314
  import {
314
315
  createNdjsonLogger,
315
316
  getGlobalPiLensLogDir,
@@ -319,11 +320,11 @@ import {
319
320
  nonNegativeIntEnv,
320
321
  phaseFinished,
321
322
  phaseStarted
322
- } from "./chunk-7CLWC2UH.js";
323
+ } from "./chunk-HUWW77QY.js";
323
324
  import {
324
325
  FactStore,
325
326
  setFactStoreEvictionReporter
326
- } from "./chunk-O6LCSHHI.js";
327
+ } from "./chunk-NHHS5T52.js";
327
328
  import {
328
329
  BoundedFifoMap,
329
330
  BoundedLruCache,
@@ -341,11 +342,11 @@ import {
341
342
  resolveHostToolPath,
342
343
  toPosix,
343
344
  toProjectRelativePath
344
- } from "./chunk-WLD6BGON.js";
345
+ } from "./chunk-6MWX2J5H.js";
345
346
 
346
347
  // dist/clients/mcp/analyze.js
347
- import * as fs15 from "node:fs";
348
- import * as path50 from "node:path";
348
+ import * as fs16 from "node:fs";
349
+ import * as path51 from "node:path";
349
350
 
350
351
  // dist/clients/cache-manager.js
351
352
  import * as fs from "node:fs";
@@ -2289,20 +2290,38 @@ var PRE_EDIT_SEED_RUNNER_IDS = /* @__PURE__ */ new Set([
2289
2290
  "vale",
2290
2291
  "yamllint"
2291
2292
  ]);
2293
+ var PRE_EDIT_EDIT_GATED_RUNNER_IDS = /* @__PURE__ */ new Set([
2294
+ "ast-grep-napi",
2295
+ "tree-sitter"
2296
+ ]);
2297
+ var PRE_EDIT_SEED_SPANLESS_RUNNER_IDS = /* @__PURE__ */ new Set([
2298
+ ...PRE_EDIT_SEED_RUNNER_IDS,
2299
+ ...PRE_EDIT_EDIT_GATED_RUNNER_IDS
2300
+ ]);
2292
2301
  function preEditSeedFactKey(filePath) {
2293
2302
  return `session.preEdit.${filePath}`;
2294
2303
  }
2295
- function classifyPreExisting(seed, current, content, answered) {
2296
- let lines;
2304
+ function coversEveryLine(ranges, lineCount) {
2305
+ let next = 1;
2306
+ for (const r of [...ranges].sort((a, b) => a.start - b.start)) {
2307
+ if (r.start > next)
2308
+ return false;
2309
+ next = Math.max(next, r.end + 1);
2310
+ }
2311
+ return next > lineCount;
2312
+ }
2313
+ function classifyPreExisting(seed, current, content, answered, modifiedRanges) {
2314
+ const lines = content.split(/\r?\n/);
2297
2315
  const hashAt = (line) => {
2298
2316
  if (line === void 0)
2299
2317
  return void 0;
2300
- lines ??= content.split(/\r?\n/);
2301
2318
  const text = lines[line - 1];
2302
2319
  return text === void 0 ? void 0 : lineHashOf(text);
2303
2320
  };
2304
- const candidates = current.filter((d) => d.runnerId !== void 0 && PRE_EDIT_SEED_RUNNER_IDS.has(d.runnerId));
2305
- const { kept } = retainRecordedFindings(seed, candidates, {
2321
+ const spanGated = modifiedRanges !== void 0 && modifiedRanges.length > 0 && !coversEveryLine(modifiedRanges, lines.length);
2322
+ const usable = (d) => !spanGated || d.runnerId === void 0 || !PRE_EDIT_EDIT_GATED_RUNNER_IDS.has(d.runnerId);
2323
+ const candidates = current.filter((d) => d.runnerId !== void 0 && PRE_EDIT_SEED_SPANLESS_RUNNER_IDS.has(d.runnerId));
2324
+ const { kept } = retainRecordedFindings(seed.filter(usable), candidates, {
2306
2325
  positionOf: () => ANY_POSITION,
2307
2326
  keepUnobserved: (d) => d.runnerId === void 0 || !answered.has(d.runnerId),
2308
2327
  matchesAnywhere: (prior, observed2) => prior.lineHash !== void 0 && prior.lineHash === hashAt(observed2.line)
@@ -3327,7 +3346,7 @@ async function dispatchForFile(ctx, groups, registry, onRunnerResult, options) {
3327
3346
  // seed holds it before the raise can block on it.
3328
3347
  ...visibleDiagnostics.filter((d) => d.semantic === "blocking" || blocksAsClassMember(d)),
3329
3348
  ...heldBackBlockers
3330
- ], seedContent, new Set([...answeredRunnerIds].filter((id) => !inconclusiveRunnerIds.has(id))));
3349
+ ], seedContent, new Set([...answeredRunnerIds].filter((id) => !inconclusiveRunnerIds.has(id))), ctx.modifiedRanges);
3331
3350
  if (classified.preExisting.length > 0) {
3332
3351
  const held = new Set(classified.preExisting);
3333
3352
  visibleDiagnostics = visibleDiagnostics.filter((d) => !held.has(d));
@@ -3348,14 +3367,14 @@ async function dispatchForFile(ctx, groups, registry, onRunnerResult, options) {
3348
3367
  provider: ctx.telemetryProvider
3349
3368
  };
3350
3369
  if (fixedItems.length > 0) {
3351
- import("./chunk-SCU62JLX.js").then(({ appendToWorklog }) => {
3370
+ import("./chunk-6MZLS6CK.js").then(({ appendToWorklog }) => {
3352
3371
  appendToWorklog(ctx.cwd, fixedItems, true, worklogIdentity);
3353
3372
  }).catch(() => {
3354
3373
  });
3355
3374
  }
3356
3375
  const fixableWarnings = warnings.filter((d) => d.fixable);
3357
3376
  if (fixableWarnings.length > 0) {
3358
- import("./chunk-SCU62JLX.js").then(({ appendToWorklog }) => {
3377
+ import("./chunk-6MZLS6CK.js").then(({ appendToWorklog }) => {
3359
3378
  appendToWorklog(ctx.cwd, fixableWarnings, false, worklogIdentity);
3360
3379
  }).catch(() => {
3361
3380
  });
@@ -3830,6 +3849,7 @@ var DELIVERY_SURFACES = {
3830
3849
  "applyProbeFindingPolicy("
3831
3850
  ]),
3832
3851
  "git-guard:commit-blocked": labeled("clients/git-guard.ts", "Git-guard commit/push \u{1F534} COMMIT BLOCKED verdict (--lens-guard).", "Synchronous preflight rejection returned inline with the failed git command. The blocker map it reads is refreshed at decision time: the gate first judges settled collect-later runner answers through the freshness gate and the finding policy (#3814), so a stale answer cannot block.", "live"),
3852
+ "staged-delta:commit-blocked": labeled("clients/staged-delta.ts", "Staged-delta \u{1F534} COMMIT BLOCKED verdict (--lens-guard) for blockers the commit adds, and the degraded refusal when that read gave no answer (#5553).", "Synchronous preflight rejection returned inline with the failed git command. The gate lists the staged set and runs the lanes over the bytes at decision time, so nothing stored is replayed and a finding cannot go stale between detection and delivery.", "live"),
3833
3853
  "shared-checkout-guard:worktree-mutation-blocked": labeled("clients/shared-checkout-guard.ts", "Shared-checkout \u{1F534} WORKING-TREE CHANGE BLOCKED verdict (--lens-checkout-guard).", "Synchronous preflight rejection returned inline with the failed git command. Both inputs are read at decision time \u2014 the instance registry and `git status` \u2014 so no stored finding is replayed and nothing can go stale between detection and delivery.", "live"),
3834
3854
  "read-guard-tool-lines:preflight-errors": labeled("clients/read-guard-tool-lines.ts", "Read-guard hashline BLOCKED / RE-READ REQUIRED / PARTIAL APPLY / ALREADY APPLIED preflight errors (#2402).", "Computed fresh per edit attempt and returned as that attempt's rejection \u2014 no cached findings are replayed, so there is no staleness window. The PARTIAL APPLY and ALREADY APPLIED variants describe the same attempt's commit outcome; applied-edit recognition reads RuntimeCoordinator's session-scoped record, which resets with the session.", "live"),
3835
3855
  "mutating-tool:adapter-preflight-errors": labeled("clients/mutating-tool.ts", "Shape-adapter BLOCKED preflight errors for hashline edit inputs the adapter recognized but could not resolve to a range (#2423).", "Computed fresh from the tool input on each attempt and returned as that attempt's rejection, so there is no staleness window. The adapters read only the call's own arguments; nothing cached is replayed.", "live"),
@@ -5821,7 +5841,113 @@ ${result.stderr ?? ""}`.trim();
5821
5841
  var cpp_check_default = cppCheckRunner;
5822
5842
 
5823
5843
  // dist/clients/dispatch/runners/credo.js
5844
+ import * as path11 from "node:path";
5845
+
5846
+ // dist/clients/dispatch/runners/utils/ignore-anchor.js
5847
+ import * as fs6 from "node:fs";
5824
5848
  import * as path10 from "node:path";
5849
+ function escapeGlobLiteral(literal) {
5850
+ return literal.replace(/[\\*?[\]{}]/g, "\\$&");
5851
+ }
5852
+ function globRoot(root) {
5853
+ const slashed = toPosix(root);
5854
+ const trimmed = slashed.length > 1 ? slashed.replace(/\/+$/, "") : slashed;
5855
+ return escapeGlobLiteral(trimmed);
5856
+ }
5857
+ function isAbsolutePattern(pattern) {
5858
+ return pattern.startsWith("/") || /^[A-Za-z]:[\\/]/.test(pattern);
5859
+ }
5860
+ function tailIsBounded(tail, dialect) {
5861
+ if (dialect === "fnmatch")
5862
+ return /^[^*?[\\/]/.test(tail);
5863
+ if (tail === "")
5864
+ return false;
5865
+ if (!tail.includes("/") && !tail.includes("**"))
5866
+ return true;
5867
+ const head = (tail.split("/")[0] ?? "").replace(/\[[^\]]*\]|\{[^{}]*\}/g, "");
5868
+ return !/[{}\\]/.test(head) && /[^*?]/.test(head);
5869
+ }
5870
+ function anchorIgnorePattern(pattern, root, dialect) {
5871
+ let rest = pattern;
5872
+ if (dialect === "java-glob") {
5873
+ if (rest.startsWith("glob:"))
5874
+ rest = rest.slice("glob:".length);
5875
+ else if (/^[A-Za-z][A-Za-z0-9+.-]+:/.test(rest))
5876
+ return null;
5877
+ }
5878
+ if (rest.length === 0)
5879
+ return null;
5880
+ if (isAbsolutePattern(rest))
5881
+ return [rest];
5882
+ const anchor = globRoot(root);
5883
+ if (dialect === "java-glob") {
5884
+ if (rest.startsWith("**/")) {
5885
+ const tail = rest.slice(3);
5886
+ if (!tailIsBounded(tail, dialect))
5887
+ return null;
5888
+ return [`${anchor}/${tail}`, `${anchor}/**/${tail}`];
5889
+ }
5890
+ return /^[A-Za-z0-9_.-]/.test(rest) ? [rest] : null;
5891
+ }
5892
+ if (rest.startsWith("*")) {
5893
+ const lead = /^\*+\/(.*)$/.exec(rest);
5894
+ const tail = lead ? lead[1] ?? "" : rest.replace(/^\*+/, "");
5895
+ if (!tailIsBounded(tail, dialect))
5896
+ return null;
5897
+ if (lead)
5898
+ return [`${anchor}/${tail}`, `${anchor}/*/${tail}`];
5899
+ return [`${anchor}/${rest}`];
5900
+ }
5901
+ return null;
5902
+ }
5903
+ function anchorIgnorePatterns(patterns, root, dialect) {
5904
+ const out = [];
5905
+ for (const pattern of patterns) {
5906
+ const anchored = anchorIgnorePattern(pattern, root, dialect);
5907
+ if (anchored === null)
5908
+ return { unrecognized: pattern };
5909
+ for (const entry of anchored)
5910
+ if (!out.includes(entry))
5911
+ out.push(entry);
5912
+ }
5913
+ return { patterns: out };
5914
+ }
5915
+ function pathExists(entry) {
5916
+ return fs6.existsSync(entry);
5917
+ }
5918
+ function readConfigText(tool, file) {
5919
+ try {
5920
+ return { kind: "read", text: fs6.readFileSync(file, "utf8") };
5921
+ } catch (err) {
5922
+ return {
5923
+ kind: "unapplied",
5924
+ reason: `its ${tool} config is unreadable (${err.code ?? "read failed"})`
5925
+ };
5926
+ }
5927
+ }
5928
+ async function withOverlayFile(tool, fileName, text, use) {
5929
+ const dir = fs6.mkdtempSync(path10.join(scannerReportParentDir(), `pi-lens-${tool}-anchor-`));
5930
+ try {
5931
+ const tmpFile = path10.join(dir, fileName);
5932
+ fs6.writeFileSync(tmpFile, text);
5933
+ return await use(tmpFile);
5934
+ } finally {
5935
+ fs6.rmSync(dir, { recursive: true, force: true });
5936
+ }
5937
+ }
5938
+ function markUnanchored(tool, reason, result) {
5939
+ incrementDegradationCount({
5940
+ kind: "runner-ignore-unanchored",
5941
+ subject: tool,
5942
+ reason: `${tool} ran on the project's own config: ${reason}`
5943
+ });
5944
+ if (result.status === "succeeded" && result.diagnostics.length === 0) {
5945
+ return { ...result, inconclusive: true };
5946
+ }
5947
+ return result;
5948
+ }
5949
+
5950
+ // dist/clients/dispatch/runners/credo.js
5825
5951
  var CREDO_PROBE_BUDGET_MS = 1e4;
5826
5952
  var probeCredo = createCwdCachedProbe((cwd) => safeSpawnAsync("mix", ["credo", "--version"], {
5827
5953
  timeout: CREDO_PROBE_BUDGET_MS,
@@ -5833,7 +5959,7 @@ function parseCredoJson(raw, fallbackPath, cwd) {
5833
5959
  return (output.issues ?? []).map((issue) => ({
5834
5960
  id: `credo:${issue.check}:${issue.line_no}`,
5835
5961
  message: `[${issue.check}] ${issue.message}`,
5836
- filePath: issue.filename && issue.filename.trim() ? path10.isAbsolute(issue.filename) ? issue.filename : path10.resolve(cwd, issue.filename) : fallbackPath,
5962
+ filePath: issue.filename && issue.filename.trim() ? path11.isAbsolute(issue.filename) ? issue.filename : path11.resolve(cwd, issue.filename) : fallbackPath,
5837
5963
  line: issue.line_no,
5838
5964
  column: issue.column ?? 1,
5839
5965
  severity: issue.priority <= 10 ? "error" : "warning",
@@ -5846,6 +5972,119 @@ function parseCredoJson(raw, fallbackPath, cwd) {
5846
5972
  return [];
5847
5973
  }
5848
5974
  }
5975
+ var CREDO_ANCHOR_OVERLAY = `refuse = fn why -> raise "pi-lens-ignore-unanchored: #{why}" end
5976
+
5977
+ try do
5978
+ root = System.get_env("PI_LENS_ANCHOR_ROOT") || refuse.("no project root")
5979
+ target = System.get_env("PI_LENS_ANCHOR_TARGET") || refuse.("no target file")
5980
+ prefix = String.trim_trailing(root, "/") <> "/"
5981
+
5982
+ if not String.starts_with?(target, prefix),
5983
+ do: refuse.("the file is outside the project root")
5984
+
5985
+ rel = "/" <> binary_part(target, byte_size(prefix), byte_size(target) - byte_size(prefix))
5986
+ overlay = Path.expand(__ENV__.file)
5987
+
5988
+ inner =
5989
+ exec
5990
+ |> Credo.Execution.get_config_files()
5991
+ |> Enum.reject(fn {origin, file, _} -> origin == :file and Path.expand(file) == overlay end)
5992
+ |> Enum.reduce(Credo.Execution.build([]), &Credo.Execution.append_config_file(&2, &1))
5993
+
5994
+ dir = Credo.CLI.Filename.remove_line_no_and_column(exec.cli_options.path)
5995
+ name = exec.cli_options.switches[:config_name]
5996
+
5997
+ config =
5998
+ case Credo.ConfigFile.read_or_default(inner, dir, name) do
5999
+ {:ok, config} -> config
6000
+ {:error, _} -> refuse.("the project's credo config did not load")
6001
+ end
6002
+
6003
+ neutral = "/pi-lens-anchor/pi-lens-root" <> rel
6004
+
6005
+ decide = fn regex ->
6006
+ here = Regex.match?(regex, target)
6007
+
6008
+ cond do
6009
+ Regex.match?(regex, neutral) == here -> here
6010
+ here and Regex.match?(regex, prefix) -> false
6011
+ true -> refuse.("a files.excluded regex reads the project's own path")
6012
+ end
6013
+ end
6014
+
6015
+ anchor_excluded = fn listed ->
6016
+ {regexes, others} = Enum.split_with(List.wrap(listed), &match?(%Regex{}, &1))
6017
+ if Enum.any?(Enum.map(regexes, decide)), do: others ++ [target], else: others
6018
+ end
6019
+
6020
+ excluded = anchor_excluded.(config.files.excluded)
6021
+
6022
+ fix_params = fn params ->
6023
+ if Keyword.keyword?(params) do
6024
+ Enum.map(params, fn
6025
+ {key, files} when key in [:files, :__files__] and (is_map(files) or is_list(files)) ->
6026
+ case files[:excluded] do
6027
+ nil ->
6028
+ {key, files}
6029
+
6030
+ listed ->
6031
+ kept = anchor_excluded.(listed)
6032
+
6033
+ {key,
6034
+ if(is_map(files),
6035
+ do: Map.put(files, :excluded, kept),
6036
+ else: Keyword.put(files, :excluded, kept)
6037
+ )}
6038
+ end
6039
+
6040
+ other ->
6041
+ other
6042
+ end)
6043
+ else
6044
+ params
6045
+ end
6046
+ end
6047
+
6048
+ fix_check = fn
6049
+ {check, params} when is_list(params) -> {check, fix_params.(params)}
6050
+ other -> other
6051
+ end
6052
+
6053
+ checks =
6054
+ case config.checks do
6055
+ %{} = grouped ->
6056
+ Map.new(grouped, fn
6057
+ {group, list} when is_list(list) -> {group, Enum.map(list, fix_check)}
6058
+ other -> other
6059
+ end)
6060
+
6061
+ list when is_list(list) ->
6062
+ Enum.map(list, fix_check)
6063
+
6064
+ other ->
6065
+ other
6066
+ end
6067
+
6068
+ %{
6069
+ configs: [
6070
+ %{
6071
+ name: name || "default",
6072
+ files: %{included: config.files.included, excluded: excluded},
6073
+ checks: checks,
6074
+ color: config.color,
6075
+ parse_timeout: config.parse_timeout,
6076
+ plugins: config.plugins,
6077
+ requires: config.requires,
6078
+ strict: config.strict
6079
+ }
6080
+ ]
6081
+ }
6082
+ rescue
6083
+ error ->
6084
+ reason = String.replace_prefix(Exception.message(error), "pi-lens-ignore-unanchored: ", "")
6085
+ refuse.(reason)
6086
+ end`;
6087
+ var CREDO_UNANCHORED_REFUSAL = /^warning: Execution halted during [^\n]*%RuntimeError\{message: "pi-lens-ignore-unanchored: ((?:[^"\\\n]|\\.)*)"/m;
5849
6088
  var credoRunner = {
5850
6089
  id: "credo",
5851
6090
  appliesTo: ["elixir"],
@@ -5861,29 +6100,168 @@ var credoRunner = {
5861
6100
  if (!await probeCredo(cwd)) {
5862
6101
  return toolAbsentSkip(cwd, { checker: probeCredo });
5863
6102
  }
5864
- const absPath = path10.resolve(cwd, ctx.filePath);
5865
- const result = await safeSpawnAsync("mix", ["credo", "--format", "json", "--strict", absPath], { timeout: 3e4, cwd });
6103
+ const absPath = path11.resolve(cwd, ctx.filePath);
6104
+ const spawnCredo = (config, env) => safeSpawnAsync("mix", ["credo", "--format", "json", "--strict", ...config, absPath], { timeout: 3e4, cwd, ...env ? { env } : {} });
6105
+ const anchoredRun = await withOverlayFile("credo", "anchor.exs", CREDO_ANCHOR_OVERLAY, (file) => spawnCredo(["--config-file", file], {
6106
+ PI_LENS_ANCHOR_ROOT: cwd,
6107
+ PI_LENS_ANCHOR_TARGET: absPath
6108
+ }));
6109
+ const refusal = CREDO_UNANCHORED_REFUSAL.exec(anchoredRun.stderr ?? "");
6110
+ const result = refusal ? await spawnCredo([]) : anchoredRun;
6111
+ const finish = (verdict) => refusal ? markUnanchored("credo", refusal[1] ?? "no reason given", verdict) : verdict;
5866
6112
  const parsed = parseToolRun("credo", {
5867
6113
  result,
5868
- // EXIT TABLE (Credo 1.7 measured fixture): 0 clean; 1 findings; 2 error; other nonzero rejected.
5869
- exitCodes: { ran: [1, 2] }
6114
+ // EXIT TABLE (Credo 1.7 measured fixture): the nonzero status is a
6115
+ // category bitmask. Stock categories set bits 1, 2, 4, 8 and 16, so a
6116
+ // stock run exits 1..31; 32..127 come only from custom checks.
6117
+ // Admitted statuses (the full bitmask): 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127; rejected statuses: 128+.
6118
+ exitCodes: {
6119
+ ran: [
6120
+ 1,
6121
+ 2,
6122
+ 3,
6123
+ 4,
6124
+ 5,
6125
+ 6,
6126
+ 7,
6127
+ 8,
6128
+ 9,
6129
+ 10,
6130
+ 11,
6131
+ 12,
6132
+ 13,
6133
+ 14,
6134
+ 15,
6135
+ 16,
6136
+ 17,
6137
+ 18,
6138
+ 19,
6139
+ 20,
6140
+ 21,
6141
+ 22,
6142
+ 23,
6143
+ 24,
6144
+ 25,
6145
+ 26,
6146
+ 27,
6147
+ 28,
6148
+ 29,
6149
+ 30,
6150
+ 31,
6151
+ 32,
6152
+ 33,
6153
+ 34,
6154
+ 35,
6155
+ 36,
6156
+ 37,
6157
+ 38,
6158
+ 39,
6159
+ 40,
6160
+ 41,
6161
+ 42,
6162
+ 43,
6163
+ 44,
6164
+ 45,
6165
+ 46,
6166
+ 47,
6167
+ 48,
6168
+ 49,
6169
+ 50,
6170
+ 51,
6171
+ 52,
6172
+ 53,
6173
+ 54,
6174
+ 55,
6175
+ 56,
6176
+ 57,
6177
+ 58,
6178
+ 59,
6179
+ 60,
6180
+ 61,
6181
+ 62,
6182
+ 63,
6183
+ 64,
6184
+ 65,
6185
+ 66,
6186
+ 67,
6187
+ 68,
6188
+ 69,
6189
+ 70,
6190
+ 71,
6191
+ 72,
6192
+ 73,
6193
+ 74,
6194
+ 75,
6195
+ 76,
6196
+ 77,
6197
+ 78,
6198
+ 79,
6199
+ 80,
6200
+ 81,
6201
+ 82,
6202
+ 83,
6203
+ 84,
6204
+ 85,
6205
+ 86,
6206
+ 87,
6207
+ 88,
6208
+ 89,
6209
+ 90,
6210
+ 91,
6211
+ 92,
6212
+ 93,
6213
+ 94,
6214
+ 95,
6215
+ 96,
6216
+ 97,
6217
+ 98,
6218
+ 99,
6219
+ 100,
6220
+ 101,
6221
+ 102,
6222
+ 103,
6223
+ 104,
6224
+ 105,
6225
+ 106,
6226
+ 107,
6227
+ 108,
6228
+ 109,
6229
+ 110,
6230
+ 111,
6231
+ 112,
6232
+ 113,
6233
+ 114,
6234
+ 115,
6235
+ 116,
6236
+ 117,
6237
+ 118,
6238
+ 119,
6239
+ 120,
6240
+ 121,
6241
+ 122,
6242
+ 123,
6243
+ 124,
6244
+ 125,
6245
+ 126,
6246
+ 127
6247
+ ]
6248
+ }
5870
6249
  }, (raw) => parseCredoJson(raw, ctx.filePath, cwd), { parseStreams: "stdout-else-stderr" });
5871
6250
  if (parsed.skipped)
5872
6251
  return parsed.skipped;
5873
- return finishParsedRun({
6252
+ return finish(finishParsedRun({
5874
6253
  tool: "credo",
5875
6254
  ctx,
5876
6255
  result,
5877
6256
  diagnostics: parsed.diagnostics
5878
- });
6257
+ }));
5879
6258
  }
5880
6259
  };
5881
6260
  var credo_default = credoRunner;
5882
6261
 
5883
6262
  // dist/clients/dispatch/runners/cue-vet.js
5884
- import * as fs6 from "node:fs";
5885
- import * as path11 from "node:path";
5886
- var cue = createAvailabilityChecker("cue", ".exe", ["version"]);
6263
+ import * as fs7 from "node:fs";
6264
+ import * as path12 from "node:path";
5887
6265
  function parseCueVetOutput(raw) {
5888
6266
  const errors = [];
5889
6267
  let current = null;
@@ -5928,7 +6306,7 @@ function hasPackageClause(content) {
5928
6306
  return false;
5929
6307
  }
5930
6308
  function locationMatchesFile(location, absTarget, vetCwd) {
5931
- return pathsEqual(path11.resolve(vetCwd, location.file), absTarget);
6309
+ return pathsEqual(path12.resolve(vetCwd, location.file), absTarget);
5932
6310
  }
5933
6311
  function toDiagnostic2(id, message, fileName, line, column) {
5934
6312
  return {
@@ -5947,7 +6325,7 @@ function toDiagnostic2(id, message, fileName, line, column) {
5947
6325
  function filterToTouchedFile(errors, fileName, vetCwd) {
5948
6326
  if (errors.length === 0)
5949
6327
  return void 0;
5950
- const absTarget = path11.resolve(vetCwd, fileName);
6328
+ const absTarget = path12.resolve(vetCwd, fileName);
5951
6329
  const withLocation = errors.filter((error) => error.locations.length > 0);
5952
6330
  const unattributable = errors.filter((error) => error.locations.length === 0);
5953
6331
  if (withLocation.length === 0)
@@ -5972,21 +6350,16 @@ var cueVetRunner = {
5972
6350
  timeoutMs: 3e4,
5973
6351
  async run(ctx) {
5974
6352
  const cwd = resolveRunnerCwd(ctx, "cue-vet");
5975
- let cmd = null;
5976
- if (await cue.isAvailableAsync(cwd)) {
5977
- cmd = cue.getCommand(cwd);
5978
- } else {
5979
- cmd = await resolveAvailableOrInstall(cue, "cue", cwd);
5980
- }
6353
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "cue");
5981
6354
  if (!cmd)
5982
- return toolAbsentSkip(cwd, { id: "cue", checker: cue });
5983
- const absPath = path11.resolve(cwd, ctx.filePath);
5984
- const fileDir = path11.dirname(absPath);
5985
- const fileName = path11.basename(absPath);
6355
+ return toolAbsentSkip(cwd, { id: "cue" });
6356
+ const absPath = path12.resolve(cwd, ctx.filePath);
6357
+ const fileDir = path12.dirname(absPath);
6358
+ const fileName = path12.basename(absPath);
5986
6359
  const singleFileArgs = ["vet", "-c=false", `./${fileName}`];
5987
6360
  let touchedContent = null;
5988
6361
  try {
5989
- touchedContent = fs6.readFileSync(absPath, "utf8");
6362
+ touchedContent = fs7.readFileSync(absPath, "utf8");
5990
6363
  } catch {
5991
6364
  touchedContent = null;
5992
6365
  }
@@ -6044,7 +6417,7 @@ ${result.stderr || ""}`.trim();
6044
6417
  var cue_vet_default = cueVetRunner;
6045
6418
 
6046
6419
  // dist/clients/dispatch/runners/dart-analyze.js
6047
- import * as path12 from "node:path";
6420
+ import * as path13 from "node:path";
6048
6421
  var dart = createAvailabilityChecker("dart", ".exe");
6049
6422
  var flutter = createAvailabilityChecker("flutter", ".bat");
6050
6423
  var DART_FIXABLE_RULES = /* @__PURE__ */ new Set([
@@ -6131,7 +6504,7 @@ var DART_FIXABLE_RULES = /* @__PURE__ */ new Set([
6131
6504
  ]);
6132
6505
  function parseDartMachineOutput(raw, filePath, cwd) {
6133
6506
  const diagnostics = [];
6134
- const absTarget = path12.resolve(cwd, filePath);
6507
+ const absTarget = path13.resolve(cwd, filePath);
6135
6508
  for (const line of raw.split(/\r?\n/)) {
6136
6509
  if (!line.trim())
6137
6510
  continue;
@@ -6142,7 +6515,7 @@ function parseDartMachineOutput(raw, filePath, cwd) {
6142
6515
  const message = messageParts.join("|").trim();
6143
6516
  const lineNum = parseInt(lineStr, 10);
6144
6517
  const colNum = parseInt(colStr, 10);
6145
- if (!pathsEqual(path12.resolve(cwd, file?.trim() ?? ""), absTarget))
6518
+ if (!pathsEqual(path13.resolve(cwd, file?.trim() ?? ""), absTarget))
6146
6519
  continue;
6147
6520
  const severity = severityStr?.trim().toLowerCase() === "error" ? "error" : "warning";
6148
6521
  const ruleId = code?.trim() ?? "dart";
@@ -6171,7 +6544,7 @@ var dartAnalyzeRunner = {
6171
6544
  skipTestFiles: false,
6172
6545
  async run(ctx) {
6173
6546
  const cwd = resolveRunnerCwd(ctx, "dart-analyze");
6174
- const absPath = path12.resolve(cwd, ctx.filePath);
6547
+ const absPath = path13.resolve(cwd, ctx.filePath);
6175
6548
  const dartAvailable = await dart.isAvailableAsync(cwd);
6176
6549
  const flutterAvailable = !dartAvailable && await flutter.isAvailableAsync(cwd);
6177
6550
  if (!dartAvailable && !flutterAvailable) {
@@ -6203,7 +6576,7 @@ var dartAnalyzeRunner = {
6203
6576
  var dart_analyze_default = dartAnalyzeRunner;
6204
6577
 
6205
6578
  // dist/clients/dispatch/runners/detekt.js
6206
- import * as path13 from "node:path";
6579
+ import * as path14 from "node:path";
6207
6580
  var DETEKT_FIXABLE_RULES = /* @__PURE__ */ new Set([
6208
6581
  // formatting (ktlint wrapper) — every rule supports autocorrect
6209
6582
  "AnnotationOnSeparateLine",
@@ -6272,11 +6645,11 @@ function parseDetektOutput(raw, filePath, cwd) {
6272
6645
  return diagnostics;
6273
6646
  let located = 0;
6274
6647
  const pattern = /^(.+?):(\d+):(\d+): (?:(error|warning): )?(.+?)(?:\s+\[([^\]]+)\])?$/gm;
6275
- const absTarget = path13.resolve(cwd, filePath);
6648
+ const absTarget = path14.resolve(cwd, filePath);
6276
6649
  for (const match of raw.matchAll(pattern)) {
6277
6650
  const [, file, lineStr, colStr, level, message, rule] = match;
6278
6651
  located += 1;
6279
- if (!pathsEqual(path13.resolve(cwd, file.trim()), absTarget))
6652
+ if (!pathsEqual(path14.resolve(cwd, file.trim()), absTarget))
6280
6653
  continue;
6281
6654
  const severity = level === "error" ? "error" : "warning";
6282
6655
  const lineNum = Number.parseInt(lineStr, 10);
@@ -6300,6 +6673,98 @@ function parseDetektOutput(raw, filePath, cwd) {
6300
6673
  }
6301
6674
  return located > 0 ? diagnostics : null;
6302
6675
  }
6676
+ var DETEKT_NON_RULESET_KEYS = /* @__PURE__ */ new Set([
6677
+ "build",
6678
+ "config",
6679
+ "processors",
6680
+ "console-reports",
6681
+ "output-reports"
6682
+ ]);
6683
+ var DETEKT_PATH_FILTER_KEYS = ["excludes", "includes"];
6684
+ function isPlainObject(value) {
6685
+ return typeof value === "object" && value !== null && !Array.isArray(value) && Object.getPrototypeOf(value) === Object.prototype;
6686
+ }
6687
+ function anchorDetektConfig(text, root) {
6688
+ if (text.trim() === "")
6689
+ return { kind: "unchanged" };
6690
+ let tree;
6691
+ try {
6692
+ tree = js_yaml_default.load(text);
6693
+ } catch (err) {
6694
+ return {
6695
+ kind: "unapplied",
6696
+ reason: `its detekt config is not readable YAML (${err instanceof Error ? err.message.split("\n")[0] : "load failed"})`
6697
+ };
6698
+ }
6699
+ if (tree === null || tree === void 0)
6700
+ return { kind: "unchanged" };
6701
+ if (!isPlainObject(tree)) {
6702
+ return {
6703
+ kind: "unapplied",
6704
+ reason: "its detekt config is not a map of rule sets"
6705
+ };
6706
+ }
6707
+ const overlay = /* @__PURE__ */ Object.create(null);
6708
+ let refused;
6709
+ const rewrite = (holder, place) => {
6710
+ for (const key of DETEKT_PATH_FILTER_KEYS) {
6711
+ const value = holder[key];
6712
+ if (value === void 0 || value === null)
6713
+ continue;
6714
+ let entries;
6715
+ if (typeof value === "string") {
6716
+ if (/[{}]/.test(value)) {
6717
+ refused = `an ${key} string holds braces: ${value}`;
6718
+ return;
6719
+ }
6720
+ entries = value.split(",").flatMap((entry) => {
6721
+ const trimmed = entry.trim();
6722
+ return trimmed.length > 0 ? [trimmed] : [];
6723
+ });
6724
+ } else if (Array.isArray(value) && value.every((entry) => typeof entry === "string")) {
6725
+ entries = value;
6726
+ } else {
6727
+ refused = `an ${key} value is not a glob list`;
6728
+ return;
6729
+ }
6730
+ const anchored = anchorIgnorePatterns(entries, root, "java-glob");
6731
+ if ("unrecognized" in anchored) {
6732
+ refused = `${key} entry ${JSON.stringify(anchored.unrecognized)} is not a form it can anchor`;
6733
+ return;
6734
+ }
6735
+ if (anchored.patterns.length !== entries.length || anchored.patterns.some((entry, index) => entry !== entries[index])) {
6736
+ place()[key] = anchored.patterns;
6737
+ }
6738
+ }
6739
+ };
6740
+ for (const [name, ruleset] of Object.entries(tree)) {
6741
+ if (DETEKT_NON_RULESET_KEYS.has(name) || !isPlainObject(ruleset))
6742
+ continue;
6743
+ const rulesetPlace = () => overlay[name] ??= /* @__PURE__ */ Object.create(null);
6744
+ rewrite(ruleset, rulesetPlace);
6745
+ for (const [ruleName, rule] of Object.entries(ruleset)) {
6746
+ if (refused)
6747
+ break;
6748
+ if (isPlainObject(rule)) {
6749
+ rewrite(rule, () => {
6750
+ const set = rulesetPlace();
6751
+ return set[ruleName] ??= /* @__PURE__ */ Object.create(null);
6752
+ });
6753
+ }
6754
+ }
6755
+ if (refused)
6756
+ break;
6757
+ }
6758
+ if (refused) {
6759
+ return { kind: "unapplied", reason: `its detekt config: ${refused}` };
6760
+ }
6761
+ if (Object.keys(overlay).length === 0)
6762
+ return { kind: "unchanged" };
6763
+ return {
6764
+ kind: "rewritten",
6765
+ text: js_yaml_default.dump(overlay, { lineWidth: -1, noRefs: true })
6766
+ };
6767
+ }
6303
6768
  var detektRunner = {
6304
6769
  id: "detekt",
6305
6770
  appliesTo: ["kotlin"],
@@ -6320,8 +6785,15 @@ var detektRunner = {
6320
6785
  const cmd = await resolveToolCommandWithInstallFallback(cwd, "detekt");
6321
6786
  if (!cmd)
6322
6787
  return toolAbsentSkip(cwd, { id: "detekt" });
6323
- const absPath = path13.resolve(cwd, ctx.filePath);
6324
- const result = await safeSpawnAsync(cmd, ["--input", absPath, "--config", configPath], { cwd, timeout: 6e4 });
6788
+ const absPath = path14.resolve(cwd, ctx.filePath);
6789
+ const read = readConfigText("detekt", configPath);
6790
+ const anchored = read.kind === "read" ? anchorDetektConfig(read.text, cwd) : read;
6791
+ const finish = (verdict2) => anchored.kind === "unapplied" ? markUnanchored("detekt", anchored.reason, verdict2) : verdict2;
6792
+ const spawnDetekt = (config) => safeSpawnAsync(cmd, ["--input", absPath, "--config", config], {
6793
+ cwd,
6794
+ timeout: 6e4
6795
+ });
6796
+ const result = anchored.kind === "rewritten" ? await withOverlayFile("detekt", "detekt.yml", anchored.text, (file) => spawnDetekt(`${configPath},${file}`)) : await spawnDetekt(configPath);
6325
6797
  const raw = `${result.stdout ?? ""}${result.stderr ?? ""}`;
6326
6798
  const run = parseToolRun("detekt", {
6327
6799
  result,
@@ -6352,18 +6824,18 @@ var detektRunner = {
6352
6824
  }
6353
6825
  });
6354
6826
  if (run.diagnostics.length === 0)
6355
- return verdict;
6356
- return result.status === 1 ? { ...verdict, inconclusive: true } : verdict;
6827
+ return finish(verdict);
6828
+ return finish(result.status === 1 ? { ...verdict, inconclusive: true } : verdict);
6357
6829
  }
6358
6830
  };
6359
6831
  var detekt_default = detektRunner;
6360
6832
 
6361
6833
  // dist/clients/dispatch/runners/dotnet-build.js
6362
- import * as fs7 from "node:fs";
6363
- import * as path14 from "node:path";
6834
+ import * as fs8 from "node:fs";
6835
+ import * as path15 from "node:path";
6364
6836
  var dotnet = createAvailabilityChecker("dotnet", ".exe");
6365
6837
  function findProjectTarget(cwd) {
6366
- const entries = fs7.readdirSync(cwd, { withFileTypes: true });
6838
+ const entries = fs8.readdirSync(cwd, { withFileTypes: true });
6367
6839
  for (const patterns of [
6368
6840
  DOTNET_CSHARP_SOLUTION_MARKERS,
6369
6841
  DOTNET_CSHARP_PROJECT_MARKERS
@@ -6441,13 +6913,13 @@ function parseDotnetDiagnosticLine(line) {
6441
6913
  }
6442
6914
  function parseDotnetBuildOutput(raw, filePath, cwd) {
6443
6915
  const diagnostics = [];
6444
- const absTarget = path14.resolve(cwd, filePath);
6916
+ const absTarget = path15.resolve(cwd, filePath);
6445
6917
  for (const line of raw.split(/\r?\n/)) {
6446
6918
  const parsed = parseDotnetDiagnosticLine(line);
6447
6919
  if (!parsed)
6448
6920
  continue;
6449
6921
  const { reportedFile, lineStr, colStr, severityLabel, rule, message } = parsed;
6450
- if (!pathsEqual(path14.resolve(cwd, reportedFile), absTarget))
6922
+ if (!pathsEqual(path15.resolve(cwd, reportedFile), absTarget))
6451
6923
  continue;
6452
6924
  const severity = severityLabel.toLowerCase() === "error" ? "error" : "warning";
6453
6925
  const lineNum = Number.parseInt(lineStr, 10) || 1;
@@ -6518,16 +6990,16 @@ ${result.stderr ?? ""}`.trim();
6518
6990
  var dotnet_build_default = dotnetBuildRunner;
6519
6991
 
6520
6992
  // dist/clients/dispatch/runners/elixir-check.js
6521
- import * as fs8 from "node:fs";
6522
- import * as path15 from "node:path";
6993
+ import * as fs9 from "node:fs";
6994
+ import * as path16 from "node:path";
6523
6995
  var mix = createAvailabilityChecker("mix", ".bat");
6524
6996
  var elixirc = createAvailabilityChecker("elixirc", ".bat");
6525
6997
  var ELIXIR_SNIPPET_LOCATION = /└─\s+(.+?):(\d+)(?::(\d+))?(?::|$)/;
6526
6998
  function parseElixirOutput(raw, filePath, cwd = process.cwd()) {
6527
6999
  const diagnostics = [];
6528
- const resolvedTarget = path15.resolve(cwd, filePath);
7000
+ const resolvedTarget = path16.resolve(cwd, filePath);
6529
7001
  const lines = raw.split(/\r?\n/);
6530
- const matchesTarget = (sourcePath) => pathsEqual(path15.resolve(cwd, sourcePath.trim()), resolvedTarget);
7002
+ const matchesTarget = (sourcePath) => pathsEqual(path16.resolve(cwd, sourcePath.trim()), resolvedTarget);
6531
7003
  for (let index = 0; index < lines.length; index++) {
6532
7004
  const line = lines[index];
6533
7005
  if (line.length > 2e3)
@@ -6612,7 +7084,7 @@ var elixirCheckRunner = {
6612
7084
  skipTestFiles: false,
6613
7085
  async run(ctx) {
6614
7086
  const cwd = resolveRunnerCwd(ctx, "elixir-check");
6615
- const absPath = path15.resolve(cwd, ctx.filePath);
7087
+ const absPath = path16.resolve(cwd, ctx.filePath);
6616
7088
  let command;
6617
7089
  let args = [];
6618
7090
  const mixProject = hasToolConfig("mix", cwd);
@@ -6620,8 +7092,8 @@ var elixirCheckRunner = {
6620
7092
  command = "mix";
6621
7093
  args = ["compile", "--warnings-as-errors"];
6622
7094
  } else if (await elixirc.isAvailableAsync(cwd)) {
6623
- const outDir = path15.join(getProjectDataDir(cwd), "elixir-check");
6624
- fs8.mkdirSync(outDir, { recursive: true });
7095
+ const outDir = path16.join(getProjectDataDir(cwd), "elixir-check");
7096
+ fs9.mkdirSync(outDir, { recursive: true });
6625
7097
  command = "elixirc";
6626
7098
  args = ["-o", outDir, absPath];
6627
7099
  }
@@ -6666,7 +7138,7 @@ ${result.stdout || ""}`;
6666
7138
  var elixir_check_default = elixirCheckRunner;
6667
7139
 
6668
7140
  // dist/clients/dispatch/runners/eslint.js
6669
- import * as path16 from "node:path";
7141
+ import * as path17 from "node:path";
6670
7142
  var ESLINT_PROBE_BUDGET_MS = 5e3;
6671
7143
  function makeEslintProbe(cmd) {
6672
7144
  return createCwdCachedProbe((cwd) => safeSpawnAsync(cmd, ["--version"], {
@@ -6692,9 +7164,9 @@ function parseEslintJson(raw, filePath, cwd) {
6692
7164
  const results = JSON.parse(raw);
6693
7165
  const autofix = getAutofixCapability("eslint");
6694
7166
  const diagnostics = [];
6695
- const absTarget = path16.resolve(cwd, filePath);
7167
+ const absTarget = path17.resolve(cwd, filePath);
6696
7168
  for (const fileResult of results) {
6697
- if (fileResult.filePath && !pathsEqual(path16.resolve(cwd, fileResult.filePath), absTarget))
7169
+ if (fileResult.filePath && !pathsEqual(path17.resolve(cwd, fileResult.filePath), absTarget))
6698
7170
  continue;
6699
7171
  for (const msg of fileResult.messages) {
6700
7172
  const severity = msg.severity === 2 ? "error" : "warning";
@@ -6727,6 +7199,7 @@ var eslintRunner = {
6727
7199
  appliesTo: ["jsts"],
6728
7200
  priority: PRIORITY.LINT_SECONDARY,
6729
7201
  requiresConfig: (cwd) => hasToolConfig("eslint", cwd),
7202
+ lintsGivenContent: true,
6730
7203
  async run(ctx) {
6731
7204
  const resolution = resolveRunnerCwdWithReason(ctx, "eslint");
6732
7205
  const cwd = resolution.cwd;
@@ -6739,7 +7212,16 @@ var eslintRunner = {
6739
7212
  if (!await eslintProbe(packageDir)) {
6740
7213
  return toolAbsentSkip(packageDir, { checker: eslintProbe });
6741
7214
  }
6742
- const result = await safeSpawnAsync(cmd, ["--format", "json", "--no-error-on-unmatched-pattern", ctx.filePath], { timeout: 3e4, cwd });
7215
+ const result = await safeSpawnAsync(cmd, [
7216
+ "--format",
7217
+ "json",
7218
+ "--no-error-on-unmatched-pattern",
7219
+ ...ctx.givenContent === void 0 ? [ctx.filePath] : ["--stdin", "--stdin-filename", ctx.filePath]
7220
+ ], {
7221
+ timeout: 3e4,
7222
+ cwd,
7223
+ ...ctx.givenContent !== void 0 && { input: ctx.givenContent }
7224
+ });
6743
7225
  const parsed = parseToolRun("eslint", {
6744
7226
  result,
6745
7227
  // EXIT TABLE (ESLint 9.10 docs https://eslint.org/docs/latest/use/command-line-interface): 0 clean; 1 findings; 2 fatal findings/error; other nonzero rejected.
@@ -6793,7 +7275,7 @@ var factRulesRunner = {
6793
7275
  var fact_rules_default = factRulesRunner;
6794
7276
 
6795
7277
  // dist/clients/dispatch/runners/gleam-check.js
6796
- import * as path17 from "node:path";
7278
+ import * as path18 from "node:path";
6797
7279
  var gleam = createAvailabilityChecker("gleam", ".exe");
6798
7280
  var GLEAM_LOCUS = /^\s*┌─\s+(.+?):(\d+):(\d+)$/;
6799
7281
  var GLEAM_HEADER = /^\s*(error|warning):\s*(.+?)\s*$/;
@@ -6815,7 +7297,7 @@ function gleamMessage(title, body) {
6815
7297
  }
6816
7298
  function parseGleamOutput(raw, filePath, cwd) {
6817
7299
  const diagnostics = [];
6818
- const absTarget = path17.resolve(cwd, filePath);
7300
+ const absTarget = path18.resolve(cwd, filePath);
6819
7301
  const lines = stripAnsi(raw).split(/\r?\n/);
6820
7302
  for (const { header, body } of gleamBlocks(lines)) {
6821
7303
  const severity = header[1] === "warning" ? "warning" : "error";
@@ -6824,7 +7306,7 @@ function parseGleamOutput(raw, filePath, cwd) {
6824
7306
  if (!location)
6825
7307
  continue;
6826
7308
  const [, sourcePath, lineStr, colStr] = location;
6827
- if (!pathsEqual(path17.resolve(cwd, sourcePath.trim()), absTarget))
7309
+ if (!pathsEqual(path18.resolve(cwd, sourcePath.trim()), absTarget))
6828
7310
  continue;
6829
7311
  diagnostics.push({
6830
7312
  id: `gleam-check-${lineStr}-${colStr}`,
@@ -6891,11 +7373,11 @@ var gleam_check_default = gleamCheckRunner;
6891
7373
  import { resolve as resolve15 } from "node:path";
6892
7374
 
6893
7375
  // dist/clients/dispatch/runners/utils/diagnostic-parsers.js
6894
- import * as path18 from "node:path";
7376
+ import * as path19 from "node:path";
6895
7377
  function createLineParser(config) {
6896
7378
  return (raw, filePath, cwd) => {
6897
7379
  const diagnostics = [];
6898
- const absTarget = path18.resolve(cwd, filePath);
7380
+ const absTarget = path19.resolve(cwd, filePath);
6899
7381
  const clean = config.stripAnsi !== false ? stripAnsi(raw) : raw;
6900
7382
  const lines = clean.split("\n").filter((l) => l.trim());
6901
7383
  for (const line of lines) {
@@ -6903,7 +7385,7 @@ function createLineParser(config) {
6903
7385
  if (!match)
6904
7386
  continue;
6905
7387
  const reported = match[1];
6906
- if (reported && !pathsEqual(path18.resolve(cwd, reported), absTarget))
7388
+ if (reported && !pathsEqual(path19.resolve(cwd, reported), absTarget))
6907
7389
  continue;
6908
7390
  const lineNum = parseInt(match[2], 10);
6909
7391
  const colNum = parseInt(match[3], 10);
@@ -7003,7 +7485,7 @@ var goVetRunner = {
7003
7485
  var go_vet_default = goVetRunner;
7004
7486
 
7005
7487
  // dist/clients/dispatch/runners/golangci-lint.js
7006
- import * as path19 from "node:path";
7488
+ import * as path20 from "node:path";
7007
7489
  var OTHER_OUTPUT_FORMATS = [
7008
7490
  "text",
7009
7491
  "tab",
@@ -7034,8 +7516,8 @@ function parseGolangciJson(raw, filePath, cwd) {
7034
7516
  const output = JSON.parse(raw);
7035
7517
  if (!output.Issues)
7036
7518
  return [];
7037
- const absFile = path19.resolve(cwd, filePath);
7038
- return output.Issues.filter((issue) => pathsEqual(path19.resolve(cwd, issue.Pos.Filename), absFile)).map((issue) => {
7519
+ const absFile = path20.resolve(cwd, filePath);
7520
+ return output.Issues.filter((issue) => pathsEqual(path20.resolve(cwd, issue.Pos.Filename), absFile)).map((issue) => {
7039
7521
  const severity = issue.Severity === "error" ? "error" : "warning";
7040
7522
  const fixSuggestion = describeReplacement(issue.Replacement);
7041
7523
  return {
@@ -7101,15 +7583,15 @@ var golangciRunner = {
7101
7583
  var golangci_lint_default = golangciRunner;
7102
7584
 
7103
7585
  // dist/clients/dispatch/runners/hadolint.js
7104
- import * as path20 from "node:path";
7586
+ import * as path21 from "node:path";
7105
7587
  function parseHadolintOutput(raw, filePath, cwd) {
7106
7588
  try {
7107
7589
  const parsed = JSON.parse(raw);
7108
7590
  if (!Array.isArray(parsed))
7109
7591
  return [];
7110
- const absTarget = path20.resolve(cwd, filePath);
7592
+ const absTarget = path21.resolve(cwd, filePath);
7111
7593
  return parsed.flatMap((item) => {
7112
- if (item.file && !pathsEqual(path20.resolve(cwd, item.file), absTarget))
7594
+ if (item.file && !pathsEqual(path21.resolve(cwd, item.file), absTarget))
7113
7595
  return [];
7114
7596
  const severity = item.level === "error" ? "error" : "warning";
7115
7597
  return [
@@ -7146,7 +7628,7 @@ var hadolintRunner = {
7146
7628
  if (!cmd) {
7147
7629
  return toolAbsentSkip(cwd, { id: "hadolint" });
7148
7630
  }
7149
- const result = await safeSpawnAsync(cmd, ["--format", "json", "--no-fail", path20.resolve(cwd, ctx.filePath)], { cwd });
7631
+ const result = await safeSpawnAsync(cmd, ["--format", "json", "--no-fail", path21.resolve(cwd, ctx.filePath)], { cwd });
7150
7632
  const run = parseToolRun("hadolint", {
7151
7633
  result,
7152
7634
  // EXIT TABLE (Hadolint 2.12 measured fixture): 0 clean; 1 findings; 2 error; other nonzero rejected.
@@ -7173,7 +7655,7 @@ var hadolintRunner = {
7173
7655
  var hadolint_default = hadolintRunner;
7174
7656
 
7175
7657
  // dist/clients/dispatch/runners/helm-lint.js
7176
- import * as path21 from "node:path";
7658
+ import * as path22 from "node:path";
7177
7659
  var inFlightByChartRoot = new PathKeyedMap(normalizeMapKey);
7178
7660
  var HELM_LINT_TIMEOUT_MS = 3e4;
7179
7661
  var MAX_HELM_LINT_OUTPUT_BYTES = 8 * 1024 * 1024;
@@ -7186,13 +7668,13 @@ function diagnosticLocation(message, chartRoot) {
7186
7668
  const location = message.match(/(?:^|[\s(])((?:[^\s:()\r\n]*\/[^:()\r\n"]*?|[^\s:()\r\n]+)\.(?:ya?ml|tpl|json))(?::(\d+))?(?=[:\s)]|$)/i);
7187
7669
  const [, found, rawLine] = location ?? [];
7188
7670
  if (!found) {
7189
- return { filePath: path21.join(chartRoot, "Chart.yaml"), message };
7671
+ return { filePath: path22.join(chartRoot, "Chart.yaml"), message };
7190
7672
  }
7191
7673
  const embedded = !message.startsWith(found);
7192
7674
  const relative2 = embedded ? found.slice(found.indexOf("/") + 1) : found;
7193
- const candidate = path21.resolve(chartRoot, relative2);
7675
+ const candidate = path22.resolve(chartRoot, relative2);
7194
7676
  return {
7195
- filePath: isWithinIdentity(candidate, chartRoot) ? candidate : path21.join(chartRoot, "Chart.yaml"),
7677
+ filePath: isWithinIdentity(candidate, chartRoot) ? candidate : path22.join(chartRoot, "Chart.yaml"),
7196
7678
  line: rawLine ? Number(rawLine) : void 0,
7197
7679
  message
7198
7680
  };
@@ -7289,12 +7771,12 @@ var helmLintRunner = {
7289
7771
  timeoutMs: 35e3,
7290
7772
  async run(ctx) {
7291
7773
  const cwd = resolveRunnerCwd(ctx, "helm");
7292
- const workspaceRoot = path21.resolve(ctx.projectRoot ?? ctx.cwd);
7293
- const startDir = path21.dirname(path21.resolve(ctx.filePath));
7774
+ const workspaceRoot = path22.resolve(ctx.projectRoot ?? ctx.cwd);
7775
+ const startDir = path22.dirname(path22.resolve(ctx.filePath));
7294
7776
  const discovered = findNearestDirWithMarker(startDir, "chartYamlPath");
7295
7777
  if (!discovered)
7296
7778
  return SKIPPED;
7297
- const chartRoot = path21.resolve(discovered);
7779
+ const chartRoot = path22.resolve(discovered);
7298
7780
  if (!isWithinIdentity(chartRoot, workspaceRoot))
7299
7781
  return SKIPPED;
7300
7782
  const existing = inFlightByChartRoot.get(chartRoot);
@@ -7311,8 +7793,8 @@ var helmLintRunner = {
7311
7793
  var helm_lint_default = helmLintRunner;
7312
7794
 
7313
7795
  // dist/clients/dispatch/runners/helm-render.js
7314
- import * as fs9 from "node:fs";
7315
- import * as path22 from "node:path";
7796
+ import * as fs10 from "node:fs";
7797
+ import * as path23 from "node:path";
7316
7798
  var inFlightByChartRoot2 = new PathKeyedMap(normalizeMapKey);
7317
7799
  var RENDER_TIMEOUT_MS = 3e4;
7318
7800
  var TRIVY_TIMEOUT_MS = 45e3;
@@ -7338,14 +7820,14 @@ function resolveTemplateSource(sourceRef, chartRoot, realChartRoot) {
7338
7820
  const segments = sourceRef.split(/[\\/]+/).filter((segment) => segment && segment !== ".");
7339
7821
  if (segments.length < 2)
7340
7822
  return null;
7341
- const candidate = path22.resolve(chartRoot, ...segments.slice(1));
7823
+ const candidate = path23.resolve(chartRoot, ...segments.slice(1));
7342
7824
  if (!isWithinIdentity(candidate, chartRoot))
7343
7825
  return null;
7344
7826
  try {
7345
- if (!fs9.lstatSync(candidate).isFile())
7827
+ if (!fs10.lstatSync(candidate).isFile())
7346
7828
  return null;
7347
- const root = realChartRoot ?? fs9.realpathSync(chartRoot);
7348
- if (!isWithinIdentity(fs9.realpathSync(candidate), root))
7829
+ const root = realChartRoot ?? fs10.realpathSync(chartRoot);
7830
+ if (!isWithinIdentity(fs10.realpathSync(candidate), root))
7349
7831
  return null;
7350
7832
  } catch {
7351
7833
  return null;
@@ -7354,13 +7836,13 @@ function resolveTemplateSource(sourceRef, chartRoot, realChartRoot) {
7354
7836
  }
7355
7837
  function canonicalChartRoot(chartRoot) {
7356
7838
  try {
7357
- return fs9.realpathSync(chartRoot);
7839
+ return fs10.realpathSync(chartRoot);
7358
7840
  } catch {
7359
7841
  return chartRoot;
7360
7842
  }
7361
7843
  }
7362
7844
  function chartYaml(chartRoot) {
7363
- return path22.join(chartRoot, "Chart.yaml");
7845
+ return path23.join(chartRoot, "Chart.yaml");
7364
7846
  }
7365
7847
  var HELM_INSTALL_HINT = "https://helm.sh/docs/intro/install/";
7366
7848
  var TRIVY_INSTALL_HINT = "https://trivy.dev/latest/getting-started/installation/";
@@ -7405,7 +7887,7 @@ function parseHelmTemplateFailure(raw, chartRoot) {
7405
7887
  continue;
7406
7888
  const location = extractTemplateRef(trimmed);
7407
7889
  const resolved = location ? resolveTemplateSource(location.ref, chartRoot, realRoot) : null;
7408
- const chartName = path22.basename(chartRoot);
7890
+ const chartName = path23.basename(chartRoot);
7409
7891
  diagnostics.push({
7410
7892
  id: `helm-render-error-${diagnostics.length + 1}`,
7411
7893
  message: resolved ? trimmed : `${trimmed} (helm template failed for chart ${chartName})`,
@@ -7593,12 +8075,12 @@ function collectRenderedFiles(root) {
7593
8075
  const dir = stack.pop();
7594
8076
  let entries;
7595
8077
  try {
7596
- entries = fs9.readdirSync(dir, { withFileTypes: true });
8078
+ entries = fs10.readdirSync(dir, { withFileTypes: true });
7597
8079
  } catch {
7598
8080
  continue;
7599
8081
  }
7600
8082
  for (const entry of entries) {
7601
- const full = path22.join(dir, entry.name);
8083
+ const full = path23.join(dir, entry.name);
7602
8084
  if (entry.isDirectory()) {
7603
8085
  stack.push(full);
7604
8086
  } else if (entry.isFile() && /\.ya?ml$/i.test(entry.name)) {
@@ -7632,7 +8114,7 @@ function readRenderedTree(outputDir, chartRoot) {
7632
8114
  for (const renderedPath of walk2.files) {
7633
8115
  let content;
7634
8116
  try {
7635
- content = fs9.readFileSync(renderedPath, "utf-8");
8117
+ content = fs10.readFileSync(renderedPath, "utf-8");
7636
8118
  } catch {
7637
8119
  unreadable += 1;
7638
8120
  continue;
@@ -7646,7 +8128,7 @@ function readRenderedTree(outputDir, chartRoot) {
7646
8128
  });
7647
8129
  manifests.push({
7648
8130
  renderedPath,
7649
- relativePath: path22.relative(outputDir, renderedPath),
8131
+ relativePath: path23.relative(outputDir, renderedPath),
7650
8132
  content,
7651
8133
  sourcePath: mapping.filePath,
7652
8134
  sourceMapped: mapping.mapped
@@ -7729,7 +8211,7 @@ async function runIacPass(options) {
7729
8211
  });
7730
8212
  }
7731
8213
  const report = parseRenderedTrivyOutput(scan.stdout || "", (target) => {
7732
- const hit = sourceByRendered.get(path22.resolve(outputDir, target));
8214
+ const hit = sourceByRendered.get(path23.resolve(outputDir, target));
7733
8215
  return hit ?? {
7734
8216
  filePath: chartYaml(chartRoot),
7735
8217
  detail: target || "rendered manifest"
@@ -7751,7 +8233,7 @@ function logRenderPass(filePath, chartRoot, startedAt, metadata) {
7751
8233
  metadata: { chartRoot, ...metadata }
7752
8234
  });
7753
8235
  }
7754
- function discardScratchDir(outputDir, filePath, remove = (target) => fs9.rmSync(target, { recursive: true, force: true })) {
8236
+ function discardScratchDir(outputDir, filePath, remove = (target) => fs10.rmSync(target, { recursive: true, force: true })) {
7755
8237
  try {
7756
8238
  remove(outputDir);
7757
8239
  } catch (error) {
@@ -7772,7 +8254,7 @@ async function renderAndValidate(chartRoot, cwd, filePath) {
7772
8254
  const helmCmd = await resolveToolCommandWithInstallFallback(cwd, "helm");
7773
8255
  if (!helmCmd)
7774
8256
  return helmUnavailableResult(cwd);
7775
- const outputDir = fs9.mkdtempSync(path22.join(scannerReportParentDir(), "pi-lens-helm-render-"));
8257
+ const outputDir = fs10.mkdtempSync(path23.join(scannerReportParentDir(), "pi-lens-helm-render-"));
7776
8258
  try {
7777
8259
  const render = await safeSpawnAsync(helmCmd, ["template", "pi-lens-render", chartRoot, "--output-dir", outputDir], {
7778
8260
  cwd,
@@ -7872,14 +8354,14 @@ var helmRenderRunner = {
7872
8354
  timeoutMs: RENDER_TIMEOUT_MS + TRIVY_TIMEOUT_MS + 1e4,
7873
8355
  async run(ctx) {
7874
8356
  const cwd = resolveRunnerCwd(ctx, "helm-render");
7875
- const workspaceRoot = path22.resolve(ctx.projectRoot ?? cwd);
8357
+ const workspaceRoot = path23.resolve(ctx.projectRoot ?? cwd);
7876
8358
  if (!isHelmRenderEnabled(workspaceRoot))
7877
8359
  return NOT_ENABLED;
7878
- const startDir = path22.dirname(path22.resolve(ctx.filePath));
8360
+ const startDir = path23.dirname(path23.resolve(ctx.filePath));
7879
8361
  const discovered = findNearestDirWithMarker(startDir, "chartYamlPath");
7880
8362
  if (!discovered)
7881
8363
  return SKIPPED2;
7882
- const chartRoot = path22.resolve(discovered);
8364
+ const chartRoot = path23.resolve(discovered);
7883
8365
  if (!isWithinIdentity(chartRoot, workspaceRoot))
7884
8366
  return SKIPPED2;
7885
8367
  if (getProjectTrustState() === "untrusted") {
@@ -7904,7 +8386,7 @@ var helmRenderRunner = {
7904
8386
  var helm_render_default = helmRenderRunner;
7905
8387
 
7906
8388
  // dist/clients/dispatch/runners/htmlhint.js
7907
- import * as path23 from "node:path";
8389
+ import * as path24 from "node:path";
7908
8390
  var HTMLHINT_RULES = {
7909
8391
  "tag-pair": true,
7910
8392
  "attr-no-duplication": true,
@@ -7915,13 +8397,13 @@ var HTMLHINT_RULES = {
7915
8397
  };
7916
8398
  function parseHtmlhintOutput(raw, filePath, cwd) {
7917
8399
  const diagnostics = [];
7918
- const absTarget = path23.resolve(cwd, filePath);
8400
+ const absTarget = path24.resolve(cwd, filePath);
7919
8401
  const lineRe = /^(.+?):(\d+):(\d+): (.+?) \[(error|warning)\/([^\]]+)\]/;
7920
8402
  for (const line of raw.split("\n")) {
7921
8403
  const match = line.match(lineRe);
7922
8404
  if (!match)
7923
8405
  continue;
7924
- if (!pathsEqual(path23.resolve(cwd, match[1]), absTarget))
8406
+ if (!pathsEqual(path24.resolve(cwd, match[1]), absTarget))
7925
8407
  continue;
7926
8408
  const lineNum = parseInt(match[2], 10);
7927
8409
  const col = parseInt(match[3], 10);
@@ -7965,7 +8447,7 @@ var htmlhintRunner = {
7965
8447
  rulesArg,
7966
8448
  "--format",
7967
8449
  "unix",
7968
- path23.resolve(cwd, ctx.filePath)
8450
+ path24.resolve(cwd, ctx.filePath)
7969
8451
  ], { cwd });
7970
8452
  const output = result.stdout || result.stderr || "";
7971
8453
  const run = parseToolRun("htmlhint", {
@@ -7995,18 +8477,18 @@ var htmlhintRunner = {
7995
8477
  var htmlhint_default = htmlhintRunner;
7996
8478
 
7997
8479
  // dist/clients/dispatch/runners/javac.js
7998
- import * as path24 from "node:path";
8480
+ import * as path25 from "node:path";
7999
8481
  var javac = createAvailabilityChecker("javac", ".exe");
8000
8482
  function parseJavacOutput(raw, filePath, cwd) {
8001
8483
  const diagnostics = [];
8002
8484
  const lines = raw.split(/\r?\n/);
8003
- const absTarget = path24.resolve(cwd, filePath);
8485
+ const absTarget = path25.resolve(cwd, filePath);
8004
8486
  for (const line of lines) {
8005
8487
  const match = line.match(/^(.*?\.java):(\d+):\s+(error|warning):\s+(.+)$/i);
8006
8488
  if (!match)
8007
8489
  continue;
8008
8490
  const [, reportedFile, lineStr, severityLabel, message] = match;
8009
- if (!pathsEqual(path24.resolve(cwd, reportedFile.trim()), absTarget))
8491
+ if (!pathsEqual(path25.resolve(cwd, reportedFile.trim()), absTarget))
8010
8492
  continue;
8011
8493
  const severity = severityLabel.toLowerCase() === "error" ? "error" : "warning";
8012
8494
  const lineNum = Number.parseInt(lineStr, 10) || 1;
@@ -8034,9 +8516,9 @@ var javacRunner = {
8034
8516
  skipTestFiles: false,
8035
8517
  async run(ctx) {
8036
8518
  const cwd = resolveRunnerCwd(ctx, "javac");
8037
- const absPath = path24.resolve(cwd, ctx.filePath);
8038
- if (hasToolConfig("javaBuild", path24.dirname(absPath), {
8039
- ceiling: ctx.projectRoot ?? ctx.cwd
8519
+ const absPath = path25.resolve(cwd, ctx.filePath);
8520
+ if (hasToolConfig("javaBuild", path25.dirname(absPath), {
8521
+ ceiling: configCeiling(ctx.cwd, ctx.projectRoot)
8040
8522
  })) {
8041
8523
  ctx.log?.("javac: skipped \u2014 file is inside a Maven/Gradle project; a classpath-less compile would emit false positives");
8042
8524
  return { status: "skipped", diagnostics: [], semantic: "none" };
@@ -8077,7 +8559,7 @@ ${result.stderr ?? ""}`.trim();
8077
8559
  var javac_default = javacRunner;
8078
8560
 
8079
8561
  // dist/clients/dispatch/runners/ktlint.js
8080
- import * as path25 from "node:path";
8562
+ import * as path26 from "node:path";
8081
8563
  var KTLINT_EXIT_CODES = { ran: [1, 2, 3] };
8082
8564
  function normalizeKtlintResults(parsed) {
8083
8565
  if (Array.isArray(parsed)) {
@@ -8116,9 +8598,9 @@ function parseKtlintOutput(raw, filePath, cwd) {
8116
8598
  return null;
8117
8599
  const autofix = getAutofixCapability("ktlint");
8118
8600
  const diagnostics = [];
8119
- const absTarget = path25.resolve(cwd, filePath);
8601
+ const absTarget = path26.resolve(cwd, filePath);
8120
8602
  for (const result of parsed) {
8121
- if (result.file && !pathsEqual(path25.resolve(cwd, result.file), absTarget))
8603
+ if (result.file && !pathsEqual(path26.resolve(cwd, result.file), absTarget))
8122
8604
  continue;
8123
8605
  for (const err of result.errors ?? []) {
8124
8606
  diagnostics.push({
@@ -8156,7 +8638,7 @@ var ktlintRunner = {
8156
8638
  const cmd = await resolveToolCommandWithInstallFallback(cwd, "ktlint");
8157
8639
  if (!cmd)
8158
8640
  return toolAbsentSkip(cwd, { id: "ktlint" });
8159
- const absPath = path25.resolve(cwd, ctx.filePath);
8641
+ const absPath = path26.resolve(cwd, ctx.filePath);
8160
8642
  const result = await safeSpawnAsync(cmd, ["--reporter=json", absPath], {
8161
8643
  cwd,
8162
8644
  timeout: 3e4
@@ -8481,32 +8963,32 @@ var lspRunner = {
8481
8963
  var lsp_default = lspRunner;
8482
8964
 
8483
8965
  // dist/clients/dispatch/runners/markdownlint.js
8484
- import * as path27 from "node:path";
8966
+ import * as path28 from "node:path";
8485
8967
 
8486
8968
  // dist/clients/dispatch/runners/utils/markdownlint-api.js
8487
- import * as fs10 from "node:fs";
8488
- import * as path26 from "node:path";
8969
+ import * as fs11 from "node:fs";
8970
+ import * as path27 from "node:path";
8489
8971
  var PACKAGE_NAME = "markdownlint-cli2";
8490
8972
  function locateCli2Entry(command) {
8491
8973
  const shim = /[\\/]/.test(command) ? command : findCommandOnPath(command, process.platform === "win32");
8492
8974
  if (!shim)
8493
8975
  return null;
8494
- const shimDir = path26.dirname(shim);
8976
+ const shimDir = path27.dirname(shim);
8495
8977
  const candidates = [
8496
- path26.join(shimDir, "..", PACKAGE_NAME),
8497
- path26.join(shimDir, "node_modules", PACKAGE_NAME)
8978
+ path27.join(shimDir, "..", PACKAGE_NAME),
8979
+ path27.join(shimDir, "node_modules", PACKAGE_NAME)
8498
8980
  ];
8499
- candidates.push(path26.dirname(realpathOrResolve(shim)));
8981
+ candidates.push(path27.dirname(realpathOrResolve(shim)));
8500
8982
  for (const dir of candidates) {
8501
8983
  try {
8502
- const manifest = JSON.parse(fs10.readFileSync(path26.join(dir, "package.json"), "utf8"));
8984
+ const manifest = JSON.parse(fs11.readFileSync(path27.join(dir, "package.json"), "utf8"));
8503
8985
  if (manifest.name !== PACKAGE_NAME)
8504
8986
  continue;
8505
8987
  const root = manifest.exports && typeof manifest.exports === "object" ? manifest.exports["."] : manifest.exports;
8506
8988
  if (typeof root !== "string")
8507
8989
  continue;
8508
- const entry = path26.resolve(dir, root);
8509
- if (fs10.statSync(entry).isFile())
8990
+ const entry = path27.resolve(dir, root);
8991
+ if (fs11.statSync(entry).isFile())
8510
8992
  return entry;
8511
8993
  } catch {
8512
8994
  }
@@ -8570,7 +9052,7 @@ var MARKDOWNLINT_FIXABLE_RULES = /* @__PURE__ */ new Set([
8570
9052
  ]);
8571
9053
  function parseMarkdownlintOutput(raw, filePath, cwd) {
8572
9054
  const diagnostics = [];
8573
- const absTarget = path27.resolve(cwd, filePath);
9055
+ const absTarget = path28.resolve(cwd, filePath);
8574
9056
  for (const line of raw.split(/\r?\n/)) {
8575
9057
  if (!line.trim())
8576
9058
  continue;
@@ -8578,7 +9060,7 @@ function parseMarkdownlintOutput(raw, filePath, cwd) {
8578
9060
  if (!match)
8579
9061
  continue;
8580
9062
  const [, reported, lineNum, col, ruleCode, message] = match;
8581
- if (reported && !pathsEqual(path27.resolve(cwd, reported), absTarget))
9063
+ if (reported && !pathsEqual(path28.resolve(cwd, reported), absTarget))
8582
9064
  continue;
8583
9065
  const ruleName = ruleCode.split("/")[0];
8584
9066
  const fixable = MARKDOWNLINT_FIXABLE_RULES.has(ruleName);
@@ -8642,7 +9124,7 @@ var markdownlintRunner = {
8642
9124
  var markdownlint_default = markdownlintRunner;
8643
9125
 
8644
9126
  // dist/clients/dispatch/runners/mypy.js
8645
- import * as path28 from "node:path";
9127
+ import * as path29 from "node:path";
8646
9128
  var MYPY_EXIT_CODES = { ran: [1, 2] };
8647
9129
  function parseMypyOutput(raw, fallbackPath, cwd) {
8648
9130
  const diagnostics = [];
@@ -8655,7 +9137,7 @@ function parseMypyOutput(raw, fallbackPath, cwd) {
8655
9137
  continue;
8656
9138
  const severity = level === "error" ? "error" : "warning";
8657
9139
  const rule = errorCode ?? "mypy";
8658
- const filePath = file && file.trim() ? path28.isAbsolute(file) ? file : path28.resolve(cwd, file) : fallbackPath;
9140
+ const filePath = file && file.trim() ? path29.isAbsolute(file) ? file : path29.resolve(cwd, file) : fallbackPath;
8659
9141
  diagnostics.push({
8660
9142
  id: `mypy-${lineNum}-${rule}`,
8661
9143
  message: errorCode ? `[${errorCode}] ${message}` : message,
@@ -8702,7 +9184,7 @@ var mypyRunner = {
8702
9184
  var mypy_default = mypyRunner;
8703
9185
 
8704
9186
  // dist/clients/dispatch/runners/oxlint.js
8705
- import * as path29 from "node:path";
9187
+ import * as path30 from "node:path";
8706
9188
  var MAX_OXLINT_OUTPUT_BYTES = 8 * 1024 * 1024;
8707
9189
  var OXLINT_NO_FILES = /* @__PURE__ */ Symbol("oxlint-no-files");
8708
9190
  var OXLINT_NO_FILES_UNCONFIRMED = /* @__PURE__ */ Symbol("oxlint-no-files-unconfirmed");
@@ -8938,9 +9420,9 @@ function parseOxlintJson(raw, filePath, cwd) {
8938
9420
  if (!Array.isArray(parsed.diagnostics))
8939
9421
  return [];
8940
9422
  const diagnostics = [];
8941
- const absTarget = path29.resolve(cwd, filePath);
9423
+ const absTarget = path30.resolve(cwd, filePath);
8942
9424
  for (const d of parsed.diagnostics) {
8943
- if (!d.filename || !pathsEqual(path29.resolve(cwd, d.filename), absTarget)) {
9425
+ if (!d.filename || !pathsEqual(path30.resolve(cwd, d.filename), absTarget)) {
8944
9426
  continue;
8945
9427
  }
8946
9428
  const rule = extractOxlintRule(d.code);
@@ -8970,14 +9452,14 @@ function parseOxlintJson(raw, filePath, cwd) {
8970
9452
  }
8971
9453
  function parseOxlintUnix(raw, filePath, cwd) {
8972
9454
  const diagnostics = [];
8973
- const absTarget = path29.resolve(cwd, filePath);
9455
+ const absTarget = path30.resolve(cwd, filePath);
8974
9456
  for (const line of raw.split("\n")) {
8975
9457
  const match = line.match(/^(.+):(\d+):(\d+):\s*(.+?)\s*\(([^)]+)\)$/);
8976
9458
  if (match) {
8977
9459
  const [, reportedPath, lineStr, _col, message, rule] = match;
8978
9460
  if (!reportedPath || !lineStr || !message || !rule)
8979
9461
  continue;
8980
- if (!pathsEqual(path29.resolve(cwd, reportedPath), absTarget))
9462
+ if (!pathsEqual(path30.resolve(cwd, reportedPath), absTarget))
8981
9463
  continue;
8982
9464
  diagnostics.push({
8983
9465
  id: `oxlint-${rule}-${lineStr}`,
@@ -8996,7 +9478,7 @@ function parseOxlintUnix(raw, filePath, cwd) {
8996
9478
  var oxlint_default = oxlintRunner;
8997
9479
 
8998
9480
  // dist/clients/dispatch/runners/php-lint.js
8999
- import * as path30 from "node:path";
9481
+ import * as path31 from "node:path";
9000
9482
  var PHP_LINT_EXIT_CODES = { ran: [1, 255] };
9001
9483
  var php = createAvailabilityChecker("php", ".exe");
9002
9484
  function parsePhpLintOutput(raw, filePath, cwd) {
@@ -9006,7 +9488,7 @@ function parsePhpLintOutput(raw, filePath, cwd) {
9006
9488
  const lineMatch = output.match(/on line (\d+)/i);
9007
9489
  const messageMatch = output.match(/PHP Parse error:\s*(.+?)(?:\s+in\s+(.+?)\s+on line \d+)?$/im) ?? output.match(/Parse error:\s*(.+?)(?:\s+in\s+(.+?)\s+on line \d+)?$/im);
9008
9490
  const reported = messageMatch?.[2]?.trim();
9009
- if (reported && !pathsEqual(path30.resolve(cwd, reported), path30.resolve(cwd, filePath)))
9491
+ if (reported && !pathsEqual(path31.resolve(cwd, reported), path31.resolve(cwd, filePath)))
9010
9492
  return [];
9011
9493
  return [
9012
9494
  {
@@ -9033,7 +9515,7 @@ var phpLintRunner = {
9033
9515
  const cmd = ctx.analysisRootMode === "adopted" ? resolveAdoptedRootCommand("php", ctx, cwd) : await php.isAvailableAsync(cwd) ? php.getCommand(cwd) : null;
9034
9516
  if (!cmd)
9035
9517
  return toolAbsentSkip(cwd, { checker: php });
9036
- const absPath = path30.resolve(cwd, ctx.filePath);
9518
+ const absPath = path31.resolve(cwd, ctx.filePath);
9037
9519
  const result = await safeSpawnAsync(cmd, ["-l", absPath], {
9038
9520
  timeout: 15e3,
9039
9521
  cwd
@@ -9058,7 +9540,7 @@ ${result.stderr ?? ""}`,
9058
9540
  var php_lint_default = phpLintRunner;
9059
9541
 
9060
9542
  // dist/clients/dispatch/runners/phpstan.js
9061
- import * as path31 from "node:path";
9543
+ import * as path32 from "node:path";
9062
9544
  var PHPSTAN_EXIT_CODES = { ran: [1] };
9063
9545
  var phpstan = createAvailabilityChecker("phpstan", ".phar");
9064
9546
  function parsePhpstanJson(raw, fallbackPath, cwd) {
@@ -9066,7 +9548,7 @@ function parsePhpstanJson(raw, fallbackPath, cwd) {
9066
9548
  const output = JSON.parse(raw);
9067
9549
  const diagnostics = [];
9068
9550
  for (const [file, fileErrors] of Object.entries(output.files ?? {})) {
9069
- const filePath = file && file.trim() ? path31.isAbsolute(file) ? file : path31.resolve(cwd, file) : fallbackPath;
9551
+ const filePath = file && file.trim() ? path32.isAbsolute(file) ? file : path32.resolve(cwd, file) : fallbackPath;
9070
9552
  for (const err of fileErrors?.messages ?? []) {
9071
9553
  diagnostics.push({
9072
9554
  id: `phpstan:${err.line ?? 1}:${err.message.slice(0, 40)}`,
@@ -9108,6 +9590,180 @@ async function resolvePhpstan(cwd) {
9108
9590
  return phpstan.getCommand(cwd);
9109
9591
  return resolveVendorToolCommand(cwd, "phpstan", ".bat");
9110
9592
  }
9593
+ var PHPSTAN_DUMP_TIMEOUT_MS = 15e3;
9594
+ var PHPSTAN_DOTTED_CONFIGS = [
9595
+ ".phpstan.neon",
9596
+ ".phpstan.neon.dist",
9597
+ ".phpstan.dist.neon"
9598
+ ];
9599
+ function phpstanConfigMayExclude(text) {
9600
+ return /exclude|includes/i.test(text) || /ignoreErrors[\s\S]*\bpaths?['"]?\s*:/i.test(text);
9601
+ }
9602
+ function neonString(value) {
9603
+ return JSON.stringify(value).replace(/%/g, "%%");
9604
+ }
9605
+ function neonValue(value) {
9606
+ if (typeof value === "string")
9607
+ return neonString(value);
9608
+ if (Array.isArray(value))
9609
+ return `[${value.map(neonValue).join(", ")}]`;
9610
+ if (typeof value === "object" && value !== null) {
9611
+ return `{${Object.entries(value).map(([key, entry]) => `${neonString(key)}: ${neonValue(entry)}`).join(", ")}}`;
9612
+ }
9613
+ return JSON.stringify(value) ?? "null";
9614
+ }
9615
+ function keptPath(entry) {
9616
+ return /[*?[]/.test(entry) || pathExists(entry) ? entry : `${entry} (?)`;
9617
+ }
9618
+ function anchorPathList(name, entries, root) {
9619
+ const out = [];
9620
+ let touched = false;
9621
+ for (const entry of entries) {
9622
+ const anchored = anchorIgnorePattern(entry, root, "fnmatch");
9623
+ if (anchored === null) {
9624
+ return {
9625
+ unapplied: `${name} entry ${JSON.stringify(entry)} is not a form it can anchor`
9626
+ };
9627
+ }
9628
+ if (anchored.length === 1 && anchored[0] === entry) {
9629
+ out.push(keptPath(entry));
9630
+ continue;
9631
+ }
9632
+ touched = true;
9633
+ out.push(...anchored);
9634
+ }
9635
+ return { entries: out, touched };
9636
+ }
9637
+ function anchorIgnoreErrors(entries, root) {
9638
+ const out = [];
9639
+ let touched = false;
9640
+ const sharedPath = /* @__PURE__ */ new Map();
9641
+ for (const entry of entries) {
9642
+ const singular = entry?.path;
9643
+ if (singular !== void 0) {
9644
+ sharedPath.set(singular, (sharedPath.get(singular) ?? 0) + 1);
9645
+ }
9646
+ }
9647
+ for (const entry of entries) {
9648
+ if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
9649
+ out.push(entry);
9650
+ continue;
9651
+ }
9652
+ const map = { ...entry };
9653
+ const singular = map.path;
9654
+ const plural = map.paths;
9655
+ if (singular !== void 0 && typeof singular !== "string") {
9656
+ return { unapplied: "an ignoreErrors path is not a string" };
9657
+ }
9658
+ if (plural !== void 0 && !(Array.isArray(plural) && plural.every((p) => typeof p === "string"))) {
9659
+ return { unapplied: "an ignoreErrors paths is not a list of strings" };
9660
+ }
9661
+ const parts = [
9662
+ ...typeof singular === "string" ? [singular] : [],
9663
+ ...plural ?? []
9664
+ ];
9665
+ const anchored = anchorPathList("ignoreErrors path", parts, root);
9666
+ if ("unapplied" in anchored)
9667
+ return anchored;
9668
+ if (anchored.touched) {
9669
+ touched = true;
9670
+ if (typeof singular === "string") {
9671
+ if (map.count !== void 0) {
9672
+ return {
9673
+ unapplied: `an ignoreErrors entry with count names the wildcard path ${JSON.stringify(singular)}`
9674
+ };
9675
+ }
9676
+ if ((sharedPath.get(singular) ?? 0) > 1) {
9677
+ return {
9678
+ unapplied: `two ignoreErrors entries share the wildcard path ${JSON.stringify(singular)}`
9679
+ };
9680
+ }
9681
+ }
9682
+ delete map.path;
9683
+ map.paths = [...new Set(anchored.entries)];
9684
+ }
9685
+ out.push(map);
9686
+ }
9687
+ return { entries: out, touched };
9688
+ }
9689
+ function anchorPhpstanConfig(dump, userConfig, root) {
9690
+ if (dump.status !== 0) {
9691
+ return {
9692
+ kind: "unapplied",
9693
+ reason: `phpstan dump-parameters exited ${dump.status ?? "without a status"}`
9694
+ };
9695
+ }
9696
+ let parameters;
9697
+ try {
9698
+ parameters = JSON.parse(dump.stdout ?? "");
9699
+ } catch {
9700
+ return {
9701
+ kind: "unapplied",
9702
+ reason: "phpstan dump-parameters printed no JSON"
9703
+ };
9704
+ }
9705
+ const excludePaths = parameters?.excludePaths;
9706
+ if (typeof excludePaths !== "object" || excludePaths === null || Array.isArray(excludePaths)) {
9707
+ return {
9708
+ kind: "unapplied",
9709
+ reason: "phpstan dump-parameters printed no excludePaths object"
9710
+ };
9711
+ }
9712
+ const lists = {
9713
+ analyse: [],
9714
+ analyseAndScan: []
9715
+ };
9716
+ let excludeTouched = false;
9717
+ for (const [name, entries] of Object.entries(excludePaths)) {
9718
+ if (name !== "analyse" && name !== "analyseAndScan") {
9719
+ return {
9720
+ kind: "unapplied",
9721
+ reason: `phpstan excludePaths has an unknown list ${JSON.stringify(name)}`
9722
+ };
9723
+ }
9724
+ if (!Array.isArray(entries) || !entries.every((entry) => typeof entry === "string")) {
9725
+ return {
9726
+ kind: "unapplied",
9727
+ reason: `phpstan excludePaths.${name} is not a list of strings`
9728
+ };
9729
+ }
9730
+ const anchored = anchorPathList(`excludePaths.${name}`, entries, root);
9731
+ if ("unapplied" in anchored) {
9732
+ return { kind: "unapplied", reason: anchored.unapplied };
9733
+ }
9734
+ lists[name] = anchored.entries;
9735
+ excludeTouched ||= anchored.touched;
9736
+ }
9737
+ const ignoreDumped = parameters?.ignoreErrors ?? [];
9738
+ if (!Array.isArray(ignoreDumped)) {
9739
+ return {
9740
+ kind: "unapplied",
9741
+ reason: "phpstan dump-parameters printed ignoreErrors that is not a list"
9742
+ };
9743
+ }
9744
+ const ignored = anchorIgnoreErrors(ignoreDumped, root);
9745
+ if ("unapplied" in ignored) {
9746
+ return { kind: "unapplied", reason: ignored.unapplied };
9747
+ }
9748
+ if (!excludeTouched && !ignored.touched)
9749
+ return { kind: "unchanged" };
9750
+ const block = (name) => lists[name].length === 0 ? ` ${name}: []
9751
+ ` : ` ${name}:
9752
+ ${lists[name].map((entry) => ` - ${neonString(entry)}
9753
+ `).join("")}`;
9754
+ const excludeText = excludeTouched ? ` excludePaths!:
9755
+ ${block("analyse")}${block("analyseAndScan")}` : "";
9756
+ const ignoreText = ignored.touched ? ` ignoreErrors!:
9757
+ ${ignored.entries.map((entry) => ` - ${neonValue(entry)}
9758
+ `).join("")}` : "";
9759
+ return {
9760
+ kind: "rewritten",
9761
+ text: `includes:
9762
+ - ${neonString(userConfig)}
9763
+ parameters:
9764
+ ${excludeText}${ignoreText}`
9765
+ };
9766
+ }
9111
9767
  var phpstanRunner = {
9112
9768
  id: "phpstan",
9113
9769
  appliesTo: ["php"],
@@ -9130,25 +9786,45 @@ var phpstanRunner = {
9130
9786
  checker: phpstan,
9131
9787
  trustRefused: isLocalBinTrustRefusal(lookup)
9132
9788
  });
9133
- const absPath = path31.resolve(cwd, ctx.filePath);
9134
- const result = await safeSpawnAsync(cmd, ["analyse", "--error-format=json", "--no-progress", absPath], { timeout: 3e4, cwd });
9789
+ const absPath = path32.resolve(cwd, ctx.filePath);
9790
+ let anchored = { kind: "unchanged" };
9791
+ const ownConfig = findToolConfig("phpstan", cwd, { ceiling: cwd })?.file;
9792
+ const read = ownConfig ? readConfigText("phpstan", ownConfig) : void 0;
9793
+ const dotted = ownConfig ? PHPSTAN_DOTTED_CONFIGS.find((name) => pathExists(path32.join(cwd, name))) : void 0;
9794
+ if (dotted) {
9795
+ anchored = {
9796
+ kind: "unapplied",
9797
+ reason: `phpstan may read ${dotted} in place of ${path32.basename(ownConfig ?? "")}`
9798
+ };
9799
+ } else if (read?.kind === "unapplied")
9800
+ anchored = read;
9801
+ if (!dotted && ownConfig && read?.kind === "read" && phpstanConfigMayExclude(read.text)) {
9802
+ const dump = await safeSpawnAsync(cmd, ["dump-parameters", "--json"], {
9803
+ cwd,
9804
+ timeout: PHPSTAN_DUMP_TIMEOUT_MS
9805
+ });
9806
+ anchored = anchorPhpstanConfig(dump, path32.resolve(cwd, ownConfig), cwd);
9807
+ }
9808
+ const analyse = (config) => safeSpawnAsync(cmd, ["analyse", "--error-format=json", "--no-progress", ...config, absPath], { timeout: 3e4, cwd });
9809
+ const result = anchored.kind === "rewritten" ? await withOverlayFile("phpstan", "phpstan.neon", anchored.text, (file) => analyse(["-c", file])) : await analyse([]);
9135
9810
  const run = parseToolRun("phpstan", { result, exitCodes: PHPSTAN_EXIT_CODES }, (out) => parsePhpstanJson(out, ctx.filePath, cwd), { parseOutput: result.stdout ?? "" });
9136
9811
  if (run.skipped)
9137
9812
  return run.skipped;
9138
9813
  const diagnostics = run.diagnostics;
9139
- return finishParsedRun({
9814
+ const verdict = finishParsedRun({
9140
9815
  tool: "phpstan",
9141
9816
  ctx,
9142
9817
  result,
9143
9818
  diagnostics,
9144
9819
  classify: () => ({ status: "failed", semantic: "blocking" })
9145
9820
  });
9821
+ return anchored.kind === "unapplied" ? markUnanchored("phpstan", anchored.reason, verdict) : verdict;
9146
9822
  }
9147
9823
  };
9148
9824
  var phpstan_default = phpstanRunner;
9149
9825
 
9150
9826
  // dist/clients/dispatch/runners/prisma-validate.js
9151
- import * as path32 from "node:path";
9827
+ import * as path33 from "node:path";
9152
9828
  var PRISMA_VALIDATION_REPORT = /\bValidation Error Count:\s*\d+/;
9153
9829
  function parsePrismaValidateOutput(raw, filePath) {
9154
9830
  const output = raw.split("\n").map((line) => line.trim()).filter(Boolean).filter((line) => !line.startsWith("Environment variables loaded")).filter((line) => !line.startsWith("Prisma schema loaded")).join(" ");
@@ -9179,7 +9855,7 @@ var prismaValidateRunner = {
9179
9855
  async run(ctx) {
9180
9856
  const cwd = resolveRunnerCwd(ctx, "prisma-validate");
9181
9857
  const resolved = await resolveLocalFirstAsync("prisma", cwd);
9182
- const absPath = path32.resolve(cwd, ctx.filePath);
9858
+ const absPath = path33.resolve(cwd, ctx.filePath);
9183
9859
  const result = await safeSpawnAsync(resolved.cmd, [...resolved.args, "validate", "--schema", absPath], {
9184
9860
  timeout: 2e4,
9185
9861
  // ONE neutral-cwd seam for npx fallbacks (#4193, #4268 acceptance 3),
@@ -9218,8 +9894,8 @@ ${result.stderr ?? ""}`;
9218
9894
  var prisma_validate_default = prismaValidateRunner;
9219
9895
 
9220
9896
  // dist/clients/dispatch/runners/psscriptanalyzer.js
9221
- import * as fs11 from "node:fs/promises";
9222
- import * as path33 from "node:path";
9897
+ import * as fs12 from "node:fs/promises";
9898
+ import * as path34 from "node:path";
9223
9899
  var PS_SCRIPT = `
9224
9900
  param([string]$FilePath)
9225
9901
  Import-Module PSScriptAnalyzer -ErrorAction Stop
@@ -9422,9 +10098,9 @@ var psScriptAnalyzerRunner = {
9422
10098
  return { status: "skipped", diagnostics: [], semantic: "none" };
9423
10099
  }
9424
10100
  const cwd = resolveRunnerCwd(ctx, "psscriptanalyzer");
9425
- const absPath = path33.resolve(cwd, ctx.filePath);
9426
- const tmpScript = path33.join(scannerReportParentDir(), `pi-lens-psa-${process.pid}.ps1`);
9427
- await fs11.writeFile(tmpScript, PS_SCRIPT, "utf-8");
10101
+ const absPath = path34.resolve(cwd, ctx.filePath);
10102
+ const tmpScript = path34.join(scannerReportParentDir(), `pi-lens-psa-${process.pid}.ps1`);
10103
+ await fs12.writeFile(tmpScript, PS_SCRIPT, "utf-8");
9428
10104
  try {
9429
10105
  const sampler = startHostStallSampler();
9430
10106
  const startedAt = Date.now();
@@ -9524,7 +10200,7 @@ var psScriptAnalyzerRunner = {
9524
10200
  semantic: hasErrors ? "blocking" : "warning"
9525
10201
  });
9526
10202
  } finally {
9527
- await fs11.unlink(tmpScript).catch(() => {
10203
+ await fs12.unlink(tmpScript).catch(() => {
9528
10204
  });
9529
10205
  }
9530
10206
  }
@@ -9532,7 +10208,6 @@ var psScriptAnalyzerRunner = {
9532
10208
  var psscriptanalyzer_default = psScriptAnalyzerRunner;
9533
10209
 
9534
10210
  // dist/clients/dispatch/runners/pyright.js
9535
- var pyright = createAvailabilityChecker("pyright", ".exe");
9536
10211
  var pyrightRunner = {
9537
10212
  id: "pyright",
9538
10213
  appliesTo: ["python"],
@@ -9544,24 +10219,9 @@ var pyrightRunner = {
9544
10219
  await lspService.getClientForFile(ctx.filePath);
9545
10220
  }
9546
10221
  const cwd = resolveRunnerCwd(ctx, "pyright");
9547
- let cmd = null;
9548
- if (await pyright.isAvailableAsync(cwd)) {
9549
- cmd = pyright.getCommand(cwd);
9550
- }
9551
- if (!cmd) {
9552
- const installedPath = await resolveAvailableOrInstall(pyright, "pyright", cwd);
9553
- if (installedPath)
9554
- cmd = installedPath;
9555
- }
9556
- if (!cmd) {
9557
- const { findCommandAsync } = await import("./chunk-H5API74E.js");
9558
- const foundCmd = await findCommandAsync("pyright");
9559
- if (foundCmd)
9560
- cmd = foundCmd;
9561
- }
9562
- if (!cmd) {
9563
- return toolAbsentSkip(cwd, { id: "pyright", checker: pyright });
9564
- }
10222
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "pyright");
10223
+ if (!cmd)
10224
+ return toolAbsentSkip(cwd, { id: "pyright" });
9565
10225
  const pythonEnvironment = await detectPythonEnvironment(cwd);
9566
10226
  const env = augmentPythonEnvironment(process.env, pythonEnvironment);
9567
10227
  const result = await safeSpawnAsync(cmd, ["--outputjson", ctx.filePath], {
@@ -9659,7 +10319,7 @@ function parsePyrightOutput(data, _filePath) {
9659
10319
  var pyright_default = pyrightRunner;
9660
10320
 
9661
10321
  // dist/clients/dispatch/runners/rubocop.js
9662
- import * as path34 from "node:path";
10322
+ import * as path35 from "node:path";
9663
10323
  var SEVERITY_MAP = {
9664
10324
  fatal: "error",
9665
10325
  error: "error",
@@ -9672,9 +10332,9 @@ function parseRubocopJson(raw, filePath, cwd) {
9672
10332
  const output = JSON.parse(raw);
9673
10333
  const autofix = getAutofixCapability("rubocop");
9674
10334
  const diagnostics = [];
9675
- const absTarget = path34.resolve(cwd, filePath);
10335
+ const absTarget = path35.resolve(cwd, filePath);
9676
10336
  for (const file of output.files) {
9677
- if (file.path && !pathsEqual(path34.resolve(cwd, file.path), absTarget))
10337
+ if (file.path && !pathsEqual(path35.resolve(cwd, file.path), absTarget))
9678
10338
  continue;
9679
10339
  for (const offense of file.offenses) {
9680
10340
  const severity = SEVERITY_MAP[offense.severity] ?? "warning";
@@ -9709,13 +10369,9 @@ var rubocopRunner = {
9709
10369
  if (policy && !policy.preferredRunners.includes("rubocop")) {
9710
10370
  return skipped("not-preferred");
9711
10371
  }
9712
- let verdict = null;
9713
- const resolved = await resolveCommandArgsWithInstallFallback(getRubocopCommand(cwd), "rubocop", cwd, ["--version"], 1e4, (found) => {
9714
- verdict = found;
9715
- });
9716
- if (!resolved) {
9717
- return toolAbsentSkip(cwd, { id: "rubocop", verdict });
9718
- }
10372
+ const resolved = await resolveRubocopCommand(getRubocopCommand(cwd), cwd);
10373
+ if (!resolved)
10374
+ return toolAbsentSkip(cwd, { id: "rubocop" });
9719
10375
  const { cmd, args } = resolved;
9720
10376
  const result = await safeSpawnAsync(cmd, [...args, "--format", "json", "--no-color", ctx.filePath], { timeout: 3e4, cwd });
9721
10377
  const run = parseToolRun("rubocop", { result, exitCodes: { ran: [1, 2] } }, (output) => parseRubocopJson(output, ctx.filePath, cwd), { parseStreams: "stdout-else-stderr" });
@@ -9765,6 +10421,7 @@ var ruffRunner = {
9765
10421
  id: "ruff-lint",
9766
10422
  appliesTo: ["python"],
9767
10423
  priority: PRIORITY.FORMAT_AND_LINT_PRIMARY,
10424
+ lintsGivenContent: true,
9768
10425
  async run(ctx) {
9769
10426
  const cwd = resolveRunnerCwd2(ctx, "ruff");
9770
10427
  const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
@@ -9783,8 +10440,14 @@ var ruffRunner = {
9783
10440
  "--output-format",
9784
10441
  "json",
9785
10442
  ...configArgs,
9786
- ctx.filePath
9787
- ], { cwd, timeout: 3e4 });
10443
+ // #5621: given bytes arrive on stdin under the file's real path, so
10444
+ // the config, the ignores and the reported filename are the file's.
10445
+ ...ctx.givenContent === void 0 ? [ctx.filePath] : ["--stdin-filename", ctx.filePath, "-"]
10446
+ ], {
10447
+ cwd,
10448
+ timeout: 3e4,
10449
+ ...ctx.givenContent !== void 0 && { input: ctx.givenContent }
10450
+ });
9788
10451
  const run = parseToolRun("ruff", { result: checkResult, exitCodes: { ran: [1, 2] } }, (rawOutput) => {
9789
10452
  const output = stripAnsi(rawOutput);
9790
10453
  const diagnostics = parseRuffJson(output, ctx.filePath);
@@ -9968,9 +10631,8 @@ var rust_clippy_default = rustClippyRunner;
9968
10631
 
9969
10632
  // dist/clients/dispatch/runners/spotbugs.js
9970
10633
  import { randomUUID } from "node:crypto";
9971
- import * as fs12 from "node:fs";
9972
- import * as path35 from "node:path";
9973
- var spotbugs = createAvailabilityChecker("spotbugs", ".bat", ["-version"]);
10634
+ import * as fs13 from "node:fs";
10635
+ import * as path36 from "node:path";
9974
10636
  var MAX_DIAGNOSTICS = 50;
9975
10637
  var MAX_XML_BYTES = 4 * 1024 * 1024;
9976
10638
  var scanCache = new BoundedLruCache(32);
@@ -9984,18 +10646,18 @@ function classesSignature(classesDir) {
9984
10646
  break;
9985
10647
  let entries;
9986
10648
  try {
9987
- entries = fs12.readdirSync(dir, { withFileTypes: true });
10649
+ entries = fs13.readdirSync(dir, { withFileTypes: true });
9988
10650
  } catch {
9989
10651
  continue;
9990
10652
  }
9991
10653
  for (const entry of entries) {
9992
- const full = path35.join(dir, entry.name);
10654
+ const full = path36.join(dir, entry.name);
9993
10655
  if (entry.isDirectory()) {
9994
10656
  stack.push(full);
9995
10657
  } else if (entry.isFile() && entry.name.endsWith(".class")) {
9996
10658
  count++;
9997
10659
  try {
9998
- const m = fs12.statSync(full).mtimeMs;
10660
+ const m = fs13.statSync(full).mtimeMs;
9999
10661
  if (m > newest)
10000
10662
  newest = m;
10001
10663
  } catch {
@@ -10080,7 +10742,7 @@ function parseSpotbugsXml(raw) {
10080
10742
  const message = shortMsg || longMsg || type;
10081
10743
  const fixSuggestion = longMsg ? firstSentence(longMsg) : void 0;
10082
10744
  diagnostics.push({
10083
- id: `spotbugs:${type}:${path35.basename(filePath)}:${line}:${index}`,
10745
+ id: `spotbugs:${type}:${path36.basename(filePath)}:${line}:${index}`,
10084
10746
  message: `[${type}] ${message}`,
10085
10747
  filePath,
10086
10748
  line,
@@ -10128,10 +10790,10 @@ var spotbugsRunner = {
10128
10790
  semantic: cached.diagnostics.length > 0 ? "warning" : "none"
10129
10791
  };
10130
10792
  }
10131
- const cmd = await resolveAvailableOrInstall(spotbugs, "spotbugs", cwd);
10793
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "spotbugs");
10132
10794
  if (!cmd)
10133
- return toolAbsentSkip(cwd, { id: "spotbugs", checker: spotbugs });
10134
- const tmpXml = path35.join(scannerReportParentDir(), `pi-lens-spotbugs-${process.pid}-${randomUUID()}.xml`);
10795
+ return toolAbsentSkip(cwd, { id: "spotbugs" });
10796
+ const tmpXml = path36.join(scannerReportParentDir(), `pi-lens-spotbugs-${process.pid}-${randomUUID()}.xml`);
10135
10797
  const result = await safeSpawnAsync(cmd, [
10136
10798
  "-textui",
10137
10799
  "-xml:withMessages",
@@ -10143,7 +10805,7 @@ var spotbugsRunner = {
10143
10805
  ], { cwd, timeout: 12e4 });
10144
10806
  let xml = "";
10145
10807
  try {
10146
- xml = fs12.readFileSync(tmpXml, "utf8");
10808
+ xml = fs13.readFileSync(tmpXml, "utf8");
10147
10809
  } catch {
10148
10810
  if (result.error || (result.status ?? 0) > 1) {
10149
10811
  return {
@@ -10156,7 +10818,7 @@ var spotbugsRunner = {
10156
10818
  return { status: "succeeded", diagnostics: [], semantic: "none" };
10157
10819
  } finally {
10158
10820
  try {
10159
- fs12.rmSync(tmpXml, { force: true });
10821
+ fs13.rmSync(tmpXml, { force: true });
10160
10822
  } catch {
10161
10823
  }
10162
10824
  }
@@ -10172,12 +10834,11 @@ var spotbugsRunner = {
10172
10834
  var spotbugs_default = spotbugsRunner;
10173
10835
 
10174
10836
  // dist/clients/dispatch/runners/shellcheck.js
10175
- import * as path36 from "node:path";
10176
- var shellcheck = createAvailabilityChecker("shellcheck", ".exe");
10837
+ import * as path37 from "node:path";
10177
10838
  var SHELLCHECK_EXIT_CODES = { ran: [1] };
10178
10839
  function parseShellcheckOutput(raw, filePath, cwd) {
10179
10840
  const diagnostics = [];
10180
- const absTarget = path36.resolve(cwd, filePath);
10841
+ const absTarget = path37.resolve(cwd, filePath);
10181
10842
  if (!raw.trim()) {
10182
10843
  return diagnostics;
10183
10844
  }
@@ -10189,7 +10850,7 @@ function parseShellcheckOutput(raw, filePath, cwd) {
10189
10850
  for (const item of parsed) {
10190
10851
  if (!item.message || !item.line)
10191
10852
  continue;
10192
- if (!item.file || !pathsEqual(path36.resolve(cwd, item.file), absTarget))
10853
+ if (!item.file || !pathsEqual(path37.resolve(cwd, item.file), absTarget))
10193
10854
  continue;
10194
10855
  const severityMap = {
10195
10856
  error: "error",
@@ -10251,21 +10912,14 @@ var shellcheckRunner = {
10251
10912
  skipReason: "dialect-unsupported"
10252
10913
  };
10253
10914
  }
10254
- let cmd = null;
10255
- if (await shellcheck.isAvailableAsync(cwd)) {
10256
- cmd = shellcheck.getCommand(cwd);
10257
- } else {
10258
- const managed = await resolveAvailableOrInstall(shellcheck, "shellcheck", cwd);
10259
- if (managed)
10260
- cmd = managed;
10261
- }
10915
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "shellcheck");
10262
10916
  if (!cmd)
10263
- return toolAbsentSkip(cwd, { id: "shellcheck", checker: shellcheck });
10917
+ return toolAbsentSkip(cwd, { id: "shellcheck" });
10264
10918
  const args = ["--format", "json"];
10265
10919
  if (!dialectInfo.shebang && !dialectInfo.directive) {
10266
10920
  args.push("--shell", dialectInfo.dialect);
10267
10921
  }
10268
- const configDir = path36.dirname(path36.resolve(cwd, ctx.filePath));
10922
+ const configDir = path37.dirname(path37.resolve(cwd, ctx.filePath));
10269
10923
  if (!hasToolConfig("shellcheck", configDir)) {
10270
10924
  args.push("--severity", "info");
10271
10925
  }
@@ -10400,7 +11054,6 @@ var fishIndentRunner = {
10400
11054
  var fish_indent_default = fishIndentRunner;
10401
11055
 
10402
11056
  // dist/clients/dispatch/runners/shfmt.js
10403
- var shfmt = createAvailabilityChecker("shfmt", ".exe");
10404
11057
  var shfmtRunner = {
10405
11058
  id: "shfmt",
10406
11059
  appliesTo: ["shell"],
@@ -10408,18 +11061,9 @@ var shfmtRunner = {
10408
11061
  skipTestFiles: false,
10409
11062
  async run(ctx) {
10410
11063
  const cwd = resolveRunnerCwd(ctx, "shfmt");
10411
- let cmd = null;
10412
- if (await shfmt.isAvailableAsync(cwd)) {
10413
- cmd = shfmt.getCommand(cwd);
10414
- } else {
10415
- const installed = await resolveAvailableOrInstall(shfmt, "shfmt", cwd);
10416
- if (!installed) {
10417
- return toolAbsentSkip(cwd, { id: "shfmt", checker: shfmt });
10418
- }
10419
- cmd = installed;
10420
- }
11064
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "shfmt");
10421
11065
  if (!cmd)
10422
- return toolAbsentSkip(cwd, { id: "shfmt", checker: shfmt });
11066
+ return toolAbsentSkip(cwd, { id: "shfmt" });
10423
11067
  const result = await safeSpawnAsync(cmd, ["--diff", ctx.filePath], {
10424
11068
  timeout: 1e4,
10425
11069
  cwd
@@ -10483,13 +11127,12 @@ var shfmtRunner = {
10483
11127
  var shfmt_default = shfmtRunner;
10484
11128
 
10485
11129
  // dist/clients/dispatch/runners/spellcheck.js
10486
- import * as path37 from "node:path";
10487
- var typos = createAvailabilityChecker("typos", ".exe");
11130
+ import * as path38 from "node:path";
10488
11131
  var TYPOS_EXIT_CODES = { ran: [2] };
10489
11132
  function parseTyposOutput(raw, filePath, cwd) {
10490
11133
  const diagnostics = [];
10491
11134
  let readRecords = 0;
10492
- const absTarget = path37.resolve(cwd, filePath);
11135
+ const absTarget = path38.resolve(cwd, filePath);
10493
11136
  if (!raw.trim()) {
10494
11137
  return diagnostics;
10495
11138
  }
@@ -10501,7 +11144,7 @@ function parseTyposOutput(raw, filePath, cwd) {
10501
11144
  readRecords += 1;
10502
11145
  if (!parsed.typo || !parsed.line_num)
10503
11146
  continue;
10504
- if (parsed.path && !pathsEqual(path37.resolve(cwd, parsed.path), absTarget))
11147
+ if (parsed.path && !pathsEqual(path38.resolve(cwd, parsed.path), absTarget))
10505
11148
  continue;
10506
11149
  const corrections = parsed.corrections?.join(", ") || "no suggestions";
10507
11150
  const message = `Typo: "${parsed.typo}" \u2192 ${corrections}`;
@@ -10535,11 +11178,11 @@ var spellcheckRunner = {
10535
11178
  // Check docs in test files too
10536
11179
  async run(ctx) {
10537
11180
  const cwd = resolveRunnerCwd2(ctx, "spellcheck/typos");
10538
- if (!await typos.isAvailableAsync(cwd)) {
10539
- return toolAbsentSkip(cwd, { id: "typos", checker: typos });
10540
- }
11181
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "typos");
11182
+ if (!cmd)
11183
+ return toolAbsentSkip(cwd, { id: "typos" });
10541
11184
  const args = ["--format", "json", ctx.filePath];
10542
- const result = await safeSpawnAsync(typos.getCommand(cwd), args, {
11185
+ const result = await safeSpawnAsync(cmd, args, {
10543
11186
  cwd,
10544
11187
  timeout: 15e3
10545
11188
  });
@@ -10559,7 +11202,7 @@ var spellcheckRunner = {
10559
11202
  var spellcheck_default = spellcheckRunner;
10560
11203
 
10561
11204
  // dist/clients/dispatch/runners/sqlfluff.js
10562
- import * as path38 from "node:path";
11205
+ import * as path39 from "node:path";
10563
11206
  var SQLFLUFF_EXIT_CODES = { ran: [1] };
10564
11207
  var SQLFLUFF_FIXABLE_RULES = /* @__PURE__ */ new Set([
10565
11208
  // Layout — pure formatting
@@ -10613,9 +11256,9 @@ function parseSqlfluffOutput(raw, filePath, cwd) {
10613
11256
  if (!Array.isArray(parsed))
10614
11257
  return [];
10615
11258
  const diagnostics = [];
10616
- const absTarget = path38.resolve(cwd, filePath);
11259
+ const absTarget = path39.resolve(cwd, filePath);
10617
11260
  for (const item of parsed) {
10618
- if (item.filepath && !pathsEqual(path38.resolve(cwd, item.filepath), absTarget))
11261
+ if (item.filepath && !pathsEqual(path39.resolve(cwd, item.filepath), absTarget))
10619
11262
  continue;
10620
11263
  for (const v of item.violations ?? []) {
10621
11264
  if (!v.description)
@@ -10685,7 +11328,7 @@ var sqlfluffRunner = {
10685
11328
  var sqlfluff_default = sqlfluffRunner;
10686
11329
 
10687
11330
  // dist/clients/dispatch/runners/stylelint.js
10688
- import * as path39 from "node:path";
11331
+ import * as path40 from "node:path";
10689
11332
  var STYLELINT_EXIT_CODES = { ran: [1, 2] };
10690
11333
  function stylelintReport(stdout, stderr) {
10691
11334
  for (const stream of [stdout, stderr]) {
@@ -10729,9 +11372,9 @@ function parseStylelintJson(raw, filePath, cwd) {
10729
11372
  try {
10730
11373
  const results = JSON.parse(raw);
10731
11374
  const diagnostics = [];
10732
- const absTarget = path39.resolve(cwd, filePath);
11375
+ const absTarget = path40.resolve(cwd, filePath);
10733
11376
  for (const result of results) {
10734
- if (result.source && !pathsEqual(path39.resolve(cwd, result.source), absTarget))
11377
+ if (result.source && !pathsEqual(path40.resolve(cwd, result.source), absTarget))
10735
11378
  continue;
10736
11379
  for (const w of result.warnings) {
10737
11380
  const severity = w.severity === "error" ? "error" : "warning";
@@ -10767,7 +11410,7 @@ var stylelintRunner = {
10767
11410
  if (policy && !policy.preferredRunners.includes("stylelint")) {
10768
11411
  return skipped("not-preferred");
10769
11412
  }
10770
- const fileDir = path39.dirname(path39.resolve(cwd, ctx.filePath));
11413
+ const fileDir = path40.dirname(path40.resolve(cwd, ctx.filePath));
10771
11414
  const hasConfig = hasToolConfig("stylelint", fileDir) || hasToolConfig("stylelint", cwd);
10772
11415
  if (!hasConfig) {
10773
11416
  logRunnerAdvisoryOnce(ctx, "stylelint", cwd, "stylelint: no config detected, running with default rules");
@@ -10792,7 +11435,7 @@ var stylelintRunner = {
10792
11435
  var stylelint_default = stylelintRunner;
10793
11436
 
10794
11437
  // dist/clients/dispatch/runners/swiftlint.js
10795
- import * as path40 from "node:path";
11438
+ import * as path41 from "node:path";
10796
11439
  var SWIFTLINT_FIXABLE_RULES = /* @__PURE__ */ new Set([
10797
11440
  "closing_brace",
10798
11441
  "colon",
@@ -10854,7 +11497,7 @@ function parseSwiftLintOutput(raw, filePath, cwd) {
10854
11497
  const diagnostics = [];
10855
11498
  if (!raw.trim())
10856
11499
  return diagnostics;
10857
- const absTarget = path40.resolve(cwd, filePath);
11500
+ const absTarget = path41.resolve(cwd, filePath);
10858
11501
  try {
10859
11502
  const parsed = JSON.parse(raw);
10860
11503
  if (!Array.isArray(parsed))
@@ -10862,7 +11505,7 @@ function parseSwiftLintOutput(raw, filePath, cwd) {
10862
11505
  for (const item of parsed) {
10863
11506
  if (!item.reason)
10864
11507
  continue;
10865
- if (item.file && !pathsEqual(path40.resolve(cwd, item.file), absTarget))
11508
+ if (item.file && !pathsEqual(path41.resolve(cwd, item.file), absTarget))
10866
11509
  continue;
10867
11510
  const severityMap = {
10868
11511
  error: "error",
@@ -10902,7 +11545,7 @@ var swiftlintRunner = {
10902
11545
  const cmd = await resolveToolCommandWithInstallFallback(cwd, "swiftlint");
10903
11546
  if (!cmd)
10904
11547
  return toolAbsentSkip(cwd, { id: "swiftlint" });
10905
- const result = await safeSpawnAsync(cmd, ["--reporter", "json", path40.resolve(cwd, ctx.filePath)], { cwd, timeout: 15e3 });
11548
+ const result = await safeSpawnAsync(cmd, ["--reporter", "json", path41.resolve(cwd, ctx.filePath)], { cwd, timeout: 15e3 });
10906
11549
  const run = parseToolRun("swiftlint", {
10907
11550
  result,
10908
11551
  // EXIT TABLE (SwiftLint 0.56 measured fixture): 0 clean; 1 findings; 2 error; other nonzero rejected.
@@ -10925,7 +11568,7 @@ var swiftlintRunner = {
10925
11568
  var swiftlint_default = swiftlintRunner;
10926
11569
 
10927
11570
  // dist/clients/dispatch/runners/taplo.js
10928
- import * as path41 from "node:path";
11571
+ import * as path42 from "node:path";
10929
11572
  var TAPLO_EXIT_CODES = { ran: [1] };
10930
11573
  var HEADER_PATTERN = /^\s*(error|warning):(.*)$/;
10931
11574
  var LOCATION_LEAD = "\u250C\u2500";
@@ -10935,7 +11578,7 @@ function parseTaploOutput(raw, filePath, cwd) {
10935
11578
  let located = 0;
10936
11579
  if (!raw.trim())
10937
11580
  return diagnostics;
10938
- const absTarget = path41.resolve(cwd, filePath);
11581
+ const absTarget = path42.resolve(cwd, filePath);
10939
11582
  const lines = stripAnsi(raw ?? "").split(/\r?\n/);
10940
11583
  for (let i = 0; i < lines.length; i++) {
10941
11584
  const header = HEADER_PATTERN.exec(lines[i].trimEnd());
@@ -10954,7 +11597,7 @@ function parseTaploOutput(raw, filePath, cwd) {
10954
11597
  if (!location)
10955
11598
  continue;
10956
11599
  located += 1;
10957
- if (!pathsEqual(path41.resolve(cwd, location[1].trim()), absTarget))
11600
+ if (!pathsEqual(path42.resolve(cwd, location[1].trim()), absTarget))
10958
11601
  continue;
10959
11602
  line = Number.parseInt(location[2], 10) || 1;
10960
11603
  column = Number.parseInt(location[3], 10) || 1;
@@ -11016,7 +11659,7 @@ var taploRunner = {
11016
11659
  id: "taplo",
11017
11660
  trustRefused: isLocalBinTrustRefusal(projectTaplo)
11018
11661
  });
11019
- const absPath = path41.resolve(cwd, ctx.filePath);
11662
+ const absPath = path42.resolve(cwd, ctx.filePath);
11020
11663
  const result = await safeSpawnAsync(cmd, ["check", "--colors", "never", absPath], { cwd, timeout: 15e3 });
11021
11664
  const raw = result.stderr?.trim() ? result.stderr : result.stdout ?? "";
11022
11665
  const run = parseToolRun("taplo", { result, output: raw, exitCodes: TAPLO_EXIT_CODES }, (out) => parseTaploOutput(out, ctx.filePath, cwd));
@@ -11035,8 +11678,7 @@ var taploRunner = {
11035
11678
  var taplo_default = taploRunner;
11036
11679
 
11037
11680
  // dist/clients/dispatch/runners/terragrunt.js
11038
- import * as path42 from "node:path";
11039
- var terragrunt = createAvailabilityChecker("terragrunt", ".exe");
11681
+ import * as path43 from "node:path";
11040
11682
  function normalizeSeverity(raw) {
11041
11683
  if (typeof raw === "number")
11042
11684
  return raw === 1 ? "error" : "warning";
@@ -11054,7 +11696,7 @@ function toRawDiagnostics(parsed) {
11054
11696
  return [];
11055
11697
  return invalidFiles.flatMap((f) => Array.isArray(f?.diagnostics) ? f.diagnostics : []);
11056
11698
  }
11057
- function parseTerragruntOutput(raw, filePath, absPath = path42.resolve(filePath)) {
11699
+ function parseTerragruntOutput(raw, filePath, absPath = path43.resolve(filePath)) {
11058
11700
  if (!raw.trim())
11059
11701
  return [];
11060
11702
  let parsed;
@@ -11063,13 +11705,13 @@ function parseTerragruntOutput(raw, filePath, absPath = path42.resolve(filePath)
11063
11705
  } catch {
11064
11706
  return [];
11065
11707
  }
11066
- const unitDir = path42.dirname(absPath);
11708
+ const unitDir = path43.dirname(absPath);
11067
11709
  const diagnostics = [];
11068
11710
  for (const d of toRawDiagnostics(parsed)) {
11069
11711
  if (!d || typeof d !== "object")
11070
11712
  continue;
11071
11713
  const diagFile = d.range?.filename;
11072
- if (diagFile && !pathsEqual(path42.resolve(unitDir, diagFile), absPath))
11714
+ if (diagFile && !pathsEqual(path43.resolve(unitDir, diagFile), absPath))
11073
11715
  continue;
11074
11716
  const line = d.range?.start?.line ?? 1;
11075
11717
  const column = d.range?.start?.column ?? 1;
@@ -11100,18 +11742,11 @@ var terragruntRunner = {
11100
11742
  const policy = getLinterPolicyForCwd(ctx.filePath, cwd);
11101
11743
  if (policy && !policy.preferredRunners.includes("terragrunt"))
11102
11744
  return skipped("not-preferred");
11103
- let cmd = null;
11104
- if (await terragrunt.isAvailableAsync(cwd)) {
11105
- cmd = terragrunt.getCommand(cwd);
11106
- } else {
11107
- const managed = await resolveAvailableOrInstall(terragrunt, "terragrunt", cwd);
11108
- if (managed)
11109
- cmd = managed;
11110
- }
11745
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "terragrunt");
11111
11746
  if (!cmd)
11112
- return toolAbsentSkip(cwd, { id: "terragrunt", checker: terragrunt });
11113
- const absPath = path42.resolve(cwd, ctx.filePath);
11114
- const fileDir = path42.dirname(absPath);
11747
+ return toolAbsentSkip(cwd, { id: "terragrunt" });
11748
+ const absPath = path43.resolve(cwd, ctx.filePath);
11749
+ const fileDir = path43.dirname(absPath);
11115
11750
  const result = await safeSpawnAsync(cmd, ["hcl", "validate", "--json", "--non-interactive"], { cwd: fileDir, timeout: 3e4 });
11116
11751
  if (spawnFailedWithNoOutput(result))
11117
11752
  return faultSkip("did-not-run");
@@ -11137,15 +11772,14 @@ var terragruntRunner = {
11137
11772
  var terragrunt_default = terragruntRunner;
11138
11773
 
11139
11774
  // dist/clients/dispatch/runners/tflint.js
11140
- import * as path43 from "node:path";
11141
- var tflint = createAvailabilityChecker("tflint", ".exe");
11775
+ import * as path44 from "node:path";
11142
11776
  function parseTflintOutput(raw, filePath, toolCwd) {
11143
11777
  try {
11144
11778
  const parsed = JSON.parse(raw);
11145
11779
  const issues = parsed.issues ?? [];
11146
- const absTarget = path43.resolve(toolCwd, filePath);
11780
+ const absTarget = path44.resolve(toolCwd, filePath);
11147
11781
  return issues.flatMap((issue) => {
11148
- if (issue.range?.filename && !pathsEqual(path43.resolve(toolCwd, issue.range.filename), absTarget))
11782
+ if (issue.range?.filename && !pathsEqual(path44.resolve(toolCwd, issue.range.filename), absTarget))
11149
11783
  return [];
11150
11784
  const severity = issue.rule.severity === "error" ? "error" : "warning";
11151
11785
  return [
@@ -11178,22 +11812,15 @@ var tflintRunner = {
11178
11812
  if (policy && !policy.preferredRunners.includes("tflint")) {
11179
11813
  return skipped("not-preferred");
11180
11814
  }
11181
- let cmd = null;
11182
- if (await tflint.isAvailableAsync(cwd)) {
11183
- cmd = tflint.getCommand(cwd);
11184
- } else {
11185
- const managed = await resolveAvailableOrInstall(tflint, "tflint", cwd);
11186
- if (managed)
11187
- cmd = managed;
11188
- }
11815
+ const cmd = await resolveToolCommandWithInstallFallback(cwd, "tflint");
11189
11816
  if (!cmd)
11190
- return toolAbsentSkip(cwd, { id: "tflint", checker: tflint });
11191
- const absPath = path43.resolve(cwd, ctx.filePath);
11192
- const fileDir = path43.dirname(absPath);
11817
+ return toolAbsentSkip(cwd, { id: "tflint" });
11818
+ const absPath = path44.resolve(cwd, ctx.filePath);
11819
+ const fileDir = path44.dirname(absPath);
11193
11820
  const args = [
11194
11821
  "--format=json",
11195
11822
  "--no-color",
11196
- `--filter=${path43.basename(absPath)}`
11823
+ `--filter=${path44.basename(absPath)}`
11197
11824
  ];
11198
11825
  const configPath = process.env.TFLINT_CONFIG_FILE ? void 0 : findToolConfig("tflint", fileDir)?.file;
11199
11826
  if (configPath)
@@ -11228,8 +11855,8 @@ var tflintRunner = {
11228
11855
  var tflint_default = tflintRunner;
11229
11856
 
11230
11857
  // dist/clients/dispatch/runners/trivy-config.js
11231
- import * as fs13 from "node:fs";
11232
- import * as path44 from "node:path";
11858
+ import * as fs14 from "node:fs";
11859
+ import * as path45 from "node:path";
11233
11860
  function looksLikeKubernetesManifest(content) {
11234
11861
  for (const doc of content.split(/^---\s*$/m)) {
11235
11862
  if (/^apiVersion:\s*\S/m.test(doc) && /^kind:\s*\S/m.test(doc)) {
@@ -11265,12 +11892,12 @@ function parseTrivyConfigOutput(raw, filePath, cwd = process.cwd()) {
11265
11892
  if (!Array.isArray(results))
11266
11893
  return [];
11267
11894
  const diagnostics = [];
11268
- const absTarget = path44.resolve(cwd, filePath);
11895
+ const absTarget = path45.resolve(cwd, filePath);
11269
11896
  for (const resultEntry of results) {
11270
11897
  if (!resultEntry || typeof resultEntry !== "object")
11271
11898
  continue;
11272
11899
  const target = resultEntry.Target;
11273
- if (typeof target !== "string" || !pathsEqual(path44.resolve(cwd, target), absTarget))
11900
+ if (typeof target !== "string" || !pathsEqual(path45.resolve(cwd, target), absTarget))
11274
11901
  continue;
11275
11902
  const rows = resultEntry.Misconfigurations;
11276
11903
  if (!Array.isArray(rows))
@@ -11320,11 +11947,11 @@ var trivyConfigRunner = {
11320
11947
  skipReason: "not-enabled"
11321
11948
  };
11322
11949
  }
11323
- const absPath = path44.resolve(cwd, ctx.filePath);
11950
+ const absPath = path45.resolve(cwd, ctx.filePath);
11324
11951
  if (ctx.kind === "yaml" || ctx.kind === "json") {
11325
11952
  let content = "";
11326
11953
  try {
11327
- content = fs13.readFileSync(absPath, "utf-8");
11954
+ content = fs14.readFileSync(absPath, "utf-8");
11328
11955
  } catch {
11329
11956
  return { status: "skipped", diagnostics: [], semantic: "none" };
11330
11957
  }
@@ -11385,12 +12012,12 @@ var trivyConfigRunner = {
11385
12012
  var trivy_config_default = trivyConfigRunner;
11386
12013
 
11387
12014
  // dist/clients/dispatch/runners/vale.js
11388
- import * as path45 from "node:path";
12015
+ import * as path46 from "node:path";
11389
12016
  function parseValeOutput(raw, filePath, cwd) {
11390
12017
  const diagnostics = [];
11391
12018
  if (!raw.trim())
11392
12019
  return diagnostics;
11393
- const absTarget = path45.resolve(cwd, filePath);
12020
+ const absTarget = path46.resolve(cwd, filePath);
11394
12021
  try {
11395
12022
  const parsed = JSON.parse(raw);
11396
12023
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
@@ -11398,7 +12025,7 @@ function parseValeOutput(raw, filePath, cwd) {
11398
12025
  for (const [reported, alerts] of Object.entries(parsed)) {
11399
12026
  if (!Array.isArray(alerts))
11400
12027
  continue;
11401
- if (reported && !pathsEqual(path45.resolve(cwd, reported), absTarget))
12028
+ if (reported && !pathsEqual(path46.resolve(cwd, reported), absTarget))
11402
12029
  continue;
11403
12030
  for (const alert of alerts) {
11404
12031
  if (!alert.Message)
@@ -11443,7 +12070,7 @@ var valeRunner = {
11443
12070
  const cmd = await resolveToolCommandWithInstallFallback(cwd, "vale");
11444
12071
  if (!cmd)
11445
12072
  return toolAbsentSkip(cwd, { id: "vale" });
11446
- const result = await safeSpawnAsync(cmd, ["--output", "JSON", ctx.filePath], { cwd, timeout: 15e3 });
12073
+ const result = await safeSpawnAsync(cmd, ["--output", "JSON", optionSafeTargetArg(cwd, ctx.filePath)], { cwd, timeout: 15e3 });
11447
12074
  const run = parseToolRun("vale", {
11448
12075
  result,
11449
12076
  // EXIT TABLE (Vale 3.9.6 docs https://vale.sh/docs/topics/metrics/): 0 clean; 1 findings; 2 error; other nonzero rejected.
@@ -11466,11 +12093,11 @@ var valeRunner = {
11466
12093
  var vale_default = valeRunner;
11467
12094
 
11468
12095
  // dist/clients/dispatch/runners/tree-sitter.js
11469
- import * as path47 from "node:path";
12096
+ import * as path48 from "node:path";
11470
12097
 
11471
12098
  // dist/clients/cache/rule-cache.js
11472
- import * as fs14 from "node:fs";
11473
- import * as path46 from "node:path";
12099
+ import * as fs15 from "node:fs";
12100
+ import * as path47 from "node:path";
11474
12101
  var CACHE_VERSION = "v7";
11475
12102
  function reportBundledRulesRootHealth() {
11476
12103
  reportBundledResourceDirHealth("tree-sitter-queries-dir-missing", BUNDLED_QUERIES_ROOT, getBundledQueriesRootHealth(), "bundled tree-sitter query rules");
@@ -11482,12 +12109,12 @@ var RuleCache = class {
11482
12109
  constructor(language, rootDir = process.cwd()) {
11483
12110
  this.language = language;
11484
12111
  reportBundledRulesRootHealth();
11485
- this.cacheDir = path46.join(getProjectDataDir(rootDir), "cache");
11486
- this.cacheFile = path46.join(this.cacheDir, `${language}-rules-${CACHE_VERSION}.json`);
12112
+ this.cacheDir = path47.join(getProjectDataDir(rootDir), "cache");
12113
+ this.cacheFile = path47.join(this.cacheDir, `${language}-rules-${CACHE_VERSION}.json`);
11487
12114
  }
11488
12115
  ensureCacheDir() {
11489
- if (!fs14.existsSync(this.cacheDir)) {
11490
- fs14.mkdirSync(this.cacheDir, { recursive: true });
12116
+ if (!fs15.existsSync(this.cacheDir)) {
12117
+ fs15.mkdirSync(this.cacheDir, { recursive: true });
11491
12118
  }
11492
12119
  }
11493
12120
  computeRuleHash(ruleFiles) {
@@ -11496,7 +12123,7 @@ var RuleCache = class {
11496
12123
  get(ruleFiles) {
11497
12124
  try {
11498
12125
  this.ensureCacheDir();
11499
- if (!fs14.existsSync(this.cacheFile))
12126
+ if (!fs15.existsSync(this.cacheFile))
11500
12127
  return null;
11501
12128
  const currentHash = this.computeRuleHash(ruleFiles);
11502
12129
  const cached = readJsonCache(this.cacheFile, (parsed) => {
@@ -11530,11 +12157,11 @@ var RuleCache = class {
11530
12157
  // on their own — nothing ever read or removed them again once the version
11531
12158
  // bumped. Delete every sibling for this language that isn't the current file.
11532
12159
  pruneStaleVersions() {
11533
- const currentName = path46.basename(this.cacheFile);
12160
+ const currentName = path47.basename(this.cacheFile);
11534
12161
  const pattern = new RegExp(`^${this.language}-rules-v\\d+\\.json$`);
11535
12162
  let dirents;
11536
12163
  try {
11537
- dirents = fs14.readdirSync(this.cacheDir);
12164
+ dirents = fs15.readdirSync(this.cacheDir);
11538
12165
  } catch {
11539
12166
  return;
11540
12167
  }
@@ -11542,15 +12169,15 @@ var RuleCache = class {
11542
12169
  if (name === currentName || !pattern.test(name))
11543
12170
  continue;
11544
12171
  try {
11545
- fs14.unlinkSync(path46.join(this.cacheDir, name));
12172
+ fs15.unlinkSync(path47.join(this.cacheDir, name));
11546
12173
  } catch {
11547
12174
  }
11548
12175
  }
11549
12176
  }
11550
12177
  clear() {
11551
12178
  try {
11552
- if (fs14.existsSync(this.cacheFile)) {
11553
- fs14.unlinkSync(this.cacheFile);
12179
+ if (fs15.existsSync(this.cacheFile)) {
12180
+ fs15.unlinkSync(this.cacheFile);
11554
12181
  }
11555
12182
  } catch {
11556
12183
  }
@@ -11841,6 +12468,8 @@ var treeSitterRunner = {
11841
12468
  priority: PRIORITY.STRUCTURAL_ANALYSIS,
11842
12469
  skipTestFiles: false,
11843
12470
  // Run on test files too (structural issues matter there)
12471
+ // #5621: it reads the `file.content` fact, never the disk.
12472
+ lintsGivenContent: true,
11844
12473
  async run(ctx) {
11845
12474
  const client = getSharedTreeSitterClient();
11846
12475
  logTreeSitter({ phase: "runner_start", filePath: ctx.filePath });
@@ -11864,7 +12493,7 @@ var treeSitterRunner = {
11864
12493
  return { status: "skipped", diagnostics: [], semantic: "none" };
11865
12494
  }
11866
12495
  const filePath = ctx.filePath;
11867
- const ext = path47.extname(filePath).toLowerCase();
12496
+ const ext = path48.extname(filePath).toLowerCase();
11868
12497
  const languageId = resolveTreeSitterLanguage(filePath);
11869
12498
  if (!languageId) {
11870
12499
  logTreeSitter({
@@ -12098,17 +12727,17 @@ var treeSitterRunner = {
12098
12727
  var tree_sitter_default = treeSitterRunner;
12099
12728
 
12100
12729
  // dist/clients/dispatch/runners/yamllint.js
12101
- import * as path48 from "node:path";
12730
+ import * as path49 from "node:path";
12102
12731
  function parseYamllintParsable(raw, filePath, cwd) {
12103
12732
  const diagnostics = [];
12104
- const absTarget = path48.resolve(cwd, filePath);
12733
+ const absTarget = path49.resolve(cwd, filePath);
12105
12734
  for (const line of raw.split(/\r?\n/)) {
12106
12735
  if (!line.trim())
12107
12736
  continue;
12108
12737
  const match = line.match(/^(.*?):(\d+):(\d+):\s*\[(error|warning)\]\s*(.*?)\s*\(([^)]+)\)\s*$/i);
12109
12738
  if (!match)
12110
12739
  continue;
12111
- if (!pathsEqual(path48.resolve(cwd, match[1]), absTarget))
12740
+ if (!pathsEqual(path49.resolve(cwd, match[1]), absTarget))
12112
12741
  continue;
12113
12742
  const severity = match[4].toLowerCase() === "error" ? "error" : "warning";
12114
12743
  diagnostics.push({
@@ -12176,17 +12805,17 @@ var yamllintRunner = {
12176
12805
  var yamllint_default = yamllintRunner;
12177
12806
 
12178
12807
  // dist/clients/dispatch/runners/zig-check.js
12179
- import * as path49 from "node:path";
12808
+ import * as path50 from "node:path";
12180
12809
  var zig = createAvailabilityChecker("zig", ".exe", ["version"]);
12181
12810
  function parseZigOutput(raw, filePath, cwd) {
12182
12811
  const diagnostics = [];
12183
- const absTarget = path49.resolve(cwd, filePath);
12812
+ const absTarget = path50.resolve(cwd, filePath);
12184
12813
  for (const line of raw.split(/\r?\n/)) {
12185
12814
  const match = line.match(/^(.*?):(\d+):(\d+):\s*(error|warning|note):\s*(.+)$/);
12186
12815
  if (!match)
12187
12816
  continue;
12188
12817
  const [, rawFile, lineStr, colStr, level, message] = match;
12189
- if (!pathsEqual(path49.resolve(cwd, rawFile.trim()), absTarget))
12818
+ if (!pathsEqual(path50.resolve(cwd, rawFile.trim()), absTarget))
12190
12819
  continue;
12191
12820
  const severity = level === "error" ? "error" : "warning";
12192
12821
  diagnostics.push({
@@ -12217,7 +12846,7 @@ var zigCheckRunner = {
12217
12846
  return toolAbsentSkip(cwd, { checker: zig });
12218
12847
  }
12219
12848
  const cmd = zig.getCommand(cwd);
12220
- const absPath = path49.resolve(cwd, ctx.filePath);
12849
+ const absPath = path50.resolve(cwd, ctx.filePath);
12221
12850
  const result = await safeSpawnAsync(cmd, ["build-exe", absPath, "-fno-emit-bin"], { cwd, timeout: 3e4 });
12222
12851
  if (result.error && !result.stdout && !result.stderr) {
12223
12852
  return faultSkip("did-not-run");
@@ -12923,6 +13552,7 @@ function applyProjectLensConfig(cwd) {
12923
13552
  var sessionFacts = new FactStore("dispatch");
12924
13553
  var preEditCaptureFacts = new FactStore("pre-edit-capture");
12925
13554
  var preEditCapturesInFlight = /* @__PURE__ */ new Map();
13555
+ var stagedDeltaFacts = new FactStore("staged-delta");
12926
13556
  setFactStoreEvictionReporter((subject, axis, reason) => {
12927
13557
  if (axis === "pinned-over-budget") {
12928
13558
  recordDegradationOnce({
@@ -13107,6 +13737,7 @@ function resetDispatchBaselines(cwd) {
13107
13737
  for (const controller of preEditCapturesInFlight.values())
13108
13738
  controller.abort();
13109
13739
  preEditCaptureFacts.clearAll();
13740
+ stagedDeltaFacts.clearAll();
13110
13741
  resetSessionSlopScore();
13111
13742
  clearCoverageNoticeState();
13112
13743
  clearReviewGraphWorkspaceCache();
@@ -13281,7 +13912,7 @@ function usableWarmWordIndex(index) {
13281
13912
  return index?.forward ? index : void 0;
13282
13913
  }
13283
13914
  function acquireWarmWordIndex(cwd) {
13284
- const key = path50.resolve(cwd);
13915
+ const key = path51.resolve(cwd);
13285
13916
  let entry = warmWordIndexes.get(key);
13286
13917
  if (!entry) {
13287
13918
  const snapshot = loadProjectSnapshot(key);
@@ -13319,7 +13950,7 @@ function adoptPublishedWarmWordIndex(cwd, published, trigger) {
13319
13950
  const index = usableWarmWordIndex(published);
13320
13951
  if (!index)
13321
13952
  return;
13322
- const key = path50.resolve(cwd);
13953
+ const key = path51.resolve(cwd);
13323
13954
  const entry = warmWordIndexes.get(key);
13324
13955
  if (!entry || entry.index)
13325
13956
  return;
@@ -13386,7 +14017,7 @@ async function warmLspForFile(absPath, host) {
13386
14017
  return;
13387
14018
  let content;
13388
14019
  try {
13389
- content = fs15.readFileSync(absPath, "utf8");
14020
+ content = fs16.readFileSync(absPath, "utf8");
13390
14021
  } catch {
13391
14022
  return;
13392
14023
  }
@@ -13444,7 +14075,7 @@ async function analyzeFile(filePath, workspaceCwd, options = {}) {
13444
14075
  }
13445
14076
  if (options.registerTurnState) {
13446
14077
  try {
13447
- const lineCount = fs15.readFileSync(absPath, "utf8").split("\n").length;
14078
+ const lineCount = fs16.readFileSync(absPath, "utf8").split("\n").length;
13448
14079
  new CacheManager().addModifiedRange(absPath, { start: 1, end: lineCount }, true, cwd, options.ownerId ?? MCP_TURN_STATE_OWNER_ID, "mcp");
13449
14080
  } catch {
13450
14081
  }
@@ -13462,7 +14093,7 @@ async function analyzeFile(filePath, workspaceCwd, options = {}) {
13462
14093
  try {
13463
14094
  if (warmIndex) {
13464
14095
  try {
13465
- const content = fs15.readFileSync(absPath, "utf8");
14096
+ const content = fs16.readFileSync(absPath, "utf8");
13466
14097
  if (!canWriteAnalysisRoot(analysisRootMode)) {
13467
14098
  emitBounded("adopted_root_writer_skipped", `${absPath}:word-index`, {
13468
14099
  filePath: absPath,