getmy-ruflo 3.5.43

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 (732) hide show
  1. package/bin/ruflo.js +29 -0
  2. package/package.json +50 -0
  3. package/v3/@claude-flow/cli/bin/cli.js +156 -0
  4. package/v3/@claude-flow/cli/bin/mcp-server.js +199 -0
  5. package/v3/@claude-flow/cli/bin/mcp-sse-server.js +596 -0
  6. package/v3/@claude-flow/cli/bin/preinstall.cjs +2 -0
  7. package/v3/@claude-flow/cli/dist/src/appliance/gguf-engine.d.ts +91 -0
  8. package/v3/@claude-flow/cli/dist/src/appliance/gguf-engine.d.ts.map +1 -0
  9. package/v3/@claude-flow/cli/dist/src/appliance/gguf-engine.js +425 -0
  10. package/v3/@claude-flow/cli/dist/src/appliance/gguf-engine.js.map +1 -0
  11. package/v3/@claude-flow/cli/dist/src/appliance/ruvllm-bridge.d.ts +102 -0
  12. package/v3/@claude-flow/cli/dist/src/appliance/ruvllm-bridge.d.ts.map +1 -0
  13. package/v3/@claude-flow/cli/dist/src/appliance/ruvllm-bridge.js +292 -0
  14. package/v3/@claude-flow/cli/dist/src/appliance/ruvllm-bridge.js.map +1 -0
  15. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-builder.d.ts +44 -0
  16. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-builder.d.ts.map +1 -0
  17. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-builder.js +329 -0
  18. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-builder.js.map +1 -0
  19. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-distribution.d.ts +97 -0
  20. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-distribution.d.ts.map +1 -0
  21. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-distribution.js +370 -0
  22. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-distribution.js.map +1 -0
  23. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-format.d.ts +111 -0
  24. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-format.d.ts.map +1 -0
  25. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-format.js +393 -0
  26. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-format.js.map +1 -0
  27. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-runner.d.ts +69 -0
  28. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-runner.d.ts.map +1 -0
  29. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-runner.js +237 -0
  30. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-runner.js.map +1 -0
  31. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-signing.d.ts +123 -0
  32. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-signing.d.ts.map +1 -0
  33. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-signing.js +347 -0
  34. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-signing.js.map +1 -0
  35. package/v3/@claude-flow/cli/dist/src/benchmarks/pretrain/index.d.ts +58 -0
  36. package/v3/@claude-flow/cli/dist/src/benchmarks/pretrain/index.d.ts.map +1 -0
  37. package/v3/@claude-flow/cli/dist/src/benchmarks/pretrain/index.js +404 -0
  38. package/v3/@claude-flow/cli/dist/src/benchmarks/pretrain/index.js.map +1 -0
  39. package/v3/@claude-flow/cli/dist/src/commands/agent.d.ts +8 -0
  40. package/v3/@claude-flow/cli/dist/src/commands/agent.d.ts.map +1 -0
  41. package/v3/@claude-flow/cli/dist/src/commands/agent.js +919 -0
  42. package/v3/@claude-flow/cli/dist/src/commands/agent.js.map +1 -0
  43. package/v3/@claude-flow/cli/dist/src/commands/analyze.d.ts +19 -0
  44. package/v3/@claude-flow/cli/dist/src/commands/analyze.d.ts.map +1 -0
  45. package/v3/@claude-flow/cli/dist/src/commands/analyze.js +1823 -0
  46. package/v3/@claude-flow/cli/dist/src/commands/analyze.js.map +1 -0
  47. package/v3/@claude-flow/cli/dist/src/commands/appliance-advanced.d.ts +9 -0
  48. package/v3/@claude-flow/cli/dist/src/commands/appliance-advanced.d.ts.map +1 -0
  49. package/v3/@claude-flow/cli/dist/src/commands/appliance-advanced.js +215 -0
  50. package/v3/@claude-flow/cli/dist/src/commands/appliance-advanced.js.map +1 -0
  51. package/v3/@claude-flow/cli/dist/src/commands/appliance.d.ts +8 -0
  52. package/v3/@claude-flow/cli/dist/src/commands/appliance.d.ts.map +1 -0
  53. package/v3/@claude-flow/cli/dist/src/commands/appliance.js +406 -0
  54. package/v3/@claude-flow/cli/dist/src/commands/appliance.js.map +1 -0
  55. package/v3/@claude-flow/cli/dist/src/commands/benchmark.d.ts +10 -0
  56. package/v3/@claude-flow/cli/dist/src/commands/benchmark.d.ts.map +1 -0
  57. package/v3/@claude-flow/cli/dist/src/commands/benchmark.js +459 -0
  58. package/v3/@claude-flow/cli/dist/src/commands/benchmark.js.map +1 -0
  59. package/v3/@claude-flow/cli/dist/src/commands/claims.d.ts +10 -0
  60. package/v3/@claude-flow/cli/dist/src/commands/claims.d.ts.map +1 -0
  61. package/v3/@claude-flow/cli/dist/src/commands/claims.js +373 -0
  62. package/v3/@claude-flow/cli/dist/src/commands/claims.js.map +1 -0
  63. package/v3/@claude-flow/cli/dist/src/commands/cleanup.d.ts +13 -0
  64. package/v3/@claude-flow/cli/dist/src/commands/cleanup.d.ts.map +1 -0
  65. package/v3/@claude-flow/cli/dist/src/commands/cleanup.js +218 -0
  66. package/v3/@claude-flow/cli/dist/src/commands/cleanup.js.map +1 -0
  67. package/v3/@claude-flow/cli/dist/src/commands/completions.d.ts +10 -0
  68. package/v3/@claude-flow/cli/dist/src/commands/completions.d.ts.map +1 -0
  69. package/v3/@claude-flow/cli/dist/src/commands/completions.js +539 -0
  70. package/v3/@claude-flow/cli/dist/src/commands/completions.js.map +1 -0
  71. package/v3/@claude-flow/cli/dist/src/commands/config.d.ts +8 -0
  72. package/v3/@claude-flow/cli/dist/src/commands/config.d.ts.map +1 -0
  73. package/v3/@claude-flow/cli/dist/src/commands/config.js +406 -0
  74. package/v3/@claude-flow/cli/dist/src/commands/config.js.map +1 -0
  75. package/v3/@claude-flow/cli/dist/src/commands/daemon.d.ts +8 -0
  76. package/v3/@claude-flow/cli/dist/src/commands/daemon.d.ts.map +1 -0
  77. package/v3/@claude-flow/cli/dist/src/commands/daemon.js +656 -0
  78. package/v3/@claude-flow/cli/dist/src/commands/daemon.js.map +1 -0
  79. package/v3/@claude-flow/cli/dist/src/commands/deployment.d.ts +10 -0
  80. package/v3/@claude-flow/cli/dist/src/commands/deployment.d.ts.map +1 -0
  81. package/v3/@claude-flow/cli/dist/src/commands/deployment.js +289 -0
  82. package/v3/@claude-flow/cli/dist/src/commands/deployment.js.map +1 -0
  83. package/v3/@claude-flow/cli/dist/src/commands/doctor.d.ts +10 -0
  84. package/v3/@claude-flow/cli/dist/src/commands/doctor.d.ts.map +1 -0
  85. package/v3/@claude-flow/cli/dist/src/commands/doctor.js +619 -0
  86. package/v3/@claude-flow/cli/dist/src/commands/doctor.js.map +1 -0
  87. package/v3/@claude-flow/cli/dist/src/commands/embeddings.d.ts +18 -0
  88. package/v3/@claude-flow/cli/dist/src/commands/embeddings.d.ts.map +1 -0
  89. package/v3/@claude-flow/cli/dist/src/commands/embeddings.js +1576 -0
  90. package/v3/@claude-flow/cli/dist/src/commands/embeddings.js.map +1 -0
  91. package/v3/@claude-flow/cli/dist/src/commands/guidance.d.ts +8 -0
  92. package/v3/@claude-flow/cli/dist/src/commands/guidance.d.ts.map +1 -0
  93. package/v3/@claude-flow/cli/dist/src/commands/guidance.js +560 -0
  94. package/v3/@claude-flow/cli/dist/src/commands/guidance.js.map +1 -0
  95. package/v3/@claude-flow/cli/dist/src/commands/hive-mind.d.ts +11 -0
  96. package/v3/@claude-flow/cli/dist/src/commands/hive-mind.d.ts.map +1 -0
  97. package/v3/@claude-flow/cli/dist/src/commands/hive-mind.js +1230 -0
  98. package/v3/@claude-flow/cli/dist/src/commands/hive-mind.js.map +1 -0
  99. package/v3/@claude-flow/cli/dist/src/commands/hooks.d.ts +8 -0
  100. package/v3/@claude-flow/cli/dist/src/commands/hooks.d.ts.map +1 -0
  101. package/v3/@claude-flow/cli/dist/src/commands/hooks.js +4441 -0
  102. package/v3/@claude-flow/cli/dist/src/commands/hooks.js.map +1 -0
  103. package/v3/@claude-flow/cli/dist/src/commands/index.d.ts +115 -0
  104. package/v3/@claude-flow/cli/dist/src/commands/index.d.ts.map +1 -0
  105. package/v3/@claude-flow/cli/dist/src/commands/index.js +377 -0
  106. package/v3/@claude-flow/cli/dist/src/commands/index.js.map +1 -0
  107. package/v3/@claude-flow/cli/dist/src/commands/init.d.ts +8 -0
  108. package/v3/@claude-flow/cli/dist/src/commands/init.d.ts.map +1 -0
  109. package/v3/@claude-flow/cli/dist/src/commands/init.js +969 -0
  110. package/v3/@claude-flow/cli/dist/src/commands/init.js.map +1 -0
  111. package/v3/@claude-flow/cli/dist/src/commands/issues.d.ts +21 -0
  112. package/v3/@claude-flow/cli/dist/src/commands/issues.d.ts.map +1 -0
  113. package/v3/@claude-flow/cli/dist/src/commands/issues.js +567 -0
  114. package/v3/@claude-flow/cli/dist/src/commands/issues.js.map +1 -0
  115. package/v3/@claude-flow/cli/dist/src/commands/mcp.d.ts +11 -0
  116. package/v3/@claude-flow/cli/dist/src/commands/mcp.d.ts.map +1 -0
  117. package/v3/@claude-flow/cli/dist/src/commands/mcp.js +779 -0
  118. package/v3/@claude-flow/cli/dist/src/commands/mcp.js.map +1 -0
  119. package/v3/@claude-flow/cli/dist/src/commands/memory.d.ts +8 -0
  120. package/v3/@claude-flow/cli/dist/src/commands/memory.d.ts.map +1 -0
  121. package/v3/@claude-flow/cli/dist/src/commands/memory.js +1292 -0
  122. package/v3/@claude-flow/cli/dist/src/commands/memory.js.map +1 -0
  123. package/v3/@claude-flow/cli/dist/src/commands/migrate.d.ts +8 -0
  124. package/v3/@claude-flow/cli/dist/src/commands/migrate.d.ts.map +1 -0
  125. package/v3/@claude-flow/cli/dist/src/commands/migrate.js +410 -0
  126. package/v3/@claude-flow/cli/dist/src/commands/migrate.js.map +1 -0
  127. package/v3/@claude-flow/cli/dist/src/commands/neural.d.ts +10 -0
  128. package/v3/@claude-flow/cli/dist/src/commands/neural.d.ts.map +1 -0
  129. package/v3/@claude-flow/cli/dist/src/commands/neural.js +1454 -0
  130. package/v3/@claude-flow/cli/dist/src/commands/neural.js.map +1 -0
  131. package/v3/@claude-flow/cli/dist/src/commands/performance.d.ts +10 -0
  132. package/v3/@claude-flow/cli/dist/src/commands/performance.d.ts.map +1 -0
  133. package/v3/@claude-flow/cli/dist/src/commands/performance.js +579 -0
  134. package/v3/@claude-flow/cli/dist/src/commands/performance.js.map +1 -0
  135. package/v3/@claude-flow/cli/dist/src/commands/plugins.d.ts +11 -0
  136. package/v3/@claude-flow/cli/dist/src/commands/plugins.d.ts.map +1 -0
  137. package/v3/@claude-flow/cli/dist/src/commands/plugins.js +820 -0
  138. package/v3/@claude-flow/cli/dist/src/commands/plugins.js.map +1 -0
  139. package/v3/@claude-flow/cli/dist/src/commands/process.d.ts +10 -0
  140. package/v3/@claude-flow/cli/dist/src/commands/process.d.ts.map +1 -0
  141. package/v3/@claude-flow/cli/dist/src/commands/process.js +641 -0
  142. package/v3/@claude-flow/cli/dist/src/commands/process.js.map +1 -0
  143. package/v3/@claude-flow/cli/dist/src/commands/progress.d.ts +11 -0
  144. package/v3/@claude-flow/cli/dist/src/commands/progress.d.ts.map +1 -0
  145. package/v3/@claude-flow/cli/dist/src/commands/progress.js +259 -0
  146. package/v3/@claude-flow/cli/dist/src/commands/progress.js.map +1 -0
  147. package/v3/@claude-flow/cli/dist/src/commands/providers.d.ts +10 -0
  148. package/v3/@claude-flow/cli/dist/src/commands/providers.d.ts.map +1 -0
  149. package/v3/@claude-flow/cli/dist/src/commands/providers.js +232 -0
  150. package/v3/@claude-flow/cli/dist/src/commands/providers.js.map +1 -0
  151. package/v3/@claude-flow/cli/dist/src/commands/route.d.ts +16 -0
  152. package/v3/@claude-flow/cli/dist/src/commands/route.d.ts.map +1 -0
  153. package/v3/@claude-flow/cli/dist/src/commands/route.js +813 -0
  154. package/v3/@claude-flow/cli/dist/src/commands/route.js.map +1 -0
  155. package/v3/@claude-flow/cli/dist/src/commands/ruvector/backup.d.ts +11 -0
  156. package/v3/@claude-flow/cli/dist/src/commands/ruvector/backup.d.ts.map +1 -0
  157. package/v3/@claude-flow/cli/dist/src/commands/ruvector/backup.js +746 -0
  158. package/v3/@claude-flow/cli/dist/src/commands/ruvector/backup.js.map +1 -0
  159. package/v3/@claude-flow/cli/dist/src/commands/ruvector/benchmark.d.ts +11 -0
  160. package/v3/@claude-flow/cli/dist/src/commands/ruvector/benchmark.d.ts.map +1 -0
  161. package/v3/@claude-flow/cli/dist/src/commands/ruvector/benchmark.js +480 -0
  162. package/v3/@claude-flow/cli/dist/src/commands/ruvector/benchmark.js.map +1 -0
  163. package/v3/@claude-flow/cli/dist/src/commands/ruvector/import.d.ts +18 -0
  164. package/v3/@claude-flow/cli/dist/src/commands/ruvector/import.d.ts.map +1 -0
  165. package/v3/@claude-flow/cli/dist/src/commands/ruvector/import.js +349 -0
  166. package/v3/@claude-flow/cli/dist/src/commands/ruvector/import.js.map +1 -0
  167. package/v3/@claude-flow/cli/dist/src/commands/ruvector/index.d.ts +29 -0
  168. package/v3/@claude-flow/cli/dist/src/commands/ruvector/index.d.ts.map +1 -0
  169. package/v3/@claude-flow/cli/dist/src/commands/ruvector/index.js +129 -0
  170. package/v3/@claude-flow/cli/dist/src/commands/ruvector/index.js.map +1 -0
  171. package/v3/@claude-flow/cli/dist/src/commands/ruvector/init.d.ts +11 -0
  172. package/v3/@claude-flow/cli/dist/src/commands/ruvector/init.d.ts.map +1 -0
  173. package/v3/@claude-flow/cli/dist/src/commands/ruvector/init.js +431 -0
  174. package/v3/@claude-flow/cli/dist/src/commands/ruvector/init.js.map +1 -0
  175. package/v3/@claude-flow/cli/dist/src/commands/ruvector/migrate.d.ts +11 -0
  176. package/v3/@claude-flow/cli/dist/src/commands/ruvector/migrate.d.ts.map +1 -0
  177. package/v3/@claude-flow/cli/dist/src/commands/ruvector/migrate.js +481 -0
  178. package/v3/@claude-flow/cli/dist/src/commands/ruvector/migrate.js.map +1 -0
  179. package/v3/@claude-flow/cli/dist/src/commands/ruvector/optimize.d.ts +11 -0
  180. package/v3/@claude-flow/cli/dist/src/commands/ruvector/optimize.d.ts.map +1 -0
  181. package/v3/@claude-flow/cli/dist/src/commands/ruvector/optimize.js +503 -0
  182. package/v3/@claude-flow/cli/dist/src/commands/ruvector/optimize.js.map +1 -0
  183. package/v3/@claude-flow/cli/dist/src/commands/ruvector/setup.d.ts +18 -0
  184. package/v3/@claude-flow/cli/dist/src/commands/ruvector/setup.d.ts.map +1 -0
  185. package/v3/@claude-flow/cli/dist/src/commands/ruvector/setup.js +765 -0
  186. package/v3/@claude-flow/cli/dist/src/commands/ruvector/setup.js.map +1 -0
  187. package/v3/@claude-flow/cli/dist/src/commands/ruvector/status.d.ts +11 -0
  188. package/v3/@claude-flow/cli/dist/src/commands/ruvector/status.d.ts.map +1 -0
  189. package/v3/@claude-flow/cli/dist/src/commands/ruvector/status.js +456 -0
  190. package/v3/@claude-flow/cli/dist/src/commands/ruvector/status.js.map +1 -0
  191. package/v3/@claude-flow/cli/dist/src/commands/security.d.ts +10 -0
  192. package/v3/@claude-flow/cli/dist/src/commands/security.d.ts.map +1 -0
  193. package/v3/@claude-flow/cli/dist/src/commands/security.js +606 -0
  194. package/v3/@claude-flow/cli/dist/src/commands/security.js.map +1 -0
  195. package/v3/@claude-flow/cli/dist/src/commands/session.d.ts +8 -0
  196. package/v3/@claude-flow/cli/dist/src/commands/session.d.ts.map +1 -0
  197. package/v3/@claude-flow/cli/dist/src/commands/session.js +750 -0
  198. package/v3/@claude-flow/cli/dist/src/commands/session.js.map +1 -0
  199. package/v3/@claude-flow/cli/dist/src/commands/start.d.ts +8 -0
  200. package/v3/@claude-flow/cli/dist/src/commands/start.d.ts.map +1 -0
  201. package/v3/@claude-flow/cli/dist/src/commands/start.js +418 -0
  202. package/v3/@claude-flow/cli/dist/src/commands/start.js.map +1 -0
  203. package/v3/@claude-flow/cli/dist/src/commands/status.d.ts +8 -0
  204. package/v3/@claude-flow/cli/dist/src/commands/status.d.ts.map +1 -0
  205. package/v3/@claude-flow/cli/dist/src/commands/status.js +591 -0
  206. package/v3/@claude-flow/cli/dist/src/commands/status.js.map +1 -0
  207. package/v3/@claude-flow/cli/dist/src/commands/swarm.d.ts +8 -0
  208. package/v3/@claude-flow/cli/dist/src/commands/swarm.d.ts.map +1 -0
  209. package/v3/@claude-flow/cli/dist/src/commands/swarm.js +748 -0
  210. package/v3/@claude-flow/cli/dist/src/commands/swarm.js.map +1 -0
  211. package/v3/@claude-flow/cli/dist/src/commands/task.d.ts +8 -0
  212. package/v3/@claude-flow/cli/dist/src/commands/task.d.ts.map +1 -0
  213. package/v3/@claude-flow/cli/dist/src/commands/task.js +671 -0
  214. package/v3/@claude-flow/cli/dist/src/commands/task.js.map +1 -0
  215. package/v3/@claude-flow/cli/dist/src/commands/transfer-store.d.ts +13 -0
  216. package/v3/@claude-flow/cli/dist/src/commands/transfer-store.d.ts.map +1 -0
  217. package/v3/@claude-flow/cli/dist/src/commands/transfer-store.js +428 -0
  218. package/v3/@claude-flow/cli/dist/src/commands/transfer-store.js.map +1 -0
  219. package/v3/@claude-flow/cli/dist/src/commands/update.d.ts +8 -0
  220. package/v3/@claude-flow/cli/dist/src/commands/update.d.ts.map +1 -0
  221. package/v3/@claude-flow/cli/dist/src/commands/update.js +276 -0
  222. package/v3/@claude-flow/cli/dist/src/commands/update.js.map +1 -0
  223. package/v3/@claude-flow/cli/dist/src/commands/workflow.d.ts +8 -0
  224. package/v3/@claude-flow/cli/dist/src/commands/workflow.d.ts.map +1 -0
  225. package/v3/@claude-flow/cli/dist/src/commands/workflow.js +617 -0
  226. package/v3/@claude-flow/cli/dist/src/commands/workflow.js.map +1 -0
  227. package/v3/@claude-flow/cli/dist/src/config-adapter.d.ts +15 -0
  228. package/v3/@claude-flow/cli/dist/src/config-adapter.d.ts.map +1 -0
  229. package/v3/@claude-flow/cli/dist/src/config-adapter.js +186 -0
  230. package/v3/@claude-flow/cli/dist/src/config-adapter.js.map +1 -0
  231. package/v3/@claude-flow/cli/dist/src/index.d.ts +76 -0
  232. package/v3/@claude-flow/cli/dist/src/index.d.ts.map +1 -0
  233. package/v3/@claude-flow/cli/dist/src/index.js +472 -0
  234. package/v3/@claude-flow/cli/dist/src/index.js.map +1 -0
  235. package/v3/@claude-flow/cli/dist/src/infrastructure/in-memory-repositories.d.ts +68 -0
  236. package/v3/@claude-flow/cli/dist/src/infrastructure/in-memory-repositories.d.ts.map +1 -0
  237. package/v3/@claude-flow/cli/dist/src/infrastructure/in-memory-repositories.js +264 -0
  238. package/v3/@claude-flow/cli/dist/src/infrastructure/in-memory-repositories.js.map +1 -0
  239. package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.d.ts +25 -0
  240. package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.d.ts.map +1 -0
  241. package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.js +486 -0
  242. package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.js.map +1 -0
  243. package/v3/@claude-flow/cli/dist/src/init/executor.d.ts +41 -0
  244. package/v3/@claude-flow/cli/dist/src/init/executor.d.ts.map +1 -0
  245. package/v3/@claude-flow/cli/dist/src/init/executor.js +1738 -0
  246. package/v3/@claude-flow/cli/dist/src/init/executor.js.map +1 -0
  247. package/v3/@claude-flow/cli/dist/src/init/helpers-generator.d.ts +60 -0
  248. package/v3/@claude-flow/cli/dist/src/init/helpers-generator.d.ts.map +1 -0
  249. package/v3/@claude-flow/cli/dist/src/init/helpers-generator.js +1181 -0
  250. package/v3/@claude-flow/cli/dist/src/init/helpers-generator.js.map +1 -0
  251. package/v3/@claude-flow/cli/dist/src/init/index.d.ts +13 -0
  252. package/v3/@claude-flow/cli/dist/src/init/index.d.ts.map +1 -0
  253. package/v3/@claude-flow/cli/dist/src/init/index.js +15 -0
  254. package/v3/@claude-flow/cli/dist/src/init/index.js.map +1 -0
  255. package/v3/@claude-flow/cli/dist/src/init/mcp-generator.d.ts +26 -0
  256. package/v3/@claude-flow/cli/dist/src/init/mcp-generator.d.ts.map +1 -0
  257. package/v3/@claude-flow/cli/dist/src/init/mcp-generator.js +116 -0
  258. package/v3/@claude-flow/cli/dist/src/init/mcp-generator.js.map +1 -0
  259. package/v3/@claude-flow/cli/dist/src/init/settings-generator.d.ts +14 -0
  260. package/v3/@claude-flow/cli/dist/src/init/settings-generator.d.ts.map +1 -0
  261. package/v3/@claude-flow/cli/dist/src/init/settings-generator.js +403 -0
  262. package/v3/@claude-flow/cli/dist/src/init/settings-generator.js.map +1 -0
  263. package/v3/@claude-flow/cli/dist/src/init/statusline-generator.d.ts +28 -0
  264. package/v3/@claude-flow/cli/dist/src/init/statusline-generator.d.ts.map +1 -0
  265. package/v3/@claude-flow/cli/dist/src/init/statusline-generator.js +833 -0
  266. package/v3/@claude-flow/cli/dist/src/init/statusline-generator.js.map +1 -0
  267. package/v3/@claude-flow/cli/dist/src/init/types.d.ts +295 -0
  268. package/v3/@claude-flow/cli/dist/src/init/types.d.ts.map +1 -0
  269. package/v3/@claude-flow/cli/dist/src/init/types.js +263 -0
  270. package/v3/@claude-flow/cli/dist/src/init/types.js.map +1 -0
  271. package/v3/@claude-flow/cli/dist/src/mcp-client.d.ts +98 -0
  272. package/v3/@claude-flow/cli/dist/src/mcp-client.d.ts.map +1 -0
  273. package/v3/@claude-flow/cli/dist/src/mcp-client.js +278 -0
  274. package/v3/@claude-flow/cli/dist/src/mcp-client.js.map +1 -0
  275. package/v3/@claude-flow/cli/dist/src/mcp-server.d.ts +161 -0
  276. package/v3/@claude-flow/cli/dist/src/mcp-server.d.ts.map +1 -0
  277. package/v3/@claude-flow/cli/dist/src/mcp-server.js +627 -0
  278. package/v3/@claude-flow/cli/dist/src/mcp-server.js.map +1 -0
  279. package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.d.ts +49 -0
  280. package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.d.ts.map +1 -0
  281. package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.js +622 -0
  282. package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.js.map +1 -0
  283. package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.d.ts +30 -0
  284. package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.d.ts.map +1 -0
  285. package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.js +557 -0
  286. package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.js.map +1 -0
  287. package/v3/@claude-flow/cli/dist/src/mcp-tools/analyze-tools.d.ts +38 -0
  288. package/v3/@claude-flow/cli/dist/src/mcp-tools/analyze-tools.d.ts.map +1 -0
  289. package/v3/@claude-flow/cli/dist/src/mcp-tools/analyze-tools.js +317 -0
  290. package/v3/@claude-flow/cli/dist/src/mcp-tools/analyze-tools.js.map +1 -0
  291. package/v3/@claude-flow/cli/dist/src/mcp-tools/auto-install.d.ts +83 -0
  292. package/v3/@claude-flow/cli/dist/src/mcp-tools/auto-install.d.ts.map +1 -0
  293. package/v3/@claude-flow/cli/dist/src/mcp-tools/auto-install.js +131 -0
  294. package/v3/@claude-flow/cli/dist/src/mcp-tools/auto-install.js.map +1 -0
  295. package/v3/@claude-flow/cli/dist/src/mcp-tools/browser-tools.d.ts +10 -0
  296. package/v3/@claude-flow/cli/dist/src/mcp-tools/browser-tools.d.ts.map +1 -0
  297. package/v3/@claude-flow/cli/dist/src/mcp-tools/browser-tools.js +639 -0
  298. package/v3/@claude-flow/cli/dist/src/mcp-tools/browser-tools.js.map +1 -0
  299. package/v3/@claude-flow/cli/dist/src/mcp-tools/claims-tools.d.ts +12 -0
  300. package/v3/@claude-flow/cli/dist/src/mcp-tools/claims-tools.d.ts.map +1 -0
  301. package/v3/@claude-flow/cli/dist/src/mcp-tools/claims-tools.js +732 -0
  302. package/v3/@claude-flow/cli/dist/src/mcp-tools/claims-tools.js.map +1 -0
  303. package/v3/@claude-flow/cli/dist/src/mcp-tools/config-tools.d.ts +8 -0
  304. package/v3/@claude-flow/cli/dist/src/mcp-tools/config-tools.d.ts.map +1 -0
  305. package/v3/@claude-flow/cli/dist/src/mcp-tools/config-tools.js +352 -0
  306. package/v3/@claude-flow/cli/dist/src/mcp-tools/config-tools.js.map +1 -0
  307. package/v3/@claude-flow/cli/dist/src/mcp-tools/coordination-tools.d.ts +13 -0
  308. package/v3/@claude-flow/cli/dist/src/mcp-tools/coordination-tools.d.ts.map +1 -0
  309. package/v3/@claude-flow/cli/dist/src/mcp-tools/coordination-tools.js +827 -0
  310. package/v3/@claude-flow/cli/dist/src/mcp-tools/coordination-tools.js.map +1 -0
  311. package/v3/@claude-flow/cli/dist/src/mcp-tools/daa-tools.d.ts +13 -0
  312. package/v3/@claude-flow/cli/dist/src/mcp-tools/daa-tools.d.ts.map +1 -0
  313. package/v3/@claude-flow/cli/dist/src/mcp-tools/daa-tools.js +426 -0
  314. package/v3/@claude-flow/cli/dist/src/mcp-tools/daa-tools.js.map +1 -0
  315. package/v3/@claude-flow/cli/dist/src/mcp-tools/dev-tools.d.ts +11 -0
  316. package/v3/@claude-flow/cli/dist/src/mcp-tools/dev-tools.d.ts.map +1 -0
  317. package/v3/@claude-flow/cli/dist/src/mcp-tools/dev-tools.js +713 -0
  318. package/v3/@claude-flow/cli/dist/src/mcp-tools/dev-tools.js.map +1 -0
  319. package/v3/@claude-flow/cli/dist/src/mcp-tools/embeddings-tools.d.ts +9 -0
  320. package/v3/@claude-flow/cli/dist/src/mcp-tools/embeddings-tools.d.ts.map +1 -0
  321. package/v3/@claude-flow/cli/dist/src/mcp-tools/embeddings-tools.js +782 -0
  322. package/v3/@claude-flow/cli/dist/src/mcp-tools/embeddings-tools.js.map +1 -0
  323. package/v3/@claude-flow/cli/dist/src/mcp-tools/github-tools.d.ts +13 -0
  324. package/v3/@claude-flow/cli/dist/src/mcp-tools/github-tools.d.ts.map +1 -0
  325. package/v3/@claude-flow/cli/dist/src/mcp-tools/github-tools.js +373 -0
  326. package/v3/@claude-flow/cli/dist/src/mcp-tools/github-tools.js.map +1 -0
  327. package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.d.ts +8 -0
  328. package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -0
  329. package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.js +811 -0
  330. package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.js.map +1 -0
  331. package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.d.ts +44 -0
  332. package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -0
  333. package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js +3112 -0
  334. package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js.map +1 -0
  335. package/v3/@claude-flow/cli/dist/src/mcp-tools/index.d.ts +29 -0
  336. package/v3/@claude-flow/cli/dist/src/mcp-tools/index.d.ts.map +1 -0
  337. package/v3/@claude-flow/cli/dist/src/mcp-tools/index.js +28 -0
  338. package/v3/@claude-flow/cli/dist/src/mcp-tools/index.js.map +1 -0
  339. package/v3/@claude-flow/cli/dist/src/mcp-tools/infrastructure-tools.d.ts +10 -0
  340. package/v3/@claude-flow/cli/dist/src/mcp-tools/infrastructure-tools.d.ts.map +1 -0
  341. package/v3/@claude-flow/cli/dist/src/mcp-tools/infrastructure-tools.js +547 -0
  342. package/v3/@claude-flow/cli/dist/src/mcp-tools/infrastructure-tools.js.map +1 -0
  343. package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.d.ts +14 -0
  344. package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.d.ts.map +1 -0
  345. package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.js +512 -0
  346. package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.js.map +1 -0
  347. package/v3/@claude-flow/cli/dist/src/mcp-tools/neural-tools.d.ts +16 -0
  348. package/v3/@claude-flow/cli/dist/src/mcp-tools/neural-tools.d.ts.map +1 -0
  349. package/v3/@claude-flow/cli/dist/src/mcp-tools/neural-tools.js +461 -0
  350. package/v3/@claude-flow/cli/dist/src/mcp-tools/neural-tools.js.map +1 -0
  351. package/v3/@claude-flow/cli/dist/src/mcp-tools/performance-tools.d.ts +16 -0
  352. package/v3/@claude-flow/cli/dist/src/mcp-tools/performance-tools.d.ts.map +1 -0
  353. package/v3/@claude-flow/cli/dist/src/mcp-tools/performance-tools.js +534 -0
  354. package/v3/@claude-flow/cli/dist/src/mcp-tools/performance-tools.js.map +1 -0
  355. package/v3/@claude-flow/cli/dist/src/mcp-tools/plugin-tools.d.ts +19 -0
  356. package/v3/@claude-flow/cli/dist/src/mcp-tools/plugin-tools.d.ts.map +1 -0
  357. package/v3/@claude-flow/cli/dist/src/mcp-tools/plugin-tools.js +135 -0
  358. package/v3/@claude-flow/cli/dist/src/mcp-tools/plugin-tools.js.map +1 -0
  359. package/v3/@claude-flow/cli/dist/src/mcp-tools/process-manager-tools.d.ts +9 -0
  360. package/v3/@claude-flow/cli/dist/src/mcp-tools/process-manager-tools.d.ts.map +1 -0
  361. package/v3/@claude-flow/cli/dist/src/mcp-tools/process-manager-tools.js +516 -0
  362. package/v3/@claude-flow/cli/dist/src/mcp-tools/process-manager-tools.js.map +1 -0
  363. package/v3/@claude-flow/cli/dist/src/mcp-tools/progress-tools.d.ts +14 -0
  364. package/v3/@claude-flow/cli/dist/src/mcp-tools/progress-tools.d.ts.map +1 -0
  365. package/v3/@claude-flow/cli/dist/src/mcp-tools/progress-tools.js +348 -0
  366. package/v3/@claude-flow/cli/dist/src/mcp-tools/progress-tools.js.map +1 -0
  367. package/v3/@claude-flow/cli/dist/src/mcp-tools/refactor-tools.d.ts +10 -0
  368. package/v3/@claude-flow/cli/dist/src/mcp-tools/refactor-tools.d.ts.map +1 -0
  369. package/v3/@claude-flow/cli/dist/src/mcp-tools/refactor-tools.js +471 -0
  370. package/v3/@claude-flow/cli/dist/src/mcp-tools/refactor-tools.js.map +1 -0
  371. package/v3/@claude-flow/cli/dist/src/mcp-tools/ruvllm-tools.d.ts +9 -0
  372. package/v3/@claude-flow/cli/dist/src/mcp-tools/ruvllm-tools.d.ts.map +1 -0
  373. package/v3/@claude-flow/cli/dist/src/mcp-tools/ruvllm-tools.js +283 -0
  374. package/v3/@claude-flow/cli/dist/src/mcp-tools/ruvllm-tools.js.map +1 -0
  375. package/v3/@claude-flow/cli/dist/src/mcp-tools/security-tools.d.ts +18 -0
  376. package/v3/@claude-flow/cli/dist/src/mcp-tools/security-tools.d.ts.map +1 -0
  377. package/v3/@claude-flow/cli/dist/src/mcp-tools/security-tools.js +434 -0
  378. package/v3/@claude-flow/cli/dist/src/mcp-tools/security-tools.js.map +1 -0
  379. package/v3/@claude-flow/cli/dist/src/mcp-tools/session-tools.d.ts +8 -0
  380. package/v3/@claude-flow/cli/dist/src/mcp-tools/session-tools.d.ts.map +1 -0
  381. package/v3/@claude-flow/cli/dist/src/mcp-tools/session-tools.js +315 -0
  382. package/v3/@claude-flow/cli/dist/src/mcp-tools/session-tools.js.map +1 -0
  383. package/v3/@claude-flow/cli/dist/src/mcp-tools/skill-dispatch-tools.d.ts +17 -0
  384. package/v3/@claude-flow/cli/dist/src/mcp-tools/skill-dispatch-tools.d.ts.map +1 -0
  385. package/v3/@claude-flow/cli/dist/src/mcp-tools/skill-dispatch-tools.js +384 -0
  386. package/v3/@claude-flow/cli/dist/src/mcp-tools/skill-dispatch-tools.js.map +1 -0
  387. package/v3/@claude-flow/cli/dist/src/mcp-tools/skills-tools.d.ts +14 -0
  388. package/v3/@claude-flow/cli/dist/src/mcp-tools/skills-tools.d.ts.map +1 -0
  389. package/v3/@claude-flow/cli/dist/src/mcp-tools/skills-tools.js +295 -0
  390. package/v3/@claude-flow/cli/dist/src/mcp-tools/skills-tools.js.map +1 -0
  391. package/v3/@claude-flow/cli/dist/src/mcp-tools/swarm-tools.d.ts +9 -0
  392. package/v3/@claude-flow/cli/dist/src/mcp-tools/swarm-tools.d.ts.map +1 -0
  393. package/v3/@claude-flow/cli/dist/src/mcp-tools/swarm-tools.js +321 -0
  394. package/v3/@claude-flow/cli/dist/src/mcp-tools/swarm-tools.js.map +1 -0
  395. package/v3/@claude-flow/cli/dist/src/mcp-tools/system-tools.d.ts +13 -0
  396. package/v3/@claude-flow/cli/dist/src/mcp-tools/system-tools.d.ts.map +1 -0
  397. package/v3/@claude-flow/cli/dist/src/mcp-tools/system-tools.js +417 -0
  398. package/v3/@claude-flow/cli/dist/src/mcp-tools/system-tools.js.map +1 -0
  399. package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.d.ts +8 -0
  400. package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.d.ts.map +1 -0
  401. package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.js +404 -0
  402. package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.js.map +1 -0
  403. package/v3/@claude-flow/cli/dist/src/mcp-tools/terminal-tools.d.ts +15 -0
  404. package/v3/@claude-flow/cli/dist/src/mcp-tools/terminal-tools.d.ts.map +1 -0
  405. package/v3/@claude-flow/cli/dist/src/mcp-tools/terminal-tools.js +339 -0
  406. package/v3/@claude-flow/cli/dist/src/mcp-tools/terminal-tools.js.map +1 -0
  407. package/v3/@claude-flow/cli/dist/src/mcp-tools/transfer-tools.d.ts +14 -0
  408. package/v3/@claude-flow/cli/dist/src/mcp-tools/transfer-tools.d.ts.map +1 -0
  409. package/v3/@claude-flow/cli/dist/src/mcp-tools/transfer-tools.js +396 -0
  410. package/v3/@claude-flow/cli/dist/src/mcp-tools/transfer-tools.js.map +1 -0
  411. package/v3/@claude-flow/cli/dist/src/mcp-tools/types.d.ts +31 -0
  412. package/v3/@claude-flow/cli/dist/src/mcp-tools/types.d.ts.map +1 -0
  413. package/v3/@claude-flow/cli/dist/src/mcp-tools/types.js +7 -0
  414. package/v3/@claude-flow/cli/dist/src/mcp-tools/types.js.map +1 -0
  415. package/v3/@claude-flow/cli/dist/src/mcp-tools/wasm-agent-tools.d.ts +9 -0
  416. package/v3/@claude-flow/cli/dist/src/mcp-tools/wasm-agent-tools.d.ts.map +1 -0
  417. package/v3/@claude-flow/cli/dist/src/mcp-tools/wasm-agent-tools.js +230 -0
  418. package/v3/@claude-flow/cli/dist/src/mcp-tools/wasm-agent-tools.js.map +1 -0
  419. package/v3/@claude-flow/cli/dist/src/mcp-tools/workflow-tools.d.ts +8 -0
  420. package/v3/@claude-flow/cli/dist/src/mcp-tools/workflow-tools.d.ts.map +1 -0
  421. package/v3/@claude-flow/cli/dist/src/mcp-tools/workflow-tools.js +572 -0
  422. package/v3/@claude-flow/cli/dist/src/mcp-tools/workflow-tools.js.map +1 -0
  423. package/v3/@claude-flow/cli/dist/src/memory/ewc-consolidation.d.ts +295 -0
  424. package/v3/@claude-flow/cli/dist/src/memory/ewc-consolidation.d.ts.map +1 -0
  425. package/v3/@claude-flow/cli/dist/src/memory/ewc-consolidation.js +601 -0
  426. package/v3/@claude-flow/cli/dist/src/memory/ewc-consolidation.js.map +1 -0
  427. package/v3/@claude-flow/cli/dist/src/memory/intelligence.d.ts +338 -0
  428. package/v3/@claude-flow/cli/dist/src/memory/intelligence.d.ts.map +1 -0
  429. package/v3/@claude-flow/cli/dist/src/memory/intelligence.js +1023 -0
  430. package/v3/@claude-flow/cli/dist/src/memory/intelligence.js.map +1 -0
  431. package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.d.ts +407 -0
  432. package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.d.ts.map +1 -0
  433. package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.js +1494 -0
  434. package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.js.map +1 -0
  435. package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.d.ts +434 -0
  436. package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.d.ts.map +1 -0
  437. package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js +2243 -0
  438. package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js.map +1 -0
  439. package/v3/@claude-flow/cli/dist/src/memory/sona-optimizer.d.ts +227 -0
  440. package/v3/@claude-flow/cli/dist/src/memory/sona-optimizer.d.ts.map +1 -0
  441. package/v3/@claude-flow/cli/dist/src/memory/sona-optimizer.js +633 -0
  442. package/v3/@claude-flow/cli/dist/src/memory/sona-optimizer.js.map +1 -0
  443. package/v3/@claude-flow/cli/dist/src/output.d.ts +133 -0
  444. package/v3/@claude-flow/cli/dist/src/output.d.ts.map +1 -0
  445. package/v3/@claude-flow/cli/dist/src/output.js +514 -0
  446. package/v3/@claude-flow/cli/dist/src/output.js.map +1 -0
  447. package/v3/@claude-flow/cli/dist/src/parser.d.ts +51 -0
  448. package/v3/@claude-flow/cli/dist/src/parser.d.ts.map +1 -0
  449. package/v3/@claude-flow/cli/dist/src/parser.js +423 -0
  450. package/v3/@claude-flow/cli/dist/src/parser.js.map +1 -0
  451. package/v3/@claude-flow/cli/dist/src/plugins/manager.d.ts +133 -0
  452. package/v3/@claude-flow/cli/dist/src/plugins/manager.d.ts.map +1 -0
  453. package/v3/@claude-flow/cli/dist/src/plugins/manager.js +400 -0
  454. package/v3/@claude-flow/cli/dist/src/plugins/manager.js.map +1 -0
  455. package/v3/@claude-flow/cli/dist/src/plugins/store/discovery.d.ts +88 -0
  456. package/v3/@claude-flow/cli/dist/src/plugins/store/discovery.d.ts.map +1 -0
  457. package/v3/@claude-flow/cli/dist/src/plugins/store/discovery.js +1147 -0
  458. package/v3/@claude-flow/cli/dist/src/plugins/store/discovery.js.map +1 -0
  459. package/v3/@claude-flow/cli/dist/src/plugins/store/index.d.ts +76 -0
  460. package/v3/@claude-flow/cli/dist/src/plugins/store/index.d.ts.map +1 -0
  461. package/v3/@claude-flow/cli/dist/src/plugins/store/index.js +141 -0
  462. package/v3/@claude-flow/cli/dist/src/plugins/store/index.js.map +1 -0
  463. package/v3/@claude-flow/cli/dist/src/plugins/store/search.d.ts +46 -0
  464. package/v3/@claude-flow/cli/dist/src/plugins/store/search.d.ts.map +1 -0
  465. package/v3/@claude-flow/cli/dist/src/plugins/store/search.js +230 -0
  466. package/v3/@claude-flow/cli/dist/src/plugins/store/search.js.map +1 -0
  467. package/v3/@claude-flow/cli/dist/src/plugins/store/types.d.ts +274 -0
  468. package/v3/@claude-flow/cli/dist/src/plugins/store/types.d.ts.map +1 -0
  469. package/v3/@claude-flow/cli/dist/src/plugins/store/types.js +7 -0
  470. package/v3/@claude-flow/cli/dist/src/plugins/store/types.js.map +1 -0
  471. package/v3/@claude-flow/cli/dist/src/plugins/tests/demo-plugin-store.d.ts +7 -0
  472. package/v3/@claude-flow/cli/dist/src/plugins/tests/demo-plugin-store.d.ts.map +1 -0
  473. package/v3/@claude-flow/cli/dist/src/plugins/tests/demo-plugin-store.js +126 -0
  474. package/v3/@claude-flow/cli/dist/src/plugins/tests/demo-plugin-store.js.map +1 -0
  475. package/v3/@claude-flow/cli/dist/src/plugins/tests/standalone-test.d.ts +12 -0
  476. package/v3/@claude-flow/cli/dist/src/plugins/tests/standalone-test.d.ts.map +1 -0
  477. package/v3/@claude-flow/cli/dist/src/plugins/tests/standalone-test.js +188 -0
  478. package/v3/@claude-flow/cli/dist/src/plugins/tests/standalone-test.js.map +1 -0
  479. package/v3/@claude-flow/cli/dist/src/plugins/tests/test-plugin-store.d.ts +7 -0
  480. package/v3/@claude-flow/cli/dist/src/plugins/tests/test-plugin-store.d.ts.map +1 -0
  481. package/v3/@claude-flow/cli/dist/src/plugins/tests/test-plugin-store.js +206 -0
  482. package/v3/@claude-flow/cli/dist/src/plugins/tests/test-plugin-store.js.map +1 -0
  483. package/v3/@claude-flow/cli/dist/src/process-supervisor.d.ts +41 -0
  484. package/v3/@claude-flow/cli/dist/src/process-supervisor.d.ts.map +1 -0
  485. package/v3/@claude-flow/cli/dist/src/process-supervisor.js +214 -0
  486. package/v3/@claude-flow/cli/dist/src/process-supervisor.js.map +1 -0
  487. package/v3/@claude-flow/cli/dist/src/production/circuit-breaker.d.ts +101 -0
  488. package/v3/@claude-flow/cli/dist/src/production/circuit-breaker.d.ts.map +1 -0
  489. package/v3/@claude-flow/cli/dist/src/production/circuit-breaker.js +241 -0
  490. package/v3/@claude-flow/cli/dist/src/production/circuit-breaker.js.map +1 -0
  491. package/v3/@claude-flow/cli/dist/src/production/error-handler.d.ts +92 -0
  492. package/v3/@claude-flow/cli/dist/src/production/error-handler.d.ts.map +1 -0
  493. package/v3/@claude-flow/cli/dist/src/production/error-handler.js +299 -0
  494. package/v3/@claude-flow/cli/dist/src/production/error-handler.js.map +1 -0
  495. package/v3/@claude-flow/cli/dist/src/production/index.d.ts +23 -0
  496. package/v3/@claude-flow/cli/dist/src/production/index.d.ts.map +1 -0
  497. package/v3/@claude-flow/cli/dist/src/production/index.js +18 -0
  498. package/v3/@claude-flow/cli/dist/src/production/index.js.map +1 -0
  499. package/v3/@claude-flow/cli/dist/src/production/monitoring.d.ts +161 -0
  500. package/v3/@claude-flow/cli/dist/src/production/monitoring.d.ts.map +1 -0
  501. package/v3/@claude-flow/cli/dist/src/production/monitoring.js +356 -0
  502. package/v3/@claude-flow/cli/dist/src/production/monitoring.js.map +1 -0
  503. package/v3/@claude-flow/cli/dist/src/production/rate-limiter.d.ts +80 -0
  504. package/v3/@claude-flow/cli/dist/src/production/rate-limiter.d.ts.map +1 -0
  505. package/v3/@claude-flow/cli/dist/src/production/rate-limiter.js +201 -0
  506. package/v3/@claude-flow/cli/dist/src/production/rate-limiter.js.map +1 -0
  507. package/v3/@claude-flow/cli/dist/src/production/retry.d.ts +48 -0
  508. package/v3/@claude-flow/cli/dist/src/production/retry.d.ts.map +1 -0
  509. package/v3/@claude-flow/cli/dist/src/production/retry.js +179 -0
  510. package/v3/@claude-flow/cli/dist/src/production/retry.js.map +1 -0
  511. package/v3/@claude-flow/cli/dist/src/prompt.d.ts +44 -0
  512. package/v3/@claude-flow/cli/dist/src/prompt.d.ts.map +1 -0
  513. package/v3/@claude-flow/cli/dist/src/prompt.js +501 -0
  514. package/v3/@claude-flow/cli/dist/src/prompt.js.map +1 -0
  515. package/v3/@claude-flow/cli/dist/src/runtime/headless.d.ts +60 -0
  516. package/v3/@claude-flow/cli/dist/src/runtime/headless.d.ts.map +1 -0
  517. package/v3/@claude-flow/cli/dist/src/runtime/headless.js +284 -0
  518. package/v3/@claude-flow/cli/dist/src/runtime/headless.js.map +1 -0
  519. package/v3/@claude-flow/cli/dist/src/ruvector/agent-wasm.d.ts +182 -0
  520. package/v3/@claude-flow/cli/dist/src/ruvector/agent-wasm.d.ts.map +1 -0
  521. package/v3/@claude-flow/cli/dist/src/ruvector/agent-wasm.js +316 -0
  522. package/v3/@claude-flow/cli/dist/src/ruvector/agent-wasm.js.map +1 -0
  523. package/v3/@claude-flow/cli/dist/src/ruvector/ast-analyzer.d.ts +67 -0
  524. package/v3/@claude-flow/cli/dist/src/ruvector/ast-analyzer.d.ts.map +1 -0
  525. package/v3/@claude-flow/cli/dist/src/ruvector/ast-analyzer.js +277 -0
  526. package/v3/@claude-flow/cli/dist/src/ruvector/ast-analyzer.js.map +1 -0
  527. package/v3/@claude-flow/cli/dist/src/ruvector/coverage-router.d.ts +160 -0
  528. package/v3/@claude-flow/cli/dist/src/ruvector/coverage-router.d.ts.map +1 -0
  529. package/v3/@claude-flow/cli/dist/src/ruvector/coverage-router.js +529 -0
  530. package/v3/@claude-flow/cli/dist/src/ruvector/coverage-router.js.map +1 -0
  531. package/v3/@claude-flow/cli/dist/src/ruvector/coverage-tools.d.ts +33 -0
  532. package/v3/@claude-flow/cli/dist/src/ruvector/coverage-tools.d.ts.map +1 -0
  533. package/v3/@claude-flow/cli/dist/src/ruvector/coverage-tools.js +157 -0
  534. package/v3/@claude-flow/cli/dist/src/ruvector/coverage-tools.js.map +1 -0
  535. package/v3/@claude-flow/cli/dist/src/ruvector/diff-classifier.d.ts +175 -0
  536. package/v3/@claude-flow/cli/dist/src/ruvector/diff-classifier.d.ts.map +1 -0
  537. package/v3/@claude-flow/cli/dist/src/ruvector/diff-classifier.js +698 -0
  538. package/v3/@claude-flow/cli/dist/src/ruvector/diff-classifier.js.map +1 -0
  539. package/v3/@claude-flow/cli/dist/src/ruvector/enhanced-model-router.d.ts +146 -0
  540. package/v3/@claude-flow/cli/dist/src/ruvector/enhanced-model-router.d.ts.map +1 -0
  541. package/v3/@claude-flow/cli/dist/src/ruvector/enhanced-model-router.js +529 -0
  542. package/v3/@claude-flow/cli/dist/src/ruvector/enhanced-model-router.js.map +1 -0
  543. package/v3/@claude-flow/cli/dist/src/ruvector/flash-attention.d.ts +195 -0
  544. package/v3/@claude-flow/cli/dist/src/ruvector/flash-attention.d.ts.map +1 -0
  545. package/v3/@claude-flow/cli/dist/src/ruvector/flash-attention.js +643 -0
  546. package/v3/@claude-flow/cli/dist/src/ruvector/flash-attention.js.map +1 -0
  547. package/v3/@claude-flow/cli/dist/src/ruvector/graph-analyzer.d.ts +187 -0
  548. package/v3/@claude-flow/cli/dist/src/ruvector/graph-analyzer.d.ts.map +1 -0
  549. package/v3/@claude-flow/cli/dist/src/ruvector/graph-analyzer.js +929 -0
  550. package/v3/@claude-flow/cli/dist/src/ruvector/graph-analyzer.js.map +1 -0
  551. package/v3/@claude-flow/cli/dist/src/ruvector/index.d.ts +40 -0
  552. package/v3/@claude-flow/cli/dist/src/ruvector/index.d.ts.map +1 -0
  553. package/v3/@claude-flow/cli/dist/src/ruvector/index.js +76 -0
  554. package/v3/@claude-flow/cli/dist/src/ruvector/index.js.map +1 -0
  555. package/v3/@claude-flow/cli/dist/src/ruvector/lora-adapter.d.ts +218 -0
  556. package/v3/@claude-flow/cli/dist/src/ruvector/lora-adapter.d.ts.map +1 -0
  557. package/v3/@claude-flow/cli/dist/src/ruvector/lora-adapter.js +455 -0
  558. package/v3/@claude-flow/cli/dist/src/ruvector/lora-adapter.js.map +1 -0
  559. package/v3/@claude-flow/cli/dist/src/ruvector/model-router.d.ts +220 -0
  560. package/v3/@claude-flow/cli/dist/src/ruvector/model-router.d.ts.map +1 -0
  561. package/v3/@claude-flow/cli/dist/src/ruvector/model-router.js +488 -0
  562. package/v3/@claude-flow/cli/dist/src/ruvector/model-router.js.map +1 -0
  563. package/v3/@claude-flow/cli/dist/src/ruvector/moe-router.d.ts +206 -0
  564. package/v3/@claude-flow/cli/dist/src/ruvector/moe-router.d.ts.map +1 -0
  565. package/v3/@claude-flow/cli/dist/src/ruvector/moe-router.js +626 -0
  566. package/v3/@claude-flow/cli/dist/src/ruvector/moe-router.js.map +1 -0
  567. package/v3/@claude-flow/cli/dist/src/ruvector/q-learning-router.d.ts +211 -0
  568. package/v3/@claude-flow/cli/dist/src/ruvector/q-learning-router.d.ts.map +1 -0
  569. package/v3/@claude-flow/cli/dist/src/ruvector/q-learning-router.js +681 -0
  570. package/v3/@claude-flow/cli/dist/src/ruvector/q-learning-router.js.map +1 -0
  571. package/v3/@claude-flow/cli/dist/src/ruvector/ruvllm-wasm.d.ts +179 -0
  572. package/v3/@claude-flow/cli/dist/src/ruvector/ruvllm-wasm.d.ts.map +1 -0
  573. package/v3/@claude-flow/cli/dist/src/ruvector/ruvllm-wasm.js +363 -0
  574. package/v3/@claude-flow/cli/dist/src/ruvector/ruvllm-wasm.js.map +1 -0
  575. package/v3/@claude-flow/cli/dist/src/ruvector/semantic-router.d.ts +77 -0
  576. package/v3/@claude-flow/cli/dist/src/ruvector/semantic-router.d.ts.map +1 -0
  577. package/v3/@claude-flow/cli/dist/src/ruvector/semantic-router.js +178 -0
  578. package/v3/@claude-flow/cli/dist/src/ruvector/semantic-router.js.map +1 -0
  579. package/v3/@claude-flow/cli/dist/src/ruvector/vector-db.d.ts +69 -0
  580. package/v3/@claude-flow/cli/dist/src/ruvector/vector-db.d.ts.map +1 -0
  581. package/v3/@claude-flow/cli/dist/src/ruvector/vector-db.js +243 -0
  582. package/v3/@claude-flow/cli/dist/src/ruvector/vector-db.js.map +1 -0
  583. package/v3/@claude-flow/cli/dist/src/services/agentic-flow-bridge.d.ts +54 -0
  584. package/v3/@claude-flow/cli/dist/src/services/agentic-flow-bridge.d.ts.map +1 -0
  585. package/v3/@claude-flow/cli/dist/src/services/agentic-flow-bridge.js +100 -0
  586. package/v3/@claude-flow/cli/dist/src/services/agentic-flow-bridge.js.map +1 -0
  587. package/v3/@claude-flow/cli/dist/src/services/claim-service.d.ts +204 -0
  588. package/v3/@claude-flow/cli/dist/src/services/claim-service.d.ts.map +1 -0
  589. package/v3/@claude-flow/cli/dist/src/services/claim-service.js +818 -0
  590. package/v3/@claude-flow/cli/dist/src/services/claim-service.js.map +1 -0
  591. package/v3/@claude-flow/cli/dist/src/services/container-worker-pool.d.ts +197 -0
  592. package/v3/@claude-flow/cli/dist/src/services/container-worker-pool.d.ts.map +1 -0
  593. package/v3/@claude-flow/cli/dist/src/services/container-worker-pool.js +583 -0
  594. package/v3/@claude-flow/cli/dist/src/services/container-worker-pool.js.map +1 -0
  595. package/v3/@claude-flow/cli/dist/src/services/headless-worker-executor.d.ts +304 -0
  596. package/v3/@claude-flow/cli/dist/src/services/headless-worker-executor.d.ts.map +1 -0
  597. package/v3/@claude-flow/cli/dist/src/services/headless-worker-executor.js +1011 -0
  598. package/v3/@claude-flow/cli/dist/src/services/headless-worker-executor.js.map +1 -0
  599. package/v3/@claude-flow/cli/dist/src/services/index.d.ts +13 -0
  600. package/v3/@claude-flow/cli/dist/src/services/index.d.ts.map +1 -0
  601. package/v3/@claude-flow/cli/dist/src/services/index.js +11 -0
  602. package/v3/@claude-flow/cli/dist/src/services/index.js.map +1 -0
  603. package/v3/@claude-flow/cli/dist/src/services/registry-api.d.ts +58 -0
  604. package/v3/@claude-flow/cli/dist/src/services/registry-api.d.ts.map +1 -0
  605. package/v3/@claude-flow/cli/dist/src/services/registry-api.js +146 -0
  606. package/v3/@claude-flow/cli/dist/src/services/registry-api.js.map +1 -0
  607. package/v3/@claude-flow/cli/dist/src/services/ruvector-training.d.ts +222 -0
  608. package/v3/@claude-flow/cli/dist/src/services/ruvector-training.d.ts.map +1 -0
  609. package/v3/@claude-flow/cli/dist/src/services/ruvector-training.js +688 -0
  610. package/v3/@claude-flow/cli/dist/src/services/ruvector-training.js.map +1 -0
  611. package/v3/@claude-flow/cli/dist/src/services/worker-daemon.d.ts +237 -0
  612. package/v3/@claude-flow/cli/dist/src/services/worker-daemon.d.ts.map +1 -0
  613. package/v3/@claude-flow/cli/dist/src/services/worker-daemon.js +959 -0
  614. package/v3/@claude-flow/cli/dist/src/services/worker-daemon.js.map +1 -0
  615. package/v3/@claude-flow/cli/dist/src/services/worker-queue.d.ts +194 -0
  616. package/v3/@claude-flow/cli/dist/src/services/worker-queue.d.ts.map +1 -0
  617. package/v3/@claude-flow/cli/dist/src/services/worker-queue.js +513 -0
  618. package/v3/@claude-flow/cli/dist/src/services/worker-queue.js.map +1 -0
  619. package/v3/@claude-flow/cli/dist/src/suggest.d.ts +53 -0
  620. package/v3/@claude-flow/cli/dist/src/suggest.d.ts.map +1 -0
  621. package/v3/@claude-flow/cli/dist/src/suggest.js +200 -0
  622. package/v3/@claude-flow/cli/dist/src/suggest.js.map +1 -0
  623. package/v3/@claude-flow/cli/dist/src/transfer/anonymization/index.d.ts +25 -0
  624. package/v3/@claude-flow/cli/dist/src/transfer/anonymization/index.d.ts.map +1 -0
  625. package/v3/@claude-flow/cli/dist/src/transfer/anonymization/index.js +175 -0
  626. package/v3/@claude-flow/cli/dist/src/transfer/anonymization/index.js.map +1 -0
  627. package/v3/@claude-flow/cli/dist/src/transfer/deploy-seraphine.d.ts +13 -0
  628. package/v3/@claude-flow/cli/dist/src/transfer/deploy-seraphine.d.ts.map +1 -0
  629. package/v3/@claude-flow/cli/dist/src/transfer/deploy-seraphine.js +205 -0
  630. package/v3/@claude-flow/cli/dist/src/transfer/deploy-seraphine.js.map +1 -0
  631. package/v3/@claude-flow/cli/dist/src/transfer/export.d.ts +25 -0
  632. package/v3/@claude-flow/cli/dist/src/transfer/export.d.ts.map +1 -0
  633. package/v3/@claude-flow/cli/dist/src/transfer/export.js +113 -0
  634. package/v3/@claude-flow/cli/dist/src/transfer/export.js.map +1 -0
  635. package/v3/@claude-flow/cli/dist/src/transfer/index.d.ts +12 -0
  636. package/v3/@claude-flow/cli/dist/src/transfer/index.d.ts.map +1 -0
  637. package/v3/@claude-flow/cli/dist/src/transfer/index.js +31 -0
  638. package/v3/@claude-flow/cli/dist/src/transfer/index.js.map +1 -0
  639. package/v3/@claude-flow/cli/dist/src/transfer/ipfs/client.d.ts +109 -0
  640. package/v3/@claude-flow/cli/dist/src/transfer/ipfs/client.d.ts.map +1 -0
  641. package/v3/@claude-flow/cli/dist/src/transfer/ipfs/client.js +307 -0
  642. package/v3/@claude-flow/cli/dist/src/transfer/ipfs/client.js.map +1 -0
  643. package/v3/@claude-flow/cli/dist/src/transfer/ipfs/upload.d.ts +95 -0
  644. package/v3/@claude-flow/cli/dist/src/transfer/ipfs/upload.d.ts.map +1 -0
  645. package/v3/@claude-flow/cli/dist/src/transfer/ipfs/upload.js +411 -0
  646. package/v3/@claude-flow/cli/dist/src/transfer/ipfs/upload.js.map +1 -0
  647. package/v3/@claude-flow/cli/dist/src/transfer/models/seraphine.d.ts +72 -0
  648. package/v3/@claude-flow/cli/dist/src/transfer/models/seraphine.d.ts.map +1 -0
  649. package/v3/@claude-flow/cli/dist/src/transfer/models/seraphine.js +373 -0
  650. package/v3/@claude-flow/cli/dist/src/transfer/models/seraphine.js.map +1 -0
  651. package/v3/@claude-flow/cli/dist/src/transfer/serialization/cfp.d.ts +49 -0
  652. package/v3/@claude-flow/cli/dist/src/transfer/serialization/cfp.d.ts.map +1 -0
  653. package/v3/@claude-flow/cli/dist/src/transfer/serialization/cfp.js +183 -0
  654. package/v3/@claude-flow/cli/dist/src/transfer/serialization/cfp.js.map +1 -0
  655. package/v3/@claude-flow/cli/dist/src/transfer/storage/gcs.d.ts +82 -0
  656. package/v3/@claude-flow/cli/dist/src/transfer/storage/gcs.d.ts.map +1 -0
  657. package/v3/@claude-flow/cli/dist/src/transfer/storage/gcs.js +272 -0
  658. package/v3/@claude-flow/cli/dist/src/transfer/storage/gcs.js.map +1 -0
  659. package/v3/@claude-flow/cli/dist/src/transfer/storage/index.d.ts +6 -0
  660. package/v3/@claude-flow/cli/dist/src/transfer/storage/index.d.ts.map +1 -0
  661. package/v3/@claude-flow/cli/dist/src/transfer/storage/index.js +6 -0
  662. package/v3/@claude-flow/cli/dist/src/transfer/storage/index.js.map +1 -0
  663. package/v3/@claude-flow/cli/dist/src/transfer/store/discovery.d.ts +84 -0
  664. package/v3/@claude-flow/cli/dist/src/transfer/store/discovery.d.ts.map +1 -0
  665. package/v3/@claude-flow/cli/dist/src/transfer/store/discovery.js +382 -0
  666. package/v3/@claude-flow/cli/dist/src/transfer/store/discovery.js.map +1 -0
  667. package/v3/@claude-flow/cli/dist/src/transfer/store/download.d.ts +70 -0
  668. package/v3/@claude-flow/cli/dist/src/transfer/store/download.d.ts.map +1 -0
  669. package/v3/@claude-flow/cli/dist/src/transfer/store/download.js +334 -0
  670. package/v3/@claude-flow/cli/dist/src/transfer/store/download.js.map +1 -0
  671. package/v3/@claude-flow/cli/dist/src/transfer/store/index.d.ts +84 -0
  672. package/v3/@claude-flow/cli/dist/src/transfer/store/index.d.ts.map +1 -0
  673. package/v3/@claude-flow/cli/dist/src/transfer/store/index.js +153 -0
  674. package/v3/@claude-flow/cli/dist/src/transfer/store/index.js.map +1 -0
  675. package/v3/@claude-flow/cli/dist/src/transfer/store/publish.d.ts +76 -0
  676. package/v3/@claude-flow/cli/dist/src/transfer/store/publish.d.ts.map +1 -0
  677. package/v3/@claude-flow/cli/dist/src/transfer/store/publish.js +294 -0
  678. package/v3/@claude-flow/cli/dist/src/transfer/store/publish.js.map +1 -0
  679. package/v3/@claude-flow/cli/dist/src/transfer/store/registry.d.ts +58 -0
  680. package/v3/@claude-flow/cli/dist/src/transfer/store/registry.d.ts.map +1 -0
  681. package/v3/@claude-flow/cli/dist/src/transfer/store/registry.js +285 -0
  682. package/v3/@claude-flow/cli/dist/src/transfer/store/registry.js.map +1 -0
  683. package/v3/@claude-flow/cli/dist/src/transfer/store/search.d.ts +54 -0
  684. package/v3/@claude-flow/cli/dist/src/transfer/store/search.d.ts.map +1 -0
  685. package/v3/@claude-flow/cli/dist/src/transfer/store/search.js +232 -0
  686. package/v3/@claude-flow/cli/dist/src/transfer/store/search.js.map +1 -0
  687. package/v3/@claude-flow/cli/dist/src/transfer/store/tests/standalone-test.d.ts +12 -0
  688. package/v3/@claude-flow/cli/dist/src/transfer/store/tests/standalone-test.d.ts.map +1 -0
  689. package/v3/@claude-flow/cli/dist/src/transfer/store/tests/standalone-test.js +190 -0
  690. package/v3/@claude-flow/cli/dist/src/transfer/store/tests/standalone-test.js.map +1 -0
  691. package/v3/@claude-flow/cli/dist/src/transfer/store/types.d.ts +193 -0
  692. package/v3/@claude-flow/cli/dist/src/transfer/store/types.d.ts.map +1 -0
  693. package/v3/@claude-flow/cli/dist/src/transfer/store/types.js +6 -0
  694. package/v3/@claude-flow/cli/dist/src/transfer/store/types.js.map +1 -0
  695. package/v3/@claude-flow/cli/dist/src/transfer/test-seraphine.d.ts +6 -0
  696. package/v3/@claude-flow/cli/dist/src/transfer/test-seraphine.d.ts.map +1 -0
  697. package/v3/@claude-flow/cli/dist/src/transfer/test-seraphine.js +105 -0
  698. package/v3/@claude-flow/cli/dist/src/transfer/test-seraphine.js.map +1 -0
  699. package/v3/@claude-flow/cli/dist/src/transfer/tests/test-store.d.ts +7 -0
  700. package/v3/@claude-flow/cli/dist/src/transfer/tests/test-store.d.ts.map +1 -0
  701. package/v3/@claude-flow/cli/dist/src/transfer/tests/test-store.js +214 -0
  702. package/v3/@claude-flow/cli/dist/src/transfer/tests/test-store.js.map +1 -0
  703. package/v3/@claude-flow/cli/dist/src/transfer/types.d.ts +245 -0
  704. package/v3/@claude-flow/cli/dist/src/transfer/types.d.ts.map +1 -0
  705. package/v3/@claude-flow/cli/dist/src/transfer/types.js +6 -0
  706. package/v3/@claude-flow/cli/dist/src/transfer/types.js.map +1 -0
  707. package/v3/@claude-flow/cli/dist/src/types.d.ts +198 -0
  708. package/v3/@claude-flow/cli/dist/src/types.d.ts.map +1 -0
  709. package/v3/@claude-flow/cli/dist/src/types.js +38 -0
  710. package/v3/@claude-flow/cli/dist/src/types.js.map +1 -0
  711. package/v3/@claude-flow/cli/dist/src/update/checker.d.ts +34 -0
  712. package/v3/@claude-flow/cli/dist/src/update/checker.d.ts.map +1 -0
  713. package/v3/@claude-flow/cli/dist/src/update/checker.js +190 -0
  714. package/v3/@claude-flow/cli/dist/src/update/checker.js.map +1 -0
  715. package/v3/@claude-flow/cli/dist/src/update/executor.d.ts +32 -0
  716. package/v3/@claude-flow/cli/dist/src/update/executor.d.ts.map +1 -0
  717. package/v3/@claude-flow/cli/dist/src/update/executor.js +181 -0
  718. package/v3/@claude-flow/cli/dist/src/update/executor.js.map +1 -0
  719. package/v3/@claude-flow/cli/dist/src/update/index.d.ts +33 -0
  720. package/v3/@claude-flow/cli/dist/src/update/index.d.ts.map +1 -0
  721. package/v3/@claude-flow/cli/dist/src/update/index.js +64 -0
  722. package/v3/@claude-flow/cli/dist/src/update/index.js.map +1 -0
  723. package/v3/@claude-flow/cli/dist/src/update/rate-limiter.d.ts +20 -0
  724. package/v3/@claude-flow/cli/dist/src/update/rate-limiter.d.ts.map +1 -0
  725. package/v3/@claude-flow/cli/dist/src/update/rate-limiter.js +96 -0
  726. package/v3/@claude-flow/cli/dist/src/update/rate-limiter.js.map +1 -0
  727. package/v3/@claude-flow/cli/dist/src/update/validator.d.ts +17 -0
  728. package/v3/@claude-flow/cli/dist/src/update/validator.d.ts.map +1 -0
  729. package/v3/@claude-flow/cli/dist/src/update/validator.js +123 -0
  730. package/v3/@claude-flow/cli/dist/src/update/validator.js.map +1 -0
  731. package/v3/@claude-flow/cli/dist/tsconfig.tsbuildinfo +1 -0
  732. package/v3/@claude-flow/cli/package.json +109 -0
