pi-lens 4.4.7 → 4.4.9

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 (186) hide show
  1. package/CHANGELOG-USER.md +31 -0
  2. package/CHANGELOG.md +327 -0
  3. package/README.md +13 -2
  4. package/config/dependency-cruiser-eager-allowlist.json +1 -1
  5. package/config/markdownlint/run-no-fix.mjs +36 -0
  6. package/dist/{chunk-4LM3VAZH.js → chunk-2VZ3VN3N.js} +2 -2
  7. package/dist/{chunk-PUZ3E2J4.js → chunk-3HTZDY3C.js} +8 -6
  8. package/dist/{chunk-RORGS5II.js → chunk-3NPWO5UO.js} +7 -13
  9. package/dist/{chunk-MNJIXFX4.js → chunk-47UCC4MM.js} +1 -1
  10. package/dist/chunk-4ENEJHF4.js +198 -0
  11. package/dist/chunk-5GEYJJHG.js +22 -0
  12. package/dist/{chunk-U6VN4NVL.js → chunk-5YSEQHJN.js} +3 -3
  13. package/dist/{chunk-6IR3ZYIB.js → chunk-6GPB3JLL.js} +3 -3
  14. package/dist/{chunk-MB6PXBUA.js → chunk-7R5GZIA6.js} +7 -15
  15. package/dist/{chunk-DH5JPM3K.js → chunk-7UTSNTWM.js} +10 -9
  16. package/dist/{chunk-24BILSZW.js → chunk-7YTRG6YW.js} +2 -2
  17. package/dist/{chunk-KW5JQPO5.js → chunk-AACN5GNE.js} +2 -2
  18. package/dist/{chunk-PKES3ISE.js → chunk-ACRJ2GZ5.js} +2 -2
  19. package/dist/{chunk-4ZYJHQMB.js → chunk-C3YRO3EU.js} +10 -12
  20. package/dist/{chunk-PQJFG24Z.js → chunk-CB7PEVOJ.js} +1300 -946
  21. package/dist/{chunk-ABPKUVA4.js → chunk-CDFJF5YD.js} +1 -1
  22. package/dist/{chunk-T7A2HK2B.js → chunk-CJS6WE66.js} +17 -18
  23. package/dist/{chunk-3YY7IXIL.js → chunk-CM6BDY4E.js} +14 -60
  24. package/dist/{chunk-RZOXUSPC.js → chunk-CZCAZVTD.js} +16 -2
  25. package/dist/chunk-DGKFWQK4.js +23 -0
  26. package/dist/{chunk-NA7SEXHE.js → chunk-E65WJVI5.js} +7 -9
  27. package/dist/{chunk-2TF6RXWB.js → chunk-EKNYSXFB.js} +8 -10
  28. package/dist/{chunk-RRV3FNNM.js → chunk-EY6LY2HO.js} +27 -30
  29. package/dist/{chunk-LBLBAFG3.js → chunk-F6BEQWAK.js} +17 -5
  30. package/dist/{chunk-4L36HG27.js → chunk-FGNSESAC.js} +12 -14
  31. package/dist/{chunk-3FRLWYBG.js → chunk-FRUBVFXV.js} +39 -42
  32. package/dist/{chunk-FB5SCCPT.js → chunk-G22UNQID.js} +14 -15
  33. package/dist/{chunk-LV4UMYVH.js → chunk-GQTQUNCG.js} +26 -27
  34. package/dist/{chunk-E7HJ56Y7.js → chunk-H3BVMK47.js} +64 -73
  35. package/dist/chunk-H6FLQ5NW.js +28 -0
  36. package/dist/{chunk-QHSNL7B2.js → chunk-HEA3EM23.js} +15 -19
  37. package/dist/{chunk-AWDSEDER.js → chunk-HSOBIN22.js} +2 -2
  38. package/dist/{chunk-EAOK7MIZ.js → chunk-HYSKJMZK.js} +17 -4
  39. package/dist/{chunk-VUZWQ7UG.js → chunk-IICERRFF.js} +46 -72
  40. package/dist/{chunk-OXOI55RU.js → chunk-IILEH3ZC.js} +8 -10
  41. package/dist/{chunk-ZKXQKGWZ.js → chunk-J3Q2NYJR.js} +4 -3
  42. package/dist/{chunk-YHC2O2WO.js → chunk-JUZ67QZQ.js} +20 -9
  43. package/dist/chunk-KR5VGMVT.js +25 -0
  44. package/dist/{chunk-F7K5IBZG.js → chunk-KV6GQOGN.js} +41 -44
  45. package/dist/{chunk-SNDXCFRS.js → chunk-KXMJLOZF.js} +25 -23
  46. package/dist/{chunk-CB4WHS4H.js → chunk-L4Y3ROKQ.js} +3 -3
  47. package/dist/{chunk-3F6BMY53.js → chunk-L6WBJGQS.js} +1 -1
  48. package/dist/{chunk-MPKRJBPK.js → chunk-L7O774U7.js} +30 -32
  49. package/dist/{chunk-URCQWAQ4.js → chunk-LAHHGNAY.js} +21 -21
  50. package/dist/{chunk-V63BC55Q.js → chunk-LT62P654.js} +1 -1
  51. package/dist/{chunk-ZMAUPOMG.js → chunk-LWOM6LVS.js} +34 -34
  52. package/dist/{chunk-HO6LWE2E.js → chunk-MKPDIAZH.js} +21 -1
  53. package/dist/{chunk-2PHMIAKO.js → chunk-MN635QYA.js} +3 -4
  54. package/dist/{chunk-KDX35VXP.js → chunk-MQ4PPCJB.js} +166 -149
  55. package/dist/{chunk-QOE342SU.js → chunk-MRLH4MYU.js} +2 -2
  56. package/dist/{chunk-CE6VMBCB.js → chunk-N56BNAA6.js} +20 -21
  57. package/dist/{chunk-L3CMBQMH.js → chunk-N5CEGQPG.js} +14 -17
  58. package/dist/{chunk-7E2563GA.js → chunk-NCLO6E6N.js} +13 -33
  59. package/dist/{chunk-J6JP25XU.js → chunk-NL5LSKVD.js} +4 -3
  60. package/dist/{chunk-U7BD2QL7.js → chunk-NMUSOZ2D.js} +10 -12
  61. package/dist/{chunk-BZARLRJW.js → chunk-NOWH2VA2.js} +8 -33
  62. package/dist/{chunk-U2SDMG7C.js → chunk-NUSXS6YB.js} +6 -5
  63. package/dist/{chunk-ZJTT47IG.js → chunk-OSEKJEUU.js} +2 -2
  64. package/dist/{chunk-FZKFVUEC.js → chunk-OUYAUXAT.js} +647 -355
  65. package/dist/{chunk-ZE3KXHS7.js → chunk-PBZNYHMM.js} +84 -4
  66. package/dist/{chunk-U5HPROLA.js → chunk-PIIUNJIT.js} +2 -4
  67. package/dist/chunk-PKLB2XJL.js +8 -0
  68. package/dist/{chunk-RC2Z6K47.js → chunk-PRHYIA6X.js} +15 -6
  69. package/dist/{chunk-RQS4QQSD.js → chunk-PXQ45SGD.js} +2 -2
  70. package/dist/chunk-Q6JQKWPK.js +25 -0
  71. package/dist/{chunk-F6X3YJWD.js → chunk-QB7T2PHK.js} +2 -2
  72. package/dist/{chunk-TIQJPRDD.js → chunk-QGITU23N.js} +3 -2
  73. package/dist/chunk-QJJKOHLH.js +57 -0
  74. package/dist/{chunk-4LOE5R5P.js → chunk-QP33NKYC.js} +18 -15
  75. package/dist/{chunk-N5WSK2K7.js → chunk-QVBOXT3L.js} +12 -17
  76. package/dist/{chunk-DPGEAHZT.js → chunk-RNJFRXEN.js} +10 -18
  77. package/dist/{chunk-EKWX4WD3.js → chunk-RNXOWDM6.js} +10 -10
  78. package/dist/{chunk-O4BJFESU.js → chunk-RTFMDIKV.js} +1 -1
  79. package/dist/{chunk-LS3QJRUB.js → chunk-SIQHOB6P.js} +11 -13
  80. package/dist/{chunk-3K2F6UDZ.js → chunk-SLSMJPEF.js} +43 -42
  81. package/dist/chunk-T5QSLSMM.js +50 -0
  82. package/dist/chunk-TGQDAG4B.js +88 -0
  83. package/dist/{chunk-4YHYPW2G.js → chunk-THYHUIDR.js} +44 -13
  84. package/dist/{chunk-YVHBNSME.js → chunk-TMNUTMT5.js} +1099 -1100
  85. package/dist/{chunk-WDBICWH3.js → chunk-TOE2RRCS.js} +1 -1
  86. package/dist/chunk-TYHPVE5H.js +25 -0
  87. package/dist/chunk-UAKO2M6B.js +73 -0
  88. package/dist/chunk-UC5AXW5Z.js +20 -0
  89. package/dist/chunk-UTJP6WOS.js +28 -0
  90. package/dist/{chunk-DQZFQSR5.js → chunk-UXTQ3QPD.js} +4 -4
  91. package/dist/chunk-UYXV5NIS.js +20 -0
  92. package/dist/{chunk-KKCK636N.js → chunk-V2WDBOLZ.js} +10 -12
  93. package/dist/{chunk-PR6PO3ES.js → chunk-V67D6TMU.js} +22 -20
  94. package/dist/{chunk-VSFLRN5Y.js → chunk-VCRVNLE7.js} +135 -2
  95. package/dist/{chunk-CPSR3AVL.js → chunk-VO4JFPTV.js} +2 -2
  96. package/dist/{chunk-XT2HTCJ5.js → chunk-VWLSU3XV.js} +6 -5
  97. package/dist/{chunk-WME2OQST.js → chunk-W5E72HJA.js} +66 -24
  98. package/dist/{chunk-LLS45EWB.js → chunk-W7TY6HYX.js} +6 -8
  99. package/dist/{chunk-CCV2EU7T.js → chunk-WSSLVMDA.js} +12 -13
  100. package/dist/{chunk-YISME6ON.js → chunk-WTB4GKMH.js} +10 -1
  101. package/dist/{chunk-KPPJTH44.js → chunk-X5BJ3G2P.js} +64 -35
  102. package/dist/{chunk-JMEKXFOL.js → chunk-XKFO2SZV.js} +39 -34
  103. package/dist/{chunk-HR3OJ3TH.js → chunk-XLAI7UYY.js} +84 -31
  104. package/dist/{chunk-H7OR7DFZ.js → chunk-XO756WE5.js} +53 -37
  105. package/dist/{chunk-F5Z6URKM.js → chunk-XVB3Q2PG.js} +2 -4
  106. package/dist/{chunk-R5MOQM2H.js → chunk-YOXCCJDF.js} +607 -366
  107. package/dist/{chunk-ZGSJDWQU.js → chunk-ZCQBNPRH.js} +2 -2
  108. package/dist/chunk-ZD4KVFXI.js +234 -0
  109. package/dist/{chunk-WGRJOXED.js → chunk-ZDMFGACN.js} +1295 -966
  110. package/dist/{chunk-OSTKYB55.js → chunk-ZMMHHXSW.js} +1 -1
  111. package/dist/{chunk-75GAYVNO.js → chunk-ZPM7ZIFL.js} +6 -6
  112. package/dist/{chunk-LUBPZN36.js → chunk-ZVCDHYWZ.js} +9 -11
  113. package/dist/{chunk-Y7F7IEE3.js → chunk-ZZN74OGD.js} +102 -7
  114. package/dist/{chunk-L5JYIU47.js → chunk-ZZSJAR76.js} +39 -20
  115. package/dist/index.js +10933 -8644
  116. package/dist/mcp/analyze-cli.js +12 -17
  117. package/dist/mcp/cli.js +43 -42
  118. package/dist/mcp/server.js +3073 -1147
  119. package/dist/mcp/worker.js +61 -61
  120. package/dist/probes/installer.js +18 -19
  121. package/docs/adr/0003-git-guard-latch-writer.md +11 -6
  122. package/docs/agent-tools.md +58 -16
  123. package/docs/alignment-families.md +29 -0
  124. package/docs/analysisall.md +1 -1
  125. package/docs/ast-grep_rules_catalog.md +6 -4
  126. package/docs/ci-bot-pr-checks.md +128 -0
  127. package/docs/configuration.md +150 -12
  128. package/docs/defect-shapes.md +107 -15
  129. package/docs/engineering-principles.md +27 -2
  130. package/docs/environment-variables.md +18 -1
  131. package/docs/features.md +14 -7
  132. package/docs/globalconfig.md +11 -3
  133. package/docs/invariants/git-guard-host.md +7 -3
  134. package/docs/invariants/language-config.md +15 -4
  135. package/docs/invariants/lsp-trust-exec.md +25 -4
  136. package/docs/invariants/paths-os.md +4 -2
  137. package/docs/invariants/session-telemetry.md +2 -2
  138. package/docs/language-coverage.md +1 -0
  139. package/docs/lsp-capability-matrix.md +167 -65
  140. package/docs/lsp-idle-eviction.md +4 -1
  141. package/docs/merge-queue-rollout.md +10 -8
  142. package/docs/module-report-read-symbol.md +34 -23
  143. package/docs/pi-lens-fixer.md +34 -17
  144. package/docs/pi-lens-investigator.md +3 -0
  145. package/docs/pi-lens-merge-policy.md +34 -17
  146. package/docs/pi-lens-monitor.md +9 -0
  147. package/docs/pi-lens-orchestration.md +4 -1
  148. package/docs/pi-lens-reviewer.md +6 -6
  149. package/docs/pi-lens-subagent.md +19 -3
  150. package/docs/public-api-stability.md +57 -7
  151. package/docs/release-qa-baseline.md +7 -4
  152. package/docs/schema/pi-lens-config-v1.json +21 -2
  153. package/docs/servercapabilities.md +3 -1
  154. package/docs/settings.md +11 -7
  155. package/docs/word-index.md +20 -7
  156. package/package.json +11 -4
  157. package/rules/ast-grep-rules/rule-tests/no-accumulating-spread-js-test.yml +37 -0
  158. package/rules/ast-grep-rules/rule-tests/ts-redundant-filter-map-test.yml +12 -1
  159. package/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-js-test.yml +12 -0
  160. package/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-test.yml +25 -0
  161. package/rules/ast-grep-rules/rules/no-accumulating-spread-js.yml +49 -1
  162. package/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +1 -2
  163. package/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +1 -2
  164. package/rules/ast-grep-rules/rules/ts-redundant-filter-map.yml +9 -1
  165. package/rules/ast-grep-rules/rules-disabled/filter-then-map-js.yml +17 -0
  166. package/rules/ast-grep-rules/rules-disabled/filter-then-map.yml +36 -0
  167. package/rules/ast-grep-rules/self-scan-baseline.json +1 -1
  168. package/scripts/download-grammars.js +3 -2
  169. package/skills/pi-lens-lsp-navigation/SKILL.md +5 -1
  170. package/dist/chunk-46TNM7XZ.js +0 -88
  171. package/dist/chunk-72OKUXSD.js +0 -31
  172. package/dist/chunk-7GLOLOSH.js +0 -57
  173. package/dist/chunk-AKUUMGD5.js +0 -26
  174. package/dist/chunk-ASUXV767.js +0 -22
  175. package/dist/chunk-CTADOKYM.js +0 -25
  176. package/dist/chunk-GNSIWBAT.js +0 -106
  177. package/dist/chunk-HWDAVBFU.js +0 -49
  178. package/dist/chunk-JJ2RRESP.js +0 -58
  179. package/dist/chunk-KXF5R4UN.js +0 -48
  180. package/dist/chunk-LSC3VADM.js +0 -23
  181. package/dist/chunk-OE5ZBP7F.js +0 -443
  182. package/dist/chunk-SHLDT3OI.js +0 -27
  183. package/dist/chunk-UF7RTZSO.js +0 -27
  184. package/dist/chunk-W4WP2ERB.js +0 -30
  185. package/dist/chunk-YES5CACN.js +0 -73
  186. package/dist/chunk-Z2XAOKHK.js +0 -136
