vibecodingmachine-core 1.0.2 → 2025.11.2-7.1239
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/.babelrc +13 -13
- package/README.md +28 -28
- package/__tests__/applescript-manager-claude-fix.test.js +286 -286
- package/__tests__/requirement-2-auto-start-looping.test.js +69 -69
- package/__tests__/requirement-3-auto-start-looping.test.js +69 -69
- package/__tests__/requirement-4-auto-start-looping.test.js +69 -69
- package/__tests__/requirement-6-auto-start-looping.test.js +73 -73
- package/__tests__/requirement-7-status-tracking.test.js +332 -332
- package/jest.config.js +18 -18
- package/jest.setup.js +12 -12
- package/package.json +48 -48
- package/src/auth/access-denied.html +119 -119
- package/src/auth/shared-auth-storage.js +230 -230
- package/src/autonomous-mode/feature-implementer.cjs +70 -70
- package/src/autonomous-mode/feature-implementer.js +425 -425
- package/src/chat-management/chat-manager.cjs +71 -71
- package/src/chat-management/chat-manager.js +342 -342
- package/src/ide-integration/__tests__/applescript-manager-thread-closure.test.js +227 -227
- package/src/ide-integration/aider-cli-manager.cjs +850 -850
- package/src/ide-integration/applescript-manager.cjs +1088 -1088
- package/src/ide-integration/applescript-manager.js +2802 -2802
- package/src/ide-integration/applescript-utils.js +306 -306
- package/src/ide-integration/cdp-manager.cjs +221 -221
- package/src/ide-integration/cdp-manager.js +321 -321
- package/src/ide-integration/claude-code-cli-manager.cjs +301 -301
- package/src/ide-integration/cline-cli-manager.cjs +2252 -2252
- package/src/ide-integration/continue-cli-manager.js +431 -431
- package/src/ide-integration/provider-manager.cjs +354 -354
- package/src/ide-integration/quota-detector.cjs +34 -34
- package/src/ide-integration/quota-detector.js +349 -349
- package/src/ide-integration/windows-automation-manager.js +262 -262
- package/src/index.cjs +47 -43
- package/src/index.js +17 -17
- package/src/llm/direct-llm-manager.cjs +609 -609
- package/src/ui/ButtonComponents.js +247 -247
- package/src/ui/ChatInterface.js +499 -499
- package/src/ui/StateManager.js +259 -259
- package/src/utils/audit-logger.cjs +116 -116
- package/src/utils/config-helpers.cjs +94 -94
- package/src/utils/config-helpers.js +94 -94
- package/src/utils/electron-update-checker.js +113 -85
- package/src/utils/gcloud-auth.cjs +394 -394
- package/src/utils/logger.cjs +193 -193
- package/src/utils/logger.js +191 -191
- package/src/utils/repo-helpers.cjs +120 -120
- package/src/utils/repo-helpers.js +120 -120
- package/src/utils/requirement-helpers.js +432 -432
- package/src/utils/update-checker.js +227 -167
- package/src/utils/version-checker.js +169 -0
|
@@ -1,230 +1,230 @@
|
|
|
1
|
-
const os = require('os');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const fs = require('fs-extra');
|
|
4
|
-
|
|
5
|
-
const CONFIG_DIR = path.join(os.homedir(), '.config', 'vibecodingmachine');
|
|
6
|
-
const TOKEN_FILE = path.join(CONFIG_DIR, 'token.json');
|
|
7
|
-
const PROFILE_FILE = path.join(CONFIG_DIR, 'profile.json');
|
|
8
|
-
const USAGE_FILE = path.join(CONFIG_DIR, 'usage.json');
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Shared authentication storage for both CLI and Electron
|
|
12
|
-
* Stores tokens and profiles in ~/.config/vibecodingmachine/
|
|
13
|
-
*/
|
|
14
|
-
class SharedAuthStorage {
|
|
15
|
-
/**
|
|
16
|
-
* Decode JWT token (simple base64 decode, no verification)
|
|
17
|
-
*/
|
|
18
|
-
decodeJWT(token) {
|
|
19
|
-
const parts = token.split('.');
|
|
20
|
-
if (parts.length !== 3) throw new Error('Invalid JWT');
|
|
21
|
-
|
|
22
|
-
const payload = Buffer.from(parts[1], 'base64').toString('utf8');
|
|
23
|
-
return JSON.parse(payload);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Check if authenticated
|
|
28
|
-
*/
|
|
29
|
-
async isAuthenticated() {
|
|
30
|
-
const token = await this.getToken();
|
|
31
|
-
if (!token) return false;
|
|
32
|
-
|
|
33
|
-
try {
|
|
34
|
-
// Decode JWT to check expiration
|
|
35
|
-
const payload = this.decodeJWT(token);
|
|
36
|
-
const now = Math.floor(Date.now() / 1000);
|
|
37
|
-
|
|
38
|
-
if (payload.exp && payload.exp > now) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
} catch (error) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Get stored token
|
|
50
|
-
*/
|
|
51
|
-
async getToken() {
|
|
52
|
-
try {
|
|
53
|
-
if (await fs.pathExists(TOKEN_FILE)) {
|
|
54
|
-
const data = await fs.readJson(TOKEN_FILE);
|
|
55
|
-
return data.token;
|
|
56
|
-
}
|
|
57
|
-
} catch (error) {
|
|
58
|
-
console.error('Failed to read token:', error);
|
|
59
|
-
}
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Save token
|
|
65
|
-
*/
|
|
66
|
-
async saveToken(token) {
|
|
67
|
-
await fs.ensureDir(CONFIG_DIR);
|
|
68
|
-
await fs.writeJson(TOKEN_FILE, { token }, { spaces: 2 });
|
|
69
|
-
|
|
70
|
-
// Also save user profile from token
|
|
71
|
-
try {
|
|
72
|
-
const payload = this.decodeJWT(token);
|
|
73
|
-
const email = payload.email;
|
|
74
|
-
|
|
75
|
-
// Note: Beta access control is handled server-side by Cognito Pre-Auth Lambda
|
|
76
|
-
// If we reached here, the user has already passed beta allowlist check
|
|
77
|
-
|
|
78
|
-
const profile = {
|
|
79
|
-
userId: payload.sub,
|
|
80
|
-
email: email,
|
|
81
|
-
name: payload.name || email,
|
|
82
|
-
picture: payload.picture,
|
|
83
|
-
tier: 'free', // Default, will be updated later
|
|
84
|
-
maxIterations: 10
|
|
85
|
-
};
|
|
86
|
-
await this.saveUserProfile(profile);
|
|
87
|
-
} catch (error) {
|
|
88
|
-
console.error('Failed to save user profile:', error);
|
|
89
|
-
throw error;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Delete token
|
|
95
|
-
*/
|
|
96
|
-
async deleteToken() {
|
|
97
|
-
if (await fs.pathExists(TOKEN_FILE)) {
|
|
98
|
-
await fs.remove(TOKEN_FILE);
|
|
99
|
-
}
|
|
100
|
-
if (await fs.pathExists(PROFILE_FILE)) {
|
|
101
|
-
await fs.remove(PROFILE_FILE);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Get user profile
|
|
107
|
-
*/
|
|
108
|
-
async getUserProfile() {
|
|
109
|
-
try {
|
|
110
|
-
if (await fs.pathExists(PROFILE_FILE)) {
|
|
111
|
-
return await fs.readJson(PROFILE_FILE);
|
|
112
|
-
}
|
|
113
|
-
} catch (error) {
|
|
114
|
-
console.error('Failed to read profile:', error);
|
|
115
|
-
}
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Save user profile
|
|
121
|
-
*/
|
|
122
|
-
async saveUserProfile(profile) {
|
|
123
|
-
await fs.ensureDir(CONFIG_DIR);
|
|
124
|
-
await fs.writeJson(PROFILE_FILE, profile, { spaces: 2 });
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Check if user can run auto mode (quota check)
|
|
129
|
-
*/
|
|
130
|
-
async canRunAutoMode() {
|
|
131
|
-
const token = await this.getToken();
|
|
132
|
-
if (!token) {
|
|
133
|
-
return { canRun: false, reason: 'Not authenticated' };
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const profile = await this.getUserProfile();
|
|
137
|
-
if (!profile) {
|
|
138
|
-
return { canRun: false, reason: 'No user profile found' };
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// Get today's usage from local tracking
|
|
142
|
-
const today = new Date().toISOString().split('T')[0];
|
|
143
|
-
let usage = 0;
|
|
144
|
-
try {
|
|
145
|
-
if (await fs.pathExists(USAGE_FILE)) {
|
|
146
|
-
const usageData = await fs.readJson(USAGE_FILE);
|
|
147
|
-
usage = usageData[today] || 0;
|
|
148
|
-
}
|
|
149
|
-
} catch (error) {
|
|
150
|
-
console.error('Error reading usage:', error);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// Check if user can run based on tier
|
|
154
|
-
const isPremium = profile.tier === 'premium';
|
|
155
|
-
const maxIterations = isPremium ? 999999 : (profile.maxIterations || 10);
|
|
156
|
-
|
|
157
|
-
if (!isPremium && usage >= maxIterations) {
|
|
158
|
-
return {
|
|
159
|
-
canRun: false,
|
|
160
|
-
reason: `Daily limit reached (${usage}/${maxIterations})`,
|
|
161
|
-
tier: profile.tier,
|
|
162
|
-
todayUsage: usage,
|
|
163
|
-
maxIterations: maxIterations
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
return {
|
|
168
|
-
canRun: true,
|
|
169
|
-
tier: profile.tier,
|
|
170
|
-
features: {
|
|
171
|
-
unlimitedIterations: isPremium,
|
|
172
|
-
cloudSync: isPremium,
|
|
173
|
-
mobileApp: isPremium
|
|
174
|
-
},
|
|
175
|
-
todayUsage: usage,
|
|
176
|
-
maxIterations: maxIterations
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Log iteration (for quota tracking)
|
|
182
|
-
*/
|
|
183
|
-
async logIteration() {
|
|
184
|
-
const today = new Date().toISOString().split('T')[0];
|
|
185
|
-
|
|
186
|
-
try {
|
|
187
|
-
await fs.ensureDir(CONFIG_DIR);
|
|
188
|
-
|
|
189
|
-
let usageData = {};
|
|
190
|
-
if (await fs.pathExists(USAGE_FILE)) {
|
|
191
|
-
usageData = await fs.readJson(USAGE_FILE);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
usageData[today] = (usageData[today] || 0) + 1;
|
|
195
|
-
|
|
196
|
-
await fs.writeJson(USAGE_FILE, usageData, { spaces: 2 });
|
|
197
|
-
return true;
|
|
198
|
-
} catch (error) {
|
|
199
|
-
console.error('Error logging iteration:', error);
|
|
200
|
-
return false;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Activate license key
|
|
206
|
-
*/
|
|
207
|
-
async activateLicense(licenseKey) {
|
|
208
|
-
// TODO: Call backend API to validate and activate license
|
|
209
|
-
// For now, just upgrade to premium locally
|
|
210
|
-
const profile = await this.getUserProfile();
|
|
211
|
-
if (profile) {
|
|
212
|
-
profile.tier = 'premium';
|
|
213
|
-
profile.maxIterations = 999999;
|
|
214
|
-
profile.licenseKey = licenseKey;
|
|
215
|
-
await this.saveUserProfile(profile);
|
|
216
|
-
return { success: true, tier: 'premium' };
|
|
217
|
-
}
|
|
218
|
-
return { success: false, error: 'Not authenticated' };
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Logout
|
|
223
|
-
*/
|
|
224
|
-
async logout() {
|
|
225
|
-
await this.deleteToken();
|
|
226
|
-
return true;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
module.exports = new SharedAuthStorage();
|
|
1
|
+
const os = require('os');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const fs = require('fs-extra');
|
|
4
|
+
|
|
5
|
+
const CONFIG_DIR = path.join(os.homedir(), '.config', 'vibecodingmachine');
|
|
6
|
+
const TOKEN_FILE = path.join(CONFIG_DIR, 'token.json');
|
|
7
|
+
const PROFILE_FILE = path.join(CONFIG_DIR, 'profile.json');
|
|
8
|
+
const USAGE_FILE = path.join(CONFIG_DIR, 'usage.json');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Shared authentication storage for both CLI and Electron
|
|
12
|
+
* Stores tokens and profiles in ~/.config/vibecodingmachine/
|
|
13
|
+
*/
|
|
14
|
+
class SharedAuthStorage {
|
|
15
|
+
/**
|
|
16
|
+
* Decode JWT token (simple base64 decode, no verification)
|
|
17
|
+
*/
|
|
18
|
+
decodeJWT(token) {
|
|
19
|
+
const parts = token.split('.');
|
|
20
|
+
if (parts.length !== 3) throw new Error('Invalid JWT');
|
|
21
|
+
|
|
22
|
+
const payload = Buffer.from(parts[1], 'base64').toString('utf8');
|
|
23
|
+
return JSON.parse(payload);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Check if authenticated
|
|
28
|
+
*/
|
|
29
|
+
async isAuthenticated() {
|
|
30
|
+
const token = await this.getToken();
|
|
31
|
+
if (!token) return false;
|
|
32
|
+
|
|
33
|
+
try {
|
|
34
|
+
// Decode JWT to check expiration
|
|
35
|
+
const payload = this.decodeJWT(token);
|
|
36
|
+
const now = Math.floor(Date.now() / 1000);
|
|
37
|
+
|
|
38
|
+
if (payload.exp && payload.exp > now) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
} catch (error) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get stored token
|
|
50
|
+
*/
|
|
51
|
+
async getToken() {
|
|
52
|
+
try {
|
|
53
|
+
if (await fs.pathExists(TOKEN_FILE)) {
|
|
54
|
+
const data = await fs.readJson(TOKEN_FILE);
|
|
55
|
+
return data.token;
|
|
56
|
+
}
|
|
57
|
+
} catch (error) {
|
|
58
|
+
console.error('Failed to read token:', error);
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Save token
|
|
65
|
+
*/
|
|
66
|
+
async saveToken(token) {
|
|
67
|
+
await fs.ensureDir(CONFIG_DIR);
|
|
68
|
+
await fs.writeJson(TOKEN_FILE, { token }, { spaces: 2 });
|
|
69
|
+
|
|
70
|
+
// Also save user profile from token
|
|
71
|
+
try {
|
|
72
|
+
const payload = this.decodeJWT(token);
|
|
73
|
+
const email = payload.email;
|
|
74
|
+
|
|
75
|
+
// Note: Beta access control is handled server-side by Cognito Pre-Auth Lambda
|
|
76
|
+
// If we reached here, the user has already passed beta allowlist check
|
|
77
|
+
|
|
78
|
+
const profile = {
|
|
79
|
+
userId: payload.sub,
|
|
80
|
+
email: email,
|
|
81
|
+
name: payload.name || email,
|
|
82
|
+
picture: payload.picture,
|
|
83
|
+
tier: 'free', // Default, will be updated later
|
|
84
|
+
maxIterations: 10
|
|
85
|
+
};
|
|
86
|
+
await this.saveUserProfile(profile);
|
|
87
|
+
} catch (error) {
|
|
88
|
+
console.error('Failed to save user profile:', error);
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Delete token
|
|
95
|
+
*/
|
|
96
|
+
async deleteToken() {
|
|
97
|
+
if (await fs.pathExists(TOKEN_FILE)) {
|
|
98
|
+
await fs.remove(TOKEN_FILE);
|
|
99
|
+
}
|
|
100
|
+
if (await fs.pathExists(PROFILE_FILE)) {
|
|
101
|
+
await fs.remove(PROFILE_FILE);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Get user profile
|
|
107
|
+
*/
|
|
108
|
+
async getUserProfile() {
|
|
109
|
+
try {
|
|
110
|
+
if (await fs.pathExists(PROFILE_FILE)) {
|
|
111
|
+
return await fs.readJson(PROFILE_FILE);
|
|
112
|
+
}
|
|
113
|
+
} catch (error) {
|
|
114
|
+
console.error('Failed to read profile:', error);
|
|
115
|
+
}
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Save user profile
|
|
121
|
+
*/
|
|
122
|
+
async saveUserProfile(profile) {
|
|
123
|
+
await fs.ensureDir(CONFIG_DIR);
|
|
124
|
+
await fs.writeJson(PROFILE_FILE, profile, { spaces: 2 });
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Check if user can run auto mode (quota check)
|
|
129
|
+
*/
|
|
130
|
+
async canRunAutoMode() {
|
|
131
|
+
const token = await this.getToken();
|
|
132
|
+
if (!token) {
|
|
133
|
+
return { canRun: false, reason: 'Not authenticated' };
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const profile = await this.getUserProfile();
|
|
137
|
+
if (!profile) {
|
|
138
|
+
return { canRun: false, reason: 'No user profile found' };
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Get today's usage from local tracking
|
|
142
|
+
const today = new Date().toISOString().split('T')[0];
|
|
143
|
+
let usage = 0;
|
|
144
|
+
try {
|
|
145
|
+
if (await fs.pathExists(USAGE_FILE)) {
|
|
146
|
+
const usageData = await fs.readJson(USAGE_FILE);
|
|
147
|
+
usage = usageData[today] || 0;
|
|
148
|
+
}
|
|
149
|
+
} catch (error) {
|
|
150
|
+
console.error('Error reading usage:', error);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Check if user can run based on tier
|
|
154
|
+
const isPremium = profile.tier === 'premium';
|
|
155
|
+
const maxIterations = isPremium ? 999999 : (profile.maxIterations || 10);
|
|
156
|
+
|
|
157
|
+
if (!isPremium && usage >= maxIterations) {
|
|
158
|
+
return {
|
|
159
|
+
canRun: false,
|
|
160
|
+
reason: `Daily limit reached (${usage}/${maxIterations})`,
|
|
161
|
+
tier: profile.tier,
|
|
162
|
+
todayUsage: usage,
|
|
163
|
+
maxIterations: maxIterations
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return {
|
|
168
|
+
canRun: true,
|
|
169
|
+
tier: profile.tier,
|
|
170
|
+
features: {
|
|
171
|
+
unlimitedIterations: isPremium,
|
|
172
|
+
cloudSync: isPremium,
|
|
173
|
+
mobileApp: isPremium
|
|
174
|
+
},
|
|
175
|
+
todayUsage: usage,
|
|
176
|
+
maxIterations: maxIterations
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Log iteration (for quota tracking)
|
|
182
|
+
*/
|
|
183
|
+
async logIteration() {
|
|
184
|
+
const today = new Date().toISOString().split('T')[0];
|
|
185
|
+
|
|
186
|
+
try {
|
|
187
|
+
await fs.ensureDir(CONFIG_DIR);
|
|
188
|
+
|
|
189
|
+
let usageData = {};
|
|
190
|
+
if (await fs.pathExists(USAGE_FILE)) {
|
|
191
|
+
usageData = await fs.readJson(USAGE_FILE);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
usageData[today] = (usageData[today] || 0) + 1;
|
|
195
|
+
|
|
196
|
+
await fs.writeJson(USAGE_FILE, usageData, { spaces: 2 });
|
|
197
|
+
return true;
|
|
198
|
+
} catch (error) {
|
|
199
|
+
console.error('Error logging iteration:', error);
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Activate license key
|
|
206
|
+
*/
|
|
207
|
+
async activateLicense(licenseKey) {
|
|
208
|
+
// TODO: Call backend API to validate and activate license
|
|
209
|
+
// For now, just upgrade to premium locally
|
|
210
|
+
const profile = await this.getUserProfile();
|
|
211
|
+
if (profile) {
|
|
212
|
+
profile.tier = 'premium';
|
|
213
|
+
profile.maxIterations = 999999;
|
|
214
|
+
profile.licenseKey = licenseKey;
|
|
215
|
+
await this.saveUserProfile(profile);
|
|
216
|
+
return { success: true, tier: 'premium' };
|
|
217
|
+
}
|
|
218
|
+
return { success: false, error: 'Not authenticated' };
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Logout
|
|
223
|
+
*/
|
|
224
|
+
async logout() {
|
|
225
|
+
await this.deleteToken();
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
module.exports = new SharedAuthStorage();
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
// @vibecodingmachine/core - Feature Implementer (CommonJS) - Stub
|
|
2
|
-
// Handles autonomous mode feature implementation and development workflow
|
|
3
|
-
|
|
4
|
-
class FeatureImplementer {
|
|
5
|
-
constructor(options = {}) {
|
|
6
|
-
this.logger = options.logger || console;
|
|
7
|
-
this.electronAPI = options.electronAPI || null;
|
|
8
|
-
this.onStatusUpdate = options.onStatusUpdate || (() => {});
|
|
9
|
-
this.onProgressUpdate = options.onProgressUpdate || (() => {});
|
|
10
|
-
this.onMessageUpdate = options.onMessageUpdate || (() => {});
|
|
11
|
-
this.onErrorUpdate = options.onErrorUpdate || (() => {});
|
|
12
|
-
this.onCompleteUpdate = options.onCompleteUpdate || (() => {});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
async startAutonomousMode(ide, tabId) {
|
|
16
|
-
this.logger.log('startAutonomousMode stub called for:', ide, tabId);
|
|
17
|
-
return {
|
|
18
|
-
success: true,
|
|
19
|
-
progress: 0,
|
|
20
|
-
completed: false,
|
|
21
|
-
taskCount: 0
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
stopAutonomousMode() {
|
|
26
|
-
this.logger.log('stopAutonomousMode stub');
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
pauseAutonomousMode() {
|
|
30
|
-
this.logger.log('pauseAutonomousMode stub');
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
resumeAutonomousMode() {
|
|
34
|
-
this.logger.log('resumeAutonomousMode stub');
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
getState() {
|
|
38
|
-
return {
|
|
39
|
-
isAutonomousMode: false,
|
|
40
|
-
isPaused: false,
|
|
41
|
-
isStopped: false,
|
|
42
|
-
currentProgress: 0,
|
|
43
|
-
taskCount: 0
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
setElectronAPI(electronAPI) {
|
|
48
|
-
this.electronAPI = electronAPI;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
setCallbacks(callbacks) {
|
|
52
|
-
if (callbacks.onStatusUpdate) {
|
|
53
|
-
this.onStatusUpdate = callbacks.onStatusUpdate;
|
|
54
|
-
}
|
|
55
|
-
if (callbacks.onProgressUpdate) {
|
|
56
|
-
this.onProgressUpdate = callbacks.onProgressUpdate;
|
|
57
|
-
}
|
|
58
|
-
if (callbacks.onMessageUpdate) {
|
|
59
|
-
this.onMessageUpdate = callbacks.onMessageUpdate;
|
|
60
|
-
}
|
|
61
|
-
if (callbacks.onErrorUpdate) {
|
|
62
|
-
this.onErrorUpdate = callbacks.onErrorUpdate;
|
|
63
|
-
}
|
|
64
|
-
if (callbacks.onCompleteUpdate) {
|
|
65
|
-
this.onCompleteUpdate = callbacks.onCompleteUpdate;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
module.exports = { FeatureImplementer };
|
|
1
|
+
// @vibecodingmachine/core - Feature Implementer (CommonJS) - Stub
|
|
2
|
+
// Handles autonomous mode feature implementation and development workflow
|
|
3
|
+
|
|
4
|
+
class FeatureImplementer {
|
|
5
|
+
constructor(options = {}) {
|
|
6
|
+
this.logger = options.logger || console;
|
|
7
|
+
this.electronAPI = options.electronAPI || null;
|
|
8
|
+
this.onStatusUpdate = options.onStatusUpdate || (() => {});
|
|
9
|
+
this.onProgressUpdate = options.onProgressUpdate || (() => {});
|
|
10
|
+
this.onMessageUpdate = options.onMessageUpdate || (() => {});
|
|
11
|
+
this.onErrorUpdate = options.onErrorUpdate || (() => {});
|
|
12
|
+
this.onCompleteUpdate = options.onCompleteUpdate || (() => {});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async startAutonomousMode(ide, tabId) {
|
|
16
|
+
this.logger.log('startAutonomousMode stub called for:', ide, tabId);
|
|
17
|
+
return {
|
|
18
|
+
success: true,
|
|
19
|
+
progress: 0,
|
|
20
|
+
completed: false,
|
|
21
|
+
taskCount: 0
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
stopAutonomousMode() {
|
|
26
|
+
this.logger.log('stopAutonomousMode stub');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
pauseAutonomousMode() {
|
|
30
|
+
this.logger.log('pauseAutonomousMode stub');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
resumeAutonomousMode() {
|
|
34
|
+
this.logger.log('resumeAutonomousMode stub');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
getState() {
|
|
38
|
+
return {
|
|
39
|
+
isAutonomousMode: false,
|
|
40
|
+
isPaused: false,
|
|
41
|
+
isStopped: false,
|
|
42
|
+
currentProgress: 0,
|
|
43
|
+
taskCount: 0
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
setElectronAPI(electronAPI) {
|
|
48
|
+
this.electronAPI = electronAPI;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
setCallbacks(callbacks) {
|
|
52
|
+
if (callbacks.onStatusUpdate) {
|
|
53
|
+
this.onStatusUpdate = callbacks.onStatusUpdate;
|
|
54
|
+
}
|
|
55
|
+
if (callbacks.onProgressUpdate) {
|
|
56
|
+
this.onProgressUpdate = callbacks.onProgressUpdate;
|
|
57
|
+
}
|
|
58
|
+
if (callbacks.onMessageUpdate) {
|
|
59
|
+
this.onMessageUpdate = callbacks.onMessageUpdate;
|
|
60
|
+
}
|
|
61
|
+
if (callbacks.onErrorUpdate) {
|
|
62
|
+
this.onErrorUpdate = callbacks.onErrorUpdate;
|
|
63
|
+
}
|
|
64
|
+
if (callbacks.onCompleteUpdate) {
|
|
65
|
+
this.onCompleteUpdate = callbacks.onCompleteUpdate;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
module.exports = { FeatureImplementer };
|