claude-flow 2.0.0-alpha.61 → 2.0.0-alpha.62

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 (1395) hide show
  1. package/CHANGELOG.md +59 -1
  2. package/bin/claude-flow +1 -1
  3. package/dist/adapters/cliffy-node.d.ts.map +1 -1
  4. package/dist/adapters/cliffy-node.js +13 -7
  5. package/dist/adapters/cliffy-node.js.map +1 -1
  6. package/dist/agents/agent-manager.d.ts.map +1 -1
  7. package/dist/agents/agent-manager.js +77 -65
  8. package/dist/agents/agent-manager.js.map +1 -1
  9. package/dist/agents/agent-registry.d.ts.map +1 -1
  10. package/dist/agents/agent-registry.js +38 -30
  11. package/dist/agents/agent-registry.js.map +1 -1
  12. package/dist/api/claude-client.d.ts.map +1 -1
  13. package/dist/api/claude-client.js +22 -16
  14. package/dist/api/claude-client.js.map +1 -1
  15. package/dist/cli/agents/analyst.d.ts.map +1 -1
  16. package/dist/cli/agents/analyst.js +94 -114
  17. package/dist/cli/agents/analyst.js.map +1 -1
  18. package/dist/cli/agents/architect.d.ts.map +1 -1
  19. package/dist/cli/agents/architect.js +100 -114
  20. package/dist/cli/agents/architect.js.map +1 -1
  21. package/dist/cli/agents/base-agent.d.ts.map +1 -1
  22. package/dist/cli/agents/base-agent.js +27 -27
  23. package/dist/cli/agents/base-agent.js.map +1 -1
  24. package/dist/cli/agents/capabilities.d.ts.map +1 -1
  25. package/dist/cli/agents/capabilities.js +49 -51
  26. package/dist/cli/agents/capabilities.js.map +1 -1
  27. package/dist/cli/agents/coder.d.ts.map +1 -1
  28. package/dist/cli/agents/coder.js +92 -98
  29. package/dist/cli/agents/coder.js.map +1 -1
  30. package/dist/cli/agents/coordinator.d.ts.map +1 -1
  31. package/dist/cli/agents/coordinator.js +59 -64
  32. package/dist/cli/agents/coordinator.js.map +1 -1
  33. package/dist/cli/agents/hive-agents.d.ts.map +1 -1
  34. package/dist/cli/agents/hive-agents.js +22 -24
  35. package/dist/cli/agents/hive-agents.js.map +1 -1
  36. package/dist/cli/agents/index.d.ts.map +1 -1
  37. package/dist/cli/agents/index.js +17 -17
  38. package/dist/cli/agents/index.js.map +1 -1
  39. package/dist/cli/agents/researcher.d.ts.map +1 -1
  40. package/dist/cli/agents/researcher.js +41 -61
  41. package/dist/cli/agents/researcher.js.map +1 -1
  42. package/dist/cli/agents/tester.d.ts.map +1 -1
  43. package/dist/cli/agents/tester.js +78 -90
  44. package/dist/cli/agents/tester.js.map +1 -1
  45. package/dist/cli/cli-core.d.ts +4 -1
  46. package/dist/cli/cli-core.d.ts.map +1 -1
  47. package/dist/cli/cli-core.js +40 -39
  48. package/dist/cli/cli-core.js.map +1 -1
  49. package/dist/cli/command-registry.d.ts.map +1 -1
  50. package/dist/cli/command-registry.js +55 -64
  51. package/dist/cli/command-registry.js.map +1 -1
  52. package/dist/cli/commands/advanced-memory-commands.d.ts.map +1 -1
  53. package/dist/cli/commands/advanced-memory-commands.js +49 -40
  54. package/dist/cli/commands/advanced-memory-commands.js.map +1 -1
  55. package/dist/cli/commands/agent-simple.d.ts +3 -0
  56. package/dist/cli/commands/agent-simple.d.ts.map +1 -1
  57. package/dist/cli/commands/agent-simple.js +30 -27
  58. package/dist/cli/commands/agent-simple.js.map +1 -1
  59. package/dist/cli/commands/agent.d.ts.map +1 -1
  60. package/dist/cli/commands/agent.js +53 -40
  61. package/dist/cli/commands/agent.js.map +1 -1
  62. package/dist/cli/commands/claude-api.js +4 -4
  63. package/dist/cli/commands/claude-api.js.map +1 -1
  64. package/dist/cli/commands/claude.d.ts.map +1 -1
  65. package/dist/cli/commands/claude.js +2 -2
  66. package/dist/cli/commands/claude.js.map +1 -1
  67. package/dist/cli/commands/config-integration.d.ts +7 -1
  68. package/dist/cli/commands/config-integration.d.ts.map +1 -1
  69. package/dist/cli/commands/config-integration.js +18 -9
  70. package/dist/cli/commands/config-integration.js.map +1 -1
  71. package/dist/cli/commands/config.d.ts.map +1 -1
  72. package/dist/cli/commands/config.js +2 -3
  73. package/dist/cli/commands/config.js.map +1 -1
  74. package/dist/cli/commands/enterprise.d.ts.map +1 -1
  75. package/dist/cli/commands/enterprise.js +115 -95
  76. package/dist/cli/commands/enterprise.js.map +1 -1
  77. package/dist/cli/commands/help-new.js +49 -49
  78. package/dist/cli/commands/help-new.js.map +1 -1
  79. package/dist/cli/commands/help.d.ts.map +1 -1
  80. package/dist/cli/commands/help.js +122 -125
  81. package/dist/cli/commands/help.js.map +1 -1
  82. package/dist/cli/commands/hive-mind/index.d.ts +1 -1
  83. package/dist/cli/commands/hive-mind/index.d.ts.map +1 -1
  84. package/dist/cli/commands/hive-mind/index.js +1 -1
  85. package/dist/cli/commands/hive-mind/index.js.map +1 -1
  86. package/dist/cli/commands/hive-mind/init.d.ts.map +1 -1
  87. package/dist/cli/commands/hive-mind/init.js.map +1 -1
  88. package/dist/cli/commands/hive-mind/optimize-memory.d.ts.map +1 -1
  89. package/dist/cli/commands/hive-mind/optimize-memory.js +35 -26
  90. package/dist/cli/commands/hive-mind/optimize-memory.js.map +1 -1
  91. package/dist/cli/commands/hive-mind/pause.d.ts.map +1 -1
  92. package/dist/cli/commands/hive-mind/pause.js +8 -6
  93. package/dist/cli/commands/hive-mind/pause.js.map +1 -1
  94. package/dist/cli/commands/hive-mind/ps.d.ts.map +1 -1
  95. package/dist/cli/commands/hive-mind/ps.js +17 -12
  96. package/dist/cli/commands/hive-mind/ps.js.map +1 -1
  97. package/dist/cli/commands/hive-mind/resume.js +12 -10
  98. package/dist/cli/commands/hive-mind/resume.js.map +1 -1
  99. package/dist/cli/commands/hive-mind/spawn.d.ts.map +1 -1
  100. package/dist/cli/commands/hive-mind/spawn.js +20 -11
  101. package/dist/cli/commands/hive-mind/spawn.js.map +1 -1
  102. package/dist/cli/commands/hive-mind/status.js +17 -22
  103. package/dist/cli/commands/hive-mind/status.js.map +1 -1
  104. package/dist/cli/commands/hive-mind/stop.d.ts.map +1 -1
  105. package/dist/cli/commands/hive-mind/stop.js +23 -15
  106. package/dist/cli/commands/hive-mind/stop.js.map +1 -1
  107. package/dist/cli/commands/hive-mind/task.d.ts.map +1 -1
  108. package/dist/cli/commands/hive-mind/task.js +25 -19
  109. package/dist/cli/commands/hive-mind/task.js.map +1 -1
  110. package/dist/cli/commands/hive-mind/wizard.d.ts.map +1 -1
  111. package/dist/cli/commands/hive-mind/wizard.js +86 -68
  112. package/dist/cli/commands/hive-mind/wizard.js.map +1 -1
  113. package/dist/cli/commands/hive.js +73 -38
  114. package/dist/cli/commands/hive.js.map +1 -1
  115. package/dist/cli/commands/hook-validator.d.ts.map +1 -1
  116. package/dist/cli/commands/hook-validator.js +4 -2
  117. package/dist/cli/commands/hook-validator.js.map +1 -1
  118. package/dist/cli/commands/hook.d.ts.map +1 -1
  119. package/dist/cli/commands/hook.js +8 -8
  120. package/dist/cli/commands/hook.js.map +1 -1
  121. package/dist/cli/commands/index.d.ts +1 -1
  122. package/dist/cli/commands/index.d.ts.map +1 -1
  123. package/dist/cli/commands/index.js +850 -784
  124. package/dist/cli/commands/index.js.map +1 -1
  125. package/dist/cli/commands/mcp.d.ts.map +1 -1
  126. package/dist/cli/commands/mcp.js +8 -16
  127. package/dist/cli/commands/mcp.js.map +1 -1
  128. package/dist/cli/commands/memory.d.ts.map +1 -1
  129. package/dist/cli/commands/memory.js +8 -8
  130. package/dist/cli/commands/memory.js.map +1 -1
  131. package/dist/cli/commands/migrate.d.ts.map +1 -1
  132. package/dist/cli/commands/migrate.js +3 -3
  133. package/dist/cli/commands/migrate.js.map +1 -1
  134. package/dist/cli/commands/monitor.d.ts.map +1 -1
  135. package/dist/cli/commands/monitor.js +50 -34
  136. package/dist/cli/commands/monitor.js.map +1 -1
  137. package/dist/cli/commands/ruv-swarm.d.ts +7 -1
  138. package/dist/cli/commands/ruv-swarm.d.ts.map +1 -1
  139. package/dist/cli/commands/ruv-swarm.js +6 -6
  140. package/dist/cli/commands/ruv-swarm.js.map +1 -1
  141. package/dist/cli/commands/session.d.ts.map +1 -1
  142. package/dist/cli/commands/session.js +22 -17
  143. package/dist/cli/commands/session.js.map +1 -1
  144. package/dist/cli/commands/sparc.d.ts +1 -1
  145. package/dist/cli/commands/sparc.d.ts.map +1 -1
  146. package/dist/cli/commands/sparc.js +146 -126
  147. package/dist/cli/commands/sparc.js.map +1 -1
  148. package/dist/cli/commands/start/event-emitter.js +1 -1
  149. package/dist/cli/commands/start/event-emitter.js.map +1 -1
  150. package/dist/cli/commands/start/process-manager.d.ts.map +1 -1
  151. package/dist/cli/commands/start/process-manager.js +20 -18
  152. package/dist/cli/commands/start/process-manager.js.map +1 -1
  153. package/dist/cli/commands/start/process-ui-simple.d.ts +4 -0
  154. package/dist/cli/commands/start/process-ui-simple.d.ts.map +1 -1
  155. package/dist/cli/commands/start/process-ui-simple.js +2 -2
  156. package/dist/cli/commands/start/process-ui-simple.js.map +1 -1
  157. package/dist/cli/commands/start/start-command.d.ts.map +1 -1
  158. package/dist/cli/commands/start/start-command.js +27 -15
  159. package/dist/cli/commands/start/start-command.js.map +1 -1
  160. package/dist/cli/commands/start/system-monitor.d.ts +3 -0
  161. package/dist/cli/commands/start/system-monitor.d.ts.map +1 -1
  162. package/dist/cli/commands/start/system-monitor.js +16 -18
  163. package/dist/cli/commands/start/system-monitor.js.map +1 -1
  164. package/dist/cli/commands/status.d.ts.map +1 -1
  165. package/dist/cli/commands/status.js +28 -33
  166. package/dist/cli/commands/status.js.map +1 -1
  167. package/dist/cli/commands/swarm-spawn.d.ts.map +1 -1
  168. package/dist/cli/commands/swarm-spawn.js +1 -1
  169. package/dist/cli/commands/swarm-spawn.js.map +1 -1
  170. package/dist/cli/commands/swarm.d.ts +4 -1
  171. package/dist/cli/commands/swarm.d.ts.map +1 -1
  172. package/dist/cli/commands/swarm.js +23 -18
  173. package/dist/cli/commands/swarm.js.map +1 -1
  174. package/dist/cli/commands/task.d.ts.map +1 -1
  175. package/dist/cli/commands/task.js.map +1 -1
  176. package/dist/cli/commands/workflow.d.ts.map +1 -1
  177. package/dist/cli/commands/workflow.js +49 -45
  178. package/dist/cli/commands/workflow.js.map +1 -1
  179. package/dist/cli/completion.d.ts +3 -0
  180. package/dist/cli/completion.d.ts.map +1 -1
  181. package/dist/cli/completion.js +15 -5
  182. package/dist/cli/completion.js.map +1 -1
  183. package/dist/cli/formatter.d.ts +3 -0
  184. package/dist/cli/formatter.d.ts.map +1 -1
  185. package/dist/cli/formatter.js +3 -3
  186. package/dist/cli/formatter.js.map +1 -1
  187. package/dist/cli/help-formatter.d.ts.map +1 -1
  188. package/dist/cli/help-formatter.js +8 -14
  189. package/dist/cli/help-formatter.js.map +1 -1
  190. package/dist/cli/index-remote.d.ts +4 -0
  191. package/dist/cli/index-remote.d.ts.map +1 -1
  192. package/dist/cli/index-remote.js +1 -1
  193. package/dist/cli/index-remote.js.map +1 -1
  194. package/dist/cli/index.d.ts +1 -1
  195. package/dist/cli/index.d.ts.map +1 -1
  196. package/dist/cli/index.js +32 -34
  197. package/dist/cli/index.js.map +1 -1
  198. package/dist/cli/init/batch-tools.d.ts.map +1 -1
  199. package/dist/cli/init/batch-tools.js.map +1 -1
  200. package/dist/cli/init/claude-config.d.ts.map +1 -1
  201. package/dist/cli/init/claude-config.js +111 -106
  202. package/dist/cli/init/claude-config.js.map +1 -1
  203. package/dist/cli/init/directory-structure.d.ts.map +1 -1
  204. package/dist/cli/init/directory-structure.js +3 -3
  205. package/dist/cli/init/directory-structure.js.map +1 -1
  206. package/dist/cli/init/index.d.ts.map +1 -1
  207. package/dist/cli/init/index.js +1 -1
  208. package/dist/cli/init/index.js.map +1 -1
  209. package/dist/cli/init/sparc-environment.d.ts.map +1 -1
  210. package/dist/cli/init/sparc-environment.js +69 -69
  211. package/dist/cli/init/sparc-environment.js.map +1 -1
  212. package/dist/cli/init/swarm-commands.d.ts.map +1 -1
  213. package/dist/cli/init/swarm-commands.js +1 -1
  214. package/dist/cli/init/swarm-commands.js.map +1 -1
  215. package/dist/cli/main.d.ts +3 -0
  216. package/dist/cli/main.d.ts.map +1 -1
  217. package/dist/cli/main.js +6 -6
  218. package/dist/cli/main.js.map +1 -1
  219. package/dist/cli/node-compat.d.ts.map +1 -1
  220. package/dist/cli/node-compat.js +24 -18
  221. package/dist/cli/node-compat.js.map +1 -1
  222. package/dist/cli/node-repl.d.ts +4 -0
  223. package/dist/cli/node-repl.d.ts.map +1 -1
  224. package/dist/cli/node-repl.js +24 -30
  225. package/dist/cli/node-repl.js.map +1 -1
  226. package/dist/cli/repl.d.ts.map +1 -1
  227. package/dist/cli/repl.js +81 -70
  228. package/dist/cli/repl.js.map +1 -1
  229. package/dist/cli/runtime-detector.d.ts.map +1 -1
  230. package/dist/cli/runtime-detector.js +11 -7
  231. package/dist/cli/runtime-detector.js.map +1 -1
  232. package/dist/cli/simple-cli.d.ts +4 -0
  233. package/dist/cli/simple-cli.d.ts.map +1 -1
  234. package/dist/cli/simple-cli.js +109 -95
  235. package/dist/cli/simple-cli.js.map +1 -1
  236. package/dist/cli/simple-commands/analysis.d.ts.map +1 -1
  237. package/dist/cli/simple-commands/analysis.js +18 -11
  238. package/dist/cli/simple-commands/analysis.js.map +1 -1
  239. package/dist/cli/simple-commands/automation.js +32 -17
  240. package/dist/cli/simple-commands/automation.js.map +1 -1
  241. package/dist/cli/simple-commands/batch-manager.js +44 -39
  242. package/dist/cli/simple-commands/batch-manager.js.map +1 -1
  243. package/dist/cli/simple-commands/config.d.ts.map +1 -1
  244. package/dist/cli/simple-commands/config.js +22 -21
  245. package/dist/cli/simple-commands/config.js.map +1 -1
  246. package/dist/cli/simple-commands/coordination.d.ts.map +1 -1
  247. package/dist/cli/simple-commands/coordination.js +12 -12
  248. package/dist/cli/simple-commands/coordination.js.map +1 -1
  249. package/dist/cli/simple-commands/fix-hook-variables.d.ts.map +1 -1
  250. package/dist/cli/simple-commands/fix-hook-variables.js +36 -30
  251. package/dist/cli/simple-commands/fix-hook-variables.js.map +1 -1
  252. package/dist/cli/simple-commands/github.d.ts.map +1 -1
  253. package/dist/cli/simple-commands/github.js +15 -15
  254. package/dist/cli/simple-commands/github.js.map +1 -1
  255. package/dist/cli/simple-commands/hive-mind/auto-save-middleware.d.ts.map +1 -1
  256. package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js +12 -10
  257. package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js.map +1 -1
  258. package/dist/cli/simple-commands/hive-mind/communication.d.ts.map +1 -1
  259. package/dist/cli/simple-commands/hive-mind/communication.js +42 -45
  260. package/dist/cli/simple-commands/hive-mind/communication.js.map +1 -1
  261. package/dist/cli/simple-commands/hive-mind/core.d.ts.map +1 -1
  262. package/dist/cli/simple-commands/hive-mind/core.js +97 -89
  263. package/dist/cli/simple-commands/hive-mind/core.js.map +1 -1
  264. package/dist/cli/simple-commands/hive-mind/db-optimizer.d.ts.map +1 -1
  265. package/dist/cli/simple-commands/hive-mind/db-optimizer.js +114 -59
  266. package/dist/cli/simple-commands/hive-mind/db-optimizer.js.map +1 -1
  267. package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts.map +1 -1
  268. package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js +182 -103
  269. package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js.map +1 -1
  270. package/dist/cli/simple-commands/hive-mind/memory.d.ts.map +1 -1
  271. package/dist/cli/simple-commands/hive-mind/memory.js +105 -75
  272. package/dist/cli/simple-commands/hive-mind/memory.js.map +1 -1
  273. package/dist/cli/simple-commands/hive-mind/performance-optimizer.d.ts.map +1 -1
  274. package/dist/cli/simple-commands/hive-mind/performance-optimizer.js +45 -43
  275. package/dist/cli/simple-commands/hive-mind/performance-optimizer.js.map +1 -1
  276. package/dist/cli/simple-commands/hive-mind/queen.d.ts.map +1 -1
  277. package/dist/cli/simple-commands/hive-mind/queen.js +101 -88
  278. package/dist/cli/simple-commands/hive-mind/queen.js.map +1 -1
  279. package/dist/cli/simple-commands/hive-mind/session-manager.js +75 -53
  280. package/dist/cli/simple-commands/hive-mind/session-manager.js.map +1 -1
  281. package/dist/cli/simple-commands/hive-mind-optimize.js +18 -18
  282. package/dist/cli/simple-commands/hive-mind-optimize.js.map +1 -1
  283. package/dist/cli/simple-commands/hive-mind.d.ts.map +1 -1
  284. package/dist/cli/simple-commands/hive-mind.js +195 -135
  285. package/dist/cli/simple-commands/hive-mind.js.map +1 -1
  286. package/dist/cli/simple-commands/hook-safety.d.ts.map +1 -1
  287. package/dist/cli/simple-commands/hook-safety.js +19 -19
  288. package/dist/cli/simple-commands/hook-safety.js.map +1 -1
  289. package/dist/cli/simple-commands/hooks.d.ts.map +1 -1
  290. package/dist/cli/simple-commands/hooks.js +85 -71
  291. package/dist/cli/simple-commands/hooks.js.map +1 -1
  292. package/dist/cli/simple-commands/init/batch-init.d.ts.map +1 -1
  293. package/dist/cli/simple-commands/init/batch-init.js +62 -55
  294. package/dist/cli/simple-commands/init/batch-init.js.map +1 -1
  295. package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.d.ts.map +1 -1
  296. package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +2 -2
  297. package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js.map +1 -1
  298. package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.d.ts.map +1 -1
  299. package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +58 -50
  300. package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js.map +1 -1
  301. package/dist/cli/simple-commands/init/claude-commands/slash-commands.d.ts.map +1 -1
  302. package/dist/cli/simple-commands/init/claude-commands/slash-commands.js.map +1 -1
  303. package/dist/cli/simple-commands/init/claude-commands/sparc-commands.d.ts.map +1 -1
  304. package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js +34 -28
  305. package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js.map +1 -1
  306. package/dist/cli/simple-commands/init/executable-wrapper.d.ts.map +1 -1
  307. package/dist/cli/simple-commands/init/executable-wrapper.js +7 -4
  308. package/dist/cli/simple-commands/init/executable-wrapper.js.map +1 -1
  309. package/dist/cli/simple-commands/init/gitignore-updater.d.ts.map +1 -1
  310. package/dist/cli/simple-commands/init/gitignore-updater.js +10 -9
  311. package/dist/cli/simple-commands/init/gitignore-updater.js.map +1 -1
  312. package/dist/cli/simple-commands/init/help.d.ts.map +1 -1
  313. package/dist/cli/simple-commands/init/help.js.map +1 -1
  314. package/dist/cli/simple-commands/init/index.d.ts.map +1 -1
  315. package/dist/cli/simple-commands/init/index.js +159 -103
  316. package/dist/cli/simple-commands/init/index.js.map +1 -1
  317. package/dist/cli/simple-commands/init/performance-monitor.d.ts.map +1 -1
  318. package/dist/cli/simple-commands/init/performance-monitor.js +17 -18
  319. package/dist/cli/simple-commands/init/performance-monitor.js.map +1 -1
  320. package/dist/cli/simple-commands/init/rollback/backup-manager.d.ts.map +1 -1
  321. package/dist/cli/simple-commands/init/rollback/backup-manager.js +19 -25
  322. package/dist/cli/simple-commands/init/rollback/backup-manager.js.map +1 -1
  323. package/dist/cli/simple-commands/init/rollback/index.d.ts.map +1 -1
  324. package/dist/cli/simple-commands/init/rollback/index.js +18 -15
  325. package/dist/cli/simple-commands/init/rollback/index.js.map +1 -1
  326. package/dist/cli/simple-commands/init/rollback/recovery-manager.d.ts.map +1 -1
  327. package/dist/cli/simple-commands/init/rollback/recovery-manager.js +49 -68
  328. package/dist/cli/simple-commands/init/rollback/recovery-manager.js.map +1 -1
  329. package/dist/cli/simple-commands/init/rollback/rollback-executor.d.ts.map +1 -1
  330. package/dist/cli/simple-commands/init/rollback/rollback-executor.js +16 -24
  331. package/dist/cli/simple-commands/init/rollback/rollback-executor.js.map +1 -1
  332. package/dist/cli/simple-commands/init/rollback/state-tracker.d.ts.map +1 -1
  333. package/dist/cli/simple-commands/init/rollback/state-tracker.js +25 -25
  334. package/dist/cli/simple-commands/init/rollback/state-tracker.js.map +1 -1
  335. package/dist/cli/simple-commands/init/sparc/roomodes-config.d.ts.map +1 -1
  336. package/dist/cli/simple-commands/init/sparc/roomodes-config.js +57 -57
  337. package/dist/cli/simple-commands/init/sparc/roomodes-config.js.map +1 -1
  338. package/dist/cli/simple-commands/init/sparc/workflows.d.ts.map +1 -1
  339. package/dist/cli/simple-commands/init/sparc/workflows.js +21 -21
  340. package/dist/cli/simple-commands/init/sparc/workflows.js.map +1 -1
  341. package/dist/cli/simple-commands/init/sparc-structure.d.ts.map +1 -1
  342. package/dist/cli/simple-commands/init/sparc-structure.js +1 -1
  343. package/dist/cli/simple-commands/init/sparc-structure.js.map +1 -1
  344. package/dist/cli/simple-commands/init/templates/enhanced-templates.d.ts.map +1 -1
  345. package/dist/cli/simple-commands/init/templates/enhanced-templates.js +69 -78
  346. package/dist/cli/simple-commands/init/templates/enhanced-templates.js.map +1 -1
  347. package/dist/cli/simple-commands/init/templates/sparc-modes.js +2 -2
  348. package/dist/cli/simple-commands/init/validation/config-validator.d.ts.map +1 -1
  349. package/dist/cli/simple-commands/init/validation/config-validator.js +12 -16
  350. package/dist/cli/simple-commands/init/validation/config-validator.js.map +1 -1
  351. package/dist/cli/simple-commands/init/validation/health-checker.d.ts.map +1 -1
  352. package/dist/cli/simple-commands/init/validation/health-checker.js +39 -41
  353. package/dist/cli/simple-commands/init/validation/health-checker.js.map +1 -1
  354. package/dist/cli/simple-commands/init/validation/index.d.ts.map +1 -1
  355. package/dist/cli/simple-commands/init/validation/index.js +8 -8
  356. package/dist/cli/simple-commands/init/validation/index.js.map +1 -1
  357. package/dist/cli/simple-commands/init/validation/mode-validator.d.ts.map +1 -1
  358. package/dist/cli/simple-commands/init/validation/mode-validator.js +12 -12
  359. package/dist/cli/simple-commands/init/validation/mode-validator.js.map +1 -1
  360. package/dist/cli/simple-commands/init/validation/post-init-validator.d.ts.map +1 -1
  361. package/dist/cli/simple-commands/init/validation/post-init-validator.js +13 -13
  362. package/dist/cli/simple-commands/init/validation/post-init-validator.js.map +1 -1
  363. package/dist/cli/simple-commands/init/validation/pre-init-validator.d.ts.map +1 -1
  364. package/dist/cli/simple-commands/init/validation/pre-init-validator.js +19 -24
  365. package/dist/cli/simple-commands/init/validation/pre-init-validator.js.map +1 -1
  366. package/dist/cli/simple-commands/mcp.js +2 -2
  367. package/dist/cli/simple-commands/mcp.js.map +1 -1
  368. package/dist/cli/simple-commands/memory.js +4 -4
  369. package/dist/cli/simple-commands/memory.js.map +1 -1
  370. package/dist/cli/simple-commands/migrate-hooks.d.ts.map +1 -1
  371. package/dist/cli/simple-commands/migrate-hooks.js +3 -3
  372. package/dist/cli/simple-commands/migrate-hooks.js.map +1 -1
  373. package/dist/cli/simple-commands/monitor.d.ts.map +1 -1
  374. package/dist/cli/simple-commands/monitor.js +34 -26
  375. package/dist/cli/simple-commands/monitor.js.map +1 -1
  376. package/dist/cli/simple-commands/process-ui-enhanced.d.ts.map +1 -1
  377. package/dist/cli/simple-commands/process-ui-enhanced.js +53 -39
  378. package/dist/cli/simple-commands/process-ui-enhanced.js.map +1 -1
  379. package/dist/cli/simple-commands/sparc-modes/index.js +11 -11
  380. package/dist/cli/simple-commands/sparc-modes/index.js.map +1 -1
  381. package/dist/cli/simple-commands/sparc-modes/swarm.js +50 -50
  382. package/dist/cli/simple-commands/sparc.d.ts.map +1 -1
  383. package/dist/cli/simple-commands/sparc.js +21 -11
  384. package/dist/cli/simple-commands/sparc.js.map +1 -1
  385. package/dist/cli/simple-commands/start-ui.d.ts.map +1 -1
  386. package/dist/cli/simple-commands/start-ui.js +5 -3
  387. package/dist/cli/simple-commands/start-ui.js.map +1 -1
  388. package/dist/cli/simple-commands/start-wrapper.d.ts.map +1 -1
  389. package/dist/cli/simple-commands/start-wrapper.js +1 -1
  390. package/dist/cli/simple-commands/start-wrapper.js.map +1 -1
  391. package/dist/cli/simple-commands/status.js +14 -14
  392. package/dist/cli/simple-commands/status.js.map +1 -1
  393. package/dist/cli/simple-commands/swarm-executor.d.ts.map +1 -1
  394. package/dist/cli/simple-commands/swarm-executor.js +19 -19
  395. package/dist/cli/simple-commands/swarm-executor.js.map +1 -1
  396. package/dist/cli/simple-commands/swarm-metrics-integration.d.ts.map +1 -1
  397. package/dist/cli/simple-commands/swarm-metrics-integration.js +30 -21
  398. package/dist/cli/simple-commands/swarm-metrics-integration.js.map +1 -1
  399. package/dist/cli/simple-commands/swarm-webui-integration.d.ts.map +1 -1
  400. package/dist/cli/simple-commands/swarm-webui-integration.js +30 -18
  401. package/dist/cli/simple-commands/swarm-webui-integration.js.map +1 -1
  402. package/dist/cli/simple-commands/swarm.d.ts.map +1 -1
  403. package/dist/cli/simple-commands/swarm.js +78 -67
  404. package/dist/cli/simple-commands/swarm.js.map +1 -1
  405. package/dist/cli/simple-commands/training.d.ts.map +1 -1
  406. package/dist/cli/simple-commands/training.js +7 -7
  407. package/dist/cli/simple-commands/training.js.map +1 -1
  408. package/dist/cli/simple-commands/web-server.d.ts.map +1 -1
  409. package/dist/cli/simple-commands/web-server.js +68 -66
  410. package/dist/cli/simple-commands/web-server.js.map +1 -1
  411. package/dist/cli/simple-mcp.d.ts.map +1 -1
  412. package/dist/cli/simple-mcp.js +2 -4
  413. package/dist/cli/simple-mcp.js.map +1 -1
  414. package/dist/cli/simple-orchestrator.d.ts +3 -0
  415. package/dist/cli/simple-orchestrator.d.ts.map +1 -1
  416. package/dist/cli/simple-orchestrator.js +36 -35
  417. package/dist/cli/simple-orchestrator.js.map +1 -1
  418. package/dist/cli/ui/compatible-ui.d.ts +4 -0
  419. package/dist/cli/ui/compatible-ui.d.ts.map +1 -1
  420. package/dist/cli/ui/compatible-ui.js +9 -8
  421. package/dist/cli/ui/compatible-ui.js.map +1 -1
  422. package/dist/cli/ui/fallback-handler.d.ts.map +1 -1
  423. package/dist/cli/ui/fallback-handler.js +4 -4
  424. package/dist/cli/ui/fallback-handler.js.map +1 -1
  425. package/dist/cli/ui/index.d.ts +2 -2
  426. package/dist/cli/ui/index.d.ts.map +1 -1
  427. package/dist/cli/ui/index.js +3 -3
  428. package/dist/cli/ui/index.js.map +1 -1
  429. package/dist/cli/utils/environment-detector.d.ts.map +1 -1
  430. package/dist/cli/utils/environment-detector.js +13 -11
  431. package/dist/cli/utils/environment-detector.js.map +1 -1
  432. package/dist/cli/utils/interactive-detector.d.ts.map +1 -1
  433. package/dist/cli/utils/interactive-detector.js +1 -1
  434. package/dist/cli/utils/interactive-detector.js.map +1 -1
  435. package/dist/cli/utils/prompt-defaults.d.ts.map +1 -1
  436. package/dist/cli/utils/prompt-defaults.js +6 -7
  437. package/dist/cli/utils/prompt-defaults.js.map +1 -1
  438. package/dist/cli/utils/safe-interactive.d.ts.map +1 -1
  439. package/dist/cli/utils/safe-interactive.js +7 -6
  440. package/dist/cli/utils/safe-interactive.js.map +1 -1
  441. package/dist/cli/utils.d.ts.map +1 -1
  442. package/dist/cli/utils.js +58 -50
  443. package/dist/cli/utils.js.map +1 -1
  444. package/dist/cli/validation-helper.d.ts.map +1 -1
  445. package/dist/cli/validation-helper.js.map +1 -1
  446. package/dist/communication/message-bus.d.ts.map +1 -1
  447. package/dist/communication/message-bus.js +80 -74
  448. package/dist/communication/message-bus.js.map +1 -1
  449. package/dist/config/config-manager.d.ts +3 -0
  450. package/dist/config/config-manager.d.ts.map +1 -1
  451. package/dist/config/config-manager.js +23 -6
  452. package/dist/config/config-manager.js.map +1 -1
  453. package/dist/config/ruv-swarm-config.d.ts +6 -0
  454. package/dist/config/ruv-swarm-config.d.ts.map +1 -1
  455. package/dist/config/ruv-swarm-config.js +37 -22
  456. package/dist/config/ruv-swarm-config.js.map +1 -1
  457. package/dist/config/ruv-swarm-integration.d.ts.map +1 -1
  458. package/dist/config/ruv-swarm-integration.js +21 -21
  459. package/dist/config/ruv-swarm-integration.js.map +1 -1
  460. package/dist/constants/agent-types.d.ts +4 -4
  461. package/dist/constants/agent-types.d.ts.map +1 -1
  462. package/dist/constants/agent-types.js +4 -4
  463. package/dist/constants/agent-types.js.map +1 -1
  464. package/dist/coordination/advanced-scheduler.d.ts.map +1 -1
  465. package/dist/coordination/advanced-scheduler.js +6 -10
  466. package/dist/coordination/advanced-scheduler.js.map +1 -1
  467. package/dist/coordination/advanced-task-executor.d.ts.map +1 -1
  468. package/dist/coordination/advanced-task-executor.js +33 -33
  469. package/dist/coordination/advanced-task-executor.js.map +1 -1
  470. package/dist/coordination/background-executor.d.ts.map +1 -1
  471. package/dist/coordination/background-executor.js +17 -16
  472. package/dist/coordination/background-executor.js.map +1 -1
  473. package/dist/coordination/circuit-breaker.d.ts.map +1 -1
  474. package/dist/coordination/circuit-breaker.js +3 -0
  475. package/dist/coordination/circuit-breaker.js.map +1 -1
  476. package/dist/coordination/conflict-resolution.d.ts.map +1 -1
  477. package/dist/coordination/conflict-resolution.js +10 -8
  478. package/dist/coordination/conflict-resolution.js.map +1 -1
  479. package/dist/coordination/dependency-graph.d.ts.map +1 -1
  480. package/dist/coordination/dependency-graph.js +4 -3
  481. package/dist/coordination/dependency-graph.js.map +1 -1
  482. package/dist/coordination/hive-orchestrator.d.ts.map +1 -1
  483. package/dist/coordination/hive-orchestrator.js +29 -25
  484. package/dist/coordination/hive-orchestrator.js.map +1 -1
  485. package/dist/coordination/hive-protocol.d.ts.map +1 -1
  486. package/dist/coordination/hive-protocol.js +22 -23
  487. package/dist/coordination/hive-protocol.js.map +1 -1
  488. package/dist/coordination/index.d.ts +1 -1
  489. package/dist/coordination/index.d.ts.map +1 -1
  490. package/dist/coordination/index.js +1 -1
  491. package/dist/coordination/index.js.map +1 -1
  492. package/dist/coordination/load-balancer.d.ts.map +1 -1
  493. package/dist/coordination/load-balancer.js +55 -56
  494. package/dist/coordination/load-balancer.js.map +1 -1
  495. package/dist/coordination/manager.d.ts.map +1 -1
  496. package/dist/coordination/manager.js +2 -8
  497. package/dist/coordination/manager.js.map +1 -1
  498. package/dist/coordination/messaging.d.ts.map +1 -1
  499. package/dist/coordination/messaging.js +4 -4
  500. package/dist/coordination/messaging.js.map +1 -1
  501. package/dist/coordination/metrics.d.ts.map +1 -1
  502. package/dist/coordination/metrics.js +11 -9
  503. package/dist/coordination/metrics.js.map +1 -1
  504. package/dist/coordination/resources.d.ts.map +1 -1
  505. package/dist/coordination/resources.js +10 -6
  506. package/dist/coordination/resources.js.map +1 -1
  507. package/dist/coordination/scheduler.d.ts.map +1 -1
  508. package/dist/coordination/scheduler.js +4 -4
  509. package/dist/coordination/scheduler.js.map +1 -1
  510. package/dist/coordination/swarm-coordinator.d.ts.map +1 -1
  511. package/dist/coordination/swarm-coordinator.js +32 -34
  512. package/dist/coordination/swarm-coordinator.js.map +1 -1
  513. package/dist/coordination/swarm-monitor.d.ts.map +1 -1
  514. package/dist/coordination/swarm-monitor.js +17 -17
  515. package/dist/coordination/swarm-monitor.js.map +1 -1
  516. package/dist/coordination/work-stealing.d.ts.map +1 -1
  517. package/dist/coordination/work-stealing.js +3 -0
  518. package/dist/coordination/work-stealing.js.map +1 -1
  519. package/dist/core/config.d.ts +4 -0
  520. package/dist/core/config.d.ts.map +1 -1
  521. package/dist/core/config.js +28 -31
  522. package/dist/core/config.js.map +1 -1
  523. package/dist/core/event-bus.d.ts +3 -0
  524. package/dist/core/event-bus.d.ts.map +1 -1
  525. package/dist/core/event-bus.js.map +1 -1
  526. package/dist/core/json-persistence.d.ts +3 -0
  527. package/dist/core/json-persistence.d.ts.map +1 -1
  528. package/dist/core/json-persistence.js +19 -23
  529. package/dist/core/json-persistence.js.map +1 -1
  530. package/dist/core/logger.d.ts +3 -0
  531. package/dist/core/logger.d.ts.map +1 -1
  532. package/dist/core/logger.js +2 -6
  533. package/dist/core/logger.js.map +1 -1
  534. package/dist/core/orchestrator-fixed.d.ts.map +1 -1
  535. package/dist/core/orchestrator-fixed.js +4 -1
  536. package/dist/core/orchestrator-fixed.js.map +1 -1
  537. package/dist/core/orchestrator.d.ts.map +1 -1
  538. package/dist/core/orchestrator.js +66 -33
  539. package/dist/core/orchestrator.js.map +1 -1
  540. package/dist/core/persistence.d.ts +3 -0
  541. package/dist/core/persistence.d.ts.map +1 -1
  542. package/dist/core/persistence.js +25 -19
  543. package/dist/core/persistence.js.map +1 -1
  544. package/dist/enterprise/analytics-manager.d.ts.map +1 -1
  545. package/dist/enterprise/analytics-manager.js +141 -134
  546. package/dist/enterprise/analytics-manager.js.map +1 -1
  547. package/dist/enterprise/audit-manager.d.ts.map +1 -1
  548. package/dist/enterprise/audit-manager.js +144 -122
  549. package/dist/enterprise/audit-manager.js.map +1 -1
  550. package/dist/enterprise/cloud-manager.d.ts.map +1 -1
  551. package/dist/enterprise/cloud-manager.js +104 -99
  552. package/dist/enterprise/cloud-manager.js.map +1 -1
  553. package/dist/enterprise/deployment-manager.d.ts.map +1 -1
  554. package/dist/enterprise/deployment-manager.js +104 -97
  555. package/dist/enterprise/deployment-manager.js.map +1 -1
  556. package/dist/enterprise/index.d.ts +6 -6
  557. package/dist/enterprise/index.d.ts.map +1 -1
  558. package/dist/enterprise/project-manager.d.ts.map +1 -1
  559. package/dist/enterprise/project-manager.js +74 -66
  560. package/dist/enterprise/project-manager.js.map +1 -1
  561. package/dist/enterprise/security-manager.d.ts.map +1 -1
  562. package/dist/enterprise/security-manager.js +137 -129
  563. package/dist/enterprise/security-manager.js.map +1 -1
  564. package/dist/hive-mind/core/Agent.d.ts.map +1 -1
  565. package/dist/hive-mind/core/Agent.js +36 -36
  566. package/dist/hive-mind/core/Agent.js.map +1 -1
  567. package/dist/hive-mind/core/Communication.d.ts.map +1 -1
  568. package/dist/hive-mind/core/Communication.js +17 -17
  569. package/dist/hive-mind/core/Communication.js.map +1 -1
  570. package/dist/hive-mind/core/DatabaseManager.d.ts.map +1 -1
  571. package/dist/hive-mind/core/DatabaseManager.js +104 -58
  572. package/dist/hive-mind/core/DatabaseManager.js.map +1 -1
  573. package/dist/hive-mind/core/HiveMind.d.ts.map +1 -1
  574. package/dist/hive-mind/core/HiveMind.js +35 -35
  575. package/dist/hive-mind/core/HiveMind.js.map +1 -1
  576. package/dist/hive-mind/core/Memory.d.ts.map +1 -1
  577. package/dist/hive-mind/core/Memory.js +78 -71
  578. package/dist/hive-mind/core/Memory.js.map +1 -1
  579. package/dist/hive-mind/core/MemoryMonitor.d.ts.map +1 -1
  580. package/dist/hive-mind/core/MemoryMonitor.js +38 -38
  581. package/dist/hive-mind/core/MemoryMonitor.js.map +1 -1
  582. package/dist/hive-mind/core/Queen.d.ts.map +1 -1
  583. package/dist/hive-mind/core/Queen.js +110 -47
  584. package/dist/hive-mind/core/Queen.js.map +1 -1
  585. package/dist/hive-mind/integration/ConsensusEngine.d.ts.map +1 -1
  586. package/dist/hive-mind/integration/ConsensusEngine.js +25 -23
  587. package/dist/hive-mind/integration/ConsensusEngine.js.map +1 -1
  588. package/dist/hive-mind/integration/MCPToolWrapper.d.ts.map +1 -1
  589. package/dist/hive-mind/integration/MCPToolWrapper.js.map +1 -1
  590. package/dist/hive-mind/integration/SwarmOrchestrator.d.ts.map +1 -1
  591. package/dist/hive-mind/integration/SwarmOrchestrator.js +60 -58
  592. package/dist/hive-mind/integration/SwarmOrchestrator.js.map +1 -1
  593. package/dist/hive-mind/types.d.ts.map +1 -1
  594. package/dist/integration/mock-components.d.ts.map +1 -1
  595. package/dist/integration/mock-components.js +21 -21
  596. package/dist/integration/mock-components.js.map +1 -1
  597. package/dist/integration/system-integration.d.ts.map +1 -1
  598. package/dist/integration/system-integration.js +13 -11
  599. package/dist/integration/system-integration.js.map +1 -1
  600. package/dist/mcp/auth.d.ts +1 -1
  601. package/dist/mcp/auth.d.ts.map +1 -1
  602. package/dist/mcp/auth.js +8 -1
  603. package/dist/mcp/auth.js.map +1 -1
  604. package/dist/mcp/claude-code-wrapper.d.ts.map +1 -1
  605. package/dist/mcp/claude-code-wrapper.js +169 -68
  606. package/dist/mcp/claude-code-wrapper.js.map +1 -1
  607. package/dist/mcp/claude-flow-tools.d.ts.map +1 -1
  608. package/dist/mcp/claude-flow-tools.js +42 -3
  609. package/dist/mcp/claude-flow-tools.js.map +1 -1
  610. package/dist/mcp/client.d.ts.map +1 -1
  611. package/dist/mcp/client.js.map +1 -1
  612. package/dist/mcp/index.d.ts +6 -6
  613. package/dist/mcp/index.d.ts.map +1 -1
  614. package/dist/mcp/index.js +9 -9
  615. package/dist/mcp/index.js.map +1 -1
  616. package/dist/mcp/integrate-wrapper.d.ts.map +1 -1
  617. package/dist/mcp/integrate-wrapper.js +5 -7
  618. package/dist/mcp/integrate-wrapper.js.map +1 -1
  619. package/dist/mcp/lifecycle-manager.d.ts.map +1 -1
  620. package/dist/mcp/lifecycle-manager.js +8 -7
  621. package/dist/mcp/lifecycle-manager.js.map +1 -1
  622. package/dist/mcp/load-balancer.d.ts.map +1 -1
  623. package/dist/mcp/load-balancer.js +5 -1
  624. package/dist/mcp/load-balancer.js.map +1 -1
  625. package/dist/mcp/orchestration-integration.d.ts.map +1 -1
  626. package/dist/mcp/orchestration-integration.js +22 -9
  627. package/dist/mcp/orchestration-integration.js.map +1 -1
  628. package/dist/mcp/performance-monitor.d.ts.map +1 -1
  629. package/dist/mcp/performance-monitor.js +22 -19
  630. package/dist/mcp/performance-monitor.js.map +1 -1
  631. package/dist/mcp/protocol-manager.d.ts.map +1 -1
  632. package/dist/mcp/protocol-manager.js +8 -19
  633. package/dist/mcp/protocol-manager.js.map +1 -1
  634. package/dist/mcp/recovery/connection-health-monitor.d.ts.map +1 -1
  635. package/dist/mcp/recovery/connection-health-monitor.js +5 -5
  636. package/dist/mcp/recovery/connection-health-monitor.js.map +1 -1
  637. package/dist/mcp/recovery/connection-state-manager.d.ts +4 -0
  638. package/dist/mcp/recovery/connection-state-manager.d.ts.map +1 -1
  639. package/dist/mcp/recovery/connection-state-manager.js +13 -13
  640. package/dist/mcp/recovery/connection-state-manager.js.map +1 -1
  641. package/dist/mcp/recovery/fallback-coordinator.d.ts.map +1 -1
  642. package/dist/mcp/recovery/fallback-coordinator.js +5 -5
  643. package/dist/mcp/recovery/fallback-coordinator.js.map +1 -1
  644. package/dist/mcp/recovery/index.d.ts +4 -4
  645. package/dist/mcp/recovery/index.d.ts.map +1 -1
  646. package/dist/mcp/recovery/index.js +4 -4
  647. package/dist/mcp/recovery/index.js.map +1 -1
  648. package/dist/mcp/recovery/reconnection-manager.d.ts.map +1 -1
  649. package/dist/mcp/recovery/reconnection-manager.js +1 -1
  650. package/dist/mcp/recovery/reconnection-manager.js.map +1 -1
  651. package/dist/mcp/recovery/recovery-manager.d.ts.map +1 -1
  652. package/dist/mcp/recovery/recovery-manager.js +2 -4
  653. package/dist/mcp/recovery/recovery-manager.js.map +1 -1
  654. package/dist/mcp/router.d.ts.map +1 -1
  655. package/dist/mcp/router.js +3 -0
  656. package/dist/mcp/router.js.map +1 -1
  657. package/dist/mcp/ruv-swarm-tools.d.ts.map +1 -1
  658. package/dist/mcp/ruv-swarm-tools.js +132 -102
  659. package/dist/mcp/ruv-swarm-tools.js.map +1 -1
  660. package/dist/mcp/server-with-wrapper.d.ts +3 -0
  661. package/dist/mcp/server-with-wrapper.d.ts.map +1 -1
  662. package/dist/mcp/server-with-wrapper.js +2 -3
  663. package/dist/mcp/server-with-wrapper.js.map +1 -1
  664. package/dist/mcp/server-wrapper-mode.d.ts +5 -0
  665. package/dist/mcp/server-wrapper-mode.d.ts.map +1 -1
  666. package/dist/mcp/server-wrapper-mode.js +2 -3
  667. package/dist/mcp/server-wrapper-mode.js.map +1 -1
  668. package/dist/mcp/server.d.ts.map +1 -1
  669. package/dist/mcp/server.js +12 -7
  670. package/dist/mcp/server.js.map +1 -1
  671. package/dist/mcp/session-manager.d.ts.map +1 -1
  672. package/dist/mcp/session-manager.js +4 -3
  673. package/dist/mcp/session-manager.js.map +1 -1
  674. package/dist/mcp/sparc-modes.d.ts.map +1 -1
  675. package/dist/mcp/sparc-modes.js +15 -15
  676. package/dist/mcp/sparc-modes.js.map +1 -1
  677. package/dist/mcp/swarm-tools.d.ts.map +1 -1
  678. package/dist/mcp/swarm-tools.js +100 -80
  679. package/dist/mcp/swarm-tools.js.map +1 -1
  680. package/dist/mcp/tools.d.ts.map +1 -1
  681. package/dist/mcp/tools.js +28 -12
  682. package/dist/mcp/tools.js.map +1 -1
  683. package/dist/mcp/transports/base.d.ts.map +1 -1
  684. package/dist/mcp/transports/base.js +3 -0
  685. package/dist/mcp/transports/base.js.map +1 -1
  686. package/dist/mcp/transports/http.d.ts +3 -0
  687. package/dist/mcp/transports/http.d.ts.map +1 -1
  688. package/dist/mcp/transports/http.js +3 -3
  689. package/dist/mcp/transports/http.js.map +1 -1
  690. package/dist/mcp/transports/stdio.d.ts +3 -0
  691. package/dist/mcp/transports/stdio.d.ts.map +1 -1
  692. package/dist/mcp/transports/stdio.js +3 -0
  693. package/dist/mcp/transports/stdio.js.map +1 -1
  694. package/dist/memory/advanced-memory-manager.d.ts.map +1 -1
  695. package/dist/memory/advanced-memory-manager.js +109 -100
  696. package/dist/memory/advanced-memory-manager.js.map +1 -1
  697. package/dist/memory/backends/base.d.ts.map +1 -1
  698. package/dist/memory/backends/base.js +3 -0
  699. package/dist/memory/backends/base.js.map +1 -1
  700. package/dist/memory/backends/markdown.d.ts +3 -0
  701. package/dist/memory/backends/markdown.d.ts.map +1 -1
  702. package/dist/memory/backends/markdown.js +8 -8
  703. package/dist/memory/backends/markdown.js.map +1 -1
  704. package/dist/memory/backends/sqlite.d.ts +3 -0
  705. package/dist/memory/backends/sqlite.d.ts.map +1 -1
  706. package/dist/memory/backends/sqlite.js +6 -2
  707. package/dist/memory/backends/sqlite.js.map +1 -1
  708. package/dist/memory/cache.d.ts.map +1 -1
  709. package/dist/memory/cache.js +5 -3
  710. package/dist/memory/cache.js.map +1 -1
  711. package/dist/memory/distributed-memory.d.ts.map +1 -1
  712. package/dist/memory/distributed-memory.js +27 -28
  713. package/dist/memory/distributed-memory.js.map +1 -1
  714. package/dist/memory/fallback-store.d.ts.map +1 -1
  715. package/dist/memory/fallback-store.js.map +1 -1
  716. package/dist/memory/in-memory-store.d.ts.map +1 -1
  717. package/dist/memory/in-memory-store.js +8 -8
  718. package/dist/memory/in-memory-store.js.map +1 -1
  719. package/dist/memory/indexer.d.ts.map +1 -1
  720. package/dist/memory/indexer.js +4 -1
  721. package/dist/memory/indexer.js.map +1 -1
  722. package/dist/memory/manager.d.ts.map +1 -1
  723. package/dist/memory/manager.js +17 -20
  724. package/dist/memory/manager.js.map +1 -1
  725. package/dist/memory/sqlite-store.js +12 -8
  726. package/dist/memory/sqlite-store.js.map +1 -1
  727. package/dist/memory/swarm-memory.d.ts.map +1 -1
  728. package/dist/memory/swarm-memory.js +37 -44
  729. package/dist/memory/swarm-memory.js.map +1 -1
  730. package/dist/migration/index.d.ts +4 -0
  731. package/dist/migration/index.d.ts.map +1 -1
  732. package/dist/migration/index.js +8 -8
  733. package/dist/migration/index.js.map +1 -1
  734. package/dist/migration/logger.d.ts.map +1 -1
  735. package/dist/migration/logger.js +5 -5
  736. package/dist/migration/logger.js.map +1 -1
  737. package/dist/migration/migration-analyzer.d.ts +3 -0
  738. package/dist/migration/migration-analyzer.d.ts.map +1 -1
  739. package/dist/migration/migration-analyzer.js +25 -20
  740. package/dist/migration/migration-analyzer.js.map +1 -1
  741. package/dist/migration/migration-runner.d.ts.map +1 -1
  742. package/dist/migration/migration-runner.js +35 -29
  743. package/dist/migration/migration-runner.js.map +1 -1
  744. package/dist/migration/migration-validator.d.ts +3 -0
  745. package/dist/migration/migration-validator.d.ts.map +1 -1
  746. package/dist/migration/migration-validator.js +22 -26
  747. package/dist/migration/migration-validator.js.map +1 -1
  748. package/dist/migration/progress-reporter.d.ts +3 -0
  749. package/dist/migration/progress-reporter.d.ts.map +1 -1
  750. package/dist/migration/progress-reporter.js +8 -8
  751. package/dist/migration/progress-reporter.js.map +1 -1
  752. package/dist/migration/rollback-manager.d.ts +3 -0
  753. package/dist/migration/rollback-manager.d.ts.map +1 -1
  754. package/dist/migration/rollback-manager.js +29 -26
  755. package/dist/migration/rollback-manager.js.map +1 -1
  756. package/dist/monitoring/diagnostics.d.ts.map +1 -1
  757. package/dist/monitoring/diagnostics.js +49 -37
  758. package/dist/monitoring/diagnostics.js.map +1 -1
  759. package/dist/monitoring/health-check.d.ts.map +1 -1
  760. package/dist/monitoring/health-check.js +24 -25
  761. package/dist/monitoring/health-check.js.map +1 -1
  762. package/dist/monitoring/real-time-monitor.d.ts.map +1 -1
  763. package/dist/monitoring/real-time-monitor.js +71 -58
  764. package/dist/monitoring/real-time-monitor.js.map +1 -1
  765. package/dist/resources/resource-manager.d.ts.map +1 -1
  766. package/dist/resources/resource-manager.js +96 -83
  767. package/dist/resources/resource-manager.js.map +1 -1
  768. package/dist/swarm/claude-flow-executor.d.ts.map +1 -1
  769. package/dist/swarm/claude-flow-executor.js +37 -31
  770. package/dist/swarm/claude-flow-executor.js.map +1 -1
  771. package/dist/swarm/coordinator.d.ts.map +1 -1
  772. package/dist/swarm/coordinator.js +330 -280
  773. package/dist/swarm/coordinator.js.map +1 -1
  774. package/dist/swarm/direct-executor.d.ts.map +1 -1
  775. package/dist/swarm/direct-executor.js +44 -37
  776. package/dist/swarm/direct-executor.js.map +1 -1
  777. package/dist/swarm/executor-v2.d.ts.map +1 -1
  778. package/dist/swarm/executor-v2.js +28 -27
  779. package/dist/swarm/executor-v2.js.map +1 -1
  780. package/dist/swarm/executor.d.ts +3 -0
  781. package/dist/swarm/executor.d.ts.map +1 -1
  782. package/dist/swarm/executor.js +58 -52
  783. package/dist/swarm/executor.js.map +1 -1
  784. package/dist/swarm/index.d.ts.map +1 -1
  785. package/dist/swarm/index.js +2 -2
  786. package/dist/swarm/index.js.map +1 -1
  787. package/dist/swarm/json-output-aggregator.d.ts.map +1 -1
  788. package/dist/swarm/json-output-aggregator.js +20 -19
  789. package/dist/swarm/json-output-aggregator.js.map +1 -1
  790. package/dist/swarm/memory.d.ts.map +1 -1
  791. package/dist/swarm/memory.js +67 -67
  792. package/dist/swarm/memory.js.map +1 -1
  793. package/dist/swarm/optimizations/async-file-manager.d.ts +4 -0
  794. package/dist/swarm/optimizations/async-file-manager.d.ts.map +1 -1
  795. package/dist/swarm/optimizations/async-file-manager.js +19 -23
  796. package/dist/swarm/optimizations/async-file-manager.js.map +1 -1
  797. package/dist/swarm/optimizations/circular-buffer.d.ts.map +1 -1
  798. package/dist/swarm/optimizations/circular-buffer.js +2 -4
  799. package/dist/swarm/optimizations/circular-buffer.js.map +1 -1
  800. package/dist/swarm/optimizations/connection-pool.d.ts.map +1 -1
  801. package/dist/swarm/optimizations/connection-pool.js +12 -13
  802. package/dist/swarm/optimizations/connection-pool.js.map +1 -1
  803. package/dist/swarm/optimizations/index.js +2 -2
  804. package/dist/swarm/optimizations/optimized-executor.d.ts.map +1 -1
  805. package/dist/swarm/optimizations/optimized-executor.js +23 -29
  806. package/dist/swarm/optimizations/optimized-executor.js.map +1 -1
  807. package/dist/swarm/optimizations/ttl-map.d.ts.map +1 -1
  808. package/dist/swarm/optimizations/ttl-map.js +4 -4
  809. package/dist/swarm/optimizations/ttl-map.js.map +1 -1
  810. package/dist/swarm/prompt-cli.d.ts.map +1 -1
  811. package/dist/swarm/prompt-cli.js +18 -13
  812. package/dist/swarm/prompt-cli.js.map +1 -1
  813. package/dist/swarm/prompt-copier-enhanced.d.ts.map +1 -1
  814. package/dist/swarm/prompt-copier-enhanced.js +12 -12
  815. package/dist/swarm/prompt-copier-enhanced.js.map +1 -1
  816. package/dist/swarm/prompt-copier.d.ts.map +1 -1
  817. package/dist/swarm/prompt-copier.js +15 -18
  818. package/dist/swarm/prompt-copier.js.map +1 -1
  819. package/dist/swarm/prompt-manager.d.ts.map +1 -1
  820. package/dist/swarm/prompt-manager.js +27 -21
  821. package/dist/swarm/prompt-manager.js.map +1 -1
  822. package/dist/swarm/prompt-utils.d.ts.map +1 -1
  823. package/dist/swarm/prompt-utils.js +34 -32
  824. package/dist/swarm/prompt-utils.js.map +1 -1
  825. package/dist/swarm/sparc-executor.d.ts.map +1 -1
  826. package/dist/swarm/sparc-executor.js +189 -123
  827. package/dist/swarm/sparc-executor.js.map +1 -1
  828. package/dist/swarm/strategies/auto.d.ts.map +1 -1
  829. package/dist/swarm/strategies/auto.js +105 -86
  830. package/dist/swarm/strategies/auto.js.map +1 -1
  831. package/dist/swarm/strategies/base.d.ts.map +1 -1
  832. package/dist/swarm/strategies/base.js +14 -11
  833. package/dist/swarm/strategies/base.js.map +1 -1
  834. package/dist/swarm/strategies/research.d.ts.map +1 -1
  835. package/dist/swarm/strategies/research.js +76 -71
  836. package/dist/swarm/strategies/research.js.map +1 -1
  837. package/dist/swarm/types.d.ts.map +1 -1
  838. package/dist/swarm/types.js +3 -0
  839. package/dist/swarm/types.js.map +1 -1
  840. package/dist/swarm/workers/copy-worker.js +4 -4
  841. package/dist/swarm/workers/copy-worker.js.map +1 -1
  842. package/dist/task/commands.d.ts.map +1 -1
  843. package/dist/task/commands.js +11 -7
  844. package/dist/task/commands.js.map +1 -1
  845. package/dist/task/coordination.d.ts.map +1 -1
  846. package/dist/task/coordination.js +75 -70
  847. package/dist/task/coordination.js.map +1 -1
  848. package/dist/task/engine.d.ts.map +1 -1
  849. package/dist/task/engine.js +34 -32
  850. package/dist/task/engine.js.map +1 -1
  851. package/dist/task/index.d.ts +3 -3
  852. package/dist/task/index.d.ts.map +1 -1
  853. package/dist/task/index.js +11 -11
  854. package/dist/task/index.js.map +1 -1
  855. package/dist/terminal/adapters/native.d.ts.map +1 -1
  856. package/dist/terminal/adapters/native.js +6 -6
  857. package/dist/terminal/adapters/native.js.map +1 -1
  858. package/dist/terminal/adapters/vscode.d.ts +3 -0
  859. package/dist/terminal/adapters/vscode.d.ts.map +1 -1
  860. package/dist/terminal/adapters/vscode.js +6 -4
  861. package/dist/terminal/adapters/vscode.js.map +1 -1
  862. package/dist/terminal/manager.d.ts.map +1 -1
  863. package/dist/terminal/manager.js +6 -8
  864. package/dist/terminal/manager.js.map +1 -1
  865. package/dist/terminal/pool.d.ts.map +1 -1
  866. package/dist/terminal/pool.js +3 -0
  867. package/dist/terminal/pool.js.map +1 -1
  868. package/dist/terminal/session.d.ts.map +1 -1
  869. package/dist/terminal/session.js +6 -2
  870. package/dist/terminal/session.js.map +1 -1
  871. package/dist/ui/hive-dashboard.d.ts.map +1 -1
  872. package/dist/ui/hive-dashboard.js +52 -33
  873. package/dist/ui/hive-dashboard.js.map +1 -1
  874. package/dist/utils/error-handler.d.ts.map +1 -1
  875. package/dist/utils/error-handler.js +1 -1
  876. package/dist/utils/error-handler.js.map +1 -1
  877. package/dist/utils/errors.d.ts.map +1 -1
  878. package/dist/utils/errors.js.map +1 -1
  879. package/dist/utils/helpers.d.ts +3 -0
  880. package/dist/utils/helpers.d.ts.map +1 -1
  881. package/dist/utils/helpers.js +5 -8
  882. package/dist/utils/helpers.js.map +1 -1
  883. package/dist/utils/npx-isolated-cache.js +3 -3
  884. package/dist/utils/npx-isolated-cache.js.map +1 -1
  885. package/dist/utils/paths.d.ts.map +1 -1
  886. package/dist/utils/paths.js +8 -4
  887. package/dist/utils/paths.js.map +1 -1
  888. package/dist/utils/type-guards.d.ts +1 -1
  889. package/dist/utils/type-guards.d.ts.map +1 -1
  890. package/dist/utils/type-guards.js +11 -10
  891. package/dist/utils/type-guards.js.map +1 -1
  892. package/package.json +7 -6
  893. package/src/adapters/cliffy-node.ts +27 -22
  894. package/src/agents/agent-manager.ts +145 -121
  895. package/src/agents/agent-registry.ts +77 -70
  896. package/src/api/claude-client.ts +59 -38
  897. package/src/api/routes/analysis.js +750 -735
  898. package/src/cli/__tests__/command-registry.test.js +42 -32
  899. package/src/cli/__tests__/simple-cli.test.js +42 -37
  900. package/src/cli/__tests__/utils.test.js +9 -9
  901. package/src/cli/agents/README.md +30 -4
  902. package/src/cli/agents/analyst.ts +161 -163
  903. package/src/cli/agents/architect.ts +126 -131
  904. package/src/cli/agents/base-agent.ts +48 -47
  905. package/src/cli/agents/capabilities.ts +87 -85
  906. package/src/cli/agents/coder.ts +127 -120
  907. package/src/cli/agents/coordinator.ts +72 -72
  908. package/src/cli/agents/hive-agents.ts +96 -70
  909. package/src/cli/agents/index.ts +70 -55
  910. package/src/cli/agents/researcher.ts +63 -74
  911. package/src/cli/agents/tester.ts +91 -98
  912. package/src/cli/cli-core.ts +56 -47
  913. package/src/cli/command-registry.js +82 -83
  914. package/src/cli/commands/advanced-memory-commands.ts +210 -142
  915. package/src/cli/commands/agent-simple.ts +146 -114
  916. package/src/cli/commands/agent.ts +119 -95
  917. package/src/cli/commands/claude-api.ts +19 -15
  918. package/src/cli/commands/claude.ts +96 -88
  919. package/src/cli/commands/config-integration.ts +120 -101
  920. package/src/cli/commands/config.ts +10 -8
  921. package/src/cli/commands/enterprise.ts +323 -187
  922. package/src/cli/commands/help-new.ts +57 -55
  923. package/src/cli/commands/help.ts +162 -159
  924. package/src/cli/commands/hive-mind/index.ts +3 -3
  925. package/src/cli/commands/hive-mind/init.ts +19 -12
  926. package/src/cli/commands/hive-mind/optimize-memory.ts +83 -53
  927. package/src/cli/commands/hive-mind/pause.ts +27 -25
  928. package/src/cli/commands/hive-mind/ps.ts +43 -37
  929. package/src/cli/commands/hive-mind/resume.ts +26 -26
  930. package/src/cli/commands/hive-mind/spawn.ts +37 -29
  931. package/src/cli/commands/hive-mind/status.ts +51 -51
  932. package/src/cli/commands/hive-mind/stop.ts +56 -51
  933. package/src/cli/commands/hive-mind/task.ts +65 -54
  934. package/src/cli/commands/hive-mind/wizard.ts +181 -167
  935. package/src/cli/commands/hive.ts +136 -96
  936. package/src/cli/commands/hook-types.ts +2 -2
  937. package/src/cli/commands/hook-validator.ts +8 -4
  938. package/src/cli/commands/hook.ts +44 -42
  939. package/src/cli/commands/index.ts +1162 -1031
  940. package/src/cli/commands/mcp.ts +105 -94
  941. package/src/cli/commands/memory.ts +24 -21
  942. package/src/cli/commands/migrate.ts +24 -24
  943. package/src/cli/commands/monitor.ts +123 -93
  944. package/src/cli/commands/ruv-swarm.ts +131 -122
  945. package/src/cli/commands/session.ts +60 -45
  946. package/src/cli/commands/sparc.ts +170 -139
  947. package/src/cli/commands/start/event-emitter.ts +2 -2
  948. package/src/cli/commands/start/index.ts +1 -1
  949. package/src/cli/commands/start/process-manager.ts +30 -47
  950. package/src/cli/commands/start/process-ui-simple.ts +60 -49
  951. package/src/cli/commands/start/process-ui.ts +1 -1
  952. package/src/cli/commands/start/start-command.ts +104 -75
  953. package/src/cli/commands/start/system-monitor.ts +35 -41
  954. package/src/cli/commands/start/types.ts +3 -3
  955. package/src/cli/commands/start.ts +1 -1
  956. package/src/cli/commands/status.ts +67 -67
  957. package/src/cli/commands/swarm-spawn.ts +21 -12
  958. package/src/cli/commands/swarm.ts +221 -150
  959. package/src/cli/commands/task.ts +55 -55
  960. package/src/cli/commands/workflow.ts +174 -157
  961. package/src/cli/completion.ts +34 -19
  962. package/src/cli/create-enhanced-task.js +49 -17
  963. package/src/cli/formatter.ts +38 -37
  964. package/src/cli/help-formatter.js +23 -33
  965. package/src/cli/help-formatter.ts +24 -34
  966. package/src/cli/help-text.js +69 -60
  967. package/src/cli/index-remote.ts +12 -9
  968. package/src/cli/index.ts +77 -67
  969. package/src/cli/init/batch-tools.ts +4 -5
  970. package/src/cli/init/claude-config.ts +125 -118
  971. package/src/cli/init/directory-structure.ts +10 -11
  972. package/src/cli/init/index.ts +13 -13
  973. package/src/cli/init/sparc-environment.ts +90 -74
  974. package/src/cli/init/swarm-commands.ts +5 -6
  975. package/src/cli/init/utils.ts +1 -1
  976. package/src/cli/main.ts +9 -10
  977. package/src/cli/node-compat.js +26 -19
  978. package/src/cli/node-repl.ts +104 -87
  979. package/src/cli/repl.ts +190 -158
  980. package/src/cli/runtime-detector.js +24 -19
  981. package/src/cli/simple-cli.js +460 -385
  982. package/src/cli/simple-cli.ts +426 -366
  983. package/src/cli/simple-commands/__tests__/agent.test.js +49 -55
  984. package/src/cli/simple-commands/__tests__/memory.test.js +4 -401
  985. package/src/cli/simple-commands/__tests__/swarm.test.js +49 -55
  986. package/src/cli/simple-commands/__tests__/task.test.js +4 -478
  987. package/src/cli/simple-commands/agent.js +27 -27
  988. package/src/cli/simple-commands/analysis.js +179 -161
  989. package/src/cli/simple-commands/automation.js +226 -205
  990. package/src/cli/simple-commands/batch-manager.js +98 -88
  991. package/src/cli/simple-commands/config.js +65 -60
  992. package/src/cli/simple-commands/coordination.js +197 -185
  993. package/src/cli/simple-commands/enhanced-ui-views.js +142 -115
  994. package/src/cli/simple-commands/enhanced-webui-complete.js +267 -167
  995. package/src/cli/simple-commands/fix-hook-variables.js +73 -67
  996. package/src/cli/simple-commands/github/gh-coordinator.js +63 -53
  997. package/src/cli/simple-commands/github/github-api.js +45 -47
  998. package/src/cli/simple-commands/github.js +33 -34
  999. package/src/cli/simple-commands/hive-mind/auto-save-middleware.js +44 -40
  1000. package/src/cli/simple-commands/hive-mind/communication.js +198 -185
  1001. package/src/cli/simple-commands/hive-mind/core.js +289 -304
  1002. package/src/cli/simple-commands/hive-mind/db-optimizer.js +278 -168
  1003. package/src/cli/simple-commands/hive-mind/mcp-wrapper.js +352 -258
  1004. package/src/cli/simple-commands/hive-mind/memory.js +356 -287
  1005. package/src/cli/simple-commands/hive-mind/performance-optimizer.js +88 -79
  1006. package/src/cli/simple-commands/hive-mind/performance-test.js +61 -49
  1007. package/src/cli/simple-commands/hive-mind/queen.js +223 -213
  1008. package/src/cli/simple-commands/hive-mind/session-manager.js +217 -157
  1009. package/src/cli/simple-commands/hive-mind-optimize.js +69 -65
  1010. package/src/cli/simple-commands/hive-mind-wizard.js +213 -211
  1011. package/src/cli/simple-commands/hive-mind.js +598 -432
  1012. package/src/cli/simple-commands/hive.js +12 -12
  1013. package/src/cli/simple-commands/hook-safety.js +114 -111
  1014. package/src/cli/simple-commands/hooks.js +1077 -1017
  1015. package/src/cli/simple-commands/init/README.md +8 -1
  1016. package/src/cli/simple-commands/init/VALIDATION_ROLLBACK.md +27 -1
  1017. package/src/cli/simple-commands/init/batch-init.js +105 -100
  1018. package/src/cli/simple-commands/init/claude-commands/claude-flow-commands.js +6 -6
  1019. package/src/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +6 -6
  1020. package/src/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +20 -18
  1021. package/src/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +85 -71
  1022. package/src/cli/simple-commands/init/claude-commands/slash-commands.js +6 -7
  1023. package/src/cli/simple-commands/init/claude-commands/sparc-commands.js +42 -33
  1024. package/src/cli/simple-commands/init/executable-wrapper.js +13 -10
  1025. package/src/cli/simple-commands/init/gitignore-updater.js +22 -22
  1026. package/src/cli/simple-commands/init/help.js +4 -2
  1027. package/src/cli/simple-commands/init/index.js +405 -303
  1028. package/src/cli/simple-commands/init/performance-monitor.js +71 -64
  1029. package/src/cli/simple-commands/init/rollback/backup-manager.js +44 -64
  1030. package/src/cli/simple-commands/init/rollback/index.js +31 -39
  1031. package/src/cli/simple-commands/init/rollback/recovery-manager.js +71 -101
  1032. package/src/cli/simple-commands/init/rollback/rollback-executor.js +34 -53
  1033. package/src/cli/simple-commands/init/rollback/state-tracker.js +38 -49
  1034. package/src/cli/simple-commands/init/sparc/roo-readme.js +1 -1
  1035. package/src/cli/simple-commands/init/sparc/roomodes-config.js +99 -77
  1036. package/src/cli/simple-commands/init/sparc/workflows.js +37 -33
  1037. package/src/cli/simple-commands/init/sparc-structure.js +9 -10
  1038. package/src/cli/simple-commands/init/templates/CLAUDE.md +94 -26
  1039. package/src/cli/simple-commands/init/templates/claude-flow-universal +9 -7
  1040. package/src/cli/simple-commands/init/templates/claude-md.js +1 -1
  1041. package/src/cli/simple-commands/init/templates/commands/analysis/bottleneck-detect.md +15 -3
  1042. package/src/cli/simple-commands/init/templates/commands/automation/auto-agent.md +12 -2
  1043. package/src/cli/simple-commands/init/templates/commands/coordination/swarm-init.md +10 -1
  1044. package/src/cli/simple-commands/init/templates/commands/github/github-swarm.md +18 -5
  1045. package/src/cli/simple-commands/init/templates/commands/hooks/notification.md +12 -1
  1046. package/src/cli/simple-commands/init/templates/commands/hooks/post-command.md +12 -1
  1047. package/src/cli/simple-commands/init/templates/commands/hooks/post-edit.md +12 -1
  1048. package/src/cli/simple-commands/init/templates/commands/hooks/post-task.md +12 -1
  1049. package/src/cli/simple-commands/init/templates/commands/hooks/pre-command.md +12 -1
  1050. package/src/cli/simple-commands/init/templates/commands/hooks/pre-edit.md +12 -1
  1051. package/src/cli/simple-commands/init/templates/commands/hooks/pre-search.md +13 -6
  1052. package/src/cli/simple-commands/init/templates/commands/hooks/pre-task.md +12 -1
  1053. package/src/cli/simple-commands/init/templates/commands/hooks/session-end.md +12 -1
  1054. package/src/cli/simple-commands/init/templates/commands/hooks/session-restore.md +13 -5
  1055. package/src/cli/simple-commands/init/templates/commands/hooks/session-start.md +12 -1
  1056. package/src/cli/simple-commands/init/templates/coordination-md.js +1 -1
  1057. package/src/cli/simple-commands/init/templates/enhanced-templates.js +116 -113
  1058. package/src/cli/simple-commands/init/templates/memory-bank-md.js +1 -1
  1059. package/src/cli/simple-commands/init/templates/readme-files.js +1 -1
  1060. package/src/cli/simple-commands/init/templates/safe-hook-patterns.js +176 -127
  1061. package/src/cli/simple-commands/init/templates/settings.json +2 -5
  1062. package/src/cli/simple-commands/init/templates/sparc-modes.js +3 -3
  1063. package/src/cli/simple-commands/init/validation/config-validator.js +17 -28
  1064. package/src/cli/simple-commands/init/validation/health-checker.js +54 -62
  1065. package/src/cli/simple-commands/init/validation/index.js +18 -23
  1066. package/src/cli/simple-commands/init/validation/mode-validator.js +22 -32
  1067. package/src/cli/simple-commands/init/validation/post-init-validator.js +25 -26
  1068. package/src/cli/simple-commands/init/validation/pre-init-validator.js +32 -36
  1069. package/src/cli/simple-commands/init/validation/test-runner.js +55 -63
  1070. package/src/cli/simple-commands/init.js +1 -1
  1071. package/src/cli/simple-commands/mcp-integration-layer.js +179 -110
  1072. package/src/cli/simple-commands/mcp.js +55 -48
  1073. package/src/cli/simple-commands/memory.js +62 -56
  1074. package/src/cli/simple-commands/migrate-hooks.js +9 -10
  1075. package/src/cli/simple-commands/monitor.js +87 -67
  1076. package/src/cli/simple-commands/process-ui-enhanced.js +207 -155
  1077. package/src/cli/simple-commands/process-ui.js +65 -56
  1078. package/src/cli/simple-commands/realtime-update-system.js +136 -129
  1079. package/src/cli/simple-commands/sparc/architecture.js +352 -251
  1080. package/src/cli/simple-commands/sparc/commands.js +122 -94
  1081. package/src/cli/simple-commands/sparc/completion.js +274 -199
  1082. package/src/cli/simple-commands/sparc/coordinator.js +217 -169
  1083. package/src/cli/simple-commands/sparc/index.js +40 -36
  1084. package/src/cli/simple-commands/sparc/phase-base.js +72 -58
  1085. package/src/cli/simple-commands/sparc/pseudocode.js +275 -159
  1086. package/src/cli/simple-commands/sparc/refinement.js +306 -212
  1087. package/src/cli/simple-commands/sparc/specification.js +164 -94
  1088. package/src/cli/simple-commands/sparc-modes/architect.js +1 -1
  1089. package/src/cli/simple-commands/sparc-modes/ask.js +1 -1
  1090. package/src/cli/simple-commands/sparc-modes/code.js +1 -1
  1091. package/src/cli/simple-commands/sparc-modes/debug.js +1 -1
  1092. package/src/cli/simple-commands/sparc-modes/devops.js +1 -1
  1093. package/src/cli/simple-commands/sparc-modes/docs-writer.js +1 -1
  1094. package/src/cli/simple-commands/sparc-modes/generic.js +1 -1
  1095. package/src/cli/simple-commands/sparc-modes/index.js +15 -15
  1096. package/src/cli/simple-commands/sparc-modes/integration.js +1 -1
  1097. package/src/cli/simple-commands/sparc-modes/mcp.js +1 -1
  1098. package/src/cli/simple-commands/sparc-modes/monitoring.js +1 -1
  1099. package/src/cli/simple-commands/sparc-modes/optimization.js +1 -1
  1100. package/src/cli/simple-commands/sparc-modes/security-review.js +1 -1
  1101. package/src/cli/simple-commands/sparc-modes/sparc-orchestrator.js +1 -1
  1102. package/src/cli/simple-commands/sparc-modes/spec-pseudocode.js +1 -1
  1103. package/src/cli/simple-commands/sparc-modes/supabase-admin.js +1 -1
  1104. package/src/cli/simple-commands/sparc-modes/swarm.js +52 -52
  1105. package/src/cli/simple-commands/sparc-modes/tdd.js +1 -1
  1106. package/src/cli/simple-commands/sparc-modes/tutorial.js +1 -1
  1107. package/src/cli/simple-commands/sparc.js +87 -69
  1108. package/src/cli/simple-commands/start-ui.js +21 -20
  1109. package/src/cli/simple-commands/start-wrapper.js +29 -31
  1110. package/src/cli/simple-commands/start.js +1 -1
  1111. package/src/cli/simple-commands/status.js +53 -47
  1112. package/src/cli/simple-commands/swarm-executor.js +47 -57
  1113. package/src/cli/simple-commands/swarm-metrics-integration.js +119 -79
  1114. package/src/cli/simple-commands/swarm-ui.js +120 -118
  1115. package/src/cli/simple-commands/swarm-webui-integration.js +48 -27
  1116. package/src/cli/simple-commands/swarm.js +216 -181
  1117. package/src/cli/simple-commands/task.js +29 -29
  1118. package/src/cli/simple-commands/timestamp-fix.js +28 -25
  1119. package/src/cli/simple-commands/tool-execution-framework.js +115 -118
  1120. package/src/cli/simple-commands/training.js +219 -194
  1121. package/src/cli/simple-commands/web-server.js +118 -117
  1122. package/src/cli/simple-commands/webui-validator.js +4 -3
  1123. package/src/cli/simple-mcp.ts +14 -17
  1124. package/src/cli/simple-orchestrator.ts +113 -101
  1125. package/src/cli/swarm-standalone.js +20 -21
  1126. package/src/cli/ui/compatible-ui.ts +55 -44
  1127. package/src/cli/ui/fallback-handler.ts +19 -16
  1128. package/src/cli/ui/index.ts +14 -15
  1129. package/src/cli/utils/environment-detector.ts +75 -67
  1130. package/src/cli/utils/interactive-detector.js +17 -11
  1131. package/src/cli/utils/prompt-defaults.ts +32 -28
  1132. package/src/cli/utils/safe-interactive.js +21 -20
  1133. package/src/cli/utils.js +127 -110
  1134. package/src/cli/validation-helper.js +16 -21
  1135. package/src/cli/validation-helper.ts +21 -34
  1136. package/src/communication/message-bus.ts +137 -124
  1137. package/src/config/config-manager.ts +62 -30
  1138. package/src/config/ruv-swarm-config.ts +105 -86
  1139. package/src/config/ruv-swarm-integration.ts +38 -38
  1140. package/src/constants/agent-types.ts +9 -8
  1141. package/src/coordination/README.md +54 -31
  1142. package/src/coordination/advanced-scheduler.ts +23 -26
  1143. package/src/coordination/advanced-task-executor.ts +74 -68
  1144. package/src/coordination/background-executor.ts +33 -30
  1145. package/src/coordination/circuit-breaker.ts +26 -27
  1146. package/src/coordination/conflict-resolution.ts +18 -27
  1147. package/src/coordination/dependency-graph.ts +15 -18
  1148. package/src/coordination/hive-orchestrator.ts +111 -81
  1149. package/src/coordination/hive-protocol.ts +68 -77
  1150. package/src/coordination/index.ts +3 -7
  1151. package/src/coordination/load-balancer.ts +115 -105
  1152. package/src/coordination/manager.ts +38 -51
  1153. package/src/coordination/messaging.ts +19 -29
  1154. package/src/coordination/metrics.ts +57 -60
  1155. package/src/coordination/resources.ts +32 -37
  1156. package/src/coordination/scheduler.ts +29 -30
  1157. package/src/coordination/swarm-coordinator.ts +81 -70
  1158. package/src/coordination/swarm-monitor.ts +90 -69
  1159. package/src/coordination/work-stealing.ts +6 -13
  1160. package/src/core/config.ts +148 -143
  1161. package/src/core/event-bus.ts +5 -6
  1162. package/src/core/json-persistence.ts +27 -34
  1163. package/src/core/logger.ts +13 -16
  1164. package/src/core/orchestrator-fixed.ts +33 -32
  1165. package/src/core/orchestrator.ts +166 -159
  1166. package/src/core/persistence.ts +47 -36
  1167. package/src/enterprise/analytics-manager.ts +242 -233
  1168. package/src/enterprise/audit-manager.ts +238 -184
  1169. package/src/enterprise/cloud-manager.ts +167 -151
  1170. package/src/enterprise/deployment-manager.ts +223 -180
  1171. package/src/enterprise/index.ts +7 -7
  1172. package/src/enterprise/project-manager.ts +151 -133
  1173. package/src/enterprise/security-manager.ts +278 -223
  1174. package/src/hive-mind/core/Agent.ts +112 -109
  1175. package/src/hive-mind/core/Communication.ts +67 -69
  1176. package/src/hive-mind/core/DatabaseManager.ts +299 -166
  1177. package/src/hive-mind/core/HiveMind.ts +100 -96
  1178. package/src/hive-mind/core/Memory.ts +304 -295
  1179. package/src/hive-mind/core/MemoryMonitor.ts +46 -47
  1180. package/src/hive-mind/core/Queen.ts +187 -114
  1181. package/src/hive-mind/index.ts +2 -2
  1182. package/src/hive-mind/integration/ConsensusEngine.ts +88 -92
  1183. package/src/hive-mind/integration/MCPToolWrapper.ts +20 -72
  1184. package/src/hive-mind/integration/SwarmOrchestrator.ts +173 -165
  1185. package/src/hive-mind/types.ts +24 -12
  1186. package/src/integration/mock-components.ts +42 -30
  1187. package/src/integration/system-integration.ts +79 -78
  1188. package/src/integration/types.ts +7 -7
  1189. package/src/mcp/README.md +23 -4
  1190. package/src/mcp/auth.ts +25 -18
  1191. package/src/mcp/claude-code-wrapper.ts +257 -150
  1192. package/src/mcp/claude-flow-tools.ts +52 -13
  1193. package/src/mcp/client.ts +15 -13
  1194. package/src/mcp/index.ts +22 -27
  1195. package/src/mcp/integrate-wrapper.ts +18 -18
  1196. package/src/mcp/lifecycle-manager.ts +30 -27
  1197. package/src/mcp/load-balancer.ts +10 -11
  1198. package/src/mcp/mcp-server.js +662 -351
  1199. package/src/mcp/orchestration-integration.ts +32 -17
  1200. package/src/mcp/performance-monitor.ts +65 -51
  1201. package/src/mcp/protocol-manager.ts +36 -52
  1202. package/src/mcp/recovery/connection-health-monitor.ts +40 -35
  1203. package/src/mcp/recovery/connection-state-manager.ts +52 -50
  1204. package/src/mcp/recovery/fallback-coordinator.ts +24 -24
  1205. package/src/mcp/recovery/index.ts +23 -4
  1206. package/src/mcp/recovery/reconnection-manager.ts +14 -15
  1207. package/src/mcp/recovery/recovery-manager.ts +52 -68
  1208. package/src/mcp/router.ts +1 -2
  1209. package/src/mcp/ruv-swarm-tools.ts +167 -138
  1210. package/src/mcp/ruv-swarm-wrapper.js +31 -23
  1211. package/src/mcp/server-with-wrapper.ts +4 -5
  1212. package/src/mcp/server-wrapper-mode.ts +5 -6
  1213. package/src/mcp/server.ts +45 -40
  1214. package/src/mcp/session-manager.ts +8 -11
  1215. package/src/mcp/sparc-modes.ts +29 -28
  1216. package/src/mcp/swarm-tools.ts +131 -114
  1217. package/src/mcp/tests/mcp-integration.test.ts +49 -55
  1218. package/src/mcp/tools.ts +53 -38
  1219. package/src/mcp/transports/base.ts +4 -5
  1220. package/src/mcp/transports/http.ts +45 -42
  1221. package/src/mcp/transports/stdio.ts +9 -12
  1222. package/src/memory/README.md +37 -27
  1223. package/src/memory/advanced-memory-manager.ts +336 -279
  1224. package/src/memory/backends/base.ts +4 -5
  1225. package/src/memory/backends/markdown.ts +16 -22
  1226. package/src/memory/backends/sqlite.ts +19 -15
  1227. package/src/memory/cache.ts +18 -18
  1228. package/src/memory/distributed-memory.ts +84 -92
  1229. package/src/memory/enhanced-examples.js +68 -59
  1230. package/src/memory/enhanced-memory.js +99 -80
  1231. package/src/memory/fallback-store.js +16 -7
  1232. package/src/memory/in-memory-store.js +31 -27
  1233. package/src/memory/index.js +4 -4
  1234. package/src/memory/indexer.ts +6 -10
  1235. package/src/memory/manager.ts +45 -59
  1236. package/src/memory/migration.js +107 -90
  1237. package/src/memory/shared-memory.js +155 -157
  1238. package/src/memory/sqlite-store.js +76 -59
  1239. package/src/memory/swarm-memory.js +138 -131
  1240. package/src/memory/swarm-memory.ts +74 -75
  1241. package/src/memory/test-example.js +28 -30
  1242. package/src/migration/README.md +25 -9
  1243. package/src/migration/index.ts +13 -14
  1244. package/src/migration/logger.ts +9 -7
  1245. package/src/migration/migration-analyzer.ts +66 -52
  1246. package/src/migration/migration-manifest.json +2 -6
  1247. package/src/migration/migration-runner.ts +86 -63
  1248. package/src/migration/migration-validator.ts +93 -68
  1249. package/src/migration/package.json +1 -1
  1250. package/src/migration/progress-reporter.ts +25 -21
  1251. package/src/migration/rollback-manager.ts +79 -63
  1252. package/src/migration/tests/migration-system.test.ts +4 -491
  1253. package/src/migration/tsconfig.json +3 -10
  1254. package/src/migration/types.ts +1 -1
  1255. package/src/monitoring/diagnostics.ts +123 -97
  1256. package/src/monitoring/health-check.ts +45 -51
  1257. package/src/monitoring/real-time-monitor.ts +105 -92
  1258. package/src/resources/resource-manager.ts +205 -159
  1259. package/src/swarm/__tests__/integration.test.ts +59 -65
  1260. package/src/swarm/__tests__/prompt-copier.test.ts +27 -27
  1261. package/src/swarm/claude-flow-executor.ts +50 -49
  1262. package/src/swarm/coordinator.ts +727 -635
  1263. package/src/swarm/direct-executor.ts +80 -86
  1264. package/src/swarm/executor-v2.ts +81 -66
  1265. package/src/swarm/executor.ts +124 -124
  1266. package/src/swarm/index.ts +7 -8
  1267. package/src/swarm/json-output-aggregator.ts +56 -40
  1268. package/src/swarm/memory.ts +152 -147
  1269. package/src/swarm/optimizations/README.md +20 -12
  1270. package/src/swarm/optimizations/__tests__/optimization.test.ts +84 -87
  1271. package/src/swarm/optimizations/async-file-manager.ts +70 -80
  1272. package/src/swarm/optimizations/circular-buffer.ts +37 -37
  1273. package/src/swarm/optimizations/connection-pool.ts +64 -64
  1274. package/src/swarm/optimizations/index.ts +4 -4
  1275. package/src/swarm/optimizations/migration-guide.md +27 -16
  1276. package/src/swarm/optimizations/optimized-executor.ts +104 -114
  1277. package/src/swarm/optimizations/ttl-map.ts +66 -63
  1278. package/src/swarm/prompt-cli.ts +48 -42
  1279. package/src/swarm/prompt-copier-enhanced.ts +54 -55
  1280. package/src/swarm/prompt-copier.ts +59 -65
  1281. package/src/swarm/prompt-copying-README.md +49 -33
  1282. package/src/swarm/prompt-manager.ts +69 -63
  1283. package/src/swarm/prompt-utils.ts +71 -66
  1284. package/src/swarm/sparc-executor.ts +298 -225
  1285. package/src/swarm/strategies/auto.ts +367 -252
  1286. package/src/swarm/strategies/base.ts +24 -20
  1287. package/src/swarm/strategies/research.ts +144 -124
  1288. package/src/swarm/types.ts +340 -309
  1289. package/src/swarm/workers/copy-worker.ts +12 -13
  1290. package/src/task/README.md +99 -70
  1291. package/src/task/commands.ts +16 -8
  1292. package/src/task/coordination.ts +209 -162
  1293. package/src/task/engine.ts +81 -65
  1294. package/src/task/index.ts +28 -31
  1295. package/src/templates/claude-optimized/.claude/BATCHTOOLS_BEST_PRACTICES.md +479 -481
  1296. package/src/templates/claude-optimized/.claude/BATCHTOOLS_GUIDE.md +210 -188
  1297. package/src/templates/claude-optimized/.claude/MIGRATION_GUIDE.md +151 -105
  1298. package/src/templates/claude-optimized/.claude/PERFORMANCE_BENCHMARKS.md +102 -87
  1299. package/src/templates/claude-optimized/.claude/commands/claude-flow-help.md +18 -1
  1300. package/src/templates/claude-optimized/.claude/commands/claude-flow-memory.md +17 -1
  1301. package/src/templates/claude-optimized/.claude/commands/claude-flow-swarm.md +21 -1
  1302. package/src/templates/claude-optimized/.claude/commands/sparc/architect.md +11 -4
  1303. package/src/templates/claude-optimized/.claude/commands/sparc/ask.md +16 -10
  1304. package/src/templates/claude-optimized/.claude/commands/sparc/code.md +26 -7
  1305. package/src/templates/claude-optimized/.claude/commands/sparc/debug.md +14 -4
  1306. package/src/templates/claude-optimized/.claude/commands/sparc/devops.md +23 -10
  1307. package/src/templates/claude-optimized/.claude/commands/sparc/docs-writer.md +8 -4
  1308. package/src/templates/claude-optimized/.claude/commands/sparc/integration.md +43 -27
  1309. package/src/templates/claude-optimized/.claude/commands/sparc/mcp.md +15 -1
  1310. package/src/templates/claude-optimized/.claude/commands/sparc/post-deployment-monitoring-mode.md +45 -30
  1311. package/src/templates/claude-optimized/.claude/commands/sparc/refinement-optimization-mode.md +23 -13
  1312. package/src/templates/claude-optimized/.claude/commands/sparc/security-review.md +31 -17
  1313. package/src/templates/claude-optimized/.claude/commands/sparc/sparc.md +54 -47
  1314. package/src/templates/claude-optimized/.claude/commands/sparc/spec-pseudocode.md +27 -17
  1315. package/src/templates/claude-optimized/.claude/commands/sparc/supabase-admin.md +18 -4
  1316. package/src/templates/claude-optimized/.claude/commands/sparc/tdd.md +23 -9
  1317. package/src/templates/claude-optimized/.claude/commands/sparc/tutorial.md +22 -16
  1318. package/src/templates/claude-optimized/.claude/commands/sparc.md +20 -1
  1319. package/src/templates/claude-optimized/README.md +10 -1
  1320. package/src/templates/claude-optimized/SUMMARY.md +23 -1
  1321. package/src/templates/claude-optimized/deploy-to-project.js +22 -10
  1322. package/src/templates/claude-optimized/install-template.js +14 -10
  1323. package/src/templates/claude-optimized/manifest.json +1 -1
  1324. package/src/templates/claude-optimized/package.json +1 -1
  1325. package/src/templates/claude-optimized/template-manager.js +8 -8
  1326. package/src/templates/claude-optimized/validate-template.js +33 -23
  1327. package/src/terminal/adapters/base.ts +1 -1
  1328. package/src/terminal/adapters/native.ts +47 -47
  1329. package/src/terminal/adapters/vscode.ts +21 -28
  1330. package/src/terminal/manager.ts +27 -22
  1331. package/src/terminal/pool.ts +24 -27
  1332. package/src/terminal/session.ts +18 -18
  1333. package/src/terminal/vscode-bridge.ts +21 -21
  1334. package/src/tests/validation-consistency.test.ts +4 -4
  1335. package/src/types/cliffy.d.ts +11 -14
  1336. package/src/types/global.d.ts +1 -2
  1337. package/src/types/index.ts +2 -2
  1338. package/src/types/mcp.d.ts +11 -17
  1339. package/src/types/vscode.d.ts +18 -5
  1340. package/src/ui/console/README-analysis-tools.md +52 -2
  1341. package/src/ui/console/README.md +33 -1
  1342. package/src/ui/console/WORKFLOW_DESIGNER_README.md +81 -22
  1343. package/src/ui/console/analysis-tools.html +282 -261
  1344. package/src/ui/console/analytics.html +329 -326
  1345. package/src/ui/console/index.html +221 -209
  1346. package/src/ui/console/js/analysis-tools.js +815 -754
  1347. package/src/ui/console/js/command-handler.js +226 -196
  1348. package/src/ui/console/js/console.js +117 -119
  1349. package/src/ui/console/js/daa-tools.js +797 -787
  1350. package/src/ui/console/js/memory-interface.js +676 -638
  1351. package/src/ui/console/js/memory-test.js +49 -46
  1352. package/src/ui/console/js/memory-tools.js +181 -159
  1353. package/src/ui/console/js/settings.js +124 -103
  1354. package/src/ui/console/js/terminal-emulator.js +147 -130
  1355. package/src/ui/console/js/websocket-client.js +71 -71
  1356. package/src/ui/console/js/workflow-designer.js +1126 -1110
  1357. package/src/ui/console/neural-networks-demo.md +45 -16
  1358. package/src/ui/console/styles/analysis-tools.css +571 -561
  1359. package/src/ui/console/styles/console.css +16 -12
  1360. package/src/ui/console/styles/daa-tools.css +322 -319
  1361. package/src/ui/console/styles/responsive.css +71 -70
  1362. package/src/ui/console/styles/settings.css +12 -12
  1363. package/src/ui/console/styles/workflow-designer.css +628 -584
  1364. package/src/ui/console/test-neural-networks.js +59 -54
  1365. package/src/ui/console/test-neural.html +194 -196
  1366. package/src/ui/console/workflow-designer-demo.html +433 -424
  1367. package/src/ui/hive-dashboard.ts +74 -52
  1368. package/src/ui/web-ui/EnhancedProcessUI.js +570 -424
  1369. package/src/ui/web-ui/EnhancedWebUI.js +65 -65
  1370. package/src/ui/web-ui/README.md +16 -16
  1371. package/src/ui/web-ui/components/ComponentLibrary.js +173 -124
  1372. package/src/ui/web-ui/core/EventBus.js +27 -25
  1373. package/src/ui/web-ui/core/MCPIntegrationLayer.js +294 -108
  1374. package/src/ui/web-ui/core/StateManager.js +43 -46
  1375. package/src/ui/web-ui/core/UIManager.js +120 -70
  1376. package/src/ui/web-ui/core/ViewManager.js +16 -19
  1377. package/src/ui/web-ui/index.js +101 -48
  1378. package/src/ui/web-ui/neural-panel-test.js +109 -108
  1379. package/src/ui/web-ui/test-github-view.js +11 -12
  1380. package/src/ui/web-ui/test-neural-panel.html +219 -205
  1381. package/src/ui/web-ui/views/DAAView.js +88 -85
  1382. package/src/ui/web-ui/views/GitHubIntegrationTest.js +42 -42
  1383. package/src/ui/web-ui/views/GitHubIntegrationView.js +59 -53
  1384. package/src/ui/web-ui/views/NeuralNetworkView.js +20 -21
  1385. package/src/ui/web-ui/views/WorkflowAutomationView.js +31 -32
  1386. package/src/utils/error-handler.js +1 -1
  1387. package/src/utils/error-handler.ts +9 -5
  1388. package/src/utils/errors.ts +20 -18
  1389. package/src/utils/formatters.ts +6 -6
  1390. package/src/utils/helpers.ts +53 -55
  1391. package/src/utils/npx-isolated-cache.js +16 -16
  1392. package/src/utils/paths.ts +9 -6
  1393. package/src/utils/timezone-utils.js +16 -16
  1394. package/src/utils/type-guards.ts +37 -26
  1395. package/src/utils/types.ts +2 -2
