@claude-flow/cli 3.32.2 → 3.32.3

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 (655) hide show
  1. package/.claude/helpers/helpers.manifest.json +3 -3
  2. package/.claude/helpers/statusline.cjs +38 -38
  3. package/catalog-manifest.json +2 -2
  4. package/package.json +2 -2
  5. package/plugins/ruflo-metaharness/scripts/smoke.sh +11 -11
  6. package/dist/src/agenticow/speculative-exploration.d.ts +0 -148
  7. package/dist/src/agenticow/speculative-exploration.js +0 -218
  8. package/dist/src/appliance/gguf-engine.d.ts +0 -91
  9. package/dist/src/appliance/gguf-engine.js +0 -425
  10. package/dist/src/appliance/ruvllm-bridge.d.ts +0 -102
  11. package/dist/src/appliance/ruvllm-bridge.js +0 -292
  12. package/dist/src/appliance/rvfa-builder.d.ts +0 -44
  13. package/dist/src/appliance/rvfa-builder.js +0 -329
  14. package/dist/src/appliance/rvfa-distribution.d.ts +0 -97
  15. package/dist/src/appliance/rvfa-distribution.js +0 -370
  16. package/dist/src/appliance/rvfa-format.d.ts +0 -111
  17. package/dist/src/appliance/rvfa-format.js +0 -393
  18. package/dist/src/appliance/rvfa-runner.d.ts +0 -69
  19. package/dist/src/appliance/rvfa-runner.js +0 -237
  20. package/dist/src/appliance/rvfa-signing.d.ts +0 -123
  21. package/dist/src/appliance/rvfa-signing.js +0 -347
  22. package/dist/src/autopilot-state.d.ts +0 -77
  23. package/dist/src/autopilot-state.js +0 -271
  24. package/dist/src/benchmarks/gaia-agent-planning.smoke.d.ts +0 -18
  25. package/dist/src/benchmarks/gaia-agent-planning.smoke.js +0 -253
  26. package/dist/src/benchmarks/gaia-agent.d.ts +0 -198
  27. package/dist/src/benchmarks/gaia-agent.js +0 -651
  28. package/dist/src/benchmarks/gaia-causal-memory.d.ts +0 -133
  29. package/dist/src/benchmarks/gaia-causal-memory.js +0 -281
  30. package/dist/src/benchmarks/gaia-causal-memory.smoke.d.ts +0 -22
  31. package/dist/src/benchmarks/gaia-causal-memory.smoke.js +0 -300
  32. package/dist/src/benchmarks/gaia-convergence.d.ts +0 -138
  33. package/dist/src/benchmarks/gaia-convergence.js +0 -260
  34. package/dist/src/benchmarks/gaia-convergence.smoke.d.ts +0 -19
  35. package/dist/src/benchmarks/gaia-convergence.smoke.js +0 -246
  36. package/dist/src/benchmarks/gaia-critic.d.ts +0 -123
  37. package/dist/src/benchmarks/gaia-critic.js +0 -312
  38. package/dist/src/benchmarks/gaia-critic.smoke.d.ts +0 -21
  39. package/dist/src/benchmarks/gaia-critic.smoke.js +0 -327
  40. package/dist/src/benchmarks/gaia-decomposer.d.ts +0 -125
  41. package/dist/src/benchmarks/gaia-decomposer.js +0 -350
  42. package/dist/src/benchmarks/gaia-decomposer.smoke.d.ts +0 -21
  43. package/dist/src/benchmarks/gaia-decomposer.smoke.js +0 -228
  44. package/dist/src/benchmarks/gaia-e2e-smoke.d.ts +0 -27
  45. package/dist/src/benchmarks/gaia-e2e-smoke.js +0 -136
  46. package/dist/src/benchmarks/gaia-extract.smoke.d.ts +0 -45
  47. package/dist/src/benchmarks/gaia-extract.smoke.js +0 -242
  48. package/dist/src/benchmarks/gaia-hardness/features.d.ts +0 -46
  49. package/dist/src/benchmarks/gaia-hardness/features.js +0 -170
  50. package/dist/src/benchmarks/gaia-hardness/predictor.d.ts +0 -105
  51. package/dist/src/benchmarks/gaia-hardness/predictor.js +0 -260
  52. package/dist/src/benchmarks/gaia-hardness/predictor.smoke.d.ts +0 -20
  53. package/dist/src/benchmarks/gaia-hardness/predictor.smoke.js +0 -235
  54. package/dist/src/benchmarks/gaia-hardness/train-data-loader.d.ts +0 -51
  55. package/dist/src/benchmarks/gaia-hardness/train-data-loader.js +0 -179
  56. package/dist/src/benchmarks/gaia-judge.d.ts +0 -88
  57. package/dist/src/benchmarks/gaia-judge.js +0 -437
  58. package/dist/src/benchmarks/gaia-loader.d.ts +0 -87
  59. package/dist/src/benchmarks/gaia-loader.js +0 -326
  60. package/dist/src/benchmarks/gaia-tools/file_read.d.ts +0 -35
  61. package/dist/src/benchmarks/gaia-tools/file_read.js +0 -403
  62. package/dist/src/benchmarks/gaia-tools/grounded_query.d.ts +0 -126
  63. package/dist/src/benchmarks/gaia-tools/grounded_query.js +0 -225
  64. package/dist/src/benchmarks/gaia-tools/index.d.ts +0 -32
  65. package/dist/src/benchmarks/gaia-tools/index.js +0 -36
  66. package/dist/src/benchmarks/gaia-tools/types.d.ts +0 -62
  67. package/dist/src/benchmarks/gaia-tools/types.js +0 -12
  68. package/dist/src/benchmarks/gaia-tools/web_search.d.ts +0 -30
  69. package/dist/src/benchmarks/gaia-tools/web_search.js +0 -210
  70. package/dist/src/benchmarks/gaia-voting.d.ts +0 -88
  71. package/dist/src/benchmarks/gaia-voting.js +0 -297
  72. package/dist/src/benchmarks/gaia-voting.smoke.d.ts +0 -20
  73. package/dist/src/benchmarks/gaia-voting.smoke.js +0 -332
  74. package/dist/src/benchmarks/pretrain/index.d.ts +0 -58
  75. package/dist/src/benchmarks/pretrain/index.js +0 -404
  76. package/dist/src/business-pods/bbs-budget-tracker.d.ts +0 -139
  77. package/dist/src/business-pods/bbs-budget-tracker.js +0 -358
  78. package/dist/src/business-pods/domain-affinity-policy.d.ts +0 -47
  79. package/dist/src/business-pods/domain-affinity-policy.js +0 -65
  80. package/dist/src/business-pods/pod-schema.d.ts +0 -96
  81. package/dist/src/business-pods/pod-schema.js +0 -225
  82. package/dist/src/commands/advisor.d.ts +0 -15
  83. package/dist/src/commands/advisor.js +0 -94
  84. package/dist/src/commands/agent-wasm.d.ts +0 -14
  85. package/dist/src/commands/agent-wasm.js +0 -333
  86. package/dist/src/commands/agent.d.ts +0 -8
  87. package/dist/src/commands/agent.js +0 -927
  88. package/dist/src/commands/analyze.d.ts +0 -19
  89. package/dist/src/commands/analyze.js +0 -2047
  90. package/dist/src/commands/announcements.d.ts +0 -17
  91. package/dist/src/commands/announcements.js +0 -0
  92. package/dist/src/commands/appliance-advanced.d.ts +0 -9
  93. package/dist/src/commands/appliance-advanced.js +0 -215
  94. package/dist/src/commands/appliance.d.ts +0 -8
  95. package/dist/src/commands/appliance.js +0 -404
  96. package/dist/src/commands/autopilot.d.ts +0 -15
  97. package/dist/src/commands/autopilot.js +0 -407
  98. package/dist/src/commands/benchmark.d.ts +0 -10
  99. package/dist/src/commands/benchmark.js +0 -460
  100. package/dist/src/commands/claims.d.ts +0 -10
  101. package/dist/src/commands/claims.js +0 -620
  102. package/dist/src/commands/cleanup.d.ts +0 -13
  103. package/dist/src/commands/cleanup.js +0 -250
  104. package/dist/src/commands/completions.d.ts +0 -10
  105. package/dist/src/commands/completions.js +0 -539
  106. package/dist/src/commands/config.d.ts +0 -8
  107. package/dist/src/commands/config.js +0 -428
  108. package/dist/src/commands/daemon.d.ts +0 -59
  109. package/dist/src/commands/daemon.js +0 -1733
  110. package/dist/src/commands/deployment.d.ts +0 -10
  111. package/dist/src/commands/deployment.js +0 -672
  112. package/dist/src/commands/doctor.d.ts +0 -10
  113. package/dist/src/commands/doctor.js +0 -1695
  114. package/dist/src/commands/eject.d.ts +0 -33
  115. package/dist/src/commands/eject.js +0 -195
  116. package/dist/src/commands/embeddings.d.ts +0 -18
  117. package/dist/src/commands/embeddings.js +0 -1623
  118. package/dist/src/commands/funnel.d.ts +0 -18
  119. package/dist/src/commands/funnel.js +0 -302
  120. package/dist/src/commands/gaia-bench.d.ts +0 -40
  121. package/dist/src/commands/gaia-bench.js +0 -597
  122. package/dist/src/commands/guidance.d.ts +0 -8
  123. package/dist/src/commands/guidance.js +0 -556
  124. package/dist/src/commands/hive-mind.d.ts +0 -11
  125. package/dist/src/commands/hive-mind.js +0 -1319
  126. package/dist/src/commands/hooks.d.ts +0 -8
  127. package/dist/src/commands/hooks.js +0 -4606
  128. package/dist/src/commands/index.d.ts +0 -118
  129. package/dist/src/commands/index.js +0 -364
  130. package/dist/src/commands/init.d.ts +0 -13
  131. package/dist/src/commands/init.js +0 -1297
  132. package/dist/src/commands/issues.d.ts +0 -21
  133. package/dist/src/commands/issues.js +0 -567
  134. package/dist/src/commands/mcp.d.ts +0 -11
  135. package/dist/src/commands/mcp.js +0 -732
  136. package/dist/src/commands/memory-backup.d.ts +0 -11
  137. package/dist/src/commands/memory-backup.js +0 -46
  138. package/dist/src/commands/memory-distill.d.ts +0 -27
  139. package/dist/src/commands/memory-distill.js +0 -374
  140. package/dist/src/commands/memory.d.ts +0 -8
  141. package/dist/src/commands/memory.js +0 -1596
  142. package/dist/src/commands/metaharness.d.ts +0 -39
  143. package/dist/src/commands/metaharness.js +0 -215
  144. package/dist/src/commands/migrate.d.ts +0 -8
  145. package/dist/src/commands/migrate.js +0 -742
  146. package/dist/src/commands/neural.d.ts +0 -10
  147. package/dist/src/commands/neural.js +0 -4331
  148. package/dist/src/commands/performance.d.ts +0 -10
  149. package/dist/src/commands/performance.js +0 -583
  150. package/dist/src/commands/plugins.d.ts +0 -11
  151. package/dist/src/commands/plugins.js +0 -826
  152. package/dist/src/commands/process.d.ts +0 -10
  153. package/dist/src/commands/process.js +0 -694
  154. package/dist/src/commands/progress.d.ts +0 -11
  155. package/dist/src/commands/progress.js +0 -259
  156. package/dist/src/commands/providers.d.ts +0 -10
  157. package/dist/src/commands/providers.js +0 -502
  158. package/dist/src/commands/proxy.d.ts +0 -21
  159. package/dist/src/commands/proxy.js +0 -310
  160. package/dist/src/commands/route.d.ts +0 -16
  161. package/dist/src/commands/route.js +0 -822
  162. package/dist/src/commands/ruvector/backup.d.ts +0 -11
  163. package/dist/src/commands/ruvector/backup.js +0 -747
  164. package/dist/src/commands/ruvector/benchmark.d.ts +0 -11
  165. package/dist/src/commands/ruvector/benchmark.js +0 -490
  166. package/dist/src/commands/ruvector/import.d.ts +0 -18
  167. package/dist/src/commands/ruvector/import.js +0 -373
  168. package/dist/src/commands/ruvector/index.d.ts +0 -29
  169. package/dist/src/commands/ruvector/index.js +0 -129
  170. package/dist/src/commands/ruvector/init.d.ts +0 -11
  171. package/dist/src/commands/ruvector/init.js +0 -467
  172. package/dist/src/commands/ruvector/migrate.d.ts +0 -11
  173. package/dist/src/commands/ruvector/migrate.js +0 -498
  174. package/dist/src/commands/ruvector/optimize.d.ts +0 -11
  175. package/dist/src/commands/ruvector/optimize.js +0 -505
  176. package/dist/src/commands/ruvector/pg-utils.d.ts +0 -14
  177. package/dist/src/commands/ruvector/pg-utils.js +0 -41
  178. package/dist/src/commands/ruvector/setup.d.ts +0 -18
  179. package/dist/src/commands/ruvector/setup.js +0 -765
  180. package/dist/src/commands/ruvector/status.d.ts +0 -11
  181. package/dist/src/commands/ruvector/status.js +0 -479
  182. package/dist/src/commands/security.d.ts +0 -10
  183. package/dist/src/commands/security.js +0 -1012
  184. package/dist/src/commands/session.d.ts +0 -8
  185. package/dist/src/commands/session.js +0 -757
  186. package/dist/src/commands/settings.d.ts +0 -19
  187. package/dist/src/commands/settings.js +0 -180
  188. package/dist/src/commands/spinner.d.ts +0 -16
  189. package/dist/src/commands/spinner.js +0 -329
  190. package/dist/src/commands/start.d.ts +0 -8
  191. package/dist/src/commands/start.js +0 -418
  192. package/dist/src/commands/status.d.ts +0 -8
  193. package/dist/src/commands/status.js +0 -608
  194. package/dist/src/commands/swarm.d.ts +0 -8
  195. package/dist/src/commands/swarm.js +0 -891
  196. package/dist/src/commands/task.d.ts +0 -8
  197. package/dist/src/commands/task.js +0 -675
  198. package/dist/src/commands/transfer-store.d.ts +0 -13
  199. package/dist/src/commands/transfer-store.js +0 -428
  200. package/dist/src/commands/update.d.ts +0 -8
  201. package/dist/src/commands/update.js +0 -276
  202. package/dist/src/commands/verify.d.ts +0 -19
  203. package/dist/src/commands/verify.js +0 -261
  204. package/dist/src/commands/version.d.ts +0 -42
  205. package/dist/src/commands/version.js +0 -106
  206. package/dist/src/commands/workflow.d.ts +0 -8
  207. package/dist/src/commands/workflow.js +0 -617
  208. package/dist/src/config/harness-feedback-applier.d.ts +0 -50
  209. package/dist/src/config/harness-feedback-applier.js +0 -122
  210. package/dist/src/config/proven-config-refresh.d.ts +0 -39
  211. package/dist/src/config/proven-config-refresh.js +0 -154
  212. package/dist/src/config/proven-config-rvfa.d.ts +0 -23
  213. package/dist/src/config/proven-config-rvfa.js +0 -73
  214. package/dist/src/config/proven-config.d.ts +0 -86
  215. package/dist/src/config/proven-config.js +0 -176
  216. package/dist/src/config-adapter.d.ts +0 -15
  217. package/dist/src/config-adapter.js +0 -186
  218. package/dist/src/encryption/vault.d.ts +0 -94
  219. package/dist/src/encryption/vault.js +0 -172
  220. package/dist/src/fs-secure.d.ts +0 -86
  221. package/dist/src/fs-secure.js +0 -133
  222. package/dist/src/funnel/advisor-tip.d.ts +0 -58
  223. package/dist/src/funnel/advisor-tip.js +0 -92
  224. package/dist/src/funnel/attribution.d.ts +0 -37
  225. package/dist/src/funnel/attribution.js +0 -101
  226. package/dist/src/funnel/consent.d.ts +0 -22
  227. package/dist/src/funnel/consent.js +0 -58
  228. package/dist/src/funnel/credit-errors.d.ts +0 -31
  229. package/dist/src/funnel/credit-errors.js +0 -88
  230. package/dist/src/funnel/credit-notifier.d.ts +0 -44
  231. package/dist/src/funnel/credit-notifier.js +0 -74
  232. package/dist/src/funnel/disclosure.d.ts +0 -47
  233. package/dist/src/funnel/disclosure.js +0 -109
  234. package/dist/src/funnel/enrollment.d.ts +0 -36
  235. package/dist/src/funnel/enrollment.js +0 -64
  236. package/dist/src/funnel/environment.d.ts +0 -17
  237. package/dist/src/funnel/environment.js +0 -39
  238. package/dist/src/funnel/event-transport.d.ts +0 -51
  239. package/dist/src/funnel/event-transport.js +0 -199
  240. package/dist/src/funnel/events.d.ts +0 -42
  241. package/dist/src/funnel/events.js +0 -150
  242. package/dist/src/funnel/index.d.ts +0 -21
  243. package/dist/src/funnel/index.js +0 -21
  244. package/dist/src/funnel/insights.d.ts +0 -50
  245. package/dist/src/funnel/insights.js +0 -120
  246. package/dist/src/funnel/local-signals.d.ts +0 -20
  247. package/dist/src/funnel/local-signals.js +0 -77
  248. package/dist/src/funnel/message-transport.d.ts +0 -51
  249. package/dist/src/funnel/message-transport.js +0 -149
  250. package/dist/src/funnel/messages.d.ts +0 -55
  251. package/dist/src/funnel/messages.js +0 -160
  252. package/dist/src/funnel/payout.d.ts +0 -40
  253. package/dist/src/funnel/payout.js +0 -60
  254. package/dist/src/funnel/power-saver-notifier.d.ts +0 -44
  255. package/dist/src/funnel/power-saver-notifier.js +0 -92
  256. package/dist/src/funnel/precedence.d.ts +0 -16
  257. package/dist/src/funnel/precedence.js +0 -85
  258. package/dist/src/funnel/promo.d.ts +0 -41
  259. package/dist/src/funnel/promo.js +0 -144
  260. package/dist/src/funnel/rate-limit-notifier.d.ts +0 -55
  261. package/dist/src/funnel/rate-limit-notifier.js +0 -102
  262. package/dist/src/funnel/rotation.d.ts +0 -19
  263. package/dist/src/funnel/rotation.js +0 -70
  264. package/dist/src/funnel/state.d.ts +0 -13
  265. package/dist/src/funnel/state.js +0 -52
  266. package/dist/src/funnel/toggle-cooldown.d.ts +0 -17
  267. package/dist/src/funnel/toggle-cooldown.js +0 -32
  268. package/dist/src/funnel/types.d.ts +0 -98
  269. package/dist/src/funnel/types.js +0 -26
  270. package/dist/src/index.d.ts +0 -81
  271. package/dist/src/index.js +0 -609
  272. package/dist/src/infrastructure/in-memory-repositories.d.ts +0 -68
  273. package/dist/src/infrastructure/in-memory-repositories.js +0 -264
  274. package/dist/src/init/claudemd-generator.d.ts +0 -16
  275. package/dist/src/init/claudemd-generator.js +0 -368
  276. package/dist/src/init/executor.d.ts +0 -41
  277. package/dist/src/init/executor.js +0 -2142
  278. package/dist/src/init/helper-refresh.d.ts +0 -79
  279. package/dist/src/init/helper-refresh.js +0 -347
  280. package/dist/src/init/helper-signing.d.ts +0 -37
  281. package/dist/src/init/helper-signing.js +0 -67
  282. package/dist/src/init/helpers-generator.d.ts +0 -87
  283. package/dist/src/init/helpers-generator.js +0 -1456
  284. package/dist/src/init/index.d.ts +0 -13
  285. package/dist/src/init/index.js +0 -15
  286. package/dist/src/init/mcp-generator.d.ts +0 -26
  287. package/dist/src/init/mcp-generator.js +0 -126
  288. package/dist/src/init/memory-package-resolver.d.ts +0 -53
  289. package/dist/src/init/memory-package-resolver.js +0 -118
  290. package/dist/src/init/settings-generator.d.ts +0 -14
  291. package/dist/src/init/settings-generator.js +0 -462
  292. package/dist/src/init/statusline-generator.d.ts +0 -28
  293. package/dist/src/init/statusline-generator.js +0 -177
  294. package/dist/src/init/types.d.ts +0 -331
  295. package/dist/src/init/types.js +0 -276
  296. package/dist/src/log-filters.d.ts +0 -46
  297. package/dist/src/log-filters.js +0 -107
  298. package/dist/src/mcp-client.d.ts +0 -92
  299. package/dist/src/mcp-client.js +0 -397
  300. package/dist/src/mcp-server.d.ts +0 -163
  301. package/dist/src/mcp-server.js +0 -751
  302. package/dist/src/mcp-tools/agent-execute-core.d.ts +0 -115
  303. package/dist/src/mcp-tools/agent-execute-core.js +0 -587
  304. package/dist/src/mcp-tools/agent-tools.d.ts +0 -9
  305. package/dist/src/mcp-tools/agent-tools.js +0 -837
  306. package/dist/src/mcp-tools/agentbbs-tools.d.ts +0 -28
  307. package/dist/src/mcp-tools/agentbbs-tools.js +0 -394
  308. package/dist/src/mcp-tools/agentdb-tools.d.ts +0 -35
  309. package/dist/src/mcp-tools/agentdb-tools.js +0 -1473
  310. package/dist/src/mcp-tools/agenticow-loader.d.ts +0 -59
  311. package/dist/src/mcp-tools/agenticow-loader.js +0 -105
  312. package/dist/src/mcp-tools/agenticow-speculate-tools.d.ts +0 -24
  313. package/dist/src/mcp-tools/agenticow-speculate-tools.js +0 -209
  314. package/dist/src/mcp-tools/agenticow-tools.d.ts +0 -36
  315. package/dist/src/mcp-tools/agenticow-tools.js +0 -360
  316. package/dist/src/mcp-tools/analyze-tools.d.ts +0 -38
  317. package/dist/src/mcp-tools/analyze-tools.js +0 -346
  318. package/dist/src/mcp-tools/auto-install.d.ts +0 -83
  319. package/dist/src/mcp-tools/auto-install.js +0 -131
  320. package/dist/src/mcp-tools/autopilot-tools.d.ts +0 -12
  321. package/dist/src/mcp-tools/autopilot-tools.js +0 -231
  322. package/dist/src/mcp-tools/browser-intent-tools.d.ts +0 -162
  323. package/dist/src/mcp-tools/browser-intent-tools.js +0 -548
  324. package/dist/src/mcp-tools/browser-session-tools.d.ts +0 -27
  325. package/dist/src/mcp-tools/browser-session-tools.js +0 -398
  326. package/dist/src/mcp-tools/browser-tools.d.ts +0 -21
  327. package/dist/src/mcp-tools/browser-tools.js +0 -760
  328. package/dist/src/mcp-tools/business-pod-tools.d.ts +0 -20
  329. package/dist/src/mcp-tools/business-pod-tools.js +0 -169
  330. package/dist/src/mcp-tools/claims-tools.d.ts +0 -12
  331. package/dist/src/mcp-tools/claims-tools.js +0 -863
  332. package/dist/src/mcp-tools/config-tools.d.ts +0 -8
  333. package/dist/src/mcp-tools/config-tools.js +0 -411
  334. package/dist/src/mcp-tools/coordination-tools.d.ts +0 -13
  335. package/dist/src/mcp-tools/coordination-tools.js +0 -729
  336. package/dist/src/mcp-tools/daa-tools.d.ts +0 -13
  337. package/dist/src/mcp-tools/daa-tools.js +0 -534
  338. package/dist/src/mcp-tools/embeddings-tools.d.ts +0 -9
  339. package/dist/src/mcp-tools/embeddings-tools.js +0 -904
  340. package/dist/src/mcp-tools/github-tools.d.ts +0 -9
  341. package/dist/src/mcp-tools/github-tools.js +0 -659
  342. package/dist/src/mcp-tools/guidance-tools.d.ts +0 -15
  343. package/dist/src/mcp-tools/guidance-tools.js +0 -639
  344. package/dist/src/mcp-tools/hive-mind-tools.d.ts +0 -8
  345. package/dist/src/mcp-tools/hive-mind-tools.js +0 -953
  346. package/dist/src/mcp-tools/hooks-tools.d.ts +0 -65
  347. package/dist/src/mcp-tools/hooks-tools.js +0 -4836
  348. package/dist/src/mcp-tools/http-fetch-tools.d.ts +0 -55
  349. package/dist/src/mcp-tools/http-fetch-tools.js +0 -329
  350. package/dist/src/mcp-tools/index.d.ts +0 -34
  351. package/dist/src/mcp-tools/index.js +0 -40
  352. package/dist/src/mcp-tools/managed-agent-tools.d.ts +0 -22
  353. package/dist/src/mcp-tools/managed-agent-tools.js +0 -357
  354. package/dist/src/mcp-tools/memory-tools.d.ts +0 -14
  355. package/dist/src/mcp-tools/memory-tools.js +0 -1330
  356. package/dist/src/mcp-tools/metaharness-tools.d.ts +0 -51
  357. package/dist/src/mcp-tools/metaharness-tools.js +0 -684
  358. package/dist/src/mcp-tools/neural-tools.d.ts +0 -54
  359. package/dist/src/mcp-tools/neural-tools.js +0 -1168
  360. package/dist/src/mcp-tools/performance-tools.d.ts +0 -16
  361. package/dist/src/mcp-tools/performance-tools.js +0 -675
  362. package/dist/src/mcp-tools/progress-tools.d.ts +0 -14
  363. package/dist/src/mcp-tools/progress-tools.js +0 -348
  364. package/dist/src/mcp-tools/request-tracker.d.ts +0 -17
  365. package/dist/src/mcp-tools/request-tracker.js +0 -27
  366. package/dist/src/mcp-tools/ruvllm-tools.d.ts +0 -9
  367. package/dist/src/mcp-tools/ruvllm-tools.js +0 -355
  368. package/dist/src/mcp-tools/security-tools.d.ts +0 -18
  369. package/dist/src/mcp-tools/security-tools.js +0 -556
  370. package/dist/src/mcp-tools/session-tools.d.ts +0 -8
  371. package/dist/src/mcp-tools/session-tools.js +0 -517
  372. package/dist/src/mcp-tools/swarm-tools.d.ts +0 -37
  373. package/dist/src/mcp-tools/swarm-tools.js +0 -390
  374. package/dist/src/mcp-tools/system-tools.d.ts +0 -13
  375. package/dist/src/mcp-tools/system-tools.js +0 -688
  376. package/dist/src/mcp-tools/task-tools.d.ts +0 -8
  377. package/dist/src/mcp-tools/task-tools.js +0 -487
  378. package/dist/src/mcp-tools/terminal-tools.d.ts +0 -8
  379. package/dist/src/mcp-tools/terminal-tools.js +0 -306
  380. package/dist/src/mcp-tools/testgen-tools.d.ts +0 -26
  381. package/dist/src/mcp-tools/testgen-tools.js +0 -168
  382. package/dist/src/mcp-tools/tool-loop-guardrail.d.ts +0 -31
  383. package/dist/src/mcp-tools/tool-loop-guardrail.js +0 -71
  384. package/dist/src/mcp-tools/transfer-tools.d.ts +0 -14
  385. package/dist/src/mcp-tools/transfer-tools.js +0 -447
  386. package/dist/src/mcp-tools/types.d.ts +0 -8
  387. package/dist/src/mcp-tools/types.js +0 -8
  388. package/dist/src/mcp-tools/validate-input.d.ts +0 -9
  389. package/dist/src/mcp-tools/validate-input.js +0 -9
  390. package/dist/src/mcp-tools/wasm-agent-tools.d.ts +0 -13
  391. package/dist/src/mcp-tools/wasm-agent-tools.js +0 -840
  392. package/dist/src/mcp-tools/workflow-tools.d.ts +0 -8
  393. package/dist/src/mcp-tools/workflow-tools.js +0 -884
  394. package/dist/src/memory/bge-embedder.d.ts +0 -25
  395. package/dist/src/memory/bge-embedder.js +0 -121
  396. package/dist/src/memory/cross-encoder-rerank.d.ts +0 -33
  397. package/dist/src/memory/cross-encoder-rerank.js +0 -123
  398. package/dist/src/memory/embedding-policy.d.ts +0 -21
  399. package/dist/src/memory/embedding-policy.js +0 -30
  400. package/dist/src/memory/embedding-quantization.d.ts +0 -62
  401. package/dist/src/memory/embedding-quantization.js +0 -156
  402. package/dist/src/memory/ewc-consolidation.d.ts +0 -305
  403. package/dist/src/memory/ewc-consolidation.js +0 -611
  404. package/dist/src/memory/graph-edge-writer.d.ts +0 -95
  405. package/dist/src/memory/graph-edge-writer.js +0 -217
  406. package/dist/src/memory/hybrid-retrieval.d.ts +0 -77
  407. package/dist/src/memory/hybrid-retrieval.js +0 -192
  408. package/dist/src/memory/intelligence.d.ts +0 -405
  409. package/dist/src/memory/intelligence.js +0 -1316
  410. package/dist/src/memory/lucene-bm25.d.ts +0 -19
  411. package/dist/src/memory/lucene-bm25.js +0 -308
  412. package/dist/src/memory/memory-bridge.d.ts +0 -537
  413. package/dist/src/memory/memory-bridge.js +0 -2460
  414. package/dist/src/memory/memory-initializer.d.ts +0 -556
  415. package/dist/src/memory/memory-initializer.js +0 -3021
  416. package/dist/src/memory/neural-package-bridge.d.ts +0 -48
  417. package/dist/src/memory/neural-package-bridge.js +0 -87
  418. package/dist/src/memory/rabitq-index.d.ts +0 -60
  419. package/dist/src/memory/rabitq-index.js +0 -242
  420. package/dist/src/memory/sona-optimizer.d.ts +0 -267
  421. package/dist/src/memory/sona-optimizer.js +0 -779
  422. package/dist/src/memory/structured-distill.d.ts +0 -48
  423. package/dist/src/memory/structured-distill.js +0 -125
  424. package/dist/src/output.d.ts +0 -9
  425. package/dist/src/output.js +0 -9
  426. package/dist/src/parser.d.ts +0 -89
  427. package/dist/src/parser.js +0 -516
  428. package/dist/src/plugins/manager.d.ts +0 -133
  429. package/dist/src/plugins/manager.js +0 -415
  430. package/dist/src/plugins/store/discovery.d.ts +0 -99
  431. package/dist/src/plugins/store/discovery.js +0 -1224
  432. package/dist/src/plugins/store/index.d.ts +0 -76
  433. package/dist/src/plugins/store/index.js +0 -141
  434. package/dist/src/plugins/store/search.d.ts +0 -46
  435. package/dist/src/plugins/store/search.js +0 -230
  436. package/dist/src/plugins/store/types.d.ts +0 -279
  437. package/dist/src/plugins/store/types.js +0 -7
  438. package/dist/src/plugins/tests/demo-plugin-store.d.ts +0 -7
  439. package/dist/src/plugins/tests/demo-plugin-store.js +0 -126
  440. package/dist/src/plugins/tests/standalone-test.d.ts +0 -12
  441. package/dist/src/plugins/tests/standalone-test.js +0 -188
  442. package/dist/src/plugins/tests/test-plugin-store.d.ts +0 -7
  443. package/dist/src/plugins/tests/test-plugin-store.js +0 -206
  444. package/dist/src/production/circuit-breaker.d.ts +0 -101
  445. package/dist/src/production/circuit-breaker.js +0 -241
  446. package/dist/src/production/error-handler.d.ts +0 -92
  447. package/dist/src/production/error-handler.js +0 -299
  448. package/dist/src/production/index.d.ts +0 -23
  449. package/dist/src/production/index.js +0 -18
  450. package/dist/src/production/monitoring.d.ts +0 -161
  451. package/dist/src/production/monitoring.js +0 -356
  452. package/dist/src/production/rate-limiter.d.ts +0 -80
  453. package/dist/src/production/rate-limiter.js +0 -201
  454. package/dist/src/production/retry.d.ts +0 -48
  455. package/dist/src/production/retry.js +0 -179
  456. package/dist/src/prompt.d.ts +0 -44
  457. package/dist/src/prompt.js +0 -501
  458. package/dist/src/runtime/headless.d.ts +0 -60
  459. package/dist/src/runtime/headless.js +0 -284
  460. package/dist/src/runtime/parent-death-watchdog.d.ts +0 -42
  461. package/dist/src/runtime/parent-death-watchdog.js +0 -70
  462. package/dist/src/ruvector/agent-wasm.d.ts +0 -228
  463. package/dist/src/ruvector/agent-wasm.js +0 -463
  464. package/dist/src/ruvector/ast-analyzer.d.ts +0 -67
  465. package/dist/src/ruvector/ast-analyzer.js +0 -277
  466. package/dist/src/ruvector/codemods/engine.d.ts +0 -45
  467. package/dist/src/ruvector/codemods/engine.js +0 -291
  468. package/dist/src/ruvector/codemods/scope-analysis.d.ts +0 -29
  469. package/dist/src/ruvector/codemods/scope-analysis.js +0 -162
  470. package/dist/src/ruvector/coverage-router.d.ts +0 -160
  471. package/dist/src/ruvector/coverage-router.js +0 -531
  472. package/dist/src/ruvector/coverage-tools.d.ts +0 -33
  473. package/dist/src/ruvector/coverage-tools.js +0 -157
  474. package/dist/src/ruvector/diff-classifier.d.ts +0 -175
  475. package/dist/src/ruvector/diff-classifier.js +0 -699
  476. package/dist/src/ruvector/diskann-backend.d.ts +0 -78
  477. package/dist/src/ruvector/diskann-backend.js +0 -310
  478. package/dist/src/ruvector/enhanced-model-router.d.ts +0 -172
  479. package/dist/src/ruvector/enhanced-model-router.js +0 -577
  480. package/dist/src/ruvector/graph-analyzer.d.ts +0 -187
  481. package/dist/src/ruvector/graph-analyzer.js +0 -929
  482. package/dist/src/ruvector/graph-backend.d.ts +0 -79
  483. package/dist/src/ruvector/graph-backend.js +0 -220
  484. package/dist/src/ruvector/index.d.ts +0 -38
  485. package/dist/src/ruvector/index.js +0 -86
  486. package/dist/src/ruvector/lora-adapter.d.ts +0 -292
  487. package/dist/src/ruvector/lora-adapter.js +0 -710
  488. package/dist/src/ruvector/model-prices.d.ts +0 -50
  489. package/dist/src/ruvector/model-prices.js +0 -72
  490. package/dist/src/ruvector/model-router.d.ts +0 -408
  491. package/dist/src/ruvector/model-router.js +0 -1162
  492. package/dist/src/ruvector/neural-router.d.ts +0 -182
  493. package/dist/src/ruvector/neural-router.js +0 -825
  494. package/dist/src/ruvector/output-verifier.d.ts +0 -83
  495. package/dist/src/ruvector/output-verifier.js +0 -277
  496. package/dist/src/ruvector/q-learning-router.d.ts +0 -227
  497. package/dist/src/ruvector/q-learning-router.js +0 -721
  498. package/dist/src/ruvector/router-calibrator.d.ts +0 -65
  499. package/dist/src/ruvector/router-calibrator.js +0 -120
  500. package/dist/src/ruvector/router-parallel-recorder.d.ts +0 -127
  501. package/dist/src/ruvector/router-parallel-recorder.js +0 -183
  502. package/dist/src/ruvector/router-trajectory.d.ts +0 -194
  503. package/dist/src/ruvector/router-trajectory.js +0 -281
  504. package/dist/src/ruvector/run-transcript-recorder.d.ts +0 -154
  505. package/dist/src/ruvector/run-transcript-recorder.js +0 -209
  506. package/dist/src/ruvector/ruvllm-wasm.d.ts +0 -179
  507. package/dist/src/ruvector/ruvllm-wasm.js +0 -379
  508. package/dist/src/ruvector/semantic-router.d.ts +0 -77
  509. package/dist/src/ruvector/semantic-router.js +0 -178
  510. package/dist/src/ruvector/task-embedder.d.ts +0 -56
  511. package/dist/src/ruvector/task-embedder.js +0 -237
  512. package/dist/src/ruvector/trajectory-tree.d.ts +0 -113
  513. package/dist/src/ruvector/trajectory-tree.js +0 -237
  514. package/dist/src/ruvector/vector-db.d.ts +0 -73
  515. package/dist/src/ruvector/vector-db.js +0 -301
  516. package/dist/src/ruvector/wasm-embedder.d.ts +0 -13
  517. package/dist/src/ruvector/wasm-embedder.js +0 -143
  518. package/dist/src/security/builtin-aidefence.d.ts +0 -34
  519. package/dist/src/security/builtin-aidefence.js +0 -86
  520. package/dist/src/services/agentic-flow-bridge.d.ts +0 -50
  521. package/dist/src/services/agentic-flow-bridge.js +0 -95
  522. package/dist/src/services/ai-job-dedup.d.ts +0 -61
  523. package/dist/src/services/ai-job-dedup.js +0 -136
  524. package/dist/src/services/checkpoint-gate.d.ts +0 -140
  525. package/dist/src/services/checkpoint-gate.js +0 -223
  526. package/dist/src/services/claim-service.d.ts +0 -204
  527. package/dist/src/services/claim-service.js +0 -818
  528. package/dist/src/services/config-file-manager.d.ts +0 -37
  529. package/dist/src/services/config-file-manager.js +0 -224
  530. package/dist/src/services/container-worker-pool.d.ts +0 -204
  531. package/dist/src/services/container-worker-pool.js +0 -589
  532. package/dist/src/services/daemon-autostart.d.ts +0 -17
  533. package/dist/src/services/daemon-autostart.js +0 -102
  534. package/dist/src/services/distill-oracle.d.ts +0 -190
  535. package/dist/src/services/distill-oracle.js +0 -349
  536. package/dist/src/services/distill-tuning.d.ts +0 -111
  537. package/dist/src/services/distill-tuning.js +0 -510
  538. package/dist/src/services/evolve-proof.d.ts +0 -253
  539. package/dist/src/services/evolve-proof.js +0 -343
  540. package/dist/src/services/fable-harness.d.ts +0 -208
  541. package/dist/src/services/fable-harness.js +0 -388
  542. package/dist/src/services/git-workspace-identity.d.ts +0 -42
  543. package/dist/src/services/git-workspace-identity.js +0 -99
  544. package/dist/src/services/global-ai-budget.d.ts +0 -135
  545. package/dist/src/services/global-ai-budget.js +0 -415
  546. package/dist/src/services/harness-benchmark.d.ts +0 -68
  547. package/dist/src/services/harness-benchmark.js +0 -94
  548. package/dist/src/services/harness-canary.d.ts +0 -60
  549. package/dist/src/services/harness-canary.js +0 -69
  550. package/dist/src/services/harness-corpus-harvester.d.ts +0 -51
  551. package/dist/src/services/harness-corpus-harvester.js +0 -74
  552. package/dist/src/services/harness-flywheel-generations.d.ts +0 -115
  553. package/dist/src/services/harness-flywheel-generations.js +0 -360
  554. package/dist/src/services/harness-flywheel-runtime.d.ts +0 -25
  555. package/dist/src/services/harness-flywheel-runtime.js +0 -92
  556. package/dist/src/services/harness-flywheel.d.ts +0 -48
  557. package/dist/src/services/harness-flywheel.js +0 -207
  558. package/dist/src/services/harness-frozen-eval.d.ts +0 -22
  559. package/dist/src/services/harness-frozen-eval.js +0 -66
  560. package/dist/src/services/harness-hosts.d.ts +0 -40
  561. package/dist/src/services/harness-hosts.js +0 -88
  562. package/dist/src/services/harness-improvement-ledger.d.ts +0 -63
  563. package/dist/src/services/harness-improvement-ledger.js +0 -101
  564. package/dist/src/services/harness-loop.d.ts +0 -53
  565. package/dist/src/services/harness-loop.js +0 -85
  566. package/dist/src/services/harness-qualification.d.ts +0 -66
  567. package/dist/src/services/harness-qualification.js +0 -143
  568. package/dist/src/services/harness-replay.d.ts +0 -37
  569. package/dist/src/services/harness-replay.js +0 -92
  570. package/dist/src/services/harness-verify.d.ts +0 -33
  571. package/dist/src/services/harness-verify.js +0 -26
  572. package/dist/src/services/harness-worker.d.ts +0 -23
  573. package/dist/src/services/harness-worker.js +0 -66
  574. package/dist/src/services/headless-worker-executor.d.ts +0 -358
  575. package/dist/src/services/headless-worker-executor.js +0 -1269
  576. package/dist/src/services/index.d.ts +0 -13
  577. package/dist/src/services/index.js +0 -11
  578. package/dist/src/services/memory-backup.d.ts +0 -53
  579. package/dist/src/services/memory-backup.js +0 -198
  580. package/dist/src/services/memory-distillation.d.ts +0 -41
  581. package/dist/src/services/memory-distillation.js +0 -277
  582. package/dist/src/services/native-training.d.ts +0 -68
  583. package/dist/src/services/native-training.js +0 -141
  584. package/dist/src/services/registry-api.d.ts +0 -58
  585. package/dist/src/services/registry-api.js +0 -146
  586. package/dist/src/services/repo-supervisor.d.ts +0 -70
  587. package/dist/src/services/repo-supervisor.js +0 -228
  588. package/dist/src/services/ruvector-training.d.ts +0 -222
  589. package/dist/src/services/ruvector-training.js +0 -693
  590. package/dist/src/services/swarm-memory-branches.d.ts +0 -135
  591. package/dist/src/services/swarm-memory-branches.js +0 -213
  592. package/dist/src/services/weight-eft.d.ts +0 -305
  593. package/dist/src/services/weight-eft.js +0 -296
  594. package/dist/src/services/worker-daemon.d.ts +0 -439
  595. package/dist/src/services/worker-daemon.js +0 -1865
  596. package/dist/src/services/worker-queue.d.ts +0 -194
  597. package/dist/src/services/worker-queue.js +0 -513
  598. package/dist/src/services/workspace-lease.d.ts +0 -55
  599. package/dist/src/services/workspace-lease.js +0 -191
  600. package/dist/src/suggest.d.ts +0 -53
  601. package/dist/src/suggest.js +0 -200
  602. package/dist/src/transfer/anonymization/index.d.ts +0 -25
  603. package/dist/src/transfer/anonymization/index.js +0 -175
  604. package/dist/src/transfer/deploy-seraphine.d.ts +0 -13
  605. package/dist/src/transfer/deploy-seraphine.js +0 -205
  606. package/dist/src/transfer/export.d.ts +0 -25
  607. package/dist/src/transfer/export.js +0 -113
  608. package/dist/src/transfer/index.d.ts +0 -12
  609. package/dist/src/transfer/index.js +0 -31
  610. package/dist/src/transfer/ipfs/client.d.ts +0 -109
  611. package/dist/src/transfer/ipfs/client.js +0 -307
  612. package/dist/src/transfer/ipfs/upload.d.ts +0 -95
  613. package/dist/src/transfer/ipfs/upload.js +0 -413
  614. package/dist/src/transfer/models/seraphine.d.ts +0 -72
  615. package/dist/src/transfer/models/seraphine.js +0 -373
  616. package/dist/src/transfer/serialization/cfp.d.ts +0 -49
  617. package/dist/src/transfer/serialization/cfp.js +0 -183
  618. package/dist/src/transfer/storage/gcs.d.ts +0 -82
  619. package/dist/src/transfer/storage/gcs.js +0 -272
  620. package/dist/src/transfer/storage/index.d.ts +0 -6
  621. package/dist/src/transfer/storage/index.js +0 -6
  622. package/dist/src/transfer/store/discovery.d.ts +0 -84
  623. package/dist/src/transfer/store/discovery.js +0 -382
  624. package/dist/src/transfer/store/download.d.ts +0 -70
  625. package/dist/src/transfer/store/download.js +0 -334
  626. package/dist/src/transfer/store/index.d.ts +0 -84
  627. package/dist/src/transfer/store/index.js +0 -153
  628. package/dist/src/transfer/store/publish.d.ts +0 -76
  629. package/dist/src/transfer/store/publish.js +0 -294
  630. package/dist/src/transfer/store/registry.d.ts +0 -58
  631. package/dist/src/transfer/store/registry.js +0 -285
  632. package/dist/src/transfer/store/search.d.ts +0 -54
  633. package/dist/src/transfer/store/search.js +0 -232
  634. package/dist/src/transfer/store/tests/standalone-test.d.ts +0 -12
  635. package/dist/src/transfer/store/tests/standalone-test.js +0 -190
  636. package/dist/src/transfer/store/types.d.ts +0 -193
  637. package/dist/src/transfer/store/types.js +0 -6
  638. package/dist/src/transfer/test-seraphine.d.ts +0 -6
  639. package/dist/src/transfer/test-seraphine.js +0 -105
  640. package/dist/src/transfer/tests/test-store.d.ts +0 -7
  641. package/dist/src/transfer/tests/test-store.js +0 -214
  642. package/dist/src/transfer/types.d.ts +0 -245
  643. package/dist/src/transfer/types.js +0 -6
  644. package/dist/src/types.d.ts +0 -13
  645. package/dist/src/types.js +0 -13
  646. package/dist/src/update/checker.d.ts +0 -34
  647. package/dist/src/update/checker.js +0 -191
  648. package/dist/src/update/executor.d.ts +0 -33
  649. package/dist/src/update/executor.js +0 -217
  650. package/dist/src/update/index.d.ts +0 -33
  651. package/dist/src/update/index.js +0 -64
  652. package/dist/src/update/rate-limiter.d.ts +0 -20
  653. package/dist/src/update/rate-limiter.js +0 -96
  654. package/dist/src/update/validator.d.ts +0 -17
  655. package/dist/src/update/validator.js +0 -123
