erosolar-cli 1.7.326 → 1.7.327

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 (323) hide show
  1. package/README.md +24 -148
  2. package/dist/bin/erosolar.js +5 -21
  3. package/dist/bin/erosolar.js.map +1 -1
  4. package/dist/capabilities/agentSpawningCapability.d.ts.map +1 -1
  5. package/dist/capabilities/agentSpawningCapability.js +56 -31
  6. package/dist/capabilities/agentSpawningCapability.js.map +1 -1
  7. package/dist/contracts/agent-schemas.json +0 -15
  8. package/dist/contracts/tools.schema.json +0 -9
  9. package/dist/core/agent.d.ts +2 -2
  10. package/dist/core/agent.d.ts.map +1 -1
  11. package/dist/core/agent.js.map +1 -1
  12. package/dist/core/customCommands.d.ts +1 -0
  13. package/dist/core/customCommands.d.ts.map +1 -1
  14. package/dist/core/customCommands.js +3 -0
  15. package/dist/core/customCommands.js.map +1 -1
  16. package/dist/core/hooks.d.ts +113 -0
  17. package/dist/core/hooks.d.ts.map +1 -0
  18. package/dist/core/hooks.js +267 -0
  19. package/dist/core/hooks.js.map +1 -0
  20. package/dist/core/metricsTracker.d.ts +122 -0
  21. package/dist/core/metricsTracker.d.ts.map +1 -0
  22. package/dist/{alpha-zero → core}/metricsTracker.js +2 -5
  23. package/dist/core/metricsTracker.js.map +1 -0
  24. package/dist/core/securityAssessment.d.ts +91 -0
  25. package/dist/core/securityAssessment.d.ts.map +1 -0
  26. package/dist/core/securityAssessment.js +580 -0
  27. package/dist/core/securityAssessment.js.map +1 -0
  28. package/dist/core/toolPreconditions.d.ts.map +1 -1
  29. package/dist/core/toolPreconditions.js +0 -14
  30. package/dist/core/toolPreconditions.js.map +1 -1
  31. package/dist/core/toolRuntime.d.ts +22 -1
  32. package/dist/core/toolRuntime.d.ts.map +1 -1
  33. package/dist/core/toolRuntime.js +0 -5
  34. package/dist/core/toolRuntime.js.map +1 -1
  35. package/dist/core/toolValidation.d.ts.map +1 -1
  36. package/dist/core/toolValidation.js +14 -3
  37. package/dist/core/toolValidation.js.map +1 -1
  38. package/dist/core/validationRunner.d.ts +1 -3
  39. package/dist/core/validationRunner.d.ts.map +1 -1
  40. package/dist/core/validationRunner.js.map +1 -1
  41. package/dist/core/verification.d.ts +137 -0
  42. package/dist/core/verification.d.ts.map +1 -0
  43. package/dist/core/verification.js +323 -0
  44. package/dist/core/verification.js.map +1 -0
  45. package/dist/headless/headlessApp.d.ts.map +1 -1
  46. package/dist/headless/headlessApp.js +21 -0
  47. package/dist/headless/headlessApp.js.map +1 -1
  48. package/dist/mcp/sseClient.d.ts.map +1 -1
  49. package/dist/mcp/sseClient.js +9 -18
  50. package/dist/mcp/sseClient.js.map +1 -1
  51. package/dist/plugins/tools/build/buildPlugin.d.ts +0 -6
  52. package/dist/plugins/tools/build/buildPlugin.d.ts.map +1 -1
  53. package/dist/plugins/tools/build/buildPlugin.js +4 -10
  54. package/dist/plugins/tools/build/buildPlugin.js.map +1 -1
  55. package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
  56. package/dist/plugins/tools/nodeDefaults.js +0 -2
  57. package/dist/plugins/tools/nodeDefaults.js.map +1 -1
  58. package/dist/runtime/agentSession.d.ts +2 -2
  59. package/dist/runtime/agentSession.d.ts.map +1 -1
  60. package/dist/runtime/agentSession.js +2 -2
  61. package/dist/runtime/agentSession.js.map +1 -1
  62. package/dist/shell/interactiveShell.d.ts +16 -7
  63. package/dist/shell/interactiveShell.d.ts.map +1 -1
  64. package/dist/shell/interactiveShell.js +235 -164
  65. package/dist/shell/interactiveShell.js.map +1 -1
  66. package/dist/shell/shellApp.d.ts +2 -0
  67. package/dist/shell/shellApp.d.ts.map +1 -1
  68. package/dist/shell/shellApp.js +40 -9
  69. package/dist/shell/shellApp.js.map +1 -1
  70. package/dist/shell/systemPrompt.d.ts.map +1 -1
  71. package/dist/shell/systemPrompt.js +1 -4
  72. package/dist/shell/systemPrompt.js.map +1 -1
  73. package/dist/shell/terminalInput.d.ts +149 -116
  74. package/dist/shell/terminalInput.d.ts.map +1 -1
  75. package/dist/shell/terminalInput.js +639 -521
  76. package/dist/shell/terminalInput.js.map +1 -1
  77. package/dist/shell/terminalInputAdapter.d.ts +79 -20
  78. package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
  79. package/dist/shell/terminalInputAdapter.js +99 -30
  80. package/dist/shell/terminalInputAdapter.js.map +1 -1
  81. package/dist/subagents/agentConfig.d.ts +27 -0
  82. package/dist/subagents/agentConfig.d.ts.map +1 -0
  83. package/dist/subagents/agentConfig.js +89 -0
  84. package/dist/subagents/agentConfig.js.map +1 -0
  85. package/dist/subagents/agentRegistry.d.ts +33 -0
  86. package/dist/subagents/agentRegistry.d.ts.map +1 -0
  87. package/dist/subagents/agentRegistry.js +162 -0
  88. package/dist/subagents/agentRegistry.js.map +1 -0
  89. package/dist/subagents/taskRunner.d.ts +7 -1
  90. package/dist/subagents/taskRunner.d.ts.map +1 -1
  91. package/dist/subagents/taskRunner.js +180 -47
  92. package/dist/subagents/taskRunner.js.map +1 -1
  93. package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
  94. package/dist/ui/ShellUIAdapter.js +13 -12
  95. package/dist/ui/ShellUIAdapter.js.map +1 -1
  96. package/dist/ui/display.d.ts +24 -45
  97. package/dist/ui/display.d.ts.map +1 -1
  98. package/dist/ui/display.js +140 -259
  99. package/dist/ui/display.js.map +1 -1
  100. package/dist/ui/theme.d.ts.map +1 -1
  101. package/dist/ui/theme.js +6 -8
  102. package/dist/ui/theme.js.map +1 -1
  103. package/dist/ui/toolDisplay.d.ts +0 -158
  104. package/dist/ui/toolDisplay.d.ts.map +1 -1
  105. package/dist/ui/toolDisplay.js +0 -348
  106. package/dist/ui/toolDisplay.js.map +1 -1
  107. package/dist/ui/unified/layout.d.ts +1 -0
  108. package/dist/ui/unified/layout.d.ts.map +1 -1
  109. package/dist/ui/unified/layout.js +15 -25
  110. package/dist/ui/unified/layout.js.map +1 -1
  111. package/dist/utils/frontmatter.d.ts +10 -0
  112. package/dist/utils/frontmatter.d.ts.map +1 -0
  113. package/dist/utils/frontmatter.js +78 -0
  114. package/dist/utils/frontmatter.js.map +1 -0
  115. package/package.json +4 -4
  116. package/dist/alpha-zero/agentWrapper.d.ts +0 -84
  117. package/dist/alpha-zero/agentWrapper.d.ts.map +0 -1
  118. package/dist/alpha-zero/agentWrapper.js +0 -171
  119. package/dist/alpha-zero/agentWrapper.js.map +0 -1
  120. package/dist/alpha-zero/codeEvaluator.d.ts +0 -25
  121. package/dist/alpha-zero/codeEvaluator.d.ts.map +0 -1
  122. package/dist/alpha-zero/codeEvaluator.js +0 -273
  123. package/dist/alpha-zero/codeEvaluator.js.map +0 -1
  124. package/dist/alpha-zero/competitiveRunner.d.ts +0 -66
  125. package/dist/alpha-zero/competitiveRunner.d.ts.map +0 -1
  126. package/dist/alpha-zero/competitiveRunner.js +0 -224
  127. package/dist/alpha-zero/competitiveRunner.js.map +0 -1
  128. package/dist/alpha-zero/index.d.ts +0 -67
  129. package/dist/alpha-zero/index.d.ts.map +0 -1
  130. package/dist/alpha-zero/index.js +0 -99
  131. package/dist/alpha-zero/index.js.map +0 -1
  132. package/dist/alpha-zero/introspection.d.ts +0 -128
  133. package/dist/alpha-zero/introspection.d.ts.map +0 -1
  134. package/dist/alpha-zero/introspection.js +0 -300
  135. package/dist/alpha-zero/introspection.js.map +0 -1
  136. package/dist/alpha-zero/metricsTracker.d.ts +0 -71
  137. package/dist/alpha-zero/metricsTracker.d.ts.map +0 -1
  138. package/dist/alpha-zero/metricsTracker.js.map +0 -1
  139. package/dist/alpha-zero/security/core.d.ts +0 -125
  140. package/dist/alpha-zero/security/core.d.ts.map +0 -1
  141. package/dist/alpha-zero/security/core.js +0 -271
  142. package/dist/alpha-zero/security/core.js.map +0 -1
  143. package/dist/alpha-zero/security/google.d.ts +0 -125
  144. package/dist/alpha-zero/security/google.d.ts.map +0 -1
  145. package/dist/alpha-zero/security/google.js +0 -311
  146. package/dist/alpha-zero/security/google.js.map +0 -1
  147. package/dist/alpha-zero/security/googleLoader.d.ts +0 -17
  148. package/dist/alpha-zero/security/googleLoader.d.ts.map +0 -1
  149. package/dist/alpha-zero/security/googleLoader.js +0 -41
  150. package/dist/alpha-zero/security/googleLoader.js.map +0 -1
  151. package/dist/alpha-zero/security/index.d.ts +0 -29
  152. package/dist/alpha-zero/security/index.d.ts.map +0 -1
  153. package/dist/alpha-zero/security/index.js +0 -32
  154. package/dist/alpha-zero/security/index.js.map +0 -1
  155. package/dist/alpha-zero/security/simulation.d.ts +0 -124
  156. package/dist/alpha-zero/security/simulation.d.ts.map +0 -1
  157. package/dist/alpha-zero/security/simulation.js +0 -277
  158. package/dist/alpha-zero/security/simulation.js.map +0 -1
  159. package/dist/alpha-zero/selfModification.d.ts +0 -109
  160. package/dist/alpha-zero/selfModification.d.ts.map +0 -1
  161. package/dist/alpha-zero/selfModification.js +0 -233
  162. package/dist/alpha-zero/selfModification.js.map +0 -1
  163. package/dist/alpha-zero/types.d.ts +0 -170
  164. package/dist/alpha-zero/types.d.ts.map +0 -1
  165. package/dist/alpha-zero/types.js +0 -31
  166. package/dist/alpha-zero/types.js.map +0 -1
  167. package/dist/capabilities/securityTestingCapability.d.ts +0 -13
  168. package/dist/capabilities/securityTestingCapability.d.ts.map +0 -1
  169. package/dist/capabilities/securityTestingCapability.js +0 -25
  170. package/dist/capabilities/securityTestingCapability.js.map +0 -1
  171. package/dist/core/aiFlowOptimizer.d.ts +0 -26
  172. package/dist/core/aiFlowOptimizer.d.ts.map +0 -1
  173. package/dist/core/aiFlowOptimizer.js +0 -31
  174. package/dist/core/aiFlowOptimizer.js.map +0 -1
  175. package/dist/core/aiOptimizationEngine.d.ts +0 -158
  176. package/dist/core/aiOptimizationEngine.d.ts.map +0 -1
  177. package/dist/core/aiOptimizationEngine.js +0 -428
  178. package/dist/core/aiOptimizationEngine.js.map +0 -1
  179. package/dist/core/aiOptimizationIntegration.d.ts +0 -93
  180. package/dist/core/aiOptimizationIntegration.d.ts.map +0 -1
  181. package/dist/core/aiOptimizationIntegration.js +0 -250
  182. package/dist/core/aiOptimizationIntegration.js.map +0 -1
  183. package/dist/core/enhancedErrorRecovery.d.ts +0 -100
  184. package/dist/core/enhancedErrorRecovery.d.ts.map +0 -1
  185. package/dist/core/enhancedErrorRecovery.js +0 -345
  186. package/dist/core/enhancedErrorRecovery.js.map +0 -1
  187. package/dist/core/hooksSystem.d.ts +0 -65
  188. package/dist/core/hooksSystem.d.ts.map +0 -1
  189. package/dist/core/hooksSystem.js +0 -273
  190. package/dist/core/hooksSystem.js.map +0 -1
  191. package/dist/core/memorySystem.d.ts +0 -48
  192. package/dist/core/memorySystem.d.ts.map +0 -1
  193. package/dist/core/memorySystem.js +0 -271
  194. package/dist/core/memorySystem.js.map +0 -1
  195. package/dist/core/unified/errors.d.ts +0 -189
  196. package/dist/core/unified/errors.d.ts.map +0 -1
  197. package/dist/core/unified/errors.js +0 -497
  198. package/dist/core/unified/errors.js.map +0 -1
  199. package/dist/core/unified/index.d.ts +0 -19
  200. package/dist/core/unified/index.d.ts.map +0 -1
  201. package/dist/core/unified/index.js +0 -68
  202. package/dist/core/unified/index.js.map +0 -1
  203. package/dist/core/unified/schema.d.ts +0 -101
  204. package/dist/core/unified/schema.d.ts.map +0 -1
  205. package/dist/core/unified/schema.js +0 -350
  206. package/dist/core/unified/schema.js.map +0 -1
  207. package/dist/core/unified/toolRuntime.d.ts +0 -179
  208. package/dist/core/unified/toolRuntime.d.ts.map +0 -1
  209. package/dist/core/unified/toolRuntime.js +0 -517
  210. package/dist/core/unified/toolRuntime.js.map +0 -1
  211. package/dist/core/unified/tools.d.ts +0 -127
  212. package/dist/core/unified/tools.d.ts.map +0 -1
  213. package/dist/core/unified/tools.js +0 -1333
  214. package/dist/core/unified/tools.js.map +0 -1
  215. package/dist/core/unified/types.d.ts +0 -352
  216. package/dist/core/unified/types.d.ts.map +0 -1
  217. package/dist/core/unified/types.js +0 -12
  218. package/dist/core/unified/types.js.map +0 -1
  219. package/dist/core/unified/version.d.ts +0 -209
  220. package/dist/core/unified/version.d.ts.map +0 -1
  221. package/dist/core/unified/version.js +0 -454
  222. package/dist/core/unified/version.js.map +0 -1
  223. package/dist/plugins/tools/security/securityPlugin.d.ts +0 -3
  224. package/dist/plugins/tools/security/securityPlugin.d.ts.map +0 -1
  225. package/dist/plugins/tools/security/securityPlugin.js +0 -12
  226. package/dist/plugins/tools/security/securityPlugin.js.map +0 -1
  227. package/dist/security/active-stack-security.d.ts +0 -112
  228. package/dist/security/active-stack-security.d.ts.map +0 -1
  229. package/dist/security/active-stack-security.js +0 -296
  230. package/dist/security/active-stack-security.js.map +0 -1
  231. package/dist/security/advanced-persistence-research.d.ts +0 -92
  232. package/dist/security/advanced-persistence-research.d.ts.map +0 -1
  233. package/dist/security/advanced-persistence-research.js +0 -195
  234. package/dist/security/advanced-persistence-research.js.map +0 -1
  235. package/dist/security/advanced-targeting.d.ts +0 -119
  236. package/dist/security/advanced-targeting.d.ts.map +0 -1
  237. package/dist/security/advanced-targeting.js +0 -233
  238. package/dist/security/advanced-targeting.js.map +0 -1
  239. package/dist/security/assessment/vulnerabilityAssessment.d.ts +0 -104
  240. package/dist/security/assessment/vulnerabilityAssessment.d.ts.map +0 -1
  241. package/dist/security/assessment/vulnerabilityAssessment.js +0 -315
  242. package/dist/security/assessment/vulnerabilityAssessment.js.map +0 -1
  243. package/dist/security/authorization/securityAuthorization.d.ts +0 -88
  244. package/dist/security/authorization/securityAuthorization.d.ts.map +0 -1
  245. package/dist/security/authorization/securityAuthorization.js +0 -172
  246. package/dist/security/authorization/securityAuthorization.js.map +0 -1
  247. package/dist/security/comprehensive-targeting.d.ts +0 -85
  248. package/dist/security/comprehensive-targeting.d.ts.map +0 -1
  249. package/dist/security/comprehensive-targeting.js +0 -438
  250. package/dist/security/comprehensive-targeting.js.map +0 -1
  251. package/dist/security/global-security-integration.d.ts +0 -91
  252. package/dist/security/global-security-integration.d.ts.map +0 -1
  253. package/dist/security/global-security-integration.js +0 -218
  254. package/dist/security/global-security-integration.js.map +0 -1
  255. package/dist/security/index.d.ts +0 -38
  256. package/dist/security/index.d.ts.map +0 -1
  257. package/dist/security/index.js +0 -47
  258. package/dist/security/index.js.map +0 -1
  259. package/dist/security/persistence-analyzer.d.ts +0 -56
  260. package/dist/security/persistence-analyzer.d.ts.map +0 -1
  261. package/dist/security/persistence-analyzer.js +0 -187
  262. package/dist/security/persistence-analyzer.js.map +0 -1
  263. package/dist/security/persistence-cli.d.ts +0 -36
  264. package/dist/security/persistence-cli.d.ts.map +0 -1
  265. package/dist/security/persistence-cli.js +0 -160
  266. package/dist/security/persistence-cli.js.map +0 -1
  267. package/dist/security/persistence-research.d.ts +0 -92
  268. package/dist/security/persistence-research.d.ts.map +0 -1
  269. package/dist/security/persistence-research.js +0 -364
  270. package/dist/security/persistence-research.js.map +0 -1
  271. package/dist/security/research/persistenceResearch.d.ts +0 -97
  272. package/dist/security/research/persistenceResearch.d.ts.map +0 -1
  273. package/dist/security/research/persistenceResearch.js +0 -282
  274. package/dist/security/research/persistenceResearch.js.map +0 -1
  275. package/dist/security/security-integration.d.ts +0 -74
  276. package/dist/security/security-integration.d.ts.map +0 -1
  277. package/dist/security/security-integration.js +0 -137
  278. package/dist/security/security-integration.js.map +0 -1
  279. package/dist/security/security-testing-framework.d.ts +0 -112
  280. package/dist/security/security-testing-framework.d.ts.map +0 -1
  281. package/dist/security/security-testing-framework.js +0 -364
  282. package/dist/security/security-testing-framework.js.map +0 -1
  283. package/dist/security/simulation/attackSimulation.d.ts +0 -93
  284. package/dist/security/simulation/attackSimulation.d.ts.map +0 -1
  285. package/dist/security/simulation/attackSimulation.js +0 -341
  286. package/dist/security/simulation/attackSimulation.js.map +0 -1
  287. package/dist/security/strategic-operations.d.ts +0 -100
  288. package/dist/security/strategic-operations.d.ts.map +0 -1
  289. package/dist/security/strategic-operations.js +0 -276
  290. package/dist/security/strategic-operations.js.map +0 -1
  291. package/dist/security/tool-security-wrapper.d.ts +0 -58
  292. package/dist/security/tool-security-wrapper.d.ts.map +0 -1
  293. package/dist/security/tool-security-wrapper.js +0 -156
  294. package/dist/security/tool-security-wrapper.js.map +0 -1
  295. package/dist/shell/claudeCodeStreamHandler.d.ts +0 -145
  296. package/dist/shell/claudeCodeStreamHandler.d.ts.map +0 -1
  297. package/dist/shell/claudeCodeStreamHandler.js +0 -322
  298. package/dist/shell/claudeCodeStreamHandler.js.map +0 -1
  299. package/dist/shell/inputQueueManager.d.ts +0 -144
  300. package/dist/shell/inputQueueManager.d.ts.map +0 -1
  301. package/dist/shell/inputQueueManager.js +0 -290
  302. package/dist/shell/inputQueueManager.js.map +0 -1
  303. package/dist/shell/metricsTracker.d.ts +0 -60
  304. package/dist/shell/metricsTracker.d.ts.map +0 -1
  305. package/dist/shell/metricsTracker.js +0 -119
  306. package/dist/shell/metricsTracker.js.map +0 -1
  307. package/dist/shell/streamingOutputManager.d.ts +0 -115
  308. package/dist/shell/streamingOutputManager.d.ts.map +0 -1
  309. package/dist/shell/streamingOutputManager.js +0 -225
  310. package/dist/shell/streamingOutputManager.js.map +0 -1
  311. package/dist/tools/securityTools.d.ts +0 -22
  312. package/dist/tools/securityTools.d.ts.map +0 -1
  313. package/dist/tools/securityTools.js +0 -448
  314. package/dist/tools/securityTools.js.map +0 -1
  315. package/dist/ui/persistentPrompt.d.ts +0 -50
  316. package/dist/ui/persistentPrompt.d.ts.map +0 -1
  317. package/dist/ui/persistentPrompt.js +0 -92
  318. package/dist/ui/persistentPrompt.js.map +0 -1
  319. package/dist/ui/terminalUISchema.d.ts +0 -195
  320. package/dist/ui/terminalUISchema.d.ts.map +0 -1
  321. package/dist/ui/terminalUISchema.js +0 -113
  322. package/dist/ui/terminalUISchema.js.map +0 -1
  323. package/scripts/deploy-security-capabilities.js +0 -178
