codereview-aia 0.2.0 → 0.2.2

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 (435) hide show
  1. package/dist/index.js +0 -7
  2. package/dist/index.js.map +1 -1
  3. package/dist/runtime/api/batcher.d.ts +20 -0
  4. package/dist/runtime/api/batcher.js +52 -0
  5. package/dist/runtime/api/batcher.js.map +1 -0
  6. package/dist/runtime/api/edgeClient.d.ts +102 -0
  7. package/dist/runtime/api/edgeClient.js +162 -0
  8. package/dist/runtime/api/edgeClient.js.map +1 -0
  9. package/dist/runtime/api/index.d.ts +2 -0
  10. package/dist/runtime/api/index.js +9 -0
  11. package/dist/runtime/api/index.js.map +1 -0
  12. package/dist/runtime/cliEntry.js +24 -76
  13. package/dist/runtime/cliEntry.js.map +1 -1
  14. package/dist/runtime/errors.d.ts +13 -3
  15. package/dist/runtime/errors.js +31 -8
  16. package/dist/runtime/errors.js.map +1 -1
  17. package/dist/runtime/llm/index.d.ts +1 -0
  18. package/dist/runtime/llm/index.js +6 -0
  19. package/dist/runtime/llm/index.js.map +1 -0
  20. package/dist/runtime/llm/openRouterClient.d.ts +13 -0
  21. package/dist/runtime/llm/openRouterClient.js +187 -0
  22. package/dist/runtime/llm/openRouterClient.js.map +1 -0
  23. package/dist/runtime/phpFileResolver.d.ts +14 -0
  24. package/dist/runtime/phpFileResolver.js +231 -0
  25. package/dist/runtime/phpFileResolver.js.map +1 -0
  26. package/dist/runtime/phpcsParser.d.ts +10 -0
  27. package/dist/runtime/phpcsParser.js +35 -0
  28. package/dist/runtime/phpcsParser.js.map +1 -0
  29. package/dist/runtime/phpcsRunner.d.ts +32 -0
  30. package/dist/runtime/phpcsRunner.js +62 -0
  31. package/dist/runtime/phpcsRunner.js.map +1 -0
  32. package/dist/runtime/reportWriter.d.ts +17 -0
  33. package/dist/runtime/reportWriter.js +80 -0
  34. package/dist/runtime/reportWriter.js.map +1 -0
  35. package/dist/runtime/reviewPipeline.d.ts +14 -36
  36. package/dist/runtime/reviewPipeline.js +146 -199
  37. package/dist/runtime/reviewPipeline.js.map +1 -1
  38. package/dist/runtime/ui/RuntimeApp.js +23 -154
  39. package/dist/runtime/ui/RuntimeApp.js.map +1 -1
  40. package/dist/runtime/ui/screens/AuthScreen.d.ts +2 -3
  41. package/dist/runtime/ui/screens/AuthScreen.js +7 -53
  42. package/dist/runtime/ui/screens/AuthScreen.js.map +1 -1
  43. package/dist/runtime/ui/screens/ModeSelection.d.ts +1 -2
  44. package/dist/runtime/ui/screens/ModeSelection.js +14 -139
  45. package/dist/runtime/ui/screens/ModeSelection.js.map +1 -1
  46. package/dist/runtime/ui/screens/ProgressScreen.d.ts +5 -13
  47. package/dist/runtime/ui/screens/ProgressScreen.js +24 -61
  48. package/dist/runtime/ui/screens/ProgressScreen.js.map +1 -1
  49. package/dist/runtime/ui/screens/ResultsScreen.js +7 -17
  50. package/dist/runtime/ui/screens/ResultsScreen.js.map +1 -1
  51. package/package.json +4 -44
  52. package/dist/analysis/FindingsExtractor.d.ts +0 -105
  53. package/dist/analysis/FindingsExtractor.js +0 -363
  54. package/dist/analysis/FindingsExtractor.js.map +0 -1
  55. package/dist/analysis/ai-detection/analyzers/BaseAnalyzer.d.ts +0 -111
  56. package/dist/analysis/ai-detection/analyzers/BaseAnalyzer.js +0 -215
  57. package/dist/analysis/ai-detection/analyzers/BaseAnalyzer.js.map +0 -1
  58. package/dist/analysis/ai-detection/analyzers/DocumentationAnalyzer.d.ts +0 -142
  59. package/dist/analysis/ai-detection/analyzers/DocumentationAnalyzer.js +0 -503
  60. package/dist/analysis/ai-detection/analyzers/DocumentationAnalyzer.js.map +0 -1
  61. package/dist/analysis/ai-detection/analyzers/GitHistoryAnalyzer.d.ts +0 -88
  62. package/dist/analysis/ai-detection/analyzers/GitHistoryAnalyzer.js +0 -343
  63. package/dist/analysis/ai-detection/analyzers/GitHistoryAnalyzer.js.map +0 -1
  64. package/dist/analysis/ai-detection/core/AIDetectionEngine.d.ts +0 -104
  65. package/dist/analysis/ai-detection/core/AIDetectionEngine.js +0 -369
  66. package/dist/analysis/ai-detection/core/AIDetectionEngine.js.map +0 -1
  67. package/dist/analysis/ai-detection/types/DetectionTypes.d.ts +0 -364
  68. package/dist/analysis/ai-detection/types/DetectionTypes.js +0 -32
  69. package/dist/analysis/ai-detection/types/DetectionTypes.js.map +0 -1
  70. package/dist/analysis/ai-detection/utils/SubmissionConverter.d.ts +0 -97
  71. package/dist/analysis/ai-detection/utils/SubmissionConverter.js +0 -339
  72. package/dist/analysis/ai-detection/utils/SubmissionConverter.js.map +0 -1
  73. package/dist/analysis/context/ReviewContext.d.ts +0 -184
  74. package/dist/analysis/context/ReviewContext.js +0 -294
  75. package/dist/analysis/context/ReviewContext.js.map +0 -1
  76. package/dist/analysis/context/index.d.ts +0 -6
  77. package/dist/analysis/context/index.js +0 -23
  78. package/dist/analysis/context/index.js.map +0 -1
  79. package/dist/analysis/index.d.ts +0 -7
  80. package/dist/analysis/index.js +0 -24
  81. package/dist/analysis/index.js.map +0 -1
  82. package/dist/analysis/static/wpPhpcsRunner.d.ts +0 -11
  83. package/dist/analysis/static/wpPhpcsRunner.js +0 -219
  84. package/dist/analysis/static/wpPhpcsRunner.js.map +0 -1
  85. package/dist/analysis/tokens/TokenAnalysisFormatter.d.ts +0 -27
  86. package/dist/analysis/tokens/TokenAnalysisFormatter.js +0 -143
  87. package/dist/analysis/tokens/TokenAnalysisFormatter.js.map +0 -1
  88. package/dist/analysis/tokens/TokenAnalyzer.d.ts +0 -155
  89. package/dist/analysis/tokens/TokenAnalyzer.js +0 -502
  90. package/dist/analysis/tokens/TokenAnalyzer.js.map +0 -1
  91. package/dist/analysis/tokens/index.d.ts +0 -7
  92. package/dist/analysis/tokens/index.js +0 -24
  93. package/dist/analysis/tokens/index.js.map +0 -1
  94. package/dist/clients/base/abstractClient.d.ts +0 -99
  95. package/dist/clients/base/abstractClient.js +0 -98
  96. package/dist/clients/base/abstractClient.js.map +0 -1
  97. package/dist/clients/base/httpClient.d.ts +0 -24
  98. package/dist/clients/base/httpClient.js +0 -147
  99. package/dist/clients/base/httpClient.js.map +0 -1
  100. package/dist/clients/base/index.d.ts +0 -11
  101. package/dist/clients/base/index.js +0 -28
  102. package/dist/clients/base/index.js.map +0 -1
  103. package/dist/clients/base/modelDetection.d.ts +0 -41
  104. package/dist/clients/base/modelDetection.js +0 -88
  105. package/dist/clients/base/modelDetection.js.map +0 -1
  106. package/dist/clients/base/responseProcessor.d.ts +0 -45
  107. package/dist/clients/base/responseProcessor.js +0 -495
  108. package/dist/clients/base/responseProcessor.js.map +0 -1
  109. package/dist/clients/factory/clientFactory.d.ts +0 -23
  110. package/dist/clients/factory/clientFactory.js +0 -50
  111. package/dist/clients/factory/clientFactory.js.map +0 -1
  112. package/dist/clients/factory/index.d.ts +0 -7
  113. package/dist/clients/factory/index.js +0 -24
  114. package/dist/clients/factory/index.js.map +0 -1
  115. package/dist/clients/implementations/index.d.ts +0 -7
  116. package/dist/clients/implementations/index.js +0 -24
  117. package/dist/clients/implementations/index.js.map +0 -1
  118. package/dist/clients/implementations/openRouterClient.d.ts +0 -69
  119. package/dist/clients/implementations/openRouterClient.js +0 -294
  120. package/dist/clients/implementations/openRouterClient.js.map +0 -1
  121. package/dist/clients/openRouterClient.d.ts +0 -42
  122. package/dist/clients/openRouterClient.js +0 -580
  123. package/dist/clients/openRouterClient.js.map +0 -1
  124. package/dist/clients/openRouterClientWrapper.d.ts +0 -22
  125. package/dist/clients/openRouterClientWrapper.js +0 -64
  126. package/dist/clients/openRouterClientWrapper.js.map +0 -1
  127. package/dist/clients/utils/directoryStructure.d.ts +0 -14
  128. package/dist/clients/utils/directoryStructure.js +0 -48
  129. package/dist/clients/utils/directoryStructure.js.map +0 -1
  130. package/dist/clients/utils/index.d.ts +0 -10
  131. package/dist/clients/utils/index.js +0 -31
  132. package/dist/clients/utils/index.js.map +0 -1
  133. package/dist/clients/utils/languageDetection.d.ts +0 -13
  134. package/dist/clients/utils/languageDetection.js +0 -46
  135. package/dist/clients/utils/languageDetection.js.map +0 -1
  136. package/dist/clients/utils/promptFormatter.d.ts +0 -37
  137. package/dist/clients/utils/promptFormatter.js +0 -150
  138. package/dist/clients/utils/promptFormatter.js.map +0 -1
  139. package/dist/clients/utils/promptLoader.d.ts +0 -27
  140. package/dist/clients/utils/promptLoader.js +0 -49
  141. package/dist/clients/utils/promptLoader.js.map +0 -1
  142. package/dist/clients/utils/tokenCounter.d.ts +0 -81
  143. package/dist/clients/utils/tokenCounter.js +0 -184
  144. package/dist/clients/utils/tokenCounter.js.map +0 -1
  145. package/dist/core/ApiClientSelector.d.ts +0 -8
  146. package/dist/core/ApiClientSelector.js +0 -29
  147. package/dist/core/ApiClientSelector.js.map +0 -1
  148. package/dist/core/ConfigurationService.d.ts +0 -307
  149. package/dist/core/ConfigurationService.js +0 -516
  150. package/dist/core/ConfigurationService.js.map +0 -1
  151. package/dist/core/ConsolidationService.d.ts +0 -99
  152. package/dist/core/ConsolidationService.js +0 -341
  153. package/dist/core/ConsolidationService.js.map +0 -1
  154. package/dist/core/InteractiveDisplayManager.d.ts +0 -22
  155. package/dist/core/InteractiveDisplayManager.js +0 -70
  156. package/dist/core/InteractiveDisplayManager.js.map +0 -1
  157. package/dist/core/OutputManager.d.ts +0 -26
  158. package/dist/core/OutputManager.js +0 -217
  159. package/dist/core/OutputManager.js.map +0 -1
  160. package/dist/core/ReviewGenerator.d.ts +0 -13
  161. package/dist/core/ReviewGenerator.js +0 -102
  162. package/dist/core/ReviewGenerator.js.map +0 -1
  163. package/dist/core/fileDiscovery.d.ts +0 -35
  164. package/dist/core/fileDiscovery.js +0 -202
  165. package/dist/core/fileDiscovery.js.map +0 -1
  166. package/dist/core/handlers/EstimationHandler.d.ts +0 -18
  167. package/dist/core/handlers/EstimationHandler.js +0 -110
  168. package/dist/core/handlers/EstimationHandler.js.map +0 -1
  169. package/dist/core/handlers/FileProcessingHandler.d.ts +0 -31
  170. package/dist/core/handlers/FileProcessingHandler.js +0 -164
  171. package/dist/core/handlers/FileProcessingHandler.js.map +0 -1
  172. package/dist/core/handlers/OutputHandler.d.ts +0 -27
  173. package/dist/core/handlers/OutputHandler.js +0 -127
  174. package/dist/core/handlers/OutputHandler.js.map +0 -1
  175. package/dist/core/handlers/ReviewExecutor.d.ts +0 -32
  176. package/dist/core/handlers/ReviewExecutor.js +0 -111
  177. package/dist/core/handlers/ReviewExecutor.js.map +0 -1
  178. package/dist/core/reviewOrchestrator.d.ts +0 -24
  179. package/dist/core/reviewOrchestrator.js +0 -354
  180. package/dist/core/reviewOrchestrator.js.map +0 -1
  181. package/dist/core/utils/ModelInfoUtils.d.ts +0 -16
  182. package/dist/core/utils/ModelInfoUtils.js +0 -54
  183. package/dist/core/utils/ModelInfoUtils.js.map +0 -1
  184. package/dist/formatters/outputFormatter.d.ts +0 -31
  185. package/dist/formatters/outputFormatter.js +0 -65
  186. package/dist/formatters/outputFormatter.js.map +0 -1
  187. package/dist/formatters/utils/IssueFormatters.d.ts +0 -20
  188. package/dist/formatters/utils/IssueFormatters.js +0 -67
  189. package/dist/formatters/utils/IssueFormatters.js.map +0 -1
  190. package/dist/formatters/utils/JsonFormatter.d.ts +0 -13
  191. package/dist/formatters/utils/JsonFormatter.js +0 -57
  192. package/dist/formatters/utils/JsonFormatter.js.map +0 -1
  193. package/dist/formatters/utils/MarkdownFormatters.d.ts +0 -51
  194. package/dist/formatters/utils/MarkdownFormatters.js +0 -456
  195. package/dist/formatters/utils/MarkdownFormatters.js.map +0 -1
  196. package/dist/formatters/utils/MetadataFormatter.d.ts +0 -65
  197. package/dist/formatters/utils/MetadataFormatter.js +0 -219
  198. package/dist/formatters/utils/MetadataFormatter.js.map +0 -1
  199. package/dist/formatters/utils/ModelInfoExtractor.d.ts +0 -33
  200. package/dist/formatters/utils/ModelInfoExtractor.js +0 -111
  201. package/dist/formatters/utils/ModelInfoExtractor.js.map +0 -1
  202. package/dist/plugins/PluginInterface.d.ts +0 -44
  203. package/dist/plugins/PluginInterface.js +0 -9
  204. package/dist/plugins/PluginInterface.js.map +0 -1
  205. package/dist/plugins/PluginManager.d.ts +0 -51
  206. package/dist/plugins/PluginManager.js +0 -151
  207. package/dist/plugins/PluginManager.js.map +0 -1
  208. package/dist/prompts/PromptManager.d.ts +0 -30
  209. package/dist/prompts/PromptManager.js +0 -62
  210. package/dist/prompts/PromptManager.js.map +0 -1
  211. package/dist/prompts/cache/PromptCache.d.ts +0 -32
  212. package/dist/prompts/cache/PromptCache.js +0 -48
  213. package/dist/prompts/cache/PromptCache.js.map +0 -1
  214. package/dist/runtime/auth/service.d.ts +0 -2
  215. package/dist/runtime/auth/service.js +0 -41
  216. package/dist/runtime/auth/service.js.map +0 -1
  217. package/dist/runtime/auth/session.d.ts +0 -5
  218. package/dist/runtime/auth/session.js +0 -87
  219. package/dist/runtime/auth/session.js.map +0 -1
  220. package/dist/runtime/auth/types.d.ts +0 -9
  221. package/dist/runtime/auth/types.js +0 -3
  222. package/dist/runtime/auth/types.js.map +0 -1
  223. package/dist/runtime/fileCollector.d.ts +0 -14
  224. package/dist/runtime/fileCollector.js +0 -381
  225. package/dist/runtime/fileCollector.js.map +0 -1
  226. package/dist/runtime/manifest.d.ts +0 -1
  227. package/dist/runtime/manifest.js +0 -65
  228. package/dist/runtime/manifest.js.map +0 -1
  229. package/dist/runtime/openrouterProxy.d.ts +0 -4
  230. package/dist/runtime/openrouterProxy.js +0 -43
  231. package/dist/runtime/openrouterProxy.js.map +0 -1
  232. package/dist/runtime/preprod/batchStreamer.d.ts +0 -54
  233. package/dist/runtime/preprod/batchStreamer.js +0 -159
  234. package/dist/runtime/preprod/batchStreamer.js.map +0 -1
  235. package/dist/runtime/preprod/crEdgeServiceClient.d.ts +0 -30
  236. package/dist/runtime/preprod/crEdgeServiceClient.js +0 -133
  237. package/dist/runtime/preprod/crEdgeServiceClient.js.map +0 -1
  238. package/dist/runtime/preprod/progressTracker.d.ts +0 -21
  239. package/dist/runtime/preprod/progressTracker.js +0 -80
  240. package/dist/runtime/preprod/progressTracker.js.map +0 -1
  241. package/dist/runtime/preprod/webCheck.d.ts +0 -1
  242. package/dist/runtime/preprod/webCheck.js +0 -102
  243. package/dist/runtime/preprod/webCheck.js.map +0 -1
  244. package/dist/runtime/proxyConfig.d.ts +0 -6
  245. package/dist/runtime/proxyConfig.js +0 -86
  246. package/dist/runtime/proxyConfig.js.map +0 -1
  247. package/dist/runtime/proxyEnvironment.d.ts +0 -3
  248. package/dist/runtime/proxyEnvironment.js +0 -63
  249. package/dist/runtime/proxyEnvironment.js.map +0 -1
  250. package/dist/runtime/reportMerge.d.ts +0 -30
  251. package/dist/runtime/reportMerge.js +0 -70
  252. package/dist/runtime/reportMerge.js.map +0 -1
  253. package/dist/runtime/reporting/markdownReportBuilder.d.ts +0 -17
  254. package/dist/runtime/reporting/markdownReportBuilder.js +0 -154
  255. package/dist/runtime/reporting/markdownReportBuilder.js.map +0 -1
  256. package/dist/runtime/reporting/reportDataCollector.d.ts +0 -31
  257. package/dist/runtime/reporting/reportDataCollector.js +0 -170
  258. package/dist/runtime/reporting/reportDataCollector.js.map +0 -1
  259. package/dist/runtime/reporting/summaryGenerator.d.ts +0 -10
  260. package/dist/runtime/reporting/summaryGenerator.js +0 -67
  261. package/dist/runtime/reporting/summaryGenerator.js.map +0 -1
  262. package/dist/runtime/runAiCodeReview.d.ts +0 -36
  263. package/dist/runtime/runAiCodeReview.js +0 -409
  264. package/dist/runtime/runAiCodeReview.js.map +0 -1
  265. package/dist/runtime/runtimeConfig.d.ts +0 -4
  266. package/dist/runtime/runtimeConfig.js +0 -7
  267. package/dist/runtime/runtimeConfig.js.map +0 -1
  268. package/dist/strategies/ArchitecturalReviewStrategy.d.ts +0 -29
  269. package/dist/strategies/ArchitecturalReviewStrategy.js +0 -42
  270. package/dist/strategies/ArchitecturalReviewStrategy.js.map +0 -1
  271. package/dist/strategies/CodingTestReviewStrategy.d.ts +0 -194
  272. package/dist/strategies/CodingTestReviewStrategy.js +0 -681
  273. package/dist/strategies/CodingTestReviewStrategy.js.map +0 -1
  274. package/dist/strategies/ConsolidatedReviewStrategy.d.ts +0 -25
  275. package/dist/strategies/ConsolidatedReviewStrategy.js +0 -45
  276. package/dist/strategies/ConsolidatedReviewStrategy.js.map +0 -1
  277. package/dist/strategies/ExtractPatternsReviewStrategy.d.ts +0 -30
  278. package/dist/strategies/ExtractPatternsReviewStrategy.js +0 -51
  279. package/dist/strategies/ExtractPatternsReviewStrategy.js.map +0 -1
  280. package/dist/strategies/MultiPassReviewStrategy.d.ts +0 -86
  281. package/dist/strategies/MultiPassReviewStrategy.js +0 -590
  282. package/dist/strategies/MultiPassReviewStrategy.js.map +0 -1
  283. package/dist/strategies/ReviewStrategy.d.ts +0 -45
  284. package/dist/strategies/ReviewStrategy.js +0 -24
  285. package/dist/strategies/ReviewStrategy.js.map +0 -1
  286. package/dist/strategies/StrategyFactory.d.ts +0 -19
  287. package/dist/strategies/StrategyFactory.js +0 -72
  288. package/dist/strategies/StrategyFactory.js.map +0 -1
  289. package/dist/strategies/index.d.ts +0 -13
  290. package/dist/strategies/index.js +0 -30
  291. package/dist/strategies/index.js.map +0 -1
  292. package/dist/tokenizers/baseTokenizer.d.ts +0 -25
  293. package/dist/tokenizers/baseTokenizer.js +0 -48
  294. package/dist/tokenizers/baseTokenizer.js.map +0 -1
  295. package/dist/tokenizers/gptTokenizer.d.ts +0 -7
  296. package/dist/tokenizers/gptTokenizer.js +0 -28
  297. package/dist/tokenizers/gptTokenizer.js.map +0 -1
  298. package/dist/tokenizers/index.d.ts +0 -7
  299. package/dist/tokenizers/index.js +0 -24
  300. package/dist/tokenizers/index.js.map +0 -1
  301. package/dist/types/apiResponses.d.ts +0 -39
  302. package/dist/types/apiResponses.js +0 -9
  303. package/dist/types/apiResponses.js.map +0 -1
  304. package/dist/types/cli.d.ts +0 -22
  305. package/dist/types/cli.js +0 -3
  306. package/dist/types/cli.js.map +0 -1
  307. package/dist/types/common.d.ts +0 -22
  308. package/dist/types/common.js +0 -14
  309. package/dist/types/common.js.map +0 -1
  310. package/dist/types/configuration.d.ts +0 -682
  311. package/dist/types/configuration.js +0 -65
  312. package/dist/types/configuration.js.map +0 -1
  313. package/dist/types/review.d.ts +0 -318
  314. package/dist/types/review.js +0 -8
  315. package/dist/types/review.js.map +0 -1
  316. package/dist/types/reviewSchema.d.ts +0 -543
  317. package/dist/types/reviewSchema.js +0 -121
  318. package/dist/types/reviewSchema.js.map +0 -1
  319. package/dist/types/structuredReview.d.ts +0 -119
  320. package/dist/types/structuredReview.js +0 -6
  321. package/dist/types/structuredReview.js.map +0 -1
  322. package/dist/types/tokenAnalysis.d.ts +0 -44
  323. package/dist/types/tokenAnalysis.js +0 -4
  324. package/dist/types/tokenAnalysis.js.map +0 -1
  325. package/dist/utils/FileReader.d.ts +0 -33
  326. package/dist/utils/FileReader.js +0 -88
  327. package/dist/utils/FileReader.js.map +0 -1
  328. package/dist/utils/FileWriter.d.ts +0 -26
  329. package/dist/utils/FileWriter.js +0 -76
  330. package/dist/utils/FileWriter.js.map +0 -1
  331. package/dist/utils/PathGenerator.d.ts +0 -30
  332. package/dist/utils/PathGenerator.js +0 -82
  333. package/dist/utils/PathGenerator.js.map +0 -1
  334. package/dist/utils/api/apiUtils.d.ts +0 -3
  335. package/dist/utils/api/apiUtils.js +0 -20
  336. package/dist/utils/api/apiUtils.js.map +0 -1
  337. package/dist/utils/api/index.d.ts +0 -1
  338. package/dist/utils/api/index.js +0 -18
  339. package/dist/utils/api/index.js.map +0 -1
  340. package/dist/utils/apiErrorHandler.d.ts +0 -130
  341. package/dist/utils/apiErrorHandler.js +0 -256
  342. package/dist/utils/apiErrorHandler.js.map +0 -1
  343. package/dist/utils/ciDataCollector.d.ts +0 -51
  344. package/dist/utils/ciDataCollector.js +0 -197
  345. package/dist/utils/ciDataCollector.js.map +0 -1
  346. package/dist/utils/codingTestConfigLoader.d.ts +0 -66
  347. package/dist/utils/codingTestConfigLoader.js +0 -420
  348. package/dist/utils/codingTestConfigLoader.js.map +0 -1
  349. package/dist/utils/dependencies/aiDependencyAnalyzer.d.ts +0 -30
  350. package/dist/utils/dependencies/aiDependencyAnalyzer.js +0 -343
  351. package/dist/utils/dependencies/aiDependencyAnalyzer.js.map +0 -1
  352. package/dist/utils/detection/frameworkDetector.d.ts +0 -43
  353. package/dist/utils/detection/frameworkDetector.js +0 -850
  354. package/dist/utils/detection/frameworkDetector.js.map +0 -1
  355. package/dist/utils/detection/index.d.ts +0 -9
  356. package/dist/utils/detection/index.js +0 -28
  357. package/dist/utils/detection/index.js.map +0 -1
  358. package/dist/utils/detection/projectTypeDetector.d.ts +0 -27
  359. package/dist/utils/detection/projectTypeDetector.js +0 -469
  360. package/dist/utils/detection/projectTypeDetector.js.map +0 -1
  361. package/dist/utils/diagramGenerator.d.ts +0 -49
  362. package/dist/utils/diagramGenerator.js +0 -218
  363. package/dist/utils/diagramGenerator.js.map +0 -1
  364. package/dist/utils/errorLogger.d.ts +0 -24
  365. package/dist/utils/errorLogger.js +0 -59
  366. package/dist/utils/errorLogger.js.map +0 -1
  367. package/dist/utils/estimationUtils.d.ts +0 -139
  368. package/dist/utils/estimationUtils.js +0 -329
  369. package/dist/utils/estimationUtils.js.map +0 -1
  370. package/dist/utils/fileFilters.d.ts +0 -72
  371. package/dist/utils/fileFilters.js +0 -338
  372. package/dist/utils/fileFilters.js.map +0 -1
  373. package/dist/utils/fileSystem.d.ts +0 -22
  374. package/dist/utils/fileSystem.js +0 -45
  375. package/dist/utils/fileSystem.js.map +0 -1
  376. package/dist/utils/index.d.ts +0 -22
  377. package/dist/utils/index.js +0 -52
  378. package/dist/utils/index.js.map +0 -1
  379. package/dist/utils/pathValidator.d.ts +0 -40
  380. package/dist/utils/pathValidator.js +0 -98
  381. package/dist/utils/pathValidator.js.map +0 -1
  382. package/dist/utils/priorityFilter.d.ts +0 -34
  383. package/dist/utils/priorityFilter.js +0 -54
  384. package/dist/utils/priorityFilter.js.map +0 -1
  385. package/dist/utils/projectDocs.d.ts +0 -47
  386. package/dist/utils/projectDocs.js +0 -158
  387. package/dist/utils/projectDocs.js.map +0 -1
  388. package/dist/utils/promptPaths.d.ts +0 -6
  389. package/dist/utils/promptPaths.js +0 -33
  390. package/dist/utils/promptPaths.js.map +0 -1
  391. package/dist/utils/promptTemplateManager.d.ts +0 -34
  392. package/dist/utils/promptTemplateManager.js +0 -141
  393. package/dist/utils/promptTemplateManager.js.map +0 -1
  394. package/dist/utils/review/consolidateReview.d.ts +0 -15
  395. package/dist/utils/review/consolidateReview.js +0 -481
  396. package/dist/utils/review/consolidateReview.js.map +0 -1
  397. package/dist/utils/review/fixDisplay.d.ts +0 -20
  398. package/dist/utils/review/fixDisplay.js +0 -84
  399. package/dist/utils/review/fixDisplay.js.map +0 -1
  400. package/dist/utils/review/fixImplementation.d.ts +0 -28
  401. package/dist/utils/review/fixImplementation.js +0 -60
  402. package/dist/utils/review/fixImplementation.js.map +0 -1
  403. package/dist/utils/review/index.d.ts +0 -13
  404. package/dist/utils/review/index.js +0 -50
  405. package/dist/utils/review/index.js.map +0 -1
  406. package/dist/utils/review/interactiveProcessing.d.ts +0 -25
  407. package/dist/utils/review/interactiveProcessing.js +0 -251
  408. package/dist/utils/review/interactiveProcessing.js.map +0 -1
  409. package/dist/utils/review/progressTracker.d.ts +0 -106
  410. package/dist/utils/review/progressTracker.js +0 -227
  411. package/dist/utils/review/progressTracker.js.map +0 -1
  412. package/dist/utils/review/reviewExtraction.d.ts +0 -31
  413. package/dist/utils/review/reviewExtraction.js +0 -324
  414. package/dist/utils/review/reviewExtraction.js.map +0 -1
  415. package/dist/utils/review/types.d.ts +0 -45
  416. package/dist/utils/review/types.js +0 -18
  417. package/dist/utils/review/types.js.map +0 -1
  418. package/dist/utils/reviewActionHandler.d.ts +0 -16
  419. package/dist/utils/reviewActionHandler.js +0 -34
  420. package/dist/utils/reviewActionHandler.js.map +0 -1
  421. package/dist/utils/reviewParser.d.ts +0 -34
  422. package/dist/utils/reviewParser.js +0 -218
  423. package/dist/utils/reviewParser.js.map +0 -1
  424. package/dist/utils/sanitizer.d.ts +0 -82
  425. package/dist/utils/sanitizer.js +0 -239
  426. package/dist/utils/sanitizer.js.map +0 -1
  427. package/dist/utils/smartFileSelector.d.ts +0 -50
  428. package/dist/utils/smartFileSelector.js +0 -261
  429. package/dist/utils/smartFileSelector.js.map +0 -1
  430. package/dist/utils/templateLoader.d.ts +0 -44
  431. package/dist/utils/templateLoader.js +0 -431
  432. package/dist/utils/templateLoader.js.map +0 -1
  433. package/dist/utils/treeGenerator.d.ts +0 -12
  434. package/dist/utils/treeGenerator.js +0 -133
  435. package/dist/utils/treeGenerator.js.map +0 -1
