vibecodingmachine-cli 2026.2.26-1752 โ†’ 2026.3.9-1621

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.
Files changed (74) hide show
  1. package/bin/auth/auth-compliance.js +7 -1
  2. package/bin/commands/agent-commands.js +150 -228
  3. package/bin/commands/command-aliases.js +68 -0
  4. package/bin/vibecodingmachine.js +1 -2
  5. package/package.json +2 -2
  6. package/src/commands/agents/list.js +71 -115
  7. package/src/commands/agents-check.js +16 -4
  8. package/src/commands/analyze-file-sizes.js +1 -1
  9. package/src/commands/auto-direct/auto-provider-manager.js +290 -0
  10. package/src/commands/auto-direct/auto-status-display.js +331 -0
  11. package/src/commands/auto-direct/auto-utils.js +439 -0
  12. package/src/commands/auto-direct/file-operations.js +110 -0
  13. package/src/commands/auto-direct/provider-config.js +1 -1
  14. package/src/commands/auto-direct/provider-manager.js +1 -1
  15. package/src/commands/auto-direct/status-display.js +1 -1
  16. package/src/commands/auto-direct/utils.js +24 -18
  17. package/src/commands/auto-direct-refactored.js +413 -0
  18. package/src/commands/auto-direct.js +594 -188
  19. package/src/commands/requirements/commands.js +353 -0
  20. package/src/commands/requirements/default-handlers.js +272 -0
  21. package/src/commands/requirements/disable.js +97 -0
  22. package/src/commands/requirements/enable.js +97 -0
  23. package/src/commands/requirements/utils.js +194 -0
  24. package/src/commands/requirements-refactored.js +60 -0
  25. package/src/commands/requirements.js +38 -771
  26. package/src/commands/specs/disable.js +96 -0
  27. package/src/commands/specs/enable.js +96 -0
  28. package/src/trui/TruiInterface.js +5 -11
  29. package/src/trui/agents/AgentInterface.js +24 -396
  30. package/src/trui/agents/handlers/CommandHandler.js +93 -0
  31. package/src/trui/agents/handlers/ContextManager.js +117 -0
  32. package/src/trui/agents/handlers/DisplayHandler.js +243 -0
  33. package/src/trui/agents/handlers/HelpHandler.js +51 -0
  34. package/src/utils/auth.js +13 -111
  35. package/src/utils/config.js +4 -0
  36. package/src/utils/interactive/requirements-navigation.js +17 -15
  37. package/src/utils/interactive-broken.js +2 -2
  38. package/src/utils/provider-checker/agent-runner.js +15 -1
  39. package/src/utils/provider-checker/cli-installer.js +149 -7
  40. package/src/utils/provider-checker/opencode-checker.js +588 -0
  41. package/src/utils/provider-checker/provider-validator.js +88 -3
  42. package/src/utils/provider-checker/time-formatter.js +3 -2
  43. package/src/utils/provider-manager.js +28 -20
  44. package/src/utils/provider-registry.js +35 -3
  45. package/src/utils/requirements-navigator/index.js +94 -0
  46. package/src/utils/requirements-navigator/input-handler.js +217 -0
  47. package/src/utils/requirements-navigator/section-loader.js +188 -0
  48. package/src/utils/requirements-navigator/tree-builder.js +105 -0
  49. package/src/utils/requirements-navigator/tree-renderer.js +50 -0
  50. package/src/utils/requirements-navigator.js +2 -583
  51. package/src/utils/trui-clarifications.js +188 -0
  52. package/src/utils/trui-feedback.js +54 -1
  53. package/src/utils/trui-kiro-integration.js +398 -0
  54. package/src/utils/trui-main-handlers.js +194 -0
  55. package/src/utils/trui-main-menu.js +235 -0
  56. package/src/utils/trui-nav-agents.js +178 -25
  57. package/src/utils/trui-nav-requirements.js +203 -27
  58. package/src/utils/trui-nav-settings.js +114 -1
  59. package/src/utils/trui-nav-specifications.js +44 -3
  60. package/src/utils/trui-navigation-backup.js +603 -0
  61. package/src/utils/trui-navigation.js +70 -228
  62. package/src/utils/trui-provider-health.js +274 -0
  63. package/src/utils/trui-provider-manager.js +376 -0
  64. package/src/utils/trui-quick-menu.js +25 -1
  65. package/src/utils/trui-req-actions-backup.js +507 -0
  66. package/src/utils/trui-req-actions.js +148 -216
  67. package/src/utils/trui-req-editor.js +170 -0
  68. package/src/utils/trui-req-file-ops.js +278 -0
  69. package/src/utils/trui-req-tree-old.js +719 -0
  70. package/src/utils/trui-req-tree.js +348 -627
  71. package/src/utils/trui-specifications.js +25 -7
  72. package/src/utils/trui-windsurf.js +231 -10
  73. package/src/utils/welcome-screen-extracted.js +2 -2
  74. package/src/utils/welcome-screen.js +2 -2
