kynjal-cli 4.0.0 → 4.0.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 (502) hide show
  1. package/dist/src/appliance/gguf-engine.d.ts +91 -0
  2. package/dist/src/appliance/gguf-engine.d.ts.map +1 -0
  3. package/dist/src/appliance/gguf-engine.js +286 -525
  4. package/dist/src/appliance/gguf-engine.js.map +1 -1
  5. package/dist/src/appliance/ruvllm-bridge.d.ts +102 -0
  6. package/dist/src/appliance/ruvllm-bridge.d.ts.map +1 -0
  7. package/dist/src/appliance/ruvllm-bridge.js +203 -403
  8. package/dist/src/appliance/ruvllm-bridge.js.map +1 -1
  9. package/dist/src/appliance/rvfa-builder.d.ts +44 -0
  10. package/dist/src/appliance/rvfa-builder.d.ts.map +1 -0
  11. package/dist/src/appliance/rvfa-builder.js +154 -208
  12. package/dist/src/appliance/rvfa-builder.js.map +1 -1
  13. package/dist/src/appliance/rvfa-distribution.d.ts +97 -0
  14. package/dist/src/appliance/rvfa-distribution.d.ts.map +1 -0
  15. package/dist/src/appliance/rvfa-distribution.js +260 -423
  16. package/dist/src/appliance/rvfa-distribution.js.map +1 -1
  17. package/dist/src/appliance/rvfa-format.d.ts +111 -0
  18. package/dist/src/appliance/rvfa-format.d.ts.map +1 -0
  19. package/dist/src/appliance/rvfa-format.js +128 -200
  20. package/dist/src/appliance/rvfa-format.js.map +1 -1
  21. package/dist/src/appliance/rvfa-runner.d.ts +69 -0
  22. package/dist/src/appliance/rvfa-runner.d.ts.map +1 -0
  23. package/dist/src/appliance/rvfa-runner.js +168 -304
  24. package/dist/src/appliance/rvfa-runner.js.map +1 -1
  25. package/dist/src/appliance/rvfa-signing.d.ts +123 -0
  26. package/dist/src/appliance/rvfa-signing.d.ts.map +1 -0
  27. package/dist/src/appliance/rvfa-signing.js +173 -295
  28. package/dist/src/appliance/rvfa-signing.js.map +1 -1
  29. package/dist/src/benchmarks/pretrain/index.d.ts +58 -0
  30. package/dist/src/benchmarks/pretrain/index.d.ts.map +1 -0
  31. package/dist/src/benchmarks/pretrain/index.js +331 -542
  32. package/dist/src/benchmarks/pretrain/index.js.map +1 -1
  33. package/dist/src/commands/agent.js +574 -697
  34. package/dist/src/commands/agent.js.map +1 -1
  35. package/dist/src/commands/analyze.js +1218 -1548
  36. package/dist/src/commands/analyze.js.map +1 -1
  37. package/dist/src/commands/appliance-advanced.js +158 -267
  38. package/dist/src/commands/appliance-advanced.js.map +1 -1
  39. package/dist/src/commands/appliance.js +318 -493
  40. package/dist/src/commands/appliance.js.map +1 -1
  41. package/dist/src/commands/benchmark.js +372 -523
  42. package/dist/src/commands/benchmark.js.map +1 -1
  43. package/dist/src/commands/claims.js +274 -364
  44. package/dist/src/commands/claims.js.map +1 -1
  45. package/dist/src/commands/cleanup.js +113 -157
  46. package/dist/src/commands/cleanup.js.map +1 -1
  47. package/dist/src/commands/completions.js +477 -118
  48. package/dist/src/commands/completions.js.map +1 -1
  49. package/dist/src/commands/config.js +237 -303
  50. package/dist/src/commands/config.js.map +1 -1
  51. package/dist/src/commands/daemon.js +487 -596
  52. package/dist/src/commands/daemon.js.map +1 -1
  53. package/dist/src/commands/deployment.js +194 -275
  54. package/dist/src/commands/deployment.js.map +1 -1
  55. package/dist/src/commands/doctor.js +504 -686
  56. package/dist/src/commands/doctor.js.map +1 -1
  57. package/dist/src/commands/embeddings.js +1293 -1543
  58. package/dist/src/commands/embeddings.js.map +1 -1
  59. package/dist/src/commands/guidance.js +449 -596
  60. package/dist/src/commands/guidance.js.map +1 -1
  61. package/dist/src/commands/hive-mind.js +854 -938
  62. package/dist/src/commands/hive-mind.js.map +1 -1
  63. package/dist/src/commands/hooks.js +3112 -3519
  64. package/dist/src/commands/hooks.js.map +1 -1
  65. package/dist/src/commands/index.d.ts +115 -0
  66. package/dist/src/commands/index.d.ts.map +1 -0
  67. package/dist/src/commands/index.js +126 -308
  68. package/dist/src/commands/index.js.map +1 -1
  69. package/dist/src/commands/init.js +788 -940
  70. package/dist/src/commands/init.js.map +1 -1
  71. package/dist/src/commands/issues.js +383 -558
  72. package/dist/src/commands/issues.js.map +1 -1
  73. package/dist/src/commands/mcp.js +493 -605
  74. package/dist/src/commands/mcp.js.map +1 -1
  75. package/dist/src/commands/memory.js +833 -1026
  76. package/dist/src/commands/memory.js.map +1 -1
  77. package/dist/src/commands/migrate.js +282 -347
  78. package/dist/src/commands/migrate.js.map +1 -1
  79. package/dist/src/commands/neural.js +1289 -1563
  80. package/dist/src/commands/neural.js.map +1 -1
  81. package/dist/src/commands/performance.js +497 -643
  82. package/dist/src/commands/performance.js.map +1 -1
  83. package/dist/src/commands/plugins.js +668 -841
  84. package/dist/src/commands/plugins.js.map +1 -1
  85. package/dist/src/commands/process.js +392 -447
  86. package/dist/src/commands/process.js.map +1 -1
  87. package/dist/src/commands/progress.js +162 -256
  88. package/dist/src/commands/progress.js.map +1 -1
  89. package/dist/src/commands/providers.js +150 -220
  90. package/dist/src/commands/providers.js.map +1 -1
  91. package/dist/src/commands/route.js +520 -665
  92. package/dist/src/commands/route.js.map +1 -1
  93. package/dist/src/commands/ruvector/backup.js +505 -651
  94. package/dist/src/commands/ruvector/backup.js.map +1 -1
  95. package/dist/src/commands/ruvector/benchmark.js +349 -401
  96. package/dist/src/commands/ruvector/benchmark.js.map +1 -1
  97. package/dist/src/commands/ruvector/import.js +224 -266
  98. package/dist/src/commands/ruvector/import.js.map +1 -1
  99. package/dist/src/commands/ruvector/index.js +37 -75
  100. package/dist/src/commands/ruvector/index.js.map +1 -1
  101. package/dist/src/commands/ruvector/init.js +336 -359
  102. package/dist/src/commands/ruvector/init.js.map +1 -1
  103. package/dist/src/commands/ruvector/migrate.js +335 -322
  104. package/dist/src/commands/ruvector/migrate.js.map +1 -1
  105. package/dist/src/commands/ruvector/optimize.js +375 -431
  106. package/dist/src/commands/ruvector/optimize.js.map +1 -1
  107. package/dist/src/commands/ruvector/setup.js +703 -117
  108. package/dist/src/commands/ruvector/setup.js.map +1 -1
  109. package/dist/src/commands/ruvector/status.js +364 -419
  110. package/dist/src/commands/ruvector/status.js.map +1 -1
  111. package/dist/src/commands/security.js +485 -608
  112. package/dist/src/commands/security.js.map +1 -1
  113. package/dist/src/commands/session.js +504 -626
  114. package/dist/src/commands/session.js.map +1 -1
  115. package/dist/src/commands/start.js +267 -364
  116. package/dist/src/commands/start.js.map +1 -1
  117. package/dist/src/commands/status.js +380 -486
  118. package/dist/src/commands/status.js.map +1 -1
  119. package/dist/src/commands/swarm.js +408 -488
  120. package/dist/src/commands/swarm.js.map +1 -1
  121. package/dist/src/commands/task.js +423 -538
  122. package/dist/src/commands/task.js.map +1 -1
  123. package/dist/src/commands/transfer-store.js +322 -412
  124. package/dist/src/commands/transfer-store.js.map +1 -1
  125. package/dist/src/commands/update.js +196 -291
  126. package/dist/src/commands/update.js.map +1 -1
  127. package/dist/src/commands/workflow.js +386 -486
  128. package/dist/src/commands/workflow.js.map +1 -1
  129. package/dist/src/config-adapter.d.ts +15 -0
  130. package/dist/src/config-adapter.d.ts.map +1 -0
  131. package/dist/src/config-adapter.js +38 -39
  132. package/dist/src/config-adapter.js.map +1 -1
  133. package/dist/src/index.d.ts +77 -0
  134. package/dist/src/index.d.ts.map +1 -0
  135. package/dist/src/index.js +309 -411
  136. package/dist/src/index.js.map +1 -1
  137. package/dist/src/infrastructure/in-memory-repositories.d.ts +68 -0
  138. package/dist/src/infrastructure/in-memory-repositories.d.ts.map +1 -0
  139. package/dist/src/infrastructure/in-memory-repositories.js +246 -507
  140. package/dist/src/infrastructure/in-memory-repositories.js.map +1 -1
  141. package/dist/src/init/claudemd-generator.d.ts +25 -0
  142. package/dist/src/init/claudemd-generator.d.ts.map +1 -0
  143. package/dist/src/init/claudemd-generator.js +368 -78
  144. package/dist/src/init/claudemd-generator.js.map +1 -1
  145. package/dist/src/init/executor.d.ts +41 -0
  146. package/dist/src/init/executor.d.ts.map +1 -0
  147. package/dist/src/init/executor.js +1307 -996
  148. package/dist/src/init/executor.js.map +1 -1
  149. package/dist/src/init/helpers-generator.d.ts +60 -0
  150. package/dist/src/init/helpers-generator.d.ts.map +1 -0
  151. package/dist/src/init/helpers-generator.js +657 -12
  152. package/dist/src/init/helpers-generator.js.map +1 -1
  153. package/dist/src/init/index.d.ts +1 -1
  154. package/dist/src/init/index.d.ts.map +1 -1
  155. package/dist/src/init/index.js +1 -1
  156. package/dist/src/init/index.js.map +1 -1
  157. package/dist/src/init/mcp-generator.js +33 -37
  158. package/dist/src/init/mcp-generator.js.map +1 -1
  159. package/dist/src/init/settings-generator.js +76 -77
  160. package/dist/src/init/settings-generator.js.map +1 -1
  161. package/dist/src/init/statusline-generator.js +801 -3
  162. package/dist/src/init/statusline-generator.js.map +1 -1
  163. package/dist/src/init/types.d.ts +1 -1
  164. package/dist/src/init/types.d.ts.map +1 -1
  165. package/dist/src/init/types.js +76 -59
  166. package/dist/src/init/types.js.map +1 -1
  167. package/dist/src/mcp-client.d.ts +92 -0
  168. package/dist/src/mcp-client.d.ts.map +1 -0
  169. package/dist/src/mcp-client.js +81 -125
  170. package/dist/src/mcp-client.js.map +1 -1
  171. package/dist/src/mcp-server.d.ts +161 -0
  172. package/dist/src/mcp-server.d.ts.map +1 -0
  173. package/dist/src/mcp-server.js +470 -757
  174. package/dist/src/mcp-server.js.map +1 -1
  175. package/dist/src/mcp-tools/agent-tools.js +391 -492
  176. package/dist/src/mcp-tools/agent-tools.js.map +1 -1
  177. package/dist/src/mcp-tools/agentdb-tools.js +332 -533
  178. package/dist/src/mcp-tools/agentdb-tools.js.map +1 -1
  179. package/dist/src/mcp-tools/analyze-tools.js +172 -236
  180. package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
  181. package/dist/src/mcp-tools/auto-install.d.ts +83 -0
  182. package/dist/src/mcp-tools/auto-install.d.ts.map +1 -0
  183. package/dist/src/mcp-tools/auto-install.js +80 -142
  184. package/dist/src/mcp-tools/auto-install.js.map +1 -1
  185. package/dist/src/mcp-tools/browser-tools.js +252 -375
  186. package/dist/src/mcp-tools/browser-tools.js.map +1 -1
  187. package/dist/src/mcp-tools/claims-tools.js +473 -565
  188. package/dist/src/mcp-tools/claims-tools.js.map +1 -1
  189. package/dist/src/mcp-tools/config-tools.js +197 -272
  190. package/dist/src/mcp-tools/config-tools.js.map +1 -1
  191. package/dist/src/mcp-tools/coordination-tools.js +500 -572
  192. package/dist/src/mcp-tools/coordination-tools.js.map +1 -1
  193. package/dist/src/mcp-tools/daa-tools.js +286 -364
  194. package/dist/src/mcp-tools/daa-tools.js.map +1 -1
  195. package/dist/src/mcp-tools/embeddings-tools.js +582 -693
  196. package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
  197. package/dist/src/mcp-tools/github-tools.js +260 -311
  198. package/dist/src/mcp-tools/github-tools.js.map +1 -1
  199. package/dist/src/mcp-tools/hive-mind-tools.js +573 -640
  200. package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
  201. package/dist/src/mcp-tools/hooks-tools.js +2215 -2648
  202. package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
  203. package/dist/src/mcp-tools/memory-tools.js +350 -505
  204. package/dist/src/mcp-tools/memory-tools.js.map +1 -1
  205. package/dist/src/mcp-tools/neural-tools.js +315 -412
  206. package/dist/src/mcp-tools/neural-tools.js.map +1 -1
  207. package/dist/src/mcp-tools/performance-tools.js +420 -480
  208. package/dist/src/mcp-tools/performance-tools.js.map +1 -1
  209. package/dist/src/mcp-tools/progress-tools.js +204 -278
  210. package/dist/src/mcp-tools/progress-tools.js.map +1 -1
  211. package/dist/src/mcp-tools/ruvllm-tools.js +163 -279
  212. package/dist/src/mcp-tools/ruvllm-tools.js.map +1 -1
  213. package/dist/src/mcp-tools/security-tools.js +297 -429
  214. package/dist/src/mcp-tools/security-tools.js.map +1 -1
  215. package/dist/src/mcp-tools/session-tools.js +185 -234
  216. package/dist/src/mcp-tools/session-tools.js.map +1 -1
  217. package/dist/src/mcp-tools/swarm-tools.js +207 -260
  218. package/dist/src/mcp-tools/swarm-tools.js.map +1 -1
  219. package/dist/src/mcp-tools/system-tools.js +276 -325
  220. package/dist/src/mcp-tools/system-tools.js.map +1 -1
  221. package/dist/src/mcp-tools/task-tools.js +270 -336
  222. package/dist/src/mcp-tools/task-tools.js.map +1 -1
  223. package/dist/src/mcp-tools/terminal-tools.js +148 -196
  224. package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
  225. package/dist/src/mcp-tools/transfer-tools.js +186 -333
  226. package/dist/src/mcp-tools/transfer-tools.js.map +1 -1
  227. package/dist/src/mcp-tools/types.d.ts +31 -0
  228. package/dist/src/mcp-tools/types.d.ts.map +1 -0
  229. package/dist/src/mcp-tools/wasm-agent-tools.js +133 -280
  230. package/dist/src/mcp-tools/wasm-agent-tools.js.map +1 -1
  231. package/dist/src/mcp-tools/workflow-tools.js +405 -450
  232. package/dist/src/mcp-tools/workflow-tools.js.map +1 -1
  233. package/dist/src/memory/ewc-consolidation.d.ts +295 -0
  234. package/dist/src/memory/ewc-consolidation.d.ts.map +1 -0
  235. package/dist/src/memory/ewc-consolidation.js +190 -303
  236. package/dist/src/memory/ewc-consolidation.js.map +1 -1
  237. package/dist/src/memory/intelligence.d.ts +338 -0
  238. package/dist/src/memory/intelligence.d.ts.map +1 -0
  239. package/dist/src/memory/intelligence.js +569 -794
  240. package/dist/src/memory/intelligence.js.map +1 -1
  241. package/dist/src/memory/memory-bridge.d.ts +407 -0
  242. package/dist/src/memory/memory-bridge.d.ts.map +1 -0
  243. package/dist/src/memory/memory-bridge.js +1170 -1640
  244. package/dist/src/memory/memory-bridge.js.map +1 -1
  245. package/dist/src/memory/memory-initializer.d.ts +412 -0
  246. package/dist/src/memory/memory-initializer.d.ts.map +1 -0
  247. package/dist/src/memory/memory-initializer.js +1836 -1851
  248. package/dist/src/memory/memory-initializer.js.map +1 -1
  249. package/dist/src/memory/sona-optimizer.d.ts +227 -0
  250. package/dist/src/memory/sona-optimizer.d.ts.map +1 -0
  251. package/dist/src/memory/sona-optimizer.js +199 -329
  252. package/dist/src/memory/sona-optimizer.js.map +1 -1
  253. package/dist/src/output.d.ts +2 -2
  254. package/dist/src/output.d.ts.map +1 -1
  255. package/dist/src/output.js +242 -272
  256. package/dist/src/output.js.map +1 -1
  257. package/dist/src/parser.d.ts +51 -0
  258. package/dist/src/parser.d.ts.map +1 -0
  259. package/dist/src/parser.js +140 -187
  260. package/dist/src/parser.js.map +1 -1
  261. package/dist/src/plugins/manager.d.ts +133 -0
  262. package/dist/src/plugins/manager.d.ts.map +1 -0
  263. package/dist/src/plugins/manager.js +285 -521
  264. package/dist/src/plugins/manager.js.map +1 -1
  265. package/dist/src/plugins/store/discovery.d.ts +88 -0
  266. package/dist/src/plugins/store/discovery.d.ts.map +1 -0
  267. package/dist/src/plugins/store/discovery.js +271 -358
  268. package/dist/src/plugins/store/discovery.js.map +1 -1
  269. package/dist/src/plugins/store/index.d.ts +76 -0
  270. package/dist/src/plugins/store/index.d.ts.map +1 -0
  271. package/dist/src/plugins/store/index.js +48 -105
  272. package/dist/src/plugins/store/index.js.map +1 -1
  273. package/dist/src/plugins/store/search.d.ts +46 -0
  274. package/dist/src/plugins/store/search.d.ts.map +1 -0
  275. package/dist/src/plugins/store/search.js +69 -107
  276. package/dist/src/plugins/store/search.js.map +1 -1
  277. package/dist/src/plugins/store/types.d.ts +274 -0
  278. package/dist/src/plugins/store/types.d.ts.map +1 -0
  279. package/dist/src/plugins/tests/demo-plugin-store.js +113 -160
  280. package/dist/src/plugins/tests/demo-plugin-store.js.map +1 -1
  281. package/dist/src/plugins/tests/standalone-test.js +172 -223
  282. package/dist/src/plugins/tests/standalone-test.js.map +1 -1
  283. package/dist/src/plugins/tests/test-plugin-store.js +190 -228
  284. package/dist/src/plugins/tests/test-plugin-store.js.map +1 -1
  285. package/dist/src/production/circuit-breaker.d.ts +101 -0
  286. package/dist/src/production/circuit-breaker.d.ts.map +1 -0
  287. package/dist/src/production/circuit-breaker.js +62 -126
  288. package/dist/src/production/circuit-breaker.js.map +1 -1
  289. package/dist/src/production/error-handler.d.ts +92 -0
  290. package/dist/src/production/error-handler.d.ts.map +1 -0
  291. package/dist/src/production/error-handler.js +86 -156
  292. package/dist/src/production/error-handler.js.map +1 -1
  293. package/dist/src/production/monitoring.d.ts +161 -0
  294. package/dist/src/production/monitoring.d.ts.map +1 -0
  295. package/dist/src/production/monitoring.js +139 -220
  296. package/dist/src/production/monitoring.js.map +1 -1
  297. package/dist/src/production/rate-limiter.d.ts +80 -0
  298. package/dist/src/production/rate-limiter.d.ts.map +1 -0
  299. package/dist/src/production/rate-limiter.js +74 -93
  300. package/dist/src/production/rate-limiter.js.map +1 -1
  301. package/dist/src/production/retry.d.ts +48 -0
  302. package/dist/src/production/retry.d.ts.map +1 -0
  303. package/dist/src/production/retry.js +75 -167
  304. package/dist/src/production/retry.js.map +1 -1
  305. package/dist/src/prompt.d.ts +44 -0
  306. package/dist/src/prompt.d.ts.map +1 -0
  307. package/dist/src/prompt.js +436 -560
  308. package/dist/src/prompt.js.map +1 -1
  309. package/dist/src/runtime/headless.d.ts +60 -0
  310. package/dist/src/runtime/headless.d.ts.map +1 -0
  311. package/dist/src/runtime/headless.js +197 -286
  312. package/dist/src/runtime/headless.js.map +1 -1
  313. package/dist/src/ruvector/agent-wasm.d.ts +182 -0
  314. package/dist/src/ruvector/agent-wasm.d.ts.map +1 -0
  315. package/dist/src/ruvector/agent-wasm.js +156 -351
  316. package/dist/src/ruvector/agent-wasm.js.map +1 -1
  317. package/dist/src/ruvector/ast-analyzer.d.ts +67 -0
  318. package/dist/src/ruvector/ast-analyzer.d.ts.map +1 -0
  319. package/dist/src/ruvector/ast-analyzer.js +145 -232
  320. package/dist/src/ruvector/ast-analyzer.js.map +1 -1
  321. package/dist/src/ruvector/coverage-router.d.ts +160 -0
  322. package/dist/src/ruvector/coverage-router.d.ts.map +1 -0
  323. package/dist/src/ruvector/coverage-router.js +287 -419
  324. package/dist/src/ruvector/coverage-router.js.map +1 -1
  325. package/dist/src/ruvector/coverage-tools.js +56 -101
  326. package/dist/src/ruvector/coverage-tools.js.map +1 -1
  327. package/dist/src/ruvector/diff-classifier.d.ts +175 -0
  328. package/dist/src/ruvector/diff-classifier.d.ts.map +1 -0
  329. package/dist/src/ruvector/diff-classifier.js +324 -451
  330. package/dist/src/ruvector/diff-classifier.js.map +1 -1
  331. package/dist/src/ruvector/enhanced-model-router.d.ts +146 -0
  332. package/dist/src/ruvector/enhanced-model-router.d.ts.map +1 -0
  333. package/dist/src/ruvector/enhanced-model-router.js +260 -336
  334. package/dist/src/ruvector/enhanced-model-router.js.map +1 -1
  335. package/dist/src/ruvector/flash-attention.d.ts +195 -0
  336. package/dist/src/ruvector/flash-attention.d.ts.map +1 -0
  337. package/dist/src/ruvector/flash-attention.js +223 -254
  338. package/dist/src/ruvector/flash-attention.js.map +1 -1
  339. package/dist/src/ruvector/graph-analyzer.d.ts +187 -0
  340. package/dist/src/ruvector/graph-analyzer.d.ts.map +1 -0
  341. package/dist/src/ruvector/graph-analyzer.js +486 -680
  342. package/dist/src/ruvector/graph-analyzer.js.map +1 -1
  343. package/dist/src/ruvector/index.d.ts +40 -0
  344. package/dist/src/ruvector/index.d.ts.map +1 -0
  345. package/dist/src/ruvector/index.js +36 -106
  346. package/dist/src/ruvector/index.js.map +1 -1
  347. package/dist/src/ruvector/lora-adapter.d.ts +218 -0
  348. package/dist/src/ruvector/lora-adapter.d.ts.map +1 -0
  349. package/dist/src/ruvector/lora-adapter.js +155 -248
  350. package/dist/src/ruvector/lora-adapter.js.map +1 -1
  351. package/dist/src/ruvector/model-router.d.ts +220 -0
  352. package/dist/src/ruvector/model-router.d.ts.map +1 -0
  353. package/dist/src/ruvector/model-router.js +175 -248
  354. package/dist/src/ruvector/model-router.js.map +1 -1
  355. package/dist/src/ruvector/moe-router.d.ts +206 -0
  356. package/dist/src/ruvector/moe-router.d.ts.map +1 -0
  357. package/dist/src/ruvector/moe-router.js +228 -286
  358. package/dist/src/ruvector/moe-router.js.map +1 -1
  359. package/dist/src/ruvector/q-learning-router.d.ts +211 -0
  360. package/dist/src/ruvector/q-learning-router.d.ts.map +1 -0
  361. package/dist/src/ruvector/q-learning-router.js +257 -338
  362. package/dist/src/ruvector/q-learning-router.js.map +1 -1
  363. package/dist/src/ruvector/ruvllm-wasm.d.ts +179 -0
  364. package/dist/src/ruvector/ruvllm-wasm.d.ts.map +1 -0
  365. package/dist/src/ruvector/ruvllm-wasm.js +270 -434
  366. package/dist/src/ruvector/ruvllm-wasm.js.map +1 -1
  367. package/dist/src/ruvector/semantic-router.d.ts +77 -0
  368. package/dist/src/ruvector/semantic-router.d.ts.map +1 -0
  369. package/dist/src/ruvector/semantic-router.js +60 -67
  370. package/dist/src/ruvector/semantic-router.js.map +1 -1
  371. package/dist/src/ruvector/vector-db.d.ts +69 -0
  372. package/dist/src/ruvector/vector-db.d.ts.map +1 -0
  373. package/dist/src/ruvector/vector-db.js +119 -205
  374. package/dist/src/ruvector/vector-db.js.map +1 -1
  375. package/dist/src/services/agentic-flow-bridge.d.ts +50 -0
  376. package/dist/src/services/agentic-flow-bridge.d.ts.map +1 -0
  377. package/dist/src/services/agentic-flow-bridge.js +32 -105
  378. package/dist/src/services/agentic-flow-bridge.js.map +1 -1
  379. package/dist/src/services/claim-service.d.ts +204 -0
  380. package/dist/src/services/claim-service.d.ts.map +1 -0
  381. package/dist/src/services/claim-service.js +615 -940
  382. package/dist/src/services/claim-service.js.map +1 -1
  383. package/dist/src/services/container-worker-pool.d.ts +197 -0
  384. package/dist/src/services/container-worker-pool.d.ts.map +1 -0
  385. package/dist/src/services/container-worker-pool.js +398 -666
  386. package/dist/src/services/container-worker-pool.js.map +1 -1
  387. package/dist/src/services/headless-worker-executor.d.ts +304 -0
  388. package/dist/src/services/headless-worker-executor.d.ts.map +1 -0
  389. package/dist/src/services/headless-worker-executor.js +441 -467
  390. package/dist/src/services/headless-worker-executor.js.map +1 -1
  391. package/dist/src/services/index.d.ts +4 -4
  392. package/dist/src/services/index.d.ts.map +1 -1
  393. package/dist/src/services/index.js +4 -4
  394. package/dist/src/services/index.js.map +1 -1
  395. package/dist/src/services/registry-api.d.ts +58 -0
  396. package/dist/src/services/registry-api.d.ts.map +1 -0
  397. package/dist/src/services/registry-api.js +92 -200
  398. package/dist/src/services/registry-api.js.map +1 -1
  399. package/dist/src/services/ruvector-training.d.ts +222 -0
  400. package/dist/src/services/ruvector-training.d.ts.map +1 -0
  401. package/dist/src/services/ruvector-training.js +257 -337
  402. package/dist/src/services/ruvector-training.js.map +1 -1
  403. package/dist/src/services/worker-daemon.d.ts +228 -0
  404. package/dist/src/services/worker-daemon.d.ts.map +1 -0
  405. package/dist/src/services/worker-daemon.js +591 -849
  406. package/dist/src/services/worker-daemon.js.map +1 -1
  407. package/dist/src/services/worker-queue.d.ts +194 -0
  408. package/dist/src/services/worker-queue.d.ts.map +1 -0
  409. package/dist/src/services/worker-queue.js +331 -548
  410. package/dist/src/services/worker-queue.js.map +1 -1
  411. package/dist/src/suggest.d.ts +53 -0
  412. package/dist/src/suggest.d.ts.map +1 -0
  413. package/dist/src/suggest.js +45 -55
  414. package/dist/src/suggest.js.map +1 -1
  415. package/dist/src/transfer/anonymization/index.js +29 -37
  416. package/dist/src/transfer/anonymization/index.js.map +1 -1
  417. package/dist/src/transfer/deploy-seraphine.js +128 -155
  418. package/dist/src/transfer/deploy-seraphine.js.map +1 -1
  419. package/dist/src/transfer/export.d.ts +25 -0
  420. package/dist/src/transfer/export.d.ts.map +1 -0
  421. package/dist/src/transfer/export.js +84 -142
  422. package/dist/src/transfer/export.js.map +1 -1
  423. package/dist/src/transfer/index.d.ts +1 -1
  424. package/dist/src/transfer/index.d.ts.map +1 -1
  425. package/dist/src/transfer/index.js +0 -2
  426. package/dist/src/transfer/index.js.map +1 -1
  427. package/dist/src/transfer/ipfs/client.d.ts +109 -0
  428. package/dist/src/transfer/ipfs/client.d.ts.map +1 -0
  429. package/dist/src/transfer/ipfs/client.js +187 -337
  430. package/dist/src/transfer/ipfs/client.js.map +1 -1
  431. package/dist/src/transfer/ipfs/upload.d.ts +95 -0
  432. package/dist/src/transfer/ipfs/upload.d.ts.map +1 -0
  433. package/dist/src/transfer/ipfs/upload.js +288 -434
  434. package/dist/src/transfer/ipfs/upload.js.map +1 -1
  435. package/dist/src/transfer/models/seraphine.d.ts +72 -0
  436. package/dist/src/transfer/models/seraphine.d.ts.map +1 -0
  437. package/dist/src/transfer/models/seraphine.js +55 -55
  438. package/dist/src/transfer/models/seraphine.js.map +1 -1
  439. package/dist/src/transfer/serialization/cfp.d.ts +49 -0
  440. package/dist/src/transfer/serialization/cfp.d.ts.map +1 -0
  441. package/dist/src/transfer/serialization/cfp.js +30 -31
  442. package/dist/src/transfer/serialization/cfp.js.map +1 -1
  443. package/dist/src/transfer/storage/gcs.d.ts +82 -0
  444. package/dist/src/transfer/storage/gcs.d.ts.map +1 -0
  445. package/dist/src/transfer/storage/gcs.js +165 -232
  446. package/dist/src/transfer/storage/gcs.js.map +1 -1
  447. package/dist/src/transfer/store/discovery.d.ts +84 -0
  448. package/dist/src/transfer/store/discovery.d.ts.map +1 -0
  449. package/dist/src/transfer/store/discovery.js +239 -349
  450. package/dist/src/transfer/store/discovery.js.map +1 -1
  451. package/dist/src/transfer/store/download.d.ts +70 -0
  452. package/dist/src/transfer/store/download.d.ts.map +1 -0
  453. package/dist/src/transfer/store/download.js +243 -365
  454. package/dist/src/transfer/store/download.js.map +1 -1
  455. package/dist/src/transfer/store/index.d.ts +84 -0
  456. package/dist/src/transfer/store/index.d.ts.map +1 -0
  457. package/dist/src/transfer/store/index.js +63 -130
  458. package/dist/src/transfer/store/index.js.map +1 -1
  459. package/dist/src/transfer/store/publish.d.ts +76 -0
  460. package/dist/src/transfer/store/publish.d.ts.map +1 -0
  461. package/dist/src/transfer/store/publish.js +184 -258
  462. package/dist/src/transfer/store/publish.js.map +1 -1
  463. package/dist/src/transfer/store/registry.js +50 -72
  464. package/dist/src/transfer/store/registry.js.map +1 -1
  465. package/dist/src/transfer/store/search.d.ts +54 -0
  466. package/dist/src/transfer/store/search.d.ts.map +1 -0
  467. package/dist/src/transfer/store/search.js +64 -96
  468. package/dist/src/transfer/store/search.js.map +1 -1
  469. package/dist/src/transfer/store/tests/standalone-test.js +174 -231
  470. package/dist/src/transfer/store/tests/standalone-test.js.map +1 -1
  471. package/dist/src/transfer/test-seraphine.js +95 -130
  472. package/dist/src/transfer/test-seraphine.js.map +1 -1
  473. package/dist/src/transfer/tests/test-store.js +194 -239
  474. package/dist/src/transfer/tests/test-store.js.map +1 -1
  475. package/dist/src/transfer/types.d.ts +245 -0
  476. package/dist/src/transfer/types.d.ts.map +1 -0
  477. package/dist/src/types.d.ts +198 -0
  478. package/dist/src/types.d.ts.map +1 -0
  479. package/dist/src/types.js +26 -55
  480. package/dist/src/types.js.map +1 -1
  481. package/dist/src/update/checker.d.ts +34 -0
  482. package/dist/src/update/checker.d.ts.map +1 -0
  483. package/dist/src/update/checker.js +106 -183
  484. package/dist/src/update/checker.js.map +1 -1
  485. package/dist/src/update/executor.d.ts +32 -0
  486. package/dist/src/update/executor.d.ts.map +1 -0
  487. package/dist/src/update/executor.js +135 -198
  488. package/dist/src/update/executor.js.map +1 -1
  489. package/dist/src/update/index.d.ts +33 -0
  490. package/dist/src/update/index.d.ts.map +1 -0
  491. package/dist/src/update/index.js +38 -85
  492. package/dist/src/update/index.js.map +1 -1
  493. package/dist/src/update/rate-limiter.d.ts +20 -0
  494. package/dist/src/update/rate-limiter.d.ts.map +1 -0
  495. package/dist/src/update/rate-limiter.js +19 -31
  496. package/dist/src/update/rate-limiter.js.map +1 -1
  497. package/dist/src/update/validator.d.ts +17 -0
  498. package/dist/src/update/validator.d.ts.map +1 -0
  499. package/dist/src/update/validator.js +38 -64
  500. package/dist/src/update/validator.js.map +1 -1
  501. package/dist/tsconfig.tsbuildinfo +1 -1
  502. package/package.json +1 -1
