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 Agent Command
3
3
  * Agent management commands for spawning, listing, and controlling agents
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, input } from '../prompt.js';
43
7
  import { callMCPTool, MCPClientError } from '../mcp-client.js';
@@ -48,13 +12,12 @@ import * as path from 'path';
48
12
  * The statusline reads this file to display the swarm agent count.
49
13
  */
50
14
  function updateSwarmActivityMetrics(agentCountDelta) {
51
- var _a;
52
15
  try {
53
- var metricsDir = path.join(process.cwd(), '.claude-flow', 'metrics');
54
- var activityPath = path.join(metricsDir, 'swarm-activity.json');
55
- var data = {
16
+ const metricsDir = path.join(process.cwd(), '.claude-flow', 'metrics');
17
+ const activityPath = path.join(metricsDir, 'swarm-activity.json');
18
+ let data = {
56
19
  timestamp: new Date().toISOString(),
57
- swarm: { active: false, agent_count: 0, coordination_active: false }
20
+ swarm: { active: false, agent_count: 0, coordination_active: false },
58
21
  };
59
22
  if (fs.existsSync(activityPath)) {
60
23
  data = JSON.parse(fs.readFileSync(activityPath, 'utf-8'));
@@ -62,9 +25,9 @@ function updateSwarmActivityMetrics(agentCountDelta) {
62
25
  else {
63
26
  fs.mkdirSync(metricsDir, { recursive: true });
64
27
  }
65
- var swarm = (_a = data.swarm) !== null && _a !== void 0 ? _a : {};
66
- var currentCount = Math.max(0, swarm.agent_count || 0);
67
- var newCount = Math.max(0, currentCount + agentCountDelta);
28
+ const swarm = data.swarm ?? {};
29
+ const currentCount = Math.max(0, swarm.agent_count || 0);
30
+ const newCount = Math.max(0, currentCount + agentCountDelta);
68
31
  swarm.agent_count = newCount;
69
32
  swarm.active = newCount > 0;
70
33
  swarm.coordination_active = newCount > 0;
@@ -72,12 +35,12 @@ function updateSwarmActivityMetrics(agentCountDelta) {
72
35
  data.timestamp = new Date().toISOString();
73
36
  fs.writeFileSync(activityPath, JSON.stringify(data, null, 2));
74
37
  }
75
- catch (_b) {
38
+ catch {
76
39
  // Non-critical — don't fail the command if metrics update fails
77
40
  }
78
41
  }
79
42
  // Available agent types with descriptions
80
- var AGENT_TYPES = [
43
+ const AGENT_TYPES = [
81
44
  { value: 'coder', label: 'Coder', hint: 'Code development with neural patterns' },
82
45
  { value: 'researcher', label: 'Researcher', hint: 'Research with web access and data analysis' },
83
46
  { value: 'tester', label: 'Tester', hint: 'Comprehensive testing with automation' },
@@ -95,7 +58,7 @@ var AGENT_TYPES = [
95
58
  { value: 'test-architect', label: 'Test Architect', hint: 'TDD London School methodology' }
96
59
  ];
97
60
  // Agent spawn subcommand
98
- var spawnCommand = {
61
+ const spawnCommand = {
99
62
  name: 'spawn',
100
63
  description: 'Spawn a new agent',
101
64
  options: [
@@ -104,7 +67,7 @@ var spawnCommand = {
104
67
  short: 't',
105
68
  description: 'Agent type to spawn',
106
69
  type: 'string',
107
- choices: AGENT_TYPES.map(function (a) { return a.value; })
70
+ choices: AGENT_TYPES.map(a => a.value)
108
71
  },
109
72
  {
110
73
  name: 'name',
@@ -117,7 +80,7 @@ var spawnCommand = {
117
80
  short: 'p',
118
81
  description: 'Provider to use (anthropic, openrouter, ollama)',
119
82
  type: 'string',
120
- "default": 'anthropic'
83
+ default: 'anthropic'
121
84
  },
122
85
  {
123
86
  name: 'model',
@@ -134,104 +97,93 @@ var spawnCommand = {
134
97
  name: 'timeout',
135
98
  description: 'Agent timeout in seconds',
136
99
  type: 'number',
137
- "default": 300
100
+ default: 300
138
101
  },
139
102
  {
140
103
  name: 'auto-tools',
141
104
  description: 'Enable automatic tool usage',
142
105
  type: 'boolean',
143
- "default": true
106
+ default: true
144
107
  }
145
108
  ],
146
109
  examples: [
147
110
  { command: 'claude-flow agent spawn --type coder --name bot-1', description: 'Spawn a coder agent' },
148
111
  { command: 'claude-flow agent spawn -t researcher --task "Research React 19"', description: 'Spawn researcher with task' }
149
112
  ],
150
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
151
- var agentType, agentName, result, error_1;
152
- return __generator(this, function (_a) {
153
- switch (_a.label) {
154
- case 0:
155
- agentType = ctx.flags.type;
156
- agentName = ctx.flags.name;
157
- if (!(!agentType && ctx.interactive)) return [3 /*break*/, 2];
158
- return [4 /*yield*/, select({
159
- message: 'Select agent type:',
160
- options: AGENT_TYPES
161
- })];
162
- case 1:
163
- agentType = _a.sent();
164
- _a.label = 2;
165
- case 2:
166
- if (!agentType) {
167
- output.printError('Agent type is required. Use --type or -t flag.');
168
- return [2 /*return*/, { success: false, exitCode: 1 }];
169
- }
170
- // Generate name if not provided
171
- if (!agentName) {
172
- agentName = agentType + "-" + Date.now().toString(36);
173
- }
174
- output.printInfo("Spawning " + agentType + " agent: " + output.highlight(agentName));
175
- _a.label = 3;
176
- case 3:
177
- _a.trys.push([3, 5, , 6]);
178
- return [4 /*yield*/, callMCPTool('agent_spawn', {
179
- agentType: agentType,
180
- id: agentName,
181
- config: {
182
- provider: ctx.flags.provider || 'anthropic',
183
- model: ctx.flags.model,
184
- task: ctx.flags.task,
185
- timeout: ctx.flags.timeout,
186
- autoTools: ctx.flags.autoTools
187
- },
188
- priority: 'normal',
189
- metadata: {
190
- name: agentName,
191
- capabilities: getAgentCapabilities(agentType)
192
- }
193
- })];
194
- case 4:
195
- result = _a.sent();
196
- output.writeln();
197
- output.printTable({
198
- columns: [
199
- { key: 'property', header: 'Property', width: 15 },
200
- { key: 'value', header: 'Value', width: 40 }
201
- ],
202
- data: [
203
- { property: 'ID', value: result.agentId },
204
- { property: 'Type', value: result.agentType },
205
- { property: 'Name', value: agentName },
206
- { property: 'Status', value: result.status },
207
- { property: 'Created', value: result.createdAt },
208
- { property: 'Capabilities', value: getAgentCapabilities(agentType).join(', ') }
209
- ]
210
- });
211
- output.writeln();
212
- output.printSuccess("Agent " + agentName + " spawned successfully");
213
- // Update swarm-activity.json so statusline reflects the new agent count
214
- updateSwarmActivityMetrics(1);
215
- if (ctx.flags.format === 'json') {
216
- output.printJson(result);
217
- }
218
- return [2 /*return*/, { success: true, data: result }];
219
- case 5:
220
- error_1 = _a.sent();
221
- if (error_1 instanceof MCPClientError) {
222
- output.printError("Failed to spawn agent: " + error_1.message);
223
- }
224
- else {
225
- output.printError("Unexpected error: " + String(error_1));
226
- }
227
- return [2 /*return*/, { success: false, exitCode: 1 }];
228
- case 6: return [2 /*return*/];
113
+ action: async (ctx) => {
114
+ let agentType = ctx.flags.type;
115
+ let agentName = ctx.flags.name;
116
+ // Interactive mode if type not specified
117
+ if (!agentType && ctx.interactive) {
118
+ agentType = await select({
119
+ message: 'Select agent type:',
120
+ options: AGENT_TYPES
121
+ });
122
+ }
123
+ if (!agentType) {
124
+ output.printError('Agent type is required. Use --type or -t flag.');
125
+ return { success: false, exitCode: 1 };
126
+ }
127
+ // Generate name if not provided
128
+ if (!agentName) {
129
+ agentName = `${agentType}-${Date.now().toString(36)}`;
130
+ }
131
+ output.printInfo(`Spawning ${agentType} agent: ${output.highlight(agentName)}`);
132
+ try {
133
+ // Call MCP tool to spawn agent
134
+ const result = await callMCPTool('agent_spawn', {
135
+ agentType,
136
+ id: agentName,
137
+ config: {
138
+ provider: ctx.flags.provider || 'anthropic',
139
+ model: ctx.flags.model,
140
+ task: ctx.flags.task,
141
+ timeout: ctx.flags.timeout,
142
+ autoTools: ctx.flags.autoTools,
143
+ },
144
+ priority: 'normal',
145
+ metadata: {
146
+ name: agentName,
147
+ capabilities: getAgentCapabilities(agentType),
148
+ },
149
+ });
150
+ output.writeln();
151
+ output.printTable({
152
+ columns: [
153
+ { key: 'property', header: 'Property', width: 15 },
154
+ { key: 'value', header: 'Value', width: 40 }
155
+ ],
156
+ data: [
157
+ { property: 'ID', value: result.agentId },
158
+ { property: 'Type', value: result.agentType },
159
+ { property: 'Name', value: agentName },
160
+ { property: 'Status', value: result.status },
161
+ { property: 'Created', value: result.createdAt },
162
+ { property: 'Capabilities', value: getAgentCapabilities(agentType).join(', ') }
163
+ ]
164
+ });
165
+ output.writeln();
166
+ output.printSuccess(`Agent ${agentName} spawned successfully`);
167
+ // Update swarm-activity.json so statusline reflects the new agent count
168
+ updateSwarmActivityMetrics(1);
169
+ if (ctx.flags.format === 'json') {
170
+ output.printJson(result);
229
171
  }
230
- });
231
- }); }
172
+ return { success: true, data: result };
173
+ }
174
+ catch (error) {
175
+ if (error instanceof MCPClientError) {
176
+ output.printError(`Failed to spawn agent: ${error.message}`);
177
+ }
178
+ else {
179
+ output.printError(`Unexpected error: ${String(error)}`);
180
+ }
181
+ return { success: false, exitCode: 1 };
182
+ }
183
+ }
232
184
  };
233
185
  // Agent list subcommand
234
- var listCommand = {
186
+ const listCommand = {
235
187
  name: 'list',
236
188
  aliases: ['ls'],
237
189
  description: 'List all active agents',
@@ -241,7 +193,7 @@ var listCommand = {
241
193
  short: 'a',
242
194
  description: 'Include inactive agents',
243
195
  type: 'boolean',
244
- "default": false
196
+ default: false
245
197
  },
246
198
  {
247
199
  name: 'type',
@@ -256,68 +208,62 @@ var listCommand = {
256
208
  type: 'string'
257
209
  }
258
210
  ],
259
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
260
- var result, displayAgents, error_2;
261
- return __generator(this, function (_a) {
262
- switch (_a.label) {
263
- case 0:
264
- _a.trys.push([0, 2, , 3]);
265
- return [4 /*yield*/, callMCPTool('agent_list', {
266
- status: ctx.flags.all ? 'all' : ctx.flags.status || undefined,
267
- agentType: ctx.flags.type || undefined,
268
- limit: 100
269
- })];
270
- case 1:
271
- result = _a.sent();
272
- if (ctx.flags.format === 'json') {
273
- output.printJson(result);
274
- return [2 /*return*/, { success: true, data: result }];
275
- }
276
- output.writeln();
277
- output.writeln(output.bold('Active Agents'));
278
- output.writeln();
279
- if (result.agents.length === 0) {
280
- output.printInfo('No agents found matching criteria');
281
- return [2 /*return*/, { success: true, data: result }];
282
- }
283
- displayAgents = result.agents.map(function (agent) { return ({
284
- id: agent.id,
285
- type: agent.agentType,
286
- status: agent.status,
287
- created: new Date(agent.createdAt).toLocaleTimeString(),
288
- lastActivity: agent.lastActivityAt
289
- ? new Date(agent.lastActivityAt).toLocaleTimeString()
290
- : 'N/A'
291
- }); });
292
- output.printTable({
293
- columns: [
294
- { key: 'id', header: 'ID', width: 20 },
295
- { key: 'type', header: 'Type', width: 15 },
296
- { key: 'status', header: 'Status', width: 12, format: formatStatus },
297
- { key: 'created', header: 'Created', width: 12 },
298
- { key: 'lastActivity', header: 'Last Activity', width: 12 }
299
- ],
300
- data: displayAgents
301
- });
302
- output.writeln();
303
- output.printInfo("Total: " + result.total + " agents");
304
- return [2 /*return*/, { success: true, data: result }];
305
- case 2:
306
- error_2 = _a.sent();
307
- if (error_2 instanceof MCPClientError) {
308
- output.printError("Failed to list agents: " + error_2.message);
309
- }
310
- else {
311
- output.printError("Unexpected error: " + String(error_2));
312
- }
313
- return [2 /*return*/, { success: false, exitCode: 1 }];
314
- case 3: return [2 /*return*/];
211
+ action: async (ctx) => {
212
+ try {
213
+ // Call MCP tool to list agents
214
+ const result = await callMCPTool('agent_list', {
215
+ status: ctx.flags.all ? 'all' : ctx.flags.status || undefined,
216
+ agentType: ctx.flags.type || undefined,
217
+ limit: 100,
218
+ });
219
+ if (ctx.flags.format === 'json') {
220
+ output.printJson(result);
221
+ return { success: true, data: result };
315
222
  }
316
- });
317
- }); }
223
+ output.writeln();
224
+ output.writeln(output.bold('Active Agents'));
225
+ output.writeln();
226
+ if (result.agents.length === 0) {
227
+ output.printInfo('No agents found matching criteria');
228
+ return { success: true, data: result };
229
+ }
230
+ // Format for display
231
+ const displayAgents = result.agents.map(agent => ({
232
+ id: agent.id,
233
+ type: agent.agentType,
234
+ status: agent.status,
235
+ created: new Date(agent.createdAt).toLocaleTimeString(),
236
+ lastActivity: agent.lastActivityAt
237
+ ? new Date(agent.lastActivityAt).toLocaleTimeString()
238
+ : 'N/A',
239
+ }));
240
+ output.printTable({
241
+ columns: [
242
+ { key: 'id', header: 'ID', width: 20 },
243
+ { key: 'type', header: 'Type', width: 15 },
244
+ { key: 'status', header: 'Status', width: 12, format: formatStatus },
245
+ { key: 'created', header: 'Created', width: 12 },
246
+ { key: 'lastActivity', header: 'Last Activity', width: 12 }
247
+ ],
248
+ data: displayAgents
249
+ });
250
+ output.writeln();
251
+ output.printInfo(`Total: ${result.total} agents`);
252
+ return { success: true, data: result };
253
+ }
254
+ catch (error) {
255
+ if (error instanceof MCPClientError) {
256
+ output.printError(`Failed to list agents: ${error.message}`);
257
+ }
258
+ else {
259
+ output.printError(`Unexpected error: ${String(error)}`);
260
+ }
261
+ return { success: false, exitCode: 1 };
262
+ }
263
+ }
318
264
  };
319
265
  // Agent status subcommand
320
- var statusCommand = {
266
+ const statusCommand = {
321
267
  name: 'status',
322
268
  description: 'Show detailed status of an agent',
323
269
  options: [
@@ -327,83 +273,70 @@ var statusCommand = {
327
273
  type: 'string'
328
274
  }
329
275
  ],
330
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
331
- var agentId, status, avgExecTime, uptime, error_3;
332
- var _a, _b, _c, _d, _e;
333
- return __generator(this, function (_f) {
334
- switch (_f.label) {
335
- case 0:
336
- agentId = ctx.args[0] || ctx.flags.id;
337
- if (!(!agentId && ctx.interactive)) return [3 /*break*/, 2];
338
- return [4 /*yield*/, input({
339
- message: 'Enter agent ID:',
340
- validate: function (v) { return v.length > 0 || 'Agent ID is required'; }
341
- })];
342
- case 1:
343
- agentId = _f.sent();
344
- _f.label = 2;
345
- case 2:
346
- if (!agentId) {
347
- output.printError('Agent ID is required');
348
- return [2 /*return*/, { success: false, exitCode: 1 }];
349
- }
350
- _f.label = 3;
351
- case 3:
352
- _f.trys.push([3, 5, , 6]);
353
- return [4 /*yield*/, callMCPTool('agent_status', {
354
- agentId: agentId,
355
- includeMetrics: true,
356
- includeHistory: false
357
- })];
358
- case 4:
359
- status = _f.sent();
360
- if (ctx.flags.format === 'json') {
361
- output.printJson(status);
362
- return [2 /*return*/, { success: true, data: status }];
363
- }
364
- output.writeln();
365
- output.printBox([
366
- "Type: " + status.agentType,
367
- "Status: " + formatStatus(status.status),
368
- "Created: " + new Date(status.createdAt).toLocaleString(),
369
- "Last Activity: " + (status.lastActivityAt ? new Date(status.lastActivityAt).toLocaleString() : 'N/A')
370
- ].join('\n'), "Agent: " + status.id);
371
- if (status.metrics) {
372
- output.writeln();
373
- output.writeln(output.bold('Metrics'));
374
- avgExecTime = (_a = status.metrics.averageExecutionTime) !== null && _a !== void 0 ? _a : 0;
375
- uptime = (_b = status.metrics.uptime) !== null && _b !== void 0 ? _b : 0;
376
- output.printTable({
377
- columns: [
378
- { key: 'metric', header: 'Metric', width: 25 },
379
- { key: 'value', header: 'Value', width: 15, align: 'right' }
380
- ],
381
- data: [
382
- { metric: 'Tasks Completed', value: (_c = status.metrics.tasksCompleted) !== null && _c !== void 0 ? _c : 0 },
383
- { metric: 'Tasks In Progress', value: (_d = status.metrics.tasksInProgress) !== null && _d !== void 0 ? _d : 0 },
384
- { metric: 'Tasks Failed', value: (_e = status.metrics.tasksFailed) !== null && _e !== void 0 ? _e : 0 },
385
- { metric: 'Avg Execution Time', value: avgExecTime.toFixed(2) + "ms" },
386
- { metric: 'Uptime', value: (uptime / 1000 / 60).toFixed(1) + "m" }
387
- ]
388
- });
389
- }
390
- return [2 /*return*/, { success: true, data: status }];
391
- case 5:
392
- error_3 = _f.sent();
393
- if (error_3 instanceof MCPClientError) {
394
- output.printError("Failed to get agent status: " + error_3.message);
395
- }
396
- else {
397
- output.printError("Unexpected error: " + String(error_3));
398
- }
399
- return [2 /*return*/, { success: false, exitCode: 1 }];
400
- case 6: return [2 /*return*/];
276
+ action: async (ctx) => {
277
+ let agentId = ctx.args[0] || ctx.flags.id;
278
+ if (!agentId && ctx.interactive) {
279
+ agentId = await input({
280
+ message: 'Enter agent ID:',
281
+ validate: (v) => v.length > 0 || 'Agent ID is required'
282
+ });
283
+ }
284
+ if (!agentId) {
285
+ output.printError('Agent ID is required');
286
+ return { success: false, exitCode: 1 };
287
+ }
288
+ try {
289
+ // Call MCP tool to get agent status
290
+ const status = await callMCPTool('agent_status', {
291
+ agentId,
292
+ includeMetrics: true,
293
+ includeHistory: false,
294
+ });
295
+ if (ctx.flags.format === 'json') {
296
+ output.printJson(status);
297
+ return { success: true, data: status };
401
298
  }
402
- });
403
- }); }
299
+ output.writeln();
300
+ output.printBox([
301
+ `Type: ${status.agentType}`,
302
+ `Status: ${formatStatus(status.status)}`,
303
+ `Created: ${new Date(status.createdAt).toLocaleString()}`,
304
+ `Last Activity: ${status.lastActivityAt ? new Date(status.lastActivityAt).toLocaleString() : 'N/A'}`
305
+ ].join('\n'), `Agent: ${status.id}`);
306
+ if (status.metrics) {
307
+ output.writeln();
308
+ output.writeln(output.bold('Metrics'));
309
+ const avgExecTime = status.metrics.averageExecutionTime ?? 0;
310
+ const uptime = status.metrics.uptime ?? 0;
311
+ output.printTable({
312
+ columns: [
313
+ { key: 'metric', header: 'Metric', width: 25 },
314
+ { key: 'value', header: 'Value', width: 15, align: 'right' }
315
+ ],
316
+ data: [
317
+ { metric: 'Tasks Completed', value: status.metrics.tasksCompleted ?? 0 },
318
+ { metric: 'Tasks In Progress', value: status.metrics.tasksInProgress ?? 0 },
319
+ { metric: 'Tasks Failed', value: status.metrics.tasksFailed ?? 0 },
320
+ { metric: 'Avg Execution Time', value: `${avgExecTime.toFixed(2)}ms` },
321
+ { metric: 'Uptime', value: `${(uptime / 1000 / 60).toFixed(1)}m` }
322
+ ]
323
+ });
324
+ }
325
+ return { success: true, data: status };
326
+ }
327
+ catch (error) {
328
+ if (error instanceof MCPClientError) {
329
+ output.printError(`Failed to get agent status: ${error.message}`);
330
+ }
331
+ else {
332
+ output.printError(`Unexpected error: ${String(error)}`);
333
+ }
334
+ return { success: false, exitCode: 1 };
335
+ }
336
+ }
404
337
  };
405
338
  // Agent stop subcommand
406
- var stopCommand = {
339
+ const stopCommand = {
407
340
  name: 'stop',
408
341
  aliases: ['kill'],
409
342
  description: 'Stop a running agent',
@@ -413,78 +346,66 @@ var stopCommand = {
413
346
  short: 'f',
414
347
  description: 'Force stop without graceful shutdown',
415
348
  type: 'boolean',
416
- "default": false
349
+ default: false
417
350
  },
418
351
  {
419
352
  name: 'timeout',
420
353
  description: 'Graceful shutdown timeout in seconds',
421
354
  type: 'number',
422
- "default": 30
355
+ default: 30
423
356
  }
424
357
  ],
425
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
426
- var agentId, force, confirmed, result, error_4;
427
- return __generator(this, function (_a) {
428
- switch (_a.label) {
429
- case 0:
430
- agentId = ctx.args[0];
431
- if (!agentId) {
432
- output.printError('Agent ID is required');
433
- return [2 /*return*/, { success: false, exitCode: 1 }];
434
- }
435
- force = ctx.flags.force;
436
- if (!(!force && ctx.interactive)) return [3 /*break*/, 2];
437
- return [4 /*yield*/, confirm({
438
- message: "Are you sure you want to stop agent " + agentId + "?",
439
- "default": false
440
- })];
441
- case 1:
442
- confirmed = _a.sent();
443
- if (!confirmed) {
444
- output.printInfo('Operation cancelled');
445
- return [2 /*return*/, { success: true }];
446
- }
447
- _a.label = 2;
448
- case 2:
449
- output.printInfo("Stopping agent " + agentId + "...");
450
- _a.label = 3;
451
- case 3:
452
- _a.trys.push([3, 5, , 6]);
453
- return [4 /*yield*/, callMCPTool('agent_terminate', {
454
- agentId: agentId,
455
- graceful: !force,
456
- reason: 'Stopped by user via CLI'
457
- })];
458
- case 4:
459
- result = _a.sent();
460
- if (!force) {
461
- output.writeln(output.dim(' Completing current task...'));
462
- output.writeln(output.dim(' Saving state...'));
463
- output.writeln(output.dim(' Releasing resources...'));
464
- }
465
- output.printSuccess("Agent " + agentId + " stopped successfully");
466
- // Update swarm-activity.json so statusline reflects the reduced agent count
467
- updateSwarmActivityMetrics(-1);
468
- if (ctx.flags.format === 'json') {
469
- output.printJson(result);
470
- }
471
- return [2 /*return*/, { success: true, data: result }];
472
- case 5:
473
- error_4 = _a.sent();
474
- if (error_4 instanceof MCPClientError) {
475
- output.printError("Failed to stop agent: " + error_4.message);
476
- }
477
- else {
478
- output.printError("Unexpected error: " + String(error_4));
479
- }
480
- return [2 /*return*/, { success: false, exitCode: 1 }];
481
- case 6: return [2 /*return*/];
358
+ action: async (ctx) => {
359
+ const agentId = ctx.args[0];
360
+ if (!agentId) {
361
+ output.printError('Agent ID is required');
362
+ return { success: false, exitCode: 1 };
363
+ }
364
+ const force = ctx.flags.force;
365
+ if (!force && ctx.interactive) {
366
+ const confirmed = await confirm({
367
+ message: `Are you sure you want to stop agent ${agentId}?`,
368
+ default: false
369
+ });
370
+ if (!confirmed) {
371
+ output.printInfo('Operation cancelled');
372
+ return { success: true };
482
373
  }
483
- });
484
- }); }
374
+ }
375
+ output.printInfo(`Stopping agent ${agentId}...`);
376
+ try {
377
+ // Call MCP tool to terminate agent
378
+ const result = await callMCPTool('agent_terminate', {
379
+ agentId,
380
+ graceful: !force,
381
+ reason: 'Stopped by user via CLI',
382
+ });
383
+ if (!force) {
384
+ output.writeln(output.dim(' Completing current task...'));
385
+ output.writeln(output.dim(' Saving state...'));
386
+ output.writeln(output.dim(' Releasing resources...'));
387
+ }
388
+ output.printSuccess(`Agent ${agentId} stopped successfully`);
389
+ // Update swarm-activity.json so statusline reflects the reduced agent count
390
+ updateSwarmActivityMetrics(-1);
391
+ if (ctx.flags.format === 'json') {
392
+ output.printJson(result);
393
+ }
394
+ return { success: true, data: result };
395
+ }
396
+ catch (error) {
397
+ if (error instanceof MCPClientError) {
398
+ output.printError(`Failed to stop agent: ${error.message}`);
399
+ }
400
+ else {
401
+ output.printError(`Unexpected error: ${String(error)}`);
402
+ }
403
+ return { success: false, exitCode: 1 };
404
+ }
405
+ }
485
406
  };
486
407
  // Agent metrics subcommand
487
- var metricsCommand = {
408
+ const metricsCommand = {
488
409
  name: 'metrics',
489
410
  description: 'Show agent performance metrics',
490
411
  options: [
@@ -493,150 +414,140 @@ var metricsCommand = {
493
414
  short: 'p',
494
415
  description: 'Time period (1h, 24h, 7d, 30d)',
495
416
  type: 'string',
496
- "default": '24h'
417
+ default: '24h'
497
418
  }
498
419
  ],
499
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
500
- var agentId, period, _a, existsSync, readFileSync, readdirSync, statSync, join, totalAgents, activeAgents, tasksCompleted, typeCounts, swarmDir, agentsDir, files, _i, files_1, file, data, agType, activityFile, activity, vectorCount, dbPath, dbSize, byType, avgSuccessRate, metrics;
501
- return __generator(this, function (_b) {
502
- switch (_b.label) {
503
- case 0:
504
- agentId = ctx.args[0];
505
- period = ctx.flags.period;
506
- return [4 /*yield*/, import('fs')];
507
- case 1:
508
- _a = _b.sent(), existsSync = _a.existsSync, readFileSync = _a.readFileSync, readdirSync = _a.readdirSync, statSync = _a.statSync;
509
- return [4 /*yield*/, import('path')];
510
- case 2:
511
- join = (_b.sent()).join;
512
- totalAgents = 0;
513
- activeAgents = 0;
514
- tasksCompleted = 0;
515
- typeCounts = {};
516
- swarmDir = join(process.cwd(), '.swarm');
517
- agentsDir = join(swarmDir, 'agents');
518
- if (existsSync(agentsDir)) {
519
- try {
520
- files = readdirSync(agentsDir).filter(function (f) { return f.endsWith('.json'); });
521
- for (_i = 0, files_1 = files; _i < files_1.length; _i++) {
522
- file = files_1[_i];
523
- try {
524
- data = JSON.parse(readFileSync(join(agentsDir, file), 'utf-8'));
525
- totalAgents++;
526
- agType = data.type || 'unknown';
527
- if (!typeCounts[agType])
528
- typeCounts[agType] = { count: 0, tasks: 0, success: 0 };
529
- typeCounts[agType].count++;
530
- if (data.status === 'active' || data.status === 'running')
531
- activeAgents++;
532
- if (data.tasksCompleted) {
533
- typeCounts[agType].tasks += data.tasksCompleted;
534
- tasksCompleted += data.tasksCompleted;
535
- }
536
- if (data.successCount)
537
- typeCounts[agType].success += data.successCount;
538
- }
539
- catch ( /* skip malformed */_c) { /* skip malformed */ }
540
- }
541
- }
542
- catch ( /* no agents dir */_d) { /* no agents dir */ }
543
- }
544
- activityFile = join(swarmDir, 'swarm-activity.json');
545
- if (existsSync(activityFile)) {
546
- try {
547
- activity = JSON.parse(readFileSync(activityFile, 'utf-8'));
548
- if (activity.totalAgents && totalAgents === 0)
549
- totalAgents = activity.totalAgents;
550
- if (activity.activeAgents && activeAgents === 0)
551
- activeAgents = activity.activeAgents;
552
- }
553
- catch ( /* ignore */_e) { /* ignore */ }
554
- }
555
- vectorCount = 0;
556
- dbPath = join(swarmDir, 'memory.db');
557
- if (existsSync(dbPath)) {
558
- try {
559
- dbSize = statSync(dbPath).size;
560
- vectorCount = Math.floor(dbSize / 2048);
561
- }
562
- catch ( /* ignore */_f) { /* ignore */ }
563
- }
564
- byType = Object.entries(typeCounts).map(function (_a) {
565
- var type = _a[0], data = _a[1];
566
- return ({
567
- type: type,
568
- count: data.count,
569
- tasks: data.tasks,
570
- successRate: data.tasks > 0 ? Math.round((data.success / data.tasks) * 100) + "%" : 'N/A'
571
- });
572
- });
573
- avgSuccessRate = tasksCompleted > 0
574
- ? Math.round(Object.values(typeCounts).reduce(function (a, d) { return a + d.success; }, 0) / tasksCompleted * 100) + "%"
575
- : 'N/A';
576
- metrics = {
577
- period: period,
578
- summary: {
579
- totalAgents: totalAgents,
580
- activeAgents: activeAgents,
581
- tasksCompleted: tasksCompleted,
582
- avgSuccessRate: avgSuccessRate,
583
- vectorCount: vectorCount,
584
- note: totalAgents === 0 ? 'No agents spawned yet. Use: agent spawn -t coder' : undefined
585
- },
586
- byType: byType,
587
- performance: {
588
- memoryVectors: vectorCount + " vectors",
589
- searchBackend: vectorCount > 0 ? 'HNSW-indexed' : 'none'
420
+ action: async (ctx) => {
421
+ const agentId = ctx.args[0];
422
+ const period = ctx.flags.period;
423
+ // Collect real metrics from .swarm/ state
424
+ const { existsSync, readFileSync, readdirSync, statSync } = await import('fs');
425
+ const { join } = await import('path');
426
+ let totalAgents = 0;
427
+ let activeAgents = 0;
428
+ let tasksCompleted = 0;
429
+ const typeCounts = {};
430
+ // Read swarm agent state
431
+ const swarmDir = join(process.cwd(), '.swarm');
432
+ const agentsDir = join(swarmDir, 'agents');
433
+ if (existsSync(agentsDir)) {
434
+ try {
435
+ const files = readdirSync(agentsDir).filter(f => f.endsWith('.json'));
436
+ for (const file of files) {
437
+ try {
438
+ const data = JSON.parse(readFileSync(join(agentsDir, file), 'utf-8'));
439
+ totalAgents++;
440
+ const agType = data.type || 'unknown';
441
+ if (!typeCounts[agType])
442
+ typeCounts[agType] = { count: 0, tasks: 0, success: 0 };
443
+ typeCounts[agType].count++;
444
+ if (data.status === 'active' || data.status === 'running')
445
+ activeAgents++;
446
+ if (data.tasksCompleted) {
447
+ typeCounts[agType].tasks += data.tasksCompleted;
448
+ tasksCompleted += data.tasksCompleted;
590
449
  }
591
- };
592
- if (ctx.flags.format === 'json') {
593
- output.printJson(metrics);
594
- return [2 /*return*/, { success: true, data: metrics }];
595
- }
596
- output.writeln();
597
- output.writeln(output.bold("Agent Metrics (" + period + ")"));
598
- output.writeln();
599
- output.printTable({
600
- columns: [
601
- { key: 'metric', header: 'Metric', width: 20 },
602
- { key: 'value', header: 'Value', width: 15, align: 'right' }
603
- ],
604
- data: [
605
- { metric: 'Total Agents', value: metrics.summary.totalAgents },
606
- { metric: 'Active Agents', value: metrics.summary.activeAgents },
607
- { metric: 'Tasks Completed', value: metrics.summary.tasksCompleted },
608
- { metric: 'Success Rate', value: metrics.summary.avgSuccessRate },
609
- { metric: 'Memory Vectors', value: metrics.summary.vectorCount }
610
- ]
611
- });
612
- output.writeln();
613
- output.writeln(output.bold('By Agent Type'));
614
- output.printTable({
615
- columns: [
616
- { key: 'type', header: 'Type', width: 12 },
617
- { key: 'count', header: 'Count', width: 8, align: 'right' },
618
- { key: 'tasks', header: 'Tasks', width: 8, align: 'right' },
619
- { key: 'successRate', header: 'Success', width: 10, align: 'right' }
620
- ],
621
- data: metrics.byType
622
- });
623
- if (metrics.summary.note) {
624
- output.writeln();
625
- output.writeln(output.dim(metrics.summary.note));
450
+ if (data.successCount)
451
+ typeCounts[agType].success += data.successCount;
626
452
  }
627
- output.writeln();
628
- output.writeln(output.bold('Memory'));
629
- output.printList([
630
- "Vectors: " + output.success(metrics.performance.memoryVectors),
631
- "Backend: " + output.success(metrics.performance.searchBackend)
632
- ]);
633
- return [2 /*return*/, { success: true, data: metrics }];
453
+ catch { /* skip malformed */ }
454
+ }
455
+ }
456
+ catch { /* no agents dir */ }
457
+ }
458
+ // Read swarm activity for additional state
459
+ const activityFile = join(swarmDir, 'swarm-activity.json');
460
+ if (existsSync(activityFile)) {
461
+ try {
462
+ const activity = JSON.parse(readFileSync(activityFile, 'utf-8'));
463
+ if (activity.totalAgents && totalAgents === 0)
464
+ totalAgents = activity.totalAgents;
465
+ if (activity.activeAgents && activeAgents === 0)
466
+ activeAgents = activity.activeAgents;
634
467
  }
468
+ catch { /* ignore */ }
469
+ }
470
+ // Read memory.db stats
471
+ let vectorCount = 0;
472
+ const dbPath = join(swarmDir, 'memory.db');
473
+ if (existsSync(dbPath)) {
474
+ try {
475
+ const dbSize = statSync(dbPath).size;
476
+ vectorCount = Math.floor(dbSize / 2048);
477
+ }
478
+ catch { /* ignore */ }
479
+ }
480
+ const byType = Object.entries(typeCounts).map(([type, data]) => ({
481
+ type,
482
+ count: data.count,
483
+ tasks: data.tasks,
484
+ successRate: data.tasks > 0 ? `${Math.round((data.success / data.tasks) * 100)}%` : 'N/A'
485
+ }));
486
+ const avgSuccessRate = tasksCompleted > 0
487
+ ? `${Math.round(Object.values(typeCounts).reduce((a, d) => a + d.success, 0) / tasksCompleted * 100)}%`
488
+ : 'N/A';
489
+ const metrics = {
490
+ period,
491
+ summary: {
492
+ totalAgents,
493
+ activeAgents,
494
+ tasksCompleted,
495
+ avgSuccessRate,
496
+ vectorCount,
497
+ note: totalAgents === 0 ? 'No agents spawned yet. Use: agent spawn -t coder' : undefined
498
+ },
499
+ byType,
500
+ performance: {
501
+ memoryVectors: `${vectorCount} vectors`,
502
+ searchBackend: vectorCount > 0 ? 'HNSW-indexed' : 'none'
503
+ }
504
+ };
505
+ if (ctx.flags.format === 'json') {
506
+ output.printJson(metrics);
507
+ return { success: true, data: metrics };
508
+ }
509
+ output.writeln();
510
+ output.writeln(output.bold(`Agent Metrics (${period})`));
511
+ output.writeln();
512
+ output.printTable({
513
+ columns: [
514
+ { key: 'metric', header: 'Metric', width: 20 },
515
+ { key: 'value', header: 'Value', width: 15, align: 'right' }
516
+ ],
517
+ data: [
518
+ { metric: 'Total Agents', value: metrics.summary.totalAgents },
519
+ { metric: 'Active Agents', value: metrics.summary.activeAgents },
520
+ { metric: 'Tasks Completed', value: metrics.summary.tasksCompleted },
521
+ { metric: 'Success Rate', value: metrics.summary.avgSuccessRate },
522
+ { metric: 'Memory Vectors', value: metrics.summary.vectorCount }
523
+ ]
524
+ });
525
+ output.writeln();
526
+ output.writeln(output.bold('By Agent Type'));
527
+ output.printTable({
528
+ columns: [
529
+ { key: 'type', header: 'Type', width: 12 },
530
+ { key: 'count', header: 'Count', width: 8, align: 'right' },
531
+ { key: 'tasks', header: 'Tasks', width: 8, align: 'right' },
532
+ { key: 'successRate', header: 'Success', width: 10, align: 'right' }
533
+ ],
534
+ data: metrics.byType
635
535
  });
636
- }); }
536
+ if (metrics.summary.note) {
537
+ output.writeln();
538
+ output.writeln(output.dim(metrics.summary.note));
539
+ }
540
+ output.writeln();
541
+ output.writeln(output.bold('Memory'));
542
+ output.printList([
543
+ `Vectors: ${output.success(metrics.performance.memoryVectors)}`,
544
+ `Backend: ${output.success(metrics.performance.searchBackend)}`
545
+ ]);
546
+ return { success: true, data: metrics };
547
+ }
637
548
  };
638
549
  // Agent pool subcommand
639
- var poolCommand = {
550
+ const poolCommand = {
640
551
  name: 'pool',
641
552
  description: 'Manage agent pool for scaling',
642
553
  options: [
@@ -650,84 +561,75 @@ var poolCommand = {
650
561
  name: 'min',
651
562
  description: 'Minimum pool size',
652
563
  type: 'number',
653
- "default": 1
564
+ default: 1
654
565
  },
655
566
  {
656
567
  name: 'max',
657
568
  description: 'Maximum pool size',
658
569
  type: 'number',
659
- "default": 10
570
+ default: 10
660
571
  },
661
572
  {
662
573
  name: 'auto-scale',
663
574
  short: 'a',
664
575
  description: 'Enable auto-scaling',
665
576
  type: 'boolean',
666
- "default": true
577
+ default: true
667
578
  }
668
579
  ],
669
580
  examples: [
670
581
  { command: 'claude-flow agent pool --size 5', description: 'Set pool size' },
671
582
  { command: 'claude-flow agent pool --min 2 --max 15', description: 'Configure auto-scaling' }
672
583
  ],
673
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
674
- var result, utilization, agents, error_5;
675
- var _a, _b, _c, _d, _e, _f, _g;
676
- return __generator(this, function (_h) {
677
- switch (_h.label) {
678
- case 0:
679
- _h.trys.push([0, 2, , 3]);
680
- return [4 /*yield*/, callMCPTool('agent_pool', {
681
- size: ctx.flags.size,
682
- min: ctx.flags.min,
683
- max: ctx.flags.max,
684
- autoScale: (_a = ctx.flags.autoScale) !== null && _a !== void 0 ? _a : true
685
- })];
686
- case 1:
687
- result = _h.sent();
688
- if (ctx.flags.format === 'json') {
689
- output.printJson(result);
690
- return [2 /*return*/, { success: true, data: result }];
691
- }
692
- output.writeln();
693
- utilization = (_b = result.utilization) !== null && _b !== void 0 ? _b : 0;
694
- output.printBox([
695
- "Pool ID: " + ((_c = result.poolId) !== null && _c !== void 0 ? _c : 'default'),
696
- "Current Size: " + ((_d = result.currentSize) !== null && _d !== void 0 ? _d : 0),
697
- "Min/Max: " + ((_e = result.minSize) !== null && _e !== void 0 ? _e : 0) + "/" + ((_f = result.maxSize) !== null && _f !== void 0 ? _f : 100),
698
- "Auto-Scale: " + (result.autoScale ? 'Yes' : 'No'),
699
- "Utilization: " + (utilization * 100).toFixed(1) + "%"
700
- ].join('\n'), 'Agent Pool');
701
- agents = (_g = result.agents) !== null && _g !== void 0 ? _g : [];
702
- if (agents.length > 0) {
703
- output.writeln();
704
- output.writeln(output.bold('Pool Agents'));
705
- output.printTable({
706
- columns: [
707
- { key: 'id', header: 'ID', width: 20 },
708
- { key: 'type', header: 'Type', width: 15 },
709
- { key: 'status', header: 'Status', width: 12, format: formatStatus }
710
- ],
711
- data: agents
712
- });
713
- }
714
- return [2 /*return*/, { success: true, data: result }];
715
- case 2:
716
- error_5 = _h.sent();
717
- if (error_5 instanceof MCPClientError) {
718
- output.printError("Pool error: " + error_5.message);
719
- }
720
- else {
721
- output.printError("Unexpected error: " + String(error_5));
722
- }
723
- return [2 /*return*/, { success: false, exitCode: 1 }];
724
- case 3: return [2 /*return*/];
584
+ action: async (ctx) => {
585
+ try {
586
+ const result = await callMCPTool('agent_pool', {
587
+ size: ctx.flags.size,
588
+ min: ctx.flags.min,
589
+ max: ctx.flags.max,
590
+ autoScale: ctx.flags.autoScale ?? true,
591
+ });
592
+ if (ctx.flags.format === 'json') {
593
+ output.printJson(result);
594
+ return { success: true, data: result };
725
595
  }
726
- });
727
- }); }
596
+ output.writeln();
597
+ const utilization = result.utilization ?? 0;
598
+ output.printBox([
599
+ `Pool ID: ${result.poolId ?? 'default'}`,
600
+ `Current Size: ${result.currentSize ?? 0}`,
601
+ `Min/Max: ${result.minSize ?? 0}/${result.maxSize ?? 100}`,
602
+ `Auto-Scale: ${result.autoScale ? 'Yes' : 'No'}`,
603
+ `Utilization: ${(utilization * 100).toFixed(1)}%`
604
+ ].join('\n'), 'Agent Pool');
605
+ const agents = result.agents ?? [];
606
+ if (agents.length > 0) {
607
+ output.writeln();
608
+ output.writeln(output.bold('Pool Agents'));
609
+ output.printTable({
610
+ columns: [
611
+ { key: 'id', header: 'ID', width: 20 },
612
+ { key: 'type', header: 'Type', width: 15 },
613
+ { key: 'status', header: 'Status', width: 12, format: formatStatus }
614
+ ],
615
+ data: agents
616
+ });
617
+ }
618
+ return { success: true, data: result };
619
+ }
620
+ catch (error) {
621
+ if (error instanceof MCPClientError) {
622
+ output.printError(`Pool error: ${error.message}`);
623
+ }
624
+ else {
625
+ output.printError(`Unexpected error: ${String(error)}`);
626
+ }
627
+ return { success: false, exitCode: 1 };
628
+ }
629
+ }
728
630
  };
729
631
  // Agent health subcommand
730
- var healthCommand = {
632
+ const healthCommand = {
731
633
  name: 'health',
732
634
  description: 'Show agent health and metrics',
733
635
  options: [
@@ -742,114 +644,102 @@ var healthCommand = {
742
644
  short: 'd',
743
645
  description: 'Show detailed health metrics',
744
646
  type: 'boolean',
745
- "default": false
647
+ default: false
746
648
  },
747
649
  {
748
650
  name: 'watch',
749
651
  short: 'w',
750
652
  description: 'Watch mode (refresh every 5s)',
751
653
  type: 'boolean',
752
- "default": false
654
+ default: false
753
655
  }
754
656
  ],
755
657
  examples: [
756
658
  { command: 'claude-flow agent health', description: 'Show all agents health' },
757
659
  { command: 'claude-flow agent health -i agent-001 -d', description: 'Detailed health for specific agent' }
758
660
  ],
759
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
760
- var agentId, detailed, result, overall, avgCpu, avgMemory, healthAgents, _i, healthAgents_1, agent, uptime, latency, tasks, errors, error_6;
761
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
762
- return __generator(this, function (_t) {
763
- switch (_t.label) {
764
- case 0:
765
- agentId = ctx.args[0] || ctx.flags.id;
766
- detailed = ctx.flags.detailed;
767
- _t.label = 1;
768
- case 1:
769
- _t.trys.push([1, 3, , 4]);
770
- return [4 /*yield*/, callMCPTool('agent_health', {
771
- agentId: agentId,
772
- detailed: detailed
773
- })];
774
- case 2:
775
- result = _t.sent();
776
- if (ctx.flags.format === 'json') {
777
- output.printJson(result);
778
- return [2 /*return*/, { success: true, data: result }];
779
- }
780
- output.writeln();
781
- output.writeln(output.bold('Agent Health'));
782
- output.writeln();
783
- overall = (_a = result.overall) !== null && _a !== void 0 ? _a : { healthy: 0, degraded: 0, unhealthy: 0, avgCpu: 0, avgMemory: 0 };
784
- avgCpu = (_b = overall.avgCpu) !== null && _b !== void 0 ? _b : 0;
785
- avgMemory = (_c = overall.avgMemory) !== null && _c !== void 0 ? _c : 0;
786
- output.printBox([
787
- "Healthy: " + output.success(String((_d = overall.healthy) !== null && _d !== void 0 ? _d : 0)),
788
- "Degraded: " + output.warning(String((_e = overall.degraded) !== null && _e !== void 0 ? _e : 0)),
789
- "Unhealthy: " + output.error(String((_f = overall.unhealthy) !== null && _f !== void 0 ? _f : 0)),
790
- "Avg CPU: " + avgCpu.toFixed(1) + "%",
791
- "Avg Memory: " + (avgMemory * 100).toFixed(1) + "%"
792
- ].join(' | '), 'Overall Status');
793
- healthAgents = (_g = result.agents) !== null && _g !== void 0 ? _g : [];
661
+ action: async (ctx) => {
662
+ const agentId = ctx.args[0] || ctx.flags.id;
663
+ const detailed = ctx.flags.detailed;
664
+ try {
665
+ const result = await callMCPTool('agent_health', {
666
+ agentId,
667
+ detailed,
668
+ });
669
+ if (ctx.flags.format === 'json') {
670
+ output.printJson(result);
671
+ return { success: true, data: result };
672
+ }
673
+ output.writeln();
674
+ output.writeln(output.bold('Agent Health'));
675
+ output.writeln();
676
+ // Overall summary with null checks
677
+ const overall = result.overall ?? { healthy: 0, degraded: 0, unhealthy: 0, avgCpu: 0, avgMemory: 0 };
678
+ const avgCpu = overall.avgCpu ?? 0;
679
+ const avgMemory = overall.avgMemory ?? 0;
680
+ output.printBox([
681
+ `Healthy: ${output.success(String(overall.healthy ?? 0))}`,
682
+ `Degraded: ${output.warning(String(overall.degraded ?? 0))}`,
683
+ `Unhealthy: ${output.error(String(overall.unhealthy ?? 0))}`,
684
+ `Avg CPU: ${avgCpu.toFixed(1)}%`,
685
+ `Avg Memory: ${(avgMemory * 100).toFixed(1)}%`
686
+ ].join(' | '), 'Overall Status');
687
+ const healthAgents = result.agents ?? [];
688
+ output.writeln();
689
+ output.printTable({
690
+ columns: [
691
+ { key: 'id', header: 'Agent ID', width: 18 },
692
+ { key: 'type', header: 'Type', width: 12 },
693
+ { key: 'health', header: 'Health', width: 10, format: formatHealthStatus },
694
+ { key: 'cpu', header: 'CPU %', width: 8, align: 'right', format: (v) => `${Number(v ?? 0).toFixed(1)}%` },
695
+ { key: 'memory', header: 'Memory', width: 10, align: 'right', format: (v) => {
696
+ const mem = v;
697
+ if (!mem)
698
+ return '0%';
699
+ return `${(mem.used / mem.limit * 100).toFixed(0)}%`;
700
+ } },
701
+ { key: 'tasks', header: 'Tasks', width: 12, align: 'right', format: (v) => {
702
+ const t = v;
703
+ if (!t)
704
+ return '0/0';
705
+ return `${t.active ?? 0}/${t.completed ?? 0}`;
706
+ } }
707
+ ],
708
+ data: healthAgents
709
+ });
710
+ if (detailed && healthAgents.length > 0) {
711
+ output.writeln();
712
+ output.writeln(output.bold('Detailed Metrics'));
713
+ for (const agent of healthAgents) {
794
714
  output.writeln();
795
- output.printTable({
796
- columns: [
797
- { key: 'id', header: 'Agent ID', width: 18 },
798
- { key: 'type', header: 'Type', width: 12 },
799
- { key: 'health', header: 'Health', width: 10, format: formatHealthStatus },
800
- { key: 'cpu', header: 'CPU %', width: 8, align: 'right', format: function (v) { return Number(v !== null && v !== void 0 ? v : 0).toFixed(1) + "%"; } },
801
- { key: 'memory', header: 'Memory', width: 10, align: 'right', format: function (v) {
802
- var mem = v;
803
- if (!mem)
804
- return '0%';
805
- return (mem.used / mem.limit * 100).toFixed(0) + "%";
806
- } },
807
- { key: 'tasks', header: 'Tasks', width: 12, align: 'right', format: function (v) {
808
- var _a, _b;
809
- var t = v;
810
- if (!t)
811
- return '0/0';
812
- return ((_a = t.active) !== null && _a !== void 0 ? _a : 0) + "/" + ((_b = t.completed) !== null && _b !== void 0 ? _b : 0);
813
- } }
814
- ],
815
- data: healthAgents
816
- });
817
- if (detailed && healthAgents.length > 0) {
818
- output.writeln();
819
- output.writeln(output.bold('Detailed Metrics'));
820
- for (_i = 0, healthAgents_1 = healthAgents; _i < healthAgents_1.length; _i++) {
821
- agent = healthAgents_1[_i];
822
- output.writeln();
823
- output.writeln(output.highlight(agent.id));
824
- uptime = (_h = agent.uptime) !== null && _h !== void 0 ? _h : 0;
825
- latency = (_j = agent.latency) !== null && _j !== void 0 ? _j : { avg: 0, p99: 0 };
826
- tasks = (_k = agent.tasks) !== null && _k !== void 0 ? _k : { completed: 0, failed: 0, queued: 0 };
827
- errors = (_l = agent.errors) !== null && _l !== void 0 ? _l : { count: 0 };
828
- output.printList([
829
- "Uptime: " + (uptime / 1000 / 60).toFixed(1) + " min",
830
- "Latency: avg " + ((_m = latency.avg) !== null && _m !== void 0 ? _m : 0).toFixed(1) + "ms, p99 " + ((_o = latency.p99) !== null && _o !== void 0 ? _o : 0).toFixed(1) + "ms",
831
- "Tasks: " + ((_p = tasks.completed) !== null && _p !== void 0 ? _p : 0) + " completed, " + ((_q = tasks.failed) !== null && _q !== void 0 ? _q : 0) + " failed, " + ((_r = tasks.queued) !== null && _r !== void 0 ? _r : 0) + " queued",
832
- "Errors: " + ((_s = errors.count) !== null && _s !== void 0 ? _s : 0) + (errors.lastError ? " (" + errors.lastError + ")" : '')
833
- ]);
834
- }
835
- }
836
- return [2 /*return*/, { success: true, data: result }];
837
- case 3:
838
- error_6 = _t.sent();
839
- if (error_6 instanceof MCPClientError) {
840
- output.printError("Health check error: " + error_6.message);
841
- }
842
- else {
843
- output.printError("Unexpected error: " + String(error_6));
844
- }
845
- return [2 /*return*/, { success: false, exitCode: 1 }];
846
- case 4: return [2 /*return*/];
715
+ output.writeln(output.highlight(agent.id));
716
+ const uptime = agent.uptime ?? 0;
717
+ const latency = agent.latency ?? { avg: 0, p99: 0 };
718
+ const tasks = agent.tasks ?? { completed: 0, failed: 0, queued: 0 };
719
+ const errors = agent.errors ?? { count: 0 };
720
+ output.printList([
721
+ `Uptime: ${(uptime / 1000 / 60).toFixed(1)} min`,
722
+ `Latency: avg ${(latency.avg ?? 0).toFixed(1)}ms, p99 ${(latency.p99 ?? 0).toFixed(1)}ms`,
723
+ `Tasks: ${tasks.completed ?? 0} completed, ${tasks.failed ?? 0} failed, ${tasks.queued ?? 0} queued`,
724
+ `Errors: ${errors.count ?? 0}${errors.lastError ? ` (${errors.lastError})` : ''}`
725
+ ]);
726
+ }
847
727
  }
848
- });
849
- }); }
728
+ return { success: true, data: result };
729
+ }
730
+ catch (error) {
731
+ if (error instanceof MCPClientError) {
732
+ output.printError(`Health check error: ${error.message}`);
733
+ }
734
+ else {
735
+ output.printError(`Unexpected error: ${String(error)}`);
736
+ }
737
+ return { success: false, exitCode: 1 };
738
+ }
739
+ }
850
740
  };
851
741
  // Agent logs subcommand
852
- var logsCommand = {
742
+ const logsCommand = {
853
743
  name: 'logs',
854
744
  description: 'Show agent activity logs',
855
745
  options: [
@@ -864,7 +754,7 @@ var logsCommand = {
864
754
  short: 'n',
865
755
  description: 'Number of recent entries',
866
756
  type: 'number',
867
- "default": 50
757
+ default: 50
868
758
  },
869
759
  {
870
760
  name: 'level',
@@ -872,14 +762,14 @@ var logsCommand = {
872
762
  description: 'Minimum log level',
873
763
  type: 'string',
874
764
  choices: ['debug', 'info', 'warn', 'error'],
875
- "default": 'info'
765
+ default: 'info'
876
766
  },
877
767
  {
878
768
  name: 'follow',
879
769
  short: 'f',
880
770
  description: 'Follow log output',
881
771
  type: 'boolean',
882
- "default": false
772
+ default: false
883
773
  },
884
774
  {
885
775
  name: 'since',
@@ -892,63 +782,52 @@ var logsCommand = {
892
782
  { command: 'claude-flow agent logs -i agent-001 -f', description: 'Follow agent logs' },
893
783
  { command: 'claude-flow agent logs -l error --since 1h', description: 'Show errors from last hour' }
894
784
  ],
895
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
896
- var agentId, tail, level, result, _i, _a, entry, time, levelStr, error_7;
897
- return __generator(this, function (_b) {
898
- switch (_b.label) {
899
- case 0:
900
- agentId = ctx.args[0] || ctx.flags.id;
901
- tail = ctx.flags.tail;
902
- level = ctx.flags.level;
903
- if (!agentId) {
904
- output.printError('Agent ID is required. Use --id or -i');
905
- return [2 /*return*/, { success: false, exitCode: 1 }];
906
- }
907
- _b.label = 1;
908
- case 1:
909
- _b.trys.push([1, 3, , 4]);
910
- return [4 /*yield*/, callMCPTool('agent_logs', {
911
- agentId: agentId,
912
- tail: tail,
913
- level: level,
914
- since: ctx.flags.since
915
- })];
916
- case 2:
917
- result = _b.sent();
918
- if (ctx.flags.format === 'json') {
919
- output.printJson(result);
920
- return [2 /*return*/, { success: true, data: result }];
921
- }
922
- output.writeln();
923
- output.writeln(output.bold("Logs for " + agentId));
924
- output.writeln(output.dim("Showing " + result.entries.length + " of " + result.total + " entries"));
925
- output.writeln();
926
- for (_i = 0, _a = result.entries; _i < _a.length; _i++) {
927
- entry = _a[_i];
928
- time = new Date(entry.timestamp).toLocaleTimeString();
929
- levelStr = formatLogLevel(entry.level);
930
- output.writeln(output.dim(time) + " " + levelStr + " " + entry.message);
931
- if (entry.context && Object.keys(entry.context).length > 0) {
932
- output.writeln(output.dim(" " + JSON.stringify(entry.context)));
933
- }
934
- }
935
- return [2 /*return*/, { success: true, data: result }];
936
- case 3:
937
- error_7 = _b.sent();
938
- if (error_7 instanceof MCPClientError) {
939
- output.printError("Logs error: " + error_7.message);
940
- }
941
- else {
942
- output.printError("Unexpected error: " + String(error_7));
943
- }
944
- return [2 /*return*/, { success: false, exitCode: 1 }];
945
- case 4: return [2 /*return*/];
785
+ action: async (ctx) => {
786
+ const agentId = ctx.args[0] || ctx.flags.id;
787
+ const tail = ctx.flags.tail;
788
+ const level = ctx.flags.level;
789
+ if (!agentId) {
790
+ output.printError('Agent ID is required. Use --id or -i');
791
+ return { success: false, exitCode: 1 };
792
+ }
793
+ try {
794
+ const result = await callMCPTool('agent_logs', {
795
+ agentId,
796
+ tail,
797
+ level,
798
+ since: ctx.flags.since,
799
+ });
800
+ if (ctx.flags.format === 'json') {
801
+ output.printJson(result);
802
+ return { success: true, data: result };
946
803
  }
947
- });
948
- }); }
804
+ output.writeln();
805
+ output.writeln(output.bold(`Logs for ${agentId}`));
806
+ output.writeln(output.dim(`Showing ${result.entries.length} of ${result.total} entries`));
807
+ output.writeln();
808
+ for (const entry of result.entries) {
809
+ const time = new Date(entry.timestamp).toLocaleTimeString();
810
+ const levelStr = formatLogLevel(entry.level);
811
+ output.writeln(`${output.dim(time)} ${levelStr} ${entry.message}`);
812
+ if (entry.context && Object.keys(entry.context).length > 0) {
813
+ output.writeln(output.dim(` ${JSON.stringify(entry.context)}`));
814
+ }
815
+ }
816
+ return { success: true, data: result };
817
+ }
818
+ catch (error) {
819
+ if (error instanceof MCPClientError) {
820
+ output.printError(`Logs error: ${error.message}`);
821
+ }
822
+ else {
823
+ output.printError(`Unexpected error: ${String(error)}`);
824
+ }
825
+ return { success: false, exitCode: 1 };
826
+ }
827
+ }
949
828
  };
950
829
  function formatHealthStatus(health) {
951
- var h = String(health);
830
+ const h = String(health);
952
831
  switch (h) {
953
832
  case 'healthy':
954
833
  return output.success(h);
@@ -971,11 +850,11 @@ function formatLogLevel(level) {
971
850
  case 'error':
972
851
  return output.error('[ERROR]');
973
852
  default:
974
- return "[" + level.toUpperCase() + "]";
853
+ return `[${level.toUpperCase()}]`;
975
854
  }
976
855
  }
977
856
  // Main agent command
978
- export var agentCommand = {
857
+ export const agentCommand = {
979
858
  name: 'agent',
980
859
  description: 'Agent management commands',
981
860
  subcommands: [spawnCommand, listCommand, statusCommand, stopCommand, metricsCommand, poolCommand, healthCommand, logsCommand],
@@ -985,31 +864,29 @@ export var agentCommand = {
985
864
  { command: 'claude-flow agent list', description: 'List all agents' },
986
865
  { command: 'claude-flow agent status agent-001', description: 'Show agent status' }
987
866
  ],
988
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
989
- return __generator(this, function (_a) {
990
- // Show help if no subcommand
991
- output.writeln();
992
- output.writeln(output.bold('Agent Management Commands'));
993
- output.writeln();
994
- output.writeln('Usage: claude-flow agent <subcommand> [options]');
995
- output.writeln();
996
- output.writeln('Subcommands:');
997
- output.printList([
998
- output.highlight('spawn') + " - Spawn a new agent",
999
- output.highlight('list') + " - List all active agents",
1000
- output.highlight('status') + " - Show detailed agent status",
1001
- output.highlight('stop') + " - Stop a running agent",
1002
- output.highlight('metrics') + " - Show agent metrics"
1003
- ]);
1004
- output.writeln();
1005
- output.writeln('Run "claude-flow agent <subcommand> --help" for subcommand help');
1006
- return [2 /*return*/, { success: true }];
1007
- });
1008
- }); }
867
+ action: async (ctx) => {
868
+ // Show help if no subcommand
869
+ output.writeln();
870
+ output.writeln(output.bold('Agent Management Commands'));
871
+ output.writeln();
872
+ output.writeln('Usage: claude-flow agent <subcommand> [options]');
873
+ output.writeln();
874
+ output.writeln('Subcommands:');
875
+ output.printList([
876
+ `${output.highlight('spawn')} - Spawn a new agent`,
877
+ `${output.highlight('list')} - List all active agents`,
878
+ `${output.highlight('status')} - Show detailed agent status`,
879
+ `${output.highlight('stop')} - Stop a running agent`,
880
+ `${output.highlight('metrics')} - Show agent metrics`
881
+ ]);
882
+ output.writeln();
883
+ output.writeln('Run "claude-flow agent <subcommand> --help" for subcommand help');
884
+ return { success: true };
885
+ }
1009
886
  };
1010
887
  // Helper functions
1011
888
  function getAgentCapabilities(type) {
1012
- var capabilities = {
889
+ const capabilities = {
1013
890
  coder: ['code-generation', 'refactoring', 'debugging', 'testing'],
1014
891
  researcher: ['web-search', 'data-analysis', 'summarization', 'citation'],
1015
892
  tester: ['unit-testing', 'integration-testing', 'coverage-analysis', 'automation'],
@@ -1023,7 +900,7 @@ function getAgentCapabilities(type) {
1023
900
  return capabilities[type] || ['general'];
1024
901
  }
1025
902
  function formatStatus(status) {
1026
- var statusStr = String(status);
903
+ const statusStr = String(status);
1027
904
  switch (statusStr) {
1028
905
  case 'active':
1029
906
  return output.success(statusStr);