@sparkleideas/cli 3.1.0-alpha.17 → 3.1.0-alpha.18

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