agentic-qe 3.14.7 → 3.14.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/helpers/.helpers-version +1 -1
- package/.claude/helpers/auto-memory-hook.mjs +18 -9
- package/.claude/helpers/helpers.manifest.json +6 -5
- package/.claude/helpers/hook-handler.cjs +40 -12
- package/.claude/helpers/memory.cjs +86 -0
- package/.claude/helpers/router.cjs +105 -0
- package/.claude/helpers/session.cjs +166 -0
- package/.claude/helpers/statusline.cjs +73 -621
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +130 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/adapters/a2a/notifications/retry-queue.js +5 -0
- package/dist/adapters/claude-flow/pretrain-bridge.js +3 -2
- package/dist/agents/claim-verifier/verifiers/file-verifier.js +3 -2
- package/dist/cli/bundle.js +6 -6
- package/dist/cli/chunks/adapter-XYCOXQCC.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-AK2W76RG.js → agent-booster-wasm-67OKGDGZ.js} +2 -2
- package/dist/cli/chunks/{agent-handler-MGZCWHIY.js → agent-handler-4HZEQ3WQ.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-JZ54MCSP.js → agent-memory-branch-IBHZQSRN.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-DTJCROTG.js +2 -0
- package/dist/cli/chunks/{arena-CUVH3V7H.js → arena-EJBIGSF4.js} +2 -2
- package/dist/cli/chunks/{arena-YSWTKBCL.js → arena-LCLRGUIK.js} +4 -4
- package/dist/cli/chunks/{audit-LVU76QGA.js → audit-PY4JNDQQ.js} +3 -3
- package/dist/cli/chunks/base-5TQ34GMD.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-DB3LOJQU.js → better-sqlite3-2JG5K6XT.js} +2 -2
- package/dist/cli/chunks/{brain-handler-SD63KOQ6.js → brain-handler-3UYK55GA.js} +4 -4
- package/dist/cli/chunks/{branch-enumerator-4MNOPUC7.js → branch-enumerator-GOSWOX46.js} +2 -2
- package/dist/cli/chunks/{browser-OLPNTWQE.js → browser-DC2JV47Z.js} +2 -2
- package/dist/cli/chunks/browser-workflow-KWX4ESTJ.js +2 -0
- package/dist/cli/chunks/{chunk-QQFQDEUE.js → chunk-25EEIAHS.js} +2 -2
- package/dist/cli/chunks/{chunk-DOBKEXMJ.js → chunk-3576QGPP.js} +1 -1
- package/dist/cli/chunks/{chunk-3M7J4U74.js → chunk-3EKG7HFV.js} +4 -4
- package/dist/cli/chunks/{chunk-DYTQHRUS.js → chunk-3FCHH4VP.js} +1 -1
- package/dist/cli/chunks/{chunk-EJ6MMYLK.js → chunk-3S5IIK32.js} +1 -1
- package/dist/cli/chunks/{chunk-NOHWJOBS.js → chunk-3X2JSW3R.js} +1 -1
- package/dist/cli/chunks/{chunk-7EZ2Z2CK.js → chunk-4HXFPBAA.js} +1 -1
- package/dist/cli/chunks/{chunk-XBYQ2BS4.js → chunk-4PY44TKH.js} +2 -2
- package/dist/cli/chunks/{chunk-5FSLMYAC.js → chunk-4RNCVSVN.js} +2 -2
- package/dist/cli/chunks/{chunk-X7ADKL7T.js → chunk-56M4QNXU.js} +2 -2
- package/dist/cli/chunks/{chunk-JHJUSSAU.js → chunk-5X4HDW5W.js} +2 -2
- package/dist/cli/chunks/{chunk-7MIOK72I.js → chunk-673XJBGW.js} +7 -7
- package/dist/cli/chunks/{chunk-77QZHIVX.js → chunk-6F7MFHTY.js} +2 -2
- package/dist/cli/chunks/{chunk-Q6NTEICT.js → chunk-6GJWT2OY.js} +2 -2
- package/dist/cli/chunks/{chunk-GV4DYPJP.js → chunk-6GNWVPMR.js} +2 -2
- package/dist/cli/chunks/{chunk-V5AK56DA.js → chunk-6VTC3OHD.js} +2 -2
- package/dist/cli/chunks/{chunk-MM56VPNE.js → chunk-775WGWLL.js} +3 -3
- package/dist/cli/chunks/{chunk-A3DK3XNZ.js → chunk-77WL5HQW.js} +1 -1
- package/dist/cli/chunks/chunk-7STWD4KJ.js +3 -0
- package/dist/cli/chunks/{chunk-RC2A4JZ5.js → chunk-7TNCEVWX.js} +2 -2
- package/dist/cli/chunks/{chunk-XL5KIYE3.js → chunk-7X3LMTRA.js} +2 -2
- package/dist/cli/chunks/{chunk-VW6FRMLW.js → chunk-A53MMSGC.js} +2 -2
- package/dist/cli/chunks/{chunk-UFSVUBTR.js → chunk-A5CLVZC3.js} +2 -2
- package/dist/cli/chunks/{chunk-4INST4ZL.js → chunk-AEYJ4ZLA.js} +1 -1
- package/dist/cli/chunks/{chunk-5U6N4V5M.js → chunk-AJ5PCJQ2.js} +4 -4
- package/dist/cli/chunks/{chunk-OAZX6WFU.js → chunk-AJMAKUS3.js} +2 -2
- package/dist/cli/chunks/{chunk-74IOEOMH.js → chunk-AOD2ES44.js} +2 -2
- package/dist/cli/chunks/chunk-AR2S4DOB.js +2 -0
- package/dist/cli/chunks/{chunk-PYKY22GC.js → chunk-AUFV2G2J.js} +5 -5
- package/dist/cli/chunks/{chunk-KD2BLA5Y.js → chunk-B2QKBQYD.js} +1 -1
- package/dist/cli/chunks/{chunk-6EGS77BB.js → chunk-BCCSV3RH.js} +1 -1
- package/dist/cli/chunks/{chunk-JOZ47MV6.js → chunk-BFIXUKOR.js} +1 -1
- package/dist/cli/chunks/chunk-BHPTHC5O.js +4 -0
- package/dist/cli/chunks/{chunk-OIDWDGLG.js → chunk-BITFGVZ4.js} +2 -2
- package/dist/cli/chunks/{chunk-ONR2NXXD.js → chunk-BL6273KR.js} +3 -3
- package/dist/cli/chunks/{chunk-BLG7SH4A.js → chunk-BOIUENWW.js} +1 -1
- package/dist/cli/chunks/{chunk-T77GZF4B.js → chunk-BT3MI2BW.js} +1 -1
- package/dist/cli/chunks/{chunk-UYUJT6QO.js → chunk-BTBJ2NLH.js} +2 -2
- package/dist/cli/chunks/{chunk-YMW57PEL.js → chunk-BUVJIVFG.js} +1 -1
- package/dist/cli/chunks/{chunk-QUORH2MG.js → chunk-BZIPW2PA.js} +8 -8
- package/dist/cli/chunks/{chunk-GVVFTFMB.js → chunk-C647D42G.js} +2 -2
- package/dist/cli/chunks/{chunk-AJUBT4NP.js → chunk-CBWM5NOO.js} +3 -3
- package/dist/cli/chunks/{chunk-F2OPFVQH.js → chunk-CIEXUYY7.js} +1 -1
- package/dist/cli/chunks/{chunk-QGOWNVVG.js → chunk-CLUHGBLN.js} +4 -4
- package/dist/cli/chunks/{chunk-WOV6XI3A.js → chunk-CQEWL32R.js} +1 -1
- package/dist/cli/chunks/{chunk-3QJU4Q4R.js → chunk-CXUC7YKA.js} +2 -2
- package/dist/cli/chunks/{chunk-HZY42OVU.js → chunk-D2Y36V5J.js} +2 -2
- package/dist/cli/chunks/{chunk-WF6UISKW.js → chunk-DSJJHPPS.js} +4 -4
- package/dist/cli/chunks/{chunk-FYPX5WBJ.js → chunk-DZHXCOSK.js} +1 -1
- package/dist/cli/chunks/{chunk-TXSPBLBT.js → chunk-EBV3WFIR.js} +2 -2
- package/dist/cli/chunks/{chunk-Y6AKKQIQ.js → chunk-EKO5QL2B.js} +1 -1
- package/dist/cli/chunks/{chunk-MZB2UV2O.js → chunk-EMOZ5O5S.js} +1 -1
- package/dist/cli/chunks/{chunk-23CX7JNL.js → chunk-ES7TAJRJ.js} +2 -2
- package/dist/cli/chunks/{chunk-Z4Q5PCRZ.js → chunk-EXQGHTPD.js} +4 -4
- package/dist/cli/chunks/{chunk-A2VUCUTT.js → chunk-F2WAB4WK.js} +2 -2
- package/dist/cli/chunks/{chunk-CQNMGK6Y.js → chunk-F57FTFWS.js} +2 -2
- package/dist/cli/chunks/{chunk-OEPNNLR4.js → chunk-F6JJNBE5.js} +1 -1
- package/dist/cli/chunks/{chunk-UBJG3IHT.js → chunk-FRC7AFB4.js} +2 -2
- package/dist/cli/chunks/{chunk-2G63VIJE.js → chunk-G36RZF2Y.js} +1 -1
- package/dist/cli/chunks/{chunk-YRHTQZU4.js → chunk-G3C7Z6FO.js} +2 -2
- package/dist/cli/chunks/{chunk-B4I43GE2.js → chunk-GA63ESNT.js} +2 -2
- package/dist/cli/chunks/{chunk-7QYOTUOX.js → chunk-GHMJFICO.js} +2 -2
- package/dist/cli/chunks/{chunk-HYOPJHHW.js → chunk-GK5WLUX3.js} +1 -1
- package/dist/cli/chunks/{chunk-A5MA7A23.js → chunk-GQJ4QDEN.js} +6 -6
- package/dist/cli/chunks/{chunk-UA7TDVL7.js → chunk-GVLRE3BV.js} +4 -4
- package/dist/cli/chunks/{chunk-25P6JA6V.js → chunk-H5UH234L.js} +1 -1
- package/dist/cli/chunks/{chunk-BE4KALTE.js → chunk-HBAFXWSO.js} +1 -1
- package/dist/cli/chunks/{chunk-EGOIIUBD.js → chunk-HE3BDBAO.js} +2 -2
- package/dist/cli/chunks/{chunk-P2UPYSDJ.js → chunk-HHANMCD2.js} +1 -1
- package/dist/cli/chunks/{chunk-ZUOVNFXK.js → chunk-HPVYJ6JH.js} +2 -2
- package/dist/cli/chunks/{chunk-RKI3IQKQ.js → chunk-I6NZFBT3.js} +3 -3
- package/dist/cli/chunks/{chunk-QVH5Y7AP.js → chunk-ISBOHF6Y.js} +1 -1
- package/dist/cli/chunks/{chunk-IWFFO6VT.js → chunk-J24AJEDE.js} +2 -2
- package/dist/cli/chunks/{chunk-5GFKTJ65.js → chunk-J5HTQHJK.js} +2 -2
- package/dist/cli/chunks/{chunk-LY7MFGBD.js → chunk-JDOVO4E4.js} +150 -149
- package/dist/cli/chunks/chunk-JQAJUXRE.js +2 -0
- package/dist/cli/chunks/{chunk-HXXHMLJ5.js → chunk-JRK5GX56.js} +1 -1
- package/dist/cli/chunks/{chunk-36VKMAMN.js → chunk-JRLZ7LZ3.js} +2 -2
- package/dist/cli/chunks/{chunk-6PJPQGF4.js → chunk-JTOFLDU7.js} +2 -2
- package/dist/cli/chunks/{chunk-CVOQ6ESD.js → chunk-K6EOHGKS.js} +2 -2
- package/dist/cli/chunks/{chunk-LU2EDWQK.js → chunk-KKXH25IH.js} +2 -2
- package/dist/cli/chunks/{chunk-EYXE2XKP.js → chunk-KNSQWM2E.js} +2 -2
- package/dist/cli/chunks/{chunk-IEJ7ZV3M.js → chunk-L5T32SRF.js} +1 -1
- package/dist/cli/chunks/{chunk-BEFTQVEW.js → chunk-LKFBW2QM.js} +2 -2
- package/dist/cli/chunks/{chunk-C3FXFU2T.js → chunk-LMAI74EP.js} +1 -1
- package/dist/cli/chunks/{chunk-P7XSPP5D.js → chunk-LQVS5IWH.js} +2 -2
- package/dist/cli/chunks/{chunk-4EKV7PHB.js → chunk-LRGTPUJA.js} +2 -2
- package/dist/cli/chunks/{chunk-MT7UNBZ7.js → chunk-LTHV4PIG.js} +2 -2
- package/dist/cli/chunks/{chunk-B2YGVSOP.js → chunk-M7QKCHLQ.js} +2 -2
- package/dist/cli/chunks/{chunk-H5RQPO3X.js → chunk-N3ASALOL.js} +2 -2
- package/dist/cli/chunks/{chunk-MQZ53OR3.js → chunk-NEXBTLN6.js} +2 -2
- package/dist/cli/chunks/{chunk-BD7FEUN3.js → chunk-NJEEKYEP.js} +3 -3
- package/dist/cli/chunks/{chunk-UOI6ULCH.js → chunk-NWUFTLSF.js} +2 -2
- package/dist/cli/chunks/{chunk-RT6O2HW2.js → chunk-O4QB2GFL.js} +2 -2
- package/dist/cli/chunks/{chunk-MZMG6CUJ.js → chunk-OA75C4HY.js} +2 -2
- package/dist/cli/chunks/{chunk-HYFQUWNB.js → chunk-OVMG6EEF.js} +2 -2
- package/dist/cli/chunks/{chunk-FSSR6WBE.js → chunk-OX7MJFLC.js} +2 -2
- package/dist/cli/chunks/{chunk-ENK44A6Q.js → chunk-OZJQN7YE.js} +2 -2
- package/dist/cli/chunks/{chunk-LXZMP3VX.js → chunk-PFXCRRR6.js} +25 -25
- package/dist/cli/chunks/{chunk-WIH522AP.js → chunk-PVJLQ2YZ.js} +1 -1
- package/dist/cli/chunks/{chunk-ZUB5YOCM.js → chunk-QDRFLM77.js} +2 -2
- package/dist/cli/chunks/{chunk-NHUGHAY6.js → chunk-QH7C4PTX.js} +1 -1
- package/dist/cli/chunks/{chunk-VXKWNRGA.js → chunk-QKM4XT2F.js} +2 -2
- package/dist/cli/chunks/{chunk-ON2UTP2U.js → chunk-QP7EKLWU.js} +2 -2
- package/dist/cli/chunks/{chunk-KUHLTVWC.js → chunk-QPACHVDI.js} +1 -1
- package/dist/cli/chunks/{chunk-PCJQCEBA.js → chunk-QQVE65ER.js} +2 -2
- package/dist/cli/chunks/{chunk-Q3NSU24F.js → chunk-QYCZYJH7.js} +2 -2
- package/dist/cli/chunks/{chunk-AEUEMVJK.js → chunk-R6I5I724.js} +2 -2
- package/dist/cli/chunks/{chunk-5D7ZFWDS.js → chunk-RJJIPTVH.js} +2 -2
- package/dist/cli/chunks/{chunk-ZWEKAEEV.js → chunk-RM6OC35G.js} +1 -1
- package/dist/cli/chunks/{chunk-ZELWDJXT.js → chunk-RTD4U7IW.js} +2 -2
- package/dist/cli/chunks/{chunk-O5V7RHVG.js → chunk-SKJQKOFJ.js} +2 -2
- package/dist/cli/chunks/{chunk-6RD44SCE.js → chunk-SMBGK7XI.js} +1 -1
- package/dist/cli/chunks/{chunk-ND4QTZOL.js → chunk-SPS472C5.js} +2 -2
- package/dist/cli/chunks/{chunk-TFK2AYIN.js → chunk-SUNXA2UR.js} +2 -2
- package/dist/cli/chunks/{chunk-RDGPXENG.js → chunk-SVP3BP52.js} +2 -2
- package/dist/cli/chunks/{chunk-NBLDBVAW.js → chunk-T4WQPE77.js} +1 -1
- package/dist/cli/chunks/{chunk-ZS4XVJGV.js → chunk-T53ZN4NO.js} +2 -2
- package/dist/cli/chunks/chunk-T6W2EYHC.js +2 -0
- package/dist/cli/chunks/{chunk-JZT7BU44.js → chunk-T7YCNOW5.js} +2 -2
- package/dist/cli/chunks/{chunk-EADSQN5T.js → chunk-TCQWVVSR.js} +1 -1
- package/dist/cli/chunks/{chunk-XYLQZWF6.js → chunk-TGRHO4ES.js} +2 -2
- package/dist/cli/chunks/{chunk-QPLSYEWJ.js → chunk-TP7L4EX6.js} +2 -2
- package/dist/cli/chunks/{chunk-N5XOXPHZ.js → chunk-TT45RCLN.js} +2 -2
- package/dist/cli/chunks/{chunk-OZGIOKEA.js → chunk-TUZNWRYC.js} +1 -1
- package/dist/cli/chunks/{chunk-53BXTTRO.js → chunk-U2QTL5T2.js} +3 -3
- package/dist/cli/chunks/chunk-U64QORFO.js +2 -0
- package/dist/cli/chunks/{chunk-SRPLERER.js → chunk-UHLZKH6B.js} +4 -4
- package/dist/cli/chunks/{chunk-HPWWYT67.js → chunk-UIWXKRTK.js} +2 -2
- package/dist/cli/chunks/{chunk-XWYELBZS.js → chunk-UNFE4RPV.js} +1 -1
- package/dist/cli/chunks/{chunk-FW4DJ4FJ.js → chunk-UQGIC5OX.js} +1 -1
- package/dist/cli/chunks/{chunk-GLGKQX2V.js → chunk-VAXTPLO3.js} +2 -2
- package/dist/cli/chunks/{chunk-VYDVI6FZ.js → chunk-VCSNNLWL.js} +2 -2
- package/dist/cli/chunks/{chunk-J7AQZLIH.js → chunk-VSPNIDQK.js} +4 -4
- package/dist/cli/chunks/{chunk-EIGRV3J6.js → chunk-VV2JVYOI.js} +2 -2
- package/dist/cli/chunks/{chunk-CBONQM5D.js → chunk-VW7AXJQS.js} +2 -2
- package/dist/cli/chunks/{chunk-O6MO5KMR.js → chunk-W7JUD4EZ.js} +2 -2
- package/dist/cli/chunks/{chunk-QFETNCNN.js → chunk-WFKE7NZ5.js} +2 -2
- package/dist/cli/chunks/{chunk-ROVZSZCS.js → chunk-WVEHKAIH.js} +3 -3
- package/dist/cli/chunks/{chunk-YO4ESCB4.js → chunk-XAESN54Q.js} +1 -1
- package/dist/cli/chunks/{chunk-RKUAWQOF.js → chunk-XECZYQT5.js} +2 -2
- package/dist/cli/chunks/{chunk-RLW25X66.js → chunk-XFT4FYTC.js} +2 -2
- package/dist/cli/chunks/{chunk-SM2YJ2AL.js → chunk-YHX74M7C.js} +2 -2
- package/dist/cli/chunks/chunk-YIWBJ637.js +2 -0
- package/dist/cli/chunks/{chunk-IAENZ2DR.js → chunk-Z5UZOYQS.js} +2 -2
- package/dist/cli/chunks/{chunk-G367W7XR.js → chunk-Z6G3QVZ4.js} +12 -12
- package/dist/cli/chunks/ci-5LIV2HW5.js +82 -0
- package/dist/cli/chunks/{ci-output-RLS32FUY.js → ci-output-UO5BDFU4.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-MRCC7WCM.js → circuit-breaker-UQDPXYRD.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-LIZCEKDF.js → claude-flow-setup-62QES3QX.js} +2 -2
- package/dist/cli/chunks/client-AJZKCP4I.js +2 -0
- package/dist/cli/chunks/{cline-installer-T7H6R2RC.js → cline-installer-X7VZTSZG.js} +2 -2
- package/dist/cli/chunks/{code-XMBLI7OF.js → code-H3BF4L4H.js} +3 -3
- package/dist/cli/chunks/{code-index-extractor-QS7BYLEX.js → code-index-extractor-BJGFZGGL.js} +2 -2
- package/dist/cli/chunks/{codex-installer-6PGT5FM6.js → codex-installer-KVZWKU6S.js} +2 -2
- package/dist/cli/chunks/{completions-2A3WRXY2.js → completions-YMILE6V7.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-23HOOGJ7.js → complexity-analyzer-J26N2PWG.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-4FSF7B3N.js → continuedev-installer-MAR42OV7.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-A5GRQQUU.js → copilot-installer-CVOJF6OT.js} +2 -2
- package/dist/cli/chunks/core-handlers-MQHEMGDV.js +2 -0
- package/dist/cli/chunks/{cost-tracker-Z4STQ5VB.js → cost-tracker-SXLWXE55.js} +2 -2
- package/dist/cli/chunks/{coverage-NUPP6KZZ.js → coverage-D7HCHFP3.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-3QNMZV5R.js +2 -0
- package/dist/cli/chunks/{cursor-installer-FVJ7ROPJ.js → cursor-installer-X37VHIKW.js} +2 -2
- package/dist/cli/chunks/{daemon-D662EX5N.js → daemon-JN7SOH6F.js} +4 -4
- package/dist/cli/chunks/{daemon-7ZZA2MMN.js → daemon-LIW47IDM.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-IB4TQ2KA.js → dag-attention-scheduler-QCHHIZBT.js} +2 -2
- package/dist/cli/chunks/{detect-LGLBZN4I.js → detect-WRFCWAX5.js} +2 -2
- package/dist/cli/chunks/{dist-node-Z3OL42YE.js → dist-node-6FWT4XZO.js} +2 -2
- package/dist/cli/chunks/{domain-handler-L3CLNL7U.js → domain-handler-SNFPNMRT.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-GQ3V5X6L.js → domain-plugins-MXKHH62P.js} +2 -2
- package/dist/cli/chunks/domain-transfer-47UJNERX.js +2 -0
- package/dist/cli/chunks/dream-OSWAITPT.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-UGD6USYH.js → embed-and-insert-pattern-LZFAUNBQ.js} +2 -2
- package/dist/cli/chunks/{eval-3B7UIYGY.js → eval-AMUXTMJB.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-3RQ4NYY3.js → experience-capture-middleware-3D65TR2C.js} +4 -4
- package/dist/cli/chunks/{fast-paths-QOSAEPYD.js → fast-paths-Y7BBMM56.js} +2 -2
- package/dist/cli/chunks/{feature-flags-TLF4NKOH.js → feature-flags-JMQQ7JW4.js} +2 -2
- package/dist/cli/chunks/{feature-flags-3S5TH6P4.js → feature-flags-VESRRQ6V.js} +2 -2
- package/dist/cli/chunks/{file-discovery-AEVMJRNB.js → file-discovery-JJKQQUV6.js} +2 -2
- package/dist/cli/chunks/{fleet-E6WTXWFL.js → fleet-WIGHICJF.js} +4 -4
- package/dist/cli/chunks/{gnn-wrapper-MCKH3AUU.js → gnn-wrapper-BFNPETTT.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-U7XENHRR.js → heartbeat-handler-HDXKTGUI.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-BVRVVIE2.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-MZTHXULS.js +2 -0
- package/dist/cli/chunks/hnsw-index-KHEX4VDG.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-5GW4SAEI.js → hnsw-legacy-bridge-6A7OTAPT.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-7BLZBK5T.js → hnswlib-node-LKV2H47B.js} +2 -2
- package/dist/cli/chunks/{hooks-F3O2SB6H.js → hooks-KDSFYQQG.js} +10 -10
- package/dist/cli/chunks/hybrid-backend-2B3LCLR4.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-PV4EKXHB.js → hypergraph-engine-GDLPEPUC.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-VOWO5ZTW.js → hypergraph-handler-4UMFA2EW.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-4R4VWOGQ.js +2 -0
- package/dist/cli/chunks/{init-handler-ENJ5ONJX.js → init-handler-4GCHPQHD.js} +6 -6
- package/dist/cli/chunks/init-wizard-TAOPXHHD.js +2 -0
- package/dist/cli/chunks/kernel-6I6VZUWY.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-HNNJOOPE.js → kilocode-installer-HJZMT2G5.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-UZBIQ3IC.js → kiro-installer-WUPY67HG.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-KFMTTUR5.js +2 -0
- package/dist/cli/chunks/{learning-YMLCVFUT.js → learning-AXKIS7IG.js} +4 -4
- package/dist/cli/chunks/{llm-router-YWTARCCT.js → llm-router-HUDPNZLJ.js} +4 -4
- package/dist/cli/chunks/llm-router-service-2D74XVM3.js +2 -0
- package/dist/cli/chunks/{load-DKE3F3IP.js → load-RM44POD7.js} +2 -2
- package/dist/cli/chunks/load-test-53FWOWNS.js +2 -0
- package/dist/cli/chunks/{mcp-5PSGIUCW.js → mcp-5JVQRBOP.js} +2 -2
- package/dist/cli/chunks/{memory-3L3O6JMM.js → memory-VGZ2V6PL.js} +5 -5
- package/dist/cli/chunks/memory-backend-KFJDDPEZ.js +2 -0
- package/dist/cli/chunks/memory-handlers-EI537Z32.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-AEEO7IA4.js → multi-model-executor-WPRKCSCM.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-ABBO355U.js → opencode-installer-YAJMRCQO.js} +2 -2
- package/dist/cli/chunks/{orchestrator-E36Q7MKE.js → orchestrator-MUGWBUYP.js} +6 -6
- package/dist/cli/chunks/pattern-null-store-7DMU5CJ4.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-H4XKSID4.js → pattern-usage-recorder-ZQJJ2YNG.js} +2 -2
- package/dist/cli/chunks/{pipeline-BGFEHXIN.js → pipeline-F4DXDUDC.js} +2 -2
- package/dist/cli/chunks/{platform-GK7ZVDJI.js → platform-HI3A3OWF.js} +2 -2
- package/dist/cli/chunks/{plugin-CAH2CKI6.js → plugin-XRITPTR7.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-M5EYRONA.js → prime-radiant-advanced-wasm-HHNJP7CQ.js} +2 -2
- package/dist/cli/chunks/{project-root-BSNZC243.js → project-root-2VN4WO2A.js} +2 -2
- package/dist/cli/chunks/protocol-executor-2EMTBTMG.js +2 -0
- package/dist/cli/chunks/{protocol-handler-JDSSC2SF.js → protocol-handler-ZEVHSEBG.js} +2 -2
- package/dist/cli/chunks/{prove-ANPTOZJE.js → prove-C4BLZWBS.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-VZHZZPHE.js +2 -0
- package/dist/cli/chunks/{quality-SXWGYRQR.js → quality-M3DTE4KK.js} +2 -2
- package/dist/cli/chunks/quality-gate-V6KS7ML3.js +7 -0
- package/dist/cli/chunks/queen-coordinator-7MYTTUHI.js +2 -0
- package/dist/cli/chunks/{real-embeddings-WSRYAOZM.js → real-embeddings-YWSE3IRT.js} +2 -2
- package/dist/cli/chunks/{ref-validation-AZ3LRWEK.js → ref-validation-ZWOTFA3T.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-2QKGFIEU.js → roocode-installer-GJBIWETD.js} +2 -2
- package/dist/cli/chunks/router-ZD4LXAWA.js +2 -0
- package/dist/cli/chunks/routing-feedback-FSLMDVGD.js +2 -0
- package/dist/cli/chunks/{routing-handler-UYDC5MMD.js → routing-handler-CFYLGNAR.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-QXADPVEY.js → ruvector-commands-EDKG456B.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-LTKTDRFS.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-IF24EVC5.js +2 -0
- package/dist/cli/chunks/{rvf-migration-coordinator-GD4NBFKT.js → rvf-migration-coordinator-ZMEYMAI6.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-E6JNBKMZ.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-7SXG66IL.js → rvf-store-integrity-AH6PNJP6.js} +2 -2
- package/dist/cli/chunks/safe-db-F6TRB5KZ.js +2 -0
- package/dist/cli/chunks/schedule-HBD4BYTE.js +2 -0
- package/dist/cli/chunks/scheduler-6FYWPMQC.js +2 -0
- package/dist/cli/chunks/{security-YKB622PK.js → security-ZU2GW3ZM.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-KMLAV7JK.js → shared-rvf-adapter-5FOVSL3T.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-OYY27DFV.js → shared-rvf-dual-writer-IO4DC4XV.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-DOU72F5Z.js +2 -0
- package/dist/cli/chunks/{standalone-memory-2DOABVLC.js → standalone-memory-3UXDZ7HI.js} +2 -2
- package/dist/cli/chunks/{status-handler-EXRKETV7.js → status-handler-264CHTWS.js} +2 -2
- package/dist/cli/chunks/{structural-health-2SKK6DU6.js → structural-health-E2QPUOZE.js} +2 -2
- package/dist/cli/chunks/{sync-UW7SX7GO.js → sync-2ACMWM7D.js} +2 -2
- package/dist/cli/chunks/{sync-DQ2YUNI6.js → sync-N2L2OST4.js} +2 -2
- package/dist/cli/chunks/{task-handler-LYQ6WYUY.js → task-handler-IB5CVOTY.js} +2 -2
- package/dist/cli/chunks/{task-handlers-DIJO232S.js → task-handlers-QBMYNJHE.js} +3 -3
- package/dist/cli/chunks/{test-WRHZMUCW.js → test-7RGLRDSP.js} +6 -6
- package/dist/cli/chunks/{test-scheduling-HI23RXFK.js → test-scheduling-RJABJT2W.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-23SA6SWZ.js → token-bootstrap-JVHMHB72.js} +2 -2
- package/dist/cli/chunks/{token-usage-M7RRDPXO.js → token-usage-3ECHQVCY.js} +2 -2
- package/dist/cli/chunks/{transformers-4TC35KKS.js → transformers-KJH3IJWI.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-F4LTKAWD.js → tree-sitter-wasm-parser-XN6PFI32.js} +2 -2
- package/dist/cli/chunks/{types-NBXV6LXQ.js → types-5BAPXOLS.js} +2 -2
- package/dist/cli/chunks/unified-memory-GHAYAXWZ.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-CCC63YXT.js +2 -0
- package/dist/cli/chunks/unified-persistence-HKRHI5PG.js +2 -0
- package/dist/cli/chunks/{upgrade-4BGOU5RM.js → upgrade-S5NFQZID.js} +2 -2
- package/dist/cli/chunks/{validate-EDWAR63H.js → validate-BIBWOLJD.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-VI72CPR7.js → validate-swarm-WAA3LBHH.js} +2 -2
- package/dist/cli/chunks/visual-security-APOXJ3Q3.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-Y5XBRQXF.js → web-tree-sitter-OTBQTHAV.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-VEX23WAF.js → windsurf-installer-NNQ22EW6.js} +2 -2
- package/dist/cli/chunks/witness-chain-7IP5IJGT.js +2 -0
- package/dist/cli/chunks/{witness-chain-3YNL6YGY.js → witness-chain-E7MUBOJW.js} +2 -2
- package/dist/cli/chunks/{witness-chain-repair-MJZGZRWT.js → witness-chain-repair-FW4QSN4C.js} +2 -2
- package/dist/cli/chunks/{witness-chain-verifier-TTJYXTBE.js → witness-chain-verifier-YMROEBVL.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-EM6YXYOY.js → witness-key-manager-4CGRNDMJ.js} +2 -2
- package/dist/cli/chunks/{workflow-2RBDOM7V.js → workflow-4VRSTRAN.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-2HNW5ZMQ.js +2 -0
- package/dist/cli/chunks/{wrappers-5OTAVVOV.js → wrappers-4M4UTGEU.js} +2 -2
- package/dist/cli/commands/ci.js +17 -6
- package/dist/cli/commands/quality-gate.js +6 -1
- package/dist/cli/index.js +7 -2
- package/dist/cli/process-store-cleanup.d.ts +7 -0
- package/dist/cli/process-store-cleanup.js +27 -0
- package/dist/cli/utils/ci-config.d.ts +3 -3
- package/dist/cli/utils/ci-config.js +202 -68
- package/dist/domains/quality-assessment/quality-evidence.d.ts +3 -1
- package/dist/domains/quality-assessment/quality-evidence.js +7 -2
- package/dist/domains/test-execution/services/retry-handler.js +32 -13
- package/dist/domains/test-execution/services/test-executor.d.ts +3 -3
- package/dist/domains/test-execution/services/test-executor.js +66 -22
- package/dist/init/fleet-integration.js +3 -2
- package/dist/init/init-wizard-steps.js +3 -2
- package/dist/init/phases/06-code-intelligence.js +6 -4
- package/dist/integrations/ruvector/sona-persistence.d.ts +1 -0
- package/dist/integrations/ruvector/sona-persistence.js +74 -20
- package/dist/integrations/ruvector/sona-wrapper.d.ts +2 -0
- package/dist/integrations/ruvector/sona-wrapper.js +13 -0
- package/dist/kernel/memory-backend.js +5 -4
- package/dist/kernel/unified-memory.js +3 -2
- package/dist/learning/aqe-learning-engine.js +3 -2
- package/dist/mcp/bundle.js +440 -439
- package/dist/mcp/connection-pool.d.ts +2 -0
- package/dist/mcp/connection-pool.js +13 -2
- package/dist/mcp/handlers/memory-handlers.d.ts +1 -0
- package/dist/mcp/handlers/memory-handlers.js +16 -6
- package/dist/mcp/protocol-server.js +29 -8
- package/dist/mcp/types.d.ts +2 -0
- package/dist/optimization/session-cache.js +13 -11
- package/dist/plugins/cache.js +10 -3
- package/dist/shared/embeddings/embedding-cache.js +4 -4
- package/dist/shared/llm/cache.js +7 -10
- package/dist/shared/retry-engine.js +4 -0
- package/dist/shared/test-runner-process.d.ts +10 -0
- package/dist/shared/test-runner-process.js +210 -0
- package/dist/validation/quality-verdict.js +3 -2
- package/dist/workers/quality-daemon/priority-queue.js +4 -1
- package/package.json +4 -4
- package/dist/cli/chunks/adapter-TVQKH65T.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-ULGTVVWE.js +0 -2
- package/dist/cli/chunks/base-W42BURDL.js +0 -2
- package/dist/cli/chunks/browser-workflow-HKGHFFFT.js +0 -2
- package/dist/cli/chunks/chunk-2IMSJ7IO.js +0 -2
- package/dist/cli/chunks/chunk-FBZC4IGB.js +0 -2
- package/dist/cli/chunks/chunk-MNQN7UZX.js +0 -4
- package/dist/cli/chunks/chunk-OXHF3L2T.js +0 -2
- package/dist/cli/chunks/chunk-PELENDDQ.js +0 -2
- package/dist/cli/chunks/chunk-TW3SR4TS.js +0 -2
- package/dist/cli/chunks/chunk-V6RE4YRQ.js +0 -2
- package/dist/cli/chunks/chunk-ZQZD55MN.js +0 -3
- package/dist/cli/chunks/ci-J3TDK5RA.js +0 -81
- package/dist/cli/chunks/client-3BD2DI4N.js +0 -2
- package/dist/cli/chunks/core-handlers-C3H2ZCS2.js +0 -2
- package/dist/cli/chunks/cross-domain-router-JCQ7SWDP.js +0 -2
- package/dist/cli/chunks/domain-transfer-MFCI76IY.js +0 -2
- package/dist/cli/chunks/dream-FTP33IJB.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-HXBJVJL2.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-TU6WG2ME.js +0 -2
- package/dist/cli/chunks/hnsw-index-MS5KODD7.js +0 -2
- package/dist/cli/chunks/hybrid-backend-HT45LBHC.js +0 -2
- package/dist/cli/chunks/impact-analyzer-AP4AGTG5.js +0 -2
- package/dist/cli/chunks/init-wizard-I5DFZUQL.js +0 -2
- package/dist/cli/chunks/kernel-MISPSPPA.js +0 -2
- package/dist/cli/chunks/knowledge-graph-L26JESGE.js +0 -2
- package/dist/cli/chunks/llm-router-service-MWGC43ZA.js +0 -2
- package/dist/cli/chunks/load-test-H5ISNNM5.js +0 -2
- package/dist/cli/chunks/memory-backend-HWDNOBKW.js +0 -2
- package/dist/cli/chunks/memory-handlers-ZFDVQZM5.js +0 -2
- package/dist/cli/chunks/pattern-null-store-GQP6ICWK.js +0 -2
- package/dist/cli/chunks/protocol-executor-AD5A4DAI.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-W3Z2PKTR.js +0 -2
- package/dist/cli/chunks/quality-gate-GYNCA4ZY.js +0 -7
- package/dist/cli/chunks/queen-coordinator-HQRHLIJX.js +0 -2
- package/dist/cli/chunks/router-MTP5LH4H.js +0 -2
- package/dist/cli/chunks/routing-feedback-GWETVB4L.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-4UE5S7WP.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-PHH3HF4Q.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-KTLZBUWV.js +0 -2
- package/dist/cli/chunks/safe-db-FWWGAPVE.js +0 -2
- package/dist/cli/chunks/schedule-TPA4V4D5.js +0 -2
- package/dist/cli/chunks/scheduler-5ZTEPNDD.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-HPTT624C.js +0 -2
- package/dist/cli/chunks/unified-memory-OVFEPRPS.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-KKRSCZHR.js +0 -2
- package/dist/cli/chunks/unified-persistence-7GLR4RI3.js +0 -2
- package/dist/cli/chunks/visual-security-2FUM5GLI.js +0 -2
- package/dist/cli/chunks/witness-chain-MH6GA5L6.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-H6G65YKU.js +0 -2
|
@@ -1,9 +1,9 @@
|
|
|
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,b as z,c as K,d as _,e as ie,f as W,g as G,h as A,i as Ce,j as se,k as Q,l as xe,m as J,n as le,o as Ie,p as P,q as Y,r as X,s as Z,t as ee}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,b as z,c as K,d as _,e as ie,f as W,g as G,h as A,i as Ce,j as se,k as Q,l as xe,m as J,n as le,o as Ie,p as P,q as Y,r as X,s as Z,t as ee}from"./chunk-J24AJEDE.js";import{c as Ee}from"./chunk-M7QKCHLQ.js";import{b as ve}from"./chunk-JRLZ7LZ3.js";import{a as Se,d as ae,e as _e}from"./chunk-AEYJ4ZLA.js";import"./chunk-BZIPW2PA.js";import"./chunk-RTD4U7IW.js";import{b as k,d as oe}from"./chunk-BITFGVZ4.js";import"./chunk-A5CLVZC3.js";import"./chunk-LQVS5IWH.js";import"./chunk-SVP3BP52.js";import"./chunk-VCSNNLWL.js";import"./chunk-GA63ESNT.js";import"./chunk-VW7AXJQS.js";import"./chunk-OVMG6EEF.js";import"./chunk-T6W2EYHC.js";import"./chunk-U64QORFO.js";import"./chunk-J5HTQHJK.js";import"./chunk-RJJIPTVH.js";import"./chunk-HPVYJ6JH.js";import"./chunk-R6I5I724.js";import"./chunk-Z5UZOYQS.js";import{a as we,b as Re,c as H,d as V,f as nn}from"./chunk-4PY44TKH.js";import{a as F,b as tn}from"./chunk-SPS472C5.js";import"./chunk-T7YCNOW5.js";import"./chunk-XAESN54Q.js";import $ from"path";import o from"chalk";tn();oe();import{existsSync as te,mkdirSync as rn,writeFileSync as on,readFileSync as ce}from"fs";import{join as D,resolve as de}from"path";function ne(e,n){let r="shake256",t=JSON.stringify(n),a=e.prepare("SELECT * FROM witness_chain ORDER BY id DESC LIMIT 1").get(),i=a?ae(r,_e(a)):Se;e.prepare(`
|
|
3
3
|
INSERT INTO witness_chain
|
|
4
4
|
(prev_hash, action_hash, action_type, action_data, timestamp, actor, hash_algo)
|
|
5
5
|
VALUES (?, ?, 'BRAIN_IMPORT', ?, ?, 'brain-import', ?)
|
|
6
|
-
`).run(i,ae(r,t),t,new Date().toISOString(),r)}var an={rl_q_values:"includeQValues",dream_insights:"includeDreamInsights",dream_cycles:"includeDreamInsights",witness_chain:"includeWitnessChain",vectors:"includeVectors"};function sn(e,n){let r=an[e.tableName];return!(r&&n[r]===!1)}var ln=1e4;function cn(e,n,r,t){if(!sn(n,r))return le(D(t,n.fileName),[]),{count:0,rows:[]};let[a,i]=n.domainColumn?J(r.domains,n.domainColumn):[void 0,[]];if(r.domains&&r.domains.length>0&&!n.domainColumn){let s=r.domains.map(()=>"?").join(","),d=`manifest_id IN (SELECT id FROM learning_evidence_manifests WHERE task_family IN (${s}))`;["learning_evidence_segments","learning_segment_edges","learning_evidence_admissions"].includes(n.tableName)?(a=d,i=[...r.domains]):["pattern_manifest_lineage","pattern_segment_lineage"].includes(n.tableName)&&(a=`${d} AND pattern_id IN (SELECT id FROM qe_patterns WHERE qe_domain IN (${s}))`,i=[...r.domains,...r.domains])}if(se(e,n.tableName,a,i)>=ln){let s=n.blobColumns,d=s&&s.length>0?y=>W(y,s):void 0;return{count:Ie(D(t,n.fileName),xe(e,n.tableName,a,i),d)}}let l=Q(e,n.tableName,a,i);return n.blobColumns&&n.blobColumns.length>0&&(l=l.map(s=>W(s,n.blobColumns))),le(D(t,n.fileName),l),{count:l.length,rows:l}}function Be(e){let n=[];for(let r of _){let t=D(e,r.fileName);te(t)?n.push(A(ce(t,"utf-8"))):n.push(A(""))}return A(n.join(":"))}function Oe(e,n,r="memory.db"){let t=de(n.outputPath);te(t)||rn(t,{recursive:!0});let a=0,i={},c=new Set;for(let f of _){let y=cn(e,f,n,t);if(i[f.tableName]=y.count,a+=y.count,f.tableName==="qe_patterns"){if(y.rows)for(let h of y.rows)h.qe_domain&&c.add(h.qe_domain);else if(y.count>0){let[h,E]=f.domainColumn?J(n.domains,f.domainColumn):[void 0,[]],u=`SELECT DISTINCT qe_domain FROM qe_patterns ${h?`WHERE ${h} AND qe_domain IS NOT NULL`:"WHERE qe_domain IS NOT NULL"}`;try{let R=e.prepare(u).all(...E||[]);for(let g of R)c.add(g.qe_domain)}catch{}}}}let l=n.includeVectors!==!1?se(e,"vectors"):0,s=Be(t),d={version:"3.0",exportedAt:new Date().toISOString(),sourceDb:r,stats:{patternCount:i.qe_patterns||0,vectorCount:l,qValueCount:i.rl_q_values||0,dreamInsightCount:i.dream_insights||0,witnessChainLength:i.witness_chain||0,totalRecords:a},domains:[...c].sort(),checksum:s,tableRecordCounts:i};return on(D(t,"manifest.json"),JSON.stringify(d,null,2),"utf-8"),d}var dn=new Set(["qe_patterns","rl_q_values","dream_insights","witness_chain"]);function fn(e){return e==="1.0"?_.filter(n=>dn.has(n.tableName)):e==="3.0"?_:(console.warn(`[brain-import] Unknown manifest version '${e}'. Attempting full import \u2014 some files may be missing.`),_)}function Ae(e,n,r){let t=de(n),a=D(t,"manifest.json");if(!te(a))throw new Error(`Manifest not found at ${a}`);let i=k(ce(a,"utf-8")),c=Be(t);if(c!==i.checksum)throw new Error(`Checksum mismatch: expected ${i.checksum}, got ${c}. The export may have been tampered with or corrupted.`);let l=fn(i.version),s=0,d=0,f=0,y=()=>{let h=new Map,E=new Map,m=0;for(let u of l){let R=D(t,u.fileName),g=P(R,k);if(u.tableName==="witness_chain"){m+=g.length,d+=g.length;continue}u.blobColumns&&u.blobColumns.length>0&&(g=g.map(b=>G(b,u.blobColumns)));for(let b of g){let O=Y(b,h),x;if(u.dedupColumns&&u.dedupColumns.length>0)x=Z(e,u.tableName,O,u.dedupColumns,u.preserveId);else{let N=L[u.tableName]||"id",I=K[u.tableName],p=z[u.tableName];x=X(e,u.tableName,O,N,r.mergeStrategy,I,p,h,E,b.pattern_id)}s+=x.imported,d+=x.skipped,f+=x.conflicts}}ne(e,{sourceChecksum:i.checksum,sourceWitnessRows:m,importedRecords:s,skippedRecords:d,conflicts:f}),s+=1};return ee(e,r.dryRun??!1,y),{imported:s,skipped:d,conflicts:f}}function Ne(e){let n=de(e),r=D(n,"manifest.json");if(!te(r))throw new Error(`Manifest not found at ${r}`);return k(ce(r,"utf-8"))}
|
|
6
|
+
`).run(i,ae(r,t),t,new Date().toISOString(),r)}var an={rl_q_values:"includeQValues",dream_insights:"includeDreamInsights",dream_cycles:"includeDreamInsights",witness_chain:"includeWitnessChain",vectors:"includeVectors"};function sn(e,n){let r=an[e.tableName];return!(r&&n[r]===!1)}var ln=1e4;function cn(e,n,r,t){if(!sn(n,r))return le(D(t,n.fileName),[]),{count:0,rows:[]};let[a,i]=n.domainColumn?J(r.domains,n.domainColumn):[void 0,[]];if(r.domains&&r.domains.length>0&&!n.domainColumn){let s=r.domains.map(()=>"?").join(","),d=`manifest_id IN (SELECT id FROM learning_evidence_manifests WHERE task_family IN (${s}))`;["learning_evidence_segments","learning_segment_edges","learning_evidence_admissions"].includes(n.tableName)?(a=d,i=[...r.domains]):["pattern_manifest_lineage","pattern_segment_lineage"].includes(n.tableName)&&(a=`${d} AND pattern_id IN (SELECT id FROM qe_patterns WHERE qe_domain IN (${s}))`,i=[...r.domains,...r.domains])}if(se(e,n.tableName,a,i)>=ln){let s=n.blobColumns,d=s&&s.length>0?y=>W(y,s):void 0;return{count:Ie(D(t,n.fileName),xe(e,n.tableName,a,i),d)}}let l=Q(e,n.tableName,a,i);return n.blobColumns&&n.blobColumns.length>0&&(l=l.map(s=>W(s,n.blobColumns))),le(D(t,n.fileName),l),{count:l.length,rows:l}}function Be(e){let n=[];for(let r of _){let t=D(e,r.fileName);te(t)?n.push(A(ce(t,"utf-8"))):n.push(A(""))}return A(n.join(":"))}function Oe(e,n,r="memory.db"){let t=de(n.outputPath);te(t)||rn(t,{recursive:!0});let a=0,i={},c=new Set;for(let f of _){let y=cn(e,f,n,t);if(i[f.tableName]=y.count,a+=y.count,f.tableName==="qe_patterns"){if(y.rows)for(let h of y.rows)h.qe_domain&&c.add(h.qe_domain);else if(y.count>0){let[h,E]=f.domainColumn?J(n.domains,f.domainColumn):[void 0,[]],u=`SELECT DISTINCT qe_domain FROM qe_patterns ${h?`WHERE ${h} AND qe_domain IS NOT NULL`:"WHERE qe_domain IS NOT NULL"}`;try{let R=e.prepare(u).all(...E||[]);for(let g of R)c.add(g.qe_domain)}catch{}}}}let l=n.includeVectors!==!1?se(e,"vectors"):0,s=Be(t),d={version:"3.0",exportedAt:new Date().toISOString(),sourceDb:r,stats:{patternCount:i.qe_patterns||0,vectorCount:l,qValueCount:i.rl_q_values||0,dreamInsightCount:i.dream_insights||0,witnessChainLength:i.witness_chain||0,totalRecords:a},domains:[...c].sort(),checksum:s,tableRecordCounts:i};return on(D(t,"manifest.json"),JSON.stringify(d,null,2),"utf-8"),d}var dn=new Set(["qe_patterns","rl_q_values","dream_insights","witness_chain"]);function fn(e){return e==="1.0"?_.filter(n=>dn.has(n.tableName)):e==="3.0"?_:(console.warn(`[brain-import] Unknown manifest version '${e}'. Attempting full import \u2014 some files may be missing.`),_)}function Ae(e,n,r){let t=de(n),a=D(t,"manifest.json");if(!te(a))throw new Error(`Manifest not found at ${a}`);let i=k(ce(a,"utf-8")),c=Be(t);if(c!==i.checksum)throw new Error(`Checksum mismatch: expected ${i.checksum}, got ${c}. The export may have been tampered with or corrupted.`);let l=fn(i.version),s=0,d=0,f=0,y=()=>{let h=new Map,E=new Map,m=0;for(let u of l){let R=D(t,u.fileName),g=P(R,k);if(u.tableName==="witness_chain"){m+=g.length,d+=g.length;continue}u.blobColumns&&u.blobColumns.length>0&&(g=g.map(b=>G(b,u.blobColumns)));for(let b of g){let O=Y(b,h),x;if(u.dedupColumns&&u.dedupColumns.length>0)x=Z(e,u.tableName,O,u.dedupColumns,u.preserveId);else{let N=L[u.tableName]||"id",I=K[u.tableName],p=z[u.tableName];x=X(e,u.tableName,O,N,r.mergeStrategy,I,p,h,E,b.pattern_id)}s+=x.imported,d+=x.skipped,f+=x.conflicts}}ne(e,{sourceChecksum:i.checksum,sourceWitnessRows:m,importedRecords:s,skippedRecords:d,conflicts:f}),s+=1};return ee(e,r.dryRun??!1,y),{imported:s,skipped:d,conflicts:f}}function Ne(e){let n=de(e),r=D(n,"manifest.json");if(!te(r))throw new Error(`Manifest not found at ${r}`);return k(ce(r,"utf-8"))}nn();import{existsSync as j,readdirSync as mn,renameSync as un,statSync as pn,unlinkSync as fe,writeFileSync as gn}from"fs";import{basename as yn,dirname as hn,join as bn,resolve as re}from"path";var De=["",".idmap.json",".manifest.json"],wn=[...De,".lock"];function ke(e){for(let n of wn)try{let r=`${e}${n}`;j(r)&&fe(r)}catch{}}function Rn(e){let n=hn(e),r=`${yn(e)}.tmp.`,t;try{t=mn(n)}catch{return}for(let a of t){if(!a.startsWith(r))continue;let i=Number.parseInt(a.slice(r.length).split(".")[0],10);if(!(!Number.isInteger(i)||i<=0)&&!(i!==process.pid&&vn(i)))try{fe(bn(n,a))}catch{}}}function vn(e){try{return process.kill(e,0),!0}catch(n){return n.code==="EPERM"}}function $e(e,n,r="memory.db"){if(!V())throw new Error("@ruvector/rvf-node is not available. Install it or use --format jsonl instead.");let t=re(n.outputPath),a=n.dimension??384,i=`${t}.tmp.${process.pid}`;Rn(t),ke(i);let c=we(i,a),l=!1;try{let s={},d=new Set,f=0;for(let p of _){let[S,w]=p.domainColumn?J(n.domains,p.domainColumn):[void 0,[]],C=Q(e,p.tableName,S,w);if(n.domains&&n.domains.length>0){let v=new Set((s.learning_evidence_manifests??[]).map(B=>B.id)),q=new Set((s.qe_patterns??[]).map(B=>B.id));["learning_evidence_segments","learning_segment_edges","learning_evidence_admissions"].includes(p.tableName)?C=C.filter(B=>v.has(B.manifest_id)):p.tableName==="pattern_manifest_lineage"?C=C.filter(B=>{let T=B;return v.has(T.manifest_id)&&q.has(T.pattern_id)}):p.tableName==="pattern_segment_lineage"&&(C=C.filter(B=>{let T=B;return v.has(T.manifest_id)&&q.has(T.pattern_id)}))}if(p.tableName==="qe_patterns")for(let v of C)v.qe_domain&&d.add(v.qe_domain);let M=ie[p.tableName];M&&M.length>0&&(C=C.map(v=>W(v,M))),s[p.tableName]=C,f+=C.length}let y=0,h=[];if(Ce(e,"qe_pattern_embeddings")){let p=e.prepare("PRAGMA table_info('qe_pattern_embeddings')").all().some(w=>w.name==="space_id"),S=e.prepare(`SELECT pattern_id, embedding, dimension, ${p?"space_id":"NULL"} AS space_id
|
|
7
7
|
FROM qe_pattern_embeddings`).all();for(let w of S)w.embedding&&w.dimension===a&&w.space_id&&h.push({id:`pe:${w.pattern_id}`,vector:new Float32Array(w.embedding.buffer,w.embedding.byteOffset,a),metadata:{tableName:"qe_pattern_embeddings",spaceId:w.space_id}})}h.length>0&&(y=c.ingest(h).accepted);let E={version:"3.0",format:"rvf",exportedAt:new Date().toISOString(),sourceDb:r,domains:[...d].sort(),tables:s},m=JSON.stringify(E),u=A(m),R=Buffer.from(m);c.embedKernel(R);let g=n.sign?c.sign(R)??void 0:void 0,b=g?n.signerKeyId??"default":void 0,O=c.fileId(),x=O?{fileId:O,parentId:c.parentId(),lineageDepth:c.lineageDepth()}:void 0,N=c.status(),I={version:"3.0",format:"rvf",exportedAt:E.exportedAt,sourceDb:r,stats:{patternCount:(s.qe_patterns||[]).length,embeddingCount:y,qValueCount:(s.rl_q_values||[]).length,dreamInsightCount:(s.dream_insights||[]).length,witnessChainLength:(s.witness_chain||[]).length,totalRecords:f,tableCounts:Object.fromEntries(_.map(({tableName:p})=>[p,s[p]?.length??0]))},domains:E.domains,checksum:u,rvfStatus:{totalVectors:N.totalVectors,totalSegments:N.totalSegments,fileSizeBytes:N.fileSizeBytes},...g?{signature:g,signerKeyId:b}:{},...x?{lineage:x}:{}};if(g)try{c.freeze()}catch{}if(gn(`${i}.manifest.json`,JSON.stringify(I,null,2),"utf-8"),c.close(),l=!0,j(t)&&!n.allowOverwriteRicher){let p;try{p=U(t)}catch(S){if(Sn(t)||!_n(S)){let w=S instanceof Error?S.message:String(S);throw new Error(`RVF_MIRROR_INSPECTION_AMBIGUOUS: the existing mirror is readable but its richness could not be established (${w}). Preserve/import it before retrying, or repeat with --force-overwrite-richer after preserving a backup.`)}}if(p){let S=p.stats.tableCounts,w=I.stats.tableCounts,C=_.map(({tableName:v})=>v).filter(v=>!S||!Number.isSafeInteger(S[v]));if(C.length>0)throw new Error(`RVF_MIRROR_INSPECTION_AMBIGUOUS: existing mirror lacks trustworthy counts for ${C.join(", ")}. Preserve/import it before retrying, or repeat with --force-overwrite-richer after preserving a backup.`);let M=_.map(({tableName:v})=>({tableName:v,existing:S[v],candidate:w[v]})).filter(({existing:v,candidate:q})=>v>q);if(M.length>0){let v=M.map(({tableName:q,existing:B,candidate:T})=>`${q} ${B} -> ${T}`).join(", ");throw new Error(`RVF_MIRROR_RICHER: refusing to replace richer mirrored tables: ${v}. Restore/import the mirror first, or repeat with --force-overwrite-richer after preserving a backup.`)}}}for(let p of[...De].reverse()){let S=`${i}${p}`,w=`${t}${p}`;j(S)?un(S,w):j(w)&&fe(w)}return I}catch(s){if(!l)try{c.close()}catch{}throw ke(i),s}}function Sn(e){let n;try{return n=H(re(e)),!!n.extractKernel()?.image}catch{return!1}finally{try{n?.close()}catch{}}}function _n(e){let n=e instanceof Error?e.message:String(e);return/ManifestNotFound|InvalidMagic|ChecksumMismatch|CorruptStore/i.test(n)}var En={patterns:"qe_patterns",qValues:"rl_q_values",dreamInsights:"dream_insights",witnessChain:"witness_chain"};function Te(e,n,r){if(!V())throw new Error("@ruvector/rvf-node is not available. Install it or use JSONL format.");let t=re(n);if(!j(t))throw new Error(`RVF file not found: ${t}`);let a=r.dryRun?H(t):Re(t);try{let i=a.verifyWitness();if(!i.valid&&(i.totalEntries>0||i.errors.length>0)){let m=i.errors.length>0?i.errors.join("; "):"unknown integrity error";throw new Error(`RVF witness verification failed: ${m}`)}let c=a.extractKernel();if(!c||!c.image)throw new Error("No brain data found in RVF file (missing kernel segment)");let l;try{l=JSON.parse(c.image.toString("utf-8"))}catch(m){throw new Error(`Failed to parse brain kernel data as JSON: ${m instanceof Error?m.message:m}`)}let s=0,d=0,f=0,y=0,h={};if(l.tables)Object.assign(h,l.tables);else for(let[m,u]of Object.entries(En)){let R=l[m];Array.isArray(R)&&(h[u]=R)}let E=()=>{let m=new Map,u=new Map,R=0;for(let g of _){let b=h[g.tableName];if(!b||!Array.isArray(b))continue;if(g.tableName==="witness_chain"){R+=b.length,d+=b.length;continue}let O=ie[g.tableName];O&&O.length>0&&(b=b.map(x=>G(x,O)));for(let x of b){let N=Y(x,m),I;if(g.dedupColumns&&g.dedupColumns.length>0)I=Z(e,g.tableName,N,g.dedupColumns,g.preserveId);else{let p=L[g.tableName]||"id",S=K[g.tableName],w=z[g.tableName];I=X(e,g.tableName,N,p,r.mergeStrategy,S,w,m,u,x.pattern_id)}if(I.imported)for(let p of O??[])N[p]instanceof Buffer&&y++;s+=I.imported,d+=I.skipped,f+=I.conflicts}}ne(e,{sourceChecksum:A(c.image.toString("utf-8")),sourceWitnessRows:R,importedRecords:s,skippedRecords:d,conflicts:f}),s+=1};if(ee(e,r.dryRun??!1,E),!r.dryRun&&f>0)try{a.compact()}catch{}return{imported:s,skipped:d,conflicts:f,embeddingsRestored:y}}finally{a.close()}}function U(e){if(!V())throw new Error("@ruvector/rvf-node is not available.");let n=re(e);if(!j(n))throw new Error(`RVF file not found: ${n}`);let r=H(n);try{let t=r.extractKernel();if(!t||!t.image)throw new Error("No brain data found in RVF file");let a=t.image.toString("utf-8"),i;try{i=JSON.parse(a)}catch(m){throw new Error(`Failed to parse brain kernel data as JSON: ${m instanceof Error?m.message:m}`)}let c=r.status(),l=pn(n).size,s=i.tables,d=s?s.qe_patterns?.length??0:i.patterns?.length??0,f=s?s.rl_q_values?.length??0:i.qValues?.length??0,y=s?s.dream_insights?.length??0:i.dreamInsights?.length??0,h=s?s.witness_chain?.length??0:i.witnessChain?.length??0,E=s&&typeof s=="object"&&!Array.isArray(s)?Object.fromEntries(Object.entries(s).filter(m=>Array.isArray(m[1])).map(([m,u])=>[m,u.length])):void 0;return{version:"3.0",format:"rvf",exportedAt:i.exportedAt??"unknown",sourceDb:i.sourceDb??"unknown",stats:{patternCount:d,embeddingCount:c.totalVectors,qValueCount:f,dreamInsightCount:y,witnessChainLength:h,...E?{tableCounts:E}:{}},domains:i.domains??[],checksum:A(a),rvfStatus:{totalVectors:c.totalVectors,totalSegments:c.totalSegments,fileSizeBytes:l}}}finally{r.close()}}function me(){return V()}oe();import{existsSync as pe,readFileSync as Cn,statSync as xn}from"fs";import{join as ue,resolve as Me}from"path";function Pe(e,n,r={}){let t=Me(e),a=Me(n),i=qe(t),c=qe(a),l=Fe(t,i),s=Fe(a,c),d=i==="jsonl"&&c==="jsonl",f=On({pathA:t,pathB:a,manifestA:l,manifestB:s,recordLevel:d,tableFilter:r.tableFilter,maxIdsPerBucket:r.maxIdsPerBucket??500}),y=new Set(l.domains),h=new Set(s.domains),E=l.domains.filter(b=>!h.has(b)),m=s.domains.filter(b=>!y.has(b)),u=l.checksum===s.checksum,R=l.version===s.version,g=u&&R&&f.every(b=>b.delta===0&&(b.added?.length??0)===0&&(b.removed?.length??0)===0&&(b.changed?.length??0)===0);return{pathA:t,pathB:a,formatA:i,formatB:c,manifestA:l,manifestB:s,checksumMatch:u,versionMatch:R,identical:g,recordLevel:d,tableDiffs:f,domainsOnlyInA:E,domainsOnlyInB:m}}function qe(e){if(!pe(e))throw new Error(`Path not found: ${e}`);if(e.endsWith(".rvf"))return"rvf";if(xn(e).isFile())throw new Error(`Unsupported brain export: ${e} (expected a .rvf file or a JSONL directory)`);return"jsonl"}function Fe(e,n){return n==="rvf"?Bn(e):In(e)}function In(e){let n=ue(e,"manifest.json");if(!pe(n))throw new Error(`Manifest not found at ${n}`);let r=k(Cn(n,"utf-8"));return je(r,"jsonl")}function Bn(e){let n=U(e);return je(n,"rvf")}function je(e,n){return{format:n,version:e.version??"unknown",exportedAt:e.exportedAt??"unknown",sourceDb:e.sourceDb??"unknown",checksum:e.checksum??"",totalRecords:e.stats?.totalRecords??0,domains:e.domains??[],tableRecordCounts:e.tableRecordCounts??{}}}function On(e){let n=e.tableFilter?_.filter(t=>t.tableName===e.tableFilter):_;if(e.tableFilter&&n.length===0)throw new Error(`Unknown table: ${e.tableFilter}`);let r=[];for(let t of n){let a=e.manifestA.tableRecordCounts[t.tableName]??0,i=e.manifestB.tableRecordCounts[t.tableName]??0,c=i-a,l,s,d;if(e.recordLevel&&An(t)){let f=Nn(ue(e.pathA,t.fileName),ue(e.pathB,t.fileName),t,e.maxIdsPerBucket);l=f.added,s=f.removed,d=f.changed}r.push({tableName:t.tableName,countA:a,countB:i,delta:c,...l!==void 0?{added:l}:{},...s!==void 0?{removed:s}:{},...d!==void 0?{changed:d}:{}})}return r}function An(e){return!0}function Nn(e,n,r,t){let a=Le(e,r),i=Le(n,r),c=[],l=[],s=[];for(let[d,f]of a){let y=i.get(d);if(y===void 0)l.length<t&&l.push(d);else if(y!==f){if(r.dedupColumns&&r.dedupColumns.length>0)continue;s.length<t&&s.push(d)}}for(let d of i.keys())a.has(d)||c.length<t&&c.push(d);return c.sort(),l.sort(),s.sort(),{added:c,removed:l,changed:s}}function Le(e,n){let r=new Map;if(!pe(e))return r;let t=P(e,k);for(let a of t){let i=kn(a,n);if(i===void 0)continue;let c=Dn(a);r.set(i,$n(c))}return r}function kn(e,n){if(n.dedupColumns&&n.dedupColumns.length>0){let a=[];for(let i of n.dedupColumns){let c=e[i];if(c==null)return;a.push(String(c))}return a.join("")}let r=L[n.tableName]??"id",t=e[r];if(t!=null)return String(t)}function Dn(e){let n=Object.keys(e).sort(),r={};for(let t of n)r[t]=e[t];return JSON.stringify(r)}function $n(e){return A(e)}oe();import{existsSync as ge,statSync as Tn}from"fs";import{join as Ve,resolve as Mn}from"path";var qn=20,Fn="qe_patterns";function We(e,n={}){let r=Mn(e);jn(r);let t=n.table??Fn,a=_.find(R=>R.tableName===t);if(!a)throw new Error(`Unknown table: ${t}`);let i=Ve(r,a.fileName);if(!ge(i))throw new Error(`Table file not found: ${a.fileName} (expected in ${r}). Was this export generated with --format jsonl?`);let c=P(i,k),l=a.domainColumn,s=Math.max(1,n.limit??qn),d=n.query?n.query.toLowerCase():void 0,f=n.domains&&n.domains.length>0?new Set(n.domains):void 0,y=n.since,h=n.until,E=n.patternType,m=0,u=[];for(let R of c)Ln(R,{domainColumn:l,domains:f,patternType:E,since:y,until:h,queryLower:d})&&(m++,u.length<s&&u.push(Pn(R,a.tableName,l)));return{table:t,inputPath:r,totalScanned:c.length,totalMatched:m,limit:s,hits:u,truncated:m>s}}function Ln(e,n){if(n.domains){if(!n.domainColumn)return!1;let r=e[n.domainColumn];if(typeof r!="string"||!n.domains.has(r))return!1}if(n.patternType!==void 0&&e.pattern_type!==n.patternType)return!1;if(n.since!==void 0||n.until!==void 0){let r=Je(e);if(r===void 0||n.since!==void 0&&r<n.since||n.until!==void 0&&r>n.until)return!1}if(n.queryLower!==void 0){let r=typeof e.name=="string"?e.name.toLowerCase():"",t=typeof e.description=="string"?e.description.toLowerCase():"";if(!r.includes(n.queryLower)&&!t.includes(n.queryLower))return!1}return!0}function Je(e){for(let n of["updated_at","created_at","timestamp"]){let r=e[n];if(typeof r=="string"&&r.length>0)return r}}function Pn(e,n,r){let t=(typeof e.id=="string"||typeof e.id=="number"?String(e.id):void 0)??`${n}:?`,a={name:typeof e.name=="string"?e.name:void 0,description:typeof e.description=="string"?e.description:void 0,domain:r&&typeof e[r]=="string"?e[r]:void 0,patternType:typeof e.pattern_type=="string"?e.pattern_type:void 0,confidence:typeof e.confidence=="number"?e.confidence:void 0,updatedAt:Je(e)};return{id:t,display:a,row:e}}function jn(e){if(!ge(e))throw new Error(`Path not found: ${e}`);if(Tn(e).isFile())throw e.endsWith(".rvf")?new Error("Brain search does not support RVF exports. Re-export with --format jsonl, or use `aqe brain info` for RVF summaries."):new Error(`Unsupported brain export: ${e} (expected a JSONL directory)`);let r=Ve(e,"manifest.json");if(!ge(r))throw new Error(`Manifest not found at ${r}. Is this a brain export directory?`)}function Ue(e,n){if(!e.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_patterns'").get())return{created:0,skipped:0};e.exec(`
|
|
8
8
|
CREATE TEMP TABLE IF NOT EXISTS _covered_patterns (
|
|
9
9
|
pattern_id TEXT PRIMARY KEY
|
|
@@ -79,7 +79,7 @@ Examples:
|
|
|
79
79
|
aqe brain diff ./brain-a ./brain-b --verbose
|
|
80
80
|
aqe brain search -i ./brain-export --query oauth --domain test-generation
|
|
81
81
|
aqe brain search -i ./brain-export --since 2026-03-01 --limit 50 --json
|
|
82
|
-
`}};async function ye(e){if(e)return e;let{findProjectRoot:n}=await import("./unified-memory-
|
|
82
|
+
`}};async function ye(e){if(e)return e;let{findProjectRoot:n}=await import("./unified-memory-GHAYAXWZ.js");return $.join(n(),".agentic-qe","memory.db")}function Ze(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Wn(e){let n=Number.parseInt(e,10);return!Number.isFinite(n)||n<1?20:n}function Jn(e){if(e===void 0)return;let n=Array.isArray(e)?e:[e],r=[];for(let t of n)for(let a of t.split(",")){let i=a.trim();i&&r.push(i)}return r.length>0?r:void 0}function Un(e,n){console.log(o.blue(`
|
|
83
83
|
Brain Diff
|
|
84
84
|
`)),console.log(` A: ${o.cyan(e.pathA)} (${e.formatA})`),console.log(` B: ${o.cyan(e.pathB)} (${e.formatB})`),console.log(` Versions: ${o.cyan(e.manifestA.version)} \u2192 ${o.cyan(e.manifestB.version)}`+(e.versionMatch?o.gray(" (match)"):o.yellow(" (differ)"))),console.log(` Checksums: ${o.gray(e.manifestA.checksum.slice(0,12))}\u2026 \u2192 ${o.gray(e.manifestB.checksum.slice(0,12))}\u2026`+(e.checksumMatch?o.gray(" (match)"):o.yellow(" (differ)"))),console.log(` Exported: ${o.gray(e.manifestA.exportedAt)} \u2192 ${o.gray(e.manifestB.exportedAt)}`),console.log(` Records: ${o.cyan(e.manifestA.totalRecords)} \u2192 ${o.cyan(e.manifestB.totalRecords)} `+en(e.manifestB.totalRecords-e.manifestA.totalRecords)),(e.domainsOnlyInA.length>0||e.domainsOnlyInB.length>0)&&(console.log(o.blue(`
|
|
85
85
|
Domains:`)),e.domainsOnlyInA.length>0&&console.log(` Only in A: ${o.yellow(e.domainsOnlyInA.join(", "))}`),e.domainsOnlyInB.length>0&&console.log(` Only in B: ${o.yellow(e.domainsOnlyInB.join(", "))}`)),e.recordLevel||console.log(o.gray(`
|
|
@@ -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"./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"./chunk-XAESN54Q.js";var f=class{language;constructor(e="typescript"){this.language=e}enumerate(e,s){let r=[],n=e.split(`
|
|
3
3
|
`),l=!1;for(let i=0;i<n.length;i++){let d=n[i],t=d.trim(),c=i+1,u=d.length-d.trimStart().length+1;if(l){t.includes("*/")&&(l=!1);continue}if(t.startsWith("/*")){l=!t.includes("*/");continue}if(t.startsWith("//"))continue;if(/^\s*if\s*\(/.test(d)&&(this.findMatchingElse(n,i)||r.push({file:s,line:c,column:u,language:this.language,construct:"if-without-else",triggerCondition:"when condition is false",currentHandling:"falls through \u2014 no else branch",suggestedGuard:"Add else branch or document why falsy path is safe",severity:"medium"})),/^\s*switch\s*\(/.test(d)){let a=this.extractBlock(n,i);if(a&&!a.includes("default:")&&!a.includes("default :")&&r.push({file:s,line:c,column:u,language:this.language,construct:"switch-no-default",triggerCondition:"when value matches no case",currentHandling:"falls through \u2014 no default case",suggestedGuard:"Add default case with error handling or exhaustive check",severity:"high"}),a){let g=a.match(/case\s+[^:]+:/g)||[],h=a.match(/\b(break|return|throw|continue)\b/g)||[];g.length>0&&h.length<g.length&&r.push({file:s,line:c,column:u,language:this.language,construct:"switch-missing-break",triggerCondition:"when case falls through to next case",currentHandling:"fall-through \u2014 may execute unintended cases",suggestedGuard:"Add break/return to each case or add explicit // falls through comment",severity:"medium"})}}if(/\bcatch\s*\(/.test(t)||/\bcatch\s*\{/.test(t)){let a=this.extractBlock(n,i);if(a!==null){let g=a.replace(/[{}]/g,"").trim();(g.length===0||/^\s*\/\//.test(g))&&r.push({file:s,line:c,column:u,language:this.language,construct:"try-empty-catch",triggerCondition:"when exception is thrown",currentHandling:"exception silently swallowed",suggestedGuard:"Log the error or rethrow with context",severity:"high"})}}if(/\btry\s*\{/.test(t)&&this.extractBlock(n,i)&&(n.slice(i,Math.min(i+30,n.length)).join(`
|
|
4
4
|
`).includes("finally")||r.push({file:s,line:c,column:u,language:this.language,construct:"try-no-finally",triggerCondition:"when cleanup is needed regardless of success/failure",currentHandling:"no finally block \u2014 cleanup may be skipped on exception",suggestedGuard:"Add finally block for resource cleanup if applicable",severity:"low"})),t.includes("?.")){let a=t.match(/(\w+(?:\.\w+)*)\?\./g)||[];for(let g of a)if(!t.includes("??")&&!t.includes("|| ")&&!t.includes("if")){r.push({file:s,line:c,column:u,language:this.language,construct:"optional-chaining-null-path",triggerCondition:`when ${g.replace("?.","")} is null/undefined`,currentHandling:"returns undefined \u2014 may propagate",suggestedGuard:"Add ?? fallback or explicit null check",severity:"low"});break}}if(t.includes("??")&&!t.includes("?.")&&r.push({file:s,line:c,column:u,language:this.language,construct:"nullish-coalescing-fallback",triggerCondition:"when left side is null/undefined",currentHandling:"uses fallback value",suggestedGuard:"Verify fallback value is appropriate for all null cases",severity:"low"}),/\.\s*then\s*\(/.test(t)&&!t.includes(".catch")&&!t.includes("await")){let a=n.slice(i,Math.min(i+5,n.length)).join(" ");!a.includes(".catch")&&!a.includes("try")&&r.push({file:s,line:c,column:u,language:this.language,construct:"promise-no-catch",triggerCondition:"when promise rejects",currentHandling:"unhandled rejection \u2014 may crash process",suggestedGuard:"Add .catch() handler or use try/catch with await",severity:"high"})}let p=["map","filter","reduce","forEach","find","some","every","flatMap"];for(let a of p)if(new RegExp(`\\.${a}\\s*\\(`).test(t)){let h=n.slice(Math.max(0,i-3),i).join(" ");if(!h.includes(".length")&&!h.includes("if (")&&!h.includes("?.")){r.push({file:s,line:c,column:u,language:this.language,construct:"array-callback-empty",triggerCondition:`when array is empty before .${a}()`,currentHandling:a==="reduce"?"may throw without initial value":"returns empty result \u2014 may cause downstream issues",suggestedGuard:a==="reduce"?"Provide initial value or check array length":"Check array length or handle empty result",severity:a==="reduce"?"high":"low"});break}}/\|\|\s*['"`\d]/.test(t)&&!t.includes("??")&&r.push({file:s,line:c,column:u,language:this.language,construct:"logical-or-falsy",triggerCondition:'when left side is falsy (0, "", false, null, undefined)',currentHandling:'uses fallback \u2014 may unintentionally override 0, "", or false',suggestedGuard:"Use ?? instead of || if only null/undefined should trigger fallback",severity:"medium"}),/&&\s*\w+\s*\(/.test(t)&&!t.includes("if")&&!t.includes("while")&&r.push({file:s,line:c,column:u,language:this.language,construct:"logical-and-short-circuit",triggerCondition:"when left side is falsy \u2014 right side never executes",currentHandling:"short-circuits \u2014 function call skipped silently",suggestedGuard:"Use explicit if-statement for clarity when side effects matter",severity:"low"}),(t.match(/\?/g)||[]).length>=2&&t.includes(":")&&r.push({file:s,line:c,column:u,language:this.language,construct:"ternary-complex",triggerCondition:"when nested ternary conditions interact",currentHandling:"nested ternary \u2014 hard to read and maintain",suggestedGuard:"Refactor to if/else or switch for readability",severity:"medium"}),(/\btypeof\s+\w+\s*===?\s*['"]/.test(t)||/\binstanceof\b/.test(t))&&!t.includes("else")&&!this.findMatchingElse(n,i)&&r.push({file:s,line:c,column:u,language:this.language,construct:"type-guard-unhandled",triggerCondition:"when value does not match the guarded type",currentHandling:"unguarded type path \u2014 may cause runtime type errors",suggestedGuard:"Add else branch or exhaustive type checking",severity:"medium"})}return r}findMatchingElse(e,s){let r={depth:0};for(let n=s;n<Math.min(s+30,e.length);n++){let l=e[n];for(let i of l)i==="{"&&r.depth++,i==="}"&&r.depth--;if(r.depth===0&&n>s){if((e[n+1]?.trim()||"").startsWith("else")||e[n].trim().endsWith("else")||e[n].trim().endsWith("else {")||e[n].includes("} else"))return!0;break}}return!1}extractBlock(e,s){let r=0,n=!1,l=[];for(let i=s;i<Math.min(s+50,e.length);i++){let d=e[i];for(let t of d)t==="{"&&(r++,n=!0),t==="}"&&r--;if(n&&(l.push(d),r===0))return l.join(`
|
|
5
5
|
`)}return null}};function y(o,e,s){let r=Date.now(),n=s||(e.endsWith(".ts")||e.endsWith(".tsx")?"typescript":"javascript"),i=new f(n).enumerate(o,e);return{file:e,language:n,branches:i,totalConstructs:i.length,unhandledCount:i.length,duration:Date.now()-r}}function b(o){let e=[];if(e.push(`# Branch Enumeration Report: ${o.file}`),e.push(""),e.push(`**Language**: ${o.language} | **Branches**: ${o.unhandledCount} | **Duration**: ${o.duration}ms`),e.push(""),o.branches.length===0)return e.push("No unhandled branches detected."),e.join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.
|
|
2
|
-
import{a 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{a as p}from"./chunk-DZHXCOSK.js";import"./chunk-XAESN54Q.js";import{readFile as m,readdir as k}from"fs/promises";import{join as c,basename as y,dirname as W}from"path";import{fileURLToPath as v}from"url";import{parse as d}from"yaml";var b=v(import.meta.url),E=W(b),l=class{templatesDir;cache=new Map;constructor(r){this.templatesDir=r||c(E,"templates")}async load(r){if(this.cache.has(r))return this.cache.get(r);try{let e=c(this.templatesDir,`${r}.yaml`),n=await m(e,"utf-8"),o=d(n),i=await this.validate(o);if(!i.valid)throw new Error(`Invalid workflow template ${r}:
|
|
3
3
|
${i.errors.join(`
|
|
4
4
|
`)}`);return this.cache.set(r,o),o}catch(e){throw e.code==="ENOENT"?new Error(`Workflow template not found: ${r}`):e}}async list(){try{return(await k(this.templatesDir)).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).map(e=>y(e,e.endsWith(".yaml")?".yaml":".yml")).sort()}catch(r){if(r.code==="ENOENT")return[];throw r}}async validate(r){let e=[],n=[];if(r.name||e.push("Workflow must have a name"),r.version||e.push("Workflow must have a version"),r.description||n.push("Workflow should have a description"),Array.isArray(r.variables)?r.variables.forEach((o,i)=>{o.name||e.push(`Variable at index ${i} must have a name`),o.type||e.push(`Variable ${o.name} must have a type`),o.required===void 0&&n.push(`Variable ${o.name} should specify if it's required`)}):e.push("Workflow must have a variables array"),!Array.isArray(r.steps))e.push("Workflow must have a steps array");else if(r.steps.length===0)e.push("Workflow must have at least one step");else{r.steps.forEach((t,s)=>{t.name||e.push(`Step at index ${s} must have a name`),t.action||e.push(`Step ${t.name||s} must have an action`),(!t.config||typeof t.config!="object")&&e.push(`Step ${t.name||s} must have a config object`),t.assertions&&Array.isArray(t.assertions)&&t.assertions.forEach((f,u)=>{f.condition||e.push(`Assertion ${u} in step ${t.name||s} must have a condition`),f.message||n.push(`Assertion ${u} in step ${t.name||s} should have a message`)})});let o=r.steps.map(t=>t.name),i=o.filter((t,s)=>o.indexOf(t)!==s);i.length>0&&e.push(`Duplicate step names found: ${i.join(", ")}`)}return{valid:e.length===0,errors:e,warnings:n}}async createContext(r,e){let n=await this.load(r),o=n.variables.filter(t=>t.required&&!(t.name in e)).map(t=>t.name);if(o.length>0)throw new Error(`Missing required variables: ${o.join(", ")}`);let i={};return n.variables.forEach(t=>{t.name in e?i[t.name]=e[t.name]:"default"in t&&(i[t.name]=t.default)}),{variables:i,results:new Map,metadata:{startTime:Date.now(),workflow:n.name,templateName:r}}}async getMetadata(r){try{let e=c(this.templatesDir,`${r}.yaml`),n=await m(e,"utf-8"),o=d(n);return{name:o.name,version:o.version,description:o.description}}catch(e){throw e.code==="ENOENT"?new Error(`Workflow template not found: ${r}`):e}}clearCache(){this.cache.clear()}async reload(r){return this.cache.delete(r),this.load(r)}},x=new l;function w(a,r){return a.replace(/\{\{([^}]+)\}\}/g,(e,n)=>{let i=n.trim().split("."),t=r;for(let s of i)if(t&&typeof t=="object"&&s in t)t=t[s];else return e;return t!=null?String(t):e})}function T(a,r){let e={...r.variables,result:r.results.get("__last_result__")},n=w(a,e);return p(n,e,!1)}var g=["login-flow","oauth-flow","scraping-workflow","visual-regression","form-validation","navigation-flow","api-integration","performance-audit","accessibility-audit"],A={"login-flow":"Authentication testing workflow for login forms with credential validation","oauth-flow":"OAuth2/OIDC authentication testing workflow with provider integration","scraping-workflow":"Data extraction workflow for web scraping with pagination and structured output","visual-regression":"Screenshot comparison workflow for visual regression testing across breakpoints","form-validation":"Input validation testing workflow for form fields with error handling","navigation-flow":"Multi-page navigation workflow for testing user journeys and state persistence","api-integration":"Browser-API hybrid testing workflow for validating frontend-backend integration","performance-audit":"Lighthouse-style performance audit workflow with Core Web Vitals","accessibility-audit":"WCAG 2.1 Level AA compliance audit workflow with automated accessibility testing"},h={authentication:["login-flow","oauth-flow"],testing:["form-validation","navigation-flow","api-integration"],quality:["visual-regression","performance-audit","accessibility-audit"],automation:["scraping-workflow"]};function _(a){return h[a]}function P(a){return g.includes(a)}function L(){return g.map(a=>{let r=Object.entries(h).find(([e,n])=>n.includes(a))?.[0]||"other";return{name:a,description:A[a],category:r}})}export{h as WORKFLOW_CATEGORIES,A as WORKFLOW_DESCRIPTIONS,g as WORKFLOW_TEMPLATES,l as WorkflowLoader,x as defaultWorkflowLoader,T as evaluateCondition,L as getAllWorkflowTemplates,_ as getWorkflowsByCategory,w as interpolateVariables,P as isValidWorkflowTemplate};
|
|
@@ -0,0 +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.8");process.exit(0)}
|
|
2
|
+
import{a}from"./chunk-6F7MFHTY.js";import"./chunk-KKXH25IH.js";import"./chunk-XECZYQT5.js";import"./chunk-JQAJUXRE.js";import"./chunk-BZIPW2PA.js";import"./chunk-RTD4U7IW.js";import"./chunk-BITFGVZ4.js";import"./chunk-A5CLVZC3.js";import"./chunk-LQVS5IWH.js";import"./chunk-SVP3BP52.js";import"./chunk-VCSNNLWL.js";import"./chunk-GA63ESNT.js";import"./chunk-VW7AXJQS.js";import"./chunk-OVMG6EEF.js";import"./chunk-UQGIC5OX.js";import"./chunk-T6W2EYHC.js";import"./chunk-U64QORFO.js";import"./chunk-J5HTQHJK.js";import"./chunk-RJJIPTVH.js";import"./chunk-HPVYJ6JH.js";import"./chunk-R6I5I724.js";import"./chunk-Z5UZOYQS.js";import"./chunk-SPS472C5.js";import"./chunk-T7YCNOW5.js";import"./chunk-XAESN54Q.js";export{a as BrowserWorkflowTool};
|
|
@@ -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.
|
|
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 C,f as x}from"./chunk-OA75C4HY.js";import{a as h}from"./chunk-BFIXUKOR.js";var d={mechanical:["convert var to const","add types","remove console","convert to async","convert to esm","arrow function","rename variable","format code"],simple:["fix typo","update comment","fix simple bug","add documentation","format","rename","simple refactor","basic test"],moderate:["implement feature","implement","refactor","complex refactor","performance optimization","optimize","test generation","generate test","error handling","validation logic","api integration","code index","coverage analysis","quality assessment","defect prediction","predict defect","analyze coverage","analyze","assess","scan","detect"],complex:["multi-file refactor","orchestrate","coordinate","large codebase","migration","cross-domain","workflow","system design","analyze security","security scan","security analysis","vulnerability scan","chaos test","resilience test","contract validation"],critical:["architecture","security audit","critical bug","algorithm design","system-wide","vulnerability","cryptography","performance critical","hardcoded secret","cve","owasp","penetration test","exploit"]},f={architecture:/\b(architect|design|system design|overall structure|component design)\b/i,security:/\b(security|vulnerability|audit|xss|sql injection|csrf|encryption|auth|authentication|authorization)\b/i,multiStep:/\b(orchestrate|coordinate|workflow|pipeline|multi[- ]step)\b/i,crossDomain:/\b(cross[- ]domain|across (domains|modules)|integrate|coordination)\b/i},m=class{config;agentBoosterAdapter;constructor(e,t){this.config=e,this.agentBoosterAdapter=t}async collectSignals(e){let t=e.task.toLowerCase(),r=await this.checkAgentBoosterEligibility(e),o={simple:this.findKeywordMatches(t,d.simple),moderate:this.findKeywordMatches(t,d.moderate),complex:this.findKeywordMatches(t,d.complex),critical:this.findKeywordMatches(t,d.critical)},c=e.codeContext?e.codeContext.split(`
|
|
3
3
|
`).length:void 0,n=e.filePaths?e.filePaths.length:void 0,i=f.architecture.test(t),a=f.security.test(t),l=f.multiStep.test(t),g=f.crossDomain.test(t),b=this.detectCreativityRequirement(t),S=this.estimateLanguageComplexity(e.codeContext,e.filePaths),T=e.codeContext?this.estimateCyclomaticComplexity(e.codeContext):void 0;return{linesOfCode:c,fileCount:n,hasArchitectureScope:i,hasSecurityScope:a,requiresMultiStepReasoning:l,requiresCrossDomainCoordination:g,isMechanicalTransform:r.eligible,languageComplexity:S,cyclomaticComplexity:T,dependencyCount:this.countDependencies(e.codeContext),requiresCreativity:b,detectedTransformType:r.transformType,keywordMatches:o}}async checkAgentBoosterEligibility(e){if(!this.config.enableAgentBooster)return{eligible:!1,confidence:0,reason:"Agent Booster is disabled"};let t=e.task.toLowerCase(),r,o=0;for(let n of h){let i=this.getTransformKeywords(n),a=0;for(let l of i)t.includes(l.toLowerCase())&&(a=a===0?.5:a+.25);for(let l of d.mechanical)t.includes(l.toLowerCase())&&(a=Math.max(a,.6));a>o&&(o=a,r=n)}if(e.codeContext&&r&&this.agentBoosterAdapter)try{let i=(await this.agentBoosterAdapter.detectTransformOpportunities(e.codeContext)).opportunities.find(a=>a.type===r);if(i)return{eligible:i.confidence>=this.config.agentBoosterThreshold,transformType:r,confidence:i.confidence,reason:i.reason}}catch(n){console.debug("[SignalCollector] WASM analysis error:",n instanceof Error?n.message:n)}let c=o>=this.config.agentBoosterThreshold&&r!==void 0;return{eligible:c,transformType:r,confidence:Math.min(o,1),reason:c?`Detected ${r} transform pattern`:"No mechanical transform pattern detected"}}findKeywordMatches(e,t){let r=[];for(let o of t)e.includes(o.toLowerCase())&&r.push(o);return r}detectCreativityRequirement(e){return e.includes("design")||e.includes("creative")||e.includes("innovative")||e.includes("novel")}estimateLanguageComplexity(e,t){if(!e&&(!t||t.length===0))return;let r=[".ts",".tsx",".rs",".cpp",".c",".go"],o=[".js",".jsx",".py",".java"],c=[".json",".yaml",".md",".txt",".css",".html"];if(t){for(let n of t)if(r.some(i=>n.endsWith(i)))return"high";for(let n of t)if(o.some(i=>n.endsWith(i)))return"medium";for(let n of t)if(c.some(i=>n.endsWith(i)))return"low"}if(e){let n=/<[A-Z][^>]*>/.test(e),i=/\b(async|await)\b/.test(e),a=/\b(interface|type|class)\b/.test(e);return n&&a?"high":i||a?"medium":"low"}return"medium"}estimateCyclomaticComplexity(e){let t=[/\bif\b/g,/\bfor\b/g,/\bwhile\b/g,/\bcase\b/g,/\bcatch\b/g,/&&/g,/\|\|/g,/\?/g],r=1;for(let o of t){let c=e.match(o);c&&(r+=c.length)}return r}countDependencies(e){if(!e)return;let t=e.match(/\b(import|require|from)\b.*['"].*['"]/g);return t?t.length:0}getTransformKeywords(e){return{"var-to-const":["var to const","convert var","var declaration","var to let","convert var to const","change var to const"],"add-types":["add types","add type","typescript types","type annotations","type annotation","add type annotations"],"remove-console":["remove console","delete console","console.log","remove console.log","strip console"],"promise-to-async":["promise to async","async await",".then to async","convert to async","convert function to async"],"cjs-to-esm":["commonjs to esm","require to import","convert to esm","cjs to esm","module conversion"],"func-to-arrow":["arrow function","function to arrow","convert to arrow","convert function to arrow"]}[e]||[]}};function v(s,e){return new m(s,e)}var u=class{calculateCodeComplexity(e){let t=0;return t+=this.calculateLinesOfCodeContribution(e.linesOfCode),t+=this.calculateFileCountContribution(e.fileCount),t+=this.calculateCyclomaticContribution(e.cyclomaticComplexity),t+=this.calculateLanguageContribution(e.languageComplexity),Math.min(t,100)}calculateReasoningComplexity(e){let t=0;return t+=this.calculateKeywordScore(e.keywordMatches),e.requiresMultiStepReasoning&&(t+=20),e.requiresCreativity&&(t+=20),Math.min(t,100)}calculateScopeComplexity(e){let t=0;return e.hasArchitectureScope&&(t+=40),e.hasSecurityScope&&(t+=30),e.requiresCrossDomainCoordination&&(t+=20),t+=this.calculateDependencyContribution(e.dependencyCount),Math.min(t,100)}calculateOverallComplexity(e,t,r,o){if(o.isMechanicalTransform&&!o.hasSecurityScope&&!o.hasArchitectureScope&&!o.requiresMultiStepReasoning&&!o.requiresCrossDomainCoordination&&e===0&&t===0&&r===0)return 5;let c=e*.3+t*.4+r*.3,n=0;return o.hasSecurityScope&&(n=Math.max(n,50)),o.hasArchitectureScope&&(n=Math.max(n,55)),o.requiresCrossDomainCoordination&&(n=Math.max(n,35)),o.requiresMultiStepReasoning&&(n=Math.max(n,30)),o.keywordMatches.simple.length+o.keywordMatches.moderate.length+o.keywordMatches.complex.length+o.keywordMatches.critical.length===0&&!o.isMechanicalTransform&&c<15&&(n=Math.max(n,15)),Math.min(Math.max(Math.round(c),n),100)}calculateConfidence(e,t){let r=.5;return t.codeContext&&(r+=.2),t.filePaths&&t.filePaths.length>0&&(r+=.1),r+=this.calculateKeywordConfidenceBoost(e.keywordMatches),e.isMechanicalTransform&&(r+=.15),Math.min(r,1)}calculateLinesOfCodeContribution(e){return e===void 0||e<10?0:e<50?10:e<200?20:30}calculateFileCountContribution(e){return e===void 0||e===1?0:e<5?10:20}calculateCyclomaticContribution(e){return e===void 0||e<5?0:e<10?10:e<20?20:30}calculateLanguageContribution(e){return e==="low"?0:e==="medium"?10:e==="high"?20:0}calculateKeywordScore(e){let t=e.simple.length*5+e.moderate.length*15+e.complex.length*25+e.critical.length*35;return Math.min(t,60)}calculateDependencyContribution(e){return e===void 0||e<3?0:e<10?5:10}calculateKeywordConfidenceBoost(e){let t=e.simple.length+e.moderate.length+e.complex.length+e.critical.length;return t>=3?.1:t>=1?.05:0}};function M(){return new u}var p=class{getRecommendedTier(e){for(let t of[0,1,2,3,4]){let[r,o]=C[t].complexityRange;if(e>=r&&e<=o)return t}return 2}findAlternateTiers(e,t){let r=[];return t>0&&r.push(t-1),t<4&&r.push(t+1),t<3&&!r.includes(4)&&r.push(4),r}generateExplanation(e,t,r){let o=[];return o.push(`Complexity score: ${e}/100 (Tier ${t})`),r.isMechanicalTransform&&o.push(this.formatMechanicalTransformInfo(r.detectedTransformType)),o.push(...this.formatScopeExplanations(r)),o.push(...this.formatCodeMetricsExplanations(r)),o.join(". ")}formatMechanicalTransformInfo(e){return`Detected mechanical transform: ${e}`}formatScopeExplanations(e){let t=[];return e.hasArchitectureScope&&t.push("Architecture scope detected"),e.hasSecurityScope&&t.push("Security scope detected"),e.requiresMultiStepReasoning&&t.push("Multi-step reasoning required"),e.requiresCrossDomainCoordination&&t.push("Cross-domain coordination required"),t}formatCodeMetricsExplanations(e){let t=[];return e.linesOfCode!==void 0&&e.linesOfCode>100&&t.push(`Large code change: ${e.linesOfCode} lines`),e.fileCount!==void 0&&e.fileCount>3&&t.push(`Multi-file change: ${e.fileCount} files`),t}};function w(){return new p}var y=class{config;signalCollector;scoreCalculator;tierRecommender;constructor(e,t,r,o){this.config=e,this.signalCollector=t,this.scoreCalculator=r,this.tierRecommender=o}async analyze(e){try{let t=await this.signalCollector.collectSignals(e),r=this.scoreCalculator.calculateCodeComplexity(t),o=this.scoreCalculator.calculateReasoningComplexity(t),c=this.scoreCalculator.calculateScopeComplexity(t),n=this.scoreCalculator.calculateOverallComplexity(r,o,c,t),i=this.tierRecommender.getRecommendedTier(n),a=this.tierRecommender.findAlternateTiers(n,i),l=this.scoreCalculator.calculateConfidence(t,e),g=this.tierRecommender.generateExplanation(n,i,t);return{overall:n,codeComplexity:r,reasoningComplexity:o,scopeComplexity:c,confidence:l,signals:t,recommendedTier:i,alternateTiers:a,explanation:g}}catch(t){throw new x(`Failed to analyze task complexity: ${t instanceof Error?t.message:"Unknown error"}`,t instanceof Error?t:void 0)}}async checkAgentBoosterEligibility(e){return this.signalCollector.checkAgentBoosterEligibility(e)}getRecommendedTier(e){return this.tierRecommender.getRecommendedTier(e)}};function L(s,e){let t=new m(s,e),r=new u,o=new p;return new y(s,t,r,o)}function z(s,e,t,r){return new y(s,e,t,r)}export{m as a,v as b,u as c,M as d,p as e,w as f,y as g,L as h,z as i};
|
|
@@ -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.
|
|
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*as p from"node:fs/promises";import*as o from"node:path";var S=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".pyw",".go",".rs",".java",".kt",".kts",".rb",".cs",".php",".swift",".c",".h",".cpp",".hpp",".cc",".scala"]),E=new Set(["node_modules",".git","dist","build","coverage",".nyc_output","__pycache__",".venv","venv",".tox",".mypy_cache","target",".gradle","vendor",".bundle",".agentic-qe",".claude",".cache",".npm",".yarn",".next",".nuxt",".svelte-kit","out",".turbo","tmp","temp",".tmp"]);function x(l){return S.has(o.extname(l).toLowerCase())}async function _(l,y={}){let m=y.maxFiles??5e3,f=y.maxDepth??64;if(!Number.isSafeInteger(m)||m<1||!Number.isSafeInteger(f)||f<0)throw new Error("Security discovery requires a positive file limit and non-negative depth limit.");let a=[],i=[],h=[],n=o.resolve(l),c=!1,d=!1;function v(e,u){let r=u?.code;i.push({path:e,reason:typeof r=="string"&&/^[A-Z0-9_]{1,32}$/.test(r)?r:"DISCOVERY_FAILED"})}async function g(e,u){if(u>f){i.push({path:e,reason:"DEPTH_LIMIT"});return}let r;try{r=await p.readdir(e,{withFileTypes:!0})}catch(t){v(e,t),e===n&&(c=!0);return}r.sort((t,s)=>t.name<s.name?-1:t.name>s.name?1:0);for(let t of r){if(d)return;let s=o.join(e,t.name);if(t.isSymbolicLink())h.push(s);else if(t.isDirectory())E.has(t.name)?h.push(s):await g(s,u+1);else if(t.isFile()&&x(t.name)){if(a.length===m){i.push({path:s,reason:"FILE_LIMIT"}),d=!0;return}a.push(s)}}}try{let e=await p.lstat(n);e.isFile()?a.push(n):e.isDirectory()?await g(n,0):(c=!0,i.push({path:n,reason:e.isSymbolicLink()?"SYMLINK_TARGET":"NOT_REGULAR_INPUT"}))}catch(e){c=!0,v(n,e)}return{files:a,discovery:{status:c?"failed":i.length>0?"partial":"complete",policy:"aqe-security-source-files@1",issues:i,excludedPaths:h}}}export{x as a,_ 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{b 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{b as G,d as z}from"./chunk-OVMG6EEF.js";import{a as F,e as le}from"./chunk-HPVYJ6JH.js";import{b as k,c as pe}from"./chunk-Z5UZOYQS.js";z();le();z();import*as C from"node:http";import*as _ from"node:https";import{createHash as ce}from"node:crypto";import{URL as X}from"node:url";var T={model:"Xenova/all-MiniLM-L6-v2",expectedDim:384,connectTimeoutMs:5e3,requestTimeoutMs:3e4,failureThreshold:3,failureWindowMs:6e4},me="AQE embedder endpoint identity canary v1",ue="/v1/embeddings";function J(t){if(t.startsWith("unix:"))return t;try{let e=new X(t);return e.username||e.password?(e.username="",e.password="",e.toString().replace(/\/$/,"")):t}catch{return t}}function fe(t){if(t.startsWith("unix:")){let r=t.slice(5);if(!r.startsWith("/"))throw new Error(`unix endpoint must be an absolute path: ${t}`);return{transport:"unix",socketPath:r,safeUrl:t}}let e=new X(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error(`unsupported embedder endpoint protocol: ${e.protocol}`);return(e.username||e.password)&&(console.warn("[EmbedderEndpointClient] endpoint URL contained userinfo; stripping. Use AQE_EMBEDDER_TOKEN env var for credentials."),e.username="",e.password=""),{transport:e.protocol==="https:"?"https":"http",host:e.hostname,port:e.port?Number(e.port):e.protocol==="https:"?443:80,protocol:e.protocol,safeUrl:e.toString().replace(/\/$/,"")}}var q=class{constructor(e,n,r=()=>{}){this.threshold=e;this.windowMs=n;this.onRecover=r}threshold;windowMs;onRecover;failures=[];trippedAt=null;recordSuccess(){this.failures=[],this.trippedAt=null}recordFailure(){let e=Date.now();this.failures=this.failures.filter(n=>e-n<this.windowMs),this.failures.push(e),this.failures.length>=this.threshold&&(this.trippedAt=e)}isOpen(){return this.trippedAt===null?!1:Date.now()-this.trippedAt>=this.windowMs?(this.failures=[],this.trippedAt=null,this.onRecover(),!1):!0}getState(){return{open:this.isOpen(),failures:this.failures.length,trippedAt:this.trippedAt}}},R=class{parsed;agent;breaker;opts;cachedIdentity=null;probeInFlight=null;constructor(e){if(this.opts={endpoint:e.endpoint,token:e.token,model:e.model??T.model,expectedDim:e.expectedDim??T.expectedDim,connectTimeoutMs:e.connectTimeoutMs??T.connectTimeoutMs,requestTimeoutMs:e.requestTimeoutMs??T.requestTimeoutMs,failureThreshold:e.failureThreshold??T.failureThreshold,failureWindowMs:e.failureWindowMs??T.failureWindowMs,tlsOptions:e.tlsOptions},this.parsed=fe(e.endpoint),this.parsed.transport==="https"){let n=e.tlsOptions??{};this.agent=new _.Agent({keepAlive:!0,ca:n.ca,cert:n.cert,key:n.key,rejectUnauthorized:n.rejectUnauthorized!==!1,servername:n.servername})}else this.agent=new C.Agent({keepAlive:!0});this.breaker=new q(this.opts.failureThreshold,this.opts.failureWindowMs,()=>{this.cachedIdentity=null})}getSafeEndpoint(){return this.parsed.safeUrl}async embed(e){if(e.length===0)return[];if(this.breaker.isOpen())throw new Error(`[EmbedderEndpointClient] circuit breaker open for ${this.parsed.safeUrl} \u2014 fast-failing`);this.cachedIdentity===null&&await this.ensureProbed();try{let n=await this.postEmbeddings(e),r=this.decodeAndNormalize(n,e.length);return this.breaker.recordSuccess(),r}catch(n){throw this.breaker.recordFailure(),n}}async probe(){return this.probeInFlight?this.probeInFlight:(this.probeInFlight=this.doProbe().finally(()=>{this.probeInFlight=null}),this.probeInFlight)}async ensureProbed(){return this.cachedIdentity?this.cachedIdentity:this.probe()}async doProbe(){let e;try{let a=await this.postEmbeddings([me]);e=this.decodeAndNormalize(a,1)[0],this.breaker.recordSuccess()}catch(a){throw this.breaker.recordFailure(),a}if(!e||e.length!==this.opts.expectedDim)throw new Error(`[EmbedderEndpointClient] dim mismatch: expected ${this.opts.expectedDim}, got ${e?.length??0} from ${this.parsed.safeUrl}`);let n=Buffer.alloc(e.length*2);for(let a=0;a<e.length;a++){let i=Math.max(-32768,Math.min(32767,Math.round(e[a]*32767)));n.writeInt16LE(i,a*2)}let r=ce("sha256").update(n).digest("hex").slice(0,16);return this.cachedIdentity={dim:e.length,fingerprint:r,endpoint:this.parsed.safeUrl},this.cachedIdentity}getCachedIdentity(){return this.cachedIdentity}getBreakerState(){return this.breaker.getState()}close(){this.agent.destroy()}decodeAndNormalize(e,n){if(!e||typeof e!="object"||!Array.isArray(e.data))throw new Error("[EmbedderEndpointClient] response missing data array");let r=e.data;if(r.length!==n)throw new Error(`[EmbedderEndpointClient] response count mismatch: expected ${n}, got ${r.length}`);let a=r.map((i,s)=>({idx:typeof i.index=="number"?i.index:s,embedding:i.embedding}));return a.sort((i,s)=>i.idx-s.idx),a.map(({embedding:i},s)=>{if(typeof i=="string")throw new Error(`[EmbedderEndpointClient] received base64 embedding at position ${s} \u2014 server ignored encoding_format=float. Configure the server to return float arrays.`);if(!Array.isArray(i))throw new Error(`[EmbedderEndpointClient] missing embedding at position ${s}`);if(i.length!==this.opts.expectedDim)throw new Error(`[EmbedderEndpointClient] dim mismatch at position ${s}: expected ${this.opts.expectedDim}, got ${i.length}`);return G(i)})}postEmbeddings(e){let n=JSON.stringify({model:this.opts.model,input:e,encoding_format:"float"});return this.request(ue,n)}request(e,n){let r={"content-type":"application/json","content-length":Buffer.byteLength(n),accept:"application/json"};this.opts.token&&(r.authorization=`Bearer ${this.opts.token}`);let a={method:"POST",path:e,headers:r,agent:this.agent},i,s;this.parsed.transport==="unix"?(i={...a,socketPath:this.parsed.socketPath},s=C.request):(i={...a,host:this.parsed.host,port:this.parsed.port,protocol:this.parsed.protocol},s=this.parsed.transport==="https"?_.request:C.request);let o=this.parsed.safeUrl,l=this.opts.connectTimeoutMs,m=this.opts.requestTimeoutMs;return new Promise((b,$)=>{let y=!1,M=d=>{y||(y=!0,b(d))},h=d=>{y||(y=!0,$(d))},w=s(i,d=>{let g=[];d.on("data",u=>g.push(Buffer.from(u))),d.on("end",()=>{let u=Buffer.concat(g).toString("utf-8");if(!d.statusCode||d.statusCode<200||d.statusCode>=300){h(new Error(`[EmbedderEndpointClient] HTTP ${d.statusCode} from ${o}: ${u.slice(0,200)}`));return}try{let E=JSON.parse(u);M(E)}catch(E){h(new Error(`[EmbedderEndpointClient] invalid JSON from ${o}: ${E.message}`))}}),d.on("error",u=>h(u))});w.on("socket",d=>{d.setTimeout(l);let g=()=>{d.setTimeout(m)};d.connecting?d.once("connect",g):g(),d.on("timeout",()=>{let u=d.connecting?"connect":"request",E=d.connecting?l:m,S=new Error(`[EmbedderEndpointClient] ${u} timeout after ${E}ms`);h(S),w.destroy(S)})}),w.on("error",d=>h(d)),w.write(n),w.end()})}};pe();import{join as K,resolve as ge}from"node:path";import{existsSync as he,mkdirSync as Ee}from"node:fs";import{createRequire as be}from"node:module";var ye=be(import.meta.url);function we(){let t=process.env.AQE_MEMORY_PATH;return t&&t.length>0?t===":memory:"?t:ge(k(),t):K(k(),".agentic-qe","memory.db")}var Q="_system",Y="embedder_identity:",x=null,U=!1;function Z(){if(x)return x;if(U)return null;try{let t=ye("better-sqlite3"),e=we(),n=K(e,"..");he(n)||Ee(n,{recursive:!0});let r=new t(e);return r.pragma("journal_mode = WAL"),r.pragma("busy_timeout = 5000"),r.exec(`
|
|
3
3
|
CREATE TABLE IF NOT EXISTS kv_store (
|
|
4
4
|
key TEXT NOT NULL,
|
|
5
5
|
namespace TEXT NOT NULL,
|
|
@@ -9,5 +9,5 @@ import{b as z,c as pe}from"./chunk-IAENZ2DR.js";import{a as F,e as le}from"./chu
|
|
|
9
9
|
PRIMARY KEY (namespace, key)
|
|
10
10
|
);
|
|
11
11
|
CREATE INDEX IF NOT EXISTS idx_kv_namespace ON kv_store(namespace);
|
|
12
|
-
`),x=r,r}catch{return U=!0,null}}function ee(t){let e=Z();if(!e)return null;try{let n=e.prepare("SELECT value FROM kv_store WHERE namespace = ? AND key = ?").get(Q,Y+t);if(!n)return null;let r=JSON.parse(n.value);return!r.fingerprint||typeof r.dim!="number"?null:{fingerprint:r.fingerprint,dim:r.dim,endpoint:r.endpoint}}catch{return null}}function te(t){let e=Z();if(!e)return;let n={fingerprint:t.fingerprint,dim:t.dim,endpoint:t.endpoint,updatedAt:Date.now()};e.prepare("INSERT OR REPLACE INTO kv_store (key, namespace, value) VALUES (?, ?, ?)").run(Y+t.endpoint,Q,JSON.stringify(n))}function ne(){if(x)try{x.close()}catch{}x=null,U=!1}
|
|
13
|
-
`,{encoding:"utf8",mode:384}),Te(i,r)}var V=null,f=null,N=null,O=!1,P="",v=null,p=null,A=null,H={modelName:"Xenova/all-MiniLM-L6-v2",quantized:!0,enableCache:!0,maxCacheSize:1e4,endpoint:process.env.AQE_EMBEDDER_ENDPOINT,endpointToken:process.env.AQE_EMBEDDER_TOKEN},c=new Map,se=36e5;function L(t){return p?`endpoint:${p.fingerprint}:${t}`:`inproc:${t}`}function ae(t){let e=t.trim();return!!(e.startsWith("{")&&/["']metrics["']/.test(e)||e.startsWith("[")&&e.endsWith("]")&&e.length>50||(e.match(/[a-zA-Z]/g)||[]).length/Math.max(e.length,1)<.3&&e.length>20)}async function W(t={}){if(O)throw new Error(`Transformer initialization previously failed: ${P}`);if(N)return N;let e={...H,...t};return N=(async()=>{try{if(e.endpoint){let l=J(e.endpoint);console.log(`[RealEmbeddings] Using external embedder endpoint: ${l}`),v=new R({endpoint:e.endpoint,token:e.endpointToken,model:e.modelName,expectedDim:D()}),p=await v.probe(),A=B({provider:"openai-compatible-endpoint",model:e.modelName,dimensions:p.dim,pooling:"mean",normalized:!0,preprocessingVersion:"aqe-text-v1",implementation:p.endpoint,runtimeFingerprint:p.fingerprint}),console.log(`[RealEmbeddings] Endpoint identity: dim=${p.dim} fingerprint=${p.fingerprint}`);try{let m=ee(p.endpoint);m&&m.fingerprint!==p.fingerprint&&console.warn(`[RealEmbeddings] WARNING: endpoint identity changed since last run. Previous fingerprint=${m.fingerprint} dim=${m.dim}, current fingerprint=${p.fingerprint} dim=${p.dim}. Vectors written before this change may no longer be comparable.`),te(p)}catch(m){console.warn(`[RealEmbeddings] Could not persist endpoint identity: ${F(m)}`)}f=Ne(v);return}let n;try{n=await import("./transformers-
|
|
12
|
+
`),x=r,r}catch{return U=!0,null}}function ee(t){let e=Z();if(!e)return null;try{let n=e.prepare("SELECT value FROM kv_store WHERE namespace = ? AND key = ?").get(Q,Y+t);if(!n)return null;let r=JSON.parse(n.value);return!r.fingerprint||typeof r.dim!="number"?null:{fingerprint:r.fingerprint,dim:r.dim,endpoint:r.endpoint}}catch{return null}}function te(t){let e=Z();if(!e)return;let n={fingerprint:t.fingerprint,dim:t.dim,endpoint:t.endpoint,updatedAt:Date.now()};e.prepare("INSERT OR REPLACE INTO kv_store (key, namespace, value) VALUES (?, ?, ?)").run(Y+t.endpoint,Q,JSON.stringify(n))}function ne(){if(x)try{x.close()}catch{}x=null,U=!1}z();import{createHash as re}from"node:crypto";import{existsSync as ve,readFileSync as Ae,renameSync as Te,writeFileSync as xe}from"node:fs";var ie="aqe embedding-space compatibility canary v1";var I=class extends Error{constructor(n,r){super(`${n}: ${r}`);this.code=n;this.name="EmbeddingSpaceError"}code};function Se(t){return JSON.stringify({provider:t.provider,model:t.model,dimensions:t.dimensions,pooling:t.pooling??null,normalized:t.normalized,preprocessingVersion:t.preprocessingVersion??null,implementation:t.implementation??null,runtimeFingerprint:t.runtimeFingerprint})}function oe(t){let e=Buffer.alloc(t.length*2);for(let n=0;n<t.length;n++){let r=Math.max(-32768,Math.min(32767,Math.round(t[n]*32767)));e.writeInt16LE(r,n*2)}return re("sha256").update(e).digest("hex").slice(0,16)}function B(t){if(!t.runtimeFingerprint)throw new Error("Embedding space identity requires executable runtime evidence");let e=re("sha256").update("aqe:embedding-space:v1\0").update(Se(t)).digest("hex");return{...t,spaceId:e}}function Be(t,e){let n=[...new Set(t.flatMap(o=>o.spaceId?[o.spaceId]:[]))].sort(),r=t.filter(o=>!o.spaceId).length,a=e?t.filter(o=>o.spaceId===e).length:0,i=e?t.filter(o=>o.spaceId!==null&&o.spaceId!==e).length:t.length-r;return{status:r>0||!e?"unverified":i>0||n.length>1?"vector_space_mismatch":"healthy",activeSpaceId:e,storedSpaceIds:n,verifiedVectors:a,mismatchedVectors:i,unverifiedVectors:r}}function Ce(t){return`${t}.space.json`}function Ve(t,e,n){if(!e)throw new I("VECTOR_SPACE_UNVERIFIED",`cannot open ANN index ${t} without runtime provenance`);let r=Ce(t);if(ve(r)){let s;try{s=JSON.parse(Ae(r,"utf8"))}catch{throw new I("VECTOR_SPACE_UNVERIFIED",`ANN index manifest ${r} is unreadable`)}if(s.version!==1||!s.spaceId)throw new I("VECTOR_SPACE_UNVERIFIED",`ANN index manifest ${r} has no verified space`);if(s.spaceId!==e)throw new I("VECTOR_SPACE_MISMATCH",`ANN index space ${s.spaceId} != active space ${e}`);return}if(n>0)throw new I("VECTOR_SPACE_UNVERIFIED",`populated ANN index ${t} has no embedding-space manifest; rebuild required`);let a={version:1,spaceId:e},i=`${r}.${process.pid}.tmp`;xe(i,`${JSON.stringify(a)}
|
|
13
|
+
`,{encoding:"utf8",mode:384}),Te(i,r)}var V=null,f=null,N=null,O=!1,P="",v=null,p=null,A=null,H={modelName:"Xenova/all-MiniLM-L6-v2",quantized:!0,enableCache:!0,maxCacheSize:1e4,endpoint:process.env.AQE_EMBEDDER_ENDPOINT,endpointToken:process.env.AQE_EMBEDDER_TOKEN},c=new Map,se=36e5;function L(t){return p?`endpoint:${p.fingerprint}:${t}`:`inproc:${t}`}function ae(t){let e=t.trim();return!!(e.startsWith("{")&&/["']metrics["']/.test(e)||e.startsWith("[")&&e.endsWith("]")&&e.length>50||(e.match(/[a-zA-Z]/g)||[]).length/Math.max(e.length,1)<.3&&e.length>20)}async function W(t={}){if(O)throw new Error(`Transformer initialization previously failed: ${P}`);if(N)return N;let e={...H,...t};return N=(async()=>{try{if(e.endpoint){let l=J(e.endpoint);console.log(`[RealEmbeddings] Using external embedder endpoint: ${l}`),v=new R({endpoint:e.endpoint,token:e.endpointToken,model:e.modelName,expectedDim:D()}),p=await v.probe(),A=B({provider:"openai-compatible-endpoint",model:e.modelName,dimensions:p.dim,pooling:"mean",normalized:!0,preprocessingVersion:"aqe-text-v1",implementation:p.endpoint,runtimeFingerprint:p.fingerprint}),console.log(`[RealEmbeddings] Endpoint identity: dim=${p.dim} fingerprint=${p.fingerprint}`);try{let m=ee(p.endpoint);m&&m.fingerprint!==p.fingerprint&&console.warn(`[RealEmbeddings] WARNING: endpoint identity changed since last run. Previous fingerprint=${m.fingerprint} dim=${m.dim}, current fingerprint=${p.fingerprint} dim=${p.dim}. Vectors written before this change may no longer be comparable.`),te(p)}catch(m){console.warn(`[RealEmbeddings] Could not persist endpoint identity: ${F(m)}`)}f=Ne(v);return}let n;try{n=await import("./transformers-KJH3IJWI.js")}catch{throw new Error('In-process embeddings require the optional package "@huggingface/transformers", which is not installed. Configure an embedding endpoint (EmbeddingConfig.endpoint / AQE_EMBEDDER_ENDPOINT) so no local model is loaded. Installing @huggingface/transformers@4.2.0 is an explicit security opt-in: its compatible dependency chain currently has unresolved HIGH advisories GHSA-xcpc-8h2w-3j85 and GHSA-f88m-g3jw-g9cj.')}V=n.pipeline,console.log(`[RealEmbeddings] Loading model: ${e.modelName}`);let r=performance.now();f=await V("feature-extraction",e.modelName,{quantized:e.quantized});let a=f;if(!a)throw new Error("Transformer pipeline returned no embedding model");let i=await a(ie,{pooling:"mean",normalize:!0}),s=Array.from(i.data);A=B({provider:"huggingface-transformers",model:e.modelName,dimensions:s.length,pooling:"mean",normalized:!0,preprocessingVersion:"aqe-text-v1",implementation:`transformers:${e.quantized?"quantized":"full"}`,runtimeFingerprint:oe(s)});let o=performance.now()-r;console.log(`[RealEmbeddings] Model loaded in ${o.toFixed(0)}ms`)}catch(n){throw O=!0,P=F(n),new Error(`Failed to initialize transformer model: ${P}`)}})(),N}function Ne(t){return async e=>{let n=Array.isArray(e)?e:[e],r=await t.embed(n),a=r[0]?.length??D(),i=new Float32Array(n.length*a);for(let s=0;s<r.length;s++)i.set(r[s],s*a);return{data:i,dims:[n.length,a]}}}async function Xe(t,e={}){let n={...H,...e};if(ae(t))return new Array(D()).fill(0);if(f||await W(e),!f)throw new Error("Embedding model failed to initialize");let r=L(t);if(n.enableCache){let l=c.get(r);if(l&&Date.now()-l.timestamp<se)return l.embedding}let a=performance.now(),i=await f(t,{pooling:"mean",normalize:!0}),s=Array.from(i.data),o=performance.now()-a;if(o>500&&console.warn(`[RealEmbeddings] Slow embedding computation: ${o.toFixed(1)}ms for "${t.slice(0,50)}..."`),n.enableCache){if(c.size>=n.maxCacheSize){let l=c.keys().next().value;l&&c.delete(l)}c.set(r,{embedding:s,timestamp:Date.now()})}return s}async function Je(t,e={}){let n={...H,...e},r=[],a=[],i=new Array(t.length).fill(null),s=[];for(let o=0;o<t.length;o++)ae(t[o])?i[o]=new Array(D()).fill(0):s.push(o);if(s.length===0)return i;if(f||await W(e),!f)throw new Error("Embedding model failed to initialize");if(n.enableCache)for(let o of s){let l=c.get(L(t[o]));l&&Date.now()-l.timestamp<se?i[o]=l.embedding:(r.push(t[o]),a.push(o))}else for(let o of s)r.push(t[o]),a.push(o);if(r.length>0){let o=performance.now(),l=32;for(let b=0;b<r.length;b+=l){let $=Math.min(b+l,r.length),y=r.slice(b,$),M=await f(y,{pooling:"mean",normalize:!0}),h=M.dims||[y.length,384],w=h[0],d=h[1];for(let g=0;g<w;g++){let u=g*d,E=Array.from(M.data.slice(u,u+d)),S=b+g,de=a[S];if(i[de]=E,n.enableCache){if(c.size>=n.maxCacheSize){let j=c.keys().next().value;j&&c.delete(j)}c.set(L(r[S]),{embedding:E,timestamp:Date.now()})}}}let m=performance.now()-o;console.log(`[RealEmbeddings] Batch computed ${r.length} embeddings in ${m.toFixed(0)}ms`)}return i.filter(o=>o!==null)}function Ke(){c.clear(),console.log("[RealEmbeddings] Cache cleared")}function Qe(){return{size:c.size,hitRate:0}}function Ye(){return!O&&f!==null}function D(){return 384}function Ze(){V=null,f=null,N=null,O=!1,P="",c.clear(),v&&v.close(),v=null,p=null,A=null,ne()}function et(){return v!==null}function tt(){return p}function nt(){return A}async function rt(){if(A)return A;let t=process.env.AQE_EMBEDDER_ENDPOINT;return t?(await W({endpoint:t,endpointToken:process.env.AQE_EMBEDDER_TOKEN}),A):null}export{ie as a,Be as b,Ve as c,H as d,Xe as e,Je as f,Ke as g,Qe as h,Ye as i,D as j,Ze as k,et as l,tt as m,nt as n,rt as o};
|
|
@@ -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.
|
|
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
|
var n=class{constructor(t){this.capacity=t;this.buffer=new Array(t)}capacity;buffer;head=0;tail=0;count=0;push(t){this.buffer[this.tail]=t,this.tail=(this.tail+1)%this.capacity,this.count<this.capacity?this.count++:this.head=(this.head+1)%this.capacity}toArray(){let t=[];for(let e=0;e<this.count;e++){let i=(this.head+e)%this.capacity;t.push(this.buffer[i])}return t}get length(){return this.count}get size(){return this.count}clear(){this.buffer=new Array(this.capacity),this.head=0,this.tail=0,this.count=0}last(t){let e=[],i=Math.max(0,this.count-t);for(let s=i;s<this.count;s++){let r=(this.head+s)%this.capacity;e.push(this.buffer[r])}return e}percentile(t){if(this.count===0)return;let e=this.toArray().sort((s,r)=>Number(s)-Number(r)),i=Math.floor(t/100*(e.length-1));return e[i]}reduce(t,e){let i=e;for(let s=0;s<this.count;s++){let r=(this.head+s)%this.capacity;i=t(i,this.buffer[r])}return i}average(){return this.count===0?0:this.reduce((e,i)=>e+i,0)/this.count}};export{n as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.8");process.exit(0)}
|
|
2
2
|
var o={domain:"test-generation",bestPractices:["Follow Arrange-Act-Assert (AAA) pattern for clear test structure","One logical assertion per test - test one behavior at a time","Use descriptive test names: should_returnValue_when_condition","Mock external dependencies to isolate unit under test","Test edge cases and boundary conditions, not just happy paths","Keep tests deterministic - avoid time-dependent assertions","Use test data builders or factories for complex objects","Prefer integration tests for workflows, unit tests for logic","Maintain test independence - no shared mutable state between tests","Write failing test first (TDD Red) before implementation"],antiPatterns:[{name:"God Test",description:"A single test that verifies too many behaviors",reason:"Hard to diagnose failures, brittle, slow to run",alternative:"Split into focused tests, each verifying one behavior",detection:"expect.*expect.*expect.*expect.*expect"},{name:"Mystery Guest",description:"Test relies on external data files or state not visible in test",reason:"Tests are hard to understand and maintain",alternative:"Make test data explicit within the test or use fixtures"},{name:"Eager Test",description:"Test that verifies more than needed for the current behavior",reason:"Creates unnecessary coupling, breaks easily",alternative:"Only assert what is necessary for this specific test case"},{name:"Flaky Assertion",description:"Assertions that depend on timing, order, or external state",reason:"Creates unreliable test suite, erodes trust",alternative:"Use deterministic assertions, mock time/random",detection:"setTimeout|Date\\.now|Math\\.random"},{name:"Test Code Duplication",description:"Same setup or assertion code repeated across tests",reason:"Maintenance burden, inconsistency risk",alternative:"Extract to beforeEach, helpers, or fixtures"}],frameworkGuidance:{jest:["Use describe blocks to group related tests","Prefer toEqual for deep equality, toBe for primitives","Use jest.mock() at module level for consistent mocking","Use jest.spyOn for partial mocking of objects","Enable --coverage to track test coverage"],vitest:["Use vi.mock() for module mocking","Prefer vi.fn() over jest.fn() syntax","Use vitest/ui for interactive test debugging","Enable browser mode for component tests","Use inline snapshots for small expected values"],mocha:["Use beforeEach/afterEach for setup/teardown","Combine with chai for assertions","Use sinon for spies, stubs, and mocks","Set appropriate timeouts for async tests"],pytest:["Use fixtures for reusable test setup","Use parametrize for data-driven tests","Use conftest.py for shared fixtures","Use pytest.raises for exception testing","Use pytest-cov for coverage reporting"],junit:["Use @BeforeEach and @AfterEach for setup/teardown","Use @DisplayName for readable test names","Use @ParameterizedTest for data-driven tests","Use Mockito for mocking dependencies"],testng:["Use @BeforeMethod and @AfterMethod appropriately","Use @DataProvider for parameterized tests","Configure test groups for selective execution"],playwright:["Use page.locator() for resilient element selection","Use expect(locator) for auto-waiting assertions","Use page.waitForLoadState for navigation","Use test.describe for grouping tests","Use fixtures for reusable browser contexts"],cypress:["Use cy.intercept() for API mocking","Avoid conditional testing - use deterministic state","Use data-cy attributes for stable selectors","Use cy.within() for scoped queries","Prefer cy.contains() for text-based selection"],selenium:["Use explicit waits over implicit waits","Use Page Object Model for maintainability","Handle stale element references with retry logic","Clean up browser state between tests"]},languageGuidance:{typescript:["Use type assertions in tests for better IDE support","Create typed test fixtures and builders","Use satisfies operator for test data validation","Mock types with ts-mockito or typed mocking libs"],javascript:["Use JSDoc comments for test documentation","Consider TypeScript for larger test suites","Use ESLint with testing plugins"],python:["Use type hints in test functions","Use dataclasses for test data","Follow PEP 8 naming: test_should_do_something"],java:["Use AssertJ for fluent assertions","Use Lombok for test data classes","Follow naming: shouldDoSomething_whenCondition"],go:["Use table-driven tests for multiple cases","Use testify for assertions and mocking","Place tests in _test.go files"],rust:["Use #[test] attribute for test functions","Use assert!, assert_eq!, assert_ne! macros","Place unit tests in same file with #[cfg(test)]"],csharp:["Use xUnit or NUnit for testing","Use FluentAssertions for readable assertions","Use Moq for mocking interfaces"],kotlin:["Use kotest for BDD-style testing","Use MockK for Kotlin-first mocking","Use data classes for test fixtures"]},examples:[{title:"Unit Test Template (TypeScript + Vitest)",description:"Standard AAA pattern for unit tests",content:`describe('UserService', () => {
|
|
3
3
|
describe('createUser', () => {
|
|
4
4
|
it('should create user with valid data', async () => {
|
|
@@ -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.
|
|
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{existsSync as c,readFileSync as f}from"fs";import{join as p,dirname as i}from"path";import{fileURLToPath as s}from"url";function u(o,a=10){let t=i(s(o));for(let r=0;r<a;r++){let n=p(t,"package.json");if(c(n))try{if(JSON.parse(f(n,"utf-8")).name==="agentic-qe")return t}catch{}let e=i(t);if(e===t)break;t=e}return null}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.
|
|
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 r from"chalk";function s(e){switch(e){case"healthy":case"completed":return r.green(e);case"idle":return r.cyan(e);case"degraded":case"running":return r.yellow(e);case"unhealthy":case"failed":return r.red(e);default:return r.gray(e)}}function a(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:e<36e5?`${(e/6e4).toFixed(1)}m`:`${(e/36e5).toFixed(1)}h`}function l(e){let t=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4),o=Math.floor(e%6e4/1e3);return`${t}h ${n}m ${o}s`}export{s as a,a as b,l as c};
|
|
@@ -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 h,d as v,f as T}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 h,d as v,f as T}from"./chunk-XAESN54Q.js";var y={};v(y,{DotProductAttention:()=>z,FlashAttention:()=>k,HyperbolicAttention:()=>C,LinearAttention:()=>j,MoEAttention:()=>W,MultiHeadAttention:()=>F,RuvectorLayer:()=>O,SonaEngine:()=>K,TensorCompress:()=>E,default:()=>I,differentiableSearch:()=>L,getCompressionLevel:()=>B,hierarchicalForward:()=>V,init:()=>D,pipeline:()=>q});import{createRequire as A}from"module";var _,g,I,O,E,L,V,B,D,k,z,F,C,j,W,K,q,R=h(()=>{_=A(import.meta.url),g=_("@ruvector/rvf-node"),I=g,{RuvectorLayer:O,TensorCompress:E,differentiableSearch:L,hierarchicalForward:V,getCompressionLevel:B,init:D,FlashAttention:k,DotProductAttention:z,MultiHeadAttention:F,HyperbolicAttention:C,LinearAttention:j,MoEAttention:W,SonaEngine:K,pipeline:q}=g||{}});var Z={};v(Z,{createRvfStore:()=>$,isRvfNativeAvailable:()=>X,openRvfStore:()=>G,openRvfStoreReadonly:()=>U});import{readFileSync as J,writeFileSync as H,copyFileSync as Q,existsSync as Y}from"fs";function c(){if(S)return m;S=!0;try{let s=(R(),T(y));!s.RvfDatabase&&s.default&&s.default.RvfDatabase&&(s=s.default),m=s}catch{m=null}return m}function w(s){return`${s}.idmap.json`}function N(s){let e=w(s),t=new Map,n=new Map,i=1;if(Y(e))try{let r=JSON.parse(J(e,"utf-8"));i=r.nextLabel;for(let[a,p]of r.entries)t.set(a,p),n.set(p,a)}catch{}return{strToNum:t,numToStr:n,nextLabel:i}}function b(s,e,t){let n={nextLabel:t,entries:Array.from(e.entries())};H(w(s),JSON.stringify(n),"utf-8")}function $(s,e){let t=c();if(!t)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let n=t.RvfDatabase.create(s,{dimension:e}),i=n.dimension();return new d(n,s,i,new Map,new Map,1)}function G(s){let e=c();if(!e)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let t=e.RvfDatabase.open(s),n=t.dimension(),{strToNum:i,numToStr:r,nextLabel:a}=N(s);return new d(t,s,n,i,r,a)}function U(s){let e=c();if(!e)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let t=e.RvfDatabase.openReadonly(s),n=t.dimension(),{strToNum:i,numToStr:r,nextLabel:a}=N(s);return new d(t,s,n,i,r,a)}function X(){return process.env.AQE_MEMORY_BACKEND==="memory"?!1:c()!==null}var m,S,d,P=h(()=>{m=null,S=!1;d=class s{db;_path;_dimension;strToNum;numToStr;nextLabel;_open;constructor(e,t,n,i,r,a){this.db=e,this._path=t,this._dimension=n,this.strToNum=i,this.numToStr=r,this.nextLabel=a,this._open=!0}ingest(e){if(this.ensureOpen(),e.length===0)return{accepted:0,rejected:0};let t=this._dimension,n=new Float32Array(e.length*t),i=[],r=[];for(let o=0;o<e.length;o++){let{id:u,vector:f,metadata:x}=e[o],l=this.strToNum.get(u);l===void 0&&(l=this.nextLabel++,this.strToNum.set(u,l),this.numToStr.set(l,u)),i.push(l),r.push(x);let M=f instanceof Float32Array?f:new Float32Array(f);n.set(M.subarray(0,t),o*t)}let a;if(r.some(o=>o!==void 0)&&typeof this.db.ingestBatchWithMetadata=="function"){let o=r.map(u=>u?JSON.stringify(u):"");a=this.db.ingestBatchWithMetadata(n,i,o)}else a=this.db.ingestBatch(n,i);return this.persistIdMap(),{accepted:a.accepted,rejected:a.rejected}}search(e,t){this.ensureOpen();let n=e instanceof Float32Array?e:new Float32Array(e);return this.db.query(n,t).map(r=>{let a=this.numToStr.get(r.id);return a===void 0?null:{id:a,distance:r.distance,score:1/(1+r.distance)}}).filter(r=>r!==null)}delete(e){this.ensureOpen();let t=[];for(let i of e){let r=this.strToNum.get(i);r!==void 0&&t.push(r)}if(t.length===0)return 0;let n=this.db.delete(t);for(let i of e){let r=this.strToNum.get(i);r!==void 0&&(this.strToNum.delete(i),this.numToStr.delete(r))}return this.persistIdMap(),n.deleted}fork(e){this.ensureOpen(),Q(this._path,e);let t=new Map(this.strToNum),n=new Map(this.numToStr);b(e,t,this.nextLabel);let r=c().RvfDatabase.open(e);return new s(r,e,this._dimension,t,n,this.nextLabel)}status(){this.ensureOpen();let e=this.db.status(),n=this.db.segments().filter(i=>i.segType==="witness");return{totalVectors:e.totalVectors,totalSegments:e.totalSegments,fileSizeBytes:e.fileSize,epoch:e.currentEpoch,witnessValid:n.length>0,witnessEntries:n.length,deadSpaceRatio:typeof e.deadSpaceRatio=="number"?e.deadSpaceRatio:0}}dimension(){return this._dimension}size(){return this.ensureOpen(),this.db.status().totalVectors}compact(){this.ensureOpen();try{let e=this.db.compact();return e&&typeof e=="object"?{segmentsCompacted:typeof e.segmentsCompacted=="number"?e.segmentsCompacted:0,bytesReclaimed:typeof e.bytesReclaimed=="number"?e.bytesReclaimed:0,epoch:typeof e.epoch=="number"?e.epoch:0}:{segmentsCompacted:0,bytesReclaimed:0,epoch:0}}catch{return null}}close(){this._open&&(this.db.close(),this._open=!1)}isOpen(){return this._open}path(){return this._path}embedKernel(e){return this.ensureOpen(),this.db.embedKernel(0,99,0,e,0,"")}extractKernel(){return this.ensureOpen(),this.db.extractKernel()}verifyWitness(){this.ensureOpen();let e=this.tryNative("verifyWitness");return e?{valid:e.valid??!0,totalEntries:e.totalEntries??0,errors:Array.isArray(e.errors)?e.errors:[]}:{valid:!0,totalEntries:0,errors:[]}}sign(e){this.ensureOpen();let t=this.tryNative("sign",e);return typeof t=="string"?t:null}fileId(){this.ensureOpen();let e=this.tryNative("fileId");return typeof e=="string"?e:null}parentId(){this.ensureOpen();let e=this.tryNative("parentId");return typeof e=="string"?e:null}lineageDepth(){this.ensureOpen();let e=this.tryNative("lineageDepth");return typeof e=="number"?e:0}indexStats(){let e=this.status();return{totalVectors:e.totalVectors,dimension:this._dimension,totalSegments:e.totalSegments,fileSizeBytes:e.fileSizeBytes,epoch:e.epoch,witnessValid:e.witnessValid,witnessEntries:e.witnessEntries,idMapSize:this.strToNum.size}}freeze(){this.ensureOpen();let e=this.tryNative("freeze");return typeof e=="number"?e:0}derive(e){this.ensureOpen();let t=c();if(typeof this.db.derive=="function")try{let n=this.db.derive(e),i=new Map(this.strToNum),r=new Map(this.numToStr);return b(e,i,this.nextLabel),new s(n,e,this._dimension,i,r,this.nextLabel)}catch{}return this.fork(e)}ensureOpen(){if(!this._open)throw new Error("RVF database is closed")}tryNative(e,...t){if(typeof this.db[e]!="function")return null;try{return this.db[e](...t)}catch{return null}}persistIdMap(){b(this._path,this.strToNum,this.nextLabel)}}});export{$ as a,G as b,U as c,X as d,Z as e,P as f};
|
|
@@ -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
|
-
var e=null,f=null,t=null,u=!1;async function W(){return u&&!t?e:t||(t=(async()=>{try{if(process.env.AQE_RVF_MODE==="sqlite-only"||process.env.AQE_MEMORY_BACKEND==="memory")return null;let{isRvfNativeAvailable:d}=await import("./rvf-native-adapter-
|
|
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
|
+
var e=null,f=null,t=null,u=!1;async function W(){return u&&!t?e:t||(t=(async()=>{try{if(process.env.AQE_RVF_MODE==="sqlite-only"||process.env.AQE_MEMORY_BACKEND==="memory")return null;let{isRvfNativeAvailable:d}=await import("./rvf-native-adapter-E6JNBKMZ.js");if(!d())return null;let{getUnifiedMemory:v,findProjectRoot:p}=await import("./unified-memory-GHAYAXWZ.js"),o=v().getDatabase();if(!o)return null;let{join:m}=await import("node:path"),g=m(process.env.AQE_PROJECT_ROOT??p(),".agentic-qe","brain.rvf"),{RvfDualWriter:R}=await import("./rvf-dual-writer-LTKTDRFS.js"),l=new R(o,{rvfPath:g,mode:"dual-write",dimensions:384});await l.initialize(),e=l;try{let{getRvfMigrationStage:y}=await import("./feature-flags-VESRRQ6V.js"),a=y();if(a>=2){let{RvfMigrationAdapter:A}=await import("./rvf-migration-adapter-IF24EVC5.js"),s=new A({stage:a});s.setSqliteDb(o);let{getSharedRvfAdapter:D}=await import("./shared-rvf-adapter-5FOVSL3T.js"),i=D();if(i){let h={ingest:n=>i.ingest(n),search:(n,M)=>i.search(n,M).map(c=>({id:c.id,score:c.score})),delete:n=>i.delete(n),status:()=>i.status(),close:()=>{}};s.setRvfStore(h)}f=s,console.log(`[RVF] Migration adapter active at stage ${a} (${["sqlite-only","hybrid","dual-sqlite","dual-rvf","rvf-primary"][a]})`)}}catch{}return l}catch(r){return(process.env.DEBUG||process.env.AQE_VERBOSE)&&console.debug("[RVF] Dual-writer init failed, degrading to sqlite-only:",r instanceof Error?r.message:r),null}finally{u=!0,t=null,import("./base-5TQ34GMD.js").then(({registerRvfResetFn:r})=>r(w)).catch(()=>{})}})(),t)}function S(){return e}function b(){return f}function w(){if(e){try{e.close()}catch{}e=null}f=null,t=null,u=!1}export{W as a,S as b,b as c,w 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{a as w}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 w}from"./chunk-HE3BDBAO.js";import{i as v}from"./chunk-UQGIC5OX.js";import{c as p,d as l}from"./chunk-EKO5QL2B.js";import{a as g,b as x,e as y}from"./chunk-HPVYJ6JH.js";y();var h=class extends Error{constructor(e){super(`Action timed out after ${e}ms; outcome is unknown`),this.name="ActionTimeoutError"}},m={ProtocolStarted:"coordination.ProtocolStarted",ProtocolCompleted:"coordination.ProtocolCompleted",ProtocolFailed:"coordination.ProtocolFailed",ProtocolOutcomeUnknown:"coordination.ProtocolOutcomeUnknown",ProtocolCancelled:"coordination.ProtocolCancelled",ActionStarted:"coordination.ActionStarted",ActionCompleted:"coordination.ActionCompleted",ActionFailed:"coordination.ActionFailed",ActionOutcomeUnknown:"coordination.ActionOutcomeUnknown"},E=class{constructor(e,t,o){this.eventBus=e;this.memory=t;this.getDomainAPI=o}eventBus;memory;getDomainAPI;protocols=new Map;executions=new Map;scheduledProtocols=new Map;schedulerRunning=!1;registerProtocol(e){this.protocols.set(e.id,e),e.schedule.type==="event"&&e.enabled&&this.setupEventTriggers(e),(e.schedule.type==="cron"||e.schedule.type==="interval")&&e.enabled&&this.scheduleProtocol(e)}unregisterProtocol(e){if(!this.protocols.get(e))return!1;let o=this.scheduledProtocols.get(e);return o?.intervalId&&clearInterval(o.intervalId),this.scheduledProtocols.delete(e),this.protocols.delete(e),!0}getProtocol(e){return this.protocols.get(e)}listProtocols(){return Array.from(this.protocols.values())}async execute(e,t){let o=this.protocols.get(e);return o?o.enabled?this.executeProtocol(o,t):l(new Error(`Protocol is disabled: ${e}`)):l(new Error(`Protocol not found: ${e}`))}async executeOnEvent(e,t){let o=this.protocols.get(e);return o?o.enabled?this.executeProtocol(o,void 0,t):l(new Error(`Protocol is disabled: ${e}`)):l(new Error(`Protocol not found: ${e}`))}getExecution(e){let t=this.executions.get(e);if(t)return this.toImmutableExecution(t.execution)}listActiveExecutions(){return Array.from(this.executions.values()).filter(e=>e.execution.status==="running"||e.execution.status==="paused").map(e=>this.toImmutableExecution(e.execution))}async cancelExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="running"&&t.execution.status!=="paused"?l(new Error(`Cannot cancel execution in status: ${t.execution.status}`)):(t.cancelled=!0,t.execution.status="cancelled",t.execution.completedAt=new Date,await this.publishEvent(m.ProtocolCancelled,{executionId:e,protocolId:t.protocol.id}),p(void 0)):l(new Error(`Execution not found: ${e}`))}async pauseExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="running"?l(new Error(`Cannot pause execution in status: ${t.execution.status}`)):(t.paused=!0,t.execution.status="paused",p(void 0)):l(new Error(`Execution not found: ${e}`))}async resumeExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="paused"?l(new Error(`Cannot resume execution in status: ${t.execution.status}`)):(t.paused=!1,t.execution.status="running",p(void 0)):l(new Error(`Execution not found: ${e}`))}startScheduler(){if(!this.schedulerRunning){this.schedulerRunning=!0;for(let e of this.protocols.values())e.enabled&&(e.schedule.type==="interval"||e.schedule.type==="cron")&&this.scheduleProtocol(e)}}stopScheduler(){this.schedulerRunning=!1;for(let e of this.scheduledProtocols.values())e.intervalId&&(clearInterval(e.intervalId),e.intervalId=void 0)}async dispose(){this.stopScheduler(),this.protocols.clear(),this.executions.clear(),this.scheduledProtocols.clear()}async executeProtocol(e,t,o){let n=v(),a=o?.correlationId??n,i={executionId:n,protocolId:e.id,status:"running",participants:[...e.participants],results:new Map,startedAt:new Date,correlationId:a,triggeredBy:o},d={execution:i,protocol:e,params:t,actionResults:new Map,cancelled:!1,paused:!1};this.executions.set(n,d),await this.publishEvent(m.ProtocolStarted,{executionId:n,protocolId:e.id,participants:e.participants},a);try{await this.executeActions(d);let r=Array.from(d.actionResults.values()),s=r.filter(c=>c.status==="unknown").map(c=>c.actionId),u=r.filter(c=>c.status==="failed").map(c=>c.actionId);return d.cancelled?i.status="cancelled":s.length>0?(i.status="unknown",await this.publishEvent(m.ProtocolOutcomeUnknown,{executionId:n,protocolId:e.id,unknownActions:s,failedActions:u},a)):u.length>0?(i.status="failed",await this.publishEvent(m.ProtocolFailed,{executionId:n,protocolId:e.id,failedActions:u},a)):(i.status="completed",await this.publishEvent(m.ProtocolCompleted,{executionId:n,protocolId:e.id,duration:Date.now()-i.startedAt.getTime()},a)),i.completedAt=new Date,i.results=d.actionResults,await this.storeExecutionHistory(i),p(this.toImmutableExecution(i))}catch(r){return i.status="failed",i.completedAt=new Date,await this.publishEvent(m.ProtocolFailed,{executionId:n,protocolId:e.id,error:g(r)},a),l(x(r))}}async executeActions(e){let{protocol:t,actionResults:o}=e,n=new Set(t.actions.map(i=>i.id)),a=new Set;for(;n.size>0&&!e.cancelled;){for(;e.paused&&!e.cancelled;)await this.sleep(100);if(e.cancelled)break;let i=t.actions.filter(r=>n.has(r.id)&&this.dependenciesSatisfied(r,a));if(i.length===0&&n.size>0){let r=!1;for(let s of t.actions)n.has(s.id)&&s.dependsOn?.some(u=>{let c=o.get(u)?.status;return c!==void 0&&c!=="completed"})&&(o.set(s.id,{actionId:s.id,status:"skipped"}),n.delete(s.id),r=!0);if(r)continue;throw new Error(`Deadlock detected: actions ${Array.from(n).join(", ")} cannot proceed`)}let d=await Promise.allSettled(i.map(r=>this.executeAction(r,e)));for(let r=0;r<i.length;r++){let s=i[r],u=d[r],c;u.status==="fulfilled"?c=u.value:c={actionId:s.id,status:"failed",error:u.reason instanceof Error?u.reason.message:String(u.reason)},o.set(s.id,c),n.delete(s.id),c.status==="completed"&&a.add(s.id)}}for(let i of n)o.set(i,{actionId:i,status:e.cancelled?"cancelled":"skipped"})}async executeAction(e,t){let o=new Date;await this.publishEvent(m.ActionStarted,{executionId:t.execution.executionId,actionId:e.id,actionName:e.name,targetDomain:e.targetDomain},t.execution.correlationId);let n=0,a=e.retry?.maxAttempts??1,i;for(;n<a;){n++;try{let r=this.getDomainAPI(e.targetDomain);if(!r)throw new Error(`Domain API not available: ${e.targetDomain}`);let s=r[e.method];if(typeof s!="function")throw new Error(`Method ${e.method} not found on domain ${e.targetDomain}`);let u={...e.params,...t.params},c=await this.executeWithTimeout(s.bind(r)(u),e.timeout??3e4),P=new Date;return await this.publishEvent(m.ActionCompleted,{executionId:t.execution.executionId,actionId:e.id,duration:P.getTime()-o.getTime()},t.execution.correlationId),{actionId:e.id,status:"completed",startedAt:o,completedAt:P,duration:P.getTime()-o.getTime(),result:c,retryAttempts:n>1?n-1:void 0}}catch(r){if(i=x(r),r instanceof h){let s=new Date;return await this.publishEvent(m.ActionOutcomeUnknown,{executionId:t.execution.executionId,actionId:e.id,error:r.message,attempts:n},t.execution.correlationId),{actionId:e.id,status:"unknown",startedAt:o,completedAt:s,duration:s.getTime()-o.getTime(),error:r.message,retryAttempts:n>1?n-1:void 0}}if(n<a&&e.retry){let s=e.retry.backoffMs*Math.pow(e.retry.backoffMultiplier??2,n-1);await this.sleep(s)}}}let d=new Date;return await this.publishEvent(m.ActionFailed,{executionId:t.execution.executionId,actionId:e.id,error:i?.message??"Unknown error",attempts:n},t.execution.correlationId),{actionId:e.id,status:"failed",startedAt:o,completedAt:d,duration:d.getTime()-o.getTime(),error:i?.message??"Unknown error",retryAttempts:n>1?n-1:void 0}}dependenciesSatisfied(e,t){return!e.dependsOn||e.dependsOn.length===0?!0:e.dependsOn.every(o=>t.has(o))}async executeWithTimeout(e,t){let o;try{return await Promise.race([e,new Promise((n,a)=>{o=setTimeout(()=>a(new h(t)),t)})])}finally{o&&clearTimeout(o)}}setupEventTriggers(e){if(e.schedule.type==="event")for(let t of e.schedule.triggerEvents)this.eventBus.subscribe(t,async o=>{await this.executeOnEvent(e.id,o)})}scheduleProtocol(e){if(e.schedule.type==="interval"){let t={protocolId:e.id,schedule:e.schedule};t.intervalId=setInterval(async()=>{this.schedulerRunning&&await this.execute(e.id)},e.schedule.intervalMs),this.scheduledProtocols.set(e.id,t)}}async storeExecutionHistory(e){let t=`protocol-execution:${e.executionId}`;await this.memory.set(t,{...e,results:Object.fromEntries(e.results)},{namespace:"coordination",ttl:86400})}toImmutableExecution(e){return{executionId:e.executionId,protocolId:e.protocolId,status:e.status,participants:[...e.participants],results:new Map(e.results),startedAt:e.startedAt,completedAt:e.completedAt,correlationId:e.correlationId,triggeredBy:e.triggeredBy}}async publishEvent(e,t,o){let n=w(e,"learning-optimization",t,o);await this.eventBus.publish(n)}sleep(e){return new Promise(t=>setTimeout(t,e))}};function S(f,e,t){return new E(f,e,t)}export{E as a,S 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{n as g}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{n as g}from"./chunk-3EKG7HFV.js";var m={0:"sqlite-only",1:"hybrid",2:"dual-write-sqlite-primary",3:"dual-write-rvf-primary",4:"rvf-primary"},b=class{config;db=null;rvfStore=null;totalWrites=0;totalReads=0;rvfWriteFailures=0;rvfReadFailures=0;fallbacksUsed=0;sqliteLatencies=[];rvfLatencies=[];sqliteWriteLatencies=[];rvfWriteLatencies=[];constructor(e){this.config={rvfPath:".agentic-qe/patterns.rvf",dimensions:384,enableFallback:!0,...e}}setSqliteDb(e){this.db=e}setRvfStore(e){this.rvfStore=e}get stage(){return this.config.stage}setStage(e){this.config={...this.config,stage:e}}write(e,t){this.totalWrites++;let r={sqliteSuccess:!1,rvfSuccess:!1,stage:this.config.stage,fallbackUsed:!1},n=this.db?this.db.prepare("PRAGMA table_info('qe_pattern_embeddings')").all().some(s=>s.name==="space_id"):!1,c=g()?.spaceId??this.config.embeddingSpaceId;if(!n||!c)return r;let o=this.config.stage<4,i=this.config.stage>=2;if(o&&this.db){let s=performance.now();try{let a=Buffer.from(t instanceof Float32Array?t.buffer:new Float32Array(t).buffer);n?this.db.prepare(`
|
|
3
3
|
INSERT INTO qe_pattern_embeddings (pattern_id, embedding, dimension, model, space_id, created_at)
|
|
4
4
|
VALUES (?, ?, ?, 'all-MiniLM-L6-v2', ?, datetime('now'))
|
|
5
5
|
ON CONFLICT(pattern_id) DO UPDATE SET
|
|
@@ -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,
|
|
@@ -89,7 +89,7 @@ import{a as A,b as C,f,j as D,l as w,n as g}from"./chunk-3M7J4U74.js";import{g a
|
|
|
89
89
|
ON qe_patterns(name, qe_domain, pattern_type);
|
|
90
90
|
|
|
91
91
|
-- FTS5 full-text search index + sync triggers (shared DDL)
|
|
92
|
-
${
|
|
92
|
+
${O}
|
|
93
93
|
|
|
94
94
|
-- Indexes for performance
|
|
95
95
|
CREATE INDEX IF NOT EXISTS idx_patterns_domain ON qe_patterns(qe_domain);
|
|
@@ -175,7 +175,7 @@ import{a as A,b as C,f,j as D,l as w,n as g}from"./chunk-3M7J4U74.js";import{g a
|
|
|
175
175
|
SELECT COUNT(*) as count FROM qe_patterns
|
|
176
176
|
`)),this.prepared.set("countByDomain",this.db.prepare(`
|
|
177
177
|
SELECT qe_domain, COUNT(*) as count FROM qe_patterns GROUP BY qe_domain
|
|
178
|
-
`))}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(`
|
|
179
179
|
SELECT p.id, rank AS fts_score, p.name, p.description, p.pattern_type, p.qe_domain
|
|
180
180
|
FROM qe_patterns_fts fts
|
|
181
181
|
JOIN qe_patterns p ON p.rowid = fts.rowid
|
|
@@ -196,7 +196,7 @@ import{a as A,b as C,f,j as D,l as w,n as g}from"./chunk-3M7J4U74.js";import{g a
|
|
|
196
196
|
WHERE p.id NOT LIKE 'bench-%'
|
|
197
197
|
AND p.id NOT IN (SELECT pattern_id FROM qe_pattern_embeddings)
|
|
198
198
|
LIMIT 10
|
|
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
|
|
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(`
|
|
200
200
|
SELECT tier, COUNT(*) as count FROM qe_patterns GROUP BY tier
|
|
201
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(`
|
|
202
202
|
SELECT
|
|
@@ -251,7 +251,7 @@ import{a as A,b as C,f,j as D,l as w,n as g}from"./chunk-3M7J4U74.js";import{g a
|
|
|
251
251
|
GROUP BY pattern_id
|
|
252
252
|
ORDER BY reuse_count DESC
|
|
253
253
|
LIMIT 10
|
|
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=
|
|
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(`
|
|
255
255
|
SELECT p.id, p.name, p.description, p.pattern_type, p.qe_domain
|
|
256
256
|
FROM qe_patterns p
|
|
257
257
|
LEFT JOIN qe_pattern_embeddings e ON e.pattern_id = p.id
|
|
@@ -260,4 +260,4 @@ import{a as A,b as C,f,j as D,l as w,n as g}from"./chunk-3M7J4U74.js";import{g a
|
|
|
260
260
|
ORDER BY p.quality_score DESC
|
|
261
261
|
`).all(n),a=this.db.prepare(`
|
|
262
262
|
SELECT COUNT(*) as c FROM qe_pattern_embeddings
|
|
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
|
|
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};
|