pi-lens 4.4.8 → 4.4.10

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 (169) hide show
  1. package/CHANGELOG-USER.md +31 -0
  2. package/CHANGELOG.md +258 -0
  3. package/README.md +4 -1
  4. package/config/dependency-cruiser-eager-allowlist.json +1 -1
  5. package/dist/{chunk-6YUNI7B5.js → chunk-2ADRLTM2.js} +14 -60
  6. package/dist/{chunk-4B2YFN4U.js → chunk-2LVJQU3I.js} +46 -33
  7. package/dist/{chunk-2453RRJ2.js → chunk-3FRI5H4T.js} +72 -23
  8. package/dist/{chunk-7MAD5ZAY.js → chunk-3HM4BUHR.js} +14 -16
  9. package/dist/chunk-3QWVOBZJ.js +73 -0
  10. package/dist/{chunk-PIQQM32Y.js → chunk-46TQJSUE.js} +4 -2
  11. package/dist/{chunk-RZG472YW.js → chunk-4ITEFRDH.js} +84 -46
  12. package/dist/{chunk-6FIRFP6A.js → chunk-4NCDHTFI.js} +10 -12
  13. package/dist/{chunk-7CGIDRIK.js → chunk-6I44EDNQ.js} +14 -16
  14. package/dist/{chunk-2BKUFQKR.js → chunk-6MDM5MQT.js} +554 -217
  15. package/dist/{chunk-BBET6HD6.js → chunk-7JX3RNG4.js} +1 -1
  16. package/dist/{chunk-JE6HKLC7.js → chunk-7WJ55KBN.js} +2 -4
  17. package/dist/{chunk-4BKU7PV3.js → chunk-A5TEJZGJ.js} +2 -1
  18. package/dist/{chunk-7ANZ7XDD.js → chunk-ACRJ2GZ5.js} +2 -2
  19. package/dist/{chunk-2ZE3AUJQ.js → chunk-ALIZWXHZ.js} +13 -15
  20. package/dist/{chunk-BQG2QFVO.js → chunk-AON2QIJF.js} +43 -55
  21. package/dist/chunk-B2YUE6YD.js +23 -0
  22. package/dist/{chunk-L4NEVZ4T.js → chunk-B6HXETWY.js} +25 -27
  23. package/dist/chunk-BDR5MEZY.js +25 -0
  24. package/dist/{chunk-HXFUTMX2.js → chunk-BGLS5SDN.js} +2 -2
  25. package/dist/{chunk-ZZDIOAAJ.js → chunk-BRESRQBE.js} +6 -6
  26. package/dist/{chunk-WXUDRAG6.js → chunk-C6AODRNU.js} +10 -12
  27. package/dist/{chunk-GMROJJRN.js → chunk-CB7PEVOJ.js} +9 -1
  28. package/dist/{chunk-BHWW6FAX.js → chunk-CTB5BAJI.js} +53 -22
  29. package/dist/{chunk-VN3L2JWZ.js → chunk-CYUJB552.js} +5 -5
  30. package/dist/{chunk-6GMGEKQN.js → chunk-CZAWWXP6.js} +39 -12
  31. package/dist/{chunk-G5GV2Q7K.js → chunk-CZCAZVTD.js} +16 -2
  32. package/dist/chunk-DBS736MA.js +57 -0
  33. package/dist/{chunk-OWTG6UMO.js → chunk-DOUAWKLO.js} +75 -22
  34. package/dist/{chunk-BOPDQ7AZ.js → chunk-DVRJBQOJ.js} +19 -21
  35. package/dist/{chunk-UHHLR2VY.js → chunk-E4VXKTBR.js} +38 -41
  36. package/dist/{chunk-X66YJ2SS.js → chunk-F6FT6BVQ.js} +33 -34
  37. package/dist/{chunk-GIRBSBGL.js → chunk-FCQSZQAT.js} +3 -3
  38. package/dist/{chunk-X35S7HSB.js → chunk-FOEPIX76.js} +41 -30
  39. package/dist/{chunk-MC6VB2E5.js → chunk-GMC4ZGYR.js} +17 -5
  40. package/dist/{chunk-7TNILKGY.js → chunk-GTTMQ6XB.js} +1 -1
  41. package/dist/{chunk-HHR7WGCI.js → chunk-GUGKKGG7.js} +3 -3
  42. package/dist/{chunk-OZWXLJMX.js → chunk-GVWIU7M7.js} +2 -2
  43. package/dist/{chunk-WMDUT4KH.js → chunk-H65TYP6V.js} +94 -90
  44. package/dist/{chunk-5F3XF3SX.js → chunk-HILZE4BQ.js} +9 -8
  45. package/dist/{chunk-PKSUMEPT.js → chunk-HSYFLOZY.js} +3 -3
  46. package/dist/{chunk-4QG55RRC.js → chunk-I32RSMH6.js} +10 -12
  47. package/dist/chunk-I74RQGKA.js +88 -0
  48. package/dist/{chunk-G6JKM4O7.js → chunk-IDCTDKIA.js} +10 -10
  49. package/dist/chunk-IK4YS3KC.js +25 -0
  50. package/dist/{chunk-O2ARHQKF.js → chunk-IL6PIV33.js} +2 -2
  51. package/dist/{chunk-L3CLUGDY.js → chunk-J6BR5XN2.js} +3 -3
  52. package/dist/chunk-JKOZ2Z4U.js +20 -0
  53. package/dist/{chunk-SP4TFY5F.js → chunk-JZQGRARR.js} +11 -13
  54. package/dist/{chunk-CUDD35TW.js → chunk-K6WIBVMK.js} +6 -5
  55. package/dist/{chunk-DIWK3LBC.js → chunk-KDCIG23C.js} +8 -10
  56. package/dist/{chunk-4NBWFYWW.js → chunk-KFRDFAOE.js} +8 -33
  57. package/dist/{chunk-I22THIHI.js → chunk-KJ3AHOCK.js} +10 -12
  58. package/dist/{chunk-VOP4PJKA.js → chunk-KSTQ4VXT.js} +7 -9
  59. package/dist/{chunk-RGGH6M34.js → chunk-LT62P654.js} +1 -1
  60. package/dist/chunk-MAD4QJTP.js +198 -0
  61. package/dist/{chunk-CM73PPGD.js → chunk-MN635QYA.js} +3 -4
  62. package/dist/{chunk-HUAM7QG3.js → chunk-NBM7PNBP.js} +25 -23
  63. package/dist/{chunk-DYRZGUMA.js → chunk-NE4EFHJX.js} +2 -2
  64. package/dist/{chunk-SQC7K3SP.js → chunk-NL5LSKVD.js} +2 -2
  65. package/dist/{chunk-JZRP4DGP.js → chunk-NPNFGYLV.js} +4 -2
  66. package/dist/{chunk-NM2NWH55.js → chunk-NUSXS6YB.js} +6 -5
  67. package/dist/{chunk-ZKLTNLAW.js → chunk-OPFNQBS5.js} +6 -6
  68. package/dist/{chunk-PPKECBPP.js → chunk-OTSTS7L2.js} +19 -1
  69. package/dist/{chunk-SFLHSL5R.js → chunk-PTSA6QKL.js} +18 -7
  70. package/dist/{chunk-OY7WZI7Q.js → chunk-Q2VCKC3X.js} +6 -6
  71. package/dist/{chunk-HKIL6DCL.js → chunk-QGITU23N.js} +1 -1
  72. package/dist/{chunk-3O5EII3W.js → chunk-QHOTTC4A.js} +2 -2
  73. package/dist/{chunk-35WKJWO5.js → chunk-QL37SGTS.js} +112 -20
  74. package/dist/{chunk-OC7VWJBZ.js → chunk-QMV2APEH.js} +35 -37
  75. package/dist/{chunk-BUZIQDFS.js → chunk-QSCZAP24.js} +3 -3
  76. package/dist/{chunk-O4N5BQ3T.js → chunk-QUPYLQA4.js} +8 -10
  77. package/dist/{chunk-A5GRLYPZ.js → chunk-QUQY3IME.js} +7 -13
  78. package/dist/{chunk-R2QQC33W.js → chunk-QWTHFFU6.js} +12 -14
  79. package/dist/{chunk-TV6RXRYH.js → chunk-RQRKIRFY.js} +8 -10
  80. package/dist/{chunk-ZFORSIED.js → chunk-S3WFVG5P.js} +15 -42
  81. package/dist/{chunk-5RNB4HVK.js → chunk-SG2JQ2YP.js} +1 -1
  82. package/dist/{chunk-KZ4ALBCH.js → chunk-SJQUWQR6.js} +2 -2
  83. package/dist/{chunk-T2S3FNNJ.js → chunk-SKVNHCT5.js} +41 -42
  84. package/dist/{chunk-SDFKOLSF.js → chunk-TJQSYX3J.js} +8 -6
  85. package/dist/{chunk-IYVYZQRL.js → chunk-TLWFZ66Y.js} +5 -7
  86. package/dist/{chunk-5T5A6YAJ.js → chunk-TN5CWX5D.js} +33 -34
  87. package/dist/chunk-TQHOKMVZ.js +28 -0
  88. package/dist/{chunk-XOMGO63G.js → chunk-TYHOEX4V.js} +19 -21
  89. package/dist/{chunk-6LJOJ6EO.js → chunk-UNBRHPHJ.js} +14 -16
  90. package/dist/{chunk-4LL2VRNY.js → chunk-UOO4D2TK.js} +16 -18
  91. package/dist/{chunk-AGGUWKRK.js → chunk-UY745U35.js} +1 -1
  92. package/dist/{chunk-LSFXZLPW.js → chunk-V7F7JHS5.js} +218 -253
  93. package/dist/{chunk-VLQ7UKZH.js → chunk-VCRVNLE7.js} +135 -2
  94. package/dist/{chunk-JPRDTY5S.js → chunk-VGTBLTPN.js} +8 -10
  95. package/dist/{chunk-JBP7KESM.js → chunk-VPFRU5IG.js} +1 -1
  96. package/dist/chunk-VS2L7QDI.js +25 -0
  97. package/dist/{chunk-4W52ZKZX.js → chunk-W4CUK5G6.js} +2 -2
  98. package/dist/{chunk-VPLBLWFO.js → chunk-W7TY6HYX.js} +1 -1
  99. package/dist/{chunk-JYLOYTZD.js → chunk-WAA63ZJV.js} +5 -1
  100. package/dist/{chunk-WC6WRNQT.js → chunk-WS3UFJOU.js} +2 -2
  101. package/dist/chunk-XAFZJEXY.js +50 -0
  102. package/dist/{chunk-XYLC35E4.js → chunk-XPGH5O74.js} +555 -336
  103. package/dist/{chunk-VOXTCULR.js → chunk-XVB3Q2PG.js} +2 -4
  104. package/dist/{chunk-FRLAUP2B.js → chunk-Y3EHLUPL.js} +4 -4
  105. package/dist/{chunk-CZL44WFN.js → chunk-YF4G5NN5.js} +2 -2
  106. package/dist/{chunk-XWIME22V.js → chunk-YQA34KAF.js} +11 -13
  107. package/dist/{chunk-FHEV6T4L.js → chunk-YT2VR4SL.js} +8 -10
  108. package/dist/chunk-ZD4KVFXI.js +234 -0
  109. package/dist/{chunk-NSPVR3FN.js → chunk-ZOPXB2KK.js} +17 -19
  110. package/dist/chunk-ZPFLHB3R.js +28 -0
  111. package/dist/{chunk-R4QWJQ2H.js → chunk-ZZDVGCGG.js} +9 -11
  112. package/dist/index.js +5398 -4438
  113. package/dist/mcp/analyze-cli.js +12 -17
  114. package/dist/mcp/cli.js +41 -42
  115. package/dist/mcp/server.js +1466 -663
  116. package/dist/mcp/worker.js +59 -60
  117. package/dist/probes/installer.js +17 -19
  118. package/docs/agent-guide.md +2 -1
  119. package/docs/agent-tools.md +53 -10
  120. package/docs/analysisall.md +1 -1
  121. package/docs/ci-bot-pr-checks.md +7 -5
  122. package/docs/configuration.md +60 -13
  123. package/docs/defect-shapes.md +67 -4
  124. package/docs/environment-variables.md +18 -1
  125. package/docs/features.md +23 -6
  126. package/docs/globalconfig.md +24 -3
  127. package/docs/invariants/language-config.md +9 -1
  128. package/docs/invariants/lsp-trust-exec.md +9 -2
  129. package/docs/invariants/session-telemetry.md +2 -2
  130. package/docs/language-coverage.md +67 -0
  131. package/docs/lsp-capability-matrix.md +121 -53
  132. package/docs/lsp-idle-eviction.md +20 -13
  133. package/docs/merge-queue-rollout.md +10 -8
  134. package/docs/module-report-read-symbol.md +34 -23
  135. package/docs/pi-lens-fixer.md +19 -7
  136. package/docs/pi-lens-investigator.md +3 -0
  137. package/docs/pi-lens-merge-policy.md +20 -8
  138. package/docs/pi-lens-release.md +3 -2
  139. package/docs/pi-lens-reviewer.md +53 -12
  140. package/docs/pi-lens-subagent.md +13 -0
  141. package/docs/public-api-stability.md +39 -5
  142. package/docs/release-qa-baseline.md +7 -4
  143. package/docs/schema/pi-lens-config-v1.json +11 -2
  144. package/docs/servercapabilities.md +3 -1
  145. package/docs/settings.md +9 -6
  146. package/docs/usage.md +1 -0
  147. package/docs/word-index.md +3 -2
  148. package/package.json +9 -4
  149. package/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +1 -2
  150. package/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +1 -2
  151. package/scripts/download-grammars.js +13 -2
  152. package/scripts/grammars.lock.json +7 -0
  153. package/skills/pi-lens-lsp-navigation/SKILL.md +5 -1
  154. package/vendor/grammars/tree-sitter-groovy.wasm +0 -0
  155. package/dist/chunk-2TS4GLOJ.js +0 -31
  156. package/dist/chunk-3JAHQBSY.js +0 -27
  157. package/dist/chunk-447YZL4S.js +0 -25
  158. package/dist/chunk-565VRUP4.js +0 -136
  159. package/dist/chunk-57X2CDRX.js +0 -49
  160. package/dist/chunk-GGYOZWHW.js +0 -27
  161. package/dist/chunk-IE5D3RA5.js +0 -58
  162. package/dist/chunk-LPYTPNOJ.js +0 -22
  163. package/dist/chunk-OFNMHPBT.js +0 -89
  164. package/dist/chunk-U3AS2FR6.js +0 -106
  165. package/dist/chunk-W3BGKBBK.js +0 -27
  166. package/dist/chunk-WQV6BI4Q.js +0 -48
  167. package/dist/chunk-YHGYAEFH.js +0 -443
  168. package/dist/chunk-ZONZ6YY3.js +0 -74
  169. package/dist/chunk-ZSM35JF4.js +0 -30
