aspectcode 0.2.1 → 0.3.0

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 (307) hide show
  1. package/dist/cli.d.ts +16 -56
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +18 -21
  4. package/dist/cli.js.map +1 -1
  5. package/dist/config.d.ts +14 -25
  6. package/dist/config.d.ts.map +1 -1
  7. package/dist/config.js +5 -61
  8. package/dist/config.js.map +1 -1
  9. package/dist/kbBuilder.d.ts +14 -0
  10. package/dist/kbBuilder.d.ts.map +1 -0
  11. package/dist/kbBuilder.js +106 -0
  12. package/dist/kbBuilder.js.map +1 -0
  13. package/dist/main.d.ts +4 -5
  14. package/dist/main.d.ts.map +1 -1
  15. package/dist/main.js +46 -145
  16. package/dist/main.js.map +1 -1
  17. package/dist/optimize.d.ts +14 -0
  18. package/dist/optimize.d.ts.map +1 -0
  19. package/dist/optimize.js +131 -0
  20. package/dist/optimize.js.map +1 -0
  21. package/dist/pipeline.d.ts +15 -0
  22. package/dist/pipeline.d.ts.map +1 -0
  23. package/dist/pipeline.js +212 -0
  24. package/dist/pipeline.js.map +1 -0
  25. package/dist/toolIngestion.d.ts +15 -0
  26. package/dist/toolIngestion.d.ts.map +1 -0
  27. package/dist/toolIngestion.js +47 -0
  28. package/dist/toolIngestion.js.map +1 -0
  29. package/dist/writer.d.ts +17 -0
  30. package/dist/writer.d.ts.map +1 -0
  31. package/dist/writer.js +26 -0
  32. package/dist/writer.js.map +1 -0
  33. package/node_modules/@aspectcode/core/dist/analysis/analyzer.d.ts +34 -0
  34. package/node_modules/@aspectcode/core/dist/analysis/analyzer.d.ts.map +1 -0
  35. package/node_modules/@aspectcode/core/dist/analysis/analyzer.js +240 -0
  36. package/node_modules/@aspectcode/core/dist/analysis/analyzer.js.map +1 -0
  37. package/node_modules/@aspectcode/core/dist/analysis/dependencyAdapters.d.ts +32 -0
  38. package/node_modules/@aspectcode/core/dist/analysis/dependencyAdapters.d.ts.map +1 -0
  39. package/node_modules/@aspectcode/core/dist/analysis/dependencyAdapters.js +133 -0
  40. package/node_modules/@aspectcode/core/dist/analysis/dependencyAdapters.js.map +1 -0
  41. package/node_modules/@aspectcode/core/dist/analysis/importParsers.d.ts +30 -0
  42. package/node_modules/@aspectcode/core/dist/analysis/importParsers.d.ts.map +1 -0
  43. package/node_modules/@aspectcode/core/dist/analysis/importParsers.js +92 -0
  44. package/node_modules/@aspectcode/core/dist/analysis/importParsers.js.map +1 -0
  45. package/node_modules/@aspectcode/core/dist/analysis/index.d.ts +9 -0
  46. package/node_modules/@aspectcode/core/dist/analysis/index.d.ts.map +1 -0
  47. package/node_modules/@aspectcode/core/dist/analysis/index.js +9 -0
  48. package/node_modules/@aspectcode/core/dist/analysis/index.js.map +1 -0
  49. package/node_modules/@aspectcode/core/dist/analysis/moduleResolver.d.ts +34 -0
  50. package/node_modules/@aspectcode/core/dist/analysis/moduleResolver.d.ts.map +1 -0
  51. package/node_modules/@aspectcode/core/dist/analysis/moduleResolver.js +240 -0
  52. package/node_modules/@aspectcode/core/dist/analysis/moduleResolver.js.map +1 -0
  53. package/node_modules/@aspectcode/core/dist/analysis/repo.d.ts +33 -0
  54. package/node_modules/@aspectcode/core/dist/analysis/repo.d.ts.map +1 -0
  55. package/node_modules/@aspectcode/core/dist/analysis/repo.js +246 -0
  56. package/node_modules/@aspectcode/core/dist/analysis/repo.js.map +1 -0
  57. package/node_modules/@aspectcode/core/dist/classifiers.d.ts +24 -0
  58. package/node_modules/@aspectcode/core/dist/classifiers.d.ts.map +1 -0
  59. package/node_modules/@aspectcode/core/dist/classifiers.js +119 -0
  60. package/node_modules/@aspectcode/core/dist/classifiers.js.map +1 -0
  61. package/node_modules/@aspectcode/core/dist/fs/exclusions.d.ts +26 -0
  62. package/node_modules/@aspectcode/core/dist/fs/exclusions.d.ts.map +1 -0
  63. package/node_modules/@aspectcode/core/dist/fs/exclusions.js +130 -0
  64. package/node_modules/@aspectcode/core/dist/fs/exclusions.js.map +1 -0
  65. package/node_modules/@aspectcode/core/dist/fs/fingerprint.d.ts +42 -0
  66. package/node_modules/@aspectcode/core/dist/fs/fingerprint.d.ts.map +1 -0
  67. package/node_modules/@aspectcode/core/dist/fs/fingerprint.js +125 -0
  68. package/node_modules/@aspectcode/core/dist/fs/fingerprint.js.map +1 -0
  69. package/node_modules/@aspectcode/core/dist/fs/index.d.ts +9 -0
  70. package/node_modules/@aspectcode/core/dist/fs/index.d.ts.map +1 -0
  71. package/node_modules/@aspectcode/core/dist/fs/index.js +26 -0
  72. package/node_modules/@aspectcode/core/dist/fs/index.js.map +1 -0
  73. package/node_modules/@aspectcode/core/dist/fs/walker.d.ts +23 -0
  74. package/node_modules/@aspectcode/core/dist/fs/walker.d.ts.map +1 -0
  75. package/node_modules/@aspectcode/core/dist/fs/walker.js +94 -0
  76. package/node_modules/@aspectcode/core/dist/fs/walker.js.map +1 -0
  77. package/node_modules/@aspectcode/core/dist/host.d.ts +38 -0
  78. package/node_modules/@aspectcode/core/dist/host.d.ts.map +1 -0
  79. package/node_modules/@aspectcode/core/dist/host.js +110 -0
  80. package/node_modules/@aspectcode/core/dist/host.js.map +1 -0
  81. package/node_modules/@aspectcode/core/dist/index.d.ts +23 -0
  82. package/node_modules/@aspectcode/core/dist/index.d.ts.map +1 -0
  83. package/node_modules/@aspectcode/core/dist/index.js +59 -0
  84. package/node_modules/@aspectcode/core/dist/index.js.map +1 -0
  85. package/node_modules/@aspectcode/core/dist/model.d.ts +90 -0
  86. package/node_modules/@aspectcode/core/dist/model.d.ts.map +1 -0
  87. package/node_modules/@aspectcode/core/dist/model.js +9 -0
  88. package/node_modules/@aspectcode/core/dist/model.js.map +1 -0
  89. package/node_modules/@aspectcode/core/dist/parsers/csharpExtractors.d.ts +17 -0
  90. package/node_modules/@aspectcode/core/dist/parsers/csharpExtractors.d.ts.map +1 -0
  91. package/node_modules/@aspectcode/core/dist/parsers/csharpExtractors.js +225 -0
  92. package/node_modules/@aspectcode/core/dist/parsers/csharpExtractors.js.map +1 -0
  93. package/node_modules/@aspectcode/core/dist/parsers/grammarLoader.d.ts +30 -0
  94. package/node_modules/@aspectcode/core/dist/parsers/grammarLoader.d.ts.map +1 -0
  95. package/node_modules/@aspectcode/core/dist/parsers/grammarLoader.js +71 -0
  96. package/node_modules/@aspectcode/core/dist/parsers/grammarLoader.js.map +1 -0
  97. package/node_modules/@aspectcode/core/dist/parsers/index.d.ts +13 -0
  98. package/node_modules/@aspectcode/core/dist/parsers/index.d.ts.map +1 -0
  99. package/node_modules/@aspectcode/core/dist/parsers/index.js +32 -0
  100. package/node_modules/@aspectcode/core/dist/parsers/index.js.map +1 -0
  101. package/node_modules/@aspectcode/core/dist/parsers/javaExtractors.d.ts +17 -0
  102. package/node_modules/@aspectcode/core/dist/parsers/javaExtractors.d.ts.map +1 -0
  103. package/node_modules/@aspectcode/core/dist/parsers/javaExtractors.js +182 -0
  104. package/node_modules/@aspectcode/core/dist/parsers/javaExtractors.js.map +1 -0
  105. package/node_modules/@aspectcode/core/dist/parsers/languages.d.ts +44 -0
  106. package/node_modules/@aspectcode/core/dist/parsers/languages.d.ts.map +1 -0
  107. package/node_modules/@aspectcode/core/dist/parsers/languages.js +64 -0
  108. package/node_modules/@aspectcode/core/dist/parsers/languages.js.map +1 -0
  109. package/node_modules/@aspectcode/core/dist/parsers/pythonExtractors.d.ts +18 -0
  110. package/node_modules/@aspectcode/core/dist/parsers/pythonExtractors.d.ts.map +1 -0
  111. package/node_modules/@aspectcode/core/dist/parsers/pythonExtractors.js +139 -0
  112. package/node_modules/@aspectcode/core/dist/parsers/pythonExtractors.js.map +1 -0
  113. package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.d.ts +22 -0
  114. package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.d.ts.map +1 -0
  115. package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.js +240 -0
  116. package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.js.map +1 -0
  117. package/node_modules/@aspectcode/core/dist/parsers/utils.d.ts +7 -0
  118. package/node_modules/@aspectcode/core/dist/parsers/utils.d.ts.map +1 -0
  119. package/node_modules/@aspectcode/core/dist/parsers/utils.js +11 -0
  120. package/node_modules/@aspectcode/core/dist/parsers/utils.js.map +1 -0
  121. package/node_modules/@aspectcode/core/dist/paths.d.ts +27 -0
  122. package/node_modules/@aspectcode/core/dist/paths.d.ts.map +1 -0
  123. package/node_modules/@aspectcode/core/dist/paths.js +45 -0
  124. package/node_modules/@aspectcode/core/dist/paths.js.map +1 -0
  125. package/node_modules/@aspectcode/core/dist/stats.d.ts +41 -0
  126. package/node_modules/@aspectcode/core/dist/stats.d.ts.map +1 -0
  127. package/node_modules/@aspectcode/core/dist/stats.js +88 -0
  128. package/node_modules/@aspectcode/core/dist/stats.js.map +1 -0
  129. package/node_modules/@aspectcode/core/package.json +41 -0
  130. package/node_modules/@aspectcode/core/parsers/c_sharp.wasm +0 -0
  131. package/node_modules/@aspectcode/core/parsers/java.wasm +0 -0
  132. package/node_modules/@aspectcode/core/parsers/javascript.wasm +0 -0
  133. package/node_modules/@aspectcode/core/parsers/python.wasm +0 -0
  134. package/node_modules/@aspectcode/core/parsers/tree-sitter.wasm +0 -0
  135. package/node_modules/@aspectcode/core/parsers/tsx.wasm +0 -0
  136. package/node_modules/@aspectcode/core/parsers/typescript.wasm +0 -0
  137. package/node_modules/@aspectcode/emitters/dist/emitter.d.ts +72 -0
  138. package/node_modules/@aspectcode/emitters/dist/emitter.d.ts.map +1 -0
  139. package/node_modules/@aspectcode/emitters/dist/emitter.js +10 -0
  140. package/node_modules/@aspectcode/emitters/dist/emitter.js.map +1 -0
  141. package/node_modules/@aspectcode/emitters/dist/host.d.ts +31 -0
  142. package/node_modules/@aspectcode/emitters/dist/host.d.ts.map +1 -0
  143. package/node_modules/@aspectcode/emitters/dist/host.js +86 -0
  144. package/node_modules/@aspectcode/emitters/dist/host.js.map +1 -0
  145. package/node_modules/@aspectcode/emitters/dist/index.d.ts +27 -0
  146. package/node_modules/@aspectcode/emitters/dist/index.d.ts.map +1 -0
  147. package/node_modules/@aspectcode/emitters/dist/index.js +116 -0
  148. package/node_modules/@aspectcode/emitters/dist/index.js.map +1 -0
  149. package/node_modules/@aspectcode/emitters/dist/instructions/content.d.ts +15 -0
  150. package/node_modules/@aspectcode/emitters/dist/instructions/content.d.ts.map +1 -0
  151. package/node_modules/@aspectcode/emitters/dist/instructions/content.js +289 -0
  152. package/node_modules/@aspectcode/emitters/dist/instructions/content.js.map +1 -0
  153. package/node_modules/@aspectcode/emitters/dist/instructions/detection.d.ts +13 -0
  154. package/node_modules/@aspectcode/emitters/dist/instructions/detection.d.ts.map +1 -0
  155. package/node_modules/@aspectcode/emitters/dist/instructions/detection.js +55 -0
  156. package/node_modules/@aspectcode/emitters/dist/instructions/detection.js.map +1 -0
  157. package/node_modules/@aspectcode/emitters/dist/instructions/formats.d.ts +17 -0
  158. package/node_modules/@aspectcode/emitters/dist/instructions/formats.d.ts.map +1 -0
  159. package/node_modules/@aspectcode/emitters/dist/instructions/formats.js +23 -0
  160. package/node_modules/@aspectcode/emitters/dist/instructions/formats.js.map +1 -0
  161. package/node_modules/@aspectcode/emitters/dist/instructions/index.d.ts +5 -0
  162. package/node_modules/@aspectcode/emitters/dist/instructions/index.d.ts.map +1 -0
  163. package/node_modules/@aspectcode/emitters/dist/instructions/index.js +12 -0
  164. package/node_modules/@aspectcode/emitters/dist/instructions/index.js.map +1 -0
  165. package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.d.ts +9 -0
  166. package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.d.ts.map +1 -0
  167. package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.js +30 -0
  168. package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.js.map +1 -0
  169. package/node_modules/@aspectcode/emitters/dist/kb/analyzers.d.ts +64 -0
  170. package/node_modules/@aspectcode/emitters/dist/kb/analyzers.d.ts.map +1 -0
  171. package/node_modules/@aspectcode/emitters/dist/kb/analyzers.js +504 -0
  172. package/node_modules/@aspectcode/emitters/dist/kb/analyzers.js.map +1 -0
  173. package/node_modules/@aspectcode/emitters/dist/kb/architectureEmitter.d.ts +24 -0
  174. package/node_modules/@aspectcode/emitters/dist/kb/architectureEmitter.d.ts.map +1 -0
  175. package/node_modules/@aspectcode/emitters/dist/kb/architectureEmitter.js +238 -0
  176. package/node_modules/@aspectcode/emitters/dist/kb/architectureEmitter.js.map +1 -0
  177. package/node_modules/@aspectcode/emitters/dist/kb/classifiers.d.ts +8 -0
  178. package/node_modules/@aspectcode/emitters/dist/kb/classifiers.d.ts.map +1 -0
  179. package/node_modules/@aspectcode/emitters/dist/kb/classifiers.js +14 -0
  180. package/node_modules/@aspectcode/emitters/dist/kb/classifiers.js.map +1 -0
  181. package/node_modules/@aspectcode/emitters/dist/kb/constants.d.ts +35 -0
  182. package/node_modules/@aspectcode/emitters/dist/kb/constants.d.ts.map +1 -0
  183. package/node_modules/@aspectcode/emitters/dist/kb/constants.js +38 -0
  184. package/node_modules/@aspectcode/emitters/dist/kb/constants.js.map +1 -0
  185. package/node_modules/@aspectcode/emitters/dist/kb/contextEmitter.d.ts +20 -0
  186. package/node_modules/@aspectcode/emitters/dist/kb/contextEmitter.d.ts.map +1 -0
  187. package/node_modules/@aspectcode/emitters/dist/kb/contextEmitter.js +155 -0
  188. package/node_modules/@aspectcode/emitters/dist/kb/contextEmitter.js.map +1 -0
  189. package/node_modules/@aspectcode/emitters/dist/kb/conventions.d.ts +52 -0
  190. package/node_modules/@aspectcode/emitters/dist/kb/conventions.d.ts.map +1 -0
  191. package/node_modules/@aspectcode/emitters/dist/kb/conventions.js +391 -0
  192. package/node_modules/@aspectcode/emitters/dist/kb/conventions.js.map +1 -0
  193. package/node_modules/@aspectcode/emitters/dist/kb/depData.d.ts +18 -0
  194. package/node_modules/@aspectcode/emitters/dist/kb/depData.d.ts.map +1 -0
  195. package/node_modules/@aspectcode/emitters/dist/kb/depData.js +31 -0
  196. package/node_modules/@aspectcode/emitters/dist/kb/depData.js.map +1 -0
  197. package/node_modules/@aspectcode/emitters/dist/kb/detectors.d.ts +18 -0
  198. package/node_modules/@aspectcode/emitters/dist/kb/detectors.d.ts.map +1 -0
  199. package/node_modules/@aspectcode/emitters/dist/kb/detectors.js +317 -0
  200. package/node_modules/@aspectcode/emitters/dist/kb/detectors.js.map +1 -0
  201. package/node_modules/@aspectcode/emitters/dist/kb/entryPoints.d.ts +33 -0
  202. package/node_modules/@aspectcode/emitters/dist/kb/entryPoints.d.ts.map +1 -0
  203. package/node_modules/@aspectcode/emitters/dist/kb/entryPoints.js +323 -0
  204. package/node_modules/@aspectcode/emitters/dist/kb/entryPoints.js.map +1 -0
  205. package/node_modules/@aspectcode/emitters/dist/kb/helpers.d.ts +27 -0
  206. package/node_modules/@aspectcode/emitters/dist/kb/helpers.d.ts.map +1 -0
  207. package/node_modules/@aspectcode/emitters/dist/kb/helpers.js +63 -0
  208. package/node_modules/@aspectcode/emitters/dist/kb/helpers.js.map +1 -0
  209. package/node_modules/@aspectcode/emitters/dist/kb/index.d.ts +27 -0
  210. package/node_modules/@aspectcode/emitters/dist/kb/index.d.ts.map +1 -0
  211. package/node_modules/@aspectcode/emitters/dist/kb/index.js +72 -0
  212. package/node_modules/@aspectcode/emitters/dist/kb/index.js.map +1 -0
  213. package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.d.ts +21 -0
  214. package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.d.ts.map +1 -0
  215. package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.js +125 -0
  216. package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.js.map +1 -0
  217. package/node_modules/@aspectcode/emitters/dist/kb/mapEmitter.d.ts +26 -0
  218. package/node_modules/@aspectcode/emitters/dist/kb/mapEmitter.d.ts.map +1 -0
  219. package/node_modules/@aspectcode/emitters/dist/kb/mapEmitter.js +255 -0
  220. package/node_modules/@aspectcode/emitters/dist/kb/mapEmitter.js.map +1 -0
  221. package/node_modules/@aspectcode/emitters/dist/kb/policy.d.ts +12 -0
  222. package/node_modules/@aspectcode/emitters/dist/kb/policy.d.ts.map +1 -0
  223. package/node_modules/@aspectcode/emitters/dist/kb/policy.js +29 -0
  224. package/node_modules/@aspectcode/emitters/dist/kb/policy.js.map +1 -0
  225. package/node_modules/@aspectcode/emitters/dist/kb/symbols.d.ts +43 -0
  226. package/node_modules/@aspectcode/emitters/dist/kb/symbols.d.ts.map +1 -0
  227. package/node_modules/@aspectcode/emitters/dist/kb/symbols.js +343 -0
  228. package/node_modules/@aspectcode/emitters/dist/kb/symbols.js.map +1 -0
  229. package/node_modules/@aspectcode/emitters/dist/manifest.d.ts +37 -0
  230. package/node_modules/@aspectcode/emitters/dist/manifest.d.ts.map +1 -0
  231. package/node_modules/@aspectcode/emitters/dist/manifest.js +50 -0
  232. package/node_modules/@aspectcode/emitters/dist/manifest.js.map +1 -0
  233. package/node_modules/@aspectcode/emitters/dist/report.d.ts +22 -0
  234. package/node_modules/@aspectcode/emitters/dist/report.d.ts.map +1 -0
  235. package/node_modules/@aspectcode/emitters/dist/report.js +3 -0
  236. package/node_modules/@aspectcode/emitters/dist/report.js.map +1 -0
  237. package/node_modules/@aspectcode/emitters/dist/stableJson.d.ts +14 -0
  238. package/node_modules/@aspectcode/emitters/dist/stableJson.d.ts.map +1 -0
  239. package/node_modules/@aspectcode/emitters/dist/stableJson.js +40 -0
  240. package/node_modules/@aspectcode/emitters/dist/stableJson.js.map +1 -0
  241. package/node_modules/@aspectcode/emitters/dist/transaction.d.ts +29 -0
  242. package/node_modules/@aspectcode/emitters/dist/transaction.d.ts.map +1 -0
  243. package/node_modules/@aspectcode/emitters/dist/transaction.js +104 -0
  244. package/node_modules/@aspectcode/emitters/dist/transaction.js.map +1 -0
  245. package/node_modules/@aspectcode/emitters/package.json +39 -0
  246. package/node_modules/@aspectcode/optimizer/dist/agent.d.ts +18 -0
  247. package/node_modules/@aspectcode/optimizer/dist/agent.d.ts.map +1 -0
  248. package/node_modules/@aspectcode/optimizer/dist/agent.js +123 -0
  249. package/node_modules/@aspectcode/optimizer/dist/agent.js.map +1 -0
  250. package/node_modules/@aspectcode/optimizer/dist/index.d.ts +15 -0
  251. package/node_modules/@aspectcode/optimizer/dist/index.d.ts.map +1 -0
  252. package/node_modules/@aspectcode/optimizer/dist/index.js +31 -0
  253. package/node_modules/@aspectcode/optimizer/dist/index.js.map +1 -0
  254. package/node_modules/@aspectcode/optimizer/dist/prompts.d.ts +39 -0
  255. package/node_modules/@aspectcode/optimizer/dist/prompts.d.ts.map +1 -0
  256. package/node_modules/@aspectcode/optimizer/dist/prompts.js +156 -0
  257. package/node_modules/@aspectcode/optimizer/dist/prompts.js.map +1 -0
  258. package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.d.ts +20 -0
  259. package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.d.ts.map +1 -0
  260. package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.js +126 -0
  261. package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.js.map +1 -0
  262. package/node_modules/@aspectcode/optimizer/dist/providers/index.d.ts +28 -0
  263. package/node_modules/@aspectcode/optimizer/dist/providers/index.d.ts.map +1 -0
  264. package/node_modules/@aspectcode/optimizer/dist/providers/index.js +142 -0
  265. package/node_modules/@aspectcode/optimizer/dist/providers/index.js.map +1 -0
  266. package/node_modules/@aspectcode/optimizer/dist/providers/openai.d.ts +19 -0
  267. package/node_modules/@aspectcode/optimizer/dist/providers/openai.d.ts.map +1 -0
  268. package/node_modules/@aspectcode/optimizer/dist/providers/openai.js +98 -0
  269. package/node_modules/@aspectcode/optimizer/dist/providers/openai.js.map +1 -0
  270. package/node_modules/@aspectcode/optimizer/dist/providers/retry.d.ts +19 -0
  271. package/node_modules/@aspectcode/optimizer/dist/providers/retry.d.ts.map +1 -0
  272. package/node_modules/@aspectcode/optimizer/dist/providers/retry.js +87 -0
  273. package/node_modules/@aspectcode/optimizer/dist/providers/retry.js.map +1 -0
  274. package/node_modules/@aspectcode/optimizer/dist/types.d.ts +93 -0
  275. package/node_modules/@aspectcode/optimizer/dist/types.d.ts.map +1 -0
  276. package/node_modules/@aspectcode/optimizer/dist/types.js +20 -0
  277. package/node_modules/@aspectcode/optimizer/dist/types.js.map +1 -0
  278. package/node_modules/@aspectcode/optimizer/package.json +41 -0
  279. package/package.json +11 -3
  280. package/dist/commands/deps.d.ts +0 -3
  281. package/dist/commands/deps.d.ts.map +0 -1
  282. package/dist/commands/deps.js +0 -39
  283. package/dist/commands/deps.js.map +0 -1
  284. package/dist/commands/generate.d.ts +0 -8
  285. package/dist/commands/generate.d.ts.map +0 -1
  286. package/dist/commands/generate.js +0 -176
  287. package/dist/commands/generate.js.map +0 -1
  288. package/dist/commands/impact.d.ts +0 -9
  289. package/dist/commands/impact.d.ts.map +0 -1
  290. package/dist/commands/impact.js +0 -162
  291. package/dist/commands/impact.js.map +0 -1
  292. package/dist/commands/init.d.ts +0 -11
  293. package/dist/commands/init.d.ts.map +0 -1
  294. package/dist/commands/init.js +0 -204
  295. package/dist/commands/init.js.map +0 -1
  296. package/dist/commands/settings.d.ts +0 -13
  297. package/dist/commands/settings.d.ts.map +0 -1
  298. package/dist/commands/settings.js +0 -196
  299. package/dist/commands/settings.js.map +0 -1
  300. package/dist/commands/watch.d.ts +0 -6
  301. package/dist/commands/watch.d.ts.map +0 -1
  302. package/dist/commands/watch.js +0 -181
  303. package/dist/commands/watch.js.map +0 -1
  304. package/dist/connections.d.ts +0 -24
  305. package/dist/connections.d.ts.map +0 -1
  306. package/dist/connections.js +0 -89
  307. package/dist/connections.js.map +0 -1
