vibecodingmachine-core 2026.2.20-438 → 2026.2.26-1739

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 (202) hide show
  1. package/README.md +240 -0
  2. package/package.json +10 -2
  3. package/src/agents/Agent.js +300 -0
  4. package/src/agents/AgentAdditionService.js +311 -0
  5. package/src/agents/AgentCheckService.js +690 -0
  6. package/src/agents/AgentInstallationService.js +140 -0
  7. package/src/agents/AgentSetupService.js +467 -0
  8. package/src/agents/AgentStatus.js +183 -0
  9. package/src/agents/AgentVerificationService.js +634 -0
  10. package/src/agents/ConfigurationSchemaValidator.js +543 -0
  11. package/src/agents/EnvironmentConfigurationManager.js +602 -0
  12. package/src/agents/InstallationErrorHandler.js +372 -0
  13. package/src/agents/InstallationLog.js +363 -0
  14. package/src/agents/InstallationMethod.js +510 -0
  15. package/src/agents/InstallationOrchestrator.js +352 -0
  16. package/src/agents/InstallationProgressReporter.js +372 -0
  17. package/src/agents/InstallationRetryManager.js +322 -0
  18. package/src/agents/InstallationType.js +254 -0
  19. package/src/agents/OperationTypes.js +310 -0
  20. package/src/agents/PerformanceMetricsCollector.js +493 -0
  21. package/src/agents/SecurityValidationService.js +534 -0
  22. package/src/agents/VerificationTest.js +354 -0
  23. package/src/agents/VerificationType.js +226 -0
  24. package/src/agents/WindowsPermissionHandler.js +518 -0
  25. package/src/agents/config/AgentConfigManager.js +393 -0
  26. package/src/agents/config/AgentDefaultsRegistry.js +373 -0
  27. package/src/agents/config/ConfigValidator.js +281 -0
  28. package/src/agents/discovery/AgentDiscoveryService.js +707 -0
  29. package/src/agents/logging/AgentLogger.js +511 -0
  30. package/src/agents/status/AgentStatusManager.js +481 -0
  31. package/src/agents/storage/FileManager.js +454 -0
  32. package/src/agents/verification/AgentCommunicationTester.js +474 -0
  33. package/src/agents/verification/BaseVerifier.js +430 -0
  34. package/src/agents/verification/CommandVerifier.js +480 -0
  35. package/src/agents/verification/FileOperationVerifier.js +453 -0
  36. package/src/agents/verification/ResultAnalyzer.js +707 -0
  37. package/src/agents/verification/TestRequirementManager.js +495 -0
  38. package/src/agents/verification/VerificationRunner.js +433 -0
  39. package/src/agents/windows/BaseWindowsInstaller.js +441 -0
  40. package/src/agents/windows/ChocolateyInstaller.js +509 -0
  41. package/src/agents/windows/DirectInstaller.js +443 -0
  42. package/src/agents/windows/InstallerFactory.js +391 -0
  43. package/src/agents/windows/NpmInstaller.js +505 -0
  44. package/src/agents/windows/PowerShellInstaller.js +458 -0
  45. package/src/agents/windows/WinGetInstaller.js +390 -0
  46. package/src/analysis/analysis-reporter.js +132 -0
  47. package/src/analysis/boundary-detector.js +712 -0
  48. package/src/analysis/categorizer.js +340 -0
  49. package/src/analysis/codebase-scanner.js +384 -0
  50. package/src/analysis/line-counter.js +513 -0
  51. package/src/analysis/priority-calculator.js +679 -0
  52. package/src/analysis/report/analysis-report.js +250 -0
  53. package/src/analysis/report/package-analyzer.js +278 -0
  54. package/src/analysis/report/recommendation-generator.js +382 -0
  55. package/src/analysis/report/statistics-generator.js +515 -0
  56. package/src/analysis/reports/analysis-report-model.js +101 -0
  57. package/src/analysis/reports/recommendation-generator.js +283 -0
  58. package/src/analysis/reports/report-generators.js +191 -0
  59. package/src/analysis/reports/statistics-calculator.js +231 -0
  60. package/src/analysis/reports/trend-analyzer.js +219 -0
  61. package/src/analysis/strategy-generator.js +814 -0
  62. package/src/auto-mode/AutoModeBusinessLogic.js +836 -0
  63. package/src/config/refactoring-config.js +307 -0
  64. package/src/health-tracking/json-storage.js +38 -2
  65. package/src/ide-integration/applescript-manager-core.js +233 -0
  66. package/src/ide-integration/applescript-manager.cjs +357 -28
  67. package/src/ide-integration/applescript-manager.js +89 -3599
  68. package/src/ide-integration/cdp-manager.js +306 -0
  69. package/src/ide-integration/claude-code-cli-manager.cjs +1 -1
  70. package/src/ide-integration/continuation-handler.js +337 -0
  71. package/src/ide-integration/ide-status-checker.js +292 -0
  72. package/src/ide-integration/macos-ide-manager.js +627 -0
  73. package/src/ide-integration/macos-text-sender.js +528 -0
  74. package/src/ide-integration/response-reader.js +548 -0
  75. package/src/ide-integration/windows-automation-manager.js +121 -0
  76. package/src/ide-integration/windows-ide-manager.js +373 -0
  77. package/src/index.cjs +25 -3
  78. package/src/index.js +15 -1
  79. package/src/llm/direct-llm-manager.cjs +90 -2
  80. package/src/models/compliance-report.js +538 -0
  81. package/src/models/file-analysis.js +681 -0
  82. package/src/models/refactoring-plan.js +770 -0
  83. package/src/monitoring/alert-system.js +834 -0
  84. package/src/monitoring/compliance-progress-tracker.js +437 -0
  85. package/src/monitoring/continuous-scan-notifications.js +661 -0
  86. package/src/monitoring/continuous-scanner.js +279 -0
  87. package/src/monitoring/file-monitor/file-analyzer.js +262 -0
  88. package/src/monitoring/file-monitor/file-monitor.js +237 -0
  89. package/src/monitoring/file-monitor/watcher.js +194 -0
  90. package/src/monitoring/file-monitor.js +17 -0
  91. package/src/monitoring/notification-manager.js +437 -0
  92. package/src/monitoring/scanner-core.js +368 -0
  93. package/src/monitoring/scanner-events.js +214 -0
  94. package/src/monitoring/violation-notification-system.js +515 -0
  95. package/src/refactoring/boundaries/cohesion-analyzer.js +316 -0
  96. package/src/refactoring/boundaries/extraction-result.js +285 -0
  97. package/src/refactoring/boundaries/extraction-strategies.js +392 -0
  98. package/src/refactoring/boundaries/module-boundary.js +209 -0
  99. package/src/refactoring/boundary/boundary-detector.js +741 -0
  100. package/src/refactoring/boundary/boundary-types.js +405 -0
  101. package/src/refactoring/boundary/extraction-strategies.js +554 -0
  102. package/src/refactoring/boundary-extraction-result.js +77 -0
  103. package/src/refactoring/boundary-extraction-strategies.js +330 -0
  104. package/src/refactoring/boundary-extractor.js +384 -0
  105. package/src/refactoring/boundary-types.js +46 -0
  106. package/src/refactoring/circular/circular-dependency.js +88 -0
  107. package/src/refactoring/circular/cycle-detection.js +147 -0
  108. package/src/refactoring/circular/dependency-node.js +82 -0
  109. package/src/refactoring/circular/dependency-result.js +107 -0
  110. package/src/refactoring/circular/dependency-types.js +58 -0
  111. package/src/refactoring/circular/graph-builder.js +213 -0
  112. package/src/refactoring/circular/resolution-strategy.js +72 -0
  113. package/src/refactoring/circular/strategy-generator.js +229 -0
  114. package/src/refactoring/circular-dependency-resolver-original.js +809 -0
  115. package/src/refactoring/circular-dependency-resolver.js +200 -0
  116. package/src/refactoring/code-mover.js +761 -0
  117. package/src/refactoring/file-splitter.js +696 -0
  118. package/src/refactoring/functionality-validator.js +816 -0
  119. package/src/refactoring/import-manager.js +774 -0
  120. package/src/refactoring/module-boundary.js +107 -0
  121. package/src/refactoring/refactoring-executor.js +672 -0
  122. package/src/refactoring/refactoring-rollback.js +614 -0
  123. package/src/refactoring/test-validator.js +631 -0
  124. package/src/requirement-management/default-requirement-manager.js +321 -0
  125. package/src/requirement-management/requirement-file-parser.js +159 -0
  126. package/src/requirement-management/requirement-sequencer.js +221 -0
  127. package/src/rui/commands/AgentCommandParser.js +600 -0
  128. package/src/rui/commands/AgentCommands.js +487 -0
  129. package/src/rui/commands/AgentResponseFormatter.js +832 -0
  130. package/src/scripts/verify-full-compliance.js +269 -0
  131. package/src/sync/sync-engine-core.js +1 -0
  132. package/src/sync/sync-engine-remote-handlers.js +135 -0
  133. package/src/task-generation/automated-task-generator.js +351 -0
  134. package/src/task-generation/prioritizer.js +287 -0
  135. package/src/task-generation/task-list-updater.js +215 -0
  136. package/src/task-generation/task-management-integration.js +480 -0
  137. package/src/task-generation/task-manager-integration.js +270 -0
  138. package/src/task-generation/violation-task-generator.js +474 -0
  139. package/src/task-management/continuous-scan-integration.js +342 -0
  140. package/src/timeout-management/index.js +12 -3
  141. package/src/timeout-management/response-time-tracker.js +167 -0
  142. package/src/timeout-management/timeout-calculator.js +159 -0
  143. package/src/timeout-management/timeout-config-manager.js +172 -0
  144. package/src/utils/ast-analyzer.js +417 -0
  145. package/src/utils/current-requirement-manager.js +276 -0
  146. package/src/utils/current-requirement-operations.js +472 -0
  147. package/src/utils/dependency-mapper.js +456 -0
  148. package/src/utils/download-with-progress.js +4 -2
  149. package/src/utils/electron-update-checker.js +4 -1
  150. package/src/utils/file-size-analyzer.js +272 -0
  151. package/src/utils/import-updater.js +280 -0
  152. package/src/utils/refactoring-tools.js +512 -0
  153. package/src/utils/report-generator.js +569 -0
  154. package/src/utils/reports/report-analysis.js +218 -0
  155. package/src/utils/reports/report-types.js +55 -0
  156. package/src/utils/reports/summary-generators.js +102 -0
  157. package/src/utils/requirement-file-management.js +157 -0
  158. package/src/utils/requirement-helpers/requirement-file-ops.js +392 -0
  159. package/src/utils/requirement-helpers/requirement-mover.js +414 -0
  160. package/src/utils/requirement-helpers/requirement-parser.js +326 -0
  161. package/src/utils/requirement-helpers/requirement-status.js +320 -0
  162. package/src/utils/requirement-helpers-new.js +55 -0
  163. package/src/utils/requirement-helpers-refactored.js +367 -0
  164. package/src/utils/requirement-helpers.js +291 -1191
  165. package/src/utils/requirement-movement-operations.js +450 -0
  166. package/src/utils/requirement-movement.js +312 -0
  167. package/src/utils/requirement-parsing-helpers.js +56 -0
  168. package/src/utils/requirement-statistics.js +200 -0
  169. package/src/utils/requirement-text-utils.js +58 -0
  170. package/src/utils/rollback/rollback-handlers.js +125 -0
  171. package/src/utils/rollback/rollback-operation.js +63 -0
  172. package/src/utils/rollback/rollback-recorder.js +166 -0
  173. package/src/utils/rollback/rollback-state-manager.js +175 -0
  174. package/src/utils/rollback/rollback-types.js +33 -0
  175. package/src/utils/rollback/rollback-utils.js +110 -0
  176. package/src/utils/rollback-manager-original.js +569 -0
  177. package/src/utils/rollback-manager.js +202 -0
  178. package/src/utils/smoke-test-cli.js +362 -0
  179. package/src/utils/smoke-test-gui.js +351 -0
  180. package/src/utils/smoke-test-orchestrator.js +321 -0
  181. package/src/utils/smoke-test-runner.js +60 -0
  182. package/src/utils/smoke-test-web.js +347 -0
  183. package/src/utils/specification-helpers.js +39 -13
  184. package/src/utils/specification-migration.js +97 -0
  185. package/src/utils/test-runner.js +579 -0
  186. package/src/utils/validation-framework.js +518 -0
  187. package/src/validation/compliance-analyzer.js +197 -0
  188. package/src/validation/compliance-report-generator.js +343 -0
  189. package/src/validation/compliance-reporter.js +711 -0
  190. package/src/validation/compliance-rules.js +127 -0
  191. package/src/validation/constitution-validator-new.js +196 -0
  192. package/src/validation/constitution-validator.js +17 -0
  193. package/src/validation/file-validators.js +170 -0
  194. package/src/validation/line-limit/file-analyzer.js +201 -0
  195. package/src/validation/line-limit/line-limit-validator.js +208 -0
  196. package/src/validation/line-limit/validation-result.js +144 -0
  197. package/src/validation/line-limit-core.js +225 -0
  198. package/src/validation/line-limit-reporter.js +134 -0
  199. package/src/validation/line-limit-result.js +125 -0
  200. package/src/validation/line-limit-validator.js +41 -0
  201. package/src/validation/metrics-calculator.js +660 -0
  202. package/src/sync/sync-engine-backup.js +0 -559
