codereview-aia 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +0 -2
- package/docs/opt-in-full-context.md +27 -0
- package/package.json +11 -11
- package/reports/cr-cr-aia-17-11-2025-20-13.md +354 -0
- package/src/clients/implementations/openRouterClient.ts +2 -0
- package/src/clients/openRouterClient.ts +8 -1
- package/src/clients/utils/promptFormatter.ts +97 -20
- package/src/core/handlers/FileProcessingHandler.ts +6 -0
- package/src/index.ts +0 -3
- package/src/runtime/cliEntry.ts +21 -3
- package/src/runtime/fileCollector.ts +278 -5
- package/src/runtime/reviewPipeline.ts +46 -7
- package/src/runtime/runAiCodeReview.ts +161 -6
- package/src/runtime/ui/RuntimeApp.tsx +34 -5
- package/src/runtime/ui/screens/ProgressScreen.tsx +49 -1
- package/src/runtime/ui/screens/ResultsScreen.tsx +29 -9
- package/src/types/review.ts +18 -0
- package/dist/analysis/FindingsExtractor.d.ts +0 -105
- package/dist/analysis/FindingsExtractor.js +0 -363
- package/dist/analysis/FindingsExtractor.js.map +0 -1
- package/dist/analysis/ai-detection/analyzers/BaseAnalyzer.d.ts +0 -111
- package/dist/analysis/ai-detection/analyzers/BaseAnalyzer.js +0 -215
- package/dist/analysis/ai-detection/analyzers/BaseAnalyzer.js.map +0 -1
- package/dist/analysis/ai-detection/analyzers/DocumentationAnalyzer.d.ts +0 -142
- package/dist/analysis/ai-detection/analyzers/DocumentationAnalyzer.js +0 -503
- package/dist/analysis/ai-detection/analyzers/DocumentationAnalyzer.js.map +0 -1
- package/dist/analysis/ai-detection/analyzers/GitHistoryAnalyzer.d.ts +0 -88
- package/dist/analysis/ai-detection/analyzers/GitHistoryAnalyzer.js +0 -343
- package/dist/analysis/ai-detection/analyzers/GitHistoryAnalyzer.js.map +0 -1
- package/dist/analysis/ai-detection/core/AIDetectionEngine.d.ts +0 -104
- package/dist/analysis/ai-detection/core/AIDetectionEngine.js +0 -369
- package/dist/analysis/ai-detection/core/AIDetectionEngine.js.map +0 -1
- package/dist/analysis/ai-detection/types/DetectionTypes.d.ts +0 -364
- package/dist/analysis/ai-detection/types/DetectionTypes.js +0 -32
- package/dist/analysis/ai-detection/types/DetectionTypes.js.map +0 -1
- package/dist/analysis/ai-detection/utils/SubmissionConverter.d.ts +0 -97
- package/dist/analysis/ai-detection/utils/SubmissionConverter.js +0 -339
- package/dist/analysis/ai-detection/utils/SubmissionConverter.js.map +0 -1
- package/dist/analysis/context/ReviewContext.d.ts +0 -184
- package/dist/analysis/context/ReviewContext.js +0 -294
- package/dist/analysis/context/ReviewContext.js.map +0 -1
- package/dist/analysis/context/index.d.ts +0 -6
- package/dist/analysis/context/index.js +0 -23
- package/dist/analysis/context/index.js.map +0 -1
- package/dist/analysis/index.d.ts +0 -7
- package/dist/analysis/index.js +0 -24
- package/dist/analysis/index.js.map +0 -1
- package/dist/analysis/tokens/TokenAnalysisFormatter.d.ts +0 -27
- package/dist/analysis/tokens/TokenAnalysisFormatter.js +0 -143
- package/dist/analysis/tokens/TokenAnalysisFormatter.js.map +0 -1
- package/dist/analysis/tokens/TokenAnalyzer.d.ts +0 -155
- package/dist/analysis/tokens/TokenAnalyzer.js +0 -502
- package/dist/analysis/tokens/TokenAnalyzer.js.map +0 -1
- package/dist/analysis/tokens/index.d.ts +0 -7
- package/dist/analysis/tokens/index.js +0 -24
- package/dist/analysis/tokens/index.js.map +0 -1
- package/dist/clients/base/abstractClient.d.ts +0 -99
- package/dist/clients/base/abstractClient.js +0 -98
- package/dist/clients/base/abstractClient.js.map +0 -1
- package/dist/clients/base/httpClient.d.ts +0 -24
- package/dist/clients/base/httpClient.js +0 -147
- package/dist/clients/base/httpClient.js.map +0 -1
- package/dist/clients/base/index.d.ts +0 -11
- package/dist/clients/base/index.js +0 -28
- package/dist/clients/base/index.js.map +0 -1
- package/dist/clients/base/modelDetection.d.ts +0 -41
- package/dist/clients/base/modelDetection.js +0 -88
- package/dist/clients/base/modelDetection.js.map +0 -1
- package/dist/clients/base/responseProcessor.d.ts +0 -45
- package/dist/clients/base/responseProcessor.js +0 -495
- package/dist/clients/base/responseProcessor.js.map +0 -1
- package/dist/clients/factory/clientFactory.d.ts +0 -23
- package/dist/clients/factory/clientFactory.js +0 -50
- package/dist/clients/factory/clientFactory.js.map +0 -1
- package/dist/clients/factory/index.d.ts +0 -7
- package/dist/clients/factory/index.js +0 -24
- package/dist/clients/factory/index.js.map +0 -1
- package/dist/clients/implementations/index.d.ts +0 -7
- package/dist/clients/implementations/index.js +0 -24
- package/dist/clients/implementations/index.js.map +0 -1
- package/dist/clients/implementations/openRouterClient.d.ts +0 -69
- package/dist/clients/implementations/openRouterClient.js +0 -294
- package/dist/clients/implementations/openRouterClient.js.map +0 -1
- package/dist/clients/openRouterClient.d.ts +0 -42
- package/dist/clients/openRouterClient.js +0 -738
- package/dist/clients/openRouterClient.js.map +0 -1
- package/dist/clients/openRouterClientWrapper.d.ts +0 -22
- package/dist/clients/openRouterClientWrapper.js +0 -64
- package/dist/clients/openRouterClientWrapper.js.map +0 -1
- package/dist/clients/utils/directoryStructure.d.ts +0 -14
- package/dist/clients/utils/directoryStructure.js +0 -48
- package/dist/clients/utils/directoryStructure.js.map +0 -1
- package/dist/clients/utils/index.d.ts +0 -10
- package/dist/clients/utils/index.js +0 -31
- package/dist/clients/utils/index.js.map +0 -1
- package/dist/clients/utils/languageDetection.d.ts +0 -13
- package/dist/clients/utils/languageDetection.js +0 -46
- package/dist/clients/utils/languageDetection.js.map +0 -1
- package/dist/clients/utils/promptFormatter.d.ts +0 -36
- package/dist/clients/utils/promptFormatter.js +0 -92
- package/dist/clients/utils/promptFormatter.js.map +0 -1
- package/dist/clients/utils/promptLoader.d.ts +0 -27
- package/dist/clients/utils/promptLoader.js +0 -49
- package/dist/clients/utils/promptLoader.js.map +0 -1
- package/dist/clients/utils/tokenCounter.d.ts +0 -81
- package/dist/clients/utils/tokenCounter.js +0 -209
- package/dist/clients/utils/tokenCounter.js.map +0 -1
- package/dist/core/ApiClientSelector.d.ts +0 -8
- package/dist/core/ApiClientSelector.js +0 -29
- package/dist/core/ApiClientSelector.js.map +0 -1
- package/dist/core/ConfigurationService.d.ts +0 -286
- package/dist/core/ConfigurationService.js +0 -477
- package/dist/core/ConfigurationService.js.map +0 -1
- package/dist/core/ConsolidationService.d.ts +0 -99
- package/dist/core/ConsolidationService.js +0 -341
- package/dist/core/ConsolidationService.js.map +0 -1
- package/dist/core/InteractiveDisplayManager.d.ts +0 -22
- package/dist/core/InteractiveDisplayManager.js +0 -70
- package/dist/core/InteractiveDisplayManager.js.map +0 -1
- package/dist/core/OutputManager.d.ts +0 -26
- package/dist/core/OutputManager.js +0 -217
- package/dist/core/OutputManager.js.map +0 -1
- package/dist/core/ReviewGenerator.d.ts +0 -13
- package/dist/core/ReviewGenerator.js +0 -102
- package/dist/core/ReviewGenerator.js.map +0 -1
- package/dist/core/fileDiscovery.d.ts +0 -35
- package/dist/core/fileDiscovery.js +0 -202
- package/dist/core/fileDiscovery.js.map +0 -1
- package/dist/core/handlers/EstimationHandler.d.ts +0 -18
- package/dist/core/handlers/EstimationHandler.js +0 -110
- package/dist/core/handlers/EstimationHandler.js.map +0 -1
- package/dist/core/handlers/FileProcessingHandler.d.ts +0 -31
- package/dist/core/handlers/FileProcessingHandler.js +0 -159
- package/dist/core/handlers/FileProcessingHandler.js.map +0 -1
- package/dist/core/handlers/OutputHandler.d.ts +0 -27
- package/dist/core/handlers/OutputHandler.js +0 -127
- package/dist/core/handlers/OutputHandler.js.map +0 -1
- package/dist/core/handlers/ReviewExecutor.d.ts +0 -32
- package/dist/core/handlers/ReviewExecutor.js +0 -111
- package/dist/core/handlers/ReviewExecutor.js.map +0 -1
- package/dist/core/reviewOrchestrator.d.ts +0 -24
- package/dist/core/reviewOrchestrator.js +0 -294
- package/dist/core/reviewOrchestrator.js.map +0 -1
- package/dist/core/utils/ModelInfoUtils.d.ts +0 -16
- package/dist/core/utils/ModelInfoUtils.js +0 -54
- package/dist/core/utils/ModelInfoUtils.js.map +0 -1
- package/dist/formatters/outputFormatter.d.ts +0 -31
- package/dist/formatters/outputFormatter.js +0 -65
- package/dist/formatters/outputFormatter.js.map +0 -1
- package/dist/formatters/utils/IssueFormatters.d.ts +0 -20
- package/dist/formatters/utils/IssueFormatters.js +0 -67
- package/dist/formatters/utils/IssueFormatters.js.map +0 -1
- package/dist/formatters/utils/JsonFormatter.d.ts +0 -13
- package/dist/formatters/utils/JsonFormatter.js +0 -57
- package/dist/formatters/utils/JsonFormatter.js.map +0 -1
- package/dist/formatters/utils/MarkdownFormatters.d.ts +0 -51
- package/dist/formatters/utils/MarkdownFormatters.js +0 -456
- package/dist/formatters/utils/MarkdownFormatters.js.map +0 -1
- package/dist/formatters/utils/MetadataFormatter.d.ts +0 -65
- package/dist/formatters/utils/MetadataFormatter.js +0 -219
- package/dist/formatters/utils/MetadataFormatter.js.map +0 -1
- package/dist/formatters/utils/ModelInfoExtractor.d.ts +0 -33
- package/dist/formatters/utils/ModelInfoExtractor.js +0 -111
- package/dist/formatters/utils/ModelInfoExtractor.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js.map +0 -1
- package/dist/plugins/PluginInterface.d.ts +0 -44
- package/dist/plugins/PluginInterface.js +0 -9
- package/dist/plugins/PluginInterface.js.map +0 -1
- package/dist/plugins/PluginManager.d.ts +0 -51
- package/dist/plugins/PluginManager.js +0 -151
- package/dist/plugins/PluginManager.js.map +0 -1
- package/dist/prompts/PromptManager.d.ts +0 -30
- package/dist/prompts/PromptManager.js +0 -62
- package/dist/prompts/PromptManager.js.map +0 -1
- package/dist/prompts/cache/PromptCache.d.ts +0 -32
- package/dist/prompts/cache/PromptCache.js +0 -48
- package/dist/prompts/cache/PromptCache.js.map +0 -1
- package/dist/runtime/auth/service.d.ts +0 -2
- package/dist/runtime/auth/service.js +0 -41
- package/dist/runtime/auth/service.js.map +0 -1
- package/dist/runtime/auth/session.d.ts +0 -5
- package/dist/runtime/auth/session.js +0 -87
- package/dist/runtime/auth/session.js.map +0 -1
- package/dist/runtime/auth/types.d.ts +0 -9
- package/dist/runtime/auth/types.js +0 -3
- package/dist/runtime/auth/types.js.map +0 -1
- package/dist/runtime/cliEntry.d.ts +0 -1
- package/dist/runtime/cliEntry.js +0 -213
- package/dist/runtime/cliEntry.js.map +0 -1
- package/dist/runtime/debug/logManager.d.ts +0 -5
- package/dist/runtime/debug/logManager.js +0 -31
- package/dist/runtime/debug/logManager.js.map +0 -1
- package/dist/runtime/errors.d.ts +0 -5
- package/dist/runtime/errors.js +0 -15
- package/dist/runtime/errors.js.map +0 -1
- package/dist/runtime/fileCollector.d.ts +0 -5
- package/dist/runtime/fileCollector.js +0 -167
- package/dist/runtime/fileCollector.js.map +0 -1
- package/dist/runtime/manifest.d.ts +0 -1
- package/dist/runtime/manifest.js +0 -65
- package/dist/runtime/manifest.js.map +0 -1
- package/dist/runtime/openrouterProxy.d.ts +0 -4
- package/dist/runtime/openrouterProxy.js +0 -43
- package/dist/runtime/openrouterProxy.js.map +0 -1
- package/dist/runtime/preprod/webCheck.d.ts +0 -1
- package/dist/runtime/preprod/webCheck.js +0 -98
- package/dist/runtime/preprod/webCheck.js.map +0 -1
- package/dist/runtime/proxyConfig.d.ts +0 -6
- package/dist/runtime/proxyConfig.js +0 -86
- package/dist/runtime/proxyConfig.js.map +0 -1
- package/dist/runtime/proxyEnvironment.d.ts +0 -3
- package/dist/runtime/proxyEnvironment.js +0 -63
- package/dist/runtime/proxyEnvironment.js.map +0 -1
- package/dist/runtime/reportMerge.d.ts +0 -30
- package/dist/runtime/reportMerge.js +0 -70
- package/dist/runtime/reportMerge.js.map +0 -1
- package/dist/runtime/reporting/markdownReportBuilder.d.ts +0 -15
- package/dist/runtime/reporting/markdownReportBuilder.js +0 -97
- package/dist/runtime/reporting/markdownReportBuilder.js.map +0 -1
- package/dist/runtime/reporting/reportDataCollector.d.ts +0 -31
- package/dist/runtime/reporting/reportDataCollector.js +0 -170
- package/dist/runtime/reporting/reportDataCollector.js.map +0 -1
- package/dist/runtime/reporting/summaryGenerator.d.ts +0 -10
- package/dist/runtime/reporting/summaryGenerator.js +0 -67
- package/dist/runtime/reporting/summaryGenerator.js.map +0 -1
- package/dist/runtime/reviewPipeline.d.ts +0 -28
- package/dist/runtime/reviewPipeline.js +0 -122
- package/dist/runtime/reviewPipeline.js.map +0 -1
- package/dist/runtime/runAiCodeReview.d.ts +0 -10
- package/dist/runtime/runAiCodeReview.js +0 -138
- package/dist/runtime/runAiCodeReview.js.map +0 -1
- package/dist/runtime/runtimeConfig.d.ts +0 -4
- package/dist/runtime/runtimeConfig.js +0 -7
- package/dist/runtime/runtimeConfig.js.map +0 -1
- package/dist/runtime/ui/Layout.d.ts +0 -11
- package/dist/runtime/ui/Layout.js +0 -47
- package/dist/runtime/ui/Layout.js.map +0 -1
- package/dist/runtime/ui/RuntimeApp.d.ts +0 -6
- package/dist/runtime/ui/RuntimeApp.js +0 -161
- package/dist/runtime/ui/RuntimeApp.js.map +0 -1
- package/dist/runtime/ui/inkModules.d.ts +0 -10
- package/dist/runtime/ui/inkModules.js +0 -63
- package/dist/runtime/ui/inkModules.js.map +0 -1
- package/dist/runtime/ui/screens/AuthScreen.d.ts +0 -6
- package/dist/runtime/ui/screens/AuthScreen.js +0 -67
- package/dist/runtime/ui/screens/AuthScreen.js.map +0 -1
- package/dist/runtime/ui/screens/ModeSelection.d.ts +0 -10
- package/dist/runtime/ui/screens/ModeSelection.js +0 -100
- package/dist/runtime/ui/screens/ModeSelection.js.map +0 -1
- package/dist/runtime/ui/screens/ProgressScreen.d.ts +0 -7
- package/dist/runtime/ui/screens/ProgressScreen.js +0 -38
- package/dist/runtime/ui/screens/ProgressScreen.js.map +0 -1
- package/dist/runtime/ui/screens/ResultsScreen.d.ts +0 -7
- package/dist/runtime/ui/screens/ResultsScreen.js +0 -22
- package/dist/runtime/ui/screens/ResultsScreen.js.map +0 -1
- package/dist/strategies/ArchitecturalReviewStrategy.d.ts +0 -29
- package/dist/strategies/ArchitecturalReviewStrategy.js +0 -42
- package/dist/strategies/ArchitecturalReviewStrategy.js.map +0 -1
- package/dist/strategies/CodingTestReviewStrategy.d.ts +0 -194
- package/dist/strategies/CodingTestReviewStrategy.js +0 -681
- package/dist/strategies/CodingTestReviewStrategy.js.map +0 -1
- package/dist/strategies/ConsolidatedReviewStrategy.d.ts +0 -25
- package/dist/strategies/ConsolidatedReviewStrategy.js +0 -45
- package/dist/strategies/ConsolidatedReviewStrategy.js.map +0 -1
- package/dist/strategies/ExtractPatternsReviewStrategy.d.ts +0 -30
- package/dist/strategies/ExtractPatternsReviewStrategy.js +0 -51
- package/dist/strategies/ExtractPatternsReviewStrategy.js.map +0 -1
- package/dist/strategies/MultiPassReviewStrategy.d.ts +0 -86
- package/dist/strategies/MultiPassReviewStrategy.js +0 -590
- package/dist/strategies/MultiPassReviewStrategy.js.map +0 -1
- package/dist/strategies/ReviewStrategy.d.ts +0 -45
- package/dist/strategies/ReviewStrategy.js +0 -24
- package/dist/strategies/ReviewStrategy.js.map +0 -1
- package/dist/strategies/StrategyFactory.d.ts +0 -19
- package/dist/strategies/StrategyFactory.js +0 -72
- package/dist/strategies/StrategyFactory.js.map +0 -1
- package/dist/strategies/index.d.ts +0 -13
- package/dist/strategies/index.js +0 -30
- package/dist/strategies/index.js.map +0 -1
- package/dist/tokenizers/baseTokenizer.d.ts +0 -25
- package/dist/tokenizers/baseTokenizer.js +0 -48
- package/dist/tokenizers/baseTokenizer.js.map +0 -1
- package/dist/tokenizers/gptTokenizer.d.ts +0 -7
- package/dist/tokenizers/gptTokenizer.js +0 -28
- package/dist/tokenizers/gptTokenizer.js.map +0 -1
- package/dist/tokenizers/index.d.ts +0 -7
- package/dist/tokenizers/index.js +0 -24
- package/dist/tokenizers/index.js.map +0 -1
- package/dist/types/apiResponses.d.ts +0 -39
- package/dist/types/apiResponses.js +0 -9
- package/dist/types/apiResponses.js.map +0 -1
- package/dist/types/cli.d.ts +0 -22
- package/dist/types/cli.js +0 -3
- package/dist/types/cli.js.map +0 -1
- package/dist/types/common.d.ts +0 -22
- package/dist/types/common.js +0 -14
- package/dist/types/common.js.map +0 -1
- package/dist/types/configuration.d.ts +0 -682
- package/dist/types/configuration.js +0 -65
- package/dist/types/configuration.js.map +0 -1
- package/dist/types/review.d.ts +0 -258
- package/dist/types/review.js +0 -8
- package/dist/types/review.js.map +0 -1
- package/dist/types/reviewSchema.d.ts +0 -543
- package/dist/types/reviewSchema.js +0 -121
- package/dist/types/reviewSchema.js.map +0 -1
- package/dist/types/structuredReview.d.ts +0 -119
- package/dist/types/structuredReview.js +0 -6
- package/dist/types/structuredReview.js.map +0 -1
- package/dist/types/tokenAnalysis.d.ts +0 -44
- package/dist/types/tokenAnalysis.js +0 -4
- package/dist/types/tokenAnalysis.js.map +0 -1
- package/dist/utils/FileReader.d.ts +0 -33
- package/dist/utils/FileReader.js +0 -88
- package/dist/utils/FileReader.js.map +0 -1
- package/dist/utils/FileWriter.d.ts +0 -26
- package/dist/utils/FileWriter.js +0 -76
- package/dist/utils/FileWriter.js.map +0 -1
- package/dist/utils/PathGenerator.d.ts +0 -30
- package/dist/utils/PathGenerator.js +0 -82
- package/dist/utils/PathGenerator.js.map +0 -1
- package/dist/utils/api/apiUtils.d.ts +0 -3
- package/dist/utils/api/apiUtils.js +0 -20
- package/dist/utils/api/apiUtils.js.map +0 -1
- package/dist/utils/api/index.d.ts +0 -1
- package/dist/utils/api/index.js +0 -18
- package/dist/utils/api/index.js.map +0 -1
- package/dist/utils/apiErrorHandler.d.ts +0 -130
- package/dist/utils/apiErrorHandler.js +0 -256
- package/dist/utils/apiErrorHandler.js.map +0 -1
- package/dist/utils/ciDataCollector.d.ts +0 -51
- package/dist/utils/ciDataCollector.js +0 -197
- package/dist/utils/ciDataCollector.js.map +0 -1
- package/dist/utils/codingTestConfigLoader.d.ts +0 -66
- package/dist/utils/codingTestConfigLoader.js +0 -420
- package/dist/utils/codingTestConfigLoader.js.map +0 -1
- package/dist/utils/dependencies/aiDependencyAnalyzer.d.ts +0 -30
- package/dist/utils/dependencies/aiDependencyAnalyzer.js +0 -343
- package/dist/utils/dependencies/aiDependencyAnalyzer.js.map +0 -1
- package/dist/utils/detection/frameworkDetector.d.ts +0 -43
- package/dist/utils/detection/frameworkDetector.js +0 -795
- package/dist/utils/detection/frameworkDetector.js.map +0 -1
- package/dist/utils/detection/index.d.ts +0 -9
- package/dist/utils/detection/index.js +0 -28
- package/dist/utils/detection/index.js.map +0 -1
- package/dist/utils/detection/projectTypeDetector.d.ts +0 -27
- package/dist/utils/detection/projectTypeDetector.js +0 -469
- package/dist/utils/detection/projectTypeDetector.js.map +0 -1
- package/dist/utils/diagramGenerator.d.ts +0 -49
- package/dist/utils/diagramGenerator.js +0 -218
- package/dist/utils/diagramGenerator.js.map +0 -1
- package/dist/utils/errorLogger.d.ts +0 -24
- package/dist/utils/errorLogger.js +0 -59
- package/dist/utils/errorLogger.js.map +0 -1
- package/dist/utils/estimationUtils.d.ts +0 -139
- package/dist/utils/estimationUtils.js +0 -329
- package/dist/utils/estimationUtils.js.map +0 -1
- package/dist/utils/fileFilters.d.ts +0 -72
- package/dist/utils/fileFilters.js +0 -338
- package/dist/utils/fileFilters.js.map +0 -1
- package/dist/utils/fileSystem.d.ts +0 -22
- package/dist/utils/fileSystem.js +0 -45
- package/dist/utils/fileSystem.js.map +0 -1
- package/dist/utils/index.d.ts +0 -22
- package/dist/utils/index.js +0 -52
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -77
- package/dist/utils/logger.js +0 -271
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/pathValidator.d.ts +0 -40
- package/dist/utils/pathValidator.js +0 -98
- package/dist/utils/pathValidator.js.map +0 -1
- package/dist/utils/priorityFilter.d.ts +0 -34
- package/dist/utils/priorityFilter.js +0 -54
- package/dist/utils/priorityFilter.js.map +0 -1
- package/dist/utils/projectDocs.d.ts +0 -47
- package/dist/utils/projectDocs.js +0 -158
- package/dist/utils/projectDocs.js.map +0 -1
- package/dist/utils/promptPaths.d.ts +0 -6
- package/dist/utils/promptPaths.js +0 -33
- package/dist/utils/promptPaths.js.map +0 -1
- package/dist/utils/promptTemplateManager.d.ts +0 -34
- package/dist/utils/promptTemplateManager.js +0 -140
- package/dist/utils/promptTemplateManager.js.map +0 -1
- package/dist/utils/review/consolidateReview.d.ts +0 -15
- package/dist/utils/review/consolidateReview.js +0 -481
- package/dist/utils/review/consolidateReview.js.map +0 -1
- package/dist/utils/review/fixDisplay.d.ts +0 -20
- package/dist/utils/review/fixDisplay.js +0 -84
- package/dist/utils/review/fixDisplay.js.map +0 -1
- package/dist/utils/review/fixImplementation.d.ts +0 -28
- package/dist/utils/review/fixImplementation.js +0 -60
- package/dist/utils/review/fixImplementation.js.map +0 -1
- package/dist/utils/review/index.d.ts +0 -13
- package/dist/utils/review/index.js +0 -50
- package/dist/utils/review/index.js.map +0 -1
- package/dist/utils/review/interactiveProcessing.d.ts +0 -25
- package/dist/utils/review/interactiveProcessing.js +0 -251
- package/dist/utils/review/interactiveProcessing.js.map +0 -1
- package/dist/utils/review/progressTracker.d.ts +0 -106
- package/dist/utils/review/progressTracker.js +0 -227
- package/dist/utils/review/progressTracker.js.map +0 -1
- package/dist/utils/review/reviewExtraction.d.ts +0 -31
- package/dist/utils/review/reviewExtraction.js +0 -324
- package/dist/utils/review/reviewExtraction.js.map +0 -1
- package/dist/utils/review/types.d.ts +0 -45
- package/dist/utils/review/types.js +0 -18
- package/dist/utils/review/types.js.map +0 -1
- package/dist/utils/reviewActionHandler.d.ts +0 -16
- package/dist/utils/reviewActionHandler.js +0 -34
- package/dist/utils/reviewActionHandler.js.map +0 -1
- package/dist/utils/reviewParser.d.ts +0 -34
- package/dist/utils/reviewParser.js +0 -218
- package/dist/utils/reviewParser.js.map +0 -1
- package/dist/utils/sanitizer.d.ts +0 -82
- package/dist/utils/sanitizer.js +0 -239
- package/dist/utils/sanitizer.js.map +0 -1
- package/dist/utils/smartFileSelector.d.ts +0 -50
- package/dist/utils/smartFileSelector.js +0 -261
- package/dist/utils/smartFileSelector.js.map +0 -1
- package/dist/utils/templateLoader.d.ts +0 -44
- package/dist/utils/templateLoader.js +0 -431
- package/dist/utils/templateLoader.js.map +0 -1
- package/dist/utils/treeGenerator.d.ts +0 -12
- package/dist/utils/treeGenerator.js +0 -133
- package/dist/utils/treeGenerator.js.map +0 -1
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type definitions for the structured review output that cr-aia emits.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Priority levels for code review issues
|
|
6
|
-
*/
|
|
7
|
-
export type IssuePriority = 'high' | 'medium' | 'low';
|
|
8
|
-
/**
|
|
9
|
-
* Types of code review issues
|
|
10
|
-
*/
|
|
11
|
-
export type IssueType = 'bug' | 'security' | 'performance' | 'maintainability' | 'readability' | 'architecture' | 'best-practice' | 'documentation' | 'testing' | 'other';
|
|
12
|
-
/**
|
|
13
|
-
* A single code review issue
|
|
14
|
-
*/
|
|
15
|
-
export interface ReviewIssue {
|
|
16
|
-
/**
|
|
17
|
-
* Title of the issue
|
|
18
|
-
*/
|
|
19
|
-
title: string;
|
|
20
|
-
/**
|
|
21
|
-
* Priority level of the issue
|
|
22
|
-
*/
|
|
23
|
-
priority: IssuePriority;
|
|
24
|
-
/**
|
|
25
|
-
* Type of issue
|
|
26
|
-
*/
|
|
27
|
-
type: IssueType;
|
|
28
|
-
/**
|
|
29
|
-
* File path where the issue was found
|
|
30
|
-
*/
|
|
31
|
-
filePath: string;
|
|
32
|
-
/**
|
|
33
|
-
* Line number(s) where the issue was found
|
|
34
|
-
* Can be a single line number or a range (e.g., "10-15")
|
|
35
|
-
*/
|
|
36
|
-
lineNumbers?: string;
|
|
37
|
-
/**
|
|
38
|
-
* Description of the issue
|
|
39
|
-
*/
|
|
40
|
-
description: string;
|
|
41
|
-
/**
|
|
42
|
-
* Code snippet showing the issue
|
|
43
|
-
*/
|
|
44
|
-
codeSnippet?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Suggested fix for the issue
|
|
47
|
-
*/
|
|
48
|
-
suggestedFix?: string;
|
|
49
|
-
/**
|
|
50
|
-
* Impact of the issue
|
|
51
|
-
*/
|
|
52
|
-
impact?: string;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Grade level types for overall code quality
|
|
56
|
-
*/
|
|
57
|
-
export type GradeLevel = 'A+' | 'A' | 'A-' | 'B+' | 'B' | 'B-' | 'C+' | 'C' | 'C-' | 'D+' | 'D' | 'D-' | 'F';
|
|
58
|
-
/**
|
|
59
|
-
* Code quality assessment categories
|
|
60
|
-
*/
|
|
61
|
-
export interface GradeCategories {
|
|
62
|
-
/**
|
|
63
|
-
* Code functionality grade
|
|
64
|
-
*/
|
|
65
|
-
functionality?: GradeLevel;
|
|
66
|
-
/**
|
|
67
|
-
* Code quality grade
|
|
68
|
-
*/
|
|
69
|
-
codeQuality?: GradeLevel;
|
|
70
|
-
/**
|
|
71
|
-
* Documentation grade
|
|
72
|
-
*/
|
|
73
|
-
documentation?: GradeLevel;
|
|
74
|
-
/**
|
|
75
|
-
* Testing grade
|
|
76
|
-
*/
|
|
77
|
-
testing?: GradeLevel;
|
|
78
|
-
/**
|
|
79
|
-
* Maintainability grade
|
|
80
|
-
*/
|
|
81
|
-
maintainability?: GradeLevel;
|
|
82
|
-
/**
|
|
83
|
-
* Security grade
|
|
84
|
-
*/
|
|
85
|
-
security?: GradeLevel;
|
|
86
|
-
/**
|
|
87
|
-
* Performance grade
|
|
88
|
-
*/
|
|
89
|
-
performance?: GradeLevel;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Structured code review output
|
|
93
|
-
*/
|
|
94
|
-
export interface StructuredReview {
|
|
95
|
-
/**
|
|
96
|
-
* Overall grade for the codebase
|
|
97
|
-
*/
|
|
98
|
-
grade?: GradeLevel;
|
|
99
|
-
/**
|
|
100
|
-
* Detailed grade breakdown by category
|
|
101
|
-
*/
|
|
102
|
-
gradeCategories?: GradeCategories;
|
|
103
|
-
/**
|
|
104
|
-
* Summary of the code review
|
|
105
|
-
*/
|
|
106
|
-
summary: string;
|
|
107
|
-
/**
|
|
108
|
-
* List of issues found in the code review
|
|
109
|
-
*/
|
|
110
|
-
issues: ReviewIssue[];
|
|
111
|
-
/**
|
|
112
|
-
* General recommendations that don't fit into specific issues
|
|
113
|
-
*/
|
|
114
|
-
recommendations?: string[];
|
|
115
|
-
/**
|
|
116
|
-
* Positive aspects of the code
|
|
117
|
-
*/
|
|
118
|
-
positiveAspects?: string[];
|
|
119
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"structuredReview.js","sourceRoot":"","sources":["../../src/types/structuredReview.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/** Token analysis primitives shared across the CLI. */
|
|
2
|
-
import type { FileInfo } from './review';
|
|
3
|
-
export interface FileTokenAnalysis {
|
|
4
|
-
path: string;
|
|
5
|
-
relativePath: string | undefined;
|
|
6
|
-
tokenCount: number;
|
|
7
|
-
sizeInBytes: number;
|
|
8
|
-
tokensPerByte: number;
|
|
9
|
-
}
|
|
10
|
-
export interface TokenAnalysisResult {
|
|
11
|
-
files: FileTokenAnalysis[];
|
|
12
|
-
totalTokens: number;
|
|
13
|
-
totalSizeInBytes: number;
|
|
14
|
-
averageTokensPerByte: number;
|
|
15
|
-
fileCount: number;
|
|
16
|
-
promptOverheadTokens: number;
|
|
17
|
-
estimatedTotalTokens: number;
|
|
18
|
-
contextWindowSize: number;
|
|
19
|
-
exceedsContextWindow: boolean;
|
|
20
|
-
estimatedPassesNeeded: number;
|
|
21
|
-
chunkingRecommendation: ChunkingRecommendation;
|
|
22
|
-
}
|
|
23
|
-
export interface ChunkingRecommendation {
|
|
24
|
-
chunkingRecommended: boolean;
|
|
25
|
-
recommendedChunks: FileChunk[];
|
|
26
|
-
reason: string;
|
|
27
|
-
}
|
|
28
|
-
export interface FileChunk {
|
|
29
|
-
files: string[];
|
|
30
|
-
estimatedTokenCount: number;
|
|
31
|
-
priority: number;
|
|
32
|
-
}
|
|
33
|
-
export interface TokenAnalysisOptions {
|
|
34
|
-
reviewType: string;
|
|
35
|
-
modelName: string;
|
|
36
|
-
optimizeForSpeed?: boolean;
|
|
37
|
-
additionalPromptOverhead?: number;
|
|
38
|
-
contextMaintenanceFactor?: number;
|
|
39
|
-
}
|
|
40
|
-
export declare class TokenAnalyzer {
|
|
41
|
-
static analyzeFile(file: FileInfo, options: TokenAnalysisOptions): FileTokenAnalysis;
|
|
42
|
-
static analyzeFiles(files: FileInfo[], options: TokenAnalysisOptions): TokenAnalysisResult;
|
|
43
|
-
}
|
|
44
|
-
export declare function formatTokenAnalysis(analysis: TokenAnalysisResult, modelName: string, includeFiles?: boolean): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tokenAnalysis.js","sourceRoot":"","sources":["../../src/types/tokenAnalysis.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview File reading utilities.
|
|
3
|
-
*
|
|
4
|
-
* This module provides utilities for reading files and directories,
|
|
5
|
-
* with error handling and logging.
|
|
6
|
-
*/
|
|
7
|
-
import type { FileInfo } from '../types/review';
|
|
8
|
-
/**
|
|
9
|
-
* Read a file and return its content
|
|
10
|
-
* @param filePath Path to the file
|
|
11
|
-
* @returns Promise resolving to the file content
|
|
12
|
-
* @throws Error if the file cannot be read
|
|
13
|
-
*/
|
|
14
|
-
export declare function readFile(filePath: string): Promise<string>;
|
|
15
|
-
/**
|
|
16
|
-
* Read a file and return its content with file info
|
|
17
|
-
* @param filePath Path to the file
|
|
18
|
-
* @returns Promise resolving to a FileInfo object
|
|
19
|
-
*/
|
|
20
|
-
export declare function readFileWithInfo(filePath: string): Promise<FileInfo>;
|
|
21
|
-
/**
|
|
22
|
-
* Read multiple files and return their contents with file info
|
|
23
|
-
* @param filePaths Array of file paths
|
|
24
|
-
* @returns Promise resolving to an array of FileInfo objects
|
|
25
|
-
*/
|
|
26
|
-
export declare function readFilesWithInfo(filePaths: string[]): Promise<FileInfo[]>;
|
|
27
|
-
/**
|
|
28
|
-
* Read all files in a directory recursively
|
|
29
|
-
* @param dirPath Path to the directory
|
|
30
|
-
* @param filter Optional filter function to exclude certain files
|
|
31
|
-
* @returns Promise resolving to an array of file paths
|
|
32
|
-
*/
|
|
33
|
-
export declare function readFilesInDirectory(dirPath: string, filter?: (filePath: string) => boolean): Promise<string[]>;
|
package/dist/utils/FileReader.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @fileoverview File reading utilities.
|
|
4
|
-
*
|
|
5
|
-
* This module provides utilities for reading files and directories,
|
|
6
|
-
* with error handling and logging.
|
|
7
|
-
*/
|
|
8
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.readFile = readFile;
|
|
13
|
-
exports.readFileWithInfo = readFileWithInfo;
|
|
14
|
-
exports.readFilesWithInfo = readFilesWithInfo;
|
|
15
|
-
exports.readFilesInDirectory = readFilesInDirectory;
|
|
16
|
-
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
17
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
18
|
-
const logger_1 = __importDefault(require("./logger"));
|
|
19
|
-
/**
|
|
20
|
-
* Read a file and return its content
|
|
21
|
-
* @param filePath Path to the file
|
|
22
|
-
* @returns Promise resolving to the file content
|
|
23
|
-
* @throws Error if the file cannot be read
|
|
24
|
-
*/
|
|
25
|
-
async function readFile(filePath) {
|
|
26
|
-
try {
|
|
27
|
-
return await promises_1.default.readFile(filePath, 'utf-8');
|
|
28
|
-
}
|
|
29
|
-
catch (error) {
|
|
30
|
-
logger_1.default.error(`Error reading file ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
31
|
-
throw error;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Read a file and return its content with file info
|
|
36
|
-
* @param filePath Path to the file
|
|
37
|
-
* @returns Promise resolving to a FileInfo object
|
|
38
|
-
*/
|
|
39
|
-
async function readFileWithInfo(filePath) {
|
|
40
|
-
try {
|
|
41
|
-
const content = await promises_1.default.readFile(filePath, 'utf-8');
|
|
42
|
-
const extension = node_path_1.default.extname(filePath).slice(1);
|
|
43
|
-
return {
|
|
44
|
-
path: filePath,
|
|
45
|
-
content,
|
|
46
|
-
extension,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
logger_1.default.error(`Error reading file ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
51
|
-
throw error;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Read multiple files and return their contents with file info
|
|
56
|
-
* @param filePaths Array of file paths
|
|
57
|
-
* @returns Promise resolving to an array of FileInfo objects
|
|
58
|
-
*/
|
|
59
|
-
async function readFilesWithInfo(filePaths) {
|
|
60
|
-
const fileInfoPromises = filePaths.map((filePath) => readFileWithInfo(filePath));
|
|
61
|
-
return Promise.all(fileInfoPromises);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Read all files in a directory recursively
|
|
65
|
-
* @param dirPath Path to the directory
|
|
66
|
-
* @param filter Optional filter function to exclude certain files
|
|
67
|
-
* @returns Promise resolving to an array of file paths
|
|
68
|
-
*/
|
|
69
|
-
async function readFilesInDirectory(dirPath, filter) {
|
|
70
|
-
const result = [];
|
|
71
|
-
async function processDirectory(currentPath) {
|
|
72
|
-
const entries = await promises_1.default.readdir(currentPath, { withFileTypes: true });
|
|
73
|
-
for (const entry of entries) {
|
|
74
|
-
const entryPath = node_path_1.default.join(currentPath, entry.name);
|
|
75
|
-
if (entry.isDirectory()) {
|
|
76
|
-
await processDirectory(entryPath);
|
|
77
|
-
}
|
|
78
|
-
else if (entry.isFile()) {
|
|
79
|
-
if (!filter || filter(entryPath)) {
|
|
80
|
-
result.push(entryPath);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
await processDirectory(dirPath);
|
|
86
|
-
return result;
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=FileReader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FileReader.js","sourceRoot":"","sources":["../../src/utils/FileReader.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAaH,4BASC;AAOD,4CAgBC;AAOD,8CAGC;AAQD,oDAwBC;AArFD,gEAAkC;AAClC,0DAA6B;AAE7B,sDAA8B;AAE9B;;;;;GAKG;AACI,KAAK,UAAU,QAAQ,CAAC,QAAgB;IAC7C,IAAI,CAAC;QACH,OAAO,MAAM,kBAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,gBAAM,CAAC,KAAK,CACV,sBAAsB,QAAQ,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC5F,CAAC;QACF,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,gBAAgB,CAAC,QAAgB;IACrD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACrD,MAAM,SAAS,GAAG,mBAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAElD,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,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview File writing utilities.
|
|
3
|
-
*
|
|
4
|
-
* This module provides utilities for writing files and creating directories,
|
|
5
|
-
* with error handling and logging.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Create a directory if it doesn't exist
|
|
9
|
-
* @param dirPath Path to the directory
|
|
10
|
-
* @returns Promise resolving when the directory is created or already exists
|
|
11
|
-
*/
|
|
12
|
-
export declare function ensureDirectoryExists(dirPath: string): Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* Write content to a file, creating the directory if needed
|
|
15
|
-
* @param filePath Path to the file
|
|
16
|
-
* @param content Content to write
|
|
17
|
-
* @returns Promise resolving when the file is written
|
|
18
|
-
*/
|
|
19
|
-
export declare function writeFile(filePath: string, content: string): Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
* Append content to a file, creating the file if it doesn't exist
|
|
22
|
-
* @param filePath Path to the file
|
|
23
|
-
* @param content Content to append
|
|
24
|
-
* @returns Promise resolving when the content is appended
|
|
25
|
-
*/
|
|
26
|
-
export declare function appendFile(filePath: string, content: string): Promise<void>;
|
package/dist/utils/FileWriter.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @fileoverview File writing utilities.
|
|
4
|
-
*
|
|
5
|
-
* This module provides utilities for writing files and creating directories,
|
|
6
|
-
* with error handling and logging.
|
|
7
|
-
*/
|
|
8
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ensureDirectoryExists = ensureDirectoryExists;
|
|
13
|
-
exports.writeFile = writeFile;
|
|
14
|
-
exports.appendFile = appendFile;
|
|
15
|
-
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
16
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
17
|
-
const logger_1 = __importDefault(require("./logger"));
|
|
18
|
-
const pathValidator_1 = require("./pathValidator");
|
|
19
|
-
/**
|
|
20
|
-
* Create a directory if it doesn't exist
|
|
21
|
-
* @param dirPath Path to the directory
|
|
22
|
-
* @returns Promise resolving when the directory is created or already exists
|
|
23
|
-
*/
|
|
24
|
-
async function ensureDirectoryExists(dirPath) {
|
|
25
|
-
try {
|
|
26
|
-
if (!(0, pathValidator_1.pathExists)(dirPath)) {
|
|
27
|
-
await promises_1.default.mkdir(dirPath, { recursive: true });
|
|
28
|
-
logger_1.default.debug(`Created directory: ${dirPath}`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
logger_1.default.error(`Error creating directory ${dirPath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
33
|
-
throw error;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Write content to a file, creating the directory if needed
|
|
38
|
-
* @param filePath Path to the file
|
|
39
|
-
* @param content Content to write
|
|
40
|
-
* @returns Promise resolving when the file is written
|
|
41
|
-
*/
|
|
42
|
-
async function writeFile(filePath, content) {
|
|
43
|
-
try {
|
|
44
|
-
// Ensure the directory exists
|
|
45
|
-
const dirPath = node_path_1.default.dirname(filePath);
|
|
46
|
-
await ensureDirectoryExists(dirPath);
|
|
47
|
-
// Write the file
|
|
48
|
-
await promises_1.default.writeFile(filePath, content);
|
|
49
|
-
logger_1.default.debug(`Wrote file: ${filePath}`);
|
|
50
|
-
}
|
|
51
|
-
catch (error) {
|
|
52
|
-
logger_1.default.error(`Error writing file ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
53
|
-
throw error;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Append content to a file, creating the file if it doesn't exist
|
|
58
|
-
* @param filePath Path to the file
|
|
59
|
-
* @param content Content to append
|
|
60
|
-
* @returns Promise resolving when the content is appended
|
|
61
|
-
*/
|
|
62
|
-
async function appendFile(filePath, content) {
|
|
63
|
-
try {
|
|
64
|
-
// Ensure the directory exists
|
|
65
|
-
const dirPath = node_path_1.default.dirname(filePath);
|
|
66
|
-
await ensureDirectoryExists(dirPath);
|
|
67
|
-
// Append to the file
|
|
68
|
-
await promises_1.default.appendFile(filePath, content);
|
|
69
|
-
logger_1.default.debug(`Appended to file: ${filePath}`);
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
logger_1.default.error(`Error appending to file ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
73
|
-
throw error;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=FileWriter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FileWriter.js","sourceRoot":"","sources":["../../src/utils/FileWriter.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAYH,sDAYC;AAQD,8BAeC;AAQD,gCAeC;AApED,gEAAkC;AAClC,0DAA6B;AAC7B,sDAA8B;AAC9B,mDAA6C;AAE7C;;;;GAIG;AACI,KAAK,UAAU,qBAAqB,CAAC,OAAe;IACzD,IAAI,CAAC;QACH,IAAI,CAAC,IAAA,0BAAU,EAAC,OAAO,CAAC,EAAE,CAAC;YACzB,MAAM,kBAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC7C,gBAAM,CAAC,KAAK,CAAC,sBAAsB,OAAO,EAAE,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,gBAAM,CAAC,KAAK,CACV,4BAA4B,OAAO,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAA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,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACjG,CAAC;QACF,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Path generation utilities.
|
|
3
|
-
*
|
|
4
|
-
* This module provides utilities for generating file and directory paths,
|
|
5
|
-
* including versioned output paths for review results.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Generate a versioned output path for a file
|
|
9
|
-
* @param baseDir Base directory for the output
|
|
10
|
-
* @param prefix Prefix for the filename
|
|
11
|
-
* @param extension File extension (including the dot)
|
|
12
|
-
* @param modelName Name of the model used for the review
|
|
13
|
-
* @param targetName Name of the target file or directory
|
|
14
|
-
* @returns Promise resolving to the generated path
|
|
15
|
-
*/
|
|
16
|
-
export declare function generateVersionedOutputPath(baseDir: string, prefix: string, extension: string, modelName: string, targetName: string): Promise<string>;
|
|
17
|
-
/**
|
|
18
|
-
* Generate an output path for a file with a unique name
|
|
19
|
-
* @param baseDir Base directory for the output
|
|
20
|
-
* @param filename Desired filename
|
|
21
|
-
* @returns Promise resolving to the generated path
|
|
22
|
-
*/
|
|
23
|
-
export declare function generateUniqueOutputPath(baseDir: string, filename: string): Promise<string>;
|
|
24
|
-
/**
|
|
25
|
-
* Generate a temporary file path
|
|
26
|
-
* @param prefix Prefix for the filename
|
|
27
|
-
* @param extension File extension (including the dot)
|
|
28
|
-
* @returns Generated temporary file path
|
|
29
|
-
*/
|
|
30
|
-
export declare function generateTempFilePath(prefix: string, extension: string): string;
|
|
@@ -1,82 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
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__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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './apiUtils';
|
package/dist/utils/api/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B"}
|