projscan 4.5.0 → 4.7.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 (703) hide show
  1. package/README.md +30 -16
  2. package/dist/analyzers/pythonDependencyRiskCheck.js +1 -1
  3. package/dist/analyzers/pythonDependencyRiskCheck.js.map +1 -1
  4. package/dist/cli/_shared.d.ts +4 -5
  5. package/dist/cli/_shared.js +34 -213
  6. package/dist/cli/_shared.js.map +1 -1
  7. package/dist/cli/architectureLayers.d.ts +2 -0
  8. package/dist/cli/architectureLayers.js +112 -0
  9. package/dist/cli/architectureLayers.js.map +1 -0
  10. package/dist/cli/bannerDisplay.d.ts +9 -0
  11. package/dist/cli/bannerDisplay.js +18 -0
  12. package/dist/cli/bannerDisplay.js.map +1 -0
  13. package/dist/cli/changedIssueFilter.d.ts +10 -0
  14. package/dist/cli/changedIssueFilter.js +24 -0
  15. package/dist/cli/changedIssueFilter.js.map +1 -0
  16. package/dist/cli/changedOnly.d.ts +16 -0
  17. package/dist/cli/changedOnly.js +28 -0
  18. package/dist/cli/changedOnly.js.map +1 -0
  19. package/dist/cli/commandPath.d.ts +2 -0
  20. package/dist/cli/commandPath.js +12 -0
  21. package/dist/cli/commandPath.js.map +1 -0
  22. package/dist/cli/commands/agentBrief.js +11 -0
  23. package/dist/cli/commands/agentBrief.js.map +1 -1
  24. package/dist/cli/commands/analyze.js +6 -5
  25. package/dist/cli/commands/analyze.js.map +1 -1
  26. package/dist/cli/commands/ci.js +5 -4
  27. package/dist/cli/commands/ci.js.map +1 -1
  28. package/dist/cli/commands/coordinate.js +27 -0
  29. package/dist/cli/commands/coordinate.js.map +1 -1
  30. package/dist/cli/commands/doctor.js +6 -5
  31. package/dist/cli/commands/doctor.js.map +1 -1
  32. package/dist/cli/formatOptions.d.ts +4 -0
  33. package/dist/cli/formatOptions.js +30 -0
  34. package/dist/cli/formatOptions.js.map +1 -0
  35. package/dist/cli/pluginReporter.d.ts +14 -0
  36. package/dist/cli/pluginReporter.js +46 -0
  37. package/dist/cli/pluginReporter.js.map +1 -0
  38. package/dist/cli/projectConfig.d.ts +12 -0
  39. package/dist/cli/projectConfig.js +41 -0
  40. package/dist/cli/projectConfig.js.map +1 -0
  41. package/dist/cli/treeSlice.d.ts +3 -0
  42. package/dist/cli/treeSlice.js +12 -0
  43. package/dist/cli/treeSlice.js.map +1 -0
  44. package/dist/core/agentBrief.js +6 -1
  45. package/dist/core/agentBrief.js.map +1 -1
  46. package/dist/core/ast.d.ts +4 -81
  47. package/dist/core/ast.js +11 -637
  48. package/dist/core/ast.js.map +1 -1
  49. package/dist/core/astBodySignals.d.ts +17 -0
  50. package/dist/core/astBodySignals.js +106 -0
  51. package/dist/core/astBodySignals.js.map +1 -0
  52. package/dist/core/astFunctionCollector.d.ts +11 -0
  53. package/dist/core/astFunctionCollector.js +140 -0
  54. package/dist/core/astFunctionCollector.js.map +1 -0
  55. package/dist/core/astFunctionNames.d.ts +2 -0
  56. package/dist/core/astFunctionNames.js +53 -0
  57. package/dist/core/astFunctionNames.js.map +1 -0
  58. package/dist/core/astFunctionNodes.d.ts +2 -0
  59. package/dist/core/astFunctionNodes.js +12 -0
  60. package/dist/core/astFunctionNodes.js.map +1 -0
  61. package/dist/core/astMembers.d.ts +14 -0
  62. package/dist/core/astMembers.js +145 -0
  63. package/dist/core/astMembers.js.map +1 -0
  64. package/dist/core/astModuleSignals.d.ts +3 -0
  65. package/dist/core/astModuleSignals.js +140 -0
  66. package/dist/core/astModuleSignals.js.map +1 -0
  67. package/dist/core/astParser.d.ts +11 -0
  68. package/dist/core/astParser.js +38 -0
  69. package/dist/core/astParser.js.map +1 -0
  70. package/dist/core/astProgramSignals.d.ts +11 -0
  71. package/dist/core/astProgramSignals.js +97 -0
  72. package/dist/core/astProgramSignals.js.map +1 -0
  73. package/dist/core/astTypes.d.ts +78 -0
  74. package/dist/core/astTypes.js +2 -0
  75. package/dist/core/astTypes.js.map +1 -0
  76. package/dist/core/bugHunt.js +2 -142
  77. package/dist/core/bugHunt.js.map +1 -1
  78. package/dist/core/bugHuntHotspotFindings.d.ts +2 -0
  79. package/dist/core/bugHuntHotspotFindings.js +68 -0
  80. package/dist/core/bugHuntHotspotFindings.js.map +1 -0
  81. package/dist/core/bugHuntPreflightFindings.d.ts +3 -0
  82. package/dist/core/bugHuntPreflightFindings.js +115 -0
  83. package/dist/core/bugHuntPreflightFindings.js.map +1 -0
  84. package/dist/core/codeGraph.d.ts +3 -35
  85. package/dist/core/codeGraph.js +7 -261
  86. package/dist/core/codeGraph.js.map +1 -1
  87. package/dist/core/codeGraphFanMetrics.d.ts +17 -0
  88. package/dist/core/codeGraphFanMetrics.js +89 -0
  89. package/dist/core/codeGraphFanMetrics.js.map +1 -0
  90. package/dist/core/codeGraphFileSelection.d.ts +7 -0
  91. package/dist/core/codeGraphFileSelection.js +19 -0
  92. package/dist/core/codeGraphFileSelection.js.map +1 -0
  93. package/dist/core/codeGraphIndexes.d.ts +23 -0
  94. package/dist/core/codeGraphIndexes.js +57 -0
  95. package/dist/core/codeGraphIndexes.js.map +1 -0
  96. package/dist/core/codeGraphParsing.d.ts +20 -0
  97. package/dist/core/codeGraphParsing.js +104 -0
  98. package/dist/core/codeGraphParsing.js.map +1 -0
  99. package/dist/core/codeGraphQueries.d.ts +9 -0
  100. package/dist/core/codeGraphQueries.js +25 -0
  101. package/dist/core/codeGraphQueries.js.map +1 -0
  102. package/dist/core/codeGraphTypes.d.ts +28 -0
  103. package/dist/core/codeGraphTypes.js +2 -0
  104. package/dist/core/codeGraphTypes.js.map +1 -0
  105. package/dist/core/collisionDetector.d.ts +2 -0
  106. package/dist/core/collisionDetector.js +17 -12
  107. package/dist/core/collisionDetector.js.map +1 -1
  108. package/dist/core/coordination.d.ts +4 -2
  109. package/dist/core/coordination.js +40 -4
  110. package/dist/core/coordination.js.map +1 -1
  111. package/dist/core/coordinationEvidence.d.ts +32 -0
  112. package/dist/core/coordinationEvidence.js +101 -0
  113. package/dist/core/coordinationEvidence.js.map +1 -0
  114. package/dist/core/dataflow.js +3 -338
  115. package/dist/core/dataflow.js.map +1 -1
  116. package/dist/core/dataflowDatabaseSinks.d.ts +8 -0
  117. package/dist/core/dataflowDatabaseSinks.js +78 -0
  118. package/dist/core/dataflowDatabaseSinks.js.map +1 -0
  119. package/dist/core/dataflowRiskAssembly.d.ts +11 -0
  120. package/dist/core/dataflowRiskAssembly.js +117 -0
  121. package/dist/core/dataflowRiskAssembly.js.map +1 -0
  122. package/dist/core/dataflowTraversal.d.ts +25 -0
  123. package/dist/core/dataflowTraversal.js +200 -0
  124. package/dist/core/dataflowTraversal.js.map +1 -0
  125. package/dist/core/fileAccess.d.ts +16 -0
  126. package/dist/core/fileAccess.js +78 -0
  127. package/dist/core/fileAccess.js.map +1 -0
  128. package/dist/core/fileExportTypes.d.ts +2 -0
  129. package/dist/core/fileExportTypes.js +16 -0
  130. package/dist/core/fileExportTypes.js.map +1 -0
  131. package/dist/core/fileGraphMetrics.d.ts +4 -0
  132. package/dist/core/fileGraphMetrics.js +34 -0
  133. package/dist/core/fileGraphMetrics.js.map +1 -0
  134. package/dist/core/fileInspectionEvidence.d.ts +13 -0
  135. package/dist/core/fileInspectionEvidence.js +14 -0
  136. package/dist/core/fileInspectionEvidence.js.map +1 -0
  137. package/dist/core/fileInspectionGraph.d.ts +5 -0
  138. package/dist/core/fileInspectionGraph.js +29 -0
  139. package/dist/core/fileInspectionGraph.js.map +1 -0
  140. package/dist/core/fileInspectionReport.d.ts +13 -0
  141. package/dist/core/fileInspectionReport.js +49 -0
  142. package/dist/core/fileInspectionReport.js.map +1 -0
  143. package/dist/core/fileInspector.d.ts +5 -13
  144. package/dist/core/fileInspector.js +8 -239
  145. package/dist/core/fileInspector.js.map +1 -1
  146. package/dist/core/fileIssues.d.ts +1 -0
  147. package/dist/core/fileIssues.js +18 -0
  148. package/dist/core/fileIssues.js.map +1 -0
  149. package/dist/core/filePurpose.d.ts +2 -0
  150. package/dist/core/filePurpose.js +61 -0
  151. package/dist/core/filePurpose.js.map +1 -0
  152. package/dist/core/fixSuggest.d.ts +1 -9
  153. package/dist/core/fixSuggest.js +2 -58
  154. package/dist/core/fixSuggest.js.map +1 -1
  155. package/dist/core/fixSuggestDependencyNames.d.ts +1 -0
  156. package/dist/core/fixSuggestDependencyNames.js +9 -0
  157. package/dist/core/fixSuggestDependencyNames.js.map +1 -0
  158. package/dist/core/fixSuggestPreview.d.ts +10 -0
  159. package/dist/core/fixSuggestPreview.js +87 -0
  160. package/dist/core/fixSuggestPreview.js.map +1 -0
  161. package/dist/core/frameworkExpressSources.d.ts +4 -0
  162. package/dist/core/frameworkExpressSources.js +95 -0
  163. package/dist/core/frameworkExpressSources.js.map +1 -0
  164. package/dist/core/frameworkFastifySources.d.ts +4 -0
  165. package/dist/core/frameworkFastifySources.js +74 -0
  166. package/dist/core/frameworkFastifySources.js.map +1 -0
  167. package/dist/core/frameworkHonoSources.d.ts +4 -0
  168. package/dist/core/frameworkHonoSources.js +80 -0
  169. package/dist/core/frameworkHonoSources.js.map +1 -0
  170. package/dist/core/frameworkKoaSources.d.ts +4 -0
  171. package/dist/core/frameworkKoaSources.js +81 -0
  172. package/dist/core/frameworkKoaSources.js.map +1 -0
  173. package/dist/core/frameworkNextRouteSources.d.ts +7 -0
  174. package/dist/core/frameworkNextRouteSources.js +85 -0
  175. package/dist/core/frameworkNextRouteSources.js.map +1 -0
  176. package/dist/core/frameworkRemixSources.d.ts +2 -0
  177. package/dist/core/frameworkRemixSources.js +63 -0
  178. package/dist/core/frameworkRemixSources.js.map +1 -0
  179. package/dist/core/frameworkSources.d.ts +15 -3
  180. package/dist/core/frameworkSources.js +42 -210
  181. package/dist/core/frameworkSources.js.map +1 -1
  182. package/dist/core/hotspotAnalyzer.d.ts +2 -18
  183. package/dist/core/hotspotAnalyzer.js +15 -477
  184. package/dist/core/hotspotAnalyzer.js.map +1 -1
  185. package/dist/core/hotspotBuilder.d.ts +14 -0
  186. package/dist/core/hotspotBuilder.js +70 -0
  187. package/dist/core/hotspotBuilder.js.map +1 -0
  188. package/dist/core/hotspotCandidates.d.ts +9 -0
  189. package/dist/core/hotspotCandidates.js +63 -0
  190. package/dist/core/hotspotCandidates.js.map +1 -0
  191. package/dist/core/hotspotGit.d.ts +10 -0
  192. package/dist/core/hotspotGit.js +152 -0
  193. package/dist/core/hotspotGit.js.map +1 -0
  194. package/dist/core/hotspotIssues.d.ts +2 -0
  195. package/dist/core/hotspotIssues.js +83 -0
  196. package/dist/core/hotspotIssues.js.map +1 -0
  197. package/dist/core/hotspotLines.d.ts +2 -0
  198. package/dist/core/hotspotLines.js +24 -0
  199. package/dist/core/hotspotLines.js.map +1 -0
  200. package/dist/core/hotspotMemory.d.ts +2 -0
  201. package/dist/core/hotspotMemory.js +21 -0
  202. package/dist/core/hotspotMemory.js.map +1 -0
  203. package/dist/core/hotspotRanking.d.ts +13 -0
  204. package/dist/core/hotspotRanking.js +44 -0
  205. package/dist/core/hotspotRanking.js.map +1 -0
  206. package/dist/core/hotspotScoring.d.ts +23 -0
  207. package/dist/core/hotspotScoring.js +128 -0
  208. package/dist/core/hotspotScoring.js.map +1 -0
  209. package/dist/core/indexCache.js +3 -1
  210. package/dist/core/indexCache.js.map +1 -1
  211. package/dist/core/intentRouter.d.ts +5 -28
  212. package/dist/core/intentRouter.js +8 -7376
  213. package/dist/core/intentRouter.js.map +1 -1
  214. package/dist/core/intentRouterCatalog.d.ts +16 -0
  215. package/dist/core/intentRouterCatalog.js +1709 -0
  216. package/dist/core/intentRouterCatalog.js.map +1 -0
  217. package/dist/core/intentRouterCoordinationSignals.d.ts +12 -0
  218. package/dist/core/intentRouterCoordinationSignals.js +111 -0
  219. package/dist/core/intentRouterCoordinationSignals.js.map +1 -0
  220. package/dist/core/intentRouterDependencySignals.d.ts +9 -0
  221. package/dist/core/intentRouterDependencySignals.js +226 -0
  222. package/dist/core/intentRouterDependencySignals.js.map +1 -0
  223. package/dist/core/intentRouterKeywordContext.d.ts +14 -0
  224. package/dist/core/intentRouterKeywordContext.js +2 -0
  225. package/dist/core/intentRouterKeywordContext.js.map +1 -0
  226. package/dist/core/intentRouterKeywordEarlyGuards.d.ts +2 -0
  227. package/dist/core/intentRouterKeywordEarlyGuards.js +127 -0
  228. package/dist/core/intentRouterKeywordEarlyGuards.js.map +1 -0
  229. package/dist/core/intentRouterKeywordMatches.d.ts +3 -0
  230. package/dist/core/intentRouterKeywordMatches.js +31 -0
  231. package/dist/core/intentRouterKeywordMatches.js.map +1 -0
  232. package/dist/core/intentRouterKeywordSearchGuards.d.ts +2 -0
  233. package/dist/core/intentRouterKeywordSearchGuards.js +239 -0
  234. package/dist/core/intentRouterKeywordSearchGuards.js.map +1 -0
  235. package/dist/core/intentRouterKeywordTargetGuards.d.ts +2 -0
  236. package/dist/core/intentRouterKeywordTargetGuards.js +191 -0
  237. package/dist/core/intentRouterKeywordTargetGuards.js.map +1 -0
  238. package/dist/core/intentRouterKeywordToolGuards.d.ts +2 -0
  239. package/dist/core/intentRouterKeywordToolGuards.js +133 -0
  240. package/dist/core/intentRouterKeywordToolGuards.js.map +1 -0
  241. package/dist/core/intentRouterKeywordWeights.d.ts +4 -0
  242. package/dist/core/intentRouterKeywordWeights.js +1197 -0
  243. package/dist/core/intentRouterKeywordWeights.js.map +1 -0
  244. package/dist/core/intentRouterPlanningSignals.d.ts +7 -0
  245. package/dist/core/intentRouterPlanningSignals.js +268 -0
  246. package/dist/core/intentRouterPlanningSignals.js.map +1 -0
  247. package/dist/core/intentRouterPrDiffSignals.d.ts +1 -0
  248. package/dist/core/intentRouterPrDiffSignals.js +41 -0
  249. package/dist/core/intentRouterPrDiffSignals.js.map +1 -0
  250. package/dist/core/intentRouterPreflightSignals.d.ts +3 -0
  251. package/dist/core/intentRouterPreflightSignals.js +54 -0
  252. package/dist/core/intentRouterPreflightSignals.js.map +1 -0
  253. package/dist/core/intentRouterRegressionKeywordMatches.d.ts +1 -0
  254. package/dist/core/intentRouterRegressionKeywordMatches.js +176 -0
  255. package/dist/core/intentRouterRegressionKeywordMatches.js.map +1 -0
  256. package/dist/core/intentRouterRegressionSignals.d.ts +10 -0
  257. package/dist/core/intentRouterRegressionSignals.js +207 -0
  258. package/dist/core/intentRouterRegressionSignals.js.map +1 -0
  259. package/dist/core/intentRouterReleaseSignals.d.ts +8 -0
  260. package/dist/core/intentRouterReleaseSignals.js +139 -0
  261. package/dist/core/intentRouterReleaseSignals.js.map +1 -0
  262. package/dist/core/intentRouterRepoSignals.d.ts +8 -0
  263. package/dist/core/intentRouterRepoSignals.js +226 -0
  264. package/dist/core/intentRouterRepoSignals.js.map +1 -0
  265. package/dist/core/intentRouterResult.d.ts +16 -0
  266. package/dist/core/intentRouterResult.js +34 -0
  267. package/dist/core/intentRouterResult.js.map +1 -0
  268. package/dist/core/intentRouterReviewSignals.d.ts +2 -0
  269. package/dist/core/intentRouterReviewSignals.js +109 -0
  270. package/dist/core/intentRouterReviewSignals.js.map +1 -0
  271. package/dist/core/intentRouterRiskSignals.d.ts +12 -0
  272. package/dist/core/intentRouterRiskSignals.js +242 -0
  273. package/dist/core/intentRouterRiskSignals.js.map +1 -0
  274. package/dist/core/intentRouterScoring.d.ts +9 -0
  275. package/dist/core/intentRouterScoring.js +40 -0
  276. package/dist/core/intentRouterScoring.js.map +1 -0
  277. package/dist/core/intentRouterSearchApiSignals.d.ts +1 -0
  278. package/dist/core/intentRouterSearchApiSignals.js +62 -0
  279. package/dist/core/intentRouterSearchApiSignals.js.map +1 -0
  280. package/dist/core/intentRouterSearchBackgroundSignals.d.ts +1 -0
  281. package/dist/core/intentRouterSearchBackgroundSignals.js +55 -0
  282. package/dist/core/intentRouterSearchBackgroundSignals.js.map +1 -0
  283. package/dist/core/intentRouterSearchCommunicationSignals.d.ts +1 -0
  284. package/dist/core/intentRouterSearchCommunicationSignals.js +74 -0
  285. package/dist/core/intentRouterSearchCommunicationSignals.js.map +1 -0
  286. package/dist/core/intentRouterSearchDataSignals.d.ts +2 -0
  287. package/dist/core/intentRouterSearchDataSignals.js +98 -0
  288. package/dist/core/intentRouterSearchDataSignals.js.map +1 -0
  289. package/dist/core/intentRouterSearchDomainSignals.d.ts +1 -0
  290. package/dist/core/intentRouterSearchDomainSignals.js +71 -0
  291. package/dist/core/intentRouterSearchDomainSignals.js.map +1 -0
  292. package/dist/core/intentRouterSearchInfraSignals.d.ts +1 -0
  293. package/dist/core/intentRouterSearchInfraSignals.js +79 -0
  294. package/dist/core/intentRouterSearchInfraSignals.js.map +1 -0
  295. package/dist/core/intentRouterSearchIntegrationSignals.d.ts +1 -0
  296. package/dist/core/intentRouterSearchIntegrationSignals.js +117 -0
  297. package/dist/core/intentRouterSearchIntegrationSignals.js.map +1 -0
  298. package/dist/core/intentRouterSearchLookupSignals.d.ts +10 -0
  299. package/dist/core/intentRouterSearchLookupSignals.js +310 -0
  300. package/dist/core/intentRouterSearchLookupSignals.js.map +1 -0
  301. package/dist/core/intentRouterSearchNavigationSignals.d.ts +1 -0
  302. package/dist/core/intentRouterSearchNavigationSignals.js +62 -0
  303. package/dist/core/intentRouterSearchNavigationSignals.js.map +1 -0
  304. package/dist/core/intentRouterSearchOwnershipSignals.d.ts +1 -0
  305. package/dist/core/intentRouterSearchOwnershipSignals.js +15 -0
  306. package/dist/core/intentRouterSearchOwnershipSignals.js.map +1 -0
  307. package/dist/core/intentRouterSearchPageSignals.d.ts +1 -0
  308. package/dist/core/intentRouterSearchPageSignals.js +84 -0
  309. package/dist/core/intentRouterSearchPageSignals.js.map +1 -0
  310. package/dist/core/intentRouterSearchReliabilitySignals.d.ts +1 -0
  311. package/dist/core/intentRouterSearchReliabilitySignals.js +94 -0
  312. package/dist/core/intentRouterSearchReliabilitySignals.js.map +1 -0
  313. package/dist/core/intentRouterSearchStateSignals.d.ts +1 -0
  314. package/dist/core/intentRouterSearchStateSignals.js +107 -0
  315. package/dist/core/intentRouterSearchStateSignals.js.map +1 -0
  316. package/dist/core/intentRouterSearchStyleSignals.d.ts +1 -0
  317. package/dist/core/intentRouterSearchStyleSignals.js +99 -0
  318. package/dist/core/intentRouterSearchStyleSignals.js.map +1 -0
  319. package/dist/core/intentRouterSearchTestSignals.d.ts +1 -0
  320. package/dist/core/intentRouterSearchTestSignals.js +34 -0
  321. package/dist/core/intentRouterSearchTestSignals.js.map +1 -0
  322. package/dist/core/intentRouterSearchToolingSignals.d.ts +1 -0
  323. package/dist/core/intentRouterSearchToolingSignals.js +106 -0
  324. package/dist/core/intentRouterSearchToolingSignals.js.map +1 -0
  325. package/dist/core/intentRouterSearchUiSignals.d.ts +1 -0
  326. package/dist/core/intentRouterSearchUiSignals.js +77 -0
  327. package/dist/core/intentRouterSearchUiSignals.js.map +1 -0
  328. package/dist/core/intentRouterSecuritySignals.d.ts +4 -0
  329. package/dist/core/intentRouterSecuritySignals.js +235 -0
  330. package/dist/core/intentRouterSecuritySignals.js.map +1 -0
  331. package/dist/core/intentRouterTargetSignals.d.ts +5 -0
  332. package/dist/core/intentRouterTargetSignals.js +76 -0
  333. package/dist/core/intentRouterTargetSignals.js.map +1 -0
  334. package/dist/core/intentRouterTokens.d.ts +1 -0
  335. package/dist/core/intentRouterTokens.js +36 -0
  336. package/dist/core/intentRouterTokens.js.map +1 -0
  337. package/dist/core/intentRouterUnderstandSignals.d.ts +1 -0
  338. package/dist/core/intentRouterUnderstandSignals.js +171 -0
  339. package/dist/core/intentRouterUnderstandSignals.js.map +1 -0
  340. package/dist/core/intentRouterVerificationSignals.d.ts +8 -0
  341. package/dist/core/intentRouterVerificationSignals.js +119 -0
  342. package/dist/core/intentRouterVerificationSignals.js.map +1 -0
  343. package/dist/core/intentRouterWorkSignals.d.ts +4 -0
  344. package/dist/core/intentRouterWorkSignals.js +175 -0
  345. package/dist/core/intentRouterWorkSignals.js.map +1 -0
  346. package/dist/core/languages/pythonLockfiles.d.ts +15 -0
  347. package/dist/core/languages/pythonLockfiles.js +210 -0
  348. package/dist/core/languages/pythonLockfiles.js.map +1 -0
  349. package/dist/core/languages/pythonManifestText.d.ts +7 -0
  350. package/dist/core/languages/pythonManifestText.js +25 -0
  351. package/dist/core/languages/pythonManifestText.js.map +1 -0
  352. package/dist/core/languages/pythonManifests.d.ts +6 -38
  353. package/dist/core/languages/pythonManifests.js +27 -316
  354. package/dist/core/languages/pythonManifests.js.map +1 -1
  355. package/dist/core/languages/pythonPep508.d.ts +4 -0
  356. package/dist/core/languages/pythonPep508.js +14 -0
  357. package/dist/core/languages/pythonPep508.js.map +1 -0
  358. package/dist/core/languages/pythonProjectEvidence.d.ts +2 -0
  359. package/dist/core/languages/pythonProjectEvidence.js +29 -0
  360. package/dist/core/languages/pythonProjectEvidence.js.map +1 -0
  361. package/dist/core/languages/pythonProjectTypes.d.ts +31 -0
  362. package/dist/core/languages/pythonProjectTypes.js +2 -0
  363. package/dist/core/languages/pythonProjectTypes.js.map +1 -0
  364. package/dist/core/languages/pythonPyproject.d.ts +2 -0
  365. package/dist/core/languages/pythonPyproject.js +160 -0
  366. package/dist/core/languages/pythonPyproject.js.map +1 -0
  367. package/dist/core/languages/pythonRequirements.d.ts +9 -0
  368. package/dist/core/languages/pythonRequirements.js +212 -0
  369. package/dist/core/languages/pythonRequirements.js.map +1 -0
  370. package/dist/core/languages/pythonRoots.d.ts +3 -0
  371. package/dist/core/languages/pythonRoots.js +83 -0
  372. package/dist/core/languages/pythonRoots.js.map +1 -0
  373. package/dist/core/languages/pythonSetuptools.d.ts +6 -0
  374. package/dist/core/languages/pythonSetuptools.js +58 -0
  375. package/dist/core/languages/pythonSetuptools.js.map +1 -0
  376. package/dist/core/pluginManifestValidation.d.ts +41 -0
  377. package/dist/core/pluginManifestValidation.js +179 -0
  378. package/dist/core/pluginManifestValidation.js.map +1 -0
  379. package/dist/core/plugins.d.ts +3 -41
  380. package/dist/core/plugins.js +2 -129
  381. package/dist/core/plugins.js.map +1 -1
  382. package/dist/core/prDiff.js +12 -0
  383. package/dist/core/prDiff.js.map +1 -1
  384. package/dist/core/preflight.d.ts +3 -3
  385. package/dist/core/preflight.js +28 -542
  386. package/dist/core/preflight.js.map +1 -1
  387. package/dist/core/preflightChangedFileReasons.d.ts +14 -0
  388. package/dist/core/preflightChangedFileReasons.js +75 -0
  389. package/dist/core/preflightChangedFileReasons.js.map +1 -0
  390. package/dist/core/preflightChangedFiles.d.ts +9 -0
  391. package/dist/core/preflightChangedFiles.js +34 -0
  392. package/dist/core/preflightChangedFiles.js.map +1 -0
  393. package/dist/core/preflightContextReasons.d.ts +17 -0
  394. package/dist/core/preflightContextReasons.js +73 -0
  395. package/dist/core/preflightContextReasons.js.map +1 -0
  396. package/dist/core/preflightEvidence.d.ts +34 -0
  397. package/dist/core/preflightEvidence.js +119 -0
  398. package/dist/core/preflightEvidence.js.map +1 -0
  399. package/dist/core/preflightInputs.d.ts +15 -0
  400. package/dist/core/preflightInputs.js +31 -0
  401. package/dist/core/preflightInputs.js.map +1 -0
  402. package/dist/core/preflightIssueReasons.d.ts +2 -0
  403. package/dist/core/preflightIssueReasons.js +39 -0
  404. package/dist/core/preflightIssueReasons.js.map +1 -0
  405. package/dist/core/preflightLocalEvidence.d.ts +12 -0
  406. package/dist/core/preflightLocalEvidence.js +36 -0
  407. package/dist/core/preflightLocalEvidence.js.map +1 -0
  408. package/dist/core/preflightReleaseScale.d.ts +28 -0
  409. package/dist/core/preflightReleaseScale.js +95 -0
  410. package/dist/core/preflightReleaseScale.js.map +1 -0
  411. package/dist/core/preflightRequiredChecks.d.ts +26 -0
  412. package/dist/core/preflightRequiredChecks.js +96 -0
  413. package/dist/core/preflightRequiredChecks.js.map +1 -0
  414. package/dist/core/preflightReviewEvidence.d.ts +16 -0
  415. package/dist/core/preflightReviewEvidence.js +31 -0
  416. package/dist/core/preflightReviewEvidence.js.map +1 -0
  417. package/dist/core/preflightReviewReasons.d.ts +15 -0
  418. package/dist/core/preflightReviewReasons.js +76 -0
  419. package/dist/core/preflightReviewReasons.js.map +1 -0
  420. package/dist/core/preflightSuggestedActions.d.ts +15 -0
  421. package/dist/core/preflightSuggestedActions.js +84 -0
  422. package/dist/core/preflightSuggestedActions.js.map +1 -0
  423. package/dist/core/preflightTruncation.d.ts +6 -0
  424. package/dist/core/preflightTruncation.js +7 -0
  425. package/dist/core/preflightTruncation.js.map +1 -0
  426. package/dist/core/preflightVerdict.d.ts +3 -0
  427. package/dist/core/preflightVerdict.js +17 -0
  428. package/dist/core/preflightVerdict.js.map +1 -0
  429. package/dist/core/regressionPlan.d.ts +2 -1
  430. package/dist/core/regressionPlan.js +7 -1
  431. package/dist/core/regressionPlan.js.map +1 -1
  432. package/dist/core/releaseEvidence.d.ts +4 -3
  433. package/dist/core/releaseEvidence.js +17 -382
  434. package/dist/core/releaseEvidence.js.map +1 -1
  435. package/dist/core/releaseEvidenceArtifacts.d.ts +3 -0
  436. package/dist/core/releaseEvidenceArtifacts.js +65 -0
  437. package/dist/core/releaseEvidenceArtifacts.js.map +1 -0
  438. package/dist/core/releaseEvidenceBaseline.d.ts +2 -0
  439. package/dist/core/releaseEvidenceBaseline.js +28 -0
  440. package/dist/core/releaseEvidenceBaseline.js.map +1 -0
  441. package/dist/core/releaseEvidencePrSummary.d.ts +13 -0
  442. package/dist/core/releaseEvidencePrSummary.js +240 -0
  443. package/dist/core/releaseEvidencePrSummary.js.map +1 -0
  444. package/dist/core/releaseEvidenceVerdict.d.ts +6 -0
  445. package/dist/core/releaseEvidenceVerdict.js +54 -0
  446. package/dist/core/releaseEvidenceVerdict.js.map +1 -0
  447. package/dist/core/releaseTrain.js +3 -317
  448. package/dist/core/releaseTrain.js.map +1 -1
  449. package/dist/core/releaseTrainFallbacks.d.ts +3 -0
  450. package/dist/core/releaseTrainFallbacks.js +318 -0
  451. package/dist/core/releaseTrainFallbacks.js.map +1 -0
  452. package/dist/core/reportPathRedaction.d.ts +4 -0
  453. package/dist/core/reportPathRedaction.js +64 -0
  454. package/dist/core/reportPathRedaction.js.map +1 -0
  455. package/dist/core/reportScope.d.ts +7 -0
  456. package/dist/core/reportScope.js +16 -86
  457. package/dist/core/reportScope.js.map +1 -1
  458. package/dist/core/reportScopeFiltering.d.ts +9 -0
  459. package/dist/core/reportScopeFiltering.js +102 -0
  460. package/dist/core/reportScopeFiltering.js.map +1 -0
  461. package/dist/core/review.d.ts +2 -25
  462. package/dist/core/review.js +34 -1034
  463. package/dist/core/review.js.map +1 -1
  464. package/dist/core/reviewBaseSnapshot.d.ts +14 -0
  465. package/dist/core/reviewBaseSnapshot.js +41 -0
  466. package/dist/core/reviewBaseSnapshot.js.map +1 -0
  467. package/dist/core/reviewChangedFiles.d.ts +8 -0
  468. package/dist/core/reviewChangedFiles.js +63 -0
  469. package/dist/core/reviewChangedFiles.js.map +1 -0
  470. package/dist/core/reviewContractChanges.d.ts +5 -0
  471. package/dist/core/reviewContractChanges.js +114 -0
  472. package/dist/core/reviewContractChanges.js.map +1 -0
  473. package/dist/core/reviewCycles.d.ts +7 -0
  474. package/dist/core/reviewCycles.js +53 -0
  475. package/dist/core/reviewCycles.js.map +1 -0
  476. package/dist/core/reviewFindings.d.ts +17 -0
  477. package/dist/core/reviewFindings.js +49 -0
  478. package/dist/core/reviewFindings.js.map +1 -0
  479. package/dist/core/reviewFlowDiffs.d.ts +4 -0
  480. package/dist/core/reviewFlowDiffs.js +99 -0
  481. package/dist/core/reviewFlowDiffs.js.map +1 -0
  482. package/dist/core/reviewGit.d.ts +7 -0
  483. package/dist/core/reviewGit.js +45 -0
  484. package/dist/core/reviewGit.js.map +1 -0
  485. package/dist/core/reviewGraphEvidence.d.ts +3 -0
  486. package/dist/core/reviewGraphEvidence.js +55 -0
  487. package/dist/core/reviewGraphEvidence.js.map +1 -0
  488. package/dist/core/reviewHeadSnapshot.d.ts +8 -0
  489. package/dist/core/reviewHeadSnapshot.js +15 -0
  490. package/dist/core/reviewHeadSnapshot.js.map +1 -0
  491. package/dist/core/reviewIntent.d.ts +2 -0
  492. package/dist/core/reviewIntent.js +18 -0
  493. package/dist/core/reviewIntent.js.map +1 -0
  494. package/dist/core/reviewManifests.d.ts +12 -0
  495. package/dist/core/reviewManifests.js +124 -0
  496. package/dist/core/reviewManifests.js.map +1 -0
  497. package/dist/core/reviewNoChanges.d.ts +9 -0
  498. package/dist/core/reviewNoChanges.js +26 -0
  499. package/dist/core/reviewNoChanges.js.map +1 -0
  500. package/dist/core/reviewPackageScope.d.ts +4 -0
  501. package/dist/core/reviewPackageScope.js +24 -0
  502. package/dist/core/reviewPackageScope.js.map +1 -0
  503. package/dist/core/reviewRefs.d.ts +4 -0
  504. package/dist/core/reviewRefs.js +65 -0
  505. package/dist/core/reviewRefs.js.map +1 -0
  506. package/dist/core/reviewRiskyFunctions.d.ts +8 -0
  507. package/dist/core/reviewRiskyFunctions.js +83 -0
  508. package/dist/core/reviewRiskyFunctions.js.map +1 -0
  509. package/dist/core/reviewState.d.ts +21 -0
  510. package/dist/core/reviewState.js +96 -0
  511. package/dist/core/reviewState.js.map +1 -0
  512. package/dist/core/reviewTier.d.ts +18 -0
  513. package/dist/core/reviewTier.js +99 -0
  514. package/dist/core/reviewTier.js.map +1 -0
  515. package/dist/core/reviewVerdict.d.ts +9 -0
  516. package/dist/core/reviewVerdict.js +121 -0
  517. package/dist/core/reviewVerdict.js.map +1 -0
  518. package/dist/core/searchIndex.d.ts +2 -14
  519. package/dist/core/searchIndex.js +4 -227
  520. package/dist/core/searchIndex.js.map +1 -1
  521. package/dist/core/searchIndexFiles.d.ts +1 -0
  522. package/dist/core/searchIndexFiles.js +26 -0
  523. package/dist/core/searchIndexFiles.js.map +1 -0
  524. package/dist/core/searchIndexText.d.ts +15 -0
  525. package/dist/core/searchIndexText.js +204 -0
  526. package/dist/core/searchIndexText.js.map +1 -0
  527. package/dist/core/start.d.ts +1 -1
  528. package/dist/core/start.js +14 -87
  529. package/dist/core/start.js.map +1 -1
  530. package/dist/core/startAdoptionGaps.d.ts +3 -0
  531. package/dist/core/startAdoptionGaps.js +12 -0
  532. package/dist/core/startAdoptionGaps.js.map +1 -0
  533. package/dist/core/startEvidence.d.ts +1 -1
  534. package/dist/core/startEvidence.js +16 -1
  535. package/dist/core/startEvidence.js.map +1 -1
  536. package/dist/core/startInputs.d.ts +32 -0
  537. package/dist/core/startInputs.js +30 -0
  538. package/dist/core/startInputs.js.map +1 -0
  539. package/dist/core/startMissionPolicy.js +10 -0
  540. package/dist/core/startMissionPolicy.js.map +1 -1
  541. package/dist/core/startMode.js +7 -1
  542. package/dist/core/startMode.js.map +1 -1
  543. package/dist/core/startReportBuilder.d.ts +26 -0
  544. package/dist/core/startReportBuilder.js +45 -0
  545. package/dist/core/startReportBuilder.js.map +1 -0
  546. package/dist/core/startReportContext.d.ts +23 -0
  547. package/dist/core/startReportContext.js +51 -0
  548. package/dist/core/startReportContext.js.map +1 -0
  549. package/dist/core/startRoadmapPreview.d.ts +2 -0
  550. package/dist/core/startRoadmapPreview.js +31 -0
  551. package/dist/core/startRoadmapPreview.js.map +1 -0
  552. package/dist/core/taint.d.ts +2 -67
  553. package/dist/core/taint.js +41 -276
  554. package/dist/core/taint.js.map +1 -1
  555. package/dist/core/taintIndex.d.ts +20 -0
  556. package/dist/core/taintIndex.js +81 -0
  557. package/dist/core/taintIndex.js.map +1 -0
  558. package/dist/core/taintMatching.d.ts +11 -0
  559. package/dist/core/taintMatching.js +126 -0
  560. package/dist/core/taintMatching.js.map +1 -0
  561. package/dist/core/taintTraversal.d.ts +8 -0
  562. package/dist/core/taintTraversal.js +113 -0
  563. package/dist/core/taintTraversal.js.map +1 -0
  564. package/dist/core/taintTypes.d.ts +67 -0
  565. package/dist/core/taintTypes.js +2 -0
  566. package/dist/core/taintTypes.js.map +1 -0
  567. package/dist/core/telemetry.js +36 -30
  568. package/dist/core/telemetry.js.map +1 -1
  569. package/dist/core/upgradePreview.d.ts +1 -12
  570. package/dist/core/upgradePreview.js +9 -229
  571. package/dist/core/upgradePreview.js.map +1 -1
  572. package/dist/core/upgradePreviewNpmEvidence.d.ts +19 -0
  573. package/dist/core/upgradePreviewNpmEvidence.js +164 -0
  574. package/dist/core/upgradePreviewNpmEvidence.js.map +1 -0
  575. package/dist/core/upgradePreviewPython.d.ts +2 -0
  576. package/dist/core/upgradePreviewPython.js +71 -0
  577. package/dist/core/upgradePreviewPython.js.map +1 -0
  578. package/dist/index.d.ts +6 -12
  579. package/dist/index.js +2 -3
  580. package/dist/index.js.map +1 -1
  581. package/dist/mcp/server.d.ts +3 -24
  582. package/dist/mcp/server.js +32 -414
  583. package/dist/mcp/server.js.map +1 -1
  584. package/dist/mcp/serverContext.d.ts +6 -0
  585. package/dist/mcp/serverContext.js +55 -0
  586. package/dist/mcp/serverContext.js.map +1 -0
  587. package/dist/mcp/serverDispatch.d.ts +39 -0
  588. package/dist/mcp/serverDispatch.js +74 -0
  589. package/dist/mcp/serverDispatch.js.map +1 -0
  590. package/dist/mcp/serverHandlers.d.ts +15 -0
  591. package/dist/mcp/serverHandlers.js +94 -0
  592. package/dist/mcp/serverHandlers.js.map +1 -0
  593. package/dist/mcp/serverLifecycle.d.ts +14 -0
  594. package/dist/mcp/serverLifecycle.js +65 -0
  595. package/dist/mcp/serverLifecycle.js.map +1 -0
  596. package/dist/mcp/serverMessage.d.ts +11 -0
  597. package/dist/mcp/serverMessage.js +37 -0
  598. package/dist/mcp/serverMessage.js.map +1 -0
  599. package/dist/mcp/serverSession.d.ts +6 -0
  600. package/dist/mcp/serverSession.js +77 -0
  601. package/dist/mcp/serverSession.js.map +1 -0
  602. package/dist/mcp/serverStdio.d.ts +7 -0
  603. package/dist/mcp/serverStdio.js +34 -0
  604. package/dist/mcp/serverStdio.js.map +1 -0
  605. package/dist/mcp/serverTypes.d.ts +18 -0
  606. package/dist/mcp/serverTypes.js +2 -0
  607. package/dist/mcp/serverTypes.js.map +1 -0
  608. package/dist/mcp/serverVersion.d.ts +1 -0
  609. package/dist/mcp/serverVersion.js +17 -0
  610. package/dist/mcp/serverVersion.js.map +1 -0
  611. package/dist/mcp/toolCatalog.d.ts +2 -0
  612. package/dist/mcp/toolCatalog.js +93 -0
  613. package/dist/mcp/toolCatalog.js.map +1 -0
  614. package/dist/mcp/tools.d.ts +2 -3
  615. package/dist/mcp/tools.js +15 -108
  616. package/dist/mcp/tools.js.map +1 -1
  617. package/dist/projscan-sbom.cdx.json +6 -6
  618. package/dist/reporters/consoleFixReporter.d.ts +3 -0
  619. package/dist/reporters/consoleFixReporter.js +41 -0
  620. package/dist/reporters/consoleFixReporter.js.map +1 -0
  621. package/dist/reporters/consoleReporter.d.ts +1 -3
  622. package/dist/reporters/consoleReporter.js +1 -42
  623. package/dist/reporters/consoleReporter.js.map +1 -1
  624. package/dist/reporters/htmlReporter.d.ts +3 -2
  625. package/dist/reporters/htmlReporter.js +14 -2
  626. package/dist/reporters/htmlReporter.js.map +1 -1
  627. package/dist/reporters/jsonReporter.d.ts +4 -3
  628. package/dist/reporters/jsonReporter.js +9 -4
  629. package/dist/reporters/jsonReporter.js.map +1 -1
  630. package/dist/reporters/markdownAnalysisReporter.d.ts +2 -1
  631. package/dist/reporters/markdownAnalysisReporter.js +8 -1
  632. package/dist/reporters/markdownAnalysisReporter.js.map +1 -1
  633. package/dist/reporters/markdownArchitectureReporter.d.ts +3 -0
  634. package/dist/reporters/markdownArchitectureReporter.js +33 -0
  635. package/dist/reporters/markdownArchitectureReporter.js.map +1 -0
  636. package/dist/reporters/markdownCouplingReporter.d.ts +2 -0
  637. package/dist/reporters/markdownCouplingReporter.js +43 -0
  638. package/dist/reporters/markdownCouplingReporter.js.map +1 -0
  639. package/dist/reporters/markdownCoverageReporter.d.ts +2 -0
  640. package/dist/reporters/markdownCoverageReporter.js +40 -0
  641. package/dist/reporters/markdownCoverageReporter.js.map +1 -0
  642. package/dist/reporters/markdownExplanationReporter.d.ts +2 -0
  643. package/dist/reporters/markdownExplanationReporter.js +37 -0
  644. package/dist/reporters/markdownExplanationReporter.js.map +1 -0
  645. package/dist/reporters/markdownHealthReporter.d.ts +4 -0
  646. package/dist/reporters/markdownHealthReporter.js +66 -0
  647. package/dist/reporters/markdownHealthReporter.js.map +1 -0
  648. package/dist/reporters/markdownHotspotReporter.d.ts +2 -0
  649. package/dist/reporters/markdownHotspotReporter.js +36 -0
  650. package/dist/reporters/markdownHotspotReporter.js.map +1 -0
  651. package/dist/reporters/markdownOutdatedReporter.d.ts +2 -0
  652. package/dist/reporters/markdownOutdatedReporter.js +31 -0
  653. package/dist/reporters/markdownOutdatedReporter.js.map +1 -0
  654. package/dist/reporters/markdownPrDiffReporter.d.ts +2 -0
  655. package/dist/reporters/markdownPrDiffReporter.js +63 -0
  656. package/dist/reporters/markdownPrDiffReporter.js.map +1 -0
  657. package/dist/reporters/markdownReporter.d.ts +9 -12
  658. package/dist/reporters/markdownReporter.js +9 -288
  659. package/dist/reporters/markdownReporter.js.map +1 -1
  660. package/dist/reporters/markdownWorkspaceReporter.d.ts +2 -0
  661. package/dist/reporters/markdownWorkspaceReporter.js +25 -0
  662. package/dist/reporters/markdownWorkspaceReporter.js.map +1 -0
  663. package/dist/reporters/sarifReporter.d.ts +6 -4
  664. package/dist/reporters/sarifReporter.js +8 -7
  665. package/dist/reporters/sarifReporter.js.map +1 -1
  666. package/dist/tool-manifest.json +3 -3
  667. package/dist/types/start.d.ts +14 -0
  668. package/dist/types.d.ts +34 -34
  669. package/dist/utils/config.d.ts +2 -8
  670. package/dist/utils/config.js +13 -211
  671. package/dist/utils/config.js.map +1 -1
  672. package/dist/utils/configBasics.d.ts +5 -0
  673. package/dist/utils/configBasics.js +21 -0
  674. package/dist/utils/configBasics.js.map +1 -0
  675. package/dist/utils/configHotspots.d.ts +2 -0
  676. package/dist/utils/configHotspots.js +15 -0
  677. package/dist/utils/configHotspots.js.map +1 -0
  678. package/dist/utils/configIssueRules.d.ts +8 -0
  679. package/dist/utils/configIssueRules.js +24 -0
  680. package/dist/utils/configIssueRules.js.map +1 -0
  681. package/dist/utils/configMonorepo.d.ts +2 -0
  682. package/dist/utils/configMonorepo.js +38 -0
  683. package/dist/utils/configMonorepo.js.map +1 -0
  684. package/dist/utils/configReportPolicies.d.ts +2 -0
  685. package/dist/utils/configReportPolicies.js +32 -0
  686. package/dist/utils/configReportPolicies.js.map +1 -0
  687. package/dist/utils/configScan.d.ts +2 -0
  688. package/dist/utils/configScan.js +15 -0
  689. package/dist/utils/configScan.js.map +1 -0
  690. package/dist/utils/configSeverity.d.ts +2 -0
  691. package/dist/utils/configSeverity.js +15 -0
  692. package/dist/utils/configSeverity.js.map +1 -0
  693. package/dist/utils/configSources.d.ts +5 -0
  694. package/dist/utils/configSources.js +55 -0
  695. package/dist/utils/configSources.js.map +1 -0
  696. package/dist/utils/configTaint.d.ts +2 -0
  697. package/dist/utils/configTaint.js +15 -0
  698. package/dist/utils/configTaint.js.map +1 -0
  699. package/docs/GUIDE.md +22 -11
  700. package/docs/ROADMAP.md +18 -7
  701. package/docs/examples/adoption-workflows.md +2 -2
  702. package/docs/examples/swarm-coordination.md +11 -0
  703. package/package.json +1 -1
