agentic-qe 1.0.5 → 1.2.0

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 (383) hide show
  1. package/.claude/agents/qe-coverage-analyzer.md +8 -0
  2. package/.claude/agents/qe-flaky-test-hunter.md +9 -1
  3. package/.claude/agents/qe-quality-analyzer.md +405 -0
  4. package/.claude/agents/qe-test-generator.md +7 -0
  5. package/.claude/agents/reasoning/agent.md +816 -0
  6. package/.claude/agents/reasoning/goal-planner.md +73 -0
  7. package/.claude/settings.json +21 -20
  8. package/.claude/skills/README.md +124 -0
  9. package/.claude/skills/agentdb-advanced/SKILL.md +550 -0
  10. package/.claude/skills/agentdb-learning/SKILL.md +545 -0
  11. package/.claude/skills/agentdb-memory-patterns/SKILL.md +339 -0
  12. package/.claude/skills/agentdb-optimization/SKILL.md +509 -0
  13. package/.claude/skills/agentdb-vector-search/SKILL.md +339 -0
  14. package/.claude/skills/agentic-quality-engineering/SKILL.md +604 -0
  15. package/.claude/skills/api-testing-patterns/SKILL.md +686 -0
  16. package/.claude/skills/bug-reporting-excellence/SKILL.md +632 -0
  17. package/.claude/skills/code-review-quality/SKILL.md +683 -0
  18. package/.claude/skills/consultancy-practices/SKILL.md +540 -0
  19. package/.claude/skills/context-driven-testing/SKILL.md +466 -0
  20. package/.claude/skills/exploratory-testing-advanced/SKILL.md +676 -0
  21. package/.claude/skills/flow-nexus-neural/SKILL.md +738 -0
  22. package/.claude/skills/flow-nexus-platform/SKILL.md +1157 -0
  23. package/.claude/skills/flow-nexus-swarm/SKILL.md +610 -0
  24. package/.claude/skills/github-code-review/SKILL.md +1140 -0
  25. package/.claude/skills/github-multi-repo/SKILL.md +874 -0
  26. package/.claude/skills/github-project-management/SKILL.md +1277 -0
  27. package/.claude/skills/github-release-management/SKILL.md +1081 -0
  28. package/.claude/skills/github-workflow-automation/SKILL.md +1065 -0
  29. package/.claude/skills/hive-mind-advanced/SKILL.md +712 -0
  30. package/.claude/skills/holistic-testing-pact/SKILL.md +225 -0
  31. package/.claude/skills/hooks-automation/SKILL.md +1201 -0
  32. package/.claude/skills/pair-programming/SKILL.md +1202 -0
  33. package/.claude/skills/performance-analysis/SKILL.md +563 -0
  34. package/.claude/skills/performance-testing/SKILL.md +662 -0
  35. package/.claude/skills/quality-metrics/SKILL.md +592 -0
  36. package/.claude/skills/reasoningbank-agentdb/SKILL.md +446 -0
  37. package/.claude/skills/reasoningbank-intelligence/SKILL.md +201 -0
  38. package/.claude/skills/refactoring-patterns/SKILL.md +778 -0
  39. package/.claude/skills/risk-based-testing/SKILL.md +721 -0
  40. package/.claude/skills/security-testing/SKILL.md +651 -0
  41. package/.claude/skills/skill-builder/SKILL.md +910 -0
  42. package/.claude/skills/sparc-methodology/SKILL.md +1115 -0
  43. package/.claude/skills/stream-chain/SKILL.md +563 -0
  44. package/.claude/skills/swarm-advanced/SKILL.md +973 -0
  45. package/.claude/skills/swarm-orchestration/SKILL.md +179 -0
  46. package/.claude/skills/tdd-london-chicago/SKILL.md +567 -0
  47. package/.claude/skills/technical-writing/SKILL.md +235 -0
  48. package/.claude/skills/test-automation-strategy/SKILL.md +842 -0
  49. package/.claude/skills/verification-quality/SKILL.md +649 -0
  50. package/.claude/skills/xp-practices/SKILL.md +671 -0
  51. package/.claude/statusline-command.sh +176 -0
  52. package/CHANGELOG.md +645 -1
  53. package/CONTRIBUTING.md +51 -0
  54. package/README.md +758 -162
  55. package/bin/aqe +90 -938
  56. package/config/improvement-loop.config.ts +323 -0
  57. package/config/neural-agent.config.ts +197 -0
  58. package/dist/adapters/MemoryStoreAdapter.d.ts +16 -16
  59. package/dist/adapters/MemoryStoreAdapter.d.ts.map +1 -1
  60. package/dist/adapters/MemoryStoreAdapter.js +22 -16
  61. package/dist/adapters/MemoryStoreAdapter.js.map +1 -1
  62. package/dist/agents/BaseAgent.d.ts +69 -0
  63. package/dist/agents/BaseAgent.d.ts.map +1 -1
  64. package/dist/agents/BaseAgent.js +382 -1
  65. package/dist/agents/BaseAgent.js.map +1 -1
  66. package/dist/agents/CoverageAnalyzerAgent.d.ts +69 -3
  67. package/dist/agents/CoverageAnalyzerAgent.d.ts.map +1 -1
  68. package/dist/agents/CoverageAnalyzerAgent.js +418 -51
  69. package/dist/agents/CoverageAnalyzerAgent.js.map +1 -1
  70. package/dist/agents/DeploymentReadinessAgent.d.ts.map +1 -1
  71. package/dist/agents/DeploymentReadinessAgent.js +13 -13
  72. package/dist/agents/DeploymentReadinessAgent.js.map +1 -1
  73. package/dist/agents/FlakyTestHunterAgent.d.ts +76 -4
  74. package/dist/agents/FlakyTestHunterAgent.d.ts.map +1 -1
  75. package/dist/agents/FlakyTestHunterAgent.js +375 -13
  76. package/dist/agents/FlakyTestHunterAgent.js.map +1 -1
  77. package/dist/agents/FleetCommanderAgent.d.ts.map +1 -1
  78. package/dist/agents/FleetCommanderAgent.js +2 -2
  79. package/dist/agents/FleetCommanderAgent.js.map +1 -1
  80. package/dist/agents/LearningAgent.d.ts +84 -0
  81. package/dist/agents/LearningAgent.d.ts.map +1 -0
  82. package/dist/agents/LearningAgent.js +197 -0
  83. package/dist/agents/LearningAgent.js.map +1 -0
  84. package/dist/agents/NeuralAgentExtension.d.ts +117 -0
  85. package/dist/agents/NeuralAgentExtension.d.ts.map +1 -0
  86. package/dist/agents/NeuralAgentExtension.js +288 -0
  87. package/dist/agents/NeuralAgentExtension.js.map +1 -0
  88. package/dist/agents/PerformanceTesterAgent.d.ts.map +1 -1
  89. package/dist/agents/PerformanceTesterAgent.js +4 -3
  90. package/dist/agents/PerformanceTesterAgent.js.map +1 -1
  91. package/dist/agents/ProductionIntelligenceAgent.js +7 -7
  92. package/dist/agents/ProductionIntelligenceAgent.js.map +1 -1
  93. package/dist/agents/QualityAnalyzerAgent.d.ts.map +1 -1
  94. package/dist/agents/QualityAnalyzerAgent.js +2 -2
  95. package/dist/agents/QualityAnalyzerAgent.js.map +1 -1
  96. package/dist/agents/QualityGateAgent.js +5 -5
  97. package/dist/agents/QualityGateAgent.js.map +1 -1
  98. package/dist/agents/RegressionRiskAnalyzerAgent.js +7 -7
  99. package/dist/agents/RegressionRiskAnalyzerAgent.js.map +1 -1
  100. package/dist/agents/RequirementsValidatorAgent.d.ts.map +1 -1
  101. package/dist/agents/RequirementsValidatorAgent.js +1 -1
  102. package/dist/agents/RequirementsValidatorAgent.js.map +1 -1
  103. package/dist/agents/SecurityScannerAgent.js +6 -6
  104. package/dist/agents/SecurityScannerAgent.js.map +1 -1
  105. package/dist/agents/TestExecutorAgent.d.ts.map +1 -1
  106. package/dist/agents/TestExecutorAgent.js +1 -3
  107. package/dist/agents/TestExecutorAgent.js.map +1 -1
  108. package/dist/agents/TestGeneratorAgent.d.ts +53 -2
  109. package/dist/agents/TestGeneratorAgent.d.ts.map +1 -1
  110. package/dist/agents/TestGeneratorAgent.js +372 -31
  111. package/dist/agents/TestGeneratorAgent.js.map +1 -1
  112. package/dist/agents/mixins/NeuralCapableMixin.d.ts +130 -0
  113. package/dist/agents/mixins/NeuralCapableMixin.d.ts.map +1 -0
  114. package/dist/agents/mixins/NeuralCapableMixin.js +358 -0
  115. package/dist/agents/mixins/NeuralCapableMixin.js.map +1 -0
  116. package/dist/agents/mixins/QUICCapableMixin.d.ts +34 -0
  117. package/dist/agents/mixins/QUICCapableMixin.d.ts.map +1 -0
  118. package/dist/agents/mixins/QUICCapableMixin.js +346 -0
  119. package/dist/agents/mixins/QUICCapableMixin.js.map +1 -0
  120. package/dist/cli/commands/agent/index.d.ts +5 -0
  121. package/dist/cli/commands/agent/index.d.ts.map +1 -1
  122. package/dist/cli/commands/agent/index.js +11 -6
  123. package/dist/cli/commands/agent/index.js.map +1 -1
  124. package/dist/cli/commands/agent/kill.d.ts +13 -0
  125. package/dist/cli/commands/agent/kill.d.ts.map +1 -0
  126. package/dist/cli/commands/agent/kill.js +65 -0
  127. package/dist/cli/commands/agent/kill.js.map +1 -0
  128. package/dist/cli/commands/agent/list.d.ts +19 -0
  129. package/dist/cli/commands/agent/list.d.ts.map +1 -0
  130. package/dist/cli/commands/agent/list.js +92 -0
  131. package/dist/cli/commands/agent/list.js.map +1 -0
  132. package/dist/cli/commands/agent/logs.d.ts +14 -0
  133. package/dist/cli/commands/agent/logs.d.ts.map +1 -0
  134. package/dist/cli/commands/agent/logs.js +77 -0
  135. package/dist/cli/commands/agent/logs.js.map +1 -0
  136. package/dist/cli/commands/agent/metrics.d.ts +21 -0
  137. package/dist/cli/commands/agent/metrics.d.ts.map +1 -0
  138. package/dist/cli/commands/agent/metrics.js +87 -0
  139. package/dist/cli/commands/agent/metrics.js.map +1 -0
  140. package/dist/cli/commands/agent/spawn.d.ts +28 -0
  141. package/dist/cli/commands/agent/spawn.d.ts.map +1 -0
  142. package/dist/cli/commands/agent/spawn.js +83 -0
  143. package/dist/cli/commands/agent/spawn.js.map +1 -0
  144. package/dist/cli/commands/improve/index.d.ts +70 -0
  145. package/dist/cli/commands/improve/index.d.ts.map +1 -0
  146. package/dist/cli/commands/improve/index.js +530 -0
  147. package/dist/cli/commands/improve/index.js.map +1 -0
  148. package/dist/cli/commands/init.d.ts +57 -0
  149. package/dist/cli/commands/init.d.ts.map +1 -1
  150. package/dist/cli/commands/init.js +1127 -42
  151. package/dist/cli/commands/init.js.map +1 -1
  152. package/dist/cli/commands/learn/index.d.ts +68 -0
  153. package/dist/cli/commands/learn/index.d.ts.map +1 -0
  154. package/dist/cli/commands/learn/index.js +431 -0
  155. package/dist/cli/commands/learn/index.js.map +1 -0
  156. package/dist/cli/commands/patterns/index.d.ts +75 -0
  157. package/dist/cli/commands/patterns/index.d.ts.map +1 -0
  158. package/dist/cli/commands/patterns/index.js +502 -0
  159. package/dist/cli/commands/patterns/index.js.map +1 -0
  160. package/dist/cli/commands/skills/index.d.ts +51 -0
  161. package/dist/cli/commands/skills/index.d.ts.map +1 -0
  162. package/dist/cli/commands/skills/index.js +364 -0
  163. package/dist/cli/commands/skills/index.js.map +1 -0
  164. package/dist/cli/index.js +458 -8
  165. package/dist/cli/index.js.map +1 -1
  166. package/dist/core/EventBus.d.ts +38 -0
  167. package/dist/core/EventBus.d.ts.map +1 -1
  168. package/dist/core/EventBus.js +176 -31
  169. package/dist/core/EventBus.js.map +1 -1
  170. package/dist/core/FleetManager.d.ts +35 -1
  171. package/dist/core/FleetManager.d.ts.map +1 -1
  172. package/dist/core/FleetManager.js +121 -45
  173. package/dist/core/FleetManager.js.map +1 -1
  174. package/dist/core/MemoryManager.d.ts +19 -1
  175. package/dist/core/MemoryManager.d.ts.map +1 -1
  176. package/dist/core/MemoryManager.js +25 -1
  177. package/dist/core/MemoryManager.js.map +1 -1
  178. package/dist/core/embeddings/EmbeddingCache.d.ts +134 -0
  179. package/dist/core/embeddings/EmbeddingCache.d.ts.map +1 -0
  180. package/dist/core/embeddings/EmbeddingCache.js +239 -0
  181. package/dist/core/embeddings/EmbeddingCache.js.map +1 -0
  182. package/dist/core/embeddings/EmbeddingGenerator.d.ts +224 -0
  183. package/dist/core/embeddings/EmbeddingGenerator.d.ts.map +1 -0
  184. package/dist/core/embeddings/EmbeddingGenerator.js +459 -0
  185. package/dist/core/embeddings/EmbeddingGenerator.js.map +1 -0
  186. package/dist/core/embeddings/index.d.ts +15 -0
  187. package/dist/core/embeddings/index.d.ts.map +1 -0
  188. package/dist/core/embeddings/index.js +22 -0
  189. package/dist/core/embeddings/index.js.map +1 -0
  190. package/dist/core/memory/AgentDBIntegration.d.ts +35 -0
  191. package/dist/core/memory/AgentDBIntegration.d.ts.map +1 -0
  192. package/dist/core/memory/AgentDBIntegration.js +75 -0
  193. package/dist/core/memory/AgentDBIntegration.js.map +1 -0
  194. package/dist/core/memory/AgentDBManager.d.ts +200 -0
  195. package/dist/core/memory/AgentDBManager.d.ts.map +1 -0
  196. package/dist/core/memory/AgentDBManager.js +263 -0
  197. package/dist/core/memory/AgentDBManager.js.map +1 -0
  198. package/dist/core/memory/AgentDBService.d.ts +160 -0
  199. package/dist/core/memory/AgentDBService.d.ts.map +1 -0
  200. package/dist/core/memory/AgentDBService.js +450 -0
  201. package/dist/core/memory/AgentDBService.js.map +1 -0
  202. package/dist/core/memory/RealAgentDBAdapter.d.ts +51 -0
  203. package/dist/core/memory/RealAgentDBAdapter.d.ts.map +1 -0
  204. package/dist/core/memory/RealAgentDBAdapter.js +230 -0
  205. package/dist/core/memory/RealAgentDBAdapter.js.map +1 -0
  206. package/dist/core/memory/ReasoningBankAdapter.d.ts +58 -0
  207. package/dist/core/memory/ReasoningBankAdapter.d.ts.map +1 -0
  208. package/dist/core/memory/ReasoningBankAdapter.js +80 -0
  209. package/dist/core/memory/ReasoningBankAdapter.js.map +1 -0
  210. package/dist/core/memory/SwarmMemoryManager.d.ts +79 -2
  211. package/dist/core/memory/SwarmMemoryManager.d.ts.map +1 -1
  212. package/dist/core/memory/SwarmMemoryManager.js +243 -52
  213. package/dist/core/memory/SwarmMemoryManager.js.map +1 -1
  214. package/dist/core/memory/index.d.ts +4 -0
  215. package/dist/core/memory/index.d.ts.map +1 -1
  216. package/dist/core/memory/index.js +9 -1
  217. package/dist/core/memory/index.js.map +1 -1
  218. package/dist/core/neural/NeuralTrainer.d.ts +137 -0
  219. package/dist/core/neural/NeuralTrainer.d.ts.map +1 -0
  220. package/dist/core/neural/NeuralTrainer.js +543 -0
  221. package/dist/core/neural/NeuralTrainer.js.map +1 -0
  222. package/dist/core/neural/index.d.ts +8 -0
  223. package/dist/core/neural/index.d.ts.map +1 -0
  224. package/dist/core/neural/index.js +24 -0
  225. package/dist/core/neural/index.js.map +1 -0
  226. package/dist/core/neural/types.d.ts +216 -0
  227. package/dist/core/neural/types.d.ts.map +1 -0
  228. package/dist/core/neural/types.js +8 -0
  229. package/dist/core/neural/types.js.map +1 -0
  230. package/dist/core/security/CertificateValidator.d.ts +130 -0
  231. package/dist/core/security/CertificateValidator.d.ts.map +1 -0
  232. package/dist/core/security/CertificateValidator.js +376 -0
  233. package/dist/core/security/CertificateValidator.js.map +1 -0
  234. package/dist/core/transport/QUICTransport.d.ts +62 -0
  235. package/dist/core/transport/QUICTransport.d.ts.map +1 -0
  236. package/dist/core/transport/QUICTransport.js +381 -0
  237. package/dist/core/transport/QUICTransport.js.map +1 -0
  238. package/dist/core/transport/SecureQUICTransport.d.ts +71 -0
  239. package/dist/core/transport/SecureQUICTransport.d.ts.map +1 -0
  240. package/dist/core/transport/SecureQUICTransport.js +253 -0
  241. package/dist/core/transport/SecureQUICTransport.js.map +1 -0
  242. package/dist/index.d.ts +10 -0
  243. package/dist/index.d.ts.map +1 -1
  244. package/dist/index.js +10 -0
  245. package/dist/index.js.map +1 -1
  246. package/dist/learning/AdvancedFeatureExtractor.d.ts +123 -0
  247. package/dist/learning/AdvancedFeatureExtractor.d.ts.map +1 -0
  248. package/dist/learning/AdvancedFeatureExtractor.js +423 -0
  249. package/dist/learning/AdvancedFeatureExtractor.js.map +1 -0
  250. package/dist/learning/FlakyFixRecommendations.d.ts +40 -0
  251. package/dist/learning/FlakyFixRecommendations.d.ts.map +1 -0
  252. package/dist/learning/FlakyFixRecommendations.js +247 -0
  253. package/dist/learning/FlakyFixRecommendations.js.map +1 -0
  254. package/dist/learning/FlakyPredictionModel.d.ts +67 -0
  255. package/dist/learning/FlakyPredictionModel.d.ts.map +1 -0
  256. package/dist/learning/FlakyPredictionModel.js +336 -0
  257. package/dist/learning/FlakyPredictionModel.js.map +1 -0
  258. package/dist/learning/FlakyTestDetector.d.ts +55 -0
  259. package/dist/learning/FlakyTestDetector.d.ts.map +1 -0
  260. package/dist/learning/FlakyTestDetector.js +237 -0
  261. package/dist/learning/FlakyTestDetector.js.map +1 -0
  262. package/dist/learning/ImprovementLoop.d.ts +133 -0
  263. package/dist/learning/ImprovementLoop.d.ts.map +1 -0
  264. package/dist/learning/ImprovementLoop.js +412 -0
  265. package/dist/learning/ImprovementLoop.js.map +1 -0
  266. package/dist/learning/ImprovementWorker.d.ts +83 -0
  267. package/dist/learning/ImprovementWorker.d.ts.map +1 -0
  268. package/dist/learning/ImprovementWorker.js +164 -0
  269. package/dist/learning/ImprovementWorker.js.map +1 -0
  270. package/dist/learning/LearningEngine.d.ts +144 -0
  271. package/dist/learning/LearningEngine.d.ts.map +1 -0
  272. package/dist/learning/LearningEngine.js +531 -0
  273. package/dist/learning/LearningEngine.js.map +1 -0
  274. package/dist/learning/NeuralPatternMatcher.d.ts +184 -0
  275. package/dist/learning/NeuralPatternMatcher.d.ts.map +1 -0
  276. package/dist/learning/NeuralPatternMatcher.js +702 -0
  277. package/dist/learning/NeuralPatternMatcher.js.map +1 -0
  278. package/dist/learning/NeuralTrainer.d.ts +209 -0
  279. package/dist/learning/NeuralTrainer.d.ts.map +1 -0
  280. package/dist/learning/NeuralTrainer.js +478 -0
  281. package/dist/learning/NeuralTrainer.js.map +1 -0
  282. package/dist/learning/PerformanceTracker.d.ts +118 -0
  283. package/dist/learning/PerformanceTracker.d.ts.map +1 -0
  284. package/dist/learning/PerformanceTracker.js +376 -0
  285. package/dist/learning/PerformanceTracker.js.map +1 -0
  286. package/dist/learning/StatisticalAnalysis.d.ts +47 -0
  287. package/dist/learning/StatisticalAnalysis.d.ts.map +1 -0
  288. package/dist/learning/StatisticalAnalysis.js +170 -0
  289. package/dist/learning/StatisticalAnalysis.js.map +1 -0
  290. package/dist/learning/SwarmIntegration.d.ts +107 -0
  291. package/dist/learning/SwarmIntegration.d.ts.map +1 -0
  292. package/dist/learning/SwarmIntegration.js +191 -0
  293. package/dist/learning/SwarmIntegration.js.map +1 -0
  294. package/dist/learning/index.d.ts +16 -0
  295. package/dist/learning/index.d.ts.map +1 -0
  296. package/dist/learning/index.js +32 -0
  297. package/dist/learning/index.js.map +1 -0
  298. package/dist/learning/types.d.ts +289 -0
  299. package/dist/learning/types.d.ts.map +1 -0
  300. package/dist/learning/types.js +25 -0
  301. package/dist/learning/types.js.map +1 -0
  302. package/dist/mcp/MCPToolRegistry.d.ts +34 -0
  303. package/dist/mcp/MCPToolRegistry.d.ts.map +1 -0
  304. package/dist/mcp/MCPToolRegistry.js +48 -0
  305. package/dist/mcp/MCPToolRegistry.js.map +1 -0
  306. package/dist/mcp/handlers/phase2/Phase2Tools.d.ts +175 -0
  307. package/dist/mcp/handlers/phase2/Phase2Tools.d.ts.map +1 -0
  308. package/dist/mcp/handlers/phase2/Phase2Tools.js +693 -0
  309. package/dist/mcp/handlers/phase2/Phase2Tools.js.map +1 -0
  310. package/dist/mcp/server.d.ts +4 -4
  311. package/dist/mcp/server.d.ts.map +1 -1
  312. package/dist/mcp/server.js +94 -0
  313. package/dist/mcp/server.js.map +1 -1
  314. package/dist/mcp/services/AgentRegistry.d.ts.map +1 -1
  315. package/dist/mcp/services/AgentRegistry.js +7 -1
  316. package/dist/mcp/services/AgentRegistry.js.map +1 -1
  317. package/dist/mcp/tools.d.ts +15 -0
  318. package/dist/mcp/tools.d.ts.map +1 -1
  319. package/dist/mcp/tools.js +17 -1
  320. package/dist/mcp/tools.js.map +1 -1
  321. package/dist/reasoning/CodeSignatureGenerator.d.ts +98 -0
  322. package/dist/reasoning/CodeSignatureGenerator.d.ts.map +1 -0
  323. package/dist/reasoning/CodeSignatureGenerator.js +427 -0
  324. package/dist/reasoning/CodeSignatureGenerator.js.map +1 -0
  325. package/dist/reasoning/PatternClassifier.d.ts +98 -0
  326. package/dist/reasoning/PatternClassifier.d.ts.map +1 -0
  327. package/dist/reasoning/PatternClassifier.js +345 -0
  328. package/dist/reasoning/PatternClassifier.js.map +1 -0
  329. package/dist/reasoning/PatternExtractor.d.ts +131 -0
  330. package/dist/reasoning/PatternExtractor.d.ts.map +1 -0
  331. package/dist/reasoning/PatternExtractor.js +539 -0
  332. package/dist/reasoning/PatternExtractor.js.map +1 -0
  333. package/dist/reasoning/PatternMemoryIntegration.d.ts +102 -0
  334. package/dist/reasoning/PatternMemoryIntegration.d.ts.map +1 -0
  335. package/dist/reasoning/PatternMemoryIntegration.js +336 -0
  336. package/dist/reasoning/PatternMemoryIntegration.js.map +1 -0
  337. package/dist/reasoning/QEReasoningBank.d.ts +121 -0
  338. package/dist/reasoning/QEReasoningBank.d.ts.map +1 -0
  339. package/dist/reasoning/QEReasoningBank.js +235 -0
  340. package/dist/reasoning/QEReasoningBank.js.map +1 -0
  341. package/dist/reasoning/TestTemplateCreator.d.ts +95 -0
  342. package/dist/reasoning/TestTemplateCreator.d.ts.map +1 -0
  343. package/dist/reasoning/TestTemplateCreator.js +535 -0
  344. package/dist/reasoning/TestTemplateCreator.js.map +1 -0
  345. package/dist/reasoning/index.d.ts +10 -0
  346. package/dist/reasoning/index.d.ts.map +1 -0
  347. package/dist/reasoning/index.js +31 -0
  348. package/dist/reasoning/index.js.map +1 -0
  349. package/dist/reasoning/types.d.ts +717 -0
  350. package/dist/reasoning/types.d.ts.map +1 -0
  351. package/dist/reasoning/types.js +57 -0
  352. package/dist/reasoning/types.js.map +1 -0
  353. package/dist/transport/QUICTransport.d.ts +340 -0
  354. package/dist/transport/QUICTransport.d.ts.map +1 -0
  355. package/dist/transport/QUICTransport.js +814 -0
  356. package/dist/transport/QUICTransport.js.map +1 -0
  357. package/dist/transport/UDPTransport.d.ts +348 -0
  358. package/dist/transport/UDPTransport.d.ts.map +1 -0
  359. package/dist/transport/UDPTransport.js +820 -0
  360. package/dist/transport/UDPTransport.js.map +1 -0
  361. package/dist/types/errors.d.ts +1 -1
  362. package/dist/types/index.d.ts +41 -0
  363. package/dist/types/index.d.ts.map +1 -1
  364. package/dist/types/index.js +2 -0
  365. package/dist/types/index.js.map +1 -1
  366. package/dist/types/pattern.types.d.ts +364 -0
  367. package/dist/types/pattern.types.d.ts.map +1 -0
  368. package/dist/types/pattern.types.js +60 -0
  369. package/dist/types/pattern.types.js.map +1 -0
  370. package/dist/types/quic.d.ts +339 -0
  371. package/dist/types/quic.d.ts.map +1 -0
  372. package/dist/types/quic.js +48 -0
  373. package/dist/types/quic.js.map +1 -0
  374. package/dist/utils/Config.js +1 -1
  375. package/dist/utils/Config.js.map +1 -1
  376. package/dist/utils/Database.d.ts +14 -0
  377. package/dist/utils/Database.d.ts.map +1 -1
  378. package/dist/utils/Database.js +51 -4
  379. package/dist/utils/Database.js.map +1 -1
  380. package/dist/utils/Logger.d.ts.map +1 -1
  381. package/dist/utils/Logger.js +111 -26
  382. package/dist/utils/Logger.js.map +1 -1
  383. package/package.json +54 -9
