erosolar-cli 1.7.340 → 1.7.342

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 (327) 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/sessionStore.d.ts +2 -0
  29. package/dist/core/sessionStore.d.ts.map +1 -1
  30. package/dist/core/sessionStore.js +1 -0
  31. package/dist/core/sessionStore.js.map +1 -1
  32. package/dist/core/toolPreconditions.d.ts.map +1 -1
  33. package/dist/core/toolPreconditions.js +0 -14
  34. package/dist/core/toolPreconditions.js.map +1 -1
  35. package/dist/core/toolRuntime.d.ts +22 -1
  36. package/dist/core/toolRuntime.d.ts.map +1 -1
  37. package/dist/core/toolRuntime.js +0 -5
  38. package/dist/core/toolRuntime.js.map +1 -1
  39. package/dist/core/toolValidation.d.ts.map +1 -1
  40. package/dist/core/toolValidation.js +14 -3
  41. package/dist/core/toolValidation.js.map +1 -1
  42. package/dist/core/validationRunner.d.ts +1 -3
  43. package/dist/core/validationRunner.d.ts.map +1 -1
  44. package/dist/core/validationRunner.js.map +1 -1
  45. package/dist/core/verification.d.ts +137 -0
  46. package/dist/core/verification.d.ts.map +1 -0
  47. package/dist/core/verification.js +323 -0
  48. package/dist/core/verification.js.map +1 -0
  49. package/dist/headless/headlessApp.d.ts.map +1 -1
  50. package/dist/headless/headlessApp.js +21 -0
  51. package/dist/headless/headlessApp.js.map +1 -1
  52. package/dist/mcp/sseClient.d.ts.map +1 -1
  53. package/dist/mcp/sseClient.js +9 -18
  54. package/dist/mcp/sseClient.js.map +1 -1
  55. package/dist/plugins/tools/build/buildPlugin.d.ts +0 -6
  56. package/dist/plugins/tools/build/buildPlugin.d.ts.map +1 -1
  57. package/dist/plugins/tools/build/buildPlugin.js +4 -10
  58. package/dist/plugins/tools/build/buildPlugin.js.map +1 -1
  59. package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
  60. package/dist/plugins/tools/nodeDefaults.js +0 -2
  61. package/dist/plugins/tools/nodeDefaults.js.map +1 -1
  62. package/dist/runtime/agentSession.d.ts +2 -2
  63. package/dist/runtime/agentSession.d.ts.map +1 -1
  64. package/dist/runtime/agentSession.js +2 -2
  65. package/dist/runtime/agentSession.js.map +1 -1
  66. package/dist/shell/interactiveShell.d.ts +19 -7
  67. package/dist/shell/interactiveShell.d.ts.map +1 -1
  68. package/dist/shell/interactiveShell.js +271 -166
  69. package/dist/shell/interactiveShell.js.map +1 -1
  70. package/dist/shell/shellApp.d.ts +2 -0
  71. package/dist/shell/shellApp.d.ts.map +1 -1
  72. package/dist/shell/shellApp.js +82 -9
  73. package/dist/shell/shellApp.js.map +1 -1
  74. package/dist/shell/systemPrompt.d.ts.map +1 -1
  75. package/dist/shell/systemPrompt.js +1 -4
  76. package/dist/shell/systemPrompt.js.map +1 -1
  77. package/dist/shell/terminalInput.d.ts +215 -120
  78. package/dist/shell/terminalInput.d.ts.map +1 -1
  79. package/dist/shell/terminalInput.js +926 -537
  80. package/dist/shell/terminalInput.js.map +1 -1
  81. package/dist/shell/terminalInputAdapter.d.ts +99 -21
  82. package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
  83. package/dist/shell/terminalInputAdapter.js +131 -30
  84. package/dist/shell/terminalInputAdapter.js.map +1 -1
  85. package/dist/subagents/agentConfig.d.ts +27 -0
  86. package/dist/subagents/agentConfig.d.ts.map +1 -0
  87. package/dist/subagents/agentConfig.js +89 -0
  88. package/dist/subagents/agentConfig.js.map +1 -0
  89. package/dist/subagents/agentRegistry.d.ts +33 -0
  90. package/dist/subagents/agentRegistry.d.ts.map +1 -0
  91. package/dist/subagents/agentRegistry.js +162 -0
  92. package/dist/subagents/agentRegistry.js.map +1 -0
  93. package/dist/subagents/taskRunner.d.ts +7 -1
  94. package/dist/subagents/taskRunner.d.ts.map +1 -1
  95. package/dist/subagents/taskRunner.js +180 -47
  96. package/dist/subagents/taskRunner.js.map +1 -1
  97. package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
  98. package/dist/ui/ShellUIAdapter.js +13 -12
  99. package/dist/ui/ShellUIAdapter.js.map +1 -1
  100. package/dist/ui/display.d.ts +24 -45
  101. package/dist/ui/display.d.ts.map +1 -1
  102. package/dist/ui/display.js +140 -259
  103. package/dist/ui/display.js.map +1 -1
  104. package/dist/ui/theme.d.ts.map +1 -1
  105. package/dist/ui/theme.js +6 -8
  106. package/dist/ui/theme.js.map +1 -1
  107. package/dist/ui/toolDisplay.d.ts +0 -158
  108. package/dist/ui/toolDisplay.d.ts.map +1 -1
  109. package/dist/ui/toolDisplay.js +0 -348
  110. package/dist/ui/toolDisplay.js.map +1 -1
  111. package/dist/ui/unified/layout.d.ts +1 -0
  112. package/dist/ui/unified/layout.d.ts.map +1 -1
  113. package/dist/ui/unified/layout.js +15 -25
  114. package/dist/ui/unified/layout.js.map +1 -1
  115. package/dist/utils/frontmatter.d.ts +10 -0
  116. package/dist/utils/frontmatter.d.ts.map +1 -0
  117. package/dist/utils/frontmatter.js +78 -0
  118. package/dist/utils/frontmatter.js.map +1 -0
  119. package/package.json +4 -4
  120. package/dist/alpha-zero/agentWrapper.d.ts +0 -84
  121. package/dist/alpha-zero/agentWrapper.d.ts.map +0 -1
  122. package/dist/alpha-zero/agentWrapper.js +0 -171
  123. package/dist/alpha-zero/agentWrapper.js.map +0 -1
  124. package/dist/alpha-zero/codeEvaluator.d.ts +0 -25
  125. package/dist/alpha-zero/codeEvaluator.d.ts.map +0 -1
  126. package/dist/alpha-zero/codeEvaluator.js +0 -273
  127. package/dist/alpha-zero/codeEvaluator.js.map +0 -1
  128. package/dist/alpha-zero/competitiveRunner.d.ts +0 -66
  129. package/dist/alpha-zero/competitiveRunner.d.ts.map +0 -1
  130. package/dist/alpha-zero/competitiveRunner.js +0 -224
  131. package/dist/alpha-zero/competitiveRunner.js.map +0 -1
  132. package/dist/alpha-zero/index.d.ts +0 -67
  133. package/dist/alpha-zero/index.d.ts.map +0 -1
  134. package/dist/alpha-zero/index.js +0 -99
  135. package/dist/alpha-zero/index.js.map +0 -1
  136. package/dist/alpha-zero/introspection.d.ts +0 -128
  137. package/dist/alpha-zero/introspection.d.ts.map +0 -1
  138. package/dist/alpha-zero/introspection.js +0 -300
  139. package/dist/alpha-zero/introspection.js.map +0 -1
  140. package/dist/alpha-zero/metricsTracker.d.ts +0 -71
  141. package/dist/alpha-zero/metricsTracker.d.ts.map +0 -1
  142. package/dist/alpha-zero/metricsTracker.js.map +0 -1
  143. package/dist/alpha-zero/security/core.d.ts +0 -125
  144. package/dist/alpha-zero/security/core.d.ts.map +0 -1
  145. package/dist/alpha-zero/security/core.js +0 -271
  146. package/dist/alpha-zero/security/core.js.map +0 -1
  147. package/dist/alpha-zero/security/google.d.ts +0 -125
  148. package/dist/alpha-zero/security/google.d.ts.map +0 -1
  149. package/dist/alpha-zero/security/google.js +0 -311
  150. package/dist/alpha-zero/security/google.js.map +0 -1
  151. package/dist/alpha-zero/security/googleLoader.d.ts +0 -17
  152. package/dist/alpha-zero/security/googleLoader.d.ts.map +0 -1
  153. package/dist/alpha-zero/security/googleLoader.js +0 -41
  154. package/dist/alpha-zero/security/googleLoader.js.map +0 -1
  155. package/dist/alpha-zero/security/index.d.ts +0 -29
  156. package/dist/alpha-zero/security/index.d.ts.map +0 -1
  157. package/dist/alpha-zero/security/index.js +0 -32
  158. package/dist/alpha-zero/security/index.js.map +0 -1
  159. package/dist/alpha-zero/security/simulation.d.ts +0 -124
  160. package/dist/alpha-zero/security/simulation.d.ts.map +0 -1
  161. package/dist/alpha-zero/security/simulation.js +0 -277
  162. package/dist/alpha-zero/security/simulation.js.map +0 -1
  163. package/dist/alpha-zero/selfModification.d.ts +0 -109
  164. package/dist/alpha-zero/selfModification.d.ts.map +0 -1
  165. package/dist/alpha-zero/selfModification.js +0 -233
  166. package/dist/alpha-zero/selfModification.js.map +0 -1
  167. package/dist/alpha-zero/types.d.ts +0 -170
  168. package/dist/alpha-zero/types.d.ts.map +0 -1
  169. package/dist/alpha-zero/types.js +0 -31
  170. package/dist/alpha-zero/types.js.map +0 -1
  171. package/dist/capabilities/securityTestingCapability.d.ts +0 -13
  172. package/dist/capabilities/securityTestingCapability.d.ts.map +0 -1
  173. package/dist/capabilities/securityTestingCapability.js +0 -25
  174. package/dist/capabilities/securityTestingCapability.js.map +0 -1
  175. package/dist/core/aiFlowOptimizer.d.ts +0 -26
  176. package/dist/core/aiFlowOptimizer.d.ts.map +0 -1
  177. package/dist/core/aiFlowOptimizer.js +0 -31
  178. package/dist/core/aiFlowOptimizer.js.map +0 -1
  179. package/dist/core/aiOptimizationEngine.d.ts +0 -158
  180. package/dist/core/aiOptimizationEngine.d.ts.map +0 -1
  181. package/dist/core/aiOptimizationEngine.js +0 -428
  182. package/dist/core/aiOptimizationEngine.js.map +0 -1
  183. package/dist/core/aiOptimizationIntegration.d.ts +0 -93
  184. package/dist/core/aiOptimizationIntegration.d.ts.map +0 -1
  185. package/dist/core/aiOptimizationIntegration.js +0 -250
  186. package/dist/core/aiOptimizationIntegration.js.map +0 -1
  187. package/dist/core/enhancedErrorRecovery.d.ts +0 -100
  188. package/dist/core/enhancedErrorRecovery.d.ts.map +0 -1
  189. package/dist/core/enhancedErrorRecovery.js +0 -345
  190. package/dist/core/enhancedErrorRecovery.js.map +0 -1
  191. package/dist/core/hooksSystem.d.ts +0 -65
  192. package/dist/core/hooksSystem.d.ts.map +0 -1
  193. package/dist/core/hooksSystem.js +0 -273
  194. package/dist/core/hooksSystem.js.map +0 -1
  195. package/dist/core/memorySystem.d.ts +0 -48
  196. package/dist/core/memorySystem.d.ts.map +0 -1
  197. package/dist/core/memorySystem.js +0 -271
  198. package/dist/core/memorySystem.js.map +0 -1
  199. package/dist/core/unified/errors.d.ts +0 -189
  200. package/dist/core/unified/errors.d.ts.map +0 -1
  201. package/dist/core/unified/errors.js +0 -497
  202. package/dist/core/unified/errors.js.map +0 -1
  203. package/dist/core/unified/index.d.ts +0 -19
  204. package/dist/core/unified/index.d.ts.map +0 -1
  205. package/dist/core/unified/index.js +0 -68
  206. package/dist/core/unified/index.js.map +0 -1
  207. package/dist/core/unified/schema.d.ts +0 -101
  208. package/dist/core/unified/schema.d.ts.map +0 -1
  209. package/dist/core/unified/schema.js +0 -350
  210. package/dist/core/unified/schema.js.map +0 -1
  211. package/dist/core/unified/toolRuntime.d.ts +0 -179
  212. package/dist/core/unified/toolRuntime.d.ts.map +0 -1
  213. package/dist/core/unified/toolRuntime.js +0 -517
  214. package/dist/core/unified/toolRuntime.js.map +0 -1
  215. package/dist/core/unified/tools.d.ts +0 -127
  216. package/dist/core/unified/tools.d.ts.map +0 -1
  217. package/dist/core/unified/tools.js +0 -1333
  218. package/dist/core/unified/tools.js.map +0 -1
  219. package/dist/core/unified/types.d.ts +0 -352
  220. package/dist/core/unified/types.d.ts.map +0 -1
  221. package/dist/core/unified/types.js +0 -12
  222. package/dist/core/unified/types.js.map +0 -1
  223. package/dist/core/unified/version.d.ts +0 -209
  224. package/dist/core/unified/version.d.ts.map +0 -1
  225. package/dist/core/unified/version.js +0 -454
  226. package/dist/core/unified/version.js.map +0 -1
  227. package/dist/plugins/tools/security/securityPlugin.d.ts +0 -3
  228. package/dist/plugins/tools/security/securityPlugin.d.ts.map +0 -1
  229. package/dist/plugins/tools/security/securityPlugin.js +0 -12
  230. package/dist/plugins/tools/security/securityPlugin.js.map +0 -1
  231. package/dist/security/active-stack-security.d.ts +0 -112
  232. package/dist/security/active-stack-security.d.ts.map +0 -1
  233. package/dist/security/active-stack-security.js +0 -296
  234. package/dist/security/active-stack-security.js.map +0 -1
  235. package/dist/security/advanced-persistence-research.d.ts +0 -92
  236. package/dist/security/advanced-persistence-research.d.ts.map +0 -1
  237. package/dist/security/advanced-persistence-research.js +0 -195
  238. package/dist/security/advanced-persistence-research.js.map +0 -1
  239. package/dist/security/advanced-targeting.d.ts +0 -119
  240. package/dist/security/advanced-targeting.d.ts.map +0 -1
  241. package/dist/security/advanced-targeting.js +0 -233
  242. package/dist/security/advanced-targeting.js.map +0 -1
  243. package/dist/security/assessment/vulnerabilityAssessment.d.ts +0 -104
  244. package/dist/security/assessment/vulnerabilityAssessment.d.ts.map +0 -1
  245. package/dist/security/assessment/vulnerabilityAssessment.js +0 -315
  246. package/dist/security/assessment/vulnerabilityAssessment.js.map +0 -1
  247. package/dist/security/authorization/securityAuthorization.d.ts +0 -88
  248. package/dist/security/authorization/securityAuthorization.d.ts.map +0 -1
  249. package/dist/security/authorization/securityAuthorization.js +0 -172
  250. package/dist/security/authorization/securityAuthorization.js.map +0 -1
  251. package/dist/security/comprehensive-targeting.d.ts +0 -85
  252. package/dist/security/comprehensive-targeting.d.ts.map +0 -1
  253. package/dist/security/comprehensive-targeting.js +0 -438
  254. package/dist/security/comprehensive-targeting.js.map +0 -1
  255. package/dist/security/global-security-integration.d.ts +0 -91
  256. package/dist/security/global-security-integration.d.ts.map +0 -1
  257. package/dist/security/global-security-integration.js +0 -218
  258. package/dist/security/global-security-integration.js.map +0 -1
  259. package/dist/security/index.d.ts +0 -38
  260. package/dist/security/index.d.ts.map +0 -1
  261. package/dist/security/index.js +0 -47
  262. package/dist/security/index.js.map +0 -1
  263. package/dist/security/persistence-analyzer.d.ts +0 -56
  264. package/dist/security/persistence-analyzer.d.ts.map +0 -1
  265. package/dist/security/persistence-analyzer.js +0 -187
  266. package/dist/security/persistence-analyzer.js.map +0 -1
  267. package/dist/security/persistence-cli.d.ts +0 -36
  268. package/dist/security/persistence-cli.d.ts.map +0 -1
  269. package/dist/security/persistence-cli.js +0 -160
  270. package/dist/security/persistence-cli.js.map +0 -1
  271. package/dist/security/persistence-research.d.ts +0 -92
  272. package/dist/security/persistence-research.d.ts.map +0 -1
  273. package/dist/security/persistence-research.js +0 -364
  274. package/dist/security/persistence-research.js.map +0 -1
  275. package/dist/security/research/persistenceResearch.d.ts +0 -97
  276. package/dist/security/research/persistenceResearch.d.ts.map +0 -1
  277. package/dist/security/research/persistenceResearch.js +0 -282
  278. package/dist/security/research/persistenceResearch.js.map +0 -1
  279. package/dist/security/security-integration.d.ts +0 -74
  280. package/dist/security/security-integration.d.ts.map +0 -1
  281. package/dist/security/security-integration.js +0 -137
  282. package/dist/security/security-integration.js.map +0 -1
  283. package/dist/security/security-testing-framework.d.ts +0 -112
  284. package/dist/security/security-testing-framework.d.ts.map +0 -1
  285. package/dist/security/security-testing-framework.js +0 -364
  286. package/dist/security/security-testing-framework.js.map +0 -1
  287. package/dist/security/simulation/attackSimulation.d.ts +0 -93
  288. package/dist/security/simulation/attackSimulation.d.ts.map +0 -1
  289. package/dist/security/simulation/attackSimulation.js +0 -341
  290. package/dist/security/simulation/attackSimulation.js.map +0 -1
  291. package/dist/security/strategic-operations.d.ts +0 -100
  292. package/dist/security/strategic-operations.d.ts.map +0 -1
  293. package/dist/security/strategic-operations.js +0 -276
  294. package/dist/security/strategic-operations.js.map +0 -1
  295. package/dist/security/tool-security-wrapper.d.ts +0 -58
  296. package/dist/security/tool-security-wrapper.d.ts.map +0 -1
  297. package/dist/security/tool-security-wrapper.js +0 -156
  298. package/dist/security/tool-security-wrapper.js.map +0 -1
  299. package/dist/shell/claudeCodeStreamHandler.d.ts +0 -145
  300. package/dist/shell/claudeCodeStreamHandler.d.ts.map +0 -1
  301. package/dist/shell/claudeCodeStreamHandler.js +0 -322
  302. package/dist/shell/claudeCodeStreamHandler.js.map +0 -1
  303. package/dist/shell/inputQueueManager.d.ts +0 -144
  304. package/dist/shell/inputQueueManager.d.ts.map +0 -1
  305. package/dist/shell/inputQueueManager.js +0 -290
  306. package/dist/shell/inputQueueManager.js.map +0 -1
  307. package/dist/shell/metricsTracker.d.ts +0 -60
  308. package/dist/shell/metricsTracker.d.ts.map +0 -1
  309. package/dist/shell/metricsTracker.js +0 -119
  310. package/dist/shell/metricsTracker.js.map +0 -1
  311. package/dist/shell/streamingOutputManager.d.ts +0 -115
  312. package/dist/shell/streamingOutputManager.d.ts.map +0 -1
  313. package/dist/shell/streamingOutputManager.js +0 -225
  314. package/dist/shell/streamingOutputManager.js.map +0 -1
  315. package/dist/tools/securityTools.d.ts +0 -22
  316. package/dist/tools/securityTools.d.ts.map +0 -1
  317. package/dist/tools/securityTools.js +0 -448
  318. package/dist/tools/securityTools.js.map +0 -1
  319. package/dist/ui/persistentPrompt.d.ts +0 -50
  320. package/dist/ui/persistentPrompt.d.ts.map +0 -1
  321. package/dist/ui/persistentPrompt.js +0 -92
  322. package/dist/ui/persistentPrompt.js.map +0 -1
  323. package/dist/ui/terminalUISchema.d.ts +0 -195
  324. package/dist/ui/terminalUISchema.d.ts.map +0 -1
  325. package/dist/ui/terminalUISchema.js +0 -113
  326. package/dist/ui/terminalUISchema.js.map +0 -1
  327. package/scripts/deploy-security-capabilities.js +0 -178
