vibecodingmachine-core 1.0.0 → 1.0.1

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 (48) hide show
  1. package/.babelrc +13 -13
  2. package/README.md +28 -28
  3. package/__tests__/applescript-manager-claude-fix.test.js +286 -286
  4. package/__tests__/requirement-2-auto-start-looping.test.js +69 -69
  5. package/__tests__/requirement-3-auto-start-looping.test.js +69 -69
  6. package/__tests__/requirement-4-auto-start-looping.test.js +69 -69
  7. package/__tests__/requirement-6-auto-start-looping.test.js +73 -73
  8. package/__tests__/requirement-7-status-tracking.test.js +332 -332
  9. package/jest.config.js +18 -18
  10. package/jest.setup.js +12 -12
  11. package/package.json +47 -45
  12. package/src/auth/access-denied.html +119 -119
  13. package/src/auth/shared-auth-storage.js +230 -230
  14. package/src/autonomous-mode/feature-implementer.cjs +70 -70
  15. package/src/autonomous-mode/feature-implementer.js +425 -425
  16. package/src/chat-management/chat-manager.cjs +71 -71
  17. package/src/chat-management/chat-manager.js +342 -342
  18. package/src/ide-integration/__tests__/applescript-manager-thread-closure.test.js +227 -227
  19. package/src/ide-integration/aider-cli-manager.cjs +850 -850
  20. package/src/ide-integration/applescript-manager.cjs +1088 -1088
  21. package/src/ide-integration/applescript-manager.js +2802 -2802
  22. package/src/ide-integration/applescript-utils.js +306 -306
  23. package/src/ide-integration/cdp-manager.cjs +221 -221
  24. package/src/ide-integration/cdp-manager.js +321 -321
  25. package/src/ide-integration/claude-code-cli-manager.cjs +301 -301
  26. package/src/ide-integration/cline-cli-manager.cjs +2252 -2252
  27. package/src/ide-integration/continue-cli-manager.js +431 -431
  28. package/src/ide-integration/provider-manager.cjs +354 -354
  29. package/src/ide-integration/quota-detector.cjs +34 -34
  30. package/src/ide-integration/quota-detector.js +349 -349
  31. package/src/ide-integration/windows-automation-manager.js +262 -262
  32. package/src/index.cjs +43 -43
  33. package/src/index.js +17 -17
  34. package/src/llm/direct-llm-manager.cjs +609 -609
  35. package/src/ui/ButtonComponents.js +247 -247
  36. package/src/ui/ChatInterface.js +499 -499
  37. package/src/ui/StateManager.js +259 -259
  38. package/src/utils/audit-logger.cjs +116 -116
  39. package/src/utils/config-helpers.cjs +94 -94
  40. package/src/utils/config-helpers.js +94 -94
  41. package/src/utils/electron-update-checker.js +85 -78
  42. package/src/utils/gcloud-auth.cjs +394 -394
  43. package/src/utils/logger.cjs +193 -193
  44. package/src/utils/logger.js +191 -191
  45. package/src/utils/repo-helpers.cjs +120 -120
  46. package/src/utils/repo-helpers.js +120 -120
  47. package/src/utils/requirement-helpers.js +432 -432
  48. package/src/utils/update-checker.js +167 -167
