kynjal-cli 3.1.4 → 4.0.0

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 (566) hide show
  1. package/.claude/agents/core/coder.md +1 -1
  2. package/.claude/agents/core/planner.md +2 -2
  3. package/.claude/agents/core/researcher.md +1 -1
  4. package/.claude/agents/core/reviewer.md +1 -1
  5. package/.claude/agents/core/tester.md +1 -1
  6. package/.claude/agents/data/data-ml-model.md +4 -4
  7. package/.claude/agents/development/dev-backend-api.md +4 -4
  8. package/.claude/agents/documentation/docs-api-openapi.md +4 -4
  9. package/.claude/agents/github/code-review-swarm.md +2 -2
  10. package/.claude/agents/github/issue-tracker.md +2 -2
  11. package/.claude/agents/github/pr-manager.md +2 -2
  12. package/.claude/agents/github/release-manager.md +2 -2
  13. package/.claude/agents/github/workflow-automation.md +2 -2
  14. package/.claude/agents/sparc/architecture.md +3 -3
  15. package/.claude/agents/sparc/pseudocode.md +2 -2
  16. package/.claude/agents/sparc/refinement.md +3 -3
  17. package/.claude/agents/sparc/specification.md +2 -2
  18. package/.claude/agents/swarm/adaptive-coordinator.md +1 -1
  19. package/.claude/agents/swarm/hierarchical-coordinator.md +1 -1
  20. package/.claude/agents/swarm/mesh-coordinator.md +1 -1
  21. package/.claude/agents/templates/base-template-generator.md +25 -4
  22. package/.claude/agents/templates/sparc-coordinator.md +3 -3
  23. package/.claude/helpers/auto-commit.sh +1 -1
  24. package/.claude/helpers/auto-memory-hook.mjs +27 -9
  25. package/.claude/helpers/hook-handler.cjs +58 -18
  26. package/.claude/helpers/statusline.cjs +420 -613
  27. package/.claude/helpers/statusline.js +3 -3
  28. package/.claude/settings.json +9 -9
  29. package/.claude/skills/reasoningbank-intelligence/SKILL.md +2 -2
  30. package/.claude/skills/swarm-orchestration/SKILL.md +1 -1
  31. package/README.md +383 -170
  32. package/bin/cli.js +6 -6
  33. package/bin/mcp-server.js +1 -1
  34. package/bin/preinstall.cjs +2 -0
  35. package/dist/src/appliance/gguf-engine.js +664 -0
  36. package/dist/src/appliance/gguf-engine.js.map +1 -0
  37. package/dist/src/appliance/ruvllm-bridge.js +492 -0
  38. package/dist/src/appliance/ruvllm-bridge.js.map +1 -0
  39. package/dist/src/appliance/rvfa-builder.js +383 -0
  40. package/dist/src/appliance/rvfa-builder.js.map +1 -0
  41. package/dist/src/appliance/rvfa-distribution.js +533 -0
  42. package/dist/src/appliance/rvfa-distribution.js.map +1 -0
  43. package/dist/src/appliance/rvfa-format.js +465 -0
  44. package/dist/src/appliance/rvfa-format.js.map +1 -0
  45. package/dist/src/appliance/rvfa-runner.js +373 -0
  46. package/dist/src/appliance/rvfa-runner.js.map +1 -0
  47. package/dist/src/appliance/rvfa-signing.js +469 -0
  48. package/dist/src/appliance/rvfa-signing.js.map +1 -0
  49. package/dist/src/benchmarks/pretrain/index.js +542 -331
  50. package/dist/src/benchmarks/pretrain/index.js.map +1 -1
  51. package/dist/src/commands/agent.d.ts.map +1 -1
  52. package/dist/src/commands/agent.js +725 -502
  53. package/dist/src/commands/agent.js.map +1 -1
  54. package/dist/src/commands/analyze.js +1548 -1218
  55. package/dist/src/commands/analyze.js.map +1 -1
  56. package/dist/src/commands/appliance-advanced.d.ts +9 -0
  57. package/dist/src/commands/appliance-advanced.d.ts.map +1 -0
  58. package/dist/src/commands/appliance-advanced.js +324 -0
  59. package/dist/src/commands/appliance-advanced.js.map +1 -0
  60. package/dist/src/commands/appliance.d.ts +8 -0
  61. package/dist/src/commands/appliance.d.ts.map +1 -0
  62. package/dist/src/commands/appliance.js +581 -0
  63. package/dist/src/commands/appliance.js.map +1 -0
  64. package/dist/src/commands/benchmark.js +523 -372
  65. package/dist/src/commands/benchmark.js.map +1 -1
  66. package/dist/src/commands/claims.js +364 -274
  67. package/dist/src/commands/claims.js.map +1 -1
  68. package/dist/src/commands/cleanup.d.ts +13 -0
  69. package/dist/src/commands/cleanup.d.ts.map +1 -0
  70. package/dist/src/commands/cleanup.js +262 -0
  71. package/dist/src/commands/cleanup.js.map +1 -0
  72. package/dist/src/commands/completions.js +118 -477
  73. package/dist/src/commands/completions.js.map +1 -1
  74. package/dist/src/commands/config.js +303 -237
  75. package/dist/src/commands/config.js.map +1 -1
  76. package/dist/src/commands/daemon.d.ts.map +1 -1
  77. package/dist/src/commands/daemon.js +597 -425
  78. package/dist/src/commands/daemon.js.map +1 -1
  79. package/dist/src/commands/deployment.js +275 -194
  80. package/dist/src/commands/deployment.js.map +1 -1
  81. package/dist/src/commands/doctor.d.ts.map +1 -1
  82. package/dist/src/commands/doctor.js +690 -460
  83. package/dist/src/commands/doctor.js.map +1 -1
  84. package/dist/src/commands/embeddings.js +1543 -1293
  85. package/dist/src/commands/embeddings.js.map +1 -1
  86. package/dist/src/commands/guidance.js +596 -449
  87. package/dist/src/commands/guidance.js.map +1 -1
  88. package/dist/src/commands/hive-mind.js +938 -854
  89. package/dist/src/commands/hive-mind.js.map +1 -1
  90. package/dist/src/commands/hooks.d.ts.map +1 -1
  91. package/dist/src/commands/hooks.js +3677 -2570
  92. package/dist/src/commands/hooks.js.map +1 -1
  93. package/dist/src/commands/index.js +322 -122
  94. package/dist/src/commands/index.js.map +1 -1
  95. package/dist/src/commands/init.d.ts +1 -1
  96. package/dist/src/commands/init.d.ts.map +1 -1
  97. package/dist/src/commands/init.js +943 -787
  98. package/dist/src/commands/init.js.map +1 -1
  99. package/dist/src/commands/issues.js +558 -383
  100. package/dist/src/commands/issues.js.map +1 -1
  101. package/dist/src/commands/mcp.d.ts.map +1 -1
  102. package/dist/src/commands/mcp.js +605 -475
  103. package/dist/src/commands/mcp.js.map +1 -1
  104. package/dist/src/commands/memory.d.ts.map +1 -1
  105. package/dist/src/commands/memory.js +1031 -814
  106. package/dist/src/commands/memory.js.map +1 -1
  107. package/dist/src/commands/migrate.js +347 -282
  108. package/dist/src/commands/migrate.js.map +1 -1
  109. package/dist/src/commands/neural.d.ts.map +1 -1
  110. package/dist/src/commands/neural.js +1563 -1283
  111. package/dist/src/commands/neural.js.map +1 -1
  112. package/dist/src/commands/performance.js +643 -497
  113. package/dist/src/commands/performance.js.map +1 -1
  114. package/dist/src/commands/plugins.js +841 -668
  115. package/dist/src/commands/plugins.js.map +1 -1
  116. package/dist/src/commands/process.js +447 -392
  117. package/dist/src/commands/process.js.map +1 -1
  118. package/dist/src/commands/progress.js +256 -162
  119. package/dist/src/commands/progress.js.map +1 -1
  120. package/dist/src/commands/providers.js +220 -150
  121. package/dist/src/commands/providers.js.map +1 -1
  122. package/dist/src/commands/route.js +665 -520
  123. package/dist/src/commands/route.js.map +1 -1
  124. package/dist/src/commands/ruvector/backup.js +651 -505
  125. package/dist/src/commands/ruvector/backup.js.map +1 -1
  126. package/dist/src/commands/ruvector/benchmark.js +401 -349
  127. package/dist/src/commands/ruvector/benchmark.js.map +1 -1
  128. package/dist/src/commands/ruvector/import.js +267 -225
  129. package/dist/src/commands/ruvector/import.js.map +1 -1
  130. package/dist/src/commands/ruvector/index.js +75 -37
  131. package/dist/src/commands/ruvector/index.js.map +1 -1
  132. package/dist/src/commands/ruvector/init.js +359 -336
  133. package/dist/src/commands/ruvector/init.js.map +1 -1
  134. package/dist/src/commands/ruvector/migrate.js +322 -335
  135. package/dist/src/commands/ruvector/migrate.js.map +1 -1
  136. package/dist/src/commands/ruvector/optimize.js +431 -375
  137. package/dist/src/commands/ruvector/optimize.js.map +1 -1
  138. package/dist/src/commands/ruvector/setup.js +117 -703
  139. package/dist/src/commands/ruvector/setup.js.map +1 -1
  140. package/dist/src/commands/ruvector/status.js +419 -364
  141. package/dist/src/commands/ruvector/status.js.map +1 -1
  142. package/dist/src/commands/security.d.ts.map +1 -1
  143. package/dist/src/commands/security.js +610 -456
  144. package/dist/src/commands/security.js.map +1 -1
  145. package/dist/src/commands/session.d.ts +1 -1
  146. package/dist/src/commands/session.js +627 -505
  147. package/dist/src/commands/session.js.map +1 -1
  148. package/dist/src/commands/start.d.ts +1 -1
  149. package/dist/src/commands/start.js +368 -271
  150. package/dist/src/commands/start.js.map +1 -1
  151. package/dist/src/commands/status.d.ts +1 -1
  152. package/dist/src/commands/status.d.ts.map +1 -1
  153. package/dist/src/commands/status.js +492 -379
  154. package/dist/src/commands/status.js.map +1 -1
  155. package/dist/src/commands/swarm.js +488 -408
  156. package/dist/src/commands/swarm.js.map +1 -1
  157. package/dist/src/commands/task.d.ts +1 -1
  158. package/dist/src/commands/task.js +539 -424
  159. package/dist/src/commands/task.js.map +1 -1
  160. package/dist/src/commands/transfer-store.js +412 -322
  161. package/dist/src/commands/transfer-store.js.map +1 -1
  162. package/dist/src/commands/update.js +291 -196
  163. package/dist/src/commands/update.js.map +1 -1
  164. package/dist/src/commands/workflow.js +486 -386
  165. package/dist/src/commands/workflow.js.map +1 -1
  166. package/dist/src/config-adapter.js +40 -39
  167. package/dist/src/config-adapter.js.map +1 -1
  168. package/dist/src/index.js +416 -312
  169. package/dist/src/index.js.map +1 -1
  170. package/dist/src/infrastructure/in-memory-repositories.js +507 -246
  171. package/dist/src/infrastructure/in-memory-repositories.js.map +1 -1
  172. package/dist/src/init/claudemd-generator.js +78 -368
  173. package/dist/src/init/claudemd-generator.js.map +1 -1
  174. package/dist/src/init/executor.js +1019 -1345
  175. package/dist/src/init/executor.js.map +1 -1
  176. package/dist/src/init/helpers-generator.js +60 -635
  177. package/dist/src/init/helpers-generator.js.map +1 -1
  178. package/dist/src/init/index.d.ts +1 -1
  179. package/dist/src/init/index.d.ts.map +1 -1
  180. package/dist/src/init/index.js +1 -1
  181. package/dist/src/init/index.js.map +1 -1
  182. package/dist/src/init/mcp-generator.d.ts +0 -1
  183. package/dist/src/init/mcp-generator.d.ts.map +1 -1
  184. package/dist/src/init/mcp-generator.js +62 -42
  185. package/dist/src/init/mcp-generator.js.map +1 -1
  186. package/dist/src/init/settings-generator.d.ts.map +1 -1
  187. package/dist/src/init/settings-generator.js +167 -100
  188. package/dist/src/init/settings-generator.js.map +1 -1
  189. package/dist/src/init/statusline-generator.d.ts +16 -8
  190. package/dist/src/init/statusline-generator.d.ts.map +1 -1
  191. package/dist/src/init/statusline-generator.js +20 -1300
  192. package/dist/src/init/statusline-generator.js.map +1 -1
  193. package/dist/src/init/types.d.ts +15 -5
  194. package/dist/src/init/types.d.ts.map +1 -1
  195. package/dist/src/init/types.js +66 -76
  196. package/dist/src/init/types.js.map +1 -1
  197. package/dist/src/mcp-client.js +130 -76
  198. package/dist/src/mcp-client.js.map +1 -1
  199. package/dist/src/mcp-server.js +758 -445
  200. package/dist/src/mcp-server.js.map +1 -1
  201. package/dist/src/mcp-tools/agent-tools.js +492 -391
  202. package/dist/src/mcp-tools/agent-tools.js.map +1 -1
  203. package/dist/src/mcp-tools/agentdb-tools.d.ts +30 -0
  204. package/dist/src/mcp-tools/agentdb-tools.d.ts.map +1 -0
  205. package/dist/src/mcp-tools/agentdb-tools.js +758 -0
  206. package/dist/src/mcp-tools/agentdb-tools.js.map +1 -0
  207. package/dist/src/mcp-tools/analyze-tools.js +236 -172
  208. package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
  209. package/dist/src/mcp-tools/auto-install.js +142 -80
  210. package/dist/src/mcp-tools/auto-install.js.map +1 -1
  211. package/dist/src/mcp-tools/browser-tools.js +375 -252
  212. package/dist/src/mcp-tools/browser-tools.js.map +1 -1
  213. package/dist/src/mcp-tools/claims-tools.js +565 -473
  214. package/dist/src/mcp-tools/claims-tools.js.map +1 -1
  215. package/dist/src/mcp-tools/config-tools.d.ts.map +1 -1
  216. package/dist/src/mcp-tools/config-tools.js +284 -190
  217. package/dist/src/mcp-tools/config-tools.js.map +1 -1
  218. package/dist/src/mcp-tools/coordination-tools.d.ts.map +1 -1
  219. package/dist/src/mcp-tools/coordination-tools.js +600 -349
  220. package/dist/src/mcp-tools/coordination-tools.js.map +1 -1
  221. package/dist/src/mcp-tools/daa-tools.js +367 -289
  222. package/dist/src/mcp-tools/daa-tools.js.map +1 -1
  223. package/dist/src/mcp-tools/embeddings-tools.js +693 -582
  224. package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
  225. package/dist/src/mcp-tools/github-tools.js +312 -261
  226. package/dist/src/mcp-tools/github-tools.js.map +1 -1
  227. package/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -1
  228. package/dist/src/mcp-tools/hive-mind-tools.js +718 -423
  229. package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
  230. package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
  231. package/dist/src/mcp-tools/hooks-tools.js +2726 -1978
  232. package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
  233. package/dist/src/mcp-tools/index.d.ts +2 -0
  234. package/dist/src/mcp-tools/index.d.ts.map +1 -1
  235. package/dist/src/mcp-tools/index.js +2 -0
  236. package/dist/src/mcp-tools/index.js.map +1 -1
  237. package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
  238. package/dist/src/mcp-tools/memory-tools.js +514 -329
  239. package/dist/src/mcp-tools/memory-tools.js.map +1 -1
  240. package/dist/src/mcp-tools/neural-tools.d.ts.map +1 -1
  241. package/dist/src/mcp-tools/neural-tools.js +428 -326
  242. package/dist/src/mcp-tools/neural-tools.js.map +1 -1
  243. package/dist/src/mcp-tools/performance-tools.js +480 -420
  244. package/dist/src/mcp-tools/performance-tools.js.map +1 -1
  245. package/dist/src/mcp-tools/progress-tools.js +278 -204
  246. package/dist/src/mcp-tools/progress-tools.js.map +1 -1
  247. package/dist/src/mcp-tools/ruvllm-tools.d.ts +9 -0
  248. package/dist/src/mcp-tools/ruvllm-tools.d.ts.map +1 -0
  249. package/dist/src/mcp-tools/ruvllm-tools.js +399 -0
  250. package/dist/src/mcp-tools/ruvllm-tools.js.map +1 -0
  251. package/dist/src/mcp-tools/security-tools.js +429 -297
  252. package/dist/src/mcp-tools/security-tools.js.map +1 -1
  253. package/dist/src/mcp-tools/session-tools.js +234 -185
  254. package/dist/src/mcp-tools/session-tools.js.map +1 -1
  255. package/dist/src/mcp-tools/swarm-tools.d.ts +2 -1
  256. package/dist/src/mcp-tools/swarm-tools.d.ts.map +1 -1
  257. package/dist/src/mcp-tools/swarm-tools.js +303 -64
  258. package/dist/src/mcp-tools/swarm-tools.js.map +1 -1
  259. package/dist/src/mcp-tools/system-tools.d.ts.map +1 -1
  260. package/dist/src/mcp-tools/system-tools.js +352 -200
  261. package/dist/src/mcp-tools/system-tools.js.map +1 -1
  262. package/dist/src/mcp-tools/task-tools.d.ts.map +1 -1
  263. package/dist/src/mcp-tools/task-tools.js +357 -189
  264. package/dist/src/mcp-tools/task-tools.js.map +1 -1
  265. package/dist/src/mcp-tools/terminal-tools.js +196 -148
  266. package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
  267. package/dist/src/mcp-tools/transfer-tools.js +333 -186
  268. package/dist/src/mcp-tools/transfer-tools.js.map +1 -1
  269. package/dist/src/mcp-tools/wasm-agent-tools.d.ts +9 -0
  270. package/dist/src/mcp-tools/wasm-agent-tools.d.ts.map +1 -0
  271. package/dist/src/mcp-tools/wasm-agent-tools.js +377 -0
  272. package/dist/src/mcp-tools/wasm-agent-tools.js.map +1 -0
  273. package/dist/src/mcp-tools/workflow-tools.d.ts.map +1 -1
  274. package/dist/src/mcp-tools/workflow-tools.js +471 -335
  275. package/dist/src/mcp-tools/workflow-tools.js.map +1 -1
  276. package/dist/src/memory/ewc-consolidation.js +345 -173
  277. package/dist/src/memory/ewc-consolidation.js.map +1 -1
  278. package/dist/src/memory/intelligence.js +841 -359
  279. package/dist/src/memory/intelligence.js.map +1 -1
  280. package/dist/src/memory/memory-bridge.js +1964 -0
  281. package/dist/src/memory/memory-bridge.js.map +1 -0
  282. package/dist/src/memory/memory-initializer.js +1895 -1602
  283. package/dist/src/memory/memory-initializer.js.map +1 -1
  284. package/dist/src/memory/sona-optimizer.js +329 -199
  285. package/dist/src/memory/sona-optimizer.js.map +1 -1
  286. package/dist/src/output.d.ts +2 -2
  287. package/dist/src/output.d.ts.map +1 -1
  288. package/dist/src/output.js +273 -242
  289. package/dist/src/output.js.map +1 -1
  290. package/dist/src/parser.js +217 -124
  291. package/dist/src/parser.js.map +1 -1
  292. package/dist/src/plugins/manager.js +531 -278
  293. package/dist/src/plugins/manager.js.map +1 -1
  294. package/dist/src/plugins/store/discovery.js +362 -275
  295. package/dist/src/plugins/store/discovery.js.map +1 -1
  296. package/dist/src/plugins/store/index.js +105 -48
  297. package/dist/src/plugins/store/index.js.map +1 -1
  298. package/dist/src/plugins/store/search.js +107 -69
  299. package/dist/src/plugins/store/search.js.map +1 -1
  300. package/dist/src/plugins/tests/demo-plugin-store.js +160 -113
  301. package/dist/src/plugins/tests/demo-plugin-store.js.map +1 -1
  302. package/dist/src/plugins/tests/standalone-test.js +223 -172
  303. package/dist/src/plugins/tests/standalone-test.js.map +1 -1
  304. package/dist/src/plugins/tests/test-plugin-store.js +228 -190
  305. package/dist/src/plugins/tests/test-plugin-store.js.map +1 -1
  306. package/dist/src/production/circuit-breaker.js +126 -62
  307. package/dist/src/production/circuit-breaker.js.map +1 -1
  308. package/dist/src/production/error-handler.js +156 -86
  309. package/dist/src/production/error-handler.js.map +1 -1
  310. package/dist/src/production/monitoring.js +220 -139
  311. package/dist/src/production/monitoring.js.map +1 -1
  312. package/dist/src/production/rate-limiter.js +93 -74
  313. package/dist/src/production/rate-limiter.js.map +1 -1
  314. package/dist/src/production/retry.js +167 -75
  315. package/dist/src/production/retry.js.map +1 -1
  316. package/dist/src/prompt.js +560 -436
  317. package/dist/src/prompt.js.map +1 -1
  318. package/dist/src/runtime/headless.js +289 -200
  319. package/dist/src/runtime/headless.js.map +1 -1
  320. package/dist/src/ruvector/agent-wasm.js +511 -0
  321. package/dist/src/ruvector/agent-wasm.js.map +1 -0
  322. package/dist/src/ruvector/ast-analyzer.js +232 -145
  323. package/dist/src/ruvector/ast-analyzer.js.map +1 -1
  324. package/dist/src/ruvector/coverage-router.js +419 -287
  325. package/dist/src/ruvector/coverage-router.js.map +1 -1
  326. package/dist/src/ruvector/coverage-tools.js +101 -56
  327. package/dist/src/ruvector/coverage-tools.js.map +1 -1
  328. package/dist/src/ruvector/diff-classifier.js +451 -324
  329. package/dist/src/ruvector/diff-classifier.js.map +1 -1
  330. package/dist/src/ruvector/enhanced-model-router.js +337 -251
  331. package/dist/src/ruvector/enhanced-model-router.js.map +1 -1
  332. package/dist/src/ruvector/flash-attention.js +254 -223
  333. package/dist/src/ruvector/flash-attention.js.map +1 -1
  334. package/dist/src/ruvector/graph-analyzer.js +680 -486
  335. package/dist/src/ruvector/graph-analyzer.js.map +1 -1
  336. package/dist/src/ruvector/index.js +113 -27
  337. package/dist/src/ruvector/index.js.map +1 -1
  338. package/dist/src/ruvector/lora-adapter.js +248 -155
  339. package/dist/src/ruvector/lora-adapter.js.map +1 -1
  340. package/dist/src/ruvector/model-router.js +248 -175
  341. package/dist/src/ruvector/model-router.js.map +1 -1
  342. package/dist/src/ruvector/moe-router.js +286 -228
  343. package/dist/src/ruvector/moe-router.js.map +1 -1
  344. package/dist/src/ruvector/q-learning-router.js +338 -257
  345. package/dist/src/ruvector/q-learning-router.js.map +1 -1
  346. package/dist/src/ruvector/ruvllm-wasm.js +527 -0
  347. package/dist/src/ruvector/ruvllm-wasm.js.map +1 -0
  348. package/dist/src/ruvector/semantic-router.js +67 -60
  349. package/dist/src/ruvector/semantic-router.js.map +1 -1
  350. package/dist/src/ruvector/vector-db.js +205 -119
  351. package/dist/src/ruvector/vector-db.js.map +1 -1
  352. package/dist/src/services/agentic-flow-bridge.js +168 -0
  353. package/dist/src/services/agentic-flow-bridge.js.map +1 -0
  354. package/dist/src/services/claim-service.js +940 -615
  355. package/dist/src/services/claim-service.js.map +1 -1
  356. package/dist/src/services/container-worker-pool.js +669 -399
  357. package/dist/src/services/container-worker-pool.js.map +1 -1
  358. package/dist/src/services/headless-worker-executor.js +467 -441
  359. package/dist/src/services/headless-worker-executor.js.map +1 -1
  360. package/dist/src/services/index.d.ts +5 -5
  361. package/dist/src/services/index.d.ts.map +1 -1
  362. package/dist/src/services/index.js +4 -4
  363. package/dist/src/services/index.js.map +1 -1
  364. package/dist/src/services/registry-api.js +201 -93
  365. package/dist/src/services/registry-api.js.map +1 -1
  366. package/dist/src/services/ruvector-training.js +414 -144
  367. package/dist/src/services/ruvector-training.js.map +1 -1
  368. package/dist/src/services/worker-daemon.js +928 -531
  369. package/dist/src/services/worker-daemon.js.map +1 -1
  370. package/dist/src/services/worker-queue.js +550 -331
  371. package/dist/src/services/worker-queue.js.map +1 -1
  372. package/dist/src/suggest.js +55 -45
  373. package/dist/src/suggest.js.map +1 -1
  374. package/dist/src/transfer/anonymization/index.js +37 -29
  375. package/dist/src/transfer/anonymization/index.js.map +1 -1
  376. package/dist/src/transfer/deploy-seraphine.d.ts +1 -1
  377. package/dist/src/transfer/deploy-seraphine.js +156 -129
  378. package/dist/src/transfer/deploy-seraphine.js.map +1 -1
  379. package/dist/src/transfer/export.js +142 -84
  380. package/dist/src/transfer/export.js.map +1 -1
  381. package/dist/src/transfer/index.d.ts +1 -1
  382. package/dist/src/transfer/index.d.ts.map +1 -1
  383. package/dist/src/transfer/index.js +2 -0
  384. package/dist/src/transfer/index.js.map +1 -1
  385. package/dist/src/transfer/ipfs/client.js +337 -179
  386. package/dist/src/transfer/ipfs/client.js.map +1 -1
  387. package/dist/src/transfer/ipfs/upload.js +434 -290
  388. package/dist/src/transfer/ipfs/upload.js.map +1 -1
  389. package/dist/src/transfer/models/seraphine.js +58 -58
  390. package/dist/src/transfer/models/seraphine.js.map +1 -1
  391. package/dist/src/transfer/serialization/cfp.js +37 -33
  392. package/dist/src/transfer/serialization/cfp.js.map +1 -1
  393. package/dist/src/transfer/storage/gcs.js +248 -139
  394. package/dist/src/transfer/storage/gcs.js.map +1 -1
  395. package/dist/src/transfer/store/discovery.js +353 -243
  396. package/dist/src/transfer/store/discovery.js.map +1 -1
  397. package/dist/src/transfer/store/download.js +365 -243
  398. package/dist/src/transfer/store/download.js.map +1 -1
  399. package/dist/src/transfer/store/index.js +130 -63
  400. package/dist/src/transfer/store/index.js.map +1 -1
  401. package/dist/src/transfer/store/publish.js +258 -184
  402. package/dist/src/transfer/store/publish.js.map +1 -1
  403. package/dist/src/transfer/store/registry.js +73 -51
  404. package/dist/src/transfer/store/registry.js.map +1 -1
  405. package/dist/src/transfer/store/search.js +96 -64
  406. package/dist/src/transfer/store/search.js.map +1 -1
  407. package/dist/src/transfer/store/tests/standalone-test.js +231 -174
  408. package/dist/src/transfer/store/tests/standalone-test.js.map +1 -1
  409. package/dist/src/transfer/test-seraphine.js +130 -95
  410. package/dist/src/transfer/test-seraphine.js.map +1 -1
  411. package/dist/src/transfer/tests/test-store.js +239 -194
  412. package/dist/src/transfer/tests/test-store.js.map +1 -1
  413. package/dist/src/types.js +56 -27
  414. package/dist/src/types.js.map +1 -1
  415. package/dist/src/update/checker.js +183 -106
  416. package/dist/src/update/checker.js.map +1 -1
  417. package/dist/src/update/executor.js +198 -135
  418. package/dist/src/update/executor.js.map +1 -1
  419. package/dist/src/update/index.js +85 -38
  420. package/dist/src/update/index.js.map +1 -1
  421. package/dist/src/update/rate-limiter.js +31 -19
  422. package/dist/src/update/rate-limiter.js.map +1 -1
  423. package/dist/src/update/validator.js +64 -38
  424. package/dist/src/update/validator.js.map +1 -1
  425. package/dist/tsconfig.tsbuildinfo +1 -1
  426. package/package.json +13 -10
  427. package/.claude/agents/custom/accessibility-auditor.yaml +0 -56
  428. package/.claude/agents/custom/design-architect.yaml +0 -48
  429. package/.claude/agents/custom/ui-developer.yaml +0 -46
  430. package/.claude/agents/custom/ux-researcher.yaml +0 -60
  431. package/dist/src/benchmarks/pretrain/index.d.ts +0 -58
  432. package/dist/src/benchmarks/pretrain/index.d.ts.map +0 -1
  433. package/dist/src/commands/index.d.ts +0 -108
  434. package/dist/src/commands/index.d.ts.map +0 -1
  435. package/dist/src/config-adapter.d.ts +0 -15
  436. package/dist/src/config-adapter.d.ts.map +0 -1
  437. package/dist/src/index.d.ts +0 -76
  438. package/dist/src/index.d.ts.map +0 -1
  439. package/dist/src/infrastructure/in-memory-repositories.d.ts +0 -68
  440. package/dist/src/infrastructure/in-memory-repositories.d.ts.map +0 -1
  441. package/dist/src/init/claudemd-generator.d.ts +0 -25
  442. package/dist/src/init/claudemd-generator.d.ts.map +0 -1
  443. package/dist/src/init/executor.d.ts +0 -41
  444. package/dist/src/init/executor.d.ts.map +0 -1
  445. package/dist/src/init/helpers-generator.d.ts +0 -60
  446. package/dist/src/init/helpers-generator.d.ts.map +0 -1
  447. package/dist/src/mcp-client.d.ts +0 -92
  448. package/dist/src/mcp-client.d.ts.map +0 -1
  449. package/dist/src/mcp-server.d.ts +0 -161
  450. package/dist/src/mcp-server.d.ts.map +0 -1
  451. package/dist/src/mcp-tools/auto-install.d.ts +0 -83
  452. package/dist/src/mcp-tools/auto-install.d.ts.map +0 -1
  453. package/dist/src/mcp-tools/types.d.ts +0 -31
  454. package/dist/src/mcp-tools/types.d.ts.map +0 -1
  455. package/dist/src/memory/ewc-consolidation.d.ts +0 -271
  456. package/dist/src/memory/ewc-consolidation.d.ts.map +0 -1
  457. package/dist/src/memory/intelligence.d.ts +0 -285
  458. package/dist/src/memory/intelligence.d.ts.map +0 -1
  459. package/dist/src/memory/memory-initializer.d.ts +0 -396
  460. package/dist/src/memory/memory-initializer.d.ts.map +0 -1
  461. package/dist/src/memory/sona-optimizer.d.ts +0 -227
  462. package/dist/src/memory/sona-optimizer.d.ts.map +0 -1
  463. package/dist/src/parser.d.ts +0 -41
  464. package/dist/src/parser.d.ts.map +0 -1
  465. package/dist/src/plugins/manager.d.ts +0 -133
  466. package/dist/src/plugins/manager.d.ts.map +0 -1
  467. package/dist/src/plugins/store/discovery.d.ts +0 -88
  468. package/dist/src/plugins/store/discovery.d.ts.map +0 -1
  469. package/dist/src/plugins/store/index.d.ts +0 -76
  470. package/dist/src/plugins/store/index.d.ts.map +0 -1
  471. package/dist/src/plugins/store/search.d.ts +0 -46
  472. package/dist/src/plugins/store/search.d.ts.map +0 -1
  473. package/dist/src/plugins/store/types.d.ts +0 -274
  474. package/dist/src/plugins/store/types.d.ts.map +0 -1
  475. package/dist/src/production/circuit-breaker.d.ts +0 -101
  476. package/dist/src/production/circuit-breaker.d.ts.map +0 -1
  477. package/dist/src/production/error-handler.d.ts +0 -92
  478. package/dist/src/production/error-handler.d.ts.map +0 -1
  479. package/dist/src/production/monitoring.d.ts +0 -161
  480. package/dist/src/production/monitoring.d.ts.map +0 -1
  481. package/dist/src/production/rate-limiter.d.ts +0 -80
  482. package/dist/src/production/rate-limiter.d.ts.map +0 -1
  483. package/dist/src/production/retry.d.ts +0 -48
  484. package/dist/src/production/retry.d.ts.map +0 -1
  485. package/dist/src/prompt.d.ts +0 -44
  486. package/dist/src/prompt.d.ts.map +0 -1
  487. package/dist/src/runtime/headless.d.ts +0 -60
  488. package/dist/src/runtime/headless.d.ts.map +0 -1
  489. package/dist/src/ruvector/ast-analyzer.d.ts +0 -67
  490. package/dist/src/ruvector/ast-analyzer.d.ts.map +0 -1
  491. package/dist/src/ruvector/coverage-router.d.ts +0 -160
  492. package/dist/src/ruvector/coverage-router.d.ts.map +0 -1
  493. package/dist/src/ruvector/diff-classifier.d.ts +0 -175
  494. package/dist/src/ruvector/diff-classifier.d.ts.map +0 -1
  495. package/dist/src/ruvector/enhanced-model-router.d.ts +0 -146
  496. package/dist/src/ruvector/enhanced-model-router.d.ts.map +0 -1
  497. package/dist/src/ruvector/flash-attention.d.ts +0 -195
  498. package/dist/src/ruvector/flash-attention.d.ts.map +0 -1
  499. package/dist/src/ruvector/graph-analyzer.d.ts +0 -187
  500. package/dist/src/ruvector/graph-analyzer.d.ts.map +0 -1
  501. package/dist/src/ruvector/index.d.ts +0 -34
  502. package/dist/src/ruvector/index.d.ts.map +0 -1
  503. package/dist/src/ruvector/lora-adapter.d.ts +0 -218
  504. package/dist/src/ruvector/lora-adapter.d.ts.map +0 -1
  505. package/dist/src/ruvector/model-router.d.ts +0 -220
  506. package/dist/src/ruvector/model-router.d.ts.map +0 -1
  507. package/dist/src/ruvector/moe-router.d.ts +0 -206
  508. package/dist/src/ruvector/moe-router.d.ts.map +0 -1
  509. package/dist/src/ruvector/q-learning-router.d.ts +0 -211
  510. package/dist/src/ruvector/q-learning-router.d.ts.map +0 -1
  511. package/dist/src/ruvector/semantic-router.d.ts +0 -77
  512. package/dist/src/ruvector/semantic-router.d.ts.map +0 -1
  513. package/dist/src/ruvector/vector-db.d.ts +0 -69
  514. package/dist/src/ruvector/vector-db.d.ts.map +0 -1
  515. package/dist/src/services/claim-service.d.ts +0 -204
  516. package/dist/src/services/claim-service.d.ts.map +0 -1
  517. package/dist/src/services/container-worker-pool.d.ts +0 -197
  518. package/dist/src/services/container-worker-pool.d.ts.map +0 -1
  519. package/dist/src/services/headless-worker-executor.d.ts +0 -304
  520. package/dist/src/services/headless-worker-executor.d.ts.map +0 -1
  521. package/dist/src/services/registry-api.d.ts +0 -58
  522. package/dist/src/services/registry-api.d.ts.map +0 -1
  523. package/dist/src/services/ruvector-training.d.ts +0 -213
  524. package/dist/src/services/ruvector-training.d.ts.map +0 -1
  525. package/dist/src/services/worker-daemon.d.ts +0 -203
  526. package/dist/src/services/worker-daemon.d.ts.map +0 -1
  527. package/dist/src/services/worker-queue.d.ts +0 -194
  528. package/dist/src/services/worker-queue.d.ts.map +0 -1
  529. package/dist/src/suggest.d.ts +0 -53
  530. package/dist/src/suggest.d.ts.map +0 -1
  531. package/dist/src/transfer/export.d.ts +0 -25
  532. package/dist/src/transfer/export.d.ts.map +0 -1
  533. package/dist/src/transfer/ipfs/client.d.ts +0 -109
  534. package/dist/src/transfer/ipfs/client.d.ts.map +0 -1
  535. package/dist/src/transfer/ipfs/upload.d.ts +0 -95
  536. package/dist/src/transfer/ipfs/upload.d.ts.map +0 -1
  537. package/dist/src/transfer/models/seraphine.d.ts +0 -72
  538. package/dist/src/transfer/models/seraphine.d.ts.map +0 -1
  539. package/dist/src/transfer/serialization/cfp.d.ts +0 -49
  540. package/dist/src/transfer/serialization/cfp.d.ts.map +0 -1
  541. package/dist/src/transfer/storage/gcs.d.ts +0 -82
  542. package/dist/src/transfer/storage/gcs.d.ts.map +0 -1
  543. package/dist/src/transfer/store/discovery.d.ts +0 -84
  544. package/dist/src/transfer/store/discovery.d.ts.map +0 -1
  545. package/dist/src/transfer/store/download.d.ts +0 -70
  546. package/dist/src/transfer/store/download.d.ts.map +0 -1
  547. package/dist/src/transfer/store/index.d.ts +0 -84
  548. package/dist/src/transfer/store/index.d.ts.map +0 -1
  549. package/dist/src/transfer/store/publish.d.ts +0 -76
  550. package/dist/src/transfer/store/publish.d.ts.map +0 -1
  551. package/dist/src/transfer/store/search.d.ts +0 -54
  552. package/dist/src/transfer/store/search.d.ts.map +0 -1
  553. package/dist/src/transfer/types.d.ts +0 -245
  554. package/dist/src/transfer/types.d.ts.map +0 -1
  555. package/dist/src/types.d.ts +0 -198
  556. package/dist/src/types.d.ts.map +0 -1
  557. package/dist/src/update/checker.d.ts +0 -34
  558. package/dist/src/update/checker.d.ts.map +0 -1
  559. package/dist/src/update/executor.d.ts +0 -32
  560. package/dist/src/update/executor.d.ts.map +0 -1
  561. package/dist/src/update/index.d.ts +0 -33
  562. package/dist/src/update/index.d.ts.map +0 -1
  563. package/dist/src/update/rate-limiter.d.ts +0 -20
  564. package/dist/src/update/rate-limiter.d.ts.map +0 -1
  565. package/dist/src/update/validator.d.ts +0 -17
  566. package/dist/src/update/validator.d.ts.map +0 -1
