vibecodingmachine-cli 2026.3.14-1537 → 2026.6.17-1956
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
|
@@ -7,7 +7,7 @@ const os = require('os');
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* OpenCode Agent Checker - Handles OpenCode CLI specific checks and configuration
|
|
10
|
-
*
|
|
10
|
+
*
|
|
11
11
|
* This module provides specialized checking for OpenCode CLI agent:
|
|
12
12
|
* 1. First attempts a simple ping test (1+1 or "ping")
|
|
13
13
|
* 2. If configuration errors occur, attempts to pre-configure with working model
|
|
@@ -40,15 +40,15 @@ class OpenCodeChecker {
|
|
|
40
40
|
*/
|
|
41
41
|
async pingTest(configOverride = null) {
|
|
42
42
|
console.log('[OPENCODE CHECK] Starting ping test...');
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
return new Promise((resolve) => {
|
|
45
45
|
const env = { ...process.env };
|
|
46
46
|
if (configOverride) {
|
|
47
47
|
env.OPENCODE_CONFIG_CONTENT = configOverride;
|
|
48
48
|
console.log('[OPENCODE CHECK] Using config override:', configOverride);
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
const proc = spawn('opencode', ['
|
|
50
|
+
|
|
51
|
+
const proc = spawn('opencode', ['run', '1+1'], {
|
|
52
52
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
53
53
|
timeout: 30000,
|
|
54
54
|
env
|
|
@@ -73,46 +73,57 @@ class OpenCodeChecker {
|
|
|
73
73
|
const output = stdout + stderr;
|
|
74
74
|
console.log(`[OPENCODE CHECK] Process exited with code: ${code}`);
|
|
75
75
|
console.log(`[OPENCODE CHECK] Full output: ${output.substring(0, 500)}`);
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
// Check for successful response
|
|
78
|
-
if (code === 0
|
|
78
|
+
if (code === 0 || output.includes('2') || output.match(/\b2\b/)) {
|
|
79
79
|
console.log('[OPENCODE CHECK] ✓ Ping test successful');
|
|
80
80
|
resolve({ responsive: true });
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
// Check for TPM/rate limit errors (Groq free tier limitation)
|
|
85
|
+
if (output.includes('tokens per minute') || output.includes('TPM') || output.includes('Request too large')) {
|
|
86
|
+
console.log('[OPENCODE CHECK] ⚠ Rate limit / TPM error detected');
|
|
87
|
+
resolve({
|
|
88
|
+
responsive: false,
|
|
89
|
+
error: 'OpenCode exceeds Groq free tier token-per-minute limit. Upgrade Groq to Dev tier or use a different provider.',
|
|
90
|
+
rateLimited: true,
|
|
91
|
+
details: output.substring(0, 300)
|
|
92
|
+
});
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
84
96
|
// Check for configuration errors
|
|
85
|
-
const needsConfig =
|
|
97
|
+
const needsConfig =
|
|
86
98
|
output.includes('model') && output.includes('decommissioned') ||
|
|
87
99
|
output.includes('API key') ||
|
|
88
100
|
output.includes('configuration') ||
|
|
89
101
|
output.includes('configure') ||
|
|
90
102
|
output.includes('failed to process events') ||
|
|
91
|
-
output.includes('LSP Configuration') ||
|
|
92
|
-
output.includes('Unknown request URL') ||
|
|
93
|
-
output.includes('unknown_url');
|
|
103
|
+
output.includes('LSP Configuration') ||
|
|
104
|
+
output.includes('Unknown request URL') ||
|
|
105
|
+
output.includes('unknown_url');
|
|
94
106
|
|
|
95
107
|
if (needsConfig) {
|
|
96
108
|
console.log('[OPENCODE CHECK] ⚠ Configuration needed detected');
|
|
97
|
-
|
|
98
|
-
// Provide specific error details
|
|
109
|
+
|
|
99
110
|
let errorDetails = 'OpenCode needs configuration';
|
|
100
111
|
if (output.includes('Unknown request URL') || output.includes('unknown_url')) {
|
|
101
112
|
errorDetails = 'OpenCode has incorrect API endpoint configuration';
|
|
102
113
|
} else if (output.includes('max_tokens')) {
|
|
103
114
|
errorDetails = 'OpenCode has max_tokens configuration issue';
|
|
104
115
|
}
|
|
105
|
-
|
|
106
|
-
resolve({
|
|
107
|
-
responsive: false,
|
|
116
|
+
|
|
117
|
+
resolve({
|
|
118
|
+
responsive: false,
|
|
108
119
|
error: errorDetails,
|
|
109
120
|
needsConfig: true,
|
|
110
121
|
details: output.substring(0, 200)
|
|
111
122
|
});
|
|
112
123
|
} else {
|
|
113
124
|
console.log('[OPENCODE CHECK] ✗ Ping test failed for unknown reason');
|
|
114
|
-
resolve({
|
|
115
|
-
responsive: false,
|
|
125
|
+
resolve({
|
|
126
|
+
responsive: false,
|
|
116
127
|
error: `OpenCode ping failed (exit code: ${code})`,
|
|
117
128
|
details: output.substring(0, 200)
|
|
118
129
|
});
|
|
@@ -121,9 +132,9 @@ class OpenCodeChecker {
|
|
|
121
132
|
|
|
122
133
|
proc.on('error', (error) => {
|
|
123
134
|
console.log(`[OPENCODE CHECK] ✗ Process error: ${error.message}`);
|
|
124
|
-
resolve({
|
|
125
|
-
responsive: false,
|
|
126
|
-
error: `Failed to run OpenCode: ${error.message}`
|
|
135
|
+
resolve({
|
|
136
|
+
responsive: false,
|
|
137
|
+
error: `Failed to run OpenCode: ${error.message}`
|
|
127
138
|
});
|
|
128
139
|
});
|
|
129
140
|
});
|
|
@@ -135,20 +146,28 @@ class OpenCodeChecker {
|
|
|
135
146
|
*/
|
|
136
147
|
async createBasicConfig() {
|
|
137
148
|
console.log('[OPENCODE CHECK] Attempting to create basic configuration...');
|
|
138
|
-
|
|
149
|
+
|
|
139
150
|
try {
|
|
140
151
|
// Ensure config directory exists
|
|
141
152
|
fs.mkdirSync(this.configPath, { recursive: true });
|
|
142
153
|
console.log(`[OPENCODE CHECK] Config directory ensured: ${this.configPath}`);
|
|
143
154
|
|
|
155
|
+
// Preserve existing config if present (don't overwrite user's model choice)
|
|
156
|
+
let existingConfig = null;
|
|
157
|
+
if (fs.existsSync(this.globalConfigFile)) {
|
|
158
|
+
try {
|
|
159
|
+
existingConfig = JSON.parse(fs.readFileSync(this.globalConfigFile, 'utf8'));
|
|
160
|
+
} catch { }
|
|
161
|
+
}
|
|
162
|
+
|
|
144
163
|
// Try to detect available API keys from environment
|
|
145
164
|
const availableProviders = this.detectAvailableProviders();
|
|
146
165
|
console.log(`[OPENCODE CHECK] Available providers detected: ${availableProviders.join(', ')}`);
|
|
147
|
-
|
|
148
|
-
//
|
|
149
|
-
const model = this.selectWorkingModel(availableProviders);
|
|
166
|
+
|
|
167
|
+
// Use existing model if set, otherwise select a working model
|
|
168
|
+
const model = (existingConfig && existingConfig.model) || this.selectWorkingModel(availableProviders);
|
|
150
169
|
console.log(`[OPENCODE CHECK] Selected model: ${model}`);
|
|
151
|
-
|
|
170
|
+
|
|
152
171
|
const config = {
|
|
153
172
|
"$schema": "https://opencode.ai/config.json",
|
|
154
173
|
"model": model,
|
|
@@ -163,7 +182,7 @@ class OpenCodeChecker {
|
|
|
163
182
|
fs.writeFileSync(this.globalConfigFile, configJson);
|
|
164
183
|
console.log(`[OPENCODE CHECK] Configuration written to: ${this.globalConfigFile}`);
|
|
165
184
|
console.log(`[OPENCODE CHECK] Config content: ${configJson}`);
|
|
166
|
-
|
|
185
|
+
|
|
167
186
|
return { success: true };
|
|
168
187
|
} catch (error) {
|
|
169
188
|
console.log(`[OPENCODE CHECK] ✗ Failed to create config: ${error.message}`);
|
|
@@ -177,18 +196,18 @@ class OpenCodeChecker {
|
|
|
177
196
|
*/
|
|
178
197
|
detectAvailableProviders() {
|
|
179
198
|
const providers = [];
|
|
180
|
-
|
|
199
|
+
|
|
181
200
|
if (process.env.OPENAI_API_KEY) providers.push('openai');
|
|
182
201
|
if (process.env.ANTHROPIC_API_KEY) providers.push('anthropic');
|
|
183
202
|
if (process.env.GEMINI_API_KEY) providers.push('google');
|
|
184
203
|
if (process.env.GROQ_API_KEY) providers.push('groq');
|
|
185
|
-
|
|
204
|
+
|
|
186
205
|
return providers;
|
|
187
206
|
}
|
|
188
207
|
|
|
189
208
|
/**
|
|
190
209
|
* Select a working model based on available providers
|
|
191
|
-
* @param {string[]} providers
|
|
210
|
+
* @param {string[]} providers
|
|
192
211
|
* @returns {string}
|
|
193
212
|
*/
|
|
194
213
|
selectWorkingModel(providers) {
|
|
@@ -196,7 +215,7 @@ class OpenCodeChecker {
|
|
|
196
215
|
'openai': 'gpt-4o-mini',
|
|
197
216
|
'anthropic': 'claude-3-haiku-20240307',
|
|
198
217
|
'google': 'gemini-flash-1.5',
|
|
199
|
-
'groq': '
|
|
218
|
+
'groq': 'llama-3.3-70b-versatile'
|
|
200
219
|
};
|
|
201
220
|
|
|
202
221
|
// Try providers in order of preference
|
|
@@ -207,7 +226,7 @@ class OpenCodeChecker {
|
|
|
207
226
|
}
|
|
208
227
|
|
|
209
228
|
// Fallback to a common model (may fail but worth trying)
|
|
210
|
-
return '
|
|
229
|
+
return 'claude-3-haiku-20240307';
|
|
211
230
|
}
|
|
212
231
|
|
|
213
232
|
/**
|
|
@@ -216,7 +235,7 @@ class OpenCodeChecker {
|
|
|
216
235
|
*/
|
|
217
236
|
async attemptKeyboardConfiguration() {
|
|
218
237
|
console.log('[OPENCODE CHECK] Attempting keyboard-based configuration...');
|
|
219
|
-
|
|
238
|
+
|
|
220
239
|
return new Promise((resolve) => {
|
|
221
240
|
// Try to use expect or node-pty to send keyboard shortcuts
|
|
222
241
|
let pty;
|
|
@@ -242,28 +261,28 @@ class OpenCodeChecker {
|
|
|
242
261
|
proc.on('data', (data) => {
|
|
243
262
|
output += data;
|
|
244
263
|
console.log('[OPENCODE CHECK] KEYBOARD STDOUT:', data.trim());
|
|
245
|
-
|
|
264
|
+
|
|
246
265
|
// Wait for OpenCode to fully load
|
|
247
266
|
if (output.includes('OpenCode') && output.includes('press enter to send')) {
|
|
248
267
|
console.log('[OPENCODE CHECK] OpenCode ready, attempting model selection...');
|
|
249
|
-
|
|
268
|
+
|
|
250
269
|
// Send ctrl+o to open model selection
|
|
251
270
|
proc.write('\x0f'); // ctrl+o
|
|
252
|
-
|
|
271
|
+
|
|
253
272
|
setTimeout(() => {
|
|
254
273
|
// Try to select a working model by typing and entering
|
|
255
274
|
proc.write('Llama3_3_70BVersatile\r');
|
|
256
|
-
|
|
275
|
+
|
|
257
276
|
setTimeout(() => {
|
|
258
277
|
// Try to send a test message
|
|
259
278
|
proc.write('1+1\r');
|
|
260
|
-
|
|
279
|
+
|
|
261
280
|
setTimeout(() => {
|
|
262
281
|
if (output.includes('2') || output.includes('2\n')) {
|
|
263
282
|
configured = true;
|
|
264
283
|
console.log('[OPENCODE CHECK] ✓ Keyboard configuration successful');
|
|
265
284
|
}
|
|
266
|
-
|
|
285
|
+
|
|
267
286
|
proc.write('\x03'); // ctrl+c to quit
|
|
268
287
|
setTimeout(() => proc.destroy(), 1000);
|
|
269
288
|
}, 3000);
|
|
@@ -273,8 +292,8 @@ class OpenCodeChecker {
|
|
|
273
292
|
});
|
|
274
293
|
|
|
275
294
|
proc.on('exit', () => {
|
|
276
|
-
resolve({
|
|
277
|
-
success: configured,
|
|
295
|
+
resolve({
|
|
296
|
+
success: configured,
|
|
278
297
|
message: configured ? 'Keyboard configuration successful' : 'Keyboard configuration failed - manual intervention required'
|
|
279
298
|
});
|
|
280
299
|
});
|
|
@@ -283,9 +302,9 @@ class OpenCodeChecker {
|
|
|
283
302
|
setTimeout(() => {
|
|
284
303
|
if (!proc.destroyed) {
|
|
285
304
|
proc.destroy();
|
|
286
|
-
resolve({
|
|
287
|
-
success: false,
|
|
288
|
-
message: 'Keyboard configuration timed out'
|
|
305
|
+
resolve({
|
|
306
|
+
success: false,
|
|
307
|
+
message: 'Keyboard configuration timed out'
|
|
289
308
|
});
|
|
290
309
|
}
|
|
291
310
|
}, 15000);
|
|
@@ -298,7 +317,7 @@ class OpenCodeChecker {
|
|
|
298
317
|
*/
|
|
299
318
|
async attemptLSPConfiguration() {
|
|
300
319
|
console.log('[OPENCODE CHECK] Attempting to bypass LSP Configuration...');
|
|
301
|
-
|
|
320
|
+
|
|
302
321
|
return new Promise((resolve) => {
|
|
303
322
|
// Try to send a message to skip LSP configuration
|
|
304
323
|
const proc = spawn('opencode', ['-p', 'skip', '-q'], {
|
|
@@ -324,7 +343,7 @@ class OpenCodeChecker {
|
|
|
324
343
|
proc.on('close', (code) => {
|
|
325
344
|
const output = stdout + stderr;
|
|
326
345
|
console.log(`[OPENCODE CHECK] LSP config process exited with code: ${code}`);
|
|
327
|
-
|
|
346
|
+
|
|
328
347
|
// If we get a successful response or it moves past the LSP config
|
|
329
348
|
if (code === 0 && !output.includes('LSP Configuration')) {
|
|
330
349
|
console.log('[OPENCODE CHECK] ✓ LSP Configuration bypassed');
|
|
@@ -348,7 +367,7 @@ class OpenCodeChecker {
|
|
|
348
367
|
*/
|
|
349
368
|
async testInteractiveMode() {
|
|
350
369
|
console.log('[OPENCODE CHECK] Testing interactive mode vs non-interactive mode...');
|
|
351
|
-
|
|
370
|
+
|
|
352
371
|
return new Promise((resolve) => {
|
|
353
372
|
const proc = spawn('opencode', ['-d'], {
|
|
354
373
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
@@ -363,7 +382,7 @@ class OpenCodeChecker {
|
|
|
363
382
|
const chunk = data.toString();
|
|
364
383
|
stdout += chunk;
|
|
365
384
|
console.log('[OPENCODE CHECK] INTERACTIVE STDOUT:', chunk.trim());
|
|
366
|
-
|
|
385
|
+
|
|
367
386
|
// Check if interactive mode loads successfully and has the correct model
|
|
368
387
|
if (stdout.includes('OpenCode') && (stdout.includes('press enter to send') || stdout.includes('ctrl+? help'))) {
|
|
369
388
|
interactiveReady = true;
|
|
@@ -387,22 +406,22 @@ class OpenCodeChecker {
|
|
|
387
406
|
|
|
388
407
|
proc.on('close', (code) => {
|
|
389
408
|
clearTimeout(timeout);
|
|
390
|
-
|
|
409
|
+
|
|
391
410
|
if (interactiveReady) {
|
|
392
411
|
resolve({ interactiveWorks: true });
|
|
393
412
|
} else {
|
|
394
|
-
resolve({
|
|
395
|
-
interactiveWorks: false,
|
|
396
|
-
error: 'Interactive mode failed to load properly'
|
|
413
|
+
resolve({
|
|
414
|
+
interactiveWorks: false,
|
|
415
|
+
error: 'Interactive mode failed to load properly'
|
|
397
416
|
});
|
|
398
417
|
}
|
|
399
418
|
});
|
|
400
419
|
|
|
401
420
|
proc.on('error', (error) => {
|
|
402
421
|
clearTimeout(timeout);
|
|
403
|
-
resolve({
|
|
404
|
-
interactiveWorks: false,
|
|
405
|
-
error: `Failed to start interactive mode: ${error.message}`
|
|
422
|
+
resolve({
|
|
423
|
+
interactiveWorks: false,
|
|
424
|
+
error: `Failed to start interactive mode: ${error.message}`
|
|
406
425
|
});
|
|
407
426
|
});
|
|
408
427
|
});
|
|
@@ -414,7 +433,7 @@ class OpenCodeChecker {
|
|
|
414
433
|
*/
|
|
415
434
|
async attemptAutoConfiguration() {
|
|
416
435
|
console.log('[OPENCODE CHECK] Attempting to detect auto-configuration prompts...');
|
|
417
|
-
|
|
436
|
+
|
|
418
437
|
return new Promise((resolve) => {
|
|
419
438
|
const proc = spawn('opencode', ['-d'], {
|
|
420
439
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
@@ -429,9 +448,9 @@ class OpenCodeChecker {
|
|
|
429
448
|
const chunk = data.toString();
|
|
430
449
|
stdout += chunk;
|
|
431
450
|
console.log('[OPENCODE CHECK] AUTO-CONFIG STDOUT:', chunk.trim());
|
|
432
|
-
|
|
451
|
+
|
|
433
452
|
// Detect common configuration prompts
|
|
434
|
-
if (stdout.includes('Select a model') ||
|
|
453
|
+
if (stdout.includes('Select a model') ||
|
|
435
454
|
stdout.includes('Choose a provider') ||
|
|
436
455
|
stdout.includes('API key') ||
|
|
437
456
|
stdout.includes('Configure') ||
|
|
@@ -455,23 +474,23 @@ class OpenCodeChecker {
|
|
|
455
474
|
|
|
456
475
|
proc.on('close', (code) => {
|
|
457
476
|
clearTimeout(timeout);
|
|
458
|
-
|
|
477
|
+
|
|
459
478
|
if (detectedPrompt) {
|
|
460
|
-
resolve({
|
|
461
|
-
success: false,
|
|
479
|
+
resolve({
|
|
480
|
+
success: false,
|
|
462
481
|
configured: false,
|
|
463
482
|
error: 'OpenCode is waiting for initial configuration. Please run `opencode` interactively to complete setup.',
|
|
464
483
|
needsManualConfig: true
|
|
465
484
|
});
|
|
466
485
|
} else if (stdout.includes('Error') || stderr.includes('Error')) {
|
|
467
|
-
resolve({
|
|
468
|
-
success: false,
|
|
486
|
+
resolve({
|
|
487
|
+
success: false,
|
|
469
488
|
configured: false,
|
|
470
489
|
error: 'OpenCode configuration error detected'
|
|
471
490
|
});
|
|
472
491
|
} else {
|
|
473
|
-
resolve({
|
|
474
|
-
success: true,
|
|
492
|
+
resolve({
|
|
493
|
+
success: true,
|
|
475
494
|
configured: true
|
|
476
495
|
});
|
|
477
496
|
}
|
|
@@ -479,10 +498,10 @@ class OpenCodeChecker {
|
|
|
479
498
|
|
|
480
499
|
proc.on('error', (error) => {
|
|
481
500
|
clearTimeout(timeout);
|
|
482
|
-
resolve({
|
|
483
|
-
success: false,
|
|
501
|
+
resolve({
|
|
502
|
+
success: false,
|
|
484
503
|
configured: false,
|
|
485
|
-
error: `Failed to start OpenCode: ${error.message}`
|
|
504
|
+
error: `Failed to start OpenCode: ${error.message}`
|
|
486
505
|
});
|
|
487
506
|
});
|
|
488
507
|
});
|
|
@@ -514,22 +533,37 @@ class OpenCodeChecker {
|
|
|
514
533
|
};
|
|
515
534
|
}
|
|
516
535
|
|
|
536
|
+
// 2b. If rate limited (e.g. Groq TPM), report as rate_limited
|
|
537
|
+
if (pingResult.rateLimited) {
|
|
538
|
+
return {
|
|
539
|
+
status: 'rate_limited',
|
|
540
|
+
message: pingResult.error,
|
|
541
|
+
checkedAt
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
|
|
517
545
|
// 3. If ping failed due to configuration, try to create basic config
|
|
518
546
|
if (pingResult.needsConfig) {
|
|
519
547
|
console.log('🔧 OpenCode needs configuration, attempting to setup...');
|
|
520
|
-
|
|
548
|
+
|
|
521
549
|
const configResult = await this.createBasicConfig();
|
|
522
550
|
if (configResult.success) {
|
|
523
|
-
// Create config override
|
|
524
|
-
|
|
525
|
-
|
|
551
|
+
// Create config override using model from file (may be user-configured)
|
|
552
|
+
let fileModel = null;
|
|
553
|
+
try {
|
|
554
|
+
if (fs.existsSync(this.globalConfigFile)) {
|
|
555
|
+
const fc = JSON.parse(fs.readFileSync(this.globalConfigFile, 'utf8'));
|
|
556
|
+
fileModel = fc.model;
|
|
557
|
+
}
|
|
558
|
+
} catch { }
|
|
559
|
+
const model = fileModel || this.selectWorkingModel(this.detectAvailableProviders());
|
|
526
560
|
const configOverride = JSON.stringify({
|
|
527
561
|
"$schema": "https://opencode.ai/config.json",
|
|
528
562
|
"model": model,
|
|
529
563
|
"autoupdate": false,
|
|
530
564
|
"server": { "port": 4096 }
|
|
531
565
|
});
|
|
532
|
-
|
|
566
|
+
|
|
533
567
|
console.log('[OPENCODE CHECK] Trying with config override...');
|
|
534
568
|
const retryPing = await this.pingTest(configOverride);
|
|
535
569
|
if (retryPing.responsive) {
|
|
@@ -541,7 +575,7 @@ class OpenCodeChecker {
|
|
|
541
575
|
} else if (retryPing.needsConfig) {
|
|
542
576
|
// Still needs config - provide specific guidance based on what we know
|
|
543
577
|
console.log('🔧 Non-interactive mode has max_tokens issues, but interactive mode may work...');
|
|
544
|
-
|
|
578
|
+
|
|
545
579
|
return {
|
|
546
580
|
status: 'error',
|
|
547
581
|
message: 'OpenCode has max_tokens configuration issues with the selected Groq model. Both interactive and non-interactive modes are affected. Please try: 1) Select a different model with Ctrl+o, 2) Check your GROQ_API_KEY quota, 3) Update OpenCode, or 4) Use a different provider.',
|
|
@@ -132,7 +132,7 @@ async function checkProvider(providerId, config = {}, repoPath, onProgress = nul
|
|
|
132
132
|
if (!installed) {
|
|
133
133
|
return { status: 'error', message: `${def.name} not installed and auto-install failed: ${note}`, checkedAt: new Date().toISOString(), requirementLeftPending: false };
|
|
134
134
|
}
|
|
135
|
-
|
|
135
|
+
|
|
136
136
|
if (onProgress) {
|
|
137
137
|
onProgress(providerId, 'installing', null, 'Installation complete, configuring...');
|
|
138
138
|
}
|
|
@@ -143,7 +143,7 @@ async function checkProvider(providerId, config = {}, repoPath, onProgress = nul
|
|
|
143
143
|
const { OpenCodeChecker } = require('./opencode-checker');
|
|
144
144
|
const checker = new OpenCodeChecker();
|
|
145
145
|
const result = await checker.check();
|
|
146
|
-
|
|
146
|
+
|
|
147
147
|
if (result.status === 'success') {
|
|
148
148
|
// OpenCode is responsive, create the result file to indicate success
|
|
149
149
|
try {
|
|
@@ -164,28 +164,28 @@ async function checkProvider(providerId, config = {}, repoPath, onProgress = nul
|
|
|
164
164
|
try {
|
|
165
165
|
const { getProviderDefinition } = require('../provider-registry');
|
|
166
166
|
const providerDef = getProviderDefinition(providerId);
|
|
167
|
-
|
|
167
|
+
|
|
168
168
|
// Only check configuration if the provider has configKeys defined
|
|
169
169
|
if (providerDef && providerDef.configKeys) {
|
|
170
170
|
const { getAutoConfig } = require('../config');
|
|
171
171
|
const autoConfig = getAutoConfig();
|
|
172
|
-
|
|
172
|
+
|
|
173
173
|
// Check if all required config keys are available
|
|
174
174
|
const hasRequiredConfig = Object.entries(providerDef.configKeys).every(([configKey]) => {
|
|
175
175
|
return autoConfig && autoConfig[configKey];
|
|
176
176
|
});
|
|
177
|
-
|
|
177
|
+
|
|
178
178
|
if (!hasRequiredConfig) {
|
|
179
179
|
let configMessage = `${def.name} is installed but CLI is not configured for automation. `;
|
|
180
|
-
|
|
180
|
+
|
|
181
181
|
// Generate specific config instructions based on configKeys
|
|
182
182
|
const configInstructions = Object.keys(providerDef.configKeys).map(key => {
|
|
183
183
|
const envVar = key.toUpperCase();
|
|
184
184
|
return `Set ${envVar} or run "vcm auto:config".`;
|
|
185
185
|
}).join(' ');
|
|
186
|
-
|
|
186
|
+
|
|
187
187
|
configMessage += configInstructions;
|
|
188
|
-
|
|
188
|
+
|
|
189
189
|
return {
|
|
190
190
|
status: 'error',
|
|
191
191
|
message: configMessage,
|
|
@@ -195,10 +195,10 @@ async function checkProvider(providerId, config = {}, repoPath, onProgress = nul
|
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
|
|
199
|
-
// If no configKeys are defined (like
|
|
198
|
+
|
|
199
|
+
// If no configKeys are defined (like Devin), assume no special configuration needed
|
|
200
200
|
console.log(`[AGENT CHECK] ${def.name} requires no special configuration`);
|
|
201
|
-
|
|
201
|
+
|
|
202
202
|
} catch (configError) {
|
|
203
203
|
console.warn(`[AGENT CHECK] Could not check provider configuration: ${configError.message}`);
|
|
204
204
|
// Continue with automation check even if configuration check fails
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Quota Checker Module
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Contains quota checking utilities for providers.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ async function checkAntigravityQuota() {
|
|
|
12
12
|
try {
|
|
13
13
|
const { AppleScriptManager } = require('vibecodingmachine-core');
|
|
14
14
|
const manager = new AppleScriptManager();
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
const script = `
|
|
17
17
|
tell application "Antigravity"
|
|
18
18
|
if it is running then
|
|
@@ -31,11 +31,11 @@ async function checkAntigravityQuota() {
|
|
|
31
31
|
`;
|
|
32
32
|
|
|
33
33
|
const result = await manager.executeScript(script);
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
// Parse the result to determine if rate limited
|
|
36
|
-
const isRateLimited = result.includes('quota') &&
|
|
36
|
+
const isRateLimited = result.includes('quota') &&
|
|
37
37
|
(result.includes('limit') || result.includes('exceeded'));
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
return {
|
|
40
40
|
isRateLimited,
|
|
41
41
|
message: result,
|
|
@@ -9,25 +9,25 @@ async function checkAntigravityQuota() {
|
|
|
9
9
|
const { AppleScriptManager } = require('vibecodingmachine-core');
|
|
10
10
|
const manager = new AppleScriptManager();
|
|
11
11
|
const result = await manager.checkAntigravityQuotaLimit();
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
// If no rate limit detected, return as-is
|
|
14
14
|
if (!result || !result.isRateLimited) {
|
|
15
15
|
return result || { isRateLimited: false };
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
// Parse the UI text to extract refresh time
|
|
19
19
|
const text = result.message || '';
|
|
20
20
|
let resumeAt = '';
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
// Look for pattern like "refresh on 2/23/2026, 5:32:16 PM"
|
|
23
23
|
const matchRefresh = text.match(/refresh\s+on\s+(\d+\/\d+\/\d+,\s+\d+:\d+:\d+\s+[AP]M)/i);
|
|
24
24
|
if (matchRefresh) {
|
|
25
25
|
resumeAt = matchRefresh[1];
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
// Clean up message to just the key part
|
|
29
29
|
const cleanMessage = text.split('\n').filter(line => line.trim()).join(' ').substring(0, 150);
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
return {
|
|
32
32
|
isRateLimited: true,
|
|
33
33
|
message: cleanMessage || text,
|
|
@@ -25,7 +25,7 @@ function addTestRequirement(reqPath, resultFilePath) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
const content = fs.readFileSync(reqPath, 'utf8');
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
// Check if test requirement already exists
|
|
30
30
|
if (content.includes(TEST_REQ_TITLE)) {
|
|
31
31
|
return;
|
|
@@ -70,7 +70,7 @@ function removeTestRequirement(reqPath) {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
const content = fs.readFileSync(reqPath, 'utf8');
|
|
73
|
-
|
|
73
|
+
|
|
74
74
|
// Find the test requirement section
|
|
75
75
|
const startIndex = content.indexOf(`- ${TEST_REQ_TITLE}`);
|
|
76
76
|
if (startIndex === -1) {
|
|
@@ -86,10 +86,10 @@ function removeTestRequirement(reqPath) {
|
|
|
86
86
|
// Remove the test requirement and clean up extra blank lines
|
|
87
87
|
const beforeTest = content.slice(0, startIndex);
|
|
88
88
|
const afterTest = content.slice(endIndex);
|
|
89
|
-
|
|
89
|
+
|
|
90
90
|
// Clean up triple blank lines
|
|
91
91
|
const cleanedContent = (beforeTest + afterTest).replace(/\n{3,}/g, '\n\n');
|
|
92
|
-
|
|
92
|
+
|
|
93
93
|
fs.writeFileSync(reqPath, cleanedContent, 'utf8');
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -102,7 +102,7 @@ function extractTestRequirement(reqPath) {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
const content = fs.readFileSync(reqPath, 'utf8');
|
|
105
|
-
|
|
105
|
+
|
|
106
106
|
// Find the test requirement section
|
|
107
107
|
const startIndex = content.indexOf(`- ${TEST_REQ_TITLE}`);
|
|
108
108
|
if (startIndex === -1) {
|
|
@@ -117,7 +117,7 @@ function extractTestRequirement(reqPath) {
|
|
|
117
117
|
|
|
118
118
|
// Extract the test requirement content including the title line
|
|
119
119
|
const testContent = content.slice(startIndex, endIndex);
|
|
120
|
-
|
|
120
|
+
|
|
121
121
|
return testContent.trim();
|
|
122
122
|
}
|
|
123
123
|
|