@@ -3,29 +3,28 @@ import {
3
3
  shouldRecurseIntoDir,
4
4
  walkTreeRecursiveSync,
5
5
  walkTreeStackAsync
6
- } from "./chunk-O2ARHQKF.js";
6
+ } from "./chunk-IL6PIV33.js";
7
7
  import {
8
8
  getProjectIgnoreMatcher
9
- } from "./chunk-WMDUT4KH.js";
9
+ } from "./chunk-H65TYP6V.js";
10
10
  import {
11
11
  KIND_EXTENSIONS,
12
+ SPECIAL_FILENAMES,
12
13
  isCodeKindFile
13
- } from "./chunk-G5GV2Q7K.js";
14
+ } from "./chunk-CZCAZVTD.js";
14
15
  import {
15
16
  classifyGeneratedOrArtifactDetailed,
16
17
  isDeclarationFile
17
- } from "./chunk-X35S7HSB.js";
18
- import {
19
- logLatency
20
- } from "./chunk-565VRUP4.js";
18
+ } from "./chunk-FOEPIX76.js";
21
19
  import {
20
+ logLatency,
22
21
  toPositiveFinite
23
- } from "./chunk-VLQ7UKZH.js";
22
+ } from "./chunk-VCRVNLE7.js";
24
23
  import {
25
24
  BoundedLruCache,
26
25
  normalizeEphemeralMapKey,
27
26
  normalizeFilePath
28
- } from "./chunk-GMROJJRN.js";
27
+ } from "./chunk-CB7PEVOJ.js";
29
28
 