@@ -2,11 +2,82 @@
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
+ };
5
41
  import { output } from '../output.js';
6
42
  import { select, confirm, input } from '../prompt.js';
7
43
  import { callMCPTool, MCPClientError } from '../mcp-client.js';
44
+ import * as fs from 'fs';
45
+ import * as path from 'path';
46
+ /**
47
+ * Update swarm-activity.json metrics after agent count changes.
48
+ * The statusline reads this file to display the swarm agent count.
49
+ */
50
+ function updateSwarmActivityMetrics(agentCountDelta) {
51
+ var _a;
52
+ try {
53
+ var metricsDir = path.join(process.cwd(), '.claude-flow', 'metrics');
54
+ var activityPath = path.join(metricsDir, 'swarm-activity.json');
55
+ var data = {
56
+ timestamp: new Date().toISOString(),
57
+ swarm: { active: false, agent_count: 0, coordination_active: false }
58
+ };
59
+ if (fs.existsSync(activityPath)) {
60
+ data = JSON.parse(fs.readFileSync(activityPath, 'utf-8'));
61
+ }
62
+ else {
63
+ fs.mkdirSync(metricsDir, { recursive: true });
64
+ }
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);
68
+ swarm.agent_count = newCount;
69
+ swarm.active = newCount > 0;
70
+ swarm.coordination_active = newCount > 0;
71
+ data.swarm = swarm;
72
+ data.timestamp = new Date().toISOString();
73
+ fs.writeFileSync(activityPath, JSON.stringify(data, null, 2));
74
+ }
75
+ catch (_b) {
76
+ // Non-critical — don't fail the command if metrics update fails
77
+ }
78
+ }
8
79
  // Available agent types with descriptions