@@ -2,7 +2,7 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  collectSourceFiles,
4
4
  collectSourceFilesAsync
5
- } from "./chunk-EKWX4WD3.js";
5
+ } from "./chunk-RNXOWDM6.js";
6
6
 
7
7
  // dist/clients/scan-utils.js
8
8
  function getSourceFiles(dir, _isTsProject) {
@@ -1,39 +1,38 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
- import {
3
- scannerReportParentDir
4
- } from "./chunk-V63BC55Q.js";
5
2
  import {
6
3
  getScratchTreeDirNames
7
- } from "./chunk-CPSR3AVL.js";
4
+ } from "./chunk-VO4JFPTV.js";
8
5
  import {
9
6
  SecurityScanClient
10
- } from "./chunk-ZE3KXHS7.js";
7
+ } from "./chunk-PBZNYHMM.js";
8
+ import "./chunk-ZZN74OGD.js";
11
9
  import {
12
10
  resolveOpengrepConfig
13
- } from "./chunk-24BILSZW.js";
11
+ } from "./chunk-7YTRG6YW.js";
12
+ import {
13
+ scannerReportParentDir
14
+ } from "./chunk-LT62P654.js";
14
15
  import {
15
16
  stripPackRuleIdPrefix
16
- } from "./chunk-O4BJFESU.js";
17
- import "./chunk-3F6BMY53.js";
18
- import "./chunk-KW5JQPO5.js";
17
+ } from "./chunk-RTFMDIKV.js";
18
+ import "./chunk-L6WBJGQS.js";
19
+ import "./chunk-AACN5GNE.js";
19
20
  import {
20
21
  safeSpawnAsync
21
- } from "./chunk-YVHBNSME.js";
22
+ } from "./chunk-TMNUTMT5.js";
22
23
  import "./chunk-AWQWXSW4.js";
