@herbertgao/pi-extensions 2026.11.3 → 2026.11.4

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 (203) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +7 -7
  3. package/THIRD_PARTY_NOTICES.md +2 -2
  4. package/node_modules/@herbertgao/pi-cc-extensions/CHANGELOG.md +6 -0
  5. package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +2 -2
  6. package/node_modules/@herbertgao/pi-cc-extensions/README.md +2 -2
  7. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +33 -5
  8. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/ccstyle-tool.ts +72 -17
  9. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +10 -2
  10. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/tool-io.ts +16 -7
  11. package/node_modules/@herbertgao/pi-cc-extensions/package.json +7 -5
  12. package/node_modules/@herbertgao/pi-cc-extensions/themes/cc-dark-hc.json +92 -0
  13. package/node_modules/@herbertgao/pi-cc-extensions/themes/cc-light-hc.json +92 -0
  14. package/node_modules/pi-commandcode-provider/CHANGELOG.md +27 -0
  15. package/node_modules/pi-commandcode-provider/CONTRIBUTING.md +64 -5
  16. package/node_modules/pi-commandcode-provider/README.md +40 -26
  17. package/node_modules/pi-commandcode-provider/RELEASE.md +25 -0
  18. package/node_modules/pi-commandcode-provider/index.ts +212 -38
  19. package/node_modules/pi-commandcode-provider/package.json +9 -8
  20. package/node_modules/pi-commandcode-provider/scripts/live-e2e-profile.mjs +6 -13
  21. package/node_modules/pi-commandcode-provider/scripts/typecheck-entrypoint.mjs +88 -0
  22. package/node_modules/pi-commandcode-provider/src/api-key.ts +43 -2
  23. package/node_modules/pi-commandcode-provider/src/commandcode-catalog-overrides.ts +1 -1
  24. package/node_modules/pi-commandcode-provider/src/commandcode-catalog.ts +9 -2
  25. package/node_modules/pi-commandcode-provider/src/cost.ts +3 -37
  26. package/node_modules/pi-commandcode-provider/src/diagnostics.ts +215 -0
  27. package/node_modules/pi-commandcode-provider/src/oauth.ts +1 -1
  28. package/node_modules/pi-commandcode-provider/src/quota-command.ts +1 -1
  29. package/node_modules/pi-commandcode-provider/src/routing.ts +166 -0
  30. package/node_modules/pi-commandcode-provider/src/runtime.ts +15 -9
  31. package/node_modules/pi-commandcode-provider/src/transport.ts +79 -85
  32. package/node_modules/pi-commandcode-provider/src/types.ts +20 -39
  33. package/node_modules/pi-commandcode-provider/src/usage.ts +1 -1
  34. package/node_modules/pi-lens/CHANGELOG-USER.md +31 -0
  35. package/node_modules/pi-lens/CHANGELOG.md +178 -0
  36. package/node_modules/pi-lens/README.md +2 -1
  37. package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +1 -1
  38. package/node_modules/pi-lens/dist/{chunk-3O5EII3W.js → chunk-2VZ3VN3N.js} +2 -2
  39. package/node_modules/pi-lens/dist/{chunk-SDFKOLSF.js → chunk-3HTZDY3C.js} +8 -6
  40. package/node_modules/pi-lens/dist/{chunk-A5GRLYPZ.js → chunk-3NPWO5UO.js} +7 -13
  41. package/node_modules/pi-lens/dist/{chunk-AGGUWKRK.js → chunk-47UCC4MM.js} +1 -1
  42. package/node_modules/pi-lens/dist/chunk-4ENEJHF4.js +198 -0
  43. package/node_modules/pi-lens/dist/{chunk-WXUDRAG6.js → chunk-5GEYJJHG.js} +10 -12
  44. package/node_modules/pi-lens/dist/{chunk-HHR7WGCI.js → chunk-5YSEQHJN.js} +3 -3
  45. package/node_modules/pi-lens/dist/{chunk-L3CLUGDY.js → chunk-6GPB3JLL.js} +3 -3
  46. package/node_modules/pi-lens/dist/{chunk-5F3XF3SX.js → chunk-7R5GZIA6.js} +6 -6
  47. package/node_modules/pi-lens/dist/{chunk-CUDD35TW.js → chunk-7UTSNTWM.js} +4 -4
  48. package/node_modules/pi-lens/dist/{chunk-DYRZGUMA.js → chunk-7YTRG6YW.js} +2 -2
  49. package/node_modules/pi-lens/dist/{chunk-JZRP4DGP.js → chunk-AACN5GNE.js} +2 -2
  50. package/node_modules/pi-lens/dist/{chunk-7ANZ7XDD.js → chunk-ACRJ2GZ5.js} +2 -2
  51. package/node_modules/pi-lens/dist/{chunk-6FIRFP6A.js → chunk-C3YRO3EU.js} +10 -12
  52. package/node_modules/pi-lens/dist/{chunk-GMROJJRN.js → chunk-CB7PEVOJ.js} +9 -1
  53. package/node_modules/pi-lens/dist/{chunk-BBET6HD6.js → chunk-CDFJF5YD.js} +1 -1
  54. package/node_modules/pi-lens/dist/{chunk-NSPVR3FN.js → chunk-CJS6WE66.js} +17 -19
  55. package/node_modules/pi-lens/dist/{chunk-6YUNI7B5.js → chunk-CM6BDY4E.js} +14 -60
  56. package/node_modules/pi-lens/dist/{chunk-G5GV2Q7K.js → chunk-CZCAZVTD.js} +16 -2
  57. package/node_modules/pi-lens/dist/chunk-DGKFWQK4.js +23 -0
  58. package/node_modules/pi-lens/dist/{chunk-VOP4PJKA.js → chunk-E65WJVI5.js} +7 -9
  59. package/node_modules/pi-lens/dist/{chunk-TV6RXRYH.js → chunk-EKNYSXFB.js} +8 -10
  60. package/node_modules/pi-lens/dist/{chunk-4LL2VRNY.js → chunk-EY6LY2HO.js} +16 -18
  61. package/node_modules/pi-lens/dist/{chunk-MC6VB2E5.js → chunk-F6BEQWAK.js} +17 -5
  62. package/node_modules/pi-lens/dist/{chunk-R2QQC33W.js → chunk-FGNSESAC.js} +12 -14
  63. package/node_modules/pi-lens/dist/{chunk-OC7VWJBZ.js → chunk-FRUBVFXV.js} +35 -37
  64. package/node_modules/pi-lens/dist/{chunk-7CGIDRIK.js → chunk-G22UNQID.js} +14 -16
  65. package/node_modules/pi-lens/dist/{chunk-L4NEVZ4T.js → chunk-GQTQUNCG.js} +25 -27
  66. package/node_modules/pi-lens/dist/{chunk-ZKLTNLAW.js → chunk-H3BVMK47.js} +6 -6
  67. package/node_modules/pi-lens/dist/chunk-H6FLQ5NW.js +28 -0
  68. package/node_modules/pi-lens/dist/{chunk-2ZE3AUJQ.js → chunk-HEA3EM23.js} +13 -15
  69. package/node_modules/pi-lens/dist/{chunk-CZL44WFN.js → chunk-HSOBIN22.js} +2 -2
  70. package/node_modules/pi-lens/dist/{chunk-PKSUMEPT.js → chunk-HYSKJMZK.js} +3 -3
  71. package/node_modules/pi-lens/dist/{chunk-VN3L2JWZ.js → chunk-IICERRFF.js} +5 -5
  72. package/node_modules/pi-lens/dist/{chunk-O4N5BQ3T.js → chunk-IILEH3ZC.js} +8 -10
  73. package/node_modules/pi-lens/dist/{chunk-WC6WRNQT.js → chunk-J3Q2NYJR.js} +2 -2
  74. package/node_modules/pi-lens/dist/{chunk-SFLHSL5R.js → chunk-JUZ67QZQ.js} +18 -7
  75. package/node_modules/pi-lens/dist/chunk-KR5VGMVT.js +25 -0
  76. package/node_modules/pi-lens/dist/{chunk-UHHLR2VY.js → chunk-KV6GQOGN.js} +38 -41
  77. package/node_modules/pi-lens/dist/{chunk-HUAM7QG3.js → chunk-KXMJLOZF.js} +25 -23
  78. package/node_modules/pi-lens/dist/{chunk-BUZIQDFS.js → chunk-L4Y3ROKQ.js} +3 -3
  79. package/node_modules/pi-lens/dist/{chunk-JBP7KESM.js → chunk-L6WBJGQS.js} +1 -1
  80. package/node_modules/pi-lens/dist/{chunk-35WKJWO5.js → chunk-L7O774U7.js} +14 -14
  81. package/node_modules/pi-lens/dist/{chunk-BOPDQ7AZ.js → chunk-LAHHGNAY.js} +19 -21
  82. package/node_modules/pi-lens/dist/{chunk-RGGH6M34.js → chunk-LT62P654.js} +1 -1
  83. package/node_modules/pi-lens/dist/{chunk-5T5A6YAJ.js → chunk-LWOM6LVS.js} +33 -34
  84. package/node_modules/pi-lens/dist/{chunk-JYLOYTZD.js → chunk-MKPDIAZH.js} +5 -1
  85. package/node_modules/pi-lens/dist/{chunk-CM73PPGD.js → chunk-MN635QYA.js} +3 -4
  86. package/node_modules/pi-lens/dist/{chunk-BQG2QFVO.js → chunk-MQ4PPCJB.js} +21 -29
  87. package/node_modules/pi-lens/dist/{chunk-HXFUTMX2.js → chunk-MRLH4MYU.js} +2 -2
  88. package/node_modules/pi-lens/dist/{chunk-XOMGO63G.js → chunk-N56BNAA6.js} +19 -21
  89. package/node_modules/pi-lens/dist/{chunk-7MAD5ZAY.js → chunk-N5CEGQPG.js} +14 -16
  90. package/node_modules/pi-lens/dist/{chunk-ZFORSIED.js → chunk-NCLO6E6N.js} +13 -33
  91. package/node_modules/pi-lens/dist/{chunk-SQC7K3SP.js → chunk-NL5LSKVD.js} +2 -2
  92. package/node_modules/pi-lens/dist/{chunk-I22THIHI.js → chunk-NMUSOZ2D.js} +10 -12
  93. package/node_modules/pi-lens/dist/{chunk-4NBWFYWW.js → chunk-NOWH2VA2.js} +8 -33
  94. package/node_modules/pi-lens/dist/{chunk-NM2NWH55.js → chunk-NUSXS6YB.js} +6 -5
  95. package/node_modules/pi-lens/dist/{chunk-OZWXLJMX.js → chunk-OSEKJEUU.js} +2 -2
  96. package/node_modules/pi-lens/dist/{chunk-2BKUFQKR.js → chunk-OUYAUXAT.js} +405 -181
  97. package/node_modules/pi-lens/dist/{chunk-JPRDTY5S.js → chunk-PBZNYHMM.js} +8 -10
  98. package/node_modules/pi-lens/dist/{chunk-JE6HKLC7.js → chunk-PIIUNJIT.js} +2 -4
  99. package/node_modules/pi-lens/dist/{chunk-ZZDIOAAJ.js → chunk-PRHYIA6X.js} +6 -6
  100. package/node_modules/pi-lens/dist/{chunk-4W52ZKZX.js → chunk-PXQ45SGD.js} +2 -2
  101. package/node_modules/pi-lens/dist/chunk-Q6JQKWPK.js +25 -0
  102. package/node_modules/pi-lens/dist/{chunk-PIQQM32Y.js → chunk-QB7T2PHK.js} +2 -2
  103. package/node_modules/pi-lens/dist/{chunk-HKIL6DCL.js → chunk-QGITU23N.js} +1 -1
  104. package/node_modules/pi-lens/dist/chunk-QJJKOHLH.js +57 -0
  105. package/node_modules/pi-lens/dist/{chunk-6LJOJ6EO.js → chunk-QP33NKYC.js} +14 -16
  106. package/node_modules/pi-lens/dist/{chunk-DIWK3LBC.js → chunk-QVBOXT3L.js} +8 -10
  107. package/node_modules/pi-lens/dist/{chunk-IYVYZQRL.js → chunk-RNJFRXEN.js} +5 -7
  108. package/node_modules/pi-lens/dist/{chunk-G6JKM4O7.js → chunk-RNXOWDM6.js} +10 -10
  109. package/node_modules/pi-lens/dist/{chunk-5RNB4HVK.js → chunk-RTFMDIKV.js} +1 -1
  110. package/node_modules/pi-lens/dist/{chunk-XWIME22V.js → chunk-SIQHOB6P.js} +11 -13
  111. package/node_modules/pi-lens/dist/{chunk-T2S3FNNJ.js → chunk-SLSMJPEF.js} +41 -42
  112. package/node_modules/pi-lens/dist/chunk-T5QSLSMM.js +50 -0
  113. package/node_modules/pi-lens/dist/chunk-TGQDAG4B.js +88 -0
  114. package/node_modules/pi-lens/dist/{chunk-6GMGEKQN.js → chunk-THYHUIDR.js} +39 -12
  115. package/node_modules/pi-lens/dist/{chunk-WMDUT4KH.js → chunk-TMNUTMT5.js} +72 -89
  116. package/node_modules/pi-lens/dist/{chunk-7TNILKGY.js → chunk-TOE2RRCS.js} +1 -1
  117. package/node_modules/pi-lens/dist/chunk-TYHPVE5H.js +25 -0
  118. package/node_modules/pi-lens/dist/chunk-UAKO2M6B.js +73 -0
  119. package/node_modules/pi-lens/dist/chunk-UC5AXW5Z.js +20 -0
  120. package/node_modules/pi-lens/dist/chunk-UTJP6WOS.js +28 -0
  121. package/node_modules/pi-lens/dist/{chunk-FRLAUP2B.js → chunk-UXTQ3QPD.js} +4 -4
  122. package/node_modules/pi-lens/dist/{chunk-4QG55RRC.js → chunk-V2WDBOLZ.js} +10 -12
  123. package/node_modules/pi-lens/dist/{chunk-FHEV6T4L.js → chunk-V67D6TMU.js} +8 -10
  124. package/node_modules/pi-lens/dist/{chunk-VLQ7UKZH.js → chunk-VCRVNLE7.js} +135 -2
  125. package/node_modules/pi-lens/dist/{chunk-KZ4ALBCH.js → chunk-VO4JFPTV.js} +2 -2
  126. package/node_modules/pi-lens/dist/{chunk-GIRBSBGL.js → chunk-VWLSU3XV.js} +3 -3
  127. package/node_modules/pi-lens/dist/{chunk-2453RRJ2.js → chunk-W5E72HJA.js} +59 -22
  128. package/node_modules/pi-lens/dist/{chunk-VPLBLWFO.js → chunk-W7TY6HYX.js} +1 -1
  129. package/node_modules/pi-lens/dist/{chunk-SP4TFY5F.js → chunk-WSSLVMDA.js} +11 -13
  130. package/node_modules/pi-lens/dist/{chunk-PPKECBPP.js → chunk-WTB4GKMH.js} +10 -1
  131. package/node_modules/pi-lens/dist/{chunk-X35S7HSB.js → chunk-X5BJ3G2P.js} +41 -30
  132. package/node_modules/pi-lens/dist/{chunk-X66YJ2SS.js → chunk-XKFO2SZV.js} +33 -34
  133. package/node_modules/pi-lens/dist/{chunk-OWTG6UMO.js → chunk-XLAI7UYY.js} +75 -22
  134. package/node_modules/pi-lens/dist/{chunk-4B2YFN4U.js → chunk-XO756WE5.js} +45 -33
  135. package/node_modules/pi-lens/dist/{chunk-VOXTCULR.js → chunk-XVB3Q2PG.js} +2 -4
  136. package/node_modules/pi-lens/dist/{chunk-XYLC35E4.js → chunk-YOXCCJDF.js} +517 -308
  137. package/node_modules/pi-lens/dist/{chunk-O2ARHQKF.js → chunk-ZCQBNPRH.js} +2 -2
  138. package/node_modules/pi-lens/dist/chunk-ZD4KVFXI.js +234 -0
  139. package/node_modules/pi-lens/dist/{chunk-LSFXZLPW.js → chunk-ZDMFGACN.js} +184 -235
  140. package/node_modules/pi-lens/dist/{chunk-4BKU7PV3.js → chunk-ZMMHHXSW.js} +1 -1
  141. package/node_modules/pi-lens/dist/{chunk-OY7WZI7Q.js → chunk-ZPM7ZIFL.js} +6 -6
  142. package/node_modules/pi-lens/dist/{chunk-R4QWJQ2H.js → chunk-ZVCDHYWZ.js} +9 -11
  143. package/node_modules/pi-lens/dist/{chunk-RZG472YW.js → chunk-ZZN74OGD.js} +83 -46
  144. package/node_modules/pi-lens/dist/{chunk-BHWW6FAX.js → chunk-ZZSJAR76.js} +37 -19
  145. package/node_modules/pi-lens/dist/index.js +4910 -4218
  146. package/node_modules/pi-lens/dist/mcp/analyze-cli.js +12 -17
  147. package/node_modules/pi-lens/dist/mcp/cli.js +41 -42
  148. package/node_modules/pi-lens/dist/mcp/server.js +1451 -648
  149. package/node_modules/pi-lens/dist/mcp/worker.js +59 -60
  150. package/node_modules/pi-lens/dist/probes/installer.js +17 -19
  151. package/node_modules/pi-lens/docs/agent-tools.md +40 -8
  152. package/node_modules/pi-lens/docs/analysisall.md +1 -1
  153. package/node_modules/pi-lens/docs/ci-bot-pr-checks.md +7 -5
  154. package/node_modules/pi-lens/docs/configuration.md +51 -9
  155. package/node_modules/pi-lens/docs/defect-shapes.md +52 -3
  156. package/node_modules/pi-lens/docs/environment-variables.md +18 -1
  157. package/node_modules/pi-lens/docs/features.md +12 -5
  158. package/node_modules/pi-lens/docs/globalconfig.md +11 -3
  159. package/node_modules/pi-lens/docs/invariants/lsp-trust-exec.md +9 -2
  160. package/node_modules/pi-lens/docs/invariants/session-telemetry.md +2 -2
  161. package/node_modules/pi-lens/docs/language-coverage.md +1 -0
  162. package/node_modules/pi-lens/docs/lsp-capability-matrix.md +57 -35
  163. package/node_modules/pi-lens/docs/lsp-idle-eviction.md +4 -1
  164. package/node_modules/pi-lens/docs/merge-queue-rollout.md +10 -8
  165. package/node_modules/pi-lens/docs/module-report-read-symbol.md +34 -23
  166. package/node_modules/pi-lens/docs/pi-lens-fixer.md +11 -1
  167. package/node_modules/pi-lens/docs/pi-lens-investigator.md +3 -0
  168. package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +15 -7
  169. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +1 -1
  170. package/node_modules/pi-lens/docs/pi-lens-subagent.md +13 -0
  171. package/node_modules/pi-lens/docs/public-api-stability.md +39 -5
  172. package/node_modules/pi-lens/docs/release-qa-baseline.md +7 -4
  173. package/node_modules/pi-lens/docs/schema/pi-lens-config-v1.json +11 -2
  174. package/node_modules/pi-lens/docs/servercapabilities.md +3 -1
  175. package/node_modules/pi-lens/docs/settings.md +2 -2
  176. package/node_modules/pi-lens/docs/word-index.md +3 -2
  177. package/node_modules/pi-lens/package.json +8 -3
  178. package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +1 -2
  179. package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +1 -2
  180. package/node_modules/pi-lens/scripts/download-grammars.js +3 -2
  181. package/node_modules/pi-lens/skills/pi-lens-lsp-navigation/SKILL.md +5 -1
  182. package/node_modules/pi-provider-qoder/dist/index.js +473 -62
  183. package/node_modules/pi-provider-qoder/package.json +1 -1
  184. package/package.json +10 -8
  185. package/node_modules/pi-commandcode-provider/src/converters.ts +0 -419
  186. package/node_modules/pi-commandcode-provider/src/core.ts +0 -861
  187. package/node_modules/pi-commandcode-provider/src/json-schema.ts +0 -417
  188. package/node_modules/pi-commandcode-provider/src/transcript.ts +0 -56
  189. package/node_modules/pi-lens/dist/chunk-2TS4GLOJ.js +0 -31
  190. package/node_modules/pi-lens/dist/chunk-3JAHQBSY.js +0 -27
  191. package/node_modules/pi-lens/dist/chunk-447YZL4S.js +0 -25
  192. package/node_modules/pi-lens/dist/chunk-565VRUP4.js +0 -136
  193. package/node_modules/pi-lens/dist/chunk-57X2CDRX.js +0 -49
  194. package/node_modules/pi-lens/dist/chunk-GGYOZWHW.js +0 -27
  195. package/node_modules/pi-lens/dist/chunk-IE5D3RA5.js +0 -58
  196. package/node_modules/pi-lens/dist/chunk-LPYTPNOJ.js +0 -22
  197. package/node_modules/pi-lens/dist/chunk-OFNMHPBT.js +0 -89
  198. package/node_modules/pi-lens/dist/chunk-U3AS2FR6.js +0 -106
  199. package/node_modules/pi-lens/dist/chunk-W3BGKBBK.js +0 -27
  200. package/node_modules/pi-lens/dist/chunk-WQV6BI4Q.js +0 -48
  201. package/node_modules/pi-lens/dist/chunk-YHGYAEFH.js +0 -443
  202. package/node_modules/pi-lens/dist/chunk-ZONZ6YY3.js +0 -74
  203. package/node_modules/pi-lens/dist/chunk-ZSM35JF4.js +0 -30
