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
@@ -1,10 +1,8 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
+ getProcessSingleton,
3
4
  logLatency
4
- } from "./chunk-565VRUP4.js";
5
- import {
6
- getProcessSingleton
7
- } from "./chunk-VLQ7UKZH.js";
5
+ } from "./chunk-VCRVNLE7.js";
8
6
 
9
7
  // dist/clients/lsp/workspace-sweep-hold.js
10
8
  var SWEEP_IDLE_SAFETY_MARGIN_MS = 6e4;
@@ -1,18 +1,18 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  withFactTree
4
- } from "./chunk-7TNILKGY.js";
4
+ } from "./chunk-GTTMQ6XB.js";
5
5
  import {
6
6
  childrenOfType,
7
7
  firstChildOfType,
8
8
  walk
9
- } from "./chunk-BHWW6FAX.js";
9
+ } from "./chunk-CTB5BAJI.js";
10
10
  import {
11
11
  isJstsFactFile
12
- } from "./chunk-G5GV2Q7K.js";
12
+ } from "./chunk-CZCAZVTD.js";
13
13
  import {
14
14
  logLatency
15
- } from "./chunk-565VRUP4.js";
15
+ } from "./chunk-VCRVNLE7.js";
16
16
 
17
17
  // dist/clients/dispatch/facts/import-facts.js
18
18
  function importFactsApplyTo(filePath) {
@@ -2,10 +2,10 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  DEFAULT_MAX_OUTPUT_BYTES,
4
4
  writeFileAtomic
5
- } from "./chunk-JE6HKLC7.js";
5
+ } from "./chunk-7WJ55KBN.js";
6
6
  import {
7
7
  incrementDegradationCount
8
- } from "./chunk-2453RRJ2.js";
8
+ } from "./chunk-3FRI5H4T.js";
9
9
 
10
10
  // dist/clients/mcp/ipc.js
11
11
  import * as crypto from "node:crypto";
@@ -1,34 +1,32 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  parseSymbolKey
4
- } from "./chunk-L3CLUGDY.js";
4
+ } from "./chunk-J6BR5XN2.js";
5
5
  import "./chunk-3MED75HT.js";
6
6
  import {
7
7
  isBuildArtifact
8
- } from "./chunk-G6JKM4O7.js";
9
- import "./chunk-O2ARHQKF.js";
8
+ } from "./chunk-IDCTDKIA.js";
9
+ import "./chunk-IL6PIV33.js";
10
10
  import {
11
11
  getProjectDataDir
12
- } from "./chunk-WMDUT4KH.js";
12
+ } from "./chunk-H65TYP6V.js";
13
13
  import "./chunk-QYF5S6P6.js";
14
- import "./chunk-G5GV2Q7K.js";
14
+ import "./chunk-CZCAZVTD.js";
15
15
  import {
16
16
  detectFileRole
17
- } from "./chunk-X35S7HSB.js";
18
- import "./chunk-SQC7K3SP.js";
17
+ } from "./chunk-FOEPIX76.js";
18
+ import "./chunk-NL5LSKVD.js";
19
19
  import {
20
20
  writeFileAtomic
21
- } from "./chunk-JE6HKLC7.js";
22
- import "./chunk-2453RRJ2.js";
23
- import "./chunk-WQV6BI4Q.js";
21
+ } from "./chunk-7WJ55KBN.js";
22
+ import "./chunk-3FRI5H4T.js";
24
23
  import "./chunk-S26LC76R.js";
25
- import "./chunk-565VRUP4.js";
26
- import "./chunk-VLQ7UKZH.js";
24
+ import "./chunk-VCRVNLE7.js";
27
25
  import "./chunk-LJDODBBZ.js";
28
26
  import {
29
27
  isExternalOrVendorFile,
30
28
  toProjectRelativePath
31
- } from "./chunk-GMROJJRN.js";
29
+ } from "./chunk-CB7PEVOJ.js";
32
30
  import "./chunk-NXL4FFQQ.js";
33
31
 
34
32
  // dist/clients/codebase-model.js