23
- import "./chunk-KPPJTH44.js";
24
- import "./chunk-J6JP25XU.js";
25
- import "./chunk-U5HPROLA.js";
24
+ import "./chunk-X5BJ3G2P.js";
25
+ import "./chunk-NL5LSKVD.js";
26
+ import "./chunk-PIIUNJIT.js";
26
27
  import {
27
28
  recordDegradationOnce
28
- } from "./chunk-WME2OQST.js";
29
- import "./chunk-KXF5R4UN.js";
29
+ } from "./chunk-W5E72HJA.js";
30
30
  import "./chunk-S26LC76R.js";
31
- import "./chunk-Z2XAOKHK.js";
32
- import "./chunk-VSFLRN5Y.js";
31
+ import "./chunk-VCRVNLE7.js";
33
32
  import "./chunk-LJDODBBZ.js";
34
33
  import {
35
34
  realpathOrResolve
36
- } from "./chunk-PQJFG24Z.js";
35
+ } from "./chunk-CB7PEVOJ.js";
37
36
  import "./chunk-NXL4FFQQ.js";
38
37
 
39
38
  // dist/clients/opengrep-client.js
@@ -1,17 +1,20 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ measureFunction
4
+ } from "./chunk-ZD4KVFXI.js";
2
5
  import {
3
6
  extractFactsFromTree
4
- } from "./chunk-WDBICWH3.js";
7
+ } from "./chunk-TOE2RRCS.js";
5
8
  import {
6
9
  findOwnerName
7
10
  } from "./chunk-5W3R6LFT.js";
