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.
- package/README.md +240 -0
- package/package.json +10 -2
- package/src/agents/Agent.js +300 -0
- package/src/agents/AgentAdditionService.js +311 -0
- package/src/agents/AgentCheckService.js +690 -0
- package/src/agents/AgentInstallationService.js +140 -0
- package/src/agents/AgentSetupService.js +467 -0
- package/src/agents/AgentStatus.js +183 -0
- package/src/agents/AgentVerificationService.js +634 -0
- package/src/agents/ConfigurationSchemaValidator.js +543 -0
- package/src/agents/EnvironmentConfigurationManager.js +602 -0
- package/src/agents/InstallationErrorHandler.js +372 -0
- package/src/agents/InstallationLog.js +363 -0
- package/src/agents/InstallationMethod.js +510 -0
- package/src/agents/InstallationOrchestrator.js +352 -0
- package/src/agents/InstallationProgressReporter.js +372 -0
- package/src/agents/InstallationRetryManager.js +322 -0
- package/src/agents/InstallationType.js +254 -0
- package/src/agents/OperationTypes.js +310 -0
- package/src/agents/PerformanceMetricsCollector.js +493 -0
- package/src/agents/SecurityValidationService.js +534 -0
- package/src/agents/VerificationTest.js +354 -0
- package/src/agents/VerificationType.js +226 -0
- package/src/agents/WindowsPermissionHandler.js +518 -0
- package/src/agents/config/AgentConfigManager.js +393 -0
- package/src/agents/config/AgentDefaultsRegistry.js +373 -0
- package/src/agents/config/ConfigValidator.js +281 -0
- package/src/agents/discovery/AgentDiscoveryService.js +707 -0
- package/src/agents/logging/AgentLogger.js +511 -0
- package/src/agents/status/AgentStatusManager.js +481 -0
- package/src/agents/storage/FileManager.js +454 -0
- package/src/agents/verification/AgentCommunicationTester.js +474 -0
- package/src/agents/verification/BaseVerifier.js +430 -0
- package/src/agents/verification/CommandVerifier.js +480 -0
- package/src/agents/verification/FileOperationVerifier.js +453 -0
- package/src/agents/verification/ResultAnalyzer.js +707 -0
- package/src/agents/verification/TestRequirementManager.js +495 -0
- package/src/agents/verification/VerificationRunner.js +433 -0
- package/src/agents/windows/BaseWindowsInstaller.js +441 -0
- package/src/agents/windows/ChocolateyInstaller.js +509 -0
- package/src/agents/windows/DirectInstaller.js +443 -0
- package/src/agents/windows/InstallerFactory.js +391 -0
- package/src/agents/windows/NpmInstaller.js +505 -0
- package/src/agents/windows/PowerShellInstaller.js +458 -0
- package/src/agents/windows/WinGetInstaller.js +390 -0
- package/src/analysis/analysis-reporter.js +132 -0
- package/src/analysis/boundary-detector.js +712 -0
- package/src/analysis/categorizer.js +340 -0
- package/src/analysis/codebase-scanner.js +384 -0
- package/src/analysis/line-counter.js +513 -0
- package/src/analysis/priority-calculator.js +679 -0
- package/src/analysis/report/analysis-report.js +250 -0
- package/src/analysis/report/package-analyzer.js +278 -0
- package/src/analysis/report/recommendation-generator.js +382 -0
- package/src/analysis/report/statistics-generator.js +515 -0
- package/src/analysis/reports/analysis-report-model.js +101 -0
- package/src/analysis/reports/recommendation-generator.js +283 -0
- package/src/analysis/reports/report-generators.js +191 -0
- package/src/analysis/reports/statistics-calculator.js +231 -0
- package/src/analysis/reports/trend-analyzer.js +219 -0
- package/src/analysis/strategy-generator.js +814 -0
- package/src/auto-mode/AutoModeBusinessLogic.js +836 -0
- package/src/config/refactoring-config.js +307 -0
- package/src/health-tracking/json-storage.js +38 -2
- package/src/ide-integration/applescript-manager-core.js +233 -0
- package/src/ide-integration/applescript-manager.cjs +357 -28
- package/src/ide-integration/applescript-manager.js +89 -3599
- package/src/ide-integration/cdp-manager.js +306 -0
- package/src/ide-integration/claude-code-cli-manager.cjs +1 -1
- package/src/ide-integration/continuation-handler.js +337 -0
- package/src/ide-integration/ide-status-checker.js +292 -0
- package/src/ide-integration/macos-ide-manager.js +627 -0
- package/src/ide-integration/macos-text-sender.js +528 -0
- package/src/ide-integration/response-reader.js +548 -0
- package/src/ide-integration/windows-automation-manager.js +121 -0
- package/src/ide-integration/windows-ide-manager.js +373 -0
- package/src/index.cjs +25 -3
- package/src/index.js +15 -1
- package/src/llm/direct-llm-manager.cjs +90 -2
- package/src/models/compliance-report.js +538 -0
- package/src/models/file-analysis.js +681 -0
- package/src/models/refactoring-plan.js +770 -0
- package/src/monitoring/alert-system.js +834 -0
- package/src/monitoring/compliance-progress-tracker.js +437 -0
- package/src/monitoring/continuous-scan-notifications.js +661 -0
- package/src/monitoring/continuous-scanner.js +279 -0
- package/src/monitoring/file-monitor/file-analyzer.js +262 -0
- package/src/monitoring/file-monitor/file-monitor.js +237 -0
- package/src/monitoring/file-monitor/watcher.js +194 -0
- package/src/monitoring/file-monitor.js +17 -0
- package/src/monitoring/notification-manager.js +437 -0
- package/src/monitoring/scanner-core.js +368 -0
- package/src/monitoring/scanner-events.js +214 -0
- package/src/monitoring/violation-notification-system.js +515 -0
- package/src/refactoring/boundaries/cohesion-analyzer.js +316 -0
- package/src/refactoring/boundaries/extraction-result.js +285 -0
- package/src/refactoring/boundaries/extraction-strategies.js +392 -0
- package/src/refactoring/boundaries/module-boundary.js +209 -0
- package/src/refactoring/boundary/boundary-detector.js +741 -0
- package/src/refactoring/boundary/boundary-types.js +405 -0
- package/src/refactoring/boundary/extraction-strategies.js +554 -0
- package/src/refactoring/boundary-extraction-result.js +77 -0
- package/src/refactoring/boundary-extraction-strategies.js +330 -0
- package/src/refactoring/boundary-extractor.js +384 -0
- package/src/refactoring/boundary-types.js +46 -0
- package/src/refactoring/circular/circular-dependency.js +88 -0
- package/src/refactoring/circular/cycle-detection.js +147 -0
- package/src/refactoring/circular/dependency-node.js +82 -0
- package/src/refactoring/circular/dependency-result.js +107 -0
- package/src/refactoring/circular/dependency-types.js +58 -0
- package/src/refactoring/circular/graph-builder.js +213 -0
- package/src/refactoring/circular/resolution-strategy.js +72 -0
- package/src/refactoring/circular/strategy-generator.js +229 -0
- package/src/refactoring/circular-dependency-resolver-original.js +809 -0
- package/src/refactoring/circular-dependency-resolver.js +200 -0
- package/src/refactoring/code-mover.js +761 -0
- package/src/refactoring/file-splitter.js +696 -0
- package/src/refactoring/functionality-validator.js +816 -0
- package/src/refactoring/import-manager.js +774 -0
- package/src/refactoring/module-boundary.js +107 -0
- package/src/refactoring/refactoring-executor.js +672 -0
- package/src/refactoring/refactoring-rollback.js +614 -0
- package/src/refactoring/test-validator.js +631 -0
- package/src/requirement-management/default-requirement-manager.js +321 -0
- package/src/requirement-management/requirement-file-parser.js +159 -0
- package/src/requirement-management/requirement-sequencer.js +221 -0
- package/src/rui/commands/AgentCommandParser.js +600 -0
- package/src/rui/commands/AgentCommands.js +487 -0
- package/src/rui/commands/AgentResponseFormatter.js +832 -0
- package/src/scripts/verify-full-compliance.js +269 -0
- package/src/sync/sync-engine-core.js +1 -0
- package/src/sync/sync-engine-remote-handlers.js +135 -0
- package/src/task-generation/automated-task-generator.js +351 -0
- package/src/task-generation/prioritizer.js +287 -0
- package/src/task-generation/task-list-updater.js +215 -0
- package/src/task-generation/task-management-integration.js +480 -0
- package/src/task-generation/task-manager-integration.js +270 -0
- package/src/task-generation/violation-task-generator.js +474 -0
- package/src/task-management/continuous-scan-integration.js +342 -0
- package/src/timeout-management/index.js +12 -3
- package/src/timeout-management/response-time-tracker.js +167 -0
- package/src/timeout-management/timeout-calculator.js +159 -0
- package/src/timeout-management/timeout-config-manager.js +172 -0
- package/src/utils/ast-analyzer.js +417 -0
- package/src/utils/current-requirement-manager.js +276 -0
- package/src/utils/current-requirement-operations.js +472 -0
- package/src/utils/dependency-mapper.js +456 -0
- package/src/utils/download-with-progress.js +4 -2
- package/src/utils/electron-update-checker.js +4 -1
- package/src/utils/file-size-analyzer.js +272 -0
- package/src/utils/import-updater.js +280 -0
- package/src/utils/refactoring-tools.js +512 -0
- package/src/utils/report-generator.js +569 -0
- package/src/utils/reports/report-analysis.js +218 -0
- package/src/utils/reports/report-types.js +55 -0
- package/src/utils/reports/summary-generators.js +102 -0
- package/src/utils/requirement-file-management.js +157 -0
- package/src/utils/requirement-helpers/requirement-file-ops.js +392 -0
- package/src/utils/requirement-helpers/requirement-mover.js +414 -0
- package/src/utils/requirement-helpers/requirement-parser.js +326 -0
- package/src/utils/requirement-helpers/requirement-status.js +320 -0
- package/src/utils/requirement-helpers-new.js +55 -0
- package/src/utils/requirement-helpers-refactored.js +367 -0
- package/src/utils/requirement-helpers.js +291 -1191
- package/src/utils/requirement-movement-operations.js +450 -0
- package/src/utils/requirement-movement.js +312 -0
- package/src/utils/requirement-parsing-helpers.js +56 -0
- package/src/utils/requirement-statistics.js +200 -0
- package/src/utils/requirement-text-utils.js +58 -0
- package/src/utils/rollback/rollback-handlers.js +125 -0
- package/src/utils/rollback/rollback-operation.js +63 -0
- package/src/utils/rollback/rollback-recorder.js +166 -0
- package/src/utils/rollback/rollback-state-manager.js +175 -0
- package/src/utils/rollback/rollback-types.js +33 -0
- package/src/utils/rollback/rollback-utils.js +110 -0
- package/src/utils/rollback-manager-original.js +569 -0
- package/src/utils/rollback-manager.js +202 -0
- package/src/utils/smoke-test-cli.js +362 -0
- package/src/utils/smoke-test-gui.js +351 -0
- package/src/utils/smoke-test-orchestrator.js +321 -0
- package/src/utils/smoke-test-runner.js +60 -0
- package/src/utils/smoke-test-web.js +347 -0
- package/src/utils/specification-helpers.js +39 -13
- package/src/utils/specification-migration.js +97 -0
- package/src/utils/test-runner.js +579 -0
- package/src/utils/validation-framework.js +518 -0
- package/src/validation/compliance-analyzer.js +197 -0
- package/src/validation/compliance-report-generator.js +343 -0
- package/src/validation/compliance-reporter.js +711 -0
- package/src/validation/compliance-rules.js +127 -0
- package/src/validation/constitution-validator-new.js +196 -0
- package/src/validation/constitution-validator.js +17 -0
- package/src/validation/file-validators.js +170 -0
- package/src/validation/line-limit/file-analyzer.js +201 -0
- package/src/validation/line-limit/line-limit-validator.js +208 -0
- package/src/validation/line-limit/validation-result.js +144 -0
- package/src/validation/line-limit-core.js +225 -0
- package/src/validation/line-limit-reporter.js +134 -0
- package/src/validation/line-limit-result.js +125 -0
- package/src/validation/line-limit-validator.js +41 -0
- package/src/validation/metrics-calculator.js +660 -0
- package/src/sync/sync-engine-backup.js +0 -559
|
@@ -318,4 +318,310 @@ export class CDPManager {
|
|
|
318
318
|
return `Error: ${error.message}`;
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Detect continuation prompts using DOM inspection
|
|
324
|
+
* @param {Object} client - CDP client
|
|
325
|
+
* @returns {Promise<boolean>} True if continuation prompt detected
|
|
326
|
+
*/
|
|
327
|
+
async detectContinuationPrompt(client) {
|
|
328
|
+
try {
|
|
329
|
+
const { DOM, Runtime } = client;
|
|
330
|
+
|
|
331
|
+
// Get document root
|
|
332
|
+
const { result: { root } } = await DOM.getDocument();
|
|
333
|
+
|
|
334
|
+
// Query for continuation buttons
|
|
335
|
+
const continuationSelectors = [
|
|
336
|
+
'button[title*="Continue"]',
|
|
337
|
+
'button[title*="Proceed"]',
|
|
338
|
+
'button[title*="Next"]',
|
|
339
|
+
'button[title*="Keep Going"]',
|
|
340
|
+
'button[title*="Resume"]',
|
|
341
|
+
'button[aria-label*="Continue"]',
|
|
342
|
+
'button[aria-label*="Proceed"]',
|
|
343
|
+
'button[aria-label*="Next"]',
|
|
344
|
+
'button[aria-label*="Keep Going"]',
|
|
345
|
+
'button[aria-label*="Resume"]',
|
|
346
|
+
'[class*="continue"] button',
|
|
347
|
+
'[class*="proceed"] button',
|
|
348
|
+
'[class*="next"] button',
|
|
349
|
+
'button:contains("Continue")',
|
|
350
|
+
'button:contains("Proceed")',
|
|
351
|
+
'button:contains("Next")',
|
|
352
|
+
'button:contains("Keep Going")',
|
|
353
|
+
'button:contains("Resume")',
|
|
354
|
+
'button:contains("Continue Generation")'
|
|
355
|
+
];
|
|
356
|
+
|
|
357
|
+
for (const selector of continuationSelectors) {
|
|
358
|
+
try {
|
|
359
|
+
const { result: { nodes } } = await DOM.querySelectorAll({
|
|
360
|
+
nodeId: root.nodeId,
|
|
361
|
+
selector: selector.replace(':contains(', '[text*="').replace(')', '"]')
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
if (nodes && nodes.length > 0) {
|
|
365
|
+
// Check if button text contains continuation keywords
|
|
366
|
+
for (const node of nodes) {
|
|
367
|
+
const { result: { value } } = await DOM.getAttributes({ nodeId: node.nodeId });
|
|
368
|
+
if (value) {
|
|
369
|
+
const attributes = value.split(' ').map(attr => attr.replace(/"/g, ''));
|
|
370
|
+
const textContent = attributes.find(attr =>
|
|
371
|
+
attr.toLowerCase().includes('continue') ||
|
|
372
|
+
attr.toLowerCase().includes('proceed') ||
|
|
373
|
+
attr.toLowerCase().includes('next') ||
|
|
374
|
+
attr.toLowerCase().includes('keep going') ||
|
|
375
|
+
attr.toLowerCase().includes('resume')
|
|
376
|
+
);
|
|
377
|
+
|
|
378
|
+
if (textContent) {
|
|
379
|
+
return true;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
} catch (e) {
|
|
385
|
+
// Continue with next selector if this one fails
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
return false;
|
|
390
|
+
} catch (error) {
|
|
391
|
+
console.error('Error detecting continuation prompt:', error);
|
|
392
|
+
return false;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Click detected continuation button
|
|
398
|
+
* @param {Object} client - CDP client
|
|
399
|
+
* @returns {Promise<boolean>} True if button clicked successfully
|
|
400
|
+
*/
|
|
401
|
+
async clickContinuationButton(client) {
|
|
402
|
+
try {
|
|
403
|
+
const { DOM, Runtime } = client;
|
|
404
|
+
|
|
405
|
+
// Get document root
|
|
406
|
+
const { result: { root } } = await DOM.getDocument();
|
|
407
|
+
|
|
408
|
+
// Query for continuation buttons
|
|
409
|
+
const continuationSelectors = [
|
|
410
|
+
'button[title*="Continue"]',
|
|
411
|
+
'button[title*="Proceed"]',
|
|
412
|
+
'button[title*="Next"]',
|
|
413
|
+
'button[title*="Keep Going"]',
|
|
414
|
+
'button[title*="Resume"]',
|
|
415
|
+
'button[aria-label*="Continue"]',
|
|
416
|
+
'button[aria-label*="Proceed"]',
|
|
417
|
+
'button[aria-label*="Next"]',
|
|
418
|
+
'button[aria-label*="Keep Going"]',
|
|
419
|
+
'button[aria-label*="Resume"]',
|
|
420
|
+
'[class*="continue"] button',
|
|
421
|
+
'[class*="proceed"] button',
|
|
422
|
+
'[class*="next"] button'
|
|
423
|
+
];
|
|
424
|
+
|
|
425
|
+
for (const selector of continuationSelectors) {
|
|
426
|
+
try {
|
|
427
|
+
const { result: { nodes } } = await DOM.querySelectorAll({
|
|
428
|
+
nodeId: root.nodeId,
|
|
429
|
+
selector: selector
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
if (nodes && nodes.length > 0) {
|
|
433
|
+
// Click the first found button
|
|
434
|
+
const node = nodes[0];
|
|
435
|
+
await DOM.resolveNode({ nodeId: node.nodeId });
|
|
436
|
+
|
|
437
|
+
// Use Runtime to click the button
|
|
438
|
+
const clickExpression = `document.querySelector('${selector}').click()`;
|
|
439
|
+
await Runtime.evaluate({ expression: clickExpression });
|
|
440
|
+
|
|
441
|
+
return true;
|
|
442
|
+
}
|
|
443
|
+
} catch (e) {
|
|
444
|
+
// Continue with next selector if this one fails
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
return false;
|
|
449
|
+
} catch (error) {
|
|
450
|
+
console.error('Error clicking continuation button:', error);
|
|
451
|
+
return false;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Check for continuation prompts in the IDE
|
|
457
|
+
* @param {string} ide - The IDE name
|
|
458
|
+
* @returns {Promise<Object>} Result with continuation detected and button info
|
|
459
|
+
*/
|
|
460
|
+
async checkForContinuation(ide) {
|
|
461
|
+
try {
|
|
462
|
+
const { Runtime } = await this.connectToIDE(ide);
|
|
463
|
+
|
|
464
|
+
const expression = `(() => {
|
|
465
|
+
try {
|
|
466
|
+
// Look for continuation buttons or prompts
|
|
467
|
+
const continuationSelectors = [
|
|
468
|
+
'button[title*="Continue"]',
|
|
469
|
+
'button[title*="Proceed"]',
|
|
470
|
+
'button:contains("Continue")',
|
|
471
|
+
'button:contains("Proceed")',
|
|
472
|
+
'button:contains("Next")',
|
|
473
|
+
'button:contains("Continue Generation")',
|
|
474
|
+
'button:contains("Keep Going")',
|
|
475
|
+
'[class*="continue"] button',
|
|
476
|
+
'[class*="proceed"] button',
|
|
477
|
+
'[class*="next"] button',
|
|
478
|
+
'button[aria-label*="Continue"]',
|
|
479
|
+
'button[aria-label*="Proceed"]'
|
|
480
|
+
];
|
|
481
|
+
|
|
482
|
+
// Look for continuation text prompts
|
|
483
|
+
const textSelectors = [
|
|
484
|
+
'[class*="message"]:contains("Continue")',
|
|
485
|
+
'[class*="message"]:contains("Proceed")',
|
|
486
|
+
'[class*="prompt"]:contains("Continue")',
|
|
487
|
+
'[class*="prompt"]:contains("Proceed")',
|
|
488
|
+
'[class*="dialog"]:contains("Continue")',
|
|
489
|
+
'[class*="dialog"]:contains("Proceed")'
|
|
490
|
+
];
|
|
491
|
+
|
|
492
|
+
const foundButtons = [];
|
|
493
|
+
const foundTexts = [];
|
|
494
|
+
|
|
495
|
+
// Check for buttons
|
|
496
|
+
continuationSelectors.forEach(selector => {
|
|
497
|
+
try {
|
|
498
|
+
const elements = document.querySelectorAll(selector);
|
|
499
|
+
elements.forEach(el => {
|
|
500
|
+
if (el && el.offsetParent !== null) { // Check if visible
|
|
501
|
+
foundButtons.push({
|
|
502
|
+
selector,
|
|
503
|
+
text: el.textContent || el.innerText || '',
|
|
504
|
+
title: el.title || '',
|
|
505
|
+
ariaLabel: el.getAttribute('aria-label') || ''
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
} catch (e) {
|
|
510
|
+
// Some selectors may not be supported, ignore
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
|
|
514
|
+
// Check for text prompts
|
|
515
|
+
textSelectors.forEach(selector => {
|
|
516
|
+
try {
|
|
517
|
+
const elements = document.querySelectorAll(selector);
|
|
518
|
+
elements.forEach(el => {
|
|
519
|
+
if (el && el.offsetParent !== null) { // Check if visible
|
|
520
|
+
const text = el.textContent || el.innerText || '';
|
|
521
|
+
if (text.toLowerCase().includes('continue') ||
|
|
522
|
+
text.toLowerCase().includes('proceed') ||
|
|
523
|
+
text.toLowerCase().includes('keep going')) {
|
|
524
|
+
foundTexts.push({
|
|
525
|
+
selector,
|
|
526
|
+
text: text.trim()
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
} catch (e) {
|
|
532
|
+
// Some selectors may not be supported, ignore
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
return {
|
|
537
|
+
continuationDetected: foundButtons.length > 0 || foundTexts.length > 0,
|
|
538
|
+
buttons: foundButtons,
|
|
539
|
+
texts: foundTexts,
|
|
540
|
+
totalFound: foundButtons.length + foundTexts.length
|
|
541
|
+
};
|
|
542
|
+
} catch (error) {
|
|
543
|
+
return {
|
|
544
|
+
continuationDetected: false,
|
|
545
|
+
error: error.message,
|
|
546
|
+
buttons: [],
|
|
547
|
+
texts: []
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
})()`;
|
|
551
|
+
|
|
552
|
+
const { result } = await Runtime.evaluate({ expression, returnByValue: true });
|
|
553
|
+
return result.value || { continuationDetected: false, buttons: [], texts: [] };
|
|
554
|
+
} catch (error) {
|
|
555
|
+
console.error(`Error checking for continuation in ${ide}:`, error);
|
|
556
|
+
return { continuationDetected: false, error: error.message, buttons: [], texts: [] };
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* Click a continuation button if found
|
|
562
|
+
* @param {string} ide - The IDE name
|
|
563
|
+
* @returns {Promise<Object>} Result of the operation
|
|
564
|
+
*/
|
|
565
|
+
async clickContinuationButton(ide) {
|
|
566
|
+
try {
|
|
567
|
+
const { Runtime } = await this.connectToIDE(ide);
|
|
568
|
+
|
|
569
|
+
const expression = `(() => {
|
|
570
|
+
try {
|
|
571
|
+
// Look for continuation buttons
|
|
572
|
+
const continuationSelectors = [
|
|
573
|
+
'button[title*="Continue"]',
|
|
574
|
+
'button[title*="Proceed"]',
|
|
575
|
+
'button:contains("Continue")',
|
|
576
|
+
'button:contains("Proceed")',
|
|
577
|
+
'button:contains("Next")',
|
|
578
|
+
'button:contains("Continue Generation")',
|
|
579
|
+
'button:contains("Keep Going")',
|
|
580
|
+
'[class*="continue"] button',
|
|
581
|
+
'[class*="proceed"] button',
|
|
582
|
+
'[class*="next"] button',
|
|
583
|
+
'button[aria-label*="Continue"]',
|
|
584
|
+
'button[aria-label*="Proceed"]'
|
|
585
|
+
];
|
|
586
|
+
|
|
587
|
+
for (const selector of continuationSelectors) {
|
|
588
|
+
try {
|
|
589
|
+
const elements = document.querySelectorAll(selector);
|
|
590
|
+
for (const el of elements) {
|
|
591
|
+
if (el && el.offsetParent !== null) { // Check if visible
|
|
592
|
+
el.click();
|
|
593
|
+
return {
|
|
594
|
+
success: true,
|
|
595
|
+
clicked: true,
|
|
596
|
+
selector: selector,
|
|
597
|
+
text: el.textContent || el.innerText || ''
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
} catch (e) {
|
|
602
|
+
// Some selectors may not be supported, continue
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
return {
|
|
607
|
+
success: false,
|
|
608
|
+
clicked: false,
|
|
609
|
+
message: 'No continuation button found'
|
|
610
|
+
};
|
|
611
|
+
} catch (error) {
|
|
612
|
+
return {
|
|
613
|
+
success: false,
|
|
614
|
+
clicked: false,
|
|
615
|
+
error: error.message
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
})()`;
|
|
619
|
+
|
|
620
|
+
const { result } = await Runtime.evaluate({ expression, returnByValue: true });
|
|
621
|
+
return result.value || { success: false, clicked: false, message: 'No result' };
|
|
622
|
+
} catch (error) {
|
|
623
|
+
console.error(`Error clicking continuation button in ${ide}:`, error);
|
|
624
|
+
return { success: false, clicked: false, error: error.message };
|
|
625
|
+
}
|
|
626
|
+
}
|
|
321
627
|
}
|
|
@@ -312,7 +312,7 @@ class ClaudeCodeCLIManager {
|
|
|
312
312
|
// If we have a reset time, update the provider manager
|
|
313
313
|
if (rateLimitInfo.resetTime) {
|
|
314
314
|
try {
|
|
315
|
-
const ProviderManager = require('
|
|
315
|
+
const ProviderManager = require('../ide-integration/provider-manager.cjs');
|
|
316
316
|
const providerManager = new ProviderManager();
|
|
317
317
|
providerManager.markRateLimited('claude-code', 'claude-code-cli', rateLimitInfo.message);
|
|
318
318
|
} catch (e) {
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
// @vibecodingmachine/core - Continuation Handler
|
|
2
|
+
// Cross-platform continuation button detection and clicking
|
|
3
|
+
|
|
4
|
+
const { execSync } = require('child_process');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Continuation Handler for cross-platform continuation button operations
|
|
8
|
+
* Handles continuation detection and clicking for all supported IDEs
|
|
9
|
+
*/
|
|
10
|
+
class ContinuationHandler {
|
|
11
|
+
constructor(platform, windowsManager = null) {
|
|
12
|
+
this.logger = console;
|
|
13
|
+
this.platform = platform;
|
|
14
|
+
this.windowsManager = windowsManager;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Detect continuation prompts using platform-specific methods
|
|
19
|
+
* @returns {Promise<boolean>} True if continuation prompt detected
|
|
20
|
+
*/
|
|
21
|
+
async detectContinuationPrompt() {
|
|
22
|
+
try {
|
|
23
|
+
const continuationVariations = ['Continue', 'Proceed', 'Next', 'Keep Going', 'Resume'];
|
|
24
|
+
|
|
25
|
+
for (const variation of continuationVariations) {
|
|
26
|
+
try {
|
|
27
|
+
const script = this._getContinuationButtonScript(variation);
|
|
28
|
+
const result = execSync(`osascript -e '${script.replace(/'/g, "'\\\\''")}'`, {
|
|
29
|
+
encoding: 'utf8',
|
|
30
|
+
timeout: 5000,
|
|
31
|
+
stdio: 'pipe'
|
|
32
|
+
}).trim();
|
|
33
|
+
|
|
34
|
+
if (result && result.toLowerCase().includes('found')) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
} catch (error) {
|
|
38
|
+
// Continue with next variation
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return false;
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error('Error detecting continuation prompt:', error);
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Click detected continuation button using platform-specific methods
|
|
51
|
+
* @returns {Promise<boolean>} True if button clicked successfully
|
|
52
|
+
*/
|
|
53
|
+
async clickContinuationButton() {
|
|
54
|
+
try {
|
|
55
|
+
const continuationVariations = ['Continue', 'Proceed', 'Next', 'Keep Going', 'Resume'];
|
|
56
|
+
|
|
57
|
+
for (const variation of continuationVariations) {
|
|
58
|
+
try {
|
|
59
|
+
const script = this._getClickButtonScript(variation);
|
|
60
|
+
const result = execSync(`osascript -e '${script.replace(/'/g, "'\\\\''")}'`, {
|
|
61
|
+
encoding: 'utf8',
|
|
62
|
+
timeout: 5000,
|
|
63
|
+
stdio: 'pipe'
|
|
64
|
+
}).trim();
|
|
65
|
+
|
|
66
|
+
if (result && result.toLowerCase().includes('clicked')) {
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
} catch (error) {
|
|
70
|
+
// Continue with next variation
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return false;
|
|
75
|
+
} catch (error) {
|
|
76
|
+
console.error('Error clicking continuation button:', error);
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Check for continuation prompts using platform-specific methods
|
|
83
|
+
* @param {string} ide - The IDE name
|
|
84
|
+
* @returns {Promise<Object>} Result with continuation detected and button info
|
|
85
|
+
*/
|
|
86
|
+
async checkForContinuation(ide) {
|
|
87
|
+
try {
|
|
88
|
+
if (this.platform === 'darwin') {
|
|
89
|
+
return await this.checkForContinuationMacOS(ide);
|
|
90
|
+
} else if (this.platform === 'win32' && this.windowsManager) {
|
|
91
|
+
return await this.checkForContinuationWindows(ide);
|
|
92
|
+
} else {
|
|
93
|
+
return { continuationDetected: false, error: 'Unsupported platform' };
|
|
94
|
+
}
|
|
95
|
+
} catch (error) {
|
|
96
|
+
this.logger.error(`Error checking for continuation in ${ide}:`, error);
|
|
97
|
+
return { continuationDetected: false, error: error.message };
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Click a continuation button if found
|
|
103
|
+
* @param {string} ide - The IDE name
|
|
104
|
+
* @returns {Promise<Object>} Result of operation
|
|
105
|
+
*/
|
|
106
|
+
async clickContinuationButton(ide) {
|
|
107
|
+
try {
|
|
108
|
+
if (this.platform === 'darwin') {
|
|
109
|
+
return await this.clickContinuationButtonMacOS(ide);
|
|
110
|
+
} else if (this.platform === 'win32' && this.windowsManager) {
|
|
111
|
+
return await this.clickContinuationButtonWindows(ide);
|
|
112
|
+
} else {
|
|
113
|
+
return { success: false, error: 'Unsupported platform' };
|
|
114
|
+
}
|
|
115
|
+
} catch (error) {
|
|
116
|
+
this.logger.error(`Error clicking continuation button in ${ide}:`, error);
|
|
117
|
+
return { success: false, error: error.message };
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Check for continuation prompts on macOS using AppleScript
|
|
123
|
+
* @param {string} ide - The IDE name
|
|
124
|
+
* @returns {Promise<Object>} Result with continuation detected and button info
|
|
125
|
+
*/
|
|
126
|
+
async checkForContinuationMacOS(ide) {
|
|
127
|
+
try {
|
|
128
|
+
const script = `
|
|
129
|
+
tell application "System Events"
|
|
130
|
+
try
|
|
131
|
+
set frontApp to first application process whose frontmost is true
|
|
132
|
+
set appName to name of frontApp
|
|
133
|
+
|
|
134
|
+
-- Look for continuation buttons
|
|
135
|
+
set continuationButtons to {}
|
|
136
|
+
set buttonNames to {"Continue", "Proceed", "Next", "Continue Generation", "Keep Going"}
|
|
137
|
+
|
|
138
|
+
repeat with buttonName in buttonNames
|
|
139
|
+
try
|
|
140
|
+
set foundButtons to (buttons of frontApp whose name contains buttonName)
|
|
141
|
+
repeat with aButton in foundButtons
|
|
142
|
+
if exists aButton then
|
|
143
|
+
set end of continuationButtons to {name:aButton, visible:true}
|
|
144
|
+
end if
|
|
145
|
+
end repeat
|
|
146
|
+
end try
|
|
147
|
+
end repeat
|
|
148
|
+
|
|
149
|
+
-- Look for continuation text in UI elements
|
|
150
|
+
set continuationTexts to {}
|
|
151
|
+
set textElements to (static texts of frontApp)
|
|
152
|
+
repeat with textElement in textElements
|
|
153
|
+
try
|
|
154
|
+
set elementText to name of textElement
|
|
155
|
+
if elementText contains "Continue" or elementText contains "Proceed" or elementText contains "Keep Going" then
|
|
156
|
+
set end of continuationTexts to {name: elementText, visible: true}
|
|
157
|
+
end if
|
|
158
|
+
end try
|
|
159
|
+
end repeat
|
|
160
|
+
|
|
161
|
+
return {buttons: continuationButtons, texts: continuationTexts}
|
|
162
|
+
on error errMsg number errNum
|
|
163
|
+
return {errorMsg:errMsg}
|
|
164
|
+
end try
|
|
165
|
+
end tell
|
|
166
|
+
`;
|
|
167
|
+
|
|
168
|
+
const result = execSync(`osascript -e '${script}'`, {
|
|
169
|
+
encoding: 'utf8',
|
|
170
|
+
timeout: 10000
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
// Parse result (simplified parsing)
|
|
174
|
+
const continuationDetected = result.includes('Continue') || result.includes('Proceed');
|
|
175
|
+
|
|
176
|
+
return {
|
|
177
|
+
continuationDetected,
|
|
178
|
+
buttons: continuationDetected ? [{ text: 'Continue button detected' }] : [],
|
|
179
|
+
texts: continuationDetected ? [{ text: 'Continuation prompt detected' }] : [],
|
|
180
|
+
rawResult: result
|
|
181
|
+
};
|
|
182
|
+
} catch (error) {
|
|
183
|
+
return { continuationDetected: false, error: error.message };
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Check for continuation prompts on Windows using UI automation
|
|
189
|
+
* @param {string} ide - The IDE name
|
|
190
|
+
* @returns {Promise<Object>} Result with continuation detected and button info
|
|
191
|
+
*/
|
|
192
|
+
async checkForContinuationWindows(ide) {
|
|
193
|
+
try {
|
|
194
|
+
// Use Windows automation manager to check for continuation buttons
|
|
195
|
+
const result = await this.windowsManager.checkForContinuationButtons(ide);
|
|
196
|
+
return result || { continuationDetected: false, buttons: [], texts: [] };
|
|
197
|
+
} catch (error) {
|
|
198
|
+
return { continuationDetected: false, error: error.message };
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Click continuation button on macOS using AppleScript
|
|
204
|
+
* @param {string} ide - The IDE name
|
|
205
|
+
* @returns {Promise<Object>} Result of operation
|
|
206
|
+
*/
|
|
207
|
+
async clickContinuationButtonMacOS(ide) {
|
|
208
|
+
try {
|
|
209
|
+
const script = `
|
|
210
|
+
tell application "System Events"
|
|
211
|
+
try
|
|
212
|
+
set frontApp to first application process whose frontmost is true
|
|
213
|
+
set appName to name of frontApp
|
|
214
|
+
|
|
215
|
+
-- Look for and click continuation buttons
|
|
216
|
+
set buttonNames to {"Continue", "Proceed", "Next", "Continue Generation", "Keep Going"}
|
|
217
|
+
|
|
218
|
+
repeat with buttonName in buttonNames
|
|
219
|
+
try
|
|
220
|
+
set foundButtons to (buttons of frontApp whose name contains buttonName)
|
|
221
|
+
repeat with aButton in foundButtons
|
|
222
|
+
if exists aButton then
|
|
223
|
+
click aButton
|
|
224
|
+
return {success:true, clicked:true, button:buttonName}
|
|
225
|
+
end if
|
|
226
|
+
end repeat
|
|
227
|
+
end try
|
|
228
|
+
end repeat
|
|
229
|
+
|
|
230
|
+
return {success:false, clicked:false, message:"No continuation button found"}
|
|
231
|
+
on error errMsg number errNum
|
|
232
|
+
return {success:false, errorMsg:errMsg}
|
|
233
|
+
end try
|
|
234
|
+
end tell
|
|
235
|
+
`;
|
|
236
|
+
|
|
237
|
+
const result = execSync(`osascript -e '${script}'`, {
|
|
238
|
+
encoding: 'utf8',
|
|
239
|
+
timeout: 10000
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
return {
|
|
243
|
+
success: result.includes('success:true'),
|
|
244
|
+
clicked: result.includes('clicked:true'),
|
|
245
|
+
rawResult: result
|
|
246
|
+
};
|
|
247
|
+
} catch (error) {
|
|
248
|
+
return { success: false, clicked: false, error: error.message };
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Click continuation button on Windows using UI automation
|
|
254
|
+
* @param {string} ide - The IDE name
|
|
255
|
+
* @returns {Promise<Object>} Result of operation
|
|
256
|
+
*/
|
|
257
|
+
async clickContinuationButtonWindows(ide) {
|
|
258
|
+
try {
|
|
259
|
+
// Use Windows automation manager to click continuation buttons
|
|
260
|
+
const result = await this.windowsManager.clickContinuationButton(ide);
|
|
261
|
+
return result || { success: false, clicked: false, message: 'No result' };
|
|
262
|
+
} catch (error) {
|
|
263
|
+
return { success: false, clicked: false, error: error.message };
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Generate AppleScript for detecting continuation buttons
|
|
269
|
+
* @param {string} buttonText - Text to search for (Continue, Proceed, etc.)
|
|
270
|
+
* @returns {string} AppleScript code
|
|
271
|
+
*/
|
|
272
|
+
_getContinuationButtonScript(buttonText) {
|
|
273
|
+
return `
|
|
274
|
+
tell application "System Events"
|
|
275
|
+
set foundButton to false
|
|
276
|
+
repeat with proc in (every process)
|
|
277
|
+
try
|
|
278
|
+
repeat with w in (every window of proc)
|
|
279
|
+
try
|
|
280
|
+
repeat with btn in (every button of w)
|
|
281
|
+
try
|
|
282
|
+
set btnTitle to title of btn as string
|
|
283
|
+
if btnTitle contains "${buttonText}" then
|
|
284
|
+
set foundButton to true
|
|
285
|
+
exit repeat
|
|
286
|
+
end if
|
|
287
|
+
end try
|
|
288
|
+
end repeat
|
|
289
|
+
if foundButton then exit repeat
|
|
290
|
+
end try
|
|
291
|
+
end repeat
|
|
292
|
+
if foundButton then exit repeat
|
|
293
|
+
end try
|
|
294
|
+
end repeat
|
|
295
|
+
|
|
296
|
+
if foundButton then
|
|
297
|
+
return "${buttonText} button found"
|
|
298
|
+
else
|
|
299
|
+
return "${buttonText} button not found"
|
|
300
|
+
end if
|
|
301
|
+
end tell
|
|
302
|
+
`;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Generate AppleScript for clicking continuation buttons
|
|
307
|
+
* @param {string} buttonText - Text to search for (Continue, Proceed, etc.)
|
|
308
|
+
* @returns {string} AppleScript code
|
|
309
|
+
*/
|
|
310
|
+
_getClickButtonScript(buttonText) {
|
|
311
|
+
return `
|
|
312
|
+
tell application "System Events"
|
|
313
|
+
repeat with proc in (every process)
|
|
314
|
+
try
|
|
315
|
+
repeat with w in (every window of proc)
|
|
316
|
+
try
|
|
317
|
+
repeat with btn in (every button of w)
|
|
318
|
+
try
|
|
319
|
+
set btnTitle to title of btn as string
|
|
320
|
+
if btnTitle contains "${buttonText}" then
|
|
321
|
+
click btn
|
|
322
|
+
return "${buttonText} button clicked"
|
|
323
|
+
end if
|
|
324
|
+
end try
|
|
325
|
+
end repeat
|
|
326
|
+
end try
|
|
327
|
+
end repeat
|
|
328
|
+
end try
|
|
329
|
+
end repeat
|
|
330
|
+
|
|
331
|
+
return "${buttonText} button not found"
|
|
332
|
+
end tell
|
|
333
|
+
`;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
module.exports = ContinuationHandler;
|