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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CLI Command: Refactor File
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Command-line interface for executing file refactoring operations.
|
|
5
5
|
* Provides safe, automated refactoring with rollback capabilities.
|
|
6
6
|
*/
|
|
@@ -11,11 +11,11 @@ const fs = require('fs');
|
|
|
11
11
|
const path = require('path');
|
|
12
12
|
|
|
13
13
|
// Import refactoring components
|
|
14
|
-
const { RefactoringExecutor } = require('
|
|
15
|
-
const { FileSplitter } = require('
|
|
16
|
-
const { BoundaryExtractor } = require('
|
|
17
|
-
const { CodeMover } = require('
|
|
18
|
-
const { RefactoringRollback } = require('
|
|
14
|
+
const { RefactoringExecutor } = require('vibecodingmachine-core/src/refactoring/refactoring-executor');
|
|
15
|
+
const { FileSplitter } = require('vibecodingmachine-core/src/refactoring/file-splitter');
|
|
16
|
+
const { BoundaryExtractor } = require('vibecodingmachine-core/src/refactoring/boundary-extractor');
|
|
17
|
+
const { CodeMover } = require('vibecodingmachine-core/src/refactoring/code-mover');
|
|
18
|
+
const { RefactoringRollback } = require('vibecodingmachine-core/src/refactoring/refactoring-rollback');
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Refactor file command
|
|
@@ -74,7 +74,7 @@ class RefactorFileCommand {
|
|
|
74
74
|
|
|
75
75
|
// Analyze file
|
|
76
76
|
const analysis = await this.analyzeFile(resolvedPath, options);
|
|
77
|
-
|
|
77
|
+
|
|
78
78
|
if (options.dryRun) {
|
|
79
79
|
return this.showDryRun(analysis, options);
|
|
80
80
|
}
|
|
@@ -95,7 +95,7 @@ class RefactorFileCommand {
|
|
|
95
95
|
|
|
96
96
|
// Execute refactoring
|
|
97
97
|
const result = await this.executeRefactoring(resolvedPath, analysis, options);
|
|
98
|
-
|
|
98
|
+
|
|
99
99
|
// Show results
|
|
100
100
|
this.showResults(result, options);
|
|
101
101
|
|
|
@@ -104,7 +104,7 @@ class RefactorFileCommand {
|
|
|
104
104
|
|
|
105
105
|
async analyzeFile(filePath, options) {
|
|
106
106
|
console.log(chalk.yellow('📊 Analyzing file...'));
|
|
107
|
-
|
|
107
|
+
|
|
108
108
|
const analysis = {
|
|
109
109
|
filePath,
|
|
110
110
|
lineCount: 0,
|
|
@@ -173,16 +173,16 @@ class RefactorFileCommand {
|
|
|
173
173
|
showDryRun(analysis, options) {
|
|
174
174
|
console.log(chalk.blue('\n🔍 Dry Run - Refactoring Preview'));
|
|
175
175
|
console.log(chalk.gray('─'.repeat(50)));
|
|
176
|
-
|
|
176
|
+
|
|
177
177
|
console.log(`📁 File: ${analysis.filePath}`);
|
|
178
178
|
console.log(`📏 Lines: ${analysis.lineCount}`);
|
|
179
179
|
console.log(`📦 Size: ${(analysis.size / 1024).toFixed(2)} KB`);
|
|
180
|
-
|
|
180
|
+
|
|
181
181
|
console.log(chalk.yellow('\n📋 Recommendations:'));
|
|
182
182
|
for (const rec of analysis.recommendations) {
|
|
183
|
-
const priorityColor = rec.priority === 'high' ? 'red' :
|
|
183
|
+
const priorityColor = rec.priority === 'high' ? 'red' :
|
|
184
184
|
rec.priority === 'medium' ? 'yellow' : 'green';
|
|
185
|
-
|
|
185
|
+
|
|
186
186
|
console.log(`${chalk[priorityColor]('●')} ${rec.type} (${rec.priority})`);
|
|
187
187
|
console.log(` ${rec.description}`);
|
|
188
188
|
if (rec.estimatedEffort) {
|
|
@@ -205,24 +205,24 @@ class RefactorFileCommand {
|
|
|
205
205
|
async confirmRefactoring(analysis, options) {
|
|
206
206
|
console.log(chalk.yellow('\n⚠️ Refactoring Confirmation'));
|
|
207
207
|
console.log(chalk.gray('─'.repeat(50)));
|
|
208
|
-
|
|
208
|
+
|
|
209
209
|
console.log(`File: ${analysis.filePath}`);
|
|
210
210
|
console.log(`Current lines: ${analysis.lineCount}`);
|
|
211
|
-
|
|
211
|
+
|
|
212
212
|
if (analysis.recommendations.length > 0) {
|
|
213
213
|
console.log('\nPlanned actions:');
|
|
214
214
|
for (const rec of analysis.recommendations) {
|
|
215
215
|
console.log(`- ${rec.description}`);
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
|
|
218
|
+
|
|
219
219
|
if (options.backup) {
|
|
220
220
|
console.log('\n✅ Backup will be created before refactoring');
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
// Simple confirmation for CLI
|
|
224
224
|
console.log('\nProceed with refactoring? (y/N)');
|
|
225
|
-
|
|
225
|
+
|
|
226
226
|
// In a real implementation, this would wait for user input
|
|
227
227
|
// For now, we'll assume confirmation in non-interactive mode
|
|
228
228
|
return true;
|
|
@@ -230,7 +230,7 @@ class RefactorFileCommand {
|
|
|
230
230
|
|
|
231
231
|
async createRollbackPoint(filePath) {
|
|
232
232
|
console.log(chalk.yellow('📦 Creating rollback point...'));
|
|
233
|
-
|
|
233
|
+
|
|
234
234
|
try {
|
|
235
235
|
const operationId = this.generateOperationId();
|
|
236
236
|
const operation = {
|
|
@@ -239,10 +239,10 @@ class RefactorFileCommand {
|
|
|
239
239
|
affectedFiles: [filePath],
|
|
240
240
|
estimatedDuration: 10
|
|
241
241
|
};
|
|
242
|
-
|
|
242
|
+
|
|
243
243
|
await this.rollback.createRollbackPoint(operationId, operation);
|
|
244
244
|
console.log(chalk.green('✅ Rollback point created'));
|
|
245
|
-
|
|
245
|
+
|
|
246
246
|
} catch (error) {
|
|
247
247
|
console.error(chalk.red('❌ Failed to create rollback point:'), error.message);
|
|
248
248
|
throw error;
|
|
@@ -251,36 +251,36 @@ class RefactorFileCommand {
|
|
|
251
251
|
|
|
252
252
|
async executeRefactoring(filePath, analysis, options) {
|
|
253
253
|
console.log(chalk.yellow('🔨 Executing refactoring...'));
|
|
254
|
-
|
|
254
|
+
|
|
255
255
|
const startTime = Date.now();
|
|
256
|
-
|
|
256
|
+
|
|
257
257
|
try {
|
|
258
258
|
// Create refactoring plan
|
|
259
259
|
const plan = this.createRefactoringPlan(filePath, analysis, options);
|
|
260
|
-
|
|
260
|
+
|
|
261
261
|
// Validate plan
|
|
262
262
|
const validation = this.executor.validatePlan(plan);
|
|
263
263
|
if (!validation.isValid) {
|
|
264
264
|
throw new Error(`Invalid refactoring plan: ${validation.issues.join(', ')}`);
|
|
265
265
|
}
|
|
266
|
-
|
|
266
|
+
|
|
267
267
|
// Execute plan
|
|
268
268
|
const result = await this.executor.executePlan(plan);
|
|
269
|
-
|
|
269
|
+
|
|
270
270
|
const duration = (Date.now() - startTime) / 1000;
|
|
271
|
-
|
|
271
|
+
|
|
272
272
|
if (result.success) {
|
|
273
273
|
console.log(chalk.green(`✅ Refactoring completed successfully in ${duration.toFixed(2)}s`));
|
|
274
274
|
} else {
|
|
275
275
|
console.log(chalk.red(`❌ Refactoring failed after ${duration.toFixed(2)}s`));
|
|
276
|
-
|
|
276
|
+
|
|
277
277
|
if (result.rollbackPerformed) {
|
|
278
278
|
console.log(chalk.yellow('🔄 Changes were rolled back'));
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
-
|
|
281
|
+
|
|
282
282
|
return result;
|
|
283
|
-
|
|
283
|
+
|
|
284
284
|
} catch (error) {
|
|
285
285
|
console.error(chalk.red('❌ Refactoring execution failed:'), error.message);
|
|
286
286
|
throw error;
|
|
@@ -288,43 +288,43 @@ class RefactorFileCommand {
|
|
|
288
288
|
}
|
|
289
289
|
|
|
290
290
|
createRefactoringPlan(filePath, analysis, options) {
|
|
291
|
-
const { RefactoringPlan } = require('
|
|
292
|
-
|
|
291
|
+
const { RefactoringPlan } = require('vibecodingmachine-core/src/refactoring/refactoring-executor');
|
|
292
|
+
|
|
293
293
|
const plan = new RefactoringPlan(`refactor-${path.basename(filePath)}`);
|
|
294
|
-
|
|
294
|
+
|
|
295
295
|
// Add operations based on analysis
|
|
296
296
|
if (analysis.needsRefactoring) {
|
|
297
|
-
const { RefactoringOperation } = require('
|
|
298
|
-
|
|
297
|
+
const { RefactoringOperation } = require('vibecodingmachine-core/src/refactoring/refactoring-executor');
|
|
298
|
+
|
|
299
299
|
const splitOp = new RefactoringOperation('split_file', filePath, {
|
|
300
300
|
estimatedDuration: 5,
|
|
301
301
|
priority: 'high',
|
|
302
302
|
maxModuleSize: parseInt(options.maxLines),
|
|
303
303
|
minModuleSize: parseInt(options.minLines)
|
|
304
304
|
});
|
|
305
|
-
|
|
305
|
+
|
|
306
306
|
plan.addOperation(splitOp);
|
|
307
307
|
}
|
|
308
|
-
|
|
308
|
+
|
|
309
309
|
return plan;
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
showResults(result, options) {
|
|
313
313
|
console.log(chalk.blue('\n📊 Refactoring Results'));
|
|
314
314
|
console.log(chalk.gray('─'.repeat(50)));
|
|
315
|
-
|
|
315
|
+
|
|
316
316
|
console.log(`Status: ${result.success ? chalk.green('SUCCESS') : chalk.red('FAILED')}`);
|
|
317
317
|
console.log(`Operations executed: ${result.executedOperations}`);
|
|
318
318
|
console.log(`Operations failed: ${result.failedOperations}`);
|
|
319
319
|
console.log(`Duration: ${result.duration.toFixed(2)}s`);
|
|
320
|
-
|
|
320
|
+
|
|
321
321
|
if (result.executedOperations > 0) {
|
|
322
322
|
console.log(chalk.green(`\n✅ ${result.executedOperations} operations completed successfully`));
|
|
323
323
|
}
|
|
324
|
-
|
|
324
|
+
|
|
325
325
|
if (result.failedOperations > 0) {
|
|
326
326
|
console.log(chalk.red(`\n❌ ${result.failedOperations} operations failed`));
|
|
327
|
-
|
|
327
|
+
|
|
328
328
|
if (result.errors.length > 0) {
|
|
329
329
|
console.log(chalk.red('\nErrors:'));
|
|
330
330
|
for (const error of result.errors.slice(0, 3)) {
|
|
@@ -332,12 +332,12 @@ class RefactorFileCommand {
|
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
|
-
|
|
335
|
+
|
|
336
336
|
if (!options.noValidation && result.success) {
|
|
337
337
|
console.log(chalk.blue('\n🧪 Validation:'));
|
|
338
338
|
console.log('✅ Post-refactoring validation passed');
|
|
339
339
|
}
|
|
340
|
-
|
|
340
|
+
|
|
341
341
|
if (options.backup && result.success) {
|
|
342
342
|
console.log(chalk.blue('\n💾 Backup:'));
|
|
343
343
|
console.log('✅ Rollback point available for recovery');
|
|
@@ -346,14 +346,14 @@ class RefactorFileCommand {
|
|
|
346
346
|
|
|
347
347
|
async handleRollback(rollbackId, options) {
|
|
348
348
|
console.log(chalk.blue('🔄 Executing rollback...'));
|
|
349
|
-
|
|
349
|
+
|
|
350
350
|
try {
|
|
351
351
|
const result = await this.rollback.executeRollback(rollbackId, 'User requested rollback');
|
|
352
|
-
|
|
352
|
+
|
|
353
353
|
console.log(chalk.green(`✅ Rollback ${result.success ? 'completed' : 'completed with issues'}`));
|
|
354
354
|
console.log(`Files restored: ${result.metadata.totalFilesRestored}`);
|
|
355
355
|
console.log(`Duration: ${result.duration.toFixed(2)}s`);
|
|
356
|
-
|
|
356
|
+
|
|
357
357
|
if (result.operations.length > 0) {
|
|
358
358
|
console.log(chalk.yellow('\nRestored files:'));
|
|
359
359
|
for (const op of result.operations) {
|
|
@@ -364,9 +364,9 @@ class RefactorFileCommand {
|
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
|
-
|
|
367
|
+
|
|
368
368
|
return result;
|
|
369
|
-
|
|
369
|
+
|
|
370
370
|
} catch (error) {
|
|
371
371
|
console.error(chalk.red('❌ Rollback failed:'), error.message);
|
|
372
372
|
throw error;
|
|
@@ -382,15 +382,15 @@ class RefactorFileCommand {
|
|
|
382
382
|
*/
|
|
383
383
|
async listRollbackPoints() {
|
|
384
384
|
const status = this.rollback.getRollbackStatus();
|
|
385
|
-
|
|
385
|
+
|
|
386
386
|
console.log(chalk.blue('📋 Available Rollback Points'));
|
|
387
387
|
console.log(chalk.gray('─'.repeat(50)));
|
|
388
|
-
|
|
388
|
+
|
|
389
389
|
if (status.rollbackHistory.length === 0) {
|
|
390
390
|
console.log(chalk.yellow('No rollback points available'));
|
|
391
391
|
return;
|
|
392
392
|
}
|
|
393
|
-
|
|
393
|
+
|
|
394
394
|
for (const [opId, ops] of status.rollbackHistory) {
|
|
395
395
|
const lastOp = ops[ops.length - 1];
|
|
396
396
|
console.log(`${chalk.cyan(opId)}`);
|
|
@@ -406,12 +406,12 @@ class RefactorFileCommand {
|
|
|
406
406
|
*/
|
|
407
407
|
showRollbackStatus() {
|
|
408
408
|
const status = this.rollback.getRollbackStatus();
|
|
409
|
-
|
|
409
|
+
|
|
410
410
|
console.log(chalk.blue('📊 Rollback Status'));
|
|
411
411
|
console.log(chalk.gray('─'.repeat(50)));
|
|
412
|
-
|
|
412
|
+
|
|
413
413
|
console.log(`Rollback in progress: ${status.isRollingBack ? 'Yes' : 'No'}`);
|
|
414
|
-
|
|
414
|
+
|
|
415
415
|
if (status.currentRollback) {
|
|
416
416
|
const current = status.currentRollback;
|
|
417
417
|
console.log(`Current rollback: ${current.rollbackId}`);
|
|
@@ -419,7 +419,7 @@ class RefactorFileCommand {
|
|
|
419
419
|
console.log(`Files affected: ${current.metadata.affectedFiles}`);
|
|
420
420
|
console.log(`Files restored: ${current.metadata.totalFilesRestored}`);
|
|
421
421
|
}
|
|
422
|
-
|
|
422
|
+
|
|
423
423
|
console.log(`Total rollback points: ${status.rollbackHistory.length}`);
|
|
424
424
|
}
|
|
425
425
|
}
|
|
@@ -429,7 +429,7 @@ class RefactorFileCommand {
|
|
|
429
429
|
*/
|
|
430
430
|
function registerCommand(program) {
|
|
431
431
|
const command = new RefactorFileCommand();
|
|
432
|
-
|
|
432
|
+
|
|
433
433
|
// Add subcommands
|
|
434
434
|
const rollbackCmd = new Command('rollback')
|
|
435
435
|
.description('Rollback a refactoring operation')
|
|
@@ -444,7 +444,7 @@ function registerCommand(program) {
|
|
|
444
444
|
process.exit(1);
|
|
445
445
|
}
|
|
446
446
|
});
|
|
447
|
-
|
|
447
|
+
|
|
448
448
|
const listCmd = new Command('list')
|
|
449
449
|
.description('List available rollback points')
|
|
450
450
|
.action(async () => {
|
|
@@ -456,7 +456,7 @@ function registerCommand(program) {
|
|
|
456
456
|
process.exit(1);
|
|
457
457
|
}
|
|
458
458
|
});
|
|
459
|
-
|
|
459
|
+
|
|
460
460
|
const statusCmd = new Command('status')
|
|
461
461
|
.description('Show rollback status')
|
|
462
462
|
.action(async () => {
|
|
@@ -468,11 +468,11 @@ function registerCommand(program) {
|
|
|
468
468
|
process.exit(1);
|
|
469
469
|
}
|
|
470
470
|
});
|
|
471
|
-
|
|
471
|
+
|
|
472
472
|
command.addCommand(rollbackCmd);
|
|
473
473
|
command.addCommand(listCmd);
|
|
474
474
|
command.addCommand(statusCmd);
|
|
475
|
-
|
|
475
|
+
|
|
476
476
|
program.addCommand(command.command);
|
|
477
477
|
return command;
|
|
478
478
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Requirements Commands
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Core requirements management commands
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -26,7 +26,7 @@ const {
|
|
|
26
26
|
async function list(options) {
|
|
27
27
|
try {
|
|
28
28
|
const { repoPath, reqPath } = await getReqPathOrExit();
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
if (!await fs.pathExists(reqPath)) {
|
|
31
31
|
console.log(chalk.yellow('No requirements file found. Use "app req add" to create one.'));
|
|
32
32
|
return;
|
|
@@ -41,7 +41,7 @@ async function list(options) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
console.log(chalk.blue('\nRequirements:'));
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
if (options.verbose) {
|
|
46
46
|
requirements.forEach((req, index) => {
|
|
47
47
|
const isCurrent = current && current.id === req.id;
|
|
@@ -121,7 +121,7 @@ async function add(name, pkg, description) {
|
|
|
121
121
|
async function current() {
|
|
122
122
|
try {
|
|
123
123
|
const { reqPath } = await getReqPathOrExit();
|
|
124
|
-
|
|
124
|
+
|
|
125
125
|
if (!await fs.pathExists(reqPath)) {
|
|
126
126
|
console.log(chalk.yellow('No requirements file found.'));
|
|
127
127
|
return;
|
|
@@ -137,11 +137,11 @@ async function current() {
|
|
|
137
137
|
|
|
138
138
|
console.log(chalk.blue('\nCurrent Requirement:'));
|
|
139
139
|
console.log(` ${formatRequirement(current, true)}`);
|
|
140
|
-
|
|
140
|
+
|
|
141
141
|
if (current.description) {
|
|
142
142
|
console.log(chalk.gray(`\nDescription: ${current.description}`));
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
|
|
145
145
|
if (current.package) {
|
|
146
146
|
console.log(chalk.cyan(`Package: ${current.package}`));
|
|
147
147
|
}
|
|
@@ -156,7 +156,7 @@ async function current() {
|
|
|
156
156
|
async function next() {
|
|
157
157
|
try {
|
|
158
158
|
const { reqPath } = await getReqPathOrExit();
|
|
159
|
-
|
|
159
|
+
|
|
160
160
|
if (!await fs.pathExists(reqPath)) {
|
|
161
161
|
console.log(chalk.yellow('No requirements file found.'));
|
|
162
162
|
return;
|
|
@@ -201,7 +201,7 @@ async function next() {
|
|
|
201
201
|
async function edit() {
|
|
202
202
|
try {
|
|
203
203
|
const { reqPath } = await getReqPathOrExit();
|
|
204
|
-
|
|
204
|
+
|
|
205
205
|
if (!await fs.pathExists(reqPath)) {
|
|
206
206
|
console.log(chalk.yellow('No requirements file found. Creating new one...'));
|
|
207
207
|
await ensureRequirementsFile(reqPath);
|
|
@@ -220,29 +220,29 @@ async function edit() {
|
|
|
220
220
|
async function watch() {
|
|
221
221
|
try {
|
|
222
222
|
const { reqPath } = await getReqPathOrExit();
|
|
223
|
-
|
|
223
|
+
|
|
224
224
|
if (!await fs.pathExists(reqPath)) {
|
|
225
225
|
console.log(chalk.yellow('No requirements file found.'));
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
console.log(chalk.gray('Watching:'), chalk.cyan(reqPath));
|
|
230
|
-
|
|
230
|
+
|
|
231
231
|
const watcher = chokidar.watch(reqPath);
|
|
232
|
-
|
|
232
|
+
|
|
233
233
|
watcher.on('change', async () => {
|
|
234
234
|
console.log(chalk.blue('\nRequirements file changed. Reloading...'));
|
|
235
235
|
const data = await loadRequirements(reqPath);
|
|
236
236
|
const { requirements, current } = data;
|
|
237
|
-
|
|
237
|
+
|
|
238
238
|
console.log(chalk.green(`Found ${requirements.length} requirements`));
|
|
239
239
|
if (current) {
|
|
240
240
|
console.log(chalk.cyan(`Current: ${current.title}`));
|
|
241
241
|
}
|
|
242
242
|
});
|
|
243
|
-
|
|
243
|
+
|
|
244
244
|
console.log(chalk.green('Watching for changes. Press Ctrl+C to stop.'));
|
|
245
|
-
|
|
245
|
+
|
|
246
246
|
} catch (error) {
|
|
247
247
|
console.error(chalk.red('Error watching requirements:'), error.message);
|
|
248
248
|
}
|
|
@@ -254,7 +254,7 @@ async function watch() {
|
|
|
254
254
|
async function rename(oldTitle, newTitle, description) {
|
|
255
255
|
try {
|
|
256
256
|
const { reqPath } = await getReqPathOrExit();
|
|
257
|
-
|
|
257
|
+
|
|
258
258
|
if (!await fs.pathExists(reqPath)) {
|
|
259
259
|
console.log(chalk.yellow('No requirements file found.'));
|
|
260
260
|
return;
|
|
@@ -278,7 +278,7 @@ async function rename(oldTitle, newTitle, description) {
|
|
|
278
278
|
// Update requirement
|
|
279
279
|
requirement.title = newTitle;
|
|
280
280
|
requirement.updated = new Date().toISOString();
|
|
281
|
-
|
|
281
|
+
|
|
282
282
|
if (description) {
|
|
283
283
|
requirement.description = description;
|
|
284
284
|
}
|
|
@@ -310,7 +310,7 @@ async function working() {
|
|
|
310
310
|
async function numberAll() {
|
|
311
311
|
try {
|
|
312
312
|
const { reqPath, repoPath } = await getReqPathOrExit();
|
|
313
|
-
|
|
313
|
+
|
|
314
314
|
if (!await fs.pathExists(reqPath)) {
|
|
315
315
|
console.log(chalk.yellow('No requirements file found.'));
|
|
316
316
|
return;
|