vibecodingmachine-cli 2026.2.20-438 → 2026.2.26-1739

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 (101) hide show
  1. package/bin/auth/auth-compliance.js +126 -0
  2. package/bin/cli-program.js +104 -0
  3. package/bin/cli-setup.js +52 -0
  4. package/bin/commands/agent-commands.js +310 -0
  5. package/bin/commands/auto-commands.js +70 -0
  6. package/bin/commands/command-aliases.js +118 -0
  7. package/bin/commands/repo-commands.js +39 -0
  8. package/bin/commands/rui-commands.js +152 -0
  9. package/bin/config/cli-config.js +394 -0
  10. package/bin/init/environment-setup.js +84 -0
  11. package/bin/update/update-checker.js +126 -0
  12. package/bin/vibecodingmachine-new.js +50 -0
  13. package/bin/vibecodingmachine.js +29 -663
  14. package/package.json +8 -2
  15. package/src/commands/agents/add.js +277 -0
  16. package/src/commands/agents/check.js +380 -0
  17. package/src/commands/agents/list.js +471 -0
  18. package/src/commands/agents/remove.js +351 -0
  19. package/src/commands/analyze-file-sizes.js +428 -0
  20. package/src/commands/auto-direct/code-processor.js +282 -0
  21. package/src/commands/auto-direct/file-scanner.js +266 -0
  22. package/src/commands/auto-direct/provider-config.js +178 -0
  23. package/src/commands/auto-direct/provider-manager.js +219 -0
  24. package/src/commands/auto-direct/requirement-manager.js +172 -0
  25. package/src/commands/auto-direct/status-display.js +91 -0
  26. package/src/commands/auto-direct/utils.js +106 -0
  27. package/src/commands/auto-direct.js +875 -488
  28. package/src/commands/auto-execution.js +342 -0
  29. package/src/commands/auto-provider-management.js +102 -0
  30. package/src/commands/auto-requirement-management.js +161 -0
  31. package/src/commands/auto-status-helpers.js +141 -0
  32. package/src/commands/auto.js +105 -5155
  33. package/src/commands/check-compliance.js +536 -0
  34. package/src/commands/continuous-scan.js +119 -0
  35. package/src/commands/ide.js +16 -4
  36. package/src/commands/refactor-file.js +486 -0
  37. package/src/commands/requirements.js +301 -2
  38. package/src/commands/timeout.js +290 -0
  39. package/src/trui/TruiInterface.js +108 -0
  40. package/src/trui/agents/AgentInterface.js +580 -0
  41. package/src/utils/antigravity-installer.js +60 -6
  42. package/src/utils/clarification-actions.js +290 -0
  43. package/src/utils/config.js +123 -2
  44. package/src/utils/first-run.js +5 -5
  45. package/src/utils/ide-handlers.js +212 -0
  46. package/src/utils/interactive/clarification-actions.js +348 -0
  47. package/src/utils/interactive/core-ui.js +265 -0
  48. package/src/utils/interactive/file-backup.js +237 -0
  49. package/src/utils/interactive/file-import-export.js +305 -0
  50. package/src/utils/interactive/file-operations.js +49 -0
  51. package/src/utils/interactive/file-validation.js +276 -0
  52. package/src/utils/interactive/interactive-prompts.js +480 -0
  53. package/src/utils/interactive/requirement-actions.js +127 -0
  54. package/src/utils/interactive/requirement-crud.js +356 -0
  55. package/src/utils/interactive/requirements-navigation.js +286 -0
  56. package/src/utils/interactive.js +390 -3459
  57. package/src/utils/provider-checker/agent-checker.js +250 -0
  58. package/src/utils/provider-checker/agent-runner.js +450 -0
  59. package/src/utils/provider-checker/cli-installer.js +123 -0
  60. package/src/utils/provider-checker/cli-utils.js +15 -0
  61. package/src/utils/provider-checker/format-utils.js +32 -0
  62. package/src/utils/provider-checker/ide-manager.js +72 -0
  63. package/src/utils/provider-checker/ide-utils.js +71 -0
  64. package/src/utils/provider-checker/node-detector.js +56 -0
  65. package/src/utils/provider-checker/node-utils.js +61 -0
  66. package/src/utils/provider-checker/process-spawn.js +22 -0
  67. package/src/utils/provider-checker/process-utils.js +37 -0
  68. package/src/utils/provider-checker/provider-validator.js +160 -0
  69. package/src/utils/provider-checker/quota-checker.js +54 -0
  70. package/src/utils/provider-checker/quota-detector.js +44 -0
  71. package/src/utils/provider-checker/requirements-manager.js +94 -0
  72. package/src/utils/provider-checker/test-requirements.js +95 -0
  73. package/src/utils/provider-checker/time-formatter.js +18 -0
  74. package/src/utils/provider-checker-new.js +14 -0
  75. package/src/utils/provider-checker.js +12 -407
  76. package/src/utils/provider-checkers/ide-manager.js +128 -0
  77. package/src/utils/provider-checkers/node-executable-finder.js +51 -0
  78. package/src/utils/provider-checkers/provider-checker-core.js +172 -0
  79. package/src/utils/provider-checkers/provider-checker-main.js +107 -0
  80. package/src/utils/provider-manager.js +60 -4
  81. package/src/utils/provider-registry.js +26 -3
  82. package/src/utils/provider-utils.js +173 -0
  83. package/src/utils/quota-detectors.js +212 -0
  84. package/src/utils/requirement-action-handlers.js +288 -0
  85. package/src/utils/requirement-actions/clarification-actions.js +229 -0
  86. package/src/utils/requirement-actions/confirmation-prompts.js +93 -0
  87. package/src/utils/requirement-actions/file-operations.js +92 -0
  88. package/src/utils/requirement-actions/helpers.js +40 -0
  89. package/src/utils/requirement-actions/requirement-operations.js +335 -0
  90. package/src/utils/requirement-actions.js +46 -856
  91. package/src/utils/requirement-file-operations.js +259 -0
  92. package/src/utils/requirement-helpers.js +128 -0
  93. package/src/utils/requirement-management.js +279 -0
  94. package/src/utils/requirement-navigation.js +146 -0
  95. package/src/utils/requirement-organization.js +271 -0
  96. package/src/utils/simple-trui.js +75 -1
  97. package/src/utils/trui-navigation.js +28 -2
  98. package/src/utils/trui-req-tree.js +196 -11
  99. package/src/utils/trui-specifications.js +31 -1
  100. package/src/utils/interactive-backup.js +0 -5664
  101. package/src/utils/trui-provider-manager.js +0 -182
