codereview-aia 0.1.0 → 0.1.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 (422) hide show
  1. package/dist/analysis/FindingsExtractor.d.ts +105 -0
  2. package/dist/analysis/FindingsExtractor.js +363 -0
  3. package/dist/analysis/FindingsExtractor.js.map +1 -0
  4. package/dist/analysis/ai-detection/analyzers/BaseAnalyzer.d.ts +111 -0
  5. package/dist/analysis/ai-detection/analyzers/BaseAnalyzer.js +215 -0
  6. package/dist/analysis/ai-detection/analyzers/BaseAnalyzer.js.map +1 -0
  7. package/dist/analysis/ai-detection/analyzers/DocumentationAnalyzer.d.ts +142 -0
  8. package/dist/analysis/ai-detection/analyzers/DocumentationAnalyzer.js +503 -0
  9. package/dist/analysis/ai-detection/analyzers/DocumentationAnalyzer.js.map +1 -0
  10. package/dist/analysis/ai-detection/analyzers/GitHistoryAnalyzer.d.ts +88 -0
  11. package/dist/analysis/ai-detection/analyzers/GitHistoryAnalyzer.js +343 -0
  12. package/dist/analysis/ai-detection/analyzers/GitHistoryAnalyzer.js.map +1 -0
  13. package/dist/analysis/ai-detection/core/AIDetectionEngine.d.ts +104 -0
  14. package/dist/analysis/ai-detection/core/AIDetectionEngine.js +369 -0
  15. package/dist/analysis/ai-detection/core/AIDetectionEngine.js.map +1 -0
  16. package/dist/analysis/ai-detection/types/DetectionTypes.d.ts +364 -0
  17. package/dist/analysis/ai-detection/types/DetectionTypes.js +32 -0
  18. package/dist/analysis/ai-detection/types/DetectionTypes.js.map +1 -0
  19. package/dist/analysis/ai-detection/utils/SubmissionConverter.d.ts +97 -0
  20. package/dist/analysis/ai-detection/utils/SubmissionConverter.js +339 -0
  21. package/dist/analysis/ai-detection/utils/SubmissionConverter.js.map +1 -0
  22. package/dist/analysis/context/ReviewContext.d.ts +184 -0
  23. package/dist/analysis/context/ReviewContext.js +294 -0
  24. package/dist/analysis/context/ReviewContext.js.map +1 -0
  25. package/dist/analysis/context/index.d.ts +6 -0
  26. package/dist/analysis/context/index.js +23 -0
  27. package/dist/analysis/context/index.js.map +1 -0
  28. package/dist/analysis/index.d.ts +7 -0
  29. package/dist/analysis/index.js +24 -0
  30. package/dist/analysis/index.js.map +1 -0
  31. package/dist/analysis/tokens/TokenAnalysisFormatter.d.ts +27 -0
  32. package/dist/analysis/tokens/TokenAnalysisFormatter.js +143 -0
  33. package/dist/analysis/tokens/TokenAnalysisFormatter.js.map +1 -0
  34. package/dist/analysis/tokens/TokenAnalyzer.d.ts +155 -0
  35. package/dist/analysis/tokens/TokenAnalyzer.js +502 -0
  36. package/dist/analysis/tokens/TokenAnalyzer.js.map +1 -0
  37. package/dist/analysis/tokens/index.d.ts +7 -0
  38. package/dist/analysis/tokens/index.js +24 -0
  39. package/dist/analysis/tokens/index.js.map +1 -0
  40. package/dist/clients/base/abstractClient.d.ts +99 -0
  41. package/dist/clients/base/abstractClient.js +98 -0
  42. package/dist/clients/base/abstractClient.js.map +1 -0
  43. package/dist/clients/base/httpClient.d.ts +24 -0
  44. package/dist/clients/base/httpClient.js +147 -0
  45. package/dist/clients/base/httpClient.js.map +1 -0
  46. package/dist/clients/base/index.d.ts +11 -0
  47. package/dist/clients/base/index.js +28 -0
  48. package/dist/clients/base/index.js.map +1 -0
  49. package/dist/clients/base/modelDetection.d.ts +41 -0
  50. package/dist/clients/base/modelDetection.js +88 -0
  51. package/dist/clients/base/modelDetection.js.map +1 -0
  52. package/dist/clients/base/responseProcessor.d.ts +45 -0
  53. package/dist/clients/base/responseProcessor.js +495 -0
  54. package/dist/clients/base/responseProcessor.js.map +1 -0
  55. package/dist/clients/factory/clientFactory.d.ts +23 -0
  56. package/dist/clients/factory/clientFactory.js +50 -0
  57. package/dist/clients/factory/clientFactory.js.map +1 -0
  58. package/dist/clients/factory/index.d.ts +7 -0
  59. package/dist/clients/factory/index.js +24 -0
  60. package/dist/clients/factory/index.js.map +1 -0
  61. package/dist/clients/implementations/index.d.ts +7 -0
  62. package/dist/clients/implementations/index.js +24 -0
  63. package/dist/clients/implementations/index.js.map +1 -0
  64. package/dist/clients/implementations/openRouterClient.d.ts +69 -0
  65. package/dist/clients/implementations/openRouterClient.js +294 -0
  66. package/dist/clients/implementations/openRouterClient.js.map +1 -0
  67. package/dist/clients/openRouterClient.d.ts +42 -0
  68. package/dist/clients/openRouterClient.js +738 -0
  69. package/dist/clients/openRouterClient.js.map +1 -0
  70. package/dist/clients/openRouterClientWrapper.d.ts +22 -0
  71. package/dist/clients/openRouterClientWrapper.js +64 -0
  72. package/dist/clients/openRouterClientWrapper.js.map +1 -0
  73. package/dist/clients/utils/directoryStructure.d.ts +14 -0
  74. package/dist/clients/utils/directoryStructure.js +48 -0
  75. package/dist/clients/utils/directoryStructure.js.map +1 -0
  76. package/dist/clients/utils/index.d.ts +10 -0
  77. package/dist/clients/utils/index.js +31 -0
  78. package/dist/clients/utils/index.js.map +1 -0
  79. package/dist/clients/utils/languageDetection.d.ts +13 -0
  80. package/dist/clients/utils/languageDetection.js +46 -0
  81. package/dist/clients/utils/languageDetection.js.map +1 -0
  82. package/dist/clients/utils/promptFormatter.d.ts +36 -0
  83. package/dist/clients/utils/promptFormatter.js +92 -0
  84. package/dist/clients/utils/promptFormatter.js.map +1 -0
  85. package/dist/clients/utils/promptLoader.d.ts +27 -0
  86. package/dist/clients/utils/promptLoader.js +49 -0
  87. package/dist/clients/utils/promptLoader.js.map +1 -0
  88. package/dist/clients/utils/tokenCounter.d.ts +81 -0
  89. package/dist/clients/utils/tokenCounter.js +209 -0
  90. package/dist/clients/utils/tokenCounter.js.map +1 -0
  91. package/dist/core/ApiClientSelector.d.ts +8 -0
  92. package/dist/core/ApiClientSelector.js +29 -0
  93. package/dist/core/ApiClientSelector.js.map +1 -0
  94. package/dist/core/ConfigurationService.d.ts +286 -0
  95. package/dist/core/ConfigurationService.js +477 -0
  96. package/dist/core/ConfigurationService.js.map +1 -0
  97. package/dist/core/ConsolidationService.d.ts +99 -0
  98. package/dist/core/ConsolidationService.js +341 -0
  99. package/dist/core/ConsolidationService.js.map +1 -0
  100. package/dist/core/InteractiveDisplayManager.d.ts +22 -0
  101. package/dist/core/InteractiveDisplayManager.js +70 -0
  102. package/dist/core/InteractiveDisplayManager.js.map +1 -0
  103. package/dist/core/OutputManager.d.ts +26 -0
  104. package/dist/core/OutputManager.js +217 -0
  105. package/dist/core/OutputManager.js.map +1 -0
  106. package/dist/core/ReviewGenerator.d.ts +13 -0
  107. package/dist/core/ReviewGenerator.js +102 -0
  108. package/dist/core/ReviewGenerator.js.map +1 -0
  109. package/dist/core/fileDiscovery.d.ts +35 -0
  110. package/dist/core/fileDiscovery.js +202 -0
  111. package/dist/core/fileDiscovery.js.map +1 -0
  112. package/dist/core/handlers/EstimationHandler.d.ts +18 -0
  113. package/dist/core/handlers/EstimationHandler.js +110 -0
  114. package/dist/core/handlers/EstimationHandler.js.map +1 -0
  115. package/dist/core/handlers/FileProcessingHandler.d.ts +31 -0
  116. package/dist/core/handlers/FileProcessingHandler.js +159 -0
  117. package/dist/core/handlers/FileProcessingHandler.js.map +1 -0
  118. package/dist/core/handlers/OutputHandler.d.ts +27 -0
  119. package/dist/core/handlers/OutputHandler.js +127 -0
  120. package/dist/core/handlers/OutputHandler.js.map +1 -0
  121. package/dist/core/handlers/ReviewExecutor.d.ts +32 -0
  122. package/dist/core/handlers/ReviewExecutor.js +111 -0
  123. package/dist/core/handlers/ReviewExecutor.js.map +1 -0
  124. package/dist/core/reviewOrchestrator.d.ts +24 -0
  125. package/dist/core/reviewOrchestrator.js +294 -0
  126. package/dist/core/reviewOrchestrator.js.map +1 -0
  127. package/dist/core/utils/ModelInfoUtils.d.ts +16 -0
  128. package/dist/core/utils/ModelInfoUtils.js +54 -0
  129. package/dist/core/utils/ModelInfoUtils.js.map +1 -0
  130. package/dist/formatters/outputFormatter.d.ts +31 -0
  131. package/dist/formatters/outputFormatter.js +65 -0
  132. package/dist/formatters/outputFormatter.js.map +1 -0
  133. package/dist/formatters/utils/IssueFormatters.d.ts +20 -0
  134. package/dist/formatters/utils/IssueFormatters.js +67 -0
  135. package/dist/formatters/utils/IssueFormatters.js.map +1 -0
  136. package/dist/formatters/utils/JsonFormatter.d.ts +13 -0
  137. package/dist/formatters/utils/JsonFormatter.js +57 -0
  138. package/dist/formatters/utils/JsonFormatter.js.map +1 -0
  139. package/dist/formatters/utils/MarkdownFormatters.d.ts +51 -0
  140. package/dist/formatters/utils/MarkdownFormatters.js +456 -0
  141. package/dist/formatters/utils/MarkdownFormatters.js.map +1 -0
  142. package/dist/formatters/utils/MetadataFormatter.d.ts +65 -0
  143. package/dist/formatters/utils/MetadataFormatter.js +219 -0
  144. package/dist/formatters/utils/MetadataFormatter.js.map +1 -0
  145. package/dist/formatters/utils/ModelInfoExtractor.d.ts +33 -0
  146. package/dist/formatters/utils/ModelInfoExtractor.js +111 -0
  147. package/dist/formatters/utils/ModelInfoExtractor.js.map +1 -0
  148. package/dist/index.d.ts +2 -0
  149. package/dist/index.js +1 -0
  150. package/dist/index.js.map +1 -0
  151. package/dist/plugins/PluginInterface.d.ts +44 -0
  152. package/dist/plugins/PluginInterface.js +9 -0
  153. package/dist/plugins/PluginInterface.js.map +1 -0
  154. package/dist/plugins/PluginManager.d.ts +51 -0
  155. package/dist/plugins/PluginManager.js +151 -0
  156. package/dist/plugins/PluginManager.js.map +1 -0
  157. package/dist/prompts/PromptManager.d.ts +30 -0
  158. package/dist/prompts/PromptManager.js +62 -0
  159. package/dist/prompts/PromptManager.js.map +1 -0
  160. package/dist/prompts/cache/PromptCache.d.ts +32 -0
  161. package/dist/prompts/cache/PromptCache.js +48 -0
  162. package/dist/prompts/cache/PromptCache.js.map +1 -0
  163. package/dist/runtime/auth/service.d.ts +2 -0
  164. package/dist/runtime/auth/service.js +41 -0
  165. package/dist/runtime/auth/service.js.map +1 -0
  166. package/dist/runtime/auth/session.d.ts +5 -0
  167. package/dist/runtime/auth/session.js +87 -0
  168. package/dist/runtime/auth/session.js.map +1 -0
  169. package/dist/runtime/auth/types.d.ts +9 -0
  170. package/dist/runtime/auth/types.js +3 -0
  171. package/dist/runtime/auth/types.js.map +1 -0
  172. package/dist/runtime/cliEntry.d.ts +1 -0
  173. package/dist/runtime/cliEntry.js +213 -0
  174. package/dist/runtime/cliEntry.js.map +1 -0
  175. package/dist/runtime/debug/logManager.d.ts +5 -0
  176. package/dist/runtime/debug/logManager.js +31 -0
  177. package/dist/runtime/debug/logManager.js.map +1 -0
  178. package/dist/runtime/errors.d.ts +5 -0
  179. package/dist/runtime/errors.js +15 -0
  180. package/dist/runtime/errors.js.map +1 -0
  181. package/dist/runtime/fileCollector.d.ts +5 -0
  182. package/dist/runtime/fileCollector.js +167 -0
  183. package/dist/runtime/fileCollector.js.map +1 -0
  184. package/dist/runtime/manifest.d.ts +1 -0
  185. package/dist/runtime/manifest.js +65 -0
  186. package/dist/runtime/manifest.js.map +1 -0
  187. package/dist/runtime/openrouterProxy.d.ts +4 -0
  188. package/dist/runtime/openrouterProxy.js +43 -0
  189. package/dist/runtime/openrouterProxy.js.map +1 -0
  190. package/dist/runtime/preprod/webCheck.d.ts +1 -0
  191. package/dist/runtime/preprod/webCheck.js +98 -0
  192. package/dist/runtime/preprod/webCheck.js.map +1 -0
  193. package/dist/runtime/proxyConfig.d.ts +6 -0
  194. package/dist/runtime/proxyConfig.js +86 -0
  195. package/dist/runtime/proxyConfig.js.map +1 -0
  196. package/dist/runtime/proxyEnvironment.d.ts +3 -0
  197. package/dist/runtime/proxyEnvironment.js +63 -0
  198. package/dist/runtime/proxyEnvironment.js.map +1 -0
  199. package/dist/runtime/reportMerge.d.ts +30 -0
  200. package/dist/runtime/reportMerge.js +70 -0
  201. package/dist/runtime/reportMerge.js.map +1 -0
  202. package/dist/runtime/reporting/markdownReportBuilder.d.ts +15 -0
  203. package/dist/runtime/reporting/markdownReportBuilder.js +97 -0
  204. package/dist/runtime/reporting/markdownReportBuilder.js.map +1 -0
  205. package/dist/runtime/reporting/reportDataCollector.d.ts +31 -0
  206. package/dist/runtime/reporting/reportDataCollector.js +170 -0
  207. package/dist/runtime/reporting/reportDataCollector.js.map +1 -0
  208. package/dist/runtime/reporting/summaryGenerator.d.ts +10 -0
  209. package/dist/runtime/reporting/summaryGenerator.js +67 -0
  210. package/dist/runtime/reporting/summaryGenerator.js.map +1 -0
  211. package/dist/runtime/reviewPipeline.d.ts +28 -0
  212. package/dist/runtime/reviewPipeline.js +122 -0
  213. package/dist/runtime/reviewPipeline.js.map +1 -0
  214. package/dist/runtime/runAiCodeReview.d.ts +10 -0
  215. package/dist/runtime/runAiCodeReview.js +138 -0
  216. package/dist/runtime/runAiCodeReview.js.map +1 -0
  217. package/dist/runtime/runtimeConfig.d.ts +4 -0
  218. package/dist/runtime/runtimeConfig.js +7 -0
  219. package/dist/runtime/runtimeConfig.js.map +1 -0
  220. package/dist/runtime/ui/Layout.d.ts +11 -0
  221. package/dist/runtime/ui/Layout.js +47 -0
  222. package/dist/runtime/ui/Layout.js.map +1 -0
  223. package/dist/runtime/ui/RuntimeApp.d.ts +6 -0
  224. package/dist/runtime/ui/RuntimeApp.js +161 -0
  225. package/dist/runtime/ui/RuntimeApp.js.map +1 -0
  226. package/dist/runtime/ui/inkModules.d.ts +10 -0
  227. package/dist/runtime/ui/inkModules.js +63 -0
  228. package/dist/runtime/ui/inkModules.js.map +1 -0
  229. package/dist/runtime/ui/screens/AuthScreen.d.ts +6 -0
  230. package/dist/runtime/ui/screens/AuthScreen.js +67 -0
  231. package/dist/runtime/ui/screens/AuthScreen.js.map +1 -0
  232. package/dist/runtime/ui/screens/ModeSelection.d.ts +10 -0
  233. package/dist/runtime/ui/screens/ModeSelection.js +100 -0
  234. package/dist/runtime/ui/screens/ModeSelection.js.map +1 -0
  235. package/dist/runtime/ui/screens/ProgressScreen.d.ts +7 -0
  236. package/dist/runtime/ui/screens/ProgressScreen.js +38 -0
  237. package/dist/runtime/ui/screens/ProgressScreen.js.map +1 -0
  238. package/dist/runtime/ui/screens/ResultsScreen.d.ts +7 -0
  239. package/dist/runtime/ui/screens/ResultsScreen.js +22 -0
  240. package/dist/runtime/ui/screens/ResultsScreen.js.map +1 -0
  241. package/dist/strategies/ArchitecturalReviewStrategy.d.ts +29 -0
  242. package/dist/strategies/ArchitecturalReviewStrategy.js +42 -0
  243. package/dist/strategies/ArchitecturalReviewStrategy.js.map +1 -0
  244. package/dist/strategies/CodingTestReviewStrategy.d.ts +194 -0
  245. package/dist/strategies/CodingTestReviewStrategy.js +681 -0
  246. package/dist/strategies/CodingTestReviewStrategy.js.map +1 -0
  247. package/dist/strategies/ConsolidatedReviewStrategy.d.ts +25 -0
  248. package/dist/strategies/ConsolidatedReviewStrategy.js +45 -0
  249. package/dist/strategies/ConsolidatedReviewStrategy.js.map +1 -0
  250. package/dist/strategies/ExtractPatternsReviewStrategy.d.ts +30 -0
  251. package/dist/strategies/ExtractPatternsReviewStrategy.js +51 -0
  252. package/dist/strategies/ExtractPatternsReviewStrategy.js.map +1 -0
  253. package/dist/strategies/MultiPassReviewStrategy.d.ts +86 -0
  254. package/dist/strategies/MultiPassReviewStrategy.js +590 -0
  255. package/dist/strategies/MultiPassReviewStrategy.js.map +1 -0
  256. package/dist/strategies/ReviewStrategy.d.ts +45 -0
  257. package/dist/strategies/ReviewStrategy.js +24 -0
  258. package/dist/strategies/ReviewStrategy.js.map +1 -0
  259. package/dist/strategies/StrategyFactory.d.ts +19 -0
  260. package/dist/strategies/StrategyFactory.js +72 -0
  261. package/dist/strategies/StrategyFactory.js.map +1 -0
  262. package/dist/strategies/index.d.ts +13 -0
  263. package/dist/strategies/index.js +30 -0
  264. package/dist/strategies/index.js.map +1 -0
  265. package/dist/tokenizers/baseTokenizer.d.ts +25 -0
  266. package/dist/tokenizers/baseTokenizer.js +48 -0
  267. package/dist/tokenizers/baseTokenizer.js.map +1 -0
  268. package/dist/tokenizers/gptTokenizer.d.ts +7 -0
  269. package/dist/tokenizers/gptTokenizer.js +28 -0
  270. package/dist/tokenizers/gptTokenizer.js.map +1 -0
  271. package/dist/tokenizers/index.d.ts +7 -0
  272. package/dist/tokenizers/index.js +24 -0
  273. package/dist/tokenizers/index.js.map +1 -0
  274. package/dist/types/apiResponses.d.ts +39 -0
  275. package/dist/types/apiResponses.js +9 -0
  276. package/dist/types/apiResponses.js.map +1 -0
  277. package/dist/types/cli.d.ts +22 -0
  278. package/dist/types/cli.js +3 -0
  279. package/dist/types/cli.js.map +1 -0
  280. package/dist/types/common.d.ts +22 -0
  281. package/dist/types/common.js +14 -0
  282. package/dist/types/common.js.map +1 -0
  283. package/dist/types/configuration.d.ts +682 -0
  284. package/dist/types/configuration.js +65 -0
  285. package/dist/types/configuration.js.map +1 -0
  286. package/dist/types/review.d.ts +258 -0
  287. package/dist/types/review.js +8 -0
  288. package/dist/types/review.js.map +1 -0
  289. package/dist/types/reviewSchema.d.ts +543 -0
  290. package/dist/types/reviewSchema.js +121 -0
  291. package/dist/types/reviewSchema.js.map +1 -0
  292. package/dist/types/structuredReview.d.ts +119 -0
  293. package/dist/types/structuredReview.js +6 -0
  294. package/dist/types/structuredReview.js.map +1 -0
  295. package/dist/types/tokenAnalysis.d.ts +44 -0
  296. package/dist/types/tokenAnalysis.js +4 -0
  297. package/dist/types/tokenAnalysis.js.map +1 -0
  298. package/dist/utils/FileReader.d.ts +33 -0
  299. package/dist/utils/FileReader.js +88 -0
  300. package/dist/utils/FileReader.js.map +1 -0
  301. package/dist/utils/FileWriter.d.ts +26 -0
  302. package/dist/utils/FileWriter.js +76 -0
  303. package/dist/utils/FileWriter.js.map +1 -0
  304. package/dist/utils/PathGenerator.d.ts +30 -0
  305. package/dist/utils/PathGenerator.js +82 -0
  306. package/dist/utils/PathGenerator.js.map +1 -0
  307. package/dist/utils/api/apiUtils.d.ts +3 -0
  308. package/dist/utils/api/apiUtils.js +20 -0
  309. package/dist/utils/api/apiUtils.js.map +1 -0
  310. package/dist/utils/api/index.d.ts +1 -0
  311. package/dist/utils/api/index.js +18 -0
  312. package/dist/utils/api/index.js.map +1 -0
  313. package/dist/utils/apiErrorHandler.d.ts +130 -0
  314. package/dist/utils/apiErrorHandler.js +256 -0
  315. package/dist/utils/apiErrorHandler.js.map +1 -0
  316. package/dist/utils/ciDataCollector.d.ts +51 -0
  317. package/dist/utils/ciDataCollector.js +197 -0
  318. package/dist/utils/ciDataCollector.js.map +1 -0
  319. package/dist/utils/codingTestConfigLoader.d.ts +66 -0
  320. package/dist/utils/codingTestConfigLoader.js +420 -0
  321. package/dist/utils/codingTestConfigLoader.js.map +1 -0
  322. package/dist/utils/dependencies/aiDependencyAnalyzer.d.ts +30 -0
  323. package/dist/utils/dependencies/aiDependencyAnalyzer.js +343 -0
  324. package/dist/utils/dependencies/aiDependencyAnalyzer.js.map +1 -0
  325. package/dist/utils/detection/frameworkDetector.d.ts +43 -0
  326. package/dist/utils/detection/frameworkDetector.js +795 -0
  327. package/dist/utils/detection/frameworkDetector.js.map +1 -0
  328. package/dist/utils/detection/index.d.ts +9 -0
  329. package/dist/utils/detection/index.js +28 -0
  330. package/dist/utils/detection/index.js.map +1 -0
  331. package/dist/utils/detection/projectTypeDetector.d.ts +27 -0
  332. package/dist/utils/detection/projectTypeDetector.js +469 -0
  333. package/dist/utils/detection/projectTypeDetector.js.map +1 -0
  334. package/dist/utils/diagramGenerator.d.ts +49 -0
  335. package/dist/utils/diagramGenerator.js +218 -0
  336. package/dist/utils/diagramGenerator.js.map +1 -0
  337. package/dist/utils/errorLogger.d.ts +24 -0
  338. package/dist/utils/errorLogger.js +59 -0
  339. package/dist/utils/errorLogger.js.map +1 -0
  340. package/dist/utils/estimationUtils.d.ts +139 -0
  341. package/dist/utils/estimationUtils.js +329 -0
  342. package/dist/utils/estimationUtils.js.map +1 -0
  343. package/dist/utils/fileFilters.d.ts +72 -0
  344. package/dist/utils/fileFilters.js +338 -0
  345. package/dist/utils/fileFilters.js.map +1 -0
  346. package/dist/utils/fileSystem.d.ts +22 -0
  347. package/dist/utils/fileSystem.js +45 -0
  348. package/dist/utils/fileSystem.js.map +1 -0
  349. package/dist/utils/index.d.ts +22 -0
  350. package/dist/utils/index.js +52 -0
  351. package/dist/utils/index.js.map +1 -0
  352. package/dist/utils/logger.d.ts +77 -0
  353. package/dist/utils/logger.js +271 -0
  354. package/dist/utils/logger.js.map +1 -0
  355. package/dist/utils/pathValidator.d.ts +40 -0
  356. package/dist/utils/pathValidator.js +98 -0
  357. package/dist/utils/pathValidator.js.map +1 -0
  358. package/dist/utils/priorityFilter.d.ts +34 -0
  359. package/dist/utils/priorityFilter.js +54 -0
  360. package/dist/utils/priorityFilter.js.map +1 -0
  361. package/dist/utils/projectDocs.d.ts +47 -0
  362. package/dist/utils/projectDocs.js +158 -0
  363. package/dist/utils/projectDocs.js.map +1 -0
  364. package/dist/utils/promptPaths.d.ts +6 -0
  365. package/dist/utils/promptPaths.js +33 -0
  366. package/dist/utils/promptPaths.js.map +1 -0
  367. package/dist/utils/promptTemplateManager.d.ts +34 -0
  368. package/dist/utils/promptTemplateManager.js +140 -0
  369. package/dist/utils/promptTemplateManager.js.map +1 -0
  370. package/dist/utils/review/consolidateReview.d.ts +15 -0
  371. package/dist/utils/review/consolidateReview.js +481 -0
  372. package/dist/utils/review/consolidateReview.js.map +1 -0
  373. package/dist/utils/review/fixDisplay.d.ts +20 -0
  374. package/dist/utils/review/fixDisplay.js +84 -0
  375. package/dist/utils/review/fixDisplay.js.map +1 -0
  376. package/dist/utils/review/fixImplementation.d.ts +28 -0
  377. package/dist/utils/review/fixImplementation.js +60 -0
  378. package/dist/utils/review/fixImplementation.js.map +1 -0
  379. package/dist/utils/review/index.d.ts +13 -0
  380. package/dist/utils/review/index.js +50 -0
  381. package/dist/utils/review/index.js.map +1 -0
  382. package/dist/utils/review/interactiveProcessing.d.ts +25 -0
  383. package/dist/utils/review/interactiveProcessing.js +251 -0
  384. package/dist/utils/review/interactiveProcessing.js.map +1 -0
  385. package/dist/utils/review/progressTracker.d.ts +106 -0
  386. package/dist/utils/review/progressTracker.js +227 -0
  387. package/dist/utils/review/progressTracker.js.map +1 -0
  388. package/dist/utils/review/reviewExtraction.d.ts +31 -0
  389. package/dist/utils/review/reviewExtraction.js +324 -0
  390. package/dist/utils/review/reviewExtraction.js.map +1 -0
  391. package/dist/utils/review/types.d.ts +45 -0
  392. package/dist/utils/review/types.js +18 -0
  393. package/dist/utils/review/types.js.map +1 -0
  394. package/dist/utils/reviewActionHandler.d.ts +16 -0
  395. package/dist/utils/reviewActionHandler.js +34 -0
  396. package/dist/utils/reviewActionHandler.js.map +1 -0
  397. package/dist/utils/reviewParser.d.ts +34 -0
  398. package/dist/utils/reviewParser.js +218 -0
  399. package/dist/utils/reviewParser.js.map +1 -0
  400. package/dist/utils/sanitizer.d.ts +82 -0
  401. package/dist/utils/sanitizer.js +239 -0
  402. package/dist/utils/sanitizer.js.map +1 -0
  403. package/dist/utils/smartFileSelector.d.ts +50 -0
  404. package/dist/utils/smartFileSelector.js +261 -0
  405. package/dist/utils/smartFileSelector.js.map +1 -0
  406. package/dist/utils/templateLoader.d.ts +44 -0
  407. package/dist/utils/templateLoader.js +431 -0
  408. package/dist/utils/templateLoader.js.map +1 -0
  409. package/dist/utils/treeGenerator.d.ts +12 -0
  410. package/dist/utils/treeGenerator.js +133 -0
  411. package/dist/utils/treeGenerator.js.map +1 -0
  412. package/package.json +11 -12
  413. package/src/index.ts +1 -0
  414. package/src/runtime/debug/logManager.ts +37 -0
  415. package/src/runtime/fileCollector.ts +58 -24
  416. package/src/runtime/preprod/webCheck.ts +104 -0
  417. package/src/runtime/reviewPipeline.ts +10 -4
  418. package/src/runtime/ui/RuntimeApp.tsx +96 -13
  419. package/src/runtime/ui/screens/ModeSelection.tsx +148 -15
  420. package/src/runtime/ui/screens/ProgressScreen.tsx +10 -3
  421. package/src/runtime/ui/screens/ResultsScreen.tsx +8 -1
  422. package/src/utils/logger.ts +64 -14
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Type definitions for the structured review output that cr-aia emits.
3
+ */
4
+ /**
5
+ * Priority levels for code review issues
6
+ */
7
+ export type IssuePriority = 'high' | 'medium' | 'low';
8
+ /**
9
+ * Types of code review issues
10
+ */
11
+ export type IssueType = 'bug' | 'security' | 'performance' | 'maintainability' | 'readability' | 'architecture' | 'best-practice' | 'documentation' | 'testing' | 'other';
12
+ /**
13
+ * A single code review issue
14
+ */
15
+ export interface ReviewIssue {
16
+ /**
17
+ * Title of the issue
18
+ */
19
+ title: string;
20
+ /**
21
+ * Priority level of the issue
22
+ */
23
+ priority: IssuePriority;
24
+ /**
25
+ * Type of issue
26
+ */
27
+ type: IssueType;
28
+ /**
29
+ * File path where the issue was found
30
+ */
31
+ filePath: string;
32
+ /**
33
+ * Line number(s) where the issue was found
34
+ * Can be a single line number or a range (e.g., "10-15")
35
+ */
36
+ lineNumbers?: string;
37
+ /**
38
+ * Description of the issue
39
+ */
40
+ description: string;
41
+ /**
42
+ * Code snippet showing the issue
43
+ */
44
+ codeSnippet?: string;
45
+ /**
46
+ * Suggested fix for the issue
47
+ */
48
+ suggestedFix?: string;
49
+ /**
50
+ * Impact of the issue
51
+ */
52
+ impact?: string;
53
+ }
54
+ /**
55
+ * Grade level types for overall code quality
56
+ */
57
+ export type GradeLevel = 'A+' | 'A' | 'A-' | 'B+' | 'B' | 'B-' | 'C+' | 'C' | 'C-' | 'D+' | 'D' | 'D-' | 'F';
58
+ /**
59
+ * Code quality assessment categories
60
+ */
61
+ export interface GradeCategories {
62
+ /**
63
+ * Code functionality grade
64
+ */
65
+ functionality?: GradeLevel;
66
+ /**
67
+ * Code quality grade
68
+ */
69
+ codeQuality?: GradeLevel;
70
+ /**
71
+ * Documentation grade
72
+ */
73
+ documentation?: GradeLevel;
74
+ /**
75
+ * Testing grade
76
+ */
77
+ testing?: GradeLevel;
78
+ /**
79
+ * Maintainability grade
80
+ */
81
+ maintainability?: GradeLevel;
82
+ /**
83
+ * Security grade
84
+ */
85
+ security?: GradeLevel;
86
+ /**
87
+ * Performance grade
88
+ */
89
+ performance?: GradeLevel;
90
+ }
91
+ /**
92
+ * Structured code review output
93
+ */
94
+ export interface StructuredReview {
95
+ /**
96
+ * Overall grade for the codebase
97
+ */
98
+ grade?: GradeLevel;
99
+ /**
100
+ * Detailed grade breakdown by category
101
+ */
102
+ gradeCategories?: GradeCategories;
103
+ /**
104
+ * Summary of the code review
105
+ */
106
+ summary: string;
107
+ /**
108
+ * List of issues found in the code review
109
+ */
110
+ issues: ReviewIssue[];
111
+ /**
112
+ * General recommendations that don't fit into specific issues
113
+ */
114
+ recommendations?: string[];
115
+ /**
116
+ * Positive aspects of the code
117
+ */
118
+ positiveAspects?: string[];
119
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Type definitions for the structured review output that cr-aia emits.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=structuredReview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structuredReview.js","sourceRoot":"","sources":["../../src/types/structuredReview.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -0,0 +1,44 @@
1
+ /** Token analysis primitives shared across the CLI. */
2
+ import type { FileInfo } from './review';
3
+ export interface FileTokenAnalysis {
4
+ path: string;
5
+ relativePath: string | undefined;
6
+ tokenCount: number;
7
+ sizeInBytes: number;
8
+ tokensPerByte: number;
9
+ }
10
+ export interface TokenAnalysisResult {
11
+ files: FileTokenAnalysis[];
12
+ totalTokens: number;
13
+ totalSizeInBytes: number;
14
+ averageTokensPerByte: number;
15
+ fileCount: number;
16
+ promptOverheadTokens: number;
17
+ estimatedTotalTokens: number;
18
+ contextWindowSize: number;
19
+ exceedsContextWindow: boolean;
20
+ estimatedPassesNeeded: number;
21
+ chunkingRecommendation: ChunkingRecommendation;
22
+ }
23
+ export interface ChunkingRecommendation {
24
+ chunkingRecommended: boolean;
25
+ recommendedChunks: FileChunk[];
26
+ reason: string;
27
+ }
28
+ export interface FileChunk {
29
+ files: string[];
30
+ estimatedTokenCount: number;
31
+ priority: number;
32
+ }
33
+ export interface TokenAnalysisOptions {
34
+ reviewType: string;
35
+ modelName: string;
36
+ optimizeForSpeed?: boolean;
37
+ additionalPromptOverhead?: number;
38
+ contextMaintenanceFactor?: number;
39
+ }
40
+ export declare class TokenAnalyzer {
41
+ static analyzeFile(file: FileInfo, options: TokenAnalysisOptions): FileTokenAnalysis;
42
+ static analyzeFiles(files: FileInfo[], options: TokenAnalysisOptions): TokenAnalysisResult;
43
+ }
44
+ export declare function formatTokenAnalysis(analysis: TokenAnalysisResult, modelName: string, includeFiles?: boolean): string;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ /** Token analysis primitives shared across the CLI. */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=tokenAnalysis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokenAnalysis.js","sourceRoot":"","sources":["../../src/types/tokenAnalysis.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @fileoverview File reading utilities.
3
+ *
4
+ * This module provides utilities for reading files and directories,
5
+ * with error handling and logging.
6
+ */
7
+ import type { FileInfo } from '../types/review';
8
+ /**
9
+ * Read a file and return its content
10
+ * @param filePath Path to the file
11
+ * @returns Promise resolving to the file content
12
+ * @throws Error if the file cannot be read
13
+ */
14
+ export declare function readFile(filePath: string): Promise<string>;
15
+ /**
16
+ * Read a file and return its content with file info
17
+ * @param filePath Path to the file
18
+ * @returns Promise resolving to a FileInfo object
19
+ */
20
+ export declare function readFileWithInfo(filePath: string): Promise<FileInfo>;
21
+ /**
22
+ * Read multiple files and return their contents with file info
23
+ * @param filePaths Array of file paths
24
+ * @returns Promise resolving to an array of FileInfo objects
25
+ */
26
+ export declare function readFilesWithInfo(filePaths: string[]): Promise<FileInfo[]>;
27
+ /**
28
+ * Read all files in a directory recursively
29
+ * @param dirPath Path to the directory
30
+ * @param filter Optional filter function to exclude certain files
31
+ * @returns Promise resolving to an array of file paths
32
+ */
33
+ export declare function readFilesInDirectory(dirPath: string, filter?: (filePath: string) => boolean): Promise<string[]>;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview File reading utilities.
4
+ *
5
+ * This module provides utilities for reading files and directories,
6
+ * with error handling and logging.
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.readFile = readFile;
13
+ exports.readFileWithInfo = readFileWithInfo;
14
+ exports.readFilesWithInfo = readFilesWithInfo;
15
+ exports.readFilesInDirectory = readFilesInDirectory;
16
+ const promises_1 = __importDefault(require("node:fs/promises"));
17
+ const node_path_1 = __importDefault(require("node:path"));
18
+ const logger_1 = __importDefault(require("./logger"));
19
+ /**
20
+ * Read a file and return its content
21
+ * @param filePath Path to the file
22
+ * @returns Promise resolving to the file content
23
+ * @throws Error if the file cannot be read
24
+ */
25
+ async function readFile(filePath) {
26
+ try {
27
+ return await promises_1.default.readFile(filePath, 'utf-8');
28
+ }
29
+ catch (error) {
30
+ logger_1.default.error(`Error reading file ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
31
+ throw error;
32
+ }
33
+ }
34
+ /**
35
+ * Read a file and return its content with file info
36
+ * @param filePath Path to the file
37
+ * @returns Promise resolving to a FileInfo object
38
+ */
39
+ async function readFileWithInfo(filePath) {
40
+ try {
41
+ const content = await promises_1.default.readFile(filePath, 'utf-8');
42
+ const extension = node_path_1.default.extname(filePath).slice(1);
43
+ return {
44
+ path: filePath,
45
+ content,
46
+ extension,
47
+ };
48
+ }
49
+ catch (error) {
50
+ logger_1.default.error(`Error reading file ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
51
+ throw error;
52
+ }
53
+ }
54
+ /**
55
+ * Read multiple files and return their contents with file info
56
+ * @param filePaths Array of file paths
57
+ * @returns Promise resolving to an array of FileInfo objects
58
+ */
59
+ async function readFilesWithInfo(filePaths) {
60
+ const fileInfoPromises = filePaths.map((filePath) => readFileWithInfo(filePath));
61
+ return Promise.all(fileInfoPromises);
62
+ }
63
+ /**
64
+ * Read all files in a directory recursively
65
+ * @param dirPath Path to the directory
66
+ * @param filter Optional filter function to exclude certain files
67
+ * @returns Promise resolving to an array of file paths
68
+ */
69
+ async function readFilesInDirectory(dirPath, filter) {
70
+ const result = [];
71
+ async function processDirectory(currentPath) {
72
+ const entries = await promises_1.default.readdir(currentPath, { withFileTypes: true });
73
+ for (const entry of entries) {
74
+ const entryPath = node_path_1.default.join(currentPath, entry.name);
75
+ if (entry.isDirectory()) {
76
+ await processDirectory(entryPath);
77
+ }
78
+ else if (entry.isFile()) {
79
+ if (!filter || filter(entryPath)) {
80
+ result.push(entryPath);
81
+ }
82
+ }
83
+ }
84
+ }
85
+ await processDirectory(dirPath);
86
+ return result;
87
+ }
88
+ //# sourceMappingURL=FileReader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileReader.js","sourceRoot":"","sources":["../../src/utils/FileReader.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAaH,4BASC;AAOD,4CAgBC;AAOD,8CAGC;AAQD,oDAwBC;AArFD,gEAAkC;AAClC,0DAA6B;AAE7B,sDAA8B;AAE9B;;;;;GAKG;AACI,KAAK,UAAU,QAAQ,CAAC,QAAgB;IAC7C,IAAI,CAAC;QACH,OAAO,MAAM,kBAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,gBAAM,CAAC,KAAK,CACV,sBAAsB,QAAQ,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC5F,CAAC;QACF,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,gBAAgB,CAAC,QAAgB;IACrD,IAAI,CAAC;QACH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C;YACpC,CAAC;iBAAM,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;gBAC1B,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;oBACjC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBACzB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChC,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @fileoverview File writing utilities.
3
+ *
4
+ * This module provides utilities for writing files and creating directories,
5
+ * with error handling and logging.
6
+ */
7
+ /**
8
+ * Create a directory if it doesn't exist
9
+ * @param dirPath Path to the directory
10
+ * @returns Promise resolving when the directory is created or already exists
11
+ */
12
+ export declare function ensureDirectoryExists(dirPath: string): Promise<void>;
13
+ /**
14
+ * Write content to a file, creating the directory if needed
15
+ * @param filePath Path to the file
16
+ * @param content Content to write
17
+ * @returns Promise resolving when the file is written
18
+ */
19
+ export declare function writeFile(filePath: string, content: string): Promise<void>;
20
+ /**
21
+ * Append content to a file, creating the file if it doesn't exist
22
+ * @param filePath Path to the file
23
+ * @param content Content to append
24
+ * @returns Promise resolving when the content is appended
25
+ */
26
+ export declare function appendFile(filePath: string, content: string): Promise<void>;
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview File writing utilities.
4
+ *
5
+ * This module provides utilities for writing files and creating directories,
6
+ * with error handling and logging.
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.ensureDirectoryExists = ensureDirectoryExists;
13
+ exports.writeFile = writeFile;
14
+ exports.appendFile = appendFile;
15
+ const promises_1 = __importDefault(require("node:fs/promises"));
16
+ const node_path_1 = __importDefault(require("node:path"));
17
+ const logger_1 = __importDefault(require("./logger"));
18
+ const pathValidator_1 = require("./pathValidator");
19
+ /**
20
+ * Create a directory if it doesn't exist
21
+ * @param dirPath Path to the directory
22
+ * @returns Promise resolving when the directory is created or already exists
23
+ */
24
+ async function ensureDirectoryExists(dirPath) {
25
+ try {
26
+ if (!(0, pathValidator_1.pathExists)(dirPath)) {
27
+ await promises_1.default.mkdir(dirPath, { recursive: true });
28
+ logger_1.default.debug(`Created directory: ${dirPath}`);
29
+ }
30
+ }
31
+ catch (error) {
32
+ logger_1.default.error(`Error creating directory ${dirPath}: ${error instanceof Error ? error.message : String(error)}`);
33
+ throw error;
34
+ }
35
+ }
36
+ /**
37
+ * Write content to a file, creating the directory if needed
38
+ * @param filePath Path to the file
39
+ * @param content Content to write
40
+ * @returns Promise resolving when the file is written
41
+ */
42
+ async function writeFile(filePath, content) {
43
+ try {
44
+ // Ensure the directory exists
45
+ const dirPath = node_path_1.default.dirname(filePath);
46
+ await ensureDirectoryExists(dirPath);
47
+ // Write the file
48
+ await promises_1.default.writeFile(filePath, content);
49
+ logger_1.default.debug(`Wrote file: ${filePath}`);
50
+ }
51
+ catch (error) {
52
+ logger_1.default.error(`Error writing file ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
53
+ throw error;
54
+ }
55
+ }
56
+ /**
57
+ * Append content to a file, creating the file if it doesn't exist
58
+ * @param filePath Path to the file
59
+ * @param content Content to append
60
+ * @returns Promise resolving when the content is appended
61
+ */
62
+ async function appendFile(filePath, content) {
63
+ try {
64
+ // Ensure the directory exists
65
+ const dirPath = node_path_1.default.dirname(filePath);
66
+ await ensureDirectoryExists(dirPath);
67
+ // Append to the file
68
+ await promises_1.default.appendFile(filePath, content);
69
+ logger_1.default.debug(`Appended to file: ${filePath}`);
70
+ }
71
+ catch (error) {
72
+ logger_1.default.error(`Error appending to file ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
73
+ throw error;
74
+ }
75
+ }
76
+ //# sourceMappingURL=FileWriter.js.map
@@ -0,0 +1 @@
1
+ {"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AAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC5F,CAAC;QACF,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,UAAU,CAAC,QAAgB,EAAE,OAAe;IAChE,IAAI,CAAC;QACH,8BAA8B;QAC9B,MAAM,OAAO,GAAG,mBAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACvC,MAAM,qBAAqB,CAAC,OAAO,CAAC,CAAC;QAErC,qBAAqB;QACrB,MAAM,kBAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACvC,gBAAM,CAAC,KAAK,CAAC,qBAAqB,QAAQ,EAAE,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,gBAAM,CAAC,KAAK,CACV,2BAA2B,QAAQ,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACjG,CAAC;QACF,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @fileoverview Path generation utilities.
3
+ *
4
+ * This module provides utilities for generating file and directory paths,
5
+ * including versioned output paths for review results.
6
+ */
7
+ /**
8
+ * Generate a versioned output path for a file
9
+ * @param baseDir Base directory for the output
10
+ * @param prefix Prefix for the filename
11
+ * @param extension File extension (including the dot)
12
+ * @param modelName Name of the model used for the review
13
+ * @param targetName Name of the target file or directory
14
+ * @returns Promise resolving to the generated path
15
+ */
16
+ export declare function generateVersionedOutputPath(baseDir: string, prefix: string, extension: string, modelName: string, targetName: string): Promise<string>;
17
+ /**
18
+ * Generate an output path for a file with a unique name
19
+ * @param baseDir Base directory for the output
20
+ * @param filename Desired filename
21
+ * @returns Promise resolving to the generated path
22
+ */
23
+ export declare function generateUniqueOutputPath(baseDir: string, filename: string): Promise<string>;
24
+ /**
25
+ * Generate a temporary file path
26
+ * @param prefix Prefix for the filename
27
+ * @param extension File extension (including the dot)
28
+ * @returns Generated temporary file path
29
+ */
30
+ export declare function generateTempFilePath(prefix: string, extension: string): string;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Path generation utilities.
4
+ *
5
+ * This module provides utilities for generating file and directory paths,
6
+ * including versioned output paths for review results.
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.generateVersionedOutputPath = generateVersionedOutputPath;
13
+ exports.generateUniqueOutputPath = generateUniqueOutputPath;
14
+ exports.generateTempFilePath = generateTempFilePath;
15
+ const node_path_1 = __importDefault(require("node:path"));
16
+ const FileWriter_1 = require("./FileWriter");
17
+ const pathValidator_1 = require("./pathValidator");
18
+ /**
19
+ * Generate a versioned output path for a file
20
+ * @param baseDir Base directory for the output
21
+ * @param prefix Prefix for the filename
22
+ * @param extension File extension (including the dot)
23
+ * @param modelName Name of the model used for the review
24
+ * @param targetName Name of the target file or directory
25
+ * @returns Promise resolving to the generated path
26
+ */
27
+ async function generateVersionedOutputPath(baseDir, prefix, extension, modelName, targetName) {
28
+ // Ensure the output directory exists
29
+ await (0, FileWriter_1.ensureDirectoryExists)(baseDir);
30
+ // Generate a timestamp for the filename
31
+ const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
32
+ // Clean up the model name for use in a filename
33
+ const cleanModelName = modelName.replace(/[^a-zA-Z0-9-]/g, '-');
34
+ // Clean up the target name for use in a filename
35
+ let cleanTargetName = targetName.replace(/[^a-zA-Z0-9-]/g, '-');
36
+ // Handle special cases for target names
37
+ if (targetName === '.' || cleanTargetName === '-' || cleanTargetName === '') {
38
+ cleanTargetName = 'current-dir';
39
+ }
40
+ // Remove any sequential dashes
41
+ cleanTargetName = cleanTargetName.replace(/-+/g, '-').replace(/^-|-$/g, '');
42
+ // Generate the filename
43
+ const filename = `${prefix}-${cleanTargetName}-${cleanModelName}-${timestamp}${extension}`;
44
+ // Return the full path
45
+ return node_path_1.default.join(baseDir, filename);
46
+ }
47
+ /**
48
+ * Generate an output path for a file with a unique name
49
+ * @param baseDir Base directory for the output
50
+ * @param filename Desired filename
51
+ * @returns Promise resolving to the generated path
52
+ */
53
+ async function generateUniqueOutputPath(baseDir, filename) {
54
+ // Ensure the output directory exists
55
+ await (0, FileWriter_1.ensureDirectoryExists)(baseDir);
56
+ // Generate the initial path
57
+ let outputPath = node_path_1.default.join(baseDir, filename);
58
+ // If the file already exists, add a number to the filename
59
+ if (await (0, pathValidator_1.pathExists)(outputPath)) {
60
+ const extension = node_path_1.default.extname(filename);
61
+ const nameWithoutExtension = node_path_1.default.basename(filename, extension);
62
+ let counter = 1;
63
+ // Try different numbers until we find an available filename
64
+ while (await (0, pathValidator_1.pathExists)(outputPath)) {
65
+ outputPath = node_path_1.default.join(baseDir, `${nameWithoutExtension}-${counter}${extension}`);
66
+ counter++;
67
+ }
68
+ }
69
+ return outputPath;
70
+ }
71
+ /**
72
+ * Generate a temporary file path
73
+ * @param prefix Prefix for the filename
74
+ * @param extension File extension (including the dot)
75
+ * @returns Generated temporary file path
76
+ */
77
+ function generateTempFilePath(prefix, extension) {
78
+ const timestamp = Date.now();
79
+ const randomPart = Math.floor(Math.random() * 10000);
80
+ return node_path_1.default.join(process.env.TEMP || process.env.TMP || '/tmp', `${prefix}-${timestamp}-${randomPart}${extension}`);
81
+ }
82
+ //# sourceMappingURL=PathGenerator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PathGenerator.js","sourceRoot":"","sources":["../../src/utils/PathGenerator.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAeH,kEAgCC;AAQD,4DAqBC;AAQD,oDAOC;AAzFD,0DAA6B;AAC7B,6CAAqD;AACrD,mDAA6C;AAE7C;;;;;;;;GAQG;AACI,KAAK,UA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CAAC,EAAE,CAAC;QACjC,MAAM,SAAS,GAAG,mBAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACzC,MAAM,oBAAoB,GAAG,mBAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAChE,IAAI,OAAO,GAAG,CAAC,CAAC;QAEhB,4DAA4D;QAC5D,OAAO,MAAM,IAAA,0BAAU,EAAC,UAAU,CAAC,EAAE,CAAC;YACpC,UAAU,GAAG,mBAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,oBAAoB,IAAI,OAAO,GAAG,SAAS,EAAE,CAAC,CAAC;YAClF,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,oBAAoB,CAAC,MAAc,EAAE,SAAiB;IACpE,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7B,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC;IACrD,OAAO,mBAAI,CAAC,IAAI,CACd,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,MAAM,EAC7C,GAAG,MAAM,IAAI,SAAS,IAAI,UAAU,GAAG,SAAS,EAAE,CACnD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function hasApiKey(provider: string): boolean;
2
+ export declare function getApiKeyType(): 'OpenRouter' | null;
3
+ export declare function getApiKeyTypeLowerCase(): 'openrouter' | 'none';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.hasApiKey = hasApiKey;
7
+ exports.getApiKeyType = getApiKeyType;
8
+ exports.getApiKeyTypeLowerCase = getApiKeyTypeLowerCase;
9
+ const logger_1 = __importDefault(require("../logger"));
10
+ function hasApiKey(provider) {
11
+ return provider.toLowerCase() === 'openrouter';
12
+ }
13
+ function getApiKeyType() {
14
+ logger_1.default.debug('getApiKeyType: defaulting to OpenRouter proxy');
15
+ return 'OpenRouter';
16
+ }
17
+ function getApiKeyTypeLowerCase() {
18
+ return 'openrouter';
19
+ }
20
+ //# sourceMappingURL=apiUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiUtils.js","sourceRoot":"","sources":["../../../src/utils/api/apiUtils.ts"],"names":[],"mappings":";;;;;AAEA,8BAEC;AAED,sCAGC;AAED,wDAEC;AAbD,uDAA+B;AAE/B,SAAgB,SAAS,CAAC,QAAgB;IACxC,OAAO,QAAQ,CAAC,WAAW,EAAE,KAAK,YAAY,CAAC;AACjD,CAAC;AAED,SAAgB,aAAa;IAC3B,gBAAM,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;IAC9D,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAgB,sBAAsB;IACpC,OAAO,YAAY,CAAC;AACtB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './apiUtils';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./apiUtils"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B"}