package/bin/aqe CHANGED
@@ -1,959 +1,111 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * AQE - Agentic Quality Engineering Fleet CLI
4
+ * Agentic QE CLI Entry Point
5
+ * Version: 1.1.0
5
6
  *
6
- * Complete implementation with all functions included
7
- * User-friendly shorthand for comprehensive QE operations
7
+ * This script imports and executes the comprehensive TypeScript CLI
8
+ * which includes all Phase 1 and Phase 2 commands:
9
+ *
10
+ * Phase 1 (v1.0.5):
11
+ * - Multi-Model Router (routing commands)
12
+ * - Streaming MCP tools
13
+ *
14
+ * Phase 2 (Milestone 2.2):
15
+ * - Learning Engine (learn commands)
16
+ * - Pattern Management (patterns commands)
17
+ * - Continuous Improvement (improve commands)
18
+ * - QE Reasoning Bank integration
19
+ *
20
+ * Core Commands:
21
+ * - init, status, start
22
+ * - workflow (list, pause, cancel)
23
+ * - config (init, validate, get, set, list, reset)
24
+ * - debug (agent, diagnostics, health-check, troubleshoot)
25
+ * - memory (stats, compact)
8
26
  */
9
27
 
10
28
  const path = require('path');
11
29
  const fs = require('fs');
