claude-flow-novice 1.3.6 → 1.5.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 (345) hide show
  1. package/.claude/agents/analysis/code-analyzer.md +3 -20
  2. package/.claude/agents/analysis/code-review/analyze-code-quality.md +1 -1
  3. package/.claude/agents/analyst.md +208 -550
  4. package/.claude/agents/architect.md +136 -469
  5. package/.claude/agents/architecture/system-architect.md +20 -1
  6. package/.claude/agents/architecture/system-design/arch-system-design.md +1 -1
  7. package/.claude/agents/base-template-generator.md +24 -1
  8. package/.claude/agents/coder.md +87 -303
  9. package/.claude/agents/consensus/byzantine-coordinator.md +4 -21
  10. package/.claude/agents/consensus/consensus-builder.md +3 -20
  11. package/.claude/agents/consensus/crdt-synchronizer.md +4 -21
  12. package/.claude/agents/consensus/gossip-coordinator.md +4 -21
  13. package/.claude/agents/consensus/performance-benchmarker.md +4 -21
  14. package/.claude/agents/consensus/quorum-manager.md +4 -21
  15. package/.claude/agents/consensus/raft-manager.md +4 -21
  16. package/.claude/agents/consensus/security-manager.md +4 -21
  17. package/.claude/agents/coordinator.md +22 -11
  18. package/.claude/agents/data/ml/data-ml-model.md +2 -2
  19. package/.claude/agents/development/backend/dev-backend-api.md +2 -2
  20. package/.claude/agents/devops/ci-cd/ops-cicd-github.md +2 -2
  21. package/.claude/agents/devops/devops-engineer.md +134 -402
  22. package/.claude/agents/documentation/api-docs/docs-api-openapi.md +2 -2
  23. package/.claude/agents/github/code-review-swarm.md +1 -1
  24. package/.claude/agents/github/github-specialist.md +856 -0
  25. package/.claude/agents/github/pr-manager.md +1 -1
  26. package/.claude/agents/github/release-manager.md +1 -1
  27. package/.claude/agents/neural/neural-pattern-agent.md +762 -0
  28. package/.claude/agents/optimization/benchmark-suite.md +1 -1
  29. package/.claude/agents/optimization/perf-analyzer.md +1 -1
  30. package/.claude/agents/optimization/performance-monitor.md +1 -1
  31. package/.claude/agents/planner.md +135 -0
  32. package/.claude/agents/researcher.md +22 -9
  33. package/.claude/agents/reviewer.md +291 -0
  34. package/.claude/agents/security/security-specialist.md +1 -1
  35. package/.claude/agents/sparc/architecture.md +1 -1
  36. package/.claude/agents/sparc/pseudocode.md +1 -1
  37. package/.claude/agents/sparc/refinement.md +1 -1
  38. package/.claude/agents/sparc/specification.md +1 -1
  39. package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +2 -2
  40. package/.claude/agents/tester.md +21 -11
  41. package/.claude/agents/testing/unit/tdd-london-swarm.md +1 -1
  42. package/.claude/agents/testing/validation/production-validator.md +1 -1
  43. package/.claude/commands/claude-soul.js +1 -1
  44. package/.claude/hooks.json +12 -15
  45. package/{.claude → .claude-flow-novice/.claude}/agents/MIGRATION_SUMMARY.md +1 -1
  46. package/.claude-flow-novice/.claude/agents/analysis/code-analyzer.md +192 -0
  47. package/.claude-flow-novice/.claude/agents/analysis/code-review/analyze-code-quality.md +180 -0
  48. package/.claude-flow-novice/.claude/agents/analyst.md +300 -0
  49. package/.claude-flow-novice/.claude/agents/architect.md +557 -0
  50. package/.claude-flow-novice/.claude/agents/architecture/system-architect.md +630 -0
  51. package/.claude-flow-novice/.claude/agents/architecture/system-design/arch-system-design.md +156 -0
  52. package/.claude-flow-novice/.claude/agents/base-template-generator.md +65 -0
  53. package/.claude-flow-novice/.claude/agents/coder.md +180 -0
  54. package/.claude-flow-novice/.claude/agents/consensus/byzantine-coordinator.md +46 -0
  55. package/.claude-flow-novice/.claude/agents/consensus/consensus-builder.md +225 -0
  56. package/.claude-flow-novice/.claude/agents/consensus/crdt-synchronizer.md +980 -0
  57. package/.claude-flow-novice/.claude/agents/consensus/gossip-coordinator.md +46 -0
  58. package/.claude-flow-novice/.claude/agents/consensus/performance-benchmarker.md +834 -0
  59. package/.claude-flow-novice/.claude/agents/consensus/quorum-manager.md +806 -0
  60. package/.claude-flow-novice/.claude/agents/consensus/raft-manager.md +46 -0
  61. package/.claude-flow-novice/.claude/agents/consensus/security-manager.md +605 -0
  62. package/.claude-flow-novice/.claude/agents/coordinator.md +842 -0
  63. package/.claude-flow-novice/.claude/agents/data/ml/data-ml-model.md +193 -0
  64. package/.claude-flow-novice/.claude/agents/development/backend/dev-backend-api.md +142 -0
  65. package/.claude-flow-novice/.claude/agents/devops/ci-cd/ops-cicd-github.md +164 -0
  66. package/.claude-flow-novice/.claude/agents/devops/devops-engineer.md +638 -0
  67. package/.claude-flow-novice/.claude/agents/documentation/api-docs/docs-api-openapi.md +174 -0
  68. package/.claude-flow-novice/.claude/agents/github/code-review-swarm.md +538 -0
  69. package/.claude-flow-novice/.claude/agents/github/github-modes.md +173 -0
  70. package/.claude-flow-novice/.claude/agents/github/github-specialist.md +856 -0
  71. package/.claude-flow-novice/.claude/agents/github/issue-tracker.md +319 -0
  72. package/.claude-flow-novice/.claude/agents/github/multi-repo-swarm.md +553 -0
  73. package/.claude-flow-novice/.claude/agents/github/pr-manager.md +191 -0
  74. package/.claude-flow-novice/.claude/agents/github/project-board-sync.md +509 -0
  75. package/.claude-flow-novice/.claude/agents/github/release-manager.md +367 -0
  76. package/.claude-flow-novice/.claude/agents/github/release-swarm.md +583 -0
  77. package/.claude-flow-novice/.claude/agents/github/repo-architect.md +398 -0
  78. package/.claude-flow-novice/.claude/agents/github/swarm-issue.md +573 -0
  79. package/.claude-flow-novice/.claude/agents/github/swarm-pr.md +428 -0
  80. package/.claude-flow-novice/.claude/agents/github/sync-coordinator.md +452 -0
  81. package/.claude-flow-novice/.claude/agents/github/workflow-automation.md +635 -0
  82. package/.claude-flow-novice/.claude/agents/goal/goal-planner.md +73 -0
  83. package/.claude-flow-novice/.claude/agents/neural/neural-pattern-agent.md +762 -0
  84. package/.claude-flow-novice/.claude/agents/neural/safla-neural.md +74 -0
  85. package/.claude-flow-novice/.claude/agents/optimization/benchmark-suite.md +665 -0
  86. package/.claude-flow-novice/.claude/agents/optimization/load-balancer.md +431 -0
  87. package/.claude-flow-novice/.claude/agents/optimization/perf-analyzer.md +725 -0
  88. package/.claude-flow-novice/.claude/agents/optimization/performance-monitor.md +672 -0
  89. package/.claude-flow-novice/.claude/agents/optimization/resource-allocator.md +674 -0
  90. package/.claude-flow-novice/.claude/agents/optimization/topology-optimizer.md +808 -0
  91. package/.claude-flow-novice/.claude/agents/planner.md +135 -0
  92. package/.claude-flow-novice/.claude/agents/researcher.md +185 -0
  93. package/.claude-flow-novice/.claude/agents/reviewer.md +291 -0
  94. package/.claude-flow-novice/.claude/agents/security/security-specialist.md +978 -0
  95. package/.claude-flow-novice/.claude/agents/sparc/architecture.md +472 -0
  96. package/.claude-flow-novice/.claude/agents/sparc/pseudocode.md +318 -0
  97. package/.claude-flow-novice/.claude/agents/sparc/refinement.md +525 -0
  98. package/.claude-flow-novice/.claude/agents/sparc/specification.md +276 -0
  99. package/.claude-flow-novice/.claude/agents/specialized/mobile/spec-mobile-react-native.md +226 -0
  100. package/.claude-flow-novice/.claude/agents/sublinear/consciousness-evolution-agent.md +499 -0
  101. package/.claude-flow-novice/.claude/agents/sublinear/matrix-solver-agent.md +113 -0
  102. package/.claude-flow-novice/.claude/agents/sublinear/nanosecond-scheduler-agent.md +644 -0
  103. package/.claude-flow-novice/.claude/agents/sublinear/pagerank-agent.md +699 -0
  104. package/.claude-flow-novice/.claude/agents/sublinear/phi-calculator-agent.md +749 -0
  105. package/.claude-flow-novice/.claude/agents/sublinear/psycho-symbolic-agent.md +543 -0
  106. package/.claude-flow-novice/.claude/agents/sublinear/sublinear.md +816 -0
  107. package/.claude-flow-novice/.claude/agents/sublinear/temporal-advantage-agent.md +360 -0
  108. package/.claude-flow-novice/.claude/agents/swarm/adaptive-coordinator-enhanced.md +746 -0
  109. package/.claude-flow-novice/.claude/agents/swarm/adaptive-coordinator.md +396 -0
  110. package/.claude-flow-novice/.claude/agents/swarm/hierarchical-coordinator.md +300 -0
  111. package/.claude-flow-novice/.claude/agents/swarm/mesh-coordinator.md +435 -0
  112. package/.claude-flow-novice/.claude/agents/templates/automation-smart-agent.md +205 -0
  113. package/.claude-flow-novice/.claude/agents/templates/coordinator-swarm-init.md +90 -0
  114. package/.claude-flow-novice/.claude/agents/templates/github-pr-manager.md +177 -0
  115. package/.claude-flow-novice/.claude/agents/templates/implementer-sparc-coder.md +259 -0
  116. package/.claude-flow-novice/.claude/agents/templates/memory-coordinator.md +187 -0
  117. package/.claude-flow-novice/.claude/agents/templates/migration-plan.md +746 -0
  118. package/.claude-flow-novice/.claude/agents/templates/orchestrator-task.md +139 -0
  119. package/.claude-flow-novice/.claude/agents/templates/performance-analyzer.md +199 -0
  120. package/.claude-flow-novice/.claude/agents/templates/sparc-coordinator.md +183 -0
  121. package/.claude-flow-novice/.claude/agents/tester.md +663 -0
  122. package/.claude-flow-novice/.claude/agents/testing/e2e/playwright-agent.md +249 -0
  123. package/.claude-flow-novice/.claude/agents/testing/unit/tdd-london-swarm.md +244 -0
  124. package/.claude-flow-novice/.claude/agents/testing/validation/production-validator.md +395 -0
  125. package/.claude-flow-novice/dist/index.js +12 -24
  126. package/.claude-flow-novice/dist/index.js.map +1 -0
  127. package/.claude-flow-novice/dist/src/agents/agent-manager.js +123 -69
  128. package/.claude-flow-novice/dist/src/agents/agent-manager.js.map +1 -1
  129. package/.claude-flow-novice/dist/src/agents/github/utils/hook-integration.js +7 -7
  130. package/.claude-flow-novice/dist/src/agents/github/utils/hook-integration.js.map +1 -1
  131. package/.claude-flow-novice/dist/src/agents/stage3-integration-validator.js +485 -0
  132. package/.claude-flow-novice/dist/src/agents/stage3-integration-validator.js.map +1 -0
  133. package/.claude-flow-novice/dist/src/agents/unified-ultra-fast-agent-manager.js +630 -0
  134. package/.claude-flow-novice/dist/src/agents/unified-ultra-fast-agent-manager.js.map +1 -0
  135. package/.claude-flow-novice/dist/src/cli/commands/agent.js +1 -1
  136. package/.claude-flow-novice/dist/src/cli/commands/agent.js.map +1 -1
  137. package/.claude-flow-novice/dist/src/cli/commands/config-integration.js +6 -6
  138. package/.claude-flow-novice/dist/src/cli/commands/enterprise.js +18 -18
  139. package/.claude-flow-novice/dist/src/cli/commands/enterprise.js.map +1 -1
  140. package/.claude-flow-novice/dist/src/cli/commands/goal-init.js +4 -4
  141. package/.claude-flow-novice/dist/src/cli/commands/help-new.js +23 -23
  142. package/.claude-flow-novice/dist/src/cli/commands/help-new.js.map +1 -1
  143. package/.claude-flow-novice/dist/src/cli/commands/help.js +74 -74
  144. package/.claude-flow-novice/dist/src/cli/commands/help.js.map +1 -1
  145. package/.claude-flow-novice/dist/src/cli/commands/hive-mind/pause.js +2 -2
  146. package/.claude-flow-novice/dist/src/cli/commands/hive-mind/pause.js.map +1 -1
  147. package/.claude-flow-novice/dist/src/cli/commands/hive.js +4 -4
  148. package/.claude-flow-novice/dist/src/cli/commands/index.js +103 -132
  149. package/.claude-flow-novice/dist/src/cli/commands/index.js.map +1 -1
  150. package/.claude-flow-novice/dist/src/cli/commands/mcp.js +1 -1
  151. package/.claude-flow-novice/dist/src/cli/commands/migrate.js +4 -4
  152. package/.claude-flow-novice/dist/src/cli/commands/migrate.js.map +1 -1
  153. package/.claude-flow-novice/dist/src/cli/commands/monitor.js +1 -1
  154. package/.claude-flow-novice/dist/src/cli/commands/neural-init.js +4 -4
  155. package/.claude-flow-novice/dist/src/cli/commands/ruv-swarm.js +8 -8
  156. package/.claude-flow-novice/dist/src/cli/commands/sparc.js +12 -12
  157. package/.claude-flow-novice/dist/src/cli/commands/sparc.js.map +1 -1
  158. package/.claude-flow-novice/dist/src/cli/commands/start/start-command.js +3 -3
  159. package/.claude-flow-novice/dist/src/cli/commands/status.js +1 -1
  160. package/.claude-flow-novice/dist/src/cli/commands/swarm.js +7 -7
  161. package/.claude-flow-novice/dist/src/cli/commands/swarm.js.map +1 -1
  162. package/.claude-flow-novice/dist/src/cli/commands/verification.js +18 -18
  163. package/.claude-flow-novice/dist/src/cli/completion.js +54 -54
  164. package/.claude-flow-novice/dist/src/cli/completion.js.map +1 -1
  165. package/.claude-flow-novice/dist/src/cli/consolidated/ConsolidatedCLI.js +11 -11
  166. package/.claude-flow-novice/dist/src/cli/consolidated/ConsolidatedCLI.js.map +1 -1
  167. package/.claude-flow-novice/dist/src/cli/consolidated/core/CommandHandlers.js +31 -31
  168. package/.claude-flow-novice/dist/src/cli/consolidated/core/TierManager.js +39 -39
  169. package/.claude-flow-novice/dist/src/cli/consolidated/core/TierManager.js.map +1 -1
  170. package/.claude-flow-novice/dist/src/cli/consolidated/help/InteractiveHelp.js +25 -25
  171. package/.claude-flow-novice/dist/src/cli/consolidated/help/InteractiveHelp.js.map +1 -1
  172. package/.claude-flow-novice/dist/src/cli/consolidated/routing/CommandRouter.js +8 -8
  173. package/.claude-flow-novice/dist/src/cli/consolidated/routing/CommandRouter.js.map +1 -1
  174. package/.claude-flow-novice/dist/src/cli/consolidated/utils/IntelligentDefaults.js +6 -6
  175. package/.claude-flow-novice/dist/src/cli/consolidated/utils/IntelligentDefaults.js.map +1 -1
  176. package/.claude-flow-novice/dist/src/cli/consolidated/utils/PerformanceOptimizer.js +7 -7
  177. package/.claude-flow-novice/dist/src/cli/consolidated/utils/PerformanceOptimizer.js.map +1 -1
  178. package/.claude-flow-novice/dist/src/cli/index-remote.js +10 -10
  179. package/.claude-flow-novice/dist/src/cli/index.js +1 -1
  180. package/.claude-flow-novice/dist/src/cli/init/directory-structure.js +8 -8
  181. package/.claude-flow-novice/dist/src/cli/init/index.js +3 -3
  182. package/.claude-flow-novice/dist/src/cli/init/sparc-environment.js +67 -67
  183. package/.claude-flow-novice/dist/src/cli/init/swarm-commands.js +18 -18
  184. package/.claude-flow-novice/dist/src/cli/node-repl.js +2 -2
  185. package/.claude-flow-novice/dist/src/cli/repl.js +1 -1
  186. package/.claude-flow-novice/dist/src/cli/simple-cli.js +68 -68
  187. package/.claude-flow-novice/dist/src/cli/simple-cli.js.map +1 -1
  188. package/.claude-flow-novice/dist/src/cli/simple-commands/session-start-soul.js +271 -0
  189. package/.claude-flow-novice/dist/src/cli/simple-orchestrator.js +7 -7
  190. package/.claude-flow-novice/dist/src/cli/simple-orchestrator.js.map +1 -1
  191. package/.claude-flow-novice/dist/src/cli/ui/fallback-handler.js +7 -7
  192. package/.claude-flow-novice/dist/src/communication/enhanced-event-bus.js +816 -0
  193. package/.claude-flow-novice/dist/src/communication/enhanced-event-bus.js.map +1 -0
  194. package/.claude-flow-novice/dist/src/communication/failure-recovery-system.js +812 -0
  195. package/.claude-flow-novice/dist/src/communication/failure-recovery-system.js.map +1 -0
  196. package/.claude-flow-novice/dist/src/communication/optimized-serialization.js +369 -0
  197. package/.claude-flow-novice/dist/src/communication/optimized-serialization.js.map +1 -0
  198. package/.claude-flow-novice/dist/src/communication/performance-optimizations.js +526 -0
  199. package/.claude-flow-novice/dist/src/communication/performance-optimizations.js.map +1 -0
  200. package/.claude-flow-novice/dist/src/communication/performance-validator.js +532 -0
  201. package/.claude-flow-novice/dist/src/communication/performance-validator.js.map +1 -0
  202. package/.claude-flow-novice/dist/src/communication/priority-message-queue.js +525 -0
  203. package/.claude-flow-novice/dist/src/communication/priority-message-queue.js.map +1 -0
  204. package/.claude-flow-novice/dist/src/communication/shared-buffer-bus.js +218 -0
  205. package/.claude-flow-novice/dist/src/communication/shared-buffer-bus.js.map +1 -0
  206. package/.claude-flow-novice/dist/src/communication/ultra-fast-communication-bus.js +521 -0
  207. package/.claude-flow-novice/dist/src/communication/ultra-fast-communication-bus.js.map +1 -0
  208. package/.claude-flow-novice/dist/src/communication/ultra-fast-serialization.js +563 -0
  209. package/.claude-flow-novice/dist/src/communication/ultra-fast-serialization.js.map +1 -0
  210. package/.claude-flow-novice/dist/src/communication/websocket-cluster.js +344 -0
  211. package/.claude-flow-novice/dist/src/communication/websocket-cluster.js.map +1 -0
  212. package/.claude-flow-novice/dist/src/communication/zero-copy-structures.js +369 -0
  213. package/.claude-flow-novice/dist/src/communication/zero-copy-structures.js.map +1 -0
  214. package/.claude-flow-novice/dist/src/config/config-manager.js +1 -1
  215. package/.claude-flow-novice/dist/src/config/config-manager.js.map +1 -1
  216. package/.claude-flow-novice/dist/src/config/core/intelligent-configuration-manager.js +1 -1
  217. package/.claude-flow-novice/dist/src/config/integration/hooks-integration.js +6 -6
  218. package/.claude-flow-novice/dist/src/config/integration/hooks-integration.js.map +1 -1
  219. package/.claude-flow-novice/dist/src/config/migration/config-migration.js +1 -1
  220. package/.claude-flow-novice/dist/src/config/ruv-swarm-integration.js +1 -1
  221. package/.claude-flow-novice/dist/src/config/utils/zero-config-setup.js +1 -1
  222. package/.claude-flow-novice/dist/src/config/utils/zero-config-setup.js.map +1 -1
  223. package/.claude-flow-novice/dist/src/config/web-portal-config.js +0 -9
  224. package/.claude-flow-novice/dist/src/config/web-portal-config.js.map +1 -1
  225. package/.claude-flow-novice/dist/src/config/zero-config-setup.js +18 -18
  226. package/.claude-flow-novice/dist/src/config/zero-config-setup.js.map +1 -1
  227. package/.claude-flow-novice/dist/src/core/logger.js +33 -10
  228. package/.claude-flow-novice/dist/src/core/logger.js.map +1 -1
  229. package/.claude-flow-novice/dist/src/migration/index.js +1 -1
  230. package/.claude-flow-novice/dist/src/migration/index.js.map +1 -1
  231. package/.claude-flow-novice/dist/src/migration/migration-runner.js +4 -4
  232. package/.claude-flow-novice/dist/src/migration/migration-runner.js.map +1 -1
  233. package/.claude-flow-novice/dist/src/monitoring/agent-health-monitor.js +430 -0
  234. package/.claude-flow-novice/dist/src/monitoring/agent-health-monitor.js.map +1 -0
  235. package/.claude-flow-novice/dist/src/slash-commands/claude-soul.js +248 -365
  236. package/.claude-flow-novice/dist/src/slash-commands/register-all-commands.js +1 -1
  237. package/.claude-flow-novice/dist/src/swarm/claude-code-interface.js +1 -1
  238. package/.claude-flow-novice/dist/src/swarm/claude-flow-executor.js +1 -1
  239. package/.claude-flow-novice/dist/src/swarm/consensus-coordinator.js +471 -0
  240. package/.claude-flow-novice/dist/src/swarm/consensus-coordinator.js.map +1 -0
  241. package/.claude-flow-novice/dist/src/swarm/hive-mind-integration.js +1 -1
  242. package/.claude-flow-novice/dist/src/swarm/large-scale-coordinator.js +543 -0
  243. package/.claude-flow-novice/dist/src/swarm/large-scale-coordinator.js.map +1 -0
  244. package/.claude-flow-novice/dist/src/swarm/optimizations/connection-pool.js +1 -1
  245. package/.claude-flow-novice/dist/src/swarm/optimizations/optimized-executor.js +1 -1
  246. package/.claude-flow-novice/dist/src/swarm/types.js.map +1 -1
  247. package/.claude-flow-novice/dist/src/swarm-fullstack/integrations/communication-bridge.js +709 -0
  248. package/.claude-flow-novice/dist/src/swarm-fullstack/integrations/communication-bridge.js.map +1 -0
  249. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/api-contract-validator.js +612 -0
  250. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/api-contract-validator.js.map +1 -0
  251. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/backend-test-orchestrator.js +679 -0
  252. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/backend-test-orchestrator.js.map +1 -0
  253. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/frontend-test-orchestrator.js +654 -0
  254. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/frontend-test-orchestrator.js.map +1 -0
  255. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/visual-regression.js +402 -0
  256. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/visual-regression.js.map +1 -0
  257. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/convergence-detector.js +459 -0
  258. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/convergence-detector.js.map +1 -0
  259. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/fix-coordinator.js +513 -0
  260. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/fix-coordinator.js.map +1 -0
  261. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/index.js +19 -0
  262. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/index.js.map +1 -0
  263. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/iterative-build-test.js +568 -0
  264. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/iterative-build-test.js.map +1 -0
  265. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/regression-test-manager.js +418 -0
  266. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/regression-test-manager.js.map +1 -0
  267. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/test-result-analyzer.js +530 -0
  268. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/test-result-analyzer.js.map +1 -0
  269. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/workflow-metrics.js +250 -0
  270. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/workflow-metrics.js.map +1 -0
  271. package/.claude-flow-novice/dist/src/task/index.js +7 -7
  272. package/.claude-flow-novice/dist/src/validation/fullstack-integration-validator.js +420 -0
  273. package/.claude-flow-novice/dist/src/validation/fullstack-integration-validator.js.map +1 -0
  274. package/.claude-flow-novice/dist/src/validation/production-validator.js +1435 -0
  275. package/.claude-flow-novice/dist/src/validation/production-validator.js.map +1 -0
  276. package/.claude-flow-novice/dist/src/verification/cli-integration.js +3 -3
  277. package/.claude-flow-novice/dist/src/verification/hooks.js +1 -1
  278. package/CHANGELOG.md +13 -0
  279. package/CLAUDE.md +1029 -68
  280. package/README.md +0 -1
  281. package/config/build/babel.config.cjs +19 -11
  282. package/config/typescript/tsconfig.json +1 -1
  283. package/examples/claude-api-error-handling.ts +2 -2
  284. package/examples/frontend-testing-demo.ts +470 -0
  285. package/examples/litellm/config/config.yaml +1 -1
  286. package/package.json +13 -7
  287. package/scripts/build/unified-builder.sh +6 -6
  288. package/scripts/build/validate-agents.js +238 -0
  289. package/scripts/run-production-validation.ts +590 -0
  290. package/scripts/test/test-coordination-features.ts +2 -2
  291. package/scripts/validate-stage3-performance.ts +377 -0
  292. package/src/cli/simple-commands/hooks.js +1 -0
  293. package/src/cli/simple-commands/init/agent-copier.js +0 -2
  294. package/src/cli/simple-commands/init/index.js +5 -97
  295. package/src/cli/simple-commands/init/templates/CLAUDE.md +162 -1158
  296. package/src/cli/simple-commands/init/templates/claude-md.js +38 -157
  297. package/src/swarm-fullstack/integrations/communication-bridge.ts +931 -0
  298. package/src/swarm-fullstack/testing/api-contract-validator.ts +909 -0
  299. package/src/swarm-fullstack/testing/backend-test-orchestrator.ts +791 -0
  300. package/src/swarm-fullstack/testing/frontend-test-orchestrator.ts +853 -0
  301. package/src/swarm-fullstack/testing/visual-regression.ts +507 -0
  302. package/src/swarm-fullstack/workflows/convergence-detector.ts +736 -0
  303. package/src/swarm-fullstack/workflows/fix-coordinator.ts +677 -0
  304. package/src/swarm-fullstack/workflows/index.ts +75 -0
  305. package/src/swarm-fullstack/workflows/iterative-build-test.ts +829 -0
  306. package/src/swarm-fullstack/workflows/regression-test-manager.ts +590 -0
  307. package/src/swarm-fullstack/workflows/test-result-analyzer.ts +739 -0
  308. package/src/swarm-fullstack/workflows/workflow-metrics.ts +399 -0
  309. package/wiki/command-reference/README.md +1 -2
  310. package/wiki/command-reference/mcp-tools/README.md +1 -1
  311. package/wiki/getting-started/claude-code-mcp/README.md +1 -2
  312. package/wiki/getting-started/installation/README.md +2 -10
  313. package/.claude/commands/flow-nexus/app-store.md +0 -124
  314. package/.claude/commands/flow-nexus/challenges.md +0 -120
  315. package/.claude/commands/flow-nexus/login-registration.md +0 -65
  316. package/.claude/commands/flow-nexus/neural-network.md +0 -134
  317. package/.claude/commands/flow-nexus/payments.md +0 -116
  318. package/.claude/commands/flow-nexus/sandbox.md +0 -83
  319. package/.claude/commands/flow-nexus/swarm.md +0 -87
  320. package/.claude/commands/flow-nexus/user-tools.md +0 -152
  321. package/.claude/commands/flow-nexus/workflow.md +0 -115
  322. package/.claude-flow-novice/dist/cli/index.js +0 -45
  323. package/.claude-flow-novice/dist/core/index.js +0 -22
  324. package/.claude-flow-novice/dist/mcp/mcp-server-novice.js +0 -595
  325. package/.claude-flow-novice/dist/mcp/mcp-server-sdk.js +0 -649
  326. package/.claude-flow-novice/dist/mcp/mcp-server-with-slash-commands.js +0 -776
  327. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/claude-md.js +0 -1101
  328. package/src/cli/simple-commands/init/templates/CLAUDE.md.optimized +0 -265
  329. /package/{.claude → .claude-flow-novice/.claude}/agents/README.md +0 -0
  330. /package/{.claude → .claude-flow-novice/.claude}/agents/backend-dev.json +0 -0
  331. /package/{.claude → .claude-flow-novice/.claude}/agents/code-analyzer.json +0 -0
  332. /package/{.claude → .claude-flow-novice/.claude}/agents/coder.json +0 -0
  333. /package/{.claude → .claude-flow-novice/.claude}/agents/consensus/README.md +0 -0
  334. /package/{.claude → .claude-flow-novice/.claude}/agents/core/coder.md +0 -0
  335. /package/{.claude → .claude-flow-novice/.claude}/agents/core/planner.md +0 -0
  336. /package/{.claude → .claude-flow-novice/.claude}/agents/core/researcher.md +0 -0
  337. /package/{.claude → .claude-flow-novice/.claude}/agents/core/reviewer.md +0 -0
  338. /package/{.claude → .claude-flow-novice/.claude}/agents/core/tester.md +0 -0
  339. /package/{.claude → .claude-flow-novice/.claude}/agents/optimization/README.md +0 -0
  340. /package/{.claude → .claude-flow-novice/.claude}/agents/planner.json +0 -0
  341. /package/{.claude → .claude-flow-novice/.claude}/agents/researcher.json +0 -0
  342. /package/{.claude → .claude-flow-novice/.claude}/agents/reviewer.json +0 -0
  343. /package/{.claude → .claude-flow-novice/.claude}/agents/swarm/README.md +0 -0
  344. /package/{.claude → .claude-flow-novice/.claude}/agents/system-architect.json +0 -0
  345. /package/{.claude → .claude-flow-novice/.claude}/agents/tester.json +0 -0
