@aiready/context-analyzer 0.22.8 → 0.22.11

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 (304) hide show
  1. package/.turbo/turbo-build.log +33 -32
  2. package/.turbo/turbo-format-check.log +2 -2
  3. package/.turbo/turbo-lint.log +9 -1
  4. package/.turbo/turbo-test.log +23 -23
  5. package/.turbo/turbo-type-check.log +1 -1
  6. package/dist/chunk-HD4Y3GYL.mjs +124 -0
  7. package/dist/{chunk-M2EGQ36M.mjs → chunk-ISWPFG2C.mjs} +43 -98
  8. package/dist/{chunk-BQCISA2F.mjs → chunk-QW6ULRML.mjs} +32 -6
  9. package/dist/{chunk-WHB7QI7N.mjs → chunk-T733LS62.mjs} +23 -4
  10. package/dist/{cli-action-CXIHOVAC.mjs → cli-action-FV4G4OB6.mjs} +3 -3
  11. package/dist/{cli-action-3CWN7PBE.mjs → cli-action-HYSWE7F4.mjs} +3 -3
  12. package/dist/{cli-action-MLFCIW2O.mjs → cli-action-VIQZSWSP.mjs} +3 -3
  13. package/dist/{cli-action-E7UGP4KE.mjs → cli-action-W7TESWAV.mjs} +6 -8
  14. package/dist/cli.js +236 -191
  15. package/dist/cli.mjs +1 -1
  16. package/dist/console-report-AP4JYNQY.mjs +74 -0
  17. package/dist/html-report-ULELSIYG.mjs +73 -0
  18. package/dist/index.d.mts +69 -337
  19. package/dist/index.d.ts +69 -337
  20. package/dist/index.js +90 -452
  21. package/dist/index.mjs +9 -157
  22. package/dist/interactive-setup-JGFBFI3M.mjs +75 -0
  23. package/dist/{orchestrator-3ERQS3NW.mjs → orchestrator-QNE2E4TE.mjs} +2 -2
  24. package/dist/summary-GQRWW3A2.mjs +7 -0
  25. package/dist/summary-JTBS7CPM.mjs +7 -0
  26. package/dist/summary-TZFB6ZFM.mjs +7 -0
  27. package/package.json +2 -2
  28. package/src/__tests__/file-classification.fixtures.ts +57 -0
  29. package/src/__tests__/file-classification.test.ts +24 -929
  30. package/src/__tests__/provider.test.ts +6 -72
  31. package/src/classifier.ts +42 -42
  32. package/src/cli-action.ts +11 -6
  33. package/src/index.ts +30 -27
  34. package/src/provider.ts +1 -1
  35. package/src/summary.ts +65 -10
  36. package/dist/__tests__/analyzer.test.d.ts +0 -2
  37. package/dist/__tests__/analyzer.test.d.ts.map +0 -1
  38. package/dist/__tests__/analyzer.test.js +0 -198
  39. package/dist/__tests__/analyzer.test.js.map +0 -1
  40. package/dist/__tests__/auto-detection.test.d.ts +0 -2
  41. package/dist/__tests__/auto-detection.test.d.ts.map +0 -1
  42. package/dist/__tests__/auto-detection.test.js +0 -132
  43. package/dist/__tests__/auto-detection.test.js.map +0 -1
  44. package/dist/__tests__/cluster-detector.test.d.ts +0 -2
  45. package/dist/__tests__/cluster-detector.test.d.ts.map +0 -1
  46. package/dist/__tests__/cluster-detector.test.js +0 -121
  47. package/dist/__tests__/cluster-detector.test.js.map +0 -1
  48. package/dist/__tests__/contract.test.d.ts +0 -2
  49. package/dist/__tests__/contract.test.d.ts.map +0 -1
  50. package/dist/__tests__/contract.test.js +0 -59
  51. package/dist/__tests__/contract.test.js.map +0 -1
  52. package/dist/__tests__/enhanced-cohesion.test.d.ts +0 -2
  53. package/dist/__tests__/enhanced-cohesion.test.d.ts.map +0 -1
  54. package/dist/__tests__/enhanced-cohesion.test.js +0 -119
  55. package/dist/__tests__/enhanced-cohesion.test.js.map +0 -1
  56. package/dist/__tests__/file-classification.test.d.ts +0 -2
  57. package/dist/__tests__/file-classification.test.d.ts.map +0 -1
  58. package/dist/__tests__/file-classification.test.js +0 -749
  59. package/dist/__tests__/file-classification.test.js.map +0 -1
  60. package/dist/__tests__/fragmentation-advanced.test.d.ts +0 -2
  61. package/dist/__tests__/fragmentation-advanced.test.d.ts.map +0 -1
  62. package/dist/__tests__/fragmentation-advanced.test.js +0 -44
  63. package/dist/__tests__/fragmentation-advanced.test.js.map +0 -1
  64. package/dist/__tests__/fragmentation-coupling.test.d.ts +0 -2
  65. package/dist/__tests__/fragmentation-coupling.test.d.ts.map +0 -1
  66. package/dist/__tests__/fragmentation-coupling.test.js +0 -52
  67. package/dist/__tests__/fragmentation-coupling.test.js.map +0 -1
  68. package/dist/__tests__/fragmentation-log.test.d.ts +0 -2
  69. package/dist/__tests__/fragmentation-log.test.d.ts.map +0 -1
  70. package/dist/__tests__/fragmentation-log.test.js +0 -29
  71. package/dist/__tests__/fragmentation-log.test.js.map +0 -1
  72. package/dist/__tests__/provider.test.d.ts +0 -2
  73. package/dist/__tests__/provider.test.d.ts.map +0 -1
  74. package/dist/__tests__/provider.test.js +0 -72
  75. package/dist/__tests__/provider.test.js.map +0 -1
  76. package/dist/__tests__/remediation.test.d.ts +0 -2
  77. package/dist/__tests__/remediation.test.d.ts.map +0 -1
  78. package/dist/__tests__/remediation.test.js +0 -61
  79. package/dist/__tests__/remediation.test.js.map +0 -1
  80. package/dist/__tests__/scoring.test.d.ts +0 -2
  81. package/dist/__tests__/scoring.test.d.ts.map +0 -1
  82. package/dist/__tests__/scoring.test.js +0 -298
  83. package/dist/__tests__/scoring.test.js.map +0 -1
  84. package/dist/__tests__/structural-cohesion.test.d.ts +0 -2
  85. package/dist/__tests__/structural-cohesion.test.d.ts.map +0 -1
  86. package/dist/__tests__/structural-cohesion.test.js +0 -35
  87. package/dist/__tests__/structural-cohesion.test.js.map +0 -1
  88. package/dist/analyzer.d.ts +0 -37
  89. package/dist/analyzer.d.ts.map +0 -1
  90. package/dist/analyzer.js +0 -283
  91. package/dist/analyzer.js.map +0 -1
  92. package/dist/analyzers/python-context.d.ts +0 -38
  93. package/dist/analyzers/python-context.d.ts.map +0 -1
  94. package/dist/analyzers/python-context.js +0 -234
  95. package/dist/analyzers/python-context.js.map +0 -1
  96. package/dist/ast-utils.d.ts +0 -16
  97. package/dist/ast-utils.d.ts.map +0 -1
  98. package/dist/ast-utils.js +0 -81
  99. package/dist/ast-utils.js.map +0 -1
  100. package/dist/chunk-22ZO4EKZ.mjs +0 -1297
  101. package/dist/chunk-2HE27YEV.mjs +0 -1739
  102. package/dist/chunk-45P4RDYP.mjs +0 -607
  103. package/dist/chunk-474DEGWW.mjs +0 -1792
  104. package/dist/chunk-4SYIJ7CU.mjs +0 -1538
  105. package/dist/chunk-4U4LDWGF.mjs +0 -360
  106. package/dist/chunk-4XQVYYPC.mjs +0 -1470
  107. package/dist/chunk-5CLU3HYU.mjs +0 -1475
  108. package/dist/chunk-5K73Q3OQ.mjs +0 -1520
  109. package/dist/chunk-5N5DCJOV.mjs +0 -583
  110. package/dist/chunk-6AVS4KTM.mjs +0 -1536
  111. package/dist/chunk-6FQYIG6I.mjs +0 -1298
  112. package/dist/chunk-6I4552YB.mjs +0 -1467
  113. package/dist/chunk-6LPITDKG.mjs +0 -1539
  114. package/dist/chunk-72QC5QUS.mjs +0 -549
  115. package/dist/chunk-736QSHJP.mjs +0 -1807
  116. package/dist/chunk-7LUSCLGR.mjs +0 -2058
  117. package/dist/chunk-7VK3XTSH.mjs +0 -1756
  118. package/dist/chunk-7ZEJGWLN.mjs +0 -1363
  119. package/dist/chunk-AECWO7NQ.mjs +0 -1539
  120. package/dist/chunk-AEK3MZC5.mjs +0 -709
  121. package/dist/chunk-AJC3FR6G.mjs +0 -1509
  122. package/dist/chunk-AMPK6SWS.mjs +0 -1754
  123. package/dist/chunk-BA7QGUHN.mjs +0 -1722
  124. package/dist/chunk-BCEZGRXI.mjs +0 -1297
  125. package/dist/chunk-BD4NWUVG.mjs +0 -1242
  126. package/dist/chunk-BEZPBI5C.mjs +0 -1829
  127. package/dist/chunk-BHCRDEE4.mjs +0 -1745
  128. package/dist/chunk-BW463GQB.mjs +0 -1767
  129. package/dist/chunk-CAX2MOUZ.mjs +0 -1801
  130. package/dist/chunk-CBWM3EK5.mjs +0 -1854
  131. package/dist/chunk-CCBNKQYB.mjs +0 -1812
  132. package/dist/chunk-CDIVYADN.mjs +0 -2110
  133. package/dist/chunk-CVGIDSMN.mjs +0 -1522
  134. package/dist/chunk-D25B5LZR.mjs +0 -1739
  135. package/dist/chunk-D3SIHB2V.mjs +0 -2118
  136. package/dist/chunk-DD7UVNE3.mjs +0 -678
  137. package/dist/chunk-DMRZMS2U.mjs +0 -964
  138. package/dist/chunk-DXG5NIYL.mjs +0 -1527
  139. package/dist/chunk-EBXG2Q5Y.mjs +0 -2059
  140. package/dist/chunk-EH3PMNZQ.mjs +0 -569
  141. package/dist/chunk-EMYD7NS6.mjs +0 -137
  142. package/dist/chunk-EVX2W2BK.mjs +0 -1896
  143. package/dist/chunk-EWFR366Y.mjs +0 -1740
  144. package/dist/chunk-EX7HCWAO.mjs +0 -625
  145. package/dist/chunk-FNPSK3CG.mjs +0 -1760
  146. package/dist/chunk-FO6YT6RG.mjs +0 -1751
  147. package/dist/chunk-FYI56A5M.mjs +0 -1892
  148. package/dist/chunk-G3CCJCBI.mjs +0 -1521
  149. package/dist/chunk-G7PO3DNK.mjs +0 -1072
  150. package/dist/chunk-GFADGYXZ.mjs +0 -1752
  151. package/dist/chunk-GTRIBVS6.mjs +0 -1467
  152. package/dist/chunk-GXTGOLZT.mjs +0 -92
  153. package/dist/chunk-H4HWBQU6.mjs +0 -1530
  154. package/dist/chunk-HDFXSEFW.mjs +0 -605
  155. package/dist/chunk-HOUDVRG2.mjs +0 -1422
  156. package/dist/chunk-HQNHM2X7.mjs +0 -997
  157. package/dist/chunk-I54HL4FZ.mjs +0 -781
  158. package/dist/chunk-I77HFFZU.mjs +0 -1876
  159. package/dist/chunk-IKRP7ECY.mjs +0 -1754
  160. package/dist/chunk-ILMLGJGI.mjs +0 -1295
  161. package/dist/chunk-IPIE5TXJ.mjs +0 -1741
  162. package/dist/chunk-IRWCPDWD.mjs +0 -779
  163. package/dist/chunk-J3MUOWHC.mjs +0 -1747
  164. package/dist/chunk-J5TA3AZU.mjs +0 -1795
  165. package/dist/chunk-JH535NPP.mjs +0 -1619
  166. package/dist/chunk-JUHHOSHG.mjs +0 -1808
  167. package/dist/chunk-JZ2SE4DB.mjs +0 -1116
  168. package/dist/chunk-K2WFOBAZ.mjs +0 -1821
  169. package/dist/chunk-K6U64EL3.mjs +0 -517
  170. package/dist/chunk-KDUUZQBK.mjs +0 -1692
  171. package/dist/chunk-KGFWKSGJ.mjs +0 -1442
  172. package/dist/chunk-KGVMS4R5.mjs +0 -1750
  173. package/dist/chunk-KWIS5FQP.mjs +0 -1739
  174. package/dist/chunk-KYSZF5N6.mjs +0 -1876
  175. package/dist/chunk-LERPI33Y.mjs +0 -2060
  176. package/dist/chunk-M64RHH4D.mjs +0 -1896
  177. package/dist/chunk-MBE4AQP5.mjs +0 -1362
  178. package/dist/chunk-MR7WXHIE.mjs +0 -1833
  179. package/dist/chunk-MZP3G7TF.mjs +0 -2118
  180. package/dist/chunk-N2GQWNFG.mjs +0 -1527
  181. package/dist/chunk-N6XBOOVA.mjs +0 -564
  182. package/dist/chunk-NJUW6VED.mjs +0 -610
  183. package/dist/chunk-NOHK5DLU.mjs +0 -2173
  184. package/dist/chunk-NQA3F2HJ.mjs +0 -1532
  185. package/dist/chunk-NXXQ2U73.mjs +0 -1467
  186. package/dist/chunk-OP4G6GLN.mjs +0 -1876
  187. package/dist/chunk-ORLC5Y4J.mjs +0 -1787
  188. package/dist/chunk-OTCQL7DY.mjs +0 -2045
  189. package/dist/chunk-OUYSZZ7X.mjs +0 -1846
  190. package/dist/chunk-OZE3FVZT.mjs +0 -1089
  191. package/dist/chunk-P3T3H27S.mjs +0 -1895
  192. package/dist/chunk-P5YV5WIX.mjs +0 -1803
  193. package/dist/chunk-P74BO725.mjs +0 -1296
  194. package/dist/chunk-PDN74MG3.mjs +0 -1834
  195. package/dist/chunk-PJD4VCIH.mjs +0 -1722
  196. package/dist/chunk-PVVCCE6W.mjs +0 -755
  197. package/dist/chunk-PVVMK56C.mjs +0 -1793
  198. package/dist/chunk-Q2GDZ2FZ.mjs +0 -1794
  199. package/dist/chunk-QDGPR3L6.mjs +0 -1518
  200. package/dist/chunk-RQCIJO5Z.mjs +0 -1116
  201. package/dist/chunk-RRB2C34Q.mjs +0 -1738
  202. package/dist/chunk-RYIB5CWD.mjs +0 -781
  203. package/dist/chunk-S6OPP4L5.mjs +0 -1791
  204. package/dist/chunk-SAVOSPM3.mjs +0 -1522
  205. package/dist/chunk-SFK6XTJE.mjs +0 -2110
  206. package/dist/chunk-SIX4KMF2.mjs +0 -1468
  207. package/dist/chunk-SPAM2YJE.mjs +0 -1537
  208. package/dist/chunk-T6ZCOPPI.mjs +0 -538
  209. package/dist/chunk-TPF75CNP.mjs +0 -581
  210. package/dist/chunk-TWWPY7FD.mjs +0 -1754
  211. package/dist/chunk-U5R2FTCR.mjs +0 -1803
  212. package/dist/chunk-UG7OPVHB.mjs +0 -1521
  213. package/dist/chunk-UMZTAWDA.mjs +0 -1812
  214. package/dist/chunk-UU4HZ7ZT.mjs +0 -1849
  215. package/dist/chunk-UXC6QUZ7.mjs +0 -1801
  216. package/dist/chunk-VBWXHKGD.mjs +0 -1895
  217. package/dist/chunk-VIJTZPBI.mjs +0 -1470
  218. package/dist/chunk-VLV6MXPL.mjs +0 -1750
  219. package/dist/chunk-VTALAPQZ.mjs +0 -1241
  220. package/dist/chunk-W2KNBN6W.mjs +0 -1849
  221. package/dist/chunk-W37E7MW5.mjs +0 -1403
  222. package/dist/chunk-W76FEISE.mjs +0 -1538
  223. package/dist/chunk-WCFQYXQA.mjs +0 -1532
  224. package/dist/chunk-WKOZOHOU.mjs +0 -2060
  225. package/dist/chunk-WTQJNY4U.mjs +0 -1785
  226. package/dist/chunk-XBFM2Z4O.mjs +0 -1792
  227. package/dist/chunk-XIXAWCMS.mjs +0 -1760
  228. package/dist/chunk-XTAXUNQN.mjs +0 -1742
  229. package/dist/chunk-XY77XABG.mjs +0 -1545
  230. package/dist/chunk-XZ645X5U.mjs +0 -1425
  231. package/dist/chunk-Y6FXYEAI.mjs +0 -10
  232. package/dist/chunk-YCGDIGOG.mjs +0 -1467
  233. package/dist/chunk-YYB6NZE3.mjs +0 -1869
  234. package/dist/chunk-Z5WY6A4P.mjs +0 -1754
  235. package/dist/chunk-ZAMFWKIB.mjs +0 -1842
  236. package/dist/classifier.d.ts +0 -114
  237. package/dist/classifier.d.ts.map +0 -1
  238. package/dist/classifier.js +0 -439
  239. package/dist/classifier.js.map +0 -1
  240. package/dist/cli-action-SA7SCYNV.mjs +0 -95
  241. package/dist/cli-action-VCXBZGZP.mjs +0 -95
  242. package/dist/cli-action-YAJOJCXJ.mjs +0 -95
  243. package/dist/cli.d.ts.map +0 -1
  244. package/dist/cli.js.map +0 -1
  245. package/dist/cluster-detector.d.ts +0 -8
  246. package/dist/cluster-detector.d.ts.map +0 -1
  247. package/dist/cluster-detector.js +0 -70
  248. package/dist/cluster-detector.js.map +0 -1
  249. package/dist/defaults.d.ts +0 -7
  250. package/dist/defaults.d.ts.map +0 -1
  251. package/dist/defaults.js +0 -54
  252. package/dist/defaults.js.map +0 -1
  253. package/dist/graph-builder.d.ts +0 -33
  254. package/dist/graph-builder.d.ts.map +0 -1
  255. package/dist/graph-builder.js +0 -225
  256. package/dist/graph-builder.js.map +0 -1
  257. package/dist/index.d.ts.map +0 -1
  258. package/dist/index.js.map +0 -1
  259. package/dist/metrics.d.ts +0 -34
  260. package/dist/metrics.d.ts.map +0 -1
  261. package/dist/metrics.js +0 -170
  262. package/dist/metrics.js.map +0 -1
  263. package/dist/orchestrator-3L3NAZYP.mjs +0 -10
  264. package/dist/orchestrator-5AL3XBPZ.mjs +0 -10
  265. package/dist/orchestrator-KMAKMHTD.mjs +0 -10
  266. package/dist/orchestrator-MONOZHVW.mjs +0 -10
  267. package/dist/orchestrator-R6MZT4Z2.mjs +0 -10
  268. package/dist/orchestrator-ZR7JSKWI.mjs +0 -10
  269. package/dist/provider.d.ts +0 -6
  270. package/dist/provider.d.ts.map +0 -1
  271. package/dist/provider.js +0 -48
  272. package/dist/provider.js.map +0 -1
  273. package/dist/python-context-3GZKN3LR.mjs +0 -162
  274. package/dist/python-context-GOH747QU.mjs +0 -202
  275. package/dist/python-context-O2EN3M6Z.mjs +0 -162
  276. package/dist/python-context-PAETRLDY.mjs +0 -185
  277. package/dist/python-context-TBI5FVFY.mjs +0 -203
  278. package/dist/python-context-UOPTQH44.mjs +0 -192
  279. package/dist/remediation.d.ts +0 -25
  280. package/dist/remediation.d.ts.map +0 -1
  281. package/dist/remediation.js +0 -98
  282. package/dist/remediation.js.map +0 -1
  283. package/dist/scoring.d.ts +0 -9
  284. package/dist/scoring.d.ts.map +0 -1
  285. package/dist/scoring.js +0 -142
  286. package/dist/scoring.js.map +0 -1
  287. package/dist/semantic-analysis.d.ts +0 -33
  288. package/dist/semantic-analysis.d.ts.map +0 -1
  289. package/dist/semantic-analysis.js +0 -303
  290. package/dist/semantic-analysis.js.map +0 -1
  291. package/dist/summary-7PZVW72O.mjs +0 -7
  292. package/dist/summary-LKUCJAIS.mjs +0 -7
  293. package/dist/summary.d.ts +0 -6
  294. package/dist/summary.d.ts.map +0 -1
  295. package/dist/summary.js +0 -92
  296. package/dist/summary.js.map +0 -1
  297. package/dist/types.d.ts +0 -124
  298. package/dist/types.d.ts.map +0 -1
  299. package/dist/types.js +0 -2
  300. package/dist/types.js.map +0 -1
  301. package/dist/utils/output-formatter.d.ts +0 -14
  302. package/dist/utils/output-formatter.d.ts.map +0 -1
  303. package/dist/utils/output-formatter.js +0 -338
  304. package/dist/utils/output-formatter.js.map +0 -1