@@ -1,29 +1,27 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  parseJsonc
4
- } from "./chunk-7ANZ7XDD.js";
4
+ } from "./chunk-ACRJ2GZ5.js";
5
5
  import {
6
6
  extractTomlTableSection,
7
7
  hasTomlTable,
8
8
  parseTomlScalarString,
9
9
  parseTomlStringArray
10
- } from "./chunk-WC6WRNQT.js";
10
+ } from "./chunk-WS3UFJOU.js";
11
11
  import {
12
12
  resolveLanguage
13
- } from "./chunk-PPKECBPP.js";
13
+ } from "./chunk-OTSTS7L2.js";
14
14
  import {
15
15
  getProjectTrustState
16
- } from "./chunk-JE6HKLC7.js";
16
+ } from "./chunk-7WJ55KBN.js";
17
17
  import {
18
18
  incrementDegradationCount,
19
+ logExtension,
19
20
  recordDegradationOnce
20
- } from "./chunk-2453RRJ2.js";
21
- import {
22
- logExtension
23
- } from "./chunk-WQV6BI4Q.js";
21
+ } from "./chunk-3FRI5H4T.js";
24
22
  import {
25
23
  logLatency
26
- } from "./chunk-565VRUP4.js";
24
+ } from "./chunk-VCRVNLE7.js";
27
25
  import {
28
26
  UV_WORKSPACE_EXCLUDE_DIALECT,
29
27
  UV_WORKSPACE_MEMBERS_DIALECT,
@@ -31,7 +29,7 @@ import {
31
29
  realpathOrResolve,
32
30
  relativeInside,
33
31
  walkUpDirs
34
- } from "./chunk-GMROJJRN.js";
32
+ } from "./chunk-CB7PEVOJ.js";
35
33
 
36
34
  // dist/clients/bounded-telemetry.js
37
35
  var MAX_TRACKED_TURN_CAPS = 64;