@@ -1,443 +0,0 @@
1
- import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
- import {
3
- calcCyclomaticComplexity
4
- } from "./chunk-6YUNI7B5.js";
5
- import "./chunk-7TNILKGY.js";
6
- import "./chunk-5W3R6LFT.js";
7
- import {
8
- firstChildOfType,
9
- isComplexityLanguageId,
10
- isComplexitySupportedFile,
11
- resolveTreeSitterLanguage,
12
- walk,
13
- withTreeSitterRoot
14
- } from "./chunk-BHWW6FAX.js";
15
- import "./chunk-Z54ZSOBZ.js";
16
- import "./chunk-HHR7WGCI.js";
17
- import "./chunk-HKIL6DCL.js";
18
- import "./chunk-PPKECBPP.js";
19
- import "./chunk-JYLOYTZD.js";
20
- import "./chunk-JZRP4DGP.js";
21
- import "./chunk-WMDUT4KH.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 {
28
- createSubsystemLogger
29
- } from "./chunk-WQV6BI4Q.js";
30
- import "./chunk-S26LC76R.js";
31
- import "./chunk-565VRUP4.js";
32
- import "./chunk-VLQ7UKZH.js";
33
- import "./chunk-LJDODBBZ.js";
34
- import "./chunk-GMROJJRN.js";
35
- import "./chunk-NXL4FFQQ.js";
36
-
37
- // dist/clients/complexity-client.js
38
- import * as fs from "node:fs";
39
- import * as path from "node:path";
40
- var JSTS = {
41
- functionLike: /* @__PURE__ */ new Set([
42
- "function_declaration",
43
- "method_definition",
44
- "function_expression",
45
- "arrow_function",
46
- "generator_function",
47
- "generator_function_declaration"
48
- ]),
49
- nesting: /* @__PURE__ */ new Set([
50
- "if_statement",
51
- "while_statement",
52
- "for_statement",
53
- "for_in_statement",
54
- "switch_statement",
55
- "function_declaration",
56
- "function_expression",
57
- "arrow_function",
58
- "method_definition",
59
- "class_declaration",
60
- "try_statement",
61
- "catch_clause"
62
- ]),
63
- decision: /* @__PURE__ */ new Set([
64
- "if_statement",
65
- "while_statement",
66
- "for_statement",
67
- "for_in_statement",
68
- "switch_case",
69
- "ternary_expression"
70
- ]),
71
- cognitive: /* @__PURE__ */ new Set([
72
- "if_statement",
73
- "while_statement",
74
- "for_statement",
75
- "for_in_statement",
76
- "switch_statement",
77
- "switch_case",
78
- "ternary_expression",
79
- "catch_clause"
80
- ]),
81
- logicalOpNodes: /* @__PURE__ */ new Set(),
82
- logicalBinaryOps: /* @__PURE__ */ new Set(["&&", "||", "??"]),
83
- tryNode: "try_statement",
84
- nameChildTypes: ["identifier", "property_identifier"]
85
- };
86
- var PYTHON = {
87
- functionLike: /* @__PURE__ */ new Set(["function_definition", "lambda"]),
88
- nesting: /* @__PURE__ */ new Set([
89
- "if_statement",
90
- "for_statement",
91
- "while_statement",
92
- "match_statement",
93
- "function_definition",
94
- "class_definition",
95
- "try_statement",
96
- "except_clause",
97
- "elif_clause"
98
- ]),
99
- decision: /* @__PURE__ */ new Set([
100
- "if_statement",
101
- "elif_clause",
102
- "for_statement",
103
- "while_statement",
104
- "case_clause",
105
- "conditional_expression"
106
- ]),
107
- cognitive: /* @__PURE__ */ new Set([
108
- "if_statement",
109
- "elif_clause",
110
- "for_statement",
111
- "while_statement",
112
- "match_statement",
113
- "case_clause",
114
- "conditional_expression",
115
- "except_clause"
116
- ]),
117
- logicalOpNodes: /* @__PURE__ */ new Set(["boolean_operator"]),
118
- logicalBinaryOps: /* @__PURE__ */ new Set(),
119
- tryNode: "try_statement",
120
- nameChildTypes: ["identifier"]
121
- };
122
- var GO = {
123
- functionLike: /* @__PURE__ */ new Set([
124
- "function_declaration",
125
- "method_declaration",
126
- "func_literal"
127
- ]),
128
- nesting: /* @__PURE__ */ new Set([
129
- "if_statement",
130
- "for_statement",
131
- "expression_switch_statement",
132
- "type_switch_statement",
133
- "select_statement",
134
- "function_declaration",
135
- "method_declaration"
136
- ]),
137
- decision: /* @__PURE__ */ new Set([
138
- "if_statement",
139
- "for_statement",
140
- "expression_case",
141
- "type_case",
142
- "communication_case"
143
- ]),
144
- cognitive: /* @__PURE__ */ new Set([
145
- "if_statement",
146
- "for_statement",
147
- "expression_switch_statement",
148
- "type_switch_statement",
149
- "select_statement",
150
- "expression_case",
151
- "type_case",
152
- "communication_case"
153
- ]),
154
- logicalOpNodes: /* @__PURE__ */ new Set(),
155
- logicalBinaryOps: /* @__PURE__ */ new Set(["&&", "||"]),
156
- tryNode: void 0,
157
- // Go has no try/catch (error returns)
158
- nameChildTypes: ["identifier", "field_identifier"]
159
- };
160
- var RUST = {
161
- functionLike: /* @__PURE__ */ new Set(["function_item", "closure_expression"]),
162
- nesting: /* @__PURE__ */ new Set([
163
- "if_expression",
164
- "while_expression",
165
- "for_expression",
166
- "loop_expression",
167
- "match_expression",
168
- "function_item"
169
- ]),
170
- decision: /* @__PURE__ */ new Set([
171
- "if_expression",
172
- "while_expression",
173
- "for_expression",
174
- "loop_expression",
175
- "match_arm"
176
- ]),
177
- cognitive: /* @__PURE__ */ new Set([
178
- "if_expression",
179
- "while_expression",
180
- "for_expression",
181
- "loop_expression",
182
- "match_expression",
183
- "match_arm"
184
- ]),
185
- logicalOpNodes: /* @__PURE__ */ new Set(),
186
- logicalBinaryOps: /* @__PURE__ */ new Set(["&&", "||"]),
187
- tryNode: void 0,
188
- // Rust uses Result/? — no try/catch
189
- nameChildTypes: ["identifier"]
190
- };
191
- var LANGUAGE_NODES = {
192
- typescript: JSTS,
193
- tsx: JSTS,
194
- javascript: JSTS,
195
- python: PYTHON,
196
- go: GO,
197
- rust: RUST
198
- };
199
- var COMMENT_TYPES = /* @__PURE__ */ new Set(["comment", "line_comment", "block_comment"]);
200
- function isLogicalOp(node, nodes) {
201
- if (nodes.logicalOpNodes.has(node.type))
202
- return true;
203
- if (nodes.logicalBinaryOps.size > 0 && node.type === "binary_expression") {
204
- return (node.children ?? []).some((c) => c && nodes.logicalBinaryOps.has(c.type));
205
- }
206
- return false;
207
- }
208
- function subtreeCyclomatic(root, nodes) {
209
- if (nodes === JSTS)
210
- return calcCyclomaticComplexity(root) - 1;
211
- let cc = 0;
212
- walk(root, (n) => {
213
- if (nodes.decision.has(n.type))
214
- cc++;
215
- if (isLogicalOp(n, nodes))
216
- cc++;
217
- });
218
- return cc;
219
- }
220
- function subtreeCognitive(node, nesting, nodes) {
221
- let complexity = 0;
222
- if (nodes.cognitive.has(node.type))
223
- complexity += 1 + nesting;
224
- if ((node.type === "break_statement" || node.type === "continue_statement") && (node.children ?? []).some((c) => c && (c.type === "statement_identifier" || c.type === "identifier" || c.type === "label_name" || c.type === "label"))) {
225
- complexity += 1 + nesting;
226
- }
227
- if (isLogicalOp(node, nodes))
228
- complexity += 1;
229
- const childNesting = nodes.nesting.has(node.type) ? nesting + 1 : nesting;
230
- for (const child of node.children ?? []) {
231
- if (child)
232
- complexity += subtreeCognitive(child, childNesting, nodes);
233
- }
234
- return complexity;
235
- }
236
- function subtreeMaxNesting(node, currentDepth, nodes) {
237
- let maxDepth = currentDepth;
238
- if (nodes.nesting.has(node.type)) {
239
- currentDepth++;
240
- maxDepth = Math.max(maxDepth, currentDepth);
241
- }
242
- for (const child of node.children ?? []) {
243
- if (child) {
244
- maxDepth = Math.max(maxDepth, subtreeMaxNesting(child, currentDepth, nodes));
245
- }
246
- }
247
- return maxDepth;
248
- }
249
- function functionName(fnNode, nodes) {
250
- for (const t of nodes.nameChildTypes) {
251
- const id = firstChildOfType(fnNode, t);
252
- if (id)
253
- return id.text;
254
- }
255
- return void 0;
256
- }
257
- function collectFunctionMetrics(root, nodes) {
258
- const functions = [];
259
- const visit = (node, nestingLevel) => {
260
- if (nodes.functionLike.has(node.type)) {
261
- const startLine = node.startPosition.row;
262
- const endLine = node.endPosition.row;
263
- functions.push({
264
- name: functionName(node, nodes) ?? `<anonymous@L${startLine + 1}>`,
265
- line: startLine + 1,
266
- length: endLine - startLine + 1,
267
- cyclomatic: subtreeCyclomatic(node, nodes),
268
- cognitive: subtreeCognitive(node, nestingLevel, nodes),
269
- nestingDepth: subtreeMaxNesting(node, 0, nodes)
270
- });
271
- }
272
- const newNesting = nodes.nesting.has(node.type) ? nestingLevel + 1 : nestingLevel;
273
- for (const child of node.children ?? []) {
274
- if (child)
275
- visit(child, newNesting);
276
- }
277
- };
278
- visit(root, 0);
279
- return functions;
280
- }
281
- function countTryCatch(root, nodes) {
282
- if (!nodes.tryNode)
283
- return 0;
284
- let count = 0;
285
- walk(root, (n) => {
286
- if (n.type === nodes.tryNode)
287
- count++;
288
- });
289
- return count;
290
- }
291
- function countLines(content, root) {
292
- const lines = content.split(/\r?\n/);
293
- const commentLineSet = /* @__PURE__ */ new Set();
294
- walk(root, (n) => {
295
- if (COMMENT_TYPES.has(n.type)) {
296
- for (let l = n.startPosition.row; l <= n.endPosition.row; l++) {
297
- commentLineSet.add(l);
298
- }
299
- }
300
- });
301
- const codeLines = lines.filter((line, i) => {
302
- if (line.trim().length === 0)
303
- return false;
304
- if (!commentLineSet.has(i))
305
- return true;
306
- const stripped = line.replace(/\/\/.*$/, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/#.*$/, "").trim();
307
- return stripped.length > 0;
308
- }).length;
309
- return { codeLines, commentLines: commentLineSet.size };
310
- }
311
- var AI_COMMENT_PATTERNS = [
312
- /(?:🔍|✅|📝|🔧|🐛|⚠️|🚀|💡|🎯|📌|🏷️|🔑|🏗️|🧪|🗑️|🔄|♻️|📋|🔖|📊|💬|🔥|💎|⭐|🌟|🎨|🛠️)/u,
313
- /(?:\/\/|#)\s*(Initialize|Setup|Clean up|Create|Define|Check if|Handle|Process|Validate|Return|Get|Set|Add|Remove|Update|Fetch)\b/i,
314
- /(?:\/\/|#)\s*(This function|This method|This code|Here we|Now we)\b/i,
315
- /\/\*\*?\s*(Overview|Summary|Description|Example|Usage)\s*\*?\//i
316
- ];
317
- function countAICommentPatterns(sourceText) {
318
- let count = 0;
319
- for (const line of sourceText.split(/\r?\n/)) {
320
- const trimmed = line.trim();
321
- if (trimmed.startsWith("//") || trimmed.startsWith("/*") || trimmed.startsWith("*") || trimmed.startsWith("#")) {
322
- for (const pattern of AI_COMMENT_PATTERNS) {
323
- if (pattern.test(line)) {
324
- count++;
325
- break;
326
- }
327
- }
328
- }
329
- }
330
- return count;
331
- }
332
- function calculateCodeEntropy(sourceText) {
333
- 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);
334
- if (tokens.length === 0)
335
- return 0;
336
- const freq = /* @__PURE__ */ new Map();
337
- for (const token of tokens)
338
- freq.set(token, (freq.get(token) || 0) + 1);
339
- let entropy = 0;
340
- for (const count of freq.values()) {
341
- const p = count / tokens.length;
342
- if (p > 0)
343
- entropy -= p * Math.log2(p);
344
- }
345
- return entropy;
346
- }
347
- function calculateMaintainabilityIndex(cyclomatic, loc, comments) {
348
- if (loc === 0)
349
- return 100;
350
- const lnLOC = Math.log(loc);
351
- let mi = (171 - 0.23 * cyclomatic - 16.2 * lnLOC) * 100 / 171;
352
- const commentBonus = Math.min(10, comments / loc * 50);
353
- mi += commentBonus;
354
- return Math.max(0, Math.min(100, mi));
355
- }
356
- function calculateMaxParams(functions) {
357
- return Math.min(10, Math.max(2, Math.round(functions.reduce((a, f) => a + f.length, 0) / Math.max(1, functions.length) / 5)));
358
- }
359
- function countSingleUseFunctions(functions) {
360
- 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;
361
- }
362
- var ComplexityClient = class {
363
- log;
364
- constructor(verbose = false) {
365
- this.log = verbose ? createSubsystemLogger("complexity") : () => {
366
- };
367
- }
368
- /** True if the file's grammar has a complexity node mapping.
369
- *
370
- * Delegates to the module-free predicate in `tree-sitter-shared.ts`: the
371
- * same question is asked by `handleToolCallImpl` BEFORE the analyzer
372
- * bootstrap is loaded (#2467), and two copies of it would be two answers. */
373
- isSupportedFile(filePath) {
374
- return isComplexitySupportedFile(filePath);
375
- }
376
- /** Analyze complexity metrics for a file (null if unsupported / unparseable). */
377
- async analyzeFile(filePath) {
378
- const absolutePath = path.resolve(filePath);
379
- const languageId = resolveTreeSitterLanguage(absolutePath);
380
- const nodes = languageId && isComplexityLanguageId(languageId) ? LANGUAGE_NODES[languageId] : void 0;
381
- if (!nodes)
382
- return null;
383
- let content;
384
- try {
385
- if (!fs.existsSync(absolutePath))
386
- return null;
387
- content = fs.readFileSync(absolutePath, "utf-8");
388
- } catch (err) {
389
- this.log(`Read error for ${filePath}: ${err.message}`);
390
- return null;
391
- }
392
- try {
393
- const parsed = await withTreeSitterRoot(absolutePath, content, (root) => this.computeMetrics(absolutePath, content, root, nodes), "complexity");
394
- return parsed.parsed ? parsed.value : null;
395
- } catch (err) {
396
- this.log(`Analysis error for ${filePath}: ${err.message}`);
397
- return null;
398
- }
399
- }
400
- computeMetrics(absolutePath, content, root, nodes) {
401
- const { codeLines, commentLines } = countLines(content, root);
402
- const functions = collectFunctionMetrics(root, nodes);
403
- const maxNestingDepth = subtreeMaxNesting(root, 0, nodes);
404
- const cognitive = subtreeCognitive(root, 0, nodes);
405
- const funcStats = this.aggregateFunctionStats(functions);
406
- return {
407
- filePath: path.relative(process.cwd(), absolutePath),
408
- maxNestingDepth,
409
- avgFunctionLength: funcStats.avgLength,
410
- maxFunctionLength: funcStats.maxLength,
411
- functionCount: functions.length,
412
- cyclomaticComplexity: funcStats.avgCyclomatic,
413
- maxCyclomaticComplexity: funcStats.maxCyclomatic,
414
- cognitiveComplexity: cognitive,
415
- maintainabilityIndex: Math.round(calculateMaintainabilityIndex(funcStats.avgCyclomatic, codeLines, commentLines) * 10) / 10,
416
- linesOfCode: codeLines,
417
- commentLines,
418
- codeEntropy: Math.round(calculateCodeEntropy(content) * 100) / 100,
419
- maxParamsInFunction: calculateMaxParams(functions),
420
- aiCommentPatterns: countAICommentPatterns(content),
421
- singleUseFunctions: countSingleUseFunctions(functions),
422
- tryCatchCount: countTryCatch(root, nodes),
423
- functions
424
- };
425
- }
426
- aggregateFunctionStats(functions) {
427
- if (functions.length === 0) {
428
- return { avgLength: 0, maxLength: 0, avgCyclomatic: 1, maxCyclomatic: 1 };
429
- }
430
- const lengths = functions.map((f) => f.length);
431
- const cyclomatics = functions.map((f) => f.cyclomatic);
432
- const sum = (arr) => arr.reduce((a, b) => a + b, 0);
433
- return {
434
- avgLength: Math.round(sum(lengths) / lengths.length),
435
- maxLength: Math.max(...lengths),
436
- avgCyclomatic: Math.max(1, Math.round(sum(cyclomatics) / cyclomatics.length)),
437
- maxCyclomatic: Math.max(1, Math.max(...cyclomatics))
438
- };
439
- }
440
- };
441
- export {
442
- ComplexityClient
443
- };
@@ -1,74 +0,0 @@
1
- import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
- import {
3
- adaptLspService,
4
- getLSPService,
5
- groupFilesByPrimaryServer,
6
- hasAuxiliaryLspPublishedForRoot,
7
- notifyExternalFileChange,
8
- peekLSPService,
9
- resetLSPService,
10
- resyncGitChangedFiles,
11
- runPerServerGroups
12
- } from "./chunk-2BKUFQKR.js";
13
- import "./chunk-GIRBSBGL.js";
14
- import "./chunk-XIMYZ3JA.js";
15
- import "./chunk-XYLC35E4.js";
16
- import "./chunk-DYRZGUMA.js";
17
- import "./chunk-FHEV6T4L.js";
18
- import "./chunk-ZZDIOAAJ.js";
19
- import "./chunk-VOXTCULR.js";
20
- import "./chunk-35WKJWO5.js";
21
- import "./chunk-CUDD35TW.js";
22
- import "./chunk-7ANZ7XDD.js";
23
- import "./chunk-WC6WRNQT.js";
24
- import "./chunk-BHWW6FAX.js";
25
- import "./chunk-Z54ZSOBZ.js";
26
- import "./chunk-HHR7WGCI.js";
27
- import "./chunk-HKIL6DCL.js";
28
- import "./chunk-PPKECBPP.js";
29
- import "./chunk-6HWVI6MI.js";
30
- import "./chunk-5RNB4HVK.js";
31
- import "./chunk-CKEQFGLT.js";
32
- import "./chunk-JYLOYTZD.js";
33
- import "./chunk-HUAM7QG3.js";
34
- import "./chunk-HXFUTMX2.js";
35
- import "./chunk-CZL44WFN.js";
36
- import "./chunk-VPLBLWFO.js";
37
- import "./chunk-2BEMIWEW.js";
38
- import "./chunk-IJYGIDF4.js";
39
- import "./chunk-BQG2QFVO.js";
40
- import "./chunk-IYVYZQRL.js";
41
- import "./chunk-VOP4PJKA.js";
42
- import "./chunk-JBP7KESM.js";
43
- import "./chunk-UYXV5NIS.js";
44
- import "./chunk-JZRP4DGP.js";
45
- import "./chunk-SDFKOLSF.js";
46
- import "./chunk-BBET6HD6.js";
47
- import "./chunk-G6JKM4O7.js";
48
- import "./chunk-O2ARHQKF.js";
49
- import "./chunk-WMDUT4KH.js";
50
- import "./chunk-AWQWXSW4.js";
51
- import "./chunk-QYF5S6P6.js";
52
- import "./chunk-G5GV2Q7K.js";
53
- import "./chunk-X35S7HSB.js";
54
- import "./chunk-SQC7K3SP.js";
55
- import "./chunk-JE6HKLC7.js";
56
- import "./chunk-2453RRJ2.js";
57
- import "./chunk-WQV6BI4Q.js";
58
- import "./chunk-S26LC76R.js";
59
- import "./chunk-565VRUP4.js";
60
- import "./chunk-VLQ7UKZH.js";
61
- import "./chunk-LJDODBBZ.js";
62
- import "./chunk-GMROJJRN.js";
63
- import "./chunk-NXL4FFQQ.js";
64
- export {
65
- adaptLspService,
66
- getLSPService,
67
- groupFilesByPrimaryServer,
68
- hasAuxiliaryLspPublishedForRoot,
69
- notifyExternalFileChange,
70
- peekLSPService,
71
- resetLSPService,
72
- resyncGitChangedFiles,
73
- runPerServerGroups
74
- };
@@ -1,30 +0,0 @@
1
- import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
- import {
3
- importFactProvider,
4
- importFactsApplyTo
5
- } from "./chunk-FRLAUP2B.js";
6
- import "./chunk-7TNILKGY.js";
7
- import "./chunk-BHWW6FAX.js";
8
- import "./chunk-Z54ZSOBZ.js";
9
- import "./chunk-HHR7WGCI.js";
10
- import "./chunk-HKIL6DCL.js";
11
- import "./chunk-PPKECBPP.js";
12
- import "./chunk-JYLOYTZD.js";
13
- import "./chunk-JZRP4DGP.js";
14
- import "./chunk-WMDUT4KH.js";
15
- import "./chunk-G5GV2Q7K.js";
16
- import "./chunk-X35S7HSB.js";
17
- import "./chunk-SQC7K3SP.js";
18
- import "./chunk-JE6HKLC7.js";
19
- import "./chunk-2453RRJ2.js";
20
- import "./chunk-WQV6BI4Q.js";
21
- import "./chunk-S26LC76R.js";
22
- import "./chunk-565VRUP4.js";
23
- import "./chunk-VLQ7UKZH.js";
24
- import "./chunk-LJDODBBZ.js";
25
- import "./chunk-GMROJJRN.js";
26
- import "./chunk-NXL4FFQQ.js";
27
- export {
28
- importFactProvider,
29
- importFactsApplyTo
30
- };