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
|
@@ -1,7 +1,43 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* V3 CLI Session Command
|
|
3
|
-
* Session management for
|
|
3
|
+
* Session management for Claude Flow
|
|
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 { confirm, input, select } from '../prompt.js';
|
|
7
43
|
import { callMCPTool, MCPClientError } from '../mcp-client.js';
|
|
@@ -9,17 +45,17 @@ import * as fs from 'fs';
|
|
|
9
45
|
import * as path from 'path';
|
|
10
46
|
// Format date for display
|
|
11
47
|
function formatDate(dateStr) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
48
|
+
var date = new Date(dateStr);
|
|
49
|
+
var now = new Date();
|
|
50
|
+
var diff = now.getTime() - date.getTime();
|
|
15
51
|
// Less than 24 hours - show relative time
|
|
16
52
|
if (diff < 24 * 60 * 60 * 1000) {
|
|
17
|
-
|
|
18
|
-
|
|
53
|
+
var hours = Math.floor(diff / (60 * 60 * 1000));
|
|
54
|
+
var minutes = Math.floor((diff % (60 * 60 * 1000)) / (60 * 1000));
|
|
19
55
|
if (hours > 0) {
|
|
20
|
-
return
|
|
56
|
+
return hours + "h " + minutes + "m ago";
|
|
21
57
|
}
|
|
22
|
-
return
|
|
58
|
+
return minutes + "m ago";
|
|
23
59
|
}
|
|
24
60
|
// Otherwise show date
|
|
25
61
|
return date.toLocaleDateString() + ' ' + date.toLocaleTimeString();
|
|
@@ -38,7 +74,7 @@ function formatStatus(status) {
|
|
|
38
74
|
}
|
|
39
75
|
}
|
|
40
76
|
// List subcommand
|
|
41
|
-
|
|
77
|
+
var listCommand = {
|
|
42
78
|
name: 'list',
|
|
43
79
|
aliases: ['ls'],
|
|
44
80
|
description: 'List all sessions',
|
|
@@ -48,78 +84,88 @@ const listCommand = {
|
|
|
48
84
|
short: 'a',
|
|
49
85
|
description: 'Show only active sessions',
|
|
50
86
|
type: 'boolean',
|
|
51
|
-
default: false
|
|
87
|
+
"default": false
|
|
52
88
|
},
|
|
53
89
|
{
|
|
54
90
|
name: 'all',
|
|
55
91
|
description: 'Include archived sessions',
|
|
56
92
|
type: 'boolean',
|
|
57
|
-
default: false
|
|
93
|
+
"default": false
|
|
58
94
|
},
|
|
59
95
|
{
|
|
60
96
|
name: 'limit',
|
|
61
97
|
short: 'l',
|
|
62
98
|
description: 'Maximum sessions to show',
|
|
63
99
|
type: 'number',
|
|
64
|
-
default: 20
|
|
100
|
+
"default": 20
|
|
65
101
|
}
|
|
66
102
|
],
|
|
67
|
-
action:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
103
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
104
|
+
var activeOnly, includeArchived, limit, result, error_1;
|
|
105
|
+
return __generator(this, function (_a) {
|
|
106
|
+
switch (_a.label) {
|
|
107
|
+
case 0:
|
|
108
|
+
activeOnly = ctx.flags.active;
|
|
109
|
+
includeArchived = ctx.flags.all;
|
|
110
|
+
limit = ctx.flags.limit;
|
|
111
|
+
_a.label = 1;
|
|
112
|
+
case 1:
|
|
113
|
+
_a.trys.push([1, 3, , 4]);
|
|
114
|
+
return [4 /*yield*/, callMCPTool('session_list', {
|
|
115
|
+
status: activeOnly ? 'active' : includeArchived ? 'all' : 'active,saved',
|
|
116
|
+
limit: limit
|
|
117
|
+
})];
|
|
118
|
+
case 2:
|
|
119
|
+
result = _a.sent();
|
|
120
|
+
if (ctx.flags.format === 'json') {
|
|
121
|
+
output.printJson(result);
|
|
122
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
123
|
+
}
|
|
124
|
+
output.writeln();
|
|
125
|
+
output.writeln(output.bold('Sessions'));
|
|
126
|
+
output.writeln();
|
|
127
|
+
if (result.sessions.length === 0) {
|
|
128
|
+
output.printInfo('No sessions found');
|
|
129
|
+
output.printInfo('Run "claude-flow session save" to create a session');
|
|
130
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
131
|
+
}
|
|
132
|
+
output.printTable({
|
|
133
|
+
columns: [
|
|
134
|
+
{ key: 'id', header: 'ID', width: 20 },
|
|
135
|
+
{ key: 'name', header: 'Name', width: 20 },
|
|
136
|
+
{ key: 'status', header: 'Status', width: 10 },
|
|
137
|
+
{ key: 'agents', header: 'Agents', width: 8, align: 'right' },
|
|
138
|
+
{ key: 'tasks', header: 'Tasks', width: 8, align: 'right' },
|
|
139
|
+
{ key: 'updated', header: 'Last Updated', width: 18 }
|
|
140
|
+
],
|
|
141
|
+
data: result.sessions.map(function (s) { return ({
|
|
142
|
+
id: s.id,
|
|
143
|
+
name: s.name || '-',
|
|
144
|
+
status: formatStatus(s.status),
|
|
145
|
+
agents: s.agentCount,
|
|
146
|
+
tasks: s.taskCount,
|
|
147
|
+
updated: formatDate(s.updatedAt)
|
|
148
|
+
}); })
|
|
149
|
+
});
|
|
150
|
+
output.writeln();
|
|
151
|
+
output.printInfo("Showing " + result.sessions.length + " of " + result.total + " sessions");
|
|
152
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
153
|
+
case 3:
|
|
154
|
+
error_1 = _a.sent();
|
|
155
|
+
if (error_1 instanceof MCPClientError) {
|
|
156
|
+
output.printError("Failed to list sessions: " + error_1.message);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
output.printError("Unexpected error: " + String(error_1));
|
|
160
|
+
}
|
|
161
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
162
|
+
case 4: return [2 /*return*/];
|
|
116
163
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
164
|
+
});
|
|
165
|
+
}); }
|
|
120
166
|
};
|
|
121
167
|
// Save subcommand
|
|
122
|
-
|
|
168
|
+
var saveCommand = {
|
|
123
169
|
name: 'save',
|
|
124
170
|
aliases: ['create', 'checkpoint'],
|
|
125
171
|
description: 'Save current session state',
|
|
@@ -140,88 +186,103 @@ const saveCommand = {
|
|
|
140
186
|
name: 'include-memory',
|
|
141
187
|
description: 'Include memory state in session',
|
|
142
188
|
type: 'boolean',
|
|
143
|
-
default: true
|
|
189
|
+
"default": true
|
|
144
190
|
},
|
|
145
191
|
{
|
|
146
192
|
name: 'include-agents',
|
|
147
193
|
description: 'Include agent state in session',
|
|
148
194
|
type: 'boolean',
|
|
149
|
-
default: true
|
|
195
|
+
"default": true
|
|
150
196
|
},
|
|
151
197
|
{
|
|
152
198
|
name: 'include-tasks',
|
|
153
199
|
description: 'Include task state in session',
|
|
154
200
|
type: 'boolean',
|
|
155
|
-
default: true
|
|
201
|
+
"default": true
|
|
156
202
|
}
|
|
157
203
|
],
|
|
158
|
-
action:
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
{
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
204
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
205
|
+
var sessionName, description, spinner, result, error_2;
|
|
206
|
+
return __generator(this, function (_a) {
|
|
207
|
+
switch (_a.label) {
|
|
208
|
+
case 0:
|
|
209
|
+
sessionName = ctx.flags.name;
|
|
210
|
+
description = ctx.flags.description;
|
|
211
|
+
if (!(!sessionName && ctx.interactive)) return [3 /*break*/, 2];
|
|
212
|
+
return [4 /*yield*/, input({
|
|
213
|
+
message: 'Session name:',
|
|
214
|
+
"default": "session-" + Date.now().toString(36),
|
|
215
|
+
validate: function (v) { return v.length > 0 || 'Name is required'; }
|
|
216
|
+
})];
|
|
217
|
+
case 1:
|
|
218
|
+
sessionName = _a.sent();
|
|
219
|
+
_a.label = 2;
|
|
220
|
+
case 2:
|
|
221
|
+
if (!(!description && ctx.interactive)) return [3 /*break*/, 4];
|
|
222
|
+
return [4 /*yield*/, input({
|
|
223
|
+
message: 'Session description (optional):',
|
|
224
|
+
"default": ''
|
|
225
|
+
})];
|
|
226
|
+
case 3:
|
|
227
|
+
description = _a.sent();
|
|
228
|
+
_a.label = 4;
|
|
229
|
+
case 4:
|
|
230
|
+
spinner = output.createSpinner({ text: 'Saving session...' });
|
|
231
|
+
spinner.start();
|
|
232
|
+
_a.label = 5;
|
|
233
|
+
case 5:
|
|
234
|
+
_a.trys.push([5, 7, , 8]);
|
|
235
|
+
return [4 /*yield*/, callMCPTool('session_save', {
|
|
236
|
+
name: sessionName,
|
|
237
|
+
description: description,
|
|
238
|
+
includeMemory: ctx.flags['include-memory'] !== false,
|
|
239
|
+
includeAgents: ctx.flags['include-agents'] !== false,
|
|
240
|
+
includeTasks: ctx.flags['include-tasks'] !== false
|
|
241
|
+
})];
|
|
242
|
+
case 6:
|
|
243
|
+
result = _a.sent();
|
|
244
|
+
spinner.succeed('Session saved');
|
|
245
|
+
output.writeln();
|
|
246
|
+
output.printTable({
|
|
247
|
+
columns: [
|
|
248
|
+
{ key: 'property', header: 'Property', width: 18 },
|
|
249
|
+
{ key: 'value', header: 'Value', width: 35 }
|
|
250
|
+
],
|
|
251
|
+
data: [
|
|
252
|
+
{ property: 'Session ID', value: result.sessionId },
|
|
253
|
+
{ property: 'Name', value: result.name },
|
|
254
|
+
{ property: 'Description', value: result.description || '-' },
|
|
255
|
+
{ property: 'Saved At', value: new Date(result.savedAt).toLocaleString() },
|
|
256
|
+
{ property: 'Agents', value: result.stats.agentCount },
|
|
257
|
+
{ property: 'Tasks', value: result.stats.taskCount },
|
|
258
|
+
{ property: 'Memory Entries', value: result.stats.memoryEntries },
|
|
259
|
+
{ property: 'Total Size', value: formatSize(result.stats.totalSize) }
|
|
260
|
+
]
|
|
261
|
+
});
|
|
262
|
+
output.writeln();
|
|
263
|
+
output.printSuccess("Session saved: " + result.sessionId);
|
|
264
|
+
output.printInfo("Restore with: claude-flow session restore " + result.sessionId);
|
|
265
|
+
if (ctx.flags.format === 'json') {
|
|
266
|
+
output.printJson(result);
|
|
267
|
+
}
|
|
268
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
269
|
+
case 7:
|
|
270
|
+
error_2 = _a.sent();
|
|
271
|
+
spinner.fail('Failed to save session');
|
|
272
|
+
if (error_2 instanceof MCPClientError) {
|
|
273
|
+
output.printError("Error: " + error_2.message);
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
output.printError("Unexpected error: " + String(error_2));
|
|
277
|
+
}
|
|
278
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
279
|
+
case 8: return [2 /*return*/];
|
|
218
280
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
281
|
+
});
|
|
282
|
+
}); }
|
|
222
283
|
};
|
|
223
284
|
// Restore subcommand
|
|
224
|
-
|
|
285
|
+
var restoreCommand = {
|
|
225
286
|
name: 'restore',
|
|
226
287
|
aliases: ['load'],
|
|
227
288
|
description: 'Restore a saved session',
|
|
@@ -231,130 +292,146 @@ const restoreCommand = {
|
|
|
231
292
|
short: 'f',
|
|
232
293
|
description: 'Overwrite current state without confirmation',
|
|
233
294
|
type: 'boolean',
|
|
234
|
-
default: false
|
|
295
|
+
"default": false
|
|
235
296
|
},
|
|
236
297
|
{
|
|
237
298
|
name: 'memory-only',
|
|
238
299
|
description: 'Only restore memory state',
|
|
239
300
|
type: 'boolean',
|
|
240
|
-
default: false
|
|
301
|
+
"default": false
|
|
241
302
|
},
|
|
242
303
|
{
|
|
243
304
|
name: 'agents-only',
|
|
244
305
|
description: 'Only restore agent state',
|
|
245
306
|
type: 'boolean',
|
|
246
|
-
default: false
|
|
307
|
+
"default": false
|
|
247
308
|
},
|
|
248
309
|
{
|
|
249
310
|
name: 'tasks-only',
|
|
250
311
|
description: 'Only restore task state',
|
|
251
312
|
type: 'boolean',
|
|
252
|
-
default: false
|
|
313
|
+
"default": false
|
|
253
314
|
}
|
|
254
315
|
],
|
|
255
|
-
action:
|
|
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
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
316
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
317
|
+
var sessionId, force, sessions, error_3, confirmed, spinner, restoreMemory, restoreAgents, restoreTasks, result, error_4;
|
|
318
|
+
return __generator(this, function (_a) {
|
|
319
|
+
switch (_a.label) {
|
|
320
|
+
case 0:
|
|
321
|
+
sessionId = ctx.args[0];
|
|
322
|
+
force = ctx.flags.force;
|
|
323
|
+
if (!(!sessionId && ctx.interactive)) return [3 /*break*/, 5];
|
|
324
|
+
_a.label = 1;
|
|
325
|
+
case 1:
|
|
326
|
+
_a.trys.push([1, 4, , 5]);
|
|
327
|
+
return [4 /*yield*/, callMCPTool('session_list', { status: 'saved', limit: 20 })];
|
|
328
|
+
case 2:
|
|
329
|
+
sessions = _a.sent();
|
|
330
|
+
if (sessions.sessions.length === 0) {
|
|
331
|
+
output.printWarning('No saved sessions found');
|
|
332
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
333
|
+
}
|
|
334
|
+
return [4 /*yield*/, select({
|
|
335
|
+
message: 'Select session to restore:',
|
|
336
|
+
options: sessions.sessions.map(function (s) { return ({
|
|
337
|
+
value: s.id,
|
|
338
|
+
label: s.name || s.id,
|
|
339
|
+
hint: formatDate(s.updatedAt)
|
|
340
|
+
}); })
|
|
341
|
+
})];
|
|
342
|
+
case 3:
|
|
343
|
+
sessionId = _a.sent();
|
|
344
|
+
return [3 /*break*/, 5];
|
|
345
|
+
case 4:
|
|
346
|
+
error_3 = _a.sent();
|
|
347
|
+
if (error_3 instanceof Error && error_3.message === 'User cancelled') {
|
|
348
|
+
output.printInfo('Operation cancelled');
|
|
349
|
+
return [2 /*return*/, { success: true }];
|
|
350
|
+
}
|
|
351
|
+
throw error_3;
|
|
352
|
+
case 5:
|
|
353
|
+
if (!sessionId) {
|
|
354
|
+
output.printError('Session ID is required');
|
|
355
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
356
|
+
}
|
|
357
|
+
if (!(!force && ctx.interactive)) return [3 /*break*/, 7];
|
|
358
|
+
return [4 /*yield*/, confirm({
|
|
359
|
+
message: 'This will overwrite current state. Continue?',
|
|
360
|
+
"default": false
|
|
361
|
+
})];
|
|
362
|
+
case 6:
|
|
363
|
+
confirmed = _a.sent();
|
|
364
|
+
if (!confirmed) {
|
|
365
|
+
output.printInfo('Operation cancelled');
|
|
366
|
+
return [2 /*return*/, { success: true }];
|
|
367
|
+
}
|
|
368
|
+
_a.label = 7;
|
|
369
|
+
case 7:
|
|
370
|
+
spinner = output.createSpinner({ text: 'Restoring session...' });
|
|
371
|
+
spinner.start();
|
|
372
|
+
_a.label = 8;
|
|
373
|
+
case 8:
|
|
374
|
+
_a.trys.push([8, 10, , 11]);
|
|
375
|
+
restoreMemory = !ctx.flags['agents-only'] && !ctx.flags['tasks-only'];
|
|
376
|
+
restoreAgents = !ctx.flags['memory-only'] && !ctx.flags['tasks-only'];
|
|
377
|
+
restoreTasks = !ctx.flags['memory-only'] && !ctx.flags['agents-only'];
|
|
378
|
+
return [4 /*yield*/, callMCPTool('session_restore', {
|
|
379
|
+
sessionId: sessionId,
|
|
380
|
+
restoreMemory: restoreMemory,
|
|
381
|
+
restoreAgents: restoreAgents,
|
|
382
|
+
restoreTasks: restoreTasks
|
|
383
|
+
})];
|
|
384
|
+
case 9:
|
|
385
|
+
result = _a.sent();
|
|
386
|
+
spinner.succeed('Session restored');
|
|
387
|
+
output.writeln();
|
|
388
|
+
output.printTable({
|
|
389
|
+
columns: [
|
|
390
|
+
{ key: 'component', header: 'Component', width: 20 },
|
|
391
|
+
{ key: 'status', header: 'Status', width: 15 },
|
|
392
|
+
{ key: 'count', header: 'Items', width: 10, align: 'right' }
|
|
393
|
+
],
|
|
394
|
+
data: [
|
|
395
|
+
{
|
|
396
|
+
component: 'Memory',
|
|
397
|
+
status: result.restored.memory ? output.success('Restored') : output.dim('Skipped'),
|
|
398
|
+
count: result.stats.memoryEntriesRestored
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
component: 'Agents',
|
|
402
|
+
status: result.restored.agents ? output.success('Restored') : output.dim('Skipped'),
|
|
403
|
+
count: result.stats.agentsRestored
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
component: 'Tasks',
|
|
407
|
+
status: result.restored.tasks ? output.success('Restored') : output.dim('Skipped'),
|
|
408
|
+
count: result.stats.tasksRestored
|
|
409
|
+
}
|
|
410
|
+
]
|
|
411
|
+
});
|
|
412
|
+
output.writeln();
|
|
413
|
+
output.printSuccess("Session " + sessionId + " restored successfully");
|
|
414
|
+
if (ctx.flags.format === 'json') {
|
|
415
|
+
output.printJson(result);
|
|
416
|
+
}
|
|
417
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
418
|
+
case 10:
|
|
419
|
+
error_4 = _a.sent();
|
|
420
|
+
spinner.fail('Failed to restore session');
|
|
421
|
+
if (error_4 instanceof MCPClientError) {
|
|
422
|
+
output.printError("Error: " + error_4.message);
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
output.printError("Unexpected error: " + String(error_4));
|
|
426
|
+
}
|
|
427
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
428
|
+
case 11: return [2 /*return*/];
|
|
351
429
|
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}
|
|
430
|
+
});
|
|
431
|
+
}); }
|
|
355
432
|
};
|
|
356
433
|
// Delete subcommand
|
|
357
|
-
|
|
434
|
+
var deleteCommand = {
|
|
358
435
|
name: 'delete',
|
|
359
436
|
aliases: ['rm', 'remove'],
|
|
360
437
|
description: 'Delete a saved session',
|
|
@@ -364,48 +441,59 @@ const deleteCommand = {
|
|
|
364
441
|
short: 'f',
|
|
365
442
|
description: 'Delete without confirmation',
|
|
366
443
|
type: 'boolean',
|
|
367
|
-
default: false
|
|
444
|
+
"default": false
|
|
368
445
|
}
|
|
369
446
|
],
|
|
370
|
-
action:
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
447
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
448
|
+
var sessionId, force, confirmed, result, error_5;
|
|
449
|
+
return __generator(this, function (_a) {
|
|
450
|
+
switch (_a.label) {
|
|
451
|
+
case 0:
|
|
452
|
+
sessionId = ctx.args[0];
|
|
453
|
+
force = ctx.flags.force;
|
|
454
|
+
if (!sessionId) {
|
|
455
|
+
output.printError('Session ID is required');
|
|
456
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
457
|
+
}
|
|
458
|
+
if (!(!force && ctx.interactive)) return [3 /*break*/, 2];
|
|
459
|
+
return [4 /*yield*/, confirm({
|
|
460
|
+
message: "Delete session " + sessionId + "? This cannot be undone.",
|
|
461
|
+
"default": false
|
|
462
|
+
})];
|
|
463
|
+
case 1:
|
|
464
|
+
confirmed = _a.sent();
|
|
465
|
+
if (!confirmed) {
|
|
466
|
+
output.printInfo('Operation cancelled');
|
|
467
|
+
return [2 /*return*/, { success: true }];
|
|
468
|
+
}
|
|
469
|
+
_a.label = 2;
|
|
470
|
+
case 2:
|
|
471
|
+
_a.trys.push([2, 4, , 5]);
|
|
472
|
+
return [4 /*yield*/, callMCPTool('session_delete', { sessionId: sessionId })];
|
|
473
|
+
case 3:
|
|
474
|
+
result = _a.sent();
|
|
475
|
+
output.writeln();
|
|
476
|
+
output.printSuccess("Session " + sessionId + " deleted");
|
|
477
|
+
if (ctx.flags.format === 'json') {
|
|
478
|
+
output.printJson(result);
|
|
479
|
+
}
|
|
480
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
481
|
+
case 4:
|
|
482
|
+
error_5 = _a.sent();
|
|
483
|
+
if (error_5 instanceof MCPClientError) {
|
|
484
|
+
output.printError("Failed to delete session: " + error_5.message);
|
|
485
|
+
}
|
|
486
|
+
else {
|
|
487
|
+
output.printError("Unexpected error: " + String(error_5));
|
|
488
|
+
}
|
|
489
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
490
|
+
case 5: return [2 /*return*/];
|
|
402
491
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
}
|
|
492
|
+
});
|
|
493
|
+
}); }
|
|
406
494
|
};
|
|
407
495
|
// Export subcommand
|
|
408
|
-
|
|
496
|
+
var exportCommand = {
|
|
409
497
|
name: 'export',
|
|
410
498
|
description: 'Export session to file',
|
|
411
499
|
options: [
|
|
@@ -421,100 +509,111 @@ const exportCommand = {
|
|
|
421
509
|
description: 'Export format (json, yaml)',
|
|
422
510
|
type: 'string',
|
|
423
511
|
choices: ['json', 'yaml'],
|
|
424
|
-
default: 'json'
|
|
512
|
+
"default": 'json'
|
|
425
513
|
},
|
|
426
514
|
{
|
|
427
515
|
name: 'include-memory',
|
|
428
516
|
description: 'Include memory data',
|
|
429
517
|
type: 'boolean',
|
|
430
|
-
default: true
|
|
518
|
+
"default": true
|
|
431
519
|
},
|
|
432
520
|
{
|
|
433
521
|
name: 'compress',
|
|
434
522
|
description: 'Compress output',
|
|
435
523
|
type: 'boolean',
|
|
436
|
-
default: false
|
|
524
|
+
"default": false
|
|
437
525
|
}
|
|
438
526
|
],
|
|
439
|
-
action:
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
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
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
{
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
527
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
528
|
+
var sessionId, outputPath, exportFormat, compress, current, _a, ext, spinner, result, content, absolutePath, error_6;
|
|
529
|
+
return __generator(this, function (_b) {
|
|
530
|
+
switch (_b.label) {
|
|
531
|
+
case 0:
|
|
532
|
+
sessionId = ctx.args[0];
|
|
533
|
+
outputPath = ctx.flags.output;
|
|
534
|
+
exportFormat = ctx.flags.format;
|
|
535
|
+
compress = ctx.flags.compress;
|
|
536
|
+
if (!!sessionId) return [3 /*break*/, 4];
|
|
537
|
+
_b.label = 1;
|
|
538
|
+
case 1:
|
|
539
|
+
_b.trys.push([1, 3, , 4]);
|
|
540
|
+
return [4 /*yield*/, callMCPTool('session_current', {})];
|
|
541
|
+
case 2:
|
|
542
|
+
current = _b.sent();
|
|
543
|
+
sessionId = current.sessionId;
|
|
544
|
+
return [3 /*break*/, 4];
|
|
545
|
+
case 3:
|
|
546
|
+
_a = _b.sent();
|
|
547
|
+
output.printError('No active session. Provide a session ID to export.');
|
|
548
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
549
|
+
case 4:
|
|
550
|
+
// Generate output path if not provided
|
|
551
|
+
if (!outputPath) {
|
|
552
|
+
ext = compress ? '.gz' : '';
|
|
553
|
+
outputPath = "session-" + sessionId + "." + exportFormat + ext;
|
|
554
|
+
}
|
|
555
|
+
spinner = output.createSpinner({ text: 'Exporting session...' });
|
|
556
|
+
spinner.start();
|
|
557
|
+
_b.label = 5;
|
|
558
|
+
case 5:
|
|
559
|
+
_b.trys.push([5, 7, , 8]);
|
|
560
|
+
return [4 /*yield*/, callMCPTool('session_export', {
|
|
561
|
+
sessionId: sessionId,
|
|
562
|
+
includeMemory: ctx.flags['include-memory'] !== false
|
|
563
|
+
})];
|
|
564
|
+
case 6:
|
|
565
|
+
result = _b.sent();
|
|
566
|
+
content = void 0;
|
|
567
|
+
if (exportFormat === 'yaml') {
|
|
568
|
+
content = toSimpleYaml(result.data);
|
|
569
|
+
}
|
|
570
|
+
else {
|
|
571
|
+
content = JSON.stringify(result.data, null, 2);
|
|
572
|
+
}
|
|
573
|
+
absolutePath = path.isAbsolute(outputPath)
|
|
574
|
+
? outputPath
|
|
575
|
+
: path.join(ctx.cwd, outputPath);
|
|
576
|
+
fs.writeFileSync(absolutePath, content, 'utf-8');
|
|
577
|
+
spinner.succeed('Session exported');
|
|
578
|
+
output.writeln();
|
|
579
|
+
output.printTable({
|
|
580
|
+
columns: [
|
|
581
|
+
{ key: 'property', header: 'Property', width: 18 },
|
|
582
|
+
{ key: 'value', header: 'Value', width: 40 }
|
|
583
|
+
],
|
|
584
|
+
data: [
|
|
585
|
+
{ property: 'Session ID', value: sessionId },
|
|
586
|
+
{ property: 'Output File', value: absolutePath },
|
|
587
|
+
{ property: 'Format', value: exportFormat.toUpperCase() },
|
|
588
|
+
{ property: 'Agents', value: result.stats.agentCount },
|
|
589
|
+
{ property: 'Tasks', value: result.stats.taskCount },
|
|
590
|
+
{ property: 'Memory Entries', value: result.stats.memoryEntries },
|
|
591
|
+
{ property: 'File Size', value: formatSize(content.length) }
|
|
592
|
+
]
|
|
593
|
+
});
|
|
594
|
+
output.writeln();
|
|
595
|
+
output.printSuccess("Session exported to " + outputPath);
|
|
596
|
+
return [2 /*return*/, {
|
|
597
|
+
success: true,
|
|
598
|
+
data: { sessionId: sessionId, outputPath: outputPath, format: exportFormat, size: content.length }
|
|
599
|
+
}];
|
|
600
|
+
case 7:
|
|
601
|
+
error_6 = _b.sent();
|
|
602
|
+
spinner.fail('Failed to export session');
|
|
603
|
+
if (error_6 instanceof MCPClientError) {
|
|
604
|
+
output.printError("Error: " + error_6.message);
|
|
605
|
+
}
|
|
606
|
+
else {
|
|
607
|
+
output.printError("Unexpected error: " + String(error_6));
|
|
608
|
+
}
|
|
609
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
610
|
+
case 8: return [2 /*return*/];
|
|
511
611
|
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
}
|
|
612
|
+
});
|
|
613
|
+
}); }
|
|
515
614
|
};
|
|
516
615
|
// Import subcommand
|
|
517
|
-
|
|
616
|
+
var importCommand = {
|
|
518
617
|
name: 'import',
|
|
519
618
|
description: 'Import session from file',
|
|
520
619
|
options: [
|
|
@@ -528,149 +627,168 @@ const importCommand = {
|
|
|
528
627
|
name: 'activate',
|
|
529
628
|
description: 'Activate session after import',
|
|
530
629
|
type: 'boolean',
|
|
531
|
-
default: false
|
|
630
|
+
"default": false
|
|
532
631
|
}
|
|
533
632
|
],
|
|
534
|
-
action:
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
633
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
634
|
+
var filePath, sessionName, activate, absolutePath, spinner, content, data, result, error_7;
|
|
635
|
+
return __generator(this, function (_a) {
|
|
636
|
+
switch (_a.label) {
|
|
637
|
+
case 0:
|
|
638
|
+
filePath = ctx.args[0];
|
|
639
|
+
sessionName = ctx.flags.name;
|
|
640
|
+
activate = ctx.flags.activate;
|
|
641
|
+
if (!filePath) {
|
|
642
|
+
output.printError('File path is required');
|
|
643
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
644
|
+
}
|
|
645
|
+
absolutePath = path.isAbsolute(filePath)
|
|
646
|
+
? filePath
|
|
647
|
+
: path.join(ctx.cwd, filePath);
|
|
648
|
+
if (!fs.existsSync(absolutePath)) {
|
|
649
|
+
output.printError("File not found: " + absolutePath);
|
|
650
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
651
|
+
}
|
|
652
|
+
spinner = output.createSpinner({ text: 'Importing session...' });
|
|
653
|
+
spinner.start();
|
|
654
|
+
_a.label = 1;
|
|
655
|
+
case 1:
|
|
656
|
+
_a.trys.push([1, 3, , 4]);
|
|
657
|
+
content = fs.readFileSync(absolutePath, 'utf-8');
|
|
658
|
+
data = void 0;
|
|
659
|
+
// Parse based on extension
|
|
660
|
+
if (absolutePath.endsWith('.yaml') || absolutePath.endsWith('.yml')) {
|
|
661
|
+
// Simple YAML parsing (basic implementation)
|
|
662
|
+
data = JSON.parse(content); // Would need proper YAML parser
|
|
663
|
+
}
|
|
664
|
+
else {
|
|
665
|
+
data = JSON.parse(content);
|
|
666
|
+
}
|
|
667
|
+
return [4 /*yield*/, callMCPTool('session_import', {
|
|
668
|
+
data: data,
|
|
669
|
+
name: sessionName,
|
|
670
|
+
activate: activate
|
|
671
|
+
})];
|
|
672
|
+
case 2:
|
|
673
|
+
result = _a.sent();
|
|
674
|
+
spinner.succeed('Session imported');
|
|
675
|
+
output.writeln();
|
|
676
|
+
output.printTable({
|
|
677
|
+
columns: [
|
|
678
|
+
{ key: 'property', header: 'Property', width: 20 },
|
|
679
|
+
{ key: 'value', header: 'Value', width: 35 }
|
|
680
|
+
],
|
|
681
|
+
data: [
|
|
682
|
+
{ property: 'Session ID', value: result.sessionId },
|
|
683
|
+
{ property: 'Name', value: result.name },
|
|
684
|
+
{ property: 'Source File', value: path.basename(absolutePath) },
|
|
685
|
+
{ property: 'Agents Imported', value: result.stats.agentsImported },
|
|
686
|
+
{ property: 'Tasks Imported', value: result.stats.tasksImported },
|
|
687
|
+
{ property: 'Memory Entries', value: result.stats.memoryEntriesImported },
|
|
688
|
+
{ property: 'Activated', value: result.activated ? 'Yes' : 'No' }
|
|
689
|
+
]
|
|
690
|
+
});
|
|
691
|
+
output.writeln();
|
|
692
|
+
output.printSuccess("Session imported: " + result.sessionId);
|
|
693
|
+
if (!result.activated) {
|
|
694
|
+
output.printInfo("Restore with: claude-flow session restore " + result.sessionId);
|
|
695
|
+
}
|
|
696
|
+
if (ctx.flags.format === 'json') {
|
|
697
|
+
output.printJson(result);
|
|
698
|
+
}
|
|
699
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
700
|
+
case 3:
|
|
701
|
+
error_7 = _a.sent();
|
|
702
|
+
spinner.fail('Failed to import session');
|
|
703
|
+
if (error_7 instanceof MCPClientError) {
|
|
704
|
+
output.printError("Error: " + error_7.message);
|
|
705
|
+
}
|
|
706
|
+
else if (error_7 instanceof SyntaxError) {
|
|
707
|
+
output.printError('Invalid file format. Expected JSON or YAML.');
|
|
708
|
+
}
|
|
709
|
+
else {
|
|
710
|
+
output.printError("Unexpected error: " + String(error_7));
|
|
711
|
+
}
|
|
712
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
713
|
+
case 4: return [2 /*return*/];
|
|
604
714
|
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
}
|
|
715
|
+
});
|
|
716
|
+
}); }
|
|
608
717
|
};
|
|
609
718
|
// Current subcommand
|
|
610
|
-
|
|
719
|
+
var currentCommand = {
|
|
611
720
|
name: 'current',
|
|
612
721
|
description: 'Show current active session',
|
|
613
|
-
action:
|
|
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
|
-
|
|
722
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
723
|
+
var result, error_8;
|
|
724
|
+
return __generator(this, function (_a) {
|
|
725
|
+
switch (_a.label) {
|
|
726
|
+
case 0:
|
|
727
|
+
_a.trys.push([0, 2, , 3]);
|
|
728
|
+
return [4 /*yield*/, callMCPTool('session_current', { includeStats: true })];
|
|
729
|
+
case 1:
|
|
730
|
+
result = _a.sent();
|
|
731
|
+
if (ctx.flags.format === 'json') {
|
|
732
|
+
output.printJson(result);
|
|
733
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
734
|
+
}
|
|
735
|
+
output.writeln();
|
|
736
|
+
output.writeln(output.bold('Current Session'));
|
|
737
|
+
output.writeln();
|
|
738
|
+
output.printTable({
|
|
739
|
+
columns: [
|
|
740
|
+
{ key: 'property', header: 'Property', width: 18 },
|
|
741
|
+
{ key: 'value', header: 'Value', width: 35 }
|
|
742
|
+
],
|
|
743
|
+
data: [
|
|
744
|
+
{ property: 'Session ID', value: result.sessionId },
|
|
745
|
+
{ property: 'Name', value: result.name || '-' },
|
|
746
|
+
{ property: 'Status', value: formatStatus(result.status) },
|
|
747
|
+
{ property: 'Started', value: new Date(result.startedAt).toLocaleString() },
|
|
748
|
+
{ property: 'Duration', value: formatDuration(result.stats.duration) },
|
|
749
|
+
{ property: 'Agents', value: result.stats.agentCount },
|
|
750
|
+
{ property: 'Tasks', value: result.stats.taskCount },
|
|
751
|
+
{ property: 'Memory Entries', value: result.stats.memoryEntries }
|
|
752
|
+
]
|
|
753
|
+
});
|
|
754
|
+
return [2 /*return*/, { success: true, data: result }];
|
|
755
|
+
case 2:
|
|
756
|
+
error_8 = _a.sent();
|
|
757
|
+
if (error_8 instanceof MCPClientError) {
|
|
758
|
+
output.printWarning('No active session');
|
|
759
|
+
output.printInfo('Start a session with "claude-flow start"');
|
|
760
|
+
return [2 /*return*/, { success: true, data: { active: false } }];
|
|
761
|
+
}
|
|
762
|
+
output.printError("Unexpected error: " + String(error_8));
|
|
763
|
+
return [2 /*return*/, { success: false, exitCode: 1 }];
|
|
764
|
+
case 3: return [2 /*return*/];
|
|
646
765
|
}
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
}
|
|
650
|
-
}
|
|
766
|
+
});
|
|
767
|
+
}); }
|
|
651
768
|
};
|
|
652
769
|
// Helper functions
|
|
653
770
|
function formatSize(bytes) {
|
|
654
771
|
if (bytes === 0)
|
|
655
772
|
return '0 B';
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
return
|
|
773
|
+
var k = 1024;
|
|
774
|
+
var sizes = ['B', 'KB', 'MB', 'GB'];
|
|
775
|
+
var i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
776
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + " " + sizes[i];
|
|
660
777
|
}
|
|
661
778
|
function formatDuration(ms) {
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
779
|
+
var seconds = Math.floor(ms / 1000);
|
|
780
|
+
var minutes = Math.floor(seconds / 60);
|
|
781
|
+
var hours = Math.floor(minutes / 60);
|
|
665
782
|
if (hours > 0) {
|
|
666
|
-
return
|
|
783
|
+
return hours + "h " + minutes % 60 + "m";
|
|
667
784
|
}
|
|
668
785
|
else if (minutes > 0) {
|
|
669
|
-
return
|
|
786
|
+
return minutes + "m " + seconds % 60 + "s";
|
|
670
787
|
}
|
|
671
|
-
return
|
|
788
|
+
return seconds + "s";
|
|
672
789
|
}
|
|
673
|
-
function toSimpleYaml(obj, indent
|
|
790
|
+
function toSimpleYaml(obj, indent) {
|
|
791
|
+
if (indent === void 0) { indent = 0; }
|
|
674
792
|
// Simple YAML serializer (for basic types)
|
|
675
793
|
if (obj === null)
|
|
676
794
|
return 'null';
|
|
@@ -679,22 +797,24 @@ function toSimpleYaml(obj, indent = 0) {
|
|
|
679
797
|
if (typeof obj === 'number')
|
|
680
798
|
return String(obj);
|
|
681
799
|
if (typeof obj === 'string')
|
|
682
|
-
return obj.includes(':') ?
|
|
683
|
-
|
|
684
|
-
|
|
800
|
+
return obj.includes(':') ? "\"" + obj + "\"" : obj;
|
|
801
|
+
var spaces = ' '.repeat(indent);
|
|
802
|
+
var result = '';
|
|
685
803
|
if (Array.isArray(obj)) {
|
|
686
|
-
for (
|
|
687
|
-
|
|
804
|
+
for (var _i = 0, obj_1 = obj; _i < obj_1.length; _i++) {
|
|
805
|
+
var item = obj_1[_i];
|
|
806
|
+
result += spaces + "- " + toSimpleYaml(item, indent + 1).trim() + "\n";
|
|
688
807
|
}
|
|
689
808
|
return result;
|
|
690
809
|
}
|
|
691
810
|
if (typeof obj === 'object') {
|
|
692
|
-
for (
|
|
811
|
+
for (var _a = 0, _b = Object.entries(obj); _a < _b.length; _a++) {
|
|
812
|
+
var _c = _b[_a], key = _c[0], value = _c[1];
|
|
693
813
|
if (typeof value === 'object' && value !== null) {
|
|
694
|
-
result +=
|
|
814
|
+
result += "" + spaces + key + ":\n" + toSimpleYaml(value, indent + 1);
|
|
695
815
|
}
|
|
696
816
|
else {
|
|
697
|
-
result +=
|
|
817
|
+
result += "" + spaces + key + ": " + toSimpleYaml(value, indent) + "\n";
|
|
698
818
|
}
|
|
699
819
|
}
|
|
700
820
|
return result;
|
|
@@ -702,7 +822,7 @@ function toSimpleYaml(obj, indent = 0) {
|
|
|
702
822
|
return String(obj);
|
|
703
823
|
}
|
|
704
824
|
// Main session command
|
|
705
|
-
export
|
|
825
|
+
export var sessionCommand = {
|
|
706
826
|
name: 'session',
|
|
707
827
|
description: 'Session management commands',
|
|
708
828
|
subcommands: [
|
|
@@ -724,27 +844,29 @@ export const sessionCommand = {
|
|
|
724
844
|
{ command: 'claude-flow session import backup.json', description: 'Import session from file' },
|
|
725
845
|
{ command: 'claude-flow session current', description: 'Show current session' }
|
|
726
846
|
],
|
|
727
|
-
action:
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
847
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
848
|
+
return __generator(this, function (_a) {
|
|
849
|
+
// Show help if no subcommand
|
|
850
|
+
output.writeln();
|
|
851
|
+
output.writeln(output.bold('Session Management Commands'));
|
|
852
|
+
output.writeln();
|
|
853
|
+
output.writeln('Usage: claude-flow session <subcommand> [options]');
|
|
854
|
+
output.writeln();
|
|
855
|
+
output.writeln('Subcommands:');
|
|
856
|
+
output.printList([
|
|
857
|
+
output.highlight('list') + " - List all sessions",
|
|
858
|
+
output.highlight('save') + " - Save current session state",
|
|
859
|
+
output.highlight('restore') + " - Restore a saved session",
|
|
860
|
+
output.highlight('delete') + " - Delete a saved session",
|
|
861
|
+
output.highlight('export') + " - Export session to file",
|
|
862
|
+
output.highlight('import') + " - Import session from file",
|
|
863
|
+
output.highlight('current') + " - Show current active session"
|
|
864
|
+
]);
|
|
865
|
+
output.writeln();
|
|
866
|
+
output.writeln('Run "claude-flow session <subcommand> --help" for subcommand help');
|
|
867
|
+
return [2 /*return*/, { success: true }];
|
|
868
|
+
});
|
|
869
|
+
}); }
|
|
748
870
|
};
|
|
749
871
|
export default sessionCommand;
|
|
750
872
|
//# sourceMappingURL=session.js.map
|