@@ -0,0 +1,1738 @@
1
+ /**
2
+ * Init Executor
3
+ * Main execution logic for V3 initialization
4
+ */
5
+ import * as fs from 'fs';
6
+ import * as path from 'path';
7
+ import { fileURLToPath } from 'url';
8
+ import { createRequire } from 'module';
9
+ import { dirname } from 'path';
10
+ // ESM-compatible __dirname
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = dirname(__filename);
13
+ import { detectPlatform, DEFAULT_INIT_OPTIONS } from './types.js';
14
+ import { generateSettingsJson, generateSettings } from './settings-generator.js';
15
+ import { generateMCPJson } from './mcp-generator.js';
16
+ import { generateStatuslineScript } from './statusline-generator.js';
17
+ import { generatePreCommitHook, generatePostCommitHook, generateSessionManager, generateAgentRouter, generateMemoryHelper, generateHookHandler, generateIntelligenceStub, generateAutoMemoryHook, } from './helpers-generator.js';
18
+ import { generateClaudeMd } from './claudemd-generator.js';
19
+ /**
20
+ * Skills to copy based on configuration
21
+ */
22
+ const SKILLS_MAP = {
23
+ core: [
24
+ 'swarm-orchestration',
25
+ 'swarm-advanced',
26
+ 'sparc-methodology',
27
+ 'hooks-automation',
28
+ 'pair-programming',
29
+ 'verification-quality',
30
+ 'stream-chain',
31
+ 'skill-builder',
32
+ ],
33
+ browser: ['browser'], // agent-browser integration
34
+ dualMode: ['dual-mode'], // Claude Code + Codex hybrid execution
35
+ agentdb: [
36
+ 'agentdb-advanced',
37
+ 'agentdb-learning',
38
+ 'agentdb-memory-patterns',
39
+ 'agentdb-optimization',
40
+ 'agentdb-vector-search',
41
+ 'reasoningbank-agentdb',
42
+ 'reasoningbank-intelligence',
43
+ ],
44
+ github: [
45
+ 'github-code-review',
46
+ 'github-multi-repo',
47
+ 'github-project-management',
48
+ 'github-release-management',
49
+ 'github-workflow-automation',
50
+ ],
51
+ flowNexus: [
52
+ 'flow-nexus-neural',
53
+ 'flow-nexus-platform',
54
+ 'flow-nexus-swarm',
55
+ ],
56
+ v3: [
57
+ 'v3-cli-modernization',
58
+ 'v3-core-implementation',
59
+ 'v3-ddd-architecture',
60
+ 'v3-integration-deep',
61
+ 'v3-mcp-optimization',
62
+ 'v3-memory-unification',
63
+ 'v3-performance-optimization',
64
+ 'v3-security-overhaul',
65
+ 'v3-swarm-coordination',
66
+ ],
67
+ };
68
+ /**
69
+ * Commands to copy based on configuration
70
+ */
71
+ const COMMANDS_MAP = {
72
+ core: ['claude-flow-help.md', 'claude-flow-swarm.md', 'claude-flow-memory.md'],
73
+ analysis: ['analysis'],
74
+ automation: ['automation'],
75
+ github: ['github'],
76
+ hooks: ['hooks'],
77
+ monitoring: ['monitoring'],
78
+ optimization: ['optimization'],
79
+ sparc: ['sparc'],
80
+ };
81
+ /**
82
+ * Agents to copy based on configuration
83
+ */
84
+ const AGENTS_MAP = {
85
+ core: ['core'],
86
+ consensus: ['consensus'],
87
+ github: ['github'],
88
+ hiveMind: ['hive-mind'],
89
+ sparc: ['sparc'],
90
+ swarm: ['swarm'],
91
+ browser: ['browser'], // agent-browser integration
92
+ dualMode: ['dual-mode'], // Claude Code + Codex hybrid execution
93
+ // V3-specific agents
94
+ v3: ['v3'],
95
+ optimization: ['optimization'],
96
+ templates: ['templates'],
97
+ testing: ['testing'],
98
+ sublinear: ['sublinear'],
99
+ flowNexus: ['flow-nexus'],
100
+ analysis: ['analysis'],
101
+ architecture: ['architecture'],
102
+ development: ['development'],
103
+ devops: ['devops'],
104
+ documentation: ['documentation'],
105
+ specialized: ['specialized'],
106
+ goal: ['goal'],
107
+ sona: ['sona'],
108
+ payments: ['payments'],
109
+ data: ['data'],
110
+ custom: ['custom'],
111
+ };
112
+ /**
113
+ * Directory structure to create
114
+ */
115
+ const DIRECTORIES = {
116
+ claude: [
117
+ '.claude',
118
+ '.claude/skills',
119
+ '.claude/commands',
120
+ '.claude/agents',
121
+ '.claude/helpers',
122
+ ],
123
+ runtime: [
124
+ '.claude-flow',
125
+ '.claude-flow/data',
126
+ '.claude-flow/logs',
127
+ '.claude-flow/sessions',
128
+ '.claude-flow/hooks',
129
+ '.claude-flow/agents',
130
+ '.claude-flow/workflows',
131
+ ],
132
+ };
133
+ /**
134
+ * Execute initialization
135
+ */
136
+ export async function executeInit(options) {
137
+ // Detect platform
138
+ const platform = detectPlatform();
139
+ const result = {
140
+ success: true,
141
+ platform,
142
+ created: {
143
+ directories: [],
144
+ files: [],
145
+ },
146
+ skipped: [],
147
+ errors: [],
148
+ summary: {
149
+ skillsCount: 0,
150
+ commandsCount: 0,
151
+ agentsCount: 0,
152
+ hooksEnabled: 0,
153
+ },
154
+ };
155
+ const targetDir = options.targetDir;
156
+ try {
157
+ // Create directory structure
158
+ await createDirectories(targetDir, options, result);
159
+ // Generate and write settings.json
160
+ if (options.components.settings) {
161
+ await writeSettings(targetDir, options, result);
162
+ }
163
+ // Generate and write .mcp.json
164
+ if (options.components.mcp) {
165
+ await writeMCPConfig(targetDir, options, result);
166
+ }
167
+ // Copy skills
168
+ if (options.components.skills) {
169
+ await copySkills(targetDir, options, result);
170
+ }
171
+ // Copy commands
172
+ if (options.components.commands) {
173
+ await copyCommands(targetDir, options, result);
174
+ }
175
+ // Copy agents
176
+ if (options.components.agents) {
177
+ await copyAgents(targetDir, options, result);
178
+ }
179
+ // Generate helpers
180
+ if (options.components.helpers) {
181
+ await writeHelpers(targetDir, options, result);
182
+ }
183
+ // Generate statusline
184
+ if (options.components.statusline) {
185
+ await writeStatusline(targetDir, options, result);
186
+ }
187
+ // Generate runtime config
188
+ if (options.components.runtime) {
189
+ await writeRuntimeConfig(targetDir, options, result);
190
+ }
191
+ // Create initial metrics for statusline (prevents "all zeros" display)
192
+ if (options.components.statusline) {
193
+ await writeInitialMetrics(targetDir, options, result);
194
+ }
195
+ // Generate CLAUDE.md
196
+ if (options.components.claudeMd) {
197
+ await writeClaudeMd(targetDir, options, result);
198
+ }
199
+ // Count enabled hooks
200
+ result.summary.hooksEnabled = countEnabledHooks(options);
201
+ }
202
+ catch (error) {
203
+ result.success = false;
204
+ result.errors.push(error instanceof Error ? error.message : String(error));
205
+ }
206
+ return result;
207
+ }
208
+ /**
209
+ * Merge new settings into existing settings.json
210
+ * Preserves user customizations while adding new features like Agent Teams
211
+ * Uses platform-specific commands for Mac, Linux, and Windows
212
+ */
213
+ function mergeSettingsForUpgrade(existing) {
214
+ const merged = { ...existing };
215
+ const platform = detectPlatform();
216
+ const isWindows = platform.os === 'windows';
217
+ // Platform-specific command wrappers
218
+ // Windows: Use PowerShell-compatible commands
219
+ // Mac/Linux: Use bash-compatible commands with 2>/dev/null
220
+ // NOTE: teammateIdleCmd and taskCompletedCmd were removed.
221
+ // TeammateIdle/TaskCompleted are not valid Claude Code hook events and caused warnings.
222
+ // Agent Teams hook config lives in claudeFlow.agentTeams.hooks instead.
223
+ // 1. Merge env vars (preserve existing, add new)
224
+ const existingEnv = existing.env || {};
225
+ merged.env = {
226
+ ...existingEnv,
227
+ CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS: '1',
228
+ CLAUDE_FLOW_V3_ENABLED: existingEnv.CLAUDE_FLOW_V3_ENABLED || 'true',
229
+ CLAUDE_FLOW_HOOKS_ENABLED: existingEnv.CLAUDE_FLOW_HOOKS_ENABLED || 'true',
230
+ };
231
+ // 2. Merge hooks (preserve existing, add new Agent Teams + auto-memory hooks)
232
+ const existingHooks = existing.hooks || {};
233
+ merged.hooks = { ...existingHooks };
234
+ // Cross-platform auto-memory hook commands that resolve paths via git root.
235
+ // Uses node -e with git rev-parse so hooks work regardless of CWD (#1259, #1284).
236
+ const gitRootResolver = "var c=require('child_process'),p=require('path'),u=require('url'),r;"
237
+ + "try{r=c.execSync('git rev-parse --show-toplevel',{encoding:'utf8'}).trim()}"
238
+ + 'catch(e){r=process.cwd()}';
239
+ const autoMemoryScript = '.claude/helpers/auto-memory-hook.mjs';
240
+ const autoMemoryImportCmd = `node -e "${gitRootResolver}var f=p.join(r,'${autoMemoryScript}');import(u.pathToFileURL(f).href)" import`;
241
+ const autoMemorySyncCmd = `node -e "${gitRootResolver}var f=p.join(r,'${autoMemoryScript}');import(u.pathToFileURL(f).href)" sync`;
242
+ // Add auto-memory import to SessionStart (if not already present)
243
+ const sessionStartHooks = existingHooks.SessionStart;
244
+ const hasAutoMemoryImport = sessionStartHooks?.some(group => group.hooks?.some(h => h.command?.includes('auto-memory-hook')));
245
+ if (!hasAutoMemoryImport) {
246
+ const startHooks = merged.hooks;
247
+ if (!startHooks.SessionStart) {
248
+ startHooks.SessionStart = [{ hooks: [] }];
249
+ }
250
+ const startGroup = startHooks.SessionStart[0];
251
+ if (!startGroup.hooks)
252
+ startGroup.hooks = [];
253
+ startGroup.hooks.push({
254
+ type: 'command',
255
+ command: autoMemoryImportCmd,
256
+ timeout: 6000,
257
+ continueOnError: true,
258
+ });
259
+ }
260
+ // Add auto-memory sync to SessionEnd (if not already present)
261
+ const sessionEndHooks = existingHooks.SessionEnd;
262
+ const hasAutoMemorySync = sessionEndHooks?.some(group => group.hooks?.some(h => h.command?.includes('auto-memory-hook')));
263
+ if (!hasAutoMemorySync) {
264
+ const endHooks = merged.hooks;
265
+ if (!endHooks.SessionEnd) {
266
+ endHooks.SessionEnd = [{ hooks: [] }];
267
+ }
268
+ const endGroup = endHooks.SessionEnd[0];
269
+ if (!endGroup.hooks)
270
+ endGroup.hooks = [];
271
+ // Insert at beginning so sync runs before other cleanup
272
+ endGroup.hooks.unshift({
273
+ type: 'command',
274
+ command: autoMemorySyncCmd,
275
+ timeout: 8000,
276
+ continueOnError: true,
277
+ });
278
+ }
279
+ // NOTE: TeammateIdle and TaskCompleted are NOT valid Claude Code hook events.
280
+ // They cause warnings when present in settings.json hooks.
281
+ // Remove them if they exist from a previous init.
282
+ delete merged.hooks.TeammateIdle;
283
+ delete merged.hooks.TaskCompleted;
284
+ // Their configuration lives in claudeFlow.agentTeams.hooks instead.
285
+ // 3. Fix statusLine config (remove invalid fields, ensure correct format)
286
+ // Claude Code only supports: type, command, padding
287
+ const existingStatusLine = existing.statusLine;
288
+ if (existingStatusLine) {
289
+ merged.statusLine = {
290
+ type: 'command',
291
+ command: existingStatusLine.command || `node -e "var c=require('child_process'),p=require('path'),r;try{r=c.execSync('git rev-parse --show-toplevel',{encoding:'utf8'}).trim()}catch(e){r=process.cwd()}var s=p.join(r,'.claude/helpers/statusline.cjs');process.argv.splice(1,0,s);require(s)"`,
292
+ // Remove invalid fields: refreshMs, enabled (not supported by Claude Code)
293
+ };
294
+ }
295
+ // 4. Merge claudeFlow settings (preserve existing, add agentTeams + memory)
296
+ const existingClaudeFlow = existing.claudeFlow || {};
297
+ const existingMemory = existingClaudeFlow.memory || {};
298
+ merged.claudeFlow = {
299
+ ...existingClaudeFlow,
300
+ version: existingClaudeFlow.version || '3.0.0',
301
+ enabled: existingClaudeFlow.enabled !== false,
302
+ agentTeams: {
303
+ enabled: true,
304
+ teammateMode: 'auto',
305
+ taskListEnabled: true,
306
+ mailboxEnabled: true,
307
+ coordination: {
308
+ autoAssignOnIdle: true,
309
+ trainPatternsOnComplete: true,
310
+ notifyLeadOnComplete: true,
311
+ sharedMemoryNamespace: 'agent-teams',
312
+ },
313
+ hooks: {
314
+ teammateIdle: { enabled: true, autoAssign: true, checkTaskList: true },
315
+ taskCompleted: { enabled: true, trainPatterns: true, notifyLead: true },
316
+ },
317
+ },
318
+ memory: {
319
+ ...existingMemory,
320
+ learningBridge: existingMemory.learningBridge ?? { enabled: true },
321
+ memoryGraph: existingMemory.memoryGraph ?? { enabled: true },
322
+ agentScopes: existingMemory.agentScopes ?? { enabled: true },
323
+ },
324
+ };
325
+ return merged;
326
+ }
327
+ /**
328
+ * Execute upgrade - updates helpers and creates missing metrics without losing data
329
+ * This is safe for existing users who want the latest statusline fixes
330
+ * @param targetDir - Target directory
331
+ * @param upgradeSettings - If true, merge new settings into existing settings.json
332
+ */
333
+ export async function executeUpgrade(targetDir, upgradeSettings = false) {
334
+ const result = {
335
+ success: true,
336
+ updated: [],
337
+ created: [],
338
+ preserved: [],
339
+ errors: [],
340
+ settingsUpdated: [],
341
+ };
342
+ try {
343
+ // Ensure required directories exist
344
+ const dirs = [
345
+ '.claude/helpers',
346
+ '.claude-flow/metrics',
347
+ '.claude-flow/security',
348
+ '.claude-flow/learning',
349
+ ];
350
+ for (const dir of dirs) {
351
+ const fullPath = path.join(targetDir, dir);
352
+ if (!fs.existsSync(fullPath)) {
353
+ fs.mkdirSync(fullPath, { recursive: true });
354
+ }
355
+ }
356
+ // 0. ALWAYS update critical helpers (force overwrite)
357
+ const sourceHelpersForUpgrade = findSourceHelpersDir();
358
+ if (sourceHelpersForUpgrade) {
359
+ const criticalHelpers = ['auto-memory-hook.mjs', 'hook-handler.cjs', 'intelligence.cjs'];
360
+ for (const helperName of criticalHelpers) {
361
+ const targetPath = path.join(targetDir, '.claude', 'helpers', helperName);
362
+ const sourcePath = path.join(sourceHelpersForUpgrade, helperName);
363
+ if (fs.existsSync(sourcePath)) {
364
+ if (fs.existsSync(targetPath)) {
365
+ result.updated.push(`.claude/helpers/${helperName}`);
366
+ }
367
+ else {
368
+ result.created.push(`.claude/helpers/${helperName}`);
369
+ }
370
+ fs.copyFileSync(sourcePath, targetPath);
371
+ try {
372
+ fs.chmodSync(targetPath, '755');
373
+ }
374
+ catch { }
375
+ }
376
+ }
377
+ }
378
+ else {
379
+ // Source not found (npx with broken paths) — use generated fallbacks
380
+ const generatedCritical = {
381
+ 'hook-handler.cjs': generateHookHandler(),
382
+ 'intelligence.cjs': generateIntelligenceStub(),
383
+ 'auto-memory-hook.mjs': generateAutoMemoryHook(),
384
+ };
385
+ for (const [helperName, content] of Object.entries(generatedCritical)) {
386
+ const targetPath = path.join(targetDir, '.claude', 'helpers', helperName);
387
+ if (fs.existsSync(targetPath)) {
388
+ result.updated.push(`.claude/helpers/${helperName}`);
389
+ }
390
+ else {
391
+ result.created.push(`.claude/helpers/${helperName}`);
392
+ }
393
+ fs.writeFileSync(targetPath, content, 'utf-8');
394
+ try {
395
+ fs.chmodSync(targetPath, '755');
396
+ }
397
+ catch { }
398
+ }
399
+ }
400
+ // 1. ALWAYS update statusline helper (force overwrite)
401
+ const statuslinePath = path.join(targetDir, '.claude', 'helpers', 'statusline.cjs');
402
+ // Use default options with statusline config
403
+ const upgradeOptions = {
404
+ ...DEFAULT_INIT_OPTIONS,
405
+ targetDir,
406
+ force: true,
407
+ statusline: {
408
+ ...DEFAULT_INIT_OPTIONS.statusline,
409
+ refreshInterval: 5000,
410
+ },
411
+ };
412
+ const statuslineContent = generateStatuslineScript(upgradeOptions);
413
+ if (fs.existsSync(statuslinePath)) {
414
+ result.updated.push('.claude/helpers/statusline.cjs');
415
+ }
416
+ else {
417
+ result.created.push('.claude/helpers/statusline.cjs');
418
+ }
419
+ fs.writeFileSync(statuslinePath, statuslineContent, 'utf-8');
420
+ // 2. Create MISSING metrics files only (preserve existing data)
421
+ const metricsDir = path.join(targetDir, '.claude-flow', 'metrics');
422
+ const securityDir = path.join(targetDir, '.claude-flow', 'security');
423
+ // v3-progress.json
424
+ const progressPath = path.join(metricsDir, 'v3-progress.json');
425
+ if (!fs.existsSync(progressPath)) {
426
+ const progress = {
427
+ version: '3.0.0',
428
+ initialized: new Date().toISOString(),
429
+ domains: { completed: 0, total: 5, status: 'INITIALIZING' },
430
+ ddd: { progress: 0, modules: 0, totalFiles: 0, totalLines: 0 },
431
+ swarm: { activeAgents: 0, maxAgents: 15, topology: 'hierarchical-mesh' },
432
+ learning: { status: 'READY', patternsLearned: 0, sessionsCompleted: 0 },
433
+ _note: 'Metrics will update as you use Ruflo'
434
+ };
435
+ fs.writeFileSync(progressPath, JSON.stringify(progress, null, 2), 'utf-8');
436
+ result.created.push('.claude-flow/metrics/v3-progress.json');
437
+ }
438
+ else {
439
+ result.preserved.push('.claude-flow/metrics/v3-progress.json');
440
+ }
441
+ // swarm-activity.json
442
+ const activityPath = path.join(metricsDir, 'swarm-activity.json');
443
+ if (!fs.existsSync(activityPath)) {
444
+ const activity = {
445
+ timestamp: new Date().toISOString(),
446
+ processes: { agentic_flow: 0, mcp_server: 0, estimated_agents: 0 },
447
+ swarm: { active: false, agent_count: 0, coordination_active: false },
448
+ integration: { agentic_flow_active: false, mcp_active: false },
449
+ _initialized: true
450
+ };
451
+ fs.writeFileSync(activityPath, JSON.stringify(activity, null, 2), 'utf-8');
452
+ result.created.push('.claude-flow/metrics/swarm-activity.json');
453
+ }
454
+ else {
455
+ result.preserved.push('.claude-flow/metrics/swarm-activity.json');
456
+ }
457
+ // learning.json
458
+ const learningPath = path.join(metricsDir, 'learning.json');
459
+ if (!fs.existsSync(learningPath)) {
460
+ const learning = {
461
+ initialized: new Date().toISOString(),
462
+ routing: { accuracy: 0, decisions: 0 },
463
+ patterns: { shortTerm: 0, longTerm: 0, quality: 0 },
464
+ sessions: { total: 0, current: null },
465
+ _note: 'Intelligence grows as you use Ruflo'
466
+ };
467
+ fs.writeFileSync(learningPath, JSON.stringify(learning, null, 2), 'utf-8');
468
+ result.created.push('.claude-flow/metrics/learning.json');
469
+ }
470
+ else {
471
+ result.preserved.push('.claude-flow/metrics/learning.json');
472
+ }
473
+ // audit-status.json
474
+ const auditPath = path.join(securityDir, 'audit-status.json');
475
+ if (!fs.existsSync(auditPath)) {
476
+ const audit = {
477
+ initialized: new Date().toISOString(),
478
+ status: 'PENDING',
479
+ cvesFixed: 0,
480
+ totalCves: 3,
481
+ lastScan: null,
482
+ _note: 'Run: npx @claude-flow/cli@latest security scan'
483
+ };
484
+ fs.writeFileSync(auditPath, JSON.stringify(audit, null, 2), 'utf-8');
485
+ result.created.push('.claude-flow/security/audit-status.json');
486
+ }
487
+ else {
488
+ result.preserved.push('.claude-flow/security/audit-status.json');
489
+ }
490
+ // 3. Merge settings if requested
491
+ if (upgradeSettings) {
492
+ const settingsPath = path.join(targetDir, '.claude', 'settings.json');
493
+ if (fs.existsSync(settingsPath)) {
494
+ try {
495
+ const existingSettings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8'));
496
+ const mergedSettings = mergeSettingsForUpgrade(existingSettings);
497
+ fs.writeFileSync(settingsPath, JSON.stringify(mergedSettings, null, 2), 'utf-8');
498
+ result.updated.push('.claude/settings.json');
499
+ result.settingsUpdated = [
500
+ 'env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS',
501
+ 'hooks.SessionStart (auto-memory import)',
502
+ 'hooks.SessionEnd (auto-memory sync)',
503
+ 'hooks.TeammateIdle (removed — not a valid Claude Code hook)',
504
+ 'hooks.TaskCompleted (removed — not a valid Claude Code hook)',
505
+ 'claudeFlow.agentTeams',
506
+ 'claudeFlow.memory (learningBridge, memoryGraph, agentScopes)',
507
+ ];
508
+ }
509
+ catch (settingsError) {
510
+ result.errors.push(`Settings merge failed: ${settingsError instanceof Error ? settingsError.message : String(settingsError)}`);
511
+ }
512
+ }
513
+ else {
514
+ // Create new settings.json with defaults
515
+ const defaultSettings = generateSettings(DEFAULT_INIT_OPTIONS);
516
+ fs.writeFileSync(settingsPath, JSON.stringify(defaultSettings, null, 2), 'utf-8');
517
+ result.created.push('.claude/settings.json');
518
+ result.settingsUpdated = ['Created new settings.json with Agent Teams'];
519
+ }
520
+ }
521
+ }
522
+ catch (error) {
523
+ result.success = false;
524
+ result.errors.push(error instanceof Error ? error.message : String(error));
525
+ }
526
+ return result;
527
+ }
528
+ /**
529
+ * Execute upgrade with --add-missing flag
530
+ * Adds any new skills, agents, and commands that don't exist yet
531
+ * @param targetDir - Target directory
532
+ * @param upgradeSettings - If true, merge new settings into existing settings.json
533
+ */
534
+ export async function executeUpgradeWithMissing(targetDir, upgradeSettings = false) {
535
+ // First do the normal upgrade (pass through upgradeSettings)
536
+ const result = await executeUpgrade(targetDir, upgradeSettings);
537
+ if (!result.success) {
538
+ return result;
539
+ }
540
+ // Initialize tracking arrays
541
+ result.addedSkills = [];
542
+ result.addedAgents = [];
543
+ result.addedCommands = [];
544
+ try {
545
+ // Ensure target directories exist
546
+ const skillsDir = path.join(targetDir, '.claude', 'skills');
547
+ const agentsDir = path.join(targetDir, '.claude', 'agents');
548
+ const commandsDir = path.join(targetDir, '.claude', 'commands');
549
+ for (const dir of [skillsDir, agentsDir, commandsDir]) {
550
+ if (!fs.existsSync(dir)) {
551
+ fs.mkdirSync(dir, { recursive: true });
552
+ }
553
+ }
554
+ // Find source directories
555
+ const sourceSkillsDir = findSourceDir('skills');
556
+ const sourceAgentsDir = findSourceDir('agents');
557
+ const sourceCommandsDir = findSourceDir('commands');
558
+ // Debug: Log source directories found
559
+ if (process.env.DEBUG || process.env.CLAUDE_FLOW_DEBUG) {
560
+ console.log('[DEBUG] Source directories:');
561
+ console.log(` Skills: ${sourceSkillsDir || 'NOT FOUND'}`);
562
+ console.log(` Agents: ${sourceAgentsDir || 'NOT FOUND'}`);
563
+ console.log(` Commands: ${sourceCommandsDir || 'NOT FOUND'}`);
564
+ }
565
+ // Add missing skills
566
+ if (sourceSkillsDir) {
567
+ const allSkills = Object.values(SKILLS_MAP).flat();
568
+ const debugMode = process.env.DEBUG || process.env.CLAUDE_FLOW_DEBUG;
569
+ if (debugMode) {
570
+ console.log(`[DEBUG] Checking ${allSkills.length} skills from SKILLS_MAP`);
571
+ }
572
+ for (const skillName of [...new Set(allSkills)]) {
573
+ const sourcePath = path.join(sourceSkillsDir, skillName);
574
+ const targetPath = path.join(skillsDir, skillName);
575
+ const sourceExists = fs.existsSync(sourcePath);
576
+ const targetExists = fs.existsSync(targetPath);
577
+ if (debugMode) {
578
+ console.log(`[DEBUG] Skill '${skillName}': source=${sourceExists}, target=${targetExists}`);
579
+ }
580
+ if (sourceExists && !targetExists) {
581
+ copyDirRecursive(sourcePath, targetPath);
582
+ result.addedSkills.push(skillName);
583
+ result.created.push(`.claude/skills/${skillName}`);
584
+ }
585
+ }
586
+ }
587
+ // Add missing agents
588
+ if (sourceAgentsDir) {
589
+ const allAgents = Object.values(AGENTS_MAP).flat();
590
+ for (const agentCategory of [...new Set(allAgents)]) {
591
+ const sourcePath = path.join(sourceAgentsDir, agentCategory);
592
+ const targetPath = path.join(agentsDir, agentCategory);
593
+ if (fs.existsSync(sourcePath) && !fs.existsSync(targetPath)) {
594
+ copyDirRecursive(sourcePath, targetPath);
595
+ result.addedAgents.push(agentCategory);
596
+ result.created.push(`.claude/agents/${agentCategory}`);
597
+ }
598
+ }
599
+ }
600
+ // Add missing commands
601
+ if (sourceCommandsDir) {
602
+ const allCommands = Object.values(COMMANDS_MAP).flat();
603
+ for (const cmdName of [...new Set(allCommands)]) {
604
+ const sourcePath = path.join(sourceCommandsDir, cmdName);
605
+ const targetPath = path.join(commandsDir, cmdName);
606
+ if (fs.existsSync(sourcePath) && !fs.existsSync(targetPath)) {
607
+ if (fs.statSync(sourcePath).isDirectory()) {
608
+ copyDirRecursive(sourcePath, targetPath);
609
+ }
610
+ else {
611
+ fs.copyFileSync(sourcePath, targetPath);
612
+ }
613
+ result.addedCommands.push(cmdName);
614
+ result.created.push(`.claude/commands/${cmdName}`);
615
+ }
616
+ }
617
+ }
618
+ }
619
+ catch (error) {
620
+ result.errors.push(`Add missing failed: ${error instanceof Error ? error.message : String(error)}`);
621
+ }
622
+ return result;
623
+ }
624
+ /**
625
+ * Create directory structure
626
+ */
627
+ async function createDirectories(targetDir, options, result) {
628
+ const dirs = [
629
+ ...DIRECTORIES.claude,
630
+ ...(options.components.runtime ? DIRECTORIES.runtime : []),
631
+ ];
632
+ for (const dir of dirs) {
633
+ const fullPath = path.join(targetDir, dir);
634
+ if (!fs.existsSync(fullPath)) {
635
+ fs.mkdirSync(fullPath, { recursive: true });
636
+ result.created.directories.push(dir);
637
+ }
638
+ }
639
+ }
640
+ /**
641
+ * Write settings.json
642
+ */
643
+ async function writeSettings(targetDir, options, result) {
644
+ const settingsPath = path.join(targetDir, '.claude', 'settings.json');
645
+ if (fs.existsSync(settingsPath) && !options.force) {
646
+ result.skipped.push('.claude/settings.json');
647
+ return;
648
+ }
649
+ const content = generateSettingsJson(options);
650
+ fs.writeFileSync(settingsPath, content, 'utf-8');
651
+ result.created.files.push('.claude/settings.json');
652
+ }
653
+ /**
654
+ * Write .mcp.json
655
+ */
656
+ async function writeMCPConfig(targetDir, options, result) {
657
+ const mcpPath = path.join(targetDir, '.mcp.json');
658
+ if (fs.existsSync(mcpPath) && !options.force) {
659
+ result.skipped.push('.mcp.json');
660
+ return;
661
+ }
662
+ const content = generateMCPJson(options);
663
+ fs.writeFileSync(mcpPath, content, 'utf-8');
664
+ result.created.files.push('.mcp.json');
665
+ }
666
+ /**
667
+ * Copy skills from source
668
+ */
669
+ async function copySkills(targetDir, options, result) {
670
+ const skillsConfig = options.skills;
671
+ const targetSkillsDir = path.join(targetDir, '.claude', 'skills');
672
+ // Determine which skills to copy
673
+ const skillsToCopy = [];
674
+ if (skillsConfig.all) {
675
+ // Copy all available skills
676
+ Object.values(SKILLS_MAP).forEach(skills => skillsToCopy.push(...skills));
677
+ }
678
+ else {
679
+ if (skillsConfig.core)
680
+ skillsToCopy.push(...SKILLS_MAP.core);
681
+ if (skillsConfig.agentdb)
682
+ skillsToCopy.push(...SKILLS_MAP.agentdb);
683
+ if (skillsConfig.github)
684
+ skillsToCopy.push(...SKILLS_MAP.github);
685
+ if (skillsConfig.flowNexus)
686
+ skillsToCopy.push(...SKILLS_MAP.flowNexus);
687
+ if (skillsConfig.browser)
688
+ skillsToCopy.push(...SKILLS_MAP.browser);
689
+ if (skillsConfig.v3)
690
+ skillsToCopy.push(...SKILLS_MAP.v3);
691
+ if (skillsConfig.dualMode)
692
+ skillsToCopy.push(...SKILLS_MAP.dualMode);
693
+ }
694
+ // Find source skills directory
695
+ const sourceSkillsDir = findSourceDir('skills', options.sourceBaseDir);
696
+ if (!sourceSkillsDir) {
697
+ result.errors.push('Could not find source skills directory');
698
+ return;
699
+ }
700
+ // Copy each skill
701
+ for (const skillName of [...new Set(skillsToCopy)]) {
702
+ const sourcePath = path.join(sourceSkillsDir, skillName);
703
+ const targetPath = path.join(targetSkillsDir, skillName);
704
+ if (fs.existsSync(sourcePath)) {
705
+ if (!fs.existsSync(targetPath) || options.force) {
706
+ copyDirRecursive(sourcePath, targetPath);
707
+ result.created.files.push(`.claude/skills/${skillName}`);
708
+ result.summary.skillsCount++;
709
+ }
710
+ else {
711
+ result.skipped.push(`.claude/skills/${skillName}`);
712
+ }
713
+ }
714
+ }
715
+ }
716
+ /**
717
+ * Copy commands from source
718
+ */
719
+ async function copyCommands(targetDir, options, result) {
720
+ const commandsConfig = options.commands;
721
+ const targetCommandsDir = path.join(targetDir, '.claude', 'commands');
722
+ // Determine which commands to copy
723
+ const commandsToCopy = [];
724
+ if (commandsConfig.all) {
725
+ Object.values(COMMANDS_MAP).forEach(cmds => commandsToCopy.push(...cmds));
726
+ }
727
+ else {
728
+ if (commandsConfig.core)
729
+ commandsToCopy.push(...COMMANDS_MAP.core);
730
+ if (commandsConfig.analysis)
731
+ commandsToCopy.push(...COMMANDS_MAP.analysis);
732
+ if (commandsConfig.automation)
733
+ commandsToCopy.push(...COMMANDS_MAP.automation);
734
+ if (commandsConfig.github)
735
+ commandsToCopy.push(...COMMANDS_MAP.github);
736
+ if (commandsConfig.hooks)
737
+ commandsToCopy.push(...COMMANDS_MAP.hooks);
738
+ if (commandsConfig.monitoring)
739
+ commandsToCopy.push(...COMMANDS_MAP.monitoring);
740
+ if (commandsConfig.optimization)
741
+ commandsToCopy.push(...COMMANDS_MAP.optimization);
742
+ if (commandsConfig.sparc)
743
+ commandsToCopy.push(...COMMANDS_MAP.sparc);
744
+ }
745
+ // Find source commands directory
746
+ const sourceCommandsDir = findSourceDir('commands', options.sourceBaseDir);
747
+ if (!sourceCommandsDir) {
748
+ result.errors.push('Could not find source commands directory');
749
+ return;
750
+ }
751
+ // Copy each command/directory
752
+ for (const cmdName of [...new Set(commandsToCopy)]) {
753
+ const sourcePath = path.join(sourceCommandsDir, cmdName);
754
+ const targetPath = path.join(targetCommandsDir, cmdName);
755
+ if (fs.existsSync(sourcePath)) {
756
+ if (!fs.existsSync(targetPath) || options.force) {
757
+ if (fs.statSync(sourcePath).isDirectory()) {
758
+ copyDirRecursive(sourcePath, targetPath);
759
+ }
760
+ else {
761
+ fs.copyFileSync(sourcePath, targetPath);
762
+ }
763
+ result.created.files.push(`.claude/commands/${cmdName}`);
764
+ result.summary.commandsCount++;
765
+ }
766
+ else {
767
+ result.skipped.push(`.claude/commands/${cmdName}`);
768
+ }
769
+ }
770
+ }
771
+ }
772
+ /**
773
+ * Copy agents from source
774
+ */
775
+ async function copyAgents(targetDir, options, result) {
776
+ const agentsConfig = options.agents;
777
+ const targetAgentsDir = path.join(targetDir, '.claude', 'agents');
778
+ // Determine which agents to copy
779
+ const agentsToCopy = [];
780
+ if (agentsConfig.all) {
781
+ Object.values(AGENTS_MAP).forEach(agents => agentsToCopy.push(...agents));
782
+ }
783
+ else {
784
+ if (agentsConfig.core)
785
+ agentsToCopy.push(...AGENTS_MAP.core);
786
+ if (agentsConfig.consensus)
787
+ agentsToCopy.push(...AGENTS_MAP.consensus);
788
+ if (agentsConfig.github)
789
+ agentsToCopy.push(...AGENTS_MAP.github);
790
+ if (agentsConfig.hiveMind)
791
+ agentsToCopy.push(...AGENTS_MAP.hiveMind);
792
+ if (agentsConfig.sparc)
793
+ agentsToCopy.push(...AGENTS_MAP.sparc);
794
+ if (agentsConfig.swarm)
795
+ agentsToCopy.push(...AGENTS_MAP.swarm);
796
+ if (agentsConfig.browser)
797
+ agentsToCopy.push(...AGENTS_MAP.browser);
798
+ // V3-specific agent categories
799
+ if (agentsConfig.v3)
800
+ agentsToCopy.push(...(AGENTS_MAP.v3 || []));
801
+ if (agentsConfig.optimization)
802
+ agentsToCopy.push(...(AGENTS_MAP.optimization || []));
803
+ if (agentsConfig.testing)
804
+ agentsToCopy.push(...(AGENTS_MAP.testing || []));
805
+ // Dual-mode agents (Claude Code + Codex hybrid)
806
+ if (agentsConfig.dualMode)
807
+ agentsToCopy.push(...(AGENTS_MAP.dualMode || []));
808
+ }
809
+ // Find source agents directory
810
+ const sourceAgentsDir = findSourceDir('agents', options.sourceBaseDir);
811
+ if (!sourceAgentsDir) {
812
+ result.errors.push('Could not find source agents directory');
813
+ return;
814
+ }
815
+ // Copy each agent category
816
+ for (const agentCategory of [...new Set(agentsToCopy)]) {
817
+ const sourcePath = path.join(sourceAgentsDir, agentCategory);
818
+ const targetPath = path.join(targetAgentsDir, agentCategory);
819
+ if (fs.existsSync(sourcePath)) {
820
+ if (!fs.existsSync(targetPath) || options.force) {
821
+ copyDirRecursive(sourcePath, targetPath);
822
+ // Count agent files (.yaml and .md)
823
+ const yamlFiles = countFiles(sourcePath, '.yaml');
824
+ const mdFiles = countFiles(sourcePath, '.md');
825
+ result.summary.agentsCount += yamlFiles + mdFiles;
826
+ result.created.files.push(`.claude/agents/${agentCategory}`);
827
+ }
828
+ else {
829
+ result.skipped.push(`.claude/agents/${agentCategory}`);
830
+ }
831
+ }
832
+ }
833
+ }
834
+ /**
835
+ * Find source helpers directory.
836
+ * Validates that the directory contains hook-handler.cjs to avoid
837
+ * returning the target directory or an incomplete source.
838
+ */
839
+ function findSourceHelpersDir(sourceBaseDir) {
840
+ const possiblePaths = [];
841
+ const SENTINEL_FILE = 'hook-handler.cjs'; // Must exist in valid source
842
+ // If explicit source base directory is provided, check it first
843
+ if (sourceBaseDir) {
844
+ possiblePaths.push(path.join(sourceBaseDir, '.claude', 'helpers'));
845
+ }
846
+ // Strategy 1: require.resolve to find package root (most reliable for npx)
847
+ try {
848
+ const esmRequire = createRequire(import.meta.url);
849
+ const pkgJsonPath = esmRequire.resolve('@claude-flow/cli/package.json');
850
+ const pkgRoot = path.dirname(pkgJsonPath);
851
+ possiblePaths.push(path.join(pkgRoot, '.claude', 'helpers'));
852
+ }
853
+ catch {
854
+ // Not installed as a package — skip
855
+ }
856
+ // Strategy 2: __dirname-based (dist/src/init -> package root)
857
+ const packageRoot = path.resolve(__dirname, '..', '..', '..');
858
+ const packageHelpers = path.join(packageRoot, '.claude', 'helpers');
859
+ possiblePaths.push(packageHelpers);
860
+ // Strategy 3: Walk up from __dirname looking for package root
861
+ let currentDir = __dirname;
862
+ for (let i = 0; i < 10; i++) {
863
+ const parentDir = path.dirname(currentDir);
864
+ if (parentDir === currentDir)
865
+ break; // hit filesystem root
866
+ const helpersPath = path.join(parentDir, '.claude', 'helpers');
867
+ possiblePaths.push(helpersPath);
868
+ currentDir = parentDir;
869
+ }
870
+ // Strategy 4: Check cwd-relative paths (for local dev)
871
+ const cwdBased = [
872
+ path.join(process.cwd(), '.claude', 'helpers'),
873
+ path.join(process.cwd(), '..', '.claude', 'helpers'),
874
+ path.join(process.cwd(), '..', '..', '.claude', 'helpers'),
875
+ ];
876
+ possiblePaths.push(...cwdBased);
877
+ // Return first path that exists AND contains the sentinel file
878
+ for (const p of possiblePaths) {
879
+ if (fs.existsSync(p) && fs.existsSync(path.join(p, SENTINEL_FILE))) {
880
+ return p;
881
+ }
882
+ }
883
+ return null;
884
+ }
885
+ /**
886
+ * Write helper scripts
887
+ */
888
+ async function writeHelpers(targetDir, options, result) {
889
+ const helpersDir = path.join(targetDir, '.claude', 'helpers');
890
+ // Find source helpers directory (works for npm package and local dev)
891
+ const sourceHelpersDir = findSourceHelpersDir(options.sourceBaseDir);
892
+ // Try to copy existing helpers from source first
893
+ if (sourceHelpersDir && fs.existsSync(sourceHelpersDir)) {
894
+ const helperFiles = fs.readdirSync(sourceHelpersDir);
895
+ let copiedCount = 0;
896
+ for (const file of helperFiles) {
897
+ const sourcePath = path.join(sourceHelpersDir, file);
898
+ const destPath = path.join(helpersDir, file);
899
+ // Skip directories and only copy files
900
+ if (!fs.statSync(sourcePath).isFile())
901
+ continue;
902
+ if (!fs.existsSync(destPath) || options.force) {
903
+ fs.copyFileSync(sourcePath, destPath);
904
+ // Make shell scripts and mjs files executable
905
+ if (file.endsWith('.sh') || file.endsWith('.mjs')) {
906
+ fs.chmodSync(destPath, '755');
907
+ }
908
+ result.created.files.push(`.claude/helpers/${file}`);
909
+ copiedCount++;
910
+ }
911
+ else {
912
+ result.skipped.push(`.claude/helpers/${file}`);
913
+ }
914
+ }
915
+ if (copiedCount > 0) {
916
+ return; // Skip generating if we copied from source
917
+ }
918
+ }
919
+ // Fall back to generating helpers if source not available
920
+ const helpers = {
921
+ 'pre-commit': generatePreCommitHook(),
922
+ 'post-commit': generatePostCommitHook(),
923
+ 'session.js': generateSessionManager(),
924
+ 'router.js': generateAgentRouter(),
925
+ 'memory.js': generateMemoryHelper(),
926
+ 'hook-handler.cjs': generateHookHandler(),
927
+ 'intelligence.cjs': generateIntelligenceStub(),
928
+ 'auto-memory-hook.mjs': generateAutoMemoryHook(),
929
+ };
930
+ for (const [name, content] of Object.entries(helpers)) {
931
+ const filePath = path.join(helpersDir, name);
932
+ if (!fs.existsSync(filePath) || options.force) {
933
+ fs.writeFileSync(filePath, content, 'utf-8');
934
+ // Make shell scripts executable
935
+ if (!name.endsWith('.js')) {
936
+ fs.chmodSync(filePath, '755');
937
+ }
938
+ result.created.files.push(`.claude/helpers/${name}`);
939
+ }
940
+ else {
941
+ result.skipped.push(`.claude/helpers/${name}`);
942
+ }
943
+ }
944
+ }
945
+ /**
946
+ * Find source .claude directory for statusline files
947
+ */
948
+ function findSourceClaudeDir(sourceBaseDir) {
949
+ const possiblePaths = [];
950
+ // If explicit source base directory is provided, check it first
951
+ if (sourceBaseDir) {
952
+ possiblePaths.push(path.join(sourceBaseDir, '.claude'));
953
+ }
954
+ // IMPORTANT: Check the package's own .claude directory
955
+ // Go up 3 levels: dist/src/init -> dist/src -> dist -> root
956
+ const packageRoot = path.resolve(__dirname, '..', '..', '..');
957
+ const packageClaude = path.join(packageRoot, '.claude');
958
+ if (fs.existsSync(packageClaude)) {
959
+ possiblePaths.unshift(packageClaude); // Add to beginning (highest priority)
960
+ }
961
+ // From dist/src/init -> go up to project root
962
+ let currentDir = __dirname;
963
+ for (let i = 0; i < 10; i++) {
964
+ const parentDir = path.dirname(currentDir);
965
+ const claudePath = path.join(parentDir, '.claude');
966
+ if (fs.existsSync(claudePath)) {
967
+ possiblePaths.push(claudePath);
968
+ }
969
+ currentDir = parentDir;
970
+ }
971
+ for (const p of possiblePaths) {
972
+ if (fs.existsSync(p)) {
973
+ return p;
974
+ }
975
+ }
976
+ return null;
977
+ }
978
+ /**
979
+ * Write statusline configuration
980
+ */
981
+ async function writeStatusline(targetDir, options, result) {
982
+ const claudeDir = path.join(targetDir, '.claude');
983
+ const helpersDir = path.join(targetDir, '.claude', 'helpers');
984
+ // Find source .claude directory (works for npm package and local dev)
985
+ const sourceClaudeDir = findSourceClaudeDir(options.sourceBaseDir);
986
+ // Try to copy existing advanced statusline files from source
987
+ const advancedStatuslineFiles = [
988
+ { src: 'statusline.sh', dest: 'statusline.sh', dir: claudeDir },
989
+ { src: 'statusline.mjs', dest: 'statusline.mjs', dir: claudeDir },
990
+ ];
991
+ if (sourceClaudeDir) {
992
+ for (const file of advancedStatuslineFiles) {
993
+ const sourcePath = path.join(sourceClaudeDir, file.src);
994
+ const destPath = path.join(file.dir, file.dest);
995
+ if (fs.existsSync(sourcePath)) {
996
+ if (!fs.existsSync(destPath) || options.force) {
997
+ fs.copyFileSync(sourcePath, destPath);
998
+ // Make shell scripts and mjs executable
999
+ if (file.src.endsWith('.sh') || file.src.endsWith('.mjs')) {
1000
+ fs.chmodSync(destPath, '755');
1001
+ }
1002
+ result.created.files.push(`.claude/${file.dest}`);
1003
+ }
1004
+ else {
1005
+ result.skipped.push(`.claude/${file.dest}`);
1006
+ }
1007
+ }
1008
+ }
1009
+ }
1010
+ // ALWAYS generate statusline.cjs — the generated version includes AgentDB
1011
+ // vectors/size, tests, ADRs, hooks, and integration stats that the
1012
+ // pre-installed static copy in the npm package lacks.
1013
+ // This must overwrite any copy from writeHelpers() which copies the legacy file.
1014
+ const statuslineScript = generateStatuslineScript(options);
1015
+ const statuslinePath = path.join(helpersDir, 'statusline.cjs');
1016
+ fs.writeFileSync(statuslinePath, statuslineScript, 'utf-8');
1017
+ result.created.files.push('.claude/helpers/statusline.cjs');
1018
+ }
1019
+ /**
1020
+ * Write runtime configuration (.claude-flow/)
1021
+ */
1022
+ async function writeRuntimeConfig(targetDir, options, result) {
1023
+ const configPath = path.join(targetDir, '.claude-flow', 'config.yaml');
1024
+ if (fs.existsSync(configPath) && !options.force) {
1025
+ result.skipped.push('.claude-flow/config.yaml');
1026
+ return;
1027
+ }
1028
+ const config = `# RuFlo V3 Runtime Configuration
1029
+ # Generated: ${new Date().toISOString()}
1030
+
1031
+ version: "3.0.0"
1032
+
1033
+ swarm:
1034
+ topology: ${options.runtime.topology}
1035
+ maxAgents: ${options.runtime.maxAgents}
1036
+ autoScale: true
1037
+ coordinationStrategy: consensus
1038
+
1039
+ memory:
1040
+ backend: ${options.runtime.memoryBackend}
1041
+ enableHNSW: ${options.runtime.enableHNSW}
1042
+ persistPath: .claude-flow/data
1043
+ cacheSize: 100
1044
+ # ADR-049: Self-Learning Memory
1045
+ learningBridge:
1046
+ enabled: ${options.runtime.enableLearningBridge ?? options.runtime.enableNeural}
1047
+ sonaMode: balanced
1048
+ confidenceDecayRate: 0.005
1049
+ accessBoostAmount: 0.03
1050
+ consolidationThreshold: 10
1051
+ memoryGraph:
1052
+ enabled: ${options.runtime.enableMemoryGraph ?? true}
1053
+ pageRankDamping: 0.85
1054
+ maxNodes: 5000
1055
+ similarityThreshold: 0.8
1056
+ agentScopes:
1057
+ enabled: ${options.runtime.enableAgentScopes ?? true}
1058
+ defaultScope: project
1059
+
1060
+ neural:
1061
+ enabled: ${options.runtime.enableNeural}
1062
+ modelPath: .claude-flow/neural
1063
+
1064
+ hooks:
1065
+ enabled: true
1066
+ autoExecute: true
1067
+
1068
+ mcp:
1069
+ autoStart: ${options.mcp.autoStart}
1070
+ port: ${options.mcp.port}
1071
+ `;
1072
+ fs.writeFileSync(configPath, config, 'utf-8');
1073
+ result.created.files.push('.claude-flow/config.yaml');
1074
+ // Write .gitignore
1075
+ const gitignorePath = path.join(targetDir, '.claude-flow', '.gitignore');
1076
+ const gitignore = `# Claude Flow runtime files
1077
+ data/
1078
+ logs/
1079
+ sessions/
1080
+ neural/
1081
+ *.log
1082
+ *.tmp
1083
+ `;
1084
+ if (!fs.existsSync(gitignorePath) || options.force) {
1085
+ fs.writeFileSync(gitignorePath, gitignore, 'utf-8');
1086
+ result.created.files.push('.claude-flow/.gitignore');
1087
+ }
1088
+ // Write CAPABILITIES.md with full system overview
1089
+ await writeCapabilitiesDoc(targetDir, options, result);
1090
+ }
1091
+ /**
1092
+ * Write initial metrics files for statusline
1093
+ * Creates baseline data so statusline shows meaningful state instead of all zeros
1094
+ */
1095
+ async function writeInitialMetrics(targetDir, options, result) {
1096
+ const metricsDir = path.join(targetDir, '.claude-flow', 'metrics');
1097
+ const learningDir = path.join(targetDir, '.claude-flow', 'learning');
1098
+ const securityDir = path.join(targetDir, '.claude-flow', 'security');
1099
+ // Ensure directories exist
1100
+ for (const dir of [metricsDir, learningDir, securityDir]) {
1101
+ if (!fs.existsSync(dir)) {
1102
+ fs.mkdirSync(dir, { recursive: true });
1103
+ }
1104
+ }
1105
+ // Create initial v3-progress.json
1106
+ const progressPath = path.join(metricsDir, 'v3-progress.json');
1107
+ if (!fs.existsSync(progressPath) || options.force) {
1108
+ const progress = {
1109
+ version: '3.0.0',
1110
+ initialized: new Date().toISOString(),
1111
+ domains: {
1112
+ completed: 0,
1113
+ total: 5,
1114
+ status: 'INITIALIZING'
1115
+ },
1116
+ ddd: {
1117
+ progress: 0,
1118
+ modules: 0,
1119
+ totalFiles: 0,
1120
+ totalLines: 0
1121
+ },
1122
+ swarm: {
1123
+ activeAgents: 0,
1124
+ maxAgents: options.runtime.maxAgents,
1125
+ topology: options.runtime.topology
1126
+ },
1127
+ learning: {
1128
+ status: 'READY',
1129
+ patternsLearned: 0,
1130
+ sessionsCompleted: 0
1131
+ },
1132
+ _note: 'Metrics will update as you use Ruflo. Run: npx ruflo@latest daemon start'
1133
+ };
1134
+ fs.writeFileSync(progressPath, JSON.stringify(progress, null, 2), 'utf-8');
1135
+ result.created.files.push('.claude-flow/metrics/v3-progress.json');
1136
+ }
1137
+ // Create initial swarm-activity.json
1138
+ const activityPath = path.join(metricsDir, 'swarm-activity.json');
1139
+ if (!fs.existsSync(activityPath) || options.force) {
1140
+ const activity = {
1141
+ timestamp: new Date().toISOString(),
1142
+ processes: {
1143
+ agentic_flow: 0,
1144
+ mcp_server: 0,
1145
+ estimated_agents: 0
1146
+ },
1147
+ swarm: {
1148
+ active: false,
1149
+ agent_count: 0,
1150
+ coordination_active: false
1151
+ },
1152
+ integration: {
1153
+ agentic_flow_active: false,
1154
+ mcp_active: false
1155
+ },
1156
+ _initialized: true
1157
+ };
1158
+ fs.writeFileSync(activityPath, JSON.stringify(activity, null, 2), 'utf-8');
1159
+ result.created.files.push('.claude-flow/metrics/swarm-activity.json');
1160
+ }
1161
+ // Create initial learning.json
1162
+ const learningPath = path.join(metricsDir, 'learning.json');
1163
+ if (!fs.existsSync(learningPath) || options.force) {
1164
+ const learning = {
1165
+ initialized: new Date().toISOString(),
1166
+ routing: {
1167
+ accuracy: 0,
1168
+ decisions: 0
1169
+ },
1170
+ patterns: {
1171
+ shortTerm: 0,
1172
+ longTerm: 0,
1173
+ quality: 0
1174
+ },
1175
+ sessions: {
1176
+ total: 0,
1177
+ current: null
1178
+ },
1179
+ _note: 'Intelligence grows as you use Ruflo'
1180
+ };
1181
+ fs.writeFileSync(learningPath, JSON.stringify(learning, null, 2), 'utf-8');
1182
+ result.created.files.push('.claude-flow/metrics/learning.json');
1183
+ }
1184
+ // Create initial audit-status.json
1185
+ const auditPath = path.join(securityDir, 'audit-status.json');
1186
+ if (!fs.existsSync(auditPath) || options.force) {
1187
+ const audit = {
1188
+ initialized: new Date().toISOString(),
1189
+ status: 'PENDING',
1190
+ cvesFixed: 0,
1191
+ totalCves: 3,
1192
+ lastScan: null,
1193
+ _note: 'Run: npx @claude-flow/cli@latest security scan'
1194
+ };
1195
+ fs.writeFileSync(auditPath, JSON.stringify(audit, null, 2), 'utf-8');
1196
+ result.created.files.push('.claude-flow/security/audit-status.json');
1197
+ }
1198
+ }
1199
+ /**
1200
+ * Write CAPABILITIES.md - comprehensive overview of all Ruflo features
1201
+ */
1202
+ async function writeCapabilitiesDoc(targetDir, options, result) {
1203
+ const capabilitiesPath = path.join(targetDir, '.claude-flow', 'CAPABILITIES.md');
1204
+ if (fs.existsSync(capabilitiesPath) && !options.force) {
1205
+ result.skipped.push('.claude-flow/CAPABILITIES.md');
1206
+ return;
1207
+ }
1208
+ const capabilities = `# RuFlo V3 - Complete Capabilities Reference
1209
+ > Generated: ${new Date().toISOString()}
1210
+ > Full documentation: https://github.com/ruvnet/claude-flow
1211
+
1212
+ ## 📋 Table of Contents
1213
+
1214
+ 1. [Overview](#overview)
1215
+ 2. [Swarm Orchestration](#swarm-orchestration)
1216
+ 3. [Available Agents (60+)](#available-agents)
1217
+ 4. [CLI Commands (26 Commands, 140+ Subcommands)](#cli-commands)
1218
+ 5. [Hooks System (27 Hooks + 12 Workers)](#hooks-system)
1219
+ 6. [Memory & Intelligence (RuVector)](#memory--intelligence)
1220
+ 7. [Hive-Mind Consensus](#hive-mind-consensus)
1221
+ 8. [Performance Targets](#performance-targets)
1222
+ 9. [Integration Ecosystem](#integration-ecosystem)
1223
+
1224
+ ---
1225
+
1226
+ ## Overview
1227
+
1228
+ RuFlo V3 is a domain-driven design architecture for multi-agent AI coordination with:
1229
+
1230
+ - **15-Agent Swarm Coordination** with hierarchical and mesh topologies
1231
+ - **HNSW Vector Search** - 150x-12,500x faster pattern retrieval
1232
+ - **SONA Neural Learning** - Self-optimizing with <0.05ms adaptation
1233
+ - **Byzantine Fault Tolerance** - Queen-led consensus mechanisms
1234
+ - **MCP Server Integration** - Model Context Protocol support
1235
+
1236
+ ### Current Configuration
1237
+ | Setting | Value |
1238
+ |---------|-------|
1239
+ | Topology | ${options.runtime.topology} |
1240
+ | Max Agents | ${options.runtime.maxAgents} |
1241
+ | Memory Backend | ${options.runtime.memoryBackend} |
1242
+ | HNSW Indexing | ${options.runtime.enableHNSW ? 'Enabled' : 'Disabled'} |
1243
+ | Neural Learning | ${options.runtime.enableNeural ? 'Enabled' : 'Disabled'} |
1244
+ | LearningBridge | ${options.runtime.enableLearningBridge ? 'Enabled (SONA + ReasoningBank)' : 'Disabled'} |
1245
+ | Knowledge Graph | ${options.runtime.enableMemoryGraph ? 'Enabled (PageRank + Communities)' : 'Disabled'} |
1246
+ | Agent Scopes | ${options.runtime.enableAgentScopes ? 'Enabled (project/local/user)' : 'Disabled'} |
1247
+
1248
+ ---
1249
+
1250
+ ## Swarm Orchestration
1251
+
1252
+ ### Topologies
1253
+ | Topology | Description | Best For |
1254
+ |----------|-------------|----------|
1255
+ | \`hierarchical\` | Queen controls workers directly | Anti-drift, tight control |
1256
+ | \`mesh\` | Fully connected peer network | Distributed tasks |
1257
+ | \`hierarchical-mesh\` | V3 hybrid (recommended) | 10+ agents |
1258
+ | \`ring\` | Circular communication | Sequential workflows |
1259
+ | \`star\` | Central coordinator | Simple coordination |
1260
+ | \`adaptive\` | Dynamic based on load | Variable workloads |
1261
+
1262
+ ### Strategies
1263
+ - \`balanced\` - Even distribution across agents
1264
+ - \`specialized\` - Clear roles, no overlap (anti-drift)
1265
+ - \`adaptive\` - Dynamic task routing
1266
+
1267
+ ### Quick Commands
1268
+ \`\`\`bash
1269
+ # Initialize swarm
1270
+ npx @claude-flow/cli@latest swarm init --topology hierarchical --max-agents 8 --strategy specialized
1271
+
1272
+ # Check status
1273
+ npx @claude-flow/cli@latest swarm status
1274
+
1275
+ # Monitor activity
1276
+ npx @claude-flow/cli@latest swarm monitor
1277
+ \`\`\`
1278
+
1279
+ ---
1280
+
1281
+ ## Available Agents
1282
+
1283
+ ### Core Development (5)
1284
+ \`coder\`, \`reviewer\`, \`tester\`, \`planner\`, \`researcher\`
1285
+
1286
+ ### V3 Specialized (4)
1287
+ \`security-architect\`, \`security-auditor\`, \`memory-specialist\`, \`performance-engineer\`
1288
+
1289
+ ### Swarm Coordination (5)
1290
+ \`hierarchical-coordinator\`, \`mesh-coordinator\`, \`adaptive-coordinator\`, \`collective-intelligence-coordinator\`, \`swarm-memory-manager\`
1291
+
1292
+ ### Consensus & Distributed (7)
1293
+ \`byzantine-coordinator\`, \`raft-manager\`, \`gossip-coordinator\`, \`consensus-builder\`, \`crdt-synchronizer\`, \`quorum-manager\`, \`security-manager\`
1294
+
1295
+ ### Performance & Optimization (5)
1296
+ \`perf-analyzer\`, \`performance-benchmarker\`, \`task-orchestrator\`, \`memory-coordinator\`, \`smart-agent\`
1297
+
1298
+ ### GitHub & Repository (9)
1299
+ \`github-modes\`, \`pr-manager\`, \`code-review-swarm\`, \`issue-tracker\`, \`release-manager\`, \`workflow-automation\`, \`project-board-sync\`, \`repo-architect\`, \`multi-repo-swarm\`
1300
+
1301
+ ### SPARC Methodology (6)
1302
+ \`sparc-coord\`, \`sparc-coder\`, \`specification\`, \`pseudocode\`, \`architecture\`, \`refinement\`
1303
+
1304
+ ### Specialized Development (8)
1305
+ \`backend-dev\`, \`mobile-dev\`, \`ml-developer\`, \`cicd-engineer\`, \`api-docs\`, \`system-architect\`, \`code-analyzer\`, \`base-template-generator\`
1306
+
1307
+ ### Testing & Validation (2)
1308
+ \`tdd-london-swarm\`, \`production-validator\`
1309
+
1310
+ ### Agent Routing by Task
1311
+ | Task Type | Recommended Agents | Topology |
1312
+ |-----------|-------------------|----------|
1313
+ | Bug Fix | researcher, coder, tester | mesh |
1314
+ | New Feature | coordinator, architect, coder, tester, reviewer | hierarchical |
1315
+ | Refactoring | architect, coder, reviewer | mesh |
1316
+ | Performance | researcher, perf-engineer, coder | hierarchical |
1317
+ | Security | security-architect, auditor, reviewer | hierarchical |
1318
+ | Docs | researcher, api-docs | mesh |
1319
+
1320
+ ---
1321
+
1322
+ ## CLI Commands
1323
+
1324
+ ### Core Commands (12)
1325
+ | Command | Subcommands | Description |
1326
+ |---------|-------------|-------------|
1327
+ | \`init\` | 4 | Project initialization |
1328
+ | \`agent\` | 8 | Agent lifecycle management |
1329
+ | \`swarm\` | 6 | Multi-agent coordination |
1330
+ | \`memory\` | 11 | AgentDB with HNSW search |
1331
+ | \`mcp\` | 9 | MCP server management |
1332
+ | \`task\` | 6 | Task assignment |
1333
+ | \`session\` | 7 | Session persistence |
1334
+ | \`config\` | 7 | Configuration |
1335
+ | \`status\` | 3 | System monitoring |
1336
+ | \`workflow\` | 6 | Workflow templates |
1337
+ | \`hooks\` | 17 | Self-learning hooks |
1338
+ | \`hive-mind\` | 6 | Consensus coordination |
1339
+
1340
+ ### Advanced Commands (14)
1341
+ | Command | Subcommands | Description |
1342
+ |---------|-------------|-------------|
1343
+ | \`daemon\` | 5 | Background workers |
1344
+ | \`neural\` | 5 | Pattern training |
1345
+ | \`security\` | 6 | Security scanning |
1346
+ | \`performance\` | 5 | Profiling & benchmarks |
1347
+ | \`providers\` | 5 | AI provider config |
1348
+ | \`plugins\` | 5 | Plugin management |
1349
+ | \`deployment\` | 5 | Deploy management |
1350
+ | \`embeddings\` | 4 | Vector embeddings |
1351
+ | \`claims\` | 4 | Authorization |
1352
+ | \`migrate\` | 5 | V2→V3 migration |
1353
+ | \`process\` | 4 | Process management |
1354
+ | \`doctor\` | 1 | Health diagnostics |
1355
+ | \`completions\` | 4 | Shell completions |
1356
+
1357
+ ### Example Commands
1358
+ \`\`\`bash
1359
+ # Initialize
1360
+ npx @claude-flow/cli@latest init --wizard
1361
+
1362
+ # Spawn agent
1363
+ npx @claude-flow/cli@latest agent spawn -t coder --name my-coder
1364
+
1365
+ # Memory operations
1366
+ npx @claude-flow/cli@latest memory store --key "pattern" --value "data" --namespace patterns
1367
+ npx @claude-flow/cli@latest memory search --query "authentication"
1368
+
1369
+ # Diagnostics
1370
+ npx @claude-flow/cli@latest doctor --fix
1371
+ \`\`\`
1372
+
1373
+ ---
1374
+
1375
+ ## Hooks System
1376
+
1377
+ ### 27 Available Hooks
1378
+
1379
+ #### Core Hooks (6)
1380
+ | Hook | Description |
1381
+ |------|-------------|
1382
+ | \`pre-edit\` | Context before file edits |
1383
+ | \`post-edit\` | Record edit outcomes |
1384
+ | \`pre-command\` | Risk assessment |
1385
+ | \`post-command\` | Command metrics |
1386
+ | \`pre-task\` | Task start + agent suggestions |
1387
+ | \`post-task\` | Task completion learning |
1388
+
1389
+ #### Session Hooks (4)
1390
+ | Hook | Description |
1391
+ |------|-------------|
1392
+ | \`session-start\` | Start/restore session |
1393
+ | \`session-end\` | Persist state |
1394
+ | \`session-restore\` | Restore previous |
1395
+ | \`notify\` | Cross-agent notifications |
1396
+
1397
+ #### Intelligence Hooks (5)
1398
+ | Hook | Description |
1399
+ |------|-------------|
1400
+ | \`route\` | Optimal agent routing |
1401
+ | \`explain\` | Routing decisions |
1402
+ | \`pretrain\` | Bootstrap intelligence |
1403
+ | \`build-agents\` | Generate configs |
1404
+ | \`transfer\` | Pattern transfer |
1405
+
1406
+ #### Coverage Hooks (3)
1407
+ | Hook | Description |
1408
+ |------|-------------|
1409
+ | \`coverage-route\` | Coverage-based routing |
1410
+ | \`coverage-suggest\` | Improvement suggestions |
1411
+ | \`coverage-gaps\` | Gap analysis |
1412
+
1413
+ ### 12 Background Workers
1414
+ | Worker | Priority | Purpose |
1415
+ |--------|----------|---------|
1416
+ | \`ultralearn\` | normal | Deep knowledge |
1417
+ | \`optimize\` | high | Performance |
1418
+ | \`consolidate\` | low | Memory consolidation |
1419
+ | \`predict\` | normal | Predictive preload |
1420
+ | \`audit\` | critical | Security |
1421
+ | \`map\` | normal | Codebase mapping |
1422
+ | \`preload\` | low | Resource preload |
1423
+ | \`deepdive\` | normal | Deep analysis |
1424
+ | \`document\` | normal | Auto-docs |
1425
+ | \`refactor\` | normal | Suggestions |
1426
+ | \`benchmark\` | normal | Benchmarking |
1427
+ | \`testgaps\` | normal | Coverage gaps |
1428
+
1429
+ ---
1430
+
1431
+ ## Memory & Intelligence
1432
+
1433
+ ### RuVector Intelligence System
1434
+ - **SONA**: Self-Optimizing Neural Architecture (<0.05ms)
1435
+ - **MoE**: Mixture of Experts routing
1436
+ - **HNSW**: 150x-12,500x faster search
1437
+ - **EWC++**: Prevents catastrophic forgetting
1438
+ - **Flash Attention**: 2.49x-7.47x speedup
1439
+ - **Int8 Quantization**: 3.92x memory reduction
1440
+
1441
+ ### 4-Step Intelligence Pipeline
1442
+ 1. **RETRIEVE** - HNSW pattern search
1443
+ 2. **JUDGE** - Success/failure verdicts
1444
+ 3. **DISTILL** - LoRA learning extraction
1445
+ 4. **CONSOLIDATE** - EWC++ preservation
1446
+
1447
+ ### Self-Learning Memory (ADR-049)
1448
+
1449
+ | Component | Status | Description |
1450
+ |-----------|--------|-------------|
1451
+ | **LearningBridge** | ${options.runtime.enableLearningBridge ? '✅ Enabled' : '⏸ Disabled'} | Connects insights to SONA/ReasoningBank neural pipeline |
1452
+ | **MemoryGraph** | ${options.runtime.enableMemoryGraph ? '✅ Enabled' : '⏸ Disabled'} | PageRank knowledge graph + community detection |
1453
+ | **AgentMemoryScope** | ${options.runtime.enableAgentScopes ? '✅ Enabled' : '⏸ Disabled'} | 3-scope agent memory (project/local/user) |
1454
+
1455
+ **LearningBridge** - Insights trigger learning trajectories. Confidence evolves: +0.03 on access, -0.005/hour decay. Consolidation runs the JUDGE/DISTILL/CONSOLIDATE pipeline.
1456
+
1457
+ **MemoryGraph** - Builds a knowledge graph from entry references. PageRank identifies influential insights. Communities group related knowledge. Graph-aware ranking blends vector + structural scores.
1458
+
1459
+ **AgentMemoryScope** - Maps Claude Code 3-scope directories:
1460
+ - \`project\`: \`<gitRoot>/.claude/agent-memory/<agent>/\`
1461
+ - \`local\`: \`<gitRoot>/.claude/agent-memory-local/<agent>/\`
1462
+ - \`user\`: \`~/.claude/agent-memory/<agent>/\`
1463
+
1464
+ High-confidence insights (>0.8) can transfer between agents.
1465
+
1466
+ ### Memory Commands
1467
+ \`\`\`bash
1468
+ # Store pattern
1469
+ npx @claude-flow/cli@latest memory store --key "name" --value "data" --namespace patterns
1470
+
1471
+ # Semantic search
1472
+ npx @claude-flow/cli@latest memory search --query "authentication"
1473
+
1474
+ # List entries
1475
+ npx @claude-flow/cli@latest memory list --namespace patterns
1476
+
1477
+ # Initialize database
1478
+ npx @claude-flow/cli@latest memory init --force
1479
+ \`\`\`
1480
+
1481
+ ---
1482
+
1483
+ ## Hive-Mind Consensus
1484
+
1485
+ ### Queen Types
1486
+ | Type | Role |
1487
+ |------|------|
1488
+ | Strategic Queen | Long-term planning |
1489
+ | Tactical Queen | Execution coordination |
1490
+ | Adaptive Queen | Dynamic optimization |
1491
+
1492
+ ### Worker Types (8)
1493
+ \`researcher\`, \`coder\`, \`analyst\`, \`tester\`, \`architect\`, \`reviewer\`, \`optimizer\`, \`documenter\`
1494
+
1495
+ ### Consensus Mechanisms
1496
+ | Mechanism | Fault Tolerance | Use Case |
1497
+ |-----------|-----------------|----------|
1498
+ | \`byzantine\` | f < n/3 faulty | Adversarial |
1499
+ | \`raft\` | f < n/2 failed | Leader-based |
1500
+ | \`gossip\` | Eventually consistent | Large scale |
1501
+ | \`crdt\` | Conflict-free | Distributed |
1502
+ | \`quorum\` | Configurable | Flexible |
1503
+
1504
+ ### Hive-Mind Commands
1505
+ \`\`\`bash
1506
+ # Initialize
1507
+ npx @claude-flow/cli@latest hive-mind init --queen-type strategic
1508
+
1509
+ # Status
1510
+ npx @claude-flow/cli@latest hive-mind status
1511
+
1512
+ # Spawn workers
1513
+ npx @claude-flow/cli@latest hive-mind spawn --count 5 --type worker
1514
+
1515
+ # Consensus
1516
+ npx @claude-flow/cli@latest hive-mind consensus --propose "task"
1517
+ \`\`\`
1518
+
1519
+ ---
1520
+
1521
+ ## Performance Targets
1522
+
1523
+ | Metric | Target | Status |
1524
+ |--------|--------|--------|
1525
+ | HNSW Search | 150x-12,500x faster | ✅ Implemented |
1526
+ | Memory Reduction | 50-75% | ✅ Implemented (3.92x) |
1527
+ | SONA Integration | Pattern learning | ✅ Implemented |
1528
+ | Flash Attention | 2.49x-7.47x | 🔄 In Progress |
1529
+ | MCP Response | <100ms | ✅ Achieved |
1530
+ | CLI Startup | <500ms | ✅ Achieved |
1531
+ | SONA Adaptation | <0.05ms | 🔄 In Progress |
1532
+ | Graph Build (1k) | <200ms | ✅ 2.78ms (71.9x headroom) |
1533
+ | PageRank (1k) | <100ms | ✅ 12.21ms (8.2x headroom) |
1534
+ | Insight Recording | <5ms/each | ✅ 0.12ms (41x headroom) |
1535
+ | Consolidation | <500ms | ✅ 0.26ms (1,955x headroom) |
1536
+ | Knowledge Transfer | <100ms | ✅ 1.25ms (80x headroom) |
1537
+
1538
+ ---
1539
+
1540
+ ## Integration Ecosystem
1541
+
1542
+ ### Integrated Packages
1543
+ | Package | Version | Purpose |
1544
+ |---------|---------|---------|
1545
+ | agentic-flow | 3.0.0-alpha.1 | Core coordination + ReasoningBank + Router |
1546
+ | agentdb | 3.0.0-alpha.10 | Vector database + 8 controllers |
1547
+ | @ruvector/attention | 0.1.3 | Flash attention |
1548
+ | @ruvector/sona | 0.1.5 | Neural learning |
1549
+
1550
+ ### Optional Integrations
1551
+ | Package | Command |
1552
+ |---------|---------|
1553
+ | ruv-swarm | \`npx ruv-swarm mcp start\` |
1554
+ | flow-nexus | \`npx flow-nexus@latest mcp start\` |
1555
+ | agentic-jujutsu | \`npx agentic-jujutsu@latest\` |
1556
+
1557
+ ### MCP Server Setup
1558
+ \`\`\`bash
1559
+ # Add Ruflo MCP
1560
+ claude mcp add ruflo -- npx -y ruflo@latest
1561
+
1562
+ # Optional servers
1563
+ claude mcp add ruv-swarm -- npx -y ruv-swarm mcp start
1564
+ claude mcp add flow-nexus -- npx -y flow-nexus@latest mcp start
1565
+ \`\`\`
1566
+
1567
+ ---
1568
+
1569
+ ## Quick Reference
1570
+
1571
+ ### Essential Commands
1572
+ \`\`\`bash
1573
+ # Setup
1574
+ npx ruflo@latest init --wizard
1575
+ npx ruflo@latest daemon start
1576
+ npx ruflo@latest doctor --fix
1577
+
1578
+ # Swarm
1579
+ npx ruflo@latest swarm init --topology hierarchical --max-agents 8
1580
+ npx ruflo@latest swarm status
1581
+
1582
+ # Agents
1583
+ npx ruflo@latest agent spawn -t coder
1584
+ npx ruflo@latest agent list
1585
+
1586
+ # Memory
1587
+ npx ruflo@latest memory search --query "patterns"
1588
+
1589
+ # Hooks
1590
+ npx ruflo@latest hooks pre-task --description "task"
1591
+ npx ruflo@latest hooks worker dispatch --trigger optimize
1592
+ \`\`\`
1593
+
1594
+ ### File Structure
1595
+ \`\`\`
1596
+ .claude-flow/
1597
+ ├── config.yaml # Runtime configuration
1598
+ ├── CAPABILITIES.md # This file
1599
+ ├── data/ # Memory storage
1600
+ ├── logs/ # Operation logs
1601
+ ├── sessions/ # Session state
1602
+ ├── hooks/ # Custom hooks
1603
+ ├── agents/ # Agent configs
1604
+ └── workflows/ # Workflow templates
1605
+ \`\`\`
1606
+
1607
+ ---
1608
+
1609
+ **Full Documentation**: https://github.com/ruvnet/claude-flow
1610
+ **Issues**: https://github.com/ruvnet/claude-flow/issues
1611
+ `;
1612
+ fs.writeFileSync(capabilitiesPath, capabilities, 'utf-8');
1613
+ result.created.files.push('.claude-flow/CAPABILITIES.md');
1614
+ }
1615
+ /**
1616
+ * Write CLAUDE.md with swarm guidance
1617
+ */
1618
+ async function writeClaudeMd(targetDir, options, result) {
1619
+ const claudeMdPath = path.join(targetDir, 'CLAUDE.md');
1620
+ if (fs.existsSync(claudeMdPath) && !options.force) {
1621
+ result.skipped.push('CLAUDE.md');
1622
+ return;
1623
+ }
1624
+ // Determine template: explicit option > infer from components > 'standard'
1625
+ const inferredTemplate = (!options.components.commands && !options.components.agents) ? 'minimal' : undefined;
1626
+ const content = generateClaudeMd(options, inferredTemplate);
1627
+ fs.writeFileSync(claudeMdPath, content, 'utf-8');
1628
+ result.created.files.push('CLAUDE.md');
1629
+ }
1630
+ /**
1631
+ * Find source directory for skills/commands/agents
1632
+ */
1633
+ function findSourceDir(type, sourceBaseDir) {
1634
+ // Build list of possible paths to check
1635
+ const possiblePaths = [];
1636
+ // If explicit source base directory is provided, use it first
1637
+ if (sourceBaseDir) {
1638
+ possiblePaths.push(path.join(sourceBaseDir, '.claude', type));
1639
+ }
1640
+ // IMPORTANT: Check the package's own .claude directory first
1641
+ // This is the primary path when running as an npm package
1642
+ // __dirname is typically /path/to/node_modules/@claude-flow/cli/dist/src/init
1643
+ // We need to go up 3 levels to reach the package root (dist/src/init -> dist/src -> dist -> root)
1644
+ const packageRoot = path.resolve(__dirname, '..', '..', '..');
1645
+ const packageDotClaude = path.join(packageRoot, '.claude', type);
1646
+ if (fs.existsSync(packageDotClaude)) {
1647
+ possiblePaths.unshift(packageDotClaude); // Add to beginning (highest priority)
1648
+ }
1649
+ // From dist/src/init -> go up to project root
1650
+ const distPath = __dirname;
1651
+ // Try to find the project root by looking for .claude directory
1652
+ let currentDir = distPath;
1653
+ for (let i = 0; i < 10; i++) {
1654
+ const parentDir = path.dirname(currentDir);
1655
+ const dotClaudePath = path.join(parentDir, '.claude', type);
1656
+ if (fs.existsSync(dotClaudePath)) {
1657
+ possiblePaths.push(dotClaudePath);
1658
+ }
1659
+ currentDir = parentDir;
1660
+ }
1661
+ // Also check relative to process.cwd() for development
1662
+ const cwdBased = [
1663
+ path.join(process.cwd(), '.claude', type),
1664
+ path.join(process.cwd(), '..', '.claude', type),
1665
+ path.join(process.cwd(), '..', '..', '.claude', type),
1666
+ ];
1667
+ possiblePaths.push(...cwdBased);
1668
+ // Check v2 directory for agents
1669
+ if (type === 'agents') {
1670
+ possiblePaths.push(path.join(process.cwd(), 'v2', '.claude', type), path.join(process.cwd(), '..', 'v2', '.claude', type));
1671
+ }
1672
+ // Plugin directory
1673
+ possiblePaths.push(path.join(process.cwd(), 'plugin', type), path.join(process.cwd(), '..', 'plugin', type));
1674
+ for (const p of possiblePaths) {
1675
+ if (fs.existsSync(p)) {
1676
+ return p;
1677
+ }
1678
+ }
1679
+ return null;
1680
+ }
1681
+ /**
1682
+ * Copy directory recursively
1683
+ */
1684
+ function copyDirRecursive(src, dest) {
1685
+ fs.mkdirSync(dest, { recursive: true });
1686
+ const entries = fs.readdirSync(src, { withFileTypes: true });
1687
+ for (const entry of entries) {
1688
+ const srcPath = path.join(src, entry.name);
1689
+ const destPath = path.join(dest, entry.name);
1690
+ if (entry.isDirectory()) {
1691
+ copyDirRecursive(srcPath, destPath);
1692
+ }
1693
+ else {
1694
+ fs.copyFileSync(srcPath, destPath);
1695
+ }
1696
+ }
1697
+ }
1698
+ /**
1699
+ * Count files with extension in directory
1700
+ */
1701
+ function countFiles(dir, ext) {
1702
+ let count = 0;
1703
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
1704
+ for (const entry of entries) {
1705
+ const fullPath = path.join(dir, entry.name);
1706
+ if (entry.isDirectory()) {
1707
+ count += countFiles(fullPath, ext);
1708
+ }
1709
+ else if (entry.name.endsWith(ext)) {
1710
+ count++;
1711
+ }
1712
+ }
1713
+ return count;
1714
+ }
1715
+ /**
1716
+ * Count enabled hooks
1717
+ */
1718
+ function countEnabledHooks(options) {
1719
+ const hooks = options.hooks;
1720
+ let count = 0;
1721
+ if (hooks.preToolUse)
1722
+ count++;
1723
+ if (hooks.postToolUse)
1724
+ count++;
1725
+ if (hooks.userPromptSubmit)
1726
+ count++;
1727
+ if (hooks.sessionStart)
1728
+ count++;
1729
+ if (hooks.stop)
1730
+ count++;
1731
+ if (hooks.preCompact)
1732
+ count++;
1733
+ if (hooks.notification)
1734
+ count++;
1735
+ return count;
1736
+ }
1737
+ export default executeInit;
1738
+ //# sourceMappingURL=executor.js.map