@@ -2,42 +2,6 @@
2
2
  * V3 CLI Swarm Command
3
3
  * Swarm coordination and management commands
4
4
  */
5
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
6
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7
- return new (P || (P = Promise))(function (resolve, reject) {
8
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11
- step((generator = generator.apply(thisArg, _arguments || [])).next());
12
- });
13
- };
14
- var __generator = (this && this.__generator) || function (thisArg, body) {
15
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
16
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
17
- function verb(n) { return function (v) { return step([n, v]); }; }
18
- function step(op) {
19
- if (f) throw new TypeError("Generator is already executing.");
20
- while (_) try {
21
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
22
- if (y = 0, t) op = [op[0] & 2, t.value];
23
- switch (op[0]) {
24
- case 0: case 1: t = op; break;
25
- case 4: _.label++; return { value: op[1], done: false };
26
- case 5: _.label++; y = op[1]; op = [0]; continue;
27
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
28
- default:
29
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
30
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
31
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
32
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
33
- if (t[2]) _.ops.pop();
34
- _.trys.pop(); continue;
35
- }
36
- op = body.call(thisArg, _);
37
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
38
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
39
- }
40
- };
41
5
  import { output } from '../output.js';
42
6
  import { select, confirm } from '../prompt.js';
43
7
  import { callMCPTool, MCPClientError } from '../mcp-client.js';
@@ -45,85 +9,81 @@ import * as fs from 'fs';
45
9
  import * as path from 'path';
46
10
  // Get dynamic swarm status from memory/session files
47
11
  function getSwarmStatus(swarmId) {
48
- var _a, _b, _c, _d;
49
- var swarmDir = path.join(process.cwd(), '.swarm');
50
- var sessionDir = path.join(process.cwd(), '.claude', 'sessions');
51
- var memoryPaths = [
12
+ const swarmDir = path.join(process.cwd(), '.swarm');
13
+ const sessionDir = path.join(process.cwd(), '.claude', 'sessions');
14
+ const memoryPaths = [
52
15
  path.join(process.cwd(), '.swarm', 'memory.db'),
53
16
  path.join(process.cwd(), '.claude', 'memory.db'),
54
17
  ];
55
18
  // Check for active swarm state file
56
- var swarmStateFile = path.join(swarmDir, 'state.json');
57
- var swarmState = null;
19
+ const swarmStateFile = path.join(swarmDir, 'state.json');
20
+ let swarmState = null;
58
21
  if (fs.existsSync(swarmStateFile)) {
59
22
  try {
60
23
  swarmState = JSON.parse(fs.readFileSync(swarmStateFile, 'utf-8'));
61
24
  }
62
- catch (_e) {
25
+ catch {
63
26
  // Ignore parse errors
64
27
  }
65
28
  }
66
29
  // Count active agents from process files
67
- var activeAgents = 0;
68
- var totalAgents = 0;
69
- var agentsDir = path.join(swarmDir, 'agents');
30
+ let activeAgents = 0;
31
+ let totalAgents = 0;
32
+ const agentsDir = path.join(swarmDir, 'agents');
70
33
  if (fs.existsSync(agentsDir)) {
71
34
  try {
72
- var agentFiles = fs.readdirSync(agentsDir).filter(function (f) { return f.endsWith('.json'); });
35
+ const agentFiles = fs.readdirSync(agentsDir).filter(f => f.endsWith('.json'));
73
36
  totalAgents = agentFiles.length;
74
- for (var _i = 0, agentFiles_1 = agentFiles; _i < agentFiles_1.length; _i++) {
75
- var file = agentFiles_1[_i];
37
+ for (const file of agentFiles) {
76
38
  try {
77
- var agent = JSON.parse(fs.readFileSync(path.join(agentsDir, file), 'utf-8'));
39
+ const agent = JSON.parse(fs.readFileSync(path.join(agentsDir, file), 'utf-8'));
78
40
  if (agent.status === 'active' || agent.status === 'running') {
79
41
  activeAgents++;
80
42
  }
81
43
  }
82
- catch (_f) {
44
+ catch {
83
45
  // Ignore
84
46
  }
85
47
  }
86
48
  }
87
- catch (_g) {
49
+ catch {
88
50
  // Ignore
89
51
  }
90
52
  }
91
53
  // Get session count
92
- var sessionCount = 0;
54
+ let sessionCount = 0;
93
55
  if (fs.existsSync(sessionDir)) {
94
56
  try {
95
- sessionCount = fs.readdirSync(sessionDir).filter(function (f) { return f.endsWith('.json'); }).length;
57
+ sessionCount = fs.readdirSync(sessionDir).filter(f => f.endsWith('.json')).length;
96
58
  }
97
- catch (_h) {
59
+ catch {
98
60
  // Ignore
99
61
  }
100
62
  }
101
63
  // Get memory size as rough indicator of activity
102
- var memorySize = 0;
103
- for (var _j = 0, memoryPaths_1 = memoryPaths; _j < memoryPaths_1.length; _j++) {
104
- var dbPath = memoryPaths_1[_j];
64
+ let memorySize = 0;
65
+ for (const dbPath of memoryPaths) {
105
66
  if (fs.existsSync(dbPath)) {
106
67
  try {
107
68
  memorySize = fs.statSync(dbPath).size;
108
69
  break;
109
70
  }
110
- catch (_k) {
71
+ catch {
111
72
  // Ignore
112
73
  }
113
74
  }
114
75
  }
115
76
  // Count task files if they exist
116
- var completedTasks = 0;
117
- var inProgressTasks = 0;
118
- var pendingTasks = 0;
119
- var tasksDir = path.join(swarmDir, 'tasks');
77
+ let completedTasks = 0;
78
+ let inProgressTasks = 0;
79
+ let pendingTasks = 0;
80
+ const tasksDir = path.join(swarmDir, 'tasks');
120
81
  if (fs.existsSync(tasksDir)) {
121
82
  try {
122
- var taskFiles = fs.readdirSync(tasksDir).filter(function (f) { return f.endsWith('.json'); });
123
- for (var _l = 0, taskFiles_1 = taskFiles; _l < taskFiles_1.length; _l++) {
124
- var file = taskFiles_1[_l];
83
+ const taskFiles = fs.readdirSync(tasksDir).filter(f => f.endsWith('.json'));
84
+ for (const file of taskFiles) {
125
85
  try {
126
- var task = JSON.parse(fs.readFileSync(path.join(tasksDir, file), 'utf-8'));
86
+ const task = JSON.parse(fs.readFileSync(path.join(tasksDir, file), 'utf-8'));
127
87
  if (task.status === 'completed' || task.status === 'done') {
128
88
  completedTasks++;
129
89
  }
@@ -134,19 +94,19 @@ function getSwarmStatus(swarmId) {
134
94
  pendingTasks++;
135
95
  }
136
96
  }
137
- catch (_m) {
97
+ catch {
138
98
  // Ignore
139
99
  }
140
100
  }
141
101
  }
142
- catch (_o) {
102
+ catch {
143
103
  // Ignore
144
104
  }
145
105
  }
146
106
  // Calculate dynamic progress based on actual state
147
107
  // If no swarm state, show 0%. Otherwise calculate from completed tasks
148
- var totalTasks = completedTasks + inProgressTasks + pendingTasks;
149
- var progress = 0;
108
+ const totalTasks = completedTasks + inProgressTasks + pendingTasks;
109
+ let progress = 0;
150
110
  if (totalTasks > 0) {
151
111
  progress = Math.round((completedTasks / totalTasks) * 100);
152
112
  }
@@ -155,7 +115,7 @@ function getSwarmStatus(swarmId) {
155
115
  progress = 5;
156
116
  }
157
117
  // Determine status
158
- var status = 'idle';
118
+ let status = 'idle';
159
119
  if (inProgressTasks > 0 || activeAgents > 0) {
160
120
  status = 'running';
161
121
  }
@@ -166,18 +126,18 @@ function getSwarmStatus(swarmId) {
166
126
  status = 'ready';
167
127
  }
168
128
  return {
169
- id: swarmId || ((_a = swarmState) === null || _a === void 0 ? void 0 : _a.id) || 'no-active-swarm',
170
- topology: ((_b = swarmState) === null || _b === void 0 ? void 0 : _b.topology) || 'none',
171
- status: status,
172
- objective: ((_c = swarmState) === null || _c === void 0 ? void 0 : _c.objective) || 'No active objective',
173
- strategy: ((_d = swarmState) === null || _d === void 0 ? void 0 : _d.strategy) || 'none',
129
+ id: swarmId || swarmState?.id || 'no-active-swarm',
130
+ topology: swarmState?.topology || 'none',
131
+ status,
132
+ objective: swarmState?.objective || 'No active objective',
133
+ strategy: swarmState?.strategy || 'none',
174
134
  agents: {
175
135
  total: totalAgents,
176
136
  active: activeAgents,
177
137
  idle: Math.max(0, totalAgents - activeAgents),
178
138
  completed: 0
179
139
  },
180
- progress: progress,
140
+ progress,
181
141
  tasks: {
182
142
  total: totalTasks,
183
143
  completed: completedTasks,
@@ -187,7 +147,7 @@ function getSwarmStatus(swarmId) {
187
147
  metrics: {
188
148
  tokensUsed: 0,
189
149
  avgResponseTime: '--',
190
- successRate: totalTasks > 0 ? Math.round((completedTasks / totalTasks) * 100) + "%" : '--',
150
+ successRate: totalTasks > 0 ? `${Math.round((completedTasks / totalTasks) * 100)}%` : '--',
191
151
  elapsedTime: '--'
192
152
  },
193
153
  coordination: {
@@ -199,7 +159,7 @@ function getSwarmStatus(swarmId) {
199
159
  };
200
160
  }
201
161
  // Swarm topologies
202
- var TOPOLOGIES = [
162
+ const TOPOLOGIES = [
203
163
  { value: 'hierarchical', label: 'Hierarchical', hint: 'Queen-led coordination with worker agents' },
204
164
  { value: 'mesh', label: 'Mesh', hint: 'Fully connected peer-to-peer network' },
205
165
  { value: 'ring', label: 'Ring', hint: 'Circular communication pattern' },
@@ -208,7 +168,7 @@ var TOPOLOGIES = [
208
168
  { value: 'hierarchical-mesh', label: 'Hierarchical Mesh', hint: 'V3 15-agent queen + peer communication (recommended)' }
209
169
  ];
210
170
  // Swarm strategies
211
- var STRATEGIES = [
171
+ const STRATEGIES = [
212
172
  { value: 'specialized', label: 'Specialized', hint: 'Clear roles, no overlap (anti-drift)' },
213
173
  { value: 'balanced', label: 'Balanced', hint: 'Even distribution of work' },
214
174
  { value: 'adaptive', label: 'Adaptive', hint: 'Dynamic strategy based on task' },
@@ -220,7 +180,7 @@ var STRATEGIES = [
220
180
  { value: 'analysis', label: 'Analysis', hint: 'Code analysis and documentation' }
221
181
  ];
222
182
  // Initialize swarm
223
- var initCommand = {
183
+ const initCommand = {
224
184
  name: 'init',
225
185
  description: 'Initialize a new swarm',
226
186
  options: [
@@ -229,147 +189,136 @@ var initCommand = {
229
189
  short: 't',
230
190
  description: 'Swarm topology',
231
191
  type: 'string',
232
- choices: TOPOLOGIES.map(function (t) { return t.value; }),
233
- "default": 'hierarchical'
192
+ choices: TOPOLOGIES.map(t => t.value),
193
+ default: 'hierarchical'
234
194
  },
235
195
  {
236
196
  name: 'max-agents',
237
197
  short: 'm',
238
198
  description: 'Maximum number of agents',
239
199
  type: 'number',
240
- "default": 15
200
+ default: 15
241
201
  },
242
202
  {
243
203
  name: 'auto-scale',
244
204
  description: 'Enable automatic scaling',
245
205
  type: 'boolean',
246
- "default": true
206
+ default: true
247
207
  },
248
208
  {
249
209
  name: 'strategy',
250
210
  short: 's',
251
211
  description: 'Coordination strategy',
252
212
  type: 'string',
253
- choices: STRATEGIES.map(function (s) { return s.value; })
213
+ choices: STRATEGIES.map(s => s.value)
254
214
  },
255
215
  {
256
216
  name: 'v3-mode',
257
217
  description: 'Enable V3 15-agent hierarchical mesh mode',
258
218
  type: 'boolean',
259
- "default": false
219
+ default: false
260
220
  }
261
221
  ],
262
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
263
- var topology, maxAgents, v3Mode, result, swarmDir, stateFile, error_1;
264
- var _a;
265
- return __generator(this, function (_b) {
266
- switch (_b.label) {
267
- case 0:
268
- topology = ctx.flags.topology;
269
- maxAgents = ctx.flags.maxAgents || 15;
270
- v3Mode = ctx.flags.v3Mode;
271
- // V3 mode enables hierarchical-mesh hybrid
272
- if (v3Mode) {
273
- topology = 'hierarchical-mesh';
274
- output.printInfo('V3 Mode: Using hierarchical-mesh topology with 15-agent coordination');
275
- }
276
- if (!(!topology && ctx.interactive)) return [3 /*break*/, 2];
277
- return [4 /*yield*/, select({
278
- message: 'Select swarm topology:',
279
- options: TOPOLOGIES,
280
- "default": 'hierarchical'
281
- })];
282
- case 1:
283
- topology = _b.sent();
284
- _b.label = 2;
285
- case 2:
286
- output.writeln();
287
- output.printInfo('Initializing swarm...');
288
- _b.label = 3;
289
- case 3:
290
- _b.trys.push([3, 5, , 6]);
291
- return [4 /*yield*/, callMCPTool('swarm_init', {
292
- topology: topology,
293
- maxAgents: maxAgents,
294
- config: {
295
- communicationProtocol: 'message-bus',
296
- consensusMechanism: 'majority',
297
- failureHandling: 'retry',
298
- loadBalancing: true,
299
- autoScaling: (_a = ctx.flags.autoScale) !== null && _a !== void 0 ? _a : true
300
- },
301
- metadata: {
302
- v3Mode: v3Mode,
303
- strategy: ctx.flags.strategy || 'development'
304
- }
305
- })];
306
- case 4:
307
- result = _b.sent();
308
- // Display initialization progress
309
- output.writeln(output.dim(' Creating coordination topology...'));
310
- output.writeln(output.dim(' Initializing memory namespace...'));
311
- output.writeln(output.dim(' Setting up communication channels...'));
312
- if (v3Mode) {
313
- output.writeln(output.dim(' Enabling Flash Attention (2.49x-7.47x speedup)...'));
314
- output.writeln(output.dim(' Configuring AgentDB integration (150x faster)...'));
315
- output.writeln(output.dim(' Initializing SONA learning system...'));
316
- }
317
- output.writeln();
318
- output.printTable({
319
- columns: [
320
- { key: 'property', header: 'Property', width: 20 },
321
- { key: 'value', header: 'Value', width: 35 }
322
- ],
323
- data: [
324
- { property: 'Swarm ID', value: result.swarmId },
325
- { property: 'Topology', value: result.topology },
326
- { property: 'Max Agents', value: result.config.maxAgents },
327
- { property: 'Auto Scale', value: result.config.autoScaling ? 'Enabled' : 'Disabled' },
328
- { property: 'Protocol', value: result.config.communicationProtocol || 'N/A' },
329
- { property: 'V3 Mode', value: v3Mode ? 'Enabled' : 'Disabled' }
330
- ]
331
- });
332
- output.writeln();
333
- output.printSuccess('Swarm initialized successfully');
334
- swarmDir = path.join(process.cwd(), '.swarm');
335
- try {
336
- if (!fs.existsSync(swarmDir)) {
337
- fs.mkdirSync(swarmDir, { recursive: true });
338
- }
339
- stateFile = path.join(swarmDir, 'state.json');
340
- fs.writeFileSync(stateFile, JSON.stringify({
341
- id: result.swarmId,
342
- topology: result.topology,
343
- maxAgents: result.config.maxAgents,
344
- strategy: ctx.flags.strategy || 'development',
345
- v3Mode: v3Mode,
346
- initializedAt: result.initializedAt,
347
- status: 'ready'
348
- }, null, 2));
349
- }
350
- catch (_c) {
351
- // Ignore errors writing state file
352
- }
353
- if (ctx.flags.format === 'json') {
354
- output.printJson(result);
355
- }
356
- return [2 /*return*/, { success: true, data: result }];
357
- case 5:
358
- error_1 = _b.sent();
359
- if (error_1 instanceof MCPClientError) {
360
- output.printError("Failed to initialize swarm: " + error_1.message);
361
- }
362
- else {
363
- output.printError("Unexpected error: " + String(error_1));
364
- }
365
- return [2 /*return*/, { success: false, exitCode: 1 }];
366
- case 6: return [2 /*return*/];
222
+ action: async (ctx) => {
223
+ let topology = ctx.flags.topology;
224
+ const maxAgents = ctx.flags.maxAgents || 15;
225
+ const v3Mode = ctx.flags.v3Mode;
226
+ // V3 mode enables hierarchical-mesh hybrid
227
+ if (v3Mode) {
228
+ topology = 'hierarchical-mesh';
229
+ output.printInfo('V3 Mode: Using hierarchical-mesh topology with 15-agent coordination');
230
+ }
231
+ // Interactive topology selection
232
+ if (!topology && ctx.interactive) {
233
+ topology = await select({
234
+ message: 'Select swarm topology:',
235
+ options: TOPOLOGIES,
236
+ default: 'hierarchical'
237
+ });
238
+ }
239
+ output.writeln();
240
+ output.printInfo('Initializing swarm...');
241
+ try {
242
+ // Call MCP tool to initialize swarm
243
+ const result = await callMCPTool('swarm_init', {
244
+ topology: topology,
245
+ maxAgents,
246
+ config: {
247
+ communicationProtocol: 'message-bus',
248
+ consensusMechanism: 'majority',
249
+ failureHandling: 'retry',
250
+ loadBalancing: true,
251
+ autoScaling: ctx.flags.autoScale ?? true,
252
+ },
253
+ metadata: {
254
+ v3Mode,
255
+ strategy: ctx.flags.strategy || 'development',
256
+ },
257
+ });
258
+ // Display initialization progress
259
+ output.writeln(output.dim(' Creating coordination topology...'));
260
+ output.writeln(output.dim(' Initializing memory namespace...'));
261
+ output.writeln(output.dim(' Setting up communication channels...'));
262
+ if (v3Mode) {
263
+ output.writeln(output.dim(' Enabling Flash Attention (2.49x-7.47x speedup)...'));
264
+ output.writeln(output.dim(' Configuring AgentDB integration (150x faster)...'));
265
+ output.writeln(output.dim(' Initializing SONA learning system...'));
367
266
  }
368
- });
369
- }); }
267
+ output.writeln();
268
+ output.printTable({
269
+ columns: [
270
+ { key: 'property', header: 'Property', width: 20 },
271
+ { key: 'value', header: 'Value', width: 35 }
272
+ ],
273
+ data: [
274
+ { property: 'Swarm ID', value: result.swarmId },
275
+ { property: 'Topology', value: result.topology },
276
+ { property: 'Max Agents', value: result.config.maxAgents },
277
+ { property: 'Auto Scale', value: result.config.autoScaling ? 'Enabled' : 'Disabled' },
278
+ { property: 'Protocol', value: result.config.communicationProtocol || 'N/A' },
279
+ { property: 'V3 Mode', value: v3Mode ? 'Enabled' : 'Disabled' }
280
+ ]
281
+ });
282
+ output.writeln();
283
+ output.printSuccess('Swarm initialized successfully');
284
+ // Save swarm state locally for status command to read
285
+ const swarmDir = path.join(process.cwd(), '.swarm');
286
+ try {
287
+ if (!fs.existsSync(swarmDir)) {
288
+ fs.mkdirSync(swarmDir, { recursive: true });
289
+ }
290
+ const stateFile = path.join(swarmDir, 'state.json');
291
+ fs.writeFileSync(stateFile, JSON.stringify({
292
+ id: result.swarmId,
293
+ topology: result.topology,
294
+ maxAgents: result.config.maxAgents,
295
+ strategy: ctx.flags.strategy || 'development',
296
+ v3Mode,
297
+ initializedAt: result.initializedAt,
298
+ status: 'ready'
299
+ }, null, 2));
300
+ }
301
+ catch {
302
+ // Ignore errors writing state file
303
+ }
304
+ if (ctx.flags.format === 'json') {
305
+ output.printJson(result);
306
+ }
307
+ return { success: true, data: result };
308
+ }
309
+ catch (error) {
310
+ if (error instanceof MCPClientError) {
311
+ output.printError(`Failed to initialize swarm: ${error.message}`);
312
+ }
313
+ else {
314
+ output.printError(`Unexpected error: ${String(error)}`);
315
+ }
316
+ return { success: false, exitCode: 1 };
317
+ }
318
+ }
370
319
  };
371
320
  // Start swarm execution
372
- var startCommand = {
321
+ const startCommand = {
373
322
  name: 'start',
374
323
  description: 'Start swarm execution',
375
324
  options: [
@@ -385,184 +334,170 @@ var startCommand = {
385
334
  short: 's',
386
335
  description: 'Execution strategy',
387
336
  type: 'string',
388
- choices: STRATEGIES.map(function (s) { return s.value; })
337
+ choices: STRATEGIES.map(s => s.value)
389
338
  },
390
339
  {
391
340
  name: 'parallel',
392
341
  short: 'p',
393
342
  description: 'Enable parallel execution',
394
343
  type: 'boolean',
395
- "default": true
344
+ default: true
396
345
  },
397
346
  {
398
347
  name: 'monitor',
399
348
  description: 'Enable real-time monitoring',
400
349
  type: 'boolean',
401
- "default": true
350
+ default: true
402
351
  }
403
352
  ],
404
353
  examples: [
405
354
  { command: 'claude-flow swarm start -o "Build REST API" -s development', description: 'Start development swarm' },
406
355
  { command: 'claude-flow swarm start -o "Analyze codebase" --parallel', description: 'Parallel analysis' }
407
356
  ],
408
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
409
- var objective, strategy, agentPlan, confirmed, spinner, executionState;
410
- var _a;
411
- return __generator(this, function (_b) {
412
- switch (_b.label) {
413
- case 0:
414
- objective = ctx.args[0] || ctx.flags.objective;
415
- strategy = ctx.flags.strategy;
416
- if (!objective) {
417
- output.printError('Objective is required. Use -o or provide as argument.');
418
- return [2 /*return*/, { success: false, exitCode: 1 }];
419
- }
420
- if (!(!strategy && ctx.interactive)) return [3 /*break*/, 2];
421
- return [4 /*yield*/, select({
422
- message: 'Select execution strategy:',
423
- options: STRATEGIES,
424
- "default": 'development'
425
- })];
426
- case 1:
427
- strategy = _b.sent();
428
- _b.label = 2;
429
- case 2:
430
- strategy = strategy || 'development';
431
- output.writeln();
432
- output.printInfo("Starting swarm with objective: " + output.highlight(objective));
433
- output.writeln();
434
- agentPlan = getAgentPlan(strategy);
435
- output.writeln(output.bold('Agent Deployment Plan'));
436
- output.printTable({
437
- columns: [
438
- { key: 'role', header: 'Role', width: 20 },
439
- { key: 'type', header: 'Type', width: 15 },
440
- { key: 'count', header: 'Count', width: 8, align: 'right' },
441
- { key: 'purpose', header: 'Purpose', width: 30 }
442
- ],
443
- data: agentPlan
444
- });
445
- if (!ctx.interactive) return [3 /*break*/, 4];
446
- return [4 /*yield*/, confirm({
447
- message: "Deploy " + agentPlan.reduce(function (sum, a) { return sum + a.count; }, 0) + " agents?",
448
- "default": true
449
- })];
450
- case 3:
451
- confirmed = _b.sent();
452
- if (!confirmed) {
453
- output.printInfo('Swarm execution cancelled');
454
- return [2 /*return*/, { success: true }];
455
- }
456
- _b.label = 4;
457
- case 4:
458
- output.writeln();
459
- output.printInfo('Deploying agents...');
460
- spinner = output.createSpinner({ text: 'Initializing agents...', spinner: 'dots' });
461
- spinner.start();
462
- // Brief delay for spinner animation
463
- return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 500); })];
464
- case 5:
465
- // Brief delay for spinner animation
466
- _b.sent();
467
- spinner.succeed('All agents deployed');
468
- executionState = {
469
- swarmId: "swarm-" + Date.now().toString(36),
470
- objective: objective,
471
- strategy: strategy,
472
- status: 'running',
473
- agents: agentPlan.reduce(function (sum, a) { return sum + a.count; }, 0),
474
- startedAt: new Date().toISOString(),
475
- parallel: (_a = ctx.flags.parallel) !== null && _a !== void 0 ? _a : true
476
- };
477
- output.writeln();
478
- output.printSuccess('Swarm execution started');
479
- output.writeln(output.dim(" Monitor: claude-flow swarm status " + executionState.swarmId));
480
- return [2 /*return*/, { success: true, data: executionState }];
481
- }
357
+ action: async (ctx) => {
358
+ const objective = ctx.args[0] || ctx.flags.objective;
359
+ let strategy = ctx.flags.strategy;
360
+ if (!objective) {
361
+ output.printError('Objective is required. Use -o or provide as argument.');
362
+ return { success: false, exitCode: 1 };
363
+ }
364
+ // Interactive strategy selection
365
+ if (!strategy && ctx.interactive) {
366
+ strategy = await select({
367
+ message: 'Select execution strategy:',
368
+ options: STRATEGIES,
369
+ default: 'development'
370
+ });
371
+ }
372
+ strategy = strategy || 'development';
373
+ output.writeln();
374
+ output.printInfo(`Starting swarm with objective: ${output.highlight(objective)}`);
375
+ output.writeln();
376
+ // Compute agent deployment plan based on strategy
377
+ const agentPlan = getAgentPlan(strategy);
378
+ output.writeln(output.bold('Agent Deployment Plan'));
379
+ output.printTable({
380
+ columns: [
381
+ { key: 'role', header: 'Role', width: 20 },
382
+ { key: 'type', header: 'Type', width: 15 },
383
+ { key: 'count', header: 'Count', width: 8, align: 'right' },
384
+ { key: 'purpose', header: 'Purpose', width: 30 }
385
+ ],
386
+ data: agentPlan
482
387
  });
483
- }); }
388
+ // Confirm execution
389
+ if (ctx.interactive) {
390
+ const confirmed = await confirm({
391
+ message: `Deploy ${agentPlan.reduce((sum, a) => sum + a.count, 0)} agents?`,
392
+ default: true
393
+ });
394
+ if (!confirmed) {
395
+ output.printInfo('Swarm execution cancelled');
396
+ return { success: true };
397
+ }
398
+ }
399
+ output.writeln();
400
+ output.printInfo('Deploying agents...');
401
+ // Show deployment progress
402
+ const spinner = output.createSpinner({ text: 'Initializing agents...', spinner: 'dots' });
403
+ spinner.start();
404
+ // Brief delay for spinner animation
405
+ await new Promise(resolve => setTimeout(resolve, 500));
406
+ spinner.succeed('All agents deployed');
407
+ const executionState = {
408
+ swarmId: `swarm-${Date.now().toString(36)}`,
409
+ objective,
410
+ strategy,
411
+ status: 'running',
412
+ agents: agentPlan.reduce((sum, a) => sum + a.count, 0),
413
+ startedAt: new Date().toISOString(),
414
+ parallel: ctx.flags.parallel ?? true
415
+ };
416
+ output.writeln();
417
+ output.printSuccess('Swarm execution started');
418
+ output.writeln(output.dim(` Monitor: claude-flow swarm status ${executionState.swarmId}`));
419
+ return { success: true, data: executionState };
420
+ }
484
421
  };
485
422
  // Swarm status
486
- var statusCommand = {
423
+ const statusCommand = {
487
424
  name: 'status',
488
425
  description: 'Show swarm status',
489
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
490
- var swarmId, status;
491
- return __generator(this, function (_a) {
492
- swarmId = ctx.args[0];
493
- status = getSwarmStatus(swarmId);
494
- if (ctx.flags.format === 'json') {
495
- output.printJson(status);
496
- return [2 /*return*/, { success: true, data: status }];
497
- }
498
- output.writeln();
499
- // Show different message if no active swarm
500
- if (!status.hasActiveSwarm) {
501
- output.writeln(output.warning('No active swarm'));
502
- output.writeln();
503
- output.writeln(output.dim('Start a swarm with:'));
504
- output.writeln(output.dim(' npx @claude-flow/cli@latest swarm init'));
505
- output.writeln(output.dim(' npx @claude-flow/cli@latest swarm start'));
506
- output.writeln();
507
- return [2 /*return*/, { success: true, data: status }];
508
- }
509
- output.writeln(output.bold("Swarm Status: " + status.id));
510
- output.writeln();
511
- // Progress bar
512
- output.writeln("Overall Progress: " + output.progressBar(status.progress, 100, 40));
513
- output.writeln();
514
- // Agent status
515
- output.writeln(output.bold('Agents'));
516
- output.printTable({
517
- columns: [
518
- { key: 'status', header: 'Status', width: 12 },
519
- { key: 'count', header: 'Count', width: 10, align: 'right' }
520
- ],
521
- data: [
522
- { status: output.success('Active'), count: status.agents.active },
523
- { status: output.warning('Idle'), count: status.agents.idle },
524
- { status: output.dim('Completed'), count: status.agents.completed },
525
- { status: 'Total', count: status.agents.total }
526
- ]
527
- });
528
- output.writeln();
529
- // Task status
530
- output.writeln(output.bold('Tasks'));
531
- output.printTable({
532
- columns: [
533
- { key: 'status', header: 'Status', width: 12 },
534
- { key: 'count', header: 'Count', width: 10, align: 'right' }
535
- ],
536
- data: [
537
- { status: output.success('Completed'), count: status.tasks.completed },
538
- { status: output.info('In Progress'), count: status.tasks.inProgress },
539
- { status: output.dim('Pending'), count: status.tasks.pending },
540
- { status: 'Total', count: status.tasks.total }
541
- ]
542
- });
426
+ action: async (ctx) => {
427
+ const swarmId = ctx.args[0];
428
+ // Get dynamic status from actual swarm state files
429
+ const status = getSwarmStatus(swarmId);
430
+ if (ctx.flags.format === 'json') {
431
+ output.printJson(status);
432
+ return { success: true, data: status };
433
+ }
434
+ output.writeln();
435
+ // Show different message if no active swarm
436
+ if (!status.hasActiveSwarm) {
437
+ output.writeln(output.warning('No active swarm'));
543
438
  output.writeln();
544
- // Metrics
545
- output.writeln(output.bold('Performance Metrics'));
546
- output.printList([
547
- "Tokens Used: " + status.metrics.tokensUsed.toLocaleString(),
548
- "Avg Response Time: " + status.metrics.avgResponseTime,
549
- "Success Rate: " + status.metrics.successRate,
550
- "Elapsed Time: " + status.metrics.elapsedTime
551
- ]);
439
+ output.writeln(output.dim('Start a swarm with:'));
440
+ output.writeln(output.dim(' npx @claude-flow/cli@latest swarm init'));
441
+ output.writeln(output.dim(' npx @claude-flow/cli@latest swarm start'));
552
442
  output.writeln();
553
- // Coordination stats
554
- output.writeln(output.bold('Coordination'));
555
- output.printList([
556
- "Consensus Rounds: " + status.coordination.consensusRounds,
557
- "Messages Sent: " + status.coordination.messagesSent,
558
- "Conflicts Resolved: " + status.coordination.conflictsResolved
559
- ]);
560
- return [2 /*return*/, { success: true, data: status }];
443
+ return { success: true, data: status };
444
+ }
445
+ output.writeln(output.bold(`Swarm Status: ${status.id}`));
446
+ output.writeln();
447
+ // Progress bar
448
+ output.writeln(`Overall Progress: ${output.progressBar(status.progress, 100, 40)}`);
449
+ output.writeln();
450
+ // Agent status
451
+ output.writeln(output.bold('Agents'));
452
+ output.printTable({
453
+ columns: [
454
+ { key: 'status', header: 'Status', width: 12 },
455
+ { key: 'count', header: 'Count', width: 10, align: 'right' }
456
+ ],
457
+ data: [
458
+ { status: output.success('Active'), count: status.agents.active },
459
+ { status: output.warning('Idle'), count: status.agents.idle },
460
+ { status: output.dim('Completed'), count: status.agents.completed },
461
+ { status: 'Total', count: status.agents.total }
462
+ ]
561
463
  });
562
- }); }
464
+ output.writeln();
465
+ // Task status
466
+ output.writeln(output.bold('Tasks'));
467
+ output.printTable({
468
+ columns: [
469
+ { key: 'status', header: 'Status', width: 12 },
470
+ { key: 'count', header: 'Count', width: 10, align: 'right' }
471
+ ],
472
+ data: [
473
+ { status: output.success('Completed'), count: status.tasks.completed },
474
+ { status: output.info('In Progress'), count: status.tasks.inProgress },
475
+ { status: output.dim('Pending'), count: status.tasks.pending },
476
+ { status: 'Total', count: status.tasks.total }
477
+ ]
478
+ });
479
+ output.writeln();
480
+ // Metrics
481
+ output.writeln(output.bold('Performance Metrics'));
482
+ output.printList([
483
+ `Tokens Used: ${status.metrics.tokensUsed.toLocaleString()}`,
484
+ `Avg Response Time: ${status.metrics.avgResponseTime}`,
485
+ `Success Rate: ${status.metrics.successRate}`,
486
+ `Elapsed Time: ${status.metrics.elapsedTime}`
487
+ ]);
488
+ output.writeln();
489
+ // Coordination stats
490
+ output.writeln(output.bold('Coordination'));
491
+ output.printList([
492
+ `Consensus Rounds: ${status.coordination.consensusRounds}`,
493
+ `Messages Sent: ${status.coordination.messagesSent}`,
494
+ `Conflicts Resolved: ${status.coordination.conflictsResolved}`
495
+ ]);
496
+ return { success: true, data: status };
497
+ }
563
498
  };
564
499
  // Stop swarm
565
- var stopCommand = {
500
+ const stopCommand = {
566
501
  name: 'stop',
567
502
  description: 'Stop swarm execution',
568
503
  options: [
@@ -571,54 +506,45 @@ var stopCommand = {
571
506
  short: 'f',
572
507
  description: 'Force immediate stop',
573
508
  type: 'boolean',
574
- "default": false
509
+ default: false
575
510
  },
576
511
  {
577
512
  name: 'save-state',
578
513
  description: 'Save current state for resume',
579
514
  type: 'boolean',
580
- "default": true
515
+ default: true
581
516
  }
582
517
  ],
583
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
584
- var swarmId, force, confirmed;
585
- return __generator(this, function (_a) {
586
- switch (_a.label) {
587
- case 0:
588
- swarmId = ctx.args[0];
589
- force = ctx.flags.force;
590
- if (!swarmId) {
591
- output.printError('Swarm ID is required');
592
- return [2 /*return*/, { success: false, exitCode: 1 }];
593
- }
594
- if (!(ctx.interactive && !force)) return [3 /*break*/, 2];
595
- return [4 /*yield*/, confirm({
596
- message: "Stop swarm " + swarmId + "? Progress will be saved.",
597
- "default": false
598
- })];
599
- case 1:
600
- confirmed = _a.sent();
601
- if (!confirmed) {
602
- output.printInfo('Operation cancelled');
603
- return [2 /*return*/, { success: true }];
604
- }
605
- _a.label = 2;
606
- case 2:
607
- output.printInfo("Stopping swarm " + swarmId + "...");
608
- if (!force) {
609
- output.writeln(output.dim(' Completing in-progress tasks...'));
610
- output.writeln(output.dim(' Saving coordination state...'));
611
- output.writeln(output.dim(' Notifying agents...'));
612
- output.writeln(output.dim(' Saving memory state...'));
613
- }
614
- output.printSuccess("Swarm " + swarmId + " stopped");
615
- return [2 /*return*/, { success: true, data: { swarmId: swarmId, stopped: true, force: force } }];
518
+ action: async (ctx) => {
519
+ const swarmId = ctx.args[0];
520
+ const force = ctx.flags.force;
521
+ if (!swarmId) {
522
+ output.printError('Swarm ID is required');
523
+ return { success: false, exitCode: 1 };
524
+ }
525
+ if (ctx.interactive && !force) {
526
+ const confirmed = await confirm({
527
+ message: `Stop swarm ${swarmId}? Progress will be saved.`,
528
+ default: false
529
+ });
530
+ if (!confirmed) {
531
+ output.printInfo('Operation cancelled');
532
+ return { success: true };
616
533
  }
617
- });
618
- }); }
534
+ }
535
+ output.printInfo(`Stopping swarm ${swarmId}...`);
536
+ if (!force) {
537
+ output.writeln(output.dim(' Completing in-progress tasks...'));
538
+ output.writeln(output.dim(' Saving coordination state...'));
539
+ output.writeln(output.dim(' Notifying agents...'));
540
+ output.writeln(output.dim(' Saving memory state...'));
541
+ }
542
+ output.printSuccess(`Swarm ${swarmId} stopped`);
543
+ return { success: true, data: { swarmId, stopped: true, force } };
544
+ }
619
545
  };
620
546
  // Scale swarm
621
- var scaleCommand = {
547
+ const scaleCommand = {
622
548
  name: 'scale',
623
549
  description: 'Scale swarm agent count',
624
550
  options: [
@@ -636,40 +562,38 @@ var scaleCommand = {
636
562
  type: 'string'
637
563
  }
638
564
  ],
639
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
640
- var swarmId, targetAgents, agentType, currentAgents, delta;
641
- return __generator(this, function (_a) {
642
- swarmId = ctx.args[0];
643
- targetAgents = ctx.flags.agents;
644
- agentType = ctx.flags.type;
645
- if (!swarmId) {
646
- output.printError('Swarm ID is required');
647
- return [2 /*return*/, { success: false, exitCode: 1 }];
648
- }
649
- if (!targetAgents) {
650
- output.printError('Target agent count required. Use --agents or -a');
651
- return [2 /*return*/, { success: false, exitCode: 1 }];
652
- }
653
- output.printInfo("Scaling swarm " + swarmId + " to " + targetAgents + " agents...");
654
- currentAgents = 8;
655
- delta = targetAgents - currentAgents;
656
- if (delta > 0) {
657
- output.writeln(output.dim(" Spawning " + delta + " new agents..."));
658
- }
659
- else if (delta < 0) {
660
- output.writeln(output.dim(" Gracefully stopping " + -delta + " agents..."));
661
- }
662
- else {
663
- output.printInfo('Swarm already at target size');
664
- return [2 /*return*/, { success: true }];
665
- }
666
- output.printSuccess("Swarm scaled to " + targetAgents + " agents");
667
- return [2 /*return*/, { success: true, data: { swarmId: swarmId, agents: targetAgents, delta: delta } }];
668
- });
669
- }); }
565
+ action: async (ctx) => {
566
+ const swarmId = ctx.args[0];
567
+ const targetAgents = ctx.flags.agents;
568
+ const agentType = ctx.flags.type;
569
+ if (!swarmId) {
570
+ output.printError('Swarm ID is required');
571
+ return { success: false, exitCode: 1 };
572
+ }
573
+ if (!targetAgents) {
574
+ output.printError('Target agent count required. Use --agents or -a');
575
+ return { success: false, exitCode: 1 };
576
+ }
577
+ output.printInfo(`Scaling swarm ${swarmId} to ${targetAgents} agents...`);
578
+ // Calculate scaling delta
579
+ const currentAgents = 8;
580
+ const delta = targetAgents - currentAgents;
581
+ if (delta > 0) {
582
+ output.writeln(output.dim(` Spawning ${delta} new agents...`));
583
+ }
584
+ else if (delta < 0) {
585
+ output.writeln(output.dim(` Gracefully stopping ${-delta} agents...`));
586
+ }
587
+ else {
588
+ output.printInfo('Swarm already at target size');
589
+ return { success: true };
590
+ }
591
+ output.printSuccess(`Swarm scaled to ${targetAgents} agents`);
592
+ return { success: true, data: { swarmId, agents: targetAgents, delta } };
593
+ }
670
594
  };
671
595
  // Coordinate command (V3 specific)
672
- var coordinateCommand = {
596
+ const coordinateCommand = {
673
597
  name: 'coordinate',
674
598
  description: 'Execute V3 15-agent hierarchical mesh coordination',
675
599
  options: [
@@ -677,7 +601,7 @@ var coordinateCommand = {
677
601
  name: 'agents',
678
602
  description: 'Number of agents',
679
603
  type: 'number',
680
- "default": 15
604
+ default: 15
681
605
  },
682
606
  {
683
607
  name: 'domains',
@@ -685,59 +609,57 @@ var coordinateCommand = {
685
609
  type: 'array'
686
610
  }
687
611
  ],
688
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
689
- var agentCount, v3Agents;
690
- return __generator(this, function (_a) {
691
- agentCount = ctx.flags.agents || 15;
692
- output.writeln();
693
- output.writeln(output.bold('V3 15-Agent Hierarchical Mesh Coordination'));
694
- output.writeln();
695
- v3Agents = [
696
- { id: 1, role: 'Queen Coordinator', domain: 'Orchestration', status: 'primary' },
697
- { id: 2, role: 'Security Architect', domain: 'Security', status: 'active' },
698
- { id: 3, role: 'Security Auditor', domain: 'Security', status: 'active' },
699
- { id: 4, role: 'Test Architect', domain: 'Security', status: 'active' },
700
- { id: 5, role: 'Core Architect', domain: 'Core', status: 'active' },
701
- { id: 6, role: 'Memory Specialist', domain: 'Core', status: 'active' },
702
- { id: 7, role: 'Swarm Specialist', domain: 'Core', status: 'active' },
703
- { id: 8, role: 'Integration Architect', domain: 'Integration', status: 'active' },
704
- { id: 9, role: 'Performance Engineer', domain: 'Integration', status: 'active' },
705
- { id: 10, role: 'CLI Developer', domain: 'Integration', status: 'active' },
706
- { id: 11, role: 'Hooks Developer', domain: 'Integration', status: 'active' },
707
- { id: 12, role: 'MCP Specialist', domain: 'Integration', status: 'active' },
708
- { id: 13, role: 'Project Coordinator', domain: 'Management', status: 'active' },
709
- { id: 14, role: 'Documentation Lead', domain: 'Management', status: 'standby' },
710
- { id: 15, role: 'DevOps Engineer', domain: 'Management', status: 'standby' }
711
- ].slice(0, agentCount);
712
- output.printTable({
713
- columns: [
714
- { key: 'id', header: '#', width: 3, align: 'right' },
715
- { key: 'role', header: 'Role', width: 22 },
716
- { key: 'domain', header: 'Domain', width: 15 },
717
- { key: 'status', header: 'Status', width: 10, format: function (v) {
718
- if (v === 'primary')
719
- return output.highlight(String(v));
720
- if (v === 'active')
721
- return output.success(String(v));
722
- return output.dim(String(v));
723
- } }
724
- ],
725
- data: v3Agents
726
- });
727
- output.writeln();
728
- output.printInfo('Performance Targets:');
729
- output.printList([
730
- "Flash Attention: " + output.success('2.49x-7.47x speedup'),
731
- "AgentDB Search: " + output.success('150x-12,500x improvement'),
732
- "Memory Reduction: " + output.success('50-75%'),
733
- "Code Reduction: " + output.success('<5,000 lines')
734
- ]);
735
- return [2 /*return*/, { success: true, data: { agents: v3Agents, count: agentCount } }];
612
+ action: async (ctx) => {
613
+ const agentCount = ctx.flags.agents || 15;
614
+ output.writeln();
615
+ output.writeln(output.bold('V3 15-Agent Hierarchical Mesh Coordination'));
616
+ output.writeln();
617
+ // V3 agent structure
618
+ const v3Agents = [
619
+ { id: 1, role: 'Queen Coordinator', domain: 'Orchestration', status: 'primary' },
620
+ { id: 2, role: 'Security Architect', domain: 'Security', status: 'active' },
621
+ { id: 3, role: 'Security Auditor', domain: 'Security', status: 'active' },
622
+ { id: 4, role: 'Test Architect', domain: 'Security', status: 'active' },
623
+ { id: 5, role: 'Core Architect', domain: 'Core', status: 'active' },
624
+ { id: 6, role: 'Memory Specialist', domain: 'Core', status: 'active' },
625
+ { id: 7, role: 'Swarm Specialist', domain: 'Core', status: 'active' },
626
+ { id: 8, role: 'Integration Architect', domain: 'Integration', status: 'active' },
627
+ { id: 9, role: 'Performance Engineer', domain: 'Integration', status: 'active' },
628
+ { id: 10, role: 'CLI Developer', domain: 'Integration', status: 'active' },
629
+ { id: 11, role: 'Hooks Developer', domain: 'Integration', status: 'active' },
630
+ { id: 12, role: 'MCP Specialist', domain: 'Integration', status: 'active' },
631
+ { id: 13, role: 'Project Coordinator', domain: 'Management', status: 'active' },
632
+ { id: 14, role: 'Documentation Lead', domain: 'Management', status: 'standby' },
633
+ { id: 15, role: 'DevOps Engineer', domain: 'Management', status: 'standby' }
634
+ ].slice(0, agentCount);
635
+ output.printTable({
636
+ columns: [
637
+ { key: 'id', header: '#', width: 3, align: 'right' },
638
+ { key: 'role', header: 'Role', width: 22 },
639
+ { key: 'domain', header: 'Domain', width: 15 },
640
+ { key: 'status', header: 'Status', width: 10, format: (v) => {
641
+ if (v === 'primary')
642
+ return output.highlight(String(v));
643
+ if (v === 'active')
644
+ return output.success(String(v));
645
+ return output.dim(String(v));
646
+ } }
647
+ ],
648
+ data: v3Agents
736
649
  });
737
- }); }
650
+ output.writeln();
651
+ output.printInfo('Performance Targets:');
652
+ output.printList([
653
+ `Flash Attention: ${output.success('2.49x-7.47x speedup')}`,
654
+ `AgentDB Search: ${output.success('150x-12,500x improvement')}`,
655
+ `Memory Reduction: ${output.success('50-75%')}`,
656
+ `Code Reduction: ${output.success('<5,000 lines')}`
657
+ ]);
658
+ return { success: true, data: { agents: v3Agents, count: agentCount } };
659
+ }
738
660
  };
739
661
  // Main swarm command
740
- export var swarmCommand = {
662
+ export const swarmCommand = {
741
663
  name: 'swarm',
742
664
  description: 'Swarm coordination commands',
743
665
  subcommands: [initCommand, startCommand, statusCommand, stopCommand, scaleCommand, coordinateCommand],
@@ -747,29 +669,27 @@ export var swarmCommand = {
747
669
  { command: 'claude-flow swarm start -o "Build API" -s development', description: 'Start development swarm' },
748
670
  { command: 'claude-flow swarm coordinate --agents 15', description: 'V3 coordination' }
749
671
  ],
750
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
751
- return __generator(this, function (_a) {
752
- output.writeln();
753
- output.writeln(output.bold('Swarm Coordination Commands'));
754
- output.writeln();
755
- output.writeln('Usage: claude-flow swarm <subcommand> [options]');
756
- output.writeln();
757
- output.writeln('Subcommands:');
758
- output.printList([
759
- output.highlight('init') + " - Initialize a new swarm",
760
- output.highlight('start') + " - Start swarm execution",
761
- output.highlight('status') + " - Show swarm status",
762
- output.highlight('stop') + " - Stop swarm execution",
763
- output.highlight('scale') + " - Scale swarm agent count",
764
- output.highlight('coordinate') + " - V3 15-agent coordination"
765
- ]);
766
- return [2 /*return*/, { success: true }];
767
- });
768
- }); }
672
+ action: async (ctx) => {
673
+ output.writeln();
674
+ output.writeln(output.bold('Swarm Coordination Commands'));
675
+ output.writeln();
676
+ output.writeln('Usage: claude-flow swarm <subcommand> [options]');
677
+ output.writeln();
678
+ output.writeln('Subcommands:');
679
+ output.printList([
680
+ `${output.highlight('init')} - Initialize a new swarm`,
681
+ `${output.highlight('start')} - Start swarm execution`,
682
+ `${output.highlight('status')} - Show swarm status`,
683
+ `${output.highlight('stop')} - Stop swarm execution`,
684
+ `${output.highlight('scale')} - Scale swarm agent count`,
685
+ `${output.highlight('coordinate')} - V3 15-agent coordination`
686
+ ]);
687
+ return { success: true };
688
+ }
769
689
  };
770
690
  // Helper function
771
691
  function getAgentPlan(strategy) {
772
- var plans = {
692
+ const plans = {
773
693
  specialized: [
774
694
  { role: 'Coordinator', type: 'coordinator', count: 1, purpose: 'Central orchestration (anti-drift)' },
775
695
  { role: 'Researcher', type: 'researcher', count: 1, purpose: 'Requirements analysis' },