getmy-ruflo 3.5.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (732) hide show
  1. package/bin/ruflo.js +29 -0
  2. package/package.json +50 -0
  3. package/v3/@claude-flow/cli/bin/cli.js +156 -0
  4. package/v3/@claude-flow/cli/bin/mcp-server.js +199 -0
  5. package/v3/@claude-flow/cli/bin/mcp-sse-server.js +596 -0
  6. package/v3/@claude-flow/cli/bin/preinstall.cjs +2 -0
  7. package/v3/@claude-flow/cli/dist/src/appliance/gguf-engine.d.ts +91 -0
  8. package/v3/@claude-flow/cli/dist/src/appliance/gguf-engine.d.ts.map +1 -0
  9. package/v3/@claude-flow/cli/dist/src/appliance/gguf-engine.js +425 -0
  10. package/v3/@claude-flow/cli/dist/src/appliance/gguf-engine.js.map +1 -0
  11. package/v3/@claude-flow/cli/dist/src/appliance/ruvllm-bridge.d.ts +102 -0
  12. package/v3/@claude-flow/cli/dist/src/appliance/ruvllm-bridge.d.ts.map +1 -0
  13. package/v3/@claude-flow/cli/dist/src/appliance/ruvllm-bridge.js +292 -0
  14. package/v3/@claude-flow/cli/dist/src/appliance/ruvllm-bridge.js.map +1 -0
  15. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-builder.d.ts +44 -0
  16. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-builder.d.ts.map +1 -0
  17. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-builder.js +329 -0
  18. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-builder.js.map +1 -0
  19. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-distribution.d.ts +97 -0
  20. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-distribution.d.ts.map +1 -0
  21. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-distribution.js +370 -0
  22. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-distribution.js.map +1 -0
  23. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-format.d.ts +111 -0
  24. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-format.d.ts.map +1 -0
  25. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-format.js +393 -0
  26. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-format.js.map +1 -0
  27. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-runner.d.ts +69 -0
  28. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-runner.d.ts.map +1 -0
  29. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-runner.js +237 -0
  30. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-runner.js.map +1 -0
  31. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-signing.d.ts +123 -0
  32. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-signing.d.ts.map +1 -0
  33. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-signing.js +347 -0
  34. package/v3/@claude-flow/cli/dist/src/appliance/rvfa-signing.js.map +1 -0
  35. package/v3/@claude-flow/cli/dist/src/benchmarks/pretrain/index.d.ts +58 -0
  36. package/v3/@claude-flow/cli/dist/src/benchmarks/pretrain/index.d.ts.map +1 -0
  37. package/v3/@claude-flow/cli/dist/src/benchmarks/pretrain/index.js +404 -0
  38. package/v3/@claude-flow/cli/dist/src/benchmarks/pretrain/index.js.map +1 -0
  39. package/v3/@claude-flow/cli/dist/src/commands/agent.d.ts +8 -0
  40. package/v3/@claude-flow/cli/dist/src/commands/agent.d.ts.map +1 -0
  41. package/v3/@claude-flow/cli/dist/src/commands/agent.js +919 -0
  42. package/v3/@claude-flow/cli/dist/src/commands/agent.js.map +1 -0
  43. package/v3/@claude-flow/cli/dist/src/commands/analyze.d.ts +19 -0
  44. package/v3/@claude-flow/cli/dist/src/commands/analyze.d.ts.map +1 -0
  45. package/v3/@claude-flow/cli/dist/src/commands/analyze.js +1823 -0
  46. package/v3/@claude-flow/cli/dist/src/commands/analyze.js.map +1 -0
  47. package/v3/@claude-flow/cli/dist/src/commands/appliance-advanced.d.ts +9 -0
  48. package/v3/@claude-flow/cli/dist/src/commands/appliance-advanced.d.ts.map +1 -0
  49. package/v3/@claude-flow/cli/dist/src/commands/appliance-advanced.js +215 -0
  50. package/v3/@claude-flow/cli/dist/src/commands/appliance-advanced.js.map +1 -0
  51. package/v3/@claude-flow/cli/dist/src/commands/appliance.d.ts +8 -0
  52. package/v3/@claude-flow/cli/dist/src/commands/appliance.d.ts.map +1 -0
  53. package/v3/@claude-flow/cli/dist/src/commands/appliance.js +406 -0
  54. package/v3/@claude-flow/cli/dist/src/commands/appliance.js.map +1 -0
  55. package/v3/@claude-flow/cli/dist/src/commands/benchmark.d.ts +10 -0
  56. package/v3/@claude-flow/cli/dist/src/commands/benchmark.d.ts.map +1 -0
  57. package/v3/@claude-flow/cli/dist/src/commands/benchmark.js +459 -0
  58. package/v3/@claude-flow/cli/dist/src/commands/benchmark.js.map +1 -0
  59. package/v3/@claude-flow/cli/dist/src/commands/claims.d.ts +10 -0
  60. package/v3/@claude-flow/cli/dist/src/commands/claims.d.ts.map +1 -0
  61. package/v3/@claude-flow/cli/dist/src/commands/claims.js +373 -0
  62. package/v3/@claude-flow/cli/dist/src/commands/claims.js.map +1 -0
  63. package/v3/@claude-flow/cli/dist/src/commands/cleanup.d.ts +13 -0
  64. package/v3/@claude-flow/cli/dist/src/commands/cleanup.d.ts.map +1 -0
  65. package/v3/@claude-flow/cli/dist/src/commands/cleanup.js +218 -0
  66. package/v3/@claude-flow/cli/dist/src/commands/cleanup.js.map +1 -0
  67. package/v3/@claude-flow/cli/dist/src/commands/completions.d.ts +10 -0
  68. package/v3/@claude-flow/cli/dist/src/commands/completions.d.ts.map +1 -0
  69. package/v3/@claude-flow/cli/dist/src/commands/completions.js +539 -0
  70. package/v3/@claude-flow/cli/dist/src/commands/completions.js.map +1 -0
  71. package/v3/@claude-flow/cli/dist/src/commands/config.d.ts +8 -0
  72. package/v3/@claude-flow/cli/dist/src/commands/config.d.ts.map +1 -0
  73. package/v3/@claude-flow/cli/dist/src/commands/config.js +406 -0
  74. package/v3/@claude-flow/cli/dist/src/commands/config.js.map +1 -0
  75. package/v3/@claude-flow/cli/dist/src/commands/daemon.d.ts +8 -0
  76. package/v3/@claude-flow/cli/dist/src/commands/daemon.d.ts.map +1 -0
  77. package/v3/@claude-flow/cli/dist/src/commands/daemon.js +656 -0
  78. package/v3/@claude-flow/cli/dist/src/commands/daemon.js.map +1 -0
  79. package/v3/@claude-flow/cli/dist/src/commands/deployment.d.ts +10 -0
  80. package/v3/@claude-flow/cli/dist/src/commands/deployment.d.ts.map +1 -0
  81. package/v3/@claude-flow/cli/dist/src/commands/deployment.js +289 -0
  82. package/v3/@claude-flow/cli/dist/src/commands/deployment.js.map +1 -0
  83. package/v3/@claude-flow/cli/dist/src/commands/doctor.d.ts +10 -0
  84. package/v3/@claude-flow/cli/dist/src/commands/doctor.d.ts.map +1 -0
  85. package/v3/@claude-flow/cli/dist/src/commands/doctor.js +619 -0
  86. package/v3/@claude-flow/cli/dist/src/commands/doctor.js.map +1 -0
  87. package/v3/@claude-flow/cli/dist/src/commands/embeddings.d.ts +18 -0
  88. package/v3/@claude-flow/cli/dist/src/commands/embeddings.d.ts.map +1 -0
  89. package/v3/@claude-flow/cli/dist/src/commands/embeddings.js +1576 -0
  90. package/v3/@claude-flow/cli/dist/src/commands/embeddings.js.map +1 -0
  91. package/v3/@claude-flow/cli/dist/src/commands/guidance.d.ts +8 -0
  92. package/v3/@claude-flow/cli/dist/src/commands/guidance.d.ts.map +1 -0
  93. package/v3/@claude-flow/cli/dist/src/commands/guidance.js +560 -0
  94. package/v3/@claude-flow/cli/dist/src/commands/guidance.js.map +1 -0
  95. package/v3/@claude-flow/cli/dist/src/commands/hive-mind.d.ts +11 -0
  96. package/v3/@claude-flow/cli/dist/src/commands/hive-mind.d.ts.map +1 -0
  97. package/v3/@claude-flow/cli/dist/src/commands/hive-mind.js +1230 -0
  98. package/v3/@claude-flow/cli/dist/src/commands/hive-mind.js.map +1 -0
  99. package/v3/@claude-flow/cli/dist/src/commands/hooks.d.ts +8 -0
  100. package/v3/@claude-flow/cli/dist/src/commands/hooks.d.ts.map +1 -0
  101. package/v3/@claude-flow/cli/dist/src/commands/hooks.js +4441 -0
  102. package/v3/@claude-flow/cli/dist/src/commands/hooks.js.map +1 -0
  103. package/v3/@claude-flow/cli/dist/src/commands/index.d.ts +115 -0
  104. package/v3/@claude-flow/cli/dist/src/commands/index.d.ts.map +1 -0
  105. package/v3/@claude-flow/cli/dist/src/commands/index.js +377 -0
  106. package/v3/@claude-flow/cli/dist/src/commands/index.js.map +1 -0
  107. package/v3/@claude-flow/cli/dist/src/commands/init.d.ts +8 -0
  108. package/v3/@claude-flow/cli/dist/src/commands/init.d.ts.map +1 -0
  109. package/v3/@claude-flow/cli/dist/src/commands/init.js +969 -0
  110. package/v3/@claude-flow/cli/dist/src/commands/init.js.map +1 -0
  111. package/v3/@claude-flow/cli/dist/src/commands/issues.d.ts +21 -0
  112. package/v3/@claude-flow/cli/dist/src/commands/issues.d.ts.map +1 -0
  113. package/v3/@claude-flow/cli/dist/src/commands/issues.js +567 -0
  114. package/v3/@claude-flow/cli/dist/src/commands/issues.js.map +1 -0
  115. package/v3/@claude-flow/cli/dist/src/commands/mcp.d.ts +11 -0
  116. package/v3/@claude-flow/cli/dist/src/commands/mcp.d.ts.map +1 -0
  117. package/v3/@claude-flow/cli/dist/src/commands/mcp.js +779 -0
  118. package/v3/@claude-flow/cli/dist/src/commands/mcp.js.map +1 -0
  119. package/v3/@claude-flow/cli/dist/src/commands/memory.d.ts +8 -0
  120. package/v3/@claude-flow/cli/dist/src/commands/memory.d.ts.map +1 -0
  121. package/v3/@claude-flow/cli/dist/src/commands/memory.js +1292 -0
  122. package/v3/@claude-flow/cli/dist/src/commands/memory.js.map +1 -0
  123. package/v3/@claude-flow/cli/dist/src/commands/migrate.d.ts +8 -0
  124. package/v3/@claude-flow/cli/dist/src/commands/migrate.d.ts.map +1 -0
  125. package/v3/@claude-flow/cli/dist/src/commands/migrate.js +410 -0
  126. package/v3/@claude-flow/cli/dist/src/commands/migrate.js.map +1 -0
  127. package/v3/@claude-flow/cli/dist/src/commands/neural.d.ts +10 -0
  128. package/v3/@claude-flow/cli/dist/src/commands/neural.d.ts.map +1 -0
  129. package/v3/@claude-flow/cli/dist/src/commands/neural.js +1454 -0
  130. package/v3/@claude-flow/cli/dist/src/commands/neural.js.map +1 -0
  131. package/v3/@claude-flow/cli/dist/src/commands/performance.d.ts +10 -0
  132. package/v3/@claude-flow/cli/dist/src/commands/performance.d.ts.map +1 -0
  133. package/v3/@claude-flow/cli/dist/src/commands/performance.js +579 -0
  134. package/v3/@claude-flow/cli/dist/src/commands/performance.js.map +1 -0
  135. package/v3/@claude-flow/cli/dist/src/commands/plugins.d.ts +11 -0
  136. package/v3/@claude-flow/cli/dist/src/commands/plugins.d.ts.map +1 -0
  137. package/v3/@claude-flow/cli/dist/src/commands/plugins.js +820 -0
  138. package/v3/@claude-flow/cli/dist/src/commands/plugins.js.map +1 -0
  139. package/v3/@claude-flow/cli/dist/src/commands/process.d.ts +10 -0
  140. package/v3/@claude-flow/cli/dist/src/commands/process.d.ts.map +1 -0
  141. package/v3/@claude-flow/cli/dist/src/commands/process.js +641 -0
  142. package/v3/@claude-flow/cli/dist/src/commands/process.js.map +1 -0
  143. package/v3/@claude-flow/cli/dist/src/commands/progress.d.ts +11 -0
  144. package/v3/@claude-flow/cli/dist/src/commands/progress.d.ts.map +1 -0
  145. package/v3/@claude-flow/cli/dist/src/commands/progress.js +259 -0
  146. package/v3/@claude-flow/cli/dist/src/commands/progress.js.map +1 -0
  147. package/v3/@claude-flow/cli/dist/src/commands/providers.d.ts +10 -0
  148. package/v3/@claude-flow/cli/dist/src/commands/providers.d.ts.map +1 -0
  149. package/v3/@claude-flow/cli/dist/src/commands/providers.js +232 -0
  150. package/v3/@claude-flow/cli/dist/src/commands/providers.js.map +1 -0
  151. package/v3/@claude-flow/cli/dist/src/commands/route.d.ts +16 -0
  152. package/v3/@claude-flow/cli/dist/src/commands/route.d.ts.map +1 -0
  153. package/v3/@claude-flow/cli/dist/src/commands/route.js +813 -0
  154. package/v3/@claude-flow/cli/dist/src/commands/route.js.map +1 -0
  155. package/v3/@claude-flow/cli/dist/src/commands/ruvector/backup.d.ts +11 -0
  156. package/v3/@claude-flow/cli/dist/src/commands/ruvector/backup.d.ts.map +1 -0
  157. package/v3/@claude-flow/cli/dist/src/commands/ruvector/backup.js +746 -0
  158. package/v3/@claude-flow/cli/dist/src/commands/ruvector/backup.js.map +1 -0
  159. package/v3/@claude-flow/cli/dist/src/commands/ruvector/benchmark.d.ts +11 -0
  160. package/v3/@claude-flow/cli/dist/src/commands/ruvector/benchmark.d.ts.map +1 -0
  161. package/v3/@claude-flow/cli/dist/src/commands/ruvector/benchmark.js +480 -0
  162. package/v3/@claude-flow/cli/dist/src/commands/ruvector/benchmark.js.map +1 -0
  163. package/v3/@claude-flow/cli/dist/src/commands/ruvector/import.d.ts +18 -0
  164. package/v3/@claude-flow/cli/dist/src/commands/ruvector/import.d.ts.map +1 -0
  165. package/v3/@claude-flow/cli/dist/src/commands/ruvector/import.js +349 -0
  166. package/v3/@claude-flow/cli/dist/src/commands/ruvector/import.js.map +1 -0
  167. package/v3/@claude-flow/cli/dist/src/commands/ruvector/index.d.ts +29 -0
  168. package/v3/@claude-flow/cli/dist/src/commands/ruvector/index.d.ts.map +1 -0
  169. package/v3/@claude-flow/cli/dist/src/commands/ruvector/index.js +129 -0
  170. package/v3/@claude-flow/cli/dist/src/commands/ruvector/index.js.map +1 -0
  171. package/v3/@claude-flow/cli/dist/src/commands/ruvector/init.d.ts +11 -0
  172. package/v3/@claude-flow/cli/dist/src/commands/ruvector/init.d.ts.map +1 -0
  173. package/v3/@claude-flow/cli/dist/src/commands/ruvector/init.js +431 -0
  174. package/v3/@claude-flow/cli/dist/src/commands/ruvector/init.js.map +1 -0
  175. package/v3/@claude-flow/cli/dist/src/commands/ruvector/migrate.d.ts +11 -0
  176. package/v3/@claude-flow/cli/dist/src/commands/ruvector/migrate.d.ts.map +1 -0
  177. package/v3/@claude-flow/cli/dist/src/commands/ruvector/migrate.js +481 -0
  178. package/v3/@claude-flow/cli/dist/src/commands/ruvector/migrate.js.map +1 -0
  179. package/v3/@claude-flow/cli/dist/src/commands/ruvector/optimize.d.ts +11 -0
  180. package/v3/@claude-flow/cli/dist/src/commands/ruvector/optimize.d.ts.map +1 -0
  181. package/v3/@claude-flow/cli/dist/src/commands/ruvector/optimize.js +503 -0
  182. package/v3/@claude-flow/cli/dist/src/commands/ruvector/optimize.js.map +1 -0
  183. package/v3/@claude-flow/cli/dist/src/commands/ruvector/setup.d.ts +18 -0
  184. package/v3/@claude-flow/cli/dist/src/commands/ruvector/setup.d.ts.map +1 -0
  185. package/v3/@claude-flow/cli/dist/src/commands/ruvector/setup.js +765 -0
  186. package/v3/@claude-flow/cli/dist/src/commands/ruvector/setup.js.map +1 -0
  187. package/v3/@claude-flow/cli/dist/src/commands/ruvector/status.d.ts +11 -0
  188. package/v3/@claude-flow/cli/dist/src/commands/ruvector/status.d.ts.map +1 -0
  189. package/v3/@claude-flow/cli/dist/src/commands/ruvector/status.js +456 -0
  190. package/v3/@claude-flow/cli/dist/src/commands/ruvector/status.js.map +1 -0
  191. package/v3/@claude-flow/cli/dist/src/commands/security.d.ts +10 -0
  192. package/v3/@claude-flow/cli/dist/src/commands/security.d.ts.map +1 -0
  193. package/v3/@claude-flow/cli/dist/src/commands/security.js +606 -0
  194. package/v3/@claude-flow/cli/dist/src/commands/security.js.map +1 -0
  195. package/v3/@claude-flow/cli/dist/src/commands/session.d.ts +8 -0
  196. package/v3/@claude-flow/cli/dist/src/commands/session.d.ts.map +1 -0
  197. package/v3/@claude-flow/cli/dist/src/commands/session.js +750 -0
  198. package/v3/@claude-flow/cli/dist/src/commands/session.js.map +1 -0
  199. package/v3/@claude-flow/cli/dist/src/commands/start.d.ts +8 -0
  200. package/v3/@claude-flow/cli/dist/src/commands/start.d.ts.map +1 -0
  201. package/v3/@claude-flow/cli/dist/src/commands/start.js +418 -0
  202. package/v3/@claude-flow/cli/dist/src/commands/start.js.map +1 -0
  203. package/v3/@claude-flow/cli/dist/src/commands/status.d.ts +8 -0
  204. package/v3/@claude-flow/cli/dist/src/commands/status.d.ts.map +1 -0
  205. package/v3/@claude-flow/cli/dist/src/commands/status.js +591 -0
  206. package/v3/@claude-flow/cli/dist/src/commands/status.js.map +1 -0
  207. package/v3/@claude-flow/cli/dist/src/commands/swarm.d.ts +8 -0
  208. package/v3/@claude-flow/cli/dist/src/commands/swarm.d.ts.map +1 -0
  209. package/v3/@claude-flow/cli/dist/src/commands/swarm.js +748 -0
  210. package/v3/@claude-flow/cli/dist/src/commands/swarm.js.map +1 -0
  211. package/v3/@claude-flow/cli/dist/src/commands/task.d.ts +8 -0
  212. package/v3/@claude-flow/cli/dist/src/commands/task.d.ts.map +1 -0
  213. package/v3/@claude-flow/cli/dist/src/commands/task.js +671 -0
  214. package/v3/@claude-flow/cli/dist/src/commands/task.js.map +1 -0
  215. package/v3/@claude-flow/cli/dist/src/commands/transfer-store.d.ts +13 -0
  216. package/v3/@claude-flow/cli/dist/src/commands/transfer-store.d.ts.map +1 -0
  217. package/v3/@claude-flow/cli/dist/src/commands/transfer-store.js +428 -0
  218. package/v3/@claude-flow/cli/dist/src/commands/transfer-store.js.map +1 -0
  219. package/v3/@claude-flow/cli/dist/src/commands/update.d.ts +8 -0
  220. package/v3/@claude-flow/cli/dist/src/commands/update.d.ts.map +1 -0
  221. package/v3/@claude-flow/cli/dist/src/commands/update.js +276 -0
  222. package/v3/@claude-flow/cli/dist/src/commands/update.js.map +1 -0
  223. package/v3/@claude-flow/cli/dist/src/commands/workflow.d.ts +8 -0
  224. package/v3/@claude-flow/cli/dist/src/commands/workflow.d.ts.map +1 -0
  225. package/v3/@claude-flow/cli/dist/src/commands/workflow.js +617 -0
  226. package/v3/@claude-flow/cli/dist/src/commands/workflow.js.map +1 -0
  227. package/v3/@claude-flow/cli/dist/src/config-adapter.d.ts +15 -0
  228. package/v3/@claude-flow/cli/dist/src/config-adapter.d.ts.map +1 -0
  229. package/v3/@claude-flow/cli/dist/src/config-adapter.js +186 -0
  230. package/v3/@claude-flow/cli/dist/src/config-adapter.js.map +1 -0
  231. package/v3/@claude-flow/cli/dist/src/index.d.ts +76 -0
  232. package/v3/@claude-flow/cli/dist/src/index.d.ts.map +1 -0
  233. package/v3/@claude-flow/cli/dist/src/index.js +472 -0
  234. package/v3/@claude-flow/cli/dist/src/index.js.map +1 -0
  235. package/v3/@claude-flow/cli/dist/src/infrastructure/in-memory-repositories.d.ts +68 -0
  236. package/v3/@claude-flow/cli/dist/src/infrastructure/in-memory-repositories.d.ts.map +1 -0
  237. package/v3/@claude-flow/cli/dist/src/infrastructure/in-memory-repositories.js +264 -0
  238. package/v3/@claude-flow/cli/dist/src/infrastructure/in-memory-repositories.js.map +1 -0
  239. package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.d.ts +25 -0
  240. package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.d.ts.map +1 -0
  241. package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.js +486 -0
  242. package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.js.map +1 -0
  243. package/v3/@claude-flow/cli/dist/src/init/executor.d.ts +41 -0
  244. package/v3/@claude-flow/cli/dist/src/init/executor.d.ts.map +1 -0
  245. package/v3/@claude-flow/cli/dist/src/init/executor.js +1738 -0
  246. package/v3/@claude-flow/cli/dist/src/init/executor.js.map +1 -0
  247. package/v3/@claude-flow/cli/dist/src/init/helpers-generator.d.ts +60 -0
  248. package/v3/@claude-flow/cli/dist/src/init/helpers-generator.d.ts.map +1 -0
  249. package/v3/@claude-flow/cli/dist/src/init/helpers-generator.js +1181 -0
  250. package/v3/@claude-flow/cli/dist/src/init/helpers-generator.js.map +1 -0
  251. package/v3/@claude-flow/cli/dist/src/init/index.d.ts +13 -0
  252. package/v3/@claude-flow/cli/dist/src/init/index.d.ts.map +1 -0
  253. package/v3/@claude-flow/cli/dist/src/init/index.js +15 -0
  254. package/v3/@claude-flow/cli/dist/src/init/index.js.map +1 -0
  255. package/v3/@claude-flow/cli/dist/src/init/mcp-generator.d.ts +26 -0
  256. package/v3/@claude-flow/cli/dist/src/init/mcp-generator.d.ts.map +1 -0
  257. package/v3/@claude-flow/cli/dist/src/init/mcp-generator.js +116 -0
  258. package/v3/@claude-flow/cli/dist/src/init/mcp-generator.js.map +1 -0
  259. package/v3/@claude-flow/cli/dist/src/init/settings-generator.d.ts +14 -0
  260. package/v3/@claude-flow/cli/dist/src/init/settings-generator.d.ts.map +1 -0
  261. package/v3/@claude-flow/cli/dist/src/init/settings-generator.js +403 -0
  262. package/v3/@claude-flow/cli/dist/src/init/settings-generator.js.map +1 -0
  263. package/v3/@claude-flow/cli/dist/src/init/statusline-generator.d.ts +28 -0
  264. package/v3/@claude-flow/cli/dist/src/init/statusline-generator.d.ts.map +1 -0
  265. package/v3/@claude-flow/cli/dist/src/init/statusline-generator.js +833 -0
  266. package/v3/@claude-flow/cli/dist/src/init/statusline-generator.js.map +1 -0
  267. package/v3/@claude-flow/cli/dist/src/init/types.d.ts +295 -0
  268. package/v3/@claude-flow/cli/dist/src/init/types.d.ts.map +1 -0
  269. package/v3/@claude-flow/cli/dist/src/init/types.js +263 -0
  270. package/v3/@claude-flow/cli/dist/src/init/types.js.map +1 -0
  271. package/v3/@claude-flow/cli/dist/src/mcp-client.d.ts +98 -0
  272. package/v3/@claude-flow/cli/dist/src/mcp-client.d.ts.map +1 -0
  273. package/v3/@claude-flow/cli/dist/src/mcp-client.js +278 -0
  274. package/v3/@claude-flow/cli/dist/src/mcp-client.js.map +1 -0
  275. package/v3/@claude-flow/cli/dist/src/mcp-server.d.ts +161 -0
  276. package/v3/@claude-flow/cli/dist/src/mcp-server.d.ts.map +1 -0
  277. package/v3/@claude-flow/cli/dist/src/mcp-server.js +627 -0
  278. package/v3/@claude-flow/cli/dist/src/mcp-server.js.map +1 -0
  279. package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.d.ts +49 -0
  280. package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.d.ts.map +1 -0
  281. package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.js +622 -0
  282. package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.js.map +1 -0
  283. package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.d.ts +30 -0
  284. package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.d.ts.map +1 -0
  285. package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.js +557 -0
  286. package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.js.map +1 -0
  287. package/v3/@claude-flow/cli/dist/src/mcp-tools/analyze-tools.d.ts +38 -0
  288. package/v3/@claude-flow/cli/dist/src/mcp-tools/analyze-tools.d.ts.map +1 -0
  289. package/v3/@claude-flow/cli/dist/src/mcp-tools/analyze-tools.js +317 -0
  290. package/v3/@claude-flow/cli/dist/src/mcp-tools/analyze-tools.js.map +1 -0
  291. package/v3/@claude-flow/cli/dist/src/mcp-tools/auto-install.d.ts +83 -0
  292. package/v3/@claude-flow/cli/dist/src/mcp-tools/auto-install.d.ts.map +1 -0
  293. package/v3/@claude-flow/cli/dist/src/mcp-tools/auto-install.js +131 -0
  294. package/v3/@claude-flow/cli/dist/src/mcp-tools/auto-install.js.map +1 -0
  295. package/v3/@claude-flow/cli/dist/src/mcp-tools/browser-tools.d.ts +10 -0
  296. package/v3/@claude-flow/cli/dist/src/mcp-tools/browser-tools.d.ts.map +1 -0
  297. package/v3/@claude-flow/cli/dist/src/mcp-tools/browser-tools.js +639 -0
  298. package/v3/@claude-flow/cli/dist/src/mcp-tools/browser-tools.js.map +1 -0
  299. package/v3/@claude-flow/cli/dist/src/mcp-tools/claims-tools.d.ts +12 -0
  300. package/v3/@claude-flow/cli/dist/src/mcp-tools/claims-tools.d.ts.map +1 -0
  301. package/v3/@claude-flow/cli/dist/src/mcp-tools/claims-tools.js +732 -0
  302. package/v3/@claude-flow/cli/dist/src/mcp-tools/claims-tools.js.map +1 -0
  303. package/v3/@claude-flow/cli/dist/src/mcp-tools/config-tools.d.ts +8 -0
  304. package/v3/@claude-flow/cli/dist/src/mcp-tools/config-tools.d.ts.map +1 -0
  305. package/v3/@claude-flow/cli/dist/src/mcp-tools/config-tools.js +352 -0
  306. package/v3/@claude-flow/cli/dist/src/mcp-tools/config-tools.js.map +1 -0
  307. package/v3/@claude-flow/cli/dist/src/mcp-tools/coordination-tools.d.ts +13 -0
  308. package/v3/@claude-flow/cli/dist/src/mcp-tools/coordination-tools.d.ts.map +1 -0
  309. package/v3/@claude-flow/cli/dist/src/mcp-tools/coordination-tools.js +827 -0
  310. package/v3/@claude-flow/cli/dist/src/mcp-tools/coordination-tools.js.map +1 -0
  311. package/v3/@claude-flow/cli/dist/src/mcp-tools/daa-tools.d.ts +13 -0
  312. package/v3/@claude-flow/cli/dist/src/mcp-tools/daa-tools.d.ts.map +1 -0
  313. package/v3/@claude-flow/cli/dist/src/mcp-tools/daa-tools.js +426 -0
  314. package/v3/@claude-flow/cli/dist/src/mcp-tools/daa-tools.js.map +1 -0
  315. package/v3/@claude-flow/cli/dist/src/mcp-tools/dev-tools.d.ts +11 -0
  316. package/v3/@claude-flow/cli/dist/src/mcp-tools/dev-tools.d.ts.map +1 -0
  317. package/v3/@claude-flow/cli/dist/src/mcp-tools/dev-tools.js +713 -0
  318. package/v3/@claude-flow/cli/dist/src/mcp-tools/dev-tools.js.map +1 -0
  319. package/v3/@claude-flow/cli/dist/src/mcp-tools/embeddings-tools.d.ts +9 -0
  320. package/v3/@claude-flow/cli/dist/src/mcp-tools/embeddings-tools.d.ts.map +1 -0
  321. package/v3/@claude-flow/cli/dist/src/mcp-tools/embeddings-tools.js +782 -0
  322. package/v3/@claude-flow/cli/dist/src/mcp-tools/embeddings-tools.js.map +1 -0
  323. package/v3/@claude-flow/cli/dist/src/mcp-tools/github-tools.d.ts +13 -0
  324. package/v3/@claude-flow/cli/dist/src/mcp-tools/github-tools.d.ts.map +1 -0
  325. package/v3/@claude-flow/cli/dist/src/mcp-tools/github-tools.js +373 -0
  326. package/v3/@claude-flow/cli/dist/src/mcp-tools/github-tools.js.map +1 -0
  327. package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.d.ts +8 -0
  328. package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -0
  329. package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.js +811 -0
  330. package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.js.map +1 -0
  331. package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.d.ts +44 -0
  332. package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -0
  333. package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js +3112 -0
  334. package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js.map +1 -0
  335. package/v3/@claude-flow/cli/dist/src/mcp-tools/index.d.ts +29 -0
  336. package/v3/@claude-flow/cli/dist/src/mcp-tools/index.d.ts.map +1 -0
  337. package/v3/@claude-flow/cli/dist/src/mcp-tools/index.js +28 -0
  338. package/v3/@claude-flow/cli/dist/src/mcp-tools/index.js.map +1 -0
  339. package/v3/@claude-flow/cli/dist/src/mcp-tools/infrastructure-tools.d.ts +10 -0
  340. package/v3/@claude-flow/cli/dist/src/mcp-tools/infrastructure-tools.d.ts.map +1 -0
  341. package/v3/@claude-flow/cli/dist/src/mcp-tools/infrastructure-tools.js +547 -0
  342. package/v3/@claude-flow/cli/dist/src/mcp-tools/infrastructure-tools.js.map +1 -0
  343. package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.d.ts +14 -0
  344. package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.d.ts.map +1 -0
  345. package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.js +512 -0
  346. package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.js.map +1 -0
  347. package/v3/@claude-flow/cli/dist/src/mcp-tools/neural-tools.d.ts +16 -0
  348. package/v3/@claude-flow/cli/dist/src/mcp-tools/neural-tools.d.ts.map +1 -0
  349. package/v3/@claude-flow/cli/dist/src/mcp-tools/neural-tools.js +461 -0
  350. package/v3/@claude-flow/cli/dist/src/mcp-tools/neural-tools.js.map +1 -0
  351. package/v3/@claude-flow/cli/dist/src/mcp-tools/performance-tools.d.ts +16 -0
  352. package/v3/@claude-flow/cli/dist/src/mcp-tools/performance-tools.d.ts.map +1 -0
  353. package/v3/@claude-flow/cli/dist/src/mcp-tools/performance-tools.js +534 -0
  354. package/v3/@claude-flow/cli/dist/src/mcp-tools/performance-tools.js.map +1 -0
  355. package/v3/@claude-flow/cli/dist/src/mcp-tools/plugin-tools.d.ts +19 -0
  356. package/v3/@claude-flow/cli/dist/src/mcp-tools/plugin-tools.d.ts.map +1 -0
  357. package/v3/@claude-flow/cli/dist/src/mcp-tools/plugin-tools.js +135 -0
  358. package/v3/@claude-flow/cli/dist/src/mcp-tools/plugin-tools.js.map +1 -0
  359. package/v3/@claude-flow/cli/dist/src/mcp-tools/process-manager-tools.d.ts +9 -0
  360. package/v3/@claude-flow/cli/dist/src/mcp-tools/process-manager-tools.d.ts.map +1 -0
  361. package/v3/@claude-flow/cli/dist/src/mcp-tools/process-manager-tools.js +516 -0
  362. package/v3/@claude-flow/cli/dist/src/mcp-tools/process-manager-tools.js.map +1 -0
  363. package/v3/@claude-flow/cli/dist/src/mcp-tools/progress-tools.d.ts +14 -0
  364. package/v3/@claude-flow/cli/dist/src/mcp-tools/progress-tools.d.ts.map +1 -0
  365. package/v3/@claude-flow/cli/dist/src/mcp-tools/progress-tools.js +348 -0
  366. package/v3/@claude-flow/cli/dist/src/mcp-tools/progress-tools.js.map +1 -0
  367. package/v3/@claude-flow/cli/dist/src/mcp-tools/refactor-tools.d.ts +10 -0
  368. package/v3/@claude-flow/cli/dist/src/mcp-tools/refactor-tools.d.ts.map +1 -0
  369. package/v3/@claude-flow/cli/dist/src/mcp-tools/refactor-tools.js +471 -0
  370. package/v3/@claude-flow/cli/dist/src/mcp-tools/refactor-tools.js.map +1 -0
  371. package/v3/@claude-flow/cli/dist/src/mcp-tools/ruvllm-tools.d.ts +9 -0
  372. package/v3/@claude-flow/cli/dist/src/mcp-tools/ruvllm-tools.d.ts.map +1 -0
  373. package/v3/@claude-flow/cli/dist/src/mcp-tools/ruvllm-tools.js +283 -0
  374. package/v3/@claude-flow/cli/dist/src/mcp-tools/ruvllm-tools.js.map +1 -0
  375. package/v3/@claude-flow/cli/dist/src/mcp-tools/security-tools.d.ts +18 -0
  376. package/v3/@claude-flow/cli/dist/src/mcp-tools/security-tools.d.ts.map +1 -0
  377. package/v3/@claude-flow/cli/dist/src/mcp-tools/security-tools.js +434 -0
  378. package/v3/@claude-flow/cli/dist/src/mcp-tools/security-tools.js.map +1 -0
  379. package/v3/@claude-flow/cli/dist/src/mcp-tools/session-tools.d.ts +8 -0
  380. package/v3/@claude-flow/cli/dist/src/mcp-tools/session-tools.d.ts.map +1 -0
  381. package/v3/@claude-flow/cli/dist/src/mcp-tools/session-tools.js +315 -0
  382. package/v3/@claude-flow/cli/dist/src/mcp-tools/session-tools.js.map +1 -0
  383. package/v3/@claude-flow/cli/dist/src/mcp-tools/skill-dispatch-tools.d.ts +17 -0
  384. package/v3/@claude-flow/cli/dist/src/mcp-tools/skill-dispatch-tools.d.ts.map +1 -0
  385. package/v3/@claude-flow/cli/dist/src/mcp-tools/skill-dispatch-tools.js +384 -0
  386. package/v3/@claude-flow/cli/dist/src/mcp-tools/skill-dispatch-tools.js.map +1 -0
  387. package/v3/@claude-flow/cli/dist/src/mcp-tools/skills-tools.d.ts +14 -0
  388. package/v3/@claude-flow/cli/dist/src/mcp-tools/skills-tools.d.ts.map +1 -0
  389. package/v3/@claude-flow/cli/dist/src/mcp-tools/skills-tools.js +295 -0
  390. package/v3/@claude-flow/cli/dist/src/mcp-tools/skills-tools.js.map +1 -0
  391. package/v3/@claude-flow/cli/dist/src/mcp-tools/swarm-tools.d.ts +9 -0
  392. package/v3/@claude-flow/cli/dist/src/mcp-tools/swarm-tools.d.ts.map +1 -0
  393. package/v3/@claude-flow/cli/dist/src/mcp-tools/swarm-tools.js +321 -0
  394. package/v3/@claude-flow/cli/dist/src/mcp-tools/swarm-tools.js.map +1 -0
  395. package/v3/@claude-flow/cli/dist/src/mcp-tools/system-tools.d.ts +13 -0
  396. package/v3/@claude-flow/cli/dist/src/mcp-tools/system-tools.d.ts.map +1 -0
  397. package/v3/@claude-flow/cli/dist/src/mcp-tools/system-tools.js +417 -0
  398. package/v3/@claude-flow/cli/dist/src/mcp-tools/system-tools.js.map +1 -0
  399. package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.d.ts +8 -0
  400. package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.d.ts.map +1 -0
  401. package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.js +404 -0
  402. package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.js.map +1 -0
  403. package/v3/@claude-flow/cli/dist/src/mcp-tools/terminal-tools.d.ts +15 -0
  404. package/v3/@claude-flow/cli/dist/src/mcp-tools/terminal-tools.d.ts.map +1 -0
  405. package/v3/@claude-flow/cli/dist/src/mcp-tools/terminal-tools.js +339 -0
  406. package/v3/@claude-flow/cli/dist/src/mcp-tools/terminal-tools.js.map +1 -0
  407. package/v3/@claude-flow/cli/dist/src/mcp-tools/transfer-tools.d.ts +14 -0
  408. package/v3/@claude-flow/cli/dist/src/mcp-tools/transfer-tools.d.ts.map +1 -0
  409. package/v3/@claude-flow/cli/dist/src/mcp-tools/transfer-tools.js +396 -0
  410. package/v3/@claude-flow/cli/dist/src/mcp-tools/transfer-tools.js.map +1 -0
  411. package/v3/@claude-flow/cli/dist/src/mcp-tools/types.d.ts +31 -0
  412. package/v3/@claude-flow/cli/dist/src/mcp-tools/types.d.ts.map +1 -0
  413. package/v3/@claude-flow/cli/dist/src/mcp-tools/types.js +7 -0
  414. package/v3/@claude-flow/cli/dist/src/mcp-tools/types.js.map +1 -0
  415. package/v3/@claude-flow/cli/dist/src/mcp-tools/wasm-agent-tools.d.ts +9 -0
  416. package/v3/@claude-flow/cli/dist/src/mcp-tools/wasm-agent-tools.d.ts.map +1 -0
  417. package/v3/@claude-flow/cli/dist/src/mcp-tools/wasm-agent-tools.js +230 -0
  418. package/v3/@claude-flow/cli/dist/src/mcp-tools/wasm-agent-tools.js.map +1 -0
  419. package/v3/@claude-flow/cli/dist/src/mcp-tools/workflow-tools.d.ts +8 -0
  420. package/v3/@claude-flow/cli/dist/src/mcp-tools/workflow-tools.d.ts.map +1 -0
  421. package/v3/@claude-flow/cli/dist/src/mcp-tools/workflow-tools.js +572 -0
  422. package/v3/@claude-flow/cli/dist/src/mcp-tools/workflow-tools.js.map +1 -0
  423. package/v3/@claude-flow/cli/dist/src/memory/ewc-consolidation.d.ts +295 -0
  424. package/v3/@claude-flow/cli/dist/src/memory/ewc-consolidation.d.ts.map +1 -0
  425. package/v3/@claude-flow/cli/dist/src/memory/ewc-consolidation.js +601 -0
  426. package/v3/@claude-flow/cli/dist/src/memory/ewc-consolidation.js.map +1 -0
  427. package/v3/@claude-flow/cli/dist/src/memory/intelligence.d.ts +338 -0
  428. package/v3/@claude-flow/cli/dist/src/memory/intelligence.d.ts.map +1 -0
  429. package/v3/@claude-flow/cli/dist/src/memory/intelligence.js +1023 -0
  430. package/v3/@claude-flow/cli/dist/src/memory/intelligence.js.map +1 -0
  431. package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.d.ts +407 -0
  432. package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.d.ts.map +1 -0
  433. package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.js +1494 -0
  434. package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.js.map +1 -0
  435. package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.d.ts +434 -0
  436. package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.d.ts.map +1 -0
  437. package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js +2243 -0
  438. package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js.map +1 -0
  439. package/v3/@claude-flow/cli/dist/src/memory/sona-optimizer.d.ts +227 -0
  440. package/v3/@claude-flow/cli/dist/src/memory/sona-optimizer.d.ts.map +1 -0
  441. package/v3/@claude-flow/cli/dist/src/memory/sona-optimizer.js +633 -0
  442. package/v3/@claude-flow/cli/dist/src/memory/sona-optimizer.js.map +1 -0
  443. package/v3/@claude-flow/cli/dist/src/output.d.ts +133 -0
  444. package/v3/@claude-flow/cli/dist/src/output.d.ts.map +1 -0
  445. package/v3/@claude-flow/cli/dist/src/output.js +514 -0
  446. package/v3/@claude-flow/cli/dist/src/output.js.map +1 -0
  447. package/v3/@claude-flow/cli/dist/src/parser.d.ts +51 -0
  448. package/v3/@claude-flow/cli/dist/src/parser.d.ts.map +1 -0
  449. package/v3/@claude-flow/cli/dist/src/parser.js +423 -0
  450. package/v3/@claude-flow/cli/dist/src/parser.js.map +1 -0
  451. package/v3/@claude-flow/cli/dist/src/plugins/manager.d.ts +133 -0
  452. package/v3/@claude-flow/cli/dist/src/plugins/manager.d.ts.map +1 -0
  453. package/v3/@claude-flow/cli/dist/src/plugins/manager.js +400 -0
  454. package/v3/@claude-flow/cli/dist/src/plugins/manager.js.map +1 -0
  455. package/v3/@claude-flow/cli/dist/src/plugins/store/discovery.d.ts +88 -0
  456. package/v3/@claude-flow/cli/dist/src/plugins/store/discovery.d.ts.map +1 -0
  457. package/v3/@claude-flow/cli/dist/src/plugins/store/discovery.js +1147 -0
  458. package/v3/@claude-flow/cli/dist/src/plugins/store/discovery.js.map +1 -0
  459. package/v3/@claude-flow/cli/dist/src/plugins/store/index.d.ts +76 -0
  460. package/v3/@claude-flow/cli/dist/src/plugins/store/index.d.ts.map +1 -0
  461. package/v3/@claude-flow/cli/dist/src/plugins/store/index.js +141 -0
  462. package/v3/@claude-flow/cli/dist/src/plugins/store/index.js.map +1 -0
  463. package/v3/@claude-flow/cli/dist/src/plugins/store/search.d.ts +46 -0
  464. package/v3/@claude-flow/cli/dist/src/plugins/store/search.d.ts.map +1 -0
  465. package/v3/@claude-flow/cli/dist/src/plugins/store/search.js +230 -0
  466. package/v3/@claude-flow/cli/dist/src/plugins/store/search.js.map +1 -0
  467. package/v3/@claude-flow/cli/dist/src/plugins/store/types.d.ts +274 -0
  468. package/v3/@claude-flow/cli/dist/src/plugins/store/types.d.ts.map +1 -0
  469. package/v3/@claude-flow/cli/dist/src/plugins/store/types.js +7 -0
  470. package/v3/@claude-flow/cli/dist/src/plugins/store/types.js.map +1 -0
  471. package/v3/@claude-flow/cli/dist/src/plugins/tests/demo-plugin-store.d.ts +7 -0
  472. package/v3/@claude-flow/cli/dist/src/plugins/tests/demo-plugin-store.d.ts.map +1 -0
  473. package/v3/@claude-flow/cli/dist/src/plugins/tests/demo-plugin-store.js +126 -0
  474. package/v3/@claude-flow/cli/dist/src/plugins/tests/demo-plugin-store.js.map +1 -0
  475. package/v3/@claude-flow/cli/dist/src/plugins/tests/standalone-test.d.ts +12 -0
  476. package/v3/@claude-flow/cli/dist/src/plugins/tests/standalone-test.d.ts.map +1 -0
  477. package/v3/@claude-flow/cli/dist/src/plugins/tests/standalone-test.js +188 -0
  478. package/v3/@claude-flow/cli/dist/src/plugins/tests/standalone-test.js.map +1 -0
  479. package/v3/@claude-flow/cli/dist/src/plugins/tests/test-plugin-store.d.ts +7 -0
  480. package/v3/@claude-flow/cli/dist/src/plugins/tests/test-plugin-store.d.ts.map +1 -0
  481. package/v3/@claude-flow/cli/dist/src/plugins/tests/test-plugin-store.js +206 -0
  482. package/v3/@claude-flow/cli/dist/src/plugins/tests/test-plugin-store.js.map +1 -0
  483. package/v3/@claude-flow/cli/dist/src/process-supervisor.d.ts +41 -0
  484. package/v3/@claude-flow/cli/dist/src/process-supervisor.d.ts.map +1 -0
  485. package/v3/@claude-flow/cli/dist/src/process-supervisor.js +214 -0
  486. package/v3/@claude-flow/cli/dist/src/process-supervisor.js.map +1 -0
  487. package/v3/@claude-flow/cli/dist/src/production/circuit-breaker.d.ts +101 -0
  488. package/v3/@claude-flow/cli/dist/src/production/circuit-breaker.d.ts.map +1 -0
  489. package/v3/@claude-flow/cli/dist/src/production/circuit-breaker.js +241 -0
  490. package/v3/@claude-flow/cli/dist/src/production/circuit-breaker.js.map +1 -0
  491. package/v3/@claude-flow/cli/dist/src/production/error-handler.d.ts +92 -0
  492. package/v3/@claude-flow/cli/dist/src/production/error-handler.d.ts.map +1 -0
  493. package/v3/@claude-flow/cli/dist/src/production/error-handler.js +299 -0
  494. package/v3/@claude-flow/cli/dist/src/production/error-handler.js.map +1 -0
  495. package/v3/@claude-flow/cli/dist/src/production/index.d.ts +23 -0
  496. package/v3/@claude-flow/cli/dist/src/production/index.d.ts.map +1 -0
  497. package/v3/@claude-flow/cli/dist/src/production/index.js +18 -0
  498. package/v3/@claude-flow/cli/dist/src/production/index.js.map +1 -0
  499. package/v3/@claude-flow/cli/dist/src/production/monitoring.d.ts +161 -0
  500. package/v3/@claude-flow/cli/dist/src/production/monitoring.d.ts.map +1 -0
  501. package/v3/@claude-flow/cli/dist/src/production/monitoring.js +356 -0
  502. package/v3/@claude-flow/cli/dist/src/production/monitoring.js.map +1 -0
  503. package/v3/@claude-flow/cli/dist/src/production/rate-limiter.d.ts +80 -0
  504. package/v3/@claude-flow/cli/dist/src/production/rate-limiter.d.ts.map +1 -0
  505. package/v3/@claude-flow/cli/dist/src/production/rate-limiter.js +201 -0
  506. package/v3/@claude-flow/cli/dist/src/production/rate-limiter.js.map +1 -0
  507. package/v3/@claude-flow/cli/dist/src/production/retry.d.ts +48 -0
  508. package/v3/@claude-flow/cli/dist/src/production/retry.d.ts.map +1 -0
  509. package/v3/@claude-flow/cli/dist/src/production/retry.js +179 -0
  510. package/v3/@claude-flow/cli/dist/src/production/retry.js.map +1 -0
  511. package/v3/@claude-flow/cli/dist/src/prompt.d.ts +44 -0
  512. package/v3/@claude-flow/cli/dist/src/prompt.d.ts.map +1 -0
  513. package/v3/@claude-flow/cli/dist/src/prompt.js +501 -0
  514. package/v3/@claude-flow/cli/dist/src/prompt.js.map +1 -0
  515. package/v3/@claude-flow/cli/dist/src/runtime/headless.d.ts +60 -0
  516. package/v3/@claude-flow/cli/dist/src/runtime/headless.d.ts.map +1 -0
  517. package/v3/@claude-flow/cli/dist/src/runtime/headless.js +284 -0
  518. package/v3/@claude-flow/cli/dist/src/runtime/headless.js.map +1 -0
  519. package/v3/@claude-flow/cli/dist/src/ruvector/agent-wasm.d.ts +182 -0
  520. package/v3/@claude-flow/cli/dist/src/ruvector/agent-wasm.d.ts.map +1 -0
  521. package/v3/@claude-flow/cli/dist/src/ruvector/agent-wasm.js +316 -0
  522. package/v3/@claude-flow/cli/dist/src/ruvector/agent-wasm.js.map +1 -0
  523. package/v3/@claude-flow/cli/dist/src/ruvector/ast-analyzer.d.ts +67 -0
  524. package/v3/@claude-flow/cli/dist/src/ruvector/ast-analyzer.d.ts.map +1 -0
  525. package/v3/@claude-flow/cli/dist/src/ruvector/ast-analyzer.js +277 -0
  526. package/v3/@claude-flow/cli/dist/src/ruvector/ast-analyzer.js.map +1 -0
  527. package/v3/@claude-flow/cli/dist/src/ruvector/coverage-router.d.ts +160 -0
  528. package/v3/@claude-flow/cli/dist/src/ruvector/coverage-router.d.ts.map +1 -0
  529. package/v3/@claude-flow/cli/dist/src/ruvector/coverage-router.js +529 -0
  530. package/v3/@claude-flow/cli/dist/src/ruvector/coverage-router.js.map +1 -0
  531. package/v3/@claude-flow/cli/dist/src/ruvector/coverage-tools.d.ts +33 -0
  532. package/v3/@claude-flow/cli/dist/src/ruvector/coverage-tools.d.ts.map +1 -0
  533. package/v3/@claude-flow/cli/dist/src/ruvector/coverage-tools.js +157 -0
  534. package/v3/@claude-flow/cli/dist/src/ruvector/coverage-tools.js.map +1 -0
  535. package/v3/@claude-flow/cli/dist/src/ruvector/diff-classifier.d.ts +175 -0
  536. package/v3/@claude-flow/cli/dist/src/ruvector/diff-classifier.d.ts.map +1 -0
  537. package/v3/@claude-flow/cli/dist/src/ruvector/diff-classifier.js +698 -0
  538. package/v3/@claude-flow/cli/dist/src/ruvector/diff-classifier.js.map +1 -0
  539. package/v3/@claude-flow/cli/dist/src/ruvector/enhanced-model-router.d.ts +146 -0
  540. package/v3/@claude-flow/cli/dist/src/ruvector/enhanced-model-router.d.ts.map +1 -0
  541. package/v3/@claude-flow/cli/dist/src/ruvector/enhanced-model-router.js +529 -0
  542. package/v3/@claude-flow/cli/dist/src/ruvector/enhanced-model-router.js.map +1 -0
  543. package/v3/@claude-flow/cli/dist/src/ruvector/flash-attention.d.ts +195 -0
  544. package/v3/@claude-flow/cli/dist/src/ruvector/flash-attention.d.ts.map +1 -0
  545. package/v3/@claude-flow/cli/dist/src/ruvector/flash-attention.js +643 -0
  546. package/v3/@claude-flow/cli/dist/src/ruvector/flash-attention.js.map +1 -0
  547. package/v3/@claude-flow/cli/dist/src/ruvector/graph-analyzer.d.ts +187 -0
  548. package/v3/@claude-flow/cli/dist/src/ruvector/graph-analyzer.d.ts.map +1 -0
  549. package/v3/@claude-flow/cli/dist/src/ruvector/graph-analyzer.js +929 -0
  550. package/v3/@claude-flow/cli/dist/src/ruvector/graph-analyzer.js.map +1 -0
  551. package/v3/@claude-flow/cli/dist/src/ruvector/index.d.ts +40 -0
  552. package/v3/@claude-flow/cli/dist/src/ruvector/index.d.ts.map +1 -0
  553. package/v3/@claude-flow/cli/dist/src/ruvector/index.js +76 -0
  554. package/v3/@claude-flow/cli/dist/src/ruvector/index.js.map +1 -0
  555. package/v3/@claude-flow/cli/dist/src/ruvector/lora-adapter.d.ts +218 -0
  556. package/v3/@claude-flow/cli/dist/src/ruvector/lora-adapter.d.ts.map +1 -0
  557. package/v3/@claude-flow/cli/dist/src/ruvector/lora-adapter.js +455 -0
  558. package/v3/@claude-flow/cli/dist/src/ruvector/lora-adapter.js.map +1 -0
  559. package/v3/@claude-flow/cli/dist/src/ruvector/model-router.d.ts +220 -0
  560. package/v3/@claude-flow/cli/dist/src/ruvector/model-router.d.ts.map +1 -0
  561. package/v3/@claude-flow/cli/dist/src/ruvector/model-router.js +488 -0
  562. package/v3/@claude-flow/cli/dist/src/ruvector/model-router.js.map +1 -0
  563. package/v3/@claude-flow/cli/dist/src/ruvector/moe-router.d.ts +206 -0
  564. package/v3/@claude-flow/cli/dist/src/ruvector/moe-router.d.ts.map +1 -0
  565. package/v3/@claude-flow/cli/dist/src/ruvector/moe-router.js +626 -0
  566. package/v3/@claude-flow/cli/dist/src/ruvector/moe-router.js.map +1 -0
  567. package/v3/@claude-flow/cli/dist/src/ruvector/q-learning-router.d.ts +211 -0
  568. package/v3/@claude-flow/cli/dist/src/ruvector/q-learning-router.d.ts.map +1 -0
  569. package/v3/@claude-flow/cli/dist/src/ruvector/q-learning-router.js +681 -0
  570. package/v3/@claude-flow/cli/dist/src/ruvector/q-learning-router.js.map +1 -0
  571. package/v3/@claude-flow/cli/dist/src/ruvector/ruvllm-wasm.d.ts +179 -0
  572. package/v3/@claude-flow/cli/dist/src/ruvector/ruvllm-wasm.d.ts.map +1 -0
  573. package/v3/@claude-flow/cli/dist/src/ruvector/ruvllm-wasm.js +363 -0
  574. package/v3/@claude-flow/cli/dist/src/ruvector/ruvllm-wasm.js.map +1 -0
  575. package/v3/@claude-flow/cli/dist/src/ruvector/semantic-router.d.ts +77 -0
  576. package/v3/@claude-flow/cli/dist/src/ruvector/semantic-router.d.ts.map +1 -0
  577. package/v3/@claude-flow/cli/dist/src/ruvector/semantic-router.js +178 -0
  578. package/v3/@claude-flow/cli/dist/src/ruvector/semantic-router.js.map +1 -0
  579. package/v3/@claude-flow/cli/dist/src/ruvector/vector-db.d.ts +69 -0
  580. package/v3/@claude-flow/cli/dist/src/ruvector/vector-db.d.ts.map +1 -0
  581. package/v3/@claude-flow/cli/dist/src/ruvector/vector-db.js +243 -0
  582. package/v3/@claude-flow/cli/dist/src/ruvector/vector-db.js.map +1 -0
  583. package/v3/@claude-flow/cli/dist/src/services/agentic-flow-bridge.d.ts +54 -0
  584. package/v3/@claude-flow/cli/dist/src/services/agentic-flow-bridge.d.ts.map +1 -0
  585. package/v3/@claude-flow/cli/dist/src/services/agentic-flow-bridge.js +100 -0
  586. package/v3/@claude-flow/cli/dist/src/services/agentic-flow-bridge.js.map +1 -0
  587. package/v3/@claude-flow/cli/dist/src/services/claim-service.d.ts +204 -0
  588. package/v3/@claude-flow/cli/dist/src/services/claim-service.d.ts.map +1 -0
  589. package/v3/@claude-flow/cli/dist/src/services/claim-service.js +818 -0
  590. package/v3/@claude-flow/cli/dist/src/services/claim-service.js.map +1 -0
  591. package/v3/@claude-flow/cli/dist/src/services/container-worker-pool.d.ts +197 -0
  592. package/v3/@claude-flow/cli/dist/src/services/container-worker-pool.d.ts.map +1 -0
  593. package/v3/@claude-flow/cli/dist/src/services/container-worker-pool.js +583 -0
  594. package/v3/@claude-flow/cli/dist/src/services/container-worker-pool.js.map +1 -0
  595. package/v3/@claude-flow/cli/dist/src/services/headless-worker-executor.d.ts +304 -0
  596. package/v3/@claude-flow/cli/dist/src/services/headless-worker-executor.d.ts.map +1 -0
  597. package/v3/@claude-flow/cli/dist/src/services/headless-worker-executor.js +1011 -0
  598. package/v3/@claude-flow/cli/dist/src/services/headless-worker-executor.js.map +1 -0
  599. package/v3/@claude-flow/cli/dist/src/services/index.d.ts +13 -0
  600. package/v3/@claude-flow/cli/dist/src/services/index.d.ts.map +1 -0
  601. package/v3/@claude-flow/cli/dist/src/services/index.js +11 -0
  602. package/v3/@claude-flow/cli/dist/src/services/index.js.map +1 -0
  603. package/v3/@claude-flow/cli/dist/src/services/registry-api.d.ts +58 -0
  604. package/v3/@claude-flow/cli/dist/src/services/registry-api.d.ts.map +1 -0
  605. package/v3/@claude-flow/cli/dist/src/services/registry-api.js +146 -0
  606. package/v3/@claude-flow/cli/dist/src/services/registry-api.js.map +1 -0
  607. package/v3/@claude-flow/cli/dist/src/services/ruvector-training.d.ts +222 -0
  608. package/v3/@claude-flow/cli/dist/src/services/ruvector-training.d.ts.map +1 -0
  609. package/v3/@claude-flow/cli/dist/src/services/ruvector-training.js +688 -0
  610. package/v3/@claude-flow/cli/dist/src/services/ruvector-training.js.map +1 -0
  611. package/v3/@claude-flow/cli/dist/src/services/worker-daemon.d.ts +237 -0
  612. package/v3/@claude-flow/cli/dist/src/services/worker-daemon.d.ts.map +1 -0
  613. package/v3/@claude-flow/cli/dist/src/services/worker-daemon.js +959 -0
  614. package/v3/@claude-flow/cli/dist/src/services/worker-daemon.js.map +1 -0
  615. package/v3/@claude-flow/cli/dist/src/services/worker-queue.d.ts +194 -0
  616. package/v3/@claude-flow/cli/dist/src/services/worker-queue.d.ts.map +1 -0
  617. package/v3/@claude-flow/cli/dist/src/services/worker-queue.js +513 -0
  618. package/v3/@claude-flow/cli/dist/src/services/worker-queue.js.map +1 -0
  619. package/v3/@claude-flow/cli/dist/src/suggest.d.ts +53 -0
  620. package/v3/@claude-flow/cli/dist/src/suggest.d.ts.map +1 -0
  621. package/v3/@claude-flow/cli/dist/src/suggest.js +200 -0
  622. package/v3/@claude-flow/cli/dist/src/suggest.js.map +1 -0
  623. package/v3/@claude-flow/cli/dist/src/transfer/anonymization/index.d.ts +25 -0
  624. package/v3/@claude-flow/cli/dist/src/transfer/anonymization/index.d.ts.map +1 -0
  625. package/v3/@claude-flow/cli/dist/src/transfer/anonymization/index.js +175 -0
  626. package/v3/@claude-flow/cli/dist/src/transfer/anonymization/index.js.map +1 -0
  627. package/v3/@claude-flow/cli/dist/src/transfer/deploy-seraphine.d.ts +13 -0
  628. package/v3/@claude-flow/cli/dist/src/transfer/deploy-seraphine.d.ts.map +1 -0
  629. package/v3/@claude-flow/cli/dist/src/transfer/deploy-seraphine.js +205 -0
  630. package/v3/@claude-flow/cli/dist/src/transfer/deploy-seraphine.js.map +1 -0
  631. package/v3/@claude-flow/cli/dist/src/transfer/export.d.ts +25 -0
  632. package/v3/@claude-flow/cli/dist/src/transfer/export.d.ts.map +1 -0
  633. package/v3/@claude-flow/cli/dist/src/transfer/export.js +113 -0
  634. package/v3/@claude-flow/cli/dist/src/transfer/export.js.map +1 -0
  635. package/v3/@claude-flow/cli/dist/src/transfer/index.d.ts +12 -0
  636. package/v3/@claude-flow/cli/dist/src/transfer/index.d.ts.map +1 -0
  637. package/v3/@claude-flow/cli/dist/src/transfer/index.js +31 -0
  638. package/v3/@claude-flow/cli/dist/src/transfer/index.js.map +1 -0
  639. package/v3/@claude-flow/cli/dist/src/transfer/ipfs/client.d.ts +109 -0
  640. package/v3/@claude-flow/cli/dist/src/transfer/ipfs/client.d.ts.map +1 -0
  641. package/v3/@claude-flow/cli/dist/src/transfer/ipfs/client.js +307 -0
  642. package/v3/@claude-flow/cli/dist/src/transfer/ipfs/client.js.map +1 -0
  643. package/v3/@claude-flow/cli/dist/src/transfer/ipfs/upload.d.ts +95 -0
  644. package/v3/@claude-flow/cli/dist/src/transfer/ipfs/upload.d.ts.map +1 -0
  645. package/v3/@claude-flow/cli/dist/src/transfer/ipfs/upload.js +411 -0
  646. package/v3/@claude-flow/cli/dist/src/transfer/ipfs/upload.js.map +1 -0
  647. package/v3/@claude-flow/cli/dist/src/transfer/models/seraphine.d.ts +72 -0
  648. package/v3/@claude-flow/cli/dist/src/transfer/models/seraphine.d.ts.map +1 -0
  649. package/v3/@claude-flow/cli/dist/src/transfer/models/seraphine.js +373 -0
  650. package/v3/@claude-flow/cli/dist/src/transfer/models/seraphine.js.map +1 -0
  651. package/v3/@claude-flow/cli/dist/src/transfer/serialization/cfp.d.ts +49 -0
  652. package/v3/@claude-flow/cli/dist/src/transfer/serialization/cfp.d.ts.map +1 -0
  653. package/v3/@claude-flow/cli/dist/src/transfer/serialization/cfp.js +183 -0
  654. package/v3/@claude-flow/cli/dist/src/transfer/serialization/cfp.js.map +1 -0
  655. package/v3/@claude-flow/cli/dist/src/transfer/storage/gcs.d.ts +82 -0
  656. package/v3/@claude-flow/cli/dist/src/transfer/storage/gcs.d.ts.map +1 -0
  657. package/v3/@claude-flow/cli/dist/src/transfer/storage/gcs.js +272 -0
  658. package/v3/@claude-flow/cli/dist/src/transfer/storage/gcs.js.map +1 -0
  659. package/v3/@claude-flow/cli/dist/src/transfer/storage/index.d.ts +6 -0
  660. package/v3/@claude-flow/cli/dist/src/transfer/storage/index.d.ts.map +1 -0
  661. package/v3/@claude-flow/cli/dist/src/transfer/storage/index.js +6 -0
  662. package/v3/@claude-flow/cli/dist/src/transfer/storage/index.js.map +1 -0
  663. package/v3/@claude-flow/cli/dist/src/transfer/store/discovery.d.ts +84 -0
  664. package/v3/@claude-flow/cli/dist/src/transfer/store/discovery.d.ts.map +1 -0
  665. package/v3/@claude-flow/cli/dist/src/transfer/store/discovery.js +382 -0
  666. package/v3/@claude-flow/cli/dist/src/transfer/store/discovery.js.map +1 -0
  667. package/v3/@claude-flow/cli/dist/src/transfer/store/download.d.ts +70 -0
  668. package/v3/@claude-flow/cli/dist/src/transfer/store/download.d.ts.map +1 -0
  669. package/v3/@claude-flow/cli/dist/src/transfer/store/download.js +334 -0
  670. package/v3/@claude-flow/cli/dist/src/transfer/store/download.js.map +1 -0
  671. package/v3/@claude-flow/cli/dist/src/transfer/store/index.d.ts +84 -0
  672. package/v3/@claude-flow/cli/dist/src/transfer/store/index.d.ts.map +1 -0
  673. package/v3/@claude-flow/cli/dist/src/transfer/store/index.js +153 -0
  674. package/v3/@claude-flow/cli/dist/src/transfer/store/index.js.map +1 -0
  675. package/v3/@claude-flow/cli/dist/src/transfer/store/publish.d.ts +76 -0
  676. package/v3/@claude-flow/cli/dist/src/transfer/store/publish.d.ts.map +1 -0
  677. package/v3/@claude-flow/cli/dist/src/transfer/store/publish.js +294 -0
  678. package/v3/@claude-flow/cli/dist/src/transfer/store/publish.js.map +1 -0
  679. package/v3/@claude-flow/cli/dist/src/transfer/store/registry.d.ts +58 -0
  680. package/v3/@claude-flow/cli/dist/src/transfer/store/registry.d.ts.map +1 -0
  681. package/v3/@claude-flow/cli/dist/src/transfer/store/registry.js +285 -0
  682. package/v3/@claude-flow/cli/dist/src/transfer/store/registry.js.map +1 -0
  683. package/v3/@claude-flow/cli/dist/src/transfer/store/search.d.ts +54 -0
  684. package/v3/@claude-flow/cli/dist/src/transfer/store/search.d.ts.map +1 -0
  685. package/v3/@claude-flow/cli/dist/src/transfer/store/search.js +232 -0
  686. package/v3/@claude-flow/cli/dist/src/transfer/store/search.js.map +1 -0
  687. package/v3/@claude-flow/cli/dist/src/transfer/store/tests/standalone-test.d.ts +12 -0
  688. package/v3/@claude-flow/cli/dist/src/transfer/store/tests/standalone-test.d.ts.map +1 -0
  689. package/v3/@claude-flow/cli/dist/src/transfer/store/tests/standalone-test.js +190 -0
  690. package/v3/@claude-flow/cli/dist/src/transfer/store/tests/standalone-test.js.map +1 -0
  691. package/v3/@claude-flow/cli/dist/src/transfer/store/types.d.ts +193 -0
  692. package/v3/@claude-flow/cli/dist/src/transfer/store/types.d.ts.map +1 -0
  693. package/v3/@claude-flow/cli/dist/src/transfer/store/types.js +6 -0
  694. package/v3/@claude-flow/cli/dist/src/transfer/store/types.js.map +1 -0
  695. package/v3/@claude-flow/cli/dist/src/transfer/test-seraphine.d.ts +6 -0
  696. package/v3/@claude-flow/cli/dist/src/transfer/test-seraphine.d.ts.map +1 -0
  697. package/v3/@claude-flow/cli/dist/src/transfer/test-seraphine.js +105 -0
  698. package/v3/@claude-flow/cli/dist/src/transfer/test-seraphine.js.map +1 -0
  699. package/v3/@claude-flow/cli/dist/src/transfer/tests/test-store.d.ts +7 -0
  700. package/v3/@claude-flow/cli/dist/src/transfer/tests/test-store.d.ts.map +1 -0
  701. package/v3/@claude-flow/cli/dist/src/transfer/tests/test-store.js +214 -0
  702. package/v3/@claude-flow/cli/dist/src/transfer/tests/test-store.js.map +1 -0
  703. package/v3/@claude-flow/cli/dist/src/transfer/types.d.ts +245 -0
  704. package/v3/@claude-flow/cli/dist/src/transfer/types.d.ts.map +1 -0
  705. package/v3/@claude-flow/cli/dist/src/transfer/types.js +6 -0
  706. package/v3/@claude-flow/cli/dist/src/transfer/types.js.map +1 -0
  707. package/v3/@claude-flow/cli/dist/src/types.d.ts +198 -0
  708. package/v3/@claude-flow/cli/dist/src/types.d.ts.map +1 -0
  709. package/v3/@claude-flow/cli/dist/src/types.js +38 -0
  710. package/v3/@claude-flow/cli/dist/src/types.js.map +1 -0
  711. package/v3/@claude-flow/cli/dist/src/update/checker.d.ts +34 -0
  712. package/v3/@claude-flow/cli/dist/src/update/checker.d.ts.map +1 -0
  713. package/v3/@claude-flow/cli/dist/src/update/checker.js +190 -0
  714. package/v3/@claude-flow/cli/dist/src/update/checker.js.map +1 -0
  715. package/v3/@claude-flow/cli/dist/src/update/executor.d.ts +32 -0
  716. package/v3/@claude-flow/cli/dist/src/update/executor.d.ts.map +1 -0
  717. package/v3/@claude-flow/cli/dist/src/update/executor.js +181 -0
  718. package/v3/@claude-flow/cli/dist/src/update/executor.js.map +1 -0
  719. package/v3/@claude-flow/cli/dist/src/update/index.d.ts +33 -0
  720. package/v3/@claude-flow/cli/dist/src/update/index.d.ts.map +1 -0
  721. package/v3/@claude-flow/cli/dist/src/update/index.js +64 -0
  722. package/v3/@claude-flow/cli/dist/src/update/index.js.map +1 -0
  723. package/v3/@claude-flow/cli/dist/src/update/rate-limiter.d.ts +20 -0
  724. package/v3/@claude-flow/cli/dist/src/update/rate-limiter.d.ts.map +1 -0
  725. package/v3/@claude-flow/cli/dist/src/update/rate-limiter.js +96 -0
  726. package/v3/@claude-flow/cli/dist/src/update/rate-limiter.js.map +1 -0
  727. package/v3/@claude-flow/cli/dist/src/update/validator.d.ts +17 -0
  728. package/v3/@claude-flow/cli/dist/src/update/validator.d.ts.map +1 -0
  729. package/v3/@claude-flow/cli/dist/src/update/validator.js +123 -0
  730. package/v3/@claude-flow/cli/dist/src/update/validator.js.map +1 -0
  731. package/v3/@claude-flow/cli/dist/tsconfig.tsbuildinfo +1 -0
  732. package/v3/@claude-flow/cli/package.json +109 -0
