codereview-aia 0.2.1 → 0.2.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.d.ts +1 -0
- package/dist/index.js +1 -7
- package/dist/index.js.map +1 -1
- package/dist/runtime/api/batcher.d.ts +20 -0
- package/dist/runtime/api/batcher.js +52 -0
- package/dist/runtime/api/batcher.js.map +1 -0
- package/dist/runtime/api/edgeClient.d.ts +102 -0
- package/dist/runtime/api/edgeClient.js +162 -0
- package/dist/runtime/api/edgeClient.js.map +1 -0
- package/dist/runtime/api/index.d.ts +2 -0
- package/dist/runtime/api/index.js +9 -0
- package/dist/runtime/api/index.js.map +1 -0
- package/dist/runtime/cliEntry.js +24 -76
- package/dist/runtime/cliEntry.js.map +1 -1
- package/dist/runtime/errors.d.ts +13 -3
- package/dist/runtime/errors.js +31 -8
- package/dist/runtime/errors.js.map +1 -1
- package/dist/runtime/llm/index.d.ts +1 -0
- package/dist/runtime/llm/index.js +6 -0
- package/dist/runtime/llm/index.js.map +1 -0
- package/dist/runtime/llm/openRouterClient.d.ts +13 -0
- package/dist/runtime/llm/openRouterClient.js +187 -0
- package/dist/runtime/llm/openRouterClient.js.map +1 -0
- package/dist/runtime/phpFileResolver.d.ts +14 -0
- package/dist/runtime/phpFileResolver.js +231 -0
- package/dist/runtime/phpFileResolver.js.map +1 -0
- package/dist/runtime/phpcsParser.d.ts +10 -0
- package/dist/runtime/phpcsParser.js +35 -0
- package/dist/runtime/phpcsParser.js.map +1 -0
- package/dist/runtime/phpcsRunner.d.ts +32 -0
- package/dist/runtime/phpcsRunner.js +62 -0
- package/dist/runtime/phpcsRunner.js.map +1 -0
- package/dist/runtime/reportWriter.d.ts +17 -0
- package/dist/runtime/reportWriter.js +80 -0
- package/dist/runtime/reportWriter.js.map +1 -0
- package/dist/runtime/reviewPipeline.d.ts +14 -36
- package/dist/runtime/reviewPipeline.js +146 -199
- package/dist/runtime/reviewPipeline.js.map +1 -1
- package/dist/runtime/ui/RuntimeApp.js +23 -154
- package/dist/runtime/ui/RuntimeApp.js.map +1 -1
- package/dist/runtime/ui/screens/AuthScreen.d.ts +2 -3
- package/dist/runtime/ui/screens/AuthScreen.js +7 -53
- package/dist/runtime/ui/screens/AuthScreen.js.map +1 -1
- package/dist/runtime/ui/screens/ModeSelection.d.ts +1 -2
- package/dist/runtime/ui/screens/ModeSelection.js +14 -139
- package/dist/runtime/ui/screens/ModeSelection.js.map +1 -1
- package/dist/runtime/ui/screens/ProgressScreen.d.ts +5 -13
- package/dist/runtime/ui/screens/ProgressScreen.js +24 -61
- package/dist/runtime/ui/screens/ProgressScreen.js.map +1 -1
- package/dist/runtime/ui/screens/ResultsScreen.js +7 -17
- package/dist/runtime/ui/screens/ResultsScreen.js.map +1 -1
- package/package.json +4 -44
- 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/static/wpPhpcsRunner.d.ts +0 -11
- package/dist/analysis/static/wpPhpcsRunner.js +0 -219
- package/dist/analysis/static/wpPhpcsRunner.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 -580
- 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 -37
- package/dist/clients/utils/promptFormatter.js +0 -186
- 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 -184
- 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 -307
- package/dist/core/ConfigurationService.js +0 -516
- 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 -164
- 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 -354
- 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/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/fileCollector.d.ts +0 -14
- package/dist/runtime/fileCollector.js +0 -383
- 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/batchStreamer.d.ts +0 -54
- package/dist/runtime/preprod/batchStreamer.js +0 -159
- package/dist/runtime/preprod/batchStreamer.js.map +0 -1
- package/dist/runtime/preprod/crEdgeServiceClient.d.ts +0 -30
- package/dist/runtime/preprod/crEdgeServiceClient.js +0 -133
- package/dist/runtime/preprod/crEdgeServiceClient.js.map +0 -1
- package/dist/runtime/preprod/progressTracker.d.ts +0 -21
- package/dist/runtime/preprod/progressTracker.js +0 -80
- package/dist/runtime/preprod/progressTracker.js.map +0 -1
- package/dist/runtime/preprod/webCheck.d.ts +0 -1
- package/dist/runtime/preprod/webCheck.js +0 -102
- 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 -17
- package/dist/runtime/reporting/markdownReportBuilder.js +0 -154
- 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/runAiCodeReview.d.ts +0 -36
- package/dist/runtime/runAiCodeReview.js +0 -409
- 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/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 -318
- 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 -850
- 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 -350
- 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/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 -141
- 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
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runPhpcs = runPhpcs;
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const execa_1 = require("execa");
|
|
7
|
+
const errors_1 = require("./errors");
|
|
8
|
+
async function runPhpcs(files, options) {
|
|
9
|
+
const phpcsPath = (0, node_path_1.resolve)(options.workspaceRoot, 'vendor', 'bin', 'phpcs');
|
|
10
|
+
if (!(0, node_fs_1.existsSync)(phpcsPath)) {
|
|
11
|
+
throw new errors_1.MissingPhpcsError(options.workspaceRoot, phpcsPath);
|
|
12
|
+
}
|
|
13
|
+
const chunkSize = options.chunkSize ?? 150;
|
|
14
|
+
const batches = [];
|
|
15
|
+
for (let i = 0; i < files.length; i += chunkSize) {
|
|
16
|
+
batches.push(files.slice(i, i + chunkSize));
|
|
17
|
+
}
|
|
18
|
+
const merged = {
|
|
19
|
+
totals: { errors: 0, warnings: 0, fixable: 0 },
|
|
20
|
+
files: {},
|
|
21
|
+
};
|
|
22
|
+
for (let index = 0; index < batches.length; index += 1) {
|
|
23
|
+
const batch = batches[index];
|
|
24
|
+
options.onBatch?.({ batchIndex: index + 1, totalBatches: batches.length });
|
|
25
|
+
const { stdout } = await (0, execa_1.execa)(phpcsPath, ['--standard=PSR12', '--report=json', ...batch], {
|
|
26
|
+
cwd: options.workspaceRoot,
|
|
27
|
+
reject: false,
|
|
28
|
+
});
|
|
29
|
+
if (!stdout || !stdout.trim()) {
|
|
30
|
+
throw new errors_1.InvalidPhpcsJsonError();
|
|
31
|
+
}
|
|
32
|
+
let parsed;
|
|
33
|
+
try {
|
|
34
|
+
parsed = JSON.parse(stdout);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
throw new errors_1.InvalidPhpcsJsonError(error instanceof Error ? error.message : undefined);
|
|
38
|
+
}
|
|
39
|
+
merged.totals.errors += parsed.totals?.errors ?? 0;
|
|
40
|
+
merged.totals.warnings += parsed.totals?.warnings ?? 0;
|
|
41
|
+
merged.totals.fixable += parsed.totals?.fixable ?? 0;
|
|
42
|
+
if (parsed.files) {
|
|
43
|
+
for (const [filePath, fileReport] of Object.entries(parsed.files)) {
|
|
44
|
+
const existing = merged.files[filePath];
|
|
45
|
+
if (existing) {
|
|
46
|
+
existing.errors += fileReport.errors ?? 0;
|
|
47
|
+
existing.warnings += fileReport.warnings ?? 0;
|
|
48
|
+
existing.messages = [...existing.messages, ...(fileReport.messages ?? [])];
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
merged.files[filePath] = {
|
|
52
|
+
errors: fileReport.errors ?? 0,
|
|
53
|
+
warnings: fileReport.warnings ?? 0,
|
|
54
|
+
messages: fileReport.messages ? [...fileReport.messages] : [],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return merged;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E,CAAC;oBACb,QAAQ,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC,CAAC;oBAC1C,QAAQ,CAAC,QAAQ,IAAI,UAAU,CAAC,QAAQ,IAAI,CAAC,CAAC;oBAC9C,QAAQ,CAAC,QAAQ,GAAG,CAAC,GAAG,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,UAAU,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC;gBAC7E,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG;wBACvB,MAAM,EAAE,UAAU,CAAC,MAAM,IAAI,CAAC;wBAC9B,QAAQ,EAAE,UAAU,CAAC,QAAQ,IAAI,CAAC;wBAClC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;qBAC9D,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ParsedPhpcsReport } from './phpcsParser';
|
|
2
|
+
export interface ReportWriterOptions {
|
|
3
|
+
workspaceRoot: string;
|
|
4
|
+
outDir: string;
|
|
5
|
+
repoName: string;
|
|
6
|
+
mode: 'uncommitted' | 'prod';
|
|
7
|
+
filesReviewed: number;
|
|
8
|
+
generatedAt: Date;
|
|
9
|
+
}
|
|
10
|
+
export interface ReportWriteResult {
|
|
11
|
+
reportPath: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function writeMarkdownReport(parsed: ParsedPhpcsReport, options: ReportWriterOptions): ReportWriteResult;
|
|
14
|
+
export declare function writeLlmReport(markdownContent: string, options: Omit<ReportWriterOptions, 'filesReviewed'>): string;
|
|
15
|
+
export declare function resolveOutputDirectory(root: string, outputDir: string): string;
|
|
16
|
+
export declare function formatReportFileName(repo: string, date: Date): string;
|
|
17
|
+
export declare function formatTimestamp(date: Date): string;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.writeMarkdownReport = writeMarkdownReport;
|
|
4
|
+
exports.writeLlmReport = writeLlmReport;
|
|
5
|
+
exports.resolveOutputDirectory = resolveOutputDirectory;
|
|
6
|
+
exports.formatReportFileName = formatReportFileName;
|
|
7
|
+
exports.formatTimestamp = formatTimestamp;
|
|
8
|
+
const node_fs_1 = require("node:fs");
|
|
9
|
+
const node_path_1 = require("node:path");
|
|
10
|
+
function writeMarkdownReport(parsed, options) {
|
|
11
|
+
const outputDir = resolveOutputDirectory(options.workspaceRoot, options.outDir);
|
|
12
|
+
(0, node_fs_1.mkdirSync)(outputDir, { recursive: true });
|
|
13
|
+
const reportName = formatReportFileName(options.repoName, options.generatedAt);
|
|
14
|
+
const reportPath = (0, node_path_1.join)(outputDir, reportName);
|
|
15
|
+
const lines = [];
|
|
16
|
+
lines.push(`# PHPCS Report — ${formatTimestamp(options.generatedAt)}`);
|
|
17
|
+
lines.push('');
|
|
18
|
+
lines.push(`Repository: ${options.repoName}`);
|
|
19
|
+
lines.push(`Mode: ${options.mode}`);
|
|
20
|
+
lines.push(`Files reviewed: ${options.filesReviewed}`);
|
|
21
|
+
lines.push(`Errors: ${parsed.totals.errors} Warnings: ${parsed.totals.warnings} Fixable: ${parsed.totals.fixable}`);
|
|
22
|
+
lines.push('');
|
|
23
|
+
lines.push('## Issues');
|
|
24
|
+
const fileEntries = Object.entries(parsed.issuesByFile);
|
|
25
|
+
if (fileEntries.length === 0) {
|
|
26
|
+
lines.push('No issues reported.');
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
for (const [filePath, issues] of fileEntries) {
|
|
30
|
+
lines.push(filePath);
|
|
31
|
+
for (const issue of issues) {
|
|
32
|
+
lines.push(formatIssue(issue));
|
|
33
|
+
}
|
|
34
|
+
lines.push('');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
(0, node_fs_1.writeFileSync)(reportPath, lines.join('\n'), 'utf8');
|
|
38
|
+
return { reportPath };
|
|
39
|
+
}
|
|
40
|
+
function writeLlmReport(markdownContent, options) {
|
|
41
|
+
const outputDir = resolveOutputDirectory(options.workspaceRoot, options.outDir);
|
|
42
|
+
(0, node_fs_1.mkdirSync)(outputDir, { recursive: true });
|
|
43
|
+
const reportName = formatReportFileName(options.repoName, options.generatedAt).replace('.md', '-llm.md');
|
|
44
|
+
const reportPath = (0, node_path_1.join)(outputDir, reportName);
|
|
45
|
+
// Add header with metadata
|
|
46
|
+
const header = `<!--
|
|
47
|
+
Generated by cr-aia with LLM analysis
|
|
48
|
+
Repository: ${options.repoName}
|
|
49
|
+
Mode: ${options.mode}
|
|
50
|
+
Generated at: ${formatTimestamp(options.generatedAt)}
|
|
51
|
+
-->
|
|
52
|
+
|
|
53
|
+
`;
|
|
54
|
+
(0, node_fs_1.writeFileSync)(reportPath, header + markdownContent, 'utf8');
|
|
55
|
+
return reportPath;
|
|
56
|
+
}
|
|
57
|
+
function resolveOutputDirectory(root, outputDir) {
|
|
58
|
+
if (outputDir.startsWith('/')) {
|
|
59
|
+
return outputDir;
|
|
60
|
+
}
|
|
61
|
+
return (0, node_path_1.resolve)(root, outputDir);
|
|
62
|
+
}
|
|
63
|
+
function formatReportFileName(repo, date) {
|
|
64
|
+
const sanitizedRepo = repo.replace(/[^a-zA-Z0-9_-]+/g, '-').replace(/-+/g, '-');
|
|
65
|
+
const pad = (value) => value.toString().padStart(2, '0');
|
|
66
|
+
const day = pad(date.getDate());
|
|
67
|
+
const month = pad(date.getMonth() + 1);
|
|
68
|
+
const year = date.getFullYear();
|
|
69
|
+
const hours = pad(date.getHours());
|
|
70
|
+
const minutes = pad(date.getMinutes());
|
|
71
|
+
return `cr-${sanitizedRepo}-${day}-${month}-${year}-${hours}-${minutes}.md`;
|
|
72
|
+
}
|
|
73
|
+
function formatTimestamp(date) {
|
|
74
|
+
return date.toISOString().replace('T', ' ').replace('Z', ' UTC');
|
|
75
|
+
}
|
|
76
|
+
function formatIssue(issue) {
|
|
77
|
+
const level = issue.type === 'ERROR' ? 'ERROR' : 'WARNING';
|
|
78
|
+
return `- [${level}] ${issue.line}:${issue.column} ${issue.message} (${issue.source})`;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=reportWriter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reportWriter.js","sourceRoot":"","sources":["../../src/runtime/reportWriter.ts"],"names":[],"mappings":";;AAiBA,kDAkCC;AAED,wCAsBC;AAED,wDAKC;AAED,oDASC;AAED,0CAEC;AAjGD,qCAAmD;AACnD,yCAAqE;AAgBrE,SAAgB,mBAAmB,CAAC,MAAyB,EAAE,OAA4B;IACzF,MAAM,SAAS,GAAG,sBAAsB,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAChF,IAAA,mBAAS,EAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE1C,MAAM,UAAU,GAAG,oBAAoB,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC/E,MAAM,UAAU,GAAG,IAAA,gBAAQ,EAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAEnD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,oBAAoB,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACvE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,eAAe,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9C,KAAK,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACpC,KAAK,CAAC,IAAI,CAAC,mBAAmB,OAAO,CA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O,GAAG,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACvC,OAAO,MAAM,aAAa,IAAI,GAAG,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC;AAC9E,CAAC;AAED,SAAgB,eAAe,CAAC,IAAU;IACxC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,WAAW,CAAC,KAAiB;IACpC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3D,OAAO,MAAM,KAAK,KAAK,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC;AACzF,CAAC"}
|
|
@@ -1,61 +1,39 @@
|
|
|
1
|
-
import { type FileCollectionMode } from './
|
|
2
|
-
|
|
3
|
-
export type ReviewStage = 'preparing' | 'collecting' | 'reviewing' | 'merging';
|
|
1
|
+
import { type FileCollectionMode } from './phpFileResolver';
|
|
2
|
+
export type ReviewStage = 'collecting' | 'reviewing' | 'analyzing' | 'uploading' | 'done';
|
|
4
3
|
export type ReviewMode = FileCollectionMode;
|
|
5
|
-
export type StreamingPhase = 'idle' | 'buffering' | 'sending' | 'success' | 'error' | 'creating-run' | 'triggering-webcheck';
|
|
6
4
|
export interface StageUpdate {
|
|
7
5
|
filesFound?: number;
|
|
8
|
-
currentFile?: string;
|
|
9
|
-
fileIndex?: number;
|
|
10
6
|
totalFiles?: number;
|
|
11
|
-
filesReviewed?: number;
|
|
12
7
|
uncommittedFiles?: number;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
streamingBatchTotal?: number;
|
|
17
|
-
streamingBatchesCompleted?: number;
|
|
18
|
-
streamingBufferedFiles?: number;
|
|
19
|
-
streamingLastError?: string;
|
|
20
|
-
streamingRetryAttempt?: number;
|
|
8
|
+
relatedFiles?: number;
|
|
9
|
+
batchIndex?: number;
|
|
10
|
+
batchTotal?: number;
|
|
21
11
|
}
|
|
22
12
|
export interface ReviewOptions {
|
|
23
|
-
model: string;
|
|
24
13
|
outDir: string;
|
|
25
14
|
debug?: boolean;
|
|
26
15
|
mode?: ReviewMode;
|
|
27
|
-
|
|
28
|
-
preprodRunId?: string;
|
|
29
|
-
recipientEmail?: string;
|
|
16
|
+
includeRelated?: boolean;
|
|
30
17
|
onStage?: (stage: ReviewStage, info?: StageUpdate) => void;
|
|
31
|
-
forceWordPress?: boolean;
|
|
32
|
-
disableWordPress?: boolean;
|
|
33
|
-
wordpressPhpcsEnabled?: boolean;
|
|
34
|
-
wordpressPhpcsPath?: string;
|
|
35
|
-
wordpressPhpcsStandard?: string;
|
|
36
|
-
wordpressPhpcsTestVersion?: string;
|
|
37
|
-
startGroup?: number;
|
|
38
18
|
}
|
|
39
19
|
export interface ReviewTotals {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
low: number;
|
|
20
|
+
errors: number;
|
|
21
|
+
warnings: number;
|
|
22
|
+
fixable: number;
|
|
44
23
|
}
|
|
45
24
|
export interface ReviewResult {
|
|
46
25
|
totals: ReviewTotals;
|
|
47
|
-
findings: any[];
|
|
48
26
|
duration: number;
|
|
49
27
|
repo: string;
|
|
50
28
|
filesReviewed: number;
|
|
51
29
|
fileBreakdown?: {
|
|
52
30
|
uncommitted: number;
|
|
53
|
-
|
|
31
|
+
related: number;
|
|
54
32
|
};
|
|
55
|
-
estimatedCostUSD?: number;
|
|
56
|
-
reportSummary?: string;
|
|
57
33
|
reportPath?: string;
|
|
58
|
-
|
|
59
|
-
|
|
34
|
+
llmAnalysisUsed?: boolean;
|
|
35
|
+
llmError?: string;
|
|
36
|
+
prodRunId?: string;
|
|
37
|
+
prodStatus?: string;
|
|
60
38
|
}
|
|
61
39
|
export declare function executeReview(options: ReviewOptions): Promise<ReviewResult>;
|
|
@@ -6,226 +6,173 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.executeReview = executeReview;
|
|
7
7
|
const node_fs_1 = require("node:fs");
|
|
8
8
|
const node_path_1 = require("node:path");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const summaryGenerator_1 = require("./reporting/summaryGenerator");
|
|
9
|
+
const node_child_process_1 = require("node:child_process");
|
|
10
|
+
const phpFileResolver_1 = require("./phpFileResolver");
|
|
11
|
+
const phpcsRunner_1 = require("./phpcsRunner");
|
|
12
|
+
const phpcsParser_1 = require("./phpcsParser");
|
|
13
|
+
const reportWriter_1 = require("./reportWriter");
|
|
14
|
+
const llm_1 = require("./llm");
|
|
15
|
+
const edgeClient_1 = require("./api/edgeClient");
|
|
16
|
+
const batcher_1 = require("./api/batcher");
|
|
17
|
+
const errors_1 = require("./errors");
|
|
19
18
|
const logger_1 = __importDefault(require("../utils/logger"));
|
|
20
|
-
const wpPhpcsRunner_1 = require("../analysis/static/wpPhpcsRunner");
|
|
21
|
-
const batchStreamer_1 = require("./preprod/batchStreamer");
|
|
22
19
|
async function executeReview(options) {
|
|
23
|
-
const {
|
|
20
|
+
const { outDir, debug = false, onStage, mode = 'uncommitted', includeRelated = false } = options;
|
|
24
21
|
onStage?.('collecting');
|
|
25
|
-
logger_1.default.info('Collecting files for review', { mode, workspace: process.cwd() });
|
|
26
|
-
const {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
throw new Error('No files to review');
|
|
22
|
+
logger_1.default.info('Collecting PHP files for review', { mode, includeRelated, workspace: process.cwd() });
|
|
23
|
+
const { files, stats } = await (0, phpFileResolver_1.collectPhpFiles)({ mode, includeRelated });
|
|
24
|
+
if (files.length === 0) {
|
|
25
|
+
throw new errors_1.NoPhpFilesError();
|
|
30
26
|
}
|
|
31
27
|
onStage?.('collecting', {
|
|
32
|
-
filesFound:
|
|
28
|
+
filesFound: files.length,
|
|
29
|
+
totalFiles: files.length,
|
|
33
30
|
uncommittedFiles: stats.uncommitted,
|
|
34
|
-
|
|
31
|
+
relatedFiles: stats.related,
|
|
35
32
|
});
|
|
36
|
-
logger_1.default.info('File collection complete', { fileCount });
|
|
37
33
|
const workspaceRoot = process.cwd();
|
|
38
|
-
const repoRoot = await resolveRepoRoot();
|
|
39
|
-
const manifest = (0, manifest_1.loadManifest)(workspaceRoot);
|
|
40
|
-
const tempDir = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), 'cr-aia-'));
|
|
41
|
-
const rawOutDir = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), 'cr-aia-raw-'));
|
|
42
|
-
const manifestPath = (0, node_path_1.join)(tempDir, 'ai-code-review.json');
|
|
43
|
-
(0, node_fs_1.writeFileSync)(manifestPath, JSON.stringify(manifest, null, 2));
|
|
44
|
-
(0, proxyEnvironment_1.ensureProxyEnvironmentInitialized)(repoRoot);
|
|
45
|
-
const finalOutDir = resolveOutputDirectory(workspaceRoot, outDir);
|
|
46
|
-
const start = Date.now();
|
|
47
34
|
const repoName = (0, node_path_1.basename)(workspaceRoot) || 'workspace';
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
// Not a git repo or detached HEAD
|
|
63
|
-
}
|
|
64
|
-
const stageState = {
|
|
65
|
-
filesFound: fileCount,
|
|
66
|
-
totalFiles: fileCount,
|
|
67
|
-
filesReviewed: 0,
|
|
68
|
-
uncommittedFiles: stats.uncommitted,
|
|
69
|
-
contextFiles: stats.context,
|
|
70
|
-
};
|
|
71
|
-
let filesReviewedCount = 0;
|
|
72
|
-
const emitReviewStage = () => onStage?.('reviewing', { ...stageState });
|
|
73
|
-
const handleStreamingStatus = (update) => {
|
|
74
|
-
stageState.streamingPhase = update.phase;
|
|
75
|
-
stageState.streamingBatchOrdinal = update.batchOrdinal;
|
|
76
|
-
stageState.streamingBatchTotal = update.totalBatches;
|
|
77
|
-
stageState.streamingBatchesCompleted = update.batchesCompleted;
|
|
78
|
-
stageState.streamingBufferedFiles = update.bufferedFiles;
|
|
79
|
-
stageState.streamingLastError = update.error;
|
|
80
|
-
stageState.streamingRetryAttempt = update.attempt;
|
|
81
|
-
emitReviewStage();
|
|
82
|
-
};
|
|
83
|
-
const batchStreamer = mode === 'preprod'
|
|
84
|
-
? new batchStreamer_1.BatchStreamer({
|
|
85
|
-
initialRunId: options.preprodRunId,
|
|
86
|
-
repo: repoName,
|
|
87
|
-
branch,
|
|
88
|
-
commitSha,
|
|
89
|
-
targetUrl: options.preprodTargetUrl,
|
|
90
|
-
recipientEmail: options.recipientEmail,
|
|
91
|
-
totalFiles: fileCount,
|
|
92
|
-
onStatus: handleStreamingStatus,
|
|
93
|
-
})
|
|
94
|
-
: null;
|
|
95
|
-
let ensuredRunId = options.preprodRunId;
|
|
96
|
-
if (mode === 'preprod' && batchStreamer) {
|
|
97
|
-
ensuredRunId = await batchStreamer.primeRun();
|
|
98
|
-
}
|
|
99
|
-
try {
|
|
100
|
-
emitReviewStage();
|
|
101
|
-
const { reports, wordpressReport } = await (0, runAiCodeReview_1.runAiCodeReview)(targets, context, {
|
|
102
|
-
provider: 'openrouter',
|
|
103
|
-
type: 'comprehensive',
|
|
104
|
-
outDir: rawOutDir,
|
|
105
|
-
format: 'json',
|
|
106
|
-
model,
|
|
107
|
-
configPath: manifestPath,
|
|
35
|
+
const start = Date.now();
|
|
36
|
+
onStage?.('reviewing', { totalFiles: files.length });
|
|
37
|
+
const report = await (0, phpcsRunner_1.runPhpcs)(files, {
|
|
38
|
+
workspaceRoot,
|
|
39
|
+
onBatch: (info) => onStage?.('reviewing', { totalFiles: files.length, ...info }),
|
|
40
|
+
});
|
|
41
|
+
if (mode === 'prod') {
|
|
42
|
+
return executeProdReview({
|
|
43
|
+
report,
|
|
44
|
+
workspaceRoot,
|
|
45
|
+
repoName,
|
|
46
|
+
files,
|
|
47
|
+
onStage,
|
|
48
|
+
outDir,
|
|
108
49
|
debug,
|
|
109
|
-
forceWordPress,
|
|
110
|
-
disableWordPress,
|
|
111
|
-
wordpressPhpcsEnabled,
|
|
112
|
-
wordpressPhpcsPath,
|
|
113
|
-
wordpressPhpcsStandard,
|
|
114
|
-
wordpressPhpcsTestVersion,
|
|
115
|
-
runContext: {
|
|
116
|
-
repoName,
|
|
117
|
-
reviewMode: mode,
|
|
118
|
-
totalFiles: fileCount,
|
|
119
|
-
uncommittedFiles: stats.uncommitted,
|
|
120
|
-
contextFiles: stats.context,
|
|
121
|
-
},
|
|
122
|
-
onFileProgress: ({ file, index, total }) => {
|
|
123
|
-
stageState.currentFile = file;
|
|
124
|
-
stageState.fileIndex = index;
|
|
125
|
-
stageState.totalFiles = total;
|
|
126
|
-
filesReviewedCount = Math.min(fileCount, Math.max(filesReviewedCount, index));
|
|
127
|
-
stageState.filesReviewed = filesReviewedCount;
|
|
128
|
-
emitReviewStage();
|
|
129
|
-
},
|
|
130
|
-
onStreamingFiles: batchStreamer ? (files) => batchStreamer.addFiles(files) : undefined,
|
|
131
|
-
startGroup: options.startGroup,
|
|
132
|
-
preprodRunId: ensuredRunId,
|
|
133
50
|
});
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
51
|
+
}
|
|
52
|
+
// LLM analysis for uncommitted mode
|
|
53
|
+
let llmResult = null;
|
|
54
|
+
if (mode === 'uncommitted') {
|
|
55
|
+
onStage?.('analyzing');
|
|
56
|
+
// Read file contents for files with issues
|
|
57
|
+
const fileContents = new Map();
|
|
58
|
+
for (const filePath of Object.keys(report.files)) {
|
|
59
|
+
try {
|
|
60
|
+
const content = (0, node_fs_1.readFileSync)(filePath, 'utf8');
|
|
61
|
+
fileContents.set(filePath, content);
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
logger_1.default.debug(`Failed to read file ${filePath} for LLM analysis`, { error: err });
|
|
143
65
|
}
|
|
144
|
-
return {
|
|
145
|
-
totals: severityTotals,
|
|
146
|
-
findings: [],
|
|
147
|
-
duration,
|
|
148
|
-
repo,
|
|
149
|
-
filesReviewed,
|
|
150
|
-
fileBreakdown: { uncommitted: stats.uncommitted, context: stats.context },
|
|
151
|
-
estimatedCostUSD: collected.estimatedCostUSD,
|
|
152
|
-
finalizationByEdgeService: true,
|
|
153
|
-
wordpressReport,
|
|
154
|
-
};
|
|
155
66
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const reportTimestamp = new Date();
|
|
162
|
-
const collected = (0, reportDataCollector_1.collectReportData)(reports || []);
|
|
163
|
-
const severityTotals = totals || collected.totals;
|
|
164
|
-
const markdownDraft = (0, markdownReportBuilder_1.buildMarkdownReport)({
|
|
165
|
-
repoName: repo,
|
|
166
|
-
generatedAt: reportTimestamp,
|
|
167
|
-
durationSeconds: duration,
|
|
168
|
-
filesReviewed,
|
|
169
|
-
totals: severityTotals,
|
|
170
|
-
tokenStats: collected.tokenStats,
|
|
171
|
-
estimatedCostUSD: collected.estimatedCostUSD,
|
|
172
|
-
issueGroups: collected.groupedIssues,
|
|
173
|
-
wordpressReport,
|
|
67
|
+
llmResult = await (0, llm_1.analyzeWithLlm)({
|
|
68
|
+
phpcsJson: report,
|
|
69
|
+
fileContents,
|
|
70
|
+
mode,
|
|
71
|
+
totalFiles: files.length
|
|
174
72
|
});
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
73
|
+
}
|
|
74
|
+
const parsed = (0, phpcsParser_1.parsePhpcsReport)(report, workspaceRoot);
|
|
75
|
+
const duration = Math.round((Date.now() - start) / 1000);
|
|
76
|
+
let finalReportPath;
|
|
77
|
+
if (llmResult?.success) {
|
|
78
|
+
finalReportPath = (0, reportWriter_1.writeLlmReport)(llmResult.markdownReport, {
|
|
79
|
+
workspaceRoot,
|
|
80
|
+
outDir,
|
|
81
|
+
repoName,
|
|
82
|
+
mode,
|
|
83
|
+
generatedAt: new Date(),
|
|
181
84
|
});
|
|
182
|
-
const finalMarkdown = (0, markdownReportBuilder_1.injectSummary)(markdownDraft, summary);
|
|
183
|
-
const reportFileName = formatReportFileName(repo, reportTimestamp);
|
|
184
|
-
const reportPath = (0, node_path_1.join)(finalOutDir, reportFileName);
|
|
185
|
-
(0, node_fs_1.writeFileSync)(reportPath, finalMarkdown, 'utf-8');
|
|
186
|
-
if (wordpressReport) {
|
|
187
|
-
logger_1.default.info((0, wpPhpcsRunner_1.summarizeWordPressReport)(wordpressReport, 6, workspaceRoot));
|
|
188
|
-
}
|
|
189
|
-
return {
|
|
190
|
-
totals: severityTotals,
|
|
191
|
-
findings,
|
|
192
|
-
duration,
|
|
193
|
-
repo,
|
|
194
|
-
filesReviewed,
|
|
195
|
-
fileBreakdown: { uncommitted: stats.uncommitted, context: stats.context },
|
|
196
|
-
reportSummary: summary,
|
|
197
|
-
reportPath,
|
|
198
|
-
wordpressReport,
|
|
199
|
-
};
|
|
200
85
|
}
|
|
201
|
-
|
|
202
|
-
(0,
|
|
203
|
-
|
|
86
|
+
else {
|
|
87
|
+
const { reportPath } = (0, reportWriter_1.writeMarkdownReport)(parsed, {
|
|
88
|
+
workspaceRoot,
|
|
89
|
+
outDir,
|
|
90
|
+
repoName,
|
|
91
|
+
mode,
|
|
92
|
+
filesReviewed: files.length,
|
|
93
|
+
generatedAt: new Date(),
|
|
94
|
+
});
|
|
95
|
+
finalReportPath = reportPath;
|
|
96
|
+
}
|
|
97
|
+
onStage?.('done');
|
|
98
|
+
if (debug) {
|
|
99
|
+
logger_1.default.info('PHPCS run complete', { duration, filesReviewed: files.length });
|
|
204
100
|
}
|
|
101
|
+
return {
|
|
102
|
+
totals: parsed.totals,
|
|
103
|
+
duration,
|
|
104
|
+
repo: repoName,
|
|
105
|
+
filesReviewed: files.length,
|
|
106
|
+
fileBreakdown: mode === 'uncommitted' ? { uncommitted: stats.uncommitted, related: stats.related } : undefined,
|
|
107
|
+
reportPath: finalReportPath,
|
|
108
|
+
llmAnalysisUsed: llmResult?.success ?? false,
|
|
109
|
+
llmError: llmResult?.error,
|
|
110
|
+
};
|
|
205
111
|
}
|
|
206
|
-
async function
|
|
112
|
+
async function executeProdReview(params) {
|
|
113
|
+
const { report, workspaceRoot, repoName, files, onStage, outDir } = params;
|
|
114
|
+
const start = Date.now();
|
|
115
|
+
// 1. Create edge client
|
|
116
|
+
const client = (0, edgeClient_1.createEdgeClient)();
|
|
117
|
+
// 2. Get git info
|
|
118
|
+
let branch;
|
|
119
|
+
let commitSha;
|
|
207
120
|
try {
|
|
208
|
-
|
|
209
|
-
|
|
121
|
+
branch = (0, node_child_process_1.execSync)('git rev-parse --abbrev-ref HEAD', { cwd: workspaceRoot, encoding: 'utf8' }).trim();
|
|
122
|
+
commitSha = (0, node_child_process_1.execSync)('git rev-parse HEAD', { cwd: workspaceRoot, encoding: 'utf8' }).trim();
|
|
210
123
|
}
|
|
211
|
-
catch {
|
|
212
|
-
|
|
124
|
+
catch (err) {
|
|
125
|
+
logger_1.default.debug('Failed to get git info for prod review', { error: err });
|
|
213
126
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
127
|
+
// 3. Create run
|
|
128
|
+
onStage?.('uploading', { batchIndex: 0, batchTotal: 0 });
|
|
129
|
+
const recipientEmail = process.env['CR_RECIPIENT_EMAIL'];
|
|
130
|
+
const runResponse = await client.createRun({
|
|
131
|
+
repo: repoName,
|
|
132
|
+
branch,
|
|
133
|
+
commit_sha: commitSha,
|
|
134
|
+
recipient_email: recipientEmail,
|
|
135
|
+
metadata: {
|
|
136
|
+
mode: 'prod',
|
|
137
|
+
total_files: files.length,
|
|
138
|
+
phpcs_totals: report.totals,
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
const runId = runResponse.run_id;
|
|
142
|
+
// 4. Create and upload batches
|
|
143
|
+
const batches = (0, batcher_1.createBatches)(report, workspaceRoot);
|
|
144
|
+
for (const batch of batches) {
|
|
145
|
+
onStage?.('uploading', {
|
|
146
|
+
batchIndex: batch.index + 1,
|
|
147
|
+
batchTotal: batches.length
|
|
148
|
+
});
|
|
149
|
+
await client.submitBatch(runId, {
|
|
150
|
+
batch_index: batch.index,
|
|
151
|
+
files: batch.files,
|
|
152
|
+
is_final: batch.isFinal,
|
|
153
|
+
});
|
|
218
154
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
155
|
+
// 5. Parse basic results locally
|
|
156
|
+
const parsed = (0, phpcsParser_1.parsePhpcsReport)(report, workspaceRoot);
|
|
157
|
+
const duration = Math.round((Date.now() - start) / 1000);
|
|
158
|
+
// 6. Write local summary report
|
|
159
|
+
const { reportPath } = (0, reportWriter_1.writeMarkdownReport)(parsed, {
|
|
160
|
+
workspaceRoot,
|
|
161
|
+
outDir,
|
|
162
|
+
repoName,
|
|
163
|
+
mode: 'prod',
|
|
164
|
+
filesReviewed: files.length,
|
|
165
|
+
generatedAt: new Date(),
|
|
166
|
+
});
|
|
167
|
+
onStage?.('done');
|
|
168
|
+
return {
|
|
169
|
+
totals: parsed.totals,
|
|
170
|
+
duration,
|
|
171
|
+
repo: repoName,
|
|
172
|
+
filesReviewed: files.length,
|
|
173
|
+
reportPath,
|
|
174
|
+
prodRunId: runId,
|
|
175
|
+
prodStatus: 'submitted',
|
|
176
|
+
};
|
|
230
177
|
}
|
|
231
178
|
//# sourceMappingURL=reviewPipeline.js.map
|