@@ -1,428 +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 var ProblemComplexity;
15
- (function (ProblemComplexity) {
16
- ProblemComplexity["TRIVIAL"] = "trivial";
17
- ProblemComplexity["SIMPLE"] = "simple";
18
- ProblemComplexity["MODERATE"] = "moderate";
19
- ProblemComplexity["COMPLEX"] = "complex";
20
- ProblemComplexity["VERY_COMPLEX"] = "very_complex"; // High uncertainty, multiple failure points
21
- })(ProblemComplexity || (ProblemComplexity = {}));
22
- export var SolutionStrategy;
23
- (function (SolutionStrategy) {
24
- SolutionStrategy["DIRECT"] = "direct";
25
- SolutionStrategy["INCREMENTAL"] = "incremental";
26
- SolutionStrategy["DEFENSIVE"] = "defensive";
27
- SolutionStrategy["OPTIMISTIC"] = "optimistic";
28
- SolutionStrategy["ADAPTIVE"] = "adaptive";
29
- SolutionStrategy["EXPLORATORY"] = "exploratory"; // Test multiple approaches
30
- })(SolutionStrategy || (SolutionStrategy = {}));
31
- export class AIOptimizationEngine {
32
- workingDir;
33
- performanceThresholds = {
34
- maxSequentialReads: 3,
35
- maxValidationRounds: 2,
36
- maxRetryAttempts: 3,
37
- contextEfficiencyThreshold: 0.7 // 70% context utilization
38
- };
39
- constructor(options = {}) {
40
- this.workingDir = options.workingDir ?? process.cwd();
41
- }
42
- /**
43
- * Analyze problem and determine optimal solution strategy
44
- */
45
- analyzeProblem(problemDescription, context = {}) {
46
- const complexity = this.assessComplexity(problemDescription, context);
47
- const riskLevel = this.assessRisk(problemDescription, context);
48
- const dependencies = this.extractDependencies(problemDescription, context);
49
- const constraints = this.extractConstraints(problemDescription);
50
- const successCriteria = this.extractSuccessCriteria(problemDescription);
51
- const failurePoints = this.identifyFailurePoints(problemDescription, context);
52
- const optimalStrategy = this.selectOptimalStrategy(complexity, riskLevel, context);
53
- const alternativeStrategies = this.getAlternativeStrategies(optimalStrategy, complexity);
54
- const estimatedSteps = this.estimateSteps(complexity, problemDescription);
55
- const confidence = this.calculateConfidence(complexity, context);
56
- return {
57
- complexity,
58
- riskLevel,
59
- dependencies,
60
- constraints,
61
- successCriteria,
62
- failurePoints,
63
- optimalStrategy,
64
- alternativeStrategies,
65
- estimatedSteps,
66
- confidence
67
- };
68
- }
69
- /**
70
- * Generate optimal solution path with validation and rollback
71
- */
72
- generateSolutionPath(analysis, context) {
73
- const strategy = analysis.optimalStrategy;
74
- const steps = this.generateSteps(analysis, context);
75
- const validationPoints = this.generateValidationPoints(steps, context);
76
- const rollbackPlan = this.generateRollbackPlan(steps, analysis);
77
- const estimatedTime = this.estimateTime(steps, analysis);
78
- const successProbability = this.calculateSuccessProbability(analysis, context);
79
- return {
80
- strategy,
81
- steps,
82
- validationPoints,
83
- rollbackPlan,
84
- estimatedTime,
85
- successProbability
86
- };
87
- }
88
- /**
89
- * Intelligent error recovery with multiple strategies
90
- */
91
- recoverFromError(error, context) {
92
- const recoveryStrategies = this.getErrorRecoveryStrategies(error);
93
- const applicableStrategies = recoveryStrategies.filter(strategy => this.isStrategyApplicable(strategy, context));
94
- // Sort by priority and success probability
95
- return applicableStrategies
96
- .flatMap(strategy => strategy.recoveryActions)
97
- .sort((a, b) => b.successProbability - a.successProbability)
98
- .slice(0, 3); // Return top 3 recovery actions
99
- }
100
- /**
101
- * Optimize AI flow for efficiency and effectiveness
102
- */
103
- optimizeAIFlow(currentFlow) {
104
- const recommendations = [];
105
- const optimizedFlow = [...currentFlow.toolCalls];
106
- // Optimize sequential reads
107
- const sequentialReads = this.detectSequentialReads(currentFlow.toolCalls);
108
- if (sequentialReads.length > this.performanceThresholds.maxSequentialReads) {
109
- recommendations.push(`Merge ${sequentialReads.length} sequential read operations into parallel reads`);
110
- optimizedFlow.splice(0, optimizedFlow.length, ...this.mergeSequentialReads(optimizedFlow));
111
- }
112
- // Optimize validation timing
113
- if (currentFlow.validationRounds > this.performanceThresholds.maxValidationRounds) {
114
- recommendations.push(`Reduce validation rounds from ${currentFlow.validationRounds} to 1 (deferred validation)`);
115
- }
116
- // Optimize context usage
117
- const contextEfficiency = this.calculateContextEfficiency(currentFlow.contextUsage);
118
- if (contextEfficiency < this.performanceThresholds.contextEfficiencyThreshold) {
119
- recommendations.push(`Improve context efficiency (current: ${(contextEfficiency * 100).toFixed(1)}%, target: ${(this.performanceThresholds.contextEfficiencyThreshold * 100).toFixed(1)}%)`);
120
- }
121
- const efficiencyGains = this.calculateEfficiencyGains(currentFlow, optimizedFlow);
122
- return {
123
- optimizedFlow,
124
- efficiencyGains,
125
- recommendations
126
- };
127
- }
128
- // Private implementation methods
129
- assessComplexity(description, context) {
130
- const complexityIndicators = {
131
- trivial: ['typo', 'format', 'rename', 'simple'],
132
- simple: ['update', 'modify', 'add', 'remove'],
133
- moderate: ['refactor', 'implement', 'create', 'integration'],
134
- complex: ['architecture', 'redesign', 'migration', 'complex'],
135
- very_complex: ['rewrite', 'overhaul', 'fundamental', 'strategic']
136
- };
137
- const lowerDesc = description.toLowerCase();
138
- for (const [level, indicators] of Object.entries(complexityIndicators)) {
139
- if (indicators.some(indicator => lowerDesc.includes(indicator))) {
140
- return level;
141
- }
142
- }
143
- // Fallback based on context
144
- if (context.errorsEncountered && context.errorsEncountered.length > 2) {
145
- return ProblemComplexity.COMPLEX;
146
- }
147
- if (context.filesRead && context.filesRead.length > 5) {
148
- return ProblemComplexity.MODERATE;
149
- }
150
- return ProblemComplexity.SIMPLE;
151
- }
152
- assessRisk(description, context) {
153
- const highRiskTerms = ['delete', 'drop', 'remove', 'overwrite', 'force', 'irreversible'];
154
- const mediumRiskTerms = ['modify', 'update', 'change', 'edit', 'refactor'];
155
- const lowerDesc = description.toLowerCase();
156
- if (highRiskTerms.some(term => lowerDesc.includes(term))) {
157
- return 'high';
158
- }
159
- if (mediumRiskTerms.some(term => lowerDesc.includes(term))) {
160
- return 'medium';
161
- }
162
- return 'low';
163
- }
164
- extractDependencies(description, context) {
165
- const dependencies = [];
166
- // Extract file dependencies from description
167
- const filePattern = /[\w\/.-]+\.(ts|js|tsx|jsx|json|md|txt)/gi;
168
- const fileMatches = description.match(filePattern) || [];
169
- dependencies.push(...fileMatches);
170
- // Add context dependencies
171
- if (context.filesRead) {
172
- dependencies.push(...context.filesRead);
173
- }
174
- return [...new Set(dependencies)]; // Remove duplicates
175
- }
176
- extractConstraints(description) {
177
- const constraints = [];
178
- const constraintPatterns = [
179
- /(?:must|should|need to|required to)\s+([^.!?]+)/gi,
180
- /(?:cannot|should not|must not)\s+([^.!?]+)/gi,
181
- /(?:constraint|limit|restriction)[^.!?]*/gi
182
- ];
183
- for (const pattern of constraintPatterns) {
184
- const matches = description.match(pattern) || [];
185
- constraints.push(...matches);
186
- }
187
- return constraints;
188
- }
189
- extractSuccessCriteria(description) {
190
- const criteria = [];
191
- const successPatterns = [
192
- /(?:should|must)\s+(?:work|function|compile|pass|succeed)/gi,
193
- /(?:expected|desired)\s+([^.!?]+)/gi,
194
- /(?:goal|objective)\s+is\s+([^.!?]+)/gi
195
- ];
196
- for (const pattern of successPatterns) {
197
- const matches = description.match(pattern) || [];
198
- criteria.push(...matches);
199
- }
200
- return criteria.length > 0 ? criteria : ['Complete implementation successfully'];
201
- }
202
- identifyFailurePoints(description, context) {
203
- const failurePoints = [];
204
- // Common failure points
205
- const commonFailures = [
206
- 'TypeScript compilation errors',
207
- 'Test failures',
208
- 'Missing dependencies',
209
- 'File not found errors',
210
- 'Permission issues'
211
- ];
212
- // Add context-specific failure points
213
- if (context.errorsEncountered) {
214
- failurePoints.push(...context.errorsEncountered);
215
- }
216
- // Add based on complexity
217
- const complexity = this.assessComplexity(description, context);
218
- if (complexity >= ProblemComplexity.COMPLEX) {
219
- failurePoints.push('Complex integration issues');
220
- failurePoints.push('Architecture conflicts');
221
- }
222
- return [...new Set([...commonFailures, ...failurePoints])];
223
- }
224
- selectOptimalStrategy(complexity, riskLevel, context) {
225
- // Strategy selection matrix
226
- const strategyMatrix = {
227
- [ProblemComplexity.TRIVIAL]: {
228
- low: SolutionStrategy.DIRECT,
229
- medium: SolutionStrategy.DIRECT,
230
- high: SolutionStrategy.DEFENSIVE
231
- },
232
- [ProblemComplexity.SIMPLE]: {
233
- low: SolutionStrategy.DIRECT,
234
- medium: SolutionStrategy.INCREMENTAL,
235
- high: SolutionStrategy.DEFENSIVE
236
- },
237
- [ProblemComplexity.MODERATE]: {
238
- low: SolutionStrategy.INCREMENTAL,
239
- medium: SolutionStrategy.ADAPTIVE,
240
- high: SolutionStrategy.DEFENSIVE
241
- },
242
- [ProblemComplexity.COMPLEX]: {
243
- low: SolutionStrategy.ADAPTIVE,
244
- medium: SolutionStrategy.EXPLORATORY,
245
- high: SolutionStrategy.DEFENSIVE
246
- },
247
- [ProblemComplexity.VERY_COMPLEX]: {
248
- low: SolutionStrategy.EXPLORATORY,
249
- medium: SolutionStrategy.EXPLORATORY,
250
- high: SolutionStrategy.DEFENSIVE
251
- }
252
- };
253
- return strategyMatrix[complexity][riskLevel];
254
- }
255
- getAlternativeStrategies(optimal, complexity) {
256
- const allStrategies = Object.values(SolutionStrategy);
257
- return allStrategies.filter(strategy => strategy !== optimal).slice(0, 2);
258
- }
259
- estimateSteps(complexity, description) {
260
- const baseSteps = {
261
- [ProblemComplexity.TRIVIAL]: 1,
262
- [ProblemComplexity.SIMPLE]: 2,
263
- [ProblemComplexity.MODERATE]: 4,
264
- [ProblemComplexity.COMPLEX]: 8,
265
- [ProblemComplexity.VERY_COMPLEX]: 15
266
- };
267
- // Adjust based on description length (proxy for complexity)
268
- const lengthFactor = Math.min(description.length / 100, 2); // Cap at 2x
269
- return Math.ceil(baseSteps[complexity] * lengthFactor);
270
- }
271
- calculateConfidence(complexity, context) {
272
- let confidence = 1.0;
273
- // Reduce confidence based on complexity
274
- const complexityPenalty = {
275
- [ProblemComplexity.TRIVIAL]: 0.0,
276
- [ProblemComplexity.SIMPLE]: 0.1,
277
- [ProblemComplexity.MODERATE]: 0.3,
278
- [ProblemComplexity.COMPLEX]: 0.5,
279
- [ProblemComplexity.VERY_COMPLEX]: 0.7
280
- };
281
- confidence -= complexityPenalty[complexity];
282
- // Reduce confidence based on previous errors
283
- if (context.errorsEncountered && context.errorsEncountered.length > 0) {
284
- confidence -= 0.2 * Math.min(context.errorsEncountered.length, 3);
285
- }
286
- return Math.max(0.1, confidence); // Minimum 10% confidence
287
- }
288
- generateSteps(n, analysis, n, context, n) {
289
- n;
290
- const steps = [];
291
- n;
292
- n; // Generic steps based on strategy\n switch (analysis.optimalStrategy) {\n case SolutionStrategy.DIRECT:\n steps.push({\n id: 'direct_implementation',\n action: 'Implement solution directly',\n tool: 'Edit',\n validation: 'Verify implementation matches requirements'\n });\n break;\n \n case SolutionStrategy.INCREMENTAL:\n steps.push(\n {\n id: 'analysis',\n action: 'Analyze current state and requirements',\n tool: 'read_files',\n validation: 'Understand the problem context'\n },\n {\n id: 'plan',\n action: 'Create implementation plan',\n validation: 'Plan covers all requirements'\n },\n {\n id: 'implement',\n action: 'Implement solution incrementally',\n tool: 'Edit',\n validation: 'Each step passes validation'\n }\n );\n break;\n \n case SolutionStrategy.DEFENSIVE:\n steps.push(\n {\n id: 'backup',\n action: 'Create backup of current state',\n tool: 'execute_bash',\n parameters: { command: 'git status' },\n validation: 'Backup created successfully'\n },\n {\n id: 'validate_current',\n action: 'Validate current state',\n tool: 'validate_all_changes',\n validation: 'Current state is stable'\n },\n {\n id: 'implement_carefully',\n action: 'Implement with validation at each step',\n tool: 'Edit',\n validation: 'Each edit passes validation'\n }\n );\n break;\n }\n\n return steps;\n }\n\n private generateValidationPoints(\n steps: SolutionStep[],\n context: any\n ): ValidationPoint[] {\n const validationPoints: ValidationPoint[] = [];\n\n for (const step of steps) {\n if (step.validation) {\n validationPoints.push({\n stepId: step.id,\n validationType: 'tool_output',\n failureAction: 'retry',\n expectedPattern: step.validation\n });\n }\n }\n\n return validationPoints;\n }\n\n private generateRollbackPlan(\n steps: SolutionStep[],\n analysis: ProblemAnalysis\n ): RollbackStep[] {\n const rollbackSteps: RollbackStep[] = [];\n\n // Add git-based rollback for defensive strategies\n if (analysis.optimalStrategy === SolutionStrategy.DEFENSIVE) {\n rollbackSteps.push({\n stepId: 'git_rollback',\n action: 'Revert all changes using git',\n tool: 'execute_bash',\n parameters: { command: 'git reset --hard HEAD' }\n });\n }\n\n return rollbackSteps;\n }\n\n private estimateTime(steps: SolutionStep[], analysis: ProblemAnalysis): number {\n const baseTimePerStep = 30; // seconds\n const complexityMultiplier: Record<ProblemComplexity, number> = {\n [ProblemComplexity.TRIVIAL]: 0.5,\n [ProblemComplexity.SIMPLE]: 1,\n [ProblemComplexity.MODERATE]: 2,\n [ProblemComplexity.COMPLEX]: 4,\n [ProblemComplexity.VERY_COMPLEX]: 8\n };\n\n return Math.ceil(steps.length * baseTimePerStep * complexityMultiplier[analysis.complexity]);\n }\n\n private calculateSuccessProbability(\n analysis: ProblemAnalysis,\n context: any\n ): number {
293
- let probability = analysis.confidence;
294
- // Adjust based on available tools
295
- if (context.availableTools && context.availableTools.length > 10) {
296
- probability += 0.1;
297
- }
298
- // Adjust based on user preferences
299
- if (context.userPreferences?.validationPreference === 'thorough') {
300
- probability += 0.1;
301
- }
302
- return Math.min(0.95, probability); // Cap at 95%
303
- }
304
- getErrorRecoveryStrategies(error) {
305
- const strategies = [
306
- {
307
- errorType: 'TypeScript Compilation Error',
308
- errorPattern: /TS\d+:.*error/,
309
- recoveryActions: [
310
- {
311
- action: 'Run TypeScript type checking to get detailed errors',
312
- tool: 'validate_typescript',
313
- successProbability: 0.9
314
- },
315
- {
316
- action: 'Fix TypeScript errors using suggested fixes',
317
- tool: 'suggest_fixes',
318
- successProbability: 0.7
319
- }
320
- ],
321
- priority: 'high',
322
- autoRecoverable: true
323
- },
324
- {
325
- errorType: 'Test Failure',
326
- errorPattern: /FAIL\s+.*test/i,
327
- recoveryActions: [
328
- {
329
- action: 'Run tests to get detailed failure information',
330
- tool: 'run_tests',
331
- successProbability: 0.8
332
- },
333
- {
334
- action: 'Analyze test failures and fix implementation',
335
- tool: 'analyze_code_structure',
336
- successProbability: 0.6
337
- }
338
- ],
339
- priority: 'high',
340
- autoRecoverable: false
341
- },
342
- {
343
- errorType: 'File Not Found',
344
- errorPattern: /(?:file not found|cannot find|ENOENT)/i,
345
- recoveryActions: [
346
- {
347
- action: 'Search for similar files',
348
- tool: 'search_files',
349
- successProbability: 0.5
350
- },
351
- {
352
- action: 'List files in directory to understand structure',
353
- tool: 'list_files',
354
- successProbability: 0.8
355
- }
356
- ],
357
- priority: 'medium',
358
- autoRecoverable: true
359
- }
360
- ];
361
- return strategies.filter(strategy => strategy.errorPattern.test(error));
362
- }
363
- isStrategyApplicable(strategy, context) {
364
- // Check if required tools are available
365
- const requiredTools = strategy.recoveryActions
366
- .map(action => action.tool)
367
- .filter(Boolean);
368
- return requiredTools.every(tool => context.availableTools?.includes(tool));
369
- }
370
- detectSequentialReads(toolCalls) {
371
- const sequentialReadIndices = [];
372
- let currentSequence = [];
373
- for (let i = 0; i < toolCalls.length; i++) {
374
- const call = toolCalls[i];
375
- if (call.tool.includes('read') || call.tool.includes('search')) {
376
- currentSequence.push(i);
377
- }
378
- else {
379
- if (currentSequence.length > 1) {
380
- sequentialReadIndices.push(...currentSequence);
381
- }
382
- currentSequence = [];
383
- }
384
- }
385
- if (currentSequence.length > 1) {
386
- sequentialReadIndices.push(...currentSequence);
387
- }
388
- return sequentialReadIndices;
389
- }
390
- mergeSequentialReads(toolCalls) {
391
- const optimizedCalls = [...toolCalls];
392
- const sequentialIndices = this.detectSequentialReads(toolCalls);
393
- // Remove sequential reads and replace with parallel reads
394
- for (let i = sequentialIndices.length - 1; i >= 0; i--) {
395
- const index = sequentialIndices[i];
396
- optimizedCalls.splice(index, 1);
397
- }
398
- // Add parallel read at the beginning of sequences
399
- if (sequentialIndices.length > 0) {
400
- const firstIndex = Math.min(...sequentialIndices);
401
- const readFiles = sequentialIndices.map(idx => toolCalls[idx].parameters?.path).filter(Boolean);
402
- if (readFiles.length > 0) {
403
- optimizedCalls.splice(firstIndex, 0, {
404
- tool: 'read_files',
405
- parameters: { paths: readFiles }
406
- });
407
- }
408
- }
409
- return optimizedCalls;
410
- }
411
- calculateContextEfficiency(contextUsage) {
412
- const totalOperations = contextUsage.filesRead + contextUsage.searches + contextUsage.edits;
413
- if (totalOperations === 0)
414
- return 1.0;
415
- // Efficiency formula: higher ratio of productive operations (edits) to exploratory operations
416
- const productiveRatio = contextUsage.edits / totalOperations;
417
- const searchEfficiency = 1 - (contextUsage.searches / (contextUsage.filesRead + 1));
418
- return (productiveRatio + searchEfficiency) / 2;
419
- }
420
- calculateEfficiencyGains(currentFlow, optimizedFlow) {
421
- const currentOps = currentFlow.toolCalls.length;
422
- const optimizedOps = optimizedFlow.length;
423
- if (currentOps === 0)
424
- return 0;
425
- return ((currentOps - optimizedOps) / currentOps) * 100;
426
- }
427
- }
428
- //# sourceMappingURL=aiOptimizationEngine.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"aiOptimizationEngine.js","sourceRoot":"","sources":["../../src/core/aiOptimizationEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,CAAN,IAAY,iBAMX;AAND,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,sCAAiB,CAAA;IACjB,0CAAqB,CAAA;IACrB,wCAAmB,CAAA;IACnB,kDAA6B,CAAA,CAAC,4CAA4C;AAC5E,CAAC,EANW,iBAAiB,KAAjB,iBAAiB,QAM5B;AAED,MAAM,CAAN,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,+CAA2B,CAAA;IAC3B,2CAAuB,CAAA;IACvB,6CAAyB,CAAA;IACzB,yCAAqB,CAAA;IACrB,+CAA2B,CAAA,CAAE,2BAA2B;AAC1D,CAAC,EAPW,gBAAgB,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aAAa,CAAC,MAAM,CAAC;QAE1C,IAAI,UAAU,KAAK,CAAC;YAAE,OAAO,CAAC,CAAC;QAE/B,OAAO,CAAC,CAAC,UAAU,GAAG,YAAY,CAAC,GAAG,UAAU,CAAC,GAAG,GAAG,CAAC;IAC1D,CAAC;CACF"}
@@ -1,93 +0,0 @@
1
- /**
2
- * AI Optimization Integration Module
3
- *
4
- * Unified interface for all AI optimization systems:
5
- * - Problem analysis and strategy selection
6
- * - Intelligent error recovery
7
- * - Flow optimization
8
- * - Performance monitoring
9
- * - Learning and adaptation
10
- *
11
- * @license MIT
12
- * @author Bo Shang
13
- */
14
- import { type ProblemAnalysis, type SolutionPath } from './aiOptimizationEngine.js';
15
- import { type RecoveryContext, type RecoveryPlan } from './enhancedErrorRecovery.js';
16
- import { type AIFlowMetrics, type OptimizedFlow } from './aiFlowOptimizer.js';
17
- export interface AIOptimizationSession {
18
- sessionId: string;
19
- startTime: Date;
20
- problem: string;
21
- analysis: ProblemAnalysis;
22
- solutionPath?: SolutionPath;
23
- recoveryPlans: RecoveryPlan[];
24
- flowOptimizations: OptimizedFlow[];
25
- performanceMetrics: AIFlowMetrics[];
26
- endTime?: Date;
27
- success: boolean;
28
- learnedPatterns: string[];
29
- }
30
- export interface OptimizationResult {
31
- session: AIOptimizationSession;
32
- recommendations: {
33
- strategy: string;
34
- efficiency: string;
35
- reliability: string;
36
- performance: string;
37
- };
38
- estimatedImprovement: number;
39
- nextSteps: string[];
40
- }
41
- export declare class AIOptimizationIntegration {
42
- private readonly optimizationEngine;
43
- private readonly errorRecovery;
44
- private readonly flowOptimizer;
45
- private readonly activeSessions;
46
- constructor(options?: {
47
- workingDir?: string;
48
- });
49
- /**
50
- * Start a new optimization session
51
- */
52
- startSession(problem: string, context?: any): AIOptimizationSession;
53
- /**
54
- * Generate optimal solution for current session
55
- */
56
- generateOptimalSolution(sessionId: string, context: {
57
- availableTools: string[];
58
- currentState: Record<string, unknown>;
59
- userPreferences?: any;
60
- }): SolutionPath;
61
- /**
62
- * Handle error with intelligent recovery
63
- */
64
- handleError(sessionId: string, error: string, context: RecoveryContext): RecoveryPlan;
65
- /**
66
- * Optimize AI flow for current session
67
- */
68
- optimizeFlow(sessionId: string, flowData: any): OptimizedFlow;
69
- /**
70
- * Complete session and generate optimization insights
71
- */
72
- completeSession(sessionId: string, success: boolean): OptimizationResult;
73
- /**
74
- * Get optimization statistics across all sessions
75
- */
76
- getOptimizationStatistics(): {
77
- totalSessions: number;
78
- successRate: number;
79
- averageImprovement: number;
80
- mostOptimizedProblems: string[];
81
- commonRecoveryPatterns: string[];
82
- };
83
- private generateSessionId;
84
- private generateRecommendations;
85
- private getStrategyRecommendation;
86
- private getEfficiencyRecommendation;
87
- private getReliabilityRecommendation;
88
- private getPerformanceRecommendation;
89
- private calculateOverallImprovement;
90
- private calculateSessionImprovement;
91
- private generateNextSteps;
92
- }
93
- //# sourceMappingURL=aiOptimizationIntegration.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"aiOptimizationIntegration.d.ts","sourceRoot":"","sources":["../../src/core/aiOptimizationIntegration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAwB,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC1G,OAAO,EAAyB,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC5G,OAAO,EAAmB,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE/F,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,eAAe,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,iBAAiB,EAAE,aAAa,EAAE,CAAC;IACnC,kBAAkB,EAAE,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