@@ -0,0 +1,853 @@
1
+ /**
2
+ * Frontend Test Orchestrator
3
+ * Comprehensive testing system for fullstack swarm frontend components
4
+ * Integrates Jest, React Testing Library, Playwright, and Visual Regression
5
+ */
6
+
7
+ import { EventEmitter } from 'events';
8
+ import { ILogger } from '../../core/logger.js';
9
+ import { FullStackAgentMessage } from '../types/index.js';
10
+
11
+ export interface TestConfiguration {
12
+ unit: {
13
+ enabled: boolean;
14
+ framework: 'jest' | 'vitest';
15
+ timeout: number;
16
+ coverage: {
17
+ enabled: boolean;
18
+ threshold: {
19
+ statements: number;
20
+ branches: number;
21
+ functions: number;
22
+ lines: number;
23
+ };
24
+ };
25
+ };
26
+ integration: {
27
+ enabled: boolean;
28
+ timeout: number;
29
+ mockStrategy: 'full' | 'partial' | 'none';
30
+ };
31
+ e2e: {
32
+ enabled: boolean;
33
+ framework: 'playwright';
34
+ browsers: ('chromium' | 'firefox' | 'webkit')[];
35
+ headless: boolean;
36
+ timeout: number;
37
+ retries: number;
38
+ };
39
+ visualRegression: {
40
+ enabled: boolean;
41
+ threshold: number; // 0-1 similarity threshold
42
+ updateBaselines: boolean;
43
+ };
44
+ accessibility: {
45
+ enabled: boolean;
46
+ standards: ('wcag2a' | 'wcag2aa' | 'wcag2aaa' | 'wcag21aa')[];
47
+ autoFix: boolean;
48
+ };
49
+ performance: {
50
+ enabled: boolean;
51
+ metrics: ('lcp' | 'fid' | 'cls' | 'ttfb' | 'fcp')[];
52
+ thresholds: Record<string, number>;
53
+ };
54
+ }
55
+
56
+ export interface TestSuite {
57
+ id: string;
58
+ name: string;
59
+ type: 'unit' | 'integration' | 'e2e' | 'visual' | 'accessibility' | 'performance';
60
+ files: string[];
61
+ dependencies: string[];
62
+ priority: number;
63
+ estimatedDuration: number;
64
+ tags: string[];
65
+ }
66
+
67
+ export interface TestResult {
68
+ suiteId: string;
69
+ suiteName: string;
70
+ type: string;
71
+ status: 'passed' | 'failed' | 'skipped' | 'error';
72
+ duration: number;
73
+ timestamp: string;
74
+ tests: {
75
+ total: number;
76
+ passed: number;
77
+ failed: number;
78
+ skipped: number;
79
+ };
80
+ coverage?: {
81
+ statements: number;
82
+ branches: number;
83
+ functions: number;
84
+ lines: number;
85
+ };
86
+ failures?: TestFailure[];
87
+ performance?: PerformanceMetrics;
88
+ accessibility?: AccessibilityReport;
89
+ visualDiff?: VisualDiffReport;
90
+ }
91
+
92
+ export interface TestFailure {
93
+ testName: string;
94
+ error: string;
95
+ stack: string;
96
+ expected?: any;
97
+ actual?: any;
98
+ diff?: string;
99
+ }
100
+
101
+ export interface PerformanceMetrics {
102
+ lcp?: number; // Largest Contentful Paint
103
+ fid?: number; // First Input Delay
104
+ cls?: number; // Cumulative Layout Shift
105
+ ttfb?: number; // Time to First Byte
106
+ fcp?: number; // First Contentful Paint
107
+ tti?: number; // Time to Interactive
108
+ }
109
+
110
+ export interface AccessibilityReport {
111
+ violations: AccessibilityViolation[];
112
+ passes: number;
113
+ incomplete: number;
114
+ inapplicable: number;
115
+ score: number; // 0-100
116
+ }
117
+
118
+ export interface AccessibilityViolation {
119
+ id: string;
120
+ impact: 'minor' | 'moderate' | 'serious' | 'critical';
121
+ description: string;
122
+ help: string;
123
+ helpUrl: string;
124
+ nodes: Array<{
125
+ html: string;
126
+ target: string[];
127
+ failureSummary: string;
128
+ }>;
129
+ }
130
+
131
+ export interface VisualDiffReport {
132
+ baseline: string;
133
+ current: string;
134
+ diff: string;
135
+ similarity: number; // 0-1
136
+ diffPixels: number;
137
+ totalPixels: number;
138
+ passed: boolean;
139
+ }
140
+
141
+ export interface TestExecutionPlan {
142
+ swarmId: string;
143
+ feature: string;
144
+ suites: TestSuite[];
145
+ parallelization: {
146
+ enabled: boolean;
147
+ maxConcurrent: number;
148
+ };
149
+ retryPolicy: {
150
+ enabled: boolean;
151
+ maxRetries: number;
152
+ retryDelay: number;
153
+ };
154
+ reportingChannels: string[];
155
+ }
156
+
157
+ export class FrontendTestOrchestrator extends EventEmitter {
158
+ private config: TestConfiguration;
159
+ private activeSuites = new Map<string, TestSuite>();
160
+ private testResults = new Map<string, TestResult>();
161
+ private executionQueue: TestSuite[] = [];
162
+ private running = false;
163
+
164
+ constructor(
165
+ config: Partial<TestConfiguration>,
166
+ private logger: ILogger,
167
+ ) {
168
+ super();
169
+
170
+ this.config = {
171
+ unit: {
172
+ enabled: true,
173
+ framework: 'jest',
174
+ timeout: 30000,
175
+ coverage: {
176
+ enabled: true,
177
+ threshold: {
178
+ statements: 80,
179
+ branches: 75,
180
+ functions: 80,
181
+ lines: 80,
182
+ },
183
+ },
184
+ },
185
+ integration: {
186
+ enabled: true,
187
+ timeout: 60000,
188
+ mockStrategy: 'partial',
189
+ },
190
+ e2e: {
191
+ enabled: true,
192
+ framework: 'playwright',
193
+ browsers: ['chromium'],
194
+ headless: true,
195
+ timeout: 120000,
196
+ retries: 2,
197
+ },
198
+ visualRegression: {
199
+ enabled: true,
200
+ threshold: 0.99,
201
+ updateBaselines: false,
202
+ },
203
+ accessibility: {
204
+ enabled: true,
205
+ standards: ['wcag2aa'],
206
+ autoFix: false,
207
+ },
208
+ performance: {
209
+ enabled: true,
210
+ metrics: ['lcp', 'fid', 'cls', 'ttfb', 'fcp'],
211
+ thresholds: {
212
+ lcp: 2500,
213
+ fid: 100,
214
+ cls: 0.1,
215
+ ttfb: 600,
216
+ fcp: 1800,
217
+ },
218
+ },
219
+ ...config,
220
+ };
221
+
222
+ this.logger.info('Frontend Test Orchestrator initialized', {
223
+ config: this.config,
224
+ });
225
+ }
226
+
227
+ /**
228
+ * Execute complete test plan for a swarm
229
+ */
230
+ async executeTestPlan(plan: TestExecutionPlan): Promise<Map<string, TestResult>> {
231
+ try {
232
+ this.logger.info('Starting test execution plan', {
233
+ swarmId: plan.swarmId,
234
+ feature: plan.feature,
235
+ totalSuites: plan.suites.length,
236
+ });
237
+
238
+ this.emit('test-plan-started', { plan });
239
+
240
+ // Prioritize and queue test suites
241
+ const prioritizedSuites = this.prioritizeSuites(plan.suites);
242
+ this.executionQueue = prioritizedSuites;
243
+
244
+ // Execute tests based on parallelization strategy
245
+ const results = plan.parallelization.enabled
246
+ ? await this.executeParallel(prioritizedSuites, plan)
247
+ : await this.executeSequential(prioritizedSuites, plan);
248
+
249
+ this.emit('test-plan-completed', {
250
+ swarmId: plan.swarmId,
251
+ results,
252
+ summary: this.generateSummary(results),
253
+ });
254
+
255
+ // Broadcast results to reporting channels
256
+ await this.broadcastResults(plan, results);
257
+
258
+ return results;
259
+ } catch (error) {
260
+ this.logger.error('Test plan execution failed', { error, plan });
261
+ throw error;
262
+ }
263
+ }
264
+
265
+ /**
266
+ * Execute unit tests
267
+ */
268
+ async executeUnitTests(suite: TestSuite): Promise<TestResult> {
269
+ if (!this.config.unit.enabled) {
270
+ return this.createSkippedResult(suite, 'Unit tests disabled');
271
+ }
272
+
273
+ this.logger.info('Executing unit tests', { suite: suite.name });
274
+ const startTime = Date.now();
275
+
276
+ try {
277
+ // Execute Jest tests with RTL
278
+ const result = await this.runJestTests({
279
+ testFiles: suite.files,
280
+ coverage: this.config.unit.coverage.enabled,
281
+ timeout: this.config.unit.timeout,
282
+ });
283
+
284
+ const testResult: TestResult = {
285
+ suiteId: suite.id,
286
+ suiteName: suite.name,
287
+ type: 'unit',
288
+ status: result.success ? 'passed' : 'failed',
289
+ duration: Date.now() - startTime,
290
+ timestamp: new Date().toISOString(),
291
+ tests: {
292
+ total: result.numTotalTests,
293
+ passed: result.numPassedTests,
294
+ failed: result.numFailedTests,
295
+ skipped: result.numPendingTests,
296
+ },
297
+ coverage: result.coverage,
298
+ failures: result.testResults
299
+ ?.filter((t: any) => t.status === 'failed')
300
+ .map((t: any) => ({
301
+ testName: t.fullName,
302
+ error: t.failureMessages[0] || 'Unknown error',
303
+ stack: t.failureMessages.join('\n'),
304
+ })),
305
+ };
306
+
307
+ this.testResults.set(suite.id, testResult);
308
+ this.emit('unit-tests-completed', { suite, result: testResult });
309
+
310
+ return testResult;
311
+ } catch (error) {
312
+ this.logger.error('Unit test execution failed', { error, suite });
313
+ return this.createErrorResult(suite, error);
314
+ }
315
+ }
316
+
317
+ /**
318
+ * Execute integration tests
319
+ */
320
+ async executeIntegrationTests(suite: TestSuite): Promise<TestResult> {
321
+ if (!this.config.integration.enabled) {
322
+ return this.createSkippedResult(suite, 'Integration tests disabled');
323
+ }
324
+
325
+ this.logger.info('Executing integration tests', { suite: suite.name });
326
+ const startTime = Date.now();
327
+
328
+ try {
329
+ // Setup test environment with mocking strategy
330
+ await this.setupIntegrationEnvironment(this.config.integration.mockStrategy);
331
+
332
+ // Execute integration test suite
333
+ const result = await this.runJestTests({
334
+ testFiles: suite.files,
335
+ coverage: false,
336
+ timeout: this.config.integration.timeout,
337
+ testEnvironment: 'jsdom',
338
+ });
339
+
340
+ const testResult: TestResult = {
341
+ suiteId: suite.id,
342
+ suiteName: suite.name,
343
+ type: 'integration',
344
+ status: result.success ? 'passed' : 'failed',
345
+ duration: Date.now() - startTime,
346
+ timestamp: new Date().toISOString(),
347
+ tests: {
348
+ total: result.numTotalTests,
349
+ passed: result.numPassedTests,
350
+ failed: result.numFailedTests,
351
+ skipped: result.numPendingTests,
352
+ },
353
+ failures: result.testResults
354
+ ?.filter((t: any) => t.status === 'failed')
355
+ .map((t: any) => ({
356
+ testName: t.fullName,
357
+ error: t.failureMessages[0] || 'Unknown error',
358
+ stack: t.failureMessages.join('\n'),
359
+ })),
360
+ };
361
+
362
+ this.testResults.set(suite.id, testResult);
363
+ this.emit('integration-tests-completed', { suite, result: testResult });
364
+
365
+ return testResult;
366
+ } catch (error) {
367
+ this.logger.error('Integration test execution failed', { error, suite });
368
+ return this.createErrorResult(suite, error);
369
+ } finally {
370
+ await this.teardownIntegrationEnvironment();
371
+ }
372
+ }
373
+
374
+ /**
375
+ * Execute E2E tests with Playwright
376
+ */
377
+ async executeE2ETests(suite: TestSuite): Promise<TestResult> {
378
+ if (!this.config.e2e.enabled) {
379
+ return this.createSkippedResult(suite, 'E2E tests disabled');
380
+ }
381
+
382
+ this.logger.info('Executing E2E tests', { suite: suite.name });
383
+ const startTime = Date.now();
384
+
385
+ try {
386
+ const results = await Promise.all(
387
+ this.config.e2e.browsers.map(async (browser) => {
388
+ return await this.runPlaywrightTests({
389
+ testFiles: suite.files,
390
+ browser,
391
+ headless: this.config.e2e.headless,
392
+ timeout: this.config.e2e.timeout,
393
+ retries: this.config.e2e.retries,
394
+ });
395
+ }),
396
+ );
397
+
398
+ // Aggregate results from all browsers
399
+ const aggregated = this.aggregateBrowserResults(results);
400
+
401
+ const testResult: TestResult = {
402
+ suiteId: suite.id,
403
+ suiteName: suite.name,
404
+ type: 'e2e',
405
+ status: aggregated.allPassed ? 'passed' : 'failed',
406
+ duration: Date.now() - startTime,
407
+ timestamp: new Date().toISOString(),
408
+ tests: aggregated.tests,
409
+ failures: aggregated.failures,
410
+ };
411
+
412
+ this.testResults.set(suite.id, testResult);
413
+ this.emit('e2e-tests-completed', { suite, result: testResult });
414
+
415
+ return testResult;
416
+ } catch (error) {
417
+ this.logger.error('E2E test execution failed', { error, suite });
418
+ return this.createErrorResult(suite, error);
419
+ }
420
+ }
421
+
422
+ /**
423
+ * Execute visual regression tests
424
+ */
425
+ async executeVisualRegressionTests(suite: TestSuite): Promise<TestResult> {
426
+ if (!this.config.visualRegression.enabled) {
427
+ return this.createSkippedResult(suite, 'Visual regression tests disabled');
428
+ }
429
+
430
+ this.logger.info('Executing visual regression tests', { suite: suite.name });
431
+ const startTime = Date.now();
432
+
433
+ try {
434
+ const screenshots = await this.captureScreenshots(suite);
435
+ const comparisons = await this.compareWithBaselines(screenshots);
436
+
437
+ const failures = comparisons.filter((c) => !c.passed);
438
+ const status = failures.length === 0 ? 'passed' : 'failed';
439
+
440
+ const testResult: TestResult = {
441
+ suiteId: suite.id,
442
+ suiteName: suite.name,
443
+ type: 'visual',
444
+ status,
445
+ duration: Date.now() - startTime,
446
+ timestamp: new Date().toISOString(),
447
+ tests: {
448
+ total: comparisons.length,
449
+ passed: comparisons.filter((c) => c.passed).length,
450
+ failed: failures.length,
451
+ skipped: 0,
452
+ },
453
+ failures: failures.map((f) => ({
454
+ testName: f.baseline,
455
+ error: `Visual difference detected: ${(1 - f.similarity) * 100}% different`,
456
+ stack: `Baseline: ${f.baseline}\nCurrent: ${f.current}\nDiff: ${f.diff}`,
457
+ })),
458
+ };
459
+
460
+ this.testResults.set(suite.id, testResult);
461
+ this.emit('visual-regression-tests-completed', { suite, result: testResult });
462
+
463
+ return testResult;
464
+ } catch (error) {
465
+ this.logger.error('Visual regression test execution failed', { error, suite });
466
+ return this.createErrorResult(suite, error);
467
+ }
468
+ }
469
+
470
+ /**
471
+ * Execute accessibility tests
472
+ */
473
+ async executeAccessibilityTests(suite: TestSuite): Promise<TestResult> {
474
+ if (!this.config.accessibility.enabled) {
475
+ return this.createSkippedResult(suite, 'Accessibility tests disabled');
476
+ }
477
+
478
+ this.logger.info('Executing accessibility tests', { suite: suite.name });
479
+ const startTime = Date.now();
480
+
481
+ try {
482
+ const report = await this.runAccessibilityAudit({
483
+ urls: suite.files,
484
+ standards: this.config.accessibility.standards,
485
+ });
486
+
487
+ const status = report.violations.length === 0 ? 'passed' : 'failed';
488
+
489
+ const testResult: TestResult = {
490
+ suiteId: suite.id,
491
+ suiteName: suite.name,
492
+ type: 'accessibility',
493
+ status,
494
+ duration: Date.now() - startTime,
495
+ timestamp: new Date().toISOString(),
496
+ tests: {
497
+ total: report.passes + report.violations.length,
498
+ passed: report.passes,
499
+ failed: report.violations.length,
500
+ skipped: report.incomplete,
501
+ },
502
+ accessibility: report,
503
+ failures: report.violations.map((v) => ({
504
+ testName: v.id,
505
+ error: v.description,
506
+ stack: `Impact: ${v.impact}\nHelp: ${v.help}\nURL: ${v.helpUrl}`,
507
+ })),
508
+ };
509
+
510
+ this.testResults.set(suite.id, testResult);
511
+ this.emit('accessibility-tests-completed', { suite, result: testResult });
512
+
513
+ return testResult;
514
+ } catch (error) {
515
+ this.logger.error('Accessibility test execution failed', { error, suite });
516
+ return this.createErrorResult(suite, error);
517
+ }
518
+ }
519
+
520
+ /**
521
+ * Get real-time test progress
522
+ */
523
+ getTestProgress(): {
524
+ total: number;
525
+ completed: number;
526
+ running: number;
527
+ queued: number;
528
+ status: 'idle' | 'running' | 'completed';
529
+ } {
530
+ const completed = this.testResults.size;
531
+ const running = this.activeSuites.size;
532
+ const queued = this.executionQueue.length;
533
+ const total = completed + running + queued;
534
+
535
+ return {
536
+ total,
537
+ completed,
538
+ running,
539
+ queued,
540
+ status: this.running ? 'running' : completed === total ? 'completed' : 'idle',
541
+ };
542
+ }
543
+
544
+ /**
545
+ * Get aggregated test results
546
+ */
547
+ getTestSummary(): {
548
+ totalSuites: number;
549
+ passed: number;
550
+ failed: number;
551
+ skipped: number;
552
+ coverage?: {
553
+ statements: number;
554
+ branches: number;
555
+ functions: number;
556
+ lines: number;
557
+ };
558
+ duration: number;
559
+ } {
560
+ const results = Array.from(this.testResults.values());
561
+
562
+ return {
563
+ totalSuites: results.length,
564
+ passed: results.filter((r) => r.status === 'passed').length,
565
+ failed: results.filter((r) => r.status === 'failed').length,
566
+ skipped: results.filter((r) => r.status === 'skipped').length,
567
+ coverage: this.aggregateCoverage(results),
568
+ duration: results.reduce((sum, r) => sum + r.duration, 0),
569
+ };
570
+ }
571
+
572
+ // Private helper methods
573
+
574
+ private prioritizeSuites(suites: TestSuite[]): TestSuite[] {
575
+ return suites.sort((a, b) => {
576
+ // Prioritize by: priority > type (unit > integration > e2e) > dependencies
577
+ if (a.priority !== b.priority) return b.priority - a.priority;
578
+
579
+ const typeOrder = { unit: 0, integration: 1, e2e: 2, visual: 3, accessibility: 3, performance: 4 };
580
+ const aOrder = typeOrder[a.type] || 5;
581
+ const bOrder = typeOrder[b.type] || 5;
582
+
583
+ if (aOrder !== bOrder) return aOrder - bOrder;
584
+
585
+ return a.dependencies.length - b.dependencies.length;
586
+ });
587
+ }
588
+
589
+ private async executeParallel(
590
+ suites: TestSuite[],
591
+ plan: TestExecutionPlan,
592
+ ): Promise<Map<string, TestResult>> {
593
+ const results = new Map<string, TestResult>();
594
+ const maxConcurrent = plan.parallelization.maxConcurrent;
595
+ const batches = this.createBatches(suites, maxConcurrent);
596
+
597
+ for (const batch of batches) {
598
+ const batchResults = await Promise.all(
599
+ batch.map((suite) => this.executeSuite(suite, plan.retryPolicy)),
600
+ );
601
+
602
+ batchResults.forEach((result, index) => {
603
+ results.set(batch[index].id, result);
604
+ });
605
+ }
606
+
607
+ return results;
608
+ }
609
+
610
+ private async executeSequential(
611
+ suites: TestSuite[],
612
+ plan: TestExecutionPlan,
613
+ ): Promise<Map<string, TestResult>> {
614
+ const results = new Map<string, TestResult>();
615
+
616
+ for (const suite of suites) {
617
+ const result = await this.executeSuite(suite, plan.retryPolicy);
618
+ results.set(suite.id, result);
619
+ }
620
+
621
+ return results;
622
+ }
623
+
624
+ private async executeSuite(
625
+ suite: TestSuite,
626
+ retryPolicy: { enabled: boolean; maxRetries: number; retryDelay: number },
627
+ ): Promise<TestResult> {
628
+ this.activeSuites.set(suite.id, suite);
629
+
630
+ let attempts = 0;
631
+ let lastError: any;
632
+
633
+ while (attempts <= (retryPolicy.enabled ? retryPolicy.maxRetries : 0)) {
634
+ try {
635
+ let result: TestResult;
636
+
637
+ switch (suite.type) {
638
+ case 'unit':
639
+ result = await this.executeUnitTests(suite);
640
+ break;
641
+ case 'integration':
642
+ result = await this.executeIntegrationTests(suite);
643
+ break;
644
+ case 'e2e':
645
+ result = await this.executeE2ETests(suite);
646
+ break;
647
+ case 'visual':
648
+ result = await this.executeVisualRegressionTests(suite);
649
+ break;
650
+ case 'accessibility':
651
+ result = await this.executeAccessibilityTests(suite);
652
+ break;
653
+ default:
654
+ throw new Error(`Unknown suite type: ${suite.type}`);
655
+ }
656
+
657
+ this.activeSuites.delete(suite.id);
658
+ return result;
659
+ } catch (error) {
660
+ lastError = error;
661
+ attempts++;
662
+
663
+ if (attempts <= retryPolicy.maxRetries) {
664
+ this.logger.warn('Test suite failed, retrying', {
665
+ suite: suite.name,
666
+ attempt: attempts,
667
+ maxRetries: retryPolicy.maxRetries,
668
+ });
669
+ await this.sleep(retryPolicy.retryDelay);
670
+ }
671
+ }
672
+ }
673
+
674
+ this.activeSuites.delete(suite.id);
675
+ return this.createErrorResult(suite, lastError);
676
+ }
677
+
678
+ private createBatches<T>(items: T[], batchSize: number): T[][] {
679
+ const batches: T[][] = [];
680
+ for (let i = 0; i < items.length; i += batchSize) {
681
+ batches.push(items.slice(i, i + batchSize));
682
+ }
683
+ return batches;
684
+ }
685
+
686
+ private createSkippedResult(suite: TestSuite, reason: string): TestResult {
687
+ return {
688
+ suiteId: suite.id,
689
+ suiteName: suite.name,
690
+ type: suite.type,
691
+ status: 'skipped',
692
+ duration: 0,
693
+ timestamp: new Date().toISOString(),
694
+ tests: { total: 0, passed: 0, failed: 0, skipped: 0 },
695
+ failures: [{ testName: 'Suite Skipped', error: reason, stack: '' }],
696
+ };
697
+ }
698
+
699
+ private createErrorResult(suite: TestSuite, error: any): TestResult {
700
+ return {
701
+ suiteId: suite.id,
702
+ suiteName: suite.name,
703
+ type: suite.type,
704
+ status: 'error',
705
+ duration: 0,
706
+ timestamp: new Date().toISOString(),
707
+ tests: { total: 0, passed: 0, failed: 1, skipped: 0 },
708
+ failures: [
709
+ {
710
+ testName: 'Suite Execution',
711
+ error: error.message || 'Unknown error',
712
+ stack: error.stack || '',
713
+ },
714
+ ],
715
+ };
716
+ }
717
+
718
+ private aggregateCoverage(results: TestResult[]): {
719
+ statements: number;
720
+ branches: number;
721
+ functions: number;
722
+ lines: number;
723
+ } | undefined {
724
+ const coverageResults = results.filter((r) => r.coverage);
725
+ if (coverageResults.length === 0) return undefined;
726
+
727
+ const total = coverageResults.length;
728
+ return {
729
+ statements: coverageResults.reduce((sum, r) => sum + (r.coverage?.statements || 0), 0) / total,
730
+ branches: coverageResults.reduce((sum, r) => sum + (r.coverage?.branches || 0), 0) / total,
731
+ functions: coverageResults.reduce((sum, r) => sum + (r.coverage?.functions || 0), 0) / total,
732
+ lines: coverageResults.reduce((sum, r) => sum + (r.coverage?.lines || 0), 0) / total,
733
+ };
734
+ }
735
+
736
+ private generateSummary(results: Map<string, TestResult>): any {
737
+ const values = Array.from(results.values());
738
+ return {
739
+ total: values.length,
740
+ passed: values.filter((r) => r.status === 'passed').length,
741
+ failed: values.filter((r) => r.status === 'failed').length,
742
+ skipped: values.filter((r) => r.status === 'skipped').length,
743
+ duration: values.reduce((sum, r) => sum + r.duration, 0),
744
+ };
745
+ }
746
+
747
+ private async broadcastResults(
748
+ plan: TestExecutionPlan,
749
+ results: Map<string, TestResult>,
750
+ ): Promise<void> {
751
+ const summary = this.generateSummary(results);
752
+
753
+ const message: FullStackAgentMessage = {
754
+ id: `test-results-${Date.now()}`,
755
+ swarmId: plan.swarmId,
756
+ agentId: 'frontend-test-orchestrator',
757
+ agentType: 'qa-engineer',
758
+ messageType: 'test-result',
759
+ content: JSON.stringify({ feature: plan.feature, summary, results: Array.from(results.values()) }),
760
+ timestamp: new Date().toISOString(),
761
+ priority: 'high',
762
+ layer: 'testing',
763
+ };
764
+
765
+ this.emit('test-results-ready', message);
766
+ }
767
+
768
+ // Placeholder methods for actual test execution (would integrate with real frameworks)
769
+
770
+ private async runJestTests(options: any): Promise<any> {
771
+ // Integration point for Jest
772
+ this.logger.info('Running Jest tests', options);
773
+ return {
774
+ success: true,
775
+ numTotalTests: 10,
776
+ numPassedTests: 9,
777
+ numFailedTests: 1,
778
+ numPendingTests: 0,
779
+ coverage: {
780
+ statements: 85,
781
+ branches: 80,
782
+ functions: 90,
783
+ lines: 85,
784
+ },
785
+ testResults: [],
786
+ };
787
+ }
788
+
789
+ private async runPlaywrightTests(options: any): Promise<any> {
790
+ // Integration point for Playwright
791
+ this.logger.info('Running Playwright tests', options);
792
+ return {
793
+ browser: options.browser,
794
+ success: true,
795
+ tests: { total: 5, passed: 5, failed: 0, skipped: 0 },
796
+ failures: [],
797
+ };
798
+ }
799
+
800
+ private aggregateBrowserResults(results: any[]): any {
801
+ return {
802
+ allPassed: results.every((r) => r.success),
803
+ tests: {
804
+ total: results.reduce((sum, r) => sum + r.tests.total, 0),
805
+ passed: results.reduce((sum, r) => sum + r.tests.passed, 0),
806
+ failed: results.reduce((sum, r) => sum + r.tests.failed, 0),
807
+ skipped: results.reduce((sum, r) => sum + r.tests.skipped, 0),
808
+ },
809
+ failures: results.flatMap((r) => r.failures),
810
+ };
811
+ }
812
+
813
+ private async setupIntegrationEnvironment(strategy: string): Promise<void> {
814
+ this.logger.info('Setting up integration environment', { strategy });
815
+ }
816
+
817
+ private async teardownIntegrationEnvironment(): Promise<void> {
818
+ this.logger.info('Tearing down integration environment');
819
+ }
820
+
821
+ private async captureScreenshots(suite: TestSuite): Promise<string[]> {
822
+ this.logger.info('Capturing screenshots', { suite: suite.name });
823
+ return suite.files.map((f) => `screenshots/${f}.png`);
824
+ }
825
+
826
+ private async compareWithBaselines(screenshots: string[]): Promise<VisualDiffReport[]> {
827
+ this.logger.info('Comparing screenshots with baselines');
828
+ return screenshots.map((s) => ({
829
+ baseline: `baselines/${s}`,
830
+ current: s,
831
+ diff: `diffs/${s}`,
832
+ similarity: 0.99,
833
+ diffPixels: 100,
834
+ totalPixels: 1000000,
835
+ passed: true,
836
+ }));
837
+ }
838
+
839
+ private async runAccessibilityAudit(options: any): Promise<AccessibilityReport> {
840
+ this.logger.info('Running accessibility audit', options);
841
+ return {
842
+ violations: [],
843
+ passes: 20,
844
+ incomplete: 0,
845
+ inapplicable: 5,
846
+ score: 100,
847
+ };
848
+ }
849
+
850
+ private sleep(ms: number): Promise<void> {
851
+ return new Promise((resolve) => setTimeout(resolve, ms));
852
+ }
853
+ }