@@ -1,32 +1,33 @@
1
-
2
- 
3
- > @aiready/context-analyzer@0.22.8 build /Users/pengcao/projects/aiready/packages/context-analyzer
4
- > tsup src/index.ts src/cli.ts --format cjs,esm --dts
5
-
6
- CLI Building entry: src/cli.ts, src/index.ts
7
- CLI Using tsconfig: tsconfig.json
8
- CLI tsup v8.5.1
9
- CLI Target: es2020
10
- CJS Build start
11
- ESM Build start
12
- ESM dist/index.mjs 12.69 KB
13
- ESM dist/cli.mjs 1.81 KB
14
- ESM dist/python-context-BWDC4E5Z.mjs 4.48 KB
15
- ESM dist/orchestrator-62YVSQFV.mjs 190.00 B
16
- ESM dist/cli-action-HREY7TK5.mjs 2.86 KB
17
- ESM dist/chunk-BTDF2ZA4.mjs 3.35 KB
18
- ESM dist/chunk-J3SZQZNU.mjs 8.11 KB
19
- ESM dist/chunk-64U3PNO3.mjs 2.65 KB
20
- ESM dist/summary-RSPRRY6S.mjs 119.00 B
21
- ESM dist/chunk-JSM7Q5CY.mjs 4.98 KB
22
- ESM dist/chunk-ZA7HRDAH.mjs 41.00 KB
23
- ESM ⚡️ Build success in 180ms
24
- CJS dist/index.js 83.44 KB
25
- CJS dist/cli.js 69.65 KB
26
- CJS ⚡️ Build success in 180ms
27
- DTS Build start
28
- DTS ⚡️ Build success in 2332ms
29
- DTS dist/cli.d.ts 20.00 B
30
- DTS dist/index.d.ts 25.64 KB
31
- DTS dist/cli.d.mts 20.00 B
32
- DTS dist/index.d.mts 25.64 KB
1
+
2
+ > @aiready/context-analyzer@0.22.9 build /Users/pengcao/projects/aiready/packages/context-analyzer
3
+ > tsup src/index.ts src/cli.ts --format cjs,esm --dts
4
+
5
+ CLI Building entry: src/cli.ts, src/index.ts
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v8.5.1
8
+ CLI Target: es2020
9
+ CJS Build start
10
+ ESM Build start
11
+ CJS dist/index.js 70.37 KB
12
+ CJS dist/cli.js 71.51 KB
13
+ CJS ⚡️ Build success in 84ms
14
+ ESM dist/python-context-BWDC4E5Z.mjs 4.48 KB
15
+ ESM dist/cli.mjs 1.81 KB
16
+ ESM dist/orchestrator-QNE2E4TE.mjs 190.00 B
17
+ ESM dist/chunk-ISWPFG2C.mjs 39.61 KB
18
+ ESM dist/index.mjs 9.02 KB
19
+ ESM dist/chunk-JSM7Q5CY.mjs 4.98 KB
20
+ ESM dist/interactive-setup-JGFBFI3M.mjs 2.44 KB
21
+ ESM dist/summary-TZFB6ZFM.mjs 119.00 B
22
+ ESM dist/chunk-HD4Y3GYL.mjs 4.48 KB
23
+ ESM dist/html-report-ULELSIYG.mjs 2.15 KB
24
+ ESM dist/console-report-AP4JYNQY.mjs 3.54 KB
25
+ ESM dist/cli-action-W7TESWAV.mjs 3.00 KB
26
+ ESM dist/chunk-64U3PNO3.mjs 2.65 KB
27
+ ESM ⚡️ Build success in 86ms
28
+ DTS Build start
29
+ DTS ⚡️ Build success in 3366ms
30
+ DTS dist/cli.d.ts 20.00 B
31
+ DTS dist/index.d.ts 14.57 KB
32
+ DTS dist/cli.d.mts 20.00 B
33
+ DTS dist/index.d.mts 14.57 KB
@@ -1,7 +1,7 @@
1
1
 
