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,252 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Advanced Targeting Security Module
|
|
4
|
+
*
|
|
5
|
+
* Enables Erosolar CLI to analyze and operate on external active stacks
|
|
6
|
+
* and critical infrastructure while maintaining security controls.
|
|
7
|
+
*
|
|
8
|
+
* @license MIT
|
|
9
|
+
* @author Bo Shang
|
|
10
|
+
*
|
|
11
|
+
* DISCLAIMER: This software is provided for authorized security testing,
|
|
12
|
+
* research, and defensive purposes only. Users must ensure compliance
|
|
13
|
+
* with all applicable laws and regulations in their jurisdiction.
|
|
14
|
+
*/
|
|
15
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
16
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
17
|
+
if (ar || !(i in from)) {
|
|
18
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
19
|
+
ar[i] = from[i];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.advancedTargetingSecurity = exports.AdvancedTargetingSecurity = void 0;
|
|
26
|
+
var AdvancedTargetingSecurity = /** @class */ (function () {
|
|
27
|
+
function AdvancedTargetingSecurity() {
|
|
28
|
+
this.authorizedTargets = new Map();
|
|
29
|
+
this.criticalInfrastructure = new Map();
|
|
30
|
+
this.operationLog = [];
|
|
31
|
+
this.initializeDefaultTargets();
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Authorize a target for operations
|
|
35
|
+
*/
|
|
36
|
+
AdvancedTargetingSecurity.prototype.authorizeTarget = function (authorization) {
|
|
37
|
+
this.authorizedTargets.set(authorization.target, authorization);
|
|
38
|
+
this.logAdvancedOperation({
|
|
39
|
+
type: 'target_authorization',
|
|
40
|
+
severity: 'high',
|
|
41
|
+
operation: 'authorize',
|
|
42
|
+
target: authorization.target,
|
|
43
|
+
authorizationLevel: authorization.level,
|
|
44
|
+
authorizedBy: authorization.authorizedBy,
|
|
45
|
+
timestamp: new Date(),
|
|
46
|
+
details: {
|
|
47
|
+
scope: authorization.scope,
|
|
48
|
+
compliance: authorization.compliance
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Validate operation on external target
|
|
54
|
+
*/
|
|
55
|
+
AdvancedTargetingSecurity.prototype.validateExternalOperation = function (operation, target, parameters) {
|
|
56
|
+
// Check if target is authorized
|
|
57
|
+
var authorization = this.authorizedTargets.get(target);
|
|
58
|
+
if (!authorization) {
|
|
59
|
+
return {
|
|
60
|
+
allowed: false,
|
|
61
|
+
reason: 'Target not authorized for external operations',
|
|
62
|
+
severity: 'high',
|
|
63
|
+
details: { target: target, operation: operation }
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
// Check authorization level
|
|
67
|
+
if (!this.isOperationAuthorized(operation, authorization.level)) {
|
|
68
|
+
return {
|
|
69
|
+
allowed: false,
|
|
70
|
+
reason: "Operation '".concat(operation, "' not authorized for target '").concat(target, "'"),
|
|
71
|
+
severity: 'high',
|
|
72
|
+
details: { target: target, operation: operation, authorizationLevel: authorization.level }
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
// Check expiration
|
|
76
|
+
if (authorization.expiresAt && authorization.expiresAt < new Date()) {
|
|
77
|
+
return {
|
|
78
|
+
allowed: false,
|
|
79
|
+
reason: 'Target authorization has expired',
|
|
80
|
+
severity: 'high',
|
|
81
|
+
details: { target: target, expiresAt: authorization.expiresAt }
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
// Check for critical infrastructure
|
|
85
|
+
var criticalTarget = this.criticalInfrastructure.get(target);
|
|
86
|
+
if (criticalTarget) {
|
|
87
|
+
return this.validateCriticalInfrastructureOperation(operation, criticalTarget, parameters);
|
|
88
|
+
}
|
|
89
|
+
// Log the authorized operation
|
|
90
|
+
this.logAdvancedOperation({
|
|
91
|
+
type: 'external_operation',
|
|
92
|
+
severity: 'medium',
|
|
93
|
+
operation: operation,
|
|
94
|
+
target: target,
|
|
95
|
+
authorizationLevel: authorization.level,
|
|
96
|
+
timestamp: new Date(),
|
|
97
|
+
details: {
|
|
98
|
+
parameters: parameters,
|
|
99
|
+
authorizedBy: authorization.authorizedBy,
|
|
100
|
+
compliance: authorization.compliance
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
return { allowed: true, severity: 'low' };
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Register critical infrastructure target
|
|
107
|
+
*/
|
|
108
|
+
AdvancedTargetingSecurity.prototype.registerCriticalInfrastructure = function (target) {
|
|
109
|
+
this.criticalInfrastructure.set(target.identifier, target);
|
|
110
|
+
this.logAdvancedOperation({
|
|
111
|
+
type: 'critical_infrastructure_registration',
|
|
112
|
+
severity: 'critical',
|
|
113
|
+
operation: 'register',
|
|
114
|
+
target: target.identifier,
|
|
115
|
+
timestamp: new Date(),
|
|
116
|
+
details: {
|
|
117
|
+
category: target.category,
|
|
118
|
+
jurisdiction: target.jurisdiction,
|
|
119
|
+
sensitivity: target.sensitivity
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Get authorized targets
|
|
125
|
+
*/
|
|
126
|
+
AdvancedTargetingSecurity.prototype.getAuthorizedTargets = function () {
|
|
127
|
+
return Array.from(this.authorizedTargets.values());
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Get critical infrastructure targets
|
|
131
|
+
*/
|
|
132
|
+
AdvancedTargetingSecurity.prototype.getCriticalInfrastructure = function () {
|
|
133
|
+
return Array.from(this.criticalInfrastructure.values());
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Get operation log
|
|
137
|
+
*/
|
|
138
|
+
AdvancedTargetingSecurity.prototype.getOperationLog = function () {
|
|
139
|
+
return __spreadArray([], this.operationLog, true);
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Generate targeting report
|
|
143
|
+
*/
|
|
144
|
+
AdvancedTargetingSecurity.prototype.generateTargetingReport = function () {
|
|
145
|
+
var authorized = this.getAuthorizedTargets();
|
|
146
|
+
var critical = this.getCriticalInfrastructure();
|
|
147
|
+
var operations = this.getOperationLog();
|
|
148
|
+
var report = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([
|
|
149
|
+
'🎯 Advanced Targeting Security Report',
|
|
150
|
+
'=====================================',
|
|
151
|
+
"Authorized Targets: ".concat(authorized.length),
|
|
152
|
+
"Critical Infrastructure: ".concat(critical.length),
|
|
153
|
+
"Total Operations: ".concat(operations.length),
|
|
154
|
+
'',
|
|
155
|
+
'🔐 Authorized Targets:'
|
|
156
|
+
], authorized.map(function (auth) {
|
|
157
|
+
return " \u2022 ".concat(auth.target, " (").concat(auth.level, ") - ").concat(auth.authorizedBy);
|
|
158
|
+
}), true), [
|
|
159
|
+
'',
|
|
160
|
+
'🏛️ Critical Infrastructure:'
|
|
161
|
+
], false), critical.map(function (infra) {
|
|
162
|
+
return " \u2022 ".concat(infra.identifier, " (").concat(infra.category, ") - ").concat(infra.jurisdiction, " [").concat(infra.sensitivity, "]");
|
|
163
|
+
}), true), [
|
|
164
|
+
'',
|
|
165
|
+
'📊 Recent Operations:'
|
|
166
|
+
], false), operations.slice(-10).map(function (op) {
|
|
167
|
+
return " \u2022 ".concat(op.timestamp.toISOString(), " - ").concat(op.type, " on ").concat(op.target, " [").concat(op.severity, "]");
|
|
168
|
+
}), true);
|
|
169
|
+
return report.join('\n');
|
|
170
|
+
};
|
|
171
|
+
AdvancedTargetingSecurity.prototype.initializeDefaultTargets = function () {
|
|
172
|
+
// Example: Research authorization for security analysis
|
|
173
|
+
this.authorizeTarget({
|
|
174
|
+
target: '*.gov',
|
|
175
|
+
level: 'research',
|
|
176
|
+
scope: ['vulnerability_scanning', 'security_analysis'],
|
|
177
|
+
authorizedBy: 'Security Research Team',
|
|
178
|
+
compliance: {
|
|
179
|
+
jurisdiction: 'International',
|
|
180
|
+
legalFramework: 'Authorized Security Research',
|
|
181
|
+
reportingRequirements: ['vulnerability_disclosure']
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
// Example: Critical infrastructure for analysis
|
|
185
|
+
this.registerCriticalInfrastructure({
|
|
186
|
+
category: 'energy',
|
|
187
|
+
identifier: 'power-grid-*.gov',
|
|
188
|
+
jurisdiction: 'Multiple',
|
|
189
|
+
sensitivity: 'critical',
|
|
190
|
+
authorizedOperations: ['security_analysis', 'vulnerability_assessment'],
|
|
191
|
+
legalRestrictions: ['no_exploitation', 'responsible_disclosure']
|
|
192
|
+
});
|
|
193
|
+
};
|
|
194
|
+
AdvancedTargetingSecurity.prototype.isOperationAuthorized = function (operation, authorizationLevel) {
|
|
195
|
+
var operationLevels = {
|
|
196
|
+
'research': ['scanning', 'analysis', 'vulnerability_assessment'],
|
|
197
|
+
'analysis': ['scanning', 'analysis', 'vulnerability_assessment', 'security_testing'],
|
|
198
|
+
'testing': ['scanning', 'analysis', 'vulnerability_assessment', 'security_testing', 'penetration_testing'],
|
|
199
|
+
'operations': ['scanning', 'analysis', 'vulnerability_assessment', 'security_testing', 'penetration_testing', 'remediation']
|
|
200
|
+
};
|
|
201
|
+
var allowedOperations = operationLevels[authorizationLevel] || [];
|
|
202
|
+
return allowedOperations.includes(operation);
|
|
203
|
+
};
|
|
204
|
+
AdvancedTargetingSecurity.prototype.validateCriticalInfrastructureOperation = function (operation, target, parameters) {
|
|
205
|
+
// Enhanced validation for critical infrastructure
|
|
206
|
+
if (!target.authorizedOperations.includes(operation)) {
|
|
207
|
+
return {
|
|
208
|
+
allowed: false,
|
|
209
|
+
reason: "Operation '".concat(operation, "' not authorized for critical infrastructure '").concat(target.identifier, "'"),
|
|
210
|
+
severity: 'critical',
|
|
211
|
+
details: {
|
|
212
|
+
target: target.identifier,
|
|
213
|
+
operation: operation,
|
|
214
|
+
authorizedOperations: target.authorizedOperations,
|
|
215
|
+
legalRestrictions: target.legalRestrictions
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
// Additional compliance checks for critical targets
|
|
220
|
+
if (target.sensitivity === 'critical') {
|
|
221
|
+
this.logAdvancedOperation({
|
|
222
|
+
type: 'critical_infrastructure_operation',
|
|
223
|
+
severity: 'critical',
|
|
224
|
+
operation: operation,
|
|
225
|
+
target: target.identifier,
|
|
226
|
+
timestamp: new Date(),
|
|
227
|
+
details: {
|
|
228
|
+
parameters: parameters,
|
|
229
|
+
category: target.category,
|
|
230
|
+
jurisdiction: target.jurisdiction,
|
|
231
|
+
sensitivity: target.sensitivity,
|
|
232
|
+
legalRestrictions: target.legalRestrictions
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
return { allowed: true, severity: 'medium' };
|
|
237
|
+
};
|
|
238
|
+
AdvancedTargetingSecurity.prototype.logAdvancedOperation = function (event) {
|
|
239
|
+
this.operationLog.push(event);
|
|
240
|
+
// Keep log size manageable
|
|
241
|
+
if (this.operationLog.length > 1000) {
|
|
242
|
+
this.operationLog = this.operationLog.slice(-500);
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
return AdvancedTargetingSecurity;
|
|
246
|
+
}());
|
|
247
|
+
exports.AdvancedTargetingSecurity = AdvancedTargetingSecurity;
|
|
248
|
+
/**
|
|
249
|
+
* Global advanced targeting security instance
|
|
250
|
+
*/
|
|
251
|
+
exports.advancedTargetingSecurity = new AdvancedTargetingSecurity();
|
|
252
|
+
//# sourceMappingURL=advanced-targeting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"advanced-targeting.js","sourceRoot":"","sources":["../src/security/advanced-targeting.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;;;;;;;;;;AAsDH;IAKE;QAJQ,sBAAiB,GAAqC,IAAI,GAAG,EAAE,CAAC;QAChE,2BAAsB,GAA8C,IAAI,GAAG,EAAE,CAAC;QAC9E,iBAAY,GAA6B,EAAE,CAAC;QAGlD,IAAI,CAAC,wBAAwB,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,mDAAe,GAAf,UAAgB,aAAkC;QAChD,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAEhE,IAAI,CAAC,oBAAoB,CAAC;YACxB,IAAI,EAAE,sBAAsB;YAC5B,QAAQ,EAAE,MAAM;YAChB,SAAS,EAAE,WAAW;YACtB,MAAM,EAAE,aAAa,CAAC,MAAM;YAC5B,kBAAkB,EAAE,aAAa,CAAC,KAAK;YACvC,YAAY,EAAE,aAAa,CAAC,YAAY;YACxC,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,OAAO,EAAE;gBACP,KAAK,EAAE,aAAa,CAAC,KAAK;gBAC1B,UAAU,EAAE,aAAa,CAAC,UAAU;aACrC;SACF,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,6DAAyB,GAAzB,UACE,SAAiB,EACjB,MAAc,EACd,UAAmC;QAEnC,gCAAgC;QAChC,IAAM,aAAa,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACzD,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,+CAA+C;gBACvD,QAAQ,EAAE,MAAM;gBAChB,OAAO,EAAE,EAAE,MAAM,QAAA,EAAE,SAAS,WAAA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CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;YACtC,IAAI,CAAC,oBAAoB,CAAC;gBACxB,IAAI,EAAE,mCAAmC;gBACzC,QAAQ,EAAE,UAAU;gBACpB,SAAS,WAAA;gBACT,MAAM,EAAE,MAAM,CAAC,UAAU;gBACzB,SAAS,EAAE,IAAI,IAAI,EAAE;gBACrB,OAAO,EAAE;oBACP,UAAU,YAAA;oBACV,QAAQ,EAAE,MAAM,CAAC,QAAQ;oBACzB,YAAY,EAAE,MAAM,CAAC,YAAY;oBACjC,WAAW,EAAE,MAAM,CAAC,WAAW;oBAC/B,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;iBAC5C;aACF,CAAC,CAAC;QACL,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;IAC/C,CAAC;IAEO,wDAAoB,GAA5B,UAA6B,KAA6B;QACxD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAE9B,2BAA2B;QAC3B,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,IAAI,EAAE,CAAC;YACpC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IACH,gCAAC;AAAD,CAAC,AA9PD,IA8PC;AA9PY,8DAAyB;AA2QtC;;GAEG;AACU,QAAA,yBAAyB,GAAG,IAAI,yBAAyB,EAAE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { instantiateToolPlugins, registerDefaultNodeToolPlugins, } from '../../plugins/tools/index.js';
|
|
2
|
+
export class NodeRuntimeAdapter {
|
|
3
|
+
constructor(options = {}) {
|
|
4
|
+
this.id = 'runtime.node';
|
|
5
|
+
this.options = options;
|
|
6
|
+
}
|
|
7
|
+
async createCapabilityModules(context) {
|
|
8
|
+
registerDefaultNodeToolPlugins();
|
|
9
|
+
const filter = (plugin) => {
|
|
10
|
+
if (this.options.includeFilesystem === false && plugin.id === 'tool.filesystem.local') {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
if (this.options.includeSearch === false && plugin.id === 'tool.search.local') {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
if (this.options.includeBash === false && plugin.id === 'tool.bash.local') {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
if (this.options.filter && !this.options.filter(plugin)) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
};
|
|
24
|
+
const modules = await instantiateToolPlugins('node', {
|
|
25
|
+
workingDir: context.workingDir,
|
|
26
|
+
env: context.env,
|
|
27
|
+
}, { filter });
|
|
28
|
+
if (this.options.extraModules?.length) {
|
|
29
|
+
modules.push(...this.options.extraModules);
|
|
30
|
+
}
|
|
31
|
+
return modules;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Alpha Zero 2 - Agent Wrapper
|
|
3
|
+
*
|
|
4
|
+
* Wraps the AgentRuntime with Alpha Zero 2 capabilities for
|
|
5
|
+
* performance tracking, code quality evaluation, and competitive metrics.
|
|
6
|
+
*
|
|
7
|
+
* Principal Investigator: Bo Shang
|
|
8
|
+
* Framework: erosolar-cli
|
|
9
|
+
*/
|
|
10
|
+
import { MetricsTracker } from './metricsTracker.js';
|
|
11
|
+
import { extractCodeBlocks, evaluateCodeQuality, calculateRewardScore } from './codeEvaluator.js';
|
|
12
|
+
/**
|
|
13
|
+
* Wrapper around AgentRuntime that adds Alpha Zero 2 capabilities.
|
|
14
|
+
*
|
|
15
|
+
* Provides:
|
|
16
|
+
* - Performance introspection
|
|
17
|
+
* - Code quality evaluation
|
|
18
|
+
* - Competitive metrics tracking
|
|
19
|
+
* - Self-improvement suggestions
|
|
20
|
+
*/
|
|
21
|
+
export class AlphaZeroAgentWrapper {
|
|
22
|
+
constructor(options) {
|
|
23
|
+
this.currentTraceId = 0;
|
|
24
|
+
this.agent = options.agent;
|
|
25
|
+
this.agentId = options.agentId ?? 'agent';
|
|
26
|
+
this.enableIntrospection = options.enableIntrospection ?? true;
|
|
27
|
+
this.enableCodeEvaluation = options.enableCodeEvaluation ?? true;
|
|
28
|
+
this.metricsTracker = new MetricsTracker(this.agentId);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Send a message with performance tracking.
|
|
32
|
+
*/
|
|
33
|
+
async send(text, useStreaming = false) {
|
|
34
|
+
const startTime = Date.now();
|
|
35
|
+
const traceId = `trace-${this.currentTraceId++}`;
|
|
36
|
+
const toolCalls = [];
|
|
37
|
+
try {
|
|
38
|
+
const response = await this.agent.send(text, useStreaming);
|
|
39
|
+
const elapsedMs = Date.now() - startTime;
|
|
40
|
+
// Track metrics
|
|
41
|
+
this.metricsTracker.recordMessage(elapsedMs);
|
|
42
|
+
// Evaluate code quality if response contains code
|
|
43
|
+
if (this.enableCodeEvaluation && response.includes('```')) {
|
|
44
|
+
await this.evaluateResponseCode(response);
|
|
45
|
+
}
|
|
46
|
+
// Add execution trace if introspection is enabled
|
|
47
|
+
if (this.enableIntrospection) {
|
|
48
|
+
const trace = {
|
|
49
|
+
traceId,
|
|
50
|
+
timestamp: new Date().toISOString(),
|
|
51
|
+
prompt: text,
|
|
52
|
+
response,
|
|
53
|
+
toolCalls,
|
|
54
|
+
totalDurationMs: elapsedMs,
|
|
55
|
+
};
|
|
56
|
+
this.metricsTracker.addTrace(trace);
|
|
57
|
+
}
|
|
58
|
+
return response;
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
const elapsedMs = Date.now() - startTime;
|
|
62
|
+
this.metricsTracker.recordMessage(elapsedMs);
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Evaluate code quality in a response.
|
|
68
|
+
*/
|
|
69
|
+
async evaluateResponseCode(response) {
|
|
70
|
+
const codeBlocks = extractCodeBlocks(response);
|
|
71
|
+
if (codeBlocks.length === 0) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
this.metricsTracker.recordCodeGeneration(codeBlocks.length);
|
|
75
|
+
// Evaluate each code block
|
|
76
|
+
for (const code of codeBlocks) {
|
|
77
|
+
try {
|
|
78
|
+
const metrics = evaluateCodeQuality(code);
|
|
79
|
+
this.metricsTracker.recordCodeQuality(metrics);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// Ignore evaluation errors
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Record a tool call result.
|
|
88
|
+
*/
|
|
89
|
+
recordToolCall(success) {
|
|
90
|
+
this.metricsTracker.recordToolCall(success);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Get current performance metrics.
|
|
94
|
+
*/
|
|
95
|
+
getMetrics() {
|
|
96
|
+
return this.metricsTracker.getMetrics();
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Get human-readable performance summary.
|
|
100
|
+
*/
|
|
101
|
+
getPerformanceSummary() {
|
|
102
|
+
return this.metricsTracker.getPerformanceSummary();
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Get execution traces.
|
|
106
|
+
*/
|
|
107
|
+
getTraces() {
|
|
108
|
+
return this.metricsTracker.getTraces();
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Get improvement suggestions based on metrics.
|
|
112
|
+
*/
|
|
113
|
+
getImprovementSuggestions() {
|
|
114
|
+
return this.metricsTracker.getImprovementSuggestions();
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Get metrics as a dictionary for serialization.
|
|
118
|
+
*/
|
|
119
|
+
getMetricsDict() {
|
|
120
|
+
const metrics = this.metricsTracker.getMetrics();
|
|
121
|
+
return {
|
|
122
|
+
sessionId: metrics.sessionId,
|
|
123
|
+
totalMessages: metrics.totalMessages,
|
|
124
|
+
totalTimeMs: metrics.totalTimeMs,
|
|
125
|
+
avgResponseTimeMs: metrics.avgResponseTimeMs,
|
|
126
|
+
codeBlocksGenerated: metrics.codeBlocksGenerated,
|
|
127
|
+
tokenUsage: metrics.totalTokensUsed,
|
|
128
|
+
toolUsage: {
|
|
129
|
+
totalCalls: metrics.totalToolCalls,
|
|
130
|
+
successfulCalls: metrics.successfulToolCalls,
|
|
131
|
+
failedCalls: metrics.failedToolCalls,
|
|
132
|
+
},
|
|
133
|
+
codeQuality: {
|
|
134
|
+
qualityScore: metrics.avgCodeQuality,
|
|
135
|
+
algorithmEfficiency: metrics.avgAlgorithmEfficiency,
|
|
136
|
+
errorHandling: metrics.avgErrorHandling,
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Reset all metrics.
|
|
142
|
+
*/
|
|
143
|
+
resetMetrics() {
|
|
144
|
+
this.metricsTracker.reset();
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Get the underlying agent runtime.
|
|
148
|
+
*/
|
|
149
|
+
getAgent() {
|
|
150
|
+
return this.agent;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Get the agent ID.
|
|
154
|
+
*/
|
|
155
|
+
getAgentId() {
|
|
156
|
+
return this.agentId;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Evaluate a single code snippet and return a reward score.
|
|
160
|
+
*/
|
|
161
|
+
evaluateCode(code) {
|
|
162
|
+
const metrics = evaluateCodeQuality(code);
|
|
163
|
+
return calculateRewardScore(metrics);
|
|
164
|
+
}
|
|
165
|
+
}
|