9
- const AGENT_TYPES = [
80
+ var AGENT_TYPES = [
10
81
  { value: 'coder', label: 'Coder', hint: 'Code development with neural patterns' },
11
82
  { value: 'researcher', label: 'Researcher', hint: 'Research with web access and data analysis' },
12
83
  { value: 'tester', label: 'Tester', hint: 'Comprehensive testing with automation' },
@@ -24,7 +95,7 @@ const AGENT_TYPES = [
24
95
  { value: 'test-architect', label: 'Test Architect', hint: 'TDD London School methodology' }
25
96
  ];
26
97
  // Agent spawn subcommand
27
- const spawnCommand = {
98
+ var spawnCommand = {
28
99
  name: 'spawn',
29
100
  description: 'Spawn a new agent',
30
101
  options: [
@@ -33,7 +104,7 @@ const spawnCommand = {
33
104
  short: 't',
34
105
  description: 'Agent type to spawn',
35
106
  type: 'string',
36
- choices: AGENT_TYPES.map(a => a.value)
107
+ choices: AGENT_TYPES.map(function (a) { return a.value; })
37
108
  },
38
109
  {
39
110
  name: 'name',
@@ -46,7 +117,7 @@ const spawnCommand = {
46
117
  short: 'p',
47
118
  description: 'Provider to use (anthropic, openrouter, ollama)',
48
119
  type: 'string',
49
- default: 'anthropic'
120
+ "default": 'anthropic'
50
121
  },
51
122
  {
52
123
  name: 'model',
@@ -63,91 +134,104 @@ const spawnCommand = {
63
134
  name: 'timeout',
64
135
  description: 'Agent timeout in seconds',
65
136
  type: 'number',
66
- default: 300
137
+ "default": 300
67
138
  },
68
139
  {
69
140
  name: 'auto-tools',
70
141
  description: 'Enable automatic tool usage',
71
142
  type: 'boolean',
72
- default: true
143
+ "default": true
73
144
  }
74
145
  ],
75
146
  examples: [
76
147
  { command: 'claude-flow agent spawn --type coder --name bot-1', description: 'Spawn a coder agent' },
77
148
  { command: 'claude-flow agent spawn -t researcher --task "Research React 19"', description: 'Spawn researcher with task' }
78
149
  ],
79
- action: async (ctx) => {
80
- let agentType = ctx.flags.type;
81
- let agentName = ctx.flags.name;
82
- // Interactive mode if type not specified
83
- if (!agentType && ctx.interactive) {
84
- agentType = await select({
85
- message: 'Select agent type:',
86
- options: AGENT_TYPES
87
- });
88
- }
89
- if (!agentType) {
90
- output.printError('Agent type is required. Use --type or -t flag.');
91
- return { success: false, exitCode: 1 };
92
- }
93
- // Generate name if not provided
94
- if (!agentName) {
95
- agentName = `${agentType}-${Date.now().toString(36)}`;
96
- }
97
- output.printInfo(`Spawning ${agentType} agent: ${output.highlight(agentName)}`);
98
- try {
99
- // Call MCP tool to spawn agent
100
- const result = await callMCPTool('agent_spawn', {
101
- agentType,
102
- id: agentName,
103
- config: {
104
- provider: ctx.flags.provider || 'anthropic',
105
- model: ctx.flags.model,
106
- task: ctx.flags.task,
107
- timeout: ctx.flags.timeout,
108
- autoTools: ctx.flags.autoTools,
109
- },
110
- priority: 'normal',
111
- metadata: {
112
- name: agentName,
113
- capabilities: getAgentCapabilities(agentType),
114
- },
115
- });
116
- output.writeln();
117
- output.printTable({
118
- columns: [
119
- { key: 'property', header: 'Property', width: 15 },
120
- { key: 'value', header: 'Value', width: 40 }
121
- ],
122
- data: [
123
- { property: 'ID', value: result.agentId },
124
- { property: 'Type', value: result.agentType },
125
- { property: 'Name', value: agentName },
126
- { property: 'Status', value: result.status },
127
- { property: 'Created', value: result.createdAt },
128
- { property: 'Capabilities', value: getAgentCapabilities(agentType).join(', ') }
129
- ]
130
- });
131
- output.writeln();
132
- output.printSuccess(`Agent ${agentName} spawned successfully`);
133
- if (ctx.flags.format === 'json') {
134
- output.printJson(result);
135
- }
136
- return { success: true, data: result };
137
- }
138
- catch (error) {
139
- if (error instanceof MCPClientError) {
140
- output.printError(`Failed to spawn agent: ${error.message}`);
141
- }
142
- else {
143
- output.printError(`Unexpected error: ${String(error)}`);
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*/];
144
229
  }
145
- return { success: false, exitCode: 1 };
146
- }
147
- }
230
+ });
231
+ }); }
148
232
  };