8
11
  import {
9
12
  firstChildOfType,
10
13
  walk
11
- } from "./chunk-L5JYIU47.js";
14
+ } from "./chunk-ZZSJAR76.js";
12
15
  import {
13
16
  isJstsFactFile
14
- } from "./chunk-RZOXUSPC.js";
17
+ } from "./chunk-CZCAZVTD.js";
15
18
 
16
19
  // dist/clients/dispatch/facts/function-facts.js
17
20
  var BOUNDARY_PREFIXES = [
@@ -30,28 +33,6 @@ var FUNCTION_TYPES = /* @__PURE__ */ new Set([
30
33
  "function_expression",
31
34
  "arrow_function"
32
35
  ]);
33
- var COMPLEXITY_TYPES = /* @__PURE__ */ new Set([
34
- "if_statement",
35
- "for_statement",
36
- "for_in_statement",
37
- // for…of and for…in both parse to for_in_statement
38
- "while_statement",
39
- "do_statement",
40
- "switch_case",
41
- // `case` only — `default` (switch_default) is not counted
42
- "catch_clause",
43
- "ternary_expression"
44
- ]);
45
- var NESTING_TYPES = /* @__PURE__ */ new Set([
46
- "if_statement",
47
- "for_statement",
48
- "for_in_statement",
49
- "while_statement",
50
- "do_statement",
51
- "switch_statement",
52
- "try_statement"
53
- ]);
54
- var LOGICAL_OPERATORS = /* @__PURE__ */ new Set(["&&", "||", "??"]);
55
36
  function namedChildren(node) {
56
37
  return (node.children ?? []).filter((c) => c && c.isNamed && c.type !== "comment");
57
38
  }
@@ -123,19 +104,6 @@ function isCallPassThrough(stmt, paramNames) {
123
104
  }
124
105
  return { pass: true, target: (expr.children ?? [])[0]?.text };
125
106
  }
