codereview-aia 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/dist/analysis/context/index.d.ts +6 -0
- package/dist/analysis/context/index.js +23 -0
- package/dist/analysis/context/index.js.map +1 -0
- package/dist/analysis/index.d.ts +7 -0
- package/dist/analysis/index.js +24 -0
- package/dist/analysis/index.js.map +1 -0
- package/dist/analysis/tokens/TokenAnalysisFormatter.d.ts +27 -0
- package/dist/analysis/tokens/TokenAnalysisFormatter.js +143 -0
- 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/dist/analysis/tokens/index.d.ts +7 -0
- 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/dist/clients/base/index.d.ts +11 -0
- 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/dist/clients/factory/index.d.ts +7 -0
- package/dist/clients/factory/index.js +24 -0
- package/dist/clients/factory/index.js.map +1 -0
- package/dist/clients/implementations/index.d.ts +7 -0
- 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/dist/clients/openRouterClientWrapper.d.ts +22 -0
- 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/dist/clients/utils/index.d.ts +10 -0
- 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 +36 -0
- package/dist/clients/utils/promptFormatter.js +92 -0
- package/dist/clients/utils/promptFormatter.js.map +1 -0
- package/dist/clients/utils/promptLoader.d.ts +27 -0
- 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 +286 -0
- package/dist/core/ConfigurationService.js +477 -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 +159 -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 +294 -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/dist/formatters/outputFormatter.d.ts +31 -0
- 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 +2 -0
- package/dist/index.js +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 +213 -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 +5 -0
- package/dist/runtime/fileCollector.js +167 -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 +15 -0
- package/dist/runtime/reporting/markdownReportBuilder.js +97 -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 +28 -0
- package/dist/runtime/reviewPipeline.js +122 -0
- package/dist/runtime/reviewPipeline.js.map +1 -0
- package/dist/runtime/runAiCodeReview.d.ts +10 -0
- package/dist/runtime/runAiCodeReview.js +138 -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 +161 -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 +7 -0
- package/dist/runtime/ui/screens/ProgressScreen.js +38 -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 +22 -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/dist/strategies/index.d.ts +13 -0
- 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/dist/tokenizers/index.d.ts +7 -0
- 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/dist/types/common.d.ts +22 -0
- 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 +258 -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/dist/types/reviewSchema.js +121 -0
- 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.d.ts +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 +795 -0
- package/dist/utils/detection/frameworkDetector.js.map +1 -0
- package/dist/utils/detection/index.d.ts +9 -0
- 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/dist/utils/index.d.ts +22 -0
- 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/dist/utils/priorityFilter.d.ts +34 -0
- 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 +140 -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/dist/utils/reviewActionHandler.d.ts +16 -0
- 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 +11 -12
- package/src/index.ts +1 -0
- package/src/runtime/debug/logManager.ts +37 -0
- package/src/runtime/fileCollector.ts +58 -24
- package/src/runtime/preprod/webCheck.ts +104 -0
- package/src/runtime/reviewPipeline.ts +10 -4
- package/src/runtime/ui/RuntimeApp.tsx +96 -13
- package/src/runtime/ui/screens/ModeSelection.tsx +148 -15
- package/src/runtime/ui/screens/ProgressScreen.tsx +10 -3
- package/src/runtime/ui/screens/ResultsScreen.tsx +8 -1
- package/src/utils/logger.ts +64 -14
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Centralized logging system for the cr-aia tool.
|
|
4
|
+
*
|
|
5
|
+
* This module provides a standardized logging interface with support for
|
|
6
|
+
* different log levels, colored output, and log level control via environment
|
|
7
|
+
* variables. It's designed to be used throughout the codebase to ensure
|
|
8
|
+
* consistent logging behavior.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.LogLevel = void 0;
|
|
12
|
+
exports.setLogLevel = setLogLevel;
|
|
13
|
+
exports.getLogLevel = getLogLevel;
|
|
14
|
+
exports.enableFileLogging = enableFileLogging;
|
|
15
|
+
exports.disableFileLogging = disableFileLogging;
|
|
16
|
+
exports.debug = debug;
|
|
17
|
+
exports.info = info;
|
|
18
|
+
exports.warn = warn;
|
|
19
|
+
exports.error = error;
|
|
20
|
+
exports.createLogger = createLogger;
|
|
21
|
+
// Define log levels with numeric values for comparison
|
|
22
|
+
var LogLevel;
|
|
23
|
+
(function (LogLevel) {
|
|
24
|
+
LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
|
|
25
|
+
LogLevel[LogLevel["INFO"] = 1] = "INFO";
|
|
26
|
+
LogLevel[LogLevel["WARN"] = 2] = "WARN";
|
|
27
|
+
LogLevel[LogLevel["ERROR"] = 3] = "ERROR";
|
|
28
|
+
LogLevel[LogLevel["NONE"] = 4] = "NONE";
|
|
29
|
+
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
30
|
+
// Map string log level names to enum values
|
|
31
|
+
const LOG_LEVEL_MAP = {
|
|
32
|
+
debug: LogLevel.DEBUG,
|
|
33
|
+
info: LogLevel.INFO,
|
|
34
|
+
warn: LogLevel.WARN,
|
|
35
|
+
error: LogLevel.ERROR,
|
|
36
|
+
none: LogLevel.NONE,
|
|
37
|
+
};
|
|
38
|
+
const node_fs_1 = require("node:fs");
|
|
39
|
+
const node_path_1 = require("node:path");
|
|
40
|
+
// ANSI color codes for terminal output
|
|
41
|
+
const COLORS = {
|
|
42
|
+
reset: '\x1b[0m',
|
|
43
|
+
dim: '\x1b[2m',
|
|
44
|
+
bright: '\x1b[1m',
|
|
45
|
+
debug: '\x1b[36m', // Cyan
|
|
46
|
+
info: '\x1b[32m', // Green
|
|
47
|
+
warn: '\x1b[33m', // Yellow
|
|
48
|
+
error: '\x1b[31m', // Red
|
|
49
|
+
time: '\x1b[90m', // Gray
|
|
50
|
+
};
|
|
51
|
+
// Track if we're initializing to avoid circular dependencies
|
|
52
|
+
const isInitializing = false;
|
|
53
|
+
let logFileStream = null;
|
|
54
|
+
let suppressConsoleOutput = false;
|
|
55
|
+
// Get the current log level from environment variables
|
|
56
|
+
function getCurrentLogLevel() {
|
|
57
|
+
// Avoid debug logs during initialization to prevent overwhelming output
|
|
58
|
+
const shouldLog = process.argv.includes('--trace-logger') && !isInitializing;
|
|
59
|
+
if (shouldLog) {
|
|
60
|
+
// Only print when explicitly requested with --trace-logger
|
|
61
|
+
console.error(`Debug: getCurrentLogLevel called, AI_CODE_REVIEW_LOG_LEVEL=${process.env.AI_CODE_REVIEW_LOG_LEVEL}`);
|
|
62
|
+
}
|
|
63
|
+
// Always check CLI flags first - highest priority
|
|
64
|
+
if (process.argv.includes('--debug')) {
|
|
65
|
+
if (shouldLog) {
|
|
66
|
+
console.error('Debug: Debug flag found in process.argv, forcing DEBUG level');
|
|
67
|
+
}
|
|
68
|
+
return LogLevel.DEBUG;
|
|
69
|
+
}
|
|
70
|
+
// Next check environment variable
|
|
71
|
+
const envLogLevel = process.env.AI_CODE_REVIEW_LOG_LEVEL?.toLowerCase();
|
|
72
|
+
if (envLogLevel) {
|
|
73
|
+
if (shouldLog) {
|
|
74
|
+
console.error(`Debug: Found AI_CODE_REVIEW_LOG_LEVEL environment variable: ${envLogLevel}`);
|
|
75
|
+
}
|
|
76
|
+
if (envLogLevel in LOG_LEVEL_MAP) {
|
|
77
|
+
if (shouldLog) {
|
|
78
|
+
console.error(`Debug: Mapped log level ${envLogLevel} -> ${LOG_LEVEL_MAP[envLogLevel]}`);
|
|
79
|
+
}
|
|
80
|
+
return LOG_LEVEL_MAP[envLogLevel];
|
|
81
|
+
}
|
|
82
|
+
if (shouldLog) {
|
|
83
|
+
console.error(`Debug: Invalid log level: ${envLogLevel}, valid options are: ${Object.keys(LOG_LEVEL_MAP).join(', ')}`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else if (shouldLog) {
|
|
87
|
+
console.error('Debug: AI_CODE_REVIEW_LOG_LEVEL environment variable not found');
|
|
88
|
+
}
|
|
89
|
+
// Default to INFO if not specified
|
|
90
|
+
if (shouldLog) {
|
|
91
|
+
console.error('Debug: No valid log level found, defaulting to INFO');
|
|
92
|
+
}
|
|
93
|
+
return LogLevel.INFO;
|
|
94
|
+
}
|
|
95
|
+
// The current log level
|
|
96
|
+
let currentLogLevel = getCurrentLogLevel();
|
|
97
|
+
/**
|
|
98
|
+
* Set the current log level
|
|
99
|
+
* @param level The log level to set
|
|
100
|
+
*/
|
|
101
|
+
function setLogLevel(level) {
|
|
102
|
+
// Only log when explicitly requested with --trace-logger
|
|
103
|
+
const shouldLog = process.argv.includes('--trace-logger');
|
|
104
|
+
if (shouldLog) {
|
|
105
|
+
console.error(`Debug: setLogLevel called with ${level}`);
|
|
106
|
+
}
|
|
107
|
+
if (typeof level === 'string') {
|
|
108
|
+
const levelLower = level.toLowerCase();
|
|
109
|
+
if (levelLower in LOG_LEVEL_MAP) {
|
|
110
|
+
currentLogLevel = LOG_LEVEL_MAP[levelLower];
|
|
111
|
+
if (shouldLog) {
|
|
112
|
+
console.error(`Debug: Log level set to ${levelLower} -> ${currentLogLevel}`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
console.warn(`Invalid log level: ${level}. Using default.`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
currentLogLevel = level;
|
|
121
|
+
if (shouldLog) {
|
|
122
|
+
console.error(`Debug: Log level set to numeric value ${level}`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Get the current log level
|
|
128
|
+
* @returns The current log level
|
|
129
|
+
*/
|
|
130
|
+
function getLogLevel() {
|
|
131
|
+
return currentLogLevel;
|
|
132
|
+
}
|
|
133
|
+
function formatConsoleMessage(level, message, timestamp) {
|
|
134
|
+
const levelUpper = level.toUpperCase().padEnd(5);
|
|
135
|
+
return `${COLORS.time}[${timestamp}]${COLORS.reset} ${COLORS[level]}${levelUpper}${COLORS.reset} ${message}`;
|
|
136
|
+
}
|
|
137
|
+
function formatFileMessage(level, message, timestamp, args) {
|
|
138
|
+
const levelUpper = level.toUpperCase().padEnd(5);
|
|
139
|
+
const extras = args.length ? ` ${args.map((arg) => serializeLogArg(arg)).join(' ')}` : '';
|
|
140
|
+
return `[${timestamp}] ${levelUpper} ${message}${extras}`;
|
|
141
|
+
}
|
|
142
|
+
function serializeLogArg(arg) {
|
|
143
|
+
if (typeof arg === 'string') {
|
|
144
|
+
return arg;
|
|
145
|
+
}
|
|
146
|
+
if (arg instanceof Error) {
|
|
147
|
+
return arg.stack || arg.message;
|
|
148
|
+
}
|
|
149
|
+
try {
|
|
150
|
+
return JSON.stringify(arg);
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
return String(arg);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function enableFileLogging(filePath, options) {
|
|
157
|
+
try {
|
|
158
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(filePath), { recursive: true });
|
|
159
|
+
if (logFileStream) {
|
|
160
|
+
logFileStream.end();
|
|
161
|
+
}
|
|
162
|
+
logFileStream = (0, node_fs_1.createWriteStream)(filePath, { flags: 'a' });
|
|
163
|
+
suppressConsoleOutput = options?.suppressConsole ?? true;
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
console.error('Failed to enable file logging:', error);
|
|
167
|
+
logFileStream = null;
|
|
168
|
+
suppressConsoleOutput = false;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
function disableFileLogging() {
|
|
172
|
+
if (logFileStream) {
|
|
173
|
+
logFileStream.end();
|
|
174
|
+
logFileStream = null;
|
|
175
|
+
}
|
|
176
|
+
suppressConsoleOutput = false;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Log a message if the current log level allows it
|
|
180
|
+
* @param level The log level
|
|
181
|
+
* @param message The message to log
|
|
182
|
+
* @param args Additional arguments to log
|
|
183
|
+
*/
|
|
184
|
+
function log(level, levelName, message, ...args) {
|
|
185
|
+
const timestamp = new Date().toISOString();
|
|
186
|
+
if (logFileStream) {
|
|
187
|
+
logFileStream.write(`${formatFileMessage(levelName, message, timestamp, args)}\n`);
|
|
188
|
+
}
|
|
189
|
+
const shouldLogToConsole = !suppressConsoleOutput && level >= currentLogLevel;
|
|
190
|
+
if (shouldLogToConsole) {
|
|
191
|
+
const formattedMessage = formatConsoleMessage(levelName, message, timestamp);
|
|
192
|
+
switch (level) {
|
|
193
|
+
case LogLevel.DEBUG:
|
|
194
|
+
console.debug(formattedMessage, ...args);
|
|
195
|
+
break;
|
|
196
|
+
case LogLevel.INFO:
|
|
197
|
+
console.log(formattedMessage, ...args);
|
|
198
|
+
break;
|
|
199
|
+
case LogLevel.WARN:
|
|
200
|
+
console.warn(formattedMessage, ...args);
|
|
201
|
+
break;
|
|
202
|
+
case LogLevel.ERROR:
|
|
203
|
+
console.error(formattedMessage, ...args);
|
|
204
|
+
break;
|
|
205
|
+
default:
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
else if (!suppressConsoleOutput && level === LogLevel.DEBUG && process.argv.includes('--trace-logger')) {
|
|
210
|
+
console.error(`Suppressing DEBUG log because currentLogLevel=${currentLogLevel}, message was: ${message}`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Log a debug message
|
|
215
|
+
* @param message The message to log
|
|
216
|
+
* @param args Additional arguments to log
|
|
217
|
+
*/
|
|
218
|
+
function debug(message, ...args) {
|
|
219
|
+
log(LogLevel.DEBUG, 'debug', message, ...args);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Log an info message
|
|
223
|
+
* @param message The message to log
|
|
224
|
+
* @param args Additional arguments to log
|
|
225
|
+
*/
|
|
226
|
+
function info(message, ...args) {
|
|
227
|
+
log(LogLevel.INFO, 'info', message, ...args);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Log a warning message
|
|
231
|
+
* @param message The message to log
|
|
232
|
+
* @param args Additional arguments to log
|
|
233
|
+
*/
|
|
234
|
+
function warn(message, ...args) {
|
|
235
|
+
log(LogLevel.WARN, 'warn', message, ...args);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Log an error message
|
|
239
|
+
* @param message The message to log
|
|
240
|
+
* @param args Additional arguments to log
|
|
241
|
+
*/
|
|
242
|
+
function error(message, ...args) {
|
|
243
|
+
log(LogLevel.ERROR, 'error', message, ...args);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Create a logger instance with a specific prefix
|
|
247
|
+
* @param prefix The prefix to add to all log messages
|
|
248
|
+
* @returns An object with debug, info, warn, and error methods
|
|
249
|
+
*/
|
|
250
|
+
function createLogger(prefix) {
|
|
251
|
+
return {
|
|
252
|
+
debug: (message, ...args) => debug(`[${prefix}] ${message}`, ...args),
|
|
253
|
+
info: (message, ...args) => info(`[${prefix}] ${message}`, ...args),
|
|
254
|
+
warn: (message, ...args) => warn(`[${prefix}] ${message}`, ...args),
|
|
255
|
+
error: (message, ...args) => error(`[${prefix}] ${message}`, ...args),
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
// Export a default logger instance
|
|
259
|
+
exports.default = {
|
|
260
|
+
debug,
|
|
261
|
+
info,
|
|
262
|
+
warn,
|
|
263
|
+
error,
|
|
264
|
+
setLogLevel,
|
|
265
|
+
getLogLevel,
|
|
266
|
+
createLogger,
|
|
267
|
+
LogLevel,
|
|
268
|
+
enableFileLogging,
|
|
269
|
+
disableFileLogging,
|
|
270
|
+
};
|
|
271
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAiGH,kCAwBC;AAMD,kCAEC;AA2BD,8CAaC;AAED,gDAMC;AAgDD,sBAEC;AAOD,oBAEC;AAOD,oBAEC;AAOD,sBAEC;AAOD,oCAOC;AA1QD,uDAAuD;AACvD,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,yCAAS,CAAA;IACT,uCAAQ,CAAA;IACR,uCAAQ,CAAA;IACR,yCAAS,CAAA;IACT,uCAAQ,CAAA;AACV,CAAC,EANW,QAAQ,wBAAR,QAAQ,QAMnB;AAED,4CAA4C;AAC5C,MAAM,aAAa,GAA6B;IAC9C,KAAK,EAAE,QAAQ,CAAC,KAAK;IACrB,IAAI,EAAE,QAAQ,CAAC,IAAI;IACnB,IAAI,EAAE,QAAQ,CAAC,IAAI;IACnB,KAAK,EAAE,QAAQ,CAAC,KAAK;IACrB,IAAI,EAAE,QAAQ,CAAC,IAAI;CACpB,CAAC;AAEF,qCAAyE;AACzE,yCAAoC;AAEpC,uCAAuC;AACvC,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,SAAS;IAChB,GAAG,EAAE,SAAS;IACd,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,UAAU,EAAE,OAAO;IAC1B,IAAI,EAAE,UAAU,EAAE,QAAQ;IAC1B,IAAI,EAAE,UAAU,EAAE,SAAS;IAC3B,KAAK,EAAE,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AAG,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,SAAgB,KAAK,CAAC,OAAe,EAAE,GAAG,IAAW;IACnD,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,MAAc;IACzC,OAAO;QACL,KAAK,EAAE,CAAC,OAAe,EAAE,GAAG,IAAW,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,MAAM,KAAK,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC;QACpF,IAAI,EAAE,CAAC,OAAe,EAAE,GAAG,IAAW,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,MAAM,KAAK,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC;QAClF,IAAI,EAAE,CAAC,OAAe,EAAE,GAAG,IAAW,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,MAAM,KAAK,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC;QAClF,KAAK,EAAE,CAAC,OAAe,EAAE,GAAG,IAAW,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,MAAM,KAAK,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC;KACrF,CAAC;AACJ,CAAC;AAED,mCAAmC;AACnC,kBAAe;IACb,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,WAAW;IACX,WAAW;IACX,YAAY;IACZ,QAAQ;IACR,iBAAiB;IACjB,kBAAkB;CACnB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Path validation utilities.
|
|
3
|
+
*
|
|
4
|
+
* This module provides utilities for validating file and directory paths,
|
|
5
|
+
* ensuring they are safe to use and exist on the file system.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Check if a path is within the current directory or its subdirectories
|
|
9
|
+
* @param targetPath Path to check
|
|
10
|
+
* @returns True if the path is within the current directory, false otherwise
|
|
11
|
+
*/
|
|
12
|
+
export declare function isPathWithinCwd(targetPath: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Check if a path exists
|
|
15
|
+
* @param targetPath Path to check
|
|
16
|
+
* @returns True if the path exists, false otherwise
|
|
17
|
+
*/
|
|
18
|
+
export declare function pathExists(targetPath: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Check if a path is a directory
|
|
21
|
+
* @param targetPath Path to check
|
|
22
|
+
* @returns True if the path is a directory, false otherwise
|
|
23
|
+
*/
|
|
24
|
+
export declare function isDirectory(targetPath: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Check if a path is a file
|
|
27
|
+
* @param targetPath Path to check
|
|
28
|
+
* @returns True if the path is a file, false otherwise
|
|
29
|
+
*/
|
|
30
|
+
export declare function isFile(targetPath: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Validate a target path for security and existence
|
|
33
|
+
* @param targetPath Path to validate
|
|
34
|
+
* @returns Object with validation results
|
|
35
|
+
*/
|
|
36
|
+
export declare function validateTargetPath(targetPath: string): {
|
|
37
|
+
isValid: boolean;
|
|
38
|
+
isDir: boolean;
|
|
39
|
+
error?: string;
|
|
40
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Path validation utilities.
|
|
4
|
+
*
|
|
5
|
+
* This module provides utilities for validating file and directory paths,
|
|
6
|
+
* ensuring they are safe to use and exist on the file system.
|
|
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.isPathWithinCwd = isPathWithinCwd;
|
|
13
|
+
exports.pathExists = pathExists;
|
|
14
|
+
exports.isDirectory = isDirectory;
|
|
15
|
+
exports.isFile = isFile;
|
|
16
|
+
exports.validateTargetPath = validateTargetPath;
|
|
17
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
18
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
19
|
+
/**
|
|
20
|
+
* Check if a path is within the current directory or its subdirectories
|
|
21
|
+
* @param targetPath Path to check
|
|
22
|
+
* @returns True if the path is within the current directory, false otherwise
|
|
23
|
+
*/
|
|
24
|
+
function isPathWithinCwd(targetPath) {
|
|
25
|
+
const resolvedPath = node_path_1.default.resolve(targetPath);
|
|
26
|
+
const resolvedCwd = node_path_1.default.resolve(process.cwd());
|
|
27
|
+
return resolvedPath.startsWith(resolvedCwd);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Check if a path exists
|
|
31
|
+
* @param targetPath Path to check
|
|
32
|
+
* @returns True if the path exists, false otherwise
|
|
33
|
+
*/
|
|
34
|
+
function pathExists(targetPath) {
|
|
35
|
+
try {
|
|
36
|
+
node_fs_1.default.accessSync(targetPath);
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
catch (_error) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Check if a path is a directory
|
|
45
|
+
* @param targetPath Path to check
|
|
46
|
+
* @returns True if the path is a directory, false otherwise
|
|
47
|
+
*/
|
|
48
|
+
function isDirectory(targetPath) {
|
|
49
|
+
try {
|
|
50
|
+
return node_fs_1.default.statSync(targetPath).isDirectory();
|
|
51
|
+
}
|
|
52
|
+
catch (_error) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Check if a path is a file
|
|
58
|
+
* @param targetPath Path to check
|
|
59
|
+
* @returns True if the path is a file, false otherwise
|
|
60
|
+
*/
|
|
61
|
+
function isFile(targetPath) {
|
|
62
|
+
try {
|
|
63
|
+
return node_fs_1.default.statSync(targetPath).isFile();
|
|
64
|
+
}
|
|
65
|
+
catch (_error) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Validate a target path for security and existence
|
|
71
|
+
* @param targetPath Path to validate
|
|
72
|
+
* @returns Object with validation results
|
|
73
|
+
*/
|
|
74
|
+
function validateTargetPath(targetPath) {
|
|
75
|
+
// Check if the path is within the current directory
|
|
76
|
+
if (!isPathWithinCwd(targetPath)) {
|
|
77
|
+
return {
|
|
78
|
+
isValid: false,
|
|
79
|
+
isDir: false,
|
|
80
|
+
error: `Path must be within the current directory: ${process.cwd()}`,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
// Check if the path exists
|
|
84
|
+
if (!pathExists(targetPath)) {
|
|
85
|
+
return {
|
|
86
|
+
isValid: false,
|
|
87
|
+
isDir: false,
|
|
88
|
+
error: `Path does not exist: ${targetPath}`,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
// Check if the path is a directory or file
|
|
92
|
+
const isDir = isDirectory(targetPath);
|
|
93
|
+
return {
|
|
94
|
+
isValid: true,
|
|
95
|
+
isDir,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=pathValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pathValidator.js","sourceRoot":"","sources":["../../src/utils/pathValidator.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAUH,0CAKC;AAOD,gCAOC;AAOD,kCAMC;AAOD,wBAMC;AAOD,gDA8BC;AA1FD,sDAAyB;AACzB,0DAA6B;AAE7B;;;;GAIG;AACH,SAAgB,eAAe,CAAC,UAAkB;IAChD,MAAM,YAAY,GAAG,mBAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC9C,MAAM,WAAW,GAAG,mBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,C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GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IAEtC,OAAO;QACL,OAAO,EAAE,IAAI;QACb,KAAK;KACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Utility functions for handling priority filters.
|
|
3
|
+
*
|
|
4
|
+
* This module provides utility functions for working with priority filters
|
|
5
|
+
* in interactive mode, including extracting priority filters from command line
|
|
6
|
+
* arguments and review options.
|
|
7
|
+
*/
|
|
8
|
+
import type { ReviewOptions } from '../types/review';
|
|
9
|
+
import type { PriorityFilter } from '../types/common';
|
|
10
|
+
/**
|
|
11
|
+
* Get the priority filter from command line arguments or options
|
|
12
|
+
*
|
|
13
|
+
* This function extracts the priority filter from either:
|
|
14
|
+
* 1. The options object (if the interactive property is a string)
|
|
15
|
+
* 2. The command line arguments (if --interactive or -i is followed by a priority filter)
|
|
16
|
+
*
|
|
17
|
+
* Priority filters determine which issues to display in interactive mode:
|
|
18
|
+
* - 'h': High priority issues only
|
|
19
|
+
* - 'm': Medium and high priority issues
|
|
20
|
+
* - 'l': Low, medium, and high priority issues
|
|
21
|
+
* - 'a': All issues (including informational)
|
|
22
|
+
*
|
|
23
|
+
* @param options Review options that may contain the priority filter
|
|
24
|
+
* @returns The priority filter (h, m, l, or a) or undefined if not specified
|
|
25
|
+
* @example
|
|
26
|
+
* // With options object
|
|
27
|
+
* const filter = getPriorityFilterFromArgs({ interactive: 'h' });
|
|
28
|
+
* // filter === 'h'
|
|
29
|
+
*
|
|
30
|
+
* // With command line arguments (if process.argv includes '--interactive h')
|
|
31
|
+
* const filter = getPriorityFilterFromArgs();
|
|
32
|
+
* // filter === 'h'
|
|
33
|
+
*/
|
|
34
|
+
export declare function getPriorityFilterFromArgs(options?: ReviewOptions): PriorityFilter | undefined;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Utility functions for handling priority filters.
|
|
4
|
+
*
|
|
5
|
+
* This module provides utility functions for working with priority filters
|
|
6
|
+
* in interactive mode, including extracting priority filters from command line
|
|
7
|
+
* arguments and review options.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getPriorityFilterFromArgs = getPriorityFilterFromArgs;
|
|
11
|
+
/**
|
|
12
|
+
* Get the priority filter from command line arguments or options
|
|
13
|
+
*
|
|
14
|
+
* This function extracts the priority filter from either:
|
|
15
|
+
* 1. The options object (if the interactive property is a string)
|
|
16
|
+
* 2. The command line arguments (if --interactive or -i is followed by a priority filter)
|
|
17
|
+
*
|
|
18
|
+
* Priority filters determine which issues to display in interactive mode:
|
|
19
|
+
* - 'h': High priority issues only
|
|
20
|
+
* - 'm': Medium and high priority issues
|
|
21
|
+
* - 'l': Low, medium, and high priority issues
|
|
22
|
+
* - 'a': All issues (including informational)
|
|
23
|
+
*
|
|
24
|
+
* @param options Review options that may contain the priority filter
|
|
25
|
+
* @returns The priority filter (h, m, l, or a) or undefined if not specified
|
|
26
|
+
* @example
|
|
27
|
+
* // With options object
|
|
28
|
+
* const filter = getPriorityFilterFromArgs({ interactive: 'h' });
|
|
29
|
+
* // filter === 'h'
|
|
30
|
+
*
|
|
31
|
+
* // With command line arguments (if process.argv includes '--interactive h')
|
|
32
|
+
* const filter = getPriorityFilterFromArgs();
|
|
33
|
+
* // filter === 'h'
|
|
34
|
+
*/
|
|
35
|
+
function getPriorityFilterFromArgs(options) {
|
|
36
|
+
// First check if the interactive option is a string (priority filter)
|
|
37
|
+
if (options &&
|
|
38
|
+
typeof options.interactive === 'string' &&
|
|
39
|
+
['h', 'm', 'l', 'a'].includes(options.interactive)) {
|
|
40
|
+
return options.interactive;
|
|
41
|
+
}
|
|
42
|
+
// Otherwise check if there's a priority filter argument after --interactive
|
|
43
|
+
const args = process.argv;
|
|
44
|
+
const interactiveIndex = args.findIndex((arg) => arg === '--interactive' || arg === '-i');
|
|
45
|
+
if (interactiveIndex !== -1 && interactiveIndex < args.length - 1) {
|
|
46
|
+
const nextArg = args[interactiveIndex + 1];
|
|
47
|
+
// Check if the next argument is a priority filter and not another option
|
|
48
|
+
if (['h', 'm', 'l', 'a'].includes(nextArg) && !nextArg.startsWith('-')) {
|
|
49
|
+
return nextArg;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=priorityFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priorityFilter.js","sourceRoot":"","sources":["../../src/utils/priorityFilter.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AA6BH,8DAuBC;AA/CD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAgB,yBAAyB,CAAC,OAAuB;IAC/D,sEAAsE;IACtE,IACE,OAAO;QACP,OAAO,OAAO,CAAC,WAAW,KAAK,QAAQ;QACvC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,EAClD,CAAC;QACD,OAAO,OAAO,CAAC,WAA6B,CAAC;IAC/C,CAAC;IAED,4EAA4E;IAC5E,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1B,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,eAAe,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC;IAE1F,IAAI,gBAAgB,KAAK,CAAC,CAAC,IAAI,gBAAgB,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAC;QAC3C,yEAAyE;QACzE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACvE,OAAO,OAAyB,CAAC;QACnC,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Utilities for reading and processing project documentation.
|
|
3
|
+
*
|
|
4
|
+
* This module provides functionality for reading and processing project documentation
|
|
5
|
+
* files like README.md, PROJECT.md, and PROGRESS.md. These files provide important
|
|
6
|
+
* context for code reviews, helping the AI model understand the project's purpose,
|
|
7
|
+
* structure, and current state.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Project documentation interface
|
|
11
|
+
*/
|
|
12
|
+
export interface ProjectDocs {
|
|
13
|
+
readme?: string;
|
|
14
|
+
project?: string;
|
|
15
|
+
progress?: string;
|
|
16
|
+
contributing?: string;
|
|
17
|
+
architecture?: string;
|
|
18
|
+
custom?: Record<string, string>;
|
|
19
|
+
metadata?: Record<string, string>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Read project documentation files
|
|
23
|
+
* @param projectDir Project directory
|
|
24
|
+
* @returns Project documentation
|
|
25
|
+
*/
|
|
26
|
+
export declare function readProjectDocs(projectDir: string): Promise<ProjectDocs>;
|
|
27
|
+
/**
|
|
28
|
+
* Add metadata to project documentation
|
|
29
|
+
* @param docs Project documentation object
|
|
30
|
+
* @param key Metadata key
|
|
31
|
+
* @param value Metadata value
|
|
32
|
+
* @returns Project documentation with added metadata
|
|
33
|
+
*/
|
|
34
|
+
export declare function addMetadataToProjectDocs(docs: ProjectDocs, key: string, value: string): ProjectDocs;
|
|
35
|
+
/**
|
|
36
|
+
* Format project documentation for inclusion in prompts
|
|
37
|
+
* @param docs Project documentation
|
|
38
|
+
* @returns Formatted documentation string
|
|
39
|
+
*/
|
|
40
|
+
export declare function formatProjectDocs(docs: ProjectDocs): string;
|
|
41
|
+
/**
|
|
42
|
+
* Add project documentation to a prompt
|
|
43
|
+
* @param prompt The prompt to add documentation to
|
|
44
|
+
* @param docs Project documentation object
|
|
45
|
+
* @returns The prompt with documentation added
|
|
46
|
+
*/
|
|
47
|
+
export declare function addProjectDocsToPrompt(prompt: string, docs: ProjectDocs): string;
|