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.
Files changed (37) hide show
  1. package/.allnightai/REQUIREMENTS.md +11 -11
  2. package/.allnightai/temp/auto-status.json +6 -0
  3. package/.env +7 -0
  4. package/.eslintrc.js +16 -16
  5. package/README.md +85 -85
  6. package/bin/vibecodingmachine.js +274 -274
  7. package/jest.config.js +8 -8
  8. package/logs/audit/2025-11-07.jsonl +2 -2
  9. package/package.json +62 -62
  10. package/scripts/README.md +128 -128
  11. package/scripts/auto-start-wrapper.sh +92 -92
  12. package/scripts/postinstall.js +81 -81
  13. package/src/commands/auth.js +96 -96
  14. package/src/commands/auto-direct.js +1748 -1748
  15. package/src/commands/auto.js +4692 -4692
  16. package/src/commands/auto.js.bak +710 -710
  17. package/src/commands/ide.js +70 -70
  18. package/src/commands/repo.js +159 -159
  19. package/src/commands/requirements.js +161 -161
  20. package/src/commands/setup.js +91 -91
  21. package/src/commands/status.js +88 -88
  22. package/src/index.js +5 -5
  23. package/src/utils/auth.js +572 -577
  24. package/src/utils/auto-mode-ansi-ui.js +238 -238
  25. package/src/utils/auto-mode-simple-ui.js +161 -161
  26. package/src/utils/auto-mode-ui.js.bak.blessed +207 -207
  27. package/src/utils/auto-mode.js +65 -65
  28. package/src/utils/config.js +64 -64
  29. package/src/utils/interactive.js +3616 -3616
  30. package/src/utils/keyboard-handler.js +153 -152
  31. package/src/utils/logger.js +4 -4
  32. package/src/utils/persistent-header.js +116 -116
  33. package/src/utils/provider-registry.js +128 -128
  34. package/src/utils/status-card.js +120 -120
  35. package/src/utils/stdout-interceptor.js +127 -127
  36. package/tests/auto-mode.test.js +37 -37
  37. package/tests/config.test.js +34 -34
