kynjal-cli 3.1.4 → 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 +420 -613
- 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
|
@@ -2,6 +2,42 @@
|
|
|
2
2
|
* V3 CLI Swarm Command
|
|
3
3
|
* Swarm coordination and management commands
|
|
4
4
|
*/
|
|
5
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
9
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
10
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
11
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
15
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
16
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
17
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
18
|
+
function step(op) {
|
|
19
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
20
|
+
while (_) try {
|
|
21
|
+
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;
|
|
22
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
23
|
+
switch (op[0]) {
|
|
24
|
+
case 0: case 1: t = op; break;
|
|
25
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
26
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
27
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
28
|
+
default:
|
|
29
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
30
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
31
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
32
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
33
|
+
if (t[2]) _.ops.pop();
|
|
34
|
+
_.trys.pop(); continue;
|
|
35
|
+
}
|
|
36
|
+
op = body.call(thisArg, _);
|
|
37
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
38
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
39
|
+
}
|
|
40
|
+
};
|
|
5
41
|
import { output } from '../output.js';
|
|
6
42
|
import { select, confirm } from '../prompt.js';
|
|
7
43
|
import { callMCPTool, MCPClientError } from '../mcp-client.js';
|
|
@@ -9,81 +45,85 @@ import * as fs from 'fs';
|
|
|
9
45
|
import * as path from 'path';
|
|
10
46
|
// Get dynamic swarm status from memory/session files
|
|
11
47
|
function getSwarmStatus(swarmId) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
48
|
+
var _a, _b, _c, _d;
|
|
49
|
+
var swarmDir = path.join(process.cwd(), '.swarm');
|
|
50
|
+
var sessionDir = path.join(process.cwd(), '.claude', 'sessions');
|
|
51
|
+
var memoryPaths = [
|
|
15
52
|
path.join(process.cwd(), '.swarm', 'memory.db'),
|
|
16
53
|
path.join(process.cwd(), '.claude', 'memory.db'),
|
|
17
54
|
];
|
|
18
55
|
// Check for active swarm state file
|
|
19
|
-
|
|
20
|
-
|
|
56
|
+
var swarmStateFile = path.join(swarmDir, 'state.json');
|
|
57
|
+
var swarmState = null;
|
|
21
58
|
if (fs.existsSync(swarmStateFile)) {
|
|
22
59
|
try {
|
|
23
60
|
swarmState = JSON.parse(fs.readFileSync(swarmStateFile, 'utf-8'));
|
|
24
61
|
}
|
|
25
|
-
catch {
|
|
62
|
+
catch (_e) {
|
|
26
63
|
// Ignore parse errors
|
|
27
64
|
}
|
|
28
65
|
}
|
|
29
66
|
// Count active agents from process files
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
67
|
+
var activeAgents = 0;
|
|
68
|
+
var totalAgents = 0;
|
|
69
|
+
var agentsDir = path.join(swarmDir, 'agents');
|
|
33
70
|
if (fs.existsSync(agentsDir)) {
|
|
34
71
|
try {
|
|
35
|
-
|
|
72
|
+
var agentFiles = fs.readdirSync(agentsDir).filter(function (f) { return f.endsWith('.json'); });
|
|
36
73
|
totalAgents = agentFiles.length;
|
|
37
|
-
for (
|
|
74
|
+
for (var _i = 0, agentFiles_1 = agentFiles; _i < agentFiles_1.length; _i++) {
|
|
75
|
+
var file = agentFiles_1[_i];
|
|
38
76
|
try {
|
|
39
|
-
|
|
77
|
+
var agent = JSON.parse(fs.readFileSync(path.join(agentsDir, file), 'utf-8'));
|
|
40
78
|
if (agent.status === 'active' || agent.status === 'running') {
|
|
41
79
|
activeAgents++;
|
|
42
80
|
}
|
|
43
81
|
}
|
|
44
|
-
catch {
|
|
82
|
+
catch (_f) {
|
|
45
83
|
// Ignore
|
|
46
84
|
}
|
|
47
85
|
}
|
|
48
86
|
}
|
|
49
|
-
catch {
|
|
87
|
+
catch (_g) {
|
|
50
88
|
// Ignore
|
|
51
89
|
}
|
|
52
90
|
}
|
|
53
91
|
// Get session count
|
|
54
|
-
|
|
92
|
+
var sessionCount = 0;
|
|
55
93
|
if (fs.existsSync(sessionDir)) {
|
|
56
94
|
try {
|
|
57
|
-
sessionCount = fs.readdirSync(sessionDir).filter(f
|
|
95
|
+
sessionCount = fs.readdirSync(sessionDir).filter(function (f) { return f.endsWith('.json'); }).length;
|
|
58
96
|
}
|
|
59
|
-
catch {
|
|
97
|
+
catch (_h) {
|
|
60
98
|
// Ignore
|
|
61
99
|
}
|
|
62
100
|
}
|
|
63
101
|
// Get memory size as rough indicator of activity
|
|
64
|
-
|
|
65
|
-
for (
|
|
102
|
+
var memorySize = 0;
|
|
103
|
+
for (var _j = 0, memoryPaths_1 = memoryPaths; _j < memoryPaths_1.length; _j++) {
|
|
104
|
+
var dbPath = memoryPaths_1[_j];
|
|
66
105
|
if (fs.existsSync(dbPath)) {
|
|
67
106
|
try {
|
|
68
107
|
memorySize = fs.statSync(dbPath).size;
|
|
69
108
|
break;
|
|
70
109
|
}
|
|
71
|
-
catch {
|
|
110
|
+
catch (_k) {
|
|
72
111
|
// Ignore
|
|
73
112
|
}
|
|
74
113
|
}
|
|
75
114
|
}
|
|
76
115
|
// Count task files if they exist
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
116
|
+
var completedTasks = 0;
|
|
117
|
+
var inProgressTasks = 0;
|
|
118
|
+
var pendingTasks = 0;
|
|
119
|
+
var tasksDir = path.join(swarmDir, 'tasks');
|
|
81
120
|
if (fs.existsSync(tasksDir)) {
|
|
82
121
|
try {
|
|
83
|
-
|
|
84
|
-
for (
|
|
122
|
+
var taskFiles = fs.readdirSync(tasksDir).filter(function (f) { return f.endsWith('.json'); });
|
|
123
|
+
for (var _l = 0, taskFiles_1 = taskFiles; _l < taskFiles_1.length; _l++) {
|
|
124
|
+
var file = taskFiles_1[_l];
|
|
85
125
|
try {
|
|
86
|
-
|
|
126
|
+
var task = JSON.parse(fs.readFileSync(path.join(tasksDir, file), 'utf-8'));
|
|
87
127
|
if (task.status === 'completed' || task.status === 'done') {
|
|
88
128
|
completedTasks++;
|
|
89
129
|
}
|
|
@@ -94,19 +134,19 @@ function getSwarmStatus(swarmId) {
|
|
|
94
134
|
pendingTasks++;
|
|
95
135
|
}
|
|
96
136
|
}
|
|
97
|
-
catch {
|
|
137
|
+
catch (_m) {
|
|
98
138
|
// Ignore
|
|
99
139
|
}
|
|
100
140
|
}
|
|
101
141
|
}
|
|
102
|
-
catch {
|
|
142
|
+
catch (_o) {
|
|
103
143
|
// Ignore
|
|
104
144
|
}
|
|
105
145
|
}
|
|
106
146
|
// Calculate dynamic progress based on actual state
|
|
107
147
|
// If no swarm state, show 0%. Otherwise calculate from completed tasks
|
|
108
|
-
|
|
109
|
-
|
|
148
|
+
var totalTasks = completedTasks + inProgressTasks + pendingTasks;
|
|
149
|
+
var progress = 0;
|
|
110
150
|
if (totalTasks > 0) {
|
|
111
151
|
progress = Math.round((completedTasks / totalTasks) * 100);
|
|
112
152
|
}
|
|
@@ -115,7 +155,7 @@ function getSwarmStatus(swarmId) {
|
|
|
115
155
|
progress = 5;
|
|
116
156
|
}
|
|
117
157
|
// Determine status
|
|
118
|
-
|
|
158
|
+
var status = 'idle';
|
|
119
159
|
if (inProgressTasks > 0 || activeAgents > 0) {
|
|
120
160
|
status = 'running';
|
|
121
161
|
}
|
|
@@ -126,18 +166,18 @@ function getSwarmStatus(swarmId) {
|
|
|
126
166
|
status = 'ready';
|
|
127
167
|
}
|
|
128
168
|
return {
|
|
129
|
-
id: swarmId || swarmState
|
|
130
|
-
topology: swarmState
|
|
131
|
-
status,
|
|
132
|
-
objective: swarmState
|
|
133
|
-
strategy: swarmState
|
|
169
|
+
id: swarmId || ((_a = swarmState) === null || _a === void 0 ? void 0 : _a.id) || 'no-active-swarm',
|
|
170
|
+
topology: ((_b = swarmState) === null || _b === void 0 ? void 0 : _b.topology) || 'none',
|
|
171
|
+
status: status,
|
|
172
|
+
objective: ((_c = swarmState) === null || _c === void 0 ? void 0 : _c.objective) || 'No active objective',
|
|
173
|
+
strategy: ((_d = swarmState) === null || _d === void 0 ? void 0 : _d.strategy) || 'none',
|
|
134
174
|
agents: {
|
|
135
175
|
total: totalAgents,
|
|
136
176
|
active: activeAgents,
|
|
137
177
|
idle: Math.max(0, totalAgents - activeAgents),
|
|
138
178
|
completed: 0
|
|
139
179
|
},
|
|
140
|
-
progress,
|
|
180
|
+
progress: progress,
|
|
141
181
|
tasks: {
|
|
142
182
|
total: totalTasks,
|
|
143
183
|
completed: completedTasks,
|
|
@@ -147,7 +187,7 @@ function getSwarmStatus(swarmId) {
|
|
|
147
187
|
metrics: {
|
|
148
188
|
tokensUsed: 0,
|
|
149
189
|
avgResponseTime: '--',
|
|
150
|
-
successRate: totalTasks > 0 ?
|
|
190
|
+
successRate: totalTasks > 0 ? Math.round((completedTasks / totalTasks) * 100) + "%" : '--',
|
|
151
191
|
elapsedTime: '--'
|
|
152
192
|
},
|
|
153
193
|
coordination: {
|
|
@@ -159,7 +199,7 @@ function getSwarmStatus(swarmId) {
|
|
|
159
199
|
};
|
|
160
200
|
}
|
|
161
201
|
// Swarm topologies
|
|
162
|
-
|
|
202
|
+
var TOPOLOGIES = [
|
|
163
203
|
{ value: 'hierarchical', label: 'Hierarchical', hint: 'Queen-led coordination with worker agents' },
|
|
164
204
|
{ value: 'mesh', label: 'Mesh', hint: 'Fully connected peer-to-peer network' },
|
|
165
205
|
{ value: 'ring', label: 'Ring', hint: 'Circular communication pattern' },
|
|
@@ -168,7 +208,7 @@ const TOPOLOGIES = [
|
|
|
168
208
|
{ value: 'hierarchical-mesh', label: 'Hierarchical Mesh', hint: 'V3 15-agent queen + peer communication (recommended)' }
|
|
169
209
|
];
|
|
170
210
|
// Swarm strategies
|
|
171
|
-
|
|
211
|
+
var STRATEGIES = [
|
|
172
212
|
{ value: 'specialized', label: 'Specialized', hint: 'Clear roles, no overlap (anti-drift)' },
|
|
173
213
|
{ value: 'balanced', label: 'Balanced', hint: 'Even distribution of work' },
|
|
174
214
|
{ value: 'adaptive', label: 'Adaptive', hint: 'Dynamic strategy based on task' },
|
|
@@ -180,7 +220,7 @@ const STRATEGIES = [
|
|
|
180
220
|
{ value: 'analysis', label: 'Analysis', hint: 'Code analysis and documentation' }
|
|
181
221
|
];
|
|
182
222
|
// Initialize swarm
|
|
183
|
-
|
|
223
|
+
var initCommand = {
|
|
184
224
|
name: 'init',
|
|
185
225
|
description: 'Initialize a new swarm',
|
|
186
226
|
options: [
|
|
@@ -189,136 +229,147 @@ const initCommand = {
|
|
|
189
229
|
short: 't',
|
|
190
230
|
description: 'Swarm topology',
|
|
191
231
|
type: 'string',
|
|
192
|
-
choices: TOPOLOGIES.map(t
|
|
193
|
-
default: 'hierarchical'
|
|
232
|
+
choices: TOPOLOGIES.map(function (t) { return t.value; }),
|
|
233
|
+
"default": 'hierarchical'
|
|
194
234
|
},
|
|
195
235
|
{
|
|
196
236
|
name: 'max-agents',
|
|
197
237
|
short: 'm',
|
|
198
238
|
description: 'Maximum number of agents',
|
|
199
239
|
type: 'number',
|
|
200
|
-
default: 15
|
|
240
|
+
"default": 15
|
|
201
241
|
},
|
|
202
242
|
{
|
|
203
243
|
name: 'auto-scale',
|
|
204
244
|
description: 'Enable automatic scaling',
|
|
205
245
|
type: 'boolean',
|
|
206
|
-
default: true
|
|
246
|
+
"default": true
|
|
207
247
|
},
|
|
208
248
|
{
|
|
209
249
|
name: 'strategy',
|
|
210
250
|
short: 's',
|
|
211
251
|
description: 'Coordination strategy',
|
|
212
252
|
type: 'string',
|
|
213
|
-
choices: STRATEGIES.map(s
|
|
253
|
+
choices: STRATEGIES.map(function (s) { return s.value; })
|
|
214
254
|
},
|
|
215
255
|
{
|
|
216
256
|
name: 'v3-mode',
|
|
217
257
|
description: 'Enable V3 15-agent hierarchical mesh mode',
|
|
218
258
|
type: 'boolean',
|
|
219
|
-
default: false
|
|
259
|
+
"default": false
|
|
220
260
|
}
|
|
221
261
|
],
|
|
222
|
-
action:
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
262
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
263
|
+
var topology, maxAgents, v3Mode, result, swarmDir, stateFile, error_1;
|
|
264
|
+
var _a;
|
|
265
|
+
return __generator(this, function (_b) {
|
|
266
|
+
switch (_b.label) {
|
|
267
|
+
case 0:
|
|
268
|
+
topology = ctx.flags.topology;
|
|
269
|
+
maxAgents = ctx.flags.maxAgents || 15;
|
|
270
|
+
v3Mode = ctx.flags.v3Mode;
|
|
271
|
+
// V3 mode enables hierarchical-mesh hybrid
|
|
272
|
+
if (v3Mode) {
|
|
273
|
+
topology = 'hierarchical-mesh';
|
|
274
|
+
output.printInfo('V3 Mode: Using hierarchical-mesh topology with 15-agent coordination');
|
|
275
|
+
}
|
|
276
|
+
if (!(!topology && ctx.interactive)) return [3 /*break*/, 2];
|
|
277
|
+
return [4 /*yield*/, select({
|
|
278
|
+
message: 'Select swarm topology:',
|
|
279
|
+
options: TOPOLOGIES,
|
|
280
|
+
"default": 'hierarchical'
|
|
281
|
+
})];
|
|
282
|
+
case 1:
|
|
283
|
+
topology = _b.sent();
|
|
284
|
+
_b.label = 2;
|
|
285
|
+
case 2:
|
|
286
|
+
output.writeln();
|
|
287
|
+
output.printInfo('Initializing swarm...');
|
|
288
|
+
_b.label = 3;
|
|
289
|
+
case 3:
|
|
290
|
+
_b.trys.push([3, 5, , 6]);
|
|
291
|
+
return [4 /*yield*/, callMCPTool('swarm_init', {
|
|
292
|
+
topology: topology,
|
|
293
|
+
maxAgents: maxAgents,
|
|
294
|
+
config: {
|
|
295
|
+
communicationProtocol: 'message-bus',
|
|
296
|
+
consensusMechanism: 'majority',
|
|
297
|
+
failureHandling: 'retry',
|
|
298
|
+
loadBalancing: true,
|
|
299
|
+
autoScaling: (_a = ctx.flags.autoScale) !== null && _a !== void 0 ? _a : true
|
|
300
|
+
},
|
|
301
|
+
metadata: {
|
|
302
|
+
v3Mode: v3Mode,
|
|
303
|
+
strategy: ctx.flags.strategy || 'development'
|
|
304
|
+
}
|
|
305
|
+
})];
|
|
306
|
+
case 4:
|
|
307
|
+
result = _b.sent();
|
|
308
|
+
// Display initialization progress
|
|
309
|
+
output.writeln(output.dim(' Creating coordination topology...'));
|
|
310
|
+
output.writeln(output.dim(' Initializing memory namespace...'));
|
|
311
|
+
output.writeln(output.dim(' Setting up communication channels...'));
|
|
312
|
+
if (v3Mode) {
|
|
313
|
+
output.writeln(output.dim(' Enabling Flash Attention (2.49x-7.47x speedup)...'));
|
|
314
|
+
output.writeln(output.dim(' Configuring AgentDB integration (150x faster)...'));
|
|
315
|
+
output.writeln(output.dim(' Initializing SONA learning system...'));
|
|
316
|
+
}
|
|
317
|
+
output.writeln();
|
|
318
|
+
output.printTable({
|
|
319
|
+
columns: [
|
|
320
|
+
{ key: 'property', header: 'Property', width: 20 },
|
|
321
|
+
{ key: 'value', header: 'Value', width: 35 }
|
|
322
|
+
],
|
|
323
|
+
data: [
|
|
324
|
+
{ property: 'Swarm ID', value: result.swarmId },
|
|
325
|
+
{ property: 'Topology', value: result.topology },
|
|
326
|
+
{ property: 'Max Agents', value: result.config.maxAgents },
|
|
327
|
+
{ property: 'Auto Scale', value: result.config.autoScaling ? 'Enabled' : 'Disabled' },
|
|
328
|
+
{ property: 'Protocol', value: result.config.communicationProtocol || 'N/A' },
|
|
329
|
+
{ property: 'V3 Mode', value: v3Mode ? 'Enabled' : 'Disabled' }
|
|
330
|
+
]
|
|
331
|
+
});
|
|
332
|
+
output.writeln();
|
|
333
|
+
output.printSuccess('Swarm initialized successfully');
|
|
334
|
+
swarmDir = path.join(process.cwd(), '.swarm');
|
|
335
|
+
try {
|
|
336
|
+
if (!fs.existsSync(swarmDir)) {
|
|
337
|
+
fs.mkdirSync(swarmDir, { recursive: true });
|
|
338
|
+
}
|
|
339
|
+
stateFile = path.join(swarmDir, 'state.json');
|
|
340
|
+
fs.writeFileSync(stateFile, JSON.stringify({
|
|
341
|
+
id: result.swarmId,
|
|
342
|
+
topology: result.topology,
|
|
343
|
+
maxAgents: result.config.maxAgents,
|
|
344
|
+
strategy: ctx.flags.strategy || 'development',
|
|
345
|
+
v3Mode: v3Mode,
|
|
346
|
+
initializedAt: result.initializedAt,
|
|
347
|
+
status: 'ready'
|
|
348
|
+
}, null, 2));
|
|
349
|
+
}
|
|
350
|
+
catch (_c) {
|
|
351
|
+
// Ignore errors writing state file
|
|
352
|
+
}
|
|
353
|
+
if (ctx.flags.format === 'json') {
|
|
354
|
+
output.printJson(result);
|
|
355
|
+
}
|
|
356
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
357
|
+
case 5:
|
|
358
|
+
error_1 = _b.sent();
|
|
359
|
+
if (error_1 instanceof MCPClientError) {
|
|
360
|
+
output.printError("Failed to initialize swarm: " + error_1.message);
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
output.printError("Unexpected error: " + String(error_1));
|
|
364
|
+
}
|
|
365
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
366
|
+
case 6: return [2 /*return*/];
|
|
315
367
|
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}
|
|
368
|
+
});
|
|
369
|
+
}); }
|
|
319
370
|
};
|
|
320
371
|
// Start swarm execution
|
|
321
|
-
|
|
372
|
+
var startCommand = {
|
|
322
373
|
name: 'start',
|
|
323
374
|
description: 'Start swarm execution',
|
|
324
375
|
options: [
|
|
@@ -334,170 +385,184 @@ const startCommand = {
|
|
|
334
385
|
short: 's',
|
|
335
386
|
description: 'Execution strategy',
|
|
336
387
|
type: 'string',
|
|
337
|
-
choices: STRATEGIES.map(s
|
|
388
|
+
choices: STRATEGIES.map(function (s) { return s.value; })
|
|
338
389
|
},
|
|
339
390
|
{
|
|
340
391
|
name: 'parallel',
|
|
341
392
|
short: 'p',
|
|
342
393
|
description: 'Enable parallel execution',
|
|
343
394
|
type: 'boolean',
|
|
344
|
-
default: true
|
|
395
|
+
"default": true
|
|
345
396
|
},
|
|
346
397
|
{
|
|
347
398
|
name: 'monitor',
|
|
348
399
|
description: 'Enable real-time monitoring',
|
|
349
400
|
type: 'boolean',
|
|
350
|
-
default: true
|
|
401
|
+
"default": true
|
|
351
402
|
}
|
|
352
403
|
],
|
|
353
404
|
examples: [
|
|
354
405
|
{ command: 'claude-flow swarm start -o "Build REST API" -s development', description: 'Start development swarm' },
|
|
355
406
|
{ command: 'claude-flow swarm start -o "Analyze codebase" --parallel', description: 'Parallel analysis' }
|
|
356
407
|
],
|
|
357
|
-
action:
|
|
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
|
-
|
|
408
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
409
|
+
var objective, strategy, agentPlan, confirmed, spinner, executionState;
|
|
410
|
+
var _a;
|
|
411
|
+
return __generator(this, function (_b) {
|
|
412
|
+
switch (_b.label) {
|
|
413
|
+
case 0:
|
|
414
|
+
objective = ctx.args[0] || ctx.flags.objective;
|
|
415
|
+
strategy = ctx.flags.strategy;
|
|
416
|
+
if (!objective) {
|
|
417
|
+
output.printError('Objective is required. Use -o or provide as argument.');
|
|
418
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
419
|
+
}
|
|
420
|
+
if (!(!strategy && ctx.interactive)) return [3 /*break*/, 2];
|
|
421
|
+
return [4 /*yield*/, select({
|
|
422
|
+
message: 'Select execution strategy:',
|
|
423
|
+
options: STRATEGIES,
|
|
424
|
+
"default": 'development'
|
|
425
|
+
})];
|
|
426
|
+
case 1:
|
|
427
|
+
strategy = _b.sent();
|
|
428
|
+
_b.label = 2;
|
|
429
|
+
case 2:
|
|
430
|
+
strategy = strategy || 'development';
|
|
431
|
+
output.writeln();
|
|
432
|
+
output.printInfo("Starting swarm with objective: " + output.highlight(objective));
|
|
433
|
+
output.writeln();
|
|
434
|
+
agentPlan = getAgentPlan(strategy);
|
|
435
|
+
output.writeln(output.bold('Agent Deployment Plan'));
|
|
436
|
+
output.printTable({
|
|
437
|
+
columns: [
|
|
438
|
+
{ key: 'role', header: 'Role', width: 20 },
|
|
439
|
+
{ key: 'type', header: 'Type', width: 15 },
|
|
440
|
+
{ key: 'count', header: 'Count', width: 8, align: 'right' },
|
|
441
|
+
{ key: 'purpose', header: 'Purpose', width: 30 }
|
|
442
|
+
],
|
|
443
|
+
data: agentPlan
|
|
444
|
+
});
|
|
445
|
+
if (!ctx.interactive) return [3 /*break*/, 4];
|
|
446
|
+
return [4 /*yield*/, confirm({
|
|
447
|
+
message: "Deploy " + agentPlan.reduce(function (sum, a) { return sum + a.count; }, 0) + " agents?",
|
|
448
|
+
"default": true
|
|
449
|
+
})];
|
|
450
|
+
case 3:
|
|
451
|
+
confirmed = _b.sent();
|
|
452
|
+
if (!confirmed) {
|
|
453
|
+
output.printInfo('Swarm execution cancelled');
|
|
454
|
+
return [2 /*return*/, { success: true }];
|
|
455
|
+
}
|
|
456
|
+
_b.label = 4;
|
|
457
|
+
case 4:
|
|
458
|
+
output.writeln();
|
|
459
|
+
output.printInfo('Deploying agents...');
|
|
460
|
+
spinner = output.createSpinner({ text: 'Initializing agents...', spinner: 'dots' });
|
|
461
|
+
spinner.start();
|
|
462
|
+
// Brief delay for spinner animation
|
|
463
|
+
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 500); })];
|
|
464
|
+
case 5:
|
|
465
|
+
// Brief delay for spinner animation
|
|
466
|
+
_b.sent();
|
|
467
|
+
spinner.succeed('All agents deployed');
|
|
468
|
+
executionState = {
|
|
469
|
+
swarmId: "swarm-" + Date.now().toString(36),
|
|
470
|
+
objective: objective,
|
|
471
|
+
strategy: strategy,
|
|
472
|
+
status: 'running',
|
|
473
|
+
agents: agentPlan.reduce(function (sum, a) { return sum + a.count; }, 0),
|
|
474
|
+
startedAt: new Date().toISOString(),
|
|
475
|
+
parallel: (_a = ctx.flags.parallel) !== null && _a !== void 0 ? _a : true
|
|
476
|
+
};
|
|
477
|
+
output.writeln();
|
|
478
|
+
output.printSuccess('Swarm execution started');
|
|
479
|
+
output.writeln(output.dim(" Monitor: claude-flow swarm status " + executionState.swarmId));
|
|
480
|
+
return [2 /*return*/, { success: true, data: executionState }];
|
|
397
481
|
}
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
output.printInfo('Deploying agents...');
|
|
401
|
-
// Show deployment progress
|
|
402
|
-
const spinner = output.createSpinner({ text: 'Initializing agents...', spinner: 'dots' });
|
|
403
|
-
spinner.start();
|
|
404
|
-
// Brief delay for spinner animation
|
|
405
|
-
await new Promise(resolve => setTimeout(resolve, 500));
|
|
406
|
-
spinner.succeed('All agents deployed');
|
|
407
|
-
const executionState = {
|
|
408
|
-
swarmId: `swarm-${Date.now().toString(36)}`,
|
|
409
|
-
objective,
|
|
410
|
-
strategy,
|
|
411
|
-
status: 'running',
|
|
412
|
-
agents: agentPlan.reduce((sum, a) => sum + a.count, 0),
|
|
413
|
-
startedAt: new Date().toISOString(),
|
|
414
|
-
parallel: ctx.flags.parallel ?? true
|
|
415
|
-
};
|
|
416
|
-
output.writeln();
|
|
417
|
-
output.printSuccess('Swarm execution started');
|
|
418
|
-
output.writeln(output.dim(` Monitor: claude-flow swarm status ${executionState.swarmId}`));
|
|
419
|
-
return { success: true, data: executionState };
|
|
420
|
-
}
|
|
482
|
+
});
|
|
483
|
+
}); }
|
|
421
484
|
};
|
|
422
485
|
// Swarm status
|
|
423
|
-
|
|
486
|
+
var statusCommand = {
|
|
424
487
|
name: 'status',
|
|
425
488
|
description: 'Show swarm status',
|
|
426
|
-
action:
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
// Show different message if no active swarm
|
|
436
|
-
if (!status.hasActiveSwarm) {
|
|
437
|
-
output.writeln(output.warning('No active swarm'));
|
|
489
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
490
|
+
var swarmId, status;
|
|
491
|
+
return __generator(this, function (_a) {
|
|
492
|
+
swarmId = ctx.args[0];
|
|
493
|
+
status = getSwarmStatus(swarmId);
|
|
494
|
+
if (ctx.flags.format === 'json') {
|
|
495
|
+
output.printJson(status);
|
|
496
|
+
return [2 /*return*/, { success: true, data: status }];
|
|
497
|
+
}
|
|
438
498
|
output.writeln();
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
499
|
+
// Show different message if no active swarm
|
|
500
|
+
if (!status.hasActiveSwarm) {
|
|
501
|
+
output.writeln(output.warning('No active swarm'));
|
|
502
|
+
output.writeln();
|
|
503
|
+
output.writeln(output.dim('Start a swarm with:'));
|
|
504
|
+
output.writeln(output.dim(' npx @claude-flow/cli@latest swarm init'));
|
|
505
|
+
output.writeln(output.dim(' npx @claude-flow/cli@latest swarm start'));
|
|
506
|
+
output.writeln();
|
|
507
|
+
return [2 /*return*/, { success: true, data: status }];
|
|
508
|
+
}
|
|
509
|
+
output.writeln(output.bold("Swarm Status: " + status.id));
|
|
442
510
|
output.writeln();
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
511
|
+
// Progress bar
|
|
512
|
+
output.writeln("Overall Progress: " + output.progressBar(status.progress, 100, 40));
|
|
513
|
+
output.writeln();
|
|
514
|
+
// Agent status
|
|
515
|
+
output.writeln(output.bold('Agents'));
|
|
516
|
+
output.printTable({
|
|
517
|
+
columns: [
|
|
518
|
+
{ key: 'status', header: 'Status', width: 12 },
|
|
519
|
+
{ key: 'count', header: 'Count', width: 10, align: 'right' }
|
|
520
|
+
],
|
|
521
|
+
data: [
|
|
522
|
+
{ status: output.success('Active'), count: status.agents.active },
|
|
523
|
+
{ status: output.warning('Idle'), count: status.agents.idle },
|
|
524
|
+
{ status: output.dim('Completed'), count: status.agents.completed },
|
|
525
|
+
{ status: 'Total', count: status.agents.total }
|
|
526
|
+
]
|
|
527
|
+
});
|
|
528
|
+
output.writeln();
|
|
529
|
+
// Task status
|
|
530
|
+
output.writeln(output.bold('Tasks'));
|
|
531
|
+
output.printTable({
|
|
532
|
+
columns: [
|
|
533
|
+
{ key: 'status', header: 'Status', width: 12 },
|
|
534
|
+
{ key: 'count', header: 'Count', width: 10, align: 'right' }
|
|
535
|
+
],
|
|
536
|
+
data: [
|
|
537
|
+
{ status: output.success('Completed'), count: status.tasks.completed },
|
|
538
|
+
{ status: output.info('In Progress'), count: status.tasks.inProgress },
|
|
539
|
+
{ status: output.dim('Pending'), count: status.tasks.pending },
|
|
540
|
+
{ status: 'Total', count: status.tasks.total }
|
|
541
|
+
]
|
|
542
|
+
});
|
|
543
|
+
output.writeln();
|
|
544
|
+
// Metrics
|
|
545
|
+
output.writeln(output.bold('Performance Metrics'));
|
|
546
|
+
output.printList([
|
|
547
|
+
"Tokens Used: " + status.metrics.tokensUsed.toLocaleString(),
|
|
548
|
+
"Avg Response Time: " + status.metrics.avgResponseTime,
|
|
549
|
+
"Success Rate: " + status.metrics.successRate,
|
|
550
|
+
"Elapsed Time: " + status.metrics.elapsedTime
|
|
551
|
+
]);
|
|
552
|
+
output.writeln();
|
|
553
|
+
// Coordination stats
|
|
554
|
+
output.writeln(output.bold('Coordination'));
|
|
555
|
+
output.printList([
|
|
556
|
+
"Consensus Rounds: " + status.coordination.consensusRounds,
|
|
557
|
+
"Messages Sent: " + status.coordination.messagesSent,
|
|
558
|
+
"Conflicts Resolved: " + status.coordination.conflictsResolved
|
|
559
|
+
]);
|
|
560
|
+
return [2 /*return*/, { success: true, data: status }];
|
|
478
561
|
});
|
|
479
|
-
|
|
480
|
-
// Metrics
|
|
481
|
-
output.writeln(output.bold('Performance Metrics'));
|
|
482
|
-
output.printList([
|
|
483
|
-
`Tokens Used: ${status.metrics.tokensUsed.toLocaleString()}`,
|
|
484
|
-
`Avg Response Time: ${status.metrics.avgResponseTime}`,
|
|
485
|
-
`Success Rate: ${status.metrics.successRate}`,
|
|
486
|
-
`Elapsed Time: ${status.metrics.elapsedTime}`
|
|
487
|
-
]);
|
|
488
|
-
output.writeln();
|
|
489
|
-
// Coordination stats
|
|
490
|
-
output.writeln(output.bold('Coordination'));
|
|
491
|
-
output.printList([
|
|
492
|
-
`Consensus Rounds: ${status.coordination.consensusRounds}`,
|
|
493
|
-
`Messages Sent: ${status.coordination.messagesSent}`,
|
|
494
|
-
`Conflicts Resolved: ${status.coordination.conflictsResolved}`
|
|
495
|
-
]);
|
|
496
|
-
return { success: true, data: status };
|
|
497
|
-
}
|
|
562
|
+
}); }
|
|
498
563
|
};
|
|
499
564
|
// Stop swarm
|
|
500
|
-
|
|
565
|
+
var stopCommand = {
|
|
501
566
|
name: 'stop',
|
|
502
567
|
description: 'Stop swarm execution',
|
|
503
568
|
options: [
|
|
@@ -506,45 +571,54 @@ const stopCommand = {
|
|
|
506
571
|
short: 'f',
|
|
507
572
|
description: 'Force immediate stop',
|
|
508
573
|
type: 'boolean',
|
|
509
|
-
default: false
|
|
574
|
+
"default": false
|
|
510
575
|
},
|
|
511
576
|
{
|
|
512
577
|
name: 'save-state',
|
|
513
578
|
description: 'Save current state for resume',
|
|
514
579
|
type: 'boolean',
|
|
515
|
-
default: true
|
|
580
|
+
"default": true
|
|
516
581
|
}
|
|
517
582
|
],
|
|
518
|
-
action:
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
583
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
584
|
+
var swarmId, force, confirmed;
|
|
585
|
+
return __generator(this, function (_a) {
|
|
586
|
+
switch (_a.label) {
|
|
587
|
+
case 0:
|
|
588
|
+
swarmId = ctx.args[0];
|
|
589
|
+
force = ctx.flags.force;
|
|
590
|
+
if (!swarmId) {
|
|
591
|
+
output.printError('Swarm ID is required');
|
|
592
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
593
|
+
}
|
|
594
|
+
if (!(ctx.interactive && !force)) return [3 /*break*/, 2];
|
|
595
|
+
return [4 /*yield*/, confirm({
|
|
596
|
+
message: "Stop swarm " + swarmId + "? Progress will be saved.",
|
|
597
|
+
"default": false
|
|
598
|
+
})];
|
|
599
|
+
case 1:
|
|
600
|
+
confirmed = _a.sent();
|
|
601
|
+
if (!confirmed) {
|
|
602
|
+
output.printInfo('Operation cancelled');
|
|
603
|
+
return [2 /*return*/, { success: true }];
|
|
604
|
+
}
|
|
605
|
+
_a.label = 2;
|
|
606
|
+
case 2:
|
|
607
|
+
output.printInfo("Stopping swarm " + swarmId + "...");
|
|
608
|
+
if (!force) {
|
|
609
|
+
output.writeln(output.dim(' Completing in-progress tasks...'));
|
|
610
|
+
output.writeln(output.dim(' Saving coordination state...'));
|
|
611
|
+
output.writeln(output.dim(' Notifying agents...'));
|
|
612
|
+
output.writeln(output.dim(' Saving memory state...'));
|
|
613
|
+
}
|
|
614
|
+
output.printSuccess("Swarm " + swarmId + " stopped");
|
|
615
|
+
return [2 /*return*/, { success: true, data: { swarmId: swarmId, stopped: true, force: force } }];
|
|
533
616
|
}
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
if (!force) {
|
|
537
|
-
output.writeln(output.dim(' Completing in-progress tasks...'));
|
|
538
|
-
output.writeln(output.dim(' Saving coordination state...'));
|
|
539
|
-
output.writeln(output.dim(' Notifying agents...'));
|
|
540
|
-
output.writeln(output.dim(' Saving memory state...'));
|
|
541
|
-
}
|
|
542
|
-
output.printSuccess(`Swarm ${swarmId} stopped`);
|
|
543
|
-
return { success: true, data: { swarmId, stopped: true, force } };
|
|
544
|
-
}
|
|
617
|
+
});
|
|
618
|
+
}); }
|
|
545
619
|
};
|
|
546
620
|
// Scale swarm
|
|
547
|
-
|
|
621
|
+
var scaleCommand = {
|
|
548
622
|
name: 'scale',
|
|
549
623
|
description: 'Scale swarm agent count',
|
|
550
624
|
options: [
|
|
@@ -562,38 +636,40 @@ const scaleCommand = {
|
|
|
562
636
|
type: 'string'
|
|
563
637
|
}
|
|
564
638
|
],
|
|
565
|
-
action:
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
639
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
640
|
+
var swarmId, targetAgents, agentType, currentAgents, delta;
|
|
641
|
+
return __generator(this, function (_a) {
|
|
642
|
+
swarmId = ctx.args[0];
|
|
643
|
+
targetAgents = ctx.flags.agents;
|
|
644
|
+
agentType = ctx.flags.type;
|
|
645
|
+
if (!swarmId) {
|
|
646
|
+
output.printError('Swarm ID is required');
|
|
647
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
648
|
+
}
|
|
649
|
+
if (!targetAgents) {
|
|
650
|
+
output.printError('Target agent count required. Use --agents or -a');
|
|
651
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
652
|
+
}
|
|
653
|
+
output.printInfo("Scaling swarm " + swarmId + " to " + targetAgents + " agents...");
|
|
654
|
+
currentAgents = 8;
|
|
655
|
+
delta = targetAgents - currentAgents;
|
|
656
|
+
if (delta > 0) {
|
|
657
|
+
output.writeln(output.dim(" Spawning " + delta + " new agents..."));
|
|
658
|
+
}
|
|
659
|
+
else if (delta < 0) {
|
|
660
|
+
output.writeln(output.dim(" Gracefully stopping " + -delta + " agents..."));
|
|
661
|
+
}
|
|
662
|
+
else {
|
|
663
|
+
output.printInfo('Swarm already at target size');
|
|
664
|
+
return [2 /*return*/, { success: true }];
|
|
665
|
+
}
|
|
666
|
+
output.printSuccess("Swarm scaled to " + targetAgents + " agents");
|
|
667
|
+
return [2 /*return*/, { success: true, data: { swarmId: swarmId, agents: targetAgents, delta: delta } }];
|
|
668
|
+
});
|
|
669
|
+
}); }
|
|
594
670
|
};
|
|
595
671
|
// Coordinate command (V3 specific)
|
|
596
|
-
|
|
672
|
+
var coordinateCommand = {
|
|
597
673
|
name: 'coordinate',
|
|
598
674
|
description: 'Execute V3 15-agent hierarchical mesh coordination',
|
|
599
675
|
options: [
|
|
@@ -601,7 +677,7 @@ const coordinateCommand = {
|
|
|
601
677
|
name: 'agents',
|
|
602
678
|
description: 'Number of agents',
|
|
603
679
|
type: 'number',
|
|
604
|
-
default: 15
|
|
680
|
+
"default": 15
|
|
605
681
|
},
|
|
606
682
|
{
|
|
607
683
|
name: 'domains',
|
|
@@ -609,57 +685,59 @@ const coordinateCommand = {
|
|
|
609
685
|
type: 'array'
|
|
610
686
|
}
|
|
611
687
|
],
|
|
612
|
-
action:
|
|
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
|
-
|
|
688
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
689
|
+
var agentCount, v3Agents;
|
|
690
|
+
return __generator(this, function (_a) {
|
|
691
|
+
agentCount = ctx.flags.agents || 15;
|
|
692
|
+
output.writeln();
|
|
693
|
+
output.writeln(output.bold('V3 15-Agent Hierarchical Mesh Coordination'));
|
|
694
|
+
output.writeln();
|
|
695
|
+
v3Agents = [
|
|
696
|
+
{ id: 1, role: 'Queen Coordinator', domain: 'Orchestration', status: 'primary' },
|
|
697
|
+
{ id: 2, role: 'Security Architect', domain: 'Security', status: 'active' },
|
|
698
|
+
{ id: 3, role: 'Security Auditor', domain: 'Security', status: 'active' },
|
|
699
|
+
{ id: 4, role: 'Test Architect', domain: 'Security', status: 'active' },
|
|
700
|
+
{ id: 5, role: 'Core Architect', domain: 'Core', status: 'active' },
|
|
701
|
+
{ id: 6, role: 'Memory Specialist', domain: 'Core', status: 'active' },
|
|
702
|
+
{ id: 7, role: 'Swarm Specialist', domain: 'Core', status: 'active' },
|
|
703
|
+
{ id: 8, role: 'Integration Architect', domain: 'Integration', status: 'active' },
|
|
704
|
+
{ id: 9, role: 'Performance Engineer', domain: 'Integration', status: 'active' },
|
|
705
|
+
{ id: 10, role: 'CLI Developer', domain: 'Integration', status: 'active' },
|
|
706
|
+
{ id: 11, role: 'Hooks Developer', domain: 'Integration', status: 'active' },
|
|
707
|
+
{ id: 12, role: 'MCP Specialist', domain: 'Integration', status: 'active' },
|
|
708
|
+
{ id: 13, role: 'Project Coordinator', domain: 'Management', status: 'active' },
|
|
709
|
+
{ id: 14, role: 'Documentation Lead', domain: 'Management', status: 'standby' },
|
|
710
|
+
{ id: 15, role: 'DevOps Engineer', domain: 'Management', status: 'standby' }
|
|
711
|
+
].slice(0, agentCount);
|
|
712
|
+
output.printTable({
|
|
713
|
+
columns: [
|
|
714
|
+
{ key: 'id', header: '#', width: 3, align: 'right' },
|
|
715
|
+
{ key: 'role', header: 'Role', width: 22 },
|
|
716
|
+
{ key: 'domain', header: 'Domain', width: 15 },
|
|
717
|
+
{ key: 'status', header: 'Status', width: 10, format: function (v) {
|
|
718
|
+
if (v === 'primary')
|
|
719
|
+
return output.highlight(String(v));
|
|
720
|
+
if (v === 'active')
|
|
721
|
+
return output.success(String(v));
|
|
722
|
+
return output.dim(String(v));
|
|
723
|
+
} }
|
|
724
|
+
],
|
|
725
|
+
data: v3Agents
|
|
726
|
+
});
|
|
727
|
+
output.writeln();
|
|
728
|
+
output.printInfo('Performance Targets:');
|
|
729
|
+
output.printList([
|
|
730
|
+
"Flash Attention: " + output.success('2.49x-7.47x speedup'),
|
|
731
|
+
"AgentDB Search: " + output.success('150x-12,500x improvement'),
|
|
732
|
+
"Memory Reduction: " + output.success('50-75%'),
|
|
733
|
+
"Code Reduction: " + output.success('<5,000 lines')
|
|
734
|
+
]);
|
|
735
|
+
return [2 /*return*/, { success: true, data: { agents: v3Agents, count: agentCount } }];
|
|
649
736
|
});
|
|
650
|
-
|
|
651
|
-
output.printInfo('Performance Targets:');
|
|
652
|
-
output.printList([
|
|
653
|
-
`Flash Attention: ${output.success('2.49x-7.47x speedup')}`,
|
|
654
|
-
`AgentDB Search: ${output.success('150x-12,500x improvement')}`,
|
|
655
|
-
`Memory Reduction: ${output.success('50-75%')}`,
|
|
656
|
-
`Code Reduction: ${output.success('<5,000 lines')}`
|
|
657
|
-
]);
|
|
658
|
-
return { success: true, data: { agents: v3Agents, count: agentCount } };
|
|
659
|
-
}
|
|
737
|
+
}); }
|
|
660
738
|
};
|
|
661
739
|
// Main swarm command
|
|
662
|
-
export
|
|
740
|
+
export var swarmCommand = {
|
|
663
741
|
name: 'swarm',
|
|
664
742
|
description: 'Swarm coordination commands',
|
|
665
743
|
subcommands: [initCommand, startCommand, statusCommand, stopCommand, scaleCommand, coordinateCommand],
|
|
@@ -669,27 +747,29 @@ export const swarmCommand = {
|
|
|
669
747
|
{ command: 'claude-flow swarm start -o "Build API" -s development', description: 'Start development swarm' },
|
|
670
748
|
{ command: 'claude-flow swarm coordinate --agents 15', description: 'V3 coordination' }
|
|
671
749
|
],
|
|
672
|
-
action:
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
750
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
751
|
+
return __generator(this, function (_a) {
|
|
752
|
+
output.writeln();
|
|
753
|
+
output.writeln(output.bold('Swarm Coordination Commands'));
|
|
754
|
+
output.writeln();
|
|
755
|
+
output.writeln('Usage: claude-flow swarm <subcommand> [options]');
|
|
756
|
+
output.writeln();
|
|
757
|
+
output.writeln('Subcommands:');
|
|
758
|
+
output.printList([
|
|
759
|
+
output.highlight('init') + " - Initialize a new swarm",
|
|
760
|
+
output.highlight('start') + " - Start swarm execution",
|
|
761
|
+
output.highlight('status') + " - Show swarm status",
|
|
762
|
+
output.highlight('stop') + " - Stop swarm execution",
|
|
763
|
+
output.highlight('scale') + " - Scale swarm agent count",
|
|
764
|
+
output.highlight('coordinate') + " - V3 15-agent coordination"
|
|
765
|
+
]);
|
|
766
|
+
return [2 /*return*/, { success: true }];
|
|
767
|
+
});
|
|
768
|
+
}); }
|
|
689
769
|
};
|
|
690
770
|
// Helper function
|
|
691
771
|
function getAgentPlan(strategy) {
|
|
692
|
-
|
|
772
|
+
var plans = {
|
|
693
773
|
specialized: [
|
|
694
774
|
{ role: 'Coordinator', type: 'coordinator', count: 1, purpose: 'Central orchestration (anti-drift)' },
|
|
695
775
|
{ role: 'Researcher', type: 'researcher', count: 1, purpose: 'Requirements analysis' },
|