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
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
// @vibecodingmachine/core - AppleScript Kiro Quota Detection + OCR Helpers (CommonJS)
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const { execSync } = require('child_process');
|
|
5
|
+
|
|
6
|
+
class AppleScriptKiroQuota {
|
|
7
|
+
async _performOCR(imagePath) {
|
|
8
|
+
try {
|
|
9
|
+
const { execSync } = require('child_process');
|
|
10
|
+
|
|
11
|
+
// Check if Tesseract is available
|
|
12
|
+
try {
|
|
13
|
+
execSync('which tesseract', { timeout: 3000 });
|
|
14
|
+
} catch (error) {
|
|
15
|
+
return {
|
|
16
|
+
success: false,
|
|
17
|
+
error: 'Tesseract OCR not found. Please install with: brew install tesseract'
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Create temporary text file for OCR output
|
|
22
|
+
const os = require('os');
|
|
23
|
+
const path = require('path');
|
|
24
|
+
const tempDir = os.tmpdir();
|
|
25
|
+
const outputPath = path.join(tempDir, `ocr-output-${Date.now()}`);
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
// Run Tesseract OCR with specific settings for better accuracy
|
|
29
|
+
execSync(`tesseract "${imagePath}" "${outputPath}" -l eng --psm 6 --oem 1`, {
|
|
30
|
+
timeout: 15000,
|
|
31
|
+
stdio: 'pipe'
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Read the OCR result
|
|
35
|
+
const fs = require('fs');
|
|
36
|
+
const textFilePath = `${outputPath}.txt`;
|
|
37
|
+
|
|
38
|
+
if (!fs.existsSync(textFilePath)) {
|
|
39
|
+
return {
|
|
40
|
+
success: false,
|
|
41
|
+
error: 'OCR output file not created'
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let text = fs.readFileSync(textFilePath, 'utf8').trim();
|
|
46
|
+
|
|
47
|
+
// Clean up OCR output file
|
|
48
|
+
try {
|
|
49
|
+
fs.unlinkSync(textFilePath);
|
|
50
|
+
} catch (cleanupError) {
|
|
51
|
+
// Ignore cleanup errors
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Filter out gibberish and clean up the text
|
|
55
|
+
text = this._cleanOCRText(text);
|
|
56
|
+
|
|
57
|
+
// Validate that we have meaningful text
|
|
58
|
+
if (!this._isValidText(text)) {
|
|
59
|
+
return {
|
|
60
|
+
success: false,
|
|
61
|
+
error: 'OCR produced only gibberish or no meaningful text'
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
success: true,
|
|
67
|
+
text: text
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
} catch (tesseractError) {
|
|
71
|
+
return {
|
|
72
|
+
success: false,
|
|
73
|
+
error: `Tesseract execution failed: ${tesseractError.message}`
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
} catch (error) {
|
|
78
|
+
return {
|
|
79
|
+
success: false,
|
|
80
|
+
error: `OCR setup failed: ${error.message}`
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Clean and filter OCR text to remove gibberish
|
|
87
|
+
* @param {string} text - Raw OCR text
|
|
88
|
+
* @returns {string} - Cleaned text
|
|
89
|
+
*/
|
|
90
|
+
_cleanOCRText(text) {
|
|
91
|
+
if (!text) return '';
|
|
92
|
+
|
|
93
|
+
// Remove common OCR artifacts and gibberish patterns
|
|
94
|
+
let cleaned = text
|
|
95
|
+
// Remove single characters on separate lines
|
|
96
|
+
.replace(/^[a-zA-Z0-9]$/gm, '')
|
|
97
|
+
// Remove lines with mostly numbers (terminal line numbers)
|
|
98
|
+
.replace(/^\d+\s*$/gm, '')
|
|
99
|
+
// Remove lines with special characters only
|
|
100
|
+
.replace(/^[^\w\s]+$/gm, '')
|
|
101
|
+
// Remove common terminal artifacts
|
|
102
|
+
.replace(/^[>»]$/gm, '')
|
|
103
|
+
// Remove very short lines (likely noise)
|
|
104
|
+
.replace(/^(.{1,2})$/gm, '')
|
|
105
|
+
// Clean up multiple spaces
|
|
106
|
+
.replace(/\s+/g, ' ')
|
|
107
|
+
// Remove empty lines
|
|
108
|
+
.replace(/\n\s*\n/g, '\n')
|
|
109
|
+
.trim();
|
|
110
|
+
|
|
111
|
+
return cleaned;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Validate that OCR text is meaningful and not gibberish
|
|
116
|
+
* @param {string} text - OCR text to validate
|
|
117
|
+
* @returns {boolean} - Whether the text is valid
|
|
118
|
+
*/
|
|
119
|
+
_isValidText(text) {
|
|
120
|
+
if (!text || text.length < 10) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Check for meaningful content
|
|
125
|
+
const words = text.split(/\s+/);
|
|
126
|
+
const meaningfulWords = words.filter(word =>
|
|
127
|
+
word.length > 2 && // Skip very short words
|
|
128
|
+
!/^\d+$/.test(word) && // Skip pure numbers
|
|
129
|
+
!/^[^\w]+$/.test(word) // Skip special characters only
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
// Need at least 3 meaningful words
|
|
133
|
+
if (meaningfulWords.length < 3) {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Check for quota-related keywords (this is what we're looking for)
|
|
138
|
+
const hasQuotaKeywords = /\b(usage|limit|quota|agent|cursor|pro|upgrade|hit)\b/i.test(text);
|
|
139
|
+
|
|
140
|
+
// If we have quota keywords, be more lenient
|
|
141
|
+
if (hasQuotaKeywords) {
|
|
142
|
+
return meaningfulWords.length >= 2;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Otherwise, require more meaningful content
|
|
146
|
+
return meaningfulWords.length >= 5;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Check AWS Kiro UI for quota limit messages
|
|
151
|
+
* This is best-effort: Kiro may render quota messages in different UI elements or web-based UI
|
|
152
|
+
* @returns {Promise<{isRateLimited: boolean, message?: string, resumeAt?: string, note?: string}>}
|
|
153
|
+
*/
|
|
154
|
+
async checkKiroQuotaLimit() {
|
|
155
|
+
try {
|
|
156
|
+
// First try AppleScript UI detection
|
|
157
|
+
const script = `
|
|
158
|
+
tell application "System Events"
|
|
159
|
+
set processName to "AWS Kiro"
|
|
160
|
+
try
|
|
161
|
+
if not (exists process "AWS Kiro") then
|
|
162
|
+
set processName to "Kiro"
|
|
163
|
+
end if
|
|
164
|
+
on error
|
|
165
|
+
set processName to "Kiro"
|
|
166
|
+
end try
|
|
167
|
+
|
|
168
|
+
if not (exists process processName) then
|
|
169
|
+
return "NOT_RUNNING"
|
|
170
|
+
end if
|
|
171
|
+
|
|
172
|
+
tell process processName
|
|
173
|
+
set frontmost to true
|
|
174
|
+
delay 0.4
|
|
175
|
+
|
|
176
|
+
set allText to ""
|
|
177
|
+
|
|
178
|
+
-- Get window title (might contain quota info)
|
|
179
|
+
try
|
|
180
|
+
set windowTitle to title of window 1
|
|
181
|
+
set allText to allText & "WINDOW_TITLE: " & windowTitle & "\\n"
|
|
182
|
+
end try
|
|
183
|
+
|
|
184
|
+
-- Get window description
|
|
185
|
+
try
|
|
186
|
+
set windowDesc to description of window 1
|
|
187
|
+
set allText to allText & "WINDOW_DESC: " & windowDesc & "\\n"
|
|
188
|
+
end try
|
|
189
|
+
|
|
190
|
+
-- Get window help text
|
|
191
|
+
try
|
|
192
|
+
set windowHelp to help of window 1
|
|
193
|
+
set allText to allText & "WINDOW_HELP: " & windowHelp & "\\n"
|
|
194
|
+
end try
|
|
195
|
+
|
|
196
|
+
-- Try to get text from main window
|
|
197
|
+
try
|
|
198
|
+
set windowText to (value of static text of window 1 as string)
|
|
199
|
+
set allText to allText & "WINDOW_STATIC: " & windowText & "\\n"
|
|
200
|
+
end try
|
|
201
|
+
|
|
202
|
+
-- Try to get text from groups in main window
|
|
203
|
+
try
|
|
204
|
+
set groupsList to groups of window 1
|
|
205
|
+
repeat with g in groupsList
|
|
206
|
+
try
|
|
207
|
+
set groupText to (value of static text of g as string)
|
|
208
|
+
set allText to allText & "GROUP: " & groupText & "\\n"
|
|
209
|
+
end try
|
|
210
|
+
end repeat
|
|
211
|
+
end try
|
|
212
|
+
|
|
213
|
+
-- Try to get text from buttons in main window
|
|
214
|
+
try
|
|
215
|
+
set buttonsList to buttons of window 1
|
|
216
|
+
repeat with b in buttonsList
|
|
217
|
+
try
|
|
218
|
+
set buttonText to (name of b as string)
|
|
219
|
+
set allText to allText & "BUTTON: " & buttonText & "\\n"
|
|
220
|
+
end try
|
|
221
|
+
end repeat
|
|
222
|
+
end try
|
|
223
|
+
|
|
224
|
+
-- Try to get text from text fields in main window
|
|
225
|
+
try
|
|
226
|
+
set textFieldsList to text fields of window 1
|
|
227
|
+
repeat with tf in textFieldsList
|
|
228
|
+
try
|
|
229
|
+
set fieldText to (value of tf as string)
|
|
230
|
+
set allText to allText & "TEXT_FIELD: " & fieldText & "\\n"
|
|
231
|
+
end try
|
|
232
|
+
end repeat
|
|
233
|
+
end try
|
|
234
|
+
|
|
235
|
+
-- Try to get text from text views in main window
|
|
236
|
+
try
|
|
237
|
+
set textViewsList to text views of window 1
|
|
238
|
+
repeat with tv in textViewsList
|
|
239
|
+
try
|
|
240
|
+
set viewText to (value of tv as string)
|
|
241
|
+
set allText to allText & "TEXT_VIEW: " & viewText & "\\n"
|
|
242
|
+
end try
|
|
243
|
+
end repeat
|
|
244
|
+
end try
|
|
245
|
+
|
|
246
|
+
-- Try to get text from sheets (dialogs/alerts)
|
|
247
|
+
try
|
|
248
|
+
set sheetsList to sheets of window 1
|
|
249
|
+
repeat with s in sheetsList
|
|
250
|
+
try
|
|
251
|
+
set sheetText to (value of static text of s as string)
|
|
252
|
+
set allText to allText & "SHEET: " & sheetText & "\\n"
|
|
253
|
+
end try
|
|
254
|
+
end repeat
|
|
255
|
+
end try
|
|
256
|
+
|
|
257
|
+
-- Try to get text from all UI elements (catch-all)
|
|
258
|
+
try
|
|
259
|
+
set uiElementsList to every UI element of window 1
|
|
260
|
+
repeat with element in uiElementsList
|
|
261
|
+
try
|
|
262
|
+
set elementText to value of element as string
|
|
263
|
+
if elementText is not missing value and elementText is not "" then
|
|
264
|
+
set allText to allText & "UI_ELEMENT: " & elementText & "\\n"
|
|
265
|
+
end if
|
|
266
|
+
end try
|
|
267
|
+
end repeat
|
|
268
|
+
end try
|
|
269
|
+
|
|
270
|
+
-- Try to get accessibility attributes
|
|
271
|
+
try
|
|
272
|
+
set windowRole to role of window 1
|
|
273
|
+
set allText to allText & "WINDOW_ROLE: " & windowRole & "\\n"
|
|
274
|
+
end try
|
|
275
|
+
|
|
276
|
+
try
|
|
277
|
+
set windowSubrole to subrole of window 1
|
|
278
|
+
set allText to allText & "WINDOW_SUBROLE: " & windowSubrole & "\\n"
|
|
279
|
+
end try
|
|
280
|
+
|
|
281
|
+
return allText
|
|
282
|
+
end tell
|
|
283
|
+
end tell
|
|
284
|
+
`;
|
|
285
|
+
|
|
286
|
+
const raw = execSync(`osascript -e '${script.replace(/'/g, "'\\''")}'`, {
|
|
287
|
+
encoding: 'utf8',
|
|
288
|
+
timeout: 8000
|
|
289
|
+
}).trim();
|
|
290
|
+
|
|
291
|
+
if (!raw || raw === 'NOT_RUNNING') {
|
|
292
|
+
return {
|
|
293
|
+
isRateLimited: false,
|
|
294
|
+
note: raw === 'NOT_RUNNING' ? 'AWS Kiro not running' : 'No readable UI text'
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
const text = raw.replace(/\s+/g, ' ').trim();
|
|
299
|
+
const lower = text.toLowerCase();
|
|
300
|
+
|
|
301
|
+
// Check for Kiro-specific quota limit patterns (expanded for better detection)
|
|
302
|
+
const hasKiroQuota = lower.includes('quota limit exceeded') ||
|
|
303
|
+
lower.includes('usage limit reached') ||
|
|
304
|
+
lower.includes('rate limit exceeded') ||
|
|
305
|
+
lower.includes('api limit exceeded') ||
|
|
306
|
+
lower.includes('request limit exceeded') ||
|
|
307
|
+
lower.includes('too many requests') ||
|
|
308
|
+
lower.includes('quota exceeded') ||
|
|
309
|
+
lower.includes('limit exceeded') ||
|
|
310
|
+
lower.includes('usage exceeded') ||
|
|
311
|
+
lower.includes('rate limited') ||
|
|
312
|
+
lower.includes('api limited') ||
|
|
313
|
+
lower.includes('request limited') ||
|
|
314
|
+
lower.includes('quota reached') ||
|
|
315
|
+
lower.includes('limit reached') ||
|
|
316
|
+
lower.includes('usage reached') ||
|
|
317
|
+
lower.includes('cap reached') ||
|
|
318
|
+
lower.includes('cap exceeded') ||
|
|
319
|
+
lower.includes('spending cap') ||
|
|
320
|
+
lower.includes('usage cap') ||
|
|
321
|
+
lower.includes('daily limit') ||
|
|
322
|
+
lower.includes('monthly limit') ||
|
|
323
|
+
lower.includes('hourly limit') ||
|
|
324
|
+
lower.includes('request limit') ||
|
|
325
|
+
lower.includes('token limit') ||
|
|
326
|
+
lower.includes('credit limit') ||
|
|
327
|
+
lower.includes('billing limit') ||
|
|
328
|
+
lower.includes('subscription limit') ||
|
|
329
|
+
lower.includes('plan limit') ||
|
|
330
|
+
lower.includes('tier limit') ||
|
|
331
|
+
lower.includes('upgrade required') ||
|
|
332
|
+
lower.includes('upgrade needed') ||
|
|
333
|
+
lower.includes('upgrade to pro') ||
|
|
334
|
+
lower.includes('upgrade to premium') ||
|
|
335
|
+
lower.includes('upgrade plan') ||
|
|
336
|
+
lower.includes('increase limit') ||
|
|
337
|
+
lower.includes('exhausted') ||
|
|
338
|
+
lower.includes('no more requests') ||
|
|
339
|
+
lower.includes('no more credits') ||
|
|
340
|
+
lower.includes('insufficient credits') ||
|
|
341
|
+
lower.includes('insufficient quota') ||
|
|
342
|
+
lower.includes('maximum reached') ||
|
|
343
|
+
lower.includes('max requests') ||
|
|
344
|
+
lower.includes('max usage') ||
|
|
345
|
+
lower.includes('over limit') ||
|
|
346
|
+
lower.includes('over quota') ||
|
|
347
|
+
lower.includes('over usage') ||
|
|
348
|
+
lower.includes('out of credits') ||
|
|
349
|
+
lower.includes('out of credit') ||
|
|
350
|
+
lower.includes('credits exhausted') ||
|
|
351
|
+
lower.includes('credits depleted') ||
|
|
352
|
+
lower.includes('credits used up') ||
|
|
353
|
+
lower.includes('credit exhausted') ||
|
|
354
|
+
lower.includes('credit depleted') ||
|
|
355
|
+
lower.includes('credit used up') ||
|
|
356
|
+
lower.includes('credit balance is too low') ||
|
|
357
|
+
lower.includes('not enough credits') ||
|
|
358
|
+
lower.includes('credits: 0') ||
|
|
359
|
+
lower.includes('credit balance: 0') ||
|
|
360
|
+
lower.includes('no credits available') ||
|
|
361
|
+
lower.includes('purchase more credits') ||
|
|
362
|
+
lower.includes('credits: 0 remaining') ||
|
|
363
|
+
lower.includes('credit balance: 0') ||
|
|
364
|
+
(lower.includes('credits') && (lower.includes('out of') || lower.includes('exhausted') || lower.includes('depleted') || lower.includes('used up'))) ||
|
|
365
|
+
(lower.includes('credit') && (lower.includes('out of') || lower.includes('exhausted') || lower.includes('depleted') || lower.includes('used up') || lower.includes('balance is too low') || lower.includes('balance: 0'))) ||
|
|
366
|
+
(lower.includes('quota') && (lower.includes('exceeded') || lower.includes('reached') || lower.includes('exhaust'))) ||
|
|
367
|
+
(lower.includes('limit') && (lower.includes('exceeded') || lower.includes('reached') || lower.includes('exhaust'))) ||
|
|
368
|
+
(lower.includes('cap') && (lower.includes('exceeded') || lower.includes('reached') || lower.includes('exhaust')));
|
|
369
|
+
|
|
370
|
+
if (hasKiroQuota) {
|
|
371
|
+
// Try to extract reset time from various formats (expanded for better detection)
|
|
372
|
+
const resumeAtMatch = text.match(/(?:resume|reset|available|renew|refresh|restart|continue|try again)\s+(?:at|in|on)\s+(\d{1,2}\/\d{1,2}\/\d{4})\s*,?\s*(\d{1,2}:\d{2}(?::\d{2})?)\s*(am|pm)/i);
|
|
373
|
+
const resumeAt = resumeAtMatch
|
|
374
|
+
? `${resumeAtMatch[1]}, ${resumeAtMatch[2]} ${resumeAtMatch[3].toUpperCase()}`
|
|
375
|
+
: undefined;
|
|
376
|
+
|
|
377
|
+
// Also try other time formats
|
|
378
|
+
if (!resumeAt) {
|
|
379
|
+
const timeMatch = text.match(/(?:try again|resume|reset|available|renew|refresh|restart|continue)\s+(?:in|after)\s+(\d+)\s*(?:minutes?|hours?|days?|seconds?)/i);
|
|
380
|
+
if (timeMatch) {
|
|
381
|
+
// For "in X minutes/hours/days" format, we'll return the raw text
|
|
382
|
+
return {
|
|
383
|
+
isRateLimited: true,
|
|
384
|
+
message: text,
|
|
385
|
+
resumeTime: timeMatch[1] + ' ' + timeMatch[2]
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// Try specific time patterns like "resets at 12pm" or "resets at 3:30 PM"
|
|
391
|
+
if (!resumeAt) {
|
|
392
|
+
const timeOnlyMatch = text.match(/(?:resets|reset|resume|available)\s+(?:at|@)\s+(\d{1,2}:\d{2}(?::\d{2})?)\s*(am|pm)?/i);
|
|
393
|
+
if (timeOnlyMatch) {
|
|
394
|
+
const time = timeOnlyMatch[1] + (timeOnlyMatch[2] ? ' ' + timeOnlyMatch[2].toUpperCase() : '');
|
|
395
|
+
return {
|
|
396
|
+
isRateLimited: true,
|
|
397
|
+
message: text,
|
|
398
|
+
resumeTime: time
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// Try date patterns like "resets on January 15" or "resets on 1/15"
|
|
404
|
+
if (!resumeAt) {
|
|
405
|
+
const dateMatch = text.match(/(?:resets|reset|resume|available)\s+(?:on|at)\s+(\d{1,2}\/\d{1,2})(?:\/\d{4})?/i);
|
|
406
|
+
if (dateMatch) {
|
|
407
|
+
return {
|
|
408
|
+
isRateLimited: true,
|
|
409
|
+
message: text,
|
|
410
|
+
resumeTime: dateMatch[1]
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
return {
|
|
416
|
+
isRateLimited: true,
|
|
417
|
+
message: text,
|
|
418
|
+
resumeAt
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// If AppleScript didn't find quota messages, try fallback methods
|
|
423
|
+
return await this.checkKiroQuotaLimitFallback();
|
|
424
|
+
|
|
425
|
+
} catch (error) {
|
|
426
|
+
return {
|
|
427
|
+
isRateLimited: false,
|
|
428
|
+
note: `Failed to check AWS Kiro quota: ${error.message}`
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Fallback method to check Kiro quota using alternative approaches
|
|
435
|
+
* @returns {Promise<{isRateLimited: boolean, message?: string, note?: string}>}
|
|
436
|
+
*/
|
|
437
|
+
async checkKiroQuotaLimitFallback() {
|
|
438
|
+
try {
|
|
439
|
+
// Method 1: Check if Kiro process is running and consuming high CPU (might indicate quota error)
|
|
440
|
+
const processCheck = execSync('ps aux | grep -i kiro | grep -v grep', {
|
|
441
|
+
encoding: 'utf8',
|
|
442
|
+
timeout: 3000
|
|
443
|
+
}).trim();
|
|
444
|
+
|
|
445
|
+
if (!processCheck) {
|
|
446
|
+
return {
|
|
447
|
+
isRateLimited: false,
|
|
448
|
+
note: 'AWS Kiro process not found'
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// Method 2: Check for system notifications (macOS notifications about quota)
|
|
453
|
+
try {
|
|
454
|
+
const notifications = execSync('log show --predicate \'subsystem == "com.apple.notificationcenter"\' --info --last 5m | grep -i "kiro\\|quota\\|limit"', {
|
|
455
|
+
encoding: 'utf8',
|
|
456
|
+
timeout: 5000
|
|
457
|
+
}).trim();
|
|
458
|
+
|
|
459
|
+
if (notifications) {
|
|
460
|
+
const lower = notifications.toLowerCase();
|
|
461
|
+
if (lower.includes('quota') || lower.includes('limit') || lower.includes('exceeded')) {
|
|
462
|
+
return {
|
|
463
|
+
isRateLimited: true,
|
|
464
|
+
message: 'Quota limit detected in system notifications',
|
|
465
|
+
note: 'Detected via system notifications'
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
} catch (notifError) {
|
|
470
|
+
// Notifications check failed, continue
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// Method 3: Check console logs for Kiro-related quota messages
|
|
474
|
+
try {
|
|
475
|
+
const consoleLogs = execSync('log show --predicate \'process == "Kiro" OR process == "AWS Kiro"\' --info --last 10m | grep -i "quota\\|limit\\|exceeded\\|error"', {
|
|
476
|
+
encoding: 'utf8',
|
|
477
|
+
timeout: 5000
|
|
478
|
+
}).trim();
|
|
479
|
+
|
|
480
|
+
if (consoleLogs) {
|
|
481
|
+
const lower = consoleLogs.toLowerCase();
|
|
482
|
+
if (lower.includes('quota') || lower.includes('limit') || lower.includes('exceeded')) {
|
|
483
|
+
return {
|
|
484
|
+
isRateLimited: true,
|
|
485
|
+
message: 'Quota limit detected in console logs',
|
|
486
|
+
note: 'Detected via console logs'
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
} catch (logError) {
|
|
491
|
+
// Console log check failed, continue
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// Method 4: Check if Kiro window title contains quota information
|
|
495
|
+
try {
|
|
496
|
+
const windowTitle = execSync(`osascript -e '
|
|
497
|
+
tell application "System Events"
|
|
498
|
+
set processName to "AWS Kiro"
|
|
499
|
+
try
|
|
500
|
+
if not (exists process "AWS Kiro") then
|
|
501
|
+
set processName to "Kiro"
|
|
502
|
+
end if
|
|
503
|
+
on error
|
|
504
|
+
set processName to "Kiro"
|
|
505
|
+
end try
|
|
506
|
+
|
|
507
|
+
if exists process processName then
|
|
508
|
+
return title of window 1 of process processName
|
|
509
|
+
end if
|
|
510
|
+
end tell
|
|
511
|
+
'`, {
|
|
512
|
+
encoding: 'utf8',
|
|
513
|
+
timeout: 3000
|
|
514
|
+
}).trim();
|
|
515
|
+
|
|
516
|
+
if (windowTitle) {
|
|
517
|
+
const lower = windowTitle.toLowerCase();
|
|
518
|
+
if (lower.includes('quota') || lower.includes('limit') || lower.includes('exceeded')) {
|
|
519
|
+
return {
|
|
520
|
+
isRateLimited: true,
|
|
521
|
+
message: `Quota limit detected in window title: ${windowTitle}`,
|
|
522
|
+
note: 'Detected via window title'
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
} catch (titleError) {
|
|
527
|
+
// Window title check failed, continue
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
return {
|
|
531
|
+
isRateLimited: false,
|
|
532
|
+
note: 'No quota limit detected via fallback methods'
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
} catch (error) {
|
|
536
|
+
return {
|
|
537
|
+
isRateLimited: false,
|
|
538
|
+
note: `Fallback quota check failed: ${error.message}`
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Open Cursor IDE
|
|
545
|
+
* @returns {Promise<Object>} Result object with success status and details
|
|
546
|
+
*/
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
module.exports = AppleScriptKiroQuota;
|
|
@@ -46,7 +46,7 @@ class AppleScriptManagerCore {
|
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Generic IDE opener - routes to specific IDE methods
|
|
49
|
-
* @param {string} ide - The IDE name ('cursor', '
|
|
49
|
+
* @param {string} ide - The IDE name ('cursor', 'devin', 'antigravity', 'vscode', etc.')
|
|
50
50
|
* @param {string} repoPath - Optional repository path to open
|
|
51
51
|
* @returns {Promise<Object>} Result object
|
|
52
52
|
*/
|
|
@@ -57,7 +57,7 @@ class AppleScriptManagerCore {
|
|
|
57
57
|
/**
|
|
58
58
|
* Send text to an IDE using platform-specific methods
|
|
59
59
|
* @param {string} text - The text to send
|
|
60
|
-
* @param {string} ide - The IDE name ('cursor', '
|
|
60
|
+
* @param {string} ide - The IDE name ('cursor', 'devin', 'claude')
|
|
61
61
|
* @param {string} repoPath - The repository path (optional, used for Claude)
|
|
62
62
|
* @returns {Promise<Object>} Result object with success status and details
|
|
63
63
|
*/
|
|
@@ -75,7 +75,7 @@ class AppleScriptManagerCore {
|
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* Read chat response from IDE using platform-specific methods
|
|
78
|
-
* @param {string} ide - The IDE name ('cursor', '
|
|
78
|
+
* @param {string} ide - The IDE name ('cursor', 'devin', 'vscode')
|
|
79
79
|
* @returns {Promise<string>} The chat response text
|
|
80
80
|
*/
|
|
81
81
|
async readChatResponse(ide) {
|
|
@@ -93,7 +93,7 @@ class AppleScriptManagerCore {
|
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
95
|
* Close previous chat thread in an IDE to prevent conflicts
|
|
96
|
-
* @param {string} ide - The IDE name ('cursor', 'vscode', '
|
|
96
|
+
* @param {string} ide - The IDE name ('cursor', 'vscode', 'devin', 'claude')
|
|
97
97
|
* @returns {Promise<Object>} Result object with success status and details
|
|
98
98
|
*/
|
|
99
99
|
async closePreviousChatThread(ide) {
|
|
@@ -103,7 +103,7 @@ class AppleScriptManagerCore {
|
|
|
103
103
|
/**
|
|
104
104
|
* Send text to an IDE with automatic thread closure
|
|
105
105
|
* @param {string} text - The text to send
|
|
106
|
-
* @param {string} ide - The IDE name ('cursor', 'vscode', '
|
|
106
|
+
* @param {string} ide - The IDE name ('cursor', 'vscode', 'devin')
|
|
107
107
|
* @returns {Promise<Object>} Result object with success status and details
|
|
108
108
|
*/
|
|
109
109
|
async sendTextWithThreadClosure(text, ide) {
|
|
@@ -179,7 +179,7 @@ class AppleScriptManagerCore {
|
|
|
179
179
|
|
|
180
180
|
/**
|
|
181
181
|
* Detect quota warnings using platform-specific methods
|
|
182
|
-
* @param {string} ide - The IDE name ('
|
|
182
|
+
* @param {string} ide - The IDE name ('devin')
|
|
183
183
|
* @returns {Promise<Object>} Quota detection result
|
|
184
184
|
*/
|
|
185
185
|
async detectQuotaWarning(ide) {
|
|
@@ -187,11 +187,11 @@ class AppleScriptManagerCore {
|
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
/**
|
|
190
|
-
* Check
|
|
190
|
+
* Check Devin for rate limit errors
|
|
191
191
|
* @returns {Promise<Object>} Result object with isRateLimited flag and details
|
|
192
192
|
*/
|
|
193
|
-
async
|
|
194
|
-
return await this.ideManager.
|
|
193
|
+
async checkDevinRateLimit() {
|
|
194
|
+
return await this.ideManager.checkDevinRateLimit();
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
/**
|
|
@@ -204,12 +204,30 @@ class AppleScriptManagerCore {
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
/**
|
|
207
|
-
* Send text to
|
|
207
|
+
* Send text to Devin extension within VS Code
|
|
208
208
|
* @param {string} text - The text to send
|
|
209
209
|
* @returns {Promise<Object>} Result object with success status
|
|
210
210
|
*/
|
|
211
|
-
async
|
|
212
|
-
return await this.ideManager.
|
|
211
|
+
async sendTextToDevinExtension(text) {
|
|
212
|
+
return await this.ideManager.sendTextToDevinExtension(text);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Send text to Devin IDE (alias for sendTextToDevinExtension)
|
|
217
|
+
* @param {string} text - The text to send
|
|
218
|
+
* @returns {Promise<Object>} Result object with success status
|
|
219
|
+
*/
|
|
220
|
+
async sendTextToDevin(text) {
|
|
221
|
+
return await this.ideManager.sendTextToDevinExtension(text);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Send text to Cursor IDE
|
|
226
|
+
* @param {string} text - The text to send
|
|
227
|
+
* @returns {Promise<Object>} Result object with success status
|
|
228
|
+
*/
|
|
229
|
+
async sendTextToCursor(text) {
|
|
230
|
+
return await this.ideManager.sendTextToCursor(text);
|
|
213
231
|
}
|
|
214
232
|
|
|
215
233
|
/**
|