claude-flow 2.7.0 → 2.7.2

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 (1135) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +83 -22
  3. package/bin/claude-flow +1 -1
  4. package/dist/src/cli/commands/memory.js +64 -1
  5. package/dist/src/cli/commands/memory.js.map +1 -1
  6. package/dist/src/cli/help-formatter.js +3 -5
  7. package/dist/src/cli/help-formatter.js.map +1 -1
  8. package/dist/src/cli/simple-cli.js +104 -0
  9. package/dist/src/cli/simple-cli.js.map +1 -1
  10. package/dist/src/cli/validation-helper.js.map +1 -1
  11. package/dist/src/core/version.js +1 -1
  12. package/dist/src/core/version.js.map +1 -1
  13. package/dist/src/mcp/mcp-server.js +261 -3
  14. package/dist/src/mcp/mcp-server.js.map +1 -1
  15. package/dist/src/memory/agentdb-adapter.js +214 -0
  16. package/dist/src/memory/agentdb-adapter.js.map +1 -0
  17. package/dist/src/memory/backends/agentdb.js +234 -0
  18. package/dist/src/memory/backends/agentdb.js.map +1 -0
  19. package/dist/src/memory/index.js +11 -2
  20. package/dist/src/memory/index.js.map +1 -1
  21. package/dist/src/memory/migration/legacy-bridge.js +222 -0
  22. package/dist/src/memory/migration/legacy-bridge.js.map +1 -0
  23. package/dist/src/memory/swarm-memory.js +421 -340
  24. package/dist/src/memory/swarm-memory.js.map +1 -1
  25. package/dist/src/utils/metrics-reader.js +41 -29
  26. package/dist/src/utils/metrics-reader.js.map +1 -1
  27. package/docs/.claude-flow/metrics/performance.json +80 -2
  28. package/docs/.claude-flow/metrics/task-metrics.json +3 -3
  29. package/docs/INDEX.md +37 -12
  30. package/docs/README.md +92 -4
  31. package/docs/agentdb/AGENT3_FINAL_REPORT.md +643 -0
  32. package/docs/agentdb/AGENT3_SUMMARY.md +354 -0
  33. package/docs/agentdb/AGENTDB_INTEGRATION_PLAN.md +1258 -0
  34. package/docs/agentdb/BACKWARD_COMPATIBILITY_GUARANTEE.md +421 -0
  35. package/docs/agentdb/OPTIMIZATION_REPORT.md +360 -0
  36. package/docs/agentdb/PRODUCTION_READINESS.md +499 -0
  37. package/docs/agentdb/PUBLISHING_CHECKLIST.md +364 -0
  38. package/docs/agentdb/README.md +58 -0
  39. package/docs/agentdb/SWARM_COORDINATION.md +393 -0
  40. package/docs/agentdb/SWARM_IMPLEMENTATION_COMPLETE.md +538 -0
  41. package/docs/agentdb/agentdb-integration-summary.md +331 -0
  42. package/docs/agentdb/benchmarks/baseline-report.json +75 -0
  43. package/docs/development/AGENT1_COMPLETION_REPORT.md +466 -0
  44. package/docs/development/README.md +22 -0
  45. package/docs/fixes/PATTERN_FIX_CONFIRMATION.md +513 -0
  46. package/docs/fixes/PATTERN_PERSISTENCE_FIX.md +328 -0
  47. package/docs/fixes/README.md +33 -0
  48. package/docs/guides/README.md +29 -0
  49. package/docs/{skills-tutorial.md → guides/skills-tutorial.md} +2 -2
  50. package/docs/integrations/agentic-flow/INTEGRATION-TEST-v1.7.1.md +419 -0
  51. package/docs/integrations/agentic-flow/MIGRATION_v1.7.0.md +381 -0
  52. package/docs/integrations/agentic-flow/README.md +229 -0
  53. package/docs/integrations/agentic-flow/RELEASE-v1.7.0.md +348 -0
  54. package/docs/integrations/agentic-flow/RELEASE-v1.7.1.md +547 -0
  55. package/docs/integrations/agentic-flow/VERIFICATION-v1.7.4.md +556 -0
  56. package/docs/performance/README.md +31 -0
  57. package/docs/releases/ALPHA_TAG_UPDATE.md +150 -0
  58. package/docs/releases/README.md +25 -0
  59. package/docs/{RELEASE-NOTES-v2.7.0-alpha.10.md → releases/v2.7.0-alpha.10/RELEASE-NOTES-v2.7.0-alpha.10.md} +1 -1
  60. package/docs/releases/v2.7.1/RELEASE_SUMMARY_v2.7.1.md +340 -0
  61. package/docs/releases/v2.7.1/RELEASE_v2.7.1.md +244 -0
  62. package/docs/validation/DOCKER_VERIFICATION_REPORT.md +371 -0
  63. package/docs/validation/README.md +25 -0
  64. package/docs/validation/REGRESSION_ANALYSIS_v2.7.1.md +357 -0
  65. package/package.json +4 -3
  66. package/scripts/fix-agentdb-imports.sh +18 -0
  67. package/scripts/run-docker-regression.sh +101 -0
  68. package/scripts/verify-agentdb-integration.sh +220 -0
  69. package/src/cli/commands/memory.ts +95 -1
  70. package/src/mcp/mcp-server.js +302 -2
  71. package/src/memory/README-AGENTDB.md +366 -0
  72. package/src/memory/agentdb-adapter.js +373 -0
  73. package/src/memory/backends/agentdb.js +360 -0
  74. package/src/memory/index.js +32 -3
  75. package/src/memory/migration/legacy-bridge.js +330 -0
  76. package/dist/agents/agent-loader.d.ts +0 -103
  77. package/dist/agents/agent-loader.d.ts.map +0 -1
  78. package/dist/agents/agent-loader.js +0 -220
  79. package/dist/agents/agent-loader.js.map +0 -1
  80. package/dist/agents/agent-manager.d.ts +0 -191
  81. package/dist/agents/agent-manager.d.ts.map +0 -1
  82. package/dist/agents/agent-manager.js +0 -1405
  83. package/dist/agents/agent-manager.js.map +0 -1
  84. package/dist/api/claude-api-errors.d.ts +0 -115
  85. package/dist/api/claude-api-errors.d.ts.map +0 -1
  86. package/dist/api/claude-api-errors.js +0 -198
  87. package/dist/api/claude-api-errors.js.map +0 -1
  88. package/dist/api/claude-client.d.ts +0 -197
  89. package/dist/api/claude-client.d.ts.map +0 -1
  90. package/dist/api/claude-client.js +0 -525
  91. package/dist/api/claude-client.js.map +0 -1
  92. package/dist/cli/cli-core.d.ts +0 -52
  93. package/dist/cli/cli-core.d.ts.map +0 -1
  94. package/dist/cli/cli-core.js +0 -264
  95. package/dist/cli/cli-core.js.map +0 -1
  96. package/dist/cli/command-registry.d.ts +0 -10
  97. package/dist/cli/command-registry.d.ts.map +0 -1
  98. package/dist/cli/command-registry.js +0 -1126
  99. package/dist/cli/command-registry.js.map +0 -1
  100. package/dist/cli/commander-fix.d.ts +0 -4
  101. package/dist/cli/commander-fix.d.ts.map +0 -1
  102. package/dist/cli/commander-fix.js +0 -6
  103. package/dist/cli/commander-fix.js.map +0 -1
  104. package/dist/cli/commands/agent.d.ts +0 -6
  105. package/dist/cli/commands/agent.d.ts.map +0 -1
  106. package/dist/cli/commands/agent.js +0 -382
  107. package/dist/cli/commands/agent.js.map +0 -1
  108. package/dist/cli/commands/config.d.ts +0 -4
  109. package/dist/cli/commands/config.d.ts.map +0 -1
  110. package/dist/cli/commands/config.js +0 -88
  111. package/dist/cli/commands/config.js.map +0 -1
  112. package/dist/cli/commands/enterprise.d.ts +0 -3
  113. package/dist/cli/commands/enterprise.d.ts.map +0 -1
  114. package/dist/cli/commands/enterprise.js +0 -1506
  115. package/dist/cli/commands/enterprise.js.map +0 -1
  116. package/dist/cli/commands/help.d.ts +0 -6
  117. package/dist/cli/commands/help.d.ts.map +0 -1
  118. package/dist/cli/commands/help.js +0 -936
  119. package/dist/cli/commands/help.js.map +0 -1
  120. package/dist/cli/commands/hive-mind/index.d.ts +0 -18
  121. package/dist/cli/commands/hive-mind/index.d.ts.map +0 -1
  122. package/dist/cli/commands/hive-mind/index.js +0 -30
  123. package/dist/cli/commands/hive-mind/index.js.map +0 -1
  124. package/dist/cli/commands/hive-mind/init.d.ts +0 -9
  125. package/dist/cli/commands/hive-mind/init.d.ts.map +0 -1
  126. package/dist/cli/commands/hive-mind/init.js +0 -68
  127. package/dist/cli/commands/hive-mind/init.js.map +0 -1
  128. package/dist/cli/commands/hive-mind/pause.d.ts +0 -8
  129. package/dist/cli/commands/hive-mind/pause.d.ts.map +0 -1
  130. package/dist/cli/commands/hive-mind/pause.js +0 -81
  131. package/dist/cli/commands/hive-mind/pause.js.map +0 -1
  132. package/dist/cli/commands/hive-mind/ps.d.ts +0 -8
  133. package/dist/cli/commands/hive-mind/ps.d.ts.map +0 -1
  134. package/dist/cli/commands/hive-mind/ps.js +0 -120
  135. package/dist/cli/commands/hive-mind/ps.js.map +0 -1
  136. package/dist/cli/commands/hive-mind/resume.d.ts +0 -8
  137. package/dist/cli/commands/hive-mind/resume.d.ts.map +0 -1
  138. package/dist/cli/commands/hive-mind/resume.js +0 -62
  139. package/dist/cli/commands/hive-mind/resume.js.map +0 -1
  140. package/dist/cli/commands/hive-mind/spawn.d.ts +0 -9
  141. package/dist/cli/commands/hive-mind/spawn.d.ts.map +0 -1
  142. package/dist/cli/commands/hive-mind/spawn.js +0 -174
  143. package/dist/cli/commands/hive-mind/spawn.js.map +0 -1
  144. package/dist/cli/commands/hive-mind/status.d.ts +0 -9
  145. package/dist/cli/commands/hive-mind/status.d.ts.map +0 -1
  146. package/dist/cli/commands/hive-mind/status.js +0 -204
  147. package/dist/cli/commands/hive-mind/status.js.map +0 -1
  148. package/dist/cli/commands/hive-mind/stop.d.ts +0 -8
  149. package/dist/cli/commands/hive-mind/stop.d.ts.map +0 -1
  150. package/dist/cli/commands/hive-mind/stop.js +0 -125
  151. package/dist/cli/commands/hive-mind/stop.js.map +0 -1
  152. package/dist/cli/commands/hive-mind/task.d.ts +0 -9
  153. package/dist/cli/commands/hive-mind/task.d.ts.map +0 -1
  154. package/dist/cli/commands/hive-mind/task.js +0 -294
  155. package/dist/cli/commands/hive-mind/task.js.map +0 -1
  156. package/dist/cli/commands/hive-mind/wizard.d.ts +0 -9
  157. package/dist/cli/commands/hive-mind/wizard.d.ts.map +0 -1
  158. package/dist/cli/commands/hive-mind/wizard.js +0 -531
  159. package/dist/cli/commands/hive-mind/wizard.js.map +0 -1
  160. package/dist/cli/commands/hive.d.ts +0 -6
  161. package/dist/cli/commands/hive.d.ts.map +0 -1
  162. package/dist/cli/commands/hive.js +0 -409
  163. package/dist/cli/commands/hive.js.map +0 -1
  164. package/dist/cli/commands/index.d.ts +0 -3
  165. package/dist/cli/commands/index.d.ts.map +0 -1
  166. package/dist/cli/commands/index.js +0 -2624
  167. package/dist/cli/commands/index.js.map +0 -1
  168. package/dist/cli/commands/mcp.d.ts +0 -5
  169. package/dist/cli/commands/mcp.d.ts.map +0 -1
  170. package/dist/cli/commands/mcp.js +0 -169
  171. package/dist/cli/commands/mcp.js.map +0 -1
  172. package/dist/cli/commands/memory.d.ts +0 -26
  173. package/dist/cli/commands/memory.d.ts.map +0 -1
  174. package/dist/cli/commands/memory.js +0 -225
  175. package/dist/cli/commands/memory.js.map +0 -1
  176. package/dist/cli/commands/migrate.d.ts +0 -5
  177. package/dist/cli/commands/migrate.d.ts.map +0 -1
  178. package/dist/cli/commands/migrate.js +0 -139
  179. package/dist/cli/commands/migrate.js.map +0 -1
  180. package/dist/cli/commands/monitor.d.ts +0 -5
  181. package/dist/cli/commands/monitor.d.ts.map +0 -1
  182. package/dist/cli/commands/monitor.js +0 -493
  183. package/dist/cli/commands/monitor.js.map +0 -1
  184. package/dist/cli/commands/session.d.ts +0 -5
  185. package/dist/cli/commands/session.d.ts.map +0 -1
  186. package/dist/cli/commands/session.js +0 -548
  187. package/dist/cli/commands/session.js.map +0 -1
  188. package/dist/cli/commands/sparc.d.ts +0 -3
  189. package/dist/cli/commands/sparc.d.ts.map +0 -1
  190. package/dist/cli/commands/sparc.js +0 -472
  191. package/dist/cli/commands/sparc.js.map +0 -1
  192. package/dist/cli/commands/start/event-emitter.d.ts +0 -13
  193. package/dist/cli/commands/start/event-emitter.d.ts.map +0 -1
  194. package/dist/cli/commands/start/event-emitter.js +0 -35
  195. package/dist/cli/commands/start/event-emitter.js.map +0 -1
  196. package/dist/cli/commands/start/index.d.ts +0 -10
  197. package/dist/cli/commands/start/index.d.ts.map +0 -1
  198. package/dist/cli/commands/start/index.js +0 -9
  199. package/dist/cli/commands/start/index.js.map +0 -1
  200. package/dist/cli/commands/start/process-manager.d.ts +0 -31
  201. package/dist/cli/commands/start/process-manager.d.ts.map +0 -1
  202. package/dist/cli/commands/start/process-manager.js +0 -283
  203. package/dist/cli/commands/start/process-manager.js.map +0 -1
  204. package/dist/cli/commands/start/process-ui-simple.d.ts +0 -29
  205. package/dist/cli/commands/start/process-ui-simple.d.ts.map +0 -1
  206. package/dist/cli/commands/start/process-ui-simple.js +0 -334
  207. package/dist/cli/commands/start/process-ui-simple.js.map +0 -1
  208. package/dist/cli/commands/start/process-ui.d.ts +0 -5
  209. package/dist/cli/commands/start/process-ui.d.ts.map +0 -1
  210. package/dist/cli/commands/start/process-ui.js +0 -5
  211. package/dist/cli/commands/start/process-ui.js.map +0 -1
  212. package/dist/cli/commands/start/start-command.d.ts +0 -2
  213. package/dist/cli/commands/start/start-command.d.ts.map +0 -1
  214. package/dist/cli/commands/start/start-command.js +0 -462
  215. package/dist/cli/commands/start/start-command.js.map +0 -1
  216. package/dist/cli/commands/start/system-monitor.d.ts +0 -25
  217. package/dist/cli/commands/start/system-monitor.d.ts.map +0 -1
  218. package/dist/cli/commands/start/system-monitor.js +0 -265
  219. package/dist/cli/commands/start/system-monitor.js.map +0 -1
  220. package/dist/cli/commands/start/types.d.ts +0 -64
  221. package/dist/cli/commands/start/types.d.ts.map +0 -1
  222. package/dist/cli/commands/start/types.js +0 -22
  223. package/dist/cli/commands/start/types.js.map +0 -1
  224. package/dist/cli/commands/start.d.ts +0 -6
  225. package/dist/cli/commands/start.d.ts.map +0 -1
  226. package/dist/cli/commands/start.js +0 -6
  227. package/dist/cli/commands/start.js.map +0 -1
  228. package/dist/cli/commands/status.d.ts +0 -2
  229. package/dist/cli/commands/status.d.ts.map +0 -1
  230. package/dist/cli/commands/status.js +0 -304
  231. package/dist/cli/commands/status.js.map +0 -1
  232. package/dist/cli/commands/swarm.d.ts +0 -6
  233. package/dist/cli/commands/swarm.d.ts.map +0 -1
  234. package/dist/cli/commands/swarm.js +0 -465
  235. package/dist/cli/commands/swarm.js.map +0 -1
  236. package/dist/cli/commands/task.d.ts +0 -2
  237. package/dist/cli/commands/task.d.ts.map +0 -1
  238. package/dist/cli/commands/task.js +0 -75
  239. package/dist/cli/commands/task.js.map +0 -1
  240. package/dist/cli/commands/workflow.d.ts +0 -2
  241. package/dist/cli/commands/workflow.d.ts.map +0 -1
  242. package/dist/cli/commands/workflow.js +0 -624
  243. package/dist/cli/commands/workflow.js.map +0 -1
  244. package/dist/cli/completion.d.ts +0 -19
  245. package/dist/cli/completion.d.ts.map +0 -1
  246. package/dist/cli/completion.js +0 -545
  247. package/dist/cli/completion.js.map +0 -1
  248. package/dist/cli/formatter.d.ts +0 -69
  249. package/dist/cli/formatter.d.ts.map +0 -1
  250. package/dist/cli/formatter.js +0 -277
  251. package/dist/cli/formatter.js.map +0 -1
  252. package/dist/cli/help-formatter.d.ts +0 -49
  253. package/dist/cli/help-formatter.d.ts.map +0 -1
  254. package/dist/cli/help-formatter.js +0 -108
  255. package/dist/cli/help-formatter.js.map +0 -1
  256. package/dist/cli/help-text.d.ts +0 -25
  257. package/dist/cli/help-text.d.ts.map +0 -1
  258. package/dist/cli/help-text.js +0 -1051
  259. package/dist/cli/help-text.js.map +0 -1
  260. package/dist/cli/index-remote.d.ts +0 -7
  261. package/dist/cli/index-remote.d.ts.map +0 -1
  262. package/dist/cli/index-remote.js +0 -125
  263. package/dist/cli/index-remote.js.map +0 -1
  264. package/dist/cli/index.d.ts +0 -7
  265. package/dist/cli/index.d.ts.map +0 -1
  266. package/dist/cli/index.js +0 -189
  267. package/dist/cli/index.js.map +0 -1
  268. package/dist/cli/node-compat.d.ts +0 -81
  269. package/dist/cli/node-compat.d.ts.map +0 -1
  270. package/dist/cli/node-compat.js +0 -229
  271. package/dist/cli/node-compat.js.map +0 -1
  272. package/dist/cli/repl.d.ts +0 -5
  273. package/dist/cli/repl.d.ts.map +0 -1
  274. package/dist/cli/repl.js +0 -949
  275. package/dist/cli/repl.js.map +0 -1
  276. package/dist/cli/runtime-detector.d.ts +0 -128
  277. package/dist/cli/runtime-detector.d.ts.map +0 -1
  278. package/dist/cli/runtime-detector.js +0 -267
  279. package/dist/cli/runtime-detector.js.map +0 -1
  280. package/dist/cli/simple-cli.d.ts +0 -7
  281. package/dist/cli/simple-cli.d.ts.map +0 -1
  282. package/dist/cli/simple-cli.js +0 -3085
  283. package/dist/cli/simple-cli.js.map +0 -1
  284. package/dist/cli/simple-commands/agent.d.ts +0 -6
  285. package/dist/cli/simple-commands/agent.d.ts.map +0 -1
  286. package/dist/cli/simple-commands/agent.js +0 -128
  287. package/dist/cli/simple-commands/agent.js.map +0 -1
  288. package/dist/cli/simple-commands/analysis.d.ts +0 -2
  289. package/dist/cli/simple-commands/analysis.d.ts.map +0 -1
  290. package/dist/cli/simple-commands/analysis.js +0 -473
  291. package/dist/cli/simple-commands/analysis.js.map +0 -1
  292. package/dist/cli/simple-commands/automation-executor.d.ts +0 -188
  293. package/dist/cli/simple-commands/automation-executor.d.ts.map +0 -1
  294. package/dist/cli/simple-commands/automation-executor.js +0 -1383
  295. package/dist/cli/simple-commands/automation-executor.js.map +0 -1
  296. package/dist/cli/simple-commands/automation.d.ts +0 -2
  297. package/dist/cli/simple-commands/automation.d.ts.map +0 -1
  298. package/dist/cli/simple-commands/automation.js +0 -531
  299. package/dist/cli/simple-commands/automation.js.map +0 -1
  300. package/dist/cli/simple-commands/batch-manager.d.ts +0 -2
  301. package/dist/cli/simple-commands/batch-manager.d.ts.map +0 -1
  302. package/dist/cli/simple-commands/batch-manager.js +0 -290
  303. package/dist/cli/simple-commands/batch-manager.js.map +0 -1
  304. package/dist/cli/simple-commands/claude-telemetry.d.ts +0 -14
  305. package/dist/cli/simple-commands/claude-telemetry.d.ts.map +0 -1
  306. package/dist/cli/simple-commands/claude-telemetry.js +0 -263
  307. package/dist/cli/simple-commands/claude-telemetry.js.map +0 -1
  308. package/dist/cli/simple-commands/config.d.ts +0 -6
  309. package/dist/cli/simple-commands/config.d.ts.map +0 -1
  310. package/dist/cli/simple-commands/config.js +0 -116
  311. package/dist/cli/simple-commands/config.js.map +0 -1
  312. package/dist/cli/simple-commands/coordination.d.ts +0 -2
  313. package/dist/cli/simple-commands/coordination.d.ts.map +0 -1
  314. package/dist/cli/simple-commands/coordination.js +0 -249
  315. package/dist/cli/simple-commands/coordination.js.map +0 -1
  316. package/dist/cli/simple-commands/env-template.d.ts +0 -42
  317. package/dist/cli/simple-commands/env-template.d.ts.map +0 -1
  318. package/dist/cli/simple-commands/env-template.js +0 -183
  319. package/dist/cli/simple-commands/env-template.js.map +0 -1
  320. package/dist/cli/simple-commands/fix-hook-variables.d.ts +0 -16
  321. package/dist/cli/simple-commands/fix-hook-variables.d.ts.map +0 -1
  322. package/dist/cli/simple-commands/fix-hook-variables.js +0 -320
  323. package/dist/cli/simple-commands/fix-hook-variables.js.map +0 -1
  324. package/dist/cli/simple-commands/github/init.d.ts +0 -6
  325. package/dist/cli/simple-commands/github/init.d.ts.map +0 -1
  326. package/dist/cli/simple-commands/github/init.js +0 -506
  327. package/dist/cli/simple-commands/github/init.js.map +0 -1
  328. package/dist/cli/simple-commands/github.d.ts +0 -3
  329. package/dist/cli/simple-commands/github.d.ts.map +0 -1
  330. package/dist/cli/simple-commands/github.js +0 -356
  331. package/dist/cli/simple-commands/github.js.map +0 -1
  332. package/dist/cli/simple-commands/goal.d.ts +0 -3
  333. package/dist/cli/simple-commands/goal.d.ts.map +0 -1
  334. package/dist/cli/simple-commands/goal.js +0 -136
  335. package/dist/cli/simple-commands/goal.js.map +0 -1
  336. package/dist/cli/simple-commands/hive-mind/auto-save-middleware.d.ts +0 -68
  337. package/dist/cli/simple-commands/hive-mind/auto-save-middleware.d.ts.map +0 -1
  338. package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js +0 -264
  339. package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js.map +0 -1
  340. package/dist/cli/simple-commands/hive-mind/communication.d.ts +0 -176
  341. package/dist/cli/simple-commands/hive-mind/communication.d.ts.map +0 -1
  342. package/dist/cli/simple-commands/hive-mind/communication.js +0 -611
  343. package/dist/cli/simple-commands/hive-mind/communication.js.map +0 -1
  344. package/dist/cli/simple-commands/hive-mind/core.d.ts +0 -306
  345. package/dist/cli/simple-commands/hive-mind/core.d.ts.map +0 -1
  346. package/dist/cli/simple-commands/hive-mind/core.js +0 -839
  347. package/dist/cli/simple-commands/hive-mind/core.js.map +0 -1
  348. package/dist/cli/simple-commands/hive-mind/db-optimizer.d.ts +0 -32
  349. package/dist/cli/simple-commands/hive-mind/db-optimizer.d.ts.map +0 -1
  350. package/dist/cli/simple-commands/hive-mind/db-optimizer.js +0 -702
  351. package/dist/cli/simple-commands/hive-mind/db-optimizer.js.map +0 -1
  352. package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts +0 -270
  353. package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts.map +0 -1
  354. package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js +0 -1211
  355. package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js.map +0 -1
  356. package/dist/cli/simple-commands/hive-mind/memory.d.ts +0 -334
  357. package/dist/cli/simple-commands/hive-mind/memory.d.ts.map +0 -1
  358. package/dist/cli/simple-commands/hive-mind/memory.js +0 -1068
  359. package/dist/cli/simple-commands/hive-mind/memory.js.map +0 -1
  360. package/dist/cli/simple-commands/hive-mind/metrics-reader.js +0 -274
  361. package/dist/cli/simple-commands/hive-mind/metrics-reader.js.map +0 -1
  362. package/dist/cli/simple-commands/hive-mind/performance-optimizer.d.ts +0 -256
  363. package/dist/cli/simple-commands/hive-mind/performance-optimizer.d.ts.map +0 -1
  364. package/dist/cli/simple-commands/hive-mind/performance-optimizer.js +0 -520
  365. package/dist/cli/simple-commands/hive-mind/performance-optimizer.js.map +0 -1
  366. package/dist/cli/simple-commands/hive-mind/queen.d.ts +0 -235
  367. package/dist/cli/simple-commands/hive-mind/queen.d.ts.map +0 -1
  368. package/dist/cli/simple-commands/hive-mind/queen.js +0 -697
  369. package/dist/cli/simple-commands/hive-mind/queen.js.map +0 -1
  370. package/dist/cli/simple-commands/hive-mind/session-manager.d.ts +0 -140
  371. package/dist/cli/simple-commands/hive-mind/session-manager.d.ts.map +0 -1
  372. package/dist/cli/simple-commands/hive-mind/session-manager.js +0 -1000
  373. package/dist/cli/simple-commands/hive-mind/session-manager.js.map +0 -1
  374. package/dist/cli/simple-commands/hive-mind-optimize.d.ts +0 -6
  375. package/dist/cli/simple-commands/hive-mind-optimize.d.ts.map +0 -1
  376. package/dist/cli/simple-commands/hive-mind-optimize.js +0 -317
  377. package/dist/cli/simple-commands/hive-mind-optimize.js.map +0 -1
  378. package/dist/cli/simple-commands/hive-mind.d.ts +0 -22
  379. package/dist/cli/simple-commands/hive-mind.d.ts.map +0 -1
  380. package/dist/cli/simple-commands/hive-mind.js +0 -2722
  381. package/dist/cli/simple-commands/hive-mind.js.map +0 -1
  382. package/dist/cli/simple-commands/hook-safety.d.ts +0 -177
  383. package/dist/cli/simple-commands/hook-safety.d.ts.map +0 -1
  384. package/dist/cli/simple-commands/hook-safety.js +0 -590
  385. package/dist/cli/simple-commands/hook-safety.js.map +0 -1
  386. package/dist/cli/simple-commands/hooks.d.ts +0 -3
  387. package/dist/cli/simple-commands/hooks.d.ts.map +0 -1
  388. package/dist/cli/simple-commands/hooks.js +0 -1298
  389. package/dist/cli/simple-commands/hooks.js.map +0 -1
  390. package/dist/cli/simple-commands/init/agent-copier.d.ts +0 -65
  391. package/dist/cli/simple-commands/init/agent-copier.d.ts.map +0 -1
  392. package/dist/cli/simple-commands/init/agent-copier.js +0 -320
  393. package/dist/cli/simple-commands/init/agent-copier.js.map +0 -1
  394. package/dist/cli/simple-commands/init/batch-init.d.ts +0 -137
  395. package/dist/cli/simple-commands/init/batch-init.d.ts.map +0 -1
  396. package/dist/cli/simple-commands/init/batch-init.js +0 -558
  397. package/dist/cli/simple-commands/init/batch-init.js.map +0 -1
  398. package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.d.ts +0 -2
  399. package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.d.ts.map +0 -1
  400. package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.js +0 -433
  401. package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.js.map +0 -1
  402. package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.d.ts +0 -2
  403. package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.d.ts.map +0 -1
  404. package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +0 -871
  405. package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js.map +0 -1
  406. package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.d.ts +0 -2
  407. package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.d.ts.map +0 -1
  408. package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +0 -332
  409. package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js.map +0 -1
  410. package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.d.ts +0 -3
  411. package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.d.ts.map +0 -1
  412. package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +0 -488
  413. package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js.map +0 -1
  414. package/dist/cli/simple-commands/init/claude-commands/slash-commands.d.ts +0 -2
  415. package/dist/cli/simple-commands/init/claude-commands/slash-commands.d.ts.map +0 -1
  416. package/dist/cli/simple-commands/init/claude-commands/slash-commands.js +0 -51
  417. package/dist/cli/simple-commands/init/claude-commands/slash-commands.js.map +0 -1
  418. package/dist/cli/simple-commands/init/claude-commands/sparc-commands.d.ts +0 -3
  419. package/dist/cli/simple-commands/init/claude-commands/sparc-commands.d.ts.map +0 -1
  420. package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js +0 -288
  421. package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js.map +0 -1
  422. package/dist/cli/simple-commands/init/copy-revised-templates.d.ts +0 -29
  423. package/dist/cli/simple-commands/init/copy-revised-templates.d.ts.map +0 -1
  424. package/dist/cli/simple-commands/init/copy-revised-templates.js +0 -166
  425. package/dist/cli/simple-commands/init/copy-revised-templates.js.map +0 -1
  426. package/dist/cli/simple-commands/init/executable-wrapper.d.ts +0 -2
  427. package/dist/cli/simple-commands/init/executable-wrapper.d.ts.map +0 -1
  428. package/dist/cli/simple-commands/init/executable-wrapper.js +0 -116
  429. package/dist/cli/simple-commands/init/executable-wrapper.js.map +0 -1
  430. package/dist/cli/simple-commands/init/gitignore-updater.d.ts +0 -23
  431. package/dist/cli/simple-commands/init/gitignore-updater.d.ts.map +0 -1
  432. package/dist/cli/simple-commands/init/gitignore-updater.js +0 -128
  433. package/dist/cli/simple-commands/init/gitignore-updater.js.map +0 -1
  434. package/dist/cli/simple-commands/init/help.d.ts +0 -2
  435. package/dist/cli/simple-commands/init/help.d.ts.map +0 -1
  436. package/dist/cli/simple-commands/init/help.js +0 -131
  437. package/dist/cli/simple-commands/init/help.js.map +0 -1
  438. package/dist/cli/simple-commands/init/hive-mind-init.d.ts +0 -152
  439. package/dist/cli/simple-commands/init/hive-mind-init.d.ts.map +0 -1
  440. package/dist/cli/simple-commands/init/hive-mind-init.js +0 -699
  441. package/dist/cli/simple-commands/init/hive-mind-init.js.map +0 -1
  442. package/dist/cli/simple-commands/init/index.d.ts +0 -2
  443. package/dist/cli/simple-commands/init/index.d.ts.map +0 -1
  444. package/dist/cli/simple-commands/init/index.js +0 -1784
  445. package/dist/cli/simple-commands/init/index.js.map +0 -1
  446. package/dist/cli/simple-commands/init/performance-monitor.d.ts +0 -73
  447. package/dist/cli/simple-commands/init/performance-monitor.d.ts.map +0 -1
  448. package/dist/cli/simple-commands/init/performance-monitor.js +0 -277
  449. package/dist/cli/simple-commands/init/performance-monitor.js.map +0 -1
  450. package/dist/cli/simple-commands/init/rollback/backup-manager.d.ts +0 -95
  451. package/dist/cli/simple-commands/init/rollback/backup-manager.d.ts.map +0 -1
  452. package/dist/cli/simple-commands/init/rollback/backup-manager.js +0 -486
  453. package/dist/cli/simple-commands/init/rollback/backup-manager.js.map +0 -1
  454. package/dist/cli/simple-commands/init/rollback/index.d.ts +0 -114
  455. package/dist/cli/simple-commands/init/rollback/index.d.ts.map +0 -1
  456. package/dist/cli/simple-commands/init/rollback/index.js +0 -353
  457. package/dist/cli/simple-commands/init/rollback/index.js.map +0 -1
  458. package/dist/cli/simple-commands/init/rollback/recovery-manager.d.ts +0 -161
  459. package/dist/cli/simple-commands/init/rollback/recovery-manager.d.ts.map +0 -1
  460. package/dist/cli/simple-commands/init/rollback/recovery-manager.js +0 -686
  461. package/dist/cli/simple-commands/init/rollback/recovery-manager.js.map +0 -1
  462. package/dist/cli/simple-commands/init/rollback/rollback-executor.d.ts +0 -112
  463. package/dist/cli/simple-commands/init/rollback/rollback-executor.d.ts.map +0 -1
  464. package/dist/cli/simple-commands/init/rollback/rollback-executor.js +0 -480
  465. package/dist/cli/simple-commands/init/rollback/rollback-executor.js.map +0 -1
  466. package/dist/cli/simple-commands/init/rollback/state-tracker.d.ts +0 -121
  467. package/dist/cli/simple-commands/init/rollback/state-tracker.d.ts.map +0 -1
  468. package/dist/cli/simple-commands/init/rollback/state-tracker.js +0 -432
  469. package/dist/cli/simple-commands/init/rollback/state-tracker.js.map +0 -1
  470. package/dist/cli/simple-commands/init/skills-copier.d.ts +0 -41
  471. package/dist/cli/simple-commands/init/skills-copier.d.ts.map +0 -1
  472. package/dist/cli/simple-commands/init/skills-copier.js +0 -192
  473. package/dist/cli/simple-commands/init/skills-copier.js.map +0 -1
  474. package/dist/cli/simple-commands/init/sparc/roo-readme.d.ts +0 -2
  475. package/dist/cli/simple-commands/init/sparc/roo-readme.d.ts.map +0 -1
  476. package/dist/cli/simple-commands/init/sparc/roo-readme.js +0 -61
  477. package/dist/cli/simple-commands/init/sparc/roo-readme.js.map +0 -1
  478. package/dist/cli/simple-commands/init/sparc/roomodes-config.d.ts +0 -2
  479. package/dist/cli/simple-commands/init/sparc/roomodes-config.d.ts.map +0 -1
  480. package/dist/cli/simple-commands/init/sparc/roomodes-config.js +0 -80
  481. package/dist/cli/simple-commands/init/sparc/roomodes-config.js.map +0 -1
  482. package/dist/cli/simple-commands/init/sparc/workflows.d.ts +0 -2
  483. package/dist/cli/simple-commands/init/sparc/workflows.d.ts.map +0 -1
  484. package/dist/cli/simple-commands/init/sparc/workflows.js +0 -36
  485. package/dist/cli/simple-commands/init/sparc/workflows.js.map +0 -1
  486. package/dist/cli/simple-commands/init/sparc-structure.d.ts +0 -2
  487. package/dist/cli/simple-commands/init/sparc-structure.d.ts.map +0 -1
  488. package/dist/cli/simple-commands/init/sparc-structure.js +0 -63
  489. package/dist/cli/simple-commands/init/sparc-structure.js.map +0 -1
  490. package/dist/cli/simple-commands/init/template-copier.d.ts +0 -27
  491. package/dist/cli/simple-commands/init/template-copier.d.ts.map +0 -1
  492. package/dist/cli/simple-commands/init/template-copier.js +0 -538
  493. package/dist/cli/simple-commands/init/template-copier.js.map +0 -1
  494. package/dist/cli/simple-commands/init/templates/claude-md.d.ts +0 -6
  495. package/dist/cli/simple-commands/init/templates/claude-md.d.ts.map +0 -1
  496. package/dist/cli/simple-commands/init/templates/claude-md.js +0 -1097
  497. package/dist/cli/simple-commands/init/templates/claude-md.js.map +0 -1
  498. package/dist/cli/simple-commands/init/templates/coordination-md.d.ts +0 -4
  499. package/dist/cli/simple-commands/init/templates/coordination-md.d.ts.map +0 -1
  500. package/dist/cli/simple-commands/init/templates/coordination-md.js +0 -338
  501. package/dist/cli/simple-commands/init/templates/coordination-md.js.map +0 -1
  502. package/dist/cli/simple-commands/init/templates/enhanced-templates.d.ts +0 -21
  503. package/dist/cli/simple-commands/init/templates/enhanced-templates.d.ts.map +0 -1
  504. package/dist/cli/simple-commands/init/templates/enhanced-templates.js +0 -2304
  505. package/dist/cli/simple-commands/init/templates/enhanced-templates.js.map +0 -1
  506. package/dist/cli/simple-commands/init/templates/memory-bank-md.d.ts +0 -4
  507. package/dist/cli/simple-commands/init/templates/memory-bank-md.d.ts.map +0 -1
  508. package/dist/cli/simple-commands/init/templates/memory-bank-md.js +0 -257
  509. package/dist/cli/simple-commands/init/templates/memory-bank-md.js.map +0 -1
  510. package/dist/cli/simple-commands/init/templates/readme-files.d.ts +0 -3
  511. package/dist/cli/simple-commands/init/templates/readme-files.d.ts.map +0 -1
  512. package/dist/cli/simple-commands/init/templates/readme-files.js +0 -71
  513. package/dist/cli/simple-commands/init/templates/readme-files.js.map +0 -1
  514. package/dist/cli/simple-commands/init/templates/sparc-modes.d.ts +0 -30
  515. package/dist/cli/simple-commands/init/templates/sparc-modes.d.ts.map +0 -1
  516. package/dist/cli/simple-commands/init/templates/sparc-modes.js +0 -1375
  517. package/dist/cli/simple-commands/init/templates/sparc-modes.js.map +0 -1
  518. package/dist/cli/simple-commands/init/templates/verification-claude-md.d.ts +0 -3
  519. package/dist/cli/simple-commands/init/templates/verification-claude-md.d.ts.map +0 -1
  520. package/dist/cli/simple-commands/init/templates/verification-claude-md.js +0 -432
  521. package/dist/cli/simple-commands/init/templates/verification-claude-md.js.map +0 -1
  522. package/dist/cli/simple-commands/init/validation/config-validator.d.ts +0 -63
  523. package/dist/cli/simple-commands/init/validation/config-validator.d.ts.map +0 -1
  524. package/dist/cli/simple-commands/init/validation/config-validator.js +0 -308
  525. package/dist/cli/simple-commands/init/validation/config-validator.js.map +0 -1
  526. package/dist/cli/simple-commands/init/validation/health-checker.d.ts +0 -117
  527. package/dist/cli/simple-commands/init/validation/health-checker.d.ts.map +0 -1
  528. package/dist/cli/simple-commands/init/validation/health-checker.js +0 -539
  529. package/dist/cli/simple-commands/init/validation/health-checker.js.map +0 -1
  530. package/dist/cli/simple-commands/init/validation/index.d.ts +0 -55
  531. package/dist/cli/simple-commands/init/validation/index.d.ts.map +0 -1
  532. package/dist/cli/simple-commands/init/validation/index.js +0 -347
  533. package/dist/cli/simple-commands/init/validation/index.js.map +0 -1
  534. package/dist/cli/simple-commands/init/validation/mode-validator.d.ts +0 -76
  535. package/dist/cli/simple-commands/init/validation/mode-validator.d.ts.map +0 -1
  536. package/dist/cli/simple-commands/init/validation/mode-validator.js +0 -343
  537. package/dist/cli/simple-commands/init/validation/mode-validator.js.map +0 -1
  538. package/dist/cli/simple-commands/init/validation/post-init-validator.d.ts +0 -62
  539. package/dist/cli/simple-commands/init/validation/post-init-validator.d.ts.map +0 -1
  540. package/dist/cli/simple-commands/init/validation/post-init-validator.js +0 -349
  541. package/dist/cli/simple-commands/init/validation/post-init-validator.js.map +0 -1
  542. package/dist/cli/simple-commands/init/validation/pre-init-validator.d.ts +0 -86
  543. package/dist/cli/simple-commands/init/validation/pre-init-validator.d.ts.map +0 -1
  544. package/dist/cli/simple-commands/init/validation/pre-init-validator.js +0 -260
  545. package/dist/cli/simple-commands/init/validation/pre-init-validator.js.map +0 -1
  546. package/dist/cli/simple-commands/inject-memory-protocol.d.ts +0 -34
  547. package/dist/cli/simple-commands/inject-memory-protocol.d.ts.map +0 -1
  548. package/dist/cli/simple-commands/inject-memory-protocol.js +0 -229
  549. package/dist/cli/simple-commands/inject-memory-protocol.js.map +0 -1
  550. package/dist/cli/simple-commands/mcp.d.ts +0 -2
  551. package/dist/cli/simple-commands/mcp.d.ts.map +0 -1
  552. package/dist/cli/simple-commands/mcp.js +0 -369
  553. package/dist/cli/simple-commands/mcp.js.map +0 -1
  554. package/dist/cli/simple-commands/memory-consolidation.d.ts +0 -73
  555. package/dist/cli/simple-commands/memory-consolidation.d.ts.map +0 -1
  556. package/dist/cli/simple-commands/memory-consolidation.js +0 -537
  557. package/dist/cli/simple-commands/memory-consolidation.js.map +0 -1
  558. package/dist/cli/simple-commands/memory.d.ts +0 -2
  559. package/dist/cli/simple-commands/memory.d.ts.map +0 -1
  560. package/dist/cli/simple-commands/memory.js +0 -778
  561. package/dist/cli/simple-commands/memory.js.map +0 -1
  562. package/dist/cli/simple-commands/migrate-hooks.d.ts +0 -10
  563. package/dist/cli/simple-commands/migrate-hooks.d.ts.map +0 -1
  564. package/dist/cli/simple-commands/migrate-hooks.js +0 -57
  565. package/dist/cli/simple-commands/migrate-hooks.js.map +0 -1
  566. package/dist/cli/simple-commands/monitor.d.ts +0 -3
  567. package/dist/cli/simple-commands/monitor.d.ts.map +0 -1
  568. package/dist/cli/simple-commands/monitor.js +0 -366
  569. package/dist/cli/simple-commands/monitor.js.map +0 -1
  570. package/dist/cli/simple-commands/neural.d.ts +0 -3
  571. package/dist/cli/simple-commands/neural.d.ts.map +0 -1
  572. package/dist/cli/simple-commands/neural.js +0 -137
  573. package/dist/cli/simple-commands/neural.js.map +0 -1
  574. package/dist/cli/simple-commands/pair.d.ts +0 -3
  575. package/dist/cli/simple-commands/pair.d.ts.map +0 -1
  576. package/dist/cli/simple-commands/pair.js +0 -735
  577. package/dist/cli/simple-commands/pair.js.map +0 -1
  578. package/dist/cli/simple-commands/performance-hooks.d.ts +0 -20
  579. package/dist/cli/simple-commands/performance-hooks.d.ts.map +0 -1
  580. package/dist/cli/simple-commands/performance-hooks.js +0 -127
  581. package/dist/cli/simple-commands/performance-hooks.js.map +0 -1
  582. package/dist/cli/simple-commands/performance-metrics.d.ts +0 -153
  583. package/dist/cli/simple-commands/performance-metrics.d.ts.map +0 -1
  584. package/dist/cli/simple-commands/performance-metrics.js +0 -759
  585. package/dist/cli/simple-commands/performance-metrics.js.map +0 -1
  586. package/dist/cli/simple-commands/process-ui-enhanced.d.ts +0 -55
  587. package/dist/cli/simple-commands/process-ui-enhanced.d.ts.map +0 -1
  588. package/dist/cli/simple-commands/process-ui-enhanced.js +0 -680
  589. package/dist/cli/simple-commands/process-ui-enhanced.js.map +0 -1
  590. package/dist/cli/simple-commands/proxy.d.ts +0 -5
  591. package/dist/cli/simple-commands/proxy.d.ts.map +0 -1
  592. package/dist/cli/simple-commands/proxy.js +0 -346
  593. package/dist/cli/simple-commands/proxy.js.map +0 -1
  594. package/dist/cli/simple-commands/sparc-modes/architect.d.ts +0 -2
  595. package/dist/cli/simple-commands/sparc-modes/architect.d.ts.map +0 -1
  596. package/dist/cli/simple-commands/sparc-modes/architect.js +0 -126
  597. package/dist/cli/simple-commands/sparc-modes/architect.js.map +0 -1
  598. package/dist/cli/simple-commands/sparc-modes/ask.d.ts +0 -2
  599. package/dist/cli/simple-commands/sparc-modes/ask.d.ts.map +0 -1
  600. package/dist/cli/simple-commands/sparc-modes/ask.js +0 -127
  601. package/dist/cli/simple-commands/sparc-modes/ask.js.map +0 -1
  602. package/dist/cli/simple-commands/sparc-modes/code.d.ts +0 -2
  603. package/dist/cli/simple-commands/sparc-modes/code.d.ts.map +0 -1
  604. package/dist/cli/simple-commands/sparc-modes/code.js +0 -149
  605. package/dist/cli/simple-commands/sparc-modes/code.js.map +0 -1
  606. package/dist/cli/simple-commands/sparc-modes/debug.d.ts +0 -2
  607. package/dist/cli/simple-commands/sparc-modes/debug.d.ts.map +0 -1
  608. package/dist/cli/simple-commands/sparc-modes/debug.js +0 -113
  609. package/dist/cli/simple-commands/sparc-modes/debug.js.map +0 -1
  610. package/dist/cli/simple-commands/sparc-modes/devops.d.ts +0 -2
  611. package/dist/cli/simple-commands/sparc-modes/devops.d.ts.map +0 -1
  612. package/dist/cli/simple-commands/sparc-modes/devops.js +0 -138
  613. package/dist/cli/simple-commands/sparc-modes/devops.js.map +0 -1
  614. package/dist/cli/simple-commands/sparc-modes/docs-writer.d.ts +0 -2
  615. package/dist/cli/simple-commands/sparc-modes/docs-writer.d.ts.map +0 -1
  616. package/dist/cli/simple-commands/sparc-modes/docs-writer.js +0 -39
  617. package/dist/cli/simple-commands/sparc-modes/docs-writer.js.map +0 -1
  618. package/dist/cli/simple-commands/sparc-modes/generic.d.ts +0 -2
  619. package/dist/cli/simple-commands/sparc-modes/generic.d.ts.map +0 -1
  620. package/dist/cli/simple-commands/sparc-modes/generic.js +0 -35
  621. package/dist/cli/simple-commands/sparc-modes/generic.js.map +0 -1
  622. package/dist/cli/simple-commands/sparc-modes/index.d.ts +0 -17
  623. package/dist/cli/simple-commands/sparc-modes/index.d.ts.map +0 -1
  624. package/dist/cli/simple-commands/sparc-modes/index.js +0 -196
  625. package/dist/cli/simple-commands/sparc-modes/index.js.map +0 -1
  626. package/dist/cli/simple-commands/sparc-modes/integration.d.ts +0 -2
  627. package/dist/cli/simple-commands/sparc-modes/integration.d.ts.map +0 -1
  628. package/dist/cli/simple-commands/sparc-modes/integration.js +0 -56
  629. package/dist/cli/simple-commands/sparc-modes/integration.js.map +0 -1
  630. package/dist/cli/simple-commands/sparc-modes/mcp.d.ts +0 -2
  631. package/dist/cli/simple-commands/sparc-modes/mcp.d.ts.map +0 -1
  632. package/dist/cli/simple-commands/sparc-modes/mcp.js +0 -39
  633. package/dist/cli/simple-commands/sparc-modes/mcp.js.map +0 -1
  634. package/dist/cli/simple-commands/sparc-modes/monitoring.d.ts +0 -2
  635. package/dist/cli/simple-commands/sparc-modes/monitoring.d.ts.map +0 -1
  636. package/dist/cli/simple-commands/sparc-modes/monitoring.js +0 -39
  637. package/dist/cli/simple-commands/sparc-modes/monitoring.js.map +0 -1
  638. package/dist/cli/simple-commands/sparc-modes/optimization.d.ts +0 -2
  639. package/dist/cli/simple-commands/sparc-modes/optimization.d.ts.map +0 -1
  640. package/dist/cli/simple-commands/sparc-modes/optimization.js +0 -39
  641. package/dist/cli/simple-commands/sparc-modes/optimization.js.map +0 -1
  642. package/dist/cli/simple-commands/sparc-modes/security-review.d.ts +0 -2
  643. package/dist/cli/simple-commands/sparc-modes/security-review.d.ts.map +0 -1
  644. package/dist/cli/simple-commands/sparc-modes/security-review.js +0 -131
  645. package/dist/cli/simple-commands/sparc-modes/security-review.js.map +0 -1
  646. package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.d.ts +0 -2
  647. package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.d.ts.map +0 -1
  648. package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.js +0 -168
  649. package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.js.map +0 -1
  650. package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.d.ts +0 -2
  651. package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.d.ts.map +0 -1
  652. package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.js +0 -39
  653. package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.js.map +0 -1
  654. package/dist/cli/simple-commands/sparc-modes/supabase-admin.d.ts +0 -2
  655. package/dist/cli/simple-commands/sparc-modes/supabase-admin.d.ts.map +0 -1
  656. package/dist/cli/simple-commands/sparc-modes/supabase-admin.js +0 -150
  657. package/dist/cli/simple-commands/sparc-modes/supabase-admin.js.map +0 -1
  658. package/dist/cli/simple-commands/sparc-modes/swarm.d.ts +0 -81
  659. package/dist/cli/simple-commands/sparc-modes/swarm.d.ts.map +0 -1
  660. package/dist/cli/simple-commands/sparc-modes/swarm.js +0 -428
  661. package/dist/cli/simple-commands/sparc-modes/swarm.js.map +0 -1
  662. package/dist/cli/simple-commands/sparc-modes/tdd.d.ts +0 -2
  663. package/dist/cli/simple-commands/sparc-modes/tdd.d.ts.map +0 -1
  664. package/dist/cli/simple-commands/sparc-modes/tdd.js +0 -113
  665. package/dist/cli/simple-commands/sparc-modes/tdd.js.map +0 -1
  666. package/dist/cli/simple-commands/sparc-modes/tutorial.d.ts +0 -2
  667. package/dist/cli/simple-commands/sparc-modes/tutorial.d.ts.map +0 -1
  668. package/dist/cli/simple-commands/sparc-modes/tutorial.js +0 -278
  669. package/dist/cli/simple-commands/sparc-modes/tutorial.js.map +0 -1
  670. package/dist/cli/simple-commands/sparc.d.ts +0 -2
  671. package/dist/cli/simple-commands/sparc.d.ts.map +0 -1
  672. package/dist/cli/simple-commands/sparc.js +0 -477
  673. package/dist/cli/simple-commands/sparc.js.map +0 -1
  674. package/dist/cli/simple-commands/start-ui.d.ts +0 -2
  675. package/dist/cli/simple-commands/start-ui.d.ts.map +0 -1
  676. package/dist/cli/simple-commands/start-ui.js +0 -135
  677. package/dist/cli/simple-commands/start-ui.js.map +0 -1
  678. package/dist/cli/simple-commands/start-wrapper.d.ts +0 -2
  679. package/dist/cli/simple-commands/start-wrapper.d.ts.map +0 -1
  680. package/dist/cli/simple-commands/start-wrapper.js +0 -264
  681. package/dist/cli/simple-commands/start-wrapper.js.map +0 -1
  682. package/dist/cli/simple-commands/start.d.ts +0 -2
  683. package/dist/cli/simple-commands/start.d.ts.map +0 -1
  684. package/dist/cli/simple-commands/start.js +0 -3
  685. package/dist/cli/simple-commands/start.js.map +0 -1
  686. package/dist/cli/simple-commands/status.d.ts +0 -2
  687. package/dist/cli/simple-commands/status.d.ts.map +0 -1
  688. package/dist/cli/simple-commands/status.js +0 -292
  689. package/dist/cli/simple-commands/status.js.map +0 -1
  690. package/dist/cli/simple-commands/stream-chain.d.ts +0 -7
  691. package/dist/cli/simple-commands/stream-chain.d.ts.map +0 -1
  692. package/dist/cli/simple-commands/stream-chain.js +0 -433
  693. package/dist/cli/simple-commands/stream-chain.js.map +0 -1
  694. package/dist/cli/simple-commands/stream-processor.d.ts +0 -32
  695. package/dist/cli/simple-commands/stream-processor.d.ts.map +0 -1
  696. package/dist/cli/simple-commands/stream-processor.js +0 -318
  697. package/dist/cli/simple-commands/stream-processor.js.map +0 -1
  698. package/dist/cli/simple-commands/swarm-executor.d.ts +0 -68
  699. package/dist/cli/simple-commands/swarm-executor.d.ts.map +0 -1
  700. package/dist/cli/simple-commands/swarm-executor.js +0 -218
  701. package/dist/cli/simple-commands/swarm-executor.js.map +0 -1
  702. package/dist/cli/simple-commands/swarm-metrics-integration.d.ts +0 -69
  703. package/dist/cli/simple-commands/swarm-metrics-integration.d.ts.map +0 -1
  704. package/dist/cli/simple-commands/swarm-metrics-integration.js +0 -294
  705. package/dist/cli/simple-commands/swarm-metrics-integration.js.map +0 -1
  706. package/dist/cli/simple-commands/swarm-webui-integration.d.ts +0 -68
  707. package/dist/cli/simple-commands/swarm-webui-integration.d.ts.map +0 -1
  708. package/dist/cli/simple-commands/swarm-webui-integration.js +0 -265
  709. package/dist/cli/simple-commands/swarm-webui-integration.js.map +0 -1
  710. package/dist/cli/simple-commands/swarm.d.ts +0 -2
  711. package/dist/cli/simple-commands/swarm.d.ts.map +0 -1
  712. package/dist/cli/simple-commands/swarm.js +0 -2104
  713. package/dist/cli/simple-commands/swarm.js.map +0 -1
  714. package/dist/cli/simple-commands/task.d.ts +0 -2
  715. package/dist/cli/simple-commands/task.d.ts.map +0 -1
  716. package/dist/cli/simple-commands/task.js +0 -250
  717. package/dist/cli/simple-commands/task.js.map +0 -1
  718. package/dist/cli/simple-commands/token-tracker.d.ts +0 -73
  719. package/dist/cli/simple-commands/token-tracker.d.ts.map +0 -1
  720. package/dist/cli/simple-commands/token-tracker.js +0 -319
  721. package/dist/cli/simple-commands/token-tracker.js.map +0 -1
  722. package/dist/cli/simple-commands/training-pipeline.d.ts +0 -166
  723. package/dist/cli/simple-commands/training-pipeline.d.ts.map +0 -1
  724. package/dist/cli/simple-commands/training-pipeline.js +0 -760
  725. package/dist/cli/simple-commands/training-pipeline.js.map +0 -1
  726. package/dist/cli/simple-commands/training.d.ts +0 -2
  727. package/dist/cli/simple-commands/training.d.ts.map +0 -1
  728. package/dist/cli/simple-commands/training.js +0 -240
  729. package/dist/cli/simple-commands/training.js.map +0 -1
  730. package/dist/cli/simple-commands/verification-training-integration.d.ts +0 -181
  731. package/dist/cli/simple-commands/verification-training-integration.d.ts.map +0 -1
  732. package/dist/cli/simple-commands/verification-training-integration.js +0 -561
  733. package/dist/cli/simple-commands/verification-training-integration.js.map +0 -1
  734. package/dist/cli/simple-commands/verification.d.ts +0 -10
  735. package/dist/cli/simple-commands/verification.d.ts.map +0 -1
  736. package/dist/cli/simple-commands/verification.js +0 -476
  737. package/dist/cli/simple-commands/verification.js.map +0 -1
  738. package/dist/cli/simple-commands/web-server.d.ts +0 -152
  739. package/dist/cli/simple-commands/web-server.d.ts.map +0 -1
  740. package/dist/cli/simple-commands/web-server.js +0 -816
  741. package/dist/cli/simple-commands/web-server.js.map +0 -1
  742. package/dist/cli/utils/interactive-detector.d.ts +0 -25
  743. package/dist/cli/utils/interactive-detector.d.ts.map +0 -1
  744. package/dist/cli/utils/interactive-detector.js +0 -129
  745. package/dist/cli/utils/interactive-detector.js.map +0 -1
  746. package/dist/cli/utils/safe-interactive.d.ts +0 -30
  747. package/dist/cli/utils/safe-interactive.d.ts.map +0 -1
  748. package/dist/cli/utils/safe-interactive.js +0 -134
  749. package/dist/cli/utils/safe-interactive.js.map +0 -1
  750. package/dist/cli/utils.d.ts +0 -75
  751. package/dist/cli/utils.d.ts.map +0 -1
  752. package/dist/cli/utils.js +0 -567
  753. package/dist/cli/utils.js.map +0 -1
  754. package/dist/config/config-manager.d.ts +0 -212
  755. package/dist/config/config-manager.d.ts.map +0 -1
  756. package/dist/config/config-manager.js +0 -550
  757. package/dist/config/config-manager.js.map +0 -1
  758. package/dist/constants/agent-types.d.ts +0 -57
  759. package/dist/constants/agent-types.d.ts.map +0 -1
  760. package/dist/constants/agent-types.js +0 -57
  761. package/dist/constants/agent-types.js.map +0 -1
  762. package/dist/coordination/advanced-scheduler.d.ts +0 -121
  763. package/dist/coordination/advanced-scheduler.d.ts.map +0 -1
  764. package/dist/coordination/advanced-scheduler.js +0 -382
  765. package/dist/coordination/advanced-scheduler.js.map +0 -1
  766. package/dist/coordination/background-executor.d.ts +0 -69
  767. package/dist/coordination/background-executor.d.ts.map +0 -1
  768. package/dist/coordination/background-executor.js +0 -363
  769. package/dist/coordination/background-executor.js.map +0 -1
  770. package/dist/coordination/circuit-breaker.d.ts +0 -124
  771. package/dist/coordination/circuit-breaker.d.ts.map +0 -1
  772. package/dist/coordination/circuit-breaker.js +0 -301
  773. package/dist/coordination/circuit-breaker.js.map +0 -1
  774. package/dist/coordination/conflict-resolution.d.ts +0 -133
  775. package/dist/coordination/conflict-resolution.d.ts.map +0 -1
  776. package/dist/coordination/conflict-resolution.js +0 -360
  777. package/dist/coordination/conflict-resolution.js.map +0 -1
  778. package/dist/coordination/dependency-graph.d.ts +0 -78
  779. package/dist/coordination/dependency-graph.d.ts.map +0 -1
  780. package/dist/coordination/dependency-graph.js +0 -387
  781. package/dist/coordination/dependency-graph.js.map +0 -1
  782. package/dist/coordination/manager.d.ts +0 -66
  783. package/dist/coordination/manager.d.ts.map +0 -1
  784. package/dist/coordination/manager.js +0 -354
  785. package/dist/coordination/manager.js.map +0 -1
  786. package/dist/coordination/messaging.d.ts +0 -37
  787. package/dist/coordination/messaging.d.ts.map +0 -1
  788. package/dist/coordination/messaging.js +0 -219
  789. package/dist/coordination/messaging.js.map +0 -1
  790. package/dist/coordination/metrics.d.ts +0 -153
  791. package/dist/coordination/metrics.d.ts.map +0 -1
  792. package/dist/coordination/metrics.js +0 -436
  793. package/dist/coordination/metrics.js.map +0 -1
  794. package/dist/coordination/resources.d.ts +0 -36
  795. package/dist/coordination/resources.d.ts.map +0 -1
  796. package/dist/coordination/resources.js +0 -254
  797. package/dist/coordination/resources.js.map +0 -1
  798. package/dist/coordination/scheduler.d.ts +0 -48
  799. package/dist/coordination/scheduler.d.ts.map +0 -1
  800. package/dist/coordination/scheduler.js +0 -308
  801. package/dist/coordination/scheduler.js.map +0 -1
  802. package/dist/coordination/swarm-coordinator.d.ts +0 -116
  803. package/dist/coordination/swarm-coordinator.d.ts.map +0 -1
  804. package/dist/coordination/swarm-coordinator.js +0 -563
  805. package/dist/coordination/swarm-coordinator.js.map +0 -1
  806. package/dist/coordination/swarm-monitor.d.ts +0 -101
  807. package/dist/coordination/swarm-monitor.d.ts.map +0 -1
  808. package/dist/coordination/swarm-monitor.js +0 -340
  809. package/dist/coordination/swarm-monitor.js.map +0 -1
  810. package/dist/coordination/work-stealing.d.ts +0 -44
  811. package/dist/coordination/work-stealing.d.ts.map +0 -1
  812. package/dist/coordination/work-stealing.js +0 -158
  813. package/dist/coordination/work-stealing.js.map +0 -1
  814. package/dist/core/config.d.ts +0 -243
  815. package/dist/core/config.d.ts.map +0 -1
  816. package/dist/core/config.js +0 -1125
  817. package/dist/core/config.js.map +0 -1
  818. package/dist/core/event-bus.d.ts +0 -63
  819. package/dist/core/event-bus.d.ts.map +0 -1
  820. package/dist/core/event-bus.js +0 -153
  821. package/dist/core/event-bus.js.map +0 -1
  822. package/dist/core/json-persistence.d.ts +0 -55
  823. package/dist/core/json-persistence.d.ts.map +0 -1
  824. package/dist/core/json-persistence.js +0 -111
  825. package/dist/core/json-persistence.js.map +0 -1
  826. package/dist/core/logger.d.ts +0 -62
  827. package/dist/core/logger.d.ts.map +0 -1
  828. package/dist/core/logger.js +0 -252
  829. package/dist/core/logger.js.map +0 -1
  830. package/dist/core/orchestrator-fixed.d.ts +0 -81
  831. package/dist/core/orchestrator-fixed.d.ts.map +0 -1
  832. package/dist/core/orchestrator-fixed.js +0 -213
  833. package/dist/core/orchestrator-fixed.js.map +0 -1
  834. package/dist/core/orchestrator.d.ts +0 -141
  835. package/dist/core/orchestrator.d.ts.map +0 -1
  836. package/dist/core/orchestrator.js +0 -1166
  837. package/dist/core/orchestrator.js.map +0 -1
  838. package/dist/core/version.d.ts +0 -10
  839. package/dist/core/version.d.ts.map +0 -1
  840. package/dist/core/version.js +0 -36
  841. package/dist/core/version.js.map +0 -1
  842. package/dist/enterprise/analytics-manager.d.ts +0 -489
  843. package/dist/enterprise/analytics-manager.d.ts.map +0 -1
  844. package/dist/enterprise/analytics-manager.js +0 -956
  845. package/dist/enterprise/analytics-manager.js.map +0 -1
  846. package/dist/enterprise/audit-manager.d.ts +0 -459
  847. package/dist/enterprise/audit-manager.d.ts.map +0 -1
  848. package/dist/enterprise/audit-manager.js +0 -1014
  849. package/dist/enterprise/audit-manager.js.map +0 -1
  850. package/dist/enterprise/cloud-manager.d.ts +0 -435
  851. package/dist/enterprise/cloud-manager.d.ts.map +0 -1
  852. package/dist/enterprise/cloud-manager.js +0 -789
  853. package/dist/enterprise/cloud-manager.js.map +0 -1
  854. package/dist/enterprise/deployment-manager.d.ts +0 -328
  855. package/dist/enterprise/deployment-manager.d.ts.map +0 -1
  856. package/dist/enterprise/deployment-manager.js +0 -830
  857. package/dist/enterprise/deployment-manager.js.map +0 -1
  858. package/dist/enterprise/project-manager.d.ts +0 -228
  859. package/dist/enterprise/project-manager.d.ts.map +0 -1
  860. package/dist/enterprise/project-manager.js +0 -537
  861. package/dist/enterprise/project-manager.js.map +0 -1
  862. package/dist/enterprise/security-manager.d.ts +0 -422
  863. package/dist/enterprise/security-manager.d.ts.map +0 -1
  864. package/dist/enterprise/security-manager.js +0 -910
  865. package/dist/enterprise/security-manager.js.map +0 -1
  866. package/dist/execution/agent-executor.d.ts +0 -80
  867. package/dist/execution/agent-executor.d.ts.map +0 -1
  868. package/dist/execution/agent-executor.js +0 -220
  869. package/dist/execution/agent-executor.js.map +0 -1
  870. package/dist/execution/provider-manager.d.ts +0 -65
  871. package/dist/execution/provider-manager.d.ts.map +0 -1
  872. package/dist/execution/provider-manager.js +0 -144
  873. package/dist/execution/provider-manager.js.map +0 -1
  874. package/dist/hive-mind/core/Agent.d.ts +0 -137
  875. package/dist/hive-mind/core/Agent.d.ts.map +0 -1
  876. package/dist/hive-mind/core/Agent.js +0 -567
  877. package/dist/hive-mind/core/Agent.js.map +0 -1
  878. package/dist/hive-mind/core/Communication.d.ts +0 -116
  879. package/dist/hive-mind/core/Communication.d.ts.map +0 -1
  880. package/dist/hive-mind/core/Communication.js +0 -407
  881. package/dist/hive-mind/core/Communication.js.map +0 -1
  882. package/dist/hive-mind/core/DatabaseManager.d.ts +0 -99
  883. package/dist/hive-mind/core/DatabaseManager.d.ts.map +0 -1
  884. package/dist/hive-mind/core/DatabaseManager.js +0 -648
  885. package/dist/hive-mind/core/DatabaseManager.js.map +0 -1
  886. package/dist/hive-mind/core/HiveMind.d.ts +0 -90
  887. package/dist/hive-mind/core/HiveMind.d.ts.map +0 -1
  888. package/dist/hive-mind/core/HiveMind.js +0 -455
  889. package/dist/hive-mind/core/HiveMind.js.map +0 -1
  890. package/dist/hive-mind/core/Memory.d.ts +0 -235
  891. package/dist/hive-mind/core/Memory.d.ts.map +0 -1
  892. package/dist/hive-mind/core/Memory.js +0 -1192
  893. package/dist/hive-mind/core/Memory.js.map +0 -1
  894. package/dist/hive-mind/core/Queen.d.ts +0 -115
  895. package/dist/hive-mind/core/Queen.d.ts.map +0 -1
  896. package/dist/hive-mind/core/Queen.js +0 -649
  897. package/dist/hive-mind/core/Queen.js.map +0 -1
  898. package/dist/hive-mind/integration/ConsensusEngine.d.ts +0 -117
  899. package/dist/hive-mind/integration/ConsensusEngine.d.ts.map +0 -1
  900. package/dist/hive-mind/integration/ConsensusEngine.js +0 -478
  901. package/dist/hive-mind/integration/ConsensusEngine.js.map +0 -1
  902. package/dist/hive-mind/integration/MCPToolWrapper.d.ts +0 -172
  903. package/dist/hive-mind/integration/MCPToolWrapper.d.ts.map +0 -1
  904. package/dist/hive-mind/integration/MCPToolWrapper.js +0 -217
  905. package/dist/hive-mind/integration/MCPToolWrapper.js.map +0 -1
  906. package/dist/hive-mind/integration/SwarmOrchestrator.d.ts +0 -172
  907. package/dist/hive-mind/integration/SwarmOrchestrator.d.ts.map +0 -1
  908. package/dist/hive-mind/integration/SwarmOrchestrator.js +0 -748
  909. package/dist/hive-mind/integration/SwarmOrchestrator.js.map +0 -1
  910. package/dist/hive-mind/types.d.ts +0 -314
  911. package/dist/hive-mind/types.d.ts.map +0 -1
  912. package/dist/hive-mind/types.js +0 -7
  913. package/dist/hive-mind/types.js.map +0 -1
  914. package/dist/mcp/auth.d.ts +0 -80
  915. package/dist/mcp/auth.d.ts.map +0 -1
  916. package/dist/mcp/auth.js +0 -350
  917. package/dist/mcp/auth.js.map +0 -1
  918. package/dist/mcp/claude-flow-tools.d.ts +0 -13
  919. package/dist/mcp/claude-flow-tools.d.ts.map +0 -1
  920. package/dist/mcp/claude-flow-tools.js +0 -1398
  921. package/dist/mcp/claude-flow-tools.js.map +0 -1
  922. package/dist/mcp/load-balancer.d.ts +0 -88
  923. package/dist/mcp/load-balancer.d.ts.map +0 -1
  924. package/dist/mcp/load-balancer.js +0 -393
  925. package/dist/mcp/load-balancer.js.map +0 -1
  926. package/dist/mcp/router.d.ts +0 -54
  927. package/dist/mcp/router.d.ts.map +0 -1
  928. package/dist/mcp/router.js +0 -204
  929. package/dist/mcp/router.js.map +0 -1
  930. package/dist/mcp/ruv-swarm-tools.d.ts +0 -58
  931. package/dist/mcp/ruv-swarm-tools.d.ts.map +0 -1
  932. package/dist/mcp/ruv-swarm-tools.js +0 -568
  933. package/dist/mcp/ruv-swarm-tools.js.map +0 -1
  934. package/dist/mcp/server.d.ts +0 -75
  935. package/dist/mcp/server.d.ts.map +0 -1
  936. package/dist/mcp/server.js +0 -538
  937. package/dist/mcp/server.js.map +0 -1
  938. package/dist/mcp/session-manager.d.ts +0 -60
  939. package/dist/mcp/session-manager.d.ts.map +0 -1
  940. package/dist/mcp/session-manager.js +0 -323
  941. package/dist/mcp/session-manager.js.map +0 -1
  942. package/dist/mcp/swarm-tools.d.ts +0 -87
  943. package/dist/mcp/swarm-tools.d.ts.map +0 -1
  944. package/dist/mcp/swarm-tools.js +0 -731
  945. package/dist/mcp/swarm-tools.js.map +0 -1
  946. package/dist/mcp/tools.d.ts +0 -145
  947. package/dist/mcp/tools.d.ts.map +0 -1
  948. package/dist/mcp/tools.js +0 -434
  949. package/dist/mcp/tools.js.map +0 -1
  950. package/dist/mcp/transports/base.d.ts +0 -22
  951. package/dist/mcp/transports/base.d.ts.map +0 -1
  952. package/dist/mcp/transports/base.js +0 -5
  953. package/dist/mcp/transports/base.js.map +0 -1
  954. package/dist/mcp/transports/http.d.ts +0 -48
  955. package/dist/mcp/transports/http.d.ts.map +0 -1
  956. package/dist/mcp/transports/http.js +0 -400
  957. package/dist/mcp/transports/http.js.map +0 -1
  958. package/dist/mcp/transports/stdio.d.ts +0 -37
  959. package/dist/mcp/transports/stdio.d.ts.map +0 -1
  960. package/dist/mcp/transports/stdio.js +0 -206
  961. package/dist/mcp/transports/stdio.js.map +0 -1
  962. package/dist/memory/advanced-serializer.d.ts +0 -159
  963. package/dist/memory/advanced-serializer.d.ts.map +0 -1
  964. package/dist/memory/advanced-serializer.js +0 -564
  965. package/dist/memory/advanced-serializer.js.map +0 -1
  966. package/dist/memory/backends/base.d.ts +0 -21
  967. package/dist/memory/backends/base.d.ts.map +0 -1
  968. package/dist/memory/backends/base.js +0 -5
  969. package/dist/memory/backends/base.js.map +0 -1
  970. package/dist/memory/backends/markdown.d.ts +0 -35
  971. package/dist/memory/backends/markdown.d.ts.map +0 -1
  972. package/dist/memory/backends/markdown.js +0 -223
  973. package/dist/memory/backends/markdown.js.map +0 -1
  974. package/dist/memory/backends/sqlite.d.ts +0 -33
  975. package/dist/memory/backends/sqlite.d.ts.map +0 -1
  976. package/dist/memory/backends/sqlite.js +0 -291
  977. package/dist/memory/backends/sqlite.js.map +0 -1
  978. package/dist/memory/cache.d.ts +0 -65
  979. package/dist/memory/cache.d.ts.map +0 -1
  980. package/dist/memory/cache.js +0 -188
  981. package/dist/memory/cache.js.map +0 -1
  982. package/dist/memory/distributed-memory.d.ts +0 -188
  983. package/dist/memory/distributed-memory.d.ts.map +0 -1
  984. package/dist/memory/distributed-memory.js +0 -710
  985. package/dist/memory/distributed-memory.js.map +0 -1
  986. package/dist/memory/enhanced-session-serializer.d.ts +0 -115
  987. package/dist/memory/enhanced-session-serializer.d.ts.map +0 -1
  988. package/dist/memory/enhanced-session-serializer.js +0 -478
  989. package/dist/memory/enhanced-session-serializer.js.map +0 -1
  990. package/dist/memory/fallback-store.d.ts +0 -28
  991. package/dist/memory/fallback-store.d.ts.map +0 -1
  992. package/dist/memory/fallback-store.js +0 -101
  993. package/dist/memory/fallback-store.js.map +0 -1
  994. package/dist/memory/in-memory-store.d.ts +0 -37
  995. package/dist/memory/in-memory-store.d.ts.map +0 -1
  996. package/dist/memory/in-memory-store.js +0 -174
  997. package/dist/memory/in-memory-store.js.map +0 -1
  998. package/dist/memory/indexer.d.ts +0 -52
  999. package/dist/memory/indexer.d.ts.map +0 -1
  1000. package/dist/memory/indexer.js +0 -191
  1001. package/dist/memory/indexer.js.map +0 -1
  1002. package/dist/memory/manager.d.ts +0 -58
  1003. package/dist/memory/manager.d.ts.map +0 -1
  1004. package/dist/memory/manager.js +0 -423
  1005. package/dist/memory/manager.js.map +0 -1
  1006. package/dist/memory/sqlite-store.d.ts +0 -34
  1007. package/dist/memory/sqlite-store.d.ts.map +0 -1
  1008. package/dist/memory/sqlite-store.js +0 -268
  1009. package/dist/memory/sqlite-store.js.map +0 -1
  1010. package/dist/memory/sqlite-wrapper.d.ts +0 -38
  1011. package/dist/memory/sqlite-wrapper.d.ts.map +0 -1
  1012. package/dist/memory/sqlite-wrapper.js +0 -152
  1013. package/dist/memory/sqlite-wrapper.js.map +0 -1
  1014. package/dist/memory/swarm-memory.d.ts +0 -91
  1015. package/dist/memory/swarm-memory.d.ts.map +0 -1
  1016. package/dist/memory/swarm-memory.js +0 -454
  1017. package/dist/memory/swarm-memory.js.map +0 -1
  1018. package/dist/memory/unified-memory-manager.d.ts +0 -116
  1019. package/dist/memory/unified-memory-manager.d.ts.map +0 -1
  1020. package/dist/memory/unified-memory-manager.js +0 -397
  1021. package/dist/memory/unified-memory-manager.js.map +0 -1
  1022. package/dist/migration/logger.d.ts +0 -26
  1023. package/dist/migration/logger.d.ts.map +0 -1
  1024. package/dist/migration/logger.js +0 -145
  1025. package/dist/migration/logger.js.map +0 -1
  1026. package/dist/migration/migration-analyzer.d.ts +0 -18
  1027. package/dist/migration/migration-analyzer.d.ts.map +0 -1
  1028. package/dist/migration/migration-analyzer.js +0 -284
  1029. package/dist/migration/migration-analyzer.js.map +0 -1
  1030. package/dist/migration/migration-runner.d.ts +0 -26
  1031. package/dist/migration/migration-runner.d.ts.map +0 -1
  1032. package/dist/migration/migration-runner.js +0 -505
  1033. package/dist/migration/migration-runner.js.map +0 -1
  1034. package/dist/migration/migration-validator.d.ts +0 -17
  1035. package/dist/migration/migration-validator.d.ts.map +0 -1
  1036. package/dist/migration/migration-validator.js +0 -309
  1037. package/dist/migration/migration-validator.js.map +0 -1
  1038. package/dist/migration/progress-reporter.d.ts +0 -28
  1039. package/dist/migration/progress-reporter.d.ts.map +0 -1
  1040. package/dist/migration/progress-reporter.js +0 -163
  1041. package/dist/migration/progress-reporter.js.map +0 -1
  1042. package/dist/migration/rollback-manager.d.ts +0 -24
  1043. package/dist/migration/rollback-manager.d.ts.map +0 -1
  1044. package/dist/migration/rollback-manager.js +0 -351
  1045. package/dist/migration/rollback-manager.js.map +0 -1
  1046. package/dist/migration/types.d.ts +0 -103
  1047. package/dist/migration/types.d.ts.map +0 -1
  1048. package/dist/migration/types.js +0 -6
  1049. package/dist/migration/types.js.map +0 -1
  1050. package/dist/reasoningbank/reasoningbank-adapter.d.ts +0 -93
  1051. package/dist/reasoningbank/reasoningbank-adapter.d.ts.map +0 -1
  1052. package/dist/reasoningbank/reasoningbank-adapter.js +0 -365
  1053. package/dist/reasoningbank/reasoningbank-adapter.js.map +0 -1
  1054. package/dist/sdk/query-control.d.ts +0 -131
  1055. package/dist/sdk/query-control.d.ts.map +0 -1
  1056. package/dist/sdk/query-control.js +0 -363
  1057. package/dist/sdk/query-control.js.map +0 -1
  1058. package/dist/sdk/session-forking.d.ts +0 -109
  1059. package/dist/sdk/session-forking.d.ts.map +0 -1
  1060. package/dist/sdk/session-forking.js +0 -275
  1061. package/dist/sdk/session-forking.js.map +0 -1
  1062. package/dist/swarm/types.d.ts +0 -578
  1063. package/dist/swarm/types.d.ts.map +0 -1
  1064. package/dist/swarm/types.js +0 -54
  1065. package/dist/swarm/types.js.map +0 -1
  1066. package/dist/terminal/adapters/base.d.ts +0 -40
  1067. package/dist/terminal/adapters/base.d.ts.map +0 -1
  1068. package/dist/terminal/adapters/base.js +0 -5
  1069. package/dist/terminal/adapters/base.js.map +0 -1
  1070. package/dist/terminal/adapters/native.d.ts +0 -19
  1071. package/dist/terminal/adapters/native.d.ts.map +0 -1
  1072. package/dist/terminal/adapters/native.js +0 -414
  1073. package/dist/terminal/adapters/native.js.map +0 -1
  1074. package/dist/terminal/adapters/vscode.d.ts +0 -23
  1075. package/dist/terminal/adapters/vscode.d.ts.map +0 -1
  1076. package/dist/terminal/adapters/vscode.js +0 -267
  1077. package/dist/terminal/adapters/vscode.js.map +0 -1
  1078. package/dist/terminal/manager.d.ts +0 -59
  1079. package/dist/terminal/manager.d.ts.map +0 -1
  1080. package/dist/terminal/manager.js +0 -235
  1081. package/dist/terminal/manager.js.map +0 -1
  1082. package/dist/terminal/pool.d.ts +0 -32
  1083. package/dist/terminal/pool.d.ts.map +0 -1
  1084. package/dist/terminal/pool.js +0 -208
  1085. package/dist/terminal/pool.js.map +0 -1
  1086. package/dist/terminal/session.d.ts +0 -41
  1087. package/dist/terminal/session.d.ts.map +0 -1
  1088. package/dist/terminal/session.js +0 -210
  1089. package/dist/terminal/session.js.map +0 -1
  1090. package/dist/utils/error-handler.d.ts +0 -14
  1091. package/dist/utils/error-handler.d.ts.map +0 -1
  1092. package/dist/utils/error-handler.js +0 -29
  1093. package/dist/utils/error-handler.js.map +0 -1
  1094. package/dist/utils/errors.d.ts +0 -121
  1095. package/dist/utils/errors.d.ts.map +0 -1
  1096. package/dist/utils/errors.js +0 -194
  1097. package/dist/utils/errors.js.map +0 -1
  1098. package/dist/utils/formatters.d.ts +0 -15
  1099. package/dist/utils/formatters.d.ts.map +0 -1
  1100. package/dist/utils/formatters.js +0 -75
  1101. package/dist/utils/formatters.js.map +0 -1
  1102. package/dist/utils/helpers.d.ts +0 -134
  1103. package/dist/utils/helpers.d.ts.map +0 -1
  1104. package/dist/utils/helpers.js +0 -444
  1105. package/dist/utils/helpers.js.map +0 -1
  1106. package/dist/utils/key-redactor.d.ts +0 -46
  1107. package/dist/utils/key-redactor.d.ts.map +0 -1
  1108. package/dist/utils/key-redactor.js +0 -153
  1109. package/dist/utils/key-redactor.js.map +0 -1
  1110. package/dist/utils/metrics-reader.d.ts +0 -67
  1111. package/dist/utils/metrics-reader.d.ts.map +0 -1
  1112. package/dist/utils/metrics-reader.js +0 -201
  1113. package/dist/utils/metrics-reader.js.map +0 -1
  1114. package/dist/utils/npx-isolated-cache.d.ts +0 -17
  1115. package/dist/utils/npx-isolated-cache.d.ts.map +0 -1
  1116. package/dist/utils/npx-isolated-cache.js +0 -140
  1117. package/dist/utils/npx-isolated-cache.js.map +0 -1
  1118. package/dist/utils/project-root.d.ts +0 -35
  1119. package/dist/utils/project-root.d.ts.map +0 -1
  1120. package/dist/utils/project-root.js +0 -115
  1121. package/dist/utils/project-root.js.map +0 -1
  1122. package/dist/utils/type-guards.d.ts +0 -117
  1123. package/dist/utils/type-guards.d.ts.map +0 -1
  1124. package/dist/utils/type-guards.js +0 -166
  1125. package/dist/utils/type-guards.js.map +0 -1
  1126. package/dist/utils/types.d.ts +0 -568
  1127. package/dist/utils/types.d.ts.map +0 -1
  1128. package/dist/utils/types.js +0 -37
  1129. package/dist/utils/types.js.map +0 -1
  1130. /package/docs/{COMMANDS_TO_SKILLS_MIGRATION.md → development/COMMANDS_TO_SKILLS_MIGRATION.md} +0 -0
  1131. /package/docs/{FINAL_INIT_STRUCTURE.md → development/FINAL_INIT_STRUCTURE.md} +0 -0
  1132. /package/docs/{CLI-MEMORY-COMMANDS-WORKING.md → fixes/CLI-MEMORY-COMMANDS-WORKING.md} +0 -0
  1133. /package/docs/{PERFORMANCE-JSON-IMPROVEMENTS.md → performance/PERFORMANCE-JSON-IMPROVEMENTS.md} +0 -0
  1134. /package/docs/{PERFORMANCE-METRICS-GUIDE.md → performance/PERFORMANCE-METRICS-GUIDE.md} +0 -0
  1135. /package/docs/{RELEASE-NOTES-v2.7.0-alpha.9.md → releases/v2.7.0-alpha.9/RELEASE-NOTES-v2.7.0-alpha.9.md} +0 -0