2
2
  
3
- > @aiready/context-analyzer@0.22.8 format-check /Users/pengcao/projects/aiready/packages/context-analyzer
3
+ > @aiready/context-analyzer@0.22.9 format-check /Users/pengcao/projects/aiready/packages/context-analyzer
4
4
  > prettier --check . --ignore-path ../../.prettierignore
5
5
 
6
6
  Checking formatting...
7
- .aireadyignoreCONTRIBUTING.mdLICENSEpackage.jsonREADME.mdsrc/__tests__/analyzer.test.tssrc/__tests__/auto-detection.test.tssrc/__tests__/boilerplate-barrel.test.tssrc/__tests__/cluster-detector.test.tssrc/__tests__/consolidation.test.tssrc/__tests__/contract.test.tssrc/__tests__/defaults.test.tssrc/__tests__/domain-inference.test.tssrc/__tests__/enhanced-cohesion.test.tssrc/__tests__/file-classification.test.tssrc/__tests__/fragmentation-advanced.test.tssrc/__tests__/fragmentation-coupling.test.tssrc/__tests__/fragmentation-log.test.tssrc/__tests__/issue-analyzer.test.tssrc/__tests__/orchestrator.test.tssrc/__tests__/provider.test.tssrc/__tests__/python-context.test.tssrc/__tests__/remediation.test.tssrc/__tests__/report/console-report.test.tssrc/__tests__/report/html-report.test.tssrc/__tests__/scoring.test.tssrc/__tests__/structural-cohesion.test.tssrc/analyzers/python-context.tssrc/ast-utils.tssrc/classifier.tssrc/classify/classification-patterns.tssrc/classify/file-classifiers.tssrc/cli-action.tssrc/cli-definition.tssrc/cli.tssrc/cluster-detector.tssrc/defaults.tssrc/graph-builder.tssrc/index.tssrc/issue-analyzer.tssrc/metrics.tssrc/orchestrator.tssrc/provider.tssrc/remediation.tssrc/report/console-report.tssrc/report/html-report.tssrc/report/interactive-setup.tssrc/scoring.tssrc/semantic/co-usage.tssrc/semantic/consolidation.tssrc/semantic/domain-inference.tssrc/semantic/type-graph.tssrc/summary.tssrc/types.tssrc/utils/dependency-graph-utils.tssrc/utils/string-utils.tstsconfig.jsontsconfig.tsbuildinfoAll matched files use Prettier code style!
7
+ .aireadyignoreCONTRIBUTING.mdLICENSEpackage.jsonREADME.mdsrc/__tests__/analyzer.test.tssrc/__tests__/auto-detection.test.tssrc/__tests__/boilerplate-barrel.test.tssrc/__tests__/cluster-detector.test.tssrc/__tests__/consolidation.test.tssrc/__tests__/contract.test.tssrc/__tests__/defaults.test.tssrc/__tests__/domain-inference.test.tssrc/__tests__/enhanced-cohesion.test.tssrc/__tests__/file-classification.fixtures.tssrc/__tests__/file-classification.test.tssrc/__tests__/fragmentation-advanced.test.tssrc/__tests__/fragmentation-coupling.test.tssrc/__tests__/fragmentation-log.test.tssrc/__tests__/issue-analyzer.test.tssrc/__tests__/orchestrator.test.tssrc/__tests__/provider.test.tssrc/__tests__/python-context.test.tssrc/__tests__/remediation.test.tssrc/__tests__/report/console-report.test.tssrc/__tests__/report/html-report.test.tssrc/__tests__/scoring.test.tssrc/__tests__/structural-cohesion.test.tssrc/analyzers/python-context.tssrc/ast-utils.tssrc/classifier.tssrc/classify/classification-patterns.tssrc/classify/file-classifiers.tssrc/cli-action.tssrc/cli-definition.tssrc/cli.tssrc/cluster-detector.tssrc/defaults.tssrc/graph-builder.tssrc/index.tssrc/issue-analyzer.tssrc/metrics.tssrc/orchestrator.tssrc/provider.tssrc/remediation.tssrc/report/console-report.tssrc/report/html-report.tssrc/report/interactive-setup.tssrc/scoring.tssrc/semantic/co-usage.tssrc/semantic/consolidation.tssrc/semantic/domain-inference.tssrc/semantic/type-graph.tssrc/summary.tssrc/types.tssrc/utils/dependency-graph-utils.tssrc/utils/string-utils.tstsconfig.jsontsconfig.tsbuildinfoAll matched files use Prettier code style!
@@ -1,5 +1,13 @@
1
1
 