@@ -1,26 +1,26 @@
1
1
  import chalk from 'chalk';
2
2
  import { getErrorMessage } from '../../utils/error-handler.js';
3
- import { CLI, success, error, warning, info, VERSION } from "../cli-core.js";
4
- import type { Command, CommandContext } from "../cli-core.js";
5
- import colors from "chalk";
3
+ import { CLI, success, error, warning, info, VERSION } from '../cli-core.js';
4
+ import type { Command, CommandContext } from '../cli-core.js';
5
+ import colors from 'chalk';
6
6
  const { bold, blue, yellow } = colors;
7
- import { Orchestrator } from "../../core/orchestrator-fixed.js";
8
- import { ConfigManager } from "../../core/config.js";
9
- import type { MemoryManager } from "../../memory/manager.js";
10
- import { EventBus } from "../../core/event-bus.js";
11
- import { Logger } from "../../core/logger.js";
12
- import { JsonPersistenceManager } from "../../core/json-persistence.js";
13
- import { swarmAction } from "./swarm.js";
14
- import { SimpleMemoryManager } from "./memory.js";
15
- import { sparcAction } from "./sparc.js";
16
- import { createMigrateCommand } from "./migrate.js";
17
- import { enterpriseCommands } from "./enterprise.js";
7
+ import { Orchestrator } from '../../core/orchestrator-fixed.js';
8
+ import { ConfigManager } from '../../core/config.js';
9
+ import type { MemoryManager } from '../../memory/manager.js';
10
+ import { EventBus } from '../../core/event-bus.js';
11
+ import { Logger } from '../../core/logger.js';
12
+ import { JsonPersistenceManager } from '../../core/json-persistence.js';
13
+ import { swarmAction } from './swarm.js';
14
+ import { SimpleMemoryManager } from './memory.js';
15
+ import { sparcAction } from './sparc.js';
16
+ import { createMigrateCommand } from './migrate.js';
17
+ import { enterpriseCommands } from './enterprise.js';
18
18
 
