erosolar-cli 2.1.248 → 2.1.252
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/agents/general.rules.json +10 -133
- package/agents/general.rules.json.bak +278 -0
- package/agents/general.rules.json.bak2 +306 -0
- package/dist/bin/erosolar.js +9 -5
- package/dist/bin/erosolar.js.map +1 -1
- package/dist/capabilities/bidirectionalAuditCapability.d.ts +26 -0
- package/dist/capabilities/bidirectionalAuditCapability.d.ts.map +1 -0
- package/dist/capabilities/bidirectionalAuditCapability.js +44 -0
- package/dist/capabilities/bidirectionalAuditCapability.js.map +1 -0
- package/dist/capabilities/globCapability.d.ts +3 -6
- package/dist/capabilities/globCapability.d.ts.map +1 -1
- package/dist/capabilities/globCapability.js +6 -10
- package/dist/capabilities/globCapability.js.map +1 -1
- package/dist/capabilities/index.d.ts +1 -18
- package/dist/capabilities/index.d.ts.map +1 -1
- package/dist/capabilities/index.js +1 -18
- package/dist/capabilities/index.js.map +1 -1
- package/dist/capabilities/orchestrationCapability.d.ts +177 -3
- package/dist/capabilities/orchestrationCapability.d.ts.map +1 -1
- package/dist/capabilities/orchestrationCapability.js +1592 -85
- package/dist/capabilities/orchestrationCapability.js.map +1 -1
- package/dist/capabilities/searchCapability.d.ts +8 -2
- package/dist/capabilities/searchCapability.d.ts.map +1 -1
- package/dist/capabilities/searchCapability.js +11 -6
- package/dist/capabilities/searchCapability.js.map +1 -1
- package/dist/contracts/tools.schema.json +9 -133
- package/dist/core/agentOrchestrator.d.ts.map +1 -1
- package/dist/core/agentOrchestrator.js +18 -1
- package/dist/core/agentOrchestrator.js.map +1 -1
- package/dist/core/aiErrorFixer.d.ts +1 -14
- package/dist/core/aiErrorFixer.d.ts.map +1 -1
- package/dist/core/aiErrorFixer.js +51 -239
- package/dist/core/aiErrorFixer.js.map +1 -1
- package/dist/core/alphaZeroEngine.d.ts +16 -256
- package/dist/core/alphaZeroEngine.d.ts.map +1 -1
- package/dist/core/alphaZeroEngine.js +22 -513
- package/dist/core/alphaZeroEngine.js.map +1 -1
- package/dist/core/completeAttackOrchestrator.d.ts +102 -0
- package/dist/core/completeAttackOrchestrator.d.ts.map +1 -0
- package/dist/core/completeAttackOrchestrator.js +293 -0
- package/dist/core/completeAttackOrchestrator.js.map +1 -0
- package/dist/core/defensiveSecurityToolkit.d.ts +373 -0
- package/dist/core/defensiveSecurityToolkit.d.ts.map +1 -0
- package/dist/core/defensiveSecurityToolkit.js +1304 -0
- package/dist/core/defensiveSecurityToolkit.js.map +1 -0
- package/dist/core/errors/errorTypes.d.ts +30 -57
- package/dist/core/errors/errorTypes.d.ts.map +1 -1
- package/dist/core/errors/errorTypes.js +51 -228
- package/dist/core/errors/errorTypes.js.map +1 -1
- package/dist/core/errors/safetyValidator.d.ts +19 -3
- package/dist/core/errors/safetyValidator.d.ts.map +1 -1
- package/dist/core/errors/safetyValidator.js +33 -71
- package/dist/core/errors/safetyValidator.js.map +1 -1
- package/dist/core/failureRecovery.d.ts +4 -100
- package/dist/core/failureRecovery.d.ts.map +1 -1
- package/dist/core/failureRecovery.js +16 -440
- package/dist/core/failureRecovery.js.map +1 -1
- package/dist/core/intelligentTargetResearcher.d.ts +142 -0
- package/dist/core/intelligentTargetResearcher.d.ts.map +1 -0
- package/dist/core/intelligentTargetResearcher.js +367 -0
- package/dist/core/intelligentTargetResearcher.js.map +1 -0
- package/dist/core/intelligentTestFlows.d.ts +26 -107
- package/dist/core/intelligentTestFlows.d.ts.map +1 -1
- package/dist/core/intelligentTestFlows.js +15 -659
- package/dist/core/intelligentTestFlows.js.map +1 -1
- package/dist/core/learningPersistence.d.ts +45 -132
- package/dist/core/learningPersistence.d.ts.map +1 -1
- package/dist/core/learningPersistence.js +32 -463
- package/dist/core/learningPersistence.js.map +1 -1
- package/dist/core/metricsTracker.d.ts +22 -139
- package/dist/core/metricsTracker.d.ts.map +1 -1
- package/dist/core/metricsTracker.js +51 -241
- package/dist/core/metricsTracker.js.map +1 -1
- package/dist/core/performanceMonitor.d.ts +15 -109
- package/dist/core/performanceMonitor.d.ts.map +1 -1
- package/dist/core/performanceMonitor.js +27 -184
- package/dist/core/performanceMonitor.js.map +1 -1
- package/dist/core/resultVerification.d.ts +6 -100
- package/dist/core/resultVerification.d.ts.map +1 -1
- package/dist/core/resultVerification.js +31 -400
- package/dist/core/resultVerification.js.map +1 -1
- package/dist/core/selfEvolution.d.ts +32 -126
- package/dist/core/selfEvolution.d.ts.map +1 -1
- package/dist/core/selfEvolution.js +24 -967
- package/dist/core/selfEvolution.js.map +1 -1
- package/dist/core/selfImprovement.d.ts +50 -109
- package/dist/core/selfImprovement.d.ts.map +1 -1
- package/dist/core/selfImprovement.js +14 -689
- package/dist/core/selfImprovement.js.map +1 -1
- package/dist/core/sourceCodeManager.d.ts +89 -0
- package/dist/core/sourceCodeManager.d.ts.map +1 -0
- package/dist/core/sourceCodeManager.js +332 -0
- package/dist/core/sourceCodeManager.js.map +1 -0
- package/dist/core/unifiedOrchestrator.d.ts +88 -0
- package/dist/core/unifiedOrchestrator.d.ts.map +1 -0
- package/dist/core/unifiedOrchestrator.js +284 -0
- package/dist/core/unifiedOrchestrator.js.map +1 -0
- package/dist/core/userDefenseOrchestrator.d.ts +202 -0
- package/dist/core/userDefenseOrchestrator.d.ts.map +1 -0
- package/dist/core/userDefenseOrchestrator.js +1006 -0
- package/dist/core/userDefenseOrchestrator.js.map +1 -0
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +36 -26
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts +8 -0
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js +17 -0
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js.map +1 -0
- package/dist/plugins/tools/nodeDefaults.d.ts +14 -0
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
- package/dist/plugins/tools/nodeDefaults.js +17 -54
- package/dist/plugins/tools/nodeDefaults.js.map +1 -1
- package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts +9 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.js +18 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.js.map +1 -0
- package/dist/shell/interactiveShell.d.ts +101 -2
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +1041 -25
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/tools/appleExposureTools.d.ts +108 -0
- package/dist/tools/appleExposureTools.d.ts.map +1 -0
- package/dist/tools/appleExposureTools.js +850 -0
- package/dist/tools/appleExposureTools.js.map +1 -0
- package/dist/tools/bidirectionalAuditTools.d.ts +104 -0
- package/dist/tools/bidirectionalAuditTools.d.ts.map +1 -0
- package/dist/tools/bidirectionalAuditTools.js +1280 -0
- package/dist/tools/bidirectionalAuditTools.js.map +1 -0
- package/dist/tools/defensiveSecurityTools.d.ts +152 -0
- package/dist/tools/defensiveSecurityTools.d.ts.map +1 -0
- package/dist/tools/defensiveSecurityTools.js +576 -0
- package/dist/tools/defensiveSecurityTools.js.map +1 -0
- package/dist/tools/forwardAttackChainTracer.d.ts +73 -0
- package/dist/tools/forwardAttackChainTracer.d.ts.map +1 -0
- package/dist/tools/forwardAttackChainTracer.js +604 -0
- package/dist/tools/forwardAttackChainTracer.js.map +1 -0
- package/dist/tools/localExplore.d.ts +12 -199
- package/dist/tools/localExplore.d.ts.map +1 -1
- package/dist/tools/localExplore.js +18 -1352
- package/dist/tools/localExplore.js.map +1 -1
- package/dist/tools/offensiveTransparencyTools.d.ts +188 -0
- package/dist/tools/offensiveTransparencyTools.d.ts.map +1 -0
- package/dist/tools/offensiveTransparencyTools.js +890 -0
- package/dist/tools/offensiveTransparencyTools.js.map +1 -0
- package/dist/tools/planningTools.d.ts +8 -17
- package/dist/tools/planningTools.d.ts.map +1 -1
- package/dist/tools/planningTools.js +31 -141
- package/dist/tools/planningTools.js.map +1 -1
- package/dist/tools/searchTools.d.ts +9 -0
- package/dist/tools/searchTools.d.ts.map +1 -1
- package/dist/tools/searchTools.js +305 -189
- package/dist/tools/searchTools.js.map +1 -1
- package/dist/tools/skillTools.d.ts +7 -5
- package/dist/tools/skillTools.d.ts.map +1 -1
- package/dist/tools/skillTools.js +13 -155
- package/dist/tools/skillTools.js.map +1 -1
- package/dist/tools/threatIntelligenceTools.d.ts +128 -0
- package/dist/tools/threatIntelligenceTools.d.ts.map +1 -0
- package/dist/tools/threatIntelligenceTools.js +712 -0
- package/dist/tools/threatIntelligenceTools.js.map +1 -0
- package/dist/ui/PromptController.d.ts +4 -0
- package/dist/ui/PromptController.d.ts.map +1 -1
- package/dist/ui/PromptController.js +32 -11
- package/dist/ui/PromptController.js.map +1 -1
- package/dist/ui/UnifiedUIRenderer.d.ts +36 -0
- package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -1
- package/dist/ui/UnifiedUIRenderer.js +308 -43
- package/dist/ui/UnifiedUIRenderer.js.map +1 -1
- package/dist/ui/animatedStatus.d.ts +2 -0
- package/dist/ui/animatedStatus.d.ts.map +1 -1
- package/dist/ui/animatedStatus.js +36 -2
- package/dist/ui/animatedStatus.js.map +1 -1
- package/dist/ui/orchestration/StatusOrchestrator.d.ts +10 -0
- package/dist/ui/orchestration/StatusOrchestrator.d.ts.map +1 -1
- package/dist/ui/orchestration/StatusOrchestrator.js +36 -4
- package/dist/ui/orchestration/StatusOrchestrator.js.map +1 -1
- package/package.json +2 -2
- package/dist/capabilities/advancedTestGenerationCapability.d.ts +0 -17
- package/dist/capabilities/advancedTestGenerationCapability.d.ts.map +0 -1
- package/dist/capabilities/advancedTestGenerationCapability.js +0 -28
- package/dist/capabilities/advancedTestGenerationCapability.js.map +0 -1
- package/dist/capabilities/browserAutomationCapability.d.ts +0 -37
- package/dist/capabilities/browserAutomationCapability.d.ts.map +0 -1
- package/dist/capabilities/browserAutomationCapability.js +0 -49
- package/dist/capabilities/browserAutomationCapability.js.map +0 -1
- package/dist/capabilities/buildCapability.d.ts +0 -24
- package/dist/capabilities/buildCapability.d.ts.map +0 -1
- package/dist/capabilities/buildCapability.js +0 -25
- package/dist/capabilities/buildCapability.js.map +0 -1
- package/dist/capabilities/cloudCapability.d.ts +0 -13
- package/dist/capabilities/cloudCapability.d.ts.map +0 -1
- package/dist/capabilities/cloudCapability.js +0 -38
- package/dist/capabilities/cloudCapability.js.map +0 -1
- package/dist/capabilities/codeAnalysisCapability.d.ts +0 -13
- package/dist/capabilities/codeAnalysisCapability.d.ts.map +0 -1
- package/dist/capabilities/codeAnalysisCapability.js +0 -24
- package/dist/capabilities/codeAnalysisCapability.js.map +0 -1
- package/dist/capabilities/codeQualityCapability.d.ts +0 -13
- package/dist/capabilities/codeQualityCapability.d.ts.map +0 -1
- package/dist/capabilities/codeQualityCapability.js +0 -25
- package/dist/capabilities/codeQualityCapability.js.map +0 -1
- package/dist/capabilities/dependencySecurityCapability.d.ts +0 -13
- package/dist/capabilities/dependencySecurityCapability.d.ts.map +0 -1
- package/dist/capabilities/dependencySecurityCapability.js +0 -24
- package/dist/capabilities/dependencySecurityCapability.js.map +0 -1
- package/dist/capabilities/devCapability.d.ts +0 -13
- package/dist/capabilities/devCapability.d.ts.map +0 -1
- package/dist/capabilities/devCapability.js +0 -24
- package/dist/capabilities/devCapability.js.map +0 -1
- package/dist/capabilities/emailCapability.d.ts +0 -12
- package/dist/capabilities/emailCapability.d.ts.map +0 -1
- package/dist/capabilities/emailCapability.js +0 -22
- package/dist/capabilities/emailCapability.js.map +0 -1
- package/dist/capabilities/enhancedAnalysisCapability.d.ts +0 -13
- package/dist/capabilities/enhancedAnalysisCapability.d.ts.map +0 -1
- package/dist/capabilities/enhancedAnalysisCapability.js +0 -20
- package/dist/capabilities/enhancedAnalysisCapability.js.map +0 -1
- package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts +0 -17
- package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts.map +0 -1
- package/dist/capabilities/enhancedCodeIntelligenceCapability.js +0 -28
- package/dist/capabilities/enhancedCodeIntelligenceCapability.js.map +0 -1
- package/dist/capabilities/enhancedDevWorkflowCapability.d.ts +0 -17
- package/dist/capabilities/enhancedDevWorkflowCapability.d.ts.map +0 -1
- package/dist/capabilities/enhancedDevWorkflowCapability.js +0 -28
- package/dist/capabilities/enhancedDevWorkflowCapability.js.map +0 -1
- package/dist/capabilities/frontendTestingCapability.d.ts +0 -13
- package/dist/capabilities/frontendTestingCapability.d.ts.map +0 -1
- package/dist/capabilities/frontendTestingCapability.js +0 -28
- package/dist/capabilities/frontendTestingCapability.js.map +0 -1
- package/dist/capabilities/interactionCapability.d.ts +0 -12
- package/dist/capabilities/interactionCapability.d.ts.map +0 -1
- package/dist/capabilities/interactionCapability.js +0 -22
- package/dist/capabilities/interactionCapability.js.map +0 -1
- package/dist/capabilities/learnCapability.d.ts +0 -22
- package/dist/capabilities/learnCapability.d.ts.map +0 -1
- package/dist/capabilities/learnCapability.js +0 -37
- package/dist/capabilities/learnCapability.js.map +0 -1
- package/dist/capabilities/notebookCapability.d.ts +0 -17
- package/dist/capabilities/notebookCapability.d.ts.map +0 -1
- package/dist/capabilities/notebookCapability.js +0 -27
- package/dist/capabilities/notebookCapability.js.map +0 -1
- package/dist/capabilities/planningCapability.d.ts +0 -16
- package/dist/capabilities/planningCapability.d.ts.map +0 -1
- package/dist/capabilities/planningCapability.js +0 -26
- package/dist/capabilities/planningCapability.js.map +0 -1
- package/dist/capabilities/refactoringCapability.d.ts +0 -13
- package/dist/capabilities/refactoringCapability.d.ts.map +0 -1
- package/dist/capabilities/refactoringCapability.js +0 -25
- package/dist/capabilities/refactoringCapability.js.map +0 -1
- package/dist/capabilities/repoChecksCapability.d.ts +0 -10
- package/dist/capabilities/repoChecksCapability.d.ts.map +0 -1
- package/dist/capabilities/repoChecksCapability.js +0 -24
- package/dist/capabilities/repoChecksCapability.js.map +0 -1
- package/dist/capabilities/taskManagementCapability.d.ts +0 -12
- package/dist/capabilities/taskManagementCapability.d.ts.map +0 -1
- package/dist/capabilities/taskManagementCapability.js +0 -22
- package/dist/capabilities/taskManagementCapability.js.map +0 -1
- package/dist/capabilities/testingCapability.d.ts +0 -13
- package/dist/capabilities/testingCapability.d.ts.map +0 -1
- package/dist/capabilities/testingCapability.js +0 -25
- package/dist/capabilities/testingCapability.js.map +0 -1
- package/dist/capabilities/validationCapability.d.ts +0 -13
- package/dist/capabilities/validationCapability.d.ts.map +0 -1
- package/dist/capabilities/validationCapability.js +0 -24
- package/dist/capabilities/validationCapability.js.map +0 -1
- package/dist/capabilities/webCapability.d.ts +0 -12
- package/dist/capabilities/webCapability.d.ts.map +0 -1
- package/dist/capabilities/webCapability.js +0 -22
- package/dist/capabilities/webCapability.js.map +0 -1
- package/dist/core/deepBugAnalyzer.d.ts +0 -128
- package/dist/core/deepBugAnalyzer.d.ts.map +0 -1
- package/dist/core/deepBugAnalyzer.js +0 -406
- package/dist/core/deepBugAnalyzer.js.map +0 -1
- package/dist/core/hypothesisEngine.d.ts +0 -113
- package/dist/core/hypothesisEngine.d.ts.map +0 -1
- package/dist/core/hypothesisEngine.js +0 -264
- package/dist/core/hypothesisEngine.js.map +0 -1
- package/dist/core/productTestHarness.d.ts +0 -113
- package/dist/core/productTestHarness.d.ts.map +0 -1
- package/dist/core/productTestHarness.js +0 -351
- package/dist/core/productTestHarness.js.map +0 -1
- package/dist/core/validationRunner.d.ts +0 -106
- package/dist/core/validationRunner.d.ts.map +0 -1
- package/dist/core/validationRunner.js +0 -892
- package/dist/core/validationRunner.js.map +0 -1
- package/dist/plugins/tools/browser/browserAutomationPlugin.d.ts +0 -14
- package/dist/plugins/tools/browser/browserAutomationPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/browser/browserAutomationPlugin.js +0 -26
- package/dist/plugins/tools/browser/browserAutomationPlugin.js.map +0 -1
- package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts +0 -3
- package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/checks/localRepoChecksPlugin.js +0 -14
- package/dist/plugins/tools/checks/localRepoChecksPlugin.js.map +0 -1
- package/dist/plugins/tools/cloud/cloudPlugin.d.ts +0 -3
- package/dist/plugins/tools/cloud/cloudPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/cloud/cloudPlugin.js +0 -14
- package/dist/plugins/tools/cloud/cloudPlugin.js.map +0 -1
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts +0 -3
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +0 -14
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js.map +0 -1
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts +0 -3
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.js +0 -14
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.js.map +0 -1
- package/dist/plugins/tools/dependency/dependencyPlugin.d.ts +0 -3
- package/dist/plugins/tools/dependency/dependencyPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/dependency/dependencyPlugin.js +0 -12
- package/dist/plugins/tools/dependency/dependencyPlugin.js.map +0 -1
- package/dist/plugins/tools/development/devPlugin.d.ts +0 -3
- package/dist/plugins/tools/development/devPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/development/devPlugin.js +0 -14
- package/dist/plugins/tools/development/devPlugin.js.map +0 -1
- package/dist/plugins/tools/email/emailPlugin.d.ts +0 -3
- package/dist/plugins/tools/email/emailPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/email/emailPlugin.js +0 -12
- package/dist/plugins/tools/email/emailPlugin.js.map +0 -1
- package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.d.ts +0 -3
- package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.js +0 -14
- package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.js.map +0 -1
- package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.d.ts +0 -3
- package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.d.ts.map +0 -1
- package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.js +0 -12
- package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.js.map +0 -1
- package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.d.ts +0 -3
- package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.js +0 -12
- package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.js.map +0 -1
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.d.ts +0 -3
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js +0 -14
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js.map +0 -1
- package/dist/plugins/tools/interaction/interactionPlugin.d.ts +0 -3
- package/dist/plugins/tools/interaction/interactionPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/interaction/interactionPlugin.js +0 -12
- package/dist/plugins/tools/interaction/interactionPlugin.js.map +0 -1
- package/dist/plugins/tools/learn/learnPlugin.d.ts +0 -3
- package/dist/plugins/tools/learn/learnPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/learn/learnPlugin.js +0 -14
- package/dist/plugins/tools/learn/learnPlugin.js.map +0 -1
- package/dist/plugins/tools/notebook/notebookPlugin.d.ts +0 -9
- package/dist/plugins/tools/notebook/notebookPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/notebook/notebookPlugin.js +0 -15
- package/dist/plugins/tools/notebook/notebookPlugin.js.map +0 -1
- package/dist/plugins/tools/planning/planningPlugin.d.ts +0 -9
- package/dist/plugins/tools/planning/planningPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/planning/planningPlugin.js +0 -15
- package/dist/plugins/tools/planning/planningPlugin.js.map +0 -1
- package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts +0 -3
- package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/refactoring/refactoringPlugin.js +0 -12
- package/dist/plugins/tools/refactoring/refactoringPlugin.js.map +0 -1
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts +0 -3
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.js +0 -12
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.js.map +0 -1
- package/dist/plugins/tools/testing/testingPlugin.d.ts +0 -3
- package/dist/plugins/tools/testing/testingPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/testing/testingPlugin.js +0 -12
- package/dist/plugins/tools/testing/testingPlugin.js.map +0 -1
- package/dist/plugins/tools/validation/validationPlugin.d.ts +0 -3
- package/dist/plugins/tools/validation/validationPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/validation/validationPlugin.js +0 -14
- package/dist/plugins/tools/validation/validationPlugin.js.map +0 -1
- package/dist/plugins/tools/web/webPlugin.d.ts +0 -3
- package/dist/plugins/tools/web/webPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/web/webPlugin.js +0 -12
- package/dist/plugins/tools/web/webPlugin.js.map +0 -1
- package/dist/tools/advancedTestGenerationTools.d.ts +0 -21
- package/dist/tools/advancedTestGenerationTools.d.ts.map +0 -1
- package/dist/tools/advancedTestGenerationTools.js +0 -304
- package/dist/tools/advancedTestGenerationTools.js.map +0 -1
- package/dist/tools/browserAutomationTools.d.ts +0 -23
- package/dist/tools/browserAutomationTools.d.ts.map +0 -1
- package/dist/tools/browserAutomationTools.js +0 -916
- package/dist/tools/browserAutomationTools.js.map +0 -1
- package/dist/tools/buildTools.d.ts +0 -9
- package/dist/tools/buildTools.d.ts.map +0 -1
- package/dist/tools/buildTools.js +0 -346
- package/dist/tools/buildTools.js.map +0 -1
- package/dist/tools/cloudTools.d.ts +0 -49
- package/dist/tools/cloudTools.d.ts.map +0 -1
- package/dist/tools/cloudTools.js +0 -1258
- package/dist/tools/cloudTools.js.map +0 -1
- package/dist/tools/codeAnalysisTools.d.ts +0 -74
- package/dist/tools/codeAnalysisTools.d.ts.map +0 -1
- package/dist/tools/codeAnalysisTools.js +0 -664
- package/dist/tools/codeAnalysisTools.js.map +0 -1
- package/dist/tools/codeGenerationTools.d.ts +0 -3
- package/dist/tools/codeGenerationTools.d.ts.map +0 -1
- package/dist/tools/codeGenerationTools.js +0 -439
- package/dist/tools/codeGenerationTools.js.map +0 -1
- package/dist/tools/codeQualityTools.d.ts +0 -3
- package/dist/tools/codeQualityTools.d.ts.map +0 -1
- package/dist/tools/codeQualityTools.js +0 -297
- package/dist/tools/codeQualityTools.js.map +0 -1
- package/dist/tools/dependencyTools.d.ts +0 -3
- package/dist/tools/dependencyTools.d.ts.map +0 -1
- package/dist/tools/dependencyTools.js +0 -284
- package/dist/tools/dependencyTools.js.map +0 -1
- package/dist/tools/devTools.d.ts +0 -10
- package/dist/tools/devTools.d.ts.map +0 -1
- package/dist/tools/devTools.js +0 -2126
- package/dist/tools/devTools.js.map +0 -1
- package/dist/tools/emailTools.d.ts +0 -21
- package/dist/tools/emailTools.d.ts.map +0 -1
- package/dist/tools/emailTools.js +0 -449
- package/dist/tools/emailTools.js.map +0 -1
- package/dist/tools/enhancedAnalysisTools.d.ts +0 -9
- package/dist/tools/enhancedAnalysisTools.d.ts.map +0 -1
- package/dist/tools/enhancedAnalysisTools.js +0 -370
- package/dist/tools/enhancedAnalysisTools.js.map +0 -1
- package/dist/tools/enhancedCodeIntelligenceTools.d.ts +0 -7
- package/dist/tools/enhancedCodeIntelligenceTools.d.ts.map +0 -1
- package/dist/tools/enhancedCodeIntelligenceTools.js +0 -540
- package/dist/tools/enhancedCodeIntelligenceTools.js.map +0 -1
- package/dist/tools/enhancedDevWorkflowTools.d.ts +0 -7
- package/dist/tools/enhancedDevWorkflowTools.d.ts.map +0 -1
- package/dist/tools/enhancedDevWorkflowTools.js +0 -432
- package/dist/tools/enhancedDevWorkflowTools.js.map +0 -1
- package/dist/tools/frontendTestingTools.d.ts +0 -35
- package/dist/tools/frontendTestingTools.d.ts.map +0 -1
- package/dist/tools/frontendTestingTools.js +0 -1258
- package/dist/tools/frontendTestingTools.js.map +0 -1
- package/dist/tools/globTools.d.ts +0 -15
- package/dist/tools/globTools.d.ts.map +0 -1
- package/dist/tools/globTools.js +0 -174
- package/dist/tools/globTools.js.map +0 -1
- package/dist/tools/grepTools.d.ts +0 -19
- package/dist/tools/grepTools.d.ts.map +0 -1
- package/dist/tools/grepTools.js +0 -411
- package/dist/tools/grepTools.js.map +0 -1
- package/dist/tools/interactionTools.d.ts +0 -6
- package/dist/tools/interactionTools.d.ts.map +0 -1
- package/dist/tools/interactionTools.js +0 -209
- package/dist/tools/interactionTools.js.map +0 -1
- package/dist/tools/learnTools.d.ts +0 -164
- package/dist/tools/learnTools.d.ts.map +0 -1
- package/dist/tools/learnTools.js +0 -2098
- package/dist/tools/learnTools.js.map +0 -1
- package/dist/tools/notebookEditTools.d.ts +0 -15
- package/dist/tools/notebookEditTools.d.ts.map +0 -1
- package/dist/tools/notebookEditTools.js +0 -197
- package/dist/tools/notebookEditTools.js.map +0 -1
- package/dist/tools/refactoringTools.d.ts +0 -3
- package/dist/tools/refactoringTools.d.ts.map +0 -1
- package/dist/tools/refactoringTools.js +0 -294
- package/dist/tools/refactoringTools.js.map +0 -1
- package/dist/tools/repoChecksTools.d.ts +0 -3
- package/dist/tools/repoChecksTools.d.ts.map +0 -1
- package/dist/tools/repoChecksTools.js +0 -276
- package/dist/tools/repoChecksTools.js.map +0 -1
- package/dist/tools/taskManagementTools.d.ts +0 -10
- package/dist/tools/taskManagementTools.d.ts.map +0 -1
- package/dist/tools/taskManagementTools.js +0 -133
- package/dist/tools/taskManagementTools.js.map +0 -1
- package/dist/tools/testingTools.d.ts +0 -3
- package/dist/tools/testingTools.d.ts.map +0 -1
- package/dist/tools/testingTools.js +0 -237
- package/dist/tools/testingTools.js.map +0 -1
- package/dist/tools/validationTools.d.ts +0 -7
- package/dist/tools/validationTools.d.ts.map +0 -1
- package/dist/tools/validationTools.js +0 -344
- package/dist/tools/validationTools.js.map +0 -1
- package/dist/tools/webTools.d.ts +0 -3
- package/dist/tools/webTools.d.ts.map +0 -1
- package/dist/tools/webTools.js +0 -502
- package/dist/tools/webTools.js.map +0 -1
|
@@ -1,669 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Intelligent Test
|
|
3
|
-
*
|
|
4
|
-
* Creates highly complex, intelligent test flows for runtime verification:
|
|
5
|
-
* - Edge case detection and generation
|
|
6
|
-
* - State machine exploration
|
|
7
|
-
* - Fuzzing with smart mutations
|
|
8
|
-
* - Regression test generation
|
|
9
|
-
* - UI interaction simulation
|
|
10
|
-
*
|
|
11
|
-
* Principal Investigator: Bo Shang
|
|
2
|
+
* Intelligent Test Flows - Minimal stub for backward compatibility
|
|
12
3
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import { homedir } from 'node:os';
|
|
16
|
-
// ============================================================================
|
|
17
|
-
// CONSTANTS
|
|
18
|
-
// ============================================================================
|
|
19
|
-
const TEST_FLOWS_DIR = join(homedir(), '.erosolar', 'test-flows');
|
|
20
|
-
const BUG_REPORTS_DIR = join(homedir(), '.erosolar', 'bug-reports');
|
|
21
|
-
const UI_UPDATES_FILE = join(homedir(), '.erosolar', 'ui-updates.json');
|
|
22
|
-
// Edge case categories
|
|
23
|
-
// ============================================================================
|
|
24
|
-
// EDGE CASE GENERATOR
|
|
25
|
-
// ============================================================================
|
|
26
|
-
/**
|
|
27
|
-
* Generate edge cases for a given function/component
|
|
28
|
-
*/
|
|
29
|
-
export function generateEdgeCases(targetName, paramTypes) {
|
|
30
|
-
const edgeCases = [];
|
|
31
|
-
let idCounter = 0;
|
|
32
|
-
for (const [param, type] of Object.entries(paramTypes)) {
|
|
33
|
-
const cases = getEdgeCasesForType(type);
|
|
34
|
-
for (const edgeCase of cases) {
|
|
35
|
-
edgeCases.push({
|
|
36
|
-
id: `${targetName}_edge_${++idCounter}`,
|
|
37
|
-
category: edgeCase.category,
|
|
38
|
-
description: `${param}: ${edgeCase.description}`,
|
|
39
|
-
input: { [param]: edgeCase.value },
|
|
40
|
-
expectedBehavior: edgeCase.expectedBehavior,
|
|
41
|
-
severity: edgeCase.severity,
|
|
42
|
-
detected: false,
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return edgeCases;
|
|
47
|
-
}
|
|
48
|
-
function getEdgeCasesForType(type) {
|
|
49
|
-
const cases = [];
|
|
50
|
-
switch (type.toLowerCase()) {
|
|
51
|
-
case 'string':
|
|
52
|
-
cases.push({ category: 'boundary', description: 'empty string', value: '', expectedBehavior: 'Handle gracefully', severity: 'medium' }, { category: 'boundary', description: 'null', value: null, expectedBehavior: 'Reject or default', severity: 'high' }, { category: 'string', description: 'whitespace only', value: ' ', expectedBehavior: 'Trim or reject', severity: 'low' }, { category: 'string', description: 'unicode', value: '你好世界🌍', expectedBehavior: 'Handle correctly', severity: 'medium' }, { category: 'string', description: 'very long', value: 'x'.repeat(10000), expectedBehavior: 'Truncate or reject', severity: 'high' }, { category: 'string', description: 'special chars', value: '<script>alert(1)</script>', expectedBehavior: 'Escape or reject', severity: 'critical' }, { category: 'string', description: 'path traversal', value: '../../../etc/passwd', expectedBehavior: 'Reject', severity: 'critical' });
|
|
53
|
-
break;
|
|
54
|
-
case 'number':
|
|
55
|
-
cases.push({ category: 'boundary', description: 'zero', value: 0, expectedBehavior: 'Handle zero case', severity: 'medium' }, { category: 'boundary', description: 'negative', value: -1, expectedBehavior: 'Validate range', severity: 'medium' }, { category: 'boundary', description: 'max safe int', value: Number.MAX_SAFE_INTEGER, expectedBehavior: 'Handle large numbers', severity: 'high' }, { category: 'boundary', description: 'infinity', value: Infinity, expectedBehavior: 'Reject or handle', severity: 'high' }, { category: 'boundary', description: 'NaN', value: NaN, expectedBehavior: 'Reject NaN', severity: 'high' }, { category: 'boundary', description: 'float precision', value: 0.1 + 0.2, expectedBehavior: 'Handle float precision', severity: 'low' });
|
|
56
|
-
break;
|
|
57
|
-
case 'array':
|
|
58
|
-
cases.push({ category: 'array', description: 'empty array', value: [], expectedBehavior: 'Handle empty', severity: 'medium' }, { category: 'array', description: 'single item', value: [1], expectedBehavior: 'Handle single', severity: 'low' }, { category: 'array', description: 'large array', value: Array(10000).fill(0), expectedBehavior: 'Handle efficiently', severity: 'high' }, { category: 'array', description: 'null in array', value: [1, null, 3], expectedBehavior: 'Filter or handle', severity: 'medium' }, { category: 'array', description: 'undefined in array', value: [1, undefined, 3], expectedBehavior: 'Filter or handle', severity: 'medium' });
|
|
59
|
-
break;
|
|
60
|
-
case 'object':
|
|
61
|
-
cases.push({ category: 'boundary', description: 'null object', value: null, expectedBehavior: 'Reject or default', severity: 'high' }, { category: 'boundary', description: 'empty object', value: {}, expectedBehavior: 'Handle empty', severity: 'medium' }, { category: 'state', description: 'missing required', value: { partial: true }, expectedBehavior: 'Validate schema', severity: 'high' }, { category: 'array', description: 'deeply nested', value: { a: { b: { c: { d: { e: {} } } } } }, expectedBehavior: 'Handle depth', severity: 'medium' });
|
|
62
|
-
break;
|
|
63
|
-
default:
|
|
64
|
-
cases.push({ category: 'boundary', description: 'null', value: null, expectedBehavior: 'Handle null', severity: 'high' }, { category: 'boundary', description: 'undefined', value: undefined, expectedBehavior: 'Handle undefined', severity: 'high' });
|
|
65
|
-
}
|
|
66
|
-
return cases;
|
|
4
|
+
export function generateTestFlows(_sourceFile, _targetPath) {
|
|
5
|
+
return [];
|
|
67
6
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
// ============================================================================
|
|
71
|
-
/**
|
|
72
|
-
* Generate intelligent test flows for a component
|
|
73
|
-
*/
|
|
74
|
-
export function generateTestFlows(workingDir, targetPath) {
|
|
75
|
-
const flows = [];
|
|
76
|
-
const fullPath = join(workingDir, targetPath);
|
|
77
|
-
if (!existsSync(fullPath)) {
|
|
78
|
-
return flows;
|
|
79
|
-
}
|
|
80
|
-
const content = readFileSync(fullPath, 'utf-8');
|
|
81
|
-
const fileName = basename(targetPath, '.ts');
|
|
82
|
-
// Extract function signatures
|
|
83
|
-
const functionMatches = content.matchAll(/(?:export\s+)?(?:async\s+)?function\s+(\w+)\s*\(([^)]*)\)/g);
|
|
84
|
-
for (const match of functionMatches) {
|
|
85
|
-
const funcName = match[1];
|
|
86
|
-
const params = parseParams(match[2] ?? '');
|
|
87
|
-
// Generate basic flow
|
|
88
|
-
flows.push(createBasicTestFlow(fileName, funcName, params));
|
|
89
|
-
// Generate edge case flows
|
|
90
|
-
flows.push(...createEdgeCaseFlows(fileName, funcName, params));
|
|
91
|
-
// Generate stress test flow
|
|
92
|
-
if (params.length > 0) {
|
|
93
|
-
flows.push(createStressTestFlow(fileName, funcName, params));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
// Extract class methods
|
|
97
|
-
const classMatches = content.matchAll(/(?:async\s+)?(\w+)\s*\(([^)]*)\)\s*(?::\s*[^{]+)?\s*\{/g);
|
|
98
|
-
for (const match of classMatches) {
|
|
99
|
-
const methodName = match[1];
|
|
100
|
-
if (methodName === 'constructor' || methodName.startsWith('_'))
|
|
101
|
-
continue;
|
|
102
|
-
const params = parseParams(match[2] ?? '');
|
|
103
|
-
flows.push(createBasicTestFlow(fileName, methodName, params));
|
|
104
|
-
}
|
|
105
|
-
return flows;
|
|
7
|
+
export function detectBugs(_sourceFile, _targetPath) {
|
|
8
|
+
return [];
|
|
106
9
|
}
|
|
107
|
-
function
|
|
108
|
-
|
|
109
|
-
return [];
|
|
110
|
-
const params = [];
|
|
111
|
-
const parts = paramStr.split(',');
|
|
112
|
-
for (const part of parts) {
|
|
113
|
-
const match = part.match(/(\w+)\s*[?]?\s*:\s*([^=,]+)/);
|
|
114
|
-
if (match) {
|
|
115
|
-
params.push({
|
|
116
|
-
name: match[1].trim(),
|
|
117
|
-
type: match[2].trim(),
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return params;
|
|
10
|
+
export function detectUIUpdates(_sourceFile, _targetPath) {
|
|
11
|
+
return [];
|
|
122
12
|
}
|
|
123
|
-
function
|
|
124
|
-
|
|
125
|
-
// Setup step
|
|
126
|
-
steps.push({
|
|
127
|
-
order: 1,
|
|
128
|
-
action: 'setup',
|
|
129
|
-
input: {},
|
|
130
|
-
assertions: [],
|
|
131
|
-
});
|
|
132
|
-
// Execution step
|
|
133
|
-
const input = {};
|
|
134
|
-
for (const param of params) {
|
|
135
|
-
input[param.name] = getDefaultValue(param.type);
|
|
136
|
-
}
|
|
137
|
-
steps.push({
|
|
138
|
-
order: 2,
|
|
139
|
-
action: `call ${funcName}`,
|
|
140
|
-
input,
|
|
141
|
-
assertions: [
|
|
142
|
-
{ type: 'resolves', target: 'result', message: 'Function should complete' },
|
|
143
|
-
],
|
|
144
|
-
});
|
|
145
|
-
// Verification step
|
|
146
|
-
steps.push({
|
|
147
|
-
order: 3,
|
|
148
|
-
action: 'verify',
|
|
149
|
-
assertions: [
|
|
150
|
-
{ type: 'truthy', target: 'result', message: 'Result should be defined' },
|
|
151
|
-
],
|
|
152
|
-
});
|
|
153
|
-
return {
|
|
154
|
-
id: `${fileName}_${funcName}_basic`,
|
|
155
|
-
name: `${funcName} - Basic Test`,
|
|
156
|
-
description: `Verify basic functionality of ${funcName}`,
|
|
157
|
-
category: 'unit',
|
|
158
|
-
steps,
|
|
159
|
-
preconditions: ['Module is loaded'],
|
|
160
|
-
postconditions: ['No side effects'],
|
|
161
|
-
expectedOutcome: 'Function executes successfully',
|
|
162
|
-
complexity: 'simple',
|
|
163
|
-
priority: 50,
|
|
164
|
-
generatedAt: new Date().toISOString(),
|
|
165
|
-
};
|
|
13
|
+
export function saveTestFlows(_flows, _outputDir) {
|
|
14
|
+
// No-op stub
|
|
166
15
|
}
|
|
167
|
-
function
|
|
168
|
-
|
|
169
|
-
for (const param of params) {
|
|
170
|
-
const edgeCases = getEdgeCasesForType(param.type);
|
|
171
|
-
for (const edge of edgeCases.slice(0, 3)) { // Limit to top 3 per param
|
|
172
|
-
const steps = [
|
|
173
|
-
{
|
|
174
|
-
order: 1,
|
|
175
|
-
action: `call ${funcName} with ${edge.description}`,
|
|
176
|
-
input: { [param.name]: edge.value },
|
|
177
|
-
assertions: [
|
|
178
|
-
{ type: edge.severity === 'critical' ? 'throws' : 'resolves', target: 'result' },
|
|
179
|
-
],
|
|
180
|
-
},
|
|
181
|
-
];
|
|
182
|
-
flows.push({
|
|
183
|
-
id: `${fileName}_${funcName}_edge_${param.name}_${edge.category}`,
|
|
184
|
-
name: `${funcName} - Edge: ${edge.description}`,
|
|
185
|
-
description: `Test ${funcName} with ${edge.description} for ${param.name}`,
|
|
186
|
-
category: 'edge-case',
|
|
187
|
-
steps,
|
|
188
|
-
preconditions: [],
|
|
189
|
-
postconditions: [],
|
|
190
|
-
expectedOutcome: edge.expectedBehavior,
|
|
191
|
-
complexity: 'moderate',
|
|
192
|
-
priority: edge.severity === 'critical' ? 90 : edge.severity === 'high' ? 70 : 50,
|
|
193
|
-
generatedAt: new Date().toISOString(),
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
return flows;
|
|
16
|
+
export function saveBugReports(_bugs, _outputDir) {
|
|
17
|
+
// No-op stub
|
|
198
18
|
}
|
|
199
|
-
function
|
|
200
|
-
|
|
201
|
-
for (let i = 0; i < 5; i++) {
|
|
202
|
-
const input = {};
|
|
203
|
-
for (const param of params) {
|
|
204
|
-
input[param.name] = getRandomValue(param.type);
|
|
205
|
-
}
|
|
206
|
-
steps.push({
|
|
207
|
-
order: i + 1,
|
|
208
|
-
action: `stress iteration ${i + 1}`,
|
|
209
|
-
input,
|
|
210
|
-
timeout: 5000,
|
|
211
|
-
assertions: [
|
|
212
|
-
{ type: 'resolves', target: 'result' },
|
|
213
|
-
],
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
return {
|
|
217
|
-
id: `${fileName}_${funcName}_stress`,
|
|
218
|
-
name: `${funcName} - Stress Test`,
|
|
219
|
-
description: `Stress test ${funcName} with random inputs`,
|
|
220
|
-
category: 'stress',
|
|
221
|
-
steps,
|
|
222
|
-
preconditions: [],
|
|
223
|
-
postconditions: ['No memory leaks', 'Consistent performance'],
|
|
224
|
-
expectedOutcome: 'Function handles load without degradation',
|
|
225
|
-
complexity: 'extreme',
|
|
226
|
-
priority: 60,
|
|
227
|
-
generatedAt: new Date().toISOString(),
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
function getDefaultValue(type) {
|
|
231
|
-
switch (type.toLowerCase()) {
|
|
232
|
-
case 'string': return 'test';
|
|
233
|
-
case 'number': return 1;
|
|
234
|
-
case 'boolean': return true;
|
|
235
|
-
case 'array': return [];
|
|
236
|
-
case 'object': return {};
|
|
237
|
-
default: return null;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
function getRandomValue(type) {
|
|
241
|
-
switch (type.toLowerCase()) {
|
|
242
|
-
case 'string': return Math.random().toString(36).substring(7);
|
|
243
|
-
case 'number': return Math.floor(Math.random() * 1000);
|
|
244
|
-
case 'boolean': return Math.random() > 0.5;
|
|
245
|
-
case 'array': return Array(Math.floor(Math.random() * 10)).fill(0).map(() => Math.random());
|
|
246
|
-
default: return null;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
// ============================================================================
|
|
250
|
-
// BUG DETECTION
|
|
251
|
-
// ============================================================================
|
|
252
|
-
/**
|
|
253
|
-
* Analyze code for potential bugs
|
|
254
|
-
*/
|
|
255
|
-
export function detectBugs(workingDir) {
|
|
256
|
-
const bugs = [];
|
|
257
|
-
const srcDir = join(workingDir, 'src');
|
|
258
|
-
if (!existsSync(srcDir))
|
|
259
|
-
return bugs;
|
|
260
|
-
const files = findFilesRecursive(srcDir, ['.ts']);
|
|
261
|
-
for (const file of files) {
|
|
262
|
-
const content = readFileSync(file, 'utf-8');
|
|
263
|
-
const relativePath = relative(workingDir, file);
|
|
264
|
-
// Detect potential bugs
|
|
265
|
-
bugs.push(...detectNullDereferencing(content, relativePath));
|
|
266
|
-
bugs.push(...detectAsyncIssues(content, relativePath));
|
|
267
|
-
bugs.push(...detectTypeCoercion(content, relativePath));
|
|
268
|
-
bugs.push(...detectResourceLeaks(content, relativePath));
|
|
269
|
-
bugs.push(...detectLogicErrors(content, relativePath));
|
|
270
|
-
}
|
|
271
|
-
// Sort by severity
|
|
272
|
-
const severityOrder = { critical: 0, high: 1, medium: 2, low: 3 };
|
|
273
|
-
bugs.sort((a, b) => severityOrder[a.severity] - severityOrder[b.severity]);
|
|
274
|
-
return bugs;
|
|
275
|
-
}
|
|
276
|
-
function detectNullDereferencing(content, file) {
|
|
277
|
-
const bugs = [];
|
|
278
|
-
const lines = content.split('\n');
|
|
279
|
-
for (let i = 0; i < lines.length; i++) {
|
|
280
|
-
const line = lines[i];
|
|
281
|
-
// Pattern: accessing property without null check
|
|
282
|
-
if (line.match(/\w+\.\w+/) && !line.includes('?.') && !line.includes('!.')) {
|
|
283
|
-
// Check if there's a null check before this line
|
|
284
|
-
const prevLines = lines.slice(Math.max(0, i - 3), i).join('\n');
|
|
285
|
-
if (!prevLines.includes('!== null') && !prevLines.includes('!== undefined') &&
|
|
286
|
-
!prevLines.includes('!= null') && !prevLines.includes('if (')) {
|
|
287
|
-
// Could be a potential null dereference
|
|
288
|
-
const match = line.match(/(\w+)\.(\w+)/);
|
|
289
|
-
if (match && !['console', 'Math', 'JSON', 'Object', 'Array', 'String', 'Number', 'Date', 'process'].includes(match[1])) {
|
|
290
|
-
bugs.push({
|
|
291
|
-
id: `null_deref_${file}_${i + 1}`,
|
|
292
|
-
severity: 'medium',
|
|
293
|
-
type: 'edge-case',
|
|
294
|
-
title: 'Potential null dereference',
|
|
295
|
-
description: `Accessing ${match[1]}.${match[2]} without null check`,
|
|
296
|
-
reproSteps: ['Call function with null/undefined input'],
|
|
297
|
-
expectedBehavior: 'Should handle null gracefully',
|
|
298
|
-
actualBehavior: 'May throw TypeError',
|
|
299
|
-
file,
|
|
300
|
-
line: i + 1,
|
|
301
|
-
suggestedFix: `Add optional chaining: ${match[1]}?.${match[2]}`,
|
|
302
|
-
detectedAt: new Date().toISOString(),
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
return bugs.slice(0, 5); // Limit to prevent flooding
|
|
309
|
-
}
|
|
310
|
-
function detectAsyncIssues(content, file) {
|
|
311
|
-
const bugs = [];
|
|
312
|
-
const lines = content.split('\n');
|
|
313
|
-
for (let i = 0; i < lines.length; i++) {
|
|
314
|
-
const line = lines[i];
|
|
315
|
-
// Missing await on async call
|
|
316
|
-
if (line.match(/[^a]\w+Async\s*\(/) && !line.includes('await') && !line.includes('return')) {
|
|
317
|
-
bugs.push({
|
|
318
|
-
id: `missing_await_${file}_${i + 1}`,
|
|
319
|
-
severity: 'high',
|
|
320
|
-
type: 'logic',
|
|
321
|
-
title: 'Missing await on async function',
|
|
322
|
-
description: 'Async function called without await',
|
|
323
|
-
reproSteps: ['Call the function and check result'],
|
|
324
|
-
expectedBehavior: 'Should await async result',
|
|
325
|
-
actualBehavior: 'Returns Promise instead of resolved value',
|
|
326
|
-
file,
|
|
327
|
-
line: i + 1,
|
|
328
|
-
suggestedFix: 'Add await keyword',
|
|
329
|
-
detectedAt: new Date().toISOString(),
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
// Unhandled promise rejection
|
|
333
|
-
if (line.includes('.then(') && !content.slice(0, content.indexOf(line) + line.length + 200).includes('.catch(')) {
|
|
334
|
-
bugs.push({
|
|
335
|
-
id: `unhandled_promise_${file}_${i + 1}`,
|
|
336
|
-
severity: 'medium',
|
|
337
|
-
type: 'edge-case',
|
|
338
|
-
title: 'Unhandled promise rejection',
|
|
339
|
-
description: 'Promise chain without .catch() handler',
|
|
340
|
-
reproSteps: ['Cause the promise to reject'],
|
|
341
|
-
expectedBehavior: 'Should handle rejection',
|
|
342
|
-
actualBehavior: 'Unhandled promise rejection',
|
|
343
|
-
file,
|
|
344
|
-
line: i + 1,
|
|
345
|
-
suggestedFix: 'Add .catch() handler or use try/catch with await',
|
|
346
|
-
detectedAt: new Date().toISOString(),
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
return bugs.slice(0, 3);
|
|
351
|
-
}
|
|
352
|
-
function detectTypeCoercion(content, file) {
|
|
353
|
-
const bugs = [];
|
|
354
|
-
const lines = content.split('\n');
|
|
355
|
-
for (let i = 0; i < lines.length; i++) {
|
|
356
|
-
const line = lines[i];
|
|
357
|
-
// Loose equality
|
|
358
|
-
if (line.match(/[^!=]==[^=]/) && !line.includes('===')) {
|
|
359
|
-
bugs.push({
|
|
360
|
-
id: `loose_eq_${file}_${i + 1}`,
|
|
361
|
-
severity: 'low',
|
|
362
|
-
type: 'logic',
|
|
363
|
-
title: 'Loose equality comparison',
|
|
364
|
-
description: 'Using == instead of ===',
|
|
365
|
-
reproSteps: ['Compare values of different types'],
|
|
366
|
-
expectedBehavior: 'Strict type comparison',
|
|
367
|
-
actualBehavior: 'Type coercion may cause unexpected matches',
|
|
368
|
-
file,
|
|
369
|
-
line: i + 1,
|
|
370
|
-
suggestedFix: 'Use === for strict equality',
|
|
371
|
-
detectedAt: new Date().toISOString(),
|
|
372
|
-
});
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
return bugs.slice(0, 3);
|
|
376
|
-
}
|
|
377
|
-
function detectResourceLeaks(content, file) {
|
|
378
|
-
const bugs = [];
|
|
379
|
-
// File handle leaks
|
|
380
|
-
if (content.includes('openSync') && !content.includes('closeSync')) {
|
|
381
|
-
bugs.push({
|
|
382
|
-
id: `file_leak_${file}`,
|
|
383
|
-
severity: 'high',
|
|
384
|
-
type: 'performance',
|
|
385
|
-
title: 'Potential file handle leak',
|
|
386
|
-
description: 'File opened but not explicitly closed',
|
|
387
|
-
reproSteps: ['Call function repeatedly'],
|
|
388
|
-
expectedBehavior: 'File handles should be closed',
|
|
389
|
-
actualBehavior: 'May leak file handles',
|
|
390
|
-
file,
|
|
391
|
-
suggestedFix: 'Use try/finally or fs promises with proper cleanup',
|
|
392
|
-
detectedAt: new Date().toISOString(),
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
// Timer leaks
|
|
396
|
-
if ((content.includes('setInterval') || content.includes('setTimeout')) &&
|
|
397
|
-
!content.includes('clearInterval') && !content.includes('clearTimeout')) {
|
|
398
|
-
bugs.push({
|
|
399
|
-
id: `timer_leak_${file}`,
|
|
400
|
-
severity: 'medium',
|
|
401
|
-
type: 'performance',
|
|
402
|
-
title: 'Potential timer leak',
|
|
403
|
-
description: 'Timer set but never cleared',
|
|
404
|
-
reproSteps: ['Create and destroy component repeatedly'],
|
|
405
|
-
expectedBehavior: 'Timers should be cleared on cleanup',
|
|
406
|
-
actualBehavior: 'May accumulate timers',
|
|
407
|
-
file,
|
|
408
|
-
suggestedFix: 'Store timer ID and clear on cleanup',
|
|
409
|
-
detectedAt: new Date().toISOString(),
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
|
-
return bugs;
|
|
413
|
-
}
|
|
414
|
-
function detectLogicErrors(content, file) {
|
|
415
|
-
const bugs = [];
|
|
416
|
-
const lines = content.split('\n');
|
|
417
|
-
for (let i = 0; i < lines.length; i++) {
|
|
418
|
-
const line = lines[i];
|
|
419
|
-
// Always true/false conditions
|
|
420
|
-
if (line.match(/if\s*\(\s*true\s*\)/) || line.match(/if\s*\(\s*false\s*\)/)) {
|
|
421
|
-
bugs.push({
|
|
422
|
-
id: `const_cond_${file}_${i + 1}`,
|
|
423
|
-
severity: 'medium',
|
|
424
|
-
type: 'logic',
|
|
425
|
-
title: 'Constant condition',
|
|
426
|
-
description: 'Condition is always true or false',
|
|
427
|
-
reproSteps: ['Review the code'],
|
|
428
|
-
expectedBehavior: 'Dynamic condition',
|
|
429
|
-
actualBehavior: 'Dead code or always executed',
|
|
430
|
-
file,
|
|
431
|
-
line: i + 1,
|
|
432
|
-
suggestedFix: 'Remove dead code or fix condition',
|
|
433
|
-
detectedAt: new Date().toISOString(),
|
|
434
|
-
});
|
|
435
|
-
}
|
|
436
|
-
// Assignment in condition
|
|
437
|
-
if (line.match(/if\s*\([^=]*[^!=<>]=[^=][^)]*\)/)) {
|
|
438
|
-
bugs.push({
|
|
439
|
-
id: `assign_cond_${file}_${i + 1}`,
|
|
440
|
-
severity: 'high',
|
|
441
|
-
type: 'logic',
|
|
442
|
-
title: 'Assignment in condition',
|
|
443
|
-
description: 'Using = instead of == or === in condition',
|
|
444
|
-
reproSteps: ['Review the code'],
|
|
445
|
-
expectedBehavior: 'Comparison',
|
|
446
|
-
actualBehavior: 'Assignment (always truthy for non-null)',
|
|
447
|
-
file,
|
|
448
|
-
line: i + 1,
|
|
449
|
-
suggestedFix: 'Use === for comparison',
|
|
450
|
-
detectedAt: new Date().toISOString(),
|
|
451
|
-
});
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
return bugs.slice(0, 3);
|
|
455
|
-
}
|
|
456
|
-
// ============================================================================
|
|
457
|
-
// UI UPDATE DETECTION
|
|
458
|
-
// ============================================================================
|
|
459
|
-
/**
|
|
460
|
-
* Detect needed UI updates
|
|
461
|
-
*/
|
|
462
|
-
export function detectUIUpdates(workingDir) {
|
|
463
|
-
const updates = [];
|
|
464
|
-
const uiDir = join(workingDir, 'src/ui');
|
|
465
|
-
if (!existsSync(uiDir))
|
|
466
|
-
return updates;
|
|
467
|
-
const files = findFilesRecursive(uiDir, ['.ts']);
|
|
468
|
-
for (const file of files) {
|
|
469
|
-
const content = readFileSync(file, 'utf-8');
|
|
470
|
-
const relativePath = relative(workingDir, file);
|
|
471
|
-
// Detect accessibility issues
|
|
472
|
-
if (content.includes('console.log') && file.includes('display')) {
|
|
473
|
-
updates.push({
|
|
474
|
-
component: basename(file, '.ts'),
|
|
475
|
-
type: 'accessibility',
|
|
476
|
-
description: 'Console output may not be screen-reader friendly',
|
|
477
|
-
before: 'console.log(...)',
|
|
478
|
-
after: 'Use structured output with ARIA labels',
|
|
479
|
-
file: relativePath,
|
|
480
|
-
});
|
|
481
|
-
}
|
|
482
|
-
// Detect hardcoded colors
|
|
483
|
-
const colorMatches = content.match(/['"`]#[0-9a-fA-F]{6}['"`]/g);
|
|
484
|
-
if (colorMatches && colorMatches.length > 3) {
|
|
485
|
-
updates.push({
|
|
486
|
-
component: basename(file, '.ts'),
|
|
487
|
-
type: 'style',
|
|
488
|
-
description: 'Hardcoded colors - should use theme',
|
|
489
|
-
before: colorMatches.slice(0, 3).join(', '),
|
|
490
|
-
after: 'Use theme.colors.* instead',
|
|
491
|
-
file: relativePath,
|
|
492
|
-
});
|
|
493
|
-
}
|
|
494
|
-
// Detect missing error handling in UI
|
|
495
|
-
if (content.includes('try') && !content.includes('showError') && !content.includes('displayError')) {
|
|
496
|
-
updates.push({
|
|
497
|
-
component: basename(file, '.ts'),
|
|
498
|
-
type: 'behavior',
|
|
499
|
-
description: 'Error handling without user feedback',
|
|
500
|
-
before: 'catch (error) { /* no UI feedback */ }',
|
|
501
|
-
after: 'catch (error) { showError(error.message); }',
|
|
502
|
-
file: relativePath,
|
|
503
|
-
});
|
|
504
|
-
}
|
|
505
|
-
// Detect long-running operations without loading state
|
|
506
|
-
if (content.includes('await') && !content.includes('loading') && !content.includes('spinner')) {
|
|
507
|
-
updates.push({
|
|
508
|
-
component: basename(file, '.ts'),
|
|
509
|
-
type: 'performance',
|
|
510
|
-
description: 'Async operation without loading indicator',
|
|
511
|
-
before: 'await longOperation()',
|
|
512
|
-
after: 'showLoading(); await longOperation(); hideLoading();',
|
|
513
|
-
file: relativePath,
|
|
514
|
-
});
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
return updates;
|
|
518
|
-
}
|
|
519
|
-
// ============================================================================
|
|
520
|
-
// PERSISTENCE
|
|
521
|
-
// ============================================================================
|
|
522
|
-
/**
|
|
523
|
-
* Save test flows to disk
|
|
524
|
-
*/
|
|
525
|
-
export function saveTestFlows(flows) {
|
|
526
|
-
if (!existsSync(TEST_FLOWS_DIR)) {
|
|
527
|
-
mkdirSync(TEST_FLOWS_DIR, { recursive: true });
|
|
528
|
-
}
|
|
529
|
-
for (const flow of flows) {
|
|
530
|
-
const filePath = join(TEST_FLOWS_DIR, `${flow.id}.json`);
|
|
531
|
-
writeFileSync(filePath, JSON.stringify(flow, null, 2));
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
/**
|
|
535
|
-
* Load test flows from disk
|
|
536
|
-
*/
|
|
537
|
-
export function loadTestFlows() {
|
|
538
|
-
if (!existsSync(TEST_FLOWS_DIR))
|
|
539
|
-
return [];
|
|
540
|
-
const flows = [];
|
|
541
|
-
const files = readdirSync(TEST_FLOWS_DIR).filter(f => f.endsWith('.json'));
|
|
542
|
-
for (const file of files) {
|
|
543
|
-
try {
|
|
544
|
-
const content = readFileSync(join(TEST_FLOWS_DIR, file), 'utf-8');
|
|
545
|
-
flows.push(JSON.parse(content));
|
|
546
|
-
}
|
|
547
|
-
catch {
|
|
548
|
-
// Skip invalid files
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
return flows;
|
|
552
|
-
}
|
|
553
|
-
/**
|
|
554
|
-
* Save bug reports
|
|
555
|
-
*/
|
|
556
|
-
export function saveBugReports(bugs) {
|
|
557
|
-
if (!existsSync(BUG_REPORTS_DIR)) {
|
|
558
|
-
mkdirSync(BUG_REPORTS_DIR, { recursive: true });
|
|
559
|
-
}
|
|
560
|
-
for (const bug of bugs) {
|
|
561
|
-
const filePath = join(BUG_REPORTS_DIR, `${bug.id}.json`);
|
|
562
|
-
writeFileSync(filePath, JSON.stringify(bug, null, 2));
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
/**
|
|
566
|
-
* Save UI updates
|
|
567
|
-
*/
|
|
568
|
-
export function saveUIUpdates(updates) {
|
|
569
|
-
const dir = join(homedir(), '.erosolar');
|
|
570
|
-
if (!existsSync(dir)) {
|
|
571
|
-
mkdirSync(dir, { recursive: true });
|
|
572
|
-
}
|
|
573
|
-
writeFileSync(UI_UPDATES_FILE, JSON.stringify(updates, null, 2));
|
|
574
|
-
}
|
|
575
|
-
// ============================================================================
|
|
576
|
-
// STATUS DISPLAY
|
|
577
|
-
// ============================================================================
|
|
578
|
-
/**
|
|
579
|
-
* Get comprehensive test/bug status
|
|
580
|
-
*/
|
|
581
|
-
export function getTestFlowStatus(workingDir) {
|
|
582
|
-
const flows = loadTestFlows();
|
|
583
|
-
const bugs = detectBugs(workingDir);
|
|
584
|
-
const uiUpdates = detectUIUpdates(workingDir);
|
|
585
|
-
const lines = [];
|
|
586
|
-
lines.push('═══════════════════════════════════════════════════════════');
|
|
587
|
-
lines.push(' 🧪 Intelligent Test Flow System');
|
|
588
|
-
lines.push('═══════════════════════════════════════════════════════════');
|
|
589
|
-
lines.push('');
|
|
590
|
-
// Test flows summary
|
|
591
|
-
const flowsByCategory = {};
|
|
592
|
-
for (const flow of flows) {
|
|
593
|
-
flowsByCategory[flow.category] = (flowsByCategory[flow.category] || 0) + 1;
|
|
594
|
-
}
|
|
595
|
-
lines.push(`Total Test Flows: ${flows.length}`);
|
|
596
|
-
for (const [category, count] of Object.entries(flowsByCategory)) {
|
|
597
|
-
lines.push(` ${category}: ${count}`);
|
|
598
|
-
}
|
|
599
|
-
lines.push('');
|
|
600
|
-
// Bugs summary
|
|
601
|
-
const bugsBySeverity = {};
|
|
602
|
-
for (const bug of bugs) {
|
|
603
|
-
bugsBySeverity[bug.severity] = (bugsBySeverity[bug.severity] || 0) + 1;
|
|
604
|
-
}
|
|
605
|
-
lines.push(`Potential Bugs Detected: ${bugs.length}`);
|
|
606
|
-
if (bugsBySeverity['critical'])
|
|
607
|
-
lines.push(` 🔴 Critical: ${bugsBySeverity['critical']}`);
|
|
608
|
-
if (bugsBySeverity['high'])
|
|
609
|
-
lines.push(` 🟠 High: ${bugsBySeverity['high']}`);
|
|
610
|
-
if (bugsBySeverity['medium'])
|
|
611
|
-
lines.push(` 🟡 Medium: ${bugsBySeverity['medium']}`);
|
|
612
|
-
if (bugsBySeverity['low'])
|
|
613
|
-
lines.push(` ⚪ Low: ${bugsBySeverity['low']}`);
|
|
614
|
-
lines.push('');
|
|
615
|
-
// UI updates
|
|
616
|
-
lines.push(`UI Updates Needed: ${uiUpdates.length}`);
|
|
617
|
-
const uiByType = {};
|
|
618
|
-
for (const update of uiUpdates) {
|
|
619
|
-
uiByType[update.type] = (uiByType[update.type] || 0) + 1;
|
|
620
|
-
}
|
|
621
|
-
for (const [type, count] of Object.entries(uiByType)) {
|
|
622
|
-
lines.push(` ${type}: ${count}`);
|
|
623
|
-
}
|
|
624
|
-
lines.push('');
|
|
625
|
-
// Top bugs
|
|
626
|
-
if (bugs.length > 0) {
|
|
627
|
-
lines.push('Top Issues:');
|
|
628
|
-
for (const bug of bugs.slice(0, 5)) {
|
|
629
|
-
const icon = bug.severity === 'critical' ? '🔴' :
|
|
630
|
-
bug.severity === 'high' ? '🟠' :
|
|
631
|
-
bug.severity === 'medium' ? '🟡' : '⚪';
|
|
632
|
-
lines.push(` ${icon} ${bug.title}`);
|
|
633
|
-
lines.push(` ${bug.file}:${bug.line ?? '?'}`);
|
|
634
|
-
}
|
|
635
|
-
lines.push('');
|
|
636
|
-
}
|
|
637
|
-
lines.push('Commands:');
|
|
638
|
-
lines.push(' /test generate <file> - Generate test flows for file');
|
|
639
|
-
lines.push(' /test bugs - Detect potential bugs');
|
|
640
|
-
lines.push(' /test ui - Detect UI improvements');
|
|
641
|
-
lines.push(' /test run - Run generated tests');
|
|
642
|
-
lines.push('');
|
|
643
|
-
lines.push('═══════════════════════════════════════════════════════════');
|
|
644
|
-
return lines.join('\n');
|
|
19
|
+
export function saveUIUpdates(_updates, _outputDir) {
|
|
20
|
+
// No-op stub
|
|
645
21
|
}
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
// ============================================================================
|
|
649
|
-
function findFilesRecursive(dir, extensions) {
|
|
650
|
-
const files = [];
|
|
651
|
-
try {
|
|
652
|
-
const entries = readdirSync(dir, { withFileTypes: true });
|
|
653
|
-
for (const entry of entries) {
|
|
654
|
-
const fullPath = join(dir, entry.name);
|
|
655
|
-
if (entry.isDirectory() && !entry.name.startsWith('.') &&
|
|
656
|
-
entry.name !== 'node_modules' && entry.name !== 'dist') {
|
|
657
|
-
files.push(...findFilesRecursive(fullPath, extensions));
|
|
658
|
-
}
|
|
659
|
-
else if (entry.isFile() && extensions.some(ext => entry.name.endsWith(ext))) {
|
|
660
|
-
files.push(fullPath);
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
catch {
|
|
665
|
-
// Ignore
|
|
666
|
-
}
|
|
667
|
-
return files;
|
|
22
|
+
export function getTestFlowStatus(_workingDir) {
|
|
23
|
+
return 'Test flow generation is deprecated';
|
|
668
24
|
}
|
|
669
25
|
//# sourceMappingURL=intelligentTestFlows.js.map
|