erosolar-cli 2.1.249 → 2.1.252

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 (467) hide show
  1. package/agents/general.rules.json +10 -133
  2. package/agents/general.rules.json.bak +278 -0
  3. package/agents/general.rules.json.bak2 +306 -0
  4. package/dist/bin/erosolar.js +9 -5
  5. package/dist/bin/erosolar.js.map +1 -1
  6. package/dist/capabilities/bidirectionalAuditCapability.d.ts +26 -0
  7. package/dist/capabilities/bidirectionalAuditCapability.d.ts.map +1 -0
  8. package/dist/capabilities/bidirectionalAuditCapability.js +44 -0
  9. package/dist/capabilities/bidirectionalAuditCapability.js.map +1 -0
  10. package/dist/capabilities/globCapability.d.ts +3 -6
  11. package/dist/capabilities/globCapability.d.ts.map +1 -1
  12. package/dist/capabilities/globCapability.js +6 -10
  13. package/dist/capabilities/globCapability.js.map +1 -1
  14. package/dist/capabilities/index.d.ts +1 -18
  15. package/dist/capabilities/index.d.ts.map +1 -1
  16. package/dist/capabilities/index.js +1 -18
  17. package/dist/capabilities/index.js.map +1 -1
  18. package/dist/capabilities/orchestrationCapability.d.ts +2 -0
  19. package/dist/capabilities/orchestrationCapability.d.ts.map +1 -1
  20. package/dist/capabilities/orchestrationCapability.js +980 -2
  21. package/dist/capabilities/orchestrationCapability.js.map +1 -1
  22. package/dist/capabilities/searchCapability.d.ts +8 -2
  23. package/dist/capabilities/searchCapability.d.ts.map +1 -1
  24. package/dist/capabilities/searchCapability.js +11 -6
  25. package/dist/capabilities/searchCapability.js.map +1 -1
  26. package/dist/contracts/tools.schema.json +9 -133
  27. package/dist/core/aiErrorFixer.d.ts +1 -14
  28. package/dist/core/aiErrorFixer.d.ts.map +1 -1
  29. package/dist/core/aiErrorFixer.js +51 -239
  30. package/dist/core/aiErrorFixer.js.map +1 -1
  31. package/dist/core/alphaZeroEngine.d.ts +16 -256
  32. package/dist/core/alphaZeroEngine.d.ts.map +1 -1
  33. package/dist/core/alphaZeroEngine.js +22 -513
  34. package/dist/core/alphaZeroEngine.js.map +1 -1
  35. package/dist/core/completeAttackOrchestrator.d.ts +102 -0
  36. package/dist/core/completeAttackOrchestrator.d.ts.map +1 -0
  37. package/dist/core/completeAttackOrchestrator.js +293 -0
  38. package/dist/core/completeAttackOrchestrator.js.map +1 -0
  39. package/dist/core/defensiveSecurityToolkit.d.ts +373 -0
  40. package/dist/core/defensiveSecurityToolkit.d.ts.map +1 -0
  41. package/dist/core/defensiveSecurityToolkit.js +1304 -0
  42. package/dist/core/defensiveSecurityToolkit.js.map +1 -0
  43. package/dist/core/errors/errorTypes.d.ts +30 -57
  44. package/dist/core/errors/errorTypes.d.ts.map +1 -1
  45. package/dist/core/errors/errorTypes.js +51 -228
  46. package/dist/core/errors/errorTypes.js.map +1 -1
  47. package/dist/core/errors/safetyValidator.d.ts +19 -3
  48. package/dist/core/errors/safetyValidator.d.ts.map +1 -1
  49. package/dist/core/errors/safetyValidator.js +33 -71
  50. package/dist/core/errors/safetyValidator.js.map +1 -1
  51. package/dist/core/failureRecovery.d.ts +4 -100
  52. package/dist/core/failureRecovery.d.ts.map +1 -1
  53. package/dist/core/failureRecovery.js +16 -440
  54. package/dist/core/failureRecovery.js.map +1 -1
  55. package/dist/core/intelligentTargetResearcher.d.ts +142 -0
  56. package/dist/core/intelligentTargetResearcher.d.ts.map +1 -0
  57. package/dist/core/intelligentTargetResearcher.js +367 -0
  58. package/dist/core/intelligentTargetResearcher.js.map +1 -0
  59. package/dist/core/intelligentTestFlows.d.ts +26 -107
  60. package/dist/core/intelligentTestFlows.d.ts.map +1 -1
  61. package/dist/core/intelligentTestFlows.js +15 -659
  62. package/dist/core/intelligentTestFlows.js.map +1 -1
  63. package/dist/core/learningPersistence.d.ts +45 -132
  64. package/dist/core/learningPersistence.d.ts.map +1 -1
  65. package/dist/core/learningPersistence.js +32 -463
  66. package/dist/core/learningPersistence.js.map +1 -1
  67. package/dist/core/metricsTracker.d.ts +22 -139
  68. package/dist/core/metricsTracker.d.ts.map +1 -1
  69. package/dist/core/metricsTracker.js +51 -241
  70. package/dist/core/metricsTracker.js.map +1 -1
  71. package/dist/core/performanceMonitor.d.ts +15 -109
  72. package/dist/core/performanceMonitor.d.ts.map +1 -1
  73. package/dist/core/performanceMonitor.js +27 -184
  74. package/dist/core/performanceMonitor.js.map +1 -1
  75. package/dist/core/resultVerification.d.ts +6 -100
  76. package/dist/core/resultVerification.d.ts.map +1 -1
  77. package/dist/core/resultVerification.js +31 -400
  78. package/dist/core/resultVerification.js.map +1 -1
  79. package/dist/core/selfEvolution.d.ts +32 -126
  80. package/dist/core/selfEvolution.d.ts.map +1 -1
  81. package/dist/core/selfEvolution.js +24 -967
  82. package/dist/core/selfEvolution.js.map +1 -1
  83. package/dist/core/selfImprovement.d.ts +50 -109
  84. package/dist/core/selfImprovement.d.ts.map +1 -1
  85. package/dist/core/selfImprovement.js +14 -689
  86. package/dist/core/selfImprovement.js.map +1 -1
  87. package/dist/core/sourceCodeManager.d.ts +89 -0
  88. package/dist/core/sourceCodeManager.d.ts.map +1 -0
  89. package/dist/core/sourceCodeManager.js +332 -0
  90. package/dist/core/sourceCodeManager.js.map +1 -0
  91. package/dist/core/unifiedOrchestrator.d.ts +88 -0
  92. package/dist/core/unifiedOrchestrator.d.ts.map +1 -0
  93. package/dist/core/unifiedOrchestrator.js +284 -0
  94. package/dist/core/unifiedOrchestrator.js.map +1 -0
  95. package/dist/core/userDefenseOrchestrator.d.ts +202 -0
  96. package/dist/core/userDefenseOrchestrator.d.ts.map +1 -0
  97. package/dist/core/userDefenseOrchestrator.js +1006 -0
  98. package/dist/core/userDefenseOrchestrator.js.map +1 -0
  99. package/dist/plugins/index.d.ts +1 -1
  100. package/dist/plugins/index.d.ts.map +1 -1
  101. package/dist/plugins/index.js +36 -26
  102. package/dist/plugins/index.js.map +1 -1
  103. package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts +8 -0
  104. package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts.map +1 -0
  105. package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js +17 -0
  106. package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js.map +1 -0
  107. package/dist/plugins/tools/nodeDefaults.d.ts +14 -0
  108. package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
  109. package/dist/plugins/tools/nodeDefaults.js +17 -54
  110. package/dist/plugins/tools/nodeDefaults.js.map +1 -1
  111. package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts +9 -0
  112. package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts.map +1 -0
  113. package/dist/plugins/tools/orchestration/orchestrationPlugin.js +18 -0
  114. package/dist/plugins/tools/orchestration/orchestrationPlugin.js.map +1 -0
  115. package/dist/shell/interactiveShell.d.ts +97 -2
  116. package/dist/shell/interactiveShell.d.ts.map +1 -1
  117. package/dist/shell/interactiveShell.js +1001 -6
  118. package/dist/shell/interactiveShell.js.map +1 -1
  119. package/dist/tools/appleExposureTools.d.ts +108 -0
  120. package/dist/tools/appleExposureTools.d.ts.map +1 -0
  121. package/dist/tools/appleExposureTools.js +850 -0
  122. package/dist/tools/appleExposureTools.js.map +1 -0
  123. package/dist/tools/bidirectionalAuditTools.d.ts +104 -0
  124. package/dist/tools/bidirectionalAuditTools.d.ts.map +1 -0
  125. package/dist/tools/bidirectionalAuditTools.js +1280 -0
  126. package/dist/tools/bidirectionalAuditTools.js.map +1 -0
  127. package/dist/tools/defensiveSecurityTools.d.ts +152 -0
  128. package/dist/tools/defensiveSecurityTools.d.ts.map +1 -0
  129. package/dist/tools/defensiveSecurityTools.js +576 -0
  130. package/dist/tools/defensiveSecurityTools.js.map +1 -0
  131. package/dist/tools/forwardAttackChainTracer.d.ts +73 -0
  132. package/dist/tools/forwardAttackChainTracer.d.ts.map +1 -0
  133. package/dist/tools/forwardAttackChainTracer.js +604 -0
  134. package/dist/tools/forwardAttackChainTracer.js.map +1 -0
  135. package/dist/tools/localExplore.d.ts +12 -199
  136. package/dist/tools/localExplore.d.ts.map +1 -1
  137. package/dist/tools/localExplore.js +18 -1352
  138. package/dist/tools/localExplore.js.map +1 -1
  139. package/dist/tools/offensiveTransparencyTools.d.ts +188 -0
  140. package/dist/tools/offensiveTransparencyTools.d.ts.map +1 -0
  141. package/dist/tools/offensiveTransparencyTools.js +890 -0
  142. package/dist/tools/offensiveTransparencyTools.js.map +1 -0
  143. package/dist/tools/planningTools.d.ts +8 -17
  144. package/dist/tools/planningTools.d.ts.map +1 -1
  145. package/dist/tools/planningTools.js +31 -141
  146. package/dist/tools/planningTools.js.map +1 -1
  147. package/dist/tools/searchTools.d.ts +9 -0
  148. package/dist/tools/searchTools.d.ts.map +1 -1
  149. package/dist/tools/searchTools.js +305 -189
  150. package/dist/tools/searchTools.js.map +1 -1
  151. package/dist/tools/skillTools.d.ts +7 -5
  152. package/dist/tools/skillTools.d.ts.map +1 -1
  153. package/dist/tools/skillTools.js +13 -155
  154. package/dist/tools/skillTools.js.map +1 -1
  155. package/dist/tools/threatIntelligenceTools.d.ts +128 -0
  156. package/dist/tools/threatIntelligenceTools.d.ts.map +1 -0
  157. package/dist/tools/threatIntelligenceTools.js +712 -0
  158. package/dist/tools/threatIntelligenceTools.js.map +1 -0
  159. package/dist/ui/PromptController.d.ts +4 -0
  160. package/dist/ui/PromptController.d.ts.map +1 -1
  161. package/dist/ui/PromptController.js +32 -11
  162. package/dist/ui/PromptController.js.map +1 -1
  163. package/dist/ui/UnifiedUIRenderer.d.ts +20 -0
  164. package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -1
  165. package/dist/ui/UnifiedUIRenderer.js +235 -28
  166. package/dist/ui/UnifiedUIRenderer.js.map +1 -1
  167. package/dist/ui/animatedStatus.d.ts +2 -0
  168. package/dist/ui/animatedStatus.d.ts.map +1 -1
  169. package/dist/ui/animatedStatus.js +36 -2
  170. package/dist/ui/animatedStatus.js.map +1 -1
  171. package/dist/ui/orchestration/StatusOrchestrator.d.ts +10 -0
  172. package/dist/ui/orchestration/StatusOrchestrator.d.ts.map +1 -1
  173. package/dist/ui/orchestration/StatusOrchestrator.js +36 -4
  174. package/dist/ui/orchestration/StatusOrchestrator.js.map +1 -1
  175. package/package.json +1 -1
  176. package/dist/capabilities/advancedTestGenerationCapability.d.ts +0 -17
  177. package/dist/capabilities/advancedTestGenerationCapability.d.ts.map +0 -1
  178. package/dist/capabilities/advancedTestGenerationCapability.js +0 -28
  179. package/dist/capabilities/advancedTestGenerationCapability.js.map +0 -1
  180. package/dist/capabilities/browserAutomationCapability.d.ts +0 -37
  181. package/dist/capabilities/browserAutomationCapability.d.ts.map +0 -1
  182. package/dist/capabilities/browserAutomationCapability.js +0 -49
  183. package/dist/capabilities/browserAutomationCapability.js.map +0 -1
  184. package/dist/capabilities/buildCapability.d.ts +0 -24
  185. package/dist/capabilities/buildCapability.d.ts.map +0 -1
  186. package/dist/capabilities/buildCapability.js +0 -25
  187. package/dist/capabilities/buildCapability.js.map +0 -1
  188. package/dist/capabilities/cloudCapability.d.ts +0 -13
  189. package/dist/capabilities/cloudCapability.d.ts.map +0 -1
  190. package/dist/capabilities/cloudCapability.js +0 -38
  191. package/dist/capabilities/cloudCapability.js.map +0 -1
  192. package/dist/capabilities/codeAnalysisCapability.d.ts +0 -13
  193. package/dist/capabilities/codeAnalysisCapability.d.ts.map +0 -1
  194. package/dist/capabilities/codeAnalysisCapability.js +0 -24
  195. package/dist/capabilities/codeAnalysisCapability.js.map +0 -1
  196. package/dist/capabilities/codeQualityCapability.d.ts +0 -13
  197. package/dist/capabilities/codeQualityCapability.d.ts.map +0 -1
  198. package/dist/capabilities/codeQualityCapability.js +0 -25
  199. package/dist/capabilities/codeQualityCapability.js.map +0 -1
  200. package/dist/capabilities/dependencySecurityCapability.d.ts +0 -13
  201. package/dist/capabilities/dependencySecurityCapability.d.ts.map +0 -1
  202. package/dist/capabilities/dependencySecurityCapability.js +0 -24
  203. package/dist/capabilities/dependencySecurityCapability.js.map +0 -1
  204. package/dist/capabilities/devCapability.d.ts +0 -13
  205. package/dist/capabilities/devCapability.d.ts.map +0 -1
  206. package/dist/capabilities/devCapability.js +0 -24
  207. package/dist/capabilities/devCapability.js.map +0 -1
  208. package/dist/capabilities/emailCapability.d.ts +0 -12
  209. package/dist/capabilities/emailCapability.d.ts.map +0 -1
  210. package/dist/capabilities/emailCapability.js +0 -22
  211. package/dist/capabilities/emailCapability.js.map +0 -1
  212. package/dist/capabilities/enhancedAnalysisCapability.d.ts +0 -13
  213. package/dist/capabilities/enhancedAnalysisCapability.d.ts.map +0 -1
  214. package/dist/capabilities/enhancedAnalysisCapability.js +0 -20
  215. package/dist/capabilities/enhancedAnalysisCapability.js.map +0 -1
  216. package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts +0 -17
  217. package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts.map +0 -1
  218. package/dist/capabilities/enhancedCodeIntelligenceCapability.js +0 -28
  219. package/dist/capabilities/enhancedCodeIntelligenceCapability.js.map +0 -1
  220. package/dist/capabilities/enhancedDevWorkflowCapability.d.ts +0 -17
  221. package/dist/capabilities/enhancedDevWorkflowCapability.d.ts.map +0 -1
  222. package/dist/capabilities/enhancedDevWorkflowCapability.js +0 -28
  223. package/dist/capabilities/enhancedDevWorkflowCapability.js.map +0 -1
  224. package/dist/capabilities/frontendTestingCapability.d.ts +0 -13
  225. package/dist/capabilities/frontendTestingCapability.d.ts.map +0 -1
  226. package/dist/capabilities/frontendTestingCapability.js +0 -28
  227. package/dist/capabilities/frontendTestingCapability.js.map +0 -1
  228. package/dist/capabilities/interactionCapability.d.ts +0 -12
  229. package/dist/capabilities/interactionCapability.d.ts.map +0 -1
  230. package/dist/capabilities/interactionCapability.js +0 -22
  231. package/dist/capabilities/interactionCapability.js.map +0 -1
  232. package/dist/capabilities/learnCapability.d.ts +0 -22
  233. package/dist/capabilities/learnCapability.d.ts.map +0 -1
  234. package/dist/capabilities/learnCapability.js +0 -37
  235. package/dist/capabilities/learnCapability.js.map +0 -1
  236. package/dist/capabilities/notebookCapability.d.ts +0 -17
  237. package/dist/capabilities/notebookCapability.d.ts.map +0 -1
  238. package/dist/capabilities/notebookCapability.js +0 -27
  239. package/dist/capabilities/notebookCapability.js.map +0 -1
  240. package/dist/capabilities/planningCapability.d.ts +0 -16
  241. package/dist/capabilities/planningCapability.d.ts.map +0 -1
  242. package/dist/capabilities/planningCapability.js +0 -26
  243. package/dist/capabilities/planningCapability.js.map +0 -1
  244. package/dist/capabilities/refactoringCapability.d.ts +0 -13
  245. package/dist/capabilities/refactoringCapability.d.ts.map +0 -1
  246. package/dist/capabilities/refactoringCapability.js +0 -25
  247. package/dist/capabilities/refactoringCapability.js.map +0 -1
  248. package/dist/capabilities/repoChecksCapability.d.ts +0 -10
  249. package/dist/capabilities/repoChecksCapability.d.ts.map +0 -1
  250. package/dist/capabilities/repoChecksCapability.js +0 -24
  251. package/dist/capabilities/repoChecksCapability.js.map +0 -1
  252. package/dist/capabilities/taskManagementCapability.d.ts +0 -12
  253. package/dist/capabilities/taskManagementCapability.d.ts.map +0 -1
  254. package/dist/capabilities/taskManagementCapability.js +0 -22
  255. package/dist/capabilities/taskManagementCapability.js.map +0 -1
  256. package/dist/capabilities/testingCapability.d.ts +0 -13
  257. package/dist/capabilities/testingCapability.d.ts.map +0 -1
  258. package/dist/capabilities/testingCapability.js +0 -25
  259. package/dist/capabilities/testingCapability.js.map +0 -1
  260. package/dist/capabilities/validationCapability.d.ts +0 -13
  261. package/dist/capabilities/validationCapability.d.ts.map +0 -1
  262. package/dist/capabilities/validationCapability.js +0 -24
  263. package/dist/capabilities/validationCapability.js.map +0 -1
  264. package/dist/capabilities/webCapability.d.ts +0 -12
  265. package/dist/capabilities/webCapability.d.ts.map +0 -1
  266. package/dist/capabilities/webCapability.js +0 -22
  267. package/dist/capabilities/webCapability.js.map +0 -1
  268. package/dist/core/deepBugAnalyzer.d.ts +0 -128
  269. package/dist/core/deepBugAnalyzer.d.ts.map +0 -1
  270. package/dist/core/deepBugAnalyzer.js +0 -406
  271. package/dist/core/deepBugAnalyzer.js.map +0 -1
  272. package/dist/core/hypothesisEngine.d.ts +0 -113
  273. package/dist/core/hypothesisEngine.d.ts.map +0 -1
  274. package/dist/core/hypothesisEngine.js +0 -264
  275. package/dist/core/hypothesisEngine.js.map +0 -1
  276. package/dist/core/productTestHarness.d.ts +0 -113
  277. package/dist/core/productTestHarness.d.ts.map +0 -1
  278. package/dist/core/productTestHarness.js +0 -351
  279. package/dist/core/productTestHarness.js.map +0 -1
  280. package/dist/core/validationRunner.d.ts +0 -106
  281. package/dist/core/validationRunner.d.ts.map +0 -1
  282. package/dist/core/validationRunner.js +0 -892
  283. package/dist/core/validationRunner.js.map +0 -1
  284. package/dist/plugins/tools/browser/browserAutomationPlugin.d.ts +0 -14
  285. package/dist/plugins/tools/browser/browserAutomationPlugin.d.ts.map +0 -1
  286. package/dist/plugins/tools/browser/browserAutomationPlugin.js +0 -26
  287. package/dist/plugins/tools/browser/browserAutomationPlugin.js.map +0 -1
  288. package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts +0 -3
  289. package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts.map +0 -1
  290. package/dist/plugins/tools/checks/localRepoChecksPlugin.js +0 -14
  291. package/dist/plugins/tools/checks/localRepoChecksPlugin.js.map +0 -1
  292. package/dist/plugins/tools/cloud/cloudPlugin.d.ts +0 -3
  293. package/dist/plugins/tools/cloud/cloudPlugin.d.ts.map +0 -1
  294. package/dist/plugins/tools/cloud/cloudPlugin.js +0 -14
  295. package/dist/plugins/tools/cloud/cloudPlugin.js.map +0 -1
  296. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts +0 -3
  297. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts.map +0 -1
  298. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +0 -14
  299. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js.map +0 -1
  300. package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts +0 -3
  301. package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts.map +0 -1
  302. package/dist/plugins/tools/codeQuality/codeQualityPlugin.js +0 -14
  303. package/dist/plugins/tools/codeQuality/codeQualityPlugin.js.map +0 -1
  304. package/dist/plugins/tools/dependency/dependencyPlugin.d.ts +0 -3
  305. package/dist/plugins/tools/dependency/dependencyPlugin.d.ts.map +0 -1
  306. package/dist/plugins/tools/dependency/dependencyPlugin.js +0 -12
  307. package/dist/plugins/tools/dependency/dependencyPlugin.js.map +0 -1
  308. package/dist/plugins/tools/development/devPlugin.d.ts +0 -3
  309. package/dist/plugins/tools/development/devPlugin.d.ts.map +0 -1
  310. package/dist/plugins/tools/development/devPlugin.js +0 -14
  311. package/dist/plugins/tools/development/devPlugin.js.map +0 -1
  312. package/dist/plugins/tools/email/emailPlugin.d.ts +0 -3
  313. package/dist/plugins/tools/email/emailPlugin.d.ts.map +0 -1
  314. package/dist/plugins/tools/email/emailPlugin.js +0 -12
  315. package/dist/plugins/tools/email/emailPlugin.js.map +0 -1
  316. package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.d.ts +0 -3
  317. package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.d.ts.map +0 -1
  318. package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.js +0 -14
  319. package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.js.map +0 -1
  320. package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.d.ts +0 -3
  321. package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.d.ts.map +0 -1
  322. package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.js +0 -12
  323. package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.js.map +0 -1
  324. package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.d.ts +0 -3
  325. package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.d.ts.map +0 -1
  326. package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.js +0 -12
  327. package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.js.map +0 -1
  328. package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.d.ts +0 -3
  329. package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.d.ts.map +0 -1
  330. package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js +0 -14
  331. package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js.map +0 -1
  332. package/dist/plugins/tools/interaction/interactionPlugin.d.ts +0 -3
  333. package/dist/plugins/tools/interaction/interactionPlugin.d.ts.map +0 -1
  334. package/dist/plugins/tools/interaction/interactionPlugin.js +0 -12
  335. package/dist/plugins/tools/interaction/interactionPlugin.js.map +0 -1
  336. package/dist/plugins/tools/learn/learnPlugin.d.ts +0 -3
  337. package/dist/plugins/tools/learn/learnPlugin.d.ts.map +0 -1
  338. package/dist/plugins/tools/learn/learnPlugin.js +0 -14
  339. package/dist/plugins/tools/learn/learnPlugin.js.map +0 -1
  340. package/dist/plugins/tools/notebook/notebookPlugin.d.ts +0 -9
  341. package/dist/plugins/tools/notebook/notebookPlugin.d.ts.map +0 -1
  342. package/dist/plugins/tools/notebook/notebookPlugin.js +0 -15
  343. package/dist/plugins/tools/notebook/notebookPlugin.js.map +0 -1
  344. package/dist/plugins/tools/planning/planningPlugin.d.ts +0 -9
  345. package/dist/plugins/tools/planning/planningPlugin.d.ts.map +0 -1
  346. package/dist/plugins/tools/planning/planningPlugin.js +0 -15
  347. package/dist/plugins/tools/planning/planningPlugin.js.map +0 -1
  348. package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts +0 -3
  349. package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts.map +0 -1
  350. package/dist/plugins/tools/refactoring/refactoringPlugin.js +0 -12
  351. package/dist/plugins/tools/refactoring/refactoringPlugin.js.map +0 -1
  352. package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts +0 -3
  353. package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts.map +0 -1
  354. package/dist/plugins/tools/taskManagement/taskManagementPlugin.js +0 -12
  355. package/dist/plugins/tools/taskManagement/taskManagementPlugin.js.map +0 -1
  356. package/dist/plugins/tools/testing/testingPlugin.d.ts +0 -3
  357. package/dist/plugins/tools/testing/testingPlugin.d.ts.map +0 -1
  358. package/dist/plugins/tools/testing/testingPlugin.js +0 -12
  359. package/dist/plugins/tools/testing/testingPlugin.js.map +0 -1
  360. package/dist/plugins/tools/validation/validationPlugin.d.ts +0 -3
  361. package/dist/plugins/tools/validation/validationPlugin.d.ts.map +0 -1
  362. package/dist/plugins/tools/validation/validationPlugin.js +0 -14
  363. package/dist/plugins/tools/validation/validationPlugin.js.map +0 -1
  364. package/dist/plugins/tools/web/webPlugin.d.ts +0 -3
  365. package/dist/plugins/tools/web/webPlugin.d.ts.map +0 -1
  366. package/dist/plugins/tools/web/webPlugin.js +0 -12
  367. package/dist/plugins/tools/web/webPlugin.js.map +0 -1
  368. package/dist/tools/advancedTestGenerationTools.d.ts +0 -21
  369. package/dist/tools/advancedTestGenerationTools.d.ts.map +0 -1
  370. package/dist/tools/advancedTestGenerationTools.js +0 -304
  371. package/dist/tools/advancedTestGenerationTools.js.map +0 -1
  372. package/dist/tools/browserAutomationTools.d.ts +0 -23
  373. package/dist/tools/browserAutomationTools.d.ts.map +0 -1
  374. package/dist/tools/browserAutomationTools.js +0 -916
  375. package/dist/tools/browserAutomationTools.js.map +0 -1
  376. package/dist/tools/buildTools.d.ts +0 -9
  377. package/dist/tools/buildTools.d.ts.map +0 -1
  378. package/dist/tools/buildTools.js +0 -346
  379. package/dist/tools/buildTools.js.map +0 -1
  380. package/dist/tools/cloudTools.d.ts +0 -49
  381. package/dist/tools/cloudTools.d.ts.map +0 -1
  382. package/dist/tools/cloudTools.js +0 -1258
  383. package/dist/tools/cloudTools.js.map +0 -1
  384. package/dist/tools/codeAnalysisTools.d.ts +0 -74
  385. package/dist/tools/codeAnalysisTools.d.ts.map +0 -1
  386. package/dist/tools/codeAnalysisTools.js +0 -664
  387. package/dist/tools/codeAnalysisTools.js.map +0 -1
  388. package/dist/tools/codeGenerationTools.d.ts +0 -3
  389. package/dist/tools/codeGenerationTools.d.ts.map +0 -1
  390. package/dist/tools/codeGenerationTools.js +0 -439
  391. package/dist/tools/codeGenerationTools.js.map +0 -1
  392. package/dist/tools/codeQualityTools.d.ts +0 -3
  393. package/dist/tools/codeQualityTools.d.ts.map +0 -1
  394. package/dist/tools/codeQualityTools.js +0 -297
  395. package/dist/tools/codeQualityTools.js.map +0 -1
  396. package/dist/tools/dependencyTools.d.ts +0 -3
  397. package/dist/tools/dependencyTools.d.ts.map +0 -1
  398. package/dist/tools/dependencyTools.js +0 -284
  399. package/dist/tools/dependencyTools.js.map +0 -1
  400. package/dist/tools/devTools.d.ts +0 -10
  401. package/dist/tools/devTools.d.ts.map +0 -1
  402. package/dist/tools/devTools.js +0 -2126
  403. package/dist/tools/devTools.js.map +0 -1
  404. package/dist/tools/emailTools.d.ts +0 -21
  405. package/dist/tools/emailTools.d.ts.map +0 -1
  406. package/dist/tools/emailTools.js +0 -449
  407. package/dist/tools/emailTools.js.map +0 -1
  408. package/dist/tools/enhancedAnalysisTools.d.ts +0 -9
  409. package/dist/tools/enhancedAnalysisTools.d.ts.map +0 -1
  410. package/dist/tools/enhancedAnalysisTools.js +0 -370
  411. package/dist/tools/enhancedAnalysisTools.js.map +0 -1
  412. package/dist/tools/enhancedCodeIntelligenceTools.d.ts +0 -7
  413. package/dist/tools/enhancedCodeIntelligenceTools.d.ts.map +0 -1
  414. package/dist/tools/enhancedCodeIntelligenceTools.js +0 -540
  415. package/dist/tools/enhancedCodeIntelligenceTools.js.map +0 -1
  416. package/dist/tools/enhancedDevWorkflowTools.d.ts +0 -7
  417. package/dist/tools/enhancedDevWorkflowTools.d.ts.map +0 -1
  418. package/dist/tools/enhancedDevWorkflowTools.js +0 -432
  419. package/dist/tools/enhancedDevWorkflowTools.js.map +0 -1
  420. package/dist/tools/frontendTestingTools.d.ts +0 -35
  421. package/dist/tools/frontendTestingTools.d.ts.map +0 -1
  422. package/dist/tools/frontendTestingTools.js +0 -1258
  423. package/dist/tools/frontendTestingTools.js.map +0 -1
  424. package/dist/tools/globTools.d.ts +0 -15
  425. package/dist/tools/globTools.d.ts.map +0 -1
  426. package/dist/tools/globTools.js +0 -174
  427. package/dist/tools/globTools.js.map +0 -1
  428. package/dist/tools/grepTools.d.ts +0 -19
  429. package/dist/tools/grepTools.d.ts.map +0 -1
  430. package/dist/tools/grepTools.js +0 -411
  431. package/dist/tools/grepTools.js.map +0 -1
  432. package/dist/tools/interactionTools.d.ts +0 -6
  433. package/dist/tools/interactionTools.d.ts.map +0 -1
  434. package/dist/tools/interactionTools.js +0 -209
  435. package/dist/tools/interactionTools.js.map +0 -1
  436. package/dist/tools/learnTools.d.ts +0 -164
  437. package/dist/tools/learnTools.d.ts.map +0 -1
  438. package/dist/tools/learnTools.js +0 -2098
  439. package/dist/tools/learnTools.js.map +0 -1
  440. package/dist/tools/notebookEditTools.d.ts +0 -15
  441. package/dist/tools/notebookEditTools.d.ts.map +0 -1
  442. package/dist/tools/notebookEditTools.js +0 -197
  443. package/dist/tools/notebookEditTools.js.map +0 -1
  444. package/dist/tools/refactoringTools.d.ts +0 -3
  445. package/dist/tools/refactoringTools.d.ts.map +0 -1
  446. package/dist/tools/refactoringTools.js +0 -294
  447. package/dist/tools/refactoringTools.js.map +0 -1
  448. package/dist/tools/repoChecksTools.d.ts +0 -3
  449. package/dist/tools/repoChecksTools.d.ts.map +0 -1
  450. package/dist/tools/repoChecksTools.js +0 -276
  451. package/dist/tools/repoChecksTools.js.map +0 -1
  452. package/dist/tools/taskManagementTools.d.ts +0 -10
  453. package/dist/tools/taskManagementTools.d.ts.map +0 -1
  454. package/dist/tools/taskManagementTools.js +0 -133
  455. package/dist/tools/taskManagementTools.js.map +0 -1
  456. package/dist/tools/testingTools.d.ts +0 -3
  457. package/dist/tools/testingTools.d.ts.map +0 -1
  458. package/dist/tools/testingTools.js +0 -237
  459. package/dist/tools/testingTools.js.map +0 -1
  460. package/dist/tools/validationTools.d.ts +0 -7
  461. package/dist/tools/validationTools.d.ts.map +0 -1
  462. package/dist/tools/validationTools.js +0 -344
  463. package/dist/tools/validationTools.js.map +0 -1
  464. package/dist/tools/webTools.d.ts +0 -3
  465. package/dist/tools/webTools.d.ts.map +0 -1
  466. package/dist/tools/webTools.js +0 -502
  467. package/dist/tools/webTools.js.map +0 -1