@@ -1,2104 +0,0 @@
1
- /**
2
- * Swarm command wrapper for simple CLI
3
- */
4
- import { args, mkdirAsync, writeTextFile, exit, cwd } from '../node-compat.js';
5
- import { spawn, execSync } from 'child_process';
6
- import { existsSync, chmodSync, statSync, readFileSync } from 'fs';
7
- import { open } from 'fs/promises';
8
- import process from 'process';
9
- import path from 'path';
10
- /**
11
- * Detects if the environment is headless (non-interactive)
12
- */
13
- function isHeadlessEnvironment() {
14
- // Check for common CI environment variables
15
- const ciEnvironments = [
16
- 'CI',
17
- 'GITHUB_ACTIONS',
18
- 'GITLAB_CI',
19
- 'JENKINS_URL',
20
- 'CIRCLECI',
21
- 'TRAVIS',
22
- 'BUILDKITE',
23
- 'DRONE',
24
- 'DOCKER_CONTAINER',
25
- ];
26
- const isCI = ciEnvironments.some(env => process.env[env]);
27
- // Check if running in Docker
28
- let isDocker = existsSync('/.dockerenv');
29
- // Additional Docker check for cgroup
30
- if (!isDocker && existsSync('/proc/1/cgroup')) {
31
- try {
32
- const cgroupContent = readFileSync('/proc/1/cgroup', 'utf8');
33
- isDocker = cgroupContent.includes('docker');
34
- }
35
- catch {
36
- // Ignore read errors
37
- }
38
- }
39
- // Check TTY availability
40
- const hasTTY = process.stdin.isTTY && process.stdout.isTTY;
41
- return isCI || isDocker || !hasTTY;
42
- }
43
- /**
44
- * Basic swarm implementation for fallback scenarios
45
- */
46
- async function basicSwarmNew(args, flags) {
47
- const objective = (args || []).join(' ').trim();
48
- if (!objective) {
49
- console.error('❌ Usage: swarm <objective>');
50
- showSwarmHelp();
51
- return;
52
- }
53
- const isHeadless = isHeadlessEnvironment();
54
- // Configure for headless mode
55
- if (isHeadless) {
56
- console.log('🤖 Headless environment detected - running in non-interactive mode');
57
- flags = {
58
- ...flags,
59
- 'non-interactive': true,
60
- 'output-format': flags['output-format'] || 'stream-json', // Use stream-json for Claude compatibility
61
- 'no-auto-permissions': false,
62
- };
63
- }
64
- // Set up graceful shutdown handlers
65
- const cleanup = () => {
66
- console.log('\n🛑 Shutting down swarm gracefully...');
67
- process.exit(0);
68
- };
69
- process.on('SIGTERM', cleanup);
70
- process.on('SIGINT', cleanup);
71
- try {
72
- // Try to use the swarm executor
73
- const { executeSwarm } = await import('./swarm-executor.js');
74
- console.log(`🐝 Starting basic swarm execution...`);
75
- console.log(`📋 Objective: ${objective}`);
76
- console.log(`🎯 Strategy: ${flags.strategy || 'auto'}`);
77
- console.log(`🏗️ Mode: ${flags.mode || 'centralized'}`);
78
- console.log(`🤖 Max Agents: ${flags['max-agents'] || 5}`);
79
- if (isHeadless) {
80
- console.log(`🖥️ Headless Mode: Enabled`);
81
- console.log(`📄 Output Format: ${flags['output-format']}`);
82
- }
83
- const result = await executeSwarm(objective, flags);
84
- // Handle output based on format
85
- if (flags['output-format'] === 'json') {
86
- // In JSON mode, output clean JSON
87
- const output = {
88
- success: result.success,
89
- swarmId: result.summary?.swarmId,
90
- objective: objective,
91
- duration: result.summary?.duration,
92
- agents: result.summary?.totalAgents,
93
- tasks: result.summary?.totalTasks,
94
- timestamp: new Date().toISOString(),
95
- };
96
- if (flags['output-file']) {
97
- const fs = await import('fs/promises');
98
- await fs.writeFile(flags['output-file'], JSON.stringify(output, null, 2));
99
- console.log(`✅ Output saved to: ${flags['output-file']}`);
100
- }
101
- else {
102
- console.log(JSON.stringify(output, null, 2));
103
- }
104
- }
105
- else {
106
- // Text mode output
107
- if (result.success) {
108
- console.log(`\n✅ Swarm execution completed successfully!`);
109
- if (result.summary) {
110
- console.log(` Duration: ${result.summary.duration}`);
111
- console.log(` Agents: ${result.summary.totalAgents}`);
112
- console.log(` Tasks: ${result.summary.totalTasks}`);
113
- }
114
- }
115
- else {
116
- console.error(`\n❌ Swarm execution failed: ${result.error}`);
117
- }
118
- }
119
- return result;
120
- }
121
- catch (error) {
122
- console.error(`❌ Basic swarm execution error: ${error.message}`);
123
- // In headless mode, ensure we output JSON error
124
- if (flags['output-format'] === 'json') {
125
- const errorOutput = {
126
- success: false,
127
- error: error.message,
128
- timestamp: new Date().toISOString(),
129
- };
130
- console.log(JSON.stringify(errorOutput, null, 2));
131
- }
132
- throw error;
133
- }
134
- }
135
- function showSwarmHelp() {
136
- console.log(`
137
- 🐝 Claude Flow Advanced Swarm System
138
-
139
- USAGE:
140
- claude-flow swarm <objective> [options]
141
-
142
- EXAMPLES:
143
- claude-flow swarm "Build a REST API with authentication"
144
- claude-flow swarm "Research cloud architecture patterns" --strategy research
145
- claude-flow swarm "Analyze database performance" --max-agents 3 --parallel
146
- claude-flow swarm "Develop user registration feature" --mode distributed
147
- claude-flow swarm "Optimize React app performance" --strategy optimization
148
- claude-flow swarm "Create microservice" --executor # Use built-in executor
149
- claude-flow swarm "Build API" --claude # Open Claude Code CLI
150
- claude-flow swarm "Build API endpoints" --output-format json # Get JSON output
151
- claude-flow swarm "Research AI trends" --output-format json --output-file results.json
152
-
153
- DEFAULT BEHAVIOR:
154
- Swarm attempts to open Claude Code CLI with comprehensive MCP tool instructions
155
- including memory coordination, agent management, and task orchestration.
156
-
157
- If Claude CLI is not available:
158
- • Use --claude flag to open Claude Code CLI
159
- • Use --executor flag to run with the built-in executor
160
-
161
- STRATEGIES:
162
- auto Automatically determine best approach (default)
163
- research Research and information gathering
164
- development Software development and coding
165
- analysis Data analysis and insights
166
- testing Testing and quality assurance
167
- optimization Performance optimization
168
- maintenance System maintenance
169
-
170
- MODES:
171
- centralized Single coordinator (default)
172
- distributed Multiple coordinators
173
- hierarchical Tree structure coordination
174
- mesh Peer-to-peer coordination
175
- hybrid Mixed coordination strategies
176
-
177
- KEY FEATURES:
178
- 🤖 Intelligent agent management with specialized types
179
- ⚡ Timeout-free background task execution
180
- 🧠 Distributed memory sharing between agents
181
- 🔄 Work stealing and advanced load balancing
182
- 🛡️ Circuit breaker patterns for fault tolerance
183
- 📊 Real-time monitoring and comprehensive metrics
184
- 🎛️ Multiple coordination strategies and algorithms
185
- 💾 Persistent state with backup and recovery
186
- 🔒 Security features with encryption options
187
- 🖥️ Interactive terminal UI for management
188
-
189
- OPTIONS:
190
- --strategy <type> Execution strategy (default: auto)
191
- --mode <type> Coordination mode (default: centralized)
192
- --max-agents <n> Maximum agents (default: 5)
193
- --timeout <minutes> Timeout in minutes (default: 60)
194
- --task-timeout-minutes <n> Task execution timeout in minutes (default: 59)
195
- --parallel Enable parallel execution
196
- --distributed Enable distributed coordination
197
- --monitor Enable real-time monitoring
198
- --ui Launch terminal UI interface
199
- --background Run in background mode
200
- --review Enable peer review
201
- --testing Enable automated testing
202
- --encryption Enable encryption
203
- --verbose Enable detailed logging
204
- --dry-run Show configuration without executing
205
- --executor Use built-in executor instead of Claude Code
206
- --claude Open Claude Code CLI
207
- --output-format <format> Output format: json, text (default: text)
208
- --output-file <path> Save output to file instead of stdout
209
- --no-interactive Run in non-interactive mode (auto-enabled with --output-format json)
210
- --auto (Deprecated: auto-permissions enabled by default)
211
- --no-auto-permissions Disable automatic --dangerously-skip-permissions
212
- --analysis Enable analysis/read-only mode (no code changes)
213
- --read-only Enable read-only mode (alias for --analysis)
214
-
215
- ADVANCED OPTIONS:
216
- --quality-threshold <n> Quality threshold 0-1 (default: 0.8)
217
- --memory-namespace <name> Memory namespace (default: swarm)
218
- --agent-selection <type> Agent selection strategy
219
- --task-scheduling <type> Task scheduling algorithm
220
- --load-balancing <type> Load balancing method
221
- --fault-tolerance <type> Fault tolerance strategy
222
- --headless Force headless mode for CI/Docker environments
223
- --health-check Perform health check and exit (for Docker health)
224
- --json-logs Output all logs in JSON format for log aggregation
225
-
226
- HEADLESS MODE:
227
- Automatically detected and enabled when running in:
228
- - CI/CD environments (GitHub Actions, GitLab CI, Jenkins, etc.)
229
- - Docker containers without TTY
230
- - Non-interactive shells (no stdin/stdout TTY)
231
-
232
- In headless mode:
233
- - Output defaults to JSON format
234
- - Non-interactive mode is enabled
235
- - Graceful shutdown on SIGTERM/SIGINT
236
- - Suitable for containerized deployments
237
-
238
- For complete documentation and examples:
239
- https://github.com/ruvnet/claude-code-flow/docs/swarm.md
240
- `);
241
- }
242
- export async function swarmCommand(args, flags) {
243
- // Handle headless mode early
244
- if (flags && flags.headless) {
245
- const isHeadless = isHeadlessEnvironment();
246
- // Configure for headless mode
247
- flags = {
248
- ...flags,
249
- 'non-interactive': true,
250
- 'output-format': flags['output-format'] || 'stream-json',
251
- 'no-auto-permissions': false,
252
- };
253
- }
254
- // Handle health check first
255
- if (flags && flags['health-check']) {
256
- try {
257
- // Quick health check for Docker/K8s
258
- console.log(JSON.stringify({
259
- status: 'healthy',
260
- service: 'claude-flow-swarm',
261
- version: process.env.npm_package_version || '2.0.0',
262
- timestamp: new Date().toISOString()
263
- }));
264
- process.exit(0);
265
- }
266
- catch (error) {
267
- console.error(JSON.stringify({
268
- status: 'unhealthy',
269
- error: error.message,
270
- timestamp: new Date().toISOString()
271
- }));
272
- process.exit(1);
273
- }
274
- }
275
- const objective = (args || []).join(' ').trim();
276
- if (!objective) {
277
- console.error('❌ Usage: swarm <objective>');
278
- showSwarmHelp();
279
- return;
280
- }
281
- // Force headless mode if flag is set
282
- if (flags && flags.headless) {
283
- const isHeadless = isHeadlessEnvironment();
284
- if (!isHeadless) {
285
- console.log('🤖 Forcing headless mode as requested');
286
- }
287
- flags = {
288
- ...flags,
289
- 'non-interactive': true,
290
- 'output-format': flags['output-format'] || 'json',
291
- 'no-auto-permissions': false,
292
- };
293
- }
294
- // Handle JSON output format
295
- const outputFormat = flags && flags['output-format'];
296
- const outputFile = flags && flags['output-file'];
297
- const isJsonOutput = outputFormat === 'json';
298
- const isNonInteractive = isJsonOutput || (flags && flags['no-interactive']);
299
- const useJsonLogs = flags && flags['json-logs'];
300
- // Override console.log for JSON logs if requested
301
- if (useJsonLogs) {
302
- const originalLog = console.log;
303
- const originalError = console.error;
304
- console.log = (...args) => {
305
- originalLog(JSON.stringify({
306
- level: 'info',
307
- message: args.join(' '),
308
- timestamp: new Date().toISOString(),
309
- service: 'claude-flow-swarm'
310
- }));
311
- };
312
- console.error = (...args) => {
313
- originalError(JSON.stringify({
314
- level: 'error',
315
- message: args.join(' '),
316
- timestamp: new Date().toISOString(),
317
- service: 'claude-flow-swarm'
318
- }));
319
- };
320
- }
321
- // Handle analysis/read-only mode
322
- const isAnalysisMode = flags && (flags.analysis || flags['read-only']);
323
- const analysisMode = isAnalysisMode ? 'analysis' : 'standard';
324
- // For JSON output, allow using Claude with stream-json format
325
- // Only force executor mode if explicitly using 'json' format (not 'stream-json')
326
- if (flags && flags['output-format'] === 'json' && !(flags && flags.executor)) {
327
- // Keep backward compatibility - regular 'json' format uses executor
328
- flags = { ...(flags || {}), executor: true };
329
- }
330
- // Check if we should use the old executor (opt-in with --executor flag)
331
- if (flags && flags.executor) {
332
- // Continue with the old swarm executor implementation below
333
- }
334
- else {
335
- // Default behavior: spawn Claude Code with comprehensive swarm MCP instructions
336
- try {
337
- const { execSync, spawn } = await import('child_process');
338
- // Get configuration values first
339
- const strategy = flags.strategy || 'auto';
340
- const mode = flags.mode || 'centralized';
341
- const maxAgents = flags['max-agents'] || 5;
342
- // Get strategy-specific guidance
343
- const strategyGuidance = getStrategyGuidance(strategy, objective);
344
- const modeGuidance = getModeGuidance(mode);
345
- const agentRecommendations = getAgentRecommendations(strategy, maxAgents, objective);
346
- const enableSparc = flags.sparc !== false && (strategy === 'development' || strategy === 'auto');
347
- // Build the complete swarm prompt before checking for claude
348
- const swarmPrompt = `You are orchestrating a Claude Flow Swarm using Claude Code's Task tool for agent execution.
349
-
350
- 🚨 CRITICAL INSTRUCTION: Use Claude Code's Task Tool for ALL Agent Spawning!
351
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
352
- ✅ Claude Code's Task tool = Spawns agents that DO the actual work
353
- ❌ MCP tools = Only for coordination setup, NOT for execution
354
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
355
-
356
- 🎯 OBJECTIVE: ${objective}
357
-
358
- 🐝 SWARM CONFIGURATION:
359
- - Strategy: ${strategy}
360
- - Mode: ${mode}
361
- - Max Agents: ${maxAgents}
362
- - Timeout: ${flags.timeout || 60} minutes
363
- - Parallel Execution: MANDATORY (Always use BatchTool)
364
- - Review Mode: ${flags.review || false}
365
- - Testing Mode: ${flags.testing || false}
366
- - Analysis Mode: ${isAnalysisMode ? 'ENABLED (Read-Only)' : 'DISABLED'}
367
-
368
- ${isAnalysisMode
369
- ? `🔍 ANALYSIS MODE CONSTRAINTS:
370
-
371
- ⚠️ READ-ONLY MODE ACTIVE - NO CODE MODIFICATIONS ALLOWED
372
-
373
- REQUIRED BEHAVIORS:
374
- 1. ✅ READ files for analysis (Read tool)
375
- 2. ✅ SEARCH codebases (Glob, Grep tools)
376
- 3. ✅ ANALYZE code structure and patterns
377
- 4. ✅ GENERATE reports and documentation
378
- 5. ✅ CREATE analysis summaries
379
- 6. ✅ STORE findings in memory for collaboration
380
- 7. ✅ COMMUNICATE between agents about findings
381
-
382
- FORBIDDEN OPERATIONS:
383
- 1. ❌ NEVER use Write tool to modify files
384
- 2. ❌ NEVER use Edit or MultiEdit tools
385
- 3. ❌ NEVER use Bash to run commands that modify files
386
- 4. ❌ NEVER create new files or directories
387
- 5. ❌ NEVER install packages or dependencies
388
- 6. ❌ NEVER modify configuration files
389
- 7. ❌ NEVER execute code that changes system state
390
-
391
- ALL AGENTS MUST OPERATE IN READ-ONLY MODE. Focus on:
392
- - Code analysis and understanding
393
- - Security vulnerability assessment
394
- - Performance bottleneck identification
395
- - Architecture documentation
396
- - Technical debt analysis
397
- - Dependency mapping
398
- - Testing strategy recommendations
399
-
400
- Generate comprehensive reports instead of making changes.
401
-
402
- `
403
- : ''}🚨 CRITICAL: PARALLEL EXECUTION IS MANDATORY! 🚨
404
-
405
- 📋 CLAUDE-FLOW SWARM BATCHTOOL INSTRUCTIONS
406
-
407
- ⚡ THE GOLDEN RULE:
408
- If you need to do X operations, they should be in 1 message, not X messages.
409
-
410
- 🎯 MANDATORY PATTERNS FOR CLAUDE-FLOW SWARMS:
411
-
412
- 1️⃣ **SWARM INITIALIZATION** - Use Claude Code's Task Tool for Agents:
413
-
414
- Step A: Optional MCP Coordination Setup (Single Message):
415
- \`\`\`javascript
416
- [MCP Tools - Coordination ONLY]:
417
- // Set up coordination topology (OPTIONAL)
418
- mcp__claude-flow__swarm_init {"topology": "mesh", "maxAgents": ${maxAgents}}
419
- mcp__claude-flow__agent_spawn {"type": "coordinator", "name": "SwarmLead"}
420
- mcp__claude-flow__memory_store {"key": "swarm/objective", "value": "${objective}"}
421
- mcp__claude-flow__memory_store {"key": "swarm/config", "value": {"strategy": "${strategy}"}}
422
- \`\`\`
423
-
424
- Step B: REQUIRED - Claude Code Task Tool for ACTUAL Agent Execution (Single Message):
425
- \`\`\`javascript
426
- [Claude Code Task Tool - CONCURRENT Agent Spawning]:
427
- // Spawn ALL agents using Task tool in ONE message
428
- Task("Coordinator", "Lead swarm coordination. Use hooks for memory sharing.", "coordinator")
429
- Task("Researcher", "Analyze requirements and patterns. Coordinate via hooks.", "researcher")
430
- Task("Backend Dev", "Implement server-side features. Share progress via hooks.", "coder")
431
- Task("Frontend Dev", "Build UI components. Sync with backend via memory.", "coder")
432
- Task("QA Engineer", "Create and run tests. Report findings via hooks.", "tester")
433
-
434
- // Batch ALL todos in ONE TodoWrite call (5-10+ todos)
435
- TodoWrite {"todos": [
436
- {"id": "1", "content": "Initialize ${maxAgents} agent swarm", "status": "completed", "priority": "high"},
437
- {"id": "2", "content": "Analyze: ${objective}", "status": "in_progress", "priority": "high"},
438
- {"id": "3", "content": "Design architecture", "status": "pending", "priority": "high"},
439
- {"id": "4", "content": "Implement backend", "status": "pending", "priority": "high"},
440
- {"id": "5", "content": "Implement frontend", "status": "pending", "priority": "high"},
441
- {"id": "6", "content": "Write unit tests", "status": "pending", "priority": "medium"},
442
- {"id": "7", "content": "Integration testing", "status": "pending", "priority": "medium"},
443
- {"id": "8", "content": "Performance optimization", "status": "pending", "priority": "low"},
444
- {"id": "9", "content": "Documentation", "status": "pending", "priority": "low"}
445
- ]}
446
- \`\`\`
447
-
448
- ⚠️ CRITICAL: Claude Code's Task tool does the ACTUAL work!
449
- - MCP tools = Coordination setup only
450
- - Task tool = Spawns agents that execute real work
451
- - ALL agents MUST be spawned in ONE message
452
- - ALL todos MUST be batched in ONE TodoWrite call
453
-
454
- 2️⃣ **TASK COORDINATION** - Batch ALL assignments:
455
- \`\`\`javascript
456
- [Single Message]:
457
- // Assign all tasks
458
- mcp__claude-flow__task_assign {"taskId": "research-1", "agentId": "researcher-1"}
459
- mcp__claude-flow__task_assign {"taskId": "design-1", "agentId": "architect-1"}
460
- mcp__claude-flow__task_assign {"taskId": "code-1", "agentId": "coder-1"}
461
- mcp__claude-flow__task_assign {"taskId": "code-2", "agentId": "coder-2"}
462
-
463
- // Communicate to all agents
464
- mcp__claude-flow__agent_communicate {"to": "all", "message": "Begin phase 1"}
465
-
466
- // Update multiple task statuses
467
- mcp__claude-flow__task_update {"taskId": "research-1", "status": "in_progress"}
468
- mcp__claude-flow__task_update {"taskId": "design-1", "status": "pending"}
469
- \`\`\`
470
-
471
- 3️⃣ **MEMORY COORDINATION** - Store/retrieve in batches:
472
- \`\`\`javascript
473
- [Single Message]:
474
- // Store multiple findings
475
- mcp__claude-flow__memory_store {"key": "research/requirements", "value": {...}}
476
- mcp__claude-flow__memory_store {"key": "research/constraints", "value": {...}}
477
- mcp__claude-flow__memory_store {"key": "architecture/decisions", "value": {...}}
478
-
479
- // Retrieve related data
480
- mcp__claude-flow__memory_retrieve {"key": "research/*"}
481
- mcp__claude-flow__memory_search {"pattern": "architecture"}
482
- \`\`\`
483
-
484
- 4️⃣ **FILE & CODE OPERATIONS** - Parallel execution:
485
- \`\`\`javascript
486
- [Single Message]:
487
- // Read multiple files
488
- Read {"file_path": "/src/index.js"}
489
- Read {"file_path": "/src/config.js"}
490
- Read {"file_path": "/package.json"}
491
-
492
- // Write multiple files
493
- Write {"file_path": "/src/api/auth.js", "content": "..."}
494
- Write {"file_path": "/src/api/users.js", "content": "..."}
495
- Write {"file_path": "/tests/auth.test.js", "content": "..."}
496
-
497
- // Update memory with results
498
- mcp__claude-flow__memory_store {"key": "code/api/auth", "value": "implemented"}
499
- mcp__claude-flow__memory_store {"key": "code/api/users", "value": "implemented"}
500
- \`\`\`
501
-
502
- 5️⃣ **MONITORING & STATUS** - Combined checks:
503
- \`\`\`javascript
504
- [Single Message]:
505
- mcp__claude-flow__swarm_monitor {}
506
- mcp__claude-flow__swarm_status {}
507
- mcp__claude-flow__agent_list {"status": "active"}
508
- mcp__claude-flow__task_status {"includeCompleted": false}
509
- TodoRead {}
510
- \`\`\`
511
-
512
- ❌ NEVER DO THIS (Sequential = SLOW):
513
- \`\`\`
514
- Message 1: mcp__claude-flow__agent_spawn
515
- Message 2: mcp__claude-flow__agent_spawn
516
- Message 3: TodoWrite (one todo)
517
- Message 4: Read file
518
- Message 5: mcp__claude-flow__memory_store
519
- \`\`\`
520
-
521
- ✅ ALWAYS DO THIS (Batch = FAST):
522
- \`\`\`
523
- Message 1: [All operations in one message]
524
- \`\`\`
525
-
526
- 💡 BATCHTOOL BEST PRACTICES:
527
- - Group by operation type (all spawns, all reads, all writes)
528
- - Use TodoWrite with 5-10 todos at once
529
- - Combine file operations when analyzing codebases
530
- - Store multiple memory items per message
531
- - Never send more than one message for related operations
532
-
533
- ${strategyGuidance}
534
-
535
- ${modeGuidance}
536
-
537
- ${agentRecommendations}
538
-
539
- 📋 MANDATORY PARALLEL WORKFLOW:
540
-
541
- 1. **INITIAL SPAWN (Single BatchTool Message):**
542
- - Spawn ALL agents at once
543
- - Create ALL initial todos at once
544
- - Store initial memory state
545
- - Create task hierarchy
546
-
547
- Example:
548
- \`\`\`
549
- [BatchTool]:
550
- mcp__claude-flow__agent_spawn (coordinator)
551
- mcp__claude-flow__agent_spawn (architect)
552
- mcp__claude-flow__agent_spawn (coder-1)
553
- mcp__claude-flow__agent_spawn (coder-2)
554
- mcp__claude-flow__agent_spawn (tester)
555
- mcp__claude-flow__memory_store { key: "init", value: {...} }
556
- mcp__claude-flow__task_create { name: "Main", subtasks: [...] }
557
- TodoWrite { todos: [5-10 todos at once] }
558
- \`\`\`
559
-
560
- 2. **TASK EXECUTION (Parallel Batches):**
561
- - Assign multiple tasks in one batch
562
- - Update multiple statuses together
563
- - Store multiple results simultaneously
564
-
565
- 3. **MONITORING (Combined Operations):**
566
- - Check all agent statuses together
567
- - Retrieve multiple memory items
568
- - Update all progress markers
569
-
570
- 🔧 AVAILABLE MCP TOOLS FOR SWARM COORDINATION:
571
-
572
- 📊 MONITORING & STATUS:
573
- - mcp__claude-flow__swarm_status - Check current swarm status and agent activity
574
- - mcp__claude-flow__swarm_monitor - Real-time monitoring of swarm execution
575
- - mcp__claude-flow__agent_list - List all active agents and their capabilities
576
- - mcp__claude-flow__task_status - Check task progress and dependencies
577
-
578
- 🧠 MEMORY & KNOWLEDGE:
579
- - mcp__claude-flow__memory_store - Store knowledge in swarm collective memory
580
- - mcp__claude-flow__memory_retrieve - Retrieve shared knowledge from memory
581
- - mcp__claude-flow__memory_search - Search collective memory by pattern
582
- - mcp__claude-flow__memory_sync - Synchronize memory across agents
583
-
584
- 🤖 AGENT MANAGEMENT:
585
- - mcp__claude-flow__agent_spawn - Spawn specialized agents for tasks
586
- - mcp__claude-flow__agent_assign - Assign tasks to specific agents
587
- - mcp__claude-flow__agent_communicate - Send messages between agents
588
- - mcp__claude-flow__agent_coordinate - Coordinate agent activities
589
-
590
- 📋 TASK ORCHESTRATION:
591
- - mcp__claude-flow__task_create - Create new tasks with dependencies
592
- - mcp__claude-flow__task_assign - Assign tasks to agents
593
- - mcp__claude-flow__task_update - Update task status and progress
594
- - mcp__claude-flow__task_complete - Mark tasks as complete with results
595
-
596
- 🎛️ COORDINATION MODES:
597
- 1. CENTRALIZED (default): Single coordinator manages all agents
598
- - Use when: Clear hierarchy needed, simple workflows
599
- - Tools: agent_assign, task_create, swarm_monitor
600
-
601
- 2. DISTRIBUTED: Multiple coordinators share responsibility
602
- - Use when: Large scale tasks, fault tolerance needed
603
- - Tools: agent_coordinate, memory_sync, task_update
604
-
605
- 3. HIERARCHICAL: Tree structure with team leads
606
- - Use when: Complex projects with sub-teams
607
- - Tools: agent_spawn (with parent), task_create (with subtasks)
608
-
609
- 4. MESH: Peer-to-peer agent coordination
610
- - Use when: Maximum flexibility, self-organizing teams
611
- - Tools: agent_communicate, memory_store/retrieve
612
-
613
- ⚡ EXECUTION WORKFLOW - ALWAYS USE BATCHTOOL:
614
- ${enableSparc
615
- ? `
616
- 1. SPARC METHODOLOGY WITH PARALLEL EXECUTION:
617
-
618
- S - Specification Phase (Single BatchTool):
619
- \`\`\`
620
- [BatchTool]:
621
- mcp__claude-flow__memory_store { key: "specs/requirements", value: {...} }
622
- mcp__claude-flow__task_create { name: "Requirement 1" }
623
- mcp__claude-flow__task_create { name: "Requirement 2" }
624
- mcp__claude-flow__task_create { name: "Requirement 3" }
625
- mcp__claude-flow__agent_spawn { type: "researcher", name: "SpecAnalyst" }
626
- \`\`\`
627
-
628
- P - Pseudocode Phase (Single BatchTool):
629
- \`\`\`
630
- [BatchTool]:
631
- mcp__claude-flow__memory_store { key: "pseudocode/main", value: {...} }
632
- mcp__claude-flow__task_create { name: "Design API" }
633
- mcp__claude-flow__task_create { name: "Design Data Model" }
634
- mcp__claude-flow__agent_communicate { to: "all", message: "Review design" }
635
- \`\`\`
636
-
637
- A - Architecture Phase (Single BatchTool):
638
- \`\`\`
639
- [BatchTool]:
640
- mcp__claude-flow__agent_spawn { type: "architect", name: "LeadArchitect" }
641
- mcp__claude-flow__memory_store { key: "architecture/decisions", value: {...} }
642
- mcp__claude-flow__task_create { name: "Backend", subtasks: [...] }
643
- mcp__claude-flow__task_create { name: "Frontend", subtasks: [...] }
644
- \`\`\`
645
-
646
- R - Refinement Phase (Single BatchTool):
647
- \`\`\`
648
- [BatchTool]:
649
- mcp__claude-flow__swarm_monitor {}
650
- mcp__claude-flow__task_update { taskId: "1", progress: 50 }
651
- mcp__claude-flow__task_update { taskId: "2", progress: 75 }
652
- mcp__claude-flow__memory_store { key: "learnings/iteration1", value: {...} }
653
- \`\`\`
654
-
655
- C - Completion Phase (Single BatchTool):
656
- \`\`\`
657
- [BatchTool]:
658
- mcp__claude-flow__task_complete { taskId: "1", results: {...} }
659
- mcp__claude-flow__task_complete { taskId: "2", results: {...} }
660
- mcp__claude-flow__memory_retrieve { pattern: "**/*" }
661
- TodoWrite { todos: [{content: "Final review", status: "completed"}] }
662
- \`\`\`
663
- `
664
- : `
665
- 1. STANDARD SWARM EXECUTION WITH PARALLEL OPERATIONS:
666
-
667
- Initial Setup (Single BatchTool):
668
- \`\`\`
669
- [BatchTool]:
670
- mcp__claude-flow__task_create { name: "Main", subtasks: [...] }
671
- mcp__claude-flow__agent_spawn { type: "coordinator" }
672
- mcp__claude-flow__agent_spawn { type: "coder" }
673
- mcp__claude-flow__agent_spawn { type: "tester" }
674
- mcp__claude-flow__memory_store { key: "init", value: {...} }
675
- \`\`\`
676
-
677
- Task Assignment (Single BatchTool):
678
- \`\`\`
679
- [BatchTool]:
680
- mcp__claude-flow__task_assign { taskId: "1", agentId: "agent-1" }
681
- mcp__claude-flow__task_assign { taskId: "2", agentId: "agent-2" }
682
- mcp__claude-flow__task_assign { taskId: "3", agentId: "agent-3" }
683
- \`\`\`
684
-
685
- Monitoring & Updates (Single BatchTool):
686
- \`\`\`
687
- [BatchTool]:
688
- mcp__claude-flow__swarm_monitor {}
689
- mcp__claude-flow__agent_communicate { to: "all", message: "Status update" }
690
- mcp__claude-flow__memory_store { key: "progress", value: {...} }
691
- \`\`\`
692
- `}
693
-
694
- 🤝 AGENT TYPES & THEIR MCP TOOL USAGE:
695
-
696
- COORDINATOR:
697
- - Primary tools: swarm_monitor, agent_assign, task_create
698
- - Monitors overall progress and assigns work
699
- - Uses memory_store for decisions and memory_retrieve for context
700
-
701
- RESEARCHER:
702
- - Primary tools: memory_search, memory_store
703
- - Gathers information and stores findings
704
- - Uses agent_communicate to share discoveries
705
-
706
- CODER:
707
- - Primary tools: task_update, memory_retrieve, memory_store
708
- - Implements solutions and updates progress
709
- - Retrieves specs from memory, stores code artifacts
710
-
711
- ANALYST:
712
- - Primary tools: memory_search, swarm_monitor
713
- - Analyzes data and patterns
714
- - Stores insights and recommendations
715
-
716
- TESTER:
717
- - Primary tools: task_status, agent_communicate
718
- - Validates implementations
719
- - Reports issues via task_update
720
-
721
- 📝 EXAMPLE MCP TOOL USAGE PATTERNS:
722
-
723
- 1. Starting a swarm:
724
- mcp__claude-flow__agent_spawn {"type": "coordinator", "name": "SwarmLead"}
725
- mcp__claude-flow__memory_store {"key": "objective", "value": "${objective}"}
726
- mcp__claude-flow__task_create {"name": "Main Objective", "type": "parent"}
727
-
728
- 2. Spawning worker agents:
729
- mcp__claude-flow__agent_spawn {"type": "researcher", "capabilities": ["web-search"]}
730
- mcp__claude-flow__agent_spawn {"type": "coder", "capabilities": ["python", "testing"]}
731
- mcp__claude-flow__task_assign {"taskId": "task-123", "agentId": "agent-456"}
732
-
733
- 3. Coordinating work:
734
- mcp__claude-flow__agent_communicate {"to": "agent-123", "message": "Begin phase 2"}
735
- mcp__claude-flow__memory_store {"key": "phase1/results", "value": {...}}
736
- mcp__claude-flow__task_update {"taskId": "task-123", "progress": 75}
737
-
738
- 4. Monitoring progress:
739
- mcp__claude-flow__swarm_monitor {}
740
- mcp__claude-flow__task_status {"includeCompleted": true}
741
- mcp__claude-flow__agent_list {"status": "active"}
742
-
743
- 💾 MEMORY PATTERNS:
744
-
745
- Use hierarchical keys for organization:
746
- - "specs/requirements" - Store specifications
747
- - "architecture/decisions" - Architecture choices
748
- - "code/modules/[name]" - Code artifacts
749
- - "tests/results/[id]" - Test outcomes
750
- - "docs/api/[endpoint]" - Documentation
751
-
752
- 🚀 BEGIN SWARM EXECUTION:
753
-
754
- Start by spawning a coordinator agent and creating the initial task structure. Use the MCP tools to orchestrate the swarm, coordinate agents, and track progress. Remember to store important decisions and artifacts in collective memory for other agents to access.
755
-
756
- The swarm should be self-documenting - use memory_store to save all important information, decisions, and results throughout the execution.`;
757
- // If --claude flag is used, force Claude Code even if CLI not available
758
- if (flags && flags.claude) {
759
- // Inject memory coordination protocol into CLAUDE.md
760
- try {
761
- const { injectMemoryProtocol, enhanceSwarmPrompt } = await import('./inject-memory-protocol.js');
762
- await injectMemoryProtocol();
763
- // Enhance the prompt with memory coordination instructions
764
- swarmPrompt = enhanceSwarmPrompt(swarmPrompt, maxAgents);
765
- }
766
- catch (err) {
767
- // If injection module not available, continue with original prompt
768
- console.log('⚠️ Memory protocol injection not available, using standard prompt');
769
- }
770
- // --claude flag means interactive mode, so don't apply non-interactive
771
- console.log('🐝 Launching Claude Flow Swarm System...');
772
- console.log(`📋 Objective: ${objective}`);
773
- console.log(`🎯 Strategy: ${strategy}`);
774
- console.log(`🏗️ Mode: ${mode}`);
775
- console.log(`🤖 Max Agents: ${maxAgents}\n`);
776
- console.log('🚀 Launching Claude Code with Swarm Coordination');
777
- console.log('📝 Memory protocol injected into CLAUDE.md');
778
- console.log('─'.repeat(60));
779
- // Build arguments properly: for interactive mode, prompt can be first
780
- const claudeArgs = [];
781
- // Add auto-permission flag first
782
- if (flags['dangerously-skip-permissions'] !== false && !flags['no-auto-permissions']) {
783
- claudeArgs.push('--dangerously-skip-permissions');
784
- console.log('🔓 Using --dangerously-skip-permissions by default for seamless swarm execution');
785
- }
786
- // Add the enhanced prompt
787
- claudeArgs.push(swarmPrompt);
788
- // --claude flag means interactive mode, so don't add non-interactive flags
789
- // For --claude interactive mode, spawn Claude directly
790
- // Temporarily disable telemetry to avoid console output interference
791
- const claudeEnv = { ...process.env };
792
- // Remove telemetry env vars to prevent console output
793
- delete claudeEnv.CLAUDE_CODE_ENABLE_TELEMETRY;
794
- delete claudeEnv.OTEL_METRICS_EXPORTER;
795
- delete claudeEnv.OTEL_LOGS_EXPORTER;
796
- const claudeProcess = spawn('claude', claudeArgs, {
797
- stdio: 'inherit',
798
- shell: false,
799
- env: claudeEnv
800
- });
801
- console.log('\n✓ Claude Code launched with swarm coordination prompt!');
802
- console.log(' The swarm coordinator will orchestrate all agent tasks');
803
- console.log(' Use MCP tools for coordination and memory sharing');
804
- console.log('\n💡 Pro Tips:');
805
- console.log('─'.repeat(30));
806
- console.log('• Use TodoWrite to track parallel tasks');
807
- console.log('• Store results with mcp__claude-flow__memory_usage');
808
- console.log('• Monitor progress with mcp__claude-flow__swarm_monitor');
809
- console.log('• Check task status with mcp__claude-flow__task_status');
810
- // Set up clean termination
811
- const cleanup = () => {
812
- console.log('\n🛑 Shutting down swarm gracefully...');
813
- if (claudeProcess && !claudeProcess.killed) {
814
- claudeProcess.kill('SIGTERM');
815
- }
816
- process.exit(0);
817
- };
818
- process.on('SIGINT', cleanup);
819
- process.on('SIGTERM', cleanup);
820
- // Wait for claude to exit
821
- claudeProcess.on('exit', (code) => {
822
- if (code === 0) {
823
- console.log('\n✓ Swarm execution completed successfully');
824
- }
825
- else if (code !== null) {
826
- console.log(`\n✗ Swarm execution exited with code ${code}`);
827
- }
828
- process.exit(code || 0);
829
- });
830
- // Handle spawn errors (e.g., claude not found)
831
- claudeProcess.on('error', (err) => {
832
- if (err.code === 'ENOENT') {
833
- console.error('\n❌ Claude Code CLI not found. Please install Claude Code:');
834
- console.error(' https://claude.ai/download');
835
- }
836
- else {
837
- console.error('\n❌ Failed to launch Claude Code:', err.message);
838
- }
839
- process.exit(1);
840
- });
841
- return;
842
- }
843
- // Check if we're in non-interactive/headless mode FIRST (like alpha.83)
844
- const isNonInteractive = flags['no-interactive'] ||
845
- flags['non-interactive'] ||
846
- flags['output-format'] === 'stream-json' ||
847
- isHeadlessEnvironment();
848
- // Check if claude command exists
849
- let claudeAvailable = false;
850
- try {
851
- execSync('which claude', { stdio: 'ignore' });
852
- claudeAvailable = true;
853
- }
854
- catch {
855
- if (!isNonInteractive) {
856
- console.log('⚠️ Claude Code CLI not found in PATH');
857
- console.log('Install it with: npm install -g @anthropic-ai/claude-code');
858
- console.log('Or use --claude flag to open Claude Code CLI');
859
- console.log('\nWould spawn Claude Code with swarm objective:');
860
- console.log(`📋 Objective: ${objective}`);
861
- console.log('\nOptions:');
862
- console.log(' • Use --executor flag for built-in executor: claude-flow swarm "objective" --executor');
863
- console.log(' • Use --claude flag to open Claude Code CLI: claude-flow swarm "objective" --claude');
864
- }
865
- else {
866
- // In non-interactive mode, output JSON error
867
- console.error(JSON.stringify({
868
- error: 'Claude Code CLI not found',
869
- message: 'Install with: npm install -g @anthropic-ai/claude-code',
870
- fallback: 'Use --executor flag for built-in executor'
871
- }));
872
- }
873
- return;
874
- }
875
- // Claude is available, use it to run swarm
876
- if (!isNonInteractive) {
877
- console.log('🐝 Launching Claude Flow Swarm System...');
878
- console.log(`📋 Objective: ${objective}`);
879
- console.log(`🎯 Strategy: ${flags.strategy || 'auto'}`);
880
- console.log(`🏗️ Mode: ${flags.mode || 'centralized'}`);
881
- console.log(`🤖 Max Agents: ${flags['max-agents'] || 5}`);
882
- if (isAnalysisMode) {
883
- console.log(`🔍 Analysis Mode: ENABLED (Read-Only - No Code Changes)`);
884
- }
885
- console.log();
886
- }
887
- else {
888
- // Non-interactive mode output
889
- console.log('🤖 Running in non-interactive mode with Claude');
890
- console.log('📋 Command: claude [prompt] -p --output-format stream-json --verbose');
891
- }
892
- // Continue with the default swarm behavior if not using --claude flag
893
- // Build arguments in correct order: flags first, then prompt
894
- const claudeArgs = [];
895
- // Add non-interactive flags FIRST if needed
896
- if (isNonInteractive) {
897
- claudeArgs.push('-p'); // Print mode
898
- claudeArgs.push('--output-format', 'stream-json'); // JSON streaming
899
- claudeArgs.push('--verbose'); // Verbose output
900
- }
901
- // Add auto-permission flag BEFORE the prompt
902
- if (flags['dangerously-skip-permissions'] !== false && !flags['no-auto-permissions']) {
903
- claudeArgs.push('--dangerously-skip-permissions');
904
- if (!isNonInteractive) {
905
- console.log('🔓 Using --dangerously-skip-permissions by default for seamless swarm execution');
906
- }
907
- }
908
- // Add the prompt as the LAST argument
909
- claudeArgs.push(swarmPrompt);
910
- // Spawn claude with properly ordered arguments
911
- const claudeProcess = spawn('claude', claudeArgs, {
912
- stdio: 'inherit',
913
- shell: false,
914
- });
915
- if (!isNonInteractive) {
916
- console.log('✓ Claude Code launched with swarm coordination prompt!');
917
- console.log('\n🚀 The swarm coordination instructions have been injected into Claude Code');
918
- console.log(' The prompt includes:');
919
- console.log(' • Strategy-specific guidance for', strategy);
920
- console.log(' • Coordination patterns for', mode, 'mode');
921
- console.log(' • Recommended agents and MCP tool usage');
922
- console.log(' • Complete workflow documentation\n');
923
- }
924
- // Handle process events
925
- claudeProcess.on('error', (err) => {
926
- console.error('❌ Failed to launch Claude Code:', err.message);
927
- });
928
- // Don't wait for completion - let it run
929
- return;
930
- }
931
- catch (error) {
932
- console.error('❌ Failed to spawn Claude Code:', error.message);
933
- console.log('\nFalling back to built-in executor...');
934
- // Fall through to executor implementation
935
- }
936
- }
937
- // Check if we should run in background mode
938
- if (flags && flags.background && !process.env.CLAUDE_SWARM_NO_BG) {
939
- // Check if we're in Deno environment
940
- if (typeof Deno !== 'undefined') {
941
- // In Deno, spawn a new process for true background execution
942
- const objective = (args || []).join(' ').trim();
943
- const swarmId = `swarm_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
944
- const swarmRunDir = `./swarm-runs/${swarmId}`;
945
- // Create swarm directory
946
- await mkdirAsync(swarmRunDir, { recursive: true });
947
- console.log(`🐝 Launching swarm in background mode...`);
948
- console.log(`📋 Objective: ${objective}`);
949
- console.log(`🆔 Swarm ID: ${swarmId}`);
950
- console.log(`📁 Results: ${swarmRunDir}`);
951
- // Build command args without background flag (to prevent infinite loop)
952
- const commandArgs = ['run', '--allow-all', import.meta.url, objective];
953
- const newFlags = { ...flags };
954
- delete newFlags.background; // Remove background flag
955
- for (const [key, value] of Object.entries(newFlags)) {
956
- commandArgs.push(`--${key}`);
957
- if (value !== true) {
958
- commandArgs.push(String(value));
959
- }
960
- }
961
- // Create log file
962
- const logFile = `${swarmRunDir}/swarm.log`;
963
- const logHandle = await open(logFile, 'w');
964
- // Create a script to run the swarm without background flag
965
- const scriptContent = `#!/usr/bin/env -S deno run --allow-all
966
- import { swarmCommand } from "${import.meta.url}";
967
- import { cwd, exit, existsSync } from '../node-compat.js';
968
- import process from 'process';
969
-
970
- // Remove background flag to prevent recursion
971
- const flags = ${JSON.stringify(newFlags)};
972
- const args = ${JSON.stringify(args)};
973
-
974
- // Set env to prevent background spawning
975
- process.env.CLAUDE_SWARM_NO_BG = 'true';
976
-
977
- // Run the swarm
978
- await swarmCommand(args, flags);
979
- `;
980
- const scriptPath = `${swarmRunDir}/run-swarm.js`;
981
- await writeTextFile(scriptPath, scriptContent);
982
- // Save process info first
983
- await writeTextFile(`${swarmRunDir}/process.json`, JSON.stringify({
984
- swarmId: swarmId,
985
- objective: objective,
986
- startTime: new Date().toISOString(),
987
- logFile: logFile,
988
- status: 'starting',
989
- }, null, 2));
990
- // Close log handle before spawning
991
- logHandle.close();
992
- // Use the bash script for true background execution
993
- const binDir = new URL('../../../bin/', import.meta.url).pathname;
994
- const bgScriptPath = `${binDir}claude-flow-swarm-bg`;
995
- try {
996
- // Check if the background script exists
997
- statSync(bgScriptPath);
998
- // Build command args for the background script
999
- const bgArgs = [objective];
1000
- for (const [key, value] of Object.entries(newFlags)) {
1001
- bgArgs.push(`--${key}`);
1002
- if (value !== true) {
1003
- bgArgs.push(String(value));
1004
- }
1005
- }
1006
- // Use the bash background script
1007
- const bgProcess = spawn(bgScriptPath, bgArgs, {
1008
- stdio: ['ignore', 'pipe', 'pipe'],
1009
- });
1010
- // Read and display output
1011
- const decoder = new TextDecoder();
1012
- const output = await bgProcess.output();
1013
- console.log(decoder.decode(output.stdout));
1014
- // Exit immediately after launching
1015
- exit(0);
1016
- }
1017
- catch (error) {
1018
- // Fallback: create a double-fork pattern using a shell script
1019
- console.log(`\n⚠️ Background script not found, using fallback method`);
1020
- // Create a shell script that will run the swarm
1021
- const shellScript = `#!/bin/bash
1022
- # Double fork to detach from parent
1023
- (
1024
- (
1025
- node "${scriptPath}" > "${logFile}" 2>&1 &
1026
- echo $! > "${swarmRunDir}/swarm.pid"
1027
- ) &
1028
- )
1029
- exit 0
1030
- `;
1031
- const shellScriptPath = `${swarmRunDir}/launch-background.sh`;
1032
- await writeTextFile(shellScriptPath, shellScript);
1033
- chmodSync(shellScriptPath, 0o755);
1034
- // Execute the shell script
1035
- const shellProcess = spawn('bash', [shellScriptPath], {
1036
- stdio: 'ignore',
1037
- detached: true,
1038
- });
1039
- shellProcess.unref();
1040
- console.log(`\n✅ Swarm launched in background!`);
1041
- console.log(`📄 Logs: tail -f ${logFile}`);
1042
- console.log(`📊 Status: claude-flow swarm status ${swarmId}`);
1043
- console.log(`\nThe swarm will continue running independently.`);
1044
- // Exit immediately
1045
- exit(0);
1046
- }
1047
- }
1048
- // Node.js environment - use background script
1049
- const { execSync } = await import('child_process');
1050
- const path = await import('path');
1051
- const fs = await import('fs');
1052
- const objective = (args || []).join(' ').trim();
1053
- // Get the claude-flow-swarm-bg script path
1054
- const bgScriptPath = path.join(path.dirname(new URL(import.meta.url).pathname), '../../../bin/claude-flow-swarm-bg');
1055
- // Check if background script exists
1056
- if (fs.existsSync(bgScriptPath)) {
1057
- // Build command args
1058
- const commandArgs = [objective];
1059
- for (const [key, value] of Object.entries(flags)) {
1060
- if (key !== 'background') {
1061
- // Skip background flag
1062
- commandArgs.push(`--${key}`);
1063
- if (value !== true) {
1064
- commandArgs.push(String(value));
1065
- }
1066
- }
1067
- }
1068
- // Execute the background script
1069
- try {
1070
- execSync(`"${bgScriptPath}" ${commandArgs.map((arg) => `"${arg}"`).join(' ')}`, {
1071
- stdio: 'inherit',
1072
- });
1073
- }
1074
- catch (error) {
1075
- console.error('Failed to launch background swarm:', error.message);
1076
- }
1077
- }
1078
- else {
1079
- // Fallback to simple message
1080
- console.log(`🐝 Background mode requested`);
1081
- console.log(`📋 Objective: ${objective}`);
1082
- console.log(`\n⚠️ Background execution requires the claude-flow-swarm-bg script.`);
1083
- console.log(`\nFor true background execution, use:`);
1084
- console.log(` nohup claude-flow swarm "${objective}" ${Object.entries(flags)
1085
- .filter(([k, v]) => k !== 'background' && v)
1086
- .map(([k, v]) => `--${k}${v !== true ? ` ${v}` : ''}`)
1087
- .join(' ')} > swarm.log 2>&1 &`);
1088
- }
1089
- return;
1090
- }
1091
- try {
1092
- // Try to load the compiled JavaScript module first
1093
- let swarmAction;
1094
- try {
1095
- // Try the compiled version first (for production/npm packages)
1096
- const distPath = new URL('../../../dist/cli/commands/swarm-new.js', import.meta.url);
1097
- const module = await import(distPath);
1098
- swarmAction = module.swarmAction;
1099
- }
1100
- catch (distError) {
1101
- // Instead of immediately falling back to basic mode,
1102
- // continue to the Claude integration below
1103
- console.log('📦 Compiled swarm module not found, checking for Claude CLI...');
1104
- }
1105
- // Only call swarmAction if it was successfully loaded
1106
- if (swarmAction) {
1107
- // Create command context compatible with TypeScript version
1108
- const ctx = {
1109
- args: args || [],
1110
- flags: flags || {},
1111
- command: 'swarm',
1112
- };
1113
- await swarmAction(ctx);
1114
- return; // Exit after successful execution
1115
- }
1116
- }
1117
- catch (error) {
1118
- // If import fails (e.g., in node_modules), provide inline implementation
1119
- if (error.code === 'ERR_MODULE_NOT_FOUND' ||
1120
- error.code === 'ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING' ||
1121
- error.code === 'ERR_UNKNOWN_FILE_EXTENSION') {
1122
- // Provide a basic swarm implementation that works without TypeScript imports
1123
- const objective = (args || []).join(' ').trim();
1124
- if (!objective) {
1125
- console.error('❌ Usage: swarm <objective>');
1126
- showSwarmHelp();
1127
- return;
1128
- }
1129
- // Try to use the swarm executor directly
1130
- try {
1131
- const { executeSwarm } = await import('./swarm-executor.js');
1132
- const result = await executeSwarm(objective, flags);
1133
- // If execution was successful, exit
1134
- if (result && result.success) {
1135
- return;
1136
- }
1137
- }
1138
- catch (execError) {
1139
- console.log(`⚠️ Swarm executor error: ${execError.message}`);
1140
- // If swarm executor fails, try to create files directly
1141
- try {
1142
- await createSwarmFiles(objective, flags);
1143
- return;
1144
- }
1145
- catch (createError) {
1146
- console.log(`⚠️ Direct file creation error: ${createError.message}`);
1147
- // Continue with fallback implementation
1148
- }
1149
- }
1150
- // Provide a basic inline swarm implementation for npm packages
1151
- console.log('🐝 Launching swarm system...');
1152
- console.log(`📋 Objective: ${objective}`);
1153
- console.log(`🎯 Strategy: ${flags.strategy || 'auto'}`);
1154
- console.log(`🏗️ Mode: ${flags.mode || 'centralized'}`);
1155
- console.log(`🤖 Max Agents: ${flags['max-agents'] || 5}`);
1156
- console.log();
1157
- // Generate swarm ID
1158
- const swarmId = `swarm_${Math.random().toString(36).substring(2, 11)}_${Math.random().toString(36).substring(2, 11)}`;
1159
- if (flags['dry-run']) {
1160
- console.log(`🆔 Swarm ID: ${swarmId}`);
1161
- console.log(`📊 Max Tasks: ${flags['max-tasks'] || 100}`);
1162
- console.log(`⏰ Timeout: ${flags.timeout || 60} minutes`);
1163
- console.log(`🔄 Parallel: ${flags.parallel || false}`);
1164
- console.log(`🌐 Distributed: ${flags.distributed || false}`);
1165
- console.log(`🔍 Monitoring: ${flags.monitor || false}`);
1166
- console.log(`👥 Review Mode: ${flags.review || false}`);
1167
- console.log(`🧪 Testing: ${flags.testing || false}`);
1168
- console.log(`🧠 Memory Namespace: ${flags['memory-namespace'] || 'swarm'}`);
1169
- console.log(`💾 Persistence: ${flags.persistence !== false}`);
1170
- console.log(`🔒 Encryption: ${flags.encryption || false}`);
1171
- console.log(`📊 Quality Threshold: ${flags['quality-threshold'] || 0.8}`);
1172
- console.log();
1173
- console.log('🎛️ Coordination Strategy:');
1174
- console.log(` • Agent Selection: ${flags['agent-selection'] || 'capability-based'}`);
1175
- console.log(` • Task Scheduling: ${flags['task-scheduling'] || 'priority'}`);
1176
- console.log(` • Load Balancing: ${flags['load-balancing'] || 'work-stealing'}`);
1177
- console.log(` • Fault Tolerance: ${flags['fault-tolerance'] || 'retry'}`);
1178
- console.log(` • Communication: ${flags.communication || 'event-driven'}`);
1179
- console.log('⚠️ DRY RUN - Advanced Swarm Configuration');
1180
- return;
1181
- }
1182
- // For actual execution in npm context, try to find and run swarm-demo.ts
1183
- try {
1184
- const path = await import('path');
1185
- const { fileURLToPath } = await import('url');
1186
- const fs = await import('fs');
1187
- const { spawn } = await import('child_process');
1188
- const __filename = fileURLToPath(import.meta.url);
1189
- const __dirname = path.dirname(__filename);
1190
- // Look for swarm-demo.ts in the package
1191
- const possiblePaths = [
1192
- path.join(__dirname, '../../../swarm-demo.ts'),
1193
- path.join(__dirname, '../../swarm-demo.ts'),
1194
- ];
1195
- let swarmDemoPath = null;
1196
- for (const p of possiblePaths) {
1197
- if (fs.existsSync(p)) {
1198
- swarmDemoPath = p;
1199
- break;
1200
- }
1201
- }
1202
- if (swarmDemoPath && Deno) {
1203
- // Run swarm-demo.ts directly with Deno
1204
- const swarmArgs = [objective];
1205
- for (const [key, value] of Object.entries(flags || {})) {
1206
- swarmArgs.push(`--${key}`);
1207
- if (value !== true) {
1208
- swarmArgs.push(String(value));
1209
- }
1210
- }
1211
- console.log('🚀 Starting advanced swarm execution...');
1212
- const swarmProcess = spawn('node', [swarmDemoPath, ...swarmArgs], {
1213
- stdio: 'inherit',
1214
- });
1215
- swarmProcess.on('error', (err) => {
1216
- console.error('❌ Failed to launch swarm:', err.message);
1217
- });
1218
- swarmProcess.on('exit', (code) => {
1219
- if (code !== 0) {
1220
- console.error(`❌ Swarm exited with code ${code}`);
1221
- }
1222
- });
1223
- return;
1224
- }
1225
- }
1226
- catch (e) {
1227
- // Fallback to basic message if can't run swarm-demo.ts
1228
- }
1229
- // Try to use Claude wrapper approach like SPARC does
1230
- try {
1231
- const { execSync } = await import('child_process');
1232
- // Check if claude command exists
1233
- try {
1234
- execSync('which claude', { stdio: 'ignore' });
1235
- }
1236
- catch (e) {
1237
- // Claude not found, show fallback message
1238
- console.log(`✅ Swarm initialized with ID: ${swarmId}`);
1239
- console.log('\n⚠️ Note: Advanced swarm features require Claude or local installation.');
1240
- console.log('Install Claude: https://claude.ai/code');
1241
- console.log('Or install locally: npm install -g claude-flow@latest');
1242
- console.log('\nThe swarm system would coordinate the following:');
1243
- console.log('1. Agent spawning and task distribution');
1244
- console.log('2. Parallel execution of subtasks');
1245
- console.log('3. Memory sharing between agents');
1246
- console.log('4. Progress monitoring and reporting');
1247
- console.log('5. Result aggregation and quality checks');
1248
- return;
1249
- }
1250
- // Claude is available, use it to run swarm
1251
- console.log('🚀 Launching swarm via Claude wrapper...');
1252
- if (flags.sparc !== false) {
1253
- console.log('🧪 SPARC methodology enabled - using full TDD workflow');
1254
- }
1255
- // Build the prompt for Claude using SPARC methodology
1256
- const enableSparc = flags.sparc !== false;
1257
- const swarmPrompt = `Execute a swarm coordination task using ${enableSparc ? 'the full SPARC methodology' : 'standard approach'}:
1258
-
1259
- OBJECTIVE: ${objective}
1260
-
1261
- CONFIGURATION:
1262
- - Strategy: ${flags.strategy || 'auto'}
1263
- - Mode: ${flags.mode || 'centralized'}
1264
- - Max Agents: ${flags['max-agents'] || 5}
1265
- - Memory Namespace: ${flags['memory-namespace'] || 'swarm'}
1266
- - Quality Threshold: ${flags['quality-threshold'] || 0.8}
1267
- ${enableSparc ? '- SPARC Enabled: YES - Use full Specification, Pseudocode, Architecture, Refinement (TDD), Completion methodology' : ''}
1268
-
1269
- ${enableSparc
1270
- ? `
1271
- SPARC METHODOLOGY REQUIREMENTS:
1272
-
1273
- 1. SPECIFICATION PHASE:
1274
- - Create detailed requirements and acceptance criteria
1275
- - Define user stories with clear objectives
1276
- - Document functional and non-functional requirements
1277
- - Establish quality metrics and success criteria
1278
-
1279
- 2. PSEUDOCODE PHASE:
1280
- - Design algorithms and data structures
1281
- - Create flow diagrams and logic patterns
1282
- - Define interfaces and contracts
1283
- - Plan error handling strategies
1284
-
1285
- 3. ARCHITECTURE PHASE:
1286
- - Design system architecture with proper components
1287
- - Define APIs and service boundaries
1288
- - Plan database schemas if applicable
1289
- - Create deployment architecture
1290
-
1291
- 4. REFINEMENT PHASE (TDD):
1292
- - RED: Write comprehensive failing tests first
1293
- - GREEN: Implement minimal code to pass tests
1294
- - REFACTOR: Optimize and clean up implementation
1295
- - Ensure >80% test coverage
1296
-
1297
- 5. COMPLETION PHASE:
1298
- - Integrate all components
1299
- - Create comprehensive documentation
1300
- - Perform end-to-end testing
1301
- - Validate against original requirements
1302
- `
1303
- : ''}
1304
-
1305
- EXECUTION APPROACH:
1306
- 1. Analyze the objective and break it down into specific tasks
1307
- 2. Create a comprehensive implementation plan
1308
- 3. ${enableSparc ? 'Follow SPARC phases sequentially with proper artifacts for each phase' : 'Implement the solution directly'}
1309
- 4. Generate production-ready code with proper structure
1310
- 5. Include all necessary files (source code, tests, configs, documentation)
1311
- 6. Ensure the implementation is complete and functional
1312
-
1313
- TARGET DIRECTORY:
1314
- Extract from the objective or use a sensible default. Create all files in the appropriate directory structure.
1315
-
1316
- IMPORTANT:
1317
- - Create actual, working implementations - not templates or placeholders
1318
- - Include comprehensive tests using appropriate testing frameworks
1319
- - Add proper error handling and logging
1320
- - Include configuration files (package.json, requirements.txt, etc.)
1321
- - Create detailed README with setup and usage instructions
1322
- - Follow best practices for the technology stack
1323
- - Make the code production-ready, not just examples
1324
-
1325
- Begin execution now. Create all necessary files and provide a complete, working solution.`;
1326
- // Execute Claude non-interactively by piping the prompt
1327
- const { spawn } = await import('child_process');
1328
- const claudeArgs = [];
1329
- // Add auto-permission flag by default for swarm mode (unless explicitly disabled)
1330
- if (flags['dangerously-skip-permissions'] !== false && !flags['no-auto-permissions']) {
1331
- claudeArgs.push('--dangerously-skip-permissions');
1332
- }
1333
- // Spawn claude process
1334
- const claudeProcess = spawn('claude', claudeArgs, {
1335
- stdio: ['pipe', 'inherit', 'inherit'],
1336
- shell: false,
1337
- });
1338
- // Write the prompt to stdin and close it
1339
- claudeProcess.stdin.write(swarmPrompt);
1340
- claudeProcess.stdin.end();
1341
- // Wait for the process to complete
1342
- await new Promise((resolve, reject) => {
1343
- claudeProcess.on('close', (code) => {
1344
- if (code === 0) {
1345
- resolve();
1346
- }
1347
- else {
1348
- reject(new Error(`Claude process exited with code ${code}`));
1349
- }
1350
- });
1351
- claudeProcess.on('error', (err) => {
1352
- reject(err);
1353
- });
1354
- });
1355
- }
1356
- catch (error) {
1357
- // Fallback if Claude execution fails
1358
- console.log(`✅ Swarm initialized with ID: ${swarmId}`);
1359
- console.log('\n⚠️ Note: Advanced swarm features require Claude or local installation.');
1360
- console.log('Install Claude: https://claude.ai/code');
1361
- console.log('Or install locally: npm install -g claude-flow@latest');
1362
- console.log('\nThe swarm system would coordinate the following:');
1363
- console.log('1. Agent spawning and task distribution');
1364
- console.log('2. Parallel execution of subtasks');
1365
- console.log('3. Memory sharing between agents');
1366
- console.log('4. Progress monitoring and reporting');
1367
- console.log('5. Result aggregation and quality checks');
1368
- }
1369
- return;
1370
- }
1371
- console.error('Swarm command error:', error);
1372
- // Fallback to comprehensive help if there's an import error
1373
- console.log(`
1374
- 🐝 Claude Flow Advanced Swarm System
1375
-
1376
- USAGE:
1377
- claude-flow swarm <objective> [options]
1378
-
1379
- EXAMPLES:
1380
- claude-flow swarm "Build a REST API" --strategy development
1381
- claude-flow swarm "Research cloud architecture" --strategy research --ui
1382
- claude-flow swarm "Analyze data trends" --strategy analysis --parallel
1383
- claude-flow swarm "Optimize performance" --distributed --monitor
1384
-
1385
- STRATEGIES:
1386
- auto Automatically determine best approach (default)
1387
- research Research and information gathering
1388
- development Software development and coding
1389
- analysis Data analysis and insights
1390
- testing Testing and quality assurance
1391
- optimization Performance optimization
1392
- maintenance System maintenance
1393
-
1394
- MODES:
1395
- centralized Single coordinator (default)
1396
- distributed Multiple coordinators
1397
- hierarchical Tree structure coordination
1398
- mesh Peer-to-peer coordination
1399
- hybrid Mixed coordination strategies
1400
-
1401
- KEY FEATURES:
1402
- 🤖 Intelligent agent management with specialized types
1403
- ⚡ Timeout-free background task execution
1404
- 🧠 Distributed memory sharing between agents
1405
- 🔄 Work stealing and advanced load balancing
1406
- 🛡️ Circuit breaker patterns for fault tolerance
1407
- 📊 Real-time monitoring and comprehensive metrics
1408
- 🎛️ Multiple coordination strategies and algorithms
1409
- 💾 Persistent state with backup and recovery
1410
- 🔒 Security features with encryption options
1411
- 🖥️ Interactive terminal UI for management
1412
-
1413
- OPTIONS:
1414
- --strategy <type> Execution strategy (default: auto)
1415
- --mode <type> Coordination mode (default: centralized)
1416
- --max-agents <n> Maximum agents (default: 5)
1417
- --timeout <minutes> Timeout in minutes (default: 60)
1418
- --task-timeout-minutes <n> Task execution timeout in minutes (default: 59)
1419
- --parallel Enable parallel execution
1420
- --distributed Enable distributed coordination
1421
- --monitor Enable real-time monitoring
1422
- --ui Launch terminal UI interface
1423
- --background Run in background mode
1424
- --review Enable peer review
1425
- --testing Enable automated testing
1426
- --encryption Enable encryption
1427
- --verbose Enable detailed logging
1428
- --dry-run Show configuration without executing
1429
- --executor Use built-in executor instead of Claude Code
1430
- --claude Open Claude Code CLI
1431
- --output-format <format> Output format: json, text (default: text)
1432
- --output-file <path> Save output to file instead of stdout
1433
- --no-interactive Run in non-interactive mode (auto-enabled with --output-format json)
1434
- --auto (Deprecated: auto-permissions enabled by default)
1435
- --no-auto-permissions Disable automatic --dangerously-skip-permissions
1436
- --analysis Enable analysis/read-only mode (no code changes)
1437
- --read-only Enable read-only mode (alias for --analysis)
1438
-
1439
- ADVANCED OPTIONS:
1440
- --quality-threshold <n> Quality threshold 0-1 (default: 0.8)
1441
- --memory-namespace <name> Memory namespace (default: swarm)
1442
- --agent-selection <type> Agent selection strategy
1443
- --task-scheduling <type> Task scheduling algorithm
1444
- --load-balancing <type> Load balancing method
1445
- --fault-tolerance <type> Fault tolerance strategy
1446
-
1447
- For complete documentation and examples:
1448
- https://github.com/ruvnet/claude-code-flow/docs/swarm.md
1449
- `);
1450
- }
1451
- }
1452
- // Function to create swarm files directly
1453
- async function createSwarmFiles(objective, flags) {
1454
- const fs = await import('fs');
1455
- const path = await import('path');
1456
- const swarmId = `swarm_${Math.random().toString(36).substring(2, 11)}_${Math.random().toString(36).substring(2, 11)}`;
1457
- console.log(`🐝 Swarm Execution Started: ${swarmId}`);
1458
- console.log(`📋 Objective: ${objective}`);
1459
- console.log(`🎯 Strategy: ${flags.strategy || 'auto'}`);
1460
- // Extract target directory from objective
1461
- const targetMatch = objective.match(/in\s+([^\s]+)\/?$/i);
1462
- let targetDir = targetMatch ? targetMatch[1] : 'output';
1463
- // Resolve relative paths
1464
- if (!targetDir.startsWith('/')) {
1465
- targetDir = path.join(process.cwd(), targetDir);
1466
- }
1467
- console.log(`📁 Target directory: ${targetDir}`);
1468
- // Ensure target directory exists
1469
- await fs.promises.mkdir(targetDir, { recursive: true });
1470
- // Determine what to build based on objective
1471
- const isRestAPI = objective.toLowerCase().includes('rest api') || objective.toLowerCase().includes('api');
1472
- if (isRestAPI) {
1473
- // Create REST API
1474
- const apiDir = path.join(targetDir, 'rest-api');
1475
- await fs.promises.mkdir(apiDir, { recursive: true });
1476
- console.log(`\n🏗️ Creating REST API...`);
1477
- console.log(` 🤖 Agent developer-1: Creating server implementation`);
1478
- // Create server.js
1479
- const serverCode = `const express = require('express');
1480
- const app = express();
1481
- const port = process.env.PORT || 3000;
1482
-
1483
- // Middleware
1484
- app.use(express.json());
1485
- app.use(express.urlencoded({ extended: true }));
1486
-
1487
- // Health check endpoint
1488
- app.get('/health', (req, res) => {
1489
- res.json({
1490
- status: 'healthy',
1491
- service: 'REST API',
1492
- swarmId: '${swarmId}',
1493
- created: new Date().toISOString()
1494
- });
1495
- });
1496
-
1497
- // Sample endpoints
1498
- app.get('/api/v1/items', (req, res) => {
1499
- res.json({
1500
- items: [
1501
- { id: 1, name: 'Item 1', description: 'First item' },
1502
- { id: 2, name: 'Item 2', description: 'Second item' }
1503
- ],
1504
- total: 2
1505
- });
1506
- });
1507
-
1508
- app.get('/api/v1/items/:id', (req, res) => {
1509
- const id = parseInt(req.params.id);
1510
- res.json({
1511
- id,
1512
- name: \`Item \${id}\`,
1513
- description: \`Description for item \${id}\`
1514
- });
1515
- });
1516
-
1517
- app.post('/api/v1/items', (req, res) => {
1518
- const newItem = {
1519
- id: Date.now(),
1520
- ...req.body,
1521
- createdAt: new Date().toISOString()
1522
- };
1523
- res.status(201).json(newItem);
1524
- });
1525
-
1526
- // Start server
1527
- app.listen(port, () => {
1528
- console.log(\`REST API server running on port \${port}\`);
1529
- console.log('Created by Claude Flow Swarm');
1530
- });
1531
-
1532
- module.exports = app;
1533
- `;
1534
- await fs.promises.writeFile(path.join(apiDir, 'server.js'), serverCode);
1535
- console.log(` ✅ Created: server.js`);
1536
- // Create package.json
1537
- const packageJson = {
1538
- name: 'rest-api',
1539
- version: '1.0.0',
1540
- description: 'REST API created by Claude Flow Swarm',
1541
- main: 'server.js',
1542
- scripts: {
1543
- start: 'node server.js',
1544
- dev: 'nodemon server.js',
1545
- test: 'jest',
1546
- },
1547
- keywords: ['rest', 'api', 'swarm', 'claude-flow'],
1548
- author: 'Claude Flow Swarm',
1549
- license: 'MIT',
1550
- dependencies: {
1551
- express: '^4.18.2',
1552
- },
1553
- devDependencies: {
1554
- nodemon: '^3.0.1',
1555
- jest: '^29.7.0',
1556
- supertest: '^6.3.3',
1557
- },
1558
- swarmMetadata: {
1559
- swarmId,
1560
- strategy: flags.strategy || 'development',
1561
- created: new Date().toISOString(),
1562
- },
1563
- };
1564
- await fs.promises.writeFile(path.join(apiDir, 'package.json'), JSON.stringify(packageJson, null, 2));
1565
- console.log(` ✅ Created: package.json`);
1566
- // Create README
1567
- const readme = `# REST API
1568
-
1569
- This REST API was created by the Claude Flow Swarm system.
1570
-
1571
- ## Swarm Details
1572
- - Swarm ID: ${swarmId}
1573
- - Strategy: ${flags.strategy || 'development'}
1574
- - Generated: ${new Date().toISOString()}
1575
-
1576
- ## Installation
1577
-
1578
- \`\`\`bash
1579
- npm install
1580
- \`\`\`
1581
-
1582
- ## Usage
1583
-
1584
- Start the server:
1585
- \`\`\`bash
1586
- npm start
1587
- \`\`\`
1588
-
1589
- ## API Endpoints
1590
-
1591
- - \`GET /health\` - Health check
1592
- - \`GET /api/v1/items\` - Get all items
1593
- - \`GET /api/v1/items/:id\` - Get item by ID
1594
- - \`POST /api/v1/items\` - Create new item
1595
-
1596
- ---
1597
- Created by Claude Flow Swarm
1598
- `;
1599
- await fs.promises.writeFile(path.join(apiDir, 'README.md'), readme);
1600
- console.log(` ✅ Created: README.md`);
1601
- console.log(`\n✅ Swarm completed successfully!`);
1602
- console.log(`📁 Files created in: ${apiDir}`);
1603
- console.log(`🆔 Swarm ID: ${swarmId}`);
1604
- }
1605
- else {
1606
- // Create generic application
1607
- console.log(`\n🏗️ Creating application...`);
1608
- const appCode = `// Application created by Claude Flow Swarm
1609
- // Objective: ${objective}
1610
- // Swarm ID: ${swarmId}
1611
-
1612
- function main() {
1613
- console.log('Executing swarm objective: ${objective}');
1614
- console.log('Implementation would be based on the specific requirements');
1615
- }
1616
-
1617
- main();
1618
- `;
1619
- await fs.promises.writeFile(path.join(targetDir, 'app.js'), appCode);
1620
- console.log(` ✅ Created: app.js`);
1621
- const packageJson = {
1622
- name: 'swarm-app',
1623
- version: '1.0.0',
1624
- description: `Application created by Claude Flow Swarm: ${objective}`,
1625
- main: 'app.js',
1626
- scripts: {
1627
- start: 'node app.js',
1628
- },
1629
- swarmMetadata: {
1630
- swarmId,
1631
- objective,
1632
- created: new Date().toISOString(),
1633
- },
1634
- };
1635
- await fs.promises.writeFile(path.join(targetDir, 'package.json'), JSON.stringify(packageJson, null, 2));
1636
- console.log(` ✅ Created: package.json`);
1637
- console.log(`\n✅ Swarm completed successfully!`);
1638
- console.log(`📁 Files created in: ${targetDir}`);
1639
- console.log(`🆔 Swarm ID: ${swarmId}`);
1640
- }
1641
- }
1642
- /**
1643
- * Get strategy-specific guidance for swarm execution
1644
- */
1645
- function getStrategyGuidance(strategy, objective) {
1646
- const guidanceMap = {
1647
- auto: `🤖 AUTO STRATEGY - INTELLIGENT TASK ANALYSIS:
1648
- The swarm will analyze "${objective}" and automatically determine the best approach.
1649
-
1650
- ANALYSIS APPROACH:
1651
- 1. Task Decomposition: Break down the objective into subtasks
1652
- 2. Skill Matching: Identify required capabilities and expertise
1653
- 3. Agent Selection: Spawn appropriate agent types based on needs
1654
- 4. Workflow Design: Create optimal execution flow
1655
-
1656
- MCP TOOL PATTERN:
1657
- - Start with memory_store to save the objective analysis
1658
- - Use task_create to build a hierarchical task structure
1659
- - Spawn agents with agent_spawn based on detected requirements
1660
- - Monitor with swarm_monitor and adjust strategy as needed`,
1661
- research: `🔬 RESEARCH STRATEGY - INFORMATION GATHERING & ANALYSIS:
1662
- Optimized for: "${objective}"
1663
-
1664
- RESEARCH PHASES:
1665
- 1. Discovery: Broad information gathering
1666
- 2. Analysis: Deep dive into findings
1667
- 3. Synthesis: Combine insights
1668
- 4. Reporting: Document conclusions
1669
-
1670
- RECOMMENDED AGENTS:
1671
- - Lead Researcher: Coordinates research efforts
1672
- - Data Analysts: Process and analyze findings
1673
- - Subject Experts: Domain-specific investigation
1674
- - Documentation Specialist: Compile reports
1675
-
1676
- MCP TOOL USAGE:
1677
- - memory_store: Save all research findings with structured keys
1678
- - memory_search: Find related information across research
1679
- - agent_communicate: Share discoveries between researchers
1680
- - task_create: Break research into focused sub-investigations`,
1681
- development: `💻 DEVELOPMENT STRATEGY - SOFTWARE CREATION:
1682
- Building: "${objective}"
1683
-
1684
- DEVELOPMENT WORKFLOW:
1685
- 1. Architecture: Design system structure
1686
- 2. Implementation: Build components
1687
- 3. Integration: Connect systems
1688
- 4. Testing: Validate functionality
1689
- 5. Documentation: Create guides
1690
-
1691
- RECOMMENDED AGENTS:
1692
- - System Architect: Overall design
1693
- - Backend Developers: API/server implementation
1694
- - Frontend Developers: UI/UX implementation
1695
- - DevOps Engineer: Infrastructure setup
1696
- - QA Engineers: Testing and validation
1697
-
1698
- MCP TOOL USAGE:
1699
- - memory_store: Save architecture decisions, code modules
1700
- - task_create: Create implementation tasks with dependencies
1701
- - agent_assign: Assign specific components to developers
1702
- - swarm_monitor: Track build progress and blockers`,
1703
- analysis: `📊 ANALYSIS STRATEGY - DATA EXAMINATION:
1704
- Analyzing: "${objective}"
1705
-
1706
- ANALYSIS FRAMEWORK:
1707
- 1. Data Collection: Gather relevant information
1708
- 2. Processing: Clean and prepare data
1709
- 3. Analysis: Apply analytical methods
1710
- 4. Visualization: Create insights
1711
- 5. Recommendations: Actionable outcomes
1712
-
1713
- RECOMMENDED AGENTS:
1714
- - Lead Analyst: Coordinate analysis efforts
1715
- - Data Engineers: Prepare data pipelines
1716
- - Statistical Analysts: Apply analytical methods
1717
- - Visualization Experts: Create dashboards
1718
- - Business Analysts: Translate to recommendations
1719
-
1720
- MCP TOOL USAGE:
1721
- - memory_store: Save datasets and analysis results
1722
- - memory_retrieve: Access historical analysis
1723
- - task_create: Define analysis pipelines
1724
- - agent_coordinate: Sync analysis phases`,
1725
- testing: `🧪 TESTING STRATEGY - QUALITY ASSURANCE:
1726
- Testing: "${objective}"
1727
-
1728
- TESTING PHASES:
1729
- 1. Test Planning: Define test scenarios
1730
- 2. Test Development: Create test cases
1731
- 3. Execution: Run test suites
1732
- 4. Bug Tracking: Document issues
1733
- 5. Regression: Ensure fixes work
1734
-
1735
- RECOMMENDED AGENTS:
1736
- - Test Lead: Coordinate testing efforts
1737
- - Unit Testers: Component-level testing
1738
- - Integration Testers: System-level testing
1739
- - Performance Testers: Load and stress testing
1740
- - Security Testers: Vulnerability assessment
1741
-
1742
- MCP TOOL USAGE:
1743
- - task_create: Create test cases and scenarios
1744
- - memory_store: Save test results and bug reports
1745
- - agent_communicate: Report bugs to developers
1746
- - swarm_monitor: Track testing coverage and progress`,
1747
- optimization: `⚡ OPTIMIZATION STRATEGY - PERFORMANCE IMPROVEMENT:
1748
- Optimizing: "${objective}"
1749
-
1750
- OPTIMIZATION PROCESS:
1751
- 1. Profiling: Identify bottlenecks
1752
- 2. Analysis: Understand root causes
1753
- 3. Implementation: Apply optimizations
1754
- 4. Validation: Measure improvements
1755
- 5. Documentation: Record changes
1756
-
1757
- RECOMMENDED AGENTS:
1758
- - Performance Lead: Coordinate optimization
1759
- - System Profilers: Identify bottlenecks
1760
- - Algorithm Experts: Optimize logic
1761
- - Database Specialists: Query optimization
1762
- - Infrastructure Engineers: System tuning
1763
-
1764
- MCP TOOL USAGE:
1765
- - memory_store: Save performance baselines and results
1766
- - task_create: Create optimization tasks by priority
1767
- - swarm_monitor: Track performance improvements
1768
- - agent_communicate: Coordinate optimization efforts`,
1769
- maintenance: `🔧 MAINTENANCE STRATEGY - SYSTEM UPKEEP:
1770
- Maintaining: "${objective}"
1771
-
1772
- MAINTENANCE WORKFLOW:
1773
- 1. Assessment: Evaluate current state
1774
- 2. Planning: Prioritize updates
1775
- 3. Implementation: Apply changes
1776
- 4. Testing: Verify stability
1777
- 5. Documentation: Update records
1778
-
1779
- RECOMMENDED AGENTS:
1780
- - Maintenance Lead: Coordinate efforts
1781
- - System Administrators: Infrastructure updates
1782
- - Security Engineers: Patch vulnerabilities
1783
- - Database Administrators: Data maintenance
1784
- - Documentation Writers: Update guides
1785
-
1786
- MCP TOOL USAGE:
1787
- - memory_retrieve: Access system history
1788
- - task_create: Schedule maintenance tasks
1789
- - agent_assign: Delegate specific updates
1790
- - memory_store: Document all changes`,
1791
- };
1792
- return guidanceMap[strategy] || guidanceMap['auto'];
1793
- }
1794
- /**
1795
- * Get mode-specific guidance for coordination
1796
- */
1797
- function getModeGuidance(mode) {
1798
- const modeMap = {
1799
- centralized: `🎯 CENTRALIZED MODE - SINGLE COORDINATOR:
1800
- All decisions flow through one coordinator agent.
1801
-
1802
- COORDINATION PATTERN:
1803
- - Spawn a single COORDINATOR as the first agent
1804
- - All other agents report to the coordinator
1805
- - Coordinator assigns tasks and monitors progress
1806
- - Use agent_assign for task delegation
1807
- - Use swarm_monitor for oversight
1808
-
1809
- BENEFITS:
1810
- - Clear chain of command
1811
- - Consistent decision making
1812
- - Simple communication flow
1813
- - Easy progress tracking
1814
-
1815
- BEST FOR:
1816
- - Small to medium projects
1817
- - Well-defined objectives
1818
- - Clear task dependencies`,
1819
- distributed: `🌐 DISTRIBUTED MODE - MULTIPLE COORDINATORS:
1820
- Multiple coordinators share responsibility by domain.
1821
-
1822
- COORDINATION PATTERN:
1823
- - Spawn domain-specific coordinators (e.g., frontend-lead, backend-lead)
1824
- - Each coordinator manages their domain agents
1825
- - Use agent_coordinate for inter-coordinator sync
1826
- - Use memory_sync to share state
1827
- - Implement consensus protocols for decisions
1828
-
1829
- BENEFITS:
1830
- - Fault tolerance
1831
- - Parallel decision making
1832
- - Domain expertise
1833
- - Scalability
1834
-
1835
- BEST FOR:
1836
- - Large projects
1837
- - Multiple workstreams
1838
- - Complex systems
1839
- - High availability needs`,
1840
- hierarchical: `🏗️ HIERARCHICAL MODE - TREE STRUCTURE:
1841
- Agents organized in management layers.
1842
-
1843
- COORDINATION PATTERN:
1844
- - Spawn top-level coordinator
1845
- - Spawn team leads under coordinator
1846
- - Spawn workers under team leads
1847
- - Use parent parameter in agent_spawn
1848
- - Tasks flow down, results flow up
1849
-
1850
- BENEFITS:
1851
- - Clear reporting structure
1852
- - Efficient for large teams
1853
- - Natural work breakdown
1854
- - Manageable span of control
1855
-
1856
- BEST FOR:
1857
- - Enterprise projects
1858
- - Multi-team efforts
1859
- - Complex hierarchies
1860
- - Phased deliveries`,
1861
- mesh: `🔗 MESH MODE - PEER-TO-PEER:
1862
- Agents coordinate directly without central authority.
1863
-
1864
- COORDINATION PATTERN:
1865
- - All agents are peers
1866
- - Use agent_communicate for direct messaging
1867
- - Consensus through voting or protocols
1868
- - Self-organizing teams
1869
- - Emergent leadership
1870
-
1871
- BENEFITS:
1872
- - Maximum flexibility
1873
- - Fast local decisions
1874
- - Resilient to failures
1875
- - Creative solutions
1876
-
1877
- BEST FOR:
1878
- - Research projects
1879
- - Exploratory work
1880
- - Innovation tasks
1881
- - Small expert teams`,
1882
- hybrid: `🎨 HYBRID MODE - MIXED STRATEGIES:
1883
- Combine different coordination patterns as needed.
1884
-
1885
- COORDINATION PATTERN:
1886
- - Start with one mode, adapt as needed
1887
- - Mix hierarchical for structure with mesh for innovation
1888
- - Use distributed for resilience with centralized for control
1889
- - Dynamic reorganization based on task needs
1890
-
1891
- BENEFITS:
1892
- - Adaptability
1893
- - Best of all modes
1894
- - Task-appropriate structure
1895
- - Evolution over time
1896
-
1897
- BEST FOR:
1898
- - Complex projects
1899
- - Uncertain requirements
1900
- - Long-term efforts
1901
- - Diverse objectives`,
1902
- };
1903
- return modeMap[mode] || modeMap['centralized'];
1904
- }
1905
- /**
1906
- * Get agent recommendations based on strategy
1907
- */
1908
- function getAgentRecommendations(strategy, maxAgents, objective) {
1909
- const recommendations = {
1910
- auto: `
1911
- 🤖 RECOMMENDED AGENT COMPOSITION (Auto-detected):
1912
- ⚡ SPAWN ALL AGENTS IN ONE BATCH - Copy this entire block:
1913
-
1914
- \`\`\`
1915
- [BatchTool - Single Message]:
1916
- mcp__claude-flow__agent_spawn {"type": "coordinator", "name": "SwarmLead"}
1917
- mcp__claude-flow__agent_spawn {"type": "researcher", "name": "RequirementsAnalyst"}
1918
- mcp__claude-flow__agent_spawn {"type": "architect", "name": "SystemDesigner"}
1919
- mcp__claude-flow__memory_store {"key": "swarm/objective", "value": "${objective}"}
1920
- mcp__claude-flow__task_create {"name": "Analyze Requirements", "assignTo": "RequirementsAnalyst"}
1921
- mcp__claude-flow__task_create {"name": "Design Architecture", "assignTo": "SystemDesigner", "dependsOn": ["Analyze Requirements"]}
1922
- TodoWrite {"todos": [
1923
- {"id": "1", "content": "Initialize swarm coordination", "status": "completed", "priority": "high"},
1924
- {"id": "2", "content": "Analyze objective requirements", "status": "in_progress", "priority": "high"},
1925
- {"id": "3", "content": "Design system architecture", "status": "pending", "priority": "high"},
1926
- {"id": "4", "content": "Spawn additional agents as needed", "status": "pending", "priority": "medium"}
1927
- ]}
1928
- \`\`\``,
1929
- research: `
1930
- 🔬 RECOMMENDED RESEARCH AGENTS:
1931
- ⚡ SPAWN ALL AGENTS IN ONE BATCH - Copy this entire block:
1932
-
1933
- \`\`\`
1934
- [BatchTool - Single Message]:
1935
- mcp__claude-flow__agent_spawn {"type": "coordinator", "name": "ResearchLead"}
1936
- mcp__claude-flow__agent_spawn {"type": "researcher", "name": "PrimaryInvestigator"}
1937
- mcp__claude-flow__agent_spawn {"type": "analyst", "name": "DataScientist"}
1938
- mcp__claude-flow__agent_spawn {"type": "researcher", "name": "LiteratureExpert"}
1939
- mcp__claude-flow__agent_spawn {"type": "analyst", "name": "InsightsCompiler"}
1940
- mcp__claude-flow__memory_store {"key": "research/objective", "value": "${objective}"}
1941
- mcp__claude-flow__task_create {"name": "Literature Review", "assignTo": "LiteratureExpert"}
1942
- mcp__claude-flow__task_create {"name": "Primary Research", "assignTo": "PrimaryInvestigator"}
1943
- mcp__claude-flow__task_create {"name": "Data Analysis", "assignTo": "DataScientist"}
1944
- mcp__claude-flow__task_create {"name": "Compile Insights", "assignTo": "InsightsCompiler", "dependsOn": ["Literature Review", "Primary Research", "Data Analysis"]}
1945
- TodoWrite {"todos": [
1946
- {"id": "1", "content": "Initialize research swarm", "status": "completed", "priority": "high"},
1947
- {"id": "2", "content": "Conduct literature review", "status": "in_progress", "priority": "high"},
1948
- {"id": "3", "content": "Execute primary research", "status": "in_progress", "priority": "high"},
1949
- {"id": "4", "content": "Analyze collected data", "status": "pending", "priority": "high"},
1950
- {"id": "5", "content": "Compile and synthesize insights", "status": "pending", "priority": "medium"}
1951
- ]}
1952
- \`\`\``,
1953
- development: `
1954
- 💻 RECOMMENDED DEVELOPMENT AGENTS:
1955
- ⚡ SPAWN ALL AGENTS IN ONE BATCH - Copy this entire block:
1956
-
1957
- \`\`\`
1958
- [BatchTool - Single Message]:
1959
- mcp__claude-flow__agent_spawn {"type": "coordinator", "name": "TechLead"}
1960
- mcp__claude-flow__agent_spawn {"type": "architect", "name": "SystemArchitect"}
1961
- mcp__claude-flow__agent_spawn {"type": "coder", "name": "BackendDev"}
1962
- mcp__claude-flow__agent_spawn {"type": "coder", "name": "FrontendDev"}
1963
- mcp__claude-flow__agent_spawn {"type": "tester", "name": "QAEngineer"}
1964
- mcp__claude-flow__memory_store {"key": "dev/objective", "value": "${objective}"}
1965
- mcp__claude-flow__task_create {"name": "System Architecture", "assignTo": "SystemArchitect"}
1966
- mcp__claude-flow__task_create {"name": "Backend Implementation", "assignTo": "BackendDev", "dependsOn": ["System Architecture"]}
1967
- mcp__claude-flow__task_create {"name": "Frontend Implementation", "assignTo": "FrontendDev", "dependsOn": ["System Architecture"]}
1968
- mcp__claude-flow__task_create {"name": "Testing Suite", "assignTo": "QAEngineer", "dependsOn": ["Backend Implementation", "Frontend Implementation"]}
1969
- TodoWrite {"todos": [
1970
- {"id": "1", "content": "Initialize development swarm", "status": "completed", "priority": "high"},
1971
- {"id": "2", "content": "Design system architecture", "status": "in_progress", "priority": "high"},
1972
- {"id": "3", "content": "Implement backend services", "status": "pending", "priority": "high"},
1973
- {"id": "4", "content": "Implement frontend UI", "status": "pending", "priority": "high"},
1974
- {"id": "5", "content": "Create comprehensive tests", "status": "pending", "priority": "medium"}
1975
- ]}
1976
- \`\`\``,
1977
- analysis: `
1978
- 📊 RECOMMENDED ANALYSIS AGENTS:
1979
- ⚡ SPAWN ALL AGENTS IN ONE BATCH - Copy this entire block:
1980
-
1981
- \`\`\`
1982
- [BatchTool - Single Message]:
1983
- mcp__claude-flow__agent_spawn {"type": "coordinator", "name": "AnalysisLead"}
1984
- mcp__claude-flow__agent_spawn {"type": "analyst", "name": "DataEngineer"}
1985
- mcp__claude-flow__agent_spawn {"type": "analyst", "name": "StatisticalExpert"}
1986
- mcp__claude-flow__agent_spawn {"type": "coder", "name": "VisualizationDev"}
1987
- mcp__claude-flow__agent_spawn {"type": "analyst", "name": "BusinessAnalyst"}
1988
- mcp__claude-flow__memory_store {"key": "analysis/objective", "value": "${objective}"}
1989
- mcp__claude-flow__task_create {"name": "Data Pipeline Setup", "assignTo": "DataEngineer"}
1990
- mcp__claude-flow__task_create {"name": "Statistical Analysis", "assignTo": "StatisticalExpert", "dependsOn": ["Data Pipeline Setup"]}
1991
- mcp__claude-flow__task_create {"name": "Create Visualizations", "assignTo": "VisualizationDev", "dependsOn": ["Statistical Analysis"]}
1992
- mcp__claude-flow__task_create {"name": "Business Insights", "assignTo": "BusinessAnalyst", "dependsOn": ["Statistical Analysis"]}
1993
- TodoWrite {"todos": [
1994
- {"id": "1", "content": "Initialize analysis swarm", "status": "completed", "priority": "high"},
1995
- {"id": "2", "content": "Setup data pipelines", "status": "in_progress", "priority": "high"},
1996
- {"id": "3", "content": "Perform statistical analysis", "status": "pending", "priority": "high"},
1997
- {"id": "4", "content": "Create data visualizations", "status": "pending", "priority": "medium"},
1998
- {"id": "5", "content": "Generate business insights", "status": "pending", "priority": "medium"}
1999
- ]}
2000
- \`\`\``,
2001
- testing: `
2002
- 🧪 RECOMMENDED TESTING AGENTS:
2003
- ⚡ SPAWN ALL AGENTS IN ONE BATCH - Copy this entire block:
2004
-
2005
- \`\`\`
2006
- [BatchTool - Single Message]:
2007
- mcp__claude-flow__agent_spawn {"type": "coordinator", "name": "QALead"}
2008
- mcp__claude-flow__agent_spawn {"type": "tester", "name": "UnitTestEngineer"}
2009
- mcp__claude-flow__agent_spawn {"type": "tester", "name": "IntegrationTester"}
2010
- mcp__claude-flow__agent_spawn {"type": "tester", "name": "PerformanceTester"}
2011
- mcp__claude-flow__agent_spawn {"type": "tester", "name": "SecurityAuditor"}
2012
- mcp__claude-flow__memory_store {"key": "testing/objective", "value": "${objective}"}
2013
- mcp__claude-flow__task_create {"name": "Unit Test Suite", "assignTo": "UnitTestEngineer"}
2014
- mcp__claude-flow__task_create {"name": "Integration Tests", "assignTo": "IntegrationTester"}
2015
- mcp__claude-flow__task_create {"name": "Performance Tests", "assignTo": "PerformanceTester"}
2016
- mcp__claude-flow__task_create {"name": "Security Audit", "assignTo": "SecurityAuditor"}
2017
- TodoWrite {"todos": [
2018
- {"id": "1", "content": "Initialize testing swarm", "status": "completed", "priority": "high"},
2019
- {"id": "2", "content": "Create unit tests", "status": "in_progress", "priority": "high"},
2020
- {"id": "3", "content": "Create integration tests", "status": "in_progress", "priority": "high"},
2021
- {"id": "4", "content": "Run performance tests", "status": "pending", "priority": "medium"},
2022
- {"id": "5", "content": "Execute security audit", "status": "pending", "priority": "high"}
2023
- ]}
2024
- \`\`\``,
2025
- optimization: `
2026
- ⚡ RECOMMENDED OPTIMIZATION AGENTS:
2027
- ⚡ SPAWN ALL AGENTS IN ONE BATCH - Copy this entire block:
2028
-
2029
- \`\`\`
2030
- [BatchTool - Single Message]:
2031
- mcp__claude-flow__agent_spawn {"type": "coordinator", "name": "OptimizationLead"}
2032
- mcp__claude-flow__agent_spawn {"type": "analyst", "name": "PerformanceProfiler"}
2033
- mcp__claude-flow__agent_spawn {"type": "coder", "name": "AlgorithmExpert"}
2034
- mcp__claude-flow__agent_spawn {"type": "analyst", "name": "DatabaseOptimizer"}
2035
- mcp__claude-flow__agent_spawn {"type": "coder", "name": "SystemsTuner"}
2036
- mcp__claude-flow__memory_store {"key": "optimization/objective", "value": "${objective}"}
2037
- mcp__claude-flow__task_create {"name": "Performance Profiling", "assignTo": "PerformanceProfiler"}
2038
- mcp__claude-flow__task_create {"name": "Algorithm Optimization", "assignTo": "AlgorithmExpert", "dependsOn": ["Performance Profiling"]}
2039
- mcp__claude-flow__task_create {"name": "Database Optimization", "assignTo": "DatabaseOptimizer", "dependsOn": ["Performance Profiling"]}
2040
- mcp__claude-flow__task_create {"name": "System Tuning", "assignTo": "SystemsTuner", "dependsOn": ["Performance Profiling"]}
2041
- TodoWrite {"todos": [
2042
- {"id": "1", "content": "Initialize optimization swarm", "status": "completed", "priority": "high"},
2043
- {"id": "2", "content": "Profile system performance", "status": "in_progress", "priority": "high"},
2044
- {"id": "3", "content": "Optimize algorithms", "status": "pending", "priority": "high"},
2045
- {"id": "4", "content": "Optimize database queries", "status": "pending", "priority": "high"},
2046
- {"id": "5", "content": "Tune system parameters", "status": "pending", "priority": "medium"}
2047
- ]}
2048
- \`\`\``,
2049
- maintenance: `
2050
- 🔧 RECOMMENDED MAINTENANCE AGENTS:
2051
- ⚡ SPAWN ALL AGENTS IN ONE BATCH - Copy this entire block:
2052
-
2053
- \`\`\`
2054
- [BatchTool - Single Message]:
2055
- mcp__claude-flow__agent_spawn {"type": "coordinator", "name": "MaintenanceLead"}
2056
- mcp__claude-flow__agent_spawn {"type": "analyst", "name": "SystemAuditor"}
2057
- mcp__claude-flow__agent_spawn {"type": "coder", "name": "PatchDeveloper"}
2058
- mcp__claude-flow__agent_spawn {"type": "tester", "name": "RegressionTester"}
2059
- mcp__claude-flow__agent_spawn {"type": "analyst", "name": "DocumentationUpdater"}
2060
- mcp__claude-flow__memory_store {"key": "maintenance/objective", "value": "${objective}"}
2061
- mcp__claude-flow__task_create {"name": "System Audit", "assignTo": "SystemAuditor"}
2062
- mcp__claude-flow__task_create {"name": "Develop Patches", "assignTo": "PatchDeveloper", "dependsOn": ["System Audit"]}
2063
- mcp__claude-flow__task_create {"name": "Regression Testing", "assignTo": "RegressionTester", "dependsOn": ["Develop Patches"]}
2064
- mcp__claude-flow__task_create {"name": "Update Documentation", "assignTo": "DocumentationUpdater", "dependsOn": ["Develop Patches"]}
2065
- TodoWrite {"todos": [
2066
- {"id": "1", "content": "Initialize maintenance swarm", "status": "completed", "priority": "high"},
2067
- {"id": "2", "content": "Audit system health", "status": "in_progress", "priority": "high"},
2068
- {"id": "3", "content": "Develop necessary patches", "status": "pending", "priority": "high"},
2069
- {"id": "4", "content": "Run regression tests", "status": "pending", "priority": "high"},
2070
- {"id": "5", "content": "Update documentation", "status": "pending", "priority": "medium"}
2071
- ]}
2072
- \`\`\``,
2073
- };
2074
- return recommendations[strategy] || recommendations['auto'];
2075
- }
2076
- // Allow direct execution
2077
- if (import.meta.main) {
2078
- // When called directly as a script, parse all arguments
2079
- const args = [];
2080
- const flags = {};
2081
- // Parse arguments and flags
2082
- for (let i = 0; i < args.length; i++) {
2083
- const arg = args[i];
2084
- if (arg.startsWith('--')) {
2085
- const flagName = arg.substring(2);
2086
- const nextArg = args[i + 1];
2087
- if (nextArg && !nextArg.startsWith('--')) {
2088
- flags[flagName] = nextArg;
2089
- i++; // Skip the next argument
2090
- }
2091
- else {
2092
- flags[flagName] = true;
2093
- }
2094
- }
2095
- else {
2096
- args.push(arg);
2097
- }
2098
- }
2099
- // The objective is all non-flag arguments joined
2100
- const objective = args.join(' ');
2101
- // Execute the swarm command
2102
- await swarmCommand([objective], flags);
2103
- }
2104
- //# sourceMappingURL=swarm.js.map