vibecodingmachine-core 2026.2.26-1739 → 2026.3.9-850
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 +1 -1
- package/src/agents/AgentCheckDiscoveryService.js +180 -0
- package/src/agents/AgentCheckService.js +18 -261
- package/src/agents/AgentCheckStatisticsService.js +195 -0
- package/src/agents/EnvironmentConfigurationManager.js +31 -380
- package/src/agents/InstallationType.js +19 -6
- package/src/agents/SimpleAgentCheckService.js +472 -0
- package/src/agents/config-managers/ConfigUtils.js +72 -0
- package/src/agents/config-managers/DefaultConfig.js +58 -0
- package/src/agents/config-managers/EnvVarLoader.js +66 -0
- package/src/agents/config-managers/FileConfigLoader.js +124 -0
- package/src/agents/config-managers/TypeConverters.js +61 -0
- package/src/agents/config-managers/VariableMappings.js +92 -0
- package/src/agents/discovery/AgentDiscoveryService-refactored.js +272 -0
- package/src/agents/discovery/AgentDiscoveryService.js +29 -403
- package/src/agents/discovery/agent-validator.js +262 -0
- package/src/agents/discovery/discovery-results.js +176 -0
- package/src/agents/discovery/discovery-scanner.js +268 -0
- package/src/agents/discovery/discovery-utils.js +161 -0
- package/src/agents/discovery/executable-analyzer.js +290 -0
- package/src/agents/discovery/history-manager.js +310 -0
- package/src/agents/verification/ResultAnalyzer-refactored.js +341 -0
- package/src/agents/verification/ResultAnalyzer.js +30 -431
- package/src/agents/verification/analysis-utils.js +310 -0
- package/src/agents/verification/batch-analyzer.js +440 -0
- package/src/agents/verification/pattern-recognizer.js +369 -0
- package/src/agents/verification/report-generator.js +320 -0
- package/src/agents/verification/test-analyzer.js +290 -0
- package/src/agents/windows/InstallerFactory.js +4 -0
- package/src/agents/windows/VSCodeExtensionInstaller.js +404 -0
- package/src/analysis/analysis-engine.js +314 -0
- package/src/analysis/ast-analyzer.js +342 -0
- package/src/analysis/boundary-detector-refactored.js +378 -0
- package/src/analysis/boundary-detector.js +200 -603
- package/src/analysis/boundary-scanner.js +609 -0
- package/src/analysis/boundary-types.js +118 -0
- package/src/analysis/boundary-utils.js +293 -0
- package/src/analysis/deadline-priority-calculator.js +18 -0
- package/src/analysis/detection-methods.js +347 -0
- package/src/analysis/importance-priority-calculator.js +18 -0
- package/src/analysis/priority/factor-calculators.js +204 -0
- package/src/analysis/priority/factor-helpers.js +71 -0
- package/src/analysis/priority/priority-constants.js +73 -0
- package/src/analysis/priority/priority-factor-calculators.js +301 -0
- package/src/analysis/priority/reasons-generator.js +44 -0
- package/src/analysis/priority-calculator.js +15 -580
- package/src/analysis/strategy-generator.js +16 -66
- package/src/analysis/type-priority-calculator.js +18 -0
- package/src/analysis/urgency-priority-calculator.js +18 -0
- package/src/auto-mode/AutoModeBusinessLogic.js +2 -40
- package/src/commands/disable-requirement.js +60 -0
- package/src/commands/disable-spec.js +60 -0
- package/src/commands/enable-requirement.js +60 -0
- package/src/commands/enable-spec.js +60 -0
- package/src/commands/registry.js +1 -6
- package/src/commands/requirements.js +8 -2
- package/src/ide-integration/applescript-manager.cjs +9 -24
- package/src/ide-integration/cdp-handlers/chat-reader.js +44 -0
- package/src/ide-integration/cdp-handlers/connection-handler.js +88 -0
- package/src/ide-integration/cdp-handlers/continuation-handler.js +314 -0
- package/src/ide-integration/cdp-handlers/message-submitter.js +75 -0
- package/src/ide-integration/cdp-handlers/text-sender.js +138 -0
- package/src/ide-integration/cdp-manager.js +28 -573
- package/src/ide-integration/claude-code-cli-manager.cjs +48 -12
- package/src/ide-integration/ide-openers/claude-opener.js +171 -0
- package/src/ide-integration/ide-openers/cursor-opener.js +53 -0
- package/src/ide-integration/ide-openers/other-ides-opener.js +230 -0
- package/src/ide-integration/ide-openers/vscode-opener.js +147 -0
- package/src/ide-integration/macos-ide-manager.js +20 -582
- package/src/ide-integration/macos-quota-checker.js +164 -0
- package/src/ide-integration/macos-text-sender.js +19 -38
- package/src/ide-integration/provider-manager.cjs +52 -7
- package/src/index.cjs +6 -0
- package/src/index.js +10 -0
- package/src/llm/direct-llm-manager.cjs +501 -0
- package/src/localization/translations/en-part1.js +363 -0
- package/src/localization/translations/en-part2.js +320 -0
- package/src/localization/translations/en.js +4 -687
- package/src/localization/translations/es-part1.js +363 -0
- package/src/localization/translations/es-part2.js +320 -0
- package/src/localization/translations/es.js +4 -688
- package/src/models/file-analysis-collection.js +139 -0
- package/src/models/file-analysis-metrics.js +50 -0
- package/src/models/file-analysis.js +15 -262
- package/src/models/plan-manager.js +410 -0
- package/src/models/refactoring-models.js +380 -0
- package/src/models/refactoring-plan-refactored.js +81 -0
- package/src/models/refactoring-plan.js +2 -663
- package/src/monitoring/alert-system.js +4 -45
- package/src/monitoring/continuous-scan-notifications.js +37 -191
- package/src/monitoring/notification-handlers/base-handler.js +58 -0
- package/src/monitoring/notification-handlers/error-handler.js +36 -0
- package/src/monitoring/notification-handlers/index.js +21 -0
- package/src/monitoring/notification-handlers/new-violation-handler.js +91 -0
- package/src/monitoring/notification-handlers/progress-handler.js +48 -0
- package/src/monitoring/notification-handlers/resolved-violation-handler.js +54 -0
- package/src/monitoring/notification-handlers/threshold-handler.js +36 -0
- package/src/provider-registry.js +8 -0
- package/src/refactoring/boundary/boundary-detector-refactored.js +58 -0
- package/src/refactoring/boundary/boundary-detector.js +26 -596
- package/src/refactoring/boundary/detectors/boundary-analyzers.js +281 -0
- package/src/refactoring/boundary/detectors/boundary-core.js +167 -0
- package/src/refactoring/boundary/detectors/class-detector.js +247 -0
- package/src/refactoring/boundary/detectors/config-detector.js +270 -0
- package/src/refactoring/boundary/detectors/constant-detector.js +269 -0
- package/src/refactoring/boundary/detectors/function-detector.js +248 -0
- package/src/refactoring/boundary/detectors/module-detector.js +249 -0
- package/src/refactoring/boundary/detectors/object-detector.js +247 -0
- package/src/refactoring/boundary/detectors/type-detectors.js +338 -0
- package/src/refactoring/boundary/detectors/utility-detector.js +270 -0
- package/src/refactoring/circular-dependency-resolver-original.js +16 -76
- package/src/refactoring/code-mover-refactored.js +309 -0
- package/src/refactoring/code-mover.js +48 -355
- package/src/refactoring/execution-status.js +18 -0
- package/src/refactoring/execution-strategies.js +172 -0
- package/src/refactoring/file-splitter-core.js +568 -0
- package/src/refactoring/file-splitter-types.js +136 -0
- package/src/refactoring/file-splitter.js +2 -682
- package/src/refactoring/functionality-validator.js +11 -51
- package/src/refactoring/import-manager-refactored.js +385 -0
- package/src/refactoring/import-manager.js +112 -487
- package/src/refactoring/import-models.js +189 -0
- package/src/refactoring/import-parser.js +306 -0
- package/src/refactoring/move-executor.js +431 -0
- package/src/refactoring/move-utils.js +368 -0
- package/src/refactoring/operation-executor.js +76 -0
- package/src/refactoring/plan-creator.js +36 -0
- package/src/refactoring/plan-executor.js +143 -0
- package/src/refactoring/plan-validator.js +68 -0
- package/src/refactoring/refactoring-executor-result.js +70 -0
- package/src/refactoring/refactoring-executor.js +34 -569
- package/src/refactoring/refactoring-operation.js +94 -0
- package/src/refactoring/refactoring-plan.js +69 -0
- package/src/refactoring/refactoring-rollback.js +22 -527
- package/src/refactoring/rollback-handlers/RollbackExecutor.js +107 -0
- package/src/refactoring/rollback-handlers/RollbackManager.js +265 -0
- package/src/refactoring/rollback-handlers/RollbackOperation.js +105 -0
- package/src/refactoring/rollback-handlers/RollbackResult.js +109 -0
- package/src/refactoring/rollback-handlers/RollbackStatistics.js +77 -0
- package/src/refactoring/test-validator.js +32 -448
- package/src/refactoring/validation/baseline-runner.js +71 -0
- package/src/refactoring/validation/report-generator.js +136 -0
- package/src/refactoring/validation/result-comparator.js +92 -0
- package/src/refactoring/validation/test-suite.js +59 -0
- package/src/refactoring/validation/test-validation-result.js +83 -0
- package/src/refactoring/validation/validation-runner.js +95 -0
- package/src/refactoring/validation/validation-status.js +18 -0
- package/src/rui/commands/AgentCommandParser.js +60 -369
- package/src/rui/commands/AgentResponseFormatter.js +7 -47
- package/src/rui/commands/parsers/CommandMapper.js +148 -0
- package/src/rui/commands/parsers/CommandValidator.js +228 -0
- package/src/rui/commands/parsers/ComponentExtractor.js +100 -0
- package/src/rui/commands/parsers/TokenParser.js +69 -0
- package/src/rui/commands/parsers/tokenizer.js +153 -0
- package/src/utils/current-requirement-operations.js +50 -1
- package/src/utils/report-generator.js +18 -514
- package/src/utils/report-generators/analysis-generator.js +115 -0
- package/src/utils/report-generators/base-generator.js +141 -0
- package/src/utils/report-generators/compliance-generator.js +41 -0
- package/src/utils/report-generators/format-handlers.js +185 -0
- package/src/utils/report-generators/refactoring-generator.js +46 -0
- package/src/utils/report-generators/validation-generator.js +63 -0
- package/src/utils/requirement-enable-disable.js +265 -0
- package/src/utils/requirement-helpers/requirement-file-ops.js +69 -1
- package/src/utils/requirement-helpers/requirement-mover.js +88 -1
- package/src/utils/requirement-helpers.js +5 -2
- package/src/utils/smoke-test-cli.js +45 -8
- package/src/utils/specification-enable-disable.js +122 -0
- package/src/utils/specification-helpers.js +30 -4
- package/src/utils/specification-migration.js +5 -5
- package/src/utils/test-comparator.js +118 -0
- package/src/utils/test-config.js +54 -0
- package/src/utils/test-executor.js +133 -0
- package/src/utils/test-parser.js +215 -0
- package/src/utils/test-runner-baseline.js +63 -0
- package/src/utils/test-runner-core.js +98 -0
- package/src/utils/test-runner-report.js +39 -0
- package/src/utils/test-runner-validation.js +71 -0
- package/src/utils/test-runner.js +11 -535
- package/src/validation/comparison-analyzer.js +333 -0
- package/src/validation/compliance-reporter-new.js +282 -0
- package/src/validation/compliance-reporter-refactored.js +344 -0
- package/src/validation/compliance-reporter.js +278 -591
- package/src/validation/compliance-utils.js +278 -0
- package/src/validation/html-generator.js +446 -0
- package/src/validation/metrics/category-calculator.js +137 -0
- package/src/validation/metrics/metrics-helpers.js +155 -0
- package/src/validation/metrics/overview-calculator.js +85 -0
- package/src/validation/metrics/overview-metrics.js +41 -0
- package/src/validation/metrics/quality-calculator.js +166 -0
- package/src/validation/metrics/size-calculator.js +69 -0
- package/src/validation/metrics-calculator.js +27 -551
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
|
|
3
|
+
class MacOSQuotaChecker {
|
|
4
|
+
constructor(logger = console) {
|
|
5
|
+
this.logger = logger;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
async checkAntigravityQuotaLimit() {
|
|
9
|
+
try {
|
|
10
|
+
const script = `
|
|
11
|
+
tell application "System Events"
|
|
12
|
+
if not (exists process "Antigravity") then
|
|
13
|
+
return "NOT_RUNNING"
|
|
14
|
+
end if
|
|
15
|
+
tell process "Antigravity"
|
|
16
|
+
set frontmost to true
|
|
17
|
+
delay 0.4
|
|
18
|
+
|
|
19
|
+
set allText to ""
|
|
20
|
+
|
|
21
|
+
-- Check ALL windows (quota popup may not be window 1)
|
|
22
|
+
set windowCount to count of windows
|
|
23
|
+
repeat with w from 1 to windowCount
|
|
24
|
+
try
|
|
25
|
+
-- Window title can reveal quota dialogs
|
|
26
|
+
set wTitle to name of window w
|
|
27
|
+
set allText to allText & wTitle & "\\n"
|
|
28
|
+
end try
|
|
29
|
+
|
|
30
|
+
try
|
|
31
|
+
set allText to allText & (value of static text of window w as string) & "\\n"
|
|
32
|
+
end try
|
|
33
|
+
|
|
34
|
+
try
|
|
35
|
+
set groupsList to groups of window w
|
|
36
|
+
repeat with g in groupsList
|
|
37
|
+
try
|
|
38
|
+
set allText to allText & (value of static text of g as string) & "\\n"
|
|
39
|
+
end try
|
|
40
|
+
-- Also check one level of sub-groups
|
|
41
|
+
try
|
|
42
|
+
set subGroups to groups of g
|
|
43
|
+
repeat with sg in subGroups
|
|
44
|
+
try
|
|
45
|
+
set allText to allText & (value of static text of sg as string) & "\\n"
|
|
46
|
+
end try
|
|
47
|
+
end repeat
|
|
48
|
+
end try
|
|
49
|
+
-- Check buttons inside groups (quota popups often have "Select another model" buttons)
|
|
50
|
+
try
|
|
51
|
+
set groupButtons to buttons of g
|
|
52
|
+
repeat with btn in groupButtons
|
|
53
|
+
try
|
|
54
|
+
set allText to allText & (name of btn) & "\\n"
|
|
55
|
+
end try
|
|
56
|
+
end repeat
|
|
57
|
+
end try
|
|
58
|
+
end repeat
|
|
59
|
+
end try
|
|
60
|
+
|
|
61
|
+
-- Check button names at window level (quota actions sometimes appear as buttons)
|
|
62
|
+
try
|
|
63
|
+
set buttonList to buttons of window w
|
|
64
|
+
repeat with btn in buttonList
|
|
65
|
+
try
|
|
66
|
+
set allText to allText & (name of btn) & "\\n"
|
|
67
|
+
end try
|
|
68
|
+
end repeat
|
|
69
|
+
end try
|
|
70
|
+
|
|
71
|
+
-- Check sheets (modal dialogs presented as sheets)
|
|
72
|
+
try
|
|
73
|
+
set sheetList to sheets of window w
|
|
74
|
+
repeat with s in sheetList
|
|
75
|
+
try
|
|
76
|
+
set allText to allText & (value of static text of s as string) & "\\n"
|
|
77
|
+
end try
|
|
78
|
+
try
|
|
79
|
+
set sheetGroups to groups of s
|
|
80
|
+
repeat with sg in sheetGroups
|
|
81
|
+
try
|
|
82
|
+
set allText to allText & (value of static text of sg as string) & "\\n"
|
|
83
|
+
end try
|
|
84
|
+
end repeat
|
|
85
|
+
end try
|
|
86
|
+
end repeat
|
|
87
|
+
end try
|
|
88
|
+
|
|
89
|
+
-- Check scroll areas
|
|
90
|
+
try
|
|
91
|
+
set scrollAreas to scroll areas of window w
|
|
92
|
+
repeat with sa in scrollAreas
|
|
93
|
+
try
|
|
94
|
+
set allText to allText & (value of static text of sa as string) & "\\n"
|
|
95
|
+
end try
|
|
96
|
+
end repeat
|
|
97
|
+
end try
|
|
98
|
+
end repeat
|
|
99
|
+
|
|
100
|
+
return allText
|
|
101
|
+
end tell
|
|
102
|
+
end tell
|
|
103
|
+
`;
|
|
104
|
+
const raw = execSync(`osascript -e '${script.replace(/'/g, "'\\''")}'`, {
|
|
105
|
+
encoding: 'utf8',
|
|
106
|
+
timeout: 10000
|
|
107
|
+
}).trim();
|
|
108
|
+
|
|
109
|
+
if (!raw || raw === 'NOT_RUNNING') {
|
|
110
|
+
return {
|
|
111
|
+
isRateLimited: false,
|
|
112
|
+
note: raw === 'NOT_RUNNING' ? 'Antigravity not running' : 'No readable UI text'
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const text = raw.replace(/\s+/g, ' ').trim();
|
|
117
|
+
const lower = text.toLowerCase();
|
|
118
|
+
|
|
119
|
+
const hasGeminiQuota = lower.includes('model quota limit exceeded') ||
|
|
120
|
+
(lower.includes('quota limit') && lower.includes('you can resume')) ||
|
|
121
|
+
lower.includes('you have reached the quota limit') ||
|
|
122
|
+
lower.includes('spending cap reached') ||
|
|
123
|
+
lower.includes('usage cap reached') ||
|
|
124
|
+
lower.includes('rate limit reached') ||
|
|
125
|
+
lower.includes('resource has been exhausted') ||
|
|
126
|
+
lower.includes('resource_exhausted') ||
|
|
127
|
+
lower.includes('quota exceeded') ||
|
|
128
|
+
lower.includes('too many requests') ||
|
|
129
|
+
lower.includes('requests per minute') ||
|
|
130
|
+
lower.includes('daily limit exceeded') ||
|
|
131
|
+
(lower.includes('limit') && lower.includes('try again')) ||
|
|
132
|
+
lower.includes('rate limited') ||
|
|
133
|
+
lower.includes('select another model') ||
|
|
134
|
+
lower.includes('switch model') ||
|
|
135
|
+
lower.includes('try another model') ||
|
|
136
|
+
lower.includes('choose model');
|
|
137
|
+
|
|
138
|
+
if (!hasGeminiQuota) {
|
|
139
|
+
return {
|
|
140
|
+
isRateLimited: false,
|
|
141
|
+
note: text ? `No quota pattern found. UI text sample: ${text.substring(0, 300)}` : 'No readable UI text from Antigravity windows'
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const resumeAtMatch = text.match(/resume\s+(?:using\s+this\s+model\s+)?at\s+(\d{1,2}\/\d{1,2}\/\d{4})\s*,?\s*(\d{1,2}:\d{2}(?::\d{2})?)\s*(AM|PM)/i);
|
|
146
|
+
const resumeAt = resumeAtMatch
|
|
147
|
+
? `${resumeAtMatch[1]}, ${resumeAtMatch[2]} ${resumeAtMatch[3].toUpperCase()}`
|
|
148
|
+
: undefined;
|
|
149
|
+
|
|
150
|
+
return {
|
|
151
|
+
isRateLimited: true,
|
|
152
|
+
message: text,
|
|
153
|
+
resumeAt
|
|
154
|
+
};
|
|
155
|
+
} catch (error) {
|
|
156
|
+
return {
|
|
157
|
+
isRateLimited: false,
|
|
158
|
+
note: `Failed to check Antigravity quota: ${error.message}`
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
module.exports = MacOSQuotaChecker;
|
|
@@ -69,22 +69,10 @@ class MacOSTextSender {
|
|
|
69
69
|
tell process "Windsurf"
|
|
70
70
|
-- Check if process is running before attempting to interact
|
|
71
71
|
try
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
--
|
|
76
|
-
key code 35 using {command down, shift down}
|
|
77
|
-
delay 0.8
|
|
78
|
-
|
|
79
|
-
-- Step 2: Type "New Chat" to start a fresh conversation
|
|
80
|
-
keystroke "New Chat"
|
|
81
|
-
delay 0.8
|
|
82
|
-
|
|
83
|
-
-- Step 3: Press Enter to execute the command
|
|
84
|
-
key code 36
|
|
85
|
-
delay 2.0
|
|
86
|
-
|
|
87
|
-
-- Step 4: Now find and click on chat input field
|
|
72
|
+
-- DO NOT use Cmd+L as it toggles Cascade panel closed
|
|
73
|
+
-- Focus Windsurf chat input without using Cmd+L
|
|
74
|
+
|
|
75
|
+
-- Try to find and click on chat input field directly
|
|
88
76
|
try
|
|
89
77
|
set chatInput to text field 1 of group 1 of window 1
|
|
90
78
|
click chatInput
|
|
@@ -96,34 +84,27 @@ class MacOSTextSender {
|
|
|
96
84
|
click chatInput
|
|
97
85
|
delay 0.5
|
|
98
86
|
on error
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
delay 0.5
|
|
104
|
-
on error
|
|
105
|
-
-- Method 4: Just try typing (fallback)
|
|
106
|
-
delay 0.5
|
|
107
|
-
end try
|
|
87
|
+
-- Method 3: Try to find any input field
|
|
88
|
+
set chatInput to text field 1 of window 1
|
|
89
|
+
click chatInput
|
|
90
|
+
delay 0.5
|
|
108
91
|
end try
|
|
109
92
|
end try
|
|
110
|
-
|
|
111
|
-
-- Type message
|
|
93
|
+
|
|
94
|
+
-- Type the message
|
|
112
95
|
keystroke "${text.replace(/"/g, '\\"')}"
|
|
113
|
-
delay 0.
|
|
114
|
-
|
|
115
|
-
--
|
|
96
|
+
delay 0.3
|
|
97
|
+
|
|
98
|
+
-- Send the message with Enter
|
|
116
99
|
key code 36
|
|
117
|
-
delay 0.
|
|
100
|
+
delay 0.2
|
|
101
|
+
|
|
102
|
+
-- Also try Cmd+Enter as backup
|
|
118
103
|
key code 36 using {command down}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
delay 0.5
|
|
122
|
-
key code 1 using {command down}
|
|
123
|
-
delay 0.5
|
|
124
|
-
on error
|
|
104
|
+
|
|
105
|
+
on error errMsg
|
|
125
106
|
-- Process not running or not accessible
|
|
126
|
-
error "
|
|
107
|
+
error "Failed to send text to Windsurf: " & errMsg
|
|
127
108
|
end try
|
|
128
109
|
end tell
|
|
129
110
|
end tell
|
|
@@ -14,6 +14,33 @@ class ProviderManager {
|
|
|
14
14
|
this.performance = this.loadPerformance();
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
clearRateLimit(provider, model) {
|
|
18
|
+
if (!provider) return false;
|
|
19
|
+
const key = `${provider}:${model || provider}`;
|
|
20
|
+
if (this.rateLimits[key]) {
|
|
21
|
+
delete this.rateLimits[key];
|
|
22
|
+
this.saveRateLimits();
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
clearProviderRateLimits(provider) {
|
|
29
|
+
if (!provider) return 0;
|
|
30
|
+
const providerPrefix = `${provider}:`;
|
|
31
|
+
let cleared = 0;
|
|
32
|
+
for (const key of Object.keys(this.rateLimits)) {
|
|
33
|
+
if (key.startsWith(providerPrefix)) {
|
|
34
|
+
delete this.rateLimits[key];
|
|
35
|
+
cleared += 1;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (cleared > 0) {
|
|
39
|
+
this.saveRateLimits();
|
|
40
|
+
}
|
|
41
|
+
return cleared;
|
|
42
|
+
}
|
|
43
|
+
|
|
17
44
|
/**
|
|
18
45
|
* Load rate limit tracking data from file
|
|
19
46
|
* Auto-cleanup expired rate limits
|
|
@@ -227,27 +254,45 @@ class ProviderManager {
|
|
|
227
254
|
let duration = this.parseRateLimitDuration(errorMessage);
|
|
228
255
|
if (duration === null || duration === undefined) {
|
|
229
256
|
console.warn(`Could not parse rate limit duration from: ${errorMessage}`);
|
|
230
|
-
//
|
|
231
|
-
duration =
|
|
257
|
+
// Don't guess the duration - just mark as rate limited without a specific reset time
|
|
258
|
+
duration = null;
|
|
232
259
|
}
|
|
233
260
|
|
|
234
|
-
const resetTime = Date.now() + duration;
|
|
261
|
+
const resetTime = duration ? Date.now() + duration : null;
|
|
235
262
|
const key = `${provider}:${model}`;
|
|
236
263
|
|
|
237
264
|
this.rateLimits[key] = {
|
|
238
265
|
provider,
|
|
239
266
|
model,
|
|
240
267
|
resetTime,
|
|
241
|
-
resetDate: new Date(resetTime).toISOString(),
|
|
268
|
+
resetDate: resetTime ? new Date(resetTime).toISOString() : null,
|
|
242
269
|
reason: errorMessage,
|
|
243
270
|
markedAt: new Date().toISOString()
|
|
244
271
|
};
|
|
245
272
|
|
|
246
273
|
this.saveRateLimits();
|
|
247
274
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
275
|
+
if (resetTime) {
|
|
276
|
+
const chalk = require('chalk');
|
|
277
|
+
const resetMinutes = Math.ceil(duration / 60000);
|
|
278
|
+
const resetDateTime = new Date(resetTime);
|
|
279
|
+
const timeString = resetDateTime.toLocaleTimeString('en-US', {
|
|
280
|
+
timeZone: 'America/Denver',
|
|
281
|
+
hour: 'numeric',
|
|
282
|
+
minute: '2-digit',
|
|
283
|
+
hour12: true
|
|
284
|
+
});
|
|
285
|
+
const dateString = resetDateTime.toLocaleDateString('en-US', {
|
|
286
|
+
timeZone: 'America/Denver',
|
|
287
|
+
weekday: 'short',
|
|
288
|
+
month: 'short',
|
|
289
|
+
day: 'numeric'
|
|
290
|
+
});
|
|
291
|
+
console.log(chalk.yellow(`📊 Provider ${provider}/${model} rate limited until ${timeString} MST on ${dateString} (~${resetMinutes}m)`));
|
|
292
|
+
} else {
|
|
293
|
+
const chalk = require('chalk');
|
|
294
|
+
console.log(chalk.yellow(`📊 Provider ${provider}/${model} rate limited (reset time unknown)`));
|
|
295
|
+
}
|
|
251
296
|
}
|
|
252
297
|
|
|
253
298
|
/**
|
package/src/index.cjs
CHANGED
|
@@ -35,6 +35,7 @@ const currentRequirementManager = require('./utils/current-requirement-manager.j
|
|
|
35
35
|
const requirementsParser = require('./utils/requirements-parser.js');
|
|
36
36
|
const requirementNumbering = require('./requirement-numbering.js');
|
|
37
37
|
const specificationHelpers = require('./utils/specification-helpers.js');
|
|
38
|
+
const requirementFileManagement = require('./utils/requirement-file-management.js');
|
|
38
39
|
const gitBranchManager = require('./utils/git-branch-manager.js');
|
|
39
40
|
const updateChecker = require('./utils/update-checker.js');
|
|
40
41
|
const electronUpdateChecker = require('./utils/electron-update-checker.js');
|
|
@@ -62,6 +63,7 @@ const { ResponseTimeTracker } = require('./timeout-management/response-time-trac
|
|
|
62
63
|
// Requirement Management (User Story 5)
|
|
63
64
|
const { RequirementFileParser } = require('./requirement-management/requirement-file-parser.js');
|
|
64
65
|
const { DefaultRequirementManager } = require('./requirement-management/default-requirement-manager.js');
|
|
66
|
+
const RequirementSequencer = require('./requirement-management/requirement-sequencer.js');
|
|
65
67
|
|
|
66
68
|
// Provider Registry
|
|
67
69
|
const providerRegistry = require('./provider-registry.js');
|
|
@@ -94,6 +96,9 @@ module.exports = {
|
|
|
94
96
|
...requirementsParser,
|
|
95
97
|
...requirementNumbering,
|
|
96
98
|
...specificationHelpers,
|
|
99
|
+
extractCompletionPercentage: specificationHelpers.extractCompletionPercentage,
|
|
100
|
+
isSpecComplete: specificationHelpers.isSpecComplete,
|
|
101
|
+
...requirementFileManagement,
|
|
97
102
|
...gitBranchManager,
|
|
98
103
|
...updateChecker,
|
|
99
104
|
...electronUpdateChecker,
|
|
@@ -129,6 +134,7 @@ module.exports = {
|
|
|
129
134
|
ResponseTimeTracker,
|
|
130
135
|
RequirementFileParser,
|
|
131
136
|
DefaultRequirementManager,
|
|
137
|
+
RequirementSequencer,
|
|
132
138
|
ProviderManager,
|
|
133
139
|
AutoModeBusinessLogic,
|
|
134
140
|
getCurrentRequirementName,
|
package/src/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export * from './utils/requirement-helpers.js';
|
|
|
16
16
|
export * from './utils/requirements-parser.js';
|
|
17
17
|
export * from './requirement-numbering.js';
|
|
18
18
|
export * from './utils/specification-helpers.js';
|
|
19
|
+
export { extractCompletionPercentage, isSpecComplete } from './utils/specification-helpers.js';
|
|
19
20
|
|
|
20
21
|
// RUI Commands (CommonJS modules - import default, re-export as named)
|
|
21
22
|
import RUICommandRegistry from './commands/registry.js';
|
|
@@ -27,6 +28,10 @@ import ListSettingsCommand from './commands/settings.js';
|
|
|
27
28
|
import CreateAgentCommand from './commands/create-agent.js';
|
|
28
29
|
import EnableAgentCommand from './commands/enable-agent.js';
|
|
29
30
|
import DisableAgentCommand from './commands/disable-agent.js';
|
|
31
|
+
import EnableSpecCommand from './commands/enable-spec.js';
|
|
32
|
+
import DisableSpecCommand from './commands/disable-spec.js';
|
|
33
|
+
import EnableRequirementCommand from './commands/enable-requirement.js';
|
|
34
|
+
import DisableRequirementCommand from './commands/disable-requirement.js';
|
|
30
35
|
import HelpCommand from './commands/help.js';
|
|
31
36
|
export {
|
|
32
37
|
RUICommandRegistry,
|
|
@@ -38,6 +43,10 @@ export {
|
|
|
38
43
|
CreateAgentCommand,
|
|
39
44
|
EnableAgentCommand,
|
|
40
45
|
DisableAgentCommand,
|
|
46
|
+
EnableSpecCommand,
|
|
47
|
+
DisableSpecCommand,
|
|
48
|
+
EnableRequirementCommand,
|
|
49
|
+
DisableRequirementCommand,
|
|
41
50
|
HelpCommand
|
|
42
51
|
};
|
|
43
52
|
|
|
@@ -81,6 +90,7 @@ export { ResponseTimeTracker } from './timeout-management/response-time-tracker.
|
|
|
81
90
|
import { RequirementFileParser } from './requirement-management/requirement-file-parser.js';
|
|
82
91
|
export { RequirementFileParser } from './requirement-management/requirement-file-parser.js';
|
|
83
92
|
export { DefaultRequirementManager } from './requirement-management/default-requirement-manager.js';
|
|
93
|
+
export { default as RequirementSequencer } from './requirement-management/requirement-sequencer.js';
|
|
84
94
|
|
|
85
95
|
// Provider Registry
|
|
86
96
|
export * from './provider-registry.js';
|