claude-flow-novice 2.0.3 → 2.0.4

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 (272) hide show
  1. package/dist/src/cli/commands/guidance.js +487 -668
  2. package/dist/src/cli/commands/index-validate.js +18 -29
  3. package/dist/src/cli/commands/mcp-troubleshoot.js +230 -282
  4. package/dist/src/cli/commands/neural-goal-init.js +92 -125
  5. package/dist/src/cli/commands/swarm-exec.js +317 -393
  6. package/dist/src/cli/commands/swarm.js +1 -1
  7. package/dist/src/cli/commands/validate-framework.js +983 -1100
  8. package/dist/src/cli/commands/validate.js +144 -223
  9. package/dist/src/cli/simple-commands/__tests__/agent.test.js +265 -277
  10. package/dist/src/cli/simple-commands/__tests__/memory.test.js +6 -7
  11. package/dist/src/cli/simple-commands/__tests__/swarm.test.js +373 -356
  12. package/dist/src/cli/simple-commands/__tests__/task.test.js +6 -7
  13. package/dist/src/cli/simple-commands/agent.js +157 -193
  14. package/dist/src/cli/simple-commands/analysis.js +336 -446
  15. package/dist/src/cli/simple-commands/automation-executor.js +1095 -1339
  16. package/dist/src/cli/simple-commands/automation.js +481 -469
  17. package/dist/src/cli/simple-commands/batch-manager.js +261 -313
  18. package/dist/src/cli/simple-commands/claude-telemetry.js +241 -267
  19. package/dist/src/cli/simple-commands/claude-track.js +68 -90
  20. package/dist/src/cli/simple-commands/concurrent-display.js +266 -320
  21. package/dist/src/cli/simple-commands/config.js +245 -290
  22. package/dist/src/cli/simple-commands/coordination.js +182 -234
  23. package/dist/src/cli/simple-commands/enhanced-ui-views.js +812 -615
  24. package/dist/src/cli/simple-commands/enhanced-webui-complete.js +922 -981
  25. package/dist/src/cli/simple-commands/fix-hook-variables.js +274 -294
  26. package/dist/src/cli/simple-commands/github/gh-coordinator.js +378 -457
  27. package/dist/src/cli/simple-commands/github/github-api.js +535 -574
  28. package/dist/src/cli/simple-commands/github/init.js +276 -303
  29. package/dist/src/cli/simple-commands/github.js +222 -247
  30. package/dist/src/cli/simple-commands/goal.js +51 -63
  31. package/dist/src/cli/simple-commands/hive-mind/auto-save-middleware.js +208 -278
  32. package/dist/src/cli/simple-commands/hive-mind/communication.js +601 -696
  33. package/dist/src/cli/simple-commands/hive-mind/core.js +907 -979
  34. package/dist/src/cli/simple-commands/hive-mind/db-optimizer.js +406 -655
  35. package/dist/src/cli/simple-commands/hive-mind/mcp-wrapper.js +1125 -1245
  36. package/dist/src/cli/simple-commands/hive-mind/memory.js +854 -1090
  37. package/dist/src/cli/simple-commands/hive-mind/performance-optimizer.js +459 -574
  38. package/dist/src/cli/simple-commands/hive-mind/performance-test.js +263 -347
  39. package/dist/src/cli/simple-commands/hive-mind/queen.js +727 -768
  40. package/dist/src/cli/simple-commands/hive-mind/session-manager.js +745 -1049
  41. package/dist/src/cli/simple-commands/hive-mind-optimize.js +227 -283
  42. package/dist/src/cli/simple-commands/hive-mind-wizard.js +174 -217
  43. package/dist/src/cli/simple-commands/hive-mind.js +1842 -2283
  44. package/dist/src/cli/simple-commands/hive.js +90 -79
  45. package/dist/src/cli/simple-commands/hook-safety.js +431 -521
  46. package/dist/src/cli/simple-commands/hooks/session-start-soul.js +203 -254
  47. package/dist/src/cli/simple-commands/hooks.js +1064 -1204
  48. package/dist/src/cli/simple-commands/init/agent-copier.js +294 -319
  49. package/dist/src/cli/simple-commands/init/batch-init.js +496 -562
  50. package/dist/src/cli/simple-commands/init/claude-commands/claude-flow-commands.js +13 -19
  51. package/dist/src/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +13 -19
  52. package/dist/src/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +61 -88
  53. package/dist/src/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +125 -150
  54. package/dist/src/cli/simple-commands/init/claude-commands/slash-commands.js +42 -49
  55. package/dist/src/cli/simple-commands/init/claude-commands/sparc-commands.js +43 -61
  56. package/dist/src/cli/simple-commands/init/copy-revised-templates.js +141 -147
  57. package/dist/src/cli/simple-commands/init/executable-wrapper.js +31 -44
  58. package/dist/src/cli/simple-commands/init/gitignore-updater.js +64 -90
  59. package/dist/src/cli/simple-commands/init/help.js +104 -107
  60. package/dist/src/cli/simple-commands/init/hive-mind-init.js +509 -528
  61. package/dist/src/cli/simple-commands/init/index.js +1510 -1759
  62. package/dist/src/cli/simple-commands/init/performance-monitor.js +234 -317
  63. package/dist/src/cli/simple-commands/init/rollback/backup-manager.js +441 -504
  64. package/dist/src/cli/simple-commands/init/rollback/index.js +289 -364
  65. package/dist/src/cli/simple-commands/init/rollback/recovery-manager.js +652 -728
  66. package/dist/src/cli/simple-commands/init/rollback/rollback-executor.js +416 -481
  67. package/dist/src/cli/simple-commands/init/rollback/state-tracker.js +369 -448
  68. package/dist/src/cli/simple-commands/init/sparc/roo-readme.js +1 -2
  69. package/dist/src/cli/simple-commands/init/sparc/roomodes-config.js +122 -99
  70. package/dist/src/cli/simple-commands/init/sparc/workflows.js +32 -37
  71. package/dist/src/cli/simple-commands/init/sparc-structure.js +55 -62
  72. package/dist/src/cli/simple-commands/init/template-copier.js +421 -533
  73. package/dist/src/cli/simple-commands/init/templates/coordination-md.js +3 -6
  74. package/dist/src/cli/simple-commands/init/templates/enhanced-templates.js +344 -318
  75. package/dist/src/cli/simple-commands/init/templates/github-safe-enhanced.js +173 -218
  76. package/dist/src/cli/simple-commands/init/templates/github-safe.js +65 -75
  77. package/dist/src/cli/simple-commands/init/templates/memory-bank-md.js +3 -6
  78. package/dist/src/cli/simple-commands/init/templates/readme-files.js +2 -4
  79. package/dist/src/cli/simple-commands/init/templates/safe-hook-patterns.js +187 -230
  80. package/dist/src/cli/simple-commands/init/templates/sparc-modes.js +53 -80
  81. package/dist/src/cli/simple-commands/init/templates/verification-claude-md.js +101 -85
  82. package/dist/src/cli/simple-commands/init/validation/config-validator.js +283 -330
  83. package/dist/src/cli/simple-commands/init/validation/health-checker.js +495 -561
  84. package/dist/src/cli/simple-commands/init/validation/index.js +302 -358
  85. package/dist/src/cli/simple-commands/init/validation/mode-validator.js +308 -359
  86. package/dist/src/cli/simple-commands/init/validation/post-init-validator.js +389 -366
  87. package/dist/src/cli/simple-commands/init/validation/pre-init-validator.js +270 -268
  88. package/dist/src/cli/simple-commands/init/validation/test-runner.js +427 -447
  89. package/dist/src/cli/simple-commands/init.js +1 -2
  90. package/dist/src/cli/simple-commands/mcp-health.js +131 -158
  91. package/dist/src/cli/simple-commands/mcp-integration-layer.js +533 -634
  92. package/dist/src/cli/simple-commands/mcp.js +345 -400
  93. package/dist/src/cli/simple-commands/memory-consolidation.js +426 -537
  94. package/dist/src/cli/simple-commands/memory.js +247 -311
  95. package/dist/src/cli/simple-commands/migrate-hooks.js +39 -46
  96. package/dist/src/cli/simple-commands/monitor.js +294 -363
  97. package/dist/src/cli/simple-commands/neural.js +51 -65
  98. package/dist/src/cli/simple-commands/pair-autofix-only.js +538 -662
  99. package/dist/src/cli/simple-commands/pair-basic.js +528 -656
  100. package/dist/src/cli/simple-commands/pair-old.js +430 -543
  101. package/dist/src/cli/simple-commands/pair-working.js +615 -751
  102. package/dist/src/cli/simple-commands/pair.js +615 -751
  103. package/dist/src/cli/simple-commands/performance-hooks.js +83 -111
  104. package/dist/src/cli/simple-commands/performance-metrics.js +348 -433
  105. package/dist/src/cli/simple-commands/process-ui-enhanced.js +708 -787
  106. package/dist/src/cli/simple-commands/process-ui.js +230 -254
  107. package/dist/src/cli/simple-commands/realtime-update-system.js +525 -611
  108. package/dist/src/cli/simple-commands/sparc/architecture.js +1704 -1530
  109. package/dist/src/cli/simple-commands/sparc/commands.js +438 -516
  110. package/dist/src/cli/simple-commands/sparc/completion.js +1224 -1481
  111. package/dist/src/cli/simple-commands/sparc/coordinator.js +913 -978
  112. package/dist/src/cli/simple-commands/sparc/index.js +241 -298
  113. package/dist/src/cli/simple-commands/sparc/phase-base.js +314 -390
  114. package/dist/src/cli/simple-commands/sparc/pseudocode.js +965 -869
  115. package/dist/src/cli/simple-commands/sparc/refinement.js +980 -1273
  116. package/dist/src/cli/simple-commands/sparc/specification.js +559 -645
  117. package/dist/src/cli/simple-commands/sparc-modes/architect.js +1 -1
  118. package/dist/src/cli/simple-commands/sparc-modes/ask.js +1 -1
  119. package/dist/src/cli/simple-commands/sparc-modes/code.js +1 -1
  120. package/dist/src/cli/simple-commands/sparc-modes/debug.js +1 -1
  121. package/dist/src/cli/simple-commands/sparc-modes/devops.js +1 -1
  122. package/dist/src/cli/simple-commands/sparc-modes/docs-writer.js +1 -1
  123. package/dist/src/cli/simple-commands/sparc-modes/generic.js +1 -1
  124. package/dist/src/cli/simple-commands/sparc-modes/index.js +47 -55
  125. package/dist/src/cli/simple-commands/sparc-modes/integration.js +1 -1
  126. package/dist/src/cli/simple-commands/sparc-modes/mcp.js +1 -1
  127. package/dist/src/cli/simple-commands/sparc-modes/monitoring.js +1 -1
  128. package/dist/src/cli/simple-commands/sparc-modes/optimization.js +1 -1
  129. package/dist/src/cli/simple-commands/sparc-modes/security-review.js +1 -1
  130. package/dist/src/cli/simple-commands/sparc-modes/sparc-orchestrator.js +1 -1
  131. package/dist/src/cli/simple-commands/sparc-modes/spec-pseudocode.js +1 -1
  132. package/dist/src/cli/simple-commands/sparc-modes/supabase-admin.js +1 -1
  133. package/dist/src/cli/simple-commands/sparc-modes/swarm.js +101 -87
  134. package/dist/src/cli/simple-commands/sparc-modes/tdd.js +1 -1
  135. package/dist/src/cli/simple-commands/sparc-modes/tutorial.js +1 -1
  136. package/dist/src/cli/simple-commands/sparc.js +465 -493
  137. package/dist/src/cli/simple-commands/start-ui.js +108 -132
  138. package/dist/src/cli/simple-commands/start-wrapper.js +240 -268
  139. package/dist/src/cli/simple-commands/start.js +1 -1
  140. package/dist/src/cli/simple-commands/status.js +254 -275
  141. package/dist/src/cli/simple-commands/stream-chain-clean.js +128 -171
  142. package/dist/src/cli/simple-commands/stream-chain-fixed.js +61 -82
  143. package/dist/src/cli/simple-commands/stream-chain-real.js +267 -331
  144. package/dist/src/cli/simple-commands/stream-chain-working.js +211 -263
  145. package/dist/src/cli/simple-commands/stream-chain.js +260 -318
  146. package/dist/src/cli/simple-commands/stream-processor.js +290 -315
  147. package/dist/src/cli/simple-commands/swarm-executor.js +189 -222
  148. package/dist/src/cli/simple-commands/swarm-metrics-integration.js +208 -300
  149. package/dist/src/cli/simple-commands/swarm-ui.js +623 -703
  150. package/dist/src/cli/simple-commands/swarm-webui-integration.js +258 -286
  151. package/dist/src/cli/simple-commands/swarm.js +887 -1082
  152. package/dist/src/cli/simple-commands/task.js +161 -206
  153. package/dist/src/cli/simple-commands/timestamp-fix.js +59 -89
  154. package/dist/src/cli/simple-commands/token-tracker.js +258 -316
  155. package/dist/src/cli/simple-commands/tool-execution-framework.js +433 -519
  156. package/dist/src/cli/simple-commands/train-and-stream.js +275 -331
  157. package/dist/src/cli/simple-commands/training-pipeline.js +619 -725
  158. package/dist/src/cli/simple-commands/training.js +170 -227
  159. package/dist/src/cli/simple-commands/verification-hooks.js +261 -284
  160. package/dist/src/cli/simple-commands/verification-integration.js +389 -417
  161. package/dist/src/cli/simple-commands/verification-training-integration.js +486 -606
  162. package/dist/src/cli/simple-commands/verification.js +493 -513
  163. package/dist/src/cli/simple-commands/web-server.js +766 -836
  164. package/dist/src/cli/simple-commands/webui-validator.js +106 -124
  165. package/dist/src/coordination/event-bus/demo-wasm-integration.js +212 -251
  166. package/dist/src/coordination/event-bus/qe-event-bus.js +608 -748
  167. package/dist/src/coordination/event-bus/qe-event-bus.test.js +379 -454
  168. package/dist/src/coordination/iteration-tracker.js +363 -454
  169. package/dist/src/enterprise/analytics-manager.js +1135 -0
  170. package/dist/src/enterprise/audit-manager.js +1115 -0
  171. package/dist/src/enterprise/cloud-manager.js +891 -0
  172. package/dist/src/enterprise/deployment-manager.js +966 -0
  173. package/dist/src/enterprise/index.js +6 -0
  174. package/dist/src/enterprise/project-manager.js +584 -0
  175. package/dist/src/enterprise/security-manager.js +991 -0
  176. package/dist/src/index.js +1 -1
  177. package/dist/src/mcp/DEPRECATED.js +46 -60
  178. package/dist/src/mcp/fixes/mcp-error-fixes.js +115 -134
  179. package/dist/src/mcp/implementations/agent-tracker.js +114 -128
  180. package/dist/src/mcp/implementations/daa-tools.js +292 -350
  181. package/dist/src/mcp/implementations/workflow-tools.js +329 -361
  182. package/dist/src/mcp/mcp-config-manager.js +1183 -1331
  183. package/dist/src/mcp/mcp-server-novice-simplified.js +11 -17
  184. package/dist/src/mcp/mcp-server-novice.js +11 -17
  185. package/dist/src/mcp/mcp-server-sdk.js +11 -17
  186. package/dist/src/mcp/mcp-server.js +1620 -1484
  187. package/dist/src/mcp/ruv-swarm-wrapper.js +209 -239
  188. package/dist/src/memory/advanced-serializer.js +609 -589
  189. package/dist/src/memory/enhanced-examples.js +220 -305
  190. package/dist/src/memory/enhanced-memory.js +295 -336
  191. package/dist/src/memory/enhanced-session-serializer.js +408 -492
  192. package/dist/src/memory/fallback-memory-system.js +900 -1021
  193. package/dist/src/memory/fallback-store.js +93 -131
  194. package/dist/src/memory/high-performance-serialization.js +592 -730
  195. package/dist/src/memory/in-memory-store.js +161 -213
  196. package/dist/src/memory/index.js +123 -157
  197. package/dist/src/memory/lock-free-structures.js +578 -764
  198. package/dist/src/memory/memory-mapped-persistence.js +585 -766
  199. package/dist/src/memory/memory-pressure-manager.js +569 -707
  200. package/dist/src/memory/migration.js +358 -445
  201. package/dist/src/memory/shared-memory.js +641 -768
  202. package/dist/src/memory/sqlite-store.js +245 -325
  203. package/dist/src/memory/sqlite-wrapper.js +122 -151
  204. package/dist/src/memory/swarm-memory.js +470 -603
  205. package/dist/src/memory/test-example.js +126 -134
  206. package/dist/src/memory/ultra-fast-memory-store.js +622 -821
  207. package/dist/src/memory/unified-memory-manager.js +356 -437
  208. package/dist/src/migration/index.js +92 -0
  209. package/dist/src/migration/logger.js +121 -0
  210. package/dist/src/migration/migration-analyzer.js +268 -0
  211. package/dist/src/migration/migration-runner.js +522 -0
  212. package/dist/src/migration/migration-validator.js +285 -0
  213. package/dist/src/migration/progress-reporter.js +150 -0
  214. package/dist/src/migration/rollback-manager.js +321 -0
  215. package/dist/src/migration/tests/migration-system.test.js +7 -0
  216. package/dist/src/migration/types.js +3 -0
  217. package/dist/src/swarm/CodeRefactoringSwarm.js +777 -952
  218. package/dist/src/swarm/__tests__/integration.test.js +227 -0
  219. package/dist/src/swarm/__tests__/prompt-copier.test.js +344 -0
  220. package/dist/src/swarm/advanced-orchestrator.js +1095 -0
  221. package/dist/src/swarm/claude-code-interface.js +961 -0
  222. package/dist/src/swarm/claude-flow-executor.js +229 -0
  223. package/dist/src/swarm/consensus-coordinator.js +475 -0
  224. package/dist/src/swarm/coordinator.js +2993 -0
  225. package/dist/src/swarm/direct-executor.js +1180 -0
  226. package/dist/src/swarm/error-recovery/advanced-error-detection.js +691 -0
  227. package/dist/src/swarm/error-recovery/automated-recovery-workflows.js +998 -0
  228. package/dist/src/swarm/error-recovery/error-recovery-coordinator.js +1197 -0
  229. package/dist/src/swarm/error-recovery/recovery-monitoring.js +772 -0
  230. package/dist/src/swarm/error-recovery/resilience-architecture.js +714 -0
  231. package/dist/src/swarm/error-recovery/self-healing-mechanisms.js +1319 -0
  232. package/dist/src/swarm/error-recovery/test-error-recovery-effectiveness.js +808 -0
  233. package/dist/src/swarm/executor-v2.js +322 -0
  234. package/dist/src/swarm/executor.js +815 -0
  235. package/dist/src/swarm/hive-mind-integration.js +703 -0
  236. package/dist/src/swarm/index.js +41 -0
  237. package/dist/src/swarm/json-output-aggregator.js +267 -0
  238. package/dist/src/swarm/large-scale-coordinator.js +542 -0
  239. package/dist/src/swarm/mcp-integration-wrapper.js +628 -0
  240. package/dist/src/swarm/memory.js +1117 -0
  241. package/dist/src/swarm/optimizations/__tests__/optimization.test.js +348 -0
  242. package/dist/src/swarm/optimizations/async-file-manager.js +285 -0
  243. package/dist/src/swarm/optimizations/circular-buffer.js +162 -0
  244. package/dist/src/swarm/optimizations/connection-pool.js +244 -0
  245. package/dist/src/swarm/optimizations/index.js +28 -0
  246. package/dist/src/swarm/optimizations/optimized-executor.js +320 -0
  247. package/dist/src/swarm/optimizations/ttl-map.js +234 -0
  248. package/dist/src/swarm/prompt-cli.js +200 -0
  249. package/dist/src/swarm/prompt-copier-enhanced.js +202 -0
  250. package/dist/src/swarm/prompt-copier.js +381 -0
  251. package/dist/src/swarm/prompt-manager.js +295 -0
  252. package/dist/src/swarm/prompt-utils.js +310 -0
  253. package/dist/src/swarm/result-aggregator.js +718 -0
  254. package/dist/src/swarm/sparc-executor.js +1568 -0
  255. package/dist/src/swarm/strategies/auto.js +758 -0
  256. package/dist/src/swarm/strategies/base.js +128 -0
  257. package/dist/src/swarm/strategies/research.js +914 -0
  258. package/dist/src/swarm/strategies/strategy-metrics-patch.js +2 -0
  259. package/dist/src/swarm/types.js +52 -0
  260. package/dist/src/swarm/workers/copy-worker.js +56 -0
  261. package/dist/src/utils/__tests__/github-cli-safety-wrapper.test.js +332 -400
  262. package/dist/src/utils/github-cli-safe.js +56 -64
  263. package/dist/src/utils/github-cli-safety-wrapper.js +451 -546
  264. package/dist/src/utils/npx-isolated-cache.js +104 -119
  265. package/dist/src/utils/preference-manager.js +622 -652
  266. package/dist/src/utils/timezone-utils.js +86 -105
  267. package/dist/src/validators/epic-config-schema.js +214 -0
  268. package/dist/src/validators/index.js +10 -0
  269. package/dist/src/validators/swarm-init-validator.js +259 -0
  270. package/dist/src/validators/todowrite-batching-validator.js +215 -0
  271. package/dist/src/validators/todowrite-integration.js +187 -0
  272. package/package.json +2 -2