2
2
  
3
- > @aiready/context-analyzer@0.22.8 lint /Users/pengcao/projects/aiready/packages/context-analyzer
3
+ > @aiready/context-analyzer@0.22.9 lint /Users/pengcao/projects/aiready/packages/context-analyzer
4
4
  > eslint src
5
5
 
6
+ 
7
+ /Users/pengcao/projects/aiready/packages/context-analyzer/src/__tests__/file-classification.test.ts
8
+ 4:3 warning 'adjustFragmentationForClassification' is defined but never used. Allowed unused vars must match /^_/u @typescript-eslint/no-unused-vars
9
+ 5:3 warning 'adjustCohesionForClassification' is defined but never used. Allowed unused vars must match /^_/u @typescript-eslint/no-unused-vars
10
+ 6:3 warning 'getClassificationRecommendations' is defined but never used. Allowed unused vars must match /^_/u @typescript-eslint/no-unused-vars
11
+
12
+ ✖ 3 problems (0 errors, 3 warnings)
13
+ 
@@ -1,15 +1,13 @@
1
1
 
2
2
  
3
- > @aiready/context-analyzer@0.22.7 test /Users/pengcao/projects/aiready/packages/context-analyzer
3
+ > @aiready/context-analyzer@0.22.8 test /Users/pengcao/projects/aiready/packages/context-analyzer
4
4
  > vitest run --exclude "**/dist/**"