@@ -0,0 +1,234 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+
3
+ // dist/clients/metrics/function-metrics.js
4
+ var JSTS = {
5
+ functions: /* @__PURE__ */ new Set([
6
+ "function_declaration",
7
+ "function_expression",
8
+ "arrow_function",
9
+ "method_definition",
10
+ "generator_function",
11
+ "generator_function_declaration"
12
+ ]),
13
+ // `switch_default` is not a decision.
14
+ decisions: /* @__PURE__ */ new Set([
15
+ "if_statement",
16
+ "for_statement",
17
+ "for_in_statement",
18
+ "while_statement",
19
+ "do_statement",
20
+ "switch_case",
21
+ "catch_clause",
22
+ "ternary_expression"
23
+ ]),
24
+ cognitive: /* @__PURE__ */ new Set([
25
+ "if_statement",
26
+ "for_statement",
27
+ "for_in_statement",
28
+ "while_statement",
29
+ "do_statement",
30
+ "switch_statement",
31
+ "catch_clause",
32
+ "ternary_expression"
33
+ ]),
34
+ nesting: /* @__PURE__ */ new Set([
35
+ "if_statement",
36
+ "for_statement",
37
+ "for_in_statement",
38
+ "while_statement",
39
+ "do_statement",
40
+ "switch_statement",
41
+ "try_statement"
42
+ ]),
43
+ logical: /* @__PURE__ */ new Set(["&&", "||", "??"])
44
+ };
45
+ var PYTHON = {
46
+ functions: /* @__PURE__ */ new Set(["function_definition", "lambda"]),
47
+ decisions: /* @__PURE__ */ new Set([
48
+ "if_statement",
49
+ "elif_clause",
50
+ "for_statement",
51
+ "while_statement",
52
+ "case_clause",
53
+ "conditional_expression",
54
+ "except_clause"
55
+ ]),
56
+ cognitive: /* @__PURE__ */ new Set([
57
+ "if_statement",
58
+ "elif_clause",
59
+ "for_statement",
60
+ "while_statement",
61
+ "match_statement",
62
+ "conditional_expression",
63
+ "except_clause"
64
+ ]),
65
+ nesting: /* @__PURE__ */ new Set([
66
+ "if_statement",
67
+ "for_statement",
68
+ "while_statement",
69
+ "match_statement",
70
+ "try_statement"
71
+ ]),
72
+ logical: /* @__PURE__ */ new Set(["and", "or"])
73
+ };
74
+ var GO = {
75
+ functions: /* @__PURE__ */ new Set([
76
+ "function_declaration",
77
+ "method_declaration",
78
+ "func_literal"
79
+ ]),
80
+ // `default_case` is not a decision.
81
+ decisions: /* @__PURE__ */ new Set([
82
+ "if_statement",
83
+ "for_statement",
84
+ "expression_case",
85
+ "type_case",
86
+ "communication_case"
87
+ ]),
88
+ cognitive: /* @__PURE__ */ new Set([
89
+ "if_statement",
90
+ "for_statement",
91
+ "expression_switch_statement",
92
+ "type_switch_statement",
93
+ "select_statement"
94
+ ]),
95
+ nesting: /* @__PURE__ */ new Set([
96
+ "if_statement",
97
+ "for_statement",
98
+ "expression_switch_statement",
99
+ "type_switch_statement",
100
+ "select_statement"
101
+ ]),
102
+ logical: /* @__PURE__ */ new Set(["&&", "||"])
103
+ };
104
+ var RUST = {
105
+ functions: /* @__PURE__ */ new Set(["function_item", "closure_expression"]),
106
+ decisions: /* @__PURE__ */ new Set([
107
+ "if_expression",
108
+ "while_expression",
109
+ "for_expression",
110
+ "loop_expression",
111
+ "match_arm"
112
+ ]),
113
+ cognitive: /* @__PURE__ */ new Set([
114
+ "if_expression",
115
+ "while_expression",
116
+ "for_expression",
117
+ "loop_expression",
118
+ "match_expression"
119
+ ]),
120
+ nesting: /* @__PURE__ */ new Set([
121
+ "if_expression",
122
+ "while_expression",
123
+ "for_expression",
124
+ "loop_expression",
125
+ "match_expression"
126
+ ]),
127
+ logical: /* @__PURE__ */ new Set(["&&", "||"])
128
+ };
129
+ var TABLES = {
130
+ typescript: JSTS,
131
+ tsx: JSTS,
132
+ javascript: JSTS,
133
+ python: PYTHON,
134
+ go: GO,
135
+ rust: RUST
136
+ };
137
+ var NOT_PARAMETERS = /* @__PURE__ */ new Set([
138
+ "comment",
139
+ "line_comment",
140
+ "block_comment",
141
+ "attribute_item",
142
+ "keyword_separator",
143
+ "positional_separator"
144
+ ]);
145
+ function isLogicalOperator(type, children, table) {
146
+ if (type !== "binary_expression" && type !== "boolean_operator")
147
+ return false;
148
+ return children.some((c) => table.logical.has(c?.type));
149
+ }
150
+ function step(walk, node, depth, cognitiveDepth, inFunction) {
151
+ const { table, tally: tally2 } = walk;
152
+ const type = node.type;
153
+ const children = node.children ?? [];
154
+ walk.visit?.(node, type, children);
155
+ tally2.nesting = Math.max(tally2.nesting, depth);
156
+ if (table.decisions.has(type))
157
+ tally2.cyclomatic++;
158
+ if (table.cognitive.has(type))
159
+ tally2.cognitive += 1 + cognitiveDepth;
160
+ if (isLogicalOperator(type, children, table)) {
161
+ tally2.cyclomatic++;
162
+ tally2.cognitive++;
163
+ }
164
+ if ((type === "break_statement" || type === "continue_statement") && children.some((c) => c?.type === "statement_identifier" || c?.type === "label_name")) {
165
+ tally2.cognitive++;
166
+ }
167
+ const nests = table.nesting.has(type);
168
+ const isFunction = table.functions.has(type);
169
+ const nextDepth = nests ? depth + 1 : depth;
170
+ const deepens = nests || isFunction && inFunction;
171
+ const nextCognitiveDepth = deepens ? cognitiveDepth + 1 : cognitiveDepth;
172
+ for (const child of children) {
173
+ if (child)
174
+ step(walk, child, nextDepth, nextCognitiveDepth, inFunction || isFunction);
175
+ }
176
+ }
177
+ function tally(scope, table, insideFunction, visit) {
178
+ const walk = {
179
+ table,
180
+ visit,
181
+ tally: { cyclomatic: 1, cognitive: 0, nesting: 0 }
182
+ };
183
+ if (scope)
184
+ step(walk, scope, 0, 0, insideFunction);
185
+ return walk.tally;
186
+ }
187
+ function bodyOf(fn) {
188
+ const id = fn.childForFieldName("body")?.id;
189
+ if (id === void 0)
190
+ return null;
191
+ return (fn.children ?? []).find((c) => c?.id === id) ?? null;
192
+ }
193
+ function countParameters(fn) {
194
+ const list = fn.childForFieldName("parameters");
195
+ if (!list)
196
+ return fn.childForFieldName("parameter") ? 1 : 0;
197
+ let count = 0;
198
+ for (const param of list.namedChildren ?? []) {
199
+ if (!param || NOT_PARAMETERS.has(param.type))
200
+ continue;
201
+ count += Math.max(1, param.childrenForFieldName("name").length);
202
+ }
203
+ return count;
204
+ }
205
+ function measureFunction(fn, languageId, visit) {
206
+ const { cyclomatic, cognitive, nesting } = tally(bodyOf(fn), TABLES[languageId], true, visit);
207
+ return {
208
+ cyclomatic,
209
+ cognitive,
210
+ nesting,
211
+ length: fn.endPosition.row - fn.startPosition.row + 1,
212
+ parameters: countParameters(fn)
213
+ };
214
+ }
215
+ function measureFile(root, languageId) {
216
+ const table = TABLES[languageId];
217
+ const functions = [];
218
+ const { cognitive, nesting } = tally(root, table, false, (node, type) => {
219
+ if (!table.functions.has(type) || !node.isNamed)
220
+ return;
221
+ const line = node.startPosition.row + 1;
222
+ functions.push({
223
+ name: node.childForFieldName("name")?.text ?? `<anonymous@L${line}>`,
224
+ line,
225
+ ...measureFunction(node, languageId)
226
+ });
227
+ });
228
+ return { cognitive, nesting, functions };
229
+ }
230
+
231
+ export {
232
+ measureFunction,
233
+ measureFile
234
+ };
@@ -1,40 +1,38 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  getScratchTreeDirNames
4
- } from "./chunk-KZ4ALBCH.js";
4
+ } from "./chunk-SJQUWQR6.js";
5
5
  import {
6
6
  SecurityScanClient
7
- } from "./chunk-JPRDTY5S.js";
8
- import {
9
- scannerReportParentDir
10
- } from "./chunk-RGGH6M34.js";
11
- import "./chunk-RZG472YW.js";
7
+ } from "./chunk-VGTBLTPN.js";
8
+ import "./chunk-4ITEFRDH.js";
12
9
  import {
13
10
  resolveOpengrepConfig
14
- } from "./chunk-DYRZGUMA.js";
11
+ } from "./chunk-NE4EFHJX.js";
12
+ import {
13
+ scannerReportParentDir
14
+ } from "./chunk-LT62P654.js";
15
15
  import {
16
16
  stripPackRuleIdPrefix
17
- } from "./chunk-5RNB4HVK.js";
18
- import "./chunk-JBP7KESM.js";
19
- import "./chunk-JZRP4DGP.js";
17
+ } from "./chunk-SG2JQ2YP.js";
18
+ import "./chunk-VPFRU5IG.js";
19
+ import "./chunk-NPNFGYLV.js";
20
20
  import {
21
21
  safeSpawnAsync
22
- } from "./chunk-WMDUT4KH.js";
22
+ } from "./chunk-H65TYP6V.js";
23
23
  import "./chunk-AWQWXSW4.js";