@@ -2,1037 +2,978 @@
2
2
  * Enhanced Web UI Complete - Full Integration
3
3
  * Combines all MCP tools with enhanced UI views and real-time updates
4
4
  * Provides access to all 87 Claude-Flow MCP tools through a comprehensive interface
5
- */
6
-
7
- import { printSuccess, printError, printWarning, printInfo } from '../utils.js';
8
- import { compat } from '../runtime-detector.js';
9
- import SwarmWebUIIntegration from './swarm-webui-integration.js';
10
- import MCPIntegrationLayer from './mcp-integration-layer.js';
11
- import ToolExecutionFramework from './tool-execution-framework.js';
12
- import { EnhancedUIViews, ENHANCED_VIEWS } from './enhanced-ui-views.js';
13
- import RealtimeUpdateSystem from './realtime-update-system.js';
14
-
5
+ */ import { printSuccess, printInfo } from "../utils.js";
6
+ import SwarmWebUIIntegration from "./swarm-webui-integration.js";
7
+ import MCPIntegrationLayer from "./mcp-integration-layer.js";
8
+ import ToolExecutionFramework from "./tool-execution-framework.js";
9
+ import { EnhancedUIViews, ENHANCED_VIEWS } from "./enhanced-ui-views.js";
10
+ import RealtimeUpdateSystem from "./realtime-update-system.js";
15
11
  // Enhanced view modes with all tool categories
16
12
  const ALL_VIEWS = {
17
- ...ENHANCED_VIEWS,
18
- // Add any additional views if needed
13
+ ...ENHANCED_VIEWS
19
14
  };