@@ -0,0 +1,14 @@
1
+ import { indexIssuesByFile } from './hotspotIssues.js';
2
+ export function collectFileInspectionEvidence(input) {
3
+ const relatedIssueIds = new Set(indexIssuesByFile(input.issues, input.files).get(input.relativePath) ?? []);
4
+ return {
5
+ hotspot: findHotspotForFile(input.hotspots, input.relativePath),
6
+ issues: input.issues.filter((issue) => relatedIssueIds.has(issue.id)),
7
+ };
8
+ }
9
+ function findHotspotForFile(report, relativePath) {
10
+ if (!report || !report.available)
11
+ return null;
12
+ return report.hotspots.find((h) => h.relativePath === relativePath) ?? null;
13
+ }
14
+ //# sourceMappingURL=fileInspectionEvidence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileInspectionEvidence.js","sourceRoot":"","sources":["../../src/core/fileInspectionEvidence.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAcvD,MAAM,UAAU,6BAA6B,CAC3C,KAAkC;IAElC,MAAM,eAAe,GAAG,IAAI,GAAG,CAC7B,iBAAiB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,CAC3E,CAAC;IAEF,OAAO;QACL,OAAO,EAAE,kBAAkB,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;QAC/D,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;KACtE,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CACzB,MAAiC,EACjC,YAAoB;IAEpB,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC9C,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,YAAY,CAAC,IAAI,IAAI,CAAC;AAC9E,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { ExportInfo, FileEntry, ImportInfo } from '../types.js';
2
+ import { type CodeGraph, type GraphFile } from './codeGraph.js';
3
+ export declare function resolveInspectionGraph(resolvedRoot: string, files: FileEntry[], graph: CodeGraph | undefined): Promise<CodeGraph>;
4
+ export declare function importsFromGraphFile(graphFile: GraphFile | undefined): ImportInfo[];
5
+ export declare function exportsFromGraphFile(graphFile: GraphFile | undefined): ExportInfo[];
@@ -0,0 +1,29 @@
1
+ import { buildCodeGraph } from './codeGraph.js';
2
+ import { mapExportType } from './fileExportTypes.js';
3
+ import { loadCachedGraph, saveCachedGraph } from './indexCache.js';
4
+ export async function resolveInspectionGraph(resolvedRoot, files, graph) {
5
+ if (graph)
6
+ return graph;
7
+ const cached = await loadCachedGraph(resolvedRoot);
8
+ const built = await buildCodeGraph(resolvedRoot, files, cached);
9
+ await saveCachedGraph(resolvedRoot, built);
10
+ return built;
11
+ }
12
+ export function importsFromGraphFile(graphFile) {
13
+ if (!graphFile)
14
+ return [];
15
+ return graphFile.imports.map((i) => ({
16
+ source: i.source,
17
+ specifiers: i.specifiers,
18
+ isRelative: i.source.startsWith('.') || i.source.startsWith('/'),
19
+ }));
20
+ }
21
+ export function exportsFromGraphFile(graphFile) {
22
+ if (!graphFile)
23
+ return [];
24
+ return graphFile.exports.map((e) => ({
25
+ name: e.name,
26
+ type: mapExportType(e.kind),
27
+ }));
28
+ }
29
+ //# sourceMappingURL=fileInspectionGraph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileInspectionGraph.js","sourceRoot":"","sources":["../../src/core/fileInspectionGraph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAkC,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEnE,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,YAAoB,EACpB,KAAkB,EAClB,KAA4B;IAE5B,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IACxB,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,YAAY,CAAC,CAAC;IACnD,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAChE,MAAM,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC3C,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,SAAgC;IACnE,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAC1B,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACnC,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC;KACjE,CAAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,SAAgC;IACnE,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAC1B,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACnC,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;KAC5B,CAAC,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { FileEntry, FileInspection, HotspotReport, Issue } from '../types.js';
2
+ import type { ProjectFileRead } from './fileAccess.js';
3
+ import type { CodeGraph } from './codeGraph.js';
4
+ export interface InspectOptions {
5
+ scan?: {
6
+ files: FileEntry[];
7
+ };
8
+ issues?: Issue[];
9
+ hotspots?: HotspotReport;
10
+ /** If provided, prefer graph-derived imports/exports over regex parsing. */
11
+ graph?: CodeGraph;
12
+ }
13
+ export declare function inspectExistingProjectFile(file: ProjectFileRead, options?: InspectOptions): Promise<FileInspection>;
@@ -0,0 +1,49 @@
1
+ import { scanRepository } from './repositoryScanner.js';
2
+ import { collectIssues } from './issueEngine.js';
3
+ import { analyzeHotspots } from './hotspotAnalyzer.js';
4
+ import { getAdapterFor } from './languages/registry.js';
5
+ import { exportsFromGraphFile, importsFromGraphFile, resolveInspectionGraph, } from './fileInspectionGraph.js';
6
+ import { collectFileInspectionEvidence } from './fileInspectionEvidence.js';
7
+ import { deriveFileGraphMetrics } from './fileGraphMetrics.js';
8
+ import { detectFileIssues } from './fileIssues.js';
9
+ import { inferPurpose } from './filePurpose.js';
10
+ export async function inspectExistingProjectFile(file, options = {}) {
11
+ const { resolvedRoot, absolutePath, relativePath, content, sizeBytes } = file;
12
+ const lines = content.split('\n');
13
+ const adapter = getAdapterFor(relativePath);
14
+ const language = adapter?.id;
15
+ const files = options.scan?.files ?? (await scanRepository(resolvedRoot)).files;
16
+ const issues = options.issues ?? (await collectIssues(resolvedRoot, files));
17
+ const graph = await resolveInspectionGraph(resolvedRoot, files, options.graph);
18
+ const graphFile = graph.files.get(relativePath);
19
+ const imports = importsFromGraphFile(graphFile);
20
+ const exports = exportsFromGraphFile(graphFile);
21
+ const purpose = inferPurpose(absolutePath, exports);
22
+ const potentialIssues = detectFileIssues(content, lines.length);
23
+ const hotspotReport = options.hotspots ?? (await analyzeHotspots(resolvedRoot, files, issues, { limit: 100, graph }));
24
+ const relatedEvidence = collectFileInspectionEvidence({
25
+ files,
26
+ issues,
27
+ hotspots: hotspotReport,
28
+ relativePath,
29
+ });
30
+ const graphMetrics = deriveFileGraphMetrics(graph, relativePath);
31
+ return {
32
+ relativePath,
33
+ exists: true,
34
+ purpose,
35
+ lineCount: lines.length,
36
+ sizeBytes,
37
+ imports,
38
+ exports,
39
+ potentialIssues,
40
+ hotspot: relatedEvidence.hotspot,
41
+ issues: relatedEvidence.issues,
42
+ cyclomaticComplexity: graphMetrics.cyclomaticComplexity,
43
+ fanIn: graphMetrics.fanIn,
44
+ fanOut: graphMetrics.fanOut,
45
+ language,
46
+ functions: graphMetrics.functions,
47
+ };
48
+ }
49
+ //# sourceMappingURL=fileInspectionReport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileInspectionReport.js","sourceRoot":"","sources":["../../src/core/fileInspectionReport.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAA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AM,eAAe,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAElG,MAAM,eAAe,GAAG,6BAA6B,CAAC;QACpD,KAAK;QACL,MAAM;QACN,QAAQ,EAAE,aAAa;QACvB,YAAY;KACb,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,sBAAsB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IAEjE,OAAO;QACL,YAAY;QACZ,MAAM,EAAE,IAAI;QACZ,OAAO;QACP,SAAS,EAAE,KAAK,CAAC,MAAM;QACvB,SAAS;QACT,OAAO;QACP,OAAO;QACP,eAAe;QACf,OAAO,EAAE,eAAe,CAAC,OAAO;QAChC,MAAM,EAAE,eAAe,CAAC,MAAM;QAC9B,oBAAoB,EAAE,YAAY,CAAC,oBAAoB;QACvD,KAAK,EAAE,YAAY,CAAC,KAAK;QACzB,MAAM,EAAE,YAAY,CAAC,MAAM;QAC3B,QAAQ;QACR,SAAS,EAAE,YAAY,CAAC,SAAS;KAClC,CAAC;AACJ,CAAC"}
@@ -1,15 +1,7 @@
1
- import type { ExportInfo, FileEntry, FileExplanation, FileInspection, HotspotReport, Issue } from '../types.js';
2
- import { type CodeGraph } from './codeGraph.js';
3
- export interface InspectOptions {
4
- scan?: {
5
- files: FileEntry[];
6
- };
7
- issues?: Issue[];
8
- hotspots?: HotspotReport;
9
- /** If provided, prefer graph-derived imports/exports over regex parsing. */
10
- graph?: CodeGraph;
11
- }
1
+ import type { FileExplanation, FileInspection } from '../types.js';
2
+ import { type InspectOptions } from './fileInspectionReport.js';
3
+ export { inferPurpose } from './filePurpose.js';
4
+ export { detectFileIssues } from './fileIssues.js';
5
+ export type { InspectOptions } from './fileInspectionReport.js';
12
6
  export declare function explainFile(rootPath: string, relOrAbsFile: string, options?: InspectOptions): Promise<FileExplanation>;