5
5
 
6
6
  [?25l
7
7
   RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/context-analyzer
8
8
 
9
- ✓ src/__tests__/consolidation.test.ts (6 tests) 3ms
10
- ✓ src/__tests__/report/html-report.test.ts (11 tests) 32ms
11
- ✓ src/__tests__/report/console-report.test.ts (8 tests) 124ms
12
- ✓ src/__tests__/domain-inference.test.ts (26 tests) 6ms
9
+ ✓ src/__tests__/report/console-report.test.ts (8 tests) 42ms
10
+ ✓ src/__tests__/report/html-report.test.ts (11 tests) 67ms
13
11
  stderr | src/__tests__/python-context.test.ts > python-context > analyzePythonContext > should filter for Python files only
14
12
  Failed to analyze src/file2.py: TypeError: Cannot read properties of undefined (reading 'split')
15
13
  at Module.analyzePythonContext (/Users/pengcao/projects/aiready/packages/context-analyzer/src/analyzers/python-context.ts:91:32)
@@ -24,28 +22,30 @@
24
22
  at /Users/pengcao/projects/aiready/packages/context-analyzer/src/__tests__/python-context.test.ts:84:23
25
23
  at file:///Users/pengcao/projects/aiready/node_modules/.pnpm/@vitest+runner@4.0.18/node_modules/@vitest/runner/dist/index.js:915:20
26
24
 
27
- ✓ src/__tests__/python-context.test.ts (4 tests) 14ms
28
- ✓ src/__tests__/fragmentation-log.test.ts (3 tests) 1ms
29
- ✓ src/__tests__/fragmentation-coupling.test.ts (2 tests) 42ms
30
- ✓ src/__tests__/analyzer.test.ts (14 tests) 46ms
31
- ✓ src/__tests__/issue-analyzer.test.ts (17 tests) 14ms
32
- ✓ src/__tests__/auto-detection.test.ts (8 tests) 177ms
33
- ✓ src/__tests__/orchestrator.test.ts (8 tests) 226ms
34
- ✓ src/__tests__/provider.test.ts (2 tests) 10ms
35
- ✓ src/__tests__/defaults.test.ts (7 tests) 3ms
36
- ✓ src/__tests__/cluster-detector.test.ts (3 tests) 35ms
37
- ✓ src/__tests__/file-classification.test.ts (63 tests) 12ms
38
- ✓ src/__tests__/remediation.test.ts (6 tests) 2ms
25
+ ✓ src/__tests__/python-context.test.ts (4 tests) 13ms
26
+ ✓ src/__tests__/domain-inference.test.ts (26 tests) 6ms
27
+ ✓ src/__tests__/cluster-detector.test.ts (3 tests) 3ms
28
+ ✓ src/__tests__/issue-analyzer.test.ts (17 tests) 99ms
29
+ ✓ src/__tests__/orchestrator.test.ts (8 tests) 70ms
30
+ ✓ src/__tests__/auto-detection.test.ts (8 tests) 25ms
39
31
  ✓ src/__tests__/contract.test.ts (1 test) 19ms
40
- ✓ src/__tests__/scoring.test.ts (15 tests) 3ms
32
+ ✓ src/__tests__/consolidation.test.ts (6 tests) 2ms
33
+ ✓ src/__tests__/fragmentation-coupling.test.ts (2 tests) 64ms
34
+ ✓ src/__tests__/structural-cohesion.test.ts (4 tests) 3ms
35
+ ✓ src/__tests__/analyzer.test.ts (14 tests) 47ms
36
+ ✓ src/__tests__/file-classification.test.ts (63 tests) 6ms
37
+ ✓ src/__tests__/remediation.test.ts (6 tests) 3ms
38
+ ✓ src/__tests__/provider.test.ts (2 tests) 4ms
39
+ ✓ src/__tests__/fragmentation-advanced.test.ts (3 tests) 2ms
40
+ ✓ src/__tests__/scoring.test.ts (15 tests) 6ms
41
+ ✓ src/__tests__/defaults.test.ts (7 tests) 5ms
41
42
  ✓ src/__tests__/enhanced-cohesion.test.ts (6 tests) 2ms
42
- ✓ src/__tests__/structural-cohesion.test.ts (4 tests) 39ms
43
- ✓ src/__tests__/fragmentation-advanced.test.ts (3 tests) 1ms
44
- ✓ src/__tests__/boilerplate-barrel.test.ts (7 tests) 3ms
43
+ ✓ src/__tests__/fragmentation-log.test.ts (3 tests) 3ms
44
+ ✓ src/__tests__/boilerplate-barrel.test.ts (7 tests) 4ms
45
45
 
46
46
   Test Files  22 passed (22)
47
47
   Tests  224 passed (224)
48
-  Start at  00:08:32
49
-  Duration  5.11s (transform 8.77s, setup 0ms, import 35.15s, tests 815ms, environment 9ms)
48
+  Start at  00:14:06
49
+  Duration  4.74s (transform 8.07s, setup 0ms, import 29.32s, tests 494ms, environment 2ms)
50
50
 
51
51
  [?25h
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @aiready/context-analyzer@0.22.8 type-check /Users/pengcao/projects/aiready/packages/context-analyzer
3
+ > @aiready/context-analyzer@0.22.9 type-check /Users/pengcao/projects/aiready/packages/context-analyzer
4
4
  > tsc --noEmit
5
5
 
@@ -0,0 +1,124 @@
1
+ import {
2
+ calculatePathEntropy
3
+ } from "./chunk-JSM7Q5CY.mjs";
4
+
5
+ // src/summary.ts
6
+ import { GLOBAL_SCAN_OPTIONS } from "@aiready/core";
7
+ function generateSummary(results, options = {}) {
8
+ const config = options ? Object.fromEntries(
9
+ Object.entries(options).filter(
10
+ ([key]) => !GLOBAL_SCAN_OPTIONS.includes(key) || key === "rootDir"
11
+ )
12
+ ) : {};
13
+ const totalFiles = results.length;
14
+ const totalTokens = results.reduce((sum, r) => sum + r.tokenCost, 0);
15
+ const avgContextBudget = totalFiles > 0 ? results.reduce((sum, r) => sum + r.contextBudget, 0) / totalFiles : 0;
16
+ const deepFiles = results.filter((r) => r.importDepth > 5).map((r) => ({ file: r.file, depth: r.importDepth }));
17
+ const maxImportDepth = Math.max(0, ...results.map((r) => r.importDepth));
18
+ const moduleMap = /* @__PURE__ */ new Map();
19
+ const rootDir = config.rootDir || "";
20
+ results.forEach((r) => {
21
+ let relativePath = r.file;
22
+ if (rootDir && r.file.startsWith(rootDir)) {
23
+ relativePath = r.file.slice(rootDir.length);
24
+ if (relativePath.startsWith("/")) relativePath = relativePath.slice(1);
25
+ }
26
+ const parts = relativePath.split("/");
27
+ let domain = "root";
28
+ const domainIndicators = ["packages", "apps", "src", "lib", "modules"];
29
+ for (let i = 0; i < parts.length - 1; i++) {
30
+ if (domainIndicators.includes(parts[i]) && parts[i + 1]) {
31
+ domain = `${parts[i]}/${parts[i + 1]}`;
32
+ break;
33
+ }
34
+ }
35
+ if (domain === "root" && parts.length > 1) {
36
+ const skipPrefixes = [
37
+ "src",
38
+ "lib",
39
+ "dist",
40
+ "build",
41
+ "out",
42
+ "node_modules"
43
+ ];
44
+ for (let i = 0; i < parts.length - 1; i++) {
45
+ if (!skipPrefixes.includes(parts[i]) && parts[i] !== "") {
46
+ domain = parts[i];
47
+ break;
48
+ }
49
+ }
50
+ }
51
+ if (!moduleMap.has(domain)) moduleMap.set(domain, []);
52
+ moduleMap.get(domain).push(r);
53
+ });
54
+ const fragmentedModules = [];
55
+ moduleMap.forEach((files, domain) => {
56
+ const clusterTokens = files.reduce((sum, f) => sum + f.tokenCost, 0);
57
+ const filePaths = files.map((f) => f.file);
58
+ const avgEntropy = calculatePathEntropy(filePaths);
59
+ const avgCohesion2 = files.reduce((sum, f) => sum + f.cohesionScore, 0) / files.length;
60
+ const cohesionFactor = avgCohesion2 < 0.5 ? (0.5 - avgCohesion2) * 2 : 0;
61
+ const entropyFactor = avgEntropy > 0.7 ? (avgEntropy - 0.7) * 3.33 : 0;
62
+ const sizeFactor = files.length > 20 ? Math.min(1, (files.length - 20) / 80) : 0;
63
+ const fragmentationScore = Math.min(
64
+ 1,
65
+ cohesionFactor * 0.5 + entropyFactor * 0.3 + sizeFactor * 0.2
66
+ );
67
+ if (fragmentationScore > 0.4) {
68
+ fragmentedModules.push({
69
+ domain,
70
+ files: filePaths,
71
+ fragmentationScore,
72
+ totalTokens: clusterTokens,
73
+ avgCohesion: avgCohesion2,
74
+ suggestedStructure: {
75
+ targetFiles: Math.ceil(files.length / 2),
76
+ consolidationPlan: [
77
+ `Consolidate ${files.length} files in ${domain} into fewer modules`
78
+ ]
79
+ }
80
+ });
81
+ }
82
+ });
83
+ fragmentedModules.sort((a, b) => b.fragmentationScore - a.fragmentationScore);
84
+ const avgFragmentation = fragmentedModules.length > 0 ? fragmentedModules.reduce((sum, m) => sum + m.fragmentationScore, 0) / fragmentedModules.length : 0;
85
+ const avgCohesion = results.reduce((sum, r) => sum + r.cohesionScore, 0) / (totalFiles || 1);
86
+ const lowCohesionFiles = results.filter((r) => r.cohesionScore < 0.4).map((r) => ({ file: r.file, score: r.cohesionScore }));
87
+ const criticalIssues = results.filter(
88
+ (r) => r.severity === "critical"
89
+ ).length;
90
+ const majorIssues = results.filter((r) => r.severity === "major").length;
91
+ const minorIssues = results.filter((r) => r.severity === "minor").length;
92
+ const totalPotentialSavings = results.reduce(
93
+ (sum, r) => sum + (r.potentialSavings || 0),
94
+ 0
95
+ );
96
+ const topExpensiveFiles = [...results].sort((a, b) => b.contextBudget - a.contextBudget).slice(0, 10).map((r) => ({
97
+ file: r.file,
98
+ contextBudget: r.contextBudget,
99
+ severity: r.severity
100
+ }));
101
+ return {
102
+ totalFiles,
103
+ totalTokens,
104
+ avgContextBudget,
105
+ maxContextBudget: Math.max(0, ...results.map((r) => r.contextBudget)),
106
+ avgImportDepth: results.reduce((sum, r) => sum + r.importDepth, 0) / (totalFiles || 1),
107
+ maxImportDepth,
108
+ deepFiles,
109
+ avgFragmentation,
110
+ fragmentedModules,
111
+ avgCohesion,
112
+ lowCohesionFiles,
113
+ criticalIssues,
114
+ majorIssues,
115
+ minorIssues,
116
+ totalPotentialSavings,
117
+ topExpensiveFiles,
118
+ config
119
+ };
120
+ }
121
+
122
+ export {
123
+ generateSummary
124
+ };
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  calculateEnhancedCohesion,
8
8
  calculateFragmentation
9
- } from "./chunk-EMYD7NS6.mjs";
9
+ } from "./chunk-JSM7Q5CY.mjs";
10
10
 
