pi-lens 4.4.0 → 4.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/README.md +1 -0
  3. package/config/dependency-cruiser-eager-allowlist.json +3 -1
  4. package/dist/{chunk-IXEBJSUE.js → chunk-23WOO7TX.js} +11 -10
  5. package/dist/{chunk-E2WFBRHM.js → chunk-2B73ZPOK.js} +3 -3
  6. package/dist/{chunk-DQ2NZ7C4.js → chunk-2BBLFX75.js} +139 -11
  7. package/dist/{chunk-ZMOL6RQC.js → chunk-2CD5RS6M.js} +2 -2
  8. package/dist/{chunk-VD4JQCQC.js → chunk-2ZGIZPDG.js} +38 -37
  9. package/dist/{chunk-DIULIWKU.js → chunk-34WSVGEM.js} +29 -3
  10. package/dist/chunk-3JNKMP3B.js +17 -0
  11. package/dist/{chunk-HVUZXSWK.js → chunk-3UUPUE3O.js} +45 -41
  12. package/dist/{chunk-5RXBNSW2.js → chunk-3VPVG5SU.js} +16 -8
  13. package/dist/chunk-3WA4HP4I.js +55 -0
  14. package/dist/chunk-466Z26MG.js +30 -0
  15. package/dist/{chunk-34U7PLGE.js → chunk-4UNXBNE2.js} +12 -11
  16. package/dist/{chunk-E4MAEDPM.js → chunk-4W4VLAPJ.js} +12 -11
  17. package/dist/{chunk-GUOGVTCQ.js → chunk-52FUZI6K.js} +4 -2
  18. package/dist/chunk-5JM2524W.js +84 -0
  19. package/dist/{chunk-VHQLPIRJ.js → chunk-5NGR67U5.js} +2 -2
  20. package/dist/{chunk-DFVMIKMQ.js → chunk-66SXUJCA.js} +45 -9
  21. package/dist/{chunk-OQGFCZJ4.js → chunk-66VMUL7Q.js} +16 -16
  22. package/dist/{chunk-HWBZIGMJ.js → chunk-67WMNWEE.js} +9 -8
  23. package/dist/{chunk-6QIUX4EP.js → chunk-6C7JWPCP.js} +7 -7
  24. package/dist/{chunk-47D2BO4S.js → chunk-6GFRNVYR.js} +11 -10
  25. package/dist/{chunk-ZAWW3AF6.js → chunk-6SDEP3AJ.js} +9 -8
  26. package/dist/{chunk-TGPXLY2J.js → chunk-724UL2TJ.js} +38 -2
  27. package/dist/{chunk-YLF3PPT5.js → chunk-76MWC2K6.js} +3 -3
  28. package/dist/{chunk-F3P7VQ7H.js → chunk-7DYBLXYA.js} +3 -3
  29. package/dist/{chunk-AJ3QXTRQ.js → chunk-7ULNCDCO.js} +37 -35
  30. package/dist/{chunk-UK3CMEAL.js → chunk-AOHZU2BM.js} +1 -1
  31. package/dist/{chunk-F3AU2TMM.js → chunk-ARJ6PLFH.js} +44 -28
  32. package/dist/{chunk-U3VGR4VU.js → chunk-AW7R2GWG.js} +65 -8
  33. package/dist/{chunk-FJNKANOS.js → chunk-BKE7E7TC.js} +10 -9
  34. package/dist/{chunk-4W2PLC4J.js → chunk-BRGDSBJE.js} +13 -12
  35. package/dist/{chunk-VN2AXLEX.js → chunk-C34ZXZ7O.js} +102 -16
  36. package/dist/{chunk-T4ERT73Y.js → chunk-CF24OIYI.js} +21 -20
  37. package/dist/{chunk-NMABWBZN.js → chunk-CHOW74WE.js} +1 -1
  38. package/dist/{chunk-ARFCXG7S.js → chunk-CO2G5PHH.js} +2 -2
  39. package/dist/{chunk-AS44CFQ4.js → chunk-EETY4LF7.js} +24 -10
  40. package/dist/{chunk-I3R7GKDR.js → chunk-EJIUXPBX.js} +1 -1
  41. package/dist/{chunk-B3I2UUT4.js → chunk-ESBQHFMJ.js} +653 -251
  42. package/dist/{chunk-O5WILGMI.js → chunk-FLKWCIZH.js} +8 -5
  43. package/dist/{chunk-LNAKEO63.js → chunk-GAEGEPOC.js} +4 -4
  44. package/dist/{chunk-V7R425XG.js → chunk-GBPP5P7X.js} +4 -4
  45. package/dist/{chunk-XK4CIILI.js → chunk-GHB6AYCP.js} +27 -26
  46. package/dist/{chunk-7FBF7NPR.js → chunk-GOYRYZ2R.js} +29 -26
  47. package/dist/{chunk-JOLITGCC.js → chunk-GXW6K4YJ.js} +1 -1
  48. package/dist/{chunk-NXPS2L6U.js → chunk-GZYBXISR.js} +9 -9
  49. package/dist/{chunk-OAXNDZJ7.js → chunk-IBGIOBEE.js} +8 -4
  50. package/dist/{chunk-IIXOAGHR.js → chunk-IBRALRBR.js} +19 -15
  51. package/dist/{chunk-7F72PXY2.js → chunk-IXXDFY73.js} +3 -3
  52. package/dist/chunk-IZSHAIJ7.js +26 -0
  53. package/dist/{chunk-N3YQJI6O.js → chunk-JAU72XNY.js} +20 -15
  54. package/dist/chunk-JMYYOTQG.js +77 -0
  55. package/dist/{chunk-NL5GLMFI.js → chunk-JSQFTSC6.js} +12 -11
  56. package/dist/{chunk-IVP5KAB7.js → chunk-JWA5I3SR.js} +35 -21
  57. package/dist/{chunk-Y4T27COV.js → chunk-KBG47GHP.js} +4 -4
  58. package/dist/{chunk-PWFHBTSF.js → chunk-L3BLXZG7.js} +2 -2
  59. package/dist/chunk-LOP6GRPH.js +31 -0
  60. package/dist/chunk-MQLUAEOC.js +162 -0
  61. package/dist/{chunk-RPD5K5NC.js → chunk-MRXKYPCS.js} +2 -2
  62. package/dist/{chunk-Q5U6FMDI.js → chunk-N2H3ZPZY.js} +59 -7
  63. package/dist/{chunk-27BBHSZC.js → chunk-N3X6Q4YT.js} +3 -3
  64. package/dist/{chunk-UY752QSN.js → chunk-NW7BOILN.js} +19 -17
  65. package/dist/{chunk-TLGFBM3F.js → chunk-ODBNXWT4.js} +302 -113
  66. package/dist/{chunk-TT22N74J.js → chunk-OG5UUPN7.js} +13 -13
  67. package/dist/{chunk-C2AUYXQH.js → chunk-OXXKQCSV.js} +6 -6
  68. package/dist/{chunk-PAK6IDME.js → chunk-P7266HLM.js} +2 -2
  69. package/dist/{chunk-52H5B5TC.js → chunk-PFNSLWU5.js} +31 -30
  70. package/dist/{chunk-5ZEJHV35.js → chunk-PHDMFAKM.js} +12 -2
  71. package/dist/{chunk-3I5QFT3N.js → chunk-PNQDPDRC.js} +6 -3
  72. package/dist/{chunk-TVN5N6GY.js → chunk-PV6LR5P5.js} +6057 -1311
  73. package/dist/{chunk-AHDW3GPE.js → chunk-Q6ZWTCLY.js} +24 -22
  74. package/dist/{chunk-RUOG5D2C.js → chunk-Q7DUK4LX.js} +5 -5
  75. package/dist/{chunk-YSNFMJKN.js → chunk-QGQ5CCCG.js} +2 -2
  76. package/dist/{chunk-LW6XKDZQ.js → chunk-QHJ6DQ2R.js} +287 -38
  77. package/dist/{chunk-GVXA6CCE.js → chunk-QILIYSJF.js} +1 -1
  78. package/dist/{chunk-22AVIGXS.js → chunk-QOBUHWHX.js} +12 -7
  79. package/dist/{chunk-5THXD6X5.js → chunk-QQNQ7SJW.js} +2 -75
  80. package/dist/{chunk-4RERDEXR.js → chunk-QZVW3AAK.js} +50 -41
  81. package/dist/{chunk-AWE5TMPO.js → chunk-R3PCY3YS.js} +14 -13
  82. package/dist/{chunk-HHYAELLJ.js → chunk-RPLINGVB.js} +7 -7
  83. package/dist/{chunk-EOKRQ3SA.js → chunk-RWWYJ623.js} +10 -1
  84. package/dist/{chunk-YGVYKNSN.js → chunk-SAEFPSB6.js} +59 -12
  85. package/dist/{chunk-K6VYLB2U.js → chunk-TYM6OUIT.js} +13 -12
  86. package/dist/{chunk-AJXODZY6.js → chunk-UXGETRP4.js} +13 -12
  87. package/dist/{chunk-I7SPGOWI.js → chunk-UZ3TUTRV.js} +1 -1
  88. package/dist/{chunk-TO6WL3GM.js → chunk-VCHXCQFG.js} +12 -2
  89. package/dist/{chunk-BRJKOBZP.js → chunk-VITUCP5A.js} +17 -6
  90. package/dist/{chunk-WONERJTP.js → chunk-VRZP76YM.js} +1 -1
  91. package/dist/{chunk-OS32RNR2.js → chunk-VSSBEUFT.js} +16 -15
  92. package/dist/{chunk-VDBPVIKD.js → chunk-VWCXW2E7.js} +1 -1
  93. package/dist/{chunk-NKOUFPQF.js → chunk-WOA4LN2R.js} +2 -2
  94. package/dist/{chunk-RIISMHKN.js → chunk-WOKKRCJ5.js} +15 -13
  95. package/dist/{chunk-XECLWQZN.js → chunk-WU567RSC.js} +13 -10
  96. package/dist/{chunk-V5PXFSZK.js → chunk-XCJN5IJU.js} +4 -4
  97. package/dist/{chunk-ORTMY4Q4.js → chunk-XKIZ2HNN.js} +22 -14
  98. package/dist/{chunk-6VCD4VKZ.js → chunk-XMSXXAHW.js} +2 -2
  99. package/dist/chunk-XPZPXCBV.js +28 -0
  100. package/dist/{chunk-O6TQT6RI.js → chunk-XTMJ7XDT.js} +1 -1
  101. package/dist/{chunk-VNMT7C64.js → chunk-XVF2VVXP.js} +5 -3
  102. package/dist/chunk-Z527N6YQ.js +28 -0
  103. package/dist/{chunk-NTUJEGDZ.js → chunk-ZANLILYD.js} +22 -2
  104. package/dist/{chunk-6P62QVEA.js → chunk-ZGDGW2V3.js} +2 -2
  105. package/dist/{chunk-ODEEOXPH.js → chunk-ZHFZWTZV.js} +12 -11
  106. package/dist/{chunk-AJVLWNFN.js → chunk-ZXYDQ3TZ.js} +5 -5
  107. package/dist/index.js +102097 -97778
  108. package/dist/mcp/analyze-cli.js +18 -8
  109. package/dist/mcp/cli.js +48 -37
  110. package/dist/mcp/server.js +695 -426
  111. package/dist/mcp/worker.js +66 -55
  112. package/dist/probes/installer.js +20 -19
  113. package/docs/ast-grep_rules_catalog.md +2 -2
  114. package/docs/astplayground.md +1 -1
  115. package/docs/configuration.md +38 -2
  116. package/docs/custom-rules.md +25 -2
  117. package/docs/dependencies.md +3 -0
  118. package/docs/environment-variables.md +34 -6
  119. package/docs/features.md +39 -3
  120. package/docs/globalconfig.md +3 -1
  121. package/docs/language-coverage.md +2 -1
  122. package/docs/lsp-capability-matrix.md +29 -6
  123. package/docs/lsp-idle-eviction.md +38 -47
  124. package/docs/pi-lens-fixer.md +13 -5
  125. package/docs/pi-lens-merge-policy.md +48 -1
  126. package/docs/pi-lens-monitor.md +3 -1
  127. package/docs/pi-lens-retro.md +2 -1
  128. package/docs/pi-lens-reviewer.md +19 -3
  129. package/docs/pi-lens-subagent.md +2 -0
  130. package/docs/real-harness.md +17 -0
  131. package/docs/schema/pi-lens-config-v1.json +565 -0
  132. package/docs/servercapabilities.md +18 -4
  133. package/docs/settings.md +2 -1
  134. package/docs/word-index.md +6 -0
  135. package/package.json +1 -1
  136. package/rules/ast-grep-rules/rule-tests/no-identity-operator-on-literals-test.yml +12 -2
  137. package/rules/ast-grep-rules/rule-tests/throw-new-error-js-test.yml +2 -0
  138. package/rules/ast-grep-rules/rule-tests/throw-new-error-test.yml +2 -0
  139. package/rules/ast-grep-rules/rules/no-identity-operator-on-literals.yml +20 -12
  140. package/rules/ast-grep-rules/rules/throw-new-error-js.yml +2 -2
  141. package/rules/ast-grep-rules/rules/throw-new-error.yml +2 -2
  142. package/dist/chunk-54B42YRX.js +0 -27
  143. package/dist/chunk-CGGAIP7J.js +0 -29
  144. package/dist/chunk-D6QS3U6M.js +0 -30
  145. package/dist/chunk-HMFXILPV.js +0 -83
  146. package/dist/chunk-LSMJ6KBE.js +0 -4139
  147. package/dist/chunk-NTHH2J74.js +0 -27
  148. package/dist/chunk-RPD4ZSB7.js +0 -25
  149. package/dist/chunk-T6D4Q4AQ.js +0 -54
  150. package/dist/chunk-VCSRSYLF.js +0 -81
