agentic-qe 3.14.6 → 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 +204 -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 +8 -8
- package/dist/cli/chunks/adapter-XYCOXQCC.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-2YGML6OU.js → agent-booster-wasm-67OKGDGZ.js} +2 -2
- package/dist/cli/chunks/{agent-handler-D5SSQYNU.js → agent-handler-4HZEQ3WQ.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-YHPLTITV.js → agent-memory-branch-IBHZQSRN.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-DTJCROTG.js +2 -0
- package/dist/cli/chunks/{arena-7BGOXGXO.js → arena-EJBIGSF4.js} +2 -2
- package/dist/cli/chunks/{arena-MCE6EU7K.js → arena-LCLRGUIK.js} +4 -4
- package/dist/cli/chunks/{audit-BMWTQECB.js → audit-PY4JNDQQ.js} +3 -3
- package/dist/cli/chunks/base-5TQ34GMD.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-PMUNGASU.js → better-sqlite3-2JG5K6XT.js} +2 -2
- package/dist/cli/chunks/{brain-handler-QPUFYX7F.js → brain-handler-3UYK55GA.js} +4 -4
- package/dist/cli/chunks/{branch-enumerator-WKFDGRN4.js → branch-enumerator-GOSWOX46.js} +2 -2
- package/dist/cli/chunks/{browser-VY5HKH5X.js → browser-DC2JV47Z.js} +2 -2
- package/dist/cli/chunks/browser-workflow-KWX4ESTJ.js +2 -0
- package/dist/cli/chunks/{chunk-FWASDOT2.js → chunk-25EEIAHS.js} +2 -2
- package/dist/cli/chunks/{chunk-P6OYS755.js → chunk-3576QGPP.js} +1 -1
- package/dist/cli/chunks/{chunk-2TMWAQQ3.js → chunk-3EKG7HFV.js} +4 -4
- package/dist/cli/chunks/{chunk-QZANMBIT.js → chunk-3FCHH4VP.js} +1 -1
- package/dist/cli/chunks/{chunk-CD542DNJ.js → chunk-3S5IIK32.js} +1 -1
- package/dist/cli/chunks/{chunk-5VFPCSK7.js → chunk-3X2JSW3R.js} +1 -1
- package/dist/cli/chunks/{chunk-D45SG6CP.js → chunk-4HXFPBAA.js} +1 -1
- package/dist/cli/chunks/{chunk-JVNTSNWU.js → chunk-4PY44TKH.js} +2 -2
- package/dist/cli/chunks/{chunk-DZ3AUAAB.js → chunk-4RNCVSVN.js} +2 -2
- package/dist/cli/chunks/{chunk-JBTPOIAC.js → chunk-56M4QNXU.js} +2 -2
- package/dist/cli/chunks/{chunk-H52HZ67P.js → chunk-5X4HDW5W.js} +2 -2
- package/dist/cli/chunks/{chunk-UNFFDHER.js → chunk-673XJBGW.js} +10 -32
- package/dist/cli/chunks/{chunk-RTFO5UQH.js → chunk-6F7MFHTY.js} +2 -2
- package/dist/cli/chunks/{chunk-Y3LZ35OG.js → chunk-6GJWT2OY.js} +2 -2
- package/dist/cli/chunks/{chunk-JXGFRBUO.js → chunk-6GNWVPMR.js} +2 -2
- package/dist/cli/chunks/{chunk-3EA536JF.js → chunk-6VTC3OHD.js} +2 -2
- package/dist/cli/chunks/{chunk-W6HXLH5G.js → chunk-775WGWLL.js} +3 -3
- package/dist/cli/chunks/{chunk-TVYY3OCX.js → chunk-77WL5HQW.js} +1 -1
- package/dist/cli/chunks/chunk-7STWD4KJ.js +3 -0
- package/dist/cli/chunks/{chunk-YSLL6VSL.js → chunk-7TNCEVWX.js} +2 -2
- package/dist/cli/chunks/{chunk-Z7WODOTH.js → chunk-7X3LMTRA.js} +2 -2
- package/dist/cli/chunks/{chunk-RZZCUIAI.js → chunk-A53MMSGC.js} +2 -2
- package/dist/cli/chunks/{chunk-QW6VMTBR.js → chunk-A5CLVZC3.js} +2 -2
- package/dist/cli/chunks/{chunk-IG5GNEC6.js → chunk-AEYJ4ZLA.js} +1 -1
- package/dist/cli/chunks/{chunk-NMAIY4PX.js → chunk-AJ5PCJQ2.js} +11 -11
- package/dist/cli/chunks/{chunk-WO4QMXIG.js → chunk-AJMAKUS3.js} +2 -2
- package/dist/cli/chunks/{chunk-2NPKIBAZ.js → chunk-AOD2ES44.js} +2 -2
- package/dist/cli/chunks/chunk-AR2S4DOB.js +2 -0
- package/dist/cli/chunks/{chunk-257E2A5M.js → chunk-AUFV2G2J.js} +5 -5
- package/dist/cli/chunks/{chunk-BVR7RMC5.js → chunk-B2QKBQYD.js} +1 -1
- package/dist/cli/chunks/{chunk-B6D2CHEH.js → chunk-BCCSV3RH.js} +1 -1
- package/dist/cli/chunks/{chunk-2YXGBZWV.js → chunk-BFIXUKOR.js} +1 -1
- package/dist/cli/chunks/chunk-BHPTHC5O.js +4 -0
- package/dist/cli/chunks/{chunk-AIRGNL55.js → chunk-BITFGVZ4.js} +2 -2
- package/dist/cli/chunks/{chunk-MBRHSU6W.js → chunk-BL6273KR.js} +10 -10
- package/dist/cli/chunks/{chunk-SMDN3BQZ.js → chunk-BOIUENWW.js} +1 -1
- package/dist/cli/chunks/{chunk-YS4FCTWF.js → chunk-BT3MI2BW.js} +1 -1
- package/dist/cli/chunks/{chunk-JZOS5FCX.js → chunk-BTBJ2NLH.js} +2 -2
- package/dist/cli/chunks/{chunk-CCK4BF76.js → chunk-BUVJIVFG.js} +1 -1
- package/dist/cli/chunks/{chunk-2JVWITNK.js → chunk-BZIPW2PA.js} +56 -80
- package/dist/cli/chunks/{chunk-BPEDWS6O.js → chunk-C647D42G.js} +2 -2
- package/dist/cli/chunks/{chunk-6U7LNMWZ.js → chunk-CBWM5NOO.js} +3 -3
- package/dist/cli/chunks/{chunk-72KXSMWI.js → chunk-CIEXUYY7.js} +1 -1
- package/dist/cli/chunks/{chunk-SE4WIB26.js → chunk-CLUHGBLN.js} +4 -4
- package/dist/cli/chunks/{chunk-JIXUMYKZ.js → chunk-CQEWL32R.js} +1 -1
- package/dist/cli/chunks/{chunk-CM7U6TAX.js → chunk-CXUC7YKA.js} +2 -2
- package/dist/cli/chunks/{chunk-7LPR6HJG.js → chunk-D2Y36V5J.js} +2 -2
- package/dist/cli/chunks/{chunk-BJTJLJRZ.js → chunk-DSJJHPPS.js} +4 -4
- package/dist/cli/chunks/{chunk-ZVWVV4EX.js → chunk-DZHXCOSK.js} +1 -1
- package/dist/cli/chunks/{chunk-7Z5LHRC3.js → chunk-EBV3WFIR.js} +2 -2
- package/dist/cli/chunks/{chunk-KNNISEDY.js → chunk-EKO5QL2B.js} +1 -1
- package/dist/cli/chunks/{chunk-XAS3XRYM.js → chunk-EMOZ5O5S.js} +1 -1
- package/dist/cli/chunks/{chunk-62N4NUJH.js → chunk-ES7TAJRJ.js} +2 -2
- package/dist/cli/chunks/chunk-EXQGHTPD.js +65 -0
- package/dist/cli/chunks/{chunk-Q7EAGKAE.js → chunk-F2WAB4WK.js} +2 -2
- package/dist/cli/chunks/{chunk-L4RUBPLR.js → chunk-F57FTFWS.js} +2 -2
- package/dist/cli/chunks/{chunk-GGRHV6D7.js → chunk-F6JJNBE5.js} +1 -1
- package/dist/cli/chunks/{chunk-3EZOZN25.js → chunk-FRC7AFB4.js} +2 -2
- package/dist/cli/chunks/{chunk-RSXXCL4A.js → chunk-G36RZF2Y.js} +1 -1
- package/dist/cli/chunks/{chunk-ZSPU4MOS.js → chunk-G3C7Z6FO.js} +2 -2
- package/dist/cli/chunks/{chunk-SNOBH4AZ.js → chunk-GA63ESNT.js} +2 -2
- package/dist/cli/chunks/{chunk-HNFVJP4I.js → chunk-GHMJFICO.js} +2 -2
- package/dist/cli/chunks/{chunk-7D3V65N5.js → chunk-GK5WLUX3.js} +1 -1
- package/dist/cli/chunks/{chunk-RETBYIAC.js → chunk-GQJ4QDEN.js} +6 -6
- package/dist/cli/chunks/chunk-GVLRE3BV.js +12 -0
- package/dist/cli/chunks/{chunk-MW2GGZZ5.js → chunk-H5UH234L.js} +1 -1
- package/dist/cli/chunks/{chunk-HM6ZSCPI.js → chunk-HBAFXWSO.js} +1 -1
- package/dist/cli/chunks/{chunk-DHVX5UB2.js → chunk-HE3BDBAO.js} +2 -2
- package/dist/cli/chunks/{chunk-YFBSPLJG.js → chunk-HHANMCD2.js} +1 -1
- package/dist/cli/chunks/chunk-HPVYJ6JH.js +2 -0
- package/dist/cli/chunks/{chunk-PX5YDCRH.js → chunk-I6NZFBT3.js} +3 -3
- package/dist/cli/chunks/{chunk-5J6W7SIA.js → chunk-ISBOHF6Y.js} +1 -1
- package/dist/cli/chunks/{chunk-UCFQALXO.js → chunk-J24AJEDE.js} +2 -2
- package/dist/cli/chunks/{chunk-FBMN7B46.js → chunk-J5HTQHJK.js} +2 -2
- package/dist/cli/chunks/{chunk-GPYVDFB3.js → chunk-JDOVO4E4.js} +205 -195
- package/dist/cli/chunks/chunk-JQAJUXRE.js +2 -0
- package/dist/cli/chunks/{chunk-RG52OKAM.js → chunk-JRK5GX56.js} +1 -1
- package/dist/cli/chunks/{chunk-I33ERSGB.js → chunk-JRLZ7LZ3.js} +2 -2
- package/dist/cli/chunks/{chunk-NQZ5AR3D.js → chunk-JTOFLDU7.js} +2 -2
- package/dist/cli/chunks/{chunk-NHWGMJAP.js → chunk-K6EOHGKS.js} +2 -2
- package/dist/cli/chunks/{chunk-5QQSIGUA.js → chunk-KKXH25IH.js} +2 -2
- package/dist/cli/chunks/{chunk-VGFFFKGK.js → chunk-KNSQWM2E.js} +2 -2
- package/dist/cli/chunks/{chunk-B6MOJC3X.js → chunk-L5T32SRF.js} +1 -1
- package/dist/cli/chunks/{chunk-WGM35YWL.js → chunk-LKFBW2QM.js} +2 -2
- package/dist/cli/chunks/{chunk-AJRUJAAK.js → chunk-LMAI74EP.js} +1 -1
- package/dist/cli/chunks/{chunk-C6KWXUFJ.js → chunk-LQVS5IWH.js} +2 -2
- package/dist/cli/chunks/{chunk-H5BS5VH7.js → chunk-LRGTPUJA.js} +2 -2
- package/dist/cli/chunks/{chunk-3HZS4M3O.js → chunk-LTHV4PIG.js} +2 -2
- package/dist/cli/chunks/{chunk-7CUQCCMD.js → chunk-M7QKCHLQ.js} +2 -2
- package/dist/cli/chunks/{chunk-CF2ISEOJ.js → chunk-N3ASALOL.js} +2 -2
- package/dist/cli/chunks/{chunk-ZCRTRYXK.js → chunk-NEXBTLN6.js} +2 -2
- package/dist/cli/chunks/{chunk-VMNWDJIZ.js → chunk-NJEEKYEP.js} +3 -3
- package/dist/cli/chunks/{chunk-ZEV3YTO7.js → chunk-NWUFTLSF.js} +2 -2
- package/dist/cli/chunks/{chunk-MQROI74N.js → chunk-O4QB2GFL.js} +2 -2
- package/dist/cli/chunks/{chunk-GDSXITFH.js → chunk-OA75C4HY.js} +2 -2
- package/dist/cli/chunks/{chunk-SESK3ARK.js → chunk-OVMG6EEF.js} +2 -2
- package/dist/cli/chunks/{chunk-MUOG6QXR.js → chunk-OX7MJFLC.js} +2 -2
- package/dist/cli/chunks/{chunk-ELLBS5RP.js → chunk-OZJQN7YE.js} +2 -2
- package/dist/cli/chunks/{chunk-D6CJIGRU.js → chunk-PFXCRRR6.js} +55 -55
- package/dist/cli/chunks/{chunk-ZL6SYKUK.js → chunk-PVJLQ2YZ.js} +1 -1
- package/dist/cli/chunks/{chunk-6LIHFV7O.js → chunk-QDRFLM77.js} +2 -2
- package/dist/cli/chunks/{chunk-H6ZM3PUT.js → chunk-QH7C4PTX.js} +1 -1
- package/dist/cli/chunks/chunk-QKM4XT2F.js +2 -0
- package/dist/cli/chunks/{chunk-V4DM6ELU.js → chunk-QP7EKLWU.js} +2 -2
- package/dist/cli/chunks/{chunk-BAMN2CHI.js → chunk-QPACHVDI.js} +1 -1
- package/dist/cli/chunks/{chunk-QDFTT3RF.js → chunk-QQVE65ER.js} +2 -2
- package/dist/cli/chunks/{chunk-LL3IGZBI.js → chunk-QYCZYJH7.js} +2 -2
- package/dist/cli/chunks/{chunk-DUYOVM5I.js → chunk-R6I5I724.js} +2 -2
- package/dist/cli/chunks/{chunk-ENGZ4D5V.js → chunk-RJJIPTVH.js} +2 -2
- package/dist/cli/chunks/{chunk-7NITCZWD.js → chunk-RM6OC35G.js} +1 -1
- package/dist/cli/chunks/{chunk-Q5XTSMWR.js → chunk-RTD4U7IW.js} +2 -2
- package/dist/cli/chunks/{chunk-DBDPRORT.js → chunk-SKJQKOFJ.js} +2 -2
- package/dist/cli/chunks/{chunk-ICTXTNQZ.js → chunk-SMBGK7XI.js} +1 -1
- package/dist/cli/chunks/{chunk-PI7TJS62.js → chunk-SPS472C5.js} +2 -2
- package/dist/cli/chunks/{chunk-IV5UZOHH.js → chunk-SUNXA2UR.js} +2 -2
- package/dist/cli/chunks/{chunk-IB27QACC.js → chunk-SVP3BP52.js} +2 -2
- package/dist/cli/chunks/{chunk-5OOMJGFN.js → chunk-T4WQPE77.js} +1 -1
- package/dist/cli/chunks/{chunk-66VWCR67.js → chunk-T53ZN4NO.js} +2 -2
- package/dist/cli/chunks/chunk-T6W2EYHC.js +2 -0
- package/dist/cli/chunks/{chunk-EAY2JMZG.js → chunk-T7YCNOW5.js} +2 -2
- package/dist/cli/chunks/{chunk-FZOBD67M.js → chunk-TCQWVVSR.js} +1 -1
- package/dist/cli/chunks/{chunk-SJUXE4IC.js → chunk-TGRHO4ES.js} +2 -2
- package/dist/cli/chunks/{chunk-6RE3X4V5.js → chunk-TP7L4EX6.js} +2 -2
- package/dist/cli/chunks/{chunk-6SQM2MUX.js → chunk-TT45RCLN.js} +2 -2
- package/dist/cli/chunks/{chunk-AVBJYI5I.js → chunk-TUZNWRYC.js} +1 -1
- package/dist/cli/chunks/{chunk-YHKEDEAA.js → chunk-U2QTL5T2.js} +3 -3
- package/dist/cli/chunks/chunk-U64QORFO.js +2 -0
- package/dist/cli/chunks/{chunk-BBT64TII.js → chunk-UHLZKH6B.js} +4 -4
- package/dist/cli/chunks/{chunk-GSF6MB64.js → chunk-UIWXKRTK.js} +2 -2
- package/dist/cli/chunks/{chunk-JMONHE4B.js → chunk-UNFE4RPV.js} +1 -1
- package/dist/cli/chunks/{chunk-DPYSUDAO.js → chunk-UQGIC5OX.js} +1 -1
- package/dist/cli/chunks/{chunk-IAF6T27S.js → chunk-VAXTPLO3.js} +2 -2
- package/dist/cli/chunks/{chunk-6SH5VZUD.js → chunk-VCSNNLWL.js} +2 -2
- package/dist/cli/chunks/chunk-VSPNIDQK.js +21 -0
- package/dist/cli/chunks/{chunk-6OS76PHI.js → chunk-VV2JVYOI.js} +2 -2
- package/dist/cli/chunks/{chunk-IQO7UCFR.js → chunk-VW7AXJQS.js} +2 -2
- package/dist/cli/chunks/{chunk-UQ32JHES.js → chunk-W7JUD4EZ.js} +2 -2
- package/dist/cli/chunks/chunk-WFKE7NZ5.js +12 -0
- package/dist/cli/chunks/{chunk-RFNPJK6N.js → chunk-WVEHKAIH.js} +3 -3
- package/dist/cli/chunks/{chunk-64VGZQLB.js → chunk-XAESN54Q.js} +1 -1
- package/dist/cli/chunks/{chunk-BMAPORJ7.js → chunk-XECZYQT5.js} +2 -2
- package/dist/cli/chunks/chunk-XFT4FYTC.js +2 -0
- package/dist/cli/chunks/{chunk-Y3UOUNHM.js → chunk-YHX74M7C.js} +2 -2
- package/dist/cli/chunks/chunk-YIWBJ637.js +2 -0
- package/dist/cli/chunks/{chunk-SDRHUMJB.js → chunk-Z5UZOYQS.js} +2 -2
- package/dist/cli/chunks/{chunk-7J6QC567.js → chunk-Z6G3QVZ4.js} +12 -12
- package/dist/cli/chunks/ci-5LIV2HW5.js +82 -0
- package/dist/cli/chunks/{ci-output-LDT24TS3.js → ci-output-UO5BDFU4.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-F5V4KITU.js → circuit-breaker-UQDPXYRD.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-DT6WQQVD.js → claude-flow-setup-62QES3QX.js} +2 -2
- package/dist/cli/chunks/client-AJZKCP4I.js +2 -0
- package/dist/cli/chunks/{cline-installer-G7TJOAEX.js → cline-installer-X7VZTSZG.js} +2 -2
- package/dist/cli/chunks/{code-PGE6A42V.js → code-H3BF4L4H.js} +3 -3
- package/dist/cli/chunks/{code-index-extractor-RNITH372.js → code-index-extractor-BJGFZGGL.js} +2 -2
- package/dist/cli/chunks/{codex-installer-LBX77AI3.js → codex-installer-KVZWKU6S.js} +2 -2
- package/dist/cli/chunks/{completions-4AWLAARX.js → completions-YMILE6V7.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-ZPNSS476.js → complexity-analyzer-J26N2PWG.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-UAPWX6OA.js → continuedev-installer-MAR42OV7.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-BJN2YJGI.js → copilot-installer-CVOJF6OT.js} +2 -2
- package/dist/cli/chunks/core-handlers-MQHEMGDV.js +2 -0
- package/dist/cli/chunks/{cost-tracker-MHP2VJ63.js → cost-tracker-SXLWXE55.js} +2 -2
- package/dist/cli/chunks/{coverage-PQB4IEFG.js → coverage-D7HCHFP3.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-3QNMZV5R.js +2 -0
- package/dist/cli/chunks/{cursor-installer-ZXBWYAS3.js → cursor-installer-X37VHIKW.js} +2 -2
- package/dist/cli/chunks/{daemon-64C7R6OJ.js → daemon-JN7SOH6F.js} +4 -4
- package/dist/cli/chunks/{daemon-N2BEGEFY.js → daemon-LIW47IDM.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-SPZDAPNL.js → dag-attention-scheduler-QCHHIZBT.js} +2 -2
- package/dist/cli/chunks/{detect-LXJBSSZW.js → detect-WRFCWAX5.js} +2 -2
- package/dist/cli/chunks/{dist-node-U3TKZ2IZ.js → dist-node-6FWT4XZO.js} +2 -2
- package/dist/cli/chunks/{domain-handler-3DDWUVSR.js → domain-handler-SNFPNMRT.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-JJVWI4OQ.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-JPAR7TXX.js → embed-and-insert-pattern-LZFAUNBQ.js} +2 -2
- package/dist/cli/chunks/{eval-SOLG23EA.js → eval-AMUXTMJB.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-T7G2VOOD.js → experience-capture-middleware-3D65TR2C.js} +4 -4
- package/dist/cli/chunks/{fast-paths-32N3ELI4.js → fast-paths-Y7BBMM56.js} +2 -2
- package/dist/cli/chunks/{feature-flags-APJDQ4N7.js → feature-flags-JMQQ7JW4.js} +2 -2
- package/dist/cli/chunks/{feature-flags-NAHKLDRN.js → feature-flags-VESRRQ6V.js} +2 -2
- package/dist/cli/chunks/{file-discovery-YKVM3MDB.js → file-discovery-JJKQQUV6.js} +2 -2
- package/dist/cli/chunks/{fleet-55M5CJS4.js → fleet-WIGHICJF.js} +4 -4
- package/dist/cli/chunks/{gnn-wrapper-UD6E6S6Z.js → gnn-wrapper-BFNPETTT.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-OYVW3VSC.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-HBYIS3ZW.js → hnsw-legacy-bridge-6A7OTAPT.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-EQPM42OU.js → hnswlib-node-LKV2H47B.js} +2 -2
- package/dist/cli/chunks/{hooks-5ZSSJWO6.js → hooks-KDSFYQQG.js} +10 -10
- package/dist/cli/chunks/hybrid-backend-2B3LCLR4.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-XBGVQ4PD.js → hypergraph-engine-GDLPEPUC.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-CAWAQ673.js → hypergraph-handler-4UMFA2EW.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-4R4VWOGQ.js +2 -0
- package/dist/cli/chunks/{init-handler-PRHXSARK.js → init-handler-4GCHPQHD.js} +16 -14
- 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-F7LXBM7I.js → kilocode-installer-HJZMT2G5.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-NM723ZRG.js → kiro-installer-WUPY67HG.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-KFMTTUR5.js +2 -0
- package/dist/cli/chunks/{learning-5QYIDHH3.js → learning-AXKIS7IG.js} +4 -4
- package/dist/cli/chunks/{llm-router-43HKWPSX.js → llm-router-HUDPNZLJ.js} +4 -4
- package/dist/cli/chunks/llm-router-service-2D74XVM3.js +2 -0
- package/dist/cli/chunks/{load-5YDBWSCS.js → load-RM44POD7.js} +2 -2
- package/dist/cli/chunks/load-test-53FWOWNS.js +2 -0
- package/dist/cli/chunks/{mcp-UMAPMNMY.js → mcp-5JVQRBOP.js} +2 -2
- package/dist/cli/chunks/{memory-FWCPCQFP.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-2XTBGLE4.js → multi-model-executor-WPRKCSCM.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-GIXOJ6NS.js → opencode-installer-YAJMRCQO.js} +2 -2
- package/dist/cli/chunks/{orchestrator-VW6BKHLI.js → orchestrator-MUGWBUYP.js} +17 -17
- package/dist/cli/chunks/pattern-null-store-7DMU5CJ4.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-7CEUC3J7.js → pattern-usage-recorder-ZQJJ2YNG.js} +2 -2
- package/dist/cli/chunks/{pipeline-IGUQPPPO.js → pipeline-F4DXDUDC.js} +2 -2
- package/dist/cli/chunks/{platform-2P636I7B.js → platform-HI3A3OWF.js} +2 -2
- package/dist/cli/chunks/{plugin-NY6SWDPE.js → plugin-XRITPTR7.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-2UUDTIO2.js → prime-radiant-advanced-wasm-HHNJP7CQ.js} +2 -2
- package/dist/cli/chunks/{project-root-IOISG5KX.js → project-root-2VN4WO2A.js} +2 -2
- package/dist/cli/chunks/protocol-executor-2EMTBTMG.js +2 -0
- package/dist/cli/chunks/{protocol-handler-ZTPCRQ5W.js → protocol-handler-ZEVHSEBG.js} +2 -2
- package/dist/cli/chunks/{prove-SQX5A3IG.js → prove-C4BLZWBS.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-VZHZZPHE.js +2 -0
- package/dist/cli/chunks/{quality-DROILKRY.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-P5U3MGYC.js → real-embeddings-YWSE3IRT.js} +2 -2
- package/dist/cli/chunks/{ref-validation-KY73NQXD.js → ref-validation-ZWOTFA3T.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-6JPPRB3W.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-VTJIVFUO.js → routing-handler-CFYLGNAR.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-C6RPSJJO.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-R53URRIO.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-MMXN5TEJ.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-3B3R2NL4.js → security-ZU2GW3ZM.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-VIJB7JUS.js → shared-rvf-adapter-5FOVSL3T.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-UVWGDUWC.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-M4LWAAYZ.js → standalone-memory-3UXDZ7HI.js} +2 -2
- package/dist/cli/chunks/{status-handler-YYFV6OZL.js → status-handler-264CHTWS.js} +2 -2
- package/dist/cli/chunks/{structural-health-27E6LLKB.js → structural-health-E2QPUOZE.js} +2 -2
- package/dist/cli/chunks/{sync-J3LJ56WN.js → sync-2ACMWM7D.js} +2 -2
- package/dist/cli/chunks/sync-N2L2OST4.js +2 -0
- package/dist/cli/chunks/{task-handler-4MCEBQZL.js → task-handler-IB5CVOTY.js} +2 -2
- package/dist/cli/chunks/task-handlers-QBMYNJHE.js +9 -0
- package/dist/cli/chunks/test-7RGLRDSP.js +33 -0
- package/dist/cli/chunks/{test-scheduling-ZJBFRZ3J.js → test-scheduling-RJABJT2W.js} +3 -3
- package/dist/cli/chunks/token-bootstrap-JVHMHB72.js +2 -0
- package/dist/cli/chunks/{token-usage-3X5WMTG2.js → token-usage-3ECHQVCY.js} +2 -2
- package/dist/cli/chunks/{transformers-MVL4C5IX.js → transformers-KJH3IJWI.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-SLW65ZFO.js → tree-sitter-wasm-parser-XN6PFI32.js} +2 -2
- package/dist/cli/chunks/{types-TG5P3CRS.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-ETBHDEPY.js → upgrade-S5NFQZID.js} +2 -2
- package/dist/cli/chunks/{validate-C2A73LZK.js → validate-BIBWOLJD.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-67XN42ML.js → validate-swarm-WAA3LBHH.js} +2 -2
- package/dist/cli/chunks/visual-security-APOXJ3Q3.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-USJN77P4.js → web-tree-sitter-OTBQTHAV.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-5GGZXGJW.js → windsurf-installer-NNQ22EW6.js} +2 -2
- package/dist/cli/chunks/witness-chain-7IP5IJGT.js +2 -0
- package/dist/cli/chunks/{witness-chain-IWS5ZHHL.js → witness-chain-E7MUBOJW.js} +2 -2
- package/dist/cli/chunks/witness-chain-repair-FW4QSN4C.js +2 -0
- package/dist/cli/chunks/{witness-chain-verifier-3GEADWPE.js → witness-chain-verifier-YMROEBVL.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-ZWEIK3VJ.js → witness-key-manager-4CGRNDMJ.js} +2 -2
- package/dist/cli/chunks/{workflow-KHMVVBBA.js → workflow-4VRSTRAN.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-2HNW5ZMQ.js +2 -0
- package/dist/cli/chunks/wrappers-4M4UTGEU.js +2 -0
- package/dist/cli/commands/ci.js +18 -7
- package/dist/cli/commands/quality-gate.js +6 -1
- package/dist/cli/commands/test.js +18 -3
- package/dist/cli/handlers/init-handler.d.ts +2 -0
- package/dist/cli/handlers/init-handler.js +8 -2
- package/dist/cli/index.js +15 -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/coordination/handlers/test-execution-handlers.js +13 -8
- package/dist/coordination/index.d.ts +1 -1
- package/dist/coordination/queen-event-handlers.js +9 -6
- package/dist/coordination/result-saver.js +1 -1
- package/dist/coordination/services/index.d.ts +1 -1
- package/dist/coordination/services/task-audit-logger.d.ts +38 -13
- package/dist/coordination/services/task-audit-logger.js +33 -5
- package/dist/coordination/task-executor.d.ts +5 -0
- package/dist/coordination/task-executor.js +10 -5
- 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/domains/test-generation/coordinator.js +6 -5
- package/dist/domains/test-generation/interfaces.d.ts +11 -1
- package/dist/domains/test-generation/services/behavior-example-validation.d.ts +36 -0
- package/dist/domains/test-generation/services/behavior-example-validation.js +89 -0
- package/dist/domains/test-generation/services/behavior-examples.d.ts +8 -0
- package/dist/domains/test-generation/services/behavior-examples.js +65 -0
- package/dist/domains/test-generation/services/test-generator.d.ts +1 -1
- package/dist/domains/test-generation/services/test-generator.js +59 -30
- package/dist/domains/visual-accessibility/services/axe-core-audit.d.ts +0 -15
- package/dist/domains/visual-accessibility/services/axe-core-audit.js +12 -10
- package/dist/init/browser-engine-installer.d.ts +5 -5
- package/dist/init/browser-engine-installer.js +28 -6
- package/dist/init/fleet-integration.js +3 -2
- package/dist/init/init-wizard-steps.js +3 -2
- package/dist/init/init-wizard.d.ts +2 -0
- package/dist/init/orchestrator.js +1 -0
- package/dist/init/phases/06-code-intelligence.js +6 -4
- package/dist/init/phases/09-assets.js +8 -18
- package/dist/init/phases/phase-interface.d.ts +2 -0
- package/dist/integrations/agentic-flow/reasoning-bank/index.d.ts +2 -5
- 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/integrations/vibium/client.d.ts +1 -0
- package/dist/integrations/vibium/client.js +24 -11
- package/dist/integrations/vibium/runtime.d.ts +14 -0
- package/dist/integrations/vibium/runtime.js +94 -0
- package/dist/kernel/memory-backend.js +5 -4
- package/dist/kernel/pattern-fts-self-heal.d.ts +63 -0
- package/dist/kernel/pattern-fts-self-heal.js +193 -0
- package/dist/kernel/process-lifecycle.d.ts +60 -0
- package/dist/kernel/process-lifecycle.js +91 -0
- package/dist/kernel/unified-memory-schemas.d.ts +15 -1
- package/dist/kernel/unified-memory-schemas.js +53 -25
- package/dist/kernel/unified-memory.js +34 -36
- package/dist/kernel/unified-persistence.js +12 -6
- package/dist/learning/aqe-learning-engine.js +3 -2
- package/dist/learning/experience-capture.d.ts +2 -1
- package/dist/learning/experience-capture.js +23 -8
- package/dist/learning/pattern-store.d.ts +1 -1
- package/dist/learning/pattern-store.js +27 -30
- package/dist/learning/qe-patterns.d.ts +6 -0
- package/dist/learning/qe-reasoning-bank.d.ts +1 -0
- package/dist/learning/qe-reasoning-bank.js +14 -4
- package/dist/learning/real-qe-reasoning-bank.d.ts +9 -4
- package/dist/learning/real-qe-reasoning-bank.js +28 -4
- package/dist/learning/rvf-pattern-store.js +19 -19
- package/dist/learning/sqlite-persistence.js +9 -24
- package/dist/mcp/bundle.js +545 -581
- package/dist/mcp/connection-pool.d.ts +2 -0
- package/dist/mcp/connection-pool.js +13 -2
- package/dist/mcp/entry.js +52 -6
- package/dist/mcp/handlers/domain-handler-configs.js +12 -4
- package/dist/mcp/handlers/memory-handlers.d.ts +1 -0
- package/dist/mcp/handlers/memory-handlers.js +16 -6
- package/dist/mcp/handlers/task-handlers.js +11 -7
- package/dist/mcp/protocol-server.js +47 -11
- package/dist/mcp/services/reasoning-bank-service.d.ts +6 -1
- package/dist/mcp/services/reasoning-bank-service.js +5 -1
- package/dist/mcp/tools/test-execution/e2e-execute.js +9 -1
- package/dist/mcp/tools/test-generation/generate.d.ts +6 -1
- package/dist/mcp/tools/test-generation/generate.js +8 -0
- package/dist/mcp/types.d.ts +8 -2
- 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/error-utils.d.ts +15 -0
- package/dist/shared/error-utils.js +21 -0
- package/dist/shared/events/domain-events.d.ts +2 -1
- 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 +10 -6
- package/dist/cli/chunks/adapter-UYOJPTOX.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-JR5AVQXR.js +0 -2
- package/dist/cli/chunks/base-DRZ2LS6X.js +0 -2
- package/dist/cli/chunks/browser-workflow-CJ7T3MXF.js +0 -2
- package/dist/cli/chunks/chunk-3NIG7S5W.js +0 -2
- package/dist/cli/chunks/chunk-4N23RFDU.js +0 -2
- package/dist/cli/chunks/chunk-AHKELLIO.js +0 -12
- package/dist/cli/chunks/chunk-DK4XN4CU.js +0 -2
- package/dist/cli/chunks/chunk-E6G2RD5H.js +0 -4
- package/dist/cli/chunks/chunk-MJS53PRX.js +0 -2
- package/dist/cli/chunks/chunk-PZPWRQ2M.js +0 -21
- package/dist/cli/chunks/chunk-QGA55PFM.js +0 -12
- package/dist/cli/chunks/chunk-SPV2VKC5.js +0 -3
- package/dist/cli/chunks/chunk-TCHGOB2N.js +0 -2
- package/dist/cli/chunks/chunk-UKA2KOXE.js +0 -2
- package/dist/cli/chunks/chunk-WCJBU2KI.js +0 -2
- package/dist/cli/chunks/chunk-Z6GGIRQQ.js +0 -65
- package/dist/cli/chunks/ci-W6K6G2KZ.js +0 -81
- package/dist/cli/chunks/client-KHWJT6FB.js +0 -2
- package/dist/cli/chunks/core-handlers-HING5RRG.js +0 -2
- package/dist/cli/chunks/cross-domain-router-PQTD6AZN.js +0 -2
- package/dist/cli/chunks/domain-transfer-M36KUJ2U.js +0 -2
- package/dist/cli/chunks/dream-WUGRSNCV.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-33XX5XNQ.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-XQPERX3H.js +0 -2
- package/dist/cli/chunks/hnsw-index-2GNXTWHH.js +0 -2
- package/dist/cli/chunks/hybrid-backend-CCF7URKI.js +0 -2
- package/dist/cli/chunks/impact-analyzer-HGKAZWIG.js +0 -2
- package/dist/cli/chunks/init-wizard-72MFBI3G.js +0 -2
- package/dist/cli/chunks/kernel-BRCBVMSK.js +0 -2
- package/dist/cli/chunks/knowledge-graph-DG44IPEI.js +0 -2
- package/dist/cli/chunks/llm-router-service-24KXFX32.js +0 -2
- package/dist/cli/chunks/load-test-N4TAYJY3.js +0 -2
- package/dist/cli/chunks/memory-backend-NVYFYVAU.js +0 -2
- package/dist/cli/chunks/memory-handlers-UTWCNCHL.js +0 -2
- package/dist/cli/chunks/pattern-null-store-SBPNYDBR.js +0 -2
- package/dist/cli/chunks/protocol-executor-IBYEII5Q.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-7IETWW6W.js +0 -2
- package/dist/cli/chunks/quality-gate-PWKWDJY2.js +0 -7
- package/dist/cli/chunks/queen-coordinator-NHUK2MWJ.js +0 -2
- package/dist/cli/chunks/router-SRSO3IHF.js +0 -2
- package/dist/cli/chunks/routing-feedback-PASRE5HY.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-4M4J67OU.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-TSXGT5LF.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-MOF3E7BR.js +0 -2
- package/dist/cli/chunks/safe-db-QJLFO33B.js +0 -2
- package/dist/cli/chunks/schedule-YIVXW5O2.js +0 -2
- package/dist/cli/chunks/scheduler-AON7DWSJ.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-75VHKKQB.js +0 -2
- package/dist/cli/chunks/sync-26CEGSTC.js +0 -2
- package/dist/cli/chunks/task-handlers-GYBAWKE2.js +0 -9
- package/dist/cli/chunks/test-MPC5HRH5.js +0 -33
- package/dist/cli/chunks/token-bootstrap-2Y2XITBX.js +0 -2
- package/dist/cli/chunks/unified-memory-UCQ6AB32.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-IXYUMKRR.js +0 -2
- package/dist/cli/chunks/unified-persistence-7E6JQ4FZ.js +0 -2
- package/dist/cli/chunks/vibium-NILGKHLN.js +0 -2
- package/dist/cli/chunks/visual-security-4VZXPEVG.js +0 -2
- package/dist/cli/chunks/witness-chain-JQA2VPZI.js +0 -2
- package/dist/cli/chunks/witness-chain-repair-4UA7IPS3.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-GI5NQH7C.js +0 -2
- package/dist/cli/chunks/wrappers-N6XIK5PT.js +0 -2
|
@@ -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{a as
|
|
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 q}from"./chunk-ISBOHF6Y.js";import{g as O,h as X,i as L,j as k,o as I,s as B}from"./chunk-BZIPW2PA.js";import{b as h,d as x}from"./chunk-BITFGVZ4.js";import{a as y,b as A,f,j as C,l as D,n as g}from"./chunk-3EKG7HFV.js";import{i as w}from"./chunk-UQGIC5OX.js";import{a as _,e as M}from"./chunk-HPVYJ6JH.js";import{a as N,b as v}from"./chunk-SPS472C5.js";v();x();M();B();X();k();var H={dbPath:".agentic-qe/memory.db",walMode:!0,mmapSize:256*1024*1024,cacheSize:-64e3,foreignKeys:!0,useUnified:!0};function ee(l,e=384){let t=new Array(e).fill(0),n=l.toLowerCase().trim();for(let a=0;a<3;a++)for(let s=0;s<n.length;s++){let i=n.charCodeAt(s),o=i*(s+1)*(a+1)%e;t[o]+=Math.sin(i*(a+1))/(s+1)}let r=Math.sqrt(t.reduce((a,s)=>a+s*s,0));if(r>0)for(let a=0;a<e;a++)t[a]/=r;return t}function P(l){return l.normalize("NFKD").replace(/\p{M}+/gu,"").toLowerCase().match(/[\p{L}\p{N}]+/gu)??[]}var S=class{db=null;config;prepared=new Map;initialized=!1;unifiedMemory=null;constructor(e={}){this.config={...H,...e}}getDatabase(){return this.db}async initialize(){if(!this.initialized)try{if(this.config.useUnified)this.unifiedMemory=I(),await this.unifiedMemory.initialize(),this.db=this.unifiedMemory.getDatabase(),console.log(`[SQLitePatternStore] Using unified storage: ${this.unifiedMemory.getDbPath()}`);else{let e=await import("path"),t=await import("fs"),n=e.dirname(this.config.dbPath);t.existsSync(n)||t.mkdirSync(n,{recursive:!0}),this.db=N(this.config.dbPath),this.db.pragma(`mmap_size = ${this.config.mmapSize}`),this.db.pragma(`cache_size = ${this.config.cacheSize}`),this.config.foreignKeys&&this.db.pragma("foreign_keys = ON"),L(this.db,{logPrefix:"[SQLitePatternStore]"}),this.createSchema(),console.log(`[SQLitePatternStore] Initialized (legacy): ${this.config.dbPath}`)}this.deduplicatePatterns(),this.ensureEmbeddingSpaceSchema(),this.prepareStatements(),this.initialized=!0}catch(e){throw new Error(`Failed to initialize SQLite: ${_(e)}`)}}createSchema(){if(!this.db)throw new Error("Database not initialized");this.db.exec(`
|
|
3
3
|
-- QE Patterns table
|
|
4
4
|
CREATE TABLE IF NOT EXISTS qe_patterns (
|
|
5
5
|
id TEXT PRIMARY KEY,
|
|
@@ -88,30 +88,8 @@ import{a as I,b as A,f,j as y,l as w,n as T}from"./chunk-2TMWAQQ3.js";import{k a
|
|
|
88
88
|
CREATE UNIQUE INDEX IF NOT EXISTS idx_patterns_unique_name_domain_type
|
|
89
89
|
ON qe_patterns(name, qe_domain, pattern_type);
|
|
90
90
|
|
|
91
|
-
-- FTS5 full-text search index
|
|
92
|
-
|
|
93
|
-
name, description, pattern_type, qe_domain,
|
|
94
|
-
content='qe_patterns',
|
|
95
|
-
content_rowid='rowid'
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
-- FTS5 triggers to keep index in sync
|
|
99
|
-
CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_insert AFTER INSERT ON qe_patterns BEGIN
|
|
100
|
-
INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
|
|
101
|
-
VALUES (new.rowid, new.name, new.description, new.pattern_type, new.qe_domain);
|
|
102
|
-
END;
|
|
103
|
-
|
|
104
|
-
CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_delete AFTER DELETE ON qe_patterns BEGIN
|
|
105
|
-
INSERT INTO qe_patterns_fts(qe_patterns_fts, rowid, name, description, pattern_type, qe_domain)
|
|
106
|
-
VALUES ('delete', old.rowid, old.name, old.description, old.pattern_type, old.qe_domain);
|
|
107
|
-
END;
|
|
108
|
-
|
|
109
|
-
CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_update AFTER UPDATE ON qe_patterns BEGIN
|
|
110
|
-
INSERT INTO qe_patterns_fts(qe_patterns_fts, rowid, name, description, pattern_type, qe_domain)
|
|
111
|
-
VALUES ('delete', old.rowid, old.name, old.description, old.pattern_type, old.qe_domain);
|
|
112
|
-
INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
|
|
113
|
-
VALUES (new.rowid, new.name, new.description, new.pattern_type, new.qe_domain);
|
|
114
|
-
END;
|
|
91
|
+
-- FTS5 full-text search index + sync triggers (shared DDL)
|
|
92
|
+
${O}
|
|
115
93
|
|
|
116
94
|
-- Indexes for performance
|
|
117
95
|
CREATE INDEX IF NOT EXISTS idx_patterns_domain ON qe_patterns(qe_domain);
|
|
@@ -197,14 +175,14 @@ import{a as I,b as A,f,j as y,l as w,n as T}from"./chunk-2TMWAQQ3.js";import{k a
|
|
|
197
175
|
SELECT COUNT(*) as count FROM qe_patterns
|
|
198
176
|
`)),this.prepared.set("countByDomain",this.db.prepare(`
|
|
199
177
|
SELECT qe_domain, COUNT(*) as count FROM qe_patterns GROUP BY qe_domain
|
|
200
|
-
`))}storePattern(e,t,n){if(!this.db)throw new Error("Database not initialized");let r=e.id||
|
|
178
|
+
`))}storePattern(e,t,n){if(!this.db)throw new Error("Database not initialized");let r=e.id||w(),a=this.prepared.get("insertPattern"),s=this.prepared.get("insertEmbedding");if(!a||!s)throw new Error("Prepared statements not ready");let i=r;return this.db.transaction(()=>{a.run(r,e.patternType,e.qeDomain,e.domain,e.name,e.description||"",e.confidence,e.tier||"short-term",JSON.stringify(e.template),JSON.stringify(e.context));let p=this.db.prepare("SELECT id FROM qe_patterns WHERE name = ? AND qe_domain = ? AND pattern_type = ?").get(e.name,e.qeDomain??"",e.patternType??"");if(i=p?p.id:r,t){let d=n??g()?.spaceId;if(!d)throw new Error("VECTOR_SPACE_UNVERIFIED: refusing to persist an embedding without runtime provenance");let u=Buffer.from(new Float32Array(t).buffer);s.run(i,u,t.length,"all-MiniLM-L6-v2",d)}})(),i}getPattern(e){if(!this.db)throw new Error("Database not initialized");let t=this.prepared.get("getPatternWithEmbedding");if(!t)throw new Error("Prepared statement not ready");let n=t.get(e);return n?this.rowToPattern(n):null}getPatterns(e={}){if(!this.db)throw new Error("Database not initialized");let t=e.limit||1e3,n,r;return e.domain?(n=this.prepared.get("getPatternsByDomain"),r=n.all(e.domain,t)):(n=this.prepared.get("getAllPatterns"),r=n.all(t)),r.map(a=>this.rowToPattern(a))}searchFTS(e,t=20){if(!this.db)throw new Error("Database not initialized");if(!e.trim())return[];let n=[...new Set(P(e))].filter(s=>s.length>=2).slice(0,32);if(n.length===0)return[];let r=n.map(s=>`"${s}"`).join(" OR "),a=performance.now();try{let s=this.db.prepare(`
|
|
201
179
|
SELECT p.id, rank AS fts_score, p.name, p.description, p.pattern_type, p.qe_domain
|
|
202
180
|
FROM qe_patterns_fts fts
|
|
203
181
|
JOIN qe_patterns p ON p.rowid = fts.rowid
|
|
204
182
|
WHERE qe_patterns_fts MATCH ?
|
|
205
183
|
ORDER BY rank
|
|
206
184
|
LIMIT ?
|
|
207
|
-
`).all(r,t),i=performance.now()-a;i>50&&console.warn(`[FTS5] searchFTS took ${i.toFixed(1)}ms (results=${s.length})`),this._lastFtsLatencyMs=i;let o=Math.max(...s.map(d=>Math.abs(d.fts_score)),1),p=s.length>0?this.searchFTSPhraseIds(e,t):new Set;return s.map(d=>{let
|
|
185
|
+
`).all(r,t),i=performance.now()-a;i>50&&console.warn(`[FTS5] searchFTS took ${i.toFixed(1)}ms (results=${s.length})`),this._lastFtsLatencyMs=i;let o=Math.max(...s.map(d=>Math.abs(d.fts_score)),1),p=s.length>0?this.searchFTSPhraseIds(e,t):new Set;return s.map(d=>{let u=new Set(P([d.name,d.description,d.pattern_type,d.qe_domain].filter(Boolean).join(" "))),T=n.filter(E=>u.has(E)).length;return{id:d.id,ftsScore:Math.abs(d.fts_score)/o,phrase:p.has(d.id),coverage:T/n.length}})}catch{return[]}}searchFTSPhraseIds(e,t){let n='"'+e.replace(/"/g,'""')+'"';try{let r=this.db.prepare(`
|
|
208
186
|
SELECT p.id FROM qe_patterns_fts fts
|
|
209
187
|
JOIN qe_patterns p ON p.rowid = fts.rowid
|
|
210
188
|
WHERE qe_patterns_fts MATCH ?
|
|
@@ -218,7 +196,7 @@ import{a as I,b as A,f,j as y,l as w,n as T}from"./chunk-2TMWAQQ3.js";import{k a
|
|
|
218
196
|
WHERE p.id NOT LIKE 'bench-%'
|
|
219
197
|
AND p.id NOT IN (SELECT pattern_id FROM qe_pattern_embeddings)
|
|
220
198
|
LIMIT 10
|
|
221
|
-
`).all();return{total:e,withoutEmbeddings:t,sampleGhostIds:n.map(r=>r.id)}}getAllEmbeddings(){if(!this.db)throw new Error("Database not initialized");let e=this.prepared.get("getAllEmbeddings");if(!e)throw new Error("Prepared statement not ready");return e.all().map(n=>({patternId:n.pattern_id,embedding:Array.from(new Float32Array(n.embedding.buffer,n.embedding.byteOffset,n.dimension)),spaceId:n.space_id}))}getRecentEmbeddings(e){if(!this.db)throw new Error("Database not initialized");let t=Number.isFinite(e)&&e>0?Math.floor(e):1e3,n=this.prepared.get("getRecentEmbeddings");if(!n)throw new Error("Prepared statement not ready");return n.all(t).map(a=>({patternId:a.pattern_id,embedding:Array.from(new Float32Array(a.embedding.buffer,a.embedding.byteOffset,a.dimension)),spaceId:a.space_id}))}getEmbeddingSpaceDiagnostics(e=
|
|
199
|
+
`).all();return{total:e,withoutEmbeddings:t,sampleGhostIds:n.map(r=>r.id)}}getAllEmbeddings(){if(!this.db)throw new Error("Database not initialized");let e=this.prepared.get("getAllEmbeddings");if(!e)throw new Error("Prepared statement not ready");return e.all().map(n=>({patternId:n.pattern_id,embedding:Array.from(new Float32Array(n.embedding.buffer,n.embedding.byteOffset,n.dimension)),spaceId:n.space_id}))}getRecentEmbeddings(e){if(!this.db)throw new Error("Database not initialized");let t=Number.isFinite(e)&&e>0?Math.floor(e):1e3,n=this.prepared.get("getRecentEmbeddings");if(!n)throw new Error("Prepared statement not ready");return n.all(t).map(a=>({patternId:a.pattern_id,embedding:Array.from(new Float32Array(a.embedding.buffer,a.embedding.byteOffset,a.dimension)),spaceId:a.space_id}))}getEmbeddingSpaceDiagnostics(e=g()?.spaceId??null){if(!this.db)throw new Error("Database not initialized");let t=this.db.prepare("SELECT space_id AS spaceId FROM qe_pattern_embeddings").all();return A(t,e)}recordUsage(e,t,n,r){if(!this.db)throw new Error("Database not initialized");if(!q(this.db,{patternId:e,success:t,metrics:n,feedback:r}).updated)throw new Error(`Pattern not found: ${e}`)}deletePattern(e){if(!this.db)throw new Error("Database not initialized");this.db.transaction(()=>{this.db.prepare("DELETE FROM qe_pattern_embeddings WHERE pattern_id = ?").run(e),this.db.prepare("DELETE FROM qe_pattern_usage WHERE pattern_id = ?").run(e),this.db.prepare("DELETE FROM qe_patterns WHERE id = ?").run(e)})()}promotePattern(e){if(!this.db)throw new Error("Database not initialized");let t=this.prepared.get("promotePattern");if(!t)throw new Error("Prepared statement not ready");t.run(e)}getStats(){if(!this.db)throw new Error("Database not initialized");let e=this.prepared.get("countPatterns"),t=this.prepared.get("countByDomain");if(!e||!t)throw new Error("Prepared statements not ready");let n=e.get().count,r=t.all(),a={};for(let o of r)a[o.qe_domain]=o.count;let s=this.db.prepare(`
|
|
222
200
|
SELECT tier, COUNT(*) as count FROM qe_patterns GROUP BY tier
|
|
223
201
|
`).all(),i={};for(let o of s)i[o.tier]=o.count;return{totalPatterns:n,byDomain:a,byTier:i}}getAggregateOutcomeStats(){let e={routingRequests:0,avgRoutingConfidence:0,successfulRoutings:0,learningOutcomes:0,successfulOutcomes:0,avgPatternSuccessRate:0};if(!this.db)return e;let t=s=>{try{return this.db.prepare(s).get()}catch{return}},n=t(`
|
|
224
202
|
SELECT
|
|
@@ -236,7 +214,7 @@ import{a as I,b as A,f,j as y,l as w,n as T}from"./chunk-2TMWAQQ3.js";import{k a
|
|
|
236
214
|
SELECT AVG(success_rate) AS avg_sr
|
|
237
215
|
FROM qe_patterns
|
|
238
216
|
WHERE usage_count > 0
|
|
239
|
-
`);return{routingRequests:n?.total??0,avgRoutingConfidence:n?.avg_q??0,successfulRoutings:n?.succ??0,learningOutcomes:r?.total??0,successfulOutcomes:r?.succ??0,avgPatternSuccessRate:a?.avg_sr??0}}hasAnyHistoricalData(){if(!this.db)return!1;try{let e=["SELECT COUNT(*) as cnt FROM qe_pattern_embeddings","SELECT COUNT(*) as cnt FROM qe_pattern_usage","SELECT COUNT(*) as cnt FROM qe_trajectories"];for(let t of e)try{let n=this.db.prepare(t).get();if(n&&n.cnt>0)return!0}catch{}return!1}catch{return!1}}rowToPattern(e){let t;return e.embedding&&(t=Array.from(new Float32Array(e.embedding.buffer,e.embedding.byteOffset,e.dimension))),{id:e.id,patternType:e.pattern_type,qeDomain:e.qe_domain,domain:e.domain,name:e.name,description:e.description,confidence:e.confidence,usageCount:e.usage_count,successRate:e.success_rate,qualityScore:e.quality_score,tier:e.tier,template:h(e.template_json||"{}"),context:h(e.context_json||"{}"),createdAt:new Date(e.created_at),lastUsedAt:e.last_used_at?new Date(e.last_used_at):new Date(e.created_at),successfulUses:e.successful_uses,embedding:t,tokensUsed:e.tokens_used,inputTokens:e.input_tokens,outputTokens:e.output_tokens,latencyMs:e.latency_ms,reusable:e.reusable===1,reuseCount:e.reuse_count||0,averageTokenSavings:e.average_token_savings||0,totalTokensSaved:e.total_tokens_saved}}updatePattern(e,t){if(!this.db)throw new Error("Database not initialized");let n=[],r=[];if(t.usageCount!==void 0&&(n.push("usage_count = ?"),r.push(t.usageCount)),t.successfulUses!==void 0&&(n.push("successful_uses = ?"),r.push(t.successfulUses)),t.successRate!==void 0&&(n.push("success_rate = ?"),r.push(t.successRate)),t.qualityScore!==void 0&&(n.push("quality_score = ?"),r.push(t.qualityScore)),t.confidence!==void 0&&(n.push("confidence = ?"),r.push(t.confidence)),t.tier!==void 0&&(n.push("tier = ?"),r.push(t.tier)),n.length===0)return;n.push("updated_at = datetime('now')"),r.push(e);let a=`UPDATE qe_patterns SET ${n.join(", ")} WHERE id = ?`;this.db.prepare(a).run(...r)}storePatternEmbedding(e,t,n){if(!this.db)throw new Error("Database not initialized");let r=this.prepared.get("insertEmbedding");if(!r)throw new Error("Prepared statements not ready");let a=Buffer.from(new Float32Array(t).buffer),s=n??
|
|
217
|
+
`);return{routingRequests:n?.total??0,avgRoutingConfidence:n?.avg_q??0,successfulRoutings:n?.succ??0,learningOutcomes:r?.total??0,successfulOutcomes:r?.succ??0,avgPatternSuccessRate:a?.avg_sr??0}}hasAnyHistoricalData(){if(!this.db)return!1;try{let e=["SELECT COUNT(*) as cnt FROM qe_pattern_embeddings","SELECT COUNT(*) as cnt FROM qe_pattern_usage","SELECT COUNT(*) as cnt FROM qe_trajectories"];for(let t of e)try{let n=this.db.prepare(t).get();if(n&&n.cnt>0)return!0}catch{}return!1}catch{return!1}}rowToPattern(e){let t;return e.embedding&&(t=Array.from(new Float32Array(e.embedding.buffer,e.embedding.byteOffset,e.dimension))),{id:e.id,patternType:e.pattern_type,qeDomain:e.qe_domain,domain:e.domain,name:e.name,description:e.description,confidence:e.confidence,usageCount:e.usage_count,successRate:e.success_rate,qualityScore:e.quality_score,tier:e.tier,template:h(e.template_json||"{}"),context:h(e.context_json||"{}"),createdAt:new Date(e.created_at),lastUsedAt:e.last_used_at?new Date(e.last_used_at):new Date(e.created_at),successfulUses:e.successful_uses,embedding:t,tokensUsed:e.tokens_used,inputTokens:e.input_tokens,outputTokens:e.output_tokens,latencyMs:e.latency_ms,reusable:e.reusable===1,reuseCount:e.reuse_count||0,averageTokenSavings:e.average_token_savings||0,totalTokensSaved:e.total_tokens_saved}}updatePattern(e,t){if(!this.db)throw new Error("Database not initialized");let n=[],r=[];if(t.usageCount!==void 0&&(n.push("usage_count = ?"),r.push(t.usageCount)),t.successfulUses!==void 0&&(n.push("successful_uses = ?"),r.push(t.successfulUses)),t.successRate!==void 0&&(n.push("success_rate = ?"),r.push(t.successRate)),t.qualityScore!==void 0&&(n.push("quality_score = ?"),r.push(t.qualityScore)),t.confidence!==void 0&&(n.push("confidence = ?"),r.push(t.confidence)),t.tier!==void 0&&(n.push("tier = ?"),r.push(t.tier)),n.length===0)return;n.push("updated_at = datetime('now')"),r.push(e);let a=`UPDATE qe_patterns SET ${n.join(", ")} WHERE id = ?`;this.db.prepare(a).run(...r)}storePatternEmbedding(e,t,n){if(!this.db)throw new Error("Database not initialized");let r=this.prepared.get("insertEmbedding");if(!r)throw new Error("Prepared statements not ready");let a=Buffer.from(new Float32Array(t).buffer),s=n??g()?.spaceId;if(!s)throw new Error("VECTOR_SPACE_UNVERIFIED: refusing to persist an embedding without runtime provenance");r.run(e,a,t.length,"all-MiniLM-L6-v2",s)}recordPatternReuse(e,t,n,r=!1,a=0,s){if(!this.db)throw new Error("Database not initialized");try{this.db.exec(`
|
|
240
218
|
CREATE TABLE IF NOT EXISTS qe_pattern_reuse (
|
|
241
219
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
242
220
|
pattern_id TEXT NOT NULL,
|
|
@@ -273,7 +251,7 @@ import{a as I,b as A,f,j as y,l as w,n as T}from"./chunk-2TMWAQQ3.js";import{k a
|
|
|
273
251
|
GROUP BY pattern_id
|
|
274
252
|
ORDER BY reuse_count DESC
|
|
275
253
|
LIMIT 10
|
|
276
|
-
`).all(r);return{totalSearches:i.total_searches||0,totalReused:i.total_reused||0,reuseRate:i.total_searches>0?(i.total_reused||0)/i.total_searches:0,totalTokensSaved:i.total_tokens_saved||0,avgSimilarity:i.avg_similarity||0,topPatterns:o.map(p=>({patternId:p.pattern_id,reuseCount:p.reuse_count,avgSimilarity:p.avg_similarity}))}}catch(n){return console.debug("[SQLitePatternStore] Failed to get reuse stats:",_(n)),{totalSearches:0,totalReused:0,reuseRate:0,totalTokensSaved:0,avgSimilarity:0,topPatterns:[]}}}async backfillEmbeddings(e=32){if(!this.db)throw new Error("Database not initialized");let t=
|
|
254
|
+
`).all(r);return{totalSearches:i.total_searches||0,totalReused:i.total_reused||0,reuseRate:i.total_searches>0?(i.total_reused||0)/i.total_searches:0,totalTokensSaved:i.total_tokens_saved||0,avgSimilarity:i.avg_similarity||0,topPatterns:o.map(p=>({patternId:p.pattern_id,reuseCount:p.reuse_count,avgSimilarity:p.avg_similarity}))}}catch(n){return console.debug("[SQLitePatternStore] Failed to get reuse stats:",_(n)),{totalSearches:0,totalReused:0,reuseRate:0,totalTokensSaved:0,avgSimilarity:0,topPatterns:[]}}}async backfillEmbeddings(e=32){if(!this.db)throw new Error("Database not initialized");let t=C();await f([y]);let n=g()?.spaceId;if(!n)throw new Error("VECTOR_SPACE_UNVERIFIED: backfill embedder has no runtime provenance");let r=this.db.prepare(`
|
|
277
255
|
SELECT p.id, p.name, p.description, p.pattern_type, p.qe_domain
|
|
278
256
|
FROM qe_patterns p
|
|
279
257
|
LEFT JOIN qe_pattern_embeddings e ON e.pattern_id = p.id
|
|
@@ -282,4 +260,4 @@ import{a as I,b as A,f,j as y,l as w,n as T}from"./chunk-2TMWAQQ3.js";import{k a
|
|
|
282
260
|
ORDER BY p.quality_score DESC
|
|
283
261
|
`).all(n),a=this.db.prepare(`
|
|
284
262
|
SELECT COUNT(*) as c FROM qe_pattern_embeddings
|
|
285
|
-
`).get();if(r.length===0)return console.log(`[SQLitePatternStore] Backfill: all patterns already have embeddings (${a.c} total)`),{processed:0,skipped:0,errors:0,alreadyHad:a.c,method:"transformer"};console.log(`[SQLitePatternStore] Backfill: ${r.length} patterns need embeddings (${a.c} already have)`);let s=this.prepared.get("insertEmbedding");if(!s)throw new Error("Prepared statements not ready");let i=0,o=0,p=0,d="transformer";for(let
|
|
263
|
+
`).get();if(r.length===0)return console.log(`[SQLitePatternStore] Backfill: all patterns already have embeddings (${a.c} total)`),{processed:0,skipped:0,errors:0,alreadyHad:a.c,method:"transformer"};console.log(`[SQLitePatternStore] Backfill: ${r.length} patterns need embeddings (${a.c} already have)`);let s=this.prepared.get("insertEmbedding");if(!s)throw new Error("Prepared statements not ready");let i=0,o=0,p=0,d="transformer";for(let u=0;u<r.length;u+=e){let T=r.slice(u,u+e),E=[];for(let c of T){let m=[c.name,c.description,c.pattern_type,c.qe_domain].filter(Boolean).join(" ");if(!m.trim()){o++;continue}E.push({id:c.id,text:m})}if(E.length===0)continue;let R;try{R=await f(E.map(c=>c.text))}catch(c){throw D()?new Error(`[SQLitePatternStore] external embedder endpoint failed during backfill; aborting to protect HNSW index. Original error: ${_(c)}`):new Error(`[SQLitePatternStore] semantic embedding unavailable; refusing to write hash proxies. Install @huggingface/transformers or configure AQE_EMBEDDER_ENDPOINT. Original error: ${_(c)}`)}let F=d==="transformer"?"transformer-backfill":"hash-backfill";this.db.transaction(()=>{for(let c=0;c<E.length;c++)try{let m=R[c];if(!m||m.length!==t){p++;continue}let U=Buffer.from(new Float32Array(m).buffer);s.run(E[c].id,U,t,F,n),i++}catch(m){p++,p<=3&&console.warn(`[SQLitePatternStore] Backfill error for ${E[c].id}:`,_(m))}})();let b=Math.min(u+e,r.length);(b%100===0||b>=r.length)&&console.log(`[SQLitePatternStore] Backfill progress: ${b}/${r.length}`)}return console.log(`[SQLitePatternStore] Backfill complete (${d}): ${i} processed, ${o} skipped, ${p} errors`),{processed:i,skipped:o,errors:p,alreadyHad:a.c,method:d}}close(){this.db&&(this.unifiedMemory?console.log("[SQLitePatternStore] Detached from unified storage (not closing shared connection)"):(this.db.close(),console.log("[SQLitePatternStore] Database closed")),this.db=null,this.unifiedMemory=null,this.initialized=!1,this.prepared.clear())}exec(e){if(!this.db)throw new Error("Database not initialized");this.db.exec(e)}getDb(){if(!this.db)throw new Error("Database not initialized");return this.db}};function te(l={}){return new S(l)}export{H as a,ee as b,S as c,te as d};
|
|
@@ -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{l as p}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{l as p}from"./chunk-KKXH25IH.js";import{a as f,e as R}from"./chunk-HPVYJ6JH.js";R();var u=class extends p{config={name:"qe/workflows/browser-load",description:"Load, validate, and prepare browser automation workflows from inline YAML or built-in templates. Returns the resolved workflow with steps and variable bindings, ready for browser execution. Templates: login-flow, form-validation, visual-regression, oauth-flow, etc.",domain:"test-execution",schema:this.buildSchema()};buildSchema(){return{type:"object",properties:{workflowYaml:{type:"string",description:"Inline YAML workflow definition. Mutually exclusive with templateName."},templateName:{type:"string",description:"Built-in template name to load.",enum:["login-flow","oauth-flow","scraping-workflow","visual-regression","form-validation","navigation-flow","api-integration","performance-audit","accessibility-audit"]},variables:{type:"object",description:'Runtime variable overrides (e.g., { "baseUrl": "https://example.com" })'}}}}async execute(r,C){try{let{WorkflowLoader:n,WORKFLOW_TEMPLATES:g,WORKFLOW_DESCRIPTIONS:v,interpolateVariables:b}=await import("./browser-DC2JV47Z.js"),{parse:k}=await import("yaml"),d=new n,l=[...g],y=v;if(!r.workflowYaml&&!r.templateName)return{success:!0,data:{workflowName:"none",description:"No workflow specified. Use templateName or workflowYaml.",source:"none",templateUsed:null,steps:[],variables:{defined:[],provided:{}},validation:{valid:!0,errors:[],warnings:[]},availableTemplates:l,summary:`Available templates: ${l.join(", ")}`}};let e,i,t=null;r.workflowYaml?(i="inline-yaml",e=k(r.workflowYaml)):(i="template",t=r.templateName,e=await d.load(r.templateName));let a=await d.validate(e),w=(e.steps??[]).map(o=>{let s=o.config;if(r.variables){let c={};for(let[h,m]of Object.entries(s))c[h]=typeof m=="string"?b(m,r.variables):m;s=c}return{name:o.name,action:o.action,config:s,optional:o.optional??!1,assertionCount:o.assertions?.length??0}});return{success:!0,data:{workflowName:e.name||t||"custom",description:e.description||t&&y[t]||"",source:i,templateUsed:t,steps:w,variables:{defined:(e.variables??[]).map(o=>({name:o.name,type:o.type,required:o.required,hasDefault:o.default!==void 0})),provided:r.variables||{}},validation:{valid:a.valid,errors:a.errors,warnings:a.warnings},availableTemplates:l,summary:a.valid?`Workflow "${e.name}" loaded (${i}): ${w.length} steps, ${(e.variables??[]).length} variables`:`Workflow "${e.name}" has validation errors: ${a.errors.join("; ")}`}}}catch(n){return{success:!1,error:f(n)}}}};export{u 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{
|
|
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-AIRGNL55.js";import{a as T}from"./chunk-TCHGOB2N.js";import{e as S}from"./chunk-FBMN7B46.js";import{a as b,c as $}from"./chunk-MJS53PRX.js";import{a as w,d as M}from"./chunk-IB27QACC.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,
|