codereview-aia 0.2.1 → 0.2.3

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 (436) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +1 -7
  3. package/dist/index.js.map +1 -1
  4. package/dist/runtime/api/batcher.d.ts +20 -0
  5. package/dist/runtime/api/batcher.js +52 -0
  6. package/dist/runtime/api/batcher.js.map +1 -0
  7. package/dist/runtime/api/edgeClient.d.ts +102 -0
  8. package/dist/runtime/api/edgeClient.js +162 -0
  9. package/dist/runtime/api/edgeClient.js.map +1 -0
  10. package/dist/runtime/api/index.d.ts +2 -0
  11. package/dist/runtime/api/index.js +9 -0
  12. package/dist/runtime/api/index.js.map +1 -0
  13. package/dist/runtime/cliEntry.js +24 -76
  14. package/dist/runtime/cliEntry.js.map +1 -1
  15. package/dist/runtime/errors.d.ts +13 -3
  16. package/dist/runtime/errors.js +31 -8
  17. package/dist/runtime/errors.js.map +1 -1
  18. package/dist/runtime/llm/index.d.ts +1 -0
  19. package/dist/runtime/llm/index.js +6 -0
  20. package/dist/runtime/llm/index.js.map +1 -0
  21. package/dist/runtime/llm/openRouterClient.d.ts +13 -0
  22. package/dist/runtime/llm/openRouterClient.js +187 -0
  23. package/dist/runtime/llm/openRouterClient.js.map +1 -0
  24. package/dist/runtime/phpFileResolver.d.ts +14 -0
  25. package/dist/runtime/phpFileResolver.js +231 -0
  26. package/dist/runtime/phpFileResolver.js.map +1 -0
  27. package/dist/runtime/phpcsParser.d.ts +10 -0
  28. package/dist/runtime/phpcsParser.js +35 -0
  29. package/dist/runtime/phpcsParser.js.map +1 -0
  30. package/dist/runtime/phpcsRunner.d.ts +32 -0
  31. package/dist/runtime/phpcsRunner.js +62 -0
  32. package/dist/runtime/phpcsRunner.js.map +1 -0
  33. package/dist/runtime/reportWriter.d.ts +17 -0
  34. package/dist/runtime/reportWriter.js +80 -0
  35. package/dist/runtime/reportWriter.js.map +1 -0
  36. package/dist/runtime/reviewPipeline.d.ts +14 -36
  37. package/dist/runtime/reviewPipeline.js +146 -199
  38. package/dist/runtime/reviewPipeline.js.map +1 -1
  39. package/dist/runtime/ui/RuntimeApp.js +23 -154
  40. package/dist/runtime/ui/RuntimeApp.js.map +1 -1
  41. package/dist/runtime/ui/screens/AuthScreen.d.ts +2 -3
  42. package/dist/runtime/ui/screens/AuthScreen.js +7 -53
  43. package/dist/runtime/ui/screens/AuthScreen.js.map +1 -1
  44. package/dist/runtime/ui/screens/ModeSelection.d.ts +1 -2
  45. package/dist/runtime/ui/screens/ModeSelection.js +14 -139
  46. package/dist/runtime/ui/screens/ModeSelection.js.map +1 -1
  47. package/dist/runtime/ui/screens/ProgressScreen.d.ts +5 -13
  48. package/dist/runtime/ui/screens/ProgressScreen.js +24 -61
  49. package/dist/runtime/ui/screens/ProgressScreen.js.map +1 -1
  50. package/dist/runtime/ui/screens/ResultsScreen.js +7 -17
  51. package/dist/runtime/ui/screens/ResultsScreen.js.map +1 -1
  52. package/package.json +4 -44
  53. package/dist/analysis/FindingsExtractor.d.ts +0 -105
  54. package/dist/analysis/FindingsExtractor.js +0 -363
  55. package/dist/analysis/FindingsExtractor.js.map +0 -1
  56. package/dist/analysis/ai-detection/analyzers/BaseAnalyzer.d.ts +0 -111
  57. package/dist/analysis/ai-detection/analyzers/BaseAnalyzer.js +0 -215
  58. package/dist/analysis/ai-detection/analyzers/BaseAnalyzer.js.map +0 -1
  59. package/dist/analysis/ai-detection/analyzers/DocumentationAnalyzer.d.ts +0 -142
  60. package/dist/analysis/ai-detection/analyzers/DocumentationAnalyzer.js +0 -503
  61. package/dist/analysis/ai-detection/analyzers/DocumentationAnalyzer.js.map +0 -1
  62. package/dist/analysis/ai-detection/analyzers/GitHistoryAnalyzer.d.ts +0 -88
  63. package/dist/analysis/ai-detection/analyzers/GitHistoryAnalyzer.js +0 -343
  64. package/dist/analysis/ai-detection/analyzers/GitHistoryAnalyzer.js.map +0 -1
  65. package/dist/analysis/ai-detection/core/AIDetectionEngine.d.ts +0 -104
  66. package/dist/analysis/ai-detection/core/AIDetectionEngine.js +0 -369
  67. package/dist/analysis/ai-detection/core/AIDetectionEngine.js.map +0 -1
  68. package/dist/analysis/ai-detection/types/DetectionTypes.d.ts +0 -364
  69. package/dist/analysis/ai-detection/types/DetectionTypes.js +0 -32
  70. package/dist/analysis/ai-detection/types/DetectionTypes.js.map +0 -1
  71. package/dist/analysis/ai-detection/utils/SubmissionConverter.d.ts +0 -97
  72. package/dist/analysis/ai-detection/utils/SubmissionConverter.js +0 -339
  73. package/dist/analysis/ai-detection/utils/SubmissionConverter.js.map +0 -1
  74. package/dist/analysis/context/ReviewContext.d.ts +0 -184
  75. package/dist/analysis/context/ReviewContext.js +0 -294
  76. package/dist/analysis/context/ReviewContext.js.map +0 -1
  77. package/dist/analysis/context/index.d.ts +0 -6
  78. package/dist/analysis/context/index.js +0 -23
  79. package/dist/analysis/context/index.js.map +0 -1
  80. package/dist/analysis/index.d.ts +0 -7
  81. package/dist/analysis/index.js +0 -24
  82. package/dist/analysis/index.js.map +0 -1
  83. package/dist/analysis/static/wpPhpcsRunner.d.ts +0 -11
  84. package/dist/analysis/static/wpPhpcsRunner.js +0 -219
  85. package/dist/analysis/static/wpPhpcsRunner.js.map +0 -1
  86. package/dist/analysis/tokens/TokenAnalysisFormatter.d.ts +0 -27
  87. package/dist/analysis/tokens/TokenAnalysisFormatter.js +0 -143
  88. package/dist/analysis/tokens/TokenAnalysisFormatter.js.map +0 -1
  89. package/dist/analysis/tokens/TokenAnalyzer.d.ts +0 -155
  90. package/dist/analysis/tokens/TokenAnalyzer.js +0 -502
  91. package/dist/analysis/tokens/TokenAnalyzer.js.map +0 -1
  92. package/dist/analysis/tokens/index.d.ts +0 -7
  93. package/dist/analysis/tokens/index.js +0 -24
  94. package/dist/analysis/tokens/index.js.map +0 -1
  95. package/dist/clients/base/abstractClient.d.ts +0 -99
  96. package/dist/clients/base/abstractClient.js +0 -98
  97. package/dist/clients/base/abstractClient.js.map +0 -1
  98. package/dist/clients/base/httpClient.d.ts +0 -24
  99. package/dist/clients/base/httpClient.js +0 -147
  100. package/dist/clients/base/httpClient.js.map +0 -1
  101. package/dist/clients/base/index.d.ts +0 -11
  102. package/dist/clients/base/index.js +0 -28
  103. package/dist/clients/base/index.js.map +0 -1
  104. package/dist/clients/base/modelDetection.d.ts +0 -41
  105. package/dist/clients/base/modelDetection.js +0 -88
  106. package/dist/clients/base/modelDetection.js.map +0 -1
  107. package/dist/clients/base/responseProcessor.d.ts +0 -45
  108. package/dist/clients/base/responseProcessor.js +0 -495
  109. package/dist/clients/base/responseProcessor.js.map +0 -1
  110. package/dist/clients/factory/clientFactory.d.ts +0 -23
  111. package/dist/clients/factory/clientFactory.js +0 -50
  112. package/dist/clients/factory/clientFactory.js.map +0 -1
  113. package/dist/clients/factory/index.d.ts +0 -7
  114. package/dist/clients/factory/index.js +0 -24
  115. package/dist/clients/factory/index.js.map +0 -1
  116. package/dist/clients/implementations/index.d.ts +0 -7
  117. package/dist/clients/implementations/index.js +0 -24
  118. package/dist/clients/implementations/index.js.map +0 -1
  119. package/dist/clients/implementations/openRouterClient.d.ts +0 -69
  120. package/dist/clients/implementations/openRouterClient.js +0 -294
  121. package/dist/clients/implementations/openRouterClient.js.map +0 -1
  122. package/dist/clients/openRouterClient.d.ts +0 -42
  123. package/dist/clients/openRouterClient.js +0 -580
  124. package/dist/clients/openRouterClient.js.map +0 -1
  125. package/dist/clients/openRouterClientWrapper.d.ts +0 -22
  126. package/dist/clients/openRouterClientWrapper.js +0 -64
  127. package/dist/clients/openRouterClientWrapper.js.map +0 -1
  128. package/dist/clients/utils/directoryStructure.d.ts +0 -14
  129. package/dist/clients/utils/directoryStructure.js +0 -48
  130. package/dist/clients/utils/directoryStructure.js.map +0 -1
  131. package/dist/clients/utils/index.d.ts +0 -10
  132. package/dist/clients/utils/index.js +0 -31
  133. package/dist/clients/utils/index.js.map +0 -1
  134. package/dist/clients/utils/languageDetection.d.ts +0 -13
  135. package/dist/clients/utils/languageDetection.js +0 -46
  136. package/dist/clients/utils/languageDetection.js.map +0 -1
  137. package/dist/clients/utils/promptFormatter.d.ts +0 -37
  138. package/dist/clients/utils/promptFormatter.js +0 -186
  139. package/dist/clients/utils/promptFormatter.js.map +0 -1
  140. package/dist/clients/utils/promptLoader.d.ts +0 -27
  141. package/dist/clients/utils/promptLoader.js +0 -49
  142. package/dist/clients/utils/promptLoader.js.map +0 -1
  143. package/dist/clients/utils/tokenCounter.d.ts +0 -81
  144. package/dist/clients/utils/tokenCounter.js +0 -184
  145. package/dist/clients/utils/tokenCounter.js.map +0 -1
  146. package/dist/core/ApiClientSelector.d.ts +0 -8
  147. package/dist/core/ApiClientSelector.js +0 -29
  148. package/dist/core/ApiClientSelector.js.map +0 -1
  149. package/dist/core/ConfigurationService.d.ts +0 -307
  150. package/dist/core/ConfigurationService.js +0 -516
  151. package/dist/core/ConfigurationService.js.map +0 -1
  152. package/dist/core/ConsolidationService.d.ts +0 -99
  153. package/dist/core/ConsolidationService.js +0 -341
  154. package/dist/core/ConsolidationService.js.map +0 -1
  155. package/dist/core/InteractiveDisplayManager.d.ts +0 -22
  156. package/dist/core/InteractiveDisplayManager.js +0 -70
  157. package/dist/core/InteractiveDisplayManager.js.map +0 -1
  158. package/dist/core/OutputManager.d.ts +0 -26
  159. package/dist/core/OutputManager.js +0 -217
  160. package/dist/core/OutputManager.js.map +0 -1
  161. package/dist/core/ReviewGenerator.d.ts +0 -13
  162. package/dist/core/ReviewGenerator.js +0 -102
  163. package/dist/core/ReviewGenerator.js.map +0 -1
  164. package/dist/core/fileDiscovery.d.ts +0 -35
  165. package/dist/core/fileDiscovery.js +0 -202
  166. package/dist/core/fileDiscovery.js.map +0 -1
  167. package/dist/core/handlers/EstimationHandler.d.ts +0 -18
  168. package/dist/core/handlers/EstimationHandler.js +0 -110
  169. package/dist/core/handlers/EstimationHandler.js.map +0 -1
  170. package/dist/core/handlers/FileProcessingHandler.d.ts +0 -31
  171. package/dist/core/handlers/FileProcessingHandler.js +0 -164
  172. package/dist/core/handlers/FileProcessingHandler.js.map +0 -1
  173. package/dist/core/handlers/OutputHandler.d.ts +0 -27
  174. package/dist/core/handlers/OutputHandler.js +0 -127
  175. package/dist/core/handlers/OutputHandler.js.map +0 -1
  176. package/dist/core/handlers/ReviewExecutor.d.ts +0 -32
  177. package/dist/core/handlers/ReviewExecutor.js +0 -111
  178. package/dist/core/handlers/ReviewExecutor.js.map +0 -1
  179. package/dist/core/reviewOrchestrator.d.ts +0 -24
  180. package/dist/core/reviewOrchestrator.js +0 -354
  181. package/dist/core/reviewOrchestrator.js.map +0 -1
  182. package/dist/core/utils/ModelInfoUtils.d.ts +0 -16
  183. package/dist/core/utils/ModelInfoUtils.js +0 -54
  184. package/dist/core/utils/ModelInfoUtils.js.map +0 -1
  185. package/dist/formatters/outputFormatter.d.ts +0 -31
  186. package/dist/formatters/outputFormatter.js +0 -65
  187. package/dist/formatters/outputFormatter.js.map +0 -1
  188. package/dist/formatters/utils/IssueFormatters.d.ts +0 -20
  189. package/dist/formatters/utils/IssueFormatters.js +0 -67
  190. package/dist/formatters/utils/IssueFormatters.js.map +0 -1
  191. package/dist/formatters/utils/JsonFormatter.d.ts +0 -13
  192. package/dist/formatters/utils/JsonFormatter.js +0 -57
  193. package/dist/formatters/utils/JsonFormatter.js.map +0 -1
  194. package/dist/formatters/utils/MarkdownFormatters.d.ts +0 -51
  195. package/dist/formatters/utils/MarkdownFormatters.js +0 -456
  196. package/dist/formatters/utils/MarkdownFormatters.js.map +0 -1
  197. package/dist/formatters/utils/MetadataFormatter.d.ts +0 -65
  198. package/dist/formatters/utils/MetadataFormatter.js +0 -219
  199. package/dist/formatters/utils/MetadataFormatter.js.map +0 -1
  200. package/dist/formatters/utils/ModelInfoExtractor.d.ts +0 -33
  201. package/dist/formatters/utils/ModelInfoExtractor.js +0 -111
  202. package/dist/formatters/utils/ModelInfoExtractor.js.map +0 -1
  203. package/dist/plugins/PluginInterface.d.ts +0 -44
  204. package/dist/plugins/PluginInterface.js +0 -9
  205. package/dist/plugins/PluginInterface.js.map +0 -1
  206. package/dist/plugins/PluginManager.d.ts +0 -51
  207. package/dist/plugins/PluginManager.js +0 -151
  208. package/dist/plugins/PluginManager.js.map +0 -1
  209. package/dist/prompts/PromptManager.d.ts +0 -30
  210. package/dist/prompts/PromptManager.js +0 -62
  211. package/dist/prompts/PromptManager.js.map +0 -1
  212. package/dist/prompts/cache/PromptCache.d.ts +0 -32
  213. package/dist/prompts/cache/PromptCache.js +0 -48
  214. package/dist/prompts/cache/PromptCache.js.map +0 -1
  215. package/dist/runtime/auth/service.d.ts +0 -2
  216. package/dist/runtime/auth/service.js +0 -41
  217. package/dist/runtime/auth/service.js.map +0 -1
  218. package/dist/runtime/auth/session.d.ts +0 -5
  219. package/dist/runtime/auth/session.js +0 -87
  220. package/dist/runtime/auth/session.js.map +0 -1
  221. package/dist/runtime/auth/types.d.ts +0 -9
  222. package/dist/runtime/auth/types.js +0 -3
  223. package/dist/runtime/auth/types.js.map +0 -1
  224. package/dist/runtime/fileCollector.d.ts +0 -14
  225. package/dist/runtime/fileCollector.js +0 -383
  226. package/dist/runtime/fileCollector.js.map +0 -1
  227. package/dist/runtime/manifest.d.ts +0 -1
  228. package/dist/runtime/manifest.js +0 -65
  229. package/dist/runtime/manifest.js.map +0 -1
  230. package/dist/runtime/openrouterProxy.d.ts +0 -4
  231. package/dist/runtime/openrouterProxy.js +0 -43
  232. package/dist/runtime/openrouterProxy.js.map +0 -1
  233. package/dist/runtime/preprod/batchStreamer.d.ts +0 -54
  234. package/dist/runtime/preprod/batchStreamer.js +0 -159
  235. package/dist/runtime/preprod/batchStreamer.js.map +0 -1
  236. package/dist/runtime/preprod/crEdgeServiceClient.d.ts +0 -30
  237. package/dist/runtime/preprod/crEdgeServiceClient.js +0 -133
  238. package/dist/runtime/preprod/crEdgeServiceClient.js.map +0 -1
  239. package/dist/runtime/preprod/progressTracker.d.ts +0 -21
  240. package/dist/runtime/preprod/progressTracker.js +0 -80
  241. package/dist/runtime/preprod/progressTracker.js.map +0 -1
  242. package/dist/runtime/preprod/webCheck.d.ts +0 -1
  243. package/dist/runtime/preprod/webCheck.js +0 -102
  244. package/dist/runtime/preprod/webCheck.js.map +0 -1
  245. package/dist/runtime/proxyConfig.d.ts +0 -6
  246. package/dist/runtime/proxyConfig.js +0 -86
  247. package/dist/runtime/proxyConfig.js.map +0 -1
  248. package/dist/runtime/proxyEnvironment.d.ts +0 -3
  249. package/dist/runtime/proxyEnvironment.js +0 -63
  250. package/dist/runtime/proxyEnvironment.js.map +0 -1
  251. package/dist/runtime/reportMerge.d.ts +0 -30
  252. package/dist/runtime/reportMerge.js +0 -70
  253. package/dist/runtime/reportMerge.js.map +0 -1
  254. package/dist/runtime/reporting/markdownReportBuilder.d.ts +0 -17
  255. package/dist/runtime/reporting/markdownReportBuilder.js +0 -154
  256. package/dist/runtime/reporting/markdownReportBuilder.js.map +0 -1
  257. package/dist/runtime/reporting/reportDataCollector.d.ts +0 -31
  258. package/dist/runtime/reporting/reportDataCollector.js +0 -170
  259. package/dist/runtime/reporting/reportDataCollector.js.map +0 -1
  260. package/dist/runtime/reporting/summaryGenerator.d.ts +0 -10
  261. package/dist/runtime/reporting/summaryGenerator.js +0 -67
  262. package/dist/runtime/reporting/summaryGenerator.js.map +0 -1
  263. package/dist/runtime/runAiCodeReview.d.ts +0 -36
  264. package/dist/runtime/runAiCodeReview.js +0 -409
  265. package/dist/runtime/runAiCodeReview.js.map +0 -1
  266. package/dist/runtime/runtimeConfig.d.ts +0 -4
  267. package/dist/runtime/runtimeConfig.js +0 -7
  268. package/dist/runtime/runtimeConfig.js.map +0 -1
  269. package/dist/strategies/ArchitecturalReviewStrategy.d.ts +0 -29
  270. package/dist/strategies/ArchitecturalReviewStrategy.js +0 -42
  271. package/dist/strategies/ArchitecturalReviewStrategy.js.map +0 -1
  272. package/dist/strategies/CodingTestReviewStrategy.d.ts +0 -194
  273. package/dist/strategies/CodingTestReviewStrategy.js +0 -681
  274. package/dist/strategies/CodingTestReviewStrategy.js.map +0 -1
  275. package/dist/strategies/ConsolidatedReviewStrategy.d.ts +0 -25
  276. package/dist/strategies/ConsolidatedReviewStrategy.js +0 -45
  277. package/dist/strategies/ConsolidatedReviewStrategy.js.map +0 -1
  278. package/dist/strategies/ExtractPatternsReviewStrategy.d.ts +0 -30
  279. package/dist/strategies/ExtractPatternsReviewStrategy.js +0 -51
  280. package/dist/strategies/ExtractPatternsReviewStrategy.js.map +0 -1
  281. package/dist/strategies/MultiPassReviewStrategy.d.ts +0 -86
  282. package/dist/strategies/MultiPassReviewStrategy.js +0 -590
  283. package/dist/strategies/MultiPassReviewStrategy.js.map +0 -1
  284. package/dist/strategies/ReviewStrategy.d.ts +0 -45
  285. package/dist/strategies/ReviewStrategy.js +0 -24
  286. package/dist/strategies/ReviewStrategy.js.map +0 -1
  287. package/dist/strategies/StrategyFactory.d.ts +0 -19
  288. package/dist/strategies/StrategyFactory.js +0 -72
  289. package/dist/strategies/StrategyFactory.js.map +0 -1
  290. package/dist/strategies/index.d.ts +0 -13
  291. package/dist/strategies/index.js +0 -30
  292. package/dist/strategies/index.js.map +0 -1
  293. package/dist/tokenizers/baseTokenizer.d.ts +0 -25
  294. package/dist/tokenizers/baseTokenizer.js +0 -48
  295. package/dist/tokenizers/baseTokenizer.js.map +0 -1
  296. package/dist/tokenizers/gptTokenizer.d.ts +0 -7
  297. package/dist/tokenizers/gptTokenizer.js +0 -28
  298. package/dist/tokenizers/gptTokenizer.js.map +0 -1
  299. package/dist/tokenizers/index.d.ts +0 -7
  300. package/dist/tokenizers/index.js +0 -24
  301. package/dist/tokenizers/index.js.map +0 -1
  302. package/dist/types/apiResponses.d.ts +0 -39
  303. package/dist/types/apiResponses.js +0 -9
  304. package/dist/types/apiResponses.js.map +0 -1
  305. package/dist/types/cli.d.ts +0 -22
  306. package/dist/types/cli.js +0 -3
  307. package/dist/types/cli.js.map +0 -1
  308. package/dist/types/common.d.ts +0 -22
  309. package/dist/types/common.js +0 -14
  310. package/dist/types/common.js.map +0 -1
  311. package/dist/types/configuration.d.ts +0 -682
  312. package/dist/types/configuration.js +0 -65
  313. package/dist/types/configuration.js.map +0 -1
  314. package/dist/types/review.d.ts +0 -318
  315. package/dist/types/review.js +0 -8
  316. package/dist/types/review.js.map +0 -1
  317. package/dist/types/reviewSchema.d.ts +0 -543
  318. package/dist/types/reviewSchema.js +0 -121
  319. package/dist/types/reviewSchema.js.map +0 -1
  320. package/dist/types/structuredReview.d.ts +0 -119
  321. package/dist/types/structuredReview.js +0 -6
  322. package/dist/types/structuredReview.js.map +0 -1
  323. package/dist/types/tokenAnalysis.d.ts +0 -44
  324. package/dist/types/tokenAnalysis.js +0 -4
  325. package/dist/types/tokenAnalysis.js.map +0 -1
  326. package/dist/utils/FileReader.d.ts +0 -33
  327. package/dist/utils/FileReader.js +0 -88
  328. package/dist/utils/FileReader.js.map +0 -1
  329. package/dist/utils/FileWriter.d.ts +0 -26
  330. package/dist/utils/FileWriter.js +0 -76
  331. package/dist/utils/FileWriter.js.map +0 -1
  332. package/dist/utils/PathGenerator.d.ts +0 -30
  333. package/dist/utils/PathGenerator.js +0 -82
  334. package/dist/utils/PathGenerator.js.map +0 -1
  335. package/dist/utils/api/apiUtils.d.ts +0 -3
  336. package/dist/utils/api/apiUtils.js +0 -20
  337. package/dist/utils/api/apiUtils.js.map +0 -1
  338. package/dist/utils/api/index.d.ts +0 -1
  339. package/dist/utils/api/index.js +0 -18
  340. package/dist/utils/api/index.js.map +0 -1
  341. package/dist/utils/apiErrorHandler.d.ts +0 -130
  342. package/dist/utils/apiErrorHandler.js +0 -256
  343. package/dist/utils/apiErrorHandler.js.map +0 -1
  344. package/dist/utils/ciDataCollector.d.ts +0 -51
  345. package/dist/utils/ciDataCollector.js +0 -197
  346. package/dist/utils/ciDataCollector.js.map +0 -1
  347. package/dist/utils/codingTestConfigLoader.d.ts +0 -66
  348. package/dist/utils/codingTestConfigLoader.js +0 -420
  349. package/dist/utils/codingTestConfigLoader.js.map +0 -1
  350. package/dist/utils/dependencies/aiDependencyAnalyzer.d.ts +0 -30
  351. package/dist/utils/dependencies/aiDependencyAnalyzer.js +0 -343
  352. package/dist/utils/dependencies/aiDependencyAnalyzer.js.map +0 -1
  353. package/dist/utils/detection/frameworkDetector.d.ts +0 -43
  354. package/dist/utils/detection/frameworkDetector.js +0 -850
  355. package/dist/utils/detection/frameworkDetector.js.map +0 -1
  356. package/dist/utils/detection/index.d.ts +0 -9
  357. package/dist/utils/detection/index.js +0 -28
  358. package/dist/utils/detection/index.js.map +0 -1
  359. package/dist/utils/detection/projectTypeDetector.d.ts +0 -27
  360. package/dist/utils/detection/projectTypeDetector.js +0 -469
  361. package/dist/utils/detection/projectTypeDetector.js.map +0 -1
  362. package/dist/utils/diagramGenerator.d.ts +0 -49
  363. package/dist/utils/diagramGenerator.js +0 -218
  364. package/dist/utils/diagramGenerator.js.map +0 -1
  365. package/dist/utils/errorLogger.d.ts +0 -24
  366. package/dist/utils/errorLogger.js +0 -59
  367. package/dist/utils/errorLogger.js.map +0 -1
  368. package/dist/utils/estimationUtils.d.ts +0 -139
  369. package/dist/utils/estimationUtils.js +0 -329
  370. package/dist/utils/estimationUtils.js.map +0 -1
  371. package/dist/utils/fileFilters.d.ts +0 -72
  372. package/dist/utils/fileFilters.js +0 -350
  373. package/dist/utils/fileFilters.js.map +0 -1
  374. package/dist/utils/fileSystem.d.ts +0 -22
  375. package/dist/utils/fileSystem.js +0 -45
  376. package/dist/utils/fileSystem.js.map +0 -1
  377. package/dist/utils/index.d.ts +0 -22
  378. package/dist/utils/index.js +0 -52
  379. package/dist/utils/index.js.map +0 -1
  380. package/dist/utils/pathValidator.d.ts +0 -40
  381. package/dist/utils/pathValidator.js +0 -98
  382. package/dist/utils/pathValidator.js.map +0 -1
  383. package/dist/utils/priorityFilter.d.ts +0 -34
  384. package/dist/utils/priorityFilter.js +0 -54
  385. package/dist/utils/priorityFilter.js.map +0 -1
  386. package/dist/utils/projectDocs.d.ts +0 -47
  387. package/dist/utils/projectDocs.js +0 -158
  388. package/dist/utils/projectDocs.js.map +0 -1
  389. package/dist/utils/promptPaths.d.ts +0 -6
  390. package/dist/utils/promptPaths.js +0 -33
  391. package/dist/utils/promptPaths.js.map +0 -1
  392. package/dist/utils/promptTemplateManager.d.ts +0 -34
  393. package/dist/utils/promptTemplateManager.js +0 -141
  394. package/dist/utils/promptTemplateManager.js.map +0 -1
  395. package/dist/utils/review/consolidateReview.d.ts +0 -15
  396. package/dist/utils/review/consolidateReview.js +0 -481
  397. package/dist/utils/review/consolidateReview.js.map +0 -1
  398. package/dist/utils/review/fixDisplay.d.ts +0 -20
  399. package/dist/utils/review/fixDisplay.js +0 -84
  400. package/dist/utils/review/fixDisplay.js.map +0 -1
  401. package/dist/utils/review/fixImplementation.d.ts +0 -28
  402. package/dist/utils/review/fixImplementation.js +0 -60
  403. package/dist/utils/review/fixImplementation.js.map +0 -1
  404. package/dist/utils/review/index.d.ts +0 -13
  405. package/dist/utils/review/index.js +0 -50
  406. package/dist/utils/review/index.js.map +0 -1
  407. package/dist/utils/review/interactiveProcessing.d.ts +0 -25
  408. package/dist/utils/review/interactiveProcessing.js +0 -251
  409. package/dist/utils/review/interactiveProcessing.js.map +0 -1
  410. package/dist/utils/review/progressTracker.d.ts +0 -106
  411. package/dist/utils/review/progressTracker.js +0 -227
  412. package/dist/utils/review/progressTracker.js.map +0 -1
  413. package/dist/utils/review/reviewExtraction.d.ts +0 -31
  414. package/dist/utils/review/reviewExtraction.js +0 -324
  415. package/dist/utils/review/reviewExtraction.js.map +0 -1
  416. package/dist/utils/review/types.d.ts +0 -45
  417. package/dist/utils/review/types.js +0 -18
  418. package/dist/utils/review/types.js.map +0 -1
  419. package/dist/utils/reviewActionHandler.d.ts +0 -16
  420. package/dist/utils/reviewActionHandler.js +0 -34
  421. package/dist/utils/reviewActionHandler.js.map +0 -1
  422. package/dist/utils/reviewParser.d.ts +0 -34
  423. package/dist/utils/reviewParser.js +0 -218
  424. package/dist/utils/reviewParser.js.map +0 -1
  425. package/dist/utils/sanitizer.d.ts +0 -82
  426. package/dist/utils/sanitizer.js +0 -239
  427. package/dist/utils/sanitizer.js.map +0 -1
  428. package/dist/utils/smartFileSelector.d.ts +0 -50
  429. package/dist/utils/smartFileSelector.js +0 -261
  430. package/dist/utils/smartFileSelector.js.map +0 -1
  431. package/dist/utils/templateLoader.d.ts +0 -44
  432. package/dist/utils/templateLoader.js +0 -431
  433. package/dist/utils/templateLoader.js.map +0 -1
  434. package/dist/utils/treeGenerator.d.ts +0 -12
  435. package/dist/utils/treeGenerator.js +0 -133
  436. 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":[],"mapp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C;YAC9E,IAAI,KAAK,KAAK,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,186 +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