@@ -4,6 +4,7 @@ import {
4
4
  DOTNET_CSHARP_ROOT_MARKERS,
5
5
  DOTNET_FSHARP_ROOT_MARKERS,
6
6
  KIND_EXTENSIONS,
7
+ LEAN_ROOT_MARKERS,
7
8
  NON_CODE_KINDS,
8
9
  SPECIAL_FILENAMES,
9
10
  TERRAGRUNT_FILENAMES,
@@ -16,17 +17,19 @@ import {
16
17
  isHelmYamlTemplatePath,
17
18
  isJstsFactFile,
18
19
  isReadableSourceFile
19
- } from "./chunk-5ZEJHV35.js";
20
- import "./chunk-VNMT7C64.js";
21
- import "./chunk-5THXD6X5.js";
22
- import "./chunk-UK3CMEAL.js";
23
- import "./chunk-Q5U6FMDI.js";
20
+ } from "./chunk-PHDMFAKM.js";
21
+ import "./chunk-XVF2VVXP.js";
22
+ import "./chunk-JMYYOTQG.js";
23
+ import "./chunk-QQNQ7SJW.js";
24
+ import "./chunk-AOHZU2BM.js";
25
+ import "./chunk-N2H3ZPZY.js";
24
26
  import "./chunk-NXL4FFQQ.js";
