claude-flow 2.0.0-alpha.61 → 2.0.0-alpha.62

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 (1395) hide show
  1. package/CHANGELOG.md +59 -1
  2. package/bin/claude-flow +1 -1
  3. package/dist/adapters/cliffy-node.d.ts.map +1 -1
  4. package/dist/adapters/cliffy-node.js +13 -7
  5. package/dist/adapters/cliffy-node.js.map +1 -1
  6. package/dist/agents/agent-manager.d.ts.map +1 -1
  7. package/dist/agents/agent-manager.js +77 -65
  8. package/dist/agents/agent-manager.js.map +1 -1
  9. package/dist/agents/agent-registry.d.ts.map +1 -1
  10. package/dist/agents/agent-registry.js +38 -30
  11. package/dist/agents/agent-registry.js.map +1 -1
  12. package/dist/api/claude-client.d.ts.map +1 -1
  13. package/dist/api/claude-client.js +22 -16
  14. package/dist/api/claude-client.js.map +1 -1
  15. package/dist/cli/agents/analyst.d.ts.map +1 -1
  16. package/dist/cli/agents/analyst.js +94 -114
  17. package/dist/cli/agents/analyst.js.map +1 -1
  18. package/dist/cli/agents/architect.d.ts.map +1 -1
  19. package/dist/cli/agents/architect.js +100 -114
  20. package/dist/cli/agents/architect.js.map +1 -1
  21. package/dist/cli/agents/base-agent.d.ts.map +1 -1
  22. package/dist/cli/agents/base-agent.js +27 -27
  23. package/dist/cli/agents/base-agent.js.map +1 -1
  24. package/dist/cli/agents/capabilities.d.ts.map +1 -1
  25. package/dist/cli/agents/capabilities.js +49 -51
  26. package/dist/cli/agents/capabilities.js.map +1 -1
  27. package/dist/cli/agents/coder.d.ts.map +1 -1
  28. package/dist/cli/agents/coder.js +92 -98
  29. package/dist/cli/agents/coder.js.map +1 -1
  30. package/dist/cli/agents/coordinator.d.ts.map +1 -1
  31. package/dist/cli/agents/coordinator.js +59 -64
  32. package/dist/cli/agents/coordinator.js.map +1 -1
  33. package/dist/cli/agents/hive-agents.d.ts.map +1 -1
  34. package/dist/cli/agents/hive-agents.js +22 -24
  35. package/dist/cli/agents/hive-agents.js.map +1 -1
  36. package/dist/cli/agents/index.d.ts.map +1 -1
  37. package/dist/cli/agents/index.js +17 -17
  38. package/dist/cli/agents/index.js.map +1 -1
  39. package/dist/cli/agents/researcher.d.ts.map +1 -1
  40. package/dist/cli/agents/researcher.js +41 -61
  41. package/dist/cli/agents/researcher.js.map +1 -1
  42. package/dist/cli/agents/tester.d.ts.map +1 -1
  43. package/dist/cli/agents/tester.js +78 -90
  44. package/dist/cli/agents/tester.js.map +1 -1
  45. package/dist/cli/cli-core.d.ts +4 -1
  46. package/dist/cli/cli-core.d.ts.map +1 -1
  47. package/dist/cli/cli-core.js +40 -39
  48. package/dist/cli/cli-core.js.map +1 -1
  49. package/dist/cli/command-registry.d.ts.map +1 -1
  50. package/dist/cli/command-registry.js +55 -64
  51. package/dist/cli/command-registry.js.map +1 -1
  52. package/dist/cli/commands/advanced-memory-commands.d.ts.map +1 -1
  53. package/dist/cli/commands/advanced-memory-commands.js +49 -40
  54. package/dist/cli/commands/advanced-memory-commands.js.map +1 -1
  55. package/dist/cli/commands/agent-simple.d.ts +3 -0
  56. package/dist/cli/commands/agent-simple.d.ts.map +1 -1
  57. package/dist/cli/commands/agent-simple.js +30 -27
  58. package/dist/cli/commands/agent-simple.js.map +1 -1
  59. package/dist/cli/commands/agent.d.ts.map +1 -1
  60. package/dist/cli/commands/agent.js +53 -40
  61. package/dist/cli/commands/agent.js.map +1 -1
  62. package/dist/cli/commands/claude-api.js +4 -4
  63. package/dist/cli/commands/claude-api.js.map +1 -1
  64. package/dist/cli/commands/claude.d.ts.map +1 -1
  65. package/dist/cli/commands/claude.js +2 -2
  66. package/dist/cli/commands/claude.js.map +1 -1
  67. package/dist/cli/commands/config-integration.d.ts +7 -1
  68. package/dist/cli/commands/config-integration.d.ts.map +1 -1
  69. package/dist/cli/commands/config-integration.js +18 -9
  70. package/dist/cli/commands/config-integration.js.map +1 -1
  71. package/dist/cli/commands/config.d.ts.map +1 -1
  72. package/dist/cli/commands/config.js +2 -3
  73. package/dist/cli/commands/config.js.map +1 -1
  74. package/dist/cli/commands/enterprise.d.ts.map +1 -1
  75. package/dist/cli/commands/enterprise.js +115 -95
  76. package/dist/cli/commands/enterprise.js.map +1 -1
  77. package/dist/cli/commands/help-new.js +49 -49
  78. package/dist/cli/commands/help-new.js.map +1 -1
  79. package/dist/cli/commands/help.d.ts.map +1 -1
  80. package/dist/cli/commands/help.js +122 -125
  81. package/dist/cli/commands/help.js.map +1 -1
  82. package/dist/cli/commands/hive-mind/index.d.ts +1 -1
  83. package/dist/cli/commands/hive-mind/index.d.ts.map +1 -1
  84. package/dist/cli/commands/hive-mind/index.js +1 -1
  85. package/dist/cli/commands/hive-mind/index.js.map +1 -1
  86. package/dist/cli/commands/hive-mind/init.d.ts.map +1 -1
  87. package/dist/cli/commands/hive-mind/init.js.map +1 -1
  88. package/dist/cli/commands/hive-mind/optimize-memory.d.ts.map +1 -1
  89. package/dist/cli/commands/hive-mind/optimize-memory.js +35 -26
  90. package/dist/cli/commands/hive-mind/optimize-memory.js.map +1 -1
  91. package/dist/cli/commands/hive-mind/pause.d.ts.map +1 -1
  92. package/dist/cli/commands/hive-mind/pause.js +8 -6
  93. package/dist/cli/commands/hive-mind/pause.js.map +1 -1
  94. package/dist/cli/commands/hive-mind/ps.d.ts.map +1 -1
  95. package/dist/cli/commands/hive-mind/ps.js +17 -12
  96. package/dist/cli/commands/hive-mind/ps.js.map +1 -1
  97. package/dist/cli/commands/hive-mind/resume.js +12 -10
  98. package/dist/cli/commands/hive-mind/resume.js.map +1 -1
  99. package/dist/cli/commands/hive-mind/spawn.d.ts.map +1 -1
  100. package/dist/cli/commands/hive-mind/spawn.js +20 -11
  101. package/dist/cli/commands/hive-mind/spawn.js.map +1 -1
  102. package/dist/cli/commands/hive-mind/status.js +17 -22
  103. package/dist/cli/commands/hive-mind/status.js.map +1 -1
  104. package/dist/cli/commands/hive-mind/stop.d.ts.map +1 -1
  105. package/dist/cli/commands/hive-mind/stop.js +23 -15
  106. package/dist/cli/commands/hive-mind/stop.js.map +1 -1
  107. package/dist/cli/commands/hive-mind/task.d.ts.map +1 -1
  108. package/dist/cli/commands/hive-mind/task.js +25 -19
  109. package/dist/cli/commands/hive-mind/task.js.map +1 -1
  110. package/dist/cli/commands/hive-mind/wizard.d.ts.map +1 -1
  111. package/dist/cli/commands/hive-mind/wizard.js +86 -68
  112. package/dist/cli/commands/hive-mind/wizard.js.map +1 -1
  113. package/dist/cli/commands/hive.js +73 -38
  114. package/dist/cli/commands/hive.js.map +1 -1
  115. package/dist/cli/commands/hook-validator.d.ts.map +1 -1
  116. package/dist/cli/commands/hook-validator.js +4 -2
  117. package/dist/cli/commands/hook-validator.js.map +1 -1
  118. package/dist/cli/commands/hook.d.ts.map +1 -1
  119. package/dist/cli/commands/hook.js +8 -8
  120. package/dist/cli/commands/hook.js.map +1 -1
  121. package/dist/cli/commands/index.d.ts +1 -1
  122. package/dist/cli/commands/index.d.ts.map +1 -1
  123. package/dist/cli/commands/index.js +850 -784
  124. package/dist/cli/commands/index.js.map +1 -1
  125. package/dist/cli/commands/mcp.d.ts.map +1 -1
  126. package/dist/cli/commands/mcp.js +8 -16
  127. package/dist/cli/commands/mcp.js.map +1 -1
  128. package/dist/cli/commands/memory.d.ts.map +1 -1
  129. package/dist/cli/commands/memory.js +8 -8
  130. package/dist/cli/commands/memory.js.map +1 -1
  131. package/dist/cli/commands/migrate.d.ts.map +1 -1
  132. package/dist/cli/commands/migrate.js +3 -3
  133. package/dist/cli/commands/migrate.js.map +1 -1
  134. package/dist/cli/commands/monitor.d.ts.map +1 -1
  135. package/dist/cli/commands/monitor.js +50 -34
  136. package/dist/cli/commands/monitor.js.map +1 -1
  137. package/dist/cli/commands/ruv-swarm.d.ts +7 -1
  138. package/dist/cli/commands/ruv-swarm.d.ts.map +1 -1
  139. package/dist/cli/commands/ruv-swarm.js +6 -6
  140. package/dist/cli/commands/ruv-swarm.js.map +1 -1
  141. package/dist/cli/commands/session.d.ts.map +1 -1
  142. package/dist/cli/commands/session.js +22 -17
  143. package/dist/cli/commands/session.js.map +1 -1
  144. package/dist/cli/commands/sparc.d.ts +1 -1
  145. package/dist/cli/commands/sparc.d.ts.map +1 -1
  146. package/dist/cli/commands/sparc.js +146 -126
  147. package/dist/cli/commands/sparc.js.map +1 -1
  148. package/dist/cli/commands/start/event-emitter.js +1 -1
  149. package/dist/cli/commands/start/event-emitter.js.map +1 -1
  150. package/dist/cli/commands/start/process-manager.d.ts.map +1 -1
  151. package/dist/cli/commands/start/process-manager.js +20 -18
  152. package/dist/cli/commands/start/process-manager.js.map +1 -1
  153. package/dist/cli/commands/start/process-ui-simple.d.ts +4 -0
  154. package/dist/cli/commands/start/process-ui-simple.d.ts.map +1 -1
  155. package/dist/cli/commands/start/process-ui-simple.js +2 -2
  156. package/dist/cli/commands/start/process-ui-simple.js.map +1 -1
  157. package/dist/cli/commands/start/start-command.d.ts.map +1 -1
  158. package/dist/cli/commands/start/start-command.js +27 -15
  159. package/dist/cli/commands/start/start-command.js.map +1 -1
  160. package/dist/cli/commands/start/system-monitor.d.ts +3 -0
  161. package/dist/cli/commands/start/system-monitor.d.ts.map +1 -1
  162. package/dist/cli/commands/start/system-monitor.js +16 -18
  163. package/dist/cli/commands/start/system-monitor.js.map +1 -1
  164. package/dist/cli/commands/status.d.ts.map +1 -1
  165. package/dist/cli/commands/status.js +28 -33
  166. package/dist/cli/commands/status.js.map +1 -1
  167. package/dist/cli/commands/swarm-spawn.d.ts.map +1 -1
  168. package/dist/cli/commands/swarm-spawn.js +1 -1
  169. package/dist/cli/commands/swarm-spawn.js.map +1 -1
  170. package/dist/cli/commands/swarm.d.ts +4 -1
  171. package/dist/cli/commands/swarm.d.ts.map +1 -1
  172. package/dist/cli/commands/swarm.js +23 -18
  173. package/dist/cli/commands/swarm.js.map +1 -1
  174. package/dist/cli/commands/task.d.ts.map +1 -1
  175. package/dist/cli/commands/task.js.map +1 -1
  176. package/dist/cli/commands/workflow.d.ts.map +1 -1
  177. package/dist/cli/commands/workflow.js +49 -45
  178. package/dist/cli/commands/workflow.js.map +1 -1
  179. package/dist/cli/completion.d.ts +3 -0
  180. package/dist/cli/completion.d.ts.map +1 -1
  181. package/dist/cli/completion.js +15 -5
  182. package/dist/cli/completion.js.map +1 -1
  183. package/dist/cli/formatter.d.ts +3 -0
  184. package/dist/cli/formatter.d.ts.map +1 -1
  185. package/dist/cli/formatter.js +3 -3
  186. package/dist/cli/formatter.js.map +1 -1
  187. package/dist/cli/help-formatter.d.ts.map +1 -1
  188. package/dist/cli/help-formatter.js +8 -14
  189. package/dist/cli/help-formatter.js.map +1 -1
  190. package/dist/cli/index-remote.d.ts +4 -0
  191. package/dist/cli/index-remote.d.ts.map +1 -1
  192. package/dist/cli/index-remote.js +1 -1
  193. package/dist/cli/index-remote.js.map +1 -1
  194. package/dist/cli/index.d.ts +1 -1
  195. package/dist/cli/index.d.ts.map +1 -1
  196. package/dist/cli/index.js +32 -34
  197. package/dist/cli/index.js.map +1 -1
  198. package/dist/cli/init/batch-tools.d.ts.map +1 -1
  199. package/dist/cli/init/batch-tools.js.map +1 -1
  200. package/dist/cli/init/claude-config.d.ts.map +1 -1
  201. package/dist/cli/init/claude-config.js +111 -106
  202. package/dist/cli/init/claude-config.js.map +1 -1
  203. package/dist/cli/init/directory-structure.d.ts.map +1 -1
  204. package/dist/cli/init/directory-structure.js +3 -3
  205. package/dist/cli/init/directory-structure.js.map +1 -1
  206. package/dist/cli/init/index.d.ts.map +1 -1
  207. package/dist/cli/init/index.js +1 -1
  208. package/dist/cli/init/index.js.map +1 -1
  209. package/dist/cli/init/sparc-environment.d.ts.map +1 -1
  210. package/dist/cli/init/sparc-environment.js +69 -69
  211. package/dist/cli/init/sparc-environment.js.map +1 -1
  212. package/dist/cli/init/swarm-commands.d.ts.map +1 -1
  213. package/dist/cli/init/swarm-commands.js +1 -1
  214. package/dist/cli/init/swarm-commands.js.map +1 -1
  215. package/dist/cli/main.d.ts +3 -0
  216. package/dist/cli/main.d.ts.map +1 -1
  217. package/dist/cli/main.js +6 -6
  218. package/dist/cli/main.js.map +1 -1
  219. package/dist/cli/node-compat.d.ts.map +1 -1
  220. package/dist/cli/node-compat.js +24 -18
  221. package/dist/cli/node-compat.js.map +1 -1
  222. package/dist/cli/node-repl.d.ts +4 -0
  223. package/dist/cli/node-repl.d.ts.map +1 -1
  224. package/dist/cli/node-repl.js +24 -30
  225. package/dist/cli/node-repl.js.map +1 -1
  226. package/dist/cli/repl.d.ts.map +1 -1
  227. package/dist/cli/repl.js +81 -70
  228. package/dist/cli/repl.js.map +1 -1
  229. package/dist/cli/runtime-detector.d.ts.map +1 -1
  230. package/dist/cli/runtime-detector.js +11 -7
  231. package/dist/cli/runtime-detector.js.map +1 -1
  232. package/dist/cli/simple-cli.d.ts +4 -0
  233. package/dist/cli/simple-cli.d.ts.map +1 -1
  234. package/dist/cli/simple-cli.js +109 -95
  235. package/dist/cli/simple-cli.js.map +1 -1
  236. package/dist/cli/simple-commands/analysis.d.ts.map +1 -1
  237. package/dist/cli/simple-commands/analysis.js +18 -11
  238. package/dist/cli/simple-commands/analysis.js.map +1 -1
  239. package/dist/cli/simple-commands/automation.js +32 -17
  240. package/dist/cli/simple-commands/automation.js.map +1 -1
  241. package/dist/cli/simple-commands/batch-manager.js +44 -39
  242. package/dist/cli/simple-commands/batch-manager.js.map +1 -1
  243. package/dist/cli/simple-commands/config.d.ts.map +1 -1
  244. package/dist/cli/simple-commands/config.js +22 -21
  245. package/dist/cli/simple-commands/config.js.map +1 -1
  246. package/dist/cli/simple-commands/coordination.d.ts.map +1 -1
  247. package/dist/cli/simple-commands/coordination.js +12 -12
  248. package/dist/cli/simple-commands/coordination.js.map +1 -1
  249. package/dist/cli/simple-commands/fix-hook-variables.d.ts.map +1 -1
  250. package/dist/cli/simple-commands/fix-hook-variables.js +36 -30
  251. package/dist/cli/simple-commands/fix-hook-variables.js.map +1 -1
  252. package/dist/cli/simple-commands/github.d.ts.map +1 -1
  253. package/dist/cli/simple-commands/github.js +15 -15
  254. package/dist/cli/simple-commands/github.js.map +1 -1
  255. package/dist/cli/simple-commands/hive-mind/auto-save-middleware.d.ts.map +1 -1
  256. package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js +12 -10
  257. package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js.map +1 -1
  258. package/dist/cli/simple-commands/hive-mind/communication.d.ts.map +1 -1
  259. package/dist/cli/simple-commands/hive-mind/communication.js +42 -45
  260. package/dist/cli/simple-commands/hive-mind/communication.js.map +1 -1
  261. package/dist/cli/simple-commands/hive-mind/core.d.ts.map +1 -1
  262. package/dist/cli/simple-commands/hive-mind/core.js +97 -89
  263. package/dist/cli/simple-commands/hive-mind/core.js.map +1 -1
  264. package/dist/cli/simple-commands/hive-mind/db-optimizer.d.ts.map +1 -1
  265. package/dist/cli/simple-commands/hive-mind/db-optimizer.js +114 -59
  266. package/dist/cli/simple-commands/hive-mind/db-optimizer.js.map +1 -1
  267. package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts.map +1 -1
  268. package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js +182 -103
  269. package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js.map +1 -1
  270. package/dist/cli/simple-commands/hive-mind/memory.d.ts.map +1 -1
  271. package/dist/cli/simple-commands/hive-mind/memory.js +105 -75
  272. package/dist/cli/simple-commands/hive-mind/memory.js.map +1 -1
  273. package/dist/cli/simple-commands/hive-mind/performance-optimizer.d.ts.map +1 -1
  274. package/dist/cli/simple-commands/hive-mind/performance-optimizer.js +45 -43
  275. package/dist/cli/simple-commands/hive-mind/performance-optimizer.js.map +1 -1
  276. package/dist/cli/simple-commands/hive-mind/queen.d.ts.map +1 -1
  277. package/dist/cli/simple-commands/hive-mind/queen.js +101 -88
  278. package/dist/cli/simple-commands/hive-mind/queen.js.map +1 -1
  279. package/dist/cli/simple-commands/hive-mind/session-manager.js +75 -53
  280. package/dist/cli/simple-commands/hive-mind/session-manager.js.map +1 -1
  281. package/dist/cli/simple-commands/hive-mind-optimize.js +18 -18
  282. package/dist/cli/simple-commands/hive-mind-optimize.js.map +1 -1
  283. package/dist/cli/simple-commands/hive-mind.d.ts.map +1 -1
  284. package/dist/cli/simple-commands/hive-mind.js +195 -135
  285. package/dist/cli/simple-commands/hive-mind.js.map +1 -1
  286. package/dist/cli/simple-commands/hook-safety.d.ts.map +1 -1
  287. package/dist/cli/simple-commands/hook-safety.js +19 -19
  288. package/dist/cli/simple-commands/hook-safety.js.map +1 -1
  289. package/dist/cli/simple-commands/hooks.d.ts.map +1 -1
  290. package/dist/cli/simple-commands/hooks.js +85 -71
  291. package/dist/cli/simple-commands/hooks.js.map +1 -1
  292. package/dist/cli/simple-commands/init/batch-init.d.ts.map +1 -1
  293. package/dist/cli/simple-commands/init/batch-init.js +62 -55
  294. package/dist/cli/simple-commands/init/batch-init.js.map +1 -1
  295. package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.d.ts.map +1 -1
  296. package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +2 -2
  297. package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js.map +1 -1
  298. package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.d.ts.map +1 -1
  299. package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +58 -50
  300. package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js.map +1 -1
  301. package/dist/cli/simple-commands/init/claude-commands/slash-commands.d.ts.map +1 -1
  302. package/dist/cli/simple-commands/init/claude-commands/slash-commands.js.map +1 -1
  303. package/dist/cli/simple-commands/init/claude-commands/sparc-commands.d.ts.map +1 -1
  304. package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js +34 -28
  305. package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js.map +1 -1
  306. package/dist/cli/simple-commands/init/executable-wrapper.d.ts.map +1 -1
  307. package/dist/cli/simple-commands/init/executable-wrapper.js +7 -4
  308. package/dist/cli/simple-commands/init/executable-wrapper.js.map +1 -1
  309. package/dist/cli/simple-commands/init/gitignore-updater.d.ts.map +1 -1
  310. package/dist/cli/simple-commands/init/gitignore-updater.js +10 -9
  311. package/dist/cli/simple-commands/init/gitignore-updater.js.map +1 -1
  312. package/dist/cli/simple-commands/init/help.d.ts.map +1 -1
  313. package/dist/cli/simple-commands/init/help.js.map +1 -1
  314. package/dist/cli/simple-commands/init/index.d.ts.map +1 -1
  315. package/dist/cli/simple-commands/init/index.js +159 -103
  316. package/dist/cli/simple-commands/init/index.js.map +1 -1
  317. package/dist/cli/simple-commands/init/performance-monitor.d.ts.map +1 -1
  318. package/dist/cli/simple-commands/init/performance-monitor.js +17 -18
  319. package/dist/cli/simple-commands/init/performance-monitor.js.map +1 -1
  320. package/dist/cli/simple-commands/init/rollback/backup-manager.d.ts.map +1 -1
  321. package/dist/cli/simple-commands/init/rollback/backup-manager.js +19 -25
  322. package/dist/cli/simple-commands/init/rollback/backup-manager.js.map +1 -1
  323. package/dist/cli/simple-commands/init/rollback/index.d.ts.map +1 -1
  324. package/dist/cli/simple-commands/init/rollback/index.js +18 -15
  325. package/dist/cli/simple-commands/init/rollback/index.js.map +1 -1
  326. package/dist/cli/simple-commands/init/rollback/recovery-manager.d.ts.map +1 -1
  327. package/dist/cli/simple-commands/init/rollback/recovery-manager.js +49 -68
  328. package/dist/cli/simple-commands/init/rollback/recovery-manager.js.map +1 -1
  329. package/dist/cli/simple-commands/init/rollback/rollback-executor.d.ts.map +1 -1
  330. package/dist/cli/simple-commands/init/rollback/rollback-executor.js +16 -24
  331. package/dist/cli/simple-commands/init/rollback/rollback-executor.js.map +1 -1
  332. package/dist/cli/simple-commands/init/rollback/state-tracker.d.ts.map +1 -1
  333. package/dist/cli/simple-commands/init/rollback/state-tracker.js +25 -25
  334. package/dist/cli/simple-commands/init/rollback/state-tracker.js.map +1 -1
  335. package/dist/cli/simple-commands/init/sparc/roomodes-config.d.ts.map +1 -1
  336. package/dist/cli/simple-commands/init/sparc/roomodes-config.js +57 -57
  337. package/dist/cli/simple-commands/init/sparc/roomodes-config.js.map +1 -1
  338. package/dist/cli/simple-commands/init/sparc/workflows.d.ts.map +1 -1
  339. package/dist/cli/simple-commands/init/sparc/workflows.js +21 -21
  340. package/dist/cli/simple-commands/init/sparc/workflows.js.map +1 -1
  341. package/dist/cli/simple-commands/init/sparc-structure.d.ts.map +1 -1
  342. package/dist/cli/simple-commands/init/sparc-structure.js +1 -1
  343. package/dist/cli/simple-commands/init/sparc-structure.js.map +1 -1
  344. package/dist/cli/simple-commands/init/templates/enhanced-templates.d.ts.map +1 -1
  345. package/dist/cli/simple-commands/init/templates/enhanced-templates.js +69 -78
  346. package/dist/cli/simple-commands/init/templates/enhanced-templates.js.map +1 -1
  347. package/dist/cli/simple-commands/init/templates/sparc-modes.js +2 -2
  348. package/dist/cli/simple-commands/init/validation/config-validator.d.ts.map +1 -1
  349. package/dist/cli/simple-commands/init/validation/config-validator.js +12 -16
  350. package/dist/cli/simple-commands/init/validation/config-validator.js.map +1 -1
  351. package/dist/cli/simple-commands/init/validation/health-checker.d.ts.map +1 -1
  352. package/dist/cli/simple-commands/init/validation/health-checker.js +39 -41
  353. package/dist/cli/simple-commands/init/validation/health-checker.js.map +1 -1
  354. package/dist/cli/simple-commands/init/validation/index.d.ts.map +1 -1
  355. package/dist/cli/simple-commands/init/validation/index.js +8 -8
  356. package/dist/cli/simple-commands/init/validation/index.js.map +1 -1
  357. package/dist/cli/simple-commands/init/validation/mode-validator.d.ts.map +1 -1
  358. package/dist/cli/simple-commands/init/validation/mode-validator.js +12 -12
  359. package/dist/cli/simple-commands/init/validation/mode-validator.js.map +1 -1
  360. package/dist/cli/simple-commands/init/validation/post-init-validator.d.ts.map +1 -1
  361. package/dist/cli/simple-commands/init/validation/post-init-validator.js +13 -13
  362. package/dist/cli/simple-commands/init/validation/post-init-validator.js.map +1 -1
  363. package/dist/cli/simple-commands/init/validation/pre-init-validator.d.ts.map +1 -1
  364. package/dist/cli/simple-commands/init/validation/pre-init-validator.js +19 -24
  365. package/dist/cli/simple-commands/init/validation/pre-init-validator.js.map +1 -1
  366. package/dist/cli/simple-commands/mcp.js +2 -2
  367. package/dist/cli/simple-commands/mcp.js.map +1 -1
  368. package/dist/cli/simple-commands/memory.js +4 -4
  369. package/dist/cli/simple-commands/memory.js.map +1 -1
  370. package/dist/cli/simple-commands/migrate-hooks.d.ts.map +1 -1
  371. package/dist/cli/simple-commands/migrate-hooks.js +3 -3
  372. package/dist/cli/simple-commands/migrate-hooks.js.map +1 -1
  373. package/dist/cli/simple-commands/monitor.d.ts.map +1 -1
  374. package/dist/cli/simple-commands/monitor.js +34 -26
  375. package/dist/cli/simple-commands/monitor.js.map +1 -1
  376. package/dist/cli/simple-commands/process-ui-enhanced.d.ts.map +1 -1
  377. package/dist/cli/simple-commands/process-ui-enhanced.js +53 -39
  378. package/dist/cli/simple-commands/process-ui-enhanced.js.map +1 -1
  379. package/dist/cli/simple-commands/sparc-modes/index.js +11 -11
  380. package/dist/cli/simple-commands/sparc-modes/index.js.map +1 -1
  381. package/dist/cli/simple-commands/sparc-modes/swarm.js +50 -50
  382. package/dist/cli/simple-commands/sparc.d.ts.map +1 -1
  383. package/dist/cli/simple-commands/sparc.js +21 -11
  384. package/dist/cli/simple-commands/sparc.js.map +1 -1
  385. package/dist/cli/simple-commands/start-ui.d.ts.map +1 -1
  386. package/dist/cli/simple-commands/start-ui.js +5 -3
  387. package/dist/cli/simple-commands/start-ui.js.map +1 -1
  388. package/dist/cli/simple-commands/start-wrapper.d.ts.map +1 -1
  389. package/dist/cli/simple-commands/start-wrapper.js +1 -1
  390. package/dist/cli/simple-commands/start-wrapper.js.map +1 -1
  391. package/dist/cli/simple-commands/status.js +14 -14
  392. package/dist/cli/simple-commands/status.js.map +1 -1
  393. package/dist/cli/simple-commands/swarm-executor.d.ts.map +1 -1
  394. package/dist/cli/simple-commands/swarm-executor.js +19 -19
  395. package/dist/cli/simple-commands/swarm-executor.js.map +1 -1
  396. package/dist/cli/simple-commands/swarm-metrics-integration.d.ts.map +1 -1
  397. package/dist/cli/simple-commands/swarm-metrics-integration.js +30 -21
  398. package/dist/cli/simple-commands/swarm-metrics-integration.js.map +1 -1
  399. package/dist/cli/simple-commands/swarm-webui-integration.d.ts.map +1 -1
  400. package/dist/cli/simple-commands/swarm-webui-integration.js +30 -18
  401. package/dist/cli/simple-commands/swarm-webui-integration.js.map +1 -1
  402. package/dist/cli/simple-commands/swarm.d.ts.map +1 -1
  403. package/dist/cli/simple-commands/swarm.js +78 -67
  404. package/dist/cli/simple-commands/swarm.js.map +1 -1
  405. package/dist/cli/simple-commands/training.d.ts.map +1 -1
  406. package/dist/cli/simple-commands/training.js +7 -7
  407. package/dist/cli/simple-commands/training.js.map +1 -1
  408. package/dist/cli/simple-commands/web-server.d.ts.map +1 -1
  409. package/dist/cli/simple-commands/web-server.js +68 -66
  410. package/dist/cli/simple-commands/web-server.js.map +1 -1
  411. package/dist/cli/simple-mcp.d.ts.map +1 -1
  412. package/dist/cli/simple-mcp.js +2 -4
  413. package/dist/cli/simple-mcp.js.map +1 -1
  414. package/dist/cli/simple-orchestrator.d.ts +3 -0
  415. package/dist/cli/simple-orchestrator.d.ts.map +1 -1
  416. package/dist/cli/simple-orchestrator.js +36 -35
  417. package/dist/cli/simple-orchestrator.js.map +1 -1
  418. package/dist/cli/ui/compatible-ui.d.ts +4 -0
  419. package/dist/cli/ui/compatible-ui.d.ts.map +1 -1
  420. package/dist/cli/ui/compatible-ui.js +9 -8
  421. package/dist/cli/ui/compatible-ui.js.map +1 -1
  422. package/dist/cli/ui/fallback-handler.d.ts.map +1 -1
  423. package/dist/cli/ui/fallback-handler.js +4 -4
  424. package/dist/cli/ui/fallback-handler.js.map +1 -1
  425. package/dist/cli/ui/index.d.ts +2 -2
  426. package/dist/cli/ui/index.d.ts.map +1 -1
  427. package/dist/cli/ui/index.js +3 -3
  428. package/dist/cli/ui/index.js.map +1 -1
  429. package/dist/cli/utils/environment-detector.d.ts.map +1 -1
  430. package/dist/cli/utils/environment-detector.js +13 -11
  431. package/dist/cli/utils/environment-detector.js.map +1 -1
  432. package/dist/cli/utils/interactive-detector.d.ts.map +1 -1
  433. package/dist/cli/utils/interactive-detector.js +1 -1
  434. package/dist/cli/utils/interactive-detector.js.map +1 -1
  435. package/dist/cli/utils/prompt-defaults.d.ts.map +1 -1
  436. package/dist/cli/utils/prompt-defaults.js +6 -7
  437. package/dist/cli/utils/prompt-defaults.js.map +1 -1
  438. package/dist/cli/utils/safe-interactive.d.ts.map +1 -1
  439. package/dist/cli/utils/safe-interactive.js +7 -6
  440. package/dist/cli/utils/safe-interactive.js.map +1 -1
  441. package/dist/cli/utils.d.ts.map +1 -1
  442. package/dist/cli/utils.js +58 -50
  443. package/dist/cli/utils.js.map +1 -1
  444. package/dist/cli/validation-helper.d.ts.map +1 -1
  445. package/dist/cli/validation-helper.js.map +1 -1
  446. package/dist/communication/message-bus.d.ts.map +1 -1
  447. package/dist/communication/message-bus.js +80 -74
  448. package/dist/communication/message-bus.js.map +1 -1
  449. package/dist/config/config-manager.d.ts +3 -0
  450. package/dist/config/config-manager.d.ts.map +1 -1
  451. package/dist/config/config-manager.js +23 -6
  452. package/dist/config/config-manager.js.map +1 -1
  453. package/dist/config/ruv-swarm-config.d.ts +6 -0
  454. package/dist/config/ruv-swarm-config.d.ts.map +1 -1
  455. package/dist/config/ruv-swarm-config.js +37 -22
  456. package/dist/config/ruv-swarm-config.js.map +1 -1
  457. package/dist/config/ruv-swarm-integration.d.ts.map +1 -1
  458. package/dist/config/ruv-swarm-integration.js +21 -21
  459. package/dist/config/ruv-swarm-integration.js.map +1 -1
  460. package/dist/constants/agent-types.d.ts +4 -4
  461. package/dist/constants/agent-types.d.ts.map +1 -1
  462. package/dist/constants/agent-types.js +4 -4
  463. package/dist/constants/agent-types.js.map +1 -1
  464. package/dist/coordination/advanced-scheduler.d.ts.map +1 -1
  465. package/dist/coordination/advanced-scheduler.js +6 -10
  466. package/dist/coordination/advanced-scheduler.js.map +1 -1
  467. package/dist/coordination/advanced-task-executor.d.ts.map +1 -1
  468. package/dist/coordination/advanced-task-executor.js +33 -33
  469. package/dist/coordination/advanced-task-executor.js.map +1 -1
  470. package/dist/coordination/background-executor.d.ts.map +1 -1
  471. package/dist/coordination/background-executor.js +17 -16
  472. package/dist/coordination/background-executor.js.map +1 -1
  473. package/dist/coordination/circuit-breaker.d.ts.map +1 -1
  474. package/dist/coordination/circuit-breaker.js +3 -0
  475. package/dist/coordination/circuit-breaker.js.map +1 -1
  476. package/dist/coordination/conflict-resolution.d.ts.map +1 -1
  477. package/dist/coordination/conflict-resolution.js +10 -8
  478. package/dist/coordination/conflict-resolution.js.map +1 -1
  479. package/dist/coordination/dependency-graph.d.ts.map +1 -1
  480. package/dist/coordination/dependency-graph.js +4 -3
  481. package/dist/coordination/dependency-graph.js.map +1 -1
  482. package/dist/coordination/hive-orchestrator.d.ts.map +1 -1
  483. package/dist/coordination/hive-orchestrator.js +29 -25
  484. package/dist/coordination/hive-orchestrator.js.map +1 -1
  485. package/dist/coordination/hive-protocol.d.ts.map +1 -1
  486. package/dist/coordination/hive-protocol.js +22 -23
  487. package/dist/coordination/hive-protocol.js.map +1 -1
  488. package/dist/coordination/index.d.ts +1 -1
  489. package/dist/coordination/index.d.ts.map +1 -1
  490. package/dist/coordination/index.js +1 -1
  491. package/dist/coordination/index.js.map +1 -1
  492. package/dist/coordination/load-balancer.d.ts.map +1 -1
  493. package/dist/coordination/load-balancer.js +55 -56
  494. package/dist/coordination/load-balancer.js.map +1 -1
  495. package/dist/coordination/manager.d.ts.map +1 -1
  496. package/dist/coordination/manager.js +2 -8
  497. package/dist/coordination/manager.js.map +1 -1
  498. package/dist/coordination/messaging.d.ts.map +1 -1
  499. package/dist/coordination/messaging.js +4 -4
  500. package/dist/coordination/messaging.js.map +1 -1
  501. package/dist/coordination/metrics.d.ts.map +1 -1
  502. package/dist/coordination/metrics.js +11 -9
  503. package/dist/coordination/metrics.js.map +1 -1
  504. package/dist/coordination/resources.d.ts.map +1 -1
  505. package/dist/coordination/resources.js +10 -6
  506. package/dist/coordination/resources.js.map +1 -1
  507. package/dist/coordination/scheduler.d.ts.map +1 -1
  508. package/dist/coordination/scheduler.js +4 -4
  509. package/dist/coordination/scheduler.js.map +1 -1
  510. package/dist/coordination/swarm-coordinator.d.ts.map +1 -1
  511. package/dist/coordination/swarm-coordinator.js +32 -34
  512. package/dist/coordination/swarm-coordinator.js.map +1 -1
  513. package/dist/coordination/swarm-monitor.d.ts.map +1 -1
  514. package/dist/coordination/swarm-monitor.js +17 -17
  515. package/dist/coordination/swarm-monitor.js.map +1 -1
  516. package/dist/coordination/work-stealing.d.ts.map +1 -1
  517. package/dist/coordination/work-stealing.js +3 -0
  518. package/dist/coordination/work-stealing.js.map +1 -1
  519. package/dist/core/config.d.ts +4 -0
  520. package/dist/core/config.d.ts.map +1 -1
  521. package/dist/core/config.js +28 -31
  522. package/dist/core/config.js.map +1 -1
  523. package/dist/core/event-bus.d.ts +3 -0
  524. package/dist/core/event-bus.d.ts.map +1 -1
  525. package/dist/core/event-bus.js.map +1 -1
  526. package/dist/core/json-persistence.d.ts +3 -0
  527. package/dist/core/json-persistence.d.ts.map +1 -1
  528. package/dist/core/json-persistence.js +19 -23
  529. package/dist/core/json-persistence.js.map +1 -1
  530. package/dist/core/logger.d.ts +3 -0
  531. package/dist/core/logger.d.ts.map +1 -1
  532. package/dist/core/logger.js +2 -6
  533. package/dist/core/logger.js.map +1 -1
  534. package/dist/core/orchestrator-fixed.d.ts.map +1 -1
  535. package/dist/core/orchestrator-fixed.js +4 -1
  536. package/dist/core/orchestrator-fixed.js.map +1 -1
  537. package/dist/core/orchestrator.d.ts.map +1 -1
  538. package/dist/core/orchestrator.js +66 -33
  539. package/dist/core/orchestrator.js.map +1 -1
  540. package/dist/core/persistence.d.ts +3 -0
  541. package/dist/core/persistence.d.ts.map +1 -1
  542. package/dist/core/persistence.js +25 -19
  543. package/dist/core/persistence.js.map +1 -1
  544. package/dist/enterprise/analytics-manager.d.ts.map +1 -1
  545. package/dist/enterprise/analytics-manager.js +141 -134
  546. package/dist/enterprise/analytics-manager.js.map +1 -1
  547. package/dist/enterprise/audit-manager.d.ts.map +1 -1
  548. package/dist/enterprise/audit-manager.js +144 -122
  549. package/dist/enterprise/audit-manager.js.map +1 -1
  550. package/dist/enterprise/cloud-manager.d.ts.map +1 -1
  551. package/dist/enterprise/cloud-manager.js +104 -99
  552. package/dist/enterprise/cloud-manager.js.map +1 -1
  553. package/dist/enterprise/deployment-manager.d.ts.map +1 -1
  554. package/dist/enterprise/deployment-manager.js +104 -97
  555. package/dist/enterprise/deployment-manager.js.map +1 -1
  556. package/dist/enterprise/index.d.ts +6 -6
  557. package/dist/enterprise/index.d.ts.map +1 -1
  558. package/dist/enterprise/project-manager.d.ts.map +1 -1
  559. package/dist/enterprise/project-manager.js +74 -66
  560. package/dist/enterprise/project-manager.js.map +1 -1
  561. package/dist/enterprise/security-manager.d.ts.map +1 -1
  562. package/dist/enterprise/security-manager.js +137 -129
  563. package/dist/enterprise/security-manager.js.map +1 -1
  564. package/dist/hive-mind/core/Agent.d.ts.map +1 -1
  565. package/dist/hive-mind/core/Agent.js +36 -36
  566. package/dist/hive-mind/core/Agent.js.map +1 -1
  567. package/dist/hive-mind/core/Communication.d.ts.map +1 -1
  568. package/dist/hive-mind/core/Communication.js +17 -17
  569. package/dist/hive-mind/core/Communication.js.map +1 -1
  570. package/dist/hive-mind/core/DatabaseManager.d.ts.map +1 -1
  571. package/dist/hive-mind/core/DatabaseManager.js +104 -58
  572. package/dist/hive-mind/core/DatabaseManager.js.map +1 -1
  573. package/dist/hive-mind/core/HiveMind.d.ts.map +1 -1
  574. package/dist/hive-mind/core/HiveMind.js +35 -35
  575. package/dist/hive-mind/core/HiveMind.js.map +1 -1
  576. package/dist/hive-mind/core/Memory.d.ts.map +1 -1
  577. package/dist/hive-mind/core/Memory.js +78 -71
  578. package/dist/hive-mind/core/Memory.js.map +1 -1
  579. package/dist/hive-mind/core/MemoryMonitor.d.ts.map +1 -1
  580. package/dist/hive-mind/core/MemoryMonitor.js +38 -38
  581. package/dist/hive-mind/core/MemoryMonitor.js.map +1 -1
  582. package/dist/hive-mind/core/Queen.d.ts.map +1 -1
  583. package/dist/hive-mind/core/Queen.js +110 -47
  584. package/dist/hive-mind/core/Queen.js.map +1 -1
  585. package/dist/hive-mind/integration/ConsensusEngine.d.ts.map +1 -1
  586. package/dist/hive-mind/integration/ConsensusEngine.js +25 -23
  587. package/dist/hive-mind/integration/ConsensusEngine.js.map +1 -1
  588. package/dist/hive-mind/integration/MCPToolWrapper.d.ts.map +1 -1
  589. package/dist/hive-mind/integration/MCPToolWrapper.js.map +1 -1
  590. package/dist/hive-mind/integration/SwarmOrchestrator.d.ts.map +1 -1
  591. package/dist/hive-mind/integration/SwarmOrchestrator.js +60 -58
  592. package/dist/hive-mind/integration/SwarmOrchestrator.js.map +1 -1
  593. package/dist/hive-mind/types.d.ts.map +1 -1
  594. package/dist/integration/mock-components.d.ts.map +1 -1
  595. package/dist/integration/mock-components.js +21 -21
  596. package/dist/integration/mock-components.js.map +1 -1
  597. package/dist/integration/system-integration.d.ts.map +1 -1
  598. package/dist/integration/system-integration.js +13 -11
  599. package/dist/integration/system-integration.js.map +1 -1
  600. package/dist/mcp/auth.d.ts +1 -1
  601. package/dist/mcp/auth.d.ts.map +1 -1
  602. package/dist/mcp/auth.js +8 -1
  603. package/dist/mcp/auth.js.map +1 -1
  604. package/dist/mcp/claude-code-wrapper.d.ts.map +1 -1
  605. package/dist/mcp/claude-code-wrapper.js +169 -68
  606. package/dist/mcp/claude-code-wrapper.js.map +1 -1
  607. package/dist/mcp/claude-flow-tools.d.ts.map +1 -1
  608. package/dist/mcp/claude-flow-tools.js +42 -3
  609. package/dist/mcp/claude-flow-tools.js.map +1 -1
  610. package/dist/mcp/client.d.ts.map +1 -1
  611. package/dist/mcp/client.js.map +1 -1
  612. package/dist/mcp/index.d.ts +6 -6
  613. package/dist/mcp/index.d.ts.map +1 -1
  614. package/dist/mcp/index.js +9 -9
  615. package/dist/mcp/index.js.map +1 -1
  616. package/dist/mcp/integrate-wrapper.d.ts.map +1 -1
  617. package/dist/mcp/integrate-wrapper.js +5 -7
  618. package/dist/mcp/integrate-wrapper.js.map +1 -1
  619. package/dist/mcp/lifecycle-manager.d.ts.map +1 -1
  620. package/dist/mcp/lifecycle-manager.js +8 -7
  621. package/dist/mcp/lifecycle-manager.js.map +1 -1
  622. package/dist/mcp/load-balancer.d.ts.map +1 -1
  623. package/dist/mcp/load-balancer.js +5 -1
  624. package/dist/mcp/load-balancer.js.map +1 -1
  625. package/dist/mcp/orchestration-integration.d.ts.map +1 -1
  626. package/dist/mcp/orchestration-integration.js +22 -9
  627. package/dist/mcp/orchestration-integration.js.map +1 -1
  628. package/dist/mcp/performance-monitor.d.ts.map +1 -1
  629. package/dist/mcp/performance-monitor.js +22 -19
  630. package/dist/mcp/performance-monitor.js.map +1 -1
  631. package/dist/mcp/protocol-manager.d.ts.map +1 -1
  632. package/dist/mcp/protocol-manager.js +8 -19
  633. package/dist/mcp/protocol-manager.js.map +1 -1
  634. package/dist/mcp/recovery/connection-health-monitor.d.ts.map +1 -1
  635. package/dist/mcp/recovery/connection-health-monitor.js +5 -5
  636. package/dist/mcp/recovery/connection-health-monitor.js.map +1 -1
  637. package/dist/mcp/recovery/connection-state-manager.d.ts +4 -0
  638. package/dist/mcp/recovery/connection-state-manager.d.ts.map +1 -1
  639. package/dist/mcp/recovery/connection-state-manager.js +13 -13
  640. package/dist/mcp/recovery/connection-state-manager.js.map +1 -1
  641. package/dist/mcp/recovery/fallback-coordinator.d.ts.map +1 -1
  642. package/dist/mcp/recovery/fallback-coordinator.js +5 -5
  643. package/dist/mcp/recovery/fallback-coordinator.js.map +1 -1
  644. package/dist/mcp/recovery/index.d.ts +4 -4
  645. package/dist/mcp/recovery/index.d.ts.map +1 -1
  646. package/dist/mcp/recovery/index.js +4 -4
  647. package/dist/mcp/recovery/index.js.map +1 -1
  648. package/dist/mcp/recovery/reconnection-manager.d.ts.map +1 -1
  649. package/dist/mcp/recovery/reconnection-manager.js +1 -1
  650. package/dist/mcp/recovery/reconnection-manager.js.map +1 -1
  651. package/dist/mcp/recovery/recovery-manager.d.ts.map +1 -1
  652. package/dist/mcp/recovery/recovery-manager.js +2 -4
  653. package/dist/mcp/recovery/recovery-manager.js.map +1 -1
  654. package/dist/mcp/router.d.ts.map +1 -1
  655. package/dist/mcp/router.js +3 -0
  656. package/dist/mcp/router.js.map +1 -1
  657. package/dist/mcp/ruv-swarm-tools.d.ts.map +1 -1
  658. package/dist/mcp/ruv-swarm-tools.js +132 -102
  659. package/dist/mcp/ruv-swarm-tools.js.map +1 -1
  660. package/dist/mcp/server-with-wrapper.d.ts +3 -0
  661. package/dist/mcp/server-with-wrapper.d.ts.map +1 -1
  662. package/dist/mcp/server-with-wrapper.js +2 -3
  663. package/dist/mcp/server-with-wrapper.js.map +1 -1
  664. package/dist/mcp/server-wrapper-mode.d.ts +5 -0
  665. package/dist/mcp/server-wrapper-mode.d.ts.map +1 -1
  666. package/dist/mcp/server-wrapper-mode.js +2 -3
  667. package/dist/mcp/server-wrapper-mode.js.map +1 -1
  668. package/dist/mcp/server.d.ts.map +1 -1
  669. package/dist/mcp/server.js +12 -7
  670. package/dist/mcp/server.js.map +1 -1
  671. package/dist/mcp/session-manager.d.ts.map +1 -1
  672. package/dist/mcp/session-manager.js +4 -3
  673. package/dist/mcp/session-manager.js.map +1 -1
  674. package/dist/mcp/sparc-modes.d.ts.map +1 -1
  675. package/dist/mcp/sparc-modes.js +15 -15
  676. package/dist/mcp/sparc-modes.js.map +1 -1
  677. package/dist/mcp/swarm-tools.d.ts.map +1 -1
  678. package/dist/mcp/swarm-tools.js +100 -80
  679. package/dist/mcp/swarm-tools.js.map +1 -1
  680. package/dist/mcp/tools.d.ts.map +1 -1
  681. package/dist/mcp/tools.js +28 -12
  682. package/dist/mcp/tools.js.map +1 -1
  683. package/dist/mcp/transports/base.d.ts.map +1 -1
  684. package/dist/mcp/transports/base.js +3 -0
  685. package/dist/mcp/transports/base.js.map +1 -1
  686. package/dist/mcp/transports/http.d.ts +3 -0
  687. package/dist/mcp/transports/http.d.ts.map +1 -1
  688. package/dist/mcp/transports/http.js +3 -3
  689. package/dist/mcp/transports/http.js.map +1 -1
  690. package/dist/mcp/transports/stdio.d.ts +3 -0
  691. package/dist/mcp/transports/stdio.d.ts.map +1 -1
  692. package/dist/mcp/transports/stdio.js +3 -0
  693. package/dist/mcp/transports/stdio.js.map +1 -1
  694. package/dist/memory/advanced-memory-manager.d.ts.map +1 -1
  695. package/dist/memory/advanced-memory-manager.js +109 -100
  696. package/dist/memory/advanced-memory-manager.js.map +1 -1
  697. package/dist/memory/backends/base.d.ts.map +1 -1
  698. package/dist/memory/backends/base.js +3 -0
  699. package/dist/memory/backends/base.js.map +1 -1
  700. package/dist/memory/backends/markdown.d.ts +3 -0
  701. package/dist/memory/backends/markdown.d.ts.map +1 -1
  702. package/dist/memory/backends/markdown.js +8 -8
  703. package/dist/memory/backends/markdown.js.map +1 -1
  704. package/dist/memory/backends/sqlite.d.ts +3 -0
  705. package/dist/memory/backends/sqlite.d.ts.map +1 -1
  706. package/dist/memory/backends/sqlite.js +6 -2
  707. package/dist/memory/backends/sqlite.js.map +1 -1
  708. package/dist/memory/cache.d.ts.map +1 -1
  709. package/dist/memory/cache.js +5 -3
  710. package/dist/memory/cache.js.map +1 -1
  711. package/dist/memory/distributed-memory.d.ts.map +1 -1
  712. package/dist/memory/distributed-memory.js +27 -28
  713. package/dist/memory/distributed-memory.js.map +1 -1
  714. package/dist/memory/fallback-store.d.ts.map +1 -1
  715. package/dist/memory/fallback-store.js.map +1 -1
  716. package/dist/memory/in-memory-store.d.ts.map +1 -1
  717. package/dist/memory/in-memory-store.js +8 -8
  718. package/dist/memory/in-memory-store.js.map +1 -1
  719. package/dist/memory/indexer.d.ts.map +1 -1
  720. package/dist/memory/indexer.js +4 -1
  721. package/dist/memory/indexer.js.map +1 -1
  722. package/dist/memory/manager.d.ts.map +1 -1
  723. package/dist/memory/manager.js +17 -20
  724. package/dist/memory/manager.js.map +1 -1
  725. package/dist/memory/sqlite-store.js +12 -8
  726. package/dist/memory/sqlite-store.js.map +1 -1
  727. package/dist/memory/swarm-memory.d.ts.map +1 -1
  728. package/dist/memory/swarm-memory.js +37 -44
  729. package/dist/memory/swarm-memory.js.map +1 -1
  730. package/dist/migration/index.d.ts +4 -0
  731. package/dist/migration/index.d.ts.map +1 -1
  732. package/dist/migration/index.js +8 -8
  733. package/dist/migration/index.js.map +1 -1
  734. package/dist/migration/logger.d.ts.map +1 -1
  735. package/dist/migration/logger.js +5 -5
  736. package/dist/migration/logger.js.map +1 -1
  737. package/dist/migration/migration-analyzer.d.ts +3 -0
  738. package/dist/migration/migration-analyzer.d.ts.map +1 -1
  739. package/dist/migration/migration-analyzer.js +25 -20
  740. package/dist/migration/migration-analyzer.js.map +1 -1
  741. package/dist/migration/migration-runner.d.ts.map +1 -1
  742. package/dist/migration/migration-runner.js +35 -29
  743. package/dist/migration/migration-runner.js.map +1 -1
  744. package/dist/migration/migration-validator.d.ts +3 -0
  745. package/dist/migration/migration-validator.d.ts.map +1 -1
  746. package/dist/migration/migration-validator.js +22 -26
  747. package/dist/migration/migration-validator.js.map +1 -1
  748. package/dist/migration/progress-reporter.d.ts +3 -0
  749. package/dist/migration/progress-reporter.d.ts.map +1 -1
  750. package/dist/migration/progress-reporter.js +8 -8
  751. package/dist/migration/progress-reporter.js.map +1 -1
  752. package/dist/migration/rollback-manager.d.ts +3 -0
  753. package/dist/migration/rollback-manager.d.ts.map +1 -1
  754. package/dist/migration/rollback-manager.js +29 -26
  755. package/dist/migration/rollback-manager.js.map +1 -1
  756. package/dist/monitoring/diagnostics.d.ts.map +1 -1
  757. package/dist/monitoring/diagnostics.js +49 -37
  758. package/dist/monitoring/diagnostics.js.map +1 -1
  759. package/dist/monitoring/health-check.d.ts.map +1 -1
  760. package/dist/monitoring/health-check.js +24 -25
  761. package/dist/monitoring/health-check.js.map +1 -1
  762. package/dist/monitoring/real-time-monitor.d.ts.map +1 -1
  763. package/dist/monitoring/real-time-monitor.js +71 -58
  764. package/dist/monitoring/real-time-monitor.js.map +1 -1
  765. package/dist/resources/resource-manager.d.ts.map +1 -1
  766. package/dist/resources/resource-manager.js +96 -83
  767. package/dist/resources/resource-manager.js.map +1 -1
  768. package/dist/swarm/claude-flow-executor.d.ts.map +1 -1
  769. package/dist/swarm/claude-flow-executor.js +37 -31
  770. package/dist/swarm/claude-flow-executor.js.map +1 -1
  771. package/dist/swarm/coordinator.d.ts.map +1 -1
  772. package/dist/swarm/coordinator.js +330 -280
  773. package/dist/swarm/coordinator.js.map +1 -1
  774. package/dist/swarm/direct-executor.d.ts.map +1 -1
  775. package/dist/swarm/direct-executor.js +44 -37
  776. package/dist/swarm/direct-executor.js.map +1 -1
  777. package/dist/swarm/executor-v2.d.ts.map +1 -1
  778. package/dist/swarm/executor-v2.js +28 -27
  779. package/dist/swarm/executor-v2.js.map +1 -1
  780. package/dist/swarm/executor.d.ts +3 -0
  781. package/dist/swarm/executor.d.ts.map +1 -1
  782. package/dist/swarm/executor.js +58 -52
  783. package/dist/swarm/executor.js.map +1 -1
  784. package/dist/swarm/index.d.ts.map +1 -1
  785. package/dist/swarm/index.js +2 -2
  786. package/dist/swarm/index.js.map +1 -1
  787. package/dist/swarm/json-output-aggregator.d.ts.map +1 -1
  788. package/dist/swarm/json-output-aggregator.js +20 -19
  789. package/dist/swarm/json-output-aggregator.js.map +1 -1
  790. package/dist/swarm/memory.d.ts.map +1 -1
  791. package/dist/swarm/memory.js +67 -67
  792. package/dist/swarm/memory.js.map +1 -1
  793. package/dist/swarm/optimizations/async-file-manager.d.ts +4 -0
  794. package/dist/swarm/optimizations/async-file-manager.d.ts.map +1 -1
  795. package/dist/swarm/optimizations/async-file-manager.js +19 -23
  796. package/dist/swarm/optimizations/async-file-manager.js.map +1 -1
  797. package/dist/swarm/optimizations/circular-buffer.d.ts.map +1 -1
  798. package/dist/swarm/optimizations/circular-buffer.js +2 -4
  799. package/dist/swarm/optimizations/circular-buffer.js.map +1 -1
  800. package/dist/swarm/optimizations/connection-pool.d.ts.map +1 -1
  801. package/dist/swarm/optimizations/connection-pool.js +12 -13
  802. package/dist/swarm/optimizations/connection-pool.js.map +1 -1
  803. package/dist/swarm/optimizations/index.js +2 -2
  804. package/dist/swarm/optimizations/optimized-executor.d.ts.map +1 -1
  805. package/dist/swarm/optimizations/optimized-executor.js +23 -29
  806. package/dist/swarm/optimizations/optimized-executor.js.map +1 -1
  807. package/dist/swarm/optimizations/ttl-map.d.ts.map +1 -1
  808. package/dist/swarm/optimizations/ttl-map.js +4 -4
  809. package/dist/swarm/optimizations/ttl-map.js.map +1 -1
  810. package/dist/swarm/prompt-cli.d.ts.map +1 -1
  811. package/dist/swarm/prompt-cli.js +18 -13
  812. package/dist/swarm/prompt-cli.js.map +1 -1
  813. package/dist/swarm/prompt-copier-enhanced.d.ts.map +1 -1
  814. package/dist/swarm/prompt-copier-enhanced.js +12 -12
  815. package/dist/swarm/prompt-copier-enhanced.js.map +1 -1
  816. package/dist/swarm/prompt-copier.d.ts.map +1 -1
  817. package/dist/swarm/prompt-copier.js +15 -18
  818. package/dist/swarm/prompt-copier.js.map +1 -1
  819. package/dist/swarm/prompt-manager.d.ts.map +1 -1
  820. package/dist/swarm/prompt-manager.js +27 -21
  821. package/dist/swarm/prompt-manager.js.map +1 -1
  822. package/dist/swarm/prompt-utils.d.ts.map +1 -1
  823. package/dist/swarm/prompt-utils.js +34 -32
  824. package/dist/swarm/prompt-utils.js.map +1 -1
  825. package/dist/swarm/sparc-executor.d.ts.map +1 -1
  826. package/dist/swarm/sparc-executor.js +189 -123
  827. package/dist/swarm/sparc-executor.js.map +1 -1
  828. package/dist/swarm/strategies/auto.d.ts.map +1 -1
  829. package/dist/swarm/strategies/auto.js +105 -86
  830. package/dist/swarm/strategies/auto.js.map +1 -1
  831. package/dist/swarm/strategies/base.d.ts.map +1 -1
  832. package/dist/swarm/strategies/base.js +14 -11
  833. package/dist/swarm/strategies/base.js.map +1 -1
  834. package/dist/swarm/strategies/research.d.ts.map +1 -1
  835. package/dist/swarm/strategies/research.js +76 -71
  836. package/dist/swarm/strategies/research.js.map +1 -1
  837. package/dist/swarm/types.d.ts.map +1 -1
  838. package/dist/swarm/types.js +3 -0
  839. package/dist/swarm/types.js.map +1 -1
  840. package/dist/swarm/workers/copy-worker.js +4 -4
  841. package/dist/swarm/workers/copy-worker.js.map +1 -1
  842. package/dist/task/commands.d.ts.map +1 -1
  843. package/dist/task/commands.js +11 -7
  844. package/dist/task/commands.js.map +1 -1
  845. package/dist/task/coordination.d.ts.map +1 -1
  846. package/dist/task/coordination.js +75 -70
  847. package/dist/task/coordination.js.map +1 -1
  848. package/dist/task/engine.d.ts.map +1 -1
  849. package/dist/task/engine.js +34 -32
  850. package/dist/task/engine.js.map +1 -1
  851. package/dist/task/index.d.ts +3 -3
  852. package/dist/task/index.d.ts.map +1 -1
  853. package/dist/task/index.js +11 -11
  854. package/dist/task/index.js.map +1 -1
  855. package/dist/terminal/adapters/native.d.ts.map +1 -1
  856. package/dist/terminal/adapters/native.js +6 -6
  857. package/dist/terminal/adapters/native.js.map +1 -1
  858. package/dist/terminal/adapters/vscode.d.ts +3 -0
  859. package/dist/terminal/adapters/vscode.d.ts.map +1 -1
  860. package/dist/terminal/adapters/vscode.js +6 -4
  861. package/dist/terminal/adapters/vscode.js.map +1 -1
  862. package/dist/terminal/manager.d.ts.map +1 -1
  863. package/dist/terminal/manager.js +6 -8
  864. package/dist/terminal/manager.js.map +1 -1
  865. package/dist/terminal/pool.d.ts.map +1 -1
  866. package/dist/terminal/pool.js +3 -0
  867. package/dist/terminal/pool.js.map +1 -1
  868. package/dist/terminal/session.d.ts.map +1 -1
  869. package/dist/terminal/session.js +6 -2
  870. package/dist/terminal/session.js.map +1 -1
  871. package/dist/ui/hive-dashboard.d.ts.map +1 -1
  872. package/dist/ui/hive-dashboard.js +52 -33
  873. package/dist/ui/hive-dashboard.js.map +1 -1
  874. package/dist/utils/error-handler.d.ts.map +1 -1
  875. package/dist/utils/error-handler.js +1 -1
  876. package/dist/utils/error-handler.js.map +1 -1
  877. package/dist/utils/errors.d.ts.map +1 -1
  878. package/dist/utils/errors.js.map +1 -1
  879. package/dist/utils/helpers.d.ts +3 -0
  880. package/dist/utils/helpers.d.ts.map +1 -1
  881. package/dist/utils/helpers.js +5 -8
  882. package/dist/utils/helpers.js.map +1 -1
  883. package/dist/utils/npx-isolated-cache.js +3 -3
  884. package/dist/utils/npx-isolated-cache.js.map +1 -1
  885. package/dist/utils/paths.d.ts.map +1 -1
  886. package/dist/utils/paths.js +8 -4
  887. package/dist/utils/paths.js.map +1 -1
  888. package/dist/utils/type-guards.d.ts +1 -1
  889. package/dist/utils/type-guards.d.ts.map +1 -1
  890. package/dist/utils/type-guards.js +11 -10
  891. package/dist/utils/type-guards.js.map +1 -1
  892. package/package.json +7 -6
  893. package/src/adapters/cliffy-node.ts +27 -22
  894. package/src/agents/agent-manager.ts +145 -121
  895. package/src/agents/agent-registry.ts +77 -70
  896. package/src/api/claude-client.ts +59 -38
  897. package/src/api/routes/analysis.js +750 -735
  898. package/src/cli/__tests__/command-registry.test.js +42 -32
  899. package/src/cli/__tests__/simple-cli.test.js +42 -37
  900. package/src/cli/__tests__/utils.test.js +9 -9
  901. package/src/cli/agents/README.md +30 -4
  902. package/src/cli/agents/analyst.ts +161 -163
  903. package/src/cli/agents/architect.ts +126 -131
  904. package/src/cli/agents/base-agent.ts +48 -47
  905. package/src/cli/agents/capabilities.ts +87 -85
  906. package/src/cli/agents/coder.ts +127 -120
  907. package/src/cli/agents/coordinator.ts +72 -72
  908. package/src/cli/agents/hive-agents.ts +96 -70
  909. package/src/cli/agents/index.ts +70 -55
  910. package/src/cli/agents/researcher.ts +63 -74
  911. package/src/cli/agents/tester.ts +91 -98
  912. package/src/cli/cli-core.ts +56 -47
  913. package/src/cli/command-registry.js +82 -83
  914. package/src/cli/commands/advanced-memory-commands.ts +210 -142
  915. package/src/cli/commands/agent-simple.ts +146 -114
  916. package/src/cli/commands/agent.ts +119 -95
  917. package/src/cli/commands/claude-api.ts +19 -15
  918. package/src/cli/commands/claude.ts +96 -88
  919. package/src/cli/commands/config-integration.ts +120 -101
  920. package/src/cli/commands/config.ts +10 -8
  921. package/src/cli/commands/enterprise.ts +323 -187
  922. package/src/cli/commands/help-new.ts +57 -55
  923. package/src/cli/commands/help.ts +162 -159
  924. package/src/cli/commands/hive-mind/index.ts +3 -3
  925. package/src/cli/commands/hive-mind/init.ts +19 -12
  926. package/src/cli/commands/hive-mind/optimize-memory.ts +83 -53
  927. package/src/cli/commands/hive-mind/pause.ts +27 -25
  928. package/src/cli/commands/hive-mind/ps.ts +43 -37
  929. package/src/cli/commands/hive-mind/resume.ts +26 -26
  930. package/src/cli/commands/hive-mind/spawn.ts +37 -29
  931. package/src/cli/commands/hive-mind/status.ts +51 -51
  932. package/src/cli/commands/hive-mind/stop.ts +56 -51
  933. package/src/cli/commands/hive-mind/task.ts +65 -54
  934. package/src/cli/commands/hive-mind/wizard.ts +181 -167
  935. package/src/cli/commands/hive.ts +136 -96
  936. package/src/cli/commands/hook-types.ts +2 -2
  937. package/src/cli/commands/hook-validator.ts +8 -4
  938. package/src/cli/commands/hook.ts +44 -42
  939. package/src/cli/commands/index.ts +1162 -1031
  940. package/src/cli/commands/mcp.ts +105 -94
  941. package/src/cli/commands/memory.ts +24 -21
  942. package/src/cli/commands/migrate.ts +24 -24
  943. package/src/cli/commands/monitor.ts +123 -93
  944. package/src/cli/commands/ruv-swarm.ts +131 -122
  945. package/src/cli/commands/session.ts +60 -45
  946. package/src/cli/commands/sparc.ts +170 -139
  947. package/src/cli/commands/start/event-emitter.ts +2 -2
  948. package/src/cli/commands/start/index.ts +1 -1
  949. package/src/cli/commands/start/process-manager.ts +30 -47
  950. package/src/cli/commands/start/process-ui-simple.ts +60 -49
  951. package/src/cli/commands/start/process-ui.ts +1 -1
  952. package/src/cli/commands/start/start-command.ts +104 -75
  953. package/src/cli/commands/start/system-monitor.ts +35 -41
  954. package/src/cli/commands/start/types.ts +3 -3
  955. package/src/cli/commands/start.ts +1 -1
  956. package/src/cli/commands/status.ts +67 -67
  957. package/src/cli/commands/swarm-spawn.ts +21 -12
  958. package/src/cli/commands/swarm.ts +221 -150
  959. package/src/cli/commands/task.ts +55 -55
  960. package/src/cli/commands/workflow.ts +174 -157
  961. package/src/cli/completion.ts +34 -19
  962. package/src/cli/create-enhanced-task.js +49 -17
  963. package/src/cli/formatter.ts +38 -37
  964. package/src/cli/help-formatter.js +23 -33
  965. package/src/cli/help-formatter.ts +24 -34
  966. package/src/cli/help-text.js +69 -60
  967. package/src/cli/index-remote.ts +12 -9
  968. package/src/cli/index.ts +77 -67
  969. package/src/cli/init/batch-tools.ts +4 -5
  970. package/src/cli/init/claude-config.ts +125 -118
  971. package/src/cli/init/directory-structure.ts +10 -11
  972. package/src/cli/init/index.ts +13 -13
  973. package/src/cli/init/sparc-environment.ts +90 -74
  974. package/src/cli/init/swarm-commands.ts +5 -6
  975. package/src/cli/init/utils.ts +1 -1
  976. package/src/cli/main.ts +9 -10
  977. package/src/cli/node-compat.js +26 -19
  978. package/src/cli/node-repl.ts +104 -87
  979. package/src/cli/repl.ts +190 -158
  980. package/src/cli/runtime-detector.js +24 -19
  981. package/src/cli/simple-cli.js +460 -385
  982. package/src/cli/simple-cli.ts +426 -366
  983. package/src/cli/simple-commands/__tests__/agent.test.js +49 -55
  984. package/src/cli/simple-commands/__tests__/memory.test.js +4 -401
  985. package/src/cli/simple-commands/__tests__/swarm.test.js +49 -55
  986. package/src/cli/simple-commands/__tests__/task.test.js +4 -478
  987. package/src/cli/simple-commands/agent.js +27 -27
  988. package/src/cli/simple-commands/analysis.js +179 -161
  989. package/src/cli/simple-commands/automation.js +226 -205
  990. package/src/cli/simple-commands/batch-manager.js +98 -88
  991. package/src/cli/simple-commands/config.js +65 -60
  992. package/src/cli/simple-commands/coordination.js +197 -185
  993. package/src/cli/simple-commands/enhanced-ui-views.js +142 -115
  994. package/src/cli/simple-commands/enhanced-webui-complete.js +267 -167
  995. package/src/cli/simple-commands/fix-hook-variables.js +73 -67
  996. package/src/cli/simple-commands/github/gh-coordinator.js +63 -53
  997. package/src/cli/simple-commands/github/github-api.js +45 -47
  998. package/src/cli/simple-commands/github.js +33 -34
  999. package/src/cli/simple-commands/hive-mind/auto-save-middleware.js +44 -40
  1000. package/src/cli/simple-commands/hive-mind/communication.js +198 -185
  1001. package/src/cli/simple-commands/hive-mind/core.js +289 -304
  1002. package/src/cli/simple-commands/hive-mind/db-optimizer.js +278 -168
  1003. package/src/cli/simple-commands/hive-mind/mcp-wrapper.js +352 -258
  1004. package/src/cli/simple-commands/hive-mind/memory.js +356 -287
  1005. package/src/cli/simple-commands/hive-mind/performance-optimizer.js +88 -79
  1006. package/src/cli/simple-commands/hive-mind/performance-test.js +61 -49
  1007. package/src/cli/simple-commands/hive-mind/queen.js +223 -213
  1008. package/src/cli/simple-commands/hive-mind/session-manager.js +217 -157
  1009. package/src/cli/simple-commands/hive-mind-optimize.js +69 -65
  1010. package/src/cli/simple-commands/hive-mind-wizard.js +213 -211
  1011. package/src/cli/simple-commands/hive-mind.js +598 -432
  1012. package/src/cli/simple-commands/hive.js +12 -12
  1013. package/src/cli/simple-commands/hook-safety.js +114 -111
  1014. package/src/cli/simple-commands/hooks.js +1077 -1017
  1015. package/src/cli/simple-commands/init/README.md +8 -1
  1016. package/src/cli/simple-commands/init/VALIDATION_ROLLBACK.md +27 -1
  1017. package/src/cli/simple-commands/init/batch-init.js +105 -100
  1018. package/src/cli/simple-commands/init/claude-commands/claude-flow-commands.js +6 -6
  1019. package/src/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +6 -6
  1020. package/src/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +20 -18
  1021. package/src/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +85 -71
  1022. package/src/cli/simple-commands/init/claude-commands/slash-commands.js +6 -7
  1023. package/src/cli/simple-commands/init/claude-commands/sparc-commands.js +42 -33
  1024. package/src/cli/simple-commands/init/executable-wrapper.js +13 -10
  1025. package/src/cli/simple-commands/init/gitignore-updater.js +22 -22
  1026. package/src/cli/simple-commands/init/help.js +4 -2
  1027. package/src/cli/simple-commands/init/index.js +405 -303
  1028. package/src/cli/simple-commands/init/performance-monitor.js +71 -64
  1029. package/src/cli/simple-commands/init/rollback/backup-manager.js +44 -64
  1030. package/src/cli/simple-commands/init/rollback/index.js +31 -39
  1031. package/src/cli/simple-commands/init/rollback/recovery-manager.js +71 -101
  1032. package/src/cli/simple-commands/init/rollback/rollback-executor.js +34 -53
  1033. package/src/cli/simple-commands/init/rollback/state-tracker.js +38 -49
  1034. package/src/cli/simple-commands/init/sparc/roo-readme.js +1 -1
  1035. package/src/cli/simple-commands/init/sparc/roomodes-config.js +99 -77
  1036. package/src/cli/simple-commands/init/sparc/workflows.js +37 -33
  1037. package/src/cli/simple-commands/init/sparc-structure.js +9 -10
  1038. package/src/cli/simple-commands/init/templates/CLAUDE.md +94 -26
  1039. package/src/cli/simple-commands/init/templates/claude-flow-universal +9 -7
  1040. package/src/cli/simple-commands/init/templates/claude-md.js +1 -1
  1041. package/src/cli/simple-commands/init/templates/commands/analysis/bottleneck-detect.md +15 -3
  1042. package/src/cli/simple-commands/init/templates/commands/automation/auto-agent.md +12 -2
  1043. package/src/cli/simple-commands/init/templates/commands/coordination/swarm-init.md +10 -1
  1044. package/src/cli/simple-commands/init/templates/commands/github/github-swarm.md +18 -5
  1045. package/src/cli/simple-commands/init/templates/commands/hooks/notification.md +12 -1
  1046. package/src/cli/simple-commands/init/templates/commands/hooks/post-command.md +12 -1
  1047. package/src/cli/simple-commands/init/templates/commands/hooks/post-edit.md +12 -1
  1048. package/src/cli/simple-commands/init/templates/commands/hooks/post-task.md +12 -1
  1049. package/src/cli/simple-commands/init/templates/commands/hooks/pre-command.md +12 -1
  1050. package/src/cli/simple-commands/init/templates/commands/hooks/pre-edit.md +12 -1
  1051. package/src/cli/simple-commands/init/templates/commands/hooks/pre-search.md +13 -6
  1052. package/src/cli/simple-commands/init/templates/commands/hooks/pre-task.md +12 -1
  1053. package/src/cli/simple-commands/init/templates/commands/hooks/session-end.md +12 -1
  1054. package/src/cli/simple-commands/init/templates/commands/hooks/session-restore.md +13 -5
  1055. package/src/cli/simple-commands/init/templates/commands/hooks/session-start.md +12 -1
  1056. package/src/cli/simple-commands/init/templates/coordination-md.js +1 -1
  1057. package/src/cli/simple-commands/init/templates/enhanced-templates.js +116 -113
  1058. package/src/cli/simple-commands/init/templates/memory-bank-md.js +1 -1
  1059. package/src/cli/simple-commands/init/templates/readme-files.js +1 -1
  1060. package/src/cli/simple-commands/init/templates/safe-hook-patterns.js +176 -127
  1061. package/src/cli/simple-commands/init/templates/settings.json +2 -5
  1062. package/src/cli/simple-commands/init/templates/sparc-modes.js +3 -3
  1063. package/src/cli/simple-commands/init/validation/config-validator.js +17 -28
  1064. package/src/cli/simple-commands/init/validation/health-checker.js +54 -62
  1065. package/src/cli/simple-commands/init/validation/index.js +18 -23
  1066. package/src/cli/simple-commands/init/validation/mode-validator.js +22 -32
  1067. package/src/cli/simple-commands/init/validation/post-init-validator.js +25 -26
  1068. package/src/cli/simple-commands/init/validation/pre-init-validator.js +32 -36
  1069. package/src/cli/simple-commands/init/validation/test-runner.js +55 -63
  1070. package/src/cli/simple-commands/init.js +1 -1
  1071. package/src/cli/simple-commands/mcp-integration-layer.js +179 -110
  1072. package/src/cli/simple-commands/mcp.js +55 -48
  1073. package/src/cli/simple-commands/memory.js +62 -56
  1074. package/src/cli/simple-commands/migrate-hooks.js +9 -10
  1075. package/src/cli/simple-commands/monitor.js +87 -67
  1076. package/src/cli/simple-commands/process-ui-enhanced.js +207 -155
  1077. package/src/cli/simple-commands/process-ui.js +65 -56
  1078. package/src/cli/simple-commands/realtime-update-system.js +136 -129
  1079. package/src/cli/simple-commands/sparc/architecture.js +352 -251
  1080. package/src/cli/simple-commands/sparc/commands.js +122 -94
  1081. package/src/cli/simple-commands/sparc/completion.js +274 -199
  1082. package/src/cli/simple-commands/sparc/coordinator.js +217 -169
  1083. package/src/cli/simple-commands/sparc/index.js +40 -36
  1084. package/src/cli/simple-commands/sparc/phase-base.js +72 -58
  1085. package/src/cli/simple-commands/sparc/pseudocode.js +275 -159
  1086. package/src/cli/simple-commands/sparc/refinement.js +306 -212
  1087. package/src/cli/simple-commands/sparc/specification.js +164 -94
  1088. package/src/cli/simple-commands/sparc-modes/architect.js +1 -1
  1089. package/src/cli/simple-commands/sparc-modes/ask.js +1 -1
  1090. package/src/cli/simple-commands/sparc-modes/code.js +1 -1
  1091. package/src/cli/simple-commands/sparc-modes/debug.js +1 -1
  1092. package/src/cli/simple-commands/sparc-modes/devops.js +1 -1
  1093. package/src/cli/simple-commands/sparc-modes/docs-writer.js +1 -1
  1094. package/src/cli/simple-commands/sparc-modes/generic.js +1 -1
  1095. package/src/cli/simple-commands/sparc-modes/index.js +15 -15
  1096. package/src/cli/simple-commands/sparc-modes/integration.js +1 -1
  1097. package/src/cli/simple-commands/sparc-modes/mcp.js +1 -1
  1098. package/src/cli/simple-commands/sparc-modes/monitoring.js +1 -1
  1099. package/src/cli/simple-commands/sparc-modes/optimization.js +1 -1
  1100. package/src/cli/simple-commands/sparc-modes/security-review.js +1 -1
  1101. package/src/cli/simple-commands/sparc-modes/sparc-orchestrator.js +1 -1
  1102. package/src/cli/simple-commands/sparc-modes/spec-pseudocode.js +1 -1
  1103. package/src/cli/simple-commands/sparc-modes/supabase-admin.js +1 -1
  1104. package/src/cli/simple-commands/sparc-modes/swarm.js +52 -52
  1105. package/src/cli/simple-commands/sparc-modes/tdd.js +1 -1
  1106. package/src/cli/simple-commands/sparc-modes/tutorial.js +1 -1
  1107. package/src/cli/simple-commands/sparc.js +87 -69
  1108. package/src/cli/simple-commands/start-ui.js +21 -20
  1109. package/src/cli/simple-commands/start-wrapper.js +29 -31
  1110. package/src/cli/simple-commands/start.js +1 -1
  1111. package/src/cli/simple-commands/status.js +53 -47
  1112. package/src/cli/simple-commands/swarm-executor.js +47 -57
  1113. package/src/cli/simple-commands/swarm-metrics-integration.js +119 -79
  1114. package/src/cli/simple-commands/swarm-ui.js +120 -118
  1115. package/src/cli/simple-commands/swarm-webui-integration.js +48 -27
  1116. package/src/cli/simple-commands/swarm.js +216 -181
  1117. package/src/cli/simple-commands/task.js +29 -29
  1118. package/src/cli/simple-commands/timestamp-fix.js +28 -25
  1119. package/src/cli/simple-commands/tool-execution-framework.js +115 -118
  1120. package/src/cli/simple-commands/training.js +219 -194
  1121. package/src/cli/simple-commands/web-server.js +118 -117
  1122. package/src/cli/simple-commands/webui-validator.js +4 -3
  1123. package/src/cli/simple-mcp.ts +14 -17
  1124. package/src/cli/simple-orchestrator.ts +113 -101
  1125. package/src/cli/swarm-standalone.js +20 -21
  1126. package/src/cli/ui/compatible-ui.ts +55 -44
  1127. package/src/cli/ui/fallback-handler.ts +19 -16
  1128. package/src/cli/ui/index.ts +14 -15
  1129. package/src/cli/utils/environment-detector.ts +75 -67
  1130. package/src/cli/utils/interactive-detector.js +17 -11
  1131. package/src/cli/utils/prompt-defaults.ts +32 -28
  1132. package/src/cli/utils/safe-interactive.js +21 -20
  1133. package/src/cli/utils.js +127 -110
  1134. package/src/cli/validation-helper.js +16 -21
  1135. package/src/cli/validation-helper.ts +21 -34
  1136. package/src/communication/message-bus.ts +137 -124
  1137. package/src/config/config-manager.ts +62 -30
  1138. package/src/config/ruv-swarm-config.ts +105 -86
  1139. package/src/config/ruv-swarm-integration.ts +38 -38
  1140. package/src/constants/agent-types.ts +9 -8
  1141. package/src/coordination/README.md +54 -31
  1142. package/src/coordination/advanced-scheduler.ts +23 -26
  1143. package/src/coordination/advanced-task-executor.ts +74 -68
  1144. package/src/coordination/background-executor.ts +33 -30
  1145. package/src/coordination/circuit-breaker.ts +26 -27
  1146. package/src/coordination/conflict-resolution.ts +18 -27
  1147. package/src/coordination/dependency-graph.ts +15 -18
  1148. package/src/coordination/hive-orchestrator.ts +111 -81
  1149. package/src/coordination/hive-protocol.ts +68 -77
  1150. package/src/coordination/index.ts +3 -7
  1151. package/src/coordination/load-balancer.ts +115 -105
  1152. package/src/coordination/manager.ts +38 -51
  1153. package/src/coordination/messaging.ts +19 -29
  1154. package/src/coordination/metrics.ts +57 -60
  1155. package/src/coordination/resources.ts +32 -37
  1156. package/src/coordination/scheduler.ts +29 -30
  1157. package/src/coordination/swarm-coordinator.ts +81 -70
  1158. package/src/coordination/swarm-monitor.ts +90 -69
  1159. package/src/coordination/work-stealing.ts +6 -13
  1160. package/src/core/config.ts +148 -143
  1161. package/src/core/event-bus.ts +5 -6
  1162. package/src/core/json-persistence.ts +27 -34
  1163. package/src/core/logger.ts +13 -16
  1164. package/src/core/orchestrator-fixed.ts +33 -32
  1165. package/src/core/orchestrator.ts +166 -159
  1166. package/src/core/persistence.ts +47 -36
  1167. package/src/enterprise/analytics-manager.ts +242 -233
  1168. package/src/enterprise/audit-manager.ts +238 -184
  1169. package/src/enterprise/cloud-manager.ts +167 -151
  1170. package/src/enterprise/deployment-manager.ts +223 -180
  1171. package/src/enterprise/index.ts +7 -7
  1172. package/src/enterprise/project-manager.ts +151 -133
  1173. package/src/enterprise/security-manager.ts +278 -223
  1174. package/src/hive-mind/core/Agent.ts +112 -109
  1175. package/src/hive-mind/core/Communication.ts +67 -69
  1176. package/src/hive-mind/core/DatabaseManager.ts +299 -166
  1177. package/src/hive-mind/core/HiveMind.ts +100 -96
  1178. package/src/hive-mind/core/Memory.ts +304 -295
  1179. package/src/hive-mind/core/MemoryMonitor.ts +46 -47
  1180. package/src/hive-mind/core/Queen.ts +187 -114
  1181. package/src/hive-mind/index.ts +2 -2
  1182. package/src/hive-mind/integration/ConsensusEngine.ts +88 -92
  1183. package/src/hive-mind/integration/MCPToolWrapper.ts +20 -72
  1184. package/src/hive-mind/integration/SwarmOrchestrator.ts +173 -165
  1185. package/src/hive-mind/types.ts +24 -12
  1186. package/src/integration/mock-components.ts +42 -30
  1187. package/src/integration/system-integration.ts +79 -78
  1188. package/src/integration/types.ts +7 -7
  1189. package/src/mcp/README.md +23 -4
  1190. package/src/mcp/auth.ts +25 -18
  1191. package/src/mcp/claude-code-wrapper.ts +257 -150
  1192. package/src/mcp/claude-flow-tools.ts +52 -13
  1193. package/src/mcp/client.ts +15 -13
  1194. package/src/mcp/index.ts +22 -27
  1195. package/src/mcp/integrate-wrapper.ts +18 -18
  1196. package/src/mcp/lifecycle-manager.ts +30 -27
  1197. package/src/mcp/load-balancer.ts +10 -11
  1198. package/src/mcp/mcp-server.js +662 -351
  1199. package/src/mcp/orchestration-integration.ts +32 -17
  1200. package/src/mcp/performance-monitor.ts +65 -51
  1201. package/src/mcp/protocol-manager.ts +36 -52
  1202. package/src/mcp/recovery/connection-health-monitor.ts +40 -35
  1203. package/src/mcp/recovery/connection-state-manager.ts +52 -50
  1204. package/src/mcp/recovery/fallback-coordinator.ts +24 -24
  1205. package/src/mcp/recovery/index.ts +23 -4
  1206. package/src/mcp/recovery/reconnection-manager.ts +14 -15
  1207. package/src/mcp/recovery/recovery-manager.ts +52 -68
  1208. package/src/mcp/router.ts +1 -2
  1209. package/src/mcp/ruv-swarm-tools.ts +167 -138
  1210. package/src/mcp/ruv-swarm-wrapper.js +31 -23
  1211. package/src/mcp/server-with-wrapper.ts +4 -5
  1212. package/src/mcp/server-wrapper-mode.ts +5 -6
  1213. package/src/mcp/server.ts +45 -40
  1214. package/src/mcp/session-manager.ts +8 -11
  1215. package/src/mcp/sparc-modes.ts +29 -28
  1216. package/src/mcp/swarm-tools.ts +131 -114
  1217. package/src/mcp/tests/mcp-integration.test.ts +49 -55
  1218. package/src/mcp/tools.ts +53 -38
  1219. package/src/mcp/transports/base.ts +4 -5
  1220. package/src/mcp/transports/http.ts +45 -42
  1221. package/src/mcp/transports/stdio.ts +9 -12
  1222. package/src/memory/README.md +37 -27
  1223. package/src/memory/advanced-memory-manager.ts +336 -279
  1224. package/src/memory/backends/base.ts +4 -5
  1225. package/src/memory/backends/markdown.ts +16 -22
  1226. package/src/memory/backends/sqlite.ts +19 -15
  1227. package/src/memory/cache.ts +18 -18
  1228. package/src/memory/distributed-memory.ts +84 -92
  1229. package/src/memory/enhanced-examples.js +68 -59
  1230. package/src/memory/enhanced-memory.js +99 -80
  1231. package/src/memory/fallback-store.js +16 -7
  1232. package/src/memory/in-memory-store.js +31 -27
  1233. package/src/memory/index.js +4 -4
  1234. package/src/memory/indexer.ts +6 -10
  1235. package/src/memory/manager.ts +45 -59
  1236. package/src/memory/migration.js +107 -90
  1237. package/src/memory/shared-memory.js +155 -157
  1238. package/src/memory/sqlite-store.js +76 -59
  1239. package/src/memory/swarm-memory.js +138 -131
  1240. package/src/memory/swarm-memory.ts +74 -75
  1241. package/src/memory/test-example.js +28 -30
  1242. package/src/migration/README.md +25 -9
  1243. package/src/migration/index.ts +13 -14
  1244. package/src/migration/logger.ts +9 -7
  1245. package/src/migration/migration-analyzer.ts +66 -52
  1246. package/src/migration/migration-manifest.json +2 -6
  1247. package/src/migration/migration-runner.ts +86 -63
  1248. package/src/migration/migration-validator.ts +93 -68
  1249. package/src/migration/package.json +1 -1
  1250. package/src/migration/progress-reporter.ts +25 -21
  1251. package/src/migration/rollback-manager.ts +79 -63
  1252. package/src/migration/tests/migration-system.test.ts +4 -491
  1253. package/src/migration/tsconfig.json +3 -10
  1254. package/src/migration/types.ts +1 -1
  1255. package/src/monitoring/diagnostics.ts +123 -97
  1256. package/src/monitoring/health-check.ts +45 -51
  1257. package/src/monitoring/real-time-monitor.ts +105 -92
  1258. package/src/resources/resource-manager.ts +205 -159
  1259. package/src/swarm/__tests__/integration.test.ts +59 -65
  1260. package/src/swarm/__tests__/prompt-copier.test.ts +27 -27
  1261. package/src/swarm/claude-flow-executor.ts +50 -49
  1262. package/src/swarm/coordinator.ts +727 -635
  1263. package/src/swarm/direct-executor.ts +80 -86
  1264. package/src/swarm/executor-v2.ts +81 -66
  1265. package/src/swarm/executor.ts +124 -124
  1266. package/src/swarm/index.ts +7 -8
  1267. package/src/swarm/json-output-aggregator.ts +56 -40
  1268. package/src/swarm/memory.ts +152 -147
  1269. package/src/swarm/optimizations/README.md +20 -12
  1270. package/src/swarm/optimizations/__tests__/optimization.test.ts +84 -87
  1271. package/src/swarm/optimizations/async-file-manager.ts +70 -80
  1272. package/src/swarm/optimizations/circular-buffer.ts +37 -37
  1273. package/src/swarm/optimizations/connection-pool.ts +64 -64
  1274. package/src/swarm/optimizations/index.ts +4 -4
  1275. package/src/swarm/optimizations/migration-guide.md +27 -16
  1276. package/src/swarm/optimizations/optimized-executor.ts +104 -114
  1277. package/src/swarm/optimizations/ttl-map.ts +66 -63
  1278. package/src/swarm/prompt-cli.ts +48 -42
  1279. package/src/swarm/prompt-copier-enhanced.ts +54 -55
  1280. package/src/swarm/prompt-copier.ts +59 -65
  1281. package/src/swarm/prompt-copying-README.md +49 -33
  1282. package/src/swarm/prompt-manager.ts +69 -63
  1283. package/src/swarm/prompt-utils.ts +71 -66
  1284. package/src/swarm/sparc-executor.ts +298 -225
  1285. package/src/swarm/strategies/auto.ts +367 -252
  1286. package/src/swarm/strategies/base.ts +24 -20
  1287. package/src/swarm/strategies/research.ts +144 -124
  1288. package/src/swarm/types.ts +340 -309
  1289. package/src/swarm/workers/copy-worker.ts +12 -13
  1290. package/src/task/README.md +99 -70
  1291. package/src/task/commands.ts +16 -8
  1292. package/src/task/coordination.ts +209 -162
  1293. package/src/task/engine.ts +81 -65
  1294. package/src/task/index.ts +28 -31
  1295. package/src/templates/claude-optimized/.claude/BATCHTOOLS_BEST_PRACTICES.md +479 -481
  1296. package/src/templates/claude-optimized/.claude/BATCHTOOLS_GUIDE.md +210 -188
  1297. package/src/templates/claude-optimized/.claude/MIGRATION_GUIDE.md +151 -105
  1298. package/src/templates/claude-optimized/.claude/PERFORMANCE_BENCHMARKS.md +102 -87
  1299. package/src/templates/claude-optimized/.claude/commands/claude-flow-help.md +18 -1
  1300. package/src/templates/claude-optimized/.claude/commands/claude-flow-memory.md +17 -1
  1301. package/src/templates/claude-optimized/.claude/commands/claude-flow-swarm.md +21 -1
  1302. package/src/templates/claude-optimized/.claude/commands/sparc/architect.md +11 -4
  1303. package/src/templates/claude-optimized/.claude/commands/sparc/ask.md +16 -10
  1304. package/src/templates/claude-optimized/.claude/commands/sparc/code.md +26 -7
  1305. package/src/templates/claude-optimized/.claude/commands/sparc/debug.md +14 -4
  1306. package/src/templates/claude-optimized/.claude/commands/sparc/devops.md +23 -10
  1307. package/src/templates/claude-optimized/.claude/commands/sparc/docs-writer.md +8 -4
  1308. package/src/templates/claude-optimized/.claude/commands/sparc/integration.md +43 -27
  1309. package/src/templates/claude-optimized/.claude/commands/sparc/mcp.md +15 -1
  1310. package/src/templates/claude-optimized/.claude/commands/sparc/post-deployment-monitoring-mode.md +45 -30
  1311. package/src/templates/claude-optimized/.claude/commands/sparc/refinement-optimization-mode.md +23 -13
  1312. package/src/templates/claude-optimized/.claude/commands/sparc/security-review.md +31 -17
  1313. package/src/templates/claude-optimized/.claude/commands/sparc/sparc.md +54 -47
  1314. package/src/templates/claude-optimized/.claude/commands/sparc/spec-pseudocode.md +27 -17
  1315. package/src/templates/claude-optimized/.claude/commands/sparc/supabase-admin.md +18 -4
  1316. package/src/templates/claude-optimized/.claude/commands/sparc/tdd.md +23 -9
  1317. package/src/templates/claude-optimized/.claude/commands/sparc/tutorial.md +22 -16
  1318. package/src/templates/claude-optimized/.claude/commands/sparc.md +20 -1
  1319. package/src/templates/claude-optimized/README.md +10 -1
  1320. package/src/templates/claude-optimized/SUMMARY.md +23 -1
  1321. package/src/templates/claude-optimized/deploy-to-project.js +22 -10
  1322. package/src/templates/claude-optimized/install-template.js +14 -10
  1323. package/src/templates/claude-optimized/manifest.json +1 -1
  1324. package/src/templates/claude-optimized/package.json +1 -1
  1325. package/src/templates/claude-optimized/template-manager.js +8 -8
  1326. package/src/templates/claude-optimized/validate-template.js +33 -23
  1327. package/src/terminal/adapters/base.ts +1 -1
  1328. package/src/terminal/adapters/native.ts +47 -47
  1329. package/src/terminal/adapters/vscode.ts +21 -28
  1330. package/src/terminal/manager.ts +27 -22
  1331. package/src/terminal/pool.ts +24 -27
  1332. package/src/terminal/session.ts +18 -18
  1333. package/src/terminal/vscode-bridge.ts +21 -21
  1334. package/src/tests/validation-consistency.test.ts +4 -4
  1335. package/src/types/cliffy.d.ts +11 -14
  1336. package/src/types/global.d.ts +1 -2
  1337. package/src/types/index.ts +2 -2
  1338. package/src/types/mcp.d.ts +11 -17
  1339. package/src/types/vscode.d.ts +18 -5
  1340. package/src/ui/console/README-analysis-tools.md +52 -2
  1341. package/src/ui/console/README.md +33 -1
  1342. package/src/ui/console/WORKFLOW_DESIGNER_README.md +81 -22
  1343. package/src/ui/console/analysis-tools.html +282 -261
  1344. package/src/ui/console/analytics.html +329 -326
  1345. package/src/ui/console/index.html +221 -209
  1346. package/src/ui/console/js/analysis-tools.js +815 -754
  1347. package/src/ui/console/js/command-handler.js +226 -196
  1348. package/src/ui/console/js/console.js +117 -119
  1349. package/src/ui/console/js/daa-tools.js +797 -787
  1350. package/src/ui/console/js/memory-interface.js +676 -638
  1351. package/src/ui/console/js/memory-test.js +49 -46
  1352. package/src/ui/console/js/memory-tools.js +181 -159
  1353. package/src/ui/console/js/settings.js +124 -103
  1354. package/src/ui/console/js/terminal-emulator.js +147 -130
  1355. package/src/ui/console/js/websocket-client.js +71 -71
  1356. package/src/ui/console/js/workflow-designer.js +1126 -1110
  1357. package/src/ui/console/neural-networks-demo.md +45 -16
  1358. package/src/ui/console/styles/analysis-tools.css +571 -561
  1359. package/src/ui/console/styles/console.css +16 -12
  1360. package/src/ui/console/styles/daa-tools.css +322 -319
  1361. package/src/ui/console/styles/responsive.css +71 -70
  1362. package/src/ui/console/styles/settings.css +12 -12
  1363. package/src/ui/console/styles/workflow-designer.css +628 -584
  1364. package/src/ui/console/test-neural-networks.js +59 -54
  1365. package/src/ui/console/test-neural.html +194 -196
  1366. package/src/ui/console/workflow-designer-demo.html +433 -424
  1367. package/src/ui/hive-dashboard.ts +74 -52
  1368. package/src/ui/web-ui/EnhancedProcessUI.js +570 -424
  1369. package/src/ui/web-ui/EnhancedWebUI.js +65 -65
  1370. package/src/ui/web-ui/README.md +16 -16
  1371. package/src/ui/web-ui/components/ComponentLibrary.js +173 -124
  1372. package/src/ui/web-ui/core/EventBus.js +27 -25
  1373. package/src/ui/web-ui/core/MCPIntegrationLayer.js +294 -108
  1374. package/src/ui/web-ui/core/StateManager.js +43 -46
  1375. package/src/ui/web-ui/core/UIManager.js +120 -70
  1376. package/src/ui/web-ui/core/ViewManager.js +16 -19
  1377. package/src/ui/web-ui/index.js +101 -48
  1378. package/src/ui/web-ui/neural-panel-test.js +109 -108
  1379. package/src/ui/web-ui/test-github-view.js +11 -12
  1380. package/src/ui/web-ui/test-neural-panel.html +219 -205
  1381. package/src/ui/web-ui/views/DAAView.js +88 -85
  1382. package/src/ui/web-ui/views/GitHubIntegrationTest.js +42 -42
  1383. package/src/ui/web-ui/views/GitHubIntegrationView.js +59 -53
  1384. package/src/ui/web-ui/views/NeuralNetworkView.js +20 -21
  1385. package/src/ui/web-ui/views/WorkflowAutomationView.js +31 -32
  1386. package/src/utils/error-handler.js +1 -1
  1387. package/src/utils/error-handler.ts +9 -5
  1388. package/src/utils/errors.ts +20 -18
  1389. package/src/utils/formatters.ts +6 -6
  1390. package/src/utils/helpers.ts +53 -55
  1391. package/src/utils/npx-isolated-cache.js +16 -16
  1392. package/src/utils/paths.ts +9 -6
  1393. package/src/utils/timezone-utils.js +16 -16
  1394. package/src/utils/type-guards.ts +37 -26
  1395. package/src/utils/types.ts +2 -2