30
29
  // dist/clients/source-filter.js
31
30
  import * as fs2 from "node:fs";
@@ -302,8 +301,9 @@ function classifyEntry(entry, fullPath, cfg, probeCache, skipCounters, siblings)
302
301
  }
303
302
  if (entry.isFile()) {
304
303
  const ext = path2.extname(entry.name).toLowerCase();
305
- if (!extensions.has(ext))
304
+ if (!extensions.has(ext) && !(options?.includeNamedFiles === true && SPECIAL_FILENAMES.some(({ pattern }) => pattern.test(entry.name)))) {
306
305
  return {};
306
+ }
307
307
  if (ignoreMatcher.isIgnored(fullPath, false))
308
308
  return {};
309
309
  if (isBuildArtifact(fullPath, probeCache, siblings)) {
@@ -0,0 +1,25 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ GoClient,
4
+ goClient,
5
+ resetGoAvailability
6
+ } from "./chunk-QHOTTC4A.js";
7
+ import "./chunk-QSCZAP24.js";
8
+ import "./chunk-VPFRU5IG.js";
9
+ import "./chunk-NPNFGYLV.js";
10
+ import "./chunk-H65TYP6V.js";
11
+ import "./chunk-AWQWXSW4.js";
12
+ import "./chunk-FOEPIX76.js";
13
+ import "./chunk-NL5LSKVD.js";
14
+ import "./chunk-7WJ55KBN.js";
15
+ import "./chunk-3FRI5H4T.js";
16
+ import "./chunk-S26LC76R.js";
17
+ import "./chunk-VCRVNLE7.js";
18
+ import "./chunk-LJDODBBZ.js";
19
+ import "./chunk-CB7PEVOJ.js";
20
+ import "./chunk-NXL4FFQQ.js";
21
+ export {
22
+ GoClient,
23
+ goClient,
24
+ resetGoAvailability
25
+ };
@@ -1,14 +1,14 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  isExcludedDirName
4
- } from "./chunk-WMDUT4KH.js";
4
+ } from "./chunk-H65TYP6V.js";
5
5
  import {
6
6
  createDeadline,
7
7
  yieldIfOverBudget
8
8
  } from "./chunk-QYF5S6P6.js";