25
27
  export {
26
28
  CODE_KINDS,
27
29
  DOTNET_CSHARP_ROOT_MARKERS,
28
30
  DOTNET_FSHARP_ROOT_MARKERS,
29
31
  KIND_EXTENSIONS,
32
+ LEAN_ROOT_MARKERS,
30
33
  NON_CODE_KINDS,
31
34
  SPECIAL_FILENAMES,
32
35
  TERRAGRUNT_FILENAMES,
@@ -1,11 +1,11 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  loadPiLensProjectConfig
4
- } from "./chunk-DQ2NZ7C4.js";
4
+ } from "./chunk-2BBLFX75.js";
5
5
  import {
6
6
  lazyEnvNumber,
7
7
  toPositiveFinite
8
- } from "./chunk-UK3CMEAL.js";
8
+ } from "./chunk-AOHZU2BM.js";
9
9
 
10
10
  // dist/clients/project-scale.js
11
11
  var DEFAULT_PROJECT_SCALE_BASE = 2e3;
@@ -24,8 +24,8 @@ var PROJECT_SCALE_RATIOS = {
24
24
  projectDiagnosticsScanner: 0.25,
25
25
  /** review graph: files kept. 0.5 * 2,000 = 1,000. */
26
26
  reviewGraph: 0.5,
27
- /** startup scan: source files counted. 1 * 2,000 = 2,000. */
28
- startupScan: 1,
27
+ /** startup scan: source files counted. 1.25 * 2,000 = 2,500. */
28
+ startupScan: 1.25,
29
29
  /** jscpd: directory entries visited (its own gate, not source-filter's). 3 * 2,000 = 6,000. */
30
30
  jscpd: 3,
31
31
  /** word index: files indexed. 3 * 2,000 = 6,000. */
@@ -4,17 +4,17 @@ import {
4
4
  readCargoDependencyNames,
5
5
  readCargoPackageName,
6
6
  readCargoWorkspaceMembers
7
- } from "./chunk-PAK6IDME.js";
7
+ } from "./chunk-P7266HLM.js";
8
8
  import {
9
9
  getProjectIgnoreMatcher,
10
10
  isExcludedDirName
11
- } from "./chunk-VN2AXLEX.js";
11
+ } from "./chunk-C34ZXZ7O.js";
12
12
  import {
13
13
  getWorkspaceManifestMarkers
14
- } from "./chunk-VNMT7C64.js";
14
+ } from "./chunk-XVF2VVXP.js";
15
15
  import {
16
16
  normalizeMapKey
17
- } from "./chunk-Q5U6FMDI.js";
17
+ } from "./chunk-N2H3ZPZY.js";
18
18
 