12
- const { spawn } = require('child_process');
13
- const { promisify } = require('util');
14
- const chalk = require('chalk');
15
-
16
- /**
17
- * Copy comprehensive agent template from agentic-qe package
18
- * @param {string} agentName - Name of the agent
19
- * @param {string} targetDir - Target directory for agent creation
20
- */
21
- function copyAgentTemplate(agentName, targetDir = process.cwd()) {
22
- // Security: Validate and sanitize directory path
23
- const sanitizedTargetDir = path.resolve(targetDir);
24
- if (!isAllowedDirectory(sanitizedTargetDir)) {
25
- throw new Error(`Access denied: ${targetDir} is not an allowed directory`);
26
- }
27
-
28
- // Find source template (comprehensive agent definition)
29
- const possibleSources = [
30
- path.join(__dirname, '..', '.claude', 'agents', `${agentName}.md`), // Same package
31
- path.join(process.cwd(), 'node_modules', 'agentic-qe', '.claude', 'agents', `${agentName}.md`), // Installed
32
- path.join(process.cwd(), '..', 'agentic-qe', '.claude', 'agents', `${agentName}.md`) // Monorepo
33
- ];
34
-
35
- let sourceTemplate = null;
36
- for (const src of possibleSources) {
37
- if (fs.existsSync(src)) {
38
- sourceTemplate = src;
39
- break;
40
- }
41
- }
42
-
43
- const targetPath = path.join(sanitizedTargetDir, '.claude', 'agents', `${agentName}.md`);
44
-
45
- if (sourceTemplate) {
46
- // Copy the comprehensive agent template
47
- fs.copyFileSync(sourceTemplate, targetPath);
48
- console.log(chalk.green(`✅ Registered agent: ${agentName} ${chalk.gray('(comprehensive template)')}`));
49
- } else {
50
- // Fallback to basic template if comprehensive not found
51
- console.log(chalk.yellow(`⚠️ Comprehensive template not found for ${agentName}, using basic template`));
52
- registerAgentBasic(agentName, targetDir);
53
- }
54
-
55
- return targetPath;
56
- }
57
-
58
- /**
59
- * Fallback: Register basic agent if comprehensive template not found
60
- * @param {string} agentName - Name of the agent
61
- * @param {string} targetDir - Target directory
62
- */
63
- function registerAgentBasic(agentName, targetDir = process.cwd()) {
64
- const agentPath = path.join(targetDir, '.claude', 'agents', `${agentName}.md`);
65
- const agentType = agentName.replace('qe-', '');
66
-
67
- const capabilities = {
68
- 'qe-test-generator': ['AI-powered test generation', 'Property-based testing', 'Coverage-driven generation'],
69
- 'qe-test-executor': ['Parallel test execution', 'Retry logic', 'Real-time reporting'],
70
- 'qe-coverage-analyzer': ['O(log n) optimization', 'Gap identification', 'Critical path analysis'],
71
- 'qe-quality-gate': ['Threshold enforcement', 'Go/no-go decisions', 'Risk assessment'],
72
- 'qe-performance-tester': ['Load testing', 'Bottleneck detection', 'SLA validation'],
73
- 'qe-security-scanner': ['SAST/DAST integration', 'Vulnerability detection', 'CVE monitoring']
74
- };
75
-
76
- const caps = capabilities[agentName] || ['Quality engineering'];
77
-
78
- const agentContent = `# ${agentName}
79
30
 
80
- Type: ${agentType}
81
- Status: Active
82
-
83
- ## Capabilities
84
- ${caps.map(cap => `- ${cap}`).join('\n')}
85
-
86
- ## Description
87
- This is an Agentic QE Fleet agent specialized in ${agentType}.
88
-
89
- ## Commands
90
- - Initialize: \`aqe agent spawn --name ${agentName} --type ${agentType}\`
91
- - Execute: \`aqe agent execute --name ${agentName} --task "<task>"\`
92
- - Status: \`aqe agent status --name ${agentName}\`
93
-
94
- ## Integration
95
- This agent integrates with the Agentic QE Fleet through:
96
- - EventBus for coordination
97
- - MemoryManager for state persistence
98
- - FleetManager for lifecycle management
99
- `;
100
-
101
- fs.writeFileSync(agentPath, agentContent);
102
- console.log(chalk.green(`✅ Registered agent: ${agentName} ${chalk.gray('(basic template)')}`));
103
- }
104
-
105
- /**
106
- * Security: Path validation function
107
- */
108
- function isAllowedDirectory(dirPath) {
109
- const resolvedPath = path.resolve(dirPath);
110
- const workspaceRoot = path.resolve('/workspaces');
111
- const homeDir = path.resolve(process.env.HOME || '/tmp');
112
-
113
- // Allow only paths within workspace or user home directory
114
- return resolvedPath.startsWith(workspaceRoot) || resolvedPath.startsWith(homeDir);
115
- }
116
-
117
- /**
118
- * Security: Execute command safely using spawn
119
- */
120
- function executeCommand(command, args = [], options = {}) {
121
- return new Promise((resolve, reject) => {
122
- const child = spawn(command, args, {
123
- stdio: options.stdio || 'pipe',
124
- cwd: options.cwd || process.cwd(),
125
- env: { ...process.env, ...options.env }
126
- });
127
-
128
- let stdout = '';
129
- let stderr = '';
130
-
131
- if (child.stdout) {
132
- child.stdout.on('data', (data) => {
133
- stdout += data.toString();
134
- if (options.stdio === 'inherit') {
135
- process.stdout.write(data);
136
- }
137
- });
138
- }
139
-
140
- if (child.stderr) {
141
- child.stderr.on('data', (data) => {
142
- stderr += data.toString();
143
- if (options.stdio === 'inherit') {
144
- process.stderr.write(data);
145
- }
146
- });
147
- }
148
-
149
- child.on('close', (code) => {
150
- if (code === 0) {
151
- resolve({ stdout, stderr, code });
152
- } else {
153
- reject(new Error(`Command failed with code ${code}: ${stderr}`));
154
- }
155
- });
156
-
157
- child.on('error', (error) => {
158
- reject(error);
159
- });
160
- });
161
- }
162
-
163
- /**
164
- * Copy command definitions from agentic-qe package to project
165
- * @param {string} targetDir - Target directory for command creation
166
- */
167
- function copyCommandDefinitions(targetDir = process.cwd()) {
168
- // Security: Validate and sanitize directory path
169
- const sanitizedTargetDir = path.resolve(targetDir);
170
- if (!isAllowedDirectory(sanitizedTargetDir)) {
171
- throw new Error(`Access denied: ${targetDir} is not an allowed directory`);
172
- }
173
-
174
- const targetCommandsDir = path.join(sanitizedTargetDir, '.claude', 'commands');
175
-
176
- // Create commands directory if it doesn't exist
177
- if (!fs.existsSync(targetCommandsDir)) {
178
- fs.mkdirSync(targetCommandsDir, { recursive: true });
179
- }
180
-
181
- // Define command names (8 QE slash commands)
182
- const commands = [
183
- 'aqe-generate',
184
- 'aqe-execute',
185
- 'aqe-analyze',
186
- 'aqe-optimize',
187
- 'aqe-report',
188
- 'aqe-fleet-status',
189
- 'aqe-chaos',
190
- 'aqe-benchmark'
191
- ];
192
-
193
- // Search for command templates in multiple possible locations
194
- const possibleSourceDirs = [
195
- path.join(__dirname, '..', '.claude', 'commands'), // Same package
196
- path.join(process.cwd(), 'node_modules', 'agentic-qe', '.claude', 'commands'), // Installed
197
- path.join(process.cwd(), '..', 'agentic-qe', '.claude', 'commands') // Monorepo
198
- ];
199
-
200
- let sourceCommandsDir = null;
201
- for (const src of possibleSourceDirs) {
202
- if (fs.existsSync(src)) {
203
- sourceCommandsDir = src;
204
- break;
205
- }
206
- }
207
-
208
- console.log(chalk.cyan('\n📋 Setting up QE slash commands...\n'));
209
-
210
- let copiedCount = 0;
211
- let createdCount = 0;
212
-
213
- commands.forEach(commandName => {
214
- const targetPath = path.join(targetCommandsDir, `${commandName}.md`);
215
-
216
- // Skip if command already exists
217
- if (fs.existsSync(targetPath)) {
218
- console.log(chalk.gray(` ${commandName}.md already exists (skipped)`));
219
- return;
220
- }
221
-
222
- // Try to copy from source
223
- if (sourceCommandsDir) {
224
- const sourcePath = path.join(sourceCommandsDir, `${commandName}.md`);
225
- if (fs.existsSync(sourcePath)) {
226
- fs.copyFileSync(sourcePath, targetPath);
227
- console.log(chalk.green(`✅ Copied command: ${commandName}.md`));
228
- copiedCount++;
229
- return;
230
- }
231
- }
232
-
233
- // Fallback: Create basic command stub
234
- const commandStub = generateCommandStub(commandName);
235
- fs.writeFileSync(targetPath, commandStub);
236
- console.log(chalk.yellow(`⚠️ Created stub: ${commandName}.md (template not found)`));
237
- createdCount++;
238
- });
239
-
240
- console.log(chalk.gray(`\n Commands copied: ${copiedCount}, Stubs created: ${createdCount}`));
241
- return { copiedCount, createdCount };
242
- }
243
-
244
- /**
245
- * Generate a basic command stub if template not found
246
- * @param {string} commandName - Name of the command
247
- */
248
- function generateCommandStub(commandName) {
249
- const commandType = commandName.replace('aqe-', '');
250
-
251
- return `# ${commandName}
252
-
253
- **Command Type:** ${commandType}
254
- **Status:** Stub (requires implementation)
255
-
256
- ## Overview
257
- This is a placeholder for the ${commandName} command. Full implementation coming soon.
258
-
259
- ## Usage
260
- \`\`\`bash
261
- /${commandName} [options]
262
- \`\`\`
263
-
264
- ## Implementation
265
- This command integrates with:
266
- - Claude Flow hooks
267
- - AQE Fleet agents
268
- - Memory coordination
269
-
270
- For full implementation, see the AQE documentation.
271
- `;
31
+ // Check Node.js version
32
+ const MIN_NODE_VERSION = 18;
33
+ const currentVersion = parseInt(process.versions.node.split('.')[0]);
34
+ if (currentVersion < MIN_NODE_VERSION) {
35
+ console.error(`❌ Error: Node.js ${MIN_NODE_VERSION}+ required. Current: ${process.version}`);
36
+ console.error(`Please upgrade Node.js: https://nodejs.org/`);
37
+ process.exit(1);
272
38
  }
273
39
 
274
- /**
275
- * Create settings.json with hook configuration
276
- * @param {string} targetDir - Target directory for settings.json
277
- */
278
- function createSettingsJson(targetDir = process.cwd()) {
279
- // Security: Validate and sanitize directory path
280
- const sanitizedTargetDir = path.resolve(targetDir);
281
- if (!isAllowedDirectory(sanitizedTargetDir)) {
282
- throw new Error(`Access denied: ${targetDir} is not an allowed directory`);
283
- }
284
-
285
- const settingsPath = path.join(sanitizedTargetDir, '.claude', 'settings.json');
286
-
287
- // Skip if settings.json already exists
288
- if (fs.existsSync(settingsPath)) {
289
- console.log(chalk.yellow('\n⚠️ settings.json already exists (skipped)'));
290
- return;
291
- }
292
-
293
- const settings = {
294
- version: "1.0.0",
295
- hooks: {
296
- enabled: true,
297
- preToolUse: {
298
- enabled: true,
299
- commands: [
300
- "npx claude-flow@alpha hooks pre-task --description \"{{description}}\" --agent \"{{agent}}\""
301
- ]
302
- },
303
- postToolUse: {
304
- enabled: true,
305
- commands: [
306
- "npx claude-flow@alpha hooks post-task --task-id \"{{task_id}}\" --results \"{{results}}\""
307
- ]
308
- },
309
- postEdit: {
310
- enabled: true,
311
- commands: [
312
- "npx claude-flow@alpha hooks post-edit --file \"{{file}}\" --memory-key \"aqe/files/{{file_name}}\""
313
- ]
314
- }
315
- },
316
- environment: {
317
- CLAUDE_FLOW_HOOKS_ENABLED: "true",
318
- AQE_FLEET_ENABLED: "true",
319
- AQE_MEMORY_NAMESPACE: "aqe"
320
- },
321
- permissions: {
322
- allowedCommands: [
323
- "aqe-generate",
324
- "aqe-execute",
325
- "aqe-analyze",
326
- "aqe-optimize",
327
- "aqe-report",
328
- "aqe-fleet-status",
329
- "aqe-chaos",
330
- "aqe-benchmark"
331
- ]
332
- },
333
- customPrompts: {
334
- testGeneration: "Generate comprehensive tests following TDD best practices",
335
- coverageAnalysis: "Use sublinear algorithms for efficient coverage analysis",
336
- qualityGate: "Enforce quality thresholds: 95% coverage, <15 complexity"
337
- }
338
- };
339
-
340
- fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2));
341
- console.log(chalk.green('\n✅ Created settings.json with hook configuration'));
342
- console.log(chalk.gray(` File: ${settingsPath}`));
40
+ // Determine CLI path (compiled TypeScript)
41
+ const cliPath = path.join(__dirname, '..', 'dist', 'cli', 'index.js');
42
+
43
+ // Check if build exists
44
+ if (!fs.existsSync(cliPath)) {
45
+ console.error('❌ Error: CLI not built. Please run: npm run build');
46
+ console.error('');
47
+ console.error('Build steps:');
48
+ console.error(' cd /workspaces/agentic-qe-cf');
49
+ console.error(' npm install');
50
+ console.error(' npm run build');
51
+ console.error('');
52
+ console.error('After building, try again: aqe --help');
53
+ process.exit(1);
343
54
  }