@@ -1,127 +1,127 @@
1
- /**
2
- * Intercept stdout and stderr to capture console output
3
- * Allows routing output to custom handlers (like blessed UI) while optionally preserving original output
4
- */
5
- class StdoutInterceptor {
6
- constructor() {
7
- this.originalStdoutWrite = null;
8
- this.originalStderrWrite = null;
9
- this.outputHandlers = [];
10
- this.isIntercepting = false;
11
- this.buffer = '<span style="color: white;">';
12
- }
13
-
14
- /**
15
- * Add a handler that will receive output
16
- * @param {function} handler - Function that receives output strings
17
- */
18
- addHandler(handler) {
19
- this.outputHandlers.push(handler);
20
- }
21
-
22
- /**
23
- * Remove a handler
24
- * @param {function} handler - Handler to remove
25
- */
26
- removeHandler(handler) {
27
- const index = this.outputHandlers.indexOf(handler);
28
- if (index > -1) {
29
- this.outputHandlers.splice(index, 1);
30
- }
31
- }
32
-
33
- /**
34
- * Start intercepting stdout/stderr
35
- * @param {boolean} passthrough - If true, still write to original stdout/stderr
36
- */
37
- start(passthrough = false) {
38
- if (this.isIntercepting) {
39
- return;
40
- }
41
-
42
- this.isIntercepting = true;
43
-
44
- // Save original write functions
45
- this.originalStdoutWrite = process.stdout.write;
46
- this.originalStderrWrite = process.stderr.write;
47
-
48
- // Intercept stdout
49
- process.stdout.write = (chunk, encoding, callback) => {
50
- const str = chunk.toString();
51
-
52
- // Call all registered handlers
53
- this.outputHandlers.forEach(handler => {
54
- try {
55
- handler(str);
56
- } catch (error) {
57
- // Silently ignore handler errors to prevent breaking the interceptor
58
- }
59
- });
60
-
61
- // Optionally pass through to original stdout
62
- if (passthrough && this.originalStdoutWrite) {
63
- return this.originalStdoutWrite.call(process.stdout, chunk, encoding, callback);
64
- }
65
-
66
- // If not passing through, still call the callback if provided
67
- if (typeof callback === 'function') {
68
- callback();
69
- }
70
- return true;
71
- };
72
-
73
- // Intercept stderr
74
- process.stderr.write = (chunk, encoding, callback) => {
75
- const str = chunk.toString();
76
-
77
- // Call all registered handlers
78
- this.outputHandlers.forEach(handler => {
79
- try {
80
- handler(str);
81
- } catch (error) {
82
- // Silently ignore handler errors
83
- }
84
- });
85
-
86
- // Optionally pass through to original stderr
87
- if (passthrough && this.originalStderrWrite) {
88
- return this.originalStderrWrite.call(process.stderr, chunk, encoding, callback);
89
- }
90
-
91
- // If not passing through, still call the callback if provided
92
- if (typeof callback === 'function') {
93
- callback();
94
- }
95
- return true;
96
- };
97
- }
98
-
99
- /**
100
- * Stop intercepting and restore original stdout/stderr
101
- */
102
- stop() {
103
- if (!this.isIntercepting) {
104
- return;
105
- }
106
-
107
- if (this.originalStdoutWrite) {
108
- process.stdout.write = this.originalStdoutWrite;
109
- }
110
- if (this.originalStderrWrite) {
111
- process.stderr.write = this.originalStderrWrite;
112
- }
113
-
114
- this.isIntercepting = false;
115
- }
116
-
117
- /**
118
- * Clear all handlers
119
- */
120
- clearHandlers() {
121
- this.outputHandlers = [];
122
- }
123
- }
124
-
125
- module.exports = {
126
- StdoutInterceptor
127
- };
1
+ /**
2
+ * Intercept stdout and stderr to capture console output
3
+ * Allows routing output to custom handlers (like blessed UI) while optionally preserving original output
4
+ */
5
+ class StdoutInterceptor {
6
+ constructor() {
7
+ this.originalStdoutWrite = null;
8
+ this.originalStderrWrite = null;
9
+ this.outputHandlers = [];
10
+ this.isIntercepting = false;
11
+ this.buffer = '<span style="color: white;">';
12
+ }
13
+
14
+ /**
15
+ * Add a handler that will receive output
16
+ * @param {function} handler - Function that receives output strings
17
+ */
18
+ addHandler(handler) {
19
+ this.outputHandlers.push(handler);
20
+ }
21
+
22
+ /**
23
+ * Remove a handler
24
+ * @param {function} handler - Handler to remove
25
+ */
26
+ removeHandler(handler) {
27
+ const index = this.outputHandlers.indexOf(handler);
28
+ if (index > -1) {
29
+ this.outputHandlers.splice(index, 1);
30
+ }
31
+ }
32
+
33
+ /**
34
+ * Start intercepting stdout/stderr
35
+ * @param {boolean} passthrough - If true, still write to original stdout/stderr
36
+ */
37
+ start(passthrough = false) {
38
+ if (this.isIntercepting) {
39
+ return;
40
+ }
41
+
42
+ this.isIntercepting = true;
43
+
44
+ // Save original write functions
45
+ this.originalStdoutWrite = process.stdout.write;
46
+ this.originalStderrWrite = process.stderr.write;
47
+
48
+ // Intercept stdout
49
+ process.stdout.write = (chunk, encoding, callback) => {
50
+ const str = chunk.toString();
51
+
52
+ // Call all registered handlers
53
+ this.outputHandlers.forEach(handler => {
54
+ try {
55
+ handler(str);
56
+ } catch (error) {
57
+ // Silently ignore handler errors to prevent breaking the interceptor
58
+ }
59
+ });
60
+
61
+ // Optionally pass through to original stdout
62
+ if (passthrough && this.originalStdoutWrite) {
63
+ return this.originalStdoutWrite.call(process.stdout, chunk, encoding, callback);
64
+ }
65
+
66
+ // If not passing through, still call the callback if provided
67
+ if (typeof callback === 'function') {
68
+ callback();
69
+ }
70
+ return true;
71
+ };
72
+
73
+ // Intercept stderr
74
+ process.stderr.write = (chunk, encoding, callback) => {
75
+ const str = chunk.toString();
76
+
77
+ // Call all registered handlers
78
+ this.outputHandlers.forEach(handler => {
79
+ try {
80
+ handler(str);
81
+ } catch (error) {
82
+ // Silently ignore handler errors
83
+ }
84
+ });
85
+
86
+ // Optionally pass through to original stderr
87
+ if (passthrough && this.originalStderrWrite) {
88
+ return this.originalStderrWrite.call(process.stderr, chunk, encoding, callback);
89
+ }
90
+
91
+ // If not passing through, still call the callback if provided
92
+ if (typeof callback === 'function') {
93
+ callback();
94
+ }
95
+ return true;
96
+ };
97
+ }
98
+
99
+ /**
100
+ * Stop intercepting and restore original stdout/stderr
101
+ */
102
+ stop() {
103
+ if (!this.isIntercepting) {
104
+ return;
105
+ }
106
+
107
+ if (this.originalStdoutWrite) {
108
+ process.stdout.write = this.originalStdoutWrite;
109
+ }
110
+ if (this.originalStderrWrite) {
111
+ process.stderr.write = this.originalStderrWrite;
112
+ }
113
+
114
+ this.isIntercepting = false;
115
+ }
116
+
117
+ /**
118
+ * Clear all handlers
119
+ */
120
+ clearHandlers() {
121
+ this.outputHandlers = [];
122
+ }
123
+ }
124
+
125
+ module.exports = {
126
+ StdoutInterceptor
127
+ };
@@ -1,37 +1,37 @@
1
- const os = require('os');
2
- const path = require('path');
3
- const fs = require('fs-extra');
4
-
5
- describe('auto-mode utils', () => {
6
- const tmpConfig = path.join(os.tmpdir(), `vibecodingmachine_test_config_${Date.now()}.json`);
7
- const tmpRepo = path.join(os.tmpdir(), `vibecodingmachine_test_repo_${Date.now()}`);
8
-
9
- beforeAll(async () => {
10
- process.env.ALLNIGHTAI_CONFIG_PATH = tmpConfig;
11
- await fs.ensureDir(path.join(tmpRepo, '.vibecodingmachine', 'temp'));
12
- const { setRepoPath } = require('../src/utils/config');
13
- await setRepoPath(tmpRepo);
14
- });
15
-
16
- afterAll(async () => {
17
- delete process.env.ALLNIGHTAI_CONFIG_PATH;
18
- await fs.remove(tmpConfig).catch(() => {});
19
- await fs.remove(tmpRepo).catch(() => {});
20
- });
21
-
22
- test('start/stop and status', async () => {
23
- const { startAutoMode, stopAutoMode, checkAutoModeStatus } = require('../src/utils/auto-mode');
24
- const { getAutoConfig } = require('../src/utils/config');
25
- await startAutoMode(tmpRepo, { ide: 'cursor' });
26
- let status = await checkAutoModeStatus();
27
- expect(status.running).toBe(true);
28
- expect(status.ide).toBe('cursor');
29
-
30
- await stopAutoMode();
31
- status = await checkAutoModeStatus();
32
- expect(status.running).toBe(false);
33
- });
34
- });
35
-
36
-
37
-
1
+ const os = require('os');
2
+ const path = require('path');
3
+ const fs = require('fs-extra');
4
+
5
+ describe('auto-mode utils', () => {
6
+ const tmpConfig = path.join(os.tmpdir(), `vibecodingmachine_test_config_${Date.now()}.json`);
7
+ const tmpRepo = path.join(os.tmpdir(), `vibecodingmachine_test_repo_${Date.now()}`);
8
+
9
+ beforeAll(async () => {
10
+ process.env.ALLNIGHTAI_CONFIG_PATH = tmpConfig;
11
+ await fs.ensureDir(path.join(tmpRepo, '.vibecodingmachine', 'temp'));
12
+ const { setRepoPath } = require('../src/utils/config');
13
+ await setRepoPath(tmpRepo);
14
+ });
15
+
16
+ afterAll(async () => {
17
+ delete process.env.ALLNIGHTAI_CONFIG_PATH;
18
+ await fs.remove(tmpConfig).catch(() => {});
19
+ await fs.remove(tmpRepo).catch(() => {});
20
+ });
21
+
22
+ test('start/stop and status', async () => {
23
+ const { startAutoMode, stopAutoMode, checkAutoModeStatus } = require('../src/utils/auto-mode');
24
+ const { getAutoConfig } = require('../src/utils/config');
25
+ await startAutoMode(tmpRepo, { ide: 'cursor' });
26
+ let status = await checkAutoModeStatus();
27
+ expect(status.running).toBe(true);
28
+ expect(status.ide).toBe('cursor');
29
+
30
+ await stopAutoMode();
31
+ status = await checkAutoModeStatus();
32
+ expect(status.running).toBe(false);
33
+ });
34
+ });
35
+
36
+
37
+
@@ -1,34 +1,34 @@
1
- const os = require('os');
2
- const path = require('path');
3
- const fs = require('fs-extra');
4
-
5
- describe('config utils', () => {
6
- const tmpConfig = path.join(os.tmpdir(), `vibecodingmachine_test_config_${Date.now()}.json`);
7
-
8
- beforeAll(() => {
9
- process.env.ALLNIGHTAI_CONFIG_PATH = tmpConfig;
10
- });
11
-
12
- afterAll(async () => {
13
- delete process.env.ALLNIGHTAI_CONFIG_PATH;
14
- await fs.remove(tmpConfig).catch(() => {});
15
- });
16
-
17
- test('set/get repo path roundtrip', async () => {
18
- const { getRepoPath, setRepoPath } = require('../src/utils/config');
19
- expect(await getRepoPath()).toBeNull();
20
- await setRepoPath('/tmp/repo');
21
- expect(await getRepoPath()).toBe('/tmp/repo');
22
- });
23
-
24
- test('set/get auto config roundtrip', async () => {
25
- const { getAutoConfig, setAutoConfig } = require('../src/utils/config');
26
- await setAutoConfig({ ide: 'cursor', maxChats: 10 });
27
- const cfg = await getAutoConfig();
28
- expect(cfg.ide).toBe('cursor');
29
- expect(cfg.maxChats).toBe(10);
30
- });
31
- });
32
-
33
-
34
-
1
+ const os = require('os');
2
+ const path = require('path');
3
+ const fs = require('fs-extra');
4
+
5
+ describe('config utils', () => {
6
+ const tmpConfig = path.join(os.tmpdir(), `vibecodingmachine_test_config_${Date.now()}.json`);
7
+
8
+ beforeAll(() => {
9
+ process.env.ALLNIGHTAI_CONFIG_PATH = tmpConfig;
10
+ });
11
+
12
+ afterAll(async () => {
13
+ delete process.env.ALLNIGHTAI_CONFIG_PATH;
14
+ await fs.remove(tmpConfig).catch(() => {});
15
+ });
16
+
17
+ test('set/get repo path roundtrip', async () => {
18
+ const { getRepoPath, setRepoPath } = require('../src/utils/config');
19
+ expect(await getRepoPath()).toBeNull();
20
+ await setRepoPath('/tmp/repo');
21
+ expect(await getRepoPath()).toBe('/tmp/repo');
22
+ });
23
+
24
+ test('set/get auto config roundtrip', async () => {
25
+ const { getAutoConfig, setAutoConfig } = require('../src/utils/config');
26
+ await setAutoConfig({ ide: 'cursor', maxChats: 10 });
27
+ const cfg = await getAutoConfig();
28
+ expect(cfg.ide).toBe('cursor');
29
+ expect(cfg.maxChats).toBe(10);
30
+ });
31
+ });
32
+
33
+
34
+