erosolar-cli 1.7.262 → 1.7.263

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.
Files changed (283) hide show
  1. package/README.md +148 -22
  2. package/dist/alpha-zero/agentWrapper.d.ts +84 -0
  3. package/dist/alpha-zero/agentWrapper.d.ts.map +1 -0
  4. package/dist/alpha-zero/agentWrapper.js +171 -0
  5. package/dist/alpha-zero/agentWrapper.js.map +1 -0
  6. package/dist/alpha-zero/codeEvaluator.d.ts +25 -0
  7. package/dist/alpha-zero/codeEvaluator.d.ts.map +1 -0
  8. package/dist/alpha-zero/codeEvaluator.js +273 -0
  9. package/dist/alpha-zero/codeEvaluator.js.map +1 -0
  10. package/dist/alpha-zero/competitiveRunner.d.ts +66 -0
  11. package/dist/alpha-zero/competitiveRunner.d.ts.map +1 -0
  12. package/dist/alpha-zero/competitiveRunner.js +224 -0
  13. package/dist/alpha-zero/competitiveRunner.js.map +1 -0
  14. package/dist/alpha-zero/index.d.ts +67 -0
  15. package/dist/alpha-zero/index.d.ts.map +1 -0
  16. package/dist/alpha-zero/index.js +99 -0
  17. package/dist/alpha-zero/index.js.map +1 -0
  18. package/dist/alpha-zero/introspection.d.ts +128 -0
  19. package/dist/alpha-zero/introspection.d.ts.map +1 -0
  20. package/dist/alpha-zero/introspection.js +300 -0
  21. package/dist/alpha-zero/introspection.js.map +1 -0
  22. package/dist/alpha-zero/metricsTracker.d.ts +71 -0
  23. package/dist/alpha-zero/metricsTracker.d.ts.map +1 -0
  24. package/dist/{core → alpha-zero}/metricsTracker.js +5 -2
  25. package/dist/alpha-zero/metricsTracker.js.map +1 -0
  26. package/dist/alpha-zero/security/core.d.ts +125 -0
  27. package/dist/alpha-zero/security/core.d.ts.map +1 -0
  28. package/dist/alpha-zero/security/core.js +271 -0
  29. package/dist/alpha-zero/security/core.js.map +1 -0
  30. package/dist/alpha-zero/security/google.d.ts +125 -0
  31. package/dist/alpha-zero/security/google.d.ts.map +1 -0
  32. package/dist/alpha-zero/security/google.js +311 -0
  33. package/dist/alpha-zero/security/google.js.map +1 -0
  34. package/dist/alpha-zero/security/googleLoader.d.ts +17 -0
  35. package/dist/alpha-zero/security/googleLoader.d.ts.map +1 -0
  36. package/dist/alpha-zero/security/googleLoader.js +41 -0
  37. package/dist/alpha-zero/security/googleLoader.js.map +1 -0
  38. package/dist/alpha-zero/security/index.d.ts +29 -0
  39. package/dist/alpha-zero/security/index.d.ts.map +1 -0
  40. package/dist/alpha-zero/security/index.js +32 -0
  41. package/dist/alpha-zero/security/index.js.map +1 -0
  42. package/dist/alpha-zero/security/simulation.d.ts +124 -0
  43. package/dist/alpha-zero/security/simulation.d.ts.map +1 -0
  44. package/dist/alpha-zero/security/simulation.js +277 -0
  45. package/dist/alpha-zero/security/simulation.js.map +1 -0
  46. package/dist/alpha-zero/selfModification.d.ts +109 -0
  47. package/dist/alpha-zero/selfModification.d.ts.map +1 -0
  48. package/dist/alpha-zero/selfModification.js +233 -0
  49. package/dist/alpha-zero/selfModification.js.map +1 -0
  50. package/dist/alpha-zero/types.d.ts +170 -0
  51. package/dist/alpha-zero/types.d.ts.map +1 -0
  52. package/dist/alpha-zero/types.js +31 -0
  53. package/dist/alpha-zero/types.js.map +1 -0
  54. package/dist/capabilities/securityTestingCapability.d.ts +13 -0
  55. package/dist/capabilities/securityTestingCapability.d.ts.map +1 -0
  56. package/dist/capabilities/securityTestingCapability.js +25 -0
  57. package/dist/capabilities/securityTestingCapability.js.map +1 -0
  58. package/dist/contracts/agent-schemas.json +15 -0
  59. package/dist/contracts/tools.schema.json +9 -0
  60. package/dist/core/aiFlowOptimizer.d.ts +26 -0
  61. package/dist/core/aiFlowOptimizer.d.ts.map +1 -0
  62. package/dist/core/aiFlowOptimizer.js +31 -0
  63. package/dist/core/aiFlowOptimizer.js.map +1 -0
  64. package/dist/core/aiOptimizationEngine.d.ts +158 -0
  65. package/dist/core/aiOptimizationEngine.d.ts.map +1 -0
  66. package/dist/core/aiOptimizationEngine.js +428 -0
  67. package/dist/core/aiOptimizationEngine.js.map +1 -0
  68. package/dist/core/aiOptimizationIntegration.d.ts +93 -0
  69. package/dist/core/aiOptimizationIntegration.d.ts.map +1 -0
  70. package/dist/core/aiOptimizationIntegration.js +250 -0
  71. package/dist/core/aiOptimizationIntegration.js.map +1 -0
  72. package/dist/core/customCommands.d.ts +0 -1
  73. package/dist/core/customCommands.d.ts.map +1 -1
  74. package/dist/core/customCommands.js +0 -3
  75. package/dist/core/customCommands.js.map +1 -1
  76. package/dist/core/enhancedErrorRecovery.d.ts +100 -0
  77. package/dist/core/enhancedErrorRecovery.d.ts.map +1 -0
  78. package/dist/core/enhancedErrorRecovery.js +345 -0
  79. package/dist/core/enhancedErrorRecovery.js.map +1 -0
  80. package/dist/core/hooksSystem.d.ts +65 -0
  81. package/dist/core/hooksSystem.d.ts.map +1 -0
  82. package/dist/core/hooksSystem.js +273 -0
  83. package/dist/core/hooksSystem.js.map +1 -0
  84. package/dist/core/memorySystem.d.ts +48 -0
  85. package/dist/core/memorySystem.d.ts.map +1 -0
  86. package/dist/core/memorySystem.js +271 -0
  87. package/dist/core/memorySystem.js.map +1 -0
  88. package/dist/core/toolPreconditions.d.ts.map +1 -1
  89. package/dist/core/toolPreconditions.js +14 -0
  90. package/dist/core/toolPreconditions.js.map +1 -1
  91. package/dist/core/toolRuntime.d.ts.map +1 -1
  92. package/dist/core/toolRuntime.js +5 -0
  93. package/dist/core/toolRuntime.js.map +1 -1
  94. package/dist/core/toolValidation.d.ts.map +1 -1
  95. package/dist/core/toolValidation.js +3 -14
  96. package/dist/core/toolValidation.js.map +1 -1
  97. package/dist/core/unified/errors.d.ts +189 -0
  98. package/dist/core/unified/errors.d.ts.map +1 -0
  99. package/dist/core/unified/errors.js +497 -0
  100. package/dist/core/unified/errors.js.map +1 -0
  101. package/dist/core/unified/index.d.ts +19 -0
  102. package/dist/core/unified/index.d.ts.map +1 -0
  103. package/dist/core/unified/index.js +68 -0
  104. package/dist/core/unified/index.js.map +1 -0
  105. package/dist/core/unified/schema.d.ts +101 -0
  106. package/dist/core/unified/schema.d.ts.map +1 -0
  107. package/dist/core/unified/schema.js +350 -0
  108. package/dist/core/unified/schema.js.map +1 -0
  109. package/dist/core/unified/toolRuntime.d.ts +179 -0
  110. package/dist/core/unified/toolRuntime.d.ts.map +1 -0
  111. package/dist/core/unified/toolRuntime.js +517 -0
  112. package/dist/core/unified/toolRuntime.js.map +1 -0
  113. package/dist/core/unified/tools.d.ts +127 -0
  114. package/dist/core/unified/tools.d.ts.map +1 -0
  115. package/dist/core/unified/tools.js +1333 -0
  116. package/dist/core/unified/tools.js.map +1 -0
  117. package/dist/core/unified/types.d.ts +352 -0
  118. package/dist/core/unified/types.d.ts.map +1 -0
  119. package/dist/core/unified/types.js +12 -0
  120. package/dist/core/unified/types.js.map +1 -0
  121. package/dist/core/unified/version.d.ts +209 -0
  122. package/dist/core/unified/version.d.ts.map +1 -0
  123. package/dist/core/unified/version.js +454 -0
  124. package/dist/core/unified/version.js.map +1 -0
  125. package/dist/core/validationRunner.d.ts +3 -1
  126. package/dist/core/validationRunner.d.ts.map +1 -1
  127. package/dist/core/validationRunner.js.map +1 -1
  128. package/dist/mcp/sseClient.d.ts.map +1 -1
  129. package/dist/mcp/sseClient.js +18 -9
  130. package/dist/mcp/sseClient.js.map +1 -1
  131. package/dist/plugins/tools/build/buildPlugin.d.ts +6 -0
  132. package/dist/plugins/tools/build/buildPlugin.d.ts.map +1 -1
  133. package/dist/plugins/tools/build/buildPlugin.js +10 -4
  134. package/dist/plugins/tools/build/buildPlugin.js.map +1 -1
  135. package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
  136. package/dist/plugins/tools/nodeDefaults.js +2 -0
  137. package/dist/plugins/tools/nodeDefaults.js.map +1 -1
  138. package/dist/plugins/tools/security/securityPlugin.d.ts +3 -0
  139. package/dist/plugins/tools/security/securityPlugin.d.ts.map +1 -0
  140. package/dist/plugins/tools/security/securityPlugin.js +12 -0
  141. package/dist/plugins/tools/security/securityPlugin.js.map +1 -0
  142. package/dist/security/active-stack-security.d.ts +112 -0
  143. package/dist/security/active-stack-security.d.ts.map +1 -0
  144. package/dist/security/active-stack-security.js +296 -0
  145. package/dist/security/active-stack-security.js.map +1 -0
  146. package/dist/security/advanced-persistence-research.d.ts +92 -0
  147. package/dist/security/advanced-persistence-research.d.ts.map +1 -0
  148. package/dist/security/advanced-persistence-research.js +195 -0
  149. package/dist/security/advanced-persistence-research.js.map +1 -0
  150. package/dist/security/advanced-targeting.d.ts +119 -0
  151. package/dist/security/advanced-targeting.d.ts.map +1 -0
  152. package/dist/security/advanced-targeting.js +233 -0
  153. package/dist/security/advanced-targeting.js.map +1 -0
  154. package/dist/security/assessment/vulnerabilityAssessment.d.ts +104 -0
  155. package/dist/security/assessment/vulnerabilityAssessment.d.ts.map +1 -0
  156. package/dist/security/assessment/vulnerabilityAssessment.js +315 -0
  157. package/dist/security/assessment/vulnerabilityAssessment.js.map +1 -0
  158. package/dist/security/authorization/securityAuthorization.d.ts +88 -0
  159. package/dist/security/authorization/securityAuthorization.d.ts.map +1 -0
  160. package/dist/security/authorization/securityAuthorization.js +172 -0
  161. package/dist/security/authorization/securityAuthorization.js.map +1 -0
  162. package/dist/security/comprehensive-targeting.d.ts +85 -0
  163. package/dist/security/comprehensive-targeting.d.ts.map +1 -0
  164. package/dist/security/comprehensive-targeting.js +438 -0
  165. package/dist/security/comprehensive-targeting.js.map +1 -0
  166. package/dist/security/global-security-integration.d.ts +91 -0
  167. package/dist/security/global-security-integration.d.ts.map +1 -0
  168. package/dist/security/global-security-integration.js +218 -0
  169. package/dist/security/global-security-integration.js.map +1 -0
  170. package/dist/security/index.d.ts +38 -0
  171. package/dist/security/index.d.ts.map +1 -0
  172. package/dist/security/index.js +47 -0
  173. package/dist/security/index.js.map +1 -0
  174. package/dist/security/persistence-analyzer.d.ts +56 -0
  175. package/dist/security/persistence-analyzer.d.ts.map +1 -0
  176. package/dist/security/persistence-analyzer.js +187 -0
  177. package/dist/security/persistence-analyzer.js.map +1 -0
  178. package/dist/security/persistence-cli.d.ts +36 -0
  179. package/dist/security/persistence-cli.d.ts.map +1 -0
  180. package/dist/security/persistence-cli.js +160 -0
  181. package/dist/security/persistence-cli.js.map +1 -0
  182. package/dist/security/persistence-research.d.ts +92 -0
  183. package/dist/security/persistence-research.d.ts.map +1 -0
  184. package/dist/security/persistence-research.js +364 -0
  185. package/dist/security/persistence-research.js.map +1 -0
  186. package/dist/security/research/persistenceResearch.d.ts +97 -0
  187. package/dist/security/research/persistenceResearch.d.ts.map +1 -0
  188. package/dist/security/research/persistenceResearch.js +282 -0
  189. package/dist/security/research/persistenceResearch.js.map +1 -0
  190. package/dist/security/security-integration.d.ts +74 -0
  191. package/dist/security/security-integration.d.ts.map +1 -0
  192. package/dist/security/security-integration.js +137 -0
  193. package/dist/security/security-integration.js.map +1 -0
  194. package/dist/security/security-testing-framework.d.ts +112 -0
  195. package/dist/security/security-testing-framework.d.ts.map +1 -0
  196. package/dist/security/security-testing-framework.js +364 -0
  197. package/dist/security/security-testing-framework.js.map +1 -0
  198. package/dist/security/simulation/attackSimulation.d.ts +93 -0
  199. package/dist/security/simulation/attackSimulation.d.ts.map +1 -0
  200. package/dist/security/simulation/attackSimulation.js +341 -0
  201. package/dist/security/simulation/attackSimulation.js.map +1 -0
  202. package/dist/security/strategic-operations.d.ts +100 -0
  203. package/dist/security/strategic-operations.d.ts.map +1 -0
  204. package/dist/security/strategic-operations.js +276 -0
  205. package/dist/security/strategic-operations.js.map +1 -0
  206. package/dist/security/tool-security-wrapper.d.ts +58 -0
  207. package/dist/security/tool-security-wrapper.d.ts.map +1 -0
  208. package/dist/security/tool-security-wrapper.js +156 -0
  209. package/dist/security/tool-security-wrapper.js.map +1 -0
  210. package/dist/shell/claudeCodeStreamHandler.d.ts +145 -0
  211. package/dist/shell/claudeCodeStreamHandler.d.ts.map +1 -0
  212. package/dist/shell/claudeCodeStreamHandler.js +322 -0
  213. package/dist/shell/claudeCodeStreamHandler.js.map +1 -0
  214. package/dist/shell/inputQueueManager.d.ts +144 -0
  215. package/dist/shell/inputQueueManager.d.ts.map +1 -0
  216. package/dist/shell/inputQueueManager.js +290 -0
  217. package/dist/shell/inputQueueManager.js.map +1 -0
  218. package/dist/shell/interactiveShell.d.ts +7 -11
  219. package/dist/shell/interactiveShell.d.ts.map +1 -1
  220. package/dist/shell/interactiveShell.js +153 -190
  221. package/dist/shell/interactiveShell.js.map +1 -1
  222. package/dist/shell/metricsTracker.d.ts +60 -0
  223. package/dist/shell/metricsTracker.d.ts.map +1 -0
  224. package/dist/shell/metricsTracker.js +119 -0
  225. package/dist/shell/metricsTracker.js.map +1 -0
  226. package/dist/shell/shellApp.d.ts +0 -2
  227. package/dist/shell/shellApp.d.ts.map +1 -1
  228. package/dist/shell/shellApp.js +0 -16
  229. package/dist/shell/shellApp.js.map +1 -1
  230. package/dist/shell/streamingOutputManager.d.ts +115 -0
  231. package/dist/shell/streamingOutputManager.d.ts.map +1 -0
  232. package/dist/shell/streamingOutputManager.js +225 -0
  233. package/dist/shell/streamingOutputManager.js.map +1 -0
  234. package/dist/shell/systemPrompt.d.ts.map +1 -1
  235. package/dist/shell/systemPrompt.js +4 -1
  236. package/dist/shell/systemPrompt.js.map +1 -1
  237. package/dist/shell/terminalInput.d.ts +147 -68
  238. package/dist/shell/terminalInput.d.ts.map +1 -1
  239. package/dist/shell/terminalInput.js +689 -451
  240. package/dist/shell/terminalInput.js.map +1 -1
  241. package/dist/shell/terminalInputAdapter.d.ts +20 -20
  242. package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
  243. package/dist/shell/terminalInputAdapter.js +29 -14
  244. package/dist/shell/terminalInputAdapter.js.map +1 -1
  245. package/dist/tools/securityTools.d.ts +22 -0
  246. package/dist/tools/securityTools.d.ts.map +1 -0
  247. package/dist/tools/securityTools.js +448 -0
  248. package/dist/tools/securityTools.js.map +1 -0
  249. package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
  250. package/dist/ui/ShellUIAdapter.js +12 -13
  251. package/dist/ui/ShellUIAdapter.js.map +1 -1
  252. package/dist/ui/display.d.ts +0 -19
  253. package/dist/ui/display.d.ts.map +1 -1
  254. package/dist/ui/display.js +33 -131
  255. package/dist/ui/display.js.map +1 -1
  256. package/dist/ui/persistentPrompt.d.ts +50 -0
  257. package/dist/ui/persistentPrompt.d.ts.map +1 -0
  258. package/dist/ui/persistentPrompt.js +92 -0
  259. package/dist/ui/persistentPrompt.js.map +1 -0
  260. package/dist/ui/terminalUISchema.d.ts +195 -0
  261. package/dist/ui/terminalUISchema.d.ts.map +1 -0
  262. package/dist/ui/terminalUISchema.js +113 -0
  263. package/dist/ui/terminalUISchema.js.map +1 -0
  264. package/dist/ui/theme.d.ts.map +1 -1
  265. package/dist/ui/theme.js +8 -6
  266. package/dist/ui/theme.js.map +1 -1
  267. package/dist/ui/toolDisplay.d.ts +158 -0
  268. package/dist/ui/toolDisplay.d.ts.map +1 -1
  269. package/dist/ui/toolDisplay.js +348 -0
  270. package/dist/ui/toolDisplay.js.map +1 -1
  271. package/dist/ui/unified/layout.d.ts +0 -1
  272. package/dist/ui/unified/layout.d.ts.map +1 -1
  273. package/dist/ui/unified/layout.js +25 -15
  274. package/dist/ui/unified/layout.js.map +1 -1
  275. package/package.json +1 -1
  276. package/scripts/deploy-security-capabilities.js +178 -0
  277. package/dist/core/hooks.d.ts +0 -113
  278. package/dist/core/hooks.d.ts.map +0 -1
  279. package/dist/core/hooks.js +0 -267
  280. package/dist/core/hooks.js.map +0 -1
  281. package/dist/core/metricsTracker.d.ts +0 -122
  282. package/dist/core/metricsTracker.d.ts.map +0 -1
  283. package/dist/core/metricsTracker.js.map +0 -1
