vibecodingmachine-core 2025.12.6-1702 โ 2025.12.22-2230
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/package.json +1 -1
- package/scripts/setup-database.js +108 -0
- package/src/compliance/compliance-manager.js +249 -0
- package/src/compliance/compliance-prompt.js +183 -0
- package/src/database/migrations.js +289 -0
- package/src/database/user-database-client.js +266 -0
- package/src/database/user-schema.js +118 -0
- package/src/ide-integration/applescript-manager.cjs +73 -127
- package/src/ide-integration/applescript-manager.js +62 -12
- package/src/ide-integration/claude-code-cli-manager.cjs +120 -1
- package/src/ide-integration/provider-manager.cjs +67 -1
- package/src/index.js +4 -0
- package/src/llm/direct-llm-manager.cjs +110 -73
- package/src/quota-management/index.js +108 -0
- package/src/sync/sync-engine.js +32 -10
- package/src/utils/download-with-progress.js +92 -0
- package/src/utils/electron-update-checker.js +7 -0
- package/src/utils/env-helpers.js +54 -0
- package/src/utils/requirement-helpers.js +745 -49
- package/src/utils/requirements-parser.js +21 -7
- package/src/utils/update-checker.js +7 -0
- package/test-quota-system.js +67 -0
- package/test-requirement-stats.js +66 -0
|
@@ -14,6 +14,7 @@ function parseRequirementsFile(content) {
|
|
|
14
14
|
const needInformation = [];
|
|
15
15
|
const changelog = [];
|
|
16
16
|
const verified = [];
|
|
17
|
+
const current = [];
|
|
17
18
|
|
|
18
19
|
let currentSection = '';
|
|
19
20
|
let inSection = false;
|
|
@@ -33,7 +34,8 @@ function parseRequirementsFile(content) {
|
|
|
33
34
|
],
|
|
34
35
|
verified: ['๐ VERIFIED', 'VERIFIED'],
|
|
35
36
|
changelog: ['CHANGELOG'],
|
|
36
|
-
needInformation: ['โ Requirements needing', 'Requirements needing', 'needing manual feedback', 'needing information']
|
|
37
|
+
needInformation: ['โ Requirements needing', 'Requirements needing', 'needing manual feedback', 'needing information'],
|
|
38
|
+
current: ['๐จ Current In Progress Requirement', 'Current In Progress Requirement']
|
|
37
39
|
};
|
|
38
40
|
|
|
39
41
|
for (let i = 0; i < lines.length; i++) {
|
|
@@ -70,6 +72,10 @@ function parseRequirementsFile(content) {
|
|
|
70
72
|
currentSection = 'needInformation';
|
|
71
73
|
inSection = true;
|
|
72
74
|
continue;
|
|
75
|
+
} else if (sectionPatterns.current.some(pattern => trimmed.includes(pattern))) {
|
|
76
|
+
currentSection = 'current';
|
|
77
|
+
inSection = true;
|
|
78
|
+
continue;
|
|
73
79
|
} else {
|
|
74
80
|
// Different section header - exit current section
|
|
75
81
|
if (inSection) {
|
|
@@ -80,7 +86,7 @@ function parseRequirementsFile(content) {
|
|
|
80
86
|
const isRecycledSection = trimmed === '## โป๏ธ RECYCLED' || trimmed.startsWith('## โป๏ธ RECYCLED') ||
|
|
81
87
|
trimmed === '## ๐ฆ RECYCLED' || trimmed.startsWith('## ๐ฆ RECYCLED');
|
|
82
88
|
const isClarificationSection = trimmed.includes('## โ Requirements needing') || trimmed.includes('โ Requirements needing');
|
|
83
|
-
|
|
89
|
+
|
|
84
90
|
if (isVerifiedSection || isTodoSection || isRecycledSection || isClarificationSection) {
|
|
85
91
|
inSection = false;
|
|
86
92
|
currentSection = '';
|
|
@@ -113,16 +119,16 @@ function parseRequirementsFile(content) {
|
|
|
113
119
|
// Read package, description, and options
|
|
114
120
|
for (let j = i + 1; j < lines.length; j++) {
|
|
115
121
|
const nextLine = lines[j].trim();
|
|
116
|
-
|
|
122
|
+
|
|
117
123
|
// Stop if we hit another requirement or section
|
|
118
124
|
if (nextLine.startsWith('###') || (nextLine.startsWith('##') && !nextLine.startsWith('###'))) {
|
|
119
125
|
break;
|
|
120
126
|
}
|
|
121
|
-
|
|
127
|
+
|
|
122
128
|
// Check for PACKAGE line
|
|
123
129
|
if (nextLine.startsWith('PACKAGE:')) {
|
|
124
130
|
package = nextLine.replace(/^PACKAGE:\s*/, '').trim();
|
|
125
|
-
}
|
|
131
|
+
}
|
|
126
132
|
// Check for OPTIONS line (for need information requirements)
|
|
127
133
|
else if (nextLine.startsWith('OPTIONS:')) {
|
|
128
134
|
optionsType = 'checkbox'; // default
|
|
@@ -160,6 +166,8 @@ function parseRequirementsFile(content) {
|
|
|
160
166
|
changelog.push(requirement);
|
|
161
167
|
} else if (currentSection === 'verified') {
|
|
162
168
|
verified.push(requirement);
|
|
169
|
+
} else if (currentSection === 'current') {
|
|
170
|
+
current.push(requirement);
|
|
163
171
|
}
|
|
164
172
|
}
|
|
165
173
|
|
|
@@ -205,7 +213,8 @@ function parseRequirementsFile(content) {
|
|
|
205
213
|
completed,
|
|
206
214
|
needInformation,
|
|
207
215
|
changelog,
|
|
208
|
-
verified
|
|
216
|
+
verified,
|
|
217
|
+
current
|
|
209
218
|
};
|
|
210
219
|
}
|
|
211
220
|
|
|
@@ -276,7 +285,8 @@ async function loadRequirementsFromFile(reqPath, repoPath = null) {
|
|
|
276
285
|
completed: [],
|
|
277
286
|
needInformation: [],
|
|
278
287
|
changelog: [],
|
|
279
|
-
verified: []
|
|
288
|
+
verified: [],
|
|
289
|
+
current: []
|
|
280
290
|
};
|
|
281
291
|
|
|
282
292
|
if (await fs.pathExists(reqPath)) {
|
|
@@ -308,3 +318,7 @@ module.exports = {
|
|
|
308
318
|
|
|
309
319
|
|
|
310
320
|
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const https = require('https');
|
|
2
2
|
const fs = require('fs');
|
|
3
3
|
const path = require('path');
|
|
4
|
+
const { shouldCheckUpdates } = require('./env-helpers');
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Check for updates from npm registry
|
|
@@ -9,6 +10,9 @@ const path = require('path');
|
|
|
9
10
|
* @returns {Promise<Object>} Update info or null if no update available
|
|
10
11
|
*/
|
|
11
12
|
async function checkForUpdates(packageName, currentVersion) {
|
|
13
|
+
if (!shouldCheckUpdates()) {
|
|
14
|
+
return { hasUpdate: false, currentVersion };
|
|
15
|
+
}
|
|
12
16
|
return new Promise((resolve, reject) => {
|
|
13
17
|
const registryUrl = `https://registry.npmjs.org/${packageName}`;
|
|
14
18
|
|
|
@@ -80,6 +84,9 @@ function isVersionNewer(version1, version2) {
|
|
|
80
84
|
* @returns {Promise<Object>} Update info or null if no update available
|
|
81
85
|
*/
|
|
82
86
|
async function checkForCLIUpdates(currentVersion) {
|
|
87
|
+
if (!shouldCheckUpdates()) {
|
|
88
|
+
return { hasUpdate: false, currentVersion };
|
|
89
|
+
}
|
|
83
90
|
return new Promise((resolve, reject) => {
|
|
84
91
|
const manifestUrl = `https://d3fh7zgi8horze.cloudfront.net/downloads/version.json?t=${Date.now()}`;
|
|
85
92
|
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const { fetchQuotaForAgent } = require('./src/quota-management/index.js');
|
|
2
|
+
const sharedAuth = require('./src/auth/shared-auth-storage');
|
|
3
|
+
const ProviderManager = require('./src/ide-integration/provider-manager.cjs');
|
|
4
|
+
|
|
5
|
+
async function testQuotaSystem() {
|
|
6
|
+
console.log('๐งช Starting Quota System Verification Test...');
|
|
7
|
+
|
|
8
|
+
// 1. Test Global Iterations Quota
|
|
9
|
+
console.log('\n--- Test 1: Global Iterations ---');
|
|
10
|
+
// Mock sharedAuth.canRunAutoMode
|
|
11
|
+
const originalCanRun = sharedAuth.canRunAutoMode;
|
|
12
|
+
sharedAuth.canRunAutoMode = async () => ({
|
|
13
|
+
canRun: true,
|
|
14
|
+
todayUsage: 4,
|
|
15
|
+
maxIterations: 10
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
const globalQuota = await fetchQuotaForAgent('global:iterations');
|
|
20
|
+
console.log('Global Quota Type:', globalQuota.type);
|
|
21
|
+
console.log('Global Remaining:', globalQuota.remaining);
|
|
22
|
+
console.log('Global Limit:', globalQuota.limit);
|
|
23
|
+
if (globalQuota.remaining === 6 && globalQuota.type === 'global') {
|
|
24
|
+
console.log('โ
Global iterations test passed');
|
|
25
|
+
} else {
|
|
26
|
+
console.log('โ Global iterations test failed');
|
|
27
|
+
}
|
|
28
|
+
} catch (error) {
|
|
29
|
+
console.error('โ Global iterations test error:', error);
|
|
30
|
+
} finally {
|
|
31
|
+
sharedAuth.canRunAutoMode = originalCanRun;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// 2. Test Local Agent (Infinite)
|
|
35
|
+
console.log('\n--- Test 2: Local Agent (Infinite) ---');
|
|
36
|
+
try {
|
|
37
|
+
const localQuota = await fetchQuotaForAgent('local-ollama:qwen2.5');
|
|
38
|
+
console.log('Local Quota Type:', localQuota.type);
|
|
39
|
+
console.log('Local Remaining:', localQuota.remaining);
|
|
40
|
+
if (localQuota.remaining === Infinity && localQuota.type === 'infinite') {
|
|
41
|
+
console.log('โ
Local agent test passed');
|
|
42
|
+
} else {
|
|
43
|
+
console.log('โ Local agent test failed');
|
|
44
|
+
}
|
|
45
|
+
} catch (error) {
|
|
46
|
+
console.error('โ Local agent test error:', error);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// 3. Test Provider Rate Limit
|
|
50
|
+
console.log('\n--- Test 3: Provider Rate Limit ---');
|
|
51
|
+
try {
|
|
52
|
+
const providerQuota = await fetchQuotaForAgent('anthropic:claude-3');
|
|
53
|
+
console.log('Provider Quota Type:', providerQuota.type);
|
|
54
|
+
console.log('Provider Available (Remaining > 0):', providerQuota.remaining > 0);
|
|
55
|
+
if (providerQuota.type === 'rate-limit') {
|
|
56
|
+
console.log('โ
Provider rate limit test passed');
|
|
57
|
+
} else {
|
|
58
|
+
console.log('โ Provider rate limit test failed');
|
|
59
|
+
}
|
|
60
|
+
} catch (error) {
|
|
61
|
+
console.error('โ Provider rate limit test error:', error);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
console.log('\n๐ Quota System Verification Finished.');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
testQuotaSystem().catch(console.error);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const fs = require('fs-extra');
|
|
3
|
+
const os = require('os');
|
|
4
|
+
const { getProjectRequirementStats } = require('./src/utils/requirement-helpers');
|
|
5
|
+
|
|
6
|
+
async function testStats() {
|
|
7
|
+
const testRepo = path.join(os.tmpdir(), 'vbc-test-stats-repo');
|
|
8
|
+
const hostname = os.hostname();
|
|
9
|
+
const vibecodingmachineDir = path.join(testRepo, '.vibecodingmachine');
|
|
10
|
+
const reqPath = path.join(vibecodingmachineDir, `REQUIREMENTS-${hostname}.md`);
|
|
11
|
+
const changelogPath = path.join(testRepo, 'CHANGELOG.md');
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
await fs.ensureDir(vibecodingmachineDir);
|
|
15
|
+
|
|
16
|
+
const reqContent = `# Requirements
|
|
17
|
+
## โณ Requirements not yet completed
|
|
18
|
+
### Req 1
|
|
19
|
+
Details 1
|
|
20
|
+
### Req 2
|
|
21
|
+
Details 2
|
|
22
|
+
|
|
23
|
+
## โ
Verified by AI screenshot
|
|
24
|
+
### Req 3
|
|
25
|
+
Details 3
|
|
26
|
+
`;
|
|
27
|
+
await fs.writeFile(reqPath, reqContent);
|
|
28
|
+
|
|
29
|
+
const changelogContent = `# Changelog
|
|
30
|
+
## Verified Requirements
|
|
31
|
+
- Req 4 (2025-12-18)
|
|
32
|
+
- Req 5 (2025-12-18)
|
|
33
|
+
`;
|
|
34
|
+
await fs.writeFile(changelogPath, changelogContent);
|
|
35
|
+
|
|
36
|
+
console.log('๐งช Testing getProjectRequirementStats...');
|
|
37
|
+
const stats = await getProjectRequirementStats(testRepo);
|
|
38
|
+
|
|
39
|
+
console.log('Result:', JSON.stringify(stats, null, 2));
|
|
40
|
+
|
|
41
|
+
const expected = {
|
|
42
|
+
todoCount: 2,
|
|
43
|
+
toVerifyCount: 1,
|
|
44
|
+
verifiedCount: 2,
|
|
45
|
+
total: 5
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
if (stats.todoCount === expected.todoCount &&
|
|
49
|
+
stats.toVerifyCount === expected.toVerifyCount &&
|
|
50
|
+
stats.verifiedCount === expected.verifiedCount &&
|
|
51
|
+
stats.total === expected.total) {
|
|
52
|
+
console.log('โ
PASS: Stats match expected values');
|
|
53
|
+
} else {
|
|
54
|
+
console.error('โ FAIL: Stats do not match expected values');
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.error('โ Error in test:', error);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
} finally {
|
|
62
|
+
await fs.remove(testRepo);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
testStats();
|