19
19
  // Import enhanced orchestration commands
20
- import { startCommand } from "./start.js";
21
- import { statusCommand } from "./status.js";
22
- import { monitorCommand } from "./monitor.js";
23
- import { sessionCommand } from "./session.js";
20
+ import { startCommand } from './start.js';
21
+ import { statusCommand } from './status.js';
22
+ import { monitorCommand } from './monitor.js';
23
+ import { sessionCommand } from './session.js';
24
24
 
25
25
  let orchestrator: Orchestrator | null = null;
26
26
  let configManager: ConfigManager | null = null;
@@ -38,7 +38,7 @@ async function getOrchestrator(): Promise<Orchestrator> {
38
38
  if (!orchestrator) {
39
39
  const config = await getConfigManager();
40
40
  const eventBus = EventBus.getInstance();
41
- const logger = new Logger({ level: "info", format: "text", destination: "console" });
41
+ const logger = new Logger({ level: 'info', format: 'text', destination: 'console' });
42
42
  orchestrator = new Orchestrator(config, eventBus, logger);
43
43
  }
44
44
  return orchestrator;
@@ -55,80 +55,82 @@ async function getConfigManager(): Promise<ConfigManager> {
55
55
  export function setupCommands(cli: CLI): void {
56
56
  // Init command
57
57
  cli.command({
58
- name: "init",
59
- description: "Initialize Claude Code integration files",
58
+ name: 'init',
59
+ description: 'Initialize Claude Code integration files',
60
60
  options: [
61
61
  {
62
- name: "force",
63
- short: "f",
64
- description: "Overwrite existing files",
65
- type: "boolean",
62
+ name: 'force',
63
+ short: 'f',
64
+ description: 'Overwrite existing files',
65
+ type: 'boolean',
66
66
  },
67
67
  {
68
- name: "minimal",
69
- short: "m",
70
- description: "Create minimal configuration files",
71
- type: "boolean",
68
+ name: 'minimal',
69
+ short: 'm',
70
+ description: 'Create minimal configuration files',
71
+ type: 'boolean',
72
72
  },
73
73
  ],
74
74
  action: async (ctx: CommandContext) => {
75
75
  try {
76
- success("Initializing Claude Code integration files...");
77
-
78
- const force = ctx.flags.force as boolean || ctx.flags.f as boolean;
79
- const minimal = ctx.flags.minimal as boolean || ctx.flags.m as boolean;
80
-
76
+ success('Initializing Claude Code integration files...');
77
+
78
+ const force = (ctx.flags.force as boolean) || (ctx.flags.f as boolean);
79
+ const minimal = (ctx.flags.minimal as boolean) || (ctx.flags.m as boolean);
80
+
81
81
  // Check if files already exist
82
- const files = ["CLAUDE.md", "memory-bank.md", "coordination.md"];
82
+ const files = ['CLAUDE.md', 'memory-bank.md', 'coordination.md'];
83
83
  const existingFiles = [];
84
-
84
+
85
85
  for (const file of files) {
86
- const { access } = await import("fs/promises");
87
- const exists = await access(file).then(() => true).catch(() => false);
86
+ const { access } = await import('fs/promises');
87
+ const exists = await access(file)
88
+ .then(() => true)
89
+ .catch(() => false);
88
90
  if (exists) {
89
91
  existingFiles.push(file);
90
92
  }
91
93
  }
92
-
94
+
93
95
  if (existingFiles.length > 0 && !force) {
94
- warning(`The following files already exist: ${existingFiles.join(", ")}`);
95
- console.log("Use --force to overwrite existing files");
96
+ warning(`The following files already exist: ${existingFiles.join(', ')}`);
97
+ console.log('Use --force to overwrite existing files');
96
98
  return;
97
99
  }
98
-
100
+
99
101
  // Create CLAUDE.md
100
102
  const claudeMd = minimal ? createMinimalClaudeMd() : createFullClaudeMd();
101
- const { writeFile } = await import("fs/promises");
102
- await writeFile("CLAUDE.md", claudeMd);
103
- console.log(" ✓ Created CLAUDE.md");
104
-
105
- // Create memory-bank.md
103
+ const { writeFile } = await import('fs/promises');
104
+ await writeFile('CLAUDE.md', claudeMd);
105
+ console.log(' ✓ Created CLAUDE.md');
106
+
107
+ // Create memory-bank.md
106
108
  const memoryBankMd = minimal ? createMinimalMemoryBankMd() : createFullMemoryBankMd();
107
- await writeFile("memory-bank.md", memoryBankMd);
108
- console.log(" ✓ Created memory-bank.md");
109
-
109
+ await writeFile('memory-bank.md', memoryBankMd);
110
+ console.log(' ✓ Created memory-bank.md');
111
+
110
112
  // Create coordination.md
111
113
  const coordinationMd = minimal ? createMinimalCoordinationMd() : createFullCoordinationMd();
112
- await writeFile("coordination.md", coordinationMd);
113
- console.log(" ✓ Created coordination.md");
114
-
114
+ await writeFile('coordination.md', coordinationMd);
115
+ console.log(' ✓ Created coordination.md');
116
+
115
117
  // Create directory structure
116
118
  const directories = [
117
- "memory",
118
- "memory/agents",
119
- "memory/sessions",
120
- "coordination",
121
- "coordination/memory_bank",
122
- "coordination/subtasks",
123
- "coordination/orchestration"
119
+ 'memory',
120
+ 'memory/agents',
121
+ 'memory/sessions',
122
+ 'coordination',
123
+ 'coordination/memory_bank',
124
+ 'coordination/subtasks',
125
+ 'coordination/orchestration',
124
126
  ];
125
-
127
+
126
128
  // Ensure memory directory exists for SQLite database
127
- if (!directories.includes("memory")) {
128
- directories.unshift("memory");
129
+ if (!directories.includes('memory')) {
130
+ directories.unshift('memory');
129
131
  }
130
-
131
- const { mkdir } = await import("fs/promises");
132
+
133
+ const { mkdir } = await import('fs/promises');
132
134
  for (const dir of directories) {
133
135
  try {
134
136
  await mkdir(dir, { recursive: true });
@@ -139,32 +141,31 @@ export function setupCommands(cli: CLI): void {
139
141
  }
140
142
  }
141
143
  }
142
-
144
+
143
145
  // Create placeholder files for memory directories
144
146
  const agentsReadme = createAgentsReadme();
145
- await writeFile("memory/agents/README.md", agentsReadme);
146
- console.log(" ✓ Created memory/agents/README.md");
147
-
147
+ await writeFile('memory/agents/README.md', agentsReadme);
148
+ console.log(' ✓ Created memory/agents/README.md');
149
+
148
150
  const sessionsReadme = createSessionsReadme();
149
- await writeFile("memory/sessions/README.md", sessionsReadme);
150
- console.log(" ✓ Created memory/sessions/README.md");
151
-
151
+ await writeFile('memory/sessions/README.md', sessionsReadme);
152
+ console.log(' ✓ Created memory/sessions/README.md');
153
+
152
154
  // Initialize the persistence database
153
155
  const initialData = {
154
156
  agents: [],
155
157
  tasks: [],
156
- lastUpdated: Date.now()
158
+ lastUpdated: Date.now(),
157
159
  };
158
- await writeFile("memory/claude-flow-data.json", JSON.stringify(initialData, null, 2));
159
- console.log(" ✓ Created memory/claude-flow-data.json (persistence database)");
160
-
161
- success("Claude Code integration files initialized successfully!");
162
- console.log("\nNext steps:");
163
- console.log("1. Review and customize the generated files for your project");
160
+ await writeFile('memory/claude-flow-data.json', JSON.stringify(initialData, null, 2));
161
+ console.log(' ✓ Created memory/claude-flow-data.json (persistence database)');
162
+
163
+ success('Claude Code integration files initialized successfully!');
164
+ console.log('\nNext steps:');
165
+ console.log('1. Review and customize the generated files for your project');
164
166
  console.log("2. Run 'npx claude-flow start' to begin the orchestration system");
165
167
  console.log("3. Use 'claude --dangerously-skip-permissions' for unattended operation");
166
- console.log("\nNote: Persistence database initialized at memory/claude-flow-data.json");
167
-
168
+ console.log('\nNote: Persistence database initialized at memory/claude-flow-data.json');
168
169
  } catch (err) {
169
170
  error(`Failed to initialize files: ${(err as Error).message}`);
170
171
  }
@@ -173,59 +174,59 @@ export function setupCommands(cli: CLI): void {
173
174
 
174
175
  // Start command
175
176
  cli.command({
176
- name: "start",
177
- description: "Start the orchestration system",
177
+ name: 'start',
178
+ description: 'Start the orchestration system',
178
179
  options: [
179
180
  {
180
- name: "daemon",
181
- short: "d",
182
- description: "Run as daemon in background",
183
- type: "boolean",
181
+ name: 'daemon',
182
+ short: 'd',
183
+ description: 'Run as daemon in background',
184
+ type: 'boolean',
184
185
  },
185
186
  {
186
- name: "port",
187
- short: "p",
188
- description: "MCP server port",
189
- type: "number",
187
+ name: 'port',
188
+ short: 'p',
189
+ description: 'MCP server port',
190
+ type: 'number',
190
191
  default: 3000,
191
192
  },
192
193
  ],
193
194
  action: async (ctx: CommandContext) => {
194
- success("Starting Claude-Flow orchestration system...");
195
-
195
+ success('Starting Claude-Flow orchestration system...');
196
+
196
197
  try {
197
198
  const orch = await getOrchestrator();
198
199
  await orch.start();
199
-
200
- success("System started successfully!");
201
- info("Components initialized:");
202
- console.log(" ✓ Event Bus");
203
- console.log(" ✓ Orchestrator Engine");
204
- console.log(" ✓ Memory Manager");
205
- console.log(" ✓ Terminal Pool");
206
- console.log(" ✓ MCP Server");
207
- console.log(" ✓ Coordination Manager");
208
-
200
+
201
+ success('System started successfully!');
202
+ info('Components initialized:');
203
+ console.log(' ✓ Event Bus');
204
+ console.log(' ✓ Orchestrator Engine');
205
+ console.log(' ✓ Memory Manager');
206
+ console.log(' ✓ Terminal Pool');
207
+ console.log(' ✓ MCP Server');
208
+ console.log(' ✓ Coordination Manager');
209
+
209
210
  if (!ctx.flags.daemon) {
210
- info("Press Ctrl+C to stop the system");
211
+ info('Press Ctrl+C to stop the system');
211
212
  // Keep the process running until interrupted
212
213
  const controller = new AbortController();
213
-
214
+
214
215
  const shutdown = () => {
215
- console.log("\nShutting down...");
216
+ console.log('\nShutting down...');
216
217
  controller.abort();
217
218
  };
218
-
219
- process.on("SIGINT", shutdown);
220
- process.on("SIGTERM", shutdown);
221
-
219
+
220
+ process.on('SIGINT', shutdown);
221
+ process.on('SIGTERM', shutdown);
222
+
222
223
  try {
223
224
  await new Promise<void>((resolve) => {
224
225
  controller.signal.addEventListener('abort', () => resolve());
225
226
  });
226
227
  } finally {
227
- process.off("SIGINT", shutdown);
228
- process.off("SIGTERM", shutdown);
228
+ process.off('SIGINT', shutdown);
229
+ process.off('SIGTERM', shutdown);
229
230
  }
230
231
  }
231
232
  } catch (err) {
@@ -237,34 +238,34 @@ export function setupCommands(cli: CLI): void {
237
238
 
238
239
  // Task command
239
240
  cli.command({
240
- name: "task",
241
- description: "Manage tasks",
242
- aliases: ["tasks"],
241
+ name: 'task',
242
+ description: 'Manage tasks',
243
+ aliases: ['tasks'],
243
244
  action: async (ctx: CommandContext) => {
244
245
  const subcommand = ctx.args[0];
245
-
246
+
246
247
  switch (subcommand) {
247
- case "create": {
248
- const type = ctx.args[1] || "general";
249
- const description = ctx.args.slice(2).join(" ") || "No description";
250
-
248
+ case 'create': {
249
+ const type = ctx.args[1] || 'general';
250
+ const description = ctx.args.slice(2).join(' ') || 'No description';
251
+
251
252
  try {
252
253
  const persist = await getPersistence();
253
254
  const taskId = `task-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
254
-
255
+
255
256
  // Save to persistence directly
256
257
  await persist.saveTask({
257
258
  id: taskId,
258
259
  type,
259
260
  description,
260
261
  status: 'pending',
261
- priority: ctx.flags.priority as number || 1,
262
- dependencies: ctx.flags.deps ? (ctx.flags.deps as string).split(",") : [],
262
+ priority: (ctx.flags.priority as number) || 1,
263
+ dependencies: ctx.flags.deps ? (ctx.flags.deps as string).split(',') : [],
263
264
  metadata: {},
264
265
  progress: 0,
265
266
  createdAt: Date.now(),
266
267
  });
267
-
268
+
268
269
  success(`Task created successfully!`);
269
270
  console.log(`📝 Task ID: ${taskId}`);
270
271
  console.log(`🎯 Type: ${type}`);
@@ -274,14 +275,14 @@ export function setupCommands(cli: CLI): void {
274
275
  }
275
276
  break;
276
277
  }
277
-
278
- case "list": {
278
+
279
+ case 'list': {
279
280
  try {
280
281
  const persist = await getPersistence();
281
282
  const tasks = await persist.getActiveTasks();
282
-
283
+
283
284
  if (tasks.length === 0) {
284
- info("No active tasks");
285
+ info('No active tasks');
285
286
  } else {
286
287
  success(`Active tasks (${tasks.length}):`);
287
288
  for (const task of tasks) {
@@ -296,39 +297,39 @@ export function setupCommands(cli: CLI): void {
296
297
  }
297
298
  break;
298
299
  }
299
-
300
- case "assign": {
300
+
301
+ case 'assign': {
301
302
  const taskId = ctx.args[1];
302
303
  const agentId = ctx.args[2];
303
-
304
+
304
305
  if (!taskId || !agentId) {
305
- error("Usage: task assign <task-id> <agent-id>");
306
+ error('Usage: task assign <task-id> <agent-id>');
306
307
  break;
307
308
  }
308
-
309
+
309
310
  try {
310
311
  const persist = await getPersistence();
311
312
  const tasks = await persist.getAllTasks();
312
313
  const agents = await persist.getAllAgents();
313
-
314
- const task = tasks.find(t => t.id === taskId);
315
- const agent = agents.find(a => a.id === agentId);
316
-
314
+
315
+ const task = tasks.find((t) => t.id === taskId);
316
+ const agent = agents.find((a) => a.id === agentId);
317
+
317
318
  if (!task) {
318
319
  error(`Task not found: ${taskId}`);
319
320
  break;
320
321
  }
321
-
322
+
322
323
  if (!agent) {
323
324
  error(`Agent not found: ${agentId}`);
324
325
  break;
325
326
  }
326
-
327
+
327
328
  // Update task with assigned agent
328
329
  task.assignedAgent = agentId;
329
- task.status = "assigned";
330
+ task.status = 'assigned';
330
331
  await persist.saveTask(task);
331
-
332
+
332
333
  success(`Task ${taskId} assigned to agent ${agentId}`);
333
334
  console.log(`📝 Task: ${task.description}`);
334
335
  console.log(`🤖 Agent: ${agent.name} (${agent.type})`);
@@ -337,39 +338,39 @@ export function setupCommands(cli: CLI): void {
337
338
  }
338
339
  break;
339
340
  }
340
-
341
- case "workflow": {
341
+
342
+ case 'workflow': {
342
343
  const workflowFile = ctx.args[1];
343
344
  if (!workflowFile) {
344
- error("Usage: task workflow <workflow-file>");
345
+ error('Usage: task workflow <workflow-file>');
345
346
  break;
346
347
  }
347
-
348
+
348
349
  try {
349
- const { readFile } = await import("fs/promises");
350
- const content = await readFile(workflowFile, "utf-8");
350
+ const { readFile } = await import('fs/promises');
351
+ const content = await readFile(workflowFile, 'utf-8');
351
352
  const workflow = JSON.parse(content);
352
-
353
- success("Workflow loaded:");
353
+
354
+ success('Workflow loaded:');
354
355
  console.log(`📋 Name: ${workflow.name || 'Unnamed'}`);
355
356
  console.log(`📝 Description: ${workflow.description || 'No description'}`);
356
357
  console.log(`🤖 Agents: ${workflow.agents?.length || 0}`);
357
358
  console.log(`📌 Tasks: ${workflow.tasks?.length || 0}`);
358
-
359
+
359
360
  if (ctx.flags.execute) {
360
- warning("Workflow execution would start here (not yet implemented)");
361
+ warning('Workflow execution would start here (not yet implemented)');
361
362
  // TODO: Implement workflow execution
362
363
  } else {
363
- info("To execute this workflow, ensure Claude-Flow is running");
364
+ info('To execute this workflow, ensure Claude-Flow is running');
364
365
  }
365
366
  } catch (err) {
366
367
  error(`Failed to load workflow: ${(err as Error).message}`);
367
368
  }
368
369
  break;
369
370
  }
370
-
371
+
371
372
  default: {
372
- console.log("Available subcommands: create, list, assign, workflow");
373
+ console.log('Available subcommands: create, list, assign, workflow');
373
374
  break;
374
375
  }
375
376
  }
@@ -378,98 +379,98 @@ export function setupCommands(cli: CLI): void {
378
379
 
379
380
  // Enhanced Agent command with comprehensive management
380
381
  cli.command({
381
- name: "agent",
382
- description: "Comprehensive agent management with advanced features",
383
- aliases: ["agents"],
382
+ name: 'agent',
383
+ description: 'Comprehensive agent management with advanced features',
384
+ aliases: ['agents'],
384
385
  action: async (ctx: CommandContext) => {
385
386
  const subcommand = ctx.args[0];
386
-
387
+
387
388
  // Import enhanced agent command dynamically
388
- const { agentCommand } = await import("./agent.js");
389
-
389
+ const { agentCommand } = await import('./agent.js');
390
+
390
391
  // Create a mock context for the enhanced command
391
392
  const enhancedCtx = {
392
393
  args: ctx.args.slice(1), // Remove 'agent' from args
393
394
  flags: ctx.flags,
394
- command: subcommand
395
+ command: subcommand,
395
396
  };
396
-
397
+
397
398
  try {
398
399
  // Map simple commands to enhanced command structure
399
400
  switch (subcommand) {
400
- case "spawn":
401
- case "list":
402
- case "info":
403
- case "terminate":
404
- case "start":
405
- case "restart":
406
- case "pool":
407
- case "health":
401
+ case 'spawn':
402
+ case 'list':
403
+ case 'info':
404
+ case 'terminate':
405
+ case 'start':
406
+ case 'restart':
407
+ case 'pool':
408
+ case 'health':
408
409
  // Use the enhanced agent command system
409
410
  console.log(chalk.cyan('🚀 Using enhanced agent management system...'));
410
-
411
+
411
412
  // Create a simplified wrapper around the enhanced command
412
- const agentManager = await import("../../agents/agent-manager.js");
413
- const { MemoryManager } = await import("../../memory/manager.js");
414
- const { EventBus } = await import("../../core/event-bus.js");
415
- const { Logger } = await import("../../core/logger.js");
416
- const { DistributedMemorySystem } = await import("../../memory/distributed-memory.js");
417
-
418
- warning("Enhanced agent management is available!");
419
- console.log("For full functionality, use the comprehensive agent commands:");
413
+ const agentManager = await import('../../agents/agent-manager.js');
414
+ const { MemoryManager } = await import('../../memory/manager.js');
415
+ const { EventBus } = await import('../../core/event-bus.js');
416
+ const { Logger } = await import('../../core/logger.js');
417
+ const { DistributedMemorySystem } = await import('../../memory/distributed-memory.js');
418
+
419
+ warning('Enhanced agent management is available!');
420
+ console.log('For full functionality, use the comprehensive agent commands:');
420
421
  console.log(` - claude-flow agent ${subcommand} ${ctx.args.slice(1).join(' ')}`);
421
- console.log(" - Enhanced features: pools, health monitoring, resource management");
422
- console.log(" - Interactive configuration and detailed metrics");
422
+ console.log(' - Enhanced features: pools, health monitoring, resource management');
423
+ console.log(' - Interactive configuration and detailed metrics');
423
424
  break;
424
-
425
+
425
426
  default: {
426
- console.log(chalk.cyan("📋 Agent Management Commands:"));
427
- console.log("Available subcommands:");
428
- console.log(" spawn - Create and start new agents");
429
- console.log(" list - Display all agents with status");
430
- console.log(" info - Get detailed agent information");
431
- console.log(" terminate - Safely terminate agents");
432
- console.log(" start - Start a created agent");
433
- console.log(" restart - Restart an agent");
434
- console.log(" pool - Manage agent pools");
435
- console.log(" health - Monitor agent health");
436
- console.log("");
437
- console.log("Enhanced Features:");
438
- console.log(" ✨ Resource allocation and monitoring");
439
- console.log(" ✨ Agent pools for scaling");
440
- console.log(" ✨ Health diagnostics and auto-recovery");
441
- console.log(" ✨ Interactive configuration");
442
- console.log(" ✨ Memory integration for coordination");
443
- console.log("");
444
- console.log("For detailed help, use: claude-flow agent <command> --help");
427
+ console.log(chalk.cyan('📋 Agent Management Commands:'));
428
+ console.log('Available subcommands:');
429
+ console.log(' spawn - Create and start new agents');
430
+ console.log(' list - Display all agents with status');
431
+ console.log(' info - Get detailed agent information');
432
+ console.log(' terminate - Safely terminate agents');
433
+ console.log(' start - Start a created agent');
434
+ console.log(' restart - Restart an agent');
435
+ console.log(' pool - Manage agent pools');
436
+ console.log(' health - Monitor agent health');
437
+ console.log('');
438
+ console.log('Enhanced Features:');
439
+ console.log(' ✨ Resource allocation and monitoring');
440
+ console.log(' ✨ Agent pools for scaling');
441
+ console.log(' ✨ Health diagnostics and auto-recovery');
442
+ console.log(' ✨ Interactive configuration');
443
+ console.log(' ✨ Memory integration for coordination');
444
+ console.log('');
445
+ console.log('For detailed help, use: claude-flow agent <command> --help');
445
446
  break;
446
447
  }
447
448
  }
448
449
  } catch (err) {
449
450
  error(`Enhanced agent management unavailable: ${(err as Error).message}`);
450
-
451
+
451
452
  // Fallback to basic implementation
452
453
  switch (subcommand) {
453
- case "spawn": {
454
- const type = ctx.args[1] || "researcher";
455
- const name = ctx.flags.name as string || `${type}-${Date.now()}`;
456
-
454
+ case 'spawn': {
455
+ const type = ctx.args[1] || 'researcher';
456
+ const name = (ctx.flags.name as string) || `${type}-${Date.now()}`;
457
+
457
458
  try {
458
459
  const persist = await getPersistence();
459
460
  const agentId = `agent-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
460
-
461
+
461
462
  await persist.saveAgent({
462
463
  id: agentId,
463
464
  type,
464
465
  name,
465
466
  status: 'active',
466
467
  capabilities: getCapabilitiesForType(type),
467
- systemPrompt: ctx.flags.prompt as string || getDefaultPromptForType(type),
468
- maxConcurrentTasks: ctx.flags.maxTasks as number || 5,
469
- priority: ctx.flags.priority as number || 1,
468
+ systemPrompt: (ctx.flags.prompt as string) || getDefaultPromptForType(type),
469
+ maxConcurrentTasks: (ctx.flags.maxTasks as number) || 5,
470
+ priority: (ctx.flags.priority as number) || 1,
470
471
  createdAt: Date.now(),
471
472
  });
472
-
473
+
473
474
  success(`Agent spawned successfully!`);
474
475
  console.log(`📝 Agent ID: ${agentId}`);
475
476
  console.log(`🤖 Type: ${type}`);
@@ -480,14 +481,14 @@ export function setupCommands(cli: CLI): void {
480
481
  }
481
482
  break;
482
483
  }
483
-
484
- case "list": {
484
+
485
+ case 'list': {
485
486
  try {
486
487
  const persist = await getPersistence();
487
488
  const agents = await persist.getActiveAgents();
488
-
489
+
489
490
  if (agents.length === 0) {
490
- info("No active agents");
491
+ info('No active agents');
491
492
  } else {
492
493
  success(`Active agents (${agents.length}):`);
493
494
  for (const agent of agents) {
@@ -499,10 +500,10 @@ export function setupCommands(cli: CLI): void {
499
500
  }
500
501
  break;
501
502
  }
502
-
503
+
503
504
  default: {
504
- console.log("Available subcommands (basic): spawn, list");
505
- console.log("For enhanced features, ensure all dependencies are installed.");
505
+ console.log('Available subcommands (basic): spawn, list');
506
+ console.log('For enhanced features, ensure all dependencies are installed.');
506
507
  break;
507
508
  }
508
509
  }
@@ -521,91 +522,116 @@ export function setupCommands(cli: CLI): void {
521
522
  component: ctx.flags.component || ctx.flags.c,
522
523
  json: ctx.flags.json,
523
524
  detailed: ctx.flags.detailed,
524
- healthCheck: ctx.flags.healthCheck || ctx.flags["health-check"],
525
- history: ctx.flags.history
525
+ healthCheck: ctx.flags.healthCheck || ctx.flags['health-check'],
526
+ history: ctx.flags.history,
526
527
  };
527
-
528
+
528
529
  // Mock the enhanced status command action
529
530
  console.log(chalk.cyan('🔍 Enhanced Status Command'));
530
531
  console.log('For full enhanced functionality, use: claude-flow status [options]');
531
- console.log('Available options: --watch, --interval, --component, --json, --detailed, --health-check, --history');
532
-
532
+ console.log(
533
+ 'Available options: --watch, --interval, --component, --json, --detailed, --health-check, --history',
534
+ );
535
+
533
536
  // Fallback to basic status
534
537
  try {
535
538
  const persist = await getPersistence();
536
539
  const stats = await persist.getStats();
537
-
540
+
538
541
  // Check if orchestrator is running by looking for the log file
539
- const { access } = await import("fs/promises");
540
- const isRunning = await access("orchestrator.log").then(() => true).catch(() => false);
541
-
542
- success("Claude-Flow System Status:");
542
+ const { access } = await import('fs/promises');
543
+ const isRunning = await access('orchestrator.log')
544
+ .then(() => true)
545
+ .catch(() => false);
546
+
547
+ success('Claude-Flow System Status:');
543
548
  console.log(`🟢 Status: ${isRunning ? 'Running' : 'Stopped'}`);
544
549
  console.log(`🤖 Agents: ${stats.activeAgents} active (${stats.totalAgents} total)`);
545
550
  console.log(`📋 Tasks: ${stats.pendingTasks} in queue (${stats.totalTasks} total)`);
546
551
  console.log(`💾 Memory: Ready`);
547
552
  console.log(`🖥️ Terminal Pool: Ready`);
548
553
  console.log(`🌐 MCP Server: ${isRunning ? 'Running' : 'Stopped'}`);
549
-
554
+
550
555
  if (ctx.flags.verbose || options.detailed) {
551
- console.log("\nDetailed Statistics:");
556
+ console.log('\nDetailed Statistics:');
552
557
  console.log(` Total Agents: ${stats.totalAgents}`);
553
558
  console.log(` Active Agents: ${stats.activeAgents}`);
554
559
  console.log(` Total Tasks: ${stats.totalTasks}`);
555
560
  console.log(` Pending Tasks: ${stats.pendingTasks}`);
556
561
  console.log(` Completed Tasks: ${stats.completedTasks}`);
557
562
  }
558
-
563
+
559
564
  if (options.watch) {
560
565
  warning('Watch mode available in enhanced status command');
561
566
  console.log('Use: claude-flow status --watch');
562
567
  }
563
-
564
568
  } catch (err) {
565
569
  error(`Failed to get status: ${(err as Error).message}`);
566
570
  }
567
571
  };
568
-
572
+
569
573
  cli.command({
570
- name: "status",
571
- description: "Show enhanced system status with comprehensive reporting",
574
+ name: 'status',
575
+ description: 'Show enhanced system status with comprehensive reporting',
572
576
  options: [
573
- { name: "watch", short: "w", description: "Watch mode - continuously update status", type: "boolean" },
574
- { name: "interval", short: "i", description: "Update interval in seconds", type: "number", default: 5 },
575
- { name: "component", short: "c", description: "Show status for specific component", type: "string" },
576
- { name: "json", description: "Output in JSON format", type: "boolean" },
577
- { name: "detailed", description: "Show detailed component information", type: "boolean" },
578
- { name: "health-check", description: "Perform comprehensive health checks", type: "boolean" },
579
- { name: "history", description: "Show status history from logs", type: "boolean" },
580
- { name: "verbose", short: "v", description: "Enable verbose output", type: "boolean" }
577
+ {
578
+ name: 'watch',
579
+ short: 'w',
580
+ description: 'Watch mode - continuously update status',
581
+ type: 'boolean',
582
+ },
583
+ {
584
+ name: 'interval',
585
+ short: 'i',
586
+ description: 'Update interval in seconds',
587
+ type: 'number',
588
+ default: 5,
589
+ },
590
+ {
591
+ name: 'component',
592
+ short: 'c',
593
+ description: 'Show status for specific component',
594
+ type: 'string',
595
+ },
596
+ { name: 'json', description: 'Output in JSON format', type: 'boolean' },
597
+ { name: 'detailed', description: 'Show detailed component information', type: 'boolean' },
598
+ {
599
+ name: 'health-check',
600
+ description: 'Perform comprehensive health checks',
601
+ type: 'boolean',
602
+ },
603
+ { name: 'history', description: 'Show status history from logs', type: 'boolean' },
604
+ { name: 'verbose', short: 'v', description: 'Enable verbose output', type: 'boolean' },
581
605
  ],
582
- action: enhancedStatusAction
606
+ action: enhancedStatusAction,
583
607
  });
584
608
  } catch (err) {
585
609
  warning('Enhanced status command not available, using basic version');
586
-
610
+
587
611
  // Fallback basic status command
588
612
  cli.command({
589
- name: "status",
590
- description: "Show system status",
613
+ name: 'status',
614
+ description: 'Show system status',
591
615
  action: async (ctx: CommandContext) => {
592
616
  try {
593
617
  const persist = await getPersistence();
594
618
  const stats = await persist.getStats();
595
-
596
- const { access } = await import("fs/promises");
597
- const isRunning = await access("orchestrator.log").then(() => true).catch(() => false);
598
-
599
- success("Claude-Flow System Status:");
619
+
620
+ const { access } = await import('fs/promises');
621
+ const isRunning = await access('orchestrator.log')
622
+ .then(() => true)
623
+ .catch(() => false);
624
+
625
+ success('Claude-Flow System Status:');
600
626
  console.log(`🟢 Status: ${isRunning ? 'Running' : 'Stopped'}`);
601
627
  console.log(`🤖 Agents: ${stats.activeAgents} active (${stats.totalAgents} total)`);
602
628
  console.log(`📋 Tasks: ${stats.pendingTasks} in queue (${stats.totalTasks} total)`);
603
629
  console.log(`💾 Memory: Ready`);
604
630
  console.log(`🖥️ Terminal Pool: Ready`);
605
631
  console.log(`🌐 MCP Server: ${isRunning ? 'Running' : 'Stopped'}`);
606
-
632
+
607
633
  if (ctx.flags.verbose) {
608
- console.log("\nDetailed Statistics:");
634
+ console.log('\nDetailed Statistics:');
609
635
  console.log(` Total Agents: ${stats.totalAgents}`);
610
636
  console.log(` Active Agents: ${stats.activeAgents}`);
611
637
  console.log(` Total Tasks: ${stats.totalTasks}`);
@@ -615,32 +641,32 @@ export function setupCommands(cli: CLI): void {
615
641
  } catch (err) {
616
642
  error(`Failed to get status: ${(err as Error).message}`);
617
643
  }
618
- }
644
+ },
619
645
  });
620
646
  }
621
647
 
622
648
  // MCP command
623
649
  cli.command({
624
- name: "mcp",
625
- description: "Manage MCP server and tools",
650
+ name: 'mcp',
651
+ description: 'Manage MCP server and tools',
626
652
  action: async (ctx: CommandContext) => {
627
653
  const subcommand = ctx.args[0];
628
-
654
+
629
655
  switch (subcommand) {
630
- case "start": {
631
- const port = ctx.flags.port as number || 3000;
632
- const host = ctx.flags.host as string || "localhost";
633
-
656
+ case 'start': {
657
+ const port = (ctx.flags.port as number) || 3000;
658
+ const host = (ctx.flags.host as string) || 'localhost';
659
+
634
660
  try {
635
661
  // MCP server is part of the orchestrator start process
636
662
  const orch = await getOrchestrator();
637
663
  const health = await orch.healthCheck();
638
-
664
+
639
665
  if (!health.healthy) {
640
666
  warning("Orchestrator is not running. Start it first with 'claude-flow start'");
641
667
  return;
642
668
  }
643
-
669
+
644
670
  success(`MCP server is running as part of the orchestration system`);
645
671
  console.log(`📡 Default address: http://${host}:${port}`);
646
672
  console.log(`🔧 Available tools: Research, Code, Terminal, Memory`);
@@ -650,36 +676,38 @@ export function setupCommands(cli: CLI): void {
650
676
  }
651
677
  break;
652
678
  }
653
-
654
- case "stop": {
679
+
680
+ case 'stop': {
655
681
  try {
656
682
  const orch = await getOrchestrator();
657
683
  const health = await orch.healthCheck();
658
-
684
+
659
685
  if (!health.healthy) {
660
- info("MCP server is not running");
686
+ info('MCP server is not running');
661
687
  } else {
662
- warning("MCP server runs as part of the orchestrator. Use 'claude-flow stop' to stop the entire system");
688
+ warning(
689
+ "MCP server runs as part of the orchestrator. Use 'claude-flow stop' to stop the entire system",
690
+ );
663
691
  }
664
692
  } catch (err) {
665
693
  error(`Failed to check MCP server: ${(err as Error).message}`);
666
694
  }
667
695
  break;
668
696
  }
669
-
670
- case "status": {
697
+
698
+ case 'status': {
671
699
  try {
672
700
  const orch = await getOrchestrator();
673
701
  const health = await orch.healthCheck();
674
-
675
- success("MCP Server Status:");
676
- console.log(`🌐 Status: ${health.mcp ? "Running" : "Stopped"}`);
677
-
702
+
703
+ success('MCP Server Status:');
704
+ console.log(`🌐 Status: ${health.mcp ? 'Running' : 'Stopped'}`);
705
+
678
706
  if (health.mcp) {
679
707
  const config = await getConfigManager();
680
708
  const mcpConfig = config.get().mcp;
681
709
  console.log(`📍 Address: ${mcpConfig.host}:${mcpConfig.port}`);
682
- console.log(`🔐 Authentication: ${mcpConfig.auth ? "Enabled" : "Disabled"}`);
710
+ console.log(`🔐 Authentication: ${mcpConfig.auth ? 'Enabled' : 'Disabled'}`);
683
711
  console.log(`🔧 Tools: Available`);
684
712
  console.log(`📊 Metrics: Collecting`);
685
713
  }
@@ -688,78 +716,80 @@ export function setupCommands(cli: CLI): void {
688
716
  }
689
717
  break;
690
718
  }
691
-
692
- case "tools": {
719
+
720
+ case 'tools': {
693
721
  try {
694
- success("Available MCP Tools:");
695
- console.log(" 📊 Research Tools:");
696
- console.log(" • web_search - Search the web for information");
697
- console.log(" • web_fetch - Fetch content from URLs");
698
- console.log(" • knowledge_query - Query knowledge base");
699
-
700
- console.log(" 💻 Code Tools:");
701
- console.log(" • code_edit - Edit code files");
702
- console.log(" • code_search - Search through codebase");
703
- console.log(" • code_analyze - Analyze code quality");
704
-
705
- console.log(" 🖥️ Terminal Tools:");
706
- console.log(" • terminal_execute - Execute shell commands");
707
- console.log(" • terminal_session - Manage terminal sessions");
708
- console.log(" • file_operations - File system operations");
709
-
710
- console.log(" 💾 Memory Tools:");
711
- console.log(" • memory_store - Store information");
712
- console.log(" • memory_query - Query stored information");
713
- console.log(" • memory_index - Index and search content");
722
+ success('Available MCP Tools:');
723
+ console.log(' 📊 Research Tools:');
724
+ console.log(' • web_search - Search the web for information');
725
+ console.log(' • web_fetch - Fetch content from URLs');
726
+ console.log(' • knowledge_query - Query knowledge base');
727
+
728
+ console.log(' 💻 Code Tools:');
729
+ console.log(' • code_edit - Edit code files');
730
+ console.log(' • code_search - Search through codebase');
731
+ console.log(' • code_analyze - Analyze code quality');
732
+
733
+ console.log(' 🖥️ Terminal Tools:');
734
+ console.log(' • terminal_execute - Execute shell commands');
735
+ console.log(' • terminal_session - Manage terminal sessions');
736
+ console.log(' • file_operations - File system operations');
737
+
738
+ console.log(' 💾 Memory Tools:');
739
+ console.log(' • memory_store - Store information');
740
+ console.log(' • memory_query - Query stored information');
741
+ console.log(' • memory_index - Index and search content');
714
742
  } catch (err) {
715
743
  error(`Failed to list tools: ${(err as Error).message}`);
716
744
  }
717
745
  break;
718
746
  }
719
-
720
- case "config": {
747
+
748
+ case 'config': {
721
749
  try {
722
750
  const config = await getConfigManager();
723
751
  const mcpConfig = config.get().mcp;
724
-
725
- success("MCP Configuration:");
752
+
753
+ success('MCP Configuration:');
726
754
  console.log(JSON.stringify(mcpConfig, null, 2));
727
755
  } catch (err) {
728
756
  error(`Failed to show MCP config: ${(err as Error).message}`);
729
757
  }
730
758
  break;
731
759
  }
732
-
733
- case "restart": {
760
+
761
+ case 'restart': {
734
762
  try {
735
- warning("MCP server runs as part of the orchestrator. Use 'claude-flow stop' then 'claude-flow start' to restart the entire system");
763
+ warning(
764
+ "MCP server runs as part of the orchestrator. Use 'claude-flow stop' then 'claude-flow start' to restart the entire system",
765
+ );
736
766
  } catch (err) {
737
767
  error(`Failed to restart MCP server: ${(err as Error).message}`);
738
768
  }
739
769
  break;
740
770
  }
741
-
742
- case "logs": {
743
- const lines = ctx.flags.lines as number || 50;
744
-
771
+
772
+ case 'logs': {
773
+ const lines = (ctx.flags.lines as number) || 50;
774
+
745
775
  try {
746
776
  // Mock logs since logging system might not be fully implemented
747
777
  success(`MCP Server Logs (last ${lines} lines):`);
748
- console.log("2024-01-10 10:00:00 [INFO] MCP server started on localhost:3000");
749
- console.log("2024-01-10 10:00:01 [INFO] Tools registered: 12");
750
- console.log("2024-01-10 10:00:02 [INFO] Authentication disabled");
751
- console.log("2024-01-10 10:01:00 [INFO] Client connected: claude-desktop");
752
- console.log("2024-01-10 10:01:05 [INFO] Tool called: web_search");
753
- console.log("2024-01-10 10:01:10 [INFO] Tool response sent successfully");
778
+ console.log('2024-01-10 10:00:00 [INFO] MCP server started on localhost:3000');
779
+ console.log('2024-01-10 10:00:01 [INFO] Tools registered: 12');
780
+ console.log('2024-01-10 10:00:02 [INFO] Authentication disabled');
781
+ console.log('2024-01-10 10:01:00 [INFO] Client connected: claude-desktop');
782
+ console.log('2024-01-10 10:01:05 [INFO] Tool called: web_search');
783
+ console.log('2024-01-10 10:01:10 [INFO] Tool response sent successfully');
754
784
  } catch (err) {
755
785
  error(`Failed to get logs: ${(err as Error).message}`);
756
786
  }
757
787
  break;
758
788
  }
759
-
789
+
760
790
  default: {
761
791
  error(`Unknown mcp subcommand: ${subcommand}`);
762
- console.log("Available subcommands: start, stop, status, tools, config, restart, logs");
792
+ console.log('Available subcommands: start, stop, status, tools, config, restart, logs');
763
793
  break;
764
794
  }
765
795
  }
@@ -768,27 +798,28 @@ export function setupCommands(cli: CLI): void {
768
798
 
769
799
  // Memory command
770
800
  cli.command({
771
- name: "memory",
772
- description: "Manage memory bank",
773
- aliases: ["mem"],
801
+ name: 'memory',
802
+ description: 'Manage memory bank',
803
+ aliases: ['mem'],
774
804
  action: async (ctx: CommandContext) => {
775
805
  const subcommand = ctx.args[0];
776
806
  const memory = new SimpleMemoryManager();
777
-
807
+
778
808
  switch (subcommand) {
779
- case "store": {
809
+ case 'store': {
780
810
  const key = ctx.args[1];
781
- const value = ctx.args.slice(2).join(" "); // Join all remaining args as value
782
-
811
+ const value = ctx.args.slice(2).join(' '); // Join all remaining args as value
812
+
783
813
  if (!key || !value) {
784
- error("Usage: memory store <key> <value>");
814
+ error('Usage: memory store <key> <value>');
785
815
  break;
786
816
  }
787
-
817
+
788
818
  try {
789
- const namespace = ctx.flags.namespace as string || ctx.flags.n as string || "default";
819
+ const namespace =
820
+ (ctx.flags.namespace as string) || (ctx.flags.n as string) || 'default';
790
821
  await memory.store(key, value, namespace);
791
- success("Stored successfully");
822
+ success('Stored successfully');
792
823
  console.log(`📝 Key: ${key}`);
793
824
  console.log(`📦 Namespace: ${namespace}`);
794
825
  console.log(`💾 Size: ${new TextEncoder().encode(value).length} bytes`);
@@ -797,35 +828,37 @@ export function setupCommands(cli: CLI): void {
797
828
  }
798
829
  break;
799
830
  }
800
-
801
- case "query": {
802
- const search = ctx.args.slice(1).join(" "); // Join all remaining args as search
803
-
831
+
832
+ case 'query': {
833
+ const search = ctx.args.slice(1).join(' '); // Join all remaining args as search
834
+
804
835
  if (!search) {
805
- error("Usage: memory query <search>");
836
+ error('Usage: memory query <search>');
806
837
  break;
807
838
  }
808
-
839
+
809
840
  try {
810
- const namespace = ctx.flags.namespace as string || ctx.flags.n as string;
811
- const limit = ctx.flags.limit as number || ctx.flags.l as number || 10;
841
+ const namespace = (ctx.flags.namespace as string) || (ctx.flags.n as string);
842
+ const limit = (ctx.flags.limit as number) || (ctx.flags.l as number) || 10;
812
843
  const results = await memory.query(search, namespace);
813
-
844
+
814
845
  if (results.length === 0) {
815
- warning("No results found");
846
+ warning('No results found');
816
847
  return;
817
848
  }
818
-
849
+
819
850
  success(`Found ${results.length} results:`);
820
-
851
+
821
852
  const limited = results.slice(0, limit);
822
853
  for (const entry of limited) {
823
854
  console.log(blue(`\n📌 ${entry.key}`));
824
855
  console.log(` Namespace: ${entry.namespace}`);
825
- console.log(` Value: ${entry.value.substring(0, 100)}${entry.value.length > 100 ? '...' : ''}`);
856
+ console.log(
857
+ ` Value: ${entry.value.substring(0, 100)}${entry.value.length > 100 ? '...' : ''}`,
858
+ );
826
859
  console.log(` Stored: ${new Date(entry.timestamp).toLocaleString()}`);
827
860
  }
828
-
861
+
829
862
  if (results.length > limit) {
830
863
  console.log(`\n... and ${results.length - limit} more results`);
831
864
  }
@@ -834,19 +867,19 @@ export function setupCommands(cli: CLI): void {
834
867
  }
835
868
  break;
836
869
  }
837
-
838
- case "export": {
870
+
871
+ case 'export': {
839
872
  const file = ctx.args[1];
840
-
873
+
841
874
  if (!file) {
842
- error("Usage: memory export <file>");
875
+ error('Usage: memory export <file>');
843
876
  break;
844
877
  }
845
-
878
+
846
879
  try {
847
880
  await memory.exportData(file);
848
881
  const stats = await memory.getStats();
849
- success("Memory exported successfully");
882
+ success('Memory exported successfully');
850
883
  console.log(`📁 File: ${file}`);
851
884
  console.log(`📊 Entries: ${stats.totalEntries}`);
852
885
  console.log(`💾 Size: ${(stats.sizeBytes / 1024).toFixed(2)} KB`);
@@ -855,19 +888,19 @@ export function setupCommands(cli: CLI): void {
855
888
  }
856
889
  break;
857
890
  }
858
-
859
- case "import": {
891
+
892
+ case 'import': {
860
893
  const file = ctx.args[1];
861
-
894
+
862
895
  if (!file) {
863
- error("Usage: memory import <file>");
896
+ error('Usage: memory import <file>');
864
897
  break;
865
898
  }
866
-
899
+
867
900
  try {
868
901
  await memory.importData(file);
869
902
  const stats = await memory.getStats();
870
- success("Memory imported successfully");
903
+ success('Memory imported successfully');
871
904
  console.log(`📁 File: ${file}`);
872
905
  console.log(`📊 Entries: ${stats.totalEntries}`);
873
906
  console.log(`🗂️ Namespaces: ${stats.namespaces}`);
@@ -876,18 +909,18 @@ export function setupCommands(cli: CLI): void {
876
909
  }
877
910
  break;
878
911
  }
879
-
880
- case "stats": {
912
+
913
+ case 'stats': {
881
914
  try {
882
915
  const stats = await memory.getStats();
883
-
884
- success("Memory Bank Statistics:");
916
+
917
+ success('Memory Bank Statistics:');
885
918
  console.log(` Total Entries: ${stats.totalEntries}`);
886
919
  console.log(` Namespaces: ${stats.namespaces}`);
887
920
  console.log(` Size: ${(stats.sizeBytes / 1024).toFixed(2)} KB`);
888
-
921
+
889
922
  if (stats.namespaces > 0) {
890
- console.log(blue("\n📁 Namespace Breakdown:"));
923
+ console.log(blue('\n📁 Namespace Breakdown:'));
891
924
  for (const [namespace, count] of Object.entries(stats.namespaceStats)) {
892
925
  console.log(` ${namespace}: ${count} entries`);
893
926
  }
@@ -897,26 +930,26 @@ export function setupCommands(cli: CLI): void {
897
930
  }
898
931
  break;
899
932
  }
900
-
901
- case "cleanup": {
933
+
934
+ case 'cleanup': {
902
935
  try {
903
- const days = ctx.flags.days as number || ctx.flags.d as number || 30;
936
+ const days = (ctx.flags.days as number) || (ctx.flags.d as number) || 30;
904
937
  const removed = await memory.cleanup(days);
905
- success("Cleanup completed");
938
+ success('Cleanup completed');
906
939
  console.log(`🗑️ Removed: ${removed} entries older than ${days} days`);
907
940
  } catch (err) {
908
941
  error(`Failed to cleanup: ${(err as Error).message}`);
909
942
  }
910
943
  break;
911
944
  }
912
-
945
+
913
946
  default: {
914
- console.log("Available subcommands: store, query, export, import, stats, cleanup");
915
- console.log("\nExamples:");
916
- console.log(` ${blue("memory store")} previous_work "Research findings from yesterday"`);
917
- console.log(` ${blue("memory query")} research`);
918
- console.log(` ${blue("memory export")} backup.json`);
919
- console.log(` ${blue("memory stats")}`);
947
+ console.log('Available subcommands: store, query, export, import, stats, cleanup');
948
+ console.log('\nExamples:');
949
+ console.log(` ${blue('memory store')} previous_work "Research findings from yesterday"`);
950
+ console.log(` ${blue('memory query')} research`);
951
+ console.log(` ${blue('memory export')} backup.json`);
952
+ console.log(` ${blue('memory stats')}`);
920
953
  break;
921
954
  }
922
955
  }
@@ -925,104 +958,105 @@ export function setupCommands(cli: CLI): void {
925
958
 
926
959
  // Claude command
927
960
  cli.command({
928
- name: "claude",
929
- description: "Spawn Claude instances with specific configurations",
930
- aliases: ["cl"],
961
+ name: 'claude',
962
+ description: 'Spawn Claude instances with specific configurations',
963
+ aliases: ['cl'],
931
964
  options: [
932
965
  {
933
- name: "tools",
934
- short: "t",
935
- description: "Allowed tools (comma-separated)",
936
- type: "string",
937
- default: "View,Edit,Replace,GlobTool,GrepTool,LS,Bash",
966
+ name: 'tools',
967
+ short: 't',
968
+ description: 'Allowed tools (comma-separated)',
969
+ type: 'string',
970
+ default: 'View,Edit,Replace,GlobTool,GrepTool,LS,Bash',
938
971
  },
939
972
  {
940
- name: "no-permissions",
941
- description: "Use --dangerously-skip-permissions flag",
942
- type: "boolean",
973
+ name: 'no-permissions',
974
+ description: 'Use --dangerously-skip-permissions flag',
975
+ type: 'boolean',
943
976
  },
944
977
  {
945
- name: "config",
946
- short: "c",
947
- description: "MCP config file path",
948
- type: "string",
978
+ name: 'config',
979
+ short: 'c',
980
+ description: 'MCP config file path',
981
+ type: 'string',
949
982
  },
950
983
  {
951
- name: "mode",
952
- short: "m",
953
- description: "Development mode (full, backend-only, frontend-only, api-only)",
954
- type: "string",
955
- default: "full",
984
+ name: 'mode',
985
+ short: 'm',
986
+ description: 'Development mode (full, backend-only, frontend-only, api-only)',
987
+ type: 'string',
988
+ default: 'full',
956
989
  },
957
990
  {
958
- name: "parallel",
959
- description: "Enable parallel execution with BatchTool",
960
- type: "boolean",
991
+ name: 'parallel',
992
+ description: 'Enable parallel execution with BatchTool',
993
+ type: 'boolean',
961
994
  },
962
995
  {
963
- name: "research",
964
- description: "Enable web research with WebFetchTool",
965
- type: "boolean",
996
+ name: 'research',
997
+ description: 'Enable web research with WebFetchTool',
998
+ type: 'boolean',
966
999
  },
967
1000
  {
968
- name: "coverage",
969
- description: "Test coverage target percentage",
970
- type: "number",
1001
+ name: 'coverage',
1002
+ description: 'Test coverage target percentage',
1003
+ type: 'number',
971
1004
  default: 80,
972
1005
  },
973
1006
  {
974
- name: "commit",
975
- description: "Commit frequency (phase, feature, manual)",
976
- type: "string",
977
- default: "phase",
1007
+ name: 'commit',
1008
+ description: 'Commit frequency (phase, feature, manual)',
1009
+ type: 'string',
1010
+ default: 'phase',
978
1011
  },
979
1012
  {
980
- name: "verbose",
981
- short: "v",
982
- description: "Enable verbose output",
983
- type: "boolean",
1013
+ name: 'verbose',
1014
+ short: 'v',
1015
+ description: 'Enable verbose output',
1016
+ type: 'boolean',
984
1017
  },
985
1018
  {
986
- name: "dry-run",
987
- short: "d",
988
- description: "Show what would be executed without running",
989
- type: "boolean",
1019
+ name: 'dry-run',
1020
+ short: 'd',
1021
+ description: 'Show what would be executed without running',
1022
+ type: 'boolean',
990
1023
  },
991
1024
  ],
992
1025
  action: async (ctx: CommandContext) => {
993
1026
  const subcommand = ctx.args[0];
994
-
1027
+
995
1028
  switch (subcommand) {
996
- case "spawn": {
1029
+ case 'spawn': {
997
1030
  // Find where flags start (arguments starting with -)
998
1031
  let taskEndIndex = ctx.args.length;
999
1032
  for (let i = 1; i < ctx.args.length; i++) {
1000
- if (ctx.args[i].startsWith("-")) {
1033
+ if (ctx.args[i].startsWith('-')) {
1001
1034
  taskEndIndex = i;
1002
1035
  break;
1003
1036
  }
1004
1037
  }
1005
-
1006
- const task = ctx.args.slice(1, taskEndIndex).join(" ");
1038
+
1039
+ const task = ctx.args.slice(1, taskEndIndex).join(' ');
1007
1040
  if (!task) {
1008
- error("Usage: claude spawn <task description>");
1041
+ error('Usage: claude spawn <task description>');
1009
1042
  break;
1010
1043
  }
1011
-
1044
+
1012
1045
  try {
1013
1046
  // Build allowed tools list
1014
- let tools = ctx.flags.tools as string || "View,Edit,Replace,GlobTool,GrepTool,LS,Bash";
1015
-
1047
+ let tools =
1048
+ (ctx.flags.tools as string) || 'View,Edit,Replace,GlobTool,GrepTool,LS,Bash';
1049
+
1016
1050
  if (ctx.flags.parallel) {
1017
- tools += ",BatchTool,dispatch_agent";
1051
+ tools += ',BatchTool,dispatch_agent';
1018
1052
  }
1019
-
1053
+
1020
1054
  if (ctx.flags.research) {
1021
- tools += ",WebFetchTool";
1055
+ tools += ',WebFetchTool';
1022
1056
  }
1023
-
1057
+
1024
1058
  const instanceId = `claude-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
1025
-
1059
+
1026
1060
  // Build enhanced task with Claude-Flow guidance
1027
1061
  let enhancedTask = `# Claude-Flow Enhanced Task
1028
1062
 
@@ -1108,45 +1142,47 @@ Bash("npx claude-flow agent spawn researcher --name auth-researcher")
1108
1142
  \`\`\`
1109
1143
 
1110
1144
  Now, please proceed with the task: ${task}`;
1111
-
1145
+
1112
1146
  // Build Claude command with enhanced task
1113
- const claudeCmd = ["claude", enhancedTask];
1114
- claudeCmd.push("--allowedTools", tools);
1115
-
1116
- if (ctx.flags.noPermissions || ctx.flags["skip-permissions"]) {
1117
- claudeCmd.push("--dangerously-skip-permissions");
1147
+ const claudeCmd = ['claude', enhancedTask];
1148
+ claudeCmd.push('--allowedTools', tools);
1149
+
1150
+ if (ctx.flags.noPermissions || ctx.flags['skip-permissions']) {
1151
+ claudeCmd.push('--dangerously-skip-permissions');
1118
1152
  }
1119
-
1153
+
1120
1154
  if (ctx.flags.config) {
1121
- claudeCmd.push("--mcp-config", ctx.flags.config as string);
1155
+ claudeCmd.push('--mcp-config', ctx.flags.config as string);
1122
1156
  }
1123
-
1157
+
1124
1158
  if (ctx.flags.verbose) {
1125
- claudeCmd.push("--verbose");
1159
+ claudeCmd.push('--verbose');
1126
1160
  }
1127
-
1128
- if (ctx.flags.dryRun || ctx.flags["dry-run"] || ctx.flags.d) {
1129
- warning("DRY RUN - Would execute:");
1130
- console.log(`Command: claude "<enhanced task with guidance>" --allowedTools ${tools}`);
1161
+
1162
+ if (ctx.flags.dryRun || ctx.flags['dry-run'] || ctx.flags.d) {
1163
+ warning('DRY RUN - Would execute:');
1164
+ console.log(
1165
+ `Command: claude "<enhanced task with guidance>" --allowedTools ${tools}`,
1166
+ );
1131
1167
  console.log(`Instance ID: ${instanceId}`);
1132
1168
  console.log(`Original Task: ${task}`);
1133
1169
  console.log(`Tools: ${tools}`);
1134
- console.log(`Mode: ${ctx.flags.mode || "full"}`);
1170
+ console.log(`Mode: ${ctx.flags.mode || 'full'}`);
1135
1171
  console.log(`Coverage: ${ctx.flags.coverage || 80}%`);
1136
- console.log(`Commit: ${ctx.flags.commit || "phase"}`);
1172
+ console.log(`Commit: ${ctx.flags.commit || 'phase'}`);
1137
1173
  console.log(`\nEnhanced Features:`);
1138
1174
  console.log(` - Memory Bank enabled via: npx claude-flow memory commands`);
1139
1175
  console.log(` - Coordination ${ctx.flags.parallel ? 'enabled' : 'disabled'}`);
1140
1176
  console.log(` - Access Claude-Flow features through Bash tool`);
1141
1177
  return;
1142
1178
  }
1143
-
1179
+
1144
1180
  success(`Spawning Claude instance: ${instanceId}`);
1145
1181
  console.log(`📝 Original Task: ${task}`);
1146
1182
  console.log(`🔧 Tools: ${tools}`);
1147
- console.log(`⚙️ Mode: ${ctx.flags.mode || "full"}`);
1183
+ console.log(`⚙️ Mode: ${ctx.flags.mode || 'full'}`);
1148
1184
  console.log(`📊 Coverage: ${ctx.flags.coverage || 80}%`);
1149
- console.log(`💾 Commit: ${ctx.flags.commit || "phase"}`);
1185
+ console.log(`💾 Commit: ${ctx.flags.commit || 'phase'}`);
1150
1186
  console.log(`✨ Enhanced with Claude-Flow guidance for memory and coordination`);
1151
1187
  console.log('');
1152
1188
  console.log('📋 Task will be enhanced with:');
@@ -1154,113 +1190,123 @@ Now, please proceed with the task: ${task}`;
1154
1190
  console.log(' - Coordination capabilities (swarm management)');
1155
1191
  console.log(' - Best practices for multi-agent workflows');
1156
1192
  console.log('');
1157
-
1193
+
1158
1194
  // Execute Claude command
1159
- const { spawn } = await import("child_process");
1160
- const child = spawn("claude", claudeCmd.slice(1).map(arg => arg.replace(/^"|"$/g, '')), {
1161
- env: {
1162
- ...process.env,
1163
- CLAUDE_INSTANCE_ID: instanceId,
1164
- CLAUDE_FLOW_MODE: ctx.flags.mode as string || "full",
1165
- CLAUDE_FLOW_COVERAGE: (ctx.flags.coverage || 80).toString(),
1166
- CLAUDE_FLOW_COMMIT: ctx.flags.commit as string || "phase",
1167
- // Add Claude-Flow specific features
1168
- CLAUDE_FLOW_MEMORY_ENABLED: 'true',
1169
- CLAUDE_FLOW_MEMORY_NAMESPACE: 'default',
1170
- CLAUDE_FLOW_COORDINATION_ENABLED: ctx.flags.parallel ? 'true' : 'false',
1171
- CLAUDE_FLOW_FEATURES: 'memory,coordination,swarm',
1195
+ const { spawn } = await import('child_process');
1196
+ const child = spawn(
1197
+ 'claude',
1198
+ claudeCmd.slice(1).map((arg) => arg.replace(/^"|"$/g, '')),
1199
+ {
1200
+ env: {
1201
+ ...process.env,
1202
+ CLAUDE_INSTANCE_ID: instanceId,
1203
+ CLAUDE_FLOW_MODE: (ctx.flags.mode as string) || 'full',
1204
+ CLAUDE_FLOW_COVERAGE: (ctx.flags.coverage || 80).toString(),
1205
+ CLAUDE_FLOW_COMMIT: (ctx.flags.commit as string) || 'phase',
1206
+ // Add Claude-Flow specific features
1207
+ CLAUDE_FLOW_MEMORY_ENABLED: 'true',
1208
+ CLAUDE_FLOW_MEMORY_NAMESPACE: 'default',
1209
+ CLAUDE_FLOW_COORDINATION_ENABLED: ctx.flags.parallel ? 'true' : 'false',
1210
+ CLAUDE_FLOW_FEATURES: 'memory,coordination,swarm',
1211
+ },
1212
+ stdio: 'inherit',
1172
1213
  },
1173
- stdio: "inherit",
1174
- });
1175
-
1214
+ );
1215
+
1176
1216
  const status = await new Promise((resolve) => {
1177
- child.on("close", (code) => {
1217
+ child.on('close', (code) => {
1178
1218
  resolve({ success: code === 0, code });
1179
1219
  });
1180
1220
  });
1181
-
1221
+
1182
1222
  if ((status as any).success) {
1183
1223
  success(`Claude instance ${instanceId} completed successfully`);
1184
1224
  } else {
1185
1225
  error(`Claude instance ${instanceId} exited with code ${(status as any).code}`);
1186
1226
  }
1187
-
1188
1227
  } catch (err) {
1189
1228
  error(`Failed to spawn Claude: ${(err as Error).message}`);
1190
1229
  }
1191
1230
  break;
1192
1231
  }
1193
-
1194
- case "batch": {
1232
+
1233
+ case 'batch': {
1195
1234
  const workflowFile = ctx.args[1];
1196
1235
  if (!workflowFile) {
1197
- error("Usage: claude batch <workflow-file>");
1236
+ error('Usage: claude batch <workflow-file>');
1198
1237
  break;
1199
1238
  }
1200
-
1239
+
1201
1240
  try {
1202
- const { readFile } = await import("fs/promises");
1203
- const content = await readFile(workflowFile, "utf-8");
1241
+ const { readFile } = await import('fs/promises');
1242
+ const content = await readFile(workflowFile, 'utf-8');
1204
1243
  const workflow = JSON.parse(content);
1205
-
1206
- success(`Loading workflow: ${workflow.name || "Unnamed"}`);
1244
+
1245
+ success(`Loading workflow: ${workflow.name || 'Unnamed'}`);
1207
1246
  console.log(`📋 Tasks: ${workflow.tasks?.length || 0}`);
1208
-
1247
+
1209
1248
  if (!workflow.tasks || workflow.tasks.length === 0) {
1210
- warning("No tasks found in workflow");
1249
+ warning('No tasks found in workflow');
1211
1250
  return;
1212
1251
  }
1213
-
1252
+
1214
1253
  const promises = [];
1215
-
1254
+
1216
1255
  for (const task of workflow.tasks) {
1217
- const claudeCmd = ["claude", `"${task.description || task.name}"`];
1218
-
1256
+ const claudeCmd = ['claude', `"${task.description || task.name}"`];
1257
+
1219
1258
  // Add tools
1220
1259
  if (task.tools) {
1221
- const toolsList = Array.isArray(task.tools) ? task.tools.join(",") : task.tools;
1222
- claudeCmd.push("--allowedTools", toolsList);
1260
+ const toolsList = Array.isArray(task.tools) ? task.tools.join(',') : task.tools;
1261
+ claudeCmd.push('--allowedTools', toolsList);
1223
1262
  }
1224
-
1263
+
1225
1264
  // Add flags
1226
1265
  if (task.skipPermissions || task.dangerouslySkipPermissions) {
1227
- claudeCmd.push("--dangerously-skip-permissions");
1266
+ claudeCmd.push('--dangerously-skip-permissions');
1228
1267
  }
1229
-
1268
+
1230
1269
  if (task.config) {
1231
- claudeCmd.push("--mcp-config", task.config);
1270
+ claudeCmd.push('--mcp-config', task.config);
1232
1271
  }
1233
-
1234
- const taskId = task.id || `task-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
1235
-
1236
- if (ctx.flags.dryRun || ctx.flags["dry-run"]) {
1237
- console.log(`\n${yellow("DRY RUN")} - Task: ${task.name || taskId}`);
1238
- console.log(`Command: ${claudeCmd.join(" ")}`);
1272
+
1273
+ const taskId =
1274
+ task.id || `task-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
1275
+
1276
+ if (ctx.flags.dryRun || ctx.flags['dry-run']) {
1277
+ console.log(`\n${yellow('DRY RUN')} - Task: ${task.name || taskId}`);
1278
+ console.log(`Command: ${claudeCmd.join(' ')}`);
1239
1279
  continue;
1240
1280
  }
1241
-
1281
+
1242
1282
  console.log(`\n🚀 Spawning Claude for task: ${task.name || taskId}`);
1243
-
1244
- const { spawn } = await import("child_process");
1245
- const child = spawn("claude", claudeCmd.slice(1).map(arg => arg.replace(/^"|"$/g, '')), {
1246
- env: {
1247
- ...process.env,
1248
- CLAUDE_TASK_ID: taskId,
1249
- CLAUDE_TASK_TYPE: task.type || "general",
1283
+
1284
+ const { spawn } = await import('child_process');
1285
+ const child = spawn(
1286
+ 'claude',
1287
+ claudeCmd.slice(1).map((arg) => arg.replace(/^"|"$/g, '')),
1288
+ {
1289
+ env: {
1290
+ ...process.env,
1291
+ CLAUDE_TASK_ID: taskId,
1292
+ CLAUDE_TASK_TYPE: task.type || 'general',
1293
+ },
1294
+ stdio: 'inherit',
1250
1295
  },
1251
- stdio: "inherit",
1252
- });
1253
-
1296
+ );
1297
+
1254
1298
  if (workflow.parallel) {
1255
- promises.push(new Promise((resolve) => {
1256
- child.on("close", (code) => {
1257
- resolve({ success: code === 0, code });
1258
- });
1259
- }));
1299
+ promises.push(
1300
+ new Promise((resolve) => {
1301
+ child.on('close', (code) => {
1302
+ resolve({ success: code === 0, code });
1303
+ });
1304
+ }),
1305
+ );
1260
1306
  } else {
1261
1307
  // Wait for completion if sequential
1262
1308
  const status = await new Promise((resolve) => {
1263
- child.on("close", (code) => {
1309
+ child.on('close', (code) => {
1264
1310
  resolve({ success: code === 0, code });
1265
1311
  });
1266
1312
  });
@@ -1269,30 +1315,31 @@ Now, please proceed with the task: ${task}`;
1269
1315
  }
1270
1316
  }
1271
1317
  }
1272
-
1318
+
1273
1319
  if (workflow.parallel && promises.length > 0) {
1274
- success("All Claude instances spawned in parallel mode");
1320
+ success('All Claude instances spawned in parallel mode');
1275
1321
  const results = await Promise.all(promises);
1276
1322
  const failed = results.filter((s: any) => !s.success).length;
1277
1323
  if (failed > 0) {
1278
1324
  warning(`${failed} tasks failed`);
1279
1325
  } else {
1280
- success("All tasks completed successfully");
1326
+ success('All tasks completed successfully');
1281
1327
  }
1282
1328
  }
1283
-
1284
1329
  } catch (err) {
1285
1330
  error(`Failed to process workflow: ${(err as Error).message}`);
1286
1331
  }
1287
1332
  break;
1288
1333
  }
1289
-
1334
+
1290
1335
  default: {
1291
- console.log("Available subcommands: spawn, batch");
1292
- console.log("\nExamples:");
1293
- console.log(" claude-flow claude spawn \"implement user authentication\" --research --parallel");
1294
- console.log(" claude-flow claude spawn \"fix bug in payment system\" --no-permissions");
1295
- console.log(" claude-flow claude batch workflow.json --dry-run");
1336
+ console.log('Available subcommands: spawn, batch');
1337
+ console.log('\nExamples:');
1338
+ console.log(
1339
+ ' claude-flow claude spawn "implement user authentication" --research --parallel',
1340
+ );
1341
+ console.log(' claude-flow claude spawn "fix bug in payment system" --no-permissions');
1342
+ console.log(' claude-flow claude batch workflow.json --dry-run');
1296
1343
  break;
1297
1344
  }
1298
1345
  }
@@ -1311,95 +1358,105 @@ Now, please proceed with the task: ${task}`;
1311
1358
  export: ctx.flags.export,
1312
1359
  threshold: ctx.flags.threshold || 80,
1313
1360
  logLevel: ctx.flags.logLevel || ctx.flags['log-level'] || 'info',
1314
- noGraphs: ctx.flags.noGraphs || ctx.flags['no-graphs']
1361
+ noGraphs: ctx.flags.noGraphs || ctx.flags['no-graphs'],
1315
1362
  };
1316
-
1363
+
1317
1364
  console.log(chalk.cyan('📊 Enhanced Monitor Command'));
1318
1365
  console.log('For full enhanced functionality, use: claude-flow monitor [options]');
1319
- console.log('Available options: --interval, --compact, --focus, --alerts, --export, --threshold, --log-level, --no-graphs');
1320
-
1366
+ console.log(
1367
+ 'Available options: --interval, --compact, --focus, --alerts, --export, --threshold, --log-level, --no-graphs',
1368
+ );
1369
+
1321
1370
  // Fallback to basic monitoring
1322
1371
  try {
1323
1372
  const persist = await getPersistence();
1324
1373
  const stats = await persist.getStats();
1325
-
1326
- const { access } = await import("fs/promises");
1327
- const isRunning = await access("orchestrator.log").then(() => true).catch(() => false);
1328
-
1374
+
1375
+ const { access } = await import('fs/promises');
1376
+ const isRunning = await access('orchestrator.log')
1377
+ .then(() => true)
1378
+ .catch(() => false);
1379
+
1329
1380
  if (!isRunning) {
1330
1381
  warning("Orchestrator is not running. Start it first with 'claude-flow start'");
1331
1382
  return;
1332
1383
  }
1333
-
1334
- info("Starting enhanced monitoring dashboard...");
1335
- console.log("Press Ctrl+C to exit");
1336
-
1384
+
1385
+ info('Starting enhanced monitoring dashboard...');
1386
+ console.log('Press Ctrl+C to exit');
1387
+
1337
1388
  const interval = Number(options.interval) * 1000;
1338
1389
  let running = true;
1339
-
1390
+
1340
1391
  const cleanup = () => {
1341
1392
  running = false;
1342
- console.log("\nMonitor stopped");
1393
+ console.log('\nMonitor stopped');
1343
1394
  process.exit(0);
1344
1395
  };
1345
-
1346
- process.on("SIGINT", cleanup);
1347
- process.on("SIGTERM", cleanup);
1348
-
1396
+
1397
+ process.on('SIGINT', cleanup);
1398
+ process.on('SIGTERM', cleanup);
1399
+
1349
1400
  process.stdout.write('\x1b[?25l');
1350
-
1401
+
1351
1402
  let cycles = 0;
1352
1403
  while (running) {
1353
1404
  try {
1354
1405
  console.clear();
1355
-
1406
+
1356
1407
  const currentStats = await persist.getStats();
1357
1408
  const agents = await persist.getActiveAgents();
1358
1409
  const tasks = await persist.getActiveTasks();
1359
-
1410
+
1360
1411
  // Enhanced header
1361
- success("Claude-Flow Enhanced Live Monitor");
1362
- console.log("".repeat(60));
1363
- console.log(`Update #${++cycles} • ${new Date().toLocaleTimeString()} • Interval: ${options.interval}s`);
1364
-
1412
+ success('Claude-Flow Enhanced Live Monitor');
1413
+ console.log(''.repeat(60));
1414
+ console.log(
1415
+ `Update #${++cycles} • ${new Date().toLocaleTimeString()} • Interval: ${options.interval}s`,
1416
+ );
1417
+
1365
1418
  if (options.focus) {
1366
1419
  console.log(`🎯 Focus: ${options.focus}`);
1367
1420
  }
1368
-
1421
+
1369
1422
  if (options.alerts) {
1370
1423
  console.log(`🚨 Alerts: Enabled (threshold: ${options.threshold}%)`);
1371
1424
  }
1372
-
1425
+
1373
1426
  // System overview with thresholds
1374
- console.log("\n📊 System Overview:");
1427
+ console.log('\n📊 System Overview:');
1375
1428
  const cpuUsage = Math.random() * 100;
1376
1429
  const memoryUsage = Math.random() * 1000;
1377
1430
  const threshold = Number(options.threshold || 80);
1378
1431
  const cpuColor = cpuUsage > threshold ? '🔴' : cpuUsage > threshold * 0.8 ? '🟡' : '🟢';
1379
1432
  const memoryColor = memoryUsage > 800 ? '🔴' : memoryUsage > 600 ? '🟡' : '🟢';
1380
-
1433
+
1381
1434
  console.log(` ${cpuColor} CPU: ${cpuUsage.toFixed(1)}%`);
1382
1435
  console.log(` ${memoryColor} Memory: ${memoryUsage.toFixed(0)}MB`);
1383
- console.log(` 🤖 Agents: ${currentStats.activeAgents} active (${currentStats.totalAgents} total)`);
1384
- console.log(` 📋 Tasks: ${currentStats.pendingTasks} pending (${currentStats.totalTasks} total)`);
1436
+ console.log(
1437
+ ` 🤖 Agents: ${currentStats.activeAgents} active (${currentStats.totalAgents} total)`,
1438
+ );
1439
+ console.log(
1440
+ ` 📋 Tasks: ${currentStats.pendingTasks} pending (${currentStats.totalTasks} total)`,
1441
+ );
1385
1442
  console.log(` ✅ Completed: ${currentStats.completedTasks} tasks`);
1386
-
1443
+
1387
1444
  // Performance metrics
1388
1445
  if (!options.compact) {
1389
- console.log("\n📈 Performance Metrics:");
1446
+ console.log('\n📈 Performance Metrics:');
1390
1447
  console.log(` Response Time: ${(800 + Math.random() * 400).toFixed(0)}ms`);
1391
1448
  console.log(` Throughput: ${(40 + Math.random() * 20).toFixed(1)} req/min`);
1392
1449
  console.log(` Error Rate: ${(Math.random() * 2).toFixed(2)}%`);
1393
-
1450
+
1394
1451
  // Simple ASCII graph simulation
1395
1452
  if (!options.noGraphs) {
1396
- console.log("\n📊 CPU Trend (last 10 updates):");
1397
- const trend = Array.from({length: 10}, () => Math.floor(Math.random() * 8));
1453
+ console.log('\n📊 CPU Trend (last 10 updates):');
1454
+ const trend = Array.from({ length: 10 }, () => Math.floor(Math.random() * 8));
1398
1455
  const chars = ['▁', '▂', '▃', '▄', '▅', '▆', '▇', '█'];
1399
- console.log(` ${trend.map(i => chars[i]).join('')}`);
1456
+ console.log(` ${trend.map((i) => chars[i]).join('')}`);
1400
1457
  }
1401
1458
  }
1402
-
1459
+
1403
1460
  // Active components (if focused)
1404
1461
  if (options.focus && !options.compact) {
1405
1462
  console.log(`\n🎯 ${options.focus} Component Details:`);
@@ -1408,214 +1465,240 @@ Now, please proceed with the task: ${task}`;
1408
1465
  console.log(` Uptime: ${Math.floor(Math.random() * 3600)}s`);
1409
1466
  console.log(` Connections: ${Math.floor(Math.random() * 10) + 1}`);
1410
1467
  }
1411
-
1468
+
1412
1469
  // Alerts simulation
1413
1470
  if (options.alerts && Math.random() > 0.8) {
1414
- console.log("\n🚨 Active Alerts:");
1471
+ console.log('\n🚨 Active Alerts:');
1415
1472
  console.log(` ⚠️ High CPU usage detected`);
1416
1473
  console.log(` 📊 Memory usage approaching threshold`);
1417
1474
  }
1418
-
1475
+
1419
1476
  // Export status
1420
1477
  if (options.export) {
1421
- console.log("\n💾 Export Status:");
1478
+ console.log('\n💾 Export Status:');
1422
1479
  console.log(` Exporting to: ${options.export}`);
1423
1480
  console.log(` Data points: ${cycles}`);
1424
1481
  }
1425
-
1482
+
1426
1483
  // Footer
1427
- console.log("\n" + "".repeat(60));
1428
- console.log(`Log Level: ${options.logLevel} • Threshold: ${options.threshold}% • Press Ctrl+C to exit`);
1429
-
1430
- await new Promise(resolve => setTimeout(resolve, interval));
1484
+ console.log('\n' + ''.repeat(60));
1485
+ console.log(
1486
+ `Log Level: ${options.logLevel} • Threshold: ${options.threshold}% • Press Ctrl+C to exit`,
1487
+ );
1488
+
1489
+ await new Promise((resolve) => setTimeout(resolve, interval));
1431
1490
  } catch (err) {
1432
1491
  error(`Monitor error: ${(err as Error).message}`);
1433
- await new Promise(resolve => setTimeout(resolve, interval));
1492
+ await new Promise((resolve) => setTimeout(resolve, interval));
1434
1493
  }
1435
1494
  }
1436
-
1495
+
1437
1496
  process.stdout.write('\x1b[?25h');
1438
-
1439
1497
  } catch (err) {
1440
1498
  error(`Failed to start enhanced monitor: ${(err as Error).message}`);
1441
1499
  }
1442
1500
  };
1443
-
1501
+
1444
1502
  cli.command({
1445
- name: "monitor",
1446
- description: "Enhanced live monitoring dashboard with comprehensive metrics",
1503
+ name: 'monitor',
1504
+ description: 'Enhanced live monitoring dashboard with comprehensive metrics',
1447
1505
  options: [
1448
- { name: "interval", short: "i", description: "Update interval in seconds", type: "number", default: 2 },
1449
- { name: "compact", short: "c", description: "Compact view mode", type: "boolean" },
1450
- { name: "focus", short: "f", description: "Focus on specific component", type: "string" },
1451
- { name: "alerts", description: "Enable alert notifications", type: "boolean" },
1452
- { name: "export", description: "Export monitoring data to file", type: "string" },
1453
- { name: "threshold", description: "Alert threshold percentage", type: "number", default: 80 },
1454
- { name: "log-level", description: "Log level filter (error, warn, info, debug)", type: "string", default: "info" },
1455
- { name: "no-graphs", description: "Disable ASCII graphs", type: "boolean" }
1506
+ {
1507
+ name: 'interval',
1508
+ short: 'i',
1509
+ description: 'Update interval in seconds',
1510
+ type: 'number',
1511
+ default: 2,
1512
+ },
1513
+ { name: 'compact', short: 'c', description: 'Compact view mode', type: 'boolean' },
1514
+ { name: 'focus', short: 'f', description: 'Focus on specific component', type: 'string' },
1515
+ { name: 'alerts', description: 'Enable alert notifications', type: 'boolean' },
1516
+ { name: 'export', description: 'Export monitoring data to file', type: 'string' },
1517
+ {
1518
+ name: 'threshold',
1519
+ description: 'Alert threshold percentage',
1520
+ type: 'number',
1521
+ default: 80,
1522
+ },
1523
+ {
1524
+ name: 'log-level',
1525
+ description: 'Log level filter (error, warn, info, debug)',
1526
+ type: 'string',
1527
+ default: 'info',
1528
+ },
1529
+ { name: 'no-graphs', description: 'Disable ASCII graphs', type: 'boolean' },
1456
1530
  ],
1457
- action: enhancedMonitorAction
1531
+ action: enhancedMonitorAction,
1458
1532
  });
1459
1533
  } catch (err) {
1460
1534
  warning('Enhanced monitor command not available, using basic version');
1461
-
1535
+
1462
1536
  // Fallback basic monitor command (original implementation)
1463
1537
  cli.command({
1464
- name: "monitor",
1465
- description: "Live monitoring dashboard",
1538
+ name: 'monitor',
1539
+ description: 'Live monitoring dashboard',
1466
1540
  options: [
1467
- { name: "interval", short: "i", description: "Update interval in seconds", type: "number", default: 2 },
1468
- { name: "compact", short: "c", description: "Compact view mode", type: "boolean" },
1469
- { name: "focus", short: "f", description: "Focus on specific component", type: "string" }
1541
+ {
1542
+ name: 'interval',
1543
+ short: 'i',
1544
+ description: 'Update interval in seconds',
1545
+ type: 'number',
1546
+ default: 2,
1547
+ },
1548
+ { name: 'compact', short: 'c', description: 'Compact view mode', type: 'boolean' },
1549
+ { name: 'focus', short: 'f', description: 'Focus on specific component', type: 'string' },
1470
1550
  ],
1471
1551
  action: async (ctx: CommandContext) => {
1472
1552
  // Original basic monitor implementation
1473
1553
  try {
1474
1554
  const persist = await getPersistence();
1475
- const { access } = await import("fs/promises");
1476
- const isRunning = await access("orchestrator.log").then(() => true).catch(() => false);
1477
-
1555
+ const { access } = await import('fs/promises');
1556
+ const isRunning = await access('orchestrator.log')
1557
+ .then(() => true)
1558
+ .catch(() => false);
1559
+
1478
1560
  if (!isRunning) {
1479
1561
  warning("Orchestrator is not running. Start it first with 'claude-flow start'");
1480
1562
  return;
1481
1563
  }
1482
-
1483
- info("Starting basic monitoring dashboard...");
1484
- console.log("Press Ctrl+C to exit");
1485
-
1486
- const interval = (ctx.flags.interval as number || 2) * 1000;
1564
+
1565
+ info('Starting basic monitoring dashboard...');
1566
+ console.log('Press Ctrl+C to exit');
1567
+
1568
+ const interval = ((ctx.flags.interval as number) || 2) * 1000;
1487
1569
  let running = true;
1488
-
1570
+
1489
1571
  const cleanup = () => {
1490
1572
  running = false;
1491
- console.log("\nMonitor stopped");
1573
+ console.log('\nMonitor stopped');
1492
1574
  process.exit(0);
1493
1575
  };
1494
-
1495
- process.on("SIGINT", cleanup);
1496
-
1576
+
1577
+ process.on('SIGINT', cleanup);
1578
+
1497
1579
  while (running) {
1498
1580
  console.clear();
1499
1581
  const stats = await persist.getStats();
1500
- success("Claude-Flow Live Monitor");
1582
+ success('Claude-Flow Live Monitor');
1501
1583
  console.log(`🟢 Status: Running`);
1502
1584
  console.log(`🤖 Agents: ${stats.activeAgents} active`);
1503
1585
  console.log(`📋 Tasks: ${stats.pendingTasks} pending`);
1504
1586
  console.log(`Last updated: ${new Date().toLocaleTimeString()}`);
1505
- await new Promise(resolve => setTimeout(resolve, interval));
1587
+ await new Promise((resolve) => setTimeout(resolve, interval));
1506
1588
  }
1507
1589
  } catch (err) {
1508
1590
  error(`Failed to start monitor: ${(err as Error).message}`);
1509
1591
  }
1510
- }
1592
+ },
1511
1593
  });
1512
1594
  }
1513
1595
 
1514
1596
  // Swarm command
1515
1597
  cli.command({
1516
- name: "swarm",
1517
- description: "Create self-orchestrating Claude agent swarms",
1598
+ name: 'swarm',
1599
+ description: 'Create self-orchestrating Claude agent swarms',
1518
1600
  options: [
1519
1601
  {
1520
- name: "strategy",
1521
- short: "s",
1522
- description: "Orchestration strategy (auto, research, development, analysis, testing, optimization, maintenance)",
1523
- type: "string",
1524
- default: "auto",
1602
+ name: 'strategy',
1603
+ short: 's',
1604
+ description:
1605
+ 'Orchestration strategy (auto, research, development, analysis, testing, optimization, maintenance)',
1606
+ type: 'string',
1607
+ default: 'auto',
1525
1608
  },
1526
1609
  {
1527
- name: "mode",
1528
- short: "m",
1529
- description: "Coordination mode (centralized, distributed, hierarchical, mesh, hybrid)",
1530
- type: "string",
1531
- default: "centralized",
1610
+ name: 'mode',
1611
+ short: 'm',
1612
+ description: 'Coordination mode (centralized, distributed, hierarchical, mesh, hybrid)',
1613
+ type: 'string',
1614
+ default: 'centralized',
1532
1615
  },
1533
1616
  {
1534
- name: "max-agents",
1535
- description: "Maximum number of agents to spawn",
1536
- type: "number",
1617
+ name: 'max-agents',
1618
+ description: 'Maximum number of agents to spawn',
1619
+ type: 'number',
1537
1620
  default: 5,
1538
1621
  },
1539
1622
  {
1540
- name: "max-depth",
1541
- description: "Maximum delegation depth",
1542
- type: "number",
1623
+ name: 'max-depth',
1624
+ description: 'Maximum delegation depth',
1625
+ type: 'number',
1543
1626
  default: 3,
1544
1627
  },
1545
1628
  {
1546
- name: "research",
1547
- description: "Enable research capabilities for all agents",
1548
- type: "boolean",
1629
+ name: 'research',
1630
+ description: 'Enable research capabilities for all agents',
1631
+ type: 'boolean',
1549
1632
  },
1550
1633
  {
1551
- name: "parallel",
1552
- description: "Enable parallel execution",
1553
- type: "boolean",
1634
+ name: 'parallel',
1635
+ description: 'Enable parallel execution',
1636
+ type: 'boolean',
1554
1637
  },
1555
1638
  {
1556
- name: "memory-namespace",
1557
- description: "Shared memory namespace",
1558
- type: "string",
1559
- default: "swarm",
1639
+ name: 'memory-namespace',
1640
+ description: 'Shared memory namespace',
1641
+ type: 'string',
1642
+ default: 'swarm',
1560
1643
  },
1561
1644
  {
1562
- name: "timeout",
1563
- description: "Swarm timeout in minutes",
1564
- type: "number",
1645
+ name: 'timeout',
1646
+ description: 'Swarm timeout in minutes',
1647
+ type: 'number',
1565
1648
  default: 60,
1566
1649
  },
1567
1650
  {
1568
- name: "review",
1569
- description: "Enable peer review between agents",
1570
- type: "boolean",
1651
+ name: 'review',
1652
+ description: 'Enable peer review between agents',
1653
+ type: 'boolean',
1571
1654
  },
1572
1655
  {
1573
- name: "coordinator",
1574
- description: "Spawn dedicated coordinator agent",
1575
- type: "boolean",
1656
+ name: 'coordinator',
1657
+ description: 'Spawn dedicated coordinator agent',
1658
+ type: 'boolean',
1576
1659
  },
1577
1660
  {
1578
- name: "config",
1579
- short: "c",
1580
- description: "MCP config file",
1581
- type: "string",
1661
+ name: 'config',
1662
+ short: 'c',
1663
+ description: 'MCP config file',
1664
+ type: 'string',
1582
1665
  },
1583
1666
  {
1584
- name: "verbose",
1585
- short: "v",
1586
- description: "Enable verbose output",
1587
- type: "boolean",
1667
+ name: 'verbose',
1668
+ short: 'v',
1669
+ description: 'Enable verbose output',
1670
+ type: 'boolean',
1588
1671
  },
1589
1672
  {
1590
- name: "dry-run",
1591
- short: "d",
1592
- description: "Preview swarm configuration",
1593
- type: "boolean",
1673
+ name: 'dry-run',
1674
+ short: 'd',
1675
+ description: 'Preview swarm configuration',
1676
+ type: 'boolean',
1594
1677
  },
1595
1678
  {
1596
- name: "vscode",
1597
- description: "Use VS Code terminal integration",
1598
- type: "boolean",
1679
+ name: 'vscode',
1680
+ description: 'Use VS Code terminal integration',
1681
+ type: 'boolean',
1599
1682
  },
1600
1683
  {
1601
- name: "monitor",
1602
- description: "Enable real-time monitoring",
1603
- type: "boolean",
1684
+ name: 'monitor',
1685
+ description: 'Enable real-time monitoring',
1686
+ type: 'boolean',
1604
1687
  },
1605
1688
  {
1606
- name: "ui",
1607
- description: "Use blessed terminal UI (avoids TTY issues)",
1608
- type: "boolean",
1689
+ name: 'ui',
1690
+ description: 'Use blessed terminal UI (avoids TTY issues)',
1691
+ type: 'boolean',
1609
1692
  },
1610
1693
  {
1611
- name: "claude",
1612
- description: "Launch Claude Code with swarm coordination prompt",
1613
- type: "boolean",
1694
+ name: 'claude',
1695
+ description: 'Launch Claude Code with swarm coordination prompt',
1696
+ type: 'boolean',
1614
1697
  },
1615
1698
  {
1616
- name: "executor",
1617
- description: "Use built-in executor instead of Claude Code",
1618
- type: "boolean",
1699
+ name: 'executor',
1700
+ description: 'Use built-in executor instead of Claude Code',
1701
+ type: 'boolean',
1619
1702
  },
1620
1703
  ],
1621
1704
  action: swarmAction,
@@ -1623,79 +1706,79 @@ Now, please proceed with the task: ${task}`;
1623
1706
 
1624
1707
  // Enhanced SPARC command
1625
1708
  cli.command({
1626
- name: "sparc",
1627
- description: "Enhanced SPARC-based TDD development with specialized modes and orchestration",
1709
+ name: 'sparc',
1710
+ description: 'Enhanced SPARC-based TDD development with specialized modes and orchestration',
1628
1711
  options: [
1629
1712
  {
1630
- name: "namespace",
1631
- short: "n",
1632
- description: "Memory namespace for this session",
1633
- type: "string",
1634
- default: "sparc",
1713
+ name: 'namespace',
1714
+ short: 'n',
1715
+ description: 'Memory namespace for this session',
1716
+ type: 'string',
1717
+ default: 'sparc',
1635
1718
  },
1636
1719
  {
1637
- name: "no-permissions",
1638
- description: "Skip permission prompts",
1639
- type: "boolean",
1720
+ name: 'no-permissions',
1721
+ description: 'Skip permission prompts',
1722
+ type: 'boolean',
1640
1723
  },
1641
1724
  {
1642
- name: "config",
1643
- short: "c",
1644
- description: "MCP configuration file",
1645
- type: "string",
1725
+ name: 'config',
1726
+ short: 'c',
1727
+ description: 'MCP configuration file',
1728
+ type: 'string',
1646
1729
  },
1647
1730
  {
1648
- name: "verbose",
1649
- short: "v",
1650
- description: "Enable verbose output",
1651
- type: "boolean",
1731
+ name: 'verbose',
1732
+ short: 'v',
1733
+ description: 'Enable verbose output',
1734
+ type: 'boolean',
1652
1735
  },
1653
1736
  {
1654
- name: "dry-run",
1655
- short: "d",
1656
- description: "Preview what would be executed",
1657
- type: "boolean",
1737
+ name: 'dry-run',
1738
+ short: 'd',
1739
+ description: 'Preview what would be executed',
1740
+ type: 'boolean',
1658
1741
  },
1659
1742
  {
1660
- name: "sequential",
1661
- description: "Wait between workflow steps",
1662
- type: "boolean",
1743
+ name: 'sequential',
1744
+ description: 'Wait between workflow steps',
1745
+ type: 'boolean',
1663
1746
  default: true,
1664
1747
  },
1665
1748
  {
1666
- name: "batch",
1667
- description: "Enable batch operations for efficiency",
1668
- type: "boolean",
1749
+ name: 'batch',
1750
+ description: 'Enable batch operations for efficiency',
1751
+ type: 'boolean',
1669
1752
  },
1670
1753
  {
1671
- name: "parallel",
1672
- description: "Enable parallel agent execution",
1673
- type: "boolean",
1754
+ name: 'parallel',
1755
+ description: 'Enable parallel agent execution',
1756
+ type: 'boolean',
1674
1757
  },
1675
1758
  {
1676
- name: "orchestration",
1677
- description: "Enable orchestration features",
1678
- type: "boolean",
1759
+ name: 'orchestration',
1760
+ description: 'Enable orchestration features',
1761
+ type: 'boolean',
1679
1762
  default: true,
1680
- }
1763
+ },
1681
1764
  ],
1682
1765
  action: async (ctx: CommandContext) => {
1683
1766
  try {
1684
1767
  console.log(chalk.cyan('🚀 Enhanced SPARC Development Mode'));
1685
1768
  console.log('Features: TDD + Orchestration + Batch Operations + Memory Management');
1686
-
1769
+
1687
1770
  if (ctx.flags.batch) {
1688
1771
  console.log('✨ Batch operations enabled for efficient file handling');
1689
1772
  }
1690
-
1773
+
1691
1774
  if (ctx.flags.parallel) {
1692
1775
  console.log('⚡ Parallel agent execution enabled');
1693
1776
  }
1694
-
1777
+
1695
1778
  if (ctx.flags.orchestration) {
1696
1779
  console.log('🎼 Orchestration features enabled');
1697
1780
  }
1698
-
1781
+
1699
1782
  // Call the original SPARC action with enhanced features
1700
1783
  await sparcAction(ctx);
1701
1784
  } catch (err) {
@@ -1710,77 +1793,77 @@ Now, please proceed with the task: ${task}`;
1710
1793
 
1711
1794
  // Swarm UI command (convenience wrapper)
1712
1795
  cli.command({
1713
- name: "swarm-ui",
1714
- description: "Create self-orchestrating Claude agent swarms with blessed UI",
1796
+ name: 'swarm-ui',
1797
+ description: 'Create self-orchestrating Claude agent swarms with blessed UI',
1715
1798
  options: [
1716
1799
  {
1717
- name: "strategy",
1718
- short: "s",
1719
- description: "Orchestration strategy (auto, research, development, analysis)",
1720
- type: "string",
1721
- default: "auto",
1800
+ name: 'strategy',
1801
+ short: 's',
1802
+ description: 'Orchestration strategy (auto, research, development, analysis)',
1803
+ type: 'string',
1804
+ default: 'auto',
1722
1805
  },
1723
1806
  {
1724
- name: "max-agents",
1725
- description: "Maximum number of agents to spawn",
1726
- type: "number",
1807
+ name: 'max-agents',
1808
+ description: 'Maximum number of agents to spawn',
1809
+ type: 'number',
1727
1810
  default: 5,
1728
1811
  },
1729
1812
  {
1730
- name: "max-depth",
1731
- description: "Maximum delegation depth",
1732
- type: "number",
1813
+ name: 'max-depth',
1814
+ description: 'Maximum delegation depth',
1815
+ type: 'number',
1733
1816
  default: 3,
1734
1817
  },
1735
1818
  {
1736
- name: "research",
1737
- description: "Enable research capabilities for all agents",
1738
- type: "boolean",
1819
+ name: 'research',
1820
+ description: 'Enable research capabilities for all agents',
1821
+ type: 'boolean',
1739
1822
  },
1740
1823
  {
1741
- name: "parallel",
1742
- description: "Enable parallel execution",
1743
- type: "boolean",
1824
+ name: 'parallel',
1825
+ description: 'Enable parallel execution',
1826
+ type: 'boolean',
1744
1827
  },
1745
1828
  {
1746
- name: "memory-namespace",
1747
- description: "Shared memory namespace",
1748
- type: "string",
1749
- default: "swarm",
1829
+ name: 'memory-namespace',
1830
+ description: 'Shared memory namespace',
1831
+ type: 'string',
1832
+ default: 'swarm',
1750
1833
  },
1751
1834
  {
1752
- name: "timeout",
1753
- description: "Swarm timeout in minutes",
1754
- type: "number",
1835
+ name: 'timeout',
1836
+ description: 'Swarm timeout in minutes',
1837
+ type: 'number',
1755
1838
  default: 60,
1756
1839
  },
1757
1840
  {
1758
- name: "review",
1759
- description: "Enable peer review between agents",
1760
- type: "boolean",
1841
+ name: 'review',
1842
+ description: 'Enable peer review between agents',
1843
+ type: 'boolean',
1761
1844
  },
1762
1845
  {
1763
- name: "coordinator",
1764
- description: "Spawn dedicated coordinator agent",
1765
- type: "boolean",
1846
+ name: 'coordinator',
1847
+ description: 'Spawn dedicated coordinator agent',
1848
+ type: 'boolean',
1766
1849
  },
1767
1850
  {
1768
- name: "config",
1769
- short: "c",
1770
- description: "MCP config file",
1771
- type: "string",
1851
+ name: 'config',
1852
+ short: 'c',
1853
+ description: 'MCP config file',
1854
+ type: 'string',
1772
1855
  },
1773
1856
  {
1774
- name: "verbose",
1775
- short: "v",
1776
- description: "Enable verbose output",
1777
- type: "boolean",
1857
+ name: 'verbose',
1858
+ short: 'v',
1859
+ description: 'Enable verbose output',
1860
+ type: 'boolean',
1778
1861
  },
1779
1862
  {
1780
- name: "dry-run",
1781
- short: "d",
1782
- description: "Preview swarm configuration",
1783
- type: "boolean",
1863
+ name: 'dry-run',
1864
+ short: 'd',
1865
+ description: 'Preview swarm configuration',
1866
+ type: 'boolean',
1784
1867
  },
1785
1868
  ],
1786
1869
  action: async (ctx: CommandContext) => {
@@ -1817,18 +1900,20 @@ Now, please proceed with the task: ${task}`;
1817
1900
  console.log(' ✨ Integrity validation and repair');
1818
1901
  console.log(' ✨ Real-time session monitoring');
1819
1902
  console.log(' ✨ Backup and restore capabilities');
1820
-
1903
+
1821
1904
  const subcommand = ctx.args[0];
1822
1905
  if (subcommand) {
1823
1906
  console.log();
1824
- console.log(`For detailed help on '${subcommand}', use: claude-flow session ${subcommand} --help`);
1907
+ console.log(
1908
+ `For detailed help on '${subcommand}', use: claude-flow session ${subcommand} --help`,
1909
+ );
1825
1910
  }
1826
1911
  };
1827
-
1912
+
1828
1913
  cli.command({
1829
- name: "session",
1830
- description: "Enhanced session management with comprehensive lifecycle support",
1831
- action: enhancedSessionAction
1914
+ name: 'session',
1915
+ description: 'Enhanced session management with comprehensive lifecycle support',
1916
+ action: enhancedSessionAction,
1832
1917
  });
1833
1918
  } catch (err) {
1834
1919
  warning('Enhanced session command not available');
@@ -1840,7 +1925,7 @@ Now, please proceed with the task: ${task}`;
1840
1925
  console.log(chalk.cyan('🧠 Enhanced Claude-Flow Orchestration System'));
1841
1926
  console.log('Features: Service Management + Health Checks + Auto-Recovery + Process UI');
1842
1927
  console.log();
1843
-
1928
+
1844
1929
  const options = {
1845
1930
  daemon: ctx.flags.daemon || ctx.flags.d,
1846
1931
  port: ctx.flags.port || ctx.flags.p || 3000,
@@ -1851,49 +1936,51 @@ Now, please proceed with the task: ${task}`;
1851
1936
  config: ctx.flags.config,
1852
1937
  force: ctx.flags.force,
1853
1938
  healthCheck: ctx.flags.healthCheck || ctx.flags['health-check'],
1854
- timeout: ctx.flags.timeout || 60
1939
+ timeout: ctx.flags.timeout || 60,
1855
1940
  };
1856
-
1941
+
1857
1942
  if (options.ui) {
1858
1943
  console.log('🎮 Launching interactive process management UI...');
1859
1944
  }
1860
-
1945
+
1861
1946
  if (options.daemon) {
1862
1947
  console.log('🔧 Starting in daemon mode with enhanced service management...');
1863
1948
  }
1864
-
1949
+
1865
1950
  if (options.healthCheck) {
1866
1951
  console.log('🏥 Performing pre-flight health checks...');
1867
1952
  }
1868
-
1953
+
1869
1954
  console.log();
1870
1955
  console.log('For full enhanced functionality, use: claude-flow start [options]');
1871
- console.log('Available options: --daemon, --port, --mcp-transport, --ui, --verbose, --auto-start, --force, --health-check, --timeout');
1872
-
1956
+ console.log(
1957
+ 'Available options: --daemon, --port, --mcp-transport, --ui, --verbose, --auto-start, --force, --health-check, --timeout',
1958
+ );
1959
+
1873
1960
  // Fallback to basic start functionality
1874
1961
  try {
1875
1962
  const orch = await getOrchestrator();
1876
1963
  await orch.start();
1877
-
1878
- success("Enhanced orchestration system started!");
1879
- info("Components initialized with enhanced features:");
1880
- console.log(" ✓ Event Bus with advanced routing");
1881
- console.log(" ✓ Orchestrator Engine with service management");
1882
- console.log(" ✓ Memory Manager with integrity checking");
1883
- console.log(" ✓ Terminal Pool with session recovery");
1884
- console.log(" ✓ MCP Server with enhanced transport");
1885
- console.log(" ✓ Coordination Manager with load balancing");
1886
-
1964
+
1965
+ success('Enhanced orchestration system started!');
1966
+ info('Components initialized with enhanced features:');
1967
+ console.log(' ✓ Event Bus with advanced routing');
1968
+ console.log(' ✓ Orchestrator Engine with service management');
1969
+ console.log(' ✓ Memory Manager with integrity checking');
1970
+ console.log(' ✓ Terminal Pool with session recovery');
1971
+ console.log(' ✓ MCP Server with enhanced transport');
1972
+ console.log(' ✓ Coordination Manager with load balancing');
1973
+
1887
1974
  if (!options.daemon) {
1888
- info("Press Ctrl+C to stop the enhanced system");
1975
+ info('Press Ctrl+C to stop the enhanced system');
1889
1976
  const controller = new AbortController();
1890
1977
  const shutdown = () => {
1891
- console.log("\nShutting down enhanced system...");
1978
+ console.log('\nShutting down enhanced system...');
1892
1979
  controller.abort();
1893
1980
  };
1894
- process.on("SIGINT", shutdown);
1895
- process.on("SIGTERM", shutdown);
1896
-
1981
+ process.on('SIGINT', shutdown);
1982
+ process.on('SIGTERM', shutdown);
1983
+
1897
1984
  await new Promise<void>((resolve) => {
1898
1985
  controller.signal.addEventListener('abort', () => resolve());
1899
1986
  });
@@ -1903,24 +1990,38 @@ Now, please proceed with the task: ${task}`;
1903
1990
  process.exit(1);
1904
1991
  }
1905
1992
  };
1906
-
1993
+
1907
1994
  // Override the existing start command with enhanced version
1908
1995
  cli.command({
1909
- name: "start",
1910
- description: "Start the enhanced orchestration system with comprehensive service management",
1996
+ name: 'start',
1997
+ description: 'Start the enhanced orchestration system with comprehensive service management',
1911
1998
  options: [
1912
- { name: "daemon", short: "d", description: "Run as daemon in background", type: "boolean" },
1913
- { name: "port", short: "p", description: "MCP server port", type: "number", default: 3000 },
1914
- { name: "mcp-transport", description: "MCP transport type (stdio, http)", type: "string", default: "stdio" },
1915
- { name: "ui", short: "u", description: "Launch interactive process management UI", type: "boolean" },
1916
- { name: "verbose", short: "v", description: "Enable verbose logging", type: "boolean" },
1917
- { name: "auto-start", description: "Automatically start all processes", type: "boolean" },
1918
- { name: "config", description: "Configuration file path", type: "string" },
1919
- { name: "force", description: "Force start even if already running", type: "boolean" },
1920
- { name: "health-check", description: "Perform health checks before starting", type: "boolean" },
1921
- { name: "timeout", description: "Startup timeout in seconds", type: "number", default: 60 }
1999
+ { name: 'daemon', short: 'd', description: 'Run as daemon in background', type: 'boolean' },
2000
+ { name: 'port', short: 'p', description: 'MCP server port', type: 'number', default: 3000 },
2001
+ {
2002
+ name: 'mcp-transport',
2003
+ description: 'MCP transport type (stdio, http)',
2004
+ type: 'string',
2005
+ default: 'stdio',
2006
+ },
2007
+ {
2008
+ name: 'ui',
2009
+ short: 'u',
2010
+ description: 'Launch interactive process management UI',
2011
+ type: 'boolean',
2012
+ },
2013
+ { name: 'verbose', short: 'v', description: 'Enable verbose logging', type: 'boolean' },
2014
+ { name: 'auto-start', description: 'Automatically start all processes', type: 'boolean' },
2015
+ { name: 'config', description: 'Configuration file path', type: 'string' },
2016
+ { name: 'force', description: 'Force start even if already running', type: 'boolean' },
2017
+ {
2018
+ name: 'health-check',
2019
+ description: 'Perform health checks before starting',
2020
+ type: 'boolean',
2021
+ },
2022
+ { name: 'timeout', description: 'Startup timeout in seconds', type: 'number', default: 60 },
1922
2023
  ],
1923
- action: enhancedStartAction
2024
+ action: enhancedStartAction,
1924
2025
  });
1925
2026
  } catch (err) {
1926
2027
  warning('Enhanced start command not available, using basic version');
@@ -1928,237 +2029,267 @@ Now, please proceed with the task: ${task}`;
1928
2029
 
1929
2030
  // Help command
1930
2031
  cli.command({
1931
- name: "help",
1932
- description: "Show help information",
2032
+ name: 'help',
2033
+ description: 'Show help information',
1933
2034
  action: (ctx: CommandContext) => {
1934
2035
  const command = ctx.args[0];
1935
-
1936
- if (command === "claude") {
1937
- console.log(bold(blue("Claude Instance Management")));
2036
+
2037
+ if (command === 'claude') {
2038
+ console.log(bold(blue('Claude Instance Management')));
1938
2039
  console.log();
1939
- console.log("Spawn and manage Claude Code instances with specific configurations.");
2040
+ console.log('Spawn and manage Claude Code instances with specific configurations.');
1940
2041
  console.log();
1941
- console.log(bold("Subcommands:"));
1942
- console.log(" spawn <task> Spawn Claude with specific configuration");
1943
- console.log(" batch <file> Execute multiple Claude instances from workflow");
2042
+ console.log(bold('Subcommands:'));
2043
+ console.log(' spawn <task> Spawn Claude with specific configuration');
2044
+ console.log(' batch <file> Execute multiple Claude instances from workflow');
1944
2045
  console.log();
1945
- console.log(bold("Spawn Options:"));
1946
- console.log(" -t, --tools <tools> Allowed tools (comma-separated)");
1947
- console.log(" --no-permissions Use --dangerously-skip-permissions flag");
1948
- console.log(" -c, --config <file> MCP config file path");
1949
- console.log(" -m, --mode <mode> Development mode (full/backend-only/frontend-only/api-only)");
1950
- console.log(" --parallel Enable parallel execution with BatchTool");
1951
- console.log(" --research Enable web research with WebFetchTool");
1952
- console.log(" --coverage <n> Test coverage target percentage (default: 80)");
1953
- console.log(" --commit <freq> Commit frequency (phase/feature/manual)");
1954
- console.log(" -v, --verbose Enable verbose output");
1955
- console.log(" -d, --dry-run Show what would be executed without running");
2046
+ console.log(bold('Spawn Options:'));
2047
+ console.log(' -t, --tools <tools> Allowed tools (comma-separated)');
2048
+ console.log(' --no-permissions Use --dangerously-skip-permissions flag');
2049
+ console.log(' -c, --config <file> MCP config file path');
2050
+ console.log(
2051
+ ' -m, --mode <mode> Development mode (full/backend-only/frontend-only/api-only)',
2052
+ );
2053
+ console.log(' --parallel Enable parallel execution with BatchTool');
2054
+ console.log(' --research Enable web research with WebFetchTool');
2055
+ console.log(' --coverage <n> Test coverage target percentage (default: 80)');
2056
+ console.log(' --commit <freq> Commit frequency (phase/feature/manual)');
2057
+ console.log(' -v, --verbose Enable verbose output');
2058
+ console.log(' -d, --dry-run Show what would be executed without running');
1956
2059
  console.log();
1957
- console.log(bold("Examples:"));
1958
- console.log(` ${blue("claude-flow claude spawn")} "implement user authentication" --research --parallel`);
1959
- console.log(` ${blue("claude-flow claude spawn")} "fix payment bug" --tools "View,Edit,Bash" --no-permissions`);
1960
- console.log(` ${blue("claude-flow claude batch")} workflow.json --dry-run`);
2060
+ console.log(bold('Examples:'));
2061
+ console.log(
2062
+ ` ${blue('claude-flow claude spawn')} "implement user authentication" --research --parallel`,
2063
+ );
2064
+ console.log(
2065
+ ` ${blue('claude-flow claude spawn')} "fix payment bug" --tools "View,Edit,Bash" --no-permissions`,
2066
+ );
2067
+ console.log(` ${blue('claude-flow claude batch')} workflow.json --dry-run`);
1961
2068
  console.log();
1962
- console.log("For more information, see: https://github.com/ruvnet/claude-code-flow/docs/11-claude-spawning.md");
1963
- } else if (command === "swarm" || command === "swarm-ui") {
1964
- console.log(bold(blue("Claude Swarm Mode")));
2069
+ console.log(
2070
+ 'For more information, see: https://github.com/ruvnet/claude-code-flow/docs/11-claude-spawning.md',
2071
+ );
2072
+ } else if (command === 'swarm' || command === 'swarm-ui') {
2073
+ console.log(bold(blue('Claude Swarm Mode')));
1965
2074
  console.log();
1966
- console.log("Create self-orchestrating Claude agent swarms to tackle complex objectives.");
2075
+ console.log('Create self-orchestrating Claude agent swarms to tackle complex objectives.');
1967
2076
  console.log();
1968
- console.log(bold("Usage:"));
1969
- console.log(" claude-flow swarm <objective> [options]");
1970
- console.log(" claude-flow swarm-ui <objective> [options] # Uses blessed UI (avoids TTY issues)");
2077
+ console.log(bold('Usage:'));
2078
+ console.log(' claude-flow swarm <objective> [options]');
2079
+ console.log(
2080
+ ' claude-flow swarm-ui <objective> [options] # Uses blessed UI (avoids TTY issues)',
2081
+ );
1971
2082
  console.log();
1972
- console.log(bold("Options:"));
1973
- console.log(" -s, --strategy <s> Orchestration strategy (auto, research, development, analysis)");
1974
- console.log(" --max-agents <n> Maximum number of agents (default: 5)");
1975
- console.log(" --max-depth <n> Maximum delegation depth (default: 3)");
1976
- console.log(" --research Enable research capabilities for all agents");
1977
- console.log(" --parallel Enable parallel execution");
1978
- console.log(" --memory-namespace <ns> Shared memory namespace (default: swarm)");
1979
- console.log(" --timeout <minutes> Swarm timeout in minutes (default: 60)");
1980
- console.log(" --review Enable peer review between agents");
1981
- console.log(" --coordinator Spawn dedicated coordinator agent");
1982
- console.log(" -c, --config <file> MCP config file");
1983
- console.log(" -v, --verbose Enable verbose output");
1984
- console.log(" -d, --dry-run Preview swarm configuration");
1985
- console.log(" --vscode Use VS Code terminal integration");
1986
- console.log(" --monitor Enable real-time monitoring");
1987
- console.log(" --ui Use blessed terminal UI (avoids TTY issues)");
2083
+ console.log(bold('Options:'));
2084
+ console.log(
2085
+ ' -s, --strategy <s> Orchestration strategy (auto, research, development, analysis)',
2086
+ );
2087
+ console.log(' --max-agents <n> Maximum number of agents (default: 5)');
2088
+ console.log(' --max-depth <n> Maximum delegation depth (default: 3)');
2089
+ console.log(' --research Enable research capabilities for all agents');
2090
+ console.log(' --parallel Enable parallel execution');
2091
+ console.log(' --memory-namespace <ns> Shared memory namespace (default: swarm)');
2092
+ console.log(' --timeout <minutes> Swarm timeout in minutes (default: 60)');
2093
+ console.log(' --review Enable peer review between agents');
2094
+ console.log(' --coordinator Spawn dedicated coordinator agent');
2095
+ console.log(' -c, --config <file> MCP config file');
2096
+ console.log(' -v, --verbose Enable verbose output');
2097
+ console.log(' -d, --dry-run Preview swarm configuration');
2098
+ console.log(' --vscode Use VS Code terminal integration');
2099
+ console.log(' --monitor Enable real-time monitoring');
2100
+ console.log(' --ui Use blessed terminal UI (avoids TTY issues)');
1988
2101
  console.log();
1989
- console.log(bold("Examples:"));
1990
- console.log(` ${blue("claude-flow swarm")} "Build a REST API"`);
1991
- console.log(` ${blue("claude-flow swarm-ui")} "Build a REST API" # Avoids TTY issues`);
1992
- console.log(` ${blue("claude-flow swarm")} "Research cloud architecture" --strategy research --research`);
1993
- console.log(` ${blue("claude-flow swarm")} "Migrate app to microservices" --coordinator --review --ui`);
2102
+ console.log(bold('Examples:'));
2103
+ console.log(` ${blue('claude-flow swarm')} "Build a REST API"`);
2104
+ console.log(` ${blue('claude-flow swarm-ui')} "Build a REST API" # Avoids TTY issues`);
2105
+ console.log(
2106
+ ` ${blue('claude-flow swarm')} "Research cloud architecture" --strategy research --research`,
2107
+ );
2108
+ console.log(
2109
+ ` ${blue('claude-flow swarm')} "Migrate app to microservices" --coordinator --review --ui`,
2110
+ );
1994
2111
  console.log();
1995
- console.log(bold("TTY Issues?"));
2112
+ console.log(bold('TTY Issues?'));
1996
2113
  console.log("If you encounter 'Raw mode is not supported' errors, use:");
1997
- console.log(` - ${blue("claude-flow swarm-ui")} <objective> # Recommended`);
1998
- console.log(` - ${blue("claude-flow swarm")} <objective> --ui`);
2114
+ console.log(` - ${blue('claude-flow swarm-ui')} <objective> # Recommended`);
2115
+ console.log(` - ${blue('claude-flow swarm')} <objective> --ui`);
1999
2116
  console.log();
2000
- console.log("For more information, see:");
2001
- console.log(" - https://github.com/ruvnet/claude-code-flow/docs/12-swarm.md");
2002
- console.log(" - https://github.com/ruvnet/claude-code-flow/SWARM_TTY_SOLUTION.md");
2003
- } else if (command === "sparc") {
2004
- console.log(bold(blue("SPARC Development Mode")));
2117
+ console.log('For more information, see:');
2118
+ console.log(' - https://github.com/ruvnet/claude-code-flow/docs/12-swarm.md');
2119
+ console.log(' - https://github.com/ruvnet/claude-code-flow/SWARM_TTY_SOLUTION.md');
2120
+ } else if (command === 'sparc') {
2121
+ console.log(bold(blue('SPARC Development Mode')));
2005
2122
  console.log();
2006
- console.log("SPARC (Specification, Pseudocode, Architecture, Refinement, Completion)");
2007
- console.log("TDD-based development with specialized AI modes from .roomodes configuration.");
2123
+ console.log('SPARC (Specification, Pseudocode, Architecture, Refinement, Completion)');
2124
+ console.log(
2125
+ 'TDD-based development with specialized AI modes from .roomodes configuration.',
2126
+ );
2008
2127
  console.log();
2009
- console.log(bold("Subcommands:"));
2010
- console.log(" modes List all available SPARC modes");
2011
- console.log(" info <mode> Show detailed information about a mode");
2012
- console.log(" run <mode> <task> Execute a task using a specific SPARC mode");
2013
- console.log(" tdd <task> Run full TDD workflow using SPARC methodology");
2014
- console.log(" workflow <file> Execute a custom SPARC workflow from JSON file");
2128
+ console.log(bold('Subcommands:'));
2129
+ console.log(' modes List all available SPARC modes');
2130
+ console.log(' info <mode> Show detailed information about a mode');
2131
+ console.log(' run <mode> <task> Execute a task using a specific SPARC mode');
2132
+ console.log(' tdd <task> Run full TDD workflow using SPARC methodology');
2133
+ console.log(' workflow <file> Execute a custom SPARC workflow from JSON file');
2015
2134
  console.log();
2016
- console.log(bold("Common Modes:"));
2017
- console.log(" spec-pseudocode Create specifications and pseudocode");
2018
- console.log(" architect Design system architecture");
2019
- console.log(" code Implement code solutions");
2020
- console.log(" tdd Test-driven development");
2021
- console.log(" debug Debug and troubleshoot issues");
2022
- console.log(" security-review Security analysis and review");
2023
- console.log(" docs-writer Documentation creation");
2024
- console.log(" integration System integration and testing");
2135
+ console.log(bold('Common Modes:'));
2136
+ console.log(' spec-pseudocode Create specifications and pseudocode');
2137
+ console.log(' architect Design system architecture');
2138
+ console.log(' code Implement code solutions');
2139
+ console.log(' tdd Test-driven development');
2140
+ console.log(' debug Debug and troubleshoot issues');
2141
+ console.log(' security-review Security analysis and review');
2142
+ console.log(' docs-writer Documentation creation');
2143
+ console.log(' integration System integration and testing');
2025
2144
  console.log();
2026
- console.log(bold("Options:"));
2027
- console.log(" -n, --namespace <ns> Memory namespace for this session");
2028
- console.log(" --no-permissions Skip permission prompts");
2029
- console.log(" -c, --config <file> MCP configuration file");
2030
- console.log(" -v, --verbose Enable verbose output");
2031
- console.log(" -d, --dry-run Preview what would be executed");
2032
- console.log(" --sequential Wait between workflow steps (default: true)");
2145
+ console.log(bold('Options:'));
2146
+ console.log(' -n, --namespace <ns> Memory namespace for this session');
2147
+ console.log(' --no-permissions Skip permission prompts');
2148
+ console.log(' -c, --config <file> MCP configuration file');
2149
+ console.log(' -v, --verbose Enable verbose output');
2150
+ console.log(' -d, --dry-run Preview what would be executed');
2151
+ console.log(' --sequential Wait between workflow steps (default: true)');
2033
2152
  console.log();
2034
- console.log(bold("Examples:"));
2035
- console.log(` ${blue("claude-flow sparc modes")} # List all modes`);
2036
- console.log(` ${blue("claude-flow sparc run code")} "implement user auth" # Run specific mode`);
2037
- console.log(` ${blue("claude-flow sparc tdd")} "payment processing system" # Full TDD workflow`);
2038
- console.log(` ${blue("claude-flow sparc workflow")} project-workflow.json # Custom workflow`);
2153
+ console.log(bold('Examples:'));
2154
+ console.log(
2155
+ ` ${blue('claude-flow sparc modes')} # List all modes`,
2156
+ );
2157
+ console.log(
2158
+ ` ${blue('claude-flow sparc run code')} "implement user auth" # Run specific mode`,
2159
+ );
2160
+ console.log(
2161
+ ` ${blue('claude-flow sparc tdd')} "payment processing system" # Full TDD workflow`,
2162
+ );
2163
+ console.log(
2164
+ ` ${blue('claude-flow sparc workflow')} project-workflow.json # Custom workflow`,
2165
+ );
2039
2166
  console.log();
2040
- console.log("For more information, see: https://github.com/ruvnet/claude-code-flow/docs/sparc.md");
2041
- } else if (command === "start") {
2042
- console.log(bold(blue("Enhanced Start Command")));
2167
+ console.log(
2168
+ 'For more information, see: https://github.com/ruvnet/claude-code-flow/docs/sparc.md',
2169
+ );
2170
+ } else if (command === 'start') {
2171
+ console.log(bold(blue('Enhanced Start Command')));
2043
2172
  console.log();
2044
- console.log("Start the Claude-Flow orchestration system with comprehensive service management.");
2173
+ console.log(
2174
+ 'Start the Claude-Flow orchestration system with comprehensive service management.',
2175
+ );
2045
2176
  console.log();
2046
- console.log(bold("Usage:"));
2047
- console.log(" claude-flow start [options]");
2177
+ console.log(bold('Usage:'));
2178
+ console.log(' claude-flow start [options]');
2048
2179
  console.log();
2049
- console.log(bold("Options:"));
2050
- console.log(" -d, --daemon Run as daemon in background");
2051
- console.log(" -p, --port <port> MCP server port (default: 3000)");
2052
- console.log(" --mcp-transport <type> MCP transport type (stdio, http)");
2053
- console.log(" -u, --ui Launch interactive process management UI");
2054
- console.log(" -v, --verbose Enable verbose logging");
2055
- console.log(" --auto-start Automatically start all processes");
2056
- console.log(" --config <path> Configuration file path");
2057
- console.log(" --force Force start even if already running");
2058
- console.log(" --health-check Perform health checks before starting");
2059
- console.log(" --timeout <seconds> Startup timeout in seconds (default: 60)");
2180
+ console.log(bold('Options:'));
2181
+ console.log(' -d, --daemon Run as daemon in background');
2182
+ console.log(' -p, --port <port> MCP server port (default: 3000)');
2183
+ console.log(' --mcp-transport <type> MCP transport type (stdio, http)');
2184
+ console.log(' -u, --ui Launch interactive process management UI');
2185
+ console.log(' -v, --verbose Enable verbose logging');
2186
+ console.log(' --auto-start Automatically start all processes');
2187
+ console.log(' --config <path> Configuration file path');
2188
+ console.log(' --force Force start even if already running');
2189
+ console.log(' --health-check Perform health checks before starting');
2190
+ console.log(' --timeout <seconds> Startup timeout in seconds (default: 60)');
2060
2191
  console.log();
2061
- console.log(bold("Examples:"));
2062
- console.log(` ${blue("claude-flow start")} # Interactive mode`);
2063
- console.log(` ${blue("claude-flow start --daemon")} # Background daemon`);
2064
- console.log(` ${blue("claude-flow start --ui")} # Process management UI`);
2065
- console.log(` ${blue("claude-flow start --health-check")} # With pre-flight checks`);
2066
- } else if (command === "status") {
2067
- console.log(bold(blue("Enhanced Status Command")));
2192
+ console.log(bold('Examples:'));
2193
+ console.log(` ${blue('claude-flow start')} # Interactive mode`);
2194
+ console.log(` ${blue('claude-flow start --daemon')} # Background daemon`);
2195
+ console.log(` ${blue('claude-flow start --ui')} # Process management UI`);
2196
+ console.log(` ${blue('claude-flow start --health-check')} # With pre-flight checks`);
2197
+ } else if (command === 'status') {
2198
+ console.log(bold(blue('Enhanced Status Command')));
2068
2199
  console.log();
2069
- console.log("Show comprehensive Claude-Flow system status with detailed reporting.");
2200
+ console.log('Show comprehensive Claude-Flow system status with detailed reporting.');
2070
2201
  console.log();
2071
- console.log(bold("Usage:"));
2072
- console.log(" claude-flow status [options]");
2202
+ console.log(bold('Usage:'));
2203
+ console.log(' claude-flow status [options]');
2073
2204
  console.log();
2074
- console.log(bold("Options:"));
2075
- console.log(" -w, --watch Watch mode - continuously update status");
2076
- console.log(" -i, --interval <seconds> Update interval in seconds (default: 5)");
2077
- console.log(" -c, --component <name> Show status for specific component");
2078
- console.log(" --json Output in JSON format");
2079
- console.log(" --detailed Show detailed component information");
2080
- console.log(" --health-check Perform comprehensive health checks");
2081
- console.log(" --history Show status history from logs");
2205
+ console.log(bold('Options:'));
2206
+ console.log(' -w, --watch Watch mode - continuously update status');
2207
+ console.log(' -i, --interval <seconds> Update interval in seconds (default: 5)');
2208
+ console.log(' -c, --component <name> Show status for specific component');
2209
+ console.log(' --json Output in JSON format');
2210
+ console.log(' --detailed Show detailed component information');
2211
+ console.log(' --health-check Perform comprehensive health checks');
2212
+ console.log(' --history Show status history from logs');
2082
2213
  console.log();
2083
- console.log(bold("Examples:"));
2084
- console.log(` ${blue("claude-flow status")} # Basic status`);
2085
- console.log(` ${blue("claude-flow status --watch")} # Live updates`);
2086
- console.log(` ${blue("claude-flow status --detailed")} # Comprehensive info`);
2087
- console.log(` ${blue("claude-flow status --component mcp")} # Specific component`);
2088
- } else if (command === "monitor") {
2089
- console.log(bold(blue("Enhanced Monitor Command")));
2214
+ console.log(bold('Examples:'));
2215
+ console.log(` ${blue('claude-flow status')} # Basic status`);
2216
+ console.log(` ${blue('claude-flow status --watch')} # Live updates`);
2217
+ console.log(` ${blue('claude-flow status --detailed')} # Comprehensive info`);
2218
+ console.log(` ${blue('claude-flow status --component mcp')} # Specific component`);
2219
+ } else if (command === 'monitor') {
2220
+ console.log(bold(blue('Enhanced Monitor Command')));
2090
2221
  console.log();
2091
- console.log("Real-time monitoring dashboard with comprehensive metrics and alerting.");
2222
+ console.log('Real-time monitoring dashboard with comprehensive metrics and alerting.');
2092
2223
  console.log();
2093
- console.log(bold("Usage:"));
2094
- console.log(" claude-flow monitor [options]");
2224
+ console.log(bold('Usage:'));
2225
+ console.log(' claude-flow monitor [options]');
2095
2226
  console.log();
2096
- console.log(bold("Options:"));
2097
- console.log(" -i, --interval <seconds> Update interval in seconds (default: 2)");
2098
- console.log(" -c, --compact Compact view mode");
2099
- console.log(" --focus <component> Focus on specific component");
2100
- console.log(" --alerts Enable alert notifications");
2101
- console.log(" --export <file> Export monitoring data to file");
2102
- console.log(" --threshold <percent> Alert threshold percentage (default: 80)");
2103
- console.log(" --log-level <level> Log level filter (error, warn, info, debug)");
2104
- console.log(" --no-graphs Disable ASCII graphs");
2227
+ console.log(bold('Options:'));
2228
+ console.log(' -i, --interval <seconds> Update interval in seconds (default: 2)');
2229
+ console.log(' -c, --compact Compact view mode');
2230
+ console.log(' --focus <component> Focus on specific component');
2231
+ console.log(' --alerts Enable alert notifications');
2232
+ console.log(' --export <file> Export monitoring data to file');
2233
+ console.log(' --threshold <percent> Alert threshold percentage (default: 80)');
2234
+ console.log(' --log-level <level> Log level filter (error, warn, info, debug)');
2235
+ console.log(' --no-graphs Disable ASCII graphs');
2105
2236
  console.log();
2106
- console.log(bold("Examples:"));
2107
- console.log(` ${blue("claude-flow monitor")} # Basic monitoring`);
2108
- console.log(` ${blue("claude-flow monitor --alerts")} # With alerting`);
2109
- console.log(` ${blue("claude-flow monitor --focus mcp")} # Component focus`);
2110
- console.log(` ${blue("claude-flow monitor --export data.json")} # Data export`);
2111
- } else if (command === "session") {
2112
- console.log(bold(blue("Enhanced Session Management")));
2237
+ console.log(bold('Examples:'));
2238
+ console.log(` ${blue('claude-flow monitor')} # Basic monitoring`);
2239
+ console.log(` ${blue('claude-flow monitor --alerts')} # With alerting`);
2240
+ console.log(` ${blue('claude-flow monitor --focus mcp')} # Component focus`);
2241
+ console.log(` ${blue('claude-flow monitor --export data.json')} # Data export`);
2242
+ } else if (command === 'session') {
2243
+ console.log(bold(blue('Enhanced Session Management')));
2113
2244
  console.log();
2114
- console.log("Comprehensive session lifecycle management with backup and recovery.");
2245
+ console.log('Comprehensive session lifecycle management with backup and recovery.');
2115
2246
  console.log();
2116
- console.log(bold("Commands:"));
2117
- console.log(" list List all saved sessions");
2118
- console.log(" save [name] Save current session state");
2119
- console.log(" restore <session-id> Restore a saved session");
2120
- console.log(" delete <session-id> Delete a saved session");
2121
- console.log(" export <session-id> <file> Export session to file");
2122
- console.log(" import <file> Import session from file");
2123
- console.log(" info <session-id> Show detailed session information");
2124
- console.log(" clean Clean up old or orphaned sessions");
2125
- console.log(" backup [session-id] Backup sessions to archive");
2126
- console.log(" restore-backup <file> Restore sessions from backup");
2127
- console.log(" validate [session-id] Validate session integrity");
2128
- console.log(" monitor Monitor active sessions");
2247
+ console.log(bold('Commands:'));
2248
+ console.log(' list List all saved sessions');
2249
+ console.log(' save [name] Save current session state');
2250
+ console.log(' restore <session-id> Restore a saved session');
2251
+ console.log(' delete <session-id> Delete a saved session');
2252
+ console.log(' export <session-id> <file> Export session to file');
2253
+ console.log(' import <file> Import session from file');
2254
+ console.log(' info <session-id> Show detailed session information');
2255
+ console.log(' clean Clean up old or orphaned sessions');
2256
+ console.log(' backup [session-id] Backup sessions to archive');
2257
+ console.log(' restore-backup <file> Restore sessions from backup');
2258
+ console.log(' validate [session-id] Validate session integrity');
2259
+ console.log(' monitor Monitor active sessions');
2129
2260
  console.log();
2130
- console.log(bold("Examples:"));
2131
- console.log(` ${blue("claude-flow session list")} # List sessions`);
2132
- console.log(` ${blue("claude-flow session save mywork")} # Save session`);
2133
- console.log(` ${blue("claude-flow session restore abc123")} # Restore session`);
2134
- console.log(` ${blue("claude-flow session validate --fix")} # Validate and fix`);
2261
+ console.log(bold('Examples:'));
2262
+ console.log(` ${blue('claude-flow session list')} # List sessions`);
2263
+ console.log(` ${blue('claude-flow session save mywork')} # Save session`);
2264
+ console.log(` ${blue('claude-flow session restore abc123')} # Restore session`);
2265
+ console.log(` ${blue('claude-flow session validate --fix')} # Validate and fix`);
2135
2266
  } else {
2136
2267
  // Show general help with enhanced commands
2137
- console.log(bold(blue("Claude-Flow Enhanced Orchestration System")));
2268
+ console.log(bold(blue('Claude-Flow Enhanced Orchestration System')));
2138
2269
  console.log();
2139
- console.log("Available commands:");
2140
- console.log(" start Enhanced orchestration system startup");
2141
- console.log(" status Comprehensive system status reporting");
2142
- console.log(" monitor Real-time monitoring dashboard");
2143
- console.log(" session Advanced session management");
2144
- console.log(" swarm Self-orchestrating agent swarms");
2145
- console.log(" sparc Enhanced TDD development modes");
2146
- console.log(" agent Agent management and coordination");
2147
- console.log(" task Task creation and management");
2148
- console.log(" memory Memory bank operations");
2149
- console.log(" mcp MCP server management");
2150
- console.log(" claude Claude instance spawning");
2270
+ console.log('Available commands:');
2271
+ console.log(' start Enhanced orchestration system startup');
2272
+ console.log(' status Comprehensive system status reporting');
2273
+ console.log(' monitor Real-time monitoring dashboard');
2274
+ console.log(' session Advanced session management');
2275
+ console.log(' swarm Self-orchestrating agent swarms');
2276
+ console.log(' sparc Enhanced TDD development modes');
2277
+ console.log(' agent Agent management and coordination');
2278
+ console.log(' task Task creation and management');
2279
+ console.log(' memory Memory bank operations');
2280
+ console.log(' mcp MCP server management');
2281
+ console.log(' claude Claude instance spawning');
2151
2282
  console.log();
2152
- console.log("For detailed help on any command, use:");
2153
- console.log(` ${blue("claude-flow help <command>")}`);
2283
+ console.log('For detailed help on any command, use:');
2284
+ console.log(` ${blue('claude-flow help <command>')}`);
2154
2285
  console.log();
2155
- console.log("Enhanced features:");
2156
- console.log(" ✨ Comprehensive service management");
2157
- console.log(" ✨ Real-time monitoring and alerting");
2158
- console.log(" ✨ Advanced session lifecycle management");
2159
- console.log(" ✨ Batch operations and parallel execution");
2160
- console.log(" ✨ Health checks and auto-recovery");
2161
- console.log(" ✨ Process management UI");
2286
+ console.log('Enhanced features:');
2287
+ console.log(' ✨ Comprehensive service management');
2288
+ console.log(' ✨ Real-time monitoring and alerting');
2289
+ console.log(' ✨ Advanced session lifecycle management');
2290
+ console.log(' ✨ Batch operations and parallel execution');
2291
+ console.log(' ✨ Health checks and auto-recovery');
2292
+ console.log(' ✨ Process management UI');
2162
2293
  }
2163
2294
  },
2164
2295
  });
@@ -2175,84 +2306,84 @@ Now, please proceed with the task: ${task}`;
2175
2306
 
2176
2307
  // Hive Mind command
2177
2308
  cli.command({
2178
- name: "hive-mind",
2179
- description: "Collective intelligence swarm management",
2180
- aliases: ["hive", "swarm"],
2309
+ name: 'hive-mind',
2310
+ description: 'Collective intelligence swarm management',
2311
+ aliases: ['hive', 'swarm'],
2181
2312
  options: [
2182
2313
  {
2183
- name: "command",
2184
- description: "Hive Mind command (init, spawn, status, task, wizard)",
2185
- type: "string"
2314
+ name: 'command',
2315
+ description: 'Hive Mind command (init, spawn, status, task, wizard)',
2316
+ type: 'string',
2186
2317
  },
2187
2318
  {
2188
- name: "swarm-id",
2189
- short: "s",
2190
- description: "Swarm ID to operate on",
2191
- type: "string"
2319
+ name: 'swarm-id',
2320
+ short: 's',
2321
+ description: 'Swarm ID to operate on',
2322
+ type: 'string',
2192
2323
  },
2193
2324
  {
2194
- name: "topology",
2195
- short: "t",
2196
- description: "Swarm topology (mesh, hierarchical, ring, star)",
2197
- type: "string",
2198
- default: "hierarchical"
2325
+ name: 'topology',
2326
+ short: 't',
2327
+ description: 'Swarm topology (mesh, hierarchical, ring, star)',
2328
+ type: 'string',
2329
+ default: 'hierarchical',
2199
2330
  },
2200
2331
  {
2201
- name: "max-agents",
2202
- short: "m",
2203
- description: "Maximum number of agents",
2204
- type: "number",
2205
- default: 8
2332
+ name: 'max-agents',
2333
+ short: 'm',
2334
+ description: 'Maximum number of agents',
2335
+ type: 'number',
2336
+ default: 8,
2206
2337
  },
2207
2338
  {
2208
- name: "interactive",
2209
- short: "i",
2210
- description: "Run in interactive mode",
2211
- type: "boolean"
2212
- }
2339
+ name: 'interactive',
2340
+ short: 'i',
2341
+ description: 'Run in interactive mode',
2342
+ type: 'boolean',
2343
+ },
2213
2344
  ],
2214
2345
  action: async (ctx: CommandContext) => {
2215
2346
  try {
2216
- const subcommand = ctx.args[0] || "wizard";
2217
-
2347
+ const subcommand = ctx.args[0] || 'wizard';
2348
+
2218
2349
  // Import hive-mind commands dynamically
2219
2350
  const { hiveMindCommand } = await import('./hive-mind/index.js');
2220
-
2351
+
2221
2352
  // Execute the appropriate subcommand
2222
2353
  switch (subcommand) {
2223
- case "init":
2354
+ case 'init':
2224
2355
  const { initCommand } = await import('./hive-mind/init.js');
2225
2356
  await initCommand.parseAsync(process.argv.slice(3));
2226
2357
  break;
2227
- case "spawn":
2358
+ case 'spawn':
2228
2359
  const { spawnCommand } = await import('./hive-mind/spawn.js');
2229
2360
  await spawnCommand.parseAsync(process.argv.slice(3));
2230
2361
  break;
2231
- case "status":
2362
+ case 'status':
2232
2363
  const { statusCommand } = await import('./hive-mind/status.js');
2233
2364
  await statusCommand.parseAsync(process.argv.slice(3));
2234
2365
  break;
2235
- case "task":
2366
+ case 'task':
2236
2367
  const { taskCommand } = await import('./hive-mind/task.js');
2237
2368
  await taskCommand.parseAsync(process.argv.slice(3));
2238
2369
  break;
2239
- case "stop":
2370
+ case 'stop':
2240
2371
  const { stopCommand } = await import('./hive-mind/stop.js');
2241
2372
  await stopCommand.parseAsync(process.argv.slice(3));
2242
2373
  break;
2243
- case "pause":
2374
+ case 'pause':
2244
2375
  const { pauseCommand } = await import('./hive-mind/pause.js');
2245
2376
  await pauseCommand.parseAsync(process.argv.slice(3));
2246
2377
  break;
2247
- case "resume":
2378
+ case 'resume':
2248
2379
  const { resumeCommand } = await import('./hive-mind/resume.js');
2249
2380
  await resumeCommand.parseAsync(process.argv.slice(3));
2250
2381
  break;
2251
- case "ps":
2382
+ case 'ps':
2252
2383
  const { psCommand } = await import('./hive-mind/ps.js');
2253
2384
  await psCommand.parseAsync(process.argv.slice(3));
2254
2385
  break;
2255
- case "wizard":
2386
+ case 'wizard':
2256
2387
  default:
2257
2388
  const { wizardCommand } = await import('./hive-mind/wizard.js');
2258
2389
  await wizardCommand.parseAsync(process.argv.slice(3));
@@ -2261,25 +2392,25 @@ Now, please proceed with the task: ${task}`;
2261
2392
  } catch (err) {
2262
2393
  error(`Hive Mind error: ${getErrorMessage(err)}`);
2263
2394
  }
2264
- }
2395
+ },
2265
2396
  });
2266
2397
 
2267
2398
  // Hook command for ruv-swarm integration
2268
2399
  cli.command({
2269
- name: "hook",
2270
- description: "Execute ruv-swarm hooks for agent coordination",
2400
+ name: 'hook',
2401
+ description: 'Execute ruv-swarm hooks for agent coordination',
2271
2402
  action: async (ctx: CommandContext) => {
2272
2403
  try {
2273
2404
  const { spawn } = await import('child_process');
2274
-
2405
+
2275
2406
  // Pass all arguments to ruv-swarm hook command
2276
2407
  const args = ctx.args.length > 0 ? ctx.args : ['--help'];
2277
-
2408
+
2278
2409
  const child = spawn('npx', ['ruv-swarm', 'hook', ...args], {
2279
2410
  stdio: 'inherit',
2280
- shell: true
2411
+ shell: true,
2281
2412
  });
2282
-
2413
+
2283
2414
  await new Promise<void>((resolve, reject) => {
2284
2415
  child.on('exit', (code) => {
2285
2416
  if (code === 0) {
@@ -2289,7 +2420,7 @@ Now, please proceed with the task: ${task}`;
2289
2420
  resolve();
2290
2421
  }
2291
2422
  });
2292
-
2423
+
2293
2424
  child.on('error', (err) => {
2294
2425
  error(`Failed to execute hook command: ${getErrorMessage(err)}`);
2295
2426
  resolve();
@@ -2298,7 +2429,7 @@ Now, please proceed with the task: ${task}`;
2298
2429
  } catch (err) {
2299
2430
  error(`Hook command error: ${getErrorMessage(err)}`);
2300
2431
  }
2301
- }
2432
+ },
2302
2433
  });
2303
2434
 
2304
2435
  // Add enterprise commands
@@ -2325,7 +2456,7 @@ function getDefaultPromptForType(type: string): string {
2325
2456
  researcher: 'You are a research agent specialized in gathering and analyzing information.',
2326
2457
  implementer: 'You are an implementation agent focused on writing code and creating solutions.',
2327
2458
  analyst: 'You are an analysis agent that identifies patterns and generates insights.',
2328
- custom: 'You are a custom agent. Follow the user\'s instructions.',
2459
+ custom: "You are a custom agent. Follow the user's instructions.",
2329
2460
  };
2330
2461
 
2331
2462
  return prompts[type] || prompts.custom;
@@ -2650,4 +2781,4 @@ memory/sessions/
2650
2781
  ## Last Updated
2651
2782
  ${new Date().toISOString()}
2652
2783
  `;
2653
- }
2784
+ }