@@ -0,0 +1,240 @@
1
+ "use strict";
2
+ /**
3
+ * TypeScript/JavaScript import and symbol extraction using tree-sitter AST.
4
+ *
5
+ * Pure functions — no vscode dependency, only web-tree-sitter.
6
+ */
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.extractTSJSImports = extractTSJSImports;
12
+ exports.extractTSJSSymbols = extractTSJSSymbols;
13
+ const web_tree_sitter_1 = __importDefault(require("web-tree-sitter"));
14
+ const utils_1 = require("./utils");
15
+ // ── Import extraction ────────────────────────────────────────
16
+ /**
17
+ * Extract TS/JS import module specifiers from source code.
18
+ *
19
+ * Handles ES `import … from "…"`, CommonJS `require("…")`,
20
+ * and dynamic `import("…")`.
21
+ */
22
+ function extractTSJSImports(lang, code) {
23
+ const parser = new web_tree_sitter_1.default();
24
+ parser.setLanguage(lang);
25
+ const tree = parser.parse(code);
26
+ const root = tree.rootNode;
27
+ const out = [];
28
+ const walk = (n) => {
29
+ if (n.type === 'import_statement' || n.type === 'import_declaration') {
30
+ const source = n.namedChildren.find((ch) => ch.type === 'string' || ch.type === 'string_literal');
31
+ if (source) {
32
+ const txt = (0, utils_1.textFor)(code, source).trim();
33
+ const m = txt.match(/^['"](.+?)['"]$/);
34
+ if (m)
35
+ out.push(m[1]);
36
+ }
37
+ }
38
+ if (n.type === 'call_expression') {
39
+ const callee = n.child(0);
40
+ if (callee && callee.type === 'identifier' && (0, utils_1.textFor)(code, callee) === 'require') {
41
+ const arg = n.namedChildren.find((ch) => ch.type === 'string' || ch.type === 'string_literal');
42
+ if (arg) {
43
+ const m = (0, utils_1.textFor)(code, arg)
44
+ .trim()
45
+ .match(/^['"](.+?)['"]$/);
46
+ if (m)
47
+ out.push(m[1]);
48
+ }
49
+ }
50
+ }
51
+ for (const ch of n.namedChildren) {
52
+ walk(ch);
53
+ }
54
+ };
55
+ walk(root);
56
+ tree.delete();
57
+ return out;
58
+ }
59
+ // ── Symbol extraction ────────────────────────────────────────
60
+ /**
61
+ * Extract symbols from TypeScript/JavaScript code.
62
+ *
63
+ * Covers: functions, classes, interfaces, type aliases, const
64
+ * declarations (including arrow functions), and abstract classes.
65
+ */
66
+ function extractTSJSSymbols(lang, code) {
67
+ const parser = new web_tree_sitter_1.default();
68
+ parser.setLanguage(lang);
69
+ const tree = parser.parse(code);
70
+ const root = tree.rootNode;
71
+ const symbols = [];
72
+ const walk = (n) => {
73
+ if (n.type === 'export_statement') {
74
+ const declaration = n.namedChildren.find((ch) => ch.type === 'function_declaration' ||
75
+ ch.type === 'class_declaration' ||
76
+ ch.type === 'interface_declaration' ||
77
+ ch.type === 'type_alias_declaration' ||
78
+ ch.type === 'lexical_declaration' ||
79
+ ch.type === 'abstract_class_declaration');
80
+ if (declaration) {
81
+ extractDeclaration(declaration, true);
82
+ }
83
+ }
84
+ if ([
85
+ 'function_declaration',
86
+ 'class_declaration',
87
+ 'interface_declaration',
88
+ 'abstract_class_declaration',
89
+ ].includes(n.type)) {
90
+ if (n.parent?.type !== 'export_statement') {
91
+ extractDeclaration(n, false);
92
+ }
93
+ }
94
+ for (const ch of n.namedChildren) {
95
+ walk(ch);
96
+ }
97
+ };
98
+ const extractDeclaration = (n, exported) => {
99
+ if (n.type === 'function_declaration') {
100
+ const nameNode = n.namedChildren.find((ch) => ch.type === 'identifier');
101
+ const paramsNode = n.namedChildren.find((ch) => ch.type === 'formal_parameters');
102
+ if (nameNode) {
103
+ const name = (0, utils_1.textFor)(code, nameNode);
104
+ const params = paramsNode ? extractTSJSParams(code, paramsNode) : [];
105
+ symbols.push({
106
+ name,
107
+ kind: 'function',
108
+ signature: `function ${name}(${params.join(', ')})`,
109
+ exported,
110
+ });
111
+ }
112
+ }
113
+ if (n.type === 'class_declaration' || n.type === 'abstract_class_declaration') {
114
+ const nameNode = n.namedChildren.find((ch) => ch.type === 'type_identifier');
115
+ const heritageNode = n.namedChildren.find((ch) => ch.type === 'class_heritage');
116
+ if (nameNode) {
117
+ const name = (0, utils_1.textFor)(code, nameNode);
118
+ let inherits;
119
+ if (heritageNode) {
120
+ const extendsClause = heritageNode.namedChildren.find((ch) => ch.type === 'extends_clause');
121
+ if (extendsClause) {
122
+ const typeId = extendsClause.namedChildren.find((ch) => ch.type === 'type_identifier' || ch.type === 'identifier');
123
+ if (typeId) {
124
+ inherits = (0, utils_1.textFor)(code, typeId);
125
+ }
126
+ }
127
+ }
128
+ symbols.push({
129
+ name,
130
+ kind: 'class',
131
+ signature: inherits ? `class ${name} extends ${inherits}` : `class ${name}`,
132
+ inherits,
133
+ exported,
134
+ });
135
+ }
136
+ }
137
+ if (n.type === 'interface_declaration') {
138
+ const nameNode = n.namedChildren.find((ch) => ch.type === 'type_identifier');
139
+ const extendsClause = n.namedChildren.find((ch) => ch.type === 'extends_type_clause');
140
+ if (nameNode) {
141
+ const name = (0, utils_1.textFor)(code, nameNode);
142
+ let inherits;
143
+ if (extendsClause) {
144
+ const typeId = extendsClause.namedChildren.find((ch) => ch.type === 'type_identifier' || ch.type === 'generic_type');
145
+ if (typeId) {
146
+ inherits = (0, utils_1.textFor)(code, typeId);
147
+ }
148
+ }
149
+ symbols.push({
150
+ name,
151
+ kind: 'interface',
152
+ signature: inherits ? `interface ${name} extends ${inherits}` : `interface ${name}`,
153
+ inherits,
154
+ exported,
155
+ });
156
+ }
157
+ }
158
+ if (n.type === 'type_alias_declaration') {
159
+ const nameNode = n.namedChildren.find((ch) => ch.type === 'type_identifier');
160
+ if (nameNode) {
161
+ const name = (0, utils_1.textFor)(code, nameNode);
162
+ symbols.push({
163
+ name,
164
+ kind: 'type',
165
+ signature: `type ${name}`,
166
+ exported,
167
+ });
168
+ }
169
+ }
170
+ if (n.type === 'lexical_declaration') {
171
+ for (const declarator of n.namedChildren) {
172
+ if (declarator.type === 'variable_declarator') {
173
+ const nameNode = declarator.namedChildren.find((ch) => ch.type === 'identifier');
174
+ if (nameNode) {
175
+ const name = (0, utils_1.textFor)(code, nameNode);
176
+ const arrowFn = declarator.namedChildren.find((ch) => ch.type === 'arrow_function');
177
+ if (arrowFn) {
178
+ const paramsNode = arrowFn.namedChildren.find((ch) => ch.type === 'formal_parameters' || ch.type === 'identifier');
179
+ let params = [];
180
+ if (paramsNode) {
181
+ if (paramsNode.type === 'formal_parameters') {
182
+ params = extractTSJSParams(code, paramsNode);
183
+ }
184
+ else if (paramsNode.type === 'identifier') {
185
+ params = [(0, utils_1.textFor)(code, paramsNode)];
186
+ }
187
+ }
188
+ const paramStr = params.length > 0 ? params.join(', ') : '';
189
+ symbols.push({
190
+ name,
191
+ kind: 'const',
192
+ signature: `const ${name} = (${paramStr}) =>`,
193
+ exported,
194
+ });
195
+ }
196
+ else {
197
+ symbols.push({
198
+ name,
199
+ kind: 'const',
200
+ signature: `const ${name}`,
201
+ exported,
202
+ });
203
+ }
204
+ }
205
+ }
206
+ }
207
+ }
208
+ };
209
+ walk(root);
210
+ tree.delete();
211
+ return symbols;
212
+ }
213
+ // ── Helpers ──────────────────────────────────────────────────
214
+ function extractTSJSParams(code, paramsNode) {
215
+ const params = [];
216
+ for (const ch of paramsNode.namedChildren) {
217
+ if (ch.type === 'identifier') {
218
+ params.push((0, utils_1.textFor)(code, ch));
219
+ }
220
+ else if (ch.type === 'required_parameter' || ch.type === 'optional_parameter') {
221
+ const pattern = ch.namedChildren.find((c) => c.type === 'identifier' || c.type === 'object_pattern' || c.type === 'array_pattern');
222
+ if (pattern) {
223
+ if (pattern.type === 'identifier') {
224
+ params.push((0, utils_1.textFor)(code, pattern));
225
+ }
226
+ else {
227
+ params.push('...');
228
+ }
229
+ }
230
+ }
231
+ else if (ch.type === 'rest_pattern') {
232
+ const idNode = ch.namedChildren.find((c) => c.type === 'identifier');
233
+ if (idNode) {
234
+ params.push('...' + (0, utils_1.textFor)(code, idNode));
235
+ }
236
+ }
237
+ }
238
+ return params.slice(0, 4);
239
+ }
240
+ //# sourceMappingURL=tsJsExtractors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tsJsExtractors.js","sourceRoot":"","sources":["../../src/parsers/tsJsExtractors.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AAcH,gDA0CC;AAUD,gDA+KC;AA/OD,sEAAqC;AAErC,mCAAkC;AAElC,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from 'web-tree-sitter';
5
+ /** Extract the source text for a syntax node. */
6
+ export declare function textFor(source: string, node: Parser.SyntaxNode): string;
7
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/parsers/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,iDAAiD;AACjD,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAEvE"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /**
3
+ * Shared utility functions for tree-sitter AST extractors.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.textFor = textFor;
7
+ /** Extract the source text for a syntax node. */
8
+ function textFor(source, node) {
9
+ return source.slice(node.startIndex, node.endIndex);
10
+ }
11
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/parsers/utils.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAKH,0BAEC;AAHD,iDAAiD;AACjD,SAAgB,OAAO,CAAC,MAAc,EAAE,IAAuB;IAC7D,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;AACtD,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Posix-path normalization — the single source of truth for path format
3
+ * at the model boundary.
4
+ *
5
+ * Every path stored in AnalysisModel (relativePath, graph node ids, edge
6
+ * source/target, hub file, FileSymbols.file) MUST pass through `toPosix()`
7
+ * before being written into the model. This prevents platform-dependent
8
+ * backslash paths from leaking into JSON output.
9
+ */
10
+ /**
11
+ * Convert any path to forward-slash (posix) form.
12
+ *
13
+ * - Replaces all backslashes with forward slashes
14
+ * - Strips leading `./`
15
+ * - Collapses consecutive slashes
16
+ *
17
+ * Safe to call on paths that are already posix — idempotent.
18
+ */
19
+ export declare function toPosix(p: string): string;
20
+ /**
21
+ * Convert an absolute path to a workspace-relative posix path.
22
+ *
23
+ * If the path starts with `workspaceRoot` the prefix is stripped; otherwise
24
+ * the filename (basename) is returned as a fallback.
25
+ */
26
+ export declare function makeRelativePath(absPath: string, workspaceRoot: string): string;
27
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAKzC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAS/E"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ /**
3
+ * Posix-path normalization — the single source of truth for path format
4
+ * at the model boundary.
5
+ *
6
+ * Every path stored in AnalysisModel (relativePath, graph node ids, edge
7
+ * source/target, hub file, FileSymbols.file) MUST pass through `toPosix()`
8
+ * before being written into the model. This prevents platform-dependent
9
+ * backslash paths from leaking into JSON output.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.toPosix = toPosix;
13
+ exports.makeRelativePath = makeRelativePath;
14
+ /**
15
+ * Convert any path to forward-slash (posix) form.
16
+ *
17
+ * - Replaces all backslashes with forward slashes
18
+ * - Strips leading `./`
19
+ * - Collapses consecutive slashes
20
+ *
21
+ * Safe to call on paths that are already posix — idempotent.
22
+ */
23
+ function toPosix(p) {
24
+ return p
25
+ .replace(/\\/g, '/')
26
+ .replace(/\/\/+/g, '/')
27
+ .replace(/^\.\//, '');
28
+ }
29
+ /**
30
+ * Convert an absolute path to a workspace-relative posix path.
31
+ *
32
+ * If the path starts with `workspaceRoot` the prefix is stripped; otherwise
33
+ * the filename (basename) is returned as a fallback.
34
+ */
35
+ function makeRelativePath(absPath, workspaceRoot) {
36
+ const normalizedAbs = toPosix(absPath);
37
+ const normalizedRoot = toPosix(workspaceRoot).replace(/\/$/, '');
38
+ if (normalizedAbs.startsWith(normalizedRoot)) {
39
+ return normalizedAbs.substring(normalizedRoot.length).replace(/^\//, '');
40
+ }
41
+ // Fallback: return the basename
42
+ const parts = normalizedAbs.split('/');
43
+ return parts[parts.length - 1];
44
+ }
45
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAWH,0BAKC;AAQD,4CASC;AA/BD;;;;;;;;GAQG;AACH,SAAgB,OAAO,CAAC,CAAS;IAC/B,OAAO,CAAC;SACL,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;SACtB,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,OAAe,EAAE,aAAqB;IACrE,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACjE,IAAI,aAAa,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QAC7C,OAAO,aAAa,CAAC,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,gCAAgC;IAChC,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACjC,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Model statistics — derived read-only summaries from an AnalysisModel.
3
+ *
4
+ * Emitters (markdown, HTML, JSON, etc.) should use these helpers instead
5
+ * of re-implementing counting/ranking logic.
6
+ */
7
+ import type { AnalysisModel, GraphEdge, HubMetric } from './model';
8
+ export interface ModelStats {
9
+ /** Total number of analyzed files */
10
+ fileCount: number;
11
+ /** Total lines of code across all files */
12
+ totalLines: number;
13
+ /** Count of files per detected language */
14
+ languageCounts: Record<string, number>;
15
+ /** Number of distinct languages */
16
+ languageCount: number;
17
+ /** Total number of graph edges (dependencies) */
18
+ edgeCount: number;
19
+ /** Number of circular dependency edges */
20
+ circularCount: number;
21
+ /** Number of bidirectional edges */
22
+ bidirectionalCount: number;
23
+ /** Total extracted symbols across all files */
24
+ symbolCount: number;
25
+ /** Top N hub files ranked by total degree (in + out) */
26
+ topHubs: HubMetric[];
27
+ }
28
+ /**
29
+ * Compute summary statistics from an AnalysisModel.
30
+ *
31
+ * @param model The analysis model to summarize
32
+ * @param topN How many top hubs to include (default 10)
33
+ */
34
+ export declare function computeModelStats(model: AnalysisModel, topN?: number): ModelStats;
35
+ /**
36
+ * Derive top-N hub files from graph edges, ranked by total degree.
37
+ *
38
+ * Also used by analysis/repo.ts when building the initial model.
39
+ */
40
+ export declare function deriveHubs(edges: GraphEdge[], topN?: number): HubMetric[];
41
+ //# sourceMappingURL=stats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../src/stats.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAInE,MAAM,WAAW,UAAU;IACzB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,mCAAmC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,oCAAoC;IACpC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,+CAA+C;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,OAAO,EAAE,SAAS,EAAE,CAAC;CACtB;AAID;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,aAAa,EACpB,IAAI,SAAK,GACR,UAAU,CA4CZ;AAID;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,SAAK,GAAG,SAAS,EAAE,CAsBrE"}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ /**
3
+ * Model statistics — derived read-only summaries from an AnalysisModel.
4
+ *
5
+ * Emitters (markdown, HTML, JSON, etc.) should use these helpers instead
6
+ * of re-implementing counting/ranking logic.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.computeModelStats = computeModelStats;
10
+ exports.deriveHubs = deriveHubs;
11
+ // ── Public API ───────────────────────────────────────────────
12
+ /**
13
+ * Compute summary statistics from an AnalysisModel.
14
+ *
15
+ * @param model The analysis model to summarize
16
+ * @param topN How many top hubs to include (default 10)
17
+ */
18
+ function computeModelStats(model, topN = 10) {
19
+ // Language counts & total lines
20
+ const languageCounts = {};
21
+ let totalLines = 0;
22
+ for (const f of model.files) {
23
+ languageCounts[f.language] = (languageCounts[f.language] ?? 0) + 1;
24
+ totalLines += f.lineCount;
25
+ }
26
+ // Edge classification
27
+ let circularCount = 0;
28
+ let bidirectionalCount = 0;
29
+ for (const e of model.graph.edges) {
30
+ if (e.type === 'circular')
31
+ circularCount++;
32
+ if (e.bidirectional)
33
+ bidirectionalCount++;
34
+ }
35
+ // Symbol count
36
+ let symbolCount = 0;
37
+ for (const fs of model.symbols) {
38
+ symbolCount += fs.symbols.length;
39
+ }
40
+ // Hubs — use model.metrics.hubs if populated, otherwise derive from edges
41
+ let topHubs;
42
+ if (model.metrics.hubs.length > 0) {
43
+ topHubs = [...model.metrics.hubs]
44
+ .sort((a, b) => b.inDegree + b.outDegree - (a.inDegree + a.outDegree))
45
+ .slice(0, topN);
46
+ }
47
+ else {
48
+ topHubs = deriveHubs(model.graph.edges, topN);
49
+ }
50
+ return {
51
+ fileCount: model.files.length,
52
+ totalLines,
53
+ languageCounts,
54
+ languageCount: Object.keys(languageCounts).length,
55
+ edgeCount: model.graph.edges.length,
56
+ circularCount,
57
+ bidirectionalCount,
58
+ symbolCount,
59
+ topHubs,
60
+ };
61
+ }
62
+ // ── Hub computation ──────────────────────────────────────────
63
+ /**
64
+ * Derive top-N hub files from graph edges, ranked by total degree.
65
+ *
66
+ * Also used by analysis/repo.ts when building the initial model.
67
+ */
68
+ function deriveHubs(edges, topN = 10) {
69
+ const inDeg = new Map();
70
+ const outDeg = new Map();
71
+ for (const e of edges) {
72
+ outDeg.set(e.source, (outDeg.get(e.source) ?? 0) + 1);
73
+ inDeg.set(e.target, (inDeg.get(e.target) ?? 0) + 1);
74
+ }
75
+ const allFiles = new Set([...inDeg.keys(), ...outDeg.keys()]);
76
+ const hubs = [];
77
+ for (const file of allFiles) {
78
+ hubs.push({
79
+ file,
80
+ inDegree: inDeg.get(file) ?? 0,
81
+ outDegree: outDeg.get(file) ?? 0,
82
+ });
83
+ }
84
+ return hubs
85
+ .sort((a, b) => b.inDegree + b.outDegree - (a.inDegree + a.outDegree))
86
+ .slice(0, topN);
87
+ }
88
+ //# sourceMappingURL=stats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.js","sourceRoot":"","sources":["../src/stats.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAmCH,8CA+CC;AASD,gCAsBC;AAtFD,gEAAgE;AAEhE;;;;;GAKG;AACH,SAAgB,iBAAiB,CAC/B,KAAoB,EACpB,IAAI,GAAG,E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AAI,CAAC,IAAI,CAAC;YAC9B,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;SACjC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,IAAI;SACR,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;SACrE,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AACpB,CAAC"}
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@aspectcode/core",
3
+ "version": "0.3.0",
4
+ "private": true,
5
+ "description": "Pure-logic core for Aspect Code — no VS Code dependency",
6
+ "license": "MIT",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "files": [
10
+ "dist",
11
+ "parsers"
12
+ ],
13
+ "engines": {
14
+ "node": ">=18"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/asashepard/aspectcode.git",
22
+ "directory": "packages/core"
23
+ },
24
+ "scripts": {
25
+ "build": "tsc",
26
+ "typecheck": "tsc --noEmit",
27
+ "prepublishOnly": "npm run build",
28
+ "test": "mocha --require ts-node/register 'test/**/*.test.ts'",
29
+ "test:snapshot": "mocha --require ts-node/register 'test/snapshot.test.ts'"
30
+ },
31
+ "dependencies": {
32
+ "web-tree-sitter": "^0.21.0"
33
+ },
34
+ "devDependencies": {
35
+ "@types/mocha": "^10.0.0",
36
+ "@types/node": "^22.0.0",
37
+ "mocha": "^10.4.0",
38
+ "ts-node": "^10.9.2",
39
+ "typescript": "^5.5.4"
40
+ }
41
+ }
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Emitter interface — the contract for all artifact generators.
3
+ *
4
+ * Each emitter takes an AnalysisModel + options and writes files
5
+ * via the EmitterHost abstraction. Emitters MUST produce deterministic
6
+ * output for the same input (modulo `generatedAt` timestamps).
7
+ */
8
+ import type { AnalysisModel } from '@aspectcode/core';
9
+ import type { EmitterHost } from './host';
10
+ /** Mode for instruction content generation. */
11
+ export type InstructionsMode = 'safe' | 'permissive' | 'custom' | 'off';
12
+ /** Options passed to every emitter. */
13
+ export interface EmitOptions {
14
+ /** Absolute path to the workspace root. */
15
+ workspaceRoot: string;
16
+ /**
17
+ * Absolute path to the output root where generated artifacts are written.
18
+ *
19
+ * Defaults to `workspaceRoot`.
20
+ *
21
+ * This allows generating into a temp directory (tests/CLI/GitHub Action)
22
+ * without depending on CWD or VS Code workspace filesystem roots.
23
+ */
24
+ outDir?: string;
25
+ /**
26
+ * ISO-8601 timestamp to embed in outputs.
27
+ * Defaults to `new Date().toISOString()` if omitted.
28
+ * Pass a fixed value in tests for determinism.
29
+ */
30
+ generatedAt?: string;
31
+ /** Instruction content mode. */
32
+ instructionsMode?: InstructionsMode;
33
+ /** Pre-loaded file contents (avoids re-reading from disk). */
34
+ fileContents?: Map<string, string>;
35
+ /**
36
+ * Whether to generate the KB file (`kb.md`).
37
+ *
38
+ * Defaults to `false`. When `false`, only instruction files are emitted.
39
+ * Set to `true` to generate the knowledge base.
40
+ */
41
+ generateKb?: boolean;
42
+ /**
43
+ * List of output format IDs to emit instruction files for.
44
+ *
45
+ * When omitted or empty, only `AGENTS.md` is written (the universal target).
46
+ * Supported values: 'agents', 'copilot', 'cursor', 'claudeCode',
47
+ * 'windsurf', 'cline', 'gemini', 'aider', 'amazonq', 'codex'.
48
+ *
49
+ * AGENTS.md is always written regardless of this list.
50
+ */
51
+ outputFormats?: string[];
52
+ }
53
+ /** Result returned by an emitter after writing artifacts. */
54
+ export interface EmitResult {
55
+ /** Absolute paths of all files written or updated. */
56
+ filesWritten: string[];
57
+ }
58
+ /** A named artifact generator. */
59
+ export interface Emitter {
60
+ /** Human-readable name (e.g. "aspect-kb", "instructions"). */
61
+ readonly name: string;
62
+ /**
63
+ * Generate and write artifacts.
64
+ *
65
+ * @param model The analysis model to consume.
66
+ * @param host File I/O abstraction.
67
+ * @param options Generation options.
68
+ * @returns Paths of all files written.
69
+ */
70
+ emit(model: AnalysisModel, host: EmitterHost, options: EmitOptions): Promise<EmitResult>;
71
+ }
72
+ //# sourceMappingURL=emitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../src/emitter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAI1C,+CAA+C;AAC/C,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,YAAY,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExE,uCAAuC;AACvC,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,gCAAgC;IAChC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAEpC,8DAA8D;IAC9D,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEnC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAID,6DAA6D;AAC7D,MAAM,WAAW,UAAU;IACzB,sDAAsD;IACtD,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAID,kCAAkC;AAClC,MAAM,WAAW,OAAO;IACtB,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;;;OAOG;IACH,IAAI,CACF,KAAK,EAAE,aAAa,EACpB,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CAAC;CACxB"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * Emitter interface — the contract for all artifact generators.
4
+ *
5
+ * Each emitter takes an AnalysisModel + options and writes files
6
+ * via the EmitterHost abstraction. Emitters MUST produce deterministic
7
+ * output for the same input (modulo `generatedAt` timestamps).
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ //# sourceMappingURL=emitter.js.map