149
233
  // Agent list subcommand
150
- const listCommand = {
234
+ var listCommand = {
151
235
  name: 'list',
152
236
  aliases: ['ls'],
153
237
  description: 'List all active agents',
@@ -157,7 +241,7 @@ const listCommand = {
157
241
  short: 'a',
158
242
  description: 'Include inactive agents',
159
243
  type: 'boolean',
160
- default: false
244
+ "default": false
161
245
  },
162
246
  {
163
247
  name: 'type',
@@ -172,62 +256,68 @@ const listCommand = {
172
256
  type: 'string'
173
257
  }
174
258
  ],
175
- action: async (ctx) => {
176
- try {
177
- // Call MCP tool to list agents
178
- const result = await callMCPTool('agent_list', {
179
- status: ctx.flags.all ? 'all' : ctx.flags.status || undefined,
180
- agentType: ctx.flags.type || undefined,
181
- limit: 100,
182
- });
183
- if (ctx.flags.format === 'json') {
184
- output.printJson(result);
185
- return { success: true, data: result };
186
- }
187
- output.writeln();
188
- output.writeln(output.bold('Active Agents'));
189
- output.writeln();
190
- if (result.agents.length === 0) {
191
- output.printInfo('No agents found matching criteria');
192
- return { success: true, data: result };
193
- }
194
- // Format for display
195
- const displayAgents = result.agents.map(agent => ({
196
- id: agent.id,
197
- type: agent.agentType,
198
- status: agent.status,
199
- created: new Date(agent.createdAt).toLocaleTimeString(),
200
- lastActivity: agent.lastActivityAt
201
- ? new Date(agent.lastActivityAt).toLocaleTimeString()
202
- : 'N/A',
203
- }));
204
- output.printTable({
205
- columns: [
206
- { key: 'id', header: 'ID', width: 20 },
207
- { key: 'type', header: 'Type', width: 15 },
208
- { key: 'status', header: 'Status', width: 12, format: formatStatus },
209
- { key: 'created', header: 'Created', width: 12 },
210
- { key: 'lastActivity', header: 'Last Activity', width: 12 }
211
- ],
212
- data: displayAgents
213
- });
214
- output.writeln();
215
- output.printInfo(`Total: ${result.total} agents`);
216
- return { success: true, data: result };
217
- }
218
- catch (error) {
219
- if (error instanceof MCPClientError) {
220
- output.printError(`Failed to list agents: ${error.message}`);
221
- }
222
- else {
223
- output.printError(`Unexpected error: ${String(error)}`);
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*/];
224
315
  }
225
- return { success: false, exitCode: 1 };
226
- }
227
- }
316
+ });
317
+ }); }
228
318
  };
