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
|
@@ -4,467 +4,595 @@
|
|
|
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 { output } from '../output.js';
|
|
8
53
|
// Benchmark subcommand - REAL measurements
|
|
9
|
-
|
|
54
|
+
var benchmarkCommand = {
|
|
10
55
|
name: 'benchmark',
|
|
11
56
|
description: 'Run performance benchmarks',
|
|
12
57
|
options: [
|
|
13
|
-
{ name: 'suite', short: 's', type: 'string', description: 'Benchmark suite: all, wasm, neural, memory, search', default: 'all' },
|
|
14
|
-
{ name: 'iterations', short: 'i', type: 'number', description: 'Number of iterations', default: '100' },
|
|
15
|
-
{ name: 'warmup', short: 'w', type: 'number', description: 'Warmup iterations', default: '10' },
|
|
16
|
-
{ name: 'output', short: 'o', type: 'string', description: 'Output format: text, json, csv', default: 'text' },
|
|
58
|
+
{ name: 'suite', short: 's', type: 'string', description: 'Benchmark suite: all, wasm, neural, memory, search', "default": 'all' },
|
|
59
|
+
{ name: 'iterations', short: 'i', type: 'number', description: 'Number of iterations', "default": '100' },
|
|
60
|
+
{ name: 'warmup', short: 'w', type: 'number', description: 'Warmup iterations', "default": '10' },
|
|
61
|
+
{ name: 'output', short: 'o', type: 'string', description: 'Output format: text, json, csv', "default": 'text' },
|
|
17
62
|
],
|
|
18
63
|
examples: [
|
|
19
64
|
{ command: 'claude-flow performance benchmark -s neural', description: 'Benchmark neural operations' },
|
|
20
65
|
{ command: 'claude-flow performance benchmark -i 1000', description: 'Run with 1000 iterations' },
|
|
21
66
|
],
|
|
22
|
-
action:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
116
|
-
|
|
67
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
68
|
+
var suite, iterations, warmup, outputFormat, spinner, _a, generateEmbedding, batchCosineSim, flashAttentionSearch, getHNSWStatus, storeEntry, searchEntries, _b, benchmarkAdaptation, initializeIntelligence, results, startTotal, percentile, embedTimes, i, i, start, mean, flashTimes, testVectors, queryVector, i, i, start, mean, baselineMs, speedup, hnswStatus, searchTimes, testQueries, _i, _c, q, i, query, start, mean, baselineBruteForce, speedup, sonaResult, storeTimes, i, start, mean, totalTime, allTargetsMet;
|
|
69
|
+
return __generator(this, function (_d) {
|
|
70
|
+
switch (_d.label) {
|
|
71
|
+
case 0:
|
|
72
|
+
suite = ctx.flags.suite || 'all';
|
|
73
|
+
iterations = parseInt(ctx.flags.iterations || '100', 10);
|
|
74
|
+
warmup = parseInt(ctx.flags.warmup || '10', 10);
|
|
75
|
+
outputFormat = ctx.flags.output || 'text';
|
|
76
|
+
output.writeln();
|
|
77
|
+
output.writeln(output.bold('Performance Benchmark (Real Measurements)'));
|
|
78
|
+
output.writeln(output.dim('─'.repeat(60)));
|
|
79
|
+
spinner = output.createSpinner({ text: "Running " + suite + " benchmarks...", spinner: 'dots' });
|
|
80
|
+
spinner.start();
|
|
81
|
+
return [4 /*yield*/, import('../memory/memory-initializer.js')];
|
|
82
|
+
case 1:
|
|
83
|
+
_a = _d.sent(), generateEmbedding = _a.generateEmbedding, batchCosineSim = _a.batchCosineSim, flashAttentionSearch = _a.flashAttentionSearch, getHNSWStatus = _a.getHNSWStatus, storeEntry = _a.storeEntry, searchEntries = _a.searchEntries;
|
|
84
|
+
return [4 /*yield*/, import('../memory/intelligence.js')];
|
|
85
|
+
case 2:
|
|
86
|
+
_b = _d.sent(), benchmarkAdaptation = _b.benchmarkAdaptation, initializeIntelligence = _b.initializeIntelligence;
|
|
87
|
+
results = [];
|
|
88
|
+
startTotal = Date.now();
|
|
89
|
+
percentile = function (arr, p) {
|
|
90
|
+
var sorted = __spreadArray([], arr, true).sort(function (a, b) { return a - b; });
|
|
91
|
+
var idx = Math.ceil((p / 100) * sorted.length) - 1;
|
|
92
|
+
return sorted[Math.max(0, idx)];
|
|
93
|
+
};
|
|
94
|
+
if (!(suite === 'all' || suite === 'neural' || suite === 'memory')) return [3 /*break*/, 11];
|
|
95
|
+
spinner.setText('Benchmarking embedding generation...');
|
|
96
|
+
embedTimes = [];
|
|
97
|
+
i = 0;
|
|
98
|
+
_d.label = 3;
|
|
99
|
+
case 3:
|
|
100
|
+
if (!(i < warmup)) return [3 /*break*/, 6];
|
|
101
|
+
return [4 /*yield*/, generateEmbedding("warmup text " + i)];
|
|
102
|
+
case 4:
|
|
103
|
+
_d.sent();
|
|
104
|
+
_d.label = 5;
|
|
105
|
+
case 5:
|
|
106
|
+
i++;
|
|
107
|
+
return [3 /*break*/, 3];
|
|
108
|
+
case 6:
|
|
109
|
+
i = 0;
|
|
110
|
+
_d.label = 7;
|
|
111
|
+
case 7:
|
|
112
|
+
if (!(i < iterations)) return [3 /*break*/, 10];
|
|
113
|
+
start = performance.now();
|
|
114
|
+
return [4 /*yield*/, generateEmbedding("benchmark text number " + i + " with some varied content")];
|
|
115
|
+
case 8:
|
|
116
|
+
_d.sent();
|
|
117
|
+
embedTimes.push(performance.now() - start);
|
|
118
|
+
_d.label = 9;
|
|
119
|
+
case 9:
|
|
120
|
+
i++;
|
|
121
|
+
return [3 /*break*/, 7];
|
|
122
|
+
case 10:
|
|
123
|
+
mean = embedTimes.reduce(function (a, b) { return a + b; }, 0) / embedTimes.length;
|
|
124
|
+
results.push({
|
|
125
|
+
operation: 'Embedding Gen',
|
|
126
|
+
mean: mean.toFixed(2) + "ms",
|
|
127
|
+
p95: percentile(embedTimes, 95).toFixed(2) + "ms",
|
|
128
|
+
p99: percentile(embedTimes, 99).toFixed(2) + "ms",
|
|
129
|
+
improvement: mean < 10 ? output.success('Target met') : output.warning('Below target')
|
|
130
|
+
});
|
|
131
|
+
_d.label = 11;
|
|
132
|
+
case 11:
|
|
133
|
+
// 2. Flash Attention-style Batch Operations
|
|
134
|
+
if (suite === 'all' || suite === 'wasm') {
|
|
135
|
+
spinner.setText('Benchmarking Flash Attention batch ops...');
|
|
136
|
+
flashTimes = [];
|
|
137
|
+
testVectors = Array.from({ length: 100 }, function () {
|
|
138
|
+
return new Float32Array(Array.from({ length: 384 }, function () { return Math.random(); }));
|
|
139
|
+
});
|
|
140
|
+
queryVector = new Float32Array(Array.from({ length: 384 }, function () { return Math.random(); }));
|
|
141
|
+
// Warmup
|
|
142
|
+
for (i = 0; i < warmup; i++) {
|
|
143
|
+
batchCosineSim(queryVector, testVectors);
|
|
144
|
+
}
|
|
145
|
+
// Actual measurement
|
|
146
|
+
for (i = 0; i < iterations; i++) {
|
|
147
|
+
start = performance.now();
|
|
148
|
+
flashAttentionSearch(queryVector, testVectors, { k: 10 });
|
|
149
|
+
flashTimes.push(performance.now() - start);
|
|
150
|
+
}
|
|
151
|
+
mean = flashTimes.reduce(function (a, b) { return a + b; }, 0) / flashTimes.length;
|
|
152
|
+
baselineMs = 0.05;
|
|
153
|
+
speedup = baselineMs / mean;
|
|
154
|
+
results.push({
|
|
155
|
+
operation: 'Flash Attention',
|
|
156
|
+
mean: mean.toFixed(3) + "ms",
|
|
157
|
+
p95: percentile(flashTimes, 95).toFixed(3) + "ms",
|
|
158
|
+
p99: percentile(flashTimes, 99).toFixed(3) + "ms",
|
|
159
|
+
improvement: speedup > 1 ? output.success(speedup.toFixed(2) + "x") : output.dim(speedup.toFixed(2) + "x")
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
if (!(suite === 'all' || suite === 'search')) return [3 /*break*/, 21];
|
|
163
|
+
spinner.setText('Benchmarking HNSW search...');
|
|
164
|
+
hnswStatus = getHNSWStatus();
|
|
165
|
+
if (!(hnswStatus.available && hnswStatus.entryCount > 0)) return [3 /*break*/, 20];
|
|
166
|
+
searchTimes = [];
|
|
167
|
+
testQueries = [
|
|
168
|
+
'error handling patterns',
|
|
169
|
+
'authentication flow',
|
|
170
|
+
'database optimization',
|
|
171
|
+
'API design patterns',
|
|
172
|
+
'test coverage strategies',
|
|
173
|
+
];
|
|
174
|
+
_i = 0, _c = testQueries.slice(0, 2);
|
|
175
|
+
_d.label = 12;
|
|
176
|
+
case 12:
|
|
177
|
+
if (!(_i < _c.length)) return [3 /*break*/, 15];
|
|
178
|
+
q = _c[_i];
|
|
179
|
+
return [4 /*yield*/, searchEntries({ query: q, limit: 10 })];
|
|
180
|
+
case 13:
|
|
181
|
+
_d.sent();
|
|
182
|
+
_d.label = 14;
|
|
183
|
+
case 14:
|
|
184
|
+
_i++;
|
|
185
|
+
return [3 /*break*/, 12];
|
|
186
|
+
case 15:
|
|
187
|
+
i = 0;
|
|
188
|
+
_d.label = 16;
|
|
189
|
+
case 16:
|
|
190
|
+
if (!(i < Math.min(iterations, 50))) return [3 /*break*/, 19];
|
|
191
|
+
query = testQueries[i % testQueries.length];
|
|
192
|
+
start = performance.now();
|
|
193
|
+
return [4 /*yield*/, searchEntries({ query: query, limit: 10 })];
|
|
194
|
+
case 17:
|
|
195
|
+
_d.sent();
|
|
117
196
|
searchTimes.push(performance.now() - start);
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
197
|
+
_d.label = 18;
|
|
198
|
+
case 18:
|
|
199
|
+
i++;
|
|
200
|
+
return [3 /*break*/, 16];
|
|
201
|
+
case 19:
|
|
202
|
+
mean = searchTimes.reduce(function (a, b) { return a + b; }, 0) / searchTimes.length;
|
|
203
|
+
baselineBruteForce = hnswStatus.entryCount * 0.0005;
|
|
204
|
+
speedup = baselineBruteForce / (mean / 1000);
|
|
205
|
+
results.push({
|
|
206
|
+
operation: "HNSW Search (n=" + hnswStatus.entryCount + ")",
|
|
207
|
+
mean: mean.toFixed(2) + "ms",
|
|
208
|
+
p95: percentile(searchTimes, 95).toFixed(2) + "ms",
|
|
209
|
+
p99: percentile(searchTimes, 99).toFixed(2) + "ms",
|
|
210
|
+
improvement: speedup > 10 ? output.success("~" + Math.round(speedup) + "x") : output.dim(speedup.toFixed(1) + "x")
|
|
211
|
+
});
|
|
212
|
+
return [3 /*break*/, 21];
|
|
213
|
+
case 20:
|
|
214
|
+
results.push({
|
|
215
|
+
operation: 'HNSW Search',
|
|
216
|
+
mean: 'N/A',
|
|
217
|
+
p95: 'N/A',
|
|
218
|
+
p99: 'N/A',
|
|
219
|
+
improvement: output.warning('No index')
|
|
220
|
+
});
|
|
221
|
+
_d.label = 21;
|
|
222
|
+
case 21:
|
|
223
|
+
if (!(suite === 'all' || suite === 'neural')) return [3 /*break*/, 23];
|
|
224
|
+
spinner.setText('Benchmarking SONA adaptation...');
|
|
225
|
+
return [4 /*yield*/, initializeIntelligence()];
|
|
226
|
+
case 22:
|
|
227
|
+
_d.sent();
|
|
228
|
+
sonaResult = benchmarkAdaptation(iterations);
|
|
229
|
+
results.push({
|
|
230
|
+
operation: 'SONA Adaptation',
|
|
231
|
+
mean: (sonaResult.avgMs * 1000).toFixed(2) + "\u03BCs",
|
|
232
|
+
p95: (sonaResult.maxMs * 1000).toFixed(2) + "\u03BCs",
|
|
233
|
+
p99: (sonaResult.maxMs * 1000).toFixed(2) + "\u03BCs",
|
|
234
|
+
improvement: sonaResult.targetMet ? output.success('<0.05ms ✓') : output.warning('Above target')
|
|
235
|
+
});
|
|
236
|
+
_d.label = 23;
|
|
237
|
+
case 23:
|
|
238
|
+
if (!(suite === 'all' || suite === 'memory')) return [3 /*break*/, 28];
|
|
239
|
+
spinner.setText('Benchmarking memory operations...');
|
|
240
|
+
storeTimes = [];
|
|
241
|
+
i = 0;
|
|
242
|
+
_d.label = 24;
|
|
243
|
+
case 24:
|
|
244
|
+
if (!(i < Math.min(iterations, 20))) return [3 /*break*/, 27];
|
|
245
|
+
start = performance.now();
|
|
246
|
+
return [4 /*yield*/, storeEntry({
|
|
247
|
+
key: "bench_" + Date.now() + "_" + i,
|
|
248
|
+
value: "Benchmark test entry " + i + " with some content for testing storage performance",
|
|
249
|
+
namespace: 'benchmark',
|
|
250
|
+
generateEmbeddingFlag: true
|
|
251
|
+
})];
|
|
252
|
+
case 25:
|
|
253
|
+
_d.sent();
|
|
254
|
+
storeTimes.push(performance.now() - start);
|
|
255
|
+
_d.label = 26;
|
|
256
|
+
case 26:
|
|
257
|
+
i++;
|
|
258
|
+
return [3 /*break*/, 24];
|
|
259
|
+
case 27:
|
|
260
|
+
mean = storeTimes.reduce(function (a, b) { return a + b; }, 0) / storeTimes.length;
|
|
261
|
+
results.push({
|
|
262
|
+
operation: 'Memory Store+Embed',
|
|
263
|
+
mean: mean.toFixed(1) + "ms",
|
|
264
|
+
p95: percentile(storeTimes, 95).toFixed(1) + "ms",
|
|
265
|
+
p99: percentile(storeTimes, 99).toFixed(1) + "ms",
|
|
266
|
+
improvement: mean < 50 ? output.success('Target met') : output.warning('Slow')
|
|
267
|
+
});
|
|
268
|
+
_d.label = 28;
|
|
269
|
+
case 28:
|
|
270
|
+
totalTime = ((Date.now() - startTotal) / 1000).toFixed(2);
|
|
271
|
+
spinner.succeed("Completed " + iterations + " iterations in " + totalTime + "s");
|
|
272
|
+
// Output results
|
|
273
|
+
if (outputFormat === 'json') {
|
|
274
|
+
output.printJson({ suite: suite, iterations: iterations, totalTime: totalTime + "s", results: results });
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
output.writeln();
|
|
278
|
+
output.printTable({
|
|
279
|
+
columns: [
|
|
280
|
+
{ key: 'operation', header: 'Operation', width: 22 },
|
|
281
|
+
{ key: 'mean', header: 'Mean', width: 12 },
|
|
282
|
+
{ key: 'p95', header: 'P95', width: 12 },
|
|
283
|
+
{ key: 'p99', header: 'P99', width: 12 },
|
|
284
|
+
{ key: 'improvement', header: 'Status', width: 15 },
|
|
285
|
+
],
|
|
286
|
+
data: results
|
|
287
|
+
});
|
|
288
|
+
output.writeln();
|
|
289
|
+
allTargetsMet = results.every(function (r) { return !r.improvement.includes('warning') && !r.improvement.includes('Slow'); });
|
|
290
|
+
output.printBox([
|
|
291
|
+
"Suite: " + suite,
|
|
292
|
+
"Iterations: " + iterations,
|
|
293
|
+
"Total Time: " + totalTime + "s",
|
|
294
|
+
"",
|
|
295
|
+
"Overall: " + (allTargetsMet ? output.success('All targets met') : output.warning('Some targets missed')),
|
|
296
|
+
].join('\n'), 'Benchmark Summary');
|
|
297
|
+
}
|
|
298
|
+
return [2 /*return*/, { success: true, data: { results: results, totalTime: totalTime } }];
|
|
140
299
|
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (suite === 'all' || suite === 'neural') {
|
|
144
|
-
spinner.setText('Benchmarking SONA adaptation...');
|
|
145
|
-
await initializeIntelligence();
|
|
146
|
-
const sonaResult = benchmarkAdaptation(iterations);
|
|
147
|
-
results.push({
|
|
148
|
-
operation: 'SONA Adaptation',
|
|
149
|
-
mean: `${(sonaResult.avgMs * 1000).toFixed(2)}μs`,
|
|
150
|
-
p95: `${(sonaResult.maxMs * 1000).toFixed(2)}μs`,
|
|
151
|
-
p99: `${(sonaResult.maxMs * 1000).toFixed(2)}μs`,
|
|
152
|
-
improvement: sonaResult.targetMet ? output.success('<0.05ms ✓') : output.warning('Above target'),
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
// 5. Memory Store/Retrieve
|
|
156
|
-
if (suite === 'all' || suite === 'memory') {
|
|
157
|
-
spinner.setText('Benchmarking memory operations...');
|
|
158
|
-
const storeTimes = [];
|
|
159
|
-
// Use in-memory operations for benchmark (don't persist)
|
|
160
|
-
for (let i = 0; i < Math.min(iterations, 20); i++) {
|
|
161
|
-
const start = performance.now();
|
|
162
|
-
await storeEntry({
|
|
163
|
-
key: `bench_${Date.now()}_${i}`,
|
|
164
|
-
value: `Benchmark test entry ${i} with some content for testing storage performance`,
|
|
165
|
-
namespace: 'benchmark',
|
|
166
|
-
generateEmbeddingFlag: true,
|
|
167
|
-
});
|
|
168
|
-
storeTimes.push(performance.now() - start);
|
|
169
|
-
}
|
|
170
|
-
const mean = storeTimes.reduce((a, b) => a + b, 0) / storeTimes.length;
|
|
171
|
-
results.push({
|
|
172
|
-
operation: 'Memory Store+Embed',
|
|
173
|
-
mean: `${mean.toFixed(1)}ms`,
|
|
174
|
-
p95: `${percentile(storeTimes, 95).toFixed(1)}ms`,
|
|
175
|
-
p99: `${percentile(storeTimes, 99).toFixed(1)}ms`,
|
|
176
|
-
improvement: mean < 50 ? output.success('Target met') : output.warning('Slow'),
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
const totalTime = ((Date.now() - startTotal) / 1000).toFixed(2);
|
|
180
|
-
spinner.succeed(`Completed ${iterations} iterations in ${totalTime}s`);
|
|
181
|
-
// Output results
|
|
182
|
-
if (outputFormat === 'json') {
|
|
183
|
-
output.printJson({ suite, iterations, totalTime: `${totalTime}s`, results });
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
output.writeln();
|
|
187
|
-
output.printTable({
|
|
188
|
-
columns: [
|
|
189
|
-
{ key: 'operation', header: 'Operation', width: 22 },
|
|
190
|
-
{ key: 'mean', header: 'Mean', width: 12 },
|
|
191
|
-
{ key: 'p95', header: 'P95', width: 12 },
|
|
192
|
-
{ key: 'p99', header: 'P99', width: 12 },
|
|
193
|
-
{ key: 'improvement', header: 'Status', width: 15 },
|
|
194
|
-
],
|
|
195
|
-
data: results,
|
|
196
|
-
});
|
|
197
|
-
output.writeln();
|
|
198
|
-
const allTargetsMet = results.every(r => !r.improvement.includes('warning') && !r.improvement.includes('Slow'));
|
|
199
|
-
output.printBox([
|
|
200
|
-
`Suite: ${suite}`,
|
|
201
|
-
`Iterations: ${iterations}`,
|
|
202
|
-
`Total Time: ${totalTime}s`,
|
|
203
|
-
``,
|
|
204
|
-
`Overall: ${allTargetsMet ? output.success('All targets met') : output.warning('Some targets missed')}`,
|
|
205
|
-
].join('\n'), 'Benchmark Summary');
|
|
206
|
-
}
|
|
207
|
-
return { success: true, data: { results, totalTime } };
|
|
208
|
-
},
|
|
300
|
+
});
|
|
301
|
+
}); }
|
|
209
302
|
};
|
|
210
303
|
// Profile subcommand
|
|
211
|
-
|
|
304
|
+
var profileCommand = {
|
|
212
305
|
name: 'profile',
|
|
213
306
|
description: 'Profile application performance',
|
|
214
307
|
options: [
|
|
215
|
-
{ name: 'type', short: 't', type: 'string', description: 'Profile type: cpu, memory, io, all', default: 'all' },
|
|
216
|
-
{ name: 'duration', short: 'd', type: 'number', description: 'Duration in seconds', default: '30' },
|
|
308
|
+
{ name: 'type', short: 't', type: 'string', description: 'Profile type: cpu, memory, io, all', "default": 'all' },
|
|
309
|
+
{ name: 'duration', short: 'd', type: 'number', description: 'Duration in seconds', "default": '30' },
|
|
217
310
|
{ name: 'output', short: 'o', type: 'string', description: 'Output file for profile data' },
|
|
218
311
|
],
|
|
219
312
|
examples: [
|
|
220
313
|
{ command: 'claude-flow performance profile -t cpu', description: 'Profile CPU usage' },
|
|
221
314
|
{ command: 'claude-flow performance profile -d 60', description: 'Profile for 60 seconds' },
|
|
222
315
|
],
|
|
223
|
-
action:
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
316
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
317
|
+
var type, duration, spinner, startCpu, startMem, startTime, endCpu, endMem, endTime, elapsedMs, cpuPercent, heapUsedMB, heapTotalMB, rssMB, externalMB, lagStart, eventLoopLag, heapStatus, lagStatus;
|
|
318
|
+
return __generator(this, function (_a) {
|
|
319
|
+
switch (_a.label) {
|
|
320
|
+
case 0:
|
|
321
|
+
type = ctx.flags.type || 'all';
|
|
322
|
+
duration = parseInt(ctx.flags.duration || '30', 10);
|
|
323
|
+
output.writeln();
|
|
324
|
+
output.writeln(output.bold('Performance Profiler'));
|
|
325
|
+
output.writeln(output.dim('─'.repeat(50)));
|
|
326
|
+
spinner = output.createSpinner({ text: 'Collecting profile data...', spinner: 'dots' });
|
|
327
|
+
spinner.start();
|
|
328
|
+
startCpu = process.cpuUsage();
|
|
329
|
+
startMem = process.memoryUsage();
|
|
330
|
+
startTime = process.hrtime.bigint();
|
|
331
|
+
// Sample for a brief period
|
|
332
|
+
return [4 /*yield*/, new Promise(function (r) { return setTimeout(r, Math.min(duration * 100, 2000)); })];
|
|
333
|
+
case 1:
|
|
334
|
+
// Sample for a brief period
|
|
335
|
+
_a.sent();
|
|
336
|
+
endCpu = process.cpuUsage(startCpu);
|
|
337
|
+
endMem = process.memoryUsage();
|
|
338
|
+
endTime = process.hrtime.bigint();
|
|
339
|
+
spinner.succeed('Profile complete');
|
|
340
|
+
elapsedMs = Number(endTime - startTime) / 1000000;
|
|
341
|
+
cpuPercent = ((endCpu.user + endCpu.system) / 1000 / elapsedMs * 100).toFixed(1);
|
|
342
|
+
heapUsedMB = (endMem.heapUsed / 1024 / 1024).toFixed(1);
|
|
343
|
+
heapTotalMB = (endMem.heapTotal / 1024 / 1024).toFixed(1);
|
|
344
|
+
rssMB = (endMem.rss / 1024 / 1024).toFixed(1);
|
|
345
|
+
externalMB = (endMem.external / 1024 / 1024).toFixed(1);
|
|
346
|
+
lagStart = Date.now();
|
|
347
|
+
return [4 /*yield*/, new Promise(function (r) { return setImmediate(r); })];
|
|
348
|
+
case 2:
|
|
349
|
+
_a.sent();
|
|
350
|
+
eventLoopLag = (Date.now() - lagStart).toFixed(1);
|
|
351
|
+
heapStatus = endMem.heapUsed / endMem.heapTotal > 0.9 ? output.error('High') :
|
|
352
|
+
endMem.heapUsed / endMem.heapTotal > 0.7 ? output.warning('Elevated') : output.success('Normal');
|
|
353
|
+
lagStatus = parseFloat(eventLoopLag) > 50 ? output.error('High') :
|
|
354
|
+
parseFloat(eventLoopLag) > 10 ? output.warning('Elevated') : output.success('Normal');
|
|
355
|
+
output.writeln();
|
|
356
|
+
output.printTable({
|
|
357
|
+
columns: [
|
|
358
|
+
{ key: 'metric', header: 'Metric', width: 25 },
|
|
359
|
+
{ key: 'current', header: 'Current', width: 15 },
|
|
360
|
+
{ key: 'peak', header: 'Peak/Total', width: 15 },
|
|
361
|
+
{ key: 'status', header: 'Status', width: 15 },
|
|
362
|
+
],
|
|
363
|
+
data: [
|
|
364
|
+
{ metric: 'CPU Usage', current: cpuPercent + "%", peak: '-', status: output.success('Sampled') },
|
|
365
|
+
{ metric: 'Memory (Heap Used)', current: heapUsedMB + " MB", peak: heapTotalMB + " MB", status: heapStatus },
|
|
366
|
+
{ metric: 'Memory (RSS)', current: rssMB + " MB", peak: '-', status: output.success('Normal') },
|
|
367
|
+
{ metric: 'Memory (External)', current: externalMB + " MB", peak: '-', status: output.success('Normal') },
|
|
368
|
+
{ metric: 'Event Loop Lag', current: eventLoopLag + "ms", peak: '-', status: lagStatus },
|
|
369
|
+
{ metric: 'Node.js Uptime', current: process.uptime().toFixed(1) + "s", peak: '-', status: output.success('Running') },
|
|
370
|
+
]
|
|
371
|
+
});
|
|
372
|
+
output.writeln();
|
|
373
|
+
output.writeln(output.dim("Profile duration: " + elapsedMs.toFixed(0) + "ms"));
|
|
374
|
+
return [2 /*return*/, { success: true }];
|
|
375
|
+
}
|
|
273
376
|
});
|
|
274
|
-
|
|
275
|
-
output.writeln(output.dim(`Profile duration: ${elapsedMs.toFixed(0)}ms`));
|
|
276
|
-
return { success: true };
|
|
277
|
-
},
|
|
377
|
+
}); }
|
|
278
378
|
};
|
|
279
379
|
// Metrics subcommand
|
|
280
|
-
|
|
380
|
+
var metricsCommand = {
|
|
281
381
|
name: 'metrics',
|
|
282
382
|
description: 'View and export performance metrics',
|
|
283
383
|
options: [
|
|
284
|
-
{ name: 'timeframe', short: 't', type: 'string', description: 'Timeframe: 1h, 24h, 7d, 30d', default: '24h' },
|
|
285
|
-
{ name: 'format', short: 'f', type: 'string', description: 'Output format: text, json, prometheus', default: 'text' },
|
|
384
|
+
{ name: 'timeframe', short: 't', type: 'string', description: 'Timeframe: 1h, 24h, 7d, 30d', "default": '24h' },
|
|
385
|
+
{ name: 'format', short: 'f', type: 'string', description: 'Output format: text, json, prometheus', "default": 'text' },
|
|
286
386
|
{ name: 'component', short: 'c', type: 'string', description: 'Component to filter' },
|
|
287
387
|
],
|
|
288
388
|
examples: [
|
|
289
389
|
{ command: 'claude-flow performance metrics -t 7d', description: 'Show 7-day metrics' },
|
|
290
390
|
{ command: 'claude-flow performance metrics -f prometheus', description: 'Export as Prometheus format' },
|
|
291
391
|
],
|
|
292
|
-
action:
|
|
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
|
-
|
|
392
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
393
|
+
var timeframe, format, os, fs, path, memUsage, cpuUsage, uptime, loadAvg, freeMem, totalMem, heapUsedMB, heapTotalMB, rssMB, memPercent, cpuUserMs, cpuSystemMs, cacheHitRate, hnswEntries, getHNSWStatus, status, _a, cacheEntries, cachePath, stats, avgLatencyMs, times, i, start, _b, metrics;
|
|
394
|
+
return __generator(this, function (_c) {
|
|
395
|
+
switch (_c.label) {
|
|
396
|
+
case 0:
|
|
397
|
+
timeframe = ctx.flags.timeframe || '24h';
|
|
398
|
+
format = ctx.flags.format || 'text';
|
|
399
|
+
output.writeln();
|
|
400
|
+
output.writeln(output.bold("Performance Metrics (" + timeframe + ")"));
|
|
401
|
+
output.writeln(output.dim('─'.repeat(50)));
|
|
402
|
+
return [4 /*yield*/, import('os')];
|
|
403
|
+
case 1:
|
|
404
|
+
os = _c.sent();
|
|
405
|
+
return [4 /*yield*/, import('fs')];
|
|
406
|
+
case 2:
|
|
407
|
+
fs = _c.sent();
|
|
408
|
+
return [4 /*yield*/, import('path')];
|
|
409
|
+
case 3:
|
|
410
|
+
path = _c.sent();
|
|
411
|
+
memUsage = process.memoryUsage();
|
|
412
|
+
cpuUsage = process.cpuUsage();
|
|
413
|
+
uptime = process.uptime();
|
|
414
|
+
loadAvg = os.loadavg();
|
|
415
|
+
freeMem = os.freemem();
|
|
416
|
+
totalMem = os.totalmem();
|
|
417
|
+
heapUsedMB = (memUsage.heapUsed / 1024 / 1024).toFixed(1);
|
|
418
|
+
heapTotalMB = (memUsage.heapTotal / 1024 / 1024).toFixed(1);
|
|
419
|
+
rssMB = (memUsage.rss / 1024 / 1024).toFixed(1);
|
|
420
|
+
memPercent = ((1 - freeMem / totalMem) * 100).toFixed(1);
|
|
421
|
+
cpuUserMs = (cpuUsage.user / 1000).toFixed(0);
|
|
422
|
+
cpuSystemMs = (cpuUsage.system / 1000).toFixed(0);
|
|
423
|
+
cacheHitRate = 'N/A';
|
|
424
|
+
hnswEntries = 0;
|
|
425
|
+
_c.label = 4;
|
|
426
|
+
case 4:
|
|
427
|
+
_c.trys.push([4, 6, , 7]);
|
|
428
|
+
return [4 /*yield*/, import('../memory/memory-initializer.js')];
|
|
429
|
+
case 5:
|
|
430
|
+
getHNSWStatus = (_c.sent()).getHNSWStatus;
|
|
431
|
+
status = getHNSWStatus();
|
|
432
|
+
hnswEntries = (status === null || status === void 0 ? void 0 : status.entryCount) || 0;
|
|
433
|
+
return [3 /*break*/, 7];
|
|
434
|
+
case 6:
|
|
435
|
+
_a = _c.sent();
|
|
436
|
+
return [3 /*break*/, 7];
|
|
437
|
+
case 7:
|
|
438
|
+
cacheEntries = 0;
|
|
439
|
+
try {
|
|
440
|
+
cachePath = path.resolve('.cache/embeddings.db');
|
|
441
|
+
if (fs.existsSync(cachePath)) {
|
|
442
|
+
stats = fs.statSync(cachePath);
|
|
443
|
+
cacheEntries = Math.floor(stats.size / 1600); // Approximate entries
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
catch ( /* no cache */_d) { /* no cache */ }
|
|
447
|
+
avgLatencyMs = 0;
|
|
448
|
+
_c.label = 8;
|
|
449
|
+
case 8:
|
|
450
|
+
_c.trys.push([8, 13, , 14]);
|
|
451
|
+
times = [];
|
|
452
|
+
i = 0;
|
|
453
|
+
_c.label = 9;
|
|
454
|
+
case 9:
|
|
455
|
+
if (!(i < 10)) return [3 /*break*/, 12];
|
|
456
|
+
start = performance.now();
|
|
457
|
+
return [4 /*yield*/, new Promise(function (r) { return setImmediate(r); })];
|
|
458
|
+
case 10:
|
|
459
|
+
_c.sent(); // Event loop turn
|
|
460
|
+
times.push(performance.now() - start);
|
|
461
|
+
_c.label = 11;
|
|
462
|
+
case 11:
|
|
463
|
+
i++;
|
|
464
|
+
return [3 /*break*/, 9];
|
|
465
|
+
case 12:
|
|
466
|
+
avgLatencyMs = times.reduce(function (a, b) { return a + b; }, 0) / times.length;
|
|
467
|
+
return [3 /*break*/, 14];
|
|
468
|
+
case 13:
|
|
469
|
+
_b = _c.sent();
|
|
470
|
+
return [3 /*break*/, 14];
|
|
471
|
+
case 14:
|
|
472
|
+
// JSON/Prometheus output
|
|
473
|
+
if (format === 'json') {
|
|
474
|
+
metrics = {
|
|
475
|
+
timestamp: new Date().toISOString(),
|
|
476
|
+
timeframe: timeframe,
|
|
477
|
+
memory: {
|
|
478
|
+
heapUsed: memUsage.heapUsed,
|
|
479
|
+
heapTotal: memUsage.heapTotal,
|
|
480
|
+
rss: memUsage.rss,
|
|
481
|
+
external: memUsage.external,
|
|
482
|
+
systemPercent: parseFloat(memPercent)
|
|
483
|
+
},
|
|
484
|
+
cpu: {
|
|
485
|
+
user: cpuUsage.user,
|
|
486
|
+
system: cpuUsage.system,
|
|
487
|
+
loadAverage: loadAvg
|
|
488
|
+
},
|
|
489
|
+
process: {
|
|
490
|
+
uptime: uptime,
|
|
491
|
+
pid: process.pid
|
|
492
|
+
},
|
|
493
|
+
cache: {
|
|
494
|
+
entries: cacheEntries,
|
|
495
|
+
hnswEntries: hnswEntries
|
|
496
|
+
},
|
|
497
|
+
latency: {
|
|
498
|
+
avgMs: avgLatencyMs
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
output.writeln(JSON.stringify(metrics, null, 2));
|
|
502
|
+
return [2 /*return*/, { success: true }];
|
|
503
|
+
}
|
|
504
|
+
if (format === 'prometheus') {
|
|
505
|
+
output.writeln("# HELP claude_flow_heap_used_bytes Heap memory used");
|
|
506
|
+
output.writeln("claude_flow_heap_used_bytes " + memUsage.heapUsed);
|
|
507
|
+
output.writeln("# HELP claude_flow_heap_total_bytes Total heap memory");
|
|
508
|
+
output.writeln("claude_flow_heap_total_bytes " + memUsage.heapTotal);
|
|
509
|
+
output.writeln("# HELP claude_flow_rss_bytes Resident set size");
|
|
510
|
+
output.writeln("claude_flow_rss_bytes " + memUsage.rss);
|
|
511
|
+
output.writeln("# HELP claude_flow_cpu_user_microseconds CPU user time");
|
|
512
|
+
output.writeln("claude_flow_cpu_user_microseconds " + cpuUsage.user);
|
|
513
|
+
output.writeln("# HELP claude_flow_cpu_system_microseconds CPU system time");
|
|
514
|
+
output.writeln("claude_flow_cpu_system_microseconds " + cpuUsage.system);
|
|
515
|
+
output.writeln("# HELP claude_flow_cache_entries Embedding cache entries");
|
|
516
|
+
output.writeln("claude_flow_cache_entries " + cacheEntries);
|
|
517
|
+
output.writeln("# HELP claude_flow_hnsw_entries HNSW index entries");
|
|
518
|
+
output.writeln("claude_flow_hnsw_entries " + hnswEntries);
|
|
519
|
+
output.writeln("# HELP claude_flow_uptime_seconds Process uptime");
|
|
520
|
+
output.writeln("claude_flow_uptime_seconds " + uptime);
|
|
521
|
+
return [2 /*return*/, { success: true }];
|
|
522
|
+
}
|
|
523
|
+
// Text table output with real values
|
|
524
|
+
output.printTable({
|
|
525
|
+
columns: [
|
|
526
|
+
{ key: 'metric', header: 'Metric', width: 25 },
|
|
527
|
+
{ key: 'current', header: 'Current', width: 15 },
|
|
528
|
+
{ key: 'limit', header: 'Limit', width: 15 },
|
|
529
|
+
{ key: 'status', header: 'Status', width: 12 },
|
|
530
|
+
],
|
|
531
|
+
data: [
|
|
532
|
+
{
|
|
533
|
+
metric: 'Heap Memory',
|
|
534
|
+
current: heapUsedMB + " MB",
|
|
535
|
+
limit: heapTotalMB + " MB",
|
|
536
|
+
status: parseFloat(heapUsedMB) < parseFloat(heapTotalMB) * 0.8 ? output.success('OK') : output.warning('High')
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
metric: 'RSS Memory',
|
|
540
|
+
current: rssMB + " MB",
|
|
541
|
+
limit: '-',
|
|
542
|
+
status: parseFloat(rssMB) < 500 ? output.success('OK') : output.warning('High')
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
metric: 'System Memory',
|
|
546
|
+
current: memPercent + "%",
|
|
547
|
+
limit: '100%',
|
|
548
|
+
status: parseFloat(memPercent) < 80 ? output.success('OK') : output.warning('High')
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
metric: 'CPU User Time',
|
|
552
|
+
current: cpuUserMs + "ms",
|
|
553
|
+
limit: '-',
|
|
554
|
+
status: output.success('OK')
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
metric: 'Event Loop Latency',
|
|
558
|
+
current: avgLatencyMs.toFixed(2) + "ms",
|
|
559
|
+
limit: '10ms',
|
|
560
|
+
status: avgLatencyMs < 10 ? output.success('OK') : output.warning('Slow')
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
metric: 'HNSW Index',
|
|
564
|
+
current: hnswEntries + " entries",
|
|
565
|
+
limit: '-',
|
|
566
|
+
status: hnswEntries > 0 ? output.success('Active') : output.dim('Empty')
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
metric: 'Embedding Cache',
|
|
570
|
+
current: cacheEntries + " entries",
|
|
571
|
+
limit: '-',
|
|
572
|
+
status: cacheEntries > 0 ? output.success('Active') : output.dim('Empty')
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
metric: 'Process Uptime',
|
|
576
|
+
current: Math.floor(uptime) + "s",
|
|
577
|
+
limit: '-',
|
|
578
|
+
status: output.success('Running')
|
|
579
|
+
},
|
|
580
|
+
]
|
|
581
|
+
});
|
|
582
|
+
output.writeln();
|
|
583
|
+
output.writeln(output.dim("Load Average: " + loadAvg.map(function (l) { return l.toFixed(2); }).join(', ')));
|
|
584
|
+
output.writeln(output.dim("CPUs: " + os.cpus().length + " | Platform: " + os.platform() + " " + os.release()));
|
|
585
|
+
return [2 /*return*/, { success: true }];
|
|
331
586
|
}
|
|
332
|
-
}
|
|
333
|
-
catch { /* no cache */ }
|
|
334
|
-
// Benchmark a quick operation to get real latency
|
|
335
|
-
let avgLatencyMs = 0;
|
|
336
|
-
try {
|
|
337
|
-
const times = [];
|
|
338
|
-
for (let i = 0; i < 10; i++) {
|
|
339
|
-
const start = performance.now();
|
|
340
|
-
await new Promise(r => setImmediate(r)); // Event loop turn
|
|
341
|
-
times.push(performance.now() - start);
|
|
342
|
-
}
|
|
343
|
-
avgLatencyMs = times.reduce((a, b) => a + b, 0) / times.length;
|
|
344
|
-
}
|
|
345
|
-
catch { /* timing failed */ }
|
|
346
|
-
// JSON/Prometheus output
|
|
347
|
-
if (format === 'json') {
|
|
348
|
-
const metrics = {
|
|
349
|
-
timestamp: new Date().toISOString(),
|
|
350
|
-
timeframe,
|
|
351
|
-
memory: {
|
|
352
|
-
heapUsed: memUsage.heapUsed,
|
|
353
|
-
heapTotal: memUsage.heapTotal,
|
|
354
|
-
rss: memUsage.rss,
|
|
355
|
-
external: memUsage.external,
|
|
356
|
-
systemPercent: parseFloat(memPercent),
|
|
357
|
-
},
|
|
358
|
-
cpu: {
|
|
359
|
-
user: cpuUsage.user,
|
|
360
|
-
system: cpuUsage.system,
|
|
361
|
-
loadAverage: loadAvg,
|
|
362
|
-
},
|
|
363
|
-
process: {
|
|
364
|
-
uptime,
|
|
365
|
-
pid: process.pid,
|
|
366
|
-
},
|
|
367
|
-
cache: {
|
|
368
|
-
entries: cacheEntries,
|
|
369
|
-
hnswEntries,
|
|
370
|
-
},
|
|
371
|
-
latency: {
|
|
372
|
-
avgMs: avgLatencyMs,
|
|
373
|
-
},
|
|
374
|
-
};
|
|
375
|
-
output.writeln(JSON.stringify(metrics, null, 2));
|
|
376
|
-
return { success: true };
|
|
377
|
-
}
|
|
378
|
-
if (format === 'prometheus') {
|
|
379
|
-
output.writeln(`# HELP claude_flow_heap_used_bytes Heap memory used`);
|
|
380
|
-
output.writeln(`claude_flow_heap_used_bytes ${memUsage.heapUsed}`);
|
|
381
|
-
output.writeln(`# HELP claude_flow_heap_total_bytes Total heap memory`);
|
|
382
|
-
output.writeln(`claude_flow_heap_total_bytes ${memUsage.heapTotal}`);
|
|
383
|
-
output.writeln(`# HELP claude_flow_rss_bytes Resident set size`);
|
|
384
|
-
output.writeln(`claude_flow_rss_bytes ${memUsage.rss}`);
|
|
385
|
-
output.writeln(`# HELP claude_flow_cpu_user_microseconds CPU user time`);
|
|
386
|
-
output.writeln(`claude_flow_cpu_user_microseconds ${cpuUsage.user}`);
|
|
387
|
-
output.writeln(`# HELP claude_flow_cpu_system_microseconds CPU system time`);
|
|
388
|
-
output.writeln(`claude_flow_cpu_system_microseconds ${cpuUsage.system}`);
|
|
389
|
-
output.writeln(`# HELP claude_flow_cache_entries Embedding cache entries`);
|
|
390
|
-
output.writeln(`claude_flow_cache_entries ${cacheEntries}`);
|
|
391
|
-
output.writeln(`# HELP claude_flow_hnsw_entries HNSW index entries`);
|
|
392
|
-
output.writeln(`claude_flow_hnsw_entries ${hnswEntries}`);
|
|
393
|
-
output.writeln(`# HELP claude_flow_uptime_seconds Process uptime`);
|
|
394
|
-
output.writeln(`claude_flow_uptime_seconds ${uptime}`);
|
|
395
|
-
return { success: true };
|
|
396
|
-
}
|
|
397
|
-
// Text table output with real values
|
|
398
|
-
output.printTable({
|
|
399
|
-
columns: [
|
|
400
|
-
{ key: 'metric', header: 'Metric', width: 25 },
|
|
401
|
-
{ key: 'current', header: 'Current', width: 15 },
|
|
402
|
-
{ key: 'limit', header: 'Limit', width: 15 },
|
|
403
|
-
{ key: 'status', header: 'Status', width: 12 },
|
|
404
|
-
],
|
|
405
|
-
data: [
|
|
406
|
-
{
|
|
407
|
-
metric: 'Heap Memory',
|
|
408
|
-
current: `${heapUsedMB} MB`,
|
|
409
|
-
limit: `${heapTotalMB} MB`,
|
|
410
|
-
status: parseFloat(heapUsedMB) < parseFloat(heapTotalMB) * 0.8 ? output.success('OK') : output.warning('High'),
|
|
411
|
-
},
|
|
412
|
-
{
|
|
413
|
-
metric: 'RSS Memory',
|
|
414
|
-
current: `${rssMB} MB`,
|
|
415
|
-
limit: '-',
|
|
416
|
-
status: parseFloat(rssMB) < 500 ? output.success('OK') : output.warning('High'),
|
|
417
|
-
},
|
|
418
|
-
{
|
|
419
|
-
metric: 'System Memory',
|
|
420
|
-
current: `${memPercent}%`,
|
|
421
|
-
limit: '100%',
|
|
422
|
-
status: parseFloat(memPercent) < 80 ? output.success('OK') : output.warning('High'),
|
|
423
|
-
},
|
|
424
|
-
{
|
|
425
|
-
metric: 'CPU User Time',
|
|
426
|
-
current: `${cpuUserMs}ms`,
|
|
427
|
-
limit: '-',
|
|
428
|
-
status: output.success('OK'),
|
|
429
|
-
},
|
|
430
|
-
{
|
|
431
|
-
metric: 'Event Loop Latency',
|
|
432
|
-
current: `${avgLatencyMs.toFixed(2)}ms`,
|
|
433
|
-
limit: '10ms',
|
|
434
|
-
status: avgLatencyMs < 10 ? output.success('OK') : output.warning('Slow'),
|
|
435
|
-
},
|
|
436
|
-
{
|
|
437
|
-
metric: 'HNSW Index',
|
|
438
|
-
current: `${hnswEntries} entries`,
|
|
439
|
-
limit: '-',
|
|
440
|
-
status: hnswEntries > 0 ? output.success('Active') : output.dim('Empty'),
|
|
441
|
-
},
|
|
442
|
-
{
|
|
443
|
-
metric: 'Embedding Cache',
|
|
444
|
-
current: `${cacheEntries} entries`,
|
|
445
|
-
limit: '-',
|
|
446
|
-
status: cacheEntries > 0 ? output.success('Active') : output.dim('Empty'),
|
|
447
|
-
},
|
|
448
|
-
{
|
|
449
|
-
metric: 'Process Uptime',
|
|
450
|
-
current: `${Math.floor(uptime)}s`,
|
|
451
|
-
limit: '-',
|
|
452
|
-
status: output.success('Running'),
|
|
453
|
-
},
|
|
454
|
-
],
|
|
455
587
|
});
|
|
456
|
-
|
|
457
|
-
output.writeln(output.dim(`Load Average: ${loadAvg.map(l => l.toFixed(2)).join(', ')}`));
|
|
458
|
-
output.writeln(output.dim(`CPUs: ${os.cpus().length} | Platform: ${os.platform()} ${os.release()}`));
|
|
459
|
-
return { success: true };
|
|
460
|
-
},
|
|
588
|
+
}); }
|
|
461
589
|
};
|
|
462
590
|
// Optimize subcommand
|
|
463
|
-
|
|
591
|
+
var optimizeCommand = {
|
|
464
592
|
name: 'optimize',
|
|
465
593
|
description: 'Run performance optimization recommendations',
|
|
466
594
|
options: [
|
|
467
|
-
{ name: 'target', short: 't', type: 'string', description: 'Target: memory, cpu, latency, all', default: 'all' },
|
|
595
|
+
{ name: 'target', short: 't', type: 'string', description: 'Target: memory, cpu, latency, all', "default": 'all' },
|
|
468
596
|
{ name: 'apply', short: 'a', type: 'boolean', description: 'Apply recommended optimizations' },
|
|
469
597
|
{ name: 'dry-run', short: 'd', type: 'boolean', description: 'Show changes without applying' },
|
|
470
598
|
],
|
|
@@ -472,75 +600,91 @@ const optimizeCommand = {
|
|
|
472
600
|
{ command: 'claude-flow performance optimize -t memory', description: 'Optimize memory usage' },
|
|
473
601
|
{ command: 'claude-flow performance optimize --apply', description: 'Apply all optimizations' },
|
|
474
602
|
],
|
|
475
|
-
action:
|
|
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
|
-
|
|
603
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
604
|
+
var target, spinner;
|
|
605
|
+
return __generator(this, function (_a) {
|
|
606
|
+
switch (_a.label) {
|
|
607
|
+
case 0:
|
|
608
|
+
target = ctx.flags.target || 'all';
|
|
609
|
+
output.writeln();
|
|
610
|
+
output.writeln(output.bold('Performance Optimization'));
|
|
611
|
+
output.writeln(output.dim('─'.repeat(50)));
|
|
612
|
+
spinner = output.createSpinner({ text: 'Analyzing performance...', spinner: 'dots' });
|
|
613
|
+
spinner.start();
|
|
614
|
+
return [4 /*yield*/, new Promise(function (r) { return setTimeout(r, 800); })];
|
|
615
|
+
case 1:
|
|
616
|
+
_a.sent();
|
|
617
|
+
spinner.succeed('Analysis complete');
|
|
618
|
+
output.writeln();
|
|
619
|
+
output.writeln(output.bold('Recommendations:'));
|
|
620
|
+
output.writeln();
|
|
621
|
+
output.printTable({
|
|
622
|
+
columns: [
|
|
623
|
+
{ key: 'priority', header: 'Priority', width: 10 },
|
|
624
|
+
{ key: 'area', header: 'Area', width: 15 },
|
|
625
|
+
{ key: 'recommendation', header: 'Recommendation', width: 40 },
|
|
626
|
+
{ key: 'impact', header: 'Impact', width: 15 },
|
|
627
|
+
],
|
|
628
|
+
data: [
|
|
629
|
+
{ priority: output.error('P0'), area: 'Memory', recommendation: 'Enable HNSW index quantization', impact: '+50% reduction' },
|
|
630
|
+
{ priority: output.warning('P1'), area: 'CPU', recommendation: 'Enable WASM SIMD acceleration', impact: '+4x speedup' },
|
|
631
|
+
{ priority: output.warning('P1'), area: 'Latency', recommendation: 'Enable Flash Attention', impact: '+2.49x speedup' },
|
|
632
|
+
{ priority: output.info('P2'), area: 'Cache', recommendation: 'Increase pattern cache size', impact: '+15% hit rate' },
|
|
633
|
+
{ priority: output.info('P2'), area: 'Network', recommendation: 'Enable request batching', impact: '-30% latency' },
|
|
634
|
+
]
|
|
635
|
+
});
|
|
636
|
+
return [2 /*return*/, { success: true }];
|
|
637
|
+
}
|
|
501
638
|
});
|
|
502
|
-
|
|
503
|
-
},
|
|
639
|
+
}); }
|
|
504
640
|
};
|
|
505
641
|
// Bottleneck subcommand
|
|
506
|
-
|
|
642
|
+
var bottleneckCommand = {
|
|
507
643
|
name: 'bottleneck',
|
|
508
644
|
description: 'Identify performance bottlenecks',
|
|
509
645
|
options: [
|
|
510
646
|
{ name: 'component', short: 'c', type: 'string', description: 'Component to analyze' },
|
|
511
|
-
{ name: 'depth', short: 'd', type: 'string', description: 'Analysis depth: quick, full', default: 'quick' },
|
|
647
|
+
{ name: 'depth', short: 'd', type: 'string', description: 'Analysis depth: quick, full', "default": 'quick' },
|
|
512
648
|
],
|
|
513
649
|
examples: [
|
|
514
650
|
{ command: 'claude-flow performance bottleneck', description: 'Find bottlenecks' },
|
|
515
651
|
{ command: 'claude-flow performance bottleneck -d full', description: 'Full analysis' },
|
|
516
652
|
],
|
|
517
|
-
action:
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
653
|
+
action: function (ctx) { return __awaiter(void 0, void 0, Promise, function () {
|
|
654
|
+
var spinner;
|
|
655
|
+
return __generator(this, function (_a) {
|
|
656
|
+
switch (_a.label) {
|
|
657
|
+
case 0:
|
|
658
|
+
output.writeln();
|
|
659
|
+
output.writeln(output.bold('Bottleneck Analysis'));
|
|
660
|
+
output.writeln(output.dim('─'.repeat(50)));
|
|
661
|
+
spinner = output.createSpinner({ text: 'Analyzing system...', spinner: 'dots' });
|
|
662
|
+
spinner.start();
|
|
663
|
+
return [4 /*yield*/, new Promise(function (r) { return setTimeout(r, 600); })];
|
|
664
|
+
case 1:
|
|
665
|
+
_a.sent();
|
|
666
|
+
spinner.succeed('Analysis complete');
|
|
667
|
+
output.writeln();
|
|
668
|
+
output.printTable({
|
|
669
|
+
columns: [
|
|
670
|
+
{ key: 'component', header: 'Component', width: 20 },
|
|
671
|
+
{ key: 'bottleneck', header: 'Bottleneck', width: 25 },
|
|
672
|
+
{ key: 'severity', header: 'Severity', width: 12 },
|
|
673
|
+
{ key: 'solution', header: 'Solution', width: 30 },
|
|
674
|
+
],
|
|
675
|
+
data: [
|
|
676
|
+
{ component: 'Vector Search', bottleneck: 'Linear scan O(n)', severity: output.error('High'), solution: 'Enable HNSW indexing' },
|
|
677
|
+
{ component: 'Neural Inference', bottleneck: 'Sequential attention', severity: output.warning('Medium'), solution: 'Enable Flash Attention' },
|
|
678
|
+
{ component: 'Memory Store', bottleneck: 'Lock contention', severity: output.info('Low'), solution: 'Use sharded storage' },
|
|
679
|
+
]
|
|
680
|
+
});
|
|
681
|
+
return [2 /*return*/, { success: true }];
|
|
682
|
+
}
|
|
538
683
|
});
|
|
539
|
-
|
|
540
|
-
},
|
|
684
|
+
}); }
|
|
541
685
|
};
|
|
542
686
|
// Main performance command
|
|
543
|
-
export
|
|
687
|
+
export var performanceCommand = {
|
|
544
688
|
name: 'performance',
|
|
545
689
|
description: 'Performance profiling, benchmarking, optimization, metrics',
|
|
546
690
|
aliases: ['perf'],
|
|
@@ -550,30 +694,32 @@ export const performanceCommand = {
|
|
|
550
694
|
{ command: 'claude-flow performance profile', description: 'Profile application' },
|
|
551
695
|
{ command: 'claude-flow perf metrics', description: 'View metrics (alias)' },
|
|
552
696
|
],
|
|
553
|
-
action:
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
697
|
+
action: function () { return __awaiter(void 0, void 0, Promise, function () {
|
|
698
|
+
return __generator(this, function (_a) {
|
|
699
|
+
output.writeln();
|
|
700
|
+
output.writeln(output.bold('RuFlo Performance Suite'));
|
|
701
|
+
output.writeln(output.dim('Advanced performance profiling and optimization'));
|
|
702
|
+
output.writeln();
|
|
703
|
+
output.writeln('Subcommands:');
|
|
704
|
+
output.printList([
|
|
705
|
+
'benchmark - Run performance benchmarks (WASM, neural, search)',
|
|
706
|
+
'profile - Profile CPU, memory, I/O usage',
|
|
707
|
+
'metrics - View and export performance metrics',
|
|
708
|
+
'optimize - Get optimization recommendations',
|
|
709
|
+
'bottleneck - Identify performance bottlenecks',
|
|
710
|
+
]);
|
|
711
|
+
output.writeln();
|
|
712
|
+
output.writeln('Performance Targets:');
|
|
713
|
+
output.printList([
|
|
714
|
+
'HNSW Search: 150x-12,500x faster than brute force',
|
|
715
|
+
'Flash Attention: 2.49x-7.47x speedup',
|
|
716
|
+
'Memory: 50-75% reduction with quantization',
|
|
717
|
+
]);
|
|
718
|
+
output.writeln();
|
|
719
|
+
output.writeln(output.dim('Created with ❤️ by ruv.io'));
|
|
720
|
+
return [2 /*return*/, { success: true }];
|
|
721
|
+
});
|
|
722
|
+
}); }
|
|
577
723
|
};
|
|
578
724
|
export default performanceCommand;
|
|
579
725
|
//# sourceMappingURL=performance.js.map
|