@@ -0,0 +1,413 @@
1
+ /**
2
+ * Refactored Auto Mode Direct Implementation
3
+ *
4
+ * Splits monolithic auto-direct.js into modular components
5
+ */
6
+
7
+ // Import modular components
8
+ const {
9
+ getTimestamp,
10
+ getLogTimestamp,
11
+ translateStage,
12
+ stripAnsi,
13
+ getVisualWidth,
14
+ padToVisualWidth,
15
+ isRateLimitMessage,
16
+ sleep,
17
+ safeLog,
18
+ updateRequirementsStatus,
19
+ getCurrentRequirement,
20
+ countTodoRequirements,
21
+ moveRequirementToVerify,
22
+ moveRequirementToRecycle
23
+ } = require('./auto-direct/auto-utils');
24
+
25
+ const {
26
+ ensureClineInstalled,
27
+ getAllAvailableProviders,
28
+ getProviderConfig,
29
+ handleProviderFailure,
30
+ handleProviderSuccess,
31
+ shouldSkipProvider,
32
+ getProviderHealth,
33
+ getAllProvidersHealth,
34
+ resetProviderHealth,
35
+ sharedProviderManager,
36
+ sharedHealthTracker
37
+ } = require('./auto-direct/auto-provider-manager');
38
+
39
+ const {
40
+ printStatusCard,
41
+ printWorkflowStages,
42
+ printProviderInfo,
43
+ printRateLimitWarning,
44
+ printError,
45
+ printSuccess,
46
+ printWarning,
47
+ printInfo,
48
+ printDebug,
49
+ createSpinner,
50
+ printFileChangeSummary,
51
+ printIterationSummary,
52
+ printTiming,
53
+ clearLine,
54
+ setConfiguredStages,
55
+ currentStatusMode
56
+ } = require('./auto-direct/auto-status-display');
57
+
58
+ // Import remaining dependencies
59
+ const chalk = require('chalk');
60
+ const vibecodingmachineCore = require('vibecodingmachine-core');
61
+ const { DirectLLMManager, AppleScriptManager } = vibecodingmachineCore;
62
+ const { detectLocale, setLocale } = vibecodingmachineCore;
63
+ const { getRepoPath, getEffectiveRepoPath, getAutoConfig, setAutoConfig, getStages, DEFAULT_STAGES } = require('../utils/config');
64
+ const { getRequirementsPath, readRequirements } = vibecodingmachineCore;
65
+ const fs = require('fs-extra');
66
+ const path = require('path');
67
+ const { spawn } = require('child_process');
68
+ const chokidar = require('chokidar');
69
+ const { getProviderPreferences, saveProviderPreferences } = require('../utils/provider-registry');
70
+ const { createKeyboardHandler } = require('../utils/keyboard-handler');
71
+ const logger = require('../utils/logger');
72
+
73
+ // Initialize locale detection for auto mode
74
+ const detectedLocale = detectLocale();
75
+ setLocale(detectedLocale);
76
+
77
+ // Constants and state
78
+ const CLI_ENTRY_POINT = path.join(__dirname, '../../bin/vibecodingmachine.js');
79
+ let keyboardHandler = null;
80
+
81
+ // Set configured stages for status display
82
+ setConfiguredStages(getStages());
83
+
84
+ /**
85
+ * Main auto mode function - refactored to use modular components
86
+ */
87
+ async function runAutoMode(options = {}) {
88
+ const startTime = Date.now();
89
+
90
+ try {
91
+ printInfo('๐Ÿš€ Starting Auto Mode...');
92
+
93
+ // Initialize repository
94
+ const repoPath = await getEffectiveRepoPath();
95
+ if (!repoPath) {
96
+ throw new Error('No repository configured. Run "app init" first.');
97
+ }
98
+
99
+ // Get current requirement
100
+ const currentRequirement = await getCurrentRequirement(repoPath);
101
+ if (!currentRequirement) {
102
+ throw new Error('No current requirement found. Use "app req next" to set one.');
103
+ }
104
+
105
+ printSuccess(`Working on: ${currentRequirement}`);
106
+
107
+ // Initialize provider
108
+ const providerConfig = await getProviderConfig();
109
+ if (providerConfig.action === 'wait') {
110
+ printRateLimitWarning('providers', providerConfig.waitTime);
111
+ await sleep(providerConfig.waitTime);
112
+ // Retry getting provider config
113
+ const retryConfig = await getProviderConfig();
114
+ if (retryConfig.action === 'wait') {
115
+ throw new Error('All providers are rate limited. Please try again later.');
116
+ }
117
+ }
118
+
119
+ printProviderInfo(providerConfig.provider, providerConfig.config);
120
+
121
+ // Initialize LLM manager
122
+ const llmManager = new DirectLLMManager(providerConfig.config);
123
+
124
+ // Set up keyboard handler
125
+ keyboardHandler = createKeyboardHandler({
126
+ onExit: () => {
127
+ printInfo('๐Ÿ›‘ Auto mode stopped by user');
128
+ process.exit(0);
129
+ },
130
+ onPause: () => {
131
+ printInfo('โธ๏ธ Auto mode paused');
132
+ },
133
+ onResume: () => {
134
+ printInfo('โ–ถ๏ธ Auto mode resumed');
135
+ }
136
+ });
137
+
138
+ // Main auto mode loop
139
+ await runAutoModeLoop(llmManager, providerConfig, currentRequirement, options);
140
+
141
+ const endTime = Date.now();
142
+ printTiming(startTime, endTime);
143
+ printSuccess('๐ŸŽ‰ Auto mode completed successfully!');
144
+
145
+ } catch (error) {
146
+ printError(error, 'Auto Mode');
147
+ process.exit(1);
148
+ } finally {
149
+ if (keyboardHandler) {
150
+ keyboardHandler.cleanup();
151
+ }
152
+ }
153
+ }
154
+
155
+ /**
156
+ * Main auto mode execution loop
157
+ */
158
+ async function runAutoModeLoop(llmManager, providerConfig, currentRequirement, options) {
159
+ const stages = getStages();
160
+ let currentStage = 'PREPARE';
161
+ let iteration = 1;
162
+ const maxIterations = options.maxIterations || 5;
163
+
164
+ while (iteration <= maxIterations) {
165
+ printIterationSummary(iteration, maxIterations, currentRequirement, currentStage);
166
+ printStatusCard(currentRequirement, currentStage);
167
+ printWorkflowStages(currentStage);
168
+
169
+ try {
170
+ // Execute current stage
171
+ await executeStage(llmManager, providerConfig, currentStage, currentRequirement, options);
172
+
173
+ // Move to next stage
174
+ const currentIndex = stages.indexOf(currentStage);
175
+ if (currentIndex < stages.length - 1) {
176
+ currentStage = stages[currentIndex + 1];
177
+ } else {
178
+ // Completed all stages
179
+ await moveRequirementToVerify(await getRepoPath(), currentRequirement);
180
+ printSuccess('โœ… All stages completed! Requirement moved to verification.');
181
+ break;
182
+ }
183
+
184
+ } catch (error) {
185
+ handleProviderFailure(providerConfig.provider, error);
186
+
187
+ if (shouldSkipProvider(providerConfig.provider)) {
188
+ printWarning(`Provider ${providerConfig.provider} is temporarily unavailable. Switching...`);
189
+
190
+ // Try to get alternative provider
191
+ const newProviderConfig = await getProviderConfig(providerConfig.provider);
192
+ if (newProviderConfig.action === 'wait') {
193
+ printRateLimitWarning('alternative providers', newProviderConfig.waitTime);
194
+ await sleep(newProviderConfig.waitTime);
195
+ continue;
196
+ }
197
+
198
+ providerConfig = newProviderConfig;
199
+ llmManager = new DirectLLMManager(providerConfig.config);
200
+ printProviderInfo(providerConfig.provider, providerConfig.config);
201
+ }
202
+
203
+ // Retry current stage
204
+ printWarning(`Retrying stage ${currentStage}...`);
205
+ await sleep(5000);
206
+ continue;
207
+ }
208
+
209
+ iteration++;
210
+ }
211
+
212
+ if (iteration > maxIterations) {
213
+ printWarning(`Maximum iterations (${maxIterations}) reached. Moving requirement to recycle.`);
214
+ await moveRequirementToRecycle(await getRepoPath(), currentRequirement);
215
+ }
216
+ }
217
+
218
+ /**
219
+ * Execute a specific workflow stage
220
+ */
221
+ async function executeStage(llmManager, providerConfig, stage, requirement, options) {
222
+ const repoPath = await getRepoPath();
223
+
224
+ // Update status
225
+ await updateRequirementsStatus(repoPath, stage);
226
+
227
+ switch (stage) {
228
+ case 'PREPARE':
229
+ await executePrepareStage(llmManager, requirement, options);
230
+ break;
231
+
232
+ case 'REPRODUCE':
233
+ await executeReproduceStage(llmManager, requirement, options);
234
+ break;
235
+
236
+ case 'ACT':
237
+ await executeActStage(llmManager, requirement, options);
238
+ break;
239
+
240
+ case 'CLEAN UP':
241
+ await executeCleanupStage(llmManager, requirement, options);
242
+ break;
243
+
244
+ case 'VERIFY':
245
+ await executeVerifyStage(llmManager, requirement, options);
246
+ break;
247
+
248
+ default:
249
+ throw new Error(`Unknown stage: ${stage}`);
250
+ }
251
+
252
+ handleProviderSuccess(providerConfig.provider);
253
+ }
254
+
255
+ /**
256
+ * Execute PREPARE stage
257
+ */
258
+ async function executePrepareStage(llmManager, requirement, options) {
259
+ printInfo('๐Ÿ”ง Preparing environment...');
260
+
261
+ const prompt = `
262
+ You are in PREPARE stage for the requirement: "${requirement}"
263
+
264
+ Please:
265
+ 1. Analyze the current codebase structure
266
+ 2. Identify files that need to be modified
267
+ 3. Prepare a plan for implementation
268
+ 4. Check for any dependencies or prerequisites
269
+
270
+ Provide a detailed preparation plan.
271
+ `;
272
+
273
+ const response = await llmManager.generateResponse(prompt);
274
+ printSuccess('โœ… Preparation completed');
275
+ printDebug(`Preparation response: ${response.substring(0, 200)}...`);
276
+ }
277
+
278
+ /**
279
+ * Execute REPRODUCE stage
280
+ */
281
+ async function executeReproduceStage(llmManager, requirement, options) {
282
+ printInfo('๐Ÿ”„ Reproducing current state...');
283
+
284
+ const prompt = `
285
+ You are in REPRODUCE stage for the requirement: "${requirement}"
286
+
287
+ Please:
288
+ 1. Understand the current implementation
289
+ 2. Reproduce any existing behavior
290
+ 3. Identify what needs to be changed
291
+ 4. Document the current state
292
+
293
+ Provide a reproduction analysis.
294
+ `;
295
+
296
+ const response = await llmManager.generateResponse(prompt);
297
+ printSuccess('โœ… Reproduction completed');
298
+ printDebug(`Reproduction response: ${response.substring(0, 200)}...`);
299
+ }
300
+
301
+ /**
302
+ * Execute ACT stage
303
+ */
304
+ async function executeActStage(llmManager, requirement, options) {
305
+ printInfo('โšก Implementing changes...');
306
+
307
+ const prompt = `
308
+ You are in ACT stage for the requirement: "${requirement}"
309
+
310
+ Please:
311
+ 1. Implement the required changes
312
+ 2. Modify files as needed
313
+ 3. Ensure code quality and consistency
314
+ 4. Follow best practices
315
+
316
+ Provide the implementation details.
317
+ `;
318
+
319
+ const response = await llmManager.generateResponse(prompt);
320
+ printSuccess('โœ… Implementation completed');
321
+ printDebug(`Implementation response: ${response.substring(0, 200)}...`);
322
+ }
323
+
324
+ /**
325
+ * Execute CLEAN UP stage
326
+ */
327
+ async function executeCleanupStage(llmManager, requirement, options) {
328
+ printInfo('๐Ÿงน Cleaning up...');
329
+
330
+ const prompt = `
331
+ You are in CLEAN UP stage for the requirement: "${requirement}"
332
+
333
+ Please:
334
+ 1. Review and clean up the code
335
+ 2. Remove any unused code or comments
336
+ 3. Ensure proper formatting
337
+ 4. Update documentation
338
+
339
+ Provide cleanup details.
340
+ `;
341
+
342
+ const response = await llmManager.generateResponse(prompt);
343
+ printSuccess('โœ… Cleanup completed');
344
+ printDebug(`Cleanup response: ${response.substring(0, 200)}...`);
345
+ }
346
+
347
+ /**
348
+ * Execute VERIFY stage
349
+ */
350
+ async function executeVerifyStage(llmManager, requirement, options) {
351
+ printInfo('โœ… Verifying implementation...');
352
+
353
+ const prompt = `
354
+ You are in VERIFY stage for the requirement: "${requirement}"
355
+
356
+ Please:
357
+ 1. Verify the implementation meets requirements
358
+ 2. Test the changes
359
+ 3. Check for any issues or edge cases
360
+ 4. Confirm everything is working correctly
361
+
362
+ Provide verification results.
363
+ `;
364
+
365
+ const response = await llmManager.generateResponse(prompt);
366
+ printSuccess('โœ… Verification completed');
367
+ printDebug(`Verification response: ${response.substring(0, 200)}...`);
368
+ }
369
+
370
+ // Export the main function and utilities
371
+ module.exports = {
372
+ runAutoMode,
373
+ // Export utilities for backward compatibility
374
+ getTimestamp,
375
+ getLogTimestamp,
376
+ translateStage,
377
+ stripAnsi,
378
+ getVisualWidth,
379
+ padToVisualWidth,
380
+ isRateLimitMessage,
381
+ sleep,
382
+ safeLog,
383
+ updateRequirementsStatus,
384
+ getCurrentRequirement,
385
+ countTodoRequirements,
386
+ moveRequirementToVerify,
387
+ moveRequirementToRecycle,
388
+ ensureClineInstalled,
389
+ getAllAvailableProviders,
390
+ getProviderConfig,
391
+ handleProviderFailure,
392
+ handleProviderSuccess,
393
+ shouldSkipProvider,
394
+ getProviderHealth,
395
+ getAllProvidersHealth,
396
+ resetProviderHealth,
397
+ printStatusCard,
398
+ printWorkflowStages,
399
+ printProviderInfo,
400
+ printRateLimitWarning,
401
+ printError,
402
+ printSuccess,
403
+ printWarning,
404
+ printInfo,
405
+ printDebug,
406
+ createSpinner,
407
+ printFileChangeSummary,
408
+ printIterationSummary,
409
+ printTiming,
410
+ clearLine,
411
+ sharedProviderManager,
412
+ sharedHealthTracker
413
+ };