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.
- package/dist/src/cli/commands/guidance.js +487 -668
- package/dist/src/cli/commands/index-validate.js +18 -29
- package/dist/src/cli/commands/mcp-troubleshoot.js +230 -282
- package/dist/src/cli/commands/neural-goal-init.js +92 -125
- package/dist/src/cli/commands/swarm-exec.js +317 -393
- package/dist/src/cli/commands/swarm.js +1 -1
- package/dist/src/cli/commands/validate-framework.js +983 -1100
- package/dist/src/cli/commands/validate.js +144 -223
- package/dist/src/cli/simple-commands/__tests__/agent.test.js +265 -277
- package/dist/src/cli/simple-commands/__tests__/memory.test.js +6 -7
- package/dist/src/cli/simple-commands/__tests__/swarm.test.js +373 -356
- package/dist/src/cli/simple-commands/__tests__/task.test.js +6 -7
- package/dist/src/cli/simple-commands/agent.js +157 -193
- package/dist/src/cli/simple-commands/analysis.js +336 -446
- package/dist/src/cli/simple-commands/automation-executor.js +1095 -1339
- package/dist/src/cli/simple-commands/automation.js +481 -469
- package/dist/src/cli/simple-commands/batch-manager.js +261 -313
- package/dist/src/cli/simple-commands/claude-telemetry.js +241 -267
- package/dist/src/cli/simple-commands/claude-track.js +68 -90
- package/dist/src/cli/simple-commands/concurrent-display.js +266 -320
- package/dist/src/cli/simple-commands/config.js +245 -290
- package/dist/src/cli/simple-commands/coordination.js +182 -234
- package/dist/src/cli/simple-commands/enhanced-ui-views.js +812 -615
- package/dist/src/cli/simple-commands/enhanced-webui-complete.js +922 -981
- package/dist/src/cli/simple-commands/fix-hook-variables.js +274 -294
- package/dist/src/cli/simple-commands/github/gh-coordinator.js +378 -457
- package/dist/src/cli/simple-commands/github/github-api.js +535 -574
- package/dist/src/cli/simple-commands/github/init.js +276 -303
- package/dist/src/cli/simple-commands/github.js +222 -247
- package/dist/src/cli/simple-commands/goal.js +51 -63
- package/dist/src/cli/simple-commands/hive-mind/auto-save-middleware.js +208 -278
- package/dist/src/cli/simple-commands/hive-mind/communication.js +601 -696
- package/dist/src/cli/simple-commands/hive-mind/core.js +907 -979
- package/dist/src/cli/simple-commands/hive-mind/db-optimizer.js +406 -655
- package/dist/src/cli/simple-commands/hive-mind/mcp-wrapper.js +1125 -1245
- package/dist/src/cli/simple-commands/hive-mind/memory.js +854 -1090
- package/dist/src/cli/simple-commands/hive-mind/performance-optimizer.js +459 -574
- package/dist/src/cli/simple-commands/hive-mind/performance-test.js +263 -347
- package/dist/src/cli/simple-commands/hive-mind/queen.js +727 -768
- package/dist/src/cli/simple-commands/hive-mind/session-manager.js +745 -1049
- package/dist/src/cli/simple-commands/hive-mind-optimize.js +227 -283
- package/dist/src/cli/simple-commands/hive-mind-wizard.js +174 -217
- package/dist/src/cli/simple-commands/hive-mind.js +1842 -2283
- package/dist/src/cli/simple-commands/hive.js +90 -79
- package/dist/src/cli/simple-commands/hook-safety.js +431 -521
- package/dist/src/cli/simple-commands/hooks/session-start-soul.js +203 -254
- package/dist/src/cli/simple-commands/hooks.js +1064 -1204
- package/dist/src/cli/simple-commands/init/agent-copier.js +294 -319
- package/dist/src/cli/simple-commands/init/batch-init.js +496 -562
- package/dist/src/cli/simple-commands/init/claude-commands/claude-flow-commands.js +13 -19
- package/dist/src/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +13 -19
- package/dist/src/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +61 -88
- package/dist/src/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +125 -150
- package/dist/src/cli/simple-commands/init/claude-commands/slash-commands.js +42 -49
- package/dist/src/cli/simple-commands/init/claude-commands/sparc-commands.js +43 -61
- package/dist/src/cli/simple-commands/init/copy-revised-templates.js +141 -147
- package/dist/src/cli/simple-commands/init/executable-wrapper.js +31 -44
- package/dist/src/cli/simple-commands/init/gitignore-updater.js +64 -90
- package/dist/src/cli/simple-commands/init/help.js +104 -107
- package/dist/src/cli/simple-commands/init/hive-mind-init.js +509 -528
- package/dist/src/cli/simple-commands/init/index.js +1510 -1759
- package/dist/src/cli/simple-commands/init/performance-monitor.js +234 -317
- package/dist/src/cli/simple-commands/init/rollback/backup-manager.js +441 -504
- package/dist/src/cli/simple-commands/init/rollback/index.js +289 -364
- package/dist/src/cli/simple-commands/init/rollback/recovery-manager.js +652 -728
- package/dist/src/cli/simple-commands/init/rollback/rollback-executor.js +416 -481
- package/dist/src/cli/simple-commands/init/rollback/state-tracker.js +369 -448
- package/dist/src/cli/simple-commands/init/sparc/roo-readme.js +1 -2
- package/dist/src/cli/simple-commands/init/sparc/roomodes-config.js +122 -99
- package/dist/src/cli/simple-commands/init/sparc/workflows.js +32 -37
- package/dist/src/cli/simple-commands/init/sparc-structure.js +55 -62
- package/dist/src/cli/simple-commands/init/template-copier.js +421 -533
- package/dist/src/cli/simple-commands/init/templates/coordination-md.js +3 -6
- package/dist/src/cli/simple-commands/init/templates/enhanced-templates.js +344 -318
- package/dist/src/cli/simple-commands/init/templates/github-safe-enhanced.js +173 -218
- package/dist/src/cli/simple-commands/init/templates/github-safe.js +65 -75
- package/dist/src/cli/simple-commands/init/templates/memory-bank-md.js +3 -6
- package/dist/src/cli/simple-commands/init/templates/readme-files.js +2 -4
- package/dist/src/cli/simple-commands/init/templates/safe-hook-patterns.js +187 -230
- package/dist/src/cli/simple-commands/init/templates/sparc-modes.js +53 -80
- package/dist/src/cli/simple-commands/init/templates/verification-claude-md.js +101 -85
- package/dist/src/cli/simple-commands/init/validation/config-validator.js +283 -330
- package/dist/src/cli/simple-commands/init/validation/health-checker.js +495 -561
- package/dist/src/cli/simple-commands/init/validation/index.js +302 -358
- package/dist/src/cli/simple-commands/init/validation/mode-validator.js +308 -359
- package/dist/src/cli/simple-commands/init/validation/post-init-validator.js +389 -366
- package/dist/src/cli/simple-commands/init/validation/pre-init-validator.js +270 -268
- package/dist/src/cli/simple-commands/init/validation/test-runner.js +427 -447
- package/dist/src/cli/simple-commands/init.js +1 -2
- package/dist/src/cli/simple-commands/mcp-health.js +131 -158
- package/dist/src/cli/simple-commands/mcp-integration-layer.js +533 -634
- package/dist/src/cli/simple-commands/mcp.js +345 -400
- package/dist/src/cli/simple-commands/memory-consolidation.js +426 -537
- package/dist/src/cli/simple-commands/memory.js +247 -311
- package/dist/src/cli/simple-commands/migrate-hooks.js +39 -46
- package/dist/src/cli/simple-commands/monitor.js +294 -363
- package/dist/src/cli/simple-commands/neural.js +51 -65
- package/dist/src/cli/simple-commands/pair-autofix-only.js +538 -662
- package/dist/src/cli/simple-commands/pair-basic.js +528 -656
- package/dist/src/cli/simple-commands/pair-old.js +430 -543
- package/dist/src/cli/simple-commands/pair-working.js +615 -751
- package/dist/src/cli/simple-commands/pair.js +615 -751
- package/dist/src/cli/simple-commands/performance-hooks.js +83 -111
- package/dist/src/cli/simple-commands/performance-metrics.js +348 -433
- package/dist/src/cli/simple-commands/process-ui-enhanced.js +708 -787
- package/dist/src/cli/simple-commands/process-ui.js +230 -254
- package/dist/src/cli/simple-commands/realtime-update-system.js +525 -611
- package/dist/src/cli/simple-commands/sparc/architecture.js +1704 -1530
- package/dist/src/cli/simple-commands/sparc/commands.js +438 -516
- package/dist/src/cli/simple-commands/sparc/completion.js +1224 -1481
- package/dist/src/cli/simple-commands/sparc/coordinator.js +913 -978
- package/dist/src/cli/simple-commands/sparc/index.js +241 -298
- package/dist/src/cli/simple-commands/sparc/phase-base.js +314 -390
- package/dist/src/cli/simple-commands/sparc/pseudocode.js +965 -869
- package/dist/src/cli/simple-commands/sparc/refinement.js +980 -1273
- package/dist/src/cli/simple-commands/sparc/specification.js +559 -645
- package/dist/src/cli/simple-commands/sparc-modes/architect.js +1 -1
- package/dist/src/cli/simple-commands/sparc-modes/ask.js +1 -1
- package/dist/src/cli/simple-commands/sparc-modes/code.js +1 -1
- package/dist/src/cli/simple-commands/sparc-modes/debug.js +1 -1
- package/dist/src/cli/simple-commands/sparc-modes/devops.js +1 -1
- package/dist/src/cli/simple-commands/sparc-modes/docs-writer.js +1 -1
- package/dist/src/cli/simple-commands/sparc-modes/generic.js +1 -1
- package/dist/src/cli/simple-commands/sparc-modes/index.js +47 -55
- package/dist/src/cli/simple-commands/sparc-modes/integration.js +1 -1
- package/dist/src/cli/simple-commands/sparc-modes/mcp.js +1 -1
- package/dist/src/cli/simple-commands/sparc-modes/monitoring.js +1 -1
- package/dist/src/cli/simple-commands/sparc-modes/optimization.js +1 -1
- package/dist/src/cli/simple-commands/sparc-modes/security-review.js +1 -1
- package/dist/src/cli/simple-commands/sparc-modes/sparc-orchestrator.js +1 -1
- package/dist/src/cli/simple-commands/sparc-modes/spec-pseudocode.js +1 -1
- package/dist/src/cli/simple-commands/sparc-modes/supabase-admin.js +1 -1
- package/dist/src/cli/simple-commands/sparc-modes/swarm.js +101 -87
- package/dist/src/cli/simple-commands/sparc-modes/tdd.js +1 -1
- package/dist/src/cli/simple-commands/sparc-modes/tutorial.js +1 -1
- package/dist/src/cli/simple-commands/sparc.js +465 -493
- package/dist/src/cli/simple-commands/start-ui.js +108 -132
- package/dist/src/cli/simple-commands/start-wrapper.js +240 -268
- package/dist/src/cli/simple-commands/start.js +1 -1
- package/dist/src/cli/simple-commands/status.js +254 -275
- package/dist/src/cli/simple-commands/stream-chain-clean.js +128 -171
- package/dist/src/cli/simple-commands/stream-chain-fixed.js +61 -82
- package/dist/src/cli/simple-commands/stream-chain-real.js +267 -331
- package/dist/src/cli/simple-commands/stream-chain-working.js +211 -263
- package/dist/src/cli/simple-commands/stream-chain.js +260 -318
- package/dist/src/cli/simple-commands/stream-processor.js +290 -315
- package/dist/src/cli/simple-commands/swarm-executor.js +189 -222
- package/dist/src/cli/simple-commands/swarm-metrics-integration.js +208 -300
- package/dist/src/cli/simple-commands/swarm-ui.js +623 -703
- package/dist/src/cli/simple-commands/swarm-webui-integration.js +258 -286
- package/dist/src/cli/simple-commands/swarm.js +887 -1082
- package/dist/src/cli/simple-commands/task.js +161 -206
- package/dist/src/cli/simple-commands/timestamp-fix.js +59 -89
- package/dist/src/cli/simple-commands/token-tracker.js +258 -316
- package/dist/src/cli/simple-commands/tool-execution-framework.js +433 -519
- package/dist/src/cli/simple-commands/train-and-stream.js +275 -331
- package/dist/src/cli/simple-commands/training-pipeline.js +619 -725
- package/dist/src/cli/simple-commands/training.js +170 -227
- package/dist/src/cli/simple-commands/verification-hooks.js +261 -284
- package/dist/src/cli/simple-commands/verification-integration.js +389 -417
- package/dist/src/cli/simple-commands/verification-training-integration.js +486 -606
- package/dist/src/cli/simple-commands/verification.js +493 -513
- package/dist/src/cli/simple-commands/web-server.js +766 -836
- package/dist/src/cli/simple-commands/webui-validator.js +106 -124
- package/dist/src/coordination/event-bus/demo-wasm-integration.js +212 -251
- package/dist/src/coordination/event-bus/qe-event-bus.js +608 -748
- package/dist/src/coordination/event-bus/qe-event-bus.test.js +379 -454
- package/dist/src/coordination/iteration-tracker.js +363 -454
- package/dist/src/enterprise/analytics-manager.js +1135 -0
- package/dist/src/enterprise/audit-manager.js +1115 -0
- package/dist/src/enterprise/cloud-manager.js +891 -0
- package/dist/src/enterprise/deployment-manager.js +966 -0
- package/dist/src/enterprise/index.js +6 -0
- package/dist/src/enterprise/project-manager.js +584 -0
- package/dist/src/enterprise/security-manager.js +991 -0
- package/dist/src/index.js +1 -1
- package/dist/src/mcp/DEPRECATED.js +46 -60
- package/dist/src/mcp/fixes/mcp-error-fixes.js +115 -134
- package/dist/src/mcp/implementations/agent-tracker.js +114 -128
- package/dist/src/mcp/implementations/daa-tools.js +292 -350
- package/dist/src/mcp/implementations/workflow-tools.js +329 -361
- package/dist/src/mcp/mcp-config-manager.js +1183 -1331
- package/dist/src/mcp/mcp-server-novice-simplified.js +11 -17
- package/dist/src/mcp/mcp-server-novice.js +11 -17
- package/dist/src/mcp/mcp-server-sdk.js +11 -17
- package/dist/src/mcp/mcp-server.js +1620 -1484
- package/dist/src/mcp/ruv-swarm-wrapper.js +209 -239
- package/dist/src/memory/advanced-serializer.js +609 -589
- package/dist/src/memory/enhanced-examples.js +220 -305
- package/dist/src/memory/enhanced-memory.js +295 -336
- package/dist/src/memory/enhanced-session-serializer.js +408 -492
- package/dist/src/memory/fallback-memory-system.js +900 -1021
- package/dist/src/memory/fallback-store.js +93 -131
- package/dist/src/memory/high-performance-serialization.js +592 -730
- package/dist/src/memory/in-memory-store.js +161 -213
- package/dist/src/memory/index.js +123 -157
- package/dist/src/memory/lock-free-structures.js +578 -764
- package/dist/src/memory/memory-mapped-persistence.js +585 -766
- package/dist/src/memory/memory-pressure-manager.js +569 -707
- package/dist/src/memory/migration.js +358 -445
- package/dist/src/memory/shared-memory.js +641 -768
- package/dist/src/memory/sqlite-store.js +245 -325
- package/dist/src/memory/sqlite-wrapper.js +122 -151
- package/dist/src/memory/swarm-memory.js +470 -603
- package/dist/src/memory/test-example.js +126 -134
- package/dist/src/memory/ultra-fast-memory-store.js +622 -821
- package/dist/src/memory/unified-memory-manager.js +356 -437
- package/dist/src/migration/index.js +92 -0
- package/dist/src/migration/logger.js +121 -0
- package/dist/src/migration/migration-analyzer.js +268 -0
- package/dist/src/migration/migration-runner.js +522 -0
- package/dist/src/migration/migration-validator.js +285 -0
- package/dist/src/migration/progress-reporter.js +150 -0
- package/dist/src/migration/rollback-manager.js +321 -0
- package/dist/src/migration/tests/migration-system.test.js +7 -0
- package/dist/src/migration/types.js +3 -0
- package/dist/src/swarm/CodeRefactoringSwarm.js +777 -952
- package/dist/src/swarm/__tests__/integration.test.js +227 -0
- package/dist/src/swarm/__tests__/prompt-copier.test.js +344 -0
- package/dist/src/swarm/advanced-orchestrator.js +1095 -0
- package/dist/src/swarm/claude-code-interface.js +961 -0
- package/dist/src/swarm/claude-flow-executor.js +229 -0
- package/dist/src/swarm/consensus-coordinator.js +475 -0
- package/dist/src/swarm/coordinator.js +2993 -0
- package/dist/src/swarm/direct-executor.js +1180 -0
- package/dist/src/swarm/error-recovery/advanced-error-detection.js +691 -0
- package/dist/src/swarm/error-recovery/automated-recovery-workflows.js +998 -0
- package/dist/src/swarm/error-recovery/error-recovery-coordinator.js +1197 -0
- package/dist/src/swarm/error-recovery/recovery-monitoring.js +772 -0
- package/dist/src/swarm/error-recovery/resilience-architecture.js +714 -0
- package/dist/src/swarm/error-recovery/self-healing-mechanisms.js +1319 -0
- package/dist/src/swarm/error-recovery/test-error-recovery-effectiveness.js +808 -0
- package/dist/src/swarm/executor-v2.js +322 -0
- package/dist/src/swarm/executor.js +815 -0
- package/dist/src/swarm/hive-mind-integration.js +703 -0
- package/dist/src/swarm/index.js +41 -0
- package/dist/src/swarm/json-output-aggregator.js +267 -0
- package/dist/src/swarm/large-scale-coordinator.js +542 -0
- package/dist/src/swarm/mcp-integration-wrapper.js +628 -0
- package/dist/src/swarm/memory.js +1117 -0
- package/dist/src/swarm/optimizations/__tests__/optimization.test.js +348 -0
- package/dist/src/swarm/optimizations/async-file-manager.js +285 -0
- package/dist/src/swarm/optimizations/circular-buffer.js +162 -0
- package/dist/src/swarm/optimizations/connection-pool.js +244 -0
- package/dist/src/swarm/optimizations/index.js +28 -0
- package/dist/src/swarm/optimizations/optimized-executor.js +320 -0
- package/dist/src/swarm/optimizations/ttl-map.js +234 -0
- package/dist/src/swarm/prompt-cli.js +200 -0
- package/dist/src/swarm/prompt-copier-enhanced.js +202 -0
- package/dist/src/swarm/prompt-copier.js +381 -0
- package/dist/src/swarm/prompt-manager.js +295 -0
- package/dist/src/swarm/prompt-utils.js +310 -0
- package/dist/src/swarm/result-aggregator.js +718 -0
- package/dist/src/swarm/sparc-executor.js +1568 -0
- package/dist/src/swarm/strategies/auto.js +758 -0
- package/dist/src/swarm/strategies/base.js +128 -0
- package/dist/src/swarm/strategies/research.js +914 -0
- package/dist/src/swarm/strategies/strategy-metrics-patch.js +2 -0
- package/dist/src/swarm/types.js +52 -0
- package/dist/src/swarm/workers/copy-worker.js +56 -0
- package/dist/src/utils/__tests__/github-cli-safety-wrapper.test.js +332 -400
- package/dist/src/utils/github-cli-safe.js +56 -64
- package/dist/src/utils/github-cli-safety-wrapper.js +451 -546
- package/dist/src/utils/npx-isolated-cache.js +104 -119
- package/dist/src/utils/preference-manager.js +622 -652
- package/dist/src/utils/timezone-utils.js +86 -105
- package/dist/src/validators/epic-config-schema.js +214 -0
- package/dist/src/validators/index.js +10 -0
- package/dist/src/validators/swarm-init-validator.js +259 -0
- package/dist/src/validators/todowrite-batching-validator.js +215 -0
- package/dist/src/validators/todowrite-integration.js +187 -0
- 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
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
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
|
-
|
|
18
|
-
// Add any additional views if needed
|
|
13
|
+
...ENHANCED_VIEWS
|
|
19
14
|
};
|
|
20
|
-
|
|
21
15
|
export class EnhancedWebUIComplete {
|
|
22
|
-
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
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
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
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
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
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
|
-
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
/**
|
|
319
|
+
/**
|
|
318
320
|
* Enhanced render method
|
|
319
|
-
*/
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
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
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
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
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
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
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
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
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
}
|
|
552
|
-
|
|
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
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
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
|
-
|
|
596
|
-
|
|
597
|
-
|
|
608
|
+
*/ async handleEnhancedViewInput(key) {
|
|
609
|
+
if (this.enhancedViews) {
|
|
610
|
+
return await this.enhancedViews.handleEnhancedInput(key, this.currentView);
|
|
611
|
+
}
|
|
612
|
+
return false;
|
|
598
613
|
}
|
|
599
|
-
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
/**
|
|
614
|
+
/**
|
|
603
615
|
* Handle global commands
|
|
604
|
-
*/
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
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
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
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
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
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
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
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
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
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
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
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
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
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
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
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
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
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
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
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
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
` ${this.colors.
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
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
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
log.
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1021
|
-
|
|
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
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
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;
|