kynjal-cli 4.0.0 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (502) hide show
  1. package/dist/src/appliance/gguf-engine.d.ts +91 -0
  2. package/dist/src/appliance/gguf-engine.d.ts.map +1 -0
  3. package/dist/src/appliance/gguf-engine.js +286 -525
  4. package/dist/src/appliance/gguf-engine.js.map +1 -1
  5. package/dist/src/appliance/ruvllm-bridge.d.ts +102 -0
  6. package/dist/src/appliance/ruvllm-bridge.d.ts.map +1 -0
  7. package/dist/src/appliance/ruvllm-bridge.js +203 -403
  8. package/dist/src/appliance/ruvllm-bridge.js.map +1 -1
  9. package/dist/src/appliance/rvfa-builder.d.ts +44 -0
  10. package/dist/src/appliance/rvfa-builder.d.ts.map +1 -0
  11. package/dist/src/appliance/rvfa-builder.js +154 -208
  12. package/dist/src/appliance/rvfa-builder.js.map +1 -1
  13. package/dist/src/appliance/rvfa-distribution.d.ts +97 -0
  14. package/dist/src/appliance/rvfa-distribution.d.ts.map +1 -0
  15. package/dist/src/appliance/rvfa-distribution.js +260 -423
  16. package/dist/src/appliance/rvfa-distribution.js.map +1 -1
  17. package/dist/src/appliance/rvfa-format.d.ts +111 -0
  18. package/dist/src/appliance/rvfa-format.d.ts.map +1 -0
  19. package/dist/src/appliance/rvfa-format.js +128 -200
  20. package/dist/src/appliance/rvfa-format.js.map +1 -1
  21. package/dist/src/appliance/rvfa-runner.d.ts +69 -0
  22. package/dist/src/appliance/rvfa-runner.d.ts.map +1 -0
  23. package/dist/src/appliance/rvfa-runner.js +168 -304
  24. package/dist/src/appliance/rvfa-runner.js.map +1 -1
  25. package/dist/src/appliance/rvfa-signing.d.ts +123 -0
  26. package/dist/src/appliance/rvfa-signing.d.ts.map +1 -0
  27. package/dist/src/appliance/rvfa-signing.js +173 -295
  28. package/dist/src/appliance/rvfa-signing.js.map +1 -1
  29. package/dist/src/benchmarks/pretrain/index.d.ts +58 -0
  30. package/dist/src/benchmarks/pretrain/index.d.ts.map +1 -0
  31. package/dist/src/benchmarks/pretrain/index.js +331 -542
  32. package/dist/src/benchmarks/pretrain/index.js.map +1 -1
  33. package/dist/src/commands/agent.js +574 -697
  34. package/dist/src/commands/agent.js.map +1 -1
  35. package/dist/src/commands/analyze.js +1218 -1548
  36. package/dist/src/commands/analyze.js.map +1 -1
  37. package/dist/src/commands/appliance-advanced.js +158 -267
  38. package/dist/src/commands/appliance-advanced.js.map +1 -1
  39. package/dist/src/commands/appliance.js +318 -493
  40. package/dist/src/commands/appliance.js.map +1 -1
  41. package/dist/src/commands/benchmark.js +372 -523
  42. package/dist/src/commands/benchmark.js.map +1 -1
  43. package/dist/src/commands/claims.js +274 -364
  44. package/dist/src/commands/claims.js.map +1 -1
  45. package/dist/src/commands/cleanup.js +113 -157
  46. package/dist/src/commands/cleanup.js.map +1 -1
  47. package/dist/src/commands/completions.js +477 -118
  48. package/dist/src/commands/completions.js.map +1 -1
  49. package/dist/src/commands/config.js +237 -303
  50. package/dist/src/commands/config.js.map +1 -1
  51. package/dist/src/commands/daemon.js +487 -596
  52. package/dist/src/commands/daemon.js.map +1 -1
  53. package/dist/src/commands/deployment.js +194 -275
  54. package/dist/src/commands/deployment.js.map +1 -1
  55. package/dist/src/commands/doctor.js +504 -686
  56. package/dist/src/commands/doctor.js.map +1 -1
  57. package/dist/src/commands/embeddings.js +1293 -1543
  58. package/dist/src/commands/embeddings.js.map +1 -1
  59. package/dist/src/commands/guidance.js +449 -596
  60. package/dist/src/commands/guidance.js.map +1 -1
  61. package/dist/src/commands/hive-mind.js +854 -938
  62. package/dist/src/commands/hive-mind.js.map +1 -1
  63. package/dist/src/commands/hooks.js +3112 -3519
  64. package/dist/src/commands/hooks.js.map +1 -1
  65. package/dist/src/commands/index.d.ts +115 -0
  66. package/dist/src/commands/index.d.ts.map +1 -0
  67. package/dist/src/commands/index.js +126 -308
  68. package/dist/src/commands/index.js.map +1 -1
  69. package/dist/src/commands/init.js +788 -940
  70. package/dist/src/commands/init.js.map +1 -1
  71. package/dist/src/commands/issues.js +383 -558
  72. package/dist/src/commands/issues.js.map +1 -1
  73. package/dist/src/commands/mcp.js +493 -605
  74. package/dist/src/commands/mcp.js.map +1 -1
  75. package/dist/src/commands/memory.js +833 -1026
  76. package/dist/src/commands/memory.js.map +1 -1
  77. package/dist/src/commands/migrate.js +282 -347
  78. package/dist/src/commands/migrate.js.map +1 -1
  79. package/dist/src/commands/neural.js +1289 -1563
  80. package/dist/src/commands/neural.js.map +1 -1
  81. package/dist/src/commands/performance.js +497 -643
  82. package/dist/src/commands/performance.js.map +1 -1
  83. package/dist/src/commands/plugins.js +668 -841
  84. package/dist/src/commands/plugins.js.map +1 -1
  85. package/dist/src/commands/process.js +392 -447
  86. package/dist/src/commands/process.js.map +1 -1
  87. package/dist/src/commands/progress.js +162 -256
  88. package/dist/src/commands/progress.js.map +1 -1
  89. package/dist/src/commands/providers.js +150 -220
  90. package/dist/src/commands/providers.js.map +1 -1
  91. package/dist/src/commands/route.js +520 -665
  92. package/dist/src/commands/route.js.map +1 -1
  93. package/dist/src/commands/ruvector/backup.js +505 -651
  94. package/dist/src/commands/ruvector/backup.js.map +1 -1
  95. package/dist/src/commands/ruvector/benchmark.js +349 -401
  96. package/dist/src/commands/ruvector/benchmark.js.map +1 -1
  97. package/dist/src/commands/ruvector/import.js +224 -266
  98. package/dist/src/commands/ruvector/import.js.map +1 -1
  99. package/dist/src/commands/ruvector/index.js +37 -75
  100. package/dist/src/commands/ruvector/index.js.map +1 -1
  101. package/dist/src/commands/ruvector/init.js +336 -359
  102. package/dist/src/commands/ruvector/init.js.map +1 -1
  103. package/dist/src/commands/ruvector/migrate.js +335 -322
  104. package/dist/src/commands/ruvector/migrate.js.map +1 -1
  105. package/dist/src/commands/ruvector/optimize.js +375 -431
  106. package/dist/src/commands/ruvector/optimize.js.map +1 -1
  107. package/dist/src/commands/ruvector/setup.js +703 -117
  108. package/dist/src/commands/ruvector/setup.js.map +1 -1
  109. package/dist/src/commands/ruvector/status.js +364 -419
  110. package/dist/src/commands/ruvector/status.js.map +1 -1
  111. package/dist/src/commands/security.js +485 -608
  112. package/dist/src/commands/security.js.map +1 -1
  113. package/dist/src/commands/session.js +504 -626
  114. package/dist/src/commands/session.js.map +1 -1
  115. package/dist/src/commands/start.js +267 -364
  116. package/dist/src/commands/start.js.map +1 -1
  117. package/dist/src/commands/status.js +380 -486
  118. package/dist/src/commands/status.js.map +1 -1
  119. package/dist/src/commands/swarm.js +408 -488
  120. package/dist/src/commands/swarm.js.map +1 -1
  121. package/dist/src/commands/task.js +423 -538
  122. package/dist/src/commands/task.js.map +1 -1
  123. package/dist/src/commands/transfer-store.js +322 -412
  124. package/dist/src/commands/transfer-store.js.map +1 -1
  125. package/dist/src/commands/update.js +196 -291
  126. package/dist/src/commands/update.js.map +1 -1
  127. package/dist/src/commands/workflow.js +386 -486
  128. package/dist/src/commands/workflow.js.map +1 -1
  129. package/dist/src/config-adapter.d.ts +15 -0
  130. package/dist/src/config-adapter.d.ts.map +1 -0
  131. package/dist/src/config-adapter.js +38 -39
  132. package/dist/src/config-adapter.js.map +1 -1
  133. package/dist/src/index.d.ts +77 -0
  134. package/dist/src/index.d.ts.map +1 -0
  135. package/dist/src/index.js +309 -411
  136. package/dist/src/index.js.map +1 -1
  137. package/dist/src/infrastructure/in-memory-repositories.d.ts +68 -0
  138. package/dist/src/infrastructure/in-memory-repositories.d.ts.map +1 -0
  139. package/dist/src/infrastructure/in-memory-repositories.js +246 -507
  140. package/dist/src/infrastructure/in-memory-repositories.js.map +1 -1
  141. package/dist/src/init/claudemd-generator.d.ts +25 -0
  142. package/dist/src/init/claudemd-generator.d.ts.map +1 -0
  143. package/dist/src/init/claudemd-generator.js +368 -78
  144. package/dist/src/init/claudemd-generator.js.map +1 -1
  145. package/dist/src/init/executor.d.ts +41 -0
  146. package/dist/src/init/executor.d.ts.map +1 -0
  147. package/dist/src/init/executor.js +1307 -996
  148. package/dist/src/init/executor.js.map +1 -1
  149. package/dist/src/init/helpers-generator.d.ts +60 -0
  150. package/dist/src/init/helpers-generator.d.ts.map +1 -0
  151. package/dist/src/init/helpers-generator.js +657 -12
  152. package/dist/src/init/helpers-generator.js.map +1 -1
  153. package/dist/src/init/index.d.ts +1 -1
  154. package/dist/src/init/index.d.ts.map +1 -1
  155. package/dist/src/init/index.js +1 -1
  156. package/dist/src/init/index.js.map +1 -1
  157. package/dist/src/init/mcp-generator.js +33 -37
  158. package/dist/src/init/mcp-generator.js.map +1 -1
  159. package/dist/src/init/settings-generator.js +76 -77
  160. package/dist/src/init/settings-generator.js.map +1 -1
  161. package/dist/src/init/statusline-generator.js +801 -3
  162. package/dist/src/init/statusline-generator.js.map +1 -1
  163. package/dist/src/init/types.d.ts +1 -1
  164. package/dist/src/init/types.d.ts.map +1 -1
  165. package/dist/src/init/types.js +76 -59
  166. package/dist/src/init/types.js.map +1 -1
  167. package/dist/src/mcp-client.d.ts +92 -0
  168. package/dist/src/mcp-client.d.ts.map +1 -0
  169. package/dist/src/mcp-client.js +81 -125
  170. package/dist/src/mcp-client.js.map +1 -1
  171. package/dist/src/mcp-server.d.ts +161 -0
  172. package/dist/src/mcp-server.d.ts.map +1 -0
  173. package/dist/src/mcp-server.js +470 -757
  174. package/dist/src/mcp-server.js.map +1 -1
  175. package/dist/src/mcp-tools/agent-tools.js +391 -492
  176. package/dist/src/mcp-tools/agent-tools.js.map +1 -1
  177. package/dist/src/mcp-tools/agentdb-tools.js +332 -533
  178. package/dist/src/mcp-tools/agentdb-tools.js.map +1 -1
  179. package/dist/src/mcp-tools/analyze-tools.js +172 -236
  180. package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
  181. package/dist/src/mcp-tools/auto-install.d.ts +83 -0
  182. package/dist/src/mcp-tools/auto-install.d.ts.map +1 -0
  183. package/dist/src/mcp-tools/auto-install.js +80 -142
  184. package/dist/src/mcp-tools/auto-install.js.map +1 -1
  185. package/dist/src/mcp-tools/browser-tools.js +252 -375
  186. package/dist/src/mcp-tools/browser-tools.js.map +1 -1
  187. package/dist/src/mcp-tools/claims-tools.js +473 -565
  188. package/dist/src/mcp-tools/claims-tools.js.map +1 -1
  189. package/dist/src/mcp-tools/config-tools.js +197 -272
  190. package/dist/src/mcp-tools/config-tools.js.map +1 -1
  191. package/dist/src/mcp-tools/coordination-tools.js +500 -572
  192. package/dist/src/mcp-tools/coordination-tools.js.map +1 -1
  193. package/dist/src/mcp-tools/daa-tools.js +286 -364
  194. package/dist/src/mcp-tools/daa-tools.js.map +1 -1
  195. package/dist/src/mcp-tools/embeddings-tools.js +582 -693
  196. package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
  197. package/dist/src/mcp-tools/github-tools.js +260 -311
  198. package/dist/src/mcp-tools/github-tools.js.map +1 -1
  199. package/dist/src/mcp-tools/hive-mind-tools.js +573 -640
  200. package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
  201. package/dist/src/mcp-tools/hooks-tools.js +2215 -2648
  202. package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
  203. package/dist/src/mcp-tools/memory-tools.js +350 -505
  204. package/dist/src/mcp-tools/memory-tools.js.map +1 -1
  205. package/dist/src/mcp-tools/neural-tools.js +315 -412
  206. package/dist/src/mcp-tools/neural-tools.js.map +1 -1
  207. package/dist/src/mcp-tools/performance-tools.js +420 -480
  208. package/dist/src/mcp-tools/performance-tools.js.map +1 -1
  209. package/dist/src/mcp-tools/progress-tools.js +204 -278
  210. package/dist/src/mcp-tools/progress-tools.js.map +1 -1
  211. package/dist/src/mcp-tools/ruvllm-tools.js +163 -279
  212. package/dist/src/mcp-tools/ruvllm-tools.js.map +1 -1
  213. package/dist/src/mcp-tools/security-tools.js +297 -429
  214. package/dist/src/mcp-tools/security-tools.js.map +1 -1
  215. package/dist/src/mcp-tools/session-tools.js +185 -234
  216. package/dist/src/mcp-tools/session-tools.js.map +1 -1
  217. package/dist/src/mcp-tools/swarm-tools.js +207 -260
  218. package/dist/src/mcp-tools/swarm-tools.js.map +1 -1
  219. package/dist/src/mcp-tools/system-tools.js +276 -325
  220. package/dist/src/mcp-tools/system-tools.js.map +1 -1
  221. package/dist/src/mcp-tools/task-tools.js +270 -336
  222. package/dist/src/mcp-tools/task-tools.js.map +1 -1
  223. package/dist/src/mcp-tools/terminal-tools.js +148 -196
  224. package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
  225. package/dist/src/mcp-tools/transfer-tools.js +186 -333
  226. package/dist/src/mcp-tools/transfer-tools.js.map +1 -1
  227. package/dist/src/mcp-tools/types.d.ts +31 -0
  228. package/dist/src/mcp-tools/types.d.ts.map +1 -0
  229. package/dist/src/mcp-tools/wasm-agent-tools.js +133 -280
  230. package/dist/src/mcp-tools/wasm-agent-tools.js.map +1 -1
  231. package/dist/src/mcp-tools/workflow-tools.js +405 -450
  232. package/dist/src/mcp-tools/workflow-tools.js.map +1 -1
  233. package/dist/src/memory/ewc-consolidation.d.ts +295 -0
  234. package/dist/src/memory/ewc-consolidation.d.ts.map +1 -0
  235. package/dist/src/memory/ewc-consolidation.js +190 -303
  236. package/dist/src/memory/ewc-consolidation.js.map +1 -1
  237. package/dist/src/memory/intelligence.d.ts +338 -0
  238. package/dist/src/memory/intelligence.d.ts.map +1 -0
  239. package/dist/src/memory/intelligence.js +569 -794
  240. package/dist/src/memory/intelligence.js.map +1 -1
  241. package/dist/src/memory/memory-bridge.d.ts +407 -0
  242. package/dist/src/memory/memory-bridge.d.ts.map +1 -0
  243. package/dist/src/memory/memory-bridge.js +1170 -1640
  244. package/dist/src/memory/memory-bridge.js.map +1 -1
  245. package/dist/src/memory/memory-initializer.d.ts +412 -0
  246. package/dist/src/memory/memory-initializer.d.ts.map +1 -0
  247. package/dist/src/memory/memory-initializer.js +1836 -1851
  248. package/dist/src/memory/memory-initializer.js.map +1 -1
  249. package/dist/src/memory/sona-optimizer.d.ts +227 -0
  250. package/dist/src/memory/sona-optimizer.d.ts.map +1 -0
  251. package/dist/src/memory/sona-optimizer.js +199 -329
  252. package/dist/src/memory/sona-optimizer.js.map +1 -1
  253. package/dist/src/output.d.ts +2 -2
  254. package/dist/src/output.d.ts.map +1 -1
  255. package/dist/src/output.js +242 -272
  256. package/dist/src/output.js.map +1 -1
  257. package/dist/src/parser.d.ts +51 -0
  258. package/dist/src/parser.d.ts.map +1 -0
  259. package/dist/src/parser.js +140 -187
  260. package/dist/src/parser.js.map +1 -1
  261. package/dist/src/plugins/manager.d.ts +133 -0
  262. package/dist/src/plugins/manager.d.ts.map +1 -0
  263. package/dist/src/plugins/manager.js +285 -521
  264. package/dist/src/plugins/manager.js.map +1 -1
  265. package/dist/src/plugins/store/discovery.d.ts +88 -0
  266. package/dist/src/plugins/store/discovery.d.ts.map +1 -0
  267. package/dist/src/plugins/store/discovery.js +271 -358
  268. package/dist/src/plugins/store/discovery.js.map +1 -1
  269. package/dist/src/plugins/store/index.d.ts +76 -0
  270. package/dist/src/plugins/store/index.d.ts.map +1 -0
  271. package/dist/src/plugins/store/index.js +48 -105
  272. package/dist/src/plugins/store/index.js.map +1 -1
  273. package/dist/src/plugins/store/search.d.ts +46 -0
  274. package/dist/src/plugins/store/search.d.ts.map +1 -0
  275. package/dist/src/plugins/store/search.js +69 -107
  276. package/dist/src/plugins/store/search.js.map +1 -1
  277. package/dist/src/plugins/store/types.d.ts +274 -0
  278. package/dist/src/plugins/store/types.d.ts.map +1 -0
  279. package/dist/src/plugins/tests/demo-plugin-store.js +113 -160
  280. package/dist/src/plugins/tests/demo-plugin-store.js.map +1 -1
  281. package/dist/src/plugins/tests/standalone-test.js +172 -223
  282. package/dist/src/plugins/tests/standalone-test.js.map +1 -1
  283. package/dist/src/plugins/tests/test-plugin-store.js +190 -228
  284. package/dist/src/plugins/tests/test-plugin-store.js.map +1 -1
  285. package/dist/src/production/circuit-breaker.d.ts +101 -0
  286. package/dist/src/production/circuit-breaker.d.ts.map +1 -0
  287. package/dist/src/production/circuit-breaker.js +62 -126
  288. package/dist/src/production/circuit-breaker.js.map +1 -1
  289. package/dist/src/production/error-handler.d.ts +92 -0
  290. package/dist/src/production/error-handler.d.ts.map +1 -0
  291. package/dist/src/production/error-handler.js +86 -156
  292. package/dist/src/production/error-handler.js.map +1 -1
  293. package/dist/src/production/monitoring.d.ts +161 -0
  294. package/dist/src/production/monitoring.d.ts.map +1 -0
  295. package/dist/src/production/monitoring.js +139 -220
  296. package/dist/src/production/monitoring.js.map +1 -1
  297. package/dist/src/production/rate-limiter.d.ts +80 -0
  298. package/dist/src/production/rate-limiter.d.ts.map +1 -0
  299. package/dist/src/production/rate-limiter.js +74 -93
  300. package/dist/src/production/rate-limiter.js.map +1 -1
  301. package/dist/src/production/retry.d.ts +48 -0
  302. package/dist/src/production/retry.d.ts.map +1 -0
  303. package/dist/src/production/retry.js +75 -167
  304. package/dist/src/production/retry.js.map +1 -1
  305. package/dist/src/prompt.d.ts +44 -0
  306. package/dist/src/prompt.d.ts.map +1 -0
  307. package/dist/src/prompt.js +436 -560
  308. package/dist/src/prompt.js.map +1 -1
  309. package/dist/src/runtime/headless.d.ts +60 -0
  310. package/dist/src/runtime/headless.d.ts.map +1 -0
  311. package/dist/src/runtime/headless.js +197 -286
  312. package/dist/src/runtime/headless.js.map +1 -1
  313. package/dist/src/ruvector/agent-wasm.d.ts +182 -0
  314. package/dist/src/ruvector/agent-wasm.d.ts.map +1 -0
  315. package/dist/src/ruvector/agent-wasm.js +156 -351
  316. package/dist/src/ruvector/agent-wasm.js.map +1 -1
  317. package/dist/src/ruvector/ast-analyzer.d.ts +67 -0
  318. package/dist/src/ruvector/ast-analyzer.d.ts.map +1 -0
  319. package/dist/src/ruvector/ast-analyzer.js +145 -232
  320. package/dist/src/ruvector/ast-analyzer.js.map +1 -1
  321. package/dist/src/ruvector/coverage-router.d.ts +160 -0
  322. package/dist/src/ruvector/coverage-router.d.ts.map +1 -0
  323. package/dist/src/ruvector/coverage-router.js +287 -419
  324. package/dist/src/ruvector/coverage-router.js.map +1 -1
  325. package/dist/src/ruvector/coverage-tools.js +56 -101
  326. package/dist/src/ruvector/coverage-tools.js.map +1 -1
  327. package/dist/src/ruvector/diff-classifier.d.ts +175 -0
  328. package/dist/src/ruvector/diff-classifier.d.ts.map +1 -0
  329. package/dist/src/ruvector/diff-classifier.js +324 -451
  330. package/dist/src/ruvector/diff-classifier.js.map +1 -1
  331. package/dist/src/ruvector/enhanced-model-router.d.ts +146 -0
  332. package/dist/src/ruvector/enhanced-model-router.d.ts.map +1 -0
  333. package/dist/src/ruvector/enhanced-model-router.js +260 -336
  334. package/dist/src/ruvector/enhanced-model-router.js.map +1 -1
  335. package/dist/src/ruvector/flash-attention.d.ts +195 -0
  336. package/dist/src/ruvector/flash-attention.d.ts.map +1 -0
  337. package/dist/src/ruvector/flash-attention.js +223 -254
  338. package/dist/src/ruvector/flash-attention.js.map +1 -1
  339. package/dist/src/ruvector/graph-analyzer.d.ts +187 -0
  340. package/dist/src/ruvector/graph-analyzer.d.ts.map +1 -0
  341. package/dist/src/ruvector/graph-analyzer.js +486 -680
  342. package/dist/src/ruvector/graph-analyzer.js.map +1 -1
  343. package/dist/src/ruvector/index.d.ts +40 -0
  344. package/dist/src/ruvector/index.d.ts.map +1 -0
  345. package/dist/src/ruvector/index.js +36 -106
  346. package/dist/src/ruvector/index.js.map +1 -1
  347. package/dist/src/ruvector/lora-adapter.d.ts +218 -0
  348. package/dist/src/ruvector/lora-adapter.d.ts.map +1 -0
  349. package/dist/src/ruvector/lora-adapter.js +155 -248
  350. package/dist/src/ruvector/lora-adapter.js.map +1 -1
  351. package/dist/src/ruvector/model-router.d.ts +220 -0
  352. package/dist/src/ruvector/model-router.d.ts.map +1 -0
  353. package/dist/src/ruvector/model-router.js +175 -248
  354. package/dist/src/ruvector/model-router.js.map +1 -1
  355. package/dist/src/ruvector/moe-router.d.ts +206 -0
  356. package/dist/src/ruvector/moe-router.d.ts.map +1 -0
  357. package/dist/src/ruvector/moe-router.js +228 -286
  358. package/dist/src/ruvector/moe-router.js.map +1 -1
  359. package/dist/src/ruvector/q-learning-router.d.ts +211 -0
  360. package/dist/src/ruvector/q-learning-router.d.ts.map +1 -0
  361. package/dist/src/ruvector/q-learning-router.js +257 -338
  362. package/dist/src/ruvector/q-learning-router.js.map +1 -1
  363. package/dist/src/ruvector/ruvllm-wasm.d.ts +179 -0
  364. package/dist/src/ruvector/ruvllm-wasm.d.ts.map +1 -0
  365. package/dist/src/ruvector/ruvllm-wasm.js +270 -434
  366. package/dist/src/ruvector/ruvllm-wasm.js.map +1 -1
  367. package/dist/src/ruvector/semantic-router.d.ts +77 -0
  368. package/dist/src/ruvector/semantic-router.d.ts.map +1 -0
  369. package/dist/src/ruvector/semantic-router.js +60 -67
  370. package/dist/src/ruvector/semantic-router.js.map +1 -1
  371. package/dist/src/ruvector/vector-db.d.ts +69 -0
  372. package/dist/src/ruvector/vector-db.d.ts.map +1 -0
  373. package/dist/src/ruvector/vector-db.js +119 -205
  374. package/dist/src/ruvector/vector-db.js.map +1 -1
  375. package/dist/src/services/agentic-flow-bridge.d.ts +50 -0
  376. package/dist/src/services/agentic-flow-bridge.d.ts.map +1 -0
  377. package/dist/src/services/agentic-flow-bridge.js +32 -105
  378. package/dist/src/services/agentic-flow-bridge.js.map +1 -1
  379. package/dist/src/services/claim-service.d.ts +204 -0
  380. package/dist/src/services/claim-service.d.ts.map +1 -0
  381. package/dist/src/services/claim-service.js +615 -940
  382. package/dist/src/services/claim-service.js.map +1 -1
  383. package/dist/src/services/container-worker-pool.d.ts +197 -0
  384. package/dist/src/services/container-worker-pool.d.ts.map +1 -0
  385. package/dist/src/services/container-worker-pool.js +398 -666
  386. package/dist/src/services/container-worker-pool.js.map +1 -1
  387. package/dist/src/services/headless-worker-executor.d.ts +304 -0
  388. package/dist/src/services/headless-worker-executor.d.ts.map +1 -0
  389. package/dist/src/services/headless-worker-executor.js +441 -467
  390. package/dist/src/services/headless-worker-executor.js.map +1 -1
  391. package/dist/src/services/index.d.ts +4 -4
  392. package/dist/src/services/index.d.ts.map +1 -1
  393. package/dist/src/services/index.js +4 -4
  394. package/dist/src/services/index.js.map +1 -1
  395. package/dist/src/services/registry-api.d.ts +58 -0
  396. package/dist/src/services/registry-api.d.ts.map +1 -0
  397. package/dist/src/services/registry-api.js +92 -200
  398. package/dist/src/services/registry-api.js.map +1 -1
  399. package/dist/src/services/ruvector-training.d.ts +222 -0
  400. package/dist/src/services/ruvector-training.d.ts.map +1 -0
  401. package/dist/src/services/ruvector-training.js +257 -337
  402. package/dist/src/services/ruvector-training.js.map +1 -1
  403. package/dist/src/services/worker-daemon.d.ts +228 -0
  404. package/dist/src/services/worker-daemon.d.ts.map +1 -0
  405. package/dist/src/services/worker-daemon.js +591 -849
  406. package/dist/src/services/worker-daemon.js.map +1 -1
  407. package/dist/src/services/worker-queue.d.ts +194 -0
  408. package/dist/src/services/worker-queue.d.ts.map +1 -0
  409. package/dist/src/services/worker-queue.js +331 -548
  410. package/dist/src/services/worker-queue.js.map +1 -1
  411. package/dist/src/suggest.d.ts +53 -0
  412. package/dist/src/suggest.d.ts.map +1 -0
  413. package/dist/src/suggest.js +45 -55
  414. package/dist/src/suggest.js.map +1 -1
  415. package/dist/src/transfer/anonymization/index.js +29 -37
  416. package/dist/src/transfer/anonymization/index.js.map +1 -1
  417. package/dist/src/transfer/deploy-seraphine.js +128 -155
  418. package/dist/src/transfer/deploy-seraphine.js.map +1 -1
  419. package/dist/src/transfer/export.d.ts +25 -0
  420. package/dist/src/transfer/export.d.ts.map +1 -0
  421. package/dist/src/transfer/export.js +84 -142
  422. package/dist/src/transfer/export.js.map +1 -1
  423. package/dist/src/transfer/index.d.ts +1 -1
  424. package/dist/src/transfer/index.d.ts.map +1 -1
  425. package/dist/src/transfer/index.js +0 -2
  426. package/dist/src/transfer/index.js.map +1 -1
  427. package/dist/src/transfer/ipfs/client.d.ts +109 -0
  428. package/dist/src/transfer/ipfs/client.d.ts.map +1 -0
  429. package/dist/src/transfer/ipfs/client.js +187 -337
  430. package/dist/src/transfer/ipfs/client.js.map +1 -1
  431. package/dist/src/transfer/ipfs/upload.d.ts +95 -0
  432. package/dist/src/transfer/ipfs/upload.d.ts.map +1 -0
  433. package/dist/src/transfer/ipfs/upload.js +288 -434
  434. package/dist/src/transfer/ipfs/upload.js.map +1 -1
  435. package/dist/src/transfer/models/seraphine.d.ts +72 -0
  436. package/dist/src/transfer/models/seraphine.d.ts.map +1 -0
  437. package/dist/src/transfer/models/seraphine.js +55 -55
  438. package/dist/src/transfer/models/seraphine.js.map +1 -1
  439. package/dist/src/transfer/serialization/cfp.d.ts +49 -0
  440. package/dist/src/transfer/serialization/cfp.d.ts.map +1 -0
  441. package/dist/src/transfer/serialization/cfp.js +30 -31
  442. package/dist/src/transfer/serialization/cfp.js.map +1 -1
  443. package/dist/src/transfer/storage/gcs.d.ts +82 -0
  444. package/dist/src/transfer/storage/gcs.d.ts.map +1 -0
  445. package/dist/src/transfer/storage/gcs.js +165 -232
  446. package/dist/src/transfer/storage/gcs.js.map +1 -1
  447. package/dist/src/transfer/store/discovery.d.ts +84 -0
  448. package/dist/src/transfer/store/discovery.d.ts.map +1 -0
  449. package/dist/src/transfer/store/discovery.js +239 -349
  450. package/dist/src/transfer/store/discovery.js.map +1 -1
  451. package/dist/src/transfer/store/download.d.ts +70 -0
  452. package/dist/src/transfer/store/download.d.ts.map +1 -0
  453. package/dist/src/transfer/store/download.js +243 -365
  454. package/dist/src/transfer/store/download.js.map +1 -1
  455. package/dist/src/transfer/store/index.d.ts +84 -0
  456. package/dist/src/transfer/store/index.d.ts.map +1 -0
  457. package/dist/src/transfer/store/index.js +63 -130
  458. package/dist/src/transfer/store/index.js.map +1 -1
  459. package/dist/src/transfer/store/publish.d.ts +76 -0
  460. package/dist/src/transfer/store/publish.d.ts.map +1 -0
  461. package/dist/src/transfer/store/publish.js +184 -258
  462. package/dist/src/transfer/store/publish.js.map +1 -1
  463. package/dist/src/transfer/store/registry.js +50 -72
  464. package/dist/src/transfer/store/registry.js.map +1 -1
  465. package/dist/src/transfer/store/search.d.ts +54 -0
  466. package/dist/src/transfer/store/search.d.ts.map +1 -0
  467. package/dist/src/transfer/store/search.js +64 -96
  468. package/dist/src/transfer/store/search.js.map +1 -1
  469. package/dist/src/transfer/store/tests/standalone-test.js +174 -231
  470. package/dist/src/transfer/store/tests/standalone-test.js.map +1 -1
  471. package/dist/src/transfer/test-seraphine.js +95 -130
  472. package/dist/src/transfer/test-seraphine.js.map +1 -1
  473. package/dist/src/transfer/tests/test-store.js +194 -239
  474. package/dist/src/transfer/tests/test-store.js.map +1 -1
  475. package/dist/src/transfer/types.d.ts +245 -0
  476. package/dist/src/transfer/types.d.ts.map +1 -0
  477. package/dist/src/types.d.ts +198 -0
  478. package/dist/src/types.d.ts.map +1 -0
  479. package/dist/src/types.js +26 -55
  480. package/dist/src/types.js.map +1 -1
  481. package/dist/src/update/checker.d.ts +34 -0
  482. package/dist/src/update/checker.d.ts.map +1 -0
  483. package/dist/src/update/checker.js +106 -183
  484. package/dist/src/update/checker.js.map +1 -1
  485. package/dist/src/update/executor.d.ts +32 -0
  486. package/dist/src/update/executor.d.ts.map +1 -0
  487. package/dist/src/update/executor.js +135 -198
  488. package/dist/src/update/executor.js.map +1 -1
  489. package/dist/src/update/index.d.ts +33 -0
  490. package/dist/src/update/index.d.ts.map +1 -0
  491. package/dist/src/update/index.js +38 -85
  492. package/dist/src/update/index.js.map +1 -1
  493. package/dist/src/update/rate-limiter.d.ts +20 -0
  494. package/dist/src/update/rate-limiter.d.ts.map +1 -0
  495. package/dist/src/update/rate-limiter.js +19 -31
  496. package/dist/src/update/rate-limiter.js.map +1 -1
  497. package/dist/src/update/validator.d.ts +17 -0
  498. package/dist/src/update/validator.d.ts.map +1 -0
  499. package/dist/src/update/validator.js +38 -64
  500. package/dist/src/update/validator.js.map +1 -1
  501. package/dist/tsconfig.tsbuildinfo +1 -1
  502. package/package.json +1 -1