9
9
  import {
10
10
  isGeneratedArtifactDirectoryName
11
- } from "./chunk-X35S7HSB.js";
11
+ } from "./chunk-FOEPIX76.js";
12
12
 
13
13
  // dist/clients/source-walker.js
14
14
  import * as fs from "node:fs";
@@ -4,14 +4,14 @@ import {
4
4
  } from "./chunk-3MED75HT.js";
5
5
  import {
6
6
  getProjectDataDir
7
- } from "./chunk-WMDUT4KH.js";
7
+ } from "./chunk-H65TYP6V.js";
8
8
  import {
9
9
  writeFileAtomic
10
- } from "./chunk-JE6HKLC7.js";
10
+ } from "./chunk-7WJ55KBN.js";
11
11
  import {
12
12
  normalizeMapKey,
13
13
  toProjectRelativePath
14
- } from "./chunk-GMROJJRN.js";
14
+ } from "./chunk-CB7PEVOJ.js";
15
15
 
16
16
  // dist/clients/call-graph.js
17
17
  import * as fs from "node:fs";
@@ -0,0 +1,20 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ AgentBehaviorClient,
4
+ agentBehaviorClient
5
+ } from "./chunk-GVWIU7M7.js";
6
+ import "./chunk-FCQSZQAT.js";
7
+ import "./chunk-H65TYP6V.js";
8
+ import "./chunk-FOEPIX76.js";
9
+ import "./chunk-NL5LSKVD.js";
10
+ import "./chunk-7WJ55KBN.js";
11
+ import "./chunk-3FRI5H4T.js";
12
+ import "./chunk-S26LC76R.js";
13
+ import "./chunk-VCRVNLE7.js";
14
+ import "./chunk-LJDODBBZ.js";
15
+ import "./chunk-CB7PEVOJ.js";
16
+ import "./chunk-NXL4FFQQ.js";
17
+ export {
18
+ AgentBehaviorClient,
19
+ agentBehaviorClient
20
+ };
@@ -44,26 +44,24 @@ import {
44
44
  setProjectSnapshotPromotionSeamForTests,
45
45
  terminateProjectSnapshotPersistWorkerForTests,
46
46
  waitForProjectSnapshotPersistsForTests
47
- } from "./chunk-ZZDIOAAJ.js";
48
- import "./chunk-HUAM7QG3.js";
49
- import "./chunk-HXFUTMX2.js";
47
+ } from "./chunk-BRESRQBE.js";
48
+ import "./chunk-NBM7PNBP.js";
49
+ import "./chunk-BGLS5SDN.js";
50
50
  import "./chunk-2BEMIWEW.js";
51
51
  import "./chunk-IJYGIDF4.js";
