kynjal-cli 4.0.0 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/appliance/gguf-engine.d.ts +91 -0
- package/dist/src/appliance/gguf-engine.d.ts.map +1 -0
- package/dist/src/appliance/gguf-engine.js +286 -525
- package/dist/src/appliance/gguf-engine.js.map +1 -1
- package/dist/src/appliance/ruvllm-bridge.d.ts +102 -0
- package/dist/src/appliance/ruvllm-bridge.d.ts.map +1 -0
- package/dist/src/appliance/ruvllm-bridge.js +203 -403
- package/dist/src/appliance/ruvllm-bridge.js.map +1 -1
- package/dist/src/appliance/rvfa-builder.d.ts +44 -0
- package/dist/src/appliance/rvfa-builder.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-builder.js +154 -208
- package/dist/src/appliance/rvfa-builder.js.map +1 -1
- package/dist/src/appliance/rvfa-distribution.d.ts +97 -0
- package/dist/src/appliance/rvfa-distribution.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-distribution.js +260 -423
- package/dist/src/appliance/rvfa-distribution.js.map +1 -1
- package/dist/src/appliance/rvfa-format.d.ts +111 -0
- package/dist/src/appliance/rvfa-format.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-format.js +128 -200
- package/dist/src/appliance/rvfa-format.js.map +1 -1
- package/dist/src/appliance/rvfa-runner.d.ts +69 -0
- package/dist/src/appliance/rvfa-runner.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-runner.js +168 -304
- package/dist/src/appliance/rvfa-runner.js.map +1 -1
- package/dist/src/appliance/rvfa-signing.d.ts +123 -0
- package/dist/src/appliance/rvfa-signing.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-signing.js +173 -295
- package/dist/src/appliance/rvfa-signing.js.map +1 -1
- package/dist/src/benchmarks/pretrain/index.d.ts +58 -0
- package/dist/src/benchmarks/pretrain/index.d.ts.map +1 -0
- package/dist/src/benchmarks/pretrain/index.js +331 -542
- package/dist/src/benchmarks/pretrain/index.js.map +1 -1
- package/dist/src/commands/agent.js +574 -697
- package/dist/src/commands/agent.js.map +1 -1
- package/dist/src/commands/analyze.js +1218 -1548
- package/dist/src/commands/analyze.js.map +1 -1
- package/dist/src/commands/appliance-advanced.js +158 -267
- package/dist/src/commands/appliance-advanced.js.map +1 -1
- package/dist/src/commands/appliance.js +318 -493
- package/dist/src/commands/appliance.js.map +1 -1
- package/dist/src/commands/benchmark.js +372 -523
- package/dist/src/commands/benchmark.js.map +1 -1
- package/dist/src/commands/claims.js +274 -364
- package/dist/src/commands/claims.js.map +1 -1
- package/dist/src/commands/cleanup.js +113 -157
- package/dist/src/commands/cleanup.js.map +1 -1
- package/dist/src/commands/completions.js +477 -118
- package/dist/src/commands/completions.js.map +1 -1
- package/dist/src/commands/config.js +237 -303
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/daemon.js +487 -596
- package/dist/src/commands/daemon.js.map +1 -1
- package/dist/src/commands/deployment.js +194 -275
- package/dist/src/commands/deployment.js.map +1 -1
- package/dist/src/commands/doctor.js +504 -686
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/embeddings.js +1293 -1543
- package/dist/src/commands/embeddings.js.map +1 -1
- package/dist/src/commands/guidance.js +449 -596
- package/dist/src/commands/guidance.js.map +1 -1
- package/dist/src/commands/hive-mind.js +854 -938
- package/dist/src/commands/hive-mind.js.map +1 -1
- package/dist/src/commands/hooks.js +3112 -3519
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.d.ts +115 -0
- package/dist/src/commands/index.d.ts.map +1 -0
- package/dist/src/commands/index.js +126 -308
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/init.js +788 -940
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/issues.js +383 -558
- package/dist/src/commands/issues.js.map +1 -1
- package/dist/src/commands/mcp.js +493 -605
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/memory.js +833 -1026
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/migrate.js +282 -347
- package/dist/src/commands/migrate.js.map +1 -1
- package/dist/src/commands/neural.js +1289 -1563
- package/dist/src/commands/neural.js.map +1 -1
- package/dist/src/commands/performance.js +497 -643
- package/dist/src/commands/performance.js.map +1 -1
- package/dist/src/commands/plugins.js +668 -841
- package/dist/src/commands/plugins.js.map +1 -1
- package/dist/src/commands/process.js +392 -447
- package/dist/src/commands/process.js.map +1 -1
- package/dist/src/commands/progress.js +162 -256
- package/dist/src/commands/progress.js.map +1 -1
- package/dist/src/commands/providers.js +150 -220
- package/dist/src/commands/providers.js.map +1 -1
- package/dist/src/commands/route.js +520 -665
- package/dist/src/commands/route.js.map +1 -1
- package/dist/src/commands/ruvector/backup.js +505 -651
- package/dist/src/commands/ruvector/backup.js.map +1 -1
- package/dist/src/commands/ruvector/benchmark.js +349 -401
- package/dist/src/commands/ruvector/benchmark.js.map +1 -1
- package/dist/src/commands/ruvector/import.js +224 -266
- package/dist/src/commands/ruvector/import.js.map +1 -1
- package/dist/src/commands/ruvector/index.js +37 -75
- package/dist/src/commands/ruvector/index.js.map +1 -1
- package/dist/src/commands/ruvector/init.js +336 -359
- package/dist/src/commands/ruvector/init.js.map +1 -1
- package/dist/src/commands/ruvector/migrate.js +335 -322
- package/dist/src/commands/ruvector/migrate.js.map +1 -1
- package/dist/src/commands/ruvector/optimize.js +375 -431
- package/dist/src/commands/ruvector/optimize.js.map +1 -1
- package/dist/src/commands/ruvector/setup.js +703 -117
- package/dist/src/commands/ruvector/setup.js.map +1 -1
- package/dist/src/commands/ruvector/status.js +364 -419
- package/dist/src/commands/ruvector/status.js.map +1 -1
- package/dist/src/commands/security.js +485 -608
- package/dist/src/commands/security.js.map +1 -1
- package/dist/src/commands/session.js +504 -626
- package/dist/src/commands/session.js.map +1 -1
- package/dist/src/commands/start.js +267 -364
- package/dist/src/commands/start.js.map +1 -1
- package/dist/src/commands/status.js +380 -486
- package/dist/src/commands/status.js.map +1 -1
- package/dist/src/commands/swarm.js +408 -488
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/commands/task.js +423 -538
- package/dist/src/commands/task.js.map +1 -1
- package/dist/src/commands/transfer-store.js +322 -412
- package/dist/src/commands/transfer-store.js.map +1 -1
- package/dist/src/commands/update.js +196 -291
- package/dist/src/commands/update.js.map +1 -1
- package/dist/src/commands/workflow.js +386 -486
- package/dist/src/commands/workflow.js.map +1 -1
- package/dist/src/config-adapter.d.ts +15 -0
- package/dist/src/config-adapter.d.ts.map +1 -0
- package/dist/src/config-adapter.js +38 -39
- package/dist/src/config-adapter.js.map +1 -1
- package/dist/src/index.d.ts +77 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +309 -411
- package/dist/src/index.js.map +1 -1
- package/dist/src/infrastructure/in-memory-repositories.d.ts +68 -0
- package/dist/src/infrastructure/in-memory-repositories.d.ts.map +1 -0
- package/dist/src/infrastructure/in-memory-repositories.js +246 -507
- package/dist/src/infrastructure/in-memory-repositories.js.map +1 -1
- package/dist/src/init/claudemd-generator.d.ts +25 -0
- package/dist/src/init/claudemd-generator.d.ts.map +1 -0
- package/dist/src/init/claudemd-generator.js +368 -78
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/executor.d.ts +41 -0
- package/dist/src/init/executor.d.ts.map +1 -0
- package/dist/src/init/executor.js +1307 -996
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/helpers-generator.d.ts +60 -0
- package/dist/src/init/helpers-generator.d.ts.map +1 -0
- package/dist/src/init/helpers-generator.js +657 -12
- package/dist/src/init/helpers-generator.js.map +1 -1
- package/dist/src/init/index.d.ts +1 -1
- package/dist/src/init/index.d.ts.map +1 -1
- package/dist/src/init/index.js +1 -1
- package/dist/src/init/index.js.map +1 -1
- package/dist/src/init/mcp-generator.js +33 -37
- package/dist/src/init/mcp-generator.js.map +1 -1
- package/dist/src/init/settings-generator.js +76 -77
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/statusline-generator.js +801 -3
- package/dist/src/init/statusline-generator.js.map +1 -1
- package/dist/src/init/types.d.ts +1 -1
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/types.js +76 -59
- package/dist/src/init/types.js.map +1 -1
- package/dist/src/mcp-client.d.ts +92 -0
- package/dist/src/mcp-client.d.ts.map +1 -0
- package/dist/src/mcp-client.js +81 -125
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-server.d.ts +161 -0
- package/dist/src/mcp-server.d.ts.map +1 -0
- package/dist/src/mcp-server.js +470 -757
- package/dist/src/mcp-server.js.map +1 -1
- package/dist/src/mcp-tools/agent-tools.js +391 -492
- package/dist/src/mcp-tools/agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/agentdb-tools.js +332 -533
- package/dist/src/mcp-tools/agentdb-tools.js.map +1 -1
- package/dist/src/mcp-tools/analyze-tools.js +172 -236
- package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
- package/dist/src/mcp-tools/auto-install.d.ts +83 -0
- package/dist/src/mcp-tools/auto-install.d.ts.map +1 -0
- package/dist/src/mcp-tools/auto-install.js +80 -142
- package/dist/src/mcp-tools/auto-install.js.map +1 -1
- package/dist/src/mcp-tools/browser-tools.js +252 -375
- package/dist/src/mcp-tools/browser-tools.js.map +1 -1
- package/dist/src/mcp-tools/claims-tools.js +473 -565
- package/dist/src/mcp-tools/claims-tools.js.map +1 -1
- package/dist/src/mcp-tools/config-tools.js +197 -272
- package/dist/src/mcp-tools/config-tools.js.map +1 -1
- package/dist/src/mcp-tools/coordination-tools.js +500 -572
- package/dist/src/mcp-tools/coordination-tools.js.map +1 -1
- package/dist/src/mcp-tools/daa-tools.js +286 -364
- package/dist/src/mcp-tools/daa-tools.js.map +1 -1
- package/dist/src/mcp-tools/embeddings-tools.js +582 -693
- package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
- package/dist/src/mcp-tools/github-tools.js +260 -311
- package/dist/src/mcp-tools/github-tools.js.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.js +573 -640
- package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +2215 -2648
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/memory-tools.js +350 -505
- package/dist/src/mcp-tools/memory-tools.js.map +1 -1
- package/dist/src/mcp-tools/neural-tools.js +315 -412
- package/dist/src/mcp-tools/neural-tools.js.map +1 -1
- package/dist/src/mcp-tools/performance-tools.js +420 -480
- package/dist/src/mcp-tools/performance-tools.js.map +1 -1
- package/dist/src/mcp-tools/progress-tools.js +204 -278
- package/dist/src/mcp-tools/progress-tools.js.map +1 -1
- package/dist/src/mcp-tools/ruvllm-tools.js +163 -279
- package/dist/src/mcp-tools/ruvllm-tools.js.map +1 -1
- package/dist/src/mcp-tools/security-tools.js +297 -429
- package/dist/src/mcp-tools/security-tools.js.map +1 -1
- package/dist/src/mcp-tools/session-tools.js +185 -234
- package/dist/src/mcp-tools/session-tools.js.map +1 -1
- package/dist/src/mcp-tools/swarm-tools.js +207 -260
- package/dist/src/mcp-tools/swarm-tools.js.map +1 -1
- package/dist/src/mcp-tools/system-tools.js +276 -325
- package/dist/src/mcp-tools/system-tools.js.map +1 -1
- package/dist/src/mcp-tools/task-tools.js +270 -336
- package/dist/src/mcp-tools/task-tools.js.map +1 -1
- package/dist/src/mcp-tools/terminal-tools.js +148 -196
- package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
- package/dist/src/mcp-tools/transfer-tools.js +186 -333
- package/dist/src/mcp-tools/transfer-tools.js.map +1 -1
- package/dist/src/mcp-tools/types.d.ts +31 -0
- package/dist/src/mcp-tools/types.d.ts.map +1 -0
- package/dist/src/mcp-tools/wasm-agent-tools.js +133 -280
- package/dist/src/mcp-tools/wasm-agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/workflow-tools.js +405 -450
- package/dist/src/mcp-tools/workflow-tools.js.map +1 -1
- package/dist/src/memory/ewc-consolidation.d.ts +295 -0
- package/dist/src/memory/ewc-consolidation.d.ts.map +1 -0
- package/dist/src/memory/ewc-consolidation.js +190 -303
- package/dist/src/memory/ewc-consolidation.js.map +1 -1
- package/dist/src/memory/intelligence.d.ts +338 -0
- package/dist/src/memory/intelligence.d.ts.map +1 -0
- package/dist/src/memory/intelligence.js +569 -794
- package/dist/src/memory/intelligence.js.map +1 -1
- package/dist/src/memory/memory-bridge.d.ts +407 -0
- package/dist/src/memory/memory-bridge.d.ts.map +1 -0
- package/dist/src/memory/memory-bridge.js +1170 -1640
- package/dist/src/memory/memory-bridge.js.map +1 -1
- package/dist/src/memory/memory-initializer.d.ts +412 -0
- package/dist/src/memory/memory-initializer.d.ts.map +1 -0
- package/dist/src/memory/memory-initializer.js +1836 -1851
- package/dist/src/memory/memory-initializer.js.map +1 -1
- package/dist/src/memory/sona-optimizer.d.ts +227 -0
- package/dist/src/memory/sona-optimizer.d.ts.map +1 -0
- package/dist/src/memory/sona-optimizer.js +199 -329
- package/dist/src/memory/sona-optimizer.js.map +1 -1
- package/dist/src/output.d.ts +2 -2
- package/dist/src/output.d.ts.map +1 -1
- package/dist/src/output.js +242 -272
- package/dist/src/output.js.map +1 -1
- package/dist/src/parser.d.ts +51 -0
- package/dist/src/parser.d.ts.map +1 -0
- package/dist/src/parser.js +140 -187
- package/dist/src/parser.js.map +1 -1
- package/dist/src/plugins/manager.d.ts +133 -0
- package/dist/src/plugins/manager.d.ts.map +1 -0
- package/dist/src/plugins/manager.js +285 -521
- package/dist/src/plugins/manager.js.map +1 -1
- package/dist/src/plugins/store/discovery.d.ts +88 -0
- package/dist/src/plugins/store/discovery.d.ts.map +1 -0
- package/dist/src/plugins/store/discovery.js +271 -358
- package/dist/src/plugins/store/discovery.js.map +1 -1
- package/dist/src/plugins/store/index.d.ts +76 -0
- package/dist/src/plugins/store/index.d.ts.map +1 -0
- package/dist/src/plugins/store/index.js +48 -105
- package/dist/src/plugins/store/index.js.map +1 -1
- package/dist/src/plugins/store/search.d.ts +46 -0
- package/dist/src/plugins/store/search.d.ts.map +1 -0
- package/dist/src/plugins/store/search.js +69 -107
- package/dist/src/plugins/store/search.js.map +1 -1
- package/dist/src/plugins/store/types.d.ts +274 -0
- package/dist/src/plugins/store/types.d.ts.map +1 -0
- package/dist/src/plugins/tests/demo-plugin-store.js +113 -160
- package/dist/src/plugins/tests/demo-plugin-store.js.map +1 -1
- package/dist/src/plugins/tests/standalone-test.js +172 -223
- package/dist/src/plugins/tests/standalone-test.js.map +1 -1
- package/dist/src/plugins/tests/test-plugin-store.js +190 -228
- package/dist/src/plugins/tests/test-plugin-store.js.map +1 -1
- package/dist/src/production/circuit-breaker.d.ts +101 -0
- package/dist/src/production/circuit-breaker.d.ts.map +1 -0
- package/dist/src/production/circuit-breaker.js +62 -126
- package/dist/src/production/circuit-breaker.js.map +1 -1
- package/dist/src/production/error-handler.d.ts +92 -0
- package/dist/src/production/error-handler.d.ts.map +1 -0
- package/dist/src/production/error-handler.js +86 -156
- package/dist/src/production/error-handler.js.map +1 -1
- package/dist/src/production/monitoring.d.ts +161 -0
- package/dist/src/production/monitoring.d.ts.map +1 -0
- package/dist/src/production/monitoring.js +139 -220
- package/dist/src/production/monitoring.js.map +1 -1
- package/dist/src/production/rate-limiter.d.ts +80 -0
- package/dist/src/production/rate-limiter.d.ts.map +1 -0
- package/dist/src/production/rate-limiter.js +74 -93
- package/dist/src/production/rate-limiter.js.map +1 -1
- package/dist/src/production/retry.d.ts +48 -0
- package/dist/src/production/retry.d.ts.map +1 -0
- package/dist/src/production/retry.js +75 -167
- package/dist/src/production/retry.js.map +1 -1
- package/dist/src/prompt.d.ts +44 -0
- package/dist/src/prompt.d.ts.map +1 -0
- package/dist/src/prompt.js +436 -560
- package/dist/src/prompt.js.map +1 -1
- package/dist/src/runtime/headless.d.ts +60 -0
- package/dist/src/runtime/headless.d.ts.map +1 -0
- package/dist/src/runtime/headless.js +197 -286
- package/dist/src/runtime/headless.js.map +1 -1
- package/dist/src/ruvector/agent-wasm.d.ts +182 -0
- package/dist/src/ruvector/agent-wasm.d.ts.map +1 -0
- package/dist/src/ruvector/agent-wasm.js +156 -351
- package/dist/src/ruvector/agent-wasm.js.map +1 -1
- package/dist/src/ruvector/ast-analyzer.d.ts +67 -0
- package/dist/src/ruvector/ast-analyzer.d.ts.map +1 -0
- package/dist/src/ruvector/ast-analyzer.js +145 -232
- package/dist/src/ruvector/ast-analyzer.js.map +1 -1
- package/dist/src/ruvector/coverage-router.d.ts +160 -0
- package/dist/src/ruvector/coverage-router.d.ts.map +1 -0
- package/dist/src/ruvector/coverage-router.js +287 -419
- package/dist/src/ruvector/coverage-router.js.map +1 -1
- package/dist/src/ruvector/coverage-tools.js +56 -101
- package/dist/src/ruvector/coverage-tools.js.map +1 -1
- package/dist/src/ruvector/diff-classifier.d.ts +175 -0
- package/dist/src/ruvector/diff-classifier.d.ts.map +1 -0
- package/dist/src/ruvector/diff-classifier.js +324 -451
- package/dist/src/ruvector/diff-classifier.js.map +1 -1
- package/dist/src/ruvector/enhanced-model-router.d.ts +146 -0
- package/dist/src/ruvector/enhanced-model-router.d.ts.map +1 -0
- package/dist/src/ruvector/enhanced-model-router.js +260 -336
- package/dist/src/ruvector/enhanced-model-router.js.map +1 -1
- package/dist/src/ruvector/flash-attention.d.ts +195 -0
- package/dist/src/ruvector/flash-attention.d.ts.map +1 -0
- package/dist/src/ruvector/flash-attention.js +223 -254
- package/dist/src/ruvector/flash-attention.js.map +1 -1
- package/dist/src/ruvector/graph-analyzer.d.ts +187 -0
- package/dist/src/ruvector/graph-analyzer.d.ts.map +1 -0
- package/dist/src/ruvector/graph-analyzer.js +486 -680
- package/dist/src/ruvector/graph-analyzer.js.map +1 -1
- package/dist/src/ruvector/index.d.ts +40 -0
- package/dist/src/ruvector/index.d.ts.map +1 -0
- package/dist/src/ruvector/index.js +36 -106
- package/dist/src/ruvector/index.js.map +1 -1
- package/dist/src/ruvector/lora-adapter.d.ts +218 -0
- package/dist/src/ruvector/lora-adapter.d.ts.map +1 -0
- package/dist/src/ruvector/lora-adapter.js +155 -248
- package/dist/src/ruvector/lora-adapter.js.map +1 -1
- package/dist/src/ruvector/model-router.d.ts +220 -0
- package/dist/src/ruvector/model-router.d.ts.map +1 -0
- package/dist/src/ruvector/model-router.js +175 -248
- package/dist/src/ruvector/model-router.js.map +1 -1
- package/dist/src/ruvector/moe-router.d.ts +206 -0
- package/dist/src/ruvector/moe-router.d.ts.map +1 -0
- package/dist/src/ruvector/moe-router.js +228 -286
- package/dist/src/ruvector/moe-router.js.map +1 -1
- package/dist/src/ruvector/q-learning-router.d.ts +211 -0
- package/dist/src/ruvector/q-learning-router.d.ts.map +1 -0
- package/dist/src/ruvector/q-learning-router.js +257 -338
- package/dist/src/ruvector/q-learning-router.js.map +1 -1
- package/dist/src/ruvector/ruvllm-wasm.d.ts +179 -0
- package/dist/src/ruvector/ruvllm-wasm.d.ts.map +1 -0
- package/dist/src/ruvector/ruvllm-wasm.js +270 -434
- package/dist/src/ruvector/ruvllm-wasm.js.map +1 -1
- package/dist/src/ruvector/semantic-router.d.ts +77 -0
- package/dist/src/ruvector/semantic-router.d.ts.map +1 -0
- package/dist/src/ruvector/semantic-router.js +60 -67
- package/dist/src/ruvector/semantic-router.js.map +1 -1
- package/dist/src/ruvector/vector-db.d.ts +69 -0
- package/dist/src/ruvector/vector-db.d.ts.map +1 -0
- package/dist/src/ruvector/vector-db.js +119 -205
- package/dist/src/ruvector/vector-db.js.map +1 -1
- package/dist/src/services/agentic-flow-bridge.d.ts +50 -0
- package/dist/src/services/agentic-flow-bridge.d.ts.map +1 -0
- package/dist/src/services/agentic-flow-bridge.js +32 -105
- package/dist/src/services/agentic-flow-bridge.js.map +1 -1
- package/dist/src/services/claim-service.d.ts +204 -0
- package/dist/src/services/claim-service.d.ts.map +1 -0
- package/dist/src/services/claim-service.js +615 -940
- package/dist/src/services/claim-service.js.map +1 -1
- package/dist/src/services/container-worker-pool.d.ts +197 -0
- package/dist/src/services/container-worker-pool.d.ts.map +1 -0
- package/dist/src/services/container-worker-pool.js +398 -666
- package/dist/src/services/container-worker-pool.js.map +1 -1
- package/dist/src/services/headless-worker-executor.d.ts +304 -0
- package/dist/src/services/headless-worker-executor.d.ts.map +1 -0
- package/dist/src/services/headless-worker-executor.js +441 -467
- package/dist/src/services/headless-worker-executor.js.map +1 -1
- package/dist/src/services/index.d.ts +4 -4
- package/dist/src/services/index.d.ts.map +1 -1
- package/dist/src/services/index.js +4 -4
- package/dist/src/services/index.js.map +1 -1
- package/dist/src/services/registry-api.d.ts +58 -0
- package/dist/src/services/registry-api.d.ts.map +1 -0
- package/dist/src/services/registry-api.js +92 -200
- package/dist/src/services/registry-api.js.map +1 -1
- package/dist/src/services/ruvector-training.d.ts +222 -0
- package/dist/src/services/ruvector-training.d.ts.map +1 -0
- package/dist/src/services/ruvector-training.js +257 -337
- package/dist/src/services/ruvector-training.js.map +1 -1
- package/dist/src/services/worker-daemon.d.ts +228 -0
- package/dist/src/services/worker-daemon.d.ts.map +1 -0
- package/dist/src/services/worker-daemon.js +591 -849
- package/dist/src/services/worker-daemon.js.map +1 -1
- package/dist/src/services/worker-queue.d.ts +194 -0
- package/dist/src/services/worker-queue.d.ts.map +1 -0
- package/dist/src/services/worker-queue.js +331 -548
- package/dist/src/services/worker-queue.js.map +1 -1
- package/dist/src/suggest.d.ts +53 -0
- package/dist/src/suggest.d.ts.map +1 -0
- package/dist/src/suggest.js +45 -55
- package/dist/src/suggest.js.map +1 -1
- package/dist/src/transfer/anonymization/index.js +29 -37
- package/dist/src/transfer/anonymization/index.js.map +1 -1
- package/dist/src/transfer/deploy-seraphine.js +128 -155
- package/dist/src/transfer/deploy-seraphine.js.map +1 -1
- package/dist/src/transfer/export.d.ts +25 -0
- package/dist/src/transfer/export.d.ts.map +1 -0
- package/dist/src/transfer/export.js +84 -142
- package/dist/src/transfer/export.js.map +1 -1
- package/dist/src/transfer/index.d.ts +1 -1
- package/dist/src/transfer/index.d.ts.map +1 -1
- package/dist/src/transfer/index.js +0 -2
- package/dist/src/transfer/index.js.map +1 -1
- package/dist/src/transfer/ipfs/client.d.ts +109 -0
- package/dist/src/transfer/ipfs/client.d.ts.map +1 -0
- package/dist/src/transfer/ipfs/client.js +187 -337
- package/dist/src/transfer/ipfs/client.js.map +1 -1
- package/dist/src/transfer/ipfs/upload.d.ts +95 -0
- package/dist/src/transfer/ipfs/upload.d.ts.map +1 -0
- package/dist/src/transfer/ipfs/upload.js +288 -434
- package/dist/src/transfer/ipfs/upload.js.map +1 -1
- package/dist/src/transfer/models/seraphine.d.ts +72 -0
- package/dist/src/transfer/models/seraphine.d.ts.map +1 -0
- package/dist/src/transfer/models/seraphine.js +55 -55
- package/dist/src/transfer/models/seraphine.js.map +1 -1
- package/dist/src/transfer/serialization/cfp.d.ts +49 -0
- package/dist/src/transfer/serialization/cfp.d.ts.map +1 -0
- package/dist/src/transfer/serialization/cfp.js +30 -31
- package/dist/src/transfer/serialization/cfp.js.map +1 -1
- package/dist/src/transfer/storage/gcs.d.ts +82 -0
- package/dist/src/transfer/storage/gcs.d.ts.map +1 -0
- package/dist/src/transfer/storage/gcs.js +165 -232
- package/dist/src/transfer/storage/gcs.js.map +1 -1
- package/dist/src/transfer/store/discovery.d.ts +84 -0
- package/dist/src/transfer/store/discovery.d.ts.map +1 -0
- package/dist/src/transfer/store/discovery.js +239 -349
- package/dist/src/transfer/store/discovery.js.map +1 -1
- package/dist/src/transfer/store/download.d.ts +70 -0
- package/dist/src/transfer/store/download.d.ts.map +1 -0
- package/dist/src/transfer/store/download.js +243 -365
- package/dist/src/transfer/store/download.js.map +1 -1
- package/dist/src/transfer/store/index.d.ts +84 -0
- package/dist/src/transfer/store/index.d.ts.map +1 -0
- package/dist/src/transfer/store/index.js +63 -130
- package/dist/src/transfer/store/index.js.map +1 -1
- package/dist/src/transfer/store/publish.d.ts +76 -0
- package/dist/src/transfer/store/publish.d.ts.map +1 -0
- package/dist/src/transfer/store/publish.js +184 -258
- package/dist/src/transfer/store/publish.js.map +1 -1
- package/dist/src/transfer/store/registry.js +50 -72
- package/dist/src/transfer/store/registry.js.map +1 -1
- package/dist/src/transfer/store/search.d.ts +54 -0
- package/dist/src/transfer/store/search.d.ts.map +1 -0
- package/dist/src/transfer/store/search.js +64 -96
- package/dist/src/transfer/store/search.js.map +1 -1
- package/dist/src/transfer/store/tests/standalone-test.js +174 -231
- package/dist/src/transfer/store/tests/standalone-test.js.map +1 -1
- package/dist/src/transfer/test-seraphine.js +95 -130
- package/dist/src/transfer/test-seraphine.js.map +1 -1
- package/dist/src/transfer/tests/test-store.js +194 -239
- package/dist/src/transfer/tests/test-store.js.map +1 -1
- package/dist/src/transfer/types.d.ts +245 -0
- package/dist/src/transfer/types.d.ts.map +1 -0
- package/dist/src/types.d.ts +198 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +26 -55
- package/dist/src/types.js.map +1 -1
- package/dist/src/update/checker.d.ts +34 -0
- package/dist/src/update/checker.d.ts.map +1 -0
- package/dist/src/update/checker.js +106 -183
- package/dist/src/update/checker.js.map +1 -1
- package/dist/src/update/executor.d.ts +32 -0
- package/dist/src/update/executor.d.ts.map +1 -0
- package/dist/src/update/executor.js +135 -198
- package/dist/src/update/executor.js.map +1 -1
- package/dist/src/update/index.d.ts +33 -0
- package/dist/src/update/index.d.ts.map +1 -0
- package/dist/src/update/index.js +38 -85
- package/dist/src/update/index.js.map +1 -1
- package/dist/src/update/rate-limiter.d.ts +20 -0
- package/dist/src/update/rate-limiter.d.ts.map +1 -0
- package/dist/src/update/rate-limiter.js +19 -31
- package/dist/src/update/rate-limiter.js.map +1 -1
- package/dist/src/update/validator.d.ts +17 -0
- package/dist/src/update/validator.d.ts.map +1 -0
- package/dist/src/update/validator.js +38 -64
- package/dist/src/update/validator.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -4,595 +4,467 @@
|
|
|
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
|
-
};
|
|
52
7
|
import { output } from '../output.js';
|
|
53
8
|
// Benchmark subcommand - REAL measurements
|
|
54
|
-
|
|
9
|
+
const benchmarkCommand = {
|
|
55
10
|
name: 'benchmark',
|
|
56
11
|
description: 'Run performance benchmarks',
|
|
57
12
|
options: [
|
|
58
|
-
{ name: 'suite', short: 's', type: 'string', description: 'Benchmark suite: all, wasm, neural, memory, search',
|
|
59
|
-
{ name: 'iterations', short: 'i', type: 'number', description: 'Number of iterations',
|
|
60
|
-
{ name: 'warmup', short: 'w', type: 'number', description: 'Warmup iterations',
|
|
61
|
-
{ name: 'output', short: 'o', type: 'string', description: 'Output format: text, json, csv',
|
|
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' },
|
|
62
17
|
],
|
|
63
18
|
examples: [
|
|
64
19
|
{ command: 'claude-flow performance benchmark -s neural', description: 'Benchmark neural operations' },
|
|
65
20
|
{ command: 'claude-flow performance benchmark -i 1000', description: 'Run with 1000 iterations' },
|
|
66
21
|
],
|
|
67
|
-
action:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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();
|
|
22
|
+
action: async (ctx) => {
|
|
23
|
+
const suite = ctx.flags.suite || 'all';
|
|
24
|
+
const iterations = parseInt(ctx.flags.iterations || '100', 10);
|
|
25
|
+
const warmup = parseInt(ctx.flags.warmup || '10', 10);
|
|
26
|
+
const outputFormat = ctx.flags.output || 'text';
|
|
27
|
+
output.writeln();
|
|
28
|
+
output.writeln(output.bold('Performance Benchmark (Real Measurements)'));
|
|
29
|
+
output.writeln(output.dim('─'.repeat(60)));
|
|
30
|
+
const spinner = output.createSpinner({ text: `Running ${suite} benchmarks...`, spinner: 'dots' });
|
|
31
|
+
spinner.start();
|
|
32
|
+
// Import real implementations
|
|
33
|
+
const { generateEmbedding, batchCosineSim, flashAttentionSearch, getHNSWStatus, storeEntry, searchEntries, } = await import('../memory/memory-initializer.js');
|
|
34
|
+
const { benchmarkAdaptation, initializeIntelligence } = await import('../memory/intelligence.js');
|
|
35
|
+
const results = [];
|
|
36
|
+
const startTotal = Date.now();
|
|
37
|
+
// Helper to compute percentiles
|
|
38
|
+
const percentile = (arr, p) => {
|
|
39
|
+
const sorted = [...arr].sort((a, b) => a - b);
|
|
40
|
+
const idx = Math.ceil((p / 100) * sorted.length) - 1;
|
|
41
|
+
return sorted[Math.max(0, idx)];
|
|
42
|
+
};
|
|
43
|
+
// 1. Embedding Generation Benchmark
|
|
44
|
+
if (suite === 'all' || suite === 'neural' || suite === 'memory') {
|
|
45
|
+
spinner.setText('Benchmarking embedding generation...');
|
|
46
|
+
const embedTimes = [];
|
|
47
|
+
// Warmup
|
|
48
|
+
for (let i = 0; i < warmup; i++) {
|
|
49
|
+
await generateEmbedding(`warmup text ${i}`);
|
|
50
|
+
}
|
|
51
|
+
// Actual measurement
|
|
52
|
+
for (let i = 0; i < iterations; i++) {
|
|
53
|
+
const start = performance.now();
|
|
54
|
+
await generateEmbedding(`benchmark text number ${i} with some varied content`);
|
|
55
|
+
embedTimes.push(performance.now() - start);
|
|
56
|
+
}
|
|
57
|
+
const mean = embedTimes.reduce((a, b) => a + b, 0) / embedTimes.length;
|
|
58
|
+
results.push({
|
|
59
|
+
operation: 'Embedding Gen',
|
|
60
|
+
mean: `${mean.toFixed(2)}ms`,
|
|
61
|
+
p95: `${percentile(embedTimes, 95).toFixed(2)}ms`,
|
|
62
|
+
p99: `${percentile(embedTimes, 99).toFixed(2)}ms`,
|
|
63
|
+
improvement: mean < 10 ? output.success('Target met') : output.warning('Below target'),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
// 2. Flash Attention-style Batch Operations
|
|
67
|
+
if (suite === 'all' || suite === 'wasm') {
|
|
68
|
+
spinner.setText('Benchmarking Flash Attention batch ops...');
|
|
69
|
+
const flashTimes = [];
|
|
70
|
+
// Generate test vectors
|
|
71
|
+
const testVectors = Array.from({ length: 100 }, () => new Float32Array(Array.from({ length: 384 }, () => Math.random())));
|
|
72
|
+
const queryVector = new Float32Array(Array.from({ length: 384 }, () => Math.random()));
|
|
73
|
+
// Warmup
|
|
74
|
+
for (let i = 0; i < warmup; i++) {
|
|
75
|
+
batchCosineSim(queryVector, testVectors);
|
|
76
|
+
}
|
|
77
|
+
// Actual measurement
|
|
78
|
+
for (let i = 0; i < iterations; i++) {
|
|
79
|
+
const start = performance.now();
|
|
80
|
+
flashAttentionSearch(queryVector, testVectors, { k: 10 });
|
|
81
|
+
flashTimes.push(performance.now() - start);
|
|
82
|
+
}
|
|
83
|
+
const mean = flashTimes.reduce((a, b) => a + b, 0) / flashTimes.length;
|
|
84
|
+
// Compare to baseline (single-vector comparison takes ~0.5μs, so 100 vectors baseline ~0.05ms)
|
|
85
|
+
const baselineMs = 0.05;
|
|
86
|
+
const speedup = baselineMs / mean;
|
|
87
|
+
results.push({
|
|
88
|
+
operation: 'Flash Attention',
|
|
89
|
+
mean: `${mean.toFixed(3)}ms`,
|
|
90
|
+
p95: `${percentile(flashTimes, 95).toFixed(3)}ms`,
|
|
91
|
+
p99: `${percentile(flashTimes, 99).toFixed(3)}ms`,
|
|
92
|
+
improvement: speedup > 1 ? output.success(`${speedup.toFixed(2)}x`) : output.dim(`${speedup.toFixed(2)}x`),
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// 3. HNSW Search Benchmark
|
|
96
|
+
if (suite === 'all' || suite === 'search') {
|
|
97
|
+
spinner.setText('Benchmarking HNSW search...');
|
|
98
|
+
const hnswStatus = getHNSWStatus();
|
|
99
|
+
if (hnswStatus.available && hnswStatus.entryCount > 0) {
|
|
100
|
+
const searchTimes = [];
|
|
101
|
+
const testQueries = [
|
|
102
|
+
'error handling patterns',
|
|
103
|
+
'authentication flow',
|
|
104
|
+
'database optimization',
|
|
105
|
+
'API design patterns',
|
|
106
|
+
'test coverage strategies',
|
|
107
|
+
];
|
|
108
|
+
// Warmup
|
|
109
|
+
for (const q of testQueries.slice(0, 2)) {
|
|
110
|
+
await searchEntries({ query: q, limit: 10 });
|
|
111
|
+
}
|
|
112
|
+
// Actual measurement
|
|
113
|
+
for (let i = 0; i < Math.min(iterations, 50); i++) {
|
|
114
|
+
const query = testQueries[i % testQueries.length];
|
|
115
|
+
const start = performance.now();
|
|
116
|
+
await searchEntries({ query, limit: 10 });
|
|
196
117
|
searchTimes.push(performance.now() - start);
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
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 } }];
|
|
118
|
+
}
|
|
119
|
+
const mean = searchTimes.reduce((a, b) => a + b, 0) / searchTimes.length;
|
|
120
|
+
// Brute force baseline: ~0.5μs per vector comparison, 1000 vectors = 0.5ms
|
|
121
|
+
// HNSW should be O(log n) ~150x faster
|
|
122
|
+
const baselineBruteForce = hnswStatus.entryCount * 0.0005;
|
|
123
|
+
const speedup = baselineBruteForce / (mean / 1000);
|
|
124
|
+
results.push({
|
|
125
|
+
operation: `HNSW Search (n=${hnswStatus.entryCount})`,
|
|
126
|
+
mean: `${mean.toFixed(2)}ms`,
|
|
127
|
+
p95: `${percentile(searchTimes, 95).toFixed(2)}ms`,
|
|
128
|
+
p99: `${percentile(searchTimes, 99).toFixed(2)}ms`,
|
|
129
|
+
improvement: speedup > 10 ? output.success(`~${Math.round(speedup)}x`) : output.dim(`${speedup.toFixed(1)}x`),
|
|
130
|
+
});
|
|
299
131
|
}
|
|
300
|
-
|
|
301
|
-
|
|
132
|
+
else {
|
|
133
|
+
results.push({
|
|
134
|
+
operation: 'HNSW Search',
|
|
135
|
+
mean: 'N/A',
|
|
136
|
+
p95: 'N/A',
|
|
137
|
+
p99: 'N/A',
|
|
138
|
+
improvement: output.warning('No index'),
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// 4. SONA Adaptation Benchmark
|
|
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
|
+
},
|
|
302
209
|
};
|
|
303
210
|
// Profile subcommand
|
|
304
|
-
|
|
211
|
+
const profileCommand = {
|
|
305
212
|
name: 'profile',
|
|
306
213
|
description: 'Profile application performance',
|
|
307
214
|
options: [
|
|
308
|
-
{ name: 'type', short: 't', type: 'string', description: 'Profile type: cpu, memory, io, all',
|
|
309
|
-
{ name: 'duration', short: 'd', type: 'number', description: 'Duration in seconds',
|
|
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' },
|
|
310
217
|
{ name: 'output', short: 'o', type: 'string', description: 'Output file for profile data' },
|
|
311
218
|
],
|
|
312
219
|
examples: [
|
|
313
220
|
{ command: 'claude-flow performance profile -t cpu', description: 'Profile CPU usage' },
|
|
314
221
|
{ command: 'claude-flow performance profile -d 60', description: 'Profile for 60 seconds' },
|
|
315
222
|
],
|
|
316
|
-
action:
|
|
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
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
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
|
-
}
|
|
223
|
+
action: async (ctx) => {
|
|
224
|
+
const type = ctx.flags.type || 'all';
|
|
225
|
+
const duration = parseInt(ctx.flags.duration || '30', 10);
|
|
226
|
+
output.writeln();
|
|
227
|
+
output.writeln(output.bold('Performance Profiler'));
|
|
228
|
+
output.writeln(output.dim('─'.repeat(50)));
|
|
229
|
+
const spinner = output.createSpinner({ text: 'Collecting profile data...', spinner: 'dots' });
|
|
230
|
+
spinner.start();
|
|
231
|
+
// Collect real metrics
|
|
232
|
+
const startCpu = process.cpuUsage();
|
|
233
|
+
const startMem = process.memoryUsage();
|
|
234
|
+
const startTime = process.hrtime.bigint();
|
|
235
|
+
// Sample for a brief period
|
|
236
|
+
await new Promise(r => setTimeout(r, Math.min(duration * 100, 2000)));
|
|
237
|
+
const endCpu = process.cpuUsage(startCpu);
|
|
238
|
+
const endMem = process.memoryUsage();
|
|
239
|
+
const endTime = process.hrtime.bigint();
|
|
240
|
+
spinner.succeed('Profile complete');
|
|
241
|
+
// Calculate real values
|
|
242
|
+
const elapsedMs = Number(endTime - startTime) / 1_000_000;
|
|
243
|
+
const cpuPercent = ((endCpu.user + endCpu.system) / 1000 / elapsedMs * 100).toFixed(1);
|
|
244
|
+
const heapUsedMB = (endMem.heapUsed / 1024 / 1024).toFixed(1);
|
|
245
|
+
const heapTotalMB = (endMem.heapTotal / 1024 / 1024).toFixed(1);
|
|
246
|
+
const rssMB = (endMem.rss / 1024 / 1024).toFixed(1);
|
|
247
|
+
const externalMB = (endMem.external / 1024 / 1024).toFixed(1);
|
|
248
|
+
// Get event loop lag (approximate)
|
|
249
|
+
const lagStart = Date.now();
|
|
250
|
+
await new Promise(r => setImmediate(r));
|
|
251
|
+
const eventLoopLag = (Date.now() - lagStart).toFixed(1);
|
|
252
|
+
// Determine status based on thresholds
|
|
253
|
+
const heapStatus = endMem.heapUsed / endMem.heapTotal > 0.9 ? output.error('High') :
|
|
254
|
+
endMem.heapUsed / endMem.heapTotal > 0.7 ? output.warning('Elevated') : output.success('Normal');
|
|
255
|
+
const lagStatus = parseFloat(eventLoopLag) > 50 ? output.error('High') :
|
|
256
|
+
parseFloat(eventLoopLag) > 10 ? output.warning('Elevated') : output.success('Normal');
|
|
257
|
+
output.writeln();
|
|
258
|
+
output.printTable({
|
|
259
|
+
columns: [
|
|
260
|
+
{ key: 'metric', header: 'Metric', width: 25 },
|
|
261
|
+
{ key: 'current', header: 'Current', width: 15 },
|
|
262
|
+
{ key: 'peak', header: 'Peak/Total', width: 15 },
|
|
263
|
+
{ key: 'status', header: 'Status', width: 15 },
|
|
264
|
+
],
|
|
265
|
+
data: [
|
|
266
|
+
{ metric: 'CPU Usage', current: `${cpuPercent}%`, peak: '-', status: output.success('Sampled') },
|
|
267
|
+
{ metric: 'Memory (Heap Used)', current: `${heapUsedMB} MB`, peak: `${heapTotalMB} MB`, status: heapStatus },
|
|
268
|
+
{ metric: 'Memory (RSS)', current: `${rssMB} MB`, peak: '-', status: output.success('Normal') },
|
|
269
|
+
{ metric: 'Memory (External)', current: `${externalMB} MB`, peak: '-', status: output.success('Normal') },
|
|
270
|
+
{ metric: 'Event Loop Lag', current: `${eventLoopLag}ms`, peak: '-', status: lagStatus },
|
|
271
|
+
{ metric: 'Node.js Uptime', current: `${process.uptime().toFixed(1)}s`, peak: '-', status: output.success('Running') },
|
|
272
|
+
],
|
|
376
273
|
});
|
|
377
|
-
|
|
274
|
+
output.writeln();
|
|
275
|
+
output.writeln(output.dim(`Profile duration: ${elapsedMs.toFixed(0)}ms`));
|
|
276
|
+
return { success: true };
|
|
277
|
+
},
|
|
378
278
|
};
|
|
379
279
|
// Metrics subcommand
|
|
380
|
-
|
|
280
|
+
const metricsCommand = {
|
|
381
281
|
name: 'metrics',
|
|
382
282
|
description: 'View and export performance metrics',
|
|
383
283
|
options: [
|
|
384
|
-
{ name: 'timeframe', short: 't', type: 'string', description: 'Timeframe: 1h, 24h, 7d, 30d',
|
|
385
|
-
{ name: 'format', short: 'f', type: 'string', description: 'Output format: text, json, prometheus',
|
|
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' },
|
|
386
286
|
{ name: 'component', short: 'c', type: 'string', description: 'Component to filter' },
|
|
387
287
|
],
|
|
388
288
|
examples: [
|
|
389
289
|
{ command: 'claude-flow performance metrics -t 7d', description: 'Show 7-day metrics' },
|
|
390
290
|
{ command: 'claude-flow performance metrics -f prometheus', description: 'Export as Prometheus format' },
|
|
391
291
|
],
|
|
392
|
-
action:
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
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 }];
|
|
292
|
+
action: async (ctx) => {
|
|
293
|
+
const timeframe = ctx.flags.timeframe || '24h';
|
|
294
|
+
const format = ctx.flags.format || 'text';
|
|
295
|
+
output.writeln();
|
|
296
|
+
output.writeln(output.bold(`Performance Metrics (${timeframe})`));
|
|
297
|
+
output.writeln(output.dim('─'.repeat(50)));
|
|
298
|
+
const os = await import('os');
|
|
299
|
+
const fs = await import('fs');
|
|
300
|
+
const path = await import('path');
|
|
301
|
+
// Real system metrics
|
|
302
|
+
const memUsage = process.memoryUsage();
|
|
303
|
+
const cpuUsage = process.cpuUsage();
|
|
304
|
+
const uptime = process.uptime();
|
|
305
|
+
const loadAvg = os.loadavg();
|
|
306
|
+
const freeMem = os.freemem();
|
|
307
|
+
const totalMem = os.totalmem();
|
|
308
|
+
// Calculate real metrics
|
|
309
|
+
const heapUsedMB = (memUsage.heapUsed / 1024 / 1024).toFixed(1);
|
|
310
|
+
const heapTotalMB = (memUsage.heapTotal / 1024 / 1024).toFixed(1);
|
|
311
|
+
const rssMB = (memUsage.rss / 1024 / 1024).toFixed(1);
|
|
312
|
+
const memPercent = ((1 - freeMem / totalMem) * 100).toFixed(1);
|
|
313
|
+
const cpuUserMs = (cpuUsage.user / 1000).toFixed(0);
|
|
314
|
+
const cpuSystemMs = (cpuUsage.system / 1000).toFixed(0);
|
|
315
|
+
// Try to get HNSW/cache stats from real data
|
|
316
|
+
let cacheHitRate = 'N/A';
|
|
317
|
+
let hnswEntries = 0;
|
|
318
|
+
try {
|
|
319
|
+
const { getHNSWStatus } = await import('../memory/memory-initializer.js');
|
|
320
|
+
const status = getHNSWStatus();
|
|
321
|
+
hnswEntries = status?.entryCount || 0;
|
|
322
|
+
}
|
|
323
|
+
catch { /* HNSW not initialized */ }
|
|
324
|
+
// Try to get real cache stats
|
|
325
|
+
let cacheEntries = 0;
|
|
326
|
+
try {
|
|
327
|
+
const cachePath = path.resolve('.cache/embeddings.db');
|
|
328
|
+
if (fs.existsSync(cachePath)) {
|
|
329
|
+
const stats = fs.statSync(cachePath);
|
|
330
|
+
cacheEntries = Math.floor(stats.size / 1600); // Approximate entries
|
|
586
331
|
}
|
|
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
|
+
],
|
|
587
455
|
});
|
|
588
|
-
|
|
456
|
+
output.writeln();
|
|
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
|
+
},
|
|
589
461
|
};
|
|
590
462
|
// Optimize subcommand
|
|
591
|
-
|
|
463
|
+
const optimizeCommand = {
|
|
592
464
|
name: 'optimize',
|
|
593
465
|
description: 'Run performance optimization recommendations',
|
|
594
466
|
options: [
|
|
595
|
-
{ name: 'target', short: 't', type: 'string', description: 'Target: memory, cpu, latency, all',
|
|
467
|
+
{ name: 'target', short: 't', type: 'string', description: 'Target: memory, cpu, latency, all', default: 'all' },
|
|
596
468
|
{ name: 'apply', short: 'a', type: 'boolean', description: 'Apply recommended optimizations' },
|
|
597
469
|
{ name: 'dry-run', short: 'd', type: 'boolean', description: 'Show changes without applying' },
|
|
598
470
|
],
|
|
@@ -600,91 +472,75 @@ var optimizeCommand = {
|
|
|
600
472
|
{ command: 'claude-flow performance optimize -t memory', description: 'Optimize memory usage' },
|
|
601
473
|
{ command: 'claude-flow performance optimize --apply', description: 'Apply all optimizations' },
|
|
602
474
|
],
|
|
603
|
-
action:
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
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
|
-
}
|
|
475
|
+
action: async (ctx) => {
|
|
476
|
+
const target = ctx.flags.target || 'all';
|
|
477
|
+
output.writeln();
|
|
478
|
+
output.writeln(output.bold('Performance Optimization'));
|
|
479
|
+
output.writeln(output.dim('─'.repeat(50)));
|
|
480
|
+
const spinner = output.createSpinner({ text: 'Analyzing performance...', spinner: 'dots' });
|
|
481
|
+
spinner.start();
|
|
482
|
+
await new Promise(r => setTimeout(r, 800));
|
|
483
|
+
spinner.succeed('Analysis complete');
|
|
484
|
+
output.writeln();
|
|
485
|
+
output.writeln(output.bold('Recommendations:'));
|
|
486
|
+
output.writeln();
|
|
487
|
+
output.printTable({
|
|
488
|
+
columns: [
|
|
489
|
+
{ key: 'priority', header: 'Priority', width: 10 },
|
|
490
|
+
{ key: 'area', header: 'Area', width: 15 },
|
|
491
|
+
{ key: 'recommendation', header: 'Recommendation', width: 40 },
|
|
492
|
+
{ key: 'impact', header: 'Impact', width: 15 },
|
|
493
|
+
],
|
|
494
|
+
data: [
|
|
495
|
+
{ priority: output.error('P0'), area: 'Memory', recommendation: 'Enable HNSW index quantization', impact: '+50% reduction' },
|
|
496
|
+
{ priority: output.warning('P1'), area: 'CPU', recommendation: 'Enable WASM SIMD acceleration', impact: '+4x speedup' },
|
|
497
|
+
{ priority: output.warning('P1'), area: 'Latency', recommendation: 'Enable Flash Attention', impact: '+2.49x speedup' },
|
|
498
|
+
{ priority: output.info('P2'), area: 'Cache', recommendation: 'Increase pattern cache size', impact: '+15% hit rate' },
|
|
499
|
+
{ priority: output.info('P2'), area: 'Network', recommendation: 'Enable request batching', impact: '-30% latency' },
|
|
500
|
+
],
|
|
638
501
|
});
|
|
639
|
-
|
|
502
|
+
return { success: true };
|
|
503
|
+
},
|
|
640
504
|
};
|
|
641
505
|
// Bottleneck subcommand
|
|
642
|
-
|
|
506
|
+
const bottleneckCommand = {
|
|
643
507
|
name: 'bottleneck',
|
|
644
508
|
description: 'Identify performance bottlenecks',
|
|
645
509
|
options: [
|
|
646
510
|
{ name: 'component', short: 'c', type: 'string', description: 'Component to analyze' },
|
|
647
|
-
{ name: 'depth', short: 'd', type: 'string', description: 'Analysis depth: quick, full',
|
|
511
|
+
{ name: 'depth', short: 'd', type: 'string', description: 'Analysis depth: quick, full', default: 'quick' },
|
|
648
512
|
],
|
|
649
513
|
examples: [
|
|
650
514
|
{ command: 'claude-flow performance bottleneck', description: 'Find bottlenecks' },
|
|
651
515
|
{ command: 'claude-flow performance bottleneck -d full', description: 'Full analysis' },
|
|
652
516
|
],
|
|
653
|
-
action:
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
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
|
-
}
|
|
517
|
+
action: async (ctx) => {
|
|
518
|
+
output.writeln();
|
|
519
|
+
output.writeln(output.bold('Bottleneck Analysis'));
|
|
520
|
+
output.writeln(output.dim('─'.repeat(50)));
|
|
521
|
+
const spinner = output.createSpinner({ text: 'Analyzing system...', spinner: 'dots' });
|
|
522
|
+
spinner.start();
|
|
523
|
+
await new Promise(r => setTimeout(r, 600));
|
|
524
|
+
spinner.succeed('Analysis complete');
|
|
525
|
+
output.writeln();
|
|
526
|
+
output.printTable({
|
|
527
|
+
columns: [
|
|
528
|
+
{ key: 'component', header: 'Component', width: 20 },
|
|
529
|
+
{ key: 'bottleneck', header: 'Bottleneck', width: 25 },
|
|
530
|
+
{ key: 'severity', header: 'Severity', width: 12 },
|
|
531
|
+
{ key: 'solution', header: 'Solution', width: 30 },
|
|
532
|
+
],
|
|
533
|
+
data: [
|
|
534
|
+
{ component: 'Vector Search', bottleneck: 'Linear scan O(n)', severity: output.error('High'), solution: 'Enable HNSW indexing' },
|
|
535
|
+
{ component: 'Neural Inference', bottleneck: 'Sequential attention', severity: output.warning('Medium'), solution: 'Enable Flash Attention' },
|
|
536
|
+
{ component: 'Memory Store', bottleneck: 'Lock contention', severity: output.info('Low'), solution: 'Use sharded storage' },
|
|
537
|
+
],
|
|
683
538
|
});
|
|
684
|
-
|
|
539
|
+
return { success: true };
|
|
540
|
+
},
|
|
685
541
|
};
|
|
686
542
|
// Main performance command
|
|
687
|
-
export
|
|
543
|
+
export const performanceCommand = {
|
|
688
544
|
name: 'performance',
|
|
689
545
|
description: 'Performance profiling, benchmarking, optimization, metrics',
|
|
690
546
|
aliases: ['perf'],
|
|
@@ -694,32 +550,30 @@ export var performanceCommand = {
|
|
|
694
550
|
{ command: 'claude-flow performance profile', description: 'Profile application' },
|
|
695
551
|
{ command: 'claude-flow perf metrics', description: 'View metrics (alias)' },
|
|
696
552
|
],
|
|
697
|
-
action:
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
});
|
|
722
|
-
}); }
|
|
553
|
+
action: async () => {
|
|
554
|
+
output.writeln();
|
|
555
|
+
output.writeln(output.bold('RuFlo Performance Suite'));
|
|
556
|
+
output.writeln(output.dim('Advanced performance profiling and optimization'));
|
|
557
|
+
output.writeln();
|
|
558
|
+
output.writeln('Subcommands:');
|
|
559
|
+
output.printList([
|
|
560
|
+
'benchmark - Run performance benchmarks (WASM, neural, search)',
|
|
561
|
+
'profile - Profile CPU, memory, I/O usage',
|
|
562
|
+
'metrics - View and export performance metrics',
|
|
563
|
+
'optimize - Get optimization recommendations',
|
|
564
|
+
'bottleneck - Identify performance bottlenecks',
|
|
565
|
+
]);
|
|
566
|
+
output.writeln();
|
|
567
|
+
output.writeln('Performance Targets:');
|
|
568
|
+
output.printList([
|
|
569
|
+
'HNSW Search: 150x-12,500x faster than brute force',
|
|
570
|
+
'Flash Attention: 2.49x-7.47x speedup',
|
|
571
|
+
'Memory: 50-75% reduction with quantization',
|
|
572
|
+
]);
|
|
573
|
+
output.writeln();
|
|
574
|
+
output.writeln(output.dim('Created with ❤️ by ruv.io'));
|
|
575
|
+
return { success: true };
|
|
576
|
+
},
|
|
723
577
|
};
|
|
724
578
|
export default performanceCommand;
|
|
725
579
|
//# sourceMappingURL=performance.js.map
|