@@ -4,306 +4,306 @@
4
4
  */
5
5
 
6
6
  class DAATools {
7
- constructor() {
8
- this.agents = new Map();
9
- this.resources = new Map();
10
- this.communications = new Map();
11
- this.consensus = new Map();
12
- this.isInitialized = false;
13
- this.currentTab = 'agents';
14
-
15
- // Performance metrics
16
- this.metrics = {
17
- totalAgents: 0,
18
- activeAgents: 0,
19
- resourceUtilization: 0,
20
- communicationLatency: 0,
21
- consensusTime: 0,
22
- faultCount: 0
23
- };
24
-
25
- this.init();
26
- }
27
-
28
- init() {
29
- if (this.isInitialized) return;
30
-
31
- this.createDAAPanel();
32
- this.setupEventListeners();
33
- this.initializeMonitoring();
34
- this.isInitialized = true;
35
-
36
- console.log('DAA Tools initialized');
37
- }
38
-
39
- // Tool 1: Dynamic Agent Creation
40
- daa_agent_create(config) {
41
- const agentId = this.generateAgentId();
42
- const agent = {
43
- id: agentId,
44
- type: config.type || 'generic',
45
- capabilities: config.capabilities || [],
46
- resources: config.resources || {},
47
- status: 'initializing',
48
- created: Date.now(),
49
- lastActivity: Date.now(),
50
- tasks: [],
51
- metadata: config.metadata || {}
52
- };
53
-
54
- this.agents.set(agentId, agent);
55
- this.metrics.totalAgents++;
56
- this.metrics.activeAgents++;
57
-
58
- // Lifecycle management
59
- this.initializeAgent(agent);
60
-
61
- // Update UI
62
- this.updateAgentsList();
63
- this.updateMetrics();
64
-
65
- return {
66
- success: true,
67
- agentId: agentId,
68
- agent: agent
69
- };
70
- }
71
-
72
- // Tool 2: Capability Matching System
73
- daa_capability_match(requirements) {
74
- const matches = [];
75
-
76
- for (const [agentId, agent] of this.agents) {
77
- if (agent.status !== 'active') continue;
78
-
79
- const score = this.calculateCapabilityScore(agent.capabilities, requirements);
80
- if (score > 0) {
81
- matches.push({
82
- agentId,
83
- agent,
84
- score,
85
- availableCapabilities: agent.capabilities.filter(cap =>
86
- requirements.some(req => this.matchCapability(cap, req))
87
- )
88
- });
89
- }
90
- }
91
-
92
- // Sort by score descending
93
- matches.sort((a, b) => b.score - a.score);
94
-
95
- this.updateCapabilityMatches(matches);
96
-
97
- return {
98
- success: true,
99
- matches: matches,
100
- totalCandidates: matches.length
101
- };
102
- }
103
-
104
- // Tool 3: Resource Allocation Management
105
- daa_resource_alloc(allocation) {
106
- const resourceId = this.generateResourceId();
107
- const resource = {
108
- id: resourceId,
109
- type: allocation.type,
110
- capacity: allocation.capacity,
111
- allocated: 0,
112
- assignments: new Map(),
113
- priority: allocation.priority || 'medium',
114
- created: Date.now(),
115
- metadata: allocation.metadata || {}
116
- };
117
-
118
- this.resources.set(resourceId, resource);
119
-
120
- // Perform allocation
121
- const allocationResult = this.allocateResource(resource, allocation);
122
-
123
- // Update visualizations
124
- this.updateResourceGraphs();
125
- this.updateMetrics();
126
-
127
- return {
128
- success: allocationResult.success,
129
- resourceId: resourceId,
130
- allocation: allocationResult,
131
- utilization: this.calculateResourceUtilization()
132
- };
133
- }
134
-
135
- // Tool 4: Agent Lifecycle Management
136
- daa_lifecycle_manage(agentId, action, params = {}) {
137
- const agent = this.agents.get(agentId);
138
- if (!agent) {
139
- return { success: false, error: 'Agent not found' };
140
- }
141
-
142
- let result;
143
-
144
- switch (action) {
145
- case 'start':
146
- result = this.startAgent(agent, params);
147
- break;
148
- case 'pause':
149
- result = this.pauseAgent(agent, params);
150
- break;
151
- case 'resume':
152
- result = this.resumeAgent(agent, params);
153
- break;
154
- case 'stop':
155
- result = this.stopAgent(agent, params);
156
- break;
157
- case 'restart':
158
- result = this.restartAgent(agent, params);
159
- break;
160
- case 'destroy':
161
- result = this.destroyAgent(agent, params);
162
- break;
163
- default:
164
- return { success: false, error: 'Unknown action' };
165
- }
166
-
167
- // Update lifecycle visualization
168
- this.updateLifecycleVisualization();
169
- this.updateMetrics();
170
-
171
- return result;
172
- }
173
-
174
- // Tool 5: Inter-agent Communication
175
- daa_communication(fromAgent, toAgent, message, options = {}) {
176
- const commId = this.generateCommId();
177
- const communication = {
178
- id: commId,
179
- from: fromAgent,
180
- to: toAgent,
181
- message: message,
182
- timestamp: Date.now(),
183
- type: options.type || 'direct',
184
- priority: options.priority || 'normal',
185
- status: 'pending',
186
- latency: 0,
187
- metadata: options.metadata || {}
188
- };
189
-
190
- this.communications.set(commId, communication);
191
-
192
- // Process communication
193
- const result = this.processCommunication(communication);
194
-
195
- // Update communication flow diagrams
196
- this.updateCommunicationFlow();
197
-
198
- return {
199
- success: result.success,
200
- commId: commId,
201
- latency: result.latency,
202
- status: result.status
203
- };
204
- }
205
-
206
- // Tool 6: Consensus Mechanisms
207
- daa_consensus(proposal, agents, options = {}) {
208
- const consensusId = this.generateConsensusId();
209
- const consensus = {
210
- id: consensusId,
211
- proposal: proposal,
212
- participants: agents,
213
- votes: new Map(),
214
- status: 'voting',
215
- algorithm: options.algorithm || 'majority',
216
- threshold: options.threshold || 0.5,
217
- timeout: options.timeout || 30000,
218
- started: Date.now(),
219
- completed: null,
220
- result: null
221
- };
222
-
223
- this.consensus.set(consensusId, consensus);
224
-
225
- // Start consensus process
226
- const result = this.startConsensusProcess(consensus);
227
-
228
- // Update consensus interface
229
- this.updateConsensusInterface();
230
-
231
- return {
232
- success: result.success,
233
- consensusId: consensusId,
234
- expectedCompletion: result.expectedCompletion
235
- };
7
+ constructor() {
8
+ this.agents = new Map();
9
+ this.resources = new Map();
10
+ this.communications = new Map();
11
+ this.consensus = new Map();
12
+ this.isInitialized = false;
13
+ this.currentTab = 'agents';
14
+
15
+ // Performance metrics
16
+ this.metrics = {
17
+ totalAgents: 0,
18
+ activeAgents: 0,
19
+ resourceUtilization: 0,
20
+ communicationLatency: 0,
21
+ consensusTime: 0,
22
+ faultCount: 0,
23
+ };
24
+
25
+ this.init();
26
+ }
27
+
28
+ init() {
29
+ if (this.isInitialized) return;
30
+
31
+ this.createDAAPanel();
32
+ this.setupEventListeners();
33
+ this.initializeMonitoring();
34
+ this.isInitialized = true;
35
+
36
+ console.log('DAA Tools initialized');
37
+ }
38
+
39
+ // Tool 1: Dynamic Agent Creation
40
+ daa_agent_create(config) {
41
+ const agentId = this.generateAgentId();
42
+ const agent = {
43
+ id: agentId,
44
+ type: config.type || 'generic',
45
+ capabilities: config.capabilities || [],
46
+ resources: config.resources || {},
47
+ status: 'initializing',
48
+ created: Date.now(),
49
+ lastActivity: Date.now(),
50
+ tasks: [],
51
+ metadata: config.metadata || {},
52
+ };
53
+
54
+ this.agents.set(agentId, agent);
55
+ this.metrics.totalAgents++;
56
+ this.metrics.activeAgents++;
57
+
58
+ // Lifecycle management
59
+ this.initializeAgent(agent);
60
+
61
+ // Update UI
62
+ this.updateAgentsList();
63
+ this.updateMetrics();
64
+
65
+ return {
66
+ success: true,
67
+ agentId: agentId,
68
+ agent: agent,
69
+ };
70
+ }
71
+
72
+ // Tool 2: Capability Matching System
73
+ daa_capability_match(requirements) {
74
+ const matches = [];
75
+
76
+ for (const [agentId, agent] of this.agents) {
77
+ if (agent.status !== 'active') continue;
78
+
79
+ const score = this.calculateCapabilityScore(agent.capabilities, requirements);
80
+ if (score > 0) {
81
+ matches.push({
82
+ agentId,
83
+ agent,
84
+ score,
85
+ availableCapabilities: agent.capabilities.filter((cap) =>
86
+ requirements.some((req) => this.matchCapability(cap, req)),
87
+ ),
88
+ });
89
+ }
236
90
  }
237
-
238
- // Tool 7: Fault Tolerance and Recovery
239
- daa_fault_tolerance(faultType, affectedAgents, recoveryOptions = {}) {
240
- const faultId = this.generateFaultId();
241
- const fault = {
242
- id: faultId,
243
- type: faultType,
244
- affected: affectedAgents,
245
- detected: Date.now(),
246
- severity: recoveryOptions.severity || 'medium',
247
- status: 'detected',
248
- recoveryPlan: null,
249
- recovered: null
250
- };
251
-
252
- this.metrics.faultCount++;
253
-
254
- // Analyze fault and create recovery plan
255
- const recoveryPlan = this.createRecoveryPlan(fault, recoveryOptions);
256
- fault.recoveryPlan = recoveryPlan;
257
-
258
- // Execute recovery
259
- const recoveryResult = this.executeRecovery(fault);
260
-
261
- // Update fault tolerance dashboard
262
- this.updateFaultDashboard();
263
-
264
- return {
265
- success: recoveryResult.success,
266
- faultId: faultId,
267
- recoveryPlan: recoveryPlan,
268
- estimatedRecoveryTime: recoveryResult.estimatedTime
269
- };
91
+
92
+ // Sort by score descending
93
+ matches.sort((a, b) => b.score - a.score);
94
+
95
+ this.updateCapabilityMatches(matches);
96
+
97
+ return {
98
+ success: true,
99
+ matches: matches,
100
+ totalCandidates: matches.length,
101
+ };
102
+ }
103
+
104
+ // Tool 3: Resource Allocation Management
105
+ daa_resource_alloc(allocation) {
106
+ const resourceId = this.generateResourceId();
107
+ const resource = {
108
+ id: resourceId,
109
+ type: allocation.type,
110
+ capacity: allocation.capacity,
111
+ allocated: 0,
112
+ assignments: new Map(),
113
+ priority: allocation.priority || 'medium',
114
+ created: Date.now(),
115
+ metadata: allocation.metadata || {},
116
+ };
117
+
118
+ this.resources.set(resourceId, resource);
119
+
120
+ // Perform allocation
121
+ const allocationResult = this.allocateResource(resource, allocation);
122
+
123
+ // Update visualizations
124
+ this.updateResourceGraphs();
125
+ this.updateMetrics();
126
+
127
+ return {
128
+ success: allocationResult.success,
129
+ resourceId: resourceId,
130
+ allocation: allocationResult,
131
+ utilization: this.calculateResourceUtilization(),
132
+ };
133
+ }
134
+
135
+ // Tool 4: Agent Lifecycle Management
136
+ daa_lifecycle_manage(agentId, action, params = {}) {
137
+ const agent = this.agents.get(agentId);
138
+ if (!agent) {
139
+ return { success: false, error: 'Agent not found' };
270
140
  }
271
-
272
- // Tool 8: Performance Optimization
273
- daa_optimization(target, options = {}) {
274
- const optimizationId = this.generateOptimizationId();
275
- const optimization = {
276
- id: optimizationId,
277
- target: target,
278
- baseline: this.capturePerformanceBaseline(),
279
- options: options,
280
- started: Date.now(),
281
- status: 'running',
282
- improvements: [],
283
- completed: null
284
- };
285
-
286
- // Perform optimization
287
- const result = this.performOptimization(optimization);
288
-
289
- // Update optimization dashboard
290
- this.updateOptimizationDashboard();
291
-
292
- return {
293
- success: result.success,
294
- optimizationId: optimizationId,
295
- improvements: result.improvements,
296
- performanceGain: result.performanceGain
297
- };
141
+
142
+ let result;
143
+
144
+ switch (action) {
145
+ case 'start':
146
+ result = this.startAgent(agent, params);
147
+ break;
148
+ case 'pause':
149
+ result = this.pauseAgent(agent, params);
150
+ break;
151
+ case 'resume':
152
+ result = this.resumeAgent(agent, params);
153
+ break;
154
+ case 'stop':
155
+ result = this.stopAgent(agent, params);
156
+ break;
157
+ case 'restart':
158
+ result = this.restartAgent(agent, params);
159
+ break;
160
+ case 'destroy':
161
+ result = this.destroyAgent(agent, params);
162
+ break;
163
+ default:
164
+ return { success: false, error: 'Unknown action' };
298
165
  }
299
-
300
- // UI Creation Methods
301
- createDAAPanel() {
302
- const panel = document.createElement('div');
303
- panel.id = 'daa-tools-panel';
304
- panel.className = 'daa-panel';
305
-
306
- panel.innerHTML = `
166
+
167
+ // Update lifecycle visualization
168
+ this.updateLifecycleVisualization();
169
+ this.updateMetrics();
170
+
171
+ return result;
172
+ }
173
+
174
+ // Tool 5: Inter-agent Communication
175
+ daa_communication(fromAgent, toAgent, message, options = {}) {
176
+ const commId = this.generateCommId();
177
+ const communication = {
178
+ id: commId,
179
+ from: fromAgent,
180
+ to: toAgent,
181
+ message: message,
182
+ timestamp: Date.now(),
183
+ type: options.type || 'direct',
184
+ priority: options.priority || 'normal',
185
+ status: 'pending',
186
+ latency: 0,
187
+ metadata: options.metadata || {},
188
+ };
189
+
190
+ this.communications.set(commId, communication);
191
+
192
+ // Process communication
193
+ const result = this.processCommunication(communication);
194
+
195
+ // Update communication flow diagrams
196
+ this.updateCommunicationFlow();
197
+
198
+ return {
199
+ success: result.success,
200
+ commId: commId,
201
+ latency: result.latency,
202
+ status: result.status,
203
+ };
204
+ }
205
+
206
+ // Tool 6: Consensus Mechanisms
207
+ daa_consensus(proposal, agents, options = {}) {
208
+ const consensusId = this.generateConsensusId();
209
+ const consensus = {
210
+ id: consensusId,
211
+ proposal: proposal,
212
+ participants: agents,
213
+ votes: new Map(),
214
+ status: 'voting',
215
+ algorithm: options.algorithm || 'majority',
216
+ threshold: options.threshold || 0.5,
217
+ timeout: options.timeout || 30000,
218
+ started: Date.now(),
219
+ completed: null,
220
+ result: null,
221
+ };
222
+
223
+ this.consensus.set(consensusId, consensus);
224
+
225
+ // Start consensus process
226
+ const result = this.startConsensusProcess(consensus);
227
+
228
+ // Update consensus interface
229
+ this.updateConsensusInterface();
230
+
231
+ return {
232
+ success: result.success,
233
+ consensusId: consensusId,
234
+ expectedCompletion: result.expectedCompletion,
235
+ };
236
+ }
237
+
238
+ // Tool 7: Fault Tolerance and Recovery
239
+ daa_fault_tolerance(faultType, affectedAgents, recoveryOptions = {}) {
240
+ const faultId = this.generateFaultId();
241
+ const fault = {
242
+ id: faultId,
243
+ type: faultType,
244
+ affected: affectedAgents,
245
+ detected: Date.now(),
246
+ severity: recoveryOptions.severity || 'medium',
247
+ status: 'detected',
248
+ recoveryPlan: null,
249
+ recovered: null,
250
+ };
251
+
252
+ this.metrics.faultCount++;
253
+
254
+ // Analyze fault and create recovery plan
255
+ const recoveryPlan = this.createRecoveryPlan(fault, recoveryOptions);
256
+ fault.recoveryPlan = recoveryPlan;
257
+
258
+ // Execute recovery
259
+ const recoveryResult = this.executeRecovery(fault);
260
+
261
+ // Update fault tolerance dashboard
262
+ this.updateFaultDashboard();
263
+
264
+ return {
265
+ success: recoveryResult.success,
266
+ faultId: faultId,
267
+ recoveryPlan: recoveryPlan,
268
+ estimatedRecoveryTime: recoveryResult.estimatedTime,
269
+ };
270
+ }
271
+
272
+ // Tool 8: Performance Optimization
273
+ daa_optimization(target, options = {}) {
274
+ const optimizationId = this.generateOptimizationId();
275
+ const optimization = {
276
+ id: optimizationId,
277
+ target: target,
278
+ baseline: this.capturePerformanceBaseline(),
279
+ options: options,
280
+ started: Date.now(),
281
+ status: 'running',
282
+ improvements: [],
283
+ completed: null,
284
+ };
285
+
286
+ // Perform optimization
287
+ const result = this.performOptimization(optimization);
288
+
289
+ // Update optimization dashboard
290
+ this.updateOptimizationDashboard();
291
+
292
+ return {
293
+ success: result.success,
294
+ optimizationId: optimizationId,
295
+ improvements: result.improvements,
296
+ performanceGain: result.performanceGain,
297
+ };
298
+ }
299
+
300
+ // UI Creation Methods
301
+ createDAAPanel() {
302
+ const panel = document.createElement('div');
303
+ panel.id = 'daa-tools-panel';
304
+ panel.className = 'daa-panel';
305
+
306
+ panel.innerHTML = `
307
307
  <div class="daa-header">
308
308
  <h3>DAA Control Center</h3>
309
309
  <div class="daa-metrics">
@@ -340,14 +340,14 @@ class DAATools {
340
340
  ${this.createMonitoringTab()}
341
341
  </div>
342
342
  `;
343
-
344
- // Add to console
345
- const consoleContainer = document.querySelector('.console-container') || document.body;
346
- consoleContainer.appendChild(panel);
347
- }
348
-
349
- createAgentsTab() {
350
- return `
343
+
344
+ // Add to console
345
+ const consoleContainer = document.querySelector('.console-container') || document.body;
346
+ consoleContainer.appendChild(panel);
347
+ }
348
+
349
+ createAgentsTab() {
350
+ return `
351
351
  <div class="daa-tab-content active" id="daa-agents-tab">
352
352
  <div class="daa-section">
353
353
  <h4>Agent Creation</h4>
@@ -379,10 +379,10 @@ class DAATools {
379
379
  </div>
380
380
  </div>
381
381
  `;
382
- }
383
-
384
- createResourcesTab() {
385
- return `
382
+ }
383
+
384
+ createResourcesTab() {
385
+ return `
386
386
  <div class="daa-tab-content" id="daa-resources-tab">
387
387
  <div class="daa-section">
388
388
  <h4>Resource Allocation</h4>
@@ -418,10 +418,10 @@ class DAATools {
418
418
  </div>
419
419
  </div>
420
420
  `;
421
- }
422
-
423
- createCommunicationTab() {
424
- return `
421
+ }
422
+
423
+ createCommunicationTab() {
424
+ return `
425
425
  <div class="daa-tab-content" id="daa-communication-tab">
426
426
  <div class="daa-section">
427
427
  <h4>Communication Flow</h4>
@@ -447,10 +447,10 @@ class DAATools {
447
447
  </div>
448
448
  </div>
449
449
  `;
450
- }
451
-
452
- createMonitoringTab() {
453
- return `
450
+ }
451
+
452
+ createMonitoringTab() {
453
+ return `
454
454
  <div class="daa-tab-content" id="daa-monitoring-tab">
455
455
  <div class="daa-section">
456
456
  <h4>Real-time Dashboard</h4>
@@ -483,212 +483,213 @@ class DAATools {
483
483
  </div>
484
484
  </div>
485
485
  `;
486
- }
487
-
488
- // Helper Methods
489
- generateAgentId() {
490
- return `agent-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
491
- }
492
-
493
- generateResourceId() {
494
- return `resource-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
495
- }
496
-
497
- generateCommId() {
498
- return `comm-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
499
- }
500
-
501
- generateConsensusId() {
502
- return `consensus-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
503
- }
504
-
505
- generateFaultId() {
506
- return `fault-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
507
- }
508
-
509
- generateOptimizationId() {
510
- return `opt-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
511
- }
512
-
513
- calculateCapabilityScore(agentCapabilities, requirements) {
514
- let score = 0;
515
- for (const requirement of requirements) {
516
- for (const capability of agentCapabilities) {
517
- if (this.matchCapability(capability, requirement)) {
518
- score += 1;
519
- }
520
- }
521
- }
522
- return score;
523
- }
524
-
525
- matchCapability(capability, requirement) {
526
- // Simple string matching - can be enhanced with fuzzy matching
527
- return capability.toLowerCase().includes(requirement.toLowerCase());
528
- }
529
-
530
- calculateResourceUtilization() {
531
- let totalCapacity = 0;
532
- let totalAllocated = 0;
533
-
534
- for (const [_, resource] of this.resources) {
535
- totalCapacity += resource.capacity;
536
- totalAllocated += resource.allocated;
537
- }
538
-
539
- return totalCapacity > 0 ? Math.round((totalAllocated / totalCapacity) * 100) : 0;
540
- }
541
-
542
- // Implementation methods (simplified for brevity)
543
- initializeAgent(agent) {
544
- agent.status = 'active';
545
- agent.lastActivity = Date.now();
546
- }
547
-
548
- startAgent(agent, params) {
549
- agent.status = 'active';
550
- agent.lastActivity = Date.now();
551
- return { success: true, status: 'active' };
552
- }
553
-
554
- pauseAgent(agent, params) {
555
- agent.status = 'paused';
556
- return { success: true, status: 'paused' };
557
- }
558
-
559
- resumeAgent(agent, params) {
560
- agent.status = 'active';
561
- agent.lastActivity = Date.now();
562
- return { success: true, status: 'active' };
563
- }
564
-
565
- stopAgent(agent, params) {
566
- agent.status = 'stopped';
567
- this.metrics.activeAgents--;
568
- return { success: true, status: 'stopped' };
569
- }
570
-
571
- restartAgent(agent, params) {
572
- agent.status = 'active';
573
- agent.lastActivity = Date.now();
574
- return { success: true, status: 'active' };
575
- }
576
-
577
- destroyAgent(agent, params) {
578
- this.agents.delete(agent.id);
579
- this.metrics.totalAgents--;
580
- this.metrics.activeAgents--;
581
- return { success: true, status: 'destroyed' };
582
- }
583
-
584
- allocateResource(resource, allocation) {
585
- // Simple allocation logic
586
- const requested = allocation.amount || 0;
587
- const available = resource.capacity - resource.allocated;
588
-
589
- if (requested <= available) {
590
- resource.allocated += requested;
591
- return { success: true, allocated: requested, remaining: available - requested };
592
- } else {
593
- return { success: false, error: 'Insufficient resources', available: available };
486
+ }
487
+
488
+ // Helper Methods
489
+ generateAgentId() {
490
+ return `agent-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
491
+ }
492
+
493
+ generateResourceId() {
494
+ return `resource-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
495
+ }
496
+
497
+ generateCommId() {
498
+ return `comm-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
499
+ }
500
+
501
+ generateConsensusId() {
502
+ return `consensus-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
503
+ }
504
+
505
+ generateFaultId() {
506
+ return `fault-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
507
+ }
508
+
509
+ generateOptimizationId() {
510
+ return `opt-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
511
+ }
512
+
513
+ calculateCapabilityScore(agentCapabilities, requirements) {
514
+ let score = 0;
515
+ for (const requirement of requirements) {
516
+ for (const capability of agentCapabilities) {
517
+ if (this.matchCapability(capability, requirement)) {
518
+ score += 1;
594
519
  }
520
+ }
595
521
  }
596
-
597
- processCommunication(communication) {
598
- // Simulate communication processing
599
- const latency = Math.random() * 100; // 0-100ms
600
- communication.latency = latency;
601
- communication.status = 'completed';
602
-
603
- this.metrics.communicationLatency = (this.metrics.communicationLatency + latency) / 2;
604
-
605
- return { success: true, latency: latency, status: 'completed' };
606
- }
607
-
608
- startConsensusProcess(consensus) {
609
- // Simulate consensus process
610
- const expectedTime = consensus.timeout || 30000;
611
-
612
- setTimeout(() => {
613
- this.completeConsensus(consensus);
614
- }, expectedTime);
615
-
616
- return { success: true, expectedCompletion: Date.now() + expectedTime };
617
- }
618
-
619
- completeConsensus(consensus) {
620
- consensus.status = 'completed';
621
- consensus.completed = Date.now();
622
- consensus.result = 'approved'; // Simplified
623
-
624
- this.metrics.consensusTime = consensus.completed - consensus.started;
625
- this.updateConsensusInterface();
626
- }
627
-
628
- createRecoveryPlan(fault, options) {
629
- return {
630
- steps: [
631
- 'Isolate affected agents',
632
- 'Backup current state',
633
- 'Restart affected components',
634
- 'Verify system integrity',
635
- 'Resume normal operations'
636
- ],
637
- estimatedTime: 60000, // 1 minute
638
- priority: fault.severity
639
- };
640
- }
641
-
642
- executeRecovery(fault) {
643
- // Simulate recovery execution
644
- fault.status = 'recovering';
645
-
646
- setTimeout(() => {
647
- fault.status = 'recovered';
648
- fault.recovered = Date.now();
649
- this.updateFaultDashboard();
650
- }, fault.recoveryPlan.estimatedTime);
651
-
652
- return { success: true, estimatedTime: fault.recoveryPlan.estimatedTime };
653
- }
654
-
655
- capturePerformanceBaseline() {
656
- return {
657
- timestamp: Date.now(),
658
- metrics: { ...this.metrics },
659
- agentCount: this.agents.size,
660
- resourceCount: this.resources.size
661
- };
522
+ return score;
523
+ }
524
+
525
+ matchCapability(capability, requirement) {
526
+ // Simple string matching - can be enhanced with fuzzy matching
527
+ return capability.toLowerCase().includes(requirement.toLowerCase());
528
+ }
529
+
530
+ calculateResourceUtilization() {
531
+ let totalCapacity = 0;
532
+ let totalAllocated = 0;
533
+
534
+ for (const [_, resource] of this.resources) {
535
+ totalCapacity += resource.capacity;
536
+ totalAllocated += resource.allocated;
662
537
  }
663
-
664
- performOptimization(optimization) {
665
- // Simulate optimization process
666
- const improvements = [
667
- { type: 'agent_efficiency', improvement: 15 },
668
- { type: 'resource_allocation', improvement: 12 },
669
- { type: 'communication_latency', improvement: 8 }
670
- ];
671
-
672
- optimization.improvements = improvements;
673
- optimization.status = 'completed';
674
- optimization.completed = Date.now();
675
-
676
- const totalGain = improvements.reduce((sum, imp) => sum + imp.improvement, 0) / improvements.length;
677
-
678
- return { success: true, improvements: improvements, performanceGain: totalGain };
538
+
539
+ return totalCapacity > 0 ? Math.round((totalAllocated / totalCapacity) * 100) : 0;
540
+ }
541
+
542
+ // Implementation methods (simplified for brevity)
543
+ initializeAgent(agent) {
544
+ agent.status = 'active';
545
+ agent.lastActivity = Date.now();
546
+ }
547
+
548
+ startAgent(agent, params) {
549
+ agent.status = 'active';
550
+ agent.lastActivity = Date.now();
551
+ return { success: true, status: 'active' };
552
+ }
553
+
554
+ pauseAgent(agent, params) {
555
+ agent.status = 'paused';
556
+ return { success: true, status: 'paused' };
557
+ }
558
+
559
+ resumeAgent(agent, params) {
560
+ agent.status = 'active';
561
+ agent.lastActivity = Date.now();
562
+ return { success: true, status: 'active' };
563
+ }
564
+
565
+ stopAgent(agent, params) {
566
+ agent.status = 'stopped';
567
+ this.metrics.activeAgents--;
568
+ return { success: true, status: 'stopped' };
569
+ }
570
+
571
+ restartAgent(agent, params) {
572
+ agent.status = 'active';
573
+ agent.lastActivity = Date.now();
574
+ return { success: true, status: 'active' };
575
+ }
576
+
577
+ destroyAgent(agent, params) {
578
+ this.agents.delete(agent.id);
579
+ this.metrics.totalAgents--;
580
+ this.metrics.activeAgents--;
581
+ return { success: true, status: 'destroyed' };
582
+ }
583
+
584
+ allocateResource(resource, allocation) {
585
+ // Simple allocation logic
586
+ const requested = allocation.amount || 0;
587
+ const available = resource.capacity - resource.allocated;
588
+
589
+ if (requested <= available) {
590
+ resource.allocated += requested;
591
+ return { success: true, allocated: requested, remaining: available - requested };
592
+ } else {
593
+ return { success: false, error: 'Insufficient resources', available: available };
679
594
  }
680
-
681
- // UI Update Methods
682
- updateAgentsList() {
683
- const agentsList = document.getElementById('daa-agents-list');
684
- if (!agentsList) return;
685
-
686
- agentsList.innerHTML = '';
687
-
688
- for (const [agentId, agent] of this.agents) {
689
- const agentElement = document.createElement('div');
690
- agentElement.className = 'daa-agent-card';
691
- agentElement.innerHTML = `
595
+ }
596
+
597
+ processCommunication(communication) {
598
+ // Simulate communication processing
599
+ const latency = Math.random() * 100; // 0-100ms
600
+ communication.latency = latency;
601
+ communication.status = 'completed';
602
+
603
+ this.metrics.communicationLatency = (this.metrics.communicationLatency + latency) / 2;
604
+
605
+ return { success: true, latency: latency, status: 'completed' };
606
+ }
607
+
608
+ startConsensusProcess(consensus) {
609
+ // Simulate consensus process
610
+ const expectedTime = consensus.timeout || 30000;
611
+
612
+ setTimeout(() => {
613
+ this.completeConsensus(consensus);
614
+ }, expectedTime);
615
+
616
+ return { success: true, expectedCompletion: Date.now() + expectedTime };
617
+ }
618
+
619
+ completeConsensus(consensus) {
620
+ consensus.status = 'completed';
621
+ consensus.completed = Date.now();
622
+ consensus.result = 'approved'; // Simplified
623
+
624
+ this.metrics.consensusTime = consensus.completed - consensus.started;
625
+ this.updateConsensusInterface();
626
+ }
627
+
628
+ createRecoveryPlan(fault, options) {
629
+ return {
630
+ steps: [
631
+ 'Isolate affected agents',
632
+ 'Backup current state',
633
+ 'Restart affected components',
634
+ 'Verify system integrity',
635
+ 'Resume normal operations',
636
+ ],
637
+ estimatedTime: 60000, // 1 minute
638
+ priority: fault.severity,
639
+ };
640
+ }
641
+
642
+ executeRecovery(fault) {
643
+ // Simulate recovery execution
644
+ fault.status = 'recovering';
645
+
646
+ setTimeout(() => {
647
+ fault.status = 'recovered';
648
+ fault.recovered = Date.now();
649
+ this.updateFaultDashboard();
650
+ }, fault.recoveryPlan.estimatedTime);
651
+
652
+ return { success: true, estimatedTime: fault.recoveryPlan.estimatedTime };
653
+ }
654
+
655
+ capturePerformanceBaseline() {
656
+ return {
657
+ timestamp: Date.now(),
658
+ metrics: { ...this.metrics },
659
+ agentCount: this.agents.size,
660
+ resourceCount: this.resources.size,
661
+ };
662
+ }
663
+
664
+ performOptimization(optimization) {
665
+ // Simulate optimization process
666
+ const improvements = [
667
+ { type: 'agent_efficiency', improvement: 15 },
668
+ { type: 'resource_allocation', improvement: 12 },
669
+ { type: 'communication_latency', improvement: 8 },
670
+ ];
671
+
672
+ optimization.improvements = improvements;
673
+ optimization.status = 'completed';
674
+ optimization.completed = Date.now();
675
+
676
+ const totalGain =
677
+ improvements.reduce((sum, imp) => sum + imp.improvement, 0) / improvements.length;
678
+
679
+ return { success: true, improvements: improvements, performanceGain: totalGain };
680
+ }
681
+
682
+ // UI Update Methods
683
+ updateAgentsList() {
684
+ const agentsList = document.getElementById('daa-agents-list');
685
+ if (!agentsList) return;
686
+
687
+ agentsList.innerHTML = '';
688
+
689
+ for (const [agentId, agent] of this.agents) {
690
+ const agentElement = document.createElement('div');
691
+ agentElement.className = 'daa-agent-card';
692
+ agentElement.innerHTML = `
692
693
  <div class="agent-header">
693
694
  <span class="agent-id">${agentId}</span>
694
695
  <span class="agent-status status-${agent.status}">${agent.status}</span>
@@ -703,133 +704,139 @@ class DAATools {
703
704
  <button onclick="daaTools.daa_lifecycle_manage('${agentId}', 'destroy')">Destroy</button>
704
705
  </div>
705
706
  `;
706
- agentsList.appendChild(agentElement);
707
- }
708
- }
709
-
710
- updateMetrics() {
711
- const elements = {
712
- 'daa-agents-count': this.metrics.activeAgents,
713
- 'daa-resources-util': `${this.metrics.resourceUtilization}%`,
714
- 'daa-latency': `${Math.round(this.metrics.communicationLatency)}ms`,
715
- 'daa-faults': this.metrics.faultCount
716
- };
717
-
718
- for (const [id, value] of Object.entries(elements)) {
719
- const element = document.getElementById(id);
720
- if (element) {
721
- element.textContent = value;
722
- }
723
- }
707
+ agentsList.appendChild(agentElement);
724
708
  }
725
-
726
- updateCapabilityMatches(matches) {
727
- // Update capability matching visualization
728
- console.log('Capability matches:', matches);
709
+ }
710
+
711
+ updateMetrics() {
712
+ const elements = {
713
+ 'daa-agents-count': this.metrics.activeAgents,
714
+ 'daa-resources-util': `${this.metrics.resourceUtilization}%`,
715
+ 'daa-latency': `${Math.round(this.metrics.communicationLatency)}ms`,
716
+ 'daa-faults': this.metrics.faultCount,
717
+ };
718
+
719
+ for (const [id, value] of Object.entries(elements)) {
720
+ const element = document.getElementById(id);
721
+ if (element) {
722
+ element.textContent = value;
723
+ }
729
724
  }
730
-
731
- updateResourceGraphs() {
732
- const canvas = document.getElementById('daa-resource-chart');
733
- if (!canvas) return;
734
-
735
- const ctx = canvas.getContext('2d');
736
- ctx.clearRect(0, 0, canvas.width, canvas.height);
737
-
738
- // Draw resource utilization bars
739
- const resources = Array.from(this.resources.values());
740
- const barWidth = canvas.width / Math.max(resources.length, 1);
741
-
742
- resources.forEach((resource, index) => {
743
- const utilization = resource.capacity > 0 ? resource.allocated / resource.capacity : 0;
744
- const barHeight = utilization * canvas.height;
745
-
746
- ctx.fillStyle = utilization > 0.8 ? '#ff4444' : utilization > 0.5 ? '#ffaa00' : '#44ff44';
747
- ctx.fillRect(index * barWidth, canvas.height - barHeight, barWidth - 2, barHeight);
748
-
749
- // Resource label
750
- ctx.fillStyle = '#000';
751
- ctx.font = '12px Arial';
752
- ctx.fillText(resource.type, index * barWidth + 5, canvas.height - 5);
753
- });
725
+ }
726
+
727
+ updateCapabilityMatches(matches) {
728
+ // Update capability matching visualization
729
+ console.log('Capability matches:', matches);
730
+ }
731
+
732
+ updateResourceGraphs() {
733
+ const canvas = document.getElementById('daa-resource-chart');
734
+ if (!canvas) return;
735
+
736
+ const ctx = canvas.getContext('2d');
737
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
738
+
739
+ // Draw resource utilization bars
740
+ const resources = Array.from(this.resources.values());
741
+ const barWidth = canvas.width / Math.max(resources.length, 1);
742
+
743
+ resources.forEach((resource, index) => {
744
+ const utilization = resource.capacity > 0 ? resource.allocated / resource.capacity : 0;
745
+ const barHeight = utilization * canvas.height;
746
+
747
+ ctx.fillStyle = utilization > 0.8 ? '#ff4444' : utilization > 0.5 ? '#ffaa00' : '#44ff44';
748
+ ctx.fillRect(index * barWidth, canvas.height - barHeight, barWidth - 2, barHeight);
749
+
750
+ // Resource label
751
+ ctx.fillStyle = '#000';
752
+ ctx.font = '12px Arial';
753
+ ctx.fillText(resource.type, index * barWidth + 5, canvas.height - 5);
754
+ });
755
+ }
756
+
757
+ updateLifecycleVisualization() {
758
+ const visualization = document.getElementById('daa-lifecycle-visualization');
759
+ if (!visualization) return;
760
+
761
+ const statusCounts = {};
762
+ for (const [_, agent] of this.agents) {
763
+ statusCounts[agent.status] = (statusCounts[agent.status] || 0) + 1;
754
764
  }
755
-
756
- updateLifecycleVisualization() {
757
- const visualization = document.getElementById('daa-lifecycle-visualization');
758
- if (!visualization) return;
759
-
760
- const statusCounts = {};
761
- for (const [_, agent] of this.agents) {
762
- statusCounts[agent.status] = (statusCounts[agent.status] || 0) + 1;
763
- }
764
-
765
- visualization.innerHTML = Object.entries(statusCounts).map(([status, count]) =>
766
- `<div class="lifecycle-item">
765
+
766
+ visualization.innerHTML = Object.entries(statusCounts)
767
+ .map(
768
+ ([status, count]) =>
769
+ `<div class="lifecycle-item">
767
770
  <span class="status-badge status-${status}">${status}</span>
768
771
  <span class="status-count">${count}</span>
769
- </div>`
770
- ).join('');
771
- }
772
-
773
- updateCommunicationFlow() {
774
- const svg = document.getElementById('daa-comm-diagram');
775
- if (!svg) return;
776
-
777
- // Clear existing content
778
- svg.innerHTML = '';
779
-
780
- // Draw communication flow visualization
781
- const agents = Array.from(this.agents.values());
782
- const centerX = 300;
783
- const centerY = 200;
784
- const radius = 150;
785
-
786
- agents.forEach((agent, index) => {
787
- const angle = (index * 2 * Math.PI) / agents.length;
788
- const x = centerX + radius * Math.cos(angle);
789
- const y = centerY + radius * Math.sin(angle);
790
-
791
- // Draw agent node
792
- const circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
793
- circle.setAttribute('cx', x);
794
- circle.setAttribute('cy', y);
795
- circle.setAttribute('r', 20);
796
- circle.setAttribute('fill', '#4CAF50');
797
- circle.setAttribute('stroke', '#333');
798
- circle.setAttribute('stroke-width', '2');
799
- svg.appendChild(circle);
800
-
801
- // Draw agent label
802
- const text = document.createElementNS('http://www.w3.org/2000/svg', 'text');
803
- text.setAttribute('x', x);
804
- text.setAttribute('y', y + 5);
805
- text.setAttribute('text-anchor', 'middle');
806
- text.setAttribute('font-size', '12');
807
- text.setAttribute('fill', '#fff');
808
- text.textContent = agent.id.split('-')[0];
809
- svg.appendChild(text);
810
- });
811
- }
812
-
813
- updateConsensusInterface() {
814
- const consensusStatus = document.getElementById('daa-consensus-status');
815
- if (!consensusStatus) return;
816
-
817
- consensusStatus.innerHTML = Array.from(this.consensus.values()).map(consensus =>
818
- `<div class="consensus-item">
772
+ </div>`,
773
+ )
774
+ .join('');
775
+ }
776
+
777
+ updateCommunicationFlow() {
778
+ const svg = document.getElementById('daa-comm-diagram');
779
+ if (!svg) return;
780
+
781
+ // Clear existing content
782
+ svg.innerHTML = '';
783
+
784
+ // Draw communication flow visualization
785
+ const agents = Array.from(this.agents.values());
786
+ const centerX = 300;
787
+ const centerY = 200;
788
+ const radius = 150;
789
+
790
+ agents.forEach((agent, index) => {
791
+ const angle = (index * 2 * Math.PI) / agents.length;
792
+ const x = centerX + radius * Math.cos(angle);
793
+ const y = centerY + radius * Math.sin(angle);
794
+
795
+ // Draw agent node
796
+ const circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
797
+ circle.setAttribute('cx', x);
798
+ circle.setAttribute('cy', y);
799
+ circle.setAttribute('r', 20);
800
+ circle.setAttribute('fill', '#4CAF50');
801
+ circle.setAttribute('stroke', '#333');
802
+ circle.setAttribute('stroke-width', '2');
803
+ svg.appendChild(circle);
804
+
805
+ // Draw agent label
806
+ const text = document.createElementNS('http://www.w3.org/2000/svg', 'text');
807
+ text.setAttribute('x', x);
808
+ text.setAttribute('y', y + 5);
809
+ text.setAttribute('text-anchor', 'middle');
810
+ text.setAttribute('font-size', '12');
811
+ text.setAttribute('fill', '#fff');
812
+ text.textContent = agent.id.split('-')[0];
813
+ svg.appendChild(text);
814
+ });
815
+ }
816
+
817
+ updateConsensusInterface() {
818
+ const consensusStatus = document.getElementById('daa-consensus-status');
819
+ if (!consensusStatus) return;
820
+
821
+ consensusStatus.innerHTML = Array.from(this.consensus.values())
822
+ .map(
823
+ (consensus) =>
824
+ `<div class="consensus-item">
819
825
  <div class="consensus-proposal">${consensus.proposal}</div>
820
826
  <div class="consensus-status">${consensus.status}</div>
821
827
  <div class="consensus-progress">
822
828
  <div class="progress-bar" style="width: ${consensus.status === 'completed' ? '100%' : '50%'}"></div>
823
829
  </div>
824
- </div>`
825
- ).join('');
826
- }
827
-
828
- updateFaultDashboard() {
829
- const faultStatus = document.getElementById('daa-fault-status');
830
- if (!faultStatus) return;
831
-
832
- faultStatus.innerHTML = `
830
+ </div>`,
831
+ )
832
+ .join('');
833
+ }
834
+
835
+ updateFaultDashboard() {
836
+ const faultStatus = document.getElementById('daa-fault-status');
837
+ if (!faultStatus) return;
838
+
839
+ faultStatus.innerHTML = `
833
840
  <div class="fault-item">
834
841
  <span class="fault-label">Total Faults</span>
835
842
  <span class="fault-value">${this.metrics.faultCount}</span>
@@ -843,13 +850,13 @@ class DAATools {
843
850
  <span class="fault-value">2.3min</span>
844
851
  </div>
845
852
  `;
846
- }
847
-
848
- updateOptimizationDashboard() {
849
- const optimizationStatus = document.getElementById('daa-optimization-status');
850
- if (!optimizationStatus) return;
851
-
852
- optimizationStatus.innerHTML = `
853
+ }
854
+
855
+ updateOptimizationDashboard() {
856
+ const optimizationStatus = document.getElementById('daa-optimization-status');
857
+ if (!optimizationStatus) return;
858
+
859
+ optimizationStatus.innerHTML = `
853
860
  <div class="optimization-item">
854
861
  <span class="opt-label">Performance Gain</span>
855
862
  <span class="opt-value">+15%</span>
@@ -863,148 +870,151 @@ class DAATools {
863
870
  <span class="opt-value">-8%</span>
864
871
  </div>
865
872
  `;
873
+ }
874
+
875
+ setupEventListeners() {
876
+ // Tab switching
877
+ document.addEventListener('click', (e) => {
878
+ if (e.target.classList.contains('daa-tab')) {
879
+ this.switchTab(e.target.dataset.tab);
880
+ }
881
+ });
882
+
883
+ // Agent creation
884
+ document.addEventListener('click', (e) => {
885
+ if (e.target.id === 'daa-create-agent') {
886
+ this.handleCreateAgent();
887
+ }
888
+ });
889
+
890
+ // Resource allocation
891
+ document.addEventListener('click', (e) => {
892
+ if (e.target.id === 'daa-allocate-resource') {
893
+ this.handleAllocateResource();
894
+ }
895
+ });
896
+
897
+ // Consensus voting
898
+ document.addEventListener('click', (e) => {
899
+ if (e.target.id === 'daa-start-consensus') {
900
+ this.handleStartConsensus();
901
+ }
902
+ });
903
+ }
904
+
905
+ switchTab(tabName) {
906
+ // Hide all tabs
907
+ document.querySelectorAll('.daa-tab-content').forEach((tab) => {
908
+ tab.classList.remove('active');
909
+ });
910
+
911
+ document.querySelectorAll('.daa-tab').forEach((tab) => {
912
+ tab.classList.remove('active');
913
+ });
914
+
915
+ // Show selected tab
916
+ document.getElementById(`daa-${tabName}-tab`).classList.add('active');
917
+ document.querySelector(`.daa-tab[data-tab="${tabName}"]`).classList.add('active');
918
+
919
+ this.currentTab = tabName;
920
+ }
921
+
922
+ handleCreateAgent() {
923
+ const type = document.getElementById('daa-agent-type').value;
924
+ const capabilities = document
925
+ .getElementById('daa-agent-capabilities')
926
+ .value.split(',')
927
+ .map((s) => s.trim());
928
+
929
+ const result = this.daa_agent_create({
930
+ type: type,
931
+ capabilities: capabilities,
932
+ resources: { cpu: 1, memory: 512 },
933
+ });
934
+
935
+ if (result.success) {
936
+ console.log('Agent created:', result.agentId);
866
937
  }
867
-
868
- setupEventListeners() {
869
- // Tab switching
870
- document.addEventListener('click', (e) => {
871
- if (e.target.classList.contains('daa-tab')) {
872
- this.switchTab(e.target.dataset.tab);
873
- }
874
- });
875
-
876
- // Agent creation
877
- document.addEventListener('click', (e) => {
878
- if (e.target.id === 'daa-create-agent') {
879
- this.handleCreateAgent();
880
- }
881
- });
882
-
883
- // Resource allocation
884
- document.addEventListener('click', (e) => {
885
- if (e.target.id === 'daa-allocate-resource') {
886
- this.handleAllocateResource();
887
- }
888
- });
889
-
890
- // Consensus voting
891
- document.addEventListener('click', (e) => {
892
- if (e.target.id === 'daa-start-consensus') {
893
- this.handleStartConsensus();
894
- }
895
- });
896
- }
897
-
898
- switchTab(tabName) {
899
- // Hide all tabs
900
- document.querySelectorAll('.daa-tab-content').forEach(tab => {
901
- tab.classList.remove('active');
902
- });
903
-
904
- document.querySelectorAll('.daa-tab').forEach(tab => {
905
- tab.classList.remove('active');
906
- });
907
-
908
- // Show selected tab
909
- document.getElementById(`daa-${tabName}-tab`).classList.add('active');
910
- document.querySelector(`.daa-tab[data-tab="${tabName}"]`).classList.add('active');
911
-
912
- this.currentTab = tabName;
913
- }
914
-
915
- handleCreateAgent() {
916
- const type = document.getElementById('daa-agent-type').value;
917
- const capabilities = document.getElementById('daa-agent-capabilities').value.split(',').map(s => s.trim());
918
-
919
- const result = this.daa_agent_create({
920
- type: type,
921
- capabilities: capabilities,
922
- resources: { cpu: 1, memory: 512 }
923
- });
924
-
925
- if (result.success) {
926
- console.log('Agent created:', result.agentId);
927
- }
928
- }
929
-
930
- handleAllocateResource() {
931
- const type = document.getElementById('daa-resource-type').value;
932
- const capacity = parseInt(document.getElementById('daa-resource-capacity').value) || 100;
933
- const priority = document.getElementById('daa-resource-priority').value;
934
-
935
- const result = this.daa_resource_alloc({
936
- type: type,
937
- capacity: capacity,
938
- priority: priority,
939
- amount: capacity * 0.5 // Allocate 50% initially
940
- });
941
-
942
- if (result.success) {
943
- console.log('Resource allocated:', result.resourceId);
944
- }
945
- }
946
-
947
- handleStartConsensus() {
948
- const proposal = document.getElementById('daa-consensus-proposal').value;
949
- const algorithm = document.getElementById('daa-consensus-algorithm').value;
950
-
951
- if (!proposal.trim()) {
952
- alert('Please enter a proposal');
953
- return;
954
- }
955
-
956
- const agents = Array.from(this.agents.keys());
957
- const result = this.daa_consensus(proposal, agents, {
958
- algorithm: algorithm,
959
- timeout: 30000
960
- });
961
-
962
- if (result.success) {
963
- console.log('Consensus started:', result.consensusId);
964
- }
938
+ }
939
+
940
+ handleAllocateResource() {
941
+ const type = document.getElementById('daa-resource-type').value;
942
+ const capacity = parseInt(document.getElementById('daa-resource-capacity').value) || 100;
943
+ const priority = document.getElementById('daa-resource-priority').value;
944
+
945
+ const result = this.daa_resource_alloc({
946
+ type: type,
947
+ capacity: capacity,
948
+ priority: priority,
949
+ amount: capacity * 0.5, // Allocate 50% initially
950
+ });
951
+
952
+ if (result.success) {
953
+ console.log('Resource allocated:', result.resourceId);
965
954
  }
966
-
967
- initializeMonitoring() {
968
- // Start monitoring intervals
969
- setInterval(() => {
970
- this.updateMetrics();
971
- this.updateResourceGraphs();
972
- this.updateLifecycleVisualization();
973
- }, 5000);
974
-
975
- // Initialize with some sample data
976
- this.createSampleData();
955
+ }
956
+
957
+ handleStartConsensus() {
958
+ const proposal = document.getElementById('daa-consensus-proposal').value;
959
+ const algorithm = document.getElementById('daa-consensus-algorithm').value;
960
+
961
+ if (!proposal.trim()) {
962
+ alert('Please enter a proposal');
963
+ return;
977
964
  }
978
-
979
- createSampleData() {
980
- // Create sample agents
981
- this.daa_agent_create({
982
- type: 'researcher',
983
- capabilities: ['data_analysis', 'research', 'documentation'],
984
- resources: { cpu: 2, memory: 1024 }
985
- });
986
-
987
- this.daa_agent_create({
988
- type: 'coder',
989
- capabilities: ['javascript', 'python', 'testing'],
990
- resources: { cpu: 4, memory: 2048 }
991
- });
992
-
993
- // Create sample resources
994
- this.daa_resource_alloc({
995
- type: 'cpu',
996
- capacity: 100,
997
- priority: 'high',
998
- amount: 30
999
- });
1000
-
1001
- this.daa_resource_alloc({
1002
- type: 'memory',
1003
- capacity: 8192,
1004
- priority: 'medium',
1005
- amount: 2048
1006
- });
965
+
966
+ const agents = Array.from(this.agents.keys());
967
+ const result = this.daa_consensus(proposal, agents, {
968
+ algorithm: algorithm,
969
+ timeout: 30000,
970
+ });
971
+
972
+ if (result.success) {
973
+ console.log('Consensus started:', result.consensusId);
1007
974
  }
975
+ }
976
+
977
+ initializeMonitoring() {
978
+ // Start monitoring intervals
979
+ setInterval(() => {
980
+ this.updateMetrics();
981
+ this.updateResourceGraphs();
982
+ this.updateLifecycleVisualization();
983
+ }, 5000);
984
+
985
+ // Initialize with some sample data
986
+ this.createSampleData();
987
+ }
988
+
989
+ createSampleData() {
990
+ // Create sample agents
991
+ this.daa_agent_create({
992
+ type: 'researcher',
993
+ capabilities: ['data_analysis', 'research', 'documentation'],
994
+ resources: { cpu: 2, memory: 1024 },
995
+ });
996
+
997
+ this.daa_agent_create({
998
+ type: 'coder',
999
+ capabilities: ['javascript', 'python', 'testing'],
1000
+ resources: { cpu: 4, memory: 2048 },
1001
+ });
1002
+
1003
+ // Create sample resources
1004
+ this.daa_resource_alloc({
1005
+ type: 'cpu',
1006
+ capacity: 100,
1007
+ priority: 'high',
1008
+ amount: 30,
1009
+ });
1010
+
1011
+ this.daa_resource_alloc({
1012
+ type: 'memory',
1013
+ capacity: 8192,
1014
+ priority: 'medium',
1015
+ amount: 2048,
1016
+ });
1017
+ }
1008
1018
  }
1009
1019
 
1010
1020
  // Initialize DAA Tools
@@ -1012,14 +1022,14 @@ let daaTools;
1012
1022
 
1013
1023
  // Initialize when DOM is ready
1014
1024
  if (document.readyState === 'loading') {
1015
- document.addEventListener('DOMContentLoaded', () => {
1016
- daaTools = new DAATools();
1017
- });
1018
- } else {
1025
+ document.addEventListener('DOMContentLoaded', () => {
1019
1026
  daaTools = new DAATools();
1027
+ });
1028
+ } else {
1029
+ daaTools = new DAATools();
1020
1030
  }
1021
1031
 
1022
1032
  // Export for use in other modules
1023
1033
  if (typeof module !== 'undefined' && module.exports) {
1024
- module.exports = DAATools;
1025
- }
1034
+ module.exports = DAATools;
1035
+ }