229
319
  // Agent status subcommand
230
- const statusCommand = {
320
+ var statusCommand = {
231
321
  name: 'status',
232
322
  description: 'Show detailed status of an agent',
233
323
  options: [
@@ -237,70 +327,83 @@ const statusCommand = {
237
327
  type: 'string'
238
328
  }
239
329
  ],
240
- action: async (ctx) => {
241
- let agentId = ctx.args[0] || ctx.flags.id;
242
- if (!agentId && ctx.interactive) {
243
- agentId = await input({
244
- message: 'Enter agent ID:',
245
- validate: (v) => v.length > 0 || 'Agent ID is required'
246
- });
247
- }
248
- if (!agentId) {
249
- output.printError('Agent ID is required');
250
- return { success: false, exitCode: 1 };
251
- }
252
- try {
253
- // Call MCP tool to get agent status
254
- const status = await callMCPTool('agent_status', {
255
- agentId,
256
- includeMetrics: true,
257
- includeHistory: false,
258
- });
259
- if (ctx.flags.format === 'json') {
260
- output.printJson(status);
261
- return { success: true, data: status };
262
- }
263
- output.writeln();
264
- output.printBox([
265
- `Type: ${status.agentType}`,
266
- `Status: ${formatStatus(status.status)}`,
267
- `Created: ${new Date(status.createdAt).toLocaleString()}`,
268
- `Last Activity: ${status.lastActivityAt ? new Date(status.lastActivityAt).toLocaleString() : 'N/A'}`
269
- ].join('\n'), `Agent: ${status.id}`);
270
- if (status.metrics) {
271
- output.writeln();
272
- output.writeln(output.bold('Metrics'));
273
- const avgExecTime = status.metrics.averageExecutionTime ?? 0;
274
- const uptime = status.metrics.uptime ?? 0;
275
- output.printTable({
276
- columns: [
277
- { key: 'metric', header: 'Metric', width: 25 },
278
- { key: 'value', header: 'Value', width: 15, align: 'right' }
279
- ],
280
- data: [
281
- { metric: 'Tasks Completed', value: status.metrics.tasksCompleted ?? 0 },
282
- { metric: 'Tasks In Progress', value: status.metrics.tasksInProgress ?? 0 },
283
- { metric: 'Tasks Failed', value: status.metrics.tasksFailed ?? 0 },
284
- { metric: 'Avg Execution Time', value: `${avgExecTime.toFixed(2)}ms` },
285
- { metric: 'Uptime', value: `${(uptime / 1000 / 60).toFixed(1)}m` }
286
- ]
287
- });
288
- }
289
- return { success: true, data: status };
290
- }
291
- catch (error) {
292
- if (error instanceof MCPClientError) {
293
- output.printError(`Failed to get agent status: ${error.message}`);
294
- }
295
- else {
296
- output.printError(`Unexpected error: ${String(error)}`);
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*/];
297
401
  }
298
- return { success: false, exitCode: 1 };
299
- }
300
- }
402
+ });
403
+ }); }
301
404
  };
