erosolar-cli 1.7.339 → 1.7.341
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +148 -24
- package/dist/alpha-zero/agentWrapper.d.ts +84 -0
- package/dist/alpha-zero/agentWrapper.d.ts.map +1 -0
- package/dist/alpha-zero/agentWrapper.js +171 -0
- package/dist/alpha-zero/agentWrapper.js.map +1 -0
- package/dist/alpha-zero/codeEvaluator.d.ts +25 -0
- package/dist/alpha-zero/codeEvaluator.d.ts.map +1 -0
- package/dist/alpha-zero/codeEvaluator.js +273 -0
- package/dist/alpha-zero/codeEvaluator.js.map +1 -0
- package/dist/alpha-zero/competitiveRunner.d.ts +66 -0
- package/dist/alpha-zero/competitiveRunner.d.ts.map +1 -0
- package/dist/alpha-zero/competitiveRunner.js +224 -0
- package/dist/alpha-zero/competitiveRunner.js.map +1 -0
- package/dist/alpha-zero/index.d.ts +67 -0
- package/dist/alpha-zero/index.d.ts.map +1 -0
- package/dist/alpha-zero/index.js +99 -0
- package/dist/alpha-zero/index.js.map +1 -0
- package/dist/alpha-zero/introspection.d.ts +128 -0
- package/dist/alpha-zero/introspection.d.ts.map +1 -0
- package/dist/alpha-zero/introspection.js +300 -0
- package/dist/alpha-zero/introspection.js.map +1 -0
- package/dist/alpha-zero/metricsTracker.d.ts +71 -0
- package/dist/alpha-zero/metricsTracker.d.ts.map +1 -0
- package/dist/{core → alpha-zero}/metricsTracker.js +5 -2
- package/dist/alpha-zero/metricsTracker.js.map +1 -0
- package/dist/alpha-zero/security/core.d.ts +125 -0
- package/dist/alpha-zero/security/core.d.ts.map +1 -0
- package/dist/alpha-zero/security/core.js +271 -0
- package/dist/alpha-zero/security/core.js.map +1 -0
- package/dist/alpha-zero/security/google.d.ts +125 -0
- package/dist/alpha-zero/security/google.d.ts.map +1 -0
- package/dist/alpha-zero/security/google.js +311 -0
- package/dist/alpha-zero/security/google.js.map +1 -0
- package/dist/alpha-zero/security/googleLoader.d.ts +17 -0
- package/dist/alpha-zero/security/googleLoader.d.ts.map +1 -0
- package/dist/alpha-zero/security/googleLoader.js +41 -0
- package/dist/alpha-zero/security/googleLoader.js.map +1 -0
- package/dist/alpha-zero/security/index.d.ts +29 -0
- package/dist/alpha-zero/security/index.d.ts.map +1 -0
- package/dist/alpha-zero/security/index.js +32 -0
- package/dist/alpha-zero/security/index.js.map +1 -0
- package/dist/alpha-zero/security/simulation.d.ts +124 -0
- package/dist/alpha-zero/security/simulation.d.ts.map +1 -0
- package/dist/alpha-zero/security/simulation.js +277 -0
- package/dist/alpha-zero/security/simulation.js.map +1 -0
- package/dist/alpha-zero/selfModification.d.ts +109 -0
- package/dist/alpha-zero/selfModification.d.ts.map +1 -0
- package/dist/alpha-zero/selfModification.js +233 -0
- package/dist/alpha-zero/selfModification.js.map +1 -0
- package/dist/alpha-zero/types.d.ts +170 -0
- package/dist/alpha-zero/types.d.ts.map +1 -0
- package/dist/alpha-zero/types.js +31 -0
- package/dist/alpha-zero/types.js.map +1 -0
- package/dist/bin/erosolar.js +21 -5
- package/dist/bin/erosolar.js.map +1 -1
- package/dist/capabilities/agentSpawningCapability.d.ts.map +1 -1
- package/dist/capabilities/agentSpawningCapability.js +31 -56
- package/dist/capabilities/agentSpawningCapability.js.map +1 -1
- package/dist/capabilities/securityTestingCapability.d.ts +13 -0
- package/dist/capabilities/securityTestingCapability.d.ts.map +1 -0
- package/dist/capabilities/securityTestingCapability.js +25 -0
- package/dist/capabilities/securityTestingCapability.js.map +1 -0
- package/dist/contracts/agent-schemas.json +15 -0
- package/dist/contracts/tools.schema.json +9 -0
- package/dist/core/agent.d.ts +2 -2
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/agent.js.map +1 -1
- package/dist/core/aiFlowOptimizer.d.ts +26 -0
- package/dist/core/aiFlowOptimizer.d.ts.map +1 -0
- package/dist/core/aiFlowOptimizer.js +31 -0
- package/dist/core/aiFlowOptimizer.js.map +1 -0
- package/dist/core/aiOptimizationEngine.d.ts +158 -0
- package/dist/core/aiOptimizationEngine.d.ts.map +1 -0
- package/dist/core/aiOptimizationEngine.js +428 -0
- package/dist/core/aiOptimizationEngine.js.map +1 -0
- package/dist/core/aiOptimizationIntegration.d.ts +93 -0
- package/dist/core/aiOptimizationIntegration.d.ts.map +1 -0
- package/dist/core/aiOptimizationIntegration.js +250 -0
- package/dist/core/aiOptimizationIntegration.js.map +1 -0
- package/dist/core/customCommands.d.ts +0 -1
- package/dist/core/customCommands.d.ts.map +1 -1
- package/dist/core/customCommands.js +0 -3
- package/dist/core/customCommands.js.map +1 -1
- package/dist/core/enhancedErrorRecovery.d.ts +100 -0
- package/dist/core/enhancedErrorRecovery.d.ts.map +1 -0
- package/dist/core/enhancedErrorRecovery.js +345 -0
- package/dist/core/enhancedErrorRecovery.js.map +1 -0
- package/dist/core/hooksSystem.d.ts +65 -0
- package/dist/core/hooksSystem.d.ts.map +1 -0
- package/dist/core/hooksSystem.js +273 -0
- package/dist/core/hooksSystem.js.map +1 -0
- package/dist/core/memorySystem.d.ts +48 -0
- package/dist/core/memorySystem.d.ts.map +1 -0
- package/dist/core/memorySystem.js +271 -0
- package/dist/core/memorySystem.js.map +1 -0
- package/dist/core/toolPreconditions.d.ts.map +1 -1
- package/dist/core/toolPreconditions.js +14 -0
- package/dist/core/toolPreconditions.js.map +1 -1
- package/dist/core/toolRuntime.d.ts +1 -22
- package/dist/core/toolRuntime.d.ts.map +1 -1
- package/dist/core/toolRuntime.js +5 -0
- package/dist/core/toolRuntime.js.map +1 -1
- package/dist/core/toolValidation.d.ts.map +1 -1
- package/dist/core/toolValidation.js +3 -14
- package/dist/core/toolValidation.js.map +1 -1
- package/dist/core/unified/errors.d.ts +189 -0
- package/dist/core/unified/errors.d.ts.map +1 -0
- package/dist/core/unified/errors.js +497 -0
- package/dist/core/unified/errors.js.map +1 -0
- package/dist/core/unified/index.d.ts +19 -0
- package/dist/core/unified/index.d.ts.map +1 -0
- package/dist/core/unified/index.js +68 -0
- package/dist/core/unified/index.js.map +1 -0
- package/dist/core/unified/schema.d.ts +101 -0
- package/dist/core/unified/schema.d.ts.map +1 -0
- package/dist/core/unified/schema.js +350 -0
- package/dist/core/unified/schema.js.map +1 -0
- package/dist/core/unified/toolRuntime.d.ts +179 -0
- package/dist/core/unified/toolRuntime.d.ts.map +1 -0
- package/dist/core/unified/toolRuntime.js +517 -0
- package/dist/core/unified/toolRuntime.js.map +1 -0
- package/dist/core/unified/tools.d.ts +127 -0
- package/dist/core/unified/tools.d.ts.map +1 -0
- package/dist/core/unified/tools.js +1333 -0
- package/dist/core/unified/tools.js.map +1 -0
- package/dist/core/unified/types.d.ts +352 -0
- package/dist/core/unified/types.d.ts.map +1 -0
- package/dist/core/unified/types.js +12 -0
- package/dist/core/unified/types.js.map +1 -0
- package/dist/core/unified/version.d.ts +209 -0
- package/dist/core/unified/version.d.ts.map +1 -0
- package/dist/core/unified/version.js +454 -0
- package/dist/core/unified/version.js.map +1 -0
- package/dist/core/validationRunner.d.ts +3 -1
- package/dist/core/validationRunner.d.ts.map +1 -1
- package/dist/core/validationRunner.js.map +1 -1
- package/dist/headless/headlessApp.d.ts.map +1 -1
- package/dist/headless/headlessApp.js +0 -21
- package/dist/headless/headlessApp.js.map +1 -1
- package/dist/mcp/sseClient.d.ts.map +1 -1
- package/dist/mcp/sseClient.js +18 -9
- package/dist/mcp/sseClient.js.map +1 -1
- package/dist/plugins/tools/build/buildPlugin.d.ts +6 -0
- package/dist/plugins/tools/build/buildPlugin.d.ts.map +1 -1
- package/dist/plugins/tools/build/buildPlugin.js +10 -4
- package/dist/plugins/tools/build/buildPlugin.js.map +1 -1
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
- package/dist/plugins/tools/nodeDefaults.js +2 -0
- package/dist/plugins/tools/nodeDefaults.js.map +1 -1
- package/dist/plugins/tools/security/securityPlugin.d.ts +3 -0
- package/dist/plugins/tools/security/securityPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/security/securityPlugin.js +12 -0
- package/dist/plugins/tools/security/securityPlugin.js.map +1 -0
- package/dist/runtime/agentSession.d.ts +2 -2
- package/dist/runtime/agentSession.d.ts.map +1 -1
- package/dist/runtime/agentSession.js +2 -2
- package/dist/runtime/agentSession.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/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/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/persistence-analyzer.d.ts +56 -0
- package/dist/security/persistence-analyzer.d.ts.map +1 -0
- package/dist/security/persistence-analyzer.js +187 -0
- package/dist/security/persistence-analyzer.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 +92 -0
- package/dist/security/persistence-research.d.ts.map +1 -0
- package/dist/security/persistence-research.js +364 -0
- package/dist/security/persistence-research.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 +112 -0
- package/dist/security/security-testing-framework.d.ts.map +1 -0
- package/dist/security/security-testing-framework.js +364 -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/claudeCodeStreamHandler.d.ts +145 -0
- package/dist/shell/claudeCodeStreamHandler.d.ts.map +1 -0
- package/dist/shell/claudeCodeStreamHandler.js +322 -0
- package/dist/shell/claudeCodeStreamHandler.js.map +1 -0
- package/dist/shell/inputQueueManager.d.ts +144 -0
- package/dist/shell/inputQueueManager.d.ts.map +1 -0
- package/dist/shell/inputQueueManager.js +290 -0
- package/dist/shell/inputQueueManager.js.map +1 -0
- package/dist/shell/interactiveShell.d.ts +7 -16
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +166 -235
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/metricsTracker.d.ts +60 -0
- package/dist/shell/metricsTracker.d.ts.map +1 -0
- package/dist/shell/metricsTracker.js +119 -0
- package/dist/shell/metricsTracker.js.map +1 -0
- package/dist/shell/shellApp.d.ts +0 -2
- package/dist/shell/shellApp.d.ts.map +1 -1
- package/dist/shell/shellApp.js +9 -40
- package/dist/shell/shellApp.js.map +1 -1
- package/dist/shell/streamingOutputManager.d.ts +115 -0
- package/dist/shell/streamingOutputManager.d.ts.map +1 -0
- package/dist/shell/streamingOutputManager.js +225 -0
- package/dist/shell/streamingOutputManager.js.map +1 -0
- package/dist/shell/systemPrompt.d.ts.map +1 -1
- package/dist/shell/systemPrompt.js +4 -1
- package/dist/shell/systemPrompt.js.map +1 -1
- package/dist/shell/terminalInput.d.ts +119 -149
- package/dist/shell/terminalInput.d.ts.map +1 -1
- package/dist/shell/terminalInput.js +532 -639
- package/dist/shell/terminalInput.js.map +1 -1
- package/dist/shell/terminalInputAdapter.d.ts +21 -79
- package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
- package/dist/shell/terminalInputAdapter.js +30 -99
- package/dist/shell/terminalInputAdapter.js.map +1 -1
- package/dist/subagents/taskRunner.d.ts +1 -7
- package/dist/subagents/taskRunner.d.ts.map +1 -1
- package/dist/subagents/taskRunner.js +47 -180
- package/dist/subagents/taskRunner.js.map +1 -1
- package/dist/tools/securityTools.d.ts +22 -0
- package/dist/tools/securityTools.d.ts.map +1 -0
- package/dist/tools/securityTools.js +448 -0
- package/dist/tools/securityTools.js.map +1 -0
- package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
- package/dist/ui/ShellUIAdapter.js +12 -13
- package/dist/ui/ShellUIAdapter.js.map +1 -1
- package/dist/ui/display.d.ts +45 -24
- package/dist/ui/display.d.ts.map +1 -1
- package/dist/ui/display.js +259 -140
- package/dist/ui/display.js.map +1 -1
- package/dist/ui/persistentPrompt.d.ts +50 -0
- package/dist/ui/persistentPrompt.d.ts.map +1 -0
- package/dist/ui/persistentPrompt.js +92 -0
- package/dist/ui/persistentPrompt.js.map +1 -0
- package/dist/ui/terminalUISchema.d.ts +195 -0
- package/dist/ui/terminalUISchema.d.ts.map +1 -0
- package/dist/ui/terminalUISchema.js +113 -0
- package/dist/ui/terminalUISchema.js.map +1 -0
- package/dist/ui/theme.d.ts.map +1 -1
- package/dist/ui/theme.js +8 -6
- package/dist/ui/theme.js.map +1 -1
- package/dist/ui/toolDisplay.d.ts +158 -0
- package/dist/ui/toolDisplay.d.ts.map +1 -1
- package/dist/ui/toolDisplay.js +348 -0
- package/dist/ui/toolDisplay.js.map +1 -1
- package/dist/ui/unified/layout.d.ts +0 -1
- package/dist/ui/unified/layout.d.ts.map +1 -1
- package/dist/ui/unified/layout.js +179 -25
- package/dist/ui/unified/layout.js.map +1 -1
- package/package.json +4 -4
- package/scripts/deploy-security-capabilities.js +178 -0
- package/dist/core/hooks.d.ts +0 -113
- package/dist/core/hooks.d.ts.map +0 -1
- package/dist/core/hooks.js +0 -267
- package/dist/core/hooks.js.map +0 -1
- package/dist/core/metricsTracker.d.ts +0 -122
- package/dist/core/metricsTracker.d.ts.map +0 -1
- package/dist/core/metricsTracker.js.map +0 -1
- package/dist/core/securityAssessment.d.ts +0 -91
- package/dist/core/securityAssessment.d.ts.map +0 -1
- package/dist/core/securityAssessment.js +0 -580
- package/dist/core/securityAssessment.js.map +0 -1
- package/dist/core/verification.d.ts +0 -137
- package/dist/core/verification.d.ts.map +0 -1
- package/dist/core/verification.js +0 -323
- package/dist/core/verification.js.map +0 -1
- package/dist/subagents/agentConfig.d.ts +0 -27
- package/dist/subagents/agentConfig.d.ts.map +0 -1
- package/dist/subagents/agentConfig.js +0 -89
- package/dist/subagents/agentConfig.js.map +0 -1
- package/dist/subagents/agentRegistry.d.ts +0 -33
- package/dist/subagents/agentRegistry.d.ts.map +0 -1
- package/dist/subagents/agentRegistry.js +0 -162
- package/dist/subagents/agentRegistry.js.map +0 -1
- package/dist/utils/frontmatter.d.ts +0 -10
- package/dist/utils/frontmatter.d.ts.map +0 -1
- package/dist/utils/frontmatter.js +0 -78
- package/dist/utils/frontmatter.js.map +0 -1
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Security Capabilities Deployment Script
|
|
5
|
+
*
|
|
6
|
+
* Deploys and configures complete security testing capabilities.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { UltimateSecurityCapabilityModule } from '../dist/capabilities/ultimateSecurityCapability.js';
|
|
10
|
+
import { AuthorizationManager } from '../dist/security/authorization.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Deploy security capabilities
|
|
14
|
+
*/
|
|
15
|
+
async function deploySecurityCapabilities() {
|
|
16
|
+
console.log('🚀 DEPLOYING SECURITY CAPABILITIES');
|
|
17
|
+
console.log('='.repeat(60));
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
// Check environment configuration
|
|
21
|
+
console.log('\n🔧 Checking Environment Configuration...');
|
|
22
|
+
|
|
23
|
+
const authToken = process.env.SECURITY_AUTHORIZATION_TOKEN;
|
|
24
|
+
const bypassAuth = process.env.BYPASS_AUTHORIZATION === 'true';
|
|
25
|
+
|
|
26
|
+
if (!authToken && !bypassAuth) {
|
|
27
|
+
console.warn('⚠️ SECURITY_AUTHORIZATION_TOKEN not set in environment');
|
|
28
|
+
console.log('💡 Set environment variable: export SECURITY_AUTHORIZATION_TOKEN="your-token"');
|
|
29
|
+
console.log('💡 Or set BYPASS_AUTHORIZATION=true for development (NOT RECOMMENDED)');
|
|
30
|
+
} else if (bypassAuth) {
|
|
31
|
+
console.warn('⚠️ AUTHORIZATION BYPASSED - FOR DEVELOPMENT ONLY');
|
|
32
|
+
} else {
|
|
33
|
+
console.log('✅ Authorization token configured');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Create authorization manager
|
|
37
|
+
console.log('\n🔐 Creating Authorization Manager...');
|
|
38
|
+
const authManager = new AuthorizationManager();
|
|
39
|
+
|
|
40
|
+
// Create ultimate security capability
|
|
41
|
+
console.log('\n🏗️ Creating Ultimate Security Capability...');
|
|
42
|
+
const ultimateSecurity = new UltimateSecurityCapabilityModule({
|
|
43
|
+
enableExploitation: true,
|
|
44
|
+
enableAdvancedExploitation: true,
|
|
45
|
+
enablePayloadGeneration: true,
|
|
46
|
+
requireAuthorization: true,
|
|
47
|
+
authorizationManager: authManager,
|
|
48
|
+
description: 'Complete security testing capabilities deployed via script'
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// Display deployment summary
|
|
52
|
+
console.log('\n📊 DEPLOYMENT SUMMARY');
|
|
53
|
+
console.log('-'.repeat(40));
|
|
54
|
+
console.log(`Capability ID: ${ultimateSecurity.id}`);
|
|
55
|
+
console.log('Configuration:');
|
|
56
|
+
console.log(' - enableExploitation: true');
|
|
57
|
+
console.log(' - enableAdvancedExploitation: true');
|
|
58
|
+
console.log(' - enablePayloadGeneration: true');
|
|
59
|
+
console.log(' - requireAuthorization: true');
|
|
60
|
+
|
|
61
|
+
console.log('\n🔧 Available Tools:');
|
|
62
|
+
console.log(' Authorization Tools (3):');
|
|
63
|
+
console.log(' - request_security_authorization');
|
|
64
|
+
console.log(' - get_authorization_status');
|
|
65
|
+
console.log(' - generate_authorization_report');
|
|
66
|
+
|
|
67
|
+
console.log('\n Real Security Tools (11):');
|
|
68
|
+
console.log(' - real_scan_network');
|
|
69
|
+
console.log(' - real_scan_vulnerabilities');
|
|
70
|
+
console.log(' - real_exploit_sql_injection');
|
|
71
|
+
console.log(' - real_exploit_xss');
|
|
72
|
+
console.log(' - real_exploit_ssh');
|
|
73
|
+
console.log(' - real_exploit_ftp');
|
|
74
|
+
console.log(' - real_exploit_smb');
|
|
75
|
+
console.log(' - real_implement_persistence');
|
|
76
|
+
console.log(' - real_detect_persistence');
|
|
77
|
+
console.log(' - real_remove_persistence');
|
|
78
|
+
console.log(' - real_generate_security_report');
|
|
79
|
+
|
|
80
|
+
console.log('\n Offensive Security Tools (8):');
|
|
81
|
+
console.log(' - generate_reverse_shell');
|
|
82
|
+
console.log(' - create_fileless_persistence');
|
|
83
|
+
console.log(' - deploy_web_shell');
|
|
84
|
+
console.log(' - create_scheduled_persistence');
|
|
85
|
+
console.log(' - generate_obfuscated_payloads');
|
|
86
|
+
console.log(' - setup_dns_tunneling');
|
|
87
|
+
console.log(' - generate_phishing_templates');
|
|
88
|
+
console.log(' - create_backdoor_user');
|
|
89
|
+
|
|
90
|
+
console.log('\n📋 Total: 22 Security Testing Tools');
|
|
91
|
+
|
|
92
|
+
// Test authorization status
|
|
93
|
+
console.log('\n🔍 Testing Authorization Status...');
|
|
94
|
+
const authStatus = authManager.getAuthorizationStatus();
|
|
95
|
+
console.log(`Authorization Status: ${authStatus.authorized ? 'AUTHORIZED' : 'NOT AUTHORIZED'}`);
|
|
96
|
+
if (authStatus.reason) {
|
|
97
|
+
console.log(`Reason: ${authStatus.reason}`);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Generate deployment report
|
|
101
|
+
console.log('\n📄 Generating Deployment Report...');
|
|
102
|
+
const deploymentReport = generateDeploymentReport(ultimateSecurity, authManager);
|
|
103
|
+
console.log(deploymentReport);
|
|
104
|
+
|
|
105
|
+
console.log('\n✅ SECURITY CAPABILITIES DEPLOYMENT COMPLETED');
|
|
106
|
+
console.log('='.repeat(60));
|
|
107
|
+
|
|
108
|
+
console.log('\n💡 Next Steps:');
|
|
109
|
+
console.log(' 1. Request authorization using request_security_authorization');
|
|
110
|
+
console.log(' 2. Define testing scope and targets');
|
|
111
|
+
console.log(' 3. Begin security testing activities');
|
|
112
|
+
console.log(' 4. Generate comprehensive reports');
|
|
113
|
+
console.log(' 5. Follow responsible disclosure practices');
|
|
114
|
+
|
|
115
|
+
} catch (error) {
|
|
116
|
+
console.error('❌ Deployment failed:', error);
|
|
117
|
+
process.exit(1);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Generate deployment report
|
|
123
|
+
*/
|
|
124
|
+
function generateDeploymentReport(capability, authManager) {
|
|
125
|
+
let report = 'SECURITY CAPABILITIES DEPLOYMENT REPORT\n';
|
|
126
|
+
report += '='.repeat(50) + '\n';
|
|
127
|
+
report += `Deployment Time: ${new Date().toISOString()}\n`;
|
|
128
|
+
report += `Capability ID: ${capability.id}\n`;
|
|
129
|
+
report += `\nConfiguration:\n`;
|
|
130
|
+
report += ` - enableExploitation: true\n`;
|
|
131
|
+
report += ` - enableAdvancedExploitation: true\n`;
|
|
132
|
+
report += ` - enablePayloadGeneration: true\n`;
|
|
133
|
+
report += ` - requireAuthorization: true\n`;
|
|
134
|
+
|
|
135
|
+
const authStatus = authManager.getAuthorizationStatus();
|
|
136
|
+
report += `\nAuthorization Status: ${authStatus.authorized ? 'ACTIVE' : 'INACTIVE'}\n`;
|
|
137
|
+
if (authStatus.reason) {
|
|
138
|
+
report += `Authorization Reason: ${authStatus.reason}\n`;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
report += `\nAvailable Tools: 22\n`;
|
|
142
|
+
report += ` - Authorization: 3 tools\n`;
|
|
143
|
+
report += ` - Real Security: 11 tools\n`;
|
|
144
|
+
report += ` - Offensive Security: 8 tools\n`;
|
|
145
|
+
|
|
146
|
+
report += `\nLegal Notice:\n`;
|
|
147
|
+
report += `All security testing tools require explicit authorization and scope definition.\n`;
|
|
148
|
+
report += `Intended for legitimate security testing, red team exercises, and authorized penetration testing only.\n`;
|
|
149
|
+
report += `Unauthorized use is illegal and unethical.\n`;
|
|
150
|
+
|
|
151
|
+
return report;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Main deployment function
|
|
156
|
+
*/
|
|
157
|
+
async function main() {
|
|
158
|
+
console.log('🔒 Erosolar CLI Security Capabilities Deployment');
|
|
159
|
+
console.log('='.repeat(60));
|
|
160
|
+
|
|
161
|
+
await deploySecurityCapabilities();
|
|
162
|
+
|
|
163
|
+
console.log('\n🎉 Deployment completed successfully!');
|
|
164
|
+
console.log('\n📚 Documentation:');
|
|
165
|
+
console.log(' - docs/OFFENSIVE_SECURITY_CAPABILITIES.md');
|
|
166
|
+
console.log(' - examples/ultimate-security-testing.ts');
|
|
167
|
+
console.log(' - config/security-deployment.json');
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Run deployment
|
|
171
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
172
|
+
main().catch(error => {
|
|
173
|
+
console.error('❌ Deployment failed:', error);
|
|
174
|
+
process.exit(1);
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export { deploySecurityCapabilities };
|
package/dist/core/hooks.d.ts
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hooks System
|
|
3
|
-
*
|
|
4
|
-
* Event-triggered scripts that automate workflows, based on Claude Code's hooks architecture.
|
|
5
|
-
* Hooks can execute shell commands or query an LLM for decisions.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Hook event types
|
|
9
|
-
*/
|
|
10
|
-
export type HookEvent = 'PreToolUse' | 'PostToolUse' | 'PermissionRequest' | 'UserPromptSubmit' | 'SessionStart' | 'SessionEnd' | 'Stop' | 'SubagentStop' | 'Notification';
|
|
11
|
-
/**
|
|
12
|
-
* Hook types
|
|
13
|
-
*/
|
|
14
|
-
export type HookType = 'command' | 'prompt';
|
|
15
|
-
/**
|
|
16
|
-
* Hook definition
|
|
17
|
-
*/
|
|
18
|
-
export interface HookDefinition {
|
|
19
|
-
/** Regex pattern to match tool names or events */
|
|
20
|
-
matcher?: string;
|
|
21
|
-
/** Type of hook: 'command' for shell, 'prompt' for LLM */
|
|
22
|
-
type: HookType;
|
|
23
|
-
/** Shell command to execute (for command hooks) */
|
|
24
|
-
command?: string;
|
|
25
|
-
/** Prompt to send to LLM (for prompt hooks) */
|
|
26
|
-
prompt?: string;
|
|
27
|
-
/** Timeout in milliseconds */
|
|
28
|
-
timeout?: number;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Hook execution result
|
|
32
|
-
*/
|
|
33
|
-
export interface HookResult {
|
|
34
|
-
success: boolean;
|
|
35
|
-
output?: string;
|
|
36
|
-
decision?: 'allow' | 'deny' | 'continue';
|
|
37
|
-
reason?: string;
|
|
38
|
-
error?: string;
|
|
39
|
-
blocked?: boolean;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Hook execution context
|
|
43
|
-
*/
|
|
44
|
-
export interface HookContext {
|
|
45
|
-
event: HookEvent;
|
|
46
|
-
toolName?: string;
|
|
47
|
-
toolArgs?: Record<string, unknown>;
|
|
48
|
-
toolResult?: string;
|
|
49
|
-
userInput?: string;
|
|
50
|
-
sessionId?: string;
|
|
51
|
-
workingDir: string;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Hooks configuration
|
|
55
|
-
*/
|
|
56
|
-
export interface HooksConfig {
|
|
57
|
-
[event: string]: HookDefinition[];
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Load hooks from settings files
|
|
61
|
-
*/
|
|
62
|
-
export declare function loadHooks(workingDir: string): HooksConfig;
|
|
63
|
-
/**
|
|
64
|
-
* HooksManager class for managing and executing hooks
|
|
65
|
-
*/
|
|
66
|
-
export declare class HooksManager {
|
|
67
|
-
private hooks;
|
|
68
|
-
private workingDir;
|
|
69
|
-
constructor(workingDir: string);
|
|
70
|
-
/**
|
|
71
|
-
* Reload hooks from settings files
|
|
72
|
-
*/
|
|
73
|
-
reload(): void;
|
|
74
|
-
/**
|
|
75
|
-
* Check if hooks are configured for an event
|
|
76
|
-
*/
|
|
77
|
-
hasHooks(event: HookEvent): boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Get all hooks for an event
|
|
80
|
-
*/
|
|
81
|
-
getHooks(event: HookEvent): HookDefinition[];
|
|
82
|
-
/**
|
|
83
|
-
* Execute all matching hooks for an event
|
|
84
|
-
*/
|
|
85
|
-
executeHooks(context: HookContext): Promise<HookResult[]>;
|
|
86
|
-
/**
|
|
87
|
-
* Execute pre-tool hooks and check if tool should proceed
|
|
88
|
-
*/
|
|
89
|
-
executePreToolHooks(toolName: string, args: Record<string, unknown>): Promise<{
|
|
90
|
-
allowed: boolean;
|
|
91
|
-
results: HookResult[];
|
|
92
|
-
}>;
|
|
93
|
-
/**
|
|
94
|
-
* Execute post-tool hooks
|
|
95
|
-
*/
|
|
96
|
-
executePostToolHooks(toolName: string, args: Record<string, unknown>, result: string): Promise<HookResult[]>;
|
|
97
|
-
/**
|
|
98
|
-
* Execute user prompt hooks
|
|
99
|
-
*/
|
|
100
|
-
executeUserPromptHooks(userInput: string): Promise<{
|
|
101
|
-
allowed: boolean;
|
|
102
|
-
results: HookResult[];
|
|
103
|
-
}>;
|
|
104
|
-
/**
|
|
105
|
-
* Execute session lifecycle hooks
|
|
106
|
-
*/
|
|
107
|
-
executeSessionHook(event: 'SessionStart' | 'SessionEnd', sessionId: string): Promise<HookResult[]>;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Create a hooks manager for the given working directory
|
|
111
|
-
*/
|
|
112
|
-
export declare function createHooksManager(workingDir: string): HooksManager;
|
|
113
|
-
//# sourceMappingURL=hooks.d.ts.map
|
package/dist/core/hooks.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/core/hooks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH;;GAEG;AACH,MAAM,MAAM,SAAS,GACj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workflows, based on Claude Code's hooks architecture.
|
|
5
|
-
* Hooks can execute shell commands or query an LLM for decisions.
|
|
6
|
-
*/
|
|
7
|
-
import { exec } from 'node:child_process';
|
|
8
|
-
import { promisify } from 'node:util';
|
|
9
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
10
|
-
import { join } from 'node:path';
|
|
11
|
-
import { homedir } from 'node:os';
|
|
12
|
-
const execAsync = promisify(exec);
|
|
13
|
-
/**
|
|
14
|
-
* Load hooks from settings files
|
|
15
|
-
*/
|
|
16
|
-
export function loadHooks(workingDir) {
|
|
17
|
-
const hooks = {};
|
|
18
|
-
// Load from user settings (~/.claude/settings.json or ~/.erosolar/settings.json)
|
|
19
|
-
const userSettingsPaths = [
|
|
20
|
-
join(homedir(), '.claude', 'settings.json'),
|
|
21
|
-
join(homedir(), '.erosolar', 'settings.json'),
|
|
22
|
-
];
|
|
23
|
-
// Load from project settings (.claude/settings.json or .erosolar/settings.json)
|
|
24
|
-
const projectSettingsPaths = [
|
|
25
|
-
join(workingDir, '.claude', 'settings.json'),
|
|
26
|
-
join(workingDir, '.erosolar', 'settings.json'),
|
|
27
|
-
];
|
|
28
|
-
// Load user settings first, then override with project settings
|
|
29
|
-
for (const settingsPath of [...userSettingsPaths, ...projectSettingsPaths]) {
|
|
30
|
-
if (existsSync(settingsPath)) {
|
|
31
|
-
try {
|
|
32
|
-
const content = readFileSync(settingsPath, 'utf-8');
|
|
33
|
-
const settings = JSON.parse(content);
|
|
34
|
-
if (settings.hooks) {
|
|
35
|
-
for (const [event, eventHooks] of Object.entries(settings.hooks)) {
|
|
36
|
-
if (!hooks[event]) {
|
|
37
|
-
hooks[event] = [];
|
|
38
|
-
}
|
|
39
|
-
hooks[event].push(...eventHooks);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
catch {
|
|
44
|
-
// Ignore invalid settings files
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return hooks;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Check if a hook matches the given context
|
|
52
|
-
*/
|
|
53
|
-
function matchesHook(hook, context) {
|
|
54
|
-
if (!hook.matcher) {
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
try {
|
|
58
|
-
const regex = new RegExp(hook.matcher);
|
|
59
|
-
// Match against tool name if available
|
|
60
|
-
if (context.toolName) {
|
|
61
|
-
return regex.test(context.toolName);
|
|
62
|
-
}
|
|
63
|
-
// Match against event name
|
|
64
|
-
return regex.test(context.event);
|
|
65
|
-
}
|
|
66
|
-
catch {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Execute a command hook
|
|
72
|
-
*/
|
|
73
|
-
async function executeCommandHook(hook, context) {
|
|
74
|
-
if (!hook.command) {
|
|
75
|
-
return { success: false, error: 'No command specified' };
|
|
76
|
-
}
|
|
77
|
-
const timeout = hook.timeout ?? 30000;
|
|
78
|
-
// Prepare environment variables for the hook
|
|
79
|
-
const env = {
|
|
80
|
-
...process.env,
|
|
81
|
-
HOOK_EVENT: context.event,
|
|
82
|
-
HOOK_TOOL_NAME: context.toolName ?? '',
|
|
83
|
-
HOOK_TOOL_ARGS: context.toolArgs ? JSON.stringify(context.toolArgs) : '',
|
|
84
|
-
HOOK_TOOL_RESULT: context.toolResult ?? '',
|
|
85
|
-
HOOK_USER_INPUT: context.userInput ?? '',
|
|
86
|
-
HOOK_SESSION_ID: context.sessionId ?? '',
|
|
87
|
-
HOOK_WORKING_DIR: context.workingDir,
|
|
88
|
-
};
|
|
89
|
-
try {
|
|
90
|
-
const { stdout, stderr } = await execAsync(hook.command, {
|
|
91
|
-
cwd: context.workingDir,
|
|
92
|
-
timeout,
|
|
93
|
-
env,
|
|
94
|
-
});
|
|
95
|
-
// Try to parse JSON output for structured results
|
|
96
|
-
const output = stdout.trim();
|
|
97
|
-
try {
|
|
98
|
-
const parsed = JSON.parse(output);
|
|
99
|
-
return {
|
|
100
|
-
success: true,
|
|
101
|
-
output,
|
|
102
|
-
decision: parsed.decision,
|
|
103
|
-
reason: parsed.reason,
|
|
104
|
-
blocked: parsed.blocked,
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
catch {
|
|
108
|
-
// Return raw output if not JSON
|
|
109
|
-
return {
|
|
110
|
-
success: true,
|
|
111
|
-
output,
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
catch (error) {
|
|
116
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
117
|
-
// Exit code 2 means blocking
|
|
118
|
-
if (message.includes('exit code 2')) {
|
|
119
|
-
return {
|
|
120
|
-
success: false,
|
|
121
|
-
blocked: true,
|
|
122
|
-
error: message,
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
return {
|
|
126
|
-
success: false,
|
|
127
|
-
error: message,
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Execute a prompt hook (would query LLM in full implementation)
|
|
133
|
-
*/
|
|
134
|
-
async function executePromptHook(hook, context) {
|
|
135
|
-
if (!hook.prompt) {
|
|
136
|
-
return { success: false, error: 'No prompt specified' };
|
|
137
|
-
}
|
|
138
|
-
// In a full implementation, this would:
|
|
139
|
-
// 1. Send the prompt to a fast LLM (e.g., Haiku)
|
|
140
|
-
// 2. Parse the response for decision
|
|
141
|
-
// 3. Return the result
|
|
142
|
-
// For now, return a placeholder that allows continuation
|
|
143
|
-
return {
|
|
144
|
-
success: true,
|
|
145
|
-
decision: 'continue',
|
|
146
|
-
reason: 'Prompt hooks require LLM integration',
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Execute a single hook
|
|
151
|
-
*/
|
|
152
|
-
async function executeHook(hook, context) {
|
|
153
|
-
switch (hook.type) {
|
|
154
|
-
case 'command':
|
|
155
|
-
return executeCommandHook(hook, context);
|
|
156
|
-
case 'prompt':
|
|
157
|
-
return executePromptHook(hook, context);
|
|
158
|
-
default:
|
|
159
|
-
return { success: false, error: `Unknown hook type: ${hook.type}` };
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* HooksManager class for managing and executing hooks
|
|
164
|
-
*/
|
|
165
|
-
export class HooksManager {
|
|
166
|
-
hooks;
|
|
167
|
-
workingDir;
|
|
168
|
-
constructor(workingDir) {
|
|
169
|
-
this.workingDir = workingDir;
|
|
170
|
-
this.hooks = loadHooks(workingDir);
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Reload hooks from settings files
|
|
174
|
-
*/
|
|
175
|
-
reload() {
|
|
176
|
-
this.hooks = loadHooks(this.workingDir);
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Check if hooks are configured for an event
|
|
180
|
-
*/
|
|
181
|
-
hasHooks(event) {
|
|
182
|
-
return Boolean(this.hooks[event]?.length);
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Get all hooks for an event
|
|
186
|
-
*/
|
|
187
|
-
getHooks(event) {
|
|
188
|
-
return this.hooks[event] ?? [];
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Execute all matching hooks for an event
|
|
192
|
-
*/
|
|
193
|
-
async executeHooks(context) {
|
|
194
|
-
const eventHooks = this.hooks[context.event] ?? [];
|
|
195
|
-
const results = [];
|
|
196
|
-
for (const hook of eventHooks) {
|
|
197
|
-
if (matchesHook(hook, context)) {
|
|
198
|
-
const result = await executeHook(hook, context);
|
|
199
|
-
results.push(result);
|
|
200
|
-
// Stop on blocking result
|
|
201
|
-
if (result.blocked) {
|
|
202
|
-
break;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
return results;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Execute pre-tool hooks and check if tool should proceed
|
|
210
|
-
*/
|
|
211
|
-
async executePreToolHooks(toolName, args) {
|
|
212
|
-
const context = {
|
|
213
|
-
event: 'PreToolUse',
|
|
214
|
-
toolName,
|
|
215
|
-
toolArgs: args,
|
|
216
|
-
workingDir: this.workingDir,
|
|
217
|
-
};
|
|
218
|
-
const results = await this.executeHooks(context);
|
|
219
|
-
// Check if any hook blocked the operation
|
|
220
|
-
const blocked = results.some((r) => r.blocked || r.decision === 'deny');
|
|
221
|
-
return { allowed: !blocked, results };
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Execute post-tool hooks
|
|
225
|
-
*/
|
|
226
|
-
async executePostToolHooks(toolName, args, result) {
|
|
227
|
-
const context = {
|
|
228
|
-
event: 'PostToolUse',
|
|
229
|
-
toolName,
|
|
230
|
-
toolArgs: args,
|
|
231
|
-
toolResult: result,
|
|
232
|
-
workingDir: this.workingDir,
|
|
233
|
-
};
|
|
234
|
-
return this.executeHooks(context);
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Execute user prompt hooks
|
|
238
|
-
*/
|
|
239
|
-
async executeUserPromptHooks(userInput) {
|
|
240
|
-
const context = {
|
|
241
|
-
event: 'UserPromptSubmit',
|
|
242
|
-
userInput,
|
|
243
|
-
workingDir: this.workingDir,
|
|
244
|
-
};
|
|
245
|
-
const results = await this.executeHooks(context);
|
|
246
|
-
const blocked = results.some((r) => r.blocked || r.decision === 'deny');
|
|
247
|
-
return { allowed: !blocked, results };
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* Execute session lifecycle hooks
|
|
251
|
-
*/
|
|
252
|
-
async executeSessionHook(event, sessionId) {
|
|
253
|
-
const context = {
|
|
254
|
-
event,
|
|
255
|
-
sessionId,
|
|
256
|
-
workingDir: this.workingDir,
|
|
257
|
-
};
|
|
258
|
-
return this.executeHooks(context);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Create a hooks manager for the given working directory
|
|
263
|
-
*/
|
|
264
|
-
export function createHooksManager(workingDir) {
|
|
265
|
-
return new HooksManager(workingDir);
|
|
266
|
-
}
|
|
267
|
-
//# sourceMappingURL=hooks.js.map
|
package/dist/core/hooks.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/core/hooks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AA4ElC;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,UAAkB;IAC1C,MAAM,KAAK,GAAgB,EAAE,CAAC;IAE9B,iFAAiF;IACjF,MAAM,iBAAiB,GAAG;QACxB,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,eAAe,CAAC;QAC3C,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,eAAe,CAAC;KAC9C,CAAC;IAEF,gFAAgF;IAChF,MAAM,oBAAoB,GAAG;QAC3B,IAAI,CAAC,UAAU,EAAE,SAAS,EAAE,eAAe,CAAC;QAC5C,IAAI,CAAC,UAAU,EAAE,WAAW,EAAE,eAAe,CAAC;KAC/C,CAAC;IAEF,gEAAgE;IAChE,KAAK,MAAM,YAAY,IAAI,CAAC,GAAG,iBAAiB,EAAE,GAAG,oBAAoB,CAAC,EAAE,CAAC;QAC3E,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YAC7B,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;gBACpD,MAAM,QAAQ,GAAiB,IAAI,CAAC,KAAK,CAAC,OAA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QAEF,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAkB;IACnD,OAAO,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Performance Metrics Tracker
|
|
3
|
-
*
|
|
4
|
-
* Tracks session performance metrics for analytics and improvement suggestions.
|
|
5
|
-
*/
|
|
6
|
-
import type { ProviderUsage } from './types.js';
|
|
7
|
-
/**
|
|
8
|
-
* Performance metrics for an agent session.
|
|
9
|
-
*/
|
|
10
|
-
export interface AgentPerformanceMetrics {
|
|
11
|
-
sessionId: string;
|
|
12
|
-
totalMessages: number;
|
|
13
|
-
totalToolCalls: number;
|
|
14
|
-
totalTokensUsed: number;
|
|
15
|
-
totalTimeMs: number;
|
|
16
|
-
successfulToolCalls: number;
|
|
17
|
-
failedToolCalls: number;
|
|
18
|
-
codeBlocksGenerated: number;
|
|
19
|
-
avgResponseTimeMs: number;
|
|
20
|
-
avgCodeQuality: number;
|
|
21
|
-
avgAlgorithmEfficiency: number;
|
|
22
|
-
avgErrorHandling: number;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Code quality evaluation result.
|
|
26
|
-
*/
|
|
27
|
-
export interface CodeQualityMetrics {
|
|
28
|
-
codeQualityScore: number;
|
|
29
|
-
algorithmEfficiency: number;
|
|
30
|
-
errorHandlingScore: number;
|
|
31
|
-
documentationScore: number;
|
|
32
|
-
maintainabilityScore: number;
|
|
33
|
-
securityScore: number;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Execution trace for debugging and analysis.
|
|
37
|
-
*/
|
|
38
|
-
export interface ExecutionTrace {
|
|
39
|
-
traceId: string;
|
|
40
|
-
timestamp: string;
|
|
41
|
-
prompt: string;
|
|
42
|
-
response: string;
|
|
43
|
-
toolCalls: Array<{
|
|
44
|
-
name: string;
|
|
45
|
-
arguments: Record<string, unknown>;
|
|
46
|
-
result?: string;
|
|
47
|
-
error?: string;
|
|
48
|
-
durationMs: number;
|
|
49
|
-
}>;
|
|
50
|
-
totalDurationMs: number;
|
|
51
|
-
tokenUsage?: ProviderUsage;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Improvement suggestion from analysis.
|
|
55
|
-
*/
|
|
56
|
-
export interface ImprovementSuggestion {
|
|
57
|
-
category: 'performance' | 'quality' | 'efficiency' | 'error-handling';
|
|
58
|
-
severity: 'low' | 'medium' | 'high';
|
|
59
|
-
message: string;
|
|
60
|
-
suggestedAction?: string;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Creates default performance metrics.
|
|
64
|
-
*/
|
|
65
|
-
export declare function createDefaultMetrics(sessionId: string): AgentPerformanceMetrics;
|
|
66
|
-
/**
|
|
67
|
-
* Tracks performance metrics for an agent session.
|
|
68
|
-
*/
|
|
69
|
-
export declare class MetricsTracker {
|
|
70
|
-
private metrics;
|
|
71
|
-
private responseTimes;
|
|
72
|
-
private codeQualityScores;
|
|
73
|
-
private efficiencyScores;
|
|
74
|
-
private errorHandlingScores;
|
|
75
|
-
private traces;
|
|
76
|
-
constructor(sessionId: string);
|
|
77
|
-
/**
|
|
78
|
-
* Record a message exchange.
|
|
79
|
-
*/
|
|
80
|
-
recordMessage(elapsedMs: number, usage?: ProviderUsage | null): void;
|
|
81
|
-
/**
|
|
82
|
-
* Record a tool call.
|
|
83
|
-
*/
|
|
84
|
-
recordToolCall(success: boolean): void;
|
|
85
|
-
/**
|
|
86
|
-
* Record code generation.
|
|
87
|
-
*/
|
|
88
|
-
recordCodeGeneration(codeBlockCount: number): void;
|
|
89
|
-
/**
|
|
90
|
-
* Record code quality evaluation.
|
|
91
|
-
*/
|
|
92
|
-
recordCodeQuality(quality: CodeQualityMetrics): void;
|
|
93
|
-
/**
|
|
94
|
-
* Add an execution trace.
|
|
95
|
-
*/
|
|
96
|
-
addTrace(trace: ExecutionTrace): void;
|
|
97
|
-
/**
|
|
98
|
-
* Update running averages.
|
|
99
|
-
*/
|
|
100
|
-
private updateAverages;
|
|
101
|
-
/**
|
|
102
|
-
* Get current metrics.
|
|
103
|
-
*/
|
|
104
|
-
getMetrics(): AgentPerformanceMetrics;
|
|
105
|
-
/**
|
|
106
|
-
* Get execution traces.
|
|
107
|
-
*/
|
|
108
|
-
getTraces(): ExecutionTrace[];
|
|
109
|
-
/**
|
|
110
|
-
* Get human-readable performance summary.
|
|
111
|
-
*/
|
|
112
|
-
getPerformanceSummary(): string;
|
|
113
|
-
/**
|
|
114
|
-
* Get improvement suggestions based on metrics.
|
|
115
|
-
*/
|
|
116
|
-
getImprovementSuggestions(): ImprovementSuggestion[];
|
|
117
|
-
/**
|
|
118
|
-
* Reset all metrics.
|
|
119
|
-
*/
|
|
120
|
-
reset(): void;
|
|
121
|
-
}
|
|
122
|
-
//# sourceMappingURL=metricsTracker.d.ts.map
|