126
- function isDecisionPoint(type, children) {
127
- if (COMPLEXITY_TYPES.has(type))
128
- return true;
129
- return type === "binary_expression" && children.some((c) => LOGICAL_OPERATORS.has(c?.type));
130
- }
131
- function calcCyclomaticComplexity(body) {
132
- let cc = 1;
133
- walk(body, (node) => {
134
- if (isDecisionPoint(node.type, node.children ?? []))
135
- cc++;
136
- });
137
- return cc;
138
- }
139
107
  function memberCallSite(callee) {
140
108
  if (callee?.type !== "member_expression")
141
109
  return void 0;
@@ -177,21 +145,13 @@ function addNewReceiverType(children, receiverTypes) {
177
145
  if (id && ctor?.type === "identifier")
178
146
  receiverTypes[id.text] = ctor.text;
179
147
  }
180
- function summarizeBody(body, params) {
148
+ function summarizeBody(fn, params) {
181
149
  let hasAwait = false;
182
150
  let hasReturnAwaitCall = false;
183
- let cyclomaticComplexity = 1;
184
- let maxNestingDepth = 0;
185
151
  const calls = /* @__PURE__ */ new Set();
186
152
  const memberCallSites = [];
187
153
  const receiverTypes = parameterReceiverTypes(params);
188
- const visit = (node, depth) => {
189
- const type = node.type;
190
- const children = node.children ?? [];
191
- if (depth > maxNestingDepth)
192
- maxNestingDepth = depth;
193
- if (isDecisionPoint(type, children))
194
- cyclomaticComplexity++;
154
+ const metrics = measureFunction(fn, "typescript", (node, type, children) => {
195
155
  if (type === "await_expression") {
196
156
  hasAwait = true;
197
157
  } else if (type === "return_statement") {
@@ -202,18 +162,13 @@ function summarizeBody(body, params) {
202
162
  } else if (type === "variable_declarator") {
203
163
  addNewReceiverType(children, receiverTypes);
204
164
  }
205
- const next = NESTING_TYPES.has(type) ? depth + 1 : depth;
206
- for (const child of children) {
207
- if (child)
208
- visit(child, next);
209
- }
210
- };
211
- visit(body, 0);
165
+ });
212
166
  return {
213
167
  hasAwait,
214
168
  hasReturnAwaitCall,
215
- cyclomaticComplexity,
216
- maxNestingDepth,
169
+ cyclomaticComplexity: metrics.cyclomatic,
170
+ maxNestingDepth: metrics.nesting,
171
+ parameterCount: metrics.parameters,
217
172
  outgoingCalls: [...calls],
218
173
  memberCallSites,
219
174
  receiverTypes
@@ -248,7 +203,7 @@ var functionFactProvider = {
248
203
  const target = passThrough.target ?? "";
249
204
  const lowerTarget = target.toLowerCase();
250
205
  const isBoundaryWrapper = BOUNDARY_PREFIXES.some((prefix) => lowerTarget.startsWith(prefix));
251
- const bodySummary = summarizeBody(body, params);
206
+ const bodySummary = summarizeBody(node, params);
252
207
  summaries.push({
253
208
  name: getFunctionName(node),
254
209
  line: node.startPosition.row + 1,
@@ -258,7 +213,7 @@ var functionFactProvider = {
258
213
  hasAwait: bodySummary.hasAwait,
259
214
  hasReturnAwaitCall: bodySummary.hasReturnAwaitCall,
260
215
  statementCount,
261
- parameterCount: params.length,
216
+ parameterCount: bodySummary.parameterCount,
262
217
  isPassThroughWrapper: passThrough.pass,
263
218
  passThroughTarget: passThrough.target,
264
219
  isBoundaryWrapper,
@@ -296,6 +251,5 @@ var functionFactProvider = {
296
251
  };
297
252
 
298
253
  export {
299
- calcCyclomaticComplexity,
300
254
  functionFactProvider
301
255
  };
@@ -1,10 +1,10 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  findNearestDirWithMarker
4
- } from "./chunk-J6JP25XU.js";
4
+ } from "./chunk-NL5LSKVD.js";
5
5
  import {
6
6
  isWindowsPath
7
- } from "./chunk-PQJFG24Z.js";
7
+ } from "./chunk-CB7PEVOJ.js";
8
8
 
9
9
  // dist/clients/file-kinds.js
10
10
  import { basename, extname, win32 } from "node:path";
@@ -60,6 +60,7 @@ var KIND_EXTENSIONS = {
60
60
  fsharp: [".fs", ".fsi", ".fsx"],
61
61
  gleam: [".gleam"],
62
62
  go: [".go"],
63
+ groovy: [".groovy", ".gvy", ".gy", ".gsh"],
63
64
  haskell: [".hs", ".lhs"],
64
65
  "helm-template": [".tpl"],
65
66
  html: [".htm", ".html"],
@@ -136,6 +137,11 @@ var DOTNET_FSHARP_ROOT_MARKERS = [
136
137
  "*.fsproj",
137
138
  "*.sln"
138
139
  ];
140
+ var GROOVY_FILENAMES = [
141
+ "Jenkinsfile",
142
+ "build.gradle",
143
+ "settings.gradle"
144
+ ];
139
145
  var TERRAGRUNT_FILENAMES = [
140
146
  "terragrunt.hcl",
141
147
  "root.hcl"
@@ -158,6 +164,10 @@ var SPECIAL_FILENAMES = [
158
164
  ...TERRAGRUNT_FILENAMES.map((name) => ({
159
165
  pattern: new RegExp(`^${name.replaceAll(".", "\\.")}$`, "i"),
160
166
  kind: "terragrunt"
167
+ })),
168
+ ...GROOVY_FILENAMES.map((name) => ({
169
+ pattern: new RegExp(`^${name.replaceAll(".", "\\.")}$`, "i"),
170
+ kind: "groovy"
161
171
  }))
162
172
  ];
163
173
  function isHelmYamlTemplatePath(filePath) {
@@ -211,6 +221,7 @@ var CODE_KINDS = /* @__PURE__ */ new Set([
211
221
  "fsharp",
212
222
  "gleam",
213
223
  "go",
224
+ "groovy",
214
225
  "haskell",
215
226
  "helm-template",
216
227
  "java",
@@ -250,6 +261,7 @@ function getFileKindLabel(kind) {
250
261
  jsts: "JavaScript/TypeScript",
251
262
  python: "Python",
252
263
  go: "Go",
264
+ groovy: "Groovy",
253
265
  rust: "Rust",
254
266
  cxx: "C/C++",
255
267
  cmake: "CMake",
@@ -294,6 +306,7 @@ function getLanguageId(kind) {
294
306
  jsts: "typescript",
295
307
  python: "python",
296
308
  go: "go",
309
+ groovy: "groovy",
297
310
  rust: "rust",
298
311
  cxx: "cpp",
299
312
  cmake: "cmake",
@@ -343,6 +356,7 @@ export {
343
356
  DOTNET_CSHARP_SOLUTION_MARKERS,
344
357
  DOTNET_CSHARP_ROOT_MARKERS,
345
358
  DOTNET_FSHARP_ROOT_MARKERS,
359
+ GROOVY_FILENAMES,
346
360
  TERRAGRUNT_FILENAMES,
347
361
  SPECIAL_FILENAMES,
348
362
  isHelmYamlTemplatePath,
@@ -0,0 +1,23 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ getSourceFiles,
4
+ getSourceFilesAsync
5
+ } from "./chunk-CDFJF5YD.js";
6
+ import "./chunk-RNXOWDM6.js";
7
+ import "./chunk-ZCQBNPRH.js";
8
+ import "./chunk-TMNUTMT5.js";
9
+ import "./chunk-QYF5S6P6.js";
10
+ import "./chunk-CZCAZVTD.js";
11
+ import "./chunk-X5BJ3G2P.js";
12
+ import "./chunk-NL5LSKVD.js";
13
+ import "./chunk-PIIUNJIT.js";
14
+ import "./chunk-W5E72HJA.js";
15
+ import "./chunk-S26LC76R.js";
16
+ import "./chunk-VCRVNLE7.js";
17
+ import "./chunk-LJDODBBZ.js";
18
+ import "./chunk-CB7PEVOJ.js";
19
+ import "./chunk-NXL4FFQQ.js";
20
+ export {
21
+ getSourceFiles,
22
+ getSourceFilesAsync
23
+ };
@@ -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-3F6BMY53.js";
5
+ } from "./chunk-L6WBJGQS.js";
6
6
  import {
7
7
  classifyProbeFailure,
8
8
  createAvailabilityLatch,
9
9
  isTransientDecision,
10
10
  logAvailabilityDecision,
11
11
  startHostStallSampler
12
- } from "./chunk-KW5JQPO5.js";
12
+ } from "./chunk-AACN5GNE.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-YVHBNSME.js";
20
+ } from "./chunk-TMNUTMT5.js";
21
21
  import {
22
22
  getProjectTrustState
23
- } from "./chunk-U5HPROLA.js";
23
+ } from "./chunk-PIIUNJIT.js";
24
24
  import {
25
+ logExtension,
25
26
  recordDegradationOnce
26
- } from "./chunk-WME2OQST.js";
27
- import {
28
- logExtension
29
- } from "./chunk-KXF5R4UN.js";
27
+ } from "./chunk-W5E72HJA.js";
30
28
  import {
31
29
  isAtOrAboveHomeDir,
32
30
  isUnderDir,
33
31
  realpathOrResolve,
34
32
  walkUpDirs
35
- } from "./chunk-PQJFG24Z.js";
33
+ } from "./chunk-CB7PEVOJ.js";
36
34
 
37
35
  // dist/clients/package-manager.js
38
36
  import * as fs from "node:fs";
@@ -7,19 +7,17 @@ import {
7
7
  loadCallGraph,
8
8
  parseSymbolKey,
9
9
  saveCallGraph
10
- } from "./chunk-6IR3ZYIB.js";
10
+ } from "./chunk-6GPB3JLL.js";
11
11
  import "./chunk-3MED75HT.js";
12
- import "./chunk-YVHBNSME.js";
13
- import "./chunk-KPPJTH44.js";
14
- import "./chunk-J6JP25XU.js";
15
- import "./chunk-U5HPROLA.js";
16
- import "./chunk-WME2OQST.js";
17
- import "./chunk-KXF5R4UN.js";
12
+ import "./chunk-TMNUTMT5.js";
13
+ import "./chunk-X5BJ3G2P.js";
14
+ import "./chunk-NL5LSKVD.js";
15
+ import "./chunk-PIIUNJIT.js";
16
+ import "./chunk-W5E72HJA.js";
18
17
  import "./chunk-S26LC76R.js";
19
- import "./chunk-Z2XAOKHK.js";
20
- import "./chunk-VSFLRN5Y.js";
18
+ import "./chunk-VCRVNLE7.js";
21
19
  import "./chunk-LJDODBBZ.js";
22
- import "./chunk-PQJFG24Z.js";
20
+ import "./chunk-CB7PEVOJ.js";
23
21
  import "./chunk-NXL4FFQQ.js";
24
22
  export {
25
23
  CALL_GRAPH_CACHE_VERSION,
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  tryLazyInstallForFormatter
4
- } from "./chunk-LBLBAFG3.js";
4
+ } from "./chunk-F6BEQWAK.js";
5
5
  import {
6
6
  OXFMT_SUPPORTED_EXTENSIONS,
7
7
  findPSScriptAnalyzerConfigPath,
@@ -43,64 +43,62 @@ import {
43
43
  hasTerraformConfig,
44
44
  hasVitePlusConfig,
45
45
  stripGradleCommentsAndStrings
46
- } from "./chunk-MB6PXBUA.js";
46
+ } from "./chunk-7R5GZIA6.js";
47
47
  import {
48
48
  readTextFileOrUndefined,
49
49
  resolveCargoPackageEdition
50
- } from "./chunk-ZKXQKGWZ.js";
50
+ } from "./chunk-J3Q2NYJR.js";
51
51
  import {
52
52
  load
53
- } from "./chunk-TIQJPRDD.js";
53
+ } from "./chunk-QGITU23N.js";
54
54
  import {
55
55
  stripAnsi
56
56
  } from "./chunk-6HWVI6MI.js";
57
57
  import {
58
58
  getToolPath
59
- } from "./chunk-KDX35VXP.js";
59
+ } from "./chunk-MQ4PPCJB.js";
60
60
  import {
61
61
  resolveToolCwd
62
- } from "./chunk-DPGEAHZT.js";
62
+ } from "./chunk-RNJFRXEN.js";
63
63
  import {
64
64
  findGlobalBinary,
65
65
  findLocalBinUpwards,
66
66
  localBinPath
67
- } from "./chunk-NA7SEXHE.js";
67
+ } from "./chunk-E65WJVI5.js";
68
68
  import {
69
69
  getIsolatedNpxSpawnOptions,
70
70
  probeToolAsync
71
- } from "./chunk-3F6BMY53.js";
71
+ } from "./chunk-L6WBJGQS.js";
72
72
  import {
73
73
  classifyProbeFailure,
74
74
  createAvailabilityLatch,
75
75
  logAvailabilityDecision,
76
76
  startHostStallSampler
77
- } from "./chunk-KW5JQPO5.js";
77
+ } from "./chunk-AACN5GNE.js";
78
78
  import {
79
79
  VENDOR_BIN_DIRS,
80
80
  VENV_BIN_DIRS,
81
81
  admittedLookupAnswer,
82
82
  createGenerationSource,
83
83
  safeSpawnAsync
84
- } from "./chunk-YVHBNSME.js";
84
+ } from "./chunk-TMNUTMT5.js";
85
85
  import {
86
86
  TERRAGRUNT_FILENAMES
87
- } from "./chunk-RZOXUSPC.js";
87
+ } from "./chunk-CZCAZVTD.js";
88
88
  import {
89
89
  assertInstallAllowed,
90
90
  getProjectTrustGeneration
91
- } from "./chunk-U5HPROLA.js";
91
+ } from "./chunk-PIIUNJIT.js";
92
92
  import {
93
93
  compareOrdinal,
94
94
  getDegradationLedgerGeneration,
95
95
  incrementDegradationCount,
96
+ logExtension,
96
97
  recordDegradationOnce
97
- } from "./chunk-WME2OQST.js";
98
- import {
99
- logExtension
100
- } from "./chunk-KXF5R4UN.js";
98
+ } from "./chunk-W5E72HJA.js";
101
99
  import {
102
100
  logLatency
103
- } from "./chunk-Z2XAOKHK.js";
101
+ } from "./chunk-VCRVNLE7.js";
104
102
  import {
105
103
  BoundedFifoMap,
106
104
  BoundedLruCache,
@@ -110,7 +108,7 @@ import {
110
108
  realpathOrResolve,
111
109
  toPosix,
112
110
  walkUpDirs
113
- } from "./chunk-PQJFG24Z.js";
111
+ } from "./chunk-CB7PEVOJ.js";
114
112
 