11
11
  // src/orchestrator.ts
12
12
  import { scanFiles, readFileContent } from "@aiready/core";
@@ -144,30 +144,6 @@ function buildCoUsageMatrix(graph) {
144
144
  }
145
145
  return coUsageMatrix;
146
146
  }
147
- function findSemanticClusters(coUsageMatrix, minCoUsage = 3) {
148
- const clusters = /* @__PURE__ */ new Map();
149
- const visited = /* @__PURE__ */ new Set();
150
- for (const [file, coUsages] of coUsageMatrix) {
151
- if (visited.has(file)) continue;
152
- const cluster = [file];
153
- visited.add(file);
154
- for (const [relatedFile, count] of coUsages) {
155
- if (count >= minCoUsage && !visited.has(relatedFile)) {
156
- cluster.push(relatedFile);
157
- visited.add(relatedFile);
158
- }
159
- }
160
- if (cluster.length > 1) clusters.set(file, cluster);
161
- }
162
- return clusters;
163
- }
164
- function getCoUsageData(file, coUsageMatrix) {
165
- return {
166
- file,
167
- coImportedWith: coUsageMatrix.get(file) || /* @__PURE__ */ new Map(),
168
- sharedImporters: []
169
- };
170
- }
171
147
 
172
148
  // src/semantic/type-graph.ts
