agentic-qe 3.11.0 → 3.11.1
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/commands/agents/README.md +50 -0
- package/.claude/commands/agents/agent-capabilities.md +140 -0
- package/.claude/commands/agents/agent-coordination.md +28 -0
- package/.claude/commands/agents/agent-spawning.md +28 -0
- package/.claude/commands/agents/agent-types.md +216 -0
- package/.claude/commands/agents/health.md +139 -0
- package/.claude/commands/agents/list.md +100 -0
- package/.claude/commands/agents/logs.md +130 -0
- package/.claude/commands/agents/metrics.md +122 -0
- package/.claude/commands/agents/pool.md +127 -0
- package/.claude/commands/agents/spawn.md +140 -0
- package/.claude/commands/agents/status.md +115 -0
- package/.claude/commands/agents/stop.md +102 -0
- package/.claude/commands/claude-flow-help.md +1 -1
- package/.claude/commands/coordination/README.md +9 -0
- package/.claude/commands/coordination/agent-spawn.md +25 -0
- package/.claude/commands/coordination/init.md +44 -0
- package/.claude/commands/coordination/orchestrate.md +43 -0
- package/.claude/commands/coordination/spawn.md +45 -0
- package/.claude/commands/coordination/swarm-init.md +85 -0
- package/.claude/commands/coordination/task-orchestrate.md +25 -0
- package/.claude/commands/github/code-review-swarm.md +1 -1
- package/.claude/commands/github/issue-tracker.md +3 -3
- package/.claude/commands/github/release-manager.md +5 -3
- package/.claude/commands/github/release-swarm.md +1 -1
- package/.claude/commands/github/repo-architect.md +2 -2
- package/.claude/commands/github/swarm-issue.md +4 -1
- package/.claude/commands/github/swarm-pr.md +6 -3
- package/.claude/commands/github/sync-coordinator.md +3 -1
- package/.claude/commands/github/workflow-automation.md +2 -2
- package/.claude/commands/hive-mind/README.md +17 -0
- package/.claude/commands/hive-mind/hive-mind-consensus.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-init.md +18 -0
- package/.claude/commands/hive-mind/hive-mind-memory.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-metrics.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-resume.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-sessions.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-spawn.md +21 -0
- package/.claude/commands/hive-mind/hive-mind-status.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-stop.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-wizard.md +8 -0
- package/.claude/commands/hive-mind/hive-mind.md +27 -0
- package/.claude/commands/memory/README.md +9 -0
- package/.claude/commands/memory/memory-persist.md +25 -0
- package/.claude/commands/memory/memory-search.md +25 -0
- package/.claude/commands/memory/memory-usage.md +25 -0
- package/.claude/commands/memory/neural.md +47 -0
- package/.claude/commands/swarm/README.md +15 -0
- package/.claude/commands/swarm/analysis.md +95 -0
- package/.claude/commands/swarm/development.md +96 -0
- package/.claude/commands/swarm/examples.md +168 -0
- package/.claude/commands/swarm/maintenance.md +102 -0
- package/.claude/commands/swarm/optimization.md +117 -0
- package/.claude/commands/swarm/research.md +136 -0
- package/.claude/commands/swarm/swarm-analysis.md +8 -0
- package/.claude/commands/swarm/swarm-background.md +8 -0
- package/.claude/commands/swarm/swarm-init.md +19 -0
- package/.claude/commands/swarm/swarm-modes.md +8 -0
- package/.claude/commands/swarm/swarm-monitor.md +8 -0
- package/.claude/commands/swarm/swarm-spawn.md +19 -0
- package/.claude/commands/swarm/swarm-status.md +8 -0
- package/.claude/commands/swarm/swarm-strategies.md +8 -0
- package/.claude/commands/swarm/swarm.md +87 -0
- package/.claude/commands/swarm/testing.md +131 -0
- package/.claude/commands/workflows/README.md +9 -0
- package/.claude/commands/workflows/development.md +78 -0
- package/.claude/commands/workflows/research.md +63 -0
- package/.claude/commands/workflows/workflow-create.md +25 -0
- package/.claude/commands/workflows/workflow-execute.md +25 -0
- package/.claude/commands/workflows/workflow-export.md +25 -0
- package/.claude/helpers/auto-commit.sh +1 -1
- package/.claude/helpers/auto-memory-hook.mjs +37 -4
- package/.claude/helpers/github-safe.js +90 -40
- package/.claude/helpers/github-setup.sh +30 -13
- package/.claude/helpers/hook-handler.cjs +68 -49
- package/.claude/helpers/intelligence.cjs +156 -27
- package/.claude/helpers/post-commit +1 -1
- package/.claude/helpers/pre-commit +1 -1
- package/.claude/helpers/quick-start.sh +4 -4
- package/.claude/helpers/router.js +70 -31
- package/.claude/helpers/ruflo-hook.cjs +59 -0
- package/.claude/helpers/session.js +28 -6
- package/.claude/helpers/setup-mcp.sh +3 -3
- package/.claude/helpers/statusline.cjs +584 -468
- package/.claude/helpers/statusline.js +47 -11
- package/.claude/skills/github-code-review/SKILL.md +2 -17
- package/.claude/skills/github-multi-repo/SKILL.md +4 -16
- package/.claude/skills/github-project-management/SKILL.md +18 -33
- package/.claude/skills/github-release-management/SKILL.md +4 -21
- package/.claude/skills/github-workflow-automation/SKILL.md +8 -26
- package/.claude/skills/pair-programming/SKILL.md +2 -2
- package/.claude/skills/reasoningbank-intelligence/SKILL.md +2 -2
- package/.claude/skills/skill-builder/SKILL.md +0 -103
- package/.claude/skills/skills-manifest.json +1 -1
- package/.claude/skills/sparc-methodology/SKILL.md +2 -11
- package/.claude/skills/stream-chain/SKILL.md +0 -3
- package/.claude/skills/swarm-advanced/SKILL.md +2 -5
- package/.claude/skills/swarm-orchestration/SKILL.md +1 -1
- package/.claude/skills/verification-quality/SKILL.md +121 -93
- package/CHANGELOG.md +49 -0
- package/assets/skills/pair-programming/SKILL.md +2 -2
- package/assets/skills/verification-quality/SKILL.md +121 -93
- package/dist/audit/witness-chain.d.ts +1 -1
- package/dist/audit/witness-findings.d.ts +50 -0
- package/dist/audit/witness-findings.js +41 -0
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-A6GCBONS.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-5CSKQB4O.js → agent-booster-wasm-3OJAT664.js} +2 -2
- package/dist/cli/chunks/{agent-handler-EBV3OKTE.js → agent-handler-6TCTI5AT.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-RZ53YM2U.js → agent-memory-branch-FAWCYEGJ.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-FRCSXNMG.js +2 -0
- package/dist/cli/chunks/{arena-UCP74DRO.js → arena-O2TCUQBF.js} +4 -4
- package/dist/cli/chunks/{arena-QWYTIQ6I.js → arena-UVYIGYUF.js} +2 -2
- package/dist/cli/chunks/{audit-M4FNIX47.js → audit-AYESKHAJ.js} +2 -2
- package/dist/cli/chunks/base-CZ3EHBU5.js +2 -0
- package/dist/cli/chunks/{hnswlib-node-HMZC5TXM.js → better-sqlite3-MJNUEPYB.js} +2 -2
- package/dist/cli/chunks/{brain-handler-OY6Q2GY5.js → brain-handler-KSJBVTHZ.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-TQWN4NIX.js → branch-enumerator-4O3S42EG.js} +2 -2
- package/dist/cli/chunks/{browser-2EH3RXJ2.js → browser-5VXK323P.js} +2 -2
- package/dist/cli/chunks/browser-workflow-EKTGQQBQ.js +2 -0
- package/dist/cli/chunks/{chunk-SQPDGRYR.js → chunk-22FHOXEE.js} +1 -1
- package/dist/cli/chunks/{chunk-ZEUUVLS2.js → chunk-2RE32VOF.js} +1 -1
- package/dist/cli/chunks/{chunk-ITRUZ3WE.js → chunk-3D4HNUZM.js} +2 -2
- package/dist/cli/chunks/{chunk-6VQKNPGY.js → chunk-3DS7ZHA7.js} +2 -2
- package/dist/cli/chunks/{chunk-Z45QDDZQ.js → chunk-3G25ZBQ6.js} +1 -1
- package/dist/cli/chunks/{chunk-ETGEGMYS.js → chunk-3IMEDZIS.js} +3 -3
- package/dist/cli/chunks/{chunk-BEOGI5FC.js → chunk-3V5DAM37.js} +2 -2
- package/dist/cli/chunks/{chunk-UFMW25MS.js → chunk-3XCEFSUK.js} +2 -2
- package/dist/cli/chunks/{chunk-QYXTESM3.js → chunk-437XL5VZ.js} +2 -2
- package/dist/cli/chunks/{chunk-XVQUVCFR.js → chunk-44HXRFOP.js} +2 -2
- package/dist/cli/chunks/{chunk-VGYUVMSN.js → chunk-4565IIF6.js} +2 -2
- package/dist/cli/chunks/{chunk-IFTEM672.js → chunk-4BMPFEEG.js} +2 -2
- package/dist/cli/chunks/{chunk-MKLLB4PM.js → chunk-4G4GTF36.js} +4 -4
- package/dist/cli/chunks/{chunk-R7FHQQAV.js → chunk-4OYC5TIZ.js} +2 -2
- package/dist/cli/chunks/{chunk-LFT7WYHW.js → chunk-4RUS5E3Q.js} +2 -2
- package/dist/cli/chunks/{chunk-IKNDGXZZ.js → chunk-4S3UIY3G.js} +2 -2
- package/dist/cli/chunks/{chunk-JQM64WJ2.js → chunk-4UHWZ47M.js} +1 -1
- package/dist/cli/chunks/{chunk-NBTKI2TX.js → chunk-56PICCZN.js} +2 -2
- package/dist/cli/chunks/chunk-57WGS6BI.js +2 -0
- package/dist/cli/chunks/{chunk-MDYI4IIW.js → chunk-5LDUW2FD.js} +1 -1
- package/dist/cli/chunks/{chunk-RPYYS6BX.js → chunk-5PSIKJL5.js} +2 -2
- package/dist/cli/chunks/{chunk-Y7UJC5OL.js → chunk-5QFZEEJ2.js} +3 -3
- package/dist/cli/chunks/{chunk-HNSZDIQU.js → chunk-5Y7GXQOM.js} +2 -2
- package/dist/cli/chunks/{chunk-DV7662EZ.js → chunk-6CH7476R.js} +1 -1
- package/dist/cli/chunks/{chunk-N52ZBTPM.js → chunk-6WNYBIPS.js} +2 -2
- package/dist/cli/chunks/{chunk-WBQEOACC.js → chunk-6YNXH6H4.js} +2 -2
- package/dist/cli/chunks/{chunk-SLWJNHCR.js → chunk-6ZAUNPAI.js} +2 -2
- package/dist/cli/chunks/{chunk-4OTA6KYJ.js → chunk-72UPBNVF.js} +2 -2
- package/dist/cli/chunks/{chunk-KOOY72E3.js → chunk-76UVJLPM.js} +2 -2
- package/dist/cli/chunks/{chunk-YR44KQUK.js → chunk-7DQLYWLR.js} +1 -1
- package/dist/cli/chunks/{chunk-I2HQLBWG.js → chunk-7GP7ZG3K.js} +2 -2
- package/dist/cli/chunks/{chunk-GGSXHGWD.js → chunk-7OAKIXNM.js} +2 -2
- package/dist/cli/chunks/{chunk-3GWSHRDA.js → chunk-7QICU44H.js} +2 -2
- package/dist/cli/chunks/{chunk-ACV2WVMX.js → chunk-7SRSOZMP.js} +1 -1
- package/dist/cli/chunks/{chunk-X2L4POJE.js → chunk-7WQKKYYG.js} +1 -1
- package/dist/cli/chunks/{chunk-ZFP3O5FM.js → chunk-AEZMNFXM.js} +1 -1
- package/dist/cli/chunks/{chunk-2TUVBEWK.js → chunk-AG4BYKUV.js} +2 -2
- package/dist/cli/chunks/{chunk-FTOICJQG.js → chunk-AL54LED5.js} +2 -2
- package/dist/cli/chunks/{chunk-IQSPL2H4.js → chunk-ATQTTGSE.js} +2 -2
- package/dist/cli/chunks/{chunk-3J6LYF6I.js → chunk-B5EE63VE.js} +2 -2
- package/dist/cli/chunks/{chunk-JN3IQB4L.js → chunk-B6U56VWG.js} +1 -1
- package/dist/cli/chunks/{chunk-3LP5GPGU.js → chunk-BOQNPFO5.js} +1 -1
- package/dist/cli/chunks/{chunk-G25YZ7Z6.js → chunk-BR4ERWVD.js} +2 -2
- package/dist/cli/chunks/{chunk-PJ4HSXH3.js → chunk-BVFNF3RW.js} +1 -1
- package/dist/cli/chunks/{chunk-KZE5UR4T.js → chunk-BXLWERBR.js} +3 -3
- package/dist/cli/chunks/{chunk-7MBF3S25.js → chunk-C27UV6DO.js} +1 -1
- package/dist/cli/chunks/{chunk-453UDYD2.js → chunk-C7FYDE5F.js} +161 -154
- package/dist/cli/chunks/{chunk-HMSPPGUF.js → chunk-CIDTFU3C.js} +2 -2
- package/dist/cli/chunks/{chunk-HHSEIPSQ.js → chunk-CII57TME.js} +1 -1
- package/dist/cli/chunks/{chunk-DCJIXDO6.js → chunk-CN2HMHIY.js} +2 -2
- package/dist/cli/chunks/{chunk-5ASPEVVF.js → chunk-CXIFCN6G.js} +1 -1
- package/dist/cli/chunks/{chunk-GBFAQ4DW.js → chunk-CZU5G6J4.js} +1 -1
- package/dist/cli/chunks/{chunk-JQSA6EMI.js → chunk-D4DAZ3P2.js} +2 -2
- package/dist/cli/chunks/{chunk-73EWPVBJ.js → chunk-D6MPGK7R.js} +2 -2
- package/dist/cli/chunks/{chunk-CERSTEAJ.js → chunk-DZT4A7R3.js} +2 -2
- package/dist/cli/chunks/{chunk-UEH6C5JA.js → chunk-EFRIMR74.js} +1 -1
- package/dist/cli/chunks/{chunk-PC3VIR2A.js → chunk-EJSDQQZH.js} +2 -2
- package/dist/cli/chunks/{chunk-XMZ2DHUL.js → chunk-EQYDPF52.js} +1 -1
- package/dist/cli/chunks/{chunk-QCJ7YOVN.js → chunk-EZBXCEBV.js} +2 -2
- package/dist/cli/chunks/{chunk-FGOVDO3R.js → chunk-FBOPSWF6.js} +2 -2
- package/dist/cli/chunks/{chunk-TGLEREP5.js → chunk-FK3XYV3A.js} +2 -2
- package/dist/cli/chunks/{chunk-RKDNLPZM.js → chunk-FOD6JEEU.js} +2 -2
- package/dist/cli/chunks/{chunk-ETZ62NFD.js → chunk-GUSW3OGX.js} +1 -1
- package/dist/cli/chunks/{chunk-VVJXQ4FR.js → chunk-H4V6WCF7.js} +2 -2
- package/dist/cli/chunks/{chunk-IOQYSR5S.js → chunk-H5GCRC2D.js} +2 -2
- package/dist/cli/chunks/{chunk-ISVBO4XO.js → chunk-HMVL55QX.js} +2 -2
- package/dist/cli/chunks/{chunk-2BBKA5J4.js → chunk-HOFEAA4R.js} +1 -1
- package/dist/cli/chunks/{chunk-OZQIDDXB.js → chunk-HYT5EMES.js} +2 -2
- package/dist/cli/chunks/{chunk-KBVXKFDI.js → chunk-IAHJ62JS.js} +4 -4
- package/dist/cli/chunks/{chunk-AYOTODUV.js → chunk-IIX5Y7BO.js} +1 -1
- package/dist/cli/chunks/{chunk-YSTWLDVD.js → chunk-ILZHECWZ.js} +3 -3
- package/dist/cli/chunks/{chunk-T6KT63NC.js → chunk-IUVAWWQG.js} +2 -2
- package/dist/cli/chunks/{chunk-ZK56THZT.js → chunk-IVZVVZZ3.js} +3 -3
- package/dist/cli/chunks/{chunk-FMULOSBL.js → chunk-J2LAYCYZ.js} +1 -1
- package/dist/cli/chunks/{chunk-7Q6CMSMD.js → chunk-JGHEGMLD.js} +3 -3
- package/dist/cli/chunks/{chunk-72QNONO6.js → chunk-K3BBLIWW.js} +2 -2
- package/dist/cli/chunks/{chunk-XSG4XKGO.js → chunk-K7XPKGOL.js} +2 -2
- package/dist/cli/chunks/{chunk-YRP73HO4.js → chunk-KIBP3LGY.js} +1 -1
- package/dist/cli/chunks/{chunk-SHW43QQV.js → chunk-KRUKMGPF.js} +2 -2
- package/dist/cli/chunks/{chunk-WP6XUSVW.js → chunk-L2QHZFC3.js} +1 -1
- package/dist/cli/chunks/{chunk-AVKGDS6F.js → chunk-LNV76GGB.js} +2 -2
- package/dist/cli/chunks/{chunk-IHNBZ5XG.js → chunk-LOPM3YIO.js} +2 -2
- package/dist/cli/chunks/{chunk-JNX7IRSI.js → chunk-LSZLXLZA.js} +2 -2
- package/dist/cli/chunks/{chunk-NI7O3GKZ.js → chunk-MILWEZSZ.js} +3 -3
- package/dist/cli/chunks/{chunk-7PTA7AVW.js → chunk-MX6M2VPB.js} +1 -1
- package/dist/cli/chunks/{chunk-YQIMO7VJ.js → chunk-N4OWZLH5.js} +2 -2
- package/dist/cli/chunks/{chunk-7BD7DZCB.js → chunk-N52WQO3G.js} +2 -2
- package/dist/cli/chunks/{chunk-Y7TBCHW4.js → chunk-N6NSZG7Z.js} +2 -2
- package/dist/cli/chunks/{chunk-C33BMWYZ.js → chunk-N6RSJGTW.js} +5 -5
- package/dist/cli/chunks/{chunk-G5VE3HQW.js → chunk-NKCL6RAF.js} +2 -2
- package/dist/cli/chunks/{chunk-LTH6XARD.js → chunk-NVJIOCS5.js} +2 -2
- package/dist/cli/chunks/{chunk-P3NV6KN3.js → chunk-NYWK7ZSX.js} +1 -1
- package/dist/cli/chunks/{chunk-5DG6H553.js → chunk-O5NF6BBD.js} +1 -1
- package/dist/cli/chunks/{chunk-J425SQFE.js → chunk-O75SVMMB.js} +2 -2
- package/dist/cli/chunks/{chunk-XKRG2U3V.js → chunk-OHBZON7T.js} +1 -1
- package/dist/cli/chunks/{chunk-NQD4CMXC.js → chunk-OUBYADPD.js} +2 -2
- package/dist/cli/chunks/{chunk-7E5NYLJT.js → chunk-OUSD2RWO.js} +2 -2
- package/dist/cli/chunks/{chunk-VHON5NDM.js → chunk-OX2PGDUM.js} +3 -3
- package/dist/cli/chunks/{chunk-PUTRXS5I.js → chunk-P7CMWL7Y.js} +2 -2
- package/dist/cli/chunks/{chunk-R3YO3Z7I.js → chunk-PY4YQDBM.js} +4 -4
- package/dist/cli/chunks/{chunk-BA4WZIAQ.js → chunk-QEDS3MOJ.js} +2 -2
- package/dist/cli/chunks/{chunk-X2TUDGFL.js → chunk-QMN563LV.js} +10 -10
- package/dist/cli/chunks/{chunk-SKL225P5.js → chunk-QOR4YAZY.js} +2 -2
- package/dist/cli/chunks/{chunk-F6Y7DTHR.js → chunk-QUTKELAS.js} +2 -2
- package/dist/cli/chunks/{chunk-HJFQVKPI.js → chunk-QXDZN2WX.js} +1 -1
- package/dist/cli/chunks/{chunk-RVQW6CBF.js → chunk-S456W64P.js} +2 -2
- package/dist/cli/chunks/{chunk-F62ZQZQQ.js → chunk-S7IHSELP.js} +2 -2
- package/dist/cli/chunks/{chunk-FMKALHT3.js → chunk-S7ZHD6VN.js} +2 -2
- package/dist/cli/chunks/{chunk-AURDGQNB.js → chunk-SU4YXUVK.js} +2 -2
- package/dist/cli/chunks/{chunk-MTSMFEWK.js → chunk-SZPTUV3B.js} +2 -2
- package/dist/cli/chunks/{chunk-O6FN53HB.js → chunk-T7PUM6OY.js} +1 -1
- package/dist/cli/chunks/{chunk-JZFA2PWY.js → chunk-TCKBICJ3.js} +2 -2
- package/dist/cli/chunks/{chunk-DDQWW22L.js → chunk-TOQJWLJV.js} +2 -2
- package/dist/cli/chunks/{chunk-2WVLFT2I.js → chunk-TUEDIQHY.js} +1 -1
- package/dist/cli/chunks/{chunk-QGBXENIP.js → chunk-U5GCSSYX.js} +1 -1
- package/dist/cli/chunks/{chunk-N3R3JGUY.js → chunk-UDLN2THT.js} +1 -1
- package/dist/cli/chunks/{chunk-N7MKF4F4.js → chunk-V6YDM37M.js} +1 -1
- package/dist/cli/chunks/{chunk-B4QA3YN6.js → chunk-VGR65B4Y.js} +1 -1
- package/dist/cli/chunks/{chunk-LCDRRAES.js → chunk-VRHLHGKR.js} +2 -2
- package/dist/cli/chunks/{chunk-XW5OXBVV.js → chunk-VS2G6LX5.js} +2 -2
- package/dist/cli/chunks/{chunk-L7GQKJLV.js → chunk-W6RS5S4Q.js} +2 -2
- package/dist/cli/chunks/{chunk-LYV7WJWA.js → chunk-WEPZOCN7.js} +1 -1
- package/dist/cli/chunks/{chunk-2ZC7S4UG.js → chunk-WIC5UZCQ.js} +2 -2
- package/dist/cli/chunks/{chunk-ZT4NPTML.js → chunk-X2OVUBF6.js} +2 -2
- package/dist/cli/chunks/{chunk-D3S4SRSA.js → chunk-X4GKYSOH.js} +2 -2
- package/dist/cli/chunks/{chunk-V6WJVFRN.js → chunk-XEVUW4QL.js} +2 -2
- package/dist/cli/chunks/{chunk-PVBJUANU.js → chunk-XMDZRULK.js} +2 -2
- package/dist/cli/chunks/{chunk-5OJXVVTI.js → chunk-YFY35CSD.js} +2 -2
- package/dist/cli/chunks/{chunk-TYS77XHV.js → chunk-Z6ADE3KJ.js} +2 -2
- package/dist/cli/chunks/{chunk-QZQGYSDG.js → chunk-ZKPOKMJZ.js} +2 -2
- package/dist/cli/chunks/{chunk-2QU6C3OS.js → chunk-ZRWAFMM7.js} +2 -2
- package/dist/cli/chunks/{ci-4JK2NFCD.js → ci-KTWY7BZT.js} +2 -2
- package/dist/cli/chunks/{ci-output-LCGTJQWC.js → ci-output-WOX6QBMS.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-EJF7D3L4.js → circuit-breaker-6XKOSFIF.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-3RUC6OB4.js → claude-flow-setup-5JA4MNE4.js} +2 -2
- package/dist/cli/chunks/client-X3KUJ6R5.js +2 -0
- package/dist/cli/chunks/{cline-installer-6LY5C5QH.js → cline-installer-Z2ANHEKW.js} +2 -2
- package/dist/cli/chunks/{code-MPDG4UHS.js → code-NO4ZKNDU.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-OY5GQJBM.js → code-index-extractor-VV4OEPG7.js} +2 -2
- package/dist/cli/chunks/{codex-installer-BO7E2ZVA.js → codex-installer-BP7Y2NYR.js} +2 -2
- package/dist/cli/chunks/{completions-VGL3KJ2R.js → completions-YULJQUF4.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-5DPUK7IL.js → complexity-analyzer-D7XYPQ76.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-LFDG2D42.js → continuedev-installer-E3L7UF72.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-SEMMMIZH.js → copilot-installer-5TRUMJC5.js} +2 -2
- package/dist/cli/chunks/core-handlers-A2EQB3UH.js +2 -0
- package/dist/cli/chunks/{cost-tracker-OPBC6FQM.js → cost-tracker-QTYSJMSV.js} +2 -2
- package/dist/cli/chunks/{coverage-CFDUSRKU.js → coverage-D5DKZ3XT.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-OKZ2PDHT.js +2 -0
- package/dist/cli/chunks/{cursor-installer-6TXUUVY4.js → cursor-installer-UDBHGUIG.js} +2 -2
- package/dist/cli/chunks/{daemon-7BDBPPAF.js → daemon-2GXYN7F7.js} +3 -3
- package/dist/cli/chunks/{daemon-5KO46YQR.js → daemon-IVWUMQKL.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-6DQKZOUW.js → dag-attention-scheduler-PWXR4QTU.js} +2 -2
- package/dist/cli/chunks/{detect-R2QAYDPI.js → detect-C6P7ONFB.js} +2 -2
- package/dist/cli/chunks/{dist-node-3POCIJ4N.js → dist-node-2BUFM2JK.js} +2 -2
- package/dist/cli/chunks/{domain-handler-KW63CHUH.js → domain-handler-Q2GWZLDM.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-2QPOJCUD.js → domain-transfer-GMUBAM3J.js} +2 -2
- package/dist/cli/chunks/dream-ZBP4Z5C3.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-OIDJZQEP.js → embed-and-insert-pattern-EFUERRM2.js} +2 -2
- package/dist/cli/chunks/{eval-UGEKTTAQ.js → eval-24FIC43F.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-3BIM2TT7.js → experience-capture-middleware-R4UP2Q2M.js} +3 -3
- package/dist/cli/chunks/{fast-paths-HCJQXB7W.js → fast-paths-RQCGGTXB.js} +2 -2
- package/dist/cli/chunks/{feature-flags-GDGJKLN4.js → feature-flags-APTWWVNQ.js} +2 -2
- package/dist/cli/chunks/{feature-flags-W4JSFBMV.js → feature-flags-SOXVYIBN.js} +2 -2
- package/dist/cli/chunks/{file-discovery-JMUZ4MUH.js → file-discovery-66KRMXVF.js} +2 -2
- package/dist/cli/chunks/{fleet-YNNK2CKW.js → fleet-EMBNKO5Q.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-R2ZY6CDD.js → gnn-wrapper-6TKDWFJF.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-OZX2EJHQ.js → heartbeat-handler-4ODKJ75H.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-6JUWQXWG.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-JT4BU7XJ.js +2 -0
- package/dist/cli/chunks/hnsw-index-JC5YELJX.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-3S6TYCG3.js → hnsw-legacy-bridge-25KFCLUC.js} +2 -2
- package/dist/cli/chunks/{better-sqlite3-RIBLRHJL.js → hnswlib-node-FUWQTM2D.js} +2 -2
- package/dist/cli/chunks/{hooks-KM7WR35T.js → hooks-JIDA2COE.js} +10 -10
- package/dist/cli/chunks/hybrid-router-SLTXHUFG.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-RX53A73M.js → hypergraph-engine-3YDFDPE3.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-3QQB3H3Z.js → hypergraph-handler-VWZX2OJX.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-JXHCMZXY.js +2 -0
- package/dist/cli/chunks/{init-handler-Y62RH4ZI.js → init-handler-DH7VQAMF.js} +6 -6
- package/dist/cli/chunks/init-wizard-EX37TYOG.js +2 -0
- package/dist/cli/chunks/kernel-JPHAG27D.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-26R253L2.js → kilocode-installer-2W2KZCGH.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-PFA5QPZZ.js → kiro-installer-E5KP7OMD.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-5QJZIRYB.js +2 -0
- package/dist/cli/chunks/{learning-CQLM5ANX.js → learning-XJRUVPLF.js} +3 -3
- package/dist/cli/chunks/{llm-router-QZ5PG4PF.js → llm-router-AEEKEMF5.js} +4 -4
- package/dist/cli/chunks/llm-router-service-SE2RO4P5.js +2 -0
- package/dist/cli/chunks/{load-UPA6LPHM.js → load-PZ4YOTBJ.js} +2 -2
- package/dist/cli/chunks/load-test-LOTBWIIS.js +2 -0
- package/dist/cli/chunks/{mcp-LSWTLAJ4.js → mcp-IVA6LC2S.js} +2 -2
- package/dist/cli/chunks/{memory-VGEYYGCG.js → memory-Y3DHXFQE.js} +5 -5
- package/dist/cli/chunks/memory-backend-BSDKTFAN.js +2 -0
- package/dist/cli/chunks/{memory-handlers-QBURG7NA.js → memory-handlers-V5PXEJWL.js} +2 -2
- package/dist/cli/chunks/{multi-model-executor-VZVFBIKC.js → multi-model-executor-646G4S4Y.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-PBQAXNLV.js → opencode-installer-P6KOOTUS.js} +2 -2
- package/dist/cli/chunks/{orchestrator-YND7JB5O.js → orchestrator-T2GVKYMX.js} +5 -5
- package/dist/cli/chunks/pattern-null-store-LRSXCZWM.js +2 -0
- package/dist/cli/chunks/{pipeline-GM5RRUES.js → pipeline-CK2ON45P.js} +2 -2
- package/dist/cli/chunks/{platform-L7OGGRSL.js → platform-OQNSD3A3.js} +2 -2
- package/dist/cli/chunks/{plugin-N4YAE6H5.js → plugin-UOG6RNRM.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-7D67XV6Z.js → prime-radiant-advanced-wasm-37UE6TG5.js} +2 -2
- package/dist/cli/chunks/protocol-executor-WPUVJEL7.js +2 -0
- package/dist/cli/chunks/{protocol-handler-V2WTFU7N.js → protocol-handler-V722S6YH.js} +2 -2
- package/dist/cli/chunks/{prove-33DS5Z3N.js → prove-ANGY6W3W.js} +2 -2
- package/dist/cli/chunks/provider-manager-EVPWSH3E.js +2 -0
- package/dist/cli/chunks/qe-reasoning-bank-IH63FG33.js +2 -0
- package/dist/cli/chunks/{quality-WCSEA5GH.js → quality-KG4ALI2L.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-TTCAGYQO.js +2 -0
- package/dist/cli/chunks/{real-embeddings-OQ5F37DG.js → real-embeddings-GUZDO5UN.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-II7LIR2X.js → roocode-installer-WROAR6MJ.js} +2 -2
- package/dist/cli/chunks/router-64Q4ILOQ.js +2 -0
- package/dist/cli/chunks/routing-feedback-KCZV4XXC.js +2 -0
- package/dist/cli/chunks/{routing-handler-6OFHARIY.js → routing-handler-UFPSSS5D.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-GD5JTR4M.js → ruvector-commands-XJQMKDRM.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-HSK6BYZV.js → rvf-dual-writer-QPRMDKYX.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-554SMF5S.js → rvf-migration-adapter-SOHBK23K.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-OFDBCAYE.js → rvf-migration-coordinator-MTWUSPEJ.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-GNJKMURU.js +2 -0
- package/dist/cli/chunks/safe-db-6VBZQIJI.js +2 -0
- package/dist/cli/chunks/schedule-4V7O5IPX.js +2 -0
- package/dist/cli/chunks/scheduler-CQDMHEHN.js +2 -0
- package/dist/cli/chunks/{security-GN4J6DSS.js → security-5MAMQKP6.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-Q4PM3QCN.js → shared-rvf-adapter-YEUBSRNN.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-R5WK5BXQ.js → shared-rvf-dual-writer-DBQJHG42.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-7DHUFTHL.js +2 -0
- package/dist/cli/chunks/{status-handler-AHS5WVMG.js → status-handler-ZUB2UKQZ.js} +2 -2
- package/dist/cli/chunks/{structural-health-5KUKNLHZ.js → structural-health-B2GHENWX.js} +2 -2
- package/dist/cli/chunks/{sync-PUMM3SR6.js → sync-7VMXJTR2.js} +2 -2
- package/dist/cli/chunks/{sync-TQLGD5HX.js → sync-YCUUW3IP.js} +2 -2
- package/dist/cli/chunks/{task-handler-D7VXV4AF.js → task-handler-N7LJTXZM.js} +2 -2
- package/dist/cli/chunks/{task-handlers-QMN4SWUG.js → task-handlers-GDHNJV2E.js} +3 -3
- package/dist/cli/chunks/{test-HEWZR6YQ.js → test-6COGC5KI.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-VTMLBEPA.js → test-scheduling-CUERHJMF.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-IYBG7PQ6.js → token-bootstrap-JTGSL6PP.js} +2 -2
- package/dist/cli/chunks/{token-usage-C7H27BFZ.js → token-usage-LSG3JYGX.js} +2 -2
- package/dist/cli/chunks/{transformers-5ZJVC6NB.js → transformers-ODIITRCT.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-EARBJG2H.js → tree-sitter-wasm-parser-KSP7ZZ5H.js} +2 -2
- package/dist/cli/chunks/{types-3IHE42PZ.js → types-6N6SUU2O.js} +2 -2
- package/dist/cli/chunks/unified-memory-MQA72NLP.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-K7HA3CWV.js +2 -0
- package/dist/cli/chunks/unified-persistence-2DXB4OE4.js +2 -0
- package/dist/cli/chunks/{upgrade-YP3VFSXO.js → upgrade-7SCVOCPS.js} +2 -2
- package/dist/cli/chunks/{validate-VSBNKPN6.js → validate-762ISH2Y.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-GOCJVWXE.js → validate-swarm-R6WYYXGO.js} +2 -2
- package/dist/cli/chunks/{vibium-U6YKCLDF.js → vibium-5GZYSUDQ.js} +2 -2
- package/dist/cli/chunks/visual-security-UD6CARIJ.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-TSNVGWSN.js → web-tree-sitter-VYYVAJTY.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-2VKMEFSD.js → windsurf-installer-RRIOR3B6.js} +2 -2
- package/dist/cli/chunks/witness-chain-LWALPPMC.js +2 -0
- package/dist/cli/chunks/{witness-chain-BWZCW52H.js → witness-chain-SRVBEKDB.js} +2 -2
- package/dist/cli/chunks/{workflow-J6SCYLU3.js → workflow-XNUDHGEC.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-QU652FLH.js +2 -0
- package/dist/cli/chunks/{wrappers-M5C7DONW.js → wrappers-3STST7QW.js} +2 -2
- package/dist/domains/requirements-validation/coordinator.d.ts +16 -2
- package/dist/domains/requirements-validation/coordinator.js +112 -7
- package/dist/domains/requirements-validation/plugin.js +20 -1
- package/dist/domains/test-generation/coordinator.d.ts +3 -1
- package/dist/domains/test-generation/coordinator.js +15 -33
- package/dist/integrations/darwin/types.d.ts +10 -3
- package/dist/integrations/darwin/types.js +10 -3
- package/dist/mcp/bundle.js +366 -359
- package/dist/mcp/tool-scoping.d.ts +8 -2
- package/dist/mcp/tool-scoping.js +13 -0
- package/dist/routing/free-tier/coordinator-support.d.ts +90 -0
- package/dist/routing/free-tier/coordinator-support.js +78 -0
- package/dist/routing/free-tier/executor.d.ts +43 -1
- package/dist/routing/free-tier/executor.js +69 -26
- package/dist/routing/free-tier/index.d.ts +1 -0
- package/dist/routing/free-tier/index.js +1 -0
- package/dist/routing/value-score.d.ts +49 -0
- package/dist/routing/value-score.js +54 -0
- package/dist/shared/optional-module.d.ts +23 -0
- package/dist/shared/optional-module.js +46 -0
- package/dist/verification/adversarial-verify/calibrate.d.ts +32 -0
- package/dist/verification/adversarial-verify/calibrate.js +33 -0
- package/dist/verification/adversarial-verify/gate.d.ts +38 -0
- package/dist/verification/adversarial-verify/gate.js +32 -0
- package/dist/verification/adversarial-verify/index.d.ts +20 -0
- package/dist/verification/adversarial-verify/index.js +6 -0
- package/dist/verification/adversarial-verify/prompts.d.ts +14 -0
- package/dist/verification/adversarial-verify/prompts.js +17 -0
- package/dist/verification/adversarial-verify/synthesize.d.ts +18 -0
- package/dist/verification/adversarial-verify/synthesize.js +35 -0
- package/dist/verification/adversarial-verify/types.d.ts +59 -0
- package/dist/verification/adversarial-verify/types.js +10 -0
- package/dist/verification/adversarial-verify/verify.d.ts +20 -0
- package/dist/verification/adversarial-verify/verify.js +34 -0
- package/package.json +10 -1
- package/dist/cli/chunks/adapter-WLFT5VMV.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-JBH4GZUM.js +0 -2
- package/dist/cli/chunks/base-A7JGM473.js +0 -2
- package/dist/cli/chunks/browser-workflow-TIDJWULK.js +0 -2
- package/dist/cli/chunks/chunk-C4OYHUJV.js +0 -2
- package/dist/cli/chunks/client-ZLJ3JMBC.js +0 -2
- package/dist/cli/chunks/core-handlers-EM7FUYTI.js +0 -2
- package/dist/cli/chunks/cross-domain-router-DYGHQ6P5.js +0 -2
- package/dist/cli/chunks/dream-DBE5D5BD.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-NFHAANNL.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-HMPCZFBY.js +0 -2
- package/dist/cli/chunks/hnsw-index-KRIWSXX4.js +0 -2
- package/dist/cli/chunks/hybrid-router-BAB32B2W.js +0 -2
- package/dist/cli/chunks/impact-analyzer-3D6XHWQE.js +0 -2
- package/dist/cli/chunks/init-wizard-LLU3WVGC.js +0 -2
- package/dist/cli/chunks/kernel-ZFHAYHHJ.js +0 -2
- package/dist/cli/chunks/knowledge-graph-ETZ65KOY.js +0 -2
- package/dist/cli/chunks/llm-router-service-R6CTGF5I.js +0 -2
- package/dist/cli/chunks/load-test-UOWIJUCH.js +0 -2
- package/dist/cli/chunks/memory-backend-E3ZQKW7A.js +0 -2
- package/dist/cli/chunks/pattern-null-store-OUOJO2RH.js +0 -2
- package/dist/cli/chunks/protocol-executor-KHAPG5CP.js +0 -2
- package/dist/cli/chunks/provider-manager-FGPPW7T4.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-TS7XOJDA.js +0 -2
- package/dist/cli/chunks/queen-coordinator-J35FNFQ3.js +0 -2
- package/dist/cli/chunks/router-AFTKPDI5.js +0 -2
- package/dist/cli/chunks/routing-feedback-SABZUJTF.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-57MDDSFQ.js +0 -2
- package/dist/cli/chunks/safe-db-2HR6MVYM.js +0 -2
- package/dist/cli/chunks/schedule-KLVAN6XI.js +0 -2
- package/dist/cli/chunks/scheduler-WYZ6BC5Y.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-2CGU5INO.js +0 -2
- package/dist/cli/chunks/unified-memory-PMYRQC5K.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-7TRL2K5Q.js +0 -2
- package/dist/cli/chunks/unified-persistence-S4BNJK4S.js +0 -2
- package/dist/cli/chunks/visual-security-RPMZ3J7L.js +0 -2
- package/dist/cli/chunks/witness-chain-BTDZSQ6P.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-42B62D3V.js +0 -2
|
@@ -1,48 +1,299 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* Displays real-time V3 implementation progress and system status
|
|
3
|
+
* RuFlo V3 Statusline — delegation build (#2195)
|
|
5
4
|
*
|
|
6
|
-
*
|
|
5
|
+
* Fix for ruvnet/ruflo#2195: the previous version re-implemented all data
|
|
6
|
+
* readers locally using fragile file probes that missed AgentDB patterns,
|
|
7
|
+
* the v3/docs/adr/ ADR directory, and the real vector count.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* --unsafe Legacy multi-line without collision avoidance
|
|
12
|
-
* --legacy Alias for --unsafe
|
|
13
|
-
* --json JSON output with pretty printing
|
|
14
|
-
* --compact JSON output without formatting
|
|
9
|
+
* This version delegates to 'npx @claude-flow/cli hooks statusline --json'
|
|
10
|
+
* as the single source of truth. That command queries AgentDB directly,
|
|
11
|
+
* counts ADRs in both directories, and reports the real intelligence pct.
|
|
15
12
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* terminal coordinates (columns 15-25 on second-to-last line). The safe
|
|
19
|
-
* mode pads the collision line with spaces to push content past column 25.
|
|
13
|
+
* ADR counting falls back to local file reads so the display still works
|
|
14
|
+
* without network access (counts both v3/docs/adr/ and v3/implementation/adrs/).
|
|
20
15
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
16
|
+
* Cache: JSON result is cached in /tmp for 10s so rapid prompt triggers
|
|
17
|
+
* (every keystroke in some shells) don't hammer the CLI on every call.
|
|
18
|
+
*
|
|
19
|
+
* Usage: node statusline.cjs [--json] [--compact] [--dashboard]
|
|
23
20
|
*/
|
|
24
21
|
|
|
25
22
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
26
23
|
const fs = require('fs');
|
|
27
24
|
const path = require('path');
|
|
28
25
|
const { execSync } = require('child_process');
|
|
26
|
+
const os = require('os');
|
|
29
27
|
|
|
30
28
|
// Configuration
|
|
31
29
|
const CONFIG = {
|
|
32
|
-
enabled: true,
|
|
33
|
-
showProgress: true,
|
|
34
|
-
showSecurity: true,
|
|
35
|
-
showSwarm: true,
|
|
36
|
-
showHooks: true,
|
|
37
|
-
showPerformance: true,
|
|
38
|
-
refreshInterval: 5000,
|
|
39
30
|
maxAgents: 15,
|
|
40
|
-
|
|
31
|
+
// Session-cost display. Claude Code's cost.total_cost_usd is a client-side
|
|
32
|
+
// estimate that "may differ from your actual bill" and reads as misleading on
|
|
33
|
+
// subscription plans, where token usage is not billed per dollar. These let
|
|
34
|
+
// each user pick what the segment means to them without changing the default.
|
|
35
|
+
// RUFLO_STATUSLINE_COST_SYMBOL override the leading '$' (e.g. ⚡, €, 🌱);
|
|
36
|
+
// set to an empty string for the number alone.
|
|
37
|
+
// RUFLO_STATUSLINE_HIDE_COST 1/true/yes/on removes the segment entirely.
|
|
38
|
+
costSymbol: process.env.RUFLO_STATUSLINE_COST_SYMBOL ?? '$',
|
|
39
|
+
hideCost: /^(1|true|yes|on)$/i.test(process.env.RUFLO_STATUSLINE_HIDE_COST || ''),
|
|
41
40
|
};
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
const CWD = process.cwd();
|
|
43
|
+
|
|
44
|
+
// ─── Delegation cache ───────────────────────────────────────────
|
|
45
|
+
// Cache the CLI JSON result for 60s so rapid prompt re-renders
|
|
46
|
+
// (Claude Code refreshes the statusline several times a second while
|
|
47
|
+
// streaming) don't re-invoke the CLI each time. #2337: bumped 10s→60s
|
|
48
|
+
// because 10s was far too short for how often Claude Code re-renders.
|
|
49
|
+
const CACHE_FILE = path.join(os.tmpdir(), 'ruflo-statusline-cache-' + require('crypto').createHash('md5').update(CWD).digest('hex').slice(0, 8) + '.json');
|
|
50
|
+
const CACHE_TTL_MS = 60000;
|
|
51
|
+
|
|
52
|
+
// #2337: resolve an already-installed @claude-flow/cli (or ruflo) bin so we
|
|
53
|
+
// can invoke it directly via `node`. The previous version called
|
|
54
|
+
// `npx --yes @claude-flow/cli@latest` on every uncached render, which forces
|
|
55
|
+
// a registry resolution + cold-start of the entire CLI per render. With
|
|
56
|
+
// multiple concurrent Claude Code sessions this storms the host (reporter
|
|
57
|
+
// saw load average 40-65 on a 12-core box).
|
|
58
|
+
//
|
|
59
|
+
// Returns the absolute path to bin/cli.js or null. Mirrors getPkgVersion()'s
|
|
60
|
+
// path probing (project, monorepo, plugin marketplace, global node_modules
|
|
61
|
+
// including custom-prefix layouts like ~/.npm-global).
|
|
62
|
+
function resolveCliBin() {
|
|
63
|
+
try {
|
|
64
|
+
const home = os.homedir();
|
|
65
|
+
const candidates = [
|
|
66
|
+
path.join(home, '.claude', 'plugins', 'marketplaces', 'ruflo', 'bin', 'cli.js'),
|
|
67
|
+
path.join(CWD, 'node_modules', '@claude-flow', 'cli', 'bin', 'cli.js'),
|
|
68
|
+
path.join(CWD, 'node_modules', 'ruflo', 'bin', 'cli.js'),
|
|
69
|
+
path.join(CWD, 'v3', '@claude-flow', 'cli', 'bin', 'cli.js'),
|
|
70
|
+
];
|
|
71
|
+
try {
|
|
72
|
+
const binDir = path.dirname(process.execPath);
|
|
73
|
+
const globalModuleDirs = [path.join(binDir, '..', 'lib', 'node_modules'), path.join(binDir, 'node_modules')];
|
|
74
|
+
for (const prefix of [process.env.npm_config_prefix, process.env.PREFIX, path.join(home, '.npm-global')]) {
|
|
75
|
+
if (prefix) globalModuleDirs.push(path.join(prefix, 'lib', 'node_modules'));
|
|
76
|
+
}
|
|
77
|
+
for (const gm of globalModuleDirs) {
|
|
78
|
+
candidates.push(
|
|
79
|
+
path.join(gm, 'ruflo', 'bin', 'cli.js'),
|
|
80
|
+
path.join(gm, '@claude-flow', 'cli', 'bin', 'cli.js'),
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
} catch { /* ignore */ }
|
|
84
|
+
for (const p of candidates) {
|
|
85
|
+
if (fs.existsSync(p)) return p;
|
|
86
|
+
}
|
|
87
|
+
} catch { /* ignore */ }
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function readCache() {
|
|
92
|
+
try {
|
|
93
|
+
if (fs.existsSync(CACHE_FILE)) {
|
|
94
|
+
const raw = JSON.parse(fs.readFileSync(CACHE_FILE, 'utf-8'));
|
|
95
|
+
if (raw && raw._ts && (Date.now() - raw._ts) < CACHE_TTL_MS) {
|
|
96
|
+
return raw.data;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
} catch { /* ignore */ }
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function writeCache(data) {
|
|
104
|
+
try { fs.writeFileSync(CACHE_FILE, JSON.stringify({ _ts: Date.now(), data }), 'utf-8'); } catch { /* ignore */ }
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Single source of truth: delegate to the CLI hooks statusline --json command.
|
|
109
|
+
* Falls back to a minimal static object on failure so the statusline still renders.
|
|
110
|
+
*
|
|
111
|
+
* Fix for ruflo#2195: the previous local readers returned 0 for AgentDB patterns
|
|
112
|
+
* (missed the .swarm/memory.db → AgentDB path), computed dddProgress wrong,
|
|
113
|
+
* and only counted ADRs in v3/implementation/adrs/ (missed v3/docs/adr/).
|
|
114
|
+
*/
|
|
115
|
+
function getStatuslineData() {
|
|
116
|
+
const cached = readCache();
|
|
117
|
+
if (cached) return cached;
|
|
118
|
+
|
|
119
|
+
try {
|
|
120
|
+
// #2337: prefer an already-installed CLI bin via direct `node` invocation
|
|
121
|
+
// — no npx, no registry round-trip, no @latest re-resolve per render.
|
|
122
|
+
// Fall back to `npx --prefer-offline @claude-flow/cli` (no @latest) only
|
|
123
|
+
// when nothing is installed locally, so a cold environment still works.
|
|
124
|
+
const cliBin = resolveCliBin();
|
|
125
|
+
const cmd = cliBin
|
|
126
|
+
? '"' + process.execPath + '" "' + cliBin + '" hooks statusline --json 2>/dev/null'
|
|
127
|
+
: 'npx --prefer-offline @claude-flow/cli hooks statusline --json 2>/dev/null';
|
|
128
|
+
const raw = execSync(
|
|
129
|
+
cmd,
|
|
130
|
+
{ encoding: 'utf-8', timeout: 8000, stdio: ['pipe', 'pipe', 'pipe'], cwd: CWD }
|
|
131
|
+
).trim();
|
|
132
|
+
// The CLI may emit preamble lines before the JSON — find the first '{'.
|
|
133
|
+
const jsonStart = raw.indexOf('{');
|
|
134
|
+
if (jsonStart === -1) throw new Error('no JSON in CLI output');
|
|
135
|
+
const data = JSON.parse(raw.slice(jsonStart));
|
|
136
|
+
// Overlay every block the CLI JSON omits (adrs/agentdb/tests/hooks/integration)
|
|
137
|
+
// with real local reads, so those segments reflect actual state instead of 0.
|
|
138
|
+
applyLocalOverlays(data);
|
|
139
|
+
writeCache(data);
|
|
140
|
+
return data;
|
|
141
|
+
} catch { /* CLI unavailable or timed out */ }
|
|
142
|
+
|
|
143
|
+
// Fallback: use local file probes only (will be less accurate, but non-zero
|
|
144
|
+
// when CLI is available and accurate when it's not).
|
|
145
|
+
return buildLocalFallback();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Count ADRs from BOTH known directories (fix for ruflo#2195: old code missed
|
|
149
|
+
// v3/docs/adr/ which holds ADR-088..ADR-137, i.e. 41 of the 128 total ADRs).
|
|
150
|
+
function getLocalADRCount() {
|
|
151
|
+
const adrDirs = [
|
|
152
|
+
path.join(CWD, 'v3', 'implementation', 'adrs'),
|
|
153
|
+
path.join(CWD, 'v3', 'docs', 'adr'),
|
|
154
|
+
path.join(CWD, 'docs', 'adrs'),
|
|
155
|
+
path.join(CWD, '.claude-flow', 'adrs'),
|
|
156
|
+
];
|
|
157
|
+
let total = 0;
|
|
158
|
+
for (const dir of adrDirs) {
|
|
159
|
+
try {
|
|
160
|
+
if (fs.existsSync(dir)) {
|
|
161
|
+
const files = fs.readdirSync(dir).filter(function(f) {
|
|
162
|
+
return f.endsWith('.md') && (f.startsWith('ADR-') || f.startsWith('adr-') || /^\d{4}-/.test(f));
|
|
163
|
+
});
|
|
164
|
+
total += files.length;
|
|
165
|
+
}
|
|
166
|
+
} catch { /* ignore */ }
|
|
167
|
+
}
|
|
168
|
+
return { count: total, implemented: total, compliance: 0 };
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// ─── Local overlays for segments the CLI JSON omits ──────────────
|
|
172
|
+
// 'hooks statusline --json' only returns user/v3Progress/security/swarm/system.
|
|
173
|
+
// agentdb/tests/hooks/integration are never populated, so without these overlays
|
|
174
|
+
// they render as a permanent 0. Each reader is cheap and degrades to zeros.
|
|
175
|
+
|
|
176
|
+
// Real AgentDB stats from the local memory DB. Vectors live in .swarm/memory.db
|
|
177
|
+
// (sql.js + HNSW); ruvector.db is an opaque redb store counted only toward size.
|
|
178
|
+
// One read-only sqlite3 query (mode=ro never takes a write lock the daemon owns).
|
|
179
|
+
function getLocalAgentDB() {
|
|
180
|
+
const result = { vectorCount: 0, dbSizeKB: 0, hasHnsw: false };
|
|
181
|
+
try {
|
|
182
|
+
let bytes = 0;
|
|
183
|
+
for (const f of ['.swarm/memory.db', 'ruvector.db']) {
|
|
184
|
+
try { bytes += fs.statSync(path.join(CWD, f)).size; } catch { /* missing */ }
|
|
185
|
+
}
|
|
186
|
+
result.dbSizeKB = Math.round(bytes / 1024);
|
|
187
|
+
|
|
188
|
+
const memDb = path.join(CWD, '.swarm', 'memory.db');
|
|
189
|
+
if (fs.existsSync(memDb)) {
|
|
190
|
+
const Q = String.fromCharCode(34);
|
|
191
|
+
const sql = Q + 'SELECT (SELECT COUNT(*) FROM memory_entries WHERE embedding IS NOT NULL)||' + "'|'" + '||(SELECT COUNT(*) FROM vector_indexes);' + Q;
|
|
192
|
+
const out = safeExec("sqlite3 'file:" + memDb + "?mode=ro' " + sql, 1500);
|
|
193
|
+
if (out && out.indexOf('|') !== -1) {
|
|
194
|
+
const parts = out.split('|');
|
|
195
|
+
result.vectorCount = parseInt(parts[0], 10) || 0;
|
|
196
|
+
result.hasHnsw = (parseInt(parts[1], 10) || 0) > 0;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
} catch { /* ignore */ }
|
|
200
|
+
return result;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Count test files via a bounded directory walk (no file reads).
|
|
204
|
+
function getLocalTests() {
|
|
205
|
+
let testFiles = 0;
|
|
206
|
+
function countTests(dir, depth) {
|
|
207
|
+
if ((depth || 0) > 4) return;
|
|
208
|
+
try {
|
|
209
|
+
if (!fs.existsSync(dir)) return;
|
|
210
|
+
for (const e of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
211
|
+
if (e.isDirectory() && !e.name.startsWith('.') && e.name !== 'node_modules') {
|
|
212
|
+
countTests(path.join(dir, e.name), (depth || 0) + 1);
|
|
213
|
+
} else if (e.isFile() && (e.name.includes('.test.') || e.name.includes('.spec.') || e.name.startsWith('test_') || e.name.startsWith('spec_'))) {
|
|
214
|
+
testFiles++;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
} catch { /* ignore */ }
|
|
218
|
+
}
|
|
219
|
+
for (const d of ['tests', 'test', '__tests__', 'src', 'v3']) countTests(path.join(CWD, d));
|
|
220
|
+
return { testFiles, testCases: testFiles * 4 };
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Count configured hooks from project .claude/settings.json. Claude Code hooks
|
|
224
|
+
// have no enabled/disabled flag, so every configured hook counts as enabled.
|
|
225
|
+
function getLocalHooks() {
|
|
226
|
+
const result = { enabled: 0, total: 0 };
|
|
227
|
+
try {
|
|
228
|
+
const settings = readJSON(path.join(CWD, '.claude', 'settings.json'));
|
|
229
|
+
const hooks = settings && settings.hooks;
|
|
230
|
+
if (hooks && typeof hooks === 'object') {
|
|
231
|
+
let n = 0;
|
|
232
|
+
for (const ev of Object.keys(hooks)) {
|
|
233
|
+
const groups = hooks[ev];
|
|
234
|
+
if (Array.isArray(groups)) {
|
|
235
|
+
for (const g of groups) {
|
|
236
|
+
if (g && Array.isArray(g.hooks)) n += g.hooks.length;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
result.total = n;
|
|
241
|
+
result.enabled = n;
|
|
242
|
+
}
|
|
243
|
+
} catch { /* ignore */ }
|
|
244
|
+
return result;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Best-effort integration block: DB presence + locally-configured stdio MCP
|
|
248
|
+
// servers (project .mcp.json + global ~/.claude.json). Remote connectors are
|
|
249
|
+
// account-managed and not present in local config, so they are not counted.
|
|
250
|
+
function getLocalIntegration() {
|
|
251
|
+
const integration = { mcpServers: { enabled: 0, total: 0 }, hasDatabase: false };
|
|
252
|
+
try {
|
|
253
|
+
for (const f of ['.swarm/memory.db', 'ruvector.db']) {
|
|
254
|
+
if (fs.existsSync(path.join(CWD, f))) { integration.hasDatabase = true; break; }
|
|
255
|
+
}
|
|
256
|
+
const names = new Set();
|
|
257
|
+
const projMcp = readJSON(path.join(CWD, '.mcp.json'));
|
|
258
|
+
if (projMcp && projMcp.mcpServers) for (const k of Object.keys(projMcp.mcpServers)) names.add(k);
|
|
259
|
+
const claudeJson = readJSON(path.join(os.homedir(), '.claude.json'));
|
|
260
|
+
if (claudeJson) {
|
|
261
|
+
if (claudeJson.mcpServers) for (const k of Object.keys(claudeJson.mcpServers)) names.add(k);
|
|
262
|
+
const proj = claudeJson.projects && claudeJson.projects[CWD];
|
|
263
|
+
if (proj && proj.mcpServers && !Array.isArray(proj.mcpServers)) {
|
|
264
|
+
for (const k of Object.keys(proj.mcpServers)) names.add(k);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
integration.mcpServers.total = names.size;
|
|
268
|
+
integration.mcpServers.enabled = names.size;
|
|
269
|
+
} catch { /* ignore */ }
|
|
270
|
+
return integration;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// Overlay every locally-derived block onto the CLI data (mutates in place).
|
|
274
|
+
function applyLocalOverlays(data) {
|
|
275
|
+
data.adrs = getLocalADRCount();
|
|
276
|
+
data.agentdb = getLocalAgentDB();
|
|
277
|
+
data.tests = getLocalTests();
|
|
278
|
+
data.hooks = getLocalHooks();
|
|
279
|
+
data.integration = getLocalIntegration();
|
|
280
|
+
return data;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// Minimal local fallback when the CLI is not installed or times out.
|
|
284
|
+
// Returns a structure that matches the CLI JSON schema so the renderer works.
|
|
285
|
+
function buildLocalFallback() {
|
|
286
|
+
const memMB = Math.floor(process.memoryUsage().heapUsed / 1024 / 1024);
|
|
287
|
+
|
|
288
|
+
return applyLocalOverlays({
|
|
289
|
+
user: { name: 'user', gitBranch: '', modelName: 'Claude Code' },
|
|
290
|
+
v3Progress: { domainsCompleted: 0, totalDomains: 5, dddProgress: 0, patternsLearned: 0, sessionsCompleted: 0 },
|
|
291
|
+
security: { status: 'NONE', cvesFixed: 0, totalCves: 0 },
|
|
292
|
+
swarm: { activeAgents: 0, maxAgents: CONFIG.maxAgents, coordinationActive: false },
|
|
293
|
+
system: { memoryMB: memMB, contextPct: 0, intelligencePct: 0, subAgents: 0 },
|
|
294
|
+
lastUpdated: new Date().toISOString(),
|
|
295
|
+
});
|
|
296
|
+
}
|
|
46
297
|
|
|
47
298
|
// ANSI colors
|
|
48
299
|
const c = {
|
|
@@ -64,514 +315,379 @@ const c = {
|
|
|
64
315
|
brightWhite: '\x1b[1;37m',
|
|
65
316
|
};
|
|
66
317
|
|
|
67
|
-
//
|
|
68
|
-
function
|
|
69
|
-
let name = 'user';
|
|
70
|
-
let gitBranch = '';
|
|
71
|
-
let modelName = 'Unknown';
|
|
72
|
-
|
|
318
|
+
// Safe execSync with strict timeout (returns empty string on failure)
|
|
319
|
+
function safeExec(cmd, timeoutMs) {
|
|
73
320
|
try {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
gitBranch = execSync(gitBranchCmd, { encoding: 'utf-8' }).trim();
|
|
82
|
-
if (gitBranch === '.') gitBranch = ''; // Windows echo. outputs a dot
|
|
83
|
-
} catch (e) {
|
|
84
|
-
// Ignore errors
|
|
321
|
+
return execSync(cmd, {
|
|
322
|
+
encoding: 'utf-8',
|
|
323
|
+
timeout: timeoutMs || 2000,
|
|
324
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
325
|
+
}).trim();
|
|
326
|
+
} catch {
|
|
327
|
+
return '';
|
|
85
328
|
}
|
|
329
|
+
}
|
|
86
330
|
|
|
87
|
-
|
|
331
|
+
// Safe JSON file reader (returns null on failure)
|
|
332
|
+
function readJSON(filePath) {
|
|
88
333
|
try {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (fs.existsSync(claudeConfigPath)) {
|
|
92
|
-
const claudeConfig = JSON.parse(fs.readFileSync(claudeConfigPath, 'utf-8'));
|
|
93
|
-
// Try to find lastModelUsage - check current dir and parent dirs
|
|
94
|
-
let lastModelUsage = null;
|
|
95
|
-
const cwd = process.cwd();
|
|
96
|
-
if (claudeConfig.projects) {
|
|
97
|
-
// Try exact match first, then check if cwd starts with any project path
|
|
98
|
-
for (const [projectPath, projectConfig] of Object.entries(claudeConfig.projects)) {
|
|
99
|
-
if (cwd === projectPath || cwd.startsWith(projectPath + '/')) {
|
|
100
|
-
lastModelUsage = projectConfig.lastModelUsage;
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
if (lastModelUsage) {
|
|
106
|
-
const modelIds = Object.keys(lastModelUsage);
|
|
107
|
-
if (modelIds.length > 0) {
|
|
108
|
-
// Take the last model (most recently added to the object)
|
|
109
|
-
// Or find the one with most tokens (most actively used this session)
|
|
110
|
-
let modelId = modelIds[modelIds.length - 1];
|
|
111
|
-
if (modelIds.length > 1) {
|
|
112
|
-
// If multiple models, pick the one with most total tokens
|
|
113
|
-
let maxTokens = 0;
|
|
114
|
-
for (const id of modelIds) {
|
|
115
|
-
const usage = lastModelUsage[id];
|
|
116
|
-
const total = (usage.inputTokens || 0) + (usage.outputTokens || 0);
|
|
117
|
-
if (total > maxTokens) {
|
|
118
|
-
maxTokens = total;
|
|
119
|
-
modelId = id;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
// Parse model ID to human-readable name
|
|
124
|
-
if (modelId.includes('opus')) modelName = 'Opus 4.5';
|
|
125
|
-
else if (modelId.includes('sonnet')) modelName = 'Sonnet 4';
|
|
126
|
-
else if (modelId.includes('haiku')) modelName = 'Haiku 4.5';
|
|
127
|
-
else modelName = modelId.split('-').slice(1, 3).join(' ');
|
|
128
|
-
}
|
|
129
|
-
}
|
|
334
|
+
if (fs.existsSync(filePath)) {
|
|
335
|
+
return JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
|
130
336
|
}
|
|
131
|
-
} catch
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return { name, gitBranch, modelName };
|
|
337
|
+
} catch { /* ignore */ }
|
|
338
|
+
return null;
|
|
136
339
|
}
|
|
137
340
|
|
|
138
|
-
//
|
|
139
|
-
function getLearningStats() {
|
|
140
|
-
let patterns = 0;
|
|
141
|
-
let sessions = 0;
|
|
142
|
-
let trajectories = 0;
|
|
143
|
-
let edges = 0;
|
|
144
|
-
let confidenceMean = 0;
|
|
145
|
-
let accessedCount = 0;
|
|
146
|
-
let trend = 'STABLE';
|
|
147
|
-
|
|
148
|
-
// PRIMARY: Read from intelligence loop data files
|
|
149
|
-
const dataDir = path.join(process.cwd(), '.claude-flow', 'data');
|
|
150
|
-
|
|
151
|
-
// 1. graph-state.json — authoritative node/edge counts
|
|
152
|
-
const graphPath = path.join(dataDir, 'graph-state.json');
|
|
153
|
-
if (fs.existsSync(graphPath)) {
|
|
154
|
-
try {
|
|
155
|
-
const graph = JSON.parse(fs.readFileSync(graphPath, 'utf-8'));
|
|
156
|
-
patterns = graph.nodes ? Object.keys(graph.nodes).length : 0;
|
|
157
|
-
edges = Array.isArray(graph.edges) ? graph.edges.length : 0;
|
|
158
|
-
} catch (e) { /* ignore */ }
|
|
159
|
-
}
|
|
341
|
+
// ─── Git info (pure-Node / single exec — needed for branch display) ──────────
|
|
160
342
|
|
|
161
|
-
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
if (ranked.entries && ranked.entries.length > 0) {
|
|
167
|
-
patterns = Math.max(patterns, ranked.entries.length);
|
|
168
|
-
let confSum = 0;
|
|
169
|
-
let accCount = 0;
|
|
170
|
-
for (let i = 0; i < ranked.entries.length; i++) {
|
|
171
|
-
confSum += (ranked.entries[i].confidence || 0);
|
|
172
|
-
if ((ranked.entries[i].accessCount || 0) > 0) accCount++;
|
|
173
|
-
}
|
|
174
|
-
confidenceMean = confSum / ranked.entries.length;
|
|
175
|
-
accessedCount = accCount;
|
|
176
|
-
}
|
|
177
|
-
} catch (e) { /* ignore */ }
|
|
178
|
-
}
|
|
343
|
+
function getGitInfo() {
|
|
344
|
+
const result = {
|
|
345
|
+
name: 'user', gitBranch: '', modified: 0, untracked: 0,
|
|
346
|
+
staged: 0, ahead: 0, behind: 0,
|
|
347
|
+
};
|
|
179
348
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
349
|
+
const script = [
|
|
350
|
+
'git config user.name 2>/dev/null || echo user',
|
|
351
|
+
'echo "---SEP---"',
|
|
352
|
+
'git branch --show-current 2>/dev/null',
|
|
353
|
+
'echo "---SEP---"',
|
|
354
|
+
'git status --porcelain 2>/dev/null',
|
|
355
|
+
'echo "---SEP---"',
|
|
356
|
+
'git rev-list --left-right --count HEAD...@{upstream} 2>/dev/null || echo "0 0"',
|
|
357
|
+
].join('; ');
|
|
358
|
+
|
|
359
|
+
const raw = safeExec("sh -c '" + script + "'", 3000);
|
|
360
|
+
if (!raw) return result;
|
|
361
|
+
|
|
362
|
+
const parts = raw.split('---SEP---').map(function(s) { return s.trim(); });
|
|
363
|
+
if (parts.length >= 4) {
|
|
364
|
+
result.name = parts[0] || 'user';
|
|
365
|
+
result.gitBranch = parts[1] || '';
|
|
366
|
+
|
|
367
|
+
if (parts[2]) {
|
|
368
|
+
for (const line of parts[2].split('\n')) {
|
|
369
|
+
if (!line || line.length < 2) continue;
|
|
370
|
+
const x = line[0], y = line[1];
|
|
371
|
+
if (x === '?' && y === '?') { result.untracked++; continue; }
|
|
372
|
+
if (x !== ' ' && x !== '?') result.staged++;
|
|
373
|
+
if (y !== ' ' && y !== '?') result.modified++;
|
|
191
374
|
}
|
|
192
|
-
} catch (e) { /* ignore */ }
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
// 4. auto-memory-store.json — fallback entry count
|
|
196
|
-
if (patterns === 0) {
|
|
197
|
-
const autoMemPath = path.join(dataDir, 'auto-memory-store.json');
|
|
198
|
-
if (fs.existsSync(autoMemPath)) {
|
|
199
|
-
try {
|
|
200
|
-
const data = JSON.parse(fs.readFileSync(autoMemPath, 'utf-8'));
|
|
201
|
-
patterns = Array.isArray(data) ? data.length : (data.entries ? data.entries.length : 0);
|
|
202
|
-
} catch (e) { /* ignore */ }
|
|
203
375
|
}
|
|
376
|
+
|
|
377
|
+
const ab = (parts[3] || '0 0').split(/\s+/);
|
|
378
|
+
result.ahead = parseInt(ab[0]) || 0;
|
|
379
|
+
result.behind = parseInt(ab[1]) || 0;
|
|
204
380
|
}
|
|
205
381
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
const
|
|
217
|
-
|
|
382
|
+
return result;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
// Detect model name from Claude config (pure file reads, no exec)
|
|
386
|
+
function getModelName() {
|
|
387
|
+
try {
|
|
388
|
+
const claudeConfig = readJSON(path.join(os.homedir(), '.claude.json'));
|
|
389
|
+
if (claudeConfig && claudeConfig.projects) {
|
|
390
|
+
for (const [projectPath, projectConfig] of Object.entries(claudeConfig.projects)) {
|
|
391
|
+
if (CWD === projectPath || CWD.startsWith(projectPath + '/')) {
|
|
392
|
+
const usage = projectConfig.lastModelUsage;
|
|
393
|
+
if (usage) {
|
|
394
|
+
const ids = Object.keys(usage);
|
|
395
|
+
if (ids.length > 0) {
|
|
396
|
+
let modelId = ids[ids.length - 1];
|
|
397
|
+
let latest = 0;
|
|
398
|
+
for (const id of ids) {
|
|
399
|
+
const ts = usage[id] && usage[id].lastUsedAt ? new Date(usage[id].lastUsedAt).getTime() : 0;
|
|
400
|
+
if (ts > latest) { latest = ts; modelId = id; }
|
|
401
|
+
}
|
|
402
|
+
if (modelId.includes('opus')) return 'Opus 4.8';
|
|
403
|
+
if (modelId.includes('sonnet')) return 'Sonnet 4.6';
|
|
404
|
+
if (modelId.includes('haiku')) return 'Haiku 4.5';
|
|
405
|
+
return modelId.split('-').slice(1, 3).join(' ');
|
|
406
|
+
}
|
|
407
|
+
}
|
|
218
408
|
break;
|
|
219
|
-
}
|
|
409
|
+
}
|
|
220
410
|
}
|
|
221
411
|
}
|
|
412
|
+
} catch { /* ignore */ }
|
|
413
|
+
|
|
414
|
+
// Fallback: settings.json model field
|
|
415
|
+
const settings = getSettings();
|
|
416
|
+
if (settings && settings.model) {
|
|
417
|
+
const m = settings.model;
|
|
418
|
+
if (m.includes('opus')) return 'Opus 4.8';
|
|
419
|
+
if (m.includes('sonnet')) return 'Sonnet 4.6';
|
|
420
|
+
if (m.includes('haiku')) return 'Haiku 4.5';
|
|
222
421
|
}
|
|
422
|
+
return 'Claude Code';
|
|
423
|
+
}
|
|
223
424
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
425
|
+
// ─── Stdin reader (Claude Code pipes session JSON) ──────────────
|
|
426
|
+
// Claude Code sends session JSON via stdin. Read synchronously so the
|
|
427
|
+
// script works both when invoked by Claude Code (stdin has JSON) and
|
|
428
|
+
// when run manually from terminal (stdin is empty/tty).
|
|
429
|
+
let _stdinData = null;
|
|
430
|
+
function getStdinData() {
|
|
431
|
+
if (_stdinData !== undefined && _stdinData !== null) return _stdinData;
|
|
432
|
+
try {
|
|
433
|
+
if (process.stdin.isTTY) { _stdinData = null; return null; }
|
|
434
|
+
const chunks = [];
|
|
435
|
+
const buf = Buffer.alloc(4096);
|
|
436
|
+
let bytesRead;
|
|
227
437
|
try {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
438
|
+
while ((bytesRead = fs.readSync(0, buf, 0, buf.length, null)) > 0) {
|
|
439
|
+
chunks.push(buf.slice(0, bytesRead));
|
|
440
|
+
}
|
|
441
|
+
} catch { /* EOF or read error */ }
|
|
442
|
+
const raw = Buffer.concat(chunks).toString('utf-8').trim();
|
|
443
|
+
_stdinData = (raw && raw.startsWith('{')) ? JSON.parse(raw) : null;
|
|
444
|
+
} catch {
|
|
445
|
+
_stdinData = null;
|
|
231
446
|
}
|
|
232
|
-
|
|
233
|
-
trajectories = Math.floor(patterns / 5);
|
|
234
|
-
|
|
235
|
-
return { patterns, sessions, trajectories, edges, confidenceMean, accessedCount, trend };
|
|
447
|
+
return _stdinData;
|
|
236
448
|
}
|
|
237
449
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
// DDD progress based on actual learned patterns
|
|
243
|
-
// New install: 0 patterns = 0/5 domains, 0% DDD
|
|
244
|
-
// As patterns grow: 10+ patterns = 1 domain, 50+ = 2, 100+ = 3, 200+ = 4, 500+ = 5
|
|
245
|
-
let domainsCompleted = 0;
|
|
246
|
-
if (learning.patterns >= 500) domainsCompleted = 5;
|
|
247
|
-
else if (learning.patterns >= 200) domainsCompleted = 4;
|
|
248
|
-
else if (learning.patterns >= 100) domainsCompleted = 3;
|
|
249
|
-
else if (learning.patterns >= 50) domainsCompleted = 2;
|
|
250
|
-
else if (learning.patterns >= 10) domainsCompleted = 1;
|
|
251
|
-
|
|
252
|
-
const totalDomains = 5;
|
|
253
|
-
const dddProgress = Math.min(100, Math.floor((domainsCompleted / totalDomains) * 100));
|
|
254
|
-
|
|
255
|
-
return {
|
|
256
|
-
domainsCompleted,
|
|
257
|
-
totalDomains,
|
|
258
|
-
dddProgress,
|
|
259
|
-
patternsLearned: learning.patterns,
|
|
260
|
-
sessionsCompleted: learning.sessions
|
|
261
|
-
};
|
|
450
|
+
function getModelFromStdin() {
|
|
451
|
+
const data = getStdinData();
|
|
452
|
+
return (data && data.model && data.model.display_name) ? data.model.display_name : null;
|
|
262
453
|
}
|
|
263
454
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
let cvesFixed = 0;
|
|
269
|
-
const totalCves = 3;
|
|
270
|
-
|
|
271
|
-
if (fs.existsSync(scanResultsPath)) {
|
|
272
|
-
try {
|
|
273
|
-
const scans = fs.readdirSync(scanResultsPath).filter(f => f.endsWith('.json'));
|
|
274
|
-
// Each successful scan file = 1 CVE addressed
|
|
275
|
-
cvesFixed = Math.min(totalCves, scans.length);
|
|
276
|
-
} catch (e) {
|
|
277
|
-
// Ignore
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
// Also check .swarm/security for audit results
|
|
282
|
-
const auditPath = path.join(process.cwd(), '.swarm', 'security');
|
|
283
|
-
if (fs.existsSync(auditPath)) {
|
|
284
|
-
try {
|
|
285
|
-
const audits = fs.readdirSync(auditPath).filter(f => f.includes('audit'));
|
|
286
|
-
cvesFixed = Math.min(totalCves, Math.max(cvesFixed, audits.length));
|
|
287
|
-
} catch (e) {
|
|
288
|
-
// Ignore
|
|
289
|
-
}
|
|
455
|
+
function getContextFromStdin() {
|
|
456
|
+
const data = getStdinData();
|
|
457
|
+
if (data && data.context_window) {
|
|
458
|
+
return { usedPct: Math.floor(data.context_window.used_percentage || 0) };
|
|
290
459
|
}
|
|
291
|
-
|
|
292
|
-
const status = cvesFixed >= totalCves ? 'CLEAN' : cvesFixed > 0 ? 'IN_PROGRESS' : 'PENDING';
|
|
293
|
-
|
|
294
|
-
return {
|
|
295
|
-
status,
|
|
296
|
-
cvesFixed,
|
|
297
|
-
totalCves,
|
|
298
|
-
};
|
|
460
|
+
return null;
|
|
299
461
|
}
|
|
300
462
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
} else {
|
|
312
|
-
const ps = execSync('ps aux 2>/dev/null | grep -c agentic-flow || echo "0"', { encoding: 'utf-8' });
|
|
313
|
-
activeAgents = Math.max(0, parseInt(ps.trim()) - 1);
|
|
314
|
-
}
|
|
315
|
-
coordinationActive = activeAgents > 0;
|
|
316
|
-
} catch (e) {
|
|
317
|
-
// Ignore errors - default to 0 agents
|
|
463
|
+
function getCostFromStdin() {
|
|
464
|
+
const data = getStdinData();
|
|
465
|
+
if (data && data.cost) {
|
|
466
|
+
const durationMs = data.cost.total_duration_ms || 0;
|
|
467
|
+
const mins = Math.floor(durationMs / 60000);
|
|
468
|
+
const secs = Math.floor((durationMs % 60000) / 1000);
|
|
469
|
+
return {
|
|
470
|
+
costUsd: data.cost.total_cost_usd || 0,
|
|
471
|
+
duration: mins > 0 ? mins + 'm' + secs + 's' : secs + 's',
|
|
472
|
+
};
|
|
318
473
|
}
|
|
319
|
-
|
|
320
|
-
return {
|
|
321
|
-
activeAgents,
|
|
322
|
-
maxAgents: CONFIG.maxAgents,
|
|
323
|
-
coordinationActive,
|
|
324
|
-
};
|
|
474
|
+
return null;
|
|
325
475
|
}
|
|
326
476
|
|
|
327
|
-
//
|
|
328
|
-
function
|
|
329
|
-
let
|
|
330
|
-
let subAgents = 0;
|
|
331
|
-
|
|
477
|
+
// Read package version from the first package.json we find.
|
|
478
|
+
function getPkgVersion() {
|
|
479
|
+
let ver = '3.6';
|
|
332
480
|
try {
|
|
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
|
-
|
|
367
|
-
// Count active sub-agents from process list
|
|
368
|
-
try {
|
|
369
|
-
if (isWindows) {
|
|
370
|
-
// Windows: use tasklist and findstr for agent counting
|
|
371
|
-
const agents = execSync('tasklist 2>NUL | findstr /I "claude-flow" 2>NUL | find /C /V "" 2>NUL || echo 0', { encoding: 'utf-8' });
|
|
372
|
-
subAgents = Math.max(0, parseInt(agents.trim()) || 0);
|
|
373
|
-
} else {
|
|
374
|
-
const agents = execSync('ps aux 2>/dev/null | grep -c "claude-flow.*agent" || echo "0"', { encoding: 'utf-8' });
|
|
375
|
-
subAgents = Math.max(0, parseInt(agents.trim()) - 1);
|
|
481
|
+
const home = os.homedir();
|
|
482
|
+
const pkgPaths = [
|
|
483
|
+
path.join(home, '.claude', 'plugins', 'marketplaces', 'ruflo', 'package.json'),
|
|
484
|
+
path.join(CWD, 'node_modules', '@claude-flow', 'cli', 'package.json'),
|
|
485
|
+
path.join(CWD, 'node_modules', 'ruflo', 'package.json'),
|
|
486
|
+
path.join(CWD, 'v3', '@claude-flow', 'cli', 'package.json'),
|
|
487
|
+
];
|
|
488
|
+
// #2221: global installs (npm i -g ruflo) live outside CWD/node_modules, so the
|
|
489
|
+
// probes above all miss and the version falls back to the hard-coded default.
|
|
490
|
+
// Derive the global node_modules dir from the running node binary (no npm spawn —
|
|
491
|
+
// statusline renders often). Covers nvm/mise (bin/../lib/node_modules) and Windows
|
|
492
|
+
// (bin/node_modules) layouts.
|
|
493
|
+
try {
|
|
494
|
+
const binDir = path.dirname(process.execPath);
|
|
495
|
+
const globalModuleDirs = [path.join(binDir, '..', 'lib', 'node_modules'), path.join(binDir, 'node_modules')];
|
|
496
|
+
// #2221 follow-up: a custom npm prefix (e.g. ~/.npm-global) is decoupled from
|
|
497
|
+
// the node binary location, so the binDir-derived probes above all miss. Also
|
|
498
|
+
// probe the npm prefix from the environment and the common ~/.npm-global default.
|
|
499
|
+
for (const prefix of [process.env.npm_config_prefix, process.env.PREFIX, path.join(home, '.npm-global')]) {
|
|
500
|
+
if (prefix) globalModuleDirs.push(path.join(prefix, 'lib', 'node_modules'));
|
|
501
|
+
}
|
|
502
|
+
for (const gm of globalModuleDirs) {
|
|
503
|
+
pkgPaths.push(
|
|
504
|
+
path.join(gm, 'ruflo', 'package.json'),
|
|
505
|
+
path.join(gm, '@claude-flow', 'cli', 'package.json'),
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
} catch { /* ignore */ }
|
|
509
|
+
for (const p of pkgPaths) {
|
|
510
|
+
if (!fs.existsSync(p)) continue;
|
|
511
|
+
try {
|
|
512
|
+
const pkg = JSON.parse(fs.readFileSync(p, 'utf-8'));
|
|
513
|
+
if (pkg && typeof pkg.version === 'string' && pkg.version.length > 0) { ver = pkg.version; break; }
|
|
514
|
+
} catch { /* ignore */ }
|
|
376
515
|
}
|
|
377
|
-
} catch
|
|
378
|
-
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
return {
|
|
382
|
-
memoryMB,
|
|
383
|
-
contextPct,
|
|
384
|
-
intelligencePct,
|
|
385
|
-
subAgents,
|
|
386
|
-
};
|
|
516
|
+
} catch { /* ignore */ }
|
|
517
|
+
return ver;
|
|
387
518
|
}
|
|
388
519
|
|
|
389
|
-
//
|
|
520
|
+
// ─── Rendering ──────────────────────────────────────────────────
|
|
521
|
+
|
|
390
522
|
function progressBar(current, total) {
|
|
391
523
|
const width = 5;
|
|
392
524
|
const filled = Math.round((current / total) * width);
|
|
393
|
-
|
|
394
|
-
return '[' + '\u25CF'.repeat(filled) + '\u25CB'.repeat(empty) + ']';
|
|
525
|
+
return '[' + '●'.repeat(filled) + '○'.repeat(width - filled) + ']';
|
|
395
526
|
}
|
|
396
527
|
|
|
397
|
-
// Generate full statusline
|
|
398
528
|
function generateStatusline() {
|
|
399
|
-
const
|
|
400
|
-
const
|
|
401
|
-
const
|
|
402
|
-
const
|
|
403
|
-
const
|
|
529
|
+
const d = getStatuslineData();
|
|
530
|
+
const git = getGitInfo();
|
|
531
|
+
const modelName = getModelFromStdin() || (d.user && d.user.modelName) || 'Claude Code';
|
|
532
|
+
const ctxInfo = getContextFromStdin();
|
|
533
|
+
const costInfo = getCostFromStdin();
|
|
534
|
+
const pkgVersion = getPkgVersion();
|
|
535
|
+
|
|
536
|
+
const progress = d.v3Progress || {};
|
|
537
|
+
const security = d.security || {};
|
|
538
|
+
const swarm = d.swarm || {};
|
|
539
|
+
const system = d.system || {};
|
|
540
|
+
const adrs = d.adrs || {};
|
|
541
|
+
const hooks = d.hooks || {};
|
|
542
|
+
const agentdb = d.agentdb || {};
|
|
543
|
+
const tests = d.tests || {};
|
|
544
|
+
|
|
545
|
+
const domainsCompleted = progress.domainsCompleted || 0;
|
|
546
|
+
const totalDomains = progress.totalDomains || 5;
|
|
547
|
+
const dddProgress = progress.dddProgress || 0;
|
|
548
|
+
const patternsLearned = progress.patternsLearned || 0;
|
|
549
|
+
const activeAgents = swarm.activeAgents || 0;
|
|
550
|
+
const maxAgents = swarm.maxAgents || CONFIG.maxAgents;
|
|
551
|
+
const coordinationActive = swarm.coordinationActive || false;
|
|
552
|
+
const intelligencePct = system.intelligencePct || 0;
|
|
553
|
+
const memoryMB = system.memoryMB || 0;
|
|
554
|
+
const subAgents = system.subAgents || 0;
|
|
555
|
+
const cvesFixed = security.cvesFixed || 0;
|
|
556
|
+
const totalCves = security.totalCves || 0;
|
|
557
|
+
const secStatus = security.status || 'NONE';
|
|
558
|
+
const adrCount = adrs.count || 0;
|
|
559
|
+
const adrImpl = adrs.implemented || 0;
|
|
560
|
+
const hooksEnabled = hooks.enabled || 0;
|
|
561
|
+
const hooksTotal = hooks.total || 0;
|
|
562
|
+
const vectorCount = agentdb.vectorCount || 0;
|
|
563
|
+
const hasHnsw = agentdb.hasHnsw || false;
|
|
564
|
+
const dbSizeKB = agentdb.dbSizeKB || 0;
|
|
565
|
+
const testFiles = tests.testFiles || 0;
|
|
566
|
+
const testCases = tests.testCases || testFiles * 4;
|
|
567
|
+
|
|
404
568
|
const lines = [];
|
|
405
569
|
|
|
406
|
-
// Header
|
|
407
|
-
let header =
|
|
408
|
-
header +=
|
|
409
|
-
if (
|
|
410
|
-
header +=
|
|
570
|
+
// Header
|
|
571
|
+
let header = c.bold + c.brightPurple + '▊ RuFlo V' + pkgVersion + ' ' + c.reset;
|
|
572
|
+
header += (coordinationActive ? c.brightCyan : c.dim) + '● ' + c.brightCyan + git.name + c.reset;
|
|
573
|
+
if (git.gitBranch) {
|
|
574
|
+
header += ' ' + c.dim + '│' + c.reset + ' ' + c.brightBlue + '⏇ ' + git.gitBranch + c.reset;
|
|
575
|
+
const changes = git.modified + git.staged + git.untracked;
|
|
576
|
+
if (changes > 0) {
|
|
577
|
+
let ind = '';
|
|
578
|
+
if (git.staged > 0) ind += c.brightGreen + '+' + git.staged + c.reset;
|
|
579
|
+
if (git.modified > 0) ind += c.brightYellow + '~' + git.modified + c.reset;
|
|
580
|
+
if (git.untracked > 0) ind += c.dim + '?' + git.untracked + c.reset;
|
|
581
|
+
header += ' ' + ind;
|
|
582
|
+
}
|
|
583
|
+
if (git.ahead > 0) header += ' ' + c.brightGreen + '↑' + git.ahead + c.reset;
|
|
584
|
+
if (git.behind > 0) header += ' ' + c.brightRed + '↓' + git.behind + c.reset;
|
|
585
|
+
}
|
|
586
|
+
header += ' ' + c.dim + '│' + c.reset + ' ' + c.purple + modelName + c.reset;
|
|
587
|
+
const duration = costInfo ? costInfo.duration : '';
|
|
588
|
+
if (duration) header += ' ' + c.dim + '│' + c.reset + ' ' + c.cyan + '⏱ ' + duration + c.reset;
|
|
589
|
+
if (ctxInfo && ctxInfo.usedPct > 0) {
|
|
590
|
+
const ctxColor = ctxInfo.usedPct >= 90 ? c.brightRed : ctxInfo.usedPct >= 70 ? c.brightYellow : c.brightGreen;
|
|
591
|
+
header += ' ' + c.dim + '│' + c.reset + ' ' + ctxColor + '● ' + ctxInfo.usedPct + '% ctx' + c.reset;
|
|
592
|
+
}
|
|
593
|
+
if (!CONFIG.hideCost && costInfo && costInfo.costUsd > 0) {
|
|
594
|
+
header += ' ' + c.dim + '│' + c.reset + ' ' + c.brightYellow + CONFIG.costSymbol + costInfo.costUsd.toFixed(2) + c.reset;
|
|
411
595
|
}
|
|
412
|
-
header += ` ${c.dim}│${c.reset} ${c.purple}${user.modelName}${c.reset}`;
|
|
413
596
|
lines.push(header);
|
|
414
597
|
|
|
415
598
|
// Separator
|
|
416
|
-
lines.push(
|
|
417
|
-
|
|
418
|
-
// Line 1: DDD
|
|
419
|
-
const domainsColor =
|
|
599
|
+
lines.push(c.dim + '─'.repeat(53) + c.reset);
|
|
600
|
+
|
|
601
|
+
// Line 1: DDD Domains
|
|
602
|
+
const domainsColor = domainsCompleted >= 3 ? c.brightGreen : domainsCompleted > 0 ? c.yellow : c.red;
|
|
603
|
+
let perfIndicator;
|
|
604
|
+
if (hasHnsw && vectorCount > 0) {
|
|
605
|
+
const speedup = vectorCount > 10000 ? '12500x' : vectorCount > 1000 ? '150x' : '10x';
|
|
606
|
+
perfIndicator = c.brightGreen + '⚡ HNSW ' + speedup + c.reset;
|
|
607
|
+
} else if (patternsLearned > 0) {
|
|
608
|
+
const pk = patternsLearned >= 1000 ? (patternsLearned / 1000).toFixed(1) + 'k' : String(patternsLearned);
|
|
609
|
+
perfIndicator = c.brightYellow + '📚 ' + pk + ' patterns' + c.reset;
|
|
610
|
+
} else {
|
|
611
|
+
perfIndicator = c.dim + '⚡ target: 150x-12500x' + c.reset;
|
|
612
|
+
}
|
|
420
613
|
lines.push(
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
`${c.brightYellow}⚡ 1.0x${c.reset} ${c.dim}→${c.reset} ${c.brightYellow}2.49x-7.47x${c.reset}`
|
|
614
|
+
c.brightCyan + '🏗️ DDD Domains' + c.reset + ' ' + progressBar(domainsCompleted, totalDomains) + ' ' +
|
|
615
|
+
domainsColor + domainsCompleted + c.reset + '/' + c.brightWhite + totalDomains + c.reset + ' ' + perfIndicator
|
|
424
616
|
);
|
|
425
617
|
|
|
426
|
-
// Line 2: Swarm +
|
|
427
|
-
const
|
|
428
|
-
const agentsColor =
|
|
429
|
-
|
|
430
|
-
|
|
618
|
+
// Line 2: Swarm + Hooks + CVE + Memory + Intelligence
|
|
619
|
+
const swarmInd = coordinationActive ? c.brightGreen + '◉' + c.reset : c.dim + '○' + c.reset;
|
|
620
|
+
const agentsColor = activeAgents > 0 ? c.brightGreen : c.red;
|
|
621
|
+
const secIcon = secStatus === 'CLEAN' ? '🟢' : (secStatus === 'IN_PROGRESS' || secStatus === 'STALE') ? '🟡' : (secStatus === 'NONE' ? '⚪' : '🔴');
|
|
622
|
+
const secColor = secStatus === 'CLEAN' ? c.brightGreen : (secStatus === 'IN_PROGRESS' || secStatus === 'STALE') ? c.brightYellow : (secStatus === 'NONE' ? c.dim : c.brightRed);
|
|
623
|
+
const hooksColor = hooksEnabled > 0 ? c.brightGreen : c.dim;
|
|
624
|
+
const intellColor = intelligencePct >= 80 ? c.brightGreen : intelligencePct >= 40 ? c.brightYellow : c.dim;
|
|
431
625
|
|
|
432
626
|
lines.push(
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
627
|
+
c.brightYellow + '🤖 Swarm' + c.reset + ' ' + swarmInd + ' [' + agentsColor + String(activeAgents).padStart(2) + c.reset + '/' + c.brightWhite + maxAgents + c.reset + '] ' +
|
|
628
|
+
c.brightPurple + '👥 ' + subAgents + c.reset + ' ' +
|
|
629
|
+
c.brightBlue + '🪝 ' + hooksColor + hooksEnabled + c.reset + '/' + c.brightWhite + hooksTotal + c.reset + ' ' +
|
|
630
|
+
secIcon + ' ' + secColor + 'CVE ' + cvesFixed + c.reset + '/' + c.brightWhite + totalCves + c.reset + ' ' +
|
|
631
|
+
c.brightCyan + '💾 ' + memoryMB + 'MB' + c.reset + ' ' +
|
|
632
|
+
intellColor + '🧠 ' + String(intelligencePct).padStart(3) + '%' + c.reset
|
|
439
633
|
);
|
|
440
634
|
|
|
441
|
-
// Line 3: Architecture
|
|
442
|
-
const dddColor =
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
`${c.cyan}DDD${c.reset} ${dddColor}●${String(progress.dddProgress).padStart(3)}%${c.reset} ${c.dim}│${c.reset} ` +
|
|
446
|
-
`${c.cyan}Security${c.reset} ${securityColor}●${security.status}${c.reset} ${c.dim}│${c.reset} ` +
|
|
447
|
-
`${c.cyan}Memory${c.reset} ${c.brightGreen}●AgentDB${c.reset} ${c.dim}│${c.reset} ` +
|
|
448
|
-
`${c.cyan}Integration${c.reset} ${swarm.coordinationActive ? c.brightCyan : c.dim}●${c.reset}`
|
|
449
|
-
);
|
|
450
|
-
|
|
451
|
-
return lines.join('\n');
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
// Generate JSON data
|
|
455
|
-
function generateJSON() {
|
|
456
|
-
return {
|
|
457
|
-
user: getUserInfo(),
|
|
458
|
-
v3Progress: getV3Progress(),
|
|
459
|
-
security: getSecurityStatus(),
|
|
460
|
-
swarm: getSwarmStatus(),
|
|
461
|
-
system: getSystemMetrics(),
|
|
462
|
-
performance: {
|
|
463
|
-
flashAttentionTarget: '2.49x-7.47x',
|
|
464
|
-
searchImprovement: '150x-12,500x',
|
|
465
|
-
memoryReduction: '50-75%',
|
|
466
|
-
},
|
|
467
|
-
lastUpdated: new Date().toISOString(),
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* Generate single-line output for Claude Code compatibility
|
|
473
|
-
* This avoids the collision zone issue entirely by using one line
|
|
474
|
-
* @see https://github.com/ruvnet/claude-flow/issues/985
|
|
475
|
-
*/
|
|
476
|
-
function generateSingleLine() {
|
|
477
|
-
if (!CONFIG.enabled) return '';
|
|
478
|
-
|
|
479
|
-
const user = getUserInfo();
|
|
480
|
-
const progress = getV3Progress();
|
|
481
|
-
const security = getSecurityStatus();
|
|
482
|
-
const swarm = getSwarmStatus();
|
|
483
|
-
const system = getSystemMetrics();
|
|
484
|
-
|
|
485
|
-
const swarmIndicator = swarm.coordinationActive ? '●' : '○';
|
|
486
|
-
const securityStatus = security.status === 'CLEAN' ? '✓' :
|
|
487
|
-
security.cvesFixed > 0 ? '~' : '✗';
|
|
488
|
-
|
|
489
|
-
return `${c.brightPurple}CF-V3${c.reset} ${c.dim}|${c.reset} ` +
|
|
490
|
-
`${c.cyan}D:${progress.domainsCompleted}/${progress.totalDomains}${c.reset} ${c.dim}|${c.reset} ` +
|
|
491
|
-
`${c.yellow}S:${swarmIndicator}${swarm.activeAgents}/${swarm.maxAgents}${c.reset} ${c.dim}|${c.reset} ` +
|
|
492
|
-
`${security.status === 'CLEAN' ? c.green : c.red}CVE:${securityStatus}${security.cvesFixed}/${security.totalCves}${c.reset} ${c.dim}|${c.reset} ` +
|
|
493
|
-
`${c.dim}🧠${system.intelligencePct}%${c.reset}`;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
/**
|
|
497
|
-
* Generate safe multi-line statusline that avoids Claude Code collision zone
|
|
498
|
-
* The collision zone is columns 15-25 on the second-to-last line.
|
|
499
|
-
* We pad that line with spaces to push content past column 25.
|
|
500
|
-
* @see https://github.com/ruvnet/claude-flow/issues/985
|
|
501
|
-
*/
|
|
502
|
-
function generateSafeStatusline() {
|
|
503
|
-
if (!CONFIG.enabled) return '';
|
|
504
|
-
|
|
505
|
-
const user = getUserInfo();
|
|
506
|
-
const progress = getV3Progress();
|
|
507
|
-
const security = getSecurityStatus();
|
|
508
|
-
const swarm = getSwarmStatus();
|
|
509
|
-
const system = getSystemMetrics();
|
|
510
|
-
const lines = [];
|
|
511
|
-
|
|
512
|
-
// Header Line
|
|
513
|
-
let header = `${c.bold}${c.brightPurple}▊ Claude Flow V3 ${c.reset}`;
|
|
514
|
-
header += `${swarm.coordinationActive ? c.brightCyan : c.dim}● ${c.brightCyan}${user.name}${c.reset}`;
|
|
515
|
-
if (user.gitBranch) {
|
|
516
|
-
header += ` ${c.dim}│${c.reset} ${c.brightBlue}⎇ ${user.gitBranch}${c.reset}`;
|
|
517
|
-
}
|
|
518
|
-
header += ` ${c.dim}│${c.reset} ${c.purple}${user.modelName}${c.reset}`;
|
|
519
|
-
lines.push(header);
|
|
520
|
-
|
|
521
|
-
// Separator
|
|
522
|
-
lines.push(`${c.dim}─────────────────────────────────────────────────────${c.reset}`);
|
|
635
|
+
// Line 3: Architecture
|
|
636
|
+
const dddColor = dddProgress >= 50 ? c.brightGreen : dddProgress > 0 ? c.yellow : c.red;
|
|
637
|
+
const adrColor = adrCount > 0 ? (adrImpl === adrCount ? c.brightGreen : c.yellow) : c.dim;
|
|
638
|
+
const adrDisplay = adrColor + '●' + adrImpl + '/' + adrCount + c.reset;
|
|
523
639
|
|
|
524
|
-
// Line 1: DDD Domain Progress
|
|
525
|
-
const domainsColor = progress.domainsCompleted >= 3 ? c.brightGreen : progress.domainsCompleted > 0 ? c.yellow : c.red;
|
|
526
640
|
lines.push(
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
641
|
+
c.brightPurple + '🔧 Architecture' + c.reset + ' ' +
|
|
642
|
+
c.cyan + 'ADRs' + c.reset + ' ' + adrDisplay + ' ' + c.dim + '│' + c.reset + ' ' +
|
|
643
|
+
c.cyan + 'DDD' + c.reset + ' ' + dddColor + '●' + String(dddProgress).padStart(3) + '%' + c.reset + ' ' + c.dim + '│' + c.reset + ' ' +
|
|
644
|
+
c.cyan + 'Security' + c.reset + ' ' + secColor + '●' + secStatus + c.reset
|
|
530
645
|
);
|
|
531
646
|
|
|
532
|
-
// Line
|
|
533
|
-
|
|
534
|
-
const
|
|
535
|
-
const
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
);
|
|
647
|
+
// Line 4: AgentDB, Tests, Integration
|
|
648
|
+
const hnswInd = hasHnsw ? c.brightGreen + '⚡' + c.reset : '';
|
|
649
|
+
const sizeDisp = dbSizeKB >= 1024 ? (dbSizeKB / 1024).toFixed(1) + 'MB' : dbSizeKB + 'KB';
|
|
650
|
+
const vectorColor = vectorCount > 0 ? c.brightGreen : c.dim;
|
|
651
|
+
const testColor = testFiles > 0 ? c.brightGreen : c.dim;
|
|
652
|
+
|
|
653
|
+
// MCP / DB integration from data
|
|
654
|
+
const integration = d.integration || {};
|
|
655
|
+
const mcpServers = (integration.mcpServers) || {};
|
|
656
|
+
let integStr = '';
|
|
657
|
+
if (mcpServers.total > 0) {
|
|
658
|
+
const mcpCol = mcpServers.enabled === mcpServers.total ? c.brightGreen : mcpServers.enabled > 0 ? c.brightYellow : c.red;
|
|
659
|
+
integStr += c.cyan + 'MCP' + c.reset + ' ' + mcpCol + '●' + mcpServers.enabled + '/' + mcpServers.total + c.reset;
|
|
660
|
+
}
|
|
661
|
+
if (integration.hasDatabase) integStr += (integStr ? ' ' : '') + c.brightGreen + '◆' + c.reset + 'DB';
|
|
662
|
+
if (!integStr) integStr = c.dim + '● none' + c.reset;
|
|
548
663
|
|
|
549
|
-
// Line 3: Architecture status (this is the last line, not in collision zone)
|
|
550
|
-
const dddColor = progress.dddProgress >= 50 ? c.brightGreen : progress.dddProgress > 0 ? c.yellow : c.red;
|
|
551
664
|
lines.push(
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
665
|
+
c.brightCyan + '📊 AgentDB' + c.reset + ' ' +
|
|
666
|
+
c.cyan + 'Vectors' + c.reset + ' ' + vectorColor + '●' + vectorCount + hnswInd + c.reset + ' ' + c.dim + '│' + c.reset + ' ' +
|
|
667
|
+
c.cyan + 'Size' + c.reset + ' ' + c.brightWhite + sizeDisp + c.reset + ' ' + c.dim + '│' + c.reset + ' ' +
|
|
668
|
+
c.cyan + 'Tests' + c.reset + ' ' + testColor + '●' + testFiles + c.reset + ' ' + c.dim + '(~' + testCases + ' cases)' + c.reset + ' ' + c.dim + '│' + c.reset + ' ' +
|
|
669
|
+
integStr
|
|
557
670
|
);
|
|
558
671
|
|
|
559
672
|
return lines.join('\n');
|
|
560
673
|
}
|
|
561
674
|
|
|
562
|
-
//
|
|
675
|
+
// JSON output — delegates to CLI for accuracy; caller can use --json flag
|
|
676
|
+
function generateJSON() {
|
|
677
|
+
const d = getStatuslineData();
|
|
678
|
+
const git = getGitInfo();
|
|
679
|
+
return Object.assign({}, d, {
|
|
680
|
+
user: Object.assign({ name: git.name, gitBranch: git.gitBranch }, d.user || {}),
|
|
681
|
+
git: { modified: git.modified, untracked: git.untracked, staged: git.staged, ahead: git.ahead, behind: git.behind },
|
|
682
|
+
lastUpdated: new Date().toISOString(),
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
// ─── Main ───────────────────────────────────────────────────────
|
|
563
687
|
if (process.argv.includes('--json')) {
|
|
564
688
|
console.log(JSON.stringify(generateJSON(), null, 2));
|
|
565
689
|
} else if (process.argv.includes('--compact')) {
|
|
566
690
|
console.log(JSON.stringify(generateJSON()));
|
|
567
|
-
} else if (process.argv.includes('--single')) {
|
|
568
|
-
// Single-line mode - completely avoids collision zone
|
|
569
|
-
console.log(generateSingleLine());
|
|
570
|
-
} else if (process.argv.includes('--unsafe') || process.argv.includes('--legacy')) {
|
|
571
|
-
// Legacy mode - original multi-line without collision avoidance
|
|
572
|
-
console.log(generateStatusline());
|
|
573
691
|
} else {
|
|
574
|
-
|
|
575
|
-
// Use --unsafe or --legacy to get the original behavior
|
|
576
|
-
console.log(generateSafeStatusline());
|
|
692
|
+
console.log(generateStatusline());
|
|
577
693
|
}
|