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
|
@@ -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;;;;;;;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,0BAAU,EAAC,UAAU,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,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,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"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview API error handling utilities.
|
|
3
|
+
*
|
|
4
|
+
* This module provides standardized error handling for API calls,
|
|
5
|
+
* including custom error classes for different types of API errors,
|
|
6
|
+
* utility functions for handling fetch responses, and logging helpers.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Base class for API errors
|
|
10
|
+
*
|
|
11
|
+
* This class extends the standard Error class to provide additional context
|
|
12
|
+
* for API-related errors. It includes properties for the HTTP status code
|
|
13
|
+
* and additional error details from the API response.
|
|
14
|
+
*
|
|
15
|
+
* All specific API error types (like AuthenticationError, RateLimitError, etc.)
|
|
16
|
+
* extend this base class to provide a consistent error handling interface.
|
|
17
|
+
*/
|
|
18
|
+
export declare class ApiError extends Error {
|
|
19
|
+
statusCode?: number | undefined;
|
|
20
|
+
details?: unknown | undefined;
|
|
21
|
+
constructor(message: string, statusCode?: number | undefined, details?: unknown | undefined);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Error thrown when API rate limits are exceeded
|
|
25
|
+
*/
|
|
26
|
+
export declare class RateLimitError extends ApiError {
|
|
27
|
+
retryAfter?: number | undefined;
|
|
28
|
+
constructor(message: string, retryAfter?: number | undefined, statusCode?: number, details?: unknown);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Error thrown when authentication fails
|
|
32
|
+
*/
|
|
33
|
+
export declare class AuthenticationError extends ApiError {
|
|
34
|
+
constructor(message: string, statusCode?: number, details?: unknown);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Error thrown when a resource is not found
|
|
38
|
+
*/
|
|
39
|
+
export declare class NotFoundError extends ApiError {
|
|
40
|
+
constructor(message: string, statusCode?: number, details?: unknown);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Error thrown when the API returns an invalid response format
|
|
44
|
+
*/
|
|
45
|
+
export declare class InvalidResponseError extends ApiError {
|
|
46
|
+
constructor(message: string, statusCode?: number, details?: unknown);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Error thrown when token limit is exceeded
|
|
50
|
+
*/
|
|
51
|
+
export declare class TokenLimitError extends ApiError {
|
|
52
|
+
tokenCount?: number | undefined;
|
|
53
|
+
tokenLimit?: number | undefined;
|
|
54
|
+
constructor(message: string, tokenCount?: number | undefined, tokenLimit?: number | undefined, statusCode?: number, details?: unknown);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Handle a fetch response and throw appropriate errors if needed
|
|
58
|
+
*
|
|
59
|
+
* This function processes a fetch response and throws appropriate error types
|
|
60
|
+
* based on the HTTP status code and response body. It handles common API error
|
|
61
|
+
* scenarios like authentication failures, rate limiting, and resource not found.
|
|
62
|
+
*
|
|
63
|
+
* The function attempts to parse the response body as JSON if possible, or falls
|
|
64
|
+
* back to text if not. It then constructs an appropriate error object with
|
|
65
|
+
* detailed information about what went wrong.
|
|
66
|
+
*
|
|
67
|
+
* @param response The fetch response object from an API call
|
|
68
|
+
* @param apiName The name of the API being called (for logging and error messages)
|
|
69
|
+
* @returns The original response object if the response is ok (status 200-299)
|
|
70
|
+
* @throws AuthenticationError for 401/403 status codes (authentication/authorization issues)
|
|
71
|
+
* @throws NotFoundError for 404 status codes (resource not found)
|
|
72
|
+
* @throws RateLimitError for 429 status codes (rate limit exceeded)
|
|
73
|
+
* @throws ApiError for all other error status codes
|
|
74
|
+
* @example
|
|
75
|
+
* try {
|
|
76
|
+
* const response = await fetch('https://api.example.com/data');
|
|
77
|
+
* await handleFetchResponse(response, 'ExampleAPI');
|
|
78
|
+
* // Process successful response
|
|
79
|
+
* } catch (error) {
|
|
80
|
+
* // Error is already logged and has the appropriate type
|
|
81
|
+
* if (error instanceof RateLimitError) {
|
|
82
|
+
* // Handle rate limiting specifically
|
|
83
|
+
* }
|
|
84
|
+
* }
|
|
85
|
+
*/
|
|
86
|
+
export declare function handleFetchResponse(response: Response, apiName: string): Promise<Response>;
|
|
87
|
+
/**
|
|
88
|
+
* Safely parse JSON from a response
|
|
89
|
+
* @param response The fetch response object
|
|
90
|
+
* @param apiName The name of the API being called (for logging)
|
|
91
|
+
* @returns The parsed JSON data
|
|
92
|
+
* @throws InvalidResponseError if the response cannot be parsed as JSON
|
|
93
|
+
*/
|
|
94
|
+
export declare function safeJsonParse<T>(response: Response | any, apiName: string): Promise<T>;
|
|
95
|
+
/**
|
|
96
|
+
* Log an API error with appropriate context and formatting
|
|
97
|
+
*
|
|
98
|
+
* This function logs API errors with rich context information to help with debugging
|
|
99
|
+
* and troubleshooting. It detects the specific type of error and formats the log
|
|
100
|
+
* message accordingly, providing different information based on the error type.
|
|
101
|
+
*
|
|
102
|
+
* The function handles various error types including:
|
|
103
|
+
* - Rate limit errors (with retry information)
|
|
104
|
+
* - Authentication errors
|
|
105
|
+
* - Resource not found errors
|
|
106
|
+
* - Invalid response errors
|
|
107
|
+
* - General API errors
|
|
108
|
+
* - Unexpected errors
|
|
109
|
+
*
|
|
110
|
+
* @param error The error object that was thrown
|
|
111
|
+
* @param context Object containing context information:
|
|
112
|
+
* - apiName: The name of the API service (e.g., 'OpenAI', 'Anthropic')
|
|
113
|
+
* - operation: The operation being performed (e.g., 'generating review')
|
|
114
|
+
* - url: Optional URL for the request that failed
|
|
115
|
+
* @example
|
|
116
|
+
* try {
|
|
117
|
+
* // API call that might fail
|
|
118
|
+
* } catch (error) {
|
|
119
|
+
* logApiError(error, {
|
|
120
|
+
* apiName: 'OpenAI',
|
|
121
|
+
* operation: 'generating code review',
|
|
122
|
+
* url: 'https://api.openai.com/v1/chat/completions'
|
|
123
|
+
* });
|
|
124
|
+
* }
|
|
125
|
+
*/
|
|
126
|
+
export declare function logApiError(error: unknown, context: {
|
|
127
|
+
operation: string;
|
|
128
|
+
url?: string;
|
|
129
|
+
apiName: string;
|
|
130
|
+
}): void;
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview API error handling utilities.
|
|
4
|
+
*
|
|
5
|
+
* This module provides standardized error handling for API calls,
|
|
6
|
+
* including custom error classes for different types of API errors,
|
|
7
|
+
* utility functions for handling fetch responses, and logging helpers.
|
|
8
|
+
*/
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.TokenLimitError = exports.InvalidResponseError = exports.NotFoundError = exports.AuthenticationError = exports.RateLimitError = exports.ApiError = void 0;
|
|
14
|
+
exports.handleFetchResponse = handleFetchResponse;
|
|
15
|
+
exports.safeJsonParse = safeJsonParse;
|
|
16
|
+
exports.logApiError = logApiError;
|
|
17
|
+
const logger_1 = __importDefault(require("./logger"));
|
|
18
|
+
/**
|
|
19
|
+
* Base class for API errors
|
|
20
|
+
*
|
|
21
|
+
* This class extends the standard Error class to provide additional context
|
|
22
|
+
* for API-related errors. It includes properties for the HTTP status code
|
|
23
|
+
* and additional error details from the API response.
|
|
24
|
+
*
|
|
25
|
+
* All specific API error types (like AuthenticationError, RateLimitError, etc.)
|
|
26
|
+
* extend this base class to provide a consistent error handling interface.
|
|
27
|
+
*/
|
|
28
|
+
class ApiError extends Error {
|
|
29
|
+
statusCode;
|
|
30
|
+
details;
|
|
31
|
+
constructor(message, statusCode, details) {
|
|
32
|
+
super(message);
|
|
33
|
+
this.statusCode = statusCode;
|
|
34
|
+
this.details = details;
|
|
35
|
+
this.name = 'ApiError';
|
|
36
|
+
// Ensure instanceof works correctly in ES5
|
|
37
|
+
Object.setPrototypeOf(this, ApiError.prototype);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.ApiError = ApiError;
|
|
41
|
+
/**
|
|
42
|
+
* Error thrown when API rate limits are exceeded
|
|
43
|
+
*/
|
|
44
|
+
class RateLimitError extends ApiError {
|
|
45
|
+
retryAfter;
|
|
46
|
+
constructor(message, retryAfter, statusCode, details) {
|
|
47
|
+
super(message, statusCode, details);
|
|
48
|
+
this.retryAfter = retryAfter;
|
|
49
|
+
this.name = 'RateLimitError';
|
|
50
|
+
// Ensure instanceof works correctly in ES5
|
|
51
|
+
Object.setPrototypeOf(this, RateLimitError.prototype);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.RateLimitError = RateLimitError;
|
|
55
|
+
/**
|
|
56
|
+
* Error thrown when authentication fails
|
|
57
|
+
*/
|
|
58
|
+
class AuthenticationError extends ApiError {
|
|
59
|
+
constructor(message, statusCode, details) {
|
|
60
|
+
super(message, statusCode, details);
|
|
61
|
+
this.name = 'AuthenticationError';
|
|
62
|
+
// Ensure instanceof works correctly in ES5
|
|
63
|
+
Object.setPrototypeOf(this, AuthenticationError.prototype);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.AuthenticationError = AuthenticationError;
|
|
67
|
+
/**
|
|
68
|
+
* Error thrown when a resource is not found
|
|
69
|
+
*/
|
|
70
|
+
class NotFoundError extends ApiError {
|
|
71
|
+
constructor(message, statusCode, details) {
|
|
72
|
+
super(message, statusCode, details);
|
|
73
|
+
this.name = 'NotFoundError';
|
|
74
|
+
// Ensure instanceof works correctly in ES5
|
|
75
|
+
Object.setPrototypeOf(this, NotFoundError.prototype);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.NotFoundError = NotFoundError;
|
|
79
|
+
/**
|
|
80
|
+
* Error thrown when the API returns an invalid response format
|
|
81
|
+
*/
|
|
82
|
+
class InvalidResponseError extends ApiError {
|
|
83
|
+
constructor(message, statusCode, details) {
|
|
84
|
+
super(message, statusCode, details);
|
|
85
|
+
this.name = 'InvalidResponseError';
|
|
86
|
+
// Ensure instanceof works correctly in ES5
|
|
87
|
+
Object.setPrototypeOf(this, InvalidResponseError.prototype);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.InvalidResponseError = InvalidResponseError;
|
|
91
|
+
/**
|
|
92
|
+
* Error thrown when token limit is exceeded
|
|
93
|
+
*/
|
|
94
|
+
class TokenLimitError extends ApiError {
|
|
95
|
+
tokenCount;
|
|
96
|
+
tokenLimit;
|
|
97
|
+
constructor(message, tokenCount, tokenLimit, statusCode, details) {
|
|
98
|
+
super(message, statusCode, details);
|
|
99
|
+
this.tokenCount = tokenCount;
|
|
100
|
+
this.tokenLimit = tokenLimit;
|
|
101
|
+
this.name = 'TokenLimitError';
|
|
102
|
+
// Ensure instanceof works correctly in ES5
|
|
103
|
+
Object.setPrototypeOf(this, TokenLimitError.prototype);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.TokenLimitError = TokenLimitError;
|
|
107
|
+
/**
|
|
108
|
+
* Handle a fetch response and throw appropriate errors if needed
|
|
109
|
+
*
|
|
110
|
+
* This function processes a fetch response and throws appropriate error types
|
|
111
|
+
* based on the HTTP status code and response body. It handles common API error
|
|
112
|
+
* scenarios like authentication failures, rate limiting, and resource not found.
|
|
113
|
+
*
|
|
114
|
+
* The function attempts to parse the response body as JSON if possible, or falls
|
|
115
|
+
* back to text if not. It then constructs an appropriate error object with
|
|
116
|
+
* detailed information about what went wrong.
|
|
117
|
+
*
|
|
118
|
+
* @param response The fetch response object from an API call
|
|
119
|
+
* @param apiName The name of the API being called (for logging and error messages)
|
|
120
|
+
* @returns The original response object if the response is ok (status 200-299)
|
|
121
|
+
* @throws AuthenticationError for 401/403 status codes (authentication/authorization issues)
|
|
122
|
+
* @throws NotFoundError for 404 status codes (resource not found)
|
|
123
|
+
* @throws RateLimitError for 429 status codes (rate limit exceeded)
|
|
124
|
+
* @throws ApiError for all other error status codes
|
|
125
|
+
* @example
|
|
126
|
+
* try {
|
|
127
|
+
* const response = await fetch('https://api.example.com/data');
|
|
128
|
+
* await handleFetchResponse(response, 'ExampleAPI');
|
|
129
|
+
* // Process successful response
|
|
130
|
+
* } catch (error) {
|
|
131
|
+
* // Error is already logged and has the appropriate type
|
|
132
|
+
* if (error instanceof RateLimitError) {
|
|
133
|
+
* // Handle rate limiting specifically
|
|
134
|
+
* }
|
|
135
|
+
* }
|
|
136
|
+
*/
|
|
137
|
+
async function handleFetchResponse(response, apiName) {
|
|
138
|
+
if (!response.ok) {
|
|
139
|
+
// Try to get the error body
|
|
140
|
+
let errorBody = 'Unknown error';
|
|
141
|
+
try {
|
|
142
|
+
// Clone the response so we can read it multiple times if needed
|
|
143
|
+
// const clonedResponse = response.clone();
|
|
144
|
+
// Log all headers for debugging
|
|
145
|
+
console.log(`[DEBUG] ${apiName} API response headers:`);
|
|
146
|
+
response.headers.forEach((value, name) => {
|
|
147
|
+
console.log(`[DEBUG] ${name}: ${value}`);
|
|
148
|
+
});
|
|
149
|
+
// Try to parse as JSON first
|
|
150
|
+
const contentType = response.headers.get('content-type');
|
|
151
|
+
console.log(`[DEBUG] Content-Type: ${contentType}`);
|
|
152
|
+
if (contentType?.includes('application/json')) {
|
|
153
|
+
errorBody = await response.json();
|
|
154
|
+
console.log(`[DEBUG] JSON error body: ${JSON.stringify(errorBody)}`);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
errorBody = await response.text();
|
|
158
|
+
console.log(`[DEBUG] Text error body: ${errorBody}`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
catch (e) {
|
|
162
|
+
// Log body read errors
|
|
163
|
+
console.log(`[DEBUG] Failed to read error body: ${e instanceof Error ? e.message : String(e)}`);
|
|
164
|
+
logger_1.default.debug(`Failed to read error body: ${e instanceof Error ? e.message : String(e)}`);
|
|
165
|
+
}
|
|
166
|
+
// Create appropriate error based on status code
|
|
167
|
+
const errorMessage = `${apiName} API error! Status: ${response.status}, Response: ${typeof errorBody === 'string' ? errorBody : JSON.stringify(errorBody)}`;
|
|
168
|
+
// Log the error
|
|
169
|
+
logger_1.default.error(errorMessage);
|
|
170
|
+
// Throw appropriate error based on status code
|
|
171
|
+
if (response.status === 401 || response.status === 403) {
|
|
172
|
+
throw new AuthenticationError(errorMessage, response.status, errorBody);
|
|
173
|
+
}
|
|
174
|
+
if (response.status === 404) {
|
|
175
|
+
throw new NotFoundError(errorMessage, response.status, errorBody);
|
|
176
|
+
}
|
|
177
|
+
if (response.status === 429) {
|
|
178
|
+
// Check for retry-after header
|
|
179
|
+
const retryAfter = response.headers.get('retry-after');
|
|
180
|
+
const retryAfterSeconds = retryAfter ? parseInt(retryAfter, 10) : undefined;
|
|
181
|
+
throw new RateLimitError(errorMessage, retryAfterSeconds, response.status, errorBody);
|
|
182
|
+
}
|
|
183
|
+
throw new ApiError(errorMessage, response.status, errorBody);
|
|
184
|
+
}
|
|
185
|
+
return response;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Safely parse JSON from a response
|
|
189
|
+
* @param response The fetch response object
|
|
190
|
+
* @param apiName The name of the API being called (for logging)
|
|
191
|
+
* @returns The parsed JSON data
|
|
192
|
+
* @throws InvalidResponseError if the response cannot be parsed as JSON
|
|
193
|
+
*/
|
|
194
|
+
async function safeJsonParse(response, apiName) {
|
|
195
|
+
try {
|
|
196
|
+
return (await response.json());
|
|
197
|
+
}
|
|
198
|
+
catch (error) {
|
|
199
|
+
const errorMessage = `Failed to parse ${apiName} API response as JSON: ${error instanceof Error ? error.message : String(error)}`;
|
|
200
|
+
logger_1.default.error(errorMessage);
|
|
201
|
+
throw new InvalidResponseError(errorMessage);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Log an API error with appropriate context and formatting
|
|
206
|
+
*
|
|
207
|
+
* This function logs API errors with rich context information to help with debugging
|
|
208
|
+
* and troubleshooting. It detects the specific type of error and formats the log
|
|
209
|
+
* message accordingly, providing different information based on the error type.
|
|
210
|
+
*
|
|
211
|
+
* The function handles various error types including:
|
|
212
|
+
* - Rate limit errors (with retry information)
|
|
213
|
+
* - Authentication errors
|
|
214
|
+
* - Resource not found errors
|
|
215
|
+
* - Invalid response errors
|
|
216
|
+
* - General API errors
|
|
217
|
+
* - Unexpected errors
|
|
218
|
+
*
|
|
219
|
+
* @param error The error object that was thrown
|
|
220
|
+
* @param context Object containing context information:
|
|
221
|
+
* - apiName: The name of the API service (e.g., 'OpenAI', 'Anthropic')
|
|
222
|
+
* - operation: The operation being performed (e.g., 'generating review')
|
|
223
|
+
* - url: Optional URL for the request that failed
|
|
224
|
+
* @example
|
|
225
|
+
* try {
|
|
226
|
+
* // API call that might fail
|
|
227
|
+
* } catch (error) {
|
|
228
|
+
* logApiError(error, {
|
|
229
|
+
* apiName: 'OpenAI',
|
|
230
|
+
* operation: 'generating code review',
|
|
231
|
+
* url: 'https://api.openai.com/v1/chat/completions'
|
|
232
|
+
* });
|
|
233
|
+
* }
|
|
234
|
+
*/
|
|
235
|
+
function logApiError(error, context) {
|
|
236
|
+
const { operation, url, apiName } = context;
|
|
237
|
+
if (error instanceof RateLimitError) {
|
|
238
|
+
logger_1.default.warn(`Rate limit exceeded for ${apiName} API during ${operation}${url ? ` (${url})` : ''}. Retry after: ${error.retryAfter || 'unknown'} seconds.`);
|
|
239
|
+
}
|
|
240
|
+
else if (error instanceof AuthenticationError) {
|
|
241
|
+
logger_1.default.error(`Authentication failed for ${apiName} API during ${operation}${url ? ` (${url})` : ''}. Check your API key.`);
|
|
242
|
+
}
|
|
243
|
+
else if (error instanceof NotFoundError) {
|
|
244
|
+
logger_1.default.error(`Resource not found on ${apiName} API during ${operation}${url ? ` (${url})` : ''}. Check your request parameters.`);
|
|
245
|
+
}
|
|
246
|
+
else if (error instanceof InvalidResponseError) {
|
|
247
|
+
logger_1.default.error(`Invalid response from ${apiName} API during ${operation}${url ? ` (${url})` : ''}. The API may have changed or returned an unexpected format.`);
|
|
248
|
+
}
|
|
249
|
+
else if (error instanceof ApiError) {
|
|
250
|
+
logger_1.default.error(`API error from ${apiName} during ${operation}${url ? ` (${url})` : ''}: ${error.message}`);
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
logger_1.default.error(`Unexpected error during ${apiName} API ${operation}${url ? ` (${url})` : ''}: ${error instanceof Error ? error.message : String(error)}`);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
//# sourceMappingURL=apiErrorHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiErrorHandler.js","sourceRoot":"","sources":["../../src/utils/apiErrorHandler.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;AAgIH,kDA2DC;AASD,sCAUC;AAiCD,kCAyCC;AAtRD,sDAA8B;AAE9B;;;;;;;;;GASG;AACH,MAAa,QAAS,SAAQ,KAAK;IAGxB;IACA;IAHT,YACE,OAAe,EACR,UAAmB,EACnB,OAAiB;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,eAAU,GAAV,UAAU,CAAS;QACnB,YAAO,GAAP,OAAO,CAAU;QAGxB,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,2CAA2C;QAC3C,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;IAClD,CAAC;CACF;AAXD,4BAWC;AAED;;GAEG;AACH,MAAa,cAAe,SAAQ,QAAQ;IAGjC;IAFT,YACE,OAAe,EACR,UAAmB,EAC1B,UAAmB,EACnB,OAAiB;QAEjB,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QAJ7B,eAAU,GAAV,UAAU,CAAS;QAK1B,I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|
+
* This module collects CI/CD data (type check errors, lint errors) to include
|
|
5
|
+
* in code reviews. It supports both project-wide and per-file analysis.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* CI data structure
|
|
9
|
+
*/
|
|
10
|
+
export interface CIData {
|
|
11
|
+
/**
|
|
12
|
+
* Number of type check errors
|
|
13
|
+
*/
|
|
14
|
+
typeCheckErrors?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Number of lint errors
|
|
17
|
+
*/
|
|
18
|
+
lintErrors?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Raw type check output
|
|
21
|
+
*/
|
|
22
|
+
typeCheckOutput?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Raw lint output
|
|
25
|
+
*/
|
|
26
|
+
lintOutput?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Per-file error counts
|
|
29
|
+
*/
|
|
30
|
+
fileErrors?: {
|
|
31
|
+
[filePath: string]: {
|
|
32
|
+
typeCheckErrors: number;
|
|
33
|
+
lintErrors: number;
|
|
34
|
+
typeCheckMessages?: string[];
|
|
35
|
+
lintMessages?: string[];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Collect CI/CD data for the current project
|
|
41
|
+
* @param projectPath Path to the project root
|
|
42
|
+
* @returns Promise resolving to CI data
|
|
43
|
+
*/
|
|
44
|
+
export declare function collectCIData(projectPath: string): Promise<CIData>;
|
|
45
|
+
/**
|
|
46
|
+
* Format CI data for inclusion in prompts
|
|
47
|
+
* @param ciData CI data to format
|
|
48
|
+
* @param specificFile Optional specific file to focus on
|
|
49
|
+
* @returns Formatted string for prompt inclusion
|
|
50
|
+
*/
|
|
51
|
+
export declare function formatCIDataForPrompt(ciData: CIData, specificFile?: string): string;
|