agentic-qe 3.14.7 → 3.14.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/helpers/.helpers-version +1 -1
- package/.claude/helpers/auto-memory-hook.mjs +18 -9
- package/.claude/helpers/helpers.manifest.json +6 -5
- package/.claude/helpers/hook-handler.cjs +40 -12
- package/.claude/helpers/memory.cjs +86 -0
- package/.claude/helpers/router.cjs +105 -0
- package/.claude/helpers/session.cjs +166 -0
- package/.claude/helpers/statusline.cjs +73 -621
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +130 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/adapters/a2a/notifications/retry-queue.js +5 -0
- package/dist/adapters/claude-flow/pretrain-bridge.js +3 -2
- package/dist/agents/claim-verifier/verifiers/file-verifier.js +3 -2
- package/dist/cli/bundle.js +6 -6
- package/dist/cli/chunks/adapter-XYCOXQCC.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-AK2W76RG.js → agent-booster-wasm-67OKGDGZ.js} +2 -2
- package/dist/cli/chunks/{agent-handler-MGZCWHIY.js → agent-handler-4HZEQ3WQ.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-JZ54MCSP.js → agent-memory-branch-IBHZQSRN.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-DTJCROTG.js +2 -0
- package/dist/cli/chunks/{arena-CUVH3V7H.js → arena-EJBIGSF4.js} +2 -2
- package/dist/cli/chunks/{arena-YSWTKBCL.js → arena-LCLRGUIK.js} +4 -4
- package/dist/cli/chunks/{audit-LVU76QGA.js → audit-PY4JNDQQ.js} +3 -3
- package/dist/cli/chunks/base-5TQ34GMD.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-DB3LOJQU.js → better-sqlite3-2JG5K6XT.js} +2 -2
- package/dist/cli/chunks/{brain-handler-SD63KOQ6.js → brain-handler-3UYK55GA.js} +4 -4
- package/dist/cli/chunks/{branch-enumerator-4MNOPUC7.js → branch-enumerator-GOSWOX46.js} +2 -2
- package/dist/cli/chunks/{browser-OLPNTWQE.js → browser-DC2JV47Z.js} +2 -2
- package/dist/cli/chunks/browser-workflow-KWX4ESTJ.js +2 -0
- package/dist/cli/chunks/{chunk-QQFQDEUE.js → chunk-25EEIAHS.js} +2 -2
- package/dist/cli/chunks/{chunk-DOBKEXMJ.js → chunk-3576QGPP.js} +1 -1
- package/dist/cli/chunks/{chunk-3M7J4U74.js → chunk-3EKG7HFV.js} +4 -4
- package/dist/cli/chunks/{chunk-DYTQHRUS.js → chunk-3FCHH4VP.js} +1 -1
- package/dist/cli/chunks/{chunk-EJ6MMYLK.js → chunk-3S5IIK32.js} +1 -1
- package/dist/cli/chunks/{chunk-NOHWJOBS.js → chunk-3X2JSW3R.js} +1 -1
- package/dist/cli/chunks/{chunk-7EZ2Z2CK.js → chunk-4HXFPBAA.js} +1 -1
- package/dist/cli/chunks/{chunk-XBYQ2BS4.js → chunk-4PY44TKH.js} +2 -2
- package/dist/cli/chunks/{chunk-5FSLMYAC.js → chunk-4RNCVSVN.js} +2 -2
- package/dist/cli/chunks/{chunk-X7ADKL7T.js → chunk-56M4QNXU.js} +2 -2
- package/dist/cli/chunks/{chunk-JHJUSSAU.js → chunk-5X4HDW5W.js} +2 -2
- package/dist/cli/chunks/{chunk-7MIOK72I.js → chunk-673XJBGW.js} +7 -7
- package/dist/cli/chunks/{chunk-77QZHIVX.js → chunk-6F7MFHTY.js} +2 -2
- package/dist/cli/chunks/{chunk-Q6NTEICT.js → chunk-6GJWT2OY.js} +2 -2
- package/dist/cli/chunks/{chunk-GV4DYPJP.js → chunk-6GNWVPMR.js} +2 -2
- package/dist/cli/chunks/{chunk-V5AK56DA.js → chunk-6VTC3OHD.js} +2 -2
- package/dist/cli/chunks/{chunk-MM56VPNE.js → chunk-775WGWLL.js} +3 -3
- package/dist/cli/chunks/{chunk-A3DK3XNZ.js → chunk-77WL5HQW.js} +1 -1
- package/dist/cli/chunks/chunk-7STWD4KJ.js +3 -0
- package/dist/cli/chunks/{chunk-RC2A4JZ5.js → chunk-7TNCEVWX.js} +2 -2
- package/dist/cli/chunks/{chunk-XL5KIYE3.js → chunk-7X3LMTRA.js} +2 -2
- package/dist/cli/chunks/{chunk-VW6FRMLW.js → chunk-A53MMSGC.js} +2 -2
- package/dist/cli/chunks/{chunk-UFSVUBTR.js → chunk-A5CLVZC3.js} +2 -2
- package/dist/cli/chunks/{chunk-4INST4ZL.js → chunk-AEYJ4ZLA.js} +1 -1
- package/dist/cli/chunks/{chunk-5U6N4V5M.js → chunk-AJ5PCJQ2.js} +4 -4
- package/dist/cli/chunks/{chunk-OAZX6WFU.js → chunk-AJMAKUS3.js} +2 -2
- package/dist/cli/chunks/{chunk-74IOEOMH.js → chunk-AOD2ES44.js} +2 -2
- package/dist/cli/chunks/chunk-AR2S4DOB.js +2 -0
- package/dist/cli/chunks/{chunk-PYKY22GC.js → chunk-AUFV2G2J.js} +5 -5
- package/dist/cli/chunks/{chunk-KD2BLA5Y.js → chunk-B2QKBQYD.js} +1 -1
- package/dist/cli/chunks/{chunk-6EGS77BB.js → chunk-BCCSV3RH.js} +1 -1
- package/dist/cli/chunks/{chunk-JOZ47MV6.js → chunk-BFIXUKOR.js} +1 -1
- package/dist/cli/chunks/chunk-BHPTHC5O.js +4 -0
- package/dist/cli/chunks/{chunk-OIDWDGLG.js → chunk-BITFGVZ4.js} +2 -2
- package/dist/cli/chunks/{chunk-ONR2NXXD.js → chunk-BL6273KR.js} +3 -3
- package/dist/cli/chunks/{chunk-BLG7SH4A.js → chunk-BOIUENWW.js} +1 -1
- package/dist/cli/chunks/{chunk-T77GZF4B.js → chunk-BT3MI2BW.js} +1 -1
- package/dist/cli/chunks/{chunk-UYUJT6QO.js → chunk-BTBJ2NLH.js} +2 -2
- package/dist/cli/chunks/{chunk-YMW57PEL.js → chunk-BUVJIVFG.js} +1 -1
- package/dist/cli/chunks/{chunk-QUORH2MG.js → chunk-BZIPW2PA.js} +8 -8
- package/dist/cli/chunks/{chunk-GVVFTFMB.js → chunk-C647D42G.js} +2 -2
- package/dist/cli/chunks/{chunk-AJUBT4NP.js → chunk-CBWM5NOO.js} +3 -3
- package/dist/cli/chunks/{chunk-F2OPFVQH.js → chunk-CIEXUYY7.js} +1 -1
- package/dist/cli/chunks/{chunk-QGOWNVVG.js → chunk-CLUHGBLN.js} +4 -4
- package/dist/cli/chunks/{chunk-WOV6XI3A.js → chunk-CQEWL32R.js} +1 -1
- package/dist/cli/chunks/{chunk-3QJU4Q4R.js → chunk-CXUC7YKA.js} +2 -2
- package/dist/cli/chunks/{chunk-HZY42OVU.js → chunk-D2Y36V5J.js} +2 -2
- package/dist/cli/chunks/{chunk-WF6UISKW.js → chunk-DSJJHPPS.js} +4 -4
- package/dist/cli/chunks/{chunk-FYPX5WBJ.js → chunk-DZHXCOSK.js} +1 -1
- package/dist/cli/chunks/{chunk-TXSPBLBT.js → chunk-EBV3WFIR.js} +2 -2
- package/dist/cli/chunks/{chunk-Y6AKKQIQ.js → chunk-EKO5QL2B.js} +1 -1
- package/dist/cli/chunks/{chunk-MZB2UV2O.js → chunk-EMOZ5O5S.js} +1 -1
- package/dist/cli/chunks/{chunk-23CX7JNL.js → chunk-ES7TAJRJ.js} +2 -2
- package/dist/cli/chunks/{chunk-Z4Q5PCRZ.js → chunk-EXQGHTPD.js} +4 -4
- package/dist/cli/chunks/{chunk-A2VUCUTT.js → chunk-F2WAB4WK.js} +2 -2
- package/dist/cli/chunks/{chunk-CQNMGK6Y.js → chunk-F57FTFWS.js} +2 -2
- package/dist/cli/chunks/{chunk-OEPNNLR4.js → chunk-F6JJNBE5.js} +1 -1
- package/dist/cli/chunks/{chunk-UBJG3IHT.js → chunk-FRC7AFB4.js} +2 -2
- package/dist/cli/chunks/{chunk-2G63VIJE.js → chunk-G36RZF2Y.js} +1 -1
- package/dist/cli/chunks/{chunk-YRHTQZU4.js → chunk-G3C7Z6FO.js} +2 -2
- package/dist/cli/chunks/{chunk-B4I43GE2.js → chunk-GA63ESNT.js} +2 -2
- package/dist/cli/chunks/{chunk-7QYOTUOX.js → chunk-GHMJFICO.js} +2 -2
- package/dist/cli/chunks/{chunk-HYOPJHHW.js → chunk-GK5WLUX3.js} +1 -1
- package/dist/cli/chunks/{chunk-A5MA7A23.js → chunk-GQJ4QDEN.js} +6 -6
- package/dist/cli/chunks/{chunk-UA7TDVL7.js → chunk-GVLRE3BV.js} +4 -4
- package/dist/cli/chunks/{chunk-25P6JA6V.js → chunk-H5UH234L.js} +1 -1
- package/dist/cli/chunks/{chunk-BE4KALTE.js → chunk-HBAFXWSO.js} +1 -1
- package/dist/cli/chunks/{chunk-EGOIIUBD.js → chunk-HE3BDBAO.js} +2 -2
- package/dist/cli/chunks/{chunk-P2UPYSDJ.js → chunk-HHANMCD2.js} +1 -1
- package/dist/cli/chunks/{chunk-ZUOVNFXK.js → chunk-HPVYJ6JH.js} +2 -2
- package/dist/cli/chunks/{chunk-RKI3IQKQ.js → chunk-I6NZFBT3.js} +3 -3
- package/dist/cli/chunks/{chunk-QVH5Y7AP.js → chunk-ISBOHF6Y.js} +1 -1
- package/dist/cli/chunks/{chunk-IWFFO6VT.js → chunk-J24AJEDE.js} +2 -2
- package/dist/cli/chunks/{chunk-5GFKTJ65.js → chunk-J5HTQHJK.js} +2 -2
- package/dist/cli/chunks/{chunk-LY7MFGBD.js → chunk-JDOVO4E4.js} +150 -149
- package/dist/cli/chunks/chunk-JQAJUXRE.js +2 -0
- package/dist/cli/chunks/{chunk-HXXHMLJ5.js → chunk-JRK5GX56.js} +1 -1
- package/dist/cli/chunks/{chunk-36VKMAMN.js → chunk-JRLZ7LZ3.js} +2 -2
- package/dist/cli/chunks/{chunk-6PJPQGF4.js → chunk-JTOFLDU7.js} +2 -2
- package/dist/cli/chunks/{chunk-CVOQ6ESD.js → chunk-K6EOHGKS.js} +2 -2
- package/dist/cli/chunks/{chunk-LU2EDWQK.js → chunk-KKXH25IH.js} +2 -2
- package/dist/cli/chunks/{chunk-EYXE2XKP.js → chunk-KNSQWM2E.js} +2 -2
- package/dist/cli/chunks/{chunk-IEJ7ZV3M.js → chunk-L5T32SRF.js} +1 -1
- package/dist/cli/chunks/{chunk-BEFTQVEW.js → chunk-LKFBW2QM.js} +2 -2
- package/dist/cli/chunks/{chunk-C3FXFU2T.js → chunk-LMAI74EP.js} +1 -1
- package/dist/cli/chunks/{chunk-P7XSPP5D.js → chunk-LQVS5IWH.js} +2 -2
- package/dist/cli/chunks/{chunk-4EKV7PHB.js → chunk-LRGTPUJA.js} +2 -2
- package/dist/cli/chunks/{chunk-MT7UNBZ7.js → chunk-LTHV4PIG.js} +2 -2
- package/dist/cli/chunks/{chunk-B2YGVSOP.js → chunk-M7QKCHLQ.js} +2 -2
- package/dist/cli/chunks/{chunk-H5RQPO3X.js → chunk-N3ASALOL.js} +2 -2
- package/dist/cli/chunks/{chunk-MQZ53OR3.js → chunk-NEXBTLN6.js} +2 -2
- package/dist/cli/chunks/{chunk-BD7FEUN3.js → chunk-NJEEKYEP.js} +3 -3
- package/dist/cli/chunks/{chunk-UOI6ULCH.js → chunk-NWUFTLSF.js} +2 -2
- package/dist/cli/chunks/{chunk-RT6O2HW2.js → chunk-O4QB2GFL.js} +2 -2
- package/dist/cli/chunks/{chunk-MZMG6CUJ.js → chunk-OA75C4HY.js} +2 -2
- package/dist/cli/chunks/{chunk-HYFQUWNB.js → chunk-OVMG6EEF.js} +2 -2
- package/dist/cli/chunks/{chunk-FSSR6WBE.js → chunk-OX7MJFLC.js} +2 -2
- package/dist/cli/chunks/{chunk-ENK44A6Q.js → chunk-OZJQN7YE.js} +2 -2
- package/dist/cli/chunks/{chunk-LXZMP3VX.js → chunk-PFXCRRR6.js} +25 -25
- package/dist/cli/chunks/{chunk-WIH522AP.js → chunk-PVJLQ2YZ.js} +1 -1
- package/dist/cli/chunks/{chunk-ZUB5YOCM.js → chunk-QDRFLM77.js} +2 -2
- package/dist/cli/chunks/{chunk-NHUGHAY6.js → chunk-QH7C4PTX.js} +1 -1
- package/dist/cli/chunks/{chunk-VXKWNRGA.js → chunk-QKM4XT2F.js} +2 -2
- package/dist/cli/chunks/{chunk-ON2UTP2U.js → chunk-QP7EKLWU.js} +2 -2
- package/dist/cli/chunks/{chunk-KUHLTVWC.js → chunk-QPACHVDI.js} +1 -1
- package/dist/cli/chunks/{chunk-PCJQCEBA.js → chunk-QQVE65ER.js} +2 -2
- package/dist/cli/chunks/{chunk-Q3NSU24F.js → chunk-QYCZYJH7.js} +2 -2
- package/dist/cli/chunks/{chunk-AEUEMVJK.js → chunk-R6I5I724.js} +2 -2
- package/dist/cli/chunks/{chunk-5D7ZFWDS.js → chunk-RJJIPTVH.js} +2 -2
- package/dist/cli/chunks/{chunk-ZWEKAEEV.js → chunk-RM6OC35G.js} +1 -1
- package/dist/cli/chunks/{chunk-ZELWDJXT.js → chunk-RTD4U7IW.js} +2 -2
- package/dist/cli/chunks/{chunk-O5V7RHVG.js → chunk-SKJQKOFJ.js} +2 -2
- package/dist/cli/chunks/{chunk-6RD44SCE.js → chunk-SMBGK7XI.js} +1 -1
- package/dist/cli/chunks/{chunk-ND4QTZOL.js → chunk-SPS472C5.js} +2 -2
- package/dist/cli/chunks/{chunk-TFK2AYIN.js → chunk-SUNXA2UR.js} +2 -2
- package/dist/cli/chunks/{chunk-RDGPXENG.js → chunk-SVP3BP52.js} +2 -2
- package/dist/cli/chunks/{chunk-NBLDBVAW.js → chunk-T4WQPE77.js} +1 -1
- package/dist/cli/chunks/{chunk-ZS4XVJGV.js → chunk-T53ZN4NO.js} +2 -2
- package/dist/cli/chunks/chunk-T6W2EYHC.js +2 -0
- package/dist/cli/chunks/{chunk-JZT7BU44.js → chunk-T7YCNOW5.js} +2 -2
- package/dist/cli/chunks/{chunk-EADSQN5T.js → chunk-TCQWVVSR.js} +1 -1
- package/dist/cli/chunks/{chunk-XYLQZWF6.js → chunk-TGRHO4ES.js} +2 -2
- package/dist/cli/chunks/{chunk-QPLSYEWJ.js → chunk-TP7L4EX6.js} +2 -2
- package/dist/cli/chunks/{chunk-N5XOXPHZ.js → chunk-TT45RCLN.js} +2 -2
- package/dist/cli/chunks/{chunk-OZGIOKEA.js → chunk-TUZNWRYC.js} +1 -1
- package/dist/cli/chunks/{chunk-53BXTTRO.js → chunk-U2QTL5T2.js} +3 -3
- package/dist/cli/chunks/chunk-U64QORFO.js +2 -0
- package/dist/cli/chunks/{chunk-SRPLERER.js → chunk-UHLZKH6B.js} +4 -4
- package/dist/cli/chunks/{chunk-HPWWYT67.js → chunk-UIWXKRTK.js} +2 -2
- package/dist/cli/chunks/{chunk-XWYELBZS.js → chunk-UNFE4RPV.js} +1 -1
- package/dist/cli/chunks/{chunk-FW4DJ4FJ.js → chunk-UQGIC5OX.js} +1 -1
- package/dist/cli/chunks/{chunk-GLGKQX2V.js → chunk-VAXTPLO3.js} +2 -2
- package/dist/cli/chunks/{chunk-VYDVI6FZ.js → chunk-VCSNNLWL.js} +2 -2
- package/dist/cli/chunks/{chunk-J7AQZLIH.js → chunk-VSPNIDQK.js} +4 -4
- package/dist/cli/chunks/{chunk-EIGRV3J6.js → chunk-VV2JVYOI.js} +2 -2
- package/dist/cli/chunks/{chunk-CBONQM5D.js → chunk-VW7AXJQS.js} +2 -2
- package/dist/cli/chunks/{chunk-O6MO5KMR.js → chunk-W7JUD4EZ.js} +2 -2
- package/dist/cli/chunks/{chunk-QFETNCNN.js → chunk-WFKE7NZ5.js} +2 -2
- package/dist/cli/chunks/{chunk-ROVZSZCS.js → chunk-WVEHKAIH.js} +3 -3
- package/dist/cli/chunks/{chunk-YO4ESCB4.js → chunk-XAESN54Q.js} +1 -1
- package/dist/cli/chunks/{chunk-RKUAWQOF.js → chunk-XECZYQT5.js} +2 -2
- package/dist/cli/chunks/{chunk-RLW25X66.js → chunk-XFT4FYTC.js} +2 -2
- package/dist/cli/chunks/{chunk-SM2YJ2AL.js → chunk-YHX74M7C.js} +2 -2
- package/dist/cli/chunks/chunk-YIWBJ637.js +2 -0
- package/dist/cli/chunks/{chunk-IAENZ2DR.js → chunk-Z5UZOYQS.js} +2 -2
- package/dist/cli/chunks/{chunk-G367W7XR.js → chunk-Z6G3QVZ4.js} +12 -12
- package/dist/cli/chunks/ci-5LIV2HW5.js +82 -0
- package/dist/cli/chunks/{ci-output-RLS32FUY.js → ci-output-UO5BDFU4.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-MRCC7WCM.js → circuit-breaker-UQDPXYRD.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-LIZCEKDF.js → claude-flow-setup-62QES3QX.js} +2 -2
- package/dist/cli/chunks/client-AJZKCP4I.js +2 -0
- package/dist/cli/chunks/{cline-installer-T7H6R2RC.js → cline-installer-X7VZTSZG.js} +2 -2
- package/dist/cli/chunks/{code-XMBLI7OF.js → code-H3BF4L4H.js} +3 -3
- package/dist/cli/chunks/{code-index-extractor-QS7BYLEX.js → code-index-extractor-BJGFZGGL.js} +2 -2
- package/dist/cli/chunks/{codex-installer-6PGT5FM6.js → codex-installer-KVZWKU6S.js} +2 -2
- package/dist/cli/chunks/{completions-2A3WRXY2.js → completions-YMILE6V7.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-23HOOGJ7.js → complexity-analyzer-J26N2PWG.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-4FSF7B3N.js → continuedev-installer-MAR42OV7.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-A5GRQQUU.js → copilot-installer-CVOJF6OT.js} +2 -2
- package/dist/cli/chunks/core-handlers-MQHEMGDV.js +2 -0
- package/dist/cli/chunks/{cost-tracker-Z4STQ5VB.js → cost-tracker-SXLWXE55.js} +2 -2
- package/dist/cli/chunks/{coverage-NUPP6KZZ.js → coverage-D7HCHFP3.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-3QNMZV5R.js +2 -0
- package/dist/cli/chunks/{cursor-installer-FVJ7ROPJ.js → cursor-installer-X37VHIKW.js} +2 -2
- package/dist/cli/chunks/{daemon-D662EX5N.js → daemon-JN7SOH6F.js} +4 -4
- package/dist/cli/chunks/{daemon-7ZZA2MMN.js → daemon-LIW47IDM.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-IB4TQ2KA.js → dag-attention-scheduler-QCHHIZBT.js} +2 -2
- package/dist/cli/chunks/{detect-LGLBZN4I.js → detect-WRFCWAX5.js} +2 -2
- package/dist/cli/chunks/{dist-node-Z3OL42YE.js → dist-node-6FWT4XZO.js} +2 -2
- package/dist/cli/chunks/{domain-handler-L3CLNL7U.js → domain-handler-SNFPNMRT.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-GQ3V5X6L.js → domain-plugins-MXKHH62P.js} +2 -2
- package/dist/cli/chunks/domain-transfer-47UJNERX.js +2 -0
- package/dist/cli/chunks/dream-OSWAITPT.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-UGD6USYH.js → embed-and-insert-pattern-LZFAUNBQ.js} +2 -2
- package/dist/cli/chunks/{eval-3B7UIYGY.js → eval-AMUXTMJB.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-3RQ4NYY3.js → experience-capture-middleware-3D65TR2C.js} +4 -4
- package/dist/cli/chunks/{fast-paths-QOSAEPYD.js → fast-paths-Y7BBMM56.js} +2 -2
- package/dist/cli/chunks/{feature-flags-TLF4NKOH.js → feature-flags-JMQQ7JW4.js} +2 -2
- package/dist/cli/chunks/{feature-flags-3S5TH6P4.js → feature-flags-VESRRQ6V.js} +2 -2
- package/dist/cli/chunks/{file-discovery-AEVMJRNB.js → file-discovery-JJKQQUV6.js} +2 -2
- package/dist/cli/chunks/{fleet-E6WTXWFL.js → fleet-WIGHICJF.js} +4 -4
- package/dist/cli/chunks/{gnn-wrapper-MCKH3AUU.js → gnn-wrapper-BFNPETTT.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-U7XENHRR.js → heartbeat-handler-HDXKTGUI.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-BVRVVIE2.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-MZTHXULS.js +2 -0
- package/dist/cli/chunks/hnsw-index-KHEX4VDG.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-5GW4SAEI.js → hnsw-legacy-bridge-6A7OTAPT.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-7BLZBK5T.js → hnswlib-node-LKV2H47B.js} +2 -2
- package/dist/cli/chunks/{hooks-F3O2SB6H.js → hooks-KDSFYQQG.js} +10 -10
- package/dist/cli/chunks/hybrid-backend-2B3LCLR4.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-PV4EKXHB.js → hypergraph-engine-GDLPEPUC.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-VOWO5ZTW.js → hypergraph-handler-4UMFA2EW.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-4R4VWOGQ.js +2 -0
- package/dist/cli/chunks/{init-handler-ENJ5ONJX.js → init-handler-4GCHPQHD.js} +6 -6
- package/dist/cli/chunks/init-wizard-TAOPXHHD.js +2 -0
- package/dist/cli/chunks/kernel-6I6VZUWY.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-HNNJOOPE.js → kilocode-installer-HJZMT2G5.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-UZBIQ3IC.js → kiro-installer-WUPY67HG.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-KFMTTUR5.js +2 -0
- package/dist/cli/chunks/{learning-YMLCVFUT.js → learning-AXKIS7IG.js} +4 -4
- package/dist/cli/chunks/{llm-router-YWTARCCT.js → llm-router-HUDPNZLJ.js} +4 -4
- package/dist/cli/chunks/llm-router-service-2D74XVM3.js +2 -0
- package/dist/cli/chunks/{load-DKE3F3IP.js → load-RM44POD7.js} +2 -2
- package/dist/cli/chunks/load-test-53FWOWNS.js +2 -0
- package/dist/cli/chunks/{mcp-5PSGIUCW.js → mcp-5JVQRBOP.js} +2 -2
- package/dist/cli/chunks/{memory-3L3O6JMM.js → memory-VGZ2V6PL.js} +5 -5
- package/dist/cli/chunks/memory-backend-KFJDDPEZ.js +2 -0
- package/dist/cli/chunks/memory-handlers-EI537Z32.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-AEEO7IA4.js → multi-model-executor-WPRKCSCM.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-ABBO355U.js → opencode-installer-YAJMRCQO.js} +2 -2
- package/dist/cli/chunks/{orchestrator-E36Q7MKE.js → orchestrator-MUGWBUYP.js} +6 -6
- package/dist/cli/chunks/pattern-null-store-7DMU5CJ4.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-H4XKSID4.js → pattern-usage-recorder-ZQJJ2YNG.js} +2 -2
- package/dist/cli/chunks/{pipeline-BGFEHXIN.js → pipeline-F4DXDUDC.js} +2 -2
- package/dist/cli/chunks/{platform-GK7ZVDJI.js → platform-HI3A3OWF.js} +2 -2
- package/dist/cli/chunks/{plugin-CAH2CKI6.js → plugin-XRITPTR7.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-M5EYRONA.js → prime-radiant-advanced-wasm-HHNJP7CQ.js} +2 -2
- package/dist/cli/chunks/{project-root-BSNZC243.js → project-root-2VN4WO2A.js} +2 -2
- package/dist/cli/chunks/protocol-executor-2EMTBTMG.js +2 -0
- package/dist/cli/chunks/{protocol-handler-JDSSC2SF.js → protocol-handler-ZEVHSEBG.js} +2 -2
- package/dist/cli/chunks/{prove-ANPTOZJE.js → prove-C4BLZWBS.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-VZHZZPHE.js +2 -0
- package/dist/cli/chunks/{quality-SXWGYRQR.js → quality-M3DTE4KK.js} +2 -2
- package/dist/cli/chunks/quality-gate-V6KS7ML3.js +7 -0
- package/dist/cli/chunks/queen-coordinator-7MYTTUHI.js +2 -0
- package/dist/cli/chunks/{real-embeddings-WSRYAOZM.js → real-embeddings-YWSE3IRT.js} +2 -2
- package/dist/cli/chunks/{ref-validation-AZ3LRWEK.js → ref-validation-ZWOTFA3T.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-2QKGFIEU.js → roocode-installer-GJBIWETD.js} +2 -2
- package/dist/cli/chunks/router-ZD4LXAWA.js +2 -0
- package/dist/cli/chunks/routing-feedback-FSLMDVGD.js +2 -0
- package/dist/cli/chunks/{routing-handler-UYDC5MMD.js → routing-handler-CFYLGNAR.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-QXADPVEY.js → ruvector-commands-EDKG456B.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-LTKTDRFS.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-IF24EVC5.js +2 -0
- package/dist/cli/chunks/{rvf-migration-coordinator-GD4NBFKT.js → rvf-migration-coordinator-ZMEYMAI6.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-E6JNBKMZ.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-7SXG66IL.js → rvf-store-integrity-AH6PNJP6.js} +2 -2
- package/dist/cli/chunks/safe-db-F6TRB5KZ.js +2 -0
- package/dist/cli/chunks/schedule-HBD4BYTE.js +2 -0
- package/dist/cli/chunks/scheduler-6FYWPMQC.js +2 -0
- package/dist/cli/chunks/{security-YKB622PK.js → security-ZU2GW3ZM.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-KMLAV7JK.js → shared-rvf-adapter-5FOVSL3T.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-OYY27DFV.js → shared-rvf-dual-writer-IO4DC4XV.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-DOU72F5Z.js +2 -0
- package/dist/cli/chunks/{standalone-memory-2DOABVLC.js → standalone-memory-3UXDZ7HI.js} +2 -2
- package/dist/cli/chunks/{status-handler-EXRKETV7.js → status-handler-264CHTWS.js} +2 -2
- package/dist/cli/chunks/{structural-health-2SKK6DU6.js → structural-health-E2QPUOZE.js} +2 -2
- package/dist/cli/chunks/{sync-UW7SX7GO.js → sync-2ACMWM7D.js} +2 -2
- package/dist/cli/chunks/{sync-DQ2YUNI6.js → sync-N2L2OST4.js} +2 -2
- package/dist/cli/chunks/{task-handler-LYQ6WYUY.js → task-handler-IB5CVOTY.js} +2 -2
- package/dist/cli/chunks/{task-handlers-DIJO232S.js → task-handlers-QBMYNJHE.js} +3 -3
- package/dist/cli/chunks/{test-WRHZMUCW.js → test-7RGLRDSP.js} +6 -6
- package/dist/cli/chunks/{test-scheduling-HI23RXFK.js → test-scheduling-RJABJT2W.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-23SA6SWZ.js → token-bootstrap-JVHMHB72.js} +2 -2
- package/dist/cli/chunks/{token-usage-M7RRDPXO.js → token-usage-3ECHQVCY.js} +2 -2
- package/dist/cli/chunks/{transformers-4TC35KKS.js → transformers-KJH3IJWI.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-F4LTKAWD.js → tree-sitter-wasm-parser-XN6PFI32.js} +2 -2
- package/dist/cli/chunks/{types-NBXV6LXQ.js → types-5BAPXOLS.js} +2 -2
- package/dist/cli/chunks/unified-memory-GHAYAXWZ.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-CCC63YXT.js +2 -0
- package/dist/cli/chunks/unified-persistence-HKRHI5PG.js +2 -0
- package/dist/cli/chunks/{upgrade-4BGOU5RM.js → upgrade-S5NFQZID.js} +2 -2
- package/dist/cli/chunks/{validate-EDWAR63H.js → validate-BIBWOLJD.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-VI72CPR7.js → validate-swarm-WAA3LBHH.js} +2 -2
- package/dist/cli/chunks/visual-security-APOXJ3Q3.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-Y5XBRQXF.js → web-tree-sitter-OTBQTHAV.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-VEX23WAF.js → windsurf-installer-NNQ22EW6.js} +2 -2
- package/dist/cli/chunks/witness-chain-7IP5IJGT.js +2 -0
- package/dist/cli/chunks/{witness-chain-3YNL6YGY.js → witness-chain-E7MUBOJW.js} +2 -2
- package/dist/cli/chunks/{witness-chain-repair-MJZGZRWT.js → witness-chain-repair-FW4QSN4C.js} +2 -2
- package/dist/cli/chunks/{witness-chain-verifier-TTJYXTBE.js → witness-chain-verifier-YMROEBVL.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-EM6YXYOY.js → witness-key-manager-4CGRNDMJ.js} +2 -2
- package/dist/cli/chunks/{workflow-2RBDOM7V.js → workflow-4VRSTRAN.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-2HNW5ZMQ.js +2 -0
- package/dist/cli/chunks/{wrappers-5OTAVVOV.js → wrappers-4M4UTGEU.js} +2 -2
- package/dist/cli/commands/ci.js +17 -6
- package/dist/cli/commands/quality-gate.js +6 -1
- package/dist/cli/index.js +7 -2
- package/dist/cli/process-store-cleanup.d.ts +7 -0
- package/dist/cli/process-store-cleanup.js +27 -0
- package/dist/cli/utils/ci-config.d.ts +3 -3
- package/dist/cli/utils/ci-config.js +202 -68
- package/dist/domains/quality-assessment/quality-evidence.d.ts +3 -1
- package/dist/domains/quality-assessment/quality-evidence.js +7 -2
- package/dist/domains/test-execution/services/retry-handler.js +32 -13
- package/dist/domains/test-execution/services/test-executor.d.ts +3 -3
- package/dist/domains/test-execution/services/test-executor.js +66 -22
- package/dist/init/fleet-integration.js +3 -2
- package/dist/init/init-wizard-steps.js +3 -2
- package/dist/init/phases/06-code-intelligence.js +6 -4
- package/dist/integrations/ruvector/sona-persistence.d.ts +1 -0
- package/dist/integrations/ruvector/sona-persistence.js +74 -20
- package/dist/integrations/ruvector/sona-wrapper.d.ts +2 -0
- package/dist/integrations/ruvector/sona-wrapper.js +13 -0
- package/dist/kernel/memory-backend.js +5 -4
- package/dist/kernel/unified-memory.js +3 -2
- package/dist/learning/aqe-learning-engine.js +3 -2
- package/dist/mcp/bundle.js +440 -439
- package/dist/mcp/connection-pool.d.ts +2 -0
- package/dist/mcp/connection-pool.js +13 -2
- package/dist/mcp/handlers/memory-handlers.d.ts +1 -0
- package/dist/mcp/handlers/memory-handlers.js +16 -6
- package/dist/mcp/protocol-server.js +29 -8
- package/dist/mcp/types.d.ts +2 -0
- package/dist/optimization/session-cache.js +13 -11
- package/dist/plugins/cache.js +10 -3
- package/dist/shared/embeddings/embedding-cache.js +4 -4
- package/dist/shared/llm/cache.js +7 -10
- package/dist/shared/retry-engine.js +4 -0
- package/dist/shared/test-runner-process.d.ts +10 -0
- package/dist/shared/test-runner-process.js +210 -0
- package/dist/validation/quality-verdict.js +3 -2
- package/dist/workers/quality-daemon/priority-queue.js +4 -1
- package/package.json +4 -4
- package/dist/cli/chunks/adapter-TVQKH65T.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-ULGTVVWE.js +0 -2
- package/dist/cli/chunks/base-W42BURDL.js +0 -2
- package/dist/cli/chunks/browser-workflow-HKGHFFFT.js +0 -2
- package/dist/cli/chunks/chunk-2IMSJ7IO.js +0 -2
- package/dist/cli/chunks/chunk-FBZC4IGB.js +0 -2
- package/dist/cli/chunks/chunk-MNQN7UZX.js +0 -4
- package/dist/cli/chunks/chunk-OXHF3L2T.js +0 -2
- package/dist/cli/chunks/chunk-PELENDDQ.js +0 -2
- package/dist/cli/chunks/chunk-TW3SR4TS.js +0 -2
- package/dist/cli/chunks/chunk-V6RE4YRQ.js +0 -2
- package/dist/cli/chunks/chunk-ZQZD55MN.js +0 -3
- package/dist/cli/chunks/ci-J3TDK5RA.js +0 -81
- package/dist/cli/chunks/client-3BD2DI4N.js +0 -2
- package/dist/cli/chunks/core-handlers-C3H2ZCS2.js +0 -2
- package/dist/cli/chunks/cross-domain-router-JCQ7SWDP.js +0 -2
- package/dist/cli/chunks/domain-transfer-MFCI76IY.js +0 -2
- package/dist/cli/chunks/dream-FTP33IJB.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-HXBJVJL2.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-TU6WG2ME.js +0 -2
- package/dist/cli/chunks/hnsw-index-MS5KODD7.js +0 -2
- package/dist/cli/chunks/hybrid-backend-HT45LBHC.js +0 -2
- package/dist/cli/chunks/impact-analyzer-AP4AGTG5.js +0 -2
- package/dist/cli/chunks/init-wizard-I5DFZUQL.js +0 -2
- package/dist/cli/chunks/kernel-MISPSPPA.js +0 -2
- package/dist/cli/chunks/knowledge-graph-L26JESGE.js +0 -2
- package/dist/cli/chunks/llm-router-service-MWGC43ZA.js +0 -2
- package/dist/cli/chunks/load-test-H5ISNNM5.js +0 -2
- package/dist/cli/chunks/memory-backend-HWDNOBKW.js +0 -2
- package/dist/cli/chunks/memory-handlers-ZFDVQZM5.js +0 -2
- package/dist/cli/chunks/pattern-null-store-GQP6ICWK.js +0 -2
- package/dist/cli/chunks/protocol-executor-AD5A4DAI.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-W3Z2PKTR.js +0 -2
- package/dist/cli/chunks/quality-gate-GYNCA4ZY.js +0 -7
- package/dist/cli/chunks/queen-coordinator-HQRHLIJX.js +0 -2
- package/dist/cli/chunks/router-MTP5LH4H.js +0 -2
- package/dist/cli/chunks/routing-feedback-GWETVB4L.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-4UE5S7WP.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-PHH3HF4Q.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-KTLZBUWV.js +0 -2
- package/dist/cli/chunks/safe-db-FWWGAPVE.js +0 -2
- package/dist/cli/chunks/schedule-TPA4V4D5.js +0 -2
- package/dist/cli/chunks/scheduler-5ZTEPNDD.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-HPTT624C.js +0 -2
- package/dist/cli/chunks/unified-memory-OVFEPRPS.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-KKRSCZHR.js +0 -2
- package/dist/cli/chunks/unified-persistence-7GLR4RI3.js +0 -2
- package/dist/cli/chunks/visual-security-2FUM5GLI.js +0 -2
- package/dist/cli/chunks/witness-chain-MH6GA5L6.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-H6G65YKU.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.
|
|
2
|
-
import{
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.8");process.exit(0)}
|
|
2
|
+
import{b as h,c as $}from"./chunk-Z5UZOYQS.js";import{a as b,b as y,c as R,e as S,f as A}from"./chunk-BOIUENWW.js";import{e as N,f as w}from"./chunk-4PY44TKH.js";import{a as g,f as C}from"./chunk-XAESN54Q.js";$();var i=null,f=!1,p=class extends Error{constructor(e){super(e instanceof Error?e.message:String(e));this.lockError=e;this.name="RvfLiveLockError"}lockError};function V(r){i=r,f=r!==null}var B=(()=>{let r=process.env.AQE_RVF_SIZE_GUARD_BYTES,t=r?Number(r):NaN;return Number.isFinite(t)&&t>0?t:256*1024*1024})(),F=(()=>{let r=process.env.AQE_RVF_DEAD_RATIO_THRESHOLD,t=r?Number(r):NaN;return Number.isFinite(t)&&t>0&&t<=1?t:.3})();function k(r=".agentic-qe",t=384){if(f)return i;f=!0;try{let{isRvfNativeAvailable:e,createRvfStore:n,openRvfStore:o}=(w(),C(N));if(!e())return console.warn("[RVF] Native bindings unavailable \u2014 agent branching and dream COW disabled. Install @ruvector/rvf-node to enable."),null;let s=g("path"),l=s.isAbsolute(r)?r:s.join(process.env.AQE_PROJECT_ROOT??h(),r),u=s.join(l,"patterns.rvf");return i=_(o,n,u,t),T(i,u),i}catch(e){return e instanceof p||console.warn("[RVF] Shared adapter init failed:",e instanceof Error?e.message:e),null}}function _(r,t,e,n){let o=()=>{try{return{adapter:r(e),err:null}}catch(a){return{adapter:null,err:a}}},{adapter:s,err:l}=o(),u=!1;if(!s&&R(l))try{let a=g("fs"),c=`${e}.lock`;a.existsSync(c)&&y(e)?(u=!0,console.warn(`[RVF] ${e} is locked by a live process (pid ${b(e)}) \u2014 not breaking the lock; degrading to SQLite for this run.`)):S(e)&&(console.warn(`[RVF] Removed stale lock file at ${c} (prior process exited without closing). Retrying open. If you see this repeatedly under live concurrency, file an issue.`),{adapter:s,err:l}=o())}catch(a){process.env.DEBUG&&console.debug("[RVF] stale-lock recovery failed:",a instanceof Error?a.message:a)}if(u)throw new p(l);if(s){let a=s.dimension();if(a===n)return s;console.warn(`[RVF] patterns.rvf dimension mismatch: file=${a} requested=${n} \u2014 closing and degrading. Delete the .rvf file to recreate at the requested dim.`);try{s.close()}catch{}throw new Error(`RVF dimension mismatch (file=${a}, requested=${n})`)}try{return t(e,n)}catch(a){let c;try{c=r(e)}catch(m){if(R(m))throw m;if(A(e,a instanceof Error?a.message:String(a),m))return t(e,n);throw a instanceof Error?a:new Error(String(a))}let v=c.dimension();if(v!==n){try{c.close()}catch{}throw new Error(`RVF dimension mismatch after race (file=${v}, requested=${n})`)}return c}}function E(r,t){if(t?.force)return{shouldCompact:!0,trigger:"force"};let e=t?.sizeGuardBytes??B,n=t?.deadRatioThreshold??F;return r.fileSizeBytes>=e?{shouldCompact:!0,trigger:"size-guard"}:(r.deadSpaceRatio??0)>=n?{shouldCompact:!0,trigger:"dead-ratio"}:{shouldCompact:!1,trigger:"none"}}function q(r){if(!i)return null;let t;try{t=i.status()}catch{return null}let e=E(t,r);if(!e.shouldCompact)return null;let n=t.fileSizeBytes,o;try{o=i.compact()}catch{return null}return o?((o.bytesReclaimed>0||o.segmentsCompacted>0)&&console.log(`[RVF] compacted patterns.rvf: reclaimed ${d(o.bytesReclaimed)} (${o.segmentsCompacted} segments, fileSize ${d(n)} \u2192 ${d(Math.max(0,n-o.bytesReclaimed))}, trigger: ${e.trigger})`),o):null}function T(r,t){try{let e=r.status(),n=E(e);if(!n.shouldCompact)return null;let o=r.compact();return o&&(o.bytesReclaimed>0||o.segmentsCompacted>0)&&console.log(`[RVF] boot-time compact (${t}): reclaimed ${d(o.bytesReclaimed)} from ${o.segmentsCompacted} segments (trigger: ${n.trigger})`),o}catch(e){return process.env.DEBUG&&console.debug("[RVF] boot-time compact guard skipped:",e instanceof Error?e.message:e),null}}function d(r){if(!Number.isFinite(r)||r<0)return`${r}B`;let t=["B","KB","MB","GB","TB"],e=0,n=r;for(;n>=1024&&e<t.length-1;)n/=1024,e++;return`${n.toFixed(e===0?0:1)}${t[e]}`}function z(){if(i){try{i.close()}catch{}i=null}f=!1}export{p as a,V as b,k as c,_ as d,E as e,q as f,T as g,z as h};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.
|
|
2
|
-
import{a as l}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.8");process.exit(0)}
|
|
2
|
+
import{a as l}from"./chunk-3FCHH4VP.js";import{i as a}from"./chunk-UQGIC5OX.js";import{a as m}from"./chunk-EKO5QL2B.js";var u=class{constructor(t,e){this.eventBus=t;this.maxHistorySize=e?.maxHistorySize??1e4,this.eventHistory=new l(this.maxHistorySize),this.correlationTimeout=e?.correlationTimeout??6e4,this.maxEventsPerCorrelation=e?.maxEventsPerCorrelation??100}eventBus;subscriptions=new Map;correlations=new Map;eventHistory;routes=[];domainSubscriptions=new Map;maxHistorySize;correlationTimeout;maxEventsPerCorrelation;initialized=!1;async initialize(){if(!this.initialized){for(let t of m){let e=this.eventBus.subscribeToChannel(t,async i=>{await this.handleIncomingEvent(i)});this.domainSubscriptions.set(t,e)}this.eventBus.subscribe("*",async t=>{m.includes(t.source)||await this.handleIncomingEvent(t)}),this.initialized=!0}}subscribeToDoamin(t,e){let i=`sub_domain_${a()}`;return this.subscriptions.set(i,{id:i,type:"domain",filter:t,handler:e,active:!0}),i}subscribeToEventType(t,e){let i=`sub_type_${a()}`;return this.subscriptions.set(i,{id:i,type:"eventType",filter:t,handler:e,active:!0}),i}unsubscribe(t){let e=this.subscriptions.get(t);return e?(e.active=!1,this.subscriptions.delete(t),!0):!1}async route(t){this.addToHistory(t),t.correlationId&&this.trackCorrelation(t);let i=this.findMatchingSubscriptions(t).map(async o=>{try{await o.handler(t)}catch(n){console.error(`Error in subscription handler ${o.id}:`,n instanceof Error?n.message:n)}}),r=await this.applyRoutes(t);await Promise.allSettled([...i,...r])}getCorrelation(t){let e=this.correlations.get(t);if(e)return{correlationId:e.correlationId,events:[...e.events],domains:new Set(e.domains),startedAt:e.startedAt,lastEventAt:e.lastEventAt,complete:e.complete}}trackCorrelation(t){if(!t.correlationId)return;let e=this.correlations.get(t.correlationId);e||(e={correlationId:t.correlationId,events:[],domains:new Set,startedAt:t.timestamp,lastEventAt:t.timestamp,complete:!1,timeout:null},this.correlations.set(t.correlationId,e)),e.events.length<this.maxEventsPerCorrelation&&(e.events.push(t),e.domains.add(t.source),e.lastEventAt=t.timestamp),e.timeout&&clearTimeout(e.timeout),e.timeout=setTimeout(()=>{e.complete=!0,e.timeout=null},this.correlationTimeout)}aggregate(t,e){let i=this.eventHistory.toArray().filter(s=>s.timestamp>=t&&s.timestamp<=e),r=new Map,o=new Map;for(let s of i)r.set(s.type,(r.get(s.type)??0)+1),o.set(s.source,(o.get(s.source)??0)+1);let n={totalEvents:i.length,uniqueEventTypes:r.size,uniqueDomains:o.size,eventsPerSecond:i.length>0?i.length/((e.getTime()-t.getTime())/1e3):0};return{id:a(),windowStart:t,windowEnd:e,events:i,countByType:r,countByDomain:o,metrics:n}}getHistory(t){let e=this.eventHistory.toArray();return t&&(t.eventTypes?.length&&(e=e.filter(i=>t.eventTypes.includes(i.type))),t.domains?.length&&(e=e.filter(i=>t.domains.includes(i.source))),t.fromTimestamp&&(e=e.filter(i=>i.timestamp>=t.fromTimestamp)),t.toTimestamp&&(e=e.filter(i=>i.timestamp<=t.toTimestamp)),t.limit&&(e=e.slice(-t.limit))),e}addRoute(t){let e=t.priority??0,i=this.routes.findIndex(r=>(r.priority??0)<e);i===-1?this.routes.push(t):this.routes.splice(i,0,t)}removeRoute(t,e){let i=this.routes.findIndex(r=>r.eventPattern===t&&(e===void 0||r.source===e));return i!==-1?(this.routes.splice(i,1),!0):!1}async dispose(){this.subscriptions.clear();for(let t of this.domainSubscriptions.values())t.unsubscribe();this.domainSubscriptions.clear();for(let t of this.correlations.values())t.timeout&&clearTimeout(t.timeout);this.correlations.clear(),this.eventHistory.clear(),this.initialized=!1}async handleIncomingEvent(t){await this.route(t)}findMatchingSubscriptions(t){let e=[];for(let i of this.subscriptions.values())i.active&&(i.type==="domain"&&i.filter===t.source||i.type==="eventType"&&this.matchEventType(t.type,i.filter))&&e.push(i);return e}matchEventType(t,e){if(e==="*")return!0;let i=e.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${i}$`).test(t)}async applyRoutes(t){let e=[];for(let i of this.routes){if(!(i.source==="*"||i.source===t.source||Array.isArray(i.source)&&i.source.includes(t.source))||!this.matchEventType(t.type,i.eventPattern)||i.filter&&!i.filter(t))continue;let o=i.transform?i.transform(t):t;for(let n of i.targets)n!==t.source&&e.push(this.eventBus.publish({...o,id:a(),correlationId:t.correlationId??t.id}))}return e}addToHistory(t){this.eventHistory.push(t)}};function y(c,t){return new u(c,t)}export{u as a,y as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.
|
|
2
|
-
import{j as c}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.8");process.exit(0)}
|
|
2
|
+
import{j as c}from"./chunk-GK5WLUX3.js";import{b as g,d as E}from"./chunk-BITFGVZ4.js";import{a as p}from"./chunk-U64QORFO.js";import{e as m}from"./chunk-J5HTQHJK.js";import{a as l,b as _}from"./chunk-SPS472C5.js";_();import b from"node:path";import{existsSync as h}from"node:fs";E();p();var T=m.create("metrics-tracker"),d=class{db=null;dbPath;initialized=!1;constructor(e=process.cwd()){this.dbPath=b.join(e,".agentic-qe","memory.db")}async initialize(){if(!this.initialized){if(!h(this.dbPath))throw new Error(`Database not found: ${this.dbPath}. Run "aqe init --auto" first.`);this.db=l(this.dbPath),this.ensureMetricsTable(),this.initialized=!0}}ensureMetricsTable(){this.db&&this.db.exec(`
|
|
3
3
|
CREATE TABLE IF NOT EXISTS learning_daily_snapshots (
|
|
4
4
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
5
5
|
snapshot_date TEXT NOT NULL UNIQUE,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.
|
|
2
|
-
import{c as R,d as j}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.8");process.exit(0)}
|
|
2
|
+
import{c as R,d as j}from"./chunk-TT45RCLN.js";import{a as b}from"./chunk-3X2JSW3R.js";import{b as le}from"./chunk-77WL5HQW.js";import{a as oe,b as ae}from"./chunk-CQEWL32R.js";import{e as ie,f as se}from"./chunk-GK5WLUX3.js";import{b as O,d as Ce}from"./chunk-BITFGVZ4.js";import{a as re}from"./chunk-EKO5QL2B.js";import{a as k,e as P}from"./chunk-HPVYJ6JH.js";var we={M:16,efConstruction:200,efSearch:100},F={enabled:!0,pretrainedPatterns:!0,hnswConfig:we,promotionThreshold:ie,qualityThreshold:se,embeddingModel:"auto"},$={mode:"hybrid",confidenceThreshold:.7,feedbackEnabled:!0,cacheEnabled:!0,cacheTTLMs:300*1e3},L={enabled:["pattern-consolidator","coverage-gap-scanner","flaky-test-detector","routing-accuracy-monitor"],intervals:{"pattern-consolidator":1800*1e3,"coverage-gap-scanner":3600*1e3,"flaky-test-detector":7200*1e3,"routing-accuracy-monitor":900*1e3},maxConcurrent:4,daemonAutoStart:!0},M={claudeCode:!0,preCommit:!1,ciIntegration:!1},V={install:!0,installV2:!0,installV3:!0,overwrite:!1},Q={enabled:!0,parameters:["hnsw.efSearch","routing.confidenceThreshold","pattern.promotionThreshold","testGen.complexityLimit"],tuningIntervalMs:10080*60*1e3,evaluationPeriodMs:5e3};var E=re.filter(r=>r!=="coordination");function W(){return"3.14.8"}function Ke(r,e){return{version:W(),project:{name:r,root:e,type:"single"},learning:structuredClone(F),routing:structuredClone($),workers:structuredClone(L),hooks:structuredClone(M),skills:structuredClone(V),autoTuning:structuredClone(Q),domains:{enabled:[...E],disabled:[]},agents:{maxConcurrent:15,defaultTimeout:6e4}}}Ce();import{readFileSync as C,existsSync as p,statSync as De,readdirSync as Re}from"fs";import{join as d,basename as ce,extname as ue,relative as B}from"path";var je=[{name:"jest",detect:r=>{let e=["jest.config.js","jest.config.ts","jest.config.mjs","jest.config.cjs"];for(let n of e)if(p(d(r,n)))return{name:"jest",version:x(r,"jest"),configFile:n,confidence:1};let t=A(r);return t?.jest?{name:"jest",version:x(r,"jest"),configFile:"package.json",confidence:.9}:t?.devDependencies?.jest||t?.dependencies?.jest?{name:"jest",version:t.devDependencies?.jest||t.dependencies?.jest,confidence:.7}:null}},{name:"vitest",detect:r=>{let e=["vitest.config.ts","vitest.config.js","vitest.config.mts","vite.config.ts"];for(let n of e)if(p(d(r,n)))return{name:"vitest",version:x(r,"vitest"),configFile:n,confidence:1};let t=A(r);return t?.devDependencies?.vitest||t?.dependencies?.vitest?{name:"vitest",version:t.devDependencies?.vitest,confidence:.8}:null}},{name:"mocha",detect:r=>{let e=[".mocharc.js",".mocharc.json",".mocharc.yaml",".mocharc.yml"];for(let n of e)if(p(d(r,n)))return{name:"mocha",version:x(r,"mocha"),configFile:n,confidence:1};let t=A(r);return t?.devDependencies?.mocha?{name:"mocha",version:t.devDependencies?.mocha,confidence:.8}:null}},{name:"pytest",detect:r=>{let e=["pytest.ini","pyproject.toml","setup.cfg"];for(let n of e){let i=d(r,n);if(p(i))try{let s=C(i,"utf-8");if(s.includes("[pytest]")||s.includes("[tool.pytest]"))return{name:"pytest",configFile:n,confidence:1}}catch(s){console.debug("[ProjectAnalyzer] Config read failed:",s instanceof Error?s.message:s)}}let t=d(r,"requirements.txt");if(p(t))try{if(C(t,"utf-8").includes("pytest"))return{name:"pytest",configFile:"requirements.txt",confidence:.8}}catch(n){console.debug("[ProjectAnalyzer] requirements.txt read failed:",n instanceof Error?n.message:n)}return null}},{name:"playwright",detect:r=>{let e=["playwright.config.ts","playwright.config.js"];for(let n of e)if(p(d(r,n)))return{name:"playwright",version:x(r,"@playwright/test"),configFile:n,confidence:1};let t=A(r);return t?.devDependencies?.["@playwright/test"]?{name:"playwright",version:t.devDependencies["@playwright/test"],confidence:.8}:null}},{name:"cypress",detect:r=>{let e=["cypress.config.ts","cypress.config.js","cypress.json"];for(let t of e)if(p(d(r,t)))return{name:"cypress",version:x(r,"cypress"),configFile:t,confidence:1};return p(d(r,"cypress"))?{name:"cypress",configFile:"cypress/",confidence:.9}:null}}],Ee=[{name:"typescript",extensions:[".ts",".tsx",".mts",".cts"]},{name:"javascript",extensions:[".js",".jsx",".mjs",".cjs"]},{name:"python",extensions:[".py",".pyw"]},{name:"java",extensions:[".java"]},{name:"go",extensions:[".go"]},{name:"rust",extensions:[".rs"]},{name:"csharp",extensions:[".cs"]},{name:"ruby",extensions:[".rb"]},{name:"php",extensions:[".php"]},{name:"kotlin",extensions:[".kt",".kts"]},{name:"swift",extensions:[".swift"]}];function A(r){let e=d(r,"package.json");if(!p(e))return null;try{return O(C(e,"utf-8"))}catch{return null}}function x(r,e){let t=A(r);if(t)return t.devDependencies?.[e]||t.dependencies?.[e]}var Ie=["node_modules",".git","dist","build","coverage",".next","__pycache__",".agentic-qe",".claude",".agents",".codex",".opencode",".kiro",".cursor",".roo",".kilocode",".windsurf",".continue",".clinerules",".swarm",".claude-flow",".hive-mind"];function G(r,e,t={}){let{maxDepth:n=10,exclude:i=Ie}=t;function s(o,a){if(a>n)return;let c;try{c=Re(o)}catch{return}for(let u of c){if(i.includes(u))continue;let l=d(o,u),D;try{D=De(l)}catch{continue}D.isDirectory()?s(l,a+1):D.isFile()&&e(l)}}s(r,0)}var z=class{projectRoot;constructor(e){this.projectRoot=e}async analyze(){let e=Date.now(),[t,n,i,s,o]=await Promise.all([this.detectFrameworks(),this.detectLanguages(),this.detectExistingTests(),this.analyzeComplexity(),this.measureCoverage()]);return{projectName:A(this.projectRoot)?.name||ce(this.projectRoot),projectRoot:this.projectRoot,projectType:this.detectProjectType(),frameworks:t,languages:n,existingTests:i,codeComplexity:s,coverage:o,packageManager:this.detectPackageManager(),hasTypeScript:p(d(this.projectRoot,"tsconfig.json")),hasCIConfig:this.detectCIConfig(),ciProvider:this.detectCIProvider(),analysisTimestamp:new Date,analysisDurationMs:Date.now()-e}}async detectFrameworks(){let e=[];for(let t of je){let n=t.detect(this.projectRoot);n&&e.push(n)}return e.sort((t,n)=>n.confidence-t.confidence)}async detectLanguages(){let e=new Map,t=0;G(this.projectRoot,i=>{let s=ue(i).toLowerCase();if(s){for(let o of Ee)if(o.extensions.includes(s)){let a=e.get(o.name)||{count:0,extensions:new Set};a.count++,a.extensions.add(s),e.set(o.name,a),t++;break}}});let n=[];for(let[i,s]of e)n.push({name:i,percentage:t>0?Math.round(s.count/t*100):0,fileCount:s.count,extensions:Array.from(s.extensions)});return n.sort((i,s)=>s.fileCount-i.fileCount)}async detectExistingTests(){let e={totalCount:0,byFramework:{},byType:{unit:0,integration:0,e2e:0,unknown:0},directories:[]},t=new Set,n=[/\.test\.[jt]sx?$/,/\.spec\.[jt]sx?$/,/_test\.[jt]sx?$/,/test_.*\.py$/,/.*_test\.py$/,/.*_test\.go$/,/.*Test\.java$/];return G(this.projectRoot,i=>{let s=ce(i);if(n.some(a=>a.test(s))){e.totalCount++;let a=B(this.projectRoot,i).toLowerCase();a.includes("e2e")||a.includes("cypress")||a.includes("playwright")?e.byType.e2e++:a.includes("integration")||a.includes("int-test")?e.byType.integration++:a.includes("unit")||a.includes("__tests__")||a.includes("test/")?e.byType.unit++:e.byType.unknown++;let c=B(this.projectRoot,d(i,".."));t.add(c)}}),e.directories=Array.from(t).slice(0,10),e}async analyzeComplexity(){let e=[],t=[],n=0,i=0;G(this.projectRoot,a=>{let c=ue(a);if([".ts",".tsx",".js",".jsx",".py",".java",".go"].includes(c))try{let u=C(a,"utf-8"),l=this.calculateFileComplexity(u,c);t.push(...l.functionComplexities),l.maxComplexity>n&&(n=l.maxComplexity),i++,l.maxComplexity>10&&e.push(B(this.projectRoot,a))}catch(u){console.debug("[ProjectAnalyzer] Complexity analysis read failed:",u instanceof Error?u.message:u)}});let s=t.reduce((a,c)=>a+c,0),o=t.length>0?s/t.length:0;return{averageCyclomatic:Math.round(o*10)/10,maxCyclomatic:n,totalFiles:i,complexFiles:e.slice(0,20),recommendation:o<5?"simple":o<15?"medium":"complex"}}calculateFileComplexity(e,t){let n=this.stripCommentsAndStrings(e,t),i=this.calculateComplexity(n);return{functionComplexities:[i],maxComplexity:i}}removeDelimitedBlocks(e,t,n){let i="",s=0;for(;s<e.length;){let o=e.indexOf(t,s);if(o===-1){i+=e.slice(s);break}i+=e.slice(s,o);let a=e.indexOf(n,o+t.length);if(a===-1)break;s=a+n.length}return i}stripCommentsAndStrings(e,t){let n=e;return[".ts",".tsx",".js",".jsx",".java",".go"].includes(t)?(n=n.split(`
|
|
3
3
|
`).map(i=>{let s=i.indexOf("//");return s>=0?i.slice(0,s):i}).join(`
|
|
4
4
|
`),n=this.removeDelimitedBlocks(n,"/*","*/"),n=this.removeDelimitedBlocks(n,"`","`"),n=this.removeDelimitedBlocks(n,'"','"'),n=this.removeDelimitedBlocks(n,"'","'")):t===".py"&&(n=n.split(`
|
|
5
5
|
`).map(i=>{let s=i.indexOf("#");return s>=0?i.slice(0,s):i}).join(`
|
|
@@ -58,7 +58,7 @@ See \`.validation/README.md\` for usage instructions.
|
|
|
58
58
|
updated: ${e}`):i=n+`
|
|
59
59
|
updated: ${e}`,r.replace(/^---\n[\s\S]*?\n---/,`---
|
|
60
60
|
${i}
|
|
61
|
-
---`)}var Qe=["qe-test-architect","qe-bdd-generator","qe-property-tester","qe-mutation-tester","qe-test-idea-rewriter","qe-quality-criteria-recommender","qe-parallel-executor","qe-flaky-hunter","qe-retry-handler","qe-coverage-specialist","qe-gap-detector","qe-quality-gate","qe-code-complexity","qe-deployment-advisor","qe-risk-assessor","qe-defect-predictor","qe-regression-analyzer","qe-root-cause-analyzer","qe-impact-analyzer","qe-requirements-validator","qe-qx-partner","qe-product-factors-assessor","qe-code-intelligence","qe-kg-builder","qe-dependency-mapper","qe-security-scanner","qe-security-auditor","qe-pentest-validator","qe-contract-validator","qe-graphql-tester","qe-visual-tester","qe-accessibility-auditor","qe-responsive-tester","qe-chaos-engineer","qe-load-tester","qe-performance-tester","qe-learning-coordinator","qe-pattern-learner","qe-metrics-optimizer","qe-transfer-specialist","qe-soap-tester","qe-sap-rfc-tester","qe-sap-idoc-tester","qe-odata-contract-tester","qe-middleware-validator","qe-message-broker-tester","qe-sod-analyzer","qe-fleet-commander","qe-queen-coordinator","qe-tdd-specialist","qe-integration-tester","qe-integration-architect"],We=["qe-code-reviewer","qe-integration-reviewer","qe-performance-reviewer","qe-security-reviewer","qe-tdd-red","qe-tdd-green","qe-tdd-refactor"],ee=class{projectRoot;options;sourceAgentsDir;constructor(e){this.projectRoot=e.projectRoot,this.options={installQEAgents:!0,installSubagents:!0,overwrite:!1,exclude:[],include:void 0,...e},this.sourceAgentsDir=this.findSourceAgentsDir()}findSourceAgentsDir(){let e=b(import.meta.url),t=[];e&&(t.push(g(e,"assets/agents/v3")),t.push(g(e,".claude/agents/v3"))),t.push(g(this.projectRoot,"node_modules/agentic-qe/assets/agents/v3"));for(let n of t)if(f(n))return n;return t[0]}preserveOverridesDir(){let e=g(this.projectRoot,".claude","agent-overrides");f(e)||w(e,{recursive:!0});let t=g(e,"_example.yaml");if(!f(t))try{let n=b(import.meta.url),i=[...n?[g(n,"assets","templates","agent-override-example.yaml")]:[],g(this.projectRoot,"node_modules","agentic-qe","assets","templates","agent-override-example.yaml")];for(let s of i)if(f(s)){X(s,t);break}}catch{}}async install(){let e={installed:[],skipped:[],errors:[],totalCount:0,agentsDir:g(this.projectRoot,".claude","agents","v3"),overlaysApplied:[],overlayWarnings:[]};if(this.preserveOverridesDir(),!f(this.sourceAgentsDir))return e.errors.push(`Source agents directory not found: ${this.sourceAgentsDir}`),e;let t=g(this.projectRoot,".claude","agents","v3");f(t)||w(t,{recursive:!0});let n=g(t,"subagents");f(n)||w(n,{recursive:!0}),await this.copyHelpersDirectory(t),await this.copyTemplatesDirectory(t);let i=this.getAvailableAgents();e.totalCount=i.length;let s=this.filterAgents(i),o=[];for(let u of s)try{let l=await this.installAgent(u,t,n);l?(e.installed.push(l),o.push(l)):(e.skipped.push(u),o.push(this.describeAgent(u,t,n)))}catch(l){e.errors.push(`Failed to install ${u}: ${k(l)}`)}let a=
|
|
61
|
+
---`)}var Qe=["qe-test-architect","qe-bdd-generator","qe-property-tester","qe-mutation-tester","qe-test-idea-rewriter","qe-quality-criteria-recommender","qe-parallel-executor","qe-flaky-hunter","qe-retry-handler","qe-coverage-specialist","qe-gap-detector","qe-quality-gate","qe-code-complexity","qe-deployment-advisor","qe-risk-assessor","qe-defect-predictor","qe-regression-analyzer","qe-root-cause-analyzer","qe-impact-analyzer","qe-requirements-validator","qe-qx-partner","qe-product-factors-assessor","qe-code-intelligence","qe-kg-builder","qe-dependency-mapper","qe-security-scanner","qe-security-auditor","qe-pentest-validator","qe-contract-validator","qe-graphql-tester","qe-visual-tester","qe-accessibility-auditor","qe-responsive-tester","qe-chaos-engineer","qe-load-tester","qe-performance-tester","qe-learning-coordinator","qe-pattern-learner","qe-metrics-optimizer","qe-transfer-specialist","qe-soap-tester","qe-sap-rfc-tester","qe-sap-idoc-tester","qe-odata-contract-tester","qe-middleware-validator","qe-message-broker-tester","qe-sod-analyzer","qe-fleet-commander","qe-queen-coordinator","qe-tdd-specialist","qe-integration-tester","qe-integration-architect"],We=["qe-code-reviewer","qe-integration-reviewer","qe-performance-reviewer","qe-security-reviewer","qe-tdd-red","qe-tdd-green","qe-tdd-refactor"],ee=class{projectRoot;options;sourceAgentsDir;constructor(e){this.projectRoot=e.projectRoot,this.options={installQEAgents:!0,installSubagents:!0,overwrite:!1,exclude:[],include:void 0,...e},this.sourceAgentsDir=this.findSourceAgentsDir()}findSourceAgentsDir(){let e=b(import.meta.url),t=[];e&&(t.push(g(e,"assets/agents/v3")),t.push(g(e,".claude/agents/v3"))),t.push(g(this.projectRoot,"node_modules/agentic-qe/assets/agents/v3"));for(let n of t)if(f(n))return n;return t[0]}preserveOverridesDir(){let e=g(this.projectRoot,".claude","agent-overrides");f(e)||w(e,{recursive:!0});let t=g(e,"_example.yaml");if(!f(t))try{let n=b(import.meta.url),i=[...n?[g(n,"assets","templates","agent-override-example.yaml")]:[],g(this.projectRoot,"node_modules","agentic-qe","assets","templates","agent-override-example.yaml")];for(let s of i)if(f(s)){X(s,t);break}}catch{}}async install(){let e={installed:[],skipped:[],errors:[],totalCount:0,agentsDir:g(this.projectRoot,".claude","agents","v3"),overlaysApplied:[],overlayWarnings:[]};if(this.preserveOverridesDir(),!f(this.sourceAgentsDir))return e.errors.push(`Source agents directory not found: ${this.sourceAgentsDir}`),e;let t=g(this.projectRoot,".claude","agents","v3");f(t)||w(t,{recursive:!0});let n=g(t,"subagents");f(n)||w(n,{recursive:!0}),await this.copyHelpersDirectory(t),await this.copyTemplatesDirectory(t);let i=this.getAvailableAgents();e.totalCount=i.length;let s=this.filterAgents(i),o=[];for(let u of s)try{let l=await this.installAgent(u,t,n);l?(e.installed.push(l),o.push(l)):(e.skipped.push(u),o.push(this.describeAgent(u,t,n)))}catch(l){e.errors.push(`Failed to install ${u}: ${k(l)}`)}let a=oe(this.projectRoot);if(a.warnings.length>0){e.overlayWarnings=a.warnings;for(let u of a.warnings)console.error(`[AgentsInstaller] Overlay warning: ${u}`)}if(a.errors.length>0)for(let u of a.errors)e.errors.push(`Overlay error: ${u}`);for(let u of a.overlays){let l=u.agent,T=We.includes(l)?g(n,`${l}.md`):g(t,`${l}.md`);if(!f(T)){e.overlayWarnings.push(`Overlay for "${l}" found but agent file does not exist. Skipping.`);continue}try{let _=he(T,"utf-8"),{content:Ae,applied:N}=ae(_,u),xe=Ve(Ae);Me(T,xe,"utf-8"),e.overlaysApplied.push(l);let Se=[...N.replacedFields.map(S=>`replaced:${S}`),...N.appendedFields.map(S=>`appended:${S}`),...N.configOverrides.map(S=>`config:${S}`)];console.error(`[AgentsInstaller] Applied overlay for ${l}: ${Se.join(", ")}`)}catch(_){e.overlayWarnings.push(`Failed to apply overlay for "${l}": ${k(_)}`)}}e.overlaysApplied.length>0&&console.error(`[AgentsInstaller] Applied ${e.overlaysApplied.length} agent overlay(s): ${e.overlaysApplied.join(", ")}`);let c=le(t,this.projectRoot);if(e.mcpValidationWarnings=c.warnings,c.warnings.length>0){console.error(`[AgentsInstaller] MCP dependency warnings (${c.agentsWithMissingDeps.length} agents affected):`);for(let u of c.warnings.slice(0,10))console.error(` ${u}`);c.warnings.length>10&&console.error(` ... and ${c.warnings.length-10} more warnings`)}return await this.createAgentsIndex(t,o),e}getAvailableAgents(){let e=[];try{let t=Z(this.sourceAgentsDir);for(let n of t){let i=g(this.sourceAgentsDir,n),s=ye(i);if(s.isFile()&&n.endsWith(".md"))e.push(n.replace(".md",""));else if(s.isDirectory()&&n==="subagents"){let o=Z(i);for(let a of o)a.endsWith(".md")&&e.push(`subagents/${a.replace(".md","")}`)}}}catch{return[]}return e}filterAgents(e){let t=e.filter(n=>(n.includes("/")?n.split("/")[1]:n).startsWith("qe-"));return this.options.include&&this.options.include.length>0&&(t=t.filter(n=>{let i=n.includes("/")?n.split("/")[1]:n;return this.options.include.includes(i)})),this.options.exclude&&this.options.exclude.length>0&&(t=t.filter(n=>{let i=n.includes("/")?n.split("/")[1]:n;return!this.options.exclude.some(s=>i.includes(s)||i.match(new RegExp(s)))})),this.options.installQEAgents||(t=t.filter(n=>{let i=n.includes("/")?n.split("/")[1]:n;return!Qe.includes(i)})),this.options.installSubagents||(t=t.filter(n=>!n.startsWith("subagents/"))),t}async installAgent(e,t,n){let i=e.startsWith("subagents/"),s=i?e.split("/")[1]:e,o=g(this.sourceAgentsDir,`${e}.md`),a=i?g(n,`${s}.md`):g(t,`${s}.md`);if(f(a)&&!this.options.overwrite)return null;if(f(o))X(o,a);else throw new Error(`Source file not found: ${o}`);return this.describeAgent(e,t,n)}describeAgent(e,t,n){let i=e.startsWith("subagents/"),s=i?e.split("/")[1]:e,o=i?g(n,`${s}.md`):g(t,`${s}.md`);return{name:s,type:this.getAgentType(s,i),description:this.getAgentDescription(o),domain:this.getAgentDomain(s)}}getAgentType(e,t){return t?"v3-subagent":"v3-qe"}copyDirectoryRecursive(e,t){if(!f(e))return;f(t)||w(t,{recursive:!0});let n=Z(e);for(let i of n){let s=g(e,i),o=g(t,i);ye(s).isDirectory()?this.copyDirectoryRecursive(s,o):(!f(o)||this.options.overwrite)&&X(s,o)}}async copyHelpersDirectory(e){let t=g(this.sourceAgentsDir,"helpers"),n=g(this.projectRoot,".claude","helpers","v3");f(t)?this.copyDirectoryRecursive(t,n):console.error(`[AgentsInstaller] Helpers source not found: ${t}`)}async copyTemplatesDirectory(e){let t=g(this.sourceAgentsDir,"templates"),n=g(e,"templates");f(t)?this.copyDirectoryRecursive(t,n):console.error(`[AgentsInstaller] Templates source not found: ${t}`)}getAgentDescription(e){if(f(e))try{let t=he(e,"utf-8"),n=t.match(/description:\s*["']?([^"'\n]+)["']?/i);if(n)return n[1].trim();let i=t.split(`
|
|
62
62
|
`);for(let s of i){let o=s.trim();if(o&&!o.startsWith("#")&&!o.startsWith("-")&&!o.startsWith("```")&&!o.startsWith("---"))return o.slice(0,100)+(o.length>100?"...":"")}}catch(t){console.debug("[AgentsInstaller] Failed to read agent description:",t instanceof Error?t.message:t)}}getAgentDomain(e){let t={"test-architect":"test-generation","bdd-generator":"test-generation","property-tester":"test-generation","mutation-tester":"test-generation","parallel-executor":"test-execution","flaky-hunter":"test-execution","retry-handler":"test-execution","coverage-specialist":"coverage-analysis","gap-detector":"coverage-analysis","quality-gate":"quality-assessment","code-complexity":"quality-assessment","deployment-advisor":"quality-assessment","risk-assessor":"quality-assessment","defect-predictor":"defect-intelligence","regression-analyzer":"defect-intelligence","root-cause-analyzer":"defect-intelligence","impact-analyzer":"defect-intelligence","requirements-validator":"requirements-validation","qx-partner":"requirements-validation","product-factors-assessor":"requirements-validation","quality-criteria-recommender":"requirements-validation","test-idea-rewriter":"test-generation","code-intelligence":"code-intelligence","kg-builder":"code-intelligence","dependency-mapper":"code-intelligence","security-scanner":"security-compliance","security-auditor":"security-compliance","pentest-validator":"security-compliance","contract-validator":"contract-testing","graphql-tester":"contract-testing","visual-tester":"visual-accessibility","accessibility-auditor":"visual-accessibility","responsive-tester":"visual-accessibility","chaos-engineer":"chaos-resilience","load-tester":"chaos-resilience","performance-tester":"chaos-resilience","learning-coordinator":"learning-optimization","pattern-learner":"learning-optimization","metrics-optimizer":"learning-optimization","transfer-specialist":"learning-optimization","soap-tester":"enterprise-integration","sap-rfc-tester":"enterprise-integration","sap-idoc-tester":"enterprise-integration","odata-contract-tester":"enterprise-integration","middleware-validator":"enterprise-integration","message-broker-tester":"enterprise-integration","sod-analyzer":"enterprise-integration"},n=e.replace(/^(v3-)?qe-/,"");return t[n]}async createAgentsIndex(e,t){let n=t.filter(c=>c.type==="v3-qe"),i=t.filter(c=>c.type==="v3-subagent"),s=new Map;for(let c of n){let u=c.domain||"general";s.has(u)||s.set(u,[]),s.get(u).push(c)}let o=`# AQE V3 Agents Index
|
|
63
63
|
|
|
64
64
|
This directory contains V3 QE agents installed by \`aqe init\`.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.8");process.exit(0)}
|
|
2
2
|
import{readFileSync as R,existsSync as v,readdirSync as y}from"fs";import{join as S}from"path";var M=100*1024,b=/mcp__([a-z][a-z0-9-]*)__([a-z][a-z0-9_]*)/g,x=/^```/;function w(e,r){let n=e.length>M?e.slice(0,M):e,o=[],i=n.split(`
|
|
3
3
|
`),a=!1;for(let s=0;s<i.length;s++){let p=i[s];if(x.test(p.trim())){a=!a;continue}let l,c=new RegExp(b.source,"g");for(;(l=c.exec(p))!==null;){let t=l[1],g=l[2],f=l[0],d=a?"code-block":"prose",u=d==="prose"?.9:.5;o.push({toolName:f,serverName:t,actionName:g,confidence:u,context:d,lineNumber:s+1})}}return o}function E(e){let r=new Map;for(let n of e)r.has(n.serverName)||r.set(n.serverName,[]),r.get(n.serverName).push(n);return r}function N(e){let r=[],n=[S(e,".claude","mcp.json"),S(e,".mcp.json")],o=process.env.HOME||process.env.USERPROFILE||"";o&&n.push(S(o,".claude","mcp.json"));for(let i of n)if(v(i))try{let a=R(i,"utf-8"),s=JSON.parse(a);s.mcpServers&&typeof s.mcpServers=="object"&&r.push(...Object.keys(s.mcpServers))}catch{}return[...new Set(r)]}function h(e,r,n){if(!v(e))return{agentName:r,references:[],requiredServers:[],availableServers:n,missingServers:[],warnings:[`Agent file not found: ${e}`],allSatisfied:!0};let o;try{o=R(e,"utf-8")}catch{return{agentName:r,references:[],requiredServers:[],availableServers:n,missingServers:[],warnings:[`Failed to read agent file: ${e}`],allSatisfied:!0}}let i=w(o,r),a=E(i),s=[...a.keys()],p=new Set(n),l=s.filter(t=>!p.has(t)),c=[];for(let t of l){let g=a.get(t)||[],f=Math.max(...g.map(m=>m.confidence)),d=g.length,u=[...new Set(g.map(m=>m.context))].join(", ");c.push(`[advisory] Agent "${r}" references MCP server "${t}" (${d} tool ref${d>1?"s":""}, confidence: ${f}, context: ${u}) but server is not configured. Agent may have reduced capabilities.`)}return{agentName:r,references:i,requiredServers:s,availableServers:n,missingServers:l,warnings:c,allSatisfied:l.length===0}}function C(e,r){let n=Date.now(),o=[],i=[],a=N(r);if(!v(e))return{agents:[],totalServersReferenced:0,globalMissingServers:[],agentsWithMissingDeps:[],warnings:[`Agents directory not found: ${e}`],durationMs:Date.now()-n};try{let c=y(e);for(let g of c){if(!g.endsWith(".md"))continue;let f=g.replace(".md",""),d=S(e,g),u=h(d,f,a);o.push(u),i.push(...u.warnings)}let t=S(e,"subagents");if(v(t)){let g=y(t);for(let f of g){if(!f.endsWith(".md"))continue;let d=f.replace(".md",""),u=S(t,f),m=h(u,d,a);o.push(m),i.push(...m.warnings)}}}catch(c){i.push(`Error scanning agents directory: ${c.message}`)}let s=new Set,p=new Set,l=[];for(let c of o){for(let t of c.requiredServers)s.add(t);for(let t of c.missingServers)p.add(t);c.missingServers.length>0&&l.push(c.agentName)}return{agents:o,totalServersReferenced:s.size,globalMissingServers:[...p],agentsWithMissingDeps:l,warnings:i,durationMs:Date.now()-n}}export{N as a,C as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.8");process.exit(0)}
|
|
2
|
+
import{b as R,d as V}from"./chunk-BITFGVZ4.js";import{a as M}from"./chunk-EKO5QL2B.js";import{a as E,e as U}from"./chunk-HPVYJ6JH.js";import{randomUUID as ee}from"crypto";import*as d from"fs";import*as h from"path";import*as S from"os";import*as k from"fs";var j={"aqe test generate":{domain:"test-generation",action:"generateTests"},"aqe test execute":{domain:"test-execution",action:"execute"},"aqe coverage analyze":{domain:"coverage-analysis",action:"analyze"},"aqe coverage gaps":{domain:"coverage-analysis",action:"detectGaps"},"aqe quality gate":{domain:"quality-assessment",action:"evaluateGate"},"aqe quality assess":{domain:"quality-assessment",action:"analyzeQuality"},"aqe security scan":{domain:"security-compliance",action:"runSASTScan"},"aqe security audit":{domain:"security-compliance",action:"runAudit"},"aqe defect predict":{domain:"defect-intelligence",action:"predictDefects"},"aqe code index":{domain:"code-intelligence",action:"index"},"aqe code impact":{domain:"code-intelligence",action:"analyzeImpact"},"aqe contract validate":{domain:"contract-testing",action:"validateContract"},"aqe chaos test":{domain:"chaos-resilience",action:"runChaosTest"},"aqe requirements validate":{domain:"requirements-validation",action:"validateRequirements"},"aqe visual test":{domain:"visual-accessibility",action:"runVisualTest"},"aqe accessibility test":{domain:"visual-accessibility",action:"runAccessibilityTest"},"aqe learn optimize":{domain:"learning-optimization",action:"optimizeAllStrategies"}},F={daily:"0 0 * * *",weekly:"0 0 * * 0",hourly:"0 * * * *",minutely:"* * * * *"},I=1e4,T=20,C=1e4,H=["__proto__","constructor","prototype"];function x(n){return!H.includes(n)}function K(n){let e=n.split(`
|
|
3
|
+
`);if(e.length>I)throw new Error(`YAML content exceeds maximum allowed lines (${I}). File has ${e.length} lines.`);for(let i=0;i<e.length;i++)if(e[i].length>C)throw new Error(`YAML line ${i+1} exceeds maximum allowed length (${C} characters).`);let r={};for(let i=0;i<e.length;i++){let s=e[i];if(s.trim()===""||s.trim().startsWith("#")||s.search(/\S/)!==0)continue;let a=s.match(/^([\w_-]+):\s*(.+)$/);if(a){let[,c,l]=a;x(c)&&(r[c]=g(l))}}let t=["tags","stages","triggers"];for(let i of t){let s=new RegExp(`^${i}:\\s*$`),o=-1;for(let u=0;u<e.length;u++){let m=e[u];if(!(m.trim()===""||m.trim().startsWith("#"))&&s.test(m.trim())){o=u;break}}if(o===-1)continue;let a=[];r[i]=a;let c=e[o].search(/\S/),l=o+1;for(;l<e.length;){let u=e[l];if(u.trim()===""||u.trim().startsWith("#")){l++;continue}let m=u.search(/\S/),y=u.trim();if(m<=c&&!y.startsWith("-"))break;if(y.startsWith("- ")){let f=y.slice(2).trim();if(!f.includes(":")){a.push(g(f)),l++;continue}let p={},$=f.match(/^([\w_-]+):\s*(.*)$/);if($){let[,w,v]=$;p[w]=g(v)}let z=m;for(l++;l<e.length;){let w=e[l];if(w.trim()===""||w.trim().startsWith("#")){l++;continue}let v=w.search(/\S/),N=w.trim();if(v<=z)break;let A=N.match(/^([\w_-]+):\s*(.*)$/);if(A){let[,L,_]=A;if(_===""){let D=G(e,l+1,v,1);p[L]=D.value,l=D.nextLine;continue}else p[L]=g(_)}l++}a.push(p)}else l++}}return r}function G(n,e,r,t=0){if(t>T)throw new Error(`YAML nesting exceeds maximum allowed depth (${T}).`);let i={},s=null,o=null,a=e;for(;a<n.length;){let l=n[a];if(l.trim()===""||l.trim().startsWith("#")){a++;continue}let u=l.search(/\S/),m=l.trim();if(u<=r)break;if(m.startsWith("- ")){let f=m.slice(2).trim();o&&!Array.isArray(i[o])&&(i[o]=[]),o?i[o].push(g(f)):(s||(s=[]),s.push(g(f))),a++;continue}let y=m.match(/^([\w_-]+):\s*(.*)$/);if(y){let[,f,p]=y;if(!x(f)){a++;continue}p===""?(o=f,i[f]=[]):(i[f]=g(p),o=null)}a++}if(s&&Object.keys(i).length===0)return{value:s,nextLine:a};let c=Object.keys(i);return c.length===1&&Array.isArray(i[c[0]])?{value:i[c[0]],nextLine:a}:{value:i,nextLine:a}}function g(n){if(n==="")return"";if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);if(n==="true")return!0;if(n==="false")return!1;if(n==="null"||n==="~")return null;let e=Number(n);return!isNaN(e)&&n!==""?e:n.startsWith("[")&&n.endsWith("]")?n.slice(1,-1).split(",").map(t=>g(t.trim())):n}function le(n){let e=[];if(!k.existsSync(n))return{success:!1,errors:[`File not found: ${n}`]};let r;try{r=k.readFileSync(n,"utf-8")}catch(t){return{success:!1,errors:[`Failed to read file: ${t}`]}}return B(r,n)}function B(n,e){let r=[],t;try{t=K(n)}catch(o){return{success:!1,errors:[`Invalid YAML syntax: ${o}`]}}if((!t.name||typeof t.name!="string")&&r.push('Pipeline must have a "name" field'),(!t.stages||!Array.isArray(t.stages))&&r.push('Pipeline must have a "stages" array'),r.length>0)return{success:!1,errors:r};let i={name:t.name,description:t.description,version:t.version||"1.0.0",schedule:t.schedule,stages:t.stages.map((o,a)=>{let c=o;return{name:c.name||`stage-${a}`,command:c.command,params:c.params,depends_on:c.depends_on,condition:c.condition,timeout:c.timeout,retry:c.retry,continue_on_failure:c.continue_on_failure}}),triggers:t.triggers,tags:t.tags,timeout:t.timeout};for(let o=0;o<i.stages.length;o++){let a=i.stages[o];a.command||r.push(`Stage ${o+1} (${a.name}) must have a "command" field`)}if(r.length>0)return{success:!1,pipeline:i,errors:r};let s=X(i,e);return{success:!0,pipeline:i,workflow:s,errors:[]}}function X(n,e){let r=`pipeline-${n.name.replace(/\s+/g,"-").toLowerCase()}`,t=n.stages.map((s,o)=>{let a=q(s.command),c={};if(s.params)for(let[u,m]of Object.entries(s.params))x(u)&&(c[u]=`input.${u}`);let l={id:`stage-${s.name.replace(/\s+/g,"-").toLowerCase()}`,name:s.name,domain:a.domain,action:a.action,inputMapping:Object.keys(c).length>0?c:void 0,dependsOn:s.depends_on?.map(u=>`stage-${u.replace(/\s+/g,"-").toLowerCase()}`),timeout:s.timeout?s.timeout*1e3:void 0,continueOnFailure:s.continue_on_failure};return s.condition&&(l.condition={path:s.condition.path,operator:s.condition.operator,value:s.condition.value}),s.retry&&(l.retry={maxAttempts:s.retry.max_attempts||3,backoffMs:(s.retry.backoff_seconds||1)*1e3}),l}),i=n.triggers?.map(s=>{let o={eventType:J(s),sourceDomain:s.source_domain};return s.condition&&(o.condition={path:s.condition.path,operator:s.condition.operator,value:s.condition.value}),o});return{id:r,name:n.name,description:n.description||`Pipeline from ${e||"inline YAML"}`,version:n.version||"1.0.0",steps:t,triggers:i,tags:n.tags,timeout:n.timeout?n.timeout*1e3:void 0}}function q(n){let e=n.trim().replace(/\s+/g," ").toLowerCase();for(let[r,t]of Object.entries(j))if(e.startsWith(r.toLowerCase()))return t;return e.includes("test")&&e.includes("generate")?{domain:"test-generation",action:"generateTests"}:e.includes("test")&&(e.includes("execute")||e.includes("run"))?{domain:"test-execution",action:"execute"}:e.includes("coverage")?{domain:"coverage-analysis",action:"analyze"}:e.includes("quality")||e.includes("gate")?{domain:"quality-assessment",action:"evaluateGate"}:e.includes("security")||e.includes("scan")?{domain:"security-compliance",action:"runSASTScan"}:e.includes("defect")||e.includes("predict")?{domain:"defect-intelligence",action:"predictDefects"}:{domain:"learning-optimization",action:"runLearningCycle"}}function J(n){let e=n.event.toLowerCase();return e==="push"?"code-intelligence.CodePushed":e==="pull_request"||e==="pr"?"code-intelligence.PullRequestOpened":e==="schedule"?"workflow.ScheduleTrigger":e==="quality_gate"?"quality-assessment.QualityGateEvaluated":e==="test_complete"?"test-execution.TestRunCompleted":e}function de(n){let e=[],r=[];if(n.name||e.push({path:"name",message:"Pipeline name is required",severity:"error"}),!n.stages||n.stages.length===0)e.push({path:"stages",message:"Pipeline must have at least one stage",severity:"error"});else{let t=new Set;for(let s=0;s<n.stages.length;s++){let o=n.stages[s],a=`stages[${s}]`;if(t.has(o.name)&&e.push({path:`${a}.name`,message:`Duplicate stage name: ${o.name}`,severity:"error"}),t.add(o.name),o.command?q(o.command).domain==="learning-optimization"&&!o.command.toLowerCase().includes("learn")&&r.push({path:`${a}.command`,message:`Command "${o.command}" not recognized, will default to learning-optimization domain`,severity:"warning"}):e.push({path:`${a}.command`,message:"Stage must have a command",severity:"error"}),o.depends_on)for(let c of o.depends_on)n.stages.some(l=>l.name===c)||e.push({path:`${a}.depends_on`,message:`Unknown dependency: ${c}`,severity:"error"});o.timeout!==void 0&&o.timeout<=0&&e.push({path:`${a}.timeout`,message:"Timeout must be a positive number",severity:"error"}),o.retry&&o.retry.max_attempts!==void 0&&o.retry.max_attempts<1&&e.push({path:`${a}.retry.max_attempts`,message:"max_attempts must be at least 1",severity:"error"})}let i=Q(n.stages);i&&e.push({path:"stages",message:`Circular dependency detected: ${i}`,severity:"error"})}if(n.schedule&&(Z(n.schedule)||e.push({path:"schedule",message:`Invalid cron expression: ${n.schedule}`,severity:"error"})),n.triggers)for(let t=0;t<n.triggers.length;t++){let i=n.triggers[t],s=`triggers[${t}]`;i.event||e.push({path:`${s}.event`,message:"Trigger must have an event type",severity:"error"}),i.source_domain&&!M.includes(i.source_domain)&&r.push({path:`${s}.source_domain`,message:`Unknown domain: ${i.source_domain}`,severity:"warning"})}return{valid:e.length===0,errors:e,warnings:r}}function Q(n){let e=new Set,r=new Set,t=(i,s)=>{if(r.has(i))return[...s,i].join(" -> ");if(e.has(i))return null;e.add(i),r.add(i);let o=n.find(a=>a.name===i);if(o?.depends_on)for(let a of o.depends_on){let c=t(a,[...s,i]);if(c)return c}return r.delete(i),null};for(let i of n){let s=t(i.name,[]);if(s)return s}return null}function Z(n){if(Object.keys(F).includes(n))return!0;let e=n.trim().split(/\s+/);if(e.length!==5)return!1;let r=[/^(\*|[0-5]?\d)(-[0-5]?\d)?(\/\d+)?$/,/^(\*|1?\d|2[0-3])(-\d+)?(\/\d+)?$/,/^(\*|[1-9]|[12]\d|3[01])(-\d+)?(\/\d+)?$/,/^(\*|[1-9]|1[0-2])(-\d+)?(\/\d+)?$/,/^(\*|[0-7])(-[0-7])?(\/\d+)?$/];for(let t=0;t<5;t++){let i=e[t].split(",");for(let s of i)if(!r[t].test(s)&&s!=="*")return!1}return!0}function ue(n){let e={"@daily":"Daily at midnight","@weekly":"Weekly on Sunday at midnight","@hourly":"Every hour","@minutely":"Every minute"};if(e[n])return e[n];if(Object.keys(F).includes(n))return{daily:"Daily at midnight",weekly:"Weekly on Sunday at midnight",hourly:"Every hour",minutely:"Every minute"}[n]||n;let r=n.trim().split(/\s+/);if(r.length!==5)return n;let[t,i,s,o,a]=r;return t==="0"&&i==="0"&&s==="*"&&o==="*"&&a==="*"?"Daily at midnight":t==="0"&&s==="*"&&o==="*"&&a==="*"?`Daily at ${i}:00`:t!=="*"&&i!=="*"&&s==="*"&&o==="*"?`Daily at ${i}:${t.padStart(2,"0")}`:i==="*"&&t==="0"?"Every hour":t!=="*"&&i==="*"?`Every hour at minute ${t}`:n}function P(n,e=new Date){let r=n.trim().split(/\s+/);if(r.length!==5)return new Date(e.getTime()+1440*60*1e3);let[t,i]=r,s=new Date(e);return i!=="*"&&t!=="*"?(s.setHours(parseInt(i,10),parseInt(t,10),0,0),s<=e&&s.setDate(s.getDate()+1)):i!=="*"?(s.setHours(parseInt(i,10),0,0,0),s<=e&&s.setDate(s.getDate()+1)):t!=="*"?(s.setMinutes(parseInt(t,10),0,0),s<=e&&s.setHours(s.getHours()+1)):(s.setSeconds(0,0),s.setMinutes(s.getMinutes()+1)),s}V();U();var te=".aqe",ne="schedules.json",ie="1.0.0",O=5e3,se=50,W=10*1024*1024,b=class{schedulesPath;debug;lockFile;initialized=!1;constructor(e={}){e.schedulesPath&&this.validateSchedulesPath(e.schedulesPath),this.schedulesPath=e.schedulesPath??this.getDefaultSchedulesPath(),this.lockFile=`${this.schedulesPath}.lock`,this.debug=e.debug??!1}validateSchedulesPath(e){let r=S.homedir(),t=h.resolve(e),i=h.resolve(r);if(t.startsWith(i+h.sep)||t===i)return;let s=process.cwd(),o=h.resolve(s);if(t.startsWith(o+h.sep)||t===o)return;let a=S.tmpdir(),c=h.resolve(a);if(!(t.startsWith(c+h.sep)||t===c))throw new Error(`Security: Custom schedulesPath must be within home directory (${r}), current working directory (${s}), or temp directory (${a}). Provided path: ${e}`)}getDefaultSchedulesPath(){let e=S.homedir();return h.join(e,te,ne)}async initialize(){if(this.initialized)return;let e=h.dirname(this.schedulesPath);d.existsSync(e)||(d.mkdirSync(e,{recursive:!0}),this.log(`Created directory: ${e}`)),this.initialized=!0}async loadSchedules(){if(await this.initialize(),!d.existsSync(this.schedulesPath))return this.log("Schedules file does not exist, returning empty array"),[];try{let e=d.readFileSync(this.schedulesPath,"utf-8"),r=this.parseSchedulesFile(e);return this.log(`Loaded ${r.schedules.length} schedules`),r.schedules}catch(e){return await this.handleCorruptFile(e),[]}}async saveSchedule(e){await this.initialize(),await this.withFileLock(async()=>{let r=await this.loadSchedulesUnsafe(),t=r.findIndex(i=>i.id===e.id);t>=0?(r[t]=e,this.log(`Updated schedule: ${e.id}`)):(r.push(e),this.log(`Added schedule: ${e.id}`)),await this.writeSchedules(r)})}async removeSchedule(e){await this.initialize(),await this.withFileLock(async()=>{let r=await this.loadSchedulesUnsafe(),t=r.filter(i=>i.id!==e);if(t.length===r.length){this.log(`Schedule not found: ${e}`);return}await this.writeSchedules(t),this.log(`Removed schedule: ${e}`)})}async getSchedules(){return this.loadSchedules()}async getSchedule(e){return(await this.loadSchedules()).find(t=>t.id===e)}async getDueSchedules(){let e=await this.loadSchedules(),r=new Date;return e.filter(t=>t.enabled?new Date(t.nextRun)<=r:!1)}async markExecuted(e){await this.initialize(),await this.withFileLock(async()=>{let r=await this.loadSchedulesUnsafe(),t=r.find(s=>s.id===e);if(!t)throw new Error(`Schedule not found: ${e}`);let i=new Date;t.lastRun=i.toISOString(),t.nextRun=P(t.schedule,i).toISOString(),await this.writeSchedules(r),this.log(`Marked executed: ${e}, next run: ${t.nextRun}`)})}async setEnabled(e,r){await this.initialize(),await this.withFileLock(async()=>{let t=await this.loadSchedulesUnsafe(),i=t.find(s=>s.id===e);if(!i)throw new Error(`Schedule not found: ${e}`);i.enabled=r,r&&(i.nextRun=P(i.schedule,new Date).toISOString()),await this.writeSchedules(t),this.log(`Set enabled=${r}: ${e}`)})}async getEnabledSchedules(){return(await this.loadSchedules()).filter(r=>r.enabled)}async getSchedulesByWorkflow(e){return(await this.loadSchedules()).filter(t=>t.workflowId===e)}async clearAll(){await this.initialize(),await this.withFileLock(async()=>{await this.writeSchedules([]),this.log("Cleared all schedules")})}async getStats(){let e=await this.loadSchedules(),r=new Date;return{total:e.length,enabled:e.filter(t=>t.enabled).length,disabled:e.filter(t=>!t.enabled).length,due:e.filter(t=>t.enabled&&new Date(t.nextRun)<=r).length}}async loadSchedulesUnsafe(){if(!d.existsSync(this.schedulesPath))return[];try{let e=d.readFileSync(this.schedulesPath,"utf-8");return this.parseSchedulesFile(e).schedules}catch{return[]}}parseSchedulesFile(e){let r=Buffer.byteLength(e,"utf-8");if(r>W)throw new Error(`Schedules file exceeds maximum allowed size (${W/(1024*1024)}MB). File is ${(r/(1024*1024)).toFixed(2)}MB.`);let t=R(e);if(!t.schedules||!Array.isArray(t.schedules))throw new Error("Invalid schedules file: missing schedules array");for(let i of t.schedules)if(!i.id||!i.workflowId||!i.schedule)throw new Error("Invalid schedule entry: missing required fields");return t}async writeSchedules(e){let r={version:ie,updatedAt:new Date().toISOString(),schedules:e},t=JSON.stringify(r,null,2);d.writeFileSync(this.schedulesPath,t,"utf-8"),this.log(`Wrote ${e.length} schedules to disk`)}async handleCorruptFile(e){let r=E(e);this.log(`Corrupt schedules file detected: ${r}`);let t=`${this.schedulesPath}.corrupt.${Date.now()}`;try{d.existsSync(this.schedulesPath)&&(d.copyFileSync(this.schedulesPath,t),this.log(`Backed up corrupt file to: ${t}`))}catch(i){this.log(`Failed to backup corrupt file: ${i}`)}try{d.existsSync(this.schedulesPath)&&(d.unlinkSync(this.schedulesPath),this.log("Removed corrupt schedules file"))}catch(i){this.log(`Failed to remove corrupt file: ${i}`)}}async withFileLock(e){await this.acquireLock();try{return await e()}finally{this.releaseLock()}}async acquireLock(){let e=Date.now();for(;d.existsSync(this.lockFile);){try{let r=d.statSync(this.lockFile);if(Date.now()-r.mtimeMs>O){d.unlinkSync(this.lockFile),this.log("Removed stale lock file");break}}catch{break}if(Date.now()-e>O)throw new Error("Timeout waiting for scheduler lock");await this.sleep(se)}try{d.writeFileSync(this.lockFile,`${process.pid}:${Date.now()}`,{flag:"wx"})}catch(r){if(r.code==="EEXIST")return this.acquireLock();throw r}}releaseLock(){try{d.existsSync(this.lockFile)&&d.unlinkSync(this.lockFile)}catch(e){console.debug("[PersistentScheduler] Lock release error:",e instanceof Error?e.message:e)}}sleep(e){return new Promise(r=>setTimeout(r,e))}log(e){this.debug&&console.log(`[PersistentScheduler] ${e}`)}};function re(n={}){return new b(n)}function Y(){let n=Date.now().toString(36),e=ee().slice(0,8);return`sched-${n}-${e}`}function oe(n){let e=new Date;return{id:Y(),workflowId:n.workflowId,pipelinePath:n.pipelinePath,schedule:n.schedule,scheduleDescription:n.scheduleDescription,nextRun:P(n.schedule,e).toISOString(),enabled:n.enabled??!0,createdAt:e.toISOString()}}export{le as a,de as b,ue as c,b as d,re as e,Y as f,oe as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.
|
|
2
|
-
import{b as d,d as c}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.8");process.exit(0)}
|
|
2
|
+
import{b as d,d as c}from"./chunk-BITFGVZ4.js";import{a as l,e as g}from"./chunk-HPVYJ6JH.js";g();c();import{existsSync as y,readFileSync as p}from"node:fs";import{join as o,dirname as u}from"node:path";import{fileURLToPath as m}from"node:url";var i=class extends Error{constructor(t,n,r){super(t);this.code=n;this.cause=r;this.name="PatternLoaderError"}code;cause},s=class a{static instance=null;config;patterns;isLoading=!1;constructor(e={}){this.config={basePath:e.basePath??this.getDefaultBasePath(),throwOnMissing:e.throwOnMissing??!1,validatePatterns:e.validatePatterns??!0},this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]}}static getInstance(e){return a.instance||(a.instance=new a(e)),a.instance}static resetInstance(){a.instance=null}getDefaultBasePath(){try{let e=import.meta.url,t=m(e),n=u(t),r=o(n,"..","..","..");return o(r,"assets","patterns")}catch{return o(process.cwd(),"assets","patterns")}}async loadPatterns(){if(!this.isLoading){this.isLoading=!0,this.patterns.errors=[];try{this.patterns.index=this.loadJsonFile("index.json");let[e,t,n,r]=await Promise.all([Promise.resolve(this.loadJsonFile("adr-051-booster-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-router-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-embedding-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-reasoning-patterns.json"))]);this.patterns.booster=e,this.patterns.router=t,this.patterns.embedding=n,this.patterns.reasoning=r,this.patterns.loadedAt=new Date,this.config.validatePatterns&&this.validateLoadedPatterns()}finally{this.isLoading=!1}}}loadJsonFile(e){let t=o(this.config.basePath,e);try{if(!y(t)){let r=`Pattern file not found: ${t}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"FILE_NOT_FOUND");return null}let n=p(t,"utf-8");return d(n)}catch(n){if(n instanceof i)throw n;let r=`Failed to load pattern file ${e}: ${l(n)}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"PARSE_ERROR",n instanceof Error?n:void 0);return null}}validateLoadedPatterns(){this.patterns.booster&&(Array.isArray(this.patterns.booster.patterns)||this.patterns.errors.push("Booster patterns file missing patterns array")),this.patterns.router&&(Array.isArray(this.patterns.router.patterns)||this.patterns.errors.push("Router patterns file missing patterns array")),this.patterns.embedding&&(Array.isArray(this.patterns.embedding.patterns)||this.patterns.errors.push("Embedding patterns file missing patterns array")),this.patterns.reasoning&&(Array.isArray(this.patterns.reasoning.patterns)||this.patterns.errors.push("Reasoning patterns file missing patterns array"))}async ensureLoaded(){this.patterns.loadedAt||await this.loadPatterns()}async getIndex(){return await this.ensureLoaded(),this.patterns.index}async getBoosterPatterns(){return await this.ensureLoaded(),this.patterns.booster}async getRouterPatterns(){return await this.ensureLoaded(),this.patterns.router}async getEmbeddingPatterns(){return await this.ensureLoaded(),this.patterns.embedding}async getReasoningPatterns(){return await this.ensureLoaded(),this.patterns.reasoning}async getBoosterPatternByKey(e){let t=await this.getBoosterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getRouterPatternByKey(e){let t=await this.getRouterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEmbeddingPatternByKey(e){let t=await this.getEmbeddingPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getReasoningPatternByKey(e){let t=await this.getReasoningPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEligibleBoosterTransforms(){let e=await this.getBoosterPatternByKey("booster-transform-eligibility");return e?e.eligibility_criteria.simple_transforms:[]}async getTierHierarchy(){let e=await this.getRouterPatternByKey("router-5tier-complexity");return e?e.tier_hierarchy:null}async getQualityGateThresholds(){let e=await this.getReasoningPatternByKey("reasoning-pattern-quality-gates");return e?e.gate_thresholds:null}isLoaded(){return this.patterns.loadedAt!==null}getLoadedAt(){return this.patterns.loadedAt}getErrors(){return[...this.patterns.errors]}async getStatistics(){let e=await this.getIndex();return e?e.pattern_statistics:null}async reload(){this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]},await this.loadPatterns()}async getAllPatterns(){return await this.ensureLoaded(),{...this.patterns}}};function x(){return s.getInstance()}export{x as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.
|
|
2
|
-
import{g as m,n as h}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.8");process.exit(0)}
|
|
2
|
+
import{g as m,n as h}from"./chunk-SUNXA2UR.js";import{b as g}from"./chunk-XAESN54Q.js";import{randomUUID as b}from"crypto";function v(d){let t=C[d];if(t)return{input:t.input,output:t.output};let e=m(d);if(e.inputCostPerMillion>0||e.outputCostPerMillion>0)return{input:e.inputCostPerMillion,output:e.outputCostPerMillion}}function R(){return s||(s=new l),s}function P(){s&&(s.dispose(),s=void 0)}var C,l,s,k=g(()=>{h();C={"claude-sonnet-5":{input:2,output:10,provider:"claude"},"claude-opus-5":{input:5,output:25,provider:"claude"},"claude-opus-5-5":{input:4,output:20,provider:"claude"},"claude-fable-5-1":{input:10,output:50,provider:"claude"},"claude-fable-5":{input:10,output:50,provider:"claude"},"claude-opus-4-8":{input:5,output:25,provider:"claude"},"claude-opus-4-7":{input:5,output:25,provider:"claude"},"claude-sonnet-4-6":{input:3,output:15,provider:"claude"},"claude-haiku-4-5-20251001":{input:1,output:5,provider:"claude"},"claude-haiku-4-5":{input:1,output:5,provider:"claude"},"claude-opus-4-5-20251101":{input:5,output:25,provider:"claude"},"claude-opus-4-6":{input:5,output:25,provider:"claude"},"claude-sonnet-4-20250514":{input:3,output:15,provider:"claude"},"claude-3-5-haiku-20241022":{input:1,output:5,provider:"claude"},"claude-3-opus-20240229":{input:15,output:75,provider:"claude"},"claude-3-sonnet-20240229":{input:3,output:15,provider:"claude"},"claude-3-haiku-20240307":{input:.25,output:1.25,provider:"claude"},"gpt-6-astra":{input:10,output:50,provider:"openai"},"gpt-6-sol":{input:2,output:10,provider:"openai"},"gpt-6-luna":{input:.1,output:.5,provider:"openai"},"gpt-4o":{input:5,output:15,provider:"openai"},"gpt-4o-mini":{input:.15,output:.6,provider:"openai"},"gpt-4-turbo":{input:10,output:30,provider:"openai"},"gpt-4":{input:30,output:60,provider:"openai"},"gpt-3.5-turbo":{input:.5,output:1.5,provider:"openai"},llama3:{input:0,output:0,provider:"ollama"},"llama3.1":{input:0,output:0,provider:"ollama"},codellama:{input:0,output:0,provider:"ollama"},mistral:{input:0,output:0,provider:"ollama"},mixtral:{input:0,output:0,provider:"ollama"},phi3:{input:0,output:0,provider:"ollama"},qwen2:{input:0,output:0,provider:"ollama"},"anthropic/claude-sonnet-5":{input:2,output:10,provider:"openrouter"},"anthropic/claude-opus-5":{input:5,output:25,provider:"openrouter"},"anthropic/claude-opus-5.5":{input:4,output:20,provider:"openrouter"},"anthropic/claude-haiku-4.5":{input:1,output:5,provider:"openrouter"},"openai/gpt-6-sol":{input:2,output:10,provider:"openrouter"},"openai/gpt-6-luna":{input:.1,output:.5,provider:"openrouter"},"google/gemini-3.8-flash":{input:.75,output:3.75,provider:"openrouter"},"meta-llama/llama-4-maverick":{input:.1875,output:.6525,provider:"openrouter"},"openai/gpt-oss-120b":{input:.15,output:.6,provider:"openrouter"},"qwen/qwen3-coder":{input:.3,output:1,provider:"openrouter"},"anthropic/claude-3.5-sonnet":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3.5-sonnet:beta":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3-opus":{input:15,output:75,provider:"openrouter"},"anthropic/claude-3-sonnet":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3-haiku":{input:.25,output:1.25,provider:"openrouter"},"openai/gpt-4o":{input:5,output:15,provider:"openrouter"},"openai/gpt-4o-mini":{input:.15,output:.6,provider:"openrouter"},"openai/gpt-4-turbo":{input:10,output:30,provider:"openrouter"},"openai/gpt-3.5-turbo":{input:.5,output:1.5,provider:"openrouter"},"google/gemini-pro":{input:.125,output:.375,provider:"openrouter"},"google/gemini-pro-1.5":{input:3.5,output:10.5,provider:"openrouter"},"meta-llama/llama-3.1-70b-instruct":{input:.59,output:.79,provider:"openrouter"},"meta-llama/llama-3.1-8b-instruct":{input:.06,output:.06,provider:"openrouter"},"mistralai/mistral-large":{input:2,output:6,provider:"openrouter"},"mistralai/mixtral-8x7b-instruct":{input:.24,output:.24,provider:"openrouter"},"mistralai/mistral-7b-instruct":{input:.06,output:.06,provider:"openrouter"},"anthropic.claude-opus-4-5-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-opus-4-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-sonnet-4-5-v2:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-sonnet-4-v1:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-3-5-haiku-v1:0":{input:1,output:5,provider:"bedrock"},"anthropic.claude-3-opus-20240229-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-3-sonnet-20240229-v1:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-3-haiku-20240307-v1:0":{input:.25,output:1.25,provider:"bedrock"},"anthropic.claude-3-5-sonnet-20241022-v2:0":{input:3,output:15,provider:"bedrock"},"azure/gpt-4o":{input:5,output:15,provider:"azure-openai"},"azure/gpt-4o-mini":{input:.15,output:.6,provider:"azure-openai"},"azure/gpt-4-turbo":{input:10,output:30,provider:"azure-openai"},"azure/gpt-4":{input:30,output:60,provider:"azure-openai"},"azure/gpt-35-turbo":{input:.5,output:1.5,provider:"azure-openai"},"azure/text-embedding-ada-002":{input:.1,output:0,provider:"azure-openai"},"azure/text-embedding-3-small":{input:.02,output:0,provider:"azure-openai"},"azure/text-embedding-3-large":{input:.13,output:0,provider:"azure-openai"},"gemini-3.8-flash":{input:.75,output:3.75,provider:"gemini"},"gemini-3.5-flash":{input:1.5,output:9,provider:"gemini"},"gemini-3.1-pro-preview":{input:2,output:12,provider:"gemini"},"gemini-2.5-flash":{input:.3,output:2.5,provider:"gemini"},"gemini-2.5-pro":{input:1.25,output:10,provider:"gemini"},"gemini-pro":{input:.5,output:1.5,provider:"gemini"},"gemini-1.0-pro":{input:.5,output:1.5,provider:"gemini"},"gemini-1.5-pro":{input:3.5,output:10.5,provider:"gemini"},"gemini-1.5-pro-latest":{input:3.5,output:10.5,provider:"gemini"},"gemini-1.5-flash":{input:.075,output:.3,provider:"gemini"},"gemini-1.5-flash-latest":{input:.075,output:.3,provider:"gemini"},"gemini-2.0-flash-exp":{input:.075,output:.3,provider:"gemini"},"gemini-ultra":{input:7,output:21,provider:"gemini"},"gemini-1.0-ultra":{input:7,output:21,provider:"gemini"},"text-embedding-004":{input:.025,output:0,provider:"gemini"}};l=class d{records=[];alerts=[];maxRecords;alertCheckInterval;constructor(t=1e4){this.maxRecords=t}static calculateCost(t,e){let o=v(t);if(!o)return{inputCost:0,outputCost:0,totalCost:0,currency:"USD"};let i=e.promptTokens/1e6*o.input+(e.cacheReadTokens??0)/1e6*o.input*.1+(e.cacheCreationTokens??0)/1e6*o.input*1.25,r=e.completionTokens/1e6*o.output;return{inputCost:i,outputCost:r,totalCost:i+r,currency:"USD"}}static getCostPerToken(t){let e=v(t);return e?{input:e.input/1e6,output:e.output/1e6}:{input:0,output:0}}recordUsage(t,e,o,i,r){let p=d.calculateCost(e,o),n={timestamp:new Date,provider:t,model:e,usage:o,cost:p,requestId:i,metadata:r};return this.records.push(n),this.records.length>this.maxRecords&&(this.records=this.records.slice(-this.maxRecords)),this.checkAlerts(),p}getSummary(t){let e=new Date,o=this.getPeriodStart(e,t),i=e,r=this.records.filter(a=>a.timestamp>=o&&a.timestamp<=i),p={claude:0,"claude-code":0,codex:0,openai:0,ollama:0,openrouter:0,bedrock:0,"azure-openai":0,gemini:0,cognitum:0},n={},u=0,c=0;for(let a of r)u+=a.cost.totalCost,c+=a.usage.totalTokens,p[a.provider]+=a.cost.totalCost,n[a.model]=(n[a.model]||0)+a.cost.totalCost;return{period:t,periodStart:o,periodEnd:i,totalCost:u,byProvider:p,byModel:n,totalTokens:c,totalRequests:r.length}}getCurrentCost(t){return this.getSummary(t).totalCost}getTotalTokens(t){return this.getSummary(t).totalTokens}getUsageByProvider(t,e="all"){let o=this.getPeriodStart(new Date,e),i=this.records.filter(u=>u.provider===t&&u.timestamp>=o),r={},p=0,n=0;for(let u of i)p+=u.cost.totalCost,n+=u.usage.totalTokens,r[u.model]||(r[u.model]={cost:0,tokens:0,requests:0}),r[u.model].cost+=u.cost.totalCost,r[u.model].tokens+=u.usage.totalTokens,r[u.model].requests+=1;return{totalCost:p,totalTokens:n,totalRequests:i.length,models:r}}addAlert(t,e,o){let i=`alert-${Date.now()}-${b().slice(0,12)}`;return this.alerts.push({threshold:t,period:e,onThreshold:o,active:!0}),this.alertCheckInterval||(this.alertCheckInterval=setInterval(()=>this.checkAlerts(),6e4)),i}removeAlert(t){return t>=0&&t<this.alerts.length?(this.alerts.splice(t,1),this.alerts.length===0&&this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0),!0):!1}getRecords(){return[...this.records]}importRecords(t){for(let e of t)e.timestamp=new Date(e.timestamp),this.records.push(e);this.records.length>this.maxRecords&&(this.records=this.records.slice(-this.maxRecords))}clear(){this.records=[]}getRecentRequests(t=10){return this.records.slice(-t)}estimateCost(t,e,o){return d.calculateCost(t,{promptTokens:e,completionTokens:o,totalTokens:e+o})}wouldExceedLimit(t,e,o,i,r){let p=this.getCurrentCost(r),n=this.estimateCost(t,e,o);return p+n.totalCost>i}dispose(){this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0)}getPeriodStart(t,e){let o=new Date(t);switch(e){case"minute":o.setSeconds(0,0),o.setMinutes(o.getMinutes()-1);break;case"hour":o.setMinutes(0,0,0),o.setHours(o.getHours()-1);break;case"day":o.setHours(0,0,0,0);break;case"week":o.setHours(0,0,0,0),o.setDate(o.getDate()-7);break;case"month":o.setHours(0,0,0,0),o.setDate(1);break;case"all":return new Date(0)}return o}checkAlerts(){for(let t of this.alerts){if(!t.active)continue;let e=this.getSummary(t.period);if(e.totalCost>=t.threshold){t.active=!1;try{t.onThreshold(e)}catch(o){console.error("Cost alert callback error:",o)}}}}}});export{C as a,v as b,l as c,R as d,P as e,k as f};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.
|
|
2
|
-
import{b as C,d as P}from"./chunk-OIDWDGLG.js";import{a as T}from"./chunk-TW3SR4TS.js";import{e as S}from"./chunk-5GFKTJ65.js";import{a as b,e as $}from"./chunk-ZUOVNFXK.js";import{a as w,d as M}from"./chunk-RDGPXENG.js";$();M();import{randomUUID as A}from"crypto";var x={topology:"hierarchical",maxConcurrentSkills:10,maxConcurrentModels:3,timeout:3e5,continueOnFailure:!0,retry:{maxRetries:2,retryDelayMs:1e3}},R=class{config;learner;skillValidator=null;workers=new Map;taskQueue=[];isRunning=!1;constructor(e,t){this.config={...x,...e},this.learner=t}setSkillValidator(e){this.skillValidator=e}async validateSkillsParallel(e,t,i){let s=Date.now(),a=i?.trustTier??3,n=i?.validationLevel??"eval",c=this.determineTopology(e.length,t.length),r=this.createValidationTasks(e,t,a,n),o=await this.executeTasksParallel(r,c),l=new Map;for(let u of o){let p=l.get(u.skill)||[];p.push(u),l.set(u.skill,p)}return await this.recordOutcomesToLearner(o,a,n),l}async validateSkillCrossModel(e,t,i){return(await this.validateSkillsParallel([e],t,i)).get(e)||[]}getSummary(e){let t=[],i=new Map,s=new Map;for(let[c,r]of e){i.set(c,r);for(let o of r){t.push(o);let l=s.get(o.model)||[];l.push(o),s.set(o.model,l)}}let a=t.filter(c=>c.errors.length===0&&c.evalPassRate>=.9).length,n=t.reduce((c,r)=>c+r.durationMs,0);return{totalSkills:i.size,totalModels:s.size,successCount:a,failureCount:t.length-a,overallPassRate:t.length>0?a/t.length:0,totalDurationMs:n,avgDurationMs:t.length>0?n/t.length:0,topology:this.config.topology,bySkill:i,byModel:s,results:t}}determineTopology(e,t){if(this.config.topology){let i=e*t;return i>20&&this.config.topology==="mesh"&&console.warn(`[SwarmSkillValidator] Large workload (${i} tasks) may be more efficient with hierarchical topology`),this.config.topology}return e>5||e>t*2?"hierarchical":t>5&&e<=3?"mesh":"hierarchical"}createValidationTasks(e,t,i,s){let a=[];for(let n of e)for(let c of t)a.push({id:`${n}-${c}-${Date.now()}-${A().slice(0,8)}`,skill:n,model:c,trustTier:i,validationLevel:s,timeout:this.config.timeout,retryCount:0});return a}async executeTasksParallel(e,t){this.isRunning=!0,this.taskQueue=[...e];let i=[],s=t==="hierarchical"?this.config.maxConcurrentSkills:Math.min(this.config.maxConcurrentSkills*this.config.maxConcurrentModels,e.length),a=[];for(let n=0;n<Math.min(s,e.length);n++){let c=`worker-${n}`;this.workers.set(c,{id:c,task:null,status:"idle"}),a.push(this.runWorker(c,i))}return await Promise.all(a),this.isRunning=!1,this.workers.clear(),i}async runWorker(e,t){let i=this.workers.get(e);if(i){for(;this.taskQueue.length>0&&this.isRunning;){let s=this.taskQueue.shift();if(!s)break;i.task=s,i.status="running",i.startTime=Date.now();try{let a=await this.executeValidationTask(s);t.push(a),i.result=a,i.status="completed"}catch(a){let n=this.createErrorResult(s,a);this.config.retry&&s.retryCount<this.config.retry.maxRetries&&this.config.continueOnFailure?(s.retryCount++,this.taskQueue.push(s),await this.delay(this.config.retry.retryDelayMs)):(t.push(n),i.result=n,i.status="failed")}}i.task=null,i.status="idle"}}async executeValidationTask(e){let t=Date.now();if(!this.skillValidator)return this.createSimulatedResult(e,t);let i=new Promise((n,c)=>{setTimeout(()=>c(new Error(`Validation timeout after ${e.timeout}ms`)),e.timeout)}),s=await Promise.race([this.skillValidator(e.skill,e.model,{trustTier:e.trustTier,validationLevel:e.validationLevel,timeout:e.timeout}),i]),a=Date.now()-t;return this.outcomeToResult(s,e,a)}outcomeToResult(e,t,i){let s=e.testCaseResults.filter(c=>c.passed).length,a=e.testCaseResults.length,n=a>0?s/a:e.score;return{skill:t.skill,model:t.model,schemaValid:e.validationLevel!=="schema"||e.passed,validatorPassed:e.validationLevel!=="validator"||e.passed,evalPassRate:n,durationMs:i,errors:e.passed?[]:["Validation failed"],trustTier:t.trustTier,validationLevel:t.validationLevel,retryCount:t.retryCount,timestamp:new Date}}createSimulatedResult(e,t){let i=Date.now()-t+w()*100,s=.85+w()*.15;return{skill:e.skill,model:e.model,schemaValid:!0,validatorPassed:s>.8,evalPassRate:s,durationMs:i,errors:s>.8?[]:["Simulated validation failure"],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}createErrorResult(e,t){let i=b(t);return{skill:e.skill,model:e.model,schemaValid:!1,validatorPassed:!1,evalPassRate:0,durationMs:0,errors:[i],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}async recordOutcomesToLearner(e,t,i){for(let s of e){let a={skillName:s.skill,trustTier:s.trustTier||t,validationLevel:s.validationLevel||i,model:s.model,passed:s.errors.length===0&&s.evalPassRate>=.9,score:s.evalPassRate,testCaseResults:this.createTestCaseResults(s),timestamp:s.timestamp,runId:`swarm-${Date.now()}`,metadata:{duration:s.durationMs,retryCount:s.retryCount}};await this.learner.recordValidationOutcome(a)}}createTestCaseResults(e){return[{testId:`${e.skill}-${e.model}-aggregate`,passed:e.errors.length===0,expectedPatterns:["valid-output"],actualPatterns:e.errors.length===0?["valid-output"]:[],reasoningQuality:e.evalPassRate,executionTimeMs:e.durationMs,category:"swarm-validation",priority:"high",error:e.errors.length>0?e.errors.join("; "):void 0}]}delay(e){return new Promise(t=>setTimeout(t,e))}getConfig(){return{...this.config}}isValidationRunning(){return this.isRunning}getWorkerStatus(){return Array.from(this.workers.values())}cancel(){this.isRunning=!1,this.taskQueue=[]}};function D(y,e){return new R(y,e)}var F=["security-testing","accessibility-testing","api-testing","performance-testing","visual-regression-testing","mutation-testing","contract-testing","chaos-testing","compliance-testing","penetration-testing"],I=["claude-sonnet","claude-haiku","claude-opus"];P();import{readFileSync as E,writeFileSync as L,existsSync as N}from"fs";var O={varianceThreshold:.04,regressionThreshold:.1,minSamples:3,autoUpdateManifest:!1},k=class{constructor(e,t,i={}){this.learner=e;this.manifestPath=t;this.config={...O,...i}}learner;manifestPath;config;async aggregateResults(e){let t=`agg-${Date.now()}`,i=new Date,s=this.buildSkillResultsMap(e),a=this.calculateSummary(s,e),n=await this.detectCrossModelAnomalies(e),c=await this.detectRegressions(e,this.config.regressionThreshold),r=this.generateRecommendations(s,n,c),o={timestamp:i,runId:t,summary:a,skillResults:s,crossModelAnalysis:n,regressions:c,recommendations:r,metadata:{version:"1.0.0",environment:e[0]?.metadata?.environment,generatedBy:"ValidationResultAggregator",inputs:{runIds:e.map(l=>l.runId),models:[...new Set(e.map(l=>l.model))]}}};return this.config.autoUpdateManifest&&await this.updateManifest(o),o}buildSkillResultsMap(e){let t=new Map;for(let i of e)for(let s of i.outcomes){let a=s.skillName;t.has(a)||t.set(a,{skill:a,trustTier:s.trustTier,passRateByModel:new Map,avgPassRate:0,schemaValid:!0,validatorPassed:!0,evalPassed:!0,issues:[],executionTimeMs:0,testCount:0,passedTests:0,failedTests:0});let n=t.get(a),c=s.testCaseResults.filter(r=>r.passed).length/(s.testCaseResults.length||1);n.passRateByModel.set(i.model,c),n.testCount+=s.testCaseResults.length,n.passedTests+=s.testCaseResults.filter(r=>r.passed).length,n.failedTests+=s.testCaseResults.filter(r=>!r.passed).length,n.executionTimeMs+=s.metadata?.duration||0,s.validationLevel==="schema"&&!s.passed&&(n.schemaValid=!1),s.validationLevel==="validator"&&!s.passed&&(n.validatorPassed=!1),s.validationLevel==="eval"&&!s.passed&&(n.evalPassed=!1);for(let r of s.testCaseResults)!r.passed&&r.error&&n.issues.push({skill:a,model:i.model,severity:r.priority==="critical"?"critical":r.priority==="high"?"high":r.priority==="medium"?"medium":"low",type:this.categorizeIssueType(s.validationLevel,r.error),message:r.error,testId:r.testId})}for(let i of t.values()){let s=Array.from(i.passRateByModel.values());i.avgPassRate=s.length>0?s.reduce((a,n)=>a+n,0)/s.length:0}return t}categorizeIssueType(e,t){return t.toLowerCase().includes("timeout")?"timeout":e==="schema"?"schema_failure":e==="validator"?"validator_failure":e==="eval"?"eval_failure":"error"}calculateSummary(e,t){let i=Array.from(e.values()),s=i.filter(n=>n.avgPassRate>=.9).length,a=i.length>0?i.reduce((n,c)=>n+c.avgPassRate,0)/i.length:0;return{totalSkills:i.length,passedSkills:s,failedSkills:i.length-s,avgPassRate:a,totalDurationMs:t.reduce((n,c)=>n+c.durationMs,0),totalTests:i.reduce((n,c)=>n+c.testCount,0),passedTests:i.reduce((n,c)=>n+c.passedTests,0),failedTests:i.reduce((n,c)=>n+c.failedTests,0),modelsUsed:[...new Set(t.map(n=>n.model))]}}async detectCrossModelAnomalies(e){let t=new Map,i=new Map,s=new Map;for(let d of e){t.has(d.model)||(t.set(d.model,[]),i.set(d.model,{totalTests:0,passedTests:0,skillCount:0}));for(let g of d.outcomes){let h=g.testCaseResults.filter(m=>m.passed).length/(g.testCaseResults.length||1);t.get(d.model).push(h);let f=i.get(d.model);f.totalTests+=g.testCaseResults.length,f.passedTests+=g.testCaseResults.filter(m=>m.passed).length,f.skillCount++,s.has(g.skillName)||s.set(g.skillName,{passRates:[],models:[]}),s.get(g.skillName).passRates.push(h),s.get(g.skillName).models.push(d.model)}}let a=[];for(let d of t.values())a.push(...d);let n=a.length>0?a.reduce((d,g)=>d+g,0)/a.length:0,c=a.length>1?a.reduce((d,g)=>d+Math.pow(g-n,2),0)/a.length:0,r=Math.sqrt(c),o=[],l=new Map;for(let[d,g]of t.entries()){let h=g.reduce((v,V)=>v+V,0)/g.length,f=h-n,m=i.get(d);l.set(d,{avgPassRate:h,skillCount:m.skillCount,totalTests:m.totalTests}),Math.abs(f)>this.config.varianceThreshold*2&&o.push({model:d,type:f<0?"low_performance":"high_variance",description:`Model ${d} has ${(f*100).toFixed(1)}% difference from average`,passRate:h,avgPassRate:n,deviation:Math.abs(f)})}let u=[],p=[];for(let[d,g]of s.entries()){if(g.passRates.length<2)continue;let h=g.passRates.reduce((m,v)=>m+v,0)/g.passRates.length;g.passRates.reduce((m,v)=>m+Math.pow(v-h,2),0)/g.passRates.length<this.config.varianceThreshold?u.push(d):p.push(d)}return{variance:c,stdDeviation:r,anomalies:o,consistentSkills:u,inconsistentSkills:p,modelPerformance:l}}async detectRegressions(e,t){let i=[],s=new Set;for(let a of e)for(let n of a.outcomes){let c=`${n.skillName}-${a.model}`;if(s.has(c))continue;s.add(c);let r=await this.learner.getValidationTrends(n.skillName);if(!r)continue;let o=n.testCaseResults.filter(p=>p.passed).length/(n.testCaseResults.length||1),l=r.recentPassRate,u=l-o;u>=t&&i.push({skill:n.skillName,model:a.model,previousPassRate:l,currentPassRate:o,regressionAmount:u,trend:r.overall,possibleCauses:this.analyzePossibleCauses(n,u),severity:this.categorizeRegressionSeverity(u)})}return i.sort((a,n)=>{let c={critical:0,high:1,medium:2,low:3},r=c[a.severity]-c[n.severity];return r!==0?r:n.regressionAmount-a.regressionAmount})}analyzePossibleCauses(e,t){let i=[],s=e.testCaseResults.filter(c=>!c.passed);if(s.length>0){let c=[...new Set(s.map(r=>r.category).filter(Boolean))];c.length>0&&i.push(`Failures in categories: ${c.join(", ")}`)}let a=s.filter(c=>c.priority==="critical");a.length>0&&i.push(`${a.length} critical test(s) failing`);let n=e.testCaseResults.reduce((c,r)=>c+r.reasoningQuality,0)/(e.testCaseResults.length||1);return n<.7&&i.push(`Low reasoning quality score: ${(n*100).toFixed(1)}%`),t>.3&&i.push("Possible model behavior change or prompt drift"),i.length===0&&i.push("No specific cause identified - review test details"),i}categorizeRegressionSeverity(e){return e>=.5?"critical":e>=.3?"high":e>=.15?"medium":"low"}generateRecommendations(e,t,i){let s=[];if(t.inconsistentSkills.length>0&&s.push(`Review ${t.inconsistentSkills.length} skills with inconsistent cross-model behavior: `+t.inconsistentSkills.slice(0,3).join(", ")+(t.inconsistentSkills.length>3?` and ${t.inconsistentSkills.length-3} more`:"")),t.anomalies.some(r=>r.type==="low_performance")){let r=t.anomalies.filter(o=>o.type==="low_performance").map(o=>o.model);s.push(`Investigate low performance on model(s): ${r.join(", ")}`)}let a=i.filter(r=>r.severity==="critical");a.length>0&&s.push(`URGENT: ${a.length} critical regression(s) detected - immediate review required`);let n=Array.from(e.values()).filter(r=>r.avgPassRate<.9);if(n.length>0){let r=n.filter(l=>!l.schemaValid),o=n.filter(l=>!l.validatorPassed);r.length>0&&s.push(`Fix schema validation for: ${r.map(l=>l.skill).slice(0,3).join(", ")}`),o.length>0&&s.push(`Review validator scripts for: ${o.map(l=>l.skill).slice(0,3).join(", ")}`)}return Array.from(e.values()).reduce((r,o)=>r+o.avgPassRate,0)/e.size<.8&&s.push("Overall pass rate below 80% - consider reviewing skill definitions and test expectations"),s.length===0&&s.push("All validations passing - no immediate action required"),s}async updateManifest(e){if(!N(this.manifestPath))throw new Error(`Manifest file not found: ${this.manifestPath}`);let t=C(E(this.manifestPath,"utf-8"));for(let[s,a]of e.skillResults.entries())if(t.skills&&t.skills[s]){let n=t.skills[s];n.validation||(n.validation={}),n.validation.passRate=a.avgPassRate,n.validation.lastValidated=e.timestamp.toISOString(),n.validation.status=a.avgPassRate>=.9?"passing":"failing",n.validation.passRateByModel=Object.fromEntries(a.passRateByModel)}let i=Array.from(e.skillResults.values());t.validationStatus={passing:i.filter(s=>s.avgPassRate>=.9).length,failing:i.filter(s=>s.avgPassRate<.9).length,unknown:0,skipped:t.summary?.tier0||0},t.generatedAt=new Date().toISOString(),t.lastValidationRun={runId:e.runId,timestamp:e.timestamp.toISOString(),avgPassRate:e.summary.avgPassRate,modelsUsed:e.summary.modelsUsed},L(this.manifestPath,JSON.stringify(t,null,2))}generateMarkdownReport(e){let{summary:t,crossModelAnalysis:i,regressions:s,recommendations:a,skillResults:n}=e,c=(t.avgPassRate>=.9||t.avgPassRate>=.7,"`"),r=[];if(r.push(`# Validation Report
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.8");process.exit(0)}
|
|
2
|
+
import{b as C,d as P}from"./chunk-BITFGVZ4.js";import{a as w,d as M}from"./chunk-SVP3BP52.js";import{a as T}from"./chunk-U64QORFO.js";import{e as S}from"./chunk-J5HTQHJK.js";import{a as b,e as $}from"./chunk-HPVYJ6JH.js";$();M();import{randomUUID as A}from"crypto";var x={topology:"hierarchical",maxConcurrentSkills:10,maxConcurrentModels:3,timeout:3e5,continueOnFailure:!0,retry:{maxRetries:2,retryDelayMs:1e3}},R=class{config;learner;skillValidator=null;workers=new Map;taskQueue=[];isRunning=!1;constructor(e,t){this.config={...x,...e},this.learner=t}setSkillValidator(e){this.skillValidator=e}async validateSkillsParallel(e,t,i){let s=Date.now(),a=i?.trustTier??3,n=i?.validationLevel??"eval",c=this.determineTopology(e.length,t.length),r=this.createValidationTasks(e,t,a,n),o=await this.executeTasksParallel(r,c),l=new Map;for(let u of o){let p=l.get(u.skill)||[];p.push(u),l.set(u.skill,p)}return await this.recordOutcomesToLearner(o,a,n),l}async validateSkillCrossModel(e,t,i){return(await this.validateSkillsParallel([e],t,i)).get(e)||[]}getSummary(e){let t=[],i=new Map,s=new Map;for(let[c,r]of e){i.set(c,r);for(let o of r){t.push(o);let l=s.get(o.model)||[];l.push(o),s.set(o.model,l)}}let a=t.filter(c=>c.errors.length===0&&c.evalPassRate>=.9).length,n=t.reduce((c,r)=>c+r.durationMs,0);return{totalSkills:i.size,totalModels:s.size,successCount:a,failureCount:t.length-a,overallPassRate:t.length>0?a/t.length:0,totalDurationMs:n,avgDurationMs:t.length>0?n/t.length:0,topology:this.config.topology,bySkill:i,byModel:s,results:t}}determineTopology(e,t){if(this.config.topology){let i=e*t;return i>20&&this.config.topology==="mesh"&&console.warn(`[SwarmSkillValidator] Large workload (${i} tasks) may be more efficient with hierarchical topology`),this.config.topology}return e>5||e>t*2?"hierarchical":t>5&&e<=3?"mesh":"hierarchical"}createValidationTasks(e,t,i,s){let a=[];for(let n of e)for(let c of t)a.push({id:`${n}-${c}-${Date.now()}-${A().slice(0,8)}`,skill:n,model:c,trustTier:i,validationLevel:s,timeout:this.config.timeout,retryCount:0});return a}async executeTasksParallel(e,t){this.isRunning=!0,this.taskQueue=[...e];let i=[],s=t==="hierarchical"?this.config.maxConcurrentSkills:Math.min(this.config.maxConcurrentSkills*this.config.maxConcurrentModels,e.length),a=[];for(let n=0;n<Math.min(s,e.length);n++){let c=`worker-${n}`;this.workers.set(c,{id:c,task:null,status:"idle"}),a.push(this.runWorker(c,i))}return await Promise.all(a),this.isRunning=!1,this.workers.clear(),i}async runWorker(e,t){let i=this.workers.get(e);if(i){for(;this.taskQueue.length>0&&this.isRunning;){let s=this.taskQueue.shift();if(!s)break;i.task=s,i.status="running",i.startTime=Date.now();try{let a=await this.executeValidationTask(s);t.push(a),i.result=a,i.status="completed"}catch(a){let n=this.createErrorResult(s,a);this.config.retry&&s.retryCount<this.config.retry.maxRetries&&this.config.continueOnFailure?(s.retryCount++,this.taskQueue.push(s),await this.delay(this.config.retry.retryDelayMs)):(t.push(n),i.result=n,i.status="failed")}}i.task=null,i.status="idle"}}async executeValidationTask(e){let t=Date.now();if(!this.skillValidator)return this.createSimulatedResult(e,t);let i=new Promise((n,c)=>{setTimeout(()=>c(new Error(`Validation timeout after ${e.timeout}ms`)),e.timeout)}),s=await Promise.race([this.skillValidator(e.skill,e.model,{trustTier:e.trustTier,validationLevel:e.validationLevel,timeout:e.timeout}),i]),a=Date.now()-t;return this.outcomeToResult(s,e,a)}outcomeToResult(e,t,i){let s=e.testCaseResults.filter(c=>c.passed).length,a=e.testCaseResults.length,n=a>0?s/a:e.score;return{skill:t.skill,model:t.model,schemaValid:e.validationLevel!=="schema"||e.passed,validatorPassed:e.validationLevel!=="validator"||e.passed,evalPassRate:n,durationMs:i,errors:e.passed?[]:["Validation failed"],trustTier:t.trustTier,validationLevel:t.validationLevel,retryCount:t.retryCount,timestamp:new Date}}createSimulatedResult(e,t){let i=Date.now()-t+w()*100,s=.85+w()*.15;return{skill:e.skill,model:e.model,schemaValid:!0,validatorPassed:s>.8,evalPassRate:s,durationMs:i,errors:s>.8?[]:["Simulated validation failure"],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}createErrorResult(e,t){let i=b(t);return{skill:e.skill,model:e.model,schemaValid:!1,validatorPassed:!1,evalPassRate:0,durationMs:0,errors:[i],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}async recordOutcomesToLearner(e,t,i){for(let s of e){let a={skillName:s.skill,trustTier:s.trustTier||t,validationLevel:s.validationLevel||i,model:s.model,passed:s.errors.length===0&&s.evalPassRate>=.9,score:s.evalPassRate,testCaseResults:this.createTestCaseResults(s),timestamp:s.timestamp,runId:`swarm-${Date.now()}`,metadata:{duration:s.durationMs,retryCount:s.retryCount}};await this.learner.recordValidationOutcome(a)}}createTestCaseResults(e){return[{testId:`${e.skill}-${e.model}-aggregate`,passed:e.errors.length===0,expectedPatterns:["valid-output"],actualPatterns:e.errors.length===0?["valid-output"]:[],reasoningQuality:e.evalPassRate,executionTimeMs:e.durationMs,category:"swarm-validation",priority:"high",error:e.errors.length>0?e.errors.join("; "):void 0}]}delay(e){return new Promise(t=>setTimeout(t,e))}getConfig(){return{...this.config}}isValidationRunning(){return this.isRunning}getWorkerStatus(){return Array.from(this.workers.values())}cancel(){this.isRunning=!1,this.taskQueue=[]}};function D(y,e){return new R(y,e)}var F=["security-testing","accessibility-testing","api-testing","performance-testing","visual-regression-testing","mutation-testing","contract-testing","chaos-testing","compliance-testing","penetration-testing"],I=["claude-sonnet","claude-haiku","claude-opus"];P();import{readFileSync as E,writeFileSync as L,existsSync as N}from"fs";var O={varianceThreshold:.04,regressionThreshold:.1,minSamples:3,autoUpdateManifest:!1},k=class{constructor(e,t,i={}){this.learner=e;this.manifestPath=t;this.config={...O,...i}}learner;manifestPath;config;async aggregateResults(e){let t=`agg-${Date.now()}`,i=new Date,s=this.buildSkillResultsMap(e),a=this.calculateSummary(s,e),n=await this.detectCrossModelAnomalies(e),c=await this.detectRegressions(e,this.config.regressionThreshold),r=this.generateRecommendations(s,n,c),o={timestamp:i,runId:t,summary:a,skillResults:s,crossModelAnalysis:n,regressions:c,recommendations:r,metadata:{version:"1.0.0",environment:e[0]?.metadata?.environment,generatedBy:"ValidationResultAggregator",inputs:{runIds:e.map(l=>l.runId),models:[...new Set(e.map(l=>l.model))]}}};return this.config.autoUpdateManifest&&await this.updateManifest(o),o}buildSkillResultsMap(e){let t=new Map;for(let i of e)for(let s of i.outcomes){let a=s.skillName;t.has(a)||t.set(a,{skill:a,trustTier:s.trustTier,passRateByModel:new Map,avgPassRate:0,schemaValid:!0,validatorPassed:!0,evalPassed:!0,issues:[],executionTimeMs:0,testCount:0,passedTests:0,failedTests:0});let n=t.get(a),c=s.testCaseResults.filter(r=>r.passed).length/(s.testCaseResults.length||1);n.passRateByModel.set(i.model,c),n.testCount+=s.testCaseResults.length,n.passedTests+=s.testCaseResults.filter(r=>r.passed).length,n.failedTests+=s.testCaseResults.filter(r=>!r.passed).length,n.executionTimeMs+=s.metadata?.duration||0,s.validationLevel==="schema"&&!s.passed&&(n.schemaValid=!1),s.validationLevel==="validator"&&!s.passed&&(n.validatorPassed=!1),s.validationLevel==="eval"&&!s.passed&&(n.evalPassed=!1);for(let r of s.testCaseResults)!r.passed&&r.error&&n.issues.push({skill:a,model:i.model,severity:r.priority==="critical"?"critical":r.priority==="high"?"high":r.priority==="medium"?"medium":"low",type:this.categorizeIssueType(s.validationLevel,r.error),message:r.error,testId:r.testId})}for(let i of t.values()){let s=Array.from(i.passRateByModel.values());i.avgPassRate=s.length>0?s.reduce((a,n)=>a+n,0)/s.length:0}return t}categorizeIssueType(e,t){return t.toLowerCase().includes("timeout")?"timeout":e==="schema"?"schema_failure":e==="validator"?"validator_failure":e==="eval"?"eval_failure":"error"}calculateSummary(e,t){let i=Array.from(e.values()),s=i.filter(n=>n.avgPassRate>=.9).length,a=i.length>0?i.reduce((n,c)=>n+c.avgPassRate,0)/i.length:0;return{totalSkills:i.length,passedSkills:s,failedSkills:i.length-s,avgPassRate:a,totalDurationMs:t.reduce((n,c)=>n+c.durationMs,0),totalTests:i.reduce((n,c)=>n+c.testCount,0),passedTests:i.reduce((n,c)=>n+c.passedTests,0),failedTests:i.reduce((n,c)=>n+c.failedTests,0),modelsUsed:[...new Set(t.map(n=>n.model))]}}async detectCrossModelAnomalies(e){let t=new Map,i=new Map,s=new Map;for(let d of e){t.has(d.model)||(t.set(d.model,[]),i.set(d.model,{totalTests:0,passedTests:0,skillCount:0}));for(let g of d.outcomes){let h=g.testCaseResults.filter(m=>m.passed).length/(g.testCaseResults.length||1);t.get(d.model).push(h);let f=i.get(d.model);f.totalTests+=g.testCaseResults.length,f.passedTests+=g.testCaseResults.filter(m=>m.passed).length,f.skillCount++,s.has(g.skillName)||s.set(g.skillName,{passRates:[],models:[]}),s.get(g.skillName).passRates.push(h),s.get(g.skillName).models.push(d.model)}}let a=[];for(let d of t.values())a.push(...d);let n=a.length>0?a.reduce((d,g)=>d+g,0)/a.length:0,c=a.length>1?a.reduce((d,g)=>d+Math.pow(g-n,2),0)/a.length:0,r=Math.sqrt(c),o=[],l=new Map;for(let[d,g]of t.entries()){let h=g.reduce((v,V)=>v+V,0)/g.length,f=h-n,m=i.get(d);l.set(d,{avgPassRate:h,skillCount:m.skillCount,totalTests:m.totalTests}),Math.abs(f)>this.config.varianceThreshold*2&&o.push({model:d,type:f<0?"low_performance":"high_variance",description:`Model ${d} has ${(f*100).toFixed(1)}% difference from average`,passRate:h,avgPassRate:n,deviation:Math.abs(f)})}let u=[],p=[];for(let[d,g]of s.entries()){if(g.passRates.length<2)continue;let h=g.passRates.reduce((m,v)=>m+v,0)/g.passRates.length;g.passRates.reduce((m,v)=>m+Math.pow(v-h,2),0)/g.passRates.length<this.config.varianceThreshold?u.push(d):p.push(d)}return{variance:c,stdDeviation:r,anomalies:o,consistentSkills:u,inconsistentSkills:p,modelPerformance:l}}async detectRegressions(e,t){let i=[],s=new Set;for(let a of e)for(let n of a.outcomes){let c=`${n.skillName}-${a.model}`;if(s.has(c))continue;s.add(c);let r=await this.learner.getValidationTrends(n.skillName);if(!r)continue;let o=n.testCaseResults.filter(p=>p.passed).length/(n.testCaseResults.length||1),l=r.recentPassRate,u=l-o;u>=t&&i.push({skill:n.skillName,model:a.model,previousPassRate:l,currentPassRate:o,regressionAmount:u,trend:r.overall,possibleCauses:this.analyzePossibleCauses(n,u),severity:this.categorizeRegressionSeverity(u)})}return i.sort((a,n)=>{let c={critical:0,high:1,medium:2,low:3},r=c[a.severity]-c[n.severity];return r!==0?r:n.regressionAmount-a.regressionAmount})}analyzePossibleCauses(e,t){let i=[],s=e.testCaseResults.filter(c=>!c.passed);if(s.length>0){let c=[...new Set(s.map(r=>r.category).filter(Boolean))];c.length>0&&i.push(`Failures in categories: ${c.join(", ")}`)}let a=s.filter(c=>c.priority==="critical");a.length>0&&i.push(`${a.length} critical test(s) failing`);let n=e.testCaseResults.reduce((c,r)=>c+r.reasoningQuality,0)/(e.testCaseResults.length||1);return n<.7&&i.push(`Low reasoning quality score: ${(n*100).toFixed(1)}%`),t>.3&&i.push("Possible model behavior change or prompt drift"),i.length===0&&i.push("No specific cause identified - review test details"),i}categorizeRegressionSeverity(e){return e>=.5?"critical":e>=.3?"high":e>=.15?"medium":"low"}generateRecommendations(e,t,i){let s=[];if(t.inconsistentSkills.length>0&&s.push(`Review ${t.inconsistentSkills.length} skills with inconsistent cross-model behavior: `+t.inconsistentSkills.slice(0,3).join(", ")+(t.inconsistentSkills.length>3?` and ${t.inconsistentSkills.length-3} more`:"")),t.anomalies.some(r=>r.type==="low_performance")){let r=t.anomalies.filter(o=>o.type==="low_performance").map(o=>o.model);s.push(`Investigate low performance on model(s): ${r.join(", ")}`)}let a=i.filter(r=>r.severity==="critical");a.length>0&&s.push(`URGENT: ${a.length} critical regression(s) detected - immediate review required`);let n=Array.from(e.values()).filter(r=>r.avgPassRate<.9);if(n.length>0){let r=n.filter(l=>!l.schemaValid),o=n.filter(l=>!l.validatorPassed);r.length>0&&s.push(`Fix schema validation for: ${r.map(l=>l.skill).slice(0,3).join(", ")}`),o.length>0&&s.push(`Review validator scripts for: ${o.map(l=>l.skill).slice(0,3).join(", ")}`)}return Array.from(e.values()).reduce((r,o)=>r+o.avgPassRate,0)/e.size<.8&&s.push("Overall pass rate below 80% - consider reviewing skill definitions and test expectations"),s.length===0&&s.push("All validations passing - no immediate action required"),s}async updateManifest(e){if(!N(this.manifestPath))throw new Error(`Manifest file not found: ${this.manifestPath}`);let t=C(E(this.manifestPath,"utf-8"));for(let[s,a]of e.skillResults.entries())if(t.skills&&t.skills[s]){let n=t.skills[s];n.validation||(n.validation={}),n.validation.passRate=a.avgPassRate,n.validation.lastValidated=e.timestamp.toISOString(),n.validation.status=a.avgPassRate>=.9?"passing":"failing",n.validation.passRateByModel=Object.fromEntries(a.passRateByModel)}let i=Array.from(e.skillResults.values());t.validationStatus={passing:i.filter(s=>s.avgPassRate>=.9).length,failing:i.filter(s=>s.avgPassRate<.9).length,unknown:0,skipped:t.summary?.tier0||0},t.generatedAt=new Date().toISOString(),t.lastValidationRun={runId:e.runId,timestamp:e.timestamp.toISOString(),avgPassRate:e.summary.avgPassRate,modelsUsed:e.summary.modelsUsed},L(this.manifestPath,JSON.stringify(t,null,2))}generateMarkdownReport(e){let{summary:t,crossModelAnalysis:i,regressions:s,recommendations:a,skillResults:n}=e,c=(t.avgPassRate>=.9||t.avgPassRate>=.7,"`"),r=[];if(r.push(`# Validation Report
|
|
3
3
|
|
|
4
4
|
> ${c} Generated: ${e.timestamp.toISOString()}
|
|
5
5
|
> Run ID: ${e.runId}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.
|
|
2
|
-
import{b as e}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.8");process.exit(0)}
|
|
2
|
+
import{b as e}from"./chunk-XAESN54Q.js";function r(t){t.exec(n)}var n,a=e(()=>{"use strict";n=`
|
|
3
3
|
-- Negative pattern records (ADR-110 kept nulls)
|
|
4
4
|
CREATE TABLE IF NOT EXISTS qe_pattern_nulls (
|
|
5
5
|
id TEXT PRIMARY KEY,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.8");process.exit(0)}
|
|
2
2
|
import{createHash as l}from"crypto";var u="0".repeat(64);function k(t){return l("sha256").update(t,"utf-8").digest("hex")}function v(t){try{return l("shake256",{outputLength:32}).update(t,"utf-8").digest("hex")}catch{return k(t)}}function o(t,e){return t==="shake256"?v(e):k(e)}function h(t){return JSON.stringify({id:t.id,prev_hash:t.prev_hash,action_hash:t.action_hash,action_type:t.action_type,action_data:t.action_data,timestamp:t.timestamp,actor:t.actor})}function c(t){return Buffer.from(t.prev_hash+t.action_hash+t.action_type+t.timestamp+t.actor,"utf-8")}var m="CHAIN_REANCHOR";function y(t){return o(t.hash_algo||"sha256",h(t))}var f=class{constructor(e,n,i={}){this.db=e;this.keyManager=n;this.options=i}db;keyManager;options;archiveRows=null;parentIndex=new Map;acks=new Map;pins=[];forks=[];tamper;signatureFailures=0;firstSignatureFailure;entriesChecked=0;archiveExists;run(){let e=g(this.db,"witness_chain")?this.db.prepare("SELECT * FROM witness_chain ORDER BY id ASC").all():[];return e.length===0?this.getArchive().length>0?(this.tamper={id:1,reason:"live-chain-missing"},this.result(1)):{valid:!0,entriesChecked:0,status:"valid",tampered:!1,forks:[],acknowledgedForks:[],forkDetails:[]}:(this.walk(e,"live")&&this.options.includeArchive&&this.walk(this.getArchive(),"archive"),this.tamper||this.checkPins(),this.result(e[0].id))}walk(e,n){for(let i=0;i<e.length;i++){let r=e[i];this.entriesChecked++;let s=this.classify(r,i>0?e[i-1]:void 0);if(s.kind==="tamper")return this.tamper={id:r.id,reason:s.reason},!1;if(s.kind==="fork")this.forks.push({id:r.id,parentId:s.parentId,prevHash:r.prev_hash,actionHash:r.action_hash,table:n,acknowledged:!1});else if(r.action_type===m){if(this.checkSignature(r)==="invalid")return this.tamper={id:r.id,reason:"reanchor-signature-invalid"},!1;this.registerReanchor(r)}this.checkAllSignatures(r)}return!0}classify(e,n){let i=e.hash_algo||"sha256";if(e.action_hash!==o(i,e.action_data))return{kind:"tamper",reason:"action-hash-mismatch"};if(e.id===1)return e.prev_hash===u?{kind:"linked"}:{kind:"tamper",reason:"genesis-link-mismatch"};if(n&&e.prev_hash===o(i,h(n)))return this.idsContiguous(n.id,e.id)?{kind:"linked"}:{kind:"tamper",reason:"id-gap"};let r=this.findEntryById(e.id-1);if(r&&e.prev_hash===o(i,h(r)))return{kind:"linked"};let s=this.lookupParent(i,e.prev_hash);return s!==void 0&&s<e.id?this.idsContiguous(s,e.id)?this.checkSignature(e)==="invalid"?{kind:"tamper",reason:"fork-signature-invalid"}:{kind:"fork",parentId:s}:{kind:"tamper",reason:"id-gap"}:{kind:"tamper",reason:e.prev_hash===u?"unlinked-genesis-prev-hash":"unlinked-prev-hash"}}findEntryById(e){return this.db.prepare("SELECT * FROM witness_chain WHERE id = ?").get(e)??(this.hasArchive()?this.db.prepare("SELECT * FROM witness_chain_archive WHERE id = ?").get(e):void 0)}getArchive(){return this.archiveRows||(this.archiveRows=this.hasArchive()?this.db.prepare("SELECT * FROM witness_chain_archive ORDER BY id ASC").all():[]),this.archiveRows}hasArchive(){return this.archiveExists===void 0&&(this.archiveExists=g(this.db,"witness_chain_archive")),this.archiveExists}lookupParent(e,n){let i=this.parentIndex.get(e);if(!i){i=new Map;let r=this.db.prepare("SELECT * FROM witness_chain").iterate();for(let s of r)i.set(o(e,h(s)),s.id);for(let s of this.getArchive()){let d=o(e,h(s));i.has(d)||i.set(d,s.id)}this.parentIndex.set(e,i)}return i.get(n)}idsContiguous(e,n){let i=n-e-1;return i<=0?!0:(this.hasArchive()?this.db.prepare(`SELECT COUNT(*) AS n FROM (
|
|
3
3
|
SELECT id FROM witness_chain WHERE id > ? AND id < ?
|
|
4
4
|
UNION SELECT id FROM witness_chain_archive WHERE id > ? AND id < ?)`).get(e,n,e,n):this.db.prepare("SELECT COUNT(*) AS n FROM witness_chain WHERE id > ? AND id < ?").get(e,n)).n===i}checkSignature(e){return!e.signature||!e.signer_key_id?"unsigned":!this.keyManager||!this.keyManager.hasKey(e.signer_key_id)?"unverifiable":this.keyManager.verify(c(e),Buffer.from(e.signature,"hex"),e.signer_key_id)?"ok":"invalid"}checkAllSignatures(e){if(this.options.checkSignatures!==!0||!this.keyManager||!e.signature||!e.signer_key_id)return;this.keyManager.verify(c(e),Buffer.from(e.signature,"hex"),e.signer_key_id)||(this.signatureFailures++,this.firstSignatureFailure??=e.id)}registerReanchor(e){let n;try{n=JSON.parse(e.action_data)??{}}catch{return}if(Array.isArray(n.forks))for(let i of n.forks){if(typeof i?.id!="number"||i.id>=e.id||typeof i.parentId!="number"||typeof i.prevHash!="string"||typeof i.actionHash!="string")continue;let r=this.acks.get(i.id)??[];r.push({id:i.id,parentId:i.parentId,prevHash:i.prevHash,actionHash:i.actionHash}),this.acks.set(i.id,r)}if(Array.isArray(n.pins))for(let i of n.pins)typeof i?.id=="number"&&typeof i.hash=="string"&&this.pins.push({id:i.id,hash:i.hash})}checkPins(){for(let e of this.pins){let n=this.findEntryById(e.id);if(!n||y(n)!==e.hash){this.tamper={id:e.id,reason:"reanchored-row-changed"};return}}}result(e){for(let a of this.forks)a.acknowledged=(this.acks.get(a.id)??[]).some(p=>p.parentId===a.parentId&&p.prevHash===a.prevHash&&p.actionHash===a.actionHash);let n=this.forks.filter(a=>!a.acknowledged),i=this.tamper!==void 0||this.signatureFailures>0,r=i?"tampered":n.length>0?"forked":this.forks.length>0?"valid-with-forks":"valid",s=r==="valid"||r==="valid-with-forks",d=n[0]?.id??this.tamper?.id??(this.signatureFailures>0?e:void 0);return{valid:s,entriesChecked:this.entriesChecked,signatureFailures:this.signatureFailures,status:r,tampered:i,forks:this.forks.map(a=>a.id),acknowledgedForks:this.forks.filter(a=>a.acknowledged).map(a=>a.id),forkDetails:this.forks,...d!==void 0&&!s?{brokenAt:d}:{},...i?{tamperedAt:this.tamper?.id??this.firstSignatureFailure,tamperReason:this.tamper?.reason??"signature-invalid"}:{}}}};function R(t,e,n){return new f(t,e,n).run()}function g(t,e){return t.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(e)!==void 0}export{u as a,k as b,v as c,o as d,h as e,c as f,m as g,y as h,f as i,R as j,g as k};
|