173
149
  function buildTypeGraph(graph) {
@@ -728,7 +704,7 @@ function isHubAndSpokeFile(node) {
728
704
  }
729
705
 
730
706
  // src/classifier.ts
731
- var Classification = {
707
+ var CLASSIFICATION = {
732
708
  BARREL: "barrel-export",
733
709
  BOILERPLATE: "boilerplate-barrel",
734
710
  TYPE_DEFINITION: "type-definition",
@@ -745,66 +721,66 @@ var Classification = {
745
721
  };
746
722
  function classifyFile(node, cohesionScore = 1, domains = []) {
747
723
  if (isBoilerplateBarrel(node)) {
748
- return Classification.BOILERPLATE;
724
+ return CLASSIFICATION.BOILERPLATE;
749
725
  }
750
726
  if (isBarrelExport(node)) {
751
- return Classification.BARREL;
727
+ return CLASSIFICATION.BARREL;
752
728
  }
753
729
  if (isTypeDefinition(node)) {
754
- return Classification.TYPE_DEFINITION;
730
+ return CLASSIFICATION.TYPE_DEFINITION;
755
731
  }
756
732
  if (isNextJsPage(node)) {
757
- return Classification.NEXTJS_PAGE;
733
+ return CLASSIFICATION.NEXTJS_PAGE;
758
734
  }
759
735
  if (isLambdaHandler(node)) {
760
- return Classification.LAMBDA_HANDLER;
736
+ return CLASSIFICATION.LAMBDA_HANDLER;
761
737
  }
762
738
  if (isServiceFile(node)) {
763
- return Classification.SERVICE;
739
+ return CLASSIFICATION.SERVICE;
764
740
  }
765
741
  if (isEmailTemplate(node)) {
766
- return Classification.EMAIL_TEMPLATE;
742
+ return CLASSIFICATION.EMAIL_TEMPLATE;
767
743
  }
768
744
  if (isParserFile(node)) {
769
- return Classification.PARSER;
745
+ return CLASSIFICATION.PARSER;
770
746
  }
771
747
  if (isSessionFile(node)) {
772
748
  if (cohesionScore >= 0.25 && domains.length <= 1)
773
- return Classification.COHESIVE_MODULE;
774
- return Classification.UTILITY_MODULE;
749
+ return CLASSIFICATION.COHESIVE_MODULE;
750
+ return CLASSIFICATION.UTILITY_MODULE;
775
751
  }
776
752
  if (isUtilityModule(node)) {
777
- return Classification.UTILITY_MODULE;
753
+ return CLASSIFICATION.UTILITY_MODULE;
778
754
  }
779
755
  if (isConfigFile(node)) {
780
- return Classification.COHESIVE_MODULE;
756
+ return CLASSIFICATION.COHESIVE_MODULE;
781
757
  }
782
758
  if (isHubAndSpokeFile(node)) {
783
- return Classification.SPOKE_MODULE;
759
+ return CLASSIFICATION.SPOKE_MODULE;
784
760
  }
785
761
  if (domains.length <= 1 && domains[0] !== "unknown") {
786
- return Classification.COHESIVE_MODULE;
762
+ return CLASSIFICATION.COHESIVE_MODULE;
787
763
  }
788
764
  if (domains.length > 1 && cohesionScore < 0.4) {
789
- return Classification.MIXED_CONCERNS;
765
+ return CLASSIFICATION.MIXED_CONCERNS;
790
766
  }
791
767
  if (cohesionScore >= 0.7) {
792
- return Classification.COHESIVE_MODULE;
768
+ return CLASSIFICATION.COHESIVE_MODULE;
793
769
  }
794
- return Classification.UNKNOWN;
770
+ return CLASSIFICATION.UNKNOWN;
795
771
  }
796
772
  function adjustCohesionForClassification(baseCohesion, classification, node) {
797
773
  switch (classification) {
798
- case Classification.BOILERPLATE:
774
+ case CLASSIFICATION.BOILERPLATE:
799
775
  return 0.2;
800
776
  // Redundant indirection is low cohesion (architectural theater)
801
- case Classification.BARREL:
777
+ case CLASSIFICATION.BARREL:
802
778
  return 1;
803
- case Classification.TYPE_DEFINITION:
779
+ case CLASSIFICATION.TYPE_DEFINITION:
804
780
  return 1;
805
- case Classification.NEXTJS_PAGE:
781
+ case CLASSIFICATION.NEXTJS_PAGE:
806
782
  return 1;
807
- case Classification.UTILITY_MODULE: {
783
+ case CLASSIFICATION.UTILITY_MODULE: {
808
784
  if (node && hasRelatedExportNames(
809
785
  (node.exports || []).map((e) => e.name.toLowerCase())
810
786
  )) {
@@ -812,19 +788,19 @@ function adjustCohesionForClassification(baseCohesion, classification, node) {
812
788
  }
813
789
  return Math.max(0.75, Math.min(1, baseCohesion + 0.35));
814
790
  }
815
- case Classification.SERVICE:
791
+ case CLASSIFICATION.SERVICE:
816
792
  return Math.max(0.72, Math.min(1, baseCohesion + 0.3));
817
- case Classification.LAMBDA_HANDLER:
793
+ case CLASSIFICATION.LAMBDA_HANDLER:
818
794
  return Math.max(0.75, Math.min(1, baseCohesion + 0.35));
819
- case Classification.EMAIL_TEMPLATE:
795
+ case CLASSIFICATION.EMAIL_TEMPLATE:
820
796
  return Math.max(0.72, Math.min(1, baseCohesion + 0.3));
821
- case Classification.PARSER:
797
+ case CLASSIFICATION.PARSER:
822
798
  return Math.max(0.7, Math.min(1, baseCohesion + 0.3));
823
- case Classification.SPOKE_MODULE:
799
+ case CLASSIFICATION.SPOKE_MODULE:
824
800
  return Math.max(baseCohesion, 0.6);
825
- case Classification.COHESIVE_MODULE:
801
+ case CLASSIFICATION.COHESIVE_MODULE:
826
802
  return Math.max(baseCohesion, 0.7);
827
- case Classification.MIXED_CONCERNS:
803
+ case CLASSIFICATION.MIXED_CONCERNS:
828
804
  return baseCohesion;
829
805
  default:
830
806
  return Math.min(1, baseCohesion + 0.1);
@@ -873,26 +849,26 @@ function hasRelatedExportNames(exportNames) {
873
849
  }
874
850
  function adjustFragmentationForClassification(baseFragmentation, classification) {
875
851
  switch (classification) {
876
- case Classification.BOILERPLATE:
852
+ case CLASSIFICATION.BOILERPLATE:
877
853
  return baseFragmentation * 1.5;
878
854
  // Redundant barrels increase fragmentation
879
- case Classification.BARREL:
855
+ case CLASSIFICATION.BARREL:
880
856
  return 0;
881
- case Classification.TYPE_DEFINITION:
857
+ case CLASSIFICATION.TYPE_DEFINITION:
882
858
  return 0;
883
- case Classification.UTILITY_MODULE:
884
- case Classification.SERVICE:
885
- case Classification.LAMBDA_HANDLER:
886
- case Classification.EMAIL_TEMPLATE:
887
- case Classification.PARSER:
888
- case Classification.NEXTJS_PAGE:
859
+ case CLASSIFICATION.UTILITY_MODULE:
860
+ case CLASSIFICATION.SERVICE:
861
+ case CLASSIFICATION.LAMBDA_HANDLER:
862
+ case CLASSIFICATION.EMAIL_TEMPLATE:
863
+ case CLASSIFICATION.PARSER:
864
+ case CLASSIFICATION.NEXTJS_PAGE:
889
865
  return baseFragmentation * 0.2;
890
- case Classification.SPOKE_MODULE:
866
+ case CLASSIFICATION.SPOKE_MODULE:
891
867
  return baseFragmentation * 0.15;
892
868
  // Heavily discount intentional monorepo separation
893
- case Classification.COHESIVE_MODULE:
869
+ case CLASSIFICATION.COHESIVE_MODULE:
894
870
  return baseFragmentation * 0.3;
895
- case Classification.MIXED_CONCERNS:
871
+ case CLASSIFICATION.MIXED_CONCERNS:
896
872
  return baseFragmentation;
897
873
  default:
898
874
  return baseFragmentation * 0.7;
@@ -1257,42 +1233,11 @@ async function analyzeContext(options) {
1257
1233
  }
1258
1234
 
1259
1235
  export {
1260
- buildCoUsageMatrix,
1261
- findSemanticClusters,
1262
- getCoUsageData,
1263
- buildTypeGraph,
1264
- calculateDomainConfidence,
1265
- inferDomainFromSemantics,
1266
- extractExports,
1267
- inferDomain,
1268
- extractDomainKeywordsFromPaths,
1269
1236
  buildDependencyGraph,
1270
1237
  calculateImportDepth,
1271
1238
  getTransitiveDependencies,
1272
1239
  calculateContextBudget,
1273
1240
  detectCircularDependencies,
1274
- BARREL_EXPORT_MIN_EXPORTS,
1275
- BARREL_EXPORT_TOKEN_LIMIT,
1276
- HANDLER_NAME_PATTERNS,
1277
- SERVICE_NAME_PATTERNS,
1278
- EMAIL_NAME_PATTERNS,
1279
- PARSER_NAME_PATTERNS,
1280
- SESSION_NAME_PATTERNS,
1281
- NEXTJS_METADATA_EXPORTS,
1282
- CONFIG_NAME_PATTERNS,
1283
- isBoilerplateBarrel,
1284
- isBarrelExport,
1285
- isTypeDefinition,
1286
- isUtilityModule,
1287
- isLambdaHandler,
1288
- isServiceFile,
1289
- isEmailTemplate,
1290
- isParserFile,
1291
- isSessionFile,
1292
- isNextJsPage,
1293
- isConfigFile,
1294
- isHubAndSpokeFile,
1295
- Classification,
1296
1241
  classifyFile,
1297
1242
  adjustCohesionForClassification,
1298
1243
  adjustFragmentationForClassification,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  calculatePathEntropy
3
- } from "./chunk-EMYD7NS6.mjs";
3
+ } from "./chunk-JSM7Q5CY.mjs";
4
4
 
5
5
  // src/summary.ts
6
6
  import { GLOBAL_SCAN_OPTIONS } from "@aiready/core";
@@ -16,11 +16,30 @@ function generateSummary(results, options = {}) {
16
16
  const deepFiles = results.filter((r) => r.importDepth > 5).map((r) => ({ file: r.file, depth: r.importDepth }));
17
17
  const maxImportDepth = Math.max(0, ...results.map((r) => r.importDepth));
18
18
  const moduleMap = /* @__PURE__ */ new Map();
19
+ const rootDir = config.rootDir || "";
19
20
  results.forEach((r) => {
20
- const parts = r.file.split("/");
21
+ let relativePath = r.file;
22
+ if (rootDir && r.file.startsWith(rootDir)) {
23
+ relativePath = r.file.slice(rootDir.length);
24
+ if (relativePath.startsWith("/")) relativePath = relativePath.slice(1);
25
+ }
26
+ const parts = relativePath.split("/");
21
27
  let domain = "root";
22
- if (parts.length > 2) {
23
- domain = parts.slice(0, 2).join("/");
28
+ const domainIndicators = ["packages", "apps", "src", "lib", "modules"];
29
+ for (let i = 0; i < parts.length - 1; i++) {
30
+ if (domainIndicators.includes(parts[i]) && parts[i + 1]) {
31
+ domain = `${parts[i]}/${parts[i + 1]}`;
32
+ break;
33
+ }
34
+ }
35
+ if (domain === "root" && parts.length > 1) {
36
+ const skipPrefixes = ["src", "lib", "dist", "build", "out", "node_modules"];
37
+ for (let i = 0; i < parts.length - 1; i++) {
38
+ if (!skipPrefixes.includes(parts[i]) && parts[i] !== "") {
39
+ domain = parts[i];
40
+ break;
41
+ }
42
+ }
24
43
  }
25
44
  if (!moduleMap.has(domain)) moduleMap.set(domain, []);
26
45
  moduleMap.get(domain).push(r);
@@ -30,14 +49,21 @@ function generateSummary(results, options = {}) {
30
49
  const clusterTokens = files.reduce((sum, f) => sum + f.tokenCost, 0);
31
50
  const filePaths = files.map((f) => f.file);
32
51
  const avgEntropy = calculatePathEntropy(filePaths);
33
- const fragmentationScore = Math.min(1, avgEntropy * (files.length / 10));
52
+ const avgCohesion2 = files.reduce((sum, f) => sum + f.cohesionScore, 0) / files.length;
53
+ const cohesionFactor = avgCohesion2 < 0.5 ? (0.5 - avgCohesion2) * 2 : 0;
54
+ const entropyFactor = avgEntropy > 0.7 ? (avgEntropy - 0.7) * 3.33 : 0;
55
+ const sizeFactor = files.length > 20 ? Math.min(1, (files.length - 20) / 80) : 0;
56
+ const fragmentationScore = Math.min(
57
+ 1,
58
+ cohesionFactor * 0.5 + entropyFactor * 0.3 + sizeFactor * 0.2
59
+ );
34
60
  if (fragmentationScore > 0.4) {
35
61
  fragmentedModules.push({
36
62
  domain,
37
63
  files: filePaths,
38
64
  fragmentationScore,
39
65
  totalTokens: clusterTokens,
40
- avgCohesion: files.reduce((sum, f) => sum + f.cohesionScore, 0) / files.length,
66
+ avgCohesion: avgCohesion2,
41
67
  suggestedStructure: {
42
68
  targetFiles: Math.ceil(files.length / 2),
43
69
  consolidationPlan: [