@@ -0,0 +1,373 @@
1
+ // @vibecodingmachine/core - Windows IDE Manager
2
+ // Windows-specific IDE operations using PowerShell automation
3
+
4
+ /**
5
+ * Windows IDE Manager for PowerShell-based interactions
6
+ * Handles all Windows-specific IDE operations
7
+ */
8
+ class WindowsIDEManager {
9
+ constructor(windowsManager) {
10
+ this.logger = console;
11
+ this.windowsManager = windowsManager;
12
+ }
13
+
14
+ /**
15
+ * Open IDE on Windows using PowerShell automation
16
+ * @param {string} ide - The IDE name
17
+ * @param {string} repoPath - Optional repository path to open
18
+ * @returns {Promise<Object>} Result object with success status and details
19
+ */
20
+ async openIDE(ide, repoPath = null) {
21
+ const ideLower = (ide || '').toLowerCase();
22
+
23
+ switch (ideLower) {
24
+ case 'cursor':
25
+ return await this.openCursor(repoPath);
26
+ case 'vscode':
27
+ return await this.openVSCode(repoPath);
28
+ case 'windsurf':
29
+ return await this.openWindsurf(repoPath);
30
+ default:
31
+ return {
32
+ success: false,
33
+ error: `Windows automation not implemented for IDE: ${ide}`,
34
+ method: 'windows-automation'
35
+ };
36
+ }
37
+ }
38
+
39
+ /**
40
+ * Open Cursor IDE on Windows
41
+ * @param {string} repoPath - Optional repository path to open
42
+ * @returns {Promise<Object>} Result object with success status and details
43
+ */
44
+ async openCursor(repoPath = null) {
45
+ if (!this.windowsManager) {
46
+ return {
47
+ success: false,
48
+ error: 'Windows automation manager not available',
49
+ method: 'windows-automation'
50
+ };
51
+ }
52
+
53
+ try {
54
+ this.logger.log(`🔧 Windows: Opening Cursor with repository: ${repoPath || 'default'}`);
55
+
56
+ // Try native Windows API approach first, then fallback to basic PowerShell
57
+ let result = await this.windowsManager.openCursorNative(repoPath);
58
+ if (!result.success) {
59
+ this.logger.log('🔧 Windows: Native approach failed, trying basic PowerShell...');
60
+ result = await this.windowsManager.openCursor(repoPath);
61
+ }
62
+ return result;
63
+ } catch (error) {
64
+ this.logger.error(`❌ Windows: Error opening Cursor:`, error.message);
65
+ return {
66
+ success: false,
67
+ error: `Windows automation error: ${error.message}`,
68
+ method: 'windows-automation'
69
+ };
70
+ }
71
+ }
72
+
73
+ /**
74
+ * Open VS Code IDE on Windows
75
+ * @param {string} repoPath - Optional repository path to open
76
+ * @returns {Promise<Object>} Result object with success status and details
77
+ */
78
+ async openVSCode(repoPath = null) {
79
+ if (!this.windowsManager) {
80
+ return {
81
+ success: false,
82
+ error: 'Windows automation manager not available',
83
+ method: 'windows-automation'
84
+ };
85
+ }
86
+
87
+ try {
88
+ this.logger.log(`🔧 Windows: Opening VS Code with repository: ${repoPath || 'default'}`);
89
+ return await this.windowsManager.openVSCode(repoPath);
90
+ } catch (error) {
91
+ this.logger.error(`❌ Windows: Error opening VS Code:`, error.message);
92
+ return {
93
+ success: false,
94
+ error: `Windows automation error: ${error.message}`,
95
+ method: 'windows-automation'
96
+ };
97
+ }
98
+ }
99
+
100
+ /**
101
+ * Open Windsurf IDE on Windows
102
+ * @param {string} repoPath - Optional repository path to open
103
+ * @returns {Promise<Object>} Result object with success status and details
104
+ */
105
+ async openWindsurf(repoPath = null) {
106
+ if (!this.windowsManager) {
107
+ return {
108
+ success: false,
109
+ error: 'Windows automation manager not available',
110
+ method: 'windows-automation'
111
+ };
112
+ }
113
+
114
+ try {
115
+ this.logger.log(`🔧 Windows: Opening Windsurf with repository: ${repoPath || 'default'}`);
116
+ return await this.windowsManager.openWindsurf(repoPath);
117
+ } catch (error) {
118
+ this.logger.error(`❌ Windows: Error opening Windsurf:`, error.message);
119
+ return {
120
+ success: false,
121
+ error: `Windows automation error: ${error.message}`,
122
+ method: 'windows-automation'
123
+ };
124
+ }
125
+ }
126
+
127
+ /**
128
+ * Send text to IDE on Windows using PowerShell automation
129
+ * @param {string} text - The text to send
130
+ * @param {string} ide - The IDE name
131
+ * @param {string} repoPath - The repository path (optional, used for Claude)
132
+ * @returns {Promise<Object>} Result object with success status and details
133
+ */
134
+ async sendText(text, ide, repoPath = null) {
135
+ if (!this.windowsManager) {
136
+ return {
137
+ success: false,
138
+ error: 'Windows automation manager not available',
139
+ method: 'windows-automation'
140
+ };
141
+ }
142
+
143
+ try {
144
+ this.logger.log(`🔧 Windows: Sending text to ${ide}...`);
145
+
146
+ switch (ide.toLowerCase()) {
147
+ case 'cursor':
148
+ // Try native Windows API approach first, then fallback to basic PowerShell
149
+ let result = await this.windowsManager.sendTextToCursorNative(text);
150
+ if (!result.success) {
151
+ this.logger.log('🔧 Windows: Native approach failed, trying basic PowerShell...');
152
+ result = await this.windowsManager.sendTextToCursor(text);
153
+ }
154
+ return result;
155
+
156
+ case 'vscode':
157
+ case 'windsurf':
158
+ // For now, use same approach as Cursor for other IDEs
159
+ return await this.windowsManager.sendTextToCursor(text);
160
+
161
+ default:
162
+ return {
163
+ success: false,
164
+ error: `Windows automation not implemented for IDE: ${ide}`,
165
+ method: 'windows-automation'
166
+ };
167
+ }
168
+ } catch (error) {
169
+ this.logger.error(`❌ Windows: Error sending text to ${ide}:`, error.message);
170
+ return {
171
+ success: false,
172
+ error: `Windows automation error: ${error.message}`,
173
+ method: 'windows-automation'
174
+ };
175
+ }
176
+ }
177
+
178
+ /**
179
+ * Check IDE status on Windows
180
+ * @param {string} ide - The IDE name
181
+ * @returns {Promise<Object>} Result object with success status and details
182
+ */
183
+ async checkIDEStatus(ide) {
184
+ if (!this.windowsManager) {
185
+ return {
186
+ success: false,
187
+ error: 'Windows automation manager not available',
188
+ running: false
189
+ };
190
+ }
191
+
192
+ try {
193
+ switch (ide.toLowerCase()) {
194
+ case 'cursor':
195
+ return await this.windowsManager.checkCursorStatus();
196
+ case 'vscode':
197
+ return await this.windowsManager.checkVSCodeStatus();
198
+ case 'windsurf':
199
+ return await this.windowsManager.checkWindsurfStatus();
200
+ default:
201
+ return {
202
+ success: false,
203
+ error: `Windows automation not implemented for IDE: ${ide}`,
204
+ running: false
205
+ };
206
+ }
207
+ } catch (error) {
208
+ return {
209
+ success: false,
210
+ error: `Failed to check IDE status: ${error.message}`,
211
+ running: false
212
+ };
213
+ }
214
+ }
215
+
216
+ /**
217
+ * Read chat response from IDE on Windows
218
+ * @param {string} ide - The IDE name
219
+ * @returns {Promise<string>} The chat response text
220
+ */
221
+ async readChatResponse(ide) {
222
+ if (!this.windowsManager) {
223
+ return 'Error: Windows automation manager not available';
224
+ }
225
+
226
+ try {
227
+ this.logger.log(`🔧 Windows: Reading chat response from ${ide}...`);
228
+ return await this.windowsManager.readChatResponse(ide);
229
+ } catch (error) {
230
+ this.logger.error(`❌ Windows: Error reading response from ${ide}:`, error.message);
231
+ return 'Error: Could not read response via Windows automation';
232
+ }
233
+ }
234
+
235
+ /**
236
+ * Close previous chat thread in IDE on Windows
237
+ * @param {string} ide - The IDE name
238
+ * @returns {Promise<Object>} Result object with success status and details
239
+ */
240
+ async closePreviousChatThread(ide) {
241
+ if (!this.windowsManager) {
242
+ return {
243
+ success: false,
244
+ error: 'Windows automation manager not available',
245
+ method: 'windows-automation'
246
+ };
247
+ }
248
+
249
+ try {
250
+ this.logger.log(`🔧 Windows: Closing previous chat thread in ${ide}...`);
251
+ return await this.windowsManager.closePreviousChatThread(ide);
252
+ } catch (error) {
253
+ this.logger.error(`❌ Windows: Error closing chat thread in ${ide}:`, error.message);
254
+ return {
255
+ success: false,
256
+ error: error.message,
257
+ method: 'windows-automation'
258
+ };
259
+ }
260
+ }
261
+
262
+ /**
263
+ * Send text with thread closure on Windows
264
+ * @param {string} text - The text to send
265
+ * @param {string} ide - The IDE name
266
+ * @returns {Promise<Object>} Result object with success status and details
267
+ */
268
+ async sendTextWithThreadClosure(text, ide) {
269
+ if (!this.windowsManager) {
270
+ return {
271
+ success: false,
272
+ error: 'Windows automation manager not available',
273
+ method: 'windows-automation'
274
+ };
275
+ }
276
+
277
+ try {
278
+ this.logger.log(`🔧 Windows: Sending text with thread closure to ${ide}...`);
279
+
280
+ // First, try to close previous chat thread
281
+ const closeResult = await this.closePreviousChatThread(ide);
282
+
283
+ // Wait a moment for thread closure to complete
284
+ await new Promise(resolve => setTimeout(resolve, 1000));
285
+
286
+ // Then send new message
287
+ const sendResult = await this.sendText(text, ide);
288
+
289
+ // Combine results
290
+ if (sendResult.success) {
291
+ return {
292
+ success: true,
293
+ message: sendResult.message,
294
+ method: sendResult.method,
295
+ threadClosure: closeResult.success ? 'Previous thread closed' : 'Thread closure failed',
296
+ warning: !closeResult.success ? `Failed to close previous thread: ${closeResult.error}` : undefined
297
+ };
298
+ } else {
299
+ return {
300
+ success: false,
301
+ error: sendResult.error,
302
+ method: sendResult.method,
303
+ threadClosure: closeResult.success ? 'Previous thread closed' : 'Thread closure failed'
304
+ };
305
+ }
306
+ } catch (error) {
307
+ this.logger.error(`❌ Windows: Failed to send text with thread closure to ${ide}:`, error.message);
308
+ return {
309
+ success: false,
310
+ error: error.message,
311
+ method: 'windows-automation'
312
+ };
313
+ }
314
+ }
315
+
316
+ /**
317
+ * Check for continuation buttons on Windows
318
+ * @param {string} ide - The IDE name
319
+ * @returns {Promise<Object>} Result with continuation detected and button info
320
+ */
321
+ async checkForContinuationButtons(ide) {
322
+ if (!this.windowsManager) {
323
+ return {
324
+ continuationDetected: false,
325
+ error: 'Windows automation manager not available',
326
+ buttons: [],
327
+ texts: []
328
+ };
329
+ }
330
+
331
+ try {
332
+ this.logger.log(`🔧 Windows: Checking for continuation buttons in ${ide}...`);
333
+ return await this.windowsManager.checkForContinuationButtons(ide);
334
+ } catch (error) {
335
+ this.logger.error(`❌ Windows: Error checking continuation buttons in ${ide}:`, error.message);
336
+ return {
337
+ continuationDetected: false,
338
+ error: error.message,
339
+ buttons: [],
340
+ texts: []
341
+ };
342
+ }
343
+ }
344
+
345
+ /**
346
+ * Click continuation button on Windows
347
+ * @param {string} ide - The IDE name
348
+ * @returns {Promise<Object>} Result of operation
349
+ */
350
+ async clickContinuationButton(ide) {
351
+ if (!this.windowsManager) {
352
+ return {
353
+ success: false,
354
+ error: 'Windows automation manager not available',
355
+ clicked: false
356
+ };
357
+ }
358
+
359
+ try {
360
+ this.logger.log(`🔧 Windows: Clicking continuation button in ${ide}...`);
361
+ return await this.windowsManager.clickContinuationButton(ide);
362
+ } catch (error) {
363
+ this.logger.error(`❌ Windows: Error clicking continuation button in ${ide}:`, error.message);
364
+ return {
365
+ success: false,
366
+ clicked: false,
367
+ error: error.message
368
+ };
369
+ }
370
+ }
371
+ }
372
+
373
+ module.exports = WindowsIDEManager;
package/src/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  // @vibecodingmachine/core - Main entry point (CommonJS)
2
2
  // This file exports all the core functionality for CommonJS environments