24
- import "./chunk-X35S7HSB.js";
25
- import "./chunk-SQC7K3SP.js";
26
- import "./chunk-JE6HKLC7.js";
24
+ import "./chunk-FOEPIX76.js";
25
+ import "./chunk-NL5LSKVD.js";
26
+ import "./chunk-7WJ55KBN.js";
27
27
  import {
28
28
  recordDegradationOnce
29
- } from "./chunk-2453RRJ2.js";
30
- import "./chunk-WQV6BI4Q.js";
29
+ } from "./chunk-3FRI5H4T.js";
31
30
  import "./chunk-S26LC76R.js";
32
- import "./chunk-565VRUP4.js";
33
- import "./chunk-VLQ7UKZH.js";
31
+ import "./chunk-VCRVNLE7.js";
34
32
  import "./chunk-LJDODBBZ.js";
35
33
  import {
36
34
  realpathOrResolve
37
- } from "./chunk-GMROJJRN.js";
35
+ } from "./chunk-CB7PEVOJ.js";
38
36
  import "./chunk-NXL4FFQQ.js";
39
37
 
40
38
  // dist/clients/opengrep-client.js
@@ -0,0 +1,28 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ importFactProvider,
4
+ importFactsApplyTo
5
+ } from "./chunk-Y3EHLUPL.js";
6
+ import "./chunk-GTTMQ6XB.js";
7
+ import "./chunk-CTB5BAJI.js";
8
+ import "./chunk-Z54ZSOBZ.js";
9
+ import "./chunk-GUGKKGG7.js";
10
+ import "./chunk-QGITU23N.js";
11
+ import "./chunk-OTSTS7L2.js";
12
+ import "./chunk-WAA63ZJV.js";
13
+ import "./chunk-NPNFGYLV.js";
14
+ import "./chunk-H65TYP6V.js";
15
+ import "./chunk-CZCAZVTD.js";
16
+ import "./chunk-FOEPIX76.js";
17
+ import "./chunk-NL5LSKVD.js";
18
+ import "./chunk-7WJ55KBN.js";
19
+ import "./chunk-3FRI5H4T.js";
20
+ import "./chunk-S26LC76R.js";
21
+ import "./chunk-VCRVNLE7.js";
22
+ import "./chunk-LJDODBBZ.js";
23
+ import "./chunk-CB7PEVOJ.js";
24
+ import "./chunk-NXL4FFQQ.js";
25
+ export {
26
+ importFactProvider,
27
+ importFactsApplyTo
28
+ };
@@ -1,22 +1,20 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  parseSymbolKey
4
- } from "./chunk-L3CLUGDY.js";
4
+ } from "./chunk-J6BR5XN2.js";
5
5
  import {
6
6
  isTestRoleCollateral
7
- } from "./chunk-AGGUWKRK.js";
7
+ } from "./chunk-UY745U35.js";
8
8
  import "./chunk-3MED75HT.js";
9
- import "./chunk-WMDUT4KH.js";
10
- import "./chunk-X35S7HSB.js";
11
- import "./chunk-SQC7K3SP.js";
12
- import "./chunk-JE6HKLC7.js";
13
- import "./chunk-2453RRJ2.js";
14
- import "./chunk-WQV6BI4Q.js";
9
+ import "./chunk-H65TYP6V.js";
10
+ import "./chunk-FOEPIX76.js";
11
+ import "./chunk-NL5LSKVD.js";
12
+ import "./chunk-7WJ55KBN.js";
13
+ import "./chunk-3FRI5H4T.js";
15
14
  import "./chunk-S26LC76R.js";
16
- import "./chunk-565VRUP4.js";
17
- import "./chunk-VLQ7UKZH.js";
15
+ import "./chunk-VCRVNLE7.js";
18
16
  import "./chunk-LJDODBBZ.js";
19
- import "./chunk-GMROJJRN.js";
17
+ import "./chunk-CB7PEVOJ.js";
20
18
  import "./chunk-NXL4FFQQ.js";
21
19
 
22
20
  // dist/clients/project-diagnostics/runner-adapters/call-graph-impact.js