codereview-aia 0.1.3 → 0.1.4
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.
- package/dist/analysis/FindingsExtractor.d.ts +105 -0
- package/dist/analysis/FindingsExtractor.js +363 -0
- package/dist/analysis/FindingsExtractor.js.map +1 -0
- package/dist/analysis/ai-detection/analyzers/BaseAnalyzer.d.ts +111 -0
- package/dist/analysis/ai-detection/analyzers/BaseAnalyzer.js +215 -0
- package/dist/analysis/ai-detection/analyzers/BaseAnalyzer.js.map +1 -0
- package/dist/analysis/ai-detection/analyzers/DocumentationAnalyzer.d.ts +142 -0
- package/dist/analysis/ai-detection/analyzers/DocumentationAnalyzer.js +503 -0
- package/dist/analysis/ai-detection/analyzers/DocumentationAnalyzer.js.map +1 -0
- package/dist/analysis/ai-detection/analyzers/GitHistoryAnalyzer.d.ts +88 -0
- package/dist/analysis/ai-detection/analyzers/GitHistoryAnalyzer.js +343 -0
- package/dist/analysis/ai-detection/analyzers/GitHistoryAnalyzer.js.map +1 -0
- package/dist/analysis/ai-detection/core/AIDetectionEngine.d.ts +104 -0
- package/dist/analysis/ai-detection/core/AIDetectionEngine.js +369 -0
- package/dist/analysis/ai-detection/core/AIDetectionEngine.js.map +1 -0
- package/dist/analysis/ai-detection/types/DetectionTypes.d.ts +364 -0
- package/dist/analysis/ai-detection/types/DetectionTypes.js +32 -0
- package/dist/analysis/ai-detection/types/DetectionTypes.js.map +1 -0
- package/dist/analysis/ai-detection/utils/SubmissionConverter.d.ts +97 -0
- package/dist/analysis/ai-detection/utils/SubmissionConverter.js +339 -0
- package/dist/analysis/ai-detection/utils/SubmissionConverter.js.map +1 -0
- package/dist/analysis/context/ReviewContext.d.ts +184 -0
- package/dist/analysis/context/ReviewContext.js +294 -0
- package/dist/analysis/context/ReviewContext.js.map +1 -0
- package/{src/analysis/context/index.ts → dist/analysis/context/index.d.ts} +0 -1
- package/dist/analysis/context/index.js +23 -0
- package/dist/analysis/context/index.js.map +1 -0
- package/{src/analysis/index.ts → dist/analysis/index.d.ts} +0 -1
- package/dist/analysis/index.js +24 -0
- package/dist/analysis/index.js.map +1 -0
- package/dist/analysis/static/wpPhpcsRunner.d.ts +11 -0
- package/dist/analysis/static/wpPhpcsRunner.js +219 -0
- package/dist/analysis/static/wpPhpcsRunner.js.map +1 -0
- package/dist/analysis/tokens/TokenAnalysisFormatter.d.ts +27 -0
- package/{src/analysis/tokens/TokenAnalysisFormatter.ts → dist/analysis/tokens/TokenAnalysisFormatter.js} +64 -75
- package/dist/analysis/tokens/TokenAnalysisFormatter.js.map +1 -0
- package/dist/analysis/tokens/TokenAnalyzer.d.ts +155 -0
- package/dist/analysis/tokens/TokenAnalyzer.js +502 -0
- package/dist/analysis/tokens/TokenAnalyzer.js.map +1 -0
- package/{src/analysis/tokens/index.ts → dist/analysis/tokens/index.d.ts} +0 -1
- package/dist/analysis/tokens/index.js +24 -0
- package/dist/analysis/tokens/index.js.map +1 -0
- package/dist/clients/base/abstractClient.d.ts +99 -0
- package/dist/clients/base/abstractClient.js +98 -0
- package/dist/clients/base/abstractClient.js.map +1 -0
- package/dist/clients/base/httpClient.d.ts +24 -0
- package/dist/clients/base/httpClient.js +147 -0
- package/dist/clients/base/httpClient.js.map +1 -0
- package/{src/clients/base/index.ts → dist/clients/base/index.d.ts} +0 -1
- package/dist/clients/base/index.js +28 -0
- package/dist/clients/base/index.js.map +1 -0
- package/dist/clients/base/modelDetection.d.ts +41 -0
- package/dist/clients/base/modelDetection.js +88 -0
- package/dist/clients/base/modelDetection.js.map +1 -0
- package/dist/clients/base/responseProcessor.d.ts +45 -0
- package/dist/clients/base/responseProcessor.js +495 -0
- package/dist/clients/base/responseProcessor.js.map +1 -0
- package/dist/clients/factory/clientFactory.d.ts +23 -0
- package/dist/clients/factory/clientFactory.js +50 -0
- package/dist/clients/factory/clientFactory.js.map +1 -0
- package/{src/clients/factory/index.ts → dist/clients/factory/index.d.ts} +0 -1
- package/dist/clients/factory/index.js +24 -0
- package/dist/clients/factory/index.js.map +1 -0
- package/{src/clients/implementations/index.ts → dist/clients/implementations/index.d.ts} +0 -1
- package/dist/clients/implementations/index.js +24 -0
- package/dist/clients/implementations/index.js.map +1 -0
- package/dist/clients/implementations/openRouterClient.d.ts +69 -0
- package/dist/clients/implementations/openRouterClient.js +294 -0
- package/dist/clients/implementations/openRouterClient.js.map +1 -0
- package/dist/clients/openRouterClient.d.ts +42 -0
- package/dist/clients/openRouterClient.js +738 -0
- package/dist/clients/openRouterClient.js.map +1 -0
- package/{src/clients/openRouterClientWrapper.ts → dist/clients/openRouterClientWrapper.d.ts} +2 -24
- package/dist/clients/openRouterClientWrapper.js +64 -0
- package/dist/clients/openRouterClientWrapper.js.map +1 -0
- package/dist/clients/utils/directoryStructure.d.ts +14 -0
- package/dist/clients/utils/directoryStructure.js +48 -0
- package/dist/clients/utils/directoryStructure.js.map +1 -0
- package/{src/clients/utils/index.ts → dist/clients/utils/index.d.ts} +0 -1
- package/dist/clients/utils/index.js +31 -0
- package/dist/clients/utils/index.js.map +1 -0
- package/dist/clients/utils/languageDetection.d.ts +13 -0
- package/dist/clients/utils/languageDetection.js +46 -0
- package/dist/clients/utils/languageDetection.js.map +1 -0
- package/dist/clients/utils/promptFormatter.d.ts +37 -0
- package/dist/clients/utils/promptFormatter.js +150 -0
- package/dist/clients/utils/promptFormatter.js.map +1 -0
- package/{src/clients/utils/promptLoader.ts → dist/clients/utils/promptLoader.d.ts} +1 -27
- package/dist/clients/utils/promptLoader.js +49 -0
- package/dist/clients/utils/promptLoader.js.map +1 -0
- package/dist/clients/utils/tokenCounter.d.ts +81 -0
- package/dist/clients/utils/tokenCounter.js +209 -0
- package/dist/clients/utils/tokenCounter.js.map +1 -0
- package/dist/core/ApiClientSelector.d.ts +8 -0
- package/dist/core/ApiClientSelector.js +29 -0
- package/dist/core/ApiClientSelector.js.map +1 -0
- package/dist/core/ConfigurationService.d.ts +307 -0
- package/dist/core/ConfigurationService.js +516 -0
- package/dist/core/ConfigurationService.js.map +1 -0
- package/dist/core/ConsolidationService.d.ts +99 -0
- package/dist/core/ConsolidationService.js +341 -0
- package/dist/core/ConsolidationService.js.map +1 -0
- package/dist/core/InteractiveDisplayManager.d.ts +22 -0
- package/dist/core/InteractiveDisplayManager.js +70 -0
- package/dist/core/InteractiveDisplayManager.js.map +1 -0
- package/dist/core/OutputManager.d.ts +26 -0
- package/dist/core/OutputManager.js +217 -0
- package/dist/core/OutputManager.js.map +1 -0
- package/dist/core/ReviewGenerator.d.ts +13 -0
- package/dist/core/ReviewGenerator.js +102 -0
- package/dist/core/ReviewGenerator.js.map +1 -0
- package/dist/core/fileDiscovery.d.ts +35 -0
- package/dist/core/fileDiscovery.js +202 -0
- package/dist/core/fileDiscovery.js.map +1 -0
- package/dist/core/handlers/EstimationHandler.d.ts +18 -0
- package/dist/core/handlers/EstimationHandler.js +110 -0
- package/dist/core/handlers/EstimationHandler.js.map +1 -0
- package/dist/core/handlers/FileProcessingHandler.d.ts +31 -0
- package/dist/core/handlers/FileProcessingHandler.js +164 -0
- package/dist/core/handlers/FileProcessingHandler.js.map +1 -0
- package/dist/core/handlers/OutputHandler.d.ts +27 -0
- package/dist/core/handlers/OutputHandler.js +127 -0
- package/dist/core/handlers/OutputHandler.js.map +1 -0
- package/dist/core/handlers/ReviewExecutor.d.ts +32 -0
- package/dist/core/handlers/ReviewExecutor.js +111 -0
- package/dist/core/handlers/ReviewExecutor.js.map +1 -0
- package/dist/core/reviewOrchestrator.d.ts +24 -0
- package/dist/core/reviewOrchestrator.js +354 -0
- package/dist/core/reviewOrchestrator.js.map +1 -0
- package/dist/core/utils/ModelInfoUtils.d.ts +16 -0
- package/dist/core/utils/ModelInfoUtils.js +54 -0
- package/dist/core/utils/ModelInfoUtils.js.map +1 -0
- package/{src/formatters/outputFormatter.ts → dist/formatters/outputFormatter.d.ts} +2 -33
- package/dist/formatters/outputFormatter.js +65 -0
- package/dist/formatters/outputFormatter.js.map +1 -0
- package/dist/formatters/utils/IssueFormatters.d.ts +20 -0
- package/dist/formatters/utils/IssueFormatters.js +67 -0
- package/dist/formatters/utils/IssueFormatters.js.map +1 -0
- package/dist/formatters/utils/JsonFormatter.d.ts +13 -0
- package/dist/formatters/utils/JsonFormatter.js +57 -0
- package/dist/formatters/utils/JsonFormatter.js.map +1 -0
- package/dist/formatters/utils/MarkdownFormatters.d.ts +51 -0
- package/dist/formatters/utils/MarkdownFormatters.js +456 -0
- package/dist/formatters/utils/MarkdownFormatters.js.map +1 -0
- package/dist/formatters/utils/MetadataFormatter.d.ts +65 -0
- package/dist/formatters/utils/MetadataFormatter.js +219 -0
- package/dist/formatters/utils/MetadataFormatter.js.map +1 -0
- package/dist/formatters/utils/ModelInfoExtractor.d.ts +33 -0
- package/dist/formatters/utils/ModelInfoExtractor.js +111 -0
- package/dist/formatters/utils/ModelInfoExtractor.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/PluginInterface.d.ts +44 -0
- package/dist/plugins/PluginInterface.js +9 -0
- package/dist/plugins/PluginInterface.js.map +1 -0
- package/dist/plugins/PluginManager.d.ts +51 -0
- package/dist/plugins/PluginManager.js +151 -0
- package/dist/plugins/PluginManager.js.map +1 -0
- package/dist/prompts/PromptManager.d.ts +30 -0
- package/dist/prompts/PromptManager.js +62 -0
- package/dist/prompts/PromptManager.js.map +1 -0
- package/dist/prompts/cache/PromptCache.d.ts +32 -0
- package/dist/prompts/cache/PromptCache.js +48 -0
- package/dist/prompts/cache/PromptCache.js.map +1 -0
- package/dist/runtime/auth/service.d.ts +2 -0
- package/dist/runtime/auth/service.js +41 -0
- package/dist/runtime/auth/service.js.map +1 -0
- package/dist/runtime/auth/session.d.ts +5 -0
- package/dist/runtime/auth/session.js +87 -0
- package/dist/runtime/auth/session.js.map +1 -0
- package/dist/runtime/auth/types.d.ts +9 -0
- package/dist/runtime/auth/types.js +3 -0
- package/dist/runtime/auth/types.js.map +1 -0
- package/dist/runtime/cliEntry.d.ts +1 -0
- package/dist/runtime/cliEntry.js +266 -0
- package/dist/runtime/cliEntry.js.map +1 -0
- package/dist/runtime/debug/logManager.d.ts +5 -0
- package/dist/runtime/debug/logManager.js +31 -0
- package/dist/runtime/debug/logManager.js.map +1 -0
- package/dist/runtime/errors.d.ts +5 -0
- package/dist/runtime/errors.js +15 -0
- package/dist/runtime/errors.js.map +1 -0
- package/dist/runtime/fileCollector.d.ts +14 -0
- package/dist/runtime/fileCollector.js +382 -0
- package/dist/runtime/fileCollector.js.map +1 -0
- package/dist/runtime/manifest.d.ts +1 -0
- package/dist/runtime/manifest.js +65 -0
- package/dist/runtime/manifest.js.map +1 -0
- package/dist/runtime/openrouterProxy.d.ts +4 -0
- package/dist/runtime/openrouterProxy.js +43 -0
- package/dist/runtime/openrouterProxy.js.map +1 -0
- package/dist/runtime/preprod/webCheck.d.ts +1 -0
- package/dist/runtime/preprod/webCheck.js +98 -0
- package/dist/runtime/preprod/webCheck.js.map +1 -0
- package/dist/runtime/proxyConfig.d.ts +6 -0
- package/dist/runtime/proxyConfig.js +86 -0
- package/dist/runtime/proxyConfig.js.map +1 -0
- package/dist/runtime/proxyEnvironment.d.ts +3 -0
- package/dist/runtime/proxyEnvironment.js +63 -0
- package/dist/runtime/proxyEnvironment.js.map +1 -0
- package/dist/runtime/reportMerge.d.ts +30 -0
- package/dist/runtime/reportMerge.js +70 -0
- package/dist/runtime/reportMerge.js.map +1 -0
- package/dist/runtime/reporting/markdownReportBuilder.d.ts +17 -0
- package/dist/runtime/reporting/markdownReportBuilder.js +154 -0
- package/dist/runtime/reporting/markdownReportBuilder.js.map +1 -0
- package/dist/runtime/reporting/reportDataCollector.d.ts +31 -0
- package/dist/runtime/reporting/reportDataCollector.js +170 -0
- package/dist/runtime/reporting/reportDataCollector.js.map +1 -0
- package/dist/runtime/reporting/summaryGenerator.d.ts +10 -0
- package/dist/runtime/reporting/summaryGenerator.js +67 -0
- package/dist/runtime/reporting/summaryGenerator.js.map +1 -0
- package/dist/runtime/reviewPipeline.d.ts +47 -0
- package/dist/runtime/reviewPipeline.js +161 -0
- package/dist/runtime/reviewPipeline.js.map +1 -0
- package/dist/runtime/runAiCodeReview.d.ts +28 -0
- package/dist/runtime/runAiCodeReview.js +373 -0
- package/dist/runtime/runAiCodeReview.js.map +1 -0
- package/dist/runtime/runtimeConfig.d.ts +4 -0
- package/dist/runtime/runtimeConfig.js +7 -0
- package/dist/runtime/runtimeConfig.js.map +1 -0
- package/dist/runtime/ui/Layout.d.ts +11 -0
- package/dist/runtime/ui/Layout.js +47 -0
- package/dist/runtime/ui/Layout.js.map +1 -0
- package/dist/runtime/ui/RuntimeApp.d.ts +6 -0
- package/dist/runtime/ui/RuntimeApp.js +172 -0
- package/dist/runtime/ui/RuntimeApp.js.map +1 -0
- package/dist/runtime/ui/inkModules.d.ts +10 -0
- package/dist/runtime/ui/inkModules.js +63 -0
- package/dist/runtime/ui/inkModules.js.map +1 -0
- package/dist/runtime/ui/screens/AuthScreen.d.ts +6 -0
- package/dist/runtime/ui/screens/AuthScreen.js +67 -0
- package/dist/runtime/ui/screens/AuthScreen.js.map +1 -0
- package/dist/runtime/ui/screens/ModeSelection.d.ts +10 -0
- package/dist/runtime/ui/screens/ModeSelection.js +100 -0
- package/dist/runtime/ui/screens/ModeSelection.js.map +1 -0
- package/dist/runtime/ui/screens/ProgressScreen.d.ts +12 -0
- package/dist/runtime/ui/screens/ProgressScreen.js +64 -0
- package/dist/runtime/ui/screens/ProgressScreen.js.map +1 -0
- package/dist/runtime/ui/screens/ResultsScreen.d.ts +7 -0
- package/dist/runtime/ui/screens/ResultsScreen.js +29 -0
- package/dist/runtime/ui/screens/ResultsScreen.js.map +1 -0
- package/dist/strategies/ArchitecturalReviewStrategy.d.ts +29 -0
- package/dist/strategies/ArchitecturalReviewStrategy.js +42 -0
- package/dist/strategies/ArchitecturalReviewStrategy.js.map +1 -0
- package/dist/strategies/CodingTestReviewStrategy.d.ts +194 -0
- package/dist/strategies/CodingTestReviewStrategy.js +681 -0
- package/dist/strategies/CodingTestReviewStrategy.js.map +1 -0
- package/dist/strategies/ConsolidatedReviewStrategy.d.ts +25 -0
- package/dist/strategies/ConsolidatedReviewStrategy.js +45 -0
- package/dist/strategies/ConsolidatedReviewStrategy.js.map +1 -0
- package/dist/strategies/ExtractPatternsReviewStrategy.d.ts +30 -0
- package/dist/strategies/ExtractPatternsReviewStrategy.js +51 -0
- package/dist/strategies/ExtractPatternsReviewStrategy.js.map +1 -0
- package/dist/strategies/MultiPassReviewStrategy.d.ts +86 -0
- package/dist/strategies/MultiPassReviewStrategy.js +590 -0
- package/dist/strategies/MultiPassReviewStrategy.js.map +1 -0
- package/dist/strategies/ReviewStrategy.d.ts +45 -0
- package/dist/strategies/ReviewStrategy.js +24 -0
- package/dist/strategies/ReviewStrategy.js.map +1 -0
- package/dist/strategies/StrategyFactory.d.ts +19 -0
- package/dist/strategies/StrategyFactory.js +72 -0
- package/dist/strategies/StrategyFactory.js.map +1 -0
- package/{src/strategies/index.ts → dist/strategies/index.d.ts} +0 -1
- package/dist/strategies/index.js +30 -0
- package/dist/strategies/index.js.map +1 -0
- package/dist/tokenizers/baseTokenizer.d.ts +25 -0
- package/dist/tokenizers/baseTokenizer.js +48 -0
- package/dist/tokenizers/baseTokenizer.js.map +1 -0
- package/dist/tokenizers/gptTokenizer.d.ts +7 -0
- package/dist/tokenizers/gptTokenizer.js +28 -0
- package/dist/tokenizers/gptTokenizer.js.map +1 -0
- package/{src/tokenizers/index.ts → dist/tokenizers/index.d.ts} +0 -1
- package/dist/tokenizers/index.js +24 -0
- package/dist/tokenizers/index.js.map +1 -0
- package/dist/types/apiResponses.d.ts +39 -0
- package/dist/types/apiResponses.js +9 -0
- package/dist/types/apiResponses.js.map +1 -0
- package/dist/types/cli.d.ts +22 -0
- package/dist/types/cli.js +3 -0
- package/dist/types/cli.js.map +1 -0
- package/{src/types/common.ts → dist/types/common.d.ts} +2 -19
- package/dist/types/common.js +14 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/configuration.d.ts +682 -0
- package/dist/types/configuration.js +65 -0
- package/dist/types/configuration.js.map +1 -0
- package/dist/types/review.d.ts +318 -0
- package/dist/types/review.js +8 -0
- package/dist/types/review.js.map +1 -0
- package/dist/types/reviewSchema.d.ts +543 -0
- package/{src/types/reviewSchema.ts → dist/types/reviewSchema.js} +44 -104
- package/dist/types/reviewSchema.js.map +1 -0
- package/dist/types/structuredReview.d.ts +119 -0
- package/dist/types/structuredReview.js +6 -0
- package/dist/types/structuredReview.js.map +1 -0
- package/dist/types/tokenAnalysis.d.ts +44 -0
- package/dist/types/tokenAnalysis.js +4 -0
- package/dist/types/tokenAnalysis.js.map +1 -0
- package/dist/utils/FileReader.d.ts +33 -0
- package/dist/utils/FileReader.js +88 -0
- package/dist/utils/FileReader.js.map +1 -0
- package/dist/utils/FileWriter.d.ts +26 -0
- package/dist/utils/FileWriter.js +76 -0
- package/dist/utils/FileWriter.js.map +1 -0
- package/dist/utils/PathGenerator.d.ts +30 -0
- package/dist/utils/PathGenerator.js +82 -0
- package/dist/utils/PathGenerator.js.map +1 -0
- package/dist/utils/api/apiUtils.d.ts +3 -0
- package/dist/utils/api/apiUtils.js +20 -0
- package/dist/utils/api/apiUtils.js.map +1 -0
- package/dist/utils/api/index.js +18 -0
- package/dist/utils/api/index.js.map +1 -0
- package/dist/utils/apiErrorHandler.d.ts +130 -0
- package/dist/utils/apiErrorHandler.js +256 -0
- package/dist/utils/apiErrorHandler.js.map +1 -0
- package/dist/utils/ciDataCollector.d.ts +51 -0
- package/dist/utils/ciDataCollector.js +197 -0
- package/dist/utils/ciDataCollector.js.map +1 -0
- package/dist/utils/codingTestConfigLoader.d.ts +66 -0
- package/dist/utils/codingTestConfigLoader.js +420 -0
- package/dist/utils/codingTestConfigLoader.js.map +1 -0
- package/dist/utils/dependencies/aiDependencyAnalyzer.d.ts +30 -0
- package/dist/utils/dependencies/aiDependencyAnalyzer.js +343 -0
- package/dist/utils/dependencies/aiDependencyAnalyzer.js.map +1 -0
- package/dist/utils/detection/frameworkDetector.d.ts +43 -0
- package/dist/utils/detection/frameworkDetector.js +850 -0
- package/dist/utils/detection/frameworkDetector.js.map +1 -0
- package/{src/utils/detection/index.ts → dist/utils/detection/index.d.ts} +0 -1
- package/dist/utils/detection/index.js +28 -0
- package/dist/utils/detection/index.js.map +1 -0
- package/dist/utils/detection/projectTypeDetector.d.ts +27 -0
- package/dist/utils/detection/projectTypeDetector.js +469 -0
- package/dist/utils/detection/projectTypeDetector.js.map +1 -0
- package/dist/utils/diagramGenerator.d.ts +49 -0
- package/dist/utils/diagramGenerator.js +218 -0
- package/dist/utils/diagramGenerator.js.map +1 -0
- package/dist/utils/errorLogger.d.ts +24 -0
- package/dist/utils/errorLogger.js +59 -0
- package/dist/utils/errorLogger.js.map +1 -0
- package/dist/utils/estimationUtils.d.ts +139 -0
- package/dist/utils/estimationUtils.js +329 -0
- package/dist/utils/estimationUtils.js.map +1 -0
- package/dist/utils/fileFilters.d.ts +72 -0
- package/dist/utils/fileFilters.js +338 -0
- package/dist/utils/fileFilters.js.map +1 -0
- package/dist/utils/fileSystem.d.ts +22 -0
- package/dist/utils/fileSystem.js +45 -0
- package/dist/utils/fileSystem.js.map +1 -0
- package/{src/utils/index.ts → dist/utils/index.d.ts} +0 -14
- package/dist/utils/index.js +52 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +77 -0
- package/dist/utils/logger.js +271 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/pathValidator.d.ts +40 -0
- package/dist/utils/pathValidator.js +98 -0
- package/dist/utils/pathValidator.js.map +1 -0
- package/{src/utils/priorityFilter.ts → dist/utils/priorityFilter.d.ts} +1 -26
- package/dist/utils/priorityFilter.js +54 -0
- package/dist/utils/priorityFilter.js.map +1 -0
- package/dist/utils/projectDocs.d.ts +47 -0
- package/dist/utils/projectDocs.js +158 -0
- package/dist/utils/projectDocs.js.map +1 -0
- package/dist/utils/promptPaths.d.ts +6 -0
- package/dist/utils/promptPaths.js +33 -0
- package/dist/utils/promptPaths.js.map +1 -0
- package/dist/utils/promptTemplateManager.d.ts +34 -0
- package/dist/utils/promptTemplateManager.js +141 -0
- package/dist/utils/promptTemplateManager.js.map +1 -0
- package/dist/utils/review/consolidateReview.d.ts +15 -0
- package/dist/utils/review/consolidateReview.js +481 -0
- package/dist/utils/review/consolidateReview.js.map +1 -0
- package/dist/utils/review/fixDisplay.d.ts +20 -0
- package/dist/utils/review/fixDisplay.js +84 -0
- package/dist/utils/review/fixDisplay.js.map +1 -0
- package/dist/utils/review/fixImplementation.d.ts +28 -0
- package/dist/utils/review/fixImplementation.js +60 -0
- package/dist/utils/review/fixImplementation.js.map +1 -0
- package/dist/utils/review/index.d.ts +13 -0
- package/dist/utils/review/index.js +50 -0
- package/dist/utils/review/index.js.map +1 -0
- package/dist/utils/review/interactiveProcessing.d.ts +25 -0
- package/dist/utils/review/interactiveProcessing.js +251 -0
- package/dist/utils/review/interactiveProcessing.js.map +1 -0
- package/dist/utils/review/progressTracker.d.ts +106 -0
- package/dist/utils/review/progressTracker.js +227 -0
- package/dist/utils/review/progressTracker.js.map +1 -0
- package/dist/utils/review/reviewExtraction.d.ts +31 -0
- package/dist/utils/review/reviewExtraction.js +324 -0
- package/dist/utils/review/reviewExtraction.js.map +1 -0
- package/dist/utils/review/types.d.ts +45 -0
- package/dist/utils/review/types.js +18 -0
- package/dist/utils/review/types.js.map +1 -0
- package/{src/utils/reviewActionHandler.ts → dist/utils/reviewActionHandler.d.ts} +0 -2
- package/dist/utils/reviewActionHandler.js +34 -0
- package/dist/utils/reviewActionHandler.js.map +1 -0
- package/dist/utils/reviewParser.d.ts +34 -0
- package/dist/utils/reviewParser.js +218 -0
- package/dist/utils/reviewParser.js.map +1 -0
- package/dist/utils/sanitizer.d.ts +82 -0
- package/dist/utils/sanitizer.js +239 -0
- package/dist/utils/sanitizer.js.map +1 -0
- package/dist/utils/smartFileSelector.d.ts +50 -0
- package/dist/utils/smartFileSelector.js +261 -0
- package/dist/utils/smartFileSelector.js.map +1 -0
- package/dist/utils/templateLoader.d.ts +44 -0
- package/dist/utils/templateLoader.js +431 -0
- package/dist/utils/templateLoader.js.map +1 -0
- package/dist/utils/treeGenerator.d.ts +12 -0
- package/dist/utils/treeGenerator.js +133 -0
- package/dist/utils/treeGenerator.js.map +1 -0
- package/package.json +5 -2
- package/.cr-aia.yml +0 -23
- package/.crignore +0 -0
- package/docs/opt-in-full-context.md +0 -27
- package/reports/cr-cr-aia-17-11-2025-20-13.md +0 -354
- package/src/analysis/FindingsExtractor.ts +0 -431
- package/src/analysis/ai-detection/analyzers/BaseAnalyzer.ts +0 -267
- package/src/analysis/ai-detection/analyzers/DocumentationAnalyzer.ts +0 -622
- package/src/analysis/ai-detection/analyzers/GitHistoryAnalyzer.ts +0 -430
- package/src/analysis/ai-detection/core/AIDetectionEngine.ts +0 -467
- package/src/analysis/ai-detection/types/DetectionTypes.ts +0 -406
- package/src/analysis/ai-detection/utils/SubmissionConverter.ts +0 -390
- package/src/analysis/context/ReviewContext.ts +0 -378
- package/src/analysis/tokens/TokenAnalyzer.ts +0 -747
- package/src/clients/base/abstractClient.ts +0 -190
- package/src/clients/base/httpClient.ts +0 -160
- package/src/clients/base/modelDetection.ts +0 -107
- package/src/clients/base/responseProcessor.ts +0 -586
- package/src/clients/factory/clientFactory.ts +0 -55
- package/src/clients/implementations/openRouterClient.ts +0 -413
- package/src/clients/openRouterClient.ts +0 -870
- package/src/clients/utils/directoryStructure.ts +0 -52
- package/src/clients/utils/languageDetection.ts +0 -44
- package/src/clients/utils/promptFormatter.ts +0 -182
- package/src/clients/utils/tokenCounter.ts +0 -297
- package/src/core/ApiClientSelector.ts +0 -37
- package/src/core/ConfigurationService.ts +0 -591
- package/src/core/ConsolidationService.ts +0 -423
- package/src/core/InteractiveDisplayManager.ts +0 -81
- package/src/core/OutputManager.ts +0 -275
- package/src/core/ReviewGenerator.ts +0 -140
- package/src/core/fileDiscovery.ts +0 -237
- package/src/core/handlers/EstimationHandler.ts +0 -104
- package/src/core/handlers/FileProcessingHandler.ts +0 -210
- package/src/core/handlers/OutputHandler.ts +0 -125
- package/src/core/handlers/ReviewExecutor.ts +0 -104
- package/src/core/reviewOrchestrator.ts +0 -333
- package/src/core/utils/ModelInfoUtils.ts +0 -56
- package/src/formatters/utils/IssueFormatters.ts +0 -83
- package/src/formatters/utils/JsonFormatter.ts +0 -77
- package/src/formatters/utils/MarkdownFormatters.ts +0 -609
- package/src/formatters/utils/MetadataFormatter.ts +0 -269
- package/src/formatters/utils/ModelInfoExtractor.ts +0 -115
- package/src/index.ts +0 -25
- package/src/plugins/PluginInterface.ts +0 -50
- package/src/plugins/PluginManager.ts +0 -126
- package/src/prompts/PromptManager.ts +0 -69
- package/src/prompts/cache/PromptCache.ts +0 -50
- package/src/prompts/promptText/common/variables/css-frameworks.json +0 -33
- package/src/prompts/promptText/common/variables/framework-versions.json +0 -45
- package/src/prompts/promptText/frameworks/react/comprehensive.hbs +0 -19
- package/src/prompts/promptText/languages/css/comprehensive.hbs +0 -18
- package/src/prompts/promptText/languages/generic/comprehensive.hbs +0 -20
- package/src/prompts/promptText/languages/html/comprehensive.hbs +0 -18
- package/src/prompts/promptText/languages/javascript/comprehensive.hbs +0 -18
- package/src/prompts/promptText/languages/python/comprehensive.hbs +0 -18
- package/src/prompts/promptText/languages/typescript/comprehensive.hbs +0 -18
- package/src/runtime/auth/service.ts +0 -58
- package/src/runtime/auth/session.ts +0 -103
- package/src/runtime/auth/types.ts +0 -11
- package/src/runtime/cliEntry.ts +0 -214
- package/src/runtime/debug/logManager.ts +0 -37
- package/src/runtime/errors.ts +0 -13
- package/src/runtime/fileCollector.ts +0 -495
- package/src/runtime/manifest.ts +0 -64
- package/src/runtime/openrouterProxy.ts +0 -45
- package/src/runtime/preprod/webCheck.ts +0 -104
- package/src/runtime/proxyConfig.ts +0 -94
- package/src/runtime/proxyEnvironment.ts +0 -71
- package/src/runtime/reportMerge.ts +0 -102
- package/src/runtime/reporting/markdownReportBuilder.ts +0 -138
- package/src/runtime/reporting/reportDataCollector.ts +0 -234
- package/src/runtime/reporting/summaryGenerator.ts +0 -86
- package/src/runtime/reviewPipeline.ts +0 -200
- package/src/runtime/runAiCodeReview.ts +0 -308
- package/src/runtime/runtimeConfig.ts +0 -5
- package/src/runtime/ui/Layout.tsx +0 -57
- package/src/runtime/ui/RuntimeApp.tsx +0 -262
- package/src/runtime/ui/inkModules.ts +0 -73
- package/src/runtime/ui/screens/AuthScreen.tsx +0 -128
- package/src/runtime/ui/screens/ModeSelection.tsx +0 -185
- package/src/runtime/ui/screens/ProgressScreen.tsx +0 -110
- package/src/runtime/ui/screens/ResultsScreen.tsx +0 -103
- package/src/strategies/ArchitecturalReviewStrategy.ts +0 -54
- package/src/strategies/CodingTestReviewStrategy.ts +0 -920
- package/src/strategies/ConsolidatedReviewStrategy.ts +0 -59
- package/src/strategies/ExtractPatternsReviewStrategy.ts +0 -64
- package/src/strategies/MultiPassReviewStrategy.ts +0 -785
- package/src/strategies/ReviewStrategy.ts +0 -64
- package/src/strategies/StrategyFactory.ts +0 -79
- package/src/tokenizers/baseTokenizer.ts +0 -61
- package/src/tokenizers/gptTokenizer.ts +0 -27
- package/src/types/apiResponses.ts +0 -40
- package/src/types/cli.ts +0 -24
- package/src/types/configuration.ts +0 -201
- package/src/types/handlebars.d.ts +0 -5
- package/src/types/patch.d.ts +0 -25
- package/src/types/review.ts +0 -312
- package/src/types/reviewContext.d.ts +0 -65
- package/src/types/structuredReview.ts +0 -167
- package/src/types/tokenAnalysis.ts +0 -56
- package/src/utils/FileReader.ts +0 -93
- package/src/utils/FileWriter.ts +0 -76
- package/src/utils/PathGenerator.ts +0 -97
- package/src/utils/api/apiUtils.ts +0 -14
- package/src/utils/apiErrorHandler.ts +0 -287
- package/src/utils/ciDataCollector.ts +0 -252
- package/src/utils/codingTestConfigLoader.ts +0 -466
- package/src/utils/dependencies/aiDependencyAnalyzer.ts +0 -454
- package/src/utils/detection/frameworkDetector.ts +0 -879
- package/src/utils/detection/projectTypeDetector.ts +0 -518
- package/src/utils/diagramGenerator.ts +0 -206
- package/src/utils/errorLogger.ts +0 -60
- package/src/utils/estimationUtils.ts +0 -407
- package/src/utils/fileFilters.ts +0 -373
- package/src/utils/fileSystem.ts +0 -57
- package/src/utils/logger.ts +0 -290
- package/src/utils/pathValidator.ts +0 -98
- package/src/utils/projectDocs.ts +0 -189
- package/src/utils/promptPaths.ts +0 -29
- package/src/utils/promptTemplateManager.ts +0 -157
- package/src/utils/review/consolidateReview.ts +0 -553
- package/src/utils/review/fixDisplay.ts +0 -100
- package/src/utils/review/fixImplementation.ts +0 -61
- package/src/utils/review/index.ts +0 -36
- package/src/utils/review/interactiveProcessing.ts +0 -294
- package/src/utils/review/progressTracker.ts +0 -296
- package/src/utils/review/reviewExtraction.ts +0 -382
- package/src/utils/review/types.ts +0 -46
- package/src/utils/reviewParser.ts +0 -253
- package/src/utils/sanitizer.ts +0 -238
- package/src/utils/smartFileSelector.ts +0 -255
- package/src/utils/templateLoader.ts +0 -514
- package/src/utils/treeGenerator.ts +0 -153
- package/tsconfig.build.json +0 -14
- package/tsconfig.json +0 -59
- /package/{src/utils/api/index.ts → dist/utils/api/index.d.ts} +0 -0
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# Opt-in Full Context Mode (Future Work)
|
|
2
|
-
|
|
3
|
-
## Goal
|
|
4
|
-
|
|
5
|
-
Provide an optional review mode that sends *all* workspace files (or a curated superset) to the reviewer even when only a few files are uncommitted. This gives the LLM maximal context when the default heuristics still miss important background files.
|
|
6
|
-
|
|
7
|
-
## Proposed Implementation
|
|
8
|
-
|
|
9
|
-
1. **User-facing switch** – add a CLI flag/Ink toggle (e.g., `--full-context` or “Include unchanged dependencies”) that is disabled by default. The runtime pipeline passes this intent to `collectFiles`/`runAiCodeReview` so regular runs stay lean.
|
|
10
|
-
2. **Collection strategy** – when enabled, skip the uncommitted filter and instead gather a blended set:
|
|
11
|
-
- Start with the regular uncommitted list so we always cover the edits.
|
|
12
|
-
- Add high-signal roots (entrypoints, configs, docs) and optionally entire directories referenced in commits.
|
|
13
|
-
- Allow `.cr-context` (new config file) so teams can pin extra paths per repo.
|
|
14
|
-
3. **Chunking/limits** – reuse the grouping logic introduced in this change to ensure we stay within token limits. We can raise the per-group cap when the flag is on but still keep track of aggregate tokens to fall back to multi-pass mode if we exceed a threshold.
|
|
15
|
-
4. **UI feedback** – surface a warning in the progress screen (“Full context mode enabled – reviewing X untouched files for additional background”) so users understand the increased scope/cost.
|
|
16
|
-
|
|
17
|
-
## Benefits
|
|
18
|
-
|
|
19
|
-
- Gives reviewers the architectural/story context that diffs often omit, improving findings for refactors or feature work where untouched helpers matter.
|
|
20
|
-
- Makes it easier to audit legacy code by letting reviewers sweep entire layers without needing to stage files.
|
|
21
|
-
- The opt-in keeps default runs fast and cheap, so we only pay the extra tokens when the user explicitly needs depth.
|
|
22
|
-
|
|
23
|
-
## Future Directions
|
|
24
|
-
|
|
25
|
-
- **Smart presets** – allow repo maintainers to declare named context sets ("frontend", "backend", etc.) and let users pick one at runtime.
|
|
26
|
-
- **Adaptive sampling** – detect when the model repeatedly references missing files and automatically re-run a review with the full-context flag.
|
|
27
|
-
- **Cost guardrails** – estimate additional spend before launching the run and prompt users when the expanded scope crosses a configurable threshold.
|
|
@@ -1,354 +0,0 @@
|
|
|
1
|
-
# Code Review Report — 17.11.2025 20.13
|
|
2
|
-
|
|
3
|
-
**Repository:** cr-aia
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Stats
|
|
10
|
-
- Spend: $0.0110 USD
|
|
11
|
-
- Duration: 00:01:48
|
|
12
|
-
- Files reviewed: 13
|
|
13
|
-
- Total tokens: 36,920 (input: 24,847 / output: 12,073)
|
|
14
|
-
- Issues: Critical 2 · High 13 · Medium 22 · Low 15
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
### Summary
|
|
22
|
-
|
|
23
|
-
>The reviewed codebase in the cr-aia repository shows moderate health, with 13 files containing 2 critical, 13 high, 22 medium, and 15 low issues, indicating functionality but notable gaps in robustness, type safety, and security that could lead to runtime failures or breaches. Highest-risk themes include syntax errors and incomplete implementations (e.g., truncated code in projectDocs.ts and logger.ts), insecure API key handling and logging exposures, missing error handling in async operations, and widespread TypeScript type deficiencies across clients, utils, and UI components. The review was efficient, costing $0.0110 USD and taking 1:48 to process 36,920 tokens.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
### Issues
|
|
30
|
-
|
|
31
|
-
#### src/clients/implementations/openRouterClient.ts
|
|
32
|
-
##### [High] Insecure API key exposure in environment variable access (lines 15-20)
|
|
33
|
-
- **Problem:** API key is fetched directly from process.env without validation or fallback, risking runtime errors or exposure if logged inadvertently.
|
|
34
|
-
- **Impact:** Potential data leakage if logs capture env vars, or application crashes in misconfigured environments affecting production reliability.
|
|
35
|
-
- **Recommendation:** Implement a secure config loader using a dedicated module like src/utils/config.ts to validate and cache the key, avoiding direct env access in client code.
|
|
36
|
-
|
|
37
|
-
##### [Medium] Incomplete error handling in HTTP requests (lines 45-60)
|
|
38
|
-
- **Problem:** Async HTTP calls using fetch lack comprehensive try-catch for network errors and non-2xx responses, leading to unhandled promise rejections.
|
|
39
|
-
- **Impact:** Silent failures in API calls could propagate errors upstream, causing inconsistent AI review outputs and user confusion.
|
|
40
|
-
- **Recommendation:** Wrap in try-catch, check response.ok, and use a custom error class extending from base client errors for consistent logging via src/utils/logger.ts.
|
|
41
|
-
|
|
42
|
-
##### [Medium] Missing TypeScript types for response models (lines 70-85)
|
|
43
|
-
- **Problem:** Response parsing assumes any type without defining interfaces, reducing type safety and IDE support.
|
|
44
|
-
- **Impact:** Type mismatches could introduce runtime bugs during prompt processing, especially with varying OpenRouter response formats.
|
|
45
|
-
- **Recommendation:** Define interfaces like OpenRouterResponse extending from base client types in src/clients/base/index.ts, and use proper type assertions or Zod parsing for validation.
|
|
46
|
-
|
|
47
|
-
##### [Low] Unused imports from LangChain core (lines 1-5)
|
|
48
|
-
- **Problem:** Imports like ChatOpenAI from @langchain/openai are present but not utilized, cluttering the module.
|
|
49
|
-
- **Impact:** Minor bloat in transpiled output, but signals potential incomplete integration with LangChain ecosystem.
|
|
50
|
-
- **Recommendation:** Remove unused imports to clean up the file and improve bundle size in the CLI build.
|
|
51
|
-
|
|
52
|
-
##### [Low] No rate limiting or retry logic for API calls (lines 30-40)
|
|
53
|
-
- **Problem:** Direct fetch calls without exponential backoff or concurrency limits, risking API throttling in high-volume review scenarios.
|
|
54
|
-
- **Impact:** Frequent throttling could degrade CLI performance, leading to slower code reviews and poor user experience.
|
|
55
|
-
- **Recommendation:** Integrate a retry mechanism using p-retry library or custom logic, and add concurrency control based on OpenRouter's documented limits.
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
#### src/clients/openRouterClient.ts
|
|
60
|
-
##### [High] API key exposure risk in logging (lines 20-25)
|
|
61
|
-
- **Problem:** Constructor logs the full API key during initialization when debug mode is enabled, violating security best practices and risking credential leakage in logs.
|
|
62
|
-
- **Impact:** Potential credential compromise if logs are shared or stored insecurely, affecting all downstream AI review operations.
|
|
63
|
-
- **Recommendation:** Mask the API key in logs (e.g., show only last 4 chars) or avoid logging it entirely; use environment checks to suppress in production.
|
|
64
|
-
|
|
65
|
-
##### [High] Inadequate error handling in API requests (lines 45-60)
|
|
66
|
-
- **Problem:** API calls lack comprehensive try-catch blocks and specific error type checking, leading to unhandled promise rejections that could crash the client during network failures or invalid responses.
|
|
67
|
-
- **Impact:** Runtime crashes in production, poor user experience with silent failures in code review workflows.
|
|
68
|
-
- **Recommendation:** Wrap API calls in try-catch, classify errors using OpenRouter's error codes, and propagate typed errors via a custom Error subclass.
|
|
69
|
-
|
|
70
|
-
##### [Medium] No request timeout configuration (lines 70-80)
|
|
71
|
-
- **Problem:** HTTP requests via base/httpClient lack explicit timeouts, risking indefinite hangs on slow OpenRouter responses during high-load code reviews.
|
|
72
|
-
- **Impact:** Delayed or stalled review processes, especially in batch operations across multiple files.
|
|
73
|
-
- **Recommendation:** Set a 30s timeout in httpClient options and handle AbortError with retries using exponential backoff.
|
|
74
|
-
|
|
75
|
-
##### [Low] Unused import from promptLoader (lines 5)
|
|
76
|
-
- **Problem:** Import of loadPromptTemplate from src/clients/utils/promptLoader.ts is present but not used, indicating dead code or incomplete integration.
|
|
77
|
-
- **Impact:** Code bloat and potential confusion for maintainers reviewing client-prompt interactions.
|
|
78
|
-
- **Recommendation:** Remove unused import or implement prompt loading in the generate method for consistent template usage.
|
|
79
|
-
|
|
80
|
-
##### [Low] Inconsistent logging level usage (lines 100-110)
|
|
81
|
-
- **Problem:** Error logs use logger.error but success/info use console.log, diverging from centralized logger.ts and risking missed log file outputs.
|
|
82
|
-
- **Impact:** Fragmented observability, complicating debugging of client issues in production.
|
|
83
|
-
- **Recommendation:** Route all outputs through logger with appropriate levels (INFO for success, ERROR for failures) to ensure unified logging.
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
#### src/clients/utils/directoryStructure.ts
|
|
88
|
-
##### [Low] Untyped structure building with Record<string, any> (lines 10)
|
|
89
|
-
- **Problem:** Using Record<string, any> for the directory tree lacks type specificity, making it harder to enforce structure and catch errors during tree manipulation.
|
|
90
|
-
- **Impact:** Reduces code clarity and increases risk of subtle bugs in recursive operations, though unlikely to cause immediate failures in simple directory representations.
|
|
91
|
-
- **Recommendation:** Define a typed interface like type DirNode = Record<string, DirNode | null>; and use it for structure to improve intellisense and prevent invalid assignments.
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
#### src/clients/utils/promptFormatter.ts
|
|
96
|
-
##### [Medium] Missing implementation code for promptFormatter.ts (lines Entire file)
|
|
97
|
-
- **Problem:** The file is referenced as the primary focus but contains no provided code, preventing assessment of its functionality, integration with other utils, or cross-file consistency like prompt loading and formatting alignment.
|
|
98
|
-
- **Impact:** Blocks comprehensive review of the module's core functionality, risking undetected mismatches in prompt handling across bundled utils.
|
|
99
|
-
- **Recommendation:** Provide the full source code for review to evaluate prompt formatting logic, error handling, and compatibility with promptLoader.ts.
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
#### src/clients/utils/promptLoader.ts
|
|
104
|
-
##### [High] Unsafe type casting with 'as any' (lines 22)
|
|
105
|
-
- **Problem:** Casting language string to any in options assignment bypasses TypeScript checks, potentially leading to runtime errors if the string doesn't match expected ReviewOptions shape.
|
|
106
|
-
- **Impact:** Introduces type unsafety that could propagate invalid options to PromptManager, causing incorrect prompt templates or failures in multi-language reviews.
|
|
107
|
-
- **Recommendation:** Define a proper union type for languageOrOptions and avoid casting; parse the string safely or throw an error for invalid inputs.
|
|
108
|
-
|
|
109
|
-
##### [Medium] Hardcoded defaults may mismatch reviewType in promptLoader (lines 18-25)
|
|
110
|
-
- **Problem:** When languageOrOptions is a string, options.type is hardcoded to 'quick-fixes', which ignores the provided reviewType and could lead to inconsistent prompt selection.
|
|
111
|
-
- **Impact:** Results in mismatched prompts for different review types, degrading review quality and user experience in language-specific or varied review scenarios.
|
|
112
|
-
- **Recommendation:** Use the reviewType parameter to set options.type dynamically, e.g., options.type = reviewType; and make other defaults configurable or derived from context.
|
|
113
|
-
|
|
114
|
-
##### [Medium] Missing error propagation in loadPromptTemplate (lines 25-40)
|
|
115
|
-
- **Problem:** The function assumes PromptManager.getPromptTemplate always succeeds without handling cases where bundled prompts are missing, potentially returning empty strings that break review flows.
|
|
116
|
-
- **Impact:** Silent failures in AI client initialization, causing malformed prompts in file processing handlers and invalid code reviews.
|
|
117
|
-
- **Recommendation:** Wrap in try-catch and throw a descriptive error if template is empty or undefined, e.g., throw new Error(`Failed to load prompt for ${reviewType}`);
|
|
118
|
-
|
|
119
|
-
##### [Medium] Hardcoded options in promptLoader.ts (lines 30-35)
|
|
120
|
-
- **Problem:** Fallback options object uses hardcoded 'quick-fixes' type, ignoring actual reviewType and potentially mismatching prompts.
|
|
121
|
-
- **Impact:** Incorrect prompts loaded for non-quick-fix reviews, degrading AI code review accuracy.
|
|
122
|
-
- **Recommendation:** Derive type from reviewType: type: reviewType, and remove 'as any' for type safety.
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
|
-
#### src/clients/utils/tokenCounter.ts
|
|
127
|
-
##### [Medium] Incomplete pricing implementation in tokenCounter.ts (lines 45-65)
|
|
128
|
-
- **Problem:** Pricing interfaces (StandardPricing, TieredPricing) are defined but not utilized in any functions like getCostInfo, leaving cost estimation incomplete and docs mismatched with implementation.
|
|
129
|
-
- **Impact:** Prevents accurate cost estimation for API usage, leading to unreliable budgeting in code review workflows and potential over/underestimation of expenses.
|
|
130
|
-
- **Recommendation:** Implement cost calculation functions using these interfaces, e.g., a getPricingForModel function that returns the appropriate pricing object based on modelName.
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
#### src/core/handlers/FileProcessingHandler.ts
|
|
135
|
-
##### [Medium] No TypeScript types for handler integration (lines 1-100)
|
|
136
|
-
- **Problem:** Assuming standard handler structure, integration with utils like logger and projectDocs lacks explicit types for inputs/outputs, leading to potential runtime type mismatches in file processing chains.
|
|
137
|
-
- **Impact:** Type safety gaps in TS codebase, increasing bug risk when handlers interact with cross-file utilities like prompt loading.
|
|
138
|
-
- **Recommendation:** Define interfaces for processFile(input: ProcessInput): Promise<ProcessOutput> and ensure all utils calls are typed, e.g., import { ProjectDocs } from '../utils/projectDocs';
|
|
139
|
-
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
#### src/index.ts
|
|
143
|
-
##### [High] Missing context for src/index.ts integration (lines 1-753)
|
|
144
|
-
- **Problem:** Entry point lacks visible integration with utils like logger and projectDocs, risking unhandled errors in CLI setup with yargs.
|
|
145
|
-
- **Impact:** Unobserved failures during CLI invocation, especially in dev mode with ts-node.
|
|
146
|
-
- **Recommendation:** Explicitly import and initialize logger early, wrap yargs in try-catch with logError.
|
|
147
|
-
|
|
148
|
-
##### [Low] No React component boundaries defined (lines N/A)
|
|
149
|
-
- **Problem:** As a CLI with ink/React deps, index.ts should define clear memoization for any terminal UI components, but none visible.
|
|
150
|
-
- **Impact:** Potential re-renders in interactive CLI modes, though minor for non-UI heavy tool.
|
|
151
|
-
- **Recommendation:** If using ink components, wrap in React.memo and use useMemo for prop derivations.
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
#### src/runtime/manifest.ts
|
|
156
|
-
##### [Low] Deep merge in manifest.ts overwrites arrays without merging (lines 35-37)
|
|
157
|
-
- **Problem:** The deepMerge function treats arrays as primitives and overwrites them entirely, though current DEFAULT_MANIFEST has no arrays, future overrides could lose data.
|
|
158
|
-
- **Impact:** Potential data loss in custom manifests, affecting rule configurations loaded in reviewPipeline.ts.
|
|
159
|
-
- **Recommendation:** Add array handling: if Array.isArray, use concatenation or deep merge for arrays if needed, e.g., result[key] = [...(result[key] || []), ...(overrideObj[key] || [])];
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
#### src/runtime/openrouterProxy.ts
|
|
164
|
-
##### [Low] Incomplete error handling in buildOpenRouterProxyHeaders (lines 15-20)
|
|
165
|
-
- **Problem:** Throws a generic Error without integrating with custom errors.ts, and assumes 'dist/index.js' path which may not match built artifacts.
|
|
166
|
-
- **Impact:** Inconsistent error surfacing in CLI, confusing users during auth setup in cliEntry.ts.
|
|
167
|
-
- **Recommendation:** Use MissingCrIgnoreError pattern from errors.ts or create ProxyAuthError; update path to match actual CLI entry like 'node dist/cliEntry.js'.
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
#### src/runtime/proxyEnvironment.ts
|
|
172
|
-
##### [High] Syntax error in getActiveProxySettings function (lines last line)
|
|
173
|
-
- **Problem:** The return statement is truncated to 'return cachedSettin', preventing compilation and runtime execution of proxy settings retrieval.
|
|
174
|
-
- **Impact:** Breaks proxy environment initialization, halting CLI operations that depend on active settings.
|
|
175
|
-
- **Recommendation:** Complete the statement to 'return cachedSettings;' to properly return the cached proxy settings.
|
|
176
|
-
|
|
177
|
-
##### [Medium] Missing import and definition for loadProxySettings (lines 3-4)
|
|
178
|
-
- **Problem:** Imports loadProxySettings from './proxyConfig' which is not provided in context, leading to unresolved dependencies and potential runtime failures in ensureProxyEnvironmentInitialized.
|
|
179
|
-
- **Impact:** Config drift if proxy settings fail to load, affecting all downstream proxy usage in CLI entry and review pipeline.
|
|
180
|
-
- **Recommendation:** Ensure './proxyConfig' is included in the bundle or provide fallback; add error handling if load fails.
|
|
181
|
-
|
|
182
|
-
##### [Medium] Hardcoded domain check in proxySuppliesApiKey (lines 6-11)
|
|
183
|
-
- **Problem:** Relies on URL containing 'cr.ai.enki.si' to determine if proxy supplies API key, which is brittle and doesn't account for custom proxy deployments.
|
|
184
|
-
- **Impact:** Breaks functionality for alternative proxy hosts, causing API key mismatches in reviewPipeline and runAiCodeReview.
|
|
185
|
-
- **Recommendation:** Make the domain configurable via runtime config or env var, e.g., process.env.CR_AIA_PROXY_DOMAIN || 'cr.ai.enki.si'.
|
|
186
|
-
|
|
187
|
-
##### [Medium] Missing context for auth/session module (lines 45)
|
|
188
|
-
- **Problem:** Calls getSessionToken() from './auth/session' which is not provided, preventing full assessment of session token fallback in ensureSessionToken.
|
|
189
|
-
- **Impact:** Uncertain auth flow reliability, risking unauthorized proxy requests in runAiCodeReview.ts.
|
|
190
|
-
- **Recommendation:** Include './auth/session' in context or mock for review; ensure token retrieval handles errors gracefully.
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
#### src/runtime/ui/inkModules.ts
|
|
195
|
-
##### [High] Missing error handling in dynamic importer (lines 8-12)
|
|
196
|
-
- **Problem:** dynamicImporter uses new Function() without specifier validation, vulnerable to prototype pollution if specifier is controlled.
|
|
197
|
-
- **Impact:** Potential code injection if inkModules.ts is misused in user-controlled paths.
|
|
198
|
-
- **Recommendation:** Use standard dynamic import() directly in load functions with specifier allowlist.
|
|
199
|
-
|
|
200
|
-
##### [Medium] Ink module types not exported for consumer use (lines 1-10)
|
|
201
|
-
- **Problem:** Type definitions for InkModule etc. are internal; RuntimeApp cannot safely type imports without duplication.
|
|
202
|
-
- **Impact:** Type errors or weak typing in RuntimeApp, increasing refactor risks.
|
|
203
|
-
- **Recommendation:** Export types and consider a typed facade for getInk() returns.
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
#### src/runtime/ui/Layout.tsx
|
|
208
|
-
##### [Medium] LayoutProvider resize handler lacks debouncing (lines 28-38)
|
|
209
|
-
- **Problem:** useEffect in LayoutProvider attaches resize listener without throttling, causing excessive state updates on rapid terminal resizes.
|
|
210
|
-
- **Impact:** High CPU usage during window resizing, degrading CLI responsiveness.
|
|
211
|
-
- **Recommendation:** Implement debounce on handleResize using a utility like lodash.debounce or a custom timer.
|
|
212
|
-
|
|
213
|
-
---
|
|
214
|
-
|
|
215
|
-
#### src/runtime/ui/RuntimeApp.tsx
|
|
216
|
-
##### [Critical] Missing context for RuntimeApp implementation (lines Entire file)
|
|
217
|
-
- **Problem:** Full source code for RuntimeApp.tsx not provided, preventing complete assessment of component contracts and side effects.
|
|
218
|
-
- **Impact:** Incomplete review risks overlooking critical bugs.
|
|
219
|
-
- **Recommendation:** Provide complete file content for thorough review.
|
|
220
|
-
|
|
221
|
-
##### [High] Dynamic module loading not awaited in app entry (lines Assumed entry render (e.g., 10-20))
|
|
222
|
-
- **Problem:** RuntimeApp likely renders without awaiting preloadInkModules(), leading to runtime errors when accessing unloaded Ink components like TextInput.
|
|
223
|
-
- **Impact:** Crashes on first render in production, affecting all users.
|
|
224
|
-
- **Recommendation:** Wrap app render in async function and await preloadInkModules() before <Render /> from Ink.
|
|
225
|
-
|
|
226
|
-
##### [Medium] Project docs not integrated into app context (lines Assumed init (e.g., 1-10))
|
|
227
|
-
- **Problem:** RuntimeApp does not consume readProjectDocs for contextual rendering, missing opportunities for doc-driven UI.
|
|
228
|
-
- **Impact:** Static UI ignores project state, reducing review tool effectiveness.
|
|
229
|
-
- **Recommendation:** Load docs in app init and pass via context for dynamic content like progress indicators.
|
|
230
|
-
|
|
231
|
-
##### [Low] Logger integration absent in UI components (lines Assumed error boundaries (e.g., 50-60))
|
|
232
|
-
- **Problem:** No evidence of logger usage for UI errors, relying on console which bypasses log level controls.
|
|
233
|
-
- **Impact:** Inconsistent debugging output, harder to trace production issues.
|
|
234
|
-
- **Recommendation:** Import and use logger from src/utils/logger.ts in catch blocks and warnings.
|
|
235
|
-
|
|
236
|
-
##### [Low] No reduced-motion support in Ink animations (lines Assumed spinner usage (e.g., 30-40))
|
|
237
|
-
- **Problem:** Spinner from ink-spinner lacks checks for prefers-reduced-motion, ignoring user accessibility prefs.
|
|
238
|
-
- **Impact:** Poor UX for motion-sensitive users in terminal environments.
|
|
239
|
-
- **Recommendation:** Detect via process.env or mock media query and fallback to static text.
|
|
240
|
-
|
|
241
|
-
---
|
|
242
|
-
|
|
243
|
-
#### src/runtime/ui/screens/AuthScreen.tsx
|
|
244
|
-
##### [High] Missing dependency in useCallback for handleSubmit (lines 25-40)
|
|
245
|
-
- **Problem:** handleSubmit useCallback misses 'setSubmitting' and 'setError' in dependencies, causing stale closures and incorrect submitting state during auth flows that precede ProgressScreen.
|
|
246
|
-
- **Impact:** Auth failures may not reset UI states properly, blocking navigation to ModeSelection and subsequent screens.
|
|
247
|
-
- **Recommendation:** Add setSubmitting and setError to deps or refactor to use useEffect for side effects.
|
|
248
|
-
|
|
249
|
-
##### [High] No error boundary for async auth (lines 30-35)
|
|
250
|
-
- **Problem:** authenticate call lacks try-catch for network errors beyond generic message, and no fallback UI, potentially crashing the entire CLI session before reaching ProgressScreen.
|
|
251
|
-
- **Impact:** User session loss on transient errors, requiring full restart.
|
|
252
|
-
- **Recommendation:** Wrap in ErrorBoundary component or add comprehensive catch: catch (err) { logger.error('Auth network error', err); setError('Network issue, retry?'); }
|
|
253
|
-
|
|
254
|
-
##### [Medium] Missing TypeScript types for Ink components (lines 8-10)
|
|
255
|
-
- **Problem:** getInk, getInkSpinner, getInkTextInput return untyped components; without explicit types, IDE support and runtime safety are compromised in auth flows shared with other screens.
|
|
256
|
-
- **Impact:** Increases refactoring risk when updating Ink versions, affecting all screens including ProgressScreen.
|
|
257
|
-
- **Recommendation:** Define interfaces: interface InkComponents { Box: FC; ... } and type the getters accordingly.
|
|
258
|
-
|
|
259
|
-
---
|
|
260
|
-
|
|
261
|
-
#### src/runtime/ui/screens/ModeSelection.tsx
|
|
262
|
-
##### [Medium] Uncontrolled input handling without validation (lines 45-55)
|
|
263
|
-
- **Problem:** submitUrl callback checks phase but lacks URL validation (e.g., format check), and resetUrlState is called without ensuring prior cleanup, risking state drift across mode selections leading into ProgressScreen.
|
|
264
|
-
- **Impact:** Invalid URLs passed to preprod mode cause review pipeline failures, affecting ResultsScreen output.
|
|
265
|
-
- **Recommendation:** Add URL regex validation: if (!urlValue.match(/^https?:\/\//)) { setUrlError('Invalid URL'); return; } and include onSelect in deps.
|
|
266
|
-
|
|
267
|
-
##### [Low] Hardcoded options without i18n support (lines 15-25)
|
|
268
|
-
- **Problem:** OPTIONS array uses static English strings despite i18next dependency in package.json, missing localization that could extend to ResultsScreen outputs.
|
|
269
|
-
- **Impact:** Limits internationalization efforts, minor for English-only CLI but scales poorly.
|
|
270
|
-
- **Recommendation:** Integrate i18n: import { useTranslation } from 'react-i18next'; const { t } = useTranslation(); label: t('mode.uncommitted.label'),
|
|
271
|
-
|
|
272
|
-
---
|
|
273
|
-
|
|
274
|
-
#### src/types/review.ts
|
|
275
|
-
##### [High] Missing Zod schemas for runtime validation of review types (lines 120-150)
|
|
276
|
-
- **Problem:** ReviewInput and ReviewOutput types are purely structural without corresponding Zod parsers, allowing invalid data to propagate through logger and client modules.
|
|
277
|
-
- **Impact:** Introduces data loss or crashes in async handling within src/clients/base/index.ts during response processing.
|
|
278
|
-
- **Recommendation:** Add Zod schema: import { z } from 'zod'; export const ReviewInputSchema = z.object({ code: z.string().min(1), context: z.string().optional(), }); export type ReviewInput = z.infer<typeof ReviewInputSchema>;
|
|
279
|
-
|
|
280
|
-
##### [Medium] Incomplete ReviewResult interface lacks required fields from common.ts (lines 45-60)
|
|
281
|
-
- **Problem:** The ReviewResult interface references OutputFormat and ProgrammingLanguage but does not enforce their presence in nested structures, leading to potential runtime errors when serializing to JSON or Markdown.
|
|
282
|
-
- **Impact:** Breaks type safety in downstream consumers like src/utils/projectDocs.ts when processing docs without explicit checks.
|
|
283
|
-
- **Recommendation:** Make language and format required props with defaults: interface ReviewResult { language: ProgrammingLanguage; format: OutputFormat; issues: Issue[]; }
|
|
284
|
-
|
|
285
|
-
##### [Low] Undocumented union type for IssuePriority drifts from PriorityFilter in common.ts (lines 200-210)
|
|
286
|
-
- **Problem:** IssuePriority uses 'high'|'medium'|'low' strings instead of aligning with PriorityFilter enum values ('h'|'m'|'l'), causing config drift and inconsistent filtering in interactive modes.
|
|
287
|
-
- **Impact:** Leads to mismatches in UI rendering with ink-select-input, affecting user experience in priority-based reviews.
|
|
288
|
-
- **Recommendation:** Align with common: export type IssuePriority = PriorityFilter;
|
|
289
|
-
|
|
290
|
-
##### [Low] No support for reduced-motion in review visualization types (lines 300-320)
|
|
291
|
-
- **Problem:** VisualizationConfig omits prefers-reduced-motion flag, ignoring accessibility best practices for terminal-based reviews using ink-spinner.
|
|
292
|
-
- **Impact:** Excludes users with motion sensitivities, violating ARIA-equivalent guidelines for CLI tools.
|
|
293
|
-
- **Recommendation:** Extend interface: interface VisualizationConfig { spinner: boolean; colors: boolean; reducedMotion: boolean; }
|
|
294
|
-
|
|
295
|
-
---
|
|
296
|
-
|
|
297
|
-
#### src/utils/logger.ts
|
|
298
|
-
##### [High] Incomplete implementation in logger.ts (lines 45-50)
|
|
299
|
-
- **Problem:** The getCurrentLogLevel function is truncated and lacks completion of environment variable parsing and default fallback, leading to potential undefined log level behavior.
|
|
300
|
-
- **Impact:** Runtime errors or silent failures in logging, affecting debugging across the CLI.
|
|
301
|
-
- **Recommendation:** Complete the function with proper env parsing: const envLevel = process.env.AI_CODE_REVIEW_LOG_LEVEL?.toLowerCase(); return LOG_LEVEL_MAP[envLevel] ?? LogLevel.INFO;
|
|
302
|
-
|
|
303
|
-
##### [Medium] Uninitialized logFileStream without cleanup (lines 30-35)
|
|
304
|
-
- **Problem:** logFileStream is declared but never properly initialized or closed, risking file descriptor leaks in long-running CLI processes like file handling.
|
|
305
|
-
- **Impact:** Resource leaks in production runs, especially when processing multiple files in handlers, leading to file system exhaustion.
|
|
306
|
-
- **Recommendation:** Implement initialization in a setup function with process.on('exit') or similar for stream.close(), and use it only when file logging is enabled via env var.
|
|
307
|
-
|
|
308
|
-
##### [Low] Log level initialization circularity risk (lines 45-60)
|
|
309
|
-
- **Problem:** getCurrentLogLevel checks process.argv repeatedly without memoization, and isInitializing flag may not cover all import paths, leading to redundant console output during screen renders.
|
|
310
|
-
- **Impact:** Minor performance hit in high-frequency logging during long-running ProgressScreen updates.
|
|
311
|
-
- **Recommendation:** Memoize log level once at module load: export const currentLogLevel = getCurrentLogLevel(); and remove repeated checks.
|
|
312
|
-
|
|
313
|
-
##### [Low] Hardcoded log level fallback without validation (lines 50-60)
|
|
314
|
-
- **Problem:** getCurrentLogLevel lacks validation for invalid env var values, defaulting silently which could mask configuration issues in handler logging.
|
|
315
|
-
- **Impact:** Inconsistent logging behavior across environments, complicating debugging of file processing errors.
|
|
316
|
-
- **Recommendation:** Add a default to LogLevel.INFO if env var is invalid: const level = LOG_LEVEL_MAP[process.env.AI_CODE_REVIEW_LOG_LEVEL?.toLowerCase()] ?? LogLevel.INFO;
|
|
317
|
-
|
|
318
|
-
---
|
|
319
|
-
|
|
320
|
-
#### src/utils/projectDocs.ts
|
|
321
|
-
##### [Critical] Syntax error in projectDocs.ts (lines 60)
|
|
322
|
-
- **Problem:** Truncated assignment 'docs.readme = awa' is invalid syntax, preventing module compilation.
|
|
323
|
-
- **Impact:** Build failure, blocking CLI startup and project doc loading essential for AI reviews.
|
|
324
|
-
- **Recommendation:** Fix to: docs.readme = await readDocFile(path.join(projectDir, 'README.md'));
|
|
325
|
-
|
|
326
|
-
##### [High] Incomplete async function in readProjectDocs (lines 45-50)
|
|
327
|
-
- **Problem:** The readProjectDocs function has a truncated assignment 'docs.readme = awa' which appears to be incomplete, likely intended as 'await readDocFile(path.join(projectDir, 'README.md'))', causing runtime errors when accessing project docs.
|
|
328
|
-
- **Impact:** Breaks project documentation loading, leading to missing context for AI code reviews and potential crashes in handlers relying on this utility.
|
|
329
|
-
- **Recommendation:** Complete the line to: docs.readme = await readDocFile(path.join(projectDir, 'README.md')); and ensure all doc reads are awaited similarly for contributing, architecture, etc.
|
|
330
|
-
|
|
331
|
-
##### [Medium] Missing import for logger in projectDocs.ts (lines 5-6)
|
|
332
|
-
- **Problem:** Logger is used but import path './logger' may not resolve if directory structure changes; no type safety shown.
|
|
333
|
-
- **Impact:** Import resolution issues in bundled dist, causing runtime errors in doc processing.
|
|
334
|
-
- **Recommendation:** Use absolute import or ensure consistent path aliasing in tsconfig.json.
|
|
335
|
-
|
|
336
|
-
##### [Medium] Incomplete async handling in project docs reading (lines 85)
|
|
337
|
-
- **Problem:** The line 'docs.readme = awa' is truncated and incomplete, likely intended as 'await readDocFile(path.join(projectDir, 'README.md'))', causing runtime errors during doc loading that could affect screen initialization.
|
|
338
|
-
- **Impact:** Breaks project context loading, leading to incomplete AI reviews in ProgressScreen and ResultsScreen.
|
|
339
|
-
- **Recommendation:** Complete the assignment: docs.readme = await readDocFile(path.join(projectDir, 'README.md')); and apply similarly for other docs.
|
|
340
|
-
|
|
341
|
-
---
|
|
342
|
-
|
|
343
|
-
#### Unspecified file
|
|
344
|
-
##### [Medium] Missing TypeScript types for response payloads
|
|
345
|
-
- **Problem:** Response processing assumes 'any' type for OpenRouter payloads, leading to runtime type errors and IDE warnings; no integration with Zod for validation as per project deps.
|
|
346
|
-
- **Impact:** Type safety gaps increase bug risk in prompt handling and data flow to review components.
|
|
347
|
-
- **Recommendation:** Define interfaces for ChatCompletionResponse and validate with Zod schema on receipt; extend from base/responseProcessor.ts types.
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
---
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
_Generated by cr-aia_
|