3
3
 
4
- const { CDPManager } = require('./ide-integration/cdp-manager.cjs');
5
- const { AppleScriptManager } = require('./ide-integration/applescript-manager.cjs');
4
+ const CDPManager = require('./ide-integration/cdp-manager.cjs');
5
+ const AppleScriptManager = require('./ide-integration/applescript-manager.cjs');
6
6
  const AppleScriptUtils = require('./ide-integration/applescript-utils.js');
7
7
  const WindowsAutomationManager = require('./ide-integration/windows-automation-manager.js');
8
8
  const { QuotaDetector } = require('./ide-integration/quota-detector.cjs');
@@ -31,6 +31,7 @@ const EnableAgentCommand = require('./commands/enable-agent');
31
31
  const DisableAgentCommand = require('./commands/disable-agent');
32
32
  const HelpCommand = require('./commands/help');
33
33
  const requirementHelpers = require('./utils/requirement-helpers.js');
34
+ const currentRequirementManager = require('./utils/current-requirement-manager.js');
34
35
  const requirementsParser = require('./utils/requirements-parser.js');
35
36
  const requirementNumbering = require('./requirement-numbering.js');
36
37
  const specificationHelpers = require('./utils/specification-helpers.js');
@@ -53,8 +54,20 @@ const { IDEHealthTracker, MAX_RESPONSE_TIMES, CONSECUTIVE_FAILURE_THRESHOLD } =
53
54
  // Health Tracking (User Story 2)