@@ -1,170 +0,0 @@
1
- /**
2
- * Alpha Zero 2 - Type Definitions
3
- *
4
- * Core type definitions for the competitive multi-agent RL framework.
5
- *
6
- * Principal Investigator: Bo Shang
7
- * Framework: erosolar-cli
8
- */
9
- import type { ProviderId, ProviderUsage } from '../core/types.js';
10
- /**
11
- * Performance metrics for an agent session.
12
- */
13
- export interface AgentPerformanceMetrics {
14
- sessionId: string;
15
- totalMessages: number;
16
- totalToolCalls: number;
17
- totalTokensUsed: number;
18
- totalTimeMs: number;
19
- successfulToolCalls: number;
20
- failedToolCalls: number;
21
- codeBlocksGenerated: number;
22
- avgResponseTimeMs: number;
23
- avgCodeQuality: number;
24
- avgAlgorithmEfficiency: number;
25
- avgErrorHandling: number;
26
- }
27
- /**
28
- * Configuration for a competitive agent.
29
- */
30
- export interface CompetitiveAgentConfig {
31
- agentId: string;
32
- provider: ProviderId;
33
- model: string;
34
- systemPrompt: string;
35
- competitivePromptSuffix?: string;
36
- }
37
- /**
38
- * Result of a single competition round.
39
- */
40
- export interface CompetitionRoundResult {
41
- prompt: string;
42
- agent1: {
43
- id: string;
44
- score: number;
45
- responseLength: number;
46
- timeMs: number;
47
- error?: string;
48
- };
49
- agent2: {
50
- id: string;
51
- score: number;
52
- responseLength: number;
53
- timeMs: number;
54
- error?: string;
55
- };
56
- winner: string;
57
- totalTimeMs: number;
58
- }
59
- /**
60
- * Competition standings between two agents.
61
- */
62
- export interface CompetitionStandings {
63
- totalRounds: number;
64
- agent1: {
65
- id: string;
66
- wins: number;
67
- winRate: number;
68
- };
69
- agent2: {
70
- id: string;
71
- wins: number;
72
- winRate: number;
73
- };
74
- ties: number;
75
- }
76
- /**
77
- * Code quality evaluation result.
78
- */
79
- export interface CodeQualityMetrics {
80
- codeQualityScore: number;
81
- algorithmEfficiency: number;
82
- errorHandlingScore: number;
83
- documentationScore: number;
84
- maintainabilityScore: number;
85
- securityScore: number;
86
- }
87
- /**
88
- * Introspection trace for a single execution.
89
- */
90
- export interface ExecutionTrace {
91
- traceId: string;
92
- timestamp: string;
93
- prompt: string;
94
- response: string;
95
- toolCalls: Array<{
96
- name: string;
97
- arguments: Record<string, unknown>;
98
- result?: string;
99
- error?: string;
100
- durationMs: number;
101
- }>;
102
- totalDurationMs: number;
103
- tokenUsage?: ProviderUsage;
104
- }
105
- /**
106
- * Improvement suggestion from analysis.
107
- */
108
- export interface ImprovementSuggestion {
109
- category: 'performance' | 'quality' | 'efficiency' | 'error-handling';
110
- severity: 'low' | 'medium' | 'high';
111
- message: string;
112
- suggestedAction?: string;
113
- }
114
- /**
115
- * Tournament configuration.
116
- */
117
- export interface TournamentConfig {
118
- tournamentId: string;
119
- rounds: number;
120
- prompts: string[];
121
- evaluateCode: boolean;
122
- parallelExecution: boolean;
123
- }
124
- /**
125
- * Tournament result summary.
126
- */
127
- export interface TournamentResult {
128
- tournamentId: string;
129
- config: TournamentConfig;
130
- rounds: CompetitionRoundResult[];
131
- standings: CompetitionStandings;
132
- startTime: string;
133
- endTime: string;
134
- totalDurationMs: number;
135
- }
136
- /**
137
- * Tournament status.
138
- */
139
- export type TournamentStatus = 'pending' | 'running' | 'completed' | 'failed';
140
- /**
141
- * Callbacks for tournament events.
142
- */
143
- export interface TournamentCallbacks {
144
- onRoundStart?: (roundNumber: number, prompt: string) => void;
145
- onRoundComplete?: (roundNumber: number, result: CompetitionRoundResult) => void;
146
- onTournamentComplete?: (result: TournamentResult) => void;
147
- onError?: (error: Error) => void;
148
- }
149
- /**
150
- * Research metadata for the Alpha Zero 2 project.
151
- */
152
- export interface ResearchMetadata {
153
- projectName: string;
154
- version: string;
155
- author: string;
156
- framework: string;
157
- description: string;
158
- innovations: string[];
159
- techStack: {
160
- python: string[];
161
- typescript: string[];
162
- aiProviders: string[];
163
- testing: string[];
164
- };
165
- }
166
- /**
167
- * Default research metadata.
168
- */
169
- export declare const ALPHA_ZERO_2_METADATA: ResearchMetadata;
170
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/alpha-zero/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MA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tB,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;CACH;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,gBAmBnC,CAAC"}
@@ -1,31 +0,0 @@
1
- /**
2
- * Alpha Zero 2 - Type Definitions
3
- *
4
- * Core type definitions for the competitive multi-agent RL framework.
5
- *
6
- * Principal Investigator: Bo Shang
7
- * Framework: erosolar-cli
8
- */
9
- /**
10
- * Default research metadata.
11
- */
12
- export const ALPHA_ZERO_2_METADATA = {
13
- projectName: 'Alpha Zero 2',
14
- version: '1.0.0',
15
- author: 'Bo Shang',
16
- framework: 'erosolar-cli',
17
- description: 'Recursive Self-Improvement in Competitive Multi-Agent Systems',
18
- innovations: [
19
- 'Recursive Self-Modification Engine: Agents modify their own tool source code',
20
- 'Competitive Multi-Agent Framework: Tournament system with parallel execution',
21
- 'Version-Controlled Self-Improvement: SHA-256 checkpoints with automatic rollback',
22
- 'AST-Based Code Quality Metrics: Comprehensive evaluation across 10+ dimensions',
23
- ],
24
- techStack: {
25
- python: ['typer', 'rich', 'prompt-toolkit', 'pydantic', 'aiohttp', 'tiktoken'],
26
- typescript: ['chalk', 'ora', 'gradient-string', 'boxen', 'nanospinner'],
27
- aiProviders: ['anthropic', 'openai', 'google-generativeai'],
28
- testing: ['pytest', 'pytest-asyncio', 'mypy', 'ruff', 'eslint'],
29
- },
30
- };
31
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/alpha-zero/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA8KH;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAqB;IACrD,WAAW,EAAE,cAAc;IAC3B,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,UAAU;IAClB,SAAS,EAAE,cAAc;IACzB,WAAW,EACT,+DAA+D;IACjE,WAAW,EAAE;QACX,8EAA8E;QAC9E,8EAA8E;QAC9E,kFAAkF;QAClF,gFAAgF;KACjF;IACD,SAAS,EAAE;QACT,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,CAAC;QAC9E,UAAU,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,aAAa,CAAC;QACvE,WAAW,EAAE,CAAC,WAAW,EAAE,QAAQ,EAAE,qBAAqB,CAAC;QAC3D,OAAO,EAAE,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC;KAChE;CACF,CAAC"}
@@ -1,13 +0,0 @@
1
- import type { CapabilityContribution, CapabilityContext, CapabilityModule } from '../runtime/agentHost.js';
2
- export interface SecurityTestingCapabilityOptions {
3
- workingDir?: string;
4
- id?: string;
5
- description?: string;
6
- }
7
- export declare class SecurityTestingCapabilityModule implements CapabilityModule {
8
- readonly id = "capability.security-testing";
9
- private readonly options;
10
- constructor(options?: SecurityTestingCapabilityOptions);
11
- create(context: CapabilityContext): Promise<CapabilityContribution>;
12
- }
13
- //# sourceMappingURL=securityTestingCapability.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"securityTestingCapability.d.ts","sourceRoot":"","sources":["../../src/capabilities/securityTestingCapability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3G,MAAM,WAAW,gCAAgC;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,+BAAgC,YAAW,gBAAgB;IACtE,QAAQ,CAAC,EAAE,iCAAiC;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmC;gBAE/C,OAAO,GAAE,gCAAqC;IAIpD,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAiB1E"}
@@ -1,25 +0,0 @@
1
- import { createSecurityTools } from '../tools/securityTools.js';
2
- export class SecurityTestingCapabilityModule {
3
- id = 'capability.security-testing';
4
- options;
5
- constructor(options = {}) {
6
- this.options = options;
7
- }
8
- async create(context) {
9
- const workingDir = this.options.workingDir ?? context.workingDir;
10
- return {
11
- id: this.options.id ?? 'security.testing',
12
- description: this.options.description ?? 'Ethical penetration testing and security analysis tools.',
13
- toolSuite: {
14
- id: 'security-testing',
15
- description: 'Security scanning, vulnerability detection, and penetration testing (authorized targets only)',
16
- tools: createSecurityTools(workingDir),
17
- },
18
- metadata: {
19
- workingDir,
20
- disclaimer: 'For authorized security testing only. Do not use on systems without permission.',
21
- },
22
- };
23
- }
24
- }
25
- //# sourceMappingURL=securityTestingCapability.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"securityTestingCapability.js","sourceRoot":"","sources":["../../src/capabilities/securityTestingCapability.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAQhE,MAAM,OAAO,+BAA+B;IACjC,EAAE,GAAG,6BAA6B,CAAC;IAC3B,OAAO,CAAmC;IAE3D,YAAY,UAA4C,EAAE;QACxD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAA0B;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC;QACjE,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,kBAAkB;YACzC,WAAW,EACT,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,0DAA0D;YACxF,SAAS,EAAE;gBACT,EAAE,EAAE,kBAAkB;gBACtB,WAAW,EAAE,+FAA+F;gBAC5G,KAAK,EAAE,mBAAmB,CAAC,UAAU,CAAC;aACvC;YACD,QAAQ,EAAE;gBACR,UAAU;gBACV,UAAU,EAAE,iFAAiF;aAC9F;SACF,CAAC;IACJ,CAAC;CACF"}
@@ -1,26 +0,0 @@
1
- /**
2
- * Lightweight AI flow optimizer stub.
3
- */
4
- export interface AIFlowMetrics {
5
- latencyMs: number;
6
- toolCalls: number;
7
- tokenUsage?: number;
8
- parallelExecution?: boolean;
9
- }
10
- export interface OptimizedFlow {
11
- originalMetrics: AIFlowMetrics;
12
- optimizedMetrics: AIFlowMetrics;
13
- suggestions: string[];
14
- }
15
- export interface OptimizationInsights {
16
- patterns: string[];
17
- averageLatency?: number;
18
- }
19
- export declare class AIFlowOptimizer {
20
- constructor(_options?: {
21
- workingDir?: string;
22
- });
23
- analyzeFlow(flowData: any): OptimizedFlow;
24
- getOptimizationInsights(): OptimizationInsights;
25
- }
26
- //# sourceMappingURL=aiFlowOptimizer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"aiFlowOptimizer.d.ts","sourceRoot":"","sources":["../../src/core/aiFlowOptimizer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,aAAa,CAAC;IAC/B,gBAAgB,EAAE,aAAa,CAAC;IAChC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,eAAe;gBAEd,QAAQ,GAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAO;IAElD,WAAW,CAAC,QAAQ,EAAE,GAAG,GAAG,aAAa;IAoBzC,uBAAuB,IAAI,oBAAoB;CAMhD"}
@@ -1,31 +0,0 @@
1
- /**
2
- * Lightweight AI flow optimizer stub.
3
- */
4
- export class AIFlowOptimizer {
5
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
6
- constructor(_options = {}) { }
7
- analyzeFlow(flowData) {
8
- const baseline = {
9
- latencyMs: Number(flowData?.latencyMs ?? 1000),
10
- toolCalls: Number(flowData?.toolCalls ?? 1),
11
- tokenUsage: Number(flowData?.tokenUsage ?? 0),
12
- parallelExecution: Boolean(flowData?.parallelExecution ?? false),
13
- };
14
- const optimized = {
15
- ...baseline,
16
- latencyMs: Math.max(100, Math.round(baseline.latencyMs * 0.9)),
17
- };
18
- return {
19
- originalMetrics: baseline,
20
- optimizedMetrics: optimized,
21
- suggestions: ['Enable parallel execution where safe', 'Trim redundant tool calls'],
22
- };
23
- }
24
- getOptimizationInsights() {
25
- return {
26
- patterns: ['stub-optimization-pattern'],
27
- averageLatency: undefined,
28
- };
29
- }
30
- }
31
- //# sourceMappingURL=aiFlowOptimizer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"aiFlowOptimizer.js","sourceRoot":"","sources":["../../src/core/aiFlowOptimizer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAoBH,MAAM,OAAO,eAAe;IAC1B,6DAA6D;IAC7D,YAAY,WAAoC,EAAE,IAAG,CAAC;IAEtD,WAAW,CAAC,QAAa;QACvB,MAAM,QAAQ,GAAkB;YAC9B,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS,IAAI,IAAI,CAAC;YAC9C,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS,IAAI,CAAC,CAAC;YAC3C,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,UAAU,IAAI,CAAC,CAAC;YAC7C,iBAAiB,EAAE,OAAO,CAAC,QAAQ,EAAE,iBAAiB,IAAI,KAAK,CAAC;SACjE,CAAC;QAEF,MAAM,SAAS,GAAkB;YAC/B,GAAG,QAAQ;YACX,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC;SAC/D,CAAC;QAEF,OAAO;YACL,eAAe,EAAE,QAAQ;YACzB,gBAAgB,EAAE,SAAS;YAC3B,WAAW,EAAE,CAAC,sCAAsC,EAAE,2BAA2B,CAAC;SACnF,CAAC;IACJ,CAAC;IAED,uBAAuB;QACrB,OAAO;YACL,QAAQ,EAAE,CAAC,2BAA2B,CAAC;YACvC,cAAc,EAAE,SAAS;SAC1B,CAAC;IACJ,CAAC;CACF"}
@@ -1,158 +0,0 @@
1
- /**
2
- * AI Optimization Engine - Advanced Decision Making and Error Recovery
3
- *
4
- * Provides intelligent problem-solving with:
5
- * - Optimal solution path analysis
6
- * - Multi-strategy decision making
7
- * - Intelligent error recovery
8
- * - Performance optimization
9
- * - Context-aware reasoning
10
- *
11
- * @license MIT
12
- * @author Bo Shang
13
- */
14
- export declare enum ProblemComplexity {
15
- TRIVIAL = "trivial",// Single-step, deterministic solution
16
- SIMPLE = "simple",// 2-3 steps, clear path
17
- MODERATE = "moderate",// Multiple steps, some uncertainty
18
- COMPLEX = "complex",// Complex dependencies, multiple approaches
19
- VERY_COMPLEX = "very_complex"
20
- }
21
- export declare enum SolutionStrategy {
22
- DIRECT = "direct",// Straightforward implementation
23
- INCREMENTAL = "incremental",// Step-by-step with validation
24
- DEFENSIVE = "defensive",// Conservative with fallbacks
25
- OPTIMISTIC = "optimistic",// Aggressive with rollback
26
- ADAPTIVE = "adaptive",// Dynamic strategy selection
27
- EXPLORATORY = "exploratory"
28
- }
29
- export interface ProblemAnalysis {
30
- complexity: ProblemComplexity;
31
- riskLevel: 'low' | 'medium' | 'high';
32
- dependencies: string[];
33
- constraints: string[];
34
- successCriteria: string[];
35
- failurePoints: string[];
36
- optimalStrategy: SolutionStrategy;
37
- alternativeStrategies: SolutionStrategy[];
38
- estimatedSteps: number;
39
- confidence: number;
40
- }
41
- export interface SolutionPath {
42
- strategy: SolutionStrategy;
43
- steps: SolutionStep[];
44
- validationPoints: ValidationPoint[];
45
- rollbackPlan: RollbackStep[];
46
- estimatedTime: number;
47
- successProbability: number;
48
- }
49
- export interface SolutionStep {
50
- id: string;
51
- action: string;
52
- tool?: string;
53
- parameters?: Record<string, unknown>;
54
- validation?: string;
55
- fallback?: string;
56
- }
57
- export interface ValidationPoint {
58
- stepId: string;
59
- validationType: 'tool_output' | 'file_content' | 'test_result' | 'user_confirmation';
60
- expectedPattern?: string;
61
- failureAction: 'retry' | 'fallback' | 'abort';
62
- }
63
- export interface RollbackStep {
64
- stepId: string;
65
- action: string;
66
- tool?: string;
67
- parameters?: Record<string, unknown>;
68
- }
69
- export interface ErrorRecoveryStrategy {
70
- errorType: string;
71
- errorPattern: RegExp;
72
- recoveryActions: RecoveryAction[];
73
- priority: 'immediate' | 'high' | 'medium' | 'low';
74
- autoRecoverable: boolean;
75
- }
76
- export interface RecoveryAction {
77
- action: string;
78
- tool?: string;
79
- parameters?: Record<string, unknown>;
80
- validation?: string;
81
- successProbability: number;
82
- }
83
- export declare class AIOptimizationEngine {
84
- private readonly workingDir;
85
- private readonly performanceThresholds;
86
- constructor(options?: {
87
- workingDir?: string;
88
- });
89
- /**
90
- * Analyze problem and determine optimal solution strategy
91
- */
92
- analyzeProblem(problemDescription: string, context?: {
93
- filesRead?: string[];
94
- toolsUsed?: string[];
95
- errorsEncountered?: string[];
96
- complexityHints?: string[];
97
- }): ProblemAnalysis;
98
- /**
99
- * Generate optimal solution path with validation and rollback
100
- */
101
- generateSolutionPath(analysis: ProblemAnalysis, context: {
102
- availableTools: string[];
103
- currentState: Record<string, unknown>;
104
- userPreferences?: {
105
- riskTolerance: 'low' | 'medium' | 'high';
106
- validationPreference: 'minimal' | 'balanced' | 'thorough';
107
- };
108
- }): SolutionPath;
109
- /**
110
- * Intelligent error recovery with multiple strategies
111
- */
112
- recoverFromError(error: string, context: {
113
- currentStep: SolutionStep;
114
- analysis: ProblemAnalysis;
115
- attemptedSolutions: string[];
116
- availableTools: string[];
117
- }): RecoveryAction[];
118
- /**
119
- * Optimize AI flow for efficiency and effectiveness
120
- */
121
- optimizeAIFlow(currentFlow: {
122
- toolCalls: Array<{
123
- tool: string;
124
- parameters: Record<string, unknown>;
125
- }>;
126
- contextUsage: {
127
- filesRead: number;
128
- searches: number;
129
- edits: number;
130
- };
131
- validationRounds: number;
132
- }): {
133
- optimizedFlow: Array<{
134
- tool: string;
135
- parameters: Record<string, unknown>;
136
- }>;
137
- efficiencyGains: number;
138
- recommendations: string[];
139
- };
140
- private assessComplexity;
141
- private assessRisk;
142
- private extractDependencies;
143
- private extractConstraints;
144
- private extractSuccessCriteria;
145
- private identifyFailurePoints;
146
- private selectOptimalStrategy;
147
- private getAlternativeStrategies;
148
- private estimateSteps;
149
- private calculateConfidence;
150
- private generateSteps;
151
- private getErrorRecoveryStrategies;
152
- private isStrategyApplicable;
153
- private detectSequentialReads;
154
- private mergeSequentialReads;
155
- private calculateContextEfficiency;
156
- private calculateEfficiencyGains;
157
- }
158
- //# sourceMappingURL=aiOptimizationEngine.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"aiOptimizationEngine.d.ts","sourceRoot":"","sources":["../../src/core/aiOptimizationEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,oBAAY,iBAAiB;IAC3B,OAAO,YAAY,CAAO,sCAAsC;IAChE,MAAM,WAAW,CAAS,wBAAwB;IAClD,QAAQ,aAAa,CAAK,mCAAmC;IAC7D,OAAO,YAAY,CAAO,4CAA4C;IACtE,YAAY,iBAAiB;CAC9B;AAED,oBAAY,gBAAgB;IAC1B,MAAM,WAAW,CAAY,iCAAiC;IAC9D,WAAW,gBAAgB,CAAE,+BAA+B;IAC5D,SAAS,cAAc,CAAM,8BAA8B;IAC3D,UAAU,eAAe,CAAI,2BAA2B;IACxD,QAAQ,aAAa,CAAQ,6BAA6B;IAC1D,WAAW,gBAAgB;CAC5B;AAED,MAAM,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