vibecodingmachine-cli 2026.2.26-1739 → 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 +5 -1
  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,278 @@
1
+ /**
2
+ * TRUI Requirement File Operations
3
+ *
4
+ * Extracted from trui-req-actions.js to reduce file size
5
+ */
6
+
7
+ const fs = require('fs-extra');
8
+ const {
9
+ promoteToVerified,
10
+ demoteFromVerifiedToTodo,
11
+ promoteTodoToVerify,
12
+ demoteVerifyToTodo,
13
+ } = require('vibecodingmachine-core');
14
+
15
+ /**
16
+ * Move a requirement up or down within its section
17
+ */
18
+ async function moveRequirement(reqPath, title, sectionKey, direction) {
19
+ const content = await fs.readFile(reqPath, 'utf8');
20
+ const lines = content.split('\n');
21
+
22
+ // Find section boundaries
23
+ const sectionHeadings = {
24
+ todo: /requirements not yet completed/i,
25
+ verify: /to verify|verified by ai/i,
26
+ verified: /verified\b/i,
27
+ recycled: /recycled/i,
28
+ };
29
+ const pattern = sectionHeadings[sectionKey];
30
+
31
+ let sectionStart = -1;
32
+ let sectionEnd = lines.length;
33
+
34
+ for (let i = 0; i < lines.length; i++) {
35
+ const line = lines[i].trim();
36
+ if (sectionStart === -1 && line.startsWith('##') && pattern && pattern.test(line)) {
37
+ sectionStart = i;
38
+ } else if (sectionStart !== -1 && line.startsWith('## ') && i > sectionStart) {
39
+ sectionEnd = i;
40
+ break;
41
+ }
42
+ }
43
+
44
+ if (sectionStart === -1) return false;
45
+
46
+ // Find all requirement blocks (### headers) within the section
47
+ const reqBlocks = [];
48
+ let currentBlock = null;
49
+ for (let i = sectionStart + 1; i < sectionEnd; i++) {
50
+ const line = lines[i];
51
+ if (line.trim().startsWith('### ')) {
52
+ if (currentBlock) {
53
+ reqBlocks.push(currentBlock);
54
+ }
55
+ currentBlock = { start: i, title: line.trim().substring(4).trim(), lines: [line] };
56
+ } else if (currentBlock) {
57
+ currentBlock.lines.push(line);
58
+ }
59
+ }
60
+ if (currentBlock) {
61
+ reqBlocks.push(currentBlock);
62
+ }
63
+
64
+ // Find the target requirement
65
+ const targetIndex = reqBlocks.findIndex(block =>
66
+ block.title === title || block.title.includes(title)
67
+ );
68
+ if (targetIndex === -1) return false;
69
+
70
+ // Calculate new position
71
+ let newIndex = targetIndex;
72
+ if (direction === 'up' && targetIndex > 0) {
73
+ newIndex = targetIndex - 1;
74
+ } else if (direction === 'down' && targetIndex < reqBlocks.length - 1) {
75
+ newIndex = targetIndex + 1;
76
+ } else {
77
+ return false; // Can't move further
78
+ }
79
+
80
+ // Swap blocks
81
+ const temp = reqBlocks[targetIndex];
82
+ reqBlocks[targetIndex] = reqBlocks[newIndex];
83
+ reqBlocks[newIndex] = temp;
84
+
85
+ // Rebuild the file content
86
+ const newLines = [
87
+ ...lines.slice(0, sectionStart + 1),
88
+ ...reqBlocks.flatMap(block => block.lines),
89
+ ...lines.slice(sectionEnd)
90
+ ];
91
+
92
+ await fs.writeFile(reqPath, newLines.join('\n'), 'utf8');
93
+ return true;
94
+ }
95
+
96
+ /**
97
+ * Rename a requirement
98
+ */
99
+ async function renameRequirement(reqPath, oldTitle, sectionKey) {
100
+ const inquirer = require('inquirer');
101
+ const chalk = require('chalk');
102
+
103
+ const { newTitle } = await inquirer.prompt([{
104
+ type: 'input',
105
+ name: 'newTitle',
106
+ message: 'New title:',
107
+ default: oldTitle,
108
+ validate: input => input.trim().length > 0 || 'Title cannot be empty'
109
+ }]);
110
+
111
+ if (newTitle === oldTitle) return false;
112
+
113
+ const content = await fs.readFile(reqPath, 'utf8');
114
+ const lines = content.split('\n');
115
+
116
+ // Find and replace the requirement title
117
+ let found = false;
118
+ for (let i = 0; i < lines.length; i++) {
119
+ const line = lines[i];
120
+ if (line.trim().startsWith('### ') && line.includes(oldTitle)) {
121
+ lines[i] = line.replace(oldTitle, newTitle);
122
+ found = true;
123
+ break;
124
+ }
125
+ }
126
+
127
+ if (!found) {
128
+ console.log(chalk.red('Requirement not found'));
129
+ return false;
130
+ }
131
+
132
+ await fs.writeFile(reqPath, lines.join('\n'), 'utf8');
133
+ console.log(chalk.green(`✓ Renamed to "${newTitle}"`));
134
+ return true;
135
+ }
136
+
137
+ /**
138
+ * Delete a requirement after confirmation
139
+ */
140
+ async function deleteRequirement(reqPath, title) {
141
+ const chalk = require('chalk');
142
+ const inquirer = require('inquirer');
143
+ const readline = require('readline');
144
+
145
+ const confirmed = await _confirmKeypress(chalk.red(`Delete "${title}"?`));
146
+ if (!confirmed) return false;
147
+
148
+ const content = await fs.readFile(reqPath, 'utf8');
149
+ const lines = content.split('\n');
150
+
151
+ // Find and remove the requirement block
152
+ let startIdx = -1;
153
+ let endIdx = -1;
154
+
155
+ for (let i = 0; i < lines.length; i++) {
156
+ const line = lines[i];
157
+ if (startIdx === -1 && line.trim().startsWith('### ') && line.includes(title)) {
158
+ startIdx = i;
159
+ } else if (startIdx !== -1 && line.trim().startsWith('### ') && i > startIdx) {
160
+ endIdx = i;
161
+ break;
162
+ }
163
+ }
164
+
165
+ if (startIdx === -1) return false;
166
+ if (endIdx === -1) endIdx = lines.length;
167
+
168
+ // Remove the requirement block
169
+ const newLines = [
170
+ ...lines.slice(0, startIdx),
171
+ ...lines.slice(endIdx)
172
+ ];
173
+
174
+ await fs.writeFile(reqPath, newLines.join('\n'), 'utf8');
175
+ console.log(chalk.green(`✓ Deleted "${title}"`));
176
+ return true;
177
+ }
178
+
179
+ /**
180
+ * Single-keypress confirm: Y/Enter/- = yes, N/Esc = no. No Enter required.
181
+ */
182
+ async function _confirmKeypress(message) {
183
+ return new Promise(resolve => {
184
+ const chalk = require('chalk');
185
+ const readline = require('readline');
186
+
187
+ process.stdout.write(message + ' (Y/n/-)\n\n');
188
+ readline.emitKeypressEvents(process.stdin);
189
+ if (process.stdin.isTTY && process.stdin.setRawMode) {
190
+ process.stdin.setRawMode(true);
191
+ }
192
+ process.stdin.resume();
193
+
194
+ const cleanup = () => {
195
+ process.stdin.removeListener('keypress', onKey);
196
+ if (process.stdin.isTTY && process.stdin.setRawMode) {
197
+ process.stdin.setRawMode(false);
198
+ }
199
+ process.stdin.pause();
200
+ };
201
+
202
+ const onKey = (str, key) => {
203
+ if (!key) return;
204
+ if (key.ctrl && key.name === 'c') { cleanup(); process.exit(0); }
205
+ const ch = (str || '').toLowerCase();
206
+ if (ch === 'y' || key.name === 'return' || ch === '-') {
207
+ cleanup();
208
+ process.stdout.write(chalk.green('y') + '\n');
209
+ resolve(true);
210
+ } else if (ch === 'n' || key.name === 'escape') {
211
+ cleanup();
212
+ process.stdout.write(chalk.gray('n') + '\n');
213
+ resolve(false);
214
+ }
215
+ };
216
+
217
+ process.stdin.on('keypress', onKey);
218
+ });
219
+ }
220
+
221
+ /**
222
+ * Handle requirement promotion/demotion
223
+ */
224
+ async function handleRequirementPromotion(reqPath, req, sectionKey, action) {
225
+ const chalk = require('chalk');
226
+ const inquirer = require('inquirer');
227
+
228
+ try {
229
+ switch (action) {
230
+ case 'promote':
231
+ if (sectionKey === 'todo') {
232
+ console.log(chalk.gray('\nEquivalent: vcm req:promote "' + req.title + '"'));
233
+ await promoteTodoToVerify(reqPath, req.title);
234
+ console.log(chalk.green('✓ Moved to TO VERIFY'));
235
+ } else if (sectionKey === 'verify') {
236
+ console.log(chalk.gray('\nEquivalent: vcm req:verify "' + req.title + '"'));
237
+ await promoteToVerified(reqPath, req.title);
238
+ console.log(chalk.green('✓ Moved to VERIFIED'));
239
+ }
240
+ break;
241
+
242
+ case 'demote':
243
+ if (sectionKey === 'verify') {
244
+ console.log(chalk.gray('\nEquivalent: vcm req:demote "' + req.title + '"'));
245
+ await demoteVerifyToTodo(reqPath, req.title);
246
+ console.log(chalk.green('✓ Moved back to TODO'));
247
+ } else if (sectionKey === 'verified') {
248
+ console.log(chalk.gray('\nEquivalent: vcm req:demote "' + req.title + '"'));
249
+ await demoteFromVerifiedToTodo(reqPath, req.title);
250
+ console.log(chalk.green('✓ Moved back to TODO'));
251
+ }
252
+ break;
253
+ }
254
+
255
+ await _pause();
256
+ return true;
257
+ } catch (error) {
258
+ console.log(chalk.red('Error: ' + error.message));
259
+ await _pause();
260
+ return false;
261
+ }
262
+ }
263
+
264
+ /**
265
+ * Pause for user input
266
+ */
267
+ async function _pause() {
268
+ const inquirer = require('inquirer');
269
+ await inquirer.prompt([{ type: 'input', name: 'c', message: 'Press Enter to continue...' }]);
270
+ }
271
+
272
+ module.exports = {
273
+ moveRequirement,
274
+ renameRequirement,
275
+ deleteRequirement,
276
+ handleRequirementPromotion,
277
+ _pause
278
+ };