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,351 @@
1
+ /**
2
+ * CLI Command: Remove Agent
3
+ *
4
+ * Implements "app remove agent" command for CLI interface.
5
+ * Follows constitutional requirements: <555 lines, test-first approach.
6
+ */
7
+
8
+ const AgentAdditionService = require('../../../core/src/agents/AgentAdditionService');
9
+ const AgentConfigManager = require('../../../core/src/agents/config/AgentConfigManager');
10
+ const AgentLogger = require('../../../core/src/agents/logging/AgentLogger');
11
+ const FileManager = require('../../../core/src/agents/storage/FileManager');
12
+ const AgentCommands = require('../../../core/src/rui/commands/AgentCommands');
13
+ const AgentResponseFormatter = require('../../../core/src/rui/commands/AgentResponseFormatter');
14
+
15
+ /**
16
+ * CLI remove agent command implementation
17
+ */
18
+ class RemoveAgentCommand {
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 addition service (handles both add and remove)
31
+ this.additionService = new AgentAdditionService({
32
+ configManager: this.configManager,
33
+ logger: this.logger
34
+ });
35
+
36
+ // Initialize RUI components
37
+ this.agentCommands = new AgentCommands({
38
+ configManager: this.configManager,
39
+ logger: this.logger,
40
+ fileManager: this.fileManager
41
+ });
42
+
43
+ this.responseFormatter = new AgentResponseFormatter({
44
+ defaultFormat: 'json',
45
+ includeTimestamp: true,
46
+ prettyPrint: options.pretty !== false
47
+ });
48
+ }
49
+
50
+ /**
51
+ * Execute remove agent command
52
+ * @param {Object} args - Command arguments
53
+ * @param {Object} options - Command options
54
+ * @returns {Object} - Command result
55
+ */
56
+ async execute(args = {}, options = {}) {
57
+ try {
58
+ const { agentId } = args;
59
+ const { force = false, format = 'json' } = options;
60
+
61
+ this.logger.info(`Executing remove agent command: ${agentId || 'unknown'}`);
62
+
63
+ // Validate agent ID
64
+ if (!agentId) {
65
+ const error = 'Agent ID is required';
66
+ this.logger.error(error);
67
+ return this.formatResponse({
68
+ success: false,
69
+ error
70
+ }, format);
71
+ }
72
+
73
+ // Check if agent exists
74
+ const agentExists = await this.additionService.getAgent(agentId);
75
+ if (!agentExists.success) {
76
+ const error = `Agent ${agentId} not found`;
77
+ this.logger.error(error);
78
+ return this.formatResponse({
79
+ success: false,
80
+ error
81
+ }, format);
82
+ }
83
+
84
+ // Check if agent is enabled (unless force is specified)
85
+ if (!force && agentExists.agent.enabled) {
86
+ const error = `Agent ${agentId} is currently enabled. Use --force to remove enabled agents.`;
87
+ this.logger.error(error);
88
+ return this.formatResponse({
89
+ success: false,
90
+ error,
91
+ agentId,
92
+ enabled: true,
93
+ suggestion: 'Use --force flag to remove enabled agents, or disable the agent first'
94
+ }, format);
95
+ }
96
+
97
+ // Remove agent
98
+ const result = await this.additionService.removeAgent(agentId);
99
+
100
+ // Log result
101
+ if (result.success) {
102
+ this.logger.info(`Successfully removed agent: ${result.agentId}`);
103
+ } else {
104
+ this.logger.error(`Failed to remove agent: ${result.error}`);
105
+ }
106
+
107
+ return this.formatResponse(result, format);
108
+
109
+ } catch (error) {
110
+ this.logger.error(`Remove agent command failed: ${error.message}`);
111
+ return this.formatResponse({
112
+ success: false,
113
+ error: error.message
114
+ }, options.format);
115
+ }
116
+ }
117
+
118
+ /**
119
+ * Remove multiple agents
120
+ * @param {string[]} agentIds - Array of agent IDs to remove
121
+ * @param {Object} options - Command options
122
+ * @returns {Object} - Command result
123
+ */
124
+ async removeMultiple(agentIds, options = {}) {
125
+ try {
126
+ this.logger.info(`Removing multiple agents: ${agentIds.join(', ')}`);
127
+
128
+ const results = [];
129
+ const summary = {
130
+ total: agentIds.length,
131
+ successful: 0,
132
+ failed: 0,
133
+ skipped: 0
134
+ };
135
+
136
+ for (const agentId of agentIds) {
137
+ const result = await this.execute({ agentId }, options);
138
+ results.push({ agentId, result });
139
+
140
+ if (result.success) {
141
+ summary.successful++;
142
+ } else if (result.error && result.error.includes('not found')) {
143
+ summary.skipped++;
144
+ } else {
145
+ summary.failed++;
146
+ }
147
+ }
148
+
149
+ return this.formatResponse({
150
+ success: summary.successful > 0,
151
+ results,
152
+ summary,
153
+ message: `Removed ${summary.successful} of ${summary.total} agents`
154
+ }, options.format);
155
+
156
+ } catch (error) {
157
+ this.logger.error(`Remove multiple agents failed: ${error.message}`);
158
+ return this.formatResponse({
159
+ success: false,
160
+ error: error.message
161
+ }, options.format);
162
+ }
163
+ }
164
+
165
+ /**
166
+ * Remove agents from file
167
+ * @param {string} filePath - Path to file containing agent IDs
168
+ * @param {Object} options - Command options
169
+ * @returns {Object} - Command result
170
+ */
171
+ async removeFromFile(filePath, options = {}) {
172
+ try {
173
+ this.logger.info(`Removing agents from file: ${filePath}`);
174
+
175
+ // Read file content
176
+ const fileContent = await this.fileManager.readFile(filePath);
177
+ const agentIds = JSON.parse(fileContent);
178
+
179
+ // Validate agent IDs array
180
+ if (!Array.isArray(agentIds)) {
181
+ throw new Error('File must contain an array of agent IDs');
182
+ }
183
+
184
+ // Remove multiple agents
185
+ return this.removeMultiple(agentIds, options);
186
+
187
+ } catch (error) {
188
+ this.logger.error(`Failed to remove agents from file: ${error.message}`);
189
+ return this.formatResponse({
190
+ success: false,
191
+ error: `Failed to read or parse file: ${error.message}`
192
+ }, options.format);
193
+ }
194
+ }
195
+
196
+ /**
197
+ * List removable agents
198
+ * @param {Object} options - Command options
199
+ * @returns {Object} - List of agents that can be removed
200
+ */
201
+ async listRemovable(options = {}) {
202
+ try {
203
+ this.logger.info('Listing removable agents');
204
+
205
+ const agentsResult = await this.additionService.getAgents();
206
+
207
+ if (!agentsResult.success) {
208
+ return this.formatResponse({
209
+ success: false,
210
+ error: agentsResult.error
211
+ }, options.format);
212
+ }
213
+
214
+ const removableAgents = agentsResult.agents.filter(agent => {
215
+ // All agents are removable, but enabled ones require --force
216
+ return {
217
+ id: agent.id,
218
+ name: agent.name,
219
+ enabled: agent.enabled,
220
+ status: agent.status,
221
+ requiresForce: agent.enabled
222
+ };
223
+ });
224
+
225
+ return this.formatResponse({
226
+ success: true,
227
+ agents: removableAgents,
228
+ message: `Found ${removableAgents.length} agents that can be removed`
229
+ }, options.format);
230
+
231
+ } catch (error) {
232
+ this.logger.error(`Failed to list removable agents: ${error.message}`);
233
+ return this.formatResponse({
234
+ success: false,
235
+ error: error.message
236
+ }, options.format);
237
+ }
238
+ }
239
+
240
+ /**
241
+ * Confirm removal before executing
242
+ * @param {string} agentId - Agent ID to remove
243
+ * @param {Object} options - Command options
244
+ * @returns {Object} - Confirmation result
245
+ */
246
+ async confirmRemoval(agentId, options = {}) {
247
+ try {
248
+ this.logger.info(`Confirming removal for agent: ${agentId}`);
249
+
250
+ // Get agent details
251
+ const agentResult = await this.additionService.getAgent(agentId);
252
+
253
+ if (!agentResult.success) {
254
+ return this.formatResponse({
255
+ success: false,
256
+ error: agentResult.error
257
+ }, options.format);
258
+ }
259
+
260
+ const agent = agentResult.agent;
261
+
262
+ return this.formatResponse({
263
+ success: true,
264
+ agent,
265
+ confirmation: {
266
+ message: `Are you sure you want to remove agent '${agent.name}' (${agent.id})?`,
267
+ details: {
268
+ id: agent.id,
269
+ name: agent.name,
270
+ status: agent.status,
271
+ enabled: agent.enabled,
272
+ lastChecked: agent.lastChecked,
273
+ lastVerified: agent.lastVerified
274
+ },
275
+ requiresForce: agent.enabled
276
+ }
277
+ }, options.format);
278
+
279
+ } catch (error) {
280
+ this.logger.error(`Failed to confirm removal: ${error.message}`);
281
+ return this.formatResponse({
282
+ success: false,
283
+ error: error.message
284
+ }, options.format);
285
+ }
286
+ }
287
+
288
+ /**
289
+ * Format response according to specified format
290
+ * @param {Object} data - Response data
291
+ * @param {string} format - Response format (json, table, etc.)
292
+ * @returns {Object} - Formatted response
293
+ */
294
+ formatResponse(data, format = 'json') {
295
+ return this.responseFormatter.format(data, format);
296
+ }
297
+
298
+ /**
299
+ * Get command help
300
+ * @returns {Object} - Help information
301
+ */
302
+ getHelp() {
303
+ return {
304
+ name: 'remove-agent',
305
+ description: 'Remove an agent from the system',
306
+ usage: [
307
+ 'app remove agent <agent-id>',
308
+ 'app remove agent <agent-id> --force',
309
+ 'app remove agent --multiple <agent-id1,agent-id2>',
310
+ 'app remove agent --file <path>',
311
+ 'app remove agent --list-removable',
312
+ 'app remove agent --confirm <agent-id>'
313
+ ],
314
+ options: {
315
+ '<agent-id>': 'ID of the agent to remove',
316
+ '--force': 'Remove even if agent is enabled',
317
+ '--multiple': 'Remove multiple agents (comma-separated IDs)',
318
+ '--file': 'Remove agents listed in file (JSON array)',
319
+ '--list-removable': 'List all agents that can be removed',
320
+ '--confirm': 'Show confirmation dialog before removal',
321
+ '--format': 'Output format (json, table)',
322
+ '--pretty': 'Pretty print JSON output'
323
+ },
324
+ examples: [
325
+ {
326
+ command: 'app remove agent claude-code',
327
+ description: 'Remove disabled agent claude-code'
328
+ },
329
+ {
330
+ command: 'app remove agent github-copilot --force',
331
+ description: 'Force remove enabled agent github-copilot'
332
+ },
333
+ {
334
+ command: 'app remove agent --multiple agent1,agent2,agent3',
335
+ description: 'Remove multiple agents'
336
+ },
337
+ {
338
+ command: 'app remove agent --confirm claude-code',
339
+ description: 'Show confirmation before removing agent'
340
+ }
341
+ ],
342
+ warnings: [
343
+ 'Removing an agent will delete its configuration and history',
344
+ 'Enabled agents require --force flag to remove',
345
+ 'This action cannot be undone'
346
+ ]
347
+ };
348
+ }
349
+ }
350
+
351
+ module.exports = RemoveAgentCommand;