19
19
  // dist/clients/review-graph/workspace-modules.js
20
20
  import * as fs from "node:fs";
@@ -52,41 +52,42 @@ import {
52
52
  tryLazyInstallFormatterTool,
53
53
  typstyleFormatter,
54
54
  zigFormatter
55
- } from "./chunk-F3AU2TMM.js";
56
- import "./chunk-C2AUYXQH.js";
55
+ } from "./chunk-ARJ6PLFH.js";
56
+ import "./chunk-OXXKQCSV.js";
57
57
  import "./chunk-FC4RP4I2.js";
58
- import "./chunk-HHYAELLJ.js";
58
+ import "./chunk-RPLINGVB.js";
59
+ import "./chunk-ZXYDQ3TZ.js";
59
60
  import "./chunk-QOZXJ4NA.js";
60
- import "./chunk-PAK6IDME.js";
61
- import "./chunk-AJVLWNFN.js";
62
- import "./chunk-YGVYKNSN.js";
63
- import "./chunk-LNAKEO63.js";
61
+ import "./chunk-P7266HLM.js";
62
+ import "./chunk-SAEFPSB6.js";
63
+ import "./chunk-GAEGEPOC.js";
64
64
  import "./chunk-Z3CCVDUB.js";
65
65
  import "./chunk-2BEMIWEW.js";
66
- import "./chunk-OQGFCZJ4.js";
67
- import "./chunk-RUOG5D2C.js";
68
- import "./chunk-U3VGR4VU.js";
69
- import "./chunk-NTUJEGDZ.js";
70
- import "./chunk-EOKRQ3SA.js";
71
- import "./chunk-WONERJTP.js";
72
- import "./chunk-22AVIGXS.js";
73
- import "./chunk-GVXA6CCE.js";
74
- import "./chunk-6QIUX4EP.js";
75
- import "./chunk-VHQLPIRJ.js";
76
- import "./chunk-VN2AXLEX.js";
66
+ import "./chunk-66VMUL7Q.js";
67
+ import "./chunk-Q7DUK4LX.js";
68
+ import "./chunk-AW7R2GWG.js";
69
+ import "./chunk-RWWYJ623.js";
70
+ import "./chunk-VRZP76YM.js";
71
+ import "./chunk-QOBUHWHX.js";
72
+ import "./chunk-QILIYSJF.js";
73
+ import "./chunk-6C7JWPCP.js";
74
+ import "./chunk-5NGR67U5.js";
75
+ import "./chunk-C34ZXZ7O.js";
77
76
  import "./chunk-BW5KFIQC.js";
78
77
  import "./chunk-QYF5S6P6.js";
79
- import "./chunk-5ZEJHV35.js";
80
- import "./chunk-DQ2NZ7C4.js";
81
- import "./chunk-VNMT7C64.js";
78
+ import "./chunk-PHDMFAKM.js";
79
+ import "./chunk-2BBLFX75.js";
80
+ import "./chunk-XVF2VVXP.js";
81
+ import "./chunk-ZANLILYD.js";
82
82
  import "./chunk-2EECBNC5.js";
83
- import "./chunk-N3YQJI6O.js";
84
- import "./chunk-O6TQT6RI.js";
85
- import "./chunk-5THXD6X5.js";
86
- import "./chunk-UK3CMEAL.js";
83
+ import "./chunk-JAU72XNY.js";
84
+ import "./chunk-XTMJ7XDT.js";
85
+ import "./chunk-JMYYOTQG.js";
86
+ import "./chunk-QQNQ7SJW.js";
87
+ import "./chunk-AOHZU2BM.js";
87
88
  import "./chunk-LJDODBBZ.js";
88
89
  import "./chunk-ABBOA7UD.js";
89
- import "./chunk-Q5U6FMDI.js";
90
+ import "./chunk-N2H3ZPZY.js";
90
91
  import "./chunk-NXL4FFQQ.js";
91
92
  export {
92
93
  ALL_FORMATTERS,
@@ -2,11 +2,12 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  getToolCommandSpec,
4
4
  shouldAutoInstallTool
5
- } from "./chunk-HHYAELLJ.js";
5
+ } from "./chunk-RPLINGVB.js";
6
6
  import {
7
7
  BUILTIN_SERVER_RUNNER_COVERS,
8
- getServersForFileWithConfig
9
- } from "./chunk-B3I2UUT4.js";
8
+ getServersForFileWithConfig,
9
+ isAuxiliary
10
+ } from "./chunk-ESBQHFMJ.js";
10
11
  import {
11
12
  PathKeyedMap
12
13
  } from "./chunk-Z3CCVDUB.js";
