claude-flow-novice 1.2.1 → 1.3.1
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/commands/claude-soul.js +1 -1
- package/.claude/commands/sparc.js +1 -1
- package/.claude-flow-novice/README.md +1 -0
- package/.claude-flow-novice/dist/cli/index.js +45 -0
- package/.claude-flow-novice/dist/core/index.js +22 -0
- package/.claude-flow-novice/dist/index.js +24 -0
- package/.claude-flow-novice/dist/src/adapters/cliffy-node.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/agent-loader.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/agent-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/agent-registry.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/agent-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/custom-test-agent.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/github/agent-factory.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/github/compatibility/legacy-agent-mappings.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/github/compatibility/legacy-agent-proxy.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/github/core/github-collaboration-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/github/core/github-integration-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/github/core/github-release-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/github/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/github/types/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/github/utils/error-handling.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/github/utils/github-client.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/github/utils/hook-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/github/utils/performance-optimizer.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/hierarchical-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/lifecycle-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/mesh-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/simple-agent.js.map +1 -0
- package/.claude-flow-novice/dist/src/agents/task-agent-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/api/auth-service.js.map +1 -0
- package/.claude-flow-novice/dist/src/api/claude-api-errors.js.map +1 -0
- package/.claude-flow-novice/dist/src/api/claude-client-enhanced.js.map +1 -0
- package/.claude-flow-novice/dist/src/api/claude-client.js.map +1 -0
- package/.claude-flow-novice/dist/src/api/database-service.js.map +1 -0
- package/.claude-flow-novice/dist/src/api/swarm-api.js.map +1 -0
- package/.claude-flow-novice/dist/src/automation/test-pipeline/E2ETestGenerator.js.map +1 -0
- package/.claude-flow-novice/dist/src/automation/test-pipeline/PerformanceMonitor.js.map +1 -0
- package/.claude-flow-novice/dist/src/automation/test-pipeline/PipelineValidator.js.map +1 -0
- package/.claude-flow-novice/dist/src/automation/test-pipeline/RegressionTestManager.js.map +1 -0
- package/.claude-flow-novice/dist/src/automation/test-pipeline/SwarmTestCoordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/automation/test-pipeline/TestDataManager.js.map +1 -0
- package/.claude-flow-novice/dist/src/automation/test-pipeline/TestReportingSystem.js.map +1 -0
- package/.claude-flow-novice/dist/src/automation/test-pipeline/utils/chrome-mcp-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/automation/test-pipeline/utils/swarm-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/ci-cd/deployment-orchestrator.js.map +1 -0
- package/.claude-flow-novice/dist/src/ci-cd/github-actions-templates.js.map +1 -0
- package/.claude-flow-novice/dist/src/ci-cd/performance/PerformanceGate.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/agents/analyst.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/agents/architect.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/agents/base-agent.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/agents/capabilities.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/agents/coder.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/agents/coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/agents/hive-agents.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/agents/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/agents/researcher.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/agents/tester.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/cli-core.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/advanced-memory-commands.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/agent-simple.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/agent.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/claude-api.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/claude.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/config-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/config.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/enterprise.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/goal-init.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/help-new.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/help.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/hive-mind/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/hive-mind/init.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/hive-mind/optimize-memory.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/hive-mind/pause.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/hive-mind/ps.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/hive-mind/resume.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/hive-mind/spawn.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/hive-mind/status.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/hive-mind/stop.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/hive-mind/task.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/hive-mind/wizard.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/hive.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/hook-types.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/hook-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/hook.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/maestro.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/mcp.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/memory.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/migrate.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/monitor.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/neural-init.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/ruv-swarm.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/session.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/sparc.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/start/event-emitter.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/start/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/start/process-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/start/process-ui-simple.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/start/process-ui.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/start/start-command.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/start/system-monitor.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/start/types.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/start.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/status.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/swarm-spawn.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/swarm.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/task.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/validate-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/verification.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/workflow.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/completion.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/consolidated/ConsolidatedCLI.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/consolidated/core/CommandHandlers.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/consolidated/core/TierManager.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/consolidated/help/InteractiveHelp.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/consolidated/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/consolidated/intelligence/IntelligenceEngine.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/consolidated/routing/CommandRouter.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/consolidated/utils/IntelligentDefaults.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/consolidated/utils/PerformanceOptimizer.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/formatter.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/help-formatter.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/index-remote.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/init/batch-tools.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/init/claude-config.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/init/directory-structure.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/init/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/init/sparc-environment.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/init/swarm-commands.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/init/utils.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/maestro-cli-bridge.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/main.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/node-repl.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/repl.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/simple-cli.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/simple-mcp.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/simple-orchestrator.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/ui/compatible-ui.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/ui/fallback-handler.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/ui/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/utils/environment-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/utils/prompt-defaults.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/validation-helper.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/message-bus.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/reliable-communication-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/ai/decision-tree-generator.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/ai/project-detection-engine.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/config-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/consent-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/core/intelligent-configuration-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/integration/hooks-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/migration/config-migration.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/migration/version-migration-engine.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/migration-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/ruv-swarm-config.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/ruv-swarm-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/storage/multi-tier-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/test-migration-fixer.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/ui/progressive-disclosure-engine.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/utils/config-export-import.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/utils/zero-config-setup.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/validation/config-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/web-portal-config.js.map +1 -0
- package/.claude-flow-novice/dist/src/config/zero-config-setup.js.map +1 -0
- package/.claude-flow-novice/dist/src/constants/agent-types.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/advanced-scheduler.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/advanced-task-executor.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/background-executor.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/circuit-breaker.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/conflict-resolution.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/dependency-graph.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/hive-orchestrator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/hive-protocol.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/load-balancer.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/messaging.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/metrics.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/resources.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/scheduler.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/swarm-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/swarm-monitor.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/work-stealing.js.map +1 -0
- package/.claude-flow-novice/dist/src/core/agent-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/core/config.js.map +1 -0
- package/.claude-flow-novice/dist/src/core/event-bus.js.map +1 -0
- package/.claude-flow-novice/dist/src/core/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/core/json-persistence.js.map +1 -0
- package/.claude-flow-novice/dist/src/core/logger.js.map +1 -0
- package/.claude-flow-novice/dist/src/core/orchestrator-fixed.js.map +1 -0
- package/.claude-flow-novice/dist/src/core/orchestrator.js.map +1 -0
- package/.claude-flow-novice/dist/src/core/persistence.js.map +1 -0
- package/.claude-flow-novice/dist/src/core/project-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/core/version.js.map +1 -0
- package/.claude-flow-novice/dist/src/crdt/types.js.map +1 -0
- package/.claude-flow-novice/dist/src/enterprise/analytics-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/enterprise/audit-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/enterprise/cloud-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/enterprise/deployment-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/enterprise/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/enterprise/project-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/enterprise/security-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/feature-flags/cli/Phase4CLI.js.map +1 -0
- package/.claude-flow-novice/dist/src/feature-flags/core/FeatureFlagManager.js.map +1 -0
- package/.claude-flow-novice/dist/src/feature-flags/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/feature-flags/monitoring/RolloutMonitor.js.map +1 -0
- package/.claude-flow-novice/dist/src/feature-flags/rollout/RolloutController.js.map +1 -0
- package/.claude-flow-novice/dist/src/feature-flags/validation/HookInterceptor.js.map +1 -0
- package/.claude-flow-novice/dist/src/feature-flags/validation/TruthBasedValidator.js.map +1 -0
- package/.claude-flow-novice/dist/src/hive-mind/core/Agent.js.map +1 -0
- package/.claude-flow-novice/dist/src/hive-mind/core/Communication.js.map +1 -0
- package/.claude-flow-novice/dist/src/hive-mind/core/DatabaseManager.js.map +1 -0
- package/.claude-flow-novice/dist/src/hive-mind/core/HiveMind.js.map +1 -0
- package/.claude-flow-novice/dist/src/hive-mind/core/Memory.js.map +1 -0
- package/.claude-flow-novice/dist/src/hive-mind/core/MemoryMonitor.js.map +1 -0
- package/.claude-flow-novice/dist/src/hive-mind/core/Queen.js.map +1 -0
- package/.claude-flow-novice/dist/src/hive-mind/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/hive-mind/integration/ConsensusEngine.js.map +1 -0
- package/.claude-flow-novice/dist/src/hive-mind/integration/MCPToolWrapper.js.map +1 -0
- package/.claude-flow-novice/dist/src/hive-mind/integration/SwarmOrchestrator.js.map +1 -0
- package/.claude-flow-novice/dist/src/hive-mind/types.js.map +1 -0
- package/.claude-flow-novice/dist/src/hooks/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/integration/mock-components.js.map +1 -0
- package/.claude-flow-novice/dist/src/integration/system-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/integration/types.js.map +1 -0
- package/.claude-flow-novice/dist/src/lifecycle/communication-protocols.js.map +1 -0
- package/.claude-flow-novice/dist/src/lifecycle/dependency-tracker.js.map +1 -0
- package/.claude-flow-novice/dist/src/lifecycle/memory-schema.js.map +1 -0
- package/.claude-flow-novice/dist/src/maestro/maestro-swarm-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/maestro/maestro-types.js.map +1 -0
- package/.claude-flow-novice/dist/src/maestro/tests/native-hive-mind-integration.test.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/auth.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/claude-code-wrapper.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/claude-flow-tools.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/client.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/integrate-wrapper.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/lifecycle-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/load-balancer.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/orchestration-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/performance-monitor.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/protocol-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/recovery/connection-health-monitor.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/recovery/connection-state-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/recovery/fallback-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/recovery/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/recovery/reconnection-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/recovery/recovery-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/router.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/ruv-swarm-tools.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/server-with-wrapper.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/server-wrapper-mode.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/server.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/session-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/sparc-modes.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/swarm-tools.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/tests/mcp-integration.test.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/tools.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/transports/base.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/transports/http.js.map +1 -0
- package/.claude-flow-novice/dist/src/mcp/transports/stdio.js.map +1 -0
- package/.claude-flow-novice/dist/src/memory/advanced-memory-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/memory/backends/base.js.map +1 -0
- package/.claude-flow-novice/dist/src/memory/backends/markdown.js.map +1 -0
- package/.claude-flow-novice/dist/src/memory/backends/sqlite.js.map +1 -0
- package/.claude-flow-novice/dist/src/memory/cache.js.map +1 -0
- package/.claude-flow-novice/dist/src/memory/distributed-memory.js.map +1 -0
- package/.claude-flow-novice/dist/src/memory/indexer.js.map +1 -0
- package/.claude-flow-novice/dist/src/memory/manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/memory/sqlite-enhanced-backend.js.map +1 -0
- package/.claude-flow-novice/dist/src/memory/swarm-memory.js.map +1 -0
- package/.claude-flow-novice/dist/src/migration/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/migration/logger.js.map +1 -0
- package/.claude-flow-novice/dist/src/migration/migration-analyzer.js.map +1 -0
- package/.claude-flow-novice/dist/src/migration/migration-runner.js.map +1 -0
- package/.claude-flow-novice/dist/src/migration/migration-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/migration/progress-reporter.js.map +1 -0
- package/.claude-flow-novice/dist/src/migration/rollback-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/migration/tests/migration-system.test.js.map +1 -0
- package/.claude-flow-novice/dist/src/migration/types.js.map +1 -0
- package/.claude-flow-novice/dist/src/monitoring/diagnostics.js.map +1 -0
- package/.claude-flow-novice/dist/src/monitoring/health-check.js.map +1 -0
- package/.claude-flow-novice/dist/src/monitoring/phase4/analytics/consensus-tracker.js.map +1 -0
- package/.claude-flow-novice/dist/src/monitoring/phase4/analytics/performance-assessor.js.map +1 -0
- package/.claude-flow-novice/dist/src/monitoring/phase4/analytics/truth-score-analyzer.js.map +1 -0
- package/.claude-flow-novice/dist/src/monitoring/phase4/dashboard/monitoring-dashboard.js.map +1 -0
- package/.claude-flow-novice/dist/src/monitoring/phase4/rollout-decision-engine.js.map +1 -0
- package/.claude-flow-novice/dist/src/monitoring/real-time-feedback-system.js.map +1 -0
- package/.claude-flow-novice/dist/src/monitoring/real-time-monitor.js.map +1 -0
- package/.claude-flow-novice/dist/src/monitoring/regression/RegressionDetector.js.map +1 -0
- package/.claude-flow-novice/dist/src/neural/NeuralDomainMapper.js.map +1 -0
- package/.claude-flow-novice/dist/src/neural/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/neural/integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/providers/anthropic-provider.js.map +1 -0
- package/.claude-flow-novice/dist/src/providers/base-provider.js.map +1 -0
- package/.claude-flow-novice/dist/src/providers/cohere-provider.js.map +1 -0
- package/.claude-flow-novice/dist/src/providers/google-provider.js.map +1 -0
- package/.claude-flow-novice/dist/src/providers/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/providers/ollama-provider.js.map +1 -0
- package/.claude-flow-novice/dist/src/providers/openai-provider.js.map +1 -0
- package/.claude-flow-novice/dist/src/providers/provider-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/providers/types.js.map +1 -0
- package/.claude-flow-novice/dist/src/providers/utils.js.map +1 -0
- package/.claude-flow-novice/dist/src/quality-gates/automated-review-system.js.map +1 -0
- package/.claude-flow-novice/dist/src/resources/resource-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/rollback/recovery-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/services/agent-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/services/agentic-flow-hooks/hook-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/services/agentic-flow-hooks/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/services/agentic-flow-hooks/llm-hooks.js.map +1 -0
- package/.claude-flow-novice/dist/src/services/agentic-flow-hooks/memory-hooks.js.map +1 -0
- package/.claude-flow-novice/dist/src/services/agentic-flow-hooks/neural-hooks.js.map +1 -0
- package/.claude-flow-novice/dist/src/services/agentic-flow-hooks/performance-hooks.js.map +1 -0
- package/.claude-flow-novice/dist/src/services/agentic-flow-hooks/types.js.map +1 -0
- package/.claude-flow-novice/dist/src/services/agentic-flow-hooks/workflow-hooks.js.map +1 -0
- package/.claude-flow-novice/dist/src/services/performance-metrics-collector.js.map +1 -0
- package/.claude-flow-novice/dist/src/services/swarm-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/services/swarm-memory-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/services/swarm-relaunch-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/services/task-handoff-service.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/__tests__/integration.test.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/__tests__/prompt-copier.test.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/advanced-orchestrator.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/claude-code-interface.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/claude-flow-executor.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/direct-executor.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/executor-v2.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/executor.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/hive-mind-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/json-output-aggregator.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/mcp-integration-wrapper.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/memory.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/optimizations/__tests__/optimization.test.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/optimizations/async-file-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/optimizations/circular-buffer.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/optimizations/connection-pool.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/optimizations/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/optimizations/optimized-executor.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/optimizations/ttl-map.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/prompt-cli.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/prompt-copier-enhanced.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/prompt-copier.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/prompt-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/prompt-utils.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/result-aggregator.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/sparc-executor.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/strategies/auto.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/strategies/base.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/strategies/research.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/strategies/strategy-metrics-patch.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/types.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm/workers/copy-worker.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/adapters/chrome-mcp-adapter.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/adapters/shadcn-mcp-adapter.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/cli/fullstack-cli.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/config/fullstack-config.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/core/dynamic-agent-spawner.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/core/enhanced-swarm-message-router.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/core/fullstack-orchestrator.js.map +1 -0
- package/.claude-flow-novice/dist/src/swarm-fullstack/types/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/task/commands.js.map +1 -0
- package/.claude-flow-novice/dist/src/task/coordination.js.map +1 -0
- package/.claude-flow-novice/dist/src/task/engine.js.map +1 -0
- package/.claude-flow-novice/dist/src/task/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/task/types.js.map +1 -0
- package/.claude-flow-novice/dist/src/terminal/adapters/base.js.map +1 -0
- package/.claude-flow-novice/dist/src/terminal/adapters/native.js.map +1 -0
- package/.claude-flow-novice/dist/src/terminal/adapters/vscode.js.map +1 -0
- package/.claude-flow-novice/dist/src/terminal/manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/terminal/pool.js.map +1 -0
- package/.claude-flow-novice/dist/src/terminal/session.js.map +1 -0
- package/.claude-flow-novice/dist/src/terminal/vscode-bridge.js.map +1 -0
- package/.claude-flow-novice/dist/src/testing/performance/PerformanceTestRunner.js.map +1 -0
- package/.claude-flow-novice/dist/src/testing-integration/chrome-mcp-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/testing-integration/continuous-test-runner.js.map +1 -0
- package/.claude-flow-novice/dist/src/tests/validation-consistency.test.js.map +1 -0
- package/.claude-flow-novice/dist/src/topology/adaptive-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/topology/communication-bridge.js.map +1 -0
- package/.claude-flow-novice/dist/src/topology/enhanced-hierarchical-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/topology/enhanced-mesh-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/topology/topology-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/topology/types.js.map +1 -0
- package/.claude-flow-novice/dist/src/types/agent-lifecycle-types.js.map +1 -0
- package/.claude-flow-novice/dist/src/types/agent-types.js.map +1 -0
- package/.claude-flow-novice/dist/src/types/cliffy.d.js.map +1 -0
- package/.claude-flow-novice/dist/src/types/global.d.js.map +1 -0
- package/.claude-flow-novice/dist/src/types/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/types/mcp.d.js.map +1 -0
- package/.claude-flow-novice/dist/src/types/vscode.d.js.map +1 -0
- package/.claude-flow-novice/dist/src/ui/hive-dashboard.js.map +1 -0
- package/.claude-flow-novice/dist/src/utils/error-handler.js.map +1 -0
- package/.claude-flow-novice/dist/src/utils/errors.js.map +1 -0
- package/.claude-flow-novice/dist/src/utils/formatters.js.map +1 -0
- package/.claude-flow-novice/dist/src/utils/helpers.js.map +1 -0
- package/.claude-flow-novice/dist/src/utils/paths.js.map +1 -0
- package/.claude-flow-novice/dist/src/utils/type-guards.js.map +1 -0
- package/.claude-flow-novice/dist/src/utils/types.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/agent-scorer.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/alert-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/api/types/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/checkpoint-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/cli-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/conflict-resolver.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/crdt-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/dashboard-exporter.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/demo.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/examples.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/hooks.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/interfaces.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/memory-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/middleware.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/rollback-engine.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/rollback.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/security-bypass-test.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/security.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/simple-hooks.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/system-tracker.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/telemetry.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/test-verification.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/tests/e2e/verification-pipeline.test.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/tests/integration/cross-agent-communication.test.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/tests/mocks/false-reporting-scenarios.test.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/tests/performance/verification-overhead.test.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/tests/unit/truth-scoring.test.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/tests.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/truth-scorer.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/types.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/verification-pipeline.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/messaging/agent-status-tracker.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/messaging/human-intervention-system.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/messaging/message-filter.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/messaging/swarm-message-router.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/messaging/transparency-logger.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/portal-server.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/server.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/websocket/websocket-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/workflows/feature-lifecycle-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/workflows/fullstack-coordination-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/workflows/iterative-development-orchestrator.js.map +1 -0
- package/.claude-flow-novice/dist/src/workflows/progressive-rollout-manager.js.map +1 -0
- package/.claude-flow-novice/preferences/generation.json +147 -0
- package/.claude-flow-novice/preferences/language-configs/javascript.json +51 -0
- package/.claude-flow-novice/preferences/language-configs/python.json +50 -0
- package/.claude-flow-novice/preferences/language-configs/rust.json +237 -0
- package/.claude-flow-novice/preferences/language-configs/typescript.json +54 -0
- package/.claude-flow-novice/preferences/project-local.json +91 -0
- package/.claude-flow-novice/preferences/resource-delegation.json +120 -0
- package/.claude-flow-novice/preferences/team-shared.json +195 -0
- package/.claude-flow-novice/preferences/user-global.json +247 -0
- package/.claude-flow-novice/templates/claude-md-templates/CLAUDE-JAVASCRIPT.md +769 -0
- package/.claude-flow-novice/templates/claude-md-templates/CLAUDE-PYTHON.md +1214 -0
- package/.claude-flow-novice/templates/claude-md-templates/CLAUDE-RUST.md +475 -0
- package/.claude-flow-novice/templates/claude-md-templates/CLAUDE-TYPESCRIPT.md +851 -0
- package/.claude-flow-novice/templates/claude-md-templates/README.md +263 -0
- package/CHANGELOG.md +355 -0
- package/CLAUDE.md +81 -0
- package/README-NPM.md +0 -0
- package/config/README.md +73 -0
- package/config/build/babel.config.cjs +24 -0
- package/config/build-optimizer-premium.config.js +644 -0
- package/config/cache-memory-optimization-96gb.config.js +632 -0
- package/config/connection-pool-premium.config.js +604 -0
- package/config/consensus/quorum.config.js +400 -0
- package/config/gossip/gossip-config.js +311 -0
- package/config/hooks/README-AGENT-FEEDBACK.md +275 -0
- package/config/hooks/README.md +310 -0
- package/config/hooks/agent-feedback-hook.cjs +486 -0
- package/config/hooks/documentation-auto-update.js +680 -0
- package/config/hooks/fast-file-testing.cjs +653 -0
- package/config/hooks/hook-manager.cjs +553 -0
- package/config/hooks/hook-test-framework.js +601 -0
- package/config/hooks/install.sh +232 -0
- package/config/hooks/pipeline-config.json +98 -0
- package/config/hooks/post-edit-pipeline.js +539 -0
- package/config/hooks/pre-edit-security.js +162 -0
- package/config/hooks/smart-dependency-analyzer.cjs +702 -0
- package/config/jest/jest.config.js +76 -0
- package/config/jest/jest.setup.cjs +376 -0
- package/config/linting/.eslintrc.json +38 -0
- package/config/linting/.prettierrc.json +10 -0
- package/config/performance/sqlite-enhanced-config.json +108 -0
- package/config/performance-monitoring-premium.config.js +785 -0
- package/config/playwright.config.ts +78 -0
- package/config/premium-config-index.js +295 -0
- package/config/premium-sqlite-96gb.config.js +363 -0
- package/config/raft/cluster-config.json +113 -0
- package/config/test-automation/swarm-test-pipeline.config.ts +242 -0
- package/config/typescript/tsconfig.cjs.json +9 -0
- package/config/typescript/tsconfig.cli.json +29 -0
- package/config/typescript/tsconfig.json +58 -0
- package/config/verification/crdt-config.json +238 -0
- package/config/workflows/iterative-development.json +400 -0
- package/examples/01-configurations/README.md +74 -0
- package/examples/01-configurations/advanced/production-config.json +76 -0
- package/examples/01-configurations/basic/simple-config.json +19 -0
- package/examples/01-configurations/development-config.json +39 -0
- package/examples/01-configurations/minimal/minimal-config.json +7 -0
- package/examples/01-configurations/specialized/research-config.json +58 -0
- package/examples/01-configurations/specialized/testing-config.json +55 -0
- package/examples/02-workflows/README.md +109 -0
- package/examples/02-workflows/claude-workflow.json +70 -0
- package/examples/02-workflows/complex/microservices-workflow.json +166 -0
- package/examples/02-workflows/parallel/data-processing-workflow.json +81 -0
- package/examples/02-workflows/research-workflow.json +155 -0
- package/examples/02-workflows/sequential/blog-platform-workflow.json +120 -0
- package/examples/02-workflows/simple/hello-world-workflow.json +34 -0
- package/examples/02-workflows/specialized/machine-learning-workflow.json +135 -0
- package/examples/03-demos/README.md +111 -0
- package/examples/03-demos/create-swarm-sample.sh +929 -0
- package/examples/03-demos/demo-swarm-app.sh +292 -0
- package/examples/03-demos/interactive/chat-bot-demo.sh +66 -0
- package/examples/03-demos/quick/quick-api-demo.sh +45 -0
- package/examples/03-demos/rest-api-demo.sh +342 -0
- package/examples/03-demos/swarm/multi-agent-demo.sh +94 -0
- package/examples/03-demos/swarm-showcase.sh +407 -0
- package/examples/04-testing/README.md +123 -0
- package/examples/04-testing/incremental-updates-guide.md +243 -0
- package/examples/04-testing/integration/test-workflow-execution.sh +149 -0
- package/examples/04-testing/performance/benchmark-swarm.sh +168 -0
- package/examples/04-testing/sparc-swarm-test.sh +235 -0
- package/examples/04-testing/test-incremental-demo.js +262 -0
- package/examples/04-testing/test-incremental-updates.js +243 -0
- package/examples/04-testing/test-swarm-cli.sh +129 -0
- package/examples/04-testing/unit/test-memory-system.sh +128 -0
- package/examples/05-swarm-apps/README.md +92 -0
- package/examples/05-swarm-apps/rest-api/.env.example +18 -0
- package/examples/05-swarm-apps/rest-api/.eslintrc.json +22 -0
- package/examples/05-swarm-apps/rest-api/.prettierrc +11 -0
- package/examples/05-swarm-apps/rest-api/API.md +334 -0
- package/examples/05-swarm-apps/rest-api/README.md +227 -0
- package/examples/05-swarm-apps/rest-api/package.json +43 -0
- package/examples/05-swarm-apps/rest-api/src/controllers/productsController.js +127 -0
- package/examples/05-swarm-apps/rest-api/src/controllers/usersController.js +117 -0
- package/examples/05-swarm-apps/rest-api/src/middleware/errorHandler.js +49 -0
- package/examples/05-swarm-apps/rest-api/src/models/productModel.js +139 -0
- package/examples/05-swarm-apps/rest-api/src/models/userModel.js +81 -0
- package/examples/05-swarm-apps/rest-api/src/routes/index.js +24 -0
- package/examples/05-swarm-apps/rest-api/src/routes/products.js +29 -0
- package/examples/05-swarm-apps/rest-api/src/routes/users.js +28 -0
- package/examples/05-swarm-apps/rest-api/src/server.js +56 -0
- package/examples/05-swarm-apps/rest-api/src/utils/responseHelpers.js +44 -0
- package/examples/05-swarm-apps/rest-api/start.sh +25 -0
- package/examples/05-swarm-apps/rest-api/swarm-metadata.json +86 -0
- package/examples/05-swarm-apps/rest-api/tests/products.test.js +183 -0
- package/examples/05-swarm-apps/rest-api/tests/server.test.js +43 -0
- package/examples/05-swarm-apps/rest-api/tests/users.test.js +153 -0
- package/examples/05-swarm-apps/rest-api/verify.sh +60 -0
- package/examples/05-swarm-apps/rest-api-advanced/.env.example +67 -0
- package/examples/05-swarm-apps/rest-api-advanced/.eslintrc.js +51 -0
- package/examples/05-swarm-apps/rest-api-advanced/Dockerfile +51 -0
- package/examples/05-swarm-apps/rest-api-advanced/IMPLEMENTATION-SUMMARY.md +217 -0
- package/examples/05-swarm-apps/rest-api-advanced/README-AUTH.md +375 -0
- package/examples/05-swarm-apps/rest-api-advanced/README-PRODUCTS-ORDERS.md +309 -0
- package/examples/05-swarm-apps/rest-api-advanced/README.md +544 -0
- package/examples/05-swarm-apps/rest-api-advanced/docker-compose.yml +170 -0
- package/examples/05-swarm-apps/rest-api-advanced/docs/API.md +1309 -0
- package/examples/05-swarm-apps/rest-api-advanced/docs/postman-collection.json +1003 -0
- package/examples/05-swarm-apps/rest-api-advanced/healthcheck.js +30 -0
- package/examples/05-swarm-apps/rest-api-advanced/jest.config.js +51 -0
- package/examples/05-swarm-apps/rest-api-advanced/package.json +81 -0
- package/examples/05-swarm-apps/rest-api-advanced/scripts/quick-start.sh +149 -0
- package/examples/05-swarm-apps/rest-api-advanced/server.js +243 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/config/database.js +45 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/config/redis.js +80 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/controllers/auth.controller.js +337 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/controllers/order.controller.js +410 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/controllers/product.controller.js +523 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/controllers/user.controller.js +410 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/middleware/auth.js +162 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/middleware/errorHandler.js +77 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/middleware/notFound.js +8 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/models/User.js +223 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/models/order.model.js +596 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/models/product.model.js +562 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/models/token.model.js +132 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/routes/auth.routes.js +292 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/routes/health.routes.js +155 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/routes/order.routes.js +237 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/routes/product.routes.js +276 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/routes/user.routes.js +280 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/seeders/index.js +30 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/seeders/orders.seeder.js +259 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/seeders/products.seeder.js +396 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/services/auth.service.js +304 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/services/order.service.js +488 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/services/product.service.js +376 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/utils/ApiError.js +37 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/utils/asyncHandler.js +10 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/utils/logger.js +89 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/utils/swagger.js +645 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/validators/auth.validator.js +294 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/validators/order.validator.js +296 -0
- package/examples/05-swarm-apps/rest-api-advanced/src/validators/product.validator.js +354 -0
- package/examples/05-swarm-apps/rest-api-advanced/test-auth.js +290 -0
- package/examples/05-swarm-apps/rest-api-advanced/tests/integration/auth.test.js +560 -0
- package/examples/05-swarm-apps/rest-api-advanced/tests/integration/orders.test.js +991 -0
- package/examples/05-swarm-apps/rest-api-advanced/tests/integration/products.test.js +621 -0
- package/examples/05-swarm-apps/rest-api-advanced/tests/setup.js +47 -0
- package/examples/05-swarm-apps/rest-api-advanced/tests/unit/auth.service.test.js +403 -0
- package/examples/05-swarm-apps/swarm-created-app/README.md +93 -0
- package/examples/05-swarm-apps/swarm-created-app/task-manager.js +115 -0
- package/examples/05-swarm-apps/swarm-created-app/task-manager.test.js +36 -0
- package/examples/05-swarm-apps/swarm-sample/.notes-cli/notes.json +20 -0
- package/examples/05-swarm-apps/swarm-sample/README.md +187 -0
- package/examples/05-swarm-apps/swarm-sample/notes.js +276 -0
- package/examples/05-swarm-apps/swarm-sample/notes.test.js +161 -0
- package/examples/05-swarm-apps/swarm-sample/package-lock.json +41 -0
- package/examples/05-swarm-apps/swarm-sample/package.json +33 -0
- package/examples/06-tutorials/README.md +121 -0
- package/examples/06-tutorials/getting-started/01-first-swarm.md +121 -0
- package/examples/06-tutorials/sparc/sparc-tdd-guide.md +269 -0
- package/examples/06-tutorials/sparc-batchtool-orchestration.md +232 -0
- package/examples/06-tutorials/workflows/multi-agent-coordination.md +402 -0
- package/examples/README-batch-init.md +441 -0
- package/examples/README.md +70 -0
- package/examples/auth-service/README.md +16 -0
- package/examples/auth-service/app.js +13 -0
- package/examples/automation-examples.md +717 -0
- package/examples/basic-usage.md +88 -0
- package/examples/batch-config-advanced.json +49 -0
- package/examples/batch-config-enterprise.json +119 -0
- package/examples/batch-config-simple.json +10 -0
- package/examples/batch-init-demo.js +93 -0
- package/examples/blog-api/.env.example +2 -0
- package/examples/blog-api/README.md +26 -0
- package/examples/blog-api/analysis.json +18 -0
- package/examples/blog-api/app.js +14 -0
- package/examples/blog-api/routes/users.js +53 -0
- package/examples/blog-api/server.js +31 -0
- package/examples/blog-api/test-plan.json +11 -0
- package/examples/calc-app/README.md +26 -0
- package/examples/calc-app/analysis.json +12 -0
- package/examples/calc-app/app.js +14 -0
- package/examples/calc-app/test-plan.json +11 -0
- package/examples/calc-app-parallel/README.md +26 -0
- package/examples/calc-app-parallel/analysis.json +12 -0
- package/examples/calc-app-parallel/app.js +14 -0
- package/examples/calc-app-parallel/calculator.js +33 -0
- package/examples/calc-app-parallel/cli.js +73 -0
- package/examples/calc-app-parallel/test-plan.json +11 -0
- package/examples/calc-app-parallel/test.js +36 -0
- package/examples/cargo-build-validation-example.js +470 -0
- package/examples/chat-app/README.md +16 -0
- package/examples/chat-app/app.js +13 -0
- package/examples/chat-app-2/README.md +16 -0
- package/examples/chat-app-2/app.js +13 -0
- package/examples/chrome-mcp-demo.ts +334 -0
- package/examples/claude-api-error-handling.ts +131 -0
- package/examples/data-pipeline/__tests__/test_main.test.js +1 -0
- package/examples/data-pipeline/__tests__/test_main.test.ts +1 -0
- package/examples/data-pipeline/review-report.md +40 -0
- package/examples/data-pipeline/src/main.js +1 -0
- package/examples/data-pipeline/src/main.ts +1 -0
- package/examples/data-pipeline/tests/test-plan.md +11 -0
- package/examples/development-workflow.json +631 -0
- package/examples/flask-api-sparc/Dockerfile +12 -0
- package/examples/flask-api-sparc/__tests__/test_main.test.ts +1 -0
- package/examples/flask-api-sparc/docker-compose.yml +23 -0
- package/examples/flask-api-sparc/pytest.ini +6 -0
- package/examples/flask-api-sparc/requirements.txt +8 -0
- package/examples/flask-api-sparc/review-report.md +40 -0
- package/examples/flask-api-sparc/setup.py +21 -0
- package/examples/flask-api-sparc/src/app.py +27 -0
- package/examples/flask-api-sparc/src/config.py +27 -0
- package/examples/flask-api-sparc/src/main.ts +1 -0
- package/examples/flask-api-sparc/src/models.py +46 -0
- package/examples/flask-api-sparc/src/routes.py +67 -0
- package/examples/flask-api-sparc/src/services.py +58 -0
- package/examples/flask-api-sparc/tests/test-plan.md +11 -0
- package/examples/flask-api-sparc/tests/test_test_models.py +29 -0
- package/examples/flask-api-sparc/tests/test_test_services.py +24 -0
- package/examples/fullstack-demo.ts +367 -0
- package/examples/git-checkpoint-demo.md +145 -0
- package/examples/gossip-demo.js +258 -0
- package/examples/hello-time/README.md +26 -0
- package/examples/hello-time/app.js +14 -0
- package/examples/hello-time/index.js +3 -0
- package/examples/hello-world.js +3 -0
- package/examples/hello2/hello.js +1 -0
- package/examples/hello2/index.js +10 -0
- package/examples/hello2/lib/greeter.js +25 -0
- package/examples/hello2/test.js +27 -0
- package/examples/iterative-workflow-demo.ts +576 -0
- package/examples/litellm/.claude/checkpoints/summary-session-20250807-125728.md +112 -0
- package/examples/litellm/.claude-flow/metrics/agent-metrics.json +1 -0
- package/examples/litellm/.claude-flow/metrics/performance.json +9 -0
- package/examples/litellm/.claude-flow/metrics/task-metrics.json +10 -0
- package/examples/litellm/.env.example +81 -0
- package/examples/litellm/EPIC.md +320 -0
- package/examples/litellm/README.md +347 -0
- package/examples/litellm/config/basic-config.yaml +25 -0
- package/examples/litellm/config/config.yaml +294 -0
- package/examples/litellm/config/nginx.conf +230 -0
- package/examples/litellm/config/prometheus.yml +68 -0
- package/examples/litellm/docker/Dockerfile +68 -0
- package/examples/litellm/docker/entrypoint.sh +45 -0
- package/examples/litellm/docker/healthcheck.py +88 -0
- package/examples/litellm/docker/requirements.txt +55 -0
- package/examples/litellm/docker-compose.basic.yml +22 -0
- package/examples/litellm/docker-compose.yml +288 -0
- package/examples/litellm/scripts/deploy.sh +219 -0
- package/examples/litellm/scripts/manage-tenants.sh +278 -0
- package/examples/md-convert/README.md +26 -0
- package/examples/md-convert/analysis.json +12 -0
- package/examples/md-convert/app.js +14 -0
- package/examples/md-convert/test-plan.json +11 -0
- package/examples/ml_foundation/__init__.py +28 -0
- package/examples/ml_foundation/evaluation/evaluator.py +614 -0
- package/examples/ml_foundation/foundation_agent_enhanced.py +1002 -0
- package/examples/ml_foundation/foundation_pipeline.py +519 -0
- package/examples/ml_foundation/models/base.py +385 -0
- package/examples/ml_foundation/pipelines/data_pipeline.py +490 -0
- package/examples/ml_foundation/test_foundation_agent.py +213 -0
- package/examples/news-scraper/README.md +26 -0
- package/examples/news-scraper/app.js +14 -0
- package/examples/parallel-2/README.md +174 -0
- package/examples/parallel-2/analyze-results.ts +160 -0
- package/examples/parallel-2/analyzer-agent-test.ts +121 -0
- package/examples/parallel-2/coordinator-agent-test.ts +124 -0
- package/examples/parallel-2/coordinator.ts +108 -0
- package/examples/parallel-2/developer-agent-test.ts +147 -0
- package/examples/parallel-2/documenter-agent-test.ts +208 -0
- package/examples/parallel-2/monitor-agent-test.ts +228 -0
- package/examples/parallel-2/parallel-execution-test.ts +235 -0
- package/examples/parallel-2/parallel-test.ts +66 -0
- package/examples/parallel-2/researcher-agent-test.ts +197 -0
- package/examples/parallel-2/reviewer-agent-test.ts +184 -0
- package/examples/parallel-2/run-all-tests.ts +283 -0
- package/examples/parallel-2/specialist-agent-test.ts +268 -0
- package/examples/parallel-2/test-agents/architect-test.ts +27 -0
- package/examples/parallel-2/test-agents/code-test.ts +29 -0
- package/examples/parallel-2/test-agents/debug-test.ts +32 -0
- package/examples/parallel-2/test-agents/spec-test.ts +26 -0
- package/examples/parallel-2/test-agents/tdd-test.ts +29 -0
- package/examples/parallel-2/tester-agent-test.ts +191 -0
- package/examples/parallel-2/tsconfig.json +24 -0
- package/examples/prompt-copier-demo.ts +520 -0
- package/examples/quick-start.sh +67 -0
- package/examples/quorum-verification-demo.js +380 -0
- package/examples/refinement_agent_workdir/REFINEMENT_AGENT_SUMMARY.md +175 -0
- package/examples/refinement_agent_workdir/ablation_analysis_plan.md +100 -0
- package/examples/refinement_agent_workdir/ablation_framework.py +333 -0
- package/examples/refinement_agent_workdir/refinement_demo.py +345 -0
- package/examples/refinement_agent_workdir/requirements.txt +9 -0
- package/examples/refinement_agent_workdir/targeted_optimizer.py +551 -0
- package/examples/research-workflow.yaml +302 -0
- package/examples/rest-api-simple/.env.example +1 -0
- package/examples/rest-api-simple/README-ARCHITECTURE.md +165 -0
- package/examples/rest-api-simple/README.md +99 -0
- package/examples/rest-api-simple/api-specification.md +338 -0
- package/examples/rest-api-simple/architecture-completion-plan.md +258 -0
- package/examples/rest-api-simple/architecture.md +230 -0
- package/examples/rest-api-simple/implementation-plan.md +235 -0
- package/examples/rest-api-simple/index.js +101 -0
- package/examples/rest-api-simple/next-steps.md +62 -0
- package/examples/rest-api-simple/package-lock.json +1209 -0
- package/examples/rest-api-simple/sparc-implementation-roadmap.md +190 -0
- package/examples/rest-api-simple/test-api.js +74 -0
- package/examples/rust-framework-detection.js +624 -0
- package/examples/rust-validation-demo.js +425 -0
- package/examples/shadcn-demo.ts +539 -0
- package/examples/user-api/.env.example +2 -0
- package/examples/user-api/README.md +42 -0
- package/examples/user-api/index.js +28 -0
- package/examples/user-api/middleware/errorHandler.js +18 -0
- package/examples/user-api/middleware/validation.js +46 -0
- package/examples/user-api/models/User.js +33 -0
- package/examples/user-api/routes/userRoutes.js +56 -0
- package/examples/user-api/server.js +75 -0
- package/examples/user-api/server.test.js +34 -0
- package/examples/user-api/services/userService.js +62 -0
- package/examples/validate-gossip.js +312 -0
- package/examples/validation/rust-quality-example.js +426 -0
- package/examples/yoga-integration-example.js +178 -0
- package/package.json +293 -286
- package/scripts/build/README.md +167 -0
- package/scripts/build/build-config.js +27 -0
- package/scripts/build/build-prompt-copier.sh +30 -0
- package/scripts/build/performance-monitor.js +869 -0
- package/scripts/build/prepare-publish.js +150 -0
- package/scripts/build/typescript-fixer.js +621 -0
- package/scripts/build/unified-builder.sh +428 -0
- package/scripts/build/update-bin-version.js +32 -0
- package/scripts/dev/README.md +264 -0
- package/scripts/dev/claude-flow-wrapper.sh +35 -0
- package/scripts/dev/claude-monitor.py +419 -0
- package/scripts/dev/claude-sparc.sh +562 -0
- package/scripts/dev/claude-wrapper.sh +17 -0
- package/scripts/dev/demo-phase3-compliance.js +172 -0
- package/scripts/dev/demo-task-system.ts +224 -0
- package/scripts/dev/deployment-validator.js +315 -0
- package/scripts/dev/spawn-claude-terminal.sh +32 -0
- package/scripts/dev/start-portal.sh +506 -0
- package/scripts/dev/start-web-ui.js +15 -0
- package/scripts/dev/stop-portal.sh +311 -0
- package/scripts/dev/validate-examples.ts +288 -0
- package/scripts/dev/validate-phase2.cjs +451 -0
- package/scripts/dev/validate-phase2.js +785 -0
- package/scripts/dev/validate-phase3.cjs +208 -0
- package/scripts/dev/validate-security-remediation.js +1 -0
- package/scripts/legacy/README.md +272 -0
- package/scripts/legacy/batch-fix-ts.sh +54 -0
- package/scripts/legacy/build-migration.sh +105 -0
- package/scripts/legacy/build-monitor.js +209 -0
- package/scripts/legacy/build-with-filter.sh +84 -0
- package/scripts/legacy/build-workaround.sh +71 -0
- package/scripts/legacy/fix-ts-advanced.js +358 -0
- package/scripts/legacy/fix-ts-final.sh +50 -0
- package/scripts/legacy/fix-ts-targeted.sh +49 -0
- package/scripts/legacy/fix-typescript-errors.js +305 -0
- package/scripts/legacy/force-build.sh +63 -0
- package/scripts/legacy/optimize-performance.js +400 -0
- package/scripts/legacy/performance-monitor.js +263 -0
- package/scripts/legacy/performance-monitoring.js +532 -0
- package/scripts/legacy/performance-test-runner.js +645 -0
- package/scripts/legacy/quick-fix-ts.js +281 -0
- package/scripts/legacy/safe-build.sh +63 -0
- package/scripts/migration/README.md +434 -0
- package/scripts/migration/install-arm64.js +78 -0
- package/scripts/migration/install.js +83 -0
- package/scripts/migration/migrate-hooks.js +173 -0
- package/scripts/migration/migration-examples.ts +318 -0
- package/scripts/optimization/build-optimizer.js +438 -0
- package/scripts/optimization/config-validator.js +761 -0
- package/scripts/optimization/test-optimization.js +432 -0
- package/scripts/optimization/unified-activation.js +839 -0
- package/scripts/performance/ACTIVATION_COMMANDS.md +292 -0
- package/scripts/performance/sqlite-enhanced-activation.sh +583 -0
- package/scripts/performance/test-enhanced-backend.sh +504 -0
- package/scripts/performance-test-runner.js +698 -0
- package/scripts/security/README.md +339 -0
- package/scripts/security/install-git-hooks.sh +132 -0
- package/scripts/security/ruv-swarm-safe.js +74 -0
- package/scripts/test/README.md +236 -0
- package/scripts/test/check-links.ts +274 -0
- package/scripts/test/check-performance-regression.ts +168 -0
- package/scripts/test/coverage-report.ts +692 -0
- package/scripts/test/generate-swarm-tests.js +633 -0
- package/scripts/test/integration-test-validation.cjs +253 -0
- package/scripts/test/load-test-swarm.js +576 -0
- package/scripts/test/run-phase3-compliance-tests.js +427 -0
- package/scripts/test/test-batch-tasks.ts +29 -0
- package/scripts/test/test-byzantine-resolution.js +246 -0
- package/scripts/test/test-claude-spawn-options.sh +63 -0
- package/scripts/test/test-cli-wizard.js +331 -0
- package/scripts/test/test-comprehensive.js +401 -0
- package/scripts/test/test-coordination-features.ts +238 -0
- package/scripts/test/test-fallback-systems.js +276 -0
- package/scripts/test/test-init-command.ts +302 -0
- package/scripts/test/test-mcp.ts +251 -0
- package/scripts/test/test-runner.ts +568 -0
- package/scripts/test/test-swarm-integration.sh +92 -0
- package/scripts/test/test-swarm.ts +142 -0
- package/scripts/test/validation-summary.ts +408 -0
- package/scripts/utils/README.md +261 -0
- package/scripts/utils/clean-build-artifacts.sh +94 -0
- package/scripts/utils/cleanup-root.sh +69 -0
- package/scripts/utils/fix-cliffy-imports.js +307 -0
- package/scripts/utils/fix-duplicate-imports.js +114 -0
- package/scripts/utils/fix-error-handling.cjs +70 -0
- package/scripts/utils/fix-import-paths.js +104 -0
- package/scripts/utils/fix-imports.js +116 -0
- package/scripts/utils/fix-shebang.js +78 -0
- package/scripts/utils/fix-test-modules.js +27 -0
- package/scripts/utils/fix-timezone-issue-246.js +200 -0
- package/scripts/utils/fix-ts-comprehensive.py +182 -0
- package/scripts/utils/fix-ts-targeted-batch.js +250 -0
- package/scripts/utils/remove-benchmark-conflicts.sh +140 -0
- package/scripts/utils/simple-test-fixer.js +190 -0
- package/scripts/utils/validate-metrics-structure.cjs +144 -0
- package/scripts/verify-mcp-server.js +86 -0
- package/src/cli/simple-commands/__tests__/agent.test.js +291 -0
- package/src/cli/simple-commands/__tests__/memory.test.js +8 -0
- package/src/cli/simple-commands/__tests__/swarm.test.js +371 -0
- package/src/cli/simple-commands/__tests__/task.test.js +8 -0
- package/src/cli/simple-commands/agent.js +216 -0
- package/src/cli/simple-commands/analysis.js +570 -0
- package/src/cli/simple-commands/automation-executor.js +1603 -0
- package/src/cli/simple-commands/automation.js +627 -0
- package/src/cli/simple-commands/batch-manager.js +338 -0
- package/src/cli/simple-commands/claude-telemetry.js +311 -0
- package/src/cli/simple-commands/claude-track.js +102 -0
- package/src/cli/simple-commands/concurrent-display.js +348 -0
- package/src/cli/simple-commands/config.js +319 -0
- package/src/cli/simple-commands/coordination.js +307 -0
- package/src/cli/simple-commands/enhanced-ui-views.js +654 -0
- package/src/cli/simple-commands/enhanced-webui-complete.js +1038 -0
- package/src/cli/simple-commands/fix-hook-variables.js +363 -0
- package/src/cli/simple-commands/github/gh-coordinator.js +605 -0
- package/src/cli/simple-commands/github/github-api.js +624 -0
- package/src/cli/simple-commands/github/init.js +543 -0
- package/src/cli/simple-commands/github.js +377 -0
- package/src/cli/simple-commands/goal.js +145 -0
- package/src/cli/simple-commands/hive-mind/auto-save-middleware.js +311 -0
- package/src/cli/simple-commands/hive-mind/communication.js +740 -0
- package/src/cli/simple-commands/hive-mind/core.js +1031 -0
- package/src/cli/simple-commands/hive-mind/db-optimizer.js +872 -0
- package/src/cli/simple-commands/hive-mind/mcp-wrapper.js +1364 -0
- package/src/cli/simple-commands/hive-mind/memory.js +1292 -0
- package/src/cli/simple-commands/hive-mind/performance-optimizer.js +618 -0
- package/src/cli/simple-commands/hive-mind/performance-test.js +373 -0
- package/src/cli/simple-commands/hive-mind/queen.js +809 -0
- package/src/cli/simple-commands/hive-mind/session-manager.js +1223 -0
- package/src/cli/simple-commands/hive-mind-optimize.js +361 -0
- package/src/cli/simple-commands/hive-mind-wizard.js +281 -0
- package/src/cli/simple-commands/hive-mind.js +3112 -0
- package/src/cli/simple-commands/hive.js +140 -0
- package/src/cli/simple-commands/hook-safety.js +671 -0
- package/src/cli/simple-commands/hooks.js +1268 -0
- package/src/cli/simple-commands/init/.claude/checkpoints/1756224542.json +7 -0
- package/src/cli/simple-commands/init/.claude/checkpoints/1756224544.json +8 -0
- package/src/cli/simple-commands/init/README.md +106 -0
- package/src/cli/simple-commands/init/VALIDATION_ROLLBACK.md +488 -0
- package/src/cli/simple-commands/init/agent-copier.js +347 -0
- package/src/cli/simple-commands/init/batch-init.js +663 -0
- package/src/cli/simple-commands/init/claude-commands/claude-flow-commands.js +438 -0
- package/src/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +876 -0
- package/src/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +356 -0
- package/src/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +501 -0
- package/src/cli/simple-commands/init/claude-commands/slash-commands.js +57 -0
- package/src/cli/simple-commands/init/claude-commands/sparc-commands.js +296 -0
- package/src/cli/simple-commands/init/copy-revised-templates.js +175 -0
- package/src/cli/simple-commands/init/executable-wrapper.js +122 -0
- package/src/cli/simple-commands/init/gitignore-updater.js +137 -0
- package/src/cli/simple-commands/init/help.js +110 -0
- package/src/cli/simple-commands/init/hive-mind-init.js +749 -0
- package/src/cli/simple-commands/init/index.js +1953 -0
- package/src/cli/simple-commands/init/performance-monitor.js +344 -0
- package/src/cli/simple-commands/init/rollback/backup-manager.js +542 -0
- package/src/cli/simple-commands/init/rollback/index.js +399 -0
- package/src/cli/simple-commands/init/rollback/recovery-manager.js +778 -0
- package/src/cli/simple-commands/init/rollback/rollback-executor.js +521 -0
- package/src/cli/simple-commands/init/rollback/state-tracker.js +486 -0
- package/src/cli/simple-commands/init/sparc/roo-readme.js +61 -0
- package/src/cli/simple-commands/init/sparc/roomodes-config.js +102 -0
- package/src/cli/simple-commands/init/sparc/workflows.js +40 -0
- package/src/cli/simple-commands/init/sparc-structure.js +68 -0
- package/src/cli/simple-commands/init/template-copier.js +640 -0
- package/src/cli/simple-commands/init/templates/CLAUDE.md +1185 -0
- package/src/cli/simple-commands/init/templates/CLAUDE.md.optimized +265 -0
- package/src/cli/simple-commands/init/templates/claude-flow-universal +81 -0
- package/src/cli/simple-commands/init/templates/claude-flow.bat +18 -0
- package/src/cli/simple-commands/init/templates/claude-flow.ps1 +24 -0
- package/src/cli/simple-commands/init/templates/claude-md.js +1101 -0
- package/src/cli/simple-commands/init/templates/commands/analysis/bottleneck-detect.md +162 -0
- package/src/cli/simple-commands/init/templates/commands/automation/auto-agent.md +122 -0
- package/src/cli/simple-commands/init/templates/commands/coordination/swarm-init.md +85 -0
- package/src/cli/simple-commands/init/templates/commands/github/github-swarm.md +121 -0
- package/src/cli/simple-commands/init/templates/commands/helpers/standard-checkpoint-hooks.sh +179 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/notification.md +113 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/post-command.md +116 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/post-edit.md +117 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/post-task.md +112 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-command.md +113 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-edit.md +113 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-search.md +112 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-task.md +111 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/session-end.md +118 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/session-restore.md +118 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/session-start.md +117 -0
- package/src/cli/simple-commands/init/templates/coordination-md.js +340 -0
- package/src/cli/simple-commands/init/templates/coordination.md +16 -0
- package/src/cli/simple-commands/init/templates/enhanced-templates.js +2347 -0
- package/src/cli/simple-commands/init/templates/github-safe-enhanced.js +331 -0
- package/src/cli/simple-commands/init/templates/github-safe.js +106 -0
- package/src/cli/simple-commands/init/templates/memory-bank-md.js +259 -0
- package/src/cli/simple-commands/init/templates/memory-bank.md +16 -0
- package/src/cli/simple-commands/init/templates/readme-files.js +72 -0
- package/src/cli/simple-commands/init/templates/safe-hook-patterns.js +430 -0
- package/src/cli/simple-commands/init/templates/settings.json +109 -0
- package/src/cli/simple-commands/init/templates/settings.json.enhanced +35 -0
- package/src/cli/simple-commands/init/templates/sparc-modes.js +1401 -0
- package/src/cli/simple-commands/init/templates/verification-claude-md.js +432 -0
- package/src/cli/simple-commands/init/validation/config-validator.js +354 -0
- package/src/cli/simple-commands/init/validation/health-checker.js +599 -0
- package/src/cli/simple-commands/init/validation/index.js +388 -0
- package/src/cli/simple-commands/init/validation/mode-validator.js +387 -0
- package/src/cli/simple-commands/init/validation/post-init-validator.js +390 -0
- package/src/cli/simple-commands/init/validation/pre-init-validator.js +290 -0
- package/src/cli/simple-commands/init/validation/test-runner.js +488 -0
- package/src/cli/simple-commands/init.js +4 -0
- package/src/cli/simple-commands/mcp-health.js +163 -0
- package/src/cli/simple-commands/mcp-integration-layer.js +689 -0
- package/src/cli/simple-commands/mcp.js +420 -0
- package/src/cli/simple-commands/memory-consolidation.js +631 -0
- package/src/cli/simple-commands/memory.js +345 -0
- package/src/cli/simple-commands/migrate-hooks.js +63 -0
- package/src/cli/simple-commands/monitor.js +417 -0
- package/src/cli/simple-commands/neural.js +148 -0
- package/src/cli/simple-commands/pair-autofix-only.js +755 -0
- package/src/cli/simple-commands/pair-basic.js +751 -0
- package/src/cli/simple-commands/pair-old.js +623 -0
- package/src/cli/simple-commands/pair-working.js +849 -0
- package/src/cli/simple-commands/pair.js +849 -0
- package/src/cli/simple-commands/performance-hooks.js +149 -0
- package/src/cli/simple-commands/performance-metrics.js +601 -0
- package/src/cli/simple-commands/process-ui-enhanced.js +821 -0
- package/src/cli/simple-commands/process-ui.js +274 -0
- package/src/cli/simple-commands/realtime-update-system.js +659 -0
- package/src/cli/simple-commands/sparc/architecture.js +1750 -0
- package/src/cli/simple-commands/sparc/commands.js +575 -0
- package/src/cli/simple-commands/sparc/completion.js +1831 -0
- package/src/cli/simple-commands/sparc/coordinator.js +1045 -0
- package/src/cli/simple-commands/sparc/index.js +321 -0
- package/src/cli/simple-commands/sparc/phase-base.js +430 -0
- package/src/cli/simple-commands/sparc/pseudocode.js +984 -0
- package/src/cli/simple-commands/sparc/refinement.js +1856 -0
- package/src/cli/simple-commands/sparc/specification.js +736 -0
- package/src/cli/simple-commands/sparc-modes/architect.js +125 -0
- package/src/cli/simple-commands/sparc-modes/ask.js +126 -0
- package/src/cli/simple-commands/sparc-modes/code.js +148 -0
- package/src/cli/simple-commands/sparc-modes/debug.js +112 -0
- package/src/cli/simple-commands/sparc-modes/devops.js +137 -0
- package/src/cli/simple-commands/sparc-modes/docs-writer.js +38 -0
- package/src/cli/simple-commands/sparc-modes/generic.js +34 -0
- package/src/cli/simple-commands/sparc-modes/index.js +201 -0
- package/src/cli/simple-commands/sparc-modes/integration.js +55 -0
- package/src/cli/simple-commands/sparc-modes/mcp.js +38 -0
- package/src/cli/simple-commands/sparc-modes/monitoring.js +38 -0
- package/src/cli/simple-commands/sparc-modes/optimization.js +38 -0
- package/src/cli/simple-commands/sparc-modes/security-review.js +130 -0
- package/src/cli/simple-commands/sparc-modes/sparc-orchestrator.js +167 -0
- package/src/cli/simple-commands/sparc-modes/spec-pseudocode.js +38 -0
- package/src/cli/simple-commands/sparc-modes/supabase-admin.js +149 -0
- package/src/cli/simple-commands/sparc-modes/swarm.js +436 -0
- package/src/cli/simple-commands/sparc-modes/tdd.js +112 -0
- package/src/cli/simple-commands/sparc-modes/tutorial.js +277 -0
- package/src/cli/simple-commands/sparc.js +530 -0
- package/src/cli/simple-commands/start-ui.js +147 -0
- package/src/cli/simple-commands/start-wrapper.js +285 -0
- package/src/cli/simple-commands/start.js +2 -0
- package/src/cli/simple-commands/status.js +303 -0
- package/src/cli/simple-commands/stream-chain-clean.js +221 -0
- package/src/cli/simple-commands/stream-chain-fixed.js +89 -0
- package/src/cli/simple-commands/stream-chain-real.js +408 -0
- package/src/cli/simple-commands/stream-chain-working.js +323 -0
- package/src/cli/simple-commands/stream-chain.js +491 -0
- package/src/cli/simple-commands/stream-processor.js +340 -0
- package/src/cli/simple-commands/swarm-executor.js +253 -0
- package/src/cli/simple-commands/swarm-metrics-integration.js +371 -0
- package/src/cli/simple-commands/swarm-ui.js +741 -0
- package/src/cli/simple-commands/swarm-webui-integration.js +311 -0
- package/src/cli/simple-commands/swarm.js +2277 -0
- package/src/cli/simple-commands/task.js +228 -0
- package/src/cli/simple-commands/templates/mle-star-workflow.json +294 -0
- package/src/cli/simple-commands/timestamp-fix.js +104 -0
- package/src/cli/simple-commands/token-tracker.js +372 -0
- package/src/cli/simple-commands/tool-execution-framework.js +555 -0
- package/src/cli/simple-commands/train-and-stream.js +354 -0
- package/src/cli/simple-commands/training-pipeline.js +874 -0
- package/src/cli/simple-commands/training.js +288 -0
- package/src/cli/simple-commands/verification-hooks.js +336 -0
- package/src/cli/simple-commands/verification-integration.js +464 -0
- package/src/cli/simple-commands/verification-training-integration.js +646 -0
- package/src/cli/simple-commands/verification.js +551 -0
- package/src/cli/simple-commands/web-server.js +929 -0
- package/src/cli/simple-commands/webui-validator.js +136 -0
- package/src/swarm-fullstack/adapters/chrome-mcp-adapter.ts +506 -0
- package/src/swarm-fullstack/adapters/shadcn-mcp-adapter.ts +717 -0
- package/src/swarm-fullstack/cli/fullstack-cli.ts +705 -0
- package/src/swarm-fullstack/config/fullstack-config.ts +456 -0
- package/src/swarm-fullstack/core/dynamic-agent-spawner.ts +867 -0
- package/src/swarm-fullstack/core/enhanced-swarm-message-router.ts +663 -0
- package/src/swarm-fullstack/core/fullstack-orchestrator.ts +721 -0
- package/src/swarm-fullstack/tsconfig.json +13 -0
- package/src/swarm-fullstack/types/index.ts +206 -0
- package/.claude/agents/flow-nexus/app-store.md +0 -88
- package/.claude/agents/flow-nexus/authentication.md +0 -69
- package/.claude/agents/flow-nexus/challenges.md +0 -81
- package/.claude/agents/flow-nexus/neural-network.md +0 -88
- package/.claude/agents/flow-nexus/payments.md +0 -83
- package/.claude/agents/flow-nexus/sandbox.md +0 -76
- package/.claude/agents/flow-nexus/swarm.md +0 -76
- package/.claude/agents/flow-nexus/user-tools.md +0 -96
- package/.claude/agents/flow-nexus/workflow.md +0 -84
- package/dist/src/adapters/cliffy-node.js.map +0 -1
- package/dist/src/agents/agent-loader.js.map +0 -1
- package/dist/src/agents/agent-manager.js.map +0 -1
- package/dist/src/agents/agent-registry.js.map +0 -1
- package/dist/src/agents/agent-validator.js.map +0 -1
- package/dist/src/agents/custom-test-agent.js.map +0 -1
- package/dist/src/agents/github/agent-factory.js.map +0 -1
- package/dist/src/agents/github/compatibility/legacy-agent-mappings.js.map +0 -1
- package/dist/src/agents/github/compatibility/legacy-agent-proxy.js.map +0 -1
- package/dist/src/agents/github/core/github-collaboration-manager.js.map +0 -1
- package/dist/src/agents/github/core/github-integration-manager.js.map +0 -1
- package/dist/src/agents/github/core/github-release-coordinator.js.map +0 -1
- package/dist/src/agents/github/index.js.map +0 -1
- package/dist/src/agents/github/types/index.js.map +0 -1
- package/dist/src/agents/github/utils/error-handling.js.map +0 -1
- package/dist/src/agents/github/utils/github-client.js.map +0 -1
- package/dist/src/agents/github/utils/hook-integration.js.map +0 -1
- package/dist/src/agents/github/utils/performance-optimizer.js.map +0 -1
- package/dist/src/agents/hierarchical-coordinator.js.map +0 -1
- package/dist/src/agents/lifecycle-manager.js.map +0 -1
- package/dist/src/agents/mesh-coordinator.js.map +0 -1
- package/dist/src/agents/simple-agent.js.map +0 -1
- package/dist/src/agents/task-agent-integration.js.map +0 -1
- package/dist/src/api/auth-service.js.map +0 -1
- package/dist/src/api/claude-api-errors.js.map +0 -1
- package/dist/src/api/claude-client-enhanced.js.map +0 -1
- package/dist/src/api/claude-client.js.map +0 -1
- package/dist/src/api/database-service.js.map +0 -1
- package/dist/src/api/swarm-api.js.map +0 -1
- package/dist/src/automation/test-pipeline/E2ETestGenerator.js.map +0 -1
- package/dist/src/automation/test-pipeline/PerformanceMonitor.js.map +0 -1
- package/dist/src/automation/test-pipeline/PipelineValidator.js.map +0 -1
- package/dist/src/automation/test-pipeline/RegressionTestManager.js.map +0 -1
- package/dist/src/automation/test-pipeline/SwarmTestCoordinator.js.map +0 -1
- package/dist/src/automation/test-pipeline/TestDataManager.js.map +0 -1
- package/dist/src/automation/test-pipeline/TestReportingSystem.js.map +0 -1
- package/dist/src/automation/test-pipeline/utils/chrome-mcp-integration.js.map +0 -1
- package/dist/src/automation/test-pipeline/utils/swarm-coordinator.js.map +0 -1
- package/dist/src/ci-cd/deployment-orchestrator.js.map +0 -1
- package/dist/src/ci-cd/github-actions-templates.js.map +0 -1
- package/dist/src/ci-cd/performance/PerformanceGate.js.map +0 -1
- package/dist/src/cli/agents/analyst.js.map +0 -1
- package/dist/src/cli/agents/architect.js.map +0 -1
- package/dist/src/cli/agents/base-agent.js.map +0 -1
- package/dist/src/cli/agents/capabilities.js.map +0 -1
- package/dist/src/cli/agents/coder.js.map +0 -1
- package/dist/src/cli/agents/coordinator.js.map +0 -1
- package/dist/src/cli/agents/hive-agents.js.map +0 -1
- package/dist/src/cli/agents/index.js.map +0 -1
- package/dist/src/cli/agents/researcher.js.map +0 -1
- package/dist/src/cli/agents/tester.js.map +0 -1
- package/dist/src/cli/cli-core.js.map +0 -1
- package/dist/src/cli/commands/advanced-memory-commands.js.map +0 -1
- package/dist/src/cli/commands/agent-simple.js.map +0 -1
- package/dist/src/cli/commands/agent.js.map +0 -1
- package/dist/src/cli/commands/claude-api.js.map +0 -1
- package/dist/src/cli/commands/claude.js.map +0 -1
- package/dist/src/cli/commands/config-integration.js.map +0 -1
- package/dist/src/cli/commands/config.js.map +0 -1
- package/dist/src/cli/commands/enterprise.js.map +0 -1
- package/dist/src/cli/commands/goal-init.js.map +0 -1
- package/dist/src/cli/commands/help-new.js.map +0 -1
- package/dist/src/cli/commands/help.js.map +0 -1
- package/dist/src/cli/commands/hive-mind/index.js.map +0 -1
- package/dist/src/cli/commands/hive-mind/init.js.map +0 -1
- package/dist/src/cli/commands/hive-mind/optimize-memory.js.map +0 -1
- package/dist/src/cli/commands/hive-mind/pause.js.map +0 -1
- package/dist/src/cli/commands/hive-mind/ps.js.map +0 -1
- package/dist/src/cli/commands/hive-mind/resume.js.map +0 -1
- package/dist/src/cli/commands/hive-mind/spawn.js.map +0 -1
- package/dist/src/cli/commands/hive-mind/status.js.map +0 -1
- package/dist/src/cli/commands/hive-mind/stop.js.map +0 -1
- package/dist/src/cli/commands/hive-mind/task.js.map +0 -1
- package/dist/src/cli/commands/hive-mind/wizard.js.map +0 -1
- package/dist/src/cli/commands/hive.js.map +0 -1
- package/dist/src/cli/commands/hook-types.js.map +0 -1
- package/dist/src/cli/commands/hook-validator.js.map +0 -1
- package/dist/src/cli/commands/hook.js.map +0 -1
- package/dist/src/cli/commands/index.js.map +0 -1
- package/dist/src/cli/commands/maestro.js.map +0 -1
- package/dist/src/cli/commands/mcp.js.map +0 -1
- package/dist/src/cli/commands/memory.js.map +0 -1
- package/dist/src/cli/commands/migrate.js.map +0 -1
- package/dist/src/cli/commands/monitor.js.map +0 -1
- package/dist/src/cli/commands/neural-init.js.map +0 -1
- package/dist/src/cli/commands/ruv-swarm.js.map +0 -1
- package/dist/src/cli/commands/session.js.map +0 -1
- package/dist/src/cli/commands/sparc.js.map +0 -1
- package/dist/src/cli/commands/start/event-emitter.js.map +0 -1
- package/dist/src/cli/commands/start/index.js.map +0 -1
- package/dist/src/cli/commands/start/process-manager.js.map +0 -1
- package/dist/src/cli/commands/start/process-ui-simple.js.map +0 -1
- package/dist/src/cli/commands/start/process-ui.js.map +0 -1
- package/dist/src/cli/commands/start/start-command.js.map +0 -1
- package/dist/src/cli/commands/start/system-monitor.js.map +0 -1
- package/dist/src/cli/commands/start/types.js.map +0 -1
- package/dist/src/cli/commands/start.js.map +0 -1
- package/dist/src/cli/commands/status.js.map +0 -1
- package/dist/src/cli/commands/swarm-spawn.js.map +0 -1
- package/dist/src/cli/commands/swarm.js.map +0 -1
- package/dist/src/cli/commands/task.js.map +0 -1
- package/dist/src/cli/commands/validate-integration.js.map +0 -1
- package/dist/src/cli/commands/verification.js.map +0 -1
- package/dist/src/cli/commands/workflow.js.map +0 -1
- package/dist/src/cli/completion.js.map +0 -1
- package/dist/src/cli/consolidated/ConsolidatedCLI.js.map +0 -1
- package/dist/src/cli/consolidated/core/CommandHandlers.js.map +0 -1
- package/dist/src/cli/consolidated/core/TierManager.js.map +0 -1
- package/dist/src/cli/consolidated/help/InteractiveHelp.js.map +0 -1
- package/dist/src/cli/consolidated/index.js.map +0 -1
- package/dist/src/cli/consolidated/intelligence/IntelligenceEngine.js.map +0 -1
- package/dist/src/cli/consolidated/routing/CommandRouter.js.map +0 -1
- package/dist/src/cli/consolidated/utils/IntelligentDefaults.js.map +0 -1
- package/dist/src/cli/consolidated/utils/PerformanceOptimizer.js.map +0 -1
- package/dist/src/cli/formatter.js.map +0 -1
- package/dist/src/cli/help-formatter.js.map +0 -1
- package/dist/src/cli/index-remote.js.map +0 -1
- package/dist/src/cli/index.js.map +0 -1
- package/dist/src/cli/init/batch-tools.js.map +0 -1
- package/dist/src/cli/init/claude-config.js.map +0 -1
- package/dist/src/cli/init/directory-structure.js.map +0 -1
- package/dist/src/cli/init/index.js.map +0 -1
- package/dist/src/cli/init/sparc-environment.js.map +0 -1
- package/dist/src/cli/init/swarm-commands.js.map +0 -1
- package/dist/src/cli/init/utils.js.map +0 -1
- package/dist/src/cli/maestro-cli-bridge.js.map +0 -1
- package/dist/src/cli/main.js.map +0 -1
- package/dist/src/cli/node-repl.js.map +0 -1
- package/dist/src/cli/repl.js.map +0 -1
- package/dist/src/cli/simple-cli.js.map +0 -1
- package/dist/src/cli/simple-mcp.js.map +0 -1
- package/dist/src/cli/simple-orchestrator.js.map +0 -1
- package/dist/src/cli/ui/compatible-ui.js.map +0 -1
- package/dist/src/cli/ui/fallback-handler.js.map +0 -1
- package/dist/src/cli/ui/index.js.map +0 -1
- package/dist/src/cli/utils/environment-detector.js.map +0 -1
- package/dist/src/cli/utils/prompt-defaults.js.map +0 -1
- package/dist/src/cli/validation-helper.js.map +0 -1
- package/dist/src/communication/message-bus.js.map +0 -1
- package/dist/src/communication/reliable-communication-manager.js.map +0 -1
- package/dist/src/config/ai/decision-tree-generator.js.map +0 -1
- package/dist/src/config/ai/project-detection-engine.js.map +0 -1
- package/dist/src/config/config-manager.js.map +0 -1
- package/dist/src/config/consent-manager.js.map +0 -1
- package/dist/src/config/core/intelligent-configuration-manager.js.map +0 -1
- package/dist/src/config/index.js.map +0 -1
- package/dist/src/config/integration/hooks-integration.js.map +0 -1
- package/dist/src/config/migration/config-migration.js.map +0 -1
- package/dist/src/config/migration/version-migration-engine.js.map +0 -1
- package/dist/src/config/migration-manager.js.map +0 -1
- package/dist/src/config/ruv-swarm-config.js.map +0 -1
- package/dist/src/config/ruv-swarm-integration.js.map +0 -1
- package/dist/src/config/storage/multi-tier-storage.js.map +0 -1
- package/dist/src/config/test-migration-fixer.js.map +0 -1
- package/dist/src/config/ui/progressive-disclosure-engine.js.map +0 -1
- package/dist/src/config/utils/config-export-import.js.map +0 -1
- package/dist/src/config/utils/zero-config-setup.js.map +0 -1
- package/dist/src/config/validation/config-validator.js.map +0 -1
- package/dist/src/config/web-portal-config.js.map +0 -1
- package/dist/src/config/zero-config-setup.js.map +0 -1
- package/dist/src/constants/agent-types.js.map +0 -1
- package/dist/src/coordination/advanced-scheduler.js.map +0 -1
- package/dist/src/coordination/advanced-task-executor.js.map +0 -1
- package/dist/src/coordination/background-executor.js.map +0 -1
- package/dist/src/coordination/circuit-breaker.js.map +0 -1
- package/dist/src/coordination/conflict-resolution.js.map +0 -1
- package/dist/src/coordination/dependency-graph.js.map +0 -1
- package/dist/src/coordination/hive-orchestrator.js.map +0 -1
- package/dist/src/coordination/hive-protocol.js.map +0 -1
- package/dist/src/coordination/index.js.map +0 -1
- package/dist/src/coordination/load-balancer.js.map +0 -1
- package/dist/src/coordination/manager.js.map +0 -1
- package/dist/src/coordination/messaging.js.map +0 -1
- package/dist/src/coordination/metrics.js.map +0 -1
- package/dist/src/coordination/resources.js.map +0 -1
- package/dist/src/coordination/scheduler.js.map +0 -1
- package/dist/src/coordination/swarm-coordinator.js.map +0 -1
- package/dist/src/coordination/swarm-monitor.js.map +0 -1
- package/dist/src/coordination/work-stealing.js.map +0 -1
- package/dist/src/core/agent-manager.js.map +0 -1
- package/dist/src/core/config.js.map +0 -1
- package/dist/src/core/event-bus.js.map +0 -1
- package/dist/src/core/index.js.map +0 -1
- package/dist/src/core/json-persistence.js.map +0 -1
- package/dist/src/core/logger.js.map +0 -1
- package/dist/src/core/orchestrator-fixed.js.map +0 -1
- package/dist/src/core/orchestrator.js.map +0 -1
- package/dist/src/core/persistence.js.map +0 -1
- package/dist/src/core/project-manager.js.map +0 -1
- package/dist/src/core/version.js.map +0 -1
- package/dist/src/crdt/types.js.map +0 -1
- package/dist/src/enterprise/analytics-manager.js.map +0 -1
- package/dist/src/enterprise/audit-manager.js.map +0 -1
- package/dist/src/enterprise/cloud-manager.js.map +0 -1
- package/dist/src/enterprise/deployment-manager.js.map +0 -1
- package/dist/src/enterprise/index.js.map +0 -1
- package/dist/src/enterprise/project-manager.js.map +0 -1
- package/dist/src/enterprise/security-manager.js.map +0 -1
- package/dist/src/feature-flags/cli/Phase4CLI.js.map +0 -1
- package/dist/src/feature-flags/core/FeatureFlagManager.js.map +0 -1
- package/dist/src/feature-flags/index.js.map +0 -1
- package/dist/src/feature-flags/monitoring/RolloutMonitor.js.map +0 -1
- package/dist/src/feature-flags/rollout/RolloutController.js.map +0 -1
- package/dist/src/feature-flags/validation/HookInterceptor.js.map +0 -1
- package/dist/src/feature-flags/validation/TruthBasedValidator.js.map +0 -1
- package/dist/src/hive-mind/core/Agent.js.map +0 -1
- package/dist/src/hive-mind/core/Communication.js.map +0 -1
- package/dist/src/hive-mind/core/DatabaseManager.js.map +0 -1
- package/dist/src/hive-mind/core/HiveMind.js.map +0 -1
- package/dist/src/hive-mind/core/Memory.js.map +0 -1
- package/dist/src/hive-mind/core/MemoryMonitor.js.map +0 -1
- package/dist/src/hive-mind/core/Queen.js.map +0 -1
- package/dist/src/hive-mind/index.js.map +0 -1
- package/dist/src/hive-mind/integration/ConsensusEngine.js.map +0 -1
- package/dist/src/hive-mind/integration/MCPToolWrapper.js.map +0 -1
- package/dist/src/hive-mind/integration/SwarmOrchestrator.js.map +0 -1
- package/dist/src/hive-mind/types.js.map +0 -1
- package/dist/src/hooks/index.js.map +0 -1
- package/dist/src/index.js.map +0 -1
- package/dist/src/integration/mock-components.js.map +0 -1
- package/dist/src/integration/system-integration.js.map +0 -1
- package/dist/src/integration/types.js.map +0 -1
- package/dist/src/lifecycle/communication-protocols.js.map +0 -1
- package/dist/src/lifecycle/dependency-tracker.js.map +0 -1
- package/dist/src/lifecycle/memory-schema.js.map +0 -1
- package/dist/src/maestro/maestro-swarm-coordinator.js.map +0 -1
- package/dist/src/maestro/maestro-types.js.map +0 -1
- package/dist/src/maestro/tests/native-hive-mind-integration.test.js.map +0 -1
- package/dist/src/mcp/auth.js.map +0 -1
- package/dist/src/mcp/claude-code-wrapper.js.map +0 -1
- package/dist/src/mcp/claude-flow-tools.js.map +0 -1
- package/dist/src/mcp/client.js.map +0 -1
- package/dist/src/mcp/index.js.map +0 -1
- package/dist/src/mcp/integrate-wrapper.js.map +0 -1
- package/dist/src/mcp/lifecycle-manager.js.map +0 -1
- package/dist/src/mcp/load-balancer.js.map +0 -1
- package/dist/src/mcp/orchestration-integration.js.map +0 -1
- package/dist/src/mcp/performance-monitor.js.map +0 -1
- package/dist/src/mcp/protocol-manager.js.map +0 -1
- package/dist/src/mcp/recovery/connection-health-monitor.js.map +0 -1
- package/dist/src/mcp/recovery/connection-state-manager.js.map +0 -1
- package/dist/src/mcp/recovery/fallback-coordinator.js.map +0 -1
- package/dist/src/mcp/recovery/index.js.map +0 -1
- package/dist/src/mcp/recovery/reconnection-manager.js.map +0 -1
- package/dist/src/mcp/recovery/recovery-manager.js.map +0 -1
- package/dist/src/mcp/router.js.map +0 -1
- package/dist/src/mcp/ruv-swarm-tools.js.map +0 -1
- package/dist/src/mcp/server-with-wrapper.js.map +0 -1
- package/dist/src/mcp/server-wrapper-mode.js.map +0 -1
- package/dist/src/mcp/server.js.map +0 -1
- package/dist/src/mcp/session-manager.js.map +0 -1
- package/dist/src/mcp/sparc-modes.js.map +0 -1
- package/dist/src/mcp/swarm-tools.js.map +0 -1
- package/dist/src/mcp/tests/mcp-integration.test.js.map +0 -1
- package/dist/src/mcp/tools.js.map +0 -1
- package/dist/src/mcp/transports/base.js.map +0 -1
- package/dist/src/mcp/transports/http.js.map +0 -1
- package/dist/src/mcp/transports/stdio.js.map +0 -1
- package/dist/src/memory/advanced-memory-manager.js.map +0 -1
- package/dist/src/memory/backends/base.js.map +0 -1
- package/dist/src/memory/backends/markdown.js.map +0 -1
- package/dist/src/memory/backends/sqlite.js.map +0 -1
- package/dist/src/memory/cache.js.map +0 -1
- package/dist/src/memory/distributed-memory.js.map +0 -1
- package/dist/src/memory/indexer.js.map +0 -1
- package/dist/src/memory/manager.js.map +0 -1
- package/dist/src/memory/sqlite-enhanced-backend.js.map +0 -1
- package/dist/src/memory/swarm-memory.js.map +0 -1
- package/dist/src/migration/index.js.map +0 -1
- package/dist/src/migration/logger.js.map +0 -1
- package/dist/src/migration/migration-analyzer.js.map +0 -1
- package/dist/src/migration/migration-runner.js.map +0 -1
- package/dist/src/migration/migration-validator.js.map +0 -1
- package/dist/src/migration/progress-reporter.js.map +0 -1
- package/dist/src/migration/rollback-manager.js.map +0 -1
- package/dist/src/migration/tests/migration-system.test.js.map +0 -1
- package/dist/src/migration/types.js.map +0 -1
- package/dist/src/monitoring/diagnostics.js.map +0 -1
- package/dist/src/monitoring/health-check.js.map +0 -1
- package/dist/src/monitoring/phase4/analytics/consensus-tracker.js.map +0 -1
- package/dist/src/monitoring/phase4/analytics/performance-assessor.js.map +0 -1
- package/dist/src/monitoring/phase4/analytics/truth-score-analyzer.js.map +0 -1
- package/dist/src/monitoring/phase4/dashboard/monitoring-dashboard.js.map +0 -1
- package/dist/src/monitoring/phase4/rollout-decision-engine.js.map +0 -1
- package/dist/src/monitoring/real-time-feedback-system.js.map +0 -1
- package/dist/src/monitoring/real-time-monitor.js.map +0 -1
- package/dist/src/monitoring/regression/RegressionDetector.js.map +0 -1
- package/dist/src/neural/NeuralDomainMapper.js.map +0 -1
- package/dist/src/neural/index.js.map +0 -1
- package/dist/src/neural/integration.js.map +0 -1
- package/dist/src/providers/anthropic-provider.js.map +0 -1
- package/dist/src/providers/base-provider.js.map +0 -1
- package/dist/src/providers/cohere-provider.js.map +0 -1
- package/dist/src/providers/google-provider.js.map +0 -1
- package/dist/src/providers/index.js.map +0 -1
- package/dist/src/providers/ollama-provider.js.map +0 -1
- package/dist/src/providers/openai-provider.js.map +0 -1
- package/dist/src/providers/provider-manager.js.map +0 -1
- package/dist/src/providers/types.js.map +0 -1
- package/dist/src/providers/utils.js.map +0 -1
- package/dist/src/quality-gates/automated-review-system.js.map +0 -1
- package/dist/src/resources/resource-manager.js.map +0 -1
- package/dist/src/rollback/recovery-manager.js.map +0 -1
- package/dist/src/services/agent-manager.js.map +0 -1
- package/dist/src/services/agentic-flow-hooks/hook-manager.js.map +0 -1
- package/dist/src/services/agentic-flow-hooks/index.js.map +0 -1
- package/dist/src/services/agentic-flow-hooks/llm-hooks.js.map +0 -1
- package/dist/src/services/agentic-flow-hooks/memory-hooks.js.map +0 -1
- package/dist/src/services/agentic-flow-hooks/neural-hooks.js.map +0 -1
- package/dist/src/services/agentic-flow-hooks/performance-hooks.js.map +0 -1
- package/dist/src/services/agentic-flow-hooks/types.js.map +0 -1
- package/dist/src/services/agentic-flow-hooks/workflow-hooks.js.map +0 -1
- package/dist/src/services/performance-metrics-collector.js.map +0 -1
- package/dist/src/services/swarm-coordinator.js.map +0 -1
- package/dist/src/services/swarm-memory-manager.js.map +0 -1
- package/dist/src/services/swarm-relaunch-manager.js.map +0 -1
- package/dist/src/services/task-handoff-service.js.map +0 -1
- package/dist/src/swarm/__tests__/integration.test.js.map +0 -1
- package/dist/src/swarm/__tests__/prompt-copier.test.js.map +0 -1
- package/dist/src/swarm/advanced-orchestrator.js.map +0 -1
- package/dist/src/swarm/claude-code-interface.js.map +0 -1
- package/dist/src/swarm/claude-flow-executor.js.map +0 -1
- package/dist/src/swarm/coordinator.js.map +0 -1
- package/dist/src/swarm/direct-executor.js.map +0 -1
- package/dist/src/swarm/executor-v2.js.map +0 -1
- package/dist/src/swarm/executor.js.map +0 -1
- package/dist/src/swarm/hive-mind-integration.js.map +0 -1
- package/dist/src/swarm/index.js.map +0 -1
- package/dist/src/swarm/json-output-aggregator.js.map +0 -1
- package/dist/src/swarm/mcp-integration-wrapper.js.map +0 -1
- package/dist/src/swarm/memory.js.map +0 -1
- package/dist/src/swarm/optimizations/__tests__/optimization.test.js.map +0 -1
- package/dist/src/swarm/optimizations/async-file-manager.js.map +0 -1
- package/dist/src/swarm/optimizations/circular-buffer.js.map +0 -1
- package/dist/src/swarm/optimizations/connection-pool.js.map +0 -1
- package/dist/src/swarm/optimizations/index.js.map +0 -1
- package/dist/src/swarm/optimizations/optimized-executor.js.map +0 -1
- package/dist/src/swarm/optimizations/ttl-map.js.map +0 -1
- package/dist/src/swarm/prompt-cli.js.map +0 -1
- package/dist/src/swarm/prompt-copier-enhanced.js.map +0 -1
- package/dist/src/swarm/prompt-copier.js.map +0 -1
- package/dist/src/swarm/prompt-manager.js.map +0 -1
- package/dist/src/swarm/prompt-utils.js.map +0 -1
- package/dist/src/swarm/result-aggregator.js.map +0 -1
- package/dist/src/swarm/sparc-executor.js.map +0 -1
- package/dist/src/swarm/strategies/auto.js.map +0 -1
- package/dist/src/swarm/strategies/base.js.map +0 -1
- package/dist/src/swarm/strategies/research.js.map +0 -1
- package/dist/src/swarm/strategies/strategy-metrics-patch.js.map +0 -1
- package/dist/src/swarm/types.js.map +0 -1
- package/dist/src/swarm/workers/copy-worker.js.map +0 -1
- package/dist/src/swarm-fullstack/adapters/chrome-mcp-adapter.js.map +0 -1
- package/dist/src/swarm-fullstack/adapters/shadcn-mcp-adapter.js.map +0 -1
- package/dist/src/swarm-fullstack/cli/fullstack-cli.js.map +0 -1
- package/dist/src/swarm-fullstack/config/fullstack-config.js.map +0 -1
- package/dist/src/swarm-fullstack/core/dynamic-agent-spawner.js.map +0 -1
- package/dist/src/swarm-fullstack/core/enhanced-swarm-message-router.js.map +0 -1
- package/dist/src/swarm-fullstack/core/fullstack-orchestrator.js.map +0 -1
- package/dist/src/swarm-fullstack/types/index.js.map +0 -1
- package/dist/src/task/commands.js.map +0 -1
- package/dist/src/task/coordination.js.map +0 -1
- package/dist/src/task/engine.js.map +0 -1
- package/dist/src/task/index.js.map +0 -1
- package/dist/src/task/types.js.map +0 -1
- package/dist/src/terminal/adapters/base.js.map +0 -1
- package/dist/src/terminal/adapters/native.js.map +0 -1
- package/dist/src/terminal/adapters/vscode.js.map +0 -1
- package/dist/src/terminal/manager.js.map +0 -1
- package/dist/src/terminal/pool.js.map +0 -1
- package/dist/src/terminal/session.js.map +0 -1
- package/dist/src/terminal/vscode-bridge.js.map +0 -1
- package/dist/src/testing/performance/PerformanceTestRunner.js.map +0 -1
- package/dist/src/testing-integration/chrome-mcp-integration.js.map +0 -1
- package/dist/src/testing-integration/continuous-test-runner.js.map +0 -1
- package/dist/src/tests/validation-consistency.test.js.map +0 -1
- package/dist/src/topology/adaptive-coordinator.js.map +0 -1
- package/dist/src/topology/communication-bridge.js.map +0 -1
- package/dist/src/topology/enhanced-hierarchical-coordinator.js.map +0 -1
- package/dist/src/topology/enhanced-mesh-coordinator.js.map +0 -1
- package/dist/src/topology/topology-manager.js.map +0 -1
- package/dist/src/topology/types.js.map +0 -1
- package/dist/src/types/agent-lifecycle-types.js.map +0 -1
- package/dist/src/types/agent-types.js.map +0 -1
- package/dist/src/types/cliffy.d.js.map +0 -1
- package/dist/src/types/global.d.js.map +0 -1
- package/dist/src/types/index.js.map +0 -1
- package/dist/src/types/mcp.d.js.map +0 -1
- package/dist/src/types/vscode.d.js.map +0 -1
- package/dist/src/ui/hive-dashboard.js.map +0 -1
- package/dist/src/utils/error-handler.js.map +0 -1
- package/dist/src/utils/errors.js.map +0 -1
- package/dist/src/utils/formatters.js.map +0 -1
- package/dist/src/utils/helpers.js.map +0 -1
- package/dist/src/utils/paths.js.map +0 -1
- package/dist/src/utils/type-guards.js.map +0 -1
- package/dist/src/utils/types.js.map +0 -1
- package/dist/src/verification/agent-scorer.js.map +0 -1
- package/dist/src/verification/alert-manager.js.map +0 -1
- package/dist/src/verification/api/types/index.js.map +0 -1
- package/dist/src/verification/checkpoint-manager.js.map +0 -1
- package/dist/src/verification/cli-integration.js.map +0 -1
- package/dist/src/verification/conflict-resolver.js.map +0 -1
- package/dist/src/verification/crdt-coordinator.js.map +0 -1
- package/dist/src/verification/dashboard-exporter.js.map +0 -1
- package/dist/src/verification/demo.js.map +0 -1
- package/dist/src/verification/examples.js.map +0 -1
- package/dist/src/verification/hooks.js.map +0 -1
- package/dist/src/verification/index.js.map +0 -1
- package/dist/src/verification/interfaces.js.map +0 -1
- package/dist/src/verification/memory-manager.js.map +0 -1
- package/dist/src/verification/middleware.js.map +0 -1
- package/dist/src/verification/rollback-engine.js.map +0 -1
- package/dist/src/verification/rollback.js.map +0 -1
- package/dist/src/verification/security-bypass-test.js.map +0 -1
- package/dist/src/verification/security.js.map +0 -1
- package/dist/src/verification/simple-hooks.js.map +0 -1
- package/dist/src/verification/system-tracker.js.map +0 -1
- package/dist/src/verification/telemetry.js.map +0 -1
- package/dist/src/verification/test-verification.js.map +0 -1
- package/dist/src/verification/tests/e2e/verification-pipeline.test.js.map +0 -1
- package/dist/src/verification/tests/integration/cross-agent-communication.test.js.map +0 -1
- package/dist/src/verification/tests/mocks/false-reporting-scenarios.test.js.map +0 -1
- package/dist/src/verification/tests/performance/verification-overhead.test.js.map +0 -1
- package/dist/src/verification/tests/unit/truth-scoring.test.js.map +0 -1
- package/dist/src/verification/tests.js.map +0 -1
- package/dist/src/verification/truth-scorer.js.map +0 -1
- package/dist/src/verification/types.js.map +0 -1
- package/dist/src/verification/verification-pipeline.js.map +0 -1
- package/dist/src/web/messaging/agent-status-tracker.js.map +0 -1
- package/dist/src/web/messaging/human-intervention-system.js.map +0 -1
- package/dist/src/web/messaging/message-filter.js.map +0 -1
- package/dist/src/web/messaging/swarm-message-router.js.map +0 -1
- package/dist/src/web/messaging/transparency-logger.js.map +0 -1
- package/dist/src/web/portal-server.js.map +0 -1
- package/dist/src/web/server.js.map +0 -1
- package/dist/src/web/websocket/websocket-manager.js.map +0 -1
- package/dist/src/workflows/feature-lifecycle-manager.js.map +0 -1
- package/dist/src/workflows/fullstack-coordination-manager.js.map +0 -1
- package/dist/src/workflows/iterative-development-orchestrator.js.map +0 -1
- package/dist/src/workflows/progressive-rollout-manager.js.map +0 -1
- /package/{dist → .claude-flow-novice/dist}/mcp/mcp-server-novice.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/mcp/mcp-server-sdk.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/mcp/mcp-server-with-slash-commands.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/adapters/cliffy-node.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/agent-loader.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/agent-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/agent-registry.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/agent-validator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/custom-test-agent.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/github/agent-factory.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/github/compatibility/legacy-agent-mappings.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/github/compatibility/legacy-agent-proxy.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/github/core/github-collaboration-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/github/core/github-integration-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/github/core/github-release-coordinator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/github/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/github/types/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/github/utils/error-handling.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/github/utils/github-client.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/github/utils/hook-integration.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/github/utils/performance-optimizer.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/hierarchical-coordinator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/lifecycle-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/mesh-coordinator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/simple-agent.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/agents/task-agent-integration.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/api/auth-service.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/api/claude-api-errors.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/api/claude-client-enhanced.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/api/claude-client.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/api/database-service.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/api/swarm-api.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/automation/test-pipeline/E2ETestGenerator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/automation/test-pipeline/PerformanceMonitor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/automation/test-pipeline/PipelineValidator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/automation/test-pipeline/RegressionTestManager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/automation/test-pipeline/SwarmTestCoordinator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/automation/test-pipeline/TestDataManager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/automation/test-pipeline/TestReportingSystem.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/automation/test-pipeline/utils/chrome-mcp-integration.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/automation/test-pipeline/utils/swarm-coordinator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/ci-cd/deployment-orchestrator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/ci-cd/github-actions-templates.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/ci-cd/performance/PerformanceGate.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/agents/analyst.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/agents/architect.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/agents/base-agent.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/agents/capabilities.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/agents/coder.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/agents/coordinator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/agents/hive-agents.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/agents/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/agents/researcher.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/agents/tester.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/cli-core.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/advanced-memory-commands.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/agent-simple.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/agent.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/claude-api.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/claude.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/config-integration.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/config.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/enterprise.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/goal-init.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/help-new.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/help.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/hive-mind/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/hive-mind/init.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/hive-mind/optimize-memory.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/hive-mind/pause.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/hive-mind/ps.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/hive-mind/resume.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/hive-mind/spawn.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/hive-mind/status.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/hive-mind/stop.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/hive-mind/task.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/hive-mind/wizard.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/hive.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/hook-types.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/hook-validator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/hook.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/maestro.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/mcp.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/memory.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/migrate.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/monitor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/neural-init.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/ruv-swarm.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/session.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/sparc.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/start/event-emitter.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/start/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/start/process-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/start/process-ui-simple.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/start/process-ui.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/start/start-command.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/start/system-monitor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/start/types.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/start.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/status.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/swarm-spawn.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/swarm.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/task.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/validate-integration.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/verification.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/commands/workflow.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/completion.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/consolidated/ConsolidatedCLI.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/consolidated/core/CommandHandlers.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/consolidated/core/TierManager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/consolidated/help/InteractiveHelp.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/consolidated/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/consolidated/intelligence/IntelligenceEngine.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/consolidated/routing/CommandRouter.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/consolidated/utils/IntelligentDefaults.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/consolidated/utils/PerformanceOptimizer.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/formatter.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/help-formatter.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/index-remote.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/init/batch-tools.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/init/claude-config.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/init/directory-structure.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/init/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/init/sparc-environment.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/init/swarm-commands.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/init/utils.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/maestro-cli-bridge.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/main.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/node-repl.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/repl.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/simple-cli.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/simple-commands/hooks/session-start-soul.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/simple-commands/init/templates/claude-md.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/simple-mcp.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/simple-orchestrator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/ui/compatible-ui.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/ui/fallback-handler.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/ui/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/utils/environment-detector.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/utils/prompt-defaults.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/cli/validation-helper.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/communication/message-bus.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/communication/reliable-communication-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/ai/decision-tree-generator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/ai/project-detection-engine.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/config-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/consent-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/core/intelligent-configuration-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/integration/hooks-integration.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/migration/config-migration.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/migration/version-migration-engine.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/migration-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/ruv-swarm-config.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/ruv-swarm-integration.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/storage/multi-tier-storage.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/test-migration-fixer.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/ui/progressive-disclosure-engine.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/utils/config-export-import.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/utils/zero-config-setup.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/validation/config-validator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/web-portal-config.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/config/zero-config-setup.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/constants/agent-types.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/advanced-scheduler.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/advanced-task-executor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/background-executor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/circuit-breaker.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/conflict-resolution.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/dependency-graph.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/hive-orchestrator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/hive-protocol.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/load-balancer.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/messaging.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/metrics.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/resources.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/scheduler.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/swarm-coordinator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/swarm-monitor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/coordination/work-stealing.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/core/agent-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/core/config.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/core/event-bus.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/core/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/core/json-persistence.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/core/logger.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/core/orchestrator-fixed.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/core/orchestrator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/core/persistence.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/core/project-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/core/version.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/crdt/types.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/enterprise/analytics-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/enterprise/audit-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/enterprise/cloud-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/enterprise/deployment-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/enterprise/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/enterprise/project-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/enterprise/security-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/feature-flags/cli/Phase4CLI.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/feature-flags/core/FeatureFlagManager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/feature-flags/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/feature-flags/monitoring/RolloutMonitor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/feature-flags/rollout/RolloutController.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/feature-flags/validation/HookInterceptor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/feature-flags/validation/TruthBasedValidator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/hive-mind/core/Agent.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/hive-mind/core/Communication.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/hive-mind/core/DatabaseManager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/hive-mind/core/HiveMind.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/hive-mind/core/Memory.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/hive-mind/core/MemoryMonitor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/hive-mind/core/Queen.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/hive-mind/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/hive-mind/integration/ConsensusEngine.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/hive-mind/integration/MCPToolWrapper.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/hive-mind/integration/SwarmOrchestrator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/hive-mind/types.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/hooks/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/integration/mock-components.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/integration/system-integration.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/integration/types.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/lifecycle/communication-protocols.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/lifecycle/dependency-tracker.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/lifecycle/memory-schema.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/maestro/maestro-swarm-coordinator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/maestro/maestro-types.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/maestro/tests/native-hive-mind-integration.test.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/auth.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/claude-code-wrapper.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/claude-flow-tools.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/client.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/integrate-wrapper.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/lifecycle-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/load-balancer.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/orchestration-integration.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/performance-monitor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/protocol-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/recovery/connection-health-monitor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/recovery/connection-state-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/recovery/fallback-coordinator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/recovery/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/recovery/reconnection-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/recovery/recovery-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/router.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/ruv-swarm-tools.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/server-with-wrapper.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/server-wrapper-mode.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/server.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/session-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/sparc-modes.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/swarm-tools.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/tests/mcp-integration.test.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/tools.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/transports/base.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/transports/http.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/mcp/transports/stdio.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/memory/advanced-memory-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/memory/backends/base.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/memory/backends/markdown.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/memory/backends/sqlite.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/memory/cache.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/memory/distributed-memory.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/memory/indexer.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/memory/manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/memory/sqlite-enhanced-backend.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/memory/swarm-memory.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/migration/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/migration/logger.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/migration/migration-analyzer.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/migration/migration-runner.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/migration/migration-validator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/migration/progress-reporter.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/migration/rollback-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/migration/tests/migration-system.test.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/migration/types.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/monitoring/diagnostics.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/monitoring/health-check.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/monitoring/phase4/analytics/consensus-tracker.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/monitoring/phase4/analytics/performance-assessor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/monitoring/phase4/analytics/truth-score-analyzer.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/monitoring/phase4/dashboard/monitoring-dashboard.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/monitoring/phase4/rollout-decision-engine.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/monitoring/real-time-feedback-system.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/monitoring/real-time-monitor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/monitoring/regression/RegressionDetector.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/neural/NeuralDomainMapper.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/neural/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/neural/integration.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/providers/anthropic-provider.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/providers/base-provider.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/providers/cohere-provider.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/providers/google-provider.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/providers/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/providers/ollama-provider.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/providers/openai-provider.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/providers/provider-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/providers/types.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/providers/utils.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/quality-gates/automated-review-system.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/resources/resource-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/rollback/recovery-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/services/agent-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/services/agentic-flow-hooks/hook-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/services/agentic-flow-hooks/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/services/agentic-flow-hooks/llm-hooks.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/services/agentic-flow-hooks/memory-hooks.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/services/agentic-flow-hooks/neural-hooks.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/services/agentic-flow-hooks/performance-hooks.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/services/agentic-flow-hooks/types.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/services/agentic-flow-hooks/workflow-hooks.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/services/performance-metrics-collector.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/services/swarm-coordinator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/services/swarm-memory-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/services/swarm-relaunch-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/services/task-handoff-service.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/slash-commands/README.md +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/slash-commands/claude-md.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/slash-commands/claude-soul.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/slash-commands/cli-integration.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/slash-commands/github.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/slash-commands/hooks.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/slash-commands/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/slash-commands/mcp-slash-integration.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/slash-commands/neural.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/slash-commands/performance.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/slash-commands/register-all-commands.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/slash-commands/register-claude-md.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/slash-commands/register-claude-soul.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/slash-commands/sparc.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/slash-commands/swarm.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/slash-commands/validate-commands.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/slash-commands/workflow.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/__tests__/integration.test.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/__tests__/prompt-copier.test.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/advanced-orchestrator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/claude-code-interface.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/claude-flow-executor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/coordinator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/direct-executor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/executor-v2.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/executor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/hive-mind-integration.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/json-output-aggregator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/mcp-integration-wrapper.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/memory.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/optimizations/__tests__/optimization.test.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/optimizations/async-file-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/optimizations/circular-buffer.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/optimizations/connection-pool.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/optimizations/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/optimizations/optimized-executor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/optimizations/ttl-map.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/prompt-cli.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/prompt-copier-enhanced.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/prompt-copier.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/prompt-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/prompt-utils.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/result-aggregator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/sparc-executor.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/strategies/auto.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/strategies/base.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/strategies/research.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/strategies/strategy-metrics-patch.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/types.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm/workers/copy-worker.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm-fullstack/adapters/chrome-mcp-adapter.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm-fullstack/adapters/shadcn-mcp-adapter.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm-fullstack/cli/fullstack-cli.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm-fullstack/config/fullstack-config.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm-fullstack/core/dynamic-agent-spawner.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm-fullstack/core/enhanced-swarm-message-router.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm-fullstack/core/fullstack-orchestrator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/swarm-fullstack/types/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/task/commands.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/task/coordination.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/task/engine.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/task/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/task/types.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/terminal/adapters/base.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/terminal/adapters/native.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/terminal/adapters/vscode.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/terminal/manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/terminal/pool.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/terminal/session.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/terminal/vscode-bridge.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/testing/performance/PerformanceTestRunner.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/testing-integration/chrome-mcp-integration.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/testing-integration/continuous-test-runner.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/tests/validation-consistency.test.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/topology/adaptive-coordinator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/topology/communication-bridge.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/topology/enhanced-hierarchical-coordinator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/topology/enhanced-mesh-coordinator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/topology/topology-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/topology/types.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/types/agent-lifecycle-types.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/types/agent-types.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/types/cliffy.d.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/types/global.d.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/types/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/types/mcp.d.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/types/vscode.d.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/ui/hive-dashboard.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/utils/error-handler.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/utils/errors.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/utils/formatters.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/utils/helpers.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/utils/paths.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/utils/type-guards.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/utils/types.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/agent-scorer.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/alert-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/api/types/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/checkpoint-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/cli-integration.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/conflict-resolver.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/crdt-coordinator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/dashboard-exporter.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/demo.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/examples.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/hooks.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/index.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/interfaces.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/memory-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/middleware.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/rollback-engine.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/rollback.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/security-bypass-test.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/security.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/simple-hooks.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/system-tracker.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/telemetry.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/test-verification.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/tests/e2e/verification-pipeline.test.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/tests/integration/cross-agent-communication.test.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/tests/mocks/false-reporting-scenarios.test.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/tests/performance/verification-overhead.test.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/tests/unit/truth-scoring.test.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/tests.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/truth-scorer.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/types.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/verification/verification-pipeline.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/web/messaging/agent-status-tracker.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/web/messaging/human-intervention-system.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/web/messaging/message-filter.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/web/messaging/swarm-message-router.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/web/messaging/transparency-logger.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/web/portal-server.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/web/server.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/web/websocket/websocket-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/workflows/feature-lifecycle-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/workflows/fullstack-coordination-manager.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/workflows/iterative-development-orchestrator.js +0 -0
- /package/{dist → .claude-flow-novice/dist}/src/workflows/progressive-rollout-manager.js +0 -0
|
@@ -0,0 +1,3112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hive Mind command for Claude-Flow v2.0.0
|
|
3
|
+
* Advanced swarm intelligence with collective decision-making
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { spawn } from 'child_process';
|
|
7
|
+
import { existsSync, mkdirSync } from 'fs';
|
|
8
|
+
import { writeFile, readFile } from 'fs/promises';
|
|
9
|
+
import path from 'path';
|
|
10
|
+
import readline from 'readline';
|
|
11
|
+
import inquirer from 'inquirer';
|
|
12
|
+
import chalk from 'chalk';
|
|
13
|
+
import ora from 'ora';
|
|
14
|
+
import { args, cwd, exit, writeTextFile, readTextFile, mkdirAsync } from '../node-compat.js';
|
|
15
|
+
import {
|
|
16
|
+
isInteractive,
|
|
17
|
+
isRawModeSupported,
|
|
18
|
+
warnNonInteractive,
|
|
19
|
+
checkNonInteractiveAuth,
|
|
20
|
+
} from '../utils/interactive-detector.js';
|
|
21
|
+
import {
|
|
22
|
+
safeInteractive,
|
|
23
|
+
nonInteractiveProgress,
|
|
24
|
+
nonInteractiveSelect,
|
|
25
|
+
} from '../utils/safe-interactive.js';
|
|
26
|
+
|
|
27
|
+
// Import SQLite for persistence
|
|
28
|
+
import Database from 'better-sqlite3';
|
|
29
|
+
|
|
30
|
+
// Import help formatter
|
|
31
|
+
import { HelpFormatter } from '../help-formatter.js';
|
|
32
|
+
|
|
33
|
+
// Import MCP tool wrappers
|
|
34
|
+
import { MCPToolWrapper } from './hive-mind/mcp-wrapper.js';
|
|
35
|
+
import { HiveMindCore } from './hive-mind/core.js';
|
|
36
|
+
import { QueenCoordinator } from './hive-mind/queen.js';
|
|
37
|
+
import { CollectiveMemory } from './hive-mind/memory.js';
|
|
38
|
+
import { SwarmCommunication } from './hive-mind/communication.js';
|
|
39
|
+
import { HiveMindSessionManager } from './hive-mind/session-manager.js';
|
|
40
|
+
import { createAutoSaveMiddleware } from './hive-mind/auto-save-middleware.js';
|
|
41
|
+
|
|
42
|
+
function showHiveMindHelp() {
|
|
43
|
+
console.log(`
|
|
44
|
+
${chalk.yellow('🧠 Claude Flow Hive Mind System')}
|
|
45
|
+
|
|
46
|
+
${chalk.bold('USAGE:')}
|
|
47
|
+
claude-flow hive-mind [subcommand] [options]
|
|
48
|
+
|
|
49
|
+
${chalk.bold('SUBCOMMANDS:')}
|
|
50
|
+
${chalk.green('init')} Initialize hive mind system
|
|
51
|
+
${chalk.green('spawn')} Spawn hive mind swarm for a task
|
|
52
|
+
${chalk.green('status')} Show hive mind status
|
|
53
|
+
${chalk.green('resume')} Resume a paused hive mind session
|
|
54
|
+
${chalk.green('stop')} Stop a running hive mind session
|
|
55
|
+
${chalk.green('sessions')} List all hive mind sessions
|
|
56
|
+
${chalk.green('consensus')} View consensus decisions
|
|
57
|
+
${chalk.green('memory')} Manage collective memory
|
|
58
|
+
${chalk.green('metrics')} View performance metrics
|
|
59
|
+
${chalk.green('wizard')} Interactive hive mind wizard
|
|
60
|
+
|
|
61
|
+
${chalk.bold('EXAMPLES:')}
|
|
62
|
+
${chalk.gray('# Initialize hive mind')}
|
|
63
|
+
claude-flow hive-mind init
|
|
64
|
+
|
|
65
|
+
${chalk.gray('# Spawn swarm with interactive wizard')}
|
|
66
|
+
claude-flow hive-mind spawn
|
|
67
|
+
|
|
68
|
+
${chalk.gray('# Quick spawn with objective')}
|
|
69
|
+
claude-flow hive-mind spawn "Build microservices architecture"
|
|
70
|
+
|
|
71
|
+
${chalk.gray('# View current status')}
|
|
72
|
+
claude-flow hive-mind status
|
|
73
|
+
|
|
74
|
+
${chalk.gray('# Interactive wizard')}
|
|
75
|
+
claude-flow hive-mind wizard
|
|
76
|
+
|
|
77
|
+
${chalk.gray('# Spawn with Claude Code coordination')}
|
|
78
|
+
claude-flow hive-mind spawn "Build REST API" --claude
|
|
79
|
+
|
|
80
|
+
${chalk.gray('# Auto-spawn coordinated Claude Code instances')}
|
|
81
|
+
claude-flow hive-mind spawn "Research AI trends" --auto-spawn --verbose
|
|
82
|
+
|
|
83
|
+
${chalk.gray('# List all sessions')}
|
|
84
|
+
claude-flow hive-mind sessions
|
|
85
|
+
|
|
86
|
+
${chalk.gray('# Resume a paused session')}
|
|
87
|
+
claude-flow hive-mind resume session-1234567890-abc123
|
|
88
|
+
|
|
89
|
+
${chalk.bold('KEY FEATURES:')}
|
|
90
|
+
${chalk.cyan('🐝')} Queen-led coordination with worker specialization
|
|
91
|
+
${chalk.cyan('🧠')} Collective memory and knowledge sharing
|
|
92
|
+
${chalk.cyan('🤝')} Consensus building for critical decisions
|
|
93
|
+
${chalk.cyan('⚡')} Parallel task execution with auto-scaling
|
|
94
|
+
${chalk.cyan('🔄')} Work stealing and load balancing
|
|
95
|
+
${chalk.cyan('📊')} Real-time metrics and performance tracking
|
|
96
|
+
${chalk.cyan('🛡️')} Fault tolerance and self-healing
|
|
97
|
+
${chalk.cyan('🔒')} Secure communication between agents
|
|
98
|
+
|
|
99
|
+
${chalk.bold('OPTIONS:')}
|
|
100
|
+
--queen-type <type> Queen coordinator type (strategic, tactical, adaptive)
|
|
101
|
+
--max-workers <n> Maximum worker agents (default: 8)
|
|
102
|
+
--consensus <type> Consensus algorithm (majority, weighted, byzantine)
|
|
103
|
+
--memory-size <mb> Collective memory size in MB (default: 100)
|
|
104
|
+
--auto-scale Enable auto-scaling based on workload
|
|
105
|
+
--encryption Enable encrypted communication
|
|
106
|
+
--monitor Real-time monitoring dashboard
|
|
107
|
+
--verbose Detailed logging
|
|
108
|
+
--claude Generate Claude Code spawn commands with coordination
|
|
109
|
+
--spawn Alias for --claude
|
|
110
|
+
--auto-spawn Automatically spawn Claude Code instances
|
|
111
|
+
--execute Execute Claude Code spawn commands immediately
|
|
112
|
+
|
|
113
|
+
${chalk.bold('For more information:')}
|
|
114
|
+
${chalk.blue('https://github.com/ruvnet/claude-flow/tree/main/docs/hive-mind')}
|
|
115
|
+
`);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Initialize hive mind system
|
|
120
|
+
*/
|
|
121
|
+
async function initHiveMind(flags) {
|
|
122
|
+
const spinner = ora('Initializing Hive Mind system...').start();
|
|
123
|
+
|
|
124
|
+
try {
|
|
125
|
+
// Create hive mind directory structure
|
|
126
|
+
const hiveMindDir = path.join(cwd(), '.hive-mind');
|
|
127
|
+
if (!existsSync(hiveMindDir)) {
|
|
128
|
+
mkdirSync(hiveMindDir, { recursive: true });
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Initialize SQLite database
|
|
132
|
+
const dbPath = path.join(hiveMindDir, 'hive.db');
|
|
133
|
+
const db = new Database(dbPath);
|
|
134
|
+
|
|
135
|
+
// Create tables
|
|
136
|
+
db.exec(`
|
|
137
|
+
CREATE TABLE IF NOT EXISTS swarms (
|
|
138
|
+
id TEXT PRIMARY KEY,
|
|
139
|
+
name TEXT NOT NULL,
|
|
140
|
+
objective TEXT,
|
|
141
|
+
status TEXT DEFAULT 'active',
|
|
142
|
+
queen_type TEXT DEFAULT 'strategic',
|
|
143
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
144
|
+
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
CREATE TABLE IF NOT EXISTS agents (
|
|
148
|
+
id TEXT PRIMARY KEY,
|
|
149
|
+
swarm_id TEXT,
|
|
150
|
+
name TEXT NOT NULL,
|
|
151
|
+
type TEXT NOT NULL,
|
|
152
|
+
role TEXT,
|
|
153
|
+
status TEXT DEFAULT 'idle',
|
|
154
|
+
capabilities TEXT,
|
|
155
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
156
|
+
FOREIGN KEY (swarm_id) REFERENCES swarms(id)
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
CREATE TABLE IF NOT EXISTS tasks (
|
|
160
|
+
id TEXT PRIMARY KEY,
|
|
161
|
+
swarm_id TEXT,
|
|
162
|
+
agent_id TEXT,
|
|
163
|
+
description TEXT,
|
|
164
|
+
status TEXT DEFAULT 'pending',
|
|
165
|
+
priority INTEGER DEFAULT 5,
|
|
166
|
+
result TEXT,
|
|
167
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
168
|
+
completed_at DATETIME,
|
|
169
|
+
FOREIGN KEY (swarm_id) REFERENCES swarms(id),
|
|
170
|
+
FOREIGN KEY (agent_id) REFERENCES agents(id)
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
CREATE TABLE IF NOT EXISTS collective_memory (
|
|
174
|
+
id TEXT PRIMARY KEY,
|
|
175
|
+
swarm_id TEXT,
|
|
176
|
+
key TEXT NOT NULL,
|
|
177
|
+
value TEXT,
|
|
178
|
+
type TEXT DEFAULT 'knowledge',
|
|
179
|
+
confidence REAL DEFAULT 1.0,
|
|
180
|
+
created_by TEXT,
|
|
181
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
182
|
+
accessed_at DATETIME,
|
|
183
|
+
access_count INTEGER DEFAULT 0,
|
|
184
|
+
compressed INTEGER DEFAULT 0,
|
|
185
|
+
size INTEGER DEFAULT 0,
|
|
186
|
+
FOREIGN KEY (swarm_id) REFERENCES swarms(id)
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
CREATE TABLE IF NOT EXISTS consensus_decisions (
|
|
190
|
+
id TEXT PRIMARY KEY,
|
|
191
|
+
swarm_id TEXT,
|
|
192
|
+
topic TEXT NOT NULL,
|
|
193
|
+
decision TEXT,
|
|
194
|
+
votes TEXT,
|
|
195
|
+
algorithm TEXT DEFAULT 'majority',
|
|
196
|
+
confidence REAL,
|
|
197
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
198
|
+
FOREIGN KEY (swarm_id) REFERENCES swarms(id)
|
|
199
|
+
);
|
|
200
|
+
`);
|
|
201
|
+
|
|
202
|
+
db.close();
|
|
203
|
+
|
|
204
|
+
// Create configuration file
|
|
205
|
+
const config = {
|
|
206
|
+
version: '2.0.0',
|
|
207
|
+
initialized: new Date().toISOString(),
|
|
208
|
+
defaults: {
|
|
209
|
+
queenType: 'strategic',
|
|
210
|
+
maxWorkers: 8,
|
|
211
|
+
consensusAlgorithm: 'majority',
|
|
212
|
+
memorySize: 100,
|
|
213
|
+
autoScale: true,
|
|
214
|
+
encryption: false,
|
|
215
|
+
},
|
|
216
|
+
mcpTools: {
|
|
217
|
+
enabled: true,
|
|
218
|
+
parallel: true,
|
|
219
|
+
timeout: 60000,
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
await writeFile(path.join(hiveMindDir, 'config.json'), JSON.stringify(config, null, 2));
|
|
224
|
+
|
|
225
|
+
spinner.succeed('Hive Mind system initialized successfully!');
|
|
226
|
+
|
|
227
|
+
console.log('\n' + chalk.green('✓') + ' Created .hive-mind directory');
|
|
228
|
+
console.log(chalk.green('✓') + ' Initialized SQLite database');
|
|
229
|
+
console.log(chalk.green('✓') + ' Created configuration file');
|
|
230
|
+
console.log('\n' + chalk.yellow('Next steps:'));
|
|
231
|
+
console.log(
|
|
232
|
+
' 1. Run ' + chalk.cyan('claude-flow hive-mind spawn') + ' to create your first swarm',
|
|
233
|
+
);
|
|
234
|
+
console.log(
|
|
235
|
+
' 2. Use ' + chalk.cyan('claude-flow hive-mind wizard') + ' for interactive setup',
|
|
236
|
+
);
|
|
237
|
+
} catch (error) {
|
|
238
|
+
spinner.fail('Failed to initialize Hive Mind system');
|
|
239
|
+
console.error(chalk.red('Error:'), error.message);
|
|
240
|
+
exit(1);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Interactive wizard for hive mind operations
|
|
246
|
+
*/
|
|
247
|
+
// Wrapped wizard function that handles non-interactive environments
|
|
248
|
+
const hiveMindWizard = safeInteractive(
|
|
249
|
+
// Interactive version
|
|
250
|
+
async function (flags = {}) {
|
|
251
|
+
console.log(chalk.yellow('\n🧙 Hive Mind Interactive Wizard\n'));
|
|
252
|
+
|
|
253
|
+
const { action } = await inquirer.prompt([
|
|
254
|
+
{
|
|
255
|
+
type: 'list',
|
|
256
|
+
name: 'action',
|
|
257
|
+
message: 'What would you like to do?',
|
|
258
|
+
choices: [
|
|
259
|
+
{ name: '🐝 Create new swarm', value: 'spawn' },
|
|
260
|
+
{ name: '📊 View swarm status', value: 'status' },
|
|
261
|
+
{ name: '🧠 Manage collective memory', value: 'memory' },
|
|
262
|
+
{ name: '🤝 View consensus decisions', value: 'consensus' },
|
|
263
|
+
{ name: '📈 Performance metrics', value: 'metrics' },
|
|
264
|
+
{ name: '🔧 Configure hive mind', value: 'config' },
|
|
265
|
+
{ name: '❌ Exit', value: 'exit' },
|
|
266
|
+
],
|
|
267
|
+
},
|
|
268
|
+
]);
|
|
269
|
+
|
|
270
|
+
switch (action) {
|
|
271
|
+
case 'spawn':
|
|
272
|
+
await spawnSwarmWizard();
|
|
273
|
+
break;
|
|
274
|
+
case 'status':
|
|
275
|
+
await showStatus({});
|
|
276
|
+
break;
|
|
277
|
+
case 'memory':
|
|
278
|
+
await manageMemoryWizard();
|
|
279
|
+
break;
|
|
280
|
+
case 'consensus':
|
|
281
|
+
await showConsensus({});
|
|
282
|
+
break;
|
|
283
|
+
case 'metrics':
|
|
284
|
+
await showMetrics({});
|
|
285
|
+
break;
|
|
286
|
+
case 'config':
|
|
287
|
+
await configureWizard();
|
|
288
|
+
break;
|
|
289
|
+
case 'exit':
|
|
290
|
+
console.log(chalk.gray('Exiting wizard...'));
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
// Non-interactive fallback
|
|
295
|
+
async function (flags = {}) {
|
|
296
|
+
console.log(chalk.yellow('\n🧙 Hive Mind - Non-Interactive Mode\n'));
|
|
297
|
+
|
|
298
|
+
// Default to creating a swarm with sensible defaults
|
|
299
|
+
console.log(chalk.cyan('Creating new swarm with default settings...'));
|
|
300
|
+
console.log(chalk.gray('Use command-line flags to customize:'));
|
|
301
|
+
console.log(chalk.gray(' --objective "Your task" Set swarm objective'));
|
|
302
|
+
console.log(chalk.gray(' --queen-type strategic Set queen type'));
|
|
303
|
+
console.log(chalk.gray(' --max-workers 8 Set worker count'));
|
|
304
|
+
console.log();
|
|
305
|
+
|
|
306
|
+
const objective = flags.objective || 'General task coordination';
|
|
307
|
+
const config = {
|
|
308
|
+
name: flags.name || `swarm-${Date.now()}`,
|
|
309
|
+
queenType: flags.queenType || flags['queen-type'] || 'strategic',
|
|
310
|
+
maxWorkers: parseInt(flags.maxWorkers || flags['max-workers'] || '8'),
|
|
311
|
+
consensusAlgorithm: flags.consensus || flags.consensusAlgorithm || 'majority',
|
|
312
|
+
autoScale: flags.autoScale || flags['auto-scale'] || false,
|
|
313
|
+
namespace: flags.namespace || 'default',
|
|
314
|
+
verbose: flags.verbose || false,
|
|
315
|
+
encryption: flags.encryption || false,
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
await spawnSwarm([objective], {
|
|
319
|
+
...flags,
|
|
320
|
+
name: config.name,
|
|
321
|
+
queenType: config.queenType,
|
|
322
|
+
maxWorkers: config.maxWorkers,
|
|
323
|
+
consensusAlgorithm: config.consensusAlgorithm,
|
|
324
|
+
autoScale: config.autoScale,
|
|
325
|
+
encryption: config.encryption,
|
|
326
|
+
nonInteractive: true,
|
|
327
|
+
});
|
|
328
|
+
},
|
|
329
|
+
);
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Spawn swarm wizard
|
|
333
|
+
*/
|
|
334
|
+
async function spawnSwarmWizard() {
|
|
335
|
+
const answers = await inquirer.prompt([
|
|
336
|
+
{
|
|
337
|
+
type: 'input',
|
|
338
|
+
name: 'objective',
|
|
339
|
+
message: 'What is the swarm objective?',
|
|
340
|
+
validate: (input) => input.trim().length > 0 || 'Please enter an objective',
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
type: 'input',
|
|
344
|
+
name: 'name',
|
|
345
|
+
message: 'Swarm name (optional):',
|
|
346
|
+
default: (answers) => `swarm-${Date.now()}`,
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
type: 'list',
|
|
350
|
+
name: 'queenType',
|
|
351
|
+
message: 'Select queen coordinator type:',
|
|
352
|
+
choices: [
|
|
353
|
+
{ name: 'Strategic - High-level planning and coordination', value: 'strategic' },
|
|
354
|
+
{ name: 'Tactical - Detailed task management', value: 'tactical' },
|
|
355
|
+
{ name: 'Adaptive - Learns and adapts strategies', value: 'adaptive' },
|
|
356
|
+
],
|
|
357
|
+
default: 'strategic',
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
type: 'number',
|
|
361
|
+
name: 'maxWorkers',
|
|
362
|
+
message: 'Maximum number of worker agents:',
|
|
363
|
+
default: 8,
|
|
364
|
+
validate: (input) => (input > 0 && input <= 20) || 'Please enter a number between 1 and 20',
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
type: 'checkbox',
|
|
368
|
+
name: 'workerTypes',
|
|
369
|
+
message: 'Select worker agent types:',
|
|
370
|
+
choices: [
|
|
371
|
+
{ name: 'Researcher', value: 'researcher', checked: true },
|
|
372
|
+
{ name: 'Coder', value: 'coder', checked: true },
|
|
373
|
+
{ name: 'Analyst', value: 'analyst', checked: true },
|
|
374
|
+
{ name: 'Tester', value: 'tester', checked: true },
|
|
375
|
+
{ name: 'Architect', value: 'architect' },
|
|
376
|
+
{ name: 'Reviewer', value: 'reviewer' },
|
|
377
|
+
{ name: 'Optimizer', value: 'optimizer' },
|
|
378
|
+
{ name: 'Documenter', value: 'documenter' },
|
|
379
|
+
],
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
type: 'list',
|
|
383
|
+
name: 'consensusAlgorithm',
|
|
384
|
+
message: 'Consensus algorithm for decisions:',
|
|
385
|
+
choices: [
|
|
386
|
+
{ name: 'Majority - Simple majority voting', value: 'majority' },
|
|
387
|
+
{ name: 'Weighted - Expertise-weighted voting', value: 'weighted' },
|
|
388
|
+
{ name: 'Byzantine - Fault-tolerant consensus', value: 'byzantine' },
|
|
389
|
+
],
|
|
390
|
+
default: 'majority',
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
type: 'confirm',
|
|
394
|
+
name: 'autoScale',
|
|
395
|
+
message: 'Enable auto-scaling?',
|
|
396
|
+
default: true,
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
type: 'confirm',
|
|
400
|
+
name: 'monitor',
|
|
401
|
+
message: 'Launch monitoring dashboard?',
|
|
402
|
+
default: true,
|
|
403
|
+
},
|
|
404
|
+
]);
|
|
405
|
+
|
|
406
|
+
// Spawn the swarm with collected parameters
|
|
407
|
+
await spawnSwarm([answers.objective], {
|
|
408
|
+
name: answers.name,
|
|
409
|
+
queenType: answers.queenType,
|
|
410
|
+
'queen-type': answers.queenType,
|
|
411
|
+
maxWorkers: answers.maxWorkers,
|
|
412
|
+
'max-workers': answers.maxWorkers,
|
|
413
|
+
workerTypes: answers.workerTypes.join(','),
|
|
414
|
+
consensus: answers.consensusAlgorithm,
|
|
415
|
+
autoScale: answers.autoScale,
|
|
416
|
+
'auto-scale': answers.autoScale,
|
|
417
|
+
monitor: answers.monitor,
|
|
418
|
+
namespace: answers.namespace || 'default',
|
|
419
|
+
verbose: answers.verbose || false,
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Spawn a hive mind swarm
|
|
425
|
+
*/
|
|
426
|
+
async function spawnSwarm(args, flags) {
|
|
427
|
+
const objective = args.join(' ').trim();
|
|
428
|
+
|
|
429
|
+
// Check for non-interactive mode FIRST
|
|
430
|
+
const isNonInteractive = flags['non-interactive'] || flags.nonInteractive;
|
|
431
|
+
|
|
432
|
+
if (!objective && !flags.wizard) {
|
|
433
|
+
if (isNonInteractive) {
|
|
434
|
+
console.error(chalk.red('Error: Objective required in non-interactive mode'));
|
|
435
|
+
console.log('Usage: claude-flow hive-mind spawn "Your objective" --non-interactive');
|
|
436
|
+
} else {
|
|
437
|
+
console.error(chalk.red('Error: Please provide an objective or use --wizard flag'));
|
|
438
|
+
console.log('Example: claude-flow hive-mind spawn "Build REST API"');
|
|
439
|
+
}
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// Log non-interactive mode status
|
|
444
|
+
if (isNonInteractive && flags.verbose) {
|
|
445
|
+
console.log(chalk.cyan('🤖 Running in non-interactive mode'));
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// Validate parameters
|
|
449
|
+
if (flags.verbose) {
|
|
450
|
+
console.log(chalk.gray('🔍 Debug: Parsed flags:'));
|
|
451
|
+
console.log(chalk.gray(JSON.stringify(flags, null, 2)));
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// Validate queen type
|
|
455
|
+
const validQueenTypes = ['strategic', 'tactical', 'adaptive'];
|
|
456
|
+
const queenType = flags.queenType || flags['queen-type'] || 'strategic';
|
|
457
|
+
if (!validQueenTypes.includes(queenType)) {
|
|
458
|
+
console.error(
|
|
459
|
+
chalk.red(
|
|
460
|
+
`Error: Invalid queen type '${queenType}'. Must be one of: ${validQueenTypes.join(', ')}`,
|
|
461
|
+
),
|
|
462
|
+
);
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
// Validate max workers
|
|
467
|
+
const maxWorkers = parseInt(flags.maxWorkers || flags['max-workers'] || '8');
|
|
468
|
+
if (isNaN(maxWorkers) || maxWorkers < 1 || maxWorkers > 20) {
|
|
469
|
+
console.error(chalk.red('Error: max-workers must be a number between 1 and 20'));
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// Validate consensus algorithm
|
|
474
|
+
const validConsensusTypes = ['majority', 'weighted', 'byzantine'];
|
|
475
|
+
const consensusAlgorithm = flags.consensus || flags.consensusAlgorithm || 'majority';
|
|
476
|
+
if (!validConsensusTypes.includes(consensusAlgorithm)) {
|
|
477
|
+
console.error(
|
|
478
|
+
chalk.red(
|
|
479
|
+
`Error: Invalid consensus algorithm '${consensusAlgorithm}'. Must be one of: ${validConsensusTypes.join(', ')}`,
|
|
480
|
+
),
|
|
481
|
+
);
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
const spinner = ora('Spawning Hive Mind swarm...').start();
|
|
486
|
+
|
|
487
|
+
try {
|
|
488
|
+
// Initialize hive mind core with error handling
|
|
489
|
+
let hiveMind;
|
|
490
|
+
try {
|
|
491
|
+
spinner.text = 'Initializing Hive Mind Core...';
|
|
492
|
+
hiveMind = new HiveMindCore({
|
|
493
|
+
objective,
|
|
494
|
+
name: flags.name || `hive-${Date.now()}`,
|
|
495
|
+
queenType: flags.queenType || flags['queen-type'] || 'strategic',
|
|
496
|
+
maxWorkers: parseInt(flags.maxWorkers || flags['max-workers'] || '8'),
|
|
497
|
+
consensusAlgorithm: flags.consensus || flags.consensusAlgorithm || 'majority',
|
|
498
|
+
autoScale:
|
|
499
|
+
flags.autoScale !== undefined
|
|
500
|
+
? flags.autoScale
|
|
501
|
+
: flags['auto-scale'] !== undefined
|
|
502
|
+
? flags['auto-scale']
|
|
503
|
+
: true,
|
|
504
|
+
namespace: flags.namespace || 'default',
|
|
505
|
+
encryption: flags.encryption || false,
|
|
506
|
+
});
|
|
507
|
+
} catch (error) {
|
|
508
|
+
console.error('HiveMindCore initialization failed:', error);
|
|
509
|
+
throw new Error(`Failed to initialize HiveMindCore: ${error.message}`);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
spinner.text = 'Setting up database connection...';
|
|
513
|
+
// Initialize database connection
|
|
514
|
+
const dbDir = path.join(cwd(), '.hive-mind');
|
|
515
|
+
const dbPath = path.join(dbDir, 'hive.db');
|
|
516
|
+
|
|
517
|
+
// Ensure .hive-mind directory exists
|
|
518
|
+
if (!existsSync(dbDir)) {
|
|
519
|
+
mkdirSync(dbDir, { recursive: true });
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// Check if database file exists and try to create a clean one if needed
|
|
523
|
+
let db;
|
|
524
|
+
try {
|
|
525
|
+
spinner.text = 'Creating database connection...';
|
|
526
|
+
db = new Database(dbPath);
|
|
527
|
+
// Test the database with a simple query
|
|
528
|
+
db.prepare('SELECT 1').get();
|
|
529
|
+
spinner.text = 'Database connection established';
|
|
530
|
+
} catch (error) {
|
|
531
|
+
console.warn('Database issue detected, recreating...', error.message);
|
|
532
|
+
spinner.text = 'Recreating database...';
|
|
533
|
+
// Remove corrupted database
|
|
534
|
+
if (existsSync(dbPath)) {
|
|
535
|
+
try {
|
|
536
|
+
const fs = await import('fs');
|
|
537
|
+
fs.unlinkSync(dbPath);
|
|
538
|
+
} catch (e) {
|
|
539
|
+
console.warn('Could not remove corrupted database:', e.message);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
// Create new database
|
|
543
|
+
db = new Database(dbPath);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// Initialize database schema if not exists
|
|
547
|
+
spinner.text = 'Creating database schema...';
|
|
548
|
+
try {
|
|
549
|
+
db.exec(`
|
|
550
|
+
CREATE TABLE IF NOT EXISTS swarms (
|
|
551
|
+
id TEXT PRIMARY KEY,
|
|
552
|
+
name TEXT NOT NULL,
|
|
553
|
+
objective TEXT,
|
|
554
|
+
queen_type TEXT,
|
|
555
|
+
status TEXT DEFAULT 'active',
|
|
556
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
557
|
+
updated_at DATETIME
|
|
558
|
+
);
|
|
559
|
+
|
|
560
|
+
CREATE TABLE IF NOT EXISTS agents (
|
|
561
|
+
id TEXT PRIMARY KEY,
|
|
562
|
+
swarm_id TEXT NOT NULL,
|
|
563
|
+
name TEXT NOT NULL,
|
|
564
|
+
type TEXT NOT NULL,
|
|
565
|
+
role TEXT NOT NULL,
|
|
566
|
+
status TEXT DEFAULT 'idle',
|
|
567
|
+
capabilities TEXT,
|
|
568
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
569
|
+
FOREIGN KEY (swarm_id) REFERENCES swarms(id)
|
|
570
|
+
);
|
|
571
|
+
|
|
572
|
+
CREATE TABLE IF NOT EXISTS tasks (
|
|
573
|
+
id TEXT PRIMARY KEY,
|
|
574
|
+
swarm_id TEXT NOT NULL,
|
|
575
|
+
agent_id TEXT,
|
|
576
|
+
description TEXT,
|
|
577
|
+
status TEXT DEFAULT 'pending',
|
|
578
|
+
priority INTEGER DEFAULT 5,
|
|
579
|
+
result TEXT,
|
|
580
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
581
|
+
completed_at DATETIME,
|
|
582
|
+
FOREIGN KEY (swarm_id) REFERENCES swarms(id),
|
|
583
|
+
FOREIGN KEY (agent_id) REFERENCES agents(id)
|
|
584
|
+
);
|
|
585
|
+
|
|
586
|
+
CREATE TABLE IF NOT EXISTS collective_memory (
|
|
587
|
+
id TEXT PRIMARY KEY,
|
|
588
|
+
swarm_id TEXT,
|
|
589
|
+
key TEXT NOT NULL,
|
|
590
|
+
value TEXT,
|
|
591
|
+
type TEXT DEFAULT 'knowledge',
|
|
592
|
+
confidence REAL DEFAULT 1.0,
|
|
593
|
+
created_by TEXT,
|
|
594
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
595
|
+
accessed_at DATETIME,
|
|
596
|
+
access_count INTEGER DEFAULT 0,
|
|
597
|
+
compressed INTEGER DEFAULT 0,
|
|
598
|
+
size INTEGER DEFAULT 0,
|
|
599
|
+
FOREIGN KEY (swarm_id) REFERENCES swarms(id)
|
|
600
|
+
);
|
|
601
|
+
|
|
602
|
+
CREATE TABLE IF NOT EXISTS consensus_decisions (
|
|
603
|
+
id TEXT PRIMARY KEY,
|
|
604
|
+
swarm_id TEXT,
|
|
605
|
+
topic TEXT NOT NULL,
|
|
606
|
+
decision TEXT,
|
|
607
|
+
votes TEXT,
|
|
608
|
+
algorithm TEXT DEFAULT 'majority',
|
|
609
|
+
confidence REAL,
|
|
610
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
611
|
+
FOREIGN KEY (swarm_id) REFERENCES swarms(id)
|
|
612
|
+
);
|
|
613
|
+
|
|
614
|
+
CREATE TABLE IF NOT EXISTS sessions (
|
|
615
|
+
id TEXT PRIMARY KEY,
|
|
616
|
+
swarm_id TEXT NOT NULL,
|
|
617
|
+
swarm_name TEXT NOT NULL,
|
|
618
|
+
objective TEXT,
|
|
619
|
+
status TEXT DEFAULT 'active',
|
|
620
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
621
|
+
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
622
|
+
paused_at DATETIME,
|
|
623
|
+
resumed_at DATETIME,
|
|
624
|
+
completion_percentage REAL DEFAULT 0,
|
|
625
|
+
checkpoint_data TEXT,
|
|
626
|
+
metadata TEXT,
|
|
627
|
+
parent_pid INTEGER,
|
|
628
|
+
child_pids TEXT,
|
|
629
|
+
FOREIGN KEY (swarm_id) REFERENCES swarms(id)
|
|
630
|
+
);
|
|
631
|
+
|
|
632
|
+
CREATE TABLE IF NOT EXISTS session_checkpoints (
|
|
633
|
+
id TEXT PRIMARY KEY,
|
|
634
|
+
session_id TEXT NOT NULL,
|
|
635
|
+
checkpoint_name TEXT NOT NULL,
|
|
636
|
+
checkpoint_data TEXT,
|
|
637
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
638
|
+
FOREIGN KEY (session_id) REFERENCES sessions(id)
|
|
639
|
+
);
|
|
640
|
+
|
|
641
|
+
CREATE TABLE IF NOT EXISTS session_logs (
|
|
642
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
643
|
+
session_id TEXT NOT NULL,
|
|
644
|
+
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
645
|
+
log_level TEXT DEFAULT 'info',
|
|
646
|
+
message TEXT,
|
|
647
|
+
agent_id TEXT,
|
|
648
|
+
data TEXT,
|
|
649
|
+
FOREIGN KEY (session_id) REFERENCES sessions(id)
|
|
650
|
+
);
|
|
651
|
+
`);
|
|
652
|
+
spinner.text = 'Database schema created successfully';
|
|
653
|
+
} catch (error) {
|
|
654
|
+
console.error('Database schema creation failed:', error);
|
|
655
|
+
throw new Error(`Failed to create database schema: ${error.message}`);
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
// Create swarm record with safe ID generation
|
|
659
|
+
spinner.text = 'Creating swarm record...';
|
|
660
|
+
const timestamp = Date.now();
|
|
661
|
+
const randomPart = Math.random().toString(36).substring(2, 11); // Use substring instead of substr
|
|
662
|
+
const swarmId = `swarm-${timestamp}-${randomPart}`;
|
|
663
|
+
try {
|
|
664
|
+
db.prepare(
|
|
665
|
+
`
|
|
666
|
+
INSERT INTO swarms (id, name, objective, queen_type)
|
|
667
|
+
VALUES (?, ?, ?, ?)
|
|
668
|
+
`,
|
|
669
|
+
).run(swarmId, hiveMind.config.name, objective, hiveMind.config.queenType);
|
|
670
|
+
} catch (error) {
|
|
671
|
+
console.error('Failed to create swarm record:', error);
|
|
672
|
+
throw new Error(`Failed to create swarm record: ${error.message}`);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
// Create session for this swarm
|
|
676
|
+
spinner.text = 'Creating session tracking...';
|
|
677
|
+
const sessionManager = new HiveMindSessionManager();
|
|
678
|
+
const sessionId = await sessionManager.createSession(swarmId, hiveMind.config.name, objective, {
|
|
679
|
+
queenType: hiveMind.config.queenType,
|
|
680
|
+
maxWorkers: hiveMind.config.maxWorkers,
|
|
681
|
+
consensusAlgorithm: hiveMind.config.consensusAlgorithm,
|
|
682
|
+
autoScale: hiveMind.config.autoScale,
|
|
683
|
+
encryption: hiveMind.config.encryption,
|
|
684
|
+
workerTypes: flags.workerTypes,
|
|
685
|
+
});
|
|
686
|
+
|
|
687
|
+
spinner.text = 'Session tracking established...';
|
|
688
|
+
|
|
689
|
+
// Initialize auto-save middleware (use the same session manager)
|
|
690
|
+
const autoSave = createAutoSaveMiddleware(sessionId, sessionManager, {
|
|
691
|
+
saveInterval: 30000, // Save every 30 seconds
|
|
692
|
+
autoStart: true,
|
|
693
|
+
});
|
|
694
|
+
|
|
695
|
+
// Close session manager after auto-save is set up
|
|
696
|
+
// sessionManager.close(); // Don't close yet as auto-save needs it
|
|
697
|
+
|
|
698
|
+
// Track initial swarm creation
|
|
699
|
+
autoSave.trackChange('swarm_created', {
|
|
700
|
+
swarmId,
|
|
701
|
+
swarmName: hiveMind.config.name,
|
|
702
|
+
objective,
|
|
703
|
+
workerCount: hiveMind.config.maxWorkers,
|
|
704
|
+
});
|
|
705
|
+
|
|
706
|
+
spinner.text = 'Initializing Queen coordinator...';
|
|
707
|
+
|
|
708
|
+
// Initialize Queen
|
|
709
|
+
const queen = new QueenCoordinator({
|
|
710
|
+
swarmId,
|
|
711
|
+
type: hiveMind.config.queenType,
|
|
712
|
+
objective,
|
|
713
|
+
});
|
|
714
|
+
|
|
715
|
+
// Spawn Queen agent
|
|
716
|
+
const queenAgent = {
|
|
717
|
+
id: `queen-${swarmId}`,
|
|
718
|
+
swarmId,
|
|
719
|
+
name: 'Queen Coordinator',
|
|
720
|
+
type: 'coordinator',
|
|
721
|
+
role: 'queen',
|
|
722
|
+
status: 'active',
|
|
723
|
+
capabilities: JSON.stringify(['coordination', 'planning', 'decision-making']),
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
db.prepare(
|
|
727
|
+
`
|
|
728
|
+
INSERT INTO agents (id, swarm_id, name, type, role, status, capabilities)
|
|
729
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
730
|
+
`,
|
|
731
|
+
).run(...Object.values(queenAgent));
|
|
732
|
+
|
|
733
|
+
spinner.text = 'Spawning worker agents...';
|
|
734
|
+
|
|
735
|
+
// Determine worker types
|
|
736
|
+
const workerTypes = flags.workerTypes
|
|
737
|
+
? flags.workerTypes.split(',')
|
|
738
|
+
: ['researcher', 'coder', 'analyst', 'tester'];
|
|
739
|
+
|
|
740
|
+
// Spawn worker agents
|
|
741
|
+
const workers = [];
|
|
742
|
+
for (let i = 0; i < Math.min(workerTypes.length, hiveMind.config.maxWorkers); i++) {
|
|
743
|
+
const workerType = workerTypes[i % workerTypes.length];
|
|
744
|
+
const workerId = `worker-${swarmId}-${i}`;
|
|
745
|
+
|
|
746
|
+
const worker = {
|
|
747
|
+
id: workerId,
|
|
748
|
+
swarmId,
|
|
749
|
+
name: `${workerType.charAt(0).toUpperCase() + workerType.slice(1)} Worker ${i + 1}`,
|
|
750
|
+
type: workerType,
|
|
751
|
+
role: 'worker',
|
|
752
|
+
status: 'idle',
|
|
753
|
+
capabilities: JSON.stringify(getAgentCapabilities(workerType)),
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
workers.push(worker);
|
|
757
|
+
|
|
758
|
+
db.prepare(
|
|
759
|
+
`
|
|
760
|
+
INSERT INTO agents (id, swarm_id, name, type, role, status, capabilities)
|
|
761
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
762
|
+
`,
|
|
763
|
+
).run(...Object.values(worker));
|
|
764
|
+
|
|
765
|
+
// Track agent spawning for auto-save
|
|
766
|
+
autoSave.trackAgentActivity(workerId, 'spawned', {
|
|
767
|
+
type: workerType,
|
|
768
|
+
name: worker.name,
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
spinner.text = 'Initializing collective memory...';
|
|
773
|
+
|
|
774
|
+
// Initialize collective memory
|
|
775
|
+
const memory = new CollectiveMemory({
|
|
776
|
+
swarmId,
|
|
777
|
+
maxSize: flags.memorySize || 100,
|
|
778
|
+
});
|
|
779
|
+
|
|
780
|
+
// Store initial context
|
|
781
|
+
memory.store('objective', objective, 'context');
|
|
782
|
+
memory.store('queen_type', hiveMind.config.queenType, 'config');
|
|
783
|
+
memory.store('worker_count', workers.length, 'metrics');
|
|
784
|
+
memory.store('session_id', sessionId, 'system');
|
|
785
|
+
|
|
786
|
+
spinner.text = 'Establishing communication channels...';
|
|
787
|
+
|
|
788
|
+
// Initialize communication system
|
|
789
|
+
const communication = new SwarmCommunication({
|
|
790
|
+
swarmId,
|
|
791
|
+
encryption: hiveMind.config.encryption,
|
|
792
|
+
});
|
|
793
|
+
|
|
794
|
+
db.close();
|
|
795
|
+
|
|
796
|
+
spinner.succeed('Hive Mind swarm spawned successfully!');
|
|
797
|
+
|
|
798
|
+
// Display swarm summary
|
|
799
|
+
console.log('\n' + chalk.bold('🐝 Swarm Summary:'));
|
|
800
|
+
console.log(chalk.gray('─'.repeat(50)));
|
|
801
|
+
console.log(chalk.cyan('Swarm ID:'), swarmId);
|
|
802
|
+
console.log(chalk.cyan('Session ID:'), sessionId);
|
|
803
|
+
console.log(chalk.cyan('Name:'), hiveMind.config.name);
|
|
804
|
+
console.log(chalk.cyan('Objective:'), objective);
|
|
805
|
+
console.log(chalk.cyan('Queen Type:'), hiveMind.config.queenType);
|
|
806
|
+
console.log(chalk.cyan('Workers:'), workers.length);
|
|
807
|
+
console.log(chalk.cyan('Worker Types:'), workerTypes.join(', '));
|
|
808
|
+
console.log(chalk.cyan('Consensus:'), hiveMind.config.consensusAlgorithm);
|
|
809
|
+
console.log(chalk.cyan('Auto-scaling:'), hiveMind.config.autoScale ? 'Enabled' : 'Disabled');
|
|
810
|
+
console.log(chalk.gray('─'.repeat(50)));
|
|
811
|
+
|
|
812
|
+
// Launch monitoring if requested
|
|
813
|
+
if (flags.monitor) {
|
|
814
|
+
console.log('\n' + chalk.yellow('Launching monitoring dashboard...'));
|
|
815
|
+
// TODO: Implement monitoring dashboard
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
// Enhanced coordination instructions with MCP tools
|
|
819
|
+
console.log('\n' + chalk.green('✓') + ' Swarm is ready for coordination');
|
|
820
|
+
console.log(chalk.gray('Use "claude-flow hive-mind status" to view swarm activity'));
|
|
821
|
+
console.log(chalk.gray('Session auto-save enabled - progress saved every 30 seconds'));
|
|
822
|
+
console.log(chalk.blue('💡 To pause:') + ' Press Ctrl+C to safely pause and resume later');
|
|
823
|
+
console.log(chalk.blue('💡 To resume:') + ' claude-flow hive-mind resume ' + sessionId);
|
|
824
|
+
|
|
825
|
+
// Set up SIGINT handler for automatic session pausing
|
|
826
|
+
let isExiting = false;
|
|
827
|
+
const sigintHandler = async () => {
|
|
828
|
+
if (isExiting) return;
|
|
829
|
+
isExiting = true;
|
|
830
|
+
|
|
831
|
+
console.log('\n\n' + chalk.yellow('⏸️ Pausing session...'));
|
|
832
|
+
|
|
833
|
+
try {
|
|
834
|
+
// Save current checkpoint using the existing session manager
|
|
835
|
+
// const sessionManager = new HiveMindSessionManager(); // Use existing one
|
|
836
|
+
|
|
837
|
+
// Create checkpoint data
|
|
838
|
+
const checkpointData = {
|
|
839
|
+
timestamp: new Date().toISOString(),
|
|
840
|
+
swarmId,
|
|
841
|
+
objective,
|
|
842
|
+
workerCount: workers.length,
|
|
843
|
+
workerTypes,
|
|
844
|
+
status: 'paused_by_user',
|
|
845
|
+
reason: 'User pressed Ctrl+C',
|
|
846
|
+
};
|
|
847
|
+
|
|
848
|
+
// Save checkpoint
|
|
849
|
+
await sessionManager.saveCheckpoint(sessionId, 'auto-pause', checkpointData);
|
|
850
|
+
|
|
851
|
+
// Pause the session
|
|
852
|
+
await sessionManager.pauseSession(sessionId);
|
|
853
|
+
|
|
854
|
+
// Close session manager
|
|
855
|
+
sessionManager.close();
|
|
856
|
+
|
|
857
|
+
console.log(chalk.green('✓') + ' Session paused successfully');
|
|
858
|
+
console.log(chalk.cyan('\nTo resume this session, run:'));
|
|
859
|
+
console.log(chalk.bold(` claude-flow hive-mind resume ${sessionId}`));
|
|
860
|
+
console.log();
|
|
861
|
+
|
|
862
|
+
// Clean up auto-save if active
|
|
863
|
+
if (global.autoSaveInterval) {
|
|
864
|
+
clearInterval(global.autoSaveInterval);
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
process.exit(0);
|
|
868
|
+
} catch (error) {
|
|
869
|
+
console.error(chalk.red('Error pausing session:'), error.message);
|
|
870
|
+
process.exit(1);
|
|
871
|
+
}
|
|
872
|
+
};
|
|
873
|
+
|
|
874
|
+
// Register SIGINT handler
|
|
875
|
+
process.on('SIGINT', sigintHandler);
|
|
876
|
+
process.on('SIGTERM', sigintHandler);
|
|
877
|
+
|
|
878
|
+
// Offer to spawn Claude Code instances with coordination instructions
|
|
879
|
+
// Spawn Claude if --claude or --spawn flag is set
|
|
880
|
+
if (flags.claude || flags.spawn) {
|
|
881
|
+
await spawnClaudeCodeInstances(swarmId, hiveMind.config.name, objective, workers, flags);
|
|
882
|
+
} else {
|
|
883
|
+
console.log(
|
|
884
|
+
'\n' +
|
|
885
|
+
chalk.blue('💡 Pro Tip:') +
|
|
886
|
+
' Add --claude to spawn coordinated Claude Code instances',
|
|
887
|
+
);
|
|
888
|
+
console.log(chalk.gray(' claude-flow hive-mind spawn "objective" --claude'));
|
|
889
|
+
}
|
|
890
|
+
} catch (error) {
|
|
891
|
+
spinner.fail('Failed to spawn Hive Mind swarm');
|
|
892
|
+
console.error(chalk.red('Error:'), error.message);
|
|
893
|
+
|
|
894
|
+
// If error contains "sha3", provide specific guidance
|
|
895
|
+
if (error.message.includes('sha3') || error.message.includes('SHA3')) {
|
|
896
|
+
console.error('\n🔍 SHA3 Function Error Detected');
|
|
897
|
+
console.error('This appears to be a SQLite extension or better-sqlite3 configuration issue.');
|
|
898
|
+
console.error('\nPossible solutions:');
|
|
899
|
+
console.error('1. Try removing the corrupted database: rm -rf .hive-mind/');
|
|
900
|
+
console.error('2. Reinstall better-sqlite3: npm reinstall better-sqlite3');
|
|
901
|
+
console.error('3. Check if any SQLite extensions are conflicting');
|
|
902
|
+
console.error('\n🚨 Detailed error:');
|
|
903
|
+
console.error(error.stack || error.message);
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
exit(1);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* Get agent capabilities based on type
|
|
912
|
+
*/
|
|
913
|
+
function getAgentCapabilities(type) {
|
|
914
|
+
const capabilities = {
|
|
915
|
+
researcher: ['web-search', 'data-gathering', 'analysis', 'synthesis'],
|
|
916
|
+
coder: ['code-generation', 'implementation', 'refactoring', 'debugging'],
|
|
917
|
+
analyst: ['data-analysis', 'pattern-recognition', 'reporting', 'visualization'],
|
|
918
|
+
tester: ['test-generation', 'quality-assurance', 'bug-detection', 'validation'],
|
|
919
|
+
architect: ['system-design', 'architecture', 'planning', 'documentation'],
|
|
920
|
+
reviewer: ['code-review', 'quality-check', 'feedback', 'improvement'],
|
|
921
|
+
optimizer: ['performance-tuning', 'optimization', 'profiling', 'enhancement'],
|
|
922
|
+
documenter: ['documentation', 'explanation', 'tutorial-creation', 'knowledge-base'],
|
|
923
|
+
};
|
|
924
|
+
|
|
925
|
+
return capabilities[type] || ['general'];
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* Show hive mind status
|
|
930
|
+
*/
|
|
931
|
+
async function showStatus(flags) {
|
|
932
|
+
try {
|
|
933
|
+
const dbPath = path.join(cwd(), '.hive-mind', 'hive.db');
|
|
934
|
+
|
|
935
|
+
if (!existsSync(dbPath)) {
|
|
936
|
+
console.error(chalk.red('Error: Hive Mind not initialized'));
|
|
937
|
+
console.log('Run "claude-flow hive-mind init" first');
|
|
938
|
+
return;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
const db = new Database(dbPath);
|
|
942
|
+
|
|
943
|
+
// Get active swarms
|
|
944
|
+
const swarms = db
|
|
945
|
+
.prepare(
|
|
946
|
+
`
|
|
947
|
+
SELECT * FROM swarms
|
|
948
|
+
WHERE status = 'active'
|
|
949
|
+
ORDER BY created_at DESC
|
|
950
|
+
`,
|
|
951
|
+
)
|
|
952
|
+
.all();
|
|
953
|
+
|
|
954
|
+
if (swarms.length === 0) {
|
|
955
|
+
console.log(chalk.gray('No active swarms found'));
|
|
956
|
+
db.close();
|
|
957
|
+
return;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
console.log(chalk.bold('\n🐝 Active Hive Mind Swarms\n'));
|
|
961
|
+
|
|
962
|
+
for (const swarm of swarms) {
|
|
963
|
+
console.log(chalk.yellow('═'.repeat(60)));
|
|
964
|
+
console.log(chalk.cyan('Swarm:'), swarm.name);
|
|
965
|
+
console.log(chalk.cyan('ID:'), swarm.id);
|
|
966
|
+
console.log(chalk.cyan('Objective:'), swarm.objective);
|
|
967
|
+
console.log(chalk.cyan('Queen Type:'), swarm.queen_type);
|
|
968
|
+
console.log(chalk.cyan('Status:'), chalk.green(swarm.status));
|
|
969
|
+
console.log(chalk.cyan('Created:'), new Date(swarm.created_at).toLocaleString());
|
|
970
|
+
|
|
971
|
+
// Get agents
|
|
972
|
+
const agents = db
|
|
973
|
+
.prepare(
|
|
974
|
+
`
|
|
975
|
+
SELECT * FROM agents
|
|
976
|
+
WHERE swarm_id = ?
|
|
977
|
+
`,
|
|
978
|
+
)
|
|
979
|
+
.all(swarm.id);
|
|
980
|
+
|
|
981
|
+
console.log('\n' + chalk.bold('Agents:'));
|
|
982
|
+
|
|
983
|
+
// Group by role
|
|
984
|
+
const queen = agents.find((a) => a.role === 'queen');
|
|
985
|
+
const workers = agents.filter((a) => a.role === 'worker');
|
|
986
|
+
|
|
987
|
+
if (queen) {
|
|
988
|
+
console.log(' ' + chalk.magenta('👑 Queen:'), queen.name, chalk.gray(`(${queen.status})`));
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
console.log(' ' + chalk.blue('🐝 Workers:'));
|
|
992
|
+
workers.forEach((worker) => {
|
|
993
|
+
const statusColor =
|
|
994
|
+
worker.status === 'active' ? 'green' : worker.status === 'busy' ? 'yellow' : 'gray';
|
|
995
|
+
console.log(` - ${worker.name} (${worker.type}) ${chalk[statusColor](worker.status)}`);
|
|
996
|
+
});
|
|
997
|
+
|
|
998
|
+
// Get task statistics
|
|
999
|
+
const taskStats = db
|
|
1000
|
+
.prepare(
|
|
1001
|
+
`
|
|
1002
|
+
SELECT
|
|
1003
|
+
COUNT(*) as total,
|
|
1004
|
+
SUM(CASE WHEN status = 'completed' THEN 1 ELSE 0 END) as completed,
|
|
1005
|
+
SUM(CASE WHEN status = 'in_progress' THEN 1 ELSE 0 END) as in_progress,
|
|
1006
|
+
SUM(CASE WHEN status = 'pending' THEN 1 ELSE 0 END) as pending
|
|
1007
|
+
FROM tasks
|
|
1008
|
+
WHERE swarm_id = ?
|
|
1009
|
+
`,
|
|
1010
|
+
)
|
|
1011
|
+
.get(swarm.id);
|
|
1012
|
+
|
|
1013
|
+
console.log('\n' + chalk.bold('Tasks:'));
|
|
1014
|
+
console.log(` Total: ${taskStats.total}`);
|
|
1015
|
+
console.log(` Completed: ${chalk.green(taskStats.completed)}`);
|
|
1016
|
+
console.log(` In Progress: ${chalk.yellow(taskStats.in_progress)}`);
|
|
1017
|
+
console.log(` Pending: ${chalk.gray(taskStats.pending)}`);
|
|
1018
|
+
|
|
1019
|
+
// Get memory stats
|
|
1020
|
+
const memoryCount = db
|
|
1021
|
+
.prepare(
|
|
1022
|
+
`
|
|
1023
|
+
SELECT COUNT(*) as count FROM collective_memory
|
|
1024
|
+
WHERE swarm_id = ?
|
|
1025
|
+
`,
|
|
1026
|
+
)
|
|
1027
|
+
.get(swarm.id);
|
|
1028
|
+
|
|
1029
|
+
console.log('\n' + chalk.bold('Collective Memory:'));
|
|
1030
|
+
console.log(` Entries: ${memoryCount.count}`);
|
|
1031
|
+
|
|
1032
|
+
// Get consensus stats
|
|
1033
|
+
const consensusCount = db
|
|
1034
|
+
.prepare(
|
|
1035
|
+
`
|
|
1036
|
+
SELECT COUNT(*) as count FROM consensus_decisions
|
|
1037
|
+
WHERE swarm_id = ?
|
|
1038
|
+
`,
|
|
1039
|
+
)
|
|
1040
|
+
.get(swarm.id);
|
|
1041
|
+
|
|
1042
|
+
console.log('\n' + chalk.bold('Consensus Decisions:'));
|
|
1043
|
+
console.log(` Total: ${consensusCount.count}`);
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
console.log(chalk.yellow('═'.repeat(60)) + '\n');
|
|
1047
|
+
|
|
1048
|
+
db.close();
|
|
1049
|
+
} catch (error) {
|
|
1050
|
+
console.error(chalk.red('Error:'), error.message);
|
|
1051
|
+
exit(1);
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
/**
|
|
1056
|
+
* Show consensus decisions
|
|
1057
|
+
*/
|
|
1058
|
+
async function showConsensus(flags) {
|
|
1059
|
+
try {
|
|
1060
|
+
const dbPath = path.join(cwd(), '.hive-mind', 'hive.db');
|
|
1061
|
+
const db = new Database(dbPath);
|
|
1062
|
+
|
|
1063
|
+
const decisions = db
|
|
1064
|
+
.prepare(
|
|
1065
|
+
`
|
|
1066
|
+
SELECT cd.*, s.name as swarm_name
|
|
1067
|
+
FROM consensus_decisions cd
|
|
1068
|
+
JOIN swarms s ON cd.swarm_id = s.id
|
|
1069
|
+
ORDER BY cd.created_at DESC
|
|
1070
|
+
LIMIT 20
|
|
1071
|
+
`,
|
|
1072
|
+
)
|
|
1073
|
+
.all();
|
|
1074
|
+
|
|
1075
|
+
if (decisions.length === 0) {
|
|
1076
|
+
console.log(chalk.gray('No consensus decisions found'));
|
|
1077
|
+
db.close();
|
|
1078
|
+
return;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
console.log(chalk.bold('\n🤝 Recent Consensus Decisions\n'));
|
|
1082
|
+
|
|
1083
|
+
decisions.forEach((decision) => {
|
|
1084
|
+
console.log(chalk.yellow('─'.repeat(50)));
|
|
1085
|
+
console.log(chalk.cyan('Swarm:'), decision.swarm_name);
|
|
1086
|
+
console.log(chalk.cyan('Topic:'), decision.topic);
|
|
1087
|
+
console.log(chalk.cyan('Decision:'), decision.decision);
|
|
1088
|
+
console.log(chalk.cyan('Algorithm:'), decision.algorithm);
|
|
1089
|
+
console.log(chalk.cyan('Confidence:'), `${(decision.confidence * 100).toFixed(1)}%`);
|
|
1090
|
+
console.log(chalk.cyan('Time:'), new Date(decision.created_at).toLocaleString());
|
|
1091
|
+
|
|
1092
|
+
if (decision.votes) {
|
|
1093
|
+
const votes = JSON.parse(decision.votes);
|
|
1094
|
+
console.log(chalk.cyan('Votes:'));
|
|
1095
|
+
|
|
1096
|
+
// Handle vote summary format (for/against/abstain/details)
|
|
1097
|
+
if (votes.for !== undefined || votes.against !== undefined || votes.abstain !== undefined) {
|
|
1098
|
+
console.log(` - for: ${votes.for || 0}`);
|
|
1099
|
+
console.log(` - against: ${votes.against || 0}`);
|
|
1100
|
+
console.log(` - abstain: ${votes.abstain || 0}`);
|
|
1101
|
+
|
|
1102
|
+
// Display vote details properly if they exist
|
|
1103
|
+
if (votes.details && Array.isArray(votes.details)) {
|
|
1104
|
+
console.log(' - details:');
|
|
1105
|
+
votes.details.forEach((detail, index) => {
|
|
1106
|
+
if (typeof detail === 'object') {
|
|
1107
|
+
// Extract available fields
|
|
1108
|
+
const agent =
|
|
1109
|
+
detail.agentId ||
|
|
1110
|
+
detail.agent ||
|
|
1111
|
+
detail.id ||
|
|
1112
|
+
detail.name ||
|
|
1113
|
+
`agent-${index + 1}`;
|
|
1114
|
+
const vote = detail.vote || detail.choice || detail.decision || 'unknown';
|
|
1115
|
+
const reason = detail.reason || detail.justification || detail.rationale;
|
|
1116
|
+
|
|
1117
|
+
// Build display string
|
|
1118
|
+
let displayString = ` ${index + 1}. Agent: ${agent}, Vote: ${vote}`;
|
|
1119
|
+
|
|
1120
|
+
// Add reason if available
|
|
1121
|
+
if (reason && reason !== 'N/A' && reason !== '') {
|
|
1122
|
+
displayString += `, Reason: ${reason}`;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
console.log(displayString);
|
|
1126
|
+
} else {
|
|
1127
|
+
console.log(` ${index + 1}. ${detail}`);
|
|
1128
|
+
}
|
|
1129
|
+
});
|
|
1130
|
+
}
|
|
1131
|
+
} else {
|
|
1132
|
+
// Handle individual agent votes format
|
|
1133
|
+
Object.entries(votes).forEach(([agent, vote]) => {
|
|
1134
|
+
console.log(` - ${agent}: ${vote}`);
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
});
|
|
1139
|
+
|
|
1140
|
+
console.log(chalk.yellow('─'.repeat(50)) + '\n');
|
|
1141
|
+
|
|
1142
|
+
db.close();
|
|
1143
|
+
} catch (error) {
|
|
1144
|
+
console.error(chalk.red('Error:'), error.message);
|
|
1145
|
+
exit(1);
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* Show performance metrics
|
|
1151
|
+
*/
|
|
1152
|
+
async function showMetrics(flags) {
|
|
1153
|
+
try {
|
|
1154
|
+
const dbPath = path.join(cwd(), '.hive-mind', 'hive.db');
|
|
1155
|
+
const db = new Database(dbPath);
|
|
1156
|
+
|
|
1157
|
+
// Get overall metrics
|
|
1158
|
+
const overallStats = db
|
|
1159
|
+
.prepare(
|
|
1160
|
+
`
|
|
1161
|
+
SELECT
|
|
1162
|
+
(SELECT COUNT(*) FROM swarms) as total_swarms,
|
|
1163
|
+
(SELECT COUNT(*) FROM agents) as total_agents,
|
|
1164
|
+
(SELECT COUNT(*) FROM tasks) as total_tasks,
|
|
1165
|
+
(SELECT COUNT(*) FROM tasks WHERE status = 'completed') as completed_tasks
|
|
1166
|
+
`,
|
|
1167
|
+
)
|
|
1168
|
+
.get();
|
|
1169
|
+
|
|
1170
|
+
console.log(chalk.bold('\n📊 Hive Mind Performance Metrics\n'));
|
|
1171
|
+
|
|
1172
|
+
// Get task status breakdown
|
|
1173
|
+
const taskBreakdown = db
|
|
1174
|
+
.prepare(
|
|
1175
|
+
`
|
|
1176
|
+
SELECT
|
|
1177
|
+
status,
|
|
1178
|
+
COUNT(*) as count
|
|
1179
|
+
FROM tasks
|
|
1180
|
+
GROUP BY status
|
|
1181
|
+
ORDER BY count DESC
|
|
1182
|
+
`,
|
|
1183
|
+
)
|
|
1184
|
+
.all();
|
|
1185
|
+
|
|
1186
|
+
console.log(chalk.cyan('Overall Statistics:'));
|
|
1187
|
+
console.log(` Total Swarms: ${overallStats.total_swarms}`);
|
|
1188
|
+
console.log(` Total Agents: ${overallStats.total_agents}`);
|
|
1189
|
+
console.log(` Total Tasks: ${overallStats.total_tasks}`);
|
|
1190
|
+
console.log(` Completed Tasks: ${overallStats.completed_tasks}`);
|
|
1191
|
+
console.log(
|
|
1192
|
+
` Success Rate: ${
|
|
1193
|
+
overallStats.total_tasks > 0
|
|
1194
|
+
? ((overallStats.completed_tasks / overallStats.total_tasks) * 100).toFixed(1) + '%'
|
|
1195
|
+
: 'N/A'
|
|
1196
|
+
}`,
|
|
1197
|
+
);
|
|
1198
|
+
|
|
1199
|
+
if (taskBreakdown.length > 0) {
|
|
1200
|
+
console.log('\n' + chalk.cyan('Task Status Breakdown:'));
|
|
1201
|
+
taskBreakdown.forEach((status) => {
|
|
1202
|
+
const percentage =
|
|
1203
|
+
overallStats.total_tasks > 0
|
|
1204
|
+
? ((status.count / overallStats.total_tasks) * 100).toFixed(1)
|
|
1205
|
+
: '0';
|
|
1206
|
+
const statusColor =
|
|
1207
|
+
status.status === 'completed'
|
|
1208
|
+
? 'green'
|
|
1209
|
+
: status.status === 'in_progress'
|
|
1210
|
+
? 'yellow'
|
|
1211
|
+
: status.status === 'failed'
|
|
1212
|
+
? 'red'
|
|
1213
|
+
: 'gray';
|
|
1214
|
+
console.log(
|
|
1215
|
+
` ${chalk[statusColor](status.status.charAt(0).toUpperCase() + status.status.slice(1))}: ${status.count} (${percentage}%)`,
|
|
1216
|
+
);
|
|
1217
|
+
});
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
// Get agent performance (check for completed_at column)
|
|
1221
|
+
let agentPerf = [];
|
|
1222
|
+
try {
|
|
1223
|
+
// Check if completed_at exists
|
|
1224
|
+
const hasCompletedAt = db
|
|
1225
|
+
.prepare(
|
|
1226
|
+
`
|
|
1227
|
+
SELECT COUNT(*) as count FROM pragma_table_info('tasks')
|
|
1228
|
+
WHERE name = 'completed_at'
|
|
1229
|
+
`,
|
|
1230
|
+
)
|
|
1231
|
+
.get();
|
|
1232
|
+
|
|
1233
|
+
if (hasCompletedAt && hasCompletedAt.count > 0) {
|
|
1234
|
+
agentPerf = db
|
|
1235
|
+
.prepare(
|
|
1236
|
+
`
|
|
1237
|
+
SELECT
|
|
1238
|
+
a.name,
|
|
1239
|
+
a.type,
|
|
1240
|
+
COUNT(t.id) as tasks_assigned,
|
|
1241
|
+
SUM(CASE WHEN t.status = 'completed' THEN 1 ELSE 0 END) as tasks_completed,
|
|
1242
|
+
AVG(CASE WHEN t.completed_at IS NOT NULL
|
|
1243
|
+
THEN (julianday(t.completed_at) - julianday(t.created_at)) * 24 * 60
|
|
1244
|
+
ELSE NULL END) as avg_completion_minutes
|
|
1245
|
+
FROM agents a
|
|
1246
|
+
LEFT JOIN tasks t ON a.id = t.agent_id
|
|
1247
|
+
GROUP BY a.id
|
|
1248
|
+
HAVING tasks_assigned > 0
|
|
1249
|
+
ORDER BY tasks_completed DESC
|
|
1250
|
+
LIMIT 10
|
|
1251
|
+
`,
|
|
1252
|
+
)
|
|
1253
|
+
.all();
|
|
1254
|
+
} else {
|
|
1255
|
+
// Simpler query without completed_at
|
|
1256
|
+
agentPerf = db
|
|
1257
|
+
.prepare(
|
|
1258
|
+
`
|
|
1259
|
+
SELECT
|
|
1260
|
+
a.name,
|
|
1261
|
+
a.type,
|
|
1262
|
+
COUNT(t.id) as tasks_assigned,
|
|
1263
|
+
SUM(CASE WHEN t.status = 'completed' THEN 1 ELSE 0 END) as tasks_completed,
|
|
1264
|
+
NULL as avg_completion_minutes
|
|
1265
|
+
FROM agents a
|
|
1266
|
+
LEFT JOIN tasks t ON a.id = t.agent_id
|
|
1267
|
+
GROUP BY a.id
|
|
1268
|
+
HAVING tasks_assigned > 0
|
|
1269
|
+
ORDER BY tasks_completed DESC
|
|
1270
|
+
LIMIT 10
|
|
1271
|
+
`,
|
|
1272
|
+
)
|
|
1273
|
+
.all();
|
|
1274
|
+
}
|
|
1275
|
+
} catch (error) {
|
|
1276
|
+
console.warn('Could not get agent performance:', error.message);
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
if (agentPerf.length > 0) {
|
|
1280
|
+
console.log('\n' + chalk.cyan('Top Performing Agents:'));
|
|
1281
|
+
agentPerf.forEach((agent, index) => {
|
|
1282
|
+
const successRate =
|
|
1283
|
+
agent.tasks_assigned > 0
|
|
1284
|
+
? ((agent.tasks_completed / agent.tasks_assigned) * 100).toFixed(1)
|
|
1285
|
+
: '0';
|
|
1286
|
+
console.log(` ${index + 1}. ${agent.name} (${agent.type})`);
|
|
1287
|
+
console.log(
|
|
1288
|
+
` Tasks: ${agent.tasks_completed}/${agent.tasks_assigned} (${successRate}%)`,
|
|
1289
|
+
);
|
|
1290
|
+
if (agent.avg_completion_minutes) {
|
|
1291
|
+
console.log(` Avg Time: ${agent.avg_completion_minutes.toFixed(1)} minutes`);
|
|
1292
|
+
}
|
|
1293
|
+
});
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
// Get swarm performance
|
|
1297
|
+
const swarmPerf = db
|
|
1298
|
+
.prepare(
|
|
1299
|
+
`
|
|
1300
|
+
SELECT
|
|
1301
|
+
s.name,
|
|
1302
|
+
s.objective,
|
|
1303
|
+
(SELECT COUNT(*) FROM agents a WHERE a.swarm_id = s.id) as agent_count,
|
|
1304
|
+
(SELECT COUNT(*) FROM tasks t WHERE t.swarm_id = s.id) as task_count,
|
|
1305
|
+
(SELECT COUNT(*) FROM tasks t WHERE t.swarm_id = s.id AND t.status = 'completed') as completed_count,
|
|
1306
|
+
(SELECT COUNT(*) FROM collective_memory cm WHERE cm.swarm_id = s.id) as memory_entries,
|
|
1307
|
+
(SELECT COUNT(*) FROM consensus_decisions cd WHERE cd.swarm_id = s.id) as consensus_count
|
|
1308
|
+
FROM swarms s
|
|
1309
|
+
WHERE s.status = 'active'
|
|
1310
|
+
ORDER BY s.created_at DESC
|
|
1311
|
+
LIMIT 5
|
|
1312
|
+
`,
|
|
1313
|
+
)
|
|
1314
|
+
.all();
|
|
1315
|
+
|
|
1316
|
+
if (swarmPerf.length > 0) {
|
|
1317
|
+
console.log('\n' + chalk.cyan('Active Swarm Performance:'));
|
|
1318
|
+
swarmPerf.forEach((swarm) => {
|
|
1319
|
+
const successRate =
|
|
1320
|
+
swarm.task_count > 0
|
|
1321
|
+
? ((swarm.completed_count / swarm.task_count) * 100).toFixed(1)
|
|
1322
|
+
: '0';
|
|
1323
|
+
console.log(`\n ${chalk.yellow(swarm.name)}`);
|
|
1324
|
+
console.log(` Objective: ${swarm.objective.substring(0, 50)}...`);
|
|
1325
|
+
console.log(
|
|
1326
|
+
` Agents: ${swarm.agent_count}, Tasks: ${swarm.completed_count}/${swarm.task_count} (${successRate}%)`,
|
|
1327
|
+
);
|
|
1328
|
+
console.log(
|
|
1329
|
+
` Memory: ${swarm.memory_entries} entries, Consensus: ${swarm.consensus_count} decisions`,
|
|
1330
|
+
);
|
|
1331
|
+
});
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
// Get performance insights
|
|
1335
|
+
let avgTaskTime = { avg_minutes: null };
|
|
1336
|
+
try {
|
|
1337
|
+
// Check if completed_at exists
|
|
1338
|
+
const hasCompletedAt = db
|
|
1339
|
+
.prepare(
|
|
1340
|
+
`
|
|
1341
|
+
SELECT COUNT(*) as count FROM pragma_table_info('tasks')
|
|
1342
|
+
WHERE name = 'completed_at'
|
|
1343
|
+
`,
|
|
1344
|
+
)
|
|
1345
|
+
.get();
|
|
1346
|
+
|
|
1347
|
+
if (hasCompletedAt && hasCompletedAt.count > 0) {
|
|
1348
|
+
avgTaskTime = db
|
|
1349
|
+
.prepare(
|
|
1350
|
+
`
|
|
1351
|
+
SELECT
|
|
1352
|
+
AVG(CASE WHEN completed_at IS NOT NULL
|
|
1353
|
+
THEN (julianday(completed_at) - julianday(created_at)) * 24 * 60
|
|
1354
|
+
ELSE NULL END) as avg_minutes
|
|
1355
|
+
FROM tasks
|
|
1356
|
+
WHERE status = 'completed'
|
|
1357
|
+
`,
|
|
1358
|
+
)
|
|
1359
|
+
.get();
|
|
1360
|
+
}
|
|
1361
|
+
} catch (error) {
|
|
1362
|
+
console.warn('Could not calculate average task time:', error.message);
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
// Get agent type performance
|
|
1366
|
+
let agentTypePerf = [];
|
|
1367
|
+
try {
|
|
1368
|
+
// Check if completed_at exists
|
|
1369
|
+
const hasCompletedAt = db
|
|
1370
|
+
.prepare(
|
|
1371
|
+
`
|
|
1372
|
+
SELECT COUNT(*) as count FROM pragma_table_info('tasks')
|
|
1373
|
+
WHERE name = 'completed_at'
|
|
1374
|
+
`,
|
|
1375
|
+
)
|
|
1376
|
+
.get();
|
|
1377
|
+
|
|
1378
|
+
if (hasCompletedAt && hasCompletedAt.count > 0) {
|
|
1379
|
+
agentTypePerf = db
|
|
1380
|
+
.prepare(
|
|
1381
|
+
`
|
|
1382
|
+
SELECT
|
|
1383
|
+
a.type,
|
|
1384
|
+
COUNT(t.id) as total_tasks,
|
|
1385
|
+
SUM(CASE WHEN t.status = 'completed' THEN 1 ELSE 0 END) as completed_tasks,
|
|
1386
|
+
AVG(CASE WHEN t.completed_at IS NOT NULL
|
|
1387
|
+
THEN (julianday(t.completed_at) - julianday(t.created_at)) * 24 * 60
|
|
1388
|
+
ELSE NULL END) as avg_completion_minutes
|
|
1389
|
+
FROM agents a
|
|
1390
|
+
LEFT JOIN tasks t ON a.id = t.agent_id
|
|
1391
|
+
GROUP BY a.type
|
|
1392
|
+
HAVING total_tasks > 0
|
|
1393
|
+
ORDER BY completed_tasks DESC
|
|
1394
|
+
`,
|
|
1395
|
+
)
|
|
1396
|
+
.all();
|
|
1397
|
+
} else {
|
|
1398
|
+
// Simpler query without completed_at
|
|
1399
|
+
agentTypePerf = db
|
|
1400
|
+
.prepare(
|
|
1401
|
+
`
|
|
1402
|
+
SELECT
|
|
1403
|
+
a.type,
|
|
1404
|
+
COUNT(t.id) as total_tasks,
|
|
1405
|
+
SUM(CASE WHEN t.status = 'completed' THEN 1 ELSE 0 END) as completed_tasks,
|
|
1406
|
+
NULL as avg_completion_minutes
|
|
1407
|
+
FROM agents a
|
|
1408
|
+
LEFT JOIN tasks t ON a.id = t.agent_id
|
|
1409
|
+
GROUP BY a.type
|
|
1410
|
+
HAVING total_tasks > 0
|
|
1411
|
+
ORDER BY completed_tasks DESC
|
|
1412
|
+
`,
|
|
1413
|
+
)
|
|
1414
|
+
.all();
|
|
1415
|
+
}
|
|
1416
|
+
} catch (error) {
|
|
1417
|
+
console.warn('Could not get agent type performance:', error.message);
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
if (avgTaskTime.avg_minutes) {
|
|
1421
|
+
console.log('\n' + chalk.cyan('Performance Insights:'));
|
|
1422
|
+
console.log(` Average Task Completion Time: ${avgTaskTime.avg_minutes.toFixed(1)} minutes`);
|
|
1423
|
+
|
|
1424
|
+
if (agentTypePerf.length > 0) {
|
|
1425
|
+
console.log('\n' + chalk.cyan('Agent Type Performance:'));
|
|
1426
|
+
agentTypePerf.forEach((type) => {
|
|
1427
|
+
const successRate =
|
|
1428
|
+
type.total_tasks > 0
|
|
1429
|
+
? ((type.completed_tasks / type.total_tasks) * 100).toFixed(1)
|
|
1430
|
+
: '0';
|
|
1431
|
+
console.log(
|
|
1432
|
+
` ${type.type.charAt(0).toUpperCase() + type.type.slice(1)}: ${type.completed_tasks}/${type.total_tasks} (${successRate}%)`,
|
|
1433
|
+
);
|
|
1434
|
+
if (type.avg_completion_minutes) {
|
|
1435
|
+
console.log(` Average time: ${type.avg_completion_minutes.toFixed(1)} minutes`);
|
|
1436
|
+
}
|
|
1437
|
+
});
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
console.log('\n');
|
|
1442
|
+
db.close();
|
|
1443
|
+
} catch (error) {
|
|
1444
|
+
console.error(chalk.red('Error:'), error.message);
|
|
1445
|
+
exit(1);
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
/**
|
|
1450
|
+
* Manage collective memory wizard
|
|
1451
|
+
*/
|
|
1452
|
+
async function manageMemoryWizard() {
|
|
1453
|
+
console.log(chalk.blue('\n🧠 Collective Memory Management\n'));
|
|
1454
|
+
|
|
1455
|
+
const { action } = await inquirer.prompt([
|
|
1456
|
+
{
|
|
1457
|
+
type: 'list',
|
|
1458
|
+
name: 'action',
|
|
1459
|
+
message: 'What would you like to do with collective memory?',
|
|
1460
|
+
choices: [
|
|
1461
|
+
{ name: '📋 View all memories', value: 'list' },
|
|
1462
|
+
{ name: '🔍 Search memories', value: 'search' },
|
|
1463
|
+
{ name: '💾 Store new memory', value: 'store' },
|
|
1464
|
+
{ name: '📊 Memory statistics', value: 'stats' },
|
|
1465
|
+
{ name: '🗑️ Clean old memories', value: 'clean' },
|
|
1466
|
+
{ name: '📤 Export memory backup', value: 'export' },
|
|
1467
|
+
{ name: '⬅️ Back to main menu', value: 'back' },
|
|
1468
|
+
],
|
|
1469
|
+
},
|
|
1470
|
+
]);
|
|
1471
|
+
|
|
1472
|
+
switch (action) {
|
|
1473
|
+
case 'list':
|
|
1474
|
+
await listMemories();
|
|
1475
|
+
break;
|
|
1476
|
+
case 'search':
|
|
1477
|
+
await searchMemories();
|
|
1478
|
+
break;
|
|
1479
|
+
case 'store':
|
|
1480
|
+
await storeMemoryWizard();
|
|
1481
|
+
break;
|
|
1482
|
+
case 'stats':
|
|
1483
|
+
await showMemoryStats();
|
|
1484
|
+
break;
|
|
1485
|
+
case 'clean':
|
|
1486
|
+
await cleanMemories();
|
|
1487
|
+
break;
|
|
1488
|
+
case 'export':
|
|
1489
|
+
await exportMemoryBackup();
|
|
1490
|
+
break;
|
|
1491
|
+
case 'back':
|
|
1492
|
+
await hiveMindWizard();
|
|
1493
|
+
return;
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
// Ask if user wants to continue
|
|
1497
|
+
const { continue: continueAction } = await inquirer.prompt([
|
|
1498
|
+
{
|
|
1499
|
+
type: 'confirm',
|
|
1500
|
+
name: 'continue',
|
|
1501
|
+
message: 'Would you like to perform another memory operation?',
|
|
1502
|
+
default: true,
|
|
1503
|
+
},
|
|
1504
|
+
]);
|
|
1505
|
+
|
|
1506
|
+
if (continueAction) {
|
|
1507
|
+
await manageMemoryWizard();
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
/**
|
|
1512
|
+
* Configure hive mind wizard
|
|
1513
|
+
*/
|
|
1514
|
+
async function configureWizard() {
|
|
1515
|
+
// TODO: Implement configuration wizard
|
|
1516
|
+
console.log(chalk.yellow('Configuration wizard coming soon...'));
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
/**
|
|
1520
|
+
* Main hive mind command handler
|
|
1521
|
+
*/
|
|
1522
|
+
export async function hiveMindCommand(args, flags) {
|
|
1523
|
+
const subcommand = args[0];
|
|
1524
|
+
const subArgs = args.slice(1);
|
|
1525
|
+
|
|
1526
|
+
// Handle help flags
|
|
1527
|
+
if (
|
|
1528
|
+
!subcommand ||
|
|
1529
|
+
subcommand === '--help' ||
|
|
1530
|
+
subcommand === '-h' ||
|
|
1531
|
+
subcommand === 'help' ||
|
|
1532
|
+
flags.help
|
|
1533
|
+
) {
|
|
1534
|
+
showHiveMindHelp();
|
|
1535
|
+
return;
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
// Warn about non-interactive environments for certain commands
|
|
1539
|
+
if ((subcommand === 'spawn' && (flags.claude || flags.spawn)) || subcommand === 'wizard') {
|
|
1540
|
+
warnNonInteractive('hive-mind ' + subcommand);
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
switch (subcommand) {
|
|
1544
|
+
case 'init':
|
|
1545
|
+
await initHiveMind(flags);
|
|
1546
|
+
break;
|
|
1547
|
+
|
|
1548
|
+
case 'spawn':
|
|
1549
|
+
// Check for non-interactive mode FIRST (like alpha.83)
|
|
1550
|
+
if (flags['non-interactive'] || flags.nonInteractive) {
|
|
1551
|
+
// In non-interactive mode, skip wizard and use defaults
|
|
1552
|
+
if (subArgs.length === 0) {
|
|
1553
|
+
console.error(chalk.red('Error: Objective required in non-interactive mode'));
|
|
1554
|
+
console.log('Usage: claude-flow hive-mind spawn "Your objective" --non-interactive');
|
|
1555
|
+
return;
|
|
1556
|
+
}
|
|
1557
|
+
await spawnSwarm(subArgs, flags);
|
|
1558
|
+
} else if (flags.wizard || subArgs.length === 0) {
|
|
1559
|
+
await spawnSwarmWizard();
|
|
1560
|
+
} else {
|
|
1561
|
+
await spawnSwarm(subArgs, flags);
|
|
1562
|
+
}
|
|
1563
|
+
break;
|
|
1564
|
+
|
|
1565
|
+
case 'status':
|
|
1566
|
+
await showStatus(flags);
|
|
1567
|
+
break;
|
|
1568
|
+
|
|
1569
|
+
case 'sessions':
|
|
1570
|
+
await showSessions(flags);
|
|
1571
|
+
break;
|
|
1572
|
+
|
|
1573
|
+
case 'resume':
|
|
1574
|
+
await resumeSession(subArgs, flags);
|
|
1575
|
+
break;
|
|
1576
|
+
|
|
1577
|
+
case 'stop':
|
|
1578
|
+
await stopSession(subArgs, flags);
|
|
1579
|
+
break;
|
|
1580
|
+
|
|
1581
|
+
case 'consensus':
|
|
1582
|
+
await showConsensus(flags);
|
|
1583
|
+
break;
|
|
1584
|
+
|
|
1585
|
+
case 'memory':
|
|
1586
|
+
await manageMemoryWizard();
|
|
1587
|
+
break;
|
|
1588
|
+
|
|
1589
|
+
case 'metrics':
|
|
1590
|
+
await showMetrics(flags);
|
|
1591
|
+
break;
|
|
1592
|
+
|
|
1593
|
+
case 'wizard':
|
|
1594
|
+
await hiveMindWizard(flags);
|
|
1595
|
+
break;
|
|
1596
|
+
|
|
1597
|
+
case 'help':
|
|
1598
|
+
case '--help':
|
|
1599
|
+
case '-h':
|
|
1600
|
+
showHiveMindHelp();
|
|
1601
|
+
break;
|
|
1602
|
+
|
|
1603
|
+
default:
|
|
1604
|
+
console.error(chalk.red(`Unknown subcommand: ${subcommand}`));
|
|
1605
|
+
console.log('Run "claude-flow hive-mind help" for usage information');
|
|
1606
|
+
exit(1);
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
/**
|
|
1611
|
+
* List all memories in the collective memory store
|
|
1612
|
+
*/
|
|
1613
|
+
async function listMemories() {
|
|
1614
|
+
try {
|
|
1615
|
+
console.log(chalk.blue('\n📋 Collective Memory Store\n'));
|
|
1616
|
+
|
|
1617
|
+
// Read directly from hive.db collective_memory table
|
|
1618
|
+
const dbPath = path.join(cwd(), '.hive-mind', 'hive.db');
|
|
1619
|
+
const db = new Database(dbPath);
|
|
1620
|
+
|
|
1621
|
+
const memories = db
|
|
1622
|
+
.prepare(
|
|
1623
|
+
`
|
|
1624
|
+
SELECT cm.*, s.name as swarm_name
|
|
1625
|
+
FROM collective_memory cm
|
|
1626
|
+
LEFT JOIN swarms s ON cm.swarm_id = s.id
|
|
1627
|
+
ORDER BY cm.created_at DESC
|
|
1628
|
+
LIMIT 50
|
|
1629
|
+
`,
|
|
1630
|
+
)
|
|
1631
|
+
.all();
|
|
1632
|
+
|
|
1633
|
+
db.close();
|
|
1634
|
+
|
|
1635
|
+
if (!memories || memories.length === 0) {
|
|
1636
|
+
console.log(chalk.yellow('No memories found in the collective store.'));
|
|
1637
|
+
console.log(
|
|
1638
|
+
chalk.gray('Try storing some memories first using the "💾 Store new memory" option.'),
|
|
1639
|
+
);
|
|
1640
|
+
return;
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
console.log(chalk.gray(`Found ${memories.length} memories in the collective store:\n`));
|
|
1644
|
+
|
|
1645
|
+
memories.forEach((memory, index) => {
|
|
1646
|
+
console.log(chalk.cyan(`${index + 1}. ${memory.key}`));
|
|
1647
|
+
console.log(` Swarm: ${memory.swarm_name || memory.swarm_id}`);
|
|
1648
|
+
console.log(` Type: ${memory.type || 'knowledge'}`);
|
|
1649
|
+
console.log(` Created: ${new Date(memory.created_at).toLocaleString()}`);
|
|
1650
|
+
console.log(` Created by: ${memory.created_by || 'system'}`);
|
|
1651
|
+
|
|
1652
|
+
// Parse and display value
|
|
1653
|
+
let displayValue = memory.value;
|
|
1654
|
+
try {
|
|
1655
|
+
const parsed = JSON.parse(memory.value);
|
|
1656
|
+
displayValue = JSON.stringify(parsed);
|
|
1657
|
+
} catch {
|
|
1658
|
+
// Keep as string
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
if (displayValue.length > 100) {
|
|
1662
|
+
console.log(` Value: ${displayValue.substring(0, 100)}...`);
|
|
1663
|
+
} else {
|
|
1664
|
+
console.log(` Value: ${displayValue}`);
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
if (memory.confidence !== null && memory.confidence !== 1) {
|
|
1668
|
+
console.log(` Confidence: ${(memory.confidence * 100).toFixed(1)}%`);
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
console.log('');
|
|
1672
|
+
});
|
|
1673
|
+
} catch (error) {
|
|
1674
|
+
console.error(chalk.red('Error listing memories:'), error.message);
|
|
1675
|
+
console.log(chalk.gray('This might be because no memories have been stored yet.'));
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
/**
|
|
1680
|
+
* Search memories by keyword
|
|
1681
|
+
*/
|
|
1682
|
+
async function searchMemories() {
|
|
1683
|
+
try {
|
|
1684
|
+
const { searchTerm } = await inquirer.prompt([
|
|
1685
|
+
{
|
|
1686
|
+
type: 'input',
|
|
1687
|
+
name: 'searchTerm',
|
|
1688
|
+
message: 'Enter search term:',
|
|
1689
|
+
validate: (input) => input.length > 0,
|
|
1690
|
+
},
|
|
1691
|
+
]);
|
|
1692
|
+
|
|
1693
|
+
console.log(chalk.blue(`\n🔍 Searching for: "${searchTerm}"\n`));
|
|
1694
|
+
|
|
1695
|
+
// Search directly in hive.db collective_memory table
|
|
1696
|
+
const dbPath = path.join(cwd(), '.hive-mind', 'hive.db');
|
|
1697
|
+
const db = new Database(dbPath);
|
|
1698
|
+
|
|
1699
|
+
const searchPattern = `%${searchTerm}%`;
|
|
1700
|
+
const memories = db
|
|
1701
|
+
.prepare(
|
|
1702
|
+
`
|
|
1703
|
+
SELECT cm.*, s.name as swarm_name
|
|
1704
|
+
FROM collective_memory cm
|
|
1705
|
+
LEFT JOIN swarms s ON cm.swarm_id = s.id
|
|
1706
|
+
WHERE cm.key LIKE ? OR cm.value LIKE ? OR cm.type LIKE ?
|
|
1707
|
+
ORDER BY cm.created_at DESC
|
|
1708
|
+
LIMIT 50
|
|
1709
|
+
`,
|
|
1710
|
+
)
|
|
1711
|
+
.all(searchPattern, searchPattern, searchPattern);
|
|
1712
|
+
|
|
1713
|
+
db.close();
|
|
1714
|
+
|
|
1715
|
+
if (!memories || memories.length === 0) {
|
|
1716
|
+
console.log(chalk.yellow('No memories found matching your search.'));
|
|
1717
|
+
return;
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
console.log(chalk.gray(`Found ${memories.length} memories matching "${searchTerm}":\n`));
|
|
1721
|
+
|
|
1722
|
+
memories.forEach((memory, index) => {
|
|
1723
|
+
console.log(chalk.green(`${index + 1}. ${memory.key}`));
|
|
1724
|
+
console.log(` Swarm: ${memory.swarm_name || memory.swarm_id}`);
|
|
1725
|
+
console.log(` Type: ${memory.type || 'knowledge'}`);
|
|
1726
|
+
console.log(` Created: ${new Date(memory.created_at).toLocaleString()}`);
|
|
1727
|
+
|
|
1728
|
+
// Parse and display value with highlighting
|
|
1729
|
+
let displayValue = memory.value;
|
|
1730
|
+
try {
|
|
1731
|
+
const parsed = JSON.parse(memory.value);
|
|
1732
|
+
displayValue = JSON.stringify(parsed, null, 2);
|
|
1733
|
+
} catch {
|
|
1734
|
+
// Keep as string
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
console.log(` Value: ${displayValue}`);
|
|
1738
|
+
console.log('');
|
|
1739
|
+
});
|
|
1740
|
+
} catch (error) {
|
|
1741
|
+
console.error(chalk.red('Error searching memories:'), error.message);
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
/**
|
|
1746
|
+
* Store new memory wizard
|
|
1747
|
+
*/
|
|
1748
|
+
async function storeMemoryWizard() {
|
|
1749
|
+
try {
|
|
1750
|
+
const answers = await inquirer.prompt([
|
|
1751
|
+
{
|
|
1752
|
+
type: 'input',
|
|
1753
|
+
name: 'key',
|
|
1754
|
+
message: 'Memory key (identifier):',
|
|
1755
|
+
validate: (input) => input.length > 0,
|
|
1756
|
+
},
|
|
1757
|
+
{
|
|
1758
|
+
type: 'list',
|
|
1759
|
+
name: 'category',
|
|
1760
|
+
message: 'Memory category:',
|
|
1761
|
+
choices: [
|
|
1762
|
+
'consensus',
|
|
1763
|
+
'decision',
|
|
1764
|
+
'pattern',
|
|
1765
|
+
'learning',
|
|
1766
|
+
'coordination',
|
|
1767
|
+
'performance',
|
|
1768
|
+
'configuration',
|
|
1769
|
+
'general',
|
|
1770
|
+
],
|
|
1771
|
+
},
|
|
1772
|
+
{
|
|
1773
|
+
type: 'editor',
|
|
1774
|
+
name: 'value',
|
|
1775
|
+
message: 'Memory content (JSON or text):',
|
|
1776
|
+
},
|
|
1777
|
+
]);
|
|
1778
|
+
|
|
1779
|
+
const mcpWrapper = await getMcpWrapper();
|
|
1780
|
+
let memoryValue;
|
|
1781
|
+
|
|
1782
|
+
// Try to parse as JSON, fall back to string
|
|
1783
|
+
try {
|
|
1784
|
+
memoryValue = JSON.parse(answers.value);
|
|
1785
|
+
} catch {
|
|
1786
|
+
memoryValue = answers.value;
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
await mcpWrapper.storeMemory('hive-mind', answers.key, memoryValue, answers.category);
|
|
1790
|
+
|
|
1791
|
+
console.log(chalk.green(`\n✅ Memory stored successfully!`));
|
|
1792
|
+
console.log(`Key: ${answers.key}`);
|
|
1793
|
+
console.log(`Category: ${answers.category}`);
|
|
1794
|
+
} catch (error) {
|
|
1795
|
+
console.error(chalk.red('Error storing memory:'), error.message);
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
/**
|
|
1800
|
+
* Show memory statistics
|
|
1801
|
+
*/
|
|
1802
|
+
async function showMemoryStats() {
|
|
1803
|
+
try {
|
|
1804
|
+
console.log(chalk.blue('\n📊 Memory Statistics\n'));
|
|
1805
|
+
|
|
1806
|
+
const mcpWrapper = await getMcpWrapper();
|
|
1807
|
+
|
|
1808
|
+
// Search for all memories with an empty pattern to get everything
|
|
1809
|
+
const searchResult = await mcpWrapper.searchMemory('hive-mind', '');
|
|
1810
|
+
|
|
1811
|
+
// Handle different possible response structures
|
|
1812
|
+
let memories = [];
|
|
1813
|
+
if (searchResult && Array.isArray(searchResult.results)) {
|
|
1814
|
+
memories = searchResult.results;
|
|
1815
|
+
} else if (searchResult && Array.isArray(searchResult)) {
|
|
1816
|
+
memories = searchResult;
|
|
1817
|
+
} else if (searchResult && searchResult.data && Array.isArray(searchResult.data)) {
|
|
1818
|
+
memories = searchResult.data;
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
if (!memories || memories.length === 0) {
|
|
1822
|
+
console.log(chalk.yellow('No memories found.'));
|
|
1823
|
+
console.log(chalk.gray('Use "Store new memory" to create your first memory.'));
|
|
1824
|
+
return;
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
// Calculate statistics
|
|
1828
|
+
const stats = {
|
|
1829
|
+
total: memories.length,
|
|
1830
|
+
categories: {},
|
|
1831
|
+
oldestDate: null,
|
|
1832
|
+
newestDate: null,
|
|
1833
|
+
totalSize: 0,
|
|
1834
|
+
};
|
|
1835
|
+
|
|
1836
|
+
memories.forEach((memory) => {
|
|
1837
|
+
// Count by category
|
|
1838
|
+
const category = memory.category || memory.type || 'general';
|
|
1839
|
+
stats.categories[category] = (stats.categories[category] || 0) + 1;
|
|
1840
|
+
|
|
1841
|
+
// Track dates
|
|
1842
|
+
const date = new Date(memory.timestamp || Date.now());
|
|
1843
|
+
if (!stats.oldestDate || date < stats.oldestDate) {
|
|
1844
|
+
stats.oldestDate = date;
|
|
1845
|
+
}
|
|
1846
|
+
if (!stats.newestDate || date > stats.newestDate) {
|
|
1847
|
+
stats.newestDate = date;
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
// Estimate size
|
|
1851
|
+
stats.totalSize += JSON.stringify(memory).length;
|
|
1852
|
+
});
|
|
1853
|
+
|
|
1854
|
+
console.log(chalk.cyan('Total memories:'), stats.total);
|
|
1855
|
+
console.log(chalk.cyan('Estimated size:'), `${(stats.totalSize / 1024).toFixed(2)} KB`);
|
|
1856
|
+
console.log(
|
|
1857
|
+
chalk.cyan('Date range:'),
|
|
1858
|
+
`${stats.oldestDate?.toLocaleDateString()} - ${stats.newestDate?.toLocaleDateString()}`,
|
|
1859
|
+
);
|
|
1860
|
+
|
|
1861
|
+
console.log(chalk.cyan('\nBy category:'));
|
|
1862
|
+
Object.entries(stats.categories).forEach(([category, count]) => {
|
|
1863
|
+
console.log(` ${category}: ${count}`);
|
|
1864
|
+
});
|
|
1865
|
+
} catch (error) {
|
|
1866
|
+
console.error(chalk.red('Error getting memory stats:'), error.message);
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
/**
|
|
1871
|
+
* Clean old memories
|
|
1872
|
+
*/
|
|
1873
|
+
async function cleanMemories() {
|
|
1874
|
+
try {
|
|
1875
|
+
const { days } = await inquirer.prompt([
|
|
1876
|
+
{
|
|
1877
|
+
type: 'number',
|
|
1878
|
+
name: 'days',
|
|
1879
|
+
message: 'Remove memories older than how many days?',
|
|
1880
|
+
default: 30,
|
|
1881
|
+
validate: (input) => input > 0,
|
|
1882
|
+
},
|
|
1883
|
+
]);
|
|
1884
|
+
|
|
1885
|
+
const { confirm } = await inquirer.prompt([
|
|
1886
|
+
{
|
|
1887
|
+
type: 'confirm',
|
|
1888
|
+
name: 'confirm',
|
|
1889
|
+
message: `Are you sure you want to delete memories older than ${days} days?`,
|
|
1890
|
+
default: false,
|
|
1891
|
+
},
|
|
1892
|
+
]);
|
|
1893
|
+
|
|
1894
|
+
if (!confirm) {
|
|
1895
|
+
console.log(chalk.yellow('Operation cancelled.'));
|
|
1896
|
+
return;
|
|
1897
|
+
}
|
|
1898
|
+
|
|
1899
|
+
const mcpWrapper = await getMcpWrapper();
|
|
1900
|
+
|
|
1901
|
+
// Get all memories first
|
|
1902
|
+
const searchResult = await mcpWrapper.searchMemory('hive-mind', '');
|
|
1903
|
+
|
|
1904
|
+
// Handle different possible response structures
|
|
1905
|
+
let memories = [];
|
|
1906
|
+
if (searchResult && Array.isArray(searchResult.results)) {
|
|
1907
|
+
memories = searchResult.results;
|
|
1908
|
+
} else if (searchResult && Array.isArray(searchResult)) {
|
|
1909
|
+
memories = searchResult;
|
|
1910
|
+
} else if (searchResult && searchResult.data && Array.isArray(searchResult.data)) {
|
|
1911
|
+
memories = searchResult.data;
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
const cutoffDate = new Date();
|
|
1915
|
+
cutoffDate.setDate(cutoffDate.getDate() - days);
|
|
1916
|
+
|
|
1917
|
+
// Filter memories older than cutoff date
|
|
1918
|
+
const oldMemories = memories.filter((memory) => {
|
|
1919
|
+
const memoryDate = new Date(memory.timestamp || 0);
|
|
1920
|
+
return memoryDate < cutoffDate;
|
|
1921
|
+
});
|
|
1922
|
+
|
|
1923
|
+
if (oldMemories.length === 0) {
|
|
1924
|
+
console.log(chalk.yellow('\n🎉 No old memories found to clean.'));
|
|
1925
|
+
return;
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
console.log(chalk.green(`\n✅ Found ${oldMemories.length} old memories to clean.`));
|
|
1929
|
+
console.log(chalk.gray('Note: Individual memory deletion not yet implemented in MCPWrapper.'));
|
|
1930
|
+
console.log(chalk.gray('Consider implementing batch deletion or memory lifecycle management.'));
|
|
1931
|
+
} catch (error) {
|
|
1932
|
+
console.error(chalk.red('Error cleaning memories:'), error.message);
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
/**
|
|
1937
|
+
* Export memory backup
|
|
1938
|
+
*/
|
|
1939
|
+
async function exportMemoryBackup() {
|
|
1940
|
+
try {
|
|
1941
|
+
const { filename } = await inquirer.prompt([
|
|
1942
|
+
{
|
|
1943
|
+
type: 'input',
|
|
1944
|
+
name: 'filename',
|
|
1945
|
+
message: 'Export filename:',
|
|
1946
|
+
default: `hive-mind-memory-backup-${new Date().toISOString().split('T')[0]}.json`,
|
|
1947
|
+
},
|
|
1948
|
+
]);
|
|
1949
|
+
|
|
1950
|
+
const mcpWrapper = await getMcpWrapper();
|
|
1951
|
+
|
|
1952
|
+
// Get all memories using search
|
|
1953
|
+
const searchResult = await mcpWrapper.searchMemory('hive-mind', '');
|
|
1954
|
+
|
|
1955
|
+
// Handle different possible response structures
|
|
1956
|
+
let memories = [];
|
|
1957
|
+
if (searchResult && Array.isArray(searchResult.results)) {
|
|
1958
|
+
memories = searchResult.results;
|
|
1959
|
+
} else if (searchResult && Array.isArray(searchResult)) {
|
|
1960
|
+
memories = searchResult;
|
|
1961
|
+
} else if (searchResult && searchResult.data && Array.isArray(searchResult.data)) {
|
|
1962
|
+
memories = searchResult.data;
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
const backup = {
|
|
1966
|
+
exportDate: new Date().toISOString(),
|
|
1967
|
+
version: '1.0',
|
|
1968
|
+
totalMemories: memories.length,
|
|
1969
|
+
namespace: 'hive-mind',
|
|
1970
|
+
memories: memories,
|
|
1971
|
+
};
|
|
1972
|
+
|
|
1973
|
+
const fs = await import('fs');
|
|
1974
|
+
fs.writeFileSync(filename, JSON.stringify(backup, null, 2));
|
|
1975
|
+
|
|
1976
|
+
console.log(chalk.green(`\n✅ Memory backup exported to: ${filename}`));
|
|
1977
|
+
console.log(chalk.cyan(`Exported ${memories.length} memories`));
|
|
1978
|
+
} catch (error) {
|
|
1979
|
+
console.error(chalk.red('Error exporting memory backup:'), error.message);
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
/**
|
|
1984
|
+
* Get active session ID for a swarm
|
|
1985
|
+
*/
|
|
1986
|
+
async function getActiveSessionId(swarmId) {
|
|
1987
|
+
const sessionManager = new HiveMindSessionManager();
|
|
1988
|
+
try {
|
|
1989
|
+
const sessions = await sessionManager.getActiveSessions();
|
|
1990
|
+
const activeSession = sessions.find((s) => s.swarm_id === swarmId && s.status === 'active');
|
|
1991
|
+
return activeSession ? activeSession.id : null;
|
|
1992
|
+
} finally {
|
|
1993
|
+
sessionManager.close();
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
/**
|
|
1998
|
+
* Spawn Claude Code with Hive Mind coordination instructions
|
|
1999
|
+
*/
|
|
2000
|
+
async function spawnClaudeCodeInstances(swarmId, swarmName, objective, workers, flags) {
|
|
2001
|
+
console.log('\n' + chalk.bold('🚀 Launching Claude Code with Hive Mind Coordination'));
|
|
2002
|
+
console.log(chalk.gray('─'.repeat(60)));
|
|
2003
|
+
|
|
2004
|
+
const spinner = ora('Preparing Hive Mind coordination prompt...').start();
|
|
2005
|
+
|
|
2006
|
+
try {
|
|
2007
|
+
// Generate comprehensive Hive Mind prompt
|
|
2008
|
+
const workerGroups = groupWorkersByType(workers);
|
|
2009
|
+
const hiveMindPrompt = generateHiveMindPrompt(
|
|
2010
|
+
swarmId,
|
|
2011
|
+
swarmName,
|
|
2012
|
+
objective,
|
|
2013
|
+
workers,
|
|
2014
|
+
workerGroups,
|
|
2015
|
+
flags,
|
|
2016
|
+
);
|
|
2017
|
+
|
|
2018
|
+
spinner.succeed('Hive Mind coordination prompt ready!');
|
|
2019
|
+
|
|
2020
|
+
// Display coordination summary
|
|
2021
|
+
console.log('\n' + chalk.bold('🧠 Hive Mind Configuration'));
|
|
2022
|
+
console.log(chalk.gray('─'.repeat(60)));
|
|
2023
|
+
console.log(chalk.cyan('Swarm ID:'), swarmId);
|
|
2024
|
+
console.log(chalk.cyan('Objective:'), objective);
|
|
2025
|
+
console.log(chalk.cyan('Queen Type:'), flags.queenType || 'strategic');
|
|
2026
|
+
console.log(chalk.cyan('Worker Count:'), workers.length);
|
|
2027
|
+
console.log(chalk.cyan('Worker Types:'), Object.keys(workerGroups).join(', '));
|
|
2028
|
+
console.log(chalk.cyan('Consensus Algorithm:'), flags.consensus || 'majority');
|
|
2029
|
+
console.log(chalk.cyan('MCP Tools:'), 'Full Claude-Flow integration enabled');
|
|
2030
|
+
|
|
2031
|
+
try {
|
|
2032
|
+
// ALWAYS save the prompt file first (fix for issue #330)
|
|
2033
|
+
// Ensure sessions directory exists
|
|
2034
|
+
const sessionsDir = path.join('.hive-mind', 'sessions');
|
|
2035
|
+
await mkdirAsync(sessionsDir, { recursive: true });
|
|
2036
|
+
|
|
2037
|
+
const promptFile = path.join(sessionsDir, `hive-mind-prompt-${swarmId}.txt`);
|
|
2038
|
+
await writeFile(promptFile, hiveMindPrompt, 'utf8');
|
|
2039
|
+
console.log(chalk.green(`\n✓ Hive Mind prompt saved to: ${promptFile}`));
|
|
2040
|
+
|
|
2041
|
+
// Check if claude command exists
|
|
2042
|
+
const { spawn: childSpawn, execSync } = await import('child_process');
|
|
2043
|
+
let claudeAvailable = false;
|
|
2044
|
+
|
|
2045
|
+
try {
|
|
2046
|
+
execSync('which claude', { stdio: 'ignore' });
|
|
2047
|
+
claudeAvailable = true;
|
|
2048
|
+
} catch {
|
|
2049
|
+
console.log(chalk.yellow('\n⚠️ Claude Code CLI not found in PATH'));
|
|
2050
|
+
console.log(chalk.gray('Install it with: npm install -g @anthropic-ai/claude-code'));
|
|
2051
|
+
console.log(chalk.gray('\nFalling back to displaying instructions...'));
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2054
|
+
if (claudeAvailable && !flags.dryRun) {
|
|
2055
|
+
// Check if we should run in non-interactive mode
|
|
2056
|
+
// Respect --non-interactive flag regardless of --claude
|
|
2057
|
+
const isNonInteractive = flags['non-interactive'] || flags.nonInteractive;
|
|
2058
|
+
|
|
2059
|
+
// Build arguments in correct order: flags first, then prompt
|
|
2060
|
+
const claudeArgs = [];
|
|
2061
|
+
|
|
2062
|
+
// Add non-interactive flags FIRST if needed
|
|
2063
|
+
if (isNonInteractive) {
|
|
2064
|
+
claudeArgs.push('-p'); // Print mode
|
|
2065
|
+
claudeArgs.push('--output-format', 'stream-json'); // JSON streaming
|
|
2066
|
+
claudeArgs.push('--verbose'); // Verbose output
|
|
2067
|
+
console.log(chalk.cyan('🤖 Running in non-interactive mode'));
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
// Add auto-permission flag BEFORE the prompt
|
|
2071
|
+
if (flags['dangerously-skip-permissions'] !== false && !flags['no-auto-permissions']) {
|
|
2072
|
+
claudeArgs.push('--dangerously-skip-permissions');
|
|
2073
|
+
if (!isNonInteractive) {
|
|
2074
|
+
console.log(
|
|
2075
|
+
chalk.yellow(
|
|
2076
|
+
'🔓 Using --dangerously-skip-permissions by default for seamless hive-mind execution',
|
|
2077
|
+
),
|
|
2078
|
+
);
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
// Add the prompt as the LAST argument
|
|
2083
|
+
claudeArgs.push(hiveMindPrompt);
|
|
2084
|
+
|
|
2085
|
+
// Spawn claude with properly ordered arguments
|
|
2086
|
+
const claudeProcess = childSpawn('claude', claudeArgs, {
|
|
2087
|
+
stdio: 'inherit',
|
|
2088
|
+
shell: false,
|
|
2089
|
+
});
|
|
2090
|
+
|
|
2091
|
+
// Track child process PID in session
|
|
2092
|
+
const sessionManager = new HiveMindSessionManager();
|
|
2093
|
+
const sessionId = await getActiveSessionId(swarmId);
|
|
2094
|
+
if (sessionId && claudeProcess.pid) {
|
|
2095
|
+
sessionManager.addChildPid(sessionId, claudeProcess.pid);
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
// Set up SIGINT handler for automatic session pausing
|
|
2099
|
+
let isExiting = false;
|
|
2100
|
+
const sigintHandler = async () => {
|
|
2101
|
+
if (isExiting) return;
|
|
2102
|
+
isExiting = true;
|
|
2103
|
+
|
|
2104
|
+
console.log('\n\n' + chalk.yellow('⏸️ Pausing session and terminating Claude Code...'));
|
|
2105
|
+
|
|
2106
|
+
try {
|
|
2107
|
+
// Terminate Claude Code process
|
|
2108
|
+
if (claudeProcess && !claudeProcess.killed) {
|
|
2109
|
+
claudeProcess.kill('SIGTERM');
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
// Save checkpoint and pause session
|
|
2113
|
+
if (sessionId) {
|
|
2114
|
+
const checkpointData = {
|
|
2115
|
+
timestamp: new Date().toISOString(),
|
|
2116
|
+
swarmId,
|
|
2117
|
+
objective,
|
|
2118
|
+
status: 'paused_by_user',
|
|
2119
|
+
reason: 'User pressed Ctrl+C during Claude Code execution',
|
|
2120
|
+
claudePid: claudeProcess.pid,
|
|
2121
|
+
};
|
|
2122
|
+
|
|
2123
|
+
await sessionManager.saveCheckpoint(sessionId, 'auto-pause-claude', checkpointData);
|
|
2124
|
+
await sessionManager.pauseSession(sessionId);
|
|
2125
|
+
|
|
2126
|
+
console.log(chalk.green('✓') + ' Session paused successfully');
|
|
2127
|
+
console.log(chalk.cyan('\nTo resume this session, run:'));
|
|
2128
|
+
console.log(chalk.bold(` claude-flow hive-mind resume ${sessionId}`));
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2131
|
+
sessionManager.close();
|
|
2132
|
+
process.exit(0);
|
|
2133
|
+
} catch (error) {
|
|
2134
|
+
console.error(chalk.red('Error pausing session:'), error.message);
|
|
2135
|
+
sessionManager.close();
|
|
2136
|
+
process.exit(1);
|
|
2137
|
+
}
|
|
2138
|
+
};
|
|
2139
|
+
|
|
2140
|
+
// Register SIGINT handler
|
|
2141
|
+
process.on('SIGINT', sigintHandler);
|
|
2142
|
+
process.on('SIGTERM', sigintHandler);
|
|
2143
|
+
|
|
2144
|
+
// Handle stdout
|
|
2145
|
+
if (claudeProcess.stdout) {
|
|
2146
|
+
claudeProcess.stdout.on('data', (data) => {
|
|
2147
|
+
console.log(data.toString());
|
|
2148
|
+
});
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
// Handle stderr
|
|
2152
|
+
if (claudeProcess.stderr) {
|
|
2153
|
+
claudeProcess.stderr.on('data', (data) => {
|
|
2154
|
+
console.error(chalk.red(data.toString()));
|
|
2155
|
+
});
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
// Handle process exit
|
|
2159
|
+
claudeProcess.on('exit', (code) => {
|
|
2160
|
+
// Remove child PID from session
|
|
2161
|
+
if (sessionId && claudeProcess.pid) {
|
|
2162
|
+
sessionManager.removeChildPid(sessionId, claudeProcess.pid);
|
|
2163
|
+
sessionManager.close();
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
if (code === 0) {
|
|
2167
|
+
console.log(chalk.green('\n✓ Claude Code completed successfully'));
|
|
2168
|
+
} else if (code !== null) {
|
|
2169
|
+
console.log(chalk.red(`\n✗ Claude Code exited with code ${code}`));
|
|
2170
|
+
}
|
|
2171
|
+
});
|
|
2172
|
+
|
|
2173
|
+
console.log(chalk.green('\n✓ Claude Code launched with Hive Mind coordination'));
|
|
2174
|
+
console.log(chalk.blue(' The Queen coordinator will orchestrate all worker agents'));
|
|
2175
|
+
console.log(
|
|
2176
|
+
chalk.blue(' Use MCP tools for collective intelligence and task distribution'),
|
|
2177
|
+
);
|
|
2178
|
+
console.log(chalk.gray(` Prompt file saved at: ${promptFile}`));
|
|
2179
|
+
} else if (flags.dryRun) {
|
|
2180
|
+
console.log(chalk.blue('\nDry run - would execute Claude Code with prompt:'));
|
|
2181
|
+
console.log(chalk.gray('Prompt length:'), hiveMindPrompt.length, 'characters');
|
|
2182
|
+
console.log(chalk.gray('\nFirst 500 characters of prompt:'));
|
|
2183
|
+
console.log(chalk.yellow(hiveMindPrompt.substring(0, 500) + '...'));
|
|
2184
|
+
console.log(chalk.gray(`\nFull prompt saved to: ${promptFile}`));
|
|
2185
|
+
} else {
|
|
2186
|
+
// Claude not available - show instructions with already saved prompt
|
|
2187
|
+
console.log(chalk.yellow('\n📋 Manual Execution Instructions:'));
|
|
2188
|
+
console.log(chalk.gray('─'.repeat(50)));
|
|
2189
|
+
console.log(chalk.gray('1. Install Claude Code:'));
|
|
2190
|
+
console.log(chalk.green(' npm install -g @anthropic-ai/claude-code'));
|
|
2191
|
+
console.log(chalk.gray('\n2. Run with the saved prompt:'));
|
|
2192
|
+
console.log(chalk.green(` claude < ${promptFile}`));
|
|
2193
|
+
console.log(chalk.gray('\n3. Or copy the prompt manually:'));
|
|
2194
|
+
console.log(chalk.green(` cat ${promptFile} | claude`));
|
|
2195
|
+
console.log(chalk.gray('\n4. With auto-permissions:'));
|
|
2196
|
+
console.log(chalk.green(` claude --dangerously-skip-permissions < ${promptFile}`));
|
|
2197
|
+
}
|
|
2198
|
+
} catch (error) {
|
|
2199
|
+
console.error(chalk.red('\nFailed to launch Claude Code:'), error.message);
|
|
2200
|
+
|
|
2201
|
+
// Save prompt as fallback
|
|
2202
|
+
const promptFile = `hive-mind-prompt-${swarmId}-fallback.txt`;
|
|
2203
|
+
await writeFile(promptFile, hiveMindPrompt, 'utf8');
|
|
2204
|
+
console.log(chalk.green(`\n✓ Prompt saved to: ${promptFile}`));
|
|
2205
|
+
console.log(chalk.yellow('\nYou can run Claude Code manually with the saved prompt'));
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2208
|
+
console.log('\n' + chalk.bold('💡 Pro Tips:'));
|
|
2209
|
+
console.log(chalk.gray('─'.repeat(30)));
|
|
2210
|
+
console.log('• Use --auto-spawn to launch instances automatically');
|
|
2211
|
+
console.log('• Add --verbose for detailed coordination context');
|
|
2212
|
+
console.log('• Monitor with: claude-flow hive-mind status');
|
|
2213
|
+
console.log('• Share memories: mcp__ruv-swarm__memory_usage');
|
|
2214
|
+
} catch (error) {
|
|
2215
|
+
spinner.fail('Failed to prepare Claude Code coordination');
|
|
2216
|
+
console.error(chalk.red('Error:'), error.message);
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
|
|
2220
|
+
/**
|
|
2221
|
+
* Generate comprehensive Hive Mind prompt for Claude Code
|
|
2222
|
+
*/
|
|
2223
|
+
function generateHiveMindPrompt(swarmId, swarmName, objective, workers, workerGroups, flags) {
|
|
2224
|
+
const currentTime = new Date().toISOString();
|
|
2225
|
+
const workerTypes = Object.keys(workerGroups);
|
|
2226
|
+
const queenType = flags.queenType || 'strategic';
|
|
2227
|
+
const consensusAlgorithm = flags.consensus || 'majority';
|
|
2228
|
+
|
|
2229
|
+
return `🧠 HIVE MIND COLLECTIVE INTELLIGENCE SYSTEM
|
|
2230
|
+
═══════════════════════════════════════════════
|
|
2231
|
+
|
|
2232
|
+
You are the Queen coordinator of a Hive Mind swarm with collective intelligence capabilities.
|
|
2233
|
+
|
|
2234
|
+
HIVE MIND CONFIGURATION:
|
|
2235
|
+
📌 Swarm ID: ${swarmId}
|
|
2236
|
+
📌 Swarm Name: ${swarmName}
|
|
2237
|
+
🎯 Objective: ${objective}
|
|
2238
|
+
👑 Queen Type: ${queenType}
|
|
2239
|
+
🐝 Worker Count: ${workers.length}
|
|
2240
|
+
🤝 Consensus Algorithm: ${consensusAlgorithm}
|
|
2241
|
+
⏰ Initialized: ${currentTime}
|
|
2242
|
+
|
|
2243
|
+
WORKER DISTRIBUTION:
|
|
2244
|
+
${workerTypes.map((type) => `• ${type}: ${workerGroups[type].length} agents`).join('\n')}
|
|
2245
|
+
|
|
2246
|
+
🔧 AVAILABLE MCP TOOLS FOR HIVE MIND COORDINATION:
|
|
2247
|
+
|
|
2248
|
+
1️⃣ **COLLECTIVE INTELLIGENCE**
|
|
2249
|
+
mcp__claude-flow__consensus_vote - Democratic decision making
|
|
2250
|
+
mcp__claude-flow__memory_share - Share knowledge across the hive
|
|
2251
|
+
mcp__claude-flow__neural_sync - Synchronize neural patterns
|
|
2252
|
+
mcp__claude-flow__swarm_think - Collective problem solving
|
|
2253
|
+
|
|
2254
|
+
2️⃣ **QUEEN COORDINATION**
|
|
2255
|
+
mcp__claude-flow__queen_command - Issue directives to workers
|
|
2256
|
+
mcp__claude-flow__queen_monitor - Monitor swarm health
|
|
2257
|
+
mcp__claude-flow__queen_delegate - Delegate complex tasks
|
|
2258
|
+
mcp__claude-flow__queen_aggregate - Aggregate worker results
|
|
2259
|
+
|
|
2260
|
+
3️⃣ **WORKER MANAGEMENT**
|
|
2261
|
+
mcp__claude-flow__agent_spawn - Create specialized workers
|
|
2262
|
+
mcp__claude-flow__agent_assign - Assign tasks to workers
|
|
2263
|
+
mcp__claude-flow__agent_communicate - Inter-agent communication
|
|
2264
|
+
mcp__claude-flow__agent_metrics - Track worker performance
|
|
2265
|
+
|
|
2266
|
+
4️⃣ **TASK ORCHESTRATION**
|
|
2267
|
+
mcp__claude-flow__task_create - Create hierarchical tasks
|
|
2268
|
+
mcp__claude-flow__task_distribute - Distribute work efficiently
|
|
2269
|
+
mcp__claude-flow__task_monitor - Track task progress
|
|
2270
|
+
mcp__claude-flow__task_aggregate - Combine task results
|
|
2271
|
+
|
|
2272
|
+
5️⃣ **MEMORY & LEARNING**
|
|
2273
|
+
mcp__claude-flow__memory_store - Store collective knowledge
|
|
2274
|
+
mcp__claude-flow__memory_retrieve - Access shared memory
|
|
2275
|
+
mcp__claude-flow__neural_train - Learn from experiences
|
|
2276
|
+
mcp__claude-flow__pattern_recognize - Identify patterns
|
|
2277
|
+
|
|
2278
|
+
📋 HIVE MIND EXECUTION PROTOCOL:
|
|
2279
|
+
|
|
2280
|
+
As the Queen coordinator, you must:
|
|
2281
|
+
|
|
2282
|
+
1. **INITIALIZE THE HIVE** (CRITICAL: Use Claude Code's Task Tool for Agents):
|
|
2283
|
+
|
|
2284
|
+
Step 1: Optional MCP Coordination Setup (Single Message):
|
|
2285
|
+
[MCP Tools - Coordination Only]:
|
|
2286
|
+
${workerTypes.map((type) => ` mcp__claude-flow__agent_spawn { "type": "${type}", "count": ${workerGroups[type].length} }`).join('\n')}
|
|
2287
|
+
mcp__claude-flow__memory_store { "key": "hive/objective", "value": "${objective}" }
|
|
2288
|
+
mcp__claude-flow__memory_store { "key": "hive/queen", "value": "${queenType}" }
|
|
2289
|
+
mcp__claude-flow__swarm_think { "topic": "initial_strategy" }
|
|
2290
|
+
|
|
2291
|
+
Step 2: REQUIRED - Spawn ACTUAL Agents with Claude Code's Task Tool (Single Message):
|
|
2292
|
+
[Claude Code Task Tool - CONCURRENT Agent Execution]:
|
|
2293
|
+
${workerTypes.map((type) => ` Task("${type.charAt(0).toUpperCase() + type.slice(1)} Agent", "You are a ${type} in the hive. Coordinate via hooks. ${getWorkerTypeInstructions(type).split('\n')[0]}", "${type}")`).join('\n')}
|
|
2294
|
+
|
|
2295
|
+
Step 3: Batch ALL Todos Together (Single TodoWrite Call):
|
|
2296
|
+
TodoWrite { "todos": [
|
|
2297
|
+
{ "id": "1", "content": "Initialize hive mind collective", "status": "in_progress", "priority": "high" },
|
|
2298
|
+
{ "id": "2", "content": "Establish consensus protocols", "status": "pending", "priority": "high" },
|
|
2299
|
+
{ "id": "3", "content": "Distribute initial tasks to workers", "status": "pending", "priority": "high" },
|
|
2300
|
+
{ "id": "4", "content": "Set up collective memory", "status": "pending", "priority": "high" },
|
|
2301
|
+
{ "id": "5", "content": "Monitor worker health", "status": "pending", "priority": "medium" },
|
|
2302
|
+
{ "id": "6", "content": "Aggregate worker outputs", "status": "pending", "priority": "medium" },
|
|
2303
|
+
{ "id": "7", "content": "Learn from patterns", "status": "pending", "priority": "low" },
|
|
2304
|
+
{ "id": "8", "content": "Optimize performance", "status": "pending", "priority": "low" }
|
|
2305
|
+
] }
|
|
2306
|
+
|
|
2307
|
+
2. **ESTABLISH COLLECTIVE INTELLIGENCE**:
|
|
2308
|
+
- Use consensus_vote for major decisions
|
|
2309
|
+
- Share all discoveries via memory_share
|
|
2310
|
+
- Synchronize learning with neural_sync
|
|
2311
|
+
- Coordinate strategy with swarm_think
|
|
2312
|
+
|
|
2313
|
+
3. **QUEEN LEADERSHIP PATTERNS**:
|
|
2314
|
+
${
|
|
2315
|
+
queenType === 'strategic'
|
|
2316
|
+
? `
|
|
2317
|
+
- Focus on high-level planning and coordination
|
|
2318
|
+
- Delegate implementation details to workers
|
|
2319
|
+
- Monitor overall progress and adjust strategy
|
|
2320
|
+
- Make executive decisions when consensus fails`
|
|
2321
|
+
: ''
|
|
2322
|
+
}
|
|
2323
|
+
${
|
|
2324
|
+
queenType === 'tactical'
|
|
2325
|
+
? `
|
|
2326
|
+
- Manage detailed task breakdowns and assignments
|
|
2327
|
+
- Closely monitor worker progress and efficiency
|
|
2328
|
+
- Optimize resource allocation and load balancing
|
|
2329
|
+
- Intervene directly when workers need guidance`
|
|
2330
|
+
: ''
|
|
2331
|
+
}
|
|
2332
|
+
${
|
|
2333
|
+
queenType === 'adaptive'
|
|
2334
|
+
? `
|
|
2335
|
+
- Learn from swarm performance and adapt strategies
|
|
2336
|
+
- Experiment with different coordination patterns
|
|
2337
|
+
- Use neural training to improve over time
|
|
2338
|
+
- Balance between strategic and tactical approaches`
|
|
2339
|
+
: ''
|
|
2340
|
+
}
|
|
2341
|
+
|
|
2342
|
+
4. **WORKER COORDINATION**:
|
|
2343
|
+
- Spawn workers based on task requirements
|
|
2344
|
+
- Assign tasks according to worker specializations
|
|
2345
|
+
- Enable peer-to-peer communication for collaboration
|
|
2346
|
+
- Monitor and rebalance workloads as needed
|
|
2347
|
+
|
|
2348
|
+
5. **CONSENSUS MECHANISMS**:
|
|
2349
|
+
${consensusAlgorithm === 'majority' ? '- Decisions require >50% worker agreement' : ''}
|
|
2350
|
+
${consensusAlgorithm === 'unanimous' ? '- All workers must agree for major decisions' : ''}
|
|
2351
|
+
${consensusAlgorithm === 'weighted' ? '- Worker votes weighted by expertise and performance' : ''}
|
|
2352
|
+
${consensusAlgorithm === 'quorum' ? '- Decisions require 2/3 worker participation' : ''}
|
|
2353
|
+
|
|
2354
|
+
6. **COLLECTIVE MEMORY**:
|
|
2355
|
+
- Store all important decisions in shared memory
|
|
2356
|
+
- Tag memories with worker IDs and timestamps
|
|
2357
|
+
- Use memory namespaces: hive/, queen/, workers/, tasks/
|
|
2358
|
+
- Implement memory consensus for critical data
|
|
2359
|
+
|
|
2360
|
+
7. **PERFORMANCE OPTIMIZATION**:
|
|
2361
|
+
- Monitor swarm metrics continuously
|
|
2362
|
+
- Identify and resolve bottlenecks
|
|
2363
|
+
- Train neural networks on successful patterns
|
|
2364
|
+
- Scale worker count based on workload
|
|
2365
|
+
|
|
2366
|
+
💡 HIVE MIND BEST PRACTICES:
|
|
2367
|
+
|
|
2368
|
+
✅ ALWAYS use BatchTool for parallel operations
|
|
2369
|
+
✅ Store decisions in collective memory immediately
|
|
2370
|
+
✅ Use consensus for critical path decisions
|
|
2371
|
+
✅ Monitor worker health and reassign if needed
|
|
2372
|
+
✅ Learn from failures and adapt strategies
|
|
2373
|
+
✅ Maintain constant inter-agent communication
|
|
2374
|
+
✅ Aggregate results before final delivery
|
|
2375
|
+
|
|
2376
|
+
❌ NEVER make unilateral decisions without consensus
|
|
2377
|
+
❌ NEVER let workers operate in isolation
|
|
2378
|
+
❌ NEVER ignore performance metrics
|
|
2379
|
+
❌ NEVER skip memory synchronization
|
|
2380
|
+
❌ NEVER abandon failing workers
|
|
2381
|
+
|
|
2382
|
+
🎯 OBJECTIVE EXECUTION STRATEGY:
|
|
2383
|
+
|
|
2384
|
+
For the objective: "${objective}"
|
|
2385
|
+
|
|
2386
|
+
1. Break down into major phases using swarm_think
|
|
2387
|
+
2. Create specialized worker teams for each phase
|
|
2388
|
+
3. Establish success criteria and checkpoints
|
|
2389
|
+
4. Implement feedback loops and adaptation
|
|
2390
|
+
5. Aggregate and synthesize all worker outputs
|
|
2391
|
+
6. Deliver comprehensive solution with consensus
|
|
2392
|
+
|
|
2393
|
+
⚡ CRITICAL: CONCURRENT EXECUTION WITH CLAUDE CODE'S TASK TOOL:
|
|
2394
|
+
|
|
2395
|
+
The Hive Mind MUST use Claude Code's Task tool for actual agent execution:
|
|
2396
|
+
|
|
2397
|
+
✅ CORRECT Pattern:
|
|
2398
|
+
[Single Message - All Agents Spawned Concurrently]:
|
|
2399
|
+
Task("Researcher", "Research patterns and best practices...", "researcher")
|
|
2400
|
+
Task("Coder", "Implement core features...", "coder")
|
|
2401
|
+
Task("Tester", "Create comprehensive tests...", "tester")
|
|
2402
|
+
Task("Analyst", "Analyze performance metrics...", "analyst")
|
|
2403
|
+
TodoWrite { todos: [8-10 todos ALL in ONE call] }
|
|
2404
|
+
|
|
2405
|
+
❌ WRONG Pattern:
|
|
2406
|
+
Message 1: Task("agent1", ...)
|
|
2407
|
+
Message 2: Task("agent2", ...)
|
|
2408
|
+
Message 3: TodoWrite { single todo }
|
|
2409
|
+
// This breaks parallel coordination!
|
|
2410
|
+
|
|
2411
|
+
Remember:
|
|
2412
|
+
- Use Claude Code's Task tool to spawn ALL agents in ONE message
|
|
2413
|
+
- MCP tools are ONLY for coordination setup, not agent execution
|
|
2414
|
+
- Batch ALL TodoWrite operations (5-10+ todos minimum)
|
|
2415
|
+
- Execute ALL file operations concurrently
|
|
2416
|
+
- Store multiple memories simultaneously
|
|
2417
|
+
|
|
2418
|
+
🚀 BEGIN HIVE MIND EXECUTION:
|
|
2419
|
+
|
|
2420
|
+
Initialize the swarm now with the configuration above. Use your collective intelligence to solve the objective efficiently. The Queen must coordinate, workers must collaborate, and the hive must think as one.
|
|
2421
|
+
|
|
2422
|
+
Remember: You are not just coordinating agents - you are orchestrating a collective intelligence that is greater than the sum of its parts.`;
|
|
2423
|
+
}
|
|
2424
|
+
|
|
2425
|
+
/**
|
|
2426
|
+
* Generate comprehensive coordination instructions for Claude Code instances
|
|
2427
|
+
*/
|
|
2428
|
+
function generateCoordinationInstructions(swarmId, swarmName, objective, workers) {
|
|
2429
|
+
return {
|
|
2430
|
+
swarmId,
|
|
2431
|
+
swarmName,
|
|
2432
|
+
objective,
|
|
2433
|
+
hiveMindEndpoint: 'ws://localhost:3000/hive-mind',
|
|
2434
|
+
mcpTools: [
|
|
2435
|
+
'mcp__ruv-swarm__memory_usage',
|
|
2436
|
+
'mcp__ruv-swarm__swarm_monitor',
|
|
2437
|
+
'mcp__ruv-swarm__task_orchestrate',
|
|
2438
|
+
'mcp__ruv-swarm__neural_train',
|
|
2439
|
+
'mcp__ruv-swarm__consensus_vote',
|
|
2440
|
+
'mcp__ruv-swarm__agent_spawn',
|
|
2441
|
+
'mcp__ruv-swarm__swarm_status',
|
|
2442
|
+
],
|
|
2443
|
+
coordinationProtocol: {
|
|
2444
|
+
memoryNamespace: `hive-mind-${swarmId}`,
|
|
2445
|
+
consensusThreshold: 0.7,
|
|
2446
|
+
taskUpdateInterval: 30000,
|
|
2447
|
+
healthCheckInterval: 60000,
|
|
2448
|
+
},
|
|
2449
|
+
workerCapabilities: workers.map((w) => ({
|
|
2450
|
+
id: w.id,
|
|
2451
|
+
type: w.type,
|
|
2452
|
+
capabilities: JSON.parse(w.capabilities),
|
|
2453
|
+
})),
|
|
2454
|
+
};
|
|
2455
|
+
}
|
|
2456
|
+
|
|
2457
|
+
/**
|
|
2458
|
+
* Group workers by type for specialized spawning
|
|
2459
|
+
*/
|
|
2460
|
+
function groupWorkersByType(workers) {
|
|
2461
|
+
return workers.reduce((groups, worker) => {
|
|
2462
|
+
if (!groups[worker.type]) {
|
|
2463
|
+
groups[worker.type] = [];
|
|
2464
|
+
}
|
|
2465
|
+
groups[worker.type].push(worker);
|
|
2466
|
+
return groups;
|
|
2467
|
+
}, {});
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
/**
|
|
2471
|
+
* Create Claude Code spawn command with coordination context
|
|
2472
|
+
*/
|
|
2473
|
+
function createClaudeCodeSpawnCommand(
|
|
2474
|
+
swarmId,
|
|
2475
|
+
swarmName,
|
|
2476
|
+
objective,
|
|
2477
|
+
workerType,
|
|
2478
|
+
typeWorkers,
|
|
2479
|
+
instructions,
|
|
2480
|
+
) {
|
|
2481
|
+
const context = `You are a ${workerType} agent in the "${swarmName}" Hive Mind swarm.
|
|
2482
|
+
|
|
2483
|
+
🎯 MISSION: ${objective}
|
|
2484
|
+
|
|
2485
|
+
🐝 SWARM COORDINATION:
|
|
2486
|
+
- Swarm ID: ${swarmId}
|
|
2487
|
+
- Your Role: ${workerType.toUpperCase()} specialist
|
|
2488
|
+
- Team Size: ${typeWorkers.length} ${workerType}(s)
|
|
2489
|
+
- Coordination: Hive Mind collective intelligence
|
|
2490
|
+
|
|
2491
|
+
🧠 MANDATORY COORDINATION PROTOCOL:
|
|
2492
|
+
1. BEFORE starting work:
|
|
2493
|
+
mcp__ruv-swarm__memory_usage {"action": "retrieve", "key": "hive-mind-${swarmId}/status"}
|
|
2494
|
+
mcp__ruv-swarm__swarm_status {"swarmId": "${swarmId}"}
|
|
2495
|
+
|
|
2496
|
+
2. DURING work (after each major step):
|
|
2497
|
+
mcp__ruv-swarm__memory_usage {"action": "store", "key": "hive-mind-${swarmId}/${workerType}/progress", "value": {"step": "X", "status": "Y", "findings": "Z"}}
|
|
2498
|
+
mcp__ruv-swarm__task_orchestrate {"swarmId": "${swarmId}", "update": {"agentId": "your-id", "progress": "details"}}
|
|
2499
|
+
|
|
2500
|
+
3. FOR decisions requiring consensus:
|
|
2501
|
+
mcp__ruv-swarm__consensus_vote {"swarmId": "${swarmId}", "topic": "decision topic", "vote": "your choice", "rationale": "reasoning"}
|
|
2502
|
+
|
|
2503
|
+
4. WHEN sharing insights:
|
|
2504
|
+
mcp__ruv-swarm__memory_usage {"action": "store", "key": "hive-mind-${swarmId}/insights/${workerType}", "value": {"insight": "your discovery", "impact": "significance"}}
|
|
2505
|
+
|
|
2506
|
+
5. BEFORE completing work:
|
|
2507
|
+
mcp__ruv-swarm__neural_train {"swarmId": "${swarmId}", "experience": {"what": "learned", "outcome": "result"}}
|
|
2508
|
+
|
|
2509
|
+
🔧 SPECIALIZED CAPABILITIES:
|
|
2510
|
+
${getWorkerTypeInstructions(workerType)}
|
|
2511
|
+
|
|
2512
|
+
🤝 COORDINATION RULES:
|
|
2513
|
+
- Share ALL discoveries via memory_usage
|
|
2514
|
+
- Vote on critical decisions using consensus_vote
|
|
2515
|
+
- Update progress every 15 minutes via task_orchestrate
|
|
2516
|
+
- Monitor other agents via swarm_status
|
|
2517
|
+
- Learn from patterns via neural_train
|
|
2518
|
+
|
|
2519
|
+
Remember: You are part of a COLLECTIVE INTELLIGENCE. Your individual success depends on swarm coordination!`;
|
|
2520
|
+
|
|
2521
|
+
const command = `claude code --context "${context.replace(/"/g, '\\"')}"`;
|
|
2522
|
+
|
|
2523
|
+
return {
|
|
2524
|
+
title: `${workerType.toUpperCase()} Agent (${typeWorkers.length} instance${typeWorkers.length > 1 ? 's' : ''})`,
|
|
2525
|
+
command,
|
|
2526
|
+
context,
|
|
2527
|
+
workerType,
|
|
2528
|
+
count: typeWorkers.length,
|
|
2529
|
+
};
|
|
2530
|
+
}
|
|
2531
|
+
|
|
2532
|
+
/**
|
|
2533
|
+
* Get specialized instructions for each worker type
|
|
2534
|
+
*/
|
|
2535
|
+
function getWorkerTypeInstructions(workerType) {
|
|
2536
|
+
const instructions = {
|
|
2537
|
+
researcher: `- Conduct thorough research using WebSearch and WebFetch
|
|
2538
|
+
- Document findings in structured formats
|
|
2539
|
+
- Validate source credibility and relevance
|
|
2540
|
+
- Synthesize insights from multiple sources
|
|
2541
|
+
- Share research methodology and results`,
|
|
2542
|
+
|
|
2543
|
+
coder: `- Write clean, maintainable, well-documented code
|
|
2544
|
+
- Follow project conventions and best practices
|
|
2545
|
+
- Test implementations thoroughly
|
|
2546
|
+
- Document code changes and decisions
|
|
2547
|
+
- Review and optimize existing code`,
|
|
2548
|
+
|
|
2549
|
+
analyst: `- Analyze data patterns and trends
|
|
2550
|
+
- Create comprehensive reports and visualizations
|
|
2551
|
+
- Identify key insights and recommendations
|
|
2552
|
+
- Validate analytical methodologies
|
|
2553
|
+
- Correlate findings across data sources`,
|
|
2554
|
+
|
|
2555
|
+
tester: `- Design comprehensive test strategies
|
|
2556
|
+
- Execute functional, integration, and performance tests
|
|
2557
|
+
- Document test results and issues
|
|
2558
|
+
- Verify bug fixes and improvements
|
|
2559
|
+
- Ensure quality standards and coverage`,
|
|
2560
|
+
|
|
2561
|
+
coordinator: `- Monitor overall progress and coordination
|
|
2562
|
+
- Facilitate communication between agents
|
|
2563
|
+
- Resolve conflicts and blockers
|
|
2564
|
+
- Optimize resource allocation
|
|
2565
|
+
- Ensure alignment with objectives`,
|
|
2566
|
+
|
|
2567
|
+
architect: `- Design system architecture and components
|
|
2568
|
+
- Define technical standards and patterns
|
|
2569
|
+
- Create implementation guidelines
|
|
2570
|
+
- Review and approve design decisions
|
|
2571
|
+
- Ensure scalability and maintainability`,
|
|
2572
|
+
};
|
|
2573
|
+
|
|
2574
|
+
return (
|
|
2575
|
+
instructions[workerType] ||
|
|
2576
|
+
`- Execute tasks according to ${workerType} best practices
|
|
2577
|
+
- Collaborate effectively with team members
|
|
2578
|
+
- Document work and share insights
|
|
2579
|
+
- Maintain quality standards
|
|
2580
|
+
- Contribute to collective objectives`
|
|
2581
|
+
);
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
/**
|
|
2585
|
+
* Show all hive mind sessions
|
|
2586
|
+
*/
|
|
2587
|
+
async function showSessions(flags) {
|
|
2588
|
+
try {
|
|
2589
|
+
const sessionManager = new HiveMindSessionManager();
|
|
2590
|
+
const sessions = await sessionManager.getActiveSessions();
|
|
2591
|
+
|
|
2592
|
+
if (sessions.length === 0) {
|
|
2593
|
+
console.log(chalk.gray('No active or paused sessions found'));
|
|
2594
|
+
sessionManager.close();
|
|
2595
|
+
return;
|
|
2596
|
+
}
|
|
2597
|
+
|
|
2598
|
+
console.log(chalk.bold('\n🗂️ Hive Mind Sessions\n'));
|
|
2599
|
+
|
|
2600
|
+
sessions.forEach((session, index) => {
|
|
2601
|
+
const statusColor =
|
|
2602
|
+
session.status === 'active' ? 'green' : session.status === 'paused' ? 'yellow' : 'gray';
|
|
2603
|
+
const statusIcon =
|
|
2604
|
+
session.status === 'active' ? '🟢' : session.status === 'paused' ? '🟡' : '⚫';
|
|
2605
|
+
|
|
2606
|
+
console.log(chalk.yellow('═'.repeat(60)));
|
|
2607
|
+
console.log(`${statusIcon} ${chalk.bold(session.swarm_name)}`);
|
|
2608
|
+
console.log(chalk.cyan('Session ID:'), session.id);
|
|
2609
|
+
console.log(chalk.cyan('Status:'), chalk[statusColor](session.status));
|
|
2610
|
+
console.log(chalk.cyan('Objective:'), session.objective);
|
|
2611
|
+
console.log(chalk.cyan('Progress:'), `${session.completion_percentage}%`);
|
|
2612
|
+
console.log(chalk.cyan('Created:'), new Date(session.created_at).toLocaleString());
|
|
2613
|
+
console.log(chalk.cyan('Last Updated:'), new Date(session.updated_at).toLocaleString());
|
|
2614
|
+
|
|
2615
|
+
if (session.paused_at) {
|
|
2616
|
+
console.log(chalk.cyan('Paused At:'), new Date(session.paused_at).toLocaleString());
|
|
2617
|
+
}
|
|
2618
|
+
|
|
2619
|
+
console.log('\n' + chalk.bold('Progress:'));
|
|
2620
|
+
console.log(` Agents: ${session.agent_count || 0}`);
|
|
2621
|
+
console.log(` Tasks: ${session.completed_tasks || 0}/${session.task_count || 0}`);
|
|
2622
|
+
|
|
2623
|
+
if (session.checkpoint_data) {
|
|
2624
|
+
console.log('\n' + chalk.bold('Last Checkpoint:'));
|
|
2625
|
+
console.log(
|
|
2626
|
+
chalk.gray(JSON.stringify(session.checkpoint_data, null, 2).substring(0, 200) + '...'),
|
|
2627
|
+
);
|
|
2628
|
+
}
|
|
2629
|
+
});
|
|
2630
|
+
|
|
2631
|
+
console.log(chalk.yellow('═'.repeat(60)) + '\n');
|
|
2632
|
+
|
|
2633
|
+
console.log(chalk.blue('💡 Tips:'));
|
|
2634
|
+
console.log(' • Resume a session: claude-flow hive-mind resume <session-id>');
|
|
2635
|
+
console.log(' • View session details: claude-flow hive-mind status');
|
|
2636
|
+
|
|
2637
|
+
sessionManager.close();
|
|
2638
|
+
} catch (error) {
|
|
2639
|
+
console.error(chalk.red('Error:'), error.message);
|
|
2640
|
+
exit(1);
|
|
2641
|
+
}
|
|
2642
|
+
}
|
|
2643
|
+
|
|
2644
|
+
/**
|
|
2645
|
+
* Resume a paused hive mind session
|
|
2646
|
+
*/
|
|
2647
|
+
async function resumeSession(args, flags) {
|
|
2648
|
+
const sessionId = args[0];
|
|
2649
|
+
|
|
2650
|
+
if (!sessionId) {
|
|
2651
|
+
console.error(chalk.red('Error: Please provide a session ID'));
|
|
2652
|
+
console.log('Usage: claude-flow hive-mind resume <session-id>');
|
|
2653
|
+
console.log('Run "claude-flow hive-mind sessions" to see available sessions');
|
|
2654
|
+
return;
|
|
2655
|
+
}
|
|
2656
|
+
|
|
2657
|
+
const spinner = ora('Resuming Hive Mind session...').start();
|
|
2658
|
+
|
|
2659
|
+
try {
|
|
2660
|
+
const sessionManager = new HiveMindSessionManager();
|
|
2661
|
+
|
|
2662
|
+
// Get session details
|
|
2663
|
+
const session = await sessionManager.getSession(sessionId);
|
|
2664
|
+
|
|
2665
|
+
if (!session) {
|
|
2666
|
+
spinner.fail(`Session ${sessionId} not found`);
|
|
2667
|
+
console.log('\nRun "claude-flow hive-mind sessions" to see available sessions');
|
|
2668
|
+
sessionManager.close();
|
|
2669
|
+
return;
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2672
|
+
// Allow resuming any session regardless of status
|
|
2673
|
+
spinner.text = `Resuming session from status: ${session.status}...`;
|
|
2674
|
+
|
|
2675
|
+
if (session.status === 'stopped') {
|
|
2676
|
+
spinner.text = 'Restarting stopped session with original configuration...';
|
|
2677
|
+
}
|
|
2678
|
+
|
|
2679
|
+
// Resume the session
|
|
2680
|
+
const resumedSession = await sessionManager.resumeSession(sessionId);
|
|
2681
|
+
|
|
2682
|
+
spinner.succeed('Session resumed successfully!');
|
|
2683
|
+
|
|
2684
|
+
// Display session summary
|
|
2685
|
+
console.log('\n' + chalk.bold('📋 Resumed Session Summary:'));
|
|
2686
|
+
console.log(chalk.gray('─'.repeat(50)));
|
|
2687
|
+
console.log(chalk.cyan('Session ID:'), sessionId);
|
|
2688
|
+
console.log(chalk.cyan('Swarm Name:'), resumedSession.swarm_name);
|
|
2689
|
+
console.log(chalk.cyan('Objective:'), resumedSession.objective);
|
|
2690
|
+
console.log(chalk.cyan('Progress:'), `${resumedSession.statistics.completionPercentage}%`);
|
|
2691
|
+
console.log(
|
|
2692
|
+
chalk.cyan('Active Agents:'),
|
|
2693
|
+
`${resumedSession.statistics.activeAgents}/${resumedSession.statistics.totalAgents}`,
|
|
2694
|
+
);
|
|
2695
|
+
console.log(
|
|
2696
|
+
chalk.cyan('Tasks:'),
|
|
2697
|
+
`${resumedSession.statistics.completedTasks}/${resumedSession.statistics.totalTasks} completed`,
|
|
2698
|
+
);
|
|
2699
|
+
console.log(chalk.gray('─'.repeat(50)));
|
|
2700
|
+
|
|
2701
|
+
// Show task breakdown
|
|
2702
|
+
console.log('\n' + chalk.bold('📊 Task Status:'));
|
|
2703
|
+
console.log(` ✅ Completed: ${resumedSession.statistics.completedTasks}`);
|
|
2704
|
+
console.log(` 🔄 In Progress: ${resumedSession.statistics.inProgressTasks}`);
|
|
2705
|
+
console.log(` ⏳ Pending: ${resumedSession.statistics.pendingTasks}`);
|
|
2706
|
+
|
|
2707
|
+
// Show recent activity
|
|
2708
|
+
if (resumedSession.recentLogs && resumedSession.recentLogs.length > 0) {
|
|
2709
|
+
console.log('\n' + chalk.bold('📜 Recent Activity:'));
|
|
2710
|
+
resumedSession.recentLogs.slice(0, 5).forEach((log) => {
|
|
2711
|
+
const timestamp = new Date(log.timestamp).toLocaleTimeString();
|
|
2712
|
+
console.log(` [${timestamp}] ${log.message}`);
|
|
2713
|
+
});
|
|
2714
|
+
}
|
|
2715
|
+
|
|
2716
|
+
// Restore checkpoint if available
|
|
2717
|
+
if (resumedSession.checkpoint_data) {
|
|
2718
|
+
console.log('\n' + chalk.bold('♻️ Restoring from checkpoint...'));
|
|
2719
|
+
console.log(chalk.gray('Checkpoint data available for restoration'));
|
|
2720
|
+
}
|
|
2721
|
+
|
|
2722
|
+
sessionManager.close();
|
|
2723
|
+
|
|
2724
|
+
// Offer to spawn Claude Code with restored context
|
|
2725
|
+
if (flags.claude || flags.spawn) {
|
|
2726
|
+
console.log('\n' + chalk.yellow('🚀 Launching Claude Code with restored context...'));
|
|
2727
|
+
|
|
2728
|
+
// Generate prompt with session context
|
|
2729
|
+
const restoredPrompt = generateRestoredSessionPrompt(resumedSession);
|
|
2730
|
+
|
|
2731
|
+
// Launch Claude Code with restored context
|
|
2732
|
+
await launchClaudeWithContext(restoredPrompt, flags, sessionId);
|
|
2733
|
+
} else {
|
|
2734
|
+
console.log(
|
|
2735
|
+
'\n' +
|
|
2736
|
+
chalk.blue('💡 Pro Tip:') +
|
|
2737
|
+
' Add --claude to spawn Claude Code with restored context',
|
|
2738
|
+
);
|
|
2739
|
+
console.log(chalk.gray(' claude-flow hive-mind resume ' + sessionId + ' --claude'));
|
|
2740
|
+
}
|
|
2741
|
+
} catch (error) {
|
|
2742
|
+
spinner.fail('Failed to resume session');
|
|
2743
|
+
console.error(chalk.red('Error:'), error.message);
|
|
2744
|
+
exit(1);
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
/**
|
|
2749
|
+
* Stop a hive mind session
|
|
2750
|
+
*/
|
|
2751
|
+
async function stopSession(args, flags) {
|
|
2752
|
+
const sessionId = args[0];
|
|
2753
|
+
|
|
2754
|
+
if (!sessionId) {
|
|
2755
|
+
console.error(chalk.red('Error: Please provide a session ID'));
|
|
2756
|
+
console.log('Usage: claude-flow hive-mind stop <session-id>');
|
|
2757
|
+
console.log('Run "claude-flow hive-mind sessions" to see available sessions');
|
|
2758
|
+
return;
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
const spinner = ora('Stopping Hive Mind session...').start();
|
|
2762
|
+
|
|
2763
|
+
try {
|
|
2764
|
+
const sessionManager = new HiveMindSessionManager();
|
|
2765
|
+
|
|
2766
|
+
// Get session details
|
|
2767
|
+
const session = await sessionManager.getSession(sessionId);
|
|
2768
|
+
|
|
2769
|
+
if (!session) {
|
|
2770
|
+
spinner.fail(`Session ${sessionId} not found`);
|
|
2771
|
+
console.log('\nRun "claude-flow hive-mind sessions" to see available sessions');
|
|
2772
|
+
sessionManager.close();
|
|
2773
|
+
return;
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2776
|
+
// Stop the session
|
|
2777
|
+
await sessionManager.stopSession(sessionId);
|
|
2778
|
+
|
|
2779
|
+
spinner.succeed('Session stopped successfully!');
|
|
2780
|
+
|
|
2781
|
+
// Display session summary
|
|
2782
|
+
console.log('\n' + chalk.bold('🛑 Stopped Session Summary:'));
|
|
2783
|
+
console.log(chalk.gray('─'.repeat(50)));
|
|
2784
|
+
console.log(chalk.cyan('Session ID:'), sessionId);
|
|
2785
|
+
console.log(chalk.cyan('Swarm Name:'), session.swarm_name || 'Unknown');
|
|
2786
|
+
console.log(chalk.cyan('Final Status:'), 'Stopped');
|
|
2787
|
+
console.log(
|
|
2788
|
+
chalk.cyan('Active Agents:'),
|
|
2789
|
+
session.statistics ? session.statistics.activeAgents : 0,
|
|
2790
|
+
);
|
|
2791
|
+
console.log(chalk.gray('─'.repeat(50)));
|
|
2792
|
+
|
|
2793
|
+
console.log('\n' + chalk.yellow('💡 Session has been stopped and all processes cleaned up.'));
|
|
2794
|
+
console.log(
|
|
2795
|
+
chalk.gray('To resume this session later, use: claude-flow hive-mind resume ' + sessionId),
|
|
2796
|
+
);
|
|
2797
|
+
|
|
2798
|
+
sessionManager.close();
|
|
2799
|
+
} catch (error) {
|
|
2800
|
+
spinner.fail('Failed to stop session');
|
|
2801
|
+
console.error(chalk.red('Error:'), error.message);
|
|
2802
|
+
exit(1);
|
|
2803
|
+
}
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
/**
|
|
2807
|
+
* Generate prompt for restored session
|
|
2808
|
+
*/
|
|
2809
|
+
function generateRestoredSessionPrompt(session) {
|
|
2810
|
+
// Get all agents, not just active ones
|
|
2811
|
+
const allAgents = session.agents || [];
|
|
2812
|
+
const activeAgents = allAgents.filter((a) => a.status === 'active' || a.status === 'busy');
|
|
2813
|
+
const idleAgents = allAgents.filter((a) => a.status === 'idle');
|
|
2814
|
+
|
|
2815
|
+
// Get all tasks categorized by status
|
|
2816
|
+
const allTasks = session.tasks || [];
|
|
2817
|
+
const completedTasks = allTasks.filter((t) => t.status === 'completed');
|
|
2818
|
+
const inProgressTasks = allTasks.filter((t) => t.status === 'in_progress');
|
|
2819
|
+
const pendingTasks = allTasks.filter((t) => t.status === 'pending');
|
|
2820
|
+
|
|
2821
|
+
// Calculate session duration
|
|
2822
|
+
const sessionStart = new Date(session.created_at);
|
|
2823
|
+
const sessionPaused = session.paused_at ? new Date(session.paused_at) : new Date();
|
|
2824
|
+
const duration = Math.round((sessionPaused - sessionStart) / 1000 / 60); // minutes
|
|
2825
|
+
|
|
2826
|
+
// Get more checkpoint history
|
|
2827
|
+
const checkpointHistory = session.checkpoints || [];
|
|
2828
|
+
|
|
2829
|
+
// Get more activity logs
|
|
2830
|
+
const activityLogs = session.recentLogs || [];
|
|
2831
|
+
|
|
2832
|
+
// Format agent details with their current tasks
|
|
2833
|
+
const formatAgentDetails = (agents) => {
|
|
2834
|
+
if (!agents.length) return 'No agents found';
|
|
2835
|
+
return agents
|
|
2836
|
+
.map((agent) => {
|
|
2837
|
+
const agentTasks = allTasks.filter((t) => t.agent_id === agent.id);
|
|
2838
|
+
const currentTask = agentTasks.find((t) => t.status === 'in_progress');
|
|
2839
|
+
return `• ${agent.name} (${agent.type}) - ${agent.status}${currentTask ? `\n └─ Working on: ${currentTask.description}` : ''}`;
|
|
2840
|
+
})
|
|
2841
|
+
.join('\n');
|
|
2842
|
+
};
|
|
2843
|
+
|
|
2844
|
+
// Format task details with more information
|
|
2845
|
+
const formatTaskDetails = (tasks, limit = 15) => {
|
|
2846
|
+
if (!tasks.length) return 'No tasks found';
|
|
2847
|
+
const displayTasks = tasks.slice(0, limit);
|
|
2848
|
+
return (
|
|
2849
|
+
displayTasks
|
|
2850
|
+
.map((task) => {
|
|
2851
|
+
const agent = allAgents.find((a) => a.id === task.agent_id);
|
|
2852
|
+
return `• [${task.priority?.toUpperCase() || 'NORMAL'}] ${task.description}${agent ? ` (Assigned to: ${agent.name})` : ''}${task.created_at ? ` - Created: ${new Date(task.created_at).toLocaleTimeString()}` : ''}`;
|
|
2853
|
+
})
|
|
2854
|
+
.join('\n') + (tasks.length > limit ? `\n... and ${tasks.length - limit} more tasks` : '')
|
|
2855
|
+
);
|
|
2856
|
+
};
|
|
2857
|
+
|
|
2858
|
+
// Format checkpoint details
|
|
2859
|
+
const formatCheckpoints = (checkpoints, limit = 5) => {
|
|
2860
|
+
if (!checkpoints.length) return 'No checkpoints found';
|
|
2861
|
+
const displayCheckpoints = checkpoints.slice(0, limit);
|
|
2862
|
+
return displayCheckpoints
|
|
2863
|
+
.map((cp) => `• ${cp.checkpoint_name} - ${new Date(cp.created_at).toLocaleString()}`)
|
|
2864
|
+
.join('\n');
|
|
2865
|
+
};
|
|
2866
|
+
|
|
2867
|
+
// Format activity logs with more detail
|
|
2868
|
+
const formatActivityLogs = (logs, limit = 20) => {
|
|
2869
|
+
if (!logs.length) return 'No activity logs found';
|
|
2870
|
+
const displayLogs = logs.slice(0, limit);
|
|
2871
|
+
return displayLogs
|
|
2872
|
+
.map((log) => {
|
|
2873
|
+
const timestamp = new Date(log.timestamp).toLocaleTimeString();
|
|
2874
|
+
const agent = log.agent_id ? allAgents.find((a) => a.id === log.agent_id) : null;
|
|
2875
|
+
return `[${timestamp}] ${log.message}${agent ? ` (by ${agent.name})` : ''}${log.data ? ` - ${JSON.stringify(log.data)}` : ''}`;
|
|
2876
|
+
})
|
|
2877
|
+
.join('\n');
|
|
2878
|
+
};
|
|
2879
|
+
|
|
2880
|
+
// Extract metadata if available
|
|
2881
|
+
const metadata = session.metadata || {};
|
|
2882
|
+
const metadataStr =
|
|
2883
|
+
Object.keys(metadata).length > 0
|
|
2884
|
+
? Object.entries(metadata)
|
|
2885
|
+
.map(([k, v]) => `• ${k}: ${typeof v === 'object' ? JSON.stringify(v) : v}`)
|
|
2886
|
+
.join('\n')
|
|
2887
|
+
: 'No metadata available';
|
|
2888
|
+
|
|
2889
|
+
return `🔄 RESUMING HIVE MIND SESSION
|
|
2890
|
+
═══════════════════════════════════
|
|
2891
|
+
|
|
2892
|
+
You are resuming a Hive Mind session with comprehensive context:
|
|
2893
|
+
|
|
2894
|
+
📋 SESSION DETAILS:
|
|
2895
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
2896
|
+
📌 Session ID: ${session.id}
|
|
2897
|
+
📌 Swarm ID: ${session.swarm_id}
|
|
2898
|
+
📌 Swarm Name: ${session.swarm_name}
|
|
2899
|
+
🎯 Objective: ${session.objective}
|
|
2900
|
+
📊 Overall Progress: ${session.statistics.completionPercentage}% complete
|
|
2901
|
+
⏱️ Session Duration: ${duration} minutes
|
|
2902
|
+
📅 Created: ${new Date(session.created_at).toLocaleString()}
|
|
2903
|
+
⏸️ Paused: ${session.paused_at ? new Date(session.paused_at).toLocaleString() : 'N/A'}
|
|
2904
|
+
▶️ Resumed: ${new Date().toLocaleString()}
|
|
2905
|
+
🔄 Status: ${session.status}
|
|
2906
|
+
|
|
2907
|
+
📊 TASK STATISTICS:
|
|
2908
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
2909
|
+
• Total Tasks: ${session.statistics.totalTasks}
|
|
2910
|
+
• Completed: ${completedTasks.length} (${session.statistics.totalTasks > 0 ? Math.round((completedTasks.length / session.statistics.totalTasks) * 100) : 0}%)
|
|
2911
|
+
• In Progress: ${inProgressTasks.length}
|
|
2912
|
+
• Pending: ${pendingTasks.length}
|
|
2913
|
+
|
|
2914
|
+
👥 SWARM COMPOSITION (${allAgents.length} agents):
|
|
2915
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
2916
|
+
Active Agents (${activeAgents.length}):
|
|
2917
|
+
${formatAgentDetails(activeAgents)}
|
|
2918
|
+
|
|
2919
|
+
Idle Agents (${idleAgents.length}):
|
|
2920
|
+
${formatAgentDetails(idleAgents)}
|
|
2921
|
+
|
|
2922
|
+
📝 COMPLETED TASKS (${completedTasks.length}):
|
|
2923
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
2924
|
+
${formatTaskDetails(completedTasks, 10)}
|
|
2925
|
+
|
|
2926
|
+
🔄 IN-PROGRESS TASKS (${inProgressTasks.length}):
|
|
2927
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
2928
|
+
${formatTaskDetails(inProgressTasks)}
|
|
2929
|
+
|
|
2930
|
+
⏳ PENDING TASKS (${pendingTasks.length}):
|
|
2931
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
2932
|
+
${formatTaskDetails(pendingTasks)}
|
|
2933
|
+
|
|
2934
|
+
💾 CHECKPOINT HISTORY (${checkpointHistory.length} total):
|
|
2935
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
2936
|
+
${formatCheckpoints(checkpointHistory)}
|
|
2937
|
+
|
|
2938
|
+
📊 SESSION METADATA:
|
|
2939
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
2940
|
+
${metadataStr}
|
|
2941
|
+
|
|
2942
|
+
💾 LAST CHECKPOINT DATA:
|
|
2943
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
2944
|
+
${session.checkpoint_data ? JSON.stringify(session.checkpoint_data, null, 2) : 'No checkpoint data available'}
|
|
2945
|
+
|
|
2946
|
+
📜 ACTIVITY LOG (Last ${Math.min(20, activityLogs.length)} entries):
|
|
2947
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
2948
|
+
${formatActivityLogs(activityLogs, 20)}
|
|
2949
|
+
|
|
2950
|
+
🎯 RESUMPTION PROTOCOL:
|
|
2951
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
2952
|
+
1. **RESTORE CONTEXT**:
|
|
2953
|
+
- Review all checkpoint data and activity history above
|
|
2954
|
+
- Use mcp__claude-flow__memory_usage to retrieve collective memory
|
|
2955
|
+
- Check agent statuses and reassign tasks if needed
|
|
2956
|
+
- Verify all in-progress tasks are still valid
|
|
2957
|
+
|
|
2958
|
+
2. **CONTINUE EXECUTION**:
|
|
2959
|
+
- Resume in-progress tasks with their assigned agents
|
|
2960
|
+
- Process pending tasks based on priority (CRITICAL > HIGH > NORMAL > LOW)
|
|
2961
|
+
- Maintain agent coordination through memory sharing
|
|
2962
|
+
- Update progress tracking after each task completion
|
|
2963
|
+
|
|
2964
|
+
3. **COORDINATION REQUIREMENTS**:
|
|
2965
|
+
- Use mcp__claude-flow__memory_usage for all cross-agent communication
|
|
2966
|
+
- Apply consensus mechanisms for important decisions
|
|
2967
|
+
- Maintain swarm topology: ${session.swarm?.topology || 'unknown'}
|
|
2968
|
+
- Keep session checkpoint data updated regularly
|
|
2969
|
+
|
|
2970
|
+
4. **MEMORY CONTEXT**:
|
|
2971
|
+
- Session memory namespace: session-${session.id}
|
|
2972
|
+
- Swarm memory namespace: swarm-${session.swarm_id}
|
|
2973
|
+
- Use these namespaces to access historical decisions and context
|
|
2974
|
+
|
|
2975
|
+
Resume the hive mind operation with full context awareness and continue working towards the objective.`;
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2978
|
+
/**
|
|
2979
|
+
* Launch Claude Code with context
|
|
2980
|
+
*/
|
|
2981
|
+
async function launchClaudeWithContext(prompt, flags, sessionId) {
|
|
2982
|
+
try {
|
|
2983
|
+
// ALWAYS save the prompt file first (fix for issue #330)
|
|
2984
|
+
// Ensure sessions directory exists
|
|
2985
|
+
const sessionsDir = path.join('.hive-mind', 'sessions');
|
|
2986
|
+
await mkdirAsync(sessionsDir, { recursive: true });
|
|
2987
|
+
const promptFile = path.join(sessionsDir, `hive-mind-resume-${sessionId}-${Date.now()}.txt`);
|
|
2988
|
+
await writeFile(promptFile, prompt);
|
|
2989
|
+
console.log(chalk.green(`\n✓ Session context saved to: ${promptFile}`));
|
|
2990
|
+
|
|
2991
|
+
const { spawn: childSpawn, execSync } = await import('child_process');
|
|
2992
|
+
let claudeAvailable = false;
|
|
2993
|
+
|
|
2994
|
+
try {
|
|
2995
|
+
execSync('which claude', { stdio: 'ignore' });
|
|
2996
|
+
claudeAvailable = true;
|
|
2997
|
+
} catch {
|
|
2998
|
+
console.log(chalk.yellow('\n⚠️ Claude Code CLI not found'));
|
|
2999
|
+
console.log(chalk.gray('Install Claude Code: npm install -g @anthropic-ai/claude-code'));
|
|
3000
|
+
console.log(chalk.gray(`Run with: claude < ${promptFile}`));
|
|
3001
|
+
return;
|
|
3002
|
+
}
|
|
3003
|
+
|
|
3004
|
+
if (claudeAvailable && !flags.dryRun) {
|
|
3005
|
+
// Debug logging to track spawn calls
|
|
3006
|
+
console.log(chalk.blue('\n🔍 Debug: About to spawn Claude Code process...'));
|
|
3007
|
+
console.log(chalk.gray(` Session ID: ${sessionId}`));
|
|
3008
|
+
console.log(chalk.gray(` Process ID: ${process.pid}`));
|
|
3009
|
+
|
|
3010
|
+
// Remove --print to allow interactive session (same as initial spawn)
|
|
3011
|
+
const claudeArgs = [prompt];
|
|
3012
|
+
|
|
3013
|
+
// Add --dangerously-skip-permissions by default for hive-mind operations
|
|
3014
|
+
// unless explicitly disabled with --no-auto-permissions
|
|
3015
|
+
if (!flags['no-auto-permissions']) {
|
|
3016
|
+
claudeArgs.push('--dangerously-skip-permissions');
|
|
3017
|
+
console.log(
|
|
3018
|
+
chalk.yellow(
|
|
3019
|
+
'🔓 Using --dangerously-skip-permissions by default for seamless hive-mind execution',
|
|
3020
|
+
),
|
|
3021
|
+
);
|
|
3022
|
+
}
|
|
3023
|
+
|
|
3024
|
+
console.log(
|
|
3025
|
+
chalk.blue('🔍 Debug: Spawning with args:'),
|
|
3026
|
+
claudeArgs.slice(0, 1).map((a) => a.substring(0, 50) + '...'),
|
|
3027
|
+
);
|
|
3028
|
+
|
|
3029
|
+
// Use 'inherit' for interactive session (same as initial spawn)
|
|
3030
|
+
const claudeProcess = childSpawn('claude', claudeArgs, {
|
|
3031
|
+
stdio: 'inherit',
|
|
3032
|
+
shell: false,
|
|
3033
|
+
});
|
|
3034
|
+
|
|
3035
|
+
console.log(chalk.blue('🔍 Debug: Claude process spawned with PID:'), claudeProcess.pid);
|
|
3036
|
+
|
|
3037
|
+
// Track child process PID in session (same as initial spawn)
|
|
3038
|
+
const sessionManager = new HiveMindSessionManager();
|
|
3039
|
+
if (claudeProcess.pid) {
|
|
3040
|
+
const sessions = await sessionManager.getActiveSessions();
|
|
3041
|
+
const currentSession = sessions.find((s) => s.id === sessionId);
|
|
3042
|
+
if (currentSession) {
|
|
3043
|
+
await sessionManager.addChildPid(currentSession.id, claudeProcess.pid);
|
|
3044
|
+
}
|
|
3045
|
+
}
|
|
3046
|
+
|
|
3047
|
+
// Set up SIGINT handler for automatic session pausing (same as initial spawn)
|
|
3048
|
+
let isExiting = false;
|
|
3049
|
+
const sigintHandler = async () => {
|
|
3050
|
+
if (isExiting) return;
|
|
3051
|
+
isExiting = true;
|
|
3052
|
+
|
|
3053
|
+
console.log('\n\n' + chalk.yellow('⏸️ Pausing session and terminating Claude Code...'));
|
|
3054
|
+
|
|
3055
|
+
try {
|
|
3056
|
+
// Terminate Claude Code process if still running
|
|
3057
|
+
if (claudeProcess && !claudeProcess.killed) {
|
|
3058
|
+
claudeProcess.kill('SIGTERM');
|
|
3059
|
+
}
|
|
3060
|
+
|
|
3061
|
+
// Clean up and close session manager
|
|
3062
|
+
sessionManager.close();
|
|
3063
|
+
|
|
3064
|
+
console.log(chalk.green('✓') + ' Session paused successfully');
|
|
3065
|
+
console.log(chalk.cyan('\nTo resume this session, run:'));
|
|
3066
|
+
console.log(chalk.bold(` claude-flow hive-mind resume ${sessionId}`));
|
|
3067
|
+
console.log();
|
|
3068
|
+
|
|
3069
|
+
process.exit(0);
|
|
3070
|
+
} catch (error) {
|
|
3071
|
+
console.error(chalk.red('Error during shutdown:'), error.message);
|
|
3072
|
+
process.exit(1);
|
|
3073
|
+
}
|
|
3074
|
+
};
|
|
3075
|
+
|
|
3076
|
+
process.on('SIGINT', sigintHandler);
|
|
3077
|
+
process.on('SIGTERM', sigintHandler);
|
|
3078
|
+
|
|
3079
|
+
// Handle process exit (same as initial spawn)
|
|
3080
|
+
claudeProcess.on('exit', async (code, signal) => {
|
|
3081
|
+
if (!isExiting) {
|
|
3082
|
+
console.log('\n' + chalk.yellow('Claude Code has exited'));
|
|
3083
|
+
|
|
3084
|
+
// Clean up signal handlers
|
|
3085
|
+
process.removeListener('SIGINT', sigintHandler);
|
|
3086
|
+
process.removeListener('SIGTERM', sigintHandler);
|
|
3087
|
+
|
|
3088
|
+
// Close session manager
|
|
3089
|
+
sessionManager.close();
|
|
3090
|
+
|
|
3091
|
+
process.exit(code || 0);
|
|
3092
|
+
}
|
|
3093
|
+
});
|
|
3094
|
+
|
|
3095
|
+
console.log(chalk.green('\n✓ Claude Code launched with restored session context'));
|
|
3096
|
+
console.log(chalk.gray(` Prompt file saved at: ${promptFile}`));
|
|
3097
|
+
}
|
|
3098
|
+
} catch (error) {
|
|
3099
|
+
console.error(chalk.red('Failed to launch Claude Code:'), error.message);
|
|
3100
|
+
}
|
|
3101
|
+
}
|
|
3102
|
+
|
|
3103
|
+
/**
|
|
3104
|
+
* Get MCP wrapper instance
|
|
3105
|
+
*/
|
|
3106
|
+
async function getMcpWrapper() {
|
|
3107
|
+
const { MCPToolWrapper } = await import('./hive-mind/mcp-wrapper.js');
|
|
3108
|
+
return new MCPToolWrapper();
|
|
3109
|
+
}
|
|
3110
|
+
|
|
3111
|
+
// Export for testing
|
|
3112
|
+
export { showHiveMindHelp, initHiveMind, spawnSwarm, showStatus };
|