@@ -1,892 +0,0 @@
1
- /**
2
- * Comprehensive validation runner for AI software engineering.
3
- * Validates all changes (TypeScript, tests, lint) and provides intelligent error parsing
4
- * with actionable fix suggestions - similar to Erosolar-CLI's validation flow.
5
- */
6
- import { exec } from 'node:child_process';
7
- import { readFile, access } from 'node:fs/promises';
8
- import { join } from 'node:path';
9
- import { promisify } from 'node:util';
10
- const execAsync = promisify(exec);
11
- // ============================================================================
12
- // Error Parsers
13
- // ============================================================================
14
- /**
15
- * Parse TypeScript compiler errors into structured format
16
- */
17
- export function parseTypeScriptErrors(output) {
18
- const errors = [];
19
- // Match patterns like: src/file.ts(10,5): error TS2322: Type 'string' is not assignable...
20
- // or: src/file.ts:10:5 - error TS2322: Type 'string' is not assignable...
21
- const patterns = [
22
- /^(.+?)\((\d+),(\d+)\):\s*(error|warning)\s+(TS\d+):\s*(.+)$/gm,
23
- /^(.+?):(\d+):(\d+)\s*-\s*(error|warning)\s+(TS\d+):\s*(.+)$/gm,
24
- ];
25
- for (const pattern of patterns) {
26
- let match;
27
- while ((match = pattern.exec(output)) !== null) {
28
- const [, file, line, column, severity, code, message] = match;
29
- const error = {
30
- type: 'typescript',
31
- file,
32
- line: parseInt(line, 10),
33
- column: parseInt(column, 10),
34
- code,
35
- message: message.trim(),
36
- severity: severity === 'error' ? 'error' : 'warning',
37
- suggestedFix: generateTypeScriptFix(code, message.trim(), file),
38
- };
39
- errors.push(error);
40
- }
41
- }
42
- return errors;
43
- }
44
- /**
45
- * Parse Jest/test runner errors into structured format
46
- */
47
- export function parseTestErrors(output) {
48
- const errors = [];
49
- // Match Jest failure patterns
50
- // FAIL src/tests/foo.test.ts
51
- const failPattern = /FAIL\s+(.+\.(?:test|spec)\.[jt]sx?)/g;
52
- let match;
53
- while ((match = failPattern.exec(output)) !== null) {
54
- const file = match[1];
55
- // Try to extract specific test failure details
56
- const testNamePattern = /✕\s+(.+?)(?:\s+\((\d+)\s*ms\))?$/gm;
57
- let testMatch;
58
- while ((testMatch = testNamePattern.exec(output)) !== null) {
59
- errors.push({
60
- type: 'test',
61
- file,
62
- message: `Test failed: ${testMatch[1]}`,
63
- severity: 'error',
64
- suggestedFix: {
65
- description: 'Review test assertion and fix the code or update the test',
66
- autoFixable: false,
67
- fixType: 'manual',
68
- fixDetails: {
69
- manualSteps: [
70
- `Open ${file}`,
71
- `Find test: "${testMatch[1]}"`,
72
- 'Review assertion failure',
73
- 'Fix the code or update the expected value',
74
- ],
75
- },
76
- },
77
- });
78
- }
79
- }
80
- // Match assertion errors
81
- const assertPattern = /expect\((.+?)\)\.(.+?)\((.+?)\)/g;
82
- while ((match = assertPattern.exec(output)) !== null) {
83
- errors.push({
84
- type: 'test',
85
- message: `Assertion failed: expect(${match[1]}).${match[2]}(${match[3]})`,
86
- severity: 'error',
87
- rawOutput: match[0],
88
- });
89
- }
90
- return errors;
91
- }
92
- /**
93
- * Parse ESLint errors into structured format
94
- */
95
- export function parseLintErrors(output) {
96
- const errors = [];
97
- // Match ESLint output patterns
98
- // /path/to/file.ts
99
- // 10:5 error 'foo' is defined but never used @typescript-eslint/no-unused-vars
100
- let currentFile = null;
101
- const lines = output.split('\n');
102
- for (const line of lines) {
103
- const fileMatch = line.match(/^([^\s].+\.[jt]sx?)$/);
104
- if (fileMatch) {
105
- currentFile = fileMatch[1];
106
- continue;
107
- }
108
- const errorMatch = line.match(/^\s+(\d+):(\d+)\s+(error|warning)\s+(.+?)\s{2,}(.+)$/);
109
- if (errorMatch && currentFile) {
110
- const [, lineNum, column, severity, message, rule] = errorMatch;
111
- errors.push({
112
- type: 'lint',
113
- file: currentFile,
114
- line: parseInt(lineNum, 10),
115
- column: parseInt(column, 10),
116
- code: rule,
117
- message: message.trim(),
118
- severity: severity === 'error' ? 'error' : 'warning',
119
- suggestedFix: generateLintFix(rule, message.trim(), currentFile, parseInt(lineNum, 10)),
120
- });
121
- }
122
- }
123
- return errors;
124
- }
125
- // ============================================================================
126
- // Fix Generators
127
- // ============================================================================
128
- /**
129
- * Generate suggested fix for TypeScript errors
130
- */
131
- function generateTypeScriptFix(code, _message, file) {
132
- const fixes = {
133
- // Type assignment errors
134
- 'TS2322': () => ({
135
- description: 'Type mismatch - update the type annotation or fix the value',
136
- autoFixable: false,
137
- fixType: 'manual',
138
- fixDetails: {
139
- file,
140
- manualSteps: [
141
- 'Check if the assigned value is correct',
142
- 'Update the type annotation if the value is intentional',
143
- 'Or fix the value to match the expected type',
144
- ],
145
- },
146
- }),
147
- // Property does not exist
148
- 'TS2339': () => ({
149
- description: 'Property does not exist on type',
150
- autoFixable: false,
151
- fixType: 'manual',
152
- fixDetails: {
153
- file,
154
- manualSteps: [
155
- 'Check if the property name is spelled correctly',
156
- 'Add the property to the interface/type definition',
157
- 'Use optional chaining (?.) if property might not exist',
158
- ],
159
- },
160
- }),
161
- // Cannot find name
162
- 'TS2304': () => ({
163
- description: 'Cannot find name - likely missing import',
164
- autoFixable: true,
165
- fixType: 'command',
166
- fixDetails: {
167
- command: 'Add the missing import statement at the top of the file',
168
- manualSteps: [
169
- 'Identify what needs to be imported',
170
- 'Add import statement',
171
- 'Or declare the variable/type if it should be local',
172
- ],
173
- },
174
- }),
175
- // Module not found
176
- 'TS2307': () => ({
177
- description: 'Cannot find module - check import path or install package',
178
- autoFixable: false,
179
- fixType: 'manual',
180
- fixDetails: {
181
- manualSteps: [
182
- 'Check if the import path is correct',
183
- 'If it\'s an npm package, run: npm install <package>',
184
- 'If it\'s a local file, verify the path exists',
185
- ],
186
- },
187
- }),
188
- // Argument type mismatch
189
- 'TS2345': () => ({
190
- description: 'Argument type mismatch',
191
- autoFixable: false,
192
- fixType: 'manual',
193
- fixDetails: {
194
- file,
195
- manualSteps: [
196
- 'Check the function signature for expected parameter types',
197
- 'Cast the argument if appropriate: (arg as ExpectedType)',
198
- 'Or fix the argument value to match expected type',
199
- ],
200
- },
201
- }),
202
- // Object comparison warning
203
- 'TS2839': () => ({
204
- description: 'Object comparison by reference - use proper comparison',
205
- autoFixable: true,
206
- fixType: 'edit',
207
- fixDetails: {
208
- file,
209
- manualSteps: [
210
- 'Extract one side to a variable first',
211
- 'Or use JSON.stringify for deep comparison',
212
- 'Or use a proper equality function',
213
- ],
214
- },
215
- }),
216
- // Unused variable
217
- 'TS6133': () => ({
218
- description: 'Variable declared but never used',
219
- autoFixable: true,
220
- fixType: 'edit',
221
- fixDetails: {
222
- file,
223
- manualSteps: [
224
- 'Remove the unused variable',
225
- 'Or prefix with underscore if intentionally unused: _variable',
226
- 'Or use the variable where intended',
227
- ],
228
- },
229
- }),
230
- // Implicit any
231
- 'TS7006': () => ({
232
- description: 'Parameter implicitly has an any type',
233
- autoFixable: true,
234
- fixType: 'edit',
235
- fixDetails: {
236
- file,
237
- manualSteps: [
238
- 'Add explicit type annotation to the parameter',
239
- 'Example: (param: string) instead of (param)',
240
- ],
241
- },
242
- }),
243
- };
244
- const fixGenerator = fixes[code];
245
- return fixGenerator?.();
246
- }
247
- /**
248
- * Generate suggested fix for ESLint errors
249
- */
250
- function generateLintFix(rule, _message, file, _line) {
251
- const fixes = {
252
- // Unused variables
253
- '@typescript-eslint/no-unused-vars': () => ({
254
- description: 'Remove unused variable or prefix with underscore',
255
- autoFixable: true,
256
- fixType: 'command',
257
- fixDetails: {
258
- command: `eslint --fix ${file}`,
259
- manualSteps: [
260
- 'Remove the unused variable declaration',
261
- 'Or prefix with underscore: const _unused = ...',
262
- ],
263
- },
264
- }),
265
- // Missing return type
266
- '@typescript-eslint/explicit-function-return-type': () => ({
267
- description: 'Add explicit return type to function',
268
- autoFixable: false,
269
- fixType: 'manual',
270
- fixDetails: {
271
- file,
272
- manualSteps: [
273
- 'Add return type annotation after function parameters',
274
- 'Example: function foo(): ReturnType { ... }',
275
- ],
276
- },
277
- }),
278
- // Prefer const
279
- 'prefer-const': () => ({
280
- description: 'Use const instead of let for variables that are never reassigned',
281
- autoFixable: true,
282
- fixType: 'command',
283
- fixDetails: {
284
- command: `eslint --fix ${file}`,
285
- },
286
- }),
287
- // No explicit any
288
- '@typescript-eslint/no-explicit-any': () => ({
289
- description: 'Replace any with a specific type',
290
- autoFixable: false,
291
- fixType: 'manual',
292
- fixDetails: {
293
- file,
294
- manualSteps: [
295
- 'Replace `any` with the actual expected type',
296
- 'Use `unknown` if type is truly unknown and add type guards',
297
- ],
298
- },
299
- }),
300
- };
301
- const fixGenerator = fixes[rule];
302
- return fixGenerator?.();
303
- }
304
- // ============================================================================
305
- // Insight Helpers
306
- // ============================================================================
307
- function analyzeErrorCodes(errors) {
308
- const counts = new Map();
309
- for (const error of errors) {
310
- const key = error.code || error.type;
311
- counts.set(key, (counts.get(key) ?? 0) + 1);
312
- }
313
- return Array.from(counts.entries())
314
- .map(([code, count]) => ({ code, count }))
315
- .sort((a, b) => b.count - a.count)
316
- .slice(0, 5);
317
- }
318
- function analyzeTopFiles(errors) {
319
- const counts = new Map();
320
- for (const error of errors) {
321
- if (!error.file)
322
- continue;
323
- counts.set(error.file, (counts.get(error.file) ?? 0) + 1);
324
- }
325
- return Array.from(counts.entries())
326
- .map(([file, count]) => ({ file, count }))
327
- .sort((a, b) => b.count - a.count)
328
- .slice(0, 5);
329
- }
330
- function buildValidationInsights(errors, warnings) {
331
- const rootCauseHints = new Set();
332
- const recoveryPlan = [];
333
- const hasTypeScriptErrors = errors.some(e => e.type === 'typescript');
334
- const hasTestFailures = errors.some(e => e.type === 'test');
335
- const hasLintErrors = errors.some(e => e.type === 'lint');
336
- const hasBuildErrors = errors.some(e => e.type === 'build');
337
- const autoFixable = errors.filter(e => e.suggestedFix?.autoFixable).length;
338
- const codes = analyzeErrorCodes(errors);
339
- const topFiles = analyzeTopFiles(errors);
340
- const totalErrors = errors.length;
341
- if (totalErrors === 0 && warnings.length === 0) {
342
- return {
343
- rootCauseHints: [],
344
- recoveryPlan: [],
345
- dominantErrorCodes: [],
346
- topFiles: [],
347
- };
348
- }
349
- // Root-cause heuristics
350
- if (errors.some(e => e.code === 'TS2307')) {
351
- rootCauseHints.add('TypeScript cannot find modules (TS2307) - check import paths or install missing dependencies.');
352
- }
353
- if (errors.some(e => e.code === 'TS2304')) {
354
- rootCauseHints.add('Missing identifiers (TS2304) - add imports or definitions before rerunning types.');
355
- }
356
- if (errors.some(e => e.code === '@typescript-eslint/no-unused-vars')) {
357
- rootCauseHints.add('Unused variable lint errors detected - these are usually auto-fixable with eslint --fix.');
358
- }
359
- if (hasTestFailures) {
360
- rootCauseHints.add('Tests are failing - inspect the first failing test output and fix the assertion/code before rerunning all tests.');
361
- }
362
- if (hasBuildErrors) {
363
- rootCauseHints.add('Build failed - resolve TypeScript errors first, then re-run the build to catch bundler issues.');
364
- }
365
- if (warnings.length > 0 && !hasTypeScriptErrors && !hasLintErrors && !hasTestFailures && !hasBuildErrors) {
366
- rootCauseHints.add('Only warnings detected - ensure they are intentional or adjust configurations to silence intentional warnings.');
367
- }
368
- if (totalErrors > 25 && codes[0]) {
369
- rootCauseHints.add(`High error volume (${totalErrors}) - tackle the dominant issue (${codes[0].code}) first to unlock cascading fixes.`);
370
- }
371
- // Recovery plan (ordered, concise)
372
- const topCode = codes.at(0);
373
- if (topCode) {
374
- const { code, count } = topCode;
375
- recoveryPlan.push(`Start with the dominant issue: ${code} (appears ${count}×). Fixing this usually removes many downstream errors.`);
376
- }
377
- if (hasTypeScriptErrors && errors.some(e => e.code === 'TS2307')) {
378
- recoveryPlan.push('Verify import paths and run dependency install if needed (npm install <package>) to resolve module-not-found errors.');
379
- }
380
- if (hasTypeScriptErrors) {
381
- recoveryPlan.push('Iterate with quick_typecheck after each fix to confirm the type surface is clean before running full validation.');
382
- }
383
- if (hasLintErrors && autoFixable > 0) {
384
- recoveryPlan.push('Apply auto-fixes (e.g., npm run lint -- --fix) to clear stylistic/unused issues quickly.');
385
- }
386
- if (hasTestFailures) {
387
- recoveryPlan.push('Re-run the specific failing test file in watch/verbose mode to verify fixes before full test suite (e.g., npm test -- <file>).');
388
- }
389
- if (recoveryPlan.length === 0) {
390
- recoveryPlan.push('Address the first reported error, rerun quick_typecheck, then re-run validate_all_changes once the main blockers are fixed.');
391
- }
392
- return {
393
- rootCauseHints: Array.from(rootCauseHints).slice(0, 6),
394
- recoveryPlan: recoveryPlan.slice(0, 6),
395
- dominantErrorCodes: codes,
396
- topFiles,
397
- };
398
- }
399
- function withInsights(result) {
400
- const insights = buildValidationInsights(result.errors, result.warnings);
401
- return { ...result, insights };
402
- }
403
- // ============================================================================
404
- // Validation Runner
405
- // ============================================================================
406
- export class ValidationRunner {
407
- config;
408
- constructor(config) {
409
- this.config = {
410
- workingDir: config.workingDir,
411
- phases: config.phases ?? ['typescript', 'build', 'test'],
412
- stopOnFirstFailure: config.stopOnFirstFailure ?? false,
413
- timeout: config.timeout ?? 300000,
414
- verbose: config.verbose ?? false,
415
- };
416
- }
417
- /**
418
- * Run all validation phases
419
- */
420
- async runAll() {
421
- const startTime = Date.now();
422
- const allErrors = [];
423
- const allWarnings = [];
424
- const summaryParts = [];
425
- for (const phase of this.config.phases) {
426
- const result = await this.runPhase(phase);
427
- allErrors.push(...result.errors);
428
- allWarnings.push(...result.warnings);
429
- summaryParts.push(`${phase}: ${result.success ? '✓' : '✗'}`);
430
- if (!result.success && this.config.stopOnFirstFailure) {
431
- break;
432
- }
433
- }
434
- const autoFixableCount = allErrors.filter(e => e.suggestedFix?.autoFixable).length;
435
- return withInsights({
436
- success: allErrors.length === 0,
437
- phase: 'all',
438
- errors: allErrors,
439
- warnings: allWarnings,
440
- summary: summaryParts.join(' | '),
441
- durationMs: Date.now() - startTime,
442
- autoFixableCount,
443
- });
444
- }
445
- /**
446
- * Run a specific validation phase
447
- */
448
- async runPhase(phase) {
449
- switch (phase) {
450
- case 'typescript':
451
- return this.runTypeScriptValidation();
452
- case 'build':
453
- return this.runBuildValidation();
454
- case 'test':
455
- return this.runTestValidation();
456
- case 'lint':
457
- return this.runLintValidation();
458
- default:
459
- throw new Error(`Unknown validation phase: ${phase}`);
460
- }
461
- }
462
- /**
463
- * Run TypeScript type checking
464
- */
465
- async runTypeScriptValidation() {
466
- const startTime = Date.now();
467
- try {
468
- // Check if tsconfig.json exists
469
- await access(join(this.config.workingDir, 'tsconfig.json'));
470
- }
471
- catch {
472
- return withInsights({
473
- success: true,
474
- phase: 'typescript',
475
- errors: [],
476
- warnings: [],
477
- summary: 'TypeScript: skipped (no tsconfig.json)',
478
- durationMs: Date.now() - startTime,
479
- autoFixableCount: 0,
480
- });
481
- }
482
- try {
483
- const { stdout, stderr } = await execAsync('npx tsc --noEmit', {
484
- cwd: this.config.workingDir,
485
- timeout: this.config.timeout,
486
- maxBuffer: 10 * 1024 * 1024,
487
- });
488
- const output = stdout + stderr;
489
- const errors = parseTypeScriptErrors(output);
490
- const warnings = errors.filter(e => e.severity === 'warning');
491
- const actualErrors = errors.filter(e => e.severity === 'error');
492
- return withInsights({
493
- success: actualErrors.length === 0,
494
- phase: 'typescript',
495
- errors: actualErrors,
496
- warnings,
497
- summary: `TypeScript: ${actualErrors.length} error(s), ${warnings.length} warning(s)`,
498
- durationMs: Date.now() - startTime,
499
- autoFixableCount: errors.filter(e => e.suggestedFix?.autoFixable).length,
500
- });
501
- }
502
- catch (error) {
503
- const err = error;
504
- const output = (err.stdout || '') + (err.stderr || '');
505
- const errors = parseTypeScriptErrors(output);
506
- if (errors.length === 0) {
507
- errors.push({
508
- type: 'typescript',
509
- message: err.message || 'TypeScript compilation failed',
510
- severity: 'error',
511
- rawOutput: output,
512
- });
513
- }
514
- const actualErrors = errors.filter(e => e.severity === 'error');
515
- const warnings = errors.filter(e => e.severity === 'warning');
516
- return withInsights({
517
- success: false,
518
- phase: 'typescript',
519
- errors: actualErrors,
520
- warnings,
521
- summary: `TypeScript: ${actualErrors.length} error(s)`,
522
- durationMs: Date.now() - startTime,
523
- autoFixableCount: errors.filter(e => e.suggestedFix?.autoFixable).length,
524
- });
525
- }
526
- }
527
- /**
528
- * Run build validation
529
- */
530
- async runBuildValidation() {
531
- const startTime = Date.now();
532
- try {
533
- // Check if build script exists
534
- const packageJson = await readFile(join(this.config.workingDir, 'package.json'), 'utf-8');
535
- const pkg = JSON.parse(packageJson);
536
- if (!pkg.scripts?.build) {
537
- return withInsights({
538
- success: true,
539
- phase: 'build',
540
- errors: [],
541
- warnings: [],
542
- summary: 'Build: skipped (no build script)',
543
- durationMs: Date.now() - startTime,
544
- autoFixableCount: 0,
545
- });
546
- }
547
- }
548
- catch {
549
- return withInsights({
550
- success: true,
551
- phase: 'build',
552
- errors: [],
553
- warnings: [],
554
- summary: 'Build: skipped (no package.json)',
555
- durationMs: Date.now() - startTime,
556
- autoFixableCount: 0,
557
- });
558
- }
559
- try {
560
- await execAsync('npm run build', {
561
- cwd: this.config.workingDir,
562
- timeout: this.config.timeout,
563
- maxBuffer: 10 * 1024 * 1024,
564
- });
565
- return withInsights({
566
- success: true,
567
- phase: 'build',
568
- errors: [],
569
- warnings: [],
570
- summary: 'Build: ✓ passed',
571
- durationMs: Date.now() - startTime,
572
- autoFixableCount: 0,
573
- });
574
- }
575
- catch (error) {
576
- const err = error;
577
- const output = (err.stdout || '') + (err.stderr || '');
578
- // Try to parse as TypeScript errors first
579
- let errors = parseTypeScriptErrors(output);
580
- if (errors.length === 0) {
581
- errors = [{
582
- type: 'build',
583
- message: 'Build failed',
584
- severity: 'error',
585
- rawOutput: output.slice(0, 2000),
586
- }];
587
- }
588
- return withInsights({
589
- success: false,
590
- phase: 'build',
591
- errors,
592
- warnings: [],
593
- summary: `Build: ✗ failed (${errors.length} error(s))`,
594
- durationMs: Date.now() - startTime,
595
- autoFixableCount: errors.filter(e => e.suggestedFix?.autoFixable).length,
596
- });
597
- }
598
- }
599
- /**
600
- * Run test validation
601
- */
602
- async runTestValidation() {
603
- const startTime = Date.now();
604
- try {
605
- // Check if test script exists
606
- const packageJson = await readFile(join(this.config.workingDir, 'package.json'), 'utf-8');
607
- const pkg = JSON.parse(packageJson);
608
- if (!pkg.scripts?.test) {
609
- return withInsights({
610
- success: true,
611
- phase: 'test',
612
- errors: [],
613
- warnings: [],
614
- summary: 'Tests: skipped (no test script)',
615
- durationMs: Date.now() - startTime,
616
- autoFixableCount: 0,
617
- });
618
- }
619
- }
620
- catch {
621
- return withInsights({
622
- success: true,
623
- phase: 'test',
624
- errors: [],
625
- warnings: [],
626
- summary: 'Tests: skipped (no package.json)',
627
- durationMs: Date.now() - startTime,
628
- autoFixableCount: 0,
629
- });
630
- }
631
- try {
632
- const { stdout, stderr } = await execAsync('npm test', {
633
- cwd: this.config.workingDir,
634
- timeout: this.config.timeout,
635
- maxBuffer: 10 * 1024 * 1024,
636
- });
637
- const output = stdout + stderr;
638
- // Check for test failures even in "successful" exit
639
- const errors = parseTestErrors(output);
640
- const actualErrors = errors.filter(e => e.severity === 'error');
641
- return withInsights({
642
- success: actualErrors.length === 0,
643
- phase: 'test',
644
- errors: actualErrors,
645
- warnings: [],
646
- summary: `Tests: ${actualErrors.length === 0 ? '✓ passed' : `✗ ${actualErrors.length} failure(s)`}`,
647
- durationMs: Date.now() - startTime,
648
- autoFixableCount: 0,
649
- });
650
- }
651
- catch (error) {
652
- const err = error;
653
- const output = (err.stdout || '') + (err.stderr || '');
654
- const errors = parseTestErrors(output);
655
- if (errors.length === 0) {
656
- errors.push({
657
- type: 'test',
658
- message: 'Tests failed',
659
- severity: 'error',
660
- rawOutput: output.slice(0, 2000),
661
- });
662
- }
663
- return withInsights({
664
- success: false,
665
- phase: 'test',
666
- errors,
667
- warnings: [],
668
- summary: `Tests: ✗ failed (${errors.length} failure(s))`,
669
- durationMs: Date.now() - startTime,
670
- autoFixableCount: 0,
671
- });
672
- }
673
- }
674
- /**
675
- * Run lint validation
676
- */
677
- async runLintValidation() {
678
- const startTime = Date.now();
679
- try {
680
- // Check if lint script exists
681
- const packageJson = await readFile(join(this.config.workingDir, 'package.json'), 'utf-8');
682
- const pkg = JSON.parse(packageJson);
683
- if (!pkg.scripts?.lint) {
684
- return withInsights({
685
- success: true,
686
- phase: 'lint',
687
- errors: [],
688
- warnings: [],
689
- summary: 'Lint: skipped (no lint script)',
690
- durationMs: Date.now() - startTime,
691
- autoFixableCount: 0,
692
- });
693
- }
694
- }
695
- catch {
696
- return withInsights({
697
- success: true,
698
- phase: 'lint',
699
- errors: [],
700
- warnings: [],
701
- summary: 'Lint: skipped (no package.json)',
702
- durationMs: Date.now() - startTime,
703
- autoFixableCount: 0,
704
- });
705
- }
706
- try {
707
- const { stdout, stderr } = await execAsync('npm run lint', {
708
- cwd: this.config.workingDir,
709
- timeout: this.config.timeout,
710
- maxBuffer: 10 * 1024 * 1024,
711
- });
712
- const output = stdout + stderr;
713
- const errors = parseLintErrors(output);
714
- const actualErrors = errors.filter(e => e.severity === 'error');
715
- const warnings = errors.filter(e => e.severity === 'warning');
716
- return withInsights({
717
- success: actualErrors.length === 0,
718
- phase: 'lint',
719
- errors: actualErrors,
720
- warnings,
721
- summary: `Lint: ${actualErrors.length} error(s), ${warnings.length} warning(s)`,
722
- durationMs: Date.now() - startTime,
723
- autoFixableCount: errors.filter(e => e.suggestedFix?.autoFixable).length,
724
- });
725
- }
726
- catch (error) {
727
- const err = error;
728
- const output = (err.stdout || '') + (err.stderr || '');
729
- const errors = parseLintErrors(output);
730
- if (errors.length === 0) {
731
- errors.push({
732
- type: 'lint',
733
- message: 'Lint check failed',
734
- severity: 'error',
735
- rawOutput: output.slice(0, 2000),
736
- });
737
- }
738
- const actualErrors = errors.filter(e => e.severity === 'error');
739
- const warnings = errors.filter(e => e.severity === 'warning');
740
- return withInsights({
741
- success: false,
742
- phase: 'lint',
743
- errors: actualErrors,
744
- warnings,
745
- summary: `Lint: ✗ ${actualErrors.length} error(s)`,
746
- durationMs: Date.now() - startTime,
747
- autoFixableCount: errors.filter(e => e.suggestedFix?.autoFixable).length,
748
- });
749
- }
750
- }
751
- }
752
- // ============================================================================
753
- // Formatting Helpers
754
- // ============================================================================
755
- /**
756
- * Format validation result for display
757
- */
758
- export function formatValidationResult(result) {
759
- const lines = [];
760
- lines.push(`## Validation ${result.success ? 'Passed ✓' : 'Failed ✗'}`);
761
- lines.push(`Duration: ${(result.durationMs / 1000).toFixed(1)}s`);
762
- lines.push('');
763
- lines.push(`Summary: ${result.summary}`);
764
- if (result.insights) {
765
- const { rootCauseHints, recoveryPlan, dominantErrorCodes, topFiles } = result.insights;
766
- if (rootCauseHints.length > 0) {
767
- lines.push('');
768
- lines.push('### Root Cause Hints');
769
- for (const hint of rootCauseHints) {
770
- lines.push(`- ${hint}`);
771
- }
772
- }
773
- if (recoveryPlan.length > 0) {
774
- lines.push('');
775
- lines.push('### Recommended Recovery Plan');
776
- recoveryPlan.forEach((step, idx) => {
777
- lines.push(`${idx + 1}. ${step}`);
778
- });
779
- }
780
- if (dominantErrorCodes.length > 0) {
781
- lines.push('');
782
- lines.push('### Dominant Errors');
783
- dominantErrorCodes.slice(0, 3).forEach(({ code, count }) => {
784
- lines.push(`- ${code}: ${count} occurrence(s)`);
785
- });
786
- }
787
- if (topFiles.length > 0) {
788
- lines.push('');
789
- lines.push('### Files With Most Errors');
790
- topFiles.slice(0, 3).forEach(({ file, count }) => {
791
- lines.push(`- ${file}: ${count} issue(s)`);
792
- });
793
- }
794
- }
795
- if (result.errors.length > 0) {
796
- lines.push('');
797
- lines.push(`### Errors (${result.errors.length})`);
798
- for (const error of result.errors.slice(0, 20)) {
799
- const location = error.file
800
- ? `${error.file}${error.line ? `:${error.line}` : ''}${error.column ? `:${error.column}` : ''}`
801
- : '';
802
- const code = error.code ? `[${error.code}]` : '';
803
- lines.push(`- ${location} ${code} ${error.message}`);
804
- if (error.suggestedFix) {
805
- lines.push(` Fix: ${error.suggestedFix.description}`);
806
- if (error.suggestedFix.autoFixable) {
807
- lines.push(` (Auto-fixable)`);
808
- }
809
- }
810
- }
811
- if (result.errors.length > 20) {
812
- lines.push(`... and ${result.errors.length - 20} more errors`);
813
- }
814
- }
815
- if (result.warnings.length > 0) {
816
- lines.push('');
817
- lines.push(`### Warnings (${result.warnings.length})`);
818
- for (const warning of result.warnings.slice(0, 10)) {
819
- const location = warning.file ? `${warning.file}:${warning.line || '?'}` : '';
820
- lines.push(`- ${location} ${warning.message}`);
821
- }
822
- if (result.warnings.length > 10) {
823
- lines.push(`... and ${result.warnings.length - 10} more warnings`);
824
- }
825
- }
826
- if (result.autoFixableCount > 0) {
827
- lines.push('');
828
- lines.push(`### Auto-fixable: ${result.autoFixableCount} issue(s)`);
829
- lines.push('Use the auto-fix feature to automatically resolve these issues.');
830
- }
831
- return lines.join('\n');
832
- }
833
- /**
834
- * Format errors for AI consumption (structured for intelligent fixing)
835
- */
836
- export function formatErrorsForAI(errors, insights) {
837
- const lines = [];
838
- lines.push('# Validation Errors for AI Analysis');
839
- lines.push('');
840
- lines.push('The following errors need to be fixed. For each error:');
841
- lines.push('1. Read the file at the specified location');
842
- lines.push('2. Understand the context around the error');
843
- lines.push('3. Apply the suggested fix or determine the appropriate correction');
844
- lines.push('');
845
- if (insights) {
846
- if (insights.rootCauseHints.length > 0) {
847
- lines.push('## Root Cause Hints');
848
- lines.push('');
849
- for (const hint of insights.rootCauseHints) {
850
- lines.push(`- ${hint}`);
851
- }
852
- lines.push('');
853
- }
854
- if (insights.recoveryPlan.length > 0) {
855
- lines.push('## Recommended Recovery Plan');
856
- lines.push('');
857
- insights.recoveryPlan.forEach((step, idx) => {
858
- lines.push(`${idx + 1}. ${step}`);
859
- });
860
- lines.push('');
861
- }
862
- }
863
- const groupedByFile = new Map();
864
- for (const error of errors) {
865
- const key = error.file || 'unknown';
866
- if (!groupedByFile.has(key)) {
867
- groupedByFile.set(key, []);
868
- }
869
- groupedByFile.get(key).push(error);
870
- }
871
- for (const [file, fileErrors] of groupedByFile) {
872
- lines.push(`## ${file}`);
873
- lines.push('');
874
- for (const error of fileErrors) {
875
- lines.push(`### Line ${error.line || '?'}: ${error.code || error.type}`);
876
- lines.push(`Message: ${error.message}`);
877
- if (error.suggestedFix) {
878
- lines.push(`Suggested fix: ${error.suggestedFix.description}`);
879
- lines.push(`Auto-fixable: ${error.suggestedFix.autoFixable ? 'Yes' : 'No'}`);
880
- if (error.suggestedFix.fixDetails.manualSteps) {
881
- lines.push('Steps:');
882
- for (const step of error.suggestedFix.fixDetails.manualSteps) {
883
- lines.push(` - ${step}`);
884
- }
885
- }
886
- }
887
- lines.push('');
888
- }
889
- }
890
- return lines.join('\n');
891
- }
892
- //# sourceMappingURL=validationRunner.js.map