vibecodingmachine-core 2026.3.9-907 → 2026.3.10-1547

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 (42) hide show
  1. package/package.json +1 -1
  2. package/src/auth/access-denied.html +119 -119
  3. package/src/auth/shared-auth-storage.js +267 -267
  4. package/src/autonomous-mode/feature-implementer.cjs +70 -70
  5. package/src/autonomous-mode/feature-implementer.js +425 -425
  6. package/src/beta-request.js +160 -160
  7. package/src/chat-management/chat-manager.cjs +71 -71
  8. package/src/chat-management/chat-manager.js +342 -342
  9. package/src/compliance/compliance-prompt.js +183 -183
  10. package/src/ide-integration/aider-cli-manager.cjs +850 -850
  11. package/src/ide-integration/applescript-manager.cjs +3215 -3215
  12. package/src/ide-integration/applescript-utils.js +314 -314
  13. package/src/ide-integration/cdp-manager.cjs +221 -221
  14. package/src/ide-integration/claude-code-cli-manager.cjs +456 -456
  15. package/src/ide-integration/cline-cli-manager.cjs +2252 -2252
  16. package/src/ide-integration/continue-cli-manager.js +431 -431
  17. package/src/ide-integration/provider-manager.cjs +595 -595
  18. package/src/ide-integration/quota-detector.cjs +399 -399
  19. package/src/ide-integration/windows-automation-manager.js +532 -4
  20. package/src/ide-integration/windows-ide-manager.js +12 -3
  21. package/src/index.cjs +142 -142
  22. package/src/llm/direct-llm-manager.cjs +1299 -1299
  23. package/src/localization/index.js +147 -147
  24. package/src/quota-management/index.js +108 -108
  25. package/src/requirement-numbering.js +164 -164
  26. package/src/sync/aws-setup.js +445 -445
  27. package/src/ui/ButtonComponents.js +247 -247
  28. package/src/ui/ChatInterface.js +499 -499
  29. package/src/ui/StateManager.js +259 -259
  30. package/src/utils/audit-logger.cjs +116 -116
  31. package/src/utils/config-helpers.cjs +94 -94
  32. package/src/utils/config-helpers.js +94 -94
  33. package/src/utils/env-helpers.js +54 -54
  34. package/src/utils/error-reporter.js +117 -117
  35. package/src/utils/gcloud-auth.cjs +394 -394
  36. package/src/utils/git-branch-manager.js +278 -278
  37. package/src/utils/logger.cjs +193 -193
  38. package/src/utils/logger.js +191 -191
  39. package/src/utils/repo-helpers.cjs +120 -120
  40. package/src/utils/repo-helpers.js +120 -120
  41. package/src/utils/update-checker.js +246 -246
  42. package/src/utils/version-checker.js +170 -170
