claude-flow 2.7.0 → 2.7.1

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 (1071) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/bin/claude-flow +1 -1
  3. package/dist/src/cli/simple-cli.js +104 -0
  4. package/dist/src/cli/simple-cli.js.map +1 -1
  5. package/dist/src/cli/simple-commands/config.js +115 -257
  6. package/dist/src/cli/simple-commands/config.js.map +1 -1
  7. package/dist/src/cli/validation-helper.js.map +1 -1
  8. package/dist/src/mcp/mcp-server.js +261 -3
  9. package/dist/src/mcp/mcp-server.js.map +1 -1
  10. package/dist/src/utils/key-redactor.js.map +1 -1
  11. package/dist/src/utils/metrics-reader.js +41 -29
  12. package/dist/src/utils/metrics-reader.js.map +1 -1
  13. package/docs/PATTERN_PERSISTENCE_FIX.md +328 -0
  14. package/docs/RELEASE_v2.7.1.md +244 -0
  15. package/docs/skills-tutorial.md +2 -2
  16. package/package.json +1 -1
  17. package/src/mcp/mcp-server.js +302 -2
  18. package/dist/agents/agent-loader.d.ts +0 -103
  19. package/dist/agents/agent-loader.d.ts.map +0 -1
  20. package/dist/agents/agent-loader.js +0 -220
  21. package/dist/agents/agent-loader.js.map +0 -1
  22. package/dist/agents/agent-manager.d.ts +0 -191
  23. package/dist/agents/agent-manager.d.ts.map +0 -1
  24. package/dist/agents/agent-manager.js +0 -1405
  25. package/dist/agents/agent-manager.js.map +0 -1
  26. package/dist/api/claude-api-errors.d.ts +0 -115
  27. package/dist/api/claude-api-errors.d.ts.map +0 -1
  28. package/dist/api/claude-api-errors.js +0 -198
  29. package/dist/api/claude-api-errors.js.map +0 -1
  30. package/dist/api/claude-client.d.ts +0 -197
  31. package/dist/api/claude-client.d.ts.map +0 -1
  32. package/dist/api/claude-client.js +0 -525
  33. package/dist/api/claude-client.js.map +0 -1
  34. package/dist/cli/cli-core.d.ts +0 -52
  35. package/dist/cli/cli-core.d.ts.map +0 -1
  36. package/dist/cli/cli-core.js +0 -264
  37. package/dist/cli/cli-core.js.map +0 -1
  38. package/dist/cli/command-registry.d.ts +0 -10
  39. package/dist/cli/command-registry.d.ts.map +0 -1
  40. package/dist/cli/command-registry.js +0 -1126
  41. package/dist/cli/command-registry.js.map +0 -1
  42. package/dist/cli/commander-fix.d.ts +0 -4
  43. package/dist/cli/commander-fix.d.ts.map +0 -1
  44. package/dist/cli/commander-fix.js +0 -6
  45. package/dist/cli/commander-fix.js.map +0 -1
  46. package/dist/cli/commands/agent.d.ts +0 -6
  47. package/dist/cli/commands/agent.d.ts.map +0 -1
  48. package/dist/cli/commands/agent.js +0 -382
  49. package/dist/cli/commands/agent.js.map +0 -1
  50. package/dist/cli/commands/config.d.ts +0 -4
  51. package/dist/cli/commands/config.d.ts.map +0 -1
  52. package/dist/cli/commands/config.js +0 -88
  53. package/dist/cli/commands/config.js.map +0 -1
  54. package/dist/cli/commands/enterprise.d.ts +0 -3
  55. package/dist/cli/commands/enterprise.d.ts.map +0 -1
  56. package/dist/cli/commands/enterprise.js +0 -1506
  57. package/dist/cli/commands/enterprise.js.map +0 -1
  58. package/dist/cli/commands/help.d.ts +0 -6
  59. package/dist/cli/commands/help.d.ts.map +0 -1
  60. package/dist/cli/commands/help.js +0 -936
  61. package/dist/cli/commands/help.js.map +0 -1
  62. package/dist/cli/commands/hive-mind/index.d.ts +0 -18
  63. package/dist/cli/commands/hive-mind/index.d.ts.map +0 -1
  64. package/dist/cli/commands/hive-mind/index.js +0 -30
  65. package/dist/cli/commands/hive-mind/index.js.map +0 -1
  66. package/dist/cli/commands/hive-mind/init.d.ts +0 -9
  67. package/dist/cli/commands/hive-mind/init.d.ts.map +0 -1
  68. package/dist/cli/commands/hive-mind/init.js +0 -68
  69. package/dist/cli/commands/hive-mind/init.js.map +0 -1
  70. package/dist/cli/commands/hive-mind/pause.d.ts +0 -8
  71. package/dist/cli/commands/hive-mind/pause.d.ts.map +0 -1
  72. package/dist/cli/commands/hive-mind/pause.js +0 -81
  73. package/dist/cli/commands/hive-mind/pause.js.map +0 -1
  74. package/dist/cli/commands/hive-mind/ps.d.ts +0 -8
  75. package/dist/cli/commands/hive-mind/ps.d.ts.map +0 -1
  76. package/dist/cli/commands/hive-mind/ps.js +0 -120
  77. package/dist/cli/commands/hive-mind/ps.js.map +0 -1
  78. package/dist/cli/commands/hive-mind/resume.d.ts +0 -8
  79. package/dist/cli/commands/hive-mind/resume.d.ts.map +0 -1
  80. package/dist/cli/commands/hive-mind/resume.js +0 -62
  81. package/dist/cli/commands/hive-mind/resume.js.map +0 -1
  82. package/dist/cli/commands/hive-mind/spawn.d.ts +0 -9
  83. package/dist/cli/commands/hive-mind/spawn.d.ts.map +0 -1
  84. package/dist/cli/commands/hive-mind/spawn.js +0 -174
  85. package/dist/cli/commands/hive-mind/spawn.js.map +0 -1
  86. package/dist/cli/commands/hive-mind/status.d.ts +0 -9
  87. package/dist/cli/commands/hive-mind/status.d.ts.map +0 -1
  88. package/dist/cli/commands/hive-mind/status.js +0 -204
  89. package/dist/cli/commands/hive-mind/status.js.map +0 -1
  90. package/dist/cli/commands/hive-mind/stop.d.ts +0 -8
  91. package/dist/cli/commands/hive-mind/stop.d.ts.map +0 -1
  92. package/dist/cli/commands/hive-mind/stop.js +0 -125
  93. package/dist/cli/commands/hive-mind/stop.js.map +0 -1
  94. package/dist/cli/commands/hive-mind/task.d.ts +0 -9
  95. package/dist/cli/commands/hive-mind/task.d.ts.map +0 -1
  96. package/dist/cli/commands/hive-mind/task.js +0 -294
  97. package/dist/cli/commands/hive-mind/task.js.map +0 -1
  98. package/dist/cli/commands/hive-mind/wizard.d.ts +0 -9
  99. package/dist/cli/commands/hive-mind/wizard.d.ts.map +0 -1
  100. package/dist/cli/commands/hive-mind/wizard.js +0 -531
  101. package/dist/cli/commands/hive-mind/wizard.js.map +0 -1
  102. package/dist/cli/commands/hive.d.ts +0 -6
  103. package/dist/cli/commands/hive.d.ts.map +0 -1
  104. package/dist/cli/commands/hive.js +0 -409
  105. package/dist/cli/commands/hive.js.map +0 -1
  106. package/dist/cli/commands/index.d.ts +0 -3
  107. package/dist/cli/commands/index.d.ts.map +0 -1
  108. package/dist/cli/commands/index.js +0 -2624
  109. package/dist/cli/commands/index.js.map +0 -1
  110. package/dist/cli/commands/mcp.d.ts +0 -5
  111. package/dist/cli/commands/mcp.d.ts.map +0 -1
  112. package/dist/cli/commands/mcp.js +0 -169
  113. package/dist/cli/commands/mcp.js.map +0 -1
  114. package/dist/cli/commands/memory.d.ts +0 -26
  115. package/dist/cli/commands/memory.d.ts.map +0 -1
  116. package/dist/cli/commands/memory.js +0 -225
  117. package/dist/cli/commands/memory.js.map +0 -1
  118. package/dist/cli/commands/migrate.d.ts +0 -5
  119. package/dist/cli/commands/migrate.d.ts.map +0 -1
  120. package/dist/cli/commands/migrate.js +0 -139
  121. package/dist/cli/commands/migrate.js.map +0 -1
  122. package/dist/cli/commands/monitor.d.ts +0 -5
  123. package/dist/cli/commands/monitor.d.ts.map +0 -1
  124. package/dist/cli/commands/monitor.js +0 -493
  125. package/dist/cli/commands/monitor.js.map +0 -1
  126. package/dist/cli/commands/session.d.ts +0 -5
  127. package/dist/cli/commands/session.d.ts.map +0 -1
  128. package/dist/cli/commands/session.js +0 -548
  129. package/dist/cli/commands/session.js.map +0 -1
  130. package/dist/cli/commands/sparc.d.ts +0 -3
  131. package/dist/cli/commands/sparc.d.ts.map +0 -1
  132. package/dist/cli/commands/sparc.js +0 -472
  133. package/dist/cli/commands/sparc.js.map +0 -1
  134. package/dist/cli/commands/start/event-emitter.d.ts +0 -13
  135. package/dist/cli/commands/start/event-emitter.d.ts.map +0 -1
  136. package/dist/cli/commands/start/event-emitter.js +0 -35
  137. package/dist/cli/commands/start/event-emitter.js.map +0 -1
  138. package/dist/cli/commands/start/index.d.ts +0 -10
  139. package/dist/cli/commands/start/index.d.ts.map +0 -1
  140. package/dist/cli/commands/start/index.js +0 -9
  141. package/dist/cli/commands/start/index.js.map +0 -1
  142. package/dist/cli/commands/start/process-manager.d.ts +0 -31
  143. package/dist/cli/commands/start/process-manager.d.ts.map +0 -1
  144. package/dist/cli/commands/start/process-manager.js +0 -283
  145. package/dist/cli/commands/start/process-manager.js.map +0 -1
  146. package/dist/cli/commands/start/process-ui-simple.d.ts +0 -29
  147. package/dist/cli/commands/start/process-ui-simple.d.ts.map +0 -1
  148. package/dist/cli/commands/start/process-ui-simple.js +0 -334
  149. package/dist/cli/commands/start/process-ui-simple.js.map +0 -1
  150. package/dist/cli/commands/start/process-ui.d.ts +0 -5
  151. package/dist/cli/commands/start/process-ui.d.ts.map +0 -1
  152. package/dist/cli/commands/start/process-ui.js +0 -5
  153. package/dist/cli/commands/start/process-ui.js.map +0 -1
  154. package/dist/cli/commands/start/start-command.d.ts +0 -2
  155. package/dist/cli/commands/start/start-command.d.ts.map +0 -1
  156. package/dist/cli/commands/start/start-command.js +0 -462
  157. package/dist/cli/commands/start/start-command.js.map +0 -1
  158. package/dist/cli/commands/start/system-monitor.d.ts +0 -25
  159. package/dist/cli/commands/start/system-monitor.d.ts.map +0 -1
  160. package/dist/cli/commands/start/system-monitor.js +0 -265
  161. package/dist/cli/commands/start/system-monitor.js.map +0 -1
  162. package/dist/cli/commands/start/types.d.ts +0 -64
  163. package/dist/cli/commands/start/types.d.ts.map +0 -1
  164. package/dist/cli/commands/start/types.js +0 -22
  165. package/dist/cli/commands/start/types.js.map +0 -1
  166. package/dist/cli/commands/start.d.ts +0 -6
  167. package/dist/cli/commands/start.d.ts.map +0 -1
  168. package/dist/cli/commands/start.js +0 -6
  169. package/dist/cli/commands/start.js.map +0 -1
  170. package/dist/cli/commands/status.d.ts +0 -2
  171. package/dist/cli/commands/status.d.ts.map +0 -1
  172. package/dist/cli/commands/status.js +0 -304
  173. package/dist/cli/commands/status.js.map +0 -1
  174. package/dist/cli/commands/swarm.d.ts +0 -6
  175. package/dist/cli/commands/swarm.d.ts.map +0 -1
  176. package/dist/cli/commands/swarm.js +0 -465
  177. package/dist/cli/commands/swarm.js.map +0 -1
  178. package/dist/cli/commands/task.d.ts +0 -2
  179. package/dist/cli/commands/task.d.ts.map +0 -1
  180. package/dist/cli/commands/task.js +0 -75
  181. package/dist/cli/commands/task.js.map +0 -1
  182. package/dist/cli/commands/workflow.d.ts +0 -2
  183. package/dist/cli/commands/workflow.d.ts.map +0 -1
  184. package/dist/cli/commands/workflow.js +0 -624
  185. package/dist/cli/commands/workflow.js.map +0 -1
  186. package/dist/cli/completion.d.ts +0 -19
  187. package/dist/cli/completion.d.ts.map +0 -1
  188. package/dist/cli/completion.js +0 -545
  189. package/dist/cli/completion.js.map +0 -1
  190. package/dist/cli/formatter.d.ts +0 -69
  191. package/dist/cli/formatter.d.ts.map +0 -1
  192. package/dist/cli/formatter.js +0 -277
  193. package/dist/cli/formatter.js.map +0 -1
  194. package/dist/cli/help-formatter.d.ts +0 -49
  195. package/dist/cli/help-formatter.d.ts.map +0 -1
  196. package/dist/cli/help-formatter.js +0 -108
  197. package/dist/cli/help-formatter.js.map +0 -1
  198. package/dist/cli/help-text.d.ts +0 -25
  199. package/dist/cli/help-text.d.ts.map +0 -1
  200. package/dist/cli/help-text.js +0 -1051
  201. package/dist/cli/help-text.js.map +0 -1
  202. package/dist/cli/index-remote.d.ts +0 -7
  203. package/dist/cli/index-remote.d.ts.map +0 -1
  204. package/dist/cli/index-remote.js +0 -125
  205. package/dist/cli/index-remote.js.map +0 -1
  206. package/dist/cli/index.d.ts +0 -7
  207. package/dist/cli/index.d.ts.map +0 -1
  208. package/dist/cli/index.js +0 -189
  209. package/dist/cli/index.js.map +0 -1
  210. package/dist/cli/node-compat.d.ts +0 -81
  211. package/dist/cli/node-compat.d.ts.map +0 -1
  212. package/dist/cli/node-compat.js +0 -229
  213. package/dist/cli/node-compat.js.map +0 -1
  214. package/dist/cli/repl.d.ts +0 -5
  215. package/dist/cli/repl.d.ts.map +0 -1
  216. package/dist/cli/repl.js +0 -949
  217. package/dist/cli/repl.js.map +0 -1
  218. package/dist/cli/runtime-detector.d.ts +0 -128
  219. package/dist/cli/runtime-detector.d.ts.map +0 -1
  220. package/dist/cli/runtime-detector.js +0 -267
  221. package/dist/cli/runtime-detector.js.map +0 -1
  222. package/dist/cli/simple-cli.d.ts +0 -7
  223. package/dist/cli/simple-cli.d.ts.map +0 -1
  224. package/dist/cli/simple-cli.js +0 -3085
  225. package/dist/cli/simple-cli.js.map +0 -1
  226. package/dist/cli/simple-commands/agent.d.ts +0 -6
  227. package/dist/cli/simple-commands/agent.d.ts.map +0 -1
  228. package/dist/cli/simple-commands/agent.js +0 -128
  229. package/dist/cli/simple-commands/agent.js.map +0 -1
  230. package/dist/cli/simple-commands/analysis.d.ts +0 -2
  231. package/dist/cli/simple-commands/analysis.d.ts.map +0 -1
  232. package/dist/cli/simple-commands/analysis.js +0 -473
  233. package/dist/cli/simple-commands/analysis.js.map +0 -1
  234. package/dist/cli/simple-commands/automation-executor.d.ts +0 -188
  235. package/dist/cli/simple-commands/automation-executor.d.ts.map +0 -1
  236. package/dist/cli/simple-commands/automation-executor.js +0 -1383
  237. package/dist/cli/simple-commands/automation-executor.js.map +0 -1
  238. package/dist/cli/simple-commands/automation.d.ts +0 -2
  239. package/dist/cli/simple-commands/automation.d.ts.map +0 -1
  240. package/dist/cli/simple-commands/automation.js +0 -531
  241. package/dist/cli/simple-commands/automation.js.map +0 -1
  242. package/dist/cli/simple-commands/batch-manager.d.ts +0 -2
  243. package/dist/cli/simple-commands/batch-manager.d.ts.map +0 -1
  244. package/dist/cli/simple-commands/batch-manager.js +0 -290
  245. package/dist/cli/simple-commands/batch-manager.js.map +0 -1
  246. package/dist/cli/simple-commands/claude-telemetry.d.ts +0 -14
  247. package/dist/cli/simple-commands/claude-telemetry.d.ts.map +0 -1
  248. package/dist/cli/simple-commands/claude-telemetry.js +0 -263
  249. package/dist/cli/simple-commands/claude-telemetry.js.map +0 -1
  250. package/dist/cli/simple-commands/config.d.ts +0 -6
  251. package/dist/cli/simple-commands/config.d.ts.map +0 -1
  252. package/dist/cli/simple-commands/config.js +0 -116
  253. package/dist/cli/simple-commands/config.js.map +0 -1
  254. package/dist/cli/simple-commands/coordination.d.ts +0 -2
  255. package/dist/cli/simple-commands/coordination.d.ts.map +0 -1
  256. package/dist/cli/simple-commands/coordination.js +0 -249
  257. package/dist/cli/simple-commands/coordination.js.map +0 -1
  258. package/dist/cli/simple-commands/env-template.d.ts +0 -42
  259. package/dist/cli/simple-commands/env-template.d.ts.map +0 -1
  260. package/dist/cli/simple-commands/env-template.js +0 -183
  261. package/dist/cli/simple-commands/env-template.js.map +0 -1
  262. package/dist/cli/simple-commands/fix-hook-variables.d.ts +0 -16
  263. package/dist/cli/simple-commands/fix-hook-variables.d.ts.map +0 -1
  264. package/dist/cli/simple-commands/fix-hook-variables.js +0 -320
  265. package/dist/cli/simple-commands/fix-hook-variables.js.map +0 -1
  266. package/dist/cli/simple-commands/github/init.d.ts +0 -6
  267. package/dist/cli/simple-commands/github/init.d.ts.map +0 -1
  268. package/dist/cli/simple-commands/github/init.js +0 -506
  269. package/dist/cli/simple-commands/github/init.js.map +0 -1
  270. package/dist/cli/simple-commands/github.d.ts +0 -3
  271. package/dist/cli/simple-commands/github.d.ts.map +0 -1
  272. package/dist/cli/simple-commands/github.js +0 -356
  273. package/dist/cli/simple-commands/github.js.map +0 -1
  274. package/dist/cli/simple-commands/goal.d.ts +0 -3
  275. package/dist/cli/simple-commands/goal.d.ts.map +0 -1
  276. package/dist/cli/simple-commands/goal.js +0 -136
  277. package/dist/cli/simple-commands/goal.js.map +0 -1
  278. package/dist/cli/simple-commands/hive-mind/auto-save-middleware.d.ts +0 -68
  279. package/dist/cli/simple-commands/hive-mind/auto-save-middleware.d.ts.map +0 -1
  280. package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js +0 -264
  281. package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js.map +0 -1
  282. package/dist/cli/simple-commands/hive-mind/communication.d.ts +0 -176
  283. package/dist/cli/simple-commands/hive-mind/communication.d.ts.map +0 -1
  284. package/dist/cli/simple-commands/hive-mind/communication.js +0 -611
  285. package/dist/cli/simple-commands/hive-mind/communication.js.map +0 -1
  286. package/dist/cli/simple-commands/hive-mind/core.d.ts +0 -306
  287. package/dist/cli/simple-commands/hive-mind/core.d.ts.map +0 -1
  288. package/dist/cli/simple-commands/hive-mind/core.js +0 -839
  289. package/dist/cli/simple-commands/hive-mind/core.js.map +0 -1
  290. package/dist/cli/simple-commands/hive-mind/db-optimizer.d.ts +0 -32
  291. package/dist/cli/simple-commands/hive-mind/db-optimizer.d.ts.map +0 -1
  292. package/dist/cli/simple-commands/hive-mind/db-optimizer.js +0 -702
  293. package/dist/cli/simple-commands/hive-mind/db-optimizer.js.map +0 -1
  294. package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts +0 -270
  295. package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts.map +0 -1
  296. package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js +0 -1211
  297. package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js.map +0 -1
  298. package/dist/cli/simple-commands/hive-mind/memory.d.ts +0 -334
  299. package/dist/cli/simple-commands/hive-mind/memory.d.ts.map +0 -1
  300. package/dist/cli/simple-commands/hive-mind/memory.js +0 -1068
  301. package/dist/cli/simple-commands/hive-mind/memory.js.map +0 -1
  302. package/dist/cli/simple-commands/hive-mind/metrics-reader.js +0 -274
  303. package/dist/cli/simple-commands/hive-mind/metrics-reader.js.map +0 -1
  304. package/dist/cli/simple-commands/hive-mind/performance-optimizer.d.ts +0 -256
  305. package/dist/cli/simple-commands/hive-mind/performance-optimizer.d.ts.map +0 -1
  306. package/dist/cli/simple-commands/hive-mind/performance-optimizer.js +0 -520
  307. package/dist/cli/simple-commands/hive-mind/performance-optimizer.js.map +0 -1
  308. package/dist/cli/simple-commands/hive-mind/queen.d.ts +0 -235
  309. package/dist/cli/simple-commands/hive-mind/queen.d.ts.map +0 -1
  310. package/dist/cli/simple-commands/hive-mind/queen.js +0 -697
  311. package/dist/cli/simple-commands/hive-mind/queen.js.map +0 -1
  312. package/dist/cli/simple-commands/hive-mind/session-manager.d.ts +0 -140
  313. package/dist/cli/simple-commands/hive-mind/session-manager.d.ts.map +0 -1
  314. package/dist/cli/simple-commands/hive-mind/session-manager.js +0 -1000
  315. package/dist/cli/simple-commands/hive-mind/session-manager.js.map +0 -1
  316. package/dist/cli/simple-commands/hive-mind-optimize.d.ts +0 -6
  317. package/dist/cli/simple-commands/hive-mind-optimize.d.ts.map +0 -1
  318. package/dist/cli/simple-commands/hive-mind-optimize.js +0 -317
  319. package/dist/cli/simple-commands/hive-mind-optimize.js.map +0 -1
  320. package/dist/cli/simple-commands/hive-mind.d.ts +0 -22
  321. package/dist/cli/simple-commands/hive-mind.d.ts.map +0 -1
  322. package/dist/cli/simple-commands/hive-mind.js +0 -2722
  323. package/dist/cli/simple-commands/hive-mind.js.map +0 -1
  324. package/dist/cli/simple-commands/hook-safety.d.ts +0 -177
  325. package/dist/cli/simple-commands/hook-safety.d.ts.map +0 -1
  326. package/dist/cli/simple-commands/hook-safety.js +0 -590
  327. package/dist/cli/simple-commands/hook-safety.js.map +0 -1
  328. package/dist/cli/simple-commands/hooks.d.ts +0 -3
  329. package/dist/cli/simple-commands/hooks.d.ts.map +0 -1
  330. package/dist/cli/simple-commands/hooks.js +0 -1298
  331. package/dist/cli/simple-commands/hooks.js.map +0 -1
  332. package/dist/cli/simple-commands/init/agent-copier.d.ts +0 -65
  333. package/dist/cli/simple-commands/init/agent-copier.d.ts.map +0 -1
  334. package/dist/cli/simple-commands/init/agent-copier.js +0 -320
  335. package/dist/cli/simple-commands/init/agent-copier.js.map +0 -1
  336. package/dist/cli/simple-commands/init/batch-init.d.ts +0 -137
  337. package/dist/cli/simple-commands/init/batch-init.d.ts.map +0 -1
  338. package/dist/cli/simple-commands/init/batch-init.js +0 -558
  339. package/dist/cli/simple-commands/init/batch-init.js.map +0 -1
  340. package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.d.ts +0 -2
  341. package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.d.ts.map +0 -1
  342. package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.js +0 -433
  343. package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.js.map +0 -1
  344. package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.d.ts +0 -2
  345. package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.d.ts.map +0 -1
  346. package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +0 -871
  347. package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js.map +0 -1
  348. package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.d.ts +0 -2
  349. package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.d.ts.map +0 -1
  350. package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +0 -332
  351. package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js.map +0 -1
  352. package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.d.ts +0 -3
  353. package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.d.ts.map +0 -1
  354. package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +0 -488
  355. package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js.map +0 -1
  356. package/dist/cli/simple-commands/init/claude-commands/slash-commands.d.ts +0 -2
  357. package/dist/cli/simple-commands/init/claude-commands/slash-commands.d.ts.map +0 -1
  358. package/dist/cli/simple-commands/init/claude-commands/slash-commands.js +0 -51
  359. package/dist/cli/simple-commands/init/claude-commands/slash-commands.js.map +0 -1
  360. package/dist/cli/simple-commands/init/claude-commands/sparc-commands.d.ts +0 -3
  361. package/dist/cli/simple-commands/init/claude-commands/sparc-commands.d.ts.map +0 -1
  362. package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js +0 -288
  363. package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js.map +0 -1
  364. package/dist/cli/simple-commands/init/copy-revised-templates.d.ts +0 -29
  365. package/dist/cli/simple-commands/init/copy-revised-templates.d.ts.map +0 -1
  366. package/dist/cli/simple-commands/init/copy-revised-templates.js +0 -166
  367. package/dist/cli/simple-commands/init/copy-revised-templates.js.map +0 -1
  368. package/dist/cli/simple-commands/init/executable-wrapper.d.ts +0 -2
  369. package/dist/cli/simple-commands/init/executable-wrapper.d.ts.map +0 -1
  370. package/dist/cli/simple-commands/init/executable-wrapper.js +0 -116
  371. package/dist/cli/simple-commands/init/executable-wrapper.js.map +0 -1
  372. package/dist/cli/simple-commands/init/gitignore-updater.d.ts +0 -23
  373. package/dist/cli/simple-commands/init/gitignore-updater.d.ts.map +0 -1
  374. package/dist/cli/simple-commands/init/gitignore-updater.js +0 -128
  375. package/dist/cli/simple-commands/init/gitignore-updater.js.map +0 -1
  376. package/dist/cli/simple-commands/init/help.d.ts +0 -2
  377. package/dist/cli/simple-commands/init/help.d.ts.map +0 -1
  378. package/dist/cli/simple-commands/init/help.js +0 -131
  379. package/dist/cli/simple-commands/init/help.js.map +0 -1
  380. package/dist/cli/simple-commands/init/hive-mind-init.d.ts +0 -152
  381. package/dist/cli/simple-commands/init/hive-mind-init.d.ts.map +0 -1
  382. package/dist/cli/simple-commands/init/hive-mind-init.js +0 -699
  383. package/dist/cli/simple-commands/init/hive-mind-init.js.map +0 -1
  384. package/dist/cli/simple-commands/init/index.d.ts +0 -2
  385. package/dist/cli/simple-commands/init/index.d.ts.map +0 -1
  386. package/dist/cli/simple-commands/init/index.js +0 -1784
  387. package/dist/cli/simple-commands/init/index.js.map +0 -1
  388. package/dist/cli/simple-commands/init/performance-monitor.d.ts +0 -73
  389. package/dist/cli/simple-commands/init/performance-monitor.d.ts.map +0 -1
  390. package/dist/cli/simple-commands/init/performance-monitor.js +0 -277
  391. package/dist/cli/simple-commands/init/performance-monitor.js.map +0 -1
  392. package/dist/cli/simple-commands/init/rollback/backup-manager.d.ts +0 -95
  393. package/dist/cli/simple-commands/init/rollback/backup-manager.d.ts.map +0 -1
  394. package/dist/cli/simple-commands/init/rollback/backup-manager.js +0 -486
  395. package/dist/cli/simple-commands/init/rollback/backup-manager.js.map +0 -1
  396. package/dist/cli/simple-commands/init/rollback/index.d.ts +0 -114
  397. package/dist/cli/simple-commands/init/rollback/index.d.ts.map +0 -1
  398. package/dist/cli/simple-commands/init/rollback/index.js +0 -353
  399. package/dist/cli/simple-commands/init/rollback/index.js.map +0 -1
  400. package/dist/cli/simple-commands/init/rollback/recovery-manager.d.ts +0 -161
  401. package/dist/cli/simple-commands/init/rollback/recovery-manager.d.ts.map +0 -1
  402. package/dist/cli/simple-commands/init/rollback/recovery-manager.js +0 -686
  403. package/dist/cli/simple-commands/init/rollback/recovery-manager.js.map +0 -1
  404. package/dist/cli/simple-commands/init/rollback/rollback-executor.d.ts +0 -112
  405. package/dist/cli/simple-commands/init/rollback/rollback-executor.d.ts.map +0 -1
  406. package/dist/cli/simple-commands/init/rollback/rollback-executor.js +0 -480
  407. package/dist/cli/simple-commands/init/rollback/rollback-executor.js.map +0 -1
  408. package/dist/cli/simple-commands/init/rollback/state-tracker.d.ts +0 -121
  409. package/dist/cli/simple-commands/init/rollback/state-tracker.d.ts.map +0 -1
  410. package/dist/cli/simple-commands/init/rollback/state-tracker.js +0 -432
  411. package/dist/cli/simple-commands/init/rollback/state-tracker.js.map +0 -1
  412. package/dist/cli/simple-commands/init/skills-copier.d.ts +0 -41
  413. package/dist/cli/simple-commands/init/skills-copier.d.ts.map +0 -1
  414. package/dist/cli/simple-commands/init/skills-copier.js +0 -192
  415. package/dist/cli/simple-commands/init/skills-copier.js.map +0 -1
  416. package/dist/cli/simple-commands/init/sparc/roo-readme.d.ts +0 -2
  417. package/dist/cli/simple-commands/init/sparc/roo-readme.d.ts.map +0 -1
  418. package/dist/cli/simple-commands/init/sparc/roo-readme.js +0 -61
  419. package/dist/cli/simple-commands/init/sparc/roo-readme.js.map +0 -1
  420. package/dist/cli/simple-commands/init/sparc/roomodes-config.d.ts +0 -2
  421. package/dist/cli/simple-commands/init/sparc/roomodes-config.d.ts.map +0 -1
  422. package/dist/cli/simple-commands/init/sparc/roomodes-config.js +0 -80
  423. package/dist/cli/simple-commands/init/sparc/roomodes-config.js.map +0 -1
  424. package/dist/cli/simple-commands/init/sparc/workflows.d.ts +0 -2
  425. package/dist/cli/simple-commands/init/sparc/workflows.d.ts.map +0 -1
  426. package/dist/cli/simple-commands/init/sparc/workflows.js +0 -36
  427. package/dist/cli/simple-commands/init/sparc/workflows.js.map +0 -1
  428. package/dist/cli/simple-commands/init/sparc-structure.d.ts +0 -2
  429. package/dist/cli/simple-commands/init/sparc-structure.d.ts.map +0 -1
  430. package/dist/cli/simple-commands/init/sparc-structure.js +0 -63
  431. package/dist/cli/simple-commands/init/sparc-structure.js.map +0 -1
  432. package/dist/cli/simple-commands/init/template-copier.d.ts +0 -27
  433. package/dist/cli/simple-commands/init/template-copier.d.ts.map +0 -1
  434. package/dist/cli/simple-commands/init/template-copier.js +0 -538
  435. package/dist/cli/simple-commands/init/template-copier.js.map +0 -1
  436. package/dist/cli/simple-commands/init/templates/claude-md.d.ts +0 -6
  437. package/dist/cli/simple-commands/init/templates/claude-md.d.ts.map +0 -1
  438. package/dist/cli/simple-commands/init/templates/claude-md.js +0 -1097
  439. package/dist/cli/simple-commands/init/templates/claude-md.js.map +0 -1
  440. package/dist/cli/simple-commands/init/templates/coordination-md.d.ts +0 -4
  441. package/dist/cli/simple-commands/init/templates/coordination-md.d.ts.map +0 -1
  442. package/dist/cli/simple-commands/init/templates/coordination-md.js +0 -338
  443. package/dist/cli/simple-commands/init/templates/coordination-md.js.map +0 -1
  444. package/dist/cli/simple-commands/init/templates/enhanced-templates.d.ts +0 -21
  445. package/dist/cli/simple-commands/init/templates/enhanced-templates.d.ts.map +0 -1
  446. package/dist/cli/simple-commands/init/templates/enhanced-templates.js +0 -2304
  447. package/dist/cli/simple-commands/init/templates/enhanced-templates.js.map +0 -1
  448. package/dist/cli/simple-commands/init/templates/memory-bank-md.d.ts +0 -4
  449. package/dist/cli/simple-commands/init/templates/memory-bank-md.d.ts.map +0 -1
  450. package/dist/cli/simple-commands/init/templates/memory-bank-md.js +0 -257
  451. package/dist/cli/simple-commands/init/templates/memory-bank-md.js.map +0 -1
  452. package/dist/cli/simple-commands/init/templates/readme-files.d.ts +0 -3
  453. package/dist/cli/simple-commands/init/templates/readme-files.d.ts.map +0 -1
  454. package/dist/cli/simple-commands/init/templates/readme-files.js +0 -71
  455. package/dist/cli/simple-commands/init/templates/readme-files.js.map +0 -1
  456. package/dist/cli/simple-commands/init/templates/sparc-modes.d.ts +0 -30
  457. package/dist/cli/simple-commands/init/templates/sparc-modes.d.ts.map +0 -1
  458. package/dist/cli/simple-commands/init/templates/sparc-modes.js +0 -1375
  459. package/dist/cli/simple-commands/init/templates/sparc-modes.js.map +0 -1
  460. package/dist/cli/simple-commands/init/templates/verification-claude-md.d.ts +0 -3
  461. package/dist/cli/simple-commands/init/templates/verification-claude-md.d.ts.map +0 -1
  462. package/dist/cli/simple-commands/init/templates/verification-claude-md.js +0 -432
  463. package/dist/cli/simple-commands/init/templates/verification-claude-md.js.map +0 -1
  464. package/dist/cli/simple-commands/init/validation/config-validator.d.ts +0 -63
  465. package/dist/cli/simple-commands/init/validation/config-validator.d.ts.map +0 -1
  466. package/dist/cli/simple-commands/init/validation/config-validator.js +0 -308
  467. package/dist/cli/simple-commands/init/validation/config-validator.js.map +0 -1
  468. package/dist/cli/simple-commands/init/validation/health-checker.d.ts +0 -117
  469. package/dist/cli/simple-commands/init/validation/health-checker.d.ts.map +0 -1
  470. package/dist/cli/simple-commands/init/validation/health-checker.js +0 -539
  471. package/dist/cli/simple-commands/init/validation/health-checker.js.map +0 -1
  472. package/dist/cli/simple-commands/init/validation/index.d.ts +0 -55
  473. package/dist/cli/simple-commands/init/validation/index.d.ts.map +0 -1
  474. package/dist/cli/simple-commands/init/validation/index.js +0 -347
  475. package/dist/cli/simple-commands/init/validation/index.js.map +0 -1
  476. package/dist/cli/simple-commands/init/validation/mode-validator.d.ts +0 -76
  477. package/dist/cli/simple-commands/init/validation/mode-validator.d.ts.map +0 -1
  478. package/dist/cli/simple-commands/init/validation/mode-validator.js +0 -343
  479. package/dist/cli/simple-commands/init/validation/mode-validator.js.map +0 -1
  480. package/dist/cli/simple-commands/init/validation/post-init-validator.d.ts +0 -62
  481. package/dist/cli/simple-commands/init/validation/post-init-validator.d.ts.map +0 -1
  482. package/dist/cli/simple-commands/init/validation/post-init-validator.js +0 -349
  483. package/dist/cli/simple-commands/init/validation/post-init-validator.js.map +0 -1
  484. package/dist/cli/simple-commands/init/validation/pre-init-validator.d.ts +0 -86
  485. package/dist/cli/simple-commands/init/validation/pre-init-validator.d.ts.map +0 -1
  486. package/dist/cli/simple-commands/init/validation/pre-init-validator.js +0 -260
  487. package/dist/cli/simple-commands/init/validation/pre-init-validator.js.map +0 -1
  488. package/dist/cli/simple-commands/inject-memory-protocol.d.ts +0 -34
  489. package/dist/cli/simple-commands/inject-memory-protocol.d.ts.map +0 -1
  490. package/dist/cli/simple-commands/inject-memory-protocol.js +0 -229
  491. package/dist/cli/simple-commands/inject-memory-protocol.js.map +0 -1
  492. package/dist/cli/simple-commands/mcp.d.ts +0 -2
  493. package/dist/cli/simple-commands/mcp.d.ts.map +0 -1
  494. package/dist/cli/simple-commands/mcp.js +0 -369
  495. package/dist/cli/simple-commands/mcp.js.map +0 -1
  496. package/dist/cli/simple-commands/memory-consolidation.d.ts +0 -73
  497. package/dist/cli/simple-commands/memory-consolidation.d.ts.map +0 -1
  498. package/dist/cli/simple-commands/memory-consolidation.js +0 -537
  499. package/dist/cli/simple-commands/memory-consolidation.js.map +0 -1
  500. package/dist/cli/simple-commands/memory.d.ts +0 -2
  501. package/dist/cli/simple-commands/memory.d.ts.map +0 -1
  502. package/dist/cli/simple-commands/memory.js +0 -778
  503. package/dist/cli/simple-commands/memory.js.map +0 -1
  504. package/dist/cli/simple-commands/migrate-hooks.d.ts +0 -10
  505. package/dist/cli/simple-commands/migrate-hooks.d.ts.map +0 -1
  506. package/dist/cli/simple-commands/migrate-hooks.js +0 -57
  507. package/dist/cli/simple-commands/migrate-hooks.js.map +0 -1
  508. package/dist/cli/simple-commands/monitor.d.ts +0 -3
  509. package/dist/cli/simple-commands/monitor.d.ts.map +0 -1
  510. package/dist/cli/simple-commands/monitor.js +0 -366
  511. package/dist/cli/simple-commands/monitor.js.map +0 -1
  512. package/dist/cli/simple-commands/neural.d.ts +0 -3
  513. package/dist/cli/simple-commands/neural.d.ts.map +0 -1
  514. package/dist/cli/simple-commands/neural.js +0 -137
  515. package/dist/cli/simple-commands/neural.js.map +0 -1
  516. package/dist/cli/simple-commands/pair.d.ts +0 -3
  517. package/dist/cli/simple-commands/pair.d.ts.map +0 -1
  518. package/dist/cli/simple-commands/pair.js +0 -735
  519. package/dist/cli/simple-commands/pair.js.map +0 -1
  520. package/dist/cli/simple-commands/performance-hooks.d.ts +0 -20
  521. package/dist/cli/simple-commands/performance-hooks.d.ts.map +0 -1
  522. package/dist/cli/simple-commands/performance-hooks.js +0 -127
  523. package/dist/cli/simple-commands/performance-hooks.js.map +0 -1
  524. package/dist/cli/simple-commands/performance-metrics.d.ts +0 -153
  525. package/dist/cli/simple-commands/performance-metrics.d.ts.map +0 -1
  526. package/dist/cli/simple-commands/performance-metrics.js +0 -759
  527. package/dist/cli/simple-commands/performance-metrics.js.map +0 -1
  528. package/dist/cli/simple-commands/process-ui-enhanced.d.ts +0 -55
  529. package/dist/cli/simple-commands/process-ui-enhanced.d.ts.map +0 -1
  530. package/dist/cli/simple-commands/process-ui-enhanced.js +0 -680
  531. package/dist/cli/simple-commands/process-ui-enhanced.js.map +0 -1
  532. package/dist/cli/simple-commands/proxy.d.ts +0 -5
  533. package/dist/cli/simple-commands/proxy.d.ts.map +0 -1
  534. package/dist/cli/simple-commands/proxy.js +0 -346
  535. package/dist/cli/simple-commands/proxy.js.map +0 -1
  536. package/dist/cli/simple-commands/sparc-modes/architect.d.ts +0 -2
  537. package/dist/cli/simple-commands/sparc-modes/architect.d.ts.map +0 -1
  538. package/dist/cli/simple-commands/sparc-modes/architect.js +0 -126
  539. package/dist/cli/simple-commands/sparc-modes/architect.js.map +0 -1
  540. package/dist/cli/simple-commands/sparc-modes/ask.d.ts +0 -2
  541. package/dist/cli/simple-commands/sparc-modes/ask.d.ts.map +0 -1
  542. package/dist/cli/simple-commands/sparc-modes/ask.js +0 -127
  543. package/dist/cli/simple-commands/sparc-modes/ask.js.map +0 -1
  544. package/dist/cli/simple-commands/sparc-modes/code.d.ts +0 -2
  545. package/dist/cli/simple-commands/sparc-modes/code.d.ts.map +0 -1
  546. package/dist/cli/simple-commands/sparc-modes/code.js +0 -149
  547. package/dist/cli/simple-commands/sparc-modes/code.js.map +0 -1
  548. package/dist/cli/simple-commands/sparc-modes/debug.d.ts +0 -2
  549. package/dist/cli/simple-commands/sparc-modes/debug.d.ts.map +0 -1
  550. package/dist/cli/simple-commands/sparc-modes/debug.js +0 -113
  551. package/dist/cli/simple-commands/sparc-modes/debug.js.map +0 -1
  552. package/dist/cli/simple-commands/sparc-modes/devops.d.ts +0 -2
  553. package/dist/cli/simple-commands/sparc-modes/devops.d.ts.map +0 -1
  554. package/dist/cli/simple-commands/sparc-modes/devops.js +0 -138
  555. package/dist/cli/simple-commands/sparc-modes/devops.js.map +0 -1
  556. package/dist/cli/simple-commands/sparc-modes/docs-writer.d.ts +0 -2
  557. package/dist/cli/simple-commands/sparc-modes/docs-writer.d.ts.map +0 -1
  558. package/dist/cli/simple-commands/sparc-modes/docs-writer.js +0 -39
  559. package/dist/cli/simple-commands/sparc-modes/docs-writer.js.map +0 -1
  560. package/dist/cli/simple-commands/sparc-modes/generic.d.ts +0 -2
  561. package/dist/cli/simple-commands/sparc-modes/generic.d.ts.map +0 -1
  562. package/dist/cli/simple-commands/sparc-modes/generic.js +0 -35
  563. package/dist/cli/simple-commands/sparc-modes/generic.js.map +0 -1
  564. package/dist/cli/simple-commands/sparc-modes/index.d.ts +0 -17
  565. package/dist/cli/simple-commands/sparc-modes/index.d.ts.map +0 -1
  566. package/dist/cli/simple-commands/sparc-modes/index.js +0 -196
  567. package/dist/cli/simple-commands/sparc-modes/index.js.map +0 -1
  568. package/dist/cli/simple-commands/sparc-modes/integration.d.ts +0 -2
  569. package/dist/cli/simple-commands/sparc-modes/integration.d.ts.map +0 -1
  570. package/dist/cli/simple-commands/sparc-modes/integration.js +0 -56
  571. package/dist/cli/simple-commands/sparc-modes/integration.js.map +0 -1
  572. package/dist/cli/simple-commands/sparc-modes/mcp.d.ts +0 -2
  573. package/dist/cli/simple-commands/sparc-modes/mcp.d.ts.map +0 -1
  574. package/dist/cli/simple-commands/sparc-modes/mcp.js +0 -39
  575. package/dist/cli/simple-commands/sparc-modes/mcp.js.map +0 -1
  576. package/dist/cli/simple-commands/sparc-modes/monitoring.d.ts +0 -2
  577. package/dist/cli/simple-commands/sparc-modes/monitoring.d.ts.map +0 -1
  578. package/dist/cli/simple-commands/sparc-modes/monitoring.js +0 -39
  579. package/dist/cli/simple-commands/sparc-modes/monitoring.js.map +0 -1
  580. package/dist/cli/simple-commands/sparc-modes/optimization.d.ts +0 -2
  581. package/dist/cli/simple-commands/sparc-modes/optimization.d.ts.map +0 -1
  582. package/dist/cli/simple-commands/sparc-modes/optimization.js +0 -39
  583. package/dist/cli/simple-commands/sparc-modes/optimization.js.map +0 -1
  584. package/dist/cli/simple-commands/sparc-modes/security-review.d.ts +0 -2
  585. package/dist/cli/simple-commands/sparc-modes/security-review.d.ts.map +0 -1
  586. package/dist/cli/simple-commands/sparc-modes/security-review.js +0 -131
  587. package/dist/cli/simple-commands/sparc-modes/security-review.js.map +0 -1
  588. package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.d.ts +0 -2
  589. package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.d.ts.map +0 -1
  590. package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.js +0 -168
  591. package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.js.map +0 -1
  592. package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.d.ts +0 -2
  593. package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.d.ts.map +0 -1
  594. package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.js +0 -39
  595. package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.js.map +0 -1
  596. package/dist/cli/simple-commands/sparc-modes/supabase-admin.d.ts +0 -2
  597. package/dist/cli/simple-commands/sparc-modes/supabase-admin.d.ts.map +0 -1
  598. package/dist/cli/simple-commands/sparc-modes/supabase-admin.js +0 -150
  599. package/dist/cli/simple-commands/sparc-modes/supabase-admin.js.map +0 -1
  600. package/dist/cli/simple-commands/sparc-modes/swarm.d.ts +0 -81
  601. package/dist/cli/simple-commands/sparc-modes/swarm.d.ts.map +0 -1
  602. package/dist/cli/simple-commands/sparc-modes/swarm.js +0 -428
  603. package/dist/cli/simple-commands/sparc-modes/swarm.js.map +0 -1
  604. package/dist/cli/simple-commands/sparc-modes/tdd.d.ts +0 -2
  605. package/dist/cli/simple-commands/sparc-modes/tdd.d.ts.map +0 -1
  606. package/dist/cli/simple-commands/sparc-modes/tdd.js +0 -113
  607. package/dist/cli/simple-commands/sparc-modes/tdd.js.map +0 -1
  608. package/dist/cli/simple-commands/sparc-modes/tutorial.d.ts +0 -2
  609. package/dist/cli/simple-commands/sparc-modes/tutorial.d.ts.map +0 -1
  610. package/dist/cli/simple-commands/sparc-modes/tutorial.js +0 -278
  611. package/dist/cli/simple-commands/sparc-modes/tutorial.js.map +0 -1
  612. package/dist/cli/simple-commands/sparc.d.ts +0 -2
  613. package/dist/cli/simple-commands/sparc.d.ts.map +0 -1
  614. package/dist/cli/simple-commands/sparc.js +0 -477
  615. package/dist/cli/simple-commands/sparc.js.map +0 -1
  616. package/dist/cli/simple-commands/start-ui.d.ts +0 -2
  617. package/dist/cli/simple-commands/start-ui.d.ts.map +0 -1
  618. package/dist/cli/simple-commands/start-ui.js +0 -135
  619. package/dist/cli/simple-commands/start-ui.js.map +0 -1
  620. package/dist/cli/simple-commands/start-wrapper.d.ts +0 -2
  621. package/dist/cli/simple-commands/start-wrapper.d.ts.map +0 -1
  622. package/dist/cli/simple-commands/start-wrapper.js +0 -264
  623. package/dist/cli/simple-commands/start-wrapper.js.map +0 -1
  624. package/dist/cli/simple-commands/start.d.ts +0 -2
  625. package/dist/cli/simple-commands/start.d.ts.map +0 -1
  626. package/dist/cli/simple-commands/start.js +0 -3
  627. package/dist/cli/simple-commands/start.js.map +0 -1
  628. package/dist/cli/simple-commands/status.d.ts +0 -2
  629. package/dist/cli/simple-commands/status.d.ts.map +0 -1
  630. package/dist/cli/simple-commands/status.js +0 -292
  631. package/dist/cli/simple-commands/status.js.map +0 -1
  632. package/dist/cli/simple-commands/stream-chain.d.ts +0 -7
  633. package/dist/cli/simple-commands/stream-chain.d.ts.map +0 -1
  634. package/dist/cli/simple-commands/stream-chain.js +0 -433
  635. package/dist/cli/simple-commands/stream-chain.js.map +0 -1
  636. package/dist/cli/simple-commands/stream-processor.d.ts +0 -32
  637. package/dist/cli/simple-commands/stream-processor.d.ts.map +0 -1
  638. package/dist/cli/simple-commands/stream-processor.js +0 -318
  639. package/dist/cli/simple-commands/stream-processor.js.map +0 -1
  640. package/dist/cli/simple-commands/swarm-executor.d.ts +0 -68
  641. package/dist/cli/simple-commands/swarm-executor.d.ts.map +0 -1
  642. package/dist/cli/simple-commands/swarm-executor.js +0 -218
  643. package/dist/cli/simple-commands/swarm-executor.js.map +0 -1
  644. package/dist/cli/simple-commands/swarm-metrics-integration.d.ts +0 -69
  645. package/dist/cli/simple-commands/swarm-metrics-integration.d.ts.map +0 -1
  646. package/dist/cli/simple-commands/swarm-metrics-integration.js +0 -294
  647. package/dist/cli/simple-commands/swarm-metrics-integration.js.map +0 -1
  648. package/dist/cli/simple-commands/swarm-webui-integration.d.ts +0 -68
  649. package/dist/cli/simple-commands/swarm-webui-integration.d.ts.map +0 -1
  650. package/dist/cli/simple-commands/swarm-webui-integration.js +0 -265
  651. package/dist/cli/simple-commands/swarm-webui-integration.js.map +0 -1
  652. package/dist/cli/simple-commands/swarm.d.ts +0 -2
  653. package/dist/cli/simple-commands/swarm.d.ts.map +0 -1
  654. package/dist/cli/simple-commands/swarm.js +0 -2104
  655. package/dist/cli/simple-commands/swarm.js.map +0 -1
  656. package/dist/cli/simple-commands/task.d.ts +0 -2
  657. package/dist/cli/simple-commands/task.d.ts.map +0 -1
  658. package/dist/cli/simple-commands/task.js +0 -250
  659. package/dist/cli/simple-commands/task.js.map +0 -1
  660. package/dist/cli/simple-commands/token-tracker.d.ts +0 -73
  661. package/dist/cli/simple-commands/token-tracker.d.ts.map +0 -1
  662. package/dist/cli/simple-commands/token-tracker.js +0 -319
  663. package/dist/cli/simple-commands/token-tracker.js.map +0 -1
  664. package/dist/cli/simple-commands/training-pipeline.d.ts +0 -166
  665. package/dist/cli/simple-commands/training-pipeline.d.ts.map +0 -1
  666. package/dist/cli/simple-commands/training-pipeline.js +0 -760
  667. package/dist/cli/simple-commands/training-pipeline.js.map +0 -1
  668. package/dist/cli/simple-commands/training.d.ts +0 -2
  669. package/dist/cli/simple-commands/training.d.ts.map +0 -1
  670. package/dist/cli/simple-commands/training.js +0 -240
  671. package/dist/cli/simple-commands/training.js.map +0 -1
  672. package/dist/cli/simple-commands/verification-training-integration.d.ts +0 -181
  673. package/dist/cli/simple-commands/verification-training-integration.d.ts.map +0 -1
  674. package/dist/cli/simple-commands/verification-training-integration.js +0 -561
  675. package/dist/cli/simple-commands/verification-training-integration.js.map +0 -1
  676. package/dist/cli/simple-commands/verification.d.ts +0 -10
  677. package/dist/cli/simple-commands/verification.d.ts.map +0 -1
  678. package/dist/cli/simple-commands/verification.js +0 -476
  679. package/dist/cli/simple-commands/verification.js.map +0 -1
  680. package/dist/cli/simple-commands/web-server.d.ts +0 -152
  681. package/dist/cli/simple-commands/web-server.d.ts.map +0 -1
  682. package/dist/cli/simple-commands/web-server.js +0 -816
  683. package/dist/cli/simple-commands/web-server.js.map +0 -1
  684. package/dist/cli/utils/interactive-detector.d.ts +0 -25
  685. package/dist/cli/utils/interactive-detector.d.ts.map +0 -1
  686. package/dist/cli/utils/interactive-detector.js +0 -129
  687. package/dist/cli/utils/interactive-detector.js.map +0 -1
  688. package/dist/cli/utils/safe-interactive.d.ts +0 -30
  689. package/dist/cli/utils/safe-interactive.d.ts.map +0 -1
  690. package/dist/cli/utils/safe-interactive.js +0 -134
  691. package/dist/cli/utils/safe-interactive.js.map +0 -1
  692. package/dist/cli/utils.d.ts +0 -75
  693. package/dist/cli/utils.d.ts.map +0 -1
  694. package/dist/cli/utils.js +0 -567
  695. package/dist/cli/utils.js.map +0 -1
  696. package/dist/config/config-manager.d.ts +0 -212
  697. package/dist/config/config-manager.d.ts.map +0 -1
  698. package/dist/config/config-manager.js +0 -550
  699. package/dist/config/config-manager.js.map +0 -1
  700. package/dist/constants/agent-types.d.ts +0 -57
  701. package/dist/constants/agent-types.d.ts.map +0 -1
  702. package/dist/constants/agent-types.js +0 -57
  703. package/dist/constants/agent-types.js.map +0 -1
  704. package/dist/coordination/advanced-scheduler.d.ts +0 -121
  705. package/dist/coordination/advanced-scheduler.d.ts.map +0 -1
  706. package/dist/coordination/advanced-scheduler.js +0 -382
  707. package/dist/coordination/advanced-scheduler.js.map +0 -1
  708. package/dist/coordination/background-executor.d.ts +0 -69
  709. package/dist/coordination/background-executor.d.ts.map +0 -1
  710. package/dist/coordination/background-executor.js +0 -363
  711. package/dist/coordination/background-executor.js.map +0 -1
  712. package/dist/coordination/circuit-breaker.d.ts +0 -124
  713. package/dist/coordination/circuit-breaker.d.ts.map +0 -1
  714. package/dist/coordination/circuit-breaker.js +0 -301
  715. package/dist/coordination/circuit-breaker.js.map +0 -1
  716. package/dist/coordination/conflict-resolution.d.ts +0 -133
  717. package/dist/coordination/conflict-resolution.d.ts.map +0 -1
  718. package/dist/coordination/conflict-resolution.js +0 -360
  719. package/dist/coordination/conflict-resolution.js.map +0 -1
  720. package/dist/coordination/dependency-graph.d.ts +0 -78
  721. package/dist/coordination/dependency-graph.d.ts.map +0 -1
  722. package/dist/coordination/dependency-graph.js +0 -387
  723. package/dist/coordination/dependency-graph.js.map +0 -1
  724. package/dist/coordination/manager.d.ts +0 -66
  725. package/dist/coordination/manager.d.ts.map +0 -1
  726. package/dist/coordination/manager.js +0 -354
  727. package/dist/coordination/manager.js.map +0 -1
  728. package/dist/coordination/messaging.d.ts +0 -37
  729. package/dist/coordination/messaging.d.ts.map +0 -1
  730. package/dist/coordination/messaging.js +0 -219
  731. package/dist/coordination/messaging.js.map +0 -1
  732. package/dist/coordination/metrics.d.ts +0 -153
  733. package/dist/coordination/metrics.d.ts.map +0 -1
  734. package/dist/coordination/metrics.js +0 -436
  735. package/dist/coordination/metrics.js.map +0 -1
  736. package/dist/coordination/resources.d.ts +0 -36
  737. package/dist/coordination/resources.d.ts.map +0 -1
  738. package/dist/coordination/resources.js +0 -254
  739. package/dist/coordination/resources.js.map +0 -1
  740. package/dist/coordination/scheduler.d.ts +0 -48
  741. package/dist/coordination/scheduler.d.ts.map +0 -1
  742. package/dist/coordination/scheduler.js +0 -308
  743. package/dist/coordination/scheduler.js.map +0 -1
  744. package/dist/coordination/swarm-coordinator.d.ts +0 -116
  745. package/dist/coordination/swarm-coordinator.d.ts.map +0 -1
  746. package/dist/coordination/swarm-coordinator.js +0 -563
  747. package/dist/coordination/swarm-coordinator.js.map +0 -1
  748. package/dist/coordination/swarm-monitor.d.ts +0 -101
  749. package/dist/coordination/swarm-monitor.d.ts.map +0 -1
  750. package/dist/coordination/swarm-monitor.js +0 -340
  751. package/dist/coordination/swarm-monitor.js.map +0 -1
  752. package/dist/coordination/work-stealing.d.ts +0 -44
  753. package/dist/coordination/work-stealing.d.ts.map +0 -1
  754. package/dist/coordination/work-stealing.js +0 -158
  755. package/dist/coordination/work-stealing.js.map +0 -1
  756. package/dist/core/config.d.ts +0 -243
  757. package/dist/core/config.d.ts.map +0 -1
  758. package/dist/core/config.js +0 -1125
  759. package/dist/core/config.js.map +0 -1
  760. package/dist/core/event-bus.d.ts +0 -63
  761. package/dist/core/event-bus.d.ts.map +0 -1
  762. package/dist/core/event-bus.js +0 -153
  763. package/dist/core/event-bus.js.map +0 -1
  764. package/dist/core/json-persistence.d.ts +0 -55
  765. package/dist/core/json-persistence.d.ts.map +0 -1
  766. package/dist/core/json-persistence.js +0 -111
  767. package/dist/core/json-persistence.js.map +0 -1
  768. package/dist/core/logger.d.ts +0 -62
  769. package/dist/core/logger.d.ts.map +0 -1
  770. package/dist/core/logger.js +0 -252
  771. package/dist/core/logger.js.map +0 -1
  772. package/dist/core/orchestrator-fixed.d.ts +0 -81
  773. package/dist/core/orchestrator-fixed.d.ts.map +0 -1
  774. package/dist/core/orchestrator-fixed.js +0 -213
  775. package/dist/core/orchestrator-fixed.js.map +0 -1
  776. package/dist/core/orchestrator.d.ts +0 -141
  777. package/dist/core/orchestrator.d.ts.map +0 -1
  778. package/dist/core/orchestrator.js +0 -1166
  779. package/dist/core/orchestrator.js.map +0 -1
  780. package/dist/core/version.d.ts +0 -10
  781. package/dist/core/version.d.ts.map +0 -1
  782. package/dist/core/version.js +0 -36
  783. package/dist/core/version.js.map +0 -1
  784. package/dist/enterprise/analytics-manager.d.ts +0 -489
  785. package/dist/enterprise/analytics-manager.d.ts.map +0 -1
  786. package/dist/enterprise/analytics-manager.js +0 -956
  787. package/dist/enterprise/analytics-manager.js.map +0 -1
  788. package/dist/enterprise/audit-manager.d.ts +0 -459
  789. package/dist/enterprise/audit-manager.d.ts.map +0 -1
  790. package/dist/enterprise/audit-manager.js +0 -1014
  791. package/dist/enterprise/audit-manager.js.map +0 -1
  792. package/dist/enterprise/cloud-manager.d.ts +0 -435
  793. package/dist/enterprise/cloud-manager.d.ts.map +0 -1
  794. package/dist/enterprise/cloud-manager.js +0 -789
  795. package/dist/enterprise/cloud-manager.js.map +0 -1
  796. package/dist/enterprise/deployment-manager.d.ts +0 -328
  797. package/dist/enterprise/deployment-manager.d.ts.map +0 -1
  798. package/dist/enterprise/deployment-manager.js +0 -830
  799. package/dist/enterprise/deployment-manager.js.map +0 -1
  800. package/dist/enterprise/project-manager.d.ts +0 -228
  801. package/dist/enterprise/project-manager.d.ts.map +0 -1
  802. package/dist/enterprise/project-manager.js +0 -537
  803. package/dist/enterprise/project-manager.js.map +0 -1
  804. package/dist/enterprise/security-manager.d.ts +0 -422
  805. package/dist/enterprise/security-manager.d.ts.map +0 -1
  806. package/dist/enterprise/security-manager.js +0 -910
  807. package/dist/enterprise/security-manager.js.map +0 -1
  808. package/dist/execution/agent-executor.d.ts +0 -80
  809. package/dist/execution/agent-executor.d.ts.map +0 -1
  810. package/dist/execution/agent-executor.js +0 -220
  811. package/dist/execution/agent-executor.js.map +0 -1
  812. package/dist/execution/provider-manager.d.ts +0 -65
  813. package/dist/execution/provider-manager.d.ts.map +0 -1
  814. package/dist/execution/provider-manager.js +0 -144
  815. package/dist/execution/provider-manager.js.map +0 -1
  816. package/dist/hive-mind/core/Agent.d.ts +0 -137
  817. package/dist/hive-mind/core/Agent.d.ts.map +0 -1
  818. package/dist/hive-mind/core/Agent.js +0 -567
  819. package/dist/hive-mind/core/Agent.js.map +0 -1
  820. package/dist/hive-mind/core/Communication.d.ts +0 -116
  821. package/dist/hive-mind/core/Communication.d.ts.map +0 -1
  822. package/dist/hive-mind/core/Communication.js +0 -407
  823. package/dist/hive-mind/core/Communication.js.map +0 -1
  824. package/dist/hive-mind/core/DatabaseManager.d.ts +0 -99
  825. package/dist/hive-mind/core/DatabaseManager.d.ts.map +0 -1
  826. package/dist/hive-mind/core/DatabaseManager.js +0 -648
  827. package/dist/hive-mind/core/DatabaseManager.js.map +0 -1
  828. package/dist/hive-mind/core/HiveMind.d.ts +0 -90
  829. package/dist/hive-mind/core/HiveMind.d.ts.map +0 -1
  830. package/dist/hive-mind/core/HiveMind.js +0 -455
  831. package/dist/hive-mind/core/HiveMind.js.map +0 -1
  832. package/dist/hive-mind/core/Memory.d.ts +0 -235
  833. package/dist/hive-mind/core/Memory.d.ts.map +0 -1
  834. package/dist/hive-mind/core/Memory.js +0 -1192
  835. package/dist/hive-mind/core/Memory.js.map +0 -1
  836. package/dist/hive-mind/core/Queen.d.ts +0 -115
  837. package/dist/hive-mind/core/Queen.d.ts.map +0 -1
  838. package/dist/hive-mind/core/Queen.js +0 -649
  839. package/dist/hive-mind/core/Queen.js.map +0 -1
  840. package/dist/hive-mind/integration/ConsensusEngine.d.ts +0 -117
  841. package/dist/hive-mind/integration/ConsensusEngine.d.ts.map +0 -1
  842. package/dist/hive-mind/integration/ConsensusEngine.js +0 -478
  843. package/dist/hive-mind/integration/ConsensusEngine.js.map +0 -1
  844. package/dist/hive-mind/integration/MCPToolWrapper.d.ts +0 -172
  845. package/dist/hive-mind/integration/MCPToolWrapper.d.ts.map +0 -1
  846. package/dist/hive-mind/integration/MCPToolWrapper.js +0 -217
  847. package/dist/hive-mind/integration/MCPToolWrapper.js.map +0 -1
  848. package/dist/hive-mind/integration/SwarmOrchestrator.d.ts +0 -172
  849. package/dist/hive-mind/integration/SwarmOrchestrator.d.ts.map +0 -1
  850. package/dist/hive-mind/integration/SwarmOrchestrator.js +0 -748
  851. package/dist/hive-mind/integration/SwarmOrchestrator.js.map +0 -1
  852. package/dist/hive-mind/types.d.ts +0 -314
  853. package/dist/hive-mind/types.d.ts.map +0 -1
  854. package/dist/hive-mind/types.js +0 -7
  855. package/dist/hive-mind/types.js.map +0 -1
  856. package/dist/mcp/auth.d.ts +0 -80
  857. package/dist/mcp/auth.d.ts.map +0 -1
  858. package/dist/mcp/auth.js +0 -350
  859. package/dist/mcp/auth.js.map +0 -1
  860. package/dist/mcp/claude-flow-tools.d.ts +0 -13
  861. package/dist/mcp/claude-flow-tools.d.ts.map +0 -1
  862. package/dist/mcp/claude-flow-tools.js +0 -1398
  863. package/dist/mcp/claude-flow-tools.js.map +0 -1
  864. package/dist/mcp/load-balancer.d.ts +0 -88
  865. package/dist/mcp/load-balancer.d.ts.map +0 -1
  866. package/dist/mcp/load-balancer.js +0 -393
  867. package/dist/mcp/load-balancer.js.map +0 -1
  868. package/dist/mcp/router.d.ts +0 -54
  869. package/dist/mcp/router.d.ts.map +0 -1
  870. package/dist/mcp/router.js +0 -204
  871. package/dist/mcp/router.js.map +0 -1
  872. package/dist/mcp/ruv-swarm-tools.d.ts +0 -58
  873. package/dist/mcp/ruv-swarm-tools.d.ts.map +0 -1
  874. package/dist/mcp/ruv-swarm-tools.js +0 -568
  875. package/dist/mcp/ruv-swarm-tools.js.map +0 -1
  876. package/dist/mcp/server.d.ts +0 -75
  877. package/dist/mcp/server.d.ts.map +0 -1
  878. package/dist/mcp/server.js +0 -538
  879. package/dist/mcp/server.js.map +0 -1
  880. package/dist/mcp/session-manager.d.ts +0 -60
  881. package/dist/mcp/session-manager.d.ts.map +0 -1
  882. package/dist/mcp/session-manager.js +0 -323
  883. package/dist/mcp/session-manager.js.map +0 -1
  884. package/dist/mcp/swarm-tools.d.ts +0 -87
  885. package/dist/mcp/swarm-tools.d.ts.map +0 -1
  886. package/dist/mcp/swarm-tools.js +0 -731
  887. package/dist/mcp/swarm-tools.js.map +0 -1
  888. package/dist/mcp/tools.d.ts +0 -145
  889. package/dist/mcp/tools.d.ts.map +0 -1
  890. package/dist/mcp/tools.js +0 -434
  891. package/dist/mcp/tools.js.map +0 -1
  892. package/dist/mcp/transports/base.d.ts +0 -22
  893. package/dist/mcp/transports/base.d.ts.map +0 -1
  894. package/dist/mcp/transports/base.js +0 -5
  895. package/dist/mcp/transports/base.js.map +0 -1
  896. package/dist/mcp/transports/http.d.ts +0 -48
  897. package/dist/mcp/transports/http.d.ts.map +0 -1
  898. package/dist/mcp/transports/http.js +0 -400
  899. package/dist/mcp/transports/http.js.map +0 -1
  900. package/dist/mcp/transports/stdio.d.ts +0 -37
  901. package/dist/mcp/transports/stdio.d.ts.map +0 -1
  902. package/dist/mcp/transports/stdio.js +0 -206
  903. package/dist/mcp/transports/stdio.js.map +0 -1
  904. package/dist/memory/advanced-serializer.d.ts +0 -159
  905. package/dist/memory/advanced-serializer.d.ts.map +0 -1
  906. package/dist/memory/advanced-serializer.js +0 -564
  907. package/dist/memory/advanced-serializer.js.map +0 -1
  908. package/dist/memory/backends/base.d.ts +0 -21
  909. package/dist/memory/backends/base.d.ts.map +0 -1
  910. package/dist/memory/backends/base.js +0 -5
  911. package/dist/memory/backends/base.js.map +0 -1
  912. package/dist/memory/backends/markdown.d.ts +0 -35
  913. package/dist/memory/backends/markdown.d.ts.map +0 -1
  914. package/dist/memory/backends/markdown.js +0 -223
  915. package/dist/memory/backends/markdown.js.map +0 -1
  916. package/dist/memory/backends/sqlite.d.ts +0 -33
  917. package/dist/memory/backends/sqlite.d.ts.map +0 -1
  918. package/dist/memory/backends/sqlite.js +0 -291
  919. package/dist/memory/backends/sqlite.js.map +0 -1
  920. package/dist/memory/cache.d.ts +0 -65
  921. package/dist/memory/cache.d.ts.map +0 -1
  922. package/dist/memory/cache.js +0 -188
  923. package/dist/memory/cache.js.map +0 -1
  924. package/dist/memory/distributed-memory.d.ts +0 -188
  925. package/dist/memory/distributed-memory.d.ts.map +0 -1
  926. package/dist/memory/distributed-memory.js +0 -710
  927. package/dist/memory/distributed-memory.js.map +0 -1
  928. package/dist/memory/enhanced-session-serializer.d.ts +0 -115
  929. package/dist/memory/enhanced-session-serializer.d.ts.map +0 -1
  930. package/dist/memory/enhanced-session-serializer.js +0 -478
  931. package/dist/memory/enhanced-session-serializer.js.map +0 -1
  932. package/dist/memory/fallback-store.d.ts +0 -28
  933. package/dist/memory/fallback-store.d.ts.map +0 -1
  934. package/dist/memory/fallback-store.js +0 -101
  935. package/dist/memory/fallback-store.js.map +0 -1
  936. package/dist/memory/in-memory-store.d.ts +0 -37
  937. package/dist/memory/in-memory-store.d.ts.map +0 -1
  938. package/dist/memory/in-memory-store.js +0 -174
  939. package/dist/memory/in-memory-store.js.map +0 -1
  940. package/dist/memory/indexer.d.ts +0 -52
  941. package/dist/memory/indexer.d.ts.map +0 -1
  942. package/dist/memory/indexer.js +0 -191
  943. package/dist/memory/indexer.js.map +0 -1
  944. package/dist/memory/manager.d.ts +0 -58
  945. package/dist/memory/manager.d.ts.map +0 -1
  946. package/dist/memory/manager.js +0 -423
  947. package/dist/memory/manager.js.map +0 -1
  948. package/dist/memory/sqlite-store.d.ts +0 -34
  949. package/dist/memory/sqlite-store.d.ts.map +0 -1
  950. package/dist/memory/sqlite-store.js +0 -268
  951. package/dist/memory/sqlite-store.js.map +0 -1
  952. package/dist/memory/sqlite-wrapper.d.ts +0 -38
  953. package/dist/memory/sqlite-wrapper.d.ts.map +0 -1
  954. package/dist/memory/sqlite-wrapper.js +0 -152
  955. package/dist/memory/sqlite-wrapper.js.map +0 -1
  956. package/dist/memory/swarm-memory.d.ts +0 -91
  957. package/dist/memory/swarm-memory.d.ts.map +0 -1
  958. package/dist/memory/swarm-memory.js +0 -454
  959. package/dist/memory/swarm-memory.js.map +0 -1
  960. package/dist/memory/unified-memory-manager.d.ts +0 -116
  961. package/dist/memory/unified-memory-manager.d.ts.map +0 -1
  962. package/dist/memory/unified-memory-manager.js +0 -397
  963. package/dist/memory/unified-memory-manager.js.map +0 -1
  964. package/dist/migration/logger.d.ts +0 -26
  965. package/dist/migration/logger.d.ts.map +0 -1
  966. package/dist/migration/logger.js +0 -145
  967. package/dist/migration/logger.js.map +0 -1
  968. package/dist/migration/migration-analyzer.d.ts +0 -18
  969. package/dist/migration/migration-analyzer.d.ts.map +0 -1
  970. package/dist/migration/migration-analyzer.js +0 -284
  971. package/dist/migration/migration-analyzer.js.map +0 -1
  972. package/dist/migration/migration-runner.d.ts +0 -26
  973. package/dist/migration/migration-runner.d.ts.map +0 -1
  974. package/dist/migration/migration-runner.js +0 -505
  975. package/dist/migration/migration-runner.js.map +0 -1
  976. package/dist/migration/migration-validator.d.ts +0 -17
  977. package/dist/migration/migration-validator.d.ts.map +0 -1
  978. package/dist/migration/migration-validator.js +0 -309
  979. package/dist/migration/migration-validator.js.map +0 -1
  980. package/dist/migration/progress-reporter.d.ts +0 -28
  981. package/dist/migration/progress-reporter.d.ts.map +0 -1
  982. package/dist/migration/progress-reporter.js +0 -163
  983. package/dist/migration/progress-reporter.js.map +0 -1
  984. package/dist/migration/rollback-manager.d.ts +0 -24
  985. package/dist/migration/rollback-manager.d.ts.map +0 -1
  986. package/dist/migration/rollback-manager.js +0 -351
  987. package/dist/migration/rollback-manager.js.map +0 -1
  988. package/dist/migration/types.d.ts +0 -103
  989. package/dist/migration/types.d.ts.map +0 -1
  990. package/dist/migration/types.js +0 -6
  991. package/dist/migration/types.js.map +0 -1
  992. package/dist/reasoningbank/reasoningbank-adapter.d.ts +0 -93
  993. package/dist/reasoningbank/reasoningbank-adapter.d.ts.map +0 -1
  994. package/dist/reasoningbank/reasoningbank-adapter.js +0 -365
  995. package/dist/reasoningbank/reasoningbank-adapter.js.map +0 -1
  996. package/dist/sdk/query-control.d.ts +0 -131
  997. package/dist/sdk/query-control.d.ts.map +0 -1
  998. package/dist/sdk/query-control.js +0 -363
  999. package/dist/sdk/query-control.js.map +0 -1
  1000. package/dist/sdk/session-forking.d.ts +0 -109
  1001. package/dist/sdk/session-forking.d.ts.map +0 -1
  1002. package/dist/sdk/session-forking.js +0 -275
  1003. package/dist/sdk/session-forking.js.map +0 -1
  1004. package/dist/swarm/types.d.ts +0 -578
  1005. package/dist/swarm/types.d.ts.map +0 -1
  1006. package/dist/swarm/types.js +0 -54
  1007. package/dist/swarm/types.js.map +0 -1
  1008. package/dist/terminal/adapters/base.d.ts +0 -40
  1009. package/dist/terminal/adapters/base.d.ts.map +0 -1
  1010. package/dist/terminal/adapters/base.js +0 -5
  1011. package/dist/terminal/adapters/base.js.map +0 -1
  1012. package/dist/terminal/adapters/native.d.ts +0 -19
  1013. package/dist/terminal/adapters/native.d.ts.map +0 -1
  1014. package/dist/terminal/adapters/native.js +0 -414
  1015. package/dist/terminal/adapters/native.js.map +0 -1
  1016. package/dist/terminal/adapters/vscode.d.ts +0 -23
  1017. package/dist/terminal/adapters/vscode.d.ts.map +0 -1
  1018. package/dist/terminal/adapters/vscode.js +0 -267
  1019. package/dist/terminal/adapters/vscode.js.map +0 -1
  1020. package/dist/terminal/manager.d.ts +0 -59
  1021. package/dist/terminal/manager.d.ts.map +0 -1
  1022. package/dist/terminal/manager.js +0 -235
  1023. package/dist/terminal/manager.js.map +0 -1
  1024. package/dist/terminal/pool.d.ts +0 -32
  1025. package/dist/terminal/pool.d.ts.map +0 -1
  1026. package/dist/terminal/pool.js +0 -208
  1027. package/dist/terminal/pool.js.map +0 -1
  1028. package/dist/terminal/session.d.ts +0 -41
  1029. package/dist/terminal/session.d.ts.map +0 -1
  1030. package/dist/terminal/session.js +0 -210
  1031. package/dist/terminal/session.js.map +0 -1
  1032. package/dist/utils/error-handler.d.ts +0 -14
  1033. package/dist/utils/error-handler.d.ts.map +0 -1
  1034. package/dist/utils/error-handler.js +0 -29
  1035. package/dist/utils/error-handler.js.map +0 -1
  1036. package/dist/utils/errors.d.ts +0 -121
  1037. package/dist/utils/errors.d.ts.map +0 -1
  1038. package/dist/utils/errors.js +0 -194
  1039. package/dist/utils/errors.js.map +0 -1
  1040. package/dist/utils/formatters.d.ts +0 -15
  1041. package/dist/utils/formatters.d.ts.map +0 -1
  1042. package/dist/utils/formatters.js +0 -75
  1043. package/dist/utils/formatters.js.map +0 -1
  1044. package/dist/utils/helpers.d.ts +0 -134
  1045. package/dist/utils/helpers.d.ts.map +0 -1
  1046. package/dist/utils/helpers.js +0 -444
  1047. package/dist/utils/helpers.js.map +0 -1
  1048. package/dist/utils/key-redactor.d.ts +0 -46
  1049. package/dist/utils/key-redactor.d.ts.map +0 -1
  1050. package/dist/utils/key-redactor.js +0 -153
  1051. package/dist/utils/key-redactor.js.map +0 -1
  1052. package/dist/utils/metrics-reader.d.ts +0 -67
  1053. package/dist/utils/metrics-reader.d.ts.map +0 -1
  1054. package/dist/utils/metrics-reader.js +0 -201
  1055. package/dist/utils/metrics-reader.js.map +0 -1
  1056. package/dist/utils/npx-isolated-cache.d.ts +0 -17
  1057. package/dist/utils/npx-isolated-cache.d.ts.map +0 -1
  1058. package/dist/utils/npx-isolated-cache.js +0 -140
  1059. package/dist/utils/npx-isolated-cache.js.map +0 -1
  1060. package/dist/utils/project-root.d.ts +0 -35
  1061. package/dist/utils/project-root.d.ts.map +0 -1
  1062. package/dist/utils/project-root.js +0 -115
  1063. package/dist/utils/project-root.js.map +0 -1
  1064. package/dist/utils/type-guards.d.ts +0 -117
  1065. package/dist/utils/type-guards.d.ts.map +0 -1
  1066. package/dist/utils/type-guards.js +0 -166
  1067. package/dist/utils/type-guards.js.map +0 -1
  1068. package/dist/utils/types.d.ts +0 -568
  1069. package/dist/utils/types.d.ts.map +0 -1
  1070. package/dist/utils/types.js +0 -37
  1071. package/dist/utils/types.js.map +0 -1
@@ -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