115
113
  // dist/clients/formatters.js
116
114
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -119,6 +117,7 @@ import * as os2 from "node:os";
119
117
  import * as path4 from "node:path";
120
118
 
121
119
  // dist/clients/gradle-ktfmt-style.js
120
+ import { existsSync } from "node:fs";
122
121
  import * as os from "node:os";
123
122
  import * as path from "node:path";
124
123
  var KTFMT_GRADLE_ROOT_FILES = [
@@ -255,13 +254,12 @@ async function stylesForGradleDir(gradleDir) {
255
254
  return {};
256
255
  }
257
256
  async function resolveKtfmtGradleStyle(filePath, homeDir = os.homedir()) {
258
- let searchDir = path.dirname(path.resolve(filePath));
259
- for (let hop = 0; hop < MAX_GRADLE_ANCESTOR_HOPS; hop += 1) {
260
- const gradleDir = findNearestMarkerRoot(searchDir, KTFMT_GRADLE_ROOT_FILES, {
261
- homeDir
262
- });
263
- if (!gradleDir)
264
- return void 0;
257
+ let hop = 0;
258
+ for (const gradleDir of walkUpDirs(path.dirname(realpathOrResolve(filePath)), {
259
+ homeDir
260
+ })) {
261
+ if (!KTFMT_GRADLE_ROOT_FILES.some((marker) => existsSync(path.join(gradleDir, marker))))
262
+ continue;
265
263
  const styles = await stylesForGradleDir(gradleDir);
266
264
  const style = hop === 0 ? styles.own : styles.descendants;
267
265
  if (style === "spotless-dropbox-unsupported") {
@@ -284,16 +282,15 @@ async function resolveKtfmtGradleStyle(filePath, homeDir = os.homedir()) {
284
282
  }
285
283
  if (style)
286
284
  return KTFMT_STYLE_CLI_FLAG[style];
287
- const parent = path.dirname(gradleDir);
288
- if (parent === gradleDir)
285
+ hop += 1;
286
+ if (hop >= MAX_GRADLE_ANCESTOR_HOPS)
289
287
  return void 0;
290
- searchDir = parent;
291
288
  }
292
289
  return void 0;
293
290
  }
294
291
 
295
292
  // dist/clients/php-cs-fixer-config.js
296
- import { existsSync } from "node:fs";
293
+ import { existsSync as existsSync2 } from "node:fs";
297
294
  import * as path2 from "node:path";
298
295
  var PHP_CS_FIXER_CONFIG_NAMES = [
299
296
  ".php-cs-fixer.php",
@@ -305,7 +302,7 @@ function resolvePhpCsFixerConfig(filePath) {
305
302
  cwd: path2.parse(absolute).root,
306
303
  allowHomeMarker: true
307
304
  }).cwd;
308
- return PHP_CS_FIXER_CONFIG_NAMES.map((name) => path2.join(startDir, name)).find(existsSync);
305
+ return PHP_CS_FIXER_CONFIG_NAMES.map((name) => path2.join(startDir, name)).find(existsSync2);
309
306
  }
310
307
 
311
308
  // dist/clients/dispatch/indent-detect.js
@@ -2,16 +2,20 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  classifyProbeFailure,
4
4
  installRetryDelayMs
5
- } from "./chunk-KW5JQPO5.js";
5
+ } from "./chunk-AACN5GNE.js";
6
6
  import {
7
7
  safeSpawnAsync
8
- } from "./chunk-YVHBNSME.js";
8
+ } from "./chunk-TMNUTMT5.js";
9
9
  import {
10
10
  assertInstallAllowed
11
- } from "./chunk-U5HPROLA.js";
11
+ } from "./chunk-PIIUNJIT.js";
12
12
  import {
13
- logExtension
14
- } from "./chunk-KXF5R4UN.js";
13
+ logExtension,
14
+ recordDegradationOnce
15
+ } from "./chunk-W5E72HJA.js";
16
+ import {
17
+ isToolInstallDisabled
18
+ } from "./chunk-VCRVNLE7.js";
15
19
 