- // Build a non-invasive line map so the code stays valid
30
- const numberedContent = fileContent
31
- .split('\n')
32
- .map((line, index) => `${index + 1}: ${line}`)
33
- .join('\n');
34
- // Provide line numbers separately from the actual code
35
- return [
36
- '```text',
37
- numberedContent,
38
- '```',
39
- `\`\`\`${language}`,
40
- fileContent,
41
- '```',
42
- ].join('\n');
43
- }
44
- /**
45
- * Format a single file review prompt
46
- * @param promptTemplate The prompt template
47
- * @param fileContent The content of the file
48
- * @param filePath The path to the file
49
- * @param projectDocs Optional project documentation
50
- * @returns The formatted prompt
51
- */
52
- function formatSingleFileReviewPrompt(promptTemplate, fileContent, filePath, projectDocs, runContext) {
53
- // Format the code block
54
- const codeBlock = formatCodeBlock(fileContent, filePath);
55
- // Format project documentation if available
56
- const projectContext = projectDocs ? (0, projectDocs_1.formatProjectDocs)(projectDocs) : '';
57
- const contextSnapshot = buildContextSnapshot(runContext, filePath);
58
- const severityContract = buildSeverityContract();
59
- const contextAppendix = buildContextDocAppendix(runContext);
60
- const sections = [
61
- promptTemplate,
62
- contextSnapshot,
63
- severityContract,
64
- contextAppendix,
65
- projectContext ? `## Project Context\n${projectContext}` : '',
66
- `## File to Review: ${filePath}`,
67
- 'Line numbers are provided in the preceding `text` block; the code block remains unmodified. Use those numbers for the line references you report, and do not include the line map prefix in code fixes.',
68
- codeBlock,
69
- '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.',
70
- ].filter(Boolean);
71
- return sections.join('\n\n');
72
- }
73
- /**
74
- * Format a consolidated review prompt
75
- * @param promptTemplate The prompt template
76
- * @param projectName The name of the project
77
- * @param files Array of file information
78
- * @param projectDocs Optional project documentation
79
- * @returns The formatted prompt
80
- */
81
- function formatConsolidatedReviewPrompt(promptTemplate, projectName, files, projectDocs, runContext) {
82
- const MAX_INLINE_BYTES = 200 * 1024; // prevent oversized payloads
83
- // Format project documentation if available
84
- const projectContext = projectDocs ? (0, projectDocs_1.formatProjectDocs)(projectDocs) : '';
85
- // Convert the file array to FileInfo format for the directory structure generator
86
- const fileInfos = files.map((file) => ({
87
- path: file.relativePath || file.sizeInBytes.toString(), // Use sizeInBytes as fallback for path
88
- relativePath: file.relativePath,
89
- content: file.content,
90
- }));
91
- // Create a project structure summary using the utility function
92
- const directoryStructure = (0, directoryStructure_1.generateDirectoryStructure)(fileInfos);
93
- // Prepare file summaries
94
- const fileSummaries = files
95
- .map((file) => `- ${file.relativePath || 'unnamed file'} (${file.sizeInBytes} bytes)`)
96
- .join('\n');
97
- const inlineableFiles = files.filter((file) => file.sizeInBytes <= MAX_INLINE_BYTES);
98
- const oversizedFiles = files.filter((file) => file.sizeInBytes > MAX_INLINE_BYTES);
99
- // Prepare file contents with line numbers
100
- const fileContents = inlineableFiles
101
- .map((file) => {
102
- const path = file.relativePath || 'unnamed file';
103
- const codeBlock = formatCodeBlock(file.content, path);
104
- return `### ${path}\n${codeBlock}`;
105
- })
106
- .join('\n\n');
107
- const oversizedNotice = oversizedFiles.length > 0
108
- ? [
109
- 'The following files were omitted from inline content because they exceed the size limit:',
110
- oversizedFiles
111
- .map((file) => `- ${file.relativePath || 'unnamed file'} (${file.sizeInBytes} bytes)`)
112
- .join('\n'),
113
- ].join('\n')
114
- : '';
115
- const contextSnapshot = buildContextSnapshot(runContext);
116
- const severityContract = buildSeverityContract();
117
- const contextAppendix = buildContextDocAppendix(runContext);
118
- const sections = [
119
- promptTemplate,
120
- contextSnapshot,
121
- severityContract,
122
- contextAppendix,
123
- projectContext ? `## Project Context\n${projectContext}` : '',
124
- `## Project: ${projectName}`,
125
- '## Directory Structure',
126
- `\`\`\`\n${directoryStructure}\n\`\`\``,
127
- '## File Summaries',
128
- fileSummaries,
129
- '## File Contents',
130
- 'Line numbers are provided in the `text` block that precedes each code block; the code block remains unmodified. Use those numbers for the line references you report, and do not include the line map prefix in code fixes.',
131
- oversizedNotice,
132
- fileContents,
133
- '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.',
134
- ].filter(Boolean);
135
- return sections.join('\n\n');
136
- }
137
- function buildContextSnapshot(runContext, currentFile) {
138
- if (!runContext) {
139
- return '';
140
- }
141
- const lines = ['## Context Snapshot'];
142
- lines.push(`- Repository: ${runContext.repoName}`);
143
- if (runContext.reviewMode) {
144
- lines.push(`- Mode: ${runContext.reviewMode}`);
145
- }
146
- if (typeof runContext.groupIndex === 'number' &&
147
- typeof runContext.groupCount === 'number' &&
148
- runContext.groupCount > 0) {
149
- const label = runContext.groupLabel ? ` (${runContext.groupLabel})` : '';
150
- lines.push(`- File group: ${runContext.groupIndex}/${runContext.groupCount}${label}`);
151
- }
152
- if (runContext.totalFiles) {
153
- lines.push(`- Files in this run: ${runContext.totalFiles}`);
154
- }
155
- if (currentFile) {
156
- lines.push(`- Currently focused file: ${currentFile}`);
157
- }
158
- if (runContext.groupFiles && runContext.groupFiles.length > 0) {
159
- lines.push('\n### Files in this group');
160
- runContext.groupFiles.forEach((file) => lines.push(`- ${file}`));
161
- }
162
- if (runContext.docFiles && runContext.docFiles.length > 0) {
163
- lines.push('\n### Nearby docs/config included for context');
164
- runContext.docFiles.forEach((file) => lines.push(`- ${file}`));
165
- }
166
- lines.push('\nFocus on cross-file behavior in this bundle—shared state, config drift, and docs vs implementation mismatches.');
167
- return lines.join('\n');
168
- }
169
- function buildSeverityContract() {
170
- 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** – Only report 'Missing context' if the file content is completely empty or unreadable. Do not report it if you can infer the context or if the file is just small.\n-\n-Always set the JSON 'priority' to one of the above values so UI totals remain accurate.`;
171
- }
172
- function buildContextDocAppendix(runContext) {
173
- if (!runContext?.contextDocs || runContext.contextDocs.length === 0) {
174
- return '';
175
- }
176
- const docs = runContext.contextDocs;
177
- const lines = ['## Supporting Context'];
178
- for (const doc of docs) {
179
- lines.push(`### ${doc.path}`);
180
- lines.push('```');
181
- lines.push(doc.snippet.trim() || '(empty file)');
182
- lines.push('```');
183
- }
184
- return lines.join('\n');
185
- }
186
- //# 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,0CAoBC;AAUD,oEA8BC;AAUD,wEAwEC;AA1JD,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,QAAQ,GAAG,IAAA,4CAAwB,EAAC,aAAa,CAAC,CAAC;IAEzD,wDAAwD;IACxD,MAAM,eAAe,GAAG,WAAW;SAChC,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SAC7C,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,uDAAuD;IACvD,OAAO;QACL,SAAS;QACT,eAAe;QACf,KAAK;QACL,SAAS,QAAQ,EAAE;QACnB,WAAW;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2qBAA2qB,CAAC;AACrrB,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;