@@ -19,21 +20,22 @@ import {
19
20
  isSpawnableCommand,
20
21
  logSessionStart,
21
22
  resetPathWalkMemo
22
- } from "./chunk-OQGFCZJ4.js";
23
+ } from "./chunk-66VMUL7Q.js";
23
24
  import {
24
25
  resolveToolCwd
25
- } from "./chunk-RUOG5D2C.js";
26
+ } from "./chunk-Q7DUK4LX.js";
26
27
  import {
27
28
  VENDOR_BIN_DIRS,
28
29
  VENV_BIN_DIRS,
29
30
  findGlobalBinary,
30
31
  findLocalBinAt,
31
- findLocalBinUpwards
32
- } from "./chunk-U3VGR4VU.js";
32
+ findLocalBinUpwards,
33
+ localBinPath
34
+ } from "./chunk-AW7R2GWG.js";
33
35
  import {
34
36
  createAvailabilityProbeFlight,
35
37
  probeToolAsync
36
- } from "./chunk-EOKRQ3SA.js";
38
+ } from "./chunk-RWWYJ623.js";
37
39
  import {
38
40
  classifyProbeFailure,
39
41
  createAvailabilityLatch,
@@ -43,21 +45,24 @@ import {
43
45
  logAvailabilityDecision,
44
46
  startHostStallSampler,
45
47
  transientRetryDelayMs
46
- } from "./chunk-WONERJTP.js";
48
+ } from "./chunk-VRZP76YM.js";
47
49
  import {
48
50
  createGenerationSource,
49
51
  getGlobalPiLensDir,
50
52
  isInSpawnTimeoutCooldown,
51
53
  safeSpawnAsync
52
- } from "./chunk-VN2AXLEX.js";
54
+ } from "./chunk-C34ZXZ7O.js";
55
+ import {
56
+ getProjectTrustState
57
+ } from "./chunk-ZANLILYD.js";
53
58
  import {
54
59
  compareOrdinal,
55
60
  incrementDegradationCount
56
- } from "./chunk-N3YQJI6O.js";
61
+ } from "./chunk-JAU72XNY.js";
57
62
  import {
58
63
  normalizeEphemeralMapKey,
59
64
  normalizeMapKey
60
- } from "./chunk-Q5U6FMDI.js";
65
+ } from "./chunk-N2H3ZPZY.js";
61
66
 
62
67
  // dist/clients/dispatch/runners/utils/runner-helpers.js
63
68
  import * as fs from "node:fs";
@@ -66,7 +71,7 @@ import { fileURLToPath } from "node:url";
66
71
  function lspPrimaryCoversFile(ctx, runnerId) {
67
72
  if (ctx.pi?.getFlag?.("no-lsp"))
68
73
  return void 0;
69
- const primary = getServersForFileWithConfig(ctx.filePath).find((s) => s.role !== "auxiliary");
74
+ const primary = getServersForFileWithConfig(ctx.filePath).find((s) => !isAuxiliary(s));
70
75
  if (!primary)
71
76
  return void 0;
72
77
  const fact = primary.custom ? void 0 : BUILTIN_SERVER_RUNNER_COVERS.get(primary.id);
@@ -186,10 +191,10 @@ async function findManagedReleaseBinary(tool, verificationArgs = ["--version"])
186
191
  }