@@ -2,878 +2,744 @@
2
2
  * V3 CLI Init Command
3
3
  * Comprehensive initialization for Claude Flow with Claude Code integration
4
4
  */
5
- var __assign = (this && this.__assign) || function () {
6
- __assign = Object.assign || function(t) {
7
- for (var s, i = 1, n = arguments.length; i < n; i++) {
8
- s = arguments[i];
9
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
- t[p] = s[p];
11
- }
12
- return t;
13
- };
14
- return __assign.apply(this, arguments);
15
- };
16
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
- return new (P || (P = Promise))(function (resolve, reject) {
19
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
- step((generator = generator.apply(thisArg, _arguments || [])).next());
23
- });
24
- };
25
- var __generator = (this && this.__generator) || function (thisArg, body) {
26
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
27
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
28
- function verb(n) { return function (v) { return step([n, v]); }; }
29
- function step(op) {
30
- if (f) throw new TypeError("Generator is already executing.");
31
- while (_) try {
32
- 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;
33
- if (y = 0, t) op = [op[0] & 2, t.value];
34
- switch (op[0]) {
35
- case 0: case 1: t = op; break;
36
- case 4: _.label++; return { value: op[1], done: false };
37
- case 5: _.label++; y = op[1]; op = [0]; continue;
38
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
39
- default:
40
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
41
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
42
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
43
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
44
- if (t[2]) _.ops.pop();
45
- _.trys.pop(); continue;
46
- }
47
- op = body.call(thisArg, _);
48
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
49
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
- }
51
- };
52
5
  import { output } from '../output.js';
53
6
  import { confirm, select, multiSelect, input } from '../prompt.js';
54
7
  import * as fs from 'fs';
55
8
  import * as path from 'path';
56
9
  import { executeInit, executeUpgrade, executeUpgradeWithMissing, DEFAULT_INIT_OPTIONS, MINIMAL_INIT_OPTIONS, FULL_INIT_OPTIONS, } from '../init/index.js';
57
10
  // Codex initialization action
58
- function initCodexAction(ctx, options) {
59
- return __awaiter(this, void 0, Promise, function () {
60
- var force, minimal, full, dualMode, template, spinner, CodexInitializer, codexModuleId_1, resolutionStrategies, _i, resolutionStrategies_1, strategy, _a, initializer, result, _b, _c, error, summary, _d, _e, warning, error_1, errorMessage;
61
- var _this = this;
62
- return __generator(this, function (_f) {
63
- switch (_f.label) {
64
- case 0:
65
- force = options.force, minimal = options.minimal, full = options.full, dualMode = options.dualMode;
66
- output.writeln();
67
- output.writeln(output.bold('Initializing RuFlo V3 for OpenAI Codex'));
68
- output.writeln();
69
- template = minimal ? 'minimal' : full ? 'full' : 'default';
70
- spinner = output.createSpinner({ text: 'Initializing Codex project...' });
71
- spinner.start();
72
- _f.label = 1;
73
- case 1:
74
- _f.trys.push([1, 9, , 10]);
75
- CodexInitializer = void 0;
76
- codexModuleId_1 = '@claude-flow/codex';
77
- resolutionStrategies = [
78
- // Strategy 1: Direct import (works if installed as CLI dependency)
79
- function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
80
- switch (_a.label) {
81
- case 0: return [4 /*yield*/, import(codexModuleId_1)];
82
- case 1: return [2 /*return*/, (_a.sent()).CodexInitializer];
83
- }
84
- }); }); },
85
- // Strategy 2: Project node_modules (works if installed in user's project)
86
- function () { return __awaiter(_this, void 0, void 0, function () {
87
- var projectPath, mod;
88
- return __generator(this, function (_a) {
89
- switch (_a.label) {
90
- case 0:
91
- projectPath = path.join(ctx.cwd, 'node_modules', '@claude-flow', 'codex', 'dist', 'index.js');
92
- if (!fs.existsSync(projectPath)) return [3 /*break*/, 2];
93
- return [4 /*yield*/, import("file://" + projectPath)];
94
- case 1:
95
- mod = _a.sent();
96
- return [2 /*return*/, mod.CodexInitializer];
97
- case 2: throw new Error('Not found in project');
98
- }
99
- });
100
- }); },
101
- // Strategy 3: Global node_modules
102
- function () { return __awaiter(_this, void 0, void 0, function () {
103
- var execSync, globalPath, codexPath, mod;
104
- return __generator(this, function (_a) {
105
- switch (_a.label) {
106
- case 0: return [4 /*yield*/, import('child_process')];
107
- case 1:
108
- execSync = (_a.sent()).execSync;
109
- globalPath = execSync('npm root -g', { encoding: 'utf-8' }).trim();
110
- codexPath = path.join(globalPath, '@claude-flow', 'codex', 'dist', 'index.js');
111
- if (!fs.existsSync(codexPath)) return [3 /*break*/, 3];
112
- return [4 /*yield*/, import("file://" + codexPath)];
113
- case 2:
114
- mod = _a.sent();
115
- return [2 /*return*/, mod.CodexInitializer];
116
- case 3: throw new Error('Not found globally');
117
- }
118
- });
119
- }); },
120
- ];
121
- _i = 0, resolutionStrategies_1 = resolutionStrategies;
122
- _f.label = 2;
123
- case 2:
124
- if (!(_i < resolutionStrategies_1.length)) return [3 /*break*/, 7];
125
- strategy = resolutionStrategies_1[_i];
126
- _f.label = 3;
127
- case 3:
128
- _f.trys.push([3, 5, , 6]);
129
- return [4 /*yield*/, strategy()];
130
- case 4:
131
- CodexInitializer = _f.sent();
132
- if (CodexInitializer)
133
- return [3 /*break*/, 7];
134
- return [3 /*break*/, 6];
135
- case 5:
136
- _a = _f.sent();
137
- return [3 /*break*/, 6];
138
- case 6:
139
- _i++;
140
- return [3 /*break*/, 2];
141
- case 7:
142
- if (!CodexInitializer) {
143
- throw new Error('Cannot find module @claude-flow/codex');
144
- }
145
- initializer = new CodexInitializer();
146
- return [4 /*yield*/, initializer.initialize({
147
- projectPath: ctx.cwd,
148
- template: template,
149
- force: force,
150
- dual: dualMode
151
- })];
152
- case 8:
153
- result = _f.sent();
154
- if (!result.success) {
155
- spinner.fail('Codex initialization failed');
156
- if (result.errors) {
157
- for (_b = 0, _c = result.errors; _b < _c.length; _b++) {
158
- error = _c[_b];
159
- output.printError(error);
160
- }
161
- }
162
- return [2 /*return*/, { success: false, exitCode: 1 }];
163
- }
164
- spinner.succeed('Codex project initialized successfully!');
165
- output.writeln();
166
- summary = [];
167
- summary.push("Files: " + result.filesCreated.length + " created");
168
- summary.push("Skills: " + result.skillsGenerated.length + " installed");
169
- output.printBox(summary.join('\n'), 'Summary');
170
- output.writeln();
171
- // Show what was created
172
- output.printBox([
173
- "AGENTS.md: Main project instructions",
174
- ".agents/config.toml: Project configuration",
175
- ".agents/skills/: " + result.skillsGenerated.length + " skills",
176
- ".codex/: Local overrides (gitignored)",
177
- dualMode ? "CLAUDE.md: Claude Code compatibility" : '',
178
- ].filter(Boolean).join('\n'), 'OpenAI Codex Integration');
179
- output.writeln();
180
- // Warnings
181
- if (result.warnings && result.warnings.length > 0) {
182
- output.printWarning('Warnings:');
183
- for (_d = 0, _e = result.warnings.slice(0, 5); _d < _e.length; _d++) {
184
- warning = _e[_d];
185
- output.printInfo(" \u2022 " + warning);
186
- }
187
- if (result.warnings.length > 5) {
188
- output.printInfo(" ... and " + (result.warnings.length - 5) + " more");
189
- }
190
- output.writeln();
191
- }
192
- // Next steps
193
- output.writeln(output.bold('Next steps:'));
194
- output.printList([
195
- "Review " + output.highlight('AGENTS.md') + " for project instructions",
196
- "Add skills with " + output.highlight('$skill-name') + " syntax",
197
- "Configure " + output.highlight('.agents/config.toml') + " for your project",
198
- dualMode ? "Claude Code users can use " + output.highlight('CLAUDE.md') : '',
199
- ].filter(Boolean));
200
- return [2 /*return*/, { success: true, data: result }];
201
- case 9:
202
- error_1 = _f.sent();
203
- spinner.fail('Codex initialization failed');
204
- errorMessage = error_1 instanceof Error ? error_1.message : String(error_1);
205
- // Handle module not found error gracefully
206
- if (errorMessage.includes('Cannot find module') || errorMessage.includes('@claude-flow/codex')) {
207
- output.printError('The @claude-flow/codex package is not installed.');
208
- output.printInfo('Install it with: npm install @claude-flow/codex');
209
- output.writeln();
210
- output.printInfo('Alternatively, copy skills manually from .claude/skills/ to .agents/skills/');
211
- }
212
- else {
213
- output.printError("Failed to initialize: " + errorMessage);
214
- }
215
- return [2 /*return*/, { success: false, exitCode: 1 }];
216
- case 10: return [2 /*return*/];
11
+ async function initCodexAction(ctx, options) {
12
+ const { force, minimal, full, dualMode } = options;
13
+ output.writeln();
14
+ output.writeln(output.bold('Initializing RuFlo V3 for OpenAI Codex'));
15
+ output.writeln();
16
+ // Determine template
17
+ const template = minimal ? 'minimal' : full ? 'full' : 'default';
18
+ const spinner = output.createSpinner({ text: 'Initializing Codex project...' });
19
+ spinner.start();
20
+ try {
21
+ // Dynamic import of the Codex initializer with lazy loading fallback
22
+ let CodexInitializer;
23
+ // Try multiple resolution strategies for the @claude-flow/codex package
24
+ // Use a variable to prevent TypeScript from statically resolving the optional module
25
+ const codexModuleId = '@claude-flow/codex';
26
+ const resolutionStrategies = [
27
+ // Strategy 1: Direct import (works if installed as CLI dependency)
28
+ async () => (await import(codexModuleId)).CodexInitializer,
29
+ // Strategy 2: Project node_modules (works if installed in user's project)
30
+ async () => {
31
+ const projectPath = path.join(ctx.cwd, 'node_modules', '@claude-flow', 'codex', 'dist', 'index.js');
32
+ if (fs.existsSync(projectPath)) {
33
+ const mod = await import(`file://${projectPath}`);
34
+ return mod.CodexInitializer;
35
+ }
36
+ throw new Error('Not found in project');
37
+ },
38
+ // Strategy 3: Global node_modules
39
+ async () => {
40
+ const { execSync } = await import('child_process');
41
+ const globalPath = execSync('npm root -g', { encoding: 'utf-8' }).trim();
42
+ const codexPath = path.join(globalPath, '@claude-flow', 'codex', 'dist', 'index.js');
43
+ if (fs.existsSync(codexPath)) {
44
+ const mod = await import(`file://${codexPath}`);
45
+ return mod.CodexInitializer;
46
+ }
47
+ throw new Error('Not found globally');
48
+ },
49
+ ];
50
+ for (const strategy of resolutionStrategies) {
51
+ try {
52
+ CodexInitializer = await strategy();
53
+ if (CodexInitializer)
54
+ break;
217
55
  }
56
+ catch {
57
+ // Try next strategy
58
+ }
59
+ }
60
+ if (!CodexInitializer) {
61
+ throw new Error('Cannot find module @claude-flow/codex');
62
+ }
63
+ const initializer = new CodexInitializer();
64
+ const result = await initializer.initialize({
65
+ projectPath: ctx.cwd,
66
+ template: template,
67
+ force,
68
+ dual: dualMode,
218
69
  });
219
- });
70
+ if (!result.success) {
71
+ spinner.fail('Codex initialization failed');
72
+ if (result.errors) {
73
+ for (const error of result.errors) {
74
+ output.printError(error);
75
+ }
76
+ }
77
+ return { success: false, exitCode: 1 };
78
+ }
79
+ spinner.succeed('Codex project initialized successfully!');
80
+ output.writeln();
81
+ // Display summary
82
+ const summary = [];
83
+ summary.push(`Files: ${result.filesCreated.length} created`);
84
+ summary.push(`Skills: ${result.skillsGenerated.length} installed`);
85
+ output.printBox(summary.join('\n'), 'Summary');
86
+ output.writeln();
87
+ // Show what was created
88
+ output.printBox([
89
+ `AGENTS.md: Main project instructions`,
90
+ `.agents/config.toml: Project configuration`,
91
+ `.agents/skills/: ${result.skillsGenerated.length} skills`,
92
+ `.codex/: Local overrides (gitignored)`,
93
+ dualMode ? `CLAUDE.md: Claude Code compatibility` : '',
94
+ ].filter(Boolean).join('\n'), 'OpenAI Codex Integration');
95
+ output.writeln();
96
+ // Warnings
97
+ if (result.warnings && result.warnings.length > 0) {
98
+ output.printWarning('Warnings:');
99
+ for (const warning of result.warnings.slice(0, 5)) {
100
+ output.printInfo(` • ${warning}`);
101
+ }
102
+ if (result.warnings.length > 5) {
103
+ output.printInfo(` ... and ${result.warnings.length - 5} more`);
104
+ }
105
+ output.writeln();
106
+ }
107
+ // Next steps
108
+ output.writeln(output.bold('Next steps:'));
109
+ output.printList([
110
+ `Review ${output.highlight('AGENTS.md')} for project instructions`,
111
+ `Add skills with ${output.highlight('$skill-name')} syntax`,
112
+ `Configure ${output.highlight('.agents/config.toml')} for your project`,
113
+ dualMode ? `Claude Code users can use ${output.highlight('CLAUDE.md')}` : '',
114
+ ].filter(Boolean));
115
+ return { success: true, data: result };
116
+ }
117
+ catch (error) {
118
+ spinner.fail('Codex initialization failed');
119
+ const errorMessage = error instanceof Error ? error.message : String(error);
120
+ // Handle module not found error gracefully
121
+ if (errorMessage.includes('Cannot find module') || errorMessage.includes('@claude-flow/codex')) {
122
+ output.printError('The @claude-flow/codex package is not installed.');
123
+ output.printInfo('Install it with: npm install @claude-flow/codex');
124
+ output.writeln();
125
+ output.printInfo('Alternatively, copy skills manually from .claude/skills/ to .agents/skills/');
126
+ }
127
+ else {
128
+ output.printError(`Failed to initialize: ${errorMessage}`);
129
+ }
130
+ return { success: false, exitCode: 1 };
131
+ }
220
132
  }
