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,543 @@
1
+ /**
2
+ * Large-Scale Coordinator
3
+ * Manages 100+ concurrent agents with hierarchical coordination
4
+ * Implements work-stealing, load balancing, and fault tolerance
5
+ *
6
+ * Performance Targets:
7
+ * - Support: 100+ simultaneous agents
8
+ * - Coordination latency: <10ms
9
+ * - Recovery time: <5 seconds
10
+ */ import { EventEmitter } from 'node:events';
11
+ import { performance } from 'perf_hooks';
12
+ import { Logger } from '../core/logger.js';
13
+ export class LargeScaleCoordinator extends EventEmitter {
14
+ logger;
15
+ config;
16
+ // Hierarchical coordination structure
17
+ coordinationTree = new Map();
18
+ agentToNode = new Map();
19
+ taskAssignments = new Map();
20
+ // Work-stealing queues
21
+ globalWorkQueue = [];
22
+ workStealingActive = false;
23
+ // Load balancing
24
+ loadStats = new Map();
25
+ rebalanceTimer;
26
+ // Fault tolerance
27
+ agentHealth = new Map();
28
+ failedAgents = new Set();
29
+ recoveryQueue = [];
30
+ // Performance metrics
31
+ metrics = {
32
+ totalAgentsManaged: 0,
33
+ activeCoordinationNodes: 0,
34
+ tasksCoordinated: 0,
35
+ workStealingOperations: 0,
36
+ rebalancingOperations: 0,
37
+ agentFailures: 0,
38
+ agentRecoveries: 0,
39
+ avgCoordinationLatency: 0,
40
+ coordinationLatencies: []
41
+ };
42
+ constructor(config = {}){
43
+ super();
44
+ this.config = {
45
+ maxAgentsPerNode: config.maxAgentsPerNode || 10,
46
+ hierarchyDepth: config.hierarchyDepth || 3,
47
+ workStealing: {
48
+ enabled: true,
49
+ thresholdRatio: 2.0,
50
+ minTasksToSteal: 1,
51
+ maxTasksToSteal: 5,
52
+ ...config.workStealing
53
+ },
54
+ loadBalancing: {
55
+ type: 'least-loaded',
56
+ rebalanceInterval: 5000,
57
+ ...config.loadBalancing
58
+ },
59
+ healthCheckInterval: config.healthCheckInterval || 1000,
60
+ recoveryTimeout: config.recoveryTimeout || 5000
61
+ };
62
+ const loggerConfig = process.env.CLAUDE_FLOW_ENV === 'test' ? {
63
+ level: 'error',
64
+ format: 'json',
65
+ destination: 'console'
66
+ } : {
67
+ level: 'info',
68
+ format: 'json',
69
+ destination: 'console'
70
+ };
71
+ this.logger = new Logger(loggerConfig, {
72
+ component: 'LargeScaleCoordinator'
73
+ });
74
+ this.initialize();
75
+ }
76
+ initialize() {
77
+ // Create root coordination node
78
+ const rootNode = {
79
+ id: 'root',
80
+ level: 0,
81
+ agents: new Set(),
82
+ subCoordinators: new Set(),
83
+ workQueue: [],
84
+ capacity: this.config.maxAgentsPerNode,
85
+ load: 0
86
+ };
87
+ this.coordinationTree.set('root', rootNode);
88
+ // Start background processes
89
+ this.startHealthMonitoring();
90
+ this.startLoadBalancing();
91
+ if (this.config.workStealing.enabled) {
92
+ this.startWorkStealing();
93
+ }
94
+ this.logger.info('Large-scale coordinator initialized', {
95
+ maxAgentsPerNode: this.config.maxAgentsPerNode,
96
+ hierarchyDepth: this.config.hierarchyDepth
97
+ });
98
+ }
99
+ /**
100
+ * Register multiple agents in the coordination hierarchy
101
+ */ async registerAgents(agents) {
102
+ const registerStart = performance.now();
103
+ for (const agent of agents){
104
+ await this.registerAgent(agent);
105
+ }
106
+ const registerTime = performance.now() - registerStart;
107
+ this.metrics.totalAgentsManaged = this.agentToNode.size;
108
+ this.logger.info('Agents registered in coordination hierarchy', {
109
+ count: agents.length,
110
+ totalManaged: this.metrics.totalAgentsManaged,
111
+ registerTime: `${registerTime.toFixed(2)}ms`
112
+ });
113
+ this.emit('agents:registered', {
114
+ count: agents.length,
115
+ totalManaged: this.metrics.totalAgentsManaged
116
+ });
117
+ }
118
+ /**
119
+ * Register a single agent in the coordination hierarchy
120
+ */ async registerAgent(agent) {
121
+ // Find the best coordination node for this agent
122
+ const targetNode = this.findBestNode(agent);
123
+ if (!targetNode) {
124
+ // Create new node if needed
125
+ const newNode = await this.createCoordinationNode(agent);
126
+ targetNode = newNode;
127
+ }
128
+ // Register agent to node
129
+ targetNode.agents.add(agent.id);
130
+ this.agentToNode.set(agent.id, targetNode.id);
131
+ // Initialize health tracking
132
+ this.agentHealth.set(agent.id, {
133
+ status: 'healthy',
134
+ lastHeartbeat: Date.now()
135
+ });
136
+ // Initialize load stats
137
+ this.loadStats.set(agent.id, {
138
+ tasks: 0,
139
+ avgLatency: 0,
140
+ lastUpdate: Date.now()
141
+ });
142
+ this.logger.debug('Agent registered', {
143
+ agentId: agent.id,
144
+ nodeId: targetNode.id,
145
+ nodeLevel: targetNode.level
146
+ });
147
+ }
148
+ /**
149
+ * Coordinate task assignment across agents with intelligent load balancing
150
+ */ async coordinateTask(task) {
151
+ const coordStart = performance.now();
152
+ try {
153
+ // Find best agent for this task
154
+ const targetAgentId = await this.selectTargetAgent(task);
155
+ if (!targetAgentId) {
156
+ // No available agent - queue globally
157
+ this.globalWorkQueue.push(task);
158
+ this.logger.warn('No available agent, task queued', {
159
+ taskId: task.id
160
+ });
161
+ return 'queued';
162
+ }
163
+ // Assign task to agent
164
+ this.taskAssignments.set(task.id, targetAgentId);
165
+ // Update load stats
166
+ const loadStat = this.loadStats.get(targetAgentId);
167
+ if (loadStat) {
168
+ loadStat.tasks++;
169
+ loadStat.lastUpdate = Date.now();
170
+ }
171
+ // Update node load
172
+ const nodeId = this.agentToNode.get(targetAgentId);
173
+ if (nodeId) {
174
+ const node = this.coordinationTree.get(nodeId);
175
+ if (node) {
176
+ node.load++;
177
+ }
178
+ }
179
+ // Record metrics
180
+ const coordLatency = performance.now() - coordStart;
181
+ this.metrics.coordinationLatencies.push(coordLatency);
182
+ if (this.metrics.coordinationLatencies.length > 1000) {
183
+ this.metrics.coordinationLatencies = this.metrics.coordinationLatencies.slice(-1000);
184
+ }
185
+ this.metrics.avgCoordinationLatency = this.metrics.coordinationLatencies.reduce((a, b)=>a + b, 0) / this.metrics.coordinationLatencies.length;
186
+ this.metrics.tasksCoordinated++;
187
+ this.logger.debug('Task coordinated', {
188
+ taskId: task.id,
189
+ agentId: targetAgentId,
190
+ coordLatency: `${coordLatency.toFixed(2)}ms`
191
+ });
192
+ this.emit('task:coordinated', {
193
+ taskId: task.id,
194
+ agentId: targetAgentId,
195
+ latency: coordLatency
196
+ });
197
+ return targetAgentId;
198
+ } catch (error) {
199
+ this.logger.error('Task coordination failed', {
200
+ taskId: task.id,
201
+ error: error instanceof Error ? error.message : String(error)
202
+ });
203
+ throw error;
204
+ }
205
+ }
206
+ /**
207
+ * Select the best agent for a task using configured load balancing strategy
208
+ */ async selectTargetAgent(task) {
209
+ const healthyAgents = Array.from(this.agentHealth.entries()).filter(([_, health])=>health.status === 'healthy').map(([agentId])=>agentId);
210
+ if (healthyAgents.length === 0) {
211
+ return null;
212
+ }
213
+ switch(this.config.loadBalancing.type){
214
+ case 'least-loaded':
215
+ return this.selectLeastLoadedAgent(healthyAgents);
216
+ case 'round-robin':
217
+ return this.selectRoundRobinAgent(healthyAgents);
218
+ case 'random':
219
+ return healthyAgents[Math.floor(Math.random() * healthyAgents.length)];
220
+ case 'weighted':
221
+ return this.selectWeightedAgent(healthyAgents, task);
222
+ default:
223
+ return this.selectLeastLoadedAgent(healthyAgents);
224
+ }
225
+ }
226
+ selectLeastLoadedAgent(agents) {
227
+ let minLoad = Infinity;
228
+ let selectedAgent = agents[0];
229
+ for (const agentId of agents){
230
+ const loadStat = this.loadStats.get(agentId);
231
+ if (loadStat && loadStat.tasks < minLoad) {
232
+ minLoad = loadStat.tasks;
233
+ selectedAgent = agentId;
234
+ }
235
+ }
236
+ return selectedAgent;
237
+ }
238
+ selectRoundRobinAgent(agents) {
239
+ const index = this.metrics.tasksCoordinated % agents.length;
240
+ return agents[index];
241
+ }
242
+ selectWeightedAgent(agents, task) {
243
+ // Weight based on task type affinity, load, and latency
244
+ let bestScore = -Infinity;
245
+ let selectedAgent = agents[0];
246
+ for (const agentId of agents){
247
+ const loadStat = this.loadStats.get(agentId);
248
+ if (!loadStat) continue;
249
+ const loadScore = 1 / (loadStat.tasks + 1); // Lower load = higher score
250
+ const latencyScore = loadStat.avgLatency > 0 ? 1000 / loadStat.avgLatency : 1;
251
+ const totalScore = loadScore * 0.7 + latencyScore * 0.3;
252
+ if (totalScore > bestScore) {
253
+ bestScore = totalScore;
254
+ selectedAgent = agentId;
255
+ }
256
+ }
257
+ return selectedAgent;
258
+ }
259
+ /**
260
+ * Find the best coordination node for an agent
261
+ */ findBestNode(agent) {
262
+ let bestNode = null;
263
+ let minLoad = Infinity;
264
+ for (const node of this.coordinationTree.values()){
265
+ // Skip full nodes
266
+ if (node.agents.size >= this.config.maxAgentsPerNode) {
267
+ continue;
268
+ }
269
+ // Find node with lowest load at appropriate level
270
+ if (node.load < minLoad && node.level === this.getTargetLevel(agent)) {
271
+ minLoad = node.load;
272
+ bestNode = node;
273
+ }
274
+ }
275
+ return bestNode;
276
+ }
277
+ getTargetLevel(agent) {
278
+ // Distribute agents across hierarchy levels
279
+ return Math.min(Math.floor(this.metrics.totalAgentsManaged / this.config.maxAgentsPerNode), this.config.hierarchyDepth - 1);
280
+ }
281
+ /**
282
+ * Create a new coordination node in the hierarchy
283
+ */ async createCoordinationNode(agent) {
284
+ const nodeId = `node-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
285
+ const level = this.getTargetLevel(agent);
286
+ const newNode = {
287
+ id: nodeId,
288
+ level,
289
+ agents: new Set(),
290
+ subCoordinators: new Set(),
291
+ workQueue: [],
292
+ capacity: this.config.maxAgentsPerNode,
293
+ load: 0
294
+ };
295
+ this.coordinationTree.set(nodeId, newNode);
296
+ this.metrics.activeCoordinationNodes++;
297
+ // Link to parent coordinator if not root level
298
+ if (level > 0) {
299
+ const parentNode = this.findParentNode(level);
300
+ if (parentNode) {
301
+ parentNode.subCoordinators.add(nodeId);
302
+ }
303
+ }
304
+ this.logger.info('Created new coordination node', {
305
+ nodeId,
306
+ level,
307
+ totalNodes: this.coordinationTree.size
308
+ });
309
+ return newNode;
310
+ }
311
+ findParentNode(childLevel) {
312
+ const parentLevel = childLevel - 1;
313
+ for (const node of this.coordinationTree.values()){
314
+ if (node.level === parentLevel && node.subCoordinators.size < this.config.maxAgentsPerNode) {
315
+ return node;
316
+ }
317
+ }
318
+ return null;
319
+ }
320
+ /**
321
+ * Work-stealing algorithm for dynamic load balancing
322
+ */ startWorkStealing() {
323
+ setInterval(()=>{
324
+ if (this.workStealingActive) return;
325
+ this.workStealingActive = true;
326
+ this.performWorkStealing();
327
+ this.workStealingActive = false;
328
+ }, 500); // Check every 500ms
329
+ }
330
+ performWorkStealing() {
331
+ const nodes = Array.from(this.coordinationTree.values());
332
+ // Find heavily loaded and lightly loaded nodes
333
+ const sortedByLoad = nodes.sort((a, b)=>b.load - a.load);
334
+ const heaviestNode = sortedByLoad[0];
335
+ const lightestNode = sortedByLoad[sortedByLoad.length - 1];
336
+ if (!heaviestNode || !lightestNode) return;
337
+ const loadDifference = heaviestNode.load - lightestNode.load;
338
+ const threshold = lightestNode.load * this.config.workStealing.thresholdRatio;
339
+ if (loadDifference > threshold && heaviestNode.workQueue.length > 0) {
340
+ // Steal tasks from heavy node to light node
341
+ const tasksToSteal = Math.min(Math.max(Math.floor(loadDifference / 2), this.config.workStealing.minTasksToSteal), this.config.workStealing.maxTasksToSteal, heaviestNode.workQueue.length);
342
+ const stolenTasks = heaviestNode.workQueue.splice(0, tasksToSteal);
343
+ lightestNode.workQueue.push(...stolenTasks);
344
+ heaviestNode.load -= tasksToSteal;
345
+ lightestNode.load += tasksToSteal;
346
+ this.metrics.workStealingOperations++;
347
+ this.logger.debug('Work stealing performed', {
348
+ from: heaviestNode.id,
349
+ to: lightestNode.id,
350
+ taskCount: tasksToSteal
351
+ });
352
+ this.emit('work:stolen', {
353
+ from: heaviestNode.id,
354
+ to: lightestNode.id,
355
+ count: tasksToSteal
356
+ });
357
+ }
358
+ }
359
+ /**
360
+ * Periodic load balancing across coordination nodes
361
+ */ startLoadBalancing() {
362
+ const interval = this.config.loadBalancing.rebalanceInterval || 5000;
363
+ this.rebalanceTimer = setInterval(()=>{
364
+ this.performLoadRebalancing();
365
+ }, interval);
366
+ }
367
+ performLoadRebalancing() {
368
+ const nodes = Array.from(this.coordinationTree.values());
369
+ const avgLoad = nodes.reduce((sum, node)=>sum + node.load, 0) / nodes.length;
370
+ let rebalanced = false;
371
+ for (const node of nodes){
372
+ const loadDiff = node.load - avgLoad;
373
+ if (Math.abs(loadDiff) > avgLoad * 0.3) {
374
+ // Significant load imbalance detected
375
+ rebalanced = true;
376
+ if (loadDiff > 0) {
377
+ // Redistribute excess load
378
+ const tasksToRedistribute = Math.floor(Math.abs(loadDiff) / 2);
379
+ // Logic to move tasks to less loaded nodes
380
+ }
381
+ }
382
+ }
383
+ if (rebalanced) {
384
+ this.metrics.rebalancingOperations++;
385
+ this.logger.debug('Load rebalancing performed');
386
+ this.emit('load:rebalanced');
387
+ }
388
+ }
389
+ /**
390
+ * Health monitoring and automatic recovery
391
+ */ startHealthMonitoring() {
392
+ setInterval(()=>{
393
+ this.checkAgentHealth();
394
+ this.processRecoveryQueue();
395
+ }, this.config.healthCheckInterval);
396
+ }
397
+ checkAgentHealth() {
398
+ const now = Date.now();
399
+ const healthTimeout = this.config.healthCheckInterval * 3;
400
+ for (const [agentId, health] of this.agentHealth.entries()){
401
+ const timeSinceHeartbeat = now - health.lastHeartbeat;
402
+ if (timeSinceHeartbeat > healthTimeout) {
403
+ // Agent appears to have failed
404
+ if (health.status !== 'failed') {
405
+ this.handleAgentFailure(agentId);
406
+ }
407
+ } else if (timeSinceHeartbeat > healthTimeout / 2) {
408
+ // Agent is degraded
409
+ if (health.status === 'healthy') {
410
+ health.status = 'degraded';
411
+ this.logger.warn('Agent health degraded', {
412
+ agentId
413
+ });
414
+ this.emit('agent:degraded', agentId);
415
+ }
416
+ }
417
+ }
418
+ }
419
+ handleAgentFailure(agentId) {
420
+ const health = this.agentHealth.get(agentId);
421
+ if (!health) return;
422
+ health.status = 'failed';
423
+ this.failedAgents.add(agentId);
424
+ this.metrics.agentFailures++;
425
+ // Add to recovery queue
426
+ this.recoveryQueue.push({
427
+ agentId,
428
+ failureTime: Date.now()
429
+ });
430
+ // Remove from coordination
431
+ const nodeId = this.agentToNode.get(agentId);
432
+ if (nodeId) {
433
+ const node = this.coordinationTree.get(nodeId);
434
+ if (node) {
435
+ node.agents.delete(agentId);
436
+ }
437
+ }
438
+ this.logger.error('Agent failure detected', {
439
+ agentId
440
+ });
441
+ this.emit('agent:failed', agentId);
442
+ }
443
+ processRecoveryQueue() {
444
+ const now = Date.now();
445
+ const newRecoveryQueue = [];
446
+ for (const recovery of this.recoveryQueue){
447
+ const timeSinceFailure = now - recovery.failureTime;
448
+ if (timeSinceFailure > this.config.recoveryTimeout) {
449
+ // Attempt recovery
450
+ this.attemptAgentRecovery(recovery.agentId);
451
+ } else {
452
+ // Keep in queue
453
+ newRecoveryQueue.push(recovery);
454
+ }
455
+ }
456
+ this.recoveryQueue = newRecoveryQueue;
457
+ }
458
+ attemptAgentRecovery(agentId) {
459
+ // In production, this would trigger actual agent restart/replacement
460
+ this.logger.info('Attempting agent recovery', {
461
+ agentId
462
+ });
463
+ // Simulate recovery success
464
+ this.failedAgents.delete(agentId);
465
+ const health = this.agentHealth.get(agentId);
466
+ if (health) {
467
+ health.status = 'healthy';
468
+ health.lastHeartbeat = Date.now();
469
+ }
470
+ this.metrics.agentRecoveries++;
471
+ this.emit('agent:recovered', agentId);
472
+ }
473
+ /**
474
+ * Update agent heartbeat (called by agents to signal health)
475
+ */ updateHeartbeat(agentId) {
476
+ const health = this.agentHealth.get(agentId);
477
+ if (health) {
478
+ health.lastHeartbeat = Date.now();
479
+ if (health.status !== 'healthy') {
480
+ health.status = 'healthy';
481
+ this.logger.info('Agent recovered to healthy state', {
482
+ agentId
483
+ });
484
+ }
485
+ }
486
+ }
487
+ /**
488
+ * Report task completion for load tracking
489
+ */ reportTaskCompletion(agentId, taskId, executionTime) {
490
+ const loadStat = this.loadStats.get(agentId);
491
+ if (loadStat) {
492
+ loadStat.tasks = Math.max(0, loadStat.tasks - 1);
493
+ loadStat.avgLatency = (loadStat.avgLatency + executionTime) / 2;
494
+ loadStat.lastUpdate = Date.now();
495
+ }
496
+ // Update node load
497
+ const nodeId = this.agentToNode.get(agentId);
498
+ if (nodeId) {
499
+ const node = this.coordinationTree.get(nodeId);
500
+ if (node) {
501
+ node.load = Math.max(0, node.load - 1);
502
+ }
503
+ }
504
+ this.taskAssignments.delete(taskId);
505
+ }
506
+ /**
507
+ * Get comprehensive coordination metrics
508
+ */ getMetrics() {
509
+ return {
510
+ ...this.metrics,
511
+ coordinationNodes: this.coordinationTree.size,
512
+ healthyAgents: Array.from(this.agentHealth.values()).filter((h)=>h.status === 'healthy').length,
513
+ degradedAgents: Array.from(this.agentHealth.values()).filter((h)=>h.status === 'degraded').length,
514
+ failedAgents: this.failedAgents.size,
515
+ pendingRecoveries: this.recoveryQueue.length,
516
+ globalQueueSize: this.globalWorkQueue.length,
517
+ nodeLoadDistribution: this.getNodeLoadDistribution()
518
+ };
519
+ }
520
+ getNodeLoadDistribution() {
521
+ const distribution = {};
522
+ for (const [nodeId, node] of this.coordinationTree.entries()){
523
+ distribution[nodeId] = node.load;
524
+ }
525
+ return distribution;
526
+ }
527
+ /**
528
+ * Shutdown coordinator gracefully
529
+ */ async shutdown() {
530
+ this.logger.info('Shutting down large-scale coordinator');
531
+ if (this.rebalanceTimer) {
532
+ clearInterval(this.rebalanceTimer);
533
+ }
534
+ this.coordinationTree.clear();
535
+ this.agentToNode.clear();
536
+ this.taskAssignments.clear();
537
+ this.agentHealth.clear();
538
+ this.loadStats.clear();
539
+ this.logger.info('Large-scale coordinator shut down');
540
+ }
541
+ }
542
+
543
+ //# sourceMappingURL=large-scale-coordinator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/swarm/large-scale-coordinator.ts"],"names":["EventEmitter","performance","Logger","LargeScaleCoordinator","logger","config","coordinationTree","Map","agentToNode","taskAssignments","globalWorkQueue","workStealingActive","loadStats","rebalanceTimer","agentHealth","failedAgents","Set","recoveryQueue","metrics","totalAgentsManaged","activeCoordinationNodes","tasksCoordinated","workStealingOperations","rebalancingOperations","agentFailures","agentRecoveries","avgCoordinationLatency","coordinationLatencies","maxAgentsPerNode","hierarchyDepth","workStealing","enabled","thresholdRatio","minTasksToSteal","maxTasksToSteal","loadBalancing","type","rebalanceInterval","healthCheckInterval","recoveryTimeout","loggerConfig","process","env","CLAUDE_FLOW_ENV","level","format","destination","component","initialize","rootNode","id","agents","subCoordinators","workQueue","capacity","load","set","startHealthMonitoring","startLoadBalancing","startWorkStealing","info","registerAgents","registerStart","now","agent","registerAgent","registerTime","size","count","length","totalManaged","toFixed","emit","targetNode","findBestNode","newNode","createCoordinationNode","add","status","lastHeartbeat","Date","tasks","avgLatency","lastUpdate","debug","agentId","nodeId","nodeLevel","coordinateTask","task","coordStart","targetAgentId","selectTargetAgent","push","warn","taskId","loadStat","get","node","coordLatency","slice","reduce","a","b","latency","error","Error","message","String","healthyAgents","Array","from","entries","filter","_","health","map","selectLeastLoadedAgent","selectRoundRobinAgent","Math","floor","random","selectWeightedAgent","minLoad","Infinity","selectedAgent","index","bestScore","loadScore","latencyScore","totalScore","bestNode","values","getTargetLevel","min","toString","substr","parentNode","findParentNode","totalNodes","childLevel","parentLevel","setInterval","performWorkStealing","nodes","sortedByLoad","sort","heaviestNode","lightestNode","loadDifference","threshold","tasksToSteal","max","stolenTasks","splice","to","taskCount","interval","performLoadRebalancing","avgLoad","sum","rebalanced","loadDiff","abs","tasksToRedistribute","checkAgentHealth","processRecoveryQueue","healthTimeout","timeSinceHeartbeat","handleAgentFailure","failureTime","delete","newRecoveryQueue","recovery","timeSinceFailure","attemptAgentRecovery","updateHeartbeat","reportTaskCompletion","executionTime","getMetrics","coordinationNodes","h","degradedAgents","pendingRecoveries","globalQueueSize","nodeLoadDistribution","getNodeLoadDistribution","distribution","shutdown","clearInterval","clear"],"mappings":"AAAA;;;;;;;;;CASC,GAED,SAASA,YAAY,QAAQ,cAAc;AAC3C,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASC,MAAM,QAAQ,oBAAoB;AAkC3C,OAAO,MAAMC,8BAA8BH;IACjCI,OAAe;IACfC,OAAyB;IAEjC,sCAAsC;IAC9BC,mBAAmB,IAAIC,MAAgC;IACvDC,cAAc,IAAID,MAAsB;IACxCE,kBAAkB,IAAIF,MAAsB;IAEpD,uBAAuB;IACfG,kBAAoC,EAAE,CAAC;IACvCC,qBAAqB,MAAM;IAEnC,iBAAiB;IACTC,YAAY,IAAIL,MAAyE;IACzFM,eAAgC;IAExC,kBAAkB;IACVC,cAAc,IAAIP,MAAoF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,CAACrG,OAAO,GAAGY,KAAK3C,IAAI;QAClC;QAEA,OAAOoI;IACT;IAEA;;GAEC,GACD,MAAMC,WAA0B;QAC9B,IAAI,CAACxL,MAAM,CAACwD,IAAI,CAAC;QAEjB,IAAI,IAAI,CAAC/C,cAAc,EAAE;YACvBgL,cAAc,IAAI,CAAChL,cAAc;QACnC;QAEA,IAAI,CAACP,gBAAgB,CAACwL,KAAK;QAC3B,IAAI,CAACtL,WAAW,CAACsL,KAAK;QACtB,IAAI,CAACrL,eAAe,CAACqL,KAAK;QAC1B,IAAI,CAAChL,WAAW,CAACgL,KAAK;QACtB,IAAI,CAAClL,SAAS,CAACkL,KAAK;QAEpB,IAAI,CAAC1L,MAAM,CAACwD,IAAI,CAAC;IACnB;AACF"}
@@ -22,7 +22,7 @@ export class ClaudeAPI {
22
22
  text: `Mock response for: ${options.messages?.[0]?.content || 'test'}`
23
23
  }
24
24
  ],
25
- model: options.model || 'claude-3-5-sonnet-20241022',
25
+ model: options.model || 'sonnet',
26
26
  usage: {
27
27
  input_tokens: 10,
28
28
  output_tokens: 20
@@ -97,7 +97,7 @@ export class OptimizedExecutor extends EventEmitter {
97
97
  const executionResult = await this.connectionPool.execute(async (api)=>{
98
98
  const response = await api.complete({
99
99
  messages: this.buildMessages(task),
100
- model: task.metadata?.model || 'claude-3-5-sonnet-20241022',
100
+ model: task.metadata?.model || 'sonnet',
101
101
  max_tokens: task.constraints.maxTokens || 4096,
102
102
  temperature: task.metadata?.temperature || 0.7
103
103
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/swarm/types.ts"],"names":["isAgentId","obj","id","swarmId","isTaskId","isSwarmEvent","type","isTaskDefinition","isAgentState","status","SWARM_CONSTANTS","DEFAULT_TASK_TIMEOUT","DEFAULT_AGENT_TIMEOUT","DEFAULT_HEARTBEAT_INTERVAL","MAX_AGENTS_PER_SWARM","MAX_TASKS_PER_AGENT","MAX_RETRIES","MIN_QUALITY_THRESHOLD","DEFAULT_QUALITY_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C;IACzCf;IAEA,oBAAoB;IACpBV;IACAI;IACAC;IACAE;IACAC;AACF,EAAE"}
1
+ {"version":3,"sources":["../../../../src/swarm/types.ts"],"names":["isAgentId","obj","id","swarmId","isTaskId","isSwarmEvent","type","isTaskDefinition","isAgentState","status","SWARM_CONSTANTS","DEFAULT_TASK_TIMEOUT","DEFAULT_AGENT_TIMEOUT","DEFAULT_HEARTBEAT_INTERVAL","MAX_AGENTS_PER_SWARM","MAX_TASKS_PER_AGENT","MAX_RETRIES","MIN_QUALITY_THRESHOLD","DEFAULT_QUALITY_THRESHOLD","HIGH_QUALITY_THRESHOLD","DEFAULT_THROUGHPUT_TARGET","DEFAULT_LATENCY_TARGET","DEFAULT_RELIABILITY_TARGET","DEFAULT_MEMORY_LIMIT","DEFAULT_CPU_LIMIT","DEFAULT_DISK_LIMIT"],"mappings":"AAAA;;CAEC,GA4jCD,0BAA0B;AAE1B,OAAO,SAASA,UAAUC,GAAQ;IAChC,OAAOA,OAAO,OAAOA,IAAIC,EAAE,KAAK,YAAY,OAAOD,IAAIE,OAAO,KAAK;AACrE;AAEA,OAAO,SAASC,SAASH,GAAQ;IAC/B,OAAOA,OAAO,OAAOA,IAAIC,EAAE,KAAK,YAAY,OAAOD,IAAIE,OAAO,KAAK;AACrE;AAEA,OAAO,SAASE,aAAaJ,GAAQ;IACnC,OAAOA,OAAO,OAAOA,IAAIC,EAAE,KAAK,YAAY,OAAOD,IAAIK,IAAI,KAAK;AAClE;AAEA,OAAO,SAASC,iBAAiBN,GAAQ;IACvC,OAAOA,OAAOG,SAASH,IAAIC,EAAE,KAAK,OAAOD,IAAIK,IAAI,KAAK;AACxD;AAEA,OAAO,SAASE,aAAaP,GAAQ;IACnC,OAAOA,OAAOD,UAAUC,IAAIC,EAAE,KAAK,OAAOD,IAAIQ,MAAM,KAAK;AAC3D;AAEA,wBAAwB;AAExB,OAAO,MAAMC,kBAAkB;IAC7B,WAAW;IACXC,sBAAsB,IAAI,KAAK;IAC/BC,uBA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