@sparkleideas/cli 3.1.0-alpha.37 β 3.1.0-alpha.44
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/helpers/learning-service.mjs +3 -3
- 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 +404 -0
- package/dist/src/benchmarks/pretrain/index.js.map +1 -0
- package/dist/src/commands/agent.d.ts +8 -0
- package/dist/src/commands/agent.d.ts.map +1 -0
- package/dist/src/commands/agent.js +819 -0
- package/dist/src/commands/agent.js.map +1 -0
- package/dist/src/commands/analyze.d.ts +19 -0
- package/dist/src/commands/analyze.d.ts.map +1 -0
- package/dist/src/commands/analyze.js +1823 -0
- package/dist/src/commands/analyze.js.map +1 -0
- package/dist/src/commands/benchmark.d.ts +10 -0
- package/dist/src/commands/benchmark.d.ts.map +1 -0
- package/dist/src/commands/benchmark.js +459 -0
- package/dist/src/commands/benchmark.js.map +1 -0
- package/dist/src/commands/claims.d.ts +10 -0
- package/dist/src/commands/claims.d.ts.map +1 -0
- package/dist/src/commands/claims.js +373 -0
- package/dist/src/commands/claims.js.map +1 -0
- package/dist/src/commands/completions.d.ts +10 -0
- package/dist/src/commands/completions.d.ts.map +1 -0
- package/dist/src/commands/completions.js +539 -0
- package/dist/src/commands/completions.js.map +1 -0
- package/dist/src/commands/config.d.ts +8 -0
- package/dist/src/commands/config.d.ts.map +1 -0
- package/dist/src/commands/config.js +406 -0
- package/dist/src/commands/config.js.map +1 -0
- package/dist/src/commands/daemon.d.ts +8 -0
- package/dist/src/commands/daemon.d.ts.map +1 -0
- package/dist/src/commands/daemon.js +593 -0
- package/dist/src/commands/daemon.js.map +1 -0
- package/dist/src/commands/deployment.d.ts +10 -0
- package/dist/src/commands/deployment.d.ts.map +1 -0
- package/dist/src/commands/deployment.js +289 -0
- package/dist/src/commands/deployment.js.map +1 -0
- package/dist/src/commands/doctor.d.ts +10 -0
- package/dist/src/commands/doctor.d.ts.map +1 -0
- package/dist/src/commands/doctor.js +571 -0
- package/dist/src/commands/doctor.js.map +1 -0
- package/dist/src/commands/embeddings.d.ts +18 -0
- package/dist/src/commands/embeddings.d.ts.map +1 -0
- package/dist/src/commands/embeddings.js +1576 -0
- package/dist/src/commands/embeddings.js.map +1 -0
- package/dist/src/commands/guidance.d.ts +8 -0
- package/dist/src/commands/guidance.d.ts.map +1 -0
- package/dist/src/commands/guidance.js +560 -0
- package/dist/src/commands/guidance.js.map +1 -0
- package/dist/src/commands/hive-mind.d.ts +11 -0
- package/dist/src/commands/hive-mind.d.ts.map +1 -0
- package/dist/src/commands/hive-mind.js +1230 -0
- package/dist/src/commands/hive-mind.js.map +1 -0
- package/dist/src/commands/hooks.d.ts +8 -0
- package/dist/src/commands/hooks.d.ts.map +1 -0
- package/dist/src/commands/hooks.js +3756 -0
- package/dist/src/commands/hooks.js.map +1 -0
- package/dist/src/commands/index.d.ts +108 -0
- package/dist/src/commands/index.d.ts.map +1 -0
- package/dist/src/commands/index.js +359 -0
- package/dist/src/commands/index.js.map +1 -0
- package/dist/src/commands/init.d.ts +8 -0
- package/dist/src/commands/init.d.ts.map +1 -0
- package/dist/src/commands/init.js +970 -0
- package/dist/src/commands/init.js.map +1 -0
- package/dist/src/commands/issues.d.ts +21 -0
- package/dist/src/commands/issues.d.ts.map +1 -0
- package/dist/src/commands/issues.js +567 -0
- package/dist/src/commands/issues.js.map +1 -0
- package/dist/src/commands/mcp.d.ts +11 -0
- package/dist/src/commands/mcp.d.ts.map +1 -0
- package/dist/src/commands/mcp.js +700 -0
- package/dist/src/commands/mcp.js.map +1 -0
- package/dist/src/commands/memory.d.ts +8 -0
- package/dist/src/commands/memory.d.ts.map +1 -0
- package/dist/src/commands/memory.js +1268 -0
- package/dist/src/commands/memory.js.map +1 -0
- package/dist/src/commands/migrate.d.ts +8 -0
- package/dist/src/commands/migrate.d.ts.map +1 -0
- package/dist/src/commands/migrate.js +410 -0
- package/dist/src/commands/migrate.js.map +1 -0
- package/dist/src/commands/neural.d.ts +10 -0
- package/dist/src/commands/neural.d.ts.map +1 -0
- package/dist/src/commands/neural.js +1448 -0
- package/dist/src/commands/neural.js.map +1 -0
- package/dist/src/commands/performance.d.ts +10 -0
- package/dist/src/commands/performance.d.ts.map +1 -0
- package/dist/src/commands/performance.js +579 -0
- package/dist/src/commands/performance.js.map +1 -0
- package/dist/src/commands/plugins.d.ts +11 -0
- package/dist/src/commands/plugins.d.ts.map +1 -0
- package/dist/src/commands/plugins.js +820 -0
- package/dist/src/commands/plugins.js.map +1 -0
- package/dist/src/commands/process.d.ts +10 -0
- package/dist/src/commands/process.d.ts.map +1 -0
- package/dist/src/commands/process.js +641 -0
- package/dist/src/commands/process.js.map +1 -0
- package/dist/src/commands/progress.d.ts +11 -0
- package/dist/src/commands/progress.d.ts.map +1 -0
- package/dist/src/commands/progress.js +259 -0
- package/dist/src/commands/progress.js.map +1 -0
- package/dist/src/commands/providers.d.ts +10 -0
- package/dist/src/commands/providers.d.ts.map +1 -0
- package/dist/src/commands/providers.js +232 -0
- package/dist/src/commands/providers.js.map +1 -0
- package/dist/src/commands/route.d.ts +16 -0
- package/dist/src/commands/route.d.ts.map +1 -0
- package/dist/src/commands/route.js +813 -0
- package/dist/src/commands/route.js.map +1 -0
- package/dist/src/commands/ruvector/backup.d.ts +11 -0
- package/dist/src/commands/ruvector/backup.d.ts.map +1 -0
- package/dist/src/commands/ruvector/backup.js +746 -0
- package/dist/src/commands/ruvector/backup.js.map +1 -0
- package/dist/src/commands/ruvector/benchmark.d.ts +11 -0
- package/dist/src/commands/ruvector/benchmark.d.ts.map +1 -0
- package/dist/src/commands/ruvector/benchmark.js +480 -0
- package/dist/src/commands/ruvector/benchmark.js.map +1 -0
- package/dist/src/commands/ruvector/import.d.ts +18 -0
- package/dist/src/commands/ruvector/import.d.ts.map +1 -0
- package/dist/src/commands/ruvector/import.js +349 -0
- package/dist/src/commands/ruvector/import.js.map +1 -0
- package/dist/src/commands/ruvector/index.d.ts +29 -0
- package/dist/src/commands/ruvector/index.d.ts.map +1 -0
- package/dist/src/commands/ruvector/index.js +129 -0
- package/dist/src/commands/ruvector/index.js.map +1 -0
- package/dist/src/commands/ruvector/init.d.ts +11 -0
- package/dist/src/commands/ruvector/init.d.ts.map +1 -0
- package/dist/src/commands/ruvector/init.js +431 -0
- package/dist/src/commands/ruvector/init.js.map +1 -0
- package/dist/src/commands/ruvector/migrate.d.ts +11 -0
- package/dist/src/commands/ruvector/migrate.d.ts.map +1 -0
- package/dist/src/commands/ruvector/migrate.js +481 -0
- package/dist/src/commands/ruvector/migrate.js.map +1 -0
- package/dist/src/commands/ruvector/optimize.d.ts +11 -0
- package/dist/src/commands/ruvector/optimize.d.ts.map +1 -0
- package/dist/src/commands/ruvector/optimize.js +503 -0
- package/dist/src/commands/ruvector/optimize.js.map +1 -0
- package/dist/src/commands/ruvector/setup.d.ts +18 -0
- package/dist/src/commands/ruvector/setup.d.ts.map +1 -0
- package/dist/src/commands/ruvector/setup.js +765 -0
- package/dist/src/commands/ruvector/setup.js.map +1 -0
- package/dist/src/commands/ruvector/status.d.ts +11 -0
- package/dist/src/commands/ruvector/status.d.ts.map +1 -0
- package/dist/src/commands/ruvector/status.js +456 -0
- package/dist/src/commands/ruvector/status.js.map +1 -0
- package/dist/src/commands/security.d.ts +10 -0
- package/dist/src/commands/security.d.ts.map +1 -0
- package/dist/src/commands/security.js +575 -0
- package/dist/src/commands/security.js.map +1 -0
- package/dist/src/commands/session.d.ts +8 -0
- package/dist/src/commands/session.d.ts.map +1 -0
- package/dist/src/commands/session.js +750 -0
- package/dist/src/commands/session.js.map +1 -0
- package/dist/src/commands/start.d.ts +8 -0
- package/dist/src/commands/start.d.ts.map +1 -0
- package/dist/src/commands/start.js +418 -0
- package/dist/src/commands/start.js.map +1 -0
- package/dist/src/commands/status.d.ts +8 -0
- package/dist/src/commands/status.d.ts.map +1 -0
- package/dist/src/commands/status.js +584 -0
- package/dist/src/commands/status.js.map +1 -0
- package/dist/src/commands/swarm.d.ts +8 -0
- package/dist/src/commands/swarm.d.ts.map +1 -0
- package/dist/src/commands/swarm.js +748 -0
- package/dist/src/commands/swarm.js.map +1 -0
- package/dist/src/commands/task.d.ts +8 -0
- package/dist/src/commands/task.d.ts.map +1 -0
- package/dist/src/commands/task.js +671 -0
- package/dist/src/commands/task.js.map +1 -0
- package/dist/src/commands/transfer-store.d.ts +13 -0
- package/dist/src/commands/transfer-store.d.ts.map +1 -0
- package/dist/src/commands/transfer-store.js +428 -0
- package/dist/src/commands/transfer-store.js.map +1 -0
- package/dist/src/commands/update.d.ts +8 -0
- package/dist/src/commands/update.d.ts.map +1 -0
- package/dist/src/commands/update.js +276 -0
- package/dist/src/commands/update.js.map +1 -0
- package/dist/src/commands/workflow.d.ts +8 -0
- package/dist/src/commands/workflow.d.ts.map +1 -0
- package/dist/src/commands/workflow.js +617 -0
- package/dist/src/commands/workflow.js.map +1 -0
- 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 +186 -0
- package/dist/src/config-adapter.js.map +1 -0
- package/dist/src/index.d.ts +76 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +470 -0
- package/dist/src/index.js.map +1 -0
- 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 +264 -0
- package/dist/src/infrastructure/in-memory-repositories.js.map +1 -0
- 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 +486 -0
- package/dist/src/init/claudemd-generator.js.map +1 -0
- 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 +1630 -0
- package/dist/src/init/executor.js.map +1 -0
- package/dist/src/init/helpers-generator.d.ts +42 -0
- package/dist/src/init/helpers-generator.d.ts.map +1 -0
- package/dist/src/init/helpers-generator.js +613 -0
- package/dist/src/init/helpers-generator.js.map +1 -0
- package/dist/src/init/index.d.ts +13 -0
- package/dist/src/init/index.d.ts.map +1 -0
- package/dist/src/init/index.js +15 -0
- package/dist/src/init/index.js.map +1 -0
- package/dist/src/init/mcp-generator.d.ts +27 -0
- package/dist/src/init/mcp-generator.d.ts.map +1 -0
- package/dist/src/init/mcp-generator.js +100 -0
- package/dist/src/init/mcp-generator.js.map +1 -0
- package/dist/src/init/settings-generator.d.ts +14 -0
- package/dist/src/init/settings-generator.d.ts.map +1 -0
- package/dist/src/init/settings-generator.js +396 -0
- package/dist/src/init/settings-generator.js.map +1 -0
- package/dist/src/init/statusline-generator.d.ts +20 -0
- package/dist/src/init/statusline-generator.d.ts.map +1 -0
- package/dist/src/init/statusline-generator.js +1241 -0
- package/dist/src/init/statusline-generator.js.map +1 -0
- package/dist/src/init/types.d.ts +279 -0
- package/dist/src/init/types.d.ts.map +1 -0
- package/dist/src/init/types.js +252 -0
- package/dist/src/init/types.js.map +1 -0
- 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 +233 -0
- package/dist/src/mcp-client.js.map +1 -0
- 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 +601 -0
- package/dist/src/mcp-server.js.map +1 -0
- package/dist/src/mcp-tools/agent-tools.d.ts +9 -0
- package/dist/src/mcp-tools/agent-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/agent-tools.js +549 -0
- package/dist/src/mcp-tools/agent-tools.js.map +1 -0
- package/dist/src/mcp-tools/analyze-tools.d.ts +38 -0
- package/dist/src/mcp-tools/analyze-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/analyze-tools.js +317 -0
- package/dist/src/mcp-tools/analyze-tools.js.map +1 -0
- 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 +131 -0
- package/dist/src/mcp-tools/auto-install.js.map +1 -0
- package/dist/src/mcp-tools/browser-tools.d.ts +13 -0
- package/dist/src/mcp-tools/browser-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/browser-tools.js +550 -0
- package/dist/src/mcp-tools/browser-tools.js.map +1 -0
- package/dist/src/mcp-tools/claims-tools.d.ts +12 -0
- package/dist/src/mcp-tools/claims-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/claims-tools.js +732 -0
- package/dist/src/mcp-tools/claims-tools.js.map +1 -0
- package/dist/src/mcp-tools/config-tools.d.ts +8 -0
- package/dist/src/mcp-tools/config-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/config-tools.js +333 -0
- package/dist/src/mcp-tools/config-tools.js.map +1 -0
- package/dist/src/mcp-tools/coordination-tools.d.ts +13 -0
- package/dist/src/mcp-tools/coordination-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/coordination-tools.js +486 -0
- package/dist/src/mcp-tools/coordination-tools.js.map +1 -0
- package/dist/src/mcp-tools/daa-tools.d.ts +13 -0
- package/dist/src/mcp-tools/daa-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/daa-tools.js +426 -0
- package/dist/src/mcp-tools/daa-tools.js.map +1 -0
- package/dist/src/mcp-tools/embeddings-tools.d.ts +9 -0
- package/dist/src/mcp-tools/embeddings-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/embeddings-tools.js +782 -0
- package/dist/src/mcp-tools/embeddings-tools.js.map +1 -0
- package/dist/src/mcp-tools/github-tools.d.ts +13 -0
- package/dist/src/mcp-tools/github-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/github-tools.js +373 -0
- package/dist/src/mcp-tools/github-tools.js.map +1 -0
- package/dist/src/mcp-tools/hive-mind-tools.d.ts +8 -0
- package/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/hive-mind-tools.js +583 -0
- package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -0
- package/dist/src/mcp-tools/hooks-tools.d.ts +44 -0
- package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/hooks-tools.js +2797 -0
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -0
- package/dist/src/mcp-tools/index.d.ts +23 -0
- package/dist/src/mcp-tools/index.d.ts.map +1 -0
- package/dist/src/mcp-tools/index.js +22 -0
- package/dist/src/mcp-tools/index.js.map +1 -0
- package/dist/src/mcp-tools/memory-tools.d.ts +14 -0
- package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/memory-tools.js +482 -0
- package/dist/src/mcp-tools/memory-tools.js.map +1 -0
- package/dist/src/mcp-tools/neural-tools.d.ts +16 -0
- package/dist/src/mcp-tools/neural-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/neural-tools.js +456 -0
- package/dist/src/mcp-tools/neural-tools.js.map +1 -0
- package/dist/src/mcp-tools/performance-tools.d.ts +16 -0
- package/dist/src/mcp-tools/performance-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/performance-tools.js +534 -0
- package/dist/src/mcp-tools/performance-tools.js.map +1 -0
- package/dist/src/mcp-tools/progress-tools.d.ts +14 -0
- package/dist/src/mcp-tools/progress-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/progress-tools.js +348 -0
- package/dist/src/mcp-tools/progress-tools.js.map +1 -0
- package/dist/src/mcp-tools/security-tools.d.ts +18 -0
- package/dist/src/mcp-tools/security-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/security-tools.js +434 -0
- package/dist/src/mcp-tools/security-tools.js.map +1 -0
- package/dist/src/mcp-tools/session-tools.d.ts +8 -0
- package/dist/src/mcp-tools/session-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/session-tools.js +315 -0
- package/dist/src/mcp-tools/session-tools.js.map +1 -0
- package/dist/src/mcp-tools/swarm-tools.d.ts +8 -0
- package/dist/src/mcp-tools/swarm-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/swarm-tools.js +102 -0
- package/dist/src/mcp-tools/swarm-tools.js.map +1 -0
- package/dist/src/mcp-tools/system-tools.d.ts +13 -0
- package/dist/src/mcp-tools/system-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/system-tools.js +314 -0
- package/dist/src/mcp-tools/system-tools.js.map +1 -0
- package/dist/src/mcp-tools/task-tools.d.ts +8 -0
- package/dist/src/mcp-tools/task-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/task-tools.js +302 -0
- package/dist/src/mcp-tools/task-tools.js.map +1 -0
- package/dist/src/mcp-tools/terminal-tools.d.ts +13 -0
- package/dist/src/mcp-tools/terminal-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/terminal-tools.js +246 -0
- package/dist/src/mcp-tools/terminal-tools.js.map +1 -0
- package/dist/src/mcp-tools/transfer-tools.d.ts +14 -0
- package/dist/src/mcp-tools/transfer-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/transfer-tools.js +396 -0
- package/dist/src/mcp-tools/transfer-tools.js.map +1 -0
- 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/types.js +7 -0
- package/dist/src/mcp-tools/types.js.map +1 -0
- package/dist/src/mcp-tools/workflow-tools.d.ts +8 -0
- package/dist/src/mcp-tools/workflow-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/workflow-tools.js +481 -0
- package/dist/src/mcp-tools/workflow-tools.js.map +1 -0
- package/dist/src/memory/ewc-consolidation.d.ts +271 -0
- package/dist/src/memory/ewc-consolidation.d.ts.map +1 -0
- package/dist/src/memory/ewc-consolidation.js +542 -0
- package/dist/src/memory/ewc-consolidation.js.map +1 -0
- package/dist/src/memory/intelligence.d.ts +285 -0
- package/dist/src/memory/intelligence.d.ts.map +1 -0
- package/dist/src/memory/intelligence.js +766 -0
- package/dist/src/memory/intelligence.js.map +1 -0
- package/dist/src/memory/memory-initializer.d.ts +396 -0
- package/dist/src/memory/memory-initializer.d.ts.map +1 -0
- package/dist/src/memory/memory-initializer.js +1933 -0
- package/dist/src/memory/memory-initializer.js.map +1 -0
- 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 +633 -0
- package/dist/src/memory/sona-optimizer.js.map +1 -0
- package/dist/src/output.d.ts +133 -0
- package/dist/src/output.d.ts.map +1 -0
- package/dist/src/output.js +513 -0
- package/dist/src/output.js.map +1 -0
- package/dist/src/parser.d.ts +41 -0
- package/dist/src/parser.d.ts.map +1 -0
- package/dist/src/parser.js +377 -0
- package/dist/src/parser.js.map +1 -0
- 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 +383 -0
- package/dist/src/plugins/manager.js.map +1 -0
- 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 +1147 -0
- package/dist/src/plugins/store/discovery.js.map +1 -0
- 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 +141 -0
- package/dist/src/plugins/store/index.js.map +1 -0
- 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 +230 -0
- package/dist/src/plugins/store/search.js.map +1 -0
- 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/store/types.js +7 -0
- package/dist/src/plugins/store/types.js.map +1 -0
- package/dist/src/plugins/tests/demo-plugin-store.d.ts +7 -0
- package/dist/src/plugins/tests/demo-plugin-store.d.ts.map +1 -0
- package/dist/src/plugins/tests/demo-plugin-store.js +126 -0
- package/dist/src/plugins/tests/demo-plugin-store.js.map +1 -0
- package/dist/src/plugins/tests/standalone-test.d.ts +12 -0
- package/dist/src/plugins/tests/standalone-test.d.ts.map +1 -0
- package/dist/src/plugins/tests/standalone-test.js +188 -0
- package/dist/src/plugins/tests/standalone-test.js.map +1 -0
- package/dist/src/plugins/tests/test-plugin-store.d.ts +7 -0
- package/dist/src/plugins/tests/test-plugin-store.d.ts.map +1 -0
- package/dist/src/plugins/tests/test-plugin-store.js +206 -0
- package/dist/src/plugins/tests/test-plugin-store.js.map +1 -0
- 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 +241 -0
- package/dist/src/production/circuit-breaker.js.map +1 -0
- 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 +299 -0
- package/dist/src/production/error-handler.js.map +1 -0
- package/dist/src/production/index.d.ts +23 -0
- package/dist/src/production/index.d.ts.map +1 -0
- package/dist/src/production/index.js +18 -0
- package/dist/src/production/index.js.map +1 -0
- 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 +356 -0
- package/dist/src/production/monitoring.js.map +1 -0
- 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 +201 -0
- package/dist/src/production/rate-limiter.js.map +1 -0
- 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 +179 -0
- package/dist/src/production/retry.js.map +1 -0
- package/dist/src/prompt.d.ts +44 -0
- package/dist/src/prompt.d.ts.map +1 -0
- package/dist/src/prompt.js +501 -0
- package/dist/src/prompt.js.map +1 -0
- 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 +284 -0
- package/dist/src/runtime/headless.js.map +1 -0
- 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 +277 -0
- package/dist/src/ruvector/ast-analyzer.js.map +1 -0
- 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 +529 -0
- package/dist/src/ruvector/coverage-router.js.map +1 -0
- package/dist/src/ruvector/coverage-tools.d.ts +33 -0
- package/dist/src/ruvector/coverage-tools.d.ts.map +1 -0
- package/dist/src/ruvector/coverage-tools.js +157 -0
- package/dist/src/ruvector/coverage-tools.js.map +1 -0
- 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 +698 -0
- package/dist/src/ruvector/diff-classifier.js.map +1 -0
- 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 +519 -0
- package/dist/src/ruvector/enhanced-model-router.js.map +1 -0
- 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 +643 -0
- package/dist/src/ruvector/flash-attention.js.map +1 -0
- 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 +929 -0
- package/dist/src/ruvector/graph-analyzer.js.map +1 -0
- package/dist/src/ruvector/index.d.ts +34 -0
- package/dist/src/ruvector/index.d.ts.map +1 -0
- package/dist/src/ruvector/index.js +60 -0
- package/dist/src/ruvector/index.js.map +1 -0
- 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 +455 -0
- package/dist/src/ruvector/lora-adapter.js.map +1 -0
- 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 +488 -0
- package/dist/src/ruvector/model-router.js.map +1 -0
- 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 +626 -0
- package/dist/src/ruvector/moe-router.js.map +1 -0
- 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 +681 -0
- package/dist/src/ruvector/q-learning-router.js.map +1 -0
- 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 +178 -0
- package/dist/src/ruvector/semantic-router.js.map +1 -0
- 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 +243 -0
- package/dist/src/ruvector/vector-db.js.map +1 -0
- 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 +818 -0
- package/dist/src/services/claim-service.js.map +1 -0
- 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 +581 -0
- package/dist/src/services/container-worker-pool.js.map +1 -0
- 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 +999 -0
- package/dist/src/services/headless-worker-executor.js.map +1 -0
- package/dist/src/services/index.d.ts +13 -0
- package/dist/src/services/index.d.ts.map +1 -0
- package/dist/src/services/index.js +11 -0
- package/dist/src/services/index.js.map +1 -0
- 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 +146 -0
- package/dist/src/services/registry-api.js.map +1 -0
- package/dist/src/services/ruvector-training.d.ts +213 -0
- package/dist/src/services/ruvector-training.d.ts.map +1 -0
- package/dist/src/services/ruvector-training.js +498 -0
- package/dist/src/services/ruvector-training.js.map +1 -0
- package/dist/src/services/worker-daemon.d.ts +203 -0
- package/dist/src/services/worker-daemon.d.ts.map +1 -0
- package/dist/src/services/worker-daemon.js +756 -0
- package/dist/src/services/worker-daemon.js.map +1 -0
- 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 +511 -0
- package/dist/src/services/worker-queue.js.map +1 -0
- package/dist/src/suggest.d.ts +53 -0
- package/dist/src/suggest.d.ts.map +1 -0
- package/dist/src/suggest.js +200 -0
- package/dist/src/suggest.js.map +1 -0
- package/dist/src/transfer/anonymization/index.d.ts +25 -0
- package/dist/src/transfer/anonymization/index.d.ts.map +1 -0
- package/dist/src/transfer/anonymization/index.js +175 -0
- package/dist/src/transfer/anonymization/index.js.map +1 -0
- package/dist/src/transfer/deploy-seraphine.d.ts +13 -0
- package/dist/src/transfer/deploy-seraphine.d.ts.map +1 -0
- package/dist/src/transfer/deploy-seraphine.js +205 -0
- package/dist/src/transfer/deploy-seraphine.js.map +1 -0
- 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 +113 -0
- package/dist/src/transfer/export.js.map +1 -0
- package/dist/src/transfer/index.d.ts +12 -0
- package/dist/src/transfer/index.d.ts.map +1 -0
- package/dist/src/transfer/index.js +31 -0
- package/dist/src/transfer/index.js.map +1 -0
- 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 +299 -0
- package/dist/src/transfer/ipfs/client.js.map +1 -0
- 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 +413 -0
- package/dist/src/transfer/ipfs/upload.js.map +1 -0
- 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 +373 -0
- package/dist/src/transfer/models/seraphine.js.map +1 -0
- 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 +180 -0
- package/dist/src/transfer/serialization/cfp.js.map +1 -0
- 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 +230 -0
- package/dist/src/transfer/storage/gcs.js.map +1 -0
- package/dist/src/transfer/storage/index.d.ts +6 -0
- package/dist/src/transfer/storage/index.d.ts.map +1 -0
- package/dist/src/transfer/storage/index.js +6 -0
- package/dist/src/transfer/storage/index.js.map +1 -0
- 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 +382 -0
- package/dist/src/transfer/store/discovery.js.map +1 -0
- 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 +334 -0
- package/dist/src/transfer/store/download.js.map +1 -0
- 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 +153 -0
- package/dist/src/transfer/store/index.js.map +1 -0
- 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 +294 -0
- package/dist/src/transfer/store/publish.js.map +1 -0
- package/dist/src/transfer/store/registry.d.ts +58 -0
- package/dist/src/transfer/store/registry.d.ts.map +1 -0
- package/dist/src/transfer/store/registry.js +285 -0
- package/dist/src/transfer/store/registry.js.map +1 -0
- 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 +232 -0
- package/dist/src/transfer/store/search.js.map +1 -0
- package/dist/src/transfer/store/tests/standalone-test.d.ts +12 -0
- package/dist/src/transfer/store/tests/standalone-test.d.ts.map +1 -0
- package/dist/src/transfer/store/tests/standalone-test.js +190 -0
- package/dist/src/transfer/store/tests/standalone-test.js.map +1 -0
- package/dist/src/transfer/store/types.d.ts +193 -0
- package/dist/src/transfer/store/types.d.ts.map +1 -0
- package/dist/src/transfer/store/types.js +6 -0
- package/dist/src/transfer/store/types.js.map +1 -0
- package/dist/src/transfer/test-seraphine.d.ts +6 -0
- package/dist/src/transfer/test-seraphine.d.ts.map +1 -0
- package/dist/src/transfer/test-seraphine.js +105 -0
- package/dist/src/transfer/test-seraphine.js.map +1 -0
- package/dist/src/transfer/tests/test-store.d.ts +7 -0
- package/dist/src/transfer/tests/test-store.d.ts.map +1 -0
- package/dist/src/transfer/tests/test-store.js +214 -0
- package/dist/src/transfer/tests/test-store.js.map +1 -0
- package/dist/src/transfer/types.d.ts +245 -0
- package/dist/src/transfer/types.d.ts.map +1 -0
- package/dist/src/transfer/types.js +6 -0
- package/dist/src/transfer/types.js.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 +38 -0
- package/dist/src/types.js.map +1 -0
- 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 +190 -0
- package/dist/src/update/checker.js.map +1 -0
- 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 +181 -0
- package/dist/src/update/executor.js.map +1 -0
- 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 +64 -0
- package/dist/src/update/index.js.map +1 -0
- 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 +96 -0
- package/dist/src/update/rate-limiter.js.map +1 -0
- 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 +123 -0
- package/dist/src/update/validator.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Statusline Configuration Generator
|
|
3
|
+
* Creates statusline configuration for V3 progress display
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Generate statusline configuration script
|
|
7
|
+
* Matches the advanced format:
|
|
8
|
+
* β Claude Flow V3 β user β β v3 β Opus 4.5
|
|
9
|
+
* βββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
10
|
+
* ποΈ DDD Domains [βββββ] 5/5 β‘ HNSW 12500x (or π 22.9k patterns)
|
|
11
|
+
* π€ Swarm β [12/15] π₯ 0 π’ CVE 3/3 πΎ 5177MB π 56% π§ 30%
|
|
12
|
+
* π§ Architecture DDD β100% β Security βCLEAN β Memory βAgentDB β Integration β
|
|
13
|
+
*/
|
|
14
|
+
export function generateStatuslineScript(options) {
|
|
15
|
+
const config = options.statusline;
|
|
16
|
+
// Generate CommonJS script - use .cjs extension for ES module project compatibility
|
|
17
|
+
return `#!/usr/bin/env node
|
|
18
|
+
/**
|
|
19
|
+
* Claude Flow V3 Statusline Generator
|
|
20
|
+
* Displays real-time V3 implementation progress and system status
|
|
21
|
+
*
|
|
22
|
+
* Usage: node statusline.cjs [--json] [--compact]
|
|
23
|
+
*
|
|
24
|
+
* IMPORTANT: This file uses .cjs extension to work in ES module projects.
|
|
25
|
+
* The require() syntax is intentional for CommonJS compatibility.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
29
|
+
const fs = require('fs');
|
|
30
|
+
const path = require('path');
|
|
31
|
+
const { execSync } = require('child_process');
|
|
32
|
+
|
|
33
|
+
// Configuration
|
|
34
|
+
const CONFIG = {
|
|
35
|
+
enabled: ${config.enabled},
|
|
36
|
+
showProgress: ${config.showProgress},
|
|
37
|
+
showSecurity: ${config.showSecurity},
|
|
38
|
+
showSwarm: ${config.showSwarm},
|
|
39
|
+
showHooks: ${config.showHooks},
|
|
40
|
+
showPerformance: ${config.showPerformance},
|
|
41
|
+
refreshInterval: ${config.refreshInterval},
|
|
42
|
+
maxAgents: ${options.runtime.maxAgents},
|
|
43
|
+
topology: '${options.runtime.topology}',
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// ANSI colors
|
|
47
|
+
const c = {
|
|
48
|
+
reset: '\\x1b[0m',
|
|
49
|
+
bold: '\\x1b[1m',
|
|
50
|
+
dim: '\\x1b[2m',
|
|
51
|
+
red: '\\x1b[0;31m',
|
|
52
|
+
green: '\\x1b[0;32m',
|
|
53
|
+
yellow: '\\x1b[0;33m',
|
|
54
|
+
blue: '\\x1b[0;34m',
|
|
55
|
+
purple: '\\x1b[0;35m',
|
|
56
|
+
cyan: '\\x1b[0;36m',
|
|
57
|
+
brightRed: '\\x1b[1;31m',
|
|
58
|
+
brightGreen: '\\x1b[1;32m',
|
|
59
|
+
brightYellow: '\\x1b[1;33m',
|
|
60
|
+
brightBlue: '\\x1b[1;34m',
|
|
61
|
+
brightPurple: '\\x1b[1;35m',
|
|
62
|
+
brightCyan: '\\x1b[1;36m',
|
|
63
|
+
brightWhite: '\\x1b[1;37m',
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// Get user info
|
|
67
|
+
function getUserInfo() {
|
|
68
|
+
let name = 'user';
|
|
69
|
+
let gitBranch = '';
|
|
70
|
+
let modelName = 'π€ Claude Code';
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
name = execSync('git config user.name 2>/dev/null || echo "user"', { encoding: 'utf-8' }).trim();
|
|
74
|
+
gitBranch = execSync('git branch --show-current 2>/dev/null || echo ""', { encoding: 'utf-8' }).trim();
|
|
75
|
+
} catch (e) {
|
|
76
|
+
// Ignore errors
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Auto-detect model from Claude Code's config
|
|
80
|
+
try {
|
|
81
|
+
const homedir = require('os').homedir();
|
|
82
|
+
const claudeConfigPath = path.join(homedir, '.claude.json');
|
|
83
|
+
if (fs.existsSync(claudeConfigPath)) {
|
|
84
|
+
const claudeConfig = JSON.parse(fs.readFileSync(claudeConfigPath, 'utf-8'));
|
|
85
|
+
// Try to find lastModelUsage - check current dir and parent dirs
|
|
86
|
+
let lastModelUsage = null;
|
|
87
|
+
const cwd = process.cwd();
|
|
88
|
+
if (claudeConfig.projects) {
|
|
89
|
+
// Try exact match first, then check if cwd starts with any project path
|
|
90
|
+
for (const [projectPath, projectConfig] of Object.entries(claudeConfig.projects)) {
|
|
91
|
+
if (cwd === projectPath || cwd.startsWith(projectPath + '/')) {
|
|
92
|
+
lastModelUsage = projectConfig.lastModelUsage;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (lastModelUsage) {
|
|
98
|
+
const modelIds = Object.keys(lastModelUsage);
|
|
99
|
+
if (modelIds.length > 0) {
|
|
100
|
+
// Find the most recently used model by checking lastUsedAt timestamps
|
|
101
|
+
// or fall back to the last key in the object (preserves insertion order in modern JS)
|
|
102
|
+
let modelId = modelIds[modelIds.length - 1];
|
|
103
|
+
let latestTimestamp = 0;
|
|
104
|
+
|
|
105
|
+
for (const id of modelIds) {
|
|
106
|
+
const usage = lastModelUsage[id];
|
|
107
|
+
// Check for lastUsedAt timestamp (if available)
|
|
108
|
+
if (usage.lastUsedAt) {
|
|
109
|
+
const ts = new Date(usage.lastUsedAt).getTime();
|
|
110
|
+
if (ts > latestTimestamp) {
|
|
111
|
+
latestTimestamp = ts;
|
|
112
|
+
modelId = id;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Parse model ID to human-readable name
|
|
118
|
+
if (modelId.includes('opus')) modelName = 'Opus 4.5';
|
|
119
|
+
else if (modelId.includes('sonnet')) modelName = 'Sonnet 4';
|
|
120
|
+
else if (modelId.includes('haiku')) modelName = 'Haiku 4.5';
|
|
121
|
+
else modelName = modelId.split('-').slice(1, 3).join(' ');
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
} catch (e) {
|
|
126
|
+
// Fallback to Unknown if can't read config
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Fallback: check project's .claude/settings.json for model
|
|
130
|
+
if (modelName === 'Unknown') {
|
|
131
|
+
try {
|
|
132
|
+
const settingsPath = path.join(process.cwd(), '.claude', 'settings.json');
|
|
133
|
+
if (fs.existsSync(settingsPath)) {
|
|
134
|
+
const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8'));
|
|
135
|
+
if (settings.model) {
|
|
136
|
+
if (settings.model.includes('opus')) modelName = 'Opus 4.5';
|
|
137
|
+
else if (settings.model.includes('sonnet')) modelName = 'Sonnet 4';
|
|
138
|
+
else if (settings.model.includes('haiku')) modelName = 'Haiku 4.5';
|
|
139
|
+
else modelName = settings.model.split('-').slice(1, 3).join(' ');
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
} catch (e) {
|
|
143
|
+
// Keep Unknown
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return { name, gitBranch, modelName };
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Get learning stats from memory database
|
|
151
|
+
function getLearningStats() {
|
|
152
|
+
const memoryPaths = [
|
|
153
|
+
path.join(process.cwd(), '.swarm', 'memory.db'),
|
|
154
|
+
path.join(process.cwd(), '.claude-flow', 'memory.db'),
|
|
155
|
+
path.join(process.cwd(), '.claude', 'memory.db'),
|
|
156
|
+
path.join(process.cwd(), 'data', 'memory.db'),
|
|
157
|
+
path.join(process.cwd(), 'memory.db'),
|
|
158
|
+
path.join(process.cwd(), '.agentdb', 'memory.db'),
|
|
159
|
+
];
|
|
160
|
+
|
|
161
|
+
let patterns = 0;
|
|
162
|
+
let sessions = 0;
|
|
163
|
+
let trajectories = 0;
|
|
164
|
+
|
|
165
|
+
// Try to read from sqlite database
|
|
166
|
+
for (const dbPath of memoryPaths) {
|
|
167
|
+
if (fs.existsSync(dbPath)) {
|
|
168
|
+
try {
|
|
169
|
+
// Count entries in memory file (rough estimate from file size)
|
|
170
|
+
const stats = fs.statSync(dbPath);
|
|
171
|
+
const sizeKB = stats.size / 1024;
|
|
172
|
+
// Estimate: ~2KB per pattern on average
|
|
173
|
+
patterns = Math.floor(sizeKB / 2);
|
|
174
|
+
sessions = Math.max(1, Math.floor(patterns / 10));
|
|
175
|
+
trajectories = Math.floor(patterns / 5);
|
|
176
|
+
break;
|
|
177
|
+
} catch (e) {
|
|
178
|
+
// Ignore
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Also check for session files
|
|
184
|
+
const sessionsPath = path.join(process.cwd(), '.claude', 'sessions');
|
|
185
|
+
if (fs.existsSync(sessionsPath)) {
|
|
186
|
+
try {
|
|
187
|
+
const sessionFiles = fs.readdirSync(sessionsPath).filter(f => f.endsWith('.json'));
|
|
188
|
+
sessions = Math.max(sessions, sessionFiles.length);
|
|
189
|
+
} catch (e) {
|
|
190
|
+
// Ignore
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return { patterns, sessions, trajectories };
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Get V3 progress from REAL metrics files
|
|
198
|
+
function getV3Progress() {
|
|
199
|
+
const learning = getLearningStats();
|
|
200
|
+
const totalDomains = 5;
|
|
201
|
+
|
|
202
|
+
let dddProgress = 0;
|
|
203
|
+
let dddScore = 0;
|
|
204
|
+
let dddMaxScore = 100;
|
|
205
|
+
let moduleCount = 0;
|
|
206
|
+
|
|
207
|
+
// Check ddd-progress.json for REAL DDD analysis
|
|
208
|
+
const dddPath = path.join(process.cwd(), '.claude-flow', 'metrics', 'ddd-progress.json');
|
|
209
|
+
if (fs.existsSync(dddPath)) {
|
|
210
|
+
try {
|
|
211
|
+
const data = JSON.parse(fs.readFileSync(dddPath, 'utf-8'));
|
|
212
|
+
dddProgress = data.progress || 0;
|
|
213
|
+
dddScore = data.score || 0;
|
|
214
|
+
dddMaxScore = data.maxScore || 100;
|
|
215
|
+
moduleCount = data.modules ? Object.keys(data.modules).length : 0;
|
|
216
|
+
} catch (e) {
|
|
217
|
+
// Ignore - use fallback
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Calculate domains completed from DDD progress (each 20% = 1 domain)
|
|
222
|
+
let domainsCompleted = Math.min(5, Math.floor(dddProgress / 20));
|
|
223
|
+
|
|
224
|
+
// Fallback: if no DDD data, use pattern-based calculation
|
|
225
|
+
if (dddProgress === 0 && learning.patterns > 0) {
|
|
226
|
+
if (learning.patterns >= 500) domainsCompleted = 5;
|
|
227
|
+
else if (learning.patterns >= 200) domainsCompleted = 4;
|
|
228
|
+
else if (learning.patterns >= 100) domainsCompleted = 3;
|
|
229
|
+
else if (learning.patterns >= 50) domainsCompleted = 2;
|
|
230
|
+
else if (learning.patterns >= 10) domainsCompleted = 1;
|
|
231
|
+
dddProgress = Math.floor((domainsCompleted / totalDomains) * 100);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return {
|
|
235
|
+
domainsCompleted,
|
|
236
|
+
totalDomains,
|
|
237
|
+
dddProgress,
|
|
238
|
+
dddScore,
|
|
239
|
+
dddMaxScore,
|
|
240
|
+
moduleCount,
|
|
241
|
+
patternsLearned: learning.patterns,
|
|
242
|
+
sessionsCompleted: learning.sessions
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// Get security status based on actual scans
|
|
247
|
+
function getSecurityStatus() {
|
|
248
|
+
const totalCves = 3;
|
|
249
|
+
let cvesFixed = 0;
|
|
250
|
+
|
|
251
|
+
// Check audit-status.json first (created by init)
|
|
252
|
+
const auditStatusPath = path.join(process.cwd(), '.claude-flow', 'security', 'audit-status.json');
|
|
253
|
+
if (fs.existsSync(auditStatusPath)) {
|
|
254
|
+
try {
|
|
255
|
+
const data = JSON.parse(fs.readFileSync(auditStatusPath, 'utf-8'));
|
|
256
|
+
return {
|
|
257
|
+
status: data.status || 'PENDING',
|
|
258
|
+
cvesFixed: data.cvesFixed || 0,
|
|
259
|
+
totalCves: data.totalCves || 3,
|
|
260
|
+
};
|
|
261
|
+
} catch (e) {
|
|
262
|
+
// Fall through to scan directory check
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// Check for security scan results in memory
|
|
267
|
+
const scanResultsPath = path.join(process.cwd(), '.claude', 'security-scans');
|
|
268
|
+
if (fs.existsSync(scanResultsPath)) {
|
|
269
|
+
try {
|
|
270
|
+
const scans = fs.readdirSync(scanResultsPath).filter(f => f.endsWith('.json'));
|
|
271
|
+
// Each successful scan file = 1 CVE addressed
|
|
272
|
+
cvesFixed = Math.min(totalCves, scans.length);
|
|
273
|
+
} catch (e) {
|
|
274
|
+
// Ignore
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// Also check .swarm/security for audit results
|
|
279
|
+
const swarmAuditPath = path.join(process.cwd(), '.swarm', 'security');
|
|
280
|
+
if (fs.existsSync(swarmAuditPath)) {
|
|
281
|
+
try {
|
|
282
|
+
const audits = fs.readdirSync(swarmAuditPath).filter(f => f.includes('audit'));
|
|
283
|
+
cvesFixed = Math.min(totalCves, Math.max(cvesFixed, audits.length));
|
|
284
|
+
} catch (e) {
|
|
285
|
+
// Ignore
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const status = cvesFixed >= totalCves ? 'CLEAN' : cvesFixed > 0 ? 'IN_PROGRESS' : 'PENDING';
|
|
290
|
+
|
|
291
|
+
return {
|
|
292
|
+
status,
|
|
293
|
+
cvesFixed,
|
|
294
|
+
totalCves,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Get swarm status (cross-platform)
|
|
299
|
+
function getSwarmStatus() {
|
|
300
|
+
let activeAgents = 0;
|
|
301
|
+
let coordinationActive = false;
|
|
302
|
+
|
|
303
|
+
// Check swarm-activity.json first (works on all platforms)
|
|
304
|
+
const activityPath = path.join(process.cwd(), '.claude-flow', 'metrics', 'swarm-activity.json');
|
|
305
|
+
if (fs.existsSync(activityPath)) {
|
|
306
|
+
try {
|
|
307
|
+
const data = JSON.parse(fs.readFileSync(activityPath, 'utf-8'));
|
|
308
|
+
if (data.swarm) {
|
|
309
|
+
return {
|
|
310
|
+
activeAgents: data.swarm.agent_count || 0,
|
|
311
|
+
maxAgents: CONFIG.maxAgents,
|
|
312
|
+
coordinationActive: data.swarm.coordination_active || data.swarm.active || false,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
} catch (e) {
|
|
316
|
+
// Fall through to v3-progress.json check
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// Also check v3-progress.json for swarm data (secondary source)
|
|
321
|
+
const progressPath = path.join(process.cwd(), '.claude-flow', 'metrics', 'v3-progress.json');
|
|
322
|
+
if (fs.existsSync(progressPath)) {
|
|
323
|
+
try {
|
|
324
|
+
const data = JSON.parse(fs.readFileSync(progressPath, 'utf-8'));
|
|
325
|
+
if (data.swarm) {
|
|
326
|
+
return {
|
|
327
|
+
activeAgents: data.swarm.activeAgents || data.swarm.agent_count || 0,
|
|
328
|
+
maxAgents: data.swarm.totalAgents || CONFIG.maxAgents,
|
|
329
|
+
coordinationActive: data.swarm.active || (data.swarm.activeAgents > 0),
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
} catch (e) {
|
|
333
|
+
// Fall through to process detection
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// Platform-specific process detection (fallback)
|
|
338
|
+
const isWindows = process.platform === 'win32';
|
|
339
|
+
try {
|
|
340
|
+
if (isWindows) {
|
|
341
|
+
// Windows: use tasklist
|
|
342
|
+
const ps = execSync('tasklist /FI "IMAGENAME eq node.exe" /NH 2>nul || echo ""', { encoding: 'utf-8' });
|
|
343
|
+
const nodeProcesses = (ps.match(/node\\.exe/gi) || []).length;
|
|
344
|
+
activeAgents = Math.max(0, Math.floor(nodeProcesses / 3)); // Heuristic
|
|
345
|
+
coordinationActive = nodeProcesses > 0;
|
|
346
|
+
} else {
|
|
347
|
+
// Unix: use ps - check for various agent process patterns
|
|
348
|
+
try {
|
|
349
|
+
const ps = execSync('ps aux 2>/dev/null | grep -E "(agentic-flow|claude-flow|mcp.*server)" | grep -v grep | wc -l', { encoding: 'utf-8' });
|
|
350
|
+
activeAgents = Math.max(0, parseInt(ps.trim()));
|
|
351
|
+
coordinationActive = activeAgents > 0;
|
|
352
|
+
} catch (e) {
|
|
353
|
+
// Fallback to simple agentic-flow check
|
|
354
|
+
const ps = execSync('ps aux 2>/dev/null | grep -c agentic-flow || echo "0"', { encoding: 'utf-8' });
|
|
355
|
+
activeAgents = Math.max(0, parseInt(ps.trim()) - 1);
|
|
356
|
+
coordinationActive = activeAgents > 0;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
} catch (e) {
|
|
360
|
+
// Ignore errors - return defaults
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
return {
|
|
364
|
+
activeAgents,
|
|
365
|
+
maxAgents: CONFIG.maxAgents,
|
|
366
|
+
coordinationActive,
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// Get system metrics (cross-platform)
|
|
371
|
+
function getSystemMetrics() {
|
|
372
|
+
let memoryMB = 0;
|
|
373
|
+
let subAgents = 0;
|
|
374
|
+
|
|
375
|
+
// Check learning.json first for REAL intelligence metrics
|
|
376
|
+
const learningMetricsPath = path.join(process.cwd(), '.claude-flow', 'metrics', 'learning.json');
|
|
377
|
+
let intelligenceFromFile = null;
|
|
378
|
+
let contextFromFile = null;
|
|
379
|
+
if (fs.existsSync(learningMetricsPath)) {
|
|
380
|
+
try {
|
|
381
|
+
const data = JSON.parse(fs.readFileSync(learningMetricsPath, 'utf-8'));
|
|
382
|
+
// Use intelligence.score (the REAL metric) instead of routing.accuracy
|
|
383
|
+
if (data.intelligence?.score !== undefined) {
|
|
384
|
+
intelligenceFromFile = Math.min(100, Math.floor(data.intelligence.score));
|
|
385
|
+
}
|
|
386
|
+
if (data.sessions?.total !== undefined) {
|
|
387
|
+
contextFromFile = Math.min(100, data.sessions.total * 5);
|
|
388
|
+
}
|
|
389
|
+
} catch (e) {
|
|
390
|
+
// Fall through
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// Platform-specific memory detection
|
|
395
|
+
const isWindows = process.platform === 'win32';
|
|
396
|
+
try {
|
|
397
|
+
if (isWindows) {
|
|
398
|
+
// Windows: use process.memoryUsage() (most reliable cross-platform)
|
|
399
|
+
memoryMB = Math.floor(process.memoryUsage().heapUsed / 1024 / 1024);
|
|
400
|
+
} else {
|
|
401
|
+
// Unix: try ps command, fallback to process.memoryUsage()
|
|
402
|
+
try {
|
|
403
|
+
const mem = execSync('ps aux | grep -E "(node|agentic|claude)" | grep -v grep | awk \\'{sum += \\$6} END {print int(sum/1024)}\\'', { encoding: 'utf-8' });
|
|
404
|
+
memoryMB = parseInt(mem.trim()) || 0;
|
|
405
|
+
} catch (e) {
|
|
406
|
+
memoryMB = Math.floor(process.memoryUsage().heapUsed / 1024 / 1024);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
} catch (e) {
|
|
410
|
+
// Fallback to Node.js memory API
|
|
411
|
+
memoryMB = Math.floor(process.memoryUsage().heapUsed / 1024 / 1024);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// Get learning stats for intelligence %
|
|
415
|
+
const learning = getLearningStats();
|
|
416
|
+
|
|
417
|
+
// Also get AgentDB stats for fallback intelligence calculation
|
|
418
|
+
const agentdbStats = getAgentDBStats();
|
|
419
|
+
|
|
420
|
+
// Intelligence % based on learned patterns, vectors, or project maturity
|
|
421
|
+
// Calculate all sources and take the maximum
|
|
422
|
+
let intelligencePct = 0;
|
|
423
|
+
|
|
424
|
+
if (intelligenceFromFile !== null) {
|
|
425
|
+
intelligencePct = intelligenceFromFile;
|
|
426
|
+
} else {
|
|
427
|
+
// Calculate from multiple sources and take the best
|
|
428
|
+
const fromPatterns = learning.patterns > 0 ? Math.min(100, Math.floor(learning.patterns / 10)) : 0;
|
|
429
|
+
const fromVectors = agentdbStats.vectorCount > 0 ? Math.min(100, Math.floor(agentdbStats.vectorCount / 100)) : 0;
|
|
430
|
+
|
|
431
|
+
intelligencePct = Math.max(fromPatterns, fromVectors);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// If still 0, use project maturity fallback
|
|
435
|
+
if (intelligencePct === 0) {
|
|
436
|
+
// Final fallback: estimate from project maturity indicators
|
|
437
|
+
let maturityScore = 0;
|
|
438
|
+
|
|
439
|
+
// Check git commit count (proxy for project development)
|
|
440
|
+
try {
|
|
441
|
+
const commitCount = parseInt(execSync('git rev-list --count HEAD 2>/dev/null || echo "0"', { encoding: 'utf-8' }).trim());
|
|
442
|
+
maturityScore += Math.min(30, Math.floor(commitCount / 10)); // Max 30% from commits
|
|
443
|
+
} catch (e) { /* ignore */ }
|
|
444
|
+
|
|
445
|
+
// Check for Claude session history
|
|
446
|
+
const sessionPaths = [
|
|
447
|
+
path.join(process.cwd(), '.claude', 'sessions'),
|
|
448
|
+
path.join(process.cwd(), '.claude-flow', 'sessions'),
|
|
449
|
+
];
|
|
450
|
+
for (const sessPath of sessionPaths) {
|
|
451
|
+
if (fs.existsSync(sessPath)) {
|
|
452
|
+
try {
|
|
453
|
+
const sessions = fs.readdirSync(sessPath).filter(f => f.endsWith('.json')).length;
|
|
454
|
+
maturityScore += Math.min(20, sessions * 2); // Max 20% from sessions
|
|
455
|
+
break;
|
|
456
|
+
} catch (e) { /* ignore */ }
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// Check for source files (indicates codebase size)
|
|
461
|
+
try {
|
|
462
|
+
const srcDirs = ['src', 'lib', 'app', 'packages'];
|
|
463
|
+
for (const dir of srcDirs) {
|
|
464
|
+
const dirPath = path.join(process.cwd(), dir);
|
|
465
|
+
if (fs.existsSync(dirPath)) {
|
|
466
|
+
maturityScore += 15; // Base score for having source dir
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
} catch (e) { /* ignore */ }
|
|
471
|
+
|
|
472
|
+
// Check for test files
|
|
473
|
+
try {
|
|
474
|
+
const testDirs = ['tests', 'test', '__tests__', 'spec'];
|
|
475
|
+
for (const dir of testDirs) {
|
|
476
|
+
const dirPath = path.join(process.cwd(), dir);
|
|
477
|
+
if (fs.existsSync(dirPath)) {
|
|
478
|
+
maturityScore += 10; // Bonus for having tests
|
|
479
|
+
break;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
} catch (e) { /* ignore */ }
|
|
483
|
+
|
|
484
|
+
// Check for .claude directory (Claude Code usage)
|
|
485
|
+
if (fs.existsSync(path.join(process.cwd(), '.claude'))) {
|
|
486
|
+
maturityScore += 15; // Bonus for Claude Code integration
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// Check for config files (project maturity)
|
|
490
|
+
const configFiles = ['package.json', 'tsconfig.json', 'pyproject.toml', 'Cargo.toml', 'go.mod'];
|
|
491
|
+
for (const cfg of configFiles) {
|
|
492
|
+
if (fs.existsSync(path.join(process.cwd(), cfg))) {
|
|
493
|
+
maturityScore += 5;
|
|
494
|
+
break;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
intelligencePct = Math.min(100, maturityScore);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
// Context % based on session history (0 sessions = 0%, grows with usage)
|
|
502
|
+
const contextPct = contextFromFile !== null
|
|
503
|
+
? contextFromFile
|
|
504
|
+
: Math.min(100, Math.floor(learning.sessions * 5));
|
|
505
|
+
|
|
506
|
+
// Count active sub-agents (cross-platform via metrics file)
|
|
507
|
+
const activityPath = path.join(process.cwd(), '.claude-flow', 'metrics', 'swarm-activity.json');
|
|
508
|
+
if (fs.existsSync(activityPath)) {
|
|
509
|
+
try {
|
|
510
|
+
const data = JSON.parse(fs.readFileSync(activityPath, 'utf-8'));
|
|
511
|
+
subAgents = data.processes?.estimated_agents || 0;
|
|
512
|
+
} catch (e) {
|
|
513
|
+
// Ignore
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
// Fallback to process detection on Unix only
|
|
518
|
+
if (subAgents === 0 && !isWindows) {
|
|
519
|
+
try {
|
|
520
|
+
const agents = execSync('ps aux 2>/dev/null | grep -c "claude-flow.*agent" || echo "0"', { encoding: 'utf-8' });
|
|
521
|
+
subAgents = Math.max(0, parseInt(agents.trim()) - 1);
|
|
522
|
+
} catch (e) {
|
|
523
|
+
// Ignore
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
return {
|
|
528
|
+
memoryMB,
|
|
529
|
+
contextPct,
|
|
530
|
+
intelligencePct,
|
|
531
|
+
subAgents,
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// Get ADR (Architecture Decision Records) status from REAL compliance data
|
|
536
|
+
function getADRStatus() {
|
|
537
|
+
let compliance = 0;
|
|
538
|
+
let totalChecks = 0;
|
|
539
|
+
let compliantChecks = 0;
|
|
540
|
+
let checks = {};
|
|
541
|
+
|
|
542
|
+
// Check adr-compliance.json for REAL compliance data
|
|
543
|
+
const compliancePath = path.join(process.cwd(), '.claude-flow', 'metrics', 'adr-compliance.json');
|
|
544
|
+
if (fs.existsSync(compliancePath)) {
|
|
545
|
+
try {
|
|
546
|
+
const data = JSON.parse(fs.readFileSync(compliancePath, 'utf-8'));
|
|
547
|
+
compliance = data.compliance || 0;
|
|
548
|
+
checks = data.checks || {};
|
|
549
|
+
totalChecks = Object.keys(checks).length;
|
|
550
|
+
compliantChecks = Object.values(checks).filter(c => c.compliant).length;
|
|
551
|
+
return { count: totalChecks, implemented: compliantChecks, compliance };
|
|
552
|
+
} catch (e) {
|
|
553
|
+
// Fall through to file-based detection
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// Fallback: count ADR files directly
|
|
558
|
+
const adrPaths = [
|
|
559
|
+
path.join(process.cwd(), 'docs', 'adrs'),
|
|
560
|
+
path.join(process.cwd(), 'docs', 'adr'),
|
|
561
|
+
path.join(process.cwd(), 'adr'),
|
|
562
|
+
path.join(process.cwd(), 'ADR'),
|
|
563
|
+
path.join(process.cwd(), '.claude-flow', 'adrs'),
|
|
564
|
+
path.join(process.cwd(), 'v3', 'implementation', 'adrs'),
|
|
565
|
+
path.join(process.cwd(), 'implementation', 'adrs'),
|
|
566
|
+
];
|
|
567
|
+
|
|
568
|
+
let count = 0;
|
|
569
|
+
let implemented = 0;
|
|
570
|
+
|
|
571
|
+
for (const adrPath of adrPaths) {
|
|
572
|
+
if (fs.existsSync(adrPath)) {
|
|
573
|
+
try {
|
|
574
|
+
const files = fs.readdirSync(adrPath).filter(f =>
|
|
575
|
+
f.endsWith('.md') && (f.startsWith('ADR-') || f.startsWith('adr-') || /^\\d{4}-/.test(f))
|
|
576
|
+
);
|
|
577
|
+
count = files.length;
|
|
578
|
+
|
|
579
|
+
for (const file of files) {
|
|
580
|
+
try {
|
|
581
|
+
const content = fs.readFileSync(path.join(adrPath, file), 'utf-8');
|
|
582
|
+
if (content.includes('Status: Implemented') || content.includes('status: implemented') ||
|
|
583
|
+
content.includes('Status: Accepted') || content.includes('status: accepted')) {
|
|
584
|
+
implemented++;
|
|
585
|
+
}
|
|
586
|
+
} catch (e) {
|
|
587
|
+
// Skip unreadable files
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
break;
|
|
591
|
+
} catch (e) {
|
|
592
|
+
// Ignore
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
compliance = count > 0 ? Math.floor((implemented / count) * 100) : 0;
|
|
598
|
+
return { count, implemented, compliance };
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// Get hooks status (enabled/registered hooks)
|
|
602
|
+
function getHooksStatus() {
|
|
603
|
+
let enabled = 0;
|
|
604
|
+
let total = 17; // V3 has 17 hook types
|
|
605
|
+
|
|
606
|
+
// Check .claude/settings.json for hooks config
|
|
607
|
+
const settingsPaths = [
|
|
608
|
+
path.join(process.cwd(), '.claude', 'settings.json'),
|
|
609
|
+
path.join(process.cwd(), '.claude', 'settings.local.json'),
|
|
610
|
+
];
|
|
611
|
+
|
|
612
|
+
for (const settingsPath of settingsPaths) {
|
|
613
|
+
if (fs.existsSync(settingsPath)) {
|
|
614
|
+
try {
|
|
615
|
+
const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8'));
|
|
616
|
+
if (settings.hooks) {
|
|
617
|
+
// Claude Code native hooks format: PreToolUse, PostToolUse, SessionStart, etc.
|
|
618
|
+
const hookCategories = Object.keys(settings.hooks);
|
|
619
|
+
for (const category of hookCategories) {
|
|
620
|
+
const categoryHooks = settings.hooks[category];
|
|
621
|
+
if (Array.isArray(categoryHooks) && categoryHooks.length > 0) {
|
|
622
|
+
// Count categories with at least one hook defined
|
|
623
|
+
enabled++;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
break;
|
|
628
|
+
} catch (e) {
|
|
629
|
+
// Ignore parse errors
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
// Also check for hook files in .claude/hooks
|
|
635
|
+
const hooksDir = path.join(process.cwd(), '.claude', 'hooks');
|
|
636
|
+
if (fs.existsSync(hooksDir)) {
|
|
637
|
+
try {
|
|
638
|
+
const hookFiles = fs.readdirSync(hooksDir).filter(f => f.endsWith('.js') || f.endsWith('.sh'));
|
|
639
|
+
enabled = Math.max(enabled, hookFiles.length);
|
|
640
|
+
} catch (e) {
|
|
641
|
+
// Ignore
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
return { enabled, total };
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
// Get AgentDB memory stats
|
|
649
|
+
function getAgentDBStats() {
|
|
650
|
+
let vectorCount = 0;
|
|
651
|
+
let dbSizeKB = 0;
|
|
652
|
+
let namespaces = 0;
|
|
653
|
+
let hasHnsw = false;
|
|
654
|
+
|
|
655
|
+
// Check for database directories
|
|
656
|
+
const dbDirPaths = [
|
|
657
|
+
path.join(process.cwd(), '.claude-flow', 'agentdb'),
|
|
658
|
+
path.join(process.cwd(), '.swarm', 'agentdb'),
|
|
659
|
+
path.join(process.cwd(), 'data', 'agentdb'),
|
|
660
|
+
path.join(process.cwd(), '.claude', 'memory'),
|
|
661
|
+
path.join(process.cwd(), '.agentdb'),
|
|
662
|
+
];
|
|
663
|
+
|
|
664
|
+
// Check for direct database files (memory.db, etc.)
|
|
665
|
+
const dbFilePaths = [
|
|
666
|
+
path.join(process.cwd(), '.swarm', 'memory.db'),
|
|
667
|
+
path.join(process.cwd(), '.claude-flow', 'memory.db'),
|
|
668
|
+
path.join(process.cwd(), '.claude', 'memory.db'),
|
|
669
|
+
path.join(process.cwd(), 'data', 'memory.db'),
|
|
670
|
+
path.join(process.cwd(), 'memory.db'),
|
|
671
|
+
];
|
|
672
|
+
|
|
673
|
+
// Check for HNSW index files
|
|
674
|
+
const hnswPaths = [
|
|
675
|
+
path.join(process.cwd(), '.swarm', 'hnsw.index'),
|
|
676
|
+
path.join(process.cwd(), '.claude-flow', 'hnsw.index'),
|
|
677
|
+
path.join(process.cwd(), 'data', 'hnsw.index'),
|
|
678
|
+
];
|
|
679
|
+
|
|
680
|
+
// Check direct database files first
|
|
681
|
+
for (const dbFile of dbFilePaths) {
|
|
682
|
+
if (fs.existsSync(dbFile)) {
|
|
683
|
+
try {
|
|
684
|
+
const stats = fs.statSync(dbFile);
|
|
685
|
+
dbSizeKB = stats.size / 1024;
|
|
686
|
+
// Estimate vectors: ~2KB per vector for SQLite with embeddings
|
|
687
|
+
vectorCount = Math.floor(dbSizeKB / 2);
|
|
688
|
+
namespaces = 1;
|
|
689
|
+
break;
|
|
690
|
+
} catch (e) {
|
|
691
|
+
// Ignore
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
// Check database directories if no direct file found
|
|
697
|
+
if (vectorCount === 0) {
|
|
698
|
+
for (const dbPath of dbDirPaths) {
|
|
699
|
+
if (fs.existsSync(dbPath)) {
|
|
700
|
+
try {
|
|
701
|
+
const stats = fs.statSync(dbPath);
|
|
702
|
+
if (stats.isDirectory()) {
|
|
703
|
+
const files = fs.readdirSync(dbPath);
|
|
704
|
+
namespaces = files.filter(f => f.endsWith('.db') || f.endsWith('.sqlite')).length;
|
|
705
|
+
|
|
706
|
+
for (const file of files) {
|
|
707
|
+
const filePath = path.join(dbPath, file);
|
|
708
|
+
const fileStat = fs.statSync(filePath);
|
|
709
|
+
if (fileStat.isFile()) {
|
|
710
|
+
dbSizeKB += fileStat.size / 1024;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
vectorCount = Math.floor(dbSizeKB / 2);
|
|
715
|
+
}
|
|
716
|
+
break;
|
|
717
|
+
} catch (e) {
|
|
718
|
+
// Ignore
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
// Check for HNSW index (indicates vector search capability)
|
|
725
|
+
for (const hnswPath of hnswPaths) {
|
|
726
|
+
if (fs.existsSync(hnswPath)) {
|
|
727
|
+
hasHnsw = true;
|
|
728
|
+
try {
|
|
729
|
+
const stats = fs.statSync(hnswPath);
|
|
730
|
+
// HNSW index: ~0.5KB per vector
|
|
731
|
+
const hnswVectors = Math.floor(stats.size / 1024 / 0.5);
|
|
732
|
+
vectorCount = Math.max(vectorCount, hnswVectors);
|
|
733
|
+
} catch (e) {
|
|
734
|
+
// Ignore
|
|
735
|
+
}
|
|
736
|
+
break;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
// Also check for vectors.json (simple vector store)
|
|
741
|
+
const vectorsPath = path.join(process.cwd(), '.claude-flow', 'vectors.json');
|
|
742
|
+
if (fs.existsSync(vectorsPath) && vectorCount === 0) {
|
|
743
|
+
try {
|
|
744
|
+
const data = JSON.parse(fs.readFileSync(vectorsPath, 'utf-8'));
|
|
745
|
+
if (Array.isArray(data)) {
|
|
746
|
+
vectorCount = data.length;
|
|
747
|
+
} else if (data.vectors) {
|
|
748
|
+
vectorCount = Object.keys(data.vectors).length;
|
|
749
|
+
}
|
|
750
|
+
} catch (e) {
|
|
751
|
+
// Ignore
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
return { vectorCount, dbSizeKB: Math.floor(dbSizeKB), namespaces, hasHnsw };
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
// Get test statistics
|
|
759
|
+
function getTestStats() {
|
|
760
|
+
let testFiles = 0;
|
|
761
|
+
let testCases = 0;
|
|
762
|
+
|
|
763
|
+
const testDirs = [
|
|
764
|
+
path.join(process.cwd(), 'tests'),
|
|
765
|
+
path.join(process.cwd(), 'test'),
|
|
766
|
+
path.join(process.cwd(), '__tests__'),
|
|
767
|
+
path.join(process.cwd(), 'src', '__tests__'),
|
|
768
|
+
path.join(process.cwd(), 'v3', '__tests__'),
|
|
769
|
+
];
|
|
770
|
+
|
|
771
|
+
// Recursively count test files
|
|
772
|
+
function countTestFiles(dir, depth = 0) {
|
|
773
|
+
if (depth > 3) return; // Limit recursion
|
|
774
|
+
if (!fs.existsSync(dir)) return;
|
|
775
|
+
|
|
776
|
+
try {
|
|
777
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
778
|
+
for (const entry of entries) {
|
|
779
|
+
if (entry.isDirectory() && !entry.name.startsWith('.') && entry.name !== 'node_modules') {
|
|
780
|
+
countTestFiles(path.join(dir, entry.name), depth + 1);
|
|
781
|
+
} else if (entry.isFile()) {
|
|
782
|
+
const name = entry.name;
|
|
783
|
+
if (name.includes('.test.') || name.includes('.spec.') ||
|
|
784
|
+
name.includes('_test.') || name.includes('_spec.') ||
|
|
785
|
+
name.startsWith('test_') || name.startsWith('spec_')) {
|
|
786
|
+
testFiles++;
|
|
787
|
+
|
|
788
|
+
// Try to estimate test cases from file
|
|
789
|
+
try {
|
|
790
|
+
const content = fs.readFileSync(path.join(dir, name), 'utf-8');
|
|
791
|
+
// Count it(), test(), describe() patterns
|
|
792
|
+
const itMatches = (content.match(/\\bit\\s*\\(/g) || []).length;
|
|
793
|
+
const testMatches = (content.match(/\\btest\\s*\\(/g) || []).length;
|
|
794
|
+
testCases += itMatches + testMatches;
|
|
795
|
+
} catch (e) {
|
|
796
|
+
// Estimate 3 tests per file if can't read
|
|
797
|
+
testCases += 3;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
} catch (e) {
|
|
803
|
+
// Ignore
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
for (const dir of testDirs) {
|
|
808
|
+
countTestFiles(dir);
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
// Also check src directory for colocated tests
|
|
812
|
+
const srcDir = path.join(process.cwd(), 'src');
|
|
813
|
+
if (fs.existsSync(srcDir)) {
|
|
814
|
+
countTestFiles(srcDir);
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
return { testFiles, testCases };
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
// Get integration status (MCP servers, external connections)
|
|
821
|
+
function getIntegrationStatus() {
|
|
822
|
+
let mcpServers = { total: 0, enabled: 0, names: [] };
|
|
823
|
+
let hasDatabase = false;
|
|
824
|
+
let hasCache = false;
|
|
825
|
+
let hasApi = false;
|
|
826
|
+
|
|
827
|
+
// Check for MCP servers in settings
|
|
828
|
+
const settingsPaths = [
|
|
829
|
+
path.join(process.cwd(), '.claude', 'settings.json'),
|
|
830
|
+
path.join(process.cwd(), '.claude', 'settings.local.json'),
|
|
831
|
+
];
|
|
832
|
+
|
|
833
|
+
for (const settingsPath of settingsPaths) {
|
|
834
|
+
if (fs.existsSync(settingsPath)) {
|
|
835
|
+
try {
|
|
836
|
+
const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8'));
|
|
837
|
+
|
|
838
|
+
// Check mcpServers object
|
|
839
|
+
if (settings.mcpServers && typeof settings.mcpServers === 'object') {
|
|
840
|
+
const servers = Object.keys(settings.mcpServers);
|
|
841
|
+
mcpServers.total = servers.length;
|
|
842
|
+
mcpServers.names = servers;
|
|
843
|
+
|
|
844
|
+
// Check enabledMcpjsonServers for enabled count
|
|
845
|
+
if (settings.enabledMcpjsonServers && Array.isArray(settings.enabledMcpjsonServers)) {
|
|
846
|
+
mcpServers.enabled = settings.enabledMcpjsonServers.filter(s => servers.includes(s)).length;
|
|
847
|
+
} else {
|
|
848
|
+
mcpServers.enabled = mcpServers.total; // Assume all enabled if not specified
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
break;
|
|
852
|
+
} catch (e) { /* ignore */ }
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
// Also check .mcp.json or mcp.json
|
|
857
|
+
const mcpConfigPaths = [
|
|
858
|
+
path.join(process.cwd(), '.mcp.json'),
|
|
859
|
+
path.join(process.cwd(), 'mcp.json'),
|
|
860
|
+
path.join(require('os').homedir(), '.claude', 'mcp.json'),
|
|
861
|
+
];
|
|
862
|
+
|
|
863
|
+
for (const mcpPath of mcpConfigPaths) {
|
|
864
|
+
if (fs.existsSync(mcpPath) && mcpServers.total === 0) {
|
|
865
|
+
try {
|
|
866
|
+
const config = JSON.parse(fs.readFileSync(mcpPath, 'utf-8'));
|
|
867
|
+
if (config.mcpServers) {
|
|
868
|
+
const servers = Object.keys(config.mcpServers);
|
|
869
|
+
mcpServers.total = servers.length;
|
|
870
|
+
mcpServers.names = servers;
|
|
871
|
+
mcpServers.enabled = servers.length;
|
|
872
|
+
}
|
|
873
|
+
} catch (e) { /* ignore */ }
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
// Check for database (AgentDB, SQLite, etc.)
|
|
878
|
+
const dbPaths = [
|
|
879
|
+
path.join(process.cwd(), '.swarm', 'memory.db'),
|
|
880
|
+
path.join(process.cwd(), '.claude-flow', 'memory.db'),
|
|
881
|
+
path.join(process.cwd(), 'data', 'memory.db'),
|
|
882
|
+
];
|
|
883
|
+
hasDatabase = dbPaths.some(p => fs.existsSync(p));
|
|
884
|
+
|
|
885
|
+
// Check for cache
|
|
886
|
+
const cachePaths = [
|
|
887
|
+
path.join(process.cwd(), '.claude-flow', 'cache'),
|
|
888
|
+
path.join(process.cwd(), '.cache'),
|
|
889
|
+
path.join(process.cwd(), 'node_modules', '.cache'),
|
|
890
|
+
];
|
|
891
|
+
hasCache = cachePaths.some(p => fs.existsSync(p));
|
|
892
|
+
|
|
893
|
+
// Check for API configuration (env vars or config)
|
|
894
|
+
try {
|
|
895
|
+
hasApi = !!(process.env.ANTHROPIC_API_KEY || process.env.OPENAI_API_KEY);
|
|
896
|
+
} catch (e) { /* ignore */ }
|
|
897
|
+
|
|
898
|
+
return { mcpServers, hasDatabase, hasCache, hasApi };
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
// Get git status (uncommitted changes, untracked files) - cross-platform
|
|
902
|
+
function getGitStatus() {
|
|
903
|
+
let modified = 0;
|
|
904
|
+
let untracked = 0;
|
|
905
|
+
let staged = 0;
|
|
906
|
+
let ahead = 0;
|
|
907
|
+
let behind = 0;
|
|
908
|
+
const isWindows = process.platform === 'win32';
|
|
909
|
+
|
|
910
|
+
try {
|
|
911
|
+
// Get modified and staged counts - works on all platforms
|
|
912
|
+
const status = execSync('git status --porcelain', {
|
|
913
|
+
encoding: 'utf-8',
|
|
914
|
+
stdio: ['pipe', 'pipe', 'pipe'], // Suppress stderr
|
|
915
|
+
timeout: 5000,
|
|
916
|
+
});
|
|
917
|
+
const lines = status.trim().split('\\n').filter(l => l);
|
|
918
|
+
for (const line of lines) {
|
|
919
|
+
const code = line.substring(0, 2);
|
|
920
|
+
if (code.includes('M') || code.includes('D') || code.includes('R')) {
|
|
921
|
+
if (code[0] !== ' ') staged++;
|
|
922
|
+
if (code[1] !== ' ') modified++;
|
|
923
|
+
}
|
|
924
|
+
if (code.includes('?')) untracked++;
|
|
925
|
+
if (code.includes('A')) staged++;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
// Get ahead/behind - may fail if no upstream
|
|
929
|
+
try {
|
|
930
|
+
const abStatus = execSync('git rev-list --left-right --count HEAD...@{upstream}', {
|
|
931
|
+
encoding: 'utf-8',
|
|
932
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
933
|
+
timeout: 5000,
|
|
934
|
+
});
|
|
935
|
+
const parts = abStatus.trim().split(/\\s+/);
|
|
936
|
+
ahead = parseInt(parts[0]) || 0;
|
|
937
|
+
behind = parseInt(parts[1]) || 0;
|
|
938
|
+
} catch (e) { /* no upstream or error - that's ok */ }
|
|
939
|
+
|
|
940
|
+
} catch (e) {
|
|
941
|
+
// Not a git repo or git not installed - return zeros
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
return { modified, untracked, staged, ahead, behind };
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
// Get session statistics
|
|
948
|
+
function getSessionStats() {
|
|
949
|
+
let sessionStart = null;
|
|
950
|
+
let duration = '';
|
|
951
|
+
let lastActivity = '';
|
|
952
|
+
let operationsCount = 0;
|
|
953
|
+
|
|
954
|
+
// Check for session file
|
|
955
|
+
const sessionPaths = [
|
|
956
|
+
path.join(process.cwd(), '.claude-flow', 'session.json'),
|
|
957
|
+
path.join(process.cwd(), '.claude', 'session.json'),
|
|
958
|
+
];
|
|
959
|
+
|
|
960
|
+
for (const sessPath of sessionPaths) {
|
|
961
|
+
if (fs.existsSync(sessPath)) {
|
|
962
|
+
try {
|
|
963
|
+
const data = JSON.parse(fs.readFileSync(sessPath, 'utf-8'));
|
|
964
|
+
if (data.startTime) {
|
|
965
|
+
sessionStart = new Date(data.startTime);
|
|
966
|
+
const now = new Date();
|
|
967
|
+
const diffMs = now.getTime() - sessionStart.getTime();
|
|
968
|
+
const diffMins = Math.floor(diffMs / 60000);
|
|
969
|
+
if (diffMins < 60) {
|
|
970
|
+
duration = \`\${diffMins}m\`;
|
|
971
|
+
} else {
|
|
972
|
+
const hours = Math.floor(diffMins / 60);
|
|
973
|
+
const mins = diffMins % 60;
|
|
974
|
+
duration = \`\${hours}h\${mins}m\`;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
if (data.lastActivity) {
|
|
978
|
+
const last = new Date(data.lastActivity);
|
|
979
|
+
const now = new Date();
|
|
980
|
+
const diffMs = now.getTime() - last.getTime();
|
|
981
|
+
const diffMins = Math.floor(diffMs / 60000);
|
|
982
|
+
if (diffMins < 1) lastActivity = 'now';
|
|
983
|
+
else if (diffMins < 60) lastActivity = \`\${diffMins}m ago\`;
|
|
984
|
+
else lastActivity = \`\${Math.floor(diffMins / 60)}h ago\`;
|
|
985
|
+
}
|
|
986
|
+
operationsCount = data.operationsCount || data.commandCount || 0;
|
|
987
|
+
break;
|
|
988
|
+
} catch (e) { /* ignore */ }
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
// Fallback: check metrics for activity
|
|
993
|
+
if (!duration) {
|
|
994
|
+
const metricsPath = path.join(process.cwd(), '.claude-flow', 'metrics', 'activity.json');
|
|
995
|
+
if (fs.existsSync(metricsPath)) {
|
|
996
|
+
try {
|
|
997
|
+
const data = JSON.parse(fs.readFileSync(metricsPath, 'utf-8'));
|
|
998
|
+
operationsCount = data.totalOperations || 0;
|
|
999
|
+
} catch (e) { /* ignore */ }
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
return { duration, lastActivity, operationsCount };
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
// Get trend indicator based on change
|
|
1007
|
+
function getTrend(current, previous) {
|
|
1008
|
+
if (previous === null || previous === undefined) return '';
|
|
1009
|
+
if (current > previous) return \`\${c.brightGreen}β\${c.reset}\`;
|
|
1010
|
+
if (current < previous) return \`\${c.brightRed}β\${c.reset}\`;
|
|
1011
|
+
return \`\${c.dim}β\${c.reset}\`;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
// Store previous values for trends (persisted between calls)
|
|
1015
|
+
let prevIntelligence = null;
|
|
1016
|
+
try {
|
|
1017
|
+
const trendPath = path.join(process.cwd(), '.claude-flow', '.trend-cache.json');
|
|
1018
|
+
if (fs.existsSync(trendPath)) {
|
|
1019
|
+
const data = JSON.parse(fs.readFileSync(trendPath, 'utf-8'));
|
|
1020
|
+
prevIntelligence = data.intelligence;
|
|
1021
|
+
}
|
|
1022
|
+
} catch (e) { /* ignore */ }
|
|
1023
|
+
|
|
1024
|
+
// Generate progress bar
|
|
1025
|
+
function progressBar(current, total) {
|
|
1026
|
+
const width = 5;
|
|
1027
|
+
const filled = Math.round((current / total) * width);
|
|
1028
|
+
const empty = width - filled;
|
|
1029
|
+
return '[' + '\\u25CF'.repeat(filled) + '\\u25CB'.repeat(empty) + ']';
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
// Generate full statusline
|
|
1033
|
+
function generateStatusline() {
|
|
1034
|
+
const user = getUserInfo();
|
|
1035
|
+
const progress = getV3Progress();
|
|
1036
|
+
const security = getSecurityStatus();
|
|
1037
|
+
const swarm = getSwarmStatus();
|
|
1038
|
+
const system = getSystemMetrics();
|
|
1039
|
+
const adrs = getADRStatus();
|
|
1040
|
+
const hooks = getHooksStatus();
|
|
1041
|
+
const agentdb = getAgentDBStats();
|
|
1042
|
+
const tests = getTestStats();
|
|
1043
|
+
const git = getGitStatus();
|
|
1044
|
+
const session = getSessionStats();
|
|
1045
|
+
const integration = getIntegrationStatus();
|
|
1046
|
+
const lines = [];
|
|
1047
|
+
|
|
1048
|
+
// Calculate intelligence trend
|
|
1049
|
+
const intellTrend = getTrend(system.intelligencePct, prevIntelligence);
|
|
1050
|
+
|
|
1051
|
+
// Save current values for next trend calculation
|
|
1052
|
+
try {
|
|
1053
|
+
const trendPath = path.join(process.cwd(), '.claude-flow', '.trend-cache.json');
|
|
1054
|
+
const trendDir = path.dirname(trendPath);
|
|
1055
|
+
if (!fs.existsSync(trendDir)) fs.mkdirSync(trendDir, { recursive: true });
|
|
1056
|
+
fs.writeFileSync(trendPath, JSON.stringify({ intelligence: system.intelligencePct, timestamp: Date.now() }));
|
|
1057
|
+
} catch (e) { /* ignore */ }
|
|
1058
|
+
|
|
1059
|
+
// Header Line with git changes indicator
|
|
1060
|
+
let header = \`\${c.bold}\${c.brightPurple}β Claude Flow V3 \${c.reset}\`;
|
|
1061
|
+
header += \`\${swarm.coordinationActive ? c.brightCyan : c.dim}β \${c.brightCyan}\${user.name}\${c.reset}\`;
|
|
1062
|
+
if (user.gitBranch) {
|
|
1063
|
+
header += \` \${c.dim}β\${c.reset} \${c.brightBlue}β \${user.gitBranch}\${c.reset}\`;
|
|
1064
|
+
// Add git changes indicator
|
|
1065
|
+
const gitChanges = git.modified + git.staged + git.untracked;
|
|
1066
|
+
if (gitChanges > 0) {
|
|
1067
|
+
let gitIndicator = '';
|
|
1068
|
+
if (git.staged > 0) gitIndicator += \`\${c.brightGreen}+\${git.staged}\${c.reset}\`;
|
|
1069
|
+
if (git.modified > 0) gitIndicator += \`\${c.brightYellow}~\${git.modified}\${c.reset}\`;
|
|
1070
|
+
if (git.untracked > 0) gitIndicator += \`\${c.dim}?\${git.untracked}\${c.reset}\`;
|
|
1071
|
+
header += \` \${gitIndicator}\`;
|
|
1072
|
+
}
|
|
1073
|
+
// Add ahead/behind indicator
|
|
1074
|
+
if (git.ahead > 0 || git.behind > 0) {
|
|
1075
|
+
if (git.ahead > 0) header += \` \${c.brightGreen}β\${git.ahead}\${c.reset}\`;
|
|
1076
|
+
if (git.behind > 0) header += \` \${c.brightRed}β\${git.behind}\${c.reset}\`;
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
header += \` \${c.dim}β\${c.reset} \${c.purple}\${user.modelName}\${c.reset}\`;
|
|
1080
|
+
// Add session duration if available
|
|
1081
|
+
if (session.duration) {
|
|
1082
|
+
header += \` \${c.dim}β\${c.reset} \${c.cyan}β± \${session.duration}\${c.reset}\`;
|
|
1083
|
+
}
|
|
1084
|
+
lines.push(header);
|
|
1085
|
+
|
|
1086
|
+
// Separator
|
|
1087
|
+
lines.push(\`\${c.dim}βββββββββββββββββββββββββββββββββββββββββββββββββββββ\${c.reset}\`);
|
|
1088
|
+
|
|
1089
|
+
// Line 1: DDD Domain Progress with dynamic performance indicator
|
|
1090
|
+
const domainsColor = progress.domainsCompleted >= 3 ? c.brightGreen : progress.domainsCompleted > 0 ? c.yellow : c.red;
|
|
1091
|
+
// Show HNSW speedup if enabled, otherwise show patterns learned
|
|
1092
|
+
let perfIndicator = '';
|
|
1093
|
+
if (agentdb.hasHnsw && agentdb.vectorCount > 0) {
|
|
1094
|
+
// HNSW enabled: show estimated speedup (150x-12500x based on vector count)
|
|
1095
|
+
const speedup = agentdb.vectorCount > 10000 ? '12500x' : agentdb.vectorCount > 1000 ? '150x' : '10x';
|
|
1096
|
+
perfIndicator = \`\${c.brightGreen}β‘ HNSW \${speedup}\${c.reset}\`;
|
|
1097
|
+
} else if (progress.patternsLearned > 0) {
|
|
1098
|
+
// Show patterns learned
|
|
1099
|
+
const patternsK = progress.patternsLearned >= 1000
|
|
1100
|
+
? \`\${(progress.patternsLearned / 1000).toFixed(1)}k\`
|
|
1101
|
+
: String(progress.patternsLearned);
|
|
1102
|
+
perfIndicator = \`\${c.brightYellow}π \${patternsK} patterns\${c.reset}\`;
|
|
1103
|
+
} else {
|
|
1104
|
+
// New project: show target
|
|
1105
|
+
perfIndicator = \`\${c.dim}β‘ target: 150x-12500x\${c.reset}\`;
|
|
1106
|
+
}
|
|
1107
|
+
lines.push(
|
|
1108
|
+
\`\${c.brightCyan}ποΈ DDD Domains\${c.reset} \${progressBar(progress.domainsCompleted, progress.totalDomains)} \` +
|
|
1109
|
+
\`\${domainsColor}\${progress.domainsCompleted}\${c.reset}/\${c.brightWhite}\${progress.totalDomains}\${c.reset} \` +
|
|
1110
|
+
perfIndicator
|
|
1111
|
+
);
|
|
1112
|
+
|
|
1113
|
+
// Line 2: Swarm + Hooks + CVE + Memory + Context + Intelligence
|
|
1114
|
+
const swarmIndicator = swarm.coordinationActive ? \`\${c.brightGreen}β\${c.reset}\` : \`\${c.dim}β\${c.reset}\`;
|
|
1115
|
+
const agentsColor = swarm.activeAgents > 0 ? c.brightGreen : c.red;
|
|
1116
|
+
let securityIcon = security.status === 'CLEAN' ? 'π’' : security.status === 'IN_PROGRESS' ? 'π‘' : 'π΄';
|
|
1117
|
+
let securityColor = security.status === 'CLEAN' ? c.brightGreen : security.status === 'IN_PROGRESS' ? c.brightYellow : c.brightRed;
|
|
1118
|
+
const hooksColor = hooks.enabled > 0 ? c.brightGreen : c.dim;
|
|
1119
|
+
|
|
1120
|
+
lines.push(
|
|
1121
|
+
\`\${c.brightYellow}π€ Swarm\${c.reset} \${swarmIndicator} [\${agentsColor}\${String(swarm.activeAgents).padStart(2)}\${c.reset}/\${c.brightWhite}\${swarm.maxAgents}\${c.reset}] \` +
|
|
1122
|
+
\`\${c.brightPurple}π₯ \${system.subAgents}\${c.reset} \` +
|
|
1123
|
+
\`\${c.brightBlue}πͺ \${hooksColor}\${hooks.enabled}\${c.reset}/\${c.brightWhite}\${hooks.total}\${c.reset} \` +
|
|
1124
|
+
\`\${securityIcon} \${securityColor}CVE \${security.cvesFixed}\${c.reset}/\${c.brightWhite}\${security.totalCves}\${c.reset} \` +
|
|
1125
|
+
\`\${c.brightCyan}πΎ \${system.memoryMB}MB\${c.reset} \` +
|
|
1126
|
+
\`\${system.intelligencePct >= 80 ? c.brightGreen : system.intelligencePct >= 40 ? c.brightYellow : c.dim}π§ \${String(system.intelligencePct).padStart(3)}%\${intellTrend}\${c.reset}\`
|
|
1127
|
+
);
|
|
1128
|
+
|
|
1129
|
+
// Line 3: Architecture status with ADRs, AgentDB, Tests
|
|
1130
|
+
const dddColor = progress.dddProgress >= 50 ? c.brightGreen : progress.dddProgress > 0 ? c.yellow : c.red;
|
|
1131
|
+
const adrColor = adrs.count > 0 ? (adrs.implemented === adrs.count ? c.brightGreen : c.yellow) : c.dim;
|
|
1132
|
+
const vectorColor = agentdb.vectorCount > 0 ? c.brightGreen : c.dim;
|
|
1133
|
+
const testColor = tests.testFiles > 0 ? c.brightGreen : c.dim;
|
|
1134
|
+
|
|
1135
|
+
// Show ADR compliance % if from real data, otherwise show count
|
|
1136
|
+
const adrDisplay = adrs.compliance > 0
|
|
1137
|
+
? \`\${adrColor}β\${adrs.compliance}%\${c.reset}\`
|
|
1138
|
+
: \`\${adrColor}β\${adrs.implemented}/\${adrs.count}\${c.reset}\`;
|
|
1139
|
+
|
|
1140
|
+
lines.push(
|
|
1141
|
+
\`\${c.brightPurple}π§ Architecture\${c.reset} \` +
|
|
1142
|
+
\`\${c.cyan}ADRs\${c.reset} \${adrDisplay} \${c.dim}β\${c.reset} \` +
|
|
1143
|
+
\`\${c.cyan}DDD\${c.reset} \${dddColor}β\${String(progress.dddProgress).padStart(3)}%\${c.reset} \${c.dim}β\${c.reset} \` +
|
|
1144
|
+
\`\${c.cyan}Security\${c.reset} \${securityColor}β\${security.status}\${c.reset}\`
|
|
1145
|
+
);
|
|
1146
|
+
|
|
1147
|
+
// Line 4: Memory, Vectors, Tests
|
|
1148
|
+
const hnswIndicator = agentdb.hasHnsw ? \`\${c.brightGreen}β‘\${c.reset}\` : '';
|
|
1149
|
+
const sizeDisplay = agentdb.dbSizeKB >= 1024
|
|
1150
|
+
? \`\${(agentdb.dbSizeKB / 1024).toFixed(1)}MB\`
|
|
1151
|
+
: \`\${agentdb.dbSizeKB}KB\`;
|
|
1152
|
+
// Build integration status string
|
|
1153
|
+
let integrationStr = '';
|
|
1154
|
+
if (integration.mcpServers.total > 0) {
|
|
1155
|
+
const mcpColor = integration.mcpServers.enabled === integration.mcpServers.total ? c.brightGreen :
|
|
1156
|
+
integration.mcpServers.enabled > 0 ? c.brightYellow : c.red;
|
|
1157
|
+
integrationStr += \`\${c.cyan}MCP\${c.reset} \${mcpColor}β\${integration.mcpServers.enabled}/\${integration.mcpServers.total}\${c.reset}\`;
|
|
1158
|
+
}
|
|
1159
|
+
if (integration.hasDatabase) {
|
|
1160
|
+
integrationStr += (integrationStr ? ' ' : '') + \`\${c.brightGreen}β\${c.reset}DB\`;
|
|
1161
|
+
}
|
|
1162
|
+
if (integration.hasApi) {
|
|
1163
|
+
integrationStr += (integrationStr ? ' ' : '') + \`\${c.brightGreen}β\${c.reset}API\`;
|
|
1164
|
+
}
|
|
1165
|
+
if (!integrationStr) {
|
|
1166
|
+
integrationStr = \`\${c.dim}βnone\${c.reset}\`;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
lines.push(
|
|
1170
|
+
\`\${c.brightCyan}π AgentDB\${c.reset} \` +
|
|
1171
|
+
\`\${c.cyan}Vectors\${c.reset} \${vectorColor}β\${agentdb.vectorCount}\${hnswIndicator}\${c.reset} \${c.dim}β\${c.reset} \` +
|
|
1172
|
+
\`\${c.cyan}Size\${c.reset} \${c.brightWhite}\${sizeDisplay}\${c.reset} \${c.dim}β\${c.reset} \` +
|
|
1173
|
+
\`\${c.cyan}Tests\${c.reset} \${testColor}β\${tests.testFiles}\${c.reset} \${c.dim}(\${tests.testCases} cases)\${c.reset} \${c.dim}β\${c.reset} \` +
|
|
1174
|
+
integrationStr
|
|
1175
|
+
);
|
|
1176
|
+
|
|
1177
|
+
return lines.join('\\n');
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
// Generate JSON data
|
|
1181
|
+
function generateJSON() {
|
|
1182
|
+
return {
|
|
1183
|
+
user: getUserInfo(),
|
|
1184
|
+
v3Progress: getV3Progress(),
|
|
1185
|
+
security: getSecurityStatus(),
|
|
1186
|
+
swarm: getSwarmStatus(),
|
|
1187
|
+
system: getSystemMetrics(),
|
|
1188
|
+
adrs: getADRStatus(),
|
|
1189
|
+
hooks: getHooksStatus(),
|
|
1190
|
+
agentdb: getAgentDBStats(),
|
|
1191
|
+
tests: getTestStats(),
|
|
1192
|
+
performance: {
|
|
1193
|
+
flashAttentionTarget: '2.49x-7.47x',
|
|
1194
|
+
searchImprovement: '150x-12,500x',
|
|
1195
|
+
memoryReduction: '50-75%',
|
|
1196
|
+
},
|
|
1197
|
+
lastUpdated: new Date().toISOString(),
|
|
1198
|
+
};
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
// Main
|
|
1202
|
+
if (process.argv.includes('--json')) {
|
|
1203
|
+
console.log(JSON.stringify(generateJSON(), null, 2));
|
|
1204
|
+
} else if (process.argv.includes('--compact')) {
|
|
1205
|
+
console.log(JSON.stringify(generateJSON()));
|
|
1206
|
+
} else {
|
|
1207
|
+
console.log(generateStatusline());
|
|
1208
|
+
}
|
|
1209
|
+
`;
|
|
1210
|
+
}
|
|
1211
|
+
/**
|
|
1212
|
+
* Generate statusline hook for shell integration
|
|
1213
|
+
*/
|
|
1214
|
+
export function generateStatuslineHook(options) {
|
|
1215
|
+
if (!options.statusline.enabled) {
|
|
1216
|
+
return '# Statusline disabled';
|
|
1217
|
+
}
|
|
1218
|
+
return `# Claude Flow V3 Statusline Hook
|
|
1219
|
+
# Add to your shell RC file (.bashrc, .zshrc, etc.)
|
|
1220
|
+
|
|
1221
|
+
# Function to get statusline
|
|
1222
|
+
claude_flow_statusline() {
|
|
1223
|
+
local statusline_script="\${CLAUDE_FLOW_DIR:-.claude}/helpers/statusline.cjs"
|
|
1224
|
+
if [ -f "$statusline_script" ]; then
|
|
1225
|
+
node "$statusline_script" 2>/dev/null || echo ""
|
|
1226
|
+
fi
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
# For bash PS1
|
|
1230
|
+
# export PS1='$(claude_flow_statusline) \\n\\$ '
|
|
1231
|
+
|
|
1232
|
+
# For zsh RPROMPT
|
|
1233
|
+
# export RPROMPT='$(claude_flow_statusline)'
|
|
1234
|
+
|
|
1235
|
+
# For starship (add to starship.toml)
|
|
1236
|
+
# [custom.claude_flow]
|
|
1237
|
+
# command = "node .claude/helpers/statusline.cjs 2>/dev/null"
|
|
1238
|
+
# when = "test -f .claude/helpers/statusline.cjs"
|
|
1239
|
+
`;
|
|
1240
|
+
}
|
|
1241
|
+
//# sourceMappingURL=statusline-generator.js.map
|