221
133
  // Check if project is already initialized
222
134
  function isInitialized(cwd) {
223
- var claudePath = path.join(cwd, '.claude', 'settings.json');
224
- var claudeFlowPath = path.join(cwd, '.claude-flow', 'config.yaml');
135
+ const claudePath = path.join(cwd, '.claude', 'settings.json');
136
+ const claudeFlowPath = path.join(cwd, '.claude-flow', 'config.yaml');
225
137
  return {
226
138
  claude: fs.existsSync(claudePath),
227
- claudeFlow: fs.existsSync(claudeFlowPath)
139
+ claudeFlow: fs.existsSync(claudeFlowPath),
228
140
  };
229
141
  }
230
142
  // Init subcommand (default)
231
- var initAction = function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
232
- var force, minimal, full, skipClaude, onlyClaude, codexMode, dualMode, cwd, initialized, hasExisting, proceed, options, spinner, result, _i, _a, error, summary, startAll, startDaemon, execSync, withEmbeddings, embeddingModel, execSync, error_2;
233
- return __generator(this, function (_b) {
234
- switch (_b.label) {
235
- case 0:
236
- force = ctx.flags.force;
237
- minimal = ctx.flags.minimal;
238
- full = ctx.flags.full;
239
- skipClaude = ctx.flags['skip-claude'];
240
- onlyClaude = ctx.flags['only-claude'];
241
- codexMode = ctx.flags.codex;
242
- dualMode = ctx.flags.dual;
243
- cwd = ctx.cwd;
244
- // If codex mode, use the Codex initializer
245
- if (codexMode || dualMode) {
246
- return [2 /*return*/, initCodexAction(ctx, { codexMode: codexMode, dualMode: dualMode, force: force, minimal: minimal, full: full })];
247
- }
248
- initialized = isInitialized(cwd);
249
- hasExisting = initialized.claude || initialized.claudeFlow;
250
- if (!(hasExisting && !force)) return [3 /*break*/, 3];
251
- output.printWarning('RuFlo appears to be already initialized');
252
- if (initialized.claude)
253
- output.printInfo(' Found: .claude/settings.json');
254
- if (initialized.claudeFlow)
255
- output.printInfo(' Found: .claude-flow/config.yaml');
256
- output.printInfo('Use --force to reinitialize');
257
- if (!ctx.interactive) return [3 /*break*/, 2];
258
- return [4 /*yield*/, confirm({
259
- message: 'Do you want to reinitialize? This will overwrite existing configuration.',
260
- "default": false
261
- })];
262
- case 1:
263
- proceed = _b.sent();
264
- if (!proceed) {
265
- return [2 /*return*/, { success: true, message: 'Initialization cancelled' }];
266
- }
267
- return [3 /*break*/, 3];
268
- case 2: return [2 /*return*/, { success: false, exitCode: 1, message: 'Already initialized' }];
269
- case 3:
270
- output.writeln();
271
- output.writeln(output.bold('Initializing RuFlo V3'));
272
- output.writeln();
273
- if (minimal) {
274
- options = __assign(__assign({}, MINIMAL_INIT_OPTIONS), { targetDir: cwd, force: force });
275
- }
276
- else if (full) {
277
- options = __assign(__assign({}, FULL_INIT_OPTIONS), { targetDir: cwd, force: force });
278
- }
279
- else {
280
- options = __assign(__assign({}, DEFAULT_INIT_OPTIONS), { targetDir: cwd, force: force });
281
- }
282
- // Handle --skip-claude and --only-claude flags
283
- if (skipClaude) {
284
- options.components.settings = false;
285
- options.components.skills = false;
286
- options.components.commands = false;
287
- options.components.agents = false;
288
- options.components.helpers = false;
289
- options.components.statusline = false;
290
- options.components.mcp = false;
291
- options.components.claudeMd = false;
292
- }
293
- if (onlyClaude) {
294
- options.components.runtime = false;
295
- }
296
- spinner = output.createSpinner({ text: 'Initializing...' });
297
- spinner.start();
298
- _b.label = 4;
299
- case 4:
300
- _b.trys.push([4, 10, , 11]);
301
- return [4 /*yield*/, executeInit(options)];
302
- case 5:
303
- result = _b.sent();
304
- if (!result.success) {
305
- spinner.fail('Initialization failed');
306
- for (_i = 0, _a = result.errors; _i < _a.length; _i++) {
307
- error = _a[_i];
308
- output.printError(error);
309
- }
310
- return [2 /*return*/, { success: false, exitCode: 1 }];
311
- }
312
- spinner.succeed('RuFlo V3 initialized successfully!');
313
- output.writeln();
314
- summary = [];
315
- if (result.created.directories.length > 0) {
316
- summary.push("Directories: " + result.created.directories.length + " created");
317
- }
318
- if (result.created.files.length > 0) {
319
- summary.push("Files: " + result.created.files.length + " created");
320
- }
321
- if (result.skipped.length > 0) {
322
- summary.push("Skipped: " + result.skipped.length + " (already exist)");
323
- }
324
- output.printBox(summary.join('\n'), 'Summary');
325
- output.writeln();
326
- // Show what was created
327
- if (options.components.claudeMd || options.components.settings || options.components.skills || options.components.commands || options.components.agents) {
328
- output.printBox([
329
- options.components.claudeMd ? "CLAUDE.md: Swarm guidance & configuration" : '',
330
- options.components.settings ? "Settings: .claude/settings.json" : '',
331
- options.components.skills ? "Skills: .claude/skills/ (" + result.summary.skillsCount + " skills)" : '',
332
- options.components.commands ? "Commands: .claude/commands/ (" + result.summary.commandsCount + " commands)" : '',
333
- options.components.agents ? "Agents: .claude/agents/ (" + result.summary.agentsCount + " agents)" : '',
334
- options.components.helpers ? "Helpers: .claude/helpers/" : '',
335
- options.components.mcp ? "MCP: .mcp.json" : '',
336
- ].filter(Boolean).join('\n'), 'Claude Code Integration');
337
- output.writeln();
338
- }
339
- if (options.components.runtime) {
340
- output.printBox([
341
- "Config: .claude-flow/config.yaml",
342
- "Data: .claude-flow/data/",
343
- "Logs: .claude-flow/logs/",
344
- "Sessions: .claude-flow/sessions/",
345
- ].join('\n'), 'V3 Runtime');
346
- output.writeln();
347
- }
348
- // Hooks summary
349
- if (result.summary.hooksEnabled > 0) {
350
- output.printInfo("Hooks: " + result.summary.hooksEnabled + " hook types enabled in settings.json");
351
- output.writeln();
143
+ const initAction = async (ctx) => {
144
+ const force = ctx.flags.force;
145
+ const minimal = ctx.flags.minimal;
146
+ const full = ctx.flags.full;
147
+ const skipClaude = ctx.flags['skip-claude'];
148
+ const onlyClaude = ctx.flags['only-claude'];
149
+ const codexMode = ctx.flags.codex;
150
+ const dualMode = ctx.flags.dual;
151
+ const cwd = ctx.cwd;
152
+ // If codex mode, use the Codex initializer
153
+ if (codexMode || dualMode) {
154
+ return initCodexAction(ctx, { codexMode, dualMode, force, minimal, full });
155
+ }
156
+ // Check if already initialized
157
+ const initialized = isInitialized(cwd);
158
+ const hasExisting = initialized.claude || initialized.claudeFlow;
159
+ if (hasExisting && !force) {
160
+ output.printWarning('RuFlo appears to be already initialized');
161
+ if (initialized.claude)
162
+ output.printInfo(' Found: .claude/settings.json');
163
+ if (initialized.claudeFlow)
164
+ output.printInfo(' Found: .claude-flow/config.yaml');
165
+ output.printInfo('Use --force to reinitialize');
166
+ if (ctx.interactive) {
167
+ const proceed = await confirm({
168
+ message: 'Do you want to reinitialize? This will overwrite existing configuration.',
169
+ default: false,
170
+ });
171
+ if (!proceed) {
172
+ return { success: true, message: 'Initialization cancelled' };
173
+ }
174
+ }
175
+ else {
176
+ return { success: false, exitCode: 1, message: 'Already initialized' };
177
+ }
178
+ }
179
+ output.writeln();
180
+ output.writeln(output.bold('Initializing RuFlo V3'));
181
+ output.writeln();
182
+ // Build init options based on flags
183
+ let options;
184
+ if (minimal) {
185
+ options = { ...MINIMAL_INIT_OPTIONS, targetDir: cwd, force };
186
+ }
187
+ else if (full) {
188
+ options = { ...FULL_INIT_OPTIONS, targetDir: cwd, force };
189
+ }
190
+ else {
191
+ options = { ...DEFAULT_INIT_OPTIONS, targetDir: cwd, force };
192
+ }
193
+ // Handle --skip-claude and --only-claude flags
194
+ if (skipClaude) {
195
+ options.components.settings = false;
196
+ options.components.skills = false;
197
+ options.components.commands = false;
198
+ options.components.agents = false;
199
+ options.components.helpers = false;
200
+ options.components.statusline = false;
201
+ options.components.mcp = false;
202
+ options.components.claudeMd = false;
203
+ }
204
+ if (onlyClaude) {
205
+ options.components.runtime = false;
206
+ }
207
+ // Create spinner
208
+ const spinner = output.createSpinner({ text: 'Initializing...' });
209
+ spinner.start();
210
+ try {
211
+ // Execute initialization
212
+ const result = await executeInit(options);
213
+ if (!result.success) {
214
+ spinner.fail('Initialization failed');
215
+ for (const error of result.errors) {
216
+ output.printError(error);
217
+ }
218
+ return { success: false, exitCode: 1 };
219
+ }
220
+ spinner.succeed('RuFlo V3 initialized successfully!');
221
+ output.writeln();
222
+ // Display summary
223
+ const summary = [];
224
+ if (result.created.directories.length > 0) {
225
+ summary.push(`Directories: ${result.created.directories.length} created`);
226
+ }
227
+ if (result.created.files.length > 0) {
228
+ summary.push(`Files: ${result.created.files.length} created`);
229
+ }
230
+ if (result.skipped.length > 0) {
231
+ summary.push(`Skipped: ${result.skipped.length} (already exist)`);
232
+ }
233
+ output.printBox(summary.join('\n'), 'Summary');
234
+ output.writeln();
235
+ // Show what was created
236
+ if (options.components.claudeMd || options.components.settings || options.components.skills || options.components.commands || options.components.agents) {
237
+ output.printBox([
238
+ options.components.claudeMd ? `CLAUDE.md: Swarm guidance & configuration` : '',
239
+ options.components.settings ? `Settings: .claude/settings.json` : '',
240
+ options.components.skills ? `Skills: .claude/skills/ (${result.summary.skillsCount} skills)` : '',
241
+ options.components.commands ? `Commands: .claude/commands/ (${result.summary.commandsCount} commands)` : '',
242
+ options.components.agents ? `Agents: .claude/agents/ (${result.summary.agentsCount} agents)` : '',
243
+ options.components.helpers ? `Helpers: .claude/helpers/` : '',
244
+ options.components.mcp ? `MCP: .mcp.json` : '',
245
+ ].filter(Boolean).join('\n'), 'Claude Code Integration');
246
+ output.writeln();
247
+ }
248
+ if (options.components.runtime) {
249
+ output.printBox([
250
+ `Config: .claude-flow/config.yaml`,
251
+ `Data: .claude-flow/data/`,
252
+ `Logs: .claude-flow/logs/`,
253
+ `Sessions: .claude-flow/sessions/`,
254
+ ].join('\n'), 'V3 Runtime');
255
+ output.writeln();
256
+ }
257
+ // Hooks summary
258
+ if (result.summary.hooksEnabled > 0) {
259
+ output.printInfo(`Hooks: ${result.summary.hooksEnabled} hook types enabled in settings.json`);
260
+ output.writeln();
261
+ }
262
+ // Handle --start-all or --start-daemon
263
+ const startAll = ctx.flags['start-all'] || ctx.flags.startAll;
264
+ const startDaemon = ctx.flags['start-daemon'] || ctx.flags.startDaemon || startAll;
265
+ if (startDaemon || startAll) {
266
+ output.writeln();
267
+ output.printInfo('Starting services...');
268
+ const { execSync } = await import('child_process');
269
+ // Initialize memory database
270
+ if (startAll) {
271
+ try {
272
+ output.writeln(output.dim(' Initializing memory database...'));
273
+ execSync('npx @claude-flow/cli@latest memory init 2>/dev/null', {
274
+ stdio: 'pipe',
275
+ cwd: ctx.cwd,
276
+ timeout: 30000
277
+ });
278
+ output.writeln(output.success(' ✓ Memory initialized'));
352
279
  }
353
- startAll = ctx.flags['start-all'] || ctx.flags.startAll;
354
- startDaemon = ctx.flags['start-daemon'] || ctx.flags.startDaemon || startAll;
355
- if (!(startDaemon || startAll)) return [3 /*break*/, 7];
356
- output.writeln();
357
- output.printInfo('Starting services...');
358
- return [4 /*yield*/, import('child_process')];
359
- case 6:
360
- execSync = (_b.sent()).execSync;
361
- // Initialize memory database
362
- if (startAll) {
363
- try {
364
- output.writeln(output.dim(' Initializing memory database...'));
365
- execSync('npx @claude-flow/cli@latest memory init 2>/dev/null', {
366
- stdio: 'pipe',
367
- cwd: ctx.cwd,
368
- timeout: 30000
369
- });
370
- output.writeln(output.success(' ✓ Memory initialized'));
371
- }
372
- catch (_c) {
373
- output.writeln(output.dim(' Memory database already exists'));
374
- }
280
+ catch {
281
+ output.writeln(output.dim(' Memory database already exists'));
375
282
  }
376
- // Start daemon
377
- if (startDaemon) {
378
- try {
379
- output.writeln(output.dim(' Starting daemon...'));
380
- execSync('npx @claude-flow/cli@latest daemon start 2>/dev/null &', {
381
- stdio: 'pipe',
382
- cwd: ctx.cwd,
383
- timeout: 10000
384
- });
385
- output.writeln(output.success(' ✓ Daemon started'));
386
- }
387
- catch (_d) {
388
- output.writeln(output.warning(' Daemon may already be running'));
389
- }
283
+ }
284
+ // Start daemon
285
+ if (startDaemon) {
286
+ try {
287
+ output.writeln(output.dim(' Starting daemon...'));
288
+ execSync('npx @claude-flow/cli@latest daemon start 2>/dev/null &', {
289
+ stdio: 'pipe',
290
+ cwd: ctx.cwd,
291
+ timeout: 10000
292
+ });
293
+ output.writeln(output.success(' ✓ Daemon started'));
390
294
  }
391
- // Initialize swarm
392
- if (startAll) {
393
- try {
394
- output.writeln(output.dim(' Initializing swarm...'));
395
- execSync('npx @claude-flow/cli@latest swarm init --topology hierarchical 2>/dev/null', {
396
- stdio: 'pipe',
397
- cwd: ctx.cwd,
398
- timeout: 30000
399
- });
400
- output.writeln(output.success(' ✓ Swarm initialized'));
401
- }
402
- catch (_e) {
403
- output.writeln(output.dim(' Swarm initialization skipped'));
404
- }
295
+ catch {
296
+ output.writeln(output.warning(' Daemon may already be running'));
405
297
  }
406
- output.writeln();
407
- output.printSuccess('All services started');
408
- _b.label = 7;
409
- case 7:
410
- withEmbeddings = ctx.flags['with-embeddings'] || ctx.flags.withEmbeddings;
411
- embeddingModel = (ctx.flags['embedding-model'] || ctx.flags.embeddingModel || 'all-MiniLM-L6-v2');
412
- if (!withEmbeddings) return [3 /*break*/, 9];
413
- output.writeln();
414
- output.printInfo('Initializing ONNX embedding subsystem...');
415
- return [4 /*yield*/, import('child_process')];
416
- case 8:
417
- execSync = (_b.sent()).execSync;
298
+ }
299
+ // Initialize swarm
300
+ if (startAll) {
418
301
  try {
419
- output.writeln(output.dim(" Model: " + embeddingModel));
420
- output.writeln(output.dim(' Hyperbolic: Enabled (Poincaré ball)'));
421
- execSync("npx @claude-flow/cli@latest embeddings init --model " + embeddingModel + " --no-download --force 2>/dev/null", {
302
+ output.writeln(output.dim(' Initializing swarm...'));
303
+ execSync('npx @claude-flow/cli@latest swarm init --topology hierarchical 2>/dev/null', {
422
304
  stdio: 'pipe',
423
305
  cwd: ctx.cwd,
424
306
  timeout: 30000
425
307
  });
426
- output.writeln(output.success(' ✓ Embeddings initialized'));
427
- output.writeln(output.dim(' Run "embeddings init --download" to download model'));
428
- }
429
- catch (err) {
430
- output.writeln(output.warning(' Embedding initialization skipped (run manually)'));
308
+ output.writeln(output.success(' ✓ Swarm initialized'));
431
309
  }
432
- _b.label = 9;
433
- case 9:
434
- if (!startDaemon && !startAll) {
435
- // Next steps (only if not auto-starting)
436
- output.writeln(output.bold('Next steps:'));
437
- output.printList([
438
- "Run " + output.highlight('claude-flow daemon start') + " to start background workers",
439
- "Run " + output.highlight('claude-flow memory init') + " to initialize memory database",
440
- "Run " + output.highlight('claude-flow swarm init') + " to initialize a swarm",
441
- "Or use " + output.highlight('claude-flow init --start-all') + " to do all of the above",
442
- options.components.settings ? "Review " + output.highlight('.claude/settings.json') + " for hook configurations" : '',
443
- ].filter(Boolean));
310
+ catch {
311
+ output.writeln(output.dim(' Swarm initialization skipped'));
444
312
  }
445
- if (ctx.flags.format === 'json') {
446
- output.printJson(result);
447
- }
448
- return [2 /*return*/, { success: true, data: result }];
449
- case 10:
450
- error_2 = _b.sent();
451
- spinner.fail('Initialization failed');
452
- output.printError("Failed to initialize: " + (error_2 instanceof Error ? error_2.message : String(error_2)));
453
- return [2 /*return*/, { success: false, exitCode: 1 }];
454
- case 11: return [2 /*return*/];
313
+ }
314
+ output.writeln();
315
+ output.printSuccess('All services started');
316
+ }
317
+ // Handle --with-embeddings
318
+ const withEmbeddings = ctx.flags['with-embeddings'] || ctx.flags.withEmbeddings;
319
+ const embeddingModel = (ctx.flags['embedding-model'] || ctx.flags.embeddingModel || 'all-MiniLM-L6-v2');
320
+ if (withEmbeddings) {
321
+ output.writeln();
322
+ output.printInfo('Initializing ONNX embedding subsystem...');
323
+ const { execSync } = await import('child_process');
324
+ try {
325
+ output.writeln(output.dim(` Model: ${embeddingModel}`));
326
+ output.writeln(output.dim(' Hyperbolic: Enabled (Poincaré ball)'));
327
+ execSync(`npx @claude-flow/cli@latest embeddings init --model ${embeddingModel} --no-download --force 2>/dev/null`, {
328
+ stdio: 'pipe',
329
+ cwd: ctx.cwd,
330
+ timeout: 30000
331
+ });
332
+ output.writeln(output.success(' ✓ Embeddings initialized'));
333
+ output.writeln(output.dim(' Run "embeddings init --download" to download model'));
334
+ }
335
+ catch (err) {
336
+ output.writeln(output.warning(' Embedding initialization skipped (run manually)'));
337
+ }
338
+ }
339
+ if (!startDaemon && !startAll) {
340
+ // Next steps (only if not auto-starting)
341
+ output.writeln(output.bold('Next steps:'));
342
+ output.printList([
343
+ `Run ${output.highlight('claude-flow daemon start')} to start background workers`,
344
+ `Run ${output.highlight('claude-flow memory init')} to initialize memory database`,
345
+ `Run ${output.highlight('claude-flow swarm init')} to initialize a swarm`,
346
+ `Or use ${output.highlight('claude-flow init --start-all')} to do all of the above`,
347
+ options.components.settings ? `Review ${output.highlight('.claude/settings.json')} for hook configurations` : '',
348
+ ].filter(Boolean));
349
+ }
350
+ if (ctx.flags.format === 'json') {
351
+ output.printJson(result);
455
352
  }
456
- });
457
- }); };
353
+ return { success: true, data: result };
354
+ }
355
+ catch (error) {
356
+ spinner.fail('Initialization failed');
357
+ output.printError(`Failed to initialize: ${error instanceof Error ? error.message : String(error)}`);
358
+ return { success: false, exitCode: 1 };
359
+ }
360
+ };
458
361
  // Wizard subcommand for interactive setup
459
- var wizardCommand = {
362
+ const wizardCommand = {
460
363
  name: 'wizard',
461
364
  description: 'Interactive setup wizard for comprehensive configuration',
462
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
463
- var options, preset, components, skillSets, hooks, topology, maxAgents, memoryBackend, enableHNSW, enableNeural, enableSelfLearning, enableEmbeddings, embeddingModel, spinner, result, _i, _a, error, embeddingsInitialized, execSync, error_3;
464
- return __generator(this, function (_b) {
465
- switch (_b.label) {
466
- case 0:
467
- output.writeln();
468
- output.writeln(output.bold('RuFlo V3 Setup Wizard'));
469
- output.writeln(output.dim('Answer questions to configure your project'));
470
- output.writeln();
471
- _b.label = 1;
472
- case 1:
473
- _b.trys.push([1, 25, , 26]);
474
- options = __assign(__assign({}, DEFAULT_INIT_OPTIONS), { targetDir: ctx.cwd });
475
- return [4 /*yield*/, select({
476
- message: 'Select configuration preset:',
477
- options: [
478
- { value: 'default', label: 'Default', hint: 'Recommended settings for most projects' },
479
- { value: 'minimal', label: 'Minimal', hint: 'Core features only' },
480
- { value: 'full', label: 'Full', hint: 'All features enabled' },
481
- { value: 'custom', label: 'Custom', hint: 'Choose each component' },
482
- ]
483
- })];
484
- case 2:
485
- preset = _b.sent();
486
- if (!(preset === 'minimal')) return [3 /*break*/, 3];
487
- Object.assign(options, MINIMAL_INIT_OPTIONS);
488
- options.targetDir = ctx.cwd;
489
- return [3 /*break*/, 9];
490
- case 3:
491
- if (!(preset === 'full')) return [3 /*break*/, 4];
492
- Object.assign(options, FULL_INIT_OPTIONS);
493
- options.targetDir = ctx.cwd;
494
- return [3 /*break*/, 9];
495
- case 4:
496
- if (!(preset === 'custom')) return [3 /*break*/, 9];
497
- return [4 /*yield*/, multiSelect({
498
- message: 'Select components to initialize:',
499
- options: [
500
- { value: 'claudeMd', label: 'CLAUDE.md', hint: 'Swarm guidance and project configuration', selected: true },
501
- { value: 'settings', label: 'settings.json', hint: 'Claude Code hooks configuration', selected: true },
502
- { value: 'skills', label: 'Skills', hint: 'Claude Code skills in .claude/skills/', selected: true },
503
- { value: 'commands', label: 'Commands', hint: 'Claude Code commands in .claude/commands/', selected: true },
504
- { value: 'agents', label: 'Agents', hint: 'Agent definitions in .claude/agents/', selected: true },
505
- { value: 'helpers', label: 'Helpers', hint: 'Utility scripts in .claude/helpers/', selected: true },
506
- { value: 'statusline', label: 'Statusline', hint: 'Shell statusline integration', selected: false },
507
- { value: 'mcp', label: 'MCP', hint: '.mcp.json for MCP server configuration', selected: true },
508
- { value: 'runtime', label: 'Runtime', hint: '.claude-flow/ directory for V3 runtime', selected: true },
509
- ]
510
- })];
511
- case 5:
512
- components = _b.sent();
513
- options.components.claudeMd = components.includes('claudeMd');
514
- options.components.settings = components.includes('settings');
515
- options.components.skills = components.includes('skills');
516
- options.components.commands = components.includes('commands');
517
- options.components.agents = components.includes('agents');
518
- options.components.helpers = components.includes('helpers');
519
- options.components.statusline = components.includes('statusline');
520
- options.components.mcp = components.includes('mcp');
521
- options.components.runtime = components.includes('runtime');
522
- if (!options.components.skills) return [3 /*break*/, 7];
523
- return [4 /*yield*/, multiSelect({
524
- message: 'Select skill sets:',
525
- options: [
526
- { value: 'core', label: 'Core', hint: 'Swarm, memory, SPARC skills', selected: true },
527
- { value: 'agentdb', label: 'AgentDB', hint: 'Vector database skills', selected: true },
528
- { value: 'github', label: 'GitHub', hint: 'GitHub integration skills', selected: true },
529
- { value: 'flowNexus', label: 'Flow Nexus', hint: 'Cloud platform skills', selected: false },
530
- { value: 'v3', label: 'V3', hint: 'V3 implementation skills', selected: true },
531
- ]
532
- })];
533
- case 6:
534
- skillSets = _b.sent();
365
+ action: async (ctx) => {
366
+ output.writeln();
367
+ output.writeln(output.bold('RuFlo V3 Setup Wizard'));
368
+ output.writeln(output.dim('Answer questions to configure your project'));
369
+ output.writeln();
370
+ try {
371
+ // Start with base options
372
+ const options = { ...DEFAULT_INIT_OPTIONS, targetDir: ctx.cwd };
373
+ // Configuration preset
374
+ const preset = await select({
375
+ message: 'Select configuration preset:',
376
+ options: [
377
+ { value: 'default', label: 'Default', hint: 'Recommended settings for most projects' },
378
+ { value: 'minimal', label: 'Minimal', hint: 'Core features only' },
379
+ { value: 'full', label: 'Full', hint: 'All features enabled' },
380
+ { value: 'custom', label: 'Custom', hint: 'Choose each component' },
381
+ ],
382
+ });
383
+ if (preset === 'minimal') {
384
+ Object.assign(options, MINIMAL_INIT_OPTIONS);
385
+ options.targetDir = ctx.cwd;
386
+ }
387
+ else if (preset === 'full') {
388
+ Object.assign(options, FULL_INIT_OPTIONS);
389
+ options.targetDir = ctx.cwd;
390
+ }
391
+ else if (preset === 'custom') {
392
+ // Component selection
393
+ const components = await multiSelect({
394
+ message: 'Select components to initialize:',
395
+ options: [
396
+ { value: 'claudeMd', label: 'CLAUDE.md', hint: 'Swarm guidance and project configuration', selected: true },
397
+ { value: 'settings', label: 'settings.json', hint: 'Claude Code hooks configuration', selected: true },
398
+ { value: 'skills', label: 'Skills', hint: 'Claude Code skills in .claude/skills/', selected: true },
399
+ { value: 'commands', label: 'Commands', hint: 'Claude Code commands in .claude/commands/', selected: true },
400
+ { value: 'agents', label: 'Agents', hint: 'Agent definitions in .claude/agents/', selected: true },
401
+ { value: 'helpers', label: 'Helpers', hint: 'Utility scripts in .claude/helpers/', selected: true },
402
+ { value: 'statusline', label: 'Statusline', hint: 'Shell statusline integration', selected: false },
403
+ { value: 'mcp', label: 'MCP', hint: '.mcp.json for MCP server configuration', selected: true },
404
+ { value: 'runtime', label: 'Runtime', hint: '.claude-flow/ directory for V3 runtime', selected: true },
405
+ ],
406
+ });
407
+ options.components.claudeMd = components.includes('claudeMd');
408
+ options.components.settings = components.includes('settings');
409
+ options.components.skills = components.includes('skills');
410
+ options.components.commands = components.includes('commands');
411
+ options.components.agents = components.includes('agents');
412
+ options.components.helpers = components.includes('helpers');
413
+ options.components.statusline = components.includes('statusline');
414
+ options.components.mcp = components.includes('mcp');
415
+ options.components.runtime = components.includes('runtime');
416
+ // Skills selection
417
+ if (options.components.skills) {
418
+ const skillSets = await multiSelect({
419
+ message: 'Select skill sets:',
420
+ options: [
421
+ { value: 'core', label: 'Core', hint: 'Swarm, memory, SPARC skills', selected: true },
422
+ { value: 'agentdb', label: 'AgentDB', hint: 'Vector database skills', selected: true },
423
+ { value: 'github', label: 'GitHub', hint: 'GitHub integration skills', selected: true },
424
+ { value: 'flowNexus', label: 'Flow Nexus', hint: 'Cloud platform skills', selected: false },
425
+ { value: 'v3', label: 'V3', hint: 'V3 implementation skills', selected: true },
426
+ ],
427
+ });
535
428
  options.skills.core = skillSets.includes('core');
536
429
  options.skills.agentdb = skillSets.includes('agentdb');
537
430
  options.skills.github = skillSets.includes('github');
538
431
  options.skills.flowNexus = skillSets.includes('flowNexus');
539
432
  options.skills.v3 = skillSets.includes('v3');
540
- _b.label = 7;
541
- case 7:
542
- if (!options.components.settings) return [3 /*break*/, 9];
543
- return [4 /*yield*/, multiSelect({
544
- message: 'Select hooks to enable:',
545
- options: [
546
- { value: 'preToolUse', label: 'PreToolUse', hint: 'Before tool execution', selected: true },
547
- { value: 'postToolUse', label: 'PostToolUse', hint: 'After tool execution', selected: true },
548
- { value: 'userPromptSubmit', label: 'UserPromptSubmit', hint: 'Task routing', selected: true },
549
- { value: 'sessionStart', label: 'SessionStart', hint: 'Session initialization', selected: true },
550
- { value: 'stop', label: 'Stop', hint: 'Task completion evaluation', selected: true },
551
- { value: 'notification', label: 'Notification', hint: 'Swarm notifications', selected: true },
552
- { value: 'permissionRequest', label: 'PermissionRequest', hint: 'Auto-allow claude-flow tools', selected: true },
553
- ]
554
- })];
555
- case 8:
556
- hooks = _b.sent();
433
+ }
434
+ // Hooks selection
435
+ if (options.components.settings) {
436
+ const hooks = await multiSelect({
437
+ message: 'Select hooks to enable:',
438
+ options: [
439
+ { value: 'preToolUse', label: 'PreToolUse', hint: 'Before tool execution', selected: true },
440
+ { value: 'postToolUse', label: 'PostToolUse', hint: 'After tool execution', selected: true },
441
+ { value: 'userPromptSubmit', label: 'UserPromptSubmit', hint: 'Task routing', selected: true },
442
+ { value: 'sessionStart', label: 'SessionStart', hint: 'Session initialization', selected: true },
443
+ { value: 'stop', label: 'Stop', hint: 'Task completion evaluation', selected: true },
444
+ { value: 'notification', label: 'Notification', hint: 'Swarm notifications', selected: true },
445
+ { value: 'permissionRequest', label: 'PermissionRequest', hint: 'Auto-allow claude-flow tools', selected: true },
446
+ ],
447
+ });
557
448
  options.hooks.preToolUse = hooks.includes('preToolUse');
558
449
  options.hooks.postToolUse = hooks.includes('postToolUse');
559
450
  options.hooks.userPromptSubmit = hooks.includes('userPromptSubmit');
560
451
  options.hooks.sessionStart = hooks.includes('sessionStart');
561
452
  options.hooks.stop = hooks.includes('stop');
562
453
  options.hooks.notification = hooks.includes('notification');
563
- _b.label = 9;
564
- case 9: return [4 /*yield*/, select({
565
- message: 'Select swarm topology:',
566
- options: [
567
- { value: 'hierarchical-mesh', label: 'Hierarchical Mesh', hint: 'Best for complex projects (recommended)' },
568
- { value: 'mesh', label: 'Mesh', hint: 'Peer-to-peer coordination' },
569
- { value: 'hierarchical', label: 'Hierarchical', hint: 'Tree-based coordination' },
570
- { value: 'adaptive', label: 'Adaptive', hint: 'Dynamic topology switching' },
571
- ]
572
- })];
573
- case 10:
574
- topology = _b.sent();
575
- options.runtime.topology = topology;
576
- return [4 /*yield*/, input({
577
- message: 'Maximum concurrent agents:',
578
- "default": String(options.runtime.maxAgents),
579
- validate: function (v) {
580
- var n = parseInt(v);
581
- return (!isNaN(n) && n > 0 && n <= 50) || 'Enter a number between 1 and 50';
582
- }
583
- })];
584
- case 11:
585
- maxAgents = _b.sent();
586
- options.runtime.maxAgents = parseInt(maxAgents);
587
- return [4 /*yield*/, select({
588
- message: 'Select memory backend:',
589
- options: [
590
- { value: 'hybrid', label: 'Hybrid', hint: 'SQLite + AgentDB (recommended)' },
591
- { value: 'agentdb', label: 'AgentDB', hint: '150x faster vector search' },
592
- { value: 'sqlite', label: 'SQLite', hint: 'Standard SQL storage' },
593
- { value: 'memory', label: 'In-Memory', hint: 'Fast but non-persistent' },
594
- ]
595
- })];
596
- case 12:
597
- memoryBackend = _b.sent();
598
- options.runtime.memoryBackend = memoryBackend;
599
- if (!(memoryBackend === 'agentdb' || memoryBackend === 'hybrid')) return [3 /*break*/, 14];
600
- return [4 /*yield*/, confirm({
601
- message: 'Enable HNSW indexing for faster vector search?',
602
- "default": true
603
- })];
604
- case 13:
605
- enableHNSW = _b.sent();
606
- options.runtime.enableHNSW = enableHNSW;
607
- _b.label = 14;
608
- case 14: return [4 /*yield*/, confirm({
609
- message: 'Enable neural pattern learning?',
610
- "default": options.runtime.enableNeural
611
- })];
612
- case 15:
613
- enableNeural = _b.sent();
614
- options.runtime.enableNeural = enableNeural;
615
- if (!(memoryBackend === 'agentdb' || memoryBackend === 'hybrid')) return [3 /*break*/, 17];
616
- return [4 /*yield*/, confirm({
617
- message: 'Enable self-learning memory? (LearningBridge + Knowledge Graph + Agent Scopes)',
618
- "default": true
619
- })];
620
- case 16:
621
- enableSelfLearning = _b.sent();
622
- options.runtime.enableLearningBridge = enableSelfLearning && enableNeural;
623
- options.runtime.enableMemoryGraph = enableSelfLearning;
624
- options.runtime.enableAgentScopes = enableSelfLearning;
625
- return [3 /*break*/, 18];
626
- case 17:
627
- options.runtime.enableLearningBridge = false;
628
- options.runtime.enableMemoryGraph = false;
629
- options.runtime.enableAgentScopes = false;
630
- _b.label = 18;
631
- case 18: return [4 /*yield*/, confirm({
632
- message: 'Enable ONNX embedding system with hyperbolic support?',
633
- "default": true
634
- })];
635
- case 19:
636
- enableEmbeddings = _b.sent();
637
- embeddingModel = 'all-MiniLM-L6-v2';
638
- if (!enableEmbeddings) return [3 /*break*/, 21];
639
- return [4 /*yield*/, select({
640
- message: 'Select embedding model:',
641
- options: [
642
- { value: 'all-MiniLM-L6-v2', label: 'MiniLM L6 (384d)', hint: 'Fast, good quality (recommended)' },
643
- { value: 'all-mpnet-base-v2', label: 'MPNet Base (768d)', hint: 'Higher quality, more memory' },
644
- ]
645
- })];
646
- case 20:
647
- embeddingModel = _b.sent();
648
- _b.label = 21;
649
- case 21:
650
- // Execute initialization
651
- output.writeln();
652
- spinner = output.createSpinner({ text: 'Initializing...' });
653
- spinner.start();
654
- return [4 /*yield*/, executeInit(options)];
655
- case 22:
656
- result = _b.sent();
657
- if (!result.success) {
658
- spinner.fail('Initialization failed');
659
- for (_i = 0, _a = result.errors; _i < _a.length; _i++) {
660
- error = _a[_i];
661
- output.printError(error);
662
- }
663
- return [2 /*return*/, { success: false, exitCode: 1 }];
664
- }
665
- spinner.succeed('Setup complete!');
666
- embeddingsInitialized = false;
667
- if (!enableEmbeddings) return [3 /*break*/, 24];
668
- output.writeln();
669
- output.printInfo('Initializing ONNX embedding subsystem...');
670
- return [4 /*yield*/, import('child_process')];
671
- case 23:
672
- execSync = (_b.sent()).execSync;
673
- try {
674
- execSync("npx @claude-flow/cli@latest embeddings init --model " + embeddingModel + " --no-download --force 2>/dev/null", {
675
- stdio: 'pipe',
676
- cwd: ctx.cwd,
677
- timeout: 30000
678
- });
679
- output.writeln(output.success(' ✓ Embeddings configured'));
680
- embeddingsInitialized = true;
681
- }
682
- catch (_c) {
683
- output.writeln(output.dim(' Embeddings will be configured on first use'));
684
- }
685
- _b.label = 24;
686
- case 24:
687
- output.writeln();
688
- // Summary table
689
- output.printTable({
690
- columns: [
691
- { key: 'setting', header: 'Setting', width: 20 },
692
- { key: 'value', header: 'Value', width: 40 },
693
- ],
694
- data: [
695
- { setting: 'Preset', value: preset },
696
- { setting: 'Topology', value: options.runtime.topology },
697
- { setting: 'Max Agents', value: String(options.runtime.maxAgents) },
698
- { setting: 'Memory Backend', value: options.runtime.memoryBackend },
699
- { setting: 'HNSW Indexing', value: options.runtime.enableHNSW ? 'Enabled' : 'Disabled' },
700
- { setting: 'Neural Learning', value: options.runtime.enableNeural ? 'Enabled' : 'Disabled' },
701
- { setting: 'Self-Learning', value: options.runtime.enableLearningBridge ? 'LearningBridge + Graph + Scopes' : 'Disabled' },
702
- { setting: 'Embeddings', value: enableEmbeddings ? embeddingModel + " (hyperbolic)" : 'Disabled' },
703
- { setting: 'Skills', value: result.summary.skillsCount + " installed" },
704
- { setting: 'Commands', value: result.summary.commandsCount + " installed" },
705
- { setting: 'Agents', value: result.summary.agentsCount + " installed" },
706
- { setting: 'Hooks', value: result.summary.hooksEnabled + " enabled" },
707
- ]
454
+ }
455
+ }
456
+ // Swarm topology (for all presets)
457
+ const topology = await select({
458
+ message: 'Select swarm topology:',
459
+ options: [
460
+ { value: 'hierarchical-mesh', label: 'Hierarchical Mesh', hint: 'Best for complex projects (recommended)' },
461
+ { value: 'mesh', label: 'Mesh', hint: 'Peer-to-peer coordination' },
462
+ { value: 'hierarchical', label: 'Hierarchical', hint: 'Tree-based coordination' },
463
+ { value: 'adaptive', label: 'Adaptive', hint: 'Dynamic topology switching' },
464
+ ],
465
+ });
466
+ options.runtime.topology = topology;
467
+ // Max agents
468
+ const maxAgents = await input({
469
+ message: 'Maximum concurrent agents:',
470
+ default: String(options.runtime.maxAgents),
471
+ validate: (v) => {
472
+ const n = parseInt(v);
473
+ return (!isNaN(n) && n > 0 && n <= 50) || 'Enter a number between 1 and 50';
474
+ },
475
+ });
476
+ options.runtime.maxAgents = parseInt(maxAgents);
477
+ // Memory backend
478
+ const memoryBackend = await select({
479
+ message: 'Select memory backend:',
480
+ options: [
481
+ { value: 'hybrid', label: 'Hybrid', hint: 'SQLite + AgentDB (recommended)' },
482
+ { value: 'agentdb', label: 'AgentDB', hint: '150x faster vector search' },
483
+ { value: 'sqlite', label: 'SQLite', hint: 'Standard SQL storage' },
484
+ { value: 'memory', label: 'In-Memory', hint: 'Fast but non-persistent' },
485
+ ],
486
+ });
487
+ options.runtime.memoryBackend = memoryBackend;
488
+ // HNSW indexing
489
+ if (memoryBackend === 'agentdb' || memoryBackend === 'hybrid') {
490
+ const enableHNSW = await confirm({
491
+ message: 'Enable HNSW indexing for faster vector search?',
492
+ default: true,
493
+ });
494
+ options.runtime.enableHNSW = enableHNSW;
495
+ }
496
+ // Neural learning
497
+ const enableNeural = await confirm({
498
+ message: 'Enable neural pattern learning?',
499
+ default: options.runtime.enableNeural,
500
+ });
501
+ options.runtime.enableNeural = enableNeural;
502
+ // ADR-049: Self-Learning Memory capabilities
503
+ if (memoryBackend === 'agentdb' || memoryBackend === 'hybrid') {
504
+ const enableSelfLearning = await confirm({
505
+ message: 'Enable self-learning memory? (LearningBridge + Knowledge Graph + Agent Scopes)',
506
+ default: true,
507
+ });
508
+ options.runtime.enableLearningBridge = enableSelfLearning && enableNeural;
509
+ options.runtime.enableMemoryGraph = enableSelfLearning;
510
+ options.runtime.enableAgentScopes = enableSelfLearning;
511
+ }
512
+ else {
513
+ options.runtime.enableLearningBridge = false;
514
+ options.runtime.enableMemoryGraph = false;
515
+ options.runtime.enableAgentScopes = false;
516
+ }
517
+ // Embeddings configuration
518
+ const enableEmbeddings = await confirm({
519
+ message: 'Enable ONNX embedding system with hyperbolic support?',
520
+ default: true,
521
+ });
522
+ let embeddingModel = 'all-MiniLM-L6-v2';
523
+ if (enableEmbeddings) {
524
+ embeddingModel = await select({
525
+ message: 'Select embedding model:',
526
+ options: [
527
+ { value: 'all-MiniLM-L6-v2', label: 'MiniLM L6 (384d)', hint: 'Fast, good quality (recommended)' },
528
+ { value: 'all-mpnet-base-v2', label: 'MPNet Base (768d)', hint: 'Higher quality, more memory' },
529
+ ],
530
+ });
531
+ }
532
+ // Execute initialization
533
+ output.writeln();
534
+ const spinner = output.createSpinner({ text: 'Initializing...' });
535
+ spinner.start();
536
+ const result = await executeInit(options);
537
+ if (!result.success) {
538
+ spinner.fail('Initialization failed');
539
+ for (const error of result.errors) {
540
+ output.printError(error);
541
+ }
542
+ return { success: false, exitCode: 1 };
543
+ }
544
+ spinner.succeed('Setup complete!');
545
+ // Initialize embeddings if enabled
546
+ let embeddingsInitialized = false;
547
+ if (enableEmbeddings) {
548
+ output.writeln();
549
+ output.printInfo('Initializing ONNX embedding subsystem...');
550
+ const { execSync } = await import('child_process');
551
+ try {
552
+ execSync(`npx @claude-flow/cli@latest embeddings init --model ${embeddingModel} --no-download --force 2>/dev/null`, {
553
+ stdio: 'pipe',
554
+ cwd: ctx.cwd,
555
+ timeout: 30000
708
556
  });
709
- return [2 /*return*/, { success: true, data: result }];
710
- case 25:
711
- error_3 = _b.sent();
712
- if (error_3 instanceof Error && error_3.message === 'User cancelled') {
713
- output.printInfo('Setup cancelled');
714
- return [2 /*return*/, { success: true }];
715
- }
716
- throw error_3;
717
- case 26: return [2 /*return*/];
557
+ output.writeln(output.success(' ✓ Embeddings configured'));
558
+ embeddingsInitialized = true;
559
+ }
560
+ catch {
561
+ output.writeln(output.dim(' Embeddings will be configured on first use'));
562
+ }
718
563
  }
719
- });
720
- }); }
564
+ output.writeln();
565
+ // Summary table
566
+ output.printTable({
567
+ columns: [
568
+ { key: 'setting', header: 'Setting', width: 20 },
569
+ { key: 'value', header: 'Value', width: 40 },
570
+ ],
571
+ data: [
572
+ { setting: 'Preset', value: preset },
573
+ { setting: 'Topology', value: options.runtime.topology },
574
+ { setting: 'Max Agents', value: String(options.runtime.maxAgents) },
575
+ { setting: 'Memory Backend', value: options.runtime.memoryBackend },
576
+ { setting: 'HNSW Indexing', value: options.runtime.enableHNSW ? 'Enabled' : 'Disabled' },
577
+ { setting: 'Neural Learning', value: options.runtime.enableNeural ? 'Enabled' : 'Disabled' },
578
+ { setting: 'Self-Learning', value: options.runtime.enableLearningBridge ? 'LearningBridge + Graph + Scopes' : 'Disabled' },
579
+ { setting: 'Embeddings', value: enableEmbeddings ? `${embeddingModel} (hyperbolic)` : 'Disabled' },
580
+ { setting: 'Skills', value: `${result.summary.skillsCount} installed` },
581
+ { setting: 'Commands', value: `${result.summary.commandsCount} installed` },
582
+ { setting: 'Agents', value: `${result.summary.agentsCount} installed` },
583
+ { setting: 'Hooks', value: `${result.summary.hooksEnabled} enabled` },
584
+ ],
585
+ });
586
+ return { success: true, data: result };
587
+ }
588
+ catch (error) {
589
+ if (error instanceof Error && error.message === 'User cancelled') {
590
+ output.printInfo('Setup cancelled');
591
+ return { success: true };
592
+ }
593
+ throw error;
594
+ }
595
+ },
721
596
  };
722
597
  // Check subcommand
723
- var checkCommand = {
598
+ const checkCommand = {
724
599
  name: 'check',
725
600
  description: 'Check if RuFlo is initialized',
726
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
727
- var initialized, result;
728
- return __generator(this, function (_a) {
729
- initialized = isInitialized(ctx.cwd);
730
- result = {
731
- initialized: initialized.claude || initialized.claudeFlow,
732
- claude: initialized.claude,
733
- claudeFlow: initialized.claudeFlow,
734
- paths: {
735
- claudeSettings: initialized.claude ? path.join(ctx.cwd, '.claude', 'settings.json') : null,
736
- claudeFlowConfig: initialized.claudeFlow ? path.join(ctx.cwd, '.claude-flow', 'config.yaml') : null
737
- }
738
- };
739
- if (ctx.flags.format === 'json') {
740
- output.printJson(result);
741
- return [2 /*return*/, { success: true, data: result }];
742
- }
743
- if (result.initialized) {
744
- output.printSuccess('RuFlo is initialized');
745
- if (initialized.claude) {
746
- output.printInfo(" Claude Code: .claude/settings.json");
747
- }
748
- if (initialized.claudeFlow) {
749
- output.printInfo(" V3 Runtime: .claude-flow/config.yaml");
750
- }
601
+ action: async (ctx) => {
602
+ const initialized = isInitialized(ctx.cwd);
603
+ const result = {
604
+ initialized: initialized.claude || initialized.claudeFlow,
605
+ claude: initialized.claude,
606
+ claudeFlow: initialized.claudeFlow,
607
+ paths: {
608
+ claudeSettings: initialized.claude ? path.join(ctx.cwd, '.claude', 'settings.json') : null,
609
+ claudeFlowConfig: initialized.claudeFlow ? path.join(ctx.cwd, '.claude-flow', 'config.yaml') : null,
610
+ },
611
+ };
612
+ if (ctx.flags.format === 'json') {
613
+ output.printJson(result);
614
+ return { success: true, data: result };
615
+ }
616
+ if (result.initialized) {
617
+ output.printSuccess('RuFlo is initialized');
618
+ if (initialized.claude) {
619
+ output.printInfo(` Claude Code: .claude/settings.json`);
751
620
  }
752
- else {
753
- output.printWarning('RuFlo is not initialized in this directory');
754
- output.printInfo('Run "ruflo init" to initialize');
621
+ if (initialized.claudeFlow) {
622
+ output.printInfo(` V3 Runtime: .claude-flow/config.yaml`);
755
623
  }
756
- return [2 /*return*/, { success: true, data: result }];
757
- });
758
- }); }
624
+ }
625
+ else {
626
+ output.printWarning('RuFlo is not initialized in this directory');
627
+ output.printInfo('Run "ruflo init" to initialize');
628
+ }
629
+ return { success: true, data: result };
630
+ },
759
631
  };
760
632
  // Skills subcommand
761
- var skillsCommand = {
633
+ const skillsCommand = {
762
634
  name: 'skills',
763
635
  description: 'Initialize only skills',
764
636
  options: [
765
- { name: 'all', description: 'Install all skills', type: 'boolean', "default": false },
766
- { name: 'core', description: 'Install core skills', type: 'boolean', "default": true },
767
- { name: 'agentdb', description: 'Install AgentDB skills', type: 'boolean', "default": false },
768
- { name: 'github', description: 'Install GitHub skills', type: 'boolean', "default": false },
769
- { name: 'v3', description: 'Install V3 skills', type: 'boolean', "default": false },
637
+ { name: 'all', description: 'Install all skills', type: 'boolean', default: false },
638
+ { name: 'core', description: 'Install core skills', type: 'boolean', default: true },
639
+ { name: 'agentdb', description: 'Install AgentDB skills', type: 'boolean', default: false },
640
+ { name: 'github', description: 'Install GitHub skills', type: 'boolean', default: false },
641
+ { name: 'v3', description: 'Install V3 skills', type: 'boolean', default: false },
770
642
  ],
771
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
772
- var options, spinner, result, _i, _a, error;
773
- return __generator(this, function (_b) {
774
- switch (_b.label) {
775
- case 0:
776
- options = __assign(__assign({}, MINIMAL_INIT_OPTIONS), { targetDir: ctx.cwd, force: ctx.flags.force, components: {
777
- settings: false,
778
- skills: true,
779
- commands: false,
780
- agents: false,
781
- helpers: false,
782
- statusline: false,
783
- mcp: false,
784
- runtime: false,
785
- claudeMd: false
786
- }, skills: {
787
- all: ctx.flags.all,
788
- core: ctx.flags.core,
789
- agentdb: ctx.flags.agentdb,
790
- github: ctx.flags.github,
791
- flowNexus: false,
792
- browser: false,
793
- v3: ctx.flags.v3,
794
- dualMode: false
795
- } });
796
- spinner = output.createSpinner({ text: 'Installing skills...' });
797
- spinner.start();
798
- return [4 /*yield*/, executeInit(options)];
799
- case 1:
800
- result = _b.sent();
801
- if (result.success) {
802
- spinner.succeed("Installed " + result.summary.skillsCount + " skills");
803
- }
804
- else {
805
- spinner.fail('Failed to install skills');
806
- for (_i = 0, _a = result.errors; _i < _a.length; _i++) {
807
- error = _a[_i];
808
- output.printError(error);
809
- }
810
- }
811
- return [2 /*return*/, { success: result.success, data: result }];
643
+ action: async (ctx) => {
644
+ const options = {
645
+ ...MINIMAL_INIT_OPTIONS,
646
+ targetDir: ctx.cwd,
647
+ force: ctx.flags.force,
648
+ components: {
649
+ settings: false,
650
+ skills: true,
651
+ commands: false,
652
+ agents: false,
653
+ helpers: false,
654
+ statusline: false,
655
+ mcp: false,
656
+ runtime: false,
657
+ claudeMd: false,
658
+ },
659
+ skills: {
660
+ all: ctx.flags.all,
661
+ core: ctx.flags.core,
662
+ agentdb: ctx.flags.agentdb,
663
+ github: ctx.flags.github,
664
+ flowNexus: false,
665
+ browser: false,
666
+ v3: ctx.flags.v3,
667
+ dualMode: false,
668
+ },
669
+ };
670
+ const spinner = output.createSpinner({ text: 'Installing skills...' });
671
+ spinner.start();
672
+ const result = await executeInit(options);
673
+ if (result.success) {
674
+ spinner.succeed(`Installed ${result.summary.skillsCount} skills`);
675
+ }
676
+ else {
677
+ spinner.fail('Failed to install skills');
678
+ for (const error of result.errors) {
679
+ output.printError(error);
812
680
  }
813
- });
814
- }); }
681
+ }
682
+ return { success: result.success, data: result };
683
+ },
815
684
  };
816
685
  // Hooks subcommand
817
- var hooksCommand = {
686
+ const hooksCommand = {
818
687
  name: 'hooks',
819
688
  description: 'Initialize only hooks configuration',
820
689
  options: [
821
- { name: 'all', description: 'Enable all hooks', type: 'boolean', "default": true },
822
- { name: 'minimal', description: 'Enable only essential hooks', type: 'boolean', "default": false },
690
+ { name: 'all', description: 'Enable all hooks', type: 'boolean', default: true },
691
+ { name: 'minimal', description: 'Enable only essential hooks', type: 'boolean', default: false },
823
692
  ],
824
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
825
- var minimal, options, spinner, result, _i, _a, error;
826
- return __generator(this, function (_b) {
827
- switch (_b.label) {
828
- case 0:
829
- minimal = ctx.flags.minimal;
830
- options = __assign(__assign({}, DEFAULT_INIT_OPTIONS), { targetDir: ctx.cwd, force: ctx.flags.force, components: {
831
- settings: true,
832
- skills: false,
833
- commands: false,
834
- agents: false,
835
- helpers: false,
836
- statusline: false,
837
- mcp: false,
838
- runtime: false,
839
- claudeMd: false
840
- }, hooks: minimal
841
- ? {
842
- preToolUse: true,
843
- postToolUse: true,
844
- userPromptSubmit: false,
845
- sessionStart: false,
846
- stop: false,
847
- preCompact: false,
848
- notification: false,
849
- teammateIdle: false,
850
- taskCompleted: false,
851
- timeout: 5000,
852
- continueOnError: true
853
- }
854
- : DEFAULT_INIT_OPTIONS.hooks });
855
- spinner = output.createSpinner({ text: 'Creating hooks configuration...' });
856
- spinner.start();
857
- return [4 /*yield*/, executeInit(options)];
858
- case 1:
859
- result = _b.sent();
860
- if (result.success) {
861
- spinner.succeed("Created settings.json with " + result.summary.hooksEnabled + " hooks enabled");
862
- }
863
- else {
864
- spinner.fail('Failed to create hooks configuration');
865
- for (_i = 0, _a = result.errors; _i < _a.length; _i++) {
866
- error = _a[_i];
867
- output.printError(error);
868
- }
869
- }
870
- return [2 /*return*/, { success: result.success, data: result }];
693
+ action: async (ctx) => {
694
+ const minimal = ctx.flags.minimal;
695
+ const options = {
696
+ ...DEFAULT_INIT_OPTIONS,
697
+ targetDir: ctx.cwd,
698
+ force: ctx.flags.force,
699
+ components: {
700
+ settings: true,
701
+ skills: false,
702
+ commands: false,
703
+ agents: false,
704
+ helpers: false,
705
+ statusline: false,
706
+ mcp: false,
707
+ runtime: false,
708
+ claudeMd: false,
709
+ },
710
+ hooks: minimal
711
+ ? {
712
+ preToolUse: true,
713
+ postToolUse: true,
714
+ userPromptSubmit: false,
715
+ sessionStart: false,
716
+ stop: false,
717
+ preCompact: false,
718
+ notification: false,
719
+ teammateIdle: false,
720
+ taskCompleted: false,
721
+ timeout: 5000,
722
+ continueOnError: true,
723
+ }
724
+ : DEFAULT_INIT_OPTIONS.hooks,
725
+ };
726
+ const spinner = output.createSpinner({ text: 'Creating hooks configuration...' });
727
+ spinner.start();
728
+ const result = await executeInit(options);
729
+ if (result.success) {
730
+ spinner.succeed(`Created settings.json with ${result.summary.hooksEnabled} hooks enabled`);
731
+ }
732
+ else {
733
+ spinner.fail('Failed to create hooks configuration');
734
+ for (const error of result.errors) {
735
+ output.printError(error);
871
736
  }
872
- });
873
- }); }
737
+ }
738
+ return { success: result.success, data: result };
739
+ },
874
740
  };
875
741
  // Upgrade subcommand - updates helpers without losing user data
876
- var upgradeCommand = {
742
+ const upgradeCommand = {
877
743
  name: 'upgrade',
878
744
  description: 'Update statusline and helpers while preserving existing data',
879
745
  options: [
@@ -882,144 +748,126 @@ var upgradeCommand = {
882
748
  short: 'v',
883
749
  description: 'Show detailed output',
884
750
  type: 'boolean',
885
- "default": false
751
+ default: false,
886
752
  },
887
753
  {
888
754
  name: 'add-missing',
889
755
  short: 'a',
890
756
  description: 'Add any new skills, agents, and commands that are missing',
891
757
  type: 'boolean',
892
- "default": false
758
+ default: false,
893
759
  },
894
760
  {
895
761
  name: 'settings',
896
762
  short: 's',
897
763
  description: 'Merge new settings (Agent Teams, hooks) into existing settings.json',
898
764
  type: 'boolean',
899
- "default": false
765
+ default: false,
900
766
  },
901
767
  ],
902
- action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
903
- var addMissing, upgradeSettings, spinnerText, spinner, result, _a, _i, _b, error, totalAdded, error_4;
904
- var _c, _d, _e;
905
- return __generator(this, function (_f) {
906
- switch (_f.label) {
907
- case 0:
908
- addMissing = (ctx.flags['add-missing'] || ctx.flags.addMissing);
909
- upgradeSettings = (ctx.flags.settings);
910
- output.writeln();
911
- output.writeln(output.bold('Upgrading RuFlo'));
912
- if (addMissing && upgradeSettings) {
913
- output.writeln(output.dim('Updates helpers, settings, and adds any missing skills/agents/commands'));
914
- }
915
- else if (addMissing) {
916
- output.writeln(output.dim('Updates helpers and adds any missing skills/agents/commands'));
917
- }
918
- else if (upgradeSettings) {
919
- output.writeln(output.dim('Updates helpers and merges new settings (Agent Teams, hooks)'));
920
- }
921
- else {
922
- output.writeln(output.dim('Updates helpers while preserving your existing data'));
923
- }
924
- output.writeln();
925
- spinnerText = upgradeSettings
926
- ? 'Upgrading helpers and settings...'
927
- : (addMissing ? 'Upgrading and adding missing assets...' : 'Upgrading...');
928
- spinner = output.createSpinner({ text: spinnerText });
929
- spinner.start();
930
- _f.label = 1;
931
- case 1:
932
- _f.trys.push([1, 6, , 7]);
933
- if (!addMissing) return [3 /*break*/, 3];
934
- return [4 /*yield*/, executeUpgradeWithMissing(ctx.cwd, upgradeSettings)];
935
- case 2:
936
- _a = _f.sent();
937
- return [3 /*break*/, 5];
938
- case 3: return [4 /*yield*/, executeUpgrade(ctx.cwd, upgradeSettings)];
939
- case 4:
940
- _a = _f.sent();
941
- _f.label = 5;
942
- case 5:
943
- result = _a;
944
- if (!result.success) {
945
- spinner.fail('Upgrade failed');
946
- for (_i = 0, _b = result.errors; _i < _b.length; _i++) {
947
- error = _b[_i];
948
- output.printError(error);
949
- }
950
- return [2 /*return*/, { success: false, exitCode: 1 }];
951
- }
952
- spinner.succeed('Upgrade complete!');
953
- output.writeln();
954
- // Show what was updated
955
- if (result.updated.length > 0) {
956
- output.printBox(result.updated.map(function (f) { return "\u2713 " + f; }).join('\n'), 'Updated (latest version)');
957
- output.writeln();
958
- }
959
- // Show what was created
960
- if (result.created.length > 0) {
961
- output.printBox(result.created.map(function (f) { return "+ " + f; }).join('\n'), 'Created (new files)');
962
- output.writeln();
963
- }
964
- // Show what was preserved
965
- if (result.preserved.length > 0 && ctx.flags.verbose) {
966
- output.printBox(result.preserved.map(function (f) { return "\u2022 " + f; }).join('\n'), 'Preserved (existing data kept)');
967
- output.writeln();
968
- }
969
- else if (result.preserved.length > 0) {
970
- output.printInfo("Preserved " + result.preserved.length + " existing data files");
971
- output.writeln();
972
- }
973
- // Show added assets (when --add-missing flag is used)
974
- if (result.addedSkills && result.addedSkills.length > 0) {
975
- output.printBox(result.addedSkills.map(function (s) { return "+ " + s; }).join('\n'), "Added Skills (" + result.addedSkills.length + " new)");
976
- output.writeln();
977
- }
978
- if (result.addedAgents && result.addedAgents.length > 0) {
979
- output.printBox(result.addedAgents.map(function (a) { return "+ " + a; }).join('\n'), "Added Agents (" + result.addedAgents.length + " new)");
980
- output.writeln();
981
- }
982
- if (result.addedCommands && result.addedCommands.length > 0) {
983
- output.printBox(result.addedCommands.map(function (c) { return "+ " + c; }).join('\n'), "Added Commands (" + result.addedCommands.length + " new)");
984
- output.writeln();
985
- }
986
- // Show settings updates
987
- if (result.settingsUpdated && result.settingsUpdated.length > 0) {
988
- output.printBox(result.settingsUpdated.map(function (s) { return "+ " + s; }).join('\n'), 'Settings Updated');
989
- output.writeln();
990
- }
991
- output.printSuccess('Your statusline helper has been updated to the latest version');
992
- output.printInfo('Existing metrics and learning data were preserved');
993
- // Show settings summary
994
- if (upgradeSettings && result.settingsUpdated && result.settingsUpdated.length > 0) {
995
- output.printSuccess('Settings.json updated with new Agent Teams configuration');
996
- }
997
- // Show summary for --add-missing
998
- if (addMissing) {
999
- totalAdded = (((_c = result.addedSkills) === null || _c === void 0 ? void 0 : _c.length) || 0) + (((_d = result.addedAgents) === null || _d === void 0 ? void 0 : _d.length) || 0) + (((_e = result.addedCommands) === null || _e === void 0 ? void 0 : _e.length) || 0);
1000
- if (totalAdded > 0) {
1001
- output.printSuccess("Added " + totalAdded + " missing assets to your project");
1002
- }
1003
- else {
1004
- output.printInfo('All skills, agents, and commands are already up to date');
1005
- }
1006
- }
1007
- if (ctx.flags.format === 'json') {
1008
- output.printJson(result);
1009
- }
1010
- return [2 /*return*/, { success: true, data: result }];
1011
- case 6:
1012
- error_4 = _f.sent();
1013
- spinner.fail('Upgrade failed');
1014
- output.printError("Failed to upgrade: " + (error_4 instanceof Error ? error_4.message : String(error_4)));
1015
- return [2 /*return*/, { success: false, exitCode: 1 }];
1016
- case 7: return [2 /*return*/];
768
+ action: async (ctx) => {
769
+ const addMissing = (ctx.flags['add-missing'] || ctx.flags.addMissing);
770
+ const upgradeSettings = (ctx.flags.settings);
771
+ output.writeln();
772
+ output.writeln(output.bold('Upgrading RuFlo'));
773
+ if (addMissing && upgradeSettings) {
774
+ output.writeln(output.dim('Updates helpers, settings, and adds any missing skills/agents/commands'));
775
+ }
776
+ else if (addMissing) {
777
+ output.writeln(output.dim('Updates helpers and adds any missing skills/agents/commands'));
778
+ }
779
+ else if (upgradeSettings) {
780
+ output.writeln(output.dim('Updates helpers and merges new settings (Agent Teams, hooks)'));
781
+ }
782
+ else {
783
+ output.writeln(output.dim('Updates helpers while preserving your existing data'));
784
+ }
785
+ output.writeln();
786
+ const spinnerText = upgradeSettings
787
+ ? 'Upgrading helpers and settings...'
788
+ : (addMissing ? 'Upgrading and adding missing assets...' : 'Upgrading...');
789
+ const spinner = output.createSpinner({ text: spinnerText });
790
+ spinner.start();
791
+ try {
792
+ const result = addMissing
793
+ ? await executeUpgradeWithMissing(ctx.cwd, upgradeSettings)
794
+ : await executeUpgrade(ctx.cwd, upgradeSettings);
795
+ if (!result.success) {
796
+ spinner.fail('Upgrade failed');
797
+ for (const error of result.errors) {
798
+ output.printError(error);
799
+ }
800
+ return { success: false, exitCode: 1 };
1017
801
  }
1018
- });
1019
- }); }
802
+ spinner.succeed('Upgrade complete!');
803
+ output.writeln();
804
+ // Show what was updated
805
+ if (result.updated.length > 0) {
806
+ output.printBox(result.updated.map(f => `✓ ${f}`).join('\n'), 'Updated (latest version)');
807
+ output.writeln();
808
+ }
809
+ // Show what was created
810
+ if (result.created.length > 0) {
811
+ output.printBox(result.created.map(f => `+ ${f}`).join('\n'), 'Created (new files)');
812
+ output.writeln();
813
+ }
814
+ // Show what was preserved
815
+ if (result.preserved.length > 0 && ctx.flags.verbose) {
816
+ output.printBox(result.preserved.map(f => `• ${f}`).join('\n'), 'Preserved (existing data kept)');
817
+ output.writeln();
818
+ }
819
+ else if (result.preserved.length > 0) {
820
+ output.printInfo(`Preserved ${result.preserved.length} existing data files`);
821
+ output.writeln();
822
+ }
823
+ // Show added assets (when --add-missing flag is used)
824
+ if (result.addedSkills && result.addedSkills.length > 0) {
825
+ output.printBox(result.addedSkills.map(s => `+ ${s}`).join('\n'), `Added Skills (${result.addedSkills.length} new)`);
826
+ output.writeln();
827
+ }
828
+ if (result.addedAgents && result.addedAgents.length > 0) {
829
+ output.printBox(result.addedAgents.map(a => `+ ${a}`).join('\n'), `Added Agents (${result.addedAgents.length} new)`);
830
+ output.writeln();
831
+ }
832
+ if (result.addedCommands && result.addedCommands.length > 0) {
833
+ output.printBox(result.addedCommands.map(c => `+ ${c}`).join('\n'), `Added Commands (${result.addedCommands.length} new)`);
834
+ output.writeln();
835
+ }
836
+ // Show settings updates
837
+ if (result.settingsUpdated && result.settingsUpdated.length > 0) {
838
+ output.printBox(result.settingsUpdated.map(s => `+ ${s}`).join('\n'), 'Settings Updated');
839
+ output.writeln();
840
+ }
841
+ output.printSuccess('Your statusline helper has been updated to the latest version');
842
+ output.printInfo('Existing metrics and learning data were preserved');
843
+ // Show settings summary
844
+ if (upgradeSettings && result.settingsUpdated && result.settingsUpdated.length > 0) {
845
+ output.printSuccess('Settings.json updated with new Agent Teams configuration');
846
+ }
847
+ // Show summary for --add-missing
848
+ if (addMissing) {
849
+ const totalAdded = (result.addedSkills?.length || 0) + (result.addedAgents?.length || 0) + (result.addedCommands?.length || 0);
850
+ if (totalAdded > 0) {
851
+ output.printSuccess(`Added ${totalAdded} missing assets to your project`);
852
+ }
853
+ else {
854
+ output.printInfo('All skills, agents, and commands are already up to date');
855
+ }
856
+ }
857
+ if (ctx.flags.format === 'json') {
858
+ output.printJson(result);
859
+ }
860
+ return { success: true, data: result };
861
+ }
862
+ catch (error) {
863
+ spinner.fail('Upgrade failed');
864
+ output.printError(`Failed to upgrade: ${error instanceof Error ? error.message : String(error)}`);
865
+ return { success: false, exitCode: 1 };
866
+ }
867
+ },
1020
868
  };
1021
869
  // Main init command
1022
- export var initCommand = {
870
+ export const initCommand = {
1023
871
  name: 'init',
1024
872
  description: 'Initialize RuFlo in the current directory',
1025
873
  subcommands: [wizardCommand, checkCommand, skillsCommand, hooksCommand, upgradeCommand],
@@ -1029,69 +877,69 @@ export var initCommand = {
1029
877
  short: 'f',
1030
878
  description: 'Overwrite existing configuration',
1031
879
  type: 'boolean',
1032
- "default": false
880
+ default: false,
1033
881
  },
1034
882
  {
1035
883
  name: 'minimal',
1036
884
  short: 'm',
1037
885
  description: 'Create minimal configuration',
1038
886
  type: 'boolean',
1039
- "default": false
887
+ default: false,
1040
888
  },
1041
889
  {
1042
890
  name: 'full',
1043
891
  description: 'Create full configuration with all components',
1044
892
  type: 'boolean',
1045
- "default": false
893
+ default: false,
1046
894
  },
1047
895
  {
1048
896
  name: 'skip-claude',
1049
897
  description: 'Skip .claude/ directory creation (runtime only)',
1050
898
  type: 'boolean',
1051
- "default": false
899
+ default: false,
1052
900
  },
1053
901
  {
1054
902
  name: 'only-claude',
1055
903
  description: 'Only create .claude/ directory (skip runtime)',
1056
904
  type: 'boolean',
1057
- "default": false
905
+ default: false,
1058
906
  },
1059
907
  {
1060
908
  name: 'start-all',
1061
909
  description: 'Auto-start daemon, memory, and swarm after init',
1062
910
  type: 'boolean',
1063
- "default": false
911
+ default: false,
1064
912
  },
1065
913
  {
1066
914
  name: 'start-daemon',
1067
915
  description: 'Auto-start daemon after init',
1068
916
  type: 'boolean',
1069
- "default": false
917
+ default: false,
1070
918
  },
1071
919
  {
1072
920
  name: 'with-embeddings',
1073
921
  description: 'Initialize ONNX embedding subsystem with hyperbolic support',
1074
922
  type: 'boolean',
1075
- "default": false
923
+ default: false,
1076
924
  },
1077
925
  {
1078
926
  name: 'embedding-model',
1079
927
  description: 'ONNX embedding model to use',
1080
928
  type: 'string',
1081
- "default": 'all-MiniLM-L6-v2',
1082
- choices: ['all-MiniLM-L6-v2', 'all-mpnet-base-v2']
929
+ default: 'all-MiniLM-L6-v2',
930
+ choices: ['all-MiniLM-L6-v2', 'all-mpnet-base-v2'],
1083
931
  },
1084
932
  {
1085
933
  name: 'codex',
1086
934
  description: 'Initialize for OpenAI Codex CLI (creates AGENTS.md, .agents/)',
1087
935
  type: 'boolean',
1088
- "default": false
936
+ default: false,
1089
937
  },
1090
938
  {
1091
939
  name: 'dual',
1092
940
  description: 'Initialize for both Claude Code and OpenAI Codex',
1093
941
  type: 'boolean',
1094
- "default": false
942
+ default: false,
1095
943
  },
1096
944
  ],
1097
945
  examples: [
@@ -1115,7 +963,7 @@ export var initCommand = {
1115
963
  { command: 'claude-flow init --codex --full', description: 'Codex init with all 137+ skills' },
1116
964
  { command: 'claude-flow init --dual', description: 'Initialize for both Claude Code and Codex' },
1117
965
  ],
1118
- action: initAction
966
+ action: initAction,
1119
967
  };
1120
968
  export default initCommand;
1121
969
  //# sourceMappingURL=init.js.map