@@ -1,64 +0,0 @@
1
- "use strict";
2
- /**
3
- * @fileoverview Wrapper for the OpenRouter client.
4
- *
5
- * This module provides a wrapper for the OpenRouter client to handle dynamic imports.
6
- */
7
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
- if (k2 === undefined) k2 = k;
9
- var desc = Object.getOwnPropertyDescriptor(m, k);
10
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
- desc = { enumerable: true, get: function() { return m[k]; } };
12
- }
13
- Object.defineProperty(o, k2, desc);
14
- }) : (function(o, m, k, k2) {
15
- if (k2 === undefined) k2 = k;
16
- o[k2] = m[k];
17
- }));
18
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
19
- Object.defineProperty(o, "default", { enumerable: true, value: v });
20
- }) : function(o, v) {
21
- o["default"] = v;
22
- });
23
- var __importStar = (this && this.__importStar) || (function () {
24
- var ownKeys = function(o) {
25
- ownKeys = Object.getOwnPropertyNames || function (o) {
26
- var ar = [];
27
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
28
- return ar;
29
- };
30
- return ownKeys(o);
31
- };
32
- return function (mod) {
33
- if (mod && mod.__esModule) return mod;
34
- var result = {};
35
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
36
- __setModuleDefault(result, mod);
37
- return result;
38
- };
39
- })();
40
- Object.defineProperty(exports, "__esModule", { value: true });
41
- exports.initializeAnyOpenRouterModel = initializeAnyOpenRouterModel;
42
- exports.generateOpenRouterConsolidatedReview = generateOpenRouterConsolidatedReview;
43
- // Import the OpenRouter client directly
44
- const openRouterClient = __importStar(require("./openRouterClient"));
45
- /**
46
- * Initialize the OpenRouter client
47
- * @returns Promise resolving to a boolean indicating if initialization was successful
48
- */
49
- async function initializeAnyOpenRouterModel() {
50
- return openRouterClient.initializeAnyOpenRouterModel();
51
- }
52
- /**
53
- * Generate a consolidated review using the OpenRouter API
54
- * @param fileInfos Array of file information objects
55
- * @param project Project name
56
- * @param reviewType Type of review to perform
57
- * @param projectDocs Optional project documentation
58
- * @param options Review options
59
- * @returns Promise resolving to the review result
60
- */
61
- async function generateOpenRouterConsolidatedReview(fileInfos, project, reviewType, projectDocs, options) {
62
- return openRouterClient.generateOpenRouterConsolidatedReview(fileInfos, project, reviewType, projectDocs, options);
63
- }
64
- //# sourceMappingURL=openRouterClientWrapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openRouterClientWrapper.js","sourceRoot":"","sources":["../../src/clients/openRouterClientWrapper.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYH,oEAEC;AAWD,oFAcC;AAlCD,wCAAwC;AACxC,qEAAuD;AAEvD;;;GAGG;AACI,KAAK,UAAU,4BAA4B;IAChD,OAAO,gBAAgB,CAAC,4BAA4B,EAAE,CAAC;AACzD,CAAC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,oCAAoC,CACxD,SAAqB,EACrB,OAAe,EACf,UAAsB,EACtB,WAA+B,EAC/B,OAAsB;IAEtB,OAAO,gBAAgB,CAAC,oCAAoC,CAC1D,SAAS,EACT,OAAO,EACP,UAAU,EACV,WAAW,EACX,OAAO,CACR,CAAC;AACJ,CAAC"}
@@ -1,14 +0,0 @@
1
- /**
2
- * @fileoverview Utility for generating directory structure representations.
3
- *
4
- * This module provides functions for generating directory structure
5
- * representations from file paths, which is useful for providing context
6
- * in code reviews.
7
- */
8
- import type { FileInfo } from '../../types/review';
9
- /**
10
- * Generate a directory structure representation from file paths
11
- * @param files Array of file information objects
12
- * @returns String representation of directory structure
13
- */
14
- export declare function generateDirectoryStructure(files: FileInfo[]): string;
@@ -1,48 +0,0 @@
1
- "use strict";
2
- /**
3
- * @fileoverview Utility for generating directory structure representations.
4
- *
5
- * This module provides functions for generating directory structure
6
- * representations from file paths, which is useful for providing context
7
- * in code reviews.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.generateDirectoryStructure = generateDirectoryStructure;
11
- /**
12
- * Generate a directory structure representation from file paths
13
- * @param files Array of file information objects
14
- * @returns String representation of directory structure
15
- */
16
- function generateDirectoryStructure(files) {
17
- const structure = {};
18
- // Build tree structure
19
- for (const file of files) {
20
- // Skip files without relativePath
21
- if (!file.relativePath)
22
- continue;
23
- const parts = file.relativePath.split('/');
24
- let current = structure;
25
- for (let i = 0; i < parts.length - 1; i++) {
26
- const part = parts[i];
27
- if (!current[part]) {
28
- current[part] = {};
29
- }
30
- current = current[part];
31
- }
32
- const fileName = parts[parts.length - 1];
33
- current[fileName] = null;
34
- }
35
- // Convert to string representation
36
- function stringifyStructure(obj, indent = 0) {
37
- let result = '';
38
- for (const [key, value] of Object.entries(obj)) {
39
- result += `${' '.repeat(indent) + (value === null ? '📄 ' : '📁 ') + key}\n`;
40
- if (value !== null) {
41
- result += stringifyStructure(value, indent + 1);
42
- }
43
- }
44
- return result;
45
- }
46
- return stringifyStructure(structure);
47
- }
48
- //# sourceMappingURL=directoryStructure.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"directoryStructure.js","sourceRoot":"","sources":["../../../src/clients/utils/directoryStructure.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;A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AK,IAAI,EAAE,CAAC;gBACnB,MAAM,IAAI,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,kBAAkB,CAAC,SAAS,CAAC,CAAC;AACvC,CAAC"}
@@ -1,10 +0,0 @@
1
- /**
2
- * @fileoverview Index file for client utilities.
3
- *
4
- * This module exports all client utilities for easy importing.
5
- */
6
- export * from './directoryStructure';
7
- export * from './languageDetection';
8
- export * from './promptFormatter';
9
- export * from './promptLoader';
10
- export { estimateTokenCount, getCostInfo, getCostInfoFromText } from './tokenCounter';
@@ -1,31 +0,0 @@
1
- "use strict";
2
- /**
3
- * @fileoverview Index file for client utilities.
4
- *
5
- * This module exports all client utilities for easy importing.
6
- */
7
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
- if (k2 === undefined) k2 = k;
9
- var desc = Object.getOwnPropertyDescriptor(m, k);
10
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
- desc = { enumerable: true, get: function() { return m[k]; } };
12
- }
13
- Object.defineProperty(o, k2, desc);
14
- }) : (function(o, m, k, k2) {
15
- if (k2 === undefined) k2 = k;
16
- o[k2] = m[k];
17
- }));
18
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
- };
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.getCostInfoFromText = exports.getCostInfo = exports.estimateTokenCount = void 0;
23
- __exportStar(require("./directoryStructure"), exports);
24
- __exportStar(require("./languageDetection"), exports);
25
- __exportStar(require("./promptFormatter"), exports);
26
- __exportStar(require("./promptLoader"), exports);
27
- var tokenCounter_1 = require("./tokenCounter");
28
- Object.defineProperty(exports, "estimateTokenCount", { enumerable: true, get: function () { return tokenCounter_1.estimateTokenCount; } });
29
- Object.defineProperty(exports, "getCostInfo", { enumerable: true, get: function () { return tokenCounter_1.getCostInfo; } });
30
- Object.defineProperty(exports, "getCostInfoFromText", { enumerable: true, get: function () { return tokenCounter_1.getCostInfoFromText; } });
31
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/clients/utils/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;AAEH,uDAAqC;AACrC,sDAAoC;AACpC,oDAAkC;AAClC,iDAA+B;AAC/B,+CAAsF;AAA7E,kHAAA,kBAAkB,OAAA;AAAE,2GAAA,WAAW,OAAA;AAAE,mHAAA,mBAAmB,OAAA"}
@@ -1,13 +0,0 @@
1
- /**
2
- * @fileoverview Utilities for detecting programming languages from file extensions.
3
- *
4
- * This module provides functions for mapping file extensions to programming languages,
5
- * which is useful for formatting code snippets and providing language-specific hints
6
- * to AI models.
7
- */
8
- /**
9
- * Get the language name from a file extension
10
- * @param extension File extension
11
- * @returns Language name
12
- */
13
- export declare function getLanguageFromExtension(extension: string): string;
@@ -1,46 +0,0 @@
1
- "use strict";
2
- /**
3
- * @fileoverview Utilities for detecting programming languages from file extensions.
4
- *
5
- * This module provides functions for mapping file extensions to programming languages,
6
- * which is useful for formatting code snippets and providing language-specific hints
7
- * to AI models.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.getLanguageFromExtension = getLanguageFromExtension;
11
- /**
12
- * Get the language name from a file extension
13
- * @param extension File extension
14
- * @returns Language name
15
- */
16
- function getLanguageFromExtension(extension) {
17
- const extensionMap = {
18
- js: 'javascript',
19
- jsx: 'javascript',
20
- ts: 'typescript',
21
- tsx: 'typescript',
22
- py: 'python',
23
- rb: 'ruby',
24
- java: 'java',
25
- go: 'go',
26
- rs: 'rust',
27
- php: 'php',
28
- cs: 'csharp',
29
- cpp: 'cpp',
30
- c: 'c',
31
- h: 'c',
32
- hpp: 'cpp',
33
- swift: 'swift',
34
- kt: 'kotlin',
35
- md: 'markdown',
36
- json: 'json',
37
- yml: 'yaml',
38
- yaml: 'yaml',
39
- html: 'html',
40
- css: 'css',
41
- scss: 'scss',
42
- sql: 'sql',
43
- };
44
- return extensionMap[extension.toLowerCase()] || extension;
45
- }
46
- //# sourceMappingURL=languageDetection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"languageDetection.js","sourceRoot":"","sources":["../../../src/clients/utils/languageDetection.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAOH,4DA8BC;AAnCD;;;;GAIG;AACH,SAAgB,wBAAwB,CAAC,SAAiB;IACxD,MAAM,YAAY,GAA2B;QAC3C,EAAE,EAAE,YAAY;QAChB,GAAG,EAAE,YAAY;QACjB,EAAE,EAAE,YAAY;QAChB,GAAG,EAAE,YAAY;QACjB,EAAE,EAAE,QAAQ;QACZ,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,MAAM;QACZ,EAAE,EAAE,IAAI;QACR,EAAE,EAAE,MAAM;QACV,GAAG,EAAE,KAAK;QACV,EAAE,EAAE,QAAQ;QACZ,GAAG,EAAE,KAAK;QACV,CAAC,EAAE,GAAG;QACN,CAAC,EAAE,GAAG;QACN,GAAG,EAAE,KAAK;QACV,KAAK,EAAE,OAAO;QACd,EAAE,EAAE,QAAQ;QACZ,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,MAAM;QACX,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,KAAK;QACV,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,KAAK;KACX,CAAC;IAEF,OAAO,YAAY,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,IAAI,SAAS,CAAC;AAC5D,CAAC"}
@@ -1,37 +0,0 @@
1
- /**
2
- * @fileoverview Utilities for formatting prompts for AI models.
3
- *
4
- * This module provides functions for formatting prompts for different AI models,
5
- * including handling code blocks, project context, and review instructions.
6
- */
7
- import type { RunContext } from '../../types/review';
8
- import { type ProjectDocs } from '../../utils/projectDocs';
9
- /**
10
- * Format a code block with the appropriate language
11
- * @param fileContent The content of the file
12
- * @param filePath The path to the file
13
- * @returns The formatted code block
14
- */
15
- export declare function formatCodeBlock(fileContent: string, filePath: string): string;
16
- /**
17
- * Format a single file review prompt
18
- * @param promptTemplate The prompt template
19
- * @param fileContent The content of the file
20
- * @param filePath The path to the file
21
- * @param projectDocs Optional project documentation
22
- * @returns The formatted prompt
23
- */
24
- export declare function formatSingleFileReviewPrompt(promptTemplate: string, fileContent: string, filePath: string, projectDocs?: ProjectDocs | null, runContext?: RunContext): string;
25
- /**
26
- * Format a consolidated review prompt
27
- * @param promptTemplate The prompt template
28
- * @param projectName The name of the project
29
- * @param files Array of file information
30
- * @param projectDocs Optional project documentation
31
- * @returns The formatted prompt
32
- */
33
- export declare function formatConsolidatedReviewPrompt(promptTemplate: string, projectName: string, files: Array<{
34
- relativePath?: string;
35
- content: string;
36
- sizeInBytes: number;
37
- }>, projectDocs?: ProjectDocs | null, runContext?: RunContext): string;
@@ -1,150 +0,0 @@
1
- "use strict";
2
- /**
3
- * @fileoverview Utilities for formatting prompts for AI models.
4
- *
5
- * This module provides functions for formatting prompts for different AI models,
6
- * including handling code blocks, project context, and review instructions.
7
- */
8
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.formatCodeBlock = formatCodeBlock;
13
- exports.formatSingleFileReviewPrompt = formatSingleFileReviewPrompt;
14
- exports.formatConsolidatedReviewPrompt = formatConsolidatedReviewPrompt;
15
- const node_path_1 = __importDefault(require("node:path"));
16
- const projectDocs_1 = require("../../utils/projectDocs");
17
- const languageDetection_1 = require("../utils/languageDetection");
18
- const directoryStructure_1 = require("./directoryStructure");
19
- /**
20
- * Format a code block with the appropriate language
21
- * @param fileContent The content of the file
22
- * @param filePath The path to the file
23
- * @returns The formatted code block
24
- */
25
- function formatCodeBlock(fileContent, filePath) {
26
- // Get the file extension and language
27
- const fileExtension = node_path_1.default.extname(filePath).slice(1);
28
- const language = (0, languageDetection_1.getLanguageFromExtension)(fileExtension);
29
- // Format the code block with language
30
- return `\`\`\`${language}\n${fileContent}\n\`\`\``;
31
- }
32
- /**
33
- * Format a single file review prompt
34
- * @param promptTemplate The prompt template
35
- * @param fileContent The content of the file
36
- * @param filePath The path to the file
37
- * @param projectDocs Optional project documentation
38
- * @returns The formatted prompt
39
- */
40
- function formatSingleFileReviewPrompt(promptTemplate, fileContent, filePath, projectDocs, runContext) {
41
- // Format the code block
42
- const codeBlock = formatCodeBlock(fileContent, filePath);
43
- // Format project documentation if available
44
- const projectContext = projectDocs ? (0, projectDocs_1.formatProjectDocs)(projectDocs) : '';
45
- const contextSnapshot = buildContextSnapshot(runContext, filePath);
46
- const severityContract = buildSeverityContract();
47
- const contextAppendix = buildContextDocAppendix(runContext);
48
- const sections = [
49
- promptTemplate,
50
- contextSnapshot,
51
- severityContract,
52
- contextAppendix,
53
- projectContext ? `## Project Context\n${projectContext}` : '',
54
- `## File to Review: ${filePath}`,
55
- codeBlock,
56
- 'Please review this code and provide feedback according to the instructions. DO NOT REPEAT THE INSTRUCTIONS. DO NOT ASK FOR CODE TO REVIEW. FOCUS ONLY ON PROVIDING THE CODE REVIEW CONTENT.',
57
- ].filter(Boolean);
58
- return sections.join('\n\n');
59
- }
60
- /**
61
- * Format a consolidated review prompt
62
- * @param promptTemplate The prompt template
63
- * @param projectName The name of the project
64
- * @param files Array of file information
65
- * @param projectDocs Optional project documentation
66
- * @returns The formatted prompt
67
- */
68
- function formatConsolidatedReviewPrompt(promptTemplate, projectName, files, projectDocs, runContext) {
69
- // Format project documentation if available
70
- const projectContext = projectDocs ? (0, projectDocs_1.formatProjectDocs)(projectDocs) : '';
71
- // Convert the file array to FileInfo format for the directory structure generator
72
- const fileInfos = files.map((file) => ({
73
- path: file.relativePath || file.sizeInBytes.toString(), // Use sizeInBytes as fallback for path
74
- relativePath: file.relativePath,
75
- content: file.content,
76
- }));
77
- // Create a project structure summary using the utility function
78
- const directoryStructure = (0, directoryStructure_1.generateDirectoryStructure)(fileInfos);
79
- // Prepare file summaries
80
- const fileSummaries = files
81
- .map((file) => `- ${file.relativePath || 'unnamed file'} (${file.sizeInBytes} bytes)`)
82
- .join('\n');
83
- const contextSnapshot = buildContextSnapshot(runContext);
84
- const severityContract = buildSeverityContract();
85
- const contextAppendix = buildContextDocAppendix(runContext);
86
- const sections = [
87
- promptTemplate,
88
- contextSnapshot,
89
- severityContract,
90
- contextAppendix,
91
- projectContext ? `## Project Context\n${projectContext}` : '',
92
- `## Project: ${projectName}`,
93
- '## Directory Structure',
94
- `\`\`\`\n${directoryStructure}\n\`\`\``,
95
- '## File Summaries',
96
- fileSummaries,
97
- 'Please review this codebase and provide feedback according to the instructions. DO NOT REPEAT THE INSTRUCTIONS. DO NOT ASK FOR CODE TO REVIEW. FOCUS ONLY ON PROVIDING THE CODE REVIEW CONTENT.',
98
- ].filter(Boolean);
99
- return sections.join('\n\n');
100
- }
101
- function buildContextSnapshot(runContext, currentFile) {
102
- if (!runContext) {
103
- return '';
104
- }
105
- const lines = ['## Context Snapshot'];
106
- lines.push(`- Repository: ${runContext.repoName}`);
107
- if (runContext.reviewMode) {
108
- lines.push(`- Mode: ${runContext.reviewMode}`);
109
- }
110
- if (typeof runContext.groupIndex === 'number' &&
111
- typeof runContext.groupCount === 'number' &&
112
- runContext.groupCount > 0) {
113
- const label = runContext.groupLabel ? ` (${runContext.groupLabel})` : '';
114
- lines.push(`- File group: ${runContext.groupIndex}/${runContext.groupCount}${label}`);
115
- }
116
- if (runContext.totalFiles) {
117
- lines.push(`- Files in this run: ${runContext.totalFiles}`);
118
- }
119
- if (currentFile) {
120
- lines.push(`- Currently focused file: ${currentFile}`);
121
- }
122
- if (runContext.groupFiles && runContext.groupFiles.length > 0) {
123
- lines.push('\n### Files in this group');
124
- runContext.groupFiles.forEach((file) => lines.push(`- ${file}`));
125
- }
126
- if (runContext.docFiles && runContext.docFiles.length > 0) {
127
- lines.push('\n### Nearby docs/config included for context');
128
- runContext.docFiles.forEach((file) => lines.push(`- ${file}`));
129
- }
130
- lines.push('\nFocus on cross-file behavior in this bundle—shared state, config drift, and docs vs implementation mismatches.');
131
- return lines.join('\n');
132
- }
133
- function buildSeverityContract() {
134
- return `## Severity & Reporting Guidance\n- **Critical** – production-stopping bug, security break, or guaranteed data loss. Immediate fix required.\n- **High** – severe regression, auth/z issue, or problem affecting many users.\n- **Medium** – correctness gaps, testing deficiencies, or maintainability risks that will bite soon.\n- **Low** – readability, structure, or polish issues that still deserve a fix.\n- **Missing context** – when you cannot complete an assessment, add an issue referencing the exact file that lacks detail (e.g., "missing context in src/config/app.ts").\n-\n-Always set the JSON 'priority' to one of the above values so UI totals remain accurate.`;
135
- }
136
- function buildContextDocAppendix(runContext) {
137
- if (!runContext?.contextDocs || runContext.contextDocs.length === 0) {
138
- return '';
139
- }
140
- const docs = runContext.contextDocs;
141
- const lines = ['## Supporting Context'];
142
- for (const doc of docs) {
143
- lines.push(`### ${doc.path}`);
144
- lines.push('```');
145
- lines.push(doc.snippet.trim() || '(empty file)');
146
- lines.push('```');
147
- }
148
- return lines.join('\n');
149
- }
150
- //# sourceMappingURL=promptFormatter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"promptFormatter.js","sourceRoot":"","sources":["../../../src/clients/utils/promptFormatter.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAcH,0CAOC;AAUD,oEA6BC;AAUD,wEA4CC;AAhHD,0DAA6B;AAE7B,yDAA8E;AAC9E,kEAAsE;AACtE,6DAAkE;AAElE;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,WAAmB,EAAE,QAAgB;IACnE,sCAAsC;IACtC,MAAM,aAAa,GAAG,mBAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACtD,MAAM,QAA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AAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,IAAI,CACR,kHAAkH,CACnH,CAAC;IAEF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,qBAAqB;IAC5B,OAAO,4pBAA4pB,CAAC;AACtqB,CAAC;AAED,SAAS,uBAAuB,CAAC,UAAuB;IACtD,IAAI,CAAC,UAAU,EAAE,WAAW,IAAI,UAAU,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpE,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,IAAI,GAAG,UAAU,CAAC,WAAW,CAAC;IACpC,MAAM,KAAK,GAAa,CAAC,uBAAuB,CAAC,CAAC;IAClD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,cAAc,CAAC,CAAC;QACjD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -1,27 +0,0 @@
1
- /**
2
- * @fileoverview Utilities for loading prompt templates.
3
- *
4
- * IMPORTANT: This module provides functions for loading prompt templates from BUNDLED PROMPTS ONLY.
5
- * The system prioritizes bundled prompts and only falls back to file system prompts if a bundled prompt is not found.
6
- *
7
- * All core prompts are defined in the bundledPrompts.ts file and accessed through the PromptManager.
8
- * This ensures that the system always has access to the prompts it needs, regardless of
9
- * where it's installed or how it's packaged.
10
- *
11
- * This module is a compatibility layer that uses the PromptManager internally.
12
- */
13
- import type { ReviewOptions, ReviewType } from '../../types/review';
14
- /**
15
- * Load a prompt template
16
- * @param reviewType Type of review to perform
17
- * @param options Review options including language
18
- * @returns Promise resolving to the prompt template
19
- *
20
- * IMPORTANT: This function prioritizes bundled prompts.
21
- * The system will first try to use bundled prompts defined in bundledPrompts.ts.
22
- * Only if a bundled prompt is not found will it fall back to custom templates.
23
- *
24
- * This ensures that the system always has access to the prompts it needs,
25
- * regardless of where it's installed or how it's packaged.
26
- */
27
- export declare function loadPromptTemplate(reviewType: ReviewType, languageOrOptions?: string | ReviewOptions): Promise<string>;
@@ -1,49 +0,0 @@
1
- "use strict";
2
- /**
3
- * @fileoverview Utilities for loading prompt templates.
4
- *
5
- * IMPORTANT: This module provides functions for loading prompt templates from BUNDLED PROMPTS ONLY.
6
- * The system prioritizes bundled prompts and only falls back to file system prompts if a bundled prompt is not found.
7
- *
8
- * All core prompts are defined in the bundledPrompts.ts file and accessed through the PromptManager.
9
- * This ensures that the system always has access to the prompts it needs, regardless of
10
- * where it's installed or how it's packaged.
11
- *
12
- * This module is a compatibility layer that uses the PromptManager internally.
13
- */
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.loadPromptTemplate = loadPromptTemplate;
16
- const PromptManager_1 = require("../../prompts/PromptManager");
17
- /**
18
- * Load a prompt template
19
- * @param reviewType Type of review to perform
20
- * @param options Review options including language
21
- * @returns Promise resolving to the prompt template
22
- *
23
- * IMPORTANT: This function prioritizes bundled prompts.
24
- * The system will first try to use bundled prompts defined in bundledPrompts.ts.
25
- * Only if a bundled prompt is not found will it fall back to custom templates.
26
- *
27
- * This ensures that the system always has access to the prompts it needs,
28
- * regardless of where it's installed or how it's packaged.
29
- */
30
- async function loadPromptTemplate(reviewType, languageOrOptions) {
31
- // Get the prompt manager instance
32
- const promptManager = PromptManager_1.PromptManager.getInstance();
33
- // Convert string language to options object if needed
34
- let options;
35
- if (typeof languageOrOptions === 'string') {
36
- options = {
37
- language: languageOrOptions,
38
- type: 'quick-fixes',
39
- includeTests: false,
40
- output: 'markdown',
41
- };
42
- }
43
- else {
44
- options = languageOrOptions;
45
- }
46
- // Use the prompt manager to get the template
47
- return promptManager.getPromptTemplate(reviewType, options);
48
- }
49
- //# sourceMappingURL=promptLoader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"promptLoader.js","sourceRoot":"","sources":["../../../src/clients/utils/promptLoader.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AAkBH,gDAuBC;AAvCD,+DAA4D;AAG5D;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,kBAAkB,CACtC,UAAsB,EACtB,iBAA0C;IAE1C,kCAAkC;IAClC,MAAM,aAAa,GAAG,6BAAa,CAAC,WAAW,EAAE,CAAC;IAElD,sDAAsD;IACtD,IAAI,OAAkC,CAAC;IAEvC,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE,CAAC;QAC1C,OAAO,GAAG;YACR,QAAQ,EAAE,iBAAwB;YAClC,IAAI,EAAE,aAAa;YACnB,YAAY,EAAE,KAAK;YACnB,MAAM,EAAE,UAAU;SACnB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,iBAAiB,CAAC;IAC9B,CAAC;IAED,6CAA6C;IAC7C,OAAO,aAAa,CAAC,iBAAiB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC"}
@@ -1,81 +0,0 @@
1
- /**
2
- * @fileoverview Token counting and cost estimation utilities for AI API usage.
3
- *
4
- * This module provides utilities for estimating token usage and associated costs
5
- * when using OpenRouter models. It implements accurate token counting using
6
- * model-specific tokenizers and maintains current pricing information for OpenRouter models.
7
- *
8
- * Key responsibilities:
9
- * - Counting tokens for input and output text using model-specific tokenizers
10
- * - Calculating approximate API costs based on token usage and model
11
- * - Tracking different pricing tiers for various AI models
12
- * - Providing cost information for review outputs
13
- * - Supporting cost-aware decision making for API usage
14
- *
15
- * These utilities help users understand the resource usage and costs associated
16
- * with their code reviews, enabling better planning and resource allocation.
17
- */
18
- /**
19
- * Utility functions for estimating token counts and costs for AI API calls
20
- */
21
- /**
22
- * Count tokens in a text using the appropriate tokenizer for a model
23
- * @param text Text to count tokens for
24
- * @param modelName Name of the model (optional)
25
- * @returns Token count
26
- */
27
- export declare function estimateTokenCount(text: string, modelName?: string): number;
28
- /**
29
- * Calculate the estimated cost for an AI API call
30
- * @param inputTokens Number of input tokens
31
- * @param outputTokens Number of output tokens
32
- * @param modelName Name of the model used
33
- * @returns Estimated cost in USD
34
- */
35
- export declare function calculateCost(inputTokens: number, outputTokens: number, modelName?: string): number;
36
- /**
37
- * Format a cost value as a currency string
38
- * @param cost Cost value in USD
39
- * @returns Formatted cost string
40
- */
41
- export declare function formatCost(cost: number): string;
42
- /**
43
- * Cost information for an API call
44
- */
45
- export interface CostInfo {
46
- inputTokens: number;
47
- outputTokens: number;
48
- totalTokens: number;
49
- estimatedCost: number;
50
- formattedCost: string;
51
- cost: number;
52
- passCount?: number;
53
- perPassCosts?: PassCostInfo[];
54
- contextMaintenanceFactor?: number;
55
- }
56
- /**
57
- * Cost information for a single pass in a multi-pass review
58
- */
59
- export interface PassCostInfo {
60
- passNumber: number;
61
- inputTokens: number;
62
- outputTokens: number;
63
- totalTokens: number;
64
- estimatedCost: number;
65
- }
66
- /**
67
- * Calculate cost information for an API call based on text
68
- * @param inputText Input text sent to the API
69
- * @param outputText Output text received from the API
70
- * @param modelName Name of the model used
71
- * @returns Cost information
72
- */
73
- export declare function getCostInfoFromText(inputText: string, outputText: string, modelName?: string): CostInfo;
74
- /**
75
- * Calculate cost information for an API call based on token counts
76
- * @param inputTokens Number of input tokens
77
- * @param outputTokens Number of output tokens
78
- * @param modelName Name of the model used
79
- * @returns Cost information
80
- */
81
- export declare function getCostInfo(inputTokens: number, outputTokens: number, modelName?: string): CostInfo;