344
55
 
345
- /**
346
- * Create fleet configuration file
347
- * @param {object} config - Fleet configuration
348
- * @param {string} targetDir - Target directory
349
- */
350
- function createFleetConfig(config, targetDir = process.cwd()) {
351
- // Security: Validate and sanitize directory path
352
- const sanitizedTargetDir = path.resolve(targetDir);
353
- if (!isAllowedDirectory(sanitizedTargetDir)) {
354
- throw new Error(`Access denied: ${targetDir} is not an allowed directory`);
56
+ // Global error handler
57
+ process.on('uncaughtException', (error) => {
58
+ console.error('❌ Unexpected error:', error.message);
59
+ if (process.env.DEBUG || process.env.VERBOSE) {
60
+ console.error('Stack trace:', error.stack);
355
61
  }
62
+ console.error('');
63
+ console.error('Please report this issue at:');
64
+ console.error('https://github.com/proffesor-for-testing/agentic-qe/issues');
65
+ process.exit(1);
66
+ });
356
67
 
357
- const configPath = path.join(sanitizedTargetDir, '.claude', 'aqe-fleet.json');
358
-
359
- const fleetConfig = {
360
- fleetId: config.fleetId || `aqe-fleet-${Date.now()}`,
361
- version: "2.0.0",
362
- topology: config.topology || 'hierarchical',
363
- maxAgents: config.maxAgents || 6,
364
- agents: config.agents || [],
365
- created: new Date().toISOString(),
366
- status: 'active',
367
- configuration: {
368
- coordination: {
369
- memoryNamespace: 'aqe',
370
- hooksEnabled: true,
371
- neuralLearning: true
372
- },
373
- testing: {
374
- defaultFramework: 'jest',
375
- coverageThreshold: 95,
376
- parallelWorkers: 'auto'
377
- },
378
- optimization: {
379
- algorithm: 'sublinear',
380
- targetCoveragePerTest: 'maximize'
381
- }
382
- },
383
- metadata: {
384
- packageVersion: '2.0.0',
385
- claudeFlowVersion: 'alpha',
386
- initDate: new Date().toISOString()
387
- }
388
- };
389
-
390
- fs.writeFileSync(configPath, JSON.stringify(fleetConfig, null, 2));
391
- console.log(chalk.green('\n✅ Created fleet configuration'));
392
- console.log(chalk.gray(` File: ${configPath}`));
393
-
394
- return fleetConfig;
395
- }
396
-
397
- /**
398
- * Update CLAUDE.md in target project with AQE rules
399
- */
400
- function updateClaudeMD(targetDir = process.cwd()) {
401
- // Security: Validate and sanitize directory path
402
- const sanitizedTargetDir = path.resolve(targetDir);
403
- if (!isAllowedDirectory(sanitizedTargetDir)) {
404
- throw new Error(`Access denied: ${targetDir} is not an allowed directory`);
68
+ process.on('unhandledRejection', (reason, promise) => {
69
+ console.error('❌ Unhandled promise rejection:', reason);
70
+ if (process.env.DEBUG || process.env.VERBOSE) {
71
+ console.error('Promise:', promise);
405
72
  }
406
- const claudeMdPath = path.join(sanitizedTargetDir, 'CLAUDE.md');
407
-
408
- console.log(chalk.cyan('\n📝 Updating CLAUDE.md with AQE rules...\n'));
409
-
410
- // AQE rules to add
411
- const aqeRules = `
412
-
413
- ## 🚀 AGENTIC QE FLEET - CRITICAL RULES
414
-
415
- ### 📦 Project Structure
416
- **The AQE implementation is in \`/agentic-qe/\` subfolder by design:**
417
- - This is a modular monorepo pattern
418
- - Core AQE system is separate from projects using it
419
- - This allows:
420
- - Centralized QE agent management
421
- - Reusability across multiple projects
422
- - Clean separation of concerns
423
- - Easy updates and maintenance
424
-
425
- ### 🤖 Available QE Agents
426
- - **qe-test-generator**: AI-powered test creation with property-based testing
427
- - **qe-test-executor**: Parallel test execution with retry logic
428
- - **qe-coverage-analyzer**: O(log n) coverage optimization with gap detection
429
- - **qe-quality-gate**: Intelligent go/no-go decisions with risk assessment
430
- - **qe-performance-tester**: Load testing and bottleneck detection
431
- - **qe-security-scanner**: SAST/DAST integration with CVE monitoring
432
-
433
- ### ⚡ Agent Usage
434
- **Spawn agents via Claude Code Task tool:**
435
- \`\`\`javascript
436
- Task("Generate tests", "Create comprehensive test suite", "qe-test-generator")
437
- Task("Execute tests", "Run tests in parallel", "qe-test-executor")
438
- Task("Analyze coverage", "Find coverage gaps", "qe-coverage-analyzer")
439
- \`\`\`
440
-
441
- **Or use MCP tools for coordination:**
442
- \`\`\`javascript
443
- mcp__agentic_qe__fleet_init({ topology: "hierarchical" })
444
- mcp__agentic_qe__test_generate({ framework: "jest", coverage: 0.95 })
445
- \`\`\`
446
-
447
- ### 🎯 Best Practices
448
- 1. **Initialize Fleet First**: Run \`aqe init\` before using agents
449
- 2. **Use Parallel Execution**: Spawn multiple agents in single messages
450
- 3. **Leverage Memory**: Agents share state via Claude Flow memory
451
- 4. **Monitor Progress**: Check agent status with \`aqe status\`
452
- 5. **Claude Flow Integration**: Agents use hooks for coordination
453
-
454
- ### ⚠️ Common Pitfalls
455
- - Don't expect agents in root .claude/agents/ - they're in project's .claude/agents/
456
- - Real vs Mock: \`aqe init\` creates real agents (not mocked demos)
457
- - Hooks are intentional: Agents coordinate via Claude Flow hooks
458
- - Memory is shared: All agents can access aqe/* memory keys
459
-
460
- ### 🔧 Commands
461
- - \`aqe init\` - Initialize AQE fleet in current project
462
- - \`aqe status\` - Show fleet status
463
- - \`aqe test <module>\` - Generate tests for a module
464
- - \`aqe coverage\` - Analyze test coverage
465
- - \`aqe quality\` - Run quality gate check
466
- - \`aqe agent spawn --name <agent>\` - Spawn specific agent
467
- - \`aqe agent execute --name <agent> --task "<task>"\` - Execute task
468
-
469
- ---
470
-
471
- *Agentic QE Fleet - Enterprise-grade quality engineering powered by AI and sublinear algorithms*
472
- `;
473
-
474
- // Check if CLAUDE.md exists
475
- if (fs.existsSync(claudeMdPath)) {
476
- let content = fs.readFileSync(claudeMdPath, 'utf-8');
477
-
478
- // Check if AQE rules already exist
479
- if (content.includes('AGENTIC QE FLEET - CRITICAL RULES')) {
480
- console.log(chalk.yellow('⚠️ AQE rules already exist in CLAUDE.md'));
481
- console.log(chalk.cyan(' Updating existing rules...'));
482
-
483
- // Replace existing AQE section
484
- const startMarker = '## 🚀 AGENTIC QE FLEET - CRITICAL RULES';
485
- const endMarker = '*Agentic QE Fleet - Enterprise-grade quality engineering powered by AI and sublinear algorithms*';
486
-
487
- const startIndex = content.indexOf(startMarker);
488
- if (startIndex !== -1) {
489
- const endIndex = content.indexOf(endMarker, startIndex);
490
- if (endIndex !== -1) {
491
- const before = content.substring(0, startIndex);
492
- const after = content.substring(endIndex + endMarker.length);
493
- content = before + aqeRules.trim() + after;
494
- }
495
- }
496
- } else {
497
- // Append AQE rules to existing CLAUDE.md
498
- content += aqeRules;
499
- }
500
-
501
- fs.writeFileSync(claudeMdPath, content);
502
- console.log(chalk.green('✅ Updated existing CLAUDE.md with AQE rules'));
73
+ console.error('');
74
+ console.error('Please report this issue at:');
75
+ console.error('https://github.com/proffesor-for-testing/agentic-qe/issues');
76
+ process.exit(1);
77
+ });
78
+
79
+ // Load and execute the compiled TypeScript CLI
80
+ try {
81
+ // Import the CLI module
82
+ require(cliPath);
83
+
84
+ } catch (error) {
85
+ console.error('❌ Error loading CLI:', error.message);
86
+
87
+ if (process.env.DEBUG || process.env.VERBOSE) {
88
+ console.error('');
89
+ console.error('Debug information:');
90
+ console.error(' CLI path:', cliPath);
91
+ console.error(' CLI exists:', fs.existsSync(cliPath));
92
+ console.error(' Node version:', process.version);
93
+ console.error(' Platform:', process.platform);
94
+ console.error(' Stack trace:', error.stack);
503
95
  } else {
504
- // Create new CLAUDE.md with AQE rules
505
- const defaultContent = `# Claude Code Configuration
506
-
507
- ## Project Overview
508
- This project uses Agentic QE Fleet for comprehensive quality engineering.
509
- ${aqeRules}`;
510
-
511
- fs.writeFileSync(claudeMdPath, defaultContent);
512
- console.log(chalk.green('✅ Created new CLAUDE.md with AQE rules'));
513
- }
514
-
515
- console.log(chalk.gray(` File: ${claudeMdPath}`));
516
- }
517
-
518
- /**
519
- * Initialize the AQE Fleet with real agents
520
- * @param {string} targetDir - Target directory for initialization (defaults to current directory)
521
- */
522
- async function initializeFleet(targetDir = process.cwd()) {
523
- console.log(chalk.cyan('\n🚀 Initializing Agentic QE Fleet...\n'));
524
-
525
- // Security: Validate and sanitize directory path
526
- const sanitizedTargetDir = path.resolve(targetDir);
527
- if (!isAllowedDirectory(sanitizedTargetDir)) {
528
- throw new Error(`Access denied: ${targetDir} is not an allowed directory`);
529
- }
530
-
531
- console.log(chalk.gray(`Target directory: ${sanitizedTargetDir}\n`));
532
-
533
- // Ensure Claude agents directory exists in target directory
534
- const targetClaudeDir = path.join(sanitizedTargetDir, '.claude', 'agents');
535
- if (!fs.existsSync(targetClaudeDir)) {
536
- fs.mkdirSync(targetClaudeDir, { recursive: true });
537
- }
538
-
539
- // Define AQE agent types
540
- // Complete 16-agent AQE Fleet
541
- const aqeAgents = [
542
- // Core Testing Agents (6)
543
- {
544
- name: 'qe-test-generator',
545
- type: 'test-generator',
546
- capabilities: [
547
- 'AI-powered test generation',
548
- 'Property-based testing',
549
- 'Boundary value analysis',
550
- 'Coverage-driven generation',
551
- 'Multi-framework support (Jest, Mocha, Cypress)'
552
- ]
553
- },
554
- {
555
- name: 'qe-test-executor',
556
- type: 'test-executor',
557
- capabilities: [
558
- 'Parallel test execution',
559
- 'Retry logic for flaky tests',
560
- 'Real-time reporting',
561
- 'Framework integration',
562
- 'Resource optimization'
563
- ]
564
- },
565
- {
566
- name: 'qe-coverage-analyzer',
567
- type: 'coverage-analyzer',
568
- capabilities: [
569
- 'O(log n) coverage optimization',
570
- 'Gap identification',
571
- 'Critical path analysis',
572
- 'Sublinear algorithms',
573
- 'Coverage trend analysis'
574
- ]
575
- },
576
- {
577
- name: 'qe-quality-gate',
578
- type: 'quality-gate',
579
- capabilities: [
580
- 'Threshold enforcement',
581
- 'Go/no-go decisions',
582
- 'Risk assessment',
583
- 'Policy validation',
584
- 'Automated approvals'
585
- ]
586
- },
587
- {
588
- name: 'qe-performance-tester',
589
- type: 'performance-tester',
590
- capabilities: [
591
- 'Load testing orchestration',
592
- 'Bottleneck detection',
593
- 'Resource monitoring',
594
- 'SLA validation',
595
- 'Performance regression detection'
596
- ]
597
- },
598
- {
599
- name: 'qe-security-scanner',
600
- type: 'security-scanner',
601
- capabilities: [
602
- 'SAST/DAST integration',
603
- 'Vulnerability detection',
604
- 'Compliance checking',
605
- 'Security test generation',
606
- 'CVE monitoring'
607
- ]
608
- },
609
- // Specialized Testing Agents (3)
610
- {
611
- name: 'qe-fleet-commander',
612
- type: 'fleet-commander',
613
- capabilities: [
614
- 'Hierarchical coordination',
615
- 'Resource allocation',
616
- 'Dynamic topology management',
617
- 'Conflict resolution',
618
- 'Auto-scaling'
619
- ]
620
- },
621
- {
622
- name: 'qe-chaos-engineer',
623
- type: 'chaos-engineer',
624
- capabilities: [
625
- 'Fault injection',
626
- 'Recovery testing',
627
- 'Blast radius control',
628
- 'Experiment orchestration',
629
- 'Safety validation'
630
- ]
631
- },
632
- {
633
- name: 'qe-visual-tester',
634
- type: 'visual-tester',
635
- capabilities: [
636
- 'Screenshot comparison',
637
- 'Visual regression detection',
638
- 'Accessibility validation',
639
- 'Cross-browser testing',
640
- 'Semantic analysis'
641
- ]
642
- },
643
- // Strategic Planning Agents (P0 - Critical) (3)
644
- {
645
- name: 'qe-requirements-validator',
646
- type: 'requirements-validator',
647
- capabilities: [
648
- 'Testability analysis',
649
- 'BDD scenario generation',
650
- 'Risk assessment',
651
- 'Acceptance criteria validation',
652
- 'Traceability mapping'
653
- ]
654
- },
655
- {
656
- name: 'qe-deployment-readiness',
657
- type: 'deployment-validator',
658
- capabilities: [
659
- 'Risk scoring',
660
- 'Release confidence calculation',
661
- 'Checklist automation',
662
- 'Rollback prediction',
663
- 'Stakeholder reporting'
664
- ]
665
- },
666
- {
667
- name: 'qe-production-intelligence',
668
- type: 'production-analyzer',
669
- capabilities: [
670
- 'Incident replay testing',
671
- 'RUM analysis',
672
- 'Anomaly detection',
673
- 'Load pattern analysis',
674
- 'Feature usage analytics'
675
- ]
676
- },
677
- // Optimization Agents (P1 - High Value) (4)
678
- {
679
- name: 'qe-regression-risk-analyzer',
680
- type: 'regression-analyzer',
681
- capabilities: [
682
- 'Change impact analysis',
683
- 'Test selection optimization',
684
- 'Risk heat mapping',
685
- 'Dependency tracking',
686
- 'Historical pattern learning'
687
- ]
688
- },
689
- {
690
- name: 'qe-test-data-architect',
691
- type: 'data-generator',
692
- capabilities: [
693
- 'Schema-aware generation',
694
- 'Relationship preservation',
695
- 'Edge case data',
696
- 'Data anonymization',
697
- 'Realistic data synthesis'
698
- ]
699
- },
700
- {
701
- name: 'qe-api-contract-validator',
702
- type: 'contract-validator',
703
- capabilities: [
704
- 'Schema validation',
705
- 'Breaking change detection',
706
- 'Version compatibility',
707
- 'Contract diffing',
708
- 'Consumer impact analysis'
709
- ]
710
- },
711
- {
712
- name: 'qe-flaky-test-hunter',
713
- type: 'flaky-test-detector',
714
- capabilities: [
715
- 'Flaky detection',
716
- 'Root cause analysis',
717
- 'Auto-stabilization',
718
- 'Quarantine management',
719
- 'Trend tracking'
720
- ]
721
- }
722
- ];
723
-
724
- // Copy comprehensive agent templates
725
- console.log(chalk.bold('Registering AQE agents with Claude Code:\n'));
726
- aqeAgents.forEach(agent => {
727
- copyAgentTemplate(agent.name, targetDir);
728
- });
729
-
730
- // Copy command definitions (8 QE slash commands)
731
- copyCommandDefinitions(targetDir);
732
-
733
- // Create settings.json with hook configuration
734
- createSettingsJson(targetDir);
735
-
736
- // Create fleet configuration with all metadata
737
- const fleetConfig = createFleetConfig({
738
- fleetId: `aqe-fleet-${Date.now()}`,
739
- topology: 'hierarchical',
740
- maxAgents: 6,
741
- agents: aqeAgents.map(a => a.name)
742
- }, targetDir);
743
-
744
- console.log(chalk.cyan('\n📋 Fleet Configuration:'));
745
- console.log(` Fleet ID: ${chalk.green(fleetConfig.fleetId)}`);
746
- console.log(` Topology: ${chalk.green(fleetConfig.topology)}`);
747
- console.log(` Agents: ${chalk.green(fleetConfig.agents.length)}`);
748
- console.log(` Commands: ${chalk.green('8 QE slash commands')}`);
749
- console.log(` Hooks: ${chalk.green('Enabled via settings.json')}`);
750
-
751
- // Update CLAUDE.md with AQE rules
752
- updateClaudeMD(targetDir);
753
-
754
- // Initialize with Claude Flow hooks using secure execution
755
- console.log(chalk.cyan('\n🔗 Integrating with Claude Flow...\n'));
756
- try {
757
- await executeCommand('npx', ['claude-flow@alpha', 'hooks', 'pre-task', '--description', 'AQE Fleet Initialization'], { stdio: 'inherit' });
758
- await executeCommand('npx', ['claude-flow@alpha', 'memory', 'store', '--key', 'aqe/fleet/id', '--value', fleetConfig.fleetId], { stdio: 'inherit' });
759
- await executeCommand('npx', ['claude-flow@alpha', 'hooks', 'notify', '--message', 'AQE Fleet initialized with real agents'], { stdio: 'inherit' });
760
- } catch (error) {
761
- console.log(chalk.yellow('⚠️ Claude Flow integration optional - continuing...'));
762
- }
763
-
764
- console.log(chalk.green('\n✅ AQE Fleet successfully initialized!'));
765
- console.log(chalk.gray('\nAgents are now available in: .claude/agents/'));
766
- console.log(chalk.gray('Use Claude Code to interact with these agents.\n'));
767
- }
768
-
769
- /**
770
- * Show fleet status
771
- */
772
- function showFleetStatus() {
773
- console.log(chalk.cyan('\n📊 AQE Fleet Status\n'));
774
-
775
- const configPath = path.join(process.cwd(), '.claude', 'aqe-fleet.json');
776
-
777
- if (!fs.existsSync(configPath)) {
778
- console.log(chalk.red('❌ Fleet not initialized. Run: aqe init'));
779
- return;
780
- }
781
-
782
- const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
783
-
784
- console.log(`Fleet ID: ${chalk.green(config.fleetId)}`);
785
- console.log(`Status: ${chalk.green(config.status)}`);
786
- console.log(`Created: ${chalk.gray(config.created)}`);
787
- console.log(`Topology: ${chalk.green(config.topology)}`);
788
-
789
- console.log(chalk.bold('\n🤖 Registered Agents:'));
790
- const CLAUDE_AGENTS_DIR = path.join(process.cwd(), '.claude', 'agents');
791
- config.agents.forEach(agentName => {
792
- const agentPath = path.join(CLAUDE_AGENTS_DIR, `${agentName}.md`);
793
- const exists = fs.existsSync(agentPath);
794
- const status = exists ? chalk.green('✓ Active') : chalk.red('✗ Missing');
795
- console.log(` ${agentName}: ${status}`);
796
- });
797
-
798
- console.log(chalk.cyan('\n💡 Quick Commands:'));
799
- console.log(' aqe test <module> - Generate tests');
800
- console.log(' aqe coverage - Analyze coverage');
801
- console.log(' aqe quality - Check quality gates');
802
- console.log(' aqe agent execute - Run agent task');
803
- }
804
-
805
- /**
806
- * Setup MCP integration
807
- */
808
- function setupMCP() {
809
- console.log(chalk.cyan('\n🔧 Setting up MCP Server for Claude Code...\n'));
810
-
811
- // Update package.json with MCP script
812
- const packagePath = path.join(process.cwd(), 'package.json');
813
-
814
- if (!fs.existsSync(packagePath)) {
815
- console.log(chalk.red('❌ No package.json found. Please run from project root.'));
816
- return;
96
+ console.error('');
97
+ console.error('Run with DEBUG=1 for detailed error information:');
98
+ console.error(' DEBUG=1 aqe --help');
817
99
  }
818
100
 
819
- const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf-8'));
820
-
821
- packageJson.scripts = packageJson.scripts || {};
822
- packageJson.scripts['mcp:start'] = 'ts-node src/mcp/start.ts';
823
- packageJson.scripts['mcp:dev'] = 'nodemon --watch src/mcp -e ts --exec ts-node src/mcp/start.ts';
824
-
825
- fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2));
826
- console.log(chalk.green('✅ Added MCP scripts to package.json'));
827
-
828
- console.log(chalk.cyan('\nTo connect AQE to Claude Code:'));
829
- console.log(chalk.bold('\n1. Add MCP server to Claude Code:'));
830
- console.log(chalk.gray(' claude mcp add agentic-qe "cd ' + process.cwd() + ' && npm run mcp:start"'));
831
-
832
- console.log(chalk.bold('\n2. Restart Claude Code to load MCP tools'));
101
+ console.error('');
102
+ console.error('Troubleshooting:');
103
+ console.error(' 1. Rebuild: npm run build');
104
+ console.error(' 2. Reinstall: npm install');
105
+ console.error(' 3. Check Node.js version: node --version (require 18+)');
106
+ console.error('');
107
+ console.error('If the issue persists, please report at:');
108
+ console.error('https://github.com/proffesor-for-testing/agentic-qe/issues');
833
109
 
834
- console.log(chalk.bold('\n3. Use MCP tools in Claude Code:'));
835
- console.log(chalk.gray(' - mcp__agentic_qe__fleet_init'));
836
- console.log(chalk.gray(' - mcp__agentic_qe__test_generate'));
837
- console.log(chalk.gray(' - mcp__agentic_qe__test_execute'));
838
- console.log(chalk.gray(' - mcp__agentic_qe__quality_analyze'));
839
- }
840
-
841
- // Get command and arguments
842
- const command = process.argv[2];
843
- const args = process.argv.slice(3);
844
-
845
- // Handle commands - wrapped in async function for secure execution
846
- async function handleCommand() {
847
- switch(command) {
848
- case 'init':
849
- // Initialize AQE Fleet
850
- const targetDir = args[0] || process.cwd();
851
- await initializeFleet(targetDir);
852
- break;
853
-
854
- case 'status':
855
- // Show fleet status
856
- showFleetStatus();
857
- break;
858
-
859
- case 'mcp':
860
- // Setup MCP server
861
- setupMCP();
862
- break;
863
-
864
- case 'agent':
865
- // Agent management commands - delegate to main agentic-qe using secure execution
866
- const mainScript = path.join(__dirname, 'agentic-qe');
867
- try {
868
- await executeCommand('node', [mainScript, 'agent', ...args], { stdio: 'inherit' });
869
- } catch (error) {
870
- console.error(chalk.red('Failed to execute agent command:'), error.message);
871
- process.exit(1);
872
- }
873
- break;
874
-
875
- case 'test':
876
- // Quick test generation
877
- if (!args.length) {
878
- console.log(chalk.red('❌ Please specify a module: aqe test <module>'));
879
- process.exit(1);
880
- }
881
- console.log(chalk.cyan(`\n🧪 Generating tests for: ${args.join(' ')}\n`));
882
- console.log(chalk.yellow('Using qe-test-generator agent...'));
883
- // TODO: Implement actual test generation
884
- console.log(chalk.gray('\nNote: Direct test generation coming soon.'));
885
- console.log(chalk.gray('For now, use: aqe agent execute --name qe-test-generator --task "generate tests for ' + args.join(' ') + '"'));
886
- break;
887
-
888
- case 'coverage':
889
- // Quick coverage analysis
890
- console.log(chalk.cyan('\n📊 Analyzing test coverage...\n'));
891
- console.log(chalk.yellow('Using qe-coverage-analyzer agent...'));
892
- // TODO: Implement actual coverage analysis
893
- console.log(chalk.gray('\nNote: Direct coverage analysis coming soon.'));
894
- console.log(chalk.gray('For now, use: aqe agent execute --name qe-coverage-analyzer --task "analyze coverage"'));
895
- break;
896
-
897
- case 'quality':
898
- // Quick quality gate check
899
- console.log(chalk.cyan('\n✅ Running quality gate check...\n'));
900
- console.log(chalk.yellow('Using qe-quality-gate agent...'));
901
- // TODO: Implement actual quality gate
902
- console.log(chalk.gray('\nNote: Direct quality gate check coming soon.'));
903
- console.log(chalk.gray('For now, use: aqe agent execute --name qe-quality-gate --task "evaluate quality gate"'));
904
- break;
905
-
906
- case 'help':
907
- case '--help':
908
- case '-h':
909
- case undefined:
910
- // Show help
911
- console.log(chalk.cyan('\n🚀 AQE - Agentic Quality Engineering Fleet\n'));
912
- console.log(chalk.bold('Usage:') + ' aqe <command> [options]\n');
913
-
914
- console.log(chalk.bold('Core Commands:'));
915
- console.log(' ' + chalk.green('init [dir]') + ' Initialize AQE Fleet in directory (updates CLAUDE.md)');
916
- console.log(' ' + chalk.green('status') + ' Show fleet status and registered agents');
917
- console.log(' ' + chalk.green('mcp') + ' Setup MCP server for Claude Code integration\n');
918
-
919
- console.log(chalk.bold('Quick Actions:'));
920
- console.log(' ' + chalk.green('test <module>') + ' Generate tests for a module');
921
- console.log(' ' + chalk.green('coverage') + ' Analyze test coverage');
922
- console.log(' ' + chalk.green('quality') + ' Run quality gate check\n');
923
-
924
- console.log(chalk.bold('Agent Management:'));
925
- console.log(' ' + chalk.green('agent spawn') + ' Spawn a QE agent');
926
- console.log(' ' + chalk.green('agent execute') + ' Execute agent task');
927
- console.log(' ' + chalk.green('agent status') + ' Check agent status\n');
928
-
929
- console.log(chalk.bold('Available Agents:'));
930
- console.log(' • qe-test-generator - AI-powered test creation');
931
- console.log(' • qe-test-executor - Parallel test execution');
932
- console.log(' • qe-coverage-analyzer - O(log n) coverage optimization');
933
- console.log(' • qe-quality-gate - Go/no-go decisions');
934
- console.log(' • qe-performance-tester - Load testing');
935
- console.log(' • qe-security-scanner - SAST/DAST scanning\n');
936
-
937
- console.log(chalk.gray('Examples:'));
938
- console.log(chalk.gray(' aqe init # Initialize in current directory'));
939
- console.log(chalk.gray(' aqe init /my/project # Initialize in specific directory'));
940
- console.log(chalk.gray(' aqe test user-service # Generate tests for user-service'));
941
- console.log(chalk.gray(' aqe coverage # Analyze test coverage'));
942
- console.log(chalk.gray(' aqe quality # Check quality gates\n'));
943
-
944
- console.log(chalk.dim('For detailed help on any command, use: aqe <command> --help'));
945
- console.log(chalk.dim('Documentation: https://github.com/agentic-qe/docs\n'));
946
- break;
947
-
948
- default:
949
- console.error(chalk.red(`Unknown command: ${command}`));
950
- console.log(chalk.yellow('\nRun "aqe help" to see available commands'));
951
- process.exit(1);
952
- }
953
- }
954
-
955
- // Execute command handler
956
- handleCommand().catch(error => {
957
- console.error(chalk.red('Error executing command:'), error.message);
958
110
  process.exit(1);
959
- });
111
+ }