@@ -0,0 +1,1011 @@
1
+ /**
2
+ * Headless Worker Executor
3
+ * Enables workers to invoke Claude Code in headless mode with configurable sandbox profiles.
4
+ *
5
+ * ADR-020: Headless Worker Integration Architecture
6
+ * - Integrates with CLAUDE_CODE_HEADLESS and CLAUDE_CODE_SANDBOX_MODE environment variables
7
+ * - Provides process pool for concurrent execution
8
+ * - Builds context from file glob patterns
9
+ * - Supports prompt templates and output parsing
10
+ * - Implements timeout and graceful error handling
11
+ *
12
+ * Key Features:
13
+ * - Process pool with configurable maxConcurrent
14
+ * - Context building from file glob patterns with caching
15
+ * - Prompt template system with context injection
16
+ * - Output parsing (text, json, markdown)
17
+ * - Timeout handling with graceful termination
18
+ * - Execution logging for debugging
19
+ * - Event emission for monitoring
20
+ */
21
+ import { spawn, execSync } from 'child_process';
22
+ import { EventEmitter } from 'events';
23
+ import { existsSync, readFileSync, readdirSync, mkdirSync, writeFileSync } from 'fs';
24
+ import { join } from 'path';
25
+ // ============================================
26
+ // Constants
27
+ // ============================================
28
+ /**
29
+ * Array of headless worker types for runtime checking
30
+ */
31
+ export const HEADLESS_WORKER_TYPES = [
32
+ 'audit',
33
+ 'optimize',
34
+ 'testgaps',
35
+ 'document',
36
+ 'ultralearn',
37
+ 'refactor',
38
+ 'deepdive',
39
+ 'predict',
40
+ ];
41
+ /**
42
+ * Array of local worker types
43
+ */
44
+ export const LOCAL_WORKER_TYPES = [
45
+ 'map',
46
+ 'consolidate',
47
+ 'benchmark',
48
+ 'preload',
49
+ ];
50
+ /**
51
+ * Model ID mapping
52
+ */
53
+ const MODEL_IDS = {
54
+ sonnet: 'claude-sonnet-4-5-20250929',
55
+ opus: 'claude-opus-4-6',
56
+ haiku: 'claude-haiku-4-5-20251001',
57
+ };
58
+ /**
59
+ * Default headless worker configurations based on ADR-020
60
+ */
61
+ export const HEADLESS_WORKER_CONFIGS = {
62
+ audit: {
63
+ type: 'audit',
64
+ mode: 'headless',
65
+ intervalMs: 30 * 60 * 1000,
66
+ priority: 'critical',
67
+ description: 'AI-powered security analysis',
68
+ enabled: true,
69
+ headless: {
70
+ promptTemplate: `Perform a security audit of this codebase. Check for:
71
+ - Hardcoded secrets (API keys, passwords, tokens, connection strings in source files)
72
+ - SQL injection vulnerabilities (unsanitized user input in queries)
73
+ - XSS vulnerabilities (unescaped output rendered in HTML/templates)
74
+ - Path traversal risks (user-controlled file paths without validation)
75
+ - Command injection (unsanitized input passed to shell/exec calls)
76
+ - Insecure dependencies (known CVEs in package.json dependencies)
77
+ - Authentication/authorization issues (missing auth checks, weak token handling)
78
+
79
+ Report findings with severity levels. Provide a JSON report with:
80
+ {
81
+ "vulnerabilities": [{ "severity": "critical|high|medium|low", "type": "secret|sqli|xss|path-traversal|command-injection|dependency|auth", "file": "...", "line": N, "description": "...", "recommendation": "..." }],
82
+ "riskScore": 0-100,
83
+ "summary": { "critical": N, "high": N, "medium": N, "low": N },
84
+ "recommendations": ["..."]
85
+ }`,
86
+ sandbox: 'strict',
87
+ model: 'haiku',
88
+ outputFormat: 'json',
89
+ contextPatterns: ['**/*.ts', '**/*.js', '**/.env*', '**/package.json'],
90
+ timeoutMs: 5 * 60 * 1000,
91
+ },
92
+ },
93
+ optimize: {
94
+ type: 'optimize',
95
+ mode: 'headless',
96
+ intervalMs: 60 * 60 * 1000,
97
+ priority: 'high',
98
+ description: 'AI optimization suggestions',
99
+ enabled: true,
100
+ headless: {
101
+ promptTemplate: `Analyze this codebase for performance bottlenecks. Check for:
102
+ - N+1 query patterns (repeated DB/API calls inside loops)
103
+ - Unnecessary re-renders (missing memoization, unstable references in React components)
104
+ - Large bundle sizes (heavy imports that could be lazy-loaded or tree-shaken)
105
+ - Unoptimized loops (O(n^2) patterns, redundant iterations, missing early exits)
106
+ - Memory leaks (unclosed streams, unremoved event listeners, growing caches without eviction)
107
+ - Missing caching opportunities (repeated expensive computations, redundant file reads)
108
+ - Synchronous blocking operations (sync I/O in hot paths, missing async/await)
109
+
110
+ For each finding, suggest a specific improvement with before/after code examples where applicable.
111
+ Prioritize findings by estimated performance impact (high/medium/low).`,
112
+ sandbox: 'permissive',
113
+ model: 'sonnet',
114
+ outputFormat: 'markdown',
115
+ contextPatterns: ['src/**/*.ts', 'src/**/*.tsx'],
116
+ timeoutMs: 10 * 60 * 1000,
117
+ },
118
+ },
119
+ testgaps: {
120
+ type: 'testgaps',
121
+ mode: 'headless',
122
+ intervalMs: 60 * 60 * 1000,
123
+ priority: 'normal',
124
+ description: 'AI test gap analysis',
125
+ enabled: true,
126
+ headless: {
127
+ promptTemplate: `Analyze test coverage gaps in this codebase. Identify:
128
+ - Untested exported functions and public class methods (compare src/ exports against test files)
129
+ - Missing edge cases (null/undefined inputs, empty collections, boundary values, error paths)
130
+ - Areas with low coverage (files with no corresponding test file, complex branches without tests)
131
+ - Missing error handling tests (try/catch blocks, rejected promises, error event handlers)
132
+ - Integration test gaps (API endpoint combinations, multi-service workflows, database transactions)
133
+ - Missing regression tests for known bug patterns
134
+
135
+ Prioritize gaps by risk (how likely a bug here would cause production issues) and complexity (how hard the code is to reason about). For each gap, provide a test skeleton with describe/it blocks and key assertions.`,
136
+ sandbox: 'permissive',
137
+ model: 'sonnet',
138
+ outputFormat: 'markdown',
139
+ contextPatterns: ['src/**/*.ts', 'tests/**/*.ts', '__tests__/**/*.ts'],
140
+ timeoutMs: 10 * 60 * 1000,
141
+ },
142
+ },
143
+ document: {
144
+ type: 'document',
145
+ mode: 'headless',
146
+ intervalMs: 120 * 60 * 1000,
147
+ priority: 'low',
148
+ description: 'AI documentation generation',
149
+ enabled: false,
150
+ headless: {
151
+ promptTemplate: `Review code for documentation gaps. Identify and generate documentation for:
152
+ - Public APIs and exported functions missing JSDoc comments (include @param, @returns, @throws, @example)
153
+ - Exported classes and interfaces without description comments
154
+ - Complex logic blocks (algorithms, state machines, recursive functions) that lack inline explanations
155
+ - Module-level documentation (purpose, usage patterns, dependencies)
156
+ - Type definitions that would benefit from property descriptions
157
+
158
+ For each gap found, generate a complete JSDoc stub ready to be inserted. Focus on public-facing code first, then internal utilities. Include usage examples for non-obvious APIs.`,
159
+ sandbox: 'permissive',
160
+ model: 'haiku',
161
+ outputFormat: 'markdown',
162
+ contextPatterns: ['src/**/*.ts'],
163
+ timeoutMs: 10 * 60 * 1000,
164
+ },
165
+ },
166
+ ultralearn: {
167
+ type: 'ultralearn',
168
+ mode: 'headless',
169
+ intervalMs: 0, // Manual trigger only
170
+ priority: 'normal',
171
+ description: 'Deep knowledge acquisition',
172
+ enabled: false,
173
+ headless: {
174
+ promptTemplate: `Deeply analyze this codebase to learn:
175
+ - Architectural patterns used
176
+ - Coding conventions
177
+ - Domain-specific terminology
178
+ - Common patterns and idioms
179
+ - Team preferences
180
+
181
+ Provide insights as JSON:
182
+ {
183
+ "architecture": { "patterns": [...], "style": "..." },
184
+ "conventions": { "naming": "...", "formatting": "..." },
185
+ "domains": ["..."],
186
+ "insights": ["..."]
187
+ }`,
188
+ sandbox: 'strict',
189
+ model: 'opus',
190
+ outputFormat: 'json',
191
+ contextPatterns: ['**/*.ts', '**/CLAUDE.md', '**/README.md'],
192
+ timeoutMs: 15 * 60 * 1000,
193
+ },
194
+ },
195
+ refactor: {
196
+ type: 'refactor',
197
+ mode: 'headless',
198
+ intervalMs: 0, // Manual trigger only
199
+ priority: 'normal',
200
+ description: 'AI refactoring suggestions',
201
+ enabled: false,
202
+ headless: {
203
+ promptTemplate: `Identify refactoring opportunities in this codebase. Look for:
204
+ - Code duplication (similar logic repeated across files or functions that should be extracted)
205
+ - Long methods (functions exceeding 30-40 lines that should be decomposed)
206
+ - Complex conditionals (deeply nested if/else, switch statements that could use polymorphism or lookup tables)
207
+ - Unclear naming (variables, functions, or classes whose names do not convey their purpose)
208
+ - Dead code (unreachable branches, unused exports, commented-out blocks)
209
+ - God classes/modules (files doing too many things that should be split by responsibility)
210
+ - Missing abstractions (repeated patterns that could become shared utilities or base classes)
211
+
212
+ For each finding, suggest a specific refactoring with before/after code examples. Categorize by effort (quick-win vs. significant restructuring) and impact (readability, maintainability, testability).`,
213
+ sandbox: 'permissive',
214
+ model: 'sonnet',
215
+ outputFormat: 'markdown',
216
+ contextPatterns: ['src/**/*.ts'],
217
+ timeoutMs: 10 * 60 * 1000,
218
+ },
219
+ },
220
+ deepdive: {
221
+ type: 'deepdive',
222
+ mode: 'headless',
223
+ intervalMs: 0, // Manual trigger only
224
+ priority: 'normal',
225
+ description: 'Deep code analysis',
226
+ enabled: false,
227
+ headless: {
228
+ promptTemplate: `Perform deep analysis of this codebase:
229
+ - Understand data flow
230
+ - Map dependencies
231
+ - Identify architectural issues
232
+ - Find potential bugs
233
+ - Analyze error handling
234
+
235
+ Provide comprehensive report.`,
236
+ sandbox: 'strict',
237
+ model: 'opus',
238
+ outputFormat: 'markdown',
239
+ contextPatterns: ['src/**/*.ts'],
240
+ timeoutMs: 15 * 60 * 1000,
241
+ },
242
+ },
243
+ predict: {
244
+ type: 'predict',
245
+ mode: 'headless',
246
+ intervalMs: 10 * 60 * 1000,
247
+ priority: 'low',
248
+ description: 'Predictive preloading',
249
+ enabled: false,
250
+ headless: {
251
+ promptTemplate: `Analyze recent code changes and development activity to predict likely next tasks. Examine:
252
+ - Recently modified files and their dependencies (what files are commonly edited together)
253
+ - Patterns in development activity (feature branches, test additions after implementations, config changes after new modules)
254
+ - Incomplete work indicators (TODO/FIXME comments, partial implementations, failing tests)
255
+ - Dependency chains (if module A was updated, modules B and C likely need updates too)
256
+
257
+ Suggest preloading of relevant context for the developer. Provide predictions as JSON:
258
+ {
259
+ "predictedNextFiles": [{ "file": "...", "reason": "...", "confidence": 0.0-1.0 }],
260
+ "suggestedTasks": [{ "task": "...", "reason": "...", "priority": "high|medium|low" }],
261
+ "testsToRun": ["..."],
262
+ "docsToReference": ["..."],
263
+ "overallConfidence": 0.0-1.0
264
+ }`,
265
+ sandbox: 'strict',
266
+ model: 'haiku',
267
+ outputFormat: 'json',
268
+ contextPatterns: ['.claude-flow/metrics/*.json'],
269
+ timeoutMs: 2 * 60 * 1000,
270
+ },
271
+ },
272
+ };
273
+ /**
274
+ * Local worker configurations
275
+ */
276
+ export const LOCAL_WORKER_CONFIGS = {
277
+ map: {
278
+ type: 'map',
279
+ mode: 'local',
280
+ intervalMs: 15 * 60 * 1000,
281
+ priority: 'normal',
282
+ description: 'Codebase mapping',
283
+ enabled: true,
284
+ },
285
+ consolidate: {
286
+ type: 'consolidate',
287
+ mode: 'local',
288
+ intervalMs: 30 * 60 * 1000,
289
+ priority: 'low',
290
+ description: 'Memory consolidation',
291
+ enabled: true,
292
+ },
293
+ benchmark: {
294
+ type: 'benchmark',
295
+ mode: 'local',
296
+ intervalMs: 60 * 60 * 1000,
297
+ priority: 'low',
298
+ description: 'Performance benchmarking',
299
+ enabled: false,
300
+ },
301
+ preload: {
302
+ type: 'preload',
303
+ mode: 'local',
304
+ intervalMs: 5 * 60 * 1000,
305
+ priority: 'low',
306
+ description: 'Resource preloading',
307
+ enabled: false,
308
+ },
309
+ };
310
+ /**
311
+ * Combined worker configurations
312
+ */
313
+ export const ALL_WORKER_CONFIGS = [
314
+ ...Object.values(HEADLESS_WORKER_CONFIGS),
315
+ ...Object.values(LOCAL_WORKER_CONFIGS),
316
+ ];
317
+ // ============================================
318
+ // Utility Functions
319
+ // ============================================
320
+ /**
321
+ * Check if a worker type is a headless worker
322
+ */
323
+ export function isHeadlessWorker(type) {
324
+ return HEADLESS_WORKER_TYPES.includes(type);
325
+ }
326
+ /**
327
+ * Check if a worker type is a local worker
328
+ */
329
+ export function isLocalWorker(type) {
330
+ return LOCAL_WORKER_TYPES.includes(type);
331
+ }
332
+ /**
333
+ * Get model ID from model type
334
+ */
335
+ export function getModelId(model) {
336
+ return MODEL_IDS[model];
337
+ }
338
+ /**
339
+ * Get worker configuration by type
340
+ */
341
+ export function getWorkerConfig(type) {
342
+ if (isHeadlessWorker(type)) {
343
+ return HEADLESS_WORKER_CONFIGS[type];
344
+ }
345
+ if (isLocalWorker(type)) {
346
+ return LOCAL_WORKER_CONFIGS[type];
347
+ }
348
+ return undefined;
349
+ }
350
+ // ============================================
351
+ // HeadlessWorkerExecutor Class
352
+ // ============================================
353
+ /**
354
+ * HeadlessWorkerExecutor - Executes workers using Claude Code in headless mode
355
+ *
356
+ * Features:
357
+ * - Process pool with configurable concurrency limit
358
+ * - Pending queue for overflow requests
359
+ * - Context caching with configurable TTL
360
+ * - Execution logging for debugging
361
+ * - Event emission for monitoring
362
+ * - Graceful termination
363
+ */
364
+ export class HeadlessWorkerExecutor extends EventEmitter {
365
+ projectRoot;
366
+ config;
367
+ processPool = new Map();
368
+ pendingQueue = [];
369
+ contextCache = new Map();
370
+ claudeCodeAvailable = null;
371
+ claudeCodeVersion = null;
372
+ constructor(projectRoot, options) {
373
+ super();
374
+ this.projectRoot = projectRoot;
375
+ // Merge with defaults
376
+ this.config = {
377
+ maxConcurrent: options?.maxConcurrent ?? 2,
378
+ defaultTimeoutMs: options?.defaultTimeoutMs ?? 5 * 60 * 1000,
379
+ maxContextFiles: options?.maxContextFiles ?? 20,
380
+ maxCharsPerFile: options?.maxCharsPerFile ?? 5000,
381
+ logDir: options?.logDir ?? join(projectRoot, '.claude-flow', 'logs', 'headless'),
382
+ cacheContext: options?.cacheContext ?? true,
383
+ cacheTtlMs: options?.cacheTtlMs ?? 60000, // 1 minute default
384
+ };
385
+ // Ensure log directory exists
386
+ this.ensureLogDir();
387
+ }
388
+ // ============================================
389
+ // Public API
390
+ // ============================================
391
+ /**
392
+ * Check if Claude Code CLI is available
393
+ */
394
+ async isAvailable() {
395
+ if (this.claudeCodeAvailable !== null) {
396
+ return this.claudeCodeAvailable;
397
+ }
398
+ try {
399
+ const output = execSync('claude --version', {
400
+ encoding: 'utf-8',
401
+ stdio: 'pipe',
402
+ timeout: 5000,
403
+ windowsHide: true, // Prevent phantom console windows on Windows
404
+ });
405
+ this.claudeCodeAvailable = true;
406
+ this.claudeCodeVersion = output.trim();
407
+ this.emit('status', { available: true, version: this.claudeCodeVersion });
408
+ return true;
409
+ }
410
+ catch {
411
+ this.claudeCodeAvailable = false;
412
+ this.emit('status', { available: false });
413
+ return false;
414
+ }
415
+ }
416
+ /**
417
+ * Get Claude Code version
418
+ */
419
+ async getVersion() {
420
+ await this.isAvailable();
421
+ return this.claudeCodeVersion;
422
+ }
423
+ /**
424
+ * Execute a headless worker
425
+ */
426
+ async execute(workerType, configOverrides) {
427
+ const baseConfig = HEADLESS_WORKER_CONFIGS[workerType];
428
+ if (!baseConfig) {
429
+ throw new Error(`Unknown headless worker type: ${workerType}`);
430
+ }
431
+ // Check availability
432
+ const available = await this.isAvailable();
433
+ if (!available) {
434
+ const result = this.createErrorResult(workerType, 'Claude Code CLI not available. Install with: npm install -g @anthropic-ai/claude-code');
435
+ this.emit('error', result);
436
+ return result;
437
+ }
438
+ // Check concurrent limit
439
+ if (this.processPool.size >= this.config.maxConcurrent) {
440
+ // Queue the request
441
+ return new Promise((resolve, reject) => {
442
+ const entry = {
443
+ workerType,
444
+ config: configOverrides,
445
+ resolve,
446
+ reject,
447
+ queuedAt: new Date(),
448
+ };
449
+ this.pendingQueue.push(entry);
450
+ this.emit('queued', {
451
+ workerType,
452
+ queuePosition: this.pendingQueue.length,
453
+ });
454
+ });
455
+ }
456
+ // Execute immediately
457
+ return this.executeInternal(workerType, configOverrides);
458
+ }
459
+ /**
460
+ * Get pool status
461
+ */
462
+ getPoolStatus() {
463
+ const now = Date.now();
464
+ return {
465
+ activeCount: this.processPool.size,
466
+ queueLength: this.pendingQueue.length,
467
+ maxConcurrent: this.config.maxConcurrent,
468
+ activeWorkers: Array.from(this.processPool.values()).map((entry) => ({
469
+ executionId: entry.executionId,
470
+ workerType: entry.workerType,
471
+ startTime: entry.startTime,
472
+ elapsedMs: now - entry.startTime.getTime(),
473
+ })),
474
+ queuedWorkers: this.pendingQueue.map((entry) => ({
475
+ workerType: entry.workerType,
476
+ queuedAt: entry.queuedAt,
477
+ waitingMs: now - entry.queuedAt.getTime(),
478
+ })),
479
+ };
480
+ }
481
+ /**
482
+ * Get number of active executions
483
+ */
484
+ getActiveCount() {
485
+ return this.processPool.size;
486
+ }
487
+ /**
488
+ * Cancel a running execution
489
+ */
490
+ cancel(executionId) {
491
+ const entry = this.processPool.get(executionId);
492
+ if (!entry) {
493
+ return false;
494
+ }
495
+ clearTimeout(entry.timeout);
496
+ entry.process.kill('SIGTERM');
497
+ this.processPool.delete(executionId);
498
+ this.emit('cancelled', { executionId });
499
+ // Process next in queue
500
+ this.processQueue();
501
+ return true;
502
+ }
503
+ /**
504
+ * Cancel all running executions
505
+ */
506
+ cancelAll() {
507
+ let cancelled = 0;
508
+ // Cancel active processes (convert to array to avoid iterator issues)
509
+ const entries = Array.from(this.processPool.entries());
510
+ for (const [executionId, entry] of entries) {
511
+ clearTimeout(entry.timeout);
512
+ entry.process.kill('SIGTERM');
513
+ this.emit('cancelled', { executionId });
514
+ cancelled++;
515
+ }
516
+ this.processPool.clear();
517
+ // Reject pending queue
518
+ for (const entry of this.pendingQueue) {
519
+ entry.reject(new Error('Executor cancelled all executions'));
520
+ }
521
+ this.pendingQueue = [];
522
+ this.emit('allCancelled', { count: cancelled });
523
+ return cancelled;
524
+ }
525
+ /**
526
+ * Clear context cache
527
+ */
528
+ clearContextCache() {
529
+ this.contextCache.clear();
530
+ this.emit('cacheClear', {});
531
+ }
532
+ /**
533
+ * Get worker configuration
534
+ */
535
+ getConfig(workerType) {
536
+ return HEADLESS_WORKER_CONFIGS[workerType];
537
+ }
538
+ /**
539
+ * Get all headless worker types
540
+ */
541
+ getHeadlessWorkerTypes() {
542
+ return [...HEADLESS_WORKER_TYPES];
543
+ }
544
+ /**
545
+ * Get all local worker types
546
+ */
547
+ getLocalWorkerTypes() {
548
+ return [...LOCAL_WORKER_TYPES];
549
+ }
550
+ // ============================================
551
+ // Private Methods
552
+ // ============================================
553
+ /**
554
+ * Ensure log directory exists
555
+ */
556
+ ensureLogDir() {
557
+ try {
558
+ if (!existsSync(this.config.logDir)) {
559
+ mkdirSync(this.config.logDir, { recursive: true });
560
+ }
561
+ }
562
+ catch (error) {
563
+ this.emit('warning', { message: 'Failed to create log directory', error });
564
+ }
565
+ }
566
+ /**
567
+ * Internal execution logic
568
+ */
569
+ async executeInternal(workerType, configOverrides) {
570
+ const baseConfig = HEADLESS_WORKER_CONFIGS[workerType];
571
+ const headless = { ...baseConfig.headless, ...configOverrides };
572
+ const startTime = Date.now();
573
+ const executionId = `${workerType}_${startTime}_${Math.random().toString(36).slice(2, 8)}`;
574
+ this.emit('start', { executionId, workerType, config: headless });
575
+ try {
576
+ // Build context from file patterns
577
+ const context = await this.buildContext(headless.contextPatterns || []);
578
+ // Build the full prompt
579
+ const fullPrompt = this.buildPrompt(headless.promptTemplate, context);
580
+ // Log prompt for debugging
581
+ this.logExecution(executionId, 'prompt', fullPrompt);
582
+ // Execute Claude Code headlessly
583
+ const result = await this.executeClaudeCode(fullPrompt, {
584
+ sandbox: headless.sandbox,
585
+ model: headless.model || 'sonnet',
586
+ timeoutMs: headless.timeoutMs || this.config.defaultTimeoutMs,
587
+ executionId,
588
+ workerType,
589
+ });
590
+ // Parse output based on format
591
+ let parsedOutput;
592
+ if (headless.outputFormat === 'json' && result.output) {
593
+ parsedOutput = this.parseJsonOutput(result.output);
594
+ }
595
+ else if (headless.outputFormat === 'markdown' && result.output) {
596
+ parsedOutput = this.parseMarkdownOutput(result.output);
597
+ }
598
+ const executionResult = {
599
+ success: result.success,
600
+ output: result.output,
601
+ parsedOutput,
602
+ durationMs: Date.now() - startTime,
603
+ tokensUsed: result.tokensUsed,
604
+ model: headless.model || 'sonnet',
605
+ sandboxMode: headless.sandbox,
606
+ workerType,
607
+ timestamp: new Date(),
608
+ executionId,
609
+ error: result.error,
610
+ };
611
+ // Log result
612
+ this.logExecution(executionId, 'result', JSON.stringify(executionResult, null, 2));
613
+ this.emit('complete', executionResult);
614
+ return executionResult;
615
+ }
616
+ catch (error) {
617
+ const errorMessage = error instanceof Error ? error.message : String(error);
618
+ const executionResult = this.createErrorResult(workerType, errorMessage);
619
+ executionResult.executionId = executionId;
620
+ executionResult.durationMs = Date.now() - startTime;
621
+ this.logExecution(executionId, 'error', errorMessage);
622
+ this.emit('error', executionResult);
623
+ return executionResult;
624
+ }
625
+ finally {
626
+ // Process next in queue
627
+ this.processQueue();
628
+ }
629
+ }
630
+ /**
631
+ * Process the pending queue
632
+ */
633
+ processQueue() {
634
+ while (this.pendingQueue.length > 0 &&
635
+ this.processPool.size < this.config.maxConcurrent) {
636
+ const next = this.pendingQueue.shift();
637
+ if (!next)
638
+ break;
639
+ this.executeInternal(next.workerType, next.config)
640
+ .then(next.resolve)
641
+ .catch(next.reject);
642
+ }
643
+ }
644
+ /**
645
+ * Build context from file patterns
646
+ */
647
+ async buildContext(patterns) {
648
+ if (patterns.length === 0)
649
+ return '';
650
+ // Check cache
651
+ const cacheKey = patterns.sort().join('|');
652
+ if (this.config.cacheContext) {
653
+ const cached = this.contextCache.get(cacheKey);
654
+ if (cached && Date.now() - cached.timestamp < this.config.cacheTtlMs) {
655
+ return cached.content;
656
+ }
657
+ }
658
+ // Collect files matching patterns
659
+ const files = [];
660
+ for (const pattern of patterns) {
661
+ const matches = this.simpleGlob(pattern);
662
+ files.push(...matches);
663
+ }
664
+ // Deduplicate and limit
665
+ const uniqueFiles = Array.from(new Set(files)).slice(0, this.config.maxContextFiles);
666
+ // Build context
667
+ const contextParts = [];
668
+ for (const file of uniqueFiles) {
669
+ try {
670
+ const fullPath = join(this.projectRoot, file);
671
+ if (!existsSync(fullPath))
672
+ continue;
673
+ const content = readFileSync(fullPath, 'utf-8');
674
+ const truncated = content.slice(0, this.config.maxCharsPerFile);
675
+ const wasTruncated = content.length > this.config.maxCharsPerFile;
676
+ contextParts.push(`--- ${file}${wasTruncated ? ' (truncated)' : ''} ---\n${truncated}`);
677
+ }
678
+ catch {
679
+ // Skip unreadable files
680
+ }
681
+ }
682
+ const contextContent = contextParts.join('\n\n');
683
+ // Cache the result
684
+ if (this.config.cacheContext) {
685
+ this.contextCache.set(cacheKey, {
686
+ content: contextContent,
687
+ timestamp: Date.now(),
688
+ patterns,
689
+ });
690
+ }
691
+ return contextContent;
692
+ }
693
+ /**
694
+ * Simple glob implementation for file matching
695
+ */
696
+ simpleGlob(pattern) {
697
+ const results = [];
698
+ // Handle simple patterns (no wildcards)
699
+ if (!pattern.includes('*')) {
700
+ const fullPath = join(this.projectRoot, pattern);
701
+ if (existsSync(fullPath)) {
702
+ results.push(pattern);
703
+ }
704
+ return results;
705
+ }
706
+ // Parse pattern parts
707
+ const parts = pattern.split('/');
708
+ const scanDir = (dir, remainingParts) => {
709
+ if (remainingParts.length === 0)
710
+ return;
711
+ if (results.length >= 100)
712
+ return; // Limit results
713
+ try {
714
+ const fullDir = join(this.projectRoot, dir);
715
+ if (!existsSync(fullDir))
716
+ return;
717
+ const entries = readdirSync(fullDir, { withFileTypes: true });
718
+ const currentPart = remainingParts[0];
719
+ const isLastPart = remainingParts.length === 1;
720
+ for (const entry of entries) {
721
+ // Skip common non-code directories
722
+ if (entry.name === 'node_modules' ||
723
+ entry.name === '.git' ||
724
+ entry.name === 'dist' ||
725
+ entry.name === 'build' ||
726
+ entry.name === 'coverage' ||
727
+ entry.name === '.next' ||
728
+ entry.name === '.cache') {
729
+ continue;
730
+ }
731
+ const entryPath = dir ? `${dir}/${entry.name}` : entry.name;
732
+ if (currentPart === '**') {
733
+ // Recursive glob
734
+ if (entry.isDirectory()) {
735
+ scanDir(entryPath, remainingParts); // Continue with **
736
+ scanDir(entryPath, remainingParts.slice(1)); // Try next part
737
+ }
738
+ else if (entry.isFile() && remainingParts.length > 1) {
739
+ // Check if file matches next pattern part
740
+ const nextPart = remainingParts[1];
741
+ if (this.matchesPattern(entry.name, nextPart)) {
742
+ results.push(entryPath);
743
+ }
744
+ }
745
+ }
746
+ else if (this.matchesPattern(entry.name, currentPart)) {
747
+ if (isLastPart && entry.isFile()) {
748
+ results.push(entryPath);
749
+ }
750
+ else if (!isLastPart && entry.isDirectory()) {
751
+ scanDir(entryPath, remainingParts.slice(1));
752
+ }
753
+ }
754
+ }
755
+ }
756
+ catch {
757
+ // Skip unreadable directories
758
+ }
759
+ };
760
+ scanDir('', parts);
761
+ return results;
762
+ }
763
+ /**
764
+ * Match filename against a simple pattern
765
+ */
766
+ matchesPattern(name, pattern) {
767
+ if (pattern === '*')
768
+ return true;
769
+ if (pattern === '**')
770
+ return true;
771
+ // Handle *.ext patterns
772
+ if (pattern.startsWith('*.')) {
773
+ return name.endsWith(pattern.slice(1));
774
+ }
775
+ // Handle prefix* patterns
776
+ if (pattern.endsWith('*')) {
777
+ return name.startsWith(pattern.slice(0, -1));
778
+ }
779
+ // Handle *suffix patterns
780
+ if (pattern.startsWith('*')) {
781
+ return name.endsWith(pattern.slice(1));
782
+ }
783
+ // Exact match
784
+ return name === pattern;
785
+ }
786
+ /**
787
+ * Build full prompt with context
788
+ */
789
+ buildPrompt(template, context) {
790
+ if (!context) {
791
+ return `${template}
792
+
793
+ ## Instructions
794
+
795
+ Analyze the codebase and provide your response following the format specified in the task.`;
796
+ }
797
+ return `${template}
798
+
799
+ ## Codebase Context
800
+
801
+ ${context}
802
+
803
+ ## Instructions
804
+
805
+ Analyze the above codebase context and provide your response following the format specified in the task.`;
806
+ }
807
+ /**
808
+ * Execute Claude Code in headless mode
809
+ */
810
+ executeClaudeCode(prompt, options) {
811
+ return new Promise((resolve) => {
812
+ const env = {
813
+ ...process.env,
814
+ CLAUDE_CODE_HEADLESS: 'true',
815
+ CLAUDE_CODE_SANDBOX_MODE: options.sandbox,
816
+ };
817
+ // Set model
818
+ env.ANTHROPIC_MODEL = MODEL_IDS[options.model];
819
+ // Spawn claude CLI process
820
+ // Fix #1395 Bug 1: Use 'ignore' for stdin since prompt is passed as CLI arg.
821
+ // Using 'pipe' for stdin caused claude --print to block forever waiting for input.
822
+ const child = spawn('claude', ['--print', prompt], {
823
+ cwd: this.projectRoot,
824
+ env,
825
+ stdio: ['ignore', 'pipe', 'pipe'],
826
+ windowsHide: true, // Prevent phantom console windows on Windows
827
+ });
828
+ // Setup timeout
829
+ const timeoutHandle = setTimeout(() => {
830
+ if (this.processPool.has(options.executionId)) {
831
+ child.kill('SIGTERM');
832
+ // Give it a moment to terminate gracefully
833
+ setTimeout(() => {
834
+ if (!child.killed) {
835
+ child.kill('SIGKILL');
836
+ }
837
+ }, 5000);
838
+ }
839
+ }, options.timeoutMs);
840
+ // Track in process pool
841
+ const poolEntry = {
842
+ process: child,
843
+ executionId: options.executionId,
844
+ workerType: options.workerType,
845
+ startTime: new Date(),
846
+ timeout: timeoutHandle,
847
+ };
848
+ this.processPool.set(options.executionId, poolEntry);
849
+ let stdout = '';
850
+ let stderr = '';
851
+ let resolved = false;
852
+ const cleanup = () => {
853
+ clearTimeout(timeoutHandle);
854
+ this.processPool.delete(options.executionId);
855
+ };
856
+ child.stdout?.on('data', (data) => {
857
+ const chunk = data.toString();
858
+ stdout += chunk;
859
+ this.emit('output', {
860
+ executionId: options.executionId,
861
+ type: 'stdout',
862
+ data: chunk,
863
+ });
864
+ });
865
+ child.stderr?.on('data', (data) => {
866
+ const chunk = data.toString();
867
+ stderr += chunk;
868
+ this.emit('output', {
869
+ executionId: options.executionId,
870
+ type: 'stderr',
871
+ data: chunk,
872
+ });
873
+ });
874
+ child.on('close', (code) => {
875
+ if (resolved)
876
+ return;
877
+ resolved = true;
878
+ cleanup();
879
+ resolve({
880
+ success: code === 0,
881
+ output: stdout || stderr,
882
+ error: code !== 0 ? stderr || `Process exited with code ${code}` : undefined,
883
+ });
884
+ });
885
+ child.on('error', (error) => {
886
+ if (resolved)
887
+ return;
888
+ resolved = true;
889
+ cleanup();
890
+ resolve({
891
+ success: false,
892
+ output: '',
893
+ error: error.message,
894
+ });
895
+ });
896
+ // Handle timeout
897
+ setTimeout(() => {
898
+ if (resolved)
899
+ return;
900
+ if (!this.processPool.has(options.executionId))
901
+ return;
902
+ resolved = true;
903
+ child.kill('SIGTERM');
904
+ cleanup();
905
+ resolve({
906
+ success: false,
907
+ output: stdout || stderr,
908
+ error: `Execution timed out after ${options.timeoutMs}ms`,
909
+ });
910
+ }, options.timeoutMs + 100); // Slightly after the kill timeout
911
+ });
912
+ }
913
+ /**
914
+ * Parse JSON output from Claude Code
915
+ */
916
+ parseJsonOutput(output) {
917
+ try {
918
+ // Try to find JSON in code blocks first
919
+ const codeBlockMatch = output.match(/```(?:json)?\s*([\s\S]*?)```/);
920
+ if (codeBlockMatch) {
921
+ return JSON.parse(codeBlockMatch[1].trim());
922
+ }
923
+ // Try to find any JSON object
924
+ const jsonMatch = output.match(/\{[\s\S]*\}/);
925
+ if (jsonMatch) {
926
+ return JSON.parse(jsonMatch[0]);
927
+ }
928
+ // Try direct parse
929
+ return JSON.parse(output.trim());
930
+ }
931
+ catch {
932
+ return {
933
+ parseError: true,
934
+ rawOutput: output,
935
+ };
936
+ }
937
+ }
938
+ /**
939
+ * Parse markdown output into sections
940
+ */
941
+ parseMarkdownOutput(output) {
942
+ const sections = [];
943
+ const codeBlocks = [];
944
+ // Extract code blocks first
945
+ const codeBlockRegex = /```(\w*)\n([\s\S]*?)```/g;
946
+ let codeMatch;
947
+ while ((codeMatch = codeBlockRegex.exec(output)) !== null) {
948
+ codeBlocks.push({
949
+ language: codeMatch[1] || 'text',
950
+ code: codeMatch[2].trim(),
951
+ });
952
+ }
953
+ // Parse sections
954
+ const lines = output.split('\n');
955
+ let currentSection = null;
956
+ for (const line of lines) {
957
+ const headerMatch = line.match(/^(#{1,6})\s+(.+)$/);
958
+ if (headerMatch) {
959
+ if (currentSection) {
960
+ sections.push(currentSection);
961
+ }
962
+ currentSection = {
963
+ title: headerMatch[2].trim(),
964
+ content: '',
965
+ level: headerMatch[1].length,
966
+ };
967
+ }
968
+ else if (currentSection) {
969
+ currentSection.content += line + '\n';
970
+ }
971
+ }
972
+ if (currentSection) {
973
+ currentSection.content = currentSection.content.trim();
974
+ sections.push(currentSection);
975
+ }
976
+ return { sections, codeBlocks };
977
+ }
978
+ /**
979
+ * Create an error result
980
+ */
981
+ createErrorResult(workerType, error) {
982
+ return {
983
+ success: false,
984
+ output: '',
985
+ durationMs: 0,
986
+ model: 'unknown',
987
+ sandboxMode: 'strict',
988
+ workerType,
989
+ timestamp: new Date(),
990
+ executionId: `error_${Date.now()}`,
991
+ error,
992
+ };
993
+ }
994
+ /**
995
+ * Log execution details for debugging
996
+ */
997
+ logExecution(executionId, type, content) {
998
+ try {
999
+ const timestamp = new Date().toISOString();
1000
+ const logFile = join(this.config.logDir, `${executionId}_${type}.log`);
1001
+ const logContent = `[${timestamp}] ${type.toUpperCase()}\n${'='.repeat(60)}\n${content}\n`;
1002
+ writeFileSync(logFile, logContent);
1003
+ }
1004
+ catch {
1005
+ // Ignore log write errors
1006
+ }
1007
+ }
1008
+ }
1009
+ // Export default
1010
+ export default HeadlessWorkerExecutor;
1011
+ //# sourceMappingURL=headless-worker-executor.js.map