claude-flow 2.0.0-alpha.33 → 2.0.0-alpha.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/.claude/settings.json +5 -5
- package/README.md +639 -643
- package/bin/claude-flow +1 -1
- package/dist/adapters/cliffy-node.d.ts +45 -0
- package/dist/adapters/cliffy-node.d.ts.map +1 -0
- package/dist/adapters/cliffy-node.js +61 -0
- package/dist/adapters/cliffy-node.js.map +1 -0
- package/dist/agents/agent-manager.d.ts +191 -0
- package/dist/agents/agent-manager.d.ts.map +1 -0
- package/dist/agents/agent-manager.js +969 -0
- package/dist/agents/agent-manager.js.map +1 -0
- package/dist/agents/agent-registry.d.ts +112 -0
- package/dist/agents/agent-registry.d.ts.map +1 -0
- package/dist/agents/agent-registry.js +341 -0
- package/dist/agents/agent-registry.js.map +1 -0
- package/dist/cli/agents/analyst.d.ts +28 -0
- package/dist/cli/agents/analyst.d.ts.map +1 -0
- package/dist/cli/agents/analyst.js +718 -0
- package/dist/cli/agents/analyst.js.map +1 -0
- package/dist/cli/agents/architect.d.ts +27 -0
- package/dist/cli/agents/architect.d.ts.map +1 -0
- package/dist/cli/agents/architect.js +729 -0
- package/dist/cli/agents/architect.js.map +1 -0
- package/dist/cli/agents/base-agent.d.ts +80 -0
- package/dist/cli/agents/base-agent.d.ts.map +1 -0
- package/dist/cli/agents/base-agent.js +385 -0
- package/dist/cli/agents/base-agent.js.map +1 -0
- package/dist/cli/agents/capabilities.d.ts +106 -0
- package/dist/cli/agents/capabilities.d.ts.map +1 -0
- package/dist/cli/agents/capabilities.js +556 -0
- package/dist/cli/agents/capabilities.js.map +1 -0
- package/dist/cli/agents/coder.d.ts +34 -0
- package/dist/cli/agents/coder.d.ts.map +1 -0
- package/dist/cli/agents/coder.js +806 -0
- package/dist/cli/agents/coder.js.map +1 -0
- package/dist/cli/agents/coordinator.d.ts +25 -0
- package/dist/cli/agents/coordinator.d.ts.map +1 -0
- package/dist/cli/agents/coordinator.js +454 -0
- package/dist/cli/agents/coordinator.js.map +1 -0
- package/dist/cli/agents/hive-agents.d.ts +85 -0
- package/dist/cli/agents/hive-agents.d.ts.map +1 -0
- package/dist/cli/agents/hive-agents.js +549 -0
- package/dist/cli/agents/hive-agents.js.map +1 -0
- package/dist/cli/agents/index.d.ts +111 -0
- package/dist/cli/agents/index.d.ts.map +1 -0
- package/dist/cli/agents/index.js +276 -0
- package/dist/cli/agents/index.js.map +1 -0
- package/dist/cli/agents/researcher.d.ts +24 -0
- package/dist/cli/agents/researcher.d.ts.map +1 -0
- package/dist/cli/agents/researcher.js +356 -0
- package/dist/cli/agents/researcher.js.map +1 -0
- package/dist/cli/agents/tester.d.ts +27 -0
- package/dist/cli/agents/tester.d.ts.map +1 -0
- package/dist/cli/agents/tester.js +594 -0
- package/dist/cli/agents/tester.js.map +1 -0
- package/dist/cli/cli-core.d.ts +49 -0
- package/dist/cli/cli-core.d.ts.map +1 -0
- package/dist/cli/cli-core.js +263 -0
- package/dist/cli/cli-core.js.map +1 -0
- package/dist/cli/commands/advanced-memory-commands.d.ts +2 -0
- package/dist/cli/commands/advanced-memory-commands.d.ts.map +1 -0
- package/dist/cli/commands/advanced-memory-commands.js +849 -0
- package/dist/cli/commands/advanced-memory-commands.js.map +1 -0
- package/dist/cli/commands/agent-simple.d.ts +12 -0
- package/dist/cli/commands/agent-simple.d.ts.map +1 -0
- package/dist/cli/commands/agent-simple.js +353 -0
- package/dist/cli/commands/agent-simple.js.map +1 -0
- package/dist/cli/commands/agent.d.ts +7 -0
- package/dist/cli/commands/agent.d.ts.map +1 -0
- package/dist/cli/commands/agent.js +369 -0
- package/dist/cli/commands/agent.js.map +1 -0
- package/dist/cli/commands/claude.d.ts +3 -0
- package/dist/cli/commands/claude.d.ts.map +1 -0
- package/dist/cli/commands/claude.js +154 -0
- package/dist/cli/commands/claude.js.map +1 -0
- package/dist/cli/commands/config-integration.d.ts +10 -0
- package/dist/cli/commands/config-integration.d.ts.map +1 -0
- package/dist/cli/commands/config-integration.js +416 -0
- package/dist/cli/commands/config-integration.js.map +1 -0
- package/dist/cli/commands/config.d.ts +5 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +89 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/enterprise.d.ts +3 -0
- package/dist/cli/commands/enterprise.d.ts.map +1 -0
- package/dist/cli/commands/enterprise.js +1486 -0
- package/dist/cli/commands/enterprise.js.map +1 -0
- package/dist/cli/commands/help.d.ts +6 -0
- package/dist/cli/commands/help.d.ts.map +1 -0
- package/dist/cli/commands/help.js +786 -0
- package/dist/cli/commands/help.js.map +1 -0
- package/dist/cli/commands/hive-mind/index.d.ts +15 -0
- package/dist/cli/commands/hive-mind/index.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/index.js +22 -0
- package/dist/cli/commands/hive-mind/index.js.map +1 -0
- package/dist/cli/commands/hive-mind/init.d.ts +10 -0
- package/dist/cli/commands/hive-mind/init.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/init.js +68 -0
- package/dist/cli/commands/hive-mind/init.js.map +1 -0
- package/dist/cli/commands/hive-mind/optimize-memory.d.ts +8 -0
- package/dist/cli/commands/hive-mind/optimize-memory.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/optimize-memory.js +391 -0
- package/dist/cli/commands/hive-mind/optimize-memory.js.map +1 -0
- package/dist/cli/commands/hive-mind/spawn.d.ts +10 -0
- package/dist/cli/commands/hive-mind/spawn.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/spawn.js +147 -0
- package/dist/cli/commands/hive-mind/spawn.js.map +1 -0
- package/dist/cli/commands/hive-mind/status.d.ts +10 -0
- package/dist/cli/commands/hive-mind/status.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/status.js +209 -0
- package/dist/cli/commands/hive-mind/status.js.map +1 -0
- package/dist/cli/commands/hive-mind/task.d.ts +10 -0
- package/dist/cli/commands/hive-mind/task.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/task.js +288 -0
- package/dist/cli/commands/hive-mind/task.js.map +1 -0
- package/dist/cli/commands/hive-mind/wizard.d.ts +10 -0
- package/dist/cli/commands/hive-mind/wizard.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/wizard.js +513 -0
- package/dist/cli/commands/hive-mind/wizard.js.map +1 -0
- package/dist/cli/commands/hive.d.ts +6 -0
- package/dist/cli/commands/hive.d.ts.map +1 -0
- package/dist/cli/commands/hive.js +374 -0
- package/dist/cli/commands/hive.js.map +1 -0
- package/dist/cli/commands/index.d.ts +3 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/index.js +2416 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +6 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +177 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/memory.d.ts +30 -0
- package/dist/cli/commands/memory.d.ts.map +1 -0
- package/dist/cli/commands/memory.js +225 -0
- package/dist/cli/commands/memory.js.map +1 -0
- package/dist/cli/commands/migrate.d.ts +6 -0
- package/dist/cli/commands/migrate.d.ts.map +1 -0
- package/dist/cli/commands/migrate.js +139 -0
- package/dist/cli/commands/migrate.js.map +1 -0
- package/dist/cli/commands/monitor.d.ts +6 -0
- package/dist/cli/commands/monitor.d.ts.map +1 -0
- package/dist/cli/commands/monitor.js +477 -0
- package/dist/cli/commands/monitor.js.map +1 -0
- package/dist/cli/commands/ruv-swarm.d.ts +10 -0
- package/dist/cli/commands/ruv-swarm.d.ts.map +1 -0
- package/dist/cli/commands/ruv-swarm.js +563 -0
- package/dist/cli/commands/ruv-swarm.js.map +1 -0
- package/dist/cli/commands/session.d.ts +6 -0
- package/dist/cli/commands/session.d.ts.map +1 -0
- package/dist/cli/commands/session.js +543 -0
- package/dist/cli/commands/session.js.map +1 -0
- package/dist/cli/commands/sparc.d.ts +3 -0
- package/dist/cli/commands/sparc.d.ts.map +1 -0
- package/dist/cli/commands/sparc.js +452 -0
- package/dist/cli/commands/sparc.js.map +1 -0
- package/dist/cli/commands/start/event-emitter.d.ts +13 -0
- package/dist/cli/commands/start/event-emitter.d.ts.map +1 -0
- package/dist/cli/commands/start/event-emitter.js +35 -0
- package/dist/cli/commands/start/event-emitter.js.map +1 -0
- package/dist/cli/commands/start/index.d.ts +10 -0
- package/dist/cli/commands/start/index.d.ts.map +1 -0
- package/dist/cli/commands/start/index.js +9 -0
- package/dist/cli/commands/start/index.js.map +1 -0
- package/dist/cli/commands/start/process-manager.d.ts +31 -0
- package/dist/cli/commands/start/process-manager.d.ts.map +1 -0
- package/dist/cli/commands/start/process-manager.js +281 -0
- package/dist/cli/commands/start/process-manager.js.map +1 -0
- package/dist/cli/commands/start/process-ui-simple.d.ts +25 -0
- package/dist/cli/commands/start/process-ui-simple.d.ts.map +1 -0
- package/dist/cli/commands/start/process-ui-simple.js +334 -0
- package/dist/cli/commands/start/process-ui-simple.js.map +1 -0
- package/dist/cli/commands/start/process-ui.d.ts +5 -0
- package/dist/cli/commands/start/process-ui.d.ts.map +1 -0
- package/dist/cli/commands/start/process-ui.js +5 -0
- package/dist/cli/commands/start/process-ui.js.map +1 -0
- package/dist/cli/commands/start/start-command.d.ts +6 -0
- package/dist/cli/commands/start/start-command.d.ts.map +1 -0
- package/dist/cli/commands/start/start-command.js +450 -0
- package/dist/cli/commands/start/start-command.js.map +1 -0
- package/dist/cli/commands/start/system-monitor.d.ts +22 -0
- package/dist/cli/commands/start/system-monitor.d.ts.map +1 -0
- package/dist/cli/commands/start/system-monitor.js +267 -0
- package/dist/cli/commands/start/system-monitor.js.map +1 -0
- package/dist/cli/commands/start/types.d.ts +64 -0
- package/dist/cli/commands/start/types.d.ts.map +1 -0
- package/dist/cli/commands/start/types.js +22 -0
- package/dist/cli/commands/start/types.js.map +1 -0
- package/dist/cli/commands/start.d.ts +6 -0
- package/dist/cli/commands/start.d.ts.map +1 -0
- package/dist/cli/commands/start.js +6 -0
- package/dist/cli/commands/start.js.map +1 -0
- package/dist/cli/commands/status.d.ts +6 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +312 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/swarm-new.d.ts +3 -0
- package/dist/cli/commands/swarm-new.d.ts.map +1 -0
- package/dist/cli/commands/swarm-new.js +989 -0
- package/dist/cli/commands/swarm-new.js.map +1 -0
- package/dist/cli/commands/swarm-spawn.d.ts +24 -0
- package/dist/cli/commands/swarm-spawn.d.ts.map +1 -0
- package/dist/cli/commands/swarm-spawn.js +52 -0
- package/dist/cli/commands/swarm-spawn.js.map +1 -0
- package/dist/cli/commands/swarm.d.ts +3 -0
- package/dist/cli/commands/swarm.d.ts.map +1 -0
- package/dist/cli/commands/swarm.js +460 -0
- package/dist/cli/commands/swarm.js.map +1 -0
- package/dist/cli/commands/task.d.ts +6 -0
- package/dist/cli/commands/task.d.ts.map +1 -0
- package/dist/cli/commands/task.js +72 -0
- package/dist/cli/commands/task.js.map +1 -0
- package/dist/cli/commands/workflow.d.ts +6 -0
- package/dist/cli/commands/workflow.d.ts.map +1 -0
- package/dist/cli/commands/workflow.js +618 -0
- package/dist/cli/commands/workflow.js.map +1 -0
- package/dist/cli/completion.d.ts +16 -0
- package/dist/cli/completion.d.ts.map +1 -0
- package/dist/cli/completion.js +535 -0
- package/dist/cli/completion.js.map +1 -0
- package/dist/cli/formatter.d.ts +66 -0
- package/dist/cli/formatter.d.ts.map +1 -0
- package/dist/cli/formatter.js +277 -0
- package/dist/cli/formatter.js.map +1 -0
- package/dist/cli/index-remote.d.ts +3 -0
- package/dist/cli/index-remote.d.ts.map +1 -0
- package/dist/cli/index-remote.js +126 -0
- package/dist/cli/index-remote.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +197 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init/batch-tools.d.ts +2 -0
- package/dist/cli/init/batch-tools.d.ts.map +1 -0
- package/dist/cli/init/batch-tools.js +387 -0
- package/dist/cli/init/batch-tools.js.map +1 -0
- package/dist/cli/init/claude-config.d.ts +3 -0
- package/dist/cli/init/claude-config.d.ts.map +1 -0
- package/dist/cli/init/claude-config.js +289 -0
- package/dist/cli/init/claude-config.js.map +1 -0
- package/dist/cli/init/directory-structure.d.ts +2 -0
- package/dist/cli/init/directory-structure.d.ts.map +1 -0
- package/dist/cli/init/directory-structure.js +144 -0
- package/dist/cli/init/directory-structure.js.map +1 -0
- package/dist/cli/init/index.d.ts +6 -0
- package/dist/cli/init/index.d.ts.map +1 -0
- package/dist/cli/init/index.js +52 -0
- package/dist/cli/init/index.js.map +1 -0
- package/dist/cli/init/sparc-environment.d.ts +2 -0
- package/dist/cli/init/sparc-environment.d.ts.map +1 -0
- package/dist/cli/init/sparc-environment.js +426 -0
- package/dist/cli/init/sparc-environment.js.map +1 -0
- package/dist/cli/init/swarm-commands.d.ts +2 -0
- package/dist/cli/init/swarm-commands.d.ts.map +1 -0
- package/dist/cli/init/swarm-commands.js +795 -0
- package/dist/cli/init/swarm-commands.js.map +1 -0
- package/dist/cli/init/utils.d.ts +5 -0
- package/dist/cli/init/utils.d.ts.map +1 -0
- package/dist/cli/init/utils.js +14 -0
- package/dist/cli/init/utils.js.map +1 -0
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +26 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/node-repl.d.ts +5 -0
- package/dist/cli/node-repl.d.ts.map +1 -0
- package/dist/cli/node-repl.js +677 -0
- package/dist/cli/node-repl.js.map +1 -0
- package/dist/cli/repl.d.ts +5 -0
- package/dist/cli/repl.d.ts.map +1 -0
- package/dist/cli/repl.js +909 -0
- package/dist/cli/repl.js.map +1 -0
- package/dist/cli/simple-cli.d.ts +3 -0
- package/dist/cli/simple-cli.d.ts.map +1 -0
- package/dist/cli/simple-cli.js +3059 -0
- package/dist/cli/simple-cli.js.map +1 -0
- package/dist/cli/simple-mcp.d.ts +6 -0
- package/dist/cli/simple-mcp.d.ts.map +1 -0
- package/dist/cli/simple-mcp.js +107 -0
- package/dist/cli/simple-mcp.js.map +1 -0
- package/dist/cli/simple-orchestrator.d.ts +16 -0
- package/dist/cli/simple-orchestrator.d.ts.map +1 -0
- package/dist/cli/simple-orchestrator.js +833 -0
- package/dist/cli/simple-orchestrator.js.map +1 -0
- package/dist/cli/ui/compatible-ui.d.ts +45 -0
- package/dist/cli/ui/compatible-ui.d.ts.map +1 -0
- package/dist/cli/ui/compatible-ui.js +318 -0
- package/dist/cli/ui/compatible-ui.js.map +1 -0
- package/dist/cli/ui/fallback-handler.d.ts +26 -0
- package/dist/cli/ui/fallback-handler.d.ts.map +1 -0
- package/dist/cli/ui/fallback-handler.js +163 -0
- package/dist/cli/ui/fallback-handler.js.map +1 -0
- package/dist/cli/ui/index.d.ts +11 -0
- package/dist/cli/ui/index.d.ts.map +1 -0
- package/dist/cli/ui/index.js +33 -0
- package/dist/cli/ui/index.js.map +1 -0
- package/dist/cli/utils/environment-detector.d.ts +52 -0
- package/dist/cli/utils/environment-detector.d.ts.map +1 -0
- package/dist/cli/utils/environment-detector.js +238 -0
- package/dist/cli/utils/environment-detector.js.map +1 -0
- package/dist/cli/utils/prompt-defaults.d.ts +82 -0
- package/dist/cli/utils/prompt-defaults.d.ts.map +1 -0
- package/dist/cli/utils/prompt-defaults.js +253 -0
- package/dist/cli/utils/prompt-defaults.js.map +1 -0
- package/dist/communication/message-bus.d.ts +283 -0
- package/dist/communication/message-bus.d.ts.map +1 -0
- package/dist/communication/message-bus.js +954 -0
- package/dist/communication/message-bus.js.map +1 -0
- package/dist/config/config-manager.d.ts +174 -0
- package/dist/config/config-manager.d.ts.map +1 -0
- package/dist/config/config-manager.js +443 -0
- package/dist/config/config-manager.js.map +1 -0
- package/dist/config/ruv-swarm-config.d.ts +167 -0
- package/dist/config/ruv-swarm-config.d.ts.map +1 -0
- package/dist/config/ruv-swarm-config.js +274 -0
- package/dist/config/ruv-swarm-config.js.map +1 -0
- package/dist/config/ruv-swarm-integration.d.ts +93 -0
- package/dist/config/ruv-swarm-integration.d.ts.map +1 -0
- package/dist/config/ruv-swarm-integration.js +292 -0
- package/dist/config/ruv-swarm-integration.js.map +1 -0
- package/dist/constants/agent-types.d.ts +46 -0
- package/dist/constants/agent-types.d.ts.map +1 -0
- package/dist/constants/agent-types.js +50 -0
- package/dist/constants/agent-types.js.map +1 -0
- package/dist/coordination/advanced-scheduler.d.ts +121 -0
- package/dist/coordination/advanced-scheduler.d.ts.map +1 -0
- package/dist/coordination/advanced-scheduler.js +386 -0
- package/dist/coordination/advanced-scheduler.js.map +1 -0
- package/dist/coordination/advanced-task-executor.d.ts +100 -0
- package/dist/coordination/advanced-task-executor.d.ts.map +1 -0
- package/dist/coordination/advanced-task-executor.js +459 -0
- package/dist/coordination/advanced-task-executor.js.map +1 -0
- package/dist/coordination/background-executor.d.ts +69 -0
- package/dist/coordination/background-executor.d.ts.map +1 -0
- package/dist/coordination/background-executor.js +362 -0
- package/dist/coordination/background-executor.js.map +1 -0
- package/dist/coordination/circuit-breaker.d.ts +124 -0
- package/dist/coordination/circuit-breaker.d.ts.map +1 -0
- package/dist/coordination/circuit-breaker.js +298 -0
- package/dist/coordination/circuit-breaker.js.map +1 -0
- package/dist/coordination/conflict-resolution.d.ts +133 -0
- package/dist/coordination/conflict-resolution.d.ts.map +1 -0
- package/dist/coordination/conflict-resolution.js +358 -0
- package/dist/coordination/conflict-resolution.js.map +1 -0
- package/dist/coordination/dependency-graph.d.ts +78 -0
- package/dist/coordination/dependency-graph.d.ts.map +1 -0
- package/dist/coordination/dependency-graph.js +386 -0
- package/dist/coordination/dependency-graph.js.map +1 -0
- package/dist/coordination/hive-orchestrator.d.ts +118 -0
- package/dist/coordination/hive-orchestrator.d.ts.map +1 -0
- package/dist/coordination/hive-orchestrator.js +321 -0
- package/dist/coordination/hive-orchestrator.js.map +1 -0
- package/dist/coordination/hive-protocol.d.ts +117 -0
- package/dist/coordination/hive-protocol.d.ts.map +1 -0
- package/dist/coordination/hive-protocol.js +373 -0
- package/dist/coordination/hive-protocol.js.map +1 -0
- package/dist/coordination/index.d.ts +14 -0
- package/dist/coordination/index.d.ts.map +1 -0
- package/dist/coordination/index.js +21 -0
- package/dist/coordination/index.js.map +1 -0
- package/dist/coordination/load-balancer.d.ts +139 -0
- package/dist/coordination/load-balancer.d.ts.map +1 -0
- package/dist/coordination/load-balancer.js +691 -0
- package/dist/coordination/load-balancer.js.map +1 -0
- package/dist/coordination/manager.d.ts +66 -0
- package/dist/coordination/manager.d.ts.map +1 -0
- package/dist/coordination/manager.js +360 -0
- package/dist/coordination/manager.js.map +1 -0
- package/dist/coordination/messaging.d.ts +37 -0
- package/dist/coordination/messaging.d.ts.map +1 -0
- package/dist/coordination/messaging.js +219 -0
- package/dist/coordination/messaging.js.map +1 -0
- package/dist/coordination/metrics.d.ts +153 -0
- package/dist/coordination/metrics.d.ts.map +1 -0
- package/dist/coordination/metrics.js +434 -0
- package/dist/coordination/metrics.js.map +1 -0
- package/dist/coordination/resources.d.ts +36 -0
- package/dist/coordination/resources.d.ts.map +1 -0
- package/dist/coordination/resources.js +250 -0
- package/dist/coordination/resources.js.map +1 -0
- package/dist/coordination/scheduler.d.ts +48 -0
- package/dist/coordination/scheduler.d.ts.map +1 -0
- package/dist/coordination/scheduler.js +308 -0
- package/dist/coordination/scheduler.js.map +1 -0
- package/dist/coordination/swarm-coordinator.d.ts +116 -0
- package/dist/coordination/swarm-coordinator.d.ts.map +1 -0
- package/dist/coordination/swarm-coordinator.js +565 -0
- package/dist/coordination/swarm-coordinator.js.map +1 -0
- package/dist/coordination/swarm-monitor.d.ts +101 -0
- package/dist/coordination/swarm-monitor.d.ts.map +1 -0
- package/dist/coordination/swarm-monitor.js +340 -0
- package/dist/coordination/swarm-monitor.js.map +1 -0
- package/dist/coordination/work-stealing.d.ts +44 -0
- package/dist/coordination/work-stealing.d.ts.map +1 -0
- package/dist/coordination/work-stealing.js +155 -0
- package/dist/coordination/work-stealing.js.map +1 -0
- package/dist/core/config.d.ts +239 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +1128 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/event-bus.d.ts +60 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +153 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/json-persistence.d.ts +52 -0
- package/dist/core/json-persistence.d.ts.map +1 -0
- package/dist/core/json-persistence.js +115 -0
- package/dist/core/json-persistence.js.map +1 -0
- package/dist/core/logger.d.ts +57 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +253 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/orchestrator-fixed.d.ts +81 -0
- package/dist/core/orchestrator-fixed.d.ts.map +1 -0
- package/dist/core/orchestrator-fixed.js +210 -0
- package/dist/core/orchestrator-fixed.js.map +1 -0
- package/dist/core/orchestrator.d.ts +103 -0
- package/dist/core/orchestrator.d.ts.map +1 -0
- package/dist/core/orchestrator.js +965 -0
- package/dist/core/orchestrator.js.map +1 -0
- package/dist/core/persistence.d.ts +50 -0
- package/dist/core/persistence.d.ts.map +1 -0
- package/dist/core/persistence.js +186 -0
- package/dist/core/persistence.js.map +1 -0
- package/dist/enterprise/analytics-manager.d.ts +489 -0
- package/dist/enterprise/analytics-manager.d.ts.map +1 -0
- package/dist/enterprise/analytics-manager.js +949 -0
- package/dist/enterprise/analytics-manager.js.map +1 -0
- package/dist/enterprise/audit-manager.d.ts +459 -0
- package/dist/enterprise/audit-manager.d.ts.map +1 -0
- package/dist/enterprise/audit-manager.js +992 -0
- package/dist/enterprise/audit-manager.js.map +1 -0
- package/dist/enterprise/cloud-manager.d.ts +435 -0
- package/dist/enterprise/cloud-manager.d.ts.map +1 -0
- package/dist/enterprise/cloud-manager.js +784 -0
- package/dist/enterprise/cloud-manager.js.map +1 -0
- package/dist/enterprise/deployment-manager.d.ts +328 -0
- package/dist/enterprise/deployment-manager.d.ts.map +1 -0
- package/dist/enterprise/deployment-manager.js +823 -0
- package/dist/enterprise/deployment-manager.js.map +1 -0
- package/dist/enterprise/index.d.ts +13 -0
- package/dist/enterprise/index.d.ts.map +1 -0
- package/dist/enterprise/index.js +7 -0
- package/dist/enterprise/index.js.map +1 -0
- package/dist/enterprise/project-manager.d.ts +228 -0
- package/dist/enterprise/project-manager.d.ts.map +1 -0
- package/dist/enterprise/project-manager.js +529 -0
- package/dist/enterprise/project-manager.js.map +1 -0
- package/dist/enterprise/security-manager.d.ts +422 -0
- package/dist/enterprise/security-manager.d.ts.map +1 -0
- package/dist/enterprise/security-manager.js +902 -0
- package/dist/enterprise/security-manager.js.map +1 -0
- package/dist/hive-mind/core/Agent.d.ts +137 -0
- package/dist/hive-mind/core/Agent.d.ts.map +1 -0
- package/dist/hive-mind/core/Agent.js +567 -0
- package/dist/hive-mind/core/Agent.js.map +1 -0
- package/dist/hive-mind/core/Communication.d.ts +116 -0
- package/dist/hive-mind/core/Communication.d.ts.map +1 -0
- package/dist/hive-mind/core/Communication.js +407 -0
- package/dist/hive-mind/core/Communication.js.map +1 -0
- package/dist/hive-mind/core/DatabaseManager.d.ts +93 -0
- package/dist/hive-mind/core/DatabaseManager.d.ts.map +1 -0
- package/dist/hive-mind/core/DatabaseManager.js +551 -0
- package/dist/hive-mind/core/DatabaseManager.js.map +1 -0
- package/dist/hive-mind/core/HiveMind.d.ts +90 -0
- package/dist/hive-mind/core/HiveMind.d.ts.map +1 -0
- package/dist/hive-mind/core/HiveMind.js +439 -0
- package/dist/hive-mind/core/HiveMind.js.map +1 -0
- package/dist/hive-mind/core/Memory.d.ts +235 -0
- package/dist/hive-mind/core/Memory.d.ts.map +1 -0
- package/dist/hive-mind/core/Memory.js +1185 -0
- package/dist/hive-mind/core/Memory.js.map +1 -0
- package/dist/hive-mind/core/MemoryMonitor.d.ts +183 -0
- package/dist/hive-mind/core/MemoryMonitor.d.ts.map +1 -0
- package/dist/hive-mind/core/MemoryMonitor.js +547 -0
- package/dist/hive-mind/core/MemoryMonitor.js.map +1 -0
- package/dist/hive-mind/core/Queen.d.ts +115 -0
- package/dist/hive-mind/core/Queen.d.ts.map +1 -0
- package/dist/hive-mind/core/Queen.js +586 -0
- package/dist/hive-mind/core/Queen.js.map +1 -0
- package/dist/hive-mind/index.d.ts +17 -0
- package/dist/hive-mind/index.d.ts.map +1 -0
- package/dist/hive-mind/index.js +21 -0
- package/dist/hive-mind/index.js.map +1 -0
- package/dist/hive-mind/integration/ConsensusEngine.d.ts +117 -0
- package/dist/hive-mind/integration/ConsensusEngine.d.ts.map +1 -0
- package/dist/hive-mind/integration/ConsensusEngine.js +476 -0
- package/dist/hive-mind/integration/ConsensusEngine.js.map +1 -0
- package/dist/hive-mind/integration/MCPToolWrapper.d.ts +172 -0
- package/dist/hive-mind/integration/MCPToolWrapper.d.ts.map +1 -0
- package/dist/hive-mind/integration/MCPToolWrapper.js +216 -0
- package/dist/hive-mind/integration/MCPToolWrapper.js.map +1 -0
- package/dist/hive-mind/integration/SwarmOrchestrator.d.ts +172 -0
- package/dist/hive-mind/integration/SwarmOrchestrator.d.ts.map +1 -0
- package/dist/hive-mind/integration/SwarmOrchestrator.js +746 -0
- package/dist/hive-mind/integration/SwarmOrchestrator.js.map +1 -0
- package/dist/hive-mind/types.d.ts +298 -0
- package/dist/hive-mind/types.d.ts.map +1 -0
- package/dist/hive-mind/types.js +7 -0
- package/dist/hive-mind/types.js.map +1 -0
- package/dist/integration/mock-components.d.ts +107 -0
- package/dist/integration/mock-components.d.ts.map +1 -0
- package/dist/integration/mock-components.js +357 -0
- package/dist/integration/mock-components.js.map +1 -0
- package/dist/integration/system-integration.d.ts +84 -0
- package/dist/integration/system-integration.d.ts.map +1 -0
- package/dist/integration/system-integration.js +429 -0
- package/dist/integration/system-integration.js.map +1 -0
- package/dist/integration/types.d.ts +119 -0
- package/dist/integration/types.d.ts.map +1 -0
- package/dist/integration/types.js +5 -0
- package/dist/integration/types.js.map +1 -0
- package/dist/mcp/auth.d.ts +80 -0
- package/dist/mcp/auth.d.ts.map +1 -0
- package/dist/mcp/auth.js +343 -0
- package/dist/mcp/auth.js.map +1 -0
- package/dist/mcp/claude-code-wrapper.d.ts +26 -0
- package/dist/mcp/claude-code-wrapper.d.ts.map +1 -0
- package/dist/mcp/claude-code-wrapper.js +598 -0
- package/dist/mcp/claude-code-wrapper.js.map +1 -0
- package/dist/mcp/claude-flow-tools.d.ts +13 -0
- package/dist/mcp/claude-flow-tools.d.ts.map +1 -0
- package/dist/mcp/claude-flow-tools.js +1142 -0
- package/dist/mcp/claude-flow-tools.js.map +1 -0
- package/dist/mcp/client.d.ts +41 -0
- package/dist/mcp/client.d.ts.map +1 -0
- package/dist/mcp/client.js +194 -0
- package/dist/mcp/client.js.map +1 -0
- package/dist/mcp/index.d.ts +134 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +212 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/integrate-wrapper.d.ts +16 -0
- package/dist/mcp/integrate-wrapper.d.ts.map +1 -0
- package/dist/mcp/integrate-wrapper.js +77 -0
- package/dist/mcp/integrate-wrapper.js.map +1 -0
- package/dist/mcp/lifecycle-manager.d.ts +121 -0
- package/dist/mcp/lifecycle-manager.d.ts.map +1 -0
- package/dist/mcp/lifecycle-manager.js +365 -0
- package/dist/mcp/lifecycle-manager.js.map +1 -0
- package/dist/mcp/load-balancer.d.ts +88 -0
- package/dist/mcp/load-balancer.d.ts.map +1 -0
- package/dist/mcp/load-balancer.js +389 -0
- package/dist/mcp/load-balancer.js.map +1 -0
- package/dist/mcp/orchestration-integration.d.ts +135 -0
- package/dist/mcp/orchestration-integration.d.ts.map +1 -0
- package/dist/mcp/orchestration-integration.js +722 -0
- package/dist/mcp/orchestration-integration.js.map +1 -0
- package/dist/mcp/performance-monitor.d.ts +164 -0
- package/dist/mcp/performance-monitor.d.ts.map +1 -0
- package/dist/mcp/performance-monitor.js +478 -0
- package/dist/mcp/performance-monitor.js.map +1 -0
- package/dist/mcp/protocol-manager.d.ts +88 -0
- package/dist/mcp/protocol-manager.d.ts.map +1 -0
- package/dist/mcp/protocol-manager.js +358 -0
- package/dist/mcp/protocol-manager.js.map +1 -0
- package/dist/mcp/recovery/connection-health-monitor.d.ts +69 -0
- package/dist/mcp/recovery/connection-health-monitor.d.ts.map +1 -0
- package/dist/mcp/recovery/connection-health-monitor.js +241 -0
- package/dist/mcp/recovery/connection-health-monitor.js.map +1 -0
- package/dist/mcp/recovery/connection-state-manager.d.ts +102 -0
- package/dist/mcp/recovery/connection-state-manager.d.ts.map +1 -0
- package/dist/mcp/recovery/connection-state-manager.js +318 -0
- package/dist/mcp/recovery/connection-state-manager.js.map +1 -0
- package/dist/mcp/recovery/fallback-coordinator.d.ts +79 -0
- package/dist/mcp/recovery/fallback-coordinator.d.ts.map +1 -0
- package/dist/mcp/recovery/fallback-coordinator.js +278 -0
- package/dist/mcp/recovery/fallback-coordinator.js.map +1 -0
- package/dist/mcp/recovery/index.d.ts +10 -0
- package/dist/mcp/recovery/index.d.ts.map +1 -0
- package/dist/mcp/recovery/index.js +10 -0
- package/dist/mcp/recovery/index.js.map +1 -0
- package/dist/mcp/recovery/reconnection-manager.d.ts +69 -0
- package/dist/mcp/recovery/reconnection-manager.d.ts.map +1 -0
- package/dist/mcp/recovery/reconnection-manager.js +226 -0
- package/dist/mcp/recovery/reconnection-manager.js.map +1 -0
- package/dist/mcp/recovery/recovery-manager.d.ts +93 -0
- package/dist/mcp/recovery/recovery-manager.d.ts.map +1 -0
- package/dist/mcp/recovery/recovery-manager.js +250 -0
- package/dist/mcp/recovery/recovery-manager.js.map +1 -0
- package/dist/mcp/router.d.ts +54 -0
- package/dist/mcp/router.d.ts.map +1 -0
- package/dist/mcp/router.js +201 -0
- package/dist/mcp/router.js.map +1 -0
- package/dist/mcp/ruv-swarm-tools.d.ts +58 -0
- package/dist/mcp/ruv-swarm-tools.d.ts.map +1 -0
- package/dist/mcp/ruv-swarm-tools.js +518 -0
- package/dist/mcp/ruv-swarm-tools.js.map +1 -0
- package/dist/mcp/server-with-wrapper.d.ts +3 -0
- package/dist/mcp/server-with-wrapper.d.ts.map +1 -0
- package/dist/mcp/server-with-wrapper.js +36 -0
- package/dist/mcp/server-with-wrapper.js.map +1 -0
- package/dist/mcp/server-wrapper-mode.d.ts +3 -0
- package/dist/mcp/server-wrapper-mode.d.ts.map +1 -0
- package/dist/mcp/server-wrapper-mode.js +28 -0
- package/dist/mcp/server-wrapper-mode.js.map +1 -0
- package/dist/mcp/server.d.ts +75 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +533 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/session-manager.d.ts +60 -0
- package/dist/mcp/session-manager.d.ts.map +1 -0
- package/dist/mcp/session-manager.js +322 -0
- package/dist/mcp/session-manager.js.map +1 -0
- package/dist/mcp/sparc-modes.d.ts +12 -0
- package/dist/mcp/sparc-modes.d.ts.map +1 -0
- package/dist/mcp/sparc-modes.js +370 -0
- package/dist/mcp/sparc-modes.js.map +1 -0
- package/dist/mcp/swarm-tools.d.ts +87 -0
- package/dist/mcp/swarm-tools.d.ts.map +1 -0
- package/dist/mcp/swarm-tools.js +711 -0
- package/dist/mcp/swarm-tools.js.map +1 -0
- package/dist/mcp/tools.d.ts +145 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +418 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/transports/base.d.ts +22 -0
- package/dist/mcp/transports/base.d.ts.map +1 -0
- package/dist/mcp/transports/base.js +2 -0
- package/dist/mcp/transports/base.js.map +1 -0
- package/dist/mcp/transports/http.d.ts +45 -0
- package/dist/mcp/transports/http.d.ts.map +1 -0
- package/dist/mcp/transports/http.js +400 -0
- package/dist/mcp/transports/http.js.map +1 -0
- package/dist/mcp/transports/stdio.d.ts +34 -0
- package/dist/mcp/transports/stdio.d.ts.map +1 -0
- package/dist/mcp/transports/stdio.js +203 -0
- package/dist/mcp/transports/stdio.js.map +1 -0
- package/dist/memory/advanced-memory-manager.d.ts +303 -0
- package/dist/memory/advanced-memory-manager.d.ts.map +1 -0
- package/dist/memory/advanced-memory-manager.js +1458 -0
- package/dist/memory/advanced-memory-manager.js.map +1 -0
- package/dist/memory/backends/base.d.ts +21 -0
- package/dist/memory/backends/base.d.ts.map +1 -0
- package/dist/memory/backends/base.js +2 -0
- package/dist/memory/backends/base.js.map +1 -0
- package/dist/memory/backends/markdown.d.ts +32 -0
- package/dist/memory/backends/markdown.d.ts.map +1 -0
- package/dist/memory/backends/markdown.js +223 -0
- package/dist/memory/backends/markdown.js.map +1 -0
- package/dist/memory/backends/sqlite.d.ts +29 -0
- package/dist/memory/backends/sqlite.d.ts.map +1 -0
- package/dist/memory/backends/sqlite.js +272 -0
- package/dist/memory/backends/sqlite.js.map +1 -0
- package/dist/memory/cache.d.ts +65 -0
- package/dist/memory/cache.d.ts.map +1 -0
- package/dist/memory/cache.js +186 -0
- package/dist/memory/cache.js.map +1 -0
- package/dist/memory/distributed-memory.d.ts +188 -0
- package/dist/memory/distributed-memory.d.ts.map +1 -0
- package/dist/memory/distributed-memory.js +711 -0
- package/dist/memory/distributed-memory.js.map +1 -0
- package/dist/memory/indexer.d.ts +52 -0
- package/dist/memory/indexer.d.ts.map +1 -0
- package/dist/memory/indexer.js +188 -0
- package/dist/memory/indexer.js.map +1 -0
- package/dist/memory/manager.d.ts +58 -0
- package/dist/memory/manager.d.ts.map +1 -0
- package/dist/memory/manager.js +426 -0
- package/dist/memory/manager.js.map +1 -0
- package/dist/memory/swarm-memory.d.ts +91 -0
- package/dist/memory/swarm-memory.d.ts.map +1 -0
- package/dist/memory/swarm-memory.js +461 -0
- package/dist/memory/swarm-memory.js.map +1 -0
- package/dist/migration/index.d.ts +3 -0
- package/dist/migration/index.d.ts.map +1 -0
- package/dist/migration/index.js +166 -0
- package/dist/migration/index.js.map +1 -0
- package/dist/migration/logger.d.ts +26 -0
- package/dist/migration/logger.d.ts.map +1 -0
- package/dist/migration/logger.js +145 -0
- package/dist/migration/logger.js.map +1 -0
- package/dist/migration/migration-analyzer.d.ts +15 -0
- package/dist/migration/migration-analyzer.d.ts.map +1 -0
- package/dist/migration/migration-analyzer.js +279 -0
- package/dist/migration/migration-analyzer.js.map +1 -0
- package/dist/migration/migration-runner.d.ts +26 -0
- package/dist/migration/migration-runner.d.ts.map +1 -0
- package/dist/migration/migration-runner.js +499 -0
- package/dist/migration/migration-runner.js.map +1 -0
- package/dist/migration/migration-validator.d.ts +14 -0
- package/dist/migration/migration-validator.d.ts.map +1 -0
- package/dist/migration/migration-validator.js +313 -0
- package/dist/migration/migration-validator.js.map +1 -0
- package/dist/migration/progress-reporter.d.ts +25 -0
- package/dist/migration/progress-reporter.d.ts.map +1 -0
- package/dist/migration/progress-reporter.js +163 -0
- package/dist/migration/progress-reporter.js.map +1 -0
- package/dist/migration/rollback-manager.d.ts +21 -0
- package/dist/migration/rollback-manager.d.ts.map +1 -0
- package/dist/migration/rollback-manager.js +348 -0
- package/dist/migration/rollback-manager.js.map +1 -0
- package/dist/migration/types.d.ts +103 -0
- package/dist/migration/types.d.ts.map +1 -0
- package/dist/migration/types.js +6 -0
- package/dist/migration/types.js.map +1 -0
- package/dist/monitoring/diagnostics.d.ts +109 -0
- package/dist/monitoring/diagnostics.d.ts.map +1 -0
- package/dist/monitoring/diagnostics.js +545 -0
- package/dist/monitoring/diagnostics.js.map +1 -0
- package/dist/monitoring/health-check.d.ts +91 -0
- package/dist/monitoring/health-check.d.ts.map +1 -0
- package/dist/monitoring/health-check.js +371 -0
- package/dist/monitoring/health-check.js.map +1 -0
- package/dist/monitoring/real-time-monitor.d.ts +230 -0
- package/dist/monitoring/real-time-monitor.d.ts.map +1 -0
- package/dist/monitoring/real-time-monitor.js +839 -0
- package/dist/monitoring/real-time-monitor.js.map +1 -0
- package/dist/resources/resource-manager.d.ts +390 -0
- package/dist/resources/resource-manager.d.ts.map +1 -0
- package/dist/resources/resource-manager.js +1220 -0
- package/dist/resources/resource-manager.js.map +1 -0
- package/dist/swarm/claude-flow-executor.d.ts +28 -0
- package/dist/swarm/claude-flow-executor.d.ts.map +1 -0
- package/dist/swarm/claude-flow-executor.js +210 -0
- package/dist/swarm/claude-flow-executor.js.map +1 -0
- package/dist/swarm/coordinator.d.ts +134 -0
- package/dist/swarm/coordinator.d.ts.map +1 -0
- package/dist/swarm/coordinator.js +2607 -0
- package/dist/swarm/coordinator.js.map +1 -0
- package/dist/swarm/direct-executor.d.ts +48 -0
- package/dist/swarm/direct-executor.d.ts.map +1 -0
- package/dist/swarm/direct-executor.js +1113 -0
- package/dist/swarm/direct-executor.js.map +1 -0
- package/dist/swarm/executor-v2.d.ts +23 -0
- package/dist/swarm/executor-v2.d.ts.map +1 -0
- package/dist/swarm/executor-v2.js +320 -0
- package/dist/swarm/executor-v2.js.map +1 -0
- package/dist/swarm/executor.d.ts +117 -0
- package/dist/swarm/executor.d.ts.map +1 -0
- package/dist/swarm/executor.js +791 -0
- package/dist/swarm/executor.js.map +1 -0
- package/dist/swarm/index.d.ts +31 -0
- package/dist/swarm/index.d.ts.map +1 -0
- package/dist/swarm/index.js +42 -0
- package/dist/swarm/index.js.map +1 -0
- package/dist/swarm/memory.d.ts +176 -0
- package/dist/swarm/memory.d.ts.map +1 -0
- package/dist/swarm/memory.js +1068 -0
- package/dist/swarm/memory.js.map +1 -0
- package/dist/swarm/optimizations/async-file-manager.d.ts +49 -0
- package/dist/swarm/optimizations/async-file-manager.d.ts.map +1 -0
- package/dist/swarm/optimizations/async-file-manager.js +248 -0
- package/dist/swarm/optimizations/async-file-manager.js.map +1 -0
- package/dist/swarm/optimizations/circular-buffer.d.ts +46 -0
- package/dist/swarm/optimizations/circular-buffer.d.ts.map +1 -0
- package/dist/swarm/optimizations/circular-buffer.js +159 -0
- package/dist/swarm/optimizations/circular-buffer.js.map +1 -0
- package/dist/swarm/optimizations/connection-pool.d.ts +54 -0
- package/dist/swarm/optimizations/connection-pool.d.ts.map +1 -0
- package/dist/swarm/optimizations/connection-pool.js +227 -0
- package/dist/swarm/optimizations/connection-pool.js.map +1 -0
- package/dist/swarm/optimizations/index.d.ts +24 -0
- package/dist/swarm/optimizations/index.d.ts.map +1 -0
- package/dist/swarm/optimizations/index.js +30 -0
- package/dist/swarm/optimizations/index.js.map +1 -0
- package/dist/swarm/optimizations/optimized-executor.d.ts +109 -0
- package/dist/swarm/optimizations/optimized-executor.d.ts.map +1 -0
- package/dist/swarm/optimizations/optimized-executor.js +321 -0
- package/dist/swarm/optimizations/optimized-executor.js.map +1 -0
- package/dist/swarm/optimizations/ttl-map.d.ts +78 -0
- package/dist/swarm/optimizations/ttl-map.d.ts.map +1 -0
- package/dist/swarm/optimizations/ttl-map.js +229 -0
- package/dist/swarm/optimizations/ttl-map.js.map +1 -0
- package/dist/swarm/prompt-cli.d.ts +5 -0
- package/dist/swarm/prompt-cli.d.ts.map +1 -0
- package/dist/swarm/prompt-cli.js +256 -0
- package/dist/swarm/prompt-cli.js.map +1 -0
- package/dist/swarm/prompt-copier-enhanced.d.ts +17 -0
- package/dist/swarm/prompt-copier-enhanced.d.ts.map +1 -0
- package/dist/swarm/prompt-copier-enhanced.js +190 -0
- package/dist/swarm/prompt-copier-enhanced.js.map +1 -0
- package/dist/swarm/prompt-copier.d.ts +76 -0
- package/dist/swarm/prompt-copier.d.ts.map +1 -0
- package/dist/swarm/prompt-copier.js +379 -0
- package/dist/swarm/prompt-copier.js.map +1 -0
- package/dist/swarm/prompt-manager.d.ts +72 -0
- package/dist/swarm/prompt-manager.d.ts.map +1 -0
- package/dist/swarm/prompt-manager.js +270 -0
- package/dist/swarm/prompt-manager.js.map +1 -0
- package/dist/swarm/prompt-utils.d.ts +52 -0
- package/dist/swarm/prompt-utils.d.ts.map +1 -0
- package/dist/swarm/prompt-utils.js +265 -0
- package/dist/swarm/prompt-utils.js.map +1 -0
- package/dist/swarm/sparc-executor.d.ts +105 -0
- package/dist/swarm/sparc-executor.d.ts.map +1 -0
- package/dist/swarm/sparc-executor.js +1364 -0
- package/dist/swarm/sparc-executor.js.map +1 -0
- package/dist/swarm/strategies/auto.d.ts +57 -0
- package/dist/swarm/strategies/auto.d.ts.map +1 -0
- package/dist/swarm/strategies/auto.js +623 -0
- package/dist/swarm/strategies/auto.js.map +1 -0
- package/dist/swarm/strategies/base.d.ts +78 -0
- package/dist/swarm/strategies/base.d.ts.map +1 -0
- package/dist/swarm/strategies/base.js +108 -0
- package/dist/swarm/strategies/base.js.map +1 -0
- package/dist/swarm/strategies/research.d.ts +75 -0
- package/dist/swarm/strategies/research.d.ts.map +1 -0
- package/dist/swarm/strategies/research.js +841 -0
- package/dist/swarm/strategies/research.js.map +1 -0
- package/dist/swarm/strategies/strategy-metrics-patch.d.ts +11 -0
- package/dist/swarm/strategies/strategy-metrics-patch.d.ts.map +1 -0
- package/dist/swarm/strategies/strategy-metrics-patch.js +2 -0
- package/dist/swarm/strategies/strategy-metrics-patch.js.map +1 -0
- package/dist/swarm/types.d.ts +578 -0
- package/dist/swarm/types.d.ts.map +1 -0
- package/dist/swarm/types.js +51 -0
- package/dist/swarm/types.js.map +1 -0
- package/dist/swarm/workers/copy-worker.d.ts +2 -0
- package/dist/swarm/workers/copy-worker.d.ts.map +1 -0
- package/dist/swarm/workers/copy-worker.js +56 -0
- package/dist/swarm/workers/copy-worker.js.map +1 -0
- package/dist/task/commands.d.ts +60 -0
- package/dist/task/commands.d.ts.map +1 -0
- package/dist/task/commands.js +107 -0
- package/dist/task/commands.js.map +1 -0
- package/dist/task/coordination.d.ts +109 -0
- package/dist/task/coordination.d.ts.map +1 -0
- package/dist/task/coordination.js +629 -0
- package/dist/task/coordination.js.map +1 -0
- package/dist/task/engine.d.ts +198 -0
- package/dist/task/engine.d.ts.map +1 -0
- package/dist/task/engine.js +498 -0
- package/dist/task/engine.js.map +1 -0
- package/dist/task/index.d.ts +103 -0
- package/dist/task/index.d.ts.map +1 -0
- package/dist/task/index.js +276 -0
- package/dist/task/index.js.map +1 -0
- package/dist/task/types.d.ts +56 -0
- package/dist/task/types.d.ts.map +1 -0
- package/dist/task/types.js +2 -0
- package/dist/task/types.js.map +1 -0
- package/dist/terminal/adapters/base.d.ts +40 -0
- package/dist/terminal/adapters/base.d.ts.map +1 -0
- package/dist/terminal/adapters/base.js +5 -0
- package/dist/terminal/adapters/base.js.map +1 -0
- package/dist/terminal/adapters/native.d.ts +19 -0
- package/dist/terminal/adapters/native.d.ts.map +1 -0
- package/dist/terminal/adapters/native.js +414 -0
- package/dist/terminal/adapters/native.js.map +1 -0
- package/dist/terminal/adapters/vscode.d.ts +20 -0
- package/dist/terminal/adapters/vscode.d.ts.map +1 -0
- package/dist/terminal/adapters/vscode.js +265 -0
- package/dist/terminal/adapters/vscode.js.map +1 -0
- package/dist/terminal/manager.d.ts +59 -0
- package/dist/terminal/manager.d.ts.map +1 -0
- package/dist/terminal/manager.js +237 -0
- package/dist/terminal/manager.js.map +1 -0
- package/dist/terminal/pool.d.ts +32 -0
- package/dist/terminal/pool.d.ts.map +1 -0
- package/dist/terminal/pool.js +205 -0
- package/dist/terminal/pool.js.map +1 -0
- package/dist/terminal/session.d.ts +41 -0
- package/dist/terminal/session.d.ts.map +1 -0
- package/dist/terminal/session.js +206 -0
- package/dist/terminal/session.js.map +1 -0
- package/dist/types/index.d.ts +28 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +15 -0
- package/dist/types/index.js.map +1 -0
- package/dist/ui/hive-dashboard.d.ts +140 -0
- package/dist/ui/hive-dashboard.d.ts.map +1 -0
- package/dist/ui/hive-dashboard.js +281 -0
- package/dist/ui/hive-dashboard.js.map +1 -0
- package/dist/utils/error-handler.d.ts +13 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +45 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/errors.d.ts +121 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +194 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/formatters.d.ts +15 -0
- package/dist/utils/formatters.d.ts.map +1 -0
- package/dist/utils/formatters.js +75 -0
- package/dist/utils/formatters.js.map +1 -0
- package/dist/utils/helpers.d.ts +131 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/helpers.js +447 -0
- package/dist/utils/helpers.js.map +1 -0
- package/dist/utils/paths.d.ts +4 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +39 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/types.d.ts +512 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +37 -0
- package/dist/utils/types.js.map +1 -0
- package/package.json +1 -2
- package/src/cli/command-registry.js +0 -68
- package/src/cli/commands/index.ts +0 -37
- package/src/cli/commands/swarm-new.ts +352 -762
- package/src/cli/commands/swarm-spawn.ts +4 -8
- package/src/cli/commands/task.ts +33 -30
- package/src/cli/commands/workflow.ts +37 -33
- package/src/cli/repl.ts +5 -5
- package/src/cli/simple-commands/hive-mind/core.js +1 -3
- package/src/cli/simple-commands/hive-mind/mcp-wrapper.js +1 -4
- package/src/cli/simple-commands/hive-mind/memory.js +5 -19
- package/src/cli/simple-commands/hive-mind.js +61 -240
- package/src/cli/simple-commands/init/executable-wrapper.js +13 -17
- package/src/cli/simple-commands/init/help.js +0 -2
- package/src/cli/simple-commands/init/index.js +48 -81
- package/src/cli/simple-commands/init/sparc-structure.js +1 -3
- package/src/cli/simple-commands/init/templates/CLAUDE.md +14 -14
- package/src/cli/simple-commands/init/templates/enhanced-templates.js +23 -82
- package/src/cli/simple-commands/init/templates/settings.json +5 -5
- package/src/cli/simple-commands/swarm.js +7 -9
- package/src/cli/ui/fallback-handler.ts +2 -2
- package/src/communication/message-bus.ts +3 -7
- package/src/coordination/advanced-task-executor.ts +8 -11
- package/src/coordination/load-balancer.ts +5 -13
- package/src/hive-mind/integration/MCPToolWrapper.ts +1 -2
- package/src/utils/error-handler.ts +23 -6
- package/scripts/claude-flow-wrapper.sh +0 -35
- package/src/cli/commands/hook-types.ts +0 -126
- package/src/cli/commands/hook-validator.ts +0 -191
- package/src/cli/commands/hook.ts +0 -346
- package/src/cli/simple-commands/hive-mind/db-optimizer.js +0 -762
- package/src/cli/simple-commands/hive-mind-optimize.js +0 -357
- package/src/cli/simple-commands/hook-safety.js +0 -668
- package/src/cli/simple-commands/init/templates/claude-flow-universal +0 -71
- package/src/cli/simple-commands/init/templates/commands/hooks/notification.md +0 -102
- package/src/cli/simple-commands/init/templates/commands/hooks/post-command.md +0 -105
- package/src/cli/simple-commands/init/templates/commands/hooks/post-edit.md +0 -106
- package/src/cli/simple-commands/init/templates/commands/hooks/post-task.md +0 -101
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-command.md +0 -102
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-edit.md +0 -102
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-search.md +0 -105
- package/src/cli/simple-commands/init/templates/commands/hooks/session-end.md +0 -107
- package/src/cli/simple-commands/init/templates/commands/hooks/session-restore.md +0 -110
- package/src/cli/simple-commands/init/templates/commands/hooks/session-start.md +0 -106
- package/src/cli/simple-commands/init/templates/safe-hook-patterns.js +0 -381
- package/src/utils/type-guards.ts +0 -188
|
@@ -0,0 +1,839 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Real-time monitoring system for swarm operations
|
|
3
|
+
*/
|
|
4
|
+
import { EventEmitter } from 'node:events';
|
|
5
|
+
/**
|
|
6
|
+
* Comprehensive real-time monitoring and alerting system
|
|
7
|
+
*/
|
|
8
|
+
export class RealTimeMonitor extends EventEmitter {
|
|
9
|
+
logger;
|
|
10
|
+
eventBus;
|
|
11
|
+
memory;
|
|
12
|
+
config;
|
|
13
|
+
// Metrics storage
|
|
14
|
+
timeSeries = new Map();
|
|
15
|
+
activeAlerts = new Map();
|
|
16
|
+
alertHistory = [];
|
|
17
|
+
// Monitoring state
|
|
18
|
+
monitoringInterval;
|
|
19
|
+
healthCheckInterval;
|
|
20
|
+
alertRules = new Map();
|
|
21
|
+
healthChecks = new Map();
|
|
22
|
+
// System state tracking
|
|
23
|
+
systemMetrics;
|
|
24
|
+
agentMetrics = new Map();
|
|
25
|
+
swarmMetrics;
|
|
26
|
+
// Dashboards
|
|
27
|
+
dashboards = new Map();
|
|
28
|
+
// Performance tracking
|
|
29
|
+
lastMetricsUpdate = new Date();
|
|
30
|
+
metricsBuffer = [];
|
|
31
|
+
alertProcessor;
|
|
32
|
+
constructor(config, logger, eventBus, memory) {
|
|
33
|
+
super();
|
|
34
|
+
this.logger = logger;
|
|
35
|
+
this.eventBus = eventBus;
|
|
36
|
+
this.memory = memory;
|
|
37
|
+
this.config = {
|
|
38
|
+
updateInterval: 5000,
|
|
39
|
+
retentionPeriod: 86400000, // 24 hours
|
|
40
|
+
alertingEnabled: true,
|
|
41
|
+
alertThresholds: {
|
|
42
|
+
cpu: { warning: 70, critical: 90 },
|
|
43
|
+
memory: { warning: 80, critical: 95 },
|
|
44
|
+
disk: { warning: 85, critical: 95 },
|
|
45
|
+
errorRate: { warning: 5, critical: 10 },
|
|
46
|
+
responseTime: { warning: 5000, critical: 10000 },
|
|
47
|
+
queueDepth: { warning: 10, critical: 20 },
|
|
48
|
+
agentHealth: { warning: 0.7, critical: 0.5 },
|
|
49
|
+
swarmUtilization: { warning: 0.8, critical: 0.95 }
|
|
50
|
+
},
|
|
51
|
+
metricsEnabled: true,
|
|
52
|
+
tracingEnabled: true,
|
|
53
|
+
dashboardEnabled: true,
|
|
54
|
+
exportEnabled: false,
|
|
55
|
+
exportFormat: 'json',
|
|
56
|
+
debugMode: false,
|
|
57
|
+
...config
|
|
58
|
+
};
|
|
59
|
+
this.systemMetrics = this.initializeSystemMetrics();
|
|
60
|
+
this.swarmMetrics = this.initializeSwarmMetrics();
|
|
61
|
+
this.setupEventHandlers();
|
|
62
|
+
this.initializeDefaultAlertRules();
|
|
63
|
+
this.initializeDefaultDashboards();
|
|
64
|
+
}
|
|
65
|
+
setupEventHandlers() {
|
|
66
|
+
// Agent events
|
|
67
|
+
this.eventBus.on('agent:metrics-update', (data) => {
|
|
68
|
+
this.updateAgentMetrics(data.agentId, data.metrics);
|
|
69
|
+
});
|
|
70
|
+
this.eventBus.on('agent:status-changed', (data) => {
|
|
71
|
+
this.recordMetric('agent.status.change', 1, {
|
|
72
|
+
agentId: data.agentId,
|
|
73
|
+
from: data.from,
|
|
74
|
+
to: data.to
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
// Task events
|
|
78
|
+
this.eventBus.on('task:started', (data) => {
|
|
79
|
+
this.recordMetric('task.started', 1, { taskId: data.taskId, agentId: data.agentId });
|
|
80
|
+
});
|
|
81
|
+
this.eventBus.on('task:completed', (data) => {
|
|
82
|
+
this.recordMetric('task.completed', 1, { taskId: data.taskId });
|
|
83
|
+
this.recordMetric('task.duration', data.duration, { taskId: data.taskId });
|
|
84
|
+
});
|
|
85
|
+
this.eventBus.on('task:failed', (data) => {
|
|
86
|
+
this.recordMetric('task.failed', 1, { taskId: data.taskId, error: data.error });
|
|
87
|
+
});
|
|
88
|
+
// System events
|
|
89
|
+
this.eventBus.on('system:resource-update', (data) => {
|
|
90
|
+
this.updateSystemMetrics(data);
|
|
91
|
+
});
|
|
92
|
+
this.eventBus.on('swarm:metrics-update', (data) => {
|
|
93
|
+
this.updateSwarmMetrics(data.metrics);
|
|
94
|
+
});
|
|
95
|
+
// Error events
|
|
96
|
+
this.eventBus.on('error', (data) => {
|
|
97
|
+
this.handleError(data);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
async initialize() {
|
|
101
|
+
this.logger.info('Initializing real-time monitor', {
|
|
102
|
+
updateInterval: this.config.updateInterval,
|
|
103
|
+
alerting: this.config.alertingEnabled,
|
|
104
|
+
dashboard: this.config.dashboardEnabled
|
|
105
|
+
});
|
|
106
|
+
// Start monitoring loops
|
|
107
|
+
this.startMetricsCollection();
|
|
108
|
+
this.startHealthChecks();
|
|
109
|
+
if (this.config.alertingEnabled) {
|
|
110
|
+
this.startAlertProcessing();
|
|
111
|
+
}
|
|
112
|
+
// Initialize default health checks
|
|
113
|
+
this.initializeHealthChecks();
|
|
114
|
+
this.emit('monitor:initialized');
|
|
115
|
+
}
|
|
116
|
+
async shutdown() {
|
|
117
|
+
this.logger.info('Shutting down real-time monitor');
|
|
118
|
+
// Stop all intervals
|
|
119
|
+
if (this.monitoringInterval)
|
|
120
|
+
clearInterval(this.monitoringInterval);
|
|
121
|
+
if (this.healthCheckInterval)
|
|
122
|
+
clearInterval(this.healthCheckInterval);
|
|
123
|
+
if (this.alertProcessor)
|
|
124
|
+
clearInterval(this.alertProcessor);
|
|
125
|
+
// Flush any remaining metrics
|
|
126
|
+
await this.flushMetrics();
|
|
127
|
+
this.emit('monitor:shutdown');
|
|
128
|
+
}
|
|
129
|
+
// === METRICS COLLECTION ===
|
|
130
|
+
startMetricsCollection() {
|
|
131
|
+
this.monitoringInterval = setInterval(() => {
|
|
132
|
+
this.collectSystemMetrics();
|
|
133
|
+
this.processMetricsBuffer();
|
|
134
|
+
this.cleanupOldMetrics();
|
|
135
|
+
}, this.config.updateInterval);
|
|
136
|
+
this.logger.info('Started metrics collection', {
|
|
137
|
+
interval: this.config.updateInterval
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
async collectSystemMetrics() {
|
|
141
|
+
try {
|
|
142
|
+
// Update system metrics
|
|
143
|
+
this.systemMetrics = {
|
|
144
|
+
...this.systemMetrics,
|
|
145
|
+
timestamp: new Date(),
|
|
146
|
+
cpuUsage: await this.getCpuUsage(),
|
|
147
|
+
memoryUsage: await this.getMemoryUsage(),
|
|
148
|
+
diskUsage: await this.getDiskUsage(),
|
|
149
|
+
networkUsage: await this.getNetworkUsage()
|
|
150
|
+
};
|
|
151
|
+
// Record as time series
|
|
152
|
+
this.recordMetric('system.cpu', this.systemMetrics.cpuUsage);
|
|
153
|
+
this.recordMetric('system.memory', this.systemMetrics.memoryUsage);
|
|
154
|
+
this.recordMetric('system.disk', this.systemMetrics.diskUsage);
|
|
155
|
+
this.recordMetric('system.network', this.systemMetrics.networkUsage);
|
|
156
|
+
// Update swarm-level metrics
|
|
157
|
+
await this.updateSwarmLevelMetrics();
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
this.logger.error('Failed to collect system metrics', error);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
async updateSwarmLevelMetrics() {
|
|
164
|
+
const agents = Array.from(this.agentMetrics.values());
|
|
165
|
+
this.swarmMetrics = {
|
|
166
|
+
...this.swarmMetrics,
|
|
167
|
+
agentUtilization: this.calculateAgentUtilization(agents),
|
|
168
|
+
throughput: this.calculateSwarmThroughput(agents),
|
|
169
|
+
latency: this.calculateAverageLatency(agents),
|
|
170
|
+
efficiency: this.calculateSwarmEfficiency(agents),
|
|
171
|
+
reliability: this.calculateSwarmReliability(agents),
|
|
172
|
+
averageQuality: this.calculateAverageQuality(agents)
|
|
173
|
+
};
|
|
174
|
+
// Record swarm metrics
|
|
175
|
+
this.recordMetric('swarm.utilization', this.swarmMetrics.agentUtilization);
|
|
176
|
+
this.recordMetric('swarm.throughput', this.swarmMetrics.throughput);
|
|
177
|
+
this.recordMetric('swarm.latency', this.swarmMetrics.latency);
|
|
178
|
+
this.recordMetric('swarm.efficiency', this.swarmMetrics.efficiency);
|
|
179
|
+
this.recordMetric('swarm.reliability', this.swarmMetrics.reliability);
|
|
180
|
+
}
|
|
181
|
+
recordMetric(name, value, tags = {}) {
|
|
182
|
+
const point = {
|
|
183
|
+
timestamp: new Date(),
|
|
184
|
+
value,
|
|
185
|
+
tags
|
|
186
|
+
};
|
|
187
|
+
// Add to buffer for batch processing
|
|
188
|
+
this.metricsBuffer.push({ ...point, tags: { ...tags, metric: name } });
|
|
189
|
+
// Immediate processing for critical metrics
|
|
190
|
+
if (this.isCriticalMetric(name)) {
|
|
191
|
+
this.processMetricPoint(name, point);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
processMetricsBuffer() {
|
|
195
|
+
if (this.metricsBuffer.length === 0)
|
|
196
|
+
return;
|
|
197
|
+
// Group by metric name
|
|
198
|
+
const metricGroups = new Map();
|
|
199
|
+
for (const point of this.metricsBuffer) {
|
|
200
|
+
const metricName = point.tags.metric || 'unknown';
|
|
201
|
+
const group = metricGroups.get(metricName) || [];
|
|
202
|
+
group.push(point);
|
|
203
|
+
metricGroups.set(metricName, group);
|
|
204
|
+
}
|
|
205
|
+
// Process each metric group
|
|
206
|
+
for (const [metricName, points] of metricGroups) {
|
|
207
|
+
for (const point of points) {
|
|
208
|
+
this.processMetricPoint(metricName, point);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
// Clear buffer
|
|
212
|
+
this.metricsBuffer = [];
|
|
213
|
+
}
|
|
214
|
+
processMetricPoint(metricName, point) {
|
|
215
|
+
let series = this.timeSeries.get(metricName);
|
|
216
|
+
if (!series) {
|
|
217
|
+
series = {
|
|
218
|
+
name: metricName,
|
|
219
|
+
points: [],
|
|
220
|
+
aggregations: { min: point.value, max: point.value, avg: point.value, sum: point.value, count: 1 },
|
|
221
|
+
lastUpdated: point.timestamp
|
|
222
|
+
};
|
|
223
|
+
this.timeSeries.set(metricName, series);
|
|
224
|
+
}
|
|
225
|
+
// Add point
|
|
226
|
+
series.points.push(point);
|
|
227
|
+
series.lastUpdated = point.timestamp;
|
|
228
|
+
// Update aggregations
|
|
229
|
+
series.aggregations.count++;
|
|
230
|
+
series.aggregations.sum += point.value;
|
|
231
|
+
series.aggregations.avg = series.aggregations.sum / series.aggregations.count;
|
|
232
|
+
series.aggregations.min = Math.min(series.aggregations.min, point.value);
|
|
233
|
+
series.aggregations.max = Math.max(series.aggregations.max, point.value);
|
|
234
|
+
// Trigger alert checking for this metric
|
|
235
|
+
if (this.config.alertingEnabled) {
|
|
236
|
+
this.checkAlertsForMetric(metricName, point);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
// === ALERTING ===
|
|
240
|
+
startAlertProcessing() {
|
|
241
|
+
this.alertProcessor = setInterval(() => {
|
|
242
|
+
this.processAlerts();
|
|
243
|
+
}, 1000); // Process alerts every second
|
|
244
|
+
this.logger.info('Started alert processing');
|
|
245
|
+
}
|
|
246
|
+
processAlerts() {
|
|
247
|
+
const now = new Date();
|
|
248
|
+
// Check for alert resolution
|
|
249
|
+
for (const [alertId, alert] of this.activeAlerts) {
|
|
250
|
+
if (!alert.resolved) {
|
|
251
|
+
const rule = this.alertRules.get(alert.context.ruleId);
|
|
252
|
+
if (rule && this.isAlertResolved(rule, alert)) {
|
|
253
|
+
this.resolveAlert(alertId, 'condition_resolved');
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
// Clean up old resolved alerts
|
|
258
|
+
this.cleanupResolvedAlerts();
|
|
259
|
+
}
|
|
260
|
+
checkAlertsForMetric(metricName, point) {
|
|
261
|
+
for (const [ruleId, rule] of this.alertRules) {
|
|
262
|
+
if (rule.enabled && rule.metric === metricName) {
|
|
263
|
+
this.evaluateAlertRule(rule, point);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
evaluateAlertRule(rule, point) {
|
|
268
|
+
const conditionMet = this.evaluateCondition(rule.condition, point.value, rule.threshold);
|
|
269
|
+
if (conditionMet) {
|
|
270
|
+
// Check if we already have an active alert for this rule
|
|
271
|
+
const existingAlert = Array.from(this.activeAlerts.values())
|
|
272
|
+
.find(alert => alert.context.ruleId === rule.id && !alert.resolved);
|
|
273
|
+
if (!existingAlert) {
|
|
274
|
+
this.createAlert(rule, point);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
createAlert(rule, triggeringPoint) {
|
|
279
|
+
const alertId = `alert-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
280
|
+
const alert = {
|
|
281
|
+
id: alertId,
|
|
282
|
+
timestamp: new Date(),
|
|
283
|
+
level: rule.severity,
|
|
284
|
+
type: this.getAlertTypeFromMetric(rule.metric),
|
|
285
|
+
message: `${rule.name}: ${rule.metric} ${rule.condition} ${rule.threshold} (current: ${triggeringPoint.value})`,
|
|
286
|
+
source: 'real-time-monitor',
|
|
287
|
+
context: {
|
|
288
|
+
ruleId: rule.id,
|
|
289
|
+
metric: rule.metric,
|
|
290
|
+
value: triggeringPoint.value,
|
|
291
|
+
threshold: rule.threshold,
|
|
292
|
+
tags: { ...rule.tags, ...triggeringPoint.tags }
|
|
293
|
+
},
|
|
294
|
+
acknowledged: false,
|
|
295
|
+
resolved: false,
|
|
296
|
+
escalationLevel: 0
|
|
297
|
+
};
|
|
298
|
+
this.activeAlerts.set(alertId, alert);
|
|
299
|
+
this.alertHistory.push(alert);
|
|
300
|
+
this.logger.warn('Alert created', {
|
|
301
|
+
alertId,
|
|
302
|
+
rule: rule.name,
|
|
303
|
+
metric: rule.metric,
|
|
304
|
+
value: triggeringPoint.value,
|
|
305
|
+
threshold: rule.threshold
|
|
306
|
+
});
|
|
307
|
+
this.emit('alert:created', { alert });
|
|
308
|
+
// Execute alert actions
|
|
309
|
+
this.executeAlertActions(rule, alert);
|
|
310
|
+
}
|
|
311
|
+
executeAlertActions(rule, alert) {
|
|
312
|
+
for (const action of rule.actions) {
|
|
313
|
+
if (!action.enabled)
|
|
314
|
+
continue;
|
|
315
|
+
try {
|
|
316
|
+
switch (action.type) {
|
|
317
|
+
case 'log':
|
|
318
|
+
this.logger.warn(`ALERT: ${alert.message}`, alert.context);
|
|
319
|
+
break;
|
|
320
|
+
case 'email':
|
|
321
|
+
this.sendEmailAlert(alert, action.config);
|
|
322
|
+
break;
|
|
323
|
+
case 'webhook':
|
|
324
|
+
this.sendWebhookAlert(alert, action.config);
|
|
325
|
+
break;
|
|
326
|
+
case 'auto-scale':
|
|
327
|
+
this.triggerAutoScale(alert, action.config);
|
|
328
|
+
break;
|
|
329
|
+
case 'restart':
|
|
330
|
+
this.triggerRestart(alert, action.config);
|
|
331
|
+
break;
|
|
332
|
+
default:
|
|
333
|
+
this.logger.warn('Unknown alert action type', { type: action.type });
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
catch (error) {
|
|
337
|
+
this.logger.error('Failed to execute alert action', {
|
|
338
|
+
alertId: alert.id,
|
|
339
|
+
actionType: action.type,
|
|
340
|
+
error
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
resolveAlert(alertId, reason) {
|
|
346
|
+
const alert = this.activeAlerts.get(alertId);
|
|
347
|
+
if (!alert)
|
|
348
|
+
return;
|
|
349
|
+
alert.resolved = true;
|
|
350
|
+
alert.context.resolutionReason = reason;
|
|
351
|
+
alert.context.resolvedAt = new Date();
|
|
352
|
+
this.logger.info('Alert resolved', { alertId, reason });
|
|
353
|
+
this.emit('alert:resolved', { alert, reason });
|
|
354
|
+
}
|
|
355
|
+
// === HEALTH CHECKS ===
|
|
356
|
+
startHealthChecks() {
|
|
357
|
+
this.healthCheckInterval = setInterval(() => {
|
|
358
|
+
this.performHealthChecks();
|
|
359
|
+
}, 30000); // Every 30 seconds
|
|
360
|
+
this.logger.info('Started health checks');
|
|
361
|
+
}
|
|
362
|
+
async performHealthChecks() {
|
|
363
|
+
const checks = Array.from(this.healthChecks.values());
|
|
364
|
+
const promises = checks.map(check => this.executeHealthCheck(check));
|
|
365
|
+
await Promise.allSettled(promises);
|
|
366
|
+
}
|
|
367
|
+
async executeHealthCheck(check) {
|
|
368
|
+
try {
|
|
369
|
+
let isHealthy = false;
|
|
370
|
+
switch (check.type) {
|
|
371
|
+
case 'http':
|
|
372
|
+
isHealthy = await this.performHttpHealthCheck(check);
|
|
373
|
+
break;
|
|
374
|
+
case 'tcp':
|
|
375
|
+
isHealthy = await this.performTcpHealthCheck(check);
|
|
376
|
+
break;
|
|
377
|
+
case 'custom':
|
|
378
|
+
if (check.customCheck) {
|
|
379
|
+
isHealthy = await check.customCheck();
|
|
380
|
+
}
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
383
|
+
this.recordMetric(`healthcheck.${check.name}`, isHealthy ? 1 : 0, {
|
|
384
|
+
type: check.type,
|
|
385
|
+
target: check.target
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
catch (error) {
|
|
389
|
+
this.logger.error('Health check failed', { check: check.name, error });
|
|
390
|
+
this.recordMetric(`healthcheck.${check.name}`, 0, {
|
|
391
|
+
type: check.type,
|
|
392
|
+
target: check.target,
|
|
393
|
+
error: (error instanceof Error ? error.message : String(error))
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
// === DASHBOARD MANAGEMENT ===
|
|
398
|
+
createDashboard(title, panels) {
|
|
399
|
+
const dashboardId = `dashboard-${Date.now()}`;
|
|
400
|
+
const dashboard = {
|
|
401
|
+
title,
|
|
402
|
+
panels,
|
|
403
|
+
refreshInterval: 30000,
|
|
404
|
+
timeRange: {
|
|
405
|
+
start: new Date(Date.now() - 3600000), // Last hour
|
|
406
|
+
end: new Date()
|
|
407
|
+
},
|
|
408
|
+
filters: {}
|
|
409
|
+
};
|
|
410
|
+
this.dashboards.set(dashboardId, dashboard);
|
|
411
|
+
this.emit('dashboard:created', { dashboardId, dashboard });
|
|
412
|
+
return dashboardId;
|
|
413
|
+
}
|
|
414
|
+
getDashboardData(dashboardId) {
|
|
415
|
+
const dashboard = this.dashboards.get(dashboardId);
|
|
416
|
+
if (!dashboard)
|
|
417
|
+
return null;
|
|
418
|
+
const data = {
|
|
419
|
+
dashboard,
|
|
420
|
+
panels: []
|
|
421
|
+
};
|
|
422
|
+
for (const panel of dashboard.panels) {
|
|
423
|
+
const panelData = {
|
|
424
|
+
id: panel.id,
|
|
425
|
+
title: panel.title,
|
|
426
|
+
type: panel.type,
|
|
427
|
+
data: this.getPanelData(panel, dashboard.timeRange)
|
|
428
|
+
};
|
|
429
|
+
data.panels.push(panelData);
|
|
430
|
+
}
|
|
431
|
+
return data;
|
|
432
|
+
}
|
|
433
|
+
getPanelData(panel, timeRange) {
|
|
434
|
+
const data = {};
|
|
435
|
+
for (const metricName of panel.metrics) {
|
|
436
|
+
const series = this.timeSeries.get(metricName);
|
|
437
|
+
if (series) {
|
|
438
|
+
// Filter points by time range
|
|
439
|
+
const filteredPoints = series.points.filter(point => point.timestamp >= timeRange.start && point.timestamp <= timeRange.end);
|
|
440
|
+
data[metricName] = {
|
|
441
|
+
points: filteredPoints,
|
|
442
|
+
aggregations: this.calculateAggregations(filteredPoints)
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
return data;
|
|
447
|
+
}
|
|
448
|
+
// === UTILITY METHODS ===
|
|
449
|
+
async getCpuUsage() {
|
|
450
|
+
// Placeholder - would use actual system APIs
|
|
451
|
+
return Math.random() * 100;
|
|
452
|
+
}
|
|
453
|
+
async getMemoryUsage() {
|
|
454
|
+
// Placeholder - would use actual system APIs
|
|
455
|
+
return Math.random() * 100;
|
|
456
|
+
}
|
|
457
|
+
async getDiskUsage() {
|
|
458
|
+
// Placeholder - would use actual system APIs
|
|
459
|
+
return Math.random() * 100;
|
|
460
|
+
}
|
|
461
|
+
async getNetworkUsage() {
|
|
462
|
+
// Placeholder - would use actual system APIs
|
|
463
|
+
return Math.random() * 1024 * 1024; // bytes
|
|
464
|
+
}
|
|
465
|
+
updateAgentMetrics(agentId, metrics) {
|
|
466
|
+
this.agentMetrics.set(agentId, metrics);
|
|
467
|
+
// Record individual agent metrics
|
|
468
|
+
this.recordMetric('agent.cpu', metrics.cpuUsage, { agentId });
|
|
469
|
+
this.recordMetric('agent.memory', metrics.memoryUsage, { agentId });
|
|
470
|
+
this.recordMetric('agent.tasks.completed', metrics.tasksCompleted, { agentId });
|
|
471
|
+
this.recordMetric('agent.tasks.failed', metrics.tasksFailed, { agentId });
|
|
472
|
+
this.recordMetric('agent.response.time', metrics.responseTime, { agentId });
|
|
473
|
+
}
|
|
474
|
+
updateSystemMetrics(data) {
|
|
475
|
+
this.systemMetrics = { ...this.systemMetrics, ...data };
|
|
476
|
+
}
|
|
477
|
+
updateSwarmMetrics(metrics) {
|
|
478
|
+
this.swarmMetrics = { ...this.swarmMetrics, ...metrics };
|
|
479
|
+
}
|
|
480
|
+
handleError(data) {
|
|
481
|
+
this.recordMetric('error.count', 1, {
|
|
482
|
+
type: data.type || 'unknown',
|
|
483
|
+
source: data.source || 'unknown'
|
|
484
|
+
});
|
|
485
|
+
// Create critical alert for errors
|
|
486
|
+
if (data.severity === 'critical') {
|
|
487
|
+
const alertId = `error-alert-${Date.now()}`;
|
|
488
|
+
const alert = {
|
|
489
|
+
id: alertId,
|
|
490
|
+
timestamp: new Date(),
|
|
491
|
+
level: 'critical',
|
|
492
|
+
type: 'system',
|
|
493
|
+
message: `Critical error: ${data.message}`,
|
|
494
|
+
source: data.source || 'unknown',
|
|
495
|
+
context: data,
|
|
496
|
+
acknowledged: false,
|
|
497
|
+
resolved: false,
|
|
498
|
+
escalationLevel: 0
|
|
499
|
+
};
|
|
500
|
+
this.activeAlerts.set(alertId, alert);
|
|
501
|
+
this.emit('alert:created', { alert });
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
isCriticalMetric(name) {
|
|
505
|
+
const criticalMetrics = [
|
|
506
|
+
'system.cpu', 'system.memory', 'system.disk',
|
|
507
|
+
'agent.health', 'task.failed', 'error.count'
|
|
508
|
+
];
|
|
509
|
+
return criticalMetrics.includes(name);
|
|
510
|
+
}
|
|
511
|
+
evaluateCondition(condition, value, threshold) {
|
|
512
|
+
switch (condition) {
|
|
513
|
+
case 'gt': return value > threshold;
|
|
514
|
+
case 'gte': return value >= threshold;
|
|
515
|
+
case 'lt': return value < threshold;
|
|
516
|
+
case 'lte': return value <= threshold;
|
|
517
|
+
case 'eq': return value === threshold;
|
|
518
|
+
default: return false;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
isAlertResolved(rule, alert) {
|
|
522
|
+
// Get recent metric values
|
|
523
|
+
const series = this.timeSeries.get(rule.metric);
|
|
524
|
+
if (!series || series.points.length === 0)
|
|
525
|
+
return false;
|
|
526
|
+
// Check if condition is no longer met
|
|
527
|
+
const recentPoints = series.points.slice(-5); // Last 5 points
|
|
528
|
+
const allResolved = recentPoints.every(point => !this.evaluateCondition(rule.condition, point.value, rule.threshold));
|
|
529
|
+
return allResolved;
|
|
530
|
+
}
|
|
531
|
+
getAlertTypeFromMetric(metric) {
|
|
532
|
+
if (metric.includes('system'))
|
|
533
|
+
return 'system';
|
|
534
|
+
if (metric.includes('agent'))
|
|
535
|
+
return 'agent';
|
|
536
|
+
if (metric.includes('task'))
|
|
537
|
+
return 'task';
|
|
538
|
+
if (metric.includes('swarm'))
|
|
539
|
+
return 'swarm';
|
|
540
|
+
if (metric.includes('performance'))
|
|
541
|
+
return 'performance';
|
|
542
|
+
if (metric.includes('resource'))
|
|
543
|
+
return 'resource';
|
|
544
|
+
return 'custom';
|
|
545
|
+
}
|
|
546
|
+
calculateAgentUtilization(agents) {
|
|
547
|
+
if (agents.length === 0)
|
|
548
|
+
return 0;
|
|
549
|
+
const totalUtilization = agents.reduce((sum, agent) => sum + agent.cpuUsage, 0);
|
|
550
|
+
return totalUtilization / agents.length;
|
|
551
|
+
}
|
|
552
|
+
calculateSwarmThroughput(agents) {
|
|
553
|
+
return agents.reduce((sum, agent) => sum + (agent.tasksCompleted || 0), 0);
|
|
554
|
+
}
|
|
555
|
+
calculateAverageLatency(agents) {
|
|
556
|
+
if (agents.length === 0)
|
|
557
|
+
return 0;
|
|
558
|
+
const totalLatency = agents.reduce((sum, agent) => sum + agent.responseTime, 0);
|
|
559
|
+
return totalLatency / agents.length;
|
|
560
|
+
}
|
|
561
|
+
calculateSwarmEfficiency(agents) {
|
|
562
|
+
if (agents.length === 0)
|
|
563
|
+
return 0;
|
|
564
|
+
const totalTasks = agents.reduce((sum, agent) => sum + (agent.tasksCompleted || 0) + (agent.tasksFailed || 0), 0);
|
|
565
|
+
const completedTasks = agents.reduce((sum, agent) => sum + (agent.tasksCompleted || 0), 0);
|
|
566
|
+
return totalTasks > 0 ? completedTasks / totalTasks : 1;
|
|
567
|
+
}
|
|
568
|
+
calculateSwarmReliability(agents) {
|
|
569
|
+
if (agents.length === 0)
|
|
570
|
+
return 1;
|
|
571
|
+
const totalReliability = agents.reduce((sum, agent) => sum + (agent.successRate || 1), 0);
|
|
572
|
+
return totalReliability / agents.length;
|
|
573
|
+
}
|
|
574
|
+
calculateAverageQuality(agents) {
|
|
575
|
+
if (agents.length === 0)
|
|
576
|
+
return 0.8;
|
|
577
|
+
const totalQuality = agents.reduce((sum, agent) => sum + (agent.codeQuality || 0.8), 0);
|
|
578
|
+
return totalQuality / agents.length;
|
|
579
|
+
}
|
|
580
|
+
calculateAggregations(points) {
|
|
581
|
+
if (points.length === 0) {
|
|
582
|
+
return { min: 0, max: 0, avg: 0, sum: 0, count: 0 };
|
|
583
|
+
}
|
|
584
|
+
const values = points.map(p => p.value);
|
|
585
|
+
return {
|
|
586
|
+
min: Math.min(...values),
|
|
587
|
+
max: Math.max(...values),
|
|
588
|
+
avg: values.reduce((sum, val) => sum + val, 0) / values.length,
|
|
589
|
+
sum: values.reduce((sum, val) => sum + val, 0),
|
|
590
|
+
count: values.length
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
cleanupOldMetrics() {
|
|
594
|
+
const cutoff = new Date(Date.now() - this.config.retentionPeriod);
|
|
595
|
+
for (const [name, series] of this.timeSeries) {
|
|
596
|
+
series.points = series.points.filter(point => point.timestamp > cutoff);
|
|
597
|
+
if (series.points.length === 0) {
|
|
598
|
+
this.timeSeries.delete(name);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
cleanupResolvedAlerts() {
|
|
603
|
+
const cutoff = new Date(Date.now() - 86400000); // 24 hours
|
|
604
|
+
// Remove old resolved alerts from active alerts
|
|
605
|
+
for (const [alertId, alert] of this.activeAlerts) {
|
|
606
|
+
if (alert.resolved && alert.timestamp < cutoff) {
|
|
607
|
+
this.activeAlerts.delete(alertId);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
// Trim alert history
|
|
611
|
+
this.alertHistory = this.alertHistory
|
|
612
|
+
.filter(alert => alert.timestamp > cutoff)
|
|
613
|
+
.slice(-1000); // Keep last 1000 alerts max
|
|
614
|
+
}
|
|
615
|
+
async flushMetrics() {
|
|
616
|
+
if (this.metricsBuffer.length > 0) {
|
|
617
|
+
this.processMetricsBuffer();
|
|
618
|
+
}
|
|
619
|
+
// Persist metrics to memory if enabled
|
|
620
|
+
if (this.config.exportEnabled) {
|
|
621
|
+
await this.exportMetrics();
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
async exportMetrics() {
|
|
625
|
+
try {
|
|
626
|
+
const exportData = {
|
|
627
|
+
timestamp: new Date(),
|
|
628
|
+
timeSeries: Array.from(this.timeSeries.entries()),
|
|
629
|
+
systemMetrics: this.systemMetrics,
|
|
630
|
+
swarmMetrics: this.swarmMetrics,
|
|
631
|
+
activeAlerts: Array.from(this.activeAlerts.values())
|
|
632
|
+
};
|
|
633
|
+
await this.memory.store('monitoring:export', exportData, {
|
|
634
|
+
type: 'monitoring-export',
|
|
635
|
+
partition: 'metrics'
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
catch (error) {
|
|
639
|
+
this.logger.error('Failed to export metrics', error);
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
initializeDefaultAlertRules() {
|
|
643
|
+
const rules = [
|
|
644
|
+
{
|
|
645
|
+
id: 'cpu-warning',
|
|
646
|
+
name: 'High CPU Usage',
|
|
647
|
+
enabled: true,
|
|
648
|
+
metric: 'system.cpu',
|
|
649
|
+
condition: 'gt',
|
|
650
|
+
threshold: this.config.alertThresholds.cpu.warning,
|
|
651
|
+
duration: 60000,
|
|
652
|
+
severity: 'warning',
|
|
653
|
+
tags: { category: 'system' },
|
|
654
|
+
actions: [{ type: 'log', config: {}, enabled: true }],
|
|
655
|
+
suppressions: []
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
id: 'memory-critical',
|
|
659
|
+
name: 'Critical Memory Usage',
|
|
660
|
+
enabled: true,
|
|
661
|
+
metric: 'system.memory',
|
|
662
|
+
condition: 'gt',
|
|
663
|
+
threshold: this.config.alertThresholds.memory.critical,
|
|
664
|
+
duration: 30000,
|
|
665
|
+
severity: 'critical',
|
|
666
|
+
tags: { category: 'system' },
|
|
667
|
+
actions: [
|
|
668
|
+
{ type: 'log', config: {}, enabled: true },
|
|
669
|
+
{ type: 'auto-scale', config: { action: 'scale-down' }, enabled: true }
|
|
670
|
+
],
|
|
671
|
+
suppressions: []
|
|
672
|
+
}
|
|
673
|
+
];
|
|
674
|
+
rules.forEach(rule => this.alertRules.set(rule.id, rule));
|
|
675
|
+
}
|
|
676
|
+
initializeDefaultDashboards() {
|
|
677
|
+
const systemDashboard = this.createDashboard('System Overview', [
|
|
678
|
+
{
|
|
679
|
+
id: 'cpu-panel',
|
|
680
|
+
title: 'CPU Usage',
|
|
681
|
+
type: 'line',
|
|
682
|
+
metrics: ['system.cpu'],
|
|
683
|
+
config: {
|
|
684
|
+
width: 6,
|
|
685
|
+
height: 4,
|
|
686
|
+
position: { x: 0, y: 0 },
|
|
687
|
+
visualization: { yAxis: { max: 100 } }
|
|
688
|
+
}
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
id: 'memory-panel',
|
|
692
|
+
title: 'Memory Usage',
|
|
693
|
+
type: 'gauge',
|
|
694
|
+
metrics: ['system.memory'],
|
|
695
|
+
config: {
|
|
696
|
+
width: 6,
|
|
697
|
+
height: 4,
|
|
698
|
+
position: { x: 6, y: 0 },
|
|
699
|
+
visualization: { max: 100, threshold: [70, 90] }
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
]);
|
|
703
|
+
this.logger.info('Created default dashboard', { dashboardId: systemDashboard });
|
|
704
|
+
}
|
|
705
|
+
initializeHealthChecks() {
|
|
706
|
+
// Add default health checks
|
|
707
|
+
this.healthChecks.set('system', {
|
|
708
|
+
name: 'system',
|
|
709
|
+
type: 'custom',
|
|
710
|
+
target: 'local',
|
|
711
|
+
interval: 30000,
|
|
712
|
+
timeout: 5000,
|
|
713
|
+
retries: 3,
|
|
714
|
+
customCheck: async () => {
|
|
715
|
+
// Basic system health check
|
|
716
|
+
return this.systemMetrics.cpuUsage < 95 && this.systemMetrics.memoryUsage < 95;
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
async performHttpHealthCheck(check) {
|
|
721
|
+
// Placeholder for HTTP health check
|
|
722
|
+
return true;
|
|
723
|
+
}
|
|
724
|
+
async performTcpHealthCheck(check) {
|
|
725
|
+
// Placeholder for TCP health check
|
|
726
|
+
return true;
|
|
727
|
+
}
|
|
728
|
+
async sendEmailAlert(alert, config) {
|
|
729
|
+
// Placeholder for email alert
|
|
730
|
+
this.logger.info('Email alert sent', { alertId: alert.id });
|
|
731
|
+
}
|
|
732
|
+
async sendWebhookAlert(alert, config) {
|
|
733
|
+
// Placeholder for webhook alert
|
|
734
|
+
this.logger.info('Webhook alert sent', { alertId: alert.id });
|
|
735
|
+
}
|
|
736
|
+
async triggerAutoScale(alert, config) {
|
|
737
|
+
// Placeholder for auto-scaling
|
|
738
|
+
this.logger.info('Auto-scale triggered', { alertId: alert.id, action: config.action });
|
|
739
|
+
this.eventBus.emit('autoscale:triggered', { alert, config });
|
|
740
|
+
}
|
|
741
|
+
async triggerRestart(alert, config) {
|
|
742
|
+
// Placeholder for restart action
|
|
743
|
+
this.logger.info('Restart triggered', { alertId: alert.id });
|
|
744
|
+
this.eventBus.emit('restart:triggered', { alert, config });
|
|
745
|
+
}
|
|
746
|
+
initializeSystemMetrics() {
|
|
747
|
+
return {
|
|
748
|
+
timestamp: new Date(),
|
|
749
|
+
cpuUsage: 0,
|
|
750
|
+
memoryUsage: 0,
|
|
751
|
+
diskUsage: 0,
|
|
752
|
+
networkUsage: 0,
|
|
753
|
+
activeSwarms: 0,
|
|
754
|
+
totalAgents: 0,
|
|
755
|
+
activeAgents: 0,
|
|
756
|
+
totalTasks: 0,
|
|
757
|
+
runningTasks: 0,
|
|
758
|
+
throughput: 0,
|
|
759
|
+
latency: 0,
|
|
760
|
+
errorRate: 0,
|
|
761
|
+
successRate: 100,
|
|
762
|
+
resourceUtilization: {},
|
|
763
|
+
queueLengths: {}
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
initializeSwarmMetrics() {
|
|
767
|
+
return {
|
|
768
|
+
throughput: 0,
|
|
769
|
+
latency: 0,
|
|
770
|
+
efficiency: 1.0,
|
|
771
|
+
reliability: 1.0,
|
|
772
|
+
averageQuality: 0.8,
|
|
773
|
+
defectRate: 0,
|
|
774
|
+
reworkRate: 0,
|
|
775
|
+
resourceUtilization: {},
|
|
776
|
+
costEfficiency: 1.0,
|
|
777
|
+
agentUtilization: 0,
|
|
778
|
+
agentSatisfaction: 0.8,
|
|
779
|
+
collaborationEffectiveness: 0.8,
|
|
780
|
+
scheduleVariance: 0,
|
|
781
|
+
deadlineAdherence: 1.0
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
// === PUBLIC API ===
|
|
785
|
+
getSystemMetrics() {
|
|
786
|
+
return { ...this.systemMetrics };
|
|
787
|
+
}
|
|
788
|
+
getSwarmMetrics() {
|
|
789
|
+
return { ...this.swarmMetrics };
|
|
790
|
+
}
|
|
791
|
+
getActiveAlerts() {
|
|
792
|
+
return Array.from(this.activeAlerts.values());
|
|
793
|
+
}
|
|
794
|
+
getAlertHistory(limit = 100) {
|
|
795
|
+
return this.alertHistory.slice(-limit);
|
|
796
|
+
}
|
|
797
|
+
getTimeSeries(metricName) {
|
|
798
|
+
return this.timeSeries.get(metricName);
|
|
799
|
+
}
|
|
800
|
+
getAllTimeSeries() {
|
|
801
|
+
return Array.from(this.timeSeries.values());
|
|
802
|
+
}
|
|
803
|
+
acknowledgeAlert(alertId, acknowledgedBy) {
|
|
804
|
+
const alert = this.activeAlerts.get(alertId);
|
|
805
|
+
if (alert) {
|
|
806
|
+
alert.acknowledged = true;
|
|
807
|
+
alert.assignedTo = acknowledgedBy;
|
|
808
|
+
this.emit('alert:acknowledged', { alert, acknowledgedBy });
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
createAlertRule(rule) {
|
|
812
|
+
const ruleId = `rule-${Date.now()}`;
|
|
813
|
+
this.alertRules.set(ruleId, { ...rule, id: ruleId });
|
|
814
|
+
return ruleId;
|
|
815
|
+
}
|
|
816
|
+
updateAlertRule(ruleId, updates) {
|
|
817
|
+
const rule = this.alertRules.get(ruleId);
|
|
818
|
+
if (rule) {
|
|
819
|
+
this.alertRules.set(ruleId, { ...rule, ...updates });
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
deleteAlertRule(ruleId) {
|
|
823
|
+
this.alertRules.delete(ruleId);
|
|
824
|
+
}
|
|
825
|
+
getAlertRules() {
|
|
826
|
+
return Array.from(this.alertRules.values());
|
|
827
|
+
}
|
|
828
|
+
getMonitoringStatistics() {
|
|
829
|
+
return {
|
|
830
|
+
metricsCount: this.timeSeries.size,
|
|
831
|
+
activeAlerts: this.activeAlerts.size,
|
|
832
|
+
alertRules: this.alertRules.size,
|
|
833
|
+
healthChecks: this.healthChecks.size,
|
|
834
|
+
dashboards: this.dashboards.size,
|
|
835
|
+
uptime: Date.now() - this.lastMetricsUpdate.getTime()
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
//# sourceMappingURL=real-time-monitor.js.map
|