vibecodingmachine-cli 2026.3.10-1812 → 2026.3.14-1528

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 (36) hide show
  1. package/README.md +85 -85
  2. package/bin/vibecodingmachine.js +3 -0
  3. package/package.json +4 -3
  4. package/scripts/postinstall.js +161 -161
  5. package/src/commands/auth.js +100 -100
  6. package/src/commands/auto-direct.js +16 -5
  7. package/src/commands/auto-execution.js +25 -0
  8. package/src/commands/auto-requirement-management.js +8 -8
  9. package/src/commands/auto-status-helpers.js +5 -3
  10. package/src/commands/computers.js +318 -318
  11. package/src/commands/feature.js +123 -123
  12. package/src/commands/locale.js +72 -72
  13. package/src/commands/repo.js +163 -163
  14. package/src/commands/setup.js +93 -93
  15. package/src/commands/sync.js +287 -287
  16. package/src/index.js +5 -5
  17. package/src/utils/agent-selector.js +50 -50
  18. package/src/utils/asset-cleanup.js +60 -60
  19. package/src/utils/auto-mode-ansi-ui.js +237 -237
  20. package/src/utils/auto-mode-simple-ui.js +141 -141
  21. package/src/utils/copy-with-progress.js +167 -167
  22. package/src/utils/download-with-progress.js +84 -84
  23. package/src/utils/keyboard-handler.js +153 -153
  24. package/src/utils/kiro-installer.js +178 -178
  25. package/src/utils/logger.js +4 -4
  26. package/src/utils/persistent-header.js +114 -114
  27. package/src/utils/prompt-helper.js +63 -63
  28. package/src/utils/provider-checker/agent-checker.js +25 -1
  29. package/src/utils/provider-checker/agent-runner.js +115 -37
  30. package/src/utils/provider-checker/agents-manager.js +210 -0
  31. package/src/utils/provider-checker/provider-validator.js +5 -49
  32. package/src/utils/provider-checker/requirements-manager.js +86 -65
  33. package/src/utils/provider-checker/test-requirements.js +25 -17
  34. package/src/utils/status-card.js +121 -121
  35. package/src/utils/stdout-interceptor.js +127 -127
  36. package/src/utils/user-tracking.js +299 -299