52
52
  import "./chunk-UYXV5NIS.js";
53
- import "./chunk-WMDUT4KH.js";
53
+ import "./chunk-H65TYP6V.js";
54
54
  import "./chunk-AWQWXSW4.js";
55
55
  import "./chunk-QYF5S6P6.js";
56
- import "./chunk-G5GV2Q7K.js";
57
- import "./chunk-X35S7HSB.js";
58
- import "./chunk-SQC7K3SP.js";
59
- import "./chunk-JE6HKLC7.js";
60
- import "./chunk-2453RRJ2.js";
61
- import "./chunk-WQV6BI4Q.js";
56
+ import "./chunk-CZCAZVTD.js";
57
+ import "./chunk-FOEPIX76.js";
58
+ import "./chunk-NL5LSKVD.js";
59
+ import "./chunk-7WJ55KBN.js";
60
+ import "./chunk-3FRI5H4T.js";
62
61
  import "./chunk-S26LC76R.js";
63
- import "./chunk-565VRUP4.js";
64
- import "./chunk-VLQ7UKZH.js";
62
+ import "./chunk-VCRVNLE7.js";
65
63
  import "./chunk-LJDODBBZ.js";
66
- import "./chunk-GMROJJRN.js";
64
+ import "./chunk-CB7PEVOJ.js";
67
65
  import "./chunk-NXL4FFQQ.js";
68
66
  export {
69
67
  PROJECT_SNAPSHOT_MAX_WARM_ROOTS,
@@ -4,18 +4,19 @@ import {
4
4
  readCargoDependencyNames,
5
5
  readCargoPackageName,
6
6
  readCargoWorkspaceMembers
7
- } from "./chunk-WC6WRNQT.js";
7
+ } from "./chunk-WS3UFJOU.js";
8
8
  import {
9
9
  getProjectIgnoreMatcher,
10
10
  isExcludedDirName
11
- } from "./chunk-WMDUT4KH.js";
11
+ } from "./chunk-H65TYP6V.js";
12
12
  import {
13
13
  getWorkspaceManifestMarkers
14
- } from "./chunk-SQC7K3SP.js";
14
+ } from "./chunk-NL5LSKVD.js";
15
15
  import {
16
+ isWithinForm,
16
17
  normalizeMapKey,
17
18
  toPosix
18
- } from "./chunk-GMROJJRN.js";
19
+ } from "./chunk-CB7PEVOJ.js";
19
20
 
20
21
  // dist/clients/review-graph/workspace-modules.js
21
22
  import * as fs from "node:fs";
@@ -293,7 +294,7 @@ function findModuleForPath(graph, filePath) {
293
294
  const normalized = normalizeMapKey(filePath);
294
295
  let best;
295
296
  for (const mod of graph.modules.values()) {
296
- if (normalized === mod.root || normalized.startsWith(`${mod.root}/`)) {
297
+ if (isWithinForm(normalized, mod.root)) {
297
298
  if (!best || mod.root.length > best.root.length)
298
299
  best = mod;
299
300
  }
@@ -4,33 +4,31 @@ import {
4
4
  discoverManagedTool,
5
5
  getManagedToolEnvironment,
6
6
  resolveAvailableOrInstall
7
- } from "./chunk-ZFORSIED.js";
7
+ } from "./chunk-S3WFVG5P.js";
8
8
  import {
9
9
  mapWithConcurrency
10
10
  } from "./chunk-XIMYZ3JA.js";
11
11
  import {
12
12
  findNodeToolBinary
13
- } from "./chunk-VOP4PJKA.js";
13
+ } from "./chunk-KSTQ4VXT.js";
14
14
  import {
15
15
  getIsolatedNpxSpawnOptions
16
- } from "./chunk-JBP7KESM.js";
16
+ } from "./chunk-VPFRU5IG.js";
17
17
  import {
18
18
  createAvailabilityLatch
19
- } from "./chunk-JZRP4DGP.js";
19
+ } from "./chunk-NPNFGYLV.js";
20
20
  import {
21
21
  safeSpawnAsync
22
- } from "./chunk-WMDUT4KH.js";
22
+ } from "./chunk-H65TYP6V.js";
23
23
  import {
24
24
  compareOrdinal,
25
+ createSubsystemLogger,
25
26
  recordDegradationOnce
26
- } from "./chunk-2453RRJ2.js";
27
- import {
28
- createSubsystemLogger
29
- } from "./chunk-WQV6BI4Q.js";
27
+ } from "./chunk-3FRI5H4T.js";
30
28
  import {
31
29
  isFullyQualified,
32
30
  isUnderDir
33
- } from "./chunk-GMROJJRN.js";
31
+ } from "./chunk-CB7PEVOJ.js";
34
32
 
35
33
  // dist/clients/dependency-checker.js
36
34
  import * as fs from "node:fs";
@@ -1,19 +1,17 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  getProjectDataDir
4
- } from "./chunk-WMDUT4KH.js";
5
- import "./chunk-X35S7HSB.js";
6
- import "./chunk-SQC7K3SP.js";
7
- import "./chunk-JE6HKLC7.js";
8
- import "./chunk-2453RRJ2.js";
9
- import "./chunk-WQV6BI4Q.js";
4
+ } from "./chunk-H65TYP6V.js";
5
+ import "./chunk-FOEPIX76.js";
6
+ import "./chunk-NL5LSKVD.js";
7
+ import "./chunk-7WJ55KBN.js";
8
+ import "./chunk-3FRI5H4T.js";
10
9
  import "./chunk-S26LC76R.js";
