erosolar-cli 1.5.3 → 1.5.5
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/config/security-deployment.json +54 -0
- package/dist/active-stack-security.d.ts +110 -0
- package/dist/active-stack-security.js +313 -0
- package/dist/active-stack-security.js.map +1 -0
- package/dist/advanced-targeting.d.ts +113 -0
- package/dist/advanced-targeting.js +252 -0
- package/dist/advanced-targeting.js.map +1 -0
- package/dist/bin/adapters/node/index.js +33 -0
- package/dist/bin/adapters/types.js +1 -0
- package/dist/bin/alpha-zero/agentWrapper.js +165 -0
- package/dist/bin/alpha-zero/codeEvaluator.js +272 -0
- package/dist/bin/alpha-zero/competitiveRunner.js +219 -0
- package/dist/bin/alpha-zero/index.js +98 -0
- package/dist/bin/alpha-zero/introspection.js +298 -0
- package/dist/bin/alpha-zero/metricsTracker.js +207 -0
- package/dist/bin/alpha-zero/security/core.js +269 -0
- package/dist/bin/alpha-zero/security/google.js +308 -0
- package/dist/bin/alpha-zero/security/googleLoader.js +40 -0
- package/dist/bin/alpha-zero/security/index.js +31 -0
- package/dist/bin/alpha-zero/security/simulation.js +274 -0
- package/dist/bin/alpha-zero/selfModification.js +231 -0
- package/dist/bin/alpha-zero/types.js +30 -0
- package/dist/bin/bin/erosolar-optimized.js +205 -0
- package/dist/bin/capabilities/agentSpawningCapability.js +116 -0
- package/dist/bin/capabilities/bashCapability.js +22 -0
- package/dist/bin/capabilities/cloudCapability.js +36 -0
- package/dist/bin/capabilities/codeAnalysisCapability.js +22 -0
- package/dist/bin/capabilities/codeQualityCapability.js +23 -0
- package/dist/bin/capabilities/dependencySecurityCapability.js +22 -0
- package/dist/bin/capabilities/devCapability.js +22 -0
- package/dist/bin/capabilities/editCapability.js +28 -0
- package/dist/bin/capabilities/emailCapability.js +20 -0
- package/dist/bin/capabilities/enhancedGitCapability.js +221 -0
- package/dist/bin/capabilities/filesystemCapability.js +22 -0
- package/dist/bin/capabilities/globCapability.js +28 -0
- package/dist/bin/capabilities/interactionCapability.js +20 -0
- package/dist/bin/capabilities/learnCapability.js +22 -0
- package/dist/bin/capabilities/mcpCapability.js +20 -0
- package/dist/bin/capabilities/notebookCapability.js +28 -0
- package/dist/bin/capabilities/planningCapability.js +27 -0
- package/dist/bin/capabilities/refactoringCapability.js +23 -0
- package/dist/bin/capabilities/repoChecksCapability.js +22 -0
- package/dist/bin/capabilities/searchCapability.js +22 -0
- package/dist/bin/capabilities/skillCapability.js +76 -0
- package/dist/bin/capabilities/taskManagementCapability.js +20 -0
- package/dist/bin/capabilities/testingCapability.js +23 -0
- package/dist/bin/capabilities/toolManifest.js +159 -0
- package/dist/bin/capabilities/toolRegistry.js +114 -0
- package/dist/bin/capabilities/webCapability.js +20 -0
- package/dist/bin/config.js +139 -0
- package/dist/bin/contracts/v1/agent.js +7 -0
- package/dist/bin/contracts/v1/agentProfileManifest.js +8 -0
- package/dist/bin/contracts/v1/agentRules.js +9 -0
- package/dist/bin/contracts/v1/toolAccess.js +8 -0
- package/dist/bin/core/agent.js +362 -0
- package/dist/bin/core/agentProfileManifest.js +187 -0
- package/dist/bin/core/agentProfiles.js +34 -0
- package/dist/bin/core/agentRulebook.js +135 -0
- package/dist/bin/core/agentSchemaLoader.js +233 -0
- package/dist/bin/core/contextManager.js +412 -0
- package/dist/bin/core/contextWindow.js +122 -0
- package/dist/bin/core/customCommands.js +80 -0
- package/dist/bin/core/errors/apiKeyErrors.js +114 -0
- package/dist/bin/core/errors/errorTypes.js +340 -0
- package/dist/bin/core/errors/safetyValidator.js +304 -0
- package/dist/bin/core/errors.js +32 -0
- package/dist/bin/core/modelDiscovery.js +755 -0
- package/dist/bin/core/preferences.js +224 -0
- package/dist/bin/core/schemaValidator.js +92 -0
- package/dist/bin/core/secretStore.js +199 -0
- package/dist/bin/core/sessionStore.js +187 -0
- package/dist/bin/core/toolRuntime.js +290 -0
- package/dist/bin/core/types.js +1 -0
- package/dist/bin/erosolar-optimized.d.ts +12 -0
- package/dist/bin/erosolar-optimized.d.ts.map +1 -0
- package/dist/bin/erosolar-optimized.js +239 -0
- package/dist/bin/erosolar-optimized.js.map +1 -0
- package/dist/bin/erosolar.js +14 -0
- package/dist/bin/erosolar.js.map +1 -1
- package/dist/bin/headless/headlessApp.js +172 -0
- package/dist/bin/mcp/config.js +202 -0
- package/dist/bin/mcp/stdioClient.js +172 -0
- package/dist/bin/mcp/toolBridge.js +104 -0
- package/dist/bin/mcp/types.js +1 -0
- package/dist/bin/plugins/index.js +113 -0
- package/dist/bin/plugins/providers/anthropic/index.js +25 -0
- package/dist/bin/plugins/providers/deepseek/index.js +24 -0
- package/dist/bin/plugins/providers/google/index.js +26 -0
- package/dist/bin/plugins/providers/index.js +19 -0
- package/dist/bin/plugins/providers/ollama/index.js +59 -0
- package/dist/bin/plugins/providers/openai/index.js +26 -0
- package/dist/bin/plugins/providers/xai/index.js +24 -0
- package/dist/bin/plugins/tools/agentSpawning/agentSpawningPlugin.js +8 -0
- package/dist/bin/plugins/tools/bash/localBashPlugin.js +13 -0
- package/dist/bin/plugins/tools/checks/localRepoChecksPlugin.js +13 -0
- package/dist/bin/plugins/tools/cloud/cloudPlugin.js +13 -0
- package/dist/bin/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +13 -0
- package/dist/bin/plugins/tools/codeQuality/codeQualityPlugin.js +13 -0
- package/dist/bin/plugins/tools/dependency/dependencyPlugin.js +11 -0
- package/dist/bin/plugins/tools/development/devPlugin.js +13 -0
- package/dist/bin/plugins/tools/edit/editPlugin.js +14 -0
- package/dist/bin/plugins/tools/email/emailPlugin.js +11 -0
- package/dist/bin/plugins/tools/enhancedGit/enhancedGitPlugin.js +8 -0
- package/dist/bin/plugins/tools/filesystem/localFilesystemPlugin.js +13 -0
- package/dist/bin/plugins/tools/glob/globPlugin.js +14 -0
- package/dist/bin/plugins/tools/index.js +2 -0
- package/dist/bin/plugins/tools/interaction/interactionPlugin.js +11 -0
- package/dist/bin/plugins/tools/learn/learnPlugin.js +13 -0
- package/dist/bin/plugins/tools/mcp/mcpPlugin.js +8 -0
- package/dist/bin/plugins/tools/nodeDefaults.js +56 -0
- package/dist/bin/plugins/tools/notebook/notebookPlugin.js +14 -0
- package/dist/bin/plugins/tools/planning/planningPlugin.js +14 -0
- package/dist/bin/plugins/tools/refactoring/refactoringPlugin.js +11 -0
- package/dist/bin/plugins/tools/registry.js +57 -0
- package/dist/bin/plugins/tools/search/localSearchPlugin.js +13 -0
- package/dist/bin/plugins/tools/skills/skillPlugin.js +8 -0
- package/dist/bin/plugins/tools/taskManagement/taskManagementPlugin.js +11 -0
- package/dist/bin/plugins/tools/testing/testingPlugin.js +11 -0
- package/dist/bin/plugins/tools/web/webPlugin.js +11 -0
- package/dist/bin/providers/anthropicProvider.js +329 -0
- package/dist/bin/providers/googleProvider.js +203 -0
- package/dist/bin/providers/openaiChatCompletionsProvider.js +208 -0
- package/dist/bin/providers/openaiResponsesProvider.js +249 -0
- package/dist/bin/providers/providerFactory.js +24 -0
- package/dist/bin/runtime/agentController.js +321 -0
- package/dist/bin/runtime/agentHost.js +153 -0
- package/dist/bin/runtime/agentSession.js +195 -0
- package/dist/bin/runtime/node.js +10 -0
- package/dist/bin/runtime/universal.js +28 -0
- package/dist/bin/shell/bracketedPasteManager.js +350 -0
- package/dist/bin/shell/fileChangeTracker.js +65 -0
- package/dist/bin/shell/interactiveShell.js +2908 -0
- package/dist/bin/shell/liveStatus.js +78 -0
- package/dist/bin/shell/shellApp.js +290 -0
- package/dist/bin/shell/systemPrompt.js +60 -0
- package/dist/bin/shell/updateManager.js +108 -0
- package/dist/bin/skills/skillRepository.js +236 -0
- package/dist/bin/skills/types.js +1 -0
- package/dist/bin/subagents/taskRunner.js +269 -0
- package/dist/bin/tools/backgroundBashTools.js +211 -0
- package/dist/bin/tools/bashTools.js +159 -0
- package/dist/bin/tools/cloudTools.js +864 -0
- package/dist/bin/tools/codeAnalysisTools.js +641 -0
- package/dist/bin/tools/codeQualityTools.js +294 -0
- package/dist/bin/tools/dependencyTools.js +282 -0
- package/dist/bin/tools/devTools.js +238 -0
- package/dist/bin/tools/diffUtils.js +137 -0
- package/dist/bin/tools/editTools.js +134 -0
- package/dist/bin/tools/emailTools.js +448 -0
- package/dist/bin/tools/fileTools.js +282 -0
- package/dist/bin/tools/globTools.js +173 -0
- package/dist/bin/tools/grepTools.js +332 -0
- package/dist/bin/tools/interactionTools.js +170 -0
- package/dist/bin/tools/learnTools.js +1818 -0
- package/dist/bin/tools/notebookEditTools.js +196 -0
- package/dist/bin/tools/planningTools.js +46 -0
- package/dist/bin/tools/refactoringTools.js +293 -0
- package/dist/bin/tools/repoChecksTools.js +160 -0
- package/dist/bin/tools/searchTools.js +206 -0
- package/dist/bin/tools/skillTools.js +177 -0
- package/dist/bin/tools/taskManagementTools.js +156 -0
- package/dist/bin/tools/testingTools.js +232 -0
- package/dist/bin/tools/webTools.js +480 -0
- package/dist/bin/ui/ShellUIAdapter.js +459 -0
- package/dist/bin/ui/UnifiedUIController.js +183 -0
- package/dist/bin/ui/animation/AnimationScheduler.js +430 -0
- package/dist/bin/ui/codeHighlighter.js +854 -0
- package/dist/bin/ui/designSystem.js +121 -0
- package/dist/bin/ui/display.js +1222 -0
- package/dist/bin/ui/interrupts/InterruptManager.js +437 -0
- package/dist/bin/ui/layout.js +139 -0
- package/dist/bin/ui/orchestration/StatusOrchestrator.js +403 -0
- package/dist/bin/ui/outputMode.js +38 -0
- package/dist/bin/ui/persistentPrompt.js +183 -0
- package/dist/bin/ui/richText.js +338 -0
- package/dist/bin/ui/shortcutsHelp.js +87 -0
- package/dist/bin/ui/telemetry/UITelemetry.js +443 -0
- package/dist/bin/ui/textHighlighter.js +210 -0
- package/dist/bin/ui/theme.js +116 -0
- package/dist/bin/ui/toolDisplay.js +423 -0
- package/dist/bin/ui/toolDisplayAdapter.js +357 -0
- package/dist/bin/workspace.js +106 -0
- package/dist/bin/workspace.validator.js +213 -0
- package/dist/capabilities/offensiveSecurityCapability.d.ts +26 -0
- package/dist/capabilities/offensiveSecurityCapability.d.ts.map +1 -0
- package/dist/capabilities/offensiveSecurityCapability.js +58 -0
- package/dist/capabilities/offensiveSecurityCapability.js.map +1 -0
- package/dist/capabilities/realSecurityCapability.d.ts +26 -0
- package/dist/capabilities/realSecurityCapability.d.ts.map +1 -0
- package/dist/capabilities/realSecurityCapability.js +53 -0
- package/dist/capabilities/realSecurityCapability.js.map +1 -0
- package/dist/capabilities/securityCapability.d.ts +32 -0
- package/dist/capabilities/securityCapability.d.ts.map +1 -0
- package/dist/capabilities/securityCapability.js +57 -0
- package/dist/capabilities/securityCapability.js.map +1 -0
- package/dist/capabilities/ultimateSecurityCapability.d.ts +42 -0
- package/dist/capabilities/ultimateSecurityCapability.d.ts.map +1 -0
- package/dist/capabilities/ultimateSecurityCapability.js +96 -0
- package/dist/capabilities/ultimateSecurityCapability.js.map +1 -0
- package/dist/core/LazyLoader.d.ts +129 -0
- package/dist/core/LazyLoader.d.ts.map +1 -0
- package/dist/core/LazyLoader.js +240 -0
- package/dist/core/LazyLoader.js.map +1 -0
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/agent.js +78 -8
- package/dist/core/agent.js.map +1 -1
- package/dist/core/contextManager.d.ts.map +1 -1
- package/dist/core/contextManager.js +117 -16
- package/dist/core/contextManager.js.map +1 -1
- package/dist/core/intelligenceTools.d.ts +19 -0
- package/dist/core/intelligenceTools.d.ts.map +1 -0
- package/dist/core/intelligenceTools.js +453 -0
- package/dist/core/intelligenceTools.js.map +1 -0
- package/dist/core/operationalTools.d.ts +19 -0
- package/dist/core/operationalTools.d.ts.map +1 -0
- package/dist/core/operationalTools.js +467 -0
- package/dist/core/operationalTools.js.map +1 -0
- package/dist/intelligence/codeIntelligence.d.ts.map +1 -1
- package/dist/intelligence/codeIntelligence.js +12 -0
- package/dist/intelligence/codeIntelligence.js.map +1 -1
- package/dist/offensive/core/offensive-engine.d.ts +171 -0
- package/dist/offensive/core/offensive-engine.d.ts.map +1 -0
- package/dist/offensive/core/offensive-engine.js +345 -0
- package/dist/offensive/core/offensive-engine.js.map +1 -0
- package/dist/offensive/core/offensive-integration.d.ts +129 -0
- package/dist/offensive/core/offensive-integration.d.ts.map +1 -0
- package/dist/offensive/core/offensive-integration.js +364 -0
- package/dist/offensive/core/offensive-integration.js.map +1 -0
- package/dist/offensive/core/offensive-tools.d.ts +55 -0
- package/dist/offensive/core/offensive-tools.d.ts.map +1 -0
- package/dist/offensive/core/offensive-tools.js +438 -0
- package/dist/offensive/core/offensive-tools.js.map +1 -0
- package/dist/offensive/offensive-cli.d.ts +48 -0
- package/dist/offensive/offensive-cli.d.ts.map +1 -0
- package/dist/offensive/offensive-cli.js +233 -0
- package/dist/offensive/offensive-cli.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 +2 -0
- package/dist/plugins/index.js.map +1 -1
- package/dist/security/active-stack-security.d.ts +112 -0
- package/dist/security/active-stack-security.d.ts.map +1 -0
- package/dist/security/active-stack-security.js +296 -0
- package/dist/security/active-stack-security.js.map +1 -0
- package/dist/security/advanced-persistence-research.d.ts +92 -0
- package/dist/security/advanced-persistence-research.d.ts.map +1 -0
- package/dist/security/advanced-persistence-research.js +195 -0
- package/dist/security/advanced-persistence-research.js.map +1 -0
- package/dist/security/advanced-targeting.d.ts +119 -0
- package/dist/security/advanced-targeting.d.ts.map +1 -0
- package/dist/security/advanced-targeting.js +233 -0
- package/dist/security/advanced-targeting.js.map +1 -0
- package/dist/security/apt-simulation-cli.d.ts +57 -0
- package/dist/security/apt-simulation-cli.d.ts.map +1 -0
- package/dist/security/apt-simulation-cli.js +278 -0
- package/dist/security/apt-simulation-cli.js.map +1 -0
- package/dist/security/apt-simulation-engine-complete.d.ts +97 -0
- package/dist/security/apt-simulation-engine-complete.d.ts.map +1 -0
- package/dist/security/apt-simulation-engine-complete.js +441 -0
- package/dist/security/apt-simulation-engine-complete.js.map +1 -0
- package/dist/security/apt-simulation-engine.d.ts +97 -0
- package/dist/security/apt-simulation-engine.d.ts.map +1 -0
- package/dist/security/apt-simulation-engine.js +441 -0
- package/dist/security/apt-simulation-engine.js.map +1 -0
- package/dist/security/assessment/vulnerabilityAssessment.d.ts +104 -0
- package/dist/security/assessment/vulnerabilityAssessment.d.ts.map +1 -0
- package/dist/security/assessment/vulnerabilityAssessment.js +315 -0
- package/dist/security/assessment/vulnerabilityAssessment.js.map +1 -0
- package/dist/security/authorization/securityAuthorization.d.ts +88 -0
- package/dist/security/authorization/securityAuthorization.d.ts.map +1 -0
- package/dist/security/authorization/securityAuthorization.js +172 -0
- package/dist/security/authorization/securityAuthorization.js.map +1 -0
- package/dist/security/authorization.d.ts +45 -0
- package/dist/security/authorization.d.ts.map +1 -0
- package/dist/security/authorization.js +128 -0
- package/dist/security/authorization.js.map +1 -0
- package/dist/security/comprehensive-security-research.d.ts +84 -0
- package/dist/security/comprehensive-security-research.d.ts.map +1 -0
- package/dist/security/comprehensive-security-research.js +211 -0
- package/dist/security/comprehensive-security-research.js.map +1 -0
- package/dist/security/comprehensive-targeting.d.ts +85 -0
- package/dist/security/comprehensive-targeting.d.ts.map +1 -0
- package/dist/security/comprehensive-targeting.js +438 -0
- package/dist/security/comprehensive-targeting.js.map +1 -0
- package/dist/security/global-security-integration.d.ts +91 -0
- package/dist/security/global-security-integration.d.ts.map +1 -0
- package/dist/security/global-security-integration.js +218 -0
- package/dist/security/global-security-integration.js.map +1 -0
- package/dist/security/index.d.ts +38 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +47 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/offensive/exploitationEngine.d.ts +54 -0
- package/dist/security/offensive/exploitationEngine.d.ts.map +1 -0
- package/dist/security/offensive/exploitationEngine.js +263 -0
- package/dist/security/offensive/exploitationEngine.js.map +1 -0
- package/dist/security/persistence-cli.d.ts +36 -0
- package/dist/security/persistence-cli.d.ts.map +1 -0
- package/dist/security/persistence-cli.js +160 -0
- package/dist/security/persistence-cli.js.map +1 -0
- package/dist/security/persistence-research.d.ts +11 -0
- package/dist/security/persistence-research.d.ts.map +1 -1
- package/dist/security/persistence-research.js +11 -0
- package/dist/security/persistence-research.js.map +1 -1
- package/dist/security/real/networkExploitation.d.ts +92 -0
- package/dist/security/real/networkExploitation.d.ts.map +1 -0
- package/dist/security/real/networkExploitation.js +316 -0
- package/dist/security/real/networkExploitation.js.map +1 -0
- package/dist/security/real/persistenceImplementation.d.ts +62 -0
- package/dist/security/real/persistenceImplementation.d.ts.map +1 -0
- package/dist/security/real/persistenceImplementation.js +323 -0
- package/dist/security/real/persistenceImplementation.js.map +1 -0
- package/dist/security/real/vulnerabilityScanner.d.ts +73 -0
- package/dist/security/real/vulnerabilityScanner.d.ts.map +1 -0
- package/dist/security/real/vulnerabilityScanner.js +341 -0
- package/dist/security/real/vulnerabilityScanner.js.map +1 -0
- package/dist/security/research/persistenceResearch.d.ts +97 -0
- package/dist/security/research/persistenceResearch.d.ts.map +1 -0
- package/dist/security/research/persistenceResearch.js +282 -0
- package/dist/security/research/persistenceResearch.js.map +1 -0
- package/dist/security/security-integration.d.ts +74 -0
- package/dist/security/security-integration.d.ts.map +1 -0
- package/dist/security/security-integration.js +137 -0
- package/dist/security/security-integration.js.map +1 -0
- package/dist/security/security-testing-framework.d.ts +120 -0
- package/dist/security/security-testing-framework.d.ts.map +1 -0
- package/dist/security/security-testing-framework.js +372 -0
- package/dist/security/security-testing-framework.js.map +1 -0
- package/dist/security/simulation/attackSimulation.d.ts +93 -0
- package/dist/security/simulation/attackSimulation.d.ts.map +1 -0
- package/dist/security/simulation/attackSimulation.js +341 -0
- package/dist/security/simulation/attackSimulation.js.map +1 -0
- package/dist/security/strategic-operations.d.ts +100 -0
- package/dist/security/strategic-operations.d.ts.map +1 -0
- package/dist/security/strategic-operations.js +276 -0
- package/dist/security/strategic-operations.js.map +1 -0
- package/dist/security/tool-security-wrapper.d.ts +58 -0
- package/dist/security/tool-security-wrapper.d.ts.map +1 -0
- package/dist/security/tool-security-wrapper.js +156 -0
- package/dist/security/tool-security-wrapper.js.map +1 -0
- package/dist/shell/bracketedPasteManager.d.ts +33 -0
- package/dist/shell/bracketedPasteManager.d.ts.map +1 -1
- package/dist/shell/bracketedPasteManager.js +101 -0
- package/dist/shell/bracketedPasteManager.js.map +1 -1
- package/dist/shell/interactiveShell.d.ts +22 -1
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +257 -24
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/taskCompletionDetector.d.ts +101 -0
- package/dist/shell/taskCompletionDetector.d.ts.map +1 -0
- package/dist/shell/taskCompletionDetector.js +343 -0
- package/dist/shell/taskCompletionDetector.js.map +1 -0
- package/dist/tools/cloudTools.d.ts +11 -0
- package/dist/tools/cloudTools.d.ts.map +1 -1
- package/dist/tools/cloudTools.js +11 -0
- package/dist/tools/cloudTools.js.map +1 -1
- package/dist/tools/codeAnalysisTools.d.ts.map +1 -1
- package/dist/tools/codeAnalysisTools.js +23 -1
- package/dist/tools/codeAnalysisTools.js.map +1 -1
- package/dist/tools/enhancedSecurityTools.d.ts +19 -0
- package/dist/tools/enhancedSecurityTools.d.ts.map +1 -0
- package/dist/tools/enhancedSecurityTools.js +215 -0
- package/dist/tools/enhancedSecurityTools.js.map +1 -0
- package/dist/tools/fileTools.d.ts.map +1 -1
- package/dist/tools/fileTools.js +7 -0
- package/dist/tools/fileTools.js.map +1 -1
- package/dist/tools/grepTools.d.ts.map +1 -1
- package/dist/tools/grepTools.js +6 -0
- package/dist/tools/grepTools.js.map +1 -1
- package/dist/tools/offensiveSecurityTools.d.ts +16 -0
- package/dist/tools/offensiveSecurityTools.d.ts.map +1 -0
- package/dist/tools/offensiveSecurityTools.js +285 -0
- package/dist/tools/offensiveSecurityTools.js.map +1 -0
- package/dist/tools/realSecurityTools.d.ts +18 -0
- package/dist/tools/realSecurityTools.d.ts.map +1 -0
- package/dist/tools/realSecurityTools.js +468 -0
- package/dist/tools/realSecurityTools.js.map +1 -0
- package/dist/tools/securityTools.d.ts +20 -0
- package/dist/tools/securityTools.d.ts.map +1 -0
- package/dist/tools/securityTools.js +449 -0
- package/dist/tools/securityTools.js.map +1 -0
- package/dist/tools/webTools.js +9 -0
- package/dist/tools/webTools.js.map +1 -1
- package/package.json +26 -11
- package/scripts/deploy-security-capabilities.js +178 -0
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ShellUIAdapter - Bridges the UnifiedUIController with the existing shell infrastructure
|
|
3
|
+
* Provides compatibility layer and migration path from old to new UI system
|
|
4
|
+
*/
|
|
5
|
+
import { UnifiedUIController } from './UnifiedUIController.js';
|
|
6
|
+
import { InterruptPriority } from './interrupts/InterruptManager.js';
|
|
7
|
+
import { getTerminalColumns } from './layout.js';
|
|
8
|
+
import { ToolDisplayAdapter } from './toolDisplayAdapter.js';
|
|
9
|
+
export class ShellUIAdapter {
|
|
10
|
+
constructor(writeStream, display, config = {}) {
|
|
11
|
+
this.isProcessing = false;
|
|
12
|
+
this.contextUsage = 0;
|
|
13
|
+
this.display = display;
|
|
14
|
+
this.toolDisplay = new ToolDisplayAdapter(display);
|
|
15
|
+
this.config = {
|
|
16
|
+
useUnifiedUI: true,
|
|
17
|
+
preserveCompatibility: true,
|
|
18
|
+
enableTelemetry: true,
|
|
19
|
+
debugMode: false,
|
|
20
|
+
...config,
|
|
21
|
+
};
|
|
22
|
+
// Initialize unified UI controller
|
|
23
|
+
this.uiController = new UnifiedUIController(writeStream, {
|
|
24
|
+
enableOverlay: true,
|
|
25
|
+
enableAnimations: true,
|
|
26
|
+
enableTelemetry: this.config.enableTelemetry,
|
|
27
|
+
adaptivePerformance: true,
|
|
28
|
+
debugMode: this.config.debugMode,
|
|
29
|
+
});
|
|
30
|
+
// Legacy components are optional and should be passed in if needed
|
|
31
|
+
// They require a readline.Interface which we don't have here
|
|
32
|
+
this.setupDisplayIntegration();
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Setup display integration
|
|
36
|
+
*/
|
|
37
|
+
setupDisplayIntegration() {
|
|
38
|
+
// Register output interceptor to coordinate with overlay
|
|
39
|
+
this.display.registerOutputInterceptor({
|
|
40
|
+
beforeWrite: () => {
|
|
41
|
+
if (this.config.useUnifiedUI) {
|
|
42
|
+
this.uiController.beginOutput();
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
afterWrite: () => {
|
|
46
|
+
if (this.config.useUnifiedUI) {
|
|
47
|
+
this.uiController.endOutput();
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Create a tool observer for the agent
|
|
54
|
+
*/
|
|
55
|
+
createToolObserver() {
|
|
56
|
+
return {
|
|
57
|
+
onToolStart: (call) => {
|
|
58
|
+
// Use safe write to coordinate with spinner output
|
|
59
|
+
this.display.safeWrite(() => {
|
|
60
|
+
this.toolDisplay.showToolStart(call);
|
|
61
|
+
const actionDesc = this.getToolActionDescription(call);
|
|
62
|
+
if (actionDesc) {
|
|
63
|
+
this.updateSpinnerMessage(actionDesc);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
if (this.config.useUnifiedUI) {
|
|
67
|
+
this.uiController.onToolStart(call);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
onToolProgress: (call, progress) => {
|
|
71
|
+
if (this.config.useUnifiedUI) {
|
|
72
|
+
this.uiController.onToolProgress(call.id, {
|
|
73
|
+
current: progress.current,
|
|
74
|
+
total: progress.total ?? progress.current,
|
|
75
|
+
message: progress.message,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
this.display.safeWrite(() => {
|
|
79
|
+
const description = this.getToolActionDescription(call, progress);
|
|
80
|
+
if (description) {
|
|
81
|
+
this.updateSpinnerMessage(description);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
onToolResult: (call, output) => {
|
|
86
|
+
// Use safe write to coordinate with spinner output
|
|
87
|
+
this.display.safeWrite(() => {
|
|
88
|
+
// Temporarily stop spinner to show result
|
|
89
|
+
const wasSpinning = this.display.isSpinnerActive();
|
|
90
|
+
if (wasSpinning) {
|
|
91
|
+
this.display.stopThinking(false);
|
|
92
|
+
}
|
|
93
|
+
// Track file changes for Edit/Write tools
|
|
94
|
+
if (this.fileChangeCallback && (call.name === 'Edit' || call.name === 'Write')) {
|
|
95
|
+
const fileChange = this.parseFileChange(call, output);
|
|
96
|
+
if (fileChange) {
|
|
97
|
+
this.fileChangeCallback(fileChange.path, fileChange.type, fileChange.additions, fileChange.removals);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
this.toolDisplay.showToolResult(call.id, output, 'success');
|
|
101
|
+
// Update spinner for next action (reuse existing if it was running)
|
|
102
|
+
if (wasSpinning) {
|
|
103
|
+
this.display.showThinking('Analyzing results...');
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
if (this.config.useUnifiedUI) {
|
|
107
|
+
this.uiController.onToolComplete(call.id, output);
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
onToolError: (call, message) => {
|
|
111
|
+
// Use safe write to coordinate with spinner output
|
|
112
|
+
this.display.safeWrite(() => {
|
|
113
|
+
// Temporarily stop spinner to show error
|
|
114
|
+
const wasSpinning = this.display.isSpinnerActive();
|
|
115
|
+
if (wasSpinning) {
|
|
116
|
+
this.display.stopThinking(false);
|
|
117
|
+
}
|
|
118
|
+
this.toolDisplay.showToolResult(call.id, message, 'error');
|
|
119
|
+
// Update spinner (reuse existing if it was running)
|
|
120
|
+
if (wasSpinning) {
|
|
121
|
+
this.display.showThinking('Handling error...');
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
if (this.config.useUnifiedUI) {
|
|
125
|
+
this.uiController.onToolError(call.id, { message });
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
onCacheHit: (call) => {
|
|
129
|
+
if (this.config.useUnifiedUI) {
|
|
130
|
+
this.uiController.onToolStart(call);
|
|
131
|
+
this.uiController.onToolComplete(call.id, 'cache-hit');
|
|
132
|
+
}
|
|
133
|
+
this.display.safeWrite(() => {
|
|
134
|
+
this.display.showSubAction(`Cache hit: ${call.name}`, 'info');
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Start processing a request
|
|
141
|
+
*/
|
|
142
|
+
startProcessing(message = 'Working on your request') {
|
|
143
|
+
this.isProcessing = true;
|
|
144
|
+
if (this.config.useUnifiedUI) {
|
|
145
|
+
this.uiController.startProcessing();
|
|
146
|
+
this.uiController.setBaseStatus(message, 'info');
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
if (this.legacyStatusTracker) {
|
|
150
|
+
this.legacyStatusTracker.setBase(message, { tone: 'info' });
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* End processing
|
|
156
|
+
*/
|
|
157
|
+
endProcessing(message = 'Ready for prompts') {
|
|
158
|
+
this.isProcessing = false;
|
|
159
|
+
if (this.config.useUnifiedUI) {
|
|
160
|
+
this.uiController.endProcessing();
|
|
161
|
+
this.uiController.setBaseStatus(message, 'success');
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
if (this.legacyStatusTracker) {
|
|
165
|
+
this.legacyStatusTracker.setBase(message, { tone: 'success' });
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Update context usage
|
|
171
|
+
*/
|
|
172
|
+
updateContextUsage(percentage) {
|
|
173
|
+
this.contextUsage = percentage;
|
|
174
|
+
if (this.config.useUnifiedUI) {
|
|
175
|
+
// Determine tone based on usage
|
|
176
|
+
let tone = 'info';
|
|
177
|
+
if (percentage > 90)
|
|
178
|
+
tone = 'danger';
|
|
179
|
+
else if (percentage > 70)
|
|
180
|
+
tone = 'warning';
|
|
181
|
+
const message = `Context ${percentage}% used`;
|
|
182
|
+
this.uiController.pushStatusOverride('context', message, undefined, tone);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Show a user interrupt
|
|
187
|
+
*/
|
|
188
|
+
showInterrupt(message, type = 'alert', handler) {
|
|
189
|
+
if (this.config.useUnifiedUI) {
|
|
190
|
+
const priority = type === 'alert'
|
|
191
|
+
? InterruptPriority.HIGH
|
|
192
|
+
: InterruptPriority.NORMAL;
|
|
193
|
+
return this.uiController.queueInterrupt(type, message, priority, handler ? async () => handler() : undefined);
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
// For legacy, just show the message immediately
|
|
197
|
+
this.display.showWarning(message);
|
|
198
|
+
if (handler) {
|
|
199
|
+
setTimeout(() => handler(), 0);
|
|
200
|
+
}
|
|
201
|
+
return 'legacy-interrupt';
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Complete an interrupt
|
|
206
|
+
*/
|
|
207
|
+
completeInterrupt(id) {
|
|
208
|
+
if (this.config.useUnifiedUI) {
|
|
209
|
+
this.uiController.completeInterrupt(id);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Show slash command preview with dynamic overlay
|
|
214
|
+
*/
|
|
215
|
+
showSlashCommandPreview(commands) {
|
|
216
|
+
if (this.config.useUnifiedUI) {
|
|
217
|
+
// Build a Claude Code-style command menu without duplicate separators
|
|
218
|
+
// Build command lines with proper indentation
|
|
219
|
+
const commandLines = commands.map(cmd => {
|
|
220
|
+
return ` ${cmd.command}\n ${cmd.description}`;
|
|
221
|
+
}).join('\n');
|
|
222
|
+
// Create command content
|
|
223
|
+
const content = commandLines;
|
|
224
|
+
// Use the unified UI overlay system
|
|
225
|
+
this.uiController.updateCommandsOverlay(content);
|
|
226
|
+
}
|
|
227
|
+
else if (this.legacyStatusTracker) {
|
|
228
|
+
// Legacy fallback - just show command names
|
|
229
|
+
const preview = commands.map(c => c.command).join(' | ');
|
|
230
|
+
this.legacyStatusTracker.pushOverride('slash-preview', `Commands: ${preview}`, {
|
|
231
|
+
tone: 'info',
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Hide slash command preview
|
|
237
|
+
*/
|
|
238
|
+
hideSlashCommandPreview() {
|
|
239
|
+
if (this.config.useUnifiedUI) {
|
|
240
|
+
this.uiController.hideCommandsOverlay();
|
|
241
|
+
}
|
|
242
|
+
else if (this.legacyStatusTracker) {
|
|
243
|
+
this.legacyStatusTracker.clearOverride('slash-preview');
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Show profile switcher (Shift+Tab)
|
|
248
|
+
*/
|
|
249
|
+
showProfileSwitcher(profiles, currentProfile) {
|
|
250
|
+
if (this.config.useUnifiedUI) {
|
|
251
|
+
// Build profile switcher overlay
|
|
252
|
+
const terminalWidth = getTerminalColumns();
|
|
253
|
+
const separator = '─'.repeat(terminalWidth - 1);
|
|
254
|
+
// Build profile lines
|
|
255
|
+
const profileLines = profiles.map(profile => {
|
|
256
|
+
return ` ${profile.command}\n ${profile.description}`;
|
|
257
|
+
}).join('\n');
|
|
258
|
+
// Create overlay content
|
|
259
|
+
const header = `Switch Profile (Shift+Tab)`;
|
|
260
|
+
const content = `${separator}\n${header}\n${separator}\n${profileLines}\n\nPress number to switch or Esc to cancel`;
|
|
261
|
+
// Use the unified UI overlay system
|
|
262
|
+
this.uiController.updateCommandsOverlay(content);
|
|
263
|
+
// Auto-hide after 5 seconds (track timeout to allow cleanup)
|
|
264
|
+
if (this.profileSwitcherTimeout) {
|
|
265
|
+
clearTimeout(this.profileSwitcherTimeout);
|
|
266
|
+
}
|
|
267
|
+
this.profileSwitcherTimeout = setTimeout(() => {
|
|
268
|
+
this.uiController.hideCommandsOverlay();
|
|
269
|
+
this.profileSwitcherTimeout = undefined;
|
|
270
|
+
}, 5000);
|
|
271
|
+
}
|
|
272
|
+
else if (this.legacyStatusTracker) {
|
|
273
|
+
// Legacy fallback
|
|
274
|
+
const preview = `Current: ${currentProfile} | Press Shift+Tab to switch`;
|
|
275
|
+
this.legacyStatusTracker.pushOverride('profile-switch', preview, {
|
|
276
|
+
tone: 'info',
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Enable or disable overlay
|
|
282
|
+
*/
|
|
283
|
+
setOverlayEnabled(enabled) {
|
|
284
|
+
if (this.config.useUnifiedUI) {
|
|
285
|
+
this.uiController.updateConfig({ enableOverlay: enabled });
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Get telemetry data (only available in unified mode)
|
|
290
|
+
*/
|
|
291
|
+
getTelemetry() {
|
|
292
|
+
if (this.config.useUnifiedUI) {
|
|
293
|
+
return {
|
|
294
|
+
snapshot: this.uiController.getTelemetrySnapshot(),
|
|
295
|
+
performance: this.uiController.getPerformanceSummary(),
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
return null;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Switch between UI modes
|
|
302
|
+
*/
|
|
303
|
+
switchUIMode(useUnified) {
|
|
304
|
+
this.config.useUnifiedUI = useUnified;
|
|
305
|
+
if (useUnified) {
|
|
306
|
+
// Clear legacy status tracker if it exists
|
|
307
|
+
if (this.legacyStatusTracker) {
|
|
308
|
+
this.legacyStatusTracker.reset();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
else {
|
|
312
|
+
// Hide unified UI overlays
|
|
313
|
+
this.uiController.updateConfig({ enableOverlay: false });
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Helper methods
|
|
318
|
+
*/
|
|
319
|
+
updateSpinnerMessage(message) {
|
|
320
|
+
if (!message?.trim()) {
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
if (this.display.isSpinnerActive()) {
|
|
324
|
+
this.display.updateThinking(message);
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
this.display.showThinking(message);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Get action description for tool execution (Claude Code style)
|
|
332
|
+
* Returns a human-readable description of what the tool is doing
|
|
333
|
+
*/
|
|
334
|
+
getToolActionDescription(call, progress) {
|
|
335
|
+
let description;
|
|
336
|
+
switch (call.name) {
|
|
337
|
+
case 'Read':
|
|
338
|
+
description = `Reading file...`;
|
|
339
|
+
break;
|
|
340
|
+
case 'Write':
|
|
341
|
+
description = `Writing file...`;
|
|
342
|
+
break;
|
|
343
|
+
case 'Edit':
|
|
344
|
+
description = `Editing file...`;
|
|
345
|
+
break;
|
|
346
|
+
case 'Bash':
|
|
347
|
+
description = `Executing command...`;
|
|
348
|
+
break;
|
|
349
|
+
case 'Grep':
|
|
350
|
+
description = `Searching code...`;
|
|
351
|
+
break;
|
|
352
|
+
case 'Glob':
|
|
353
|
+
description = `Finding files...`;
|
|
354
|
+
break;
|
|
355
|
+
case 'WebFetch':
|
|
356
|
+
description = `Fetching web content...`;
|
|
357
|
+
break;
|
|
358
|
+
case 'WebSearch':
|
|
359
|
+
description = `Searching web...`;
|
|
360
|
+
break;
|
|
361
|
+
case 'Task':
|
|
362
|
+
description = `Running task...`;
|
|
363
|
+
break;
|
|
364
|
+
default:
|
|
365
|
+
description = `Executing ${call.name}...`;
|
|
366
|
+
}
|
|
367
|
+
if (progress) {
|
|
368
|
+
const details = [];
|
|
369
|
+
if (progress.message?.trim()) {
|
|
370
|
+
details.push(progress.message.trim());
|
|
371
|
+
}
|
|
372
|
+
if (typeof progress.total === 'number' && progress.total > 0) {
|
|
373
|
+
const pct = Math.max(0, Math.min(100, Math.round((progress.current / progress.total) * 100)));
|
|
374
|
+
details.push(`${pct}%`);
|
|
375
|
+
}
|
|
376
|
+
if (details.length) {
|
|
377
|
+
return `${description} (${details.join(' ')})`;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
return description;
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Set file change tracking callback
|
|
384
|
+
*/
|
|
385
|
+
setFileChangeCallback(callback) {
|
|
386
|
+
this.fileChangeCallback = callback;
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Parse file changes from Edit/Write tool output
|
|
390
|
+
*/
|
|
391
|
+
parseFileChange(call, output) {
|
|
392
|
+
const args = call.arguments;
|
|
393
|
+
const path = args.file_path || args.path;
|
|
394
|
+
if (!path)
|
|
395
|
+
return null;
|
|
396
|
+
// Parse additions and removals from output
|
|
397
|
+
let additions = 0;
|
|
398
|
+
let removals = 0;
|
|
399
|
+
// For Edit tool: parse "Lines changed: +X / -Y" or "+X addition -Y removal"
|
|
400
|
+
const editMatch = output.match(/\+(\d+).*-(\d+)/);
|
|
401
|
+
if (editMatch) {
|
|
402
|
+
additions = parseInt(editMatch[1] || '0', 10);
|
|
403
|
+
removals = parseInt(editMatch[2] || '0', 10);
|
|
404
|
+
}
|
|
405
|
+
// Alternative format: "X addition" and "Y removal"
|
|
406
|
+
const addMatch = output.match(/(\d+)\s+addition/);
|
|
407
|
+
const remMatch = output.match(/(\d+)\s+removal/);
|
|
408
|
+
if (addMatch)
|
|
409
|
+
additions = parseInt(addMatch[1] || '0', 10);
|
|
410
|
+
if (remMatch)
|
|
411
|
+
removals = parseInt(remMatch[1] || '0', 10);
|
|
412
|
+
// For Write tool: estimate as all additions (new file or full rewrite)
|
|
413
|
+
if (call.name === 'Write' && additions === 0 && removals === 0) {
|
|
414
|
+
const lines = (args.content || '').split('\n').length;
|
|
415
|
+
additions = lines;
|
|
416
|
+
}
|
|
417
|
+
return {
|
|
418
|
+
path,
|
|
419
|
+
type: call.name === 'Edit' ? 'edit' : 'write',
|
|
420
|
+
additions,
|
|
421
|
+
removals
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Get current UI mode
|
|
426
|
+
*/
|
|
427
|
+
getCurrentMode() {
|
|
428
|
+
return this.config.useUnifiedUI ? 'unified' : 'legacy';
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Get UI state
|
|
432
|
+
*/
|
|
433
|
+
getState() {
|
|
434
|
+
if (this.config.useUnifiedUI) {
|
|
435
|
+
return this.uiController.getState();
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
return {
|
|
439
|
+
isProcessing: this.isProcessing,
|
|
440
|
+
contextUsage: this.contextUsage,
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Dispose of resources
|
|
446
|
+
*/
|
|
447
|
+
dispose() {
|
|
448
|
+
// Clear any pending timeouts to prevent process hang
|
|
449
|
+
if (this.profileSwitcherTimeout) {
|
|
450
|
+
clearTimeout(this.profileSwitcherTimeout);
|
|
451
|
+
this.profileSwitcherTimeout = undefined;
|
|
452
|
+
}
|
|
453
|
+
this.uiController.dispose();
|
|
454
|
+
if (this.legacyStatusTracker) {
|
|
455
|
+
// Clear all status
|
|
456
|
+
this.legacyStatusTracker.reset();
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UnifiedUIController - Minimal stub for unified UI system
|
|
3
|
+
*
|
|
4
|
+
* The overlay-based implementation has been removed in favor of simple,
|
|
5
|
+
* stable terminal output that doesn't fight with readline.
|
|
6
|
+
*/
|
|
7
|
+
import { EventEmitter } from 'events';
|
|
8
|
+
import { StatusOrchestrator } from './orchestration/StatusOrchestrator.js';
|
|
9
|
+
import { AnimationScheduler } from './animation/AnimationScheduler.js';
|
|
10
|
+
import { InterruptManager, InterruptPriority } from './interrupts/InterruptManager.js';
|
|
11
|
+
import { UITelemetry } from './telemetry/UITelemetry.js';
|
|
12
|
+
export class UnifiedUIController extends EventEmitter {
|
|
13
|
+
constructor(_writeStream, config = {}) {
|
|
14
|
+
super();
|
|
15
|
+
this.activeSpinners = new Map();
|
|
16
|
+
this.activeElapsed = new Map();
|
|
17
|
+
this.config = {
|
|
18
|
+
enableOverlay: false, // Disabled - no complex overlay
|
|
19
|
+
enableAnimations: true,
|
|
20
|
+
enableTelemetry: true,
|
|
21
|
+
adaptivePerformance: false,
|
|
22
|
+
debugMode: false,
|
|
23
|
+
...config,
|
|
24
|
+
};
|
|
25
|
+
this.state = {
|
|
26
|
+
isProcessing: false,
|
|
27
|
+
hasActiveTools: false,
|
|
28
|
+
hasActiveInterrupts: false,
|
|
29
|
+
overlayVisible: false,
|
|
30
|
+
currentStatus: null,
|
|
31
|
+
activeAnimations: 0,
|
|
32
|
+
performanceMode: 'balanced',
|
|
33
|
+
};
|
|
34
|
+
// Initialize components (no overlay manager)
|
|
35
|
+
this.statusOrchestrator = new StatusOrchestrator();
|
|
36
|
+
this.animationScheduler = new AnimationScheduler(30);
|
|
37
|
+
this.interruptManager = new InterruptManager();
|
|
38
|
+
this.telemetry = new UITelemetry({ enabled: config.enableTelemetry });
|
|
39
|
+
this.setupEventHandlers();
|
|
40
|
+
this.emit('ui.initialized');
|
|
41
|
+
}
|
|
42
|
+
setupEventHandlers() {
|
|
43
|
+
this.statusOrchestrator.subscribe((event) => {
|
|
44
|
+
this.handleStatusEvent(event);
|
|
45
|
+
});
|
|
46
|
+
this.interruptManager.on('interrupt:activated', () => {
|
|
47
|
+
this.state.hasActiveInterrupts = true;
|
|
48
|
+
this.emit('ui.state.changed', { hasActiveInterrupts: true });
|
|
49
|
+
});
|
|
50
|
+
this.interruptManager.on('interrupt:completed', () => {
|
|
51
|
+
const activeCount = this.interruptManager.getInterruptsByStatus('active').length;
|
|
52
|
+
this.state.hasActiveInterrupts = activeCount > 0;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
handleStatusEvent(event) {
|
|
56
|
+
this.telemetry.recordEvent(event.type, event.data);
|
|
57
|
+
switch (event.type) {
|
|
58
|
+
case 'tool.start':
|
|
59
|
+
this.handleToolStart(event.data);
|
|
60
|
+
break;
|
|
61
|
+
case 'tool.complete':
|
|
62
|
+
this.handleToolComplete(event.data);
|
|
63
|
+
break;
|
|
64
|
+
case 'tool.error':
|
|
65
|
+
this.handleToolError(event.data);
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
handleToolStart(data) {
|
|
70
|
+
const { toolCall, toolStatus } = data;
|
|
71
|
+
this.telemetry.markStart(`tool.${toolCall.name}`);
|
|
72
|
+
if (this.config.enableAnimations) {
|
|
73
|
+
const spinner = this.animationScheduler.createSpinner(`tool-${toolCall.id}`, toolStatus.description);
|
|
74
|
+
this.activeSpinners.set(toolCall.id, spinner);
|
|
75
|
+
}
|
|
76
|
+
const elapsed = this.animationScheduler.createElapsed(`elapsed-${toolCall.id}`, toolStatus.startedAt);
|
|
77
|
+
this.activeElapsed.set(toolCall.id, elapsed);
|
|
78
|
+
this.state.hasActiveTools = true;
|
|
79
|
+
}
|
|
80
|
+
handleToolComplete(data) {
|
|
81
|
+
this.activeSpinners.delete(data.toolId);
|
|
82
|
+
this.activeElapsed.delete(data.toolId);
|
|
83
|
+
this.animationScheduler.unregister(`tool-${data.toolId}`);
|
|
84
|
+
this.animationScheduler.unregister(`elapsed-${data.toolId}`);
|
|
85
|
+
if (this.statusOrchestrator.getContext().tools.size === 0) {
|
|
86
|
+
this.state.hasActiveTools = false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
handleToolError(data) {
|
|
90
|
+
this.telemetry.recordError(data.error, { toolId: data.toolId });
|
|
91
|
+
this.activeSpinners.delete(data.toolId);
|
|
92
|
+
this.activeElapsed.delete(data.toolId);
|
|
93
|
+
this.animationScheduler.unregister(`tool-${data.toolId}`);
|
|
94
|
+
this.animationScheduler.unregister(`elapsed-${data.toolId}`);
|
|
95
|
+
}
|
|
96
|
+
// Public API
|
|
97
|
+
startProcessing() {
|
|
98
|
+
this.state.isProcessing = true;
|
|
99
|
+
this.emit('ui.state.changed', { isProcessing: true });
|
|
100
|
+
}
|
|
101
|
+
endProcessing() {
|
|
102
|
+
this.state.isProcessing = false;
|
|
103
|
+
this.emit('ui.state.changed', { isProcessing: false });
|
|
104
|
+
}
|
|
105
|
+
setBaseStatus(text, tone) {
|
|
106
|
+
this.statusOrchestrator.setBaseStatus({
|
|
107
|
+
text,
|
|
108
|
+
tone,
|
|
109
|
+
startedAt: Date.now(),
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
pushStatusOverride(id, text, detail, tone) {
|
|
113
|
+
this.statusOrchestrator.pushOverride(id, {
|
|
114
|
+
text,
|
|
115
|
+
detail,
|
|
116
|
+
tone,
|
|
117
|
+
startedAt: Date.now(),
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
clearStatusOverride(id) {
|
|
121
|
+
this.statusOrchestrator.clearOverride(id);
|
|
122
|
+
}
|
|
123
|
+
updateCommandsOverlay(_content) {
|
|
124
|
+
// No-op - overlay removed
|
|
125
|
+
}
|
|
126
|
+
hideCommandsOverlay() {
|
|
127
|
+
// No-op - overlay removed
|
|
128
|
+
}
|
|
129
|
+
onToolStart(toolCall) {
|
|
130
|
+
this.statusOrchestrator.onToolStart(toolCall);
|
|
131
|
+
}
|
|
132
|
+
onToolProgress(toolId, progress) {
|
|
133
|
+
this.statusOrchestrator.onToolProgress(toolId, progress);
|
|
134
|
+
}
|
|
135
|
+
onToolComplete(toolId, result) {
|
|
136
|
+
this.statusOrchestrator.onToolComplete(toolId, result);
|
|
137
|
+
}
|
|
138
|
+
onToolError(toolId, error) {
|
|
139
|
+
this.statusOrchestrator.onToolError(toolId, error);
|
|
140
|
+
}
|
|
141
|
+
queueInterrupt(type, message, priority = InterruptPriority.NORMAL, handler) {
|
|
142
|
+
return this.interruptManager.queue({
|
|
143
|
+
type,
|
|
144
|
+
priority,
|
|
145
|
+
message,
|
|
146
|
+
handler,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
completeInterrupt(id) {
|
|
150
|
+
this.interruptManager.completeInterrupt(id);
|
|
151
|
+
}
|
|
152
|
+
beginOutput() {
|
|
153
|
+
// No-op - overlay removed
|
|
154
|
+
}
|
|
155
|
+
endOutput() {
|
|
156
|
+
// No-op - overlay removed
|
|
157
|
+
}
|
|
158
|
+
getState() {
|
|
159
|
+
return { ...this.state };
|
|
160
|
+
}
|
|
161
|
+
getTelemetrySnapshot() {
|
|
162
|
+
return this.telemetry.getSnapshot();
|
|
163
|
+
}
|
|
164
|
+
getPerformanceSummary() {
|
|
165
|
+
return this.telemetry.getPerformanceSummary();
|
|
166
|
+
}
|
|
167
|
+
updateConfig(config) {
|
|
168
|
+
this.config = { ...this.config, ...config };
|
|
169
|
+
this.telemetry.setEnabled(this.config.enableTelemetry);
|
|
170
|
+
if (!this.config.enableAnimations) {
|
|
171
|
+
this.animationScheduler.clearAll();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
dispose() {
|
|
175
|
+
this.statusOrchestrator.reset();
|
|
176
|
+
this.animationScheduler.dispose();
|
|
177
|
+
this.interruptManager.dispose();
|
|
178
|
+
this.telemetry.dispose();
|
|
179
|
+
this.activeSpinners.clear();
|
|
180
|
+
this.activeElapsed.clear();
|
|
181
|
+
this.removeAllListeners();
|
|
182
|
+
}
|
|
183
|
+
}
|