16
20
  // dist/clients/dispatch/runners/utils/lazy-installer.js
17
21
  var LAZY_INSTALL_SPECS = {
@@ -42,6 +46,14 @@ function suppressionFor(state) {
42
46
  }
43
47
  var inFlight = /* @__PURE__ */ new Map();
44
48
  async function runLazyInstall(tool, cwd, spec) {
49
+ if (isToolInstallDisabled()) {
50
+ recordDegradationOnce({
51
+ kind: "install-disabled",
52
+ subject: tool,
53
+ reason: "installation disabled by PI_LENS_DISABLE_TOOL_INSTALL=1"
54
+ });
55
+ return false;
56
+ }
45
57
  const k = key(cwd, tool);
46
58
  const running = inFlight.get(k);
47
59
  if (running)
@@ -8,23 +8,21 @@ import {
8
8
  getDefaultStartupTools,
9
9
  resolveLanguageRootForFile,
10
10
  rootMarkersForFile
11
- } from "./chunk-PUZ3E2J4.js";
12
- import "./chunk-ABPKUVA4.js";
13
- import "./chunk-EKWX4WD3.js";
14
- import "./chunk-ZGSJDWQU.js";
15
- import "./chunk-YVHBNSME.js";
11
+ } from "./chunk-3HTZDY3C.js";
12
+ import "./chunk-CDFJF5YD.js";
13
+ import "./chunk-RNXOWDM6.js";
14
+ import "./chunk-ZCQBNPRH.js";
15
+ import "./chunk-TMNUTMT5.js";
16
16
  import "./chunk-QYF5S6P6.js";
17
- import "./chunk-RZOXUSPC.js";
18
- import "./chunk-KPPJTH44.js";
19
- import "./chunk-J6JP25XU.js";
20
- import "./chunk-U5HPROLA.js";
21
- import "./chunk-WME2OQST.js";
22
- import "./chunk-KXF5R4UN.js";
17
+ import "./chunk-CZCAZVTD.js";
18
+ import "./chunk-X5BJ3G2P.js";
19
+ import "./chunk-NL5LSKVD.js";
20
+ import "./chunk-PIIUNJIT.js";
21
+ import "./chunk-W5E72HJA.js";
23
22
  import "./chunk-S26LC76R.js";
24
- import "./chunk-Z2XAOKHK.js";
25
- import "./chunk-VSFLRN5Y.js";
23
+ import "./chunk-VCRVNLE7.js";
26
24
  import "./chunk-LJDODBBZ.js";
27
- import "./chunk-PQJFG24Z.js";
25
+ import "./chunk-CB7PEVOJ.js";
28
26
  import "./chunk-NXL4FFQQ.js";
29
27
  export {
30
28
  SUPPORTED_FILE_KINDS,