kynjal-cli 3.1.3 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/core/coder.md +1 -1
- package/.claude/agents/core/planner.md +2 -2
- package/.claude/agents/core/researcher.md +1 -1
- package/.claude/agents/core/reviewer.md +1 -1
- package/.claude/agents/core/tester.md +1 -1
- package/.claude/agents/data/data-ml-model.md +4 -4
- package/.claude/agents/development/dev-backend-api.md +4 -4
- package/.claude/agents/documentation/docs-api-openapi.md +4 -4
- package/.claude/agents/github/code-review-swarm.md +2 -2
- package/.claude/agents/github/issue-tracker.md +2 -2
- package/.claude/agents/github/pr-manager.md +2 -2
- package/.claude/agents/github/release-manager.md +2 -2
- package/.claude/agents/github/workflow-automation.md +2 -2
- package/.claude/agents/sparc/architecture.md +3 -3
- package/.claude/agents/sparc/pseudocode.md +2 -2
- package/.claude/agents/sparc/refinement.md +3 -3
- package/.claude/agents/sparc/specification.md +2 -2
- package/.claude/agents/swarm/adaptive-coordinator.md +1 -1
- package/.claude/agents/swarm/hierarchical-coordinator.md +1 -1
- package/.claude/agents/swarm/mesh-coordinator.md +1 -1
- package/.claude/agents/templates/base-template-generator.md +25 -4
- package/.claude/agents/templates/sparc-coordinator.md +3 -3
- package/.claude/helpers/auto-commit.sh +1 -1
- package/.claude/helpers/auto-memory-hook.mjs +27 -9
- package/.claude/helpers/hook-handler.cjs +58 -18
- package/.claude/helpers/statusline.cjs +14 -33
- package/.claude/helpers/statusline.js +3 -3
- package/.claude/settings.json +9 -9
- package/.claude/skills/reasoningbank-intelligence/SKILL.md +2 -2
- package/.claude/skills/swarm-orchestration/SKILL.md +1 -1
- package/README.md +383 -170
- package/bin/cli.js +6 -6
- package/bin/mcp-server.js +1 -1
- package/bin/preinstall.cjs +2 -0
- package/dist/src/appliance/gguf-engine.js +664 -0
- package/dist/src/appliance/gguf-engine.js.map +1 -0
- package/dist/src/appliance/ruvllm-bridge.js +492 -0
- package/dist/src/appliance/ruvllm-bridge.js.map +1 -0
- package/dist/src/appliance/rvfa-builder.js +383 -0
- package/dist/src/appliance/rvfa-builder.js.map +1 -0
- package/dist/src/appliance/rvfa-distribution.js +533 -0
- package/dist/src/appliance/rvfa-distribution.js.map +1 -0
- package/dist/src/appliance/rvfa-format.js +465 -0
- package/dist/src/appliance/rvfa-format.js.map +1 -0
- package/dist/src/appliance/rvfa-runner.js +373 -0
- package/dist/src/appliance/rvfa-runner.js.map +1 -0
- package/dist/src/appliance/rvfa-signing.js +469 -0
- package/dist/src/appliance/rvfa-signing.js.map +1 -0
- package/dist/src/benchmarks/pretrain/index.js +542 -331
- package/dist/src/benchmarks/pretrain/index.js.map +1 -1
- package/dist/src/commands/agent.d.ts.map +1 -1
- package/dist/src/commands/agent.js +725 -502
- package/dist/src/commands/agent.js.map +1 -1
- package/dist/src/commands/analyze.js +1548 -1218
- package/dist/src/commands/analyze.js.map +1 -1
- package/dist/src/commands/appliance-advanced.d.ts +9 -0
- package/dist/src/commands/appliance-advanced.d.ts.map +1 -0
- package/dist/src/commands/appliance-advanced.js +324 -0
- package/dist/src/commands/appliance-advanced.js.map +1 -0
- package/dist/src/commands/appliance.d.ts +8 -0
- package/dist/src/commands/appliance.d.ts.map +1 -0
- package/dist/src/commands/appliance.js +581 -0
- package/dist/src/commands/appliance.js.map +1 -0
- package/dist/src/commands/benchmark.js +523 -372
- package/dist/src/commands/benchmark.js.map +1 -1
- package/dist/src/commands/claims.js +364 -274
- package/dist/src/commands/claims.js.map +1 -1
- package/dist/src/commands/cleanup.d.ts +13 -0
- package/dist/src/commands/cleanup.d.ts.map +1 -0
- package/dist/src/commands/cleanup.js +262 -0
- package/dist/src/commands/cleanup.js.map +1 -0
- package/dist/src/commands/completions.js +118 -477
- package/dist/src/commands/completions.js.map +1 -1
- package/dist/src/commands/config.js +303 -237
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/daemon.d.ts.map +1 -1
- package/dist/src/commands/daemon.js +597 -425
- package/dist/src/commands/daemon.js.map +1 -1
- package/dist/src/commands/deployment.js +275 -194
- package/dist/src/commands/deployment.js.map +1 -1
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +690 -460
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/embeddings.js +1543 -1293
- package/dist/src/commands/embeddings.js.map +1 -1
- package/dist/src/commands/guidance.js +596 -449
- package/dist/src/commands/guidance.js.map +1 -1
- package/dist/src/commands/hive-mind.js +938 -854
- package/dist/src/commands/hive-mind.js.map +1 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +3677 -2570
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.js +322 -122
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/init.d.ts +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +943 -787
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/issues.js +558 -383
- package/dist/src/commands/issues.js.map +1 -1
- package/dist/src/commands/mcp.d.ts.map +1 -1
- package/dist/src/commands/mcp.js +605 -475
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/memory.d.ts.map +1 -1
- package/dist/src/commands/memory.js +1031 -814
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/migrate.js +347 -282
- package/dist/src/commands/migrate.js.map +1 -1
- package/dist/src/commands/neural.d.ts.map +1 -1
- package/dist/src/commands/neural.js +1563 -1283
- package/dist/src/commands/neural.js.map +1 -1
- package/dist/src/commands/performance.js +643 -497
- package/dist/src/commands/performance.js.map +1 -1
- package/dist/src/commands/plugins.js +841 -668
- package/dist/src/commands/plugins.js.map +1 -1
- package/dist/src/commands/process.js +447 -392
- package/dist/src/commands/process.js.map +1 -1
- package/dist/src/commands/progress.js +256 -162
- package/dist/src/commands/progress.js.map +1 -1
- package/dist/src/commands/providers.js +220 -150
- package/dist/src/commands/providers.js.map +1 -1
- package/dist/src/commands/route.js +665 -520
- package/dist/src/commands/route.js.map +1 -1
- package/dist/src/commands/ruvector/backup.js +651 -505
- package/dist/src/commands/ruvector/backup.js.map +1 -1
- package/dist/src/commands/ruvector/benchmark.js +401 -349
- package/dist/src/commands/ruvector/benchmark.js.map +1 -1
- package/dist/src/commands/ruvector/import.js +267 -225
- package/dist/src/commands/ruvector/import.js.map +1 -1
- package/dist/src/commands/ruvector/index.js +75 -37
- package/dist/src/commands/ruvector/index.js.map +1 -1
- package/dist/src/commands/ruvector/init.js +359 -336
- package/dist/src/commands/ruvector/init.js.map +1 -1
- package/dist/src/commands/ruvector/migrate.js +322 -335
- package/dist/src/commands/ruvector/migrate.js.map +1 -1
- package/dist/src/commands/ruvector/optimize.js +431 -375
- package/dist/src/commands/ruvector/optimize.js.map +1 -1
- package/dist/src/commands/ruvector/setup.js +117 -703
- package/dist/src/commands/ruvector/setup.js.map +1 -1
- package/dist/src/commands/ruvector/status.js +419 -364
- package/dist/src/commands/ruvector/status.js.map +1 -1
- package/dist/src/commands/security.d.ts.map +1 -1
- package/dist/src/commands/security.js +610 -456
- package/dist/src/commands/security.js.map +1 -1
- package/dist/src/commands/session.d.ts +1 -1
- package/dist/src/commands/session.js +627 -505
- package/dist/src/commands/session.js.map +1 -1
- package/dist/src/commands/start.d.ts +1 -1
- package/dist/src/commands/start.js +368 -271
- package/dist/src/commands/start.js.map +1 -1
- package/dist/src/commands/status.d.ts +1 -1
- package/dist/src/commands/status.d.ts.map +1 -1
- package/dist/src/commands/status.js +492 -379
- package/dist/src/commands/status.js.map +1 -1
- package/dist/src/commands/swarm.js +488 -408
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/commands/task.d.ts +1 -1
- package/dist/src/commands/task.js +539 -424
- package/dist/src/commands/task.js.map +1 -1
- package/dist/src/commands/transfer-store.js +412 -322
- package/dist/src/commands/transfer-store.js.map +1 -1
- package/dist/src/commands/update.js +291 -196
- package/dist/src/commands/update.js.map +1 -1
- package/dist/src/commands/workflow.js +486 -386
- package/dist/src/commands/workflow.js.map +1 -1
- package/dist/src/config-adapter.js +40 -39
- package/dist/src/config-adapter.js.map +1 -1
- package/dist/src/index.js +416 -312
- package/dist/src/index.js.map +1 -1
- package/dist/src/infrastructure/in-memory-repositories.js +507 -246
- package/dist/src/infrastructure/in-memory-repositories.js.map +1 -1
- package/dist/src/init/claudemd-generator.js +78 -368
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/executor.js +1019 -1345
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/helpers-generator.js +60 -635
- package/dist/src/init/helpers-generator.js.map +1 -1
- package/dist/src/init/index.d.ts +1 -1
- package/dist/src/init/index.d.ts.map +1 -1
- package/dist/src/init/index.js +1 -1
- package/dist/src/init/index.js.map +1 -1
- package/dist/src/init/mcp-generator.d.ts +0 -1
- package/dist/src/init/mcp-generator.d.ts.map +1 -1
- package/dist/src/init/mcp-generator.js +62 -42
- package/dist/src/init/mcp-generator.js.map +1 -1
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +167 -100
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/statusline-generator.d.ts +16 -8
- package/dist/src/init/statusline-generator.d.ts.map +1 -1
- package/dist/src/init/statusline-generator.js +20 -1300
- package/dist/src/init/statusline-generator.js.map +1 -1
- package/dist/src/init/types.d.ts +15 -5
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/types.js +66 -76
- package/dist/src/init/types.js.map +1 -1
- package/dist/src/mcp-client.js +130 -76
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-server.js +758 -445
- package/dist/src/mcp-server.js.map +1 -1
- package/dist/src/mcp-tools/agent-tools.js +492 -391
- package/dist/src/mcp-tools/agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/agentdb-tools.d.ts +30 -0
- package/dist/src/mcp-tools/agentdb-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/agentdb-tools.js +758 -0
- package/dist/src/mcp-tools/agentdb-tools.js.map +1 -0
- package/dist/src/mcp-tools/analyze-tools.js +236 -172
- package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
- package/dist/src/mcp-tools/auto-install.js +142 -80
- package/dist/src/mcp-tools/auto-install.js.map +1 -1
- package/dist/src/mcp-tools/browser-tools.js +375 -252
- package/dist/src/mcp-tools/browser-tools.js.map +1 -1
- package/dist/src/mcp-tools/claims-tools.js +565 -473
- package/dist/src/mcp-tools/claims-tools.js.map +1 -1
- package/dist/src/mcp-tools/config-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/config-tools.js +284 -190
- package/dist/src/mcp-tools/config-tools.js.map +1 -1
- package/dist/src/mcp-tools/coordination-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/coordination-tools.js +600 -349
- package/dist/src/mcp-tools/coordination-tools.js.map +1 -1
- package/dist/src/mcp-tools/daa-tools.js +367 -289
- package/dist/src/mcp-tools/daa-tools.js.map +1 -1
- package/dist/src/mcp-tools/embeddings-tools.js +693 -582
- package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
- package/dist/src/mcp-tools/github-tools.js +312 -261
- package/dist/src/mcp-tools/github-tools.js.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.js +718 -423
- package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +2726 -1978
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/index.d.ts +2 -0
- package/dist/src/mcp-tools/index.d.ts.map +1 -1
- package/dist/src/mcp-tools/index.js +2 -0
- package/dist/src/mcp-tools/index.js.map +1 -1
- package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/memory-tools.js +514 -329
- package/dist/src/mcp-tools/memory-tools.js.map +1 -1
- package/dist/src/mcp-tools/neural-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/neural-tools.js +428 -326
- package/dist/src/mcp-tools/neural-tools.js.map +1 -1
- package/dist/src/mcp-tools/performance-tools.js +480 -420
- package/dist/src/mcp-tools/performance-tools.js.map +1 -1
- package/dist/src/mcp-tools/progress-tools.js +278 -204
- package/dist/src/mcp-tools/progress-tools.js.map +1 -1
- package/dist/src/mcp-tools/ruvllm-tools.d.ts +9 -0
- package/dist/src/mcp-tools/ruvllm-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/ruvllm-tools.js +399 -0
- package/dist/src/mcp-tools/ruvllm-tools.js.map +1 -0
- package/dist/src/mcp-tools/security-tools.js +429 -297
- package/dist/src/mcp-tools/security-tools.js.map +1 -1
- package/dist/src/mcp-tools/session-tools.js +234 -185
- package/dist/src/mcp-tools/session-tools.js.map +1 -1
- package/dist/src/mcp-tools/swarm-tools.d.ts +2 -1
- package/dist/src/mcp-tools/swarm-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/swarm-tools.js +303 -64
- package/dist/src/mcp-tools/swarm-tools.js.map +1 -1
- package/dist/src/mcp-tools/system-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/system-tools.js +352 -200
- package/dist/src/mcp-tools/system-tools.js.map +1 -1
- package/dist/src/mcp-tools/task-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/task-tools.js +357 -189
- package/dist/src/mcp-tools/task-tools.js.map +1 -1
- package/dist/src/mcp-tools/terminal-tools.js +196 -148
- package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
- package/dist/src/mcp-tools/transfer-tools.js +333 -186
- package/dist/src/mcp-tools/transfer-tools.js.map +1 -1
- package/dist/src/mcp-tools/wasm-agent-tools.d.ts +9 -0
- package/dist/src/mcp-tools/wasm-agent-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/wasm-agent-tools.js +377 -0
- package/dist/src/mcp-tools/wasm-agent-tools.js.map +1 -0
- package/dist/src/mcp-tools/workflow-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/workflow-tools.js +471 -335
- package/dist/src/mcp-tools/workflow-tools.js.map +1 -1
- package/dist/src/memory/ewc-consolidation.js +345 -173
- package/dist/src/memory/ewc-consolidation.js.map +1 -1
- package/dist/src/memory/intelligence.js +841 -359
- package/dist/src/memory/intelligence.js.map +1 -1
- package/dist/src/memory/memory-bridge.js +1964 -0
- package/dist/src/memory/memory-bridge.js.map +1 -0
- package/dist/src/memory/memory-initializer.js +1895 -1602
- package/dist/src/memory/memory-initializer.js.map +1 -1
- package/dist/src/memory/sona-optimizer.js +329 -199
- package/dist/src/memory/sona-optimizer.js.map +1 -1
- package/dist/src/output.d.ts +2 -2
- package/dist/src/output.d.ts.map +1 -1
- package/dist/src/output.js +273 -242
- package/dist/src/output.js.map +1 -1
- package/dist/src/parser.js +217 -124
- package/dist/src/parser.js.map +1 -1
- package/dist/src/plugins/manager.js +531 -278
- package/dist/src/plugins/manager.js.map +1 -1
- package/dist/src/plugins/store/discovery.js +362 -275
- package/dist/src/plugins/store/discovery.js.map +1 -1
- package/dist/src/plugins/store/index.js +105 -48
- package/dist/src/plugins/store/index.js.map +1 -1
- package/dist/src/plugins/store/search.js +107 -69
- package/dist/src/plugins/store/search.js.map +1 -1
- package/dist/src/plugins/tests/demo-plugin-store.js +160 -113
- package/dist/src/plugins/tests/demo-plugin-store.js.map +1 -1
- package/dist/src/plugins/tests/standalone-test.js +223 -172
- package/dist/src/plugins/tests/standalone-test.js.map +1 -1
- package/dist/src/plugins/tests/test-plugin-store.js +228 -190
- package/dist/src/plugins/tests/test-plugin-store.js.map +1 -1
- package/dist/src/production/circuit-breaker.js +126 -62
- package/dist/src/production/circuit-breaker.js.map +1 -1
- package/dist/src/production/error-handler.js +156 -86
- package/dist/src/production/error-handler.js.map +1 -1
- package/dist/src/production/monitoring.js +220 -139
- package/dist/src/production/monitoring.js.map +1 -1
- package/dist/src/production/rate-limiter.js +93 -74
- package/dist/src/production/rate-limiter.js.map +1 -1
- package/dist/src/production/retry.js +167 -75
- package/dist/src/production/retry.js.map +1 -1
- package/dist/src/prompt.js +560 -436
- package/dist/src/prompt.js.map +1 -1
- package/dist/src/runtime/headless.js +289 -200
- package/dist/src/runtime/headless.js.map +1 -1
- package/dist/src/ruvector/agent-wasm.js +511 -0
- package/dist/src/ruvector/agent-wasm.js.map +1 -0
- package/dist/src/ruvector/ast-analyzer.js +232 -145
- package/dist/src/ruvector/ast-analyzer.js.map +1 -1
- package/dist/src/ruvector/coverage-router.js +419 -287
- package/dist/src/ruvector/coverage-router.js.map +1 -1
- package/dist/src/ruvector/coverage-tools.js +101 -56
- package/dist/src/ruvector/coverage-tools.js.map +1 -1
- package/dist/src/ruvector/diff-classifier.js +451 -324
- package/dist/src/ruvector/diff-classifier.js.map +1 -1
- package/dist/src/ruvector/enhanced-model-router.js +337 -251
- package/dist/src/ruvector/enhanced-model-router.js.map +1 -1
- package/dist/src/ruvector/flash-attention.js +254 -223
- package/dist/src/ruvector/flash-attention.js.map +1 -1
- package/dist/src/ruvector/graph-analyzer.js +680 -486
- package/dist/src/ruvector/graph-analyzer.js.map +1 -1
- package/dist/src/ruvector/index.js +113 -27
- package/dist/src/ruvector/index.js.map +1 -1
- package/dist/src/ruvector/lora-adapter.js +248 -155
- package/dist/src/ruvector/lora-adapter.js.map +1 -1
- package/dist/src/ruvector/model-router.js +248 -175
- package/dist/src/ruvector/model-router.js.map +1 -1
- package/dist/src/ruvector/moe-router.js +286 -228
- package/dist/src/ruvector/moe-router.js.map +1 -1
- package/dist/src/ruvector/q-learning-router.js +338 -257
- package/dist/src/ruvector/q-learning-router.js.map +1 -1
- package/dist/src/ruvector/ruvllm-wasm.js +527 -0
- package/dist/src/ruvector/ruvllm-wasm.js.map +1 -0
- package/dist/src/ruvector/semantic-router.js +67 -60
- package/dist/src/ruvector/semantic-router.js.map +1 -1
- package/dist/src/ruvector/vector-db.js +205 -119
- package/dist/src/ruvector/vector-db.js.map +1 -1
- package/dist/src/services/agentic-flow-bridge.js +168 -0
- package/dist/src/services/agentic-flow-bridge.js.map +1 -0
- package/dist/src/services/claim-service.js +940 -615
- package/dist/src/services/claim-service.js.map +1 -1
- package/dist/src/services/container-worker-pool.js +669 -399
- package/dist/src/services/container-worker-pool.js.map +1 -1
- package/dist/src/services/headless-worker-executor.js +467 -441
- package/dist/src/services/headless-worker-executor.js.map +1 -1
- package/dist/src/services/index.d.ts +5 -5
- package/dist/src/services/index.d.ts.map +1 -1
- package/dist/src/services/index.js +4 -4
- package/dist/src/services/index.js.map +1 -1
- package/dist/src/services/registry-api.js +201 -93
- package/dist/src/services/registry-api.js.map +1 -1
- package/dist/src/services/ruvector-training.js +414 -144
- package/dist/src/services/ruvector-training.js.map +1 -1
- package/dist/src/services/worker-daemon.js +928 -531
- package/dist/src/services/worker-daemon.js.map +1 -1
- package/dist/src/services/worker-queue.js +550 -331
- package/dist/src/services/worker-queue.js.map +1 -1
- package/dist/src/suggest.js +55 -45
- package/dist/src/suggest.js.map +1 -1
- package/dist/src/transfer/anonymization/index.js +37 -29
- package/dist/src/transfer/anonymization/index.js.map +1 -1
- package/dist/src/transfer/deploy-seraphine.d.ts +1 -1
- package/dist/src/transfer/deploy-seraphine.js +156 -129
- package/dist/src/transfer/deploy-seraphine.js.map +1 -1
- package/dist/src/transfer/export.js +142 -84
- package/dist/src/transfer/export.js.map +1 -1
- package/dist/src/transfer/index.d.ts +1 -1
- package/dist/src/transfer/index.d.ts.map +1 -1
- package/dist/src/transfer/index.js +2 -0
- package/dist/src/transfer/index.js.map +1 -1
- package/dist/src/transfer/ipfs/client.js +337 -179
- package/dist/src/transfer/ipfs/client.js.map +1 -1
- package/dist/src/transfer/ipfs/upload.js +434 -290
- package/dist/src/transfer/ipfs/upload.js.map +1 -1
- package/dist/src/transfer/models/seraphine.js +58 -58
- package/dist/src/transfer/models/seraphine.js.map +1 -1
- package/dist/src/transfer/serialization/cfp.js +37 -33
- package/dist/src/transfer/serialization/cfp.js.map +1 -1
- package/dist/src/transfer/storage/gcs.js +248 -139
- package/dist/src/transfer/storage/gcs.js.map +1 -1
- package/dist/src/transfer/store/discovery.js +353 -243
- package/dist/src/transfer/store/discovery.js.map +1 -1
- package/dist/src/transfer/store/download.js +365 -243
- package/dist/src/transfer/store/download.js.map +1 -1
- package/dist/src/transfer/store/index.js +130 -63
- package/dist/src/transfer/store/index.js.map +1 -1
- package/dist/src/transfer/store/publish.js +258 -184
- package/dist/src/transfer/store/publish.js.map +1 -1
- package/dist/src/transfer/store/registry.js +73 -51
- package/dist/src/transfer/store/registry.js.map +1 -1
- package/dist/src/transfer/store/search.js +96 -64
- package/dist/src/transfer/store/search.js.map +1 -1
- package/dist/src/transfer/store/tests/standalone-test.js +231 -174
- package/dist/src/transfer/store/tests/standalone-test.js.map +1 -1
- package/dist/src/transfer/test-seraphine.js +130 -95
- package/dist/src/transfer/test-seraphine.js.map +1 -1
- package/dist/src/transfer/tests/test-store.js +239 -194
- package/dist/src/transfer/tests/test-store.js.map +1 -1
- package/dist/src/types.js +56 -27
- package/dist/src/types.js.map +1 -1
- package/dist/src/update/checker.js +183 -106
- package/dist/src/update/checker.js.map +1 -1
- package/dist/src/update/executor.js +198 -135
- package/dist/src/update/executor.js.map +1 -1
- package/dist/src/update/index.js +85 -38
- package/dist/src/update/index.js.map +1 -1
- package/dist/src/update/rate-limiter.js +31 -19
- package/dist/src/update/rate-limiter.js.map +1 -1
- package/dist/src/update/validator.js +64 -38
- package/dist/src/update/validator.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -10
- package/.claude/agents/custom/accessibility-auditor.yaml +0 -56
- package/.claude/agents/custom/design-architect.yaml +0 -48
- package/.claude/agents/custom/ui-developer.yaml +0 -46
- package/.claude/agents/custom/ux-researcher.yaml +0 -60
- package/dist/src/benchmarks/pretrain/index.d.ts +0 -58
- package/dist/src/benchmarks/pretrain/index.d.ts.map +0 -1
- package/dist/src/commands/index.d.ts +0 -108
- package/dist/src/commands/index.d.ts.map +0 -1
- package/dist/src/config-adapter.d.ts +0 -15
- package/dist/src/config-adapter.d.ts.map +0 -1
- package/dist/src/index.d.ts +0 -76
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/infrastructure/in-memory-repositories.d.ts +0 -68
- package/dist/src/infrastructure/in-memory-repositories.d.ts.map +0 -1
- package/dist/src/init/claudemd-generator.d.ts +0 -25
- package/dist/src/init/claudemd-generator.d.ts.map +0 -1
- package/dist/src/init/executor.d.ts +0 -41
- package/dist/src/init/executor.d.ts.map +0 -1
- package/dist/src/init/helpers-generator.d.ts +0 -60
- package/dist/src/init/helpers-generator.d.ts.map +0 -1
- package/dist/src/mcp-client.d.ts +0 -92
- package/dist/src/mcp-client.d.ts.map +0 -1
- package/dist/src/mcp-server.d.ts +0 -161
- package/dist/src/mcp-server.d.ts.map +0 -1
- package/dist/src/mcp-tools/auto-install.d.ts +0 -83
- package/dist/src/mcp-tools/auto-install.d.ts.map +0 -1
- package/dist/src/mcp-tools/types.d.ts +0 -31
- package/dist/src/mcp-tools/types.d.ts.map +0 -1
- package/dist/src/memory/ewc-consolidation.d.ts +0 -271
- package/dist/src/memory/ewc-consolidation.d.ts.map +0 -1
- package/dist/src/memory/intelligence.d.ts +0 -285
- package/dist/src/memory/intelligence.d.ts.map +0 -1
- package/dist/src/memory/memory-initializer.d.ts +0 -396
- package/dist/src/memory/memory-initializer.d.ts.map +0 -1
- package/dist/src/memory/sona-optimizer.d.ts +0 -227
- package/dist/src/memory/sona-optimizer.d.ts.map +0 -1
- package/dist/src/parser.d.ts +0 -41
- package/dist/src/parser.d.ts.map +0 -1
- package/dist/src/plugins/manager.d.ts +0 -133
- package/dist/src/plugins/manager.d.ts.map +0 -1
- package/dist/src/plugins/store/discovery.d.ts +0 -88
- package/dist/src/plugins/store/discovery.d.ts.map +0 -1
- package/dist/src/plugins/store/index.d.ts +0 -76
- package/dist/src/plugins/store/index.d.ts.map +0 -1
- package/dist/src/plugins/store/search.d.ts +0 -46
- package/dist/src/plugins/store/search.d.ts.map +0 -1
- package/dist/src/plugins/store/types.d.ts +0 -274
- package/dist/src/plugins/store/types.d.ts.map +0 -1
- package/dist/src/production/circuit-breaker.d.ts +0 -101
- package/dist/src/production/circuit-breaker.d.ts.map +0 -1
- package/dist/src/production/error-handler.d.ts +0 -92
- package/dist/src/production/error-handler.d.ts.map +0 -1
- package/dist/src/production/monitoring.d.ts +0 -161
- package/dist/src/production/monitoring.d.ts.map +0 -1
- package/dist/src/production/rate-limiter.d.ts +0 -80
- package/dist/src/production/rate-limiter.d.ts.map +0 -1
- package/dist/src/production/retry.d.ts +0 -48
- package/dist/src/production/retry.d.ts.map +0 -1
- package/dist/src/prompt.d.ts +0 -44
- package/dist/src/prompt.d.ts.map +0 -1
- package/dist/src/runtime/headless.d.ts +0 -60
- package/dist/src/runtime/headless.d.ts.map +0 -1
- package/dist/src/ruvector/ast-analyzer.d.ts +0 -67
- package/dist/src/ruvector/ast-analyzer.d.ts.map +0 -1
- package/dist/src/ruvector/coverage-router.d.ts +0 -160
- package/dist/src/ruvector/coverage-router.d.ts.map +0 -1
- package/dist/src/ruvector/diff-classifier.d.ts +0 -175
- package/dist/src/ruvector/diff-classifier.d.ts.map +0 -1
- package/dist/src/ruvector/enhanced-model-router.d.ts +0 -146
- package/dist/src/ruvector/enhanced-model-router.d.ts.map +0 -1
- package/dist/src/ruvector/flash-attention.d.ts +0 -195
- package/dist/src/ruvector/flash-attention.d.ts.map +0 -1
- package/dist/src/ruvector/graph-analyzer.d.ts +0 -187
- package/dist/src/ruvector/graph-analyzer.d.ts.map +0 -1
- package/dist/src/ruvector/index.d.ts +0 -34
- package/dist/src/ruvector/index.d.ts.map +0 -1
- package/dist/src/ruvector/lora-adapter.d.ts +0 -218
- package/dist/src/ruvector/lora-adapter.d.ts.map +0 -1
- package/dist/src/ruvector/model-router.d.ts +0 -220
- package/dist/src/ruvector/model-router.d.ts.map +0 -1
- package/dist/src/ruvector/moe-router.d.ts +0 -206
- package/dist/src/ruvector/moe-router.d.ts.map +0 -1
- package/dist/src/ruvector/q-learning-router.d.ts +0 -211
- package/dist/src/ruvector/q-learning-router.d.ts.map +0 -1
- package/dist/src/ruvector/semantic-router.d.ts +0 -77
- package/dist/src/ruvector/semantic-router.d.ts.map +0 -1
- package/dist/src/ruvector/vector-db.d.ts +0 -69
- package/dist/src/ruvector/vector-db.d.ts.map +0 -1
- package/dist/src/services/claim-service.d.ts +0 -204
- package/dist/src/services/claim-service.d.ts.map +0 -1
- package/dist/src/services/container-worker-pool.d.ts +0 -197
- package/dist/src/services/container-worker-pool.d.ts.map +0 -1
- package/dist/src/services/headless-worker-executor.d.ts +0 -304
- package/dist/src/services/headless-worker-executor.d.ts.map +0 -1
- package/dist/src/services/registry-api.d.ts +0 -58
- package/dist/src/services/registry-api.d.ts.map +0 -1
- package/dist/src/services/ruvector-training.d.ts +0 -213
- package/dist/src/services/ruvector-training.d.ts.map +0 -1
- package/dist/src/services/worker-daemon.d.ts +0 -203
- package/dist/src/services/worker-daemon.d.ts.map +0 -1
- package/dist/src/services/worker-queue.d.ts +0 -194
- package/dist/src/services/worker-queue.d.ts.map +0 -1
- package/dist/src/suggest.d.ts +0 -53
- package/dist/src/suggest.d.ts.map +0 -1
- package/dist/src/transfer/export.d.ts +0 -25
- package/dist/src/transfer/export.d.ts.map +0 -1
- package/dist/src/transfer/ipfs/client.d.ts +0 -109
- package/dist/src/transfer/ipfs/client.d.ts.map +0 -1
- package/dist/src/transfer/ipfs/upload.d.ts +0 -95
- package/dist/src/transfer/ipfs/upload.d.ts.map +0 -1
- package/dist/src/transfer/models/seraphine.d.ts +0 -72
- package/dist/src/transfer/models/seraphine.d.ts.map +0 -1
- package/dist/src/transfer/serialization/cfp.d.ts +0 -49
- package/dist/src/transfer/serialization/cfp.d.ts.map +0 -1
- package/dist/src/transfer/storage/gcs.d.ts +0 -82
- package/dist/src/transfer/storage/gcs.d.ts.map +0 -1
- package/dist/src/transfer/store/discovery.d.ts +0 -84
- package/dist/src/transfer/store/discovery.d.ts.map +0 -1
- package/dist/src/transfer/store/download.d.ts +0 -70
- package/dist/src/transfer/store/download.d.ts.map +0 -1
- package/dist/src/transfer/store/index.d.ts +0 -84
- package/dist/src/transfer/store/index.d.ts.map +0 -1
- package/dist/src/transfer/store/publish.d.ts +0 -76
- package/dist/src/transfer/store/publish.d.ts.map +0 -1
- package/dist/src/transfer/store/search.d.ts +0 -54
- package/dist/src/transfer/store/search.d.ts.map +0 -1
- package/dist/src/transfer/types.d.ts +0 -245
- package/dist/src/transfer/types.d.ts.map +0 -1
- package/dist/src/types.d.ts +0 -198
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/update/checker.d.ts +0 -34
- package/dist/src/update/checker.d.ts.map +0 -1
- package/dist/src/update/executor.d.ts +0 -32
- package/dist/src/update/executor.d.ts.map +0 -1
- package/dist/src/update/index.d.ts +0 -33
- package/dist/src/update/index.d.ts.map +0 -1
- package/dist/src/update/rate-limiter.d.ts +0 -20
- package/dist/src/update/rate-limiter.d.ts.map +0 -1
- package/dist/src/update/validator.d.ts +0 -17
- package/dist/src/update/validator.d.ts.map +0 -1
package/dist/src/index.js
CHANGED
|
@@ -1,9 +1,54 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* V3 CLI Main Entry Point
|
|
3
|
-
* Modernized CLI for
|
|
3
|
+
* Modernized CLI for RuFlo V3
|
|
4
4
|
*
|
|
5
5
|
* Created with ❤️ by ruv.io
|
|
6
6
|
*/
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
17
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
18
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
19
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
20
|
+
function step(op) {
|
|
21
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
22
|
+
while (_) try {
|
|
23
|
+
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;
|
|
24
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
25
|
+
switch (op[0]) {
|
|
26
|
+
case 0: case 1: t = op; break;
|
|
27
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
28
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
29
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
30
|
+
default:
|
|
31
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
32
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
33
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
34
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
35
|
+
if (t[2]) _.ops.pop();
|
|
36
|
+
_.trys.pop(); continue;
|
|
37
|
+
}
|
|
38
|
+
op = body.call(thisArg, _);
|
|
39
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
40
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
44
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
45
|
+
if (ar || !(i in from)) {
|
|
46
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
47
|
+
ar[i] = from[i];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
51
|
+
};
|
|
7
52
|
import { readFileSync } from 'fs';
|
|
8
53
|
import { fileURLToPath } from 'url';
|
|
9
54
|
import { dirname, join } from 'path';
|
|
@@ -15,267 +60,285 @@ import { runStartupUpdateCheck } from './update/index.js';
|
|
|
15
60
|
// Read version from package.json at runtime
|
|
16
61
|
function getPackageVersion() {
|
|
17
62
|
try {
|
|
18
|
-
|
|
19
|
-
|
|
63
|
+
var __filename = fileURLToPath(import.meta.url);
|
|
64
|
+
var __dirname = dirname(__filename);
|
|
20
65
|
// Navigate from dist/src to package root
|
|
21
|
-
|
|
22
|
-
|
|
66
|
+
var pkgPath = join(__dirname, '..', '..', 'package.json');
|
|
67
|
+
var pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
23
68
|
return pkg.version || '3.0.0';
|
|
24
69
|
}
|
|
25
|
-
catch {
|
|
70
|
+
catch (_a) {
|
|
26
71
|
return '3.0.0';
|
|
27
72
|
}
|
|
28
73
|
}
|
|
29
|
-
export
|
|
74
|
+
export var VERSION = getPackageVersion();
|
|
30
75
|
/**
|
|
31
76
|
* V3 CLI Application
|
|
32
77
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
interactive;
|
|
40
|
-
constructor(options = {}) {
|
|
41
|
-
this.name = options.name || 'kynjalflow';
|
|
42
|
-
this.description = options.description || 'KynjalFlow V3 - AI Agent Orchestration Platform';
|
|
78
|
+
var CLI = /** @class */ (function () {
|
|
79
|
+
function CLI(options) {
|
|
80
|
+
if (options === void 0) { options = {}; }
|
|
81
|
+
var _a, _b;
|
|
82
|
+
this.name = options.name || 'ruflo';
|
|
83
|
+
this.description = options.description || 'RuFlo V3 - AI Agent Orchestration Platform';
|
|
43
84
|
this.version = options.version || VERSION;
|
|
44
85
|
this.parser = commandParser;
|
|
45
86
|
this.output = output;
|
|
46
|
-
this.interactive = options.interactive
|
|
87
|
+
this.interactive = (_b = (_a = options.interactive) !== null && _a !== void 0 ? _a : process.stdin.isTTY) !== null && _b !== void 0 ? _b : false;
|
|
47
88
|
// Register all commands
|
|
48
|
-
for (
|
|
89
|
+
for (var _i = 0, commands_1 = commands; _i < commands_1.length; _i++) {
|
|
90
|
+
var cmd = commands_1[_i];
|
|
49
91
|
this.parser.registerCommand(cmd);
|
|
50
92
|
}
|
|
51
93
|
}
|
|
52
94
|
/**
|
|
53
95
|
* Run the CLI with given arguments
|
|
54
96
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
this.output.setVerbosity('quiet');
|
|
71
|
-
}
|
|
72
|
-
else if (flags.verbose) {
|
|
73
|
-
this.output.setVerbosity(process.env.DEBUG ? 'debug' : 'verbose');
|
|
74
|
-
}
|
|
75
|
-
// Verbose mode: show parsed arguments
|
|
76
|
-
if (this.output.isVerbose()) {
|
|
77
|
-
this.output.printDebug(`Command: ${commandPath.join(' ') || '(none)'}`);
|
|
78
|
-
this.output.printDebug(`Positional: [${positional.join(', ')}]`);
|
|
79
|
-
this.output.printDebug(`Flags: ${JSON.stringify(Object.fromEntries(Object.entries(flags).filter(([k]) => k !== '_')))}`);
|
|
80
|
-
this.output.printDebug(`CWD: ${process.cwd()}`);
|
|
81
|
-
}
|
|
82
|
-
// Run startup update check (non-blocking, silent on skip)
|
|
83
|
-
if (!flags.noUpdate && commandPath[0] !== 'update') {
|
|
84
|
-
this.checkForUpdatesOnStartup().catch(() => { });
|
|
85
|
-
}
|
|
86
|
-
// Handle lazy-loaded commands that weren't recognized by the parser
|
|
87
|
-
// If commandPath is empty but positional has a command name, check if it's lazy-loadable
|
|
88
|
-
if (commandPath.length === 0 && positional.length > 0 && !positional[0].startsWith('-')) {
|
|
89
|
-
const potentialCommand = positional[0];
|
|
90
|
-
if (hasCommand(potentialCommand)) {
|
|
91
|
-
// This is a lazy-loaded command, treat it as the command
|
|
92
|
-
commandPath.push(potentialCommand);
|
|
93
|
-
positional.shift();
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
// No command - show help or suggest correction
|
|
97
|
-
if (commandPath.length === 0 || flags.help || flags.h) {
|
|
98
|
-
if (commandPath.length > 0) {
|
|
99
|
-
// Show command-specific help
|
|
100
|
-
await this.showCommandHelp(commandPath[0]);
|
|
101
|
-
}
|
|
102
|
-
else if (positional.length > 0 && !positional[0].startsWith('-')) {
|
|
103
|
-
// First positional looks like an attempted command - suggest correction
|
|
104
|
-
const attemptedCommand = positional[0];
|
|
105
|
-
this.output.printError(`Unknown command: ${attemptedCommand}`);
|
|
106
|
-
const availableCommands = Array.from(new Set([...commands.map(c => c.name), ...getCommandNames()]));
|
|
107
|
-
const { message } = suggestCommand(attemptedCommand, availableCommands);
|
|
108
|
-
this.output.writeln(this.output.dim(` ${message}`));
|
|
109
|
-
process.exit(1);
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
this.showHelp();
|
|
113
|
-
}
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
// Find and execute command
|
|
117
|
-
const commandName = commandPath[0];
|
|
118
|
-
// First check the parser's registry (for dynamically registered commands)
|
|
119
|
-
// Then fall back to the static registry, then try lazy loading
|
|
120
|
-
let command = this.parser.getCommand(commandName) || getCommand(commandName);
|
|
121
|
-
// If not found in sync registry, try lazy loading
|
|
122
|
-
if (!command && hasCommand(commandName)) {
|
|
123
|
-
command = await getCommandAsync(commandName);
|
|
124
|
-
}
|
|
125
|
-
if (!command) {
|
|
126
|
-
this.output.printError(`Unknown command: ${commandName}`);
|
|
127
|
-
// Smart suggestions - include lazy-loadable commands in suggestions
|
|
128
|
-
const availableCommands = Array.from(new Set([...commands.map(c => c.name), ...getCommandNames()]));
|
|
129
|
-
const { message } = suggestCommand(commandName, availableCommands);
|
|
130
|
-
this.output.writeln(this.output.dim(` ${message}`));
|
|
131
|
-
process.exit(1);
|
|
132
|
-
}
|
|
133
|
-
// Handle subcommand (supports nested subcommands)
|
|
134
|
-
let targetCommand = command;
|
|
135
|
-
let subcommandArgs = positional;
|
|
136
|
-
// Process command path (e.g., ['hooks', 'worker', 'list'])
|
|
137
|
-
// Note: When parser includes subcommand in commandPath, positional already excludes it
|
|
138
|
-
if (commandPath.length > 1 && command.subcommands) {
|
|
139
|
-
const subcommandName = commandPath[1];
|
|
140
|
-
const subcommand = command.subcommands.find(sc => sc.name === subcommandName || sc.aliases?.includes(subcommandName));
|
|
141
|
-
if (subcommand) {
|
|
142
|
-
targetCommand = subcommand;
|
|
143
|
-
// Parser already extracted subcommand from positional, so use as-is
|
|
144
|
-
subcommandArgs = positional;
|
|
145
|
-
// Check for nested subcommand (level 2)
|
|
146
|
-
if (commandPath.length > 2 && subcommand.subcommands) {
|
|
147
|
-
const nestedName = commandPath[2];
|
|
148
|
-
const nestedSubcommand = subcommand.subcommands.find(sc => sc.name === nestedName || sc.aliases?.includes(nestedName));
|
|
149
|
-
if (nestedSubcommand) {
|
|
150
|
-
targetCommand = nestedSubcommand;
|
|
151
|
-
// Parser already extracted nested subcommand too
|
|
152
|
-
subcommandArgs = positional;
|
|
97
|
+
CLI.prototype.run = function (args) {
|
|
98
|
+
if (args === void 0) { args = process.argv.slice(2); }
|
|
99
|
+
return __awaiter(this, void 0, Promise, function () {
|
|
100
|
+
var parseResult, commandPath, flags, positional, potentialCommand, attemptedCommand, availableCommands, message, commandName, command, availableCommands, message, targetCommand, subcommandArgs, subcommandName_1, subcommand, nestedName_1, nestedSubcommand, subcommandName_2, subcommand, nestedName_2, nestedSubcommand, validationErrors, _i, validationErrors_1, error, ctx, startTime, result, error_1, errorMessage;
|
|
101
|
+
var _a;
|
|
102
|
+
return __generator(this, function (_b) {
|
|
103
|
+
switch (_b.label) {
|
|
104
|
+
case 0:
|
|
105
|
+
_b.trys.push([0, 11, , 12]);
|
|
106
|
+
parseResult = this.parser.parse(args);
|
|
107
|
+
commandPath = parseResult.command, flags = parseResult.flags, positional = parseResult.positional;
|
|
108
|
+
// Handle global flags
|
|
109
|
+
if (flags.version || flags.V) {
|
|
110
|
+
this.showVersion();
|
|
111
|
+
return [2 /*return*/];
|
|
153
112
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
else if (positional.length > 0 && command.subcommands) {
|
|
158
|
-
// Check if first positional is a subcommand
|
|
159
|
-
const subcommandName = positional[0];
|
|
160
|
-
const subcommand = command.subcommands.find(sc => sc.name === subcommandName || sc.aliases?.includes(subcommandName));
|
|
161
|
-
if (subcommand) {
|
|
162
|
-
targetCommand = subcommand;
|
|
163
|
-
subcommandArgs = positional.slice(1);
|
|
164
|
-
// Check for nested subcommand (level 2 from positional)
|
|
165
|
-
if (subcommandArgs.length > 0 && subcommand.subcommands) {
|
|
166
|
-
const nestedName = subcommandArgs[0];
|
|
167
|
-
const nestedSubcommand = subcommand.subcommands.find(sc => sc.name === nestedName || sc.aliases?.includes(nestedName));
|
|
168
|
-
if (nestedSubcommand) {
|
|
169
|
-
targetCommand = nestedSubcommand;
|
|
170
|
-
subcommandArgs = subcommandArgs.slice(1);
|
|
113
|
+
if (flags.noColor) {
|
|
114
|
+
this.output.setColorEnabled(false);
|
|
171
115
|
}
|
|
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
|
-
|
|
116
|
+
// Set verbosity level based on flags
|
|
117
|
+
if (flags.quiet) {
|
|
118
|
+
this.output.setVerbosity('quiet');
|
|
119
|
+
}
|
|
120
|
+
else if (flags.verbose) {
|
|
121
|
+
this.output.setVerbosity(process.env.DEBUG ? 'debug' : 'verbose');
|
|
122
|
+
}
|
|
123
|
+
// Verbose mode: show parsed arguments
|
|
124
|
+
if (this.output.isVerbose()) {
|
|
125
|
+
this.output.printDebug("Command: " + (commandPath.join(' ') || '(none)'));
|
|
126
|
+
this.output.printDebug("Positional: [" + positional.join(', ') + "]");
|
|
127
|
+
this.output.printDebug("Flags: " + JSON.stringify(Object.fromEntries(Object.entries(flags).filter(function (_a) {
|
|
128
|
+
var k = _a[0];
|
|
129
|
+
return k !== '_';
|
|
130
|
+
}))));
|
|
131
|
+
this.output.printDebug("CWD: " + process.cwd());
|
|
132
|
+
}
|
|
133
|
+
// Run startup update check (non-blocking, silent on skip)
|
|
134
|
+
if (!flags.noUpdate && commandPath[0] !== 'update') {
|
|
135
|
+
this.checkForUpdatesOnStartup()["catch"](function () { });
|
|
136
|
+
}
|
|
137
|
+
// Handle lazy-loaded commands that weren't recognized by the parser
|
|
138
|
+
// If commandPath is empty but positional has a command name, check if it's lazy-loadable
|
|
139
|
+
if (commandPath.length === 0 && positional.length > 0 && !positional[0].startsWith('-')) {
|
|
140
|
+
potentialCommand = positional[0];
|
|
141
|
+
if (hasCommand(potentialCommand)) {
|
|
142
|
+
// This is a lazy-loaded command, treat it as the command
|
|
143
|
+
commandPath.push(potentialCommand);
|
|
144
|
+
positional.shift();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (!(commandPath.length === 0 || flags.help || flags.h)) return [3 /*break*/, 4];
|
|
148
|
+
if (!(commandPath.length > 0)) return [3 /*break*/, 2];
|
|
149
|
+
// Show command-specific help
|
|
150
|
+
return [4 /*yield*/, this.showCommandHelp(commandPath[0])];
|
|
151
|
+
case 1:
|
|
152
|
+
// Show command-specific help
|
|
153
|
+
_b.sent();
|
|
154
|
+
return [3 /*break*/, 3];
|
|
155
|
+
case 2:
|
|
156
|
+
if (positional.length > 0 && !positional[0].startsWith('-')) {
|
|
157
|
+
attemptedCommand = positional[0];
|
|
158
|
+
this.output.printError("Unknown command: " + attemptedCommand);
|
|
159
|
+
availableCommands = Array.from(new Set(__spreadArray(__spreadArray([], commands.map(function (c) { return c.name; }), true), getCommandNames(), true)));
|
|
160
|
+
message = suggestCommand(attemptedCommand, availableCommands).message;
|
|
161
|
+
this.output.writeln(this.output.dim(" " + message));
|
|
162
|
+
process.exit(1);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
this.showHelp();
|
|
166
|
+
}
|
|
167
|
+
_b.label = 3;
|
|
168
|
+
case 3: return [2 /*return*/];
|
|
169
|
+
case 4:
|
|
170
|
+
commandName = commandPath[0];
|
|
171
|
+
command = this.parser.getCommand(commandName) || getCommand(commandName);
|
|
172
|
+
if (!(!command && hasCommand(commandName))) return [3 /*break*/, 6];
|
|
173
|
+
return [4 /*yield*/, getCommandAsync(commandName)];
|
|
174
|
+
case 5:
|
|
175
|
+
command = _b.sent();
|
|
176
|
+
_b.label = 6;
|
|
177
|
+
case 6:
|
|
178
|
+
if (!command) {
|
|
179
|
+
this.output.printError("Unknown command: " + commandName);
|
|
180
|
+
availableCommands = Array.from(new Set(__spreadArray(__spreadArray([], commands.map(function (c) { return c.name; }), true), getCommandNames(), true)));
|
|
181
|
+
message = suggestCommand(commandName, availableCommands).message;
|
|
182
|
+
this.output.writeln(this.output.dim(" " + message));
|
|
183
|
+
process.exit(1);
|
|
184
|
+
}
|
|
185
|
+
targetCommand = command;
|
|
186
|
+
subcommandArgs = positional;
|
|
187
|
+
// Process command path (e.g., ['hooks', 'worker', 'list'])
|
|
188
|
+
// Note: When parser includes subcommand in commandPath, positional already excludes it
|
|
189
|
+
if (commandPath.length > 1 && command.subcommands) {
|
|
190
|
+
subcommandName_1 = commandPath[1];
|
|
191
|
+
subcommand = command.subcommands.find(function (sc) { var _a; return sc.name === subcommandName_1 || ((_a = sc.aliases) === null || _a === void 0 ? void 0 : _a.includes(subcommandName_1)); });
|
|
192
|
+
if (subcommand) {
|
|
193
|
+
targetCommand = subcommand;
|
|
194
|
+
// Parser already extracted subcommand from positional, so use as-is
|
|
195
|
+
subcommandArgs = positional;
|
|
196
|
+
// Check for nested subcommand (level 2)
|
|
197
|
+
if (commandPath.length > 2 && subcommand.subcommands) {
|
|
198
|
+
nestedName_1 = commandPath[2];
|
|
199
|
+
nestedSubcommand = subcommand.subcommands.find(function (sc) { var _a; return sc.name === nestedName_1 || ((_a = sc.aliases) === null || _a === void 0 ? void 0 : _a.includes(nestedName_1)); });
|
|
200
|
+
if (nestedSubcommand) {
|
|
201
|
+
targetCommand = nestedSubcommand;
|
|
202
|
+
// Parser already extracted nested subcommand too
|
|
203
|
+
subcommandArgs = positional;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
else if (positional.length > 0 && command.subcommands) {
|
|
209
|
+
subcommandName_2 = positional[0];
|
|
210
|
+
subcommand = command.subcommands.find(function (sc) { var _a; return sc.name === subcommandName_2 || ((_a = sc.aliases) === null || _a === void 0 ? void 0 : _a.includes(subcommandName_2)); });
|
|
211
|
+
if (subcommand) {
|
|
212
|
+
targetCommand = subcommand;
|
|
213
|
+
subcommandArgs = positional.slice(1);
|
|
214
|
+
// Check for nested subcommand (level 2 from positional)
|
|
215
|
+
if (subcommandArgs.length > 0 && subcommand.subcommands) {
|
|
216
|
+
nestedName_2 = subcommandArgs[0];
|
|
217
|
+
nestedSubcommand = subcommand.subcommands.find(function (sc) { var _a; return sc.name === nestedName_2 || ((_a = sc.aliases) === null || _a === void 0 ? void 0 : _a.includes(nestedName_2)); });
|
|
218
|
+
if (nestedSubcommand) {
|
|
219
|
+
targetCommand = nestedSubcommand;
|
|
220
|
+
subcommandArgs = subcommandArgs.slice(1);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
validationErrors = this.parser.validateFlags(flags, targetCommand);
|
|
226
|
+
if (validationErrors.length > 0) {
|
|
227
|
+
for (_i = 0, validationErrors_1 = validationErrors; _i < validationErrors_1.length; _i++) {
|
|
228
|
+
error = validationErrors_1[_i];
|
|
229
|
+
this.output.printError(error);
|
|
230
|
+
}
|
|
231
|
+
process.exit(1);
|
|
232
|
+
}
|
|
233
|
+
_a = {
|
|
234
|
+
args: subcommandArgs,
|
|
235
|
+
flags: flags
|
|
236
|
+
};
|
|
237
|
+
return [4 /*yield*/, this.loadConfig(flags.config)];
|
|
238
|
+
case 7:
|
|
239
|
+
ctx = (_a.config = _b.sent(),
|
|
240
|
+
_a.cwd = process.cwd(),
|
|
241
|
+
_a.interactive = this.interactive && !flags.quiet,
|
|
242
|
+
_a);
|
|
243
|
+
if (!targetCommand.action) return [3 /*break*/, 9];
|
|
244
|
+
if (this.output.isVerbose()) {
|
|
245
|
+
this.output.printDebug("Executing: " + targetCommand.name);
|
|
246
|
+
}
|
|
247
|
+
startTime = Date.now();
|
|
248
|
+
return [4 /*yield*/, targetCommand.action(ctx)];
|
|
249
|
+
case 8:
|
|
250
|
+
result = _b.sent();
|
|
251
|
+
if (this.output.isVerbose()) {
|
|
252
|
+
this.output.printDebug("Completed in " + (Date.now() - startTime) + "ms");
|
|
253
|
+
}
|
|
254
|
+
if (result && !result.success) {
|
|
255
|
+
process.exit(result.exitCode || 1);
|
|
256
|
+
}
|
|
257
|
+
return [3 /*break*/, 10];
|
|
258
|
+
case 9:
|
|
259
|
+
// No action - show command help
|
|
260
|
+
this.showCommandHelp(commandName);
|
|
261
|
+
_b.label = 10;
|
|
262
|
+
case 10: return [3 /*break*/, 12];
|
|
263
|
+
case 11:
|
|
264
|
+
error_1 = _b.sent();
|
|
265
|
+
errorMessage = error_1.message;
|
|
266
|
+
if (errorMessage && errorMessage.startsWith('process.exit:')) {
|
|
267
|
+
throw error_1; // Re-throw so tests can capture the exit code
|
|
268
|
+
}
|
|
269
|
+
this.handleError(error_1);
|
|
270
|
+
return [3 /*break*/, 12];
|
|
271
|
+
case 12: return [2 /*return*/];
|
|
203
272
|
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
this.showCommandHelp(commandName);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
catch (error) {
|
|
211
|
-
// Don't re-handle if this is a process.exit error (from mocked tests)
|
|
212
|
-
const errorMessage = error.message;
|
|
213
|
-
if (errorMessage && errorMessage.startsWith('process.exit:')) {
|
|
214
|
-
throw error; // Re-throw so tests can capture the exit code
|
|
215
|
-
}
|
|
216
|
-
this.handleError(error);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
};
|
|
219
276
|
/**
|
|
220
277
|
* Show main help
|
|
221
278
|
*/
|
|
222
|
-
showHelp() {
|
|
279
|
+
CLI.prototype.showHelp = function () {
|
|
223
280
|
this.output.writeln();
|
|
224
|
-
this.output.writeln(this.output.bold(
|
|
281
|
+
this.output.writeln(this.output.bold(this.name + " v" + this.version));
|
|
225
282
|
this.output.writeln(this.output.dim(this.description));
|
|
226
283
|
this.output.writeln();
|
|
227
284
|
this.output.writeln(this.output.bold('USAGE:'));
|
|
228
|
-
this.output.writeln(
|
|
285
|
+
this.output.writeln(" " + this.name + " <command> [subcommand] [options]");
|
|
229
286
|
this.output.writeln();
|
|
230
287
|
// Primary Commands
|
|
231
288
|
this.output.writeln(this.output.bold('PRIMARY COMMANDS:'));
|
|
232
|
-
for (
|
|
289
|
+
for (var _i = 0, _a = commandsByCategory.primary; _i < _a.length; _i++) {
|
|
290
|
+
var cmd = _a[_i];
|
|
233
291
|
if (cmd.hidden)
|
|
234
292
|
continue;
|
|
235
|
-
|
|
236
|
-
this.output.writeln(
|
|
293
|
+
var name = cmd.name.padEnd(12);
|
|
294
|
+
this.output.writeln(" " + this.output.highlight(name) + " " + cmd.description);
|
|
237
295
|
}
|
|
238
296
|
this.output.writeln();
|
|
239
297
|
// Advanced Commands
|
|
240
298
|
this.output.writeln(this.output.bold('ADVANCED COMMANDS:'));
|
|
241
|
-
for (
|
|
299
|
+
for (var _b = 0, _c = commandsByCategory.advanced; _b < _c.length; _b++) {
|
|
300
|
+
var cmd = _c[_b];
|
|
242
301
|
if (cmd.hidden)
|
|
243
302
|
continue;
|
|
244
|
-
|
|
245
|
-
this.output.writeln(
|
|
303
|
+
var name = cmd.name.padEnd(12);
|
|
304
|
+
this.output.writeln(" " + this.output.highlight(name) + " " + cmd.description);
|
|
246
305
|
}
|
|
247
306
|
this.output.writeln();
|
|
248
307
|
// Utility Commands
|
|
249
308
|
this.output.writeln(this.output.bold('UTILITY COMMANDS:'));
|
|
250
|
-
for (
|
|
309
|
+
for (var _d = 0, _e = commandsByCategory.utility; _d < _e.length; _d++) {
|
|
310
|
+
var cmd = _e[_d];
|
|
251
311
|
if (cmd.hidden)
|
|
252
312
|
continue;
|
|
253
|
-
|
|
254
|
-
this.output.writeln(
|
|
313
|
+
var name = cmd.name.padEnd(12);
|
|
314
|
+
this.output.writeln(" " + this.output.highlight(name) + " " + cmd.description);
|
|
255
315
|
}
|
|
256
316
|
this.output.writeln();
|
|
257
317
|
// Analysis Commands
|
|
258
318
|
this.output.writeln(this.output.bold('ANALYSIS COMMANDS:'));
|
|
259
|
-
for (
|
|
319
|
+
for (var _f = 0, _g = commandsByCategory.analysis; _f < _g.length; _f++) {
|
|
320
|
+
var cmd = _g[_f];
|
|
260
321
|
if (cmd.hidden)
|
|
261
322
|
continue;
|
|
262
|
-
|
|
263
|
-
this.output.writeln(
|
|
323
|
+
var name = cmd.name.padEnd(12);
|
|
324
|
+
this.output.writeln(" " + this.output.highlight(name) + " " + cmd.description);
|
|
264
325
|
}
|
|
265
326
|
this.output.writeln();
|
|
266
327
|
// Management Commands
|
|
267
328
|
this.output.writeln(this.output.bold('MANAGEMENT COMMANDS:'));
|
|
268
|
-
for (
|
|
329
|
+
for (var _h = 0, _j = commandsByCategory.management; _h < _j.length; _h++) {
|
|
330
|
+
var cmd = _j[_h];
|
|
269
331
|
if (cmd.hidden)
|
|
270
332
|
continue;
|
|
271
|
-
|
|
272
|
-
this.output.writeln(
|
|
333
|
+
var name = cmd.name.padEnd(12);
|
|
334
|
+
this.output.writeln(" " + this.output.highlight(name) + " " + cmd.description);
|
|
273
335
|
}
|
|
274
336
|
this.output.writeln();
|
|
275
337
|
this.output.writeln(this.output.bold('GLOBAL OPTIONS:'));
|
|
276
|
-
for (
|
|
277
|
-
|
|
278
|
-
|
|
338
|
+
for (var _k = 0, _l = this.parser.getGlobalOptions(); _k < _l.length; _k++) {
|
|
339
|
+
var opt = _l[_k];
|
|
340
|
+
var flags = opt.short ? "-" + opt.short + ", --" + opt.name : " --" + opt.name;
|
|
341
|
+
this.output.writeln(" " + flags.padEnd(25) + " " + opt.description);
|
|
279
342
|
}
|
|
280
343
|
this.output.writeln();
|
|
281
344
|
this.output.writeln(this.output.bold('V3 FEATURES:'));
|
|
@@ -289,133 +352,170 @@ export class CLI {
|
|
|
289
352
|
]);
|
|
290
353
|
this.output.writeln();
|
|
291
354
|
this.output.writeln(this.output.bold('EXAMPLES:'));
|
|
292
|
-
this.output.writeln(
|
|
293
|
-
this.output.writeln(
|
|
294
|
-
this.output.writeln(
|
|
295
|
-
this.output.writeln(
|
|
355
|
+
this.output.writeln(" " + this.name + " agent spawn -t coder # Spawn a coder agent");
|
|
356
|
+
this.output.writeln(" " + this.name + " swarm init --v3-mode # Initialize V3 swarm");
|
|
357
|
+
this.output.writeln(" " + this.name + " memory search -q \"auth patterns\" # Semantic search");
|
|
358
|
+
this.output.writeln(" " + this.name + " mcp start # Start MCP server");
|
|
296
359
|
this.output.writeln();
|
|
297
|
-
this.output.writeln(this.output.dim(
|
|
360
|
+
this.output.writeln(this.output.dim("Run \"" + this.name + " <command> --help\" for command help"));
|
|
298
361
|
this.output.writeln();
|
|
299
362
|
this.output.writeln(this.output.dim('Created with ❤️ by ruv.io'));
|
|
300
363
|
this.output.writeln();
|
|
301
|
-
}
|
|
364
|
+
};
|
|
302
365
|
/**
|
|
303
366
|
* Show command-specific help
|
|
304
367
|
*/
|
|
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
|
-
|
|
351
|
-
|
|
368
|
+
CLI.prototype.showCommandHelp = function (commandName) {
|
|
369
|
+
return __awaiter(this, void 0, Promise, function () {
|
|
370
|
+
var command, _i, _a, sub, name, aliases, _b, _c, opt, flags, required, defaultVal, _d, _e, example;
|
|
371
|
+
return __generator(this, function (_f) {
|
|
372
|
+
switch (_f.label) {
|
|
373
|
+
case 0:
|
|
374
|
+
command = getCommand(commandName);
|
|
375
|
+
if (!(!command && hasCommand(commandName))) return [3 /*break*/, 2];
|
|
376
|
+
return [4 /*yield*/, getCommandAsync(commandName)];
|
|
377
|
+
case 1:
|
|
378
|
+
command = _f.sent();
|
|
379
|
+
_f.label = 2;
|
|
380
|
+
case 2:
|
|
381
|
+
if (!command) {
|
|
382
|
+
this.output.printError("Unknown command: " + commandName);
|
|
383
|
+
return [2 /*return*/];
|
|
384
|
+
}
|
|
385
|
+
this.output.writeln();
|
|
386
|
+
this.output.writeln(this.output.bold(this.name + " " + command.name));
|
|
387
|
+
this.output.writeln(command.description);
|
|
388
|
+
this.output.writeln();
|
|
389
|
+
// Subcommands
|
|
390
|
+
if (command.subcommands && command.subcommands.length > 0) {
|
|
391
|
+
this.output.writeln(this.output.bold('SUBCOMMANDS:'));
|
|
392
|
+
for (_i = 0, _a = command.subcommands; _i < _a.length; _i++) {
|
|
393
|
+
sub = _a[_i];
|
|
394
|
+
if (sub.hidden)
|
|
395
|
+
continue;
|
|
396
|
+
name = sub.name.padEnd(15);
|
|
397
|
+
aliases = sub.aliases ? this.output.dim(" (" + sub.aliases.join(', ') + ")") : '';
|
|
398
|
+
this.output.writeln(" " + this.output.highlight(name) + " " + sub.description + aliases);
|
|
399
|
+
}
|
|
400
|
+
this.output.writeln();
|
|
401
|
+
}
|
|
402
|
+
// Options
|
|
403
|
+
if (command.options && command.options.length > 0) {
|
|
404
|
+
this.output.writeln(this.output.bold('OPTIONS:'));
|
|
405
|
+
for (_b = 0, _c = command.options; _b < _c.length; _b++) {
|
|
406
|
+
opt = _c[_b];
|
|
407
|
+
flags = opt.short ? "-" + opt.short + ", --" + opt.name : " --" + opt.name;
|
|
408
|
+
required = opt.required ? this.output.error(' (required)') : '';
|
|
409
|
+
defaultVal = opt["default"] !== undefined ? this.output.dim(" [default: " + opt["default"] + "]") : '';
|
|
410
|
+
this.output.writeln(" " + flags.padEnd(25) + " " + opt.description + required + defaultVal);
|
|
411
|
+
}
|
|
412
|
+
this.output.writeln();
|
|
413
|
+
}
|
|
414
|
+
// Examples
|
|
415
|
+
if (command.examples && command.examples.length > 0) {
|
|
416
|
+
this.output.writeln(this.output.bold('EXAMPLES:'));
|
|
417
|
+
for (_d = 0, _e = command.examples; _d < _e.length; _d++) {
|
|
418
|
+
example = _e[_d];
|
|
419
|
+
this.output.writeln(" " + this.output.dim('$') + " " + example.command);
|
|
420
|
+
this.output.writeln(" " + this.output.dim(example.description));
|
|
421
|
+
}
|
|
422
|
+
this.output.writeln();
|
|
423
|
+
}
|
|
424
|
+
return [2 /*return*/];
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
});
|
|
428
|
+
};
|
|
352
429
|
/**
|
|
353
430
|
* Show version
|
|
354
431
|
*/
|
|
355
|
-
showVersion() {
|
|
356
|
-
this.output.writeln(
|
|
357
|
-
}
|
|
432
|
+
CLI.prototype.showVersion = function () {
|
|
433
|
+
this.output.writeln(this.name + " v" + this.version);
|
|
434
|
+
};
|
|
358
435
|
/**
|
|
359
436
|
* Check for updates on startup (non-blocking)
|
|
360
437
|
* Shows notification if updates are available
|
|
361
438
|
*/
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
439
|
+
CLI.prototype.checkForUpdatesOnStartup = function () {
|
|
440
|
+
return __awaiter(this, void 0, Promise, function () {
|
|
441
|
+
var result, nonAutoUpdates, _a;
|
|
442
|
+
return __generator(this, function (_b) {
|
|
443
|
+
switch (_b.label) {
|
|
444
|
+
case 0:
|
|
445
|
+
_b.trys.push([0, 2, , 3]);
|
|
446
|
+
return [4 /*yield*/, runStartupUpdateCheck({ autoUpdate: true })];
|
|
447
|
+
case 1:
|
|
448
|
+
result = _b.sent();
|
|
449
|
+
// Show notifications for available updates that weren't auto-applied
|
|
450
|
+
if (result.checked && result.updatesAvailable.length > 0) {
|
|
451
|
+
nonAutoUpdates = result.updatesAvailable.filter(function (u) { return !u.shouldAutoUpdate; });
|
|
452
|
+
if (result.updatesApplied.length > 0) {
|
|
453
|
+
this.output.writeln(this.output.dim("Auto-updated: " + result.updatesApplied.join(', ')));
|
|
454
|
+
}
|
|
455
|
+
if (nonAutoUpdates.length > 0) {
|
|
456
|
+
this.output.writeln(this.output.dim("Updates available: " + nonAutoUpdates.map(function (u) { return u.package + "@" + u.latestVersion; }).join(', ')));
|
|
457
|
+
this.output.writeln(this.output.dim("Run '" + this.name + " update check' for details"));
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
return [3 /*break*/, 3];
|
|
461
|
+
case 2:
|
|
462
|
+
_a = _b.sent();
|
|
463
|
+
return [3 /*break*/, 3];
|
|
464
|
+
case 3: return [2 /*return*/];
|
|
374
465
|
}
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
// Silently fail - don't interrupt CLI usage
|
|
379
|
-
}
|
|
380
|
-
}
|
|
466
|
+
});
|
|
467
|
+
});
|
|
468
|
+
};
|
|
381
469
|
/**
|
|
382
470
|
* Load configuration file
|
|
383
471
|
*/
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
472
|
+
CLI.prototype.loadConfig = function (configPath) {
|
|
473
|
+
return __awaiter(this, void 0, Promise, function () {
|
|
474
|
+
var loadSystemConfig, systemConfigToV3Config, loaded, v3Config, _i, _a, warning, error_2;
|
|
475
|
+
return __generator(this, function (_b) {
|
|
476
|
+
switch (_b.label) {
|
|
477
|
+
case 0:
|
|
478
|
+
_b.trys.push([0, 4, , 5]);
|
|
479
|
+
return [4 /*yield*/, import('@claude-flow/shared')];
|
|
480
|
+
case 1:
|
|
481
|
+
loadSystemConfig = (_b.sent()).loadConfig;
|
|
482
|
+
return [4 /*yield*/, import('./config-adapter.js')];
|
|
483
|
+
case 2:
|
|
484
|
+
systemConfigToV3Config = (_b.sent()).systemConfigToV3Config;
|
|
485
|
+
return [4 /*yield*/, loadSystemConfig({
|
|
486
|
+
file: configPath,
|
|
487
|
+
paths: configPath ? undefined : [process.cwd()]
|
|
488
|
+
})];
|
|
489
|
+
case 3:
|
|
490
|
+
loaded = _b.sent();
|
|
491
|
+
v3Config = systemConfigToV3Config(loaded.config);
|
|
492
|
+
// Log warnings if any
|
|
493
|
+
if (loaded.warnings && loaded.warnings.length > 0) {
|
|
494
|
+
for (_i = 0, _a = loaded.warnings; _i < _a.length; _i++) {
|
|
495
|
+
warning = _a[_i];
|
|
496
|
+
this.output.printWarning(warning);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
return [2 /*return*/, v3Config];
|
|
500
|
+
case 4:
|
|
501
|
+
error_2 = _b.sent();
|
|
502
|
+
// Config loading is optional - don't fail if it doesn't exist
|
|
503
|
+
if (process.env.DEBUG) {
|
|
504
|
+
this.output.writeln(this.output.dim("Config loading failed: " + error_2.message));
|
|
505
|
+
}
|
|
506
|
+
return [2 /*return*/, undefined];
|
|
507
|
+
case 5: return [2 /*return*/];
|
|
400
508
|
}
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
catch (error) {
|
|
405
|
-
// Config loading is optional - don't fail if it doesn't exist
|
|
406
|
-
if (process.env.DEBUG) {
|
|
407
|
-
this.output.writeln(this.output.dim(`Config loading failed: ${error.message}`));
|
|
408
|
-
}
|
|
409
|
-
return undefined;
|
|
410
|
-
}
|
|
411
|
-
}
|
|
509
|
+
});
|
|
510
|
+
});
|
|
511
|
+
};
|
|
412
512
|
/**
|
|
413
513
|
* Handle errors
|
|
414
514
|
*/
|
|
415
|
-
handleError(error) {
|
|
515
|
+
CLI.prototype.handleError = function (error) {
|
|
416
516
|
if ('code' in error) {
|
|
417
517
|
// CLIError
|
|
418
|
-
|
|
518
|
+
var cliError = error;
|
|
419
519
|
this.output.printError(cliError.message);
|
|
420
520
|
if (cliError.details) {
|
|
421
521
|
this.output.writeln(this.output.dim(JSON.stringify(cliError.details, null, 2)));
|
|
@@ -431,8 +531,10 @@ export class CLI {
|
|
|
431
531
|
}
|
|
432
532
|
process.exit(1);
|
|
433
533
|
}
|
|
434
|
-
}
|
|
435
|
-
|
|
534
|
+
};
|
|
535
|
+
return CLI;
|
|
536
|
+
}());
|
|
537
|
+
export { CLI };
|
|
436
538
|
// =============================================================================
|
|
437
539
|
// Module Exports
|
|
438
540
|
// =============================================================================
|
|
@@ -441,24 +543,26 @@ export * from './types.js';
|
|
|
441
543
|
// Parser
|
|
442
544
|
export { CommandParser, commandParser } from './parser.js';
|
|
443
545
|
// Output
|
|
444
|
-
export { OutputFormatter, output, Progress, Spinner } from './output.js';
|
|
546
|
+
export { OutputFormatter, output, Progress, Spinner, type } from './output.js';
|
|
445
547
|
// Prompt
|
|
446
548
|
export * from './prompt.js';
|
|
447
549
|
// Commands (internal use)
|
|
448
550
|
export * from './commands/index.js';
|
|
449
551
|
// MCP Server management
|
|
450
|
-
export { MCPServerManager, createMCPServerManager, getServerManager, startMCPServer, stopMCPServer, getMCPServerStatus, } from './mcp-server.js';
|
|
552
|
+
export { MCPServerManager, createMCPServerManager, getServerManager, startMCPServer, stopMCPServer, getMCPServerStatus, type, type, } from './mcp-server.js';
|
|
451
553
|
// Memory & Intelligence (V3 Performance Features)
|
|
452
554
|
export { initializeMemoryDatabase, generateEmbedding, generateBatchEmbeddings, storeEntry, searchEntries, getHNSWIndex, addToHNSWIndex, searchHNSWIndex, getHNSWStatus, clearHNSWIndex, quantizeInt8, dequantizeInt8, quantizedCosineSim, getQuantizationStats,
|
|
453
555
|
// Flash Attention-style batch operations
|
|
454
|
-
batchCosineSim, softmaxAttention, topKIndices, flashAttentionSearch, } from './memory/memory-initializer.js';
|
|
556
|
+
batchCosineSim, softmaxAttention, topKIndices, flashAttentionSearch, type, } from './memory/memory-initializer.js';
|
|
455
557
|
export { initializeIntelligence, recordStep, recordTrajectory, findSimilarPatterns, getIntelligenceStats, getSonaCoordinator, getReasoningBank, clearIntelligence, benchmarkAdaptation,
|
|
558
|
+
// RL loop API
|
|
559
|
+
endTrajectoryWithVerdict, distillLearning,
|
|
456
560
|
// Pattern persistence API
|
|
457
|
-
getAllPatterns, getPatternsByType, flushPatterns, deletePattern, clearAllPatterns, getNeuralDataDir, getPersistenceStatus, } from './memory/intelligence.js';
|
|
561
|
+
getAllPatterns, getPatternsByType, flushPatterns, deletePattern, clearAllPatterns, getNeuralDataDir, getPersistenceStatus, type, type, type, type, } from './memory/intelligence.js';
|
|
458
562
|
// EWC++ Consolidation (Prevents Catastrophic Forgetting)
|
|
459
|
-
export { EWCConsolidator, getEWCConsolidator, resetEWCConsolidator, consolidatePatterns, recordPatternOutcome, getEWCStats, } from './memory/ewc-consolidation.js';
|
|
563
|
+
export { EWCConsolidator, getEWCConsolidator, resetEWCConsolidator, consolidatePatterns, recordPatternOutcome, getEWCStats, type, type, type, type, } from './memory/ewc-consolidation.js';
|
|
460
564
|
// SONA Optimizer (Adaptive Routing via Trajectory Learning)
|
|
461
|
-
export { SONAOptimizer, getSONAOptimizer, resetSONAOptimizer, processTrajectory, getSuggestion, getSONAStats, } from './memory/sona-optimizer.js';
|
|
565
|
+
export { SONAOptimizer, getSONAOptimizer, resetSONAOptimizer, processTrajectory, getSuggestion, getSONAStats, type, type, type, type, } from './memory/sona-optimizer.js';
|
|
462
566
|
// Production Hardening
|
|
463
567
|
export { ErrorHandler, withErrorHandling, } from './production/error-handler.js';
|
|
464
568
|
export { RateLimiter, createRateLimiter, } from './production/rate-limiter.js';
|