claude-flow 2.7.0 → 2.7.1

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