vibecodingmachine-cli 1.0.5 → 1.0.7
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.
- package/.allnightai/REQUIREMENTS.md +11 -11
- package/.allnightai/temp/auto-status.json +6 -0
- package/.env +7 -0
- package/.eslintrc.js +16 -16
- package/README.md +85 -85
- package/bin/vibecodingmachine.js +274 -274
- package/jest.config.js +8 -8
- package/logs/audit/2025-11-07.jsonl +2 -2
- package/package.json +62 -62
- package/scripts/README.md +128 -128
- package/scripts/auto-start-wrapper.sh +92 -92
- package/scripts/postinstall.js +81 -81
- package/src/commands/auth.js +96 -96
- package/src/commands/auto-direct.js +1748 -1748
- package/src/commands/auto.js +4692 -4692
- package/src/commands/auto.js.bak +710 -710
- package/src/commands/ide.js +70 -70
- package/src/commands/repo.js +159 -159
- package/src/commands/requirements.js +161 -161
- package/src/commands/setup.js +91 -91
- package/src/commands/status.js +88 -88
- package/src/index.js +5 -5
- package/src/utils/auth.js +572 -577
- package/src/utils/auto-mode-ansi-ui.js +238 -238
- package/src/utils/auto-mode-simple-ui.js +161 -161
- package/src/utils/auto-mode-ui.js.bak.blessed +207 -207
- package/src/utils/auto-mode.js +65 -65
- package/src/utils/config.js +64 -64
- package/src/utils/interactive.js +3616 -3616
- package/src/utils/keyboard-handler.js +153 -152
- package/src/utils/logger.js +4 -4
- package/src/utils/persistent-header.js +116 -116
- package/src/utils/provider-registry.js +128 -128
- package/src/utils/status-card.js +120 -120
- package/src/utils/stdout-interceptor.js +127 -127
- package/tests/auto-mode.test.js +37 -37
- package/tests/config.test.js +34 -34
|
@@ -1,161 +1,161 @@
|
|
|
1
|
-
const chalk = require('chalk');
|
|
2
|
-
const boxen = require('boxen');
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Simple status-line UI for Auto Mode with persistent workflow card
|
|
6
|
-
* Shows a purple card similar to Electron app that stays visible
|
|
7
|
-
*/
|
|
8
|
-
class AutoModeSimpleUI {
|
|
9
|
-
constructor(options = {}) {
|
|
10
|
-
this.menuContent = options.menuContent || '';
|
|
11
|
-
this.requirement = 'Loading...';
|
|
12
|
-
this.step = 'PREPARE';
|
|
13
|
-
this.chatCount = 0;
|
|
14
|
-
this.maxChats = null;
|
|
15
|
-
this.progress = 0;
|
|
16
|
-
this.outputLineCount = 0; // Track output lines for periodic re-render
|
|
17
|
-
this.lastCardPrintTime = Date.now(); // Track when we last printed the card
|
|
18
|
-
this.lastCardPrintLine = 0; // Track line count when we last printed the card
|
|
19
|
-
|
|
20
|
-
// Print header once
|
|
21
|
-
console.log('\n' + chalk.bold.cyan('═══════════════════════════════════════════════════════════'));
|
|
22
|
-
console.log(this.menuContent);
|
|
23
|
-
console.log(chalk.bold.cyan('═══════════════════════════════════════════════════════════') + '\n');
|
|
24
|
-
|
|
25
|
-
// Initial workflow card
|
|
26
|
-
this.printWorkflowCard();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
updateStatus(status) {
|
|
30
|
-
if (status.requirement !== undefined) this.requirement = status.requirement;
|
|
31
|
-
if (status.step !== undefined) this.step = status.step;
|
|
32
|
-
if (status.chatCount !== undefined) this.chatCount = status.chatCount;
|
|
33
|
-
if (status.maxChats !== undefined) this.maxChats = status.maxChats;
|
|
34
|
-
if (status.progress !== undefined) this.progress = status.progress;
|
|
35
|
-
|
|
36
|
-
this.printWorkflowCard();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Get icon for each workflow stage based on current step
|
|
41
|
-
*/
|
|
42
|
-
getStepIcon(stage, currentStage) {
|
|
43
|
-
const stageOrder = ['PREPARE', 'ACT', 'CLEAN UP', 'VERIFY', 'DONE'];
|
|
44
|
-
const currentIndex = stageOrder.indexOf(currentStage);
|
|
45
|
-
const stepIndex = stageOrder.indexOf(stage);
|
|
46
|
-
|
|
47
|
-
if (stepIndex < currentIndex) {
|
|
48
|
-
return '✅'; // Completed steps
|
|
49
|
-
} else if (stepIndex === currentIndex) {
|
|
50
|
-
if (currentStage === 'DONE') {
|
|
51
|
-
return '✅'; // Done is always checked
|
|
52
|
-
} else {
|
|
53
|
-
return '🔨'; // Current step
|
|
54
|
-
}
|
|
55
|
-
} else {
|
|
56
|
-
return '⏳'; // Pending steps
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Render the persistent workflow card (similar to Electron app's purple card)
|
|
62
|
-
*/
|
|
63
|
-
printWorkflowCard() {
|
|
64
|
-
// Step color mapping
|
|
65
|
-
const stepColors = {
|
|
66
|
-
'PREPARE': chalk.cyan,
|
|
67
|
-
'ACT': chalk.yellow,
|
|
68
|
-
'CLEAN UP': chalk.magenta,
|
|
69
|
-
'VERIFY': chalk.blue,
|
|
70
|
-
'DONE': chalk.green,
|
|
71
|
-
'UNKNOWN': chalk.gray
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const currentStepColor = stepColors[this.step] || chalk.gray;
|
|
75
|
-
|
|
76
|
-
// Build workflow states line: PREPARE ⏳ ACT ⏳ CLEAN UP ⏳ VERIFY ⏳ DONE
|
|
77
|
-
const stages = [
|
|
78
|
-
{ name: 'PREPARE', color: chalk.cyan },
|
|
79
|
-
{ name: 'ACT', color: chalk.yellow },
|
|
80
|
-
{ name: 'CLEAN UP', color: chalk.magenta },
|
|
81
|
-
{ name: 'VERIFY', color: chalk.blue },
|
|
82
|
-
{ name: 'DONE', color: chalk.green }
|
|
83
|
-
];
|
|
84
|
-
|
|
85
|
-
const workflowLine = stages.map((stage, index) => {
|
|
86
|
-
const icon = this.getStepIcon(stage.name, this.step);
|
|
87
|
-
const isCurrent = stage.name === this.step;
|
|
88
|
-
const stageColor = isCurrent ? currentStepColor.bold : stage.color;
|
|
89
|
-
return `${icon} ${stageColor(stage.name)}`;
|
|
90
|
-
}).join(` ${chalk.gray('⏳')} `);
|
|
91
|
-
|
|
92
|
-
// Truncate requirement if too long
|
|
93
|
-
const displayReq = this.requirement.length > 70
|
|
94
|
-
? this.requirement.substring(0, 67) + '...'
|
|
95
|
-
: this.requirement;
|
|
96
|
-
|
|
97
|
-
// Build card content
|
|
98
|
-
const cardContent = [
|
|
99
|
-
workflowLine,
|
|
100
|
-
'',
|
|
101
|
-
chalk.bold.white(`🎯 Working on: ${displayReq}`)
|
|
102
|
-
].join('\n');
|
|
103
|
-
|
|
104
|
-
// Render card with purple/magenta border (matching Electron app)
|
|
105
|
-
const card = boxen(cardContent, {
|
|
106
|
-
padding: { left: 1, right: 1, top: 1, bottom: 1 },
|
|
107
|
-
margin: { top: 0, right: 0, bottom: 1, left: 0 },
|
|
108
|
-
borderStyle: 'round',
|
|
109
|
-
borderColor: 'magenta',
|
|
110
|
-
backgroundColor: 'black'
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
// Print the card with a separator line before it for visibility
|
|
114
|
-
if (this.outputLineCount > 0) {
|
|
115
|
-
// Add separator when re-printing after output
|
|
116
|
-
console.log(chalk.gray('─'.repeat(80)));
|
|
117
|
-
}
|
|
118
|
-
console.log(card);
|
|
119
|
-
this.lastCardPrintTime = Date.now();
|
|
120
|
-
this.lastCardPrintLine = this.outputLineCount;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
appendOutput(line) {
|
|
124
|
-
// Periodically re-print the workflow card to keep it visible
|
|
125
|
-
// Re-print every 20 lines of output, or if more than 5 seconds have passed
|
|
126
|
-
const linesSinceLastCard = this.outputLineCount - this.lastCardPrintLine;
|
|
127
|
-
const timeSinceLastCard = Date.now() - this.lastCardPrintTime;
|
|
128
|
-
|
|
129
|
-
if (linesSinceLastCard >= 20 || timeSinceLastCard > 5000) {
|
|
130
|
-
this.printWorkflowCard();
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Increment output line counter
|
|
134
|
-
if (line && line.trim()) {
|
|
135
|
-
this.outputLineCount++;
|
|
136
|
-
console.log(line);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
clearOutput() {
|
|
141
|
-
// No-op for simple UI
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
destroy() {
|
|
145
|
-
console.log('\n' + chalk.bold.green('Auto mode exited.') + '\n');
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Create and display a simple status UI for Auto Mode
|
|
151
|
-
* @param {object} options - UI configuration
|
|
152
|
-
* @returns {AutoModeSimpleUI} UI instance
|
|
153
|
-
*/
|
|
154
|
-
function createAutoModeUI(options = {}) {
|
|
155
|
-
return new AutoModeSimpleUI(options);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
module.exports = {
|
|
159
|
-
createAutoModeUI,
|
|
160
|
-
AutoModeSimpleUI
|
|
161
|
-
};
|
|
1
|
+
const chalk = require('chalk');
|
|
2
|
+
const boxen = require('boxen');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Simple status-line UI for Auto Mode with persistent workflow card
|
|
6
|
+
* Shows a purple card similar to Electron app that stays visible
|
|
7
|
+
*/
|
|
8
|
+
class AutoModeSimpleUI {
|
|
9
|
+
constructor(options = {}) {
|
|
10
|
+
this.menuContent = options.menuContent || '';
|
|
11
|
+
this.requirement = 'Loading...';
|
|
12
|
+
this.step = 'PREPARE';
|
|
13
|
+
this.chatCount = 0;
|
|
14
|
+
this.maxChats = null;
|
|
15
|
+
this.progress = 0;
|
|
16
|
+
this.outputLineCount = 0; // Track output lines for periodic re-render
|
|
17
|
+
this.lastCardPrintTime = Date.now(); // Track when we last printed the card
|
|
18
|
+
this.lastCardPrintLine = 0; // Track line count when we last printed the card
|
|
19
|
+
|
|
20
|
+
// Print header once
|
|
21
|
+
console.log('\n' + chalk.bold.cyan('═══════════════════════════════════════════════════════════'));
|
|
22
|
+
console.log(this.menuContent);
|
|
23
|
+
console.log(chalk.bold.cyan('═══════════════════════════════════════════════════════════') + '\n');
|
|
24
|
+
|
|
25
|
+
// Initial workflow card
|
|
26
|
+
this.printWorkflowCard();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
updateStatus(status) {
|
|
30
|
+
if (status.requirement !== undefined) this.requirement = status.requirement;
|
|
31
|
+
if (status.step !== undefined) this.step = status.step;
|
|
32
|
+
if (status.chatCount !== undefined) this.chatCount = status.chatCount;
|
|
33
|
+
if (status.maxChats !== undefined) this.maxChats = status.maxChats;
|
|
34
|
+
if (status.progress !== undefined) this.progress = status.progress;
|
|
35
|
+
|
|
36
|
+
this.printWorkflowCard();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get icon for each workflow stage based on current step
|
|
41
|
+
*/
|
|
42
|
+
getStepIcon(stage, currentStage) {
|
|
43
|
+
const stageOrder = ['PREPARE', 'ACT', 'CLEAN UP', 'VERIFY', 'DONE'];
|
|
44
|
+
const currentIndex = stageOrder.indexOf(currentStage);
|
|
45
|
+
const stepIndex = stageOrder.indexOf(stage);
|
|
46
|
+
|
|
47
|
+
if (stepIndex < currentIndex) {
|
|
48
|
+
return '✅'; // Completed steps
|
|
49
|
+
} else if (stepIndex === currentIndex) {
|
|
50
|
+
if (currentStage === 'DONE') {
|
|
51
|
+
return '✅'; // Done is always checked
|
|
52
|
+
} else {
|
|
53
|
+
return '🔨'; // Current step
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
return '⏳'; // Pending steps
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Render the persistent workflow card (similar to Electron app's purple card)
|
|
62
|
+
*/
|
|
63
|
+
printWorkflowCard() {
|
|
64
|
+
// Step color mapping
|
|
65
|
+
const stepColors = {
|
|
66
|
+
'PREPARE': chalk.cyan,
|
|
67
|
+
'ACT': chalk.yellow,
|
|
68
|
+
'CLEAN UP': chalk.magenta,
|
|
69
|
+
'VERIFY': chalk.blue,
|
|
70
|
+
'DONE': chalk.green,
|
|
71
|
+
'UNKNOWN': chalk.gray
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const currentStepColor = stepColors[this.step] || chalk.gray;
|
|
75
|
+
|
|
76
|
+
// Build workflow states line: PREPARE ⏳ ACT ⏳ CLEAN UP ⏳ VERIFY ⏳ DONE
|
|
77
|
+
const stages = [
|
|
78
|
+
{ name: 'PREPARE', color: chalk.cyan },
|
|
79
|
+
{ name: 'ACT', color: chalk.yellow },
|
|
80
|
+
{ name: 'CLEAN UP', color: chalk.magenta },
|
|
81
|
+
{ name: 'VERIFY', color: chalk.blue },
|
|
82
|
+
{ name: 'DONE', color: chalk.green }
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
const workflowLine = stages.map((stage, index) => {
|
|
86
|
+
const icon = this.getStepIcon(stage.name, this.step);
|
|
87
|
+
const isCurrent = stage.name === this.step;
|
|
88
|
+
const stageColor = isCurrent ? currentStepColor.bold : stage.color;
|
|
89
|
+
return `${icon} ${stageColor(stage.name)}`;
|
|
90
|
+
}).join(` ${chalk.gray('⏳')} `);
|
|
91
|
+
|
|
92
|
+
// Truncate requirement if too long
|
|
93
|
+
const displayReq = this.requirement.length > 70
|
|
94
|
+
? this.requirement.substring(0, 67) + '...'
|
|
95
|
+
: this.requirement;
|
|
96
|
+
|
|
97
|
+
// Build card content
|
|
98
|
+
const cardContent = [
|
|
99
|
+
workflowLine,
|
|
100
|
+
'',
|
|
101
|
+
chalk.bold.white(`🎯 Working on: ${displayReq}`)
|
|
102
|
+
].join('\n');
|
|
103
|
+
|
|
104
|
+
// Render card with purple/magenta border (matching Electron app)
|
|
105
|
+
const card = boxen(cardContent, {
|
|
106
|
+
padding: { left: 1, right: 1, top: 1, bottom: 1 },
|
|
107
|
+
margin: { top: 0, right: 0, bottom: 1, left: 0 },
|
|
108
|
+
borderStyle: 'round',
|
|
109
|
+
borderColor: 'magenta',
|
|
110
|
+
backgroundColor: 'black'
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// Print the card with a separator line before it for visibility
|
|
114
|
+
if (this.outputLineCount > 0) {
|
|
115
|
+
// Add separator when re-printing after output
|
|
116
|
+
console.log(chalk.gray('─'.repeat(80)));
|
|
117
|
+
}
|
|
118
|
+
console.log(card);
|
|
119
|
+
this.lastCardPrintTime = Date.now();
|
|
120
|
+
this.lastCardPrintLine = this.outputLineCount;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
appendOutput(line) {
|
|
124
|
+
// Periodically re-print the workflow card to keep it visible
|
|
125
|
+
// Re-print every 20 lines of output, or if more than 5 seconds have passed
|
|
126
|
+
const linesSinceLastCard = this.outputLineCount - this.lastCardPrintLine;
|
|
127
|
+
const timeSinceLastCard = Date.now() - this.lastCardPrintTime;
|
|
128
|
+
|
|
129
|
+
if (linesSinceLastCard >= 20 || timeSinceLastCard > 5000) {
|
|
130
|
+
this.printWorkflowCard();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Increment output line counter
|
|
134
|
+
if (line && line.trim()) {
|
|
135
|
+
this.outputLineCount++;
|
|
136
|
+
console.log(line);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
clearOutput() {
|
|
141
|
+
// No-op for simple UI
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
destroy() {
|
|
145
|
+
console.log('\n' + chalk.bold.green('Auto mode exited.') + '\n');
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Create and display a simple status UI for Auto Mode
|
|
151
|
+
* @param {object} options - UI configuration
|
|
152
|
+
* @returns {AutoModeSimpleUI} UI instance
|
|
153
|
+
*/
|
|
154
|
+
function createAutoModeUI(options = {}) {
|
|
155
|
+
return new AutoModeSimpleUI(options);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
module.exports = {
|
|
159
|
+
createAutoModeUI,
|
|
160
|
+
AutoModeSimpleUI
|
|
161
|
+
};
|