vibecodingmachine-core 2026.3.14-1528 → 2026.6.17-1835
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/package.json +7 -2
- package/src/agents/Agent.js +1 -1
- package/src/agents/AgentAdditionService.js +1 -1
- package/src/agents/AgentCheckDiscoveryService.js +2 -2
- package/src/agents/AgentCheckService.js +16 -16
- package/src/agents/AgentCheckStatisticsService.js +11 -11
- package/src/agents/AgentInstallationService.js +6 -6
- package/src/agents/AgentSetupService.js +15 -15
- package/src/agents/AgentStatus.js +8 -8
- package/src/agents/AgentVerificationService.js +39 -39
- package/src/agents/ConfigurationSchemaValidator.js +8 -8
- package/src/agents/EnvironmentConfigurationManager.js +28 -28
- package/src/agents/InstallationErrorHandler.js +11 -11
- package/src/agents/InstallationLog.js +18 -18
- package/src/agents/InstallationMethod.js +1 -1
- package/src/agents/InstallationOrchestrator.js +37 -37
- package/src/agents/InstallationProgressReporter.js +13 -13
- package/src/agents/InstallationRetryManager.js +20 -20
- package/src/agents/InstallationType.js +14 -14
- package/src/agents/OperationTypes.js +12 -12
- package/src/agents/PerformanceMetricsCollector.js +59 -59
- package/src/agents/SecurityValidationService.js +17 -17
- package/src/agents/SimpleAgentCheckService.js +79 -74
- package/src/agents/VerificationTest.js +26 -26
- package/src/agents/VerificationType.js +5 -5
- package/src/agents/WindowsPermissionHandler.js +30 -30
- package/src/agents/config/AgentDefaultsRegistry.js +3 -3
- package/src/agents/config-managers/ConfigUtils.js +5 -5
- package/src/agents/config-managers/DefaultConfig.js +1 -1
- package/src/agents/config-managers/EnvVarLoader.js +7 -7
- package/src/agents/config-managers/FileConfigLoader.js +22 -22
- package/src/agents/config-managers/TypeConverters.js +1 -1
- package/src/agents/config-managers/VariableMappings.js +7 -7
- package/src/agents/discovery/AgentDiscoveryService-refactored.js +8 -8
- package/src/agents/discovery/AgentDiscoveryService.js +14 -14
- package/src/agents/discovery/agent-validator.js +4 -4
- package/src/agents/discovery/discovery-results.js +1 -1
- package/src/agents/discovery/discovery-scanner.js +29 -29
- package/src/agents/discovery/discovery-utils.js +6 -6
- package/src/agents/discovery/executable-analyzer.js +27 -27
- package/src/agents/discovery/history-manager.js +2 -2
- package/src/agents/logging/AgentLogger.js +20 -20
- package/src/agents/status/AgentStatusManager.js +30 -30
- package/src/agents/storage/FileManager.js +15 -15
- package/src/agents/validation.js +4 -4
- package/src/agents/verification/AgentCommunicationTester.js +46 -46
- package/src/agents/verification/BaseVerifier.js +31 -31
- package/src/agents/verification/CommandVerifier.js +34 -34
- package/src/agents/verification/FileOperationVerifier.js +14 -14
- package/src/agents/verification/ResultAnalyzer-refactored.js +7 -7
- package/src/agents/verification/ResultAnalyzer.js +29 -29
- package/src/agents/verification/TestRequirementManager.js +49 -49
- package/src/agents/verification/VerificationRunner.js +18 -18
- package/src/agents/verification/analysis-utils.js +27 -27
- package/src/agents/verification/batch-analyzer.js +55 -55
- package/src/agents/verification/pattern-recognizer.js +49 -49
- package/src/agents/verification/report-generator.js +9 -9
- package/src/agents/verification/test-analyzer.js +29 -29
- package/src/agents/windows/BaseWindowsInstaller.js +22 -22
- package/src/agents/windows/ChocolateyInstaller.js +31 -31
- package/src/agents/windows/DirectInstaller.js +23 -23
- package/src/agents/windows/InstallerFactory.js +16 -16
- package/src/agents/windows/NpmInstaller.js +39 -39
- package/src/agents/windows/PowerShellInstaller.js +27 -27
- package/src/agents/windows/VSCodeExtensionInstaller.js +10 -10
- package/src/agents/windows/WinGetInstaller.js +23 -23
- package/src/analysis/analysis-engine.js +35 -35
- package/src/analysis/analysis-reporter.js +7 -7
- package/src/analysis/ast-analyzer.js +28 -28
- package/src/analysis/boundary-detector-refactored.js +35 -35
- package/src/analysis/boundary-detector.js +35 -35
- package/src/analysis/boundary-scanner.js +52 -52
- package/src/analysis/boundary-types.js +3 -3
- package/src/analysis/boundary-utils.js +33 -33
- package/src/analysis/categorizer.js +20 -20
- package/src/analysis/codebase-scanner.js +22 -22
- package/src/analysis/detection-methods.js +25 -25
- package/src/analysis/line-counter.js +14 -14
- package/src/analysis/report/analysis-report.js +9 -9
- package/src/analysis/report/package-analyzer.js +33 -33
- package/src/analysis/report/recommendation-generator.js +29 -29
- package/src/analysis/report/statistics-generator.js +53 -53
- package/src/analysis/reports/analysis-report-model.js +4 -4
- package/src/analysis/reports/recommendation-generator.js +25 -25
- package/src/analysis/reports/report-generators.js +9 -9
- package/src/analysis/reports/statistics-calculator.js +23 -23
- package/src/analysis/reports/trend-analyzer.js +19 -19
- package/src/analysis/strategy-generator.js +5 -5
- package/src/auth/shared-auth-storage.js +15 -7
- package/src/auto-mode/AutoModeBusinessLogic.js +9 -15
- package/src/auto-mode/auto-mode-streaks.js +104 -0
- package/src/auto-mode/direct-run-recovery.js +99 -0
- package/src/auto-mode/rate-limit-budget.js +169 -0
- package/src/auto-mode/rate-limit-handler.js +218 -0
- package/src/auto-mode/rate-limit-store.js +174 -0
- package/src/auto-mode/stage-change-log.js +60 -0
- package/src/auto-mode/stage-stall-tracker.js +123 -0
- package/src/auto-mode-error-detector/error-detector.js +135 -0
- package/src/autonomous-mode/feature-implementer.js +20 -24
- package/src/beta-request.js +1 -1
- package/src/chat-management/chat-manager.js +3 -3
- package/src/commands/base.js +8 -8
- package/src/commands/disable-requirement.js +2 -2
- package/src/commands/disable-spec.js +2 -2
- package/src/commands/enable-requirement.js +2 -2
- package/src/commands/enable-spec.js +2 -2
- package/src/commands/help.js +5 -5
- package/src/commands/registry.js +12 -12
- package/src/commands/requirements.js +2 -2
- package/src/commands/resolver.js +7 -7
- package/src/commands/settings.js +79 -4
- package/src/compliance/compliance-manager.js +10 -10
- package/src/compliance/compliance-prompt.js +6 -6
- package/src/config/refactoring-config.js +6 -6
- package/src/database/migrations.js +1 -1
- package/src/database/user-database-client.js +1 -1
- package/src/database/user-schema.js +2 -2
- package/src/feedback/feedback-config-manager.js +95 -0
- package/src/feedback/feedback-manager.js +501 -0
- package/src/feedback/ui-preferences-manager.js +87 -0
- package/src/git/commit-manager.js +475 -0
- package/src/health-tracking/health-reporter.js +14 -14
- package/src/health-tracking/ide-health-tracker.js +17 -3
- package/src/health-tracking/json-storage.js +4 -4
- package/src/ide-integration/agent-test-runner.js +275 -0
- package/src/ide-integration/aider/commands/configuration-manager.js +39 -0
- package/src/ide-integration/aider/commands/installation-manager.js +111 -0
- package/src/ide-integration/aider/processes/process-manager.js +37 -0
- package/src/ide-integration/aider/utils/ollama-manager.js +154 -0
- package/src/ide-integration/aider-cli-manager.cjs +16 -241
- package/src/ide-integration/applescript-antigravity-quota.cjs +515 -0
- package/src/ide-integration/applescript-cursor-quota.cjs +351 -0
- package/src/ide-integration/applescript-ide-opener.cjs +489 -0
- package/src/ide-integration/applescript-kiro-quota.cjs +549 -0
- package/src/ide-integration/applescript-manager-core.js +30 -12
- package/src/ide-integration/applescript-manager.cjs +45 -3201
- package/src/ide-integration/applescript-manager.js +34 -16
- package/src/ide-integration/applescript-response-reader.cjs +658 -0
- package/src/ide-integration/applescript-send-text.cjs +307 -0
- package/src/ide-integration/applescript-status-continuation.cjs +581 -0
- package/src/ide-integration/applescript-utils.js +203 -192
- package/src/ide-integration/cdp-handlers/connection-handler.js +2 -2
- package/src/ide-integration/cdp-handlers/continuation-handler.js +7 -7
- package/src/ide-integration/cdp-handlers/text-sender.js +1 -1
- package/src/ide-integration/cdp-manager.js +2 -2
- package/src/ide-integration/cli-direct-runner.js +483 -0
- package/src/ide-integration/cli-session-manager.js +180 -0
- package/src/ide-integration/cline-cli-manager.js +24 -24
- package/src/ide-integration/continuation-handler.js +18 -18
- package/src/ide-integration/continue-cli-manager.js +14 -14
- package/src/ide-integration/ide-openers/claude-opener.js +23 -7
- package/src/ide-integration/ide-openers/other-ides-opener.js +17 -63
- package/src/ide-integration/ide-status-checker.js +20 -20
- package/src/ide-integration/macos-ide-manager.js +55 -4
- package/src/ide-integration/macos-quota-checker.js +1 -1
- package/src/ide-integration/macos-text-sender.js +204 -68
- package/src/ide-integration/quota-detector.cjs +11 -11
- package/src/ide-integration/quota-detector.js +11 -11
- package/src/ide-integration/response-reader.js +10 -10
- package/src/ide-integration/windows/cursor-automation.js +304 -0
- package/src/ide-integration/windows/ide-automation.js +735 -0
- package/src/ide-integration/windows/window-operations.js +183 -0
- package/src/ide-integration/windows-automation-manager.js +92 -865
- package/src/ide-integration/windows-ide-manager.js +13 -13
- package/src/index.cjs +87 -6
- package/src/index.js +56 -41
- package/src/installation/config-manager.js +247 -0
- package/src/installation/config-paths.js +64 -0
- package/src/installation/fs-validators.js +166 -0
- package/src/installation/index.js +30 -0
- package/src/installation/path-resolver.js +73 -0
- package/src/installation/types.js +57 -0
- package/src/installation/version-detector.js +233 -0
- package/src/items/item-conversation.js +101 -0
- package/src/items/items-migrator.js +358 -0
- package/src/items/items-slug.js +55 -0
- package/src/items/items-store-io.js +257 -0
- package/src/items/items-store.js +541 -0
- package/src/localization/index.js +3 -3
- package/src/localization/translations/en-part1.js +1 -1
- package/src/localization/translations/en-part2.js +1 -1
- package/src/localization/translations/es-part1.js +1 -1
- package/src/localization/translations/es-part2.js +1 -1
- package/src/models/compliance-report.js +44 -44
- package/src/models/file-analysis.js +33 -33
- package/src/models/plan-manager.js +44 -44
- package/src/models/refactoring-models.js +4 -4
- package/src/models/refactoring-plan-refactored.js +2 -2
- package/src/models/refactoring-plan.js +5 -5
- package/src/monitoring/alert-system.js +84 -84
- package/src/monitoring/compliance-progress-tracker.js +19 -19
- package/src/monitoring/continuous-scan-notifications.js +54 -54
- package/src/monitoring/continuous-scanner.js +24 -24
- package/src/monitoring/file-monitor/file-analyzer.js +23 -23
- package/src/monitoring/file-monitor/file-monitor.js +20 -20
- package/src/monitoring/file-monitor/watcher.js +18 -18
- package/src/monitoring/file-monitor.js +1 -1
- package/src/monitoring/notification-handlers/base-handler.js +3 -3
- package/src/monitoring/notification-handlers/error-handler.js +1 -1
- package/src/monitoring/notification-handlers/index.js +1 -1
- package/src/monitoring/notification-handlers/new-violation-handler.js +5 -5
- package/src/monitoring/notification-handlers/progress-handler.js +2 -2
- package/src/monitoring/notification-handlers/resolved-violation-handler.js +4 -4
- package/src/monitoring/notification-handlers/threshold-handler.js +1 -1
- package/src/monitoring/notification-manager.js +36 -36
- package/src/monitoring/scanner-core.js +43 -43
- package/src/monitoring/scanner-events.js +26 -26
- package/src/monitoring/violation-notification-system.js +10 -10
- package/src/progress/metrics-aggregator.js +194 -0
- package/src/progress/metrics-store.js +263 -0
- package/src/provider-registry.js +5 -5
- package/src/quota-management/index.js +2 -2
- package/src/refactoring/boundaries/cohesion-analyzer.js +21 -21
- package/src/refactoring/boundaries/extraction-result.js +1 -1
- package/src/refactoring/boundaries/extraction-strategies.js +27 -27
- package/src/refactoring/boundaries/module-boundary.js +8 -8
- package/src/refactoring/boundary/boundary-detector-refactored.js +1 -1
- package/src/refactoring/boundary/boundary-detector.js +26 -26
- package/src/refactoring/boundary/boundary-types.js +21 -21
- package/src/refactoring/boundary/detectors/boundary-analyzers.js +34 -34
- package/src/refactoring/boundary/detectors/boundary-core.js +14 -14
- package/src/refactoring/boundary/detectors/class-detector.js +28 -28
- package/src/refactoring/boundary/detectors/config-detector.js +28 -28
- package/src/refactoring/boundary/detectors/constant-detector.js +28 -28
- package/src/refactoring/boundary/detectors/function-detector.js +28 -28
- package/src/refactoring/boundary/detectors/module-detector.js +29 -29
- package/src/refactoring/boundary/detectors/object-detector.js +28 -28
- package/src/refactoring/boundary/detectors/type-detectors.js +34 -34
- package/src/refactoring/boundary/detectors/utility-detector.js +28 -28
- package/src/refactoring/boundary/extraction-strategies.js +61 -61
- package/src/refactoring/boundary-extraction-result.js +3 -3
- package/src/refactoring/boundary-extraction-strategies.js +28 -28
- package/src/refactoring/boundary-extractor.js +13 -13
- package/src/refactoring/boundary-types.js +1 -1
- package/src/refactoring/circular/circular-dependency.js +4 -4
- package/src/refactoring/circular/cycle-detection.js +10 -10
- package/src/refactoring/circular/dependency-node.js +1 -1
- package/src/refactoring/circular/dependency-result.js +1 -1
- package/src/refactoring/circular/dependency-types.js +2 -2
- package/src/refactoring/circular/graph-builder.js +25 -25
- package/src/refactoring/circular/resolution-strategy.js +1 -1
- package/src/refactoring/circular/strategy-generator.js +28 -28
- package/src/refactoring/circular-dependency-resolver-original.js +70 -70
- package/src/refactoring/circular-dependency-resolver.js +19 -19
- package/src/refactoring/code-mover-refactored.js +31 -31
- package/src/refactoring/code-mover.js +53 -53
- package/src/refactoring/execution-status.js +1 -1
- package/src/refactoring/execution-strategies.js +28 -28
- package/src/refactoring/file-splitter-core.js +58 -58
- package/src/refactoring/file-splitter-types.js +1 -1
- package/src/refactoring/file-splitter.js +1 -1
- package/src/refactoring/functionality-validator.js +90 -90
- package/src/refactoring/import-manager-refactored.js +42 -42
- package/src/refactoring/import-manager.js +57 -57
- package/src/refactoring/import-models.js +1 -1
- package/src/refactoring/import-parser.js +41 -41
- package/src/refactoring/module-boundary.js +3 -3
- package/src/refactoring/move-executor.js +45 -45
- package/src/refactoring/move-utils.js +27 -27
- package/src/refactoring/operation-executor.js +7 -7
- package/src/refactoring/plan-creator.js +3 -3
- package/src/refactoring/plan-executor.js +21 -21
- package/src/refactoring/plan-validator.js +10 -10
- package/src/refactoring/refactoring-executor-result.js +1 -1
- package/src/refactoring/refactoring-executor.js +5 -5
- package/src/refactoring/refactoring-operation.js +3 -3
- package/src/refactoring/refactoring-plan.js +2 -2
- package/src/refactoring/refactoring-rollback.js +1 -1
- package/src/refactoring/rollback-handlers/RollbackExecutor.js +12 -12
- package/src/refactoring/rollback-handlers/RollbackManager.js +34 -34
- package/src/refactoring/rollback-handlers/RollbackOperation.js +2 -2
- package/src/refactoring/rollback-handlers/RollbackResult.js +5 -5
- package/src/refactoring/rollback-handlers/RollbackStatistics.js +8 -8
- package/src/refactoring/test-validator.js +19 -19
- package/src/refactoring/validation/baseline-runner.js +10 -10
- package/src/refactoring/validation/report-generator.js +16 -16
- package/src/refactoring/validation/result-comparator.js +10 -10
- package/src/refactoring/validation/test-suite.js +2 -2
- package/src/refactoring/validation/test-validation-result.js +2 -2
- package/src/refactoring/validation/validation-runner.js +16 -16
- package/src/refactoring/validation/validation-status.js +1 -1
- package/src/repos/repos-store.js +220 -0
- package/src/requirement-management/default-requirement-manager.js +20 -20
- package/src/requirement-management/requirement-file-parser.js +3 -3
- package/src/requirement-management/requirement-sequencer.js +17 -17
- package/src/rui/base.js +6 -6
- package/src/rui/commands/AgentCommandParser.js +6 -6
- package/src/rui/commands/AgentCommands.js +26 -26
- package/src/rui/commands/AgentResponseFormatter.js +12 -12
- package/src/rui/commands/parsers/CommandMapper.js +5 -5
- package/src/rui/commands/parsers/CommandValidator.js +5 -5
- package/src/rui/commands/parsers/ComponentExtractor.js +4 -4
- package/src/rui/commands/parsers/TokenParser.js +6 -6
- package/src/rui/commands/parsers/tokenizer.js +9 -9
- package/src/rui/index.js +5 -5
- package/src/rui/registry.js +5 -5
- package/src/rui/resolver.js +3 -3
- package/src/screenshot/analysis-engine.js +249 -0
- package/src/screenshot/capture-engine.js +251 -0
- package/src/screenshot/verification-loop.js +191 -0
- package/src/scripts/verify-full-compliance.js +32 -32
- package/src/spec-management/queue-storage.js +320 -0
- package/src/spec-management/retry-manager.js +243 -0
- package/src/spec-management/spec-counter.js +301 -0
- package/src/spec-management/spec-fingerprint.js +148 -0
- package/src/spec-management/spec-logger.js +329 -0
- package/src/spec-management/spec-scanner.js +313 -0
- package/src/sync/aws-setup.js +41 -41
- package/src/sync/remote-control-server.js +50 -50
- package/src/sync/sync-engine-conflicts.js +10 -10
- package/src/sync/sync-engine-core.js +9 -9
- package/src/sync/sync-engine-file-ops.js +7 -7
- package/src/sync/sync-engine.js +12 -12
- package/src/task-generation/automated-task-generator.js +20 -20
- package/src/task-generation/prioritizer.js +39 -39
- package/src/task-generation/task-list-updater.js +29 -29
- package/src/task-generation/task-management-integration.js +92 -92
- package/src/task-generation/task-manager-integration.js +18 -18
- package/src/task-generation/violation-task-generator.js +54 -54
- package/src/task-management/continuous-scan-integration.js +25 -25
- package/src/ui/ChatInterface.js +1 -1
- package/src/ui/ChromeExtensionAdapter.js +309 -0
- package/src/ui/FeedbackComponent.js +334 -0
- package/src/utils/analyzer.js +18 -18
- package/src/utils/cleanup.js +28 -28
- package/src/utils/config-helpers.js +64 -4
- package/src/utils/constants.js +19 -0
- package/src/utils/current-requirement-operations.js +63 -11
- package/src/utils/dependency-mapper.js +8 -8
- package/src/utils/duplicate-detector.js +29 -29
- package/src/utils/error-reporter.js +6 -6
- package/src/utils/file-monitor.js +20 -20
- package/src/utils/git-branch-manager.js +157 -1
- package/src/utils/import-updater.js +10 -10
- package/src/utils/refactor-plan.js +22 -22
- package/src/utils/refactoring-tools.js +7 -7
- package/src/utils/repo-helpers.cjs +16 -11
- package/src/utils/repo-helpers.js +15 -8
- package/src/utils/report-generator.js +1 -1
- package/src/utils/report-generators/analysis-generator.js +4 -4
- package/src/utils/report-generators/base-generator.js +7 -7
- package/src/utils/report-generators/compliance-generator.js +2 -2
- package/src/utils/report-generators/format-handlers.js +16 -16
- package/src/utils/report-generators/refactoring-generator.js +1 -1
- package/src/utils/report-generators/validation-generator.js +3 -3
- package/src/utils/reports/report-analysis.js +13 -13
- package/src/utils/reports/report-types.js +1 -1
- package/src/utils/reports/summary-generators.js +4 -4
- package/src/utils/requirement-enable-disable.js +69 -44
- package/src/utils/requirement-file-management.js +10 -28
- package/src/utils/requirement-helpers/requirement-file-ops.js +22 -17
- package/src/utils/requirement-helpers/requirement-mover.js +13 -13
- package/src/utils/requirement-helpers/requirement-parser.js +6 -10
- package/src/utils/requirement-helpers/requirement-status.js +20 -18
- package/src/utils/requirement-helpers-new.js +8 -8
- package/src/utils/requirement-helpers-refactored.js +1 -1
- package/src/utils/requirement-helpers.js +1 -1
- package/src/utils/requirement-loader.js +238 -0
- package/src/utils/requirement-movement.js +46 -46
- package/src/utils/requirement-writer.js +466 -0
- package/src/utils/rollback/rollback-handlers.js +2 -2
- package/src/utils/rollback/rollback-operation.js +1 -1
- package/src/utils/rollback/rollback-recorder.js +4 -4
- package/src/utils/rollback/rollback-state-manager.js +5 -5
- package/src/utils/rollback/rollback-types.js +1 -1
- package/src/utils/rollback/rollback-utils.js +4 -4
- package/src/utils/rollback-manager-original.js +14 -14
- package/src/utils/rollback-manager.js +4 -4
- package/src/utils/smoke-test-cli.js +20 -20
- package/src/utils/smoke-test-gui.js +34 -34
- package/src/utils/smoke-test-orchestrator.js +24 -24
- package/src/utils/smoke-test-runner.js +5 -5
- package/src/utils/smoke-test-web.js +22 -22
- package/src/utils/spec-loader.js +308 -0
- package/src/utils/spec-writer.js +295 -0
- package/src/utils/specification-enable-disable.js +10 -10
- package/src/utils/task-parser.js +141 -0
- package/src/utils/test-comparator.js +2 -2
- package/src/utils/test-config.js +1 -1
- package/src/utils/test-executor.js +7 -7
- package/src/utils/test-parser.js +4 -4
- package/src/utils/test-runner-baseline.js +5 -5
- package/src/utils/test-runner-core.js +2 -2
- package/src/utils/test-runner-report.js +1 -1
- package/src/utils/test-runner-validation.js +9 -9
- package/src/utils/test-runner.js +1 -1
- package/src/utils/validation-framework.js +27 -27
- package/src/utils/verification-summary-validator.js +51 -0
- package/src/validation/comparison-analyzer.js +34 -34
- package/src/validation/compliance-analyzer.js +23 -23
- package/src/validation/compliance-report-generator.js +23 -23
- package/src/validation/compliance-reporter-new.js +18 -18
- package/src/validation/compliance-reporter-refactored.js +18 -18
- package/src/validation/compliance-reporter.js +45 -30
- package/src/validation/compliance-rules.js +12 -12
- package/src/validation/compliance-utils.js +20 -20
- package/src/validation/constitution-validator-new.js +16 -16
- package/src/validation/constitution-validator.js +1 -1
- package/src/validation/file-validators.js +13 -13
- package/src/validation/html-generator.js +27 -27
- package/src/validation/line-limit/file-analyzer.js +15 -15
- package/src/validation/line-limit/line-limit-validator.js +10 -10
- package/src/validation/line-limit/validation-result.js +6 -6
- package/src/validation/line-limit-core.js +29 -29
- package/src/validation/line-limit-reporter.js +20 -20
- package/src/validation/line-limit-result.js +3 -3
- package/src/validation/line-limit-validator.js +5 -5
- package/src/validation/metrics/category-calculator.js +9 -9
- package/src/validation/metrics/metrics-helpers.js +16 -16
- package/src/validation/metrics/overview-calculator.js +2 -2
- package/src/validation/metrics/overview-metrics.js +1 -1
- package/src/validation/metrics/quality-calculator.js +22 -22
- package/src/validation/metrics/size-calculator.js +3 -3
- package/src/validation/metrics-calculator.js +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Installation Log Class
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Represents a log entry for installation/verification operations.
|
|
5
5
|
* Follows constitutional requirements: <555 lines, test-first approach.
|
|
6
6
|
*/
|
|
@@ -32,7 +32,7 @@ class InstallationLog {
|
|
|
32
32
|
this.message = config.message || '';
|
|
33
33
|
this.duration = config.duration || 0;
|
|
34
34
|
this.errorDetails = config.errorDetails || '';
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
this.validate();
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -44,39 +44,39 @@ class InstallationLog {
|
|
|
44
44
|
if (!this.id || typeof this.id !== 'string') {
|
|
45
45
|
throw new Error('Installation log must have a valid non-empty string id');
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
|
|
48
48
|
if (!this.agentId || typeof this.agentId !== 'string') {
|
|
49
49
|
throw new Error('Installation log must have a valid non-empty string agentId');
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
|
|
52
52
|
if (!this.operation || typeof this.operation !== 'string') {
|
|
53
53
|
throw new Error('Installation log must have a valid non-empty string operation');
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
|
|
56
56
|
if (!Object.values(OperationType).includes(this.operation)) {
|
|
57
57
|
throw new Error(`Invalid operation type: ${this.operation}`);
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
if (!(this.timestamp instanceof Date) || isNaN(this.timestamp)) {
|
|
61
61
|
throw new Error('Timestamp must be a valid Date object');
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
|
|
64
64
|
if (!this.status || typeof this.status !== 'string') {
|
|
65
65
|
throw new Error('Installation log must have a valid non-empty string status');
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
|
|
68
68
|
if (!Object.values(OperationStatus).includes(this.status)) {
|
|
69
69
|
throw new Error(`Invalid operation status: ${this.status}`);
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
|
|
72
72
|
if (!this.message || typeof this.message !== 'string') {
|
|
73
73
|
throw new Error('Installation log must have a valid non-empty string message');
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
|
|
76
76
|
if (typeof this.duration !== 'number' || this.duration < 0) {
|
|
77
77
|
throw new Error('Duration must be a non-negative number');
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
// Error details required if status is FAILED
|
|
81
81
|
if (this.status === OperationStatus.FAILED && !this.errorDetails) {
|
|
82
82
|
throw new Error('Error details are required when status is FAILED');
|
|
@@ -106,7 +106,7 @@ class InstallationLog {
|
|
|
106
106
|
this.message = message || this.message;
|
|
107
107
|
this.errorDetails = errorDetails || this.errorDetails;
|
|
108
108
|
this.duration += additionalDuration;
|
|
109
|
-
|
|
109
|
+
|
|
110
110
|
return {
|
|
111
111
|
oldStatus,
|
|
112
112
|
newStatus,
|
|
@@ -123,7 +123,7 @@ class InstallationLog {
|
|
|
123
123
|
if (finalDuration !== null) {
|
|
124
124
|
this.duration = finalDuration;
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
|
|
127
127
|
return this.update(OperationStatus.COMPLETED, message);
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -137,7 +137,7 @@ class InstallationLog {
|
|
|
137
137
|
if (finalDuration !== null) {
|
|
138
138
|
this.duration = finalDuration;
|
|
139
139
|
}
|
|
140
|
-
|
|
140
|
+
|
|
141
141
|
return this.update(OperationStatus.FAILED, error, errorDetails);
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -149,7 +149,7 @@ class InstallationLog {
|
|
|
149
149
|
if (timeoutDuration !== null) {
|
|
150
150
|
this.duration = timeoutDuration;
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
|
|
153
153
|
return this.update(OperationStatus.TIMEOUT, 'Operation timed out');
|
|
154
154
|
}
|
|
155
155
|
|
|
@@ -207,15 +207,15 @@ class InstallationLog {
|
|
|
207
207
|
*/
|
|
208
208
|
getFormattedDuration() {
|
|
209
209
|
const duration = this.duration;
|
|
210
|
-
|
|
210
|
+
|
|
211
211
|
if (duration < 1000) {
|
|
212
212
|
return `${duration}ms`;
|
|
213
213
|
}
|
|
214
|
-
|
|
214
|
+
|
|
215
215
|
if (duration < 60000) {
|
|
216
216
|
return `${(duration / 1000).toFixed(1)}s`;
|
|
217
217
|
}
|
|
218
|
-
|
|
218
|
+
|
|
219
219
|
const minutes = Math.floor(duration / 60000);
|
|
220
220
|
const seconds = ((duration % 60000) / 1000).toFixed(0);
|
|
221
221
|
return `${minutes}m ${seconds}s`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Installation Orchestrator
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Orchestrates agent installation across multiple installers.
|
|
5
5
|
* Follows constitutional requirements: <555 lines, test-first approach.
|
|
6
6
|
*/
|
|
@@ -28,14 +28,14 @@ class InstallationOrchestrator {
|
|
|
28
28
|
this.timeout = config.timeout || 300000;
|
|
29
29
|
this.retryAttempts = config.retryAttempts || 3;
|
|
30
30
|
this.retryDelay = config.retryDelay || 5000;
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
// Initialize services
|
|
33
33
|
this.errorHandler = new InstallationErrorHandler({
|
|
34
34
|
logger: this.logger,
|
|
35
35
|
platform: config.platform,
|
|
36
36
|
arch: config.arch
|
|
37
37
|
});
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
this.progressReporter = new InstallationProgressReporter({
|
|
40
40
|
logger: this.logger,
|
|
41
41
|
updateInterval: config.progressUpdateInterval || 2000,
|
|
@@ -51,7 +51,7 @@ class InstallationOrchestrator {
|
|
|
51
51
|
*/
|
|
52
52
|
async installAgent(agent, options = {}) {
|
|
53
53
|
const { force = false, installerType = null, timeout = this.timeout } = options;
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
if (this.logger) {
|
|
56
56
|
await this.logger.info('Starting agent installation', {
|
|
57
57
|
agentId: agent.id,
|
|
@@ -64,14 +64,14 @@ class InstallationOrchestrator {
|
|
|
64
64
|
|
|
65
65
|
const startTime = Date.now();
|
|
66
66
|
const operationId = `install-${agent.id}-${Date.now()}`;
|
|
67
|
-
|
|
67
|
+
|
|
68
68
|
try {
|
|
69
69
|
// Update agent status to INSTALLING
|
|
70
70
|
await this.updateAgentStatus(agent.id, AgentStatus.INSTALLING, 'Starting installation');
|
|
71
|
-
|
|
71
|
+
|
|
72
72
|
// Get available installers first
|
|
73
73
|
const installers = await this.getAvailableInstallers(agent, installerType);
|
|
74
|
-
|
|
74
|
+
|
|
75
75
|
// Start progress tracking
|
|
76
76
|
const progress = this.progressReporter.startProgress(operationId, {
|
|
77
77
|
agentId: agent.id,
|
|
@@ -79,21 +79,21 @@ class InstallationOrchestrator {
|
|
|
79
79
|
totalSteps: installers.length * 2 + 2,
|
|
80
80
|
estimatedDuration: timeout
|
|
81
81
|
});
|
|
82
|
-
|
|
82
|
+
|
|
83
83
|
progress.updateStep('Checking available installers');
|
|
84
|
-
|
|
84
|
+
|
|
85
85
|
if (installers.length === 0) {
|
|
86
86
|
progress.fail(new Error('No available installers found for agent'));
|
|
87
87
|
throw new Error('No available installers found for agent');
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
progress.updateStep(`Found ${installers.length} available installers`, {
|
|
91
|
-
installers: installers.map(i => i.type)
|
|
90
|
+
progress.updateStep(`Found ${installers.length} available installers`, {
|
|
91
|
+
installers: installers.map(i => i.type)
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
// Try installers in order of preference
|
|
95
95
|
let installationResult = await this.tryInstallers(agent, installers, progress, options);
|
|
96
|
-
|
|
96
|
+
|
|
97
97
|
if (!installationResult || !installationResult.success) {
|
|
98
98
|
progress.fail(new Error('All installation attempts failed'));
|
|
99
99
|
throw new Error('All installation attempts failed');
|
|
@@ -102,10 +102,10 @@ class InstallationOrchestrator {
|
|
|
102
102
|
progress.complete(installationResult);
|
|
103
103
|
|
|
104
104
|
const duration = Date.now() - startTime;
|
|
105
|
-
|
|
105
|
+
|
|
106
106
|
// Log installation success
|
|
107
107
|
await this.logInstallation(agent, installationResult, duration);
|
|
108
|
-
|
|
108
|
+
|
|
109
109
|
return {
|
|
110
110
|
success: true,
|
|
111
111
|
agentId: agent.id,
|
|
@@ -117,17 +117,17 @@ class InstallationOrchestrator {
|
|
|
117
117
|
|
|
118
118
|
} catch (error) {
|
|
119
119
|
const duration = Date.now() - startTime;
|
|
120
|
-
|
|
120
|
+
|
|
121
121
|
// Enhanced error handling for main installation failure
|
|
122
122
|
const enhancedError = this.errorHandler.handleError(error, {
|
|
123
123
|
agentId: agent.id,
|
|
124
124
|
installerType: installerType || 'AUTO',
|
|
125
125
|
phase: 'MAIN_INSTALLATION'
|
|
126
126
|
});
|
|
127
|
-
|
|
127
|
+
|
|
128
128
|
// Update agent status to ERROR
|
|
129
129
|
await this.updateAgentStatus(agent.id, AgentStatus.ERROR, enhancedError.userMessage);
|
|
130
|
-
|
|
130
|
+
|
|
131
131
|
if (this.logger) {
|
|
132
132
|
await this.logger.error('Agent installation failed', {
|
|
133
133
|
agentId: agent.id,
|
|
@@ -139,7 +139,7 @@ class InstallationOrchestrator {
|
|
|
139
139
|
resolutionSteps: enhancedError.resolutionSteps
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
-
|
|
142
|
+
|
|
143
143
|
return {
|
|
144
144
|
success: false,
|
|
145
145
|
agentId: agent.id,
|
|
@@ -164,11 +164,11 @@ class InstallationOrchestrator {
|
|
|
164
164
|
*/
|
|
165
165
|
async tryInstallers(agent, installers, progress, options) {
|
|
166
166
|
let lastError = null;
|
|
167
|
-
|
|
167
|
+
|
|
168
168
|
for (const installer of installers) {
|
|
169
169
|
try {
|
|
170
170
|
progress.updateStep(`Trying ${installer.type} installer`);
|
|
171
|
-
|
|
171
|
+
|
|
172
172
|
if (this.logger) {
|
|
173
173
|
await this.logger.info(`Trying installer: ${installer.type}`, {
|
|
174
174
|
agentId: agent.id,
|
|
@@ -183,9 +183,9 @@ class InstallationOrchestrator {
|
|
|
183
183
|
const unmet = requirements.requirements
|
|
184
184
|
.filter(req => !req.met)
|
|
185
185
|
.map(req => req.requirement);
|
|
186
|
-
|
|
186
|
+
|
|
187
187
|
progress.updateStep(`${installer.type} requirements not met`, { unmet });
|
|
188
|
-
|
|
188
|
+
|
|
189
189
|
if (this.logger) {
|
|
190
190
|
await this.logger.warn(`Installer requirements not met: ${installer.type}`, {
|
|
191
191
|
agentId: agent.id,
|
|
@@ -193,17 +193,17 @@ class InstallationOrchestrator {
|
|
|
193
193
|
unmetRequirements: unmet
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
|
-
|
|
196
|
+
|
|
197
197
|
lastError = new Error(`Requirements not met: ${unmet.join(', ')}`);
|
|
198
198
|
continue;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
progress.updateStep(`Installing with ${installer.type}`);
|
|
202
|
-
const installationResult = await installer.install(agent, {
|
|
203
|
-
force: options.force,
|
|
204
|
-
timeout: Math.floor(options.timeout / installers.length)
|
|
202
|
+
const installationResult = await installer.install(agent, {
|
|
203
|
+
force: options.force,
|
|
204
|
+
timeout: Math.floor(options.timeout / installers.length)
|
|
205
205
|
});
|
|
206
|
-
|
|
206
|
+
|
|
207
207
|
if (installationResult && installationResult.success) {
|
|
208
208
|
progress.updateStep(`${installer.type} installation successful`, {
|
|
209
209
|
result: installationResult
|
|
@@ -212,10 +212,10 @@ class InstallationOrchestrator {
|
|
|
212
212
|
} else {
|
|
213
213
|
progress.updateStep(`${installer.type} installation failed`);
|
|
214
214
|
}
|
|
215
|
-
|
|
215
|
+
|
|
216
216
|
} catch (error) {
|
|
217
217
|
lastError = error;
|
|
218
|
-
|
|
218
|
+
|
|
219
219
|
// Enhanced error handling with comprehensive messages
|
|
220
220
|
const enhancedError = this.errorHandler.handleError(error, {
|
|
221
221
|
agentId: agent.id,
|
|
@@ -223,7 +223,7 @@ class InstallationOrchestrator {
|
|
|
223
223
|
command: installer.command,
|
|
224
224
|
phase: 'INSTALLATION'
|
|
225
225
|
});
|
|
226
|
-
|
|
226
|
+
|
|
227
227
|
if (this.logger) {
|
|
228
228
|
await this.logger.error(`Installer error: ${installer.type}`, {
|
|
229
229
|
agentId: agent.id,
|
|
@@ -248,7 +248,7 @@ class InstallationOrchestrator {
|
|
|
248
248
|
*/
|
|
249
249
|
async getAvailableInstallers(agent, preferredType = null) {
|
|
250
250
|
const installers = [];
|
|
251
|
-
|
|
251
|
+
|
|
252
252
|
if (preferredType) {
|
|
253
253
|
// Try preferred installer first
|
|
254
254
|
try {
|
|
@@ -257,10 +257,10 @@ class InstallationOrchestrator {
|
|
|
257
257
|
logger: this.logger,
|
|
258
258
|
fileManager: this.fileManager
|
|
259
259
|
});
|
|
260
|
-
|
|
260
|
+
|
|
261
261
|
const isAvailable = await installer.isAvailable();
|
|
262
262
|
const requirements = await installer.checkRequirements();
|
|
263
|
-
|
|
263
|
+
|
|
264
264
|
if (isAvailable && requirements.allMet) {
|
|
265
265
|
installers.push(installer);
|
|
266
266
|
}
|
|
@@ -276,20 +276,20 @@ class InstallationOrchestrator {
|
|
|
276
276
|
|
|
277
277
|
// Try all available installers
|
|
278
278
|
const availableTypes = ['WINGET', 'NPM', 'POWERSHELL', 'CHOCOLATEY', 'DIRECT'];
|
|
279
|
-
|
|
279
|
+
|
|
280
280
|
for (const type of availableTypes) {
|
|
281
281
|
if (type === preferredType) continue; // Already tried preferred
|
|
282
|
-
|
|
282
|
+
|
|
283
283
|
try {
|
|
284
284
|
const installer = InstallerFactory.create(type, {
|
|
285
285
|
configManager: this.configManager,
|
|
286
286
|
logger: this.logger,
|
|
287
287
|
fileManager: this.fileManager
|
|
288
288
|
});
|
|
289
|
-
|
|
289
|
+
|
|
290
290
|
const isAvailable = await installer.isAvailable();
|
|
291
291
|
const requirements = await installer.checkRequirements();
|
|
292
|
-
|
|
292
|
+
|
|
293
293
|
if (isAvailable && requirements.allMet) {
|
|
294
294
|
installers.push(installer);
|
|
295
295
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Installation Progress Reporter
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Provides progress reporting for long-running installations.
|
|
5
5
|
* Follows constitutional requirements: <555 lines, test-first approach.
|
|
6
6
|
*/
|
|
@@ -18,7 +18,7 @@ class InstallationProgressReporter {
|
|
|
18
18
|
this.updateInterval = options.updateInterval || 2000; // 2 seconds
|
|
19
19
|
this.verbose = options.verbose || false;
|
|
20
20
|
this.progressCallbacks = options.progressCallbacks || [];
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
// Progress tracking
|
|
23
23
|
this.activeOperations = new Map();
|
|
24
24
|
this.timers = new Map();
|
|
@@ -33,7 +33,7 @@ class InstallationProgressReporter {
|
|
|
33
33
|
*/
|
|
34
34
|
startProgress(operationId, context = {}) {
|
|
35
35
|
const { agentId, installerType, totalSteps = 5, estimatedDuration = 300000 } = context;
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
const progress = {
|
|
38
38
|
operationId,
|
|
39
39
|
agentId,
|
|
@@ -52,10 +52,10 @@ class InstallationProgressReporter {
|
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
this.activeOperations.set(operationId, progress);
|
|
55
|
-
|
|
55
|
+
|
|
56
56
|
// Start periodic updates
|
|
57
57
|
this.startPeriodicUpdate(operationId);
|
|
58
|
-
|
|
58
|
+
|
|
59
59
|
// Log start
|
|
60
60
|
if (this.logger) {
|
|
61
61
|
this.logger.info(`Started installation: ${agentId}`, {
|
|
@@ -68,7 +68,7 @@ class InstallationProgressReporter {
|
|
|
68
68
|
|
|
69
69
|
// Notify callbacks
|
|
70
70
|
this.notifyProgress(operationId, progress);
|
|
71
|
-
|
|
71
|
+
|
|
72
72
|
return {
|
|
73
73
|
updateStep: (stepName, details = {}) => this.updateStep(operationId, stepName, details),
|
|
74
74
|
setProgress: (percent, details = {}) => this.setProgress(operationId, percent, details),
|
|
@@ -93,7 +93,7 @@ class InstallationProgressReporter {
|
|
|
93
93
|
progress.progressPercent = Math.round((progress.currentStep / progress.totalSteps) * 100);
|
|
94
94
|
progress.details = { ...progress.details, ...details };
|
|
95
95
|
progress.elapsedMs = Date.now() - progress.startTime;
|
|
96
|
-
|
|
96
|
+
|
|
97
97
|
// Estimate remaining time
|
|
98
98
|
const avgStepTime = progress.elapsedMs / progress.currentStep;
|
|
99
99
|
const remainingSteps = progress.totalSteps - progress.currentStep;
|
|
@@ -108,7 +108,7 @@ class InstallationProgressReporter {
|
|
|
108
108
|
});
|
|
109
109
|
|
|
110
110
|
this.notifyProgress(operationId, progress);
|
|
111
|
-
|
|
111
|
+
|
|
112
112
|
if (this.verbose && this.logger) {
|
|
113
113
|
this.logger.info(`Progress: ${progress.agentId} - ${stepName}`, {
|
|
114
114
|
operationId,
|
|
@@ -133,7 +133,7 @@ class InstallationProgressReporter {
|
|
|
133
133
|
progress.progressPercent = Math.max(0, Math.min(100, percent));
|
|
134
134
|
progress.details = { ...progress.details, ...details };
|
|
135
135
|
progress.elapsedMs = Date.now() - progress.startTime;
|
|
136
|
-
|
|
136
|
+
|
|
137
137
|
// Estimate remaining time
|
|
138
138
|
if (percent > 0) {
|
|
139
139
|
const totalTime = (progress.elapsedMs / percent) * 100;
|
|
@@ -181,7 +181,7 @@ class InstallationProgressReporter {
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
this.notifyProgress(operationId, progress);
|
|
184
|
-
|
|
184
|
+
|
|
185
185
|
// Remove from active operations after delay
|
|
186
186
|
setTimeout(() => {
|
|
187
187
|
this.activeOperations.delete(operationId);
|
|
@@ -224,7 +224,7 @@ class InstallationProgressReporter {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
this.notifyProgress(operationId, progress);
|
|
227
|
-
|
|
227
|
+
|
|
228
228
|
// Remove from active operations after delay
|
|
229
229
|
setTimeout(() => {
|
|
230
230
|
this.activeOperations.delete(operationId);
|
|
@@ -304,7 +304,7 @@ class InstallationProgressReporter {
|
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
progress.elapsedMs = Date.now() - progress.startTime;
|
|
307
|
-
|
|
307
|
+
|
|
308
308
|
// Update remaining time estimate
|
|
309
309
|
if (progress.progressPercent > 0) {
|
|
310
310
|
const totalTime = (progress.elapsedMs / progress.progressPercent) * 100;
|
|
@@ -361,7 +361,7 @@ class InstallationProgressReporter {
|
|
|
361
361
|
for (const [operationId, timer] of this.timers) {
|
|
362
362
|
clearInterval(timer);
|
|
363
363
|
}
|
|
364
|
-
|
|
364
|
+
|
|
365
365
|
// Clear collections
|
|
366
366
|
this.timers.clear();
|
|
367
367
|
this.activeOperations.clear();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Installation Retry Manager
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Handles retry logic for transient network failures during installation.
|
|
5
5
|
* Follows constitutional requirements: <555 lines, test-first approach.
|
|
6
6
|
*/
|
|
@@ -20,7 +20,7 @@ class InstallationRetryManager {
|
|
|
20
20
|
this.maxDelay = options.maxDelay || 30000; // 30 seconds
|
|
21
21
|
this.backoffMultiplier = options.backoffMultiplier || 2;
|
|
22
22
|
this.jitter = options.jitter || true;
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
// Network error patterns
|
|
25
25
|
this.networkErrorPatterns = [
|
|
26
26
|
/network/i,
|
|
@@ -40,7 +40,7 @@ class InstallationRetryManager {
|
|
|
40
40
|
/no internet/i,
|
|
41
41
|
/offline/i
|
|
42
42
|
];
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
// Transient HTTP status codes
|
|
45
45
|
this.transientStatusCodes = [
|
|
46
46
|
408, // Request Timeout
|
|
@@ -69,7 +69,7 @@ class InstallationRetryManager {
|
|
|
69
69
|
const { operationId, agentId, operationType = 'INSTALLATION' } = context;
|
|
70
70
|
let lastError = null;
|
|
71
71
|
let attempt = 0;
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
if (this.logger) {
|
|
74
74
|
this.logger.info(`Starting operation with retry logic`, {
|
|
75
75
|
operationId,
|
|
@@ -81,7 +81,7 @@ class InstallationRetryManager {
|
|
|
81
81
|
|
|
82
82
|
while (attempt <= this.maxRetries) {
|
|
83
83
|
attempt++;
|
|
84
|
-
|
|
84
|
+
|
|
85
85
|
try {
|
|
86
86
|
if (this.logger) {
|
|
87
87
|
this.logger.info(`Executing operation attempt ${attempt}`, {
|
|
@@ -93,7 +93,7 @@ class InstallationRetryManager {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
const result = await operation();
|
|
96
|
-
|
|
96
|
+
|
|
97
97
|
// Success - log and return
|
|
98
98
|
if (this.logger) {
|
|
99
99
|
this.logger.info(`Operation succeeded on attempt ${attempt}`, {
|
|
@@ -114,10 +114,10 @@ class InstallationRetryManager {
|
|
|
114
114
|
|
|
115
115
|
} catch (error) {
|
|
116
116
|
lastError = error;
|
|
117
|
-
|
|
117
|
+
|
|
118
118
|
// Check if error is retryable
|
|
119
119
|
const isRetryable = this.isRetryableError(error);
|
|
120
|
-
|
|
120
|
+
|
|
121
121
|
if (this.logger) {
|
|
122
122
|
this.logger.warn(`Operation attempt ${attempt} failed`, {
|
|
123
123
|
operationId,
|
|
@@ -131,10 +131,10 @@ class InstallationRetryManager {
|
|
|
131
131
|
|
|
132
132
|
// If not retryable or no more attempts, throw error
|
|
133
133
|
if (!isRetryable || attempt > this.maxRetries) {
|
|
134
|
-
const failureMessage = !isRetryable ?
|
|
134
|
+
const failureMessage = !isRetryable ?
|
|
135
135
|
`Non-retryable error: ${error.message}` :
|
|
136
136
|
`Operation failed after ${attempt} attempts: ${error.message}`;
|
|
137
|
-
|
|
137
|
+
|
|
138
138
|
if (this.logger) {
|
|
139
139
|
this.logger.error(`Operation failed permanently`, {
|
|
140
140
|
operationId,
|
|
@@ -150,7 +150,7 @@ class InstallationRetryManager {
|
|
|
150
150
|
|
|
151
151
|
// Calculate delay for next attempt
|
|
152
152
|
const delay = this.calculateDelay(attempt);
|
|
153
|
-
|
|
153
|
+
|
|
154
154
|
if (this.logger) {
|
|
155
155
|
this.logger.info(`Waiting ${delay}ms before retry`, {
|
|
156
156
|
operationId,
|
|
@@ -177,12 +177,12 @@ class InstallationRetryManager {
|
|
|
177
177
|
*/
|
|
178
178
|
isRetryableError(error) {
|
|
179
179
|
const errorMessage = error.message.toLowerCase();
|
|
180
|
-
|
|
180
|
+
|
|
181
181
|
// Check network error patterns
|
|
182
|
-
const isNetworkError = this.networkErrorPatterns.some(pattern =>
|
|
182
|
+
const isNetworkError = this.networkErrorPatterns.some(pattern =>
|
|
183
183
|
pattern.test(errorMessage)
|
|
184
184
|
);
|
|
185
|
-
|
|
185
|
+
|
|
186
186
|
if (isNetworkError) {
|
|
187
187
|
return true;
|
|
188
188
|
}
|
|
@@ -218,19 +218,19 @@ class InstallationRetryManager {
|
|
|
218
218
|
calculateDelay(attempt) {
|
|
219
219
|
// Exponential backoff: delay = baseDelay * (multiplier ^ (attempt - 1))
|
|
220
220
|
let delay = this.baseDelay * Math.pow(this.backoffMultiplier, attempt - 1);
|
|
221
|
-
|
|
221
|
+
|
|
222
222
|
// Cap at maximum delay
|
|
223
223
|
delay = Math.min(delay, this.maxDelay);
|
|
224
|
-
|
|
224
|
+
|
|
225
225
|
// Add jitter to prevent thundering herd
|
|
226
226
|
if (this.jitter) {
|
|
227
227
|
const jitterRange = delay * 0.1; // 10% jitter
|
|
228
228
|
delay = delay + (Math.random() - 0.5) * jitterRange;
|
|
229
229
|
}
|
|
230
|
-
|
|
230
|
+
|
|
231
231
|
// Ensure minimum delay
|
|
232
232
|
delay = Math.max(delay, 100);
|
|
233
|
-
|
|
233
|
+
|
|
234
234
|
return Math.round(delay);
|
|
235
235
|
}
|
|
236
236
|
|
|
@@ -268,7 +268,7 @@ class InstallationRetryManager {
|
|
|
268
268
|
const failed = attempts.length - successful;
|
|
269
269
|
const totalDuration = attempts.reduce((sum, a) => sum + (a.duration || 0), 0);
|
|
270
270
|
const averageDuration = attempts.length > 0 ? totalDuration / attempts.length : 0;
|
|
271
|
-
|
|
271
|
+
|
|
272
272
|
return {
|
|
273
273
|
totalAttempts: attempts.length,
|
|
274
274
|
successful,
|
|
@@ -290,7 +290,7 @@ class InstallationRetryManager {
|
|
|
290
290
|
if (config.maxDelay !== undefined) this.maxDelay = config.maxDelay;
|
|
291
291
|
if (config.backoffMultiplier !== undefined) this.backoffMultiplier = config.backoffMultiplier;
|
|
292
292
|
if (config.jitter !== undefined) this.jitter = config.jitter;
|
|
293
|
-
|
|
293
|
+
|
|
294
294
|
if (this.logger) {
|
|
295
295
|
this.logger.info('Retry configuration updated', {
|
|
296
296
|
maxRetries: this.maxRetries,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Installation Type Enumeration
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Defines types of installation methods for Windows agents.
|
|
5
5
|
* Follows constitutional requirements: <555 lines, test-first approach.
|
|
6
6
|
*/
|
|
@@ -12,28 +12,28 @@
|
|
|
12
12
|
const InstallationType = {
|
|
13
13
|
// Windows Package Manager (native)
|
|
14
14
|
WINGET: 'WINGET',
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
// Node Package Manager (cross-platform)
|
|
17
17
|
NPM: 'NPM',
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
// Yarn Package Manager (cross-platform)
|
|
20
20
|
YARN: 'YARN',
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
// Direct installation methods (curl, wget, etc.)
|
|
23
23
|
DIRECT: 'DIRECT',
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
// Homebrew (macOS and Linux)
|
|
26
26
|
HOMEBREW: 'HOMEBREW',
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
// Go installation
|
|
29
29
|
GO: 'GO',
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
// PowerShell script (vendor-specific)
|
|
32
32
|
POWERSHELL: 'POWERSHELL',
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
// Chocolatey Package Manager (community)
|
|
35
35
|
CHOCOLATEY: 'CHOCOLATEY',
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
// VS Code Extension
|
|
38
38
|
VSCODE_EXTENSION: 'VSCODE_EXTENSION'
|
|
39
39
|
};
|
|
@@ -150,13 +150,13 @@ function isAvailableOnPlatform(type) {
|
|
|
150
150
|
if (process.platform === 'win32') {
|
|
151
151
|
return true;
|
|
152
152
|
}
|
|
153
|
-
|
|
153
|
+
|
|
154
154
|
// On non-Windows platforms, only cross-platform types are available
|
|
155
155
|
const crossPlatformTypes = [
|
|
156
|
-
InstallationType.NPM,
|
|
157
|
-
InstallationType.YARN,
|
|
158
|
-
InstallationType.DIRECT,
|
|
159
|
-
InstallationType.HOMEBREW,
|
|
156
|
+
InstallationType.NPM,
|
|
157
|
+
InstallationType.YARN,
|
|
158
|
+
InstallationType.DIRECT,
|
|
159
|
+
InstallationType.HOMEBREW,
|
|
160
160
|
InstallationType.GO,
|
|
161
161
|
InstallationType.VSCODE_EXTENSION
|
|
162
162
|
];
|