@@ -1,237 +1,237 @@
1
- const chalk = require('chalk');
2
- const ansiEscapes = require('ansi-escapes');
3
-
4
- /**
5
- * ANSI-based UI for Auto Mode
6
- * Simple, reliable, no module system issues
7
- */
8
- class AutoModeANSIUI {
9
- constructor(options = {}) {
10
- this.menuContent = options.menuContent || '';
11
- this.onExit = options.onExit;
12
- this.requirement = 'Loading...';
13
- this.step = 'PREPARE';
14
- this.chatCount = 0;
15
- this.maxChats = null;
16
- this.progress = 0;
17
- this.outputLines = [];
18
- this.maxOutputLines = 15;
19
-
20
- // Hide cursor for cleaner output
21
- process.stdout.write(ansiEscapes.cursorHide);
22
-
23
- // Handle exit - just use SIGINT, don't try to capture keys
24
- // (stdin might be used by child process like Aider)
25
- this.handleExit = () => {
26
- this.destroy();
27
- if (this.onExit) {
28
- this.onExit();
29
- }
30
- process.exit(0);
31
- };
32
-
33
- process.on('SIGINT', this.handleExit);
34
- process.on('SIGTERM', this.handleExit);
35
-
36
- // Initial render
37
- this.render();
38
- }
39
-
40
- updateStatus(status) {
41
- if (status.requirement !== undefined) this.requirement = status.requirement;
42
- if (status.step !== undefined) this.step = status.step;
43
- if (status.chatCount !== undefined) this.chatCount = status.chatCount;
44
- if (status.maxChats !== undefined) this.maxChats = status.maxChats;
45
- if (status.progress !== undefined) this.progress = status.progress;
46
- this.render();
47
- }
48
-
49
- appendOutput(line) {
50
- // Safety: truncate very long lines to prevent memory issues
51
- const maxLineLength = 500;
52
- const safeLine = line.length > maxLineLength ? line.substring(0, maxLineLength) + '...' : line;
53
-
54
- this.outputLines.push(safeLine);
55
- // Keep only last N lines
56
- if (this.outputLines.length > this.maxOutputLines) {
57
- this.outputLines = this.outputLines.slice(-this.maxOutputLines);
58
- }
59
- this.render();
60
- }
61
-
62
- clearOutput() {
63
- this.outputLines = [];
64
- this.render();
65
- }
66
-
67
- render() {
68
- // Clear screen and move cursor to top
69
- process.stdout.write(ansiEscapes.clearScreen);
70
- process.stdout.write(ansiEscapes.cursorTo(0, 0));
71
-
72
- let output = '';
73
-
74
- // Header box
75
- output += this.drawBox(this.menuContent, { color: 'cyan', style: 'round' });
76
- output += '\n';
77
-
78
- // Status card
79
- const statusContent = this.buildStatusContent();
80
- output += this.drawBox(statusContent, { color: 'magenta', style: 'round', title: ' Auto Mode Status ' });
81
- output += '\n';
82
-
83
- // Output log
84
- const outputContent = this.buildOutputContent();
85
- output += this.drawBox(outputContent, { color: 'green', style: 'single', title: ' Aider Output ' });
86
-
87
- process.stdout.write(output);
88
- }
89
-
90
- buildStatusContent() {
91
- const stepColors = {
92
- 'PREPARE': chalk.cyan,
93
- 'ACT': chalk.yellow,
94
- 'CLEAN UP': chalk.magenta,
95
- 'VERIFY': chalk.blue,
96
- 'DONE': chalk.green,
97
- 'UNKNOWN': chalk.gray
98
- };
99
-
100
- const stepColor = stepColors[this.step] || chalk.gray;
101
-
102
- // Progress bar
103
- const barWidth = 40;
104
- const filledWidth = Math.round((this.progress / 100) * barWidth);
105
- const emptyWidth = barWidth - filledWidth;
106
- const progressBar = chalk.green('█'.repeat(filledWidth)) + chalk.gray('░'.repeat(emptyWidth));
107
-
108
- // Chat counter
109
- const chatDisplay = this.maxChats
110
- ? `Chat ${this.chatCount}/${this.maxChats}`
111
- : `Chat ${this.chatCount} (unlimited)`;
112
-
113
- // Truncate requirement if too long
114
- const displayReq = this.requirement.length > 70
115
- ? this.requirement.substring(0, 67) + '...'
116
- : this.requirement;
117
-
118
- return `
119
- ${chalk.bold('📋 Current Requirement')}
120
-
121
- ${displayReq}
122
-
123
- ${chalk.bold('🚦 Status:')} ${stepColor.bold(this.step)}
124
-
125
- ${progressBar} ${this.progress}%
126
-
127
- ${chalk.gray(chatDisplay)}
128
- `.trim();
129
- }
130
-
131
- buildOutputContent() {
132
- if (this.outputLines.length === 0) {
133
- return chalk.gray('No output yet...');
134
- }
135
- return this.outputLines.join('\n');
136
- }
137
-
138
- drawBox(content, options = {}) {
139
- const { color = 'white', style = 'single', title = '' } = options;
140
- const colorFn = chalk[color] || chalk.white;
141
-
142
- // Box drawing characters
143
- const chars = {
144
- single: {
145
- topLeft: '┌',
146
- topRight: '┐',
147
- bottomLeft: '└',
148
- bottomRight: '┘',
149
- horizontal: '─',
150
- vertical: '│'
151
- },
152
- round: {
153
- topLeft: '╭',
154
- topRight: '╮',
155
- bottomLeft: '╰',
156
- bottomRight: '╯',
157
- horizontal: '─',
158
- vertical: '│'
159
- },
160
- double: {
161
- topLeft: '╔',
162
- topRight: '╗',
163
- bottomLeft: '╚',
164
- bottomRight: '╝',
165
- horizontal: '═',
166
- vertical: '║'
167
- }
168
- };
169
-
170
- const boxChars = chars[style] || chars.single;
171
- const lines = content.split('\n');
172
-
173
- // Use fixed width to avoid any width calculation issues
174
- const terminalWidth = process.stdout.columns || 80;
175
- const width = Math.min(terminalWidth - 4, 60);
176
-
177
- // Top border
178
- let box = colorFn(boxChars.topLeft);
179
- if (title) {
180
- const titleLen = title.length;
181
- const leftPad = Math.floor((width - titleLen - 2) / 2);
182
- box += colorFn(boxChars.horizontal.repeat(leftPad));
183
- box += colorFn(title);
184
- box += colorFn(boxChars.horizontal.repeat(width - leftPad - titleLen));
185
- } else {
186
- box += colorFn(boxChars.horizontal.repeat(width));
187
- }
188
- box += colorFn(boxChars.topRight) + '\n';
189
-
190
- // Content lines - use fixed padding to avoid width calculations
191
- lines.forEach(line => {
192
- // Truncate long lines
193
- const maxLen = width - 4;
194
- const displayLine = line.length > maxLen ? line.substring(0, maxLen - 3) + '...' : line;
195
- const padding = Math.max(0, width - displayLine.length - 2);
196
- box += colorFn(boxChars.vertical) + ' ' + displayLine + ' '.repeat(padding) + ' ' + colorFn(boxChars.vertical) + '\n';
197
- });
198
-
199
- // Bottom border
200
- box += colorFn(boxChars.bottomLeft) + colorFn(boxChars.horizontal.repeat(width)) + colorFn(boxChars.bottomRight);
201
-
202
- return box;
203
- }
204
-
205
- getStringWidth(str) {
206
- // Simple character count - don't try to strip ANSI
207
- // This avoids any regex issues entirely
208
- return str.length;
209
- }
210
-
211
- destroy() {
212
- // Clean up listeners
213
- if (this.handleExit) {
214
- process.removeListener('SIGINT', this.handleExit);
215
- process.removeListener('SIGTERM', this.handleExit);
216
- }
217
-
218
- // Show cursor again
219
- process.stdout.write(ansiEscapes.cursorShow);
220
- }
221
- }
222
-
223
- /**
224
- * Create and display an ANSI-based UI for Auto Mode
225
- * @param {object} options - UI configuration
226
- * @param {string} options.menuContent - Menu content to display in header
227
- * @param {function} options.onExit - Callback when user presses Ctrl+C
228
- * @returns {AutoModeANSIUI} UI instance
229
- */
230
- function createAutoModeUI(options = {}) {
231
- return new AutoModeANSIUI(options);
232
- }
233
-
234
- module.exports = {
235
- createAutoModeUI,
236
- AutoModeANSIUI
237
- };
1
+ const chalk = require('chalk');
2
+ const ansiEscapes = require('ansi-escapes');
3
+
4
+ /**
5
+ * ANSI-based UI for Auto Mode
6
+ * Simple, reliable, no module system issues
7
+ */
8
+ class AutoModeANSIUI {
9
+ constructor(options = {}) {
10
+ this.menuContent = options.menuContent || '';
11
+ this.onExit = options.onExit;
12
+ this.requirement = 'Loading...';
13
+ this.step = 'PREPARE';
14
+ this.chatCount = 0;
15
+ this.maxChats = null;
16
+ this.progress = 0;
17
+ this.outputLines = [];
18
+ this.maxOutputLines = 15;
19
+
20
+ // Hide cursor for cleaner output
21
+ process.stdout.write(ansiEscapes.cursorHide);
22
+
23
+ // Handle exit - just use SIGINT, don't try to capture keys
24
+ // (stdin might be used by child process like Aider)
25
+ this.handleExit = () => {
26
+ this.destroy();
27
+ if (this.onExit) {
28
+ this.onExit();
29
+ }
30
+ process.exit(0);
31
+ };
32
+
33
+ process.on('SIGINT', this.handleExit);
34
+ process.on('SIGTERM', this.handleExit);
35
+
36
+ // Initial render
37
+ this.render();
38
+ }
39
+
40
+ updateStatus(status) {
41
+ if (status.requirement !== undefined) this.requirement = status.requirement;
42
+ if (status.step !== undefined) this.step = status.step;
43
+ if (status.chatCount !== undefined) this.chatCount = status.chatCount;
44
+ if (status.maxChats !== undefined) this.maxChats = status.maxChats;
45
+ if (status.progress !== undefined) this.progress = status.progress;
46
+ this.render();
47
+ }
48
+
49
+ appendOutput(line) {
50
+ // Safety: truncate very long lines to prevent memory issues
51
+ const maxLineLength = 500;
52
+ const safeLine = line.length > maxLineLength ? line.substring(0, maxLineLength) + '...' : line;
53
+
54
+ this.outputLines.push(safeLine);
55
+ // Keep only last N lines
56
+ if (this.outputLines.length > this.maxOutputLines) {
57
+ this.outputLines = this.outputLines.slice(-this.maxOutputLines);
58
+ }
59
+ this.render();
60
+ }
61
+
62
+ clearOutput() {
63
+ this.outputLines = [];
64
+ this.render();
65
+ }
66
+
67
+ render() {
68
+ // Clear screen and move cursor to top
69
+ process.stdout.write(ansiEscapes.clearScreen);
70
+ process.stdout.write(ansiEscapes.cursorTo(0, 0));
71
+
72
+ let output = '';
73
+
74
+ // Header box
75
+ output += this.drawBox(this.menuContent, { color: 'cyan', style: 'round' });
76
+ output += '\n';
77
+
78
+ // Status card
79
+ const statusContent = this.buildStatusContent();
80
+ output += this.drawBox(statusContent, { color: 'magenta', style: 'round', title: ' Auto Mode Status ' });
81
+ output += '\n';
82
+
83
+ // Output log
84
+ const outputContent = this.buildOutputContent();
85
+ output += this.drawBox(outputContent, { color: 'green', style: 'single', title: ' Aider Output ' });
86
+
87
+ process.stdout.write(output);
88
+ }
89
+
90
+ buildStatusContent() {
91
+ const stepColors = {
92
+ 'PREPARE': chalk.cyan,
93
+ 'ACT': chalk.yellow,
94
+ 'CLEAN UP': chalk.magenta,
95
+ 'VERIFY': chalk.blue,
96
+ 'DONE': chalk.green,
97
+ 'UNKNOWN': chalk.gray
98
+ };
99
+
100
+ const stepColor = stepColors[this.step] || chalk.gray;
101
+
102
+ // Progress bar
103
+ const barWidth = 40;
104
+ const filledWidth = Math.round((this.progress / 100) * barWidth);
105
+ const emptyWidth = barWidth - filledWidth;
106
+ const progressBar = chalk.green('█'.repeat(filledWidth)) + chalk.gray('░'.repeat(emptyWidth));
107
+
108
+ // Chat counter
109
+ const chatDisplay = this.maxChats
110
+ ? `Chat ${this.chatCount}/${this.maxChats}`
111
+ : `Chat ${this.chatCount} (unlimited)`;
112
+
113
+ // Truncate requirement if too long
114
+ const displayReq = this.requirement.length > 70
115
+ ? this.requirement.substring(0, 67) + '...'
116
+ : this.requirement;
117
+
118
+ return `
119
+ ${chalk.bold('📋 Current Requirement')}
120
+
121
+ ${displayReq}
122
+
123
+ ${chalk.bold('🚦 Status:')} ${stepColor.bold(this.step)}
124
+
125
+ ${progressBar} ${this.progress}%
126
+
127
+ ${chalk.gray(chatDisplay)}
128
+ `.trim();
129
+ }
130
+
131
+ buildOutputContent() {
132
+ if (this.outputLines.length === 0) {
133
+ return chalk.gray('No output yet...');
134
+ }
135
+ return this.outputLines.join('\n');
136
+ }
137
+
138
+ drawBox(content, options = {}) {
139
+ const { color = 'white', style = 'single', title = '' } = options;
140
+ const colorFn = chalk[color] || chalk.white;
141
+
142
+ // Box drawing characters
143
+ const chars = {
144
+ single: {
145
+ topLeft: '┌',
146
+ topRight: '┐',
147
+ bottomLeft: '└',
148
+ bottomRight: '┘',
149
+ horizontal: '─',
150
+ vertical: '│'
151
+ },
152
+ round: {
153
+ topLeft: '╭',
154
+ topRight: '╮',
155
+ bottomLeft: '╰',
156
+ bottomRight: '╯',
157
+ horizontal: '─',
158
+ vertical: '│'
159
+ },
160
+ double: {
161
+ topLeft: '╔',
162
+ topRight: '╗',
163
+ bottomLeft: '╚',
164
+ bottomRight: '╝',
165
+ horizontal: '═',
166
+ vertical: '║'
167
+ }
168
+ };
169
+
170
+ const boxChars = chars[style] || chars.single;
171
+ const lines = content.split('\n');
172
+
173
+ // Use fixed width to avoid any width calculation issues
174
+ const terminalWidth = process.stdout.columns || 80;
175
+ const width = Math.min(terminalWidth - 4, 60);
176
+
177
+ // Top border
178
+ let box = colorFn(boxChars.topLeft);
179
+ if (title) {
180
+ const titleLen = title.length;
181
+ const leftPad = Math.floor((width - titleLen - 2) / 2);
182
+ box += colorFn(boxChars.horizontal.repeat(leftPad));
183
+ box += colorFn(title);
184
+ box += colorFn(boxChars.horizontal.repeat(width - leftPad - titleLen));
185
+ } else {
186
+ box += colorFn(boxChars.horizontal.repeat(width));
187
+ }
188
+ box += colorFn(boxChars.topRight) + '\n';
189
+
190
+ // Content lines - use fixed padding to avoid width calculations
191
+ lines.forEach(line => {
192
+ // Truncate long lines
193
+ const maxLen = width - 4;
194
+ const displayLine = line.length > maxLen ? line.substring(0, maxLen - 3) + '...' : line;
195
+ const padding = Math.max(0, width - displayLine.length - 2);
196
+ box += colorFn(boxChars.vertical) + ' ' + displayLine + ' '.repeat(padding) + ' ' + colorFn(boxChars.vertical) + '\n';
197
+ });
198
+
199
+ // Bottom border
200
+ box += colorFn(boxChars.bottomLeft) + colorFn(boxChars.horizontal.repeat(width)) + colorFn(boxChars.bottomRight);
201
+
202
+ return box;
203
+ }
204
+
205
+ getStringWidth(str) {
206
+ // Simple character count - don't try to strip ANSI
207
+ // This avoids any regex issues entirely
208
+ return str.length;
209
+ }
210
+
211
+ destroy() {
212
+ // Clean up listeners
213
+ if (this.handleExit) {
214
+ process.removeListener('SIGINT', this.handleExit);
215
+ process.removeListener('SIGTERM', this.handleExit);
216
+ }
217
+
218
+ // Show cursor again
219
+ process.stdout.write(ansiEscapes.cursorShow);
220
+ }
221
+ }
222
+
223
+ /**
224
+ * Create and display an ANSI-based UI for Auto Mode
225
+ * @param {object} options - UI configuration
226
+ * @param {string} options.menuContent - Menu content to display in header
227
+ * @param {function} options.onExit - Callback when user presses Ctrl+C
228
+ * @returns {AutoModeANSIUI} UI instance
229
+ */
230
+ function createAutoModeUI(options = {}) {
231
+ return new AutoModeANSIUI(options);
232
+ }
233
+
234
+ module.exports = {
235
+ createAutoModeUI,
236
+ AutoModeANSIUI
237
+ };