agentic-qe 3.11.0 → 3.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.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/qe-code-intelligence/SKILL.md +3 -0
- 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 +84 -0
- package/README.md +1 -0
- package/assets/skills/pair-programming/SKILL.md +2 -2
- package/assets/skills/qe-code-intelligence/SKILL.md +3 -0
- 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-LDNYC4GH.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-5CSKQB4O.js → agent-booster-wasm-FNCVODUJ.js} +2 -2
- package/dist/cli/chunks/{agent-handler-EBV3OKTE.js → agent-handler-JK7VK37B.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-RZ53YM2U.js → agent-memory-branch-EPVVJNNA.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-CA4CT5Q7.js +2 -0
- package/dist/cli/chunks/{arena-UCP74DRO.js → arena-EH2IMSRW.js} +4 -4
- package/dist/cli/chunks/{arena-QWYTIQ6I.js → arena-NTHVDZTJ.js} +2 -2
- package/dist/cli/chunks/{audit-M4FNIX47.js → audit-ODZV2T2B.js} +2 -2
- package/dist/cli/chunks/base-TSDAEMT4.js +2 -0
- package/dist/cli/chunks/{hnswlib-node-HMZC5TXM.js → better-sqlite3-5JTP47LA.js} +2 -2
- package/dist/cli/chunks/{brain-handler-OY6Q2GY5.js → brain-handler-NVB6OJ25.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-TQWN4NIX.js → branch-enumerator-BIXSELMY.js} +2 -2
- package/dist/cli/chunks/{browser-2EH3RXJ2.js → browser-S2Y2W33Z.js} +2 -2
- package/dist/cli/chunks/browser-workflow-3HCTJBLR.js +2 -0
- package/dist/cli/chunks/{chunk-V6WJVFRN.js → chunk-26ZMIYSK.js} +2 -2
- package/dist/cli/chunks/{chunk-I2HQLBWG.js → chunk-27KNLVOY.js} +2 -2
- package/dist/cli/chunks/{chunk-HNSZDIQU.js → chunk-2Q65LTJN.js} +2 -2
- package/dist/cli/chunks/{chunk-SKL225P5.js → chunk-3ATEYGVD.js} +2 -2
- package/dist/cli/chunks/{chunk-LTH6XARD.js → chunk-3J3QXLWP.js} +2 -2
- package/dist/cli/chunks/{chunk-NQD4CMXC.js → chunk-3KTOM7NN.js} +2 -2
- package/dist/cli/chunks/{chunk-QCJ7YOVN.js → chunk-3NCVUFAL.js} +2 -2
- package/dist/cli/chunks/{chunk-ZEUUVLS2.js → chunk-42DCMEUM.js} +1 -1
- package/dist/cli/chunks/{chunk-2QU6C3OS.js → chunk-4FTVTAMN.js} +2 -2
- package/dist/cli/chunks/{chunk-QYXTESM3.js → chunk-4PYJCIRO.js} +2 -2
- package/dist/cli/chunks/{chunk-LFT7WYHW.js → chunk-527U4AHC.js} +2 -2
- package/dist/cli/chunks/{chunk-VHON5NDM.js → chunk-5AFO7ZZG.js} +3 -3
- package/dist/cli/chunks/{chunk-F62ZQZQQ.js → chunk-5BDVFFYF.js} +2 -2
- package/dist/cli/chunks/{chunk-KBVXKFDI.js → chunk-5KMGG3QW.js} +4 -4
- package/dist/cli/chunks/{chunk-AVKGDS6F.js → chunk-6LQIVIZB.js} +2 -2
- package/dist/cli/chunks/{chunk-RKDNLPZM.js → chunk-6SOGYNJG.js} +2 -2
- package/dist/cli/chunks/{chunk-RPYYS6BX.js → chunk-6VAFRS5N.js} +2 -2
- package/dist/cli/chunks/chunk-72VVTMEL.js +2 -0
- package/dist/cli/chunks/{chunk-AURDGQNB.js → chunk-75C5GX7D.js} +2 -2
- package/dist/cli/chunks/{chunk-JN3IQB4L.js → chunk-76RO2RHG.js} +1 -1
- package/dist/cli/chunks/{chunk-7E5NYLJT.js → chunk-7HYO76F2.js} +2 -2
- package/dist/cli/chunks/{chunk-R3YO3Z7I.js → chunk-7KHZZVF2.js} +4 -4
- package/dist/cli/chunks/{chunk-G5VE3HQW.js → chunk-7MKF52GT.js} +2 -2
- package/dist/cli/chunks/{chunk-TGLEREP5.js → chunk-7VM4ZUHT.js} +2 -2
- package/dist/cli/chunks/{chunk-XW5OXBVV.js → chunk-7XIQR6VU.js} +2 -2
- package/dist/cli/chunks/{chunk-XKRG2U3V.js → chunk-A4ZDKF5F.js} +1 -1
- package/dist/cli/chunks/{chunk-XSG4XKGO.js → chunk-AAVUZVM6.js} +2 -2
- package/dist/cli/chunks/{chunk-XVQUVCFR.js → chunk-AINAWVGD.js} +2 -2
- package/dist/cli/chunks/{chunk-PUTRXS5I.js → chunk-AK5Q2WCJ.js} +2 -2
- package/dist/cli/chunks/{chunk-TYS77XHV.js → chunk-AKZK46TQ.js} +2 -2
- package/dist/cli/chunks/{chunk-JQM64WJ2.js → chunk-ARUXFZDY.js} +1 -1
- package/dist/cli/chunks/{chunk-YR44KQUK.js → chunk-AYXRT2ND.js} +1 -1
- package/dist/cli/chunks/{chunk-ZT4NPTML.js → chunk-AZQ6HDPM.js} +2 -2
- package/dist/cli/chunks/{chunk-DCJIXDO6.js → chunk-BGVEBYV4.js} +2 -2
- package/dist/cli/chunks/{chunk-IHNBZ5XG.js → chunk-C6UTRG66.js} +2 -2
- package/dist/cli/chunks/{chunk-R7FHQQAV.js → chunk-CAUTOCLZ.js} +2 -2
- package/dist/cli/chunks/{chunk-N52ZBTPM.js → chunk-CAVBEZV4.js} +2 -2
- package/dist/cli/chunks/{chunk-3LP5GPGU.js → chunk-CEMROADY.js} +1 -1
- package/dist/cli/chunks/{chunk-IQSPL2H4.js → chunk-CMVNYVKL.js} +2 -2
- package/dist/cli/chunks/{chunk-7BD7DZCB.js → chunk-CUDGKSFX.js} +2 -2
- package/dist/cli/chunks/{chunk-D3S4SRSA.js → chunk-CZYSCUJ4.js} +2 -2
- package/dist/cli/chunks/{chunk-4OTA6KYJ.js → chunk-DMUQV2YU.js} +2 -2
- package/dist/cli/chunks/{chunk-KZE5UR4T.js → chunk-DPFLJMEI.js} +3 -3
- package/dist/cli/chunks/{chunk-IOQYSR5S.js → chunk-DU4GQKTH.js} +2 -2
- package/dist/cli/chunks/{chunk-FMKALHT3.js → chunk-EDH4H55B.js} +2 -2
- package/dist/cli/chunks/{chunk-NI7O3GKZ.js → chunk-EIWZDVMT.js} +3 -3
- package/dist/cli/chunks/{chunk-5DG6H553.js → chunk-FPZLOVEF.js} +1 -1
- package/dist/cli/chunks/{chunk-DV7662EZ.js → chunk-FV53RMVB.js} +1 -1
- package/dist/cli/chunks/{chunk-BA4WZIAQ.js → chunk-FYY7OJ6Y.js} +2 -2
- package/dist/cli/chunks/{chunk-5ASPEVVF.js → chunk-G4CQBQBV.js} +1 -1
- package/dist/cli/chunks/{chunk-GBFAQ4DW.js → chunk-G6LIQFT2.js} +1 -1
- package/dist/cli/chunks/{chunk-2WVLFT2I.js → chunk-H3LGBH4Y.js} +1 -1
- package/dist/cli/chunks/{chunk-G25YZ7Z6.js → chunk-H4ZPPHOI.js} +2 -2
- package/dist/cli/chunks/{chunk-C33BMWYZ.js → chunk-H5TM4KIB.js} +5 -5
- package/dist/cli/chunks/{chunk-72QNONO6.js → chunk-H6MBRYA7.js} +2 -2
- package/dist/cli/chunks/{chunk-5OJXVVTI.js → chunk-HDBJORV7.js} +2 -2
- package/dist/cli/chunks/{chunk-HJFQVKPI.js → chunk-I3AD523O.js} +1 -1
- package/dist/cli/chunks/{chunk-2BBKA5J4.js → chunk-I7UWFV6N.js} +1 -1
- package/dist/cli/chunks/{chunk-IFTEM672.js → chunk-IMPSB5WW.js} +2 -2
- package/dist/cli/chunks/{chunk-YSTWLDVD.js → chunk-IO7ZUP2G.js} +3 -3
- package/dist/cli/chunks/{chunk-F6Y7DTHR.js → chunk-IQOCTGA2.js} +2 -2
- package/dist/cli/chunks/{chunk-RVQW6CBF.js → chunk-IXYF5BZY.js} +2 -2
- package/dist/cli/chunks/{chunk-3J6LYF6I.js → chunk-JC4Z2ADP.js} +2 -2
- package/dist/cli/chunks/{chunk-T6KT63NC.js → chunk-JCH2FHJ7.js} +2 -2
- package/dist/cli/chunks/{chunk-7PTA7AVW.js → chunk-JDFF2QMZ.js} +1 -1
- package/dist/cli/chunks/{chunk-UEH6C5JA.js → chunk-JELN5XTK.js} +1 -1
- package/dist/cli/chunks/{chunk-Z45QDDZQ.js → chunk-JSZNI3AO.js} +1 -1
- package/dist/cli/chunks/{chunk-ZFP3O5FM.js → chunk-K3YM2Z3E.js} +1 -1
- package/dist/cli/chunks/{chunk-X2TUDGFL.js → chunk-K426HTEQ.js} +44 -44
- package/dist/cli/chunks/{chunk-GGSXHGWD.js → chunk-K6IQBVD7.js} +2 -2
- package/dist/cli/chunks/{chunk-453UDYD2.js → chunk-KEJEZY2R.js} +163 -181
- package/dist/cli/chunks/{chunk-MTSMFEWK.js → chunk-KFE6LB4I.js} +2 -2
- package/dist/cli/chunks/{chunk-DDQWW22L.js → chunk-KO3WB4SU.js} +2 -2
- package/dist/cli/chunks/{chunk-ETGEGMYS.js → chunk-LAY35POY.js} +3 -3
- package/dist/cli/chunks/{chunk-P3NV6KN3.js → chunk-LFXXA325.js} +1 -1
- package/dist/cli/chunks/{chunk-ZK56THZT.js → chunk-LI3T5YNC.js} +3 -3
- package/dist/cli/chunks/{chunk-ACV2WVMX.js → chunk-LIEA5EON.js} +1 -1
- package/dist/cli/chunks/{chunk-KOOY72E3.js → chunk-LRJWKFGY.js} +2 -2
- package/dist/cli/chunks/{chunk-Y7TBCHW4.js → chunk-LY6PTRVL.js} +2 -2
- package/dist/cli/chunks/{chunk-WP6XUSVW.js → chunk-MAXOIEUG.js} +1 -1
- package/dist/cli/chunks/{chunk-X2L4POJE.js → chunk-MN6W7ZNL.js} +1 -1
- package/dist/cli/chunks/{chunk-CERSTEAJ.js → chunk-NGE5YNKC.js} +2 -2
- package/dist/cli/chunks/{chunk-J425SQFE.js → chunk-NIW4CLN2.js} +2 -2
- package/dist/cli/chunks/{chunk-PJ4HSXH3.js → chunk-NPT7BYGF.js} +1 -1
- package/dist/cli/chunks/{chunk-HHSEIPSQ.js → chunk-NZNXEEZR.js} +1 -1
- package/dist/cli/chunks/{chunk-FMULOSBL.js → chunk-O3IIAIXB.js} +1 -1
- package/dist/cli/chunks/{chunk-ITRUZ3WE.js → chunk-OC2W7KIW.js} +2 -2
- package/dist/cli/chunks/{chunk-QZQGYSDG.js → chunk-OFUF3APC.js} +2 -2
- package/dist/cli/chunks/{chunk-MKLLB4PM.js → chunk-OU52V67H.js} +4 -4
- package/dist/cli/chunks/{chunk-Y7UJC5OL.js → chunk-P2RR4SW5.js} +3 -3
- package/dist/cli/chunks/{chunk-7Q6CMSMD.js → chunk-P3VRXQ3H.js} +3 -3
- package/dist/cli/chunks/{chunk-YRP73HO4.js → chunk-P5SGBQLY.js} +1 -1
- package/dist/cli/chunks/{chunk-MDYI4IIW.js → chunk-P7MIOTVP.js} +1 -1
- package/dist/cli/chunks/{chunk-B4QA3YN6.js → chunk-PFDILSVO.js} +1 -1
- package/dist/cli/chunks/{chunk-2ZC7S4UG.js → chunk-PPD5ZLNA.js} +2 -2
- package/dist/cli/chunks/{chunk-VGYUVMSN.js → chunk-QFJDR4HC.js} +2 -2
- package/dist/cli/chunks/{chunk-3GWSHRDA.js → chunk-QZ2GQGJX.js} +2 -2
- package/dist/cli/chunks/{chunk-XMZ2DHUL.js → chunk-QZLTIGLB.js} +1 -1
- package/dist/cli/chunks/{chunk-BEOGI5FC.js → chunk-RHSUXQNF.js} +2 -2
- package/dist/cli/chunks/{chunk-ISVBO4XO.js → chunk-S6BWEZKK.js} +2 -2
- package/dist/cli/chunks/{chunk-AYOTODUV.js → chunk-SE4S23C7.js} +1 -1
- package/dist/cli/chunks/{chunk-SLWJNHCR.js → chunk-TOGZ37RL.js} +2 -2
- package/dist/cli/chunks/{chunk-73EWPVBJ.js → chunk-UCXW24HY.js} +2 -2
- package/dist/cli/chunks/{chunk-JQSA6EMI.js → chunk-UQ6WB4N2.js} +2 -2
- package/dist/cli/chunks/{chunk-SQPDGRYR.js → chunk-UQBGA4UA.js} +1 -1
- package/dist/cli/chunks/{chunk-N3R3JGUY.js → chunk-VNFL2TPU.js} +1 -1
- package/dist/cli/chunks/{chunk-QGBXENIP.js → chunk-WARFZ626.js} +1 -1
- package/dist/cli/chunks/{chunk-PVBJUANU.js → chunk-WEBHFIWS.js} +2 -2
- package/dist/cli/chunks/{chunk-YQIMO7VJ.js → chunk-WKIYYF3G.js} +2 -2
- package/dist/cli/chunks/{chunk-6VQKNPGY.js → chunk-WZC4HKGZ.js} +2 -2
- package/dist/cli/chunks/{chunk-O6FN53HB.js → chunk-X36TZXDK.js} +1 -1
- package/dist/cli/chunks/{chunk-IKNDGXZZ.js → chunk-XN4G3SRU.js} +2 -2
- package/dist/cli/chunks/{chunk-N7MKF4F4.js → chunk-XNREA3FG.js} +1 -1
- package/dist/cli/chunks/{chunk-PC3VIR2A.js → chunk-XRDPGJNW.js} +2 -2
- package/dist/cli/chunks/{chunk-ETZ62NFD.js → chunk-XXCSJMSR.js} +1 -1
- package/dist/cli/chunks/{chunk-LCDRRAES.js → chunk-XY2B2BEJ.js} +2 -2
- package/dist/cli/chunks/{chunk-HMSPPGUF.js → chunk-XY4JS3IZ.js} +2 -2
- package/dist/cli/chunks/{chunk-L7GQKJLV.js → chunk-Y4M2HMPR.js} +2 -2
- package/dist/cli/chunks/{chunk-2TUVBEWK.js → chunk-YDPBCN7H.js} +2 -2
- package/dist/cli/chunks/{chunk-NBTKI2TX.js → chunk-YGR54EAA.js} +2 -2
- package/dist/cli/chunks/{chunk-WBQEOACC.js → chunk-YGRY2TVI.js} +2 -2
- package/dist/cli/chunks/{chunk-VVJXQ4FR.js → chunk-YJUJCLXV.js} +2 -2
- package/dist/cli/chunks/{chunk-SHW43QQV.js → chunk-YWG4LHFU.js} +2 -2
- package/dist/cli/chunks/{chunk-FGOVDO3R.js → chunk-Z2QNTRUX.js} +2 -2
- package/dist/cli/chunks/{chunk-UFMW25MS.js → chunk-ZBJMVWQR.js} +2 -2
- package/dist/cli/chunks/{chunk-7MBF3S25.js → chunk-ZH6HYT7C.js} +1 -1
- package/dist/cli/chunks/{chunk-LYV7WJWA.js → chunk-ZP2GE6DM.js} +1 -1
- package/dist/cli/chunks/{chunk-JNX7IRSI.js → chunk-ZQYEBLTL.js} +2 -2
- package/dist/cli/chunks/{chunk-FTOICJQG.js → chunk-ZRU3OZEU.js} +2 -2
- package/dist/cli/chunks/{chunk-OZQIDDXB.js → chunk-ZU3V4CJ4.js} +2 -2
- package/dist/cli/chunks/{chunk-JZFA2PWY.js → chunk-ZWMXF6AX.js} +2 -2
- package/dist/cli/chunks/{ci-4JK2NFCD.js → ci-SM3EVLZ4.js} +2 -2
- package/dist/cli/chunks/{ci-output-LCGTJQWC.js → ci-output-YYXICZBC.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-EJF7D3L4.js → circuit-breaker-CV5UGKXT.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-3RUC6OB4.js → claude-flow-setup-BSBUZ4B7.js} +2 -2
- package/dist/cli/chunks/client-WRDYZGM2.js +2 -0
- package/dist/cli/chunks/{cline-installer-6LY5C5QH.js → cline-installer-P2O6STIC.js} +2 -2
- package/dist/cli/chunks/code-M7DDLBGS.js +58 -0
- package/dist/cli/chunks/{code-index-extractor-OY5GQJBM.js → code-index-extractor-3QZIUYOG.js} +2 -2
- package/dist/cli/chunks/{codex-installer-BO7E2ZVA.js → codex-installer-5JVZCCTC.js} +2 -2
- package/dist/cli/chunks/{completions-VGL3KJ2R.js → completions-EM7IL2BJ.js} +8 -5
- package/dist/cli/chunks/{complexity-analyzer-5DPUK7IL.js → complexity-analyzer-VJXVB2CV.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-LFDG2D42.js → continuedev-installer-RCKJIAEC.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-SEMMMIZH.js → copilot-installer-DZ7LTDOZ.js} +2 -2
- package/dist/cli/chunks/core-handlers-O6E5DNHT.js +2 -0
- package/dist/cli/chunks/{cost-tracker-OPBC6FQM.js → cost-tracker-QLOLXVAM.js} +2 -2
- package/dist/cli/chunks/{coverage-CFDUSRKU.js → coverage-LYHTLWRV.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-EV7LQMDO.js +2 -0
- package/dist/cli/chunks/{cursor-installer-6TXUUVY4.js → cursor-installer-PSIZ3Y53.js} +2 -2
- package/dist/cli/chunks/{daemon-5KO46YQR.js → daemon-IYDTMA5M.js} +4 -4
- package/dist/cli/chunks/{daemon-7BDBPPAF.js → daemon-YLOAXM4X.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-6DQKZOUW.js → dag-attention-scheduler-I2UIO3Z7.js} +2 -2
- package/dist/cli/chunks/{detect-R2QAYDPI.js → detect-ZXQ7X7GZ.js} +2 -2
- package/dist/cli/chunks/{dist-node-3POCIJ4N.js → dist-node-GK6OZX4H.js} +2 -2
- package/dist/cli/chunks/{domain-handler-KW63CHUH.js → domain-handler-NS3IBLRQ.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-2QPOJCUD.js → domain-transfer-5G4RZEWF.js} +2 -2
- package/dist/cli/chunks/dream-E4C236UL.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-OIDJZQEP.js → embed-and-insert-pattern-V4JJUFR6.js} +2 -2
- package/dist/cli/chunks/{eval-UGEKTTAQ.js → eval-7Q6PPYKR.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-3BIM2TT7.js → experience-capture-middleware-DUBKSYFM.js} +3 -3
- package/dist/cli/chunks/{fast-paths-HCJQXB7W.js → fast-paths-IDPPMBUW.js} +2 -2
- package/dist/cli/chunks/{feature-flags-W4JSFBMV.js → feature-flags-EPTMAAKA.js} +2 -2
- package/dist/cli/chunks/{feature-flags-GDGJKLN4.js → feature-flags-KXI6FDY7.js} +2 -2
- package/dist/cli/chunks/{file-discovery-JMUZ4MUH.js → file-discovery-EDX2OJO7.js} +2 -2
- package/dist/cli/chunks/{fleet-YNNK2CKW.js → fleet-67BO3LJ4.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-R2ZY6CDD.js → gnn-wrapper-YARORYT7.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-OZX2EJHQ.js → heartbeat-handler-K3JGPBYR.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-WMADLDKT.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-STRDGJ65.js +2 -0
- package/dist/cli/chunks/hnsw-index-DBHX3TSC.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-3S6TYCG3.js → hnsw-legacy-bridge-CDDRSV5E.js} +2 -2
- package/dist/cli/chunks/{better-sqlite3-RIBLRHJL.js → hnswlib-node-2KL54YUA.js} +2 -2
- package/dist/cli/chunks/{hooks-KM7WR35T.js → hooks-6SCAE6LC.js} +10 -10
- package/dist/cli/chunks/hybrid-router-L2K55I4T.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-RX53A73M.js → hypergraph-engine-I3LUMO7I.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-3QQB3H3Z.js → hypergraph-handler-YAKAIVCN.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-WMO7ZGS7.js +2 -0
- package/dist/cli/chunks/{init-handler-Y62RH4ZI.js → init-handler-NBKCZD7Q.js} +6 -6
- package/dist/cli/chunks/init-wizard-ZAB7UZZS.js +2 -0
- package/dist/cli/chunks/kernel-4MUFDEQI.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-26R253L2.js → kilocode-installer-YGPJCPU3.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-PFA5QPZZ.js → kiro-installer-JV3ONVMN.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-GZRFGXLX.js +2 -0
- package/dist/cli/chunks/{learning-CQLM5ANX.js → learning-2FEZJ5CX.js} +3 -3
- package/dist/cli/chunks/{llm-router-QZ5PG4PF.js → llm-router-SILI4KLU.js} +4 -4
- package/dist/cli/chunks/llm-router-service-5ODLU5U5.js +2 -0
- package/dist/cli/chunks/{load-UPA6LPHM.js → load-EGXLQVR3.js} +2 -2
- package/dist/cli/chunks/load-test-ZDQFS5XS.js +2 -0
- package/dist/cli/chunks/{mcp-LSWTLAJ4.js → mcp-OJH775TL.js} +2 -2
- package/dist/cli/chunks/{memory-VGEYYGCG.js → memory-FNEOK4FW.js} +5 -5
- package/dist/cli/chunks/memory-backend-UK7SQ6ZM.js +2 -0
- package/dist/cli/chunks/{memory-handlers-QBURG7NA.js → memory-handlers-6LDUH3JZ.js} +2 -2
- package/dist/cli/chunks/{multi-model-executor-VZVFBIKC.js → multi-model-executor-ORTFWLLE.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-PBQAXNLV.js → opencode-installer-UAQLW6XX.js} +2 -2
- package/dist/cli/chunks/{orchestrator-YND7JB5O.js → orchestrator-VE5KJ2V4.js} +5 -5
- package/dist/cli/chunks/pattern-null-store-LO2QTIBU.js +2 -0
- package/dist/cli/chunks/{pipeline-GM5RRUES.js → pipeline-FNMDRWTU.js} +2 -2
- package/dist/cli/chunks/{platform-L7OGGRSL.js → platform-MGAKRUQN.js} +2 -2
- package/dist/cli/chunks/{plugin-N4YAE6H5.js → plugin-YX7THX3I.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-7D67XV6Z.js → prime-radiant-advanced-wasm-XJV4RLMK.js} +2 -2
- package/dist/cli/chunks/protocol-executor-JWMYQEOI.js +2 -0
- package/dist/cli/chunks/{protocol-handler-V2WTFU7N.js → protocol-handler-QFET442Y.js} +2 -2
- package/dist/cli/chunks/{prove-33DS5Z3N.js → prove-QBAESCOC.js} +2 -2
- package/dist/cli/chunks/provider-manager-PEXOHGNB.js +2 -0
- package/dist/cli/chunks/qe-reasoning-bank-7B2G4UGQ.js +2 -0
- package/dist/cli/chunks/{quality-WCSEA5GH.js → quality-ZTNRL6EG.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-6OF4HT3S.js +2 -0
- package/dist/cli/chunks/{real-embeddings-OQ5F37DG.js → real-embeddings-ZFFDV6HC.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-II7LIR2X.js → roocode-installer-J4LFL4AE.js} +2 -2
- package/dist/cli/chunks/router-GMWRF6DU.js +2 -0
- package/dist/cli/chunks/routing-feedback-XKJSQK3I.js +2 -0
- package/dist/cli/chunks/{routing-handler-6OFHARIY.js → routing-handler-A5QG2TP2.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-GD5JTR4M.js → ruvector-commands-J5JL5WX5.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-HSK6BYZV.js → rvf-dual-writer-H7442GMO.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-554SMF5S.js → rvf-migration-adapter-PTFQUYKC.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-OFDBCAYE.js → rvf-migration-coordinator-RSNROYRX.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-YEA6TMXB.js +2 -0
- package/dist/cli/chunks/safe-db-5DOP2J3V.js +2 -0
- package/dist/cli/chunks/schedule-SUWTOBHP.js +2 -0
- package/dist/cli/chunks/scheduler-P4VTC5SQ.js +2 -0
- package/dist/cli/chunks/{security-GN4J6DSS.js → security-LHHLMCBA.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-Q4PM3QCN.js → shared-rvf-adapter-NPSHVUTM.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-R5WK5BXQ.js → shared-rvf-dual-writer-INQDY5WE.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-5Z2RAXH7.js +2 -0
- package/dist/cli/chunks/{status-handler-AHS5WVMG.js → status-handler-R2KIAMAE.js} +2 -2
- package/dist/cli/chunks/{structural-health-5KUKNLHZ.js → structural-health-2VPPIOZX.js} +2 -2
- package/dist/cli/chunks/{sync-PUMM3SR6.js → sync-ASZ3T5GT.js} +2 -2
- package/dist/cli/chunks/{sync-TQLGD5HX.js → sync-NLASP7AK.js} +2 -2
- package/dist/cli/chunks/{task-handler-D7VXV4AF.js → task-handler-UV5R6LJG.js} +2 -2
- package/dist/cli/chunks/{task-handlers-QMN4SWUG.js → task-handlers-I6YJXPYP.js} +3 -3
- package/dist/cli/chunks/{test-HEWZR6YQ.js → test-TE43TNTI.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-VTMLBEPA.js → test-scheduling-WWWWF2TZ.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-IYBG7PQ6.js → token-bootstrap-HEWP7KKS.js} +2 -2
- package/dist/cli/chunks/{token-usage-C7H27BFZ.js → token-usage-3FVHUAW6.js} +2 -2
- package/dist/cli/chunks/{transformers-5ZJVC6NB.js → transformers-O5OFM4XM.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-EARBJG2H.js → tree-sitter-wasm-parser-YOYWFW63.js} +2 -2
- package/dist/cli/chunks/{types-3IHE42PZ.js → types-42GR6PLO.js} +2 -2
- package/dist/cli/chunks/unified-memory-HCKOPFAY.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-6NQPYA5C.js +2 -0
- package/dist/cli/chunks/unified-persistence-NIMKNAFR.js +2 -0
- package/dist/cli/chunks/{upgrade-YP3VFSXO.js → upgrade-BU6DJ4LT.js} +2 -2
- package/dist/cli/chunks/{validate-VSBNKPN6.js → validate-MPTBARGN.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-GOCJVWXE.js → validate-swarm-5LUQYHPP.js} +2 -2
- package/dist/cli/chunks/{vibium-U6YKCLDF.js → vibium-MJJDANDL.js} +2 -2
- package/dist/cli/chunks/visual-security-HFGHA57Z.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-TSNVGWSN.js → web-tree-sitter-5TF4UGB3.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-2VKMEFSD.js → windsurf-installer-NQAOSVCN.js} +2 -2
- package/dist/cli/chunks/{witness-chain-BWZCW52H.js → witness-chain-23UWK2JT.js} +2 -2
- package/dist/cli/chunks/witness-chain-VZGGJ7TJ.js +2 -0
- package/dist/cli/chunks/{workflow-J6SCYLU3.js → workflow-3QOLXRJC.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-45L7D4SN.js +2 -0
- package/dist/cli/chunks/{wrappers-M5C7DONW.js → wrappers-S6EUZBCX.js} +2 -2
- package/dist/cli/commands/code.js +78 -2
- package/dist/cli/completions/index.js +4 -1
- package/dist/domains/code-intelligence/coordinator.js +8 -4
- package/dist/domains/code-intelligence/services/c4-model/from-detected.d.ts +41 -0
- package/dist/domains/code-intelligence/services/c4-model/from-detected.js +152 -0
- package/dist/domains/code-intelligence/services/c4-model/kg-relationships.d.ts +71 -0
- package/dist/domains/code-intelligence/services/c4-model/kg-relationships.js +87 -0
- package/dist/domains/code-intelligence/services/knowledge-graph.d.ts +6 -0
- package/dist/domains/code-intelligence/services/knowledge-graph.js +3 -3
- package/dist/domains/code-intelligence/services/product-factors-bridge.d.ts +26 -5
- package/dist/domains/code-intelligence/services/product-factors-bridge.js +72 -65
- 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 +446 -464
- package/dist/mcp/tool-scoping.d.ts +8 -2
- package/dist/mcp/tool-scoping.js +13 -0
- package/dist/mcp/tools/code-intelligence/c4.d.ts +56 -0
- package/dist/mcp/tools/code-intelligence/c4.js +145 -0
- package/dist/mcp/tools/index.d.ts +1 -0
- package/dist/mcp/tools/index.js +1 -0
- package/dist/mcp/tools/registry.d.ts +1 -0
- package/dist/mcp/tools/registry.js +3 -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/c4-model/confidence.d.ts +38 -0
- package/dist/shared/c4-model/confidence.js +69 -0
- package/dist/shared/c4-model/index.d.ts +4 -0
- package/dist/shared/c4-model/index.js +1 -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/code-MPDG4UHS.js +0 -39
- 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
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Research Workflow Coordination
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Coordinate Claude Code's research activities for comprehensive, systematic exploration.
|
|
5
|
+
|
|
6
|
+
## Step-by-Step Coordination
|
|
7
|
+
|
|
8
|
+
### 1. Initialize Research Framework
|
|
9
|
+
```
|
|
10
|
+
Tool: mcp__claude-flow__swarm_init
|
|
11
|
+
Parameters: {"topology": "mesh", "maxAgents": 5, "strategy": "balanced"}
|
|
12
|
+
```
|
|
13
|
+
Creates a mesh topology for comprehensive exploration from multiple angles.
|
|
14
|
+
|
|
15
|
+
### 2. Define Research Perspectives
|
|
16
|
+
```
|
|
17
|
+
Tool: mcp__claude-flow__agent_spawn
|
|
18
|
+
Parameters: {"type": "researcher", "name": "Literature Review"}
|
|
19
|
+
```
|
|
20
|
+
```
|
|
21
|
+
Tool: mcp__claude-flow__agent_spawn
|
|
22
|
+
Parameters: {"type": "analyst", "name": "Data Analysis"}
|
|
23
|
+
```
|
|
24
|
+
Sets up different analytical approaches for Claude Code to use.
|
|
25
|
+
|
|
26
|
+
### 3. Execute Coordinated Research
|
|
27
|
+
```
|
|
28
|
+
Tool: mcp__claude-flow__task_orchestrate
|
|
29
|
+
Parameters: {
|
|
30
|
+
"task": "Research modern web frameworks performance",
|
|
31
|
+
"strategy": "adaptive",
|
|
32
|
+
"priority": "medium"
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 4. Store Research Findings
|
|
37
|
+
```
|
|
38
|
+
Tool: mcp__claude-flow__memory_usage
|
|
39
|
+
Parameters: {
|
|
40
|
+
"action": "store",
|
|
41
|
+
"key": "research_findings",
|
|
42
|
+
"value": "framework performance analysis results",
|
|
43
|
+
"namespace": "research"
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## What Claude Code Actually Does
|
|
48
|
+
1. Uses **WebSearch** tool for finding resources
|
|
49
|
+
2. Uses **Read** tool for analyzing documentation
|
|
50
|
+
3. Uses **Task** tool for parallel exploration
|
|
51
|
+
4. Synthesizes findings using coordination patterns
|
|
52
|
+
5. Stores insights in memory for future reference
|
|
53
|
+
|
|
54
|
+
Remember: The swarm coordinates HOW Claude Code researches, not WHAT it finds.
|
|
55
|
+
|
|
56
|
+
## CLI Usage
|
|
57
|
+
```bash
|
|
58
|
+
# Start research workflow via CLI
|
|
59
|
+
npx claude-flow workflow research "modern web frameworks"
|
|
60
|
+
|
|
61
|
+
# Export research workflow
|
|
62
|
+
npx claude-flow workflow export research --format json
|
|
63
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# workflow-create
|
|
2
|
+
|
|
3
|
+
Create reusable workflow templates.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
```bash
|
|
7
|
+
npx claude-flow workflow create [options]
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Options
|
|
11
|
+
- `--name <name>` - Workflow name
|
|
12
|
+
- `--from-history` - Create from history
|
|
13
|
+
- `--interactive` - Interactive creation
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
```bash
|
|
17
|
+
# Create workflow
|
|
18
|
+
npx claude-flow workflow create --name "deploy-api"
|
|
19
|
+
|
|
20
|
+
# From history
|
|
21
|
+
npx claude-flow workflow create --name "test-suite" --from-history
|
|
22
|
+
|
|
23
|
+
# Interactive mode
|
|
24
|
+
npx claude-flow workflow create --interactive
|
|
25
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# workflow-execute
|
|
2
|
+
|
|
3
|
+
Execute saved workflows.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
```bash
|
|
7
|
+
npx claude-flow workflow execute [options]
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Options
|
|
11
|
+
- `--name <name>` - Workflow name
|
|
12
|
+
- `--params <json>` - Workflow parameters
|
|
13
|
+
- `--dry-run` - Preview execution
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
```bash
|
|
17
|
+
# Execute workflow
|
|
18
|
+
npx claude-flow workflow execute --name "deploy-api"
|
|
19
|
+
|
|
20
|
+
# With parameters
|
|
21
|
+
npx claude-flow workflow execute --name "test-suite" --params '{"env": "staging"}'
|
|
22
|
+
|
|
23
|
+
# Dry run
|
|
24
|
+
npx claude-flow workflow execute --name "deploy-api" --dry-run
|
|
25
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# workflow-export
|
|
2
|
+
|
|
3
|
+
Export workflows for sharing.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
```bash
|
|
7
|
+
npx claude-flow workflow export [options]
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Options
|
|
11
|
+
- `--name <name>` - Workflow to export
|
|
12
|
+
- `--format <type>` - Export format
|
|
13
|
+
- `--include-history` - Include execution history
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
```bash
|
|
17
|
+
# Export workflow
|
|
18
|
+
npx claude-flow workflow export --name "deploy-api"
|
|
19
|
+
|
|
20
|
+
# As YAML
|
|
21
|
+
npx claude-flow workflow export --name "test-suite" --format yaml
|
|
22
|
+
|
|
23
|
+
# With history
|
|
24
|
+
npx claude-flow workflow export --name "deploy-api" --include-history
|
|
25
|
+
```
|
|
@@ -90,7 +90,7 @@ Automatic checkpoint created by Claude Code
|
|
|
90
90
|
|
|
91
91
|
🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
|
92
92
|
|
|
93
|
-
Co-Authored-By: Claude Opus 4.
|
|
93
|
+
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>" --quiet 2>/dev/null; then
|
|
94
94
|
log "Created commit: $message"
|
|
95
95
|
|
|
96
96
|
# Push if enabled
|
|
@@ -31,6 +31,27 @@ const log = (msg) => console.log(`${CYAN}[AutoMemory] ${msg}${RESET}`);
|
|
|
31
31
|
const success = (msg) => console.log(`${GREEN}[AutoMemory] ✓ ${msg}${RESET}`);
|
|
32
32
|
const dim = (msg) => console.log(` ${DIM}${msg}${RESET}`);
|
|
33
33
|
|
|
34
|
+
const DEBUG = !!(process.env.RUFLO_DEBUG || process.env.DEBUG);
|
|
35
|
+
|
|
36
|
+
// ── Graceful shutdown (FIX 3) ───────────────────────────────────────────────
|
|
37
|
+
// Track the backend in use so a SIGTERM/SIGINT mid-run can still flush it
|
|
38
|
+
// (the JSON backend persists; a SQLite-backed one closes/flushes WAL) instead
|
|
39
|
+
// of leaving a half-written store or a stale lock behind.
|
|
40
|
+
let activeBackend = null;
|
|
41
|
+
let shuttingDown = false;
|
|
42
|
+
function trackBackend(b) { activeBackend = b; return b; }
|
|
43
|
+
async function gracefulExit(signal) {
|
|
44
|
+
if (shuttingDown) return;
|
|
45
|
+
shuttingDown = true;
|
|
46
|
+
if (DEBUG) process.stderr.write(`[AutoMemory] received ${signal}, flushing backend before exit\n`);
|
|
47
|
+
try {
|
|
48
|
+
if (activeBackend && typeof activeBackend.shutdown === 'function') await activeBackend.shutdown();
|
|
49
|
+
} catch { /* best effort — never block exit on cleanup */ }
|
|
50
|
+
process.exit(0);
|
|
51
|
+
}
|
|
52
|
+
process.on('SIGTERM', () => { gracefulExit('SIGTERM'); });
|
|
53
|
+
process.on('SIGINT', () => { gracefulExit('SIGINT'); });
|
|
54
|
+
|
|
34
55
|
// Ensure data dir
|
|
35
56
|
if (!existsSync(DATA_DIR)) mkdirSync(DATA_DIR, { recursive: true });
|
|
36
57
|
|
|
@@ -219,7 +240,7 @@ async function doImport() {
|
|
|
219
240
|
}
|
|
220
241
|
|
|
221
242
|
const config = readConfig();
|
|
222
|
-
const backend = new JsonFileBackend(STORE_PATH);
|
|
243
|
+
const backend = trackBackend(new JsonFileBackend(STORE_PATH));
|
|
223
244
|
await backend.initialize();
|
|
224
245
|
|
|
225
246
|
const bridgeConfig = {
|
|
@@ -272,7 +293,7 @@ async function doSync() {
|
|
|
272
293
|
}
|
|
273
294
|
|
|
274
295
|
const config = readConfig();
|
|
275
|
-
const backend = new JsonFileBackend(STORE_PATH);
|
|
296
|
+
const backend = trackBackend(new JsonFileBackend(STORE_PATH));
|
|
276
297
|
await backend.initialize();
|
|
277
298
|
|
|
278
299
|
const entryCount = await backend.count();
|
|
@@ -348,6 +369,18 @@ async function doStatus() {
|
|
|
348
369
|
|
|
349
370
|
const command = process.argv[2] || 'status';
|
|
350
371
|
|
|
372
|
+
// Dynamic import() failures can surface as unhandled rejections on a later
|
|
373
|
+
// microtask even when the awaiting call site already caught them, which would
|
|
374
|
+
// otherwise force a non-zero exit. Swallow to keep hooks exit-0, but surface the
|
|
375
|
+
// reason under RUFLO_DEBUG/DEBUG so genuine async bugs aren't silently hidden
|
|
376
|
+
// (FIX 2 — the previous `() => {}` discarded every rejection process-wide).
|
|
377
|
+
process.on('unhandledRejection', (reason) => {
|
|
378
|
+
if (DEBUG) {
|
|
379
|
+
const detail = reason && reason.message ? reason.message : String(reason);
|
|
380
|
+
process.stderr.write(`[AutoMemory] unhandledRejection (suppressed): ${detail}\n`);
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
|
|
351
384
|
try {
|
|
352
385
|
switch (command) {
|
|
353
386
|
case 'import': await doImport(); break;
|
|
@@ -361,5 +394,5 @@ try {
|
|
|
361
394
|
// Hooks must never crash Claude Code - fail silently
|
|
362
395
|
try { dim(`Error (non-critical): ${err.message}`); } catch (_) {}
|
|
363
396
|
}
|
|
364
|
-
//
|
|
365
|
-
process.
|
|
397
|
+
// Force clean exit — process.exitCode alone isn't enough if async errors override it
|
|
398
|
+
process.exit(0);
|
|
@@ -1,25 +1,43 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
|
-
* Safe GitHub CLI Helper
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* Safe GitHub CLI Helper — v1.0.0
|
|
4
|
+
*
|
|
5
|
+
* Prevents injection issues when using `gh` commands with untrusted content
|
|
6
|
+
* (PR bodies, issue bodies, comment bodies) by routing the body through a
|
|
7
|
+
* temp file and using `--body-file` rather than interpolating into shell args.
|
|
8
|
+
*
|
|
9
|
+
* ADR-127 Phase 2 hardening:
|
|
10
|
+
* - GITHUB_SAFE_VERSION exported for smoke assertions.
|
|
11
|
+
* - Explicit 256KB body cap: rejects oversized bodies before any temp-file
|
|
12
|
+
* write, matching the GitHub API `body` field limit.
|
|
13
|
+
* - Strict error handling: all execSync calls inside try/catch; cleanup in
|
|
14
|
+
* finally; non-zero exit on any error.
|
|
15
|
+
* - GITHUB_SAFE_DRY_RUN=1 env-var skips the actual `gh` exec for testing.
|
|
16
|
+
*
|
|
7
17
|
* Usage:
|
|
8
|
-
* ./github-safe.js issue comment 123 "Message with
|
|
18
|
+
* ./github-safe.js issue comment 123 "Message with \`backticks\`"
|
|
9
19
|
* ./github-safe.js pr create --title "Title" --body "Complex body"
|
|
10
20
|
*/
|
|
11
21
|
|
|
12
|
-
import { execSync } from 'child_process';
|
|
22
|
+
import { execSync, execFileSync } from 'child_process';
|
|
13
23
|
import { writeFileSync, unlinkSync } from 'fs';
|
|
14
24
|
import { tmpdir } from 'os';
|
|
15
25
|
import { join } from 'path';
|
|
16
26
|
import { randomBytes } from 'crypto';
|
|
17
27
|
|
|
28
|
+
// Version constant — asserted by smoke-github-safe-injection.mjs.
|
|
29
|
+
export const GITHUB_SAFE_VERSION = '1.0.0';
|
|
30
|
+
|
|
31
|
+
// Maximum body size allowed (bytes). The GitHub API enforces 65536 chars for
|
|
32
|
+
// issue/PR bodies; the CLI is more lenient but the 256KB limit is a
|
|
33
|
+
// conservative safety cap that prevents accidental oversized writes.
|
|
34
|
+
const MAX_BODY_BYTES = 256 * 1024;
|
|
35
|
+
|
|
18
36
|
const args = process.argv.slice(2);
|
|
19
37
|
|
|
20
38
|
if (args.length < 2) {
|
|
21
39
|
console.log(`
|
|
22
|
-
Safe GitHub CLI Helper
|
|
40
|
+
Safe GitHub CLI Helper v${GITHUB_SAFE_VERSION}
|
|
23
41
|
|
|
24
42
|
Usage:
|
|
25
43
|
./github-safe.js issue comment <number> <body>
|
|
@@ -27,11 +45,11 @@ Usage:
|
|
|
27
45
|
./github-safe.js issue create --title <title> --body <body>
|
|
28
46
|
./github-safe.js pr create --title <title> --body <body>
|
|
29
47
|
|
|
30
|
-
This helper prevents
|
|
48
|
+
This helper prevents injection issues with special characters:
|
|
31
49
|
- Backticks in code examples
|
|
32
|
-
- Command substitution
|
|
33
|
-
-
|
|
34
|
-
-
|
|
50
|
+
- Command substitution $(...)
|
|
51
|
+
- Semicolons and other shell metacharacters
|
|
52
|
+
- Oversized bodies (> 256 KB rejected)
|
|
35
53
|
`);
|
|
36
54
|
process.exit(1);
|
|
37
55
|
}
|
|
@@ -39,68 +57,100 @@ This helper prevents timeout issues with special characters like:
|
|
|
39
57
|
const [command, subcommand, ...restArgs] = args;
|
|
40
58
|
|
|
41
59
|
// Handle commands that need body content
|
|
42
|
-
if ((command === 'issue' || command === 'pr') &&
|
|
60
|
+
if ((command === 'issue' || command === 'pr') &&
|
|
43
61
|
(subcommand === 'comment' || subcommand === 'create')) {
|
|
44
|
-
|
|
62
|
+
|
|
45
63
|
let bodyIndex = -1;
|
|
46
64
|
let body = '';
|
|
47
|
-
|
|
65
|
+
|
|
48
66
|
if (subcommand === 'comment' && restArgs.length >= 2) {
|
|
49
67
|
// Simple format: github-safe.js issue comment 123 "body"
|
|
50
68
|
body = restArgs[1];
|
|
51
69
|
bodyIndex = 1;
|
|
52
70
|
} else {
|
|
53
|
-
// Flag format: --body "content"
|
|
71
|
+
// Flag format: --body "content"
|
|
54
72
|
bodyIndex = restArgs.indexOf('--body');
|
|
55
73
|
if (bodyIndex !== -1 && bodyIndex < restArgs.length - 1) {
|
|
56
74
|
body = restArgs[bodyIndex + 1];
|
|
57
75
|
}
|
|
58
76
|
}
|
|
59
|
-
|
|
77
|
+
|
|
60
78
|
if (body) {
|
|
61
|
-
//
|
|
79
|
+
// Enforce 256KB cap before any file I/O.
|
|
80
|
+
const bodyBytes = Buffer.byteLength(body, 'utf8');
|
|
81
|
+
if (bodyBytes > MAX_BODY_BYTES) {
|
|
82
|
+
console.error(
|
|
83
|
+
`[ERROR] Body exceeds maximum allowed size (${bodyBytes} bytes > ${MAX_BODY_BYTES} bytes). ` +
|
|
84
|
+
'GitHub API body fields are capped at 256KB. Truncate the body before passing it to github-safe.js.'
|
|
85
|
+
);
|
|
86
|
+
process.exit(1);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Use temporary file for body content — never interpolate into argv.
|
|
62
90
|
const tmpFile = join(tmpdir(), `gh-body-${randomBytes(8).toString('hex')}.tmp`);
|
|
63
|
-
|
|
91
|
+
|
|
64
92
|
try {
|
|
65
93
|
writeFileSync(tmpFile, body, 'utf8');
|
|
66
|
-
|
|
94
|
+
|
|
67
95
|
// Build new command with --body-file
|
|
68
96
|
const newArgs = [...restArgs];
|
|
69
97
|
if (subcommand === 'comment' && bodyIndex === 1) {
|
|
70
|
-
// Replace body with --body-file
|
|
98
|
+
// Replace positional body arg with --body-file
|
|
71
99
|
newArgs[1] = '--body-file';
|
|
72
100
|
newArgs.push(tmpFile);
|
|
73
101
|
} else if (bodyIndex !== -1) {
|
|
74
|
-
// Replace --body with --body-file
|
|
102
|
+
// Replace --body flag pair with --body-file
|
|
75
103
|
newArgs[bodyIndex] = '--body-file';
|
|
76
104
|
newArgs[bodyIndex + 1] = tmpFile;
|
|
77
105
|
}
|
|
78
|
-
|
|
79
|
-
//
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
106
|
+
|
|
107
|
+
// Skip actual gh exec in dry-run mode (used by smoke tests).
|
|
108
|
+
if (process.env.GITHUB_SAFE_DRY_RUN === '1') {
|
|
109
|
+
const ghArgs = [command, subcommand, ...newArgs];
|
|
110
|
+
console.log(`[DRY-RUN] gh ${ghArgs.join(' ')}`);
|
|
111
|
+
process.exit(0);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const ghArgv = [command, subcommand, ...newArgs];
|
|
115
|
+
console.log(`Executing: gh ${ghArgv.join(' ')}`);
|
|
116
|
+
|
|
117
|
+
// Use execFileSync to avoid shell interpolation — args are passed as an
|
|
118
|
+
// array so shell metacharacters in tmpFile path cannot be exploited.
|
|
119
|
+
execFileSync('gh', ghArgv, {
|
|
84
120
|
stdio: 'inherit',
|
|
85
|
-
timeout: 30000
|
|
121
|
+
timeout: 30000,
|
|
86
122
|
});
|
|
87
|
-
|
|
123
|
+
|
|
88
124
|
} catch (error) {
|
|
89
|
-
console.error('
|
|
125
|
+
console.error('[ERROR]', error.message);
|
|
90
126
|
process.exit(1);
|
|
91
127
|
} finally {
|
|
92
|
-
//
|
|
93
|
-
try {
|
|
94
|
-
unlinkSync(tmpFile);
|
|
95
|
-
} catch (e) {
|
|
96
|
-
// Ignore cleanup errors
|
|
97
|
-
}
|
|
128
|
+
// Always clean up the temp file.
|
|
129
|
+
try { unlinkSync(tmpFile); } catch (_) { /* ignore cleanup errors */ }
|
|
98
130
|
}
|
|
99
131
|
} else {
|
|
100
|
-
// No body content
|
|
101
|
-
|
|
132
|
+
// No body content — execute normally (no injection risk for args).
|
|
133
|
+
if (process.env.GITHUB_SAFE_DRY_RUN === '1') {
|
|
134
|
+
console.log(`[DRY-RUN] gh ${args.join(' ')}`);
|
|
135
|
+
process.exit(0);
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
execFileSync('gh', args, { stdio: 'inherit' });
|
|
139
|
+
} catch (error) {
|
|
140
|
+
console.error('[ERROR]', error.message);
|
|
141
|
+
process.exit(1);
|
|
142
|
+
}
|
|
102
143
|
}
|
|
103
144
|
} else {
|
|
104
|
-
//
|
|
105
|
-
|
|
145
|
+
// Non-body commands — execute normally.
|
|
146
|
+
if (process.env.GITHUB_SAFE_DRY_RUN === '1') {
|
|
147
|
+
console.log(`[DRY-RUN] gh ${args.join(' ')}`);
|
|
148
|
+
process.exit(0);
|
|
149
|
+
}
|
|
150
|
+
try {
|
|
151
|
+
execFileSync('gh', args, { stdio: 'inherit' });
|
|
152
|
+
} catch (error) {
|
|
153
|
+
console.error('[ERROR]', error.message);
|
|
154
|
+
process.exit(1);
|
|
155
|
+
}
|
|
106
156
|
}
|
|
@@ -1,28 +1,45 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
+
# Security rationale: set -euo pipefail ensures that:
|
|
3
|
+
# -e — exit immediately if any command fails (no silent failures)
|
|
4
|
+
# -u — treat unset variables as errors (prevents empty-string expansion bugs)
|
|
5
|
+
# -o pipefail — pipeline fails if any command in it fails (not just last)
|
|
6
|
+
# This matches the ADR-127 Phase 2 requirement for github-setup.sh hardening.
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
2
9
|
# Setup GitHub integration for Claude Flow
|
|
3
10
|
|
|
4
|
-
echo "
|
|
11
|
+
echo "Setting up GitHub integration..."
|
|
5
12
|
|
|
6
13
|
# Check for gh CLI
|
|
7
14
|
if ! command -v gh &> /dev/null; then
|
|
8
|
-
echo "
|
|
15
|
+
echo "WARNING: GitHub CLI (gh) not found"
|
|
9
16
|
echo "Install from: https://cli.github.com/"
|
|
10
17
|
echo "Continuing without GitHub features..."
|
|
11
18
|
else
|
|
12
|
-
echo "
|
|
13
|
-
|
|
14
|
-
# Check auth status
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
echo "OK: GitHub CLI found"
|
|
20
|
+
|
|
21
|
+
# Check auth status and scope sufficiency.
|
|
22
|
+
# `gh auth status` exits non-zero when not authenticated.
|
|
23
|
+
# We additionally parse for "Token scopes" to verify we have at least
|
|
24
|
+
# 'repo' scope, which is required for PR/issue operations.
|
|
25
|
+
if gh auth status 2>&1 | grep -q "Logged in"; then
|
|
26
|
+
echo "OK: GitHub authentication active"
|
|
27
|
+
# Verify repo scope is present for PR/issue operations.
|
|
28
|
+
if gh auth status 2>&1 | grep -q "repo"; then
|
|
29
|
+
echo "OK: 'repo' scope available"
|
|
30
|
+
else
|
|
31
|
+
echo "WARNING: 'repo' scope not confirmed — PR/issue operations may fail"
|
|
32
|
+
echo "Run: gh auth login --scopes repo,read:org"
|
|
33
|
+
fi
|
|
17
34
|
else
|
|
18
|
-
echo "
|
|
35
|
+
echo "WARNING: Not authenticated with GitHub"
|
|
19
36
|
echo "Run: gh auth login"
|
|
20
37
|
fi
|
|
21
38
|
fi
|
|
22
39
|
|
|
23
40
|
echo ""
|
|
24
|
-
echo "
|
|
25
|
-
echo " - npx
|
|
26
|
-
echo " - npx
|
|
27
|
-
echo " - npx
|
|
28
|
-
echo " - npx
|
|
41
|
+
echo "GitHub swarm commands available:"
|
|
42
|
+
echo " - npx claude-flow github swarm"
|
|
43
|
+
echo " - npx claude-flow repo analyze"
|
|
44
|
+
echo " - npx claude-flow pr enhance"
|
|
45
|
+
echo " - npx claude-flow issue triage"
|
|
@@ -47,6 +47,33 @@ const session = safeRequire(path.join(helpersDir, 'session.js'));
|
|
|
47
47
|
const memory = safeRequire(path.join(helpersDir, 'memory.js'));
|
|
48
48
|
const intelligence = safeRequire(path.join(helpersDir, 'intelligence.cjs'));
|
|
49
49
|
|
|
50
|
+
// ── Intelligence timeout protection (fixes #1530, #1531) ───────────────────
|
|
51
|
+
const INTELLIGENCE_TIMEOUT_MS = 3000;
|
|
52
|
+
// Race the (possibly-async) work against a real timeout. The previous version
|
|
53
|
+
// called fn() and clearTimeout(timer) immediately, so an async fn returned a
|
|
54
|
+
// pending promise that resolved THROUGH the race — the timeout protected
|
|
55
|
+
// nothing. This settles on whichever finishes first, then clears the timer.
|
|
56
|
+
//
|
|
57
|
+
// LIMITATION: a synchronous blocking fn (the current intelligence.init() does
|
|
58
|
+
// blocking fs reads) cannot be interrupted by any in-process timer — the event
|
|
59
|
+
// loop is blocked. The real guard for that case is the readJSON file-size
|
|
60
|
+
// limit in intelligence.cjs. This util only bounds work that yields (async I/O).
|
|
61
|
+
function runWithTimeout(fn, label) {
|
|
62
|
+
let timer;
|
|
63
|
+
const timeout = new Promise((resolve) => {
|
|
64
|
+
timer = setTimeout(() => {
|
|
65
|
+
process.stderr.write("[WARN] " + label + " timed out after " + INTELLIGENCE_TIMEOUT_MS + "ms, skipping\n");
|
|
66
|
+
resolve(null);
|
|
67
|
+
}, INTELLIGENCE_TIMEOUT_MS);
|
|
68
|
+
});
|
|
69
|
+
const work = Promise.resolve().then(fn).catch(() => null);
|
|
70
|
+
return Promise.race([work, timeout]).then((result) => {
|
|
71
|
+
clearTimeout(timer);
|
|
72
|
+
return result;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
50
77
|
// Get the command from argv
|
|
51
78
|
const [,, command, ...args] = process.argv;
|
|
52
79
|
|
|
@@ -70,6 +97,13 @@ async function readStdin() {
|
|
|
70
97
|
}
|
|
71
98
|
|
|
72
99
|
async function main() {
|
|
100
|
+
// Global safety timeout: hooks must NEVER hang (#1530, #1531)
|
|
101
|
+
const safetyTimer = setTimeout(() => {
|
|
102
|
+
process.stderr.write("[WARN] Hook handler global timeout (5s), forcing exit\n");
|
|
103
|
+
process.exit(0);
|
|
104
|
+
}, 5000);
|
|
105
|
+
safetyTimer.unref(); // don't keep process alive just for this timer
|
|
106
|
+
|
|
73
107
|
let stdinData = '';
|
|
74
108
|
try { stdinData = await readStdin(); } catch (e) { /* ignore stdin errors */ }
|
|
75
109
|
|
|
@@ -78,8 +112,16 @@ async function main() {
|
|
|
78
112
|
try { hookInput = JSON.parse(stdinData); } catch (e) { /* ignore parse errors */ }
|
|
79
113
|
}
|
|
80
114
|
|
|
81
|
-
//
|
|
82
|
-
const
|
|
115
|
+
// Normalize snake_case/camelCase: Claude Code sends tool_input/tool_name (snake_case)
|
|
116
|
+
const toolInput = hookInput.toolInput || hookInput.tool_input || {};
|
|
117
|
+
const toolName = hookInput.toolName || hookInput.tool_name || '';
|
|
118
|
+
|
|
119
|
+
// Merge stdin data into prompt resolution: prefer stdin fields, then env, then argv.
|
|
120
|
+
// `toolInput` is an object (e.g. {command:"ls"}) — it's truthy but not a string,
|
|
121
|
+
// so falling back to it directly bound `prompt` to the object and tripped
|
|
122
|
+
// `.toLowerCase()` / `.substring()` on every Bash hook (#1944). Use the
|
|
123
|
+
// `.command` field instead, which is the actual string the hook needs.
|
|
124
|
+
const prompt = hookInput.prompt || hookInput.command || toolInput.command
|
|
83
125
|
|| process.env.PROMPT || process.env.TOOL_INPUT_command || args.join(' ') || '';
|
|
84
126
|
|
|
85
127
|
const handlers = {
|
|
@@ -93,39 +135,15 @@ const handlers = {
|
|
|
93
135
|
}
|
|
94
136
|
if (router && router.routeTask) {
|
|
95
137
|
const result = router.routeTask(prompt);
|
|
96
|
-
// Format output for Claude Code hook consumption
|
|
138
|
+
// Format output for Claude Code hook consumption — real data only
|
|
97
139
|
const output = [
|
|
98
140
|
`[INFO] Routing task: ${prompt.substring(0, 80) || '(no prompt)'}`,
|
|
99
141
|
'',
|
|
100
|
-
'Routing Method',
|
|
101
|
-
' - Method: keyword',
|
|
102
|
-
' - Backend: keyword matching',
|
|
103
|
-
` - Latency: ${(Math.random() * 0.5 + 0.1).toFixed(3)}ms`,
|
|
104
|
-
' - Matched Pattern: keyword-fallback',
|
|
105
|
-
'',
|
|
106
|
-
'Semantic Matches:',
|
|
107
|
-
' bugfix-task: 15.0%',
|
|
108
|
-
' devops-task: 14.0%',
|
|
109
|
-
' testing-task: 13.0%',
|
|
110
|
-
'',
|
|
111
142
|
'+------------------- Primary Recommendation -------------------+',
|
|
112
143
|
`| Agent: ${result.agent.padEnd(53)}|`,
|
|
113
144
|
`| Confidence: ${(result.confidence * 100).toFixed(1)}%${' '.repeat(44)}|`,
|
|
114
|
-
`| Reason: ${result.reason.substring(0, 53).padEnd(53)}|`,
|
|
145
|
+
`| Reason: ${(result.reason || '').substring(0, 53).padEnd(53)}|`,
|
|
115
146
|
'+--------------------------------------------------------------+',
|
|
116
|
-
'',
|
|
117
|
-
'Alternative Agents',
|
|
118
|
-
'+------------+------------+-------------------------------------+',
|
|
119
|
-
'| Agent Type | Confidence | Reason |',
|
|
120
|
-
'+------------+------------+-------------------------------------+',
|
|
121
|
-
'| researcher | 60.0% | Alternative agent for researcher... |',
|
|
122
|
-
'| tester | 50.0% | Alternative agent for tester cap... |',
|
|
123
|
-
'+------------+------------+-------------------------------------+',
|
|
124
|
-
'',
|
|
125
|
-
'Estimated Metrics',
|
|
126
|
-
' - Success Probability: 70.0%',
|
|
127
|
-
' - Estimated Duration: 10-30 min',
|
|
128
|
-
' - Complexity: LOW',
|
|
129
147
|
];
|
|
130
148
|
console.log(output.join('\n'));
|
|
131
149
|
} else {
|
|
@@ -134,8 +152,12 @@ const handlers = {
|
|
|
134
152
|
},
|
|
135
153
|
|
|
136
154
|
'pre-bash': () => {
|
|
137
|
-
// Basic command safety check — prefer stdin command data from Claude Code
|
|
138
|
-
|
|
155
|
+
// Basic command safety check — prefer stdin command data from Claude Code.
|
|
156
|
+
// String() wrap is belt-and-suspenders for #2017: even if a future regression
|
|
157
|
+
// re-binds `prompt` or `hookInput.command` to a non-string, `.toLowerCase()`
|
|
158
|
+
// can no longer throw a TypeError that the global try/catch would swallow
|
|
159
|
+
// (silently exiting 0 and letting the dangerous command through).
|
|
160
|
+
const cmd = String(hookInput.command || toolInput.command || prompt || '').toLowerCase();
|
|
139
161
|
const dangerous = ['rm -rf /', 'format c:', 'del /s /q c:\\', ':(){:|:&};:'];
|
|
140
162
|
for (const d of dangerous) {
|
|
141
163
|
if (cmd.includes(d)) {
|
|
@@ -154,7 +176,7 @@ const handlers = {
|
|
|
154
176
|
// Record edit for intelligence consolidation — prefer stdin data from Claude Code
|
|
155
177
|
if (intelligence && intelligence.recordEdit) {
|
|
156
178
|
try {
|
|
157
|
-
const file = hookInput.file_path ||
|
|
179
|
+
const file = hookInput.file_path || toolInput.file_path
|
|
158
180
|
|| process.env.TOOL_INPUT_file_path || args[0] || '';
|
|
159
181
|
intelligence.recordEdit(file);
|
|
160
182
|
} catch (e) { /* non-fatal */ }
|
|
@@ -162,7 +184,7 @@ const handlers = {
|
|
|
162
184
|
console.log('[OK] Edit recorded');
|
|
163
185
|
},
|
|
164
186
|
|
|
165
|
-
'session-restore': () => {
|
|
187
|
+
'session-restore': async () => {
|
|
166
188
|
if (session) {
|
|
167
189
|
// Try restore first, fall back to start
|
|
168
190
|
const existing = session.restore && session.restore();
|
|
@@ -186,26 +208,22 @@ const handlers = {
|
|
|
186
208
|
console.log('| Memory Entries | 0 |');
|
|
187
209
|
console.log('+----------------+-------+');
|
|
188
210
|
}
|
|
189
|
-
// Initialize intelligence graph after session restore
|
|
211
|
+
// Initialize intelligence graph after session restore (with timeout — #1530)
|
|
190
212
|
if (intelligence && intelligence.init) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
} catch (e) { /* non-fatal */ }
|
|
213
|
+
const initResult = await runWithTimeout(() => intelligence.init(), 'intelligence.init()');
|
|
214
|
+
if (initResult && initResult.nodes > 0) {
|
|
215
|
+
console.log(`[INTELLIGENCE] Loaded ${initResult.nodes} patterns, ${initResult.edges} edges`);
|
|
216
|
+
}
|
|
197
217
|
}
|
|
198
218
|
},
|
|
199
219
|
|
|
200
|
-
'session-end': () => {
|
|
201
|
-
// Consolidate intelligence before ending session
|
|
220
|
+
'session-end': async () => {
|
|
221
|
+
// Consolidate intelligence before ending session (with timeout — #1530)
|
|
202
222
|
if (intelligence && intelligence.consolidate) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
} catch (e) { /* non-fatal */ }
|
|
223
|
+
const consResult = await runWithTimeout(() => intelligence.consolidate(), 'intelligence.consolidate()');
|
|
224
|
+
if (consResult && consResult.entries > 0) {
|
|
225
|
+
console.log(`[INTELLIGENCE] Consolidated: ${consResult.entries} entries, ${consResult.edges} edges${consResult.newEntries > 0 ? `, ${consResult.newEntries} new` : ''}, PageRank recomputed`);
|
|
226
|
+
}
|
|
209
227
|
}
|
|
210
228
|
if (session && session.end) {
|
|
211
229
|
session.end();
|
|
@@ -249,7 +267,7 @@ const handlers = {
|
|
|
249
267
|
// Execute the handler
|
|
250
268
|
if (command && handlers[command]) {
|
|
251
269
|
try {
|
|
252
|
-
handlers[command]();
|
|
270
|
+
await Promise.resolve(handlers[command]());
|
|
253
271
|
} catch (e) {
|
|
254
272
|
// Hooks should never crash Claude Code - fail silently
|
|
255
273
|
console.log(`[WARN] Hook ${command} encountered an error: ${e.message}`);
|
|
@@ -267,5 +285,6 @@ const handlers = {
|
|
|
267
285
|
process.exitCode = 0;
|
|
268
286
|
main().catch((e) => {
|
|
269
287
|
try { console.log(`[WARN] Hook handler error: ${e.message}`); } catch (_) {}
|
|
270
|
-
|
|
288
|
+
}).finally(() => {
|
|
289
|
+
process.exit(0);
|
|
271
290
|
});
|