erosolar-cli 1.7.323 → 1.7.325
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 +164 -233
- 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 +116 -135
- package/dist/shell/terminalInput.d.ts.map +1 -1
- package/dist/shell/terminalInput.js +513 -527
- package/dist/shell/terminalInput.js.map +1 -1
- package/dist/shell/terminalInputAdapter.d.ts +20 -71
- package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
- package/dist/shell/terminalInputAdapter.js +30 -87
- 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 +25 -15
- 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
package/README.md
CHANGED
|
@@ -1,49 +1,173 @@
|
|
|
1
1
|
# erosolar-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## AI Coding Agent Comparison
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
| Agent | Screenshot |
|
|
6
|
+
|-------|------------|
|
|
7
|
+
| **Claude Code** |  |
|
|
8
|
+
| **OpenAI Codex CLI** |  |
|
|
9
|
+
| **Erosolar CLI** |  |
|
|
10
|
+
|
|
11
|
+
### Current State
|
|
12
|
+
|
|
13
|
+
**Claude Code** currently delivers the best results for creating complete projects from scratch. It successfully built a CS50 final project end-to-end and launched it without manual intervention.
|
|
14
|
+
|
|
15
|
+
**OpenAI Codex CLI** provides solid coding assistance but requires more human guidance for complex multi-step project creation.
|
|
16
|
+
|
|
17
|
+
**Erosolar CLI** is actively being developed by Bo Shang to match and eventually exceed these capabilities. The goal is to achieve the same level of autonomous project creation, constrained only by the underlying model's limits—not by the CLI tooling itself. This work is ongoing.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Overview
|
|
22
|
+
|
|
23
|
+
**Erosolar CLI** is a sophisticated, unified AI coding agent framework for the command line that provides multi-provider AI support with advanced code intelligence and security research capabilities.
|
|
24
|
+
|
|
25
|
+
### Core Purpose
|
|
26
|
+
|
|
27
|
+
1. **Universal AI Interface**: Acts as a model-agnostic CLI that works with any major AI provider (OpenAI, Anthropic, Google, xAI, DeepSeek, Ollama) - you bring your own API keys
|
|
28
|
+
|
|
29
|
+
2. **Advanced Code Intelligence**: Provides comprehensive coding capabilities including:
|
|
30
|
+
- File system operations (read/write/edit)
|
|
31
|
+
- Code search and analysis
|
|
32
|
+
- Bash command execution
|
|
33
|
+
- Git operations
|
|
34
|
+
- Browser automation
|
|
35
|
+
- Cloud deployment
|
|
36
|
+
- Testing and validation
|
|
37
|
+
|
|
38
|
+
3. **Security Research Toolkit**: Includes sophisticated security testing and research capabilities for:
|
|
39
|
+
- Penetration testing
|
|
40
|
+
- Vulnerability scanning
|
|
41
|
+
- Threat intelligence
|
|
42
|
+
- Red team operations
|
|
43
|
+
- Counter-intelligence simulations
|
|
44
|
+
|
|
45
|
+
### Key Features
|
|
46
|
+
|
|
47
|
+
- **Multi-Provider Support** - Switch between OpenAI, Anthropic, Google, xAI, DeepSeek, or run locally with Ollama
|
|
48
|
+
- **25+ Built-in Models** - From GPT-5 to Claude Opus to Gemini Pro to local Llama models
|
|
49
|
+
- **Advanced Code Intelligence** - Full file system access, git operations, bash command execution
|
|
50
|
+
- **Browser Automation** - Web scraping, form filling, authentication, testing
|
|
51
|
+
- **Cloud Deployment** - Firebase, Vercel, Netlify, AWS, GCP, Azure support
|
|
52
|
+
- **Security Research** - Penetration testing, vulnerability scanning, threat intelligence
|
|
53
|
+
- **Testing Framework** - Unit tests, E2E tests, accessibility tests, performance audits
|
|
54
|
+
- **Email Automation** - SMTP email sending, batch campaigns, template personalization
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Installation
|
|
10
59
|
|
|
11
|
-
## Install
|
|
12
60
|
```bash
|
|
13
61
|
npm install -g erosolar-cli
|
|
14
|
-
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Or use npx:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
15
67
|
npx erosolar-cli
|
|
16
68
|
```
|
|
17
69
|
|
|
18
|
-
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Quick Start
|
|
73
|
+
|
|
19
74
|
```bash
|
|
20
|
-
#
|
|
75
|
+
# Basic usage
|
|
21
76
|
erosolar
|
|
22
77
|
|
|
23
|
-
#
|
|
78
|
+
# With specific provider and model
|
|
24
79
|
erosolar --provider openai --model gpt-4o
|
|
25
80
|
|
|
26
|
-
#
|
|
81
|
+
# With agent profile
|
|
82
|
+
erosolar --profile erosolar-code
|
|
83
|
+
|
|
84
|
+
# Resume last session
|
|
27
85
|
erosolar --restore
|
|
28
86
|
```
|
|
29
87
|
|
|
30
|
-
|
|
31
|
-
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Configuration
|
|
91
|
+
|
|
92
|
+
Set your API keys as environment variables:
|
|
93
|
+
|
|
32
94
|
```bash
|
|
33
|
-
|
|
34
|
-
|
|
95
|
+
# OpenAI
|
|
96
|
+
OPENAI_API_KEY=sk-...
|
|
97
|
+
|
|
98
|
+
# Anthropic
|
|
99
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
100
|
+
|
|
101
|
+
# Google AI
|
|
35
102
|
GOOGLE_API_KEY=...
|
|
103
|
+
|
|
104
|
+
# xAI
|
|
36
105
|
XAI_API_KEY=...
|
|
106
|
+
|
|
107
|
+
# DeepSeek
|
|
37
108
|
DEEPSEEK_API_KEY=...
|
|
109
|
+
|
|
110
|
+
# Ollama (local)
|
|
38
111
|
OLLAMA_BASE_URL=http://localhost:11434
|
|
39
112
|
```
|
|
40
113
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Usage
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
erosolar [options]
|
|
120
|
+
|
|
121
|
+
Options:
|
|
122
|
+
--provider <name> AI provider (openai, anthropic, google, xai, deepseek, ollama)
|
|
123
|
+
--model <name> Specific model to use
|
|
124
|
+
--profile <name> Agent profile (general, erosolar-code)
|
|
125
|
+
--restore Resume last session
|
|
126
|
+
--version Show version
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Agent Profiles
|
|
132
|
+
|
|
133
|
+
Erosolar CLI supports multiple agent profiles optimized for different tasks:
|
|
134
|
+
|
|
135
|
+
- **`erosolar-code`**: Coding specialist optimized for fast, deterministic edits
|
|
136
|
+
- **`general`**: General-purpose agent for research and analysis
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Development Status
|
|
141
|
+
|
|
142
|
+
Erosolar CLI is actively being developed to achieve production readiness. Current focus areas include:
|
|
143
|
+
|
|
144
|
+
- ✅ Multi-provider AI support
|
|
145
|
+
- ✅ Advanced code intelligence
|
|
146
|
+
- ✅ Security research capabilities
|
|
147
|
+
- 🔄 Performance optimization
|
|
148
|
+
- 🔄 Enterprise features
|
|
149
|
+
- 🔄 Enhanced reliability
|
|
150
|
+
|
|
151
|
+
See [CRITICAL_ENHANCEMENTS.md](./CRITICAL_ENHANCEMENTS.md) for detailed roadmap.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## License
|
|
156
|
+
|
|
157
|
+
MIT
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Links
|
|
162
|
+
|
|
163
|
+
- [npm Package](https://www.npmjs.com/package/erosolar-cli)
|
|
164
|
+
- [GitHub](https://github.com/ErosolarAI/erosolar-by-bo)
|
|
165
|
+
- [Issues](https://github.com/ErosolarAI/erosolar-by-bo/issues)
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Author
|
|
170
|
+
|
|
171
|
+
Built by **Bo Shang** with assistance from Claude Code and OpenAI Codex CLI. A special thanks goes to Samantha Briasco-Stewart (erosolar) for motivating Bo to code.
|
|
48
172
|
|
|
49
|
-
|
|
173
|
+
And an apology to Samantha for all of Bo's mistakes.
|
|
@@ -0,0 +1,84 @@
|
|
|
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 type { AgentRuntime } from '../core/agent.js';
|
|
11
|
+
import type { AgentPerformanceMetrics, ExecutionTrace, ImprovementSuggestion } from './types.js';
|
|
12
|
+
export interface AlphaZeroAgentOptions {
|
|
13
|
+
agent: AgentRuntime;
|
|
14
|
+
agentId?: string;
|
|
15
|
+
enableIntrospection?: boolean;
|
|
16
|
+
enableCodeEvaluation?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Wrapper around AgentRuntime that adds Alpha Zero 2 capabilities.
|
|
20
|
+
*
|
|
21
|
+
* Provides:
|
|
22
|
+
* - Performance introspection
|
|
23
|
+
* - Code quality evaluation
|
|
24
|
+
* - Competitive metrics tracking
|
|
25
|
+
* - Self-improvement suggestions
|
|
26
|
+
*/
|
|
27
|
+
export declare class AlphaZeroAgentWrapper {
|
|
28
|
+
private readonly agent;
|
|
29
|
+
private readonly agentId;
|
|
30
|
+
private readonly enableIntrospection;
|
|
31
|
+
private readonly enableCodeEvaluation;
|
|
32
|
+
private readonly metricsTracker;
|
|
33
|
+
private currentTraceId;
|
|
34
|
+
constructor(options: AlphaZeroAgentOptions);
|
|
35
|
+
/**
|
|
36
|
+
* Send a message with performance tracking.
|
|
37
|
+
*/
|
|
38
|
+
send(text: string, useStreaming?: boolean): Promise<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Evaluate code quality in a response.
|
|
41
|
+
*/
|
|
42
|
+
private evaluateResponseCode;
|
|
43
|
+
/**
|
|
44
|
+
* Record a tool call result.
|
|
45
|
+
*/
|
|
46
|
+
recordToolCall(success: boolean): void;
|
|
47
|
+
/**
|
|
48
|
+
* Get current performance metrics.
|
|
49
|
+
*/
|
|
50
|
+
getMetrics(): AgentPerformanceMetrics;
|
|
51
|
+
/**
|
|
52
|
+
* Get human-readable performance summary.
|
|
53
|
+
*/
|
|
54
|
+
getPerformanceSummary(): string;
|
|
55
|
+
/**
|
|
56
|
+
* Get execution traces.
|
|
57
|
+
*/
|
|
58
|
+
getTraces(): ExecutionTrace[];
|
|
59
|
+
/**
|
|
60
|
+
* Get improvement suggestions based on metrics.
|
|
61
|
+
*/
|
|
62
|
+
getImprovementSuggestions(): ImprovementSuggestion[];
|
|
63
|
+
/**
|
|
64
|
+
* Get metrics as a dictionary for serialization.
|
|
65
|
+
*/
|
|
66
|
+
getMetricsDict(): Record<string, unknown>;
|
|
67
|
+
/**
|
|
68
|
+
* Reset all metrics.
|
|
69
|
+
*/
|
|
70
|
+
resetMetrics(): void;
|
|
71
|
+
/**
|
|
72
|
+
* Get the underlying agent runtime.
|
|
73
|
+
*/
|
|
74
|
+
getAgent(): AgentRuntime;
|
|
75
|
+
/**
|
|
76
|
+
* Get the agent ID.
|
|
77
|
+
*/
|
|
78
|
+
getAgentId(): string;
|
|
79
|
+
/**
|
|
80
|
+
* Evaluate a single code snippet and return a reward score.
|
|
81
|
+
*/
|
|
82
|
+
evaluateCode(code: string): number;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=agentWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentWrapper.d.ts","sourceRoot":"","sources":["../../src/alpha-zero/agentWrapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EACV,uBAAuB,EACvB,cAAc,EACd,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAIpB,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;GAQG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAU;IAC9C,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAU;IAC/C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,cAAc,CAAK;gBAEf,OAAO,EAAE,qBAAqB;IAQ1C;;OAEG;IACG,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAsC/D;;OAEG;YACW,oBAAoB;IAmBlC;;OAEG;IACH,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAItC;;OAEG;IACH,UAAU,IAAI,uBAAuB;IAIrC;;OAEG;IACH,qBAAqB,IAAI,MAAM;IAI/B;;OAEG;IACH,SAAS,IAAI,cAAc,EAAE;IAI7B;;OAEG;IACH,yBAAyB,IAAI,qBAAqB,EAAE;IAIpD;;OAEG;IACH,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAsBzC;;OAEG;IACH,YAAY,IAAI,IAAI;IAIpB;;OAEG;IACH,QAAQ,IAAI,YAAY;IAIxB;;OAEG;IACH,UAAU,IAAI,MAAM;IAIpB;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAInC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
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
|
+
agent;
|
|
23
|
+
agentId;
|
|
24
|
+
enableIntrospection;
|
|
25
|
+
enableCodeEvaluation;
|
|
26
|
+
metricsTracker;
|
|
27
|
+
currentTraceId = 0;
|
|
28
|
+
constructor(options) {
|
|
29
|
+
this.agent = options.agent;
|
|
30
|
+
this.agentId = options.agentId ?? 'agent';
|
|
31
|
+
this.enableIntrospection = options.enableIntrospection ?? true;
|
|
32
|
+
this.enableCodeEvaluation = options.enableCodeEvaluation ?? true;
|
|
33
|
+
this.metricsTracker = new MetricsTracker(this.agentId);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Send a message with performance tracking.
|
|
37
|
+
*/
|
|
38
|
+
async send(text, useStreaming = false) {
|
|
39
|
+
const startTime = Date.now();
|
|
40
|
+
const traceId = `trace-${this.currentTraceId++}`;
|
|
41
|
+
const toolCalls = [];
|
|
42
|
+
try {
|
|
43
|
+
const response = await this.agent.send(text, useStreaming);
|
|
44
|
+
const elapsedMs = Date.now() - startTime;
|
|
45
|
+
// Track metrics
|
|
46
|
+
this.metricsTracker.recordMessage(elapsedMs);
|
|
47
|
+
// Evaluate code quality if response contains code
|
|
48
|
+
if (this.enableCodeEvaluation && response.includes('```')) {
|
|
49
|
+
await this.evaluateResponseCode(response);
|
|
50
|
+
}
|
|
51
|
+
// Add execution trace if introspection is enabled
|
|
52
|
+
if (this.enableIntrospection) {
|
|
53
|
+
const trace = {
|
|
54
|
+
traceId,
|
|
55
|
+
timestamp: new Date().toISOString(),
|
|
56
|
+
prompt: text,
|
|
57
|
+
response,
|
|
58
|
+
toolCalls,
|
|
59
|
+
totalDurationMs: elapsedMs,
|
|
60
|
+
};
|
|
61
|
+
this.metricsTracker.addTrace(trace);
|
|
62
|
+
}
|
|
63
|
+
return response;
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
const elapsedMs = Date.now() - startTime;
|
|
67
|
+
this.metricsTracker.recordMessage(elapsedMs);
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Evaluate code quality in a response.
|
|
73
|
+
*/
|
|
74
|
+
async evaluateResponseCode(response) {
|
|
75
|
+
const codeBlocks = extractCodeBlocks(response);
|
|
76
|
+
if (codeBlocks.length === 0) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
this.metricsTracker.recordCodeGeneration(codeBlocks.length);
|
|
80
|
+
// Evaluate each code block
|
|
81
|
+
for (const code of codeBlocks) {
|
|
82
|
+
try {
|
|
83
|
+
const metrics = evaluateCodeQuality(code);
|
|
84
|
+
this.metricsTracker.recordCodeQuality(metrics);
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
// Ignore evaluation errors
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Record a tool call result.
|
|
93
|
+
*/
|
|
94
|
+
recordToolCall(success) {
|
|
95
|
+
this.metricsTracker.recordToolCall(success);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Get current performance metrics.
|
|
99
|
+
*/
|
|
100
|
+
getMetrics() {
|
|
101
|
+
return this.metricsTracker.getMetrics();
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Get human-readable performance summary.
|
|
105
|
+
*/
|
|
106
|
+
getPerformanceSummary() {
|
|
107
|
+
return this.metricsTracker.getPerformanceSummary();
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Get execution traces.
|
|
111
|
+
*/
|
|
112
|
+
getTraces() {
|
|
113
|
+
return this.metricsTracker.getTraces();
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Get improvement suggestions based on metrics.
|
|
117
|
+
*/
|
|
118
|
+
getImprovementSuggestions() {
|
|
119
|
+
return this.metricsTracker.getImprovementSuggestions();
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get metrics as a dictionary for serialization.
|
|
123
|
+
*/
|
|
124
|
+
getMetricsDict() {
|
|
125
|
+
const metrics = this.metricsTracker.getMetrics();
|
|
126
|
+
return {
|
|
127
|
+
sessionId: metrics.sessionId,
|
|
128
|
+
totalMessages: metrics.totalMessages,
|
|
129
|
+
totalTimeMs: metrics.totalTimeMs,
|
|
130
|
+
avgResponseTimeMs: metrics.avgResponseTimeMs,
|
|
131
|
+
codeBlocksGenerated: metrics.codeBlocksGenerated,
|
|
132
|
+
tokenUsage: metrics.totalTokensUsed,
|
|
133
|
+
toolUsage: {
|
|
134
|
+
totalCalls: metrics.totalToolCalls,
|
|
135
|
+
successfulCalls: metrics.successfulToolCalls,
|
|
136
|
+
failedCalls: metrics.failedToolCalls,
|
|
137
|
+
},
|
|
138
|
+
codeQuality: {
|
|
139
|
+
qualityScore: metrics.avgCodeQuality,
|
|
140
|
+
algorithmEfficiency: metrics.avgAlgorithmEfficiency,
|
|
141
|
+
errorHandling: metrics.avgErrorHandling,
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Reset all metrics.
|
|
147
|
+
*/
|
|
148
|
+
resetMetrics() {
|
|
149
|
+
this.metricsTracker.reset();
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Get the underlying agent runtime.
|
|
153
|
+
*/
|
|
154
|
+
getAgent() {
|
|
155
|
+
return this.agent;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Get the agent ID.
|
|
159
|
+
*/
|
|
160
|
+
getAgentId() {
|
|
161
|
+
return this.agentId;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Evaluate a single code snippet and return a reward score.
|
|
165
|
+
*/
|
|
166
|
+
evaluateCode(code) {
|
|
167
|
+
const metrics = evaluateCodeQuality(code);
|
|
168
|
+
return calculateRewardScore(metrics);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=agentWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentWrapper.js","sourceRoot":"","sources":["../../src/alpha-zero/agentWrapper.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Alpha Zero 2 - Code Evaluator
|
|
3
|
+
*
|
|
4
|
+
* AST-based code quality evaluation for generated code.
|
|
5
|
+
*
|
|
6
|
+
* Principal Investigator: Bo Shang
|
|
7
|
+
* Framework: erosolar-cli
|
|
8
|
+
*/
|
|
9
|
+
import type { CodeQualityMetrics } from './types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Extract code blocks from a response string.
|
|
12
|
+
*/
|
|
13
|
+
export declare function extractCodeBlocks(response: string): string[];
|
|
14
|
+
/**
|
|
15
|
+
* Evaluate code quality metrics.
|
|
16
|
+
*
|
|
17
|
+
* This is a heuristic-based evaluation that analyzes code patterns.
|
|
18
|
+
* For production use, consider integrating actual AST parsers.
|
|
19
|
+
*/
|
|
20
|
+
export declare function evaluateCodeQuality(code: string): CodeQualityMetrics;
|
|
21
|
+
/**
|
|
22
|
+
* Calculate a composite reward score from metrics.
|
|
23
|
+
*/
|
|
24
|
+
export declare function calculateRewardScore(metrics: CodeQualityMetrics): number;
|
|
25
|
+
//# sourceMappingURL=codeEvaluator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codeEvaluator.d.ts","sourceRoot":"","sources":["../../src/alpha-zero/codeEvaluator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAa5D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAoBpE;AAkQD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAkBxE"}
|