302
405
  // Agent stop subcommand
303
- const stopCommand = {
406
+ var stopCommand = {
304
407
  name: 'stop',
305
408
  aliases: ['kill'],
306
409
  description: 'Stop a running agent',
@@ -310,64 +413,78 @@ const stopCommand = {
310
413
  short: 'f',
311
414
  description: 'Force stop without graceful shutdown',
312
415
  type: 'boolean',
313
- default: false
416
+ "default": false
314
417
  },
315
418
  {
316
419
  name: 'timeout',
317
420
  description: 'Graceful shutdown timeout in seconds',
318
421
  type: 'number',
319
- default: 30
422
+ "default": 30
320
423
  }
321
424
  ],
322
- action: async (ctx) => {
323
- const agentId = ctx.args[0];
324
- if (!agentId) {
325
- output.printError('Agent ID is required');
326
- return { success: false, exitCode: 1 };
327
- }
328
- const force = ctx.flags.force;
329
- if (!force && ctx.interactive) {
330
- const confirmed = await confirm({
331
- message: `Are you sure you want to stop agent ${agentId}?`,
332
- default: false
333
- });
334
- if (!confirmed) {
335
- output.printInfo('Operation cancelled');
336
- return { success: true };
337
- }
338
- }
339
- output.printInfo(`Stopping agent ${agentId}...`);
340
- try {
341
- // Call MCP tool to terminate agent
342
- const result = await callMCPTool('agent_terminate', {
343
- agentId,
344
- graceful: !force,
345
- reason: 'Stopped by user via CLI',
346
- });
347
- if (!force) {
348
- output.writeln(output.dim(' Completing current task...'));
349
- output.writeln(output.dim(' Saving state...'));
350
- output.writeln(output.dim(' Releasing resources...'));
351
- }
352
- output.printSuccess(`Agent ${agentId} stopped successfully`);
353
- if (ctx.flags.format === 'json') {
354
- output.printJson(result);
355
- }
356
- return { success: true, data: result };
357
- }
358
- catch (error) {
359
- if (error instanceof MCPClientError) {
360
- output.printError(`Failed to stop agent: ${error.message}`);
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*/];
361
482
  }
362
- else {
363
- output.printError(`Unexpected error: ${String(error)}`);
364
- }
365
- return { success: false, exitCode: 1 };
366
- }
367
- }
483
+ });
484
+ }); }
368
485
  };
