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
|
* Operation Types and Status Enumerations
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Defines types and statuses for logged operations.
|
|
5
5
|
* Follows constitutional requirements: <555 lines, test-first approach.
|
|
6
6
|
*/
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
const OperationType = {
|
|
13
13
|
// Agent installation
|
|
14
14
|
INSTALL: 'INSTALL',
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
// Agent verification
|
|
17
17
|
VERIFY: 'VERIFY',
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
// Status check
|
|
20
20
|
CHECK_STATUS: 'CHECK_STATUS',
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
// Agent update
|
|
23
23
|
UPDATE: 'UPDATE',
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
// Agent removal
|
|
26
26
|
UNINSTALL: 'UNINSTALL'
|
|
27
27
|
};
|
|
@@ -33,16 +33,16 @@ const OperationType = {
|
|
|
33
33
|
const OperationStatus = {
|
|
34
34
|
// Operation initiated
|
|
35
35
|
STARTED: 'STARTED',
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
// Operation finished successfully
|
|
38
38
|
COMPLETED: 'COMPLETED',
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
// Operation failed
|
|
41
41
|
FAILED: 'FAILED',
|
|
42
|
-
|
|
42
|
+
|
|
43
43
|
// Operation timed out
|
|
44
44
|
TIMEOUT: 'TIMEOUT',
|
|
45
|
-
|
|
45
|
+
|
|
46
46
|
// Operation was cancelled
|
|
47
47
|
CANCELLED: 'CANCELLED'
|
|
48
48
|
};
|
|
@@ -186,7 +186,7 @@ function isValidOperationStatus(status) {
|
|
|
186
186
|
function getValidFinalStatuses(type) {
|
|
187
187
|
// All operations can end in these states
|
|
188
188
|
const commonFinal = [OperationStatus.COMPLETED, OperationStatus.FAILED, OperationStatus.TIMEOUT];
|
|
189
|
-
|
|
189
|
+
|
|
190
190
|
// Add type-specific final statuses
|
|
191
191
|
switch (type) {
|
|
192
192
|
case OperationType.INSTALL:
|
|
@@ -277,11 +277,11 @@ function getRetryDelay(status, attempt = 1) {
|
|
|
277
277
|
};
|
|
278
278
|
|
|
279
279
|
const baseDelay = baseDelays[status] || 1000;
|
|
280
|
-
|
|
280
|
+
|
|
281
281
|
// Exponential backoff with jitter
|
|
282
282
|
const exponentialDelay = baseDelay * Math.pow(2, attempt - 1);
|
|
283
283
|
const jitter = Math.random() * 1000; // Add up to 1 second jitter
|
|
284
|
-
|
|
284
|
+
|
|
285
285
|
return Math.min(exponentialDelay + jitter, 60000); // Cap at 1 minute
|
|
286
286
|
}
|
|
287
287
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Performance Metrics Collector
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Collects and manages performance metrics for agent operations.
|
|
5
5
|
* Follows constitutional requirements: <555 lines, test-first approach.
|
|
6
6
|
*/
|
|
@@ -18,17 +18,17 @@ class PerformanceMetricsCollector {
|
|
|
18
18
|
this.enabled = options.enabled !== false; // Default to enabled
|
|
19
19
|
this.maxHistorySize = options.maxHistorySize || 1000;
|
|
20
20
|
this.flushInterval = options.flushInterval || 60000; // 1 minute
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
// Metrics storage
|
|
23
23
|
this.metrics = {
|
|
24
24
|
operations: new Map(),
|
|
25
25
|
system: new Map(),
|
|
26
26
|
performance: new Map()
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
// Active operations tracking
|
|
30
30
|
this.activeOperations = new Map();
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
// Start periodic flush if enabled
|
|
33
33
|
if (this.enabled) {
|
|
34
34
|
this.startPeriodicFlush();
|
|
@@ -43,10 +43,10 @@ class PerformanceMetricsCollector {
|
|
|
43
43
|
*/
|
|
44
44
|
startOperation(operationId, context = {}) {
|
|
45
45
|
if (!this.enabled) return this.createNoOpTracker();
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
const startTime = process.hrtime.bigint();
|
|
48
48
|
const startMemory = this.getMemoryUsage();
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
const operation = {
|
|
51
51
|
id: operationId,
|
|
52
52
|
type: context.type || 'UNKNOWN',
|
|
@@ -58,16 +58,16 @@ class PerformanceMetricsCollector {
|
|
|
58
58
|
phases: [],
|
|
59
59
|
checkpoints: []
|
|
60
60
|
};
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
this.activeOperations.set(operationId, operation);
|
|
63
|
-
|
|
63
|
+
|
|
64
64
|
// Record initial system metrics
|
|
65
65
|
this.recordSystemMetrics('operation_start', {
|
|
66
66
|
operationId,
|
|
67
67
|
type: operation.type,
|
|
68
68
|
agentId: operation.agentId
|
|
69
69
|
});
|
|
70
|
-
|
|
70
|
+
|
|
71
71
|
if (this.logger) {
|
|
72
72
|
this.logger.debug('Started operation tracking', {
|
|
73
73
|
operationId,
|
|
@@ -75,7 +75,7 @@ class PerformanceMetricsCollector {
|
|
|
75
75
|
agentId: operation.agentId
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
|
|
79
79
|
return {
|
|
80
80
|
addPhase: (phaseName, details = {}) => this.addOperationPhase(operationId, phaseName, details),
|
|
81
81
|
addCheckpoint: (checkpointName, details = {}) => this.addOperationCheckpoint(operationId, checkpointName, details),
|
|
@@ -93,19 +93,19 @@ class PerformanceMetricsCollector {
|
|
|
93
93
|
*/
|
|
94
94
|
addOperationPhase(operationId, phaseName, details = {}) {
|
|
95
95
|
if (!this.enabled) return;
|
|
96
|
-
|
|
96
|
+
|
|
97
97
|
const operation = this.activeOperations.get(operationId);
|
|
98
98
|
if (!operation) return;
|
|
99
|
-
|
|
99
|
+
|
|
100
100
|
const phase = {
|
|
101
101
|
name: phaseName,
|
|
102
102
|
startTime: Date.now(),
|
|
103
103
|
startMemory: this.getMemoryUsage(),
|
|
104
104
|
details
|
|
105
105
|
};
|
|
106
|
-
|
|
106
|
+
|
|
107
107
|
operation.phases.push(phase);
|
|
108
|
-
|
|
108
|
+
|
|
109
109
|
if (this.logger) {
|
|
110
110
|
this.logger.debug(`Added operation phase: ${phaseName}`, {
|
|
111
111
|
operationId,
|
|
@@ -123,19 +123,19 @@ class PerformanceMetricsCollector {
|
|
|
123
123
|
*/
|
|
124
124
|
addOperationCheckpoint(operationId, checkpointName, details = {}) {
|
|
125
125
|
if (!this.enabled) return;
|
|
126
|
-
|
|
126
|
+
|
|
127
127
|
const operation = this.activeOperations.get(operationId);
|
|
128
128
|
if (!operation) return;
|
|
129
|
-
|
|
129
|
+
|
|
130
130
|
const checkpoint = {
|
|
131
131
|
name: checkpointName,
|
|
132
132
|
timestamp: Date.now(),
|
|
133
133
|
memory: this.getMemoryUsage(),
|
|
134
134
|
details
|
|
135
135
|
};
|
|
136
|
-
|
|
136
|
+
|
|
137
137
|
operation.checkpoints.push(checkpoint);
|
|
138
|
-
|
|
138
|
+
|
|
139
139
|
if (this.logger) {
|
|
140
140
|
this.logger.debug(`Added operation checkpoint: ${checkpointName}`, {
|
|
141
141
|
operationId,
|
|
@@ -152,20 +152,20 @@ class PerformanceMetricsCollector {
|
|
|
152
152
|
*/
|
|
153
153
|
completeOperation(operationId, result = {}) {
|
|
154
154
|
if (!this.enabled) return;
|
|
155
|
-
|
|
155
|
+
|
|
156
156
|
const operation = this.activeOperations.get(operationId);
|
|
157
157
|
if (!operation) return;
|
|
158
|
-
|
|
158
|
+
|
|
159
159
|
const endTime = process.hrtime.bigint();
|
|
160
160
|
const endMemory = this.getMemoryUsage();
|
|
161
|
-
|
|
161
|
+
|
|
162
162
|
operation.endTime = Number(endTime / 1000000n);
|
|
163
163
|
operation.endMemory = endMemory;
|
|
164
164
|
operation.duration = operation.endTime - operation.startTime;
|
|
165
165
|
operation.memoryDelta = endMemory - operation.startMemory;
|
|
166
166
|
operation.status = 'COMPLETED';
|
|
167
167
|
operation.result = result;
|
|
168
|
-
|
|
168
|
+
|
|
169
169
|
// Complete final phase
|
|
170
170
|
if (operation.phases.length > 0) {
|
|
171
171
|
const lastPhase = operation.phases[operation.phases.length - 1];
|
|
@@ -175,13 +175,13 @@ class PerformanceMetricsCollector {
|
|
|
175
175
|
lastPhase.memoryDelta = endMemory - lastPhase.startMemory;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
|
|
178
|
+
|
|
179
179
|
// Store in metrics
|
|
180
180
|
this.storeOperationMetrics(operation);
|
|
181
|
-
|
|
181
|
+
|
|
182
182
|
// Remove from active operations
|
|
183
183
|
this.activeOperations.delete(operationId);
|
|
184
|
-
|
|
184
|
+
|
|
185
185
|
// Record completion metrics
|
|
186
186
|
this.recordSystemMetrics('operation_complete', {
|
|
187
187
|
operationId,
|
|
@@ -190,7 +190,7 @@ class PerformanceMetricsCollector {
|
|
|
190
190
|
memoryDelta: operation.memoryDelta,
|
|
191
191
|
success: true
|
|
192
192
|
});
|
|
193
|
-
|
|
193
|
+
|
|
194
194
|
if (this.logger) {
|
|
195
195
|
this.logger.info('Completed operation tracking', {
|
|
196
196
|
operationId,
|
|
@@ -208,26 +208,26 @@ class PerformanceMetricsCollector {
|
|
|
208
208
|
*/
|
|
209
209
|
failOperation(operationId, error) {
|
|
210
210
|
if (!this.enabled) return;
|
|
211
|
-
|
|
211
|
+
|
|
212
212
|
const operation = this.activeOperations.get(operationId);
|
|
213
213
|
if (!operation) return;
|
|
214
|
-
|
|
214
|
+
|
|
215
215
|
const endTime = process.hrtime.bigint();
|
|
216
216
|
const endMemory = this.getMemoryUsage();
|
|
217
|
-
|
|
217
|
+
|
|
218
218
|
operation.endTime = Number(endTime / 1000000n);
|
|
219
219
|
operation.endMemory = endMemory;
|
|
220
220
|
operation.duration = operation.endTime - operation.startTime;
|
|
221
221
|
operation.memoryDelta = endMemory - operation.startMemory;
|
|
222
222
|
operation.status = 'FAILED';
|
|
223
223
|
operation.error = error.message;
|
|
224
|
-
|
|
224
|
+
|
|
225
225
|
// Store in metrics
|
|
226
226
|
this.storeOperationMetrics(operation);
|
|
227
|
-
|
|
227
|
+
|
|
228
228
|
// Remove from active operations
|
|
229
229
|
this.activeOperations.delete(operationId);
|
|
230
|
-
|
|
230
|
+
|
|
231
231
|
// Record failure metrics
|
|
232
232
|
this.recordSystemMetrics('operation_fail', {
|
|
233
233
|
operationId,
|
|
@@ -236,7 +236,7 @@ class PerformanceMetricsCollector {
|
|
|
236
236
|
error: error.message,
|
|
237
237
|
success: false
|
|
238
238
|
});
|
|
239
|
-
|
|
239
|
+
|
|
240
240
|
if (this.logger) {
|
|
241
241
|
this.logger.warn('Failed operation tracking', {
|
|
242
242
|
operationId,
|
|
@@ -254,12 +254,12 @@ class PerformanceMetricsCollector {
|
|
|
254
254
|
storeOperationMetrics(operation) {
|
|
255
255
|
const typeMetrics = this.metrics.operations.get(operation.type) || [];
|
|
256
256
|
typeMetrics.push(operation);
|
|
257
|
-
|
|
257
|
+
|
|
258
258
|
// Limit history size
|
|
259
259
|
if (typeMetrics.length > this.maxHistorySize) {
|
|
260
260
|
typeMetrics.shift();
|
|
261
261
|
}
|
|
262
|
-
|
|
262
|
+
|
|
263
263
|
this.metrics.operations.set(operation.type, typeMetrics);
|
|
264
264
|
}
|
|
265
265
|
|
|
@@ -270,11 +270,11 @@ class PerformanceMetricsCollector {
|
|
|
270
270
|
*/
|
|
271
271
|
recordSystemMetrics(event, data = {}) {
|
|
272
272
|
if (!this.enabled) return;
|
|
273
|
-
|
|
273
|
+
|
|
274
274
|
const timestamp = Date.now();
|
|
275
275
|
const memory = this.getMemoryUsage();
|
|
276
276
|
const cpu = this.getCpuUsage();
|
|
277
|
-
|
|
277
|
+
|
|
278
278
|
const metric = {
|
|
279
279
|
timestamp,
|
|
280
280
|
event,
|
|
@@ -282,15 +282,15 @@ class PerformanceMetricsCollector {
|
|
|
282
282
|
cpu,
|
|
283
283
|
data
|
|
284
284
|
};
|
|
285
|
-
|
|
285
|
+
|
|
286
286
|
const systemMetrics = this.metrics.system.get(event) || [];
|
|
287
287
|
systemMetrics.push(metric);
|
|
288
|
-
|
|
288
|
+
|
|
289
289
|
// Limit history size
|
|
290
290
|
if (systemMetrics.length > this.maxHistorySize) {
|
|
291
291
|
systemMetrics.shift();
|
|
292
292
|
}
|
|
293
|
-
|
|
293
|
+
|
|
294
294
|
this.metrics.system.set(event, systemMetrics);
|
|
295
295
|
}
|
|
296
296
|
|
|
@@ -302,10 +302,10 @@ class PerformanceMetricsCollector {
|
|
|
302
302
|
getOperationMetrics(operationId) {
|
|
303
303
|
const operation = this.activeOperations.get(operationId);
|
|
304
304
|
if (!operation) return null;
|
|
305
|
-
|
|
305
|
+
|
|
306
306
|
const currentMemory = this.getMemoryUsage();
|
|
307
307
|
const currentTime = Date.now();
|
|
308
|
-
|
|
308
|
+
|
|
309
309
|
return {
|
|
310
310
|
id: operation.id,
|
|
311
311
|
type: operation.type,
|
|
@@ -326,35 +326,35 @@ class PerformanceMetricsCollector {
|
|
|
326
326
|
*/
|
|
327
327
|
getAggregatedMetrics(filters = {}) {
|
|
328
328
|
if (!this.enabled) return {};
|
|
329
|
-
|
|
329
|
+
|
|
330
330
|
const { operationType, timeRange, agentId } = filters;
|
|
331
331
|
const now = Date.now();
|
|
332
332
|
const timeLimit = timeRange ? now - timeRange : 0;
|
|
333
|
-
|
|
333
|
+
|
|
334
334
|
const result = {
|
|
335
335
|
summary: {},
|
|
336
336
|
operations: {},
|
|
337
337
|
performance: {},
|
|
338
338
|
system: {}
|
|
339
339
|
};
|
|
340
|
-
|
|
340
|
+
|
|
341
341
|
// Aggregate operation metrics
|
|
342
342
|
for (const [type, operations] of this.metrics.operations) {
|
|
343
343
|
if (operationType && type !== operationType) continue;
|
|
344
|
-
|
|
345
|
-
const filteredOps = operations.filter(op =>
|
|
346
|
-
op.endTime >= timeLimit &&
|
|
344
|
+
|
|
345
|
+
const filteredOps = operations.filter(op =>
|
|
346
|
+
op.endTime >= timeLimit &&
|
|
347
347
|
(!agentId || op.agentId === agentId)
|
|
348
348
|
);
|
|
349
|
-
|
|
349
|
+
|
|
350
350
|
if (filteredOps.length === 0) continue;
|
|
351
|
-
|
|
351
|
+
|
|
352
352
|
const completed = filteredOps.filter(op => op.status === 'COMPLETED');
|
|
353
353
|
const failed = filteredOps.filter(op => op.status === 'FAILED');
|
|
354
|
-
|
|
354
|
+
|
|
355
355
|
const durations = completed.map(op => op.duration);
|
|
356
356
|
const memoryDeltas = completed.map(op => op.memoryDelta);
|
|
357
|
-
|
|
357
|
+
|
|
358
358
|
result.operations[type] = {
|
|
359
359
|
total: filteredOps.length,
|
|
360
360
|
completed: completed.length,
|
|
@@ -366,7 +366,7 @@ class PerformanceMetricsCollector {
|
|
|
366
366
|
avgMemoryDelta: memoryDeltas.length > 0 ? memoryDeltas.reduce((a, b) => a + b, 0) / memoryDeltas.length : 0
|
|
367
367
|
};
|
|
368
368
|
}
|
|
369
|
-
|
|
369
|
+
|
|
370
370
|
// System metrics summary
|
|
371
371
|
for (const [event, metrics] of this.metrics.system) {
|
|
372
372
|
const recentMetrics = metrics.filter(m => m.timestamp >= timeLimit);
|
|
@@ -376,7 +376,7 @@ class PerformanceMetricsCollector {
|
|
|
376
376
|
avgCpu: recentMetrics.length > 0 ? recentMetrics.reduce((sum, m) => sum + (m.cpu || 0), 0) / recentMetrics.length : 0
|
|
377
377
|
};
|
|
378
378
|
}
|
|
379
|
-
|
|
379
|
+
|
|
380
380
|
return result;
|
|
381
381
|
}
|
|
382
382
|
|
|
@@ -403,7 +403,7 @@ class PerformanceMetricsCollector {
|
|
|
403
403
|
*/
|
|
404
404
|
startPeriodicFlush() {
|
|
405
405
|
if (this.flushTimer) return;
|
|
406
|
-
|
|
406
|
+
|
|
407
407
|
this.flushTimer = setInterval(() => {
|
|
408
408
|
this.flushMetrics();
|
|
409
409
|
}, this.flushInterval);
|
|
@@ -424,16 +424,16 @@ class PerformanceMetricsCollector {
|
|
|
424
424
|
*/
|
|
425
425
|
flushMetrics() {
|
|
426
426
|
if (!this.enabled) return;
|
|
427
|
-
|
|
427
|
+
|
|
428
428
|
const metrics = this.getAggregatedMetrics();
|
|
429
|
-
|
|
429
|
+
|
|
430
430
|
if (this.logger) {
|
|
431
431
|
this.logger.debug('Flushing performance metrics', {
|
|
432
432
|
operationsCount: Object.keys(metrics.operations).length,
|
|
433
433
|
systemEventsCount: Object.keys(metrics.system).length
|
|
434
434
|
});
|
|
435
435
|
}
|
|
436
|
-
|
|
436
|
+
|
|
437
437
|
// Could integrate with external metrics systems here
|
|
438
438
|
// For now, just log summary
|
|
439
439
|
}
|
|
@@ -460,7 +460,7 @@ class PerformanceMetricsCollector {
|
|
|
460
460
|
this.metrics.system.clear();
|
|
461
461
|
this.metrics.performance.clear();
|
|
462
462
|
this.activeOperations.clear();
|
|
463
|
-
|
|
463
|
+
|
|
464
464
|
if (this.logger) {
|
|
465
465
|
this.logger.info('Reset all performance metrics');
|
|
466
466
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Security Validation Service
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Provides security validation for downloaded packages and files.
|
|
5
5
|
* Follows constitutional requirements: <555 lines, test-first approach.
|
|
6
6
|
*/
|
|
@@ -32,7 +32,7 @@ class SecurityValidationService {
|
|
|
32
32
|
/\.vbs$/i, // VBScript files
|
|
33
33
|
/\.ps1$/i // PowerShell scripts (require validation)
|
|
34
34
|
];
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
// Known malicious signatures (simplified)
|
|
37
37
|
this.maliciousSignatures = [
|
|
38
38
|
'eval(',
|
|
@@ -93,7 +93,7 @@ class SecurityValidationService {
|
|
|
93
93
|
// File extension validation
|
|
94
94
|
const ext = path.extname(filePath).toLowerCase();
|
|
95
95
|
result.security.fileExtension = ext;
|
|
96
|
-
|
|
96
|
+
|
|
97
97
|
if (!this.allowedExtensions.includes(ext)) {
|
|
98
98
|
result.warnings.push(`File extension '${ext}' is not in the allowed list`);
|
|
99
99
|
}
|
|
@@ -108,13 +108,13 @@ class SecurityValidationService {
|
|
|
108
108
|
|
|
109
109
|
// Read file for content validation
|
|
110
110
|
const content = await fs.readFile(filePath);
|
|
111
|
-
|
|
111
|
+
|
|
112
112
|
// Calculate file hash
|
|
113
113
|
result.security.fileHash = this.calculateHash(content);
|
|
114
|
-
|
|
114
|
+
|
|
115
115
|
// Content validation
|
|
116
116
|
await this.validateContent(content, result);
|
|
117
|
-
|
|
117
|
+
|
|
118
118
|
// Permission validation (Windows specific)
|
|
119
119
|
if (process.platform === 'win32') {
|
|
120
120
|
await this.validateFilePermissions(filePath, result);
|
|
@@ -135,7 +135,7 @@ class SecurityValidationService {
|
|
|
135
135
|
} catch (error) {
|
|
136
136
|
result.valid = false;
|
|
137
137
|
result.errors.push(`Validation error: ${error.message}`);
|
|
138
|
-
|
|
138
|
+
|
|
139
139
|
if (this.logger) {
|
|
140
140
|
this.logger.error('File security validation failed', {
|
|
141
141
|
filePath,
|
|
@@ -154,7 +154,7 @@ class SecurityValidationService {
|
|
|
154
154
|
*/
|
|
155
155
|
async validateContent(content, result) {
|
|
156
156
|
const contentString = content.toString('utf8', 0, Math.min(content.length, 1024 * 1024)); // First 1MB
|
|
157
|
-
|
|
157
|
+
|
|
158
158
|
// Check for malicious signatures
|
|
159
159
|
for (const signature of this.maliciousSignatures) {
|
|
160
160
|
if (contentString.includes(signature)) {
|
|
@@ -211,7 +211,7 @@ class SecurityValidationService {
|
|
|
211
211
|
try {
|
|
212
212
|
// Check if file is writable (potential security risk)
|
|
213
213
|
await fs.access(filePath, fs.constants.W_OK);
|
|
214
|
-
|
|
214
|
+
|
|
215
215
|
// Check file attributes (Windows specific)
|
|
216
216
|
const stats = await fs.stat(filePath);
|
|
217
217
|
result.security.permissions = {
|
|
@@ -272,7 +272,7 @@ class SecurityValidationService {
|
|
|
272
272
|
} catch (error) {
|
|
273
273
|
result.valid = false;
|
|
274
274
|
result.errors.push(`Signature validation error: ${error.message}`);
|
|
275
|
-
|
|
275
|
+
|
|
276
276
|
if (this.logger) {
|
|
277
277
|
this.logger.error('Package signature validation failed', {
|
|
278
278
|
filePath,
|
|
@@ -299,7 +299,7 @@ class SecurityValidationService {
|
|
|
299
299
|
|
|
300
300
|
try {
|
|
301
301
|
const urlObj = new URL(url);
|
|
302
|
-
|
|
302
|
+
|
|
303
303
|
// Check protocol
|
|
304
304
|
if (!['https:', 'http:'].includes(urlObj.protocol)) {
|
|
305
305
|
result.valid = false;
|
|
@@ -386,14 +386,14 @@ class SecurityValidationService {
|
|
|
386
386
|
for (const filePath of filePaths) {
|
|
387
387
|
const fileResult = await this.validateFile(filePath, context);
|
|
388
388
|
results.files.push(fileResult);
|
|
389
|
-
|
|
389
|
+
|
|
390
390
|
if (fileResult.valid) {
|
|
391
391
|
results.summary.valid++;
|
|
392
392
|
} else {
|
|
393
393
|
results.summary.invalid++;
|
|
394
394
|
results.valid = false;
|
|
395
395
|
}
|
|
396
|
-
|
|
396
|
+
|
|
397
397
|
results.summary.warnings += fileResult.warnings.length;
|
|
398
398
|
results.summary.errors += fileResult.errors.length;
|
|
399
399
|
}
|
|
@@ -469,19 +469,19 @@ class SecurityValidationService {
|
|
|
469
469
|
if (result.security.maliciousContent) {
|
|
470
470
|
return 'HIGH';
|
|
471
471
|
}
|
|
472
|
-
|
|
472
|
+
|
|
473
473
|
if (result.errors.length > 0) {
|
|
474
474
|
return 'HIGH';
|
|
475
475
|
}
|
|
476
|
-
|
|
476
|
+
|
|
477
477
|
if (result.warnings.length > 3) {
|
|
478
478
|
return 'MEDIUM';
|
|
479
479
|
}
|
|
480
|
-
|
|
480
|
+
|
|
481
481
|
if (result.warnings.length > 0) {
|
|
482
482
|
return 'LOW';
|
|
483
483
|
}
|
|
484
|
-
|
|
484
|
+
|
|
485
485
|
return 'LOW';
|
|
486
486
|
}
|
|
487
487
|
|