11
- import "./chunk-565VRUP4.js";
12
10
  import {
13
11
  redactSecrets
14
- } from "./chunk-VLQ7UKZH.js";
12
+ } from "./chunk-VCRVNLE7.js";
15
13
  import "./chunk-LJDODBBZ.js";
16
- import "./chunk-GMROJJRN.js";
14
+ import "./chunk-CB7PEVOJ.js";
17
15
  import "./chunk-NXL4FFQQ.js";
18
16
 
19
17
  // dist/clients/fix-worklog.js
@@ -67,31 +65,8 @@ function readWorklog(cwd) {
67
65
  return [];
68
66
  }
69
67
  }
70
- function summarizeWorklog(cwd) {
71
- const entries = readWorklog(cwd);
72
- const byRule = /* @__PURE__ */ new Map();
73
- let totalAutoFixed = 0;
74
- let totalFixable = 0;
75
- for (const e of entries) {
76
- const r = byRule.get(e.rule) ?? { count: 0, autoFixed: 0 };
77
- r.count++;
78
- if (e.autoFixed) {
79
- r.autoFixed++;
80
- totalAutoFixed++;
81
- }
82
- if (e.fixable)
83
- totalFixable++;
84
- byRule.set(e.rule, r);
85
- }
86
- return {
87
- totalAutoFixed,
88
- totalFixable,
89
- byRule: [...byRule.entries()].map(([rule, v]) => ({ rule, ...v })).sort((a, b) => b.count - a.count)
90
- };
91
- }
92
68
  export {
93
69
  appendToWorklog,
94
70
  getWorklogPath,
95
- readWorklog,
96
- summarizeWorklog
71
+ readWorklog
97
72
  };
@@ -15,21 +15,19 @@ import {
15
15
  getFilterStats,
16
16
  isBuildArtifact,
17
17
  sourceTwinCandidates
18
- } from "./chunk-G6JKM4O7.js";
19
- import "./chunk-O2ARHQKF.js";
20
- import "./chunk-WMDUT4KH.js";
18
+ } from "./chunk-IDCTDKIA.js";
19
+ import "./chunk-IL6PIV33.js";
20
+ import "./chunk-H65TYP6V.js";
21
21
  import "./chunk-QYF5S6P6.js";
22
- import "./chunk-G5GV2Q7K.js";
23
- import "./chunk-X35S7HSB.js";
24
- import "./chunk-SQC7K3SP.js";
25
- import "./chunk-JE6HKLC7.js";
26
- import "./chunk-2453RRJ2.js";
27
- import "./chunk-WQV6BI4Q.js";
22
+ import "./chunk-CZCAZVTD.js";
23
+ import "./chunk-FOEPIX76.js";
24
+ import "./chunk-NL5LSKVD.js";
25
+ import "./chunk-7WJ55KBN.js";
26
+ import "./chunk-3FRI5H4T.js";
28
27
  import "./chunk-S26LC76R.js";
29
- import "./chunk-565VRUP4.js";
30
- import "./chunk-VLQ7UKZH.js";
28
+ import "./chunk-VCRVNLE7.js";
31
29
  import "./chunk-LJDODBBZ.js";
32
- import "./chunk-GMROJJRN.js";
30
+ import "./chunk-CB7PEVOJ.js";
33
31
  import "./chunk-NXL4FFQQ.js";
34
32
  export {
35
33
  ALL_SCANNABLE_EXTENSIONS,
@@ -2,14 +2,14 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  createAvailabilityProbeFlight,
4
4
  probeToolAsync
5
- } from "./chunk-JBP7KESM.js";
5
+ } from "./chunk-VPFRU5IG.js";
6
6
  import {
7
7
  classifyProbeFailure,
8
8
  createAvailabilityLatch,
9
9
  isTransientDecision,
10
10
  logAvailabilityDecision,
11
11
  startHostStallSampler
12
- } from "./chunk-JZRP4DGP.js";
12
+ } from "./chunk-NPNFGYLV.js";
13
13
  import {
14
14
  NODE_MODULES_BIN_DIRS,
15
15
  createGenerationSource,
@@ -17,22 +17,20 @@ import {
17
17
  projectLocalBinDirs,
18
18
  recordProjectCommandRefusal,
19
19
  safeSpawnAsync
20
- } from "./chunk-WMDUT4KH.js";
20
+ } from "./chunk-H65TYP6V.js";
21
21
  import {
22
22
  getProjectTrustState
23
- } from "./chunk-JE6HKLC7.js";
23
+ } from "./chunk-7WJ55KBN.js";
24
24
  import {
25
+ logExtension,
25
26
  recordDegradationOnce
26
- } from "./chunk-2453RRJ2.js";
27
- import {
28
- logExtension
29
- } from "./chunk-WQV6BI4Q.js";
27
+ } from "./chunk-3FRI5H4T.js";
30
28
  import {
31
29
  isAtOrAboveHomeDir,
32
30
  isUnderDir,
33
31
  realpathOrResolve,
34
32
  walkUpDirs
35
- } from "./chunk-GMROJJRN.js";
33
+ } from "./chunk-CB7PEVOJ.js";
36
34
 
37
35
  // dist/clients/package-manager.js
38
36
  import * as fs from "node:fs";
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  isTestMode
4
- } from "./chunk-VLQ7UKZH.js";
4
+ } from "./chunk-VCRVNLE7.js";
5
5
 