369
486
  // Agent metrics subcommand
370
- const metricsCommand = {
487
+ var metricsCommand = {
371
488
  name: 'metrics',
372
489
  description: 'Show agent performance metrics',
373
490
  options: [
@@ -376,78 +493,150 @@ const metricsCommand = {
376
493
  short: 'p',
377
494
  description: 'Time period (1h, 24h, 7d, 30d)',
378
495
  type: 'string',
379
- default: '24h'
496
+ "default": '24h'
380
497
  }
381
498
  ],
382
- action: async (ctx) => {
383
- const agentId = ctx.args[0];
384
- const period = ctx.flags.period;
385
- // Default metrics (updated by MCP agent/metrics when available)
386
- const metrics = {
387
- period,
388
- summary: {
389
- totalAgents: 4,
390
- activeAgents: 3,
391
- tasksCompleted: 127,
392
- avgSuccessRate: '96.2%',
393
- totalTokens: 1234567,
394
- avgResponseTime: '1.45s'
395
- },
396
- byType: [
397
- { type: 'coder', count: 2, tasks: 45, successRate: '97%' },
398
- { type: 'researcher', count: 1, tasks: 32, successRate: '95%' },
399
- { type: 'tester', count: 1, tasks: 50, successRate: '98%' }
400
- ],
401
- performance: {
402
- flashAttention: '2.8x speedup',
403
- memoryReduction: '52%',
404
- searchImprovement: '150x faster'
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'
590
+ }
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));
626
+ }
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 }];
405
634
  }
406
- };
407
- if (ctx.flags.format === 'json') {
408
- output.printJson(metrics);
409
- return { success: true, data: metrics };
410
- }
411
- output.writeln();
412
- output.writeln(output.bold(`Agent Metrics (${period})`));
413
- output.writeln();
414
- output.printTable({
415
- columns: [
416
- { key: 'metric', header: 'Metric', width: 20 },
417
- { key: 'value', header: 'Value', width: 15, align: 'right' }
418
- ],
419
- data: [
420
- { metric: 'Total Agents', value: metrics.summary.totalAgents },
421
- { metric: 'Active Agents', value: metrics.summary.activeAgents },
422
- { metric: 'Tasks Completed', value: metrics.summary.tasksCompleted },
423
- { metric: 'Success Rate', value: metrics.summary.avgSuccessRate },
424
- { metric: 'Total Tokens', value: metrics.summary.totalTokens.toLocaleString() },
425
- { metric: 'Avg Response Time', value: metrics.summary.avgResponseTime }
426
- ]
427
- });
428
- output.writeln();
429
- output.writeln(output.bold('By Agent Type'));
430
- output.printTable({
431
- columns: [
432
- { key: 'type', header: 'Type', width: 12 },
433
- { key: 'count', header: 'Count', width: 8, align: 'right' },
434
- { key: 'tasks', header: 'Tasks', width: 8, align: 'right' },
435
- { key: 'successRate', header: 'Success', width: 10, align: 'right' }
436
- ],
437
- data: metrics.byType
438
635
  });
439
- output.writeln();
440
- output.writeln(output.bold('V3 Performance Gains'));
441
- output.printList([
442
- `Flash Attention: ${output.success(metrics.performance.flashAttention)}`,
443
- `Memory Reduction: ${output.success(metrics.performance.memoryReduction)}`,
444
- `Search: ${output.success(metrics.performance.searchImprovement)}`
445
- ]);
446
- return { success: true, data: metrics };
447
- }
636
+ }); }
448
637
  };
449
638
  // Agent pool subcommand
450
- const poolCommand = {
639
+ var poolCommand = {
451
640
  name: 'pool',
452
641
  description: 'Manage agent pool for scaling',
453
642
  options: [
@@ -461,75 +650,84 @@ const poolCommand = {
461
650
  name: 'min',
462
651
  description: 'Minimum pool size',
463
652
  type: 'number',
464
- default: 1
653
+ "default": 1
465
654
  },
466
655
  {
467
656
  name: 'max',
468
657
  description: 'Maximum pool size',
469
658
  type: 'number',
470
- default: 10
659
+ "default": 10
471
660
  },
472
661
  {
473
662
  name: 'auto-scale',
474
663
  short: 'a',
475
664
  description: 'Enable auto-scaling',
476
665
  type: 'boolean',
477
- default: true
666
+ "default": true
478
667
  }
479
668
  ],
480
669
  examples: [
481
670
  { command: 'claude-flow agent pool --size 5', description: 'Set pool size' },
482
671
  { command: 'claude-flow agent pool --min 2 --max 15', description: 'Configure auto-scaling' }
483
672
  ],
484
- action: async (ctx) => {
485
- try {
486
- const result = await callMCPTool('agent_pool', {
487
- size: ctx.flags.size,
488
- min: ctx.flags.min,
489
- max: ctx.flags.max,
490
- autoScale: ctx.flags.autoScale ?? true,
491
- });
492
- if (ctx.flags.format === 'json') {
493
- output.printJson(result);
494
- return { success: true, data: result };
495
- }
496
- output.writeln();
497
- const utilization = result.utilization ?? 0;
498
- output.printBox([
499
- `Pool ID: ${result.poolId ?? 'default'}`,
500
- `Current Size: ${result.currentSize ?? 0}`,
501
- `Min/Max: ${result.minSize ?? 0}/${result.maxSize ?? 100}`,
502
- `Auto-Scale: ${result.autoScale ? 'Yes' : 'No'}`,
503
- `Utilization: ${(utilization * 100).toFixed(1)}%`
504
- ].join('\n'), 'Agent Pool');
505
- const agents = result.agents ?? [];
506
- if (agents.length > 0) {
507
- output.writeln();
508
- output.writeln(output.bold('Pool Agents'));
509
- output.printTable({
510
- columns: [
511
- { key: 'id', header: 'ID', width: 20 },
512
- { key: 'type', header: 'Type', width: 15 },
513
- { key: 'status', header: 'Status', width: 12, format: formatStatus }
514
- ],
515
- data: agents
516
- });
517
- }
518
- return { success: true, data: result };
519
- }
520
- catch (error) {
521
- if (error instanceof MCPClientError) {
522
- output.printError(`Pool error: ${error.message}`);
523
- }
524
- else {
525
- output.printError(`Unexpected error: ${String(error)}`);
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*/];
526
725
  }
527
- return { success: false, exitCode: 1 };
528
- }
529
- }
726
+ });
727
+ }); }
530
728
  };
531
729
  // Agent health subcommand
