vibecodingmachine-cli 2026.3.14-1537 → 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/bin/auth/auth-compliance.js +7 -7
- package/bin/commands/agent-commands.js +15 -15
- package/bin/commands/auto-commands.js +3 -3
- package/bin/commands/command-aliases.js +13 -4
- package/bin/config/cli-config.js +15 -5
- package/bin/update/update-checker.js +5 -5
- package/bin/vibecodingmachine.js +2 -2
- package/package.json +2 -2
- package/src/commands/agents/add.js +5 -5
- package/src/commands/agents/check.js +19 -19
- package/src/commands/agents/list.js +24 -24
- package/src/commands/agents/remove.js +4 -4
- package/src/commands/agents-check.js +1 -1
- package/src/commands/analyze-file-sizes.js +43 -43
- package/src/commands/auto-direct/auto-provider-manager.js +19 -19
- package/src/commands/auto-direct/auto-start-phases.js +493 -0
- package/src/commands/auto-direct/auto-status-display.js +35 -35
- package/src/commands/auto-direct/auto-utils.js +50 -50
- package/src/commands/auto-direct/cline-installer.js +56 -0
- package/src/commands/auto-direct/code-processor.js +27 -27
- package/src/commands/auto-direct/file-scanner.js +19 -19
- package/src/commands/auto-direct/ide-completion-waiter.js +485 -0
- package/src/commands/auto-direct/ide-fallback-runner.js +226 -0
- package/src/commands/auto-direct/ide-provider-runner.js +103 -0
- package/src/commands/auto-direct/iteration-handlers.js +189 -0
- package/src/commands/auto-direct/iteration-runner.js +485 -0
- package/src/commands/auto-direct/provider-config.js +38 -7
- package/src/commands/auto-direct/provider-manager.js +132 -6
- package/src/commands/auto-direct/requirement-manager.js +169 -104
- package/src/commands/auto-direct/requirement-mover.js +350 -0
- package/src/commands/auto-direct/spec-handlers.js +155 -0
- package/src/commands/auto-direct/spec-ide-runner.js +318 -0
- package/src/commands/auto-direct/spec-processing.js +203 -0
- package/src/commands/auto-direct/status-display.js +9 -9
- package/src/commands/auto-direct/utils.js +83 -1
- package/src/commands/auto-direct-refactored.js +1 -413
- package/src/commands/auto-direct.js +127 -4119
- package/src/commands/auto-execution.js +21 -21
- package/src/commands/auto-status-helpers.js +0 -2
- package/src/commands/auto.js +22 -22
- package/src/commands/check-compliance.js +65 -65
- package/src/commands/computers.js +39 -39
- package/src/commands/continuous-scan.js +19 -19
- package/src/commands/ide.js +4 -4
- package/src/commands/locale.js +7 -7
- package/src/commands/refactor-file.js +59 -59
- package/src/commands/requirements/commands.js +17 -17
- package/src/commands/requirements/default-handlers.js +30 -30
- package/src/commands/requirements/disable.js +3 -3
- package/src/commands/requirements/enable.js +3 -3
- package/src/commands/requirements/utils.js +6 -6
- package/src/commands/requirements-refactored.js +3 -3
- package/src/commands/requirements-remote.js +38 -38
- package/src/commands/requirements.js +3 -3
- package/src/commands/settings.js +111 -0
- package/src/commands/specs/count.js +60 -0
- package/src/commands/specs/disable.js +3 -3
- package/src/commands/specs/enable.js +3 -3
- package/src/commands/status.js +10 -10
- package/src/commands/sync.js +25 -25
- package/src/commands/timeout.js +35 -35
- package/src/trui/TruiInterface.js +2 -2
- package/src/trui/agents/AgentInterface.js +4 -4
- package/src/trui/agents/handlers/CommandHandler.js +4 -4
- package/src/trui/agents/handlers/ContextManager.js +1 -1
- package/src/trui/agents/handlers/DisplayHandler.js +11 -11
- package/src/trui/agents/handlers/HelpHandler.js +1 -1
- package/src/utils/agent-selector.js +6 -6
- package/src/utils/antigravity-installer.js +4 -4
- package/src/utils/asset-cleanup.js +1 -1
- package/src/utils/auth.js +9 -12
- package/src/utils/clarification-actions.js +4 -4
- package/src/utils/cline-js-handler.js +5 -5
- package/src/utils/compliance-check.js +6 -6
- package/src/utils/config.js +12 -12
- package/src/utils/display-formatters-complete.js +2 -2
- package/src/utils/display-formatters-extracted.js +2 -2
- package/src/utils/display-formatters.js +2 -2
- package/src/utils/feedback-handler.js +2 -2
- package/src/utils/first-run.js +7 -7
- package/src/utils/ide-detection.js +1 -1
- package/src/utils/ide-handlers.js +6 -6
- package/src/utils/interactive/clarification-actions.js +3 -3
- package/src/utils/interactive/core-ui.js +7 -7
- package/src/utils/interactive/file-backup.js +6 -6
- package/src/utils/interactive/file-import-export.js +49 -49
- package/src/utils/interactive/file-operations.js +3 -3
- package/src/utils/interactive/file-validation.js +41 -41
- package/src/utils/interactive/interactive-prompts.js +41 -41
- package/src/utils/interactive/requirement-actions.js +5 -5
- package/src/utils/interactive/requirement-crud.js +4 -4
- package/src/utils/interactive/requirements-navigation.js +10 -10
- package/src/utils/interactive-broken.js +6 -6
- package/src/utils/interactive.js +37 -37
- package/src/utils/keyboard-handler.js +4 -4
- package/src/utils/prompt-helper.js +6 -6
- package/src/utils/provider-checker/agent-checker.js +1 -1
- package/src/utils/provider-checker/agent-runner.js +203 -314
- package/src/utils/provider-checker/agents-file-lock.js +134 -0
- package/src/utils/provider-checker/agents-manager.js +224 -36
- package/src/utils/provider-checker/cli-installer.js +28 -28
- package/src/utils/provider-checker/cli-utils.js +2 -2
- package/src/utils/provider-checker/cursor-approval-clicker.js +108 -0
- package/src/utils/provider-checker/format-utils.js +4 -4
- package/src/utils/provider-checker/ide-installer-helper.js +96 -0
- package/src/utils/provider-checker/ide-manager.js +19 -8
- package/src/utils/provider-checker/ide-quota-checker.js +120 -0
- package/src/utils/provider-checker/ide-utils.js +2 -2
- package/src/utils/provider-checker/node-detector.js +4 -4
- package/src/utils/provider-checker/node-utils.js +5 -5
- package/src/utils/provider-checker/opencode-checker.js +107 -73
- package/src/utils/provider-checker/process-utils.js +1 -1
- package/src/utils/provider-checker/provider-validator.js +11 -11
- package/src/utils/provider-checker/quota-checker.js +5 -5
- package/src/utils/provider-checker/quota-detector.js +5 -5
- package/src/utils/provider-checker/requirements-manager.js +6 -6
- package/src/utils/provider-checker/test-requirements.js +1 -1
- package/src/utils/provider-checker/vscode-approval-clicker.js +328 -0
- package/src/utils/provider-checker-new.js +6 -6
- package/src/utils/provider-checker.js +6 -6
- package/src/utils/provider-checkers/ide-manager.js +13 -13
- package/src/utils/provider-checkers/node-executable-finder.js +4 -4
- package/src/utils/provider-checkers/provider-checker-core.js +5 -5
- package/src/utils/provider-checkers/provider-checker-main.js +17 -17
- package/src/utils/provider-registry.js +5 -6
- package/src/utils/provider-utils.js +12 -12
- package/src/utils/quota-detectors.js +32 -32
- package/src/utils/requirement-action-handlers.js +12 -12
- package/src/utils/requirement-actions/requirement-operations.js +3 -3
- package/src/utils/requirement-actions.js +1 -1
- package/src/utils/requirement-file-operations.js +5 -5
- package/src/utils/requirement-helpers.js +1 -1
- package/src/utils/requirement-management.js +5 -5
- package/src/utils/requirement-navigation.js +2 -2
- package/src/utils/requirement-organization.js +3 -3
- package/src/utils/rui-trui-adapter.js +14 -14
- package/src/utils/simple-trui.js +3 -3
- package/src/utils/status-helpers-extracted.js +3 -3
- package/src/utils/trui-clarifications.js +11 -11
- package/src/utils/trui-debug.js +3 -2
- package/src/utils/trui-devin.js +217 -0
- package/src/utils/trui-feedback.js +7 -7
- package/src/utils/trui-kiro-integration.js +34 -34
- package/src/utils/trui-main-handlers.js +20 -21
- package/src/utils/trui-main-menu.js +19 -19
- package/src/utils/trui-nav-agents.js +59 -8
- package/src/utils/trui-nav-requirements.js +3 -3
- package/src/utils/trui-nav-settings.js +10 -10
- package/src/utils/trui-nav-specifications.js +1 -1
- package/src/utils/trui-navigation-backup.js +11 -11
- package/src/utils/trui-navigation.js +9 -9
- package/src/utils/trui-provider-health.js +25 -25
- package/src/utils/trui-provider-manager.js +28 -28
- package/src/utils/trui-quick-menu.js +2 -2
- package/src/utils/trui-req-actions-backup.js +21 -21
- package/src/utils/trui-req-actions.js +20 -20
- package/src/utils/trui-req-editor.js +10 -10
- package/src/utils/trui-req-file-ops.js +3 -3
- package/src/utils/trui-req-tree.js +7 -7
- package/src/utils/trui-windsurf.js +103 -103
- package/src/utils/user-tracking.js +15 -15
- package/src/utils/trui-req-tree-old.js +0 -719
|
@@ -10,7 +10,7 @@ async function checkAgents(options = {}) {
|
|
|
10
10
|
const definitions = getProviderDefinitions();
|
|
11
11
|
const { getProviderPreferences } = require('../utils/provider-registry');
|
|
12
12
|
const prefs = await getProviderPreferences();
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
// Only check enabled providers unless a specific provider is requested
|
|
15
15
|
let providerIds;
|
|
16
16
|
if (options.enabledOnly && options.enabledAgents) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CLI Command: Analyze File Sizes
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Command-line interface for analyzing file sizes across the codebase.
|
|
5
5
|
* Provides comprehensive analysis and refactoring recommendations.
|
|
6
6
|
*/
|
|
@@ -11,15 +11,15 @@ const fs = require('fs');
|
|
|
11
11
|
const path = require('path');
|
|
12
12
|
|
|
13
13
|
// Import analysis components
|
|
14
|
-
const { CodebaseScanner } = require('
|
|
15
|
-
const { LineCounter } = require('
|
|
16
|
-
const { FileCategorizer } = require('
|
|
17
|
-
const { BoundaryDetector } = require('
|
|
18
|
-
const { StrategyGenerator } = require('
|
|
19
|
-
const { PriorityCalculator } = require('
|
|
20
|
-
const { AnalysisReporter } = require('
|
|
21
|
-
const { FileAnalysis } = require('
|
|
22
|
-
const { FileAnalysisCollection } = require('
|
|
14
|
+
const { CodebaseScanner } = require('vibecodingmachine-core/src/analysis/codebase-scanner');
|
|
15
|
+
const { LineCounter } = require('vibecodingmachine-core/src/analysis/line-counter');
|
|
16
|
+
const { FileCategorizer } = require('vibecodingmachine-core/src/analysis/categorizer');
|
|
17
|
+
const { BoundaryDetector } = require('vibecodingmachine-core/src/analysis/boundary-detector');
|
|
18
|
+
const { StrategyGenerator } = require('vibecodingmachine-core/src/analysis/strategy-generator');
|
|
19
|
+
const { PriorityCalculator } = require('vibecodingmachine-core/src/analysis/priority-calculator');
|
|
20
|
+
const { AnalysisReporter } = require('vibecodingmachine-core/src/analysis/analysis-reporter');
|
|
21
|
+
const { FileAnalysis } = require('vibecodingmachine-core/src/models/file-analysis');
|
|
22
|
+
const { FileAnalysisCollection } = require('vibecodingmachine-core/src/models/file-analysis-collection');
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Analyze file sizes command
|
|
@@ -58,7 +58,7 @@ class AnalyzeFileSizesCommand {
|
|
|
58
58
|
|
|
59
59
|
async execute(options) {
|
|
60
60
|
const startTime = Date.now();
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
if (!options.quiet) {
|
|
63
63
|
console.log(chalk.blue('🔍 Starting file size analysis...'));
|
|
64
64
|
console.log(chalk.gray(`Path: ${options.path}`));
|
|
@@ -71,33 +71,33 @@ class AnalyzeFileSizesCommand {
|
|
|
71
71
|
|
|
72
72
|
// Step 1: Scan codebase
|
|
73
73
|
const scanResults = await this.scanCodebase(options);
|
|
74
|
-
|
|
74
|
+
|
|
75
75
|
// Step 2: Count lines
|
|
76
76
|
const lineResults = await this.countLines(scanResults, options);
|
|
77
|
-
|
|
77
|
+
|
|
78
78
|
// Step 3: Categorize files
|
|
79
79
|
const categorizationResults = await this.categorizeFiles(lineResults, options);
|
|
80
|
-
|
|
80
|
+
|
|
81
81
|
// Step 4: Detect boundaries
|
|
82
82
|
const boundaryResults = await this.detectBoundaries(lineResults, options);
|
|
83
|
-
|
|
83
|
+
|
|
84
84
|
// Step 5: Calculate priorities
|
|
85
85
|
const priorityResults = await this.calculatePriorities(lineResults, boundaryResults, options);
|
|
86
|
-
|
|
86
|
+
|
|
87
87
|
// Step 6: Generate strategies
|
|
88
88
|
const strategyResults = await this.generateStrategies(lineResults, priorityResults, options);
|
|
89
|
-
|
|
89
|
+
|
|
90
90
|
// Step 7: Generate report
|
|
91
91
|
const reportResults = await this.generateReport(
|
|
92
|
-
lineResults,
|
|
93
|
-
categorizationResults,
|
|
94
|
-
priorityResults,
|
|
95
|
-
strategyResults,
|
|
92
|
+
lineResults,
|
|
93
|
+
categorizationResults,
|
|
94
|
+
priorityResults,
|
|
95
|
+
strategyResults,
|
|
96
96
|
options
|
|
97
97
|
);
|
|
98
98
|
|
|
99
99
|
const duration = Date.now() - startTime;
|
|
100
|
-
|
|
100
|
+
|
|
101
101
|
if (!options.quiet) {
|
|
102
102
|
this.printSummary(reportResults, duration);
|
|
103
103
|
}
|
|
@@ -186,7 +186,7 @@ class AnalyzeFileSizesCommand {
|
|
|
186
186
|
for (let i = 0; i < lineResults.length; i++) {
|
|
187
187
|
const analysis = lineResults[i];
|
|
188
188
|
const categorization = categorizationResults.files[i];
|
|
189
|
-
|
|
189
|
+
|
|
190
190
|
if (categorization && categorization.categorization) {
|
|
191
191
|
analysis.setClassification(
|
|
192
192
|
categorization.categorization.size,
|
|
@@ -210,20 +210,20 @@ class AnalyzeFileSizesCommand {
|
|
|
210
210
|
const boundaryResults = new Map();
|
|
211
211
|
|
|
212
212
|
// Only analyze JavaScript/TypeScript files for boundaries
|
|
213
|
-
const jsFiles = lineResults.filter(analysis =>
|
|
213
|
+
const jsFiles = lineResults.filter(analysis =>
|
|
214
214
|
['.js', '.jsx', '.ts', '.tsx'].includes(analysis.extension)
|
|
215
215
|
);
|
|
216
216
|
|
|
217
217
|
for (let i = 0; i < jsFiles.length; i++) {
|
|
218
218
|
const analysis = jsFiles[i];
|
|
219
|
-
|
|
219
|
+
|
|
220
220
|
try {
|
|
221
221
|
const boundaryResult = await boundaryDetector.detectBoundaries(analysis.filePath);
|
|
222
222
|
boundaryResults.set(analysis.filePath, boundaryResult);
|
|
223
|
-
|
|
223
|
+
|
|
224
224
|
// Update analysis with boundary data
|
|
225
225
|
analysis.setBoundaries(boundaryResult);
|
|
226
|
-
|
|
226
|
+
|
|
227
227
|
if (options.verbose && i % 10 === 0) {
|
|
228
228
|
console.log(chalk.gray(`Analyzed boundaries for ${i + 1}/${jsFiles.length} files`));
|
|
229
229
|
}
|
|
@@ -251,7 +251,7 @@ class AnalyzeFileSizesCommand {
|
|
|
251
251
|
for (let i = 0; i < lineResults.length; i++) {
|
|
252
252
|
const analysis = lineResults[i];
|
|
253
253
|
const priorityResult = priorityResults[i];
|
|
254
|
-
|
|
254
|
+
|
|
255
255
|
if (priorityResult) {
|
|
256
256
|
analysis.priority = priorityResult.priority;
|
|
257
257
|
// Add priority reasons as warnings
|
|
@@ -296,7 +296,7 @@ class AnalyzeFileSizesCommand {
|
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
const reporter = new AnalysisReporter();
|
|
299
|
-
|
|
299
|
+
|
|
300
300
|
// Create analysis data for reporter
|
|
301
301
|
const analysisData = {
|
|
302
302
|
files: lineResults,
|
|
@@ -327,7 +327,7 @@ class AnalyzeFileSizesCommand {
|
|
|
327
327
|
|
|
328
328
|
printSummary(results, duration) {
|
|
329
329
|
const { reportData, summary } = results;
|
|
330
|
-
|
|
330
|
+
|
|
331
331
|
console.log();
|
|
332
332
|
console.log(chalk.blue('📈 Analysis Summary'));
|
|
333
333
|
console.log(chalk.gray('─'.repeat(50)));
|
|
@@ -338,16 +338,16 @@ class AnalyzeFileSizesCommand {
|
|
|
338
338
|
console.log(`✅ Compliance Rate: ${chalk.bold(reportData.summary.complianceRate + '%')}`);
|
|
339
339
|
console.log(`🎯 Average Complexity: ${chalk.bold(reportData.summary.averageComplexity)}`);
|
|
340
340
|
console.log(`⏱️ Duration: ${chalk.bold((duration / 1000).toFixed(2) + 's')}`);
|
|
341
|
-
|
|
341
|
+
|
|
342
342
|
// Show violations
|
|
343
343
|
if (reportData.violations.length > 0) {
|
|
344
344
|
console.log();
|
|
345
345
|
console.log(chalk.red('⚠️ Violations Found'));
|
|
346
346
|
console.log(chalk.gray('─'.repeat(50)));
|
|
347
|
-
|
|
347
|
+
|
|
348
348
|
const criticalViolations = reportData.violations.filter(v => v.severity === 'critical');
|
|
349
349
|
const majorViolations = reportData.violations.filter(v => v.severity === 'major');
|
|
350
|
-
|
|
350
|
+
|
|
351
351
|
if (criticalViolations.length > 0) {
|
|
352
352
|
console.log(`${chalk.red('🚨 Critical:')} ${criticalViolations.length} files`);
|
|
353
353
|
}
|
|
@@ -355,34 +355,34 @@ class AnalyzeFileSizesCommand {
|
|
|
355
355
|
console.log(`${chalk.yellow('⚠️ Major:')} ${majorViolations.length} files`);
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
|
|
358
|
+
|
|
359
359
|
// Show top recommendations
|
|
360
360
|
if (reportData.recommendations.length > 0) {
|
|
361
361
|
console.log();
|
|
362
362
|
console.log(chalk.blue('💡 Top Recommendations'));
|
|
363
363
|
console.log(chalk.gray('─'.repeat(50)));
|
|
364
|
-
|
|
364
|
+
|
|
365
365
|
for (const rec of reportData.recommendations.slice(0, 3)) {
|
|
366
|
-
const priorityColor = rec.priority === 'critical' ? 'red' :
|
|
367
|
-
rec.priority === 'high' ? 'yellow' :
|
|
366
|
+
const priorityColor = rec.priority === 'critical' ? 'red' :
|
|
367
|
+
rec.priority === 'high' ? 'yellow' :
|
|
368
368
|
rec.priority === 'medium' ? 'blue' : 'gray';
|
|
369
|
-
|
|
369
|
+
|
|
370
370
|
console.log(`${chalk[priorityColor]('●')} ${rec.title}`);
|
|
371
371
|
console.log(` ${rec.description}`);
|
|
372
372
|
console.log(` Priority: ${rec.priority} | Effort: ${rec.estimatedEffort} units`);
|
|
373
373
|
console.log();
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
-
|
|
376
|
+
|
|
377
377
|
// Package summary
|
|
378
378
|
if (Object.keys(reportData.packageAnalysis).length > 1) {
|
|
379
379
|
console.log(chalk.blue('📦 Package Summary'));
|
|
380
380
|
console.log(chalk.gray('─'.repeat(50)));
|
|
381
|
-
|
|
381
|
+
|
|
382
382
|
for (const [packageName, packageData] of Object.entries(reportData.packageAnalysis)) {
|
|
383
383
|
const complianceColor = packageData.complianceRate >= 90 ? 'green' :
|
|
384
384
|
packageData.complianceRate >= 70 ? 'yellow' : 'red';
|
|
385
|
-
|
|
385
|
+
|
|
386
386
|
console.log(`${packageName}: ${chalk[complianceColor](packageData.complianceRate + '%')} compliant (${packageData.files.length} files)`);
|
|
387
387
|
}
|
|
388
388
|
}
|
|
@@ -391,12 +391,12 @@ class AnalyzeFileSizesCommand {
|
|
|
391
391
|
async saveReport(results, options) {
|
|
392
392
|
try {
|
|
393
393
|
const { exportResult } = results;
|
|
394
|
-
|
|
394
|
+
|
|
395
395
|
if (exportResult.success) {
|
|
396
396
|
console.log();
|
|
397
397
|
console.log(chalk.green('✅ Report saved successfully'));
|
|
398
398
|
console.log(chalk.gray(`📄 ${exportResult.path}`));
|
|
399
|
-
|
|
399
|
+
|
|
400
400
|
// Show file size
|
|
401
401
|
const stats = fs.statSync(exportResult.path);
|
|
402
402
|
const fileSize = (stats.size / 1024).toFixed(2);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auto Mode Provider Management
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Handles LLM provider configuration and management for auto mode
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -30,7 +30,7 @@ async function ensureClineInstalled(forceInstall = false) {
|
|
|
30
30
|
|
|
31
31
|
console.log('Installing Cline CLI...');
|
|
32
32
|
const installResult = await llm.installCline();
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
if (installResult.success) {
|
|
35
35
|
console.log('✓ Cline CLI installed successfully');
|
|
36
36
|
return true;
|
|
@@ -78,28 +78,28 @@ async function getAllAvailableProviders() {
|
|
|
78
78
|
reason = 'missing_api_key';
|
|
79
79
|
}
|
|
80
80
|
break;
|
|
81
|
-
|
|
81
|
+
|
|
82
82
|
case 'openai':
|
|
83
83
|
if (!providerConfig.apiKey) {
|
|
84
84
|
canUse = false;
|
|
85
85
|
reason = 'missing_api_key';
|
|
86
86
|
}
|
|
87
87
|
break;
|
|
88
|
-
|
|
88
|
+
|
|
89
89
|
case 'ollama':
|
|
90
90
|
if (!providerConfig.baseUrl) {
|
|
91
91
|
canUse = false;
|
|
92
92
|
reason = 'missing_base_url';
|
|
93
93
|
}
|
|
94
94
|
break;
|
|
95
|
-
|
|
95
|
+
|
|
96
96
|
case 'groq':
|
|
97
97
|
if (!providerConfig.apiKey) {
|
|
98
98
|
canUse = false;
|
|
99
99
|
reason = 'missing_api_key';
|
|
100
100
|
}
|
|
101
101
|
break;
|
|
102
|
-
|
|
102
|
+
|
|
103
103
|
case 'bedrock':
|
|
104
104
|
if (!providerConfig.region || !providerConfig.accessKeyId) {
|
|
105
105
|
canUse = false;
|
|
@@ -132,7 +132,7 @@ async function getProviderConfig(excludeProvider = null) {
|
|
|
132
132
|
|
|
133
133
|
// Filter out excluded provider
|
|
134
134
|
const availableProviders = providers.filter(p => p.name !== excludeProvider);
|
|
135
|
-
|
|
135
|
+
|
|
136
136
|
if (availableProviders.length === 0) {
|
|
137
137
|
throw new Error('No available providers. Check configuration and API keys.');
|
|
138
138
|
}
|
|
@@ -140,11 +140,11 @@ async function getProviderConfig(excludeProvider = null) {
|
|
|
140
140
|
// Check each provider for rate limits and availability
|
|
141
141
|
for (const provider of availableProviders) {
|
|
142
142
|
const providerName = provider.name;
|
|
143
|
-
|
|
143
|
+
|
|
144
144
|
// Check provider-specific rate limits
|
|
145
145
|
let isRateLimited = false;
|
|
146
146
|
let rateLimitInfo = null;
|
|
147
|
-
|
|
147
|
+
|
|
148
148
|
switch (providerName) {
|
|
149
149
|
case 'antigravity':
|
|
150
150
|
isRateLimited = checkAntigravityRateLimit(providerManager);
|
|
@@ -152,14 +152,14 @@ async function getProviderConfig(excludeProvider = null) {
|
|
|
152
152
|
rateLimitInfo = handleAntigravityRateLimit(providerManager);
|
|
153
153
|
}
|
|
154
154
|
break;
|
|
155
|
-
|
|
155
|
+
|
|
156
156
|
case 'kiro':
|
|
157
157
|
isRateLimited = checkKiroRateLimit(providerManager);
|
|
158
158
|
if (isRateLimited) {
|
|
159
159
|
rateLimitInfo = handleKiroRateLimit(providerManager);
|
|
160
160
|
}
|
|
161
161
|
break;
|
|
162
|
-
|
|
162
|
+
|
|
163
163
|
case 'cline':
|
|
164
164
|
isRateLimited = checkClineRateLimit(providerManager);
|
|
165
165
|
if (isRateLimited) {
|
|
@@ -167,19 +167,19 @@ async function getProviderConfig(excludeProvider = null) {
|
|
|
167
167
|
}
|
|
168
168
|
break;
|
|
169
169
|
}
|
|
170
|
-
|
|
170
|
+
|
|
171
171
|
if (isRateLimited) {
|
|
172
172
|
console.warn(`Provider ${providerName} is rate limited:`, rateLimitInfo.message);
|
|
173
173
|
continue;
|
|
174
174
|
}
|
|
175
|
-
|
|
175
|
+
|
|
176
176
|
// Check IDE health for provider
|
|
177
177
|
const ideHealth = sharedHealthTracker.getHealth(providerName);
|
|
178
178
|
if (ideHealth && ideHealth.consecutiveFailures >= 3) {
|
|
179
179
|
console.warn(`Provider ${providerName} has ${ideHealth.consecutiveFailures} consecutive failures`);
|
|
180
180
|
continue;
|
|
181
181
|
}
|
|
182
|
-
|
|
182
|
+
|
|
183
183
|
// Return first available provider
|
|
184
184
|
return {
|
|
185
185
|
provider: providerName,
|
|
@@ -188,7 +188,7 @@ async function getProviderConfig(excludeProvider = null) {
|
|
|
188
188
|
manager: providerManager
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
|
|
192
192
|
// If we get here, all providers are rate limited or unhealthy
|
|
193
193
|
const rateLimitedProviders = availableProviders.filter(p => {
|
|
194
194
|
switch (p.name) {
|
|
@@ -198,7 +198,7 @@ async function getProviderConfig(excludeProvider = null) {
|
|
|
198
198
|
default: return false;
|
|
199
199
|
}
|
|
200
200
|
});
|
|
201
|
-
|
|
201
|
+
|
|
202
202
|
if (rateLimitedProviders.length > 0) {
|
|
203
203
|
const waitTime = Math.max(...rateLimitedProviders.map(p => {
|
|
204
204
|
switch (p.name) {
|
|
@@ -208,14 +208,14 @@ async function getProviderConfig(excludeProvider = null) {
|
|
|
208
208
|
default: return 60000;
|
|
209
209
|
}
|
|
210
210
|
}));
|
|
211
|
-
|
|
211
|
+
|
|
212
212
|
return {
|
|
213
213
|
action: 'wait',
|
|
214
214
|
waitTime,
|
|
215
215
|
message: `All providers are rate limited. Waiting ${waitTime/1000}s before retry.`
|
|
216
216
|
};
|
|
217
217
|
}
|
|
218
|
-
|
|
218
|
+
|
|
219
219
|
throw new Error('All providers are unavailable or unhealthy.');
|
|
220
220
|
}
|
|
221
221
|
|
|
@@ -224,7 +224,7 @@ async function getProviderConfig(excludeProvider = null) {
|
|
|
224
224
|
*/
|
|
225
225
|
function handleProviderFailure(providerName, error) {
|
|
226
226
|
sharedHealthTracker.recordFailure(providerName, error);
|
|
227
|
-
|
|
227
|
+
|
|
228
228
|
// Mark provider as temporarily skipped if too many failures
|
|
229
229
|
const health = sharedHealthTracker.getHealth(providerName);
|
|
230
230
|
if (health && health.consecutiveFailures >= 3) {
|