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,335 @@
1
+ const fs = require('fs-extra');
2
+ const inquirer = require('inquirer');
3
+ const chalk = require('chalk');
4
+ const { getRequirementsPath } = require('vibecodingmachine-core');
5
+ const { confirmAction } = require('./confirmation-prompts');
6
+ const { getSectionTitle, getRequirementList } = require('./helpers');
7
+
8
+ /**
9
+ * Show requirement actions menu
10
+ */
11
+ async function showRequirementActions(req, sectionKey, tree) {
12
+ const actions = [
13
+ { label: '✏️ Rename/Edit', value: 'rename' },
14
+ { label: '👍 Thumbs up (promote to Verified)', value: 'thumbs-up' },
15
+ { label: '👎 Thumbs down (demote to TODO)', value: 'thumbs-down' },
16
+ { label: '⬆️ Move up', value: 'move-up' },
17
+ { label: '⬇️ Move down', value: 'move-down' },
18
+ { label: '🗑️ Delete', value: 'delete' },
19
+ { label: '❌ Cancel', value: 'cancel' }
20
+ ];
21
+
22
+ // Add clarification action for TODO items
23
+ if (sectionKey === 'todo') {
24
+ actions.splice(2, 0, { label: '❓ Need clarification', value: 'clarification' });
25
+ }
26
+
27
+ const { action } = await inquirer.prompt([
28
+ {
29
+ type: 'list',
30
+ name: 'action',
31
+ message: `Select action for "${req.title}":`,
32
+ choices: actions
33
+ }
34
+ ]);
35
+
36
+ return action;
37
+ }
38
+
39
+ /**
40
+ * Helper to perform action on requirement
41
+ */
42
+ async function performRequirementAction(action, req, sectionKey, tree) {
43
+ const reqList = getRequirementList(tree, sectionKey);
44
+ const sectionTitle = getSectionTitle(sectionKey);
45
+ const reqIndex = reqList.findIndex(r => r.title === req.title);
46
+
47
+ if (reqIndex === -1) {
48
+ console.log(chalk.red('❌ Requirement not found'));
49
+ return;
50
+ }
51
+
52
+ switch (action) {
53
+ case 'rename':
54
+ await renameRequirement(req, sectionKey, tree);
55
+ break;
56
+ case 'thumbs-up':
57
+ await promoteRequirement(req, sectionKey, tree);
58
+ break;
59
+ case 'thumbs-down':
60
+ await demoteRequirement(req.title, sectionKey, tree);
61
+ break;
62
+ case 'move-up':
63
+ await moveRequirementUp(req, sectionKey, tree);
64
+ break;
65
+ case 'move-down':
66
+ await moveRequirementDown(req, sectionKey, tree);
67
+ break;
68
+ case 'delete':
69
+ await deleteRequirement(req, sectionKey, tree);
70
+ break;
71
+ case 'clarification':
72
+ await moveToClarification(req, sectionKey, tree);
73
+ break;
74
+ default:
75
+ console.log(chalk.gray('Action cancelled'));
76
+ }
77
+ }
78
+
79
+ /**
80
+ * Helper to rename requirement (title and description)
81
+ */
82
+ async function renameRequirement(req, sectionKey, tree) {
83
+ const reqPath = await getRequirementsPath();
84
+
85
+ console.log(chalk.cyan('\n✏️ Rename/Edit Requirement\n'));
86
+ console.log(chalk.gray(`Current title: ${req.title}`));
87
+ console.log(chalk.gray(`Current description: ${req.description || 'No description'}\n`));
88
+
89
+ const { newTitle, newDescription } = await inquirer.prompt([
90
+ {
91
+ type: 'input',
92
+ name: 'newTitle',
93
+ message: 'Enter new title:',
94
+ default: req.title
95
+ },
96
+ {
97
+ type: 'input',
98
+ name: 'newDescription',
99
+ message: 'Enter new description:',
100
+ default: req.description || ''
101
+ }
102
+ ]);
103
+
104
+ if (!newTitle.trim()) {
105
+ console.log(chalk.red('❌ Title cannot be empty'));
106
+ return;
107
+ }
108
+
109
+ const content = await fs.readFile(reqPath, 'utf8');
110
+ const lines = content.split('\n');
111
+
112
+ // Find and update the requirement
113
+ const reqList = getRequirementList(tree, sectionKey);
114
+ const reqIndex = reqList.findIndex(r => r.title === req.title);
115
+
116
+ if (reqIndex !== -1) {
117
+ reqList[reqIndex].title = newTitle.trim();
118
+ reqList[reqIndex].description = newDescription.trim();
119
+ }
120
+
121
+ // Write back to file
122
+ await fs.writeFile(reqPath, content);
123
+
124
+ console.log(chalk.green('✅ Requirement updated successfully!'));
125
+ }
126
+
127
+ /**
128
+ * Helper to move requirement to recycled section (used to delete)
129
+ */
130
+ async function deleteRequirement(req, sectionKey, tree) {
131
+ const reqList = getRequirementList(tree, sectionKey);
132
+ const sectionTitle = getSectionTitle(sectionKey);
133
+ const reqIndex = reqList.findIndex(r => r.title === req.title);
134
+
135
+ if (reqIndex === -1) return;
136
+
137
+ const confirmed = await confirmAction(`Delete "${req.title}" from ${sectionTitle}? This cannot be undone. (r/y/N)`);
138
+ if (!confirmed) return;
139
+
140
+ const reqPath = await getRequirementsPath();
141
+ const content = await fs.readFile(reqPath, 'utf8');
142
+
143
+ // Remove from current section
144
+ const deletedReq = reqList.splice(reqIndex, 1)[0];
145
+
146
+ // Add to recycled section
147
+ tree.recycledReqs.push({
148
+ ...deletedReq,
149
+ deletedAt: new Date().toISOString(),
150
+ fromSection: sectionKey
151
+ });
152
+
153
+ // Write back to file
154
+ await fs.writeFile(reqPath, content);
155
+
156
+ console.log(chalk.green(`✅ Deleted "${req.title}" from ${sectionTitle}`));
157
+ }
158
+
159
+ /**
160
+ * Helper to permanently delete requirement from file (used for recycled items)
161
+ */
162
+ async function permanentlyDeleteRequirement(req, sectionKey, tree) {
163
+ const reqList = getRequirementList(tree, sectionKey);
164
+ const reqIndex = reqList.findIndex(r => r.title === req.title);
165
+
166
+ if (reqIndex === -1) return;
167
+
168
+ const confirmed = await confirmAction(`Permanently delete "${req.title}"? This cannot be undone. (r/y/N)`);
169
+ if (!confirmed) return;
170
+
171
+ // Remove from recycled section
172
+ reqList.splice(reqIndex, 1);
173
+
174
+ console.log(chalk.green(`✅ Permanently deleted "${req.title}"`));
175
+ }
176
+
177
+ /**
178
+ * Helper to move requirement down with 'j' key
179
+ */
180
+ async function moveRequirementDown(req, sectionKey, tree) {
181
+ const reqList = getRequirementList(tree, sectionKey);
182
+ const sectionTitle = getSectionTitle(sectionKey);
183
+ const reqIndex = reqList.findIndex(r => r.title === req.title);
184
+
185
+ if (reqIndex === -1 || reqIndex === reqList.length - 1) return;
186
+
187
+ // Swap with next item
188
+ [reqList[reqIndex], reqList[reqIndex + 1]] = [reqList[reqIndex + 1], reqList[reqIndex]];
189
+
190
+ const reqPath = await getRequirementsPath();
191
+ await saveRequirementsOrder(reqPath, sectionTitle, reqList);
192
+
193
+ console.log(chalk.green(`✅ Moved "${req.title}" down`));
194
+ }
195
+
196
+ /**
197
+ * Helper to move requirement up with 'k' key
198
+ */
199
+ async function moveRequirementUp(req, sectionKey, tree) {
200
+ const reqList = getRequirementList(tree, sectionKey);
201
+ const sectionTitle = getSectionTitle(sectionKey);
202
+ const reqIndex = reqList.findIndex(r => r.title === req.title);
203
+
204
+ if (reqIndex === -1 || reqIndex === 0) return;
205
+
206
+ // Swap with previous item
207
+ [reqList[reqIndex], reqList[reqIndex - 1]] = [reqList[reqIndex - 1], reqList[reqIndex]];
208
+
209
+ const reqPath = await getRequirementsPath();
210
+ await saveRequirementsOrder(reqPath, sectionTitle, reqList);
211
+
212
+ console.log(chalk.green(`✅ Moved "${req.title}" up`));
213
+ }
214
+
215
+ /**
216
+ * Helper to promote requirement to next list (TODO -> TO VERIFY -> VERIFIED)
217
+ */
218
+ async function promoteRequirement(req, sectionKey, tree) {
219
+ const { promoteTodoToVerify, promoteToVerified } = require('vibecodingmachine-core');
220
+ const reqPath = await getRequirementsPath();
221
+
222
+ if (sectionKey === 'todo') {
223
+ await promoteTodoToVerify(req.title, reqPath);
224
+ console.log(chalk.green(`✅ Promoted "${req.title}" to verification`));
225
+ } else if (sectionKey === 'verify') {
226
+ await promoteToVerified(req.title, reqPath);
227
+ console.log(chalk.green(`✅ Promoted "${req.title}" to verified`));
228
+ }
229
+ }
230
+
231
+ /**
232
+ * Helper to demote requirement to previous list (VERIFIED -> TODO, TO VERIFY -> TODO)
233
+ */
234
+ async function demoteRequirement(reqTitle, sectionKey, tree) {
235
+ const { demoteVerifyToTodo, demoteFromVerifiedToTodo } = require('vibecodingmachine-core');
236
+ const reqPath = await getRequirementsPath();
237
+
238
+ if (sectionKey === 'verify') {
239
+ await demoteVerifyToTodo(reqTitle, reqPath);
240
+ console.log(chalk.green(`✅ Demoted "${reqTitle}" back to TODO`));
241
+ } else if (sectionKey === 'verified') {
242
+ await demoteFromVerifiedToTodo(reqTitle, reqPath);
243
+ console.log(chalk.green(`✅ Demoted "${reqTitle}" back to TODO`));
244
+ }
245
+ }
246
+
247
+ /**
248
+ * Helper to move requirement to clarification section
249
+ */
250
+ async function moveToClarification(req, sectionKey, tree) {
251
+ const reqPath = await getRequirementsPath();
252
+ const content = await fs.readFile(reqPath, 'utf8');
253
+
254
+ // Find and remove from current section
255
+ const reqList = getRequirementList(tree, sectionKey);
256
+ const reqIndex = reqList.findIndex(r => r.title === req.title);
257
+
258
+ if (reqIndex === -1) return;
259
+
260
+ const clarificationReq = reqList.splice(reqIndex, 1)[0];
261
+
262
+ // Add to clarification section
263
+ tree.clarificationReqs.push({
264
+ ...clarificationReq,
265
+ status: 'NEED CLARIFICATION',
266
+ responses: []
267
+ });
268
+
269
+ // Write back to file
270
+ await fs.writeFile(reqPath, content);
271
+
272
+ console.log(chalk.green(`✅ Moved "${req.title}" to clarification`));
273
+ }
274
+
275
+ /**
276
+ * Helper to save reordered requirements back to file
277
+ */
278
+ async function saveRequirementsOrder(reqPath, sectionTitle, requirements) {
279
+ const content = await fs.readFile(reqPath, 'utf8');
280
+ const lines = content.split('\n');
281
+
282
+ // Find the section start and end
283
+ let sectionStart = -1;
284
+ let sectionEnd = -1;
285
+
286
+ for (let i = 0; i < lines.length; i++) {
287
+ if (lines[i].includes(sectionTitle)) {
288
+ sectionStart = i;
289
+ // Find the end of this section (next section or end of file)
290
+ for (let j = i + 1; j < lines.length; j++) {
291
+ if (lines[j].startsWith('## ') && j > i + 1) {
292
+ sectionEnd = j - 1;
293
+ break;
294
+ }
295
+ sectionEnd = lines.length - 1;
296
+ }
297
+ break;
298
+ }
299
+ }
300
+
301
+ if (sectionStart === -1) return;
302
+
303
+ // Rebuild the section with reordered requirements
304
+ const newSection = [lines[sectionStart]]; // Keep the section header
305
+
306
+ // Add reordered requirements
307
+ requirements.forEach(req => {
308
+ newSection.push(`- ${req.title}`);
309
+ if (req.description) {
310
+ newSection.push(` ${req.description}`);
311
+ }
312
+ });
313
+
314
+ // Replace the section in the file
315
+ const beforeSection = lines.slice(0, sectionStart);
316
+ const afterSection = lines.slice(sectionEnd + 1);
317
+
318
+ const newContent = [...beforeSection, ...newSection, ...afterSection];
319
+
320
+ await fs.writeFile(reqPath, newContent.join('\n'));
321
+ }
322
+
323
+ module.exports = {
324
+ showRequirementActions,
325
+ performRequirementAction,
326
+ renameRequirement,
327
+ deleteRequirement,
328
+ permanentlyDeleteRequirement,
329
+ moveRequirementDown,
330
+ moveRequirementUp,
331
+ promoteRequirement,
332
+ demoteRequirement,
333
+ moveToClarification,
334
+ saveRequirementsOrder,
335
+ };