kynjal-cli 3.1.3 → 4.0.0
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/agents/core/coder.md +1 -1
- package/.claude/agents/core/planner.md +2 -2
- package/.claude/agents/core/researcher.md +1 -1
- package/.claude/agents/core/reviewer.md +1 -1
- package/.claude/agents/core/tester.md +1 -1
- package/.claude/agents/data/data-ml-model.md +4 -4
- package/.claude/agents/development/dev-backend-api.md +4 -4
- package/.claude/agents/documentation/docs-api-openapi.md +4 -4
- package/.claude/agents/github/code-review-swarm.md +2 -2
- package/.claude/agents/github/issue-tracker.md +2 -2
- package/.claude/agents/github/pr-manager.md +2 -2
- package/.claude/agents/github/release-manager.md +2 -2
- package/.claude/agents/github/workflow-automation.md +2 -2
- package/.claude/agents/sparc/architecture.md +3 -3
- package/.claude/agents/sparc/pseudocode.md +2 -2
- package/.claude/agents/sparc/refinement.md +3 -3
- package/.claude/agents/sparc/specification.md +2 -2
- package/.claude/agents/swarm/adaptive-coordinator.md +1 -1
- package/.claude/agents/swarm/hierarchical-coordinator.md +1 -1
- package/.claude/agents/swarm/mesh-coordinator.md +1 -1
- package/.claude/agents/templates/base-template-generator.md +25 -4
- package/.claude/agents/templates/sparc-coordinator.md +3 -3
- package/.claude/helpers/auto-commit.sh +1 -1
- package/.claude/helpers/auto-memory-hook.mjs +27 -9
- package/.claude/helpers/hook-handler.cjs +58 -18
- package/.claude/helpers/statusline.cjs +14 -33
- package/.claude/helpers/statusline.js +3 -3
- package/.claude/settings.json +9 -9
- package/.claude/skills/reasoningbank-intelligence/SKILL.md +2 -2
- package/.claude/skills/swarm-orchestration/SKILL.md +1 -1
- package/README.md +383 -170
- package/bin/cli.js +6 -6
- package/bin/mcp-server.js +1 -1
- package/bin/preinstall.cjs +2 -0
- package/dist/src/appliance/gguf-engine.js +664 -0
- package/dist/src/appliance/gguf-engine.js.map +1 -0
- package/dist/src/appliance/ruvllm-bridge.js +492 -0
- package/dist/src/appliance/ruvllm-bridge.js.map +1 -0
- package/dist/src/appliance/rvfa-builder.js +383 -0
- package/dist/src/appliance/rvfa-builder.js.map +1 -0
- package/dist/src/appliance/rvfa-distribution.js +533 -0
- package/dist/src/appliance/rvfa-distribution.js.map +1 -0
- package/dist/src/appliance/rvfa-format.js +465 -0
- package/dist/src/appliance/rvfa-format.js.map +1 -0
- package/dist/src/appliance/rvfa-runner.js +373 -0
- package/dist/src/appliance/rvfa-runner.js.map +1 -0
- package/dist/src/appliance/rvfa-signing.js +469 -0
- package/dist/src/appliance/rvfa-signing.js.map +1 -0
- package/dist/src/benchmarks/pretrain/index.js +542 -331
- package/dist/src/benchmarks/pretrain/index.js.map +1 -1
- package/dist/src/commands/agent.d.ts.map +1 -1
- package/dist/src/commands/agent.js +725 -502
- package/dist/src/commands/agent.js.map +1 -1
- package/dist/src/commands/analyze.js +1548 -1218
- package/dist/src/commands/analyze.js.map +1 -1
- package/dist/src/commands/appliance-advanced.d.ts +9 -0
- package/dist/src/commands/appliance-advanced.d.ts.map +1 -0
- package/dist/src/commands/appliance-advanced.js +324 -0
- package/dist/src/commands/appliance-advanced.js.map +1 -0
- package/dist/src/commands/appliance.d.ts +8 -0
- package/dist/src/commands/appliance.d.ts.map +1 -0
- package/dist/src/commands/appliance.js +581 -0
- package/dist/src/commands/appliance.js.map +1 -0
- package/dist/src/commands/benchmark.js +523 -372
- package/dist/src/commands/benchmark.js.map +1 -1
- package/dist/src/commands/claims.js +364 -274
- package/dist/src/commands/claims.js.map +1 -1
- package/dist/src/commands/cleanup.d.ts +13 -0
- package/dist/src/commands/cleanup.d.ts.map +1 -0
- package/dist/src/commands/cleanup.js +262 -0
- package/dist/src/commands/cleanup.js.map +1 -0
- package/dist/src/commands/completions.js +118 -477
- package/dist/src/commands/completions.js.map +1 -1
- package/dist/src/commands/config.js +303 -237
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/daemon.d.ts.map +1 -1
- package/dist/src/commands/daemon.js +597 -425
- package/dist/src/commands/daemon.js.map +1 -1
- package/dist/src/commands/deployment.js +275 -194
- package/dist/src/commands/deployment.js.map +1 -1
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +690 -460
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/embeddings.js +1543 -1293
- package/dist/src/commands/embeddings.js.map +1 -1
- package/dist/src/commands/guidance.js +596 -449
- package/dist/src/commands/guidance.js.map +1 -1
- package/dist/src/commands/hive-mind.js +938 -854
- package/dist/src/commands/hive-mind.js.map +1 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +3677 -2570
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.js +322 -122
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/init.d.ts +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +943 -787
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/issues.js +558 -383
- package/dist/src/commands/issues.js.map +1 -1
- package/dist/src/commands/mcp.d.ts.map +1 -1
- package/dist/src/commands/mcp.js +605 -475
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/memory.d.ts.map +1 -1
- package/dist/src/commands/memory.js +1031 -814
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/migrate.js +347 -282
- package/dist/src/commands/migrate.js.map +1 -1
- package/dist/src/commands/neural.d.ts.map +1 -1
- package/dist/src/commands/neural.js +1563 -1283
- package/dist/src/commands/neural.js.map +1 -1
- package/dist/src/commands/performance.js +643 -497
- package/dist/src/commands/performance.js.map +1 -1
- package/dist/src/commands/plugins.js +841 -668
- package/dist/src/commands/plugins.js.map +1 -1
- package/dist/src/commands/process.js +447 -392
- package/dist/src/commands/process.js.map +1 -1
- package/dist/src/commands/progress.js +256 -162
- package/dist/src/commands/progress.js.map +1 -1
- package/dist/src/commands/providers.js +220 -150
- package/dist/src/commands/providers.js.map +1 -1
- package/dist/src/commands/route.js +665 -520
- package/dist/src/commands/route.js.map +1 -1
- package/dist/src/commands/ruvector/backup.js +651 -505
- package/dist/src/commands/ruvector/backup.js.map +1 -1
- package/dist/src/commands/ruvector/benchmark.js +401 -349
- package/dist/src/commands/ruvector/benchmark.js.map +1 -1
- package/dist/src/commands/ruvector/import.js +267 -225
- package/dist/src/commands/ruvector/import.js.map +1 -1
- package/dist/src/commands/ruvector/index.js +75 -37
- package/dist/src/commands/ruvector/index.js.map +1 -1
- package/dist/src/commands/ruvector/init.js +359 -336
- package/dist/src/commands/ruvector/init.js.map +1 -1
- package/dist/src/commands/ruvector/migrate.js +322 -335
- package/dist/src/commands/ruvector/migrate.js.map +1 -1
- package/dist/src/commands/ruvector/optimize.js +431 -375
- package/dist/src/commands/ruvector/optimize.js.map +1 -1
- package/dist/src/commands/ruvector/setup.js +117 -703
- package/dist/src/commands/ruvector/setup.js.map +1 -1
- package/dist/src/commands/ruvector/status.js +419 -364
- package/dist/src/commands/ruvector/status.js.map +1 -1
- package/dist/src/commands/security.d.ts.map +1 -1
- package/dist/src/commands/security.js +610 -456
- package/dist/src/commands/security.js.map +1 -1
- package/dist/src/commands/session.d.ts +1 -1
- package/dist/src/commands/session.js +627 -505
- package/dist/src/commands/session.js.map +1 -1
- package/dist/src/commands/start.d.ts +1 -1
- package/dist/src/commands/start.js +368 -271
- package/dist/src/commands/start.js.map +1 -1
- package/dist/src/commands/status.d.ts +1 -1
- package/dist/src/commands/status.d.ts.map +1 -1
- package/dist/src/commands/status.js +492 -379
- package/dist/src/commands/status.js.map +1 -1
- package/dist/src/commands/swarm.js +488 -408
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/commands/task.d.ts +1 -1
- package/dist/src/commands/task.js +539 -424
- package/dist/src/commands/task.js.map +1 -1
- package/dist/src/commands/transfer-store.js +412 -322
- package/dist/src/commands/transfer-store.js.map +1 -1
- package/dist/src/commands/update.js +291 -196
- package/dist/src/commands/update.js.map +1 -1
- package/dist/src/commands/workflow.js +486 -386
- package/dist/src/commands/workflow.js.map +1 -1
- package/dist/src/config-adapter.js +40 -39
- package/dist/src/config-adapter.js.map +1 -1
- package/dist/src/index.js +416 -312
- package/dist/src/index.js.map +1 -1
- package/dist/src/infrastructure/in-memory-repositories.js +507 -246
- package/dist/src/infrastructure/in-memory-repositories.js.map +1 -1
- package/dist/src/init/claudemd-generator.js +78 -368
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/executor.js +1019 -1345
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/helpers-generator.js +60 -635
- package/dist/src/init/helpers-generator.js.map +1 -1
- package/dist/src/init/index.d.ts +1 -1
- package/dist/src/init/index.d.ts.map +1 -1
- package/dist/src/init/index.js +1 -1
- package/dist/src/init/index.js.map +1 -1
- package/dist/src/init/mcp-generator.d.ts +0 -1
- package/dist/src/init/mcp-generator.d.ts.map +1 -1
- package/dist/src/init/mcp-generator.js +62 -42
- package/dist/src/init/mcp-generator.js.map +1 -1
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +167 -100
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/statusline-generator.d.ts +16 -8
- package/dist/src/init/statusline-generator.d.ts.map +1 -1
- package/dist/src/init/statusline-generator.js +20 -1300
- package/dist/src/init/statusline-generator.js.map +1 -1
- package/dist/src/init/types.d.ts +15 -5
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/types.js +66 -76
- package/dist/src/init/types.js.map +1 -1
- package/dist/src/mcp-client.js +130 -76
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-server.js +758 -445
- package/dist/src/mcp-server.js.map +1 -1
- package/dist/src/mcp-tools/agent-tools.js +492 -391
- package/dist/src/mcp-tools/agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/agentdb-tools.d.ts +30 -0
- package/dist/src/mcp-tools/agentdb-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/agentdb-tools.js +758 -0
- package/dist/src/mcp-tools/agentdb-tools.js.map +1 -0
- package/dist/src/mcp-tools/analyze-tools.js +236 -172
- package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
- package/dist/src/mcp-tools/auto-install.js +142 -80
- package/dist/src/mcp-tools/auto-install.js.map +1 -1
- package/dist/src/mcp-tools/browser-tools.js +375 -252
- package/dist/src/mcp-tools/browser-tools.js.map +1 -1
- package/dist/src/mcp-tools/claims-tools.js +565 -473
- package/dist/src/mcp-tools/claims-tools.js.map +1 -1
- package/dist/src/mcp-tools/config-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/config-tools.js +284 -190
- package/dist/src/mcp-tools/config-tools.js.map +1 -1
- package/dist/src/mcp-tools/coordination-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/coordination-tools.js +600 -349
- package/dist/src/mcp-tools/coordination-tools.js.map +1 -1
- package/dist/src/mcp-tools/daa-tools.js +367 -289
- package/dist/src/mcp-tools/daa-tools.js.map +1 -1
- package/dist/src/mcp-tools/embeddings-tools.js +693 -582
- package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
- package/dist/src/mcp-tools/github-tools.js +312 -261
- package/dist/src/mcp-tools/github-tools.js.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.js +718 -423
- package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +2726 -1978
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/index.d.ts +2 -0
- package/dist/src/mcp-tools/index.d.ts.map +1 -1
- package/dist/src/mcp-tools/index.js +2 -0
- package/dist/src/mcp-tools/index.js.map +1 -1
- package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/memory-tools.js +514 -329
- package/dist/src/mcp-tools/memory-tools.js.map +1 -1
- package/dist/src/mcp-tools/neural-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/neural-tools.js +428 -326
- package/dist/src/mcp-tools/neural-tools.js.map +1 -1
- package/dist/src/mcp-tools/performance-tools.js +480 -420
- package/dist/src/mcp-tools/performance-tools.js.map +1 -1
- package/dist/src/mcp-tools/progress-tools.js +278 -204
- package/dist/src/mcp-tools/progress-tools.js.map +1 -1
- package/dist/src/mcp-tools/ruvllm-tools.d.ts +9 -0
- package/dist/src/mcp-tools/ruvllm-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/ruvllm-tools.js +399 -0
- package/dist/src/mcp-tools/ruvllm-tools.js.map +1 -0
- package/dist/src/mcp-tools/security-tools.js +429 -297
- package/dist/src/mcp-tools/security-tools.js.map +1 -1
- package/dist/src/mcp-tools/session-tools.js +234 -185
- package/dist/src/mcp-tools/session-tools.js.map +1 -1
- package/dist/src/mcp-tools/swarm-tools.d.ts +2 -1
- package/dist/src/mcp-tools/swarm-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/swarm-tools.js +303 -64
- package/dist/src/mcp-tools/swarm-tools.js.map +1 -1
- package/dist/src/mcp-tools/system-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/system-tools.js +352 -200
- package/dist/src/mcp-tools/system-tools.js.map +1 -1
- package/dist/src/mcp-tools/task-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/task-tools.js +357 -189
- package/dist/src/mcp-tools/task-tools.js.map +1 -1
- package/dist/src/mcp-tools/terminal-tools.js +196 -148
- package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
- package/dist/src/mcp-tools/transfer-tools.js +333 -186
- package/dist/src/mcp-tools/transfer-tools.js.map +1 -1
- package/dist/src/mcp-tools/wasm-agent-tools.d.ts +9 -0
- package/dist/src/mcp-tools/wasm-agent-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/wasm-agent-tools.js +377 -0
- package/dist/src/mcp-tools/wasm-agent-tools.js.map +1 -0
- package/dist/src/mcp-tools/workflow-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/workflow-tools.js +471 -335
- package/dist/src/mcp-tools/workflow-tools.js.map +1 -1
- package/dist/src/memory/ewc-consolidation.js +345 -173
- package/dist/src/memory/ewc-consolidation.js.map +1 -1
- package/dist/src/memory/intelligence.js +841 -359
- package/dist/src/memory/intelligence.js.map +1 -1
- package/dist/src/memory/memory-bridge.js +1964 -0
- package/dist/src/memory/memory-bridge.js.map +1 -0
- package/dist/src/memory/memory-initializer.js +1895 -1602
- package/dist/src/memory/memory-initializer.js.map +1 -1
- package/dist/src/memory/sona-optimizer.js +329 -199
- package/dist/src/memory/sona-optimizer.js.map +1 -1
- package/dist/src/output.d.ts +2 -2
- package/dist/src/output.d.ts.map +1 -1
- package/dist/src/output.js +273 -242
- package/dist/src/output.js.map +1 -1
- package/dist/src/parser.js +217 -124
- package/dist/src/parser.js.map +1 -1
- package/dist/src/plugins/manager.js +531 -278
- package/dist/src/plugins/manager.js.map +1 -1
- package/dist/src/plugins/store/discovery.js +362 -275
- package/dist/src/plugins/store/discovery.js.map +1 -1
- package/dist/src/plugins/store/index.js +105 -48
- package/dist/src/plugins/store/index.js.map +1 -1
- package/dist/src/plugins/store/search.js +107 -69
- package/dist/src/plugins/store/search.js.map +1 -1
- package/dist/src/plugins/tests/demo-plugin-store.js +160 -113
- package/dist/src/plugins/tests/demo-plugin-store.js.map +1 -1
- package/dist/src/plugins/tests/standalone-test.js +223 -172
- package/dist/src/plugins/tests/standalone-test.js.map +1 -1
- package/dist/src/plugins/tests/test-plugin-store.js +228 -190
- package/dist/src/plugins/tests/test-plugin-store.js.map +1 -1
- package/dist/src/production/circuit-breaker.js +126 -62
- package/dist/src/production/circuit-breaker.js.map +1 -1
- package/dist/src/production/error-handler.js +156 -86
- package/dist/src/production/error-handler.js.map +1 -1
- package/dist/src/production/monitoring.js +220 -139
- package/dist/src/production/monitoring.js.map +1 -1
- package/dist/src/production/rate-limiter.js +93 -74
- package/dist/src/production/rate-limiter.js.map +1 -1
- package/dist/src/production/retry.js +167 -75
- package/dist/src/production/retry.js.map +1 -1
- package/dist/src/prompt.js +560 -436
- package/dist/src/prompt.js.map +1 -1
- package/dist/src/runtime/headless.js +289 -200
- package/dist/src/runtime/headless.js.map +1 -1
- package/dist/src/ruvector/agent-wasm.js +511 -0
- package/dist/src/ruvector/agent-wasm.js.map +1 -0
- package/dist/src/ruvector/ast-analyzer.js +232 -145
- package/dist/src/ruvector/ast-analyzer.js.map +1 -1
- package/dist/src/ruvector/coverage-router.js +419 -287
- package/dist/src/ruvector/coverage-router.js.map +1 -1
- package/dist/src/ruvector/coverage-tools.js +101 -56
- package/dist/src/ruvector/coverage-tools.js.map +1 -1
- package/dist/src/ruvector/diff-classifier.js +451 -324
- package/dist/src/ruvector/diff-classifier.js.map +1 -1
- package/dist/src/ruvector/enhanced-model-router.js +337 -251
- package/dist/src/ruvector/enhanced-model-router.js.map +1 -1
- package/dist/src/ruvector/flash-attention.js +254 -223
- package/dist/src/ruvector/flash-attention.js.map +1 -1
- package/dist/src/ruvector/graph-analyzer.js +680 -486
- package/dist/src/ruvector/graph-analyzer.js.map +1 -1
- package/dist/src/ruvector/index.js +113 -27
- package/dist/src/ruvector/index.js.map +1 -1
- package/dist/src/ruvector/lora-adapter.js +248 -155
- package/dist/src/ruvector/lora-adapter.js.map +1 -1
- package/dist/src/ruvector/model-router.js +248 -175
- package/dist/src/ruvector/model-router.js.map +1 -1
- package/dist/src/ruvector/moe-router.js +286 -228
- package/dist/src/ruvector/moe-router.js.map +1 -1
- package/dist/src/ruvector/q-learning-router.js +338 -257
- package/dist/src/ruvector/q-learning-router.js.map +1 -1
- package/dist/src/ruvector/ruvllm-wasm.js +527 -0
- package/dist/src/ruvector/ruvllm-wasm.js.map +1 -0
- package/dist/src/ruvector/semantic-router.js +67 -60
- package/dist/src/ruvector/semantic-router.js.map +1 -1
- package/dist/src/ruvector/vector-db.js +205 -119
- package/dist/src/ruvector/vector-db.js.map +1 -1
- package/dist/src/services/agentic-flow-bridge.js +168 -0
- package/dist/src/services/agentic-flow-bridge.js.map +1 -0
- package/dist/src/services/claim-service.js +940 -615
- package/dist/src/services/claim-service.js.map +1 -1
- package/dist/src/services/container-worker-pool.js +669 -399
- package/dist/src/services/container-worker-pool.js.map +1 -1
- package/dist/src/services/headless-worker-executor.js +467 -441
- package/dist/src/services/headless-worker-executor.js.map +1 -1
- package/dist/src/services/index.d.ts +5 -5
- package/dist/src/services/index.d.ts.map +1 -1
- package/dist/src/services/index.js +4 -4
- package/dist/src/services/index.js.map +1 -1
- package/dist/src/services/registry-api.js +201 -93
- package/dist/src/services/registry-api.js.map +1 -1
- package/dist/src/services/ruvector-training.js +414 -144
- package/dist/src/services/ruvector-training.js.map +1 -1
- package/dist/src/services/worker-daemon.js +928 -531
- package/dist/src/services/worker-daemon.js.map +1 -1
- package/dist/src/services/worker-queue.js +550 -331
- package/dist/src/services/worker-queue.js.map +1 -1
- package/dist/src/suggest.js +55 -45
- package/dist/src/suggest.js.map +1 -1
- package/dist/src/transfer/anonymization/index.js +37 -29
- package/dist/src/transfer/anonymization/index.js.map +1 -1
- package/dist/src/transfer/deploy-seraphine.d.ts +1 -1
- package/dist/src/transfer/deploy-seraphine.js +156 -129
- package/dist/src/transfer/deploy-seraphine.js.map +1 -1
- package/dist/src/transfer/export.js +142 -84
- package/dist/src/transfer/export.js.map +1 -1
- package/dist/src/transfer/index.d.ts +1 -1
- package/dist/src/transfer/index.d.ts.map +1 -1
- package/dist/src/transfer/index.js +2 -0
- package/dist/src/transfer/index.js.map +1 -1
- package/dist/src/transfer/ipfs/client.js +337 -179
- package/dist/src/transfer/ipfs/client.js.map +1 -1
- package/dist/src/transfer/ipfs/upload.js +434 -290
- package/dist/src/transfer/ipfs/upload.js.map +1 -1
- package/dist/src/transfer/models/seraphine.js +58 -58
- package/dist/src/transfer/models/seraphine.js.map +1 -1
- package/dist/src/transfer/serialization/cfp.js +37 -33
- package/dist/src/transfer/serialization/cfp.js.map +1 -1
- package/dist/src/transfer/storage/gcs.js +248 -139
- package/dist/src/transfer/storage/gcs.js.map +1 -1
- package/dist/src/transfer/store/discovery.js +353 -243
- package/dist/src/transfer/store/discovery.js.map +1 -1
- package/dist/src/transfer/store/download.js +365 -243
- package/dist/src/transfer/store/download.js.map +1 -1
- package/dist/src/transfer/store/index.js +130 -63
- package/dist/src/transfer/store/index.js.map +1 -1
- package/dist/src/transfer/store/publish.js +258 -184
- package/dist/src/transfer/store/publish.js.map +1 -1
- package/dist/src/transfer/store/registry.js +73 -51
- package/dist/src/transfer/store/registry.js.map +1 -1
- package/dist/src/transfer/store/search.js +96 -64
- package/dist/src/transfer/store/search.js.map +1 -1
- package/dist/src/transfer/store/tests/standalone-test.js +231 -174
- package/dist/src/transfer/store/tests/standalone-test.js.map +1 -1
- package/dist/src/transfer/test-seraphine.js +130 -95
- package/dist/src/transfer/test-seraphine.js.map +1 -1
- package/dist/src/transfer/tests/test-store.js +239 -194
- package/dist/src/transfer/tests/test-store.js.map +1 -1
- package/dist/src/types.js +56 -27
- package/dist/src/types.js.map +1 -1
- package/dist/src/update/checker.js +183 -106
- package/dist/src/update/checker.js.map +1 -1
- package/dist/src/update/executor.js +198 -135
- package/dist/src/update/executor.js.map +1 -1
- package/dist/src/update/index.js +85 -38
- package/dist/src/update/index.js.map +1 -1
- package/dist/src/update/rate-limiter.js +31 -19
- package/dist/src/update/rate-limiter.js.map +1 -1
- package/dist/src/update/validator.js +64 -38
- package/dist/src/update/validator.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -10
- package/.claude/agents/custom/accessibility-auditor.yaml +0 -56
- package/.claude/agents/custom/design-architect.yaml +0 -48
- package/.claude/agents/custom/ui-developer.yaml +0 -46
- package/.claude/agents/custom/ux-researcher.yaml +0 -60
- package/dist/src/benchmarks/pretrain/index.d.ts +0 -58
- package/dist/src/benchmarks/pretrain/index.d.ts.map +0 -1
- package/dist/src/commands/index.d.ts +0 -108
- package/dist/src/commands/index.d.ts.map +0 -1
- package/dist/src/config-adapter.d.ts +0 -15
- package/dist/src/config-adapter.d.ts.map +0 -1
- package/dist/src/index.d.ts +0 -76
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/infrastructure/in-memory-repositories.d.ts +0 -68
- package/dist/src/infrastructure/in-memory-repositories.d.ts.map +0 -1
- package/dist/src/init/claudemd-generator.d.ts +0 -25
- package/dist/src/init/claudemd-generator.d.ts.map +0 -1
- package/dist/src/init/executor.d.ts +0 -41
- package/dist/src/init/executor.d.ts.map +0 -1
- package/dist/src/init/helpers-generator.d.ts +0 -60
- package/dist/src/init/helpers-generator.d.ts.map +0 -1
- package/dist/src/mcp-client.d.ts +0 -92
- package/dist/src/mcp-client.d.ts.map +0 -1
- package/dist/src/mcp-server.d.ts +0 -161
- package/dist/src/mcp-server.d.ts.map +0 -1
- package/dist/src/mcp-tools/auto-install.d.ts +0 -83
- package/dist/src/mcp-tools/auto-install.d.ts.map +0 -1
- package/dist/src/mcp-tools/types.d.ts +0 -31
- package/dist/src/mcp-tools/types.d.ts.map +0 -1
- package/dist/src/memory/ewc-consolidation.d.ts +0 -271
- package/dist/src/memory/ewc-consolidation.d.ts.map +0 -1
- package/dist/src/memory/intelligence.d.ts +0 -285
- package/dist/src/memory/intelligence.d.ts.map +0 -1
- package/dist/src/memory/memory-initializer.d.ts +0 -396
- package/dist/src/memory/memory-initializer.d.ts.map +0 -1
- package/dist/src/memory/sona-optimizer.d.ts +0 -227
- package/dist/src/memory/sona-optimizer.d.ts.map +0 -1
- package/dist/src/parser.d.ts +0 -41
- package/dist/src/parser.d.ts.map +0 -1
- package/dist/src/plugins/manager.d.ts +0 -133
- package/dist/src/plugins/manager.d.ts.map +0 -1
- package/dist/src/plugins/store/discovery.d.ts +0 -88
- package/dist/src/plugins/store/discovery.d.ts.map +0 -1
- package/dist/src/plugins/store/index.d.ts +0 -76
- package/dist/src/plugins/store/index.d.ts.map +0 -1
- package/dist/src/plugins/store/search.d.ts +0 -46
- package/dist/src/plugins/store/search.d.ts.map +0 -1
- package/dist/src/plugins/store/types.d.ts +0 -274
- package/dist/src/plugins/store/types.d.ts.map +0 -1
- package/dist/src/production/circuit-breaker.d.ts +0 -101
- package/dist/src/production/circuit-breaker.d.ts.map +0 -1
- package/dist/src/production/error-handler.d.ts +0 -92
- package/dist/src/production/error-handler.d.ts.map +0 -1
- package/dist/src/production/monitoring.d.ts +0 -161
- package/dist/src/production/monitoring.d.ts.map +0 -1
- package/dist/src/production/rate-limiter.d.ts +0 -80
- package/dist/src/production/rate-limiter.d.ts.map +0 -1
- package/dist/src/production/retry.d.ts +0 -48
- package/dist/src/production/retry.d.ts.map +0 -1
- package/dist/src/prompt.d.ts +0 -44
- package/dist/src/prompt.d.ts.map +0 -1
- package/dist/src/runtime/headless.d.ts +0 -60
- package/dist/src/runtime/headless.d.ts.map +0 -1
- package/dist/src/ruvector/ast-analyzer.d.ts +0 -67
- package/dist/src/ruvector/ast-analyzer.d.ts.map +0 -1
- package/dist/src/ruvector/coverage-router.d.ts +0 -160
- package/dist/src/ruvector/coverage-router.d.ts.map +0 -1
- package/dist/src/ruvector/diff-classifier.d.ts +0 -175
- package/dist/src/ruvector/diff-classifier.d.ts.map +0 -1
- package/dist/src/ruvector/enhanced-model-router.d.ts +0 -146
- package/dist/src/ruvector/enhanced-model-router.d.ts.map +0 -1
- package/dist/src/ruvector/flash-attention.d.ts +0 -195
- package/dist/src/ruvector/flash-attention.d.ts.map +0 -1
- package/dist/src/ruvector/graph-analyzer.d.ts +0 -187
- package/dist/src/ruvector/graph-analyzer.d.ts.map +0 -1
- package/dist/src/ruvector/index.d.ts +0 -34
- package/dist/src/ruvector/index.d.ts.map +0 -1
- package/dist/src/ruvector/lora-adapter.d.ts +0 -218
- package/dist/src/ruvector/lora-adapter.d.ts.map +0 -1
- package/dist/src/ruvector/model-router.d.ts +0 -220
- package/dist/src/ruvector/model-router.d.ts.map +0 -1
- package/dist/src/ruvector/moe-router.d.ts +0 -206
- package/dist/src/ruvector/moe-router.d.ts.map +0 -1
- package/dist/src/ruvector/q-learning-router.d.ts +0 -211
- package/dist/src/ruvector/q-learning-router.d.ts.map +0 -1
- package/dist/src/ruvector/semantic-router.d.ts +0 -77
- package/dist/src/ruvector/semantic-router.d.ts.map +0 -1
- package/dist/src/ruvector/vector-db.d.ts +0 -69
- package/dist/src/ruvector/vector-db.d.ts.map +0 -1
- package/dist/src/services/claim-service.d.ts +0 -204
- package/dist/src/services/claim-service.d.ts.map +0 -1
- package/dist/src/services/container-worker-pool.d.ts +0 -197
- package/dist/src/services/container-worker-pool.d.ts.map +0 -1
- package/dist/src/services/headless-worker-executor.d.ts +0 -304
- package/dist/src/services/headless-worker-executor.d.ts.map +0 -1
- package/dist/src/services/registry-api.d.ts +0 -58
- package/dist/src/services/registry-api.d.ts.map +0 -1
- package/dist/src/services/ruvector-training.d.ts +0 -213
- package/dist/src/services/ruvector-training.d.ts.map +0 -1
- package/dist/src/services/worker-daemon.d.ts +0 -203
- package/dist/src/services/worker-daemon.d.ts.map +0 -1
- package/dist/src/services/worker-queue.d.ts +0 -194
- package/dist/src/services/worker-queue.d.ts.map +0 -1
- package/dist/src/suggest.d.ts +0 -53
- package/dist/src/suggest.d.ts.map +0 -1
- package/dist/src/transfer/export.d.ts +0 -25
- package/dist/src/transfer/export.d.ts.map +0 -1
- package/dist/src/transfer/ipfs/client.d.ts +0 -109
- package/dist/src/transfer/ipfs/client.d.ts.map +0 -1
- package/dist/src/transfer/ipfs/upload.d.ts +0 -95
- package/dist/src/transfer/ipfs/upload.d.ts.map +0 -1
- package/dist/src/transfer/models/seraphine.d.ts +0 -72
- package/dist/src/transfer/models/seraphine.d.ts.map +0 -1
- package/dist/src/transfer/serialization/cfp.d.ts +0 -49
- package/dist/src/transfer/serialization/cfp.d.ts.map +0 -1
- package/dist/src/transfer/storage/gcs.d.ts +0 -82
- package/dist/src/transfer/storage/gcs.d.ts.map +0 -1
- package/dist/src/transfer/store/discovery.d.ts +0 -84
- package/dist/src/transfer/store/discovery.d.ts.map +0 -1
- package/dist/src/transfer/store/download.d.ts +0 -70
- package/dist/src/transfer/store/download.d.ts.map +0 -1
- package/dist/src/transfer/store/index.d.ts +0 -84
- package/dist/src/transfer/store/index.d.ts.map +0 -1
- package/dist/src/transfer/store/publish.d.ts +0 -76
- package/dist/src/transfer/store/publish.d.ts.map +0 -1
- package/dist/src/transfer/store/search.d.ts +0 -54
- package/dist/src/transfer/store/search.d.ts.map +0 -1
- package/dist/src/transfer/types.d.ts +0 -245
- package/dist/src/transfer/types.d.ts.map +0 -1
- package/dist/src/types.d.ts +0 -198
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/update/checker.d.ts +0 -34
- package/dist/src/update/checker.d.ts.map +0 -1
- package/dist/src/update/executor.d.ts +0 -32
- package/dist/src/update/executor.d.ts.map +0 -1
- package/dist/src/update/index.d.ts +0 -33
- package/dist/src/update/index.d.ts.map +0 -1
- package/dist/src/update/rate-limiter.d.ts +0 -20
- package/dist/src/update/rate-limiter.d.ts.map +0 -1
- package/dist/src/update/validator.d.ts +0 -17
- package/dist/src/update/validator.d.ts.map +0 -1
|
@@ -5,6 +5,42 @@
|
|
|
5
5
|
* Updated to support --claude flag for launching interactive Claude Code sessions
|
|
6
6
|
* PR: Fix #955 - Implement --claude flag for hive-mind spawn command
|
|
7
7
|
*/
|
|
8
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
18
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
19
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
20
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
21
|
+
function step(op) {
|
|
22
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
23
|
+
while (_) try {
|
|
24
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
25
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
26
|
+
switch (op[0]) {
|
|
27
|
+
case 0: case 1: t = op; break;
|
|
28
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
29
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
30
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
31
|
+
default:
|
|
32
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
33
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
34
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
35
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
36
|
+
if (t[2]) _.ops.pop();
|
|
37
|
+
_.trys.pop(); continue;
|
|
38
|
+
}
|
|
39
|
+
op = body.call(thisArg, _);
|
|
40
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
41
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
42
|
+
}
|
|
43
|
+
};
|
|
8
44
|
import { output } from '../output.js';
|
|
9
45
|
import { select, confirm, input } from '../prompt.js';
|
|
10
46
|
import { callMCPTool, MCPClientError } from '../mcp-client.js';
|
|
@@ -12,14 +48,14 @@ import { spawn as childSpawn, execSync } from 'child_process';
|
|
|
12
48
|
import { mkdir, writeFile } from 'fs/promises';
|
|
13
49
|
import { join } from 'path';
|
|
14
50
|
// Hive topologies
|
|
15
|
-
|
|
51
|
+
var TOPOLOGIES = [
|
|
16
52
|
{ value: 'hierarchical', label: 'Hierarchical', hint: 'Queen-led with worker agents' },
|
|
17
53
|
{ value: 'mesh', label: 'Mesh', hint: 'Peer-to-peer coordination' },
|
|
18
54
|
{ value: 'hierarchical-mesh', label: 'Hierarchical Mesh', hint: 'Queen + peer communication (recommended)' },
|
|
19
55
|
{ value: 'adaptive', label: 'Adaptive', hint: 'Dynamic topology based on task' }
|
|
20
56
|
];
|
|
21
57
|
// Consensus strategies
|
|
22
|
-
|
|
58
|
+
var CONSENSUS_STRATEGIES = [
|
|
23
59
|
{ value: 'byzantine', label: 'Byzantine Fault Tolerant', hint: '2/3 majority, handles malicious actors' },
|
|
24
60
|
{ value: 'raft', label: 'Raft', hint: 'Leader-based consensus' },
|
|
25
61
|
{ value: 'gossip', label: 'Gossip', hint: 'Eventually consistent, scalable' },
|
|
@@ -30,9 +66,10 @@ const CONSENSUS_STRATEGIES = [
|
|
|
30
66
|
* Group workers by their type for prompt generation
|
|
31
67
|
*/
|
|
32
68
|
function groupWorkersByType(workers) {
|
|
33
|
-
|
|
34
|
-
for (
|
|
35
|
-
|
|
69
|
+
var groups = {};
|
|
70
|
+
for (var _i = 0, workers_1 = workers; _i < workers_1.length; _i++) {
|
|
71
|
+
var worker = workers_1[_i];
|
|
72
|
+
var type = worker.type || worker.role || 'worker';
|
|
36
73
|
if (!groups[type]) {
|
|
37
74
|
groups[type] = [];
|
|
38
75
|
}
|
|
@@ -45,267 +82,187 @@ function groupWorkersByType(workers) {
|
|
|
45
82
|
* Ported from v2.7.47 with enhancements for v3
|
|
46
83
|
*/
|
|
47
84
|
function generateHiveMindPrompt(swarmId, swarmName, objective, workers, workerGroups, flags) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return
|
|
54
|
-
═══════════════════════════════════════════════
|
|
55
|
-
|
|
56
|
-
You are the Queen coordinator of a Hive Mind swarm with collective intelligence capabilities.
|
|
57
|
-
|
|
58
|
-
HIVE MIND CONFIGURATION:
|
|
59
|
-
📌 Swarm ID: ${swarmId}
|
|
60
|
-
📌 Swarm Name: ${swarmName}
|
|
61
|
-
🎯 Objective: ${objective}
|
|
62
|
-
👑 Queen Type: ${queenType}
|
|
63
|
-
🐝 Worker Count: ${workers.length}
|
|
64
|
-
🔗 Topology: ${topology}
|
|
65
|
-
🤝 Consensus Algorithm: ${consensusAlgorithm}
|
|
66
|
-
⏰ Initialized: ${currentTime}
|
|
67
|
-
|
|
68
|
-
WORKER DISTRIBUTION:
|
|
69
|
-
${workerTypes.map(type => `• ${type}: ${workerGroups[type].length} agents`).join('\n')}
|
|
70
|
-
|
|
71
|
-
🔧 AVAILABLE MCP TOOLS FOR HIVE MIND COORDINATION:
|
|
72
|
-
|
|
73
|
-
1️⃣ **COLLECTIVE INTELLIGENCE**
|
|
74
|
-
mcp__claude-flow__hive-mind_consensus - Democratic decision making
|
|
75
|
-
mcp__claude-flow__hive-mind_memory - Share knowledge across the hive
|
|
76
|
-
mcp__claude-flow__hive-mind_broadcast - Broadcast to all workers
|
|
77
|
-
mcp__claude-flow__neural_patterns - Neural pattern recognition
|
|
78
|
-
|
|
79
|
-
2️⃣ **QUEEN COORDINATION**
|
|
80
|
-
mcp__claude-flow__hive-mind_status - Monitor swarm health
|
|
81
|
-
mcp__claude-flow__task_create - Create and delegate tasks
|
|
82
|
-
mcp__claude-flow__task_orchestrate - Orchestrate task distribution
|
|
83
|
-
mcp__claude-flow__agent_spawn - Spawn additional workers
|
|
84
|
-
|
|
85
|
-
3️⃣ **WORKER MANAGEMENT**
|
|
86
|
-
mcp__claude-flow__agent_list - List all active agents
|
|
87
|
-
mcp__claude-flow__agent_status - Check agent status
|
|
88
|
-
mcp__claude-flow__agent_metrics - Track worker performance
|
|
89
|
-
mcp__claude-flow__hive-mind_join - Add agent to hive
|
|
90
|
-
mcp__claude-flow__hive-mind_leave - Remove agent from hive
|
|
91
|
-
|
|
92
|
-
4️⃣ **TASK ORCHESTRATION**
|
|
93
|
-
mcp__claude-flow__task_create - Create hierarchical tasks
|
|
94
|
-
mcp__claude-flow__task_status - Track task progress
|
|
95
|
-
mcp__claude-flow__task_complete - Mark tasks complete
|
|
96
|
-
mcp__claude-flow__workflow_create - Create workflows
|
|
97
|
-
|
|
98
|
-
5️⃣ **MEMORY & LEARNING**
|
|
99
|
-
mcp__claude-flow__memory_store - Store collective knowledge
|
|
100
|
-
mcp__claude-flow__memory_retrieve - Access shared memory
|
|
101
|
-
mcp__claude-flow__memory_search - Search memory patterns
|
|
102
|
-
mcp__claude-flow__neural_train - Learn from experiences
|
|
103
|
-
mcp__claude-flow__hooks_intelligence_pattern-store - Store patterns
|
|
104
|
-
|
|
105
|
-
📋 HIVE MIND EXECUTION PROTOCOL:
|
|
106
|
-
|
|
107
|
-
1. **INITIALIZATION PHASE**
|
|
108
|
-
- Verify all workers are online and responsive
|
|
109
|
-
- Establish communication channels
|
|
110
|
-
- Load previous session state if available
|
|
111
|
-
- Initialize shared memory space
|
|
112
|
-
|
|
113
|
-
2. **TASK DISTRIBUTION PHASE**
|
|
114
|
-
- Analyze the objective and decompose into subtasks
|
|
115
|
-
- Assign tasks based on worker specializations
|
|
116
|
-
- Set up task dependencies and ordering
|
|
117
|
-
- Monitor parallel execution
|
|
118
|
-
|
|
119
|
-
3. **COORDINATION PHASE**
|
|
120
|
-
- Use consensus for critical decisions
|
|
121
|
-
- Aggregate results from workers
|
|
122
|
-
- Resolve conflicts using ${consensusAlgorithm} consensus
|
|
123
|
-
- Share learnings across the hive
|
|
124
|
-
|
|
125
|
-
4. **COMPLETION PHASE**
|
|
126
|
-
- Verify all subtasks are complete
|
|
127
|
-
- Consolidate results
|
|
128
|
-
- Store learnings in collective memory
|
|
129
|
-
- Report final status
|
|
130
|
-
|
|
131
|
-
🎯 YOUR OBJECTIVE:
|
|
132
|
-
${objective}
|
|
133
|
-
|
|
134
|
-
💡 COORDINATION TIPS:
|
|
135
|
-
• Use mcp__claude-flow__hive-mind_broadcast for swarm-wide announcements
|
|
136
|
-
• Check worker status regularly with mcp__claude-flow__hive-mind_status
|
|
137
|
-
• Store important decisions in shared memory for persistence
|
|
138
|
-
• Use consensus for any decisions affecting multiple workers
|
|
139
|
-
• Monitor task progress and reassign if workers are blocked
|
|
140
|
-
|
|
141
|
-
🚀 BEGIN HIVE MIND COORDINATION NOW!
|
|
142
|
-
Start by checking the current hive status and then proceed with the objective.
|
|
143
|
-
`;
|
|
85
|
+
var currentTime = new Date().toISOString();
|
|
86
|
+
var workerTypes = Object.keys(workerGroups);
|
|
87
|
+
var queenType = flags.queenType || 'strategic';
|
|
88
|
+
var consensusAlgorithm = flags.consensus || 'byzantine';
|
|
89
|
+
var topology = flags.topology || 'hierarchical-mesh';
|
|
90
|
+
return "\uD83E\uDDE0 HIVE MIND COLLECTIVE INTELLIGENCE SYSTEM\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n\nYou are the Queen coordinator of a Hive Mind swarm with collective intelligence capabilities.\n\nHIVE MIND CONFIGURATION:\n\uD83D\uDCCC Swarm ID: " + swarmId + "\n\uD83D\uDCCC Swarm Name: " + swarmName + "\n\uD83C\uDFAF Objective: " + objective + "\n\uD83D\uDC51 Queen Type: " + queenType + "\n\uD83D\uDC1D Worker Count: " + workers.length + "\n\uD83D\uDD17 Topology: " + topology + "\n\uD83E\uDD1D Consensus Algorithm: " + consensusAlgorithm + "\n\u23F0 Initialized: " + currentTime + "\n\nWORKER DISTRIBUTION:\n" + workerTypes.map(function (type) { return "\u2022 " + type + ": " + workerGroups[type].length + " agents"; }).join('\n') + "\n\n\uD83D\uDD27 AVAILABLE MCP TOOLS FOR HIVE MIND COORDINATION:\n\n1\uFE0F\u20E3 **COLLECTIVE INTELLIGENCE**\n mcp__ruflo__hive-mind_consensus - Democratic decision making\n mcp__ruflo__hive-mind_memory - Share knowledge across the hive\n mcp__ruflo__hive-mind_broadcast - Broadcast to all workers\n mcp__ruflo__neural_patterns - Neural pattern recognition\n\n2\uFE0F\u20E3 **QUEEN COORDINATION**\n mcp__ruflo__hive-mind_status - Monitor swarm health\n mcp__ruflo__task_create - Create and delegate tasks\n mcp__ruflo__coordination_orchestrate - Orchestrate task distribution\n mcp__ruflo__agent_spawn - Spawn additional workers\n\n3\uFE0F\u20E3 **WORKER MANAGEMENT**\n mcp__ruflo__agent_list - List all active agents\n mcp__ruflo__agent_status - Check agent status\n mcp__ruflo__agent_health - Check worker health\n mcp__ruflo__hive-mind_join - Add agent to hive\n mcp__ruflo__hive-mind_leave - Remove agent from hive\n\n4\uFE0F\u20E3 **TASK ORCHESTRATION**\n mcp__ruflo__task_assign - Assign tasks to workers\n mcp__ruflo__task_status - Track task progress\n mcp__ruflo__task_complete - Mark tasks complete\n mcp__ruflo__workflow_create - Create workflows\n\n5\uFE0F\u20E3 **MEMORY & LEARNING**\n mcp__ruflo__memory_store - Store collective knowledge\n mcp__ruflo__memory_retrieve - Access shared memory\n mcp__ruflo__memory_search - Search memory patterns\n mcp__ruflo__neural_train - Learn from experiences\n mcp__ruflo__hooks_intelligence_pattern-store - Store patterns\n\n\uD83D\uDCCB HIVE MIND EXECUTION PROTOCOL:\n\n1. **INITIALIZATION PHASE**\n - Verify all workers are online and responsive\n - Establish communication channels\n - Load previous session state if available\n - Initialize shared memory space\n\n2. **TASK DISTRIBUTION PHASE**\n - Analyze the objective and decompose into subtasks\n - Assign tasks based on worker specializations\n - Set up task dependencies and ordering\n - Monitor parallel execution\n\n3. **COORDINATION PHASE**\n - Use consensus for critical decisions\n - Aggregate results from workers\n - Resolve conflicts using " + consensusAlgorithm + " consensus\n - Share learnings across the hive\n\n4. **COMPLETION PHASE**\n - Verify all subtasks are complete\n - Consolidate results\n - Store learnings in collective memory\n - Report final status\n\n\uD83C\uDFAF YOUR OBJECTIVE:\n" + objective + "\n\n\uD83D\uDCA1 COORDINATION TIPS:\n\u2022 Use mcp__ruflo__hive-mind_broadcast for swarm-wide announcements\n\u2022 Check worker status regularly with mcp__ruflo__hive-mind_status\n\u2022 Store important decisions in shared memory for persistence\n\u2022 Use consensus for any decisions affecting multiple workers\n\u2022 Use mcp__ruflo__task_assign to assign tasks to workers, then mcp__ruflo__task_complete when done\n\n\uD83D\uDE80 BEGIN HIVE MIND COORDINATION NOW!\nStart by checking the current hive status and then proceed with the objective.\n";
|
|
144
91
|
}
|
|
145
92
|
/**
|
|
146
93
|
* Spawn Claude Code with Hive Mind coordination instructions
|
|
147
94
|
* Ported from v2.7.47 spawnClaudeCodeInstances function
|
|
148
95
|
*/
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
try {
|
|
156
|
-
// Generate comprehensive Hive Mind prompt
|
|
157
|
-
const workerGroups = groupWorkersByType(workers);
|
|
158
|
-
const hiveMindPrompt = generateHiveMindPrompt(swarmId, swarmName, objective, workers, workerGroups, flags);
|
|
159
|
-
spinner.succeed('Hive Mind coordination prompt ready!');
|
|
160
|
-
// Display coordination summary
|
|
161
|
-
output.writeln();
|
|
162
|
-
output.writeln(output.bold('🧠 Hive Mind Configuration'));
|
|
163
|
-
output.writeln(output.dim('─'.repeat(60)));
|
|
164
|
-
output.printList([
|
|
165
|
-
`Swarm ID: ${output.highlight(swarmId)}`,
|
|
166
|
-
`Objective: ${output.highlight(objective)}`,
|
|
167
|
-
`Queen Type: ${output.highlight(flags.queenType || 'strategic')}`,
|
|
168
|
-
`Worker Count: ${output.highlight(String(workers.length))}`,
|
|
169
|
-
`Worker Types: ${output.highlight(Object.keys(workerGroups).join(', '))}`,
|
|
170
|
-
`Consensus: ${output.highlight(flags.consensus || 'byzantine')}`,
|
|
171
|
-
`MCP Tools: ${output.success('Full KynjalFlow integration enabled')}`
|
|
172
|
-
]);
|
|
173
|
-
// Ensure sessions directory exists
|
|
174
|
-
const sessionsDir = join('.hive-mind', 'sessions');
|
|
175
|
-
await mkdir(sessionsDir, { recursive: true });
|
|
176
|
-
const promptFile = join(sessionsDir, `hive-mind-prompt-${swarmId}.txt`);
|
|
177
|
-
await writeFile(promptFile, hiveMindPrompt, 'utf8');
|
|
178
|
-
output.writeln();
|
|
179
|
-
output.printSuccess(`Hive Mind prompt saved to: ${promptFile}`);
|
|
180
|
-
// Check if claude command exists
|
|
181
|
-
let claudeAvailable = false;
|
|
182
|
-
try {
|
|
183
|
-
execSync('which claude', { stdio: 'ignore' });
|
|
184
|
-
claudeAvailable = true;
|
|
185
|
-
}
|
|
186
|
-
catch {
|
|
187
|
-
output.writeln();
|
|
188
|
-
output.printWarning('Claude Code CLI not found in PATH');
|
|
189
|
-
output.writeln(output.dim('Install it with: npm install -g @anthropic-ai/claude-code'));
|
|
190
|
-
output.writeln(output.dim('Falling back to displaying instructions...'));
|
|
191
|
-
}
|
|
192
|
-
const dryRun = flags.dryRun || flags['dry-run'];
|
|
193
|
-
if (claudeAvailable && !dryRun) {
|
|
194
|
-
// Build arguments - flags first, then prompt
|
|
195
|
-
const claudeArgs = [];
|
|
196
|
-
// Check for non-interactive mode
|
|
197
|
-
const isNonInteractive = flags['non-interactive'] || flags.nonInteractive;
|
|
198
|
-
if (isNonInteractive) {
|
|
199
|
-
claudeArgs.push('-p'); // Print mode
|
|
200
|
-
claudeArgs.push('--output-format', 'stream-json');
|
|
201
|
-
claudeArgs.push('--verbose');
|
|
202
|
-
output.printInfo('Running in non-interactive mode');
|
|
203
|
-
}
|
|
204
|
-
// Add auto-permission flag unless explicitly disabled
|
|
205
|
-
const skipPermissions = flags['dangerously-skip-permissions'] !== false && !flags['no-auto-permissions'];
|
|
206
|
-
if (skipPermissions) {
|
|
207
|
-
claudeArgs.push('--dangerously-skip-permissions');
|
|
208
|
-
if (!isNonInteractive) {
|
|
209
|
-
output.printWarning('Using --dangerously-skip-permissions for seamless hive-mind execution');
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
// Add the prompt as the LAST argument
|
|
213
|
-
claudeArgs.push(hiveMindPrompt);
|
|
214
|
-
output.writeln();
|
|
215
|
-
output.printInfo('Launching Claude Code...');
|
|
216
|
-
output.writeln(output.dim('Press Ctrl+C to pause the session'));
|
|
217
|
-
// Spawn claude with properly ordered arguments
|
|
218
|
-
const claudeProcess = childSpawn('claude', claudeArgs, {
|
|
219
|
-
stdio: 'inherit',
|
|
220
|
-
shell: false,
|
|
221
|
-
});
|
|
222
|
-
// Set up SIGINT handler for session management
|
|
223
|
-
let isExiting = false;
|
|
224
|
-
const sigintHandler = () => {
|
|
225
|
-
if (isExiting)
|
|
226
|
-
return;
|
|
227
|
-
isExiting = true;
|
|
228
|
-
output.writeln();
|
|
229
|
-
output.writeln();
|
|
230
|
-
output.printWarning('Pausing session and terminating Claude Code...');
|
|
231
|
-
if (claudeProcess && !claudeProcess.killed) {
|
|
232
|
-
claudeProcess.kill('SIGTERM');
|
|
233
|
-
}
|
|
234
|
-
output.writeln();
|
|
235
|
-
output.printSuccess('Session paused');
|
|
236
|
-
output.writeln(output.dim(`Prompt file saved at: ${promptFile}`));
|
|
237
|
-
output.writeln(output.dim('To resume, run claude with the saved prompt file'));
|
|
238
|
-
process.exit(0);
|
|
239
|
-
};
|
|
240
|
-
process.on('SIGINT', sigintHandler);
|
|
241
|
-
process.on('SIGTERM', sigintHandler);
|
|
242
|
-
// Handle process exit
|
|
243
|
-
claudeProcess.on('exit', (code) => {
|
|
244
|
-
// Clean up signal handlers
|
|
245
|
-
process.removeListener('SIGINT', sigintHandler);
|
|
246
|
-
process.removeListener('SIGTERM', sigintHandler);
|
|
247
|
-
if (code === 0) {
|
|
96
|
+
function spawnClaudeCodeInstance(swarmId, swarmName, objective, workers, flags) {
|
|
97
|
+
return __awaiter(this, void 0, Promise, function () {
|
|
98
|
+
var spinner, workerGroups, hiveMindPrompt, sessionsDir, promptFile_1, claudeAvailable, dryRun, claudeArgs, isNonInteractive, skipPermissions, claudeProcess_1, isExiting_1, sigintHandler_1, error_1, errorMessage, promptFile, workerGroups, hiveMindPrompt, _a;
|
|
99
|
+
return __generator(this, function (_b) {
|
|
100
|
+
switch (_b.label) {
|
|
101
|
+
case 0:
|
|
248
102
|
output.writeln();
|
|
249
|
-
output.
|
|
250
|
-
|
|
251
|
-
|
|
103
|
+
output.writeln(output.bold('🚀 Launching Claude Code with Hive Mind Coordination'));
|
|
104
|
+
output.writeln(output.dim('─'.repeat(60)));
|
|
105
|
+
spinner = output.createSpinner({ text: 'Preparing Hive Mind coordination prompt...', spinner: 'dots' });
|
|
106
|
+
spinner.start();
|
|
107
|
+
_b.label = 1;
|
|
108
|
+
case 1:
|
|
109
|
+
_b.trys.push([1, 4, , 9]);
|
|
110
|
+
workerGroups = groupWorkersByType(workers);
|
|
111
|
+
hiveMindPrompt = generateHiveMindPrompt(swarmId, swarmName, objective, workers, workerGroups, flags);
|
|
112
|
+
spinner.succeed('Hive Mind coordination prompt ready!');
|
|
113
|
+
// Display coordination summary
|
|
252
114
|
output.writeln();
|
|
253
|
-
output.
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
115
|
+
output.writeln(output.bold('🧠 Hive Mind Configuration'));
|
|
116
|
+
output.writeln(output.dim('─'.repeat(60)));
|
|
117
|
+
output.printList([
|
|
118
|
+
"Swarm ID: " + output.highlight(swarmId),
|
|
119
|
+
"Objective: " + output.highlight(objective),
|
|
120
|
+
"Queen Type: " + output.highlight(flags.queenType || 'strategic'),
|
|
121
|
+
"Worker Count: " + output.highlight(String(workers.length)),
|
|
122
|
+
"Worker Types: " + output.highlight(Object.keys(workerGroups).join(', ')),
|
|
123
|
+
"Consensus: " + output.highlight(flags.consensus || 'byzantine'),
|
|
124
|
+
"MCP Tools: " + output.success('Full Claude-Flow integration enabled')
|
|
125
|
+
]);
|
|
126
|
+
sessionsDir = join('.hive-mind', 'sessions');
|
|
127
|
+
return [4 /*yield*/, mkdir(sessionsDir, { recursive: true })];
|
|
128
|
+
case 2:
|
|
129
|
+
_b.sent();
|
|
130
|
+
promptFile_1 = join(sessionsDir, "hive-mind-prompt-" + swarmId + ".txt");
|
|
131
|
+
return [4 /*yield*/, writeFile(promptFile_1, hiveMindPrompt, 'utf8')];
|
|
132
|
+
case 3:
|
|
133
|
+
_b.sent();
|
|
134
|
+
output.writeln();
|
|
135
|
+
output.printSuccess("Hive Mind prompt saved to: " + promptFile_1);
|
|
136
|
+
claudeAvailable = false;
|
|
137
|
+
try {
|
|
138
|
+
execSync('which claude', { stdio: 'ignore' });
|
|
139
|
+
claudeAvailable = true;
|
|
140
|
+
}
|
|
141
|
+
catch (_c) {
|
|
142
|
+
output.writeln();
|
|
143
|
+
output.printWarning('Claude Code CLI not found in PATH');
|
|
144
|
+
output.writeln(output.dim('Install it with: npm install -g @anthropic-ai/claude-code'));
|
|
145
|
+
output.writeln(output.dim('Falling back to displaying instructions...'));
|
|
146
|
+
}
|
|
147
|
+
dryRun = flags.dryRun || flags['dry-run'];
|
|
148
|
+
if (claudeAvailable && !dryRun) {
|
|
149
|
+
claudeArgs = [];
|
|
150
|
+
isNonInteractive = flags['non-interactive'] || flags.nonInteractive;
|
|
151
|
+
if (isNonInteractive) {
|
|
152
|
+
claudeArgs.push('-p'); // Print mode
|
|
153
|
+
claudeArgs.push('--output-format', 'stream-json');
|
|
154
|
+
claudeArgs.push('--verbose');
|
|
155
|
+
output.printInfo('Running in non-interactive mode');
|
|
156
|
+
}
|
|
157
|
+
skipPermissions = flags['dangerously-skip-permissions'] !== false && !flags['no-auto-permissions'];
|
|
158
|
+
if (skipPermissions) {
|
|
159
|
+
claudeArgs.push('--dangerously-skip-permissions');
|
|
160
|
+
if (!isNonInteractive) {
|
|
161
|
+
output.printWarning('Using --dangerously-skip-permissions for seamless hive-mind execution');
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
// Add the prompt as the LAST argument
|
|
165
|
+
claudeArgs.push(hiveMindPrompt);
|
|
166
|
+
output.writeln();
|
|
167
|
+
output.printInfo('Launching Claude Code...');
|
|
168
|
+
output.writeln(output.dim('Press Ctrl+C to pause the session'));
|
|
169
|
+
claudeProcess_1 = childSpawn('claude', claudeArgs, {
|
|
170
|
+
stdio: 'inherit',
|
|
171
|
+
shell: false
|
|
172
|
+
});
|
|
173
|
+
isExiting_1 = false;
|
|
174
|
+
sigintHandler_1 = function () {
|
|
175
|
+
if (isExiting_1)
|
|
176
|
+
return;
|
|
177
|
+
isExiting_1 = true;
|
|
178
|
+
output.writeln();
|
|
179
|
+
output.writeln();
|
|
180
|
+
output.printWarning('Pausing session and terminating Claude Code...');
|
|
181
|
+
if (claudeProcess_1 && !claudeProcess_1.killed) {
|
|
182
|
+
claudeProcess_1.kill('SIGTERM');
|
|
183
|
+
}
|
|
184
|
+
output.writeln();
|
|
185
|
+
output.printSuccess('Session paused');
|
|
186
|
+
output.writeln(output.dim("Prompt file saved at: " + promptFile_1));
|
|
187
|
+
output.writeln(output.dim('To resume, run claude with the saved prompt file'));
|
|
188
|
+
process.exit(0);
|
|
189
|
+
};
|
|
190
|
+
process.on('SIGINT', sigintHandler_1);
|
|
191
|
+
process.on('SIGTERM', sigintHandler_1);
|
|
192
|
+
// Handle process exit
|
|
193
|
+
claudeProcess_1.on('exit', function (code) {
|
|
194
|
+
// Clean up signal handlers
|
|
195
|
+
process.removeListener('SIGINT', sigintHandler_1);
|
|
196
|
+
process.removeListener('SIGTERM', sigintHandler_1);
|
|
197
|
+
if (code === 0) {
|
|
198
|
+
output.writeln();
|
|
199
|
+
output.printSuccess('Claude Code completed successfully');
|
|
200
|
+
}
|
|
201
|
+
else if (code !== null) {
|
|
202
|
+
output.writeln();
|
|
203
|
+
output.printError("Claude Code exited with code " + code);
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
output.writeln();
|
|
207
|
+
output.printSuccess('Claude Code launched with Hive Mind coordination');
|
|
208
|
+
output.printInfo('The Queen coordinator will orchestrate all worker agents');
|
|
209
|
+
output.writeln(output.dim("Prompt file saved at: " + promptFile_1));
|
|
210
|
+
return [2 /*return*/, { success: true, promptFile: promptFile_1 }];
|
|
211
|
+
}
|
|
212
|
+
else if (dryRun) {
|
|
213
|
+
output.writeln();
|
|
214
|
+
output.printInfo('Dry run - would execute Claude Code with prompt:');
|
|
215
|
+
output.writeln(output.dim("Prompt length: " + hiveMindPrompt.length + " characters"));
|
|
216
|
+
output.writeln();
|
|
217
|
+
output.writeln(output.dim('First 500 characters of prompt:'));
|
|
218
|
+
output.writeln(output.highlight(hiveMindPrompt.substring(0, 500) + '...'));
|
|
219
|
+
output.writeln();
|
|
220
|
+
output.writeln(output.dim("Full prompt saved to: " + promptFile_1));
|
|
221
|
+
return [2 /*return*/, { success: true, promptFile: promptFile_1 }];
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
// Claude not available - show instructions
|
|
225
|
+
output.writeln();
|
|
226
|
+
output.writeln(output.bold('📋 Manual Execution Instructions:'));
|
|
227
|
+
output.writeln(output.dim('─'.repeat(50)));
|
|
228
|
+
output.printList([
|
|
229
|
+
'Install Claude Code: npm install -g @anthropic-ai/claude-code',
|
|
230
|
+
"Run with saved prompt: claude < " + promptFile_1,
|
|
231
|
+
"Or copy manually: cat " + promptFile_1 + " | claude",
|
|
232
|
+
"With auto-permissions: claude --dangerously-skip-permissions < " + promptFile_1
|
|
233
|
+
]);
|
|
234
|
+
return [2 /*return*/, { success: true, promptFile: promptFile_1 }];
|
|
235
|
+
}
|
|
236
|
+
return [3 /*break*/, 9];
|
|
237
|
+
case 4:
|
|
238
|
+
error_1 = _b.sent();
|
|
239
|
+
spinner.fail('Failed to prepare Claude Code coordination');
|
|
240
|
+
errorMessage = error_1 instanceof Error ? error_1.message : String(error_1);
|
|
241
|
+
output.printError("Error: " + errorMessage);
|
|
242
|
+
_b.label = 5;
|
|
243
|
+
case 5:
|
|
244
|
+
_b.trys.push([5, 7, , 8]);
|
|
245
|
+
promptFile = "hive-mind-prompt-" + swarmId + "-fallback.txt";
|
|
246
|
+
workerGroups = groupWorkersByType(workers);
|
|
247
|
+
hiveMindPrompt = generateHiveMindPrompt(swarmId, swarmName, objective, workers, workerGroups, flags);
|
|
248
|
+
return [4 /*yield*/, writeFile(promptFile, hiveMindPrompt, 'utf8')];
|
|
249
|
+
case 6:
|
|
250
|
+
_b.sent();
|
|
251
|
+
output.writeln();
|
|
252
|
+
output.printSuccess("Prompt saved to: " + promptFile);
|
|
253
|
+
output.writeln(output.dim('You can run Claude Code manually with the saved prompt'));
|
|
254
|
+
return [2 /*return*/, { success: false, promptFile: promptFile, error: errorMessage }];
|
|
255
|
+
case 7:
|
|
256
|
+
_a = _b.sent();
|
|
257
|
+
return [2 /*return*/, { success: false, error: errorMessage }];
|
|
258
|
+
case 8: return [3 /*break*/, 9];
|
|
259
|
+
case 9: return [2 /*return*/];
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
});
|
|
306
263
|
}
|
|
307
264
|
// Init subcommand
|
|
308
|
-
|
|
265
|
+
var initCommand = {
|
|
309
266
|
name: 'init',
|
|
310
267
|
description: 'Initialize a hive mind',
|
|
311
268
|
options: [
|
|
@@ -314,107 +271,124 @@ const initCommand = {
|
|
|
314
271
|
short: 't',
|
|
315
272
|
description: 'Hive topology',
|
|
316
273
|
type: 'string',
|
|
317
|
-
choices: TOPOLOGIES.map(t
|
|
318
|
-
default: 'hierarchical-mesh'
|
|
274
|
+
choices: TOPOLOGIES.map(function (t) { return t.value; }),
|
|
275
|
+
"default": 'hierarchical-mesh'
|
|
319
276
|
},
|
|
320
277
|
{
|
|
321
278
|
name: 'consensus',
|
|
322
279
|
short: 'c',
|
|
323
280
|
description: 'Consensus strategy',
|
|
324
281
|
type: 'string',
|
|
325
|
-
choices: CONSENSUS_STRATEGIES.map(s
|
|
326
|
-
default: 'byzantine'
|
|
282
|
+
choices: CONSENSUS_STRATEGIES.map(function (s) { return s.value; }),
|
|
283
|
+
"default": 'byzantine'
|
|
327
284
|
},
|
|
328
285
|
{
|
|
329
286
|
name: 'max-agents',
|
|
330
287
|
short: 'm',
|
|
331
288
|
description: 'Maximum agents',
|
|
332
289
|
type: 'number',
|
|
333
|
-
default: 15
|
|
290
|
+
"default": 15
|
|
334
291
|
},
|
|
335
292
|
{
|
|
336
293
|
name: 'persist',
|
|
337
294
|
short: 'p',
|
|
338
295
|
description: 'Enable persistent state',
|
|
339
296
|
type: 'boolean',
|
|
340
|
-
default: true
|
|
297
|
+
"default": true
|
|
341
298
|
},
|
|
342
299
|
{
|
|
343
300
|
name: 'memory-backend',
|
|
344
301
|
description: 'Memory backend (agentdb, sqlite, hybrid)',
|
|
345
302
|
type: 'string',
|
|
346
|
-
default: 'hybrid'
|
|
303
|
+
"default": 'hybrid'
|
|
347
304
|
}
|
|
348
305
|
],
|
|
349
306
|
examples: [
|
|
350
307
|
{ command: 'claude-flow hive-mind init -t hierarchical-mesh', description: 'Init hierarchical mesh' },
|
|
351
308
|
{ command: 'claude-flow hive-mind init -c byzantine -m 20', description: 'Init with Byzantine consensus' }
|
|
352
309
|
],
|
|
353
|
-
action:
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
310
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
311
|
+
var topology, consensus, config, spinner, result, error_2;
|
|
312
|
+
var _a, _b, _c, _d, _e;
|
|
313
|
+
return __generator(this, function (_f) {
|
|
314
|
+
switch (_f.label) {
|
|
315
|
+
case 0:
|
|
316
|
+
topology = ctx.flags.topology;
|
|
317
|
+
consensus = ctx.flags.consensus;
|
|
318
|
+
if (!(ctx.interactive && !ctx.flags.topology)) return [3 /*break*/, 2];
|
|
319
|
+
return [4 /*yield*/, select({
|
|
320
|
+
message: 'Select hive topology:',
|
|
321
|
+
options: TOPOLOGIES,
|
|
322
|
+
"default": 'hierarchical-mesh'
|
|
323
|
+
})];
|
|
324
|
+
case 1:
|
|
325
|
+
topology = _f.sent();
|
|
326
|
+
_f.label = 2;
|
|
327
|
+
case 2:
|
|
328
|
+
if (!(ctx.interactive && !ctx.flags.consensus)) return [3 /*break*/, 4];
|
|
329
|
+
return [4 /*yield*/, select({
|
|
330
|
+
message: 'Select consensus strategy:',
|
|
331
|
+
options: CONSENSUS_STRATEGIES,
|
|
332
|
+
"default": 'byzantine'
|
|
333
|
+
})];
|
|
334
|
+
case 3:
|
|
335
|
+
consensus = _f.sent();
|
|
336
|
+
_f.label = 4;
|
|
337
|
+
case 4:
|
|
338
|
+
config = {
|
|
339
|
+
topology: topology || 'hierarchical-mesh',
|
|
340
|
+
consensus: consensus || 'byzantine',
|
|
341
|
+
maxAgents: ctx.flags.maxAgents || 15,
|
|
342
|
+
persist: ctx.flags.persist,
|
|
343
|
+
memoryBackend: ctx.flags.memoryBackend || 'hybrid'
|
|
344
|
+
};
|
|
345
|
+
output.writeln();
|
|
346
|
+
output.writeln(output.bold('Initializing Hive Mind'));
|
|
347
|
+
spinner = output.createSpinner({ text: 'Setting up hive infrastructure...', spinner: 'dots' });
|
|
348
|
+
spinner.start();
|
|
349
|
+
_f.label = 5;
|
|
350
|
+
case 5:
|
|
351
|
+
_f.trys.push([5, 7, , 8]);
|
|
352
|
+
return [4 /*yield*/, callMCPTool('hive-mind_init', config)];
|
|
353
|
+
case 6:
|
|
354
|
+
result = _f.sent();
|
|
355
|
+
spinner.succeed('Hive Mind initialized');
|
|
356
|
+
if (ctx.flags.format === 'json') {
|
|
357
|
+
output.printJson(result);
|
|
358
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
359
|
+
}
|
|
360
|
+
output.writeln();
|
|
361
|
+
output.printBox([
|
|
362
|
+
"Hive ID: " + ((_a = result.hiveId) !== null && _a !== void 0 ? _a : 'default'),
|
|
363
|
+
"Queen ID: " + ((_b = result.queenId) !== null && _b !== void 0 ? _b : 'N/A'),
|
|
364
|
+
"Topology: " + ((_c = result.topology) !== null && _c !== void 0 ? _c : config.topology),
|
|
365
|
+
"Consensus: " + ((_d = result.consensus) !== null && _d !== void 0 ? _d : config.consensus),
|
|
366
|
+
"Max Agents: " + config.maxAgents,
|
|
367
|
+
"Memory: " + config.memoryBackend,
|
|
368
|
+
"Status: " + output.success((_e = result.status) !== null && _e !== void 0 ? _e : 'initialized')
|
|
369
|
+
].join('\n'), 'Hive Mind Configuration');
|
|
370
|
+
output.writeln();
|
|
371
|
+
output.printInfo('Queen agent is ready to coordinate worker agents');
|
|
372
|
+
output.writeln(output.dim(' Use "claude-flow hive-mind spawn" to add workers'));
|
|
373
|
+
output.writeln(output.dim(' Use "claude-flow hive-mind spawn --claude" to launch Claude Code'));
|
|
374
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
375
|
+
case 7:
|
|
376
|
+
error_2 = _f.sent();
|
|
377
|
+
spinner.fail('Failed to initialize');
|
|
378
|
+
if (error_2 instanceof MCPClientError) {
|
|
379
|
+
output.printError("Init error: " + error_2.message);
|
|
380
|
+
}
|
|
381
|
+
else {
|
|
382
|
+
output.printError("Unexpected error: " + String(error_2));
|
|
383
|
+
}
|
|
384
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
385
|
+
case 8: return [2 /*return*/];
|
|
411
386
|
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}
|
|
387
|
+
});
|
|
388
|
+
}); }
|
|
415
389
|
};
|
|
416
390
|
// Spawn subcommand - UPDATED with --claude flag
|
|
417
|
-
|
|
391
|
+
var spawnCommand = {
|
|
418
392
|
name: 'spawn',
|
|
419
393
|
description: 'Spawn worker agents into the hive (use --claude to launch Claude Code)',
|
|
420
394
|
options: [
|
|
@@ -423,7 +397,7 @@ const spawnCommand = {
|
|
|
423
397
|
short: 'n',
|
|
424
398
|
description: 'Number of workers to spawn',
|
|
425
399
|
type: 'number',
|
|
426
|
-
default: 1
|
|
400
|
+
"default": 1
|
|
427
401
|
},
|
|
428
402
|
{
|
|
429
403
|
name: 'role',
|
|
@@ -431,28 +405,28 @@ const spawnCommand = {
|
|
|
431
405
|
description: 'Worker role (worker, specialist, scout)',
|
|
432
406
|
type: 'string',
|
|
433
407
|
choices: ['worker', 'specialist', 'scout'],
|
|
434
|
-
default: 'worker'
|
|
408
|
+
"default": 'worker'
|
|
435
409
|
},
|
|
436
410
|
{
|
|
437
411
|
name: 'type',
|
|
438
412
|
short: 't',
|
|
439
413
|
description: 'Agent type',
|
|
440
414
|
type: 'string',
|
|
441
|
-
default: 'worker'
|
|
415
|
+
"default": 'worker'
|
|
442
416
|
},
|
|
443
417
|
{
|
|
444
418
|
name: 'prefix',
|
|
445
419
|
short: 'p',
|
|
446
420
|
description: 'Prefix for worker IDs',
|
|
447
421
|
type: 'string',
|
|
448
|
-
default: 'hive-worker'
|
|
422
|
+
"default": 'hive-worker'
|
|
449
423
|
},
|
|
450
424
|
// NEW: --claude flag for launching Claude Code
|
|
451
425
|
{
|
|
452
426
|
name: 'claude',
|
|
453
427
|
description: 'Launch Claude Code with hive-mind coordination prompt',
|
|
454
428
|
type: 'boolean',
|
|
455
|
-
default: false
|
|
429
|
+
"default": false
|
|
456
430
|
},
|
|
457
431
|
{
|
|
458
432
|
name: 'objective',
|
|
@@ -464,25 +438,25 @@ const spawnCommand = {
|
|
|
464
438
|
name: 'dangerously-skip-permissions',
|
|
465
439
|
description: 'Skip permission prompts in Claude Code (use with caution)',
|
|
466
440
|
type: 'boolean',
|
|
467
|
-
default: true
|
|
441
|
+
"default": true
|
|
468
442
|
},
|
|
469
443
|
{
|
|
470
444
|
name: 'no-auto-permissions',
|
|
471
445
|
description: 'Disable automatic permission skipping',
|
|
472
446
|
type: 'boolean',
|
|
473
|
-
default: false
|
|
447
|
+
"default": false
|
|
474
448
|
},
|
|
475
449
|
{
|
|
476
450
|
name: 'dry-run',
|
|
477
451
|
description: 'Show what would be done without launching Claude Code',
|
|
478
452
|
type: 'boolean',
|
|
479
|
-
default: false
|
|
453
|
+
"default": false
|
|
480
454
|
},
|
|
481
455
|
{
|
|
482
456
|
name: 'non-interactive',
|
|
483
457
|
description: 'Run Claude Code in non-interactive mode',
|
|
484
458
|
type: 'boolean',
|
|
485
|
-
default: false
|
|
459
|
+
"default": false
|
|
486
460
|
}
|
|
487
461
|
],
|
|
488
462
|
examples: [
|
|
@@ -492,104 +466,116 @@ const spawnCommand = {
|
|
|
492
466
|
{ command: 'claude-flow hive-mind spawn --claude -o "Build a REST API"', description: 'Launch Claude Code with objective' },
|
|
493
467
|
{ command: 'claude-flow hive-mind spawn -n 5 --claude -o "Research AI patterns"', description: 'Spawn workers and launch Claude Code' }
|
|
494
468
|
],
|
|
495
|
-
action:
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
// Get objective if not provided
|
|
543
|
-
if (!objective && ctx.interactive) {
|
|
544
|
-
objective = await input({
|
|
545
|
-
message: 'Enter the objective for the hive mind:',
|
|
546
|
-
validate: (v) => v.length > 0 || 'Objective is required when using --claude'
|
|
469
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
470
|
+
var count, role, agentType, prefix, launchClaude, objective, result, displayData, swarmId, swarmName, statusResult, _a, workers, claudeResult, error_3;
|
|
471
|
+
return __generator(this, function (_b) {
|
|
472
|
+
switch (_b.label) {
|
|
473
|
+
case 0:
|
|
474
|
+
count = ctx.flags.count || 1;
|
|
475
|
+
role = ctx.flags.role || 'worker';
|
|
476
|
+
agentType = ctx.flags.type || 'worker';
|
|
477
|
+
prefix = ctx.flags.prefix || 'hive-worker';
|
|
478
|
+
launchClaude = ctx.flags.claude;
|
|
479
|
+
objective = ctx.flags.objective || ctx.args.join(' ');
|
|
480
|
+
output.printInfo("Spawning " + count + " " + role + " agent(s)...");
|
|
481
|
+
_b.label = 1;
|
|
482
|
+
case 1:
|
|
483
|
+
_b.trys.push([1, 11, , 12]);
|
|
484
|
+
return [4 /*yield*/, callMCPTool('hive-mind_spawn', {
|
|
485
|
+
count: count,
|
|
486
|
+
role: role,
|
|
487
|
+
agentType: agentType,
|
|
488
|
+
prefix: prefix
|
|
489
|
+
})];
|
|
490
|
+
case 2:
|
|
491
|
+
result = _b.sent();
|
|
492
|
+
// Check for errors from MCP tool
|
|
493
|
+
if (!result.success) {
|
|
494
|
+
output.printError(result.error || 'Failed to spawn workers');
|
|
495
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
496
|
+
}
|
|
497
|
+
if (ctx.flags.format === 'json' && !launchClaude) {
|
|
498
|
+
output.printJson(result);
|
|
499
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
500
|
+
}
|
|
501
|
+
output.writeln();
|
|
502
|
+
displayData = (result.workers || []).map(function (w) { return ({
|
|
503
|
+
id: w.agentId,
|
|
504
|
+
role: w.role,
|
|
505
|
+
status: 'idle',
|
|
506
|
+
joinedAt: new Date(w.joinedAt).toLocaleTimeString()
|
|
507
|
+
}); });
|
|
508
|
+
output.printTable({
|
|
509
|
+
columns: [
|
|
510
|
+
{ key: 'id', header: 'Agent ID', width: 30 },
|
|
511
|
+
{ key: 'role', header: 'Role', width: 12 },
|
|
512
|
+
{ key: 'status', header: 'Status', width: 10, format: formatAgentStatus },
|
|
513
|
+
{ key: 'joinedAt', header: 'Joined', width: 12 }
|
|
514
|
+
],
|
|
515
|
+
data: displayData
|
|
547
516
|
});
|
|
548
|
-
}
|
|
549
|
-
if (!objective) {
|
|
550
517
|
output.writeln();
|
|
551
|
-
output.
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
518
|
+
output.printSuccess("Spawned " + result.spawned + " agent(s)");
|
|
519
|
+
output.writeln(output.dim(" Total workers in hive: " + result.totalWorkers));
|
|
520
|
+
if (!launchClaude) return [3 /*break*/, 10];
|
|
521
|
+
if (!(!objective && ctx.interactive)) return [3 /*break*/, 4];
|
|
522
|
+
return [4 /*yield*/, input({
|
|
523
|
+
message: 'Enter the objective for the hive mind:',
|
|
524
|
+
validate: function (v) { return v.length > 0 || 'Objective is required when using --claude'; }
|
|
525
|
+
})];
|
|
526
|
+
case 3:
|
|
527
|
+
objective = _b.sent();
|
|
528
|
+
_b.label = 4;
|
|
529
|
+
case 4:
|
|
530
|
+
if (!objective) {
|
|
531
|
+
output.writeln();
|
|
532
|
+
output.printWarning('No objective provided. Using default objective.');
|
|
533
|
+
objective = 'Coordinate the hive mind workers to complete tasks efficiently.';
|
|
534
|
+
}
|
|
535
|
+
swarmId = result.hiveId || 'default';
|
|
536
|
+
swarmName = 'Hive Mind Swarm';
|
|
537
|
+
_b.label = 5;
|
|
538
|
+
case 5:
|
|
539
|
+
_b.trys.push([5, 7, , 8]);
|
|
540
|
+
return [4 /*yield*/, callMCPTool('hive-mind_status', { includeWorkers: false })];
|
|
541
|
+
case 6:
|
|
542
|
+
statusResult = _b.sent();
|
|
559
543
|
swarmId = statusResult.hiveId || swarmId;
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
544
|
+
return [3 /*break*/, 8];
|
|
545
|
+
case 7:
|
|
546
|
+
_a = _b.sent();
|
|
547
|
+
return [3 /*break*/, 8];
|
|
548
|
+
case 8:
|
|
549
|
+
workers = (result.workers || []).map(function (w) { return ({
|
|
550
|
+
agentId: w.agentId,
|
|
551
|
+
role: w.role,
|
|
552
|
+
type: agentType,
|
|
553
|
+
joinedAt: w.joinedAt
|
|
554
|
+
}); });
|
|
555
|
+
return [4 /*yield*/, spawnClaudeCodeInstance(swarmId, swarmName, objective, workers, ctx.flags)];
|
|
556
|
+
case 9:
|
|
557
|
+
claudeResult = _b.sent();
|
|
558
|
+
if (!claudeResult.success) {
|
|
559
|
+
return [2 /*return*/, { success: false, exitCode: 1, data: { spawn: result, claude: claudeResult } }];
|
|
560
|
+
}
|
|
561
|
+
return [2 /*return*/, { success: true, data: { spawn: result, claude: claudeResult } }];
|
|
562
|
+
case 10: return [2 /*return*/, { success: true, data: result }];
|
|
563
|
+
case 11:
|
|
564
|
+
error_3 = _b.sent();
|
|
565
|
+
if (error_3 instanceof MCPClientError) {
|
|
566
|
+
output.printError("Spawn error: " + error_3.message);
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
output.printError("Unexpected error: " + String(error_3));
|
|
570
|
+
}
|
|
571
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
572
|
+
case 12: return [2 /*return*/];
|
|
586
573
|
}
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
}
|
|
574
|
+
});
|
|
575
|
+
}); }
|
|
590
576
|
};
|
|
591
577
|
// Status subcommand
|
|
592
|
-
|
|
578
|
+
var statusCommand = {
|
|
593
579
|
name: 'status',
|
|
594
580
|
description: 'Show hive mind status',
|
|
595
581
|
options: [
|
|
@@ -598,125 +584,135 @@ const statusCommand = {
|
|
|
598
584
|
short: 'd',
|
|
599
585
|
description: 'Show detailed metrics',
|
|
600
586
|
type: 'boolean',
|
|
601
|
-
default: false
|
|
587
|
+
"default": false
|
|
602
588
|
},
|
|
603
589
|
{
|
|
604
590
|
name: 'watch',
|
|
605
591
|
short: 'w',
|
|
606
592
|
description: 'Watch for changes',
|
|
607
593
|
type: 'boolean',
|
|
608
|
-
default: false
|
|
594
|
+
"default": false
|
|
609
595
|
}
|
|
610
596
|
],
|
|
611
|
-
action:
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
{
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
597
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
598
|
+
var detailed, result, flexResult, hiveId, status, queen, flexQueen, queenId, queenLoad, queenTasks, queenStatus, workers, workerData, metrics, health, error_4;
|
|
599
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
600
|
+
return __generator(this, function (_1) {
|
|
601
|
+
switch (_1.label) {
|
|
602
|
+
case 0:
|
|
603
|
+
detailed = ctx.flags.detailed;
|
|
604
|
+
_1.label = 1;
|
|
605
|
+
case 1:
|
|
606
|
+
_1.trys.push([1, 3, , 4]);
|
|
607
|
+
return [4 /*yield*/, callMCPTool('hive-mind_status', {
|
|
608
|
+
includeMetrics: detailed,
|
|
609
|
+
includeWorkers: true
|
|
610
|
+
})];
|
|
611
|
+
case 2:
|
|
612
|
+
result = _1.sent();
|
|
613
|
+
if (ctx.flags.format === 'json') {
|
|
614
|
+
output.printJson(result);
|
|
615
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
616
|
+
}
|
|
617
|
+
flexResult = result;
|
|
618
|
+
hiveId = (_b = (_a = result.hiveId) !== null && _a !== void 0 ? _a : flexResult.id) !== null && _b !== void 0 ? _b : 'default';
|
|
619
|
+
status = (_c = result.status) !== null && _c !== void 0 ? _c : (flexResult.initialized ? 'running' : 'stopped');
|
|
620
|
+
queen = (_d = result.queen) !== null && _d !== void 0 ? _d : { id: 'N/A', status: 'unknown', load: 0, tasksQueued: 0 };
|
|
621
|
+
flexQueen = queen;
|
|
622
|
+
queenId = typeof queen === 'object' ? ((_f = (_e = queen.id) !== null && _e !== void 0 ? _e : flexQueen.agentId) !== null && _f !== void 0 ? _f : 'N/A') : String(queen);
|
|
623
|
+
queenLoad = typeof queen === 'object' ? ((_g = queen.load) !== null && _g !== void 0 ? _g : 0) : 0;
|
|
624
|
+
queenTasks = typeof queen === 'object' ? ((_h = queen.tasksQueued) !== null && _h !== void 0 ? _h : 0) : 0;
|
|
625
|
+
queenStatus = typeof queen === 'object' ? ((_j = queen.status) !== null && _j !== void 0 ? _j : 'active') : 'active';
|
|
626
|
+
output.writeln();
|
|
627
|
+
output.printBox([
|
|
628
|
+
"Hive ID: " + hiveId,
|
|
629
|
+
"Status: " + formatHiveStatus(String(status)),
|
|
630
|
+
"Topology: " + ((_k = result.topology) !== null && _k !== void 0 ? _k : 'mesh'),
|
|
631
|
+
"Consensus: " + ((_l = result.consensus) !== null && _l !== void 0 ? _l : 'byzantine'),
|
|
632
|
+
'',
|
|
633
|
+
"Queen: " + queenId,
|
|
634
|
+
" Status: " + formatAgentStatus(queenStatus),
|
|
635
|
+
" Load: " + (queenLoad * 100).toFixed(1) + "%",
|
|
636
|
+
" Queued Tasks: " + queenTasks
|
|
637
|
+
].join('\n'), 'Hive Mind Status');
|
|
638
|
+
workers = (_m = result.workers) !== null && _m !== void 0 ? _m : [];
|
|
639
|
+
workerData = Array.isArray(workers) ? workers.map(function (w) {
|
|
640
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
641
|
+
if (typeof w === 'string') {
|
|
642
|
+
return { id: w, type: 'worker', status: 'idle', currentTask: '-', tasksCompleted: 0 };
|
|
643
|
+
}
|
|
644
|
+
var flexWorker = w;
|
|
645
|
+
return {
|
|
646
|
+
id: (_b = (_a = w.id) !== null && _a !== void 0 ? _a : flexWorker.agentId) !== null && _b !== void 0 ? _b : 'unknown',
|
|
647
|
+
type: (_d = (_c = w.type) !== null && _c !== void 0 ? _c : flexWorker.agentType) !== null && _d !== void 0 ? _d : 'worker',
|
|
648
|
+
status: (_e = w.status) !== null && _e !== void 0 ? _e : 'idle',
|
|
649
|
+
currentTask: (_f = w.currentTask) !== null && _f !== void 0 ? _f : '-',
|
|
650
|
+
tasksCompleted: (_g = w.tasksCompleted) !== null && _g !== void 0 ? _g : 0
|
|
651
|
+
};
|
|
652
|
+
}) : [];
|
|
653
|
+
output.writeln();
|
|
654
|
+
output.writeln(output.bold('Worker Agents'));
|
|
655
|
+
if (workerData.length === 0) {
|
|
656
|
+
output.printInfo('No workers in hive. Use "claude-flow hive-mind spawn" to add workers.');
|
|
657
|
+
}
|
|
658
|
+
else {
|
|
659
|
+
output.printTable({
|
|
660
|
+
columns: [
|
|
661
|
+
{ key: 'id', header: 'ID', width: 20 },
|
|
662
|
+
{ key: 'type', header: 'Type', width: 12 },
|
|
663
|
+
{ key: 'status', header: 'Status', width: 10, format: formatAgentStatus },
|
|
664
|
+
{ key: 'currentTask', header: 'Current Task', width: 20, format: function (v) { return String(v || '-'); } },
|
|
665
|
+
{ key: 'tasksCompleted', header: 'Completed', width: 10, align: 'right' }
|
|
666
|
+
],
|
|
667
|
+
data: workerData
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
if (detailed) {
|
|
671
|
+
metrics = (_o = result.metrics) !== null && _o !== void 0 ? _o : { totalTasks: 0, completedTasks: 0, failedTasks: 0, avgTaskTime: 0, consensusRounds: 0, memoryUsage: '0 MB' };
|
|
672
|
+
output.writeln();
|
|
673
|
+
output.writeln(output.bold('Metrics'));
|
|
674
|
+
output.printTable({
|
|
675
|
+
columns: [
|
|
676
|
+
{ key: 'metric', header: 'Metric', width: 20 },
|
|
677
|
+
{ key: 'value', header: 'Value', width: 15, align: 'right' }
|
|
678
|
+
],
|
|
679
|
+
data: [
|
|
680
|
+
{ metric: 'Total Tasks', value: (_p = metrics.totalTasks) !== null && _p !== void 0 ? _p : 0 },
|
|
681
|
+
{ metric: 'Completed', value: (_q = metrics.completedTasks) !== null && _q !== void 0 ? _q : 0 },
|
|
682
|
+
{ metric: 'Failed', value: (_r = metrics.failedTasks) !== null && _r !== void 0 ? _r : 0 },
|
|
683
|
+
{ metric: 'Avg Task Time', value: ((_s = metrics.avgTaskTime) !== null && _s !== void 0 ? _s : 0).toFixed(1) + "ms" },
|
|
684
|
+
{ metric: 'Consensus Rounds', value: (_t = metrics.consensusRounds) !== null && _t !== void 0 ? _t : 0 },
|
|
685
|
+
{ metric: 'Memory Usage', value: (_u = metrics.memoryUsage) !== null && _u !== void 0 ? _u : '0 MB' }
|
|
686
|
+
]
|
|
687
|
+
});
|
|
688
|
+
health = (_v = result.health) !== null && _v !== void 0 ? _v : { overall: 'healthy', queen: 'healthy', workers: 'healthy', consensus: 'healthy', memory: 'healthy' };
|
|
689
|
+
output.writeln();
|
|
690
|
+
output.writeln(output.bold('Health'));
|
|
691
|
+
output.printList([
|
|
692
|
+
"Overall: " + formatHealth((_w = health.overall) !== null && _w !== void 0 ? _w : 'healthy'),
|
|
693
|
+
"Queen: " + formatHealth((_x = health.queen) !== null && _x !== void 0 ? _x : 'healthy'),
|
|
694
|
+
"Workers: " + formatHealth((_y = health.workers) !== null && _y !== void 0 ? _y : 'healthy'),
|
|
695
|
+
"Consensus: " + formatHealth((_z = health.consensus) !== null && _z !== void 0 ? _z : 'healthy'),
|
|
696
|
+
"Memory: " + formatHealth((_0 = health.memory) !== null && _0 !== void 0 ? _0 : 'healthy')
|
|
697
|
+
]);
|
|
698
|
+
}
|
|
699
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
700
|
+
case 3:
|
|
701
|
+
error_4 = _1.sent();
|
|
702
|
+
if (error_4 instanceof MCPClientError) {
|
|
703
|
+
output.printError("Status error: " + error_4.message);
|
|
704
|
+
}
|
|
705
|
+
else {
|
|
706
|
+
output.printError("Unexpected error: " + String(error_4));
|
|
707
|
+
}
|
|
708
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
709
|
+
case 4: return [2 /*return*/];
|
|
713
710
|
}
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
}
|
|
711
|
+
});
|
|
712
|
+
}); }
|
|
717
713
|
};
|
|
718
714
|
// Task subcommand
|
|
719
|
-
|
|
715
|
+
var taskCommand = {
|
|
720
716
|
name: 'task',
|
|
721
717
|
description: 'Submit tasks to the hive',
|
|
722
718
|
options: [
|
|
@@ -732,80 +728,93 @@ const taskCommand = {
|
|
|
732
728
|
description: 'Task priority',
|
|
733
729
|
type: 'string',
|
|
734
730
|
choices: ['low', 'normal', 'high', 'critical'],
|
|
735
|
-
default: 'normal'
|
|
731
|
+
"default": 'normal'
|
|
736
732
|
},
|
|
737
733
|
{
|
|
738
734
|
name: 'require-consensus',
|
|
739
735
|
short: 'c',
|
|
740
736
|
description: 'Require consensus for completion',
|
|
741
737
|
type: 'boolean',
|
|
742
|
-
default: false
|
|
738
|
+
"default": false
|
|
743
739
|
},
|
|
744
740
|
{
|
|
745
741
|
name: 'timeout',
|
|
746
742
|
description: 'Task timeout in seconds',
|
|
747
743
|
type: 'number',
|
|
748
|
-
default: 300
|
|
744
|
+
"default": 300
|
|
749
745
|
}
|
|
750
746
|
],
|
|
751
747
|
examples: [
|
|
752
748
|
{ command: 'claude-flow hive-mind task -d "Implement auth module"', description: 'Submit task' },
|
|
753
749
|
{ command: 'claude-flow hive-mind task -d "Security review" -p critical -c', description: 'Critical task with consensus' }
|
|
754
750
|
],
|
|
755
|
-
action:
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
751
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
752
|
+
var description, priority, requireConsensus, timeout, result, error_5;
|
|
753
|
+
return __generator(this, function (_a) {
|
|
754
|
+
switch (_a.label) {
|
|
755
|
+
case 0:
|
|
756
|
+
description = ctx.flags.description || ctx.args.join(' ');
|
|
757
|
+
if (!(!description && ctx.interactive)) return [3 /*break*/, 2];
|
|
758
|
+
return [4 /*yield*/, input({
|
|
759
|
+
message: 'Task description:',
|
|
760
|
+
validate: function (v) { return v.length > 0 || 'Description is required'; }
|
|
761
|
+
})];
|
|
762
|
+
case 1:
|
|
763
|
+
description = _a.sent();
|
|
764
|
+
_a.label = 2;
|
|
765
|
+
case 2:
|
|
766
|
+
if (!description) {
|
|
767
|
+
output.printError('Task description is required');
|
|
768
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
769
|
+
}
|
|
770
|
+
priority = ctx.flags.priority;
|
|
771
|
+
requireConsensus = ctx.flags.requireConsensus;
|
|
772
|
+
timeout = ctx.flags.timeout;
|
|
773
|
+
output.printInfo('Submitting task to hive...');
|
|
774
|
+
_a.label = 3;
|
|
775
|
+
case 3:
|
|
776
|
+
_a.trys.push([3, 5, , 6]);
|
|
777
|
+
return [4 /*yield*/, callMCPTool('hive-mind_task', {
|
|
778
|
+
description: description,
|
|
779
|
+
priority: priority,
|
|
780
|
+
requireConsensus: requireConsensus,
|
|
781
|
+
timeout: timeout
|
|
782
|
+
})];
|
|
783
|
+
case 4:
|
|
784
|
+
result = _a.sent();
|
|
785
|
+
if (ctx.flags.format === 'json') {
|
|
786
|
+
output.printJson(result);
|
|
787
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
788
|
+
}
|
|
789
|
+
output.writeln();
|
|
790
|
+
output.printBox([
|
|
791
|
+
"Task ID: " + result.taskId,
|
|
792
|
+
"Status: " + formatAgentStatus(result.status),
|
|
793
|
+
"Priority: " + formatPriority(priority),
|
|
794
|
+
"Assigned: " + result.assignedTo.join(', '),
|
|
795
|
+
"Consensus: " + (result.requiresConsensus ? 'Yes' : 'No'),
|
|
796
|
+
"Est. Time: " + result.estimatedTime
|
|
797
|
+
].join('\n'), 'Task Submitted');
|
|
798
|
+
output.writeln();
|
|
799
|
+
output.printSuccess('Task submitted to hive');
|
|
800
|
+
output.writeln(output.dim(" Track with: claude-flow hive-mind task-status " + result.taskId));
|
|
801
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
802
|
+
case 5:
|
|
803
|
+
error_5 = _a.sent();
|
|
804
|
+
if (error_5 instanceof MCPClientError) {
|
|
805
|
+
output.printError("Task submission error: " + error_5.message);
|
|
806
|
+
}
|
|
807
|
+
else {
|
|
808
|
+
output.printError("Unexpected error: " + String(error_5));
|
|
809
|
+
}
|
|
810
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
811
|
+
case 6: return [2 /*return*/];
|
|
802
812
|
}
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
}
|
|
813
|
+
});
|
|
814
|
+
}); }
|
|
806
815
|
};
|
|
807
816
|
// Optimize memory subcommand
|
|
808
|
-
|
|
817
|
+
var optimizeMemoryCommand = {
|
|
809
818
|
name: 'optimize-memory',
|
|
810
819
|
description: 'Optimize hive memory and patterns',
|
|
811
820
|
options: [
|
|
@@ -814,245 +823,305 @@ const optimizeMemoryCommand = {
|
|
|
814
823
|
short: 'a',
|
|
815
824
|
description: 'Aggressive optimization',
|
|
816
825
|
type: 'boolean',
|
|
817
|
-
default: false
|
|
826
|
+
"default": false
|
|
818
827
|
},
|
|
819
828
|
{
|
|
820
829
|
name: 'threshold',
|
|
821
830
|
description: 'Quality threshold for pattern retention',
|
|
822
831
|
type: 'number',
|
|
823
|
-
default: 0.7
|
|
832
|
+
"default": 0.7
|
|
824
833
|
}
|
|
825
834
|
],
|
|
826
|
-
action:
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
{
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
835
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
836
|
+
var aggressive, threshold, spinner, result, error_6;
|
|
837
|
+
return __generator(this, function (_a) {
|
|
838
|
+
switch (_a.label) {
|
|
839
|
+
case 0:
|
|
840
|
+
aggressive = ctx.flags.aggressive;
|
|
841
|
+
threshold = ctx.flags.threshold;
|
|
842
|
+
output.printInfo('Optimizing hive memory...');
|
|
843
|
+
spinner = output.createSpinner({ text: 'Analyzing patterns...', spinner: 'dots' });
|
|
844
|
+
spinner.start();
|
|
845
|
+
_a.label = 1;
|
|
846
|
+
case 1:
|
|
847
|
+
_a.trys.push([1, 3, , 4]);
|
|
848
|
+
return [4 /*yield*/, callMCPTool('hive-mind_optimize-memory', {
|
|
849
|
+
aggressive: aggressive,
|
|
850
|
+
qualityThreshold: threshold
|
|
851
|
+
})];
|
|
852
|
+
case 2:
|
|
853
|
+
result = _a.sent();
|
|
854
|
+
spinner.succeed('Memory optimized');
|
|
855
|
+
if (ctx.flags.format === 'json') {
|
|
856
|
+
output.printJson(result);
|
|
857
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
858
|
+
}
|
|
859
|
+
output.writeln();
|
|
860
|
+
output.printTable({
|
|
861
|
+
columns: [
|
|
862
|
+
{ key: 'metric', header: 'Metric', width: 20 },
|
|
863
|
+
{ key: 'before', header: 'Before', width: 15, align: 'right' },
|
|
864
|
+
{ key: 'after', header: 'After', width: 15, align: 'right' }
|
|
865
|
+
],
|
|
866
|
+
data: [
|
|
867
|
+
{ metric: 'Patterns', before: result.before.patterns, after: result.after.patterns },
|
|
868
|
+
{ metric: 'Memory', before: result.before.memory, after: result.after.memory }
|
|
869
|
+
]
|
|
870
|
+
});
|
|
871
|
+
output.writeln();
|
|
872
|
+
output.printList([
|
|
873
|
+
"Patterns removed: " + result.removed,
|
|
874
|
+
"Patterns consolidated: " + result.consolidated,
|
|
875
|
+
"Optimization time: " + result.timeMs + "ms"
|
|
876
|
+
]);
|
|
877
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
878
|
+
case 3:
|
|
879
|
+
error_6 = _a.sent();
|
|
880
|
+
spinner.fail('Optimization failed');
|
|
881
|
+
if (error_6 instanceof MCPClientError) {
|
|
882
|
+
output.printError("Optimization error: " + error_6.message);
|
|
883
|
+
}
|
|
884
|
+
else {
|
|
885
|
+
output.printError("Unexpected error: " + String(error_6));
|
|
886
|
+
}
|
|
887
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
888
|
+
case 4: return [2 /*return*/];
|
|
869
889
|
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
}
|
|
890
|
+
});
|
|
891
|
+
}); }
|
|
873
892
|
};
|
|
874
893
|
// Join subcommand
|
|
875
|
-
|
|
894
|
+
var joinCommand = {
|
|
876
895
|
name: 'join',
|
|
877
896
|
description: 'Join an agent to the hive mind',
|
|
878
897
|
options: [
|
|
879
898
|
{ name: 'agent-id', short: 'a', description: 'Agent ID to join', type: 'string' },
|
|
880
|
-
{ name: 'role', short: 'r', description: 'Agent role (worker, specialist, scout)', type: 'string', default: 'worker' }
|
|
899
|
+
{ name: 'role', short: 'r', description: 'Agent role (worker, specialist, scout)', type: 'string', "default": 'worker' }
|
|
881
900
|
],
|
|
882
|
-
action:
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
901
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
902
|
+
var agentId, result, error_7;
|
|
903
|
+
return __generator(this, function (_a) {
|
|
904
|
+
switch (_a.label) {
|
|
905
|
+
case 0:
|
|
906
|
+
agentId = ctx.args[0] || ctx.flags['agent-id'] || ctx.flags.agentId;
|
|
907
|
+
if (!agentId) {
|
|
908
|
+
output.printError('Agent ID is required. Use --agent-id or -a flag, or provide as argument.');
|
|
909
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
910
|
+
}
|
|
911
|
+
_a.label = 1;
|
|
912
|
+
case 1:
|
|
913
|
+
_a.trys.push([1, 3, , 4]);
|
|
914
|
+
return [4 /*yield*/, callMCPTool('hive-mind_join', { agentId: agentId, role: ctx.flags.role })];
|
|
915
|
+
case 2:
|
|
916
|
+
result = _a.sent();
|
|
917
|
+
if (!result.success) {
|
|
918
|
+
output.printError(result.error || 'Failed');
|
|
919
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
920
|
+
}
|
|
921
|
+
output.printSuccess("Agent " + agentId + " joined hive (" + result.totalWorkers + " workers)");
|
|
922
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
923
|
+
case 3:
|
|
924
|
+
error_7 = _a.sent();
|
|
925
|
+
output.printError("Join error: " + (error_7 instanceof MCPClientError ? error_7.message : String(error_7)));
|
|
926
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
927
|
+
case 4: return [2 /*return*/];
|
|
893
928
|
}
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
}
|
|
897
|
-
catch (error) {
|
|
898
|
-
output.printError(`Join error: ${error instanceof MCPClientError ? error.message : String(error)}`);
|
|
899
|
-
return { success: false, exitCode: 1 };
|
|
900
|
-
}
|
|
901
|
-
}
|
|
929
|
+
});
|
|
930
|
+
}); }
|
|
902
931
|
};
|
|
903
932
|
// Leave subcommand
|
|
904
|
-
|
|
933
|
+
var leaveCommand = {
|
|
905
934
|
name: 'leave',
|
|
906
935
|
description: 'Remove an agent from the hive mind',
|
|
907
936
|
options: [{ name: 'agent-id', short: 'a', description: 'Agent ID to remove', type: 'string' }],
|
|
908
|
-
action:
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
937
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
938
|
+
var agentId, result, error_8;
|
|
939
|
+
return __generator(this, function (_a) {
|
|
940
|
+
switch (_a.label) {
|
|
941
|
+
case 0:
|
|
942
|
+
agentId = ctx.args[0] || ctx.flags['agent-id'] || ctx.flags.agentId;
|
|
943
|
+
if (!agentId) {
|
|
944
|
+
output.printError('Agent ID required.');
|
|
945
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
946
|
+
}
|
|
947
|
+
_a.label = 1;
|
|
948
|
+
case 1:
|
|
949
|
+
_a.trys.push([1, 3, , 4]);
|
|
950
|
+
return [4 /*yield*/, callMCPTool('hive-mind_leave', { agentId: agentId })];
|
|
951
|
+
case 2:
|
|
952
|
+
result = _a.sent();
|
|
953
|
+
if (!result.success) {
|
|
954
|
+
output.printError(result.error || 'Failed');
|
|
955
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
956
|
+
}
|
|
957
|
+
output.printSuccess("Agent " + agentId + " left hive (" + result.remainingWorkers + " remaining)");
|
|
958
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
959
|
+
case 3:
|
|
960
|
+
error_8 = _a.sent();
|
|
961
|
+
output.printError("Leave error: " + (error_8 instanceof MCPClientError ? error_8.message : String(error_8)));
|
|
962
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
963
|
+
case 4: return [2 /*return*/];
|
|
919
964
|
}
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
}
|
|
923
|
-
catch (error) {
|
|
924
|
-
output.printError(`Leave error: ${error instanceof MCPClientError ? error.message : String(error)}`);
|
|
925
|
-
return { success: false, exitCode: 1 };
|
|
926
|
-
}
|
|
927
|
-
}
|
|
965
|
+
});
|
|
966
|
+
}); }
|
|
928
967
|
};
|
|
929
968
|
// Consensus subcommand
|
|
930
|
-
|
|
969
|
+
var consensusCommand = {
|
|
931
970
|
name: 'consensus',
|
|
932
971
|
description: 'Manage consensus proposals and voting',
|
|
933
972
|
options: [
|
|
934
|
-
{ name: 'action', short: 'a', description: 'Consensus action', type: 'string', choices: ['propose', 'vote', 'status', 'list'], default: 'list' },
|
|
973
|
+
{ name: 'action', short: 'a', description: 'Consensus action', type: 'string', choices: ['propose', 'vote', 'status', 'list'], "default": 'list' },
|
|
935
974
|
{ name: 'proposal-id', short: 'p', description: 'Proposal ID', type: 'string' },
|
|
936
975
|
{ name: 'type', short: 't', description: 'Proposal type', type: 'string' },
|
|
937
976
|
{ name: 'value', description: 'Proposal value', type: 'string' },
|
|
938
977
|
{ name: 'vote', short: 'v', description: 'Vote (yes/no)', type: 'string' },
|
|
939
978
|
{ name: 'voter-id', description: 'Voter agent ID', type: 'string' }
|
|
940
979
|
],
|
|
941
|
-
action:
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
980
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
981
|
+
var action, result, pending, error_9;
|
|
982
|
+
return __generator(this, function (_a) {
|
|
983
|
+
switch (_a.label) {
|
|
984
|
+
case 0:
|
|
985
|
+
action = ctx.flags.action || 'list';
|
|
986
|
+
_a.label = 1;
|
|
987
|
+
case 1:
|
|
988
|
+
_a.trys.push([1, 3, , 4]);
|
|
989
|
+
return [4 /*yield*/, callMCPTool('hive-mind_consensus', { action: action, proposalId: ctx.flags.proposalId, type: ctx.flags.type, value: ctx.flags.value, vote: ctx.flags.vote === 'yes', voterId: ctx.flags.voterId })];
|
|
990
|
+
case 2:
|
|
991
|
+
result = _a.sent();
|
|
992
|
+
if (ctx.flags.format === 'json') {
|
|
993
|
+
output.printJson(result);
|
|
994
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
995
|
+
}
|
|
996
|
+
if (action === 'list') {
|
|
997
|
+
output.writeln(output.bold('\nPending Proposals'));
|
|
998
|
+
pending = result.pending || [];
|
|
999
|
+
if (pending.length === 0)
|
|
1000
|
+
output.printInfo('No pending proposals');
|
|
1001
|
+
else
|
|
1002
|
+
output.printTable({ columns: [{ key: 'proposalId', header: 'ID', width: 30 }, { key: 'type', header: 'Type', width: 12 }], data: pending });
|
|
1003
|
+
}
|
|
1004
|
+
else if (action === 'propose') {
|
|
1005
|
+
output.printSuccess("Proposal created: " + result.proposalId);
|
|
1006
|
+
}
|
|
1007
|
+
else if (action === 'vote') {
|
|
1008
|
+
output.printSuccess("Vote recorded (For: " + result.votesFor + ", Against: " + result.votesAgainst + ")");
|
|
1009
|
+
}
|
|
1010
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
1011
|
+
case 3:
|
|
1012
|
+
error_9 = _a.sent();
|
|
1013
|
+
output.printError("Consensus error: " + (error_9 instanceof MCPClientError ? error_9.message : String(error_9)));
|
|
1014
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
1015
|
+
case 4: return [2 /*return*/];
|
|
959
1016
|
}
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
}
|
|
963
|
-
return { success: true, data: result };
|
|
964
|
-
}
|
|
965
|
-
catch (error) {
|
|
966
|
-
output.printError(`Consensus error: ${error instanceof MCPClientError ? error.message : String(error)}`);
|
|
967
|
-
return { success: false, exitCode: 1 };
|
|
968
|
-
}
|
|
969
|
-
}
|
|
1017
|
+
});
|
|
1018
|
+
}); }
|
|
970
1019
|
};
|
|
971
1020
|
// Broadcast subcommand
|
|
972
|
-
|
|
1021
|
+
var broadcastCommand = {
|
|
973
1022
|
name: 'broadcast',
|
|
974
1023
|
description: 'Broadcast a message to all workers in the hive',
|
|
975
1024
|
options: [
|
|
976
1025
|
{ name: 'message', short: 'm', description: 'Message to broadcast', type: 'string', required: true },
|
|
977
|
-
{ name: 'priority', short: 'p', description: 'Message priority', type: 'string', choices: ['low', 'normal', 'high', 'critical'], default: 'normal' },
|
|
1026
|
+
{ name: 'priority', short: 'p', description: 'Message priority', type: 'string', choices: ['low', 'normal', 'high', 'critical'], "default": 'normal' },
|
|
978
1027
|
{ name: 'from', short: 'f', description: 'Sender agent ID', type: 'string' }
|
|
979
1028
|
],
|
|
980
|
-
action:
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
1029
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
1030
|
+
var message, result, error_10;
|
|
1031
|
+
return __generator(this, function (_a) {
|
|
1032
|
+
switch (_a.label) {
|
|
1033
|
+
case 0:
|
|
1034
|
+
message = ctx.args.join(' ') || ctx.flags.message;
|
|
1035
|
+
if (!message) {
|
|
1036
|
+
output.printError('Message required. Use --message or -m flag.');
|
|
1037
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
1038
|
+
}
|
|
1039
|
+
_a.label = 1;
|
|
1040
|
+
case 1:
|
|
1041
|
+
_a.trys.push([1, 3, , 4]);
|
|
1042
|
+
return [4 /*yield*/, callMCPTool('hive-mind_broadcast', { message: message, priority: ctx.flags.priority, fromId: ctx.flags.from })];
|
|
1043
|
+
case 2:
|
|
1044
|
+
result = _a.sent();
|
|
1045
|
+
if (!result.success) {
|
|
1046
|
+
output.printError(result.error || 'Failed');
|
|
1047
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
1048
|
+
}
|
|
1049
|
+
output.printSuccess("Message broadcast to " + result.recipients + " workers (ID: " + result.messageId + ")");
|
|
1050
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
1051
|
+
case 3:
|
|
1052
|
+
error_10 = _a.sent();
|
|
1053
|
+
output.printError("Broadcast error: " + (error_10 instanceof MCPClientError ? error_10.message : String(error_10)));
|
|
1054
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
1055
|
+
case 4: return [2 /*return*/];
|
|
991
1056
|
}
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
}
|
|
995
|
-
catch (error) {
|
|
996
|
-
output.printError(`Broadcast error: ${error instanceof MCPClientError ? error.message : String(error)}`);
|
|
997
|
-
return { success: false, exitCode: 1 };
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1057
|
+
});
|
|
1058
|
+
}); }
|
|
1000
1059
|
};
|
|
1001
1060
|
// Memory subcommand
|
|
1002
|
-
|
|
1061
|
+
var memorySubCommand = {
|
|
1003
1062
|
name: 'memory',
|
|
1004
1063
|
description: 'Access hive shared memory',
|
|
1005
1064
|
options: [
|
|
1006
|
-
{ name: 'action', short: 'a', description: 'Memory action', type: 'string', choices: ['get', 'set', 'delete', 'list'], default: 'list' },
|
|
1065
|
+
{ name: 'action', short: 'a', description: 'Memory action', type: 'string', choices: ['get', 'set', 'delete', 'list'], "default": 'list' },
|
|
1007
1066
|
{ name: 'key', short: 'k', description: 'Memory key', type: 'string' },
|
|
1008
1067
|
{ name: 'value', short: 'v', description: 'Value to store', type: 'string' }
|
|
1009
1068
|
],
|
|
1010
|
-
action:
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1069
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
1070
|
+
var action, key, value, result, keys, error_11;
|
|
1071
|
+
return __generator(this, function (_a) {
|
|
1072
|
+
switch (_a.label) {
|
|
1073
|
+
case 0:
|
|
1074
|
+
action = ctx.flags.action || 'list';
|
|
1075
|
+
key = ctx.flags.key;
|
|
1076
|
+
value = ctx.flags.value;
|
|
1077
|
+
if ((action === 'get' || action === 'delete') && !key) {
|
|
1078
|
+
output.printError('Key required for get/delete.');
|
|
1079
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
1080
|
+
}
|
|
1081
|
+
if (action === 'set' && (!key || value === undefined)) {
|
|
1082
|
+
output.printError('Key and value required for set.');
|
|
1083
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
1084
|
+
}
|
|
1085
|
+
_a.label = 1;
|
|
1086
|
+
case 1:
|
|
1087
|
+
_a.trys.push([1, 3, , 4]);
|
|
1088
|
+
return [4 /*yield*/, callMCPTool('hive-mind_memory', { action: action, key: key, value: value })];
|
|
1089
|
+
case 2:
|
|
1090
|
+
result = _a.sent();
|
|
1091
|
+
if (ctx.flags.format === 'json') {
|
|
1092
|
+
output.printJson(result);
|
|
1093
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
1094
|
+
}
|
|
1095
|
+
if (action === 'list') {
|
|
1096
|
+
keys = result.keys || [];
|
|
1097
|
+
output.writeln(output.bold("\nShared Memory (" + result.count + " keys)"));
|
|
1098
|
+
if (keys.length === 0)
|
|
1099
|
+
output.printInfo('No keys in shared memory');
|
|
1100
|
+
else
|
|
1101
|
+
output.printList(keys.map(function (k) { return output.highlight(k); }));
|
|
1102
|
+
}
|
|
1103
|
+
else if (action === 'get') {
|
|
1104
|
+
output.writeln(output.bold("\nKey: " + key));
|
|
1105
|
+
output.writeln(result.exists ? "Value: " + JSON.stringify(result.value, null, 2) : 'Key not found');
|
|
1106
|
+
}
|
|
1107
|
+
else if (action === 'set') {
|
|
1108
|
+
output.printSuccess("Set " + key + " in shared memory");
|
|
1109
|
+
}
|
|
1110
|
+
else if (action === 'delete') {
|
|
1111
|
+
output.printSuccess(result.deleted ? "Deleted " + key : "Key " + key + " did not exist");
|
|
1112
|
+
}
|
|
1113
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
1114
|
+
case 3:
|
|
1115
|
+
error_11 = _a.sent();
|
|
1116
|
+
output.printError("Memory error: " + (error_11 instanceof MCPClientError ? error_11.message : String(error_11)));
|
|
1117
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
1118
|
+
case 4: return [2 /*return*/];
|
|
1042
1119
|
}
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
}
|
|
1046
|
-
return { success: true, data: result };
|
|
1047
|
-
}
|
|
1048
|
-
catch (error) {
|
|
1049
|
-
output.printError(`Memory error: ${error instanceof MCPClientError ? error.message : String(error)}`);
|
|
1050
|
-
return { success: false, exitCode: 1 };
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1120
|
+
});
|
|
1121
|
+
}); }
|
|
1053
1122
|
};
|
|
1054
1123
|
// Shutdown subcommand
|
|
1055
|
-
|
|
1124
|
+
var shutdownCommand = {
|
|
1056
1125
|
name: 'shutdown',
|
|
1057
1126
|
description: 'Shutdown the hive mind',
|
|
1058
1127
|
options: [
|
|
@@ -1061,60 +1130,73 @@ const shutdownCommand = {
|
|
|
1061
1130
|
short: 'f',
|
|
1062
1131
|
description: 'Force shutdown',
|
|
1063
1132
|
type: 'boolean',
|
|
1064
|
-
default: false
|
|
1133
|
+
"default": false
|
|
1065
1134
|
},
|
|
1066
1135
|
{
|
|
1067
1136
|
name: 'save-state',
|
|
1068
1137
|
short: 's',
|
|
1069
1138
|
description: 'Save state before shutdown',
|
|
1070
1139
|
type: 'boolean',
|
|
1071
|
-
default: true
|
|
1140
|
+
"default": true
|
|
1072
1141
|
}
|
|
1073
1142
|
],
|
|
1074
|
-
action:
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1143
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
1144
|
+
var force, saveState, confirmed, spinner, result, error_12;
|
|
1145
|
+
return __generator(this, function (_a) {
|
|
1146
|
+
switch (_a.label) {
|
|
1147
|
+
case 0:
|
|
1148
|
+
force = ctx.flags.force;
|
|
1149
|
+
saveState = ctx.flags.saveState;
|
|
1150
|
+
if (!(!force && ctx.interactive)) return [3 /*break*/, 2];
|
|
1151
|
+
return [4 /*yield*/, confirm({
|
|
1152
|
+
message: 'Shutdown the hive mind? All agents will be terminated.',
|
|
1153
|
+
"default": false
|
|
1154
|
+
})];
|
|
1155
|
+
case 1:
|
|
1156
|
+
confirmed = _a.sent();
|
|
1157
|
+
if (!confirmed) {
|
|
1158
|
+
output.printInfo('Operation cancelled');
|
|
1159
|
+
return [2 /*return*/, { success: true }];
|
|
1160
|
+
}
|
|
1161
|
+
_a.label = 2;
|
|
1162
|
+
case 2:
|
|
1163
|
+
output.printInfo('Shutting down hive mind...');
|
|
1164
|
+
spinner = output.createSpinner({ text: 'Graceful shutdown in progress...', spinner: 'dots' });
|
|
1165
|
+
spinner.start();
|
|
1166
|
+
_a.label = 3;
|
|
1167
|
+
case 3:
|
|
1168
|
+
_a.trys.push([3, 5, , 6]);
|
|
1169
|
+
return [4 /*yield*/, callMCPTool('hive-mind_shutdown', {
|
|
1170
|
+
force: force,
|
|
1171
|
+
saveState: saveState
|
|
1172
|
+
})];
|
|
1173
|
+
case 4:
|
|
1174
|
+
result = _a.sent();
|
|
1175
|
+
spinner.succeed('Hive mind shutdown complete');
|
|
1176
|
+
output.writeln();
|
|
1177
|
+
output.printList([
|
|
1178
|
+
"Agents terminated: " + result.agentsTerminated,
|
|
1179
|
+
"State saved: " + (result.stateSaved ? 'Yes' : 'No'),
|
|
1180
|
+
"Shutdown time: " + result.shutdownTime
|
|
1181
|
+
]);
|
|
1182
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
1183
|
+
case 5:
|
|
1184
|
+
error_12 = _a.sent();
|
|
1185
|
+
spinner.fail('Shutdown failed');
|
|
1186
|
+
if (error_12 instanceof MCPClientError) {
|
|
1187
|
+
output.printError("Shutdown error: " + error_12.message);
|
|
1188
|
+
}
|
|
1189
|
+
else {
|
|
1190
|
+
output.printError("Unexpected error: " + String(error_12));
|
|
1191
|
+
}
|
|
1192
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
1193
|
+
case 6: return [2 /*return*/];
|
|
1111
1194
|
}
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
}
|
|
1195
|
+
});
|
|
1196
|
+
}); }
|
|
1115
1197
|
};
|
|
1116
1198
|
// Main hive-mind command
|
|
1117
|
-
export
|
|
1199
|
+
export var hiveMindCommand = {
|
|
1118
1200
|
name: 'hive-mind',
|
|
1119
1201
|
aliases: ['hive'],
|
|
1120
1202
|
description: 'Queen-led consensus-based multi-agent coordination',
|
|
@@ -1126,46 +1208,48 @@ export const hiveMindCommand = {
|
|
|
1126
1208
|
{ command: 'claude-flow hive-mind spawn --claude -o "Build a feature"', description: 'Launch Claude Code with hive mind' },
|
|
1127
1209
|
{ command: 'claude-flow hive-mind task -d "Build feature"', description: 'Submit task' }
|
|
1128
1210
|
],
|
|
1129
|
-
action:
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1211
|
+
action: function () { return __awaiter(void 0, void 0, Promise, function () {
|
|
1212
|
+
return __generator(this, function (_a) {
|
|
1213
|
+
output.writeln();
|
|
1214
|
+
output.writeln(output.bold('Hive Mind - Consensus-Based Multi-Agent Coordination'));
|
|
1215
|
+
output.writeln();
|
|
1216
|
+
output.writeln('Usage: claude-flow hive-mind <subcommand> [options]');
|
|
1217
|
+
output.writeln();
|
|
1218
|
+
output.writeln('Subcommands:');
|
|
1219
|
+
output.printList([
|
|
1220
|
+
output.highlight('init') + " - Initialize hive mind",
|
|
1221
|
+
output.highlight('spawn') + " - Spawn worker agents (use --claude to launch Claude Code)",
|
|
1222
|
+
output.highlight('status') + " - Show hive status",
|
|
1223
|
+
output.highlight('task') + " - Submit task to hive",
|
|
1224
|
+
output.highlight('join') + " - Join an agent to the hive",
|
|
1225
|
+
output.highlight('leave') + " - Remove an agent from the hive",
|
|
1226
|
+
output.highlight('consensus') + " - Manage consensus proposals",
|
|
1227
|
+
output.highlight('broadcast') + " - Broadcast message to workers",
|
|
1228
|
+
output.highlight('memory') + " - Access shared memory",
|
|
1229
|
+
output.highlight('optimize-memory') + " - Optimize patterns and memory",
|
|
1230
|
+
output.highlight('shutdown') + " - Shutdown the hive"
|
|
1231
|
+
]);
|
|
1232
|
+
output.writeln();
|
|
1233
|
+
output.writeln('Features:');
|
|
1234
|
+
output.printList([
|
|
1235
|
+
'Queen-led hierarchical coordination',
|
|
1236
|
+
'Byzantine fault tolerant consensus',
|
|
1237
|
+
'HNSW-accelerated pattern matching',
|
|
1238
|
+
'Cross-session memory persistence',
|
|
1239
|
+
'Automatic load balancing',
|
|
1240
|
+
output.success('NEW: --claude flag to launch interactive Claude Code sessions')
|
|
1241
|
+
]);
|
|
1242
|
+
output.writeln();
|
|
1243
|
+
output.writeln('Quick Start with Claude Code:');
|
|
1244
|
+
output.writeln(output.dim(' claude-flow hive-mind init'));
|
|
1245
|
+
output.writeln(output.dim(' claude-flow hive-mind spawn -n 5 --claude -o "Your objective here"'));
|
|
1246
|
+
return [2 /*return*/, { success: true }];
|
|
1247
|
+
});
|
|
1248
|
+
}); }
|
|
1165
1249
|
};
|
|
1166
1250
|
// Helper functions
|
|
1167
1251
|
function formatAgentStatus(status) {
|
|
1168
|
-
|
|
1252
|
+
var statusStr = String(status);
|
|
1169
1253
|
switch (statusStr) {
|
|
1170
1254
|
case 'active':
|
|
1171
1255
|
case 'ready':
|