kynjal-cli 3.1.3 → 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 +14 -33
  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
@@ -4,388 +4,603 @@
4
4
  *
5
5
  * Created with ruv.io
6
6
  */
7
+ var __assign = (this && this.__assign) || function () {
8
+ __assign = Object.assign || function(t) {
9
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
10
+ s = arguments[i];
11
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
12
+ t[p] = s[p];
13
+ }
14
+ return t;
15
+ };
16
+ return __assign.apply(this, arguments);
17
+ };
18
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
19
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
20
+ return new (P || (P = Promise))(function (resolve, reject) {
21
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
22
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
23
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
24
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
25
+ });
26
+ };
27
+ var __generator = (this && this.__generator) || function (thisArg, body) {
28
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
29
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
30
+ function verb(n) { return function (v) { return step([n, v]); }; }
31
+ function step(op) {
32
+ if (f) throw new TypeError("Generator is already executing.");
33
+ while (_) try {
34
+ 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;
35
+ if (y = 0, t) op = [op[0] & 2, t.value];
36
+ switch (op[0]) {
37
+ case 0: case 1: t = op; break;
38
+ case 4: _.label++; return { value: op[1], done: false };
39
+ case 5: _.label++; y = op[1]; op = [0]; continue;
40
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
41
+ default:
42
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
43
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
44
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
45
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
46
+ if (t[2]) _.ops.pop();
47
+ _.trys.pop(); continue;
48
+ }
49
+ op = body.call(thisArg, _);
50
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
51
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
52
+ }
53
+ };
7
54
  import { output } from '../output.js';
8
- import { existsSync, readFileSync, readdirSync, statSync } from 'fs';
9
- import { join } from 'path';
55
+ import { existsSync, readFileSync, statSync } from 'fs';
56
+ import { join, dirname } from 'path';
57
+ import { fileURLToPath } from 'url';
10
58
  import { execSync, exec } from 'child_process';
11
59
  import { promisify } from 'util';
12
60
  // Promisified exec with proper shell and env inheritance for cross-platform support
13
- const execAsync = promisify(exec);
61
+ var execAsync = promisify(exec);
14
62
  /**
15
63
  * Execute command asynchronously with proper environment inheritance
16
64
  * Critical for Windows where PATH may not be inherited properly
17
65
  */
18
- async function runCommand(command, timeoutMs = 5000) {
19
- const { stdout } = await execAsync(command, {
20
- encoding: 'utf8',
21
- timeout: timeoutMs,
22
- shell: process.platform === 'win32' ? 'cmd.exe' : '/bin/sh', // Use proper shell per platform
23
- env: { ...process.env }, // Explicitly inherit full environment
24
- windowsHide: true, // Hide window on Windows
66
+ function runCommand(command, timeoutMs) {
67
+ if (timeoutMs === void 0) { timeoutMs = 5000; }
68
+ return __awaiter(this, void 0, Promise, function () {
69
+ var stdout;
70
+ return __generator(this, function (_a) {
71
+ switch (_a.label) {
72
+ case 0: return [4 /*yield*/, execAsync(command, {
73
+ encoding: 'utf8',
74
+ timeout: timeoutMs,
75
+ shell: process.platform === 'win32' ? 'cmd.exe' : '/bin/sh',
76
+ env: __assign({}, process.env),
77
+ windowsHide: true
78
+ })];
79
+ case 1:
80
+ stdout = (_a.sent()).stdout;
81
+ return [2 /*return*/, stdout.trim()];
82
+ }
83
+ });
25
84
  });
26
- return stdout.trim();
27
85
  }
28
86
  // Check Node.js version
29
- async function checkNodeVersion() {
30
- const requiredMajor = 20;
31
- const version = process.version;
32
- const major = parseInt(version.slice(1).split('.')[0], 10);
33
- if (major >= requiredMajor) {
34
- return { name: 'Node.js Version', status: 'pass', message: `${version} (>= ${requiredMajor} required)` };
35
- }
36
- else if (major >= 18) {
37
- return { name: 'Node.js Version', status: 'warn', message: `${version} (>= ${requiredMajor} recommended)`, fix: 'nvm install 20 && nvm use 20' };
38
- }
39
- else {
40
- return { name: 'Node.js Version', status: 'fail', message: `${version} (>= ${requiredMajor} required)`, fix: 'nvm install 20 && nvm use 20' };
41
- }
87
+ function checkNodeVersion() {
88
+ return __awaiter(this, void 0, Promise, function () {
89
+ var requiredMajor, version, major;
90
+ return __generator(this, function (_a) {
91
+ requiredMajor = 20;
92
+ version = process.version;
93
+ major = parseInt(version.slice(1).split('.')[0], 10);
94
+ if (major >= requiredMajor) {
95
+ return [2 /*return*/, { name: 'Node.js Version', status: 'pass', message: version + " (>= " + requiredMajor + " required)" }];
96
+ }
97
+ else if (major >= 18) {
98
+ return [2 /*return*/, { name: 'Node.js Version', status: 'warn', message: version + " (>= " + requiredMajor + " recommended)", fix: 'nvm install 20 && nvm use 20' }];
99
+ }
100
+ else {
101
+ return [2 /*return*/, { name: 'Node.js Version', status: 'fail', message: version + " (>= " + requiredMajor + " required)", fix: 'nvm install 20 && nvm use 20' }];
102
+ }
103
+ return [2 /*return*/];
104
+ });
105
+ });
42
106
  }
43
107
  // Check npm version (async with proper env inheritance)
44
- async function checkNpmVersion() {
45
- try {
46
- const version = await runCommand('npm --version');
47
- const major = parseInt(version.split('.')[0], 10);
48
- if (major >= 9) {
49
- return { name: 'npm Version', status: 'pass', message: `v${version}` };
50
- }
51
- else {
52
- return { name: 'npm Version', status: 'warn', message: `v${version} (>= 9 recommended)`, fix: 'npm install -g npm@latest' };
53
- }
54
- }
55
- catch {
56
- return { name: 'npm Version', status: 'fail', message: 'npm not found', fix: 'Install Node.js from https://nodejs.org' };
57
- }
108
+ function checkNpmVersion() {
109
+ return __awaiter(this, void 0, Promise, function () {
110
+ var version, major, _a;
111
+ return __generator(this, function (_b) {
112
+ switch (_b.label) {
113
+ case 0:
114
+ _b.trys.push([0, 2, , 3]);
115
+ return [4 /*yield*/, runCommand('npm --version')];
116
+ case 1:
117
+ version = _b.sent();
118
+ major = parseInt(version.split('.')[0], 10);
119
+ if (major >= 9) {
120
+ return [2 /*return*/, { name: 'npm Version', status: 'pass', message: "v" + version }];
121
+ }
122
+ else {
123
+ return [2 /*return*/, { name: 'npm Version', status: 'warn', message: "v" + version + " (>= 9 recommended)", fix: 'npm install -g npm@latest' }];
124
+ }
125
+ return [3 /*break*/, 3];
126
+ case 2:
127
+ _a = _b.sent();
128
+ return [2 /*return*/, { name: 'npm Version', status: 'fail', message: 'npm not found', fix: 'Install Node.js from https://nodejs.org' }];
129
+ case 3: return [2 /*return*/];
130
+ }
131
+ });
132
+ });
58
133
  }
59
134
  // Check config file
60
- async function checkConfigFile() {
61
- const configPaths = [
62
- '.claude-flow/config.json',
63
- 'claude-flow.config.json',
64
- '.claude-flow.json'
65
- ];
66
- for (const configPath of configPaths) {
67
- if (existsSync(configPath)) {
68
- try {
69
- const content = readFileSync(configPath, 'utf8');
70
- JSON.parse(content);
71
- return { name: 'Config File', status: 'pass', message: `Found: ${configPath}` };
135
+ function checkConfigFile() {
136
+ return __awaiter(this, void 0, Promise, function () {
137
+ var jsonPaths, _i, jsonPaths_1, configPath, content, yamlPaths, _a, yamlPaths_1, configPath;
138
+ return __generator(this, function (_b) {
139
+ jsonPaths = [
140
+ '.claude-flow/config.json',
141
+ 'claude-flow.config.json',
142
+ '.claude-flow.json'
143
+ ];
144
+ for (_i = 0, jsonPaths_1 = jsonPaths; _i < jsonPaths_1.length; _i++) {
145
+ configPath = jsonPaths_1[_i];
146
+ if (existsSync(configPath)) {
147
+ try {
148
+ content = readFileSync(configPath, 'utf8');
149
+ JSON.parse(content);
150
+ return [2 /*return*/, { name: 'Config File', status: 'pass', message: "Found: " + configPath }];
151
+ }
152
+ catch (e) {
153
+ return [2 /*return*/, { name: 'Config File', status: 'fail', message: "Invalid JSON: " + configPath, fix: 'Fix JSON syntax in config file' }];
154
+ }
155
+ }
72
156
  }
73
- catch (e) {
74
- return { name: 'Config File', status: 'fail', message: `Invalid JSON: ${configPath}`, fix: 'Fix JSON syntax in config file' };
157
+ yamlPaths = [
158
+ '.claude-flow/config.yaml',
159
+ '.claude-flow/config.yml',
160
+ 'claude-flow.config.yaml'
161
+ ];
162
+ for (_a = 0, yamlPaths_1 = yamlPaths; _a < yamlPaths_1.length; _a++) {
163
+ configPath = yamlPaths_1[_a];
164
+ if (existsSync(configPath)) {
165
+ return [2 /*return*/, { name: 'Config File', status: 'pass', message: "Found: " + configPath }];
166
+ }
75
167
  }
76
- }
77
- }
78
- return { name: 'Config File', status: 'warn', message: 'No config file (using defaults)', fix: 'claude-flow config init' };
168
+ return [2 /*return*/, { name: 'Config File', status: 'warn', message: 'No config file (using defaults)', fix: 'claude-flow config init' }];
169
+ });
170
+ });
79
171
  }
80
172
  // Check daemon status
81
- async function checkDaemonStatus() {
82
- try {
83
- const pidFile = '.claude-flow/daemon.pid';
84
- if (existsSync(pidFile)) {
85
- const pid = readFileSync(pidFile, 'utf8').trim();
173
+ function checkDaemonStatus() {
174
+ return __awaiter(this, void 0, Promise, function () {
175
+ var pidFile, pid;
176
+ return __generator(this, function (_a) {
86
177
  try {
87
- process.kill(parseInt(pid, 10), 0); // Check if process exists
88
- return { name: 'Daemon Status', status: 'pass', message: `Running (PID: ${pid})` };
178
+ pidFile = '.claude-flow/daemon.pid';
179
+ if (existsSync(pidFile)) {
180
+ pid = readFileSync(pidFile, 'utf8').trim();
181
+ try {
182
+ process.kill(parseInt(pid, 10), 0); // Check if process exists
183
+ return [2 /*return*/, { name: 'Daemon Status', status: 'pass', message: "Running (PID: " + pid + ")" }];
184
+ }
185
+ catch (_b) {
186
+ return [2 /*return*/, { name: 'Daemon Status', status: 'warn', message: 'Stale PID file', fix: 'rm .claude-flow/daemon.pid && claude-flow daemon start' }];
187
+ }
188
+ }
189
+ return [2 /*return*/, { name: 'Daemon Status', status: 'warn', message: 'Not running', fix: 'claude-flow daemon start' }];
89
190
  }
90
- catch {
91
- return { name: 'Daemon Status', status: 'warn', message: 'Stale PID file', fix: 'rm .claude-flow/daemon.pid && claude-flow daemon start' };
191
+ catch (_c) {
192
+ return [2 /*return*/, { name: 'Daemon Status', status: 'warn', message: 'Unable to check', fix: 'claude-flow daemon status' }];
92
193
  }
93
- }
94
- return { name: 'Daemon Status', status: 'warn', message: 'Not running', fix: 'claude-flow daemon start' };
95
- }
96
- catch {
97
- return { name: 'Daemon Status', status: 'warn', message: 'Unable to check', fix: 'claude-flow daemon status' };
98
- }
194
+ return [2 /*return*/];
195
+ });
196
+ });
99
197
  }
100
198
  // Check memory database
101
- async function checkMemoryDatabase() {
102
- const dbPaths = [
103
- '.claude-flow/memory.db',
104
- '.swarm/memory.db',
105
- 'data/memory.db'
106
- ];
107
- for (const dbPath of dbPaths) {
108
- if (existsSync(dbPath)) {
109
- try {
110
- const stats = statSync(dbPath);
111
- const sizeMB = (stats.size / 1024 / 1024).toFixed(2);
112
- return { name: 'Memory Database', status: 'pass', message: `${dbPath} (${sizeMB} MB)` };
113
- }
114
- catch {
115
- return { name: 'Memory Database', status: 'warn', message: `${dbPath} (unable to stat)` };
199
+ function checkMemoryDatabase() {
200
+ return __awaiter(this, void 0, Promise, function () {
201
+ var dbPaths, _i, dbPaths_1, dbPath, stats, sizeMB;
202
+ return __generator(this, function (_a) {
203
+ dbPaths = [
204
+ '.claude-flow/memory.db',
205
+ '.swarm/memory.db',
206
+ 'data/memory.db'
207
+ ];
208
+ for (_i = 0, dbPaths_1 = dbPaths; _i < dbPaths_1.length; _i++) {
209
+ dbPath = dbPaths_1[_i];
210
+ if (existsSync(dbPath)) {
211
+ try {
212
+ stats = statSync(dbPath);
213
+ sizeMB = (stats.size / 1024 / 1024).toFixed(2);
214
+ return [2 /*return*/, { name: 'Memory Database', status: 'pass', message: dbPath + " (" + sizeMB + " MB)" }];
215
+ }
216
+ catch (_b) {
217
+ return [2 /*return*/, { name: 'Memory Database', status: 'warn', message: dbPath + " (unable to stat)" }];
218
+ }
219
+ }
116
220
  }
117
- }
118
- }
119
- return { name: 'Memory Database', status: 'warn', message: 'Not initialized', fix: 'claude-flow memory configure --backend hybrid' };
221
+ return [2 /*return*/, { name: 'Memory Database', status: 'warn', message: 'Not initialized', fix: 'claude-flow memory configure --backend hybrid' }];
222
+ });
223
+ });
120
224
  }
121
225
  // Check API keys
122
- async function checkApiKeys() {
123
- const keys = ['ANTHROPIC_API_KEY', 'CLAUDE_API_KEY', 'OPENAI_API_KEY'];
124
- const found = [];
125
- for (const key of keys) {
126
- if (process.env[key]) {
127
- found.push(key);
128
- }
129
- }
130
- if (found.includes('ANTHROPIC_API_KEY') || found.includes('CLAUDE_API_KEY')) {
131
- return { name: 'API Keys', status: 'pass', message: `Found: ${found.join(', ')}` };
132
- }
133
- else if (found.length > 0) {
134
- return { name: 'API Keys', status: 'warn', message: `Found: ${found.join(', ')} (no Claude key)`, fix: 'export ANTHROPIC_API_KEY=your_key' };
135
- }
136
- else {
137
- return { name: 'API Keys', status: 'warn', message: 'No API keys found', fix: 'export ANTHROPIC_API_KEY=your_key' };
138
- }
226
+ function checkApiKeys() {
227
+ return __awaiter(this, void 0, Promise, function () {
228
+ var keys, found, _i, keys_1, key, inClaudeCode;
229
+ return __generator(this, function (_a) {
230
+ keys = ['ANTHROPIC_API_KEY', 'CLAUDE_API_KEY', 'OPENAI_API_KEY'];
231
+ found = [];
232
+ for (_i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
233
+ key = keys_1[_i];
234
+ if (process.env[key]) {
235
+ found.push(key);
236
+ }
237
+ }
238
+ inClaudeCode = !!(process.env.CLAUDE_CODE || process.env.CLAUDE_PROJECT_DIR || process.env.MCP_SESSION_ID);
239
+ if (found.includes('ANTHROPIC_API_KEY') || found.includes('CLAUDE_API_KEY')) {
240
+ return [2 /*return*/, { name: 'API Keys', status: 'pass', message: "Found: " + found.join(', ') }];
241
+ }
242
+ else if (inClaudeCode) {
243
+ return [2 /*return*/, { name: 'API Keys', status: 'pass', message: 'Claude Code (managed internally)' }];
244
+ }
245
+ else if (found.length > 0) {
246
+ return [2 /*return*/, { name: 'API Keys', status: 'warn', message: "Found: " + found.join(', ') + " (no Claude key)", fix: 'export ANTHROPIC_API_KEY=your_key' }];
247
+ }
248
+ else {
249
+ return [2 /*return*/, { name: 'API Keys', status: 'warn', message: 'No API keys found', fix: 'export ANTHROPIC_API_KEY=your_key' }];
250
+ }
251
+ return [2 /*return*/];
252
+ });
253
+ });
139
254
  }
140
255
  // Check git (async with proper env inheritance)
141
- async function checkGit() {
142
- try {
143
- const version = await runCommand('git --version');
144
- return { name: 'Git', status: 'pass', message: version.replace('git version ', 'v') };
145
- }
146
- catch {
147
- return { name: 'Git', status: 'warn', message: 'Not installed', fix: 'Install git from https://git-scm.com' };
148
- }
256
+ function checkGit() {
257
+ return __awaiter(this, void 0, Promise, function () {
258
+ var version, _a;
259
+ return __generator(this, function (_b) {
260
+ switch (_b.label) {
261
+ case 0:
262
+ _b.trys.push([0, 2, , 3]);
263
+ return [4 /*yield*/, runCommand('git --version')];
264
+ case 1:
265
+ version = _b.sent();
266
+ return [2 /*return*/, { name: 'Git', status: 'pass', message: version.replace('git version ', 'v') }];
267
+ case 2:
268
+ _a = _b.sent();
269
+ return [2 /*return*/, { name: 'Git', status: 'warn', message: 'Not installed', fix: 'Install git from https://git-scm.com' }];
270
+ case 3: return [2 /*return*/];
271
+ }
272
+ });
273
+ });
149
274
  }
150
275
  // Check if in git repo (async with proper env inheritance)
151
- async function checkGitRepo() {
152
- try {
153
- await runCommand('git rev-parse --git-dir');
154
- return { name: 'Git Repository', status: 'pass', message: 'In a git repository' };
155
- }
156
- catch {
157
- return { name: 'Git Repository', status: 'warn', message: 'Not a git repository', fix: 'git init' };
158
- }
276
+ function checkGitRepo() {
277
+ return __awaiter(this, void 0, Promise, function () {
278
+ var _a;
279
+ return __generator(this, function (_b) {
280
+ switch (_b.label) {
281
+ case 0:
282
+ _b.trys.push([0, 2, , 3]);
283
+ return [4 /*yield*/, runCommand('git rev-parse --git-dir')];
284
+ case 1:
285
+ _b.sent();
286
+ return [2 /*return*/, { name: 'Git Repository', status: 'pass', message: 'In a git repository' }];
287
+ case 2:
288
+ _a = _b.sent();
289
+ return [2 /*return*/, { name: 'Git Repository', status: 'warn', message: 'Not a git repository', fix: 'git init' }];
290
+ case 3: return [2 /*return*/];
291
+ }
292
+ });
293
+ });
159
294
  }
160
295
  // Check MCP servers
161
- async function checkMcpServers() {
162
- const mcpConfigPaths = [
163
- join(process.env.HOME || '', '.claude/claude_desktop_config.json'),
164
- join(process.env.HOME || '', '.config/claude/mcp.json'),
165
- '.mcp.json'
166
- ];
167
- for (const configPath of mcpConfigPaths) {
168
- if (existsSync(configPath)) {
169
- try {
170
- const content = JSON.parse(readFileSync(configPath, 'utf8'));
171
- const servers = content.mcpServers || content.servers || {};
172
- const count = Object.keys(servers).length;
173
- const hasClaudeFlow = 'kynjalflow' in servers || 'claude-flow_alpha' in servers;
174
- if (hasClaudeFlow) {
175
- return { name: 'MCP Servers', status: 'pass', message: `${count} servers (claude-flow configured)` };
176
- }
177
- else {
178
- return { name: 'MCP Servers', status: 'warn', message: `${count} servers (claude-flow not found)`, fix: 'claude mcp add claude-flow npx @kynjal/cli@v3alpha mcp start' };
296
+ function checkMcpServers() {
297
+ return __awaiter(this, void 0, Promise, function () {
298
+ var mcpConfigPaths, _i, mcpConfigPaths_1, configPath, content, servers, count, hasClaudeFlow;
299
+ return __generator(this, function (_a) {
300
+ mcpConfigPaths = [
301
+ join(process.env.HOME || '', '.claude/claude_desktop_config.json'),
302
+ join(process.env.HOME || '', '.config/claude/mcp.json'),
303
+ '.mcp.json'
304
+ ];
305
+ for (_i = 0, mcpConfigPaths_1 = mcpConfigPaths; _i < mcpConfigPaths_1.length; _i++) {
306
+ configPath = mcpConfigPaths_1[_i];
307
+ if (existsSync(configPath)) {
308
+ try {
309
+ content = JSON.parse(readFileSync(configPath, 'utf8'));
310
+ servers = content.mcpServers || content.servers || {};
311
+ count = Object.keys(servers).length;
312
+ hasClaudeFlow = 'claude-flow' in servers || 'claude-flow_alpha' in servers || 'ruflo' in servers || 'ruflo_alpha' in servers;
313
+ if (hasClaudeFlow) {
314
+ return [2 /*return*/, { name: 'MCP Servers', status: 'pass', message: count + " servers (ruflo configured)" }];
315
+ }
316
+ else {
317
+ return [2 /*return*/, { name: 'MCP Servers', status: 'warn', message: count + " servers (ruflo not found)", fix: 'claude mcp add ruflo -- npx -y ruflo@latest mcp start' }];
318
+ }
319
+ }
320
+ catch (_b) {
321
+ // continue to next path
322
+ }
179
323
  }
180
324
  }
181
- catch {
182
- // continue to next path
183
- }
184
- }
185
- }
186
- return { name: 'MCP Servers', status: 'warn', message: 'No MCP config found', fix: 'claude mcp add claude-flow npx @kynjal/cli@v3alpha mcp start' };
325
+ return [2 /*return*/, { name: 'MCP Servers', status: 'warn', message: 'No MCP config found', fix: 'claude mcp add claude-flow npx @claude-flow/cli@v3alpha mcp start' }];
326
+ });
327
+ });
187
328
  }
188
329
  // Check disk space (async with proper env inheritance)
189
- async function checkDiskSpace() {
190
- try {
191
- if (process.platform === 'win32') {
192
- return { name: 'Disk Space', status: 'pass', message: 'Check skipped on Windows' };
193
- }
194
- const output_str = await runCommand('df -h . | tail -1');
195
- const parts = output_str.split(/\s+/);
196
- const available = parts[3];
197
- const usePercent = parseInt(parts[4]?.replace('%', '') || '0', 10);
198
- if (usePercent > 90) {
199
- return { name: 'Disk Space', status: 'fail', message: `${available} available (${usePercent}% used)`, fix: 'Free up disk space' };
200
- }
201
- else if (usePercent > 80) {
202
- return { name: 'Disk Space', status: 'warn', message: `${available} available (${usePercent}% used)` };
203
- }
204
- return { name: 'Disk Space', status: 'pass', message: `${available} available` };
205
- }
206
- catch {
207
- return { name: 'Disk Space', status: 'warn', message: 'Unable to check' };
208
- }
330
+ function checkDiskSpace() {
331
+ var _a;
332
+ return __awaiter(this, void 0, Promise, function () {
333
+ var output_str, parts, available, usePercent, _b;
334
+ return __generator(this, function (_c) {
335
+ switch (_c.label) {
336
+ case 0:
337
+ _c.trys.push([0, 2, , 3]);
338
+ if (process.platform === 'win32') {
339
+ return [2 /*return*/, { name: 'Disk Space', status: 'pass', message: 'Check skipped on Windows' }];
340
+ }
341
+ return [4 /*yield*/, runCommand('df -Ph . | tail -1')];
342
+ case 1:
343
+ output_str = _c.sent();
344
+ parts = output_str.split(/\s+/);
345
+ available = parts[3];
346
+ usePercent = parseInt(((_a = parts[4]) === null || _a === void 0 ? void 0 : _a.replace('%', '')) || '0', 10);
347
+ if (isNaN(usePercent)) {
348
+ return [2 /*return*/, { name: 'Disk Space', status: 'warn', message: (available || 'unknown') + " available (unable to parse usage)" }];
349
+ }
350
+ if (usePercent > 90) {
351
+ return [2 /*return*/, { name: 'Disk Space', status: 'fail', message: available + " available (" + usePercent + "% used)", fix: 'Free up disk space' }];
352
+ }
353
+ else if (usePercent > 80) {
354
+ return [2 /*return*/, { name: 'Disk Space', status: 'warn', message: available + " available (" + usePercent + "% used)" }];
355
+ }
356
+ return [2 /*return*/, { name: 'Disk Space', status: 'pass', message: available + " available" }];
357
+ case 2:
358
+ _b = _c.sent();
359
+ return [2 /*return*/, { name: 'Disk Space', status: 'warn', message: 'Unable to check' }];
360
+ case 3: return [2 /*return*/];
361
+ }
362
+ });
363
+ });
209
364
  }
210
365
  // Check TypeScript/build (async with proper env inheritance)
211
- async function checkBuildTools() {
212
- try {
213
- const tscVersion = await runCommand('npx tsc --version', 10000); // tsc can be slow
214
- if (!tscVersion || tscVersion.includes('not found')) {
215
- return { name: 'TypeScript', status: 'warn', message: 'Not installed locally', fix: 'npm install -D typescript' };
216
- }
217
- return { name: 'TypeScript', status: 'pass', message: tscVersion.replace('Version ', 'v') };
218
- }
219
- catch {
220
- return { name: 'TypeScript', status: 'warn', message: 'Not installed locally', fix: 'npm install -D typescript' };
221
- }
366
+ function checkBuildTools() {
367
+ return __awaiter(this, void 0, Promise, function () {
368
+ var tscVersion, _a;
369
+ return __generator(this, function (_b) {
370
+ switch (_b.label) {
371
+ case 0:
372
+ _b.trys.push([0, 2, , 3]);
373
+ return [4 /*yield*/, runCommand('npx tsc --version', 10000)];
374
+ case 1:
375
+ tscVersion = _b.sent();
376
+ if (!tscVersion || tscVersion.includes('not found')) {
377
+ return [2 /*return*/, { name: 'TypeScript', status: 'warn', message: 'Not installed locally', fix: 'npm install -D typescript' }];
378
+ }
379
+ return [2 /*return*/, { name: 'TypeScript', status: 'pass', message: tscVersion.replace('Version ', 'v') }];
380
+ case 2:
381
+ _a = _b.sent();
382
+ return [2 /*return*/, { name: 'TypeScript', status: 'warn', message: 'Not installed locally', fix: 'npm install -D typescript' }];
383
+ case 3: return [2 /*return*/];
384
+ }
385
+ });
386
+ });
222
387
  }
223
388
  // Check for stale npx cache (version freshness)
224
- async function checkVersionFreshness() {
225
- try {
226
- // Get current CLI version from package.json
227
- let currentVersion = '0.0.0';
228
- try {
229
- // Get directory of current module and walk up to find package.json
230
- const moduleUrl = new URL(import.meta.url);
231
- const modulePath = moduleUrl.protocol === 'file:' ? moduleUrl.pathname : import.meta.url;
232
- const moduleDir = modulePath.substring(0, modulePath.lastIndexOf('/'));
233
- // Look for package.json in multiple locations
234
- const possiblePaths = [
235
- join(moduleDir, '..', 'package.json'), // ../package.json from dist/commands
236
- join(moduleDir, '..', '..', 'package.json'), // ../../package.json from dist/commands
237
- join(process.cwd(), 'package.json'), // Current working directory
238
- join(process.cwd(), 'node_modules/@claude-flow/cli/package.json')
239
- ];
240
- // Also search in npx cache directories (Linux/macOS)
241
- const homeDir = process.env.HOME || process.env.USERPROFILE || '';
242
- if (homeDir) {
243
- // Check common npx cache locations
244
- try {
245
- const npxCacheDir = join(homeDir, '.npm', '_npx');
246
- if (existsSync(npxCacheDir)) {
247
- const cacheEntries = readdirSync(npxCacheDir);
248
- for (const entry of cacheEntries) {
249
- const npxPkgPath = join(npxCacheDir, entry, 'node_modules', '@claude-flow', 'cli', 'package.json');
250
- if (existsSync(npxPkgPath)) {
251
- possiblePaths.push(npxPkgPath);
389
+ function checkVersionFreshness() {
390
+ var _a, _b;
391
+ return __awaiter(this, void 0, Promise, function () {
392
+ var currentVersion, thisFile, dir, candidate, pkg, parent, isNpx, latestVersion, npmInfo, _c, parseVersion, current, latest, isOutdated, fix, error_1;
393
+ return __generator(this, function (_d) {
394
+ switch (_d.label) {
395
+ case 0:
396
+ _d.trys.push([0, 5, , 6]);
397
+ currentVersion = '0.0.0';
398
+ try {
399
+ thisFile = fileURLToPath(import.meta.url);
400
+ dir = dirname(thisFile);
401
+ // Walk up from the current file's directory until we find the
402
+ // package.json that belongs to @claude-flow/cli (or claude-flow/cli).
403
+ // Walk until dirname(dir) === dir (filesystem root on any platform).
404
+ for (;;) {
405
+ candidate = join(dir, 'package.json');
406
+ try {
407
+ if (existsSync(candidate)) {
408
+ pkg = JSON.parse(readFileSync(candidate, 'utf8'));
409
+ if (pkg.version &&
410
+ typeof pkg.name === 'string' &&
411
+ (pkg.name === '@claude-flow/cli' || pkg.name === 'claude-flow' || pkg.name === 'ruflo')) {
412
+ currentVersion = pkg.version;
413
+ break;
414
+ }
415
+ }
252
416
  }
417
+ catch (_e) {
418
+ // Unreadable/invalid JSON -- skip and keep walking up
419
+ }
420
+ parent = dirname(dir);
421
+ if (parent === dir)
422
+ break; // reached root
423
+ dir = parent;
253
424
  }
254
425
  }
255
- }
256
- catch {
257
- // Ignore errors scanning npx cache
258
- }
259
- }
260
- for (const pkgPath of possiblePaths) {
261
- try {
262
- if (existsSync(pkgPath)) {
263
- const packageJson = JSON.parse(readFileSync(pkgPath, 'utf8'));
264
- // Make sure it's the right package
265
- if (packageJson.name === '@claude-flow/cli' && packageJson.version) {
266
- currentVersion = packageJson.version;
267
- break;
268
- }
426
+ catch (_f) {
427
+ // Fall back to a default
428
+ currentVersion = '0.0.0';
269
429
  }
270
- }
271
- catch {
272
- continue;
273
- }
430
+ isNpx = ((_a = process.argv[1]) === null || _a === void 0 ? void 0 : _a.includes('_npx')) ||
431
+ ((_b = process.env.npm_execpath) === null || _b === void 0 ? void 0 : _b.includes('npx')) ||
432
+ process.cwd().includes('_npx');
433
+ latestVersion = currentVersion;
434
+ _d.label = 1;
435
+ case 1:
436
+ _d.trys.push([1, 3, , 4]);
437
+ return [4 /*yield*/, runCommand('npm view @claude-flow/cli@alpha version', 5000)];
438
+ case 2:
439
+ npmInfo = _d.sent();
440
+ latestVersion = npmInfo.trim();
441
+ return [3 /*break*/, 4];
442
+ case 3:
443
+ _c = _d.sent();
444
+ // Can't reach npm registry - skip check
445
+ return [2 /*return*/, {
446
+ name: 'Version Freshness',
447
+ status: 'warn',
448
+ message: "v" + currentVersion + " (cannot check registry)"
449
+ }];
450
+ case 4:
451
+ parseVersion = function (v) {
452
+ var match = v.match(/^(\d+)\.(\d+)\.(\d+)(?:-[a-zA-Z]+\.(\d+))?/);
453
+ if (!match)
454
+ return { major: 0, minor: 0, patch: 0, prerelease: 0 };
455
+ return {
456
+ major: parseInt(match[1], 10) || 0,
457
+ minor: parseInt(match[2], 10) || 0,
458
+ patch: parseInt(match[3], 10) || 0,
459
+ prerelease: parseInt(match[4], 10) || 0
460
+ };
461
+ };
462
+ current = parseVersion(currentVersion);
463
+ latest = parseVersion(latestVersion);
464
+ isOutdated = (latest.major > current.major ||
465
+ (latest.major === current.major && latest.minor > current.minor) ||
466
+ (latest.major === current.major && latest.minor === current.minor && latest.patch > current.patch) ||
467
+ (latest.major === current.major && latest.minor === current.minor && latest.patch === current.patch && latest.prerelease > current.prerelease));
468
+ if (isOutdated) {
469
+ fix = isNpx
470
+ ? 'rm -rf ~/.npm/_npx/* && npx -y @claude-flow/cli@latest'
471
+ : 'npm update @claude-flow/cli';
472
+ return [2 /*return*/, {
473
+ name: 'Version Freshness',
474
+ status: 'warn',
475
+ message: "v" + currentVersion + " (latest: v" + latestVersion + ")" + (isNpx ? ' [npx cache stale]' : ''),
476
+ fix: fix
477
+ }];
478
+ }
479
+ return [2 /*return*/, {
480
+ name: 'Version Freshness',
481
+ status: 'pass',
482
+ message: "v" + currentVersion + " (up to date)"
483
+ }];
484
+ case 5:
485
+ error_1 = _d.sent();
486
+ return [2 /*return*/, {
487
+ name: 'Version Freshness',
488
+ status: 'warn',
489
+ message: 'Unable to check version freshness'
490
+ }];
491
+ case 6: return [2 /*return*/];
274
492
  }
275
- }
276
- catch {
277
- // Fall back to a default
278
- currentVersion = '0.0.0';
279
- }
280
- // Check if running via npx (look for _npx in process path or argv)
281
- const isNpx = process.argv[1]?.includes('_npx') ||
282
- process.env.npm_execpath?.includes('npx') ||
283
- process.cwd().includes('_npx');
284
- // Query npm for latest version (using alpha tag since that's what we publish to)
285
- let latestVersion = currentVersion;
286
- try {
287
- const npmInfo = await runCommand('npm view @claude-flow/cli@alpha version 2>/dev/null', 5000);
288
- latestVersion = npmInfo.trim();
289
- }
290
- catch {
291
- // Can't reach npm registry - skip check
292
- return {
293
- name: 'Version Freshness',
294
- status: 'warn',
295
- message: `v${currentVersion} (cannot check registry)`
296
- };
297
- }
298
- // Parse version numbers for comparison (handle prerelease like 3.0.0-alpha.84)
299
- const parseVersion = (v) => {
300
- const match = v.match(/^(\d+)\.(\d+)\.(\d+)(?:-[a-zA-Z]+\.(\d+))?/);
301
- if (!match)
302
- return { major: 0, minor: 0, patch: 0, prerelease: 0 };
303
- return {
304
- major: parseInt(match[1], 10) || 0,
305
- minor: parseInt(match[2], 10) || 0,
306
- patch: parseInt(match[3], 10) || 0,
307
- prerelease: parseInt(match[4], 10) || 0
308
- };
309
- };
310
- const current = parseVersion(currentVersion);
311
- const latest = parseVersion(latestVersion);
312
- // Compare versions (including prerelease number)
313
- const isOutdated = (latest.major > current.major ||
314
- (latest.major === current.major && latest.minor > current.minor) ||
315
- (latest.major === current.major && latest.minor === current.minor && latest.patch > current.patch) ||
316
- (latest.major === current.major && latest.minor === current.minor && latest.patch === current.patch && latest.prerelease > current.prerelease));
317
- if (isOutdated) {
318
- const fix = isNpx
319
- ? 'rm -rf ~/.npm/_npx/* && npx -y @claude-flow/cli@latest'
320
- : 'npm update @claude-flow/cli';
321
- return {
322
- name: 'Version Freshness',
323
- status: 'warn',
324
- message: `v${currentVersion} (latest: v${latestVersion})${isNpx ? ' [npx cache stale]' : ''}`,
325
- fix
326
- };
327
- }
328
- return {
329
- name: 'Version Freshness',
330
- status: 'pass',
331
- message: `v${currentVersion} (up to date)`
332
- };
333
- }
334
- catch (error) {
335
- return {
336
- name: 'Version Freshness',
337
- status: 'warn',
338
- message: 'Unable to check version freshness'
339
- };
340
- }
493
+ });
494
+ });
341
495
  }
342
496
  // Check Claude Code CLI (async with proper env inheritance)
343
- async function checkClaudeCode() {
344
- try {
345
- const version = await runCommand('claude --version');
346
- // Parse version from output like "claude 1.0.0" or "Claude Code v1.0.0"
347
- const versionMatch = version.match(/v?(\d+\.\d+\.\d+)/);
348
- const versionStr = versionMatch ? `v${versionMatch[1]}` : version;
349
- return { name: 'Claude Code CLI', status: 'pass', message: versionStr };
350
- }
351
- catch {
352
- return {
353
- name: 'Claude Code CLI',
354
- status: 'warn',
355
- message: 'Not installed',
356
- fix: 'npm install -g @anthropic-ai/claude-code'
357
- };
358
- }
497
+ function checkClaudeCode() {
498
+ return __awaiter(this, void 0, Promise, function () {
499
+ var version, versionMatch, versionStr, _a;
500
+ return __generator(this, function (_b) {
501
+ switch (_b.label) {
502
+ case 0:
503
+ _b.trys.push([0, 2, , 3]);
504
+ return [4 /*yield*/, runCommand('claude --version')];
505
+ case 1:
506
+ version = _b.sent();
507
+ versionMatch = version.match(/v?(\d+\.\d+\.\d+)/);
508
+ versionStr = versionMatch ? "v" + versionMatch[1] : version;
509
+ return [2 /*return*/, { name: 'Claude Code CLI', status: 'pass', message: versionStr }];
510
+ case 2:
511
+ _a = _b.sent();
512
+ return [2 /*return*/, {
513
+ name: 'Claude Code CLI',
514
+ status: 'warn',
515
+ message: 'Not installed',
516
+ fix: 'npm install -g @anthropic-ai/claude-code'
517
+ }];
518
+ case 3: return [2 /*return*/];
519
+ }
520
+ });
521
+ });
359
522
  }
360
523
  // Install Claude Code CLI
361
- async function installClaudeCode() {
362
- try {
363
- output.writeln();
364
- output.writeln(output.bold('Installing Claude Code CLI...'));
365
- execSync('npm install -g @anthropic-ai/claude-code', {
366
- encoding: 'utf8',
367
- stdio: 'inherit'
524
+ function installClaudeCode() {
525
+ return __awaiter(this, void 0, Promise, function () {
526
+ return __generator(this, function (_a) {
527
+ try {
528
+ output.writeln();
529
+ output.writeln(output.bold('Installing Claude Code CLI...'));
530
+ execSync('npm install -g @anthropic-ai/claude-code', {
531
+ encoding: 'utf8',
532
+ stdio: 'inherit'
533
+ });
534
+ output.writeln(output.success('Claude Code CLI installed successfully!'));
535
+ return [2 /*return*/, true];
536
+ }
537
+ catch (error) {
538
+ output.writeln(output.error('Failed to install Claude Code CLI'));
539
+ if (error instanceof Error) {
540
+ output.writeln(output.dim(error.message));
541
+ }
542
+ return [2 /*return*/, false];
543
+ }
544
+ return [2 /*return*/];
368
545
  });
369
- output.writeln(output.success('Claude Code CLI installed successfully!'));
370
- return true;
371
- }
372
- catch (error) {
373
- output.writeln(output.error('Failed to install Claude Code CLI'));
374
- if (error instanceof Error) {
375
- output.writeln(output.dim(error.message));
376
- }
377
- return false;
378
- }
546
+ });
547
+ }
548
+ // Check agentic-flow v3 integration (filesystem-based to avoid slow WASM/DB init)
549
+ function checkAgenticFlow() {
550
+ return __awaiter(this, void 0, Promise, function () {
551
+ var candidates, pkgJsonPath, _i, candidates_1, p, pkg, version, exports, features;
552
+ return __generator(this, function (_a) {
553
+ try {
554
+ candidates = [
555
+ join(process.cwd(), 'node_modules', 'agentic-flow', 'package.json'),
556
+ join(process.cwd(), '..', 'node_modules', 'agentic-flow', 'package.json'),
557
+ ];
558
+ pkgJsonPath = null;
559
+ for (_i = 0, candidates_1 = candidates; _i < candidates_1.length; _i++) {
560
+ p = candidates_1[_i];
561
+ if (existsSync(p)) {
562
+ pkgJsonPath = p;
563
+ break;
564
+ }
565
+ }
566
+ if (!pkgJsonPath) {
567
+ return [2 /*return*/, {
568
+ name: 'agentic-flow',
569
+ status: 'warn',
570
+ message: 'Not installed (optional — embeddings/routing will use fallbacks)',
571
+ fix: 'npm install agentic-flow@latest'
572
+ }];
573
+ }
574
+ pkg = JSON.parse(readFileSync(pkgJsonPath, 'utf-8'));
575
+ version = pkg.version || 'unknown';
576
+ exports = pkg.exports || {};
577
+ features = [
578
+ exports['./reasoningbank'] ? 'ReasoningBank' : null,
579
+ exports['./router'] ? 'Router' : null,
580
+ exports['./transport/quic'] ? 'QUIC' : null,
581
+ ].filter(Boolean);
582
+ return [2 /*return*/, {
583
+ name: 'agentic-flow',
584
+ status: 'pass',
585
+ message: "v" + version + " (" + features.join(', ') + ")"
586
+ }];
587
+ }
588
+ catch (_b) {
589
+ return [2 /*return*/, { name: 'agentic-flow', status: 'warn', message: 'Check failed' }];
590
+ }
591
+ return [2 /*return*/];
592
+ });
593
+ });
379
594
  }
380
595
  // Format health check result
381
596
  function formatCheck(check) {
382
- const icon = check.status === 'pass' ? output.success('✓') :
597
+ var icon = check.status === 'pass' ? output.success('✓') :
383
598
  check.status === 'warn' ? output.warning('⚠') :
384
599
  output.error('✗');
385
- return `${icon} ${check.name}: ${check.message}`;
600
+ return icon + " " + check.name + ": " + check.message;
386
601
  }
387
602
  // Main doctor command
388
- export const doctorCommand = {
603
+ export var doctorCommand = {
389
604
  name: 'doctor',
390
605
  description: 'System diagnostics and health checks',
391
606
  options: [
@@ -394,14 +609,14 @@ export const doctorCommand = {
394
609
  short: 'f',
395
610
  description: 'Show fix commands for issues',
396
611
  type: 'boolean',
397
- default: false
612
+ "default": false
398
613
  },
399
614
  {
400
615
  name: 'install',
401
616
  short: 'i',
402
617
  description: 'Auto-install missing dependencies (Claude Code CLI)',
403
618
  type: 'boolean',
404
- default: false
619
+ "default": false
405
620
  },
406
621
  {
407
622
  name: 'component',
@@ -414,7 +629,7 @@ export const doctorCommand = {
414
629
  short: 'v',
415
630
  description: 'Verbose output',
416
631
  type: 'boolean',
417
- default: false
632
+ "default": false
418
633
  }
419
634
  ],
420
635
  examples: [
@@ -424,148 +639,163 @@ export const doctorCommand = {
424
639
  { command: 'claude-flow doctor -c version', description: 'Check for stale npx cache' },
425
640
  { command: 'claude-flow doctor -c claude', description: 'Check Claude Code CLI only' }
426
641
  ],
427
- action: async (ctx) => {
428
- const showFix = ctx.flags.fix;
429
- const autoInstall = ctx.flags.install;
430
- const component = ctx.flags.component;
431
- const verbose = ctx.flags.verbose;
432
- output.writeln();
433
- output.writeln(output.bold('KynjalFlow Doctor'));
434
- output.writeln(output.dim('System diagnostics and health check'));
435
- output.writeln(output.dim('─'.repeat(50)));
436
- output.writeln();
437
- const allChecks = [
438
- checkVersionFreshness,
439
- checkNodeVersion,
440
- checkNpmVersion,
441
- checkClaudeCode,
442
- checkGit,
443
- checkGitRepo,
444
- checkConfigFile,
445
- checkDaemonStatus,
446
- checkMemoryDatabase,
447
- checkApiKeys,
448
- checkMcpServers,
449
- checkDiskSpace,
450
- checkBuildTools
451
- ];
452
- const componentMap = {
453
- 'version': checkVersionFreshness,
454
- 'freshness': checkVersionFreshness,
455
- 'node': checkNodeVersion,
456
- 'npm': checkNpmVersion,
457
- 'claude': checkClaudeCode,
458
- 'config': checkConfigFile,
459
- 'daemon': checkDaemonStatus,
460
- 'memory': checkMemoryDatabase,
461
- 'api': checkApiKeys,
462
- 'git': checkGit,
463
- 'mcp': checkMcpServers,
464
- 'disk': checkDiskSpace,
465
- 'typescript': checkBuildTools
466
- };
467
- let checksToRun = allChecks;
468
- if (component && componentMap[component]) {
469
- checksToRun = [componentMap[component]];
470
- }
471
- const results = [];
472
- const fixes = [];
473
- // OPTIMIZATION: Run all checks in parallel for 3-5x faster execution
474
- const spinner = output.createSpinner({ text: 'Running health checks in parallel...', spinner: 'dots' });
475
- spinner.start();
476
- try {
477
- // Execute all checks concurrently
478
- const checkResults = await Promise.allSettled(checksToRun.map(check => check()));
479
- spinner.stop();
480
- // Process results in order
481
- for (const settledResult of checkResults) {
482
- if (settledResult.status === 'fulfilled') {
483
- const result = settledResult.value;
484
- results.push(result);
485
- output.writeln(formatCheck(result));
486
- if (result.fix && (result.status === 'fail' || result.status === 'warn')) {
487
- fixes.push(`${result.name}: ${result.fix}`);
488
- }
489
- }
490
- else {
491
- const errorResult = {
492
- name: 'Check',
493
- status: 'fail',
494
- message: settledResult.reason?.message || 'Unknown error'
642
+ action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
643
+ var showFix, autoInstall, component, verbose, allChecks, componentMap, checksToRun, results, fixes, spinner, checkResults, _i, checkResults_1, settledResult, result, errorResult, error_2, claudeCodeResult, installed, newCheck, idx, fixIdx, passed, warnings, failed, summaryParts, _a, fixes_1, fix;
644
+ var _b;
645
+ return __generator(this, function (_c) {
646
+ switch (_c.label) {
647
+ case 0:
648
+ showFix = ctx.flags.fix;
649
+ autoInstall = ctx.flags.install;
650
+ component = ctx.flags.component;
651
+ verbose = ctx.flags.verbose;
652
+ output.writeln();
653
+ output.writeln(output.bold('RuFlo Doctor'));
654
+ output.writeln(output.dim('System diagnostics and health check'));
655
+ output.writeln(output.dim('─'.repeat(50)));
656
+ output.writeln();
657
+ allChecks = [
658
+ checkVersionFreshness,
659
+ checkNodeVersion,
660
+ checkNpmVersion,
661
+ checkClaudeCode,
662
+ checkGit,
663
+ checkGitRepo,
664
+ checkConfigFile,
665
+ checkDaemonStatus,
666
+ checkMemoryDatabase,
667
+ checkApiKeys,
668
+ checkMcpServers,
669
+ checkDiskSpace,
670
+ checkBuildTools,
671
+ checkAgenticFlow
672
+ ];
673
+ componentMap = {
674
+ 'version': checkVersionFreshness,
675
+ 'freshness': checkVersionFreshness,
676
+ 'node': checkNodeVersion,
677
+ 'npm': checkNpmVersion,
678
+ 'claude': checkClaudeCode,
679
+ 'config': checkConfigFile,
680
+ 'daemon': checkDaemonStatus,
681
+ 'memory': checkMemoryDatabase,
682
+ 'api': checkApiKeys,
683
+ 'git': checkGit,
684
+ 'mcp': checkMcpServers,
685
+ 'disk': checkDiskSpace,
686
+ 'typescript': checkBuildTools,
687
+ 'agentic-flow': checkAgenticFlow
495
688
  };
496
- results.push(errorResult);
497
- output.writeln(formatCheck(errorResult));
498
- }
499
- }
500
- }
501
- catch (error) {
502
- spinner.stop();
503
- output.writeln(output.error('Failed to run health checks'));
504
- }
505
- // Auto-install missing dependencies if requested
506
- if (autoInstall) {
507
- const claudeCodeResult = results.find(r => r.name === 'Claude Code CLI');
508
- if (claudeCodeResult && claudeCodeResult.status !== 'pass') {
509
- const installed = await installClaudeCode();
510
- if (installed) {
511
- // Re-check Claude Code after installation
512
- const newCheck = await checkClaudeCode();
513
- const idx = results.findIndex(r => r.name === 'Claude Code CLI');
689
+ checksToRun = allChecks;
690
+ if (component && componentMap[component]) {
691
+ checksToRun = [componentMap[component]];
692
+ }
693
+ results = [];
694
+ fixes = [];
695
+ spinner = output.createSpinner({ text: 'Running health checks in parallel...', spinner: 'dots' });
696
+ spinner.start();
697
+ _c.label = 1;
698
+ case 1:
699
+ _c.trys.push([1, 3, , 4]);
700
+ return [4 /*yield*/, Promise.allSettled(checksToRun.map(function (check) { return check(); }))];
701
+ case 2:
702
+ checkResults = _c.sent();
703
+ spinner.stop();
704
+ // Process results in order
705
+ for (_i = 0, checkResults_1 = checkResults; _i < checkResults_1.length; _i++) {
706
+ settledResult = checkResults_1[_i];
707
+ if (settledResult.status === 'fulfilled') {
708
+ result = settledResult.value;
709
+ results.push(result);
710
+ output.writeln(formatCheck(result));
711
+ if (result.fix && (result.status === 'fail' || result.status === 'warn')) {
712
+ fixes.push(result.name + ": " + result.fix);
713
+ }
714
+ }
715
+ else {
716
+ errorResult = {
717
+ name: 'Check',
718
+ status: 'fail',
719
+ message: ((_b = settledResult.reason) === null || _b === void 0 ? void 0 : _b.message) || 'Unknown error'
720
+ };
721
+ results.push(errorResult);
722
+ output.writeln(formatCheck(errorResult));
723
+ }
724
+ }
725
+ return [3 /*break*/, 4];
726
+ case 3:
727
+ error_2 = _c.sent();
728
+ spinner.stop();
729
+ output.writeln(output.error('Failed to run health checks'));
730
+ return [3 /*break*/, 4];
731
+ case 4:
732
+ if (!autoInstall) return [3 /*break*/, 7];
733
+ claudeCodeResult = results.find(function (r) { return r.name === 'Claude Code CLI'; });
734
+ if (!(claudeCodeResult && claudeCodeResult.status !== 'pass')) return [3 /*break*/, 7];
735
+ return [4 /*yield*/, installClaudeCode()];
736
+ case 5:
737
+ installed = _c.sent();
738
+ if (!installed) return [3 /*break*/, 7];
739
+ return [4 /*yield*/, checkClaudeCode()];
740
+ case 6:
741
+ newCheck = _c.sent();
742
+ idx = results.findIndex(function (r) { return r.name === 'Claude Code CLI'; });
514
743
  if (idx !== -1) {
515
744
  results[idx] = newCheck;
516
- // Update fixes list
517
- const fixIdx = fixes.findIndex(f => f.startsWith('Claude Code CLI:'));
745
+ fixIdx = fixes.findIndex(function (f) { return f.startsWith('Claude Code CLI:'); });
518
746
  if (fixIdx !== -1 && newCheck.status === 'pass') {
519
747
  fixes.splice(fixIdx, 1);
520
748
  }
521
749
  }
522
750
  output.writeln(formatCheck(newCheck));
523
- }
524
- }
525
- }
526
- // Summary
527
- const passed = results.filter(r => r.status === 'pass').length;
528
- const warnings = results.filter(r => r.status === 'warn').length;
529
- const failed = results.filter(r => r.status === 'fail').length;
530
- output.writeln();
531
- output.writeln(output.dim('─'.repeat(50)));
532
- output.writeln();
533
- const summaryParts = [
534
- output.success(`${passed} passed`),
535
- warnings > 0 ? output.warning(`${warnings} warnings`) : null,
536
- failed > 0 ? output.error(`${failed} failed`) : null
537
- ].filter(Boolean);
538
- output.writeln(`Summary: ${summaryParts.join(', ')}`);
539
- // Show fixes
540
- if (showFix && fixes.length > 0) {
541
- output.writeln();
542
- output.writeln(output.bold('Suggested Fixes:'));
543
- output.writeln();
544
- for (const fix of fixes) {
545
- output.writeln(output.dim(` ${fix}`));
751
+ _c.label = 7;
752
+ case 7:
753
+ passed = results.filter(function (r) { return r.status === 'pass'; }).length;
754
+ warnings = results.filter(function (r) { return r.status === 'warn'; }).length;
755
+ failed = results.filter(function (r) { return r.status === 'fail'; }).length;
756
+ output.writeln();
757
+ output.writeln(output.dim(''.repeat(50)));
758
+ output.writeln();
759
+ summaryParts = [
760
+ output.success(passed + " passed"),
761
+ warnings > 0 ? output.warning(warnings + " warnings") : null,
762
+ failed > 0 ? output.error(failed + " failed") : null
763
+ ].filter(Boolean);
764
+ output.writeln("Summary: " + summaryParts.join(', '));
765
+ // Show fixes
766
+ if (showFix && fixes.length > 0) {
767
+ output.writeln();
768
+ output.writeln(output.bold('Suggested Fixes:'));
769
+ output.writeln();
770
+ for (_a = 0, fixes_1 = fixes; _a < fixes_1.length; _a++) {
771
+ fix = fixes_1[_a];
772
+ output.writeln(output.dim(" " + fix));
773
+ }
774
+ }
775
+ else if (fixes.length > 0 && !showFix) {
776
+ output.writeln();
777
+ output.writeln(output.dim("Run with --fix to see " + fixes.length + " suggested fix" + (fixes.length > 1 ? 'es' : '')));
778
+ }
779
+ // Overall result
780
+ if (failed > 0) {
781
+ output.writeln();
782
+ output.writeln(output.error('Some checks failed. Please address the issues above.'));
783
+ return [2 /*return*/, { success: false, exitCode: 1, data: { passed: passed, warnings: warnings, failed: failed, results: results } }];
784
+ }
785
+ else if (warnings > 0) {
786
+ output.writeln();
787
+ output.writeln(output.warning('All checks passed with some warnings.'));
788
+ return [2 /*return*/, { success: true, data: { passed: passed, warnings: warnings, failed: failed, results: results } }];
789
+ }
790
+ else {
791
+ output.writeln();
792
+ output.writeln(output.success('All checks passed! System is healthy.'));
793
+ return [2 /*return*/, { success: true, data: { passed: passed, warnings: warnings, failed: failed, results: results } }];
794
+ }
795
+ return [2 /*return*/];
546
796
  }
547
- }
548
- else if (fixes.length > 0 && !showFix) {
549
- output.writeln();
550
- output.writeln(output.dim(`Run with --fix to see ${fixes.length} suggested fix${fixes.length > 1 ? 'es' : ''}`));
551
- }
552
- // Overall result
553
- if (failed > 0) {
554
- output.writeln();
555
- output.writeln(output.error('Some checks failed. Please address the issues above.'));
556
- return { success: false, exitCode: 1, data: { passed, warnings, failed, results } };
557
- }
558
- else if (warnings > 0) {
559
- output.writeln();
560
- output.writeln(output.warning('All checks passed with some warnings.'));
561
- return { success: true, data: { passed, warnings, failed, results } };
562
- }
563
- else {
564
- output.writeln();
565
- output.writeln(output.success('All checks passed! System is healthy.'));
566
- return { success: true, data: { passed, warnings, failed, results } };
567
- }
568
- }
797
+ });
798
+ }); }
569
799
  };
570
800
  export default doctorCommand;
571
801
  //# sourceMappingURL=doctor.js.map