claude-flow 2.0.0-alpha.79 → 2.0.0-alpha.80

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