54
55
  const { HealthReporter } = require('./health-tracking/health-reporter.js');
55
56
 
57
+ // Timeout Management (User Story 3)
58
+ const { TimeoutCalculator } = require('./timeout-management/timeout-calculator.js');
59
+ const { TimeoutConfigManager } = require('./timeout-management/timeout-config-manager.js');
60
+ const { ResponseTimeTracker } = require('./timeout-management/response-time-tracker.js');
61
+
62
+ // Requirement Management (User Story 5)
63
+ const { RequirementFileParser } = require('./requirement-management/requirement-file-parser.js');
64
+ const { DefaultRequirementManager } = require('./requirement-management/default-requirement-manager.js');
65
+
56
66
  // Provider Registry
57
67
  const providerRegistry = require('./provider-registry.js');
68
+ const ProviderManager = require('./ide-integration/provider-manager.cjs');
69
+ const AutoModeBusinessLogic = require('./auto-mode/AutoModeBusinessLogic.js');
70
+ const { getCurrentRequirementName } = require('./utils/current-requirement-manager.js');
58
71
 
59
72
  module.exports = {
60
73
  CDPManager,
@@ -77,6 +90,7 @@ module.exports = {
77
90
  ...configHelpers,
78
91
  ...auditLogger,
79
92
  ...requirementHelpers,
93
+ ...currentRequirementManager,
80
94
  ...requirementsParser,
81
95
  ...requirementNumbering,
82
96
  ...specificationHelpers,
@@ -110,5 +124,13 @@ module.exports = {
110
124
  MAX_RESPONSE_TIMES,
111
125
  CONSECUTIVE_FAILURE_THRESHOLD,
112
126
  HealthReporter,
113
- ...providerRegistry
127
+ TimeoutCalculator,
128
+ TimeoutConfigManager,
129
+ ResponseTimeTracker,
130
+ RequirementFileParser,
131
+ DefaultRequirementManager,
132
+ ProviderManager,
133
+ AutoModeBusinessLogic,
134
+ getCurrentRequirementName,
135
+ providerRegistry
114
136
  };
package/src/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  // @vibecodingmachine/core - Main entry point
2
2
  // This file exports all the core functionality
3
3
 
4
+ import { AppleScriptManager } from './ide-integration/applescript-manager.js';
4
5
  export { CDPManager } from './ide-integration/cdp-manager.js';
5
6
  export { AppleScriptManager } from './ide-integration/applescript-manager.js';
6
7
  export { QuotaDetector } from './ide-integration/quota-detector.js';
@@ -41,7 +42,7 @@ export {
41
42
  };
42
43
 
43
44
  // Compliance
44
- const CompliancePrompt = require('./compliance/compliance-prompt.js');
45
+ import CompliancePrompt from './compliance/compliance-prompt.js';
45
46
  export { CompliancePrompt };
46
47
 
47
48
  // UI Components
@@ -71,5 +72,18 @@ export { IDEHealthTracker, MAX_RESPONSE_TIMES, CONSECUTIVE_FAILURE_THRESHOLD } f
71
72
  // Health Tracking (User Story 2)
72
73
  export { HealthReporter } from './health-tracking/health-reporter.js';
73
74
 
75
+ // Timeout Management (User Story 3)
76
+ export { TimeoutCalculator } from './timeout-management/timeout-calculator.js';
77
+ export { TimeoutConfigManager } from './timeout-management/timeout-config-manager.js';
78
+ export { ResponseTimeTracker } from './timeout-management/response-time-tracker.js';
79
+
80
+ // Requirement Management (User Story 5)
81
+ import { RequirementFileParser } from './requirement-management/requirement-file-parser.js';
82
+ export { RequirementFileParser } from './requirement-management/requirement-file-parser.js';
83
+ export { DefaultRequirementManager } from './requirement-management/default-requirement-manager.js';
84
+
74
85
  // Provider Registry
75
86
  export * from './provider-registry.js';
87
+
88
+ // Current Requirement Management
89
+ export { getCurrentRequirementName } from './utils/current-requirement-manager.js';
@@ -34,14 +34,15 @@ class DirectLLMManager {
34
34
  if (!this.providerManager) return;
35
35
 
36
36
  // Check for rate limit indicators
37
- const isRateLimit = errorMessage.includes('rate limit') ||
37
+ const isRateLimit = (errorMessage.includes('rate limit') ||
38
38
  errorMessage.includes('Rate limit') ||
39
39
  errorMessage.includes('too many requests') ||
40
40
  errorMessage.includes('429') ||
41
41
  errorMessage.includes('quota') ||
42
42
  errorMessage.includes('Weekly limit reached') ||
43
43
  errorMessage.includes('Daily limit reached') ||
44
- errorMessage.includes('limit reached');
44
+ errorMessage.includes('limit reached')) &&
45
+ !errorMessage.startsWith('Quota limit reached'); // Don't re-mark our own internal exceeded messages
45
46
 
46
47
  if (isRateLimit) {
47
48
  this.providerManager.markRateLimited(provider, model, errorMessage);
@@ -547,6 +548,90 @@ class DirectLLMManager {
547
548
  });
548
549
  }
549
550
 
551
+ /**
552
+ * Call the OpenCode CLI with a prompt via -p flag
553
+ */
554
+ async callOpenCode(model, prompt, options = {}) {
555
+ const { onChunk, onComplete, onError } = options;
556
+ const { spawn } = require('child_process');
557
+ const path = require('path');
558
+ const os = require('os');
559
+
560
+ return new Promise((resolve) => {
561
+ let fullResponse = '';
562
+ let errorOutput = '';
563
+
564
+ // Resolve opencode binary — check well-known path first
565
+ let cmd = 'opencode';
566
+ const knownPath = path.join(os.homedir(), '.opencode', 'bin', 'opencode');
567
+ try {
568
+ require('fs').accessSync(knownPath, require('fs').constants.X_OK);
569
+ cmd = knownPath;
570
+ } catch {
571
+ // fall back to PATH lookup
572
+ }
573
+
574
+ const opencode = spawn(cmd, ['-p', prompt], {
575
+ stdio: ['ignore', 'pipe', 'pipe']
576
+ });
577
+
578
+ opencode.stdout.on('data', (data) => {
579
+ const chunk = data.toString();
580
+ fullResponse += chunk;
581
+ if (onChunk) onChunk(chunk);
582
+ });
583
+
584
+ opencode.stderr.on('data', (data) => {
585
+ errorOutput += data.toString();
586
+ });
587
+
588
+ opencode.on('close', (code) => {
589
+ if (code === 0) {
590
+ if (onComplete) onComplete(fullResponse);
591
+ resolve({ success: true, response: fullResponse });
592
+ } else {
593
+ const error = `OpenCode CLI exited with code ${code}: ${errorOutput}`;
594
+ if (onError) onError(error);
595
+ this.detectAndSaveRateLimit('opencode', 'opencode-cli', errorOutput);
596
+ resolve({ success: false, error });
597
+ }
598
+ });
599
+
600
+ opencode.on('error', (err) => {
601
+ const error = `Failed to start OpenCode CLI: ${err.message}`;
602
+ if (onError) onError(error);
603
+ resolve({ success: false, error });
604
+ });
605
+ });
606
+ }
607
+
608
+ /**
609
+ * Check if OpenCode CLI is available
610
+ * @returns {Promise<boolean>}
611
+ */
612
+ async isOpenCodeAvailable() {
613
+ const { spawn } = require('child_process');
614
+ const path = require('path');
615
+ const os = require('os');
616
+
617
+ // Try well-known path first, then fall back to PATH
618
+ let cmd = 'opencode';
619
+ const knownPath = path.join(os.homedir(), '.opencode', 'bin', 'opencode');
620
+ try {
621
+ require('fs').accessSync(knownPath, require('fs').constants.X_OK);
622
+ cmd = knownPath;
623
+ } catch {
624
+ // fall back to PATH lookup
625
+ }
626
+
627
+ return new Promise((resolve) => {
628
+ const proc = spawn(cmd, ['--version'], { stdio: ['ignore', 'pipe', 'pipe'] });
629
+ proc.on('close', (code) => resolve(code === 0));
630
+ proc.on('error', () => resolve(false));
631
+ setTimeout(() => { proc.kill(); resolve(false); }, 5000);
632
+ });
633
+ }
634
+
550
635
  /**
551
636
  * Call any LLM provider
552
637
  * @param {Object} config - Provider configuration
@@ -598,6 +683,9 @@ class DirectLLMManager {
598
683
  case 'cline':
599
684
  result = await this.callCline(currentModel, prompt, options);
600
685
  break;
686
+ case 'opencode':
687
+ result = await this.callOpenCode(currentModel, prompt, options);
688
+ break;
601
689
  default:
602
690
  return { success: false, error: `Unknown provider: ${provider}` };
603
691
  }