6
6
  // dist/clients/scanner-temp-root.js
7
7
  import * as os from "node:os";
@@ -0,0 +1,198 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ measureFile
4
+ } from "./chunk-ZD4KVFXI.js";
5
+ import {
6
+ isComplexityLanguageId,
7
+ isComplexitySupportedFile,
8
+ resolveTreeSitterLanguage,
9
+ walk,
10
+ withTreeSitterRoot
11
+ } from "./chunk-CTB5BAJI.js";
12
+ import "./chunk-Z54ZSOBZ.js";
13
+ import "./chunk-GUGKKGG7.js";
14
+ import "./chunk-QGITU23N.js";
15
+ import "./chunk-OTSTS7L2.js";
16
+ import "./chunk-WAA63ZJV.js";
17
+ import "./chunk-NPNFGYLV.js";
18
+ import "./chunk-H65TYP6V.js";
19
+ import "./chunk-CZCAZVTD.js";
20
+ import "./chunk-FOEPIX76.js";
21
+ import "./chunk-NL5LSKVD.js";
22
+ import "./chunk-7WJ55KBN.js";
23
+ import {
24
+ createSubsystemLogger
25
+ } from "./chunk-3FRI5H4T.js";
26
+ import "./chunk-S26LC76R.js";
27
+ import "./chunk-VCRVNLE7.js";
28
+ import "./chunk-LJDODBBZ.js";
29
+ import "./chunk-CB7PEVOJ.js";
30
+ import "./chunk-NXL4FFQQ.js";
31
+
32
+ // dist/clients/complexity-client.js
33
+ import * as fs from "node:fs";
34
+ import * as path from "node:path";
35
+ var COMMENT_TYPES = /* @__PURE__ */ new Set(["comment", "line_comment", "block_comment"]);
36
+ function countTryCatch(root) {
37
+ let count = 0;
38
+ walk(root, (n) => {
39
+ if (n.type === "try_statement")
40
+ count++;
41
+ });
42
+ return count;
43
+ }
44
+ function countLines(content, root) {
45
+ const lines = content.split(/\r?\n/);
46
+ const commentLineSet = /* @__PURE__ */ new Set();
47
+ walk(root, (n) => {
48
+ if (COMMENT_TYPES.has(n.type)) {
49
+ for (let l = n.startPosition.row; l <= n.endPosition.row; l++) {
50
+ commentLineSet.add(l);
51
+ }
52
+ }
53
+ });
54
+ const codeLines = lines.filter((line, i) => {
55
+ if (line.trim().length === 0)
56
+ return false;
57
+ if (!commentLineSet.has(i))
58
+ return true;
59
+ const stripped = line.replace(/\/\/.*$/, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/#.*$/, "").trim();
60
+ return stripped.length > 0;
61
+ }).length;
62
+ return { codeLines, commentLines: commentLineSet.size };
63
+ }
64
+ var AI_COMMENT_PATTERNS = [
65
+ /(?:🔍|✅|📝|🔧|🐛|⚠️|🚀|💡|🎯|📌|🏷️|🔑|🏗️|🧪|🗑️|🔄|♻️|📋|🔖|📊|💬|🔥|💎|⭐|🌟|🎨|🛠️)/u,
66
+ /(?:\/\/|#)\s*(Initialize|Setup|Clean up|Create|Define|Check if|Handle|Process|Validate|Return|Get|Set|Add|Remove|Update|Fetch)\b/i,
67
+ /(?:\/\/|#)\s*(This function|This method|This code|Here we|Now we)\b/i,
68
+ /\/\*\*?\s*(Overview|Summary|Description|Example|Usage)\s*\*?\//i
69
+ ];
70
+ function countAICommentPatterns(sourceText) {
71
+ let count = 0;
72
+ for (const line of sourceText.split(/\r?\n/)) {
73
+ const trimmed = line.trim();
74
+ if (trimmed.startsWith("//") || trimmed.startsWith("/*") || trimmed.startsWith("*") || trimmed.startsWith("#")) {
75
+ for (const pattern of AI_COMMENT_PATTERNS) {
76
+ if (pattern.test(line)) {
77
+ count++;
78
+ break;
79
+ }
80
+ }
81
+ }
82
+ }
83
+ return count;
84
+ }
85
+ function calculateCodeEntropy(sourceText) {
86
+ const tokens = sourceText.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/["'`][^"'`]*["'`]/g, "STR").replace(/\b\d+(\.\d+)?\b/g, "NUM").split(/[\s\n\r\t,;:()[\]{}=<>!&|+\-*/%^~?]+/).filter((t) => t.length > 0);
87
+ if (tokens.length === 0)
88
+ return 0;
89
+ const freq = /* @__PURE__ */ new Map();
90
+ for (const token of tokens)
91
+ freq.set(token, (freq.get(token) || 0) + 1);
92
+ let entropy = 0;
93
+ for (const count of freq.values()) {
94
+ const p = count / tokens.length;
95
+ if (p > 0)
96
+ entropy -= p * Math.log2(p);
97
+ }
98
+ return entropy;
99
+ }
100
+ function calculateMaintainabilityIndex(cyclomatic, loc, comments) {
101
+ if (loc === 0)
102
+ return 100;
103
+ const lnLOC = Math.log(loc);
104
+ let mi = (171 - 0.23 * cyclomatic - 16.2 * lnLOC) * 100 / 171;
105
+ const commentBonus = Math.min(10, comments / loc * 50);
106
+ mi += commentBonus;
107
+ return Math.max(0, Math.min(100, mi));
108
+ }
109
+ function countSingleUseFunctions(functions) {
110
+ return functions.filter((f) => f.length < 10 && f.cyclomatic <= 2 && /^(get|set|check|is|has|validate|format|parse|convert|create|make)/i.test(f.name)).length;
111
+ }
112
+ var ComplexityClient = class {
113
+ log;
114
+ constructor(verbose = false) {
115
+ this.log = verbose ? createSubsystemLogger("complexity") : () => {
116
+ };
117
+ }
118
+ /** True if the file's grammar has a complexity node mapping.
119
+ *
120
+ * Delegates to the module-free predicate in `tree-sitter-shared.ts`: the
121
+ * same question is asked by `handleToolCallImpl` BEFORE the analyzer
122
+ * bootstrap is loaded (#2467), and two copies of it would be two answers. */
123
+ isSupportedFile(filePath) {
124
+ return isComplexitySupportedFile(filePath);
125
+ }
126
+ /** Analyze complexity metrics for a file (null if unsupported / unparseable). */
127
+ async analyzeFile(filePath) {
128
+ const absolutePath = path.resolve(filePath);
129
+ const languageId = resolveTreeSitterLanguage(absolutePath);
130
+ if (!languageId || !isComplexityLanguageId(languageId))
131
+ return null;
132
+ let content;
133
+ try {
134
+ if (!fs.existsSync(absolutePath))
135
+ return null;
136
+ content = fs.readFileSync(absolutePath, "utf-8");
137
+ } catch (err) {
138
+ this.log(`Read error for ${filePath}: ${err.message}`);
139
+ return null;
140
+ }
141
+ try {
142
+ const parsed = await withTreeSitterRoot(absolutePath, content, (root) => this.computeMetrics(absolutePath, content, root, languageId), "complexity");
143
+ return parsed.parsed ? parsed.value : null;
144
+ } catch (err) {
145
+ this.log(`Analysis error for ${filePath}: ${err.message}`);
146
+ return null;
147
+ }
148
+ }
149
+ computeMetrics(absolutePath, content, root, languageId) {
150
+ const { codeLines, commentLines } = countLines(content, root);
151
+ const file = measureFile(root, languageId);
152
+ const functions = file.functions.map((f) => ({
153
+ name: f.name,
154
+ line: f.line,
155
+ length: f.length,
156
+ cyclomatic: f.cyclomatic - 1,
157
+ cognitive: f.cognitive,
158
+ nestingDepth: f.nesting
159
+ }));
160
+ const funcStats = this.aggregateFunctionStats(functions);
161
+ return {
162
+ filePath: path.relative(process.cwd(), absolutePath),
163
+ maxNestingDepth: file.nesting,
164
+ avgFunctionLength: funcStats.avgLength,
165
+ maxFunctionLength: funcStats.maxLength,
166
+ functionCount: functions.length,
167
+ cyclomaticComplexity: funcStats.avgCyclomatic,
168
+ maxCyclomaticComplexity: funcStats.maxCyclomatic,
169
+ cognitiveComplexity: file.cognitive,
170
+ maintainabilityIndex: Math.round(calculateMaintainabilityIndex(funcStats.avgCyclomatic, codeLines, commentLines) * 10) / 10,
171
+ linesOfCode: codeLines,
172
+ commentLines,
173
+ codeEntropy: Math.round(calculateCodeEntropy(content) * 100) / 100,
174
+ maxParamsInFunction: Math.max(0, ...file.functions.map((f) => f.parameters)),
175
+ aiCommentPatterns: countAICommentPatterns(content),
176
+ singleUseFunctions: countSingleUseFunctions(functions),
177
+ tryCatchCount: countTryCatch(root),
178
+ functions
179
+ };
180
+ }
181
+ aggregateFunctionStats(functions) {
182
+ if (functions.length === 0) {
183
+ return { avgLength: 0, maxLength: 0, avgCyclomatic: 1, maxCyclomatic: 1 };
184
+ }
185
+ const lengths = functions.map((f) => f.length);
186
+ const cyclomatics = functions.map((f) => f.cyclomatic);
187
+ const sum = (arr) => arr.reduce((a, b) => a + b, 0);
188
+ return {
189
+ avgLength: Math.round(sum(lengths) / lengths.length),
190
+ maxLength: Math.max(...lengths),
191
+ avgCyclomatic: Math.max(1, Math.round(sum(cyclomatics) / cyclomatics.length)),
192
+ maxCyclomatic: Math.max(1, Math.max(...cyclomatics))
193
+ };
194
+ }
195
+ };
196
+ export {
197
+ ComplexityClient
198
+ };
@@ -4,10 +4,9 @@ import {
4
4
  getOwnedLspService,
5
5
  peekOwnedLspService,
6
6
  resetOwnedLspService
7
- } from "./chunk-VOXTCULR.js";
8
- import "./chunk-565VRUP4.js";
9
- import "./chunk-VLQ7UKZH.js";
10
- import "./chunk-GMROJJRN.js";
7
+ } from "./chunk-XVB3Q2PG.js";
8
+ import "./chunk-VCRVNLE7.js";
9
+ import "./chunk-CB7PEVOJ.js";
11
10
  import "./chunk-NXL4FFQQ.js";
12
11
  export {
13
12
  configureLspServiceLifecycle,