@@ -0,0 +1,471 @@
1
+ /**
2
+ * CLI Command: List Agents
3
+ *
4
+ * Implements "app list agents" command for CLI interface.
5
+ * Follows constitutional requirements: <555 lines, test-first approach.
6
+ */
7
+
8
+ const AgentConfigManager = require('../../../../../packages/core/src/agents/config/AgentConfigManager');
9
+ const AgentLogger = require('../../../../../packages/core/src/agents/logging/AgentLogger');
10
+ const FileManager = require('../../../../../packages/core/src/agents/storage/FileManager');
11
+ const { AgentStatus } = require('../../../../../packages/core/src/agents/AgentStatus');
12
+ const AgentCommands = require('../../../../../packages/core/src/rui/commands/AgentCommands');
13
+ const AgentResponseFormatter = require('../../../../../packages/core/src/rui/commands/AgentResponseFormatter');
14
+
15
+ /**
16
+ * CLI list agents command implementation
17
+ */
18
+ class ListAgentsCommand {
19
+ /**
20
+ * Create command instance
21
+ * @param {Object} options - Command options
22
+ */
23
+ constructor(options = {}) {
24
+ this.configManager = options.configManager || new AgentConfigManager();
25
+ this.logger = options.logger || new AgentLogger({
26
+ fileManager: new FileManager()
27
+ });
28
+ this.fileManager = options.fileManager || new FileManager();
29
+
30
+ // Initialize RUI components
31
+ this.agentCommands = new AgentCommands({
32
+ configManager: this.configManager,
33
+ logger: this.logger,
34
+ fileManager: this.fileManager
35
+ });
36
+
37
+ this.responseFormatter = new AgentResponseFormatter({
38
+ defaultFormat: 'table',
39
+ includeTimestamp: true,
40
+ prettyPrint: options.pretty !== false
41
+ });
42
+ }
43
+
44
+ /**
45
+ * Execute list agents command using RUI pattern
46
+ * @param {Object} args - Command arguments
47
+ * @param {Object} options - Command options
48
+ * @returns {Promise<Object>} - Command result
49
+ */
50
+ async execute(args = [], options = {}) {
51
+ const {
52
+ includeDisabled = false,
53
+ includeStatus = true,
54
+ format = 'table',
55
+ sortBy = 'name',
56
+ filterStatus = null
57
+ } = this.parseArguments(args, options);
58
+
59
+ try {
60
+ // Load configuration
61
+ await this.configManager.load();
62
+
63
+ // Execute using RUI pattern
64
+ const ruiResult = await this.agentCommands.executeCommand('LIST', 'agents', {
65
+ includeDisabled,
66
+ includeStatus
67
+ });
68
+
69
+ // Format response for CLI
70
+ const formattedResponse = this.responseFormatter.format(ruiResult, 'cli', {
71
+ format,
72
+ sortBy,
73
+ filterStatus
74
+ });
75
+
76
+ // Apply additional filtering and sorting
77
+ let agents = formattedResponse.data?.agents || [];
78
+
79
+ // Apply status filter
80
+ if (filterStatus) {
81
+ agents = agents.filter(agent => agent.status === filterStatus);
82
+ }
83
+
84
+ // Apply sorting
85
+ agents = this.sortAgents(agents, sortBy);
86
+
87
+ // Output results
88
+ this.outputResults(agents, format, includeStatus);
89
+
90
+ return {
91
+ success: ruiResult.success,
92
+ agents,
93
+ formatted: formattedResponse,
94
+ count: agents.length,
95
+ message: `Listed ${agents.length} agents`
96
+ };
97
+ } catch (error) {
98
+ const errorMessage = `List agents failed: ${error.message}`;
99
+ console.error(errorMessage);
100
+
101
+ return {
102
+ success: false,
103
+ error: error.message,
104
+ message: errorMessage
105
+ };
106
+ }
107
+ }
108
+
109
+ /**
110
+ * Parse command line arguments
111
+ * @param {Array<string>} args - Command arguments
112
+ * @param {Object} options - Default options
113
+ * @returns {Object} - Parsed arguments
114
+ */
115
+ parseArguments(args, options = {}) {
116
+ const parsed = {
117
+ includeDisabled: options.includeDisabled || false,
118
+ includeStatus: options.includeStatus !== false,
119
+ format: options.format || 'table',
120
+ sortBy: options.sortBy || 'name',
121
+ filterStatus: options.filterStatus || null
122
+ };
123
+
124
+ // Parse command line arguments
125
+ for (let i = 0; i < args.length; i++) {
126
+ const arg = args[i];
127
+
128
+ switch (arg) {
129
+ case '--all':
130
+ case '-a':
131
+ parsed.includeDisabled = true;
132
+ break;
133
+
134
+ case '--no-status':
135
+ parsed.includeStatus = false;
136
+ break;
137
+
138
+ case '--format':
139
+ if (i + 1 < args.length) {
140
+ const format = args[i + 1];
141
+ if (['table', 'json', 'csv'].includes(format)) {
142
+ parsed.format = format;
143
+ i++; // Skip the next argument (format value)
144
+ }
145
+ }
146
+ break;
147
+
148
+ case '--sort':
149
+ if (i + 1 < args.length) {
150
+ const sortBy = args[i + 1];
151
+ if (['name', 'status', 'type', 'priority'].includes(sortBy)) {
152
+ parsed.sortBy = sortBy;
153
+ i++; // Skip the next argument (sort value)
154
+ }
155
+ }
156
+ break;
157
+
158
+ case '--status':
159
+ if (i + 1 < args.length) {
160
+ const status = args[i + 1];
161
+ if (Object.values(AgentStatus).includes(status)) {
162
+ parsed.filterStatus = status;
163
+ i++; // Skip the next argument (status value)
164
+ }
165
+ }
166
+ break;
167
+
168
+ default:
169
+ // Handle positional arguments (agent IDs)
170
+ if (!arg.startsWith('-')) {
171
+ // For list command, positional args are ignored
172
+ break;
173
+ }
174
+ break;
175
+ }
176
+ }
177
+
178
+ return parsed;
179
+ }
180
+
181
+ /**
182
+ * Filter agents by status
183
+ * @param {Array<Object>} agents - Agents to filter
184
+ * @param {string} status - Status to filter by
185
+ * @returns {Promise<Array>} - Filtered agents
186
+ */
187
+ async filterAgentsByStatus(agents, status) {
188
+ const filteredAgents = [];
189
+
190
+ for (const agent of agents) {
191
+ const agentStatus = await this.configManager.getAgentStatus(agent.id);
192
+ const currentStatus = agentStatus ? agentStatus.status : AgentStatus.NOT_INSTALLED;
193
+
194
+ if (currentStatus === status) {
195
+ filteredAgents.push(agent);
196
+ }
197
+ }
198
+
199
+ return filteredAgents;
200
+ }
201
+
202
+ /**
203
+ * Sort agents by specified criteria
204
+ * @param {Array<Object>} agents - Agents to sort
205
+ * @param {string} sortBy - Sort criteria
206
+ * @returns {Array<Object>} - Sorted agents
207
+ */
208
+ sortAgents(agents, sortBy) {
209
+ return agents.sort((a, b) => {
210
+ switch (sortBy) {
211
+ case 'name':
212
+ return a.name.localeCompare(b.name);
213
+ case 'status':
214
+ return (a.status || '').localeCompare(b.status || '');
215
+ case 'type':
216
+ return (a.type || '').localeCompare(b.type || '');
217
+ case 'priority':
218
+ return (a.priority || 999) - (b.priority || 999);
219
+ default:
220
+ return a.name.localeCompare(b.name);
221
+ }
222
+ });
223
+ }
224
+
225
+ /**
226
+ * Add status information to agents
227
+ * @param {Array<Object>} agents - Agents to enhance
228
+ * @returns {Promise<Array>} - Agents with status info
229
+ */
230
+ async addStatusInfo(agents) {
231
+ const agentsWithStatus = [];
232
+
233
+ for (const agent of agents) {
234
+ const status = await this.configManager.getAgentStatus(agent.id);
235
+
236
+ agentsWithStatus.push({
237
+ ...agent,
238
+ status: status ? status.status : AgentStatus.NOT_INSTALLED,
239
+ statusDescription: this.getStatusDescription(status ? status.status : AgentStatus.NOT_INSTALLED),
240
+ lastChecked: status ? status.lastChecked : null,
241
+ lastVerified: status ? status.lastVerified : null,
242
+ statusMessage: status ? status.message : '',
243
+ canInstall: agent.enabled && (!status || status.status === AgentStatus.NOT_INSTALLED),
244
+ canVerify: agent.enabled && status && [AgentStatus.INSTALLED, AgentStatus.VERIFIED].includes(status.status)
245
+ });
246
+ }
247
+
248
+ return agentsWithStatus;
249
+ }
250
+
251
+ /**
252
+ * Get status description
253
+ * @param {string} status - Status code
254
+ * @returns {string} - Human-readable description
255
+ */
256
+ getStatusDescription(status) {
257
+ const descriptions = {
258
+ [AgentStatus.NOT_INSTALLED]: 'Not installed',
259
+ [AgentStatus.INSTALLING]: 'Installing...',
260
+ [AgentStatus.INSTALLED]: 'Installed (not verified)',
261
+ [AgentStatus.VERIFYING]: 'Verifying...',
262
+ [AgentStatus.VERIFIED]: 'Verified and ready',
263
+ [AgentStatus.ERROR]: 'Error occurred',
264
+ [AgentStatus.RATE_LIMITED]: 'Rate limited',
265
+ [AgentStatus.DISABLED]: 'Disabled'
266
+ };
267
+
268
+ return descriptions[status] || 'Unknown';
269
+ }
270
+
271
+ /**
272
+ * Output results in specified format
273
+ * @param {Array} agents - Agents to output
274
+ * @param {string} format - Output format
275
+ * @param {boolean} includeStatus - Include status information
276
+ */
277
+ outputResults(agents, format, includeStatus) {
278
+ if (agents.length === 0) {
279
+ console.log('No agents found.');
280
+ return;
281
+ }
282
+
283
+ switch (format) {
284
+ case 'json':
285
+ this.outputJson(agents, includeStatus);
286
+ break;
287
+ case 'csv':
288
+ this.outputCsv(agents, includeStatus);
289
+ break;
290
+ case 'table':
291
+ default:
292
+ this.outputTable(agents, includeStatus);
293
+ break;
294
+ }
295
+ }
296
+
297
+ /**
298
+ * Output results as JSON
299
+ * @param {Array<Object>} agents - Agents to output
300
+ * @param {boolean} includeStatus - Include status information
301
+ */
302
+ outputJson(agents, includeStatus) {
303
+ const output = includeStatus ? agents : agents.map(agent => ({
304
+ id: agent.id,
305
+ name: agent.name,
306
+ description: agent.description,
307
+ enabled: agent.enabled,
308
+ type: agent.type
309
+ }));
310
+
311
+ console.log(JSON.stringify(output, null, 2));
312
+ }
313
+
314
+ /**
315
+ * Output results as CSV
316
+ * @param {Array<Object>} agents - Agents to output
317
+ * @param {boolean} includeStatus - Include status information
318
+ */
319
+ outputCsv(agents, includeStatus) {
320
+ const headers = includeStatus
321
+ ? ['ID', 'Name', 'Description', 'Enabled', 'Type', 'Status', 'Last Checked', 'Can Install', 'Can Verify']
322
+ : ['ID', 'Name', 'Description', 'Enabled', 'Type'];
323
+
324
+ console.log(headers.join(','));
325
+
326
+ for (const agent of agents) {
327
+ const row = includeStatus ? [
328
+ agent.id,
329
+ `"${agent.name}"`,
330
+ `"${agent.description}"`,
331
+ agent.enabled,
332
+ agent.type,
333
+ agent.statusDescription || 'Not installed',
334
+ agent.lastChecked || '',
335
+ agent.canInstall ? 'Yes' : 'No',
336
+ agent.canVerify ? 'Yes' : 'No'
337
+ ] : [
338
+ agent.id,
339
+ `"${agent.name}"`,
340
+ `"${agent.description}"`,
341
+ agent.enabled,
342
+ agent.type
343
+ ];
344
+
345
+ console.log(row.join(','));
346
+ }
347
+ }
348
+
349
+ /**
350
+ * Output results as table
351
+ * @param {Array<Object>} agents - Agents to output
352
+ * @param {boolean} includeStatus - Include status information
353
+ */
354
+ outputTable(agents, includeStatus) {
355
+ if (agents.length === 0) {
356
+ console.log('No agents found.');
357
+ return;
358
+ }
359
+
360
+ if (includeStatus) {
361
+ console.log('\n=== AGENTS ===');
362
+ console.log('ID'.padEnd(12) + ' ' + 'NAME'.padEnd(20) + ' ' + 'ENABLED'.padEnd(8) + ' ' + 'TYPE'.padEnd(12) + ' ' + 'STATUS'.padEnd(12) + ' ' + 'LAST CHECKED');
363
+ console.log('-'.repeat(80));
364
+
365
+ for (const agent of agents) {
366
+ const id = agent.id.padEnd(12);
367
+ const name = agent.name.padEnd(20);
368
+ const enabled = agent.enabled ? 'Yes'.padEnd(8) : 'No'.padEnd(8);
369
+ const type = (agent.type || '').padEnd(12);
370
+ const status = agent.statusDescription.padEnd(12);
371
+ const lastChecked = (agent.lastChecked || 'Never').padEnd(12);
372
+
373
+ console.log(`${id} ${name} ${enabled} ${type} ${status} ${lastChecked}`);
374
+ }
375
+ } else {
376
+ console.log('\n=== AGENTS ===');
377
+ console.log('ID'.padEnd(12) + ' ' + 'NAME'.padEnd(20) + ' ' + 'ENABLED'.padEnd(8) + ' ' + 'TYPE'.padEnd(12));
378
+ console.log('-'.repeat(54));
379
+
380
+ for (const agent of agents) {
381
+ const id = agent.id.padEnd(12);
382
+ const name = agent.name.padEnd(20);
383
+ const enabled = agent.enabled ? 'Yes'.padEnd(8) : 'No'.padEnd(8);
384
+ const type = (agent.type || '').padEnd(12);
385
+
386
+ console.log(`${id} ${name} ${enabled} ${type}`);
387
+ }
388
+ }
389
+ }
390
+
391
+ /**
392
+ * Show help information
393
+ */
394
+ showHelp() {
395
+ console.log('\n=== LIST AGENTS COMMAND ===');
396
+ console.log('Description: List all configured agents');
397
+ console.log('');
398
+ console.log('Usage: app list agents [options]');
399
+ console.log('');
400
+ console.log('Options:');
401
+ console.log(' --all, -a Include disabled agents');
402
+ console.log(' --no-status Exclude status information');
403
+ console.log(' --format <format> Output format: table, json, csv (default: table)');
404
+ console.log(' --sort <field> Sort by: name, status, type, priority (default: name)');
405
+ console.log(' --status <status> Filter by status (NOT_INSTALLED, INSTALLING, etc.)');
406
+ console.log('');
407
+ console.log('Examples:');
408
+ console.log(' app list agents');
409
+ console.log(' app list agents --all');
410
+ console.log(' app list agents --format json');
411
+ console.log(' app list agents --sort status');
412
+ console.log(' app list agents --status VERIFIED');
413
+ }
414
+
415
+ /**
416
+ * Get command information
417
+ * @returns {Object} - Command info
418
+ */
419
+ getCommandInfo() {
420
+ return {
421
+ name: 'list-agents',
422
+ description: 'List all configured agents',
423
+ usage: 'app list agents [options]',
424
+ examples: [
425
+ 'app list agents',
426
+ 'app list agents --all',
427
+ 'app list agents --format json',
428
+ 'app list agents --sort status',
429
+ 'app list agents --status VERIFIED'
430
+ ],
431
+ options: [
432
+ {
433
+ flag: '--all, -a',
434
+ description: 'Include disabled agents'
435
+ },
436
+ {
437
+ flag: '--no-status',
438
+ description: 'Exclude status information'
439
+ },
440
+ {
441
+ flag: '--format <format>',
442
+ description: 'Output format: table, json, csv (default: table)'
443
+ },
444
+ {
445
+ flag: '--sort <field>',
446
+ description: 'Sort by: name, status, type, priority (default: name)'
447
+ },
448
+ {
449
+ flag: '--status <status>',
450
+ description: 'Filter by status (NOT_INSTALLED, INSTALLING, etc.)'
451
+ }
452
+ ]
453
+ };
454
+ }
455
+ }
456
+
457
+ /**
458
+ * Execute list agents command
459
+ * @param {Array<string>} args - Command line arguments
460
+ * @param {Object} options - Command options
461
+ * @returns {Promise<Object>} - Command result
462
+ */
463
+ async function execute(args, options = {}) {
464
+ const command = new ListAgentsCommand(options);
465
+ return await command.execute(args, options);
466
+ }
467
+
468
+ module.exports = {
469
+ execute,
470
+ ListAgentsCommand
471
+ };