@@ -1,167 +1,167 @@
1
- const https = require('https');
2
- const fs = require('fs');
3
- const path = require('path');
4
-
5
- /**
6
- * Check for updates from npm registry
7
- * @param {string} packageName - Name of the package to check (e.g., 'allnightai-cli')
8
- * @param {string} currentVersion - Current version (e.g., '1.0.0')
9
- * @returns {Promise<Object>} Update info or null if no update available
10
- */
11
- async function checkForUpdates(packageName, currentVersion) {
12
- return new Promise((resolve, reject) => {
13
- const registryUrl = `https://registry.npmjs.org/${packageName}`;
14
-
15
- https.get(registryUrl, (res) => {
16
- let data = '';
17
-
18
- res.on('data', (chunk) => {
19
- data += chunk;
20
- });
21
-
22
- res.on('end', () => {
23
- try {
24
- const packageInfo = JSON.parse(data);
25
- const latestVersion = packageInfo['dist-tags'].latest;
26
-
27
- if (latestVersion !== currentVersion) {
28
- const versionInfo = packageInfo.versions[latestVersion];
29
- const publishedDate = new Date(packageInfo.time[latestVersion]);
30
-
31
- resolve({
32
- hasUpdate: true,
33
- currentVersion,
34
- latestVersion,
35
- publishedDate: publishedDate.toLocaleString('en-US', {
36
- year: 'numeric',
37
- month: '2-digit',
38
- day: '2-digit',
39
- hour: '2-digit',
40
- minute: '2-digit',
41
- timeZoneName: 'short'
42
- }),
43
- packageName,
44
- description: versionInfo.description || ''
45
- });
46
- } else {
47
- resolve({
48
- hasUpdate: false,
49
- currentVersion,
50
- latestVersion,
51
- packageName
52
- });
53
- }
54
- } catch (error) {
55
- console.error('Error parsing registry response:', error);
56
- resolve({ hasUpdate: false, currentVersion, packageName, error: error.message });
57
- }
58
- });
59
- }).on('error', (error) => {
60
- console.error('Error checking for updates:', error);
61
- resolve({ hasUpdate: false, currentVersion, packageName, error: error.message });
62
- });
63
- });
64
- }
65
-
66
- /**
67
- * Get update info cache file path
68
- * @param {string} packageName - Package name
69
- * @returns {string} Path to cache file
70
- */
71
- function getUpdateCachePath(packageName) {
72
- const homeDir = require('os').homedir();
73
- const cacheDir = path.join(homeDir, '.config', 'allnightai');
74
-
75
- // Ensure cache directory exists
76
- if (!fs.existsSync(cacheDir)) {
77
- fs.mkdirSync(cacheDir, { recursive: true });
78
- }
79
-
80
- return path.join(cacheDir, `${packageName}-update-cache.json`);
81
- }
82
-
83
- /**
84
- * Load cached update info
85
- * @param {string} packageName - Package name
86
- * @returns {Object|null} Cached update info or null
87
- */
88
- function loadUpdateCache(packageName) {
89
- try {
90
- const cachePath = getUpdateCachePath(packageName);
91
- if (fs.existsSync(cachePath)) {
92
- const data = fs.readFileSync(cachePath, 'utf8');
93
- const cache = JSON.parse(data);
94
-
95
- // Cache is valid for 1 hour
96
- const cacheAge = Date.now() - cache.checkedAt;
97
- if (cacheAge < 3600000) { // 1 hour
98
- return cache.updateInfo;
99
- }
100
- }
101
- } catch (error) {
102
- console.error('Error loading update cache:', error);
103
- }
104
- return null;
105
- }
106
-
107
- /**
108
- * Save update info to cache
109
- * @param {string} packageName - Package name
110
- * @param {Object} updateInfo - Update info to cache
111
- */
112
- function saveUpdateCache(packageName, updateInfo) {
113
- try {
114
- const cachePath = getUpdateCachePath(packageName);
115
- const cache = {
116
- checkedAt: Date.now(),
117
- updateInfo
118
- };
119
- fs.writeFileSync(cachePath, JSON.stringify(cache, null, 2));
120
- } catch (error) {
121
- console.error('Error saving update cache:', error);
122
- }
123
- }
124
-
125
- /**
126
- * Check for updates with caching
127
- * @param {string} packageName - Package name
128
- * @param {string} currentVersion - Current version
129
- * @param {boolean} forceCheck - Force check even if cache is valid
130
- * @returns {Promise<Object>} Update info
131
- */
132
- async function checkForUpdatesWithCache(packageName, currentVersion, forceCheck = false) {
133
- if (!forceCheck) {
134
- const cached = loadUpdateCache(packageName);
135
- if (cached) {
136
- return cached;
137
- }
138
- }
139
-
140
- const updateInfo = await checkForUpdates(packageName, currentVersion);
141
- saveUpdateCache(packageName, updateInfo);
142
- return updateInfo;
143
- }
144
-
145
- /**
146
- * Clear update notification (mark as dismissed)
147
- * @param {string} packageName - Package name
148
- */
149
- function clearUpdateNotification(packageName) {
150
- try {
151
- const cachePath = getUpdateCachePath(packageName);
152
- if (fs.existsSync(cachePath)) {
153
- fs.unlinkSync(cachePath);
154
- }
155
- } catch (error) {
156
- console.error('Error clearing update notification:', error);
157
- }
158
- }
159
-
160
- module.exports = {
161
- checkForUpdates,
162
- checkForUpdatesWithCache,
163
- loadUpdateCache,
164
- saveUpdateCache,
165
- clearUpdateNotification,
166
- getUpdateCachePath
167
- };
1
+ const https = require('https');
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+
5
+ /**
6
+ * Check for updates from npm registry
7
+ * @param {string} packageName - Name of the package to check (e.g., 'vibecodingmachine-cli')
8
+ * @param {string} currentVersion - Current version (e.g., '1.0.0')
9
+ * @returns {Promise<Object>} Update info or null if no update available
10
+ */
11
+ async function checkForUpdates(packageName, currentVersion) {
12
+ return new Promise((resolve, reject) => {
13
+ const registryUrl = `https://registry.npmjs.org/${packageName}`;
14
+
15
+ https.get(registryUrl, (res) => {
16
+ let data = '';
17
+
18
+ res.on('data', (chunk) => {
19
+ data += chunk;
20
+ });
21
+
22
+ res.on('end', () => {
23
+ try {
24
+ const packageInfo = JSON.parse(data);
25
+ const latestVersion = packageInfo['dist-tags'].latest;
26
+
27
+ if (latestVersion !== currentVersion) {
28
+ const versionInfo = packageInfo.versions[latestVersion];
29
+ const publishedDate = new Date(packageInfo.time[latestVersion]);
30
+
31
+ resolve({
32
+ hasUpdate: true,
33
+ currentVersion,
34
+ latestVersion,
35
+ publishedDate: publishedDate.toLocaleString('en-US', {
36
+ year: 'numeric',
37
+ month: '2-digit',
38
+ day: '2-digit',
39
+ hour: '2-digit',
40
+ minute: '2-digit',
41
+ timeZoneName: 'short'
42
+ }),
43
+ packageName,
44
+ description: versionInfo.description || ''
45
+ });
46
+ } else {
47
+ resolve({
48
+ hasUpdate: false,
49
+ currentVersion,
50
+ latestVersion,
51
+ packageName
52
+ });
53
+ }
54
+ } catch (error) {
55
+ console.error('Error parsing registry response:', error);
56
+ resolve({ hasUpdate: false, currentVersion, packageName, error: error.message });
57
+ }
58
+ });
59
+ }).on('error', (error) => {
60
+ console.error('Error checking for updates:', error);
61
+ resolve({ hasUpdate: false, currentVersion, packageName, error: error.message });
62
+ });
63
+ });
64
+ }
65
+
66
+ /**
67
+ * Get update info cache file path
68
+ * @param {string} packageName - Package name
69
+ * @returns {string} Path to cache file
70
+ */
71
+ function getUpdateCachePath(packageName) {
72
+ const homeDir = require('os').homedir();
73
+ const cacheDir = path.join(homeDir, '.config', 'vibecodingmachine');
74
+
75
+ // Ensure cache directory exists
76
+ if (!fs.existsSync(cacheDir)) {
77
+ fs.mkdirSync(cacheDir, { recursive: true });
78
+ }
79
+
80
+ return path.join(cacheDir, `${packageName}-update-cache.json`);
81
+ }
82
+
83
+ /**
84
+ * Load cached update info
85
+ * @param {string} packageName - Package name
86
+ * @returns {Object|null} Cached update info or null
87
+ */
88
+ function loadUpdateCache(packageName) {
89
+ try {
90
+ const cachePath = getUpdateCachePath(packageName);
91
+ if (fs.existsSync(cachePath)) {
92
+ const data = fs.readFileSync(cachePath, 'utf8');
93
+ const cache = JSON.parse(data);
94
+
95
+ // Cache is valid for 1 hour
96
+ const cacheAge = Date.now() - cache.checkedAt;
97
+ if (cacheAge < 3600000) { // 1 hour
98
+ return cache.updateInfo;
99
+ }
100
+ }
101
+ } catch (error) {
102
+ console.error('Error loading update cache:', error);
103
+ }
104
+ return null;
105
+ }
106
+
107
+ /**
108
+ * Save update info to cache
109
+ * @param {string} packageName - Package name
110
+ * @param {Object} updateInfo - Update info to cache
111
+ */
112
+ function saveUpdateCache(packageName, updateInfo) {
113
+ try {
114
+ const cachePath = getUpdateCachePath(packageName);
115
+ const cache = {
116
+ checkedAt: Date.now(),
117
+ updateInfo
118
+ };
119
+ fs.writeFileSync(cachePath, JSON.stringify(cache, null, 2));
120
+ } catch (error) {
121
+ console.error('Error saving update cache:', error);
122
+ }
123
+ }
124
+
125
+ /**
126
+ * Check for updates with caching
127
+ * @param {string} packageName - Package name
128
+ * @param {string} currentVersion - Current version
129
+ * @param {boolean} forceCheck - Force check even if cache is valid
130
+ * @returns {Promise<Object>} Update info
131
+ */
132
+ async function checkForUpdatesWithCache(packageName, currentVersion, forceCheck = false) {
133
+ if (!forceCheck) {
134
+ const cached = loadUpdateCache(packageName);
135
+ if (cached) {
136
+ return cached;
137
+ }
138
+ }
139
+
140
+ const updateInfo = await checkForUpdates(packageName, currentVersion);
141
+ saveUpdateCache(packageName, updateInfo);
142
+ return updateInfo;
143
+ }
144
+
145
+ /**
146
+ * Clear update notification (mark as dismissed)
147
+ * @param {string} packageName - Package name
148
+ */
149
+ function clearUpdateNotification(packageName) {
150
+ try {
151
+ const cachePath = getUpdateCachePath(packageName);
152
+ if (fs.existsSync(cachePath)) {
153
+ fs.unlinkSync(cachePath);
154
+ }
155
+ } catch (error) {
156
+ console.error('Error clearing update notification:', error);
157
+ }
158
+ }
159
+
160
+ module.exports = {
161
+ checkForUpdates,
162
+ checkForUpdatesWithCache,
163
+ loadUpdateCache,
164
+ saveUpdateCache,
165
+ clearUpdateNotification,
166
+ getUpdateCachePath
167
+ };