532
- const healthCommand = {
730
+ var healthCommand = {
533
731
  name: 'health',
534
732
  description: 'Show agent health and metrics',
535
733
  options: [
@@ -544,102 +742,114 @@ const healthCommand = {
544
742
  short: 'd',
545
743
  description: 'Show detailed health metrics',
546
744
  type: 'boolean',
547
- default: false
745
+ "default": false
548
746
  },
549
747
  {
550
748
  name: 'watch',
551
749
  short: 'w',
552
750
  description: 'Watch mode (refresh every 5s)',
553
751
  type: 'boolean',
554
- default: false
752
+ "default": false
555
753
  }
556
754
  ],
557
755
  examples: [
558
756
  { command: 'claude-flow agent health', description: 'Show all agents health' },
559
757
  { command: 'claude-flow agent health -i agent-001 -d', description: 'Detailed health for specific agent' }
560
758
  ],
561
- action: async (ctx) => {
562
- const agentId = ctx.args[0] || ctx.flags.id;
563
- const detailed = ctx.flags.detailed;
564
- try {
565
- const result = await callMCPTool('agent_health', {
566
- agentId,
567
- detailed,
568
- });
569
- if (ctx.flags.format === 'json') {
570
- output.printJson(result);
571
- return { success: true, data: result };
572
- }
573
- output.writeln();
574
- output.writeln(output.bold('Agent Health'));
575
- output.writeln();
576
- // Overall summary with null checks
577
- const overall = result.overall ?? { healthy: 0, degraded: 0, unhealthy: 0, avgCpu: 0, avgMemory: 0 };
578
- const avgCpu = overall.avgCpu ?? 0;
579
- const avgMemory = overall.avgMemory ?? 0;
580
- output.printBox([
581
- `Healthy: ${output.success(String(overall.healthy ?? 0))}`,
582
- `Degraded: ${output.warning(String(overall.degraded ?? 0))}`,
583
- `Unhealthy: ${output.error(String(overall.unhealthy ?? 0))}`,
584
- `Avg CPU: ${avgCpu.toFixed(1)}%`,
585
- `Avg Memory: ${(avgMemory * 100).toFixed(1)}%`
586
- ].join(' | '), 'Overall Status');
587
- const healthAgents = result.agents ?? [];
588
- output.writeln();
589
- output.printTable({
590
- columns: [
591
- { key: 'id', header: 'Agent ID', width: 18 },
592
- { key: 'type', header: 'Type', width: 12 },
593
- { key: 'health', header: 'Health', width: 10, format: formatHealthStatus },
594
- { key: 'cpu', header: 'CPU %', width: 8, align: 'right', format: (v) => `${Number(v ?? 0).toFixed(1)}%` },
595
- { key: 'memory', header: 'Memory', width: 10, align: 'right', format: (v) => {
596
- const mem = v;
597
- if (!mem)
598
- return '0%';
599
- return `${(mem.used / mem.limit * 100).toFixed(0)}%`;
600
- } },
601
- { key: 'tasks', header: 'Tasks', width: 12, align: 'right', format: (v) => {
602
- const t = v;
603
- if (!t)
604
- return '0/0';
605
- return `${t.active ?? 0}/${t.completed ?? 0}`;
606
- } }
607
- ],
608
- data: healthAgents
609
- });
610
- if (detailed && healthAgents.length > 0) {
611
- output.writeln();
612
- output.writeln(output.bold('Detailed Metrics'));
613
- for (const agent of healthAgents) {
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
+ }
614
780
  output.writeln();
615
- output.writeln(output.highlight(agent.id));
616
- const uptime = agent.uptime ?? 0;
617
- const latency = agent.latency ?? { avg: 0, p99: 0 };
618
- const tasks = agent.tasks ?? { completed: 0, failed: 0, queued: 0 };
619
- const errors = agent.errors ?? { count: 0 };
620
- output.printList([
621
- `Uptime: ${(uptime / 1000 / 60).toFixed(1)} min`,
622
- `Latency: avg ${(latency.avg ?? 0).toFixed(1)}ms, p99 ${(latency.p99 ?? 0).toFixed(1)}ms`,
623
- `Tasks: ${tasks.completed ?? 0} completed, ${tasks.failed ?? 0} failed, ${tasks.queued ?? 0} queued`,
624
- `Errors: ${errors.count ?? 0}${errors.lastError ? ` (${errors.lastError})` : ''}`
625
- ]);
626
- }
627
- }
628
- return { success: true, data: result };
629
- }
630
- catch (error) {
631
- if (error instanceof MCPClientError) {
632
- output.printError(`Health check error: ${error.message}`);
633
- }
634
- else {
635
- output.printError(`Unexpected error: ${String(error)}`);
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 : [];
794
+ 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*/];
636
847
  }
637
- return { success: false, exitCode: 1 };
638
- }
639
- }
848
+ });
849
+ }); }
640
850
  };
641
851
  // Agent logs subcommand
642
- const logsCommand = {
852
+ var logsCommand = {
643
853
  name: 'logs',
644
854
  description: 'Show agent activity logs',
645
855
  options: [
@@ -654,7 +864,7 @@ const logsCommand = {
654
864
  short: 'n',
655
865
  description: 'Number of recent entries',
656
866
  type: 'number',
657
- default: 50
867
+ "default": 50
658
868
  },
659
869
  {
660
870
  name: 'level',
@@ -662,14 +872,14 @@ const logsCommand = {
662
872
  description: 'Minimum log level',
663
873
  type: 'string',
664
874
  choices: ['debug', 'info', 'warn', 'error'],
665
- default: 'info'
875
+ "default": 'info'
666
876
  },
667
877
  {
668
878
  name: 'follow',
669
879
  short: 'f',
670
880
  description: 'Follow log output',
671
881
  type: 'boolean',
672
- default: false
882
+ "default": false
673
883
  },
674
884
  {
675
885
  name: 'since',
@@ -682,52 +892,63 @@ const logsCommand = {
682
892
  { command: 'claude-flow agent logs -i agent-001 -f', description: 'Follow agent logs' },
683
893
  { command: 'claude-flow agent logs -l error --since 1h', description: 'Show errors from last hour' }
684
894
  ],
685
- action: async (ctx) => {
686
- const agentId = ctx.args[0] || ctx.flags.id;
687
- const tail = ctx.flags.tail;
688
- const level = ctx.flags.level;
689
- if (!agentId) {
690
- output.printError('Agent ID is required. Use --id or -i');
691
- return { success: false, exitCode: 1 };
692
- }
693
- try {
694
- const result = await callMCPTool('agent_logs', {
695
- agentId,
696
- tail,
697
- level,
698
- since: ctx.flags.since,
699
- });
700
- if (ctx.flags.format === 'json') {
701
- output.printJson(result);
702
- return { success: true, data: result };
703
- }
704
- output.writeln();
705
- output.writeln(output.bold(`Logs for ${agentId}`));
706
- output.writeln(output.dim(`Showing ${result.entries.length} of ${result.total} entries`));
707
- output.writeln();
708
- for (const entry of result.entries) {
709
- const time = new Date(entry.timestamp).toLocaleTimeString();
710
- const levelStr = formatLogLevel(entry.level);
711
- output.writeln(`${output.dim(time)} ${levelStr} ${entry.message}`);
712
- if (entry.context && Object.keys(entry.context).length > 0) {
713
- output.writeln(output.dim(` ${JSON.stringify(entry.context)}`));
714
- }
715
- }
716
- return { success: true, data: result };
717
- }
718
- catch (error) {
719
- if (error instanceof MCPClientError) {
720
- output.printError(`Logs error: ${error.message}`);
721
- }
722
- else {
723
- output.printError(`Unexpected error: ${String(error)}`);
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*/];
724
946
  }
725
- return { success: false, exitCode: 1 };
726
- }
727
- }
947
+ });
948
+ }); }
728
949
  };
729
950
  function formatHealthStatus(health) {
730
- const h = String(health);
951
+ var h = String(health);
731
952
  switch (h) {
732
953
  case 'healthy':
733
954
  return output.success(h);
@@ -750,11 +971,11 @@ function formatLogLevel(level) {
750
971
  case 'error':
751
972
  return output.error('[ERROR]');
752
973
  default:
753
- return `[${level.toUpperCase()}]`;
974
+ return "[" + level.toUpperCase() + "]";
754
975
  }
755
976
  }
756
977
  // Main agent command
757
- export const agentCommand = {
978
+ export var agentCommand = {
758
979
  name: 'agent',
759
980
  description: 'Agent management commands',
760
981
  subcommands: [spawnCommand, listCommand, statusCommand, stopCommand, metricsCommand, poolCommand, healthCommand, logsCommand],
@@ -764,29 +985,31 @@ export const agentCommand = {
764
985
  { command: 'claude-flow agent list', description: 'List all agents' },
765
986
  { command: 'claude-flow agent status agent-001', description: 'Show agent status' }
766
987
  ],
767
- action: async (ctx) => {
768
- // Show help if no subcommand
769
- output.writeln();
770
- output.writeln(output.bold('Agent Management Commands'));
771
- output.writeln();
772
- output.writeln('Usage: claude-flow agent <subcommand> [options]');
773
- output.writeln();
774
- output.writeln('Subcommands:');
775
- output.printList([
776
- `${output.highlight('spawn')} - Spawn a new agent`,
777
- `${output.highlight('list')} - List all active agents`,
778
- `${output.highlight('status')} - Show detailed agent status`,
779
- `${output.highlight('stop')} - Stop a running agent`,
780
- `${output.highlight('metrics')} - Show agent metrics`
781
- ]);
782
- output.writeln();
783
- output.writeln('Run "claude-flow agent <subcommand> --help" for subcommand help');
784
- return { success: true };
785
- }
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
+ }); }
786
1009
  };
787
1010
  // Helper functions
788
1011
  function getAgentCapabilities(type) {
789
- const capabilities = {
1012
+ var capabilities = {
790
1013
  coder: ['code-generation', 'refactoring', 'debugging', 'testing'],
791
1014
  researcher: ['web-search', 'data-analysis', 'summarization', 'citation'],
792
1015
  tester: ['unit-testing', 'integration-testing', 'coverage-analysis', 'automation'],
@@ -800,7 +1023,7 @@ function getAgentCapabilities(type) {
800
1023
  return capabilities[type] || ['general'];
801
1024
  }
802
1025
  function formatStatus(status) {
803
- const statusStr = String(status);
1026
+ var statusStr = String(status);
804
1027
  switch (statusStr) {
805
1028
  case 'active':
806
1029
  return output.success(statusStr);