187
192
  function createVenvFinder(command, windowsExt = "", verificationArgs = ["--version"]) {
188
193
  return async (cwd) => {
189
- const venvBin = findLocalBinAt(command, cwd, {
194
+ const venvBin = localBinPath(findLocalBinAt(command, cwd, {
190
195
  windowsExt,
191
196
  binDirs: VENV_BIN_DIRS
192
- });
197
+ }));
193
198
  if (venvBin)
194
199
  return { path: venvBin, rung: "venv" };
195
200
  const managed = await findManagedNodeToolBinary(command, verificationArgs);
@@ -233,6 +238,8 @@ async function getManagedToolEnvironment(_toolId, cwd) {
233
238
  }
234
239
  if (!cwd)
235
240
  return env;
241
+ if (getProjectTrustState() !== "trusted")
242
+ return env;
236
243
  const separator = process.platform === "win32" ? ";" : ":";
237
244
  const currentPath = env.PATH || env.Path || process.env.PATH || "";
238
245
  const localBin = path.join(cwd, "node_modules", ".bin");
@@ -811,10 +818,8 @@ function createCwdCachedProbe(probe, options) {
811
818
  return cached;
812
819
  }
813
820
  function resolveNodeToolCommand(cwd, toolName, windowsExt = ".cmd") {
814
- const isWin = process.platform === "win32";
815
- const binName = isWin ? `${toolName}${windowsExt}` : toolName;
816
- const local = path.join(cwd, "node_modules", ".bin", binName);
817
- if (fs.existsSync(local))
821
+ const local = localBinPath(findLocalBinAt(toolName, cwd, { windowsExt }));
822
+ if (local)
818
823
  return local;
819
824
  return toolName;
820
825
  }
@@ -825,10 +830,10 @@ function resolveToolCommand(cwd, toolId) {
825
830
  return resolveNodeToolCommand(cwd, spec.command, spec.windowsExt ?? ".cmd");
826
831
  }
827
832
  function resolveVendorToolCommand(cwd, toolName, windowsExt = ".bat") {
828
- return findLocalBinUpwards(toolName, cwd, {
833
+ return localBinPath(findLocalBinUpwards(toolName, cwd, {
829
834
  windowsExt,
830
835
  binDirs: VENDOR_BIN_DIRS
831
- }) ?? null;
836
+ })) ?? null;
832
837
  }
833
838
  async function resolveToolCommandWithInstallFallback(cwd, toolId, timeout = 5e3) {
834
839
  const spec = getToolCommandSpec(toolId);
@@ -948,14 +953,12 @@ function getSgCommand() {
948
953
  ensureCurrentSgGeneration();
949
954
  return {
950
955
  cmd: sgCmd ?? "npx",
951
- args: sgCmdArgs.length ? sgCmdArgs : ["--no", "--", "ast-grep"]
956
+ args: sgCmdArgs.length ? sgCmdArgs : ["--no", "--package", "@ast-grep/cli", "--", "ast-grep"]
952
957
  };
953
958
  }
954
959
  async function resolveLocalFirstAsync(toolName, cwd, windowsExt = ".cmd") {
955
- const isWin = process.platform === "win32";
956
- const binName = isWin ? `${toolName}${windowsExt}` : toolName;
957
- const local = path.join(cwd, "node_modules", ".bin", binName);
958
- if (fs.existsSync(local))
960
+ const local = localBinPath(findLocalBinAt(toolName, cwd, { windowsExt }));
961
+ if (local)
959
962
  return { cmd: local, args: [] };
960
963
  const globalBin = await findGlobalBinary(toolName, windowsExt);
961
964
  if (globalBin)
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  withTreeSitterRoot
4
- } from "./chunk-LW6XKDZQ.js";
4
+ } from "./chunk-QHJ6DQ2R.js";
5
5
 
6
6
  // dist/clients/dispatch/facts/tree-sitter-facts.js
7
7
  var withFactTree = withTreeSitterRoot;
@@ -1,30 +1,30 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  SecurityScanClient
4
- } from "./chunk-7F72PXY2.js";
4
+ } from "./chunk-IXXDFY73.js";
5
5
  import {
6
6
  firstOutputLine,
7
7
  spawnFailedWithNoOutput
8
- } from "./chunk-I7SPGOWI.js";
9
- import {
10
- assertInstallAllowed
11
- } from "./chunk-NTUJEGDZ.js";
8
+ } from "./chunk-UZ3TUTRV.js";
12
9
  import {
13
10
  probeToolAsync
14
- } from "./chunk-EOKRQ3SA.js";
11
+ } from "./chunk-RWWYJ623.js";
15
12
  import {
16
13
  INSTALL_TRANSIENT_MAX_ATTEMPTS,
17
14
  classifyProbeFailure,
18
15
  describeProbeEvidence,
19
16
  logAvailabilityDecision,
20
17
  startHostStallSampler
21
- } from "./chunk-WONERJTP.js";
18
+ } from "./chunk-VRZP76YM.js";
22
19
  import {
23
20
  safeSpawnAsync
24
- } from "./chunk-VN2AXLEX.js";
21
+ } from "./chunk-C34ZXZ7O.js";
22
+ import {
23
+ assertInstallAllowed
24
+ } from "./chunk-ZANLILYD.js";
25
25
  import {
26
26
  recordDegradationOnce
27
- } from "./chunk-N3YQJI6O.js";
27
+ } from "./chunk-JAU72XNY.js";
28
28
 
29
29
  // dist/clients/govulncheck-client.js
30
30
  import * as fs from "node:fs";
@@ -1,21 +1,21 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  getProjectDataDir
4
- } from "./chunk-VN2AXLEX.js";
4
+ } from "./chunk-C34ZXZ7O.js";
5
5
  import {
6
6
  createNdjsonLogger,
7
7
  getGlobalPiLensLogDir,
8
8
  getProcessSingleton,
9
9
  getTurnId,
10
10
  isTestMode
11
- } from "./chunk-UK3CMEAL.js";
11
+ } from "./chunk-AOHZU2BM.js";
12
12
  import {
13
13
  BoundedFifoMap
14
14
  } from "./chunk-ABBOA7UD.js";
15
15
  import {
16
16
  normalizeFilePath,
17
17
  normalizeMapKey
18
- } from "./chunk-Q5U6FMDI.js";
18
+ } from "./chunk-N2H3ZPZY.js";
19
19
 
20
20
  // dist/clients/hashline-anchor.js
21
21
  var HASHLINE_ANCHOR_LENGTH = 3;
@@ -235,7 +235,10 @@ function shouldLogEvent(event) {
235
235
  // Same rarity argument as #1913 for the reasons that DO fire: each is
236
236
  // rising-edge gated once per file per session, so always-on
237
237
  // visibility costs nothing.
238
- event === "read_file_evicted" || event === "edits_cap_trimmed";
238
+ event === "read_file_evicted" || event === "edits_cap_trimmed" || // #4131: a file's authorship ended because another writer changed its
239
+ // bytes. Once per authorship episode: the retired file needs a read or
240
+ // a known-content write before a writer can author it again.
241
+ event === "authorship_retired";
239
242
  }
240
243
  var MAX_TELEMETRY_STRING = 512;
241
244
  var MAX_TELEMETRY_KEYS = 64;
@@ -314,6 +317,7 @@ export {
314
317
  normalizeMessage,
315
318
  hashText,
316
319
  stableFindingId,
320
+ sanitizeCorrelationId,
317
321
  getReadGuardCorrelationId,
318
322
  createReadGuardEditBatchSummary,
319
323
  logReadGuardEvent,
@@ -7,24 +7,27 @@ import {
7
7
  parseTrivyReport,
8
8
  parseTrivySecrets,
9
9
  resolveSeverityFloor,
10
- shouldScanTrivy
11
- } from "./chunk-DFVMIKMQ.js";
12
- import "./chunk-TO6WL3GM.js";
13
- import "./chunk-7F72PXY2.js";
14
- import "./chunk-EOKRQ3SA.js";
15
- import "./chunk-WONERJTP.js";
16
- import "./chunk-VN2AXLEX.js";
10
+ shouldScanTrivy,
11
+ worktreeSkipDirs
12
+ } from "./chunk-66SXUJCA.js";
13
+ import "./chunk-VCHXCQFG.js";
14
+ import "./chunk-IXXDFY73.js";
15
+ import "./chunk-PNQDPDRC.js";
16
+ import "./chunk-RWWYJ623.js";
17
+ import "./chunk-VRZP76YM.js";
18
+ import "./chunk-C34ZXZ7O.js";
17
19
  import "./chunk-BW5KFIQC.js";
