kynjal-cli 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/appliance/gguf-engine.d.ts +91 -0
- package/dist/src/appliance/gguf-engine.d.ts.map +1 -0
- package/dist/src/appliance/gguf-engine.js +286 -525
- package/dist/src/appliance/gguf-engine.js.map +1 -1
- package/dist/src/appliance/ruvllm-bridge.d.ts +102 -0
- package/dist/src/appliance/ruvllm-bridge.d.ts.map +1 -0
- package/dist/src/appliance/ruvllm-bridge.js +203 -403
- package/dist/src/appliance/ruvllm-bridge.js.map +1 -1
- package/dist/src/appliance/rvfa-builder.d.ts +44 -0
- package/dist/src/appliance/rvfa-builder.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-builder.js +154 -208
- package/dist/src/appliance/rvfa-builder.js.map +1 -1
- package/dist/src/appliance/rvfa-distribution.d.ts +97 -0
- package/dist/src/appliance/rvfa-distribution.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-distribution.js +260 -423
- package/dist/src/appliance/rvfa-distribution.js.map +1 -1
- package/dist/src/appliance/rvfa-format.d.ts +111 -0
- package/dist/src/appliance/rvfa-format.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-format.js +128 -200
- package/dist/src/appliance/rvfa-format.js.map +1 -1
- package/dist/src/appliance/rvfa-runner.d.ts +69 -0
- package/dist/src/appliance/rvfa-runner.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-runner.js +168 -304
- package/dist/src/appliance/rvfa-runner.js.map +1 -1
- package/dist/src/appliance/rvfa-signing.d.ts +123 -0
- package/dist/src/appliance/rvfa-signing.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-signing.js +173 -295
- package/dist/src/appliance/rvfa-signing.js.map +1 -1
- package/dist/src/benchmarks/pretrain/index.d.ts +58 -0
- package/dist/src/benchmarks/pretrain/index.d.ts.map +1 -0
- package/dist/src/benchmarks/pretrain/index.js +331 -542
- package/dist/src/benchmarks/pretrain/index.js.map +1 -1
- package/dist/src/commands/agent.js +574 -697
- package/dist/src/commands/agent.js.map +1 -1
- package/dist/src/commands/analyze.js +1218 -1548
- package/dist/src/commands/analyze.js.map +1 -1
- package/dist/src/commands/appliance-advanced.js +158 -267
- package/dist/src/commands/appliance-advanced.js.map +1 -1
- package/dist/src/commands/appliance.js +318 -493
- package/dist/src/commands/appliance.js.map +1 -1
- package/dist/src/commands/benchmark.js +372 -523
- package/dist/src/commands/benchmark.js.map +1 -1
- package/dist/src/commands/claims.js +274 -364
- package/dist/src/commands/claims.js.map +1 -1
- package/dist/src/commands/cleanup.js +113 -157
- package/dist/src/commands/cleanup.js.map +1 -1
- package/dist/src/commands/completions.js +477 -118
- package/dist/src/commands/completions.js.map +1 -1
- package/dist/src/commands/config.js +237 -303
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/daemon.js +487 -596
- package/dist/src/commands/daemon.js.map +1 -1
- package/dist/src/commands/deployment.js +194 -275
- package/dist/src/commands/deployment.js.map +1 -1
- package/dist/src/commands/doctor.js +504 -686
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/embeddings.js +1293 -1543
- package/dist/src/commands/embeddings.js.map +1 -1
- package/dist/src/commands/guidance.js +449 -596
- package/dist/src/commands/guidance.js.map +1 -1
- package/dist/src/commands/hive-mind.js +854 -938
- package/dist/src/commands/hive-mind.js.map +1 -1
- package/dist/src/commands/hooks.js +3112 -3519
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.d.ts +115 -0
- package/dist/src/commands/index.d.ts.map +1 -0
- package/dist/src/commands/index.js +126 -308
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/init.js +788 -940
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/issues.js +383 -558
- package/dist/src/commands/issues.js.map +1 -1
- package/dist/src/commands/mcp.js +493 -605
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/memory.js +833 -1026
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/migrate.js +282 -347
- package/dist/src/commands/migrate.js.map +1 -1
- package/dist/src/commands/neural.js +1289 -1563
- package/dist/src/commands/neural.js.map +1 -1
- package/dist/src/commands/performance.js +497 -643
- package/dist/src/commands/performance.js.map +1 -1
- package/dist/src/commands/plugins.js +668 -841
- package/dist/src/commands/plugins.js.map +1 -1
- package/dist/src/commands/process.js +392 -447
- package/dist/src/commands/process.js.map +1 -1
- package/dist/src/commands/progress.js +162 -256
- package/dist/src/commands/progress.js.map +1 -1
- package/dist/src/commands/providers.js +150 -220
- package/dist/src/commands/providers.js.map +1 -1
- package/dist/src/commands/route.js +520 -665
- package/dist/src/commands/route.js.map +1 -1
- package/dist/src/commands/ruvector/backup.js +505 -651
- package/dist/src/commands/ruvector/backup.js.map +1 -1
- package/dist/src/commands/ruvector/benchmark.js +349 -401
- package/dist/src/commands/ruvector/benchmark.js.map +1 -1
- package/dist/src/commands/ruvector/import.js +224 -266
- package/dist/src/commands/ruvector/import.js.map +1 -1
- package/dist/src/commands/ruvector/index.js +37 -75
- package/dist/src/commands/ruvector/index.js.map +1 -1
- package/dist/src/commands/ruvector/init.js +336 -359
- package/dist/src/commands/ruvector/init.js.map +1 -1
- package/dist/src/commands/ruvector/migrate.js +335 -322
- package/dist/src/commands/ruvector/migrate.js.map +1 -1
- package/dist/src/commands/ruvector/optimize.js +375 -431
- package/dist/src/commands/ruvector/optimize.js.map +1 -1
- package/dist/src/commands/ruvector/setup.js +703 -117
- package/dist/src/commands/ruvector/setup.js.map +1 -1
- package/dist/src/commands/ruvector/status.js +364 -419
- package/dist/src/commands/ruvector/status.js.map +1 -1
- package/dist/src/commands/security.js +485 -608
- package/dist/src/commands/security.js.map +1 -1
- package/dist/src/commands/session.js +504 -626
- package/dist/src/commands/session.js.map +1 -1
- package/dist/src/commands/start.js +267 -364
- package/dist/src/commands/start.js.map +1 -1
- package/dist/src/commands/status.js +380 -486
- package/dist/src/commands/status.js.map +1 -1
- package/dist/src/commands/swarm.js +408 -488
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/commands/task.js +423 -538
- package/dist/src/commands/task.js.map +1 -1
- package/dist/src/commands/transfer-store.js +322 -412
- package/dist/src/commands/transfer-store.js.map +1 -1
- package/dist/src/commands/update.js +196 -291
- package/dist/src/commands/update.js.map +1 -1
- package/dist/src/commands/workflow.js +386 -486
- package/dist/src/commands/workflow.js.map +1 -1
- package/dist/src/config-adapter.d.ts +15 -0
- package/dist/src/config-adapter.d.ts.map +1 -0
- package/dist/src/config-adapter.js +38 -39
- package/dist/src/config-adapter.js.map +1 -1
- package/dist/src/index.d.ts +77 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +309 -411
- package/dist/src/index.js.map +1 -1
- package/dist/src/infrastructure/in-memory-repositories.d.ts +68 -0
- package/dist/src/infrastructure/in-memory-repositories.d.ts.map +1 -0
- package/dist/src/infrastructure/in-memory-repositories.js +246 -507
- package/dist/src/infrastructure/in-memory-repositories.js.map +1 -1
- package/dist/src/init/claudemd-generator.d.ts +25 -0
- package/dist/src/init/claudemd-generator.d.ts.map +1 -0
- package/dist/src/init/claudemd-generator.js +368 -78
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/executor.d.ts +41 -0
- package/dist/src/init/executor.d.ts.map +1 -0
- package/dist/src/init/executor.js +1307 -996
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/helpers-generator.d.ts +60 -0
- package/dist/src/init/helpers-generator.d.ts.map +1 -0
- package/dist/src/init/helpers-generator.js +657 -12
- 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.js +33 -37
- package/dist/src/init/mcp-generator.js.map +1 -1
- package/dist/src/init/settings-generator.js +76 -77
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/statusline-generator.js +801 -3
- package/dist/src/init/statusline-generator.js.map +1 -1
- package/dist/src/init/types.d.ts +1 -1
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/types.js +76 -59
- package/dist/src/init/types.js.map +1 -1
- package/dist/src/mcp-client.d.ts +92 -0
- package/dist/src/mcp-client.d.ts.map +1 -0
- package/dist/src/mcp-client.js +81 -125
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-server.d.ts +161 -0
- package/dist/src/mcp-server.d.ts.map +1 -0
- package/dist/src/mcp-server.js +470 -757
- package/dist/src/mcp-server.js.map +1 -1
- package/dist/src/mcp-tools/agent-tools.js +391 -492
- package/dist/src/mcp-tools/agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/agentdb-tools.js +332 -533
- package/dist/src/mcp-tools/agentdb-tools.js.map +1 -1
- package/dist/src/mcp-tools/analyze-tools.js +172 -236
- package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
- package/dist/src/mcp-tools/auto-install.d.ts +83 -0
- package/dist/src/mcp-tools/auto-install.d.ts.map +1 -0
- package/dist/src/mcp-tools/auto-install.js +80 -142
- package/dist/src/mcp-tools/auto-install.js.map +1 -1
- package/dist/src/mcp-tools/browser-tools.js +252 -375
- package/dist/src/mcp-tools/browser-tools.js.map +1 -1
- package/dist/src/mcp-tools/claims-tools.js +473 -565
- package/dist/src/mcp-tools/claims-tools.js.map +1 -1
- package/dist/src/mcp-tools/config-tools.js +197 -272
- package/dist/src/mcp-tools/config-tools.js.map +1 -1
- package/dist/src/mcp-tools/coordination-tools.js +500 -572
- package/dist/src/mcp-tools/coordination-tools.js.map +1 -1
- package/dist/src/mcp-tools/daa-tools.js +286 -364
- package/dist/src/mcp-tools/daa-tools.js.map +1 -1
- package/dist/src/mcp-tools/embeddings-tools.js +582 -693
- package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
- package/dist/src/mcp-tools/github-tools.js +260 -311
- package/dist/src/mcp-tools/github-tools.js.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.js +573 -640
- package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +2215 -2648
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/memory-tools.js +350 -505
- package/dist/src/mcp-tools/memory-tools.js.map +1 -1
- package/dist/src/mcp-tools/neural-tools.js +315 -412
- package/dist/src/mcp-tools/neural-tools.js.map +1 -1
- package/dist/src/mcp-tools/performance-tools.js +420 -480
- package/dist/src/mcp-tools/performance-tools.js.map +1 -1
- package/dist/src/mcp-tools/progress-tools.js +204 -278
- package/dist/src/mcp-tools/progress-tools.js.map +1 -1
- package/dist/src/mcp-tools/ruvllm-tools.js +163 -279
- package/dist/src/mcp-tools/ruvllm-tools.js.map +1 -1
- package/dist/src/mcp-tools/security-tools.js +297 -429
- package/dist/src/mcp-tools/security-tools.js.map +1 -1
- package/dist/src/mcp-tools/session-tools.js +185 -234
- package/dist/src/mcp-tools/session-tools.js.map +1 -1
- package/dist/src/mcp-tools/swarm-tools.js +207 -260
- package/dist/src/mcp-tools/swarm-tools.js.map +1 -1
- package/dist/src/mcp-tools/system-tools.js +276 -325
- package/dist/src/mcp-tools/system-tools.js.map +1 -1
- package/dist/src/mcp-tools/task-tools.js +270 -336
- package/dist/src/mcp-tools/task-tools.js.map +1 -1
- package/dist/src/mcp-tools/terminal-tools.js +148 -196
- package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
- package/dist/src/mcp-tools/transfer-tools.js +186 -333
- package/dist/src/mcp-tools/transfer-tools.js.map +1 -1
- package/dist/src/mcp-tools/types.d.ts +31 -0
- package/dist/src/mcp-tools/types.d.ts.map +1 -0
- package/dist/src/mcp-tools/wasm-agent-tools.js +133 -280
- package/dist/src/mcp-tools/wasm-agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/workflow-tools.js +405 -450
- package/dist/src/mcp-tools/workflow-tools.js.map +1 -1
- package/dist/src/memory/ewc-consolidation.d.ts +295 -0
- package/dist/src/memory/ewc-consolidation.d.ts.map +1 -0
- package/dist/src/memory/ewc-consolidation.js +190 -303
- package/dist/src/memory/ewc-consolidation.js.map +1 -1
- package/dist/src/memory/intelligence.d.ts +338 -0
- package/dist/src/memory/intelligence.d.ts.map +1 -0
- package/dist/src/memory/intelligence.js +569 -794
- package/dist/src/memory/intelligence.js.map +1 -1
- package/dist/src/memory/memory-bridge.d.ts +407 -0
- package/dist/src/memory/memory-bridge.d.ts.map +1 -0
- package/dist/src/memory/memory-bridge.js +1170 -1640
- package/dist/src/memory/memory-bridge.js.map +1 -1
- package/dist/src/memory/memory-initializer.d.ts +412 -0
- package/dist/src/memory/memory-initializer.d.ts.map +1 -0
- package/dist/src/memory/memory-initializer.js +1836 -1851
- package/dist/src/memory/memory-initializer.js.map +1 -1
- package/dist/src/memory/sona-optimizer.d.ts +227 -0
- package/dist/src/memory/sona-optimizer.d.ts.map +1 -0
- package/dist/src/memory/sona-optimizer.js +199 -329
- 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 +242 -272
- package/dist/src/output.js.map +1 -1
- package/dist/src/parser.d.ts +51 -0
- package/dist/src/parser.d.ts.map +1 -0
- package/dist/src/parser.js +140 -187
- package/dist/src/parser.js.map +1 -1
- package/dist/src/plugins/manager.d.ts +133 -0
- package/dist/src/plugins/manager.d.ts.map +1 -0
- package/dist/src/plugins/manager.js +285 -521
- package/dist/src/plugins/manager.js.map +1 -1
- package/dist/src/plugins/store/discovery.d.ts +88 -0
- package/dist/src/plugins/store/discovery.d.ts.map +1 -0
- package/dist/src/plugins/store/discovery.js +271 -358
- package/dist/src/plugins/store/discovery.js.map +1 -1
- package/dist/src/plugins/store/index.d.ts +76 -0
- package/dist/src/plugins/store/index.d.ts.map +1 -0
- package/dist/src/plugins/store/index.js +48 -105
- package/dist/src/plugins/store/index.js.map +1 -1
- package/dist/src/plugins/store/search.d.ts +46 -0
- package/dist/src/plugins/store/search.d.ts.map +1 -0
- package/dist/src/plugins/store/search.js +69 -107
- package/dist/src/plugins/store/search.js.map +1 -1
- package/dist/src/plugins/store/types.d.ts +274 -0
- package/dist/src/plugins/store/types.d.ts.map +1 -0
- package/dist/src/plugins/tests/demo-plugin-store.js +113 -160
- package/dist/src/plugins/tests/demo-plugin-store.js.map +1 -1
- package/dist/src/plugins/tests/standalone-test.js +172 -223
- package/dist/src/plugins/tests/standalone-test.js.map +1 -1
- package/dist/src/plugins/tests/test-plugin-store.js +190 -228
- package/dist/src/plugins/tests/test-plugin-store.js.map +1 -1
- package/dist/src/production/circuit-breaker.d.ts +101 -0
- package/dist/src/production/circuit-breaker.d.ts.map +1 -0
- package/dist/src/production/circuit-breaker.js +62 -126
- package/dist/src/production/circuit-breaker.js.map +1 -1
- package/dist/src/production/error-handler.d.ts +92 -0
- package/dist/src/production/error-handler.d.ts.map +1 -0
- package/dist/src/production/error-handler.js +86 -156
- package/dist/src/production/error-handler.js.map +1 -1
- package/dist/src/production/monitoring.d.ts +161 -0
- package/dist/src/production/monitoring.d.ts.map +1 -0
- package/dist/src/production/monitoring.js +139 -220
- package/dist/src/production/monitoring.js.map +1 -1
- package/dist/src/production/rate-limiter.d.ts +80 -0
- package/dist/src/production/rate-limiter.d.ts.map +1 -0
- package/dist/src/production/rate-limiter.js +74 -93
- package/dist/src/production/rate-limiter.js.map +1 -1
- package/dist/src/production/retry.d.ts +48 -0
- package/dist/src/production/retry.d.ts.map +1 -0
- package/dist/src/production/retry.js +75 -167
- package/dist/src/production/retry.js.map +1 -1
- package/dist/src/prompt.d.ts +44 -0
- package/dist/src/prompt.d.ts.map +1 -0
- package/dist/src/prompt.js +436 -560
- package/dist/src/prompt.js.map +1 -1
- package/dist/src/runtime/headless.d.ts +60 -0
- package/dist/src/runtime/headless.d.ts.map +1 -0
- package/dist/src/runtime/headless.js +197 -286
- package/dist/src/runtime/headless.js.map +1 -1
- package/dist/src/ruvector/agent-wasm.d.ts +182 -0
- package/dist/src/ruvector/agent-wasm.d.ts.map +1 -0
- package/dist/src/ruvector/agent-wasm.js +156 -351
- package/dist/src/ruvector/agent-wasm.js.map +1 -1
- package/dist/src/ruvector/ast-analyzer.d.ts +67 -0
- package/dist/src/ruvector/ast-analyzer.d.ts.map +1 -0
- package/dist/src/ruvector/ast-analyzer.js +145 -232
- package/dist/src/ruvector/ast-analyzer.js.map +1 -1
- package/dist/src/ruvector/coverage-router.d.ts +160 -0
- package/dist/src/ruvector/coverage-router.d.ts.map +1 -0
- package/dist/src/ruvector/coverage-router.js +287 -419
- package/dist/src/ruvector/coverage-router.js.map +1 -1
- package/dist/src/ruvector/coverage-tools.js +56 -101
- package/dist/src/ruvector/coverage-tools.js.map +1 -1
- package/dist/src/ruvector/diff-classifier.d.ts +175 -0
- package/dist/src/ruvector/diff-classifier.d.ts.map +1 -0
- package/dist/src/ruvector/diff-classifier.js +324 -451
- package/dist/src/ruvector/diff-classifier.js.map +1 -1
- package/dist/src/ruvector/enhanced-model-router.d.ts +146 -0
- package/dist/src/ruvector/enhanced-model-router.d.ts.map +1 -0
- package/dist/src/ruvector/enhanced-model-router.js +260 -336
- package/dist/src/ruvector/enhanced-model-router.js.map +1 -1
- package/dist/src/ruvector/flash-attention.d.ts +195 -0
- package/dist/src/ruvector/flash-attention.d.ts.map +1 -0
- package/dist/src/ruvector/flash-attention.js +223 -254
- package/dist/src/ruvector/flash-attention.js.map +1 -1
- package/dist/src/ruvector/graph-analyzer.d.ts +187 -0
- package/dist/src/ruvector/graph-analyzer.d.ts.map +1 -0
- package/dist/src/ruvector/graph-analyzer.js +486 -680
- package/dist/src/ruvector/graph-analyzer.js.map +1 -1
- package/dist/src/ruvector/index.d.ts +40 -0
- package/dist/src/ruvector/index.d.ts.map +1 -0
- package/dist/src/ruvector/index.js +36 -106
- package/dist/src/ruvector/index.js.map +1 -1
- package/dist/src/ruvector/lora-adapter.d.ts +218 -0
- package/dist/src/ruvector/lora-adapter.d.ts.map +1 -0
- package/dist/src/ruvector/lora-adapter.js +155 -248
- package/dist/src/ruvector/lora-adapter.js.map +1 -1
- package/dist/src/ruvector/model-router.d.ts +220 -0
- package/dist/src/ruvector/model-router.d.ts.map +1 -0
- package/dist/src/ruvector/model-router.js +175 -248
- package/dist/src/ruvector/model-router.js.map +1 -1
- package/dist/src/ruvector/moe-router.d.ts +206 -0
- package/dist/src/ruvector/moe-router.d.ts.map +1 -0
- package/dist/src/ruvector/moe-router.js +228 -286
- package/dist/src/ruvector/moe-router.js.map +1 -1
- package/dist/src/ruvector/q-learning-router.d.ts +211 -0
- package/dist/src/ruvector/q-learning-router.d.ts.map +1 -0
- package/dist/src/ruvector/q-learning-router.js +257 -338
- package/dist/src/ruvector/q-learning-router.js.map +1 -1
- package/dist/src/ruvector/ruvllm-wasm.d.ts +179 -0
- package/dist/src/ruvector/ruvllm-wasm.d.ts.map +1 -0
- package/dist/src/ruvector/ruvllm-wasm.js +270 -434
- package/dist/src/ruvector/ruvllm-wasm.js.map +1 -1
- package/dist/src/ruvector/semantic-router.d.ts +77 -0
- package/dist/src/ruvector/semantic-router.d.ts.map +1 -0
- package/dist/src/ruvector/semantic-router.js +60 -67
- package/dist/src/ruvector/semantic-router.js.map +1 -1
- package/dist/src/ruvector/vector-db.d.ts +69 -0
- package/dist/src/ruvector/vector-db.d.ts.map +1 -0
- package/dist/src/ruvector/vector-db.js +119 -205
- package/dist/src/ruvector/vector-db.js.map +1 -1
- package/dist/src/services/agentic-flow-bridge.d.ts +50 -0
- package/dist/src/services/agentic-flow-bridge.d.ts.map +1 -0
- package/dist/src/services/agentic-flow-bridge.js +32 -105
- package/dist/src/services/agentic-flow-bridge.js.map +1 -1
- package/dist/src/services/claim-service.d.ts +204 -0
- package/dist/src/services/claim-service.d.ts.map +1 -0
- package/dist/src/services/claim-service.js +615 -940
- package/dist/src/services/claim-service.js.map +1 -1
- package/dist/src/services/container-worker-pool.d.ts +197 -0
- package/dist/src/services/container-worker-pool.d.ts.map +1 -0
- package/dist/src/services/container-worker-pool.js +398 -666
- package/dist/src/services/container-worker-pool.js.map +1 -1
- package/dist/src/services/headless-worker-executor.d.ts +304 -0
- package/dist/src/services/headless-worker-executor.d.ts.map +1 -0
- package/dist/src/services/headless-worker-executor.js +441 -467
- package/dist/src/services/headless-worker-executor.js.map +1 -1
- package/dist/src/services/index.d.ts +4 -4
- 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.d.ts +58 -0
- package/dist/src/services/registry-api.d.ts.map +1 -0
- package/dist/src/services/registry-api.js +92 -200
- package/dist/src/services/registry-api.js.map +1 -1
- package/dist/src/services/ruvector-training.d.ts +222 -0
- package/dist/src/services/ruvector-training.d.ts.map +1 -0
- package/dist/src/services/ruvector-training.js +257 -337
- package/dist/src/services/ruvector-training.js.map +1 -1
- package/dist/src/services/worker-daemon.d.ts +228 -0
- package/dist/src/services/worker-daemon.d.ts.map +1 -0
- package/dist/src/services/worker-daemon.js +591 -849
- package/dist/src/services/worker-daemon.js.map +1 -1
- package/dist/src/services/worker-queue.d.ts +194 -0
- package/dist/src/services/worker-queue.d.ts.map +1 -0
- package/dist/src/services/worker-queue.js +331 -548
- package/dist/src/services/worker-queue.js.map +1 -1
- package/dist/src/suggest.d.ts +53 -0
- package/dist/src/suggest.d.ts.map +1 -0
- package/dist/src/suggest.js +45 -55
- package/dist/src/suggest.js.map +1 -1
- package/dist/src/transfer/anonymization/index.js +29 -37
- package/dist/src/transfer/anonymization/index.js.map +1 -1
- package/dist/src/transfer/deploy-seraphine.js +128 -155
- package/dist/src/transfer/deploy-seraphine.js.map +1 -1
- package/dist/src/transfer/export.d.ts +25 -0
- package/dist/src/transfer/export.d.ts.map +1 -0
- package/dist/src/transfer/export.js +84 -142
- 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 +0 -2
- package/dist/src/transfer/index.js.map +1 -1
- package/dist/src/transfer/ipfs/client.d.ts +109 -0
- package/dist/src/transfer/ipfs/client.d.ts.map +1 -0
- package/dist/src/transfer/ipfs/client.js +187 -337
- package/dist/src/transfer/ipfs/client.js.map +1 -1
- package/dist/src/transfer/ipfs/upload.d.ts +95 -0
- package/dist/src/transfer/ipfs/upload.d.ts.map +1 -0
- package/dist/src/transfer/ipfs/upload.js +288 -434
- package/dist/src/transfer/ipfs/upload.js.map +1 -1
- package/dist/src/transfer/models/seraphine.d.ts +72 -0
- package/dist/src/transfer/models/seraphine.d.ts.map +1 -0
- package/dist/src/transfer/models/seraphine.js +55 -55
- package/dist/src/transfer/models/seraphine.js.map +1 -1
- package/dist/src/transfer/serialization/cfp.d.ts +49 -0
- package/dist/src/transfer/serialization/cfp.d.ts.map +1 -0
- package/dist/src/transfer/serialization/cfp.js +30 -31
- package/dist/src/transfer/serialization/cfp.js.map +1 -1
- package/dist/src/transfer/storage/gcs.d.ts +82 -0
- package/dist/src/transfer/storage/gcs.d.ts.map +1 -0
- package/dist/src/transfer/storage/gcs.js +165 -232
- package/dist/src/transfer/storage/gcs.js.map +1 -1
- package/dist/src/transfer/store/discovery.d.ts +84 -0
- package/dist/src/transfer/store/discovery.d.ts.map +1 -0
- package/dist/src/transfer/store/discovery.js +239 -349
- package/dist/src/transfer/store/discovery.js.map +1 -1
- package/dist/src/transfer/store/download.d.ts +70 -0
- package/dist/src/transfer/store/download.d.ts.map +1 -0
- package/dist/src/transfer/store/download.js +243 -365
- package/dist/src/transfer/store/download.js.map +1 -1
- package/dist/src/transfer/store/index.d.ts +84 -0
- package/dist/src/transfer/store/index.d.ts.map +1 -0
- package/dist/src/transfer/store/index.js +63 -130
- package/dist/src/transfer/store/index.js.map +1 -1
- package/dist/src/transfer/store/publish.d.ts +76 -0
- package/dist/src/transfer/store/publish.d.ts.map +1 -0
- package/dist/src/transfer/store/publish.js +184 -258
- package/dist/src/transfer/store/publish.js.map +1 -1
- package/dist/src/transfer/store/registry.js +50 -72
- package/dist/src/transfer/store/registry.js.map +1 -1
- package/dist/src/transfer/store/search.d.ts +54 -0
- package/dist/src/transfer/store/search.d.ts.map +1 -0
- package/dist/src/transfer/store/search.js +64 -96
- package/dist/src/transfer/store/search.js.map +1 -1
- package/dist/src/transfer/store/tests/standalone-test.js +174 -231
- package/dist/src/transfer/store/tests/standalone-test.js.map +1 -1
- package/dist/src/transfer/test-seraphine.js +95 -130
- package/dist/src/transfer/test-seraphine.js.map +1 -1
- package/dist/src/transfer/tests/test-store.js +194 -239
- package/dist/src/transfer/tests/test-store.js.map +1 -1
- package/dist/src/transfer/types.d.ts +245 -0
- package/dist/src/transfer/types.d.ts.map +1 -0
- package/dist/src/types.d.ts +198 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +26 -55
- package/dist/src/types.js.map +1 -1
- package/dist/src/update/checker.d.ts +34 -0
- package/dist/src/update/checker.d.ts.map +1 -0
- package/dist/src/update/checker.js +106 -183
- package/dist/src/update/checker.js.map +1 -1
- package/dist/src/update/executor.d.ts +32 -0
- package/dist/src/update/executor.d.ts.map +1 -0
- package/dist/src/update/executor.js +135 -198
- package/dist/src/update/executor.js.map +1 -1
- package/dist/src/update/index.d.ts +33 -0
- package/dist/src/update/index.d.ts.map +1 -0
- package/dist/src/update/index.js +38 -85
- package/dist/src/update/index.js.map +1 -1
- package/dist/src/update/rate-limiter.d.ts +20 -0
- package/dist/src/update/rate-limiter.d.ts.map +1 -0
- package/dist/src/update/rate-limiter.js +19 -31
- package/dist/src/update/rate-limiter.js.map +1 -1
- package/dist/src/update/validator.d.ts +17 -0
- package/dist/src/update/validator.d.ts.map +1 -0
- package/dist/src/update/validator.js +38 -64
- package/dist/src/update/validator.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -2,42 +2,6 @@
|
|
|
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
|
-
};
|
|
41
5
|
import { output } from '../output.js';
|
|
42
6
|
import { select, confirm } from '../prompt.js';
|
|
43
7
|
import { callMCPTool, MCPClientError } from '../mcp-client.js';
|
|
@@ -45,85 +9,81 @@ import * as fs from 'fs';
|
|
|
45
9
|
import * as path from 'path';
|
|
46
10
|
// Get dynamic swarm status from memory/session files
|
|
47
11
|
function getSwarmStatus(swarmId) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
var memoryPaths = [
|
|
12
|
+
const swarmDir = path.join(process.cwd(), '.swarm');
|
|
13
|
+
const sessionDir = path.join(process.cwd(), '.claude', 'sessions');
|
|
14
|
+
const memoryPaths = [
|
|
52
15
|
path.join(process.cwd(), '.swarm', 'memory.db'),
|
|
53
16
|
path.join(process.cwd(), '.claude', 'memory.db'),
|
|
54
17
|
];
|
|
55
18
|
// Check for active swarm state file
|
|
56
|
-
|
|
57
|
-
|
|
19
|
+
const swarmStateFile = path.join(swarmDir, 'state.json');
|
|
20
|
+
let swarmState = null;
|
|
58
21
|
if (fs.existsSync(swarmStateFile)) {
|
|
59
22
|
try {
|
|
60
23
|
swarmState = JSON.parse(fs.readFileSync(swarmStateFile, 'utf-8'));
|
|
61
24
|
}
|
|
62
|
-
catch
|
|
25
|
+
catch {
|
|
63
26
|
// Ignore parse errors
|
|
64
27
|
}
|
|
65
28
|
}
|
|
66
29
|
// Count active agents from process files
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
30
|
+
let activeAgents = 0;
|
|
31
|
+
let totalAgents = 0;
|
|
32
|
+
const agentsDir = path.join(swarmDir, 'agents');
|
|
70
33
|
if (fs.existsSync(agentsDir)) {
|
|
71
34
|
try {
|
|
72
|
-
|
|
35
|
+
const agentFiles = fs.readdirSync(agentsDir).filter(f => f.endsWith('.json'));
|
|
73
36
|
totalAgents = agentFiles.length;
|
|
74
|
-
for (
|
|
75
|
-
var file = agentFiles_1[_i];
|
|
37
|
+
for (const file of agentFiles) {
|
|
76
38
|
try {
|
|
77
|
-
|
|
39
|
+
const agent = JSON.parse(fs.readFileSync(path.join(agentsDir, file), 'utf-8'));
|
|
78
40
|
if (agent.status === 'active' || agent.status === 'running') {
|
|
79
41
|
activeAgents++;
|
|
80
42
|
}
|
|
81
43
|
}
|
|
82
|
-
catch
|
|
44
|
+
catch {
|
|
83
45
|
// Ignore
|
|
84
46
|
}
|
|
85
47
|
}
|
|
86
48
|
}
|
|
87
|
-
catch
|
|
49
|
+
catch {
|
|
88
50
|
// Ignore
|
|
89
51
|
}
|
|
90
52
|
}
|
|
91
53
|
// Get session count
|
|
92
|
-
|
|
54
|
+
let sessionCount = 0;
|
|
93
55
|
if (fs.existsSync(sessionDir)) {
|
|
94
56
|
try {
|
|
95
|
-
sessionCount = fs.readdirSync(sessionDir).filter(
|
|
57
|
+
sessionCount = fs.readdirSync(sessionDir).filter(f => f.endsWith('.json')).length;
|
|
96
58
|
}
|
|
97
|
-
catch
|
|
59
|
+
catch {
|
|
98
60
|
// Ignore
|
|
99
61
|
}
|
|
100
62
|
}
|
|
101
63
|
// Get memory size as rough indicator of activity
|
|
102
|
-
|
|
103
|
-
for (
|
|
104
|
-
var dbPath = memoryPaths_1[_j];
|
|
64
|
+
let memorySize = 0;
|
|
65
|
+
for (const dbPath of memoryPaths) {
|
|
105
66
|
if (fs.existsSync(dbPath)) {
|
|
106
67
|
try {
|
|
107
68
|
memorySize = fs.statSync(dbPath).size;
|
|
108
69
|
break;
|
|
109
70
|
}
|
|
110
|
-
catch
|
|
71
|
+
catch {
|
|
111
72
|
// Ignore
|
|
112
73
|
}
|
|
113
74
|
}
|
|
114
75
|
}
|
|
115
76
|
// Count task files if they exist
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
77
|
+
let completedTasks = 0;
|
|
78
|
+
let inProgressTasks = 0;
|
|
79
|
+
let pendingTasks = 0;
|
|
80
|
+
const tasksDir = path.join(swarmDir, 'tasks');
|
|
120
81
|
if (fs.existsSync(tasksDir)) {
|
|
121
82
|
try {
|
|
122
|
-
|
|
123
|
-
for (
|
|
124
|
-
var file = taskFiles_1[_l];
|
|
83
|
+
const taskFiles = fs.readdirSync(tasksDir).filter(f => f.endsWith('.json'));
|
|
84
|
+
for (const file of taskFiles) {
|
|
125
85
|
try {
|
|
126
|
-
|
|
86
|
+
const task = JSON.parse(fs.readFileSync(path.join(tasksDir, file), 'utf-8'));
|
|
127
87
|
if (task.status === 'completed' || task.status === 'done') {
|
|
128
88
|
completedTasks++;
|
|
129
89
|
}
|
|
@@ -134,19 +94,19 @@ function getSwarmStatus(swarmId) {
|
|
|
134
94
|
pendingTasks++;
|
|
135
95
|
}
|
|
136
96
|
}
|
|
137
|
-
catch
|
|
97
|
+
catch {
|
|
138
98
|
// Ignore
|
|
139
99
|
}
|
|
140
100
|
}
|
|
141
101
|
}
|
|
142
|
-
catch
|
|
102
|
+
catch {
|
|
143
103
|
// Ignore
|
|
144
104
|
}
|
|
145
105
|
}
|
|
146
106
|
// Calculate dynamic progress based on actual state
|
|
147
107
|
// If no swarm state, show 0%. Otherwise calculate from completed tasks
|
|
148
|
-
|
|
149
|
-
|
|
108
|
+
const totalTasks = completedTasks + inProgressTasks + pendingTasks;
|
|
109
|
+
let progress = 0;
|
|
150
110
|
if (totalTasks > 0) {
|
|
151
111
|
progress = Math.round((completedTasks / totalTasks) * 100);
|
|
152
112
|
}
|
|
@@ -155,7 +115,7 @@ function getSwarmStatus(swarmId) {
|
|
|
155
115
|
progress = 5;
|
|
156
116
|
}
|
|
157
117
|
// Determine status
|
|
158
|
-
|
|
118
|
+
let status = 'idle';
|
|
159
119
|
if (inProgressTasks > 0 || activeAgents > 0) {
|
|
160
120
|
status = 'running';
|
|
161
121
|
}
|
|
@@ -166,18 +126,18 @@ function getSwarmStatus(swarmId) {
|
|
|
166
126
|
status = 'ready';
|
|
167
127
|
}
|
|
168
128
|
return {
|
|
169
|
-
id: swarmId ||
|
|
170
|
-
topology:
|
|
171
|
-
status
|
|
172
|
-
objective:
|
|
173
|
-
strategy:
|
|
129
|
+
id: swarmId || swarmState?.id || 'no-active-swarm',
|
|
130
|
+
topology: swarmState?.topology || 'none',
|
|
131
|
+
status,
|
|
132
|
+
objective: swarmState?.objective || 'No active objective',
|
|
133
|
+
strategy: swarmState?.strategy || 'none',
|
|
174
134
|
agents: {
|
|
175
135
|
total: totalAgents,
|
|
176
136
|
active: activeAgents,
|
|
177
137
|
idle: Math.max(0, totalAgents - activeAgents),
|
|
178
138
|
completed: 0
|
|
179
139
|
},
|
|
180
|
-
progress
|
|
140
|
+
progress,
|
|
181
141
|
tasks: {
|
|
182
142
|
total: totalTasks,
|
|
183
143
|
completed: completedTasks,
|
|
@@ -187,7 +147,7 @@ function getSwarmStatus(swarmId) {
|
|
|
187
147
|
metrics: {
|
|
188
148
|
tokensUsed: 0,
|
|
189
149
|
avgResponseTime: '--',
|
|
190
|
-
successRate: totalTasks > 0 ? Math.round((completedTasks / totalTasks) * 100)
|
|
150
|
+
successRate: totalTasks > 0 ? `${Math.round((completedTasks / totalTasks) * 100)}%` : '--',
|
|
191
151
|
elapsedTime: '--'
|
|
192
152
|
},
|
|
193
153
|
coordination: {
|
|
@@ -199,7 +159,7 @@ function getSwarmStatus(swarmId) {
|
|
|
199
159
|
};
|
|
200
160
|
}
|
|
201
161
|
// Swarm topologies
|
|
202
|
-
|
|
162
|
+
const TOPOLOGIES = [
|
|
203
163
|
{ value: 'hierarchical', label: 'Hierarchical', hint: 'Queen-led coordination with worker agents' },
|
|
204
164
|
{ value: 'mesh', label: 'Mesh', hint: 'Fully connected peer-to-peer network' },
|
|
205
165
|
{ value: 'ring', label: 'Ring', hint: 'Circular communication pattern' },
|
|
@@ -208,7 +168,7 @@ var TOPOLOGIES = [
|
|
|
208
168
|
{ value: 'hierarchical-mesh', label: 'Hierarchical Mesh', hint: 'V3 15-agent queen + peer communication (recommended)' }
|
|
209
169
|
];
|
|
210
170
|
// Swarm strategies
|
|
211
|
-
|
|
171
|
+
const STRATEGIES = [
|
|
212
172
|
{ value: 'specialized', label: 'Specialized', hint: 'Clear roles, no overlap (anti-drift)' },
|
|
213
173
|
{ value: 'balanced', label: 'Balanced', hint: 'Even distribution of work' },
|
|
214
174
|
{ value: 'adaptive', label: 'Adaptive', hint: 'Dynamic strategy based on task' },
|
|
@@ -220,7 +180,7 @@ var STRATEGIES = [
|
|
|
220
180
|
{ value: 'analysis', label: 'Analysis', hint: 'Code analysis and documentation' }
|
|
221
181
|
];
|
|
222
182
|
// Initialize swarm
|
|
223
|
-
|
|
183
|
+
const initCommand = {
|
|
224
184
|
name: 'init',
|
|
225
185
|
description: 'Initialize a new swarm',
|
|
226
186
|
options: [
|
|
@@ -229,147 +189,136 @@ var initCommand = {
|
|
|
229
189
|
short: 't',
|
|
230
190
|
description: 'Swarm topology',
|
|
231
191
|
type: 'string',
|
|
232
|
-
choices: TOPOLOGIES.map(
|
|
233
|
-
|
|
192
|
+
choices: TOPOLOGIES.map(t => t.value),
|
|
193
|
+
default: 'hierarchical'
|
|
234
194
|
},
|
|
235
195
|
{
|
|
236
196
|
name: 'max-agents',
|
|
237
197
|
short: 'm',
|
|
238
198
|
description: 'Maximum number of agents',
|
|
239
199
|
type: 'number',
|
|
240
|
-
|
|
200
|
+
default: 15
|
|
241
201
|
},
|
|
242
202
|
{
|
|
243
203
|
name: 'auto-scale',
|
|
244
204
|
description: 'Enable automatic scaling',
|
|
245
205
|
type: 'boolean',
|
|
246
|
-
|
|
206
|
+
default: true
|
|
247
207
|
},
|
|
248
208
|
{
|
|
249
209
|
name: 'strategy',
|
|
250
210
|
short: 's',
|
|
251
211
|
description: 'Coordination strategy',
|
|
252
212
|
type: 'string',
|
|
253
|
-
choices: STRATEGIES.map(
|
|
213
|
+
choices: STRATEGIES.map(s => s.value)
|
|
254
214
|
},
|
|
255
215
|
{
|
|
256
216
|
name: 'v3-mode',
|
|
257
217
|
description: 'Enable V3 15-agent hierarchical mesh mode',
|
|
258
218
|
type: 'boolean',
|
|
259
|
-
|
|
219
|
+
default: false
|
|
260
220
|
}
|
|
261
221
|
],
|
|
262
|
-
action:
|
|
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
|
-
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*/];
|
|
222
|
+
action: async (ctx) => {
|
|
223
|
+
let topology = ctx.flags.topology;
|
|
224
|
+
const maxAgents = ctx.flags.maxAgents || 15;
|
|
225
|
+
const v3Mode = ctx.flags.v3Mode;
|
|
226
|
+
// V3 mode enables hierarchical-mesh hybrid
|
|
227
|
+
if (v3Mode) {
|
|
228
|
+
topology = 'hierarchical-mesh';
|
|
229
|
+
output.printInfo('V3 Mode: Using hierarchical-mesh topology with 15-agent coordination');
|
|
230
|
+
}
|
|
231
|
+
// Interactive topology selection
|
|
232
|
+
if (!topology && ctx.interactive) {
|
|
233
|
+
topology = await select({
|
|
234
|
+
message: 'Select swarm topology:',
|
|
235
|
+
options: TOPOLOGIES,
|
|
236
|
+
default: 'hierarchical'
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
output.writeln();
|
|
240
|
+
output.printInfo('Initializing swarm...');
|
|
241
|
+
try {
|
|
242
|
+
// Call MCP tool to initialize swarm
|
|
243
|
+
const result = await callMCPTool('swarm_init', {
|
|
244
|
+
topology: topology,
|
|
245
|
+
maxAgents,
|
|
246
|
+
config: {
|
|
247
|
+
communicationProtocol: 'message-bus',
|
|
248
|
+
consensusMechanism: 'majority',
|
|
249
|
+
failureHandling: 'retry',
|
|
250
|
+
loadBalancing: true,
|
|
251
|
+
autoScaling: ctx.flags.autoScale ?? true,
|
|
252
|
+
},
|
|
253
|
+
metadata: {
|
|
254
|
+
v3Mode,
|
|
255
|
+
strategy: ctx.flags.strategy || 'development',
|
|
256
|
+
},
|
|
257
|
+
});
|
|
258
|
+
// Display initialization progress
|
|
259
|
+
output.writeln(output.dim(' Creating coordination topology...'));
|
|
260
|
+
output.writeln(output.dim(' Initializing memory namespace...'));
|
|
261
|
+
output.writeln(output.dim(' Setting up communication channels...'));
|
|
262
|
+
if (v3Mode) {
|
|
263
|
+
output.writeln(output.dim(' Enabling Flash Attention (2.49x-7.47x speedup)...'));
|
|
264
|
+
output.writeln(output.dim(' Configuring AgentDB integration (150x faster)...'));
|
|
265
|
+
output.writeln(output.dim(' Initializing SONA learning system...'));
|
|
367
266
|
}
|
|
368
|
-
|
|
369
|
-
|
|
267
|
+
output.writeln();
|
|
268
|
+
output.printTable({
|
|
269
|
+
columns: [
|
|
270
|
+
{ key: 'property', header: 'Property', width: 20 },
|
|
271
|
+
{ key: 'value', header: 'Value', width: 35 }
|
|
272
|
+
],
|
|
273
|
+
data: [
|
|
274
|
+
{ property: 'Swarm ID', value: result.swarmId },
|
|
275
|
+
{ property: 'Topology', value: result.topology },
|
|
276
|
+
{ property: 'Max Agents', value: result.config.maxAgents },
|
|
277
|
+
{ property: 'Auto Scale', value: result.config.autoScaling ? 'Enabled' : 'Disabled' },
|
|
278
|
+
{ property: 'Protocol', value: result.config.communicationProtocol || 'N/A' },
|
|
279
|
+
{ property: 'V3 Mode', value: v3Mode ? 'Enabled' : 'Disabled' }
|
|
280
|
+
]
|
|
281
|
+
});
|
|
282
|
+
output.writeln();
|
|
283
|
+
output.printSuccess('Swarm initialized successfully');
|
|
284
|
+
// Save swarm state locally for status command to read
|
|
285
|
+
const swarmDir = path.join(process.cwd(), '.swarm');
|
|
286
|
+
try {
|
|
287
|
+
if (!fs.existsSync(swarmDir)) {
|
|
288
|
+
fs.mkdirSync(swarmDir, { recursive: true });
|
|
289
|
+
}
|
|
290
|
+
const stateFile = path.join(swarmDir, 'state.json');
|
|
291
|
+
fs.writeFileSync(stateFile, JSON.stringify({
|
|
292
|
+
id: result.swarmId,
|
|
293
|
+
topology: result.topology,
|
|
294
|
+
maxAgents: result.config.maxAgents,
|
|
295
|
+
strategy: ctx.flags.strategy || 'development',
|
|
296
|
+
v3Mode,
|
|
297
|
+
initializedAt: result.initializedAt,
|
|
298
|
+
status: 'ready'
|
|
299
|
+
}, null, 2));
|
|
300
|
+
}
|
|
301
|
+
catch {
|
|
302
|
+
// Ignore errors writing state file
|
|
303
|
+
}
|
|
304
|
+
if (ctx.flags.format === 'json') {
|
|
305
|
+
output.printJson(result);
|
|
306
|
+
}
|
|
307
|
+
return { success: true, data: result };
|
|
308
|
+
}
|
|
309
|
+
catch (error) {
|
|
310
|
+
if (error instanceof MCPClientError) {
|
|
311
|
+
output.printError(`Failed to initialize swarm: ${error.message}`);
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
output.printError(`Unexpected error: ${String(error)}`);
|
|
315
|
+
}
|
|
316
|
+
return { success: false, exitCode: 1 };
|
|
317
|
+
}
|
|
318
|
+
}
|
|
370
319
|
};
|
|
371
320
|
// Start swarm execution
|
|
372
|
-
|
|
321
|
+
const startCommand = {
|
|
373
322
|
name: 'start',
|
|
374
323
|
description: 'Start swarm execution',
|
|
375
324
|
options: [
|
|
@@ -385,184 +334,170 @@ var startCommand = {
|
|
|
385
334
|
short: 's',
|
|
386
335
|
description: 'Execution strategy',
|
|
387
336
|
type: 'string',
|
|
388
|
-
choices: STRATEGIES.map(
|
|
337
|
+
choices: STRATEGIES.map(s => s.value)
|
|
389
338
|
},
|
|
390
339
|
{
|
|
391
340
|
name: 'parallel',
|
|
392
341
|
short: 'p',
|
|
393
342
|
description: 'Enable parallel execution',
|
|
394
343
|
type: 'boolean',
|
|
395
|
-
|
|
344
|
+
default: true
|
|
396
345
|
},
|
|
397
346
|
{
|
|
398
347
|
name: 'monitor',
|
|
399
348
|
description: 'Enable real-time monitoring',
|
|
400
349
|
type: 'boolean',
|
|
401
|
-
|
|
350
|
+
default: true
|
|
402
351
|
}
|
|
403
352
|
],
|
|
404
353
|
examples: [
|
|
405
354
|
{ command: 'claude-flow swarm start -o "Build REST API" -s development', description: 'Start development swarm' },
|
|
406
355
|
{ command: 'claude-flow swarm start -o "Analyze codebase" --parallel', description: 'Parallel analysis' }
|
|
407
356
|
],
|
|
408
|
-
action:
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
{ 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 }];
|
|
481
|
-
}
|
|
357
|
+
action: async (ctx) => {
|
|
358
|
+
const objective = ctx.args[0] || ctx.flags.objective;
|
|
359
|
+
let strategy = ctx.flags.strategy;
|
|
360
|
+
if (!objective) {
|
|
361
|
+
output.printError('Objective is required. Use -o or provide as argument.');
|
|
362
|
+
return { success: false, exitCode: 1 };
|
|
363
|
+
}
|
|
364
|
+
// Interactive strategy selection
|
|
365
|
+
if (!strategy && ctx.interactive) {
|
|
366
|
+
strategy = await select({
|
|
367
|
+
message: 'Select execution strategy:',
|
|
368
|
+
options: STRATEGIES,
|
|
369
|
+
default: 'development'
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
strategy = strategy || 'development';
|
|
373
|
+
output.writeln();
|
|
374
|
+
output.printInfo(`Starting swarm with objective: ${output.highlight(objective)}`);
|
|
375
|
+
output.writeln();
|
|
376
|
+
// Compute agent deployment plan based on strategy
|
|
377
|
+
const agentPlan = getAgentPlan(strategy);
|
|
378
|
+
output.writeln(output.bold('Agent Deployment Plan'));
|
|
379
|
+
output.printTable({
|
|
380
|
+
columns: [
|
|
381
|
+
{ key: 'role', header: 'Role', width: 20 },
|
|
382
|
+
{ key: 'type', header: 'Type', width: 15 },
|
|
383
|
+
{ key: 'count', header: 'Count', width: 8, align: 'right' },
|
|
384
|
+
{ key: 'purpose', header: 'Purpose', width: 30 }
|
|
385
|
+
],
|
|
386
|
+
data: agentPlan
|
|
482
387
|
});
|
|
483
|
-
|
|
388
|
+
// Confirm execution
|
|
389
|
+
if (ctx.interactive) {
|
|
390
|
+
const confirmed = await confirm({
|
|
391
|
+
message: `Deploy ${agentPlan.reduce((sum, a) => sum + a.count, 0)} agents?`,
|
|
392
|
+
default: true
|
|
393
|
+
});
|
|
394
|
+
if (!confirmed) {
|
|
395
|
+
output.printInfo('Swarm execution cancelled');
|
|
396
|
+
return { success: true };
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
output.writeln();
|
|
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
|
+
}
|
|
484
421
|
};
|
|
485
422
|
// Swarm status
|
|
486
|
-
|
|
423
|
+
const statusCommand = {
|
|
487
424
|
name: 'status',
|
|
488
425
|
description: 'Show swarm status',
|
|
489
|
-
action:
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
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));
|
|
510
|
-
output.writeln();
|
|
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
|
-
});
|
|
426
|
+
action: async (ctx) => {
|
|
427
|
+
const swarmId = ctx.args[0];
|
|
428
|
+
// Get dynamic status from actual swarm state files
|
|
429
|
+
const status = getSwarmStatus(swarmId);
|
|
430
|
+
if (ctx.flags.format === 'json') {
|
|
431
|
+
output.printJson(status);
|
|
432
|
+
return { success: true, data: status };
|
|
433
|
+
}
|
|
434
|
+
output.writeln();
|
|
435
|
+
// Show different message if no active swarm
|
|
436
|
+
if (!status.hasActiveSwarm) {
|
|
437
|
+
output.writeln(output.warning('No active swarm'));
|
|
543
438
|
output.writeln();
|
|
544
|
-
|
|
545
|
-
output.writeln(output.
|
|
546
|
-
output.
|
|
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
|
-
]);
|
|
439
|
+
output.writeln(output.dim('Start a swarm with:'));
|
|
440
|
+
output.writeln(output.dim(' npx @claude-flow/cli@latest swarm init'));
|
|
441
|
+
output.writeln(output.dim(' npx @claude-flow/cli@latest swarm start'));
|
|
552
442
|
output.writeln();
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
443
|
+
return { success: true, data: status };
|
|
444
|
+
}
|
|
445
|
+
output.writeln(output.bold(`Swarm Status: ${status.id}`));
|
|
446
|
+
output.writeln();
|
|
447
|
+
// Progress bar
|
|
448
|
+
output.writeln(`Overall Progress: ${output.progressBar(status.progress, 100, 40)}`);
|
|
449
|
+
output.writeln();
|
|
450
|
+
// Agent status
|
|
451
|
+
output.writeln(output.bold('Agents'));
|
|
452
|
+
output.printTable({
|
|
453
|
+
columns: [
|
|
454
|
+
{ key: 'status', header: 'Status', width: 12 },
|
|
455
|
+
{ key: 'count', header: 'Count', width: 10, align: 'right' }
|
|
456
|
+
],
|
|
457
|
+
data: [
|
|
458
|
+
{ status: output.success('Active'), count: status.agents.active },
|
|
459
|
+
{ status: output.warning('Idle'), count: status.agents.idle },
|
|
460
|
+
{ status: output.dim('Completed'), count: status.agents.completed },
|
|
461
|
+
{ status: 'Total', count: status.agents.total }
|
|
462
|
+
]
|
|
561
463
|
});
|
|
562
|
-
|
|
464
|
+
output.writeln();
|
|
465
|
+
// Task status
|
|
466
|
+
output.writeln(output.bold('Tasks'));
|
|
467
|
+
output.printTable({
|
|
468
|
+
columns: [
|
|
469
|
+
{ key: 'status', header: 'Status', width: 12 },
|
|
470
|
+
{ key: 'count', header: 'Count', width: 10, align: 'right' }
|
|
471
|
+
],
|
|
472
|
+
data: [
|
|
473
|
+
{ status: output.success('Completed'), count: status.tasks.completed },
|
|
474
|
+
{ status: output.info('In Progress'), count: status.tasks.inProgress },
|
|
475
|
+
{ status: output.dim('Pending'), count: status.tasks.pending },
|
|
476
|
+
{ status: 'Total', count: status.tasks.total }
|
|
477
|
+
]
|
|
478
|
+
});
|
|
479
|
+
output.writeln();
|
|
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
|
+
}
|
|
563
498
|
};
|
|
564
499
|
// Stop swarm
|
|
565
|
-
|
|
500
|
+
const stopCommand = {
|
|
566
501
|
name: 'stop',
|
|
567
502
|
description: 'Stop swarm execution',
|
|
568
503
|
options: [
|
|
@@ -571,54 +506,45 @@ var stopCommand = {
|
|
|
571
506
|
short: 'f',
|
|
572
507
|
description: 'Force immediate stop',
|
|
573
508
|
type: 'boolean',
|
|
574
|
-
|
|
509
|
+
default: false
|
|
575
510
|
},
|
|
576
511
|
{
|
|
577
512
|
name: 'save-state',
|
|
578
513
|
description: 'Save current state for resume',
|
|
579
514
|
type: 'boolean',
|
|
580
|
-
|
|
515
|
+
default: true
|
|
581
516
|
}
|
|
582
517
|
],
|
|
583
|
-
action:
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
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 } }];
|
|
518
|
+
action: async (ctx) => {
|
|
519
|
+
const swarmId = ctx.args[0];
|
|
520
|
+
const force = ctx.flags.force;
|
|
521
|
+
if (!swarmId) {
|
|
522
|
+
output.printError('Swarm ID is required');
|
|
523
|
+
return { success: false, exitCode: 1 };
|
|
524
|
+
}
|
|
525
|
+
if (ctx.interactive && !force) {
|
|
526
|
+
const confirmed = await confirm({
|
|
527
|
+
message: `Stop swarm ${swarmId}? Progress will be saved.`,
|
|
528
|
+
default: false
|
|
529
|
+
});
|
|
530
|
+
if (!confirmed) {
|
|
531
|
+
output.printInfo('Operation cancelled');
|
|
532
|
+
return { success: true };
|
|
616
533
|
}
|
|
617
|
-
}
|
|
618
|
-
|
|
534
|
+
}
|
|
535
|
+
output.printInfo(`Stopping swarm ${swarmId}...`);
|
|
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
|
+
}
|
|
619
545
|
};
|
|
620
546
|
// Scale swarm
|
|
621
|
-
|
|
547
|
+
const scaleCommand = {
|
|
622
548
|
name: 'scale',
|
|
623
549
|
description: 'Scale swarm agent count',
|
|
624
550
|
options: [
|
|
@@ -636,40 +562,38 @@ var scaleCommand = {
|
|
|
636
562
|
type: 'string'
|
|
637
563
|
}
|
|
638
564
|
],
|
|
639
|
-
action:
|
|
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
|
-
}); }
|
|
565
|
+
action: async (ctx) => {
|
|
566
|
+
const swarmId = ctx.args[0];
|
|
567
|
+
const targetAgents = ctx.flags.agents;
|
|
568
|
+
const agentType = ctx.flags.type;
|
|
569
|
+
if (!swarmId) {
|
|
570
|
+
output.printError('Swarm ID is required');
|
|
571
|
+
return { success: false, exitCode: 1 };
|
|
572
|
+
}
|
|
573
|
+
if (!targetAgents) {
|
|
574
|
+
output.printError('Target agent count required. Use --agents or -a');
|
|
575
|
+
return { success: false, exitCode: 1 };
|
|
576
|
+
}
|
|
577
|
+
output.printInfo(`Scaling swarm ${swarmId} to ${targetAgents} agents...`);
|
|
578
|
+
// Calculate scaling delta
|
|
579
|
+
const currentAgents = 8;
|
|
580
|
+
const delta = targetAgents - currentAgents;
|
|
581
|
+
if (delta > 0) {
|
|
582
|
+
output.writeln(output.dim(` Spawning ${delta} new agents...`));
|
|
583
|
+
}
|
|
584
|
+
else if (delta < 0) {
|
|
585
|
+
output.writeln(output.dim(` Gracefully stopping ${-delta} agents...`));
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
output.printInfo('Swarm already at target size');
|
|
589
|
+
return { success: true };
|
|
590
|
+
}
|
|
591
|
+
output.printSuccess(`Swarm scaled to ${targetAgents} agents`);
|
|
592
|
+
return { success: true, data: { swarmId, agents: targetAgents, delta } };
|
|
593
|
+
}
|
|
670
594
|
};
|
|
671
595
|
// Coordinate command (V3 specific)
|
|
672
|
-
|
|
596
|
+
const coordinateCommand = {
|
|
673
597
|
name: 'coordinate',
|
|
674
598
|
description: 'Execute V3 15-agent hierarchical mesh coordination',
|
|
675
599
|
options: [
|
|
@@ -677,7 +601,7 @@ var coordinateCommand = {
|
|
|
677
601
|
name: 'agents',
|
|
678
602
|
description: 'Number of agents',
|
|
679
603
|
type: 'number',
|
|
680
|
-
|
|
604
|
+
default: 15
|
|
681
605
|
},
|
|
682
606
|
{
|
|
683
607
|
name: 'domains',
|
|
@@ -685,59 +609,57 @@ var coordinateCommand = {
|
|
|
685
609
|
type: 'array'
|
|
686
610
|
}
|
|
687
611
|
],
|
|
688
|
-
action:
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
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 } }];
|
|
612
|
+
action: async (ctx) => {
|
|
613
|
+
const agentCount = ctx.flags.agents || 15;
|
|
614
|
+
output.writeln();
|
|
615
|
+
output.writeln(output.bold('V3 15-Agent Hierarchical Mesh Coordination'));
|
|
616
|
+
output.writeln();
|
|
617
|
+
// V3 agent structure
|
|
618
|
+
const v3Agents = [
|
|
619
|
+
{ id: 1, role: 'Queen Coordinator', domain: 'Orchestration', status: 'primary' },
|
|
620
|
+
{ id: 2, role: 'Security Architect', domain: 'Security', status: 'active' },
|
|
621
|
+
{ id: 3, role: 'Security Auditor', domain: 'Security', status: 'active' },
|
|
622
|
+
{ id: 4, role: 'Test Architect', domain: 'Security', status: 'active' },
|
|
623
|
+
{ id: 5, role: 'Core Architect', domain: 'Core', status: 'active' },
|
|
624
|
+
{ id: 6, role: 'Memory Specialist', domain: 'Core', status: 'active' },
|
|
625
|
+
{ id: 7, role: 'Swarm Specialist', domain: 'Core', status: 'active' },
|
|
626
|
+
{ id: 8, role: 'Integration Architect', domain: 'Integration', status: 'active' },
|
|
627
|
+
{ id: 9, role: 'Performance Engineer', domain: 'Integration', status: 'active' },
|
|
628
|
+
{ id: 10, role: 'CLI Developer', domain: 'Integration', status: 'active' },
|
|
629
|
+
{ id: 11, role: 'Hooks Developer', domain: 'Integration', status: 'active' },
|
|
630
|
+
{ id: 12, role: 'MCP Specialist', domain: 'Integration', status: 'active' },
|
|
631
|
+
{ id: 13, role: 'Project Coordinator', domain: 'Management', status: 'active' },
|
|
632
|
+
{ id: 14, role: 'Documentation Lead', domain: 'Management', status: 'standby' },
|
|
633
|
+
{ id: 15, role: 'DevOps Engineer', domain: 'Management', status: 'standby' }
|
|
634
|
+
].slice(0, agentCount);
|
|
635
|
+
output.printTable({
|
|
636
|
+
columns: [
|
|
637
|
+
{ key: 'id', header: '#', width: 3, align: 'right' },
|
|
638
|
+
{ key: 'role', header: 'Role', width: 22 },
|
|
639
|
+
{ key: 'domain', header: 'Domain', width: 15 },
|
|
640
|
+
{ key: 'status', header: 'Status', width: 10, format: (v) => {
|
|
641
|
+
if (v === 'primary')
|
|
642
|
+
return output.highlight(String(v));
|
|
643
|
+
if (v === 'active')
|
|
644
|
+
return output.success(String(v));
|
|
645
|
+
return output.dim(String(v));
|
|
646
|
+
} }
|
|
647
|
+
],
|
|
648
|
+
data: v3Agents
|
|
736
649
|
});
|
|
737
|
-
|
|
650
|
+
output.writeln();
|
|
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
|
+
}
|
|
738
660
|
};
|
|
739
661
|
// Main swarm command
|
|
740
|
-
export
|
|
662
|
+
export const swarmCommand = {
|
|
741
663
|
name: 'swarm',
|
|
742
664
|
description: 'Swarm coordination commands',
|
|
743
665
|
subcommands: [initCommand, startCommand, statusCommand, stopCommand, scaleCommand, coordinateCommand],
|
|
@@ -747,29 +669,27 @@ export var swarmCommand = {
|
|
|
747
669
|
{ command: 'claude-flow swarm start -o "Build API" -s development', description: 'Start development swarm' },
|
|
748
670
|
{ command: 'claude-flow swarm coordinate --agents 15', description: 'V3 coordination' }
|
|
749
671
|
],
|
|
750
|
-
action:
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
output.
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
});
|
|
768
|
-
}); }
|
|
672
|
+
action: async (ctx) => {
|
|
673
|
+
output.writeln();
|
|
674
|
+
output.writeln(output.bold('Swarm Coordination Commands'));
|
|
675
|
+
output.writeln();
|
|
676
|
+
output.writeln('Usage: claude-flow swarm <subcommand> [options]');
|
|
677
|
+
output.writeln();
|
|
678
|
+
output.writeln('Subcommands:');
|
|
679
|
+
output.printList([
|
|
680
|
+
`${output.highlight('init')} - Initialize a new swarm`,
|
|
681
|
+
`${output.highlight('start')} - Start swarm execution`,
|
|
682
|
+
`${output.highlight('status')} - Show swarm status`,
|
|
683
|
+
`${output.highlight('stop')} - Stop swarm execution`,
|
|
684
|
+
`${output.highlight('scale')} - Scale swarm agent count`,
|
|
685
|
+
`${output.highlight('coordinate')} - V3 15-agent coordination`
|
|
686
|
+
]);
|
|
687
|
+
return { success: true };
|
|
688
|
+
}
|
|
769
689
|
};
|
|
770
690
|
// Helper function
|
|
771
691
|
function getAgentPlan(strategy) {
|
|
772
|
-
|
|
692
|
+
const plans = {
|
|
773
693
|
specialized: [
|
|
774
694
|
{ role: 'Coordinator', type: 'coordinator', count: 1, purpose: 'Central orchestration (anti-drift)' },
|
|
775
695
|
{ role: 'Researcher', type: 'researcher', count: 1, purpose: 'Requirements analysis' },
|