@@ -1,221 +1,221 @@
1
- // @vibecodingmachine/core - CDP Manager (CommonJS)
2
- // Handles Chrome DevTools Protocol interactions with IDEs
3
-
4
- const CDP = require('chrome-remote-interface');
5
-
6
- /**
7
- * CDP Manager for IDE interactions
8
- * Handles Chrome DevTools Protocol-based text sending for IDEs like VS Code and Cursor
9
- */
10
- class CDPManager {
11
- constructor() {
12
- this.logger = console;
13
- }
14
-
15
- /**
16
- * Timeout utility function
17
- * @param {number} ms - Timeout in milliseconds
18
- * @param {Promise} promise - Promise to timeout
19
- * @returns {Promise} Promise with timeout
20
- */
21
- timeout(ms, promise) {
22
- return Promise.race([
23
- promise,
24
- new Promise((_, reject) =>
25
- setTimeout(() => reject(new Error(`Operation timed out after ${ms}ms`)), ms)
26
- )
27
- ]);
28
- }
29
-
30
- /**
31
- * Send text to an IDE via CDP
32
- * @param {string} text - The text to send
33
- * @param {string} ide - The IDE name ('vscode', 'cursor')
34
- * @returns {Promise<Object>} Result object with success status and details
35
- */
36
- async sendText(text, ide) {
37
- if (typeof text !== 'string') {
38
- return {
39
- success: false,
40
- error: `Invalid text type: ${typeof text}. Expected string.`,
41
- debug: { textType: typeof text, textValue: text }
42
- };
43
- }
44
-
45
- const ideName = ide === 'cursor' ? 'Cursor' : ide === 'vscode' ? 'VS Code' : 'Unknown IDE';
46
- const port = ide === 'cursor' ? 9225 : 9222;
47
-
48
- this.logger.log(`🔍 sendText: Starting debug session`);
49
- this.logger.log(`📋 IDE: ${ideName} (${ide})`);
50
- this.logger.log(`🔌 Port: ${port}`);
51
- this.logger.log(`💬 Text: "${text.substring(0, 100)}${text.length > 100 ? '...' : ''}"`);
52
-
53
- try {
54
- // For VS Code, use the working approach from commit 6235f46b
55
- if (ide === 'vscode') {
56
- return await this.sendTextToVSCode(text);
57
- }
58
-
59
- // For other IDEs, use basic CDP approach
60
- return await this.sendTextBasic(text, ide);
61
- } catch (error) {
62
- this.logger.error('CDP error:', error);
63
- return {
64
- success: false,
65
- error: `CDP error: ${error.message}`,
66
- debug: { ide, port, textLength: text.length }
67
- };
68
- }
69
- }
70
-
71
- /**
72
- * Send text to VS Code using the working approach
73
- * @param {string} text - The text to send
74
- * @returns {Promise<Object>} Result object
75
- */
76
- async sendTextToVSCode(text) {
77
- try {
78
- const targets = await CDP.List({ port: 9222 });
79
- if (!targets || targets.length === 0) {
80
- return { success: false, error: 'Could not find VS Code. Make sure VS Code is running with --remote-debugging-port=9222' };
81
- }
82
-
83
- const workbench = targets.find(t => t.url && t.url.includes('workbench')) || targets[0];
84
- if (!workbench) return { success: false, error: 'No VS Code workbench target found.' };
85
-
86
- this.logger.log(`Found ${targets.length} targets, using workbench: ${workbench.title}`);
87
- const client = await CDP({ port: 9222, target: workbench });
88
- const { Runtime, Input, Page, DOM } = client;
89
- await Runtime.enable();
90
- await DOM.enable();
91
- if (Page && Page.bringToFront) { try { await Page.bringToFront(); } catch (_) {} }
92
-
93
- // Use clipboard approach to avoid focus issues
94
- const clipboardText = String(text).slice(0, 4000);
95
- this.logger.log('Copying text to clipboard:', clipboardText);
96
-
97
- // Try to paste the text after a short delay
98
- setTimeout(async () => {
99
- try {
100
- const isDarwin = process.platform === 'darwin';
101
- const pasteMods = isDarwin ? 4 /* Meta */ : 2 /* Ctrl */;
102
- await Input.dispatchKeyEvent({ type: 'keyDown', key: 'v', text: 'v', modifiers: pasteMods });
103
- await Input.dispatchKeyEvent({ type: 'keyUp', key: 'v', text: 'v', modifiers: pasteMods });
104
- this.logger.log('Pasted text via Cmd+V');
105
- } catch (e) {
106
- this.logger.log('Paste failed:', e.message);
107
- }
108
- }, 200);
109
-
110
- // Also try typing the text character by character
111
- setTimeout(async () => {
112
- try {
113
- this.logger.log('Starting character-by-character typing...');
114
- for (let i = 0; i < clipboardText.length; i++) {
115
- const char = clipboardText[i];
116
- await Input.dispatchKeyEvent({ type: 'keyDown', key: char, text: char });
117
- await Input.dispatchKeyEvent({ type: 'keyUp', key: char, text: char });
118
- await new Promise(resolve => setTimeout(resolve, 20));
119
- }
120
- this.logger.log('Finished character-by-character typing');
121
-
122
- // Try multiple submission methods
123
- setTimeout(async () => {
124
- try {
125
- this.logger.log('Attempting to submit message...');
126
-
127
- // Method 1: Press Enter
128
- await Input.dispatchKeyEvent({ type: 'keyDown', key: 'Enter' });
129
- await Input.dispatchKeyEvent({ type: 'keyUp', key: 'Enter' });
130
- await new Promise(resolve => setTimeout(resolve, 100));
131
-
132
- // Method 2: Try Cmd+Enter
133
- const isDarwin = process.platform === 'darwin';
134
- const enterMods = isDarwin ? 4 /* Meta */ : 2 /* Ctrl */;
135
- await Input.dispatchKeyEvent({ type: 'keyDown', key: 'Enter', text: 'Enter', modifiers: enterMods });
136
- await Input.dispatchKeyEvent({ type: 'keyUp', key: 'Enter', text: 'Enter', modifiers: enterMods });
137
-
138
- } catch (e) {
139
- this.logger.log('Submission failed:', e.message);
140
- }
141
- }, 300);
142
-
143
- } catch (e) {
144
- this.logger.log('Character typing failed:', e.message);
145
- }
146
- }, 500);
147
-
148
- this.logger.log(`Successfully sent message to VS Code via CDP`);
149
- return {
150
- success: true,
151
- method: 'cdp-clipboard',
152
- message: `Message sent to VS Code: ${text}`,
153
- note: 'Message sent via CDP with clipboard approach'
154
- };
155
-
156
- } catch (error) {
157
- this.logger.error('VS Code CDP error:', error);
158
- return { success: false, error: `VS Code CDP error: ${error.message}` };
159
- }
160
- }
161
-
162
- /**
163
- * Send text using basic CDP approach
164
- * @param {string} text - The text to send
165
- * @param {string} ide - The IDE name
166
- * @returns {Promise<Object>} Result object
167
- */
168
- async sendTextBasic(text, ide) {
169
- const textToSend = String(text).slice(0, 4000);
170
- const port = ide === 'cursor' ? 9225 : 9222;
171
-
172
- try {
173
- const targets = await this.timeout(5000, CDP.List({ port }));
174
- if (!targets || targets.length === 0) {
175
- return { success: false, error: `Could not find ${ide}. Make sure ${ide} is running with --remote-debugging-port=${port}` };
176
- }
177
-
178
- const workbench = targets.find(t => t.url && t.url.includes('workbench')) || targets[0];
179
- if (!workbench) return { success: false, error: `No ${ide} workbench target found.` };
180
-
181
- const client = await this.timeout(10000, CDP({ port, target: workbench }));
182
- const { Runtime, Input, Page } = client;
183
-
184
- await this.timeout(5000, Runtime.enable());
185
- await this.timeout(5000, Page.enable());
186
-
187
- if (Page && Page.bringToFront) {
188
- try {
189
- await this.timeout(3000, Page.bringToFront());
190
- } catch (error) {
191
- this.logger.log(`Bring to front failed: ${error.message}`);
192
- }
193
- }
194
-
195
- // Type the text character by character
196
- for (let i = 0; i < textToSend.length; i++) {
197
- const char = textToSend[i];
198
- await Input.dispatchKeyEvent({ type: 'keyDown', key: char, text: char });
199
- await Input.dispatchKeyEvent({ type: 'keyUp', key: char, text: char });
200
- await new Promise(resolve => setTimeout(resolve, 20));
201
- }
202
-
203
- // Press Enter to submit
204
- await Input.dispatchKeyEvent({ type: 'keyDown', key: 'Enter' });
205
- await Input.dispatchKeyEvent({ type: 'keyUp', key: 'Enter' });
206
-
207
- return {
208
- success: true,
209
- method: 'cdp-basic',
210
- message: `Message sent to ${ide}: ${text}`,
211
- note: 'Message sent via basic CDP approach'
212
- };
213
-
214
- } catch (error) {
215
- this.logger.error(`${ide} CDP error:`, error);
216
- return { success: false, error: `${ide} CDP error: ${error.message}` };
217
- }
218
- }
219
- }
220
-
221
- module.exports = { CDPManager };
1
+ // @vibecodingmachine/core - CDP Manager (CommonJS)
2
+ // Handles Chrome DevTools Protocol interactions with IDEs
3
+
4
+ const CDP = require('chrome-remote-interface');
5
+
6
+ /**
7
+ * CDP Manager for IDE interactions
8
+ * Handles Chrome DevTools Protocol-based text sending for IDEs like VS Code and Cursor
9
+ */
10
+ class CDPManager {
11
+ constructor() {
12
+ this.logger = console;
13
+ }
14
+
15
+ /**
16
+ * Timeout utility function
17
+ * @param {number} ms - Timeout in milliseconds
18
+ * @param {Promise} promise - Promise to timeout
19
+ * @returns {Promise} Promise with timeout
20
+ */
21
+ timeout(ms, promise) {
22
+ return Promise.race([
23
+ promise,
24
+ new Promise((_, reject) =>
25
+ setTimeout(() => reject(new Error(`Operation timed out after ${ms}ms`)), ms)
26
+ )
27
+ ]);
28
+ }
29
+
30
+ /**
31
+ * Send text to an IDE via CDP
32
+ * @param {string} text - The text to send
33
+ * @param {string} ide - The IDE name ('vscode', 'cursor')
34
+ * @returns {Promise<Object>} Result object with success status and details
35
+ */
36
+ async sendText(text, ide) {
37
+ if (typeof text !== 'string') {
38
+ return {
39
+ success: false,
40
+ error: `Invalid text type: ${typeof text}. Expected string.`,
41
+ debug: { textType: typeof text, textValue: text }
42
+ };
43
+ }
44
+
45
+ const ideName = ide === 'cursor' ? 'Cursor' : ide === 'vscode' ? 'VS Code' : 'Unknown IDE';
46
+ const port = ide === 'cursor' ? 9225 : 9222;
47
+
48
+ this.logger.log(`🔍 sendText: Starting debug session`);
49
+ this.logger.log(`📋 IDE: ${ideName} (${ide})`);
50
+ this.logger.log(`🔌 Port: ${port}`);
51
+ this.logger.log(`💬 Text: "${text.substring(0, 100)}${text.length > 100 ? '...' : ''}"`);
52
+
53
+ try {
54
+ // For VS Code, use the working approach from commit 6235f46b
55
+ if (ide === 'vscode') {
56
+ return await this.sendTextToVSCode(text);
57
+ }
58
+
59
+ // For other IDEs, use basic CDP approach
60
+ return await this.sendTextBasic(text, ide);
61
+ } catch (error) {
62
+ this.logger.error('CDP error:', error);
63
+ return {
64
+ success: false,
65
+ error: `CDP error: ${error.message}`,
66
+ debug: { ide, port, textLength: text.length }
67
+ };
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Send text to VS Code using the working approach
73
+ * @param {string} text - The text to send
74
+ * @returns {Promise<Object>} Result object
75
+ */
76
+ async sendTextToVSCode(text) {
77
+ try {
78
+ const targets = await CDP.List({ port: 9222 });
79
+ if (!targets || targets.length === 0) {
80
+ return { success: false, error: 'Could not find VS Code. Make sure VS Code is running with --remote-debugging-port=9222' };
81
+ }
82
+
83
+ const workbench = targets.find(t => t.url && t.url.includes('workbench')) || targets[0];
84
+ if (!workbench) return { success: false, error: 'No VS Code workbench target found.' };
85
+
86
+ this.logger.log(`Found ${targets.length} targets, using workbench: ${workbench.title}`);
87
+ const client = await CDP({ port: 9222, target: workbench });
88
+ const { Runtime, Input, Page, DOM } = client;
89
+ await Runtime.enable();
90
+ await DOM.enable();
91
+ if (Page && Page.bringToFront) { try { await Page.bringToFront(); } catch (_) {} }
92
+
93
+ // Use clipboard approach to avoid focus issues
94
+ const clipboardText = String(text).slice(0, 4000);
95
+ this.logger.log('Copying text to clipboard:', clipboardText);
96
+
97
+ // Try to paste the text after a short delay
98
+ setTimeout(async () => {
99
+ try {
100
+ const isDarwin = process.platform === 'darwin';
101
+ const pasteMods = isDarwin ? 4 /* Meta */ : 2 /* Ctrl */;
102
+ await Input.dispatchKeyEvent({ type: 'keyDown', key: 'v', text: 'v', modifiers: pasteMods });
103
+ await Input.dispatchKeyEvent({ type: 'keyUp', key: 'v', text: 'v', modifiers: pasteMods });
104
+ this.logger.log('Pasted text via Cmd+V');
105
+ } catch (e) {
106
+ this.logger.log('Paste failed:', e.message);
107
+ }
108
+ }, 200);
109
+
110
+ // Also try typing the text character by character
111
+ setTimeout(async () => {
112
+ try {
113
+ this.logger.log('Starting character-by-character typing...');
114
+ for (let i = 0; i < clipboardText.length; i++) {
115
+ const char = clipboardText[i];
116
+ await Input.dispatchKeyEvent({ type: 'keyDown', key: char, text: char });
117
+ await Input.dispatchKeyEvent({ type: 'keyUp', key: char, text: char });
118
+ await new Promise(resolve => setTimeout(resolve, 20));
119
+ }
120
+ this.logger.log('Finished character-by-character typing');
121
+
122
+ // Try multiple submission methods
123
+ setTimeout(async () => {
124
+ try {
125
+ this.logger.log('Attempting to submit message...');
126
+
127
+ // Method 1: Press Enter
128
+ await Input.dispatchKeyEvent({ type: 'keyDown', key: 'Enter' });
129
+ await Input.dispatchKeyEvent({ type: 'keyUp', key: 'Enter' });
130
+ await new Promise(resolve => setTimeout(resolve, 100));
131
+
132
+ // Method 2: Try Cmd+Enter
133
+ const isDarwin = process.platform === 'darwin';
134
+ const enterMods = isDarwin ? 4 /* Meta */ : 2 /* Ctrl */;
135
+ await Input.dispatchKeyEvent({ type: 'keyDown', key: 'Enter', text: 'Enter', modifiers: enterMods });
136
+ await Input.dispatchKeyEvent({ type: 'keyUp', key: 'Enter', text: 'Enter', modifiers: enterMods });
137
+
138
+ } catch (e) {
139
+ this.logger.log('Submission failed:', e.message);
140
+ }
141
+ }, 300);
142
+
143
+ } catch (e) {
144
+ this.logger.log('Character typing failed:', e.message);
145
+ }
146
+ }, 500);
147
+
148
+ this.logger.log(`Successfully sent message to VS Code via CDP`);
149
+ return {
150
+ success: true,
151
+ method: 'cdp-clipboard',
152
+ message: `Message sent to VS Code: ${text}`,
153
+ note: 'Message sent via CDP with clipboard approach'
154
+ };
155
+
156
+ } catch (error) {
157
+ this.logger.error('VS Code CDP error:', error);
158
+ return { success: false, error: `VS Code CDP error: ${error.message}` };
159
+ }
160
+ }
161
+
162
+ /**
163
+ * Send text using basic CDP approach
164
+ * @param {string} text - The text to send
165
+ * @param {string} ide - The IDE name
166
+ * @returns {Promise<Object>} Result object
167
+ */
168
+ async sendTextBasic(text, ide) {
169
+ const textToSend = String(text).slice(0, 4000);
170
+ const port = ide === 'cursor' ? 9225 : 9222;
171
+
172
+ try {
173
+ const targets = await this.timeout(5000, CDP.List({ port }));
174
+ if (!targets || targets.length === 0) {
175
+ return { success: false, error: `Could not find ${ide}. Make sure ${ide} is running with --remote-debugging-port=${port}` };
176
+ }
177
+
178
+ const workbench = targets.find(t => t.url && t.url.includes('workbench')) || targets[0];
179
+ if (!workbench) return { success: false, error: `No ${ide} workbench target found.` };
180
+
181
+ const client = await this.timeout(10000, CDP({ port, target: workbench }));
182
+ const { Runtime, Input, Page } = client;
183
+
184
+ await this.timeout(5000, Runtime.enable());
185
+ await this.timeout(5000, Page.enable());
186
+
187
+ if (Page && Page.bringToFront) {
188
+ try {
189
+ await this.timeout(3000, Page.bringToFront());
190
+ } catch (error) {
191
+ this.logger.log(`Bring to front failed: ${error.message}`);
192
+ }
193
+ }
194
+
195
+ // Type the text character by character
196
+ for (let i = 0; i < textToSend.length; i++) {
197
+ const char = textToSend[i];
198
+ await Input.dispatchKeyEvent({ type: 'keyDown', key: char, text: char });
199
+ await Input.dispatchKeyEvent({ type: 'keyUp', key: char, text: char });
200
+ await new Promise(resolve => setTimeout(resolve, 20));
201
+ }
202
+
203
+ // Press Enter to submit
204
+ await Input.dispatchKeyEvent({ type: 'keyDown', key: 'Enter' });
205
+ await Input.dispatchKeyEvent({ type: 'keyUp', key: 'Enter' });
206
+
207
+ return {
208
+ success: true,
209
+ method: 'cdp-basic',
210
+ message: `Message sent to ${ide}: ${text}`,
211
+ note: 'Message sent via basic CDP approach'
212
+ };
213
+
214
+ } catch (error) {
215
+ this.logger.error(`${ide} CDP error:`, error);
216
+ return { success: false, error: `${ide} CDP error: ${error.message}` };
217
+ }
218
+ }
219
+ }
220
+
221
+ module.exports = { CDPManager };