@@ -1,1319 +0,0 @@
1
- /**
2
- * V3 CLI Hive Mind Command
3
- * Queen-led consensus-based multi-agent coordination
4
- *
5
- * Updated to support --claude flag for launching interactive Claude Code sessions
6
- * PR: Fix #955 - Implement --claude flag for hive-mind spawn command
7
- */
8
- import { output } from '../output.js';
9
- import { select, confirm, input } from '../prompt.js';
10
- import { callMCPTool, MCPClientError } from '../mcp-client.js';
11
- import { spawn as childSpawn, execSync } from 'child_process';
12
- import { mkdir, writeFile } from 'fs/promises';
13
- import { existsSync } from 'fs';
14
- import { join } from 'path';
15
- // Hive topologies
16
- const TOPOLOGIES = [
17
- { value: 'hierarchical', label: 'Hierarchical', hint: 'Queen-led with worker agents' },
18
- { value: 'mesh', label: 'Mesh', hint: 'Peer-to-peer coordination' },
19
- { value: 'hierarchical-mesh', label: 'Hierarchical Mesh', hint: 'Queen + peer communication (recommended)' },
20
- { value: 'adaptive', label: 'Adaptive', hint: 'Dynamic topology based on task' }
21
- ];
22
- // Consensus strategies
23
- const CONSENSUS_STRATEGIES = [
24
- { value: 'byzantine', label: 'Byzantine Fault Tolerant', hint: '2/3 majority, handles malicious actors' },
25
- { value: 'raft', label: 'Raft', hint: 'Leader-based consensus' },
26
- { value: 'gossip', label: 'Gossip', hint: 'Eventually consistent, scalable' },
27
- { value: 'crdt', label: 'CRDT', hint: 'Conflict-free replicated data' },
28
- { value: 'quorum', label: 'Quorum', hint: 'Simple majority voting' }
29
- ];
30
- /**
31
- * Group workers by their type for prompt generation
32
- */
33
- function groupWorkersByType(workers) {
34
- const groups = {};
35
- for (const worker of workers) {
36
- const type = worker.type || worker.role || 'worker';
37
- if (!groups[type]) {
38
- groups[type] = [];
39
- }
40
- groups[type].push(worker);
41
- }
42
- return groups;
43
- }
44
- /**
45
- * Generate comprehensive Hive Mind prompt for Claude Code
46
- * Ported from v2.7.47 with enhancements for v3
47
- */
48
- function generateHiveMindPrompt(swarmId, swarmName, objective, workers, workerGroups, flags) {
49
- const currentTime = new Date().toISOString();
50
- const workerTypes = Object.keys(workerGroups);
51
- const queenType = flags.queenType || 'strategic';
52
- const consensusAlgorithm = flags.consensus || 'byzantine';
53
- const topology = flags.topology || 'hierarchical-mesh';
54
- return `🧠 HIVE MIND COLLECTIVE INTELLIGENCE SYSTEM
55
- ═══════════════════════════════════════════════
56
-
57
- You are the Queen coordinator of a Hive Mind swarm with collective intelligence capabilities.
58
-
59
- HIVE MIND CONFIGURATION:
60
- 📌 Swarm ID: ${swarmId}
61
- 📌 Swarm Name: ${swarmName}
62
- 🎯 Objective: ${objective}
63
- 👑 Queen Type: ${queenType}
64
- 🐝 Worker Count: ${workers.length}
65
- 🔗 Topology: ${topology}
66
- 🤝 Consensus Algorithm: ${consensusAlgorithm}
67
- ⏰ Initialized: ${currentTime}
68
-
69
- WORKER DISTRIBUTION:
70
- ${workerTypes.map(type => `• ${type}: ${workerGroups[type].length} agents`).join('\n')}
71
-
72
- 🔧 AVAILABLE MCP TOOLS FOR HIVE MIND COORDINATION:
73
-
74
- 1️⃣ **COLLECTIVE INTELLIGENCE**
75
- mcp__ruflo__hive-mind_consensus - Democratic decision making
76
- mcp__ruflo__hive-mind_memory - Share knowledge across the hive
77
- mcp__ruflo__hive-mind_broadcast - Broadcast to all workers
78
- mcp__ruflo__neural_patterns - Neural pattern recognition
79
-
80
- 2️⃣ **QUEEN COORDINATION**
81
- mcp__ruflo__hive-mind_status - Monitor swarm health
82
- mcp__ruflo__task_create - Create and delegate tasks
83
- mcp__ruflo__coordination_orchestrate - Orchestrate task distribution
84
- mcp__ruflo__agent_spawn - Spawn additional workers
85
-
86
- 3️⃣ **WORKER MANAGEMENT**
87
- mcp__ruflo__agent_list - List all active agents
88
- mcp__ruflo__agent_status - Check agent status
89
- mcp__ruflo__agent_health - Check worker health
90
- mcp__ruflo__hive-mind_join - Add agent to hive
91
- mcp__ruflo__hive-mind_leave - Remove agent from hive
92
-
93
- 4️⃣ **TASK ORCHESTRATION**
94
- mcp__ruflo__task_assign - Assign tasks to workers
95
- mcp__ruflo__task_status - Track task progress
96
- mcp__ruflo__task_complete - Mark tasks complete
97
- mcp__ruflo__workflow_create - Create workflows
98
-
99
- 5️⃣ **MEMORY & LEARNING**
100
- mcp__ruflo__memory_store - Store collective knowledge
101
- mcp__ruflo__memory_retrieve - Access shared memory
102
- mcp__ruflo__memory_search - Search memory patterns
103
- mcp__ruflo__neural_train - Learn from experiences
104
- mcp__ruflo__hooks_intelligence_pattern-store - Store patterns
105
-
106
- 📋 HIVE MIND EXECUTION PROTOCOL:
107
-
108
- 1. **INITIALIZATION PHASE**
109
- - Verify all workers are online and responsive
110
- - Establish communication channels
111
- - Load previous session state if available
112
- - Initialize shared memory space
113
-
114
- 2. **TASK DISTRIBUTION PHASE**
115
- - Analyze the objective and decompose into subtasks
116
- - Assign tasks based on worker specializations
117
- - Set up task dependencies and ordering
118
- - Monitor parallel execution
119
-
120
- 3. **COORDINATION PHASE**
121
- - Use consensus for critical decisions
122
- - Aggregate results from workers
123
- - Resolve conflicts using ${consensusAlgorithm} consensus
124
- - Share learnings across the hive
125
-
126
- 4. **COMPLETION PHASE**
127
- - Verify all subtasks are complete
128
- - Consolidate results
129
- - Store learnings in collective memory
130
- - Report final status
131
-
132
- 🎯 YOUR OBJECTIVE:
133
- ${objective}
134
-
135
- ⚠️ CRITICAL — TOOL PREFERENCE RULES (#1422):
136
- • You MUST use Ruflo MCP tools (mcp__ruflo__*) for ALL orchestration tasks
137
- • Do NOT use Claude native Task/Agent tools for swarm coordination — use mcp__ruflo__agent_spawn, mcp__ruflo__task_assign, etc.
138
- • Native Claude tools (Read, Write, Edit, Bash, Grep, Glob) should ONLY be used for file operations and shell commands
139
- • All agent spawning, task assignment, memory, and coordination MUST go through mcp__ruflo__* tools
140
- • If a Ruflo MCP tool exists for an operation, always prefer it over any native equivalent
141
-
142
- 💡 COORDINATION TIPS:
143
- • Use mcp__ruflo__hive-mind_broadcast for swarm-wide announcements
144
- • Check worker status regularly with mcp__ruflo__hive-mind_status
145
- • Store important decisions in shared memory for persistence
146
- • Use consensus for any decisions affecting multiple workers
147
- • Use mcp__ruflo__task_assign to assign tasks to workers, then mcp__ruflo__task_complete when done
148
-
149
- 🚀 BEGIN HIVE MIND COORDINATION NOW!
150
- Start by checking the current hive status and then proceed with the objective.
151
- `;
152
- }
153
- /**
154
- * Spawn Claude Code with Hive Mind coordination instructions
155
- * Ported from v2.7.47 spawnClaudeCodeInstances function
156
- */
157
- async function spawnClaudeCodeInstance(swarmId, swarmName, objective, workers, flags) {
158
- output.writeln();
159
- output.writeln(output.bold('🚀 Launching Claude Code with Hive Mind Coordination'));
160
- output.writeln(output.dim('─'.repeat(60)));
161
- const spinner = output.createSpinner({ text: 'Preparing Hive Mind coordination prompt...', spinner: 'dots' });
162
- spinner.start();
163
- try {
164
- // Generate comprehensive Hive Mind prompt
165
- const workerGroups = groupWorkersByType(workers);
166
- const hiveMindPrompt = generateHiveMindPrompt(swarmId, swarmName, objective, workers, workerGroups, flags);
167
- spinner.succeed('Hive Mind coordination prompt ready!');
168
- // Display coordination summary
169
- output.writeln();
170
- output.writeln(output.bold('🧠 Hive Mind Configuration'));
171
- output.writeln(output.dim('─'.repeat(60)));
172
- output.printList([
173
- `Swarm ID: ${output.highlight(swarmId)}`,
174
- `Objective: ${output.highlight(objective)}`,
175
- `Queen Type: ${output.highlight(flags.queenType || 'strategic')}`,
176
- `Worker Count: ${output.highlight(String(workers.length))}`,
177
- `Worker Types: ${output.highlight(Object.keys(workerGroups).join(', '))}`,
178
- `Consensus: ${output.highlight(flags.consensus || 'byzantine')}`,
179
- `MCP Tools: ${output.success('Full Claude-Flow integration enabled')}`
180
- ]);
181
- // Ensure sessions directory exists
182
- const sessionsDir = join('.hive-mind', 'sessions');
183
- await mkdir(sessionsDir, { recursive: true });
184
- const promptFile = join(sessionsDir, `hive-mind-prompt-${swarmId}.txt`);
185
- await writeFile(promptFile, hiveMindPrompt, 'utf8');
186
- output.writeln();
187
- output.printSuccess(`Hive Mind prompt saved to: ${promptFile}`);
188
- // Check if claude command exists
189
- let claudeAvailable = false;
190
- try {
191
- execSync('which claude', { stdio: 'ignore' });
192
- claudeAvailable = true;
193
- }
194
- catch {
195
- output.writeln();
196
- output.printWarning('Claude Code CLI not found in PATH');
197
- output.writeln(output.dim('Install it with: npm install -g @anthropic-ai/claude-code'));
198
- output.writeln(output.dim('Falling back to displaying instructions...'));
199
- }
200
- const dryRun = flags.dryRun || flags['dry-run'];
201
- if (claudeAvailable && !dryRun) {
202
- // Build arguments - flags first, then prompt
203
- const claudeArgs = [];
204
- // #1748 Issue 2 — pass --mcp-config so the spawned worker actually has
205
- // mcp__ruflo__* tools registered. Before this, the coordination prompt
206
- // referenced tools the worker didn't know about and exited silently.
207
- // Resolution order:
208
- // 1. explicit --mcp-config <path> flag passed by the caller
209
- // 2. ./.mcp.json in cwd (project-local Ruflo MCP config)
210
- // 3. ~/.claude.json or ~/.claude/mcp.json (user-global)
211
- // If none found, we still spawn but warn — that's the pre-fix behavior
212
- // and the user's debug log will surface the missing tools.
213
- const explicitMcpConfig = flags['mcp-config'];
214
- let mcpConfigPath = explicitMcpConfig;
215
- if (!mcpConfigPath) {
216
- const candidates = [
217
- join(process.cwd(), '.mcp.json'),
218
- join(process.env.HOME || process.env.USERPROFILE || '', '.claude.json'),
219
- join(process.env.HOME || process.env.USERPROFILE || '', '.claude', 'mcp.json'),
220
- ];
221
- for (const c of candidates) {
222
- try {
223
- if (c && existsSync(c)) {
224
- mcpConfigPath = c;
225
- break;
226
- }
227
- }
228
- catch { /* continue */ }
229
- }
230
- }
231
- if (mcpConfigPath) {
232
- // #1780 — Claude Code's `--mcp-config` is variadic; passing it as two
233
- // argv tokens (`--mcp-config`, `<path>`) lets a later positional (the
234
- // hive-mind prompt) be slurped as a second config file, producing
235
- // `ENAMETOOLONG: name too long, open` once the prompt exceeds PATH_MAX.
236
- // Use `=`-syntax so the flag stays attached to its single value.
237
- claudeArgs.push(`--mcp-config=${mcpConfigPath}`);
238
- output.printInfo(`Spawned worker MCP config: ${mcpConfigPath}`);
239
- }
240
- else {
241
- output.printWarning('No .mcp.json or ~/.claude.json found — spawned worker will not have mcp__ruflo__* tools (#1748 Issue 2). Pass --mcp-config <path> or run "ruflo init" to generate one.');
242
- }
243
- // Check for non-interactive mode
244
- const isNonInteractive = flags['non-interactive'] || flags.nonInteractive;
245
- if (isNonInteractive) {
246
- claudeArgs.push('-p'); // Print mode
247
- claudeArgs.push('--output-format', 'stream-json');
248
- claudeArgs.push('--verbose');
249
- output.printInfo('Running in non-interactive mode');
250
- }
251
- // HIGH-02: Strict boolean check (=== true) instead of loose truthiness (!== false)
252
- // to prevent undefined/null from being treated as "skip permissions".
253
- // Behavior change: only explicit --dangerously-skip-permissions flag triggers skip.
254
- // #2269: the arg parser normalizes kebab-case to camelCase (parser.ts:350,
255
- // normalizeKey) and stores only the normalized key, so reading
256
- // flags['dangerously-skip-permissions'] alone is always undefined. Accept
257
- // both forms — mirroring the isNonInteractive pattern a few lines above.
258
- // The deny clause must ALSO accept the yargs-style negation the parser
259
- // produces for `--no-auto-permissions` (stored as `autoPermissions: false`,
260
- // NOT `noAutoPermissions: true`); without this third clause, the deny half
261
- // never fires and `--no-auto-permissions` is silently ignored.
262
- const skipPermissions = (flags['dangerously-skip-permissions'] === true || flags.dangerouslySkipPermissions === true) &&
263
- !(flags['no-auto-permissions'] || flags.noAutoPermissions || flags.autoPermissions === false);
264
- if (skipPermissions) {
265
- claudeArgs.push('--dangerously-skip-permissions');
266
- if (!isNonInteractive) {
267
- output.printWarning('Using --dangerously-skip-permissions for seamless hive-mind execution');
268
- }
269
- }
270
- // Add the prompt as the LAST argument
271
- claudeArgs.push(hiveMindPrompt);
272
- output.writeln();
273
- output.printInfo('Launching Claude Code...');
274
- output.writeln(output.dim('Press Ctrl+C to pause the session'));
275
- // Spawn claude with properly ordered arguments
276
- const claudeProcess = childSpawn('claude', claudeArgs, {
277
- stdio: 'inherit',
278
- shell: false,
279
- });
280
- // Set up SIGINT handler for session management
281
- let isExiting = false;
282
- const sigintHandler = () => {
283
- if (isExiting)
284
- return;
285
- isExiting = true;
286
- output.writeln();
287
- output.writeln();
288
- output.printWarning('Pausing session and terminating Claude Code...');
289
- if (claudeProcess && !claudeProcess.killed) {
290
- claudeProcess.kill('SIGTERM');
291
- }
292
- output.writeln();
293
- output.printSuccess('Session paused');
294
- output.writeln(output.dim(`Prompt file saved at: ${promptFile}`));
295
- output.writeln(output.dim('To resume, run claude with the saved prompt file'));
296
- process.exit(0);
297
- };
298
- process.on('SIGINT', sigintHandler);
299
- process.on('SIGTERM', sigintHandler);
300
- // Handle process exit
301
- claudeProcess.on('exit', (code) => {
302
- // Clean up signal handlers
303
- process.removeListener('SIGINT', sigintHandler);
304
- process.removeListener('SIGTERM', sigintHandler);
305
- if (code === 0) {
306
- output.writeln();
307
- output.printSuccess('Claude Code completed successfully');
308
- }
309
- else if (code !== null) {
310
- output.writeln();
311
- output.printError(`Claude Code exited with code ${code}`);
312
- }
313
- });
314
- output.writeln();
315
- output.printSuccess('Claude Code launched with Hive Mind coordination');
316
- output.printInfo('The Queen coordinator will orchestrate all worker agents');
317
- output.writeln(output.dim(`Prompt file saved at: ${promptFile}`));
318
- // #2297: await child exit before returning. Without this, the CLI
319
- // process resolves immediately, finishes, and the still-initializing
320
- // `claude` child loses its controlling terminal and is killed mid-launch
321
- // — visible as a stray XTVERSION reply leaking onto the next shell
322
- // prompt (the terminal queried for capabilities, but the child died
323
- // before reading the answer). Awaiting also makes the existing
324
- // claudeProcess.on('exit', ...) log lines actually print, and lets the
325
- // non-interactive (-p / --non-interactive) path complete only after
326
- // Claude Code finishes.
327
- const claudeExitCode = await new Promise((resolve) => {
328
- claudeProcess.on('exit', (c) => resolve(c ?? 0));
329
- claudeProcess.on('error', () => resolve(1));
330
- });
331
- return { success: claudeExitCode === 0, promptFile };
332
- }
333
- else if (dryRun) {
334
- output.writeln();
335
- output.printInfo('Dry run - would execute Claude Code with prompt:');
336
- output.writeln(output.dim(`Prompt length: ${hiveMindPrompt.length} characters`));
337
- output.writeln();
338
- output.writeln(output.dim('First 500 characters of prompt:'));
339
- output.writeln(output.highlight(hiveMindPrompt.substring(0, 500) + '...'));
340
- output.writeln();
341
- output.writeln(output.dim(`Full prompt saved to: ${promptFile}`));
342
- return { success: true, promptFile };
343
- }
344
- else {
345
- // Claude not available - show instructions
346
- output.writeln();
347
- output.writeln(output.bold('📋 Manual Execution Instructions:'));
348
- output.writeln(output.dim('─'.repeat(50)));
349
- output.printList([
350
- 'Install Claude Code: npm install -g @anthropic-ai/claude-code',
351
- `Run with saved prompt: claude < ${promptFile}`,
352
- `Or copy manually: cat ${promptFile} | claude`,
353
- `With auto-permissions: claude --dangerously-skip-permissions < ${promptFile}`
354
- ]);
355
- return { success: true, promptFile };
356
- }
357
- }
358
- catch (error) {
359
- spinner.fail('Failed to prepare Claude Code coordination');
360
- const errorMessage = error instanceof Error ? error.message : String(error);
361
- output.printError(`Error: ${errorMessage}`);
362
- // Try to save prompt as fallback
363
- try {
364
- const promptFile = `hive-mind-prompt-${swarmId}-fallback.txt`;
365
- const workerGroups = groupWorkersByType(workers);
366
- const hiveMindPrompt = generateHiveMindPrompt(swarmId, swarmName, objective, workers, workerGroups, flags);
367
- await writeFile(promptFile, hiveMindPrompt, 'utf8');
368
- output.writeln();
369
- output.printSuccess(`Prompt saved to: ${promptFile}`);
370
- output.writeln(output.dim('You can run Claude Code manually with the saved prompt'));
371
- return { success: false, promptFile, error: errorMessage };
372
- }
373
- catch {
374
- return { success: false, error: errorMessage };
375
- }
376
- }
377
- }
378
- // Init subcommand
379
- const initCommand = {
380
- name: 'init',
381
- description: 'Initialize a hive mind',
382
- options: [
383
- {
384
- name: 'topology',
385
- short: 't',
386
- description: 'Hive topology',
387
- type: 'string',
388
- choices: TOPOLOGIES.map(t => t.value),
389
- default: 'hierarchical-mesh'
390
- },
391
- {
392
- name: 'consensus',
393
- short: 'c',
394
- description: 'Consensus strategy',
395
- type: 'string',
396
- choices: CONSENSUS_STRATEGIES.map(s => s.value),
397
- default: 'byzantine'
398
- },
399
- {
400
- name: 'max-agents',
401
- short: 'm',
402
- description: 'Maximum agents',
403
- type: 'number',
404
- default: 15
405
- },
406
- {
407
- name: 'persist',
408
- short: 'p',
409
- description: 'Enable persistent state',
410
- type: 'boolean',
411
- default: true
412
- },
413
- {
414
- name: 'memory-backend',
415
- description: 'Memory backend (agentdb, sqlite, hybrid)',
416
- type: 'string',
417
- default: 'hybrid'
418
- }
419
- ],
420
- examples: [
421
- { command: 'claude-flow hive-mind init -t hierarchical-mesh', description: 'Init hierarchical mesh' },
422
- { command: 'claude-flow hive-mind init -c byzantine -m 20', description: 'Init with Byzantine consensus' }
423
- ],
424
- action: async (ctx) => {
425
- let topology = ctx.flags.topology;
426
- let consensus = ctx.flags.consensus;
427
- if (ctx.interactive && !ctx.flags.topology) {
428
- topology = await select({
429
- message: 'Select hive topology:',
430
- options: TOPOLOGIES,
431
- default: 'hierarchical-mesh'
432
- });
433
- }
434
- if (ctx.interactive && !ctx.flags.consensus) {
435
- consensus = await select({
436
- message: 'Select consensus strategy:',
437
- options: CONSENSUS_STRATEGIES,
438
- default: 'byzantine'
439
- });
440
- }
441
- const config = {
442
- topology: topology || 'hierarchical-mesh',
443
- consensus: consensus || 'byzantine',
444
- maxAgents: ctx.flags.maxAgents || 15,
445
- persist: ctx.flags.persist,
446
- memoryBackend: ctx.flags.memoryBackend || 'hybrid'
447
- };
448
- output.writeln();
449
- output.writeln(output.bold('Initializing Hive Mind'));
450
- const spinner = output.createSpinner({ text: 'Setting up hive infrastructure...', spinner: 'dots' });
451
- spinner.start();
452
- try {
453
- const result = await callMCPTool('hive-mind_init', config);
454
- spinner.succeed('Hive Mind initialized');
455
- if (ctx.flags.format === 'json') {
456
- output.printJson(result);
457
- return { success: true, data: result };
458
- }
459
- output.writeln();
460
- output.printBox([
461
- `Hive ID: ${result.hiveId ?? 'default'}`,
462
- `Queen ID: ${result.queenId ?? 'N/A'}`,
463
- `Topology: ${result.topology ?? config.topology}`,
464
- `Consensus: ${result.consensus ?? config.consensus}`,
465
- `Max Agents: ${config.maxAgents}`,
466
- `Memory: ${config.memoryBackend}`,
467
- `Status: ${output.success(result.status ?? 'initialized')}`
468
- ].join('\n'), 'Hive Mind Configuration');
469
- output.writeln();
470
- output.printInfo('Queen agent is ready to coordinate worker agents');
471
- output.writeln(output.dim(' Use "claude-flow hive-mind spawn" to add workers'));
472
- output.writeln(output.dim(' Use "claude-flow hive-mind spawn --claude" to launch Claude Code'));
473
- return { success: true, data: result };
474
- }
475
- catch (error) {
476
- spinner.fail('Failed to initialize');
477
- if (error instanceof MCPClientError) {
478
- output.printError(`Init error: ${error.message}`);
479
- }
480
- else {
481
- output.printError(`Unexpected error: ${String(error)}`);
482
- }
483
- return { success: false, exitCode: 1 };
484
- }
485
- }
486
- };
487
- // Spawn subcommand - UPDATED with --claude flag
488
- const spawnCommand = {
489
- name: 'spawn',
490
- description: 'Spawn worker agents into the hive (use --claude to launch Claude Code)',
491
- options: [
492
- {
493
- name: 'count',
494
- short: 'n',
495
- description: 'Number of workers to spawn',
496
- type: 'number',
497
- default: 1
498
- },
499
- {
500
- name: 'role',
501
- short: 'r',
502
- description: 'Worker role (worker, specialist, scout)',
503
- type: 'string',
504
- choices: ['worker', 'specialist', 'scout'],
505
- default: 'worker'
506
- },
507
- {
508
- name: 'type',
509
- short: 't',
510
- description: 'Agent type',
511
- type: 'string',
512
- default: 'worker'
513
- },
514
- {
515
- name: 'prefix',
516
- short: 'p',
517
- description: 'Prefix for worker IDs',
518
- type: 'string',
519
- default: 'hive-worker'
520
- },
521
- // NEW: --claude flag for launching Claude Code
522
- {
523
- name: 'claude',
524
- description: 'Launch Claude Code with hive-mind coordination prompt',
525
- type: 'boolean',
526
- default: false
527
- },
528
- {
529
- name: 'objective',
530
- short: 'o',
531
- description: 'Objective for the hive mind (used with --claude)',
532
- type: 'string'
533
- },
534
- {
535
- name: 'dangerously-skip-permissions',
536
- description: 'Skip permission prompts in Claude Code (use with caution)',
537
- type: 'boolean',
538
- default: true
539
- },
540
- {
541
- name: 'no-auto-permissions',
542
- description: 'Disable automatic permission skipping',
543
- type: 'boolean',
544
- default: false
545
- },
546
- {
547
- name: 'dry-run',
548
- description: 'Show what would be done without launching Claude Code',
549
- type: 'boolean',
550
- default: false
551
- },
552
- {
553
- name: 'non-interactive',
554
- description: 'Run Claude Code in non-interactive mode',
555
- type: 'boolean',
556
- default: false
557
- },
558
- {
559
- name: 'mcp-config',
560
- description: 'Path to .mcp.json for the spawned worker (auto-detects ./.mcp.json or ~/.claude.json if omitted) — fixes #1748 Issue 2',
561
- type: 'string'
562
- }
563
- ],
564
- examples: [
565
- { command: 'claude-flow hive-mind spawn -n 5', description: 'Spawn 5 workers' },
566
- { command: 'claude-flow hive-mind spawn -n 3 -r specialist', description: 'Spawn 3 specialists' },
567
- { command: 'claude-flow hive-mind spawn -t coder -p my-coder', description: 'Spawn coder with custom prefix' },
568
- { command: 'claude-flow hive-mind spawn --claude -o "Build a REST API"', description: 'Launch Claude Code with objective' },
569
- { command: 'claude-flow hive-mind spawn -n 5 --claude -o "Research AI patterns"', description: 'Spawn workers and launch Claude Code' }
570
- ],
571
- action: async (ctx) => {
572
- // Parse count with fallback to default
573
- const count = ctx.flags.count || 1;
574
- const role = ctx.flags.role || 'worker';
575
- const agentType = ctx.flags.type || 'worker';
576
- const prefix = ctx.flags.prefix || 'hive-worker';
577
- const launchClaude = ctx.flags.claude;
578
- let objective = ctx.flags.objective || ctx.args.join(' ');
579
- output.printInfo(`Spawning ${count} ${role} agent(s)...`);
580
- try {
581
- const result = await callMCPTool('hive-mind_spawn', {
582
- count,
583
- role,
584
- agentType,
585
- prefix,
586
- });
587
- // Check for errors from MCP tool
588
- if (!result.success) {
589
- output.printError(result.error || 'Failed to spawn workers');
590
- return { success: false, exitCode: 1 };
591
- }
592
- if (ctx.flags.format === 'json' && !launchClaude) {
593
- output.printJson(result);
594
- return { success: true, data: result };
595
- }
596
- output.writeln();
597
- // Transform workers array to display format
598
- const displayData = (result.workers || []).map(w => ({
599
- id: w.agentId,
600
- role: w.role,
601
- status: 'idle',
602
- joinedAt: new Date(w.joinedAt).toLocaleTimeString()
603
- }));
604
- output.printTable({
605
- columns: [
606
- { key: 'id', header: 'Agent ID', width: 30 },
607
- { key: 'role', header: 'Role', width: 12 },
608
- { key: 'status', header: 'Status', width: 10, format: formatAgentStatus },
609
- { key: 'joinedAt', header: 'Joined', width: 12 }
610
- ],
611
- data: displayData
612
- });
613
- output.writeln();
614
- output.printSuccess(`Spawned ${result.spawned} agent(s)`);
615
- output.writeln(output.dim(` Total workers in hive: ${result.totalWorkers}`));
616
- // NEW: Handle --claude flag
617
- if (launchClaude) {
618
- // Get objective if not provided
619
- if (!objective && ctx.interactive) {
620
- objective = await input({
621
- message: 'Enter the objective for the hive mind:',
622
- validate: (v) => v.length > 0 || 'Objective is required when using --claude'
623
- });
624
- }
625
- if (!objective) {
626
- output.writeln();
627
- output.printWarning('No objective provided. Using default objective.');
628
- objective = 'Coordinate the hive mind workers to complete tasks efficiently.';
629
- }
630
- // Get hive status for swarm info
631
- let swarmId = result.hiveId || 'default';
632
- let swarmName = 'Hive Mind Swarm';
633
- try {
634
- const statusResult = await callMCPTool('hive-mind_status', { includeWorkers: false });
635
- swarmId = statusResult.hiveId || swarmId;
636
- }
637
- catch {
638
- // Use defaults if status call fails
639
- }
640
- // Convert workers to expected format
641
- const workers = (result.workers || []).map(w => ({
642
- agentId: w.agentId,
643
- role: w.role,
644
- type: agentType,
645
- joinedAt: w.joinedAt
646
- }));
647
- // Launch Claude Code with hive mind prompt
648
- const claudeResult = await spawnClaudeCodeInstance(swarmId, swarmName, objective, workers, ctx.flags);
649
- if (!claudeResult.success) {
650
- return { success: false, exitCode: 1, data: { spawn: result, claude: claudeResult } };
651
- }
652
- return { success: true, data: { spawn: result, claude: claudeResult } };
653
- }
654
- return { success: true, data: result };
655
- }
656
- catch (error) {
657
- if (error instanceof MCPClientError) {
658
- output.printError(`Spawn error: ${error.message}`);
659
- }
660
- else {
661
- output.printError(`Unexpected error: ${String(error)}`);
662
- }
663
- return { success: false, exitCode: 1 };
664
- }
665
- }
666
- };
667
- // Status subcommand
668
- const statusCommand = {
669
- name: 'status',
670
- description: 'Show hive mind status',
671
- options: [
672
- {
673
- name: 'detailed',
674
- short: 'd',
675
- description: 'Show detailed metrics',
676
- type: 'boolean',
677
- default: false
678
- },
679
- {
680
- name: 'watch',
681
- short: 'w',
682
- description: 'Watch for changes',
683
- type: 'boolean',
684
- default: false
685
- }
686
- ],
687
- action: async (ctx) => {
688
- const detailed = ctx.flags.detailed;
689
- try {
690
- const result = await callMCPTool('hive-mind_status', {
691
- includeMetrics: detailed,
692
- includeWorkers: true,
693
- });
694
- if (ctx.flags.format === 'json') {
695
- output.printJson(result);
696
- return { success: true, data: result };
697
- }
698
- // Handle both simple and complex response formats - cast to flexible type
699
- const flexResult = result;
700
- const hiveId = result.hiveId ?? flexResult.id ?? 'default';
701
- const status = result.status ?? (flexResult.initialized ? 'running' : 'stopped');
702
- const queen = result.queen ?? { id: 'N/A', status: 'unknown', load: 0, tasksQueued: 0 };
703
- const flexQueen = queen;
704
- const queenId = typeof queen === 'object' ? (queen.id ?? flexQueen.agentId ?? 'N/A') : String(queen);
705
- const queenLoad = typeof queen === 'object' ? (queen.load ?? 0) : 0;
706
- const queenTasks = typeof queen === 'object' ? (queen.tasksQueued ?? 0) : 0;
707
- const queenStatus = typeof queen === 'object' ? (queen.status ?? 'active') : 'active';
708
- output.writeln();
709
- output.printBox([
710
- `Hive ID: ${hiveId}`,
711
- `Status: ${formatHiveStatus(String(status))}`,
712
- `Topology: ${result.topology ?? 'mesh'}`,
713
- `Consensus: ${result.consensus ?? 'byzantine'}`,
714
- '',
715
- `Queen: ${queenId}`,
716
- ` Status: ${formatAgentStatus(queenStatus)}`,
717
- ` Load: ${(queenLoad * 100).toFixed(1)}%`,
718
- ` Queued Tasks: ${queenTasks}`
719
- ].join('\n'), 'Hive Mind Status');
720
- // Handle workers array - could be worker objects or just IDs
721
- const workers = result.workers ?? [];
722
- const workerData = Array.isArray(workers) ? workers.map(w => {
723
- if (typeof w === 'string') {
724
- return { id: w, type: 'worker', status: 'idle', currentTask: '-', tasksCompleted: 0 };
725
- }
726
- const flexWorker = w;
727
- return {
728
- id: w.id ?? flexWorker.agentId ?? 'unknown',
729
- type: w.type ?? flexWorker.agentType ?? 'worker',
730
- status: w.status ?? 'idle',
731
- currentTask: w.currentTask ?? '-',
732
- tasksCompleted: w.tasksCompleted ?? 0
733
- };
734
- }) : [];
735
- output.writeln();
736
- output.writeln(output.bold('Worker Agents'));
737
- if (workerData.length === 0) {
738
- output.printInfo('No workers in hive. Use "claude-flow hive-mind spawn" to add workers.');
739
- }
740
- else {
741
- output.printTable({
742
- columns: [
743
- { key: 'id', header: 'ID', width: 20 },
744
- { key: 'type', header: 'Type', width: 12 },
745
- { key: 'status', header: 'Status', width: 10, format: formatAgentStatus },
746
- { key: 'currentTask', header: 'Current Task', width: 20, format: (v) => String(v || '-') },
747
- { key: 'tasksCompleted', header: 'Completed', width: 10, align: 'right' }
748
- ],
749
- data: workerData
750
- });
751
- }
752
- if (detailed) {
753
- const metrics = result.metrics ?? { totalTasks: 0, completedTasks: 0, failedTasks: 0, avgTaskTime: 0, consensusRounds: 0, memoryUsage: '0 MB' };
754
- output.writeln();
755
- output.writeln(output.bold('Metrics'));
756
- output.printTable({
757
- columns: [
758
- { key: 'metric', header: 'Metric', width: 20 },
759
- { key: 'value', header: 'Value', width: 15, align: 'right' }
760
- ],
761
- data: [
762
- { metric: 'Total Tasks', value: metrics.totalTasks ?? 0 },
763
- { metric: 'Completed', value: metrics.completedTasks ?? 0 },
764
- { metric: 'Failed', value: metrics.failedTasks ?? 0 },
765
- { metric: 'Avg Task Time', value: `${(metrics.avgTaskTime ?? 0).toFixed(1)}ms` },
766
- { metric: 'Consensus Rounds', value: metrics.consensusRounds ?? 0 },
767
- { metric: 'Memory Usage', value: metrics.memoryUsage ?? '0 MB' }
768
- ]
769
- });
770
- const health = result.health ?? { overall: 'healthy', queen: 'healthy', workers: 'healthy', consensus: 'healthy', memory: 'healthy' };
771
- output.writeln();
772
- output.writeln(output.bold('Health'));
773
- output.printList([
774
- `Overall: ${formatHealth(health.overall ?? 'healthy')}`,
775
- `Queen: ${formatHealth(health.queen ?? 'healthy')}`,
776
- `Workers: ${formatHealth(health.workers ?? 'healthy')}`,
777
- `Consensus: ${formatHealth(health.consensus ?? 'healthy')}`,
778
- `Memory: ${formatHealth(health.memory ?? 'healthy')}`
779
- ]);
780
- }
781
- return { success: true, data: result };
782
- }
783
- catch (error) {
784
- if (error instanceof MCPClientError) {
785
- output.printError(`Status error: ${error.message}`);
786
- }
787
- else {
788
- output.printError(`Unexpected error: ${String(error)}`);
789
- }
790
- return { success: false, exitCode: 1 };
791
- }
792
- }
793
- };
794
- // Task subcommand
795
- const taskCommand = {
796
- name: 'task',
797
- description: 'Submit tasks to the hive',
798
- options: [
799
- {
800
- name: 'description',
801
- short: 'd',
802
- description: 'Task description',
803
- type: 'string'
804
- },
805
- {
806
- name: 'priority',
807
- short: 'p',
808
- description: 'Task priority',
809
- type: 'string',
810
- choices: ['low', 'normal', 'high', 'critical'],
811
- default: 'normal'
812
- },
813
- {
814
- name: 'require-consensus',
815
- short: 'c',
816
- description: 'Require consensus for completion',
817
- type: 'boolean',
818
- default: false
819
- },
820
- {
821
- name: 'timeout',
822
- description: 'Task timeout in seconds',
823
- type: 'number',
824
- default: 300
825
- }
826
- ],
827
- examples: [
828
- { command: 'claude-flow hive-mind task -d "Implement auth module"', description: 'Submit task' },
829
- { command: 'claude-flow hive-mind task -d "Security review" -p critical -c', description: 'Critical task with consensus' }
830
- ],
831
- action: async (ctx) => {
832
- let description = ctx.flags.description || ctx.args.join(' ');
833
- if (!description && ctx.interactive) {
834
- description = await input({
835
- message: 'Task description:',
836
- validate: (v) => v.length > 0 || 'Description is required'
837
- });
838
- }
839
- if (!description) {
840
- output.printError('Task description is required');
841
- return { success: false, exitCode: 1 };
842
- }
843
- const priority = ctx.flags.priority;
844
- const requireConsensus = ctx.flags.requireConsensus;
845
- const timeout = ctx.flags.timeout;
846
- output.printInfo('Submitting task to hive...');
847
- try {
848
- // #1791.1 — `hive-mind_task` was never registered in the bundled MCP
849
- // server (the `mcp__ruflo__hive-mind_*` surface only exposes init,
850
- // spawn, status, broadcast, consensus, memory, shutdown, leave). The
851
- // CLI was dispatching to a tool that doesn't exist, producing
852
- // `MCP tool not found: hive-mind_task` and aborting.
853
- //
854
- // Re-route to the existing `task_create` tool. Hive-specific options
855
- // (consensus requirement, timeout) are preserved as tags so a future
856
- // hive-mind worker / consensus tool can pick them up — the data is
857
- // not lost just because the dedicated hive-mind tool isn't there yet.
858
- const consensusTag = `consensus:${requireConsensus ? 'required' : 'none'}`;
859
- const timeoutTag = `timeout:${timeout}s`;
860
- const result = await callMCPTool('task_create', {
861
- type: 'hive-mind',
862
- description,
863
- priority,
864
- tags: ['hive-mind', consensusTag, timeoutTag],
865
- });
866
- if (ctx.flags.format === 'json') {
867
- output.printJson(result);
868
- return { success: true, data: result };
869
- }
870
- output.writeln();
871
- output.printBox([
872
- `Task ID: ${result.taskId}`,
873
- `Status: ${formatAgentStatus(result.status)}`,
874
- `Priority: ${formatPriority(priority)}`,
875
- `Assigned: ${result.assignedTo.length > 0 ? result.assignedTo.join(', ') : 'pending dispatch'}`,
876
- `Consensus: ${requireConsensus ? 'Yes' : 'No'}`,
877
- `Timeout: ${timeout}s`,
878
- `Tags: ${result.tags.join(', ')}`
879
- ].join('\n'), 'Task Submitted');
880
- output.writeln();
881
- output.printSuccess('Task submitted to hive');
882
- output.writeln(output.dim(` Track with: claude-flow hive-mind task-status ${result.taskId}`));
883
- return { success: true, data: result };
884
- }
885
- catch (error) {
886
- if (error instanceof MCPClientError) {
887
- output.printError(`Task submission error: ${error.message}`);
888
- }
889
- else {
890
- output.printError(`Unexpected error: ${String(error)}`);
891
- }
892
- return { success: false, exitCode: 1 };
893
- }
894
- }
895
- };
896
- // Optimize memory subcommand
897
- const optimizeMemoryCommand = {
898
- name: 'optimize-memory',
899
- description: 'Optimize hive memory and patterns',
900
- options: [
901
- {
902
- name: 'aggressive',
903
- short: 'a',
904
- description: 'Aggressive optimization',
905
- type: 'boolean',
906
- default: false
907
- },
908
- {
909
- name: 'threshold',
910
- description: 'Quality threshold for pattern retention',
911
- type: 'number',
912
- default: 0.7
913
- }
914
- ],
915
- action: async (ctx) => {
916
- const aggressive = ctx.flags.aggressive;
917
- const threshold = ctx.flags.threshold;
918
- output.printInfo('Optimizing hive memory...');
919
- const spinner = output.createSpinner({ text: 'Analyzing patterns...', spinner: 'dots' });
920
- spinner.start();
921
- try {
922
- const result = await callMCPTool('hive-mind_optimize-memory', {
923
- aggressive,
924
- qualityThreshold: threshold,
925
- });
926
- spinner.succeed('Memory optimized');
927
- if (ctx.flags.format === 'json') {
928
- output.printJson(result);
929
- return { success: true, data: result };
930
- }
931
- output.writeln();
932
- output.printTable({
933
- columns: [
934
- { key: 'metric', header: 'Metric', width: 20 },
935
- { key: 'before', header: 'Before', width: 15, align: 'right' },
936
- { key: 'after', header: 'After', width: 15, align: 'right' }
937
- ],
938
- data: [
939
- { metric: 'Patterns', before: result.before.patterns, after: result.after.patterns },
940
- { metric: 'Memory', before: result.before.memory, after: result.after.memory }
941
- ]
942
- });
943
- output.writeln();
944
- output.printList([
945
- `Patterns removed: ${result.removed}`,
946
- `Patterns consolidated: ${result.consolidated}`,
947
- `Optimization time: ${result.timeMs}ms`
948
- ]);
949
- return { success: true, data: result };
950
- }
951
- catch (error) {
952
- spinner.fail('Optimization failed');
953
- if (error instanceof MCPClientError) {
954
- output.printError(`Optimization error: ${error.message}`);
955
- }
956
- else {
957
- output.printError(`Unexpected error: ${String(error)}`);
958
- }
959
- return { success: false, exitCode: 1 };
960
- }
961
- }
962
- };
963
- // Join subcommand
964
- const joinCommand = {
965
- name: 'join',
966
- description: 'Join an agent to the hive mind',
967
- options: [
968
- { name: 'agent-id', short: 'a', description: 'Agent ID to join', type: 'string' },
969
- { name: 'role', short: 'r', description: 'Agent role (worker, specialist, scout)', type: 'string', default: 'worker' }
970
- ],
971
- action: async (ctx) => {
972
- const agentId = ctx.args[0] || ctx.flags['agent-id'] || ctx.flags.agentId;
973
- if (!agentId) {
974
- output.printError('Agent ID is required. Use --agent-id or -a flag, or provide as argument.');
975
- return { success: false, exitCode: 1 };
976
- }
977
- try {
978
- const result = await callMCPTool('hive-mind_join', { agentId, role: ctx.flags.role });
979
- if (!result.success) {
980
- output.printError(result.error || 'Failed');
981
- return { success: false, exitCode: 1 };
982
- }
983
- output.printSuccess(`Agent ${agentId} joined hive (${result.totalWorkers} workers)`);
984
- return { success: true, data: result };
985
- }
986
- catch (error) {
987
- output.printError(`Join error: ${error instanceof MCPClientError ? error.message : String(error)}`);
988
- return { success: false, exitCode: 1 };
989
- }
990
- }
991
- };
992
- // Leave subcommand
993
- const leaveCommand = {
994
- name: 'leave',
995
- description: 'Remove an agent from the hive mind',
996
- options: [{ name: 'agent-id', short: 'a', description: 'Agent ID to remove', type: 'string' }],
997
- action: async (ctx) => {
998
- const agentId = ctx.args[0] || ctx.flags['agent-id'] || ctx.flags.agentId;
999
- if (!agentId) {
1000
- output.printError('Agent ID required.');
1001
- return { success: false, exitCode: 1 };
1002
- }
1003
- try {
1004
- const result = await callMCPTool('hive-mind_leave', { agentId });
1005
- if (!result.success) {
1006
- output.printError(result.error || 'Failed');
1007
- return { success: false, exitCode: 1 };
1008
- }
1009
- output.printSuccess(`Agent ${agentId} left hive (${result.remainingWorkers} remaining)`);
1010
- return { success: true, data: result };
1011
- }
1012
- catch (error) {
1013
- output.printError(`Leave error: ${error instanceof MCPClientError ? error.message : String(error)}`);
1014
- return { success: false, exitCode: 1 };
1015
- }
1016
- }
1017
- };
1018
- // Consensus subcommand
1019
- const consensusCommand = {
1020
- name: 'consensus',
1021
- description: 'Manage consensus proposals and voting',
1022
- options: [
1023
- { name: 'action', short: 'a', description: 'Consensus action', type: 'string', choices: ['propose', 'vote', 'status', 'list'], default: 'list' },
1024
- { name: 'proposal-id', short: 'p', description: 'Proposal ID', type: 'string' },
1025
- { name: 'type', short: 't', description: 'Proposal type', type: 'string' },
1026
- { name: 'value', description: 'Proposal value', type: 'string' },
1027
- { name: 'vote', short: 'v', description: 'Vote (yes/no)', type: 'string' },
1028
- { name: 'voter-id', description: 'Voter agent ID', type: 'string' }
1029
- ],
1030
- action: async (ctx) => {
1031
- const action = ctx.flags.action || 'list';
1032
- try {
1033
- const result = await callMCPTool('hive-mind_consensus', { action, proposalId: ctx.flags.proposalId, type: ctx.flags.type, value: ctx.flags.value, vote: ctx.flags.vote === 'yes', voterId: ctx.flags.voterId });
1034
- if (ctx.flags.format === 'json') {
1035
- output.printJson(result);
1036
- return { success: true, data: result };
1037
- }
1038
- if (action === 'list') {
1039
- output.writeln(output.bold('\nPending Proposals'));
1040
- const pending = result.pending || [];
1041
- if (pending.length === 0)
1042
- output.printInfo('No pending proposals');
1043
- else
1044
- output.printTable({ columns: [{ key: 'proposalId', header: 'ID', width: 30 }, { key: 'type', header: 'Type', width: 12 }], data: pending });
1045
- }
1046
- else if (action === 'propose') {
1047
- output.printSuccess(`Proposal created: ${result.proposalId}`);
1048
- }
1049
- else if (action === 'vote') {
1050
- output.printSuccess(`Vote recorded (For: ${result.votesFor}, Against: ${result.votesAgainst})`);
1051
- }
1052
- return { success: true, data: result };
1053
- }
1054
- catch (error) {
1055
- output.printError(`Consensus error: ${error instanceof MCPClientError ? error.message : String(error)}`);
1056
- return { success: false, exitCode: 1 };
1057
- }
1058
- }
1059
- };
1060
- // Broadcast subcommand
1061
- const broadcastCommand = {
1062
- name: 'broadcast',
1063
- description: 'Broadcast a message to all workers in the hive',
1064
- options: [
1065
- { name: 'message', short: 'm', description: 'Message to broadcast', type: 'string', required: true },
1066
- { name: 'priority', short: 'p', description: 'Message priority', type: 'string', choices: ['low', 'normal', 'high', 'critical'], default: 'normal' },
1067
- { name: 'from', short: 'f', description: 'Sender agent ID', type: 'string' }
1068
- ],
1069
- action: async (ctx) => {
1070
- const message = ctx.args.join(' ') || ctx.flags.message;
1071
- if (!message) {
1072
- output.printError('Message required. Use --message or -m flag.');
1073
- return { success: false, exitCode: 1 };
1074
- }
1075
- try {
1076
- const result = await callMCPTool('hive-mind_broadcast', { message, priority: ctx.flags.priority, fromId: ctx.flags.from });
1077
- if (!result.success) {
1078
- output.printError(result.error || 'Failed');
1079
- return { success: false, exitCode: 1 };
1080
- }
1081
- output.printSuccess(`Message broadcast to ${result.recipients} workers (ID: ${result.messageId})`);
1082
- return { success: true, data: result };
1083
- }
1084
- catch (error) {
1085
- output.printError(`Broadcast error: ${error instanceof MCPClientError ? error.message : String(error)}`);
1086
- return { success: false, exitCode: 1 };
1087
- }
1088
- }
1089
- };
1090
- // Memory subcommand
1091
- const memorySubCommand = {
1092
- name: 'memory',
1093
- description: 'Access hive shared memory',
1094
- options: [
1095
- { name: 'action', short: 'a', description: 'Memory action', type: 'string', choices: ['get', 'set', 'delete', 'list'], default: 'list' },
1096
- { name: 'key', short: 'k', description: 'Memory key', type: 'string' },
1097
- { name: 'value', short: 'v', description: 'Value to store', type: 'string' }
1098
- ],
1099
- action: async (ctx) => {
1100
- const action = ctx.flags.action || 'list';
1101
- const key = ctx.flags.key;
1102
- const value = ctx.flags.value;
1103
- if ((action === 'get' || action === 'delete') && !key) {
1104
- output.printError('Key required for get/delete.');
1105
- return { success: false, exitCode: 1 };
1106
- }
1107
- if (action === 'set' && (!key || value === undefined)) {
1108
- output.printError('Key and value required for set.');
1109
- return { success: false, exitCode: 1 };
1110
- }
1111
- try {
1112
- const result = await callMCPTool('hive-mind_memory', { action, key, value });
1113
- if (ctx.flags.format === 'json') {
1114
- output.printJson(result);
1115
- return { success: true, data: result };
1116
- }
1117
- if (action === 'list') {
1118
- const keys = result.keys || [];
1119
- output.writeln(output.bold(`\nShared Memory (${result.count} keys)`));
1120
- if (keys.length === 0)
1121
- output.printInfo('No keys in shared memory');
1122
- else
1123
- output.printList(keys.map(k => output.highlight(k)));
1124
- }
1125
- else if (action === 'get') {
1126
- output.writeln(output.bold(`\nKey: ${key}`));
1127
- output.writeln(result.exists ? `Value: ${JSON.stringify(result.value, null, 2)}` : 'Key not found');
1128
- }
1129
- else if (action === 'set') {
1130
- output.printSuccess(`Set ${key} in shared memory`);
1131
- }
1132
- else if (action === 'delete') {
1133
- output.printSuccess(result.deleted ? `Deleted ${key}` : `Key ${key} did not exist`);
1134
- }
1135
- return { success: true, data: result };
1136
- }
1137
- catch (error) {
1138
- output.printError(`Memory error: ${error instanceof MCPClientError ? error.message : String(error)}`);
1139
- return { success: false, exitCode: 1 };
1140
- }
1141
- }
1142
- };
1143
- // Shutdown subcommand
1144
- const shutdownCommand = {
1145
- name: 'shutdown',
1146
- description: 'Shutdown the hive mind',
1147
- options: [
1148
- {
1149
- name: 'force',
1150
- short: 'f',
1151
- description: 'Force shutdown',
1152
- type: 'boolean',
1153
- default: false
1154
- },
1155
- {
1156
- name: 'save-state',
1157
- short: 's',
1158
- description: 'Save state before shutdown',
1159
- type: 'boolean',
1160
- default: true
1161
- }
1162
- ],
1163
- action: async (ctx) => {
1164
- const force = ctx.flags.force;
1165
- const saveState = ctx.flags.saveState;
1166
- if (!force && ctx.interactive) {
1167
- const confirmed = await confirm({
1168
- message: 'Shutdown the hive mind? All agents will be terminated.',
1169
- default: false
1170
- });
1171
- if (!confirmed) {
1172
- output.printInfo('Operation cancelled');
1173
- return { success: true };
1174
- }
1175
- }
1176
- output.printInfo('Shutting down hive mind...');
1177
- const spinner = output.createSpinner({ text: 'Graceful shutdown in progress...', spinner: 'dots' });
1178
- spinner.start();
1179
- try {
1180
- const result = await callMCPTool('hive-mind_shutdown', {
1181
- force,
1182
- saveState,
1183
- });
1184
- spinner.succeed('Hive mind shutdown complete');
1185
- output.writeln();
1186
- output.printList([
1187
- `Agents terminated: ${result.agentsTerminated}`,
1188
- `State saved: ${result.stateSaved ? 'Yes' : 'No'}`,
1189
- `Shutdown time: ${result.shutdownTime}`
1190
- ]);
1191
- return { success: true, data: result };
1192
- }
1193
- catch (error) {
1194
- spinner.fail('Shutdown failed');
1195
- if (error instanceof MCPClientError) {
1196
- output.printError(`Shutdown error: ${error.message}`);
1197
- }
1198
- else {
1199
- output.printError(`Unexpected error: ${String(error)}`);
1200
- }
1201
- return { success: false, exitCode: 1 };
1202
- }
1203
- }
1204
- };
1205
- // Main hive-mind command
1206
- export const hiveMindCommand = {
1207
- name: 'hive-mind',
1208
- aliases: ['hive'],
1209
- description: 'Queen-led consensus-based multi-agent coordination',
1210
- subcommands: [initCommand, spawnCommand, statusCommand, taskCommand, joinCommand, leaveCommand, consensusCommand, broadcastCommand, memorySubCommand, optimizeMemoryCommand, shutdownCommand],
1211
- options: [],
1212
- examples: [
1213
- { command: 'claude-flow hive-mind init -t hierarchical-mesh', description: 'Initialize hive' },
1214
- { command: 'claude-flow hive-mind spawn -n 5', description: 'Spawn workers' },
1215
- { command: 'claude-flow hive-mind spawn --claude -o "Build a feature"', description: 'Launch Claude Code with hive mind' },
1216
- { command: 'claude-flow hive-mind task -d "Build feature"', description: 'Submit task' }
1217
- ],
1218
- action: async () => {
1219
- output.writeln();
1220
- output.writeln(output.bold('Hive Mind - Consensus-Based Multi-Agent Coordination'));
1221
- output.writeln();
1222
- output.writeln('Usage: claude-flow hive-mind <subcommand> [options]');
1223
- output.writeln();
1224
- output.writeln('Subcommands:');
1225
- output.printList([
1226
- `${output.highlight('init')} - Initialize hive mind`,
1227
- `${output.highlight('spawn')} - Spawn worker agents (use --claude to launch Claude Code)`,
1228
- `${output.highlight('status')} - Show hive status`,
1229
- `${output.highlight('task')} - Submit task to hive`,
1230
- `${output.highlight('join')} - Join an agent to the hive`,
1231
- `${output.highlight('leave')} - Remove an agent from the hive`,
1232
- `${output.highlight('consensus')} - Manage consensus proposals`,
1233
- `${output.highlight('broadcast')} - Broadcast message to workers`,
1234
- `${output.highlight('memory')} - Access shared memory`,
1235
- `${output.highlight('optimize-memory')} - Optimize patterns and memory`,
1236
- `${output.highlight('shutdown')} - Shutdown the hive`
1237
- ]);
1238
- output.writeln();
1239
- output.writeln('Features:');
1240
- output.printList([
1241
- 'Queen-led hierarchical coordination',
1242
- 'Byzantine fault tolerant consensus',
1243
- 'HNSW-accelerated pattern matching',
1244
- 'Cross-session memory persistence',
1245
- 'Automatic load balancing',
1246
- output.success('NEW: --claude flag to launch interactive Claude Code sessions')
1247
- ]);
1248
- output.writeln();
1249
- output.writeln('Quick Start with Claude Code:');
1250
- output.writeln(output.dim(' claude-flow hive-mind init'));
1251
- output.writeln(output.dim(' claude-flow hive-mind spawn -n 5 --claude -o "Your objective here"'));
1252
- return { success: true };
1253
- }
1254
- };
1255
- // Helper functions
1256
- function formatAgentStatus(status) {
1257
- const statusStr = String(status);
1258
- switch (statusStr) {
1259
- case 'active':
1260
- case 'ready':
1261
- case 'running':
1262
- return output.success(statusStr);
1263
- case 'idle':
1264
- case 'waiting':
1265
- return output.dim(statusStr);
1266
- case 'busy':
1267
- return output.highlight(statusStr);
1268
- case 'error':
1269
- case 'failed':
1270
- return output.error(statusStr);
1271
- default:
1272
- return statusStr;
1273
- }
1274
- }
1275
- function formatHiveStatus(status) {
1276
- switch (status) {
1277
- case 'active':
1278
- return output.success(status);
1279
- case 'idle':
1280
- return output.dim(status);
1281
- case 'degraded':
1282
- return output.warning(status);
1283
- case 'offline':
1284
- return output.error(status);
1285
- default:
1286
- return status;
1287
- }
1288
- }
1289
- function formatHealth(health) {
1290
- switch (health) {
1291
- case 'healthy':
1292
- case 'good':
1293
- return output.success(health);
1294
- case 'warning':
1295
- case 'degraded':
1296
- return output.warning(health);
1297
- case 'critical':
1298
- case 'unhealthy':
1299
- return output.error(health);
1300
- default:
1301
- return health;
1302
- }
1303
- }
1304
- function formatPriority(priority) {
1305
- switch (priority) {
1306
- case 'critical':
1307
- return output.error(priority.toUpperCase());
1308
- case 'high':
1309
- return output.warning(priority);
1310
- case 'normal':
1311
- return priority;
1312
- case 'low':
1313
- return output.dim(priority);
1314
- default:
1315
- return priority;
1316
- }
1317
- }
1318
- export default hiveMindCommand;
1319
- //# sourceMappingURL=hive-mind.js.map