13
7
  export declare function inspectFile(rootPath: string, relOrAbsFile: string, options?: InspectOptions): Promise<FileInspection>;
14
- export declare function inferPurpose(filePath: string, exports: ExportInfo[]): string;
15
- export declare function detectFileIssues(content: string, lineCount: number): string[];
@@ -1,11 +1,7 @@
1
- import fs from 'node:fs/promises';
2
- import path from 'node:path';
3
- import { scanRepository } from './repositoryScanner.js';
4
- import { collectIssues } from './issueEngine.js';
5
- import { analyzeHotspots } from './hotspotAnalyzer.js';
6
- import { getAdapterFor } from './languages/registry.js';
7
- import { buildCodeGraph } from './codeGraph.js';
8
- import { loadCachedGraph, saveCachedGraph } from './indexCache.js';
1
+ import { readProjectFile } from './fileAccess.js';
2
+ import { inspectExistingProjectFile } from './fileInspectionReport.js';
3
+ export { inferPurpose } from './filePurpose.js';
4
+ export { detectFileIssues } from './fileIssues.js';
9
5
  export async function explainFile(rootPath, relOrAbsFile, options = {}) {
10
6
  const inspection = await inspectFile(rootPath, relOrAbsFile, options);
11
7
  if (!inspection.exists) {
@@ -21,157 +17,11 @@ export async function explainFile(rootPath, relOrAbsFile, options = {}) {
21
17
  };
22
18
  }
23
19
  export async function inspectFile(rootPath, relOrAbsFile, options = {}) {
24
- // Reject absolute paths up-front. The MCP `projscan_file` tool's docs
25
- // describe `path` as "relative to the project root", but the prior
26
- // implementation silently honored absolute paths. Refusing them removes
27
- // an attack vector where a hostile MCP client passes /etc/passwd directly.
28
- if (path.isAbsolute(relOrAbsFile)) {
29
- return makeEmpty(relOrAbsFile, 'Absolute paths are not accepted; pass a path relative to the project root.');
30
- }
31
- // Canonicalize BOTH the root and the target via realpath before the
32
- // inside-root check. macOS's tmpdir lives at `/var/folders/...` which
33
- // is itself a symlink to `/private/var/folders/...`; without canonical-
34
- // izing the root, the resolved target's `/private/...` form would fail
35
- // the prefix check. Realpath of the root fails ENOENT only if the user
36
- // pointed at a non-existent root (caller error); fall back to the
37
- // resolved-without-realpath form in that case so the user gets a clear
38
- // downstream "File not found" error rather than a misleading "outside
39
- // the project root".
40
- const resolvedRoot = path.resolve(rootPath);
41
- let canonicalRoot = resolvedRoot;
42
- try {
43
- canonicalRoot = await fs.realpath(resolvedRoot);
44
- }
45
- catch {
46
- // root doesn't exist; use the unresolved form
47
- }
48
- const absolutePath = path.resolve(canonicalRoot, relOrAbsFile);
49
- // Resolve symlinks on the target. Without this, a symlink under the repo
50
- // (e.g. `cache/keys.pem` → `/etc/passwd`) passes the prefix check but
51
- // reads attacker-chosen content. realpath collapses the symlink so the
52
- // inside-root check sees the real target. ENOENT (path doesn't exist)
53
- // → fall back to the unresolved path; downstream stat will surface the
54
- // real error.
55
- let realPath = absolutePath;
56
- try {
57
- realPath = await fs.realpath(absolutePath);
58
- }
59
- catch {
60
- // missing path; use the unresolved form for the inside-root check.
61
- // path.resolve already collapsed any '..' so we won't admit traversal.
62
- }
63
- if (!isInsideRoot(realPath, canonicalRoot)) {
64
- return makeEmpty(relOrAbsFile, 'File is outside the project root');
65
- }
66
- let content;
67
- let sizeBytes;
68
- try {
69
- const stat = await fs.stat(realPath);
70
- if (!stat.isFile()) {
71
- return makeEmpty(relOrAbsFile, 'Path is not a file');
72
- }
73
- sizeBytes = stat.size;
74
- content = await fs.readFile(realPath, 'utf-8');
75
- }
76
- catch (err) {
77
- const msg = err.code === 'ENOENT' ? 'File not found' : String(err);
78
- return makeEmpty(relOrAbsFile, msg);
79
- }
80
- const relativePath = path.relative(canonicalRoot, absolutePath).split(path.sep).join('/');
81
- const lines = content.split('\n');
82
- const adapter = getAdapterFor(relativePath);
83
- const language = adapter?.id;
84
- const files = options.scan?.files ?? (await scanRepository(resolvedRoot)).files;
85
- const issues = options.issues ?? (await collectIssues(resolvedRoot, files));
86
- // Build the graph before deriving imports/exports. The removed regex
87
- // extractors only understood JS/TS and emitted misleading metadata for
88
- // other languages.
89
- let graph = options.graph;
90
- if (!graph) {
91
- const cached = await loadCachedGraph(resolvedRoot);
92
- graph = await buildCodeGraph(resolvedRoot, files, cached);
93
- await saveCachedGraph(resolvedRoot, graph);
94
- }
95
- let imports = [];
96
- let exports = [];
97
- const graphFile = graph.files.get(relativePath);
98
- if (graphFile) {
99
- imports = graphFile.imports.map((i) => ({
100
- source: i.source,
101
- specifiers: i.specifiers,
102
- isRelative: i.source.startsWith('.') || i.source.startsWith('/'),
103
- }));
104
- exports = graphFile.exports.map((e) => ({
105
- name: e.name,
106
- type: mapExportType(e.kind),
107
- }));
108
- }
109
- const purpose = inferPurpose(absolutePath, exports);
110
- const potentialIssues = detectFileIssues(content, lines.length);
111
- const hotspotReport = options.hotspots ?? (await analyzeHotspots(resolvedRoot, files, issues, { limit: 100, graph }));
112
- const hotspot = findHotspotForFile(hotspotReport, relativePath);
113
- const relatedIssues = issues.filter((issue) => (issue.title + '\n' + issue.description).includes(relativePath));
114
- // Coupling: fan-in is direct from the graph; fan-out scans localImporters
115
- // for entries where this file is the importer. O(N) over local edges, fine
116
- // for a single-file inspection.
117
- let cyclomaticComplexity = null;
118
- let fanIn = null;
119
- let fanOut = null;
120
- let functions;
121
- const graphFileEntry = graph.files.get(relativePath);
122
- if (graphFileEntry) {
123
- cyclomaticComplexity = graphFileEntry.parseOk ? graphFileEntry.cyclomaticComplexity : null;
124
- fanIn = graph.localImporters.get(relativePath)?.size ?? 0;
125
- let fo = 0;
126
- for (const importers of graph.localImporters.values()) {
127
- if (importers.has(relativePath))
128
- fo++;
129
- }
130
- fanOut = fo;
131
- if (graphFileEntry.functions && graphFileEntry.functions.length > 0) {
132
- functions = [...graphFileEntry.functions]
133
- .sort((a, b) => b.cyclomaticComplexity - a.cyclomaticComplexity)
134
- .map((f) => ({
135
- name: f.name,
136
- line: f.line,
137
- endLine: f.endLine,
138
- cyclomaticComplexity: f.cyclomaticComplexity,
139
- fanIn: f.fanIn,
140
- }));
141
- }
142
- }
143
- return {
144
- relativePath,
145
- exists: true,
146
- purpose,
147
- lineCount: lines.length,
148
- sizeBytes,
149
- imports,
150
- exports,
151
- potentialIssues,
152
- hotspot,
153
- issues: relatedIssues,
154
- cyclomaticComplexity,
155
- fanIn,
156
- fanOut,
157
- language,
158
- functions,
159
- };
160
- }
161
- function mapExportType(kind) {
162
- switch (kind) {
163
- case 'function':
164
- case 'class':
165
- case 'variable':
166
- case 'type':
167
- case 'interface':
168
- case 'default':
169
- return kind;
170
- case 'enum':
171
- return 'type';
172
- default:
173
- return 'unknown';
20
+ const fileRead = await readProjectFile(rootPath, relOrAbsFile);
21
+ if (!fileRead.ok) {
22
+ return makeEmpty(fileRead.relativePath, fileRead.reason);
174
23
  }
24
+ return inspectExistingProjectFile(fileRead.file, options);
175
25
  }
176
26
  function makeEmpty(relativePath, reason) {
177
27
  return {
@@ -188,85 +38,4 @@ function makeEmpty(relativePath, reason) {
188
38
  issues: [],
189
39
  };
190
40
  }
191
- function isInsideRoot(absolutePath, resolvedRoot) {
192
- return absolutePath === resolvedRoot || absolutePath.startsWith(resolvedRoot + path.sep);
193
- }
194
- function findHotspotForFile(report, relativePath) {
195
- if (!report || !report.available)
196
- return null;
197
- return report.hotspots.find((h) => h.relativePath === relativePath) ?? null;
198
- }
199
- /**
200
- * Filename-keyword rules. Order matters — first match wins. Each pred
201
- * runs against the lowercase basename (without extension).
202
- */
203
- const NAME_RULES = [
204
- { pred: (n) => n.includes('test') || n.includes('spec'), label: 'Test file' },
205
- { pred: (n) => n.includes('config') || n.includes('rc'), label: 'Configuration file' },
206
- { pred: (n) => n === 'index', label: 'Module entry point / barrel file' },
207
- { pred: (n) => n === 'main' || n === 'app', label: 'Application entry point' },
208
- { pred: (n) => n.includes('route') || n.includes('router'), label: 'Route definitions' },
209
- { pred: (n) => n.includes('middleware'), label: 'Middleware handler' },
210
- { pred: (n) => n.includes('controller'), label: 'Request controller' },
211
- { pred: (n) => n.includes('service'), label: 'Service layer logic' },
212
- {
213
- pred: (n) => n.includes('model') || n.includes('schema'),
214
- label: 'Data model / schema definition',
215
- },
216
- { pred: (n) => n.includes('util') || n.includes('helper'), label: 'Utility functions' },
217
- { pred: (n) => n.includes('hook'), label: 'Custom hook' },
218
- {
219
- pred: (n) => n.includes('context') || n.includes('provider'),
220
- label: 'Context / state provider',
221
- },
222
- { pred: (n) => n.includes('type') || n.includes('interface'), label: 'Type definitions' },
223
- { pred: (n) => n.includes('constant'), label: 'Constants / configuration' },
224
- { pred: (n) => n.includes('migration'), label: 'Database migration' },
225
- { pred: (n) => n.includes('seed'), label: 'Database seed data' },
226
- { pred: (n) => n.includes('auth'), label: 'Authentication logic' },
227
- { pred: (n) => n.includes('api'), label: 'API endpoint handler' },
228
- ];
229
- /** Directory-segment rules. Same first-match-wins semantics. */
230
- const DIR_RULES = [
231
- { pred: (d) => d.includes('component') || d.includes('pages'), label: 'UI component' },
232
- { pred: (d) => d.includes('service'), label: 'Service module' },
233
- { pred: (d) => d.includes('model'), label: 'Data model' },
234
- { pred: (d) => d.includes('util') || d.includes('lib'), label: 'Library / utility module' },
235
- ];
236
- export function inferPurpose(filePath, exports) {
237
- const name = path.basename(filePath, path.extname(filePath)).toLowerCase();
238
- const dir = path.dirname(filePath).toLowerCase();
239
- for (const rule of NAME_RULES)
240
- if (rule.pred(name))
241
- return rule.label;
242
- for (const rule of DIR_RULES)
243
- if (rule.pred(dir))
244
- return rule.label;
245
- return inferPurposeFromExports(exports);
246
- }
247
- function inferPurposeFromExports(exports) {
248
- const exportTypes = exports.map((e) => e.type);
249
- if (exportTypes.includes('class'))
250
- return 'Class-based module';
251
- if (exportTypes.filter((t) => t === 'function').length > 2)
252
- return 'Function library';
253
- return 'Source module';
254
- }
255
- export function detectFileIssues(content, lineCount) {
256
- const issues = [];
257
- if (lineCount > 500)
258
- issues.push(`Large file (${lineCount} lines) - consider splitting`);
259
- if (lineCount > 1000)
260
- issues.push('Very large file - strongly consider refactoring');
261
- if (/console\.(log|warn|error|debug)\s*\(/.test(content)) {
262
- issues.push('Contains console.log statements - consider using a proper logger');
263
- }
264
- if (/TODO|FIXME|HACK|XXX/i.test(content)) {
265
- issues.push('Contains TODO/FIXME comments');
266
- }
267
- if (/:\s*any\b/.test(content) && /\.tsx?$/.test(content)) {
268
- issues.push('Uses "any" type - consider using proper types');
269
- }
270
- return issues;
271
- }
272
41
  //# sourceMappingURL=fileInspector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fileInspector.js","sourceRoot":"","sources":["../../src/core/fileInspector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAW7B,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAkB,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAUnE,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,QAAgB,EAChB,YAAoB,EACpB,UAA0B,EAAE;IAE5B,MAAM,UAAU,GAAG,MAAM,WAAW,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IACtE,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,IAAI,gBAAgB,CAAC,CAAC;IACzD,CAAC;IACD,OAAO;QACL,QAAQ,EAAE,UAAU,CAAC,YAAY;QACjC,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,eAAe,EAAE,UAAU,CAAC,eAAe;QAC3C,SAAS,EAAE,UAAU,CAAC,SAAS;KAChC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,QAAgB,EAChB,YAAoB,EACpB,UAA0B,EAAE;IAE5B,sEAAsE;IACtE,mEAAmE;IACnE,wEAAwE;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AO,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;IAED,OAAO,0BAA0B,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,SAAS,CAAC,YAAoB,EAAE,MAAc;IACrD,OAAO;QACL,YAAY;QACZ,MAAM,EAAE,KAAK;QACb,MAAM;QACN,OAAO,EAAE,EAAE;QACX,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,EAAE;QACnB,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,EAAE;KACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function detectFileIssues(content: string, lineCount: number): string[];
@@ -0,0 +1,18 @@
1
+ export function detectFileIssues(content, lineCount) {
2
+ const issues = [];
3
+ if (lineCount > 500)
4
+ issues.push(`Large file (${lineCount} lines) - consider splitting`);
5
+ if (lineCount > 1000)
6
+ issues.push('Very large file - strongly consider refactoring');
7
+ if (/console\.(log|warn|error|debug)\s*\(/.test(content)) {
8
+ issues.push('Contains console.log statements - consider using a proper logger');
9
+ }
10
+ if (/TODO|FIXME|HACK|XXX/i.test(content)) {
11
+ issues.push('Contains TODO/FIXME comments');
12
+ }
13
+ if (/:\s*any\b/.test(content) && /\.tsx?$/.test(content)) {
14
+ issues.push('Uses "any" type - consider using proper types');
15
+ }
16
+ return issues;
17
+ }
18
+ //# sourceMappingURL=fileIssues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileIssues.js","sourceRoot":"","sources":["../../src/core/fileIssues.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,OAAe,EAAE,SAAiB;IACjE,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,SAAS,GAAG,GAAG;QAAE,MAAM,CAAC,IAAI,CAAC,eAAe,SAAS,8BAA8B,CAAC,CAAC;IACzF,IAAI,SAAS,GAAG,IAAI;QAAE,MAAM,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;IAErF,IAAI,sCAAsC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACzD,MAAM,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;IAClF,CAAC;IAED,IAAI,sBAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACzC,MAAM,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;IAC9C,CAAC;IAED,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACzD,MAAM,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { ExportInfo } from '../types.js';
2
+ export declare function inferPurpose(filePath: string, exports: ExportInfo[]): string;
@@ -0,0 +1,61 @@
1
+ import path from 'node:path';
2
+ /**
3
+ * Filename-keyword rules. Order matters: first match wins. Each predicate
4
+ * runs against the lowercase basename without extension.
5
+ */
6
+ const NAME_RULES = [
7
+ { pred: isTestFileName, label: 'Test file' },
8
+ { pred: (name) => name.includes('config') || name.includes('rc'), label: 'Configuration file' },
9
+ { pred: (name) => name === 'index', label: 'Module entry point / barrel file' },
10
+ { pred: (name) => name === 'main' || name === 'app', label: 'Application entry point' },
11
+ { pred: (name) => name.includes('route') || name.includes('router'), label: 'Route definitions' },
12
+ { pred: (name) => name.includes('middleware'), label: 'Middleware handler' },
13
+ { pred: (name) => name.includes('controller'), label: 'Request controller' },
14
+ { pred: (name) => name.includes('service'), label: 'Service layer logic' },
15
+ {
16
+ pred: (name) => name.includes('model') || name.includes('schema'),
17
+ label: 'Data model / schema definition',
18
+ },
19
+ { pred: (name) => name.includes('util') || name.includes('helper'), label: 'Utility functions' },
20
+ { pred: (name) => name.includes('hook'), label: 'Custom hook' },
21
+ {
22
+ pred: (name) => name.includes('context') || name.includes('provider'),
23
+ label: 'Context / state provider',
24
+ },
25
+ { pred: (name) => name.includes('type') || name.includes('interface'), label: 'Type definitions' },
26
+ { pred: (name) => name.includes('constant'), label: 'Constants / configuration' },
27
+ { pred: (name) => name.includes('migration'), label: 'Database migration' },
28
+ { pred: (name) => name.includes('seed'), label: 'Database seed data' },
29
+ { pred: (name) => name.includes('auth'), label: 'Authentication logic' },
30
+ { pred: (name) => name.includes('api'), label: 'API endpoint handler' },
31
+ ];
32
+ const TEST_NAME_TOKENS = new Set(['test', 'tests', 'spec', 'specs']);
33
+ const DIR_RULES = [
34
+ { pred: (dir) => dir.includes('component') || dir.includes('pages'), label: 'UI component' },
35
+ { pred: (dir) => dir.includes('service'), label: 'Service module' },
36
+ { pred: (dir) => dir.includes('model'), label: 'Data model' },
37
+ { pred: (dir) => dir.includes('util') || dir.includes('lib'), label: 'Library / utility module' },
38
+ ];
39
+ export function inferPurpose(filePath, exports) {
40
+ const name = path.basename(filePath, path.extname(filePath)).toLowerCase();
41
+ const dir = path.dirname(filePath).toLowerCase();
42
+ for (const rule of NAME_RULES)
43
+ if (rule.pred(name))
44
+ return rule.label;
45
+ for (const rule of DIR_RULES)
46
+ if (rule.pred(dir))
47
+ return rule.label;
48
+ return inferPurposeFromExports(exports);
49
+ }
50
+ function isTestFileName(name) {
51
+ return name.split(/[\W_]+/).some((part) => TEST_NAME_TOKENS.has(part));
52
+ }
53
+ function inferPurposeFromExports(exports) {
54
+ const exportTypes = exports.map((item) => item.type);
55
+ if (exportTypes.includes('class'))
56
+ return 'Class-based module';
57
+ if (exportTypes.filter((type) => type === 'function').length > 2)
58
+ return 'Function library';
59
+ return 'Source module';
60
+ }
61
+ //# sourceMappingURL=filePurpose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filePurpose.js","sourceRoot":"","sources":["../../src/core/filePurpose.ts"],"names":[],"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GAAG,CAAC;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpE,OAAO,uBAAuB,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,SAAS,uBAAuB,CAAC,OAAqB;IACpD,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrD,IAAI,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,oBAAoB,CAAC;IAC/D,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,kBAAkB,CAAC;IAC5F,OAAO,eAAe,CAAC;AACzB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { Issue, IssueLocation, FixSuggestion } from '../types.js';
2
2
  import type { ApplyPlan } from './applyFix.js';
3
+ export { previewSuggestionForIssue } from './fixSuggestPreview.js';
3
4
  /**
4
5
  * Pick a template for the issue. Always returns a suggestion - the fallback
5
6
  * catches anything without a tailored template. Async because some templates
@@ -12,15 +13,6 @@ export declare function suggestFixForIssue(issue: Issue, rootPath: string): Prom
12
13
  * matching template declares apply support.
13
14
  */
14
15
  export declare function buildApplyPlanForIssue(issue: Issue, rootPath: string): Promise<ApplyPlan | null>;
15
- /**
16
- * Synchronous one-line preview for inline use in projscan_doctor output.
17
- * Returns the headline a template would render. We can't run the full
18
- * template synchronously (some are async-shaped); the headline is a
19
- * lightweight projection that doesn't need IO.
20
- */
21
- export declare function previewSuggestionForIssue(issue: Issue): {
22
- summary: string;
23
- } | null;
24
16
  /**
25
17
  * Locate an issue in a doctor result by id. The MCP tool calls this to
26
18
  * resolve a fix-suggest request; the issue payload comes from