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,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Discovery Scanner
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Core scanning logic for agent discovery.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
const {
|
|
8
|
-
commandExists,
|
|
9
|
-
getCommandHelp,
|
|
10
|
-
scanDirectory,
|
|
7
|
+
const {
|
|
8
|
+
commandExists,
|
|
9
|
+
getCommandHelp,
|
|
10
|
+
scanDirectory,
|
|
11
11
|
isAgentTool,
|
|
12
|
-
getFileMetadata
|
|
12
|
+
getFileMetadata
|
|
13
13
|
} = require('./discovery-utils');
|
|
14
14
|
|
|
15
15
|
const { DiscoveredAgent, DiscoveryResult } = require('./discovery-results');
|
|
@@ -24,9 +24,9 @@ const execAsync = promisify(exec);
|
|
|
24
24
|
class DiscoveryScanner {
|
|
25
25
|
constructor(options = {}) {
|
|
26
26
|
this.discoveryPaths = options.discoveryPaths || [
|
|
27
|
-
'/usr/local/bin',
|
|
28
|
-
'/opt/bin',
|
|
29
|
-
'/usr/bin/local/bin',
|
|
27
|
+
'/usr/local/bin',
|
|
28
|
+
'/opt/bin',
|
|
29
|
+
'/usr/bin/local/bin',
|
|
30
30
|
'/snap/bin'
|
|
31
31
|
];
|
|
32
32
|
this.timeout = options.timeout || 30000;
|
|
@@ -41,7 +41,7 @@ class DiscoveryScanner {
|
|
|
41
41
|
*/
|
|
42
42
|
async scanAllPaths(sessionId = null) {
|
|
43
43
|
const result = new DiscoveryResult(sessionId);
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
try {
|
|
46
46
|
if (this.logger) {
|
|
47
47
|
await this.logger.info('Starting discovery scan', {
|
|
@@ -53,7 +53,7 @@ class DiscoveryScanner {
|
|
|
53
53
|
result.metadata.pathsScanned = [...this.discoveryPaths];
|
|
54
54
|
|
|
55
55
|
// Scan all directories concurrently with limit
|
|
56
|
-
const scanPromises = this.discoveryPaths.map(path =>
|
|
56
|
+
const scanPromises = this.discoveryPaths.map(path =>
|
|
57
57
|
this.scanPath(path, result)
|
|
58
58
|
);
|
|
59
59
|
|
|
@@ -89,7 +89,7 @@ class DiscoveryScanner {
|
|
|
89
89
|
|
|
90
90
|
// Process files with concurrency limit
|
|
91
91
|
const chunks = this.chunkArray(files, this.maxConcurrency);
|
|
92
|
-
|
|
92
|
+
|
|
93
93
|
for (const chunk of chunks) {
|
|
94
94
|
await Promise.allSettled(
|
|
95
95
|
chunk.map(file => this.processFile(file, result))
|
|
@@ -111,7 +111,7 @@ class DiscoveryScanner {
|
|
|
111
111
|
try {
|
|
112
112
|
// Check if it's an agent tool
|
|
113
113
|
const isAgent = await isAgentTool(fileInfo);
|
|
114
|
-
|
|
114
|
+
|
|
115
115
|
if (!isAgent) {
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
@@ -126,12 +126,12 @@ class DiscoveryScanner {
|
|
|
126
126
|
|
|
127
127
|
// Create discovered agent
|
|
128
128
|
const agent = new DiscoveredAgent(fileInfo, commandHelp);
|
|
129
|
-
|
|
129
|
+
|
|
130
130
|
result.addAgent(agent);
|
|
131
131
|
|
|
132
132
|
} catch (error) {
|
|
133
|
-
result.addWarning(`Failed to process file: ${fileInfo.name}`, {
|
|
134
|
-
error: error.message
|
|
133
|
+
result.addWarning(`Failed to process file: ${fileInfo.name}`, {
|
|
134
|
+
error: error.message
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
}
|
|
@@ -151,11 +151,11 @@ class DiscoveryScanner {
|
|
|
151
151
|
'agent', 'ai', 'assistant', 'chat', 'llm', 'model',
|
|
152
152
|
'openai', 'anthropic', 'claude', 'gpt', 'gemini'
|
|
153
153
|
];
|
|
154
|
-
|
|
155
|
-
const keywordMatches = agentKeywords.filter(keyword =>
|
|
154
|
+
|
|
155
|
+
const keywordMatches = agentKeywords.filter(keyword =>
|
|
156
156
|
helpLower.includes(keyword.toLowerCase())
|
|
157
157
|
).length;
|
|
158
|
-
|
|
158
|
+
|
|
159
159
|
confidence += (keywordMatches / agentKeywords.length) * 0.4;
|
|
160
160
|
}
|
|
161
161
|
|
|
@@ -164,20 +164,20 @@ class DiscoveryScanner {
|
|
|
164
164
|
const nameKeywords = [
|
|
165
165
|
'agent', 'ai', 'assistant', 'chat', 'llm', 'claude', 'gpt'
|
|
166
166
|
];
|
|
167
|
-
|
|
168
|
-
const nameMatches = nameKeywords.filter(keyword =>
|
|
167
|
+
|
|
168
|
+
const nameMatches = nameKeywords.filter(keyword =>
|
|
169
169
|
nameLower.includes(keyword.toLowerCase())
|
|
170
170
|
).length;
|
|
171
|
-
|
|
171
|
+
|
|
172
172
|
confidence += (nameMatches / nameKeywords.length) * 0.3;
|
|
173
173
|
|
|
174
174
|
// Path analysis (20% weight)
|
|
175
175
|
const pathLower = agent.path.toLowerCase();
|
|
176
176
|
const pathIndicators = ['agent', 'ai', 'tools', 'bin'];
|
|
177
|
-
const pathMatches = pathIndicators.filter(indicator =>
|
|
177
|
+
const pathMatches = pathIndicators.filter(indicator =>
|
|
178
178
|
pathLower.includes(indicator.toLowerCase())
|
|
179
179
|
).length;
|
|
180
|
-
|
|
180
|
+
|
|
181
181
|
confidence += (pathMatches / pathIndicators.length) * 0.2;
|
|
182
182
|
|
|
183
183
|
// Executable status (10% weight)
|
|
@@ -210,14 +210,14 @@ class DiscoveryScanner {
|
|
|
210
210
|
|
|
211
211
|
// Verify high-confidence agents
|
|
212
212
|
const highConfidenceAgents = result.agents.filter(a => a.confidence > 0.7);
|
|
213
|
-
|
|
213
|
+
|
|
214
214
|
for (const agent of highConfidenceAgents) {
|
|
215
215
|
try {
|
|
216
216
|
const isVerified = await this.verifyAgent(agent);
|
|
217
217
|
agent.setVerified(isVerified);
|
|
218
218
|
} catch (error) {
|
|
219
|
-
result.addWarning(`Failed to verify agent: ${agent.name}`, {
|
|
220
|
-
error: error.message
|
|
219
|
+
result.addWarning(`Failed to verify agent: ${agent.name}`, {
|
|
220
|
+
error: error.message
|
|
221
221
|
});
|
|
222
222
|
}
|
|
223
223
|
}
|
|
@@ -232,7 +232,7 @@ class DiscoveryScanner {
|
|
|
232
232
|
try {
|
|
233
233
|
// Try to run the agent with --version or --help
|
|
234
234
|
const verifyCommands = ['--version', '--help', '-v', '-h'];
|
|
235
|
-
|
|
235
|
+
|
|
236
236
|
for (const cmd of verifyCommands) {
|
|
237
237
|
try {
|
|
238
238
|
await execAsync(`${agent.path} ${cmd}`, {
|
|
@@ -243,7 +243,7 @@ class DiscoveryScanner {
|
|
|
243
243
|
// Try next command
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
|
|
246
|
+
|
|
247
247
|
return false;
|
|
248
248
|
} catch (error) {
|
|
249
249
|
return false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Discovery Utilities
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Utility functions for agent discovery operations.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -33,9 +33,9 @@ async function commandExists(command) {
|
|
|
33
33
|
*/
|
|
34
34
|
async function getCommandHelp(command, timeout = 5000) {
|
|
35
35
|
return new Promise((resolve) => {
|
|
36
|
-
const child = spawn(command, ['--help'], {
|
|
36
|
+
const child = spawn(command, ['--help'], {
|
|
37
37
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
38
|
-
timeout
|
|
38
|
+
timeout
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
let stdout = '';
|
|
@@ -98,7 +98,7 @@ async function scanDirectory(dirPath) {
|
|
|
98
98
|
*/
|
|
99
99
|
async function isAgentTool(fileInfo) {
|
|
100
100
|
const { name, path: filePath } = fileInfo;
|
|
101
|
-
|
|
101
|
+
|
|
102
102
|
// Skip common non-agent executables
|
|
103
103
|
const skipPatterns = [
|
|
104
104
|
/^(ls|cd|pwd|cat|echo|rm|cp|mv|mkdir|chmod|chown)/,
|
|
@@ -119,8 +119,8 @@ async function isAgentTool(fileInfo) {
|
|
|
119
119
|
'agent', 'ai', 'assistant', 'chat', 'llm', 'model',
|
|
120
120
|
'openai', 'anthropic', 'claude', 'gpt', 'gemini'
|
|
121
121
|
];
|
|
122
|
-
|
|
123
|
-
return agentKeywords.some(keyword =>
|
|
122
|
+
|
|
123
|
+
return agentKeywords.some(keyword =>
|
|
124
124
|
help.toLowerCase().includes(keyword.toLowerCase())
|
|
125
125
|
);
|
|
126
126
|
} catch (error) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent Discovery - Executable Analyzer
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Analyzes executable files to determine if they are agent tools.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -22,7 +22,7 @@ async function analyzeExecutable(filePath, logger = null) {
|
|
|
22
22
|
// Get file info
|
|
23
23
|
const stat = await fs.stat(filePath);
|
|
24
24
|
const fileName = path.basename(filePath);
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
// Basic agent information
|
|
27
27
|
const agentInfo = {
|
|
28
28
|
id: generateAgentId(fileName),
|
|
@@ -80,7 +80,7 @@ function sanitizeAgentName(fileName) {
|
|
|
80
80
|
*/
|
|
81
81
|
function detectAgentType(fileName) {
|
|
82
82
|
const name = fileName.toLowerCase();
|
|
83
|
-
|
|
83
|
+
|
|
84
84
|
if (name.includes('ai') || name.includes('agent') || name.includes('assistant')) {
|
|
85
85
|
return 'ai-agent';
|
|
86
86
|
}
|
|
@@ -90,7 +90,7 @@ function detectAgentType(fileName) {
|
|
|
90
90
|
if (name.includes('bot') || name.includes('automation')) {
|
|
91
91
|
return 'automation-bot';
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
|
|
94
94
|
return 'unknown';
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -104,14 +104,14 @@ async function extractVersion(agentInfo, filePath, logger) {
|
|
|
104
104
|
try {
|
|
105
105
|
// Try common version flags
|
|
106
106
|
const versionFlags = ['--version', '-v', '--version', '-V'];
|
|
107
|
-
|
|
107
|
+
|
|
108
108
|
for (const flag of versionFlags) {
|
|
109
109
|
try {
|
|
110
|
-
const { stdout } = await execAsync(`${filePath} ${flag}`, {
|
|
110
|
+
const { stdout } = await execAsync(`${filePath} ${flag}`, {
|
|
111
111
|
timeout: 5000,
|
|
112
112
|
env: { ...process.env, NO_COLOR: '1' }
|
|
113
113
|
});
|
|
114
|
-
|
|
114
|
+
|
|
115
115
|
const version = parseVersionOutput(stdout);
|
|
116
116
|
if (version) {
|
|
117
117
|
agentInfo.version = version;
|
|
@@ -142,21 +142,21 @@ async function extractVersion(agentInfo, filePath, logger) {
|
|
|
142
142
|
*/
|
|
143
143
|
function parseVersionOutput(output) {
|
|
144
144
|
const lines = output.trim().split('\n');
|
|
145
|
-
|
|
145
|
+
|
|
146
146
|
for (const line of lines) {
|
|
147
147
|
// Look for version patterns
|
|
148
148
|
const versionMatch = line.match(/(\d+\.\d+(\.\d+)?)/);
|
|
149
149
|
if (versionMatch) {
|
|
150
150
|
return versionMatch[1];
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
|
|
153
153
|
// Look for "version X.Y.Z" patterns
|
|
154
154
|
const versionWordMatch = line.match(/version\s+(\d+\.\d+(\.\d+)?)/i);
|
|
155
155
|
if (versionWordMatch) {
|
|
156
156
|
return versionWordMatch[1];
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
|
|
159
|
+
|
|
160
160
|
return null;
|
|
161
161
|
}
|
|
162
162
|
|
|
@@ -172,14 +172,14 @@ function extractVersionFromContent(content) {
|
|
|
172
172
|
/const\s+VERSION\s*=\s*['"`]([^'"`]+)['"`]/i,
|
|
173
173
|
/__version__\s*=\s*['"`]([^'"`]+)['"`]/i
|
|
174
174
|
];
|
|
175
|
-
|
|
175
|
+
|
|
176
176
|
for (const pattern of patterns) {
|
|
177
177
|
const match = content.match(pattern);
|
|
178
178
|
if (match) {
|
|
179
179
|
return match[1];
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
|
|
182
|
+
|
|
183
183
|
return null;
|
|
184
184
|
}
|
|
185
185
|
|
|
@@ -192,11 +192,11 @@ function extractVersionFromContent(content) {
|
|
|
192
192
|
async function extractDescription(agentInfo, filePath, logger) {
|
|
193
193
|
try {
|
|
194
194
|
// Try help flag
|
|
195
|
-
const { stdout } = await execAsync(`${filePath} --help`, {
|
|
195
|
+
const { stdout } = await execAsync(`${filePath} --help`, {
|
|
196
196
|
timeout: 5000,
|
|
197
197
|
env: { ...process.env, NO_COLOR: '1' }
|
|
198
198
|
});
|
|
199
|
-
|
|
199
|
+
|
|
200
200
|
const description = parseDescriptionFromHelp(stdout);
|
|
201
201
|
if (description) {
|
|
202
202
|
agentInfo.description = description;
|
|
@@ -215,22 +215,22 @@ async function extractDescription(agentInfo, filePath, logger) {
|
|
|
215
215
|
*/
|
|
216
216
|
function parseDescriptionFromHelp(helpOutput) {
|
|
217
217
|
const lines = helpOutput.trim().split('\n');
|
|
218
|
-
|
|
218
|
+
|
|
219
219
|
// Look for description in first few lines
|
|
220
220
|
for (let i = 0; i < Math.min(5, lines.length); i++) {
|
|
221
221
|
const line = lines[i].trim();
|
|
222
|
-
|
|
222
|
+
|
|
223
223
|
// Skip empty lines and common help headers
|
|
224
224
|
if (!line || line.startsWith('Usage:') || line.startsWith('Options:')) {
|
|
225
225
|
continue;
|
|
226
226
|
}
|
|
227
|
-
|
|
227
|
+
|
|
228
228
|
// Return first meaningful line as description
|
|
229
229
|
if (line.length > 10 && !line.startsWith('-')) {
|
|
230
230
|
return line.substring(0, 200); // Limit length
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
|
|
233
|
+
|
|
234
234
|
return '';
|
|
235
235
|
}
|
|
236
236
|
|
|
@@ -242,41 +242,41 @@ function parseDescriptionFromHelp(helpOutput) {
|
|
|
242
242
|
*/
|
|
243
243
|
async function detectCapabilities(agentInfo, filePath, logger) {
|
|
244
244
|
const capabilities = [];
|
|
245
|
-
|
|
245
|
+
|
|
246
246
|
try {
|
|
247
247
|
// Check if it's a script
|
|
248
248
|
const content = await fs.readFile(filePath, 'utf8');
|
|
249
|
-
|
|
249
|
+
|
|
250
250
|
if (content.includes('chat') || content.includes('conversation')) {
|
|
251
251
|
capabilities.push('chat');
|
|
252
252
|
}
|
|
253
|
-
|
|
253
|
+
|
|
254
254
|
if (content.includes('code') || content.includes('programming')) {
|
|
255
255
|
capabilities.push('code-generation');
|
|
256
256
|
}
|
|
257
|
-
|
|
257
|
+
|
|
258
258
|
if (content.includes('file') || content.includes('document')) {
|
|
259
259
|
capabilities.push('file-processing');
|
|
260
260
|
}
|
|
261
|
-
|
|
261
|
+
|
|
262
262
|
if (content.includes('web') || content.includes('http')) {
|
|
263
263
|
capabilities.push('web-interaction');
|
|
264
264
|
}
|
|
265
|
-
|
|
265
|
+
|
|
266
266
|
// Check for common CLI patterns
|
|
267
267
|
if (content.includes('process.argv') || content.includes('yargs') || content.includes('commander')) {
|
|
268
268
|
capabilities.push('cli-interface');
|
|
269
269
|
}
|
|
270
|
-
|
|
270
|
+
|
|
271
271
|
} catch (error) {
|
|
272
272
|
if (logger) {
|
|
273
273
|
await logger.debug(`Capability detection failed for ${filePath}: ${error.message}`);
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
|
|
276
|
+
|
|
277
277
|
// Add default capabilities based on file type
|
|
278
278
|
capabilities.push('help');
|
|
279
|
-
|
|
279
|
+
|
|
280
280
|
agentInfo.capabilities = capabilities;
|
|
281
281
|
}
|
|
282
282
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent Discovery - History Manager
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Manages discovery history and status tracking.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -190,7 +190,7 @@ async function getDiscoveryStatistics(fileManager) {
|
|
|
190
190
|
lastDiscovery: status.lastDiscovery,
|
|
191
191
|
totalAgentsDiscovered: status.totalDiscovered || 0,
|
|
192
192
|
validAgents: status.validAgents || 0,
|
|
193
|
-
duplicateRate: status.totalDiscovered > 0 ?
|
|
193
|
+
duplicateRate: status.totalDiscovered > 0 ?
|
|
194
194
|
((status.duplicates || 0) / status.totalDiscovered * 100).toFixed(2) + '%' : '0%',
|
|
195
195
|
agentTypes: {},
|
|
196
196
|
recentOperations: history.slice(-10).reverse()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent Logger
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Provides structured logging for agent operations.
|
|
5
5
|
* Follows constitutional requirements: <555 lines, test-first approach.
|
|
6
6
|
*/
|
|
@@ -82,11 +82,11 @@ class AgentLogger {
|
|
|
82
82
|
if (!this.shouldLog('error')) return;
|
|
83
83
|
|
|
84
84
|
const logEntry = this.formatMessage('error', message, meta);
|
|
85
|
-
|
|
85
|
+
|
|
86
86
|
if (this.console) {
|
|
87
87
|
console.error(`[ERROR] ${logEntry.timestamp} - ${message}`, meta);
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
|
|
90
90
|
await this.writeToFile('error', logEntry);
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -100,11 +100,11 @@ class AgentLogger {
|
|
|
100
100
|
if (!this.shouldLog('warn')) return;
|
|
101
101
|
|
|
102
102
|
const logEntry = this.formatMessage('warn', message, meta);
|
|
103
|
-
|
|
103
|
+
|
|
104
104
|
if (this.console) {
|
|
105
105
|
console.warn(`[WARN] ${logEntry.timestamp} - ${message}`, meta);
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
|
|
108
108
|
await this.writeToFile('agent', logEntry);
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -118,11 +118,11 @@ class AgentLogger {
|
|
|
118
118
|
if (!this.shouldLog('info')) return;
|
|
119
119
|
|
|
120
120
|
const logEntry = this.formatMessage('info', message, meta);
|
|
121
|
-
|
|
121
|
+
|
|
122
122
|
if (this.console) {
|
|
123
123
|
console.info(`[INFO] ${logEntry.timestamp} - ${message}`, meta);
|
|
124
124
|
}
|
|
125
|
-
|
|
125
|
+
|
|
126
126
|
await this.writeToFile('agent', logEntry);
|
|
127
127
|
}
|
|
128
128
|
|
|
@@ -136,11 +136,11 @@ class AgentLogger {
|
|
|
136
136
|
if (!this.shouldLog('debug')) return;
|
|
137
137
|
|
|
138
138
|
const logEntry = this.formatMessage('debug', message, meta);
|
|
139
|
-
|
|
139
|
+
|
|
140
140
|
if (this.console) {
|
|
141
141
|
console.debug(`[DEBUG] ${logEntry.timestamp} - ${message}`, meta);
|
|
142
142
|
}
|
|
143
|
-
|
|
143
|
+
|
|
144
144
|
await this.writeToFile('debug', logEntry);
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -247,7 +247,7 @@ class AgentLogger {
|
|
|
247
247
|
*/
|
|
248
248
|
async logVerificationResult(agentId, testType, passed, duration, meta = {}) {
|
|
249
249
|
const level = passed ? 'info' : 'warn';
|
|
250
|
-
const message = passed
|
|
250
|
+
const message = passed
|
|
251
251
|
? `Verification ${testType} passed for ${agentId}`
|
|
252
252
|
: `Verification ${testType} failed for ${agentId}`;
|
|
253
253
|
|
|
@@ -429,10 +429,10 @@ class AgentLogger {
|
|
|
429
429
|
fileManager: this.fileManager,
|
|
430
430
|
console: this.console
|
|
431
431
|
});
|
|
432
|
-
|
|
432
|
+
|
|
433
433
|
// Add context to all log messages
|
|
434
434
|
childLogger.context = context;
|
|
435
|
-
|
|
435
|
+
|
|
436
436
|
// Override log methods to include context
|
|
437
437
|
['error', 'warn', 'info', 'debug'].forEach(level => {
|
|
438
438
|
const originalMethod = childLogger[level];
|
|
@@ -440,7 +440,7 @@ class AgentLogger {
|
|
|
440
440
|
await originalMethod.call(childLogger, message, { ...this.context, ...meta });
|
|
441
441
|
};
|
|
442
442
|
});
|
|
443
|
-
|
|
443
|
+
|
|
444
444
|
return childLogger;
|
|
445
445
|
}
|
|
446
446
|
|
|
@@ -452,12 +452,12 @@ class AgentLogger {
|
|
|
452
452
|
*/
|
|
453
453
|
async getAgentLogs(agentId, options = {}) {
|
|
454
454
|
const { limit = 50, level = null, since = null } = options;
|
|
455
|
-
|
|
455
|
+
|
|
456
456
|
const logs = await this.fileManager.readLogs('agent', {
|
|
457
457
|
limit: limit * 3, // Get more to filter
|
|
458
458
|
since
|
|
459
459
|
});
|
|
460
|
-
|
|
460
|
+
|
|
461
461
|
return logs
|
|
462
462
|
.filter(log => log.agentId === agentId)
|
|
463
463
|
.filter(log => !level || log.level === level.toUpperCase())
|
|
@@ -471,7 +471,7 @@ class AgentLogger {
|
|
|
471
471
|
*/
|
|
472
472
|
async getErrorLogs(options = {}) {
|
|
473
473
|
const { limit = 50, since = null } = options;
|
|
474
|
-
|
|
474
|
+
|
|
475
475
|
return await this.fileManager.readLogs('error', {
|
|
476
476
|
limit,
|
|
477
477
|
since
|
|
@@ -485,25 +485,25 @@ class AgentLogger {
|
|
|
485
485
|
*/
|
|
486
486
|
async cleanOldLogs(olderThanDays = 30) {
|
|
487
487
|
const results = {};
|
|
488
|
-
|
|
488
|
+
|
|
489
489
|
try {
|
|
490
490
|
results.agent = await this.fileManager.cleanOldLogs('agent', olderThanDays);
|
|
491
491
|
} catch (error) {
|
|
492
492
|
results.agent = { error: error.message };
|
|
493
493
|
}
|
|
494
|
-
|
|
494
|
+
|
|
495
495
|
try {
|
|
496
496
|
results.error = await this.fileManager.cleanOldLogs('error', olderThanDays);
|
|
497
497
|
} catch (error) {
|
|
498
498
|
results.error = { error: error.message };
|
|
499
499
|
}
|
|
500
|
-
|
|
500
|
+
|
|
501
501
|
try {
|
|
502
502
|
results.debug = await this.fileManager.cleanOldLogs('debug', olderThanDays);
|
|
503
503
|
} catch (error) {
|
|
504
504
|
results.debug = { error: error.message };
|
|
505
505
|
}
|
|
506
|
-
|
|
506
|
+
|
|
507
507
|
return results;
|
|
508
508
|
}
|
|
509
509
|
}
|