18
- import "./chunk-DQ2NZ7C4.js";
19
- import "./chunk-VNMT7C64.js";
20
+ import "./chunk-2BBLFX75.js";
21
+ import "./chunk-XVF2VVXP.js";
20
22
  import "./chunk-2EECBNC5.js";
21
- import "./chunk-N3YQJI6O.js";
22
- import "./chunk-O6TQT6RI.js";
23
- import "./chunk-5THXD6X5.js";
24
- import "./chunk-UK3CMEAL.js";
23
+ import "./chunk-JAU72XNY.js";
24
+ import "./chunk-XTMJ7XDT.js";
25
+ import "./chunk-JMYYOTQG.js";
26
+ import "./chunk-QQNQ7SJW.js";
27
+ import "./chunk-AOHZU2BM.js";
25
28
  import "./chunk-LJDODBBZ.js";
26
29
  import "./chunk-ABBOA7UD.js";
27
- import "./chunk-Q5U6FMDI.js";
30
+ import "./chunk-N2H3ZPZY.js";
28
31
  import "./chunk-NXL4FFQQ.js";
29
32
  export {
30
33
  TrivyClient,
@@ -34,5 +37,6 @@ export {
34
37
  parseTrivyReport,
35
38
  parseTrivySecrets,
36
39
  resolveSeverityFloor,
37
- shouldScanTrivy
40
+ shouldScanTrivy,
41
+ worktreeSkipDirs
38
42
  };
@@ -2,7 +2,7 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  createAvailabilityProbeFlight,
4
4
  probeToolAsync
5
- } from "./chunk-EOKRQ3SA.js";
5
+ } from "./chunk-RWWYJ623.js";
6
6
  import {
7
7
  classifyProbeFailure,
8
8
  createAvailabilityLatch,
@@ -10,13 +10,13 @@ import {
10
10
  describeProbeEvidence,
11
11
  logAvailabilityDecision,
12
12
  startHostStallSampler
13
- } from "./chunk-WONERJTP.js";
13
+ } from "./chunk-VRZP76YM.js";
14
14
  import {
15
15
  createSingleFlight
16
16
  } from "./chunk-BW5KFIQC.js";
17
17
  import {
18
18
  createSubsystemLogger
19
- } from "./chunk-O6TQT6RI.js";
19
+ } from "./chunk-XTMJ7XDT.js";
20
20
 
21
21
  // dist/clients/security-scan-client.js
22
22
  import * as path from "node:path";
@@ -0,0 +1,26 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ getSourceFiles,
4
+ getSourceFilesAsync
5
+ } from "./chunk-QILIYSJF.js";
6
+ import "./chunk-6C7JWPCP.js";
7
+ import "./chunk-5NGR67U5.js";
8
+ import "./chunk-C34ZXZ7O.js";
9
+ import "./chunk-QYF5S6P6.js";
10
+ import "./chunk-PHDMFAKM.js";
11
+ import "./chunk-2BBLFX75.js";
12
+ import "./chunk-XVF2VVXP.js";
13
+ import "./chunk-2EECBNC5.js";
14
+ import "./chunk-JAU72XNY.js";
15
+ import "./chunk-XTMJ7XDT.js";
16
+ import "./chunk-JMYYOTQG.js";
17
+ import "./chunk-QQNQ7SJW.js";
18
+ import "./chunk-AOHZU2BM.js";
19
+ import "./chunk-LJDODBBZ.js";
20
+ import "./chunk-ABBOA7UD.js";
21
+ import "./chunk-N2H3ZPZY.js";
22
+ import "./chunk-NXL4FFQQ.js";
23
+ export {
24
+ getSourceFiles,
25
+ getSourceFilesAsync
26
+ };
@@ -1,11 +1,13 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  logExtension
4
- } from "./chunk-O6TQT6RI.js";
4
+ } from "./chunk-XTMJ7XDT.js";
5
+ import {
6
+ DEPRECATED_CONFIG_SURFACES
7
+ } from "./chunk-JMYYOTQG.js";
5
8
  import {
6
- DEPRECATED_CONFIG_SURFACES,
7
9
  logLatency
8
- } from "./chunk-5THXD6X5.js";
10
+ } from "./chunk-QQNQ7SJW.js";
9
11
  import {
10
12
  PROCESS_SINGLETON_RESET_KIND,
11
13
  getProbeHomeRedirectEvent,
@@ -16,15 +18,7 @@ import {
16
18
  getSinkWriteFailures,
17
19
  resetSinkRotations,
18
20
  resetSinkWriteFailures
19
- } from "./chunk-UK3CMEAL.js";
20
-
21
- // dist/clients/string-utils.js
22
- function compareOrdinal(a, b) {
23
- return a < b ? -1 : a > b ? 1 : 0;
24
- }
25
- function escapeRegExp(value) {
26
- return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
27
- }
21
+ } from "./chunk-AOHZU2BM.js";
28
22
 
29
23
  // dist/clients/ledger-bounds.js
30
24
  var LEDGER_FIELD_MAX = 200;
@@ -87,13 +81,15 @@ function recordDegradationOnce(record) {
87
81
  const subject = subjectForLedger(record.subject);
88
82
  const key = `${kind}\0${subject}`;
89
83
  if (onceKeys.has(key))
90
- return;
84
+ return false;
91
85
  onceKeys.add(key);
92
86
  if (recordDegradation({ kind, subject, reason: record.reason })) {
93
87
  logDurableDegradation(kind, subject, 1, record.metadata, record.code);
94
88
  }
89
+ return true;
95
90
  } catch (error) {
96
91
  debugLedgerFailure("record-once", error);
92
+ return false;
97
93
  }