20
-
21
15
  export class EnhancedWebUIComplete {
22
- constructor() {
23
- this.processes = new Map();
24
- this.running = true;
25
- this.selectedIndex = 0;
26
- this.currentView = ALL_VIEWS.PROCESSES;
27
- this.agents = [];
28
- this.tasks = [];
29
- this.memoryStats = {
30
- totalEntries: 0,
31
- totalSize: 0,
32
- namespaces: [],
33
- };
34
- this.logs = [];
35
- this.systemStats = {
36
- uptime: 0,
37
- totalTasks: 0,
38
- completedTasks: 0,
39
- activeAgents: 0,
40
- memoryUsage: 0,
41
- cpuUsage: 0,
42
- };
43
-
44
- // Enhanced components
45
- this.mcpIntegration = null;
46
- this.toolFramework = null;
47
- this.enhancedViews = null;
48
- this.realtimeUpdates = null;
49
-
50
- // Input handling
51
- this.inputBuffer = '';
52
- this.commandHistory = [];
53
- this.historyIndex = -1;
54
-
55
- // Colors for consistent styling
56
- this.colors = {
57
- cyan: (text) => `\x1b[36m${text}\x1b[0m`,
58
- gray: (text) => `\x1b[90m${text}\x1b[0m`,
59
- white: (text) => `\x1b[37m${text}\x1b[0m`,
60
- yellow: (text) => `\x1b[33m${text}\x1b[0m`,
61
- green: (text) => `\x1b[32m${text}\x1b[0m`,
62
- red: (text) => `\x1b[31m${text}\x1b[0m`,
63
- blue: (text) => `\x1b[34m${text}\x1b[0m`,
64
- magenta: (text) => `\x1b[35m${text}\x1b[0m`,
65
- bold: (text) => `\x1b[1m${text}\x1b[0m`,
66
- dim: (text) => `\x1b[2m${text}\x1b[0m`,
67
- };
68
-
69
- this.initializeEnhancedUI();
70
- }
71
-
72
- /**
16
+ /**
73
17
  * Initialize all enhanced UI components
74
- */
75
- async initializeEnhancedUI() {
76
- try {
77
- // Initialize original swarm integration
78
- this.swarmIntegration = new SwarmWebUIIntegration(this);
79
-
80
- // Initialize MCP integration layer
81
- this.mcpIntegration = new MCPIntegrationLayer(this);
82
-
83
- // Initialize tool execution framework
84
- this.toolFramework = new ToolExecutionFramework(this);
85
-
86
- // Initialize enhanced UI views
87
- this.enhancedViews = new EnhancedUIViews(this);
88
-
89
- // Initialize real-time update system
90
- this.realtimeUpdates = new RealtimeUpdateSystem(this);
91
-
92
- // Initialize default processes
93
- this.initializeProcesses();
94
-
95
- // Initialize mock data
96
- await this.initializeSystemData();
97
-
98
- // Start system monitoring
99
- this.startSystemMonitoring();
100
-
101
- this.addLog('success', '🚀 Enhanced Web UI fully initialized with all 87 MCP tools');
102
- } catch (error) {
103
- this.addLog('error', `Failed to initialize enhanced UI: ${error.message}`);
104
- throw error;
18
+ */ async initializeEnhancedUI() {
19
+ try {
20
+ // Initialize original swarm integration
21
+ this.swarmIntegration = new SwarmWebUIIntegration(this);
22
+ // Initialize MCP integration layer
23
+ this.mcpIntegration = new MCPIntegrationLayer(this);
24
+ // Initialize tool execution framework
25
+ this.toolFramework = new ToolExecutionFramework(this);
26
+ // Initialize enhanced UI views
27
+ this.enhancedViews = new EnhancedUIViews(this);
28
+ // Initialize real-time update system
29
+ this.realtimeUpdates = new RealtimeUpdateSystem(this);
30
+ // Initialize default processes
31
+ this.initializeProcesses();
32
+ // Initialize mock data
33
+ await this.initializeSystemData();
34
+ // Start system monitoring
35
+ this.startSystemMonitoring();
36
+ this.addLog('success', '🚀 Enhanced Web UI fully initialized with all 87 MCP tools');
37
+ } catch (error) {
38
+ this.addLog('error', `Failed to initialize enhanced UI: ${error.message}`);
39
+ throw error;
40
+ }
105
41
  }
106
- }
107
-
108
- /**
42
+ /**
109
43
  * Initialize system processes
110
- */
111
- initializeProcesses() {
112
- const PROCESSES = [
113
- { id: 'event-bus', name: 'Event Bus', description: 'Central event distribution system' },
114
- { id: 'orchestrator', name: 'Orchestrator', description: 'Main coordination engine' },
115
- { id: 'memory-manager', name: 'Memory Manager', description: 'Persistent memory system' },
116
- { id: 'terminal-pool', name: 'Terminal Pool', description: 'Terminal session management' },
117
- { id: 'mcp-server', name: 'MCP Server', description: 'Model Context Protocol server' },
118
- { id: 'coordinator', name: 'Coordinator', description: 'Task coordination service' },
119
- { id: 'neural-engine', name: 'Neural Engine', description: 'Neural network processing' },
120
- { id: 'analysis-service', name: 'Analysis Service', description: 'Performance analysis' },
121
- { id: 'workflow-engine', name: 'Workflow Engine', description: 'Automation workflows' },
122
- { id: 'github-connector', name: 'GitHub Connector', description: 'GitHub integration' },
123
- { id: 'daa-controller', name: 'DAA Controller', description: 'Dynamic agent architecture' },
124
- ];
125
-
126
- PROCESSES.forEach((p) => {
127
- this.processes.set(p.id, {
128
- ...p,
129
- status: 'running', // Start most services as running
130
- pid: Math.floor(Math.random() * 50000) + 1000,
131
- uptime: Math.floor(Math.random() * 86400), // Random uptime up to 24h
132
- cpu: Math.random() * 5,
133
- memory: Math.random() * 100,
134
- });
135
- });
136
- }
137
-
138
- /**
44
+ */ initializeProcesses() {
45
+ const PROCESSES = [
46
+ {
47
+ id: 'event-bus',
48
+ name: 'Event Bus',
49
+ description: 'Central event distribution system'
50
+ },
51
+ {
52
+ id: 'orchestrator',
53
+ name: 'Orchestrator',
54
+ description: 'Main coordination engine'
55
+ },
56
+ {
57
+ id: 'memory-manager',
58
+ name: 'Memory Manager',
59
+ description: 'Persistent memory system'
60
+ },
61
+ {
62
+ id: 'terminal-pool',
63
+ name: 'Terminal Pool',
64
+ description: 'Terminal session management'
65
+ },
66
+ {
67
+ id: 'mcp-server',
68
+ name: 'MCP Server',
69
+ description: 'Model Context Protocol server'
70
+ },
71
+ {
72
+ id: 'coordinator',
73
+ name: 'Coordinator',
74
+ description: 'Task coordination service'
75
+ },
76
+ {
77
+ id: 'neural-engine',
78
+ name: 'Neural Engine',
79
+ description: 'Neural network processing'
80
+ },
81
+ {
82
+ id: 'analysis-service',
83
+ name: 'Analysis Service',
84
+ description: 'Performance analysis'
85
+ },
86
+ {
87
+ id: 'workflow-engine',
88
+ name: 'Workflow Engine',
89
+ description: 'Automation workflows'
90
+ },
91
+ {
92
+ id: 'github-connector',
93
+ name: 'GitHub Connector',
94
+ description: 'GitHub integration'
95
+ },
96
+ {
97
+ id: 'daa-controller',
98
+ name: 'DAA Controller',
99
+ description: 'Dynamic agent architecture'
100
+ }
101
+ ];
102
+ PROCESSES.forEach((p)=>{
103
+ this.processes.set(p.id, {
104
+ ...p,
105
+ status: 'running',
106
+ pid: Math.floor(Math.random() * 50000) + 1000,
107
+ uptime: Math.floor(Math.random() * 86400),
108
+ cpu: Math.random() * 5,
109
+ memory: Math.random() * 100
110
+ });
111
+ });
112
+ }
113
+ /**
139
114
  * Initialize system data
140
- */
141
- async initializeSystemData() {
142
- // Initialize swarm
143
- await this.swarmIntegration.initializeSwarm('hierarchical', 8);
144
-
145
- // Initialize memory stats
146
- this.memoryStats = {
147
- totalEntries: 156,
148
- totalSize: '2.3 MB',
149
- namespaces: [
150
- { name: 'neural', entries: 42, size: '856 KB' },
151
- { name: 'swarm', entries: 35, size: '645 KB' },
152
- { name: 'analysis', entries: 28, size: '423 KB' },
153
- { name: 'workflow', entries: 24, size: '298 KB' },
154
- { name: 'github', entries: 15, size: '156 KB' },
155
- { name: 'system', entries: 12, size: '89 KB' },
156
- ],
157
- };
158
-
159
- // Initialize logs
160
- this.logs = [
161
- {
162
- time: new Date(),
163
- level: 'success',
164
- message: '🧠 Neural engine initialized with 27 models',
165
- },
166
- {
167
- time: new Date(),
168
- level: 'success',
169
- message: '🐝 Swarm orchestration active with hierarchical topology',
170
- },
171
- {
172
- time: new Date(),
173
- level: 'info',
174
- message: '📊 Analysis service monitoring 13 performance metrics',
175
- },
176
- {
177
- time: new Date(),
178
- level: 'success',
179
- message: '🔄 Workflow engine loaded 11 automation tools',
180
- },
181
- {
182
- time: new Date(),
183
- level: 'info',
184
- message: '🐙 GitHub connector established with 8 integration tools',
185
- },
186
- {
187
- time: new Date(),
188
- level: 'success',
189
- message: '🤖 DAA controller managing 8 dynamic agent tools',
190
- },
191
- {
192
- time: new Date(),
193
- level: 'success',
194
- message: '💾 Memory system active with 12 persistence tools',
195
- },
196
- {
197
- time: new Date(),
198
- level: 'success',
199
- message: '🛠️ System utilities loaded 8 management tools',
200
- },
201
- ];
202
-
203
- // Start uptime counter
204
- setInterval(() => {
205
- this.systemStats.uptime++;
206
- // Update process uptimes
207
- this.processes.forEach((process) => {
208
- if (process.status === 'running') {
209
- process.uptime++;
210
- }
211
- });
212
- }, 1000);
213
- }
214
-
215
- /**
115
+ */ async initializeSystemData() {
116
+ // Initialize swarm
117
+ await this.swarmIntegration.initializeSwarm('hierarchical', 8);
118
+ // Initialize memory stats
119
+ this.memoryStats = {
120
+ totalEntries: 156,
121
+ totalSize: '2.3 MB',
122
+ namespaces: [
123
+ {
124
+ name: 'neural',
125
+ entries: 42,
126
+ size: '856 KB'
127
+ },
128
+ {
129
+ name: 'swarm',
130
+ entries: 35,
131
+ size: '645 KB'
132
+ },
133
+ {
134
+ name: 'analysis',
135
+ entries: 28,
136
+ size: '423 KB'
137
+ },
138
+ {
139
+ name: 'workflow',
140
+ entries: 24,
141
+ size: '298 KB'
142
+ },
143
+ {
144
+ name: 'github',
145
+ entries: 15,
146
+ size: '156 KB'
147
+ },
148
+ {
149
+ name: 'system',
150
+ entries: 12,
151
+ size: '89 KB'
152
+ }
153
+ ]
154
+ };
155
+ // Initialize logs
156
+ this.logs = [
157
+ {
158
+ time: new Date(),
159
+ level: 'success',
160
+ message: '🧠 Neural engine initialized with 27 models'
161
+ },
162
+ {
163
+ time: new Date(),
164
+ level: 'success',
165
+ message: '🐝 Swarm orchestration active with hierarchical topology'
166
+ },
167
+ {
168
+ time: new Date(),
169
+ level: 'info',
170
+ message: '📊 Analysis service monitoring 13 performance metrics'
171
+ },
172
+ {
173
+ time: new Date(),
174
+ level: 'success',
175
+ message: '🔄 Workflow engine loaded 11 automation tools'
176
+ },
177
+ {
178
+ time: new Date(),
179
+ level: 'info',
180
+ message: '🐙 GitHub connector established with 8 integration tools'
181
+ },
182
+ {
183
+ time: new Date(),
184
+ level: 'success',
185
+ message: '🤖 DAA controller managing 8 dynamic agent tools'
186
+ },
187
+ {
188
+ time: new Date(),
189
+ level: 'success',
190
+ message: '💾 Memory system active with 12 persistence tools'
191
+ },
192
+ {
193
+ time: new Date(),
194
+ level: 'success',
195
+ message: '🛠️ System utilities loaded 8 management tools'
196
+ }
197
+ ];
198
+ // Start uptime counter
199
+ setInterval(()=>{
200
+ this.systemStats.uptime++;
201
+ // Update process uptimes
202
+ this.processes.forEach((process1)=>{
203
+ if (process1.status === 'running') {
204
+ process1.uptime++;
205
+ }
206
+ });
207
+ }, 1000);
208
+ }
209
+ /**
216
210
  * Start system monitoring
217
- */
218
- startSystemMonitoring() {
219
- setInterval(() => {
220
- // Update system stats
221
- this.systemStats.cpuUsage = Math.max(
222
- 0,
223
- this.systemStats.cpuUsage + (Math.random() - 0.5) * 2,
224
- );
225
- this.systemStats.memoryUsage = Math.max(
226
- 0,
227
- this.systemStats.memoryUsage + (Math.random() - 0.5) * 3,
228
- );
229
-
230
- // Update process stats
231
- this.processes.forEach((process) => {
232
- if (process.status === 'running') {
233
- process.cpu = Math.max(0, process.cpu + (Math.random() - 0.5) * 1);
234
- process.memory = Math.max(0, process.memory + (Math.random() - 0.5) * 5);
235
- }
236
- });
237
-
238
- // Emit performance metrics for real-time updates
239
- if (this.realtimeUpdates) {
240
- this.realtimeUpdates.emit('system_stats_update', {
241
- cpuUsage: this.systemStats.cpuUsage,
242
- memoryUsage: this.systemStats.memoryUsage,
243
- processCount: this.processes.size,
244
- });
245
- }
246
- }, 5000);
247
- }
248
-
249
- /**
211
+ */ startSystemMonitoring() {
212
+ setInterval(()=>{
213
+ // Update system stats
214
+ this.systemStats.cpuUsage = Math.max(0, this.systemStats.cpuUsage + (Math.random() - 0.5) * 2);
215
+ this.systemStats.memoryUsage = Math.max(0, this.systemStats.memoryUsage + (Math.random() - 0.5) * 3);
216
+ // Update process stats
217
+ this.processes.forEach((process1)=>{
218
+ if (process1.status === 'running') {
219
+ process1.cpu = Math.max(0, process1.cpu + (Math.random() - 0.5) * 1);
220
+ process1.memory = Math.max(0, process1.memory + (Math.random() - 0.5) * 5);
221
+ }
222
+ });
223
+ // Emit performance metrics for real-time updates
224
+ if (this.realtimeUpdates) {
225
+ this.realtimeUpdates.emit('system_stats_update', {
226
+ cpuUsage: this.systemStats.cpuUsage,
227
+ memoryUsage: this.systemStats.memoryUsage,
228
+ processCount: this.processes.size
229
+ });
230
+ }
231
+ }, 5000);
232
+ }
233
+ /**
250
234
  * Start the enhanced UI
251
- */
252
- async start() {
253
- // Clear screen
254
- console.clear();
255
-
256
- // Show enhanced welcome
257
- printSuccess('🧠 Claude-Flow Enhanced Web UI v2.0.0');
258
- printInfo('🔧 Comprehensive MCP Tool Integration - 87 Tools Available');
259
- console.log('─'.repeat(80));
260
- console.log();
261
-
262
- // Show tool categories summary
263
- this.showToolCategoriesSummary();
264
-
265
- // Initial render
266
- this.render();
267
-
268
- // Setup input handling
269
- this.setupInputHandling();
270
-
271
- // Main UI loop
272
- while (this.running) {
273
- await this.handleInput();
274
- if (this.running) {
235
+ */ async start() {
236
+ // Clear screen
237
+ console.clear();
238
+ // Show enhanced welcome
239
+ printSuccess('🧠 Claude-Flow Enhanced Web UI v2.0.0');
240
+ printInfo('🔧 Comprehensive MCP Tool Integration - 87 Tools Available');
241
+ console.log('─'.repeat(80));
242
+ console.log();
243
+ // Show tool categories summary
244
+ this.showToolCategoriesSummary();
245
+ // Initial render
275
246
  this.render();
276
- }
247
+ // Setup input handling
248
+ this.setupInputHandling();
249
+ // Main UI loop
250
+ while(this.running){
251
+ await this.handleInput();
252
+ if (this.running) {
253
+ this.render();
254
+ }
255
+ }
277
256
  }
278
- }
279
-
280
- /**
257
+ /**
281
258
  * Show tool categories summary at startup
282
- */
283
- showToolCategoriesSummary() {
284
- const categories = [
285
- { name: 'Swarm Coordination', count: 12, icon: '🐝' },
286
- { name: 'Neural Networks', count: 15, icon: '🧠' },
287
- { name: 'Memory & Persistence', count: 12, icon: '💾' },
288
- { name: 'Analysis & Monitoring', count: 13, icon: '📊' },
289
- { name: 'Workflow & Automation', count: 11, icon: '🔄' },
290
- { name: 'GitHub Integration', count: 8, icon: '🐙' },
291
- { name: 'Dynamic Agents (DAA)', count: 8, icon: '🤖' },
292
- { name: 'System & Utilities', count: 8, icon: '🛠️' },
293
- ];
294
-
295
- console.log(this.colors.cyan('📂 Available Tool Categories:'));
296
- categories.forEach((cat) => {
297
- console.log(
298
- ` ${cat.icon} ${this.colors.white(cat.name)}: ${this.colors.yellow(cat.count)} tools`,
299
- );
300
- });
301
- console.log();
302
- console.log(this.colors.green(`Total: ${this.colors.bold('87')} MCP tools ready for use`));
303
- console.log();
304
- }
305
-
306
- /**
259
+ */ showToolCategoriesSummary() {
260
+ const categories = [
261
+ {
262
+ name: 'Swarm Coordination',
263
+ count: 12,
264
+ icon: '🐝'
265
+ },
266
+ {
267
+ name: 'Neural Networks',
268
+ count: 15,
269
+ icon: '🧠'
270
+ },
271
+ {
272
+ name: 'Memory & Persistence',
273
+ count: 12,
274
+ icon: '💾'
275
+ },
276
+ {
277
+ name: 'Analysis & Monitoring',
278
+ count: 13,
279
+ icon: '📊'
280
+ },
281
+ {
282
+ name: 'Workflow & Automation',
283
+ count: 11,
284
+ icon: '🔄'
285
+ },
286
+ {
287
+ name: 'GitHub Integration',
288
+ count: 8,
289
+ icon: '🐙'
290
+ },
291
+ {
292
+ name: 'Dynamic Agents (DAA)',
293
+ count: 8,
294
+ icon: '🤖'
295
+ },
296
+ {
297
+ name: 'System & Utilities',
298
+ count: 8,
299
+ icon: '🛠️'
300
+ }
301
+ ];
302
+ console.log(this.colors.cyan('📂 Available Tool Categories:'));
303
+ categories.forEach((cat)=>{
304
+ console.log(` ${cat.icon} ${this.colors.white(cat.name)}: ${this.colors.yellow(cat.count)} tools`);
305
+ });
306
+ console.log();
307
+ console.log(this.colors.green(`Total: ${this.colors.bold('87')} MCP tools ready for use`));
308
+ console.log();
309
+ }
310
+ /**
307
311
  * Setup input handling for enhanced features
308
- */
309
- setupInputHandling() {
310
- // Enable raw input mode for better key handling
311
- if (process.stdin.setRawMode) {
312
- process.stdin.setRawMode(true);
312
+ */ setupInputHandling() {
313
+ // Enable raw input mode for better key handling
314
+ if (process.stdin.setRawMode) {
315
+ process.stdin.setRawMode(true);
316
+ }
317
+ process.stdin.resume();
313
318
  }
314
- process.stdin.resume();
315
- }
316
-
317
- /**
319
+ /**
318
320
  * Enhanced render method
319
- */
320
- render() {
321
- // Clear screen and move cursor to top
322
- console.log('\x1b[2J\x1b[H');
323
-
324
- // Header with enhanced navigation
325
- this.renderEnhancedHeader();
326
-
327
- // Main content based on current view
328
- switch (this.currentView) {
329
- case ALL_VIEWS.PROCESSES:
330
- this.renderProcessView();
331
- break;
332
- case ALL_VIEWS.STATUS:
333
- this.renderStatusView();
334
- break;
335
- case ALL_VIEWS.ORCHESTRATION:
336
- this.renderOrchestrationView();
337
- break;
338
- case ALL_VIEWS.MEMORY:
339
- this.renderMemoryView();
340
- break;
341
- case ALL_VIEWS.LOGS:
342
- this.renderLogsView();
343
- break;
344
- case ALL_VIEWS.NEURAL:
345
- this.enhancedViews.renderNeuralView();
346
- break;
347
- case ALL_VIEWS.ANALYSIS:
348
- this.enhancedViews.renderAnalysisView();
349
- break;
350
- case ALL_VIEWS.WORKFLOW:
351
- this.enhancedViews.renderWorkflowView();
352
- break;
353
- case ALL_VIEWS.GITHUB:
354
- this.enhancedViews.renderGitHubView();
355
- break;
356
- case ALL_VIEWS.DAA:
357
- this.enhancedViews.renderDAAView();
358
- break;
359
- case ALL_VIEWS.SYSTEM:
360
- this.enhancedViews.renderSystemView();
361
- break;
362
- case ALL_VIEWS.TOOLS:
363
- this.enhancedViews.renderToolsView();
364
- break;
365
- case ALL_VIEWS.HELP:
366
- this.renderEnhancedHelpView();
367
- break;
321
+ */ render() {
322
+ // Clear screen and move cursor to top
323
+ console.log('\x1b[2J\x1b[H');
324
+ // Header with enhanced navigation
325
+ this.renderEnhancedHeader();
326
+ // Main content based on current view
327
+ switch(this.currentView){
328
+ case ALL_VIEWS.PROCESSES:
329
+ this.renderProcessView();
330
+ break;
331
+ case ALL_VIEWS.STATUS:
332
+ this.renderStatusView();
333
+ break;
334
+ case ALL_VIEWS.ORCHESTRATION:
335
+ this.renderOrchestrationView();
336
+ break;
337
+ case ALL_VIEWS.MEMORY:
338
+ this.renderMemoryView();
339
+ break;
340
+ case ALL_VIEWS.LOGS:
341
+ this.renderLogsView();
342
+ break;
343
+ case ALL_VIEWS.NEURAL:
344
+ this.enhancedViews.renderNeuralView();
345
+ break;
346
+ case ALL_VIEWS.ANALYSIS:
347
+ this.enhancedViews.renderAnalysisView();
348
+ break;
349
+ case ALL_VIEWS.WORKFLOW:
350
+ this.enhancedViews.renderWorkflowView();
351
+ break;
352
+ case ALL_VIEWS.GITHUB:
353
+ this.enhancedViews.renderGitHubView();
354
+ break;
355
+ case ALL_VIEWS.DAA:
356
+ this.enhancedViews.renderDAAView();
357
+ break;
358
+ case ALL_VIEWS.SYSTEM:
359
+ this.enhancedViews.renderSystemView();
360
+ break;
361
+ case ALL_VIEWS.TOOLS:
362
+ this.enhancedViews.renderToolsView();
363
+ break;
364
+ case ALL_VIEWS.HELP:
365
+ this.renderEnhancedHelpView();
366
+ break;
367
+ }
368
+ // Enhanced footer with more controls
369
+ this.renderEnhancedFooter();
368
370
  }
369
-
370
- // Enhanced footer with more controls
371
- this.renderEnhancedFooter();
372
- }
373
-
374
- /**
371
+ /**
375
372
  * Render enhanced header with all navigation options
376
- */
377
- renderEnhancedHeader() {
378
- console.log(this.colors.cyan(this.colors.bold('🧠 Claude-Flow Enhanced Web UI v2.0.0')));
379
- console.log(this.colors.gray('─'.repeat(80)));
380
-
381
- // Main navigation tabs (row 1)
382
- const mainTabs = [
383
- { key: '1', view: ALL_VIEWS.PROCESSES, label: 'Processes' },
384
- { key: '2', view: ALL_VIEWS.STATUS, label: 'Status' },
385
- { key: '3', view: ALL_VIEWS.ORCHESTRATION, label: 'Orchestration' },
386
- { key: '4', view: ALL_VIEWS.MEMORY, label: 'Memory' },
387
- { key: '5', view: ALL_VIEWS.LOGS, label: 'Logs' },
388
- ];
389
-
390
- let mainTabLine = '';
391
- mainTabs.forEach((tab) => {
392
- const isActive = this.currentView === tab.view;
393
- const label = isActive
394
- ? this.colors.yellow(`[${tab.label}]`)
395
- : this.colors.gray(`${tab.label}`);
396
- mainTabLine += ` ${this.colors.bold(tab.key)}:${label}`;
397
- });
398
-
399
- console.log(mainTabLine);
400
-
401
- // Enhanced tool tabs (row 2)
402
- const toolTabs = [
403
- { key: '6', view: ALL_VIEWS.NEURAL, label: 'Neural', icon: '🧠' },
404
- { key: '7', view: ALL_VIEWS.ANALYSIS, label: 'Analysis', icon: '📊' },
405
- { key: '8', view: ALL_VIEWS.WORKFLOW, label: 'Workflow', icon: '🔄' },
406
- { key: '9', view: ALL_VIEWS.GITHUB, label: 'GitHub', icon: '🐙' },
407
- { key: '0', view: ALL_VIEWS.DAA, label: 'DAA', icon: '🤖' },
408
- ];
409
-
410
- let toolTabLine = '';
411
- toolTabs.forEach((tab) => {
412
- const isActive = this.currentView === tab.view;
413
- const label = isActive
414
- ? this.colors.yellow(`[${tab.icon}${tab.label}]`)
415
- : this.colors.gray(`${tab.icon}${tab.label}`);
416
- toolTabLine += ` ${this.colors.bold(tab.key)}:${label}`;
417
- });
418
-
419
- console.log(toolTabLine);
420
-
421
- // Additional tabs (row 3)
422
- const additionalTabs = [
423
- { key: 't', view: ALL_VIEWS.TOOLS, label: 'Tools', icon: '🎛️' },
424
- { key: 's', view: ALL_VIEWS.SYSTEM, label: 'System', icon: '🛠️' },
425
- { key: 'h', view: ALL_VIEWS.HELP, label: 'Help', icon: '❓' },
426
- ];
427
-
428
- let additionalTabLine = '';
429
- additionalTabs.forEach((tab) => {
430
- const isActive = this.currentView === tab.view;
431
- const label = isActive
432
- ? this.colors.yellow(`[${tab.icon}${tab.label}]`)
433
- : this.colors.gray(`${tab.icon}${tab.label}`);
434
- additionalTabLine += ` ${this.colors.bold(tab.key)}:${label}`;
435
- });
436
-
437
- console.log(additionalTabLine);
438
- console.log(this.colors.gray(''.repeat(80)));
439
- console.log();
440
- }
441
-
442
- /**
373
+ */ renderEnhancedHeader() {
374
+ console.log(this.colors.cyan(this.colors.bold('🧠 Claude-Flow Enhanced Web UI v2.0.0')));
375
+ console.log(this.colors.gray('─'.repeat(80)));
376
+ // Main navigation tabs (row 1)
377
+ const mainTabs = [
378
+ {
379
+ key: '1',
380
+ view: ALL_VIEWS.PROCESSES,
381
+ label: 'Processes'
382
+ },
383
+ {
384
+ key: '2',
385
+ view: ALL_VIEWS.STATUS,
386
+ label: 'Status'
387
+ },
388
+ {
389
+ key: '3',
390
+ view: ALL_VIEWS.ORCHESTRATION,
391
+ label: 'Orchestration'
392
+ },
393
+ {
394
+ key: '4',
395
+ view: ALL_VIEWS.MEMORY,
396
+ label: 'Memory'
397
+ },
398
+ {
399
+ key: '5',
400
+ view: ALL_VIEWS.LOGS,
401
+ label: 'Logs'
402
+ }
403
+ ];
404
+ let mainTabLine = '';
405
+ mainTabs.forEach((tab)=>{
406
+ const isActive = this.currentView === tab.view;
407
+ const label = isActive ? this.colors.yellow(`[${tab.label}]`) : this.colors.gray(`${tab.label}`);
408
+ mainTabLine += ` ${this.colors.bold(tab.key)}:${label}`;
409
+ });
410
+ console.log(mainTabLine);
411
+ // Enhanced tool tabs (row 2)
412
+ const toolTabs = [
413
+ {
414
+ key: '6',
415
+ view: ALL_VIEWS.NEURAL,
416
+ label: 'Neural',
417
+ icon: '🧠'
418
+ },
419
+ {
420
+ key: '7',
421
+ view: ALL_VIEWS.ANALYSIS,
422
+ label: 'Analysis',
423
+ icon: '📊'
424
+ },
425
+ {
426
+ key: '8',
427
+ view: ALL_VIEWS.WORKFLOW,
428
+ label: 'Workflow',
429
+ icon: '🔄'
430
+ },
431
+ {
432
+ key: '9',
433
+ view: ALL_VIEWS.GITHUB,
434
+ label: 'GitHub',
435
+ icon: '🐙'
436
+ },
437
+ {
438
+ key: '0',
439
+ view: ALL_VIEWS.DAA,
440
+ label: 'DAA',
441
+ icon: '🤖'
442
+ }
443
+ ];
444
+ let toolTabLine = '';
445
+ toolTabs.forEach((tab)=>{
446
+ const isActive = this.currentView === tab.view;
447
+ const label = isActive ? this.colors.yellow(`[${tab.icon}${tab.label}]`) : this.colors.gray(`${tab.icon}${tab.label}`);
448
+ toolTabLine += ` ${this.colors.bold(tab.key)}:${label}`;
449
+ });
450
+ console.log(toolTabLine);
451
+ // Additional tabs (row 3)
452
+ const additionalTabs = [
453
+ {
454
+ key: 't',
455
+ view: ALL_VIEWS.TOOLS,
456
+ label: 'Tools',
457
+ icon: '🎛️'
458
+ },
459
+ {
460
+ key: 's',
461
+ view: ALL_VIEWS.SYSTEM,
462
+ label: 'System',
463
+ icon: '🛠️'
464
+ },
465
+ {
466
+ key: 'h',
467
+ view: ALL_VIEWS.HELP,
468
+ label: 'Help',
469
+ icon: '❓'
470
+ }
471
+ ];
472
+ let additionalTabLine = '';
473
+ additionalTabs.forEach((tab)=>{
474
+ const isActive = this.currentView === tab.view;
475
+ const label = isActive ? this.colors.yellow(`[${tab.icon}${tab.label}]`) : this.colors.gray(`${tab.icon}${tab.label}`);
476
+ additionalTabLine += ` ${this.colors.bold(tab.key)}:${label}`;
477
+ });
478
+ console.log(additionalTabLine);
479
+ console.log(this.colors.gray('─'.repeat(80)));
480
+ console.log();
481
+ }
482
+ /**
443
483
  * Render enhanced help view
444
- */
445
- renderEnhancedHelpView() {
446
- console.log(this.colors.white(this.colors.bold('❓ Enhanced Web UI Help')));
447
- console.log();
448
-
449
- console.log(this.colors.cyan('🗝️ Navigation Keys:'));
450
- console.log(' 1-5: Main views (Processes, Status, Orchestration, Memory, Logs)');
451
- console.log(' 6-0: Tool categories (Neural, Analysis, Workflow, GitHub, DAA)');
452
- console.log(' t: Tool execution center');
453
- console.log(' s: System utilities');
454
- console.log(' h: This help screen');
455
- console.log();
456
-
457
- console.log(this.colors.cyan('🔧 Tool Categories:'));
458
- console.log(' 🧠 Neural (15 tools): Training, prediction, model management');
459
- console.log(' 📊 Analysis (13 tools): Performance reports, monitoring, metrics');
460
- console.log(' 🔄 Workflow (11 tools): Automation, pipelines, scheduling');
461
- console.log(' 🐙 GitHub (8 tools): Repository management, PR automation');
462
- console.log(' 🤖 DAA (8 tools): Dynamic agent architecture');
463
- console.log(' 🛠️ System (8 tools): Configuration, security, diagnostics');
464
- console.log(' 🐝 Swarm (12 tools): Agent coordination, task orchestration');
465
- console.log(' 💾 Memory (12 tools): Persistence, caching, namespaces');
466
- console.log();
467
-
468
- console.log(this.colors.cyan(' Quick Actions:'));
469
- console.log(' r: Run custom tool (from any view)');
470
- console.log(' w: Execute workflow');
471
- console.log(' b: Batch tool execution');
472
- console.log(' c: Clear screen');
473
- console.log(' q: Quit application');
474
- console.log();
475
-
476
- console.log(this.colors.cyan('💡 Features:'));
477
- console.log(' • Real-time updates and monitoring');
478
- console.log(' • Comprehensive MCP tool integration');
479
- console.log(' • Batch and workflow execution');
480
- console.log(' • Performance tracking and analysis');
481
- console.log(' • Memory management and persistence');
482
- console.log(' • GitHub integration and automation');
483
- console.log(' • Dynamic agent architecture');
484
- console.log(' • Neural network management');
485
- }
486
-
487
- /**
484
+ */ renderEnhancedHelpView() {
485
+ console.log(this.colors.white(this.colors.bold('❓ Enhanced Web UI Help')));
486
+ console.log();
487
+ console.log(this.colors.cyan('🗝️ Navigation Keys:'));
488
+ console.log(' 1-5: Main views (Processes, Status, Orchestration, Memory, Logs)');
489
+ console.log(' 6-0: Tool categories (Neural, Analysis, Workflow, GitHub, DAA)');
490
+ console.log(' t: Tool execution center');
491
+ console.log(' s: System utilities');
492
+ console.log(' h: This help screen');
493
+ console.log();
494
+ console.log(this.colors.cyan('🔧 Tool Categories:'));
495
+ console.log(' 🧠 Neural (15 tools): Training, prediction, model management');
496
+ console.log(' 📊 Analysis (13 tools): Performance reports, monitoring, metrics');
497
+ console.log(' 🔄 Workflow (11 tools): Automation, pipelines, scheduling');
498
+ console.log(' 🐙 GitHub (8 tools): Repository management, PR automation');
499
+ console.log(' 🤖 DAA (8 tools): Dynamic agent architecture');
500
+ console.log(' 🛠️ System (8 tools): Configuration, security, diagnostics');
501
+ console.log(' 🐝 Swarm (12 tools): Agent coordination, task orchestration');
502
+ console.log(' 💾 Memory (12 tools): Persistence, caching, namespaces');
503
+ console.log();
504
+ console.log(this.colors.cyan(' Quick Actions:'));
505
+ console.log(' r: Run custom tool (from any view)');
506
+ console.log(' w: Execute workflow');
507
+ console.log(' b: Batch tool execution');
508
+ console.log(' c: Clear screen');
509
+ console.log(' q: Quit application');
510
+ console.log();
511
+ console.log(this.colors.cyan('💡 Features:'));
512
+ console.log(' Real-time updates and monitoring');
513
+ console.log(' Comprehensive MCP tool integration');
514
+ console.log(' • Batch and workflow execution');
515
+ console.log(' • Performance tracking and analysis');
516
+ console.log(' Memory management and persistence');
517
+ console.log(' • GitHub integration and automation');
518
+ console.log(' • Dynamic agent architecture');
519
+ console.log(' • Neural network management');
520
+ }
521
+ /**
488
522
  * Render enhanced footer
489
- */
490
- renderEnhancedFooter() {
491
- console.log();
492
- console.log(this.colors.gray('─'.repeat(80)));
493
-
494
- // Status line
495
- const mcpStatus = this.mcpIntegration ? this.mcpIntegration.getStatus() : null;
496
- const toolStatus = this.toolFramework ? this.toolFramework.getStatus() : null;
497
-
498
- let statusLine = `🧠 Claude-Flow Enhanced UI | `;
499
- statusLine += `MCP: ${mcpStatus?.mcpAvailable ? this.colors.green('✓') : this.colors.red('✗')} | `;
500
- statusLine += `Tools: ${this.colors.yellow(mcpStatus?.totalTools || 87)} | `;
501
- statusLine += `Active: ${this.colors.blue(toolStatus?.currentExecutions || 0)} | `;
502
- statusLine += `Queued: ${this.colors.cyan(toolStatus?.queuedExecutions || 0)} | `;
503
- statusLine += `Uptime: ${this.colors.white(this.formatUptime(this.systemStats.uptime))}`;
504
-
505
- console.log(statusLine);
506
-
507
- // Controls line
508
- let controlsLine = `${this.colors.gray('Controls:')} `;
509
- controlsLine += `${this.colors.yellow('r')}=Run Tool | `;
510
- controlsLine += `${this.colors.yellow('w')}=Workflow | `;
511
- controlsLine += `${this.colors.yellow('b')}=Batch | `;
512
- controlsLine += `${this.colors.yellow('c')}=Clear | `;
513
- controlsLine += `${this.colors.yellow('q')}=Quit | `;
514
- controlsLine += `${this.colors.yellow('↑↓')}=Navigate`;
515
-
516
- console.log(controlsLine);
517
- }
518
-
519
- /**
523
+ */ renderEnhancedFooter() {
524
+ console.log();
525
+ console.log(this.colors.gray('─'.repeat(80)));
526
+ // Status line
527
+ const mcpStatus = this.mcpIntegration ? this.mcpIntegration.getStatus() : null;
528
+ const toolStatus = this.toolFramework ? this.toolFramework.getStatus() : null;
529
+ let statusLine = `🧠 Claude-Flow Enhanced UI | `;
530
+ statusLine += `MCP: ${mcpStatus?.mcpAvailable ? this.colors.green('✓') : this.colors.red('✗')} | `;
531
+ statusLine += `Tools: ${this.colors.yellow(mcpStatus?.totalTools || 87)} | `;
532
+ statusLine += `Active: ${this.colors.blue(toolStatus?.currentExecutions || 0)} | `;
533
+ statusLine += `Queued: ${this.colors.cyan(toolStatus?.queuedExecutions || 0)} | `;
534
+ statusLine += `Uptime: ${this.colors.white(this.formatUptime(this.systemStats.uptime))}`;
535
+ console.log(statusLine);
536
+ // Controls line
537
+ let controlsLine = `${this.colors.gray('Controls:')} `;
538
+ controlsLine += `${this.colors.yellow('r')}=Run Tool | `;
539
+ controlsLine += `${this.colors.yellow('w')}=Workflow | `;
540
+ controlsLine += `${this.colors.yellow('b')}=Batch | `;
541
+ controlsLine += `${this.colors.yellow('c')}=Clear | `;
542
+ controlsLine += `${this.colors.yellow('q')}=Quit | `;
543
+ controlsLine += `${this.colors.yellow('↑↓')}=Navigate`;
544
+ console.log(controlsLine);
545
+ }
546
+ /**
520
547
  * Enhanced input handling
521
- */
522
- async handleInput() {
523
- return new Promise((resolve) => {
524
- const onData = async (chunk) => {
525
- const key = chunk.toString();
526
-
527
- // Remove listener
528
- process.stdin.removeListener('data', onData);
529
-
530
- try {
531
- // Handle navigation keys
532
- if (await this.handleNavigationInput(key)) {
533
- resolve();
534
- return;
535
- }
536
-
537
- // Handle enhanced view input
538
- if (await this.handleEnhancedViewInput(key)) {
539
- resolve();
540
- return;
541
- }
542
-
543
- // Handle global commands
544
- if (await this.handleGlobalCommands(key)) {
545
- resolve();
546
- return;
547
- }
548
-
549
- // Handle original input
550
- await this.handleOriginalInput(key);
551
- } catch (error) {
552
- this.addLog('error', `Input handling error: ${error.message}`);
553
- }
554
-
555
- resolve();
556
- };
557
-
558
- process.stdin.once('data', onData);
559
- });
560
- }
561
-
562
- /**
548
+ */ async handleInput() {
549
+ return new Promise((resolve)=>{
550
+ const onData = async (chunk)=>{
551
+ const key = chunk.toString();
552
+ // Remove listener
553
+ process.stdin.removeListener('data', onData);
554
+ try {
555
+ // Handle navigation keys
556
+ if (await this.handleNavigationInput(key)) {
557
+ resolve();
558
+ return;
559
+ }
560
+ // Handle enhanced view input
561
+ if (await this.handleEnhancedViewInput(key)) {
562
+ resolve();
563
+ return;
564
+ }
565
+ // Handle global commands
566
+ if (await this.handleGlobalCommands(key)) {
567
+ resolve();
568
+ return;
569
+ }
570
+ // Handle original input
571
+ await this.handleOriginalInput(key);
572
+ } catch (error) {
573
+ this.addLog('error', `Input handling error: ${error.message}`);
574
+ }
575
+ resolve();
576
+ };
577
+ process.stdin.once('data', onData);
578
+ });
579
+ }
580
+ /**
563
581
  * Handle navigation input
564
- */
565
- async handleNavigationInput(key) {
566
- const navigationMap = {
567
- 1: ALL_VIEWS.PROCESSES,
568
- 2: ALL_VIEWS.STATUS,
569
- 3: ALL_VIEWS.ORCHESTRATION,
570
- 4: ALL_VIEWS.MEMORY,
571
- 5: ALL_VIEWS.LOGS,
572
- 6: ALL_VIEWS.NEURAL,
573
- 7: ALL_VIEWS.ANALYSIS,
574
- 8: ALL_VIEWS.WORKFLOW,
575
- 9: ALL_VIEWS.GITHUB,
576
- 0: ALL_VIEWS.DAA,
577
- t: ALL_VIEWS.TOOLS,
578
- s: ALL_VIEWS.SYSTEM,
579
- h: ALL_VIEWS.HELP,
580
- };
581
-
582
- if (navigationMap[key]) {
583
- this.currentView = navigationMap[key];
584
- this.selectedIndex = 0;
585
- this.addLog('info', `Switched to ${this.currentView} view`);
586
- return true;
582
+ */ async handleNavigationInput(key) {
583
+ const navigationMap = {
584
+ 1: ALL_VIEWS.PROCESSES,
585
+ 2: ALL_VIEWS.STATUS,
586
+ 3: ALL_VIEWS.ORCHESTRATION,
587
+ 4: ALL_VIEWS.MEMORY,
588
+ 5: ALL_VIEWS.LOGS,
589
+ 6: ALL_VIEWS.NEURAL,
590
+ 7: ALL_VIEWS.ANALYSIS,
591
+ 8: ALL_VIEWS.WORKFLOW,
592
+ 9: ALL_VIEWS.GITHUB,
593
+ 0: ALL_VIEWS.DAA,
594
+ t: ALL_VIEWS.TOOLS,
595
+ s: ALL_VIEWS.SYSTEM,
596
+ h: ALL_VIEWS.HELP
597
+ };
598
+ if (navigationMap[key]) {
599
+ this.currentView = navigationMap[key];
600
+ this.selectedIndex = 0;
601
+ this.addLog('info', `Switched to ${this.currentView} view`);
602
+ return true;
603
+ }
604
+ return false;
587
605
  }
588
-
589
- return false;
590
- }
591
-
592
- /**
606
+ /**
593
607
  * Handle enhanced view input
594
- */
595
- async handleEnhancedViewInput(key) {
596
- if (this.enhancedViews) {
597
- return await this.enhancedViews.handleEnhancedInput(key, this.currentView);
608
+ */ async handleEnhancedViewInput(key) {
609
+ if (this.enhancedViews) {
610
+ return await this.enhancedViews.handleEnhancedInput(key, this.currentView);
611
+ }
612
+ return false;
598
613
  }
599
- return false;
600
- }
601
-
602
- /**
614
+ /**
603
615
  * Handle global commands
604
- */
605
- async handleGlobalCommands(key) {
606
- switch (key) {
607
- case 'r':
608
- await this.promptRunTool();
609
- return true;
610
- case 'w':
611
- await this.promptRunWorkflow();
612
- return true;
613
- case 'b':
614
- await this.promptBatchExecution();
615
- return true;
616
- case 'c':
617
- console.clear();
618
- return true;
619
- case 'q':
620
- case '\x03': // Ctrl+C
621
- await this.shutdown();
622
- return true;
616
+ */ async handleGlobalCommands(key) {
617
+ switch(key){
618
+ case 'r':
619
+ await this.promptRunTool();
620
+ return true;
621
+ case 'w':
622
+ await this.promptRunWorkflow();
623
+ return true;
624
+ case 'b':
625
+ await this.promptBatchExecution();
626
+ return true;
627
+ case 'c':
628
+ console.clear();
629
+ return true;
630
+ case 'q':
631
+ case '\x03':
632
+ await this.shutdown();
633
+ return true;
634
+ }
635
+ return false;
623
636
  }
624
-
625
- return false;
626
- }
627
-
628
- /**
637
+ /**
629
638
  * Prompt for tool execution
630
- */
631
- async promptRunTool() {
632
- // In a real implementation, this would show an interactive prompt
633
- // For now, execute a sample tool
634
- this.addLog('info', 'Tool execution prompt (demo)');
635
-
636
- try {
637
- const result = await this.toolFramework.executeTool('features_detect');
638
- this.addLog('success', 'Tool executed successfully');
639
- this.enhancedViews.displayToolResult(result);
640
- } catch (error) {
641
- this.addLog('error', `Tool execution failed: ${error.message}`);
639
+ */ async promptRunTool() {
640
+ // In a real implementation, this would show an interactive prompt
641
+ // For now, execute a sample tool
642
+ this.addLog('info', 'Tool execution prompt (demo)');
643
+ try {
644
+ const result = await this.toolFramework.executeTool('features_detect');
645
+ this.addLog('success', 'Tool executed successfully');
646
+ this.enhancedViews.displayToolResult(result);
647
+ } catch (error) {
648
+ this.addLog('error', `Tool execution failed: ${error.message}`);
649
+ }
642
650
  }
643
- }
644
-
645
- /**
651
+ /**
646
652
  * Prompt for workflow execution
647
- */
648
- async promptRunWorkflow() {
649
- this.addLog('info', 'Executing sample workflow...');
650
-
651
- try {
652
- const result = await this.toolFramework.executePredefinedWorkflow('performance_analysis');
653
- this.addLog('success', 'Workflow completed successfully');
654
- } catch (error) {
655
- this.addLog('error', `Workflow failed: ${error.message}`);
653
+ */ async promptRunWorkflow() {
654
+ this.addLog('info', 'Executing sample workflow...');
655
+ try {
656
+ const result = await this.toolFramework.executePredefinedWorkflow('performance_analysis');
657
+ this.addLog('success', 'Workflow completed successfully');
658
+ } catch (error) {
659
+ this.addLog('error', `Workflow failed: ${error.message}`);
660
+ }
656
661
  }
657
- }
658
-
659
- /**
662
+ /**
660
663
  * Prompt for batch execution
661
- */
662
- async promptBatchExecution() {
663
- this.addLog('info', 'Executing sample batch...');
664
-
665
- const batchTools = [
666
- { toolName: 'swarm_status' },
667
- { toolName: 'neural_status' },
668
- { toolName: 'memory_usage', parameters: { action: 'list' } },
669
- ];
670
-
671
- try {
672
- const result = await this.toolFramework.executeToolsBatch(batchTools, { parallel: true });
673
- this.addLog(
674
- 'success',
675
- `Batch completed: ${result.summary.successful}/${result.summary.total} successful`,
676
- );
677
- } catch (error) {
678
- this.addLog('error', `Batch execution failed: ${error.message}`);
664
+ */ async promptBatchExecution() {
665
+ this.addLog('info', 'Executing sample batch...');
666
+ const batchTools = [
667
+ {
668
+ toolName: 'swarm_status'
669
+ },
670
+ {
671
+ toolName: 'neural_status'
672
+ },
673
+ {
674
+ toolName: 'memory_usage',
675
+ parameters: {
676
+ action: 'list'
677
+ }
678
+ }
679
+ ];
680
+ try {
681
+ const result = await this.toolFramework.executeToolsBatch(batchTools, {
682
+ parallel: true
683
+ });
684
+ this.addLog('success', `Batch completed: ${result.summary.successful}/${result.summary.total} successful`);
685
+ } catch (error) {
686
+ this.addLog('error', `Batch execution failed: ${error.message}`);
687
+ }
679
688
  }
680
- }
681
-
682
- /**
689
+ /**
683
690
  * Handle original input for backward compatibility
684
- */
685
- async handleOriginalInput(key) {
686
- // Handle original process view navigation
687
- if (this.currentView === ALL_VIEWS.PROCESSES) {
688
- switch (key) {
689
- case '\x1b[A': // Up arrow
690
- this.selectedIndex = Math.max(0, this.selectedIndex - 1);
691
- break;
692
- case '\x1b[B': // Down arrow
693
- this.selectedIndex = Math.min(this.processes.size - 1, this.selectedIndex + 1);
694
- break;
695
- case ' ':
696
- case '\r':
697
- await this.toggleSelectedProcess();
698
- break;
699
- }
691
+ */ async handleOriginalInput(key) {
692
+ // Handle original process view navigation
693
+ if (this.currentView === ALL_VIEWS.PROCESSES) {
694
+ switch(key){
695
+ case '\x1b[A':
696
+ this.selectedIndex = Math.max(0, this.selectedIndex - 1);
697
+ break;
698
+ case '\x1b[B':
699
+ this.selectedIndex = Math.min(this.processes.size - 1, this.selectedIndex + 1);
700
+ break;
701
+ case ' ':
702
+ case '\r':
703
+ await this.toggleSelectedProcess();
704
+ break;
705
+ }
706
+ }
700
707
  }
701
- }
702
-
703
- /**
708
+ /**
704
709
  * Toggle selected process status
705
- */
706
- async toggleSelectedProcess() {
707
- const processes = Array.from(this.processes.values());
708
- const selected = processes[this.selectedIndex];
709
-
710
- if (selected) {
711
- if (selected.status === 'running') {
712
- selected.status = 'stopped';
713
- selected.pid = null;
714
- this.addLog('warning', `Stopped ${selected.name}`);
715
- } else {
716
- selected.status = 'running';
717
- selected.pid = Math.floor(Math.random() * 50000) + 1000;
718
- this.addLog('success', `Started ${selected.name}`);
719
- }
710
+ */ async toggleSelectedProcess() {
711
+ const processes = Array.from(this.processes.values());
712
+ const selected = processes[this.selectedIndex];
713
+ if (selected) {
714
+ if (selected.status === 'running') {
715
+ selected.status = 'stopped';
716
+ selected.pid = null;
717
+ this.addLog('warning', `Stopped ${selected.name}`);
718
+ } else {
719
+ selected.status = 'running';
720
+ selected.pid = Math.floor(Math.random() * 50000) + 1000;
721
+ this.addLog('success', `Started ${selected.name}`);
722
+ }
723
+ }
720
724
  }
721
- }
722
-
723
- /**
725
+ /**
724
726
  * Add log entry with enhanced formatting
725
- */
726
- addLog(level, message) {
727
- const logEntry = {
728
- time: new Date(),
729
- level,
730
- message,
731
- };
732
-
733
- this.logs.unshift(logEntry);
734
-
735
- // Keep only last 100 logs
736
- if (this.logs.length > 100) {
737
- this.logs = this.logs.slice(0, 100);
738
- }
739
-
740
- // Emit log event for real-time updates
741
- if (this.realtimeUpdates) {
742
- this.realtimeUpdates.emit('log_added', logEntry);
727
+ */ addLog(level, message) {
728
+ const logEntry = {
729
+ time: new Date(),
730
+ level,
731
+ message
732
+ };
733
+ this.logs.unshift(logEntry);
734
+ // Keep only last 100 logs
735
+ if (this.logs.length > 100) {
736
+ this.logs = this.logs.slice(0, 100);
737
+ }
738
+ // Emit log event for real-time updates
739
+ if (this.realtimeUpdates) {
740
+ this.realtimeUpdates.emit('log_added', logEntry);
741
+ }
743
742
  }
744
- }
745
-
746
- /**
743
+ /**
747
744
  * Render process view (original)
748
- */
749
- renderProcessView() {
750
- console.log(this.colors.white(this.colors.bold('Process Management')));
751
- console.log();
752
-
753
- let index = 0;
754
- for (const [id, process] of this.processes) {
755
- const selected = index === this.selectedIndex;
756
- const prefix = selected ? this.colors.yellow('▶ ') : ' ';
757
- const status = this.getStatusIcon(process.status);
758
- const name = selected ? this.colors.yellow(process.name) : this.colors.white(process.name);
759
-
760
- console.log(`${prefix}${status} ${name}`);
761
- console.log(` ${this.colors.gray(process.description)}`);
762
-
763
- if (process.status === 'running') {
764
- const stats = this.colors.dim(
765
- `PID: ${process.pid} | Uptime: ${this.formatUptime(process.uptime)} | CPU: ${process.cpu.toFixed(1)}% | Mem: ${process.memory.toFixed(0)}MB`,
766
- );
767
- console.log(` ${stats}`);
768
- }
769
- console.log();
770
-
771
- index++;
745
+ */ renderProcessView() {
746
+ console.log(this.colors.white(this.colors.bold('Process Management')));
747
+ console.log();
748
+ let index = 0;
749
+ for (const [id, process1] of this.processes){
750
+ const selected = index === this.selectedIndex;
751
+ const prefix = selected ? this.colors.yellow('▶ ') : ' ';
752
+ const status = this.getStatusIcon(process1.status);
753
+ const name = selected ? this.colors.yellow(process1.name) : this.colors.white(process1.name);
754
+ console.log(`${prefix}${status} ${name}`);
755
+ console.log(` ${this.colors.gray(process1.description)}`);
756
+ if (process1.status === 'running') {
757
+ const stats = this.colors.dim(`PID: ${process1.pid} | Uptime: ${this.formatUptime(process1.uptime)} | CPU: ${process1.cpu.toFixed(1)}% | Mem: ${process1.memory.toFixed(0)}MB`);
758
+ console.log(` ${stats}`);
759
+ }
760
+ console.log();
761
+ index++;
762
+ }
763
+ // Enhanced stats
764
+ const running = Array.from(this.processes.values()).filter((p)=>p.status === 'running').length;
765
+ console.log(this.colors.gray('─'.repeat(80)));
766
+ console.log(this.colors.white(`Total: ${this.processes.size} | Running: ${this.colors.green(running)} | Stopped: ${this.colors.gray(this.processes.size - running)}`));
767
+ console.log(this.colors.cyan(`Enhanced: ${this.colors.yellow('87 MCP tools')} available across ${this.colors.yellow('8 categories')}`));
772
768
  }
773
-
774
- // Enhanced stats
775
- const running = Array.from(this.processes.values()).filter(
776
- (p) => p.status === 'running',
777
- ).length;
778
- console.log(this.colors.gray('─'.repeat(80)));
779
- console.log(
780
- this.colors.white(
781
- `Total: ${this.processes.size} | Running: ${this.colors.green(running)} | Stopped: ${this.colors.gray(this.processes.size - running)}`,
782
- ),
783
- );
784
- console.log(
785
- this.colors.cyan(
786
- `Enhanced: ${this.colors.yellow('87 MCP tools')} available across ${this.colors.yellow('8 categories')}`,
787
- ),
788
- );
789
- }
790
-
791
- /**
769
+ /**
792
770
  * Render status view with enhanced metrics
793
- */
794
- renderStatusView() {
795
- console.log(this.colors.white(this.colors.bold('Enhanced System Status')));
796
- console.log();
797
-
798
- // System overview
799
- console.log(this.colors.cyan('📊 System Overview'));
800
- console.log(` Uptime: ${this.colors.green(this.formatUptime(this.systemStats.uptime))}`);
801
- console.log(` Process Health: ${this.getHealthBar()}`);
802
- console.log(` MCP Tools: ${this.colors.yellow('87')} available`);
803
- console.log(` Tool Categories: ${this.colors.blue('8')} active`);
804
- console.log();
805
-
806
- // Enhanced resource usage
807
- console.log(this.colors.cyan('💻 Resource Usage'));
808
- console.log(
809
- ` CPU Usage: ${this.getUsageBar(this.systemStats.cpuUsage, 100)} ${this.systemStats.cpuUsage.toFixed(1)}%`,
810
- );
811
- console.log(
812
- ` Memory: ${this.getUsageBar(this.systemStats.memoryUsage, 100)} ${this.systemStats.memoryUsage.toFixed(1)}%`,
813
- );
814
- console.log();
815
-
816
- // Enhanced activity metrics
817
- console.log(this.colors.cyan('📈 Enhanced Activity Metrics'));
818
- console.log(
819
- ` Active Agents: ${this.colors.yellow(this.agents.filter((a) => a.status === 'working').length)}/${this.agents.length}`,
820
- );
821
- console.log(` Total Tasks: ${this.tasks.length}`);
822
- console.log(` Tool Executions: ${this.colors.green('Running')}`);
823
- console.log(` Real-time Updates: ${this.colors.green('Active')}`);
824
- console.log();
825
-
826
- // Tool status
827
- const mcpStatus = this.mcpIntegration ? this.mcpIntegration.getStatus() : null;
828
- if (mcpStatus) {
829
- console.log(this.colors.cyan('🔧 Tool System Status'));
830
- console.log(
831
- ` MCP Connection: ${mcpStatus.mcpAvailable ? this.colors.green('Connected') : this.colors.red('Mock Mode')}`,
832
- );
833
- console.log(` Active Executions: ${this.colors.yellow(mcpStatus.activeExecutions || 0)}`);
834
- console.log(` Cache Size: ${this.colors.blue(mcpStatus.cacheSize || 0)} entries`);
835
- console.log();
771
+ */ renderStatusView() {
772
+ console.log(this.colors.white(this.colors.bold('Enhanced System Status')));
773
+ console.log();
774
+ // System overview
775
+ console.log(this.colors.cyan('📊 System Overview'));
776
+ console.log(` Uptime: ${this.colors.green(this.formatUptime(this.systemStats.uptime))}`);
777
+ console.log(` Process Health: ${this.getHealthBar()}`);
778
+ console.log(` MCP Tools: ${this.colors.yellow('87')} available`);
779
+ console.log(` Tool Categories: ${this.colors.blue('8')} active`);
780
+ console.log();
781
+ // Enhanced resource usage
782
+ console.log(this.colors.cyan('💻 Resource Usage'));
783
+ console.log(` CPU Usage: ${this.getUsageBar(this.systemStats.cpuUsage, 100)} ${this.systemStats.cpuUsage.toFixed(1)}%`);
784
+ console.log(` Memory: ${this.getUsageBar(this.systemStats.memoryUsage, 100)} ${this.systemStats.memoryUsage.toFixed(1)}%`);
785
+ console.log();
786
+ // Enhanced activity metrics
787
+ console.log(this.colors.cyan('📈 Enhanced Activity Metrics'));
788
+ console.log(` Active Agents: ${this.colors.yellow(this.agents.filter((a)=>a.status === 'working').length)}/${this.agents.length}`);
789
+ console.log(` Total Tasks: ${this.tasks.length}`);
790
+ console.log(` Tool Executions: ${this.colors.green('Running')}`);
791
+ console.log(` Real-time Updates: ${this.colors.green('Active')}`);
792
+ console.log();
793
+ // Tool status
794
+ const mcpStatus = this.mcpIntegration ? this.mcpIntegration.getStatus() : null;
795
+ if (mcpStatus) {
796
+ console.log(this.colors.cyan('🔧 Tool System Status'));
797
+ console.log(` MCP Connection: ${mcpStatus.mcpAvailable ? this.colors.green('Connected') : this.colors.red('Mock Mode')}`);
798
+ console.log(` Active Executions: ${this.colors.yellow(mcpStatus.activeExecutions || 0)}`);
799
+ console.log(` Cache Size: ${this.colors.blue(mcpStatus.cacheSize || 0)} entries`);
800
+ console.log();
801
+ }
802
+ // Recent events
803
+ console.log(this.colors.cyan('🔔 Recent Events'));
804
+ this.logs.slice(0, 5).forEach((log)=>{
805
+ const time = log.time.toLocaleTimeString();
806
+ const icon = log.level === 'success' ? '✓' : log.level === 'warning' ? '⚠' : log.level === 'error' ? '❌' : 'ℹ';
807
+ const color = log.level === 'success' ? this.colors.green : log.level === 'warning' ? this.colors.yellow : log.level === 'error' ? this.colors.red : this.colors.blue;
808
+ console.log(` ${this.colors.gray(time)} ${color(icon)} ${log.message}`);
809
+ });
836
810
  }
837
-
838
- // Recent events
839
- console.log(this.colors.cyan('🔔 Recent Events'));
840
- this.logs.slice(0, 5).forEach((log) => {
841
- const time = log.time.toLocaleTimeString();
842
- const icon =
843
- log.level === 'success'
844
- ? '✓'
845
- : log.level === 'warning'
846
- ? '⚠'
847
- : log.level === 'error'
848
- ? '❌'
849
- : 'ℹ';
850
- const color =
851
- log.level === 'success'
852
- ? this.colors.green
853
- : log.level === 'warning'
854
- ? this.colors.yellow
855
- : log.level === 'error'
856
- ? this.colors.red
857
- : this.colors.blue;
858
- console.log(` ${this.colors.gray(time)} ${color(icon)} ${log.message}`);
859
- });
860
- }
861
-
862
- /**
811
+ /**
863
812
  * Render orchestration view (enhanced)
864
- */
865
- renderOrchestrationView() {
866
- console.log(this.colors.white(this.colors.bold('Enhanced Swarm Orchestration')));
867
- console.log();
868
-
869
- // Enhanced swarm metrics
870
- const metrics = this.swarmIntegration.getSwarmMetrics();
871
- if (metrics) {
872
- console.log(this.colors.cyan('🐝 Swarm Status'));
873
- console.log(` Swarm ID: ${this.colors.yellow(metrics.swarmId)}`);
874
- console.log(` Topology: ${this.colors.blue('hierarchical')} (optimized)`);
875
- console.log(
876
- ` Agents: ${this.colors.green(metrics.agents.active)}/${metrics.agents.total} active`,
877
- );
878
- console.log(
879
- ` Tasks: ${this.colors.yellow(metrics.tasks.inProgress)} in progress, ${this.colors.green(metrics.tasks.completed)} completed`,
880
- );
881
- console.log(` Efficiency: ${this.colors.green(metrics.efficiency + '%')}`);
882
- console.log(` Coordination Tools: ${this.colors.cyan('12')} available`);
883
- console.log();
813
+ */ renderOrchestrationView() {
814
+ console.log(this.colors.white(this.colors.bold('Enhanced Swarm Orchestration')));
815
+ console.log();
816
+ // Enhanced swarm metrics
817
+ const metrics = this.swarmIntegration.getSwarmMetrics();
818
+ if (metrics) {
819
+ console.log(this.colors.cyan('🐝 Swarm Status'));
820
+ console.log(` Swarm ID: ${this.colors.yellow(metrics.swarmId)}`);
821
+ console.log(` Topology: ${this.colors.blue('hierarchical')} (optimized)`);
822
+ console.log(` Agents: ${this.colors.green(metrics.agents.active)}/${metrics.agents.total} active`);
823
+ console.log(` Tasks: ${this.colors.yellow(metrics.tasks.inProgress)} in progress, ${this.colors.green(metrics.tasks.completed)} completed`);
824
+ console.log(` Efficiency: ${this.colors.green(metrics.efficiency + '%')}`);
825
+ console.log(` Coordination Tools: ${this.colors.cyan('12')} available`);
826
+ console.log();
827
+ }
828
+ // Enhanced agents section
829
+ console.log(this.colors.cyan('🤖 Enhanced Agent Pool'));
830
+ console.log();
831
+ this.agents.forEach((agent, index)=>{
832
+ const selected = this.currentView === ALL_VIEWS.ORCHESTRATION && index === this.selectedIndex;
833
+ const prefix = selected ? this.colors.yellow('▶ ') : ' ';
834
+ const statusIcon = agent.status === 'working' ? this.colors.green('●') : this.colors.gray('○');
835
+ const name = selected ? this.colors.yellow(agent.name) : this.colors.white(agent.name);
836
+ console.log(`${prefix}${statusIcon} ${name} (${agent.type})`);
837
+ console.log(` ID: ${agent.id} | Tasks: ${agent.tasks} | Status: ${agent.status}`);
838
+ if (agent.capabilities && agent.capabilities.length > 0) {
839
+ console.log(` Capabilities: ${this.colors.dim(agent.capabilities.join(', '))}`);
840
+ }
841
+ console.log();
842
+ });
843
+ console.log(this.colors.gray('─'.repeat(40)));
844
+ console.log(this.colors.cyan('⚡ Quick Actions: [1-9] Execute swarm tools | [r] Run custom tool'));
884
845
  }
885
-
886
- // Enhanced agents section
887
- console.log(this.colors.cyan('🤖 Enhanced Agent Pool'));
888
- console.log();
889
- this.agents.forEach((agent, index) => {
890
- const selected = this.currentView === ALL_VIEWS.ORCHESTRATION && index === this.selectedIndex;
891
- const prefix = selected ? this.colors.yellow('▶ ') : ' ';
892
- const statusIcon =
893
- agent.status === 'working' ? this.colors.green('●') : this.colors.gray('○');
894
- const name = selected ? this.colors.yellow(agent.name) : this.colors.white(agent.name);
895
-
896
- console.log(`${prefix}${statusIcon} ${name} (${agent.type})`);
897
- console.log(` ID: ${agent.id} | Tasks: ${agent.tasks} | Status: ${agent.status}`);
898
- if (agent.capabilities && agent.capabilities.length > 0) {
899
- console.log(` Capabilities: ${this.colors.dim(agent.capabilities.join(', '))}`);
900
- }
901
- console.log();
902
- });
903
-
904
- console.log(this.colors.gray('─'.repeat(40)));
905
- console.log(
906
- this.colors.cyan('⚡ Quick Actions: [1-9] Execute swarm tools | [r] Run custom tool'),
907
- );
908
- }
909
-
910
- /**
846
+ /**
911
847
  * Render memory view (enhanced)
912
- */
913
- renderMemoryView() {
914
- console.log(this.colors.white(this.colors.bold('Enhanced Memory Management')));
915
- console.log();
916
-
917
- // Enhanced memory overview
918
- console.log(this.colors.cyan('💾 Memory Overview'));
919
- console.log(` Total Entries: ${this.colors.yellow(this.memoryStats.totalEntries)}`);
920
- console.log(` Total Size: ${this.colors.blue(this.memoryStats.totalSize)}`);
921
- console.log(` Namespaces: ${this.colors.green(this.memoryStats.namespaces.length)}`);
922
- console.log(` Persistence Tools: ${this.colors.cyan('12')} available`);
923
- console.log();
924
-
925
- // Enhanced namespace details
926
- console.log(this.colors.cyan('📂 Namespace Details'));
927
- this.memoryStats.namespaces.forEach((ns) => {
928
- const usageBar = this.getUsageBar(ns.entries, 100);
929
- console.log(
930
- ` ${this.colors.white(ns.name.padEnd(12))} ${usageBar} ${this.colors.yellow(ns.entries)} entries (${this.colors.blue(ns.size)})`,
931
- );
932
- });
933
-
934
- console.log();
935
- console.log(this.colors.cyan('⚡ Memory Tools Available:'));
936
- console.log(` ${this.colors.gray('• Store/Retrieve operations')}`);
937
- console.log(` ${this.colors.gray('• Backup and restore')}`);
938
- console.log(` ${this.colors.gray('• Cross-session persistence')}`);
939
- console.log(` ${this.colors.gray('• Memory analytics and compression')}`);
940
- }
941
-
942
- /**
848
+ */ renderMemoryView() {
849
+ console.log(this.colors.white(this.colors.bold('Enhanced Memory Management')));
850
+ console.log();
851
+ // Enhanced memory overview
852
+ console.log(this.colors.cyan('💾 Memory Overview'));
853
+ console.log(` Total Entries: ${this.colors.yellow(this.memoryStats.totalEntries)}`);
854
+ console.log(` Total Size: ${this.colors.blue(this.memoryStats.totalSize)}`);
855
+ console.log(` Namespaces: ${this.colors.green(this.memoryStats.namespaces.length)}`);
856
+ console.log(` Persistence Tools: ${this.colors.cyan('12')} available`);
857
+ console.log();
858
+ // Enhanced namespace details
859
+ console.log(this.colors.cyan('📂 Namespace Details'));
860
+ this.memoryStats.namespaces.forEach((ns)=>{
861
+ const usageBar = this.getUsageBar(ns.entries, 100);
862
+ console.log(` ${this.colors.white(ns.name.padEnd(12))} ${usageBar} ${this.colors.yellow(ns.entries)} entries (${this.colors.blue(ns.size)})`);
863
+ });
864
+ console.log();
865
+ console.log(this.colors.cyan('⚡ Memory Tools Available:'));
866
+ console.log(` ${this.colors.gray('• Store/Retrieve operations')}`);
867
+ console.log(` ${this.colors.gray('• Backup and restore')}`);
868
+ console.log(` ${this.colors.gray('• Cross-session persistence')}`);
869
+ console.log(` ${this.colors.gray('• Memory analytics and compression')}`);
870
+ }
871
+ /**
943
872
  * Render logs view (enhanced)
944
- */
945
- renderLogsView() {
946
- console.log(this.colors.white(this.colors.bold('Enhanced System Logs')));
947
- console.log();
948
-
949
- console.log(this.colors.cyan(`📋 Recent Activity (${this.logs.length} total entries)`));
950
- console.log();
951
-
952
- this.logs.slice(0, 15).forEach((log) => {
953
- const time = log.time.toLocaleTimeString();
954
- const icon =
955
- log.level === 'success'
956
- ? this.colors.green('')
957
- : log.level === 'warning'
958
- ? this.colors.yellow('⚠️')
959
- : log.level === 'error'
960
- ? this.colors.red('❌')
961
- : this.colors.blue('ℹ️');
962
-
963
- console.log(`${this.colors.gray(time)} ${icon} ${log.message}`);
964
- });
965
-
966
- console.log();
967
- console.log(this.colors.gray('─'.repeat(80)));
968
- console.log(
969
- this.colors.cyan(
970
- '🔍 Log Analysis Tools Available: Pattern detection, error analysis, usage statistics',
971
- ),
972
- );
973
- }
974
-
975
- /**
873
+ */ renderLogsView() {
874
+ console.log(this.colors.white(this.colors.bold('Enhanced System Logs')));
875
+ console.log();
876
+ console.log(this.colors.cyan(`📋 Recent Activity (${this.logs.length} total entries)`));
877
+ console.log();
878
+ this.logs.slice(0, 15).forEach((log)=>{
879
+ const time = log.time.toLocaleTimeString();
880
+ const icon = log.level === 'success' ? this.colors.green('✅') : log.level === 'warning' ? this.colors.yellow('⚠️') : log.level === 'error' ? this.colors.red('❌') : this.colors.blue('ℹ️');
881
+ console.log(`${this.colors.gray(time)} ${icon} ${log.message}`);
882
+ });
883
+ console.log();
884
+ console.log(this.colors.gray(''.repeat(80)));
885
+ console.log(this.colors.cyan('🔍 Log Analysis Tools Available: Pattern detection, error analysis, usage statistics'));
886
+ }
887
+ /**
976
888
  * Utility methods
977
- */
978
- getStatusIcon(status) {
979
- return status === 'running' ? this.colors.green('●') : this.colors.gray('○');
980
- }
981
-
982
- formatUptime(seconds) {
983
- const hours = Math.floor(seconds / 3600);
984
- const minutes = Math.floor((seconds % 3600) / 60);
985
- const secs = seconds % 60;
986
- return `${hours}h ${minutes}m ${secs}s`;
987
- }
988
-
989
- getHealthBar() {
990
- const running = Array.from(this.processes.values()).filter(
991
- (p) => p.status === 'running',
992
- ).length;
993
- const total = this.processes.size;
994
- const percentage = (running / total) * 100;
995
- return this.getUsageBar(percentage, 100);
996
- }
997
-
998
- getUsageBar(value, max, width = 20) {
999
- const percentage = Math.min((value / max) * 100, 100);
1000
- const filled = Math.round((percentage / 100) * width);
1001
- const empty = width - filled;
1002
-
1003
- const color =
1004
- percentage > 80 ? this.colors.red : percentage > 60 ? this.colors.yellow : this.colors.green;
1005
- return color('█'.repeat(filled)) + this.colors.gray('░'.repeat(empty));
1006
- }
1007
-
1008
- /**
1009
- * Shutdown the enhanced UI
1010
- */
1011
- async shutdown() {
1012
- console.log();
1013
- this.addLog('info', 'Shutting down Enhanced Web UI...');
1014
-
1015
- // Cleanup enhanced components
1016
- if (this.enhancedViews) {
1017
- this.enhancedViews.cleanup();
889
+ */ getStatusIcon(status) {
890
+ return status === 'running' ? this.colors.green('●') : this.colors.gray('○');
1018
891
  }
1019
-
1020
- if (this.realtimeUpdates) {
1021
- this.realtimeUpdates.cleanup();
892
+ formatUptime(seconds) {
893
+ const hours = Math.floor(seconds / 3600);
894
+ const minutes = Math.floor(seconds % 3600 / 60);
895
+ const secs = seconds % 60;
896
+ return `${hours}h ${minutes}m ${secs}s`;
897
+ }
898
+ getHealthBar() {
899
+ const running = Array.from(this.processes.values()).filter((p)=>p.status === 'running').length;
900
+ const total = this.processes.size;
901
+ const percentage = running / total * 100;
902
+ return this.getUsageBar(percentage, 100);
903
+ }
904
+ getUsageBar(value, max, width = 20) {
905
+ const percentage = Math.min(value / max * 100, 100);
906
+ const filled = Math.round(percentage / 100 * width);
907
+ const empty = width - filled;
908
+ const color = percentage > 80 ? this.colors.red : percentage > 60 ? this.colors.yellow : this.colors.green;
909
+ return color('█'.repeat(filled)) + this.colors.gray('░'.repeat(empty));
910
+ }
911
+ /**
912
+ * Shutdown the enhanced UI
913
+ */ async shutdown() {
914
+ console.log();
915
+ this.addLog('info', 'Shutting down Enhanced Web UI...');
916
+ // Cleanup enhanced components
917
+ if (this.enhancedViews) {
918
+ this.enhancedViews.cleanup();
919
+ }
920
+ if (this.realtimeUpdates) {
921
+ this.realtimeUpdates.cleanup();
922
+ }
923
+ // Reset terminal
924
+ if (process.stdin.setRawMode) {
925
+ process.stdin.setRawMode(false);
926
+ }
927
+ process.stdin.pause();
928
+ this.running = false;
929
+ console.log();
930
+ printSuccess('👋 Enhanced Web UI shutdown complete');
931
+ process.exit(0);
1022
932
  }
1023
-
1024
- // Reset terminal
1025
- if (process.stdin.setRawMode) {
1026
- process.stdin.setRawMode(false);
933
+ constructor(){
934
+ this.processes = new Map();
935
+ this.running = true;
936
+ this.selectedIndex = 0;
937
+ this.currentView = ALL_VIEWS.PROCESSES;
938
+ this.agents = [];
939
+ this.tasks = [];
940
+ this.memoryStats = {
941
+ totalEntries: 0,
942
+ totalSize: 0,
943
+ namespaces: []
944
+ };
945
+ this.logs = [];
946
+ this.systemStats = {
947
+ uptime: 0,
948
+ totalTasks: 0,
949
+ completedTasks: 0,
950
+ activeAgents: 0,
951
+ memoryUsage: 0,
952
+ cpuUsage: 0
953
+ };
954
+ // Enhanced components
955
+ this.mcpIntegration = null;
956
+ this.toolFramework = null;
957
+ this.enhancedViews = null;
958
+ this.realtimeUpdates = null;
959
+ // Input handling
960
+ this.inputBuffer = '';
961
+ this.commandHistory = [];
962
+ this.historyIndex = -1;
963
+ // Colors for consistent styling
964
+ this.colors = {
965
+ cyan: (text)=>`\x1b[36m${text}\x1b[0m`,
966
+ gray: (text)=>`\x1b[90m${text}\x1b[0m`,
967
+ white: (text)=>`\x1b[37m${text}\x1b[0m`,
968
+ yellow: (text)=>`\x1b[33m${text}\x1b[0m`,
969
+ green: (text)=>`\x1b[32m${text}\x1b[0m`,
970
+ red: (text)=>`\x1b[31m${text}\x1b[0m`,
971
+ blue: (text)=>`\x1b[34m${text}\x1b[0m`,
972
+ magenta: (text)=>`\x1b[35m${text}\x1b[0m`,
973
+ bold: (text)=>`\x1b[1m${text}\x1b[0m`,
974
+ dim: (text)=>`\x1b[2m${text}\x1b[0m`
975
+ };
976
+ this.initializeEnhancedUI();
1027
977
  }
1028
- process.stdin.pause();
1029
-
1030
- this.running = false;
1031
-
1032
- console.log();
1033
- printSuccess('👋 Enhanced Web UI shutdown complete');
1034
- process.exit(0);
1035
- }
1036
978
  }
1037
-
1038
979
  export default EnhancedWebUIComplete;