package/README.md CHANGED
@@ -1,47 +1,173 @@
1
1
  # erosolar-cli
2
2
 
3
- Unified command-line agent with a single, persistent chat box pinned to the bottom of every session. Output streams scroll above it while the prompt and status controls stay anchored.
3
+ ## AI Coding Agent Comparison
4
4
 
5
- ## Highlights
6
- - One chat box, always on the bottom during the entire session (idle or streaming).
7
- - Shared control bar for status, verify/build toggle, auto-continue, and context gauge.
8
- - Works with OpenAI, Anthropic, Google, xAI, DeepSeek, and local Ollama using the same UI contract.
5
+ | Agent | Screenshot |
6
+ |-------|------------|
7
+ | **Claude Code** | ![Claude](https://erosolar-public-assets.s3.amazonaws.com/images/Claude.png) |
8
+ | **OpenAI Codex CLI** | ![Codex](https://erosolar-public-assets.s3.amazonaws.com/images/Codex.png) |
9
+ | **Erosolar CLI** | ![Erosolar](https://erosolar-public-assets.s3.amazonaws.com/images/Erosolar.png) |
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
9
59
 
10
- ## Install
11
60
  ```bash
12
61
  npm install -g erosolar-cli
13
- # or
62
+ ```
63
+
64
+ Or use npx:
65
+
66
+ ```bash
14
67
  npx erosolar-cli
15
68
  ```
16
69
 
17
- ## Run
70
+ ---
71
+
72
+ ## Quick Start
73
+
18
74
  ```bash
19
- # default profile
75
+ # Basic usage
20
76
  erosolar
21
77
 
22
- # choose model/provider
78
+ # With specific provider and model
23
79
  erosolar --provider openai --model gpt-4o
24
80
 
25
- # restore last session
81
+ # With agent profile
82
+ erosolar --profile erosolar-code
83
+
84
+ # Resume last session
26
85
  erosolar --restore
27
86
  ```
28
87
 
29
- ## Configure
30
- Set the keys you need before launching:
88
+ ---
89
+
90
+ ## Configuration
91
+
92
+ Set your API keys as environment variables:
93
+
31
94
  ```bash
32
- OPENAI_API_KEY=...
33
- ANTHROPIC_API_KEY=...
95
+ # OpenAI
96
+ OPENAI_API_KEY=sk-...
97
+
98
+ # Anthropic
99
+ ANTHROPIC_API_KEY=sk-ant-...
100
+
101
+ # Google AI
34
102
  GOOGLE_API_KEY=...
103
+
104
+ # xAI
35
105
  XAI_API_KEY=...
106
+
107
+ # DeepSeek
36
108
  DEEPSEEK_API_KEY=...
109
+
110
+ # Ollama (local)
37
111
  OLLAMA_BASE_URL=http://localhost:11434
38
112
  ```
39
113
 
40
- ## Options
41
- - `--provider <name>` pick the AI provider
42
- - `--model <name>` choose a model
43
- - `--profile <name>` switch agent profiles (e.g., `erosolar-code`)
44
- - `--restore` resume the previous session
45
- - `--version` show the CLI version
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.
46
172
 
47
- MIT licensed.
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":"AAAA;;;;;;;;GAQG;AAQH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AASlG;;;;;;;;GAQG;AACH,MAAM,OAAO,qBAAqB;IACf,KAAK,CAAe;IACpB,OAAO,CAAS;IAChB,mBAAmB,CAAU;IAC7B,oBAAo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,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"}