98
94
  }
99
95
  function incrementDegradationCount(record) {
@@ -343,6 +339,14 @@ function resetDegradationLedger() {
343
339
  resetSinkRotations();
344
340
  }
345
341
 
342
+ // dist/clients/string-utils.js
343
+ function compareOrdinal(a, b) {
344
+ return a < b ? -1 : a > b ? 1 : 0;
345
+ }
346
+ function escapeRegExp(value) {
347
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
348
+ }
349
+
346
350
  // dist/clients/lens-flag-registry.js
347
351
  function globalOptInFlag(name, description, configKey) {
348
352
  return {
@@ -793,6 +797,7 @@ var TOOL_REGISTRY = [
793
797
  }
794
798
  ];
795
799
  var LENS_TOOL_NAMES = TOOL_REGISTRY.map((tool) => tool.name);
800
+ var PI_LENS_TOOL_NAMES = TOOL_REGISTRY.flatMap((tool) => tool.piName === void 0 ? [] : [tool.piName]);
796
801
  function resolveLensToolName(name, host = "pi") {
797
802
  const entry = TOOL_REGISTRY.find((tool) => tool.name === name || tool.piName === name || tool.mcpName === name);
798
803
  if (!entry)
@@ -864,8 +869,6 @@ function readToolConfig(raw, warnInvalid) {
864
869
  }
865
870
 
866
871
  export {
867
- compareOrdinal,
868
- escapeRegExp,
869
872
  LEDGER_FIELD_MAX,
870
873
  DEGRADATION_ENTRIES_PER_KIND,
871
874
  truncateForLedger,
@@ -876,6 +879,8 @@ export {
876
879
  getDegradationSummary,
877
880
  renderDegradationLines,
878
881
  resetDegradationLedger,
882
+ compareOrdinal,
883
+ escapeRegExp,
879
884
  LENS_FLAGS,
880
885
  getLensFlagSpec,
881
886
  PROJECT_SCOPED_LENS_FLAGS,
@@ -0,0 +1,77 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+
3
+ // dist/clients/config-diagnostic-codes.js
4
+ var STABILITY_TIER_KEY = "x-stability";
5
+ var CONFIG_SCHEMA_ID = "https://raw.githubusercontent.com/apmantza/pi-lens/master/docs/schema/pi-lens-config-v1.json";
6
+ var CONFIG_SCHEMA_ANCHOR_KEY = "$schema";
7
+ function configDiagnosticMarker(code) {
8
+ return `[${code}]`;
9
+ }
10
+ function withConfigDiagnosticCode(message, code) {
11
+ const marker = configDiagnosticMarker(code);
12
+ return message.includes(marker) ? message : `${message} ${marker}`;
13
+ }
14
+ var LSP_DEPRECATION_WINDOW = {
15
+ deprecatedSince: "4.1.4",
16
+ removeNotBefore: "5.0.0"
17
+ };
18
+ var LEGACY_KEY = {
19
+ kind: "key",
20
+ code: "PILENS_CFG_0002",
21
+ ...LSP_DEPRECATION_WINDOW
22
+ };
23
+ var LEGACY_FILE = {
24
+ kind: "file",
25
+ code: "PILENS_CFG_0003",
26
+ ...LSP_DEPRECATION_WINDOW
27
+ };
28
+ var DEPRECATED_CONFIG_SURFACES = [
29
+ {
30
+ ...LEGACY_KEY,
31
+ surface: "servers",
32
+ reason: "custom-server definitions move to the unified catalog schema; the bare string command + args form is replaced by the trust-gated ProcessSpec (#2416)."
33
+ },
34
+ {
35
+ ...LEGACY_KEY,
36
+ surface: "serverOverrides",
37
+ reason: "per-server initializationOptions overrides fold into the catalog's field-wise merge, keyed by the same public server IDs (#2416)."
38
+ },
39
+ {
40
+ ...LEGACY_KEY,
41
+ surface: "disabledServers",
42
+ reason: "replaced by the catalog's per-entry `enabled: false`, which carries monotonic deny precedence (#1416/#2415)."
43
+ },
44
+ {
45
+ ...LEGACY_KEY,
46
+ surface: "warmFiles",
47
+ reason: "session warm-up seeds become a per-server catalog field rather than a config-root list (#2416)."
48
+ },
49
+ {
50
+ ...LEGACY_FILE,
51
+ surface: ".pi-lens/lsp.json",
52
+ reason: "project LSP settings consolidate into `.pi-lens.json` under the unified envelope (#2426)."
53
+ },
54
+ {
55
+ ...LEGACY_FILE,
56
+ surface: "pi-lsp.json",
57
+ reason: "pre-rename project location; superseded by `.pi-lens.json` (#2426)."
58
+ },
59
+ {
60
+ ...LEGACY_FILE,
61
+ surface: "pi-lens.json",
62
+ reason: "undotted project-config basename; superseded by `.pi-lens.json` (#2426)."
63
+ },
64
+ {
65
+ ...LEGACY_FILE,
66
+ surface: "~/.pi-lens/lsp.json",
67
+ reason: "global LSP settings consolidate into `~/.pi-lens/config.json` (#2426)."
68
+ }
69
+ ];
70
+
71
+ export {
72
+ STABILITY_TIER_KEY,
73
+ CONFIG_SCHEMA_ID,
74
+ CONFIG_SCHEMA_ANCHOR_KEY,
75
+ withConfigDiagnosticCode,
76
+ DEPRECATED_CONFIG_SURFACES
77
+ };