erosolar-cli 2.1.249 → 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 +2 -0
- package/dist/capabilities/orchestrationCapability.d.ts.map +1 -1
- package/dist/capabilities/orchestrationCapability.js +980 -2
- 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/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 +97 -2
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +1001 -6
- 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 +20 -0
- package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -1
- package/dist/ui/UnifiedUIRenderer.js +235 -28
- 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 +1 -1
- 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
|
@@ -82,6 +82,10 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
82
82
|
funActivityPhrases = [
|
|
83
83
|
'Thinking', 'Processing', 'Analyzing', 'Working', 'Preparing',
|
|
84
84
|
];
|
|
85
|
+
maxCuratedReasoningLines = 8;
|
|
86
|
+
maxCuratedReasoningChars = 1800;
|
|
87
|
+
thoughtDedupWindowMs = 15000;
|
|
88
|
+
lastCuratedThought = null;
|
|
85
89
|
statusMeta = {};
|
|
86
90
|
toggleState = {
|
|
87
91
|
verificationEnabled: false,
|
|
@@ -90,6 +94,37 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
90
94
|
dualRlEnabled: false,
|
|
91
95
|
};
|
|
92
96
|
// ------------ Helpers ------------
|
|
97
|
+
/** Ensure cursor is always within valid bounds for the current buffer */
|
|
98
|
+
clampCursor() {
|
|
99
|
+
this.cursor = Math.max(0, Math.min(this.cursor, this.buffer.length));
|
|
100
|
+
}
|
|
101
|
+
/** Safely append to paste buffer with size limit enforcement */
|
|
102
|
+
appendToPasteBuffer(buffer, text) {
|
|
103
|
+
if (this.pasteBufferOverflow)
|
|
104
|
+
return; // Already at limit
|
|
105
|
+
const current = buffer === 'paste' ? this.pasteBuffer : this.plainPasteBuffer;
|
|
106
|
+
const remaining = this.maxPasteBufferSize - current.length;
|
|
107
|
+
if (remaining <= 0) {
|
|
108
|
+
this.pasteBufferOverflow = true;
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const toAdd = text.length <= remaining ? text : text.slice(0, remaining);
|
|
112
|
+
if (buffer === 'paste') {
|
|
113
|
+
this.pasteBuffer += toAdd;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
this.plainPasteBuffer += toAdd;
|
|
117
|
+
}
|
|
118
|
+
if (toAdd.length < text.length) {
|
|
119
|
+
this.pasteBufferOverflow = true;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/** Strip ANSI escape sequences from text to prevent injection */
|
|
123
|
+
sanitizePasteContent(text) {
|
|
124
|
+
// Remove all ANSI escape sequences (CSI, OSC, etc.)
|
|
125
|
+
// eslint-disable-next-line no-control-regex
|
|
126
|
+
return text.replace(/\x1b\[[0-9;]*[A-Za-z]|\x1b\][^\x07]*\x07|\x1b[PX^_][^\x1b]*\x1b\\|\x1b./g, '');
|
|
127
|
+
}
|
|
93
128
|
formatHotkey(combo) {
|
|
94
129
|
if (!combo?.trim())
|
|
95
130
|
return null;
|
|
@@ -106,6 +141,9 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
106
141
|
plainPasteWindowMs = 60;
|
|
107
142
|
plainPasteTriggerChars = 24;
|
|
108
143
|
plainPasteEarlyNewlineChars = 2; // Guard for short first lines in plain paste mode
|
|
144
|
+
// Paste buffer limits to prevent memory exhaustion
|
|
145
|
+
maxPasteBufferSize = 10 * 1024 * 1024; // 10MB max paste size
|
|
146
|
+
pasteBufferOverflow = false; // Track if paste was truncated
|
|
109
147
|
cursorVisibleColumn = 1;
|
|
110
148
|
inBracketedPaste = false;
|
|
111
149
|
pasteBuffer = '';
|
|
@@ -131,6 +169,12 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
131
169
|
pendingRender = false;
|
|
132
170
|
lastRenderTime = 0;
|
|
133
171
|
renderThrottleMs = 16; // ~60fps max
|
|
172
|
+
renderThrottleTimer = null;
|
|
173
|
+
// Disposal state to prevent operations after cleanup
|
|
174
|
+
disposed = false;
|
|
175
|
+
// Bound event handlers for proper cleanup
|
|
176
|
+
boundResizeHandler = null;
|
|
177
|
+
boundKeypressHandler = null;
|
|
134
178
|
inputCapture = null;
|
|
135
179
|
constructor(output = process.stdout, input = process.stdin, _options) {
|
|
136
180
|
super();
|
|
@@ -149,12 +193,14 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
149
193
|
});
|
|
150
194
|
this.rl.setPrompt('');
|
|
151
195
|
this.updateTerminalSize();
|
|
152
|
-
|
|
153
|
-
|
|
196
|
+
// Use bound handlers so we can remove them on cleanup
|
|
197
|
+
this.boundResizeHandler = () => {
|
|
198
|
+
if (!this.plainMode && !this.disposed) {
|
|
154
199
|
this.updateTerminalSize();
|
|
155
200
|
this.renderPrompt();
|
|
156
201
|
}
|
|
157
|
-
}
|
|
202
|
+
};
|
|
203
|
+
this.output.on('resize', this.boundResizeHandler);
|
|
158
204
|
this.setupInputHandlers();
|
|
159
205
|
}
|
|
160
206
|
initialize() {
|
|
@@ -181,8 +227,15 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
181
227
|
this.renderPrompt();
|
|
182
228
|
}
|
|
183
229
|
cleanup() {
|
|
230
|
+
// Mark as disposed first to prevent any pending operations
|
|
231
|
+
this.disposed = true;
|
|
184
232
|
this.cancelInputCapture(new Error('Renderer disposed'));
|
|
185
233
|
this.cancelPlainPasteCapture();
|
|
234
|
+
// Clear render throttle timer
|
|
235
|
+
if (this.renderThrottleTimer) {
|
|
236
|
+
clearTimeout(this.renderThrottleTimer);
|
|
237
|
+
this.renderThrottleTimer = null;
|
|
238
|
+
}
|
|
186
239
|
// Stop any running animations
|
|
187
240
|
if (this.spinnerInterval) {
|
|
188
241
|
clearInterval(this.spinnerInterval);
|
|
@@ -198,6 +251,17 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
198
251
|
}
|
|
199
252
|
this.contextMeter.dispose();
|
|
200
253
|
disposeAnimations();
|
|
254
|
+
// Remove event listeners to prevent memory leaks
|
|
255
|
+
if (this.boundResizeHandler) {
|
|
256
|
+
this.output.removeListener('resize', this.boundResizeHandler);
|
|
257
|
+
this.boundResizeHandler = null;
|
|
258
|
+
}
|
|
259
|
+
if (this.boundKeypressHandler) {
|
|
260
|
+
this.input.removeListener('keypress', this.boundKeypressHandler);
|
|
261
|
+
this.boundKeypressHandler = null;
|
|
262
|
+
}
|
|
263
|
+
// Remove all EventEmitter listeners from this instance
|
|
264
|
+
this.removeAllListeners();
|
|
201
265
|
if (!this.interactive) {
|
|
202
266
|
this.rl.close();
|
|
203
267
|
return;
|
|
@@ -214,6 +278,8 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
214
278
|
}
|
|
215
279
|
this.rl.close();
|
|
216
280
|
this.lastOverlay = null;
|
|
281
|
+
// Clear event queue
|
|
282
|
+
this.eventQueue = [];
|
|
217
283
|
}
|
|
218
284
|
suspendPromptRendering() {
|
|
219
285
|
this.promptRenderingSuspended = true;
|
|
@@ -234,9 +300,13 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
234
300
|
if (this.input.isTTY) {
|
|
235
301
|
this.input.setRawMode(true);
|
|
236
302
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
303
|
+
// Use bound handler so we can remove it on cleanup
|
|
304
|
+
this.boundKeypressHandler = (str, key) => {
|
|
305
|
+
if (!this.disposed) {
|
|
306
|
+
this.handleKeypress(str, key);
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
this.input.on('keypress', this.boundKeypressHandler);
|
|
240
310
|
}
|
|
241
311
|
emitInputChange() {
|
|
242
312
|
const payload = {
|
|
@@ -386,8 +456,16 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
386
456
|
else if (this.historyIndex > 0) {
|
|
387
457
|
this.historyIndex--;
|
|
388
458
|
}
|
|
389
|
-
|
|
459
|
+
// Validate index is within bounds before accessing
|
|
460
|
+
if (this.historyIndex >= 0 && this.historyIndex < this.history.length) {
|
|
461
|
+
this.buffer = this.history[this.historyIndex] ?? '';
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
this.historyIndex = -1;
|
|
465
|
+
this.buffer = '';
|
|
466
|
+
}
|
|
390
467
|
this.cursor = this.buffer.length;
|
|
468
|
+
this.inputRenderOffset = 0; // Reset render offset for new buffer
|
|
391
469
|
this.updateSuggestions();
|
|
392
470
|
this.renderPrompt();
|
|
393
471
|
this.emitInputChange();
|
|
@@ -404,10 +482,16 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
404
482
|
this.historyIndex = -1;
|
|
405
483
|
this.buffer = '';
|
|
406
484
|
}
|
|
407
|
-
else {
|
|
485
|
+
else if (this.historyIndex >= 0) {
|
|
408
486
|
this.buffer = this.history[this.historyIndex] ?? '';
|
|
409
487
|
}
|
|
488
|
+
else {
|
|
489
|
+
// Safety: invalid state, reset
|
|
490
|
+
this.historyIndex = -1;
|
|
491
|
+
this.buffer = '';
|
|
492
|
+
}
|
|
410
493
|
this.cursor = this.buffer.length;
|
|
494
|
+
this.inputRenderOffset = 0; // Reset render offset for new buffer
|
|
411
495
|
this.updateSuggestions();
|
|
412
496
|
this.renderPrompt();
|
|
413
497
|
this.emitInputChange();
|
|
@@ -472,6 +556,7 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
472
556
|
}
|
|
473
557
|
if (sequence === '\x1b[200~') {
|
|
474
558
|
this.inBracketedPaste = true;
|
|
559
|
+
this.pasteBufferOverflow = false; // Reset overflow flag for new paste
|
|
475
560
|
// Consume any pending insert buffer to prevent leak
|
|
476
561
|
const pending = this.consumePendingInsertForPaste();
|
|
477
562
|
this.pasteBuffer = pending; // Include any chars that arrived before bracketed paste started
|
|
@@ -486,7 +571,7 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
486
571
|
return true;
|
|
487
572
|
}
|
|
488
573
|
if (key?.name === 'return' || key?.name === 'enter') {
|
|
489
|
-
this.
|
|
574
|
+
this.appendToPasteBuffer('paste', '\n');
|
|
490
575
|
return true;
|
|
491
576
|
}
|
|
492
577
|
if (key?.name === 'backspace') {
|
|
@@ -494,11 +579,11 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
494
579
|
return true;
|
|
495
580
|
}
|
|
496
581
|
if (typeof str === 'string' && str.length > 0) {
|
|
497
|
-
this.
|
|
582
|
+
this.appendToPasteBuffer('paste', str);
|
|
498
583
|
return true;
|
|
499
584
|
}
|
|
500
585
|
if (typeof sequence === 'string' && sequence.length > 0) {
|
|
501
|
-
this.
|
|
586
|
+
this.appendToPasteBuffer('paste', sequence);
|
|
502
587
|
return true;
|
|
503
588
|
}
|
|
504
589
|
return true;
|
|
@@ -506,11 +591,18 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
506
591
|
commitPasteBuffer() {
|
|
507
592
|
if (!this.inBracketedPaste)
|
|
508
593
|
return;
|
|
509
|
-
|
|
594
|
+
// Sanitize to remove any injected escape sequences, then normalize line endings
|
|
595
|
+
const sanitized = this.sanitizePasteContent(this.pasteBuffer);
|
|
596
|
+
const content = sanitized.replace(/\r\n?/g, '\n');
|
|
510
597
|
if (content) {
|
|
511
598
|
const lines = content.split('\n');
|
|
599
|
+
const wasTruncated = this.pasteBufferOverflow;
|
|
512
600
|
if (lines.length > 1 || content.length > 200) {
|
|
513
|
-
this.collapsedPaste = {
|
|
601
|
+
this.collapsedPaste = {
|
|
602
|
+
text: content,
|
|
603
|
+
lines: lines.length,
|
|
604
|
+
chars: content.length + (wasTruncated ? '+' : 0), // Indicate truncation
|
|
605
|
+
};
|
|
514
606
|
this.buffer = '';
|
|
515
607
|
this.cursor = 0;
|
|
516
608
|
this.updateSuggestions();
|
|
@@ -523,6 +615,7 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
523
615
|
}
|
|
524
616
|
this.inBracketedPaste = false;
|
|
525
617
|
this.pasteBuffer = '';
|
|
618
|
+
this.pasteBufferOverflow = false;
|
|
526
619
|
this.cancelPlainPasteCapture();
|
|
527
620
|
}
|
|
528
621
|
handlePlainPaste(str, key) {
|
|
@@ -562,6 +655,7 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
562
655
|
let chunkAlreadyCaptured = false;
|
|
563
656
|
if (!this.inPlainPaste) {
|
|
564
657
|
this.inPlainPaste = true;
|
|
658
|
+
this.pasteBufferOverflow = false; // Reset overflow flag for new paste
|
|
565
659
|
// Consume pending insert buffer first - this is the primary source now
|
|
566
660
|
const pending = this.consumePendingInsertForPaste();
|
|
567
661
|
const reclaimed = this.reclaimRecentPlainChunks();
|
|
@@ -575,9 +669,13 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
575
669
|
if (removeCount > 0 && suffix === reclaimed.slice(-removeCount)) {
|
|
576
670
|
this.buffer = this.buffer.slice(0, this.buffer.length - removeCount);
|
|
577
671
|
this.cursor = Math.max(0, this.buffer.length);
|
|
672
|
+
this.clampCursor(); // Ensure cursor is valid
|
|
578
673
|
}
|
|
579
674
|
}
|
|
580
|
-
this.plainPasteBuffer = combined;
|
|
675
|
+
this.plainPasteBuffer = combined.slice(0, this.maxPasteBufferSize);
|
|
676
|
+
if (combined.length > this.maxPasteBufferSize) {
|
|
677
|
+
this.pasteBufferOverflow = true;
|
|
678
|
+
}
|
|
581
679
|
chunkAlreadyCaptured = combined.endsWith(chunk);
|
|
582
680
|
}
|
|
583
681
|
else {
|
|
@@ -585,7 +683,7 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
585
683
|
}
|
|
586
684
|
}
|
|
587
685
|
if (!chunkAlreadyCaptured) {
|
|
588
|
-
this.
|
|
686
|
+
this.appendToPasteBuffer('plainPaste', chunk);
|
|
589
687
|
}
|
|
590
688
|
this.schedulePlainPasteCommit();
|
|
591
689
|
return true;
|
|
@@ -647,11 +745,15 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
647
745
|
finalizePlainPaste() {
|
|
648
746
|
if (!this.inPlainPaste)
|
|
649
747
|
return;
|
|
650
|
-
|
|
748
|
+
// Sanitize to remove any injected escape sequences, then normalize line endings
|
|
749
|
+
const sanitized = this.sanitizePasteContent(this.plainPasteBuffer);
|
|
750
|
+
const content = sanitized.replace(/\r\n?/g, '\n');
|
|
751
|
+
const wasTruncated = this.pasteBufferOverflow;
|
|
651
752
|
this.inPlainPaste = false;
|
|
652
753
|
this.plainPasteBuffer = '';
|
|
653
754
|
this.plainRecentChunks = [];
|
|
654
755
|
this.resetPlainPasteBurst();
|
|
756
|
+
this.pasteBufferOverflow = false;
|
|
655
757
|
if (this.plainPasteTimer) {
|
|
656
758
|
clearTimeout(this.plainPasteTimer);
|
|
657
759
|
this.plainPasteTimer = null;
|
|
@@ -660,7 +762,11 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
660
762
|
return;
|
|
661
763
|
const lines = content.split('\n');
|
|
662
764
|
if (lines.length > 1 || content.length > 200) {
|
|
663
|
-
this.collapsedPaste = {
|
|
765
|
+
this.collapsedPaste = {
|
|
766
|
+
text: content,
|
|
767
|
+
lines: lines.length,
|
|
768
|
+
chars: content.length + (wasTruncated ? '+' : 0),
|
|
769
|
+
};
|
|
664
770
|
this.buffer = '';
|
|
665
771
|
this.cursor = 0;
|
|
666
772
|
this.updateSuggestions();
|
|
@@ -679,8 +785,11 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
679
785
|
if (this.collapsedPaste) {
|
|
680
786
|
this.expandCollapsedPaste();
|
|
681
787
|
}
|
|
788
|
+
// Ensure cursor is valid before slicing
|
|
789
|
+
this.clampCursor();
|
|
682
790
|
this.buffer = this.buffer.slice(0, this.cursor) + text + this.buffer.slice(this.cursor);
|
|
683
791
|
this.cursor += text.length;
|
|
792
|
+
this.clampCursor(); // Ensure cursor remains valid after modification
|
|
684
793
|
this.updateSuggestions();
|
|
685
794
|
this.renderPrompt();
|
|
686
795
|
this.emitInputChange();
|
|
@@ -797,11 +906,19 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
797
906
|
}
|
|
798
907
|
navigateSuggestions(direction) {
|
|
799
908
|
if (!this.buffer.startsWith('/') || this.suggestions.length === 0) {
|
|
909
|
+
// Reset index if suggestions were cleared but index wasn't
|
|
910
|
+
if (this.suggestionIndex !== -1 && this.suggestions.length === 0) {
|
|
911
|
+
this.suggestionIndex = -1;
|
|
912
|
+
}
|
|
800
913
|
return false;
|
|
801
914
|
}
|
|
802
|
-
|
|
915
|
+
// Ensure current index is valid before computing next
|
|
916
|
+
const currentIndex = this.suggestionIndex >= 0 && this.suggestionIndex < this.suggestions.length
|
|
917
|
+
? this.suggestionIndex
|
|
918
|
+
: -1;
|
|
919
|
+
const next = currentIndex + direction;
|
|
803
920
|
const clamped = Math.max(0, Math.min(this.suggestions.length - 1, next));
|
|
804
|
-
if (clamped === this.suggestionIndex) {
|
|
921
|
+
if (clamped === this.suggestionIndex && this.suggestionIndex >= 0) {
|
|
805
922
|
return true;
|
|
806
923
|
}
|
|
807
924
|
this.suggestionIndex = clamped;
|
|
@@ -870,11 +987,11 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
870
987
|
}
|
|
871
988
|
}
|
|
872
989
|
async processQueue() {
|
|
873
|
-
if (this.isProcessingQueue)
|
|
990
|
+
if (this.isProcessingQueue || this.disposed)
|
|
874
991
|
return;
|
|
875
992
|
this.isProcessingQueue = true;
|
|
876
993
|
try {
|
|
877
|
-
while (this.eventQueue.length > 0) {
|
|
994
|
+
while (this.eventQueue.length > 0 && !this.disposed) {
|
|
878
995
|
const event = this.eventQueue.shift();
|
|
879
996
|
if (!event)
|
|
880
997
|
continue;
|
|
@@ -884,9 +1001,14 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
884
1001
|
}
|
|
885
1002
|
catch (error) {
|
|
886
1003
|
// Never allow a rendering failure to stall the event queue
|
|
1004
|
+
if (this.disposed)
|
|
1005
|
+
break; // Don't try to write after disposal
|
|
887
1006
|
const message = error instanceof Error ? error.message : typeof error === 'string' ? error : 'Unknown renderer error';
|
|
888
1007
|
this.output.write(`\n[renderer] ${message}\n`);
|
|
889
1008
|
}
|
|
1009
|
+
// Check disposed before continuing
|
|
1010
|
+
if (this.disposed)
|
|
1011
|
+
break;
|
|
890
1012
|
// For prompt events, ensure the overlay is rendered immediately
|
|
891
1013
|
// This guarantees prompts are visible before async processing continues
|
|
892
1014
|
if (event.type === 'prompt') {
|
|
@@ -902,7 +1024,7 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
902
1024
|
}
|
|
903
1025
|
// ALWAYS render prompt after queue completes to keep bottom UI persistent
|
|
904
1026
|
// This ensures status/toggles stay pinned and responses are fully rendered
|
|
905
|
-
if (this.output.isTTY) {
|
|
1027
|
+
if (this.output.isTTY && !this.disposed) {
|
|
906
1028
|
this.allowPromptRender = true;
|
|
907
1029
|
this.renderPrompt();
|
|
908
1030
|
}
|
|
@@ -1032,9 +1154,18 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
1032
1154
|
if (this.isGarbageOutput(event.content)) {
|
|
1033
1155
|
return '';
|
|
1034
1156
|
}
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1157
|
+
const curated = this.curateReasoningContent(event.content);
|
|
1158
|
+
if (!curated || this.isGarbageOutput(curated)) {
|
|
1159
|
+
return '';
|
|
1160
|
+
}
|
|
1161
|
+
if (!this.shouldRenderThought(curated)) {
|
|
1162
|
+
return '';
|
|
1163
|
+
}
|
|
1164
|
+
this.lastCuratedThought = {
|
|
1165
|
+
text: curated.replace(/\s+/g, ' ').trim().toLowerCase(),
|
|
1166
|
+
at: Date.now(),
|
|
1167
|
+
};
|
|
1168
|
+
return this.formatThinkingBlock(curated);
|
|
1038
1169
|
}
|
|
1039
1170
|
case 'tool': {
|
|
1040
1171
|
// Compact tool display: ⚡ToolName → result
|
|
@@ -1094,6 +1225,70 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
1094
1225
|
}
|
|
1095
1226
|
return false;
|
|
1096
1227
|
}
|
|
1228
|
+
curateReasoningContent(content) {
|
|
1229
|
+
const normalized = content.replace(/\r\n/g, '\n').replace(/\r/g, '\n').trim();
|
|
1230
|
+
if (!normalized)
|
|
1231
|
+
return null;
|
|
1232
|
+
const limited = normalized.length > this.maxCuratedReasoningChars
|
|
1233
|
+
? normalized.slice(0, this.maxCuratedReasoningChars)
|
|
1234
|
+
: normalized;
|
|
1235
|
+
const segments = limited
|
|
1236
|
+
.split('\n')
|
|
1237
|
+
.flatMap(line => line.split(/(?<=[.?!])\s+/))
|
|
1238
|
+
.map(line => line.replace(/^[•*⏺○\-\u2022]+\s*/, '').trim())
|
|
1239
|
+
.filter(Boolean);
|
|
1240
|
+
if (segments.length === 0) {
|
|
1241
|
+
return null;
|
|
1242
|
+
}
|
|
1243
|
+
const seen = new Set();
|
|
1244
|
+
const deduped = [];
|
|
1245
|
+
for (const segment of segments) {
|
|
1246
|
+
const normalizedSegment = segment.replace(/\s+/g, ' ');
|
|
1247
|
+
const key = normalizedSegment.toLowerCase();
|
|
1248
|
+
if (seen.has(key)) {
|
|
1249
|
+
continue;
|
|
1250
|
+
}
|
|
1251
|
+
seen.add(key);
|
|
1252
|
+
deduped.push(normalizedSegment);
|
|
1253
|
+
if (deduped.length >= this.maxCuratedReasoningLines) {
|
|
1254
|
+
break;
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
if (deduped.length === 0) {
|
|
1258
|
+
return null;
|
|
1259
|
+
}
|
|
1260
|
+
const structured = deduped.filter(line => this.looksStructuredThought(line));
|
|
1261
|
+
const selected = structured.length > 0 ? structured : deduped;
|
|
1262
|
+
const limitedSelection = selected.slice(0, this.maxCuratedReasoningLines);
|
|
1263
|
+
const bulleted = limitedSelection.map(line => this.ensureReasoningBullet(line));
|
|
1264
|
+
return bulleted.join('\n');
|
|
1265
|
+
}
|
|
1266
|
+
ensureReasoningBullet(line) {
|
|
1267
|
+
if (/^([•*⏺○\-]|\d+[.)])\s/.test(line)) {
|
|
1268
|
+
return line;
|
|
1269
|
+
}
|
|
1270
|
+
return `• ${line}`;
|
|
1271
|
+
}
|
|
1272
|
+
looksStructuredThought(line) {
|
|
1273
|
+
return (/^(\d+[.)]\s|step\s*\d+|plan\b|next\b|then\b|goal\b)/i.test(line) ||
|
|
1274
|
+
/^[-*•]\s/.test(line) ||
|
|
1275
|
+
line.includes('->') ||
|
|
1276
|
+
line.includes('→') ||
|
|
1277
|
+
line.includes(': '));
|
|
1278
|
+
}
|
|
1279
|
+
shouldRenderThought(content) {
|
|
1280
|
+
const normalized = content.replace(/\s+/g, ' ').trim().toLowerCase();
|
|
1281
|
+
if (!normalized) {
|
|
1282
|
+
return false;
|
|
1283
|
+
}
|
|
1284
|
+
const now = Date.now();
|
|
1285
|
+
if (this.lastCuratedThought && this.lastCuratedThought.text === normalized) {
|
|
1286
|
+
if (now - this.lastCuratedThought.at < this.thoughtDedupWindowMs) {
|
|
1287
|
+
return false;
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
return true;
|
|
1291
|
+
}
|
|
1097
1292
|
/**
|
|
1098
1293
|
* Format text in Claude Code style: ⏺ prefix with wrapped continuation lines
|
|
1099
1294
|
* Example:
|
|
@@ -1688,14 +1883,21 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
1688
1883
|
}
|
|
1689
1884
|
// ------------ Prompt rendering ------------
|
|
1690
1885
|
renderPrompt() {
|
|
1886
|
+
// Don't render if disposed
|
|
1887
|
+
if (this.disposed)
|
|
1888
|
+
return;
|
|
1691
1889
|
// Throttle renders to prevent excessive redraws during rapid input
|
|
1692
1890
|
const now = Date.now();
|
|
1693
1891
|
if (now - this.lastRenderTime < this.renderThrottleMs) {
|
|
1694
1892
|
if (!this.pendingRender) {
|
|
1695
1893
|
this.pendingRender = true;
|
|
1696
|
-
|
|
1894
|
+
// Track the timer for cleanup
|
|
1895
|
+
this.renderThrottleTimer = setTimeout(() => {
|
|
1896
|
+
this.renderThrottleTimer = null;
|
|
1697
1897
|
this.pendingRender = false;
|
|
1698
|
-
this.
|
|
1898
|
+
if (!this.disposed) {
|
|
1899
|
+
this.renderPromptImmediate();
|
|
1900
|
+
}
|
|
1699
1901
|
}, this.renderThrottleMs);
|
|
1700
1902
|
}
|
|
1701
1903
|
return;
|
|
@@ -1703,6 +1905,9 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
1703
1905
|
this.renderPromptImmediate();
|
|
1704
1906
|
}
|
|
1705
1907
|
renderPromptImmediate() {
|
|
1908
|
+
// Don't render if disposed
|
|
1909
|
+
if (this.disposed)
|
|
1910
|
+
return;
|
|
1706
1911
|
this.lastRenderTime = Date.now();
|
|
1707
1912
|
if (!this.interactive) {
|
|
1708
1913
|
this.isPromptActive = false;
|
|
@@ -2405,7 +2610,9 @@ export class UnifiedUIRenderer extends EventEmitter {
|
|
|
2405
2610
|
}
|
|
2406
2611
|
setBuffer(text, cursorPos) {
|
|
2407
2612
|
this.buffer = text;
|
|
2408
|
-
|
|
2613
|
+
// Validate cursor position to prevent out-of-bounds issues
|
|
2614
|
+
const requestedCursor = cursorPos ?? text.length;
|
|
2615
|
+
this.cursor = Math.max(0, Math.min(requestedCursor, text.length));
|
|
2409
2616
|
this.inputRenderOffset = 0;
|
|
2410
2617
|
this.updateSuggestions();
|
|
2411
2618
|
this.renderPrompt();
|