agentic-qe 3.15.14 → 3.15.16
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/agents/v3/templates/qx-report-template.html +1 -1
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +136 -0
- package/assets/agents/v3/templates/qx-report-template.html +1 -1
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/audit/witness-chain.d.ts +7 -0
- package/dist/audit/witness-chain.js +10 -0
- package/dist/cli/bundle.js +6 -6
- package/dist/cli/chunks/adapter-6CQ2PIP5.js +2 -0
- package/dist/cli/chunks/agent-booster-wasm-45NWEKVS.js +2 -0
- package/dist/cli/chunks/{agent-handler-P3IY7XEE.js → agent-handler-LVHMYFEF.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-WWKC2H3G.js → agent-memory-branch-YDWOJFEQ.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-73RR52VS.js +2 -0
- package/dist/cli/chunks/{arena-EIV5OALF.js → arena-CZKHXDDS.js} +2 -2
- package/dist/cli/chunks/{arena-4BMFF6BS.js → arena-ELDZH3CZ.js} +4 -4
- package/dist/cli/chunks/{audit-DNTI453H.js → audit-5MT4T47Z.js} +3 -3
- package/dist/cli/chunks/base-SMCMMVGP.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-TQBQGNC6.js → better-sqlite3-6TGYPC2B.js} +2 -2
- package/dist/cli/chunks/{brain-handler-HY57CNAO.js → brain-handler-HQWZFO52.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-THPMZPHQ.js → branch-enumerator-WVILM4SO.js} +2 -2
- package/dist/cli/chunks/{browser-O6JJOZCK.js → browser-RX5ALU3H.js} +2 -2
- package/dist/cli/chunks/browser-workflow-A2MEZ66K.js +2 -0
- package/dist/cli/chunks/{chunk-CIINJHOX.js → chunk-24OX5TQJ.js} +1 -1
- package/dist/cli/chunks/{chunk-6P4Q4RTC.js → chunk-24QHCVX6.js} +1 -1
- package/dist/cli/chunks/{chunk-U6IOQKCT.js → chunk-2H4XH6FT.js} +2 -2
- package/dist/cli/chunks/{chunk-OGEIHS76.js → chunk-2YZ4G6NW.js} +1 -1
- package/dist/cli/chunks/chunk-32BPDLRZ.js +27 -0
- package/dist/cli/chunks/{chunk-5PLBQZ5J.js → chunk-32GN3JKR.js} +1 -1
- package/dist/cli/chunks/{chunk-AJVLVF7V.js → chunk-3HD7E6HN.js} +2 -2
- package/dist/cli/chunks/{chunk-X7CUI7KH.js → chunk-4D4DENG6.js} +2 -2
- package/dist/cli/chunks/{chunk-E2JLAW3U.js → chunk-4LQFBY5L.js} +6 -6
- package/dist/cli/chunks/{chunk-E3QIQMMN.js → chunk-4NFQLP6R.js} +1 -1
- package/dist/cli/chunks/{chunk-7Y3LXH57.js → chunk-525CFDUE.js} +2 -2
- package/dist/cli/chunks/chunk-5B5QPCNU.js +65 -0
- package/dist/cli/chunks/{chunk-X6Q2N5S5.js → chunk-5JZRZI4S.js} +2 -2
- package/dist/cli/chunks/{chunk-MB4UKUBV.js → chunk-5LAVKGLH.js} +2 -2
- package/dist/cli/chunks/chunk-5NNNEWLS.js +755 -0
- package/dist/cli/chunks/{chunk-NKOLILT7.js → chunk-5PBLPQ5T.js} +2 -2
- package/dist/cli/chunks/chunk-5QO3R3TU.js +6 -0
- package/dist/cli/chunks/{chunk-7T6L3LFN.js → chunk-5SPCGMBB.js} +2 -2
- package/dist/cli/chunks/{chunk-2QLE6NDW.js → chunk-5V3TI2LG.js} +1 -1
- package/dist/cli/chunks/{chunk-A2T56XVL.js → chunk-5VZL4UVN.js} +2 -2
- package/dist/cli/chunks/{chunk-TWOV3I3A.js → chunk-63GMRQ25.js} +1 -1
- package/dist/cli/chunks/{chunk-YGOSSVY5.js → chunk-63ZKI4PX.js} +6 -6
- package/dist/cli/chunks/{chunk-FHPNWHY7.js → chunk-67Z5R7RJ.js} +2 -2
- package/dist/cli/chunks/{chunk-PCQZIAXB.js → chunk-6DPYNAOK.js} +2 -2
- package/dist/cli/chunks/{chunk-WCM6WE7G.js → chunk-6ICX3FEG.js} +3 -3
- package/dist/cli/chunks/{chunk-JB7R77SH.js → chunk-6XXZDV2C.js} +2 -2
- package/dist/cli/chunks/{chunk-FJOIBZUB.js → chunk-6ZBXSOX6.js} +2 -2
- package/dist/cli/chunks/{chunk-WZQADC5R.js → chunk-72XSEQMW.js} +2 -2
- package/dist/cli/chunks/{chunk-AYLEH2UF.js → chunk-7TE5ONQQ.js} +1 -1
- package/dist/cli/chunks/{chunk-7QUSNBAA.js → chunk-A5GBXCP5.js} +2 -2
- package/dist/cli/chunks/{chunk-7724KXM2.js → chunk-AAMLQ2LF.js} +3 -3
- package/dist/cli/chunks/chunk-AG2EWGXS.js +21 -0
- package/dist/cli/chunks/{chunk-2UZBLC5H.js → chunk-AGRV5B3T.js} +2 -2
- package/dist/cli/chunks/{chunk-V6SE2ZU2.js → chunk-AJMJNQMP.js} +1 -1
- package/dist/cli/chunks/{chunk-2HPNGK7A.js → chunk-AR67RJPY.js} +2 -2
- package/dist/cli/chunks/{chunk-G7HGUQAE.js → chunk-ASEOFRIG.js} +2 -2
- package/dist/cli/chunks/{chunk-7TH4PJSU.js → chunk-BEKDKVQT.js} +2 -2
- package/dist/cli/chunks/{chunk-M5JEA6ZY.js → chunk-BY5OF7OH.js} +2 -2
- package/dist/cli/chunks/{chunk-OLUOVNUF.js → chunk-C5FP5GW3.js} +2 -2
- package/dist/cli/chunks/{chunk-R5RRWLRI.js → chunk-C6D5AHBO.js} +2 -2
- package/dist/cli/chunks/{chunk-K7GFYFBO.js → chunk-CAKMOVZ6.js} +2 -2
- package/dist/cli/chunks/{chunk-6NIGSY5L.js → chunk-CEYSYSK5.js} +2 -2
- package/dist/cli/chunks/{chunk-U4TML2VD.js → chunk-CGGUM2YJ.js} +2 -2
- package/dist/cli/chunks/{chunk-YE54T2NQ.js → chunk-CJSHWQXP.js} +2 -2
- package/dist/cli/chunks/{chunk-7SQTLUEN.js → chunk-CRPIYUTJ.js} +2 -2
- package/dist/cli/chunks/{chunk-65EE2EST.js → chunk-D6COXLYE.js} +2 -2
- package/dist/cli/chunks/{chunk-4WLIOPHX.js → chunk-DTMAS2GB.js} +2 -2
- package/dist/cli/chunks/{chunk-E7QTWGPI.js → chunk-DVYHMDFR.js} +470 -411
- package/dist/cli/chunks/chunk-DXD6K2ZP.js +3 -0
- package/dist/cli/chunks/{chunk-HSDWPQQY.js → chunk-E3D4GPLP.js} +3 -3
- package/dist/cli/chunks/{chunk-JJHLGGPP.js → chunk-EA4YQVKS.js} +1 -1
- package/dist/cli/chunks/{chunk-EIEEST4T.js → chunk-EGYE5UPQ.js} +2 -2
- package/dist/cli/chunks/{chunk-O756AOUX.js → chunk-EK7OLYOZ.js} +2 -2
- package/dist/cli/chunks/{chunk-57DRT6UA.js → chunk-F742SZAX.js} +2 -2
- package/dist/cli/chunks/{chunk-6OI5SK7M.js → chunk-FBDVGRSC.js} +1 -1
- package/dist/cli/chunks/{chunk-H3C5FJRH.js → chunk-FDDC72IA.js} +2 -2
- package/dist/cli/chunks/{chunk-IQRPR4KB.js → chunk-FL64OUBA.js} +2 -2
- package/dist/cli/chunks/{chunk-BNG4J3CE.js → chunk-FLNAW7C4.js} +2 -2
- package/dist/cli/chunks/{chunk-C3OIBFAA.js → chunk-G5RHFBAY.js} +2 -2
- package/dist/cli/chunks/{chunk-NPCXGX7N.js → chunk-GAHNO6JJ.js} +2 -2
- package/dist/cli/chunks/{chunk-PNRPVQGI.js → chunk-GFWHUQSF.js} +2 -2
- package/dist/cli/chunks/{chunk-OCN53CCK.js → chunk-GJYHWYXR.js} +2 -2
- package/dist/cli/chunks/{chunk-5Z4MO2F3.js → chunk-GQ6TUIKY.js} +1 -1
- package/dist/cli/chunks/{chunk-N736GLWZ.js → chunk-GSKMOPL7.js} +2 -2
- package/dist/cli/chunks/{chunk-43XHGWYH.js → chunk-HCH4Y6XX.js} +2 -2
- package/dist/cli/chunks/{chunk-QP6GL3O5.js → chunk-HGWXF45W.js} +1 -1
- package/dist/cli/chunks/{chunk-PGN4TARY.js → chunk-HJ6ZGVTB.js} +2 -2
- package/dist/cli/chunks/{chunk-M2TG7VDK.js → chunk-HLUXXCHF.js} +1 -1
- package/dist/cli/chunks/{chunk-UMHFTQTR.js → chunk-HVRRLYX6.js} +4 -4
- package/dist/cli/chunks/{chunk-L7PC675Y.js → chunk-I7MQIM2U.js} +1 -1
- package/dist/cli/chunks/{chunk-JSSU4RIK.js → chunk-IESR7TNB.js} +2 -2
- package/dist/cli/chunks/{chunk-H4LYXLAT.js → chunk-IHRXZZQM.js} +1 -1
- package/dist/cli/chunks/{chunk-HV43NX4A.js → chunk-IOKYCMTJ.js} +6 -6
- package/dist/cli/chunks/{chunk-NZQYJCO6.js → chunk-IOQ6ZQ5W.js} +1 -1
- package/dist/cli/chunks/{chunk-JO26SG47.js → chunk-IOYG4VFL.js} +2 -2
- package/dist/cli/chunks/{chunk-6O63ZTVX.js → chunk-IUBJVHNB.js} +2 -2
- package/dist/cli/chunks/{chunk-XSPMLJCQ.js → chunk-J442IZLE.js} +1 -1
- package/dist/cli/chunks/{chunk-LTGQJYYO.js → chunk-J4ELZNLY.js} +2 -2
- package/dist/cli/chunks/chunk-J7I6PABJ.js +153 -0
- package/dist/cli/chunks/chunk-JDIYMZCQ.js +2 -0
- package/dist/cli/chunks/{chunk-TOJF3ZG4.js → chunk-JHQCRRJI.js} +2 -2
- package/dist/cli/chunks/{chunk-QUZ745UQ.js → chunk-JQ3DYUMS.js} +2 -2
- package/dist/cli/chunks/{chunk-P2TPH3TC.js → chunk-KITOPKRG.js} +2 -2
- package/dist/cli/chunks/{chunk-QNQE3EOH.js → chunk-KKU2QGSJ.js} +2 -2
- package/dist/cli/chunks/chunk-KL7OKSU2.js +4 -0
- package/dist/cli/chunks/{chunk-L5VSLPMW.js → chunk-KNSRL6NO.js} +2 -2
- package/dist/cli/chunks/{chunk-INGXD5IX.js → chunk-KPRCB5LT.js} +2 -2
- package/dist/cli/chunks/{chunk-GY4P7KAI.js → chunk-KQYJ4VQ5.js} +1 -1
- package/dist/cli/chunks/{chunk-Z2S7DNFP.js → chunk-KU2AUFGX.js} +2 -2
- package/dist/cli/chunks/{chunk-O5CEL447.js → chunk-KVF4NXGQ.js} +2 -2
- package/dist/cli/chunks/{chunk-2IJO3657.js → chunk-KXCLACFG.js} +2 -2
- package/dist/cli/chunks/{chunk-ZJGFQK27.js → chunk-L2DWPVNJ.js} +1 -1
- package/dist/cli/chunks/{chunk-E7OR6V3V.js → chunk-L6QSTQME.js} +2 -2
- package/dist/cli/chunks/{chunk-RE6JTSDM.js → chunk-LE4QJREF.js} +1 -1
- package/dist/cli/chunks/{chunk-DSQESXL4.js → chunk-LKTTUHLF.js} +2 -2
- package/dist/cli/chunks/{chunk-YGC5QKQ4.js → chunk-LQLPB2T6.js} +2 -2
- package/dist/cli/chunks/{chunk-VGZOPQQY.js → chunk-LRSX2FJM.js} +1 -1
- package/dist/cli/chunks/chunk-M4FRQ4TE.js +12 -0
- package/dist/cli/chunks/chunk-M7WJCTG3.js +2 -0
- package/dist/cli/chunks/{chunk-56NSE3LJ.js → chunk-MAFQV4U4.js} +2 -2
- package/dist/cli/chunks/{chunk-MKYOE7NE.js → chunk-MD43XRX5.js} +1 -1
- package/dist/cli/chunks/{chunk-3TF27MG5.js → chunk-MI5MFHRA.js} +2 -2
- package/dist/cli/chunks/{chunk-JK6PMLQQ.js → chunk-MO55CVMT.js} +32 -32
- package/dist/cli/chunks/{chunk-X6NJOT3V.js → chunk-N7HL5PHH.js} +1 -1
- package/dist/cli/chunks/chunk-NAEWCFQT.js +14 -0
- package/dist/cli/chunks/{chunk-WUGXXNK4.js → chunk-NDJ7P2EP.js} +1 -1
- package/dist/cli/chunks/{chunk-D5GB5PUU.js → chunk-NO3IV5Q5.js} +1 -1
- package/dist/cli/chunks/{chunk-3XACRXBY.js → chunk-NQXXI77K.js} +2 -2
- package/dist/cli/chunks/{chunk-EC65UZ77.js → chunk-NVEWF4JV.js} +1 -1
- package/dist/cli/chunks/{chunk-JI67T6Q2.js → chunk-NZU4ACBZ.js} +2 -2
- package/dist/cli/chunks/chunk-O5W3FIO6.js +63 -0
- package/dist/cli/chunks/{chunk-YEFTK4HD.js → chunk-OAEE6JWQ.js} +2 -2
- package/dist/cli/chunks/{chunk-JAOCHPYX.js → chunk-OCV2XEWQ.js} +2 -2
- package/dist/cli/chunks/{chunk-IDBA5GK2.js → chunk-P3EYRILV.js} +2 -2
- package/dist/cli/chunks/{chunk-4RPBODN5.js → chunk-PEQDY4BO.js} +2 -2
- package/dist/cli/chunks/{chunk-CPPYZYXC.js → chunk-PF7RBAYL.js} +2 -2
- package/dist/cli/chunks/{chunk-WCPSR4MJ.js → chunk-PHT5N7SC.js} +2 -2
- package/dist/cli/chunks/{chunk-O2AAYJUV.js → chunk-PINSJCM3.js} +1 -1
- package/dist/cli/chunks/{chunk-HEDGFKC5.js → chunk-PPUZWYUG.js} +2 -2
- package/dist/cli/chunks/{chunk-XMCSKYDE.js → chunk-QPEOLAAS.js} +1 -1
- package/dist/cli/chunks/{chunk-7MUO4DEH.js → chunk-QQWBWEJS.js} +18 -18
- package/dist/cli/chunks/{chunk-UFP7SN5V.js → chunk-QVDCVD5D.js} +2 -2
- package/dist/cli/chunks/{chunk-NHEG2DLN.js → chunk-RJIEG3NA.js} +2 -2
- package/dist/cli/chunks/{chunk-KJ5A54ZH.js → chunk-RV74I3YO.js} +2 -2
- package/dist/cli/chunks/{chunk-UDSB3XCG.js → chunk-S75SOOZL.js} +2 -2
- package/dist/cli/chunks/{chunk-BPDAQB3F.js → chunk-SASBO5Y5.js} +2 -2
- package/dist/cli/chunks/{chunk-VJBJRFUO.js → chunk-SDLWKRVL.js} +9 -9
- package/dist/cli/chunks/{chunk-J6ASX536.js → chunk-SHKOCGNK.js} +2 -2
- package/dist/cli/chunks/{chunk-J35JWDJE.js → chunk-SI6DPU5D.js} +1 -1
- package/dist/cli/chunks/{chunk-V3MGY76S.js → chunk-SJ6Y4725.js} +2 -2
- package/dist/cli/chunks/{chunk-FTYRPEJS.js → chunk-SR52XP5F.js} +1 -1
- package/dist/cli/chunks/{chunk-ZUE524JL.js → chunk-SSUAAX3F.js} +2 -2
- package/dist/cli/chunks/{chunk-VG32EEUG.js → chunk-SSYAQZXA.js} +2 -2
- package/dist/cli/chunks/{chunk-HTVGHHX2.js → chunk-SUDMM5SO.js} +2 -2
- package/dist/cli/chunks/{chunk-K2SMP4OD.js → chunk-TIUKLYAI.js} +1 -1
- package/dist/cli/chunks/{chunk-VCVRZD4Y.js → chunk-TVGI32MB.js} +33 -33
- package/dist/cli/chunks/{chunk-CAZM63TP.js → chunk-U2A7NHZA.js} +2 -2
- package/dist/cli/chunks/{chunk-WBC6WB32.js → chunk-UE5ZOZR2.js} +2 -2
- package/dist/cli/chunks/{chunk-BQJ7CV53.js → chunk-UHEOGZLX.js} +12 -12
- package/dist/cli/chunks/chunk-UNGBRZDK.js +12 -0
- package/dist/cli/chunks/{chunk-XN3KCKAM.js → chunk-V5NHZV7S.js} +2 -2
- package/dist/cli/chunks/{chunk-UNYTHZDZ.js → chunk-VJCIEHEF.js} +1 -1
- package/dist/cli/chunks/{chunk-5Y7UFHJD.js → chunk-VMDFFTCK.js} +1 -1
- package/dist/cli/chunks/chunk-VSIKHWZ4.js +29 -0
- package/dist/cli/chunks/{chunk-UPWLMIDY.js → chunk-VWPM27GU.js} +2 -2
- package/dist/cli/chunks/{chunk-USAKCGHC.js → chunk-VXFLJNCA.js} +2 -2
- package/dist/cli/chunks/{chunk-WKI46WWN.js → chunk-W5HQUIML.js} +2 -2
- package/dist/cli/chunks/{chunk-Z54G2YOL.js → chunk-WP4RETKG.js} +2 -2
- package/dist/cli/chunks/{chunk-IRPNEXOU.js → chunk-XIIQ5QTT.js} +2 -2
- package/dist/cli/chunks/{chunk-O32BFQV4.js → chunk-XIQW7EFL.js} +2 -2
- package/dist/cli/chunks/{chunk-TW6Z6W4X.js → chunk-XWUWX7BV.js} +13 -13
- package/dist/cli/chunks/{chunk-57FX3GP6.js → chunk-Y4PFUMOU.js} +1 -1
- package/dist/cli/chunks/chunk-YAPLJR7K.js +2 -0
- package/dist/cli/chunks/{chunk-4T7XV5KQ.js → chunk-YLMNVLDK.js} +1 -1
- package/dist/cli/chunks/{chunk-TSP6SU5V.js → chunk-YNMJEDN5.js} +2 -2
- package/dist/cli/chunks/{chunk-PWQWKYBG.js → chunk-YPBSUGMI.js} +1 -1
- package/dist/cli/chunks/{chunk-QP2HLKTS.js → chunk-YRAX7SFJ.js} +2 -2
- package/dist/cli/chunks/{chunk-O3ERGUXH.js → chunk-YTHTQPWR.js} +1 -1
- package/dist/cli/chunks/{chunk-MR2OPUSA.js → chunk-YU2BDRSD.js} +1 -1
- package/dist/cli/chunks/chunk-ZB3LEFYG.js +2 -0
- package/dist/cli/chunks/{chunk-2W5MQDHM.js → chunk-ZFL436FN.js} +2 -2
- package/dist/cli/chunks/{chunk-7MISCSL5.js → chunk-ZJH5MU2I.js} +2 -2
- package/dist/cli/chunks/{chunk-52KOPIMI.js → chunk-ZQ2XW3IP.js} +2 -2
- package/dist/cli/chunks/chunk-ZR2TKVXQ.js +14 -0
- package/dist/cli/chunks/{ci-UMA2SMNW.js → ci-MFUR4CWV.js} +2 -2
- package/dist/cli/chunks/{ci-config-UQSILJFQ.js → ci-config-PNDLQ6XV.js} +2 -2
- package/dist/cli/chunks/{ci-output-U6YZLLKH.js → ci-output-PFZ4M7NC.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-ATYQP6X2.js → circuit-breaker-5HH6NLZN.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-6YHFD7AN.js → claude-flow-setup-QCKYLGLC.js} +2 -2
- package/dist/cli/chunks/client-MHQRTZM4.js +2 -0
- package/dist/cli/chunks/{cline-installer-EPE7IOZE.js → cline-installer-EASVPFXR.js} +2 -2
- package/dist/cli/chunks/{code-NUEJ4XYO.js → code-UJXDVYRK.js} +4 -3
- package/dist/cli/chunks/{code-index-extractor-D4DBT6OL.js → code-index-extractor-BZJ3UDP4.js} +2 -2
- package/dist/cli/chunks/{codex-installer-633SM4LR.js → codex-installer-XSQZUVOZ.js} +4 -4
- package/dist/cli/chunks/{completions-WUKVIW3L.js → completions-OWOOJFI2.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-F73ACR5H.js → complexity-analyzer-KP5TOHDT.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-QH42TKMS.js → continuedev-installer-IFKQXLHM.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-Y3XC7BTT.js → copilot-installer-IGJ6KGQY.js} +2 -2
- package/dist/cli/chunks/core-handlers-UAK3LLJE.js +2 -0
- package/dist/cli/chunks/{cost-tracker-57QPV7E3.js → cost-tracker-MMDDNKZB.js} +2 -2
- package/dist/cli/chunks/{coverage-IBCHMBCR.js → coverage-LUH2B7NT.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-WTRZQPNQ.js +2 -0
- package/dist/cli/chunks/{cursor-installer-F4UYQHIN.js → cursor-installer-4YLM5GWM.js} +2 -2
- package/dist/cli/chunks/daemon-CAVZ7OFV.js +18 -0
- package/dist/cli/chunks/{daemon-XR4Q6YZF.js → daemon-MZKVM4CJ.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-ZR5ZD3TW.js → dag-attention-scheduler-X4CYW665.js} +2 -2
- package/dist/cli/chunks/{detect-GEGYURLL.js → detect-7BM2XINO.js} +2 -2
- package/dist/cli/chunks/{dist-node-JU3KT2JO.js → dist-node-Y5APLEYB.js} +2 -2
- package/dist/cli/chunks/{domain-handler-7QI3FJGE.js → domain-handler-X3ZRJNAH.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-O2YRM2PD.js → domain-plugins-2UW5KQJB.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-7J3S2OS6.js → domain-transfer-35W4CIBV.js} +2 -2
- package/dist/cli/chunks/dream-EJY24JN6.js +2 -0
- package/dist/cli/chunks/embed-and-insert-pattern-COG4C7ZI.js +3 -0
- package/dist/cli/chunks/embedding-space-SBM2MZD2.js +2 -0
- package/dist/cli/chunks/{eval-RVMCIUOR.js → eval-4QA2SROK.js} +2 -2
- package/dist/cli/chunks/experience-capture-middleware-Z6BF6KYM.js +40 -0
- package/dist/cli/chunks/{fast-paths-QUKPKWKZ.js → fast-paths-FIORX6GN.js} +2 -2
- package/dist/cli/chunks/{feature-flags-K7JXNKJI.js → feature-flags-6LYI2T4G.js} +2 -2
- package/dist/cli/chunks/{feature-flags-5JCSKL2P.js → feature-flags-ZOO7LMIC.js} +2 -2
- package/dist/cli/chunks/file-discovery-UZSFSS4V.js +2 -0
- package/dist/cli/chunks/{fleet-II4Q6HXK.js → fleet-7WF53H4F.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-M7VO2EMS.js → gnn-wrapper-KJ6B7BRM.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-ND5CY26N.js → heartbeat-handler-DEKKMOVW.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-NVR356I7.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-LFMPLUJU.js +2 -0
- package/dist/cli/chunks/hnsw-index-POCPMVJH.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-N3AUUUU7.js → hnsw-legacy-bridge-L27WS27N.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-NZY3E5EN.js → hnswlib-node-4YOQC6L4.js} +2 -2
- package/dist/cli/chunks/{hooks-QVJDTII5.js → hooks-TAOKV4EJ.js} +23 -22
- package/dist/cli/chunks/hybrid-backend-4STAO7CV.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-ZRY6MTDV.js → hypergraph-engine-BODRJLHL.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-56DO4XZQ.js → hypergraph-handler-RKMYJNTU.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-3VIIISBQ.js +2 -0
- package/dist/cli/chunks/{init-guard-DTF4EVUY.js → init-guard-MXHSLSB2.js} +2 -2
- package/dist/cli/chunks/{init-handler-M6CNQHMX.js → init-handler-HUE57IFW.js} +6 -6
- package/dist/cli/chunks/init-wizard-PL6QN6RQ.js +2 -0
- package/dist/cli/chunks/kernel-CCDWT7KS.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-IJN7XKBH.js → kilocode-installer-S333IKYQ.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-UKKPGPDC.js → kiro-installer-WM5DLQWC.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-KFOMEN3H.js +2 -0
- package/dist/cli/chunks/{learning-W2HETWQ4.js → learning-LNHMQLH5.js} +3 -3
- package/dist/cli/chunks/{llm-router-Y546K4VX.js → llm-router-EWFXYZZR.js} +4 -4
- package/dist/cli/chunks/llm-router-service-7NBE2EX6.js +2 -0
- package/dist/cli/chunks/{load-MKAB2AXE.js → load-FGYGWVDK.js} +2 -2
- package/dist/cli/chunks/load-test-UNZUWY3F.js +2 -0
- package/dist/cli/chunks/{mcp-AZKUS6K3.js → mcp-2FHNAAOM.js} +2 -2
- package/dist/cli/chunks/{memory-ZDOQN2KU.js → memory-DZMQ73AB.js} +5 -5
- package/dist/cli/chunks/memory-backend-DFGKWA2Q.js +2 -0
- package/dist/cli/chunks/memory-handlers-MP426XRJ.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-WWVXDHG4.js → multi-model-executor-6F2UAEUW.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-YUJNXXWS.js → opencode-installer-XY3BGOTZ.js} +2 -2
- package/dist/cli/chunks/{orchestrator-Z6PWPLRE.js → orchestrator-B4CNKUOS.js} +17 -17
- package/dist/cli/chunks/pattern-null-store-SSVF5TE5.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-TPWPX32U.js → pattern-usage-recorder-R4GUFNMD.js} +2 -2
- package/dist/cli/chunks/{pipeline-4BBGTE4M.js → pipeline-FG5RKVRO.js} +2 -2
- package/dist/cli/chunks/{platform-5GSHXCV5.js → platform-3BT4KEVJ.js} +2 -2
- package/dist/cli/chunks/{plugin-OFDVF5HS.js → plugin-WI4RIN7O.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-NC6MUYGJ.js → prime-radiant-advanced-wasm-7ECDNQFS.js} +2 -2
- package/dist/cli/chunks/project-root-BEANNYWU.js +2 -0
- package/dist/cli/chunks/protocol-executor-FQVIHXZ7.js +2 -0
- package/dist/cli/chunks/{protocol-handler-MPOAAEPA.js → protocol-handler-WNODKPGW.js} +2 -2
- package/dist/cli/chunks/{prove-CDKMAIVM.js → prove-5RHAEPYZ.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-5TFYSE24.js +2 -0
- package/dist/cli/chunks/{quality-ZH4F7R7R.js → quality-WPHR7BGQ.js} +2 -2
- package/dist/cli/chunks/{quality-gate-IDRMW6OE.js → quality-gate-4RKTEZMX.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-Y2OUL7IN.js +2 -0
- package/dist/cli/chunks/real-embeddings-OXLYU7JW.js +2 -0
- package/dist/cli/chunks/{ref-validation-Z5GCGVXK.js → ref-validation-TPAWHOHH.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-IZ2S7PH2.js → roocode-installer-7AVHFNDI.js} +2 -2
- package/dist/cli/chunks/router-EP34O3KB.js +2 -0
- package/dist/cli/chunks/routing-feedback-FJCRKXNG.js +2 -0
- package/dist/cli/chunks/{routing-handler-NAX35VUW.js → routing-handler-YKEDVJSH.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-5YW2SOFF.js → ruvector-commands-JUAMM354.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-ILITJSFG.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-XF6W4C2N.js +2 -0
- package/dist/cli/chunks/rvf-migration-coordinator-CMKG56AR.js +2 -0
- package/dist/cli/chunks/rvf-native-adapter-7YFW6S4Y.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-IPGCAT6C.js → rvf-store-integrity-VJDUIRTX.js} +2 -2
- package/dist/cli/chunks/safe-db-TCAU4FUT.js +2 -0
- package/dist/cli/chunks/schedule-NB5KV435.js +2 -0
- package/dist/cli/chunks/scheduler-JKXGKVK6.js +2 -0
- package/dist/cli/chunks/{security-3IH4BO5Z.js → security-ORDN3RD2.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-ABY7PAY2.js → shared-rvf-adapter-CF4BCIO7.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-6KENLN2W.js → shared-rvf-dual-writer-C32UBR6D.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-IXCNZRTW.js +2 -0
- package/dist/cli/chunks/{standalone-memory-RLFAUGOW.js → standalone-memory-OXRJYZXN.js} +2 -2
- package/dist/cli/chunks/{status-handler-FCOZBPE5.js → status-handler-BCX5D4HY.js} +2 -2
- package/dist/cli/chunks/{structural-health-4RDA5UUM.js → structural-health-LFG7RUU6.js} +2 -2
- package/dist/cli/chunks/sync-OSF7C2NL.js +2 -0
- package/dist/cli/chunks/{sync-KGEEXXCC.js → sync-YJEE2K2L.js} +2 -2
- package/dist/cli/chunks/task-handler-6LXKPTXJ.js +64 -0
- package/dist/cli/chunks/{task-handlers-6H7L2UT4.js → task-handlers-CILP36I7.js} +4 -4
- package/dist/cli/chunks/{test-S7IG6EIX.js → test-SD457QJ6.js} +4 -4
- package/dist/cli/chunks/test-runner-process-VKD65QQU.js +2 -0
- package/dist/cli/chunks/{test-scheduling-7XYXI4L2.js → test-scheduling-ISI2O4Q5.js} +3 -3
- package/dist/cli/chunks/token-bootstrap-VUELSBOS.js +2 -0
- package/dist/cli/chunks/{token-usage-Y2YTPOFE.js → token-usage-XOC5KG7S.js} +2 -2
- package/dist/cli/chunks/{transformers-UCJ3HHHC.js → transformers-LSLQAARK.js} +2 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-YAIPHRIL.js +2 -0
- package/dist/cli/chunks/{types-6CMFPETH.js → types-5BLCGLCR.js} +2 -2
- package/dist/cli/chunks/unified-memory-GI76TXFV.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-GXJ5BTZO.js +2 -0
- package/dist/cli/chunks/unified-persistence-OP7FDQPD.js +2 -0
- package/dist/cli/chunks/{upgrade-K25DN6WU.js → upgrade-RQJYLK3J.js} +2 -2
- package/dist/cli/chunks/{validate-T4V3TBY3.js → validate-QBHWXXCK.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-XSRC576T.js → validate-swarm-IKXBKFB5.js} +2 -2
- package/dist/cli/chunks/visual-security-GZ2MOKWB.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-YOZXHRTN.js → web-tree-sitter-ZF6FIE5R.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-ITPU2IYL.js → windsurf-installer-HQGDZT5D.js} +2 -2
- package/dist/cli/chunks/witness-chain-DCHCAMSQ.js +2 -0
- package/dist/cli/chunks/witness-chain-P3XXXA62.js +2 -0
- package/dist/cli/chunks/witness-chain-repair-PUX2NFDL.js +2 -0
- package/dist/cli/chunks/{witness-chain-verifier-DTDSVKOG.js → witness-chain-verifier-PX2OQ6XT.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-EWACWGAW.js → witness-key-manager-RXYQNFJB.js} +2 -2
- package/dist/cli/chunks/{workflow-ZIQ4FV42.js → workflow-FBKCA4H6.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-P2APAJAA.js +2 -0
- package/dist/cli/chunks/wrappers-TWSKBTWD.js +2 -0
- package/dist/cli/commands/code.js +4 -0
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +10 -2
- package/dist/cli/handlers/task-handler.d.ts +5 -0
- package/dist/cli/handlers/task-handler.js +21 -1
- package/dist/cli/utils/task-result.d.ts +11 -0
- package/dist/cli/utils/task-result.js +39 -0
- package/dist/coordination/handlers/test-execution-handlers.js +92 -58
- package/dist/coordination/mincut/mincut-persistence.js +29 -25
- package/dist/domains/code-intelligence/coordinator.d.ts +4 -0
- package/dist/domains/code-intelligence/coordinator.js +46 -13
- package/dist/domains/code-intelligence/interfaces.d.ts +10 -1
- package/dist/domains/code-intelligence/services/semantic-analyzer.d.ts +32 -7
- package/dist/domains/code-intelligence/services/semantic-analyzer.js +112 -53
- package/dist/domains/learning-optimization/services/learning-coordinator.js +1 -1
- package/dist/domains/quality-assessment/coordinator.js +2 -1
- package/dist/domains/test-execution/coordinator.js +10 -5
- package/dist/domains/test-execution/interfaces.d.ts +12 -0
- package/dist/domains/test-execution/plugin.js +6 -2
- package/dist/domains/test-execution/services/retry-handler.d.ts +2 -0
- package/dist/domains/test-execution/services/retry-handler.js +14 -9
- package/dist/domains/test-execution/services/test-executor.d.ts +1 -0
- package/dist/domains/test-execution/services/test-executor.js +28 -9
- package/dist/domains/visual-accessibility/coordinator.d.ts +15 -7
- package/dist/domains/visual-accessibility/coordinator.js +15 -7
- package/dist/domains/visual-accessibility/interfaces.d.ts +27 -3
- package/dist/domains/visual-accessibility/services/accessibility-contrast.d.ts +39 -0
- package/dist/domains/visual-accessibility/services/accessibility-contrast.js +93 -0
- package/dist/domains/visual-accessibility/services/accessibility-tester-browser.d.ts +18 -3
- package/dist/domains/visual-accessibility/services/accessibility-tester-browser.js +50 -40
- package/dist/domains/visual-accessibility/services/accessibility-tester-checks.d.ts +27 -0
- package/dist/domains/visual-accessibility/services/accessibility-tester-checks.js +137 -0
- package/dist/domains/visual-accessibility/services/accessibility-tester.d.ts +5 -0
- package/dist/domains/visual-accessibility/services/accessibility-tester.js +43 -24
- package/dist/domains/visual-accessibility/services/browser-swarm-coordinator.d.ts +2 -3
- package/dist/domains/visual-accessibility/services/browser-swarm-coordinator.js +8 -14
- package/dist/feedback/coverage-learner.js +13 -9
- package/dist/feedback/test-outcome-tracker.js +13 -9
- package/dist/governance/witness-chain.d.ts +5 -0
- package/dist/governance/witness-chain.js +22 -6
- package/dist/init/init-wizard-hooks.d.ts +1 -1
- package/dist/init/init-wizard-hooks.js +7 -8
- package/dist/init/phases/08-mcp.js +9 -0
- package/dist/init/settings-merge.d.ts +13 -0
- package/dist/init/settings-merge.js +49 -2
- package/dist/integrations/agent-booster-wasm/agent_booster_wasm.js +849 -0
- package/dist/integrations/agent-booster-wasm/agent_booster_wasm_bg.wasm +0 -0
- package/dist/integrations/agent-booster-wasm/index.d.ts +8 -0
- package/dist/integrations/agent-booster-wasm/index.js +25 -2
- package/dist/integrations/agent-booster-wasm/package.json +16 -0
- package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.d.ts +22 -0
- package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.js +115 -45
- package/dist/integrations/agentic-flow/reasoning-bank/pattern-evolution.d.ts +6 -0
- package/dist/integrations/agentic-flow/reasoning-bank/pattern-evolution.js +51 -33
- package/dist/integrations/agentic-flow/reasoning-bank/trajectory-tracker.js +17 -9
- package/dist/integrations/embeddings/cache/EmbeddingCache.d.ts +8 -0
- package/dist/integrations/embeddings/cache/EmbeddingCache.js +24 -10
- package/dist/integrations/ruvector/delta-tracker.d.ts +11 -0
- package/dist/integrations/ruvector/delta-tracker.js +16 -0
- package/dist/integrations/ruvector/sona-persistence.d.ts +10 -0
- package/dist/integrations/ruvector/sona-persistence.js +49 -24
- package/dist/kernel/unified-memory.d.ts +24 -0
- package/dist/kernel/unified-memory.js +63 -8
- package/dist/learning/aqe-learning-engine.js +1 -1
- package/dist/learning/dream/dream-engine.d.ts +3 -2
- package/dist/learning/dream/dream-engine.js +42 -24
- package/dist/learning/dream/dream-lock-retry.d.ts +38 -0
- package/dist/learning/dream/dream-lock-retry.js +66 -0
- package/dist/learning/dream/speculative-dreamer.js +1 -1
- package/dist/learning/embed-and-insert-pattern.js +4 -2
- package/dist/learning/embedder-endpoint-client.d.ts +31 -0
- package/dist/learning/embedder-endpoint-client.js +103 -10
- package/dist/learning/embedding-space.d.ts +12 -0
- package/dist/learning/embedding-space.js +17 -0
- package/dist/learning/experience-capture-middleware.js +25 -13
- package/dist/learning/experience-capture.js +1 -1
- package/dist/learning/experience-consolidation.d.ts +18 -0
- package/dist/learning/experience-consolidation.js +55 -8
- package/dist/learning/experience-space-verification.d.ts +71 -0
- package/dist/learning/experience-space-verification.js +147 -0
- package/dist/learning/pattern-lifecycle.d.ts +40 -4
- package/dist/learning/pattern-lifecycle.js +153 -76
- package/dist/learning/pattern-null-store.d.ts +5 -0
- package/dist/learning/pattern-null-store.js +8 -0
- package/dist/learning/pattern-promotion.js +6 -3
- package/dist/learning/pattern-store.d.ts +6 -0
- package/dist/learning/pattern-store.js +19 -6
- package/dist/learning/qe-reasoning-bank.js +2 -2
- package/dist/learning/real-embeddings.js +3 -1
- package/dist/learning/real-qe-reasoning-bank.d.ts +5 -0
- package/dist/learning/real-qe-reasoning-bank.js +77 -47
- package/dist/learning/rvf-pattern-store.js +6 -2
- package/dist/learning/sqlite-persistence.d.ts +6 -0
- package/dist/learning/sqlite-persistence.js +10 -0
- package/dist/mcp/bundle.js +642 -571
- package/dist/mcp/entry.js +4 -0
- package/dist/mcp/handlers/domain-handler-configs.js +2 -0
- package/dist/mcp/handlers/trajectory-judge.js +1 -1
- package/dist/mcp/protocol-server.js +1 -0
- package/dist/mcp/tools/visual-accessibility/index.js +8 -2
- package/dist/mcp/types.d.ts +6 -0
- package/dist/optimization/session-cache.d.ts +17 -1
- package/dist/optimization/session-cache.js +40 -36
- package/dist/planning/goap-planner.d.ts +6 -0
- package/dist/planning/goap-planner.js +35 -19
- package/dist/planning/plan-executor.js +24 -15
- package/dist/routing/co-execution-repository.js +12 -9
- package/dist/routing/routing-feedback.d.ts +8 -0
- package/dist/routing/routing-feedback.js +46 -24
- package/dist/routing/routing-outcomes-migration.js +7 -2
- package/dist/shared/llm/spend-ledger.d.ts +9 -0
- package/dist/shared/llm/spend-ledger.js +64 -39
- package/dist/shared/sqlite-lock-wait.d.ts +27 -0
- package/dist/shared/sqlite-lock-wait.js +37 -0
- package/dist/shared/sqlite-write-queue.d.ts +28 -0
- package/dist/shared/sqlite-write-queue.js +38 -0
- package/dist/shared/test-runner-project.d.ts +69 -0
- package/dist/shared/test-runner-project.js +186 -0
- package/dist/skills/security-visual-testing/index.d.ts +3 -1
- package/dist/skills/security-visual-testing/index.js +49 -35
- package/dist/skills/security-visual-testing/types.d.ts +19 -3
- package/dist/workers/workers/heartbeat-scheduler.js +5 -5
- package/dist/workers/workers/learning-consolidation.js +8 -7
- package/package.json +4 -2
- package/dist/cli/chunks/adapter-23KA2YW7.js +0 -2
- package/dist/cli/chunks/agent-booster-wasm-2DLAEZK6.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-MUICAXW5.js +0 -2
- package/dist/cli/chunks/base-XPWGYDKD.js +0 -2
- package/dist/cli/chunks/browser-workflow-UMQVBVGK.js +0 -2
- package/dist/cli/chunks/chunk-3FITMWWJ.js +0 -21
- package/dist/cli/chunks/chunk-ARRBXCII.js +0 -4
- package/dist/cli/chunks/chunk-BBYJBZHG.js +0 -14
- package/dist/cli/chunks/chunk-BM3EJLMV.js +0 -153
- package/dist/cli/chunks/chunk-D3ZZ2NLL.js +0 -62
- package/dist/cli/chunks/chunk-DLTB5KCR.js +0 -2
- package/dist/cli/chunks/chunk-DRLSJJIC.js +0 -6
- package/dist/cli/chunks/chunk-HAYKLXCT.js +0 -744
- package/dist/cli/chunks/chunk-HHBF2BZC.js +0 -65
- package/dist/cli/chunks/chunk-K7RT6ITZ.js +0 -2
- package/dist/cli/chunks/chunk-L752CNG3.js +0 -13
- package/dist/cli/chunks/chunk-MQXWG55U.js +0 -12
- package/dist/cli/chunks/chunk-WM2QRIRD.js +0 -14
- package/dist/cli/chunks/chunk-WRC3HLUY.js +0 -29
- package/dist/cli/chunks/chunk-XTZGAG6P.js +0 -27
- package/dist/cli/chunks/chunk-YKQWIXUY.js +0 -2
- package/dist/cli/chunks/client-E43GWLQH.js +0 -2
- package/dist/cli/chunks/core-handlers-R5A3SQDY.js +0 -2
- package/dist/cli/chunks/cross-domain-router-LLYVPZF6.js +0 -2
- package/dist/cli/chunks/daemon-BYYPIJ7G.js +0 -18
- package/dist/cli/chunks/dream-6C4NURSE.js +0 -2
- package/dist/cli/chunks/embed-and-insert-pattern-URES5Q6J.js +0 -3
- package/dist/cli/chunks/experience-capture-middleware-SYJQSBKE.js +0 -40
- package/dist/cli/chunks/file-discovery-J5IE5KP7.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-FC5PBTMN.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-47UIVOBG.js +0 -2
- package/dist/cli/chunks/hnsw-index-3AKVLOZQ.js +0 -2
- package/dist/cli/chunks/hybrid-backend-YAOSNX47.js +0 -2
- package/dist/cli/chunks/impact-analyzer-4FMJXM4M.js +0 -2
- package/dist/cli/chunks/init-wizard-RTLCRWDT.js +0 -2
- package/dist/cli/chunks/kernel-2OWIGGGT.js +0 -2
- package/dist/cli/chunks/knowledge-graph-25XXKDJN.js +0 -2
- package/dist/cli/chunks/llm-router-service-G3EIN4UB.js +0 -2
- package/dist/cli/chunks/load-test-D6QYNIVT.js +0 -2
- package/dist/cli/chunks/memory-backend-LDFFZMEQ.js +0 -2
- package/dist/cli/chunks/memory-handlers-3SQVY7FE.js +0 -2
- package/dist/cli/chunks/pattern-null-store-KDVRM7PW.js +0 -2
- package/dist/cli/chunks/project-root-DDGBWDP6.js +0 -2
- package/dist/cli/chunks/protocol-executor-KBOLLCWA.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-GRXBT7FC.js +0 -2
- package/dist/cli/chunks/queen-coordinator-L2QWMJ5Q.js +0 -2
- package/dist/cli/chunks/real-embeddings-I2UVNNB3.js +0 -2
- package/dist/cli/chunks/router-FT5WJPUH.js +0 -2
- package/dist/cli/chunks/routing-feedback-EO2MKOUX.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-WHBFQJVU.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-YT3APF2I.js +0 -2
- package/dist/cli/chunks/rvf-migration-coordinator-VUIZHTVG.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-37PUFKQD.js +0 -2
- package/dist/cli/chunks/safe-db-TDZKUOZJ.js +0 -2
- package/dist/cli/chunks/schedule-CRKTRY2A.js +0 -2
- package/dist/cli/chunks/scheduler-6ZBDVQWN.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-FFJQAIKW.js +0 -2
- package/dist/cli/chunks/sync-54LUAUTK.js +0 -2
- package/dist/cli/chunks/task-handler-K3OXHYKU.js +0 -62
- package/dist/cli/chunks/test-runner-process-OTQDAJLN.js +0 -2
- package/dist/cli/chunks/token-bootstrap-3QMABE45.js +0 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-D6JTTHTP.js +0 -2
- package/dist/cli/chunks/unified-memory-QARWQKJ2.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-LHY3DXCP.js +0 -2
- package/dist/cli/chunks/unified-persistence-WEYYGLHM.js +0 -2
- package/dist/cli/chunks/visual-security-O4ALMCXQ.js +0 -2
- package/dist/cli/chunks/witness-chain-B3YW5NMS.js +0 -2
- package/dist/cli/chunks/witness-chain-PIYR72HJ.js +0 -2
- package/dist/cli/chunks/witness-chain-repair-YUG7E3UX.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-3ZN2BCGY.js +0 -2
- package/dist/cli/chunks/wrappers-PW2O27LL.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
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.15.16");process.exit(0)}
|
|
2
2
|
var l="defect-intelligence",d=["critical","high","medium","low","info"],m=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function u(e){if(!m(e))return null;let{file:i,probability:t,riskLevel:r}=e;if(typeof i!="string"||i.length===0||typeof t!="number"||!Number.isFinite(t)||t<0||t>1||!d.includes(r))return null;let c=Array.isArray(e.factors)?e.factors.filter(o=>m(o)&&typeof o.name=="string"&&typeof o.contribution=="number"&&Number.isFinite(o.contribution)):[],a=Array.isArray(e.recommendations)?e.recommendations.filter(o=>typeof o=="string"):[];return{file:i,probability:t,riskLevel:r,factors:c,recommendations:a}}function f(e,i){if(!m(e)||typeof e.id!="string"||typeof e.timestamp!="string")return null;let t=Date.parse(e.timestamp);if(!Number.isFinite(t)||t>i+6e4||i-t>6048e5||!Array.isArray(e.predictions)||e.predictions.length===0)return null;let r=e.predictions.map(u);return r.some(c=>c===null)?null:{id:e.id,timestamp:e.timestamp,predictions:r,...e.predictionMethod==="static-code-indicators"?{predictionMethod:"static-code-indicators",estimated:!0,filesSkipped:typeof e.filesSkipped=="number"&&Number.isSafeInteger(e.filesSkipped)&&e.filesSkipped>=0?e.filesSkipped:0}:{}}}async function A(e,i="defect-intelligence:predictor"){let t=`${i}:prediction:`,r=await e.search(`${t}*`,Number.MAX_SAFE_INTEGER,{namespace:l}),c=Date.now(),a=[],o=[];for(let n of r){let s=n.startsWith(`${l}:${t}`)?n.slice(l.length+1):n;if(!s.startsWith(t))continue;let p=f(await e.get(s,{namespace:l}),c);p?a.push({key:s,timestamp:Date.parse(p.timestamp),id:p.id}):o.push(s)}a.sort((n,s)=>s.timestamp-n.timestamp||(n.id===s.id?n.key===s.key?0:n.key>s.key?-1:1:n.id>s.id?-1:1));for(let n of[...o,...a.slice(32).map(s=>s.key)])await e.delete(n,{namespace:l})}function g(e){let i=e.replace(/[.+^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${i.replace(/\*/g,".*").replace(/\?/g,".")}$`,"s")}function y(e,i,t){return g(t).test(e)?e:e.startsWith(`${i}:`)?e.slice(i.length+1):e}var k=1e4,h=32;async function b(e,i,t={}){let r=Math.max(1,Math.floor(t.pageSize??k)),c=await e.search(i,r,t.retrieve);for(let n=1;c.length>=r;n++){if(n>=h)throw new Error(`searchAllKeys('${i}'): the backend never returned a short page after ${n} requests (last limit ${r}); refusing to return a possibly incomplete key list`);r*=2,c=await e.search(i,r,t.retrieve)}let a=t.retrieve?.namespace,o=a?c.map(n=>y(n,a,i)):c;return[...new Set(o)].sort()}export{f as a,A as b,y as c,b as d};
|
|
@@ -0,0 +1,12 @@
|
|
|
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.15.16");process.exit(0)}
|
|
2
|
+
import{a as J,d as V,e as B}from"./chunk-DXD6K2ZP.js";import{b as Q,d as Y}from"./chunk-FLNAW7C4.js";import{c as U,d as ce}from"./chunk-AGRV5B3T.js";import{a as q,e as pe}from"./chunk-KNSRL6NO.js";Y();pe();Y();import*as M from"node:http";import*as $ from"node:https";import{createHash as ue}from"node:crypto";import{URL as Z}from"node:url";var S={model:"Xenova/all-MiniLM-L6-v2",expectedDim:384,connectTimeoutMs:5e3,requestTimeoutMs:3e4,failureThreshold:3,failureWindowMs:6e4},me="AQE embedder endpoint identity canary v1",he="/v1/embeddings";function ee(n){if(n.startsWith("unix:"))return n;try{let e=new Z(n);return e.username||e.password?(e.username="",e.password="",e.toString().replace(/\/$/,"")):n}catch{return n}}function fe(n){if(n.startsWith("unix:")){let r=n.slice(5);if(!r.startsWith("/"))throw new Error(`unix endpoint must be an absolute path: ${n}`);return{transport:"unix",socketPath:r,safeUrl:n}}let e=new Z(n);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 k=class extends Error{constructor(t,r){super(`[EmbedderEndpointClient] ${t} timeout after ${r}ms`);this.phase=t;this.limitMs=r;this.name="EmbedderEndpointTimeoutError"}phase;limitMs},L=class{constructor(e,t,r=()=>{},s=()=>{}){this.threshold=e;this.windowMs=t;this.onRecover=r;this.onTrip=s}threshold;windowMs;onRecover;onTrip;failures=[];trippedAt=null;recordSuccess(){this.failures=[],this.trippedAt=null}recordFailure(e=!1){if(this.trippedAt!==null)return;let t=Date.now();this.failures=this.failures.filter(r=>t-r<this.windowMs),this.failures.push(t),(e||this.failures.length>=this.threshold)&&this.trip()}isOpen(){return this.trippedAt===null?!1:Date.now()-this.trippedAt>=this.windowMs?(this.failures=[],this.trippedAt=null,this.onRecover(),!1):!0}trip(){this.trippedAt=Date.now(),this.onTrip()}getState(){return{open:this.isOpen(),failures:this.failures.length,trippedAt:this.trippedAt}}},O=class{parsed;agent;breaker;opts;cachedIdentity=null;probeInFlight=null;trialPending=!1;inFlight=new Set;constructor(e){if(this.opts={endpoint:e.endpoint,token:e.token,model:e.model??S.model,expectedDim:e.expectedDim??S.expectedDim,connectTimeoutMs:e.connectTimeoutMs??S.connectTimeoutMs,requestTimeoutMs:e.requestTimeoutMs??S.requestTimeoutMs,failureThreshold:e.failureThreshold??S.failureThreshold,failureWindowMs:e.failureWindowMs??S.failureWindowMs,tlsOptions:e.tlsOptions},this.parsed=fe(e.endpoint),this.parsed.transport==="https"){let t=e.tlsOptions??{};this.agent=new $.Agent({keepAlive:!0,ca:t.ca,cert:t.cert,key:t.key,rejectUnauthorized:t.rejectUnauthorized!==!1,servername:t.servername})}else this.agent=new M.Agent({keepAlive:!0});this.breaker=new L(this.opts.failureThreshold,this.opts.failureWindowMs,()=>{this.cachedIdentity=null,this.trialPending=!0},()=>this.abandonInFlight())}abandonInFlight(){if(this.inFlight.size===0)return;let e=new Error(`[EmbedderEndpointClient] circuit breaker opened for ${this.parsed.safeUrl} \u2014 request abandoned`);for(let t of[...this.inFlight])t(e)}needsTrial(){return this.breaker.isOpen()||this.trialPending}startTrialProbe(){this.probeInFlight||this.probe().catch(()=>{this.breaker.trip()})}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`);if(this.cachedIdentity===null){if(this.trialPending)throw this.startTrialProbe(),new Error(`[EmbedderEndpointClient] circuit breaker half-open for ${this.parsed.safeUrl} \u2014 trial probe running, fast-failing`);await this.ensureProbed()}try{let t=await this.postEmbeddings(e),r=this.decodeAndNormalize(t,e.length);return this.breaker.recordSuccess(),r}catch(t){throw this.breaker.recordFailure(t instanceof k),t}}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 s=await this.postEmbeddings([me]);e=this.decodeAndNormalize(s,1)[0],this.breaker.recordSuccess()}catch(s){throw this.breaker.recordFailure(s instanceof k),s}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 t=Buffer.alloc(e.length*2);for(let s=0;s<e.length;s++){let i=Math.max(-32768,Math.min(32767,Math.round(e[s]*32767)));t.writeInt16LE(i,s*2)}let r=ue("sha256").update(t).digest("hex").slice(0,16);return this.cachedIdentity={dim:e.length,fingerprint:r,endpoint:this.parsed.safeUrl},this.trialPending=!1,this.cachedIdentity}getCachedIdentity(){return this.cachedIdentity}getBreakerState(){return this.breaker.getState()}async probeThroughOpenBreaker(){try{return await this.probe()}catch(e){throw this.breaker.trip(),e}}close(){this.agent.destroy()}decodeAndNormalize(e,t){if(!e||typeof e!="object"||!Array.isArray(e.data))throw new Error("[EmbedderEndpointClient] response missing data array");let r=e.data;if(r.length!==t)throw new Error(`[EmbedderEndpointClient] response count mismatch: expected ${t}, got ${r.length}`);let s=r.map((i,a)=>({idx:typeof i.index=="number"?i.index:a,embedding:i.embedding}));return s.sort((i,a)=>i.idx-a.idx),s.map(({embedding:i},a)=>{if(typeof i=="string")throw new Error(`[EmbedderEndpointClient] received base64 embedding at position ${a} \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 ${a}`);if(i.length!==this.opts.expectedDim)throw new Error(`[EmbedderEndpointClient] dim mismatch at position ${a}: expected ${this.opts.expectedDim}, got ${i.length}`);return Q(i)})}postEmbeddings(e){let t=JSON.stringify({model:this.opts.model,input:e,encoding_format:"float"});return this.request(he,t)}request(e,t){let r={"content-type":"application/json","content-length":Buffer.byteLength(t),accept:"application/json"};this.opts.token&&(r.authorization=`Bearer ${this.opts.token}`);let s={method:"POST",path:e,headers:r,agent:this.agent},i,a;this.parsed.transport==="unix"?(i={...s,socketPath:this.parsed.socketPath},a=M.request):(i={...s,host:this.parsed.host,port:this.parsed.port,protocol:this.parsed.protocol},a=this.parsed.transport==="https"?$.request:M.request);let d=this.parsed.safeUrl,p=this.opts.connectTimeoutMs,P=this.opts.requestTimeoutMs;return new Promise((c,_)=>{let y=!1,v=()=>{},D=o=>{y||(y=!0,v(),this.inFlight.delete(C),c(o))},w=o=>{y||(y=!0,v(),this.inFlight.delete(C),_(o))},C=o=>{w(o),f.destroy(o)},f=a(i,o=>{let b=[];o.on("data",h=>b.push(Buffer.from(h))),o.on("end",()=>{let h=Buffer.concat(b).toString("utf-8");if(!o.statusCode||o.statusCode<200||o.statusCode>=300){w(new Error(`[EmbedderEndpointClient] HTTP ${o.statusCode} from ${d}: ${h.slice(0,200)}`));return}try{let T=JSON.parse(h);D(T)}catch(T){w(new Error(`[EmbedderEndpointClient] invalid JSON from ${d}: ${T.message}`))}}),o.on("error",h=>w(h))});f.on("socket",o=>{o.setTimeout(p);let b=()=>{o.setTimeout(P)};o.connecting?o.once("connect",b):b();let h=()=>{let T=o.connecting?"connect":"request",N=o.connecting?p:P,K=new k(T,N);w(K),f.destroy(K)};o.on("timeout",h),v=()=>{o.removeListener("timeout",h),o.removeListener("connect",b)},y&&v()}),f.on("error",o=>w(o)),this.inFlight.add(C),f.write(t),f.end()})}};ce();import{join as te,resolve as ge}from"node:path";import{existsSync as be,mkdirSync as Ee}from"node:fs";import{createRequire as ye}from"node:module";var we=ye(import.meta.url);function ve(){let n=process.env.AQE_MEMORY_PATH;return n&&n.length>0?n===":memory:"?n:ge(U(),n):te(U(),".agentic-qe","memory.db")}var ne="_system",re="embedder_identity:",R=null,W=!1;function ie(){if(R)return R;if(W)return null;try{let n=we("better-sqlite3"),e=ve(),t=te(e,"..");be(t)||Ee(t,{recursive:!0});let r=new n(e);return r.pragma("journal_mode = WAL"),r.pragma("busy_timeout = 5000"),r.exec(`
|
|
3
|
+
CREATE TABLE IF NOT EXISTS kv_store (
|
|
4
|
+
key TEXT NOT NULL,
|
|
5
|
+
namespace TEXT NOT NULL,
|
|
6
|
+
value TEXT NOT NULL,
|
|
7
|
+
expires_at INTEGER,
|
|
8
|
+
created_at INTEGER DEFAULT (strftime('%s', 'now') * 1000),
|
|
9
|
+
PRIMARY KEY (namespace, key)
|
|
10
|
+
);
|
|
11
|
+
CREATE INDEX IF NOT EXISTS idx_kv_namespace ON kv_store(namespace);
|
|
12
|
+
`),R=r,r}catch{return W=!0,null}}function oe(n){let e=ie();if(!e)return null;try{let t=e.prepare("SELECT value FROM kv_store WHERE namespace = ? AND key = ?").get(ne,re+n);if(!t)return null;let r=JSON.parse(t.value);return!r.fingerprint||typeof r.dim!="number"?null:{fingerprint:r.fingerprint,dim:r.dim,endpoint:r.endpoint}}catch{return null}}function se(n){let e=ie();if(!e)return;let t={fingerprint:n.fingerprint,dim:n.dim,endpoint:n.endpoint,updatedAt:Date.now()};e.prepare("INSERT OR REPLACE INTO kv_store (key, namespace, value) VALUES (?, ?, ?)").run(re+n.endpoint,ne,JSON.stringify(t))}function ae(){if(R)try{R.close()}catch{}R=null,W=!1}var j=null,g=null,A=null,E=!1,I="",H=null,u=null,l=null,x=null,X={modelName:"Xenova/all-MiniLM-L6-v2",quantized:!0,enableCache:!0,maxCacheSize:1e4,endpoint:process.env.AQE_EMBEDDER_ENDPOINT,endpointToken:process.env.AQE_EMBEDDER_TOKEN},m=new Map,de=36e5;function G(n){return l?`endpoint:${l.fingerprint}:${n}`:`inproc:${n}`}function le(n){let e=n.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 F(n={},e=!1){if(E&&!e)throw new Error(`Transformer initialization previously failed: ${I}`);if(A)return A;let t={...X,...n};return A=(async()=>{try{if(t.endpoint){let P=ee(t.endpoint);console.log(`[RealEmbeddings] Using external embedder endpoint: ${P}`),u=new O({endpoint:t.endpoint,token:t.endpointToken,model:t.modelName,expectedDim:z()}),l=await u.probe(),x=B({provider:"openai-compatible-endpoint",model:t.modelName,dimensions:l.dim,pooling:"mean",normalized:!0,preprocessingVersion:"aqe-text-v1",implementation:l.endpoint,runtimeFingerprint:l.fingerprint}),console.log(`[RealEmbeddings] Endpoint identity: dim=${l.dim} fingerprint=${l.fingerprint}`);try{let c=oe(l.endpoint);c&&c.fingerprint!==l.fingerprint&&console.warn(`[RealEmbeddings] WARNING: endpoint identity changed since last run. Previous fingerprint=${c.fingerprint} dim=${c.dim}, current fingerprint=${l.fingerprint} dim=${l.dim}. Vectors written before this change may no longer be comparable.`),se(l)}catch(c){console.warn(`[RealEmbeddings] Could not persist endpoint identity: ${q(c)}`)}g=Te(u),E=!1,I="";return}let r;try{r=await import("./transformers-LSLQAARK.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.')}j=r.pipeline,console.log(`[RealEmbeddings] Loading model: ${t.modelName}`);let s=performance.now();g=await j("feature-extraction",t.modelName,{quantized:t.quantized});let i=g;if(!i)throw new Error("Transformer pipeline returned no embedding model");let a=await i(J,{pooling:"mean",normalize:!0}),d=Array.from(a.data);x=B({provider:"huggingface-transformers",model:t.modelName,dimensions:d.length,pooling:"mean",normalized:!0,preprocessingVersion:"aqe-text-v1",implementation:`transformers:${t.quantized?"quantized":"full"}`,runtimeFingerprint:V(d)}),E=!1,I="";let p=performance.now()-s;console.log(`[RealEmbeddings] Model loaded in ${p.toFixed(0)}ms`)}catch(r){throw E=!0,I=q(r),new Error(`Failed to initialize transformer model: ${I}`)}})(),A}function Te(n){return async e=>{let t=Array.isArray(e)?e:[e],r=await n.embed(t),s=r[0]?.length??z(),i=new Float32Array(t.length*s);for(let a=0;a<r.length;a++)i.set(r[a],a*s);return{data:i,dims:[t.length,s]}}}async function _e(n,e={}){let t={...X,...e};if(le(n))return new Array(z()).fill(0);if(g||await F(e),!g)throw new Error("Embedding model failed to initialize");let r=G(n);if(t.enableCache){let p=m.get(r);if(p&&Date.now()-p.timestamp<de)return p.embedding}let s=performance.now(),i=await g(n,{pooling:"mean",normalize:!0}),a=Array.from(i.data),d=performance.now()-s;if(d>500&&console.warn(`[RealEmbeddings] Slow embedding computation: ${d.toFixed(1)}ms for "${n.slice(0,50)}..."`),t.enableCache){if(m.size>=t.maxCacheSize){let p=m.keys().next().value;p&&m.delete(p)}m.set(r,{embedding:a,timestamp:Date.now()})}return a}async function qe(n,e={}){let t={...X,...e},r=[],s=[],i=new Array(n.length).fill(null),a=[];for(let d=0;d<n.length;d++)le(n[d])?i[d]=new Array(z()).fill(0):a.push(d);if(a.length===0)return i;if(g||await F(e),!g)throw new Error("Embedding model failed to initialize");if(t.enableCache)for(let d of a){let p=m.get(G(n[d]));p&&Date.now()-p.timestamp<de?i[d]=p.embedding:(r.push(n[d]),s.push(d))}else for(let d of a)r.push(n[d]),s.push(d);if(r.length>0){let d=performance.now(),p=32;for(let c=0;c<r.length;c+=p){let _=Math.min(c+p,r.length),y=r.slice(c,_),v=await g(y,{pooling:"mean",normalize:!0}),D=v.dims||[y.length,384],w=D[0],C=D[1];for(let f=0;f<w;f++){let o=f*C,b=Array.from(v.data.slice(o,o+C)),h=c+f,T=s[h];if(i[T]=b,t.enableCache){if(m.size>=t.maxCacheSize){let N=m.keys().next().value;N&&m.delete(N)}m.set(G(r[h]),{embedding:b,timestamp:Date.now()})}}}let P=performance.now()-d;console.log(`[RealEmbeddings] Batch computed ${r.length} embeddings in ${P.toFixed(0)}ms`)}return i.filter(d=>d!==null)}function Ue(){m.clear(),console.log("[RealEmbeddings] Cache cleared")}function Be(){return{size:m.size,hitRate:0}}function Le(){return!E&&g!==null}function z(){return 384}function We(){j=null,g=null,A=null,E=!1,I="",m.clear(),u&&u.close(),u=null,l=null,x=null,ae()}function He(){E&&(E=!1,I="",A=null,u&&u.close(),u=null,l=null)}async function je(n={}){if(E)return H??=Ie(n).finally(()=>{H=null}),H;let e=u;if(!e||!e.needsTrial())return;let t=await e.probeThroughOpenBreaker();if(l&&t.fingerprint!==l.fingerprint)throw new Error(`[RealEmbeddings] endpoint identity changed since this process bound to it (fingerprint ${l.fingerprint} -> ${t.fingerprint}); restart to use the new embedding space`)}async function Ie(n){u&&u.close(),u=null,l=null,A=null,await F(n,!0)}function Ge(){return u!==null}function Xe(){return l}function Ke(){return x}async function Qe(){if(x)return x;let n=process.env.AQE_EMBEDDER_ENDPOINT;return n?(await F({endpoint:n,endpointToken:process.env.AQE_EMBEDDER_TOKEN}),x):null}export{ee as a,X as b,_e as c,qe as d,Ue as e,Be as f,Le as g,z as h,We as i,He as j,je as k,Ge as l,Xe as m,Ke as n,Qe as o};
|
|
@@ -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.15.16");process.exit(0)}
|
|
2
|
+
import{a as r,e as a}from"./chunk-MO55CVMT.js";a();var e=!1;function n(t){if(!e){for(let i of["ALTER TABLE routing_outcomes ADD COLUMN exploration INTEGER NOT NULL DEFAULT 0","ALTER TABLE routing_outcomes ADD COLUMN criticality REAL","ALTER TABLE routing_outcomes ADD COLUMN q_weight REAL"])try{t.prepare(i).run()}catch(o){if(r(o))throw o}try{t.prepare("CREATE INDEX IF NOT EXISTS idx_routing_outcomes_exploration ON routing_outcomes(exploration)").run()}catch{}e=!0}}export{n as a};
|
|
@@ -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.15.
|
|
2
|
-
import{a as $}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.15.16");process.exit(0)}
|
|
2
|
+
import{a as $}from"./chunk-C6D5AHBO.js";import{i as q}from"./chunk-HGWXF45W.js";import{A as V,B as K}from"./chunk-MO55CVMT.js";import{a as N,c as y,d}from"./chunk-LE4QJREF.js";import{a as k,b as M,e as Q}from"./chunk-KNSRL6NO.js";import{f as H}from"./chunk-AJMJNQMP.js";Q();var v={WorkflowStarted:"workflow.WorkflowStarted",WorkflowCompleted:"workflow.WorkflowCompleted",WorkflowFailed:"workflow.WorkflowFailed",WorkflowCancelled:"workflow.WorkflowCancelled",StepStarted:"workflow.StepStarted",StepCompleted:"workflow.StepCompleted",StepFailed:"workflow.StepFailed",StepSkipped:"workflow.StepSkipped",StepAwaitingApproval:"workflow.StepAwaitingApproval",StepApproved:"workflow.StepApproved",StepRejected:"workflow.StepRejected"},O={maxConcurrentWorkflows:10,defaultStepTimeout:6e4,defaultWorkflowTimeout:6e5,enableEventTriggers:!0,persistExecutions:!0};import{createHash as J}from"node:crypto";function R(s){if(["__proto__","constructor","prototype"].includes(s.id))throw new Error(`parallel_output_invalid_path: unsafe step ID ${s.id}`);let e=[{stepId:s.id,path:s.id,segments:[s.id]}];for(let t of Object.values(s.outputMapping??{}).sort()){let i=t.split(".");if(i.some(r=>!r||["__proto__","constructor","prototype"].includes(r)))throw new Error(`parallel_output_invalid_path: ${s.id} maps to ${t}`);e.push({stepId:s.id,path:t,segments:i})}return e}function j(s){let e=s.flatMap(R),t=[];for(let i=0;i<e.length;i++)for(let r=i+1;r<e.length;r++){let o=e[i],a=e[r];if(o.stepId===a.stepId)continue;let n=Math.min(o.segments.length,a.segments.length);o.segments.slice(0,n).every((c,l)=>c===a.segments[l])&&t.push({pathA:o.path,stepA:o.stepId,pathB:a.path,stepB:a.stepId,kind:o.segments.length===a.segments.length?"exact":"ancestor-descendant"})}return t}function L(s){let e=[];for(let t of s){let i=[...Object.values(t.inputMapping??{}),t.condition?.path,t.skipCondition?.path].filter(r=>typeof r=="string");for(let r of i)for(let o of s){if(o.id===t.id)continue;if(r==="results"){e.push({stepId:t.id,sourcePath:r,otherStepId:o.id});continue}if(!r.startsWith("results."))continue;let a=r.slice(8).split(".");R(o).some(c=>{let l=Math.min(a.length,c.segments.length);return c.segments.slice(0,l).every((f,S)=>f===a[S])})&&e.push({stepId:t.id,sourcePath:r,otherStepId:o.id})}}return e}function x(s,e){if(s===null||typeof s=="string"||typeof s=="boolean")return s;if(typeof s=="number")return["number",String(s)];if(typeof s=="bigint")return["bigint",String(s)];if(s===void 0)return["undefined"];if(typeof s!="object")throw new Error("parallel_output_unhashable");if(e.has(s))throw new Error("parallel_output_cyclic");e.add(s);try{if(s instanceof Date)return["date",s.toISOString()];if(s instanceof ArrayBuffer)return["bytes",Buffer.from(s).toString("base64")];if(ArrayBuffer.isView(s))return["bytes",s.constructor.name,Buffer.from(s.buffer,s.byteOffset,s.byteLength).toString("base64")];if(Array.isArray(s))return["array",s.map(i=>x(i,e))];if(s instanceof Set)return["set",[...s].map(r=>x(r,e)).sort((r,o)=>JSON.stringify(r).localeCompare(JSON.stringify(o)))];if(s instanceof Map)return["map",[...s].map(([r,o])=>[x(r,e),x(o,e)]).sort((r,o)=>JSON.stringify(r).localeCompare(JSON.stringify(o)))];let t=s;return["object",Object.keys(t).sort().map(i=>[i,x(t[i],e)])]}finally{e.delete(s)}}function A(s){let e=JSON.stringify(x(s,new Set));return J("sha256").update(e).digest("hex")}var X="qe-coverage-analysis",T=`(agent_id != '${X}' OR (CASE WHEN json_valid(context_json) THEN json_extract(context_json, '$.measured') END) = 1)`;function P(){try{let{getUnifiedMemory:s}=(K(),H(V)),e=s();return e.isInitialized()?e.getDatabase():null}catch{return null}}var Y={id:"quality-gate-check",domain:"quality-assessment",action:"gate-check",async execute(s){let e=typeof s.coverageMin=="number"?s.coverageMin:80,t=typeof s.testsPassingMin=="number"?s.testsPassingMin:90,i=typeof s.maxBugs=="number"?s.maxBugs:5,r=typeof s.currentCoverage=="number"?s.currentCoverage:null,o=typeof s.currentTestsPassingRate=="number"?s.currentTestsPassingRate:null,a=typeof s.currentBugs=="number"?s.currentBugs:null;if(r===null||o===null||a===null){let b=P();if(b)try{if(r===null){let h=b.prepare(`SELECT after_lines FROM coverage_sessions WHERE ${T} ORDER BY created_at DESC LIMIT 1`).get();r=typeof h?.after_lines=="number"?h.after_lines:null}if(o===null){let h=b.prepare(`SELECT COUNT(*) as total,
|
|
3
3
|
SUM(CASE WHEN passed = 1 THEN 1 ELSE 0 END) as passed
|
|
4
4
|
FROM test_outcomes
|
|
5
5
|
WHERE created_at > datetime('now', '-7 days')`).get();o=h&&h.total>0?h.passed/h.total*100:0}a===null&&(a=b.prepare(`SELECT COUNT(*) as bugs FROM test_outcomes
|
|
@@ -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.15.
|
|
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.15.16");process.exit(0)}
|
|
2
2
|
var l=["var-to-const","add-types","remove-console","promise-to-async","cjs-to-esm","func-to-arrow"],p={"var-to-const":{type:"var-to-const",name:"Var to Const/Let",description:"Convert var declarations to const (if not reassigned) or let (if reassigned)",complexity:"simple",wasmAvailable:!0,typicalLatencyMs:1},"add-types":{type:"add-types",name:"Add TypeScript Types",description:"Add TypeScript type annotations to function parameters and return types",complexity:"moderate",wasmAvailable:!0,typicalLatencyMs:5},"remove-console":{type:"remove-console",name:"Remove Console Statements",description:"Remove all console.log, console.warn, console.error, etc. statements",complexity:"simple",wasmAvailable:!0,typicalLatencyMs:1},"promise-to-async":{type:"promise-to-async",name:"Promise to Async/Await",description:"Convert Promise .then()/.catch() chains to async/await syntax",complexity:"complex",wasmAvailable:!0,typicalLatencyMs:10},"cjs-to-esm":{type:"cjs-to-esm",name:"CommonJS to ES Modules",description:"Convert require() calls to import statements and module.exports to export",complexity:"moderate",wasmAvailable:!0,typicalLatencyMs:5},"func-to-arrow":{type:"func-to-arrow",name:"Function to Arrow",description:"Convert function declarations and expressions to arrow functions",complexity:"moderate",wasmAvailable:!0,typicalLatencyMs:3}},u={enabled:!0,fallbackToLLM:!0,confidenceThreshold:.7,transforms:[],maxFileSizeBytes:1024*1024,timeoutMs:5e3,cacheEnabled:!0,cacheTtlMs:300*1e3},t=class extends Error{constructor(e,s,o){super(e);this.code=s;this.cause=o;this.name="AgentBoosterError"}code;cause},a=class extends t{constructor(e,s,o){super(e,"TRANSFORM_ERROR",o);this.transformType=s;this.name="TransformError"}transformType},i=class extends t{constructor(r="WASM module is not available",e){super(r,"WASM_UNAVAILABLE",e),this.name="WasmUnavailableError"}},c=class extends t{constructor(e,s,o){super(e,"TRANSFORM_TIMEOUT");this.transformType=s;this.timeoutMs=o;this.name="TransformTimeoutError"}transformType;timeoutMs},m=class extends t{constructor(e,s,o){super(`File ${e} is too large (${s} bytes, max ${o} bytes)`,"FILE_TOO_LARGE");this.filePath=e;this.sizeBytes=s;this.maxSizeBytes=o;this.name="FileTooLargeError"}filePath;sizeBytes;maxSizeBytes};export{l as a,p as b,u as c,a as d,i as e,c as f,m as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as o,b as s,c as n,f as a}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.15.16");process.exit(0)}
|
|
2
|
+
import{a as o,b as s,c as n,f as a}from"./chunk-U2A7NHZA.js";a();import{existsSync as d,statSync as l}from"node:fs";import{join as u,resolve as p}from"node:path";function c(r=process.cwd(),t=process.env){return p(r,t.AQE_PROJECT_ROOT||".")}function E(r,t){return(t?o(r)||s(r)&&!d(u(r,".git")):n(r))?`Refusing to initialize in "${r}": it is a shared temp/system directory, so a store here would be shared by every unrelated project below it and later commands would not use it. Create a project directory first (mkdir my-project && cd my-project) or set AQE_PROJECT_ROOT to a project directory.`:null}function O(r,t=process.env){return E(c(r,t),!!t.AQE_PROJECT_ROOT)}function h(r=process.cwd(),t=process.env){if(!t.AQE_PROJECT_ROOT)return null;let e=c(r,t),i=!1;try{i=l(e).isDirectory()}catch{i=!1}return i?null:`AQE_PROJECT_ROOT "${e}" is not an existing directory. Create it first (mkdir -p) or correct the path; aqe init does not create the project root.`}export{c as a,E as b,O as c,h as d};
|
|
@@ -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.15.
|
|
2
|
-
import{d 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.15.16");process.exit(0)}
|
|
2
|
+
import{d as z,f as It}from"./chunk-CEYSYSK5.js";import{a as Y,c as Ct}from"./chunk-WP4RETKG.js";import{a as Se,b as he,c as Re,d as Rt}from"./chunk-JDIYMZCQ.js";import{b as I,d as Ne}from"./chunk-V5NHZV7S.js";import{a as K,b as $,c as V,d as Ae,e as Ot}from"./chunk-S75SOOZL.js";import{a as Ie,d as F,e as Ce,f as Oe}from"./chunk-PPUZWYUG.js";import{a as U,b as Le,e as Lt}from"./chunk-CRPIYUTJ.js";import{a as be,c as ve,d as At}from"./chunk-J4ELZNLY.js";import{a as Nt}from"./chunk-YAPLJR7K.js";import{c as me}from"./chunk-G5RHFBAY.js";import{a as W,c as X,d as St}from"./chunk-AGRV5B3T.js";import{d as fe,e as ht}from"./chunk-KPRCB5LT.js";import{a as A,e as _e}from"./chunk-KNSRL6NO.js";import{b as h,d as ft}from"./chunk-AJMJNQMP.js";function Q(n){return ye===null?n:Math.min(n,ye)}var ye,De=h(()=>{"use strict";ye=null});function J(n){let e=n?.code;if(typeof e=="string"&&/^SQLITE_(BUSY|LOCKED)/.test(e))return!0;let t=n instanceof Error?n.message:String(n);return/database is locked|database table is locked|SQLITE_BUSY/i.test(t)}function Z(n,e,t){let s=n.pragma("busy_timeout",{simple:!0});n.pragma(`busy_timeout = ${e}`);try{return t()}finally{try{n.pragma(`busy_timeout = ${s}`)}catch{}}}async function Xe(n,e,t={}){let s=t.waitMs??200,r=t.budgetMs??6e4,c=t.sleep??(d=>new Promise(u=>setTimeout(u,d))),a=t.now??Date.now,T=a(),l=25;for(;;){if(t.shouldContinue&&!t.shouldContinue())throw t.cancelledError?.()??new Error("Cancelled while waiting for a locked database");try{return Z(n,s,e)}catch(d){if(!J(d)||a()-T+l>=r)throw d}await c(l),l=Math.min(l*2,1e3)}}var Wt,Ue=h(()=>{"use strict";Wt=1e3});import{createHash as xe}from"node:crypto";function vt(n){let e=Buffer.alloc(8);return e.writeBigUInt64LE(BigInt(n)),e}function yt(n){return typeof n=="string"?Buffer.from(n,"utf8"):n instanceof Uint8Array?Buffer.from(n):Buffer.from(ee(n),"utf8")}function ee(n){return n===null||typeof n!="object"?JSON.stringify(n)??"null":Array.isArray(n)?`[${n.map(ee).join(",")}]`:`{${Object.keys(n).sort().map(t=>`${JSON.stringify(t)}:${ee(n[t])}`).join(",")}}`}function Me(...n){let e=xe("sha256");for(let t of n)e.update(t);return e.digest()}function Fe(n,e,t){return Me(bt,n,e,vt(t))}var bt,we,b,Ge=h(()=>{"use strict";bt=Buffer.from("ruvector:chain:"),we=xe("sha256").update("ruvector-proof-gate-v1").digest();b=class n{seq=0;prev=we;chain=[];payloadHashes=[];admit(e){let t=Me(yt(e)),s=Fe(this.prev,t,this.seq);this.prev=s,this.chain.push(s),this.payloadHashes.push(t);let r={sequence:this.seq,payloadHash:t.toString("hex"),chainCommitment:s.toString("hex")};return this.seq+=1,r}verifyReceipt(e){return e.sequence>=0&&e.sequence<this.chain.length&&this.chain[e.sequence].toString("hex")===e.chainCommitment}chainRoot(){return this.prev.toString("hex")}get length(){return this.seq}get isEmpty(){return this.seq===0}verifyIntegrity(){if(this.chain.length!==this.payloadHashes.length)return!1;let e=we;for(let t=0;t<this.chain.length;t++){if(!Fe(e,this.payloadHashes[t],t).equals(this.chain[t]))return!1;e=this.chain[t]}return e.equals(this.prev)}toJSON(){return{seq:this.seq,head:this.prev.toString("hex"),chain:this.chain.map(e=>e.toString("hex")),payloadHashes:this.payloadHashes.map(e=>e.toString("hex"))}}static fromJSON(e){let t=new n;t.seq=e.seq,t.prev=Buffer.from(e.head,"hex");for(let s of e.chain)t.chain.push(Buffer.from(s,"hex"));for(let s of e.payloadHashes)t.payloadHashes.push(Buffer.from(s,"hex"));return t}}});function v(n){if(!te.has(n))throw new Error(`Invalid table name: "${n}" is not in the allowlist`);return n}function $t(n){let e=n.split(".");if(e.length>2)throw new Error(`Invalid SQL identifier: "${n}" has too many parts (max: schema.table)`);for(let t of e)if(!Pe.test(t))throw new Error(`Invalid SQL identifier: "${n}" \u2014 part "${t}" does not match pattern ${Pe}`);return n}var te,Pe,ne=h(()=>{"use strict";te=new Set(["schema_version","kv_store","vectors","rl_q_values","goap_goals","goap_actions","goap_plans","goap_plan_signatures","concept_nodes","concept_edges","dream_cycles","dream_insights","qe_patterns","qe_pattern_embeddings","qe_pattern_usage","qe_trajectories","embeddings","execution_results","executed_steps","mincut_snapshots","mincut_history","mincut_weak_vertices","mincut_alerts","mincut_healing_actions","mincut_observations","sona_patterns","sona_fisher_matrices","test_outcomes","routing_outcomes","coverage_sessions","patterns","hypergraph_nodes","hypergraph_edges","hypergraph_vertices","hypergraph_hyperedges","hypergraph_edge_vertices","hypergraph_vertex_properties","hypergraph_edge_properties","captured_experiences","experience_applications","witness_chain","witness_chain_receipts","witness_chain_archive","trajectories","trajectory_steps","pattern_evolution_events","pattern_relationships","pattern_versions","learning_daily_snapshots","metrics_outcomes","experience_consolidation_log","qe_pattern_reuse","learning_evidence_manifests","learning_evidence_segments","learning_segment_edges","learning_evidence_admissions","pattern_manifest_lineage","pattern_segment_lineage","qe_agent_co_execution"]);Pe=/^[a-z_][a-z0-9_]{0,62}$/});function qe(n){n.exec(ke),n.exec(`
|
|
3
3
|
INSERT OR IGNORE INTO learning_evidence_manifests (
|
|
4
4
|
id, trajectory_id, trajectory_hash, manifest_hash, task_family,
|
|
5
5
|
outcome, oracle_refs_json, source_kind, process_signals_json
|
|
@@ -23,7 +23,7 @@ import{d as W,f as lt}from"./chunk-6NIGSY5L.js";import{b as I,d as _e}from"./chu
|
|
|
23
23
|
pattern_id, manifest_id, use_kind
|
|
24
24
|
)
|
|
25
25
|
SELECT id, 'legacy-pattern:' || id, 'legacy-context' FROM qe_patterns;
|
|
26
|
-
`)}var
|
|
26
|
+
`)}var ke,re=h(()=>{"use strict";ke=`
|
|
27
27
|
CREATE TABLE IF NOT EXISTS learning_evidence_manifests (
|
|
28
28
|
id TEXT PRIMARY KEY,
|
|
29
29
|
trajectory_id TEXT,
|
|
@@ -131,8 +131,8 @@ import{d as W,f as lt}from"./chunk-6NIGSY5L.js";import{b as I,d as _e}from"./chu
|
|
|
131
131
|
BEGIN SELECT RAISE(ABORT, 'learning evidence admissions are append-only'); END;
|
|
132
132
|
CREATE TRIGGER IF NOT EXISTS learning_admissions_no_delete BEFORE DELETE ON learning_evidence_admissions
|
|
133
133
|
BEGIN SELECT RAISE(ABORT, 'learning evidence admissions are append-only'); END;
|
|
134
|
-
`});var
|
|
135
|
-
CREATE TABLE IF NOT EXISTS ${
|
|
134
|
+
`});var Be,Dt,se,je=h(()=>{"use strict";Be="dream_insights_archive",Dt=`
|
|
135
|
+
CREATE TABLE IF NOT EXISTS ${Be} (
|
|
136
136
|
archive_id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
137
137
|
id TEXT NOT NULL,
|
|
138
138
|
cycle_id TEXT,
|
|
@@ -148,17 +148,17 @@ import{d as W,f as lt}from"./chunk-6NIGSY5L.js";import{b as I,d as _e}from"./chu
|
|
|
148
148
|
created_at TEXT,
|
|
149
149
|
archived_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
150
150
|
)
|
|
151
|
-
`,
|
|
152
|
-
${
|
|
151
|
+
`,se=`
|
|
152
|
+
${Dt};
|
|
153
153
|
-- The sweep's read-back looks copies up by insight id.
|
|
154
|
-
CREATE INDEX IF NOT EXISTS idx_dream_insights_archive_id ON ${
|
|
155
|
-
`});var C,
|
|
154
|
+
CREATE INDEX IF NOT EXISTS idx_dream_insights_archive_id ON ${Be}(id);
|
|
155
|
+
`});var C,He,We,ze,Ye,ie,Ke,oe,y,ae,$e,Ve,Qe,Je,Ze,et,tt,ce=h(()=>{"use strict";It();Ct();re();je();C=14,He=`
|
|
156
156
|
CREATE TABLE IF NOT EXISTS schema_version (
|
|
157
157
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
158
158
|
version INTEGER NOT NULL,
|
|
159
159
|
migrated_at TEXT DEFAULT (datetime('now'))
|
|
160
160
|
);
|
|
161
|
-
`,
|
|
161
|
+
`,We=`
|
|
162
162
|
-- Key-Value Store (v2 compatible - same schema as HybridBackend)
|
|
163
163
|
CREATE TABLE IF NOT EXISTS kv_store (
|
|
164
164
|
key TEXT NOT NULL,
|
|
@@ -170,7 +170,7 @@ import{d as W,f as lt}from"./chunk-6NIGSY5L.js";import{b as I,d as _e}from"./chu
|
|
|
170
170
|
);
|
|
171
171
|
CREATE INDEX IF NOT EXISTS idx_kv_namespace ON kv_store(namespace);
|
|
172
172
|
CREATE INDEX IF NOT EXISTS idx_kv_expires ON kv_store(expires_at) WHERE expires_at IS NOT NULL;
|
|
173
|
-
`,
|
|
173
|
+
`,ze=`
|
|
174
174
|
-- Vector Embeddings (new in v3 - replaces in-memory AgentDB)
|
|
175
175
|
CREATE TABLE IF NOT EXISTS vectors (
|
|
176
176
|
id TEXT PRIMARY KEY,
|
|
@@ -183,7 +183,7 @@ import{d as W,f as lt}from"./chunk-6NIGSY5L.js";import{b as I,d as _e}from"./chu
|
|
|
183
183
|
);
|
|
184
184
|
CREATE INDEX IF NOT EXISTS idx_vectors_namespace ON vectors(namespace);
|
|
185
185
|
CREATE INDEX IF NOT EXISTS idx_vectors_dimensions ON vectors(dimensions);
|
|
186
|
-
`,
|
|
186
|
+
`,Ye=`
|
|
187
187
|
-- Q-Values for RL algorithms (ADR-046)
|
|
188
188
|
CREATE TABLE IF NOT EXISTS rl_q_values (
|
|
189
189
|
id TEXT PRIMARY KEY,
|
|
@@ -204,7 +204,7 @@ import{d as W,f as lt}from"./chunk-6NIGSY5L.js";import{b as I,d as _e}from"./chu
|
|
|
204
204
|
CREATE INDEX IF NOT EXISTS idx_qvalues_state ON rl_q_values(agent_id, state_key);
|
|
205
205
|
CREATE INDEX IF NOT EXISTS idx_qvalues_domain ON rl_q_values(domain);
|
|
206
206
|
CREATE INDEX IF NOT EXISTS idx_qvalues_updated ON rl_q_values(updated_at);
|
|
207
|
-
`,
|
|
207
|
+
`,ie=`
|
|
208
208
|
-- GOAP Goals
|
|
209
209
|
CREATE TABLE IF NOT EXISTS goap_goals (
|
|
210
210
|
id TEXT PRIMARY KEY,
|
|
@@ -315,7 +315,7 @@ import{d as W,f as lt}from"./chunk-6NIGSY5L.js";import{b as I,d as _e}from"./chu
|
|
|
315
315
|
-- would fail on "no such column" since CREATE TABLE IF NOT EXISTS above
|
|
316
316
|
-- silently no-ops against them. unified-memory.ts's v11 migration creates
|
|
317
317
|
-- this index only after confirming/backfilling the column.
|
|
318
|
-
`,
|
|
318
|
+
`,Ke=`
|
|
319
319
|
-- Concept Graph Nodes (Dream Engine)
|
|
320
320
|
CREATE TABLE IF NOT EXISTS concept_nodes (
|
|
321
321
|
id TEXT PRIMARY KEY,
|
|
@@ -384,13 +384,13 @@ import{d as W,f as lt}from"./chunk-6NIGSY5L.js";import{b as I,d as _e}from"./chu
|
|
|
384
384
|
CREATE INDEX IF NOT EXISTS idx_edge_weight ON concept_edges(weight DESC);
|
|
385
385
|
CREATE INDEX IF NOT EXISTS idx_insight_cycle ON dream_insights(cycle_id);
|
|
386
386
|
CREATE INDEX IF NOT EXISTS idx_dream_status ON dream_cycles(status);
|
|
387
|
-
`,
|
|
387
|
+
`,oe=`
|
|
388
388
|
CREATE VIRTUAL TABLE IF NOT EXISTS qe_patterns_fts USING fts5(
|
|
389
389
|
name, description, pattern_type, qe_domain,
|
|
390
390
|
content='qe_patterns',
|
|
391
391
|
content_rowid='rowid'
|
|
392
392
|
);
|
|
393
|
-
`,
|
|
393
|
+
`,y=Object.freeze({qe_patterns_fts_insert:`
|
|
394
394
|
CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_insert AFTER INSERT ON qe_patterns BEGIN
|
|
395
395
|
INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
|
|
396
396
|
VALUES (new.rowid, new.name, new.description, new.pattern_type, new.qe_domain);
|
|
@@ -407,7 +407,7 @@ import{d as W,f as lt}from"./chunk-6NIGSY5L.js";import{b as I,d as _e}from"./chu
|
|
|
407
407
|
INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
|
|
408
408
|
VALUES (new.rowid, new.name, new.description, new.pattern_type, new.qe_domain);
|
|
409
409
|
END;
|
|
410
|
-
`}),
|
|
410
|
+
`}),ae=oe+Object.values(y).join(""),$e=n=>`
|
|
411
411
|
-- QE Patterns table (unified from sqlite-persistence.ts)
|
|
412
412
|
CREATE TABLE IF NOT EXISTS qe_patterns (
|
|
413
413
|
id TEXT PRIMARY KEY,
|
|
@@ -537,7 +537,7 @@ import{d as W,f as lt}from"./chunk-6NIGSY5L.js";import{b as I,d as _e}from"./chu
|
|
|
537
537
|
CREATE INDEX IF NOT EXISTS idx_execution_results_status ON execution_results(status);
|
|
538
538
|
CREATE INDEX IF NOT EXISTS idx_executed_steps_execution ON executed_steps(execution_id);
|
|
539
539
|
CREATE INDEX IF NOT EXISTS idx_executed_steps_action ON executed_steps(action_id);
|
|
540
|
-
`,
|
|
540
|
+
`,Ve=$e(ae),Qe=$e(""),Je=`
|
|
541
541
|
-- MinCut Graph Snapshots (ADR-047)
|
|
542
542
|
CREATE TABLE IF NOT EXISTS mincut_snapshots (
|
|
543
543
|
id TEXT PRIMARY KEY,
|
|
@@ -643,7 +643,7 @@ import{d as W,f as lt}from"./chunk-6NIGSY5L.js";import{b as I,d as _e}from"./chu
|
|
|
643
643
|
CREATE INDEX IF NOT EXISTS idx_mincut_healing_type ON mincut_healing_actions(action_type);
|
|
644
644
|
CREATE INDEX IF NOT EXISTS idx_mincut_healing_success ON mincut_healing_actions(success);
|
|
645
645
|
CREATE INDEX IF NOT EXISTS idx_mincut_observations_iter ON mincut_observations(iteration);
|
|
646
|
-
`,
|
|
646
|
+
`,Ze=`
|
|
647
647
|
-- SONA Patterns table (ADR-046: Pattern Persistence for Neural Backbone)
|
|
648
648
|
CREATE TABLE IF NOT EXISTS sona_patterns (
|
|
649
649
|
id TEXT PRIMARY KEY,
|
|
@@ -669,7 +669,7 @@ import{d as W,f as lt}from"./chunk-6NIGSY5L.js";import{b as I,d as _e}from"./chu
|
|
|
669
669
|
CREATE INDEX IF NOT EXISTS idx_sona_patterns_domain ON sona_patterns(domain);
|
|
670
670
|
CREATE INDEX IF NOT EXISTS idx_sona_patterns_confidence ON sona_patterns(confidence DESC);
|
|
671
671
|
CREATE INDEX IF NOT EXISTS idx_sona_patterns_updated ON sona_patterns(updated_at DESC);
|
|
672
|
-
`,
|
|
672
|
+
`,et=`
|
|
673
673
|
-- Test outcomes (ADR-023: Quality Feedback Loop)
|
|
674
674
|
CREATE TABLE IF NOT EXISTS test_outcomes (
|
|
675
675
|
id TEXT PRIMARY KEY,
|
|
@@ -752,26 +752,26 @@ import{d as W,f as lt}from"./chunk-6NIGSY5L.js";import{b as I,d as _e}from"./chu
|
|
|
752
752
|
CREATE INDEX IF NOT EXISTS idx_coverage_sessions_technique ON coverage_sessions(technique);
|
|
753
753
|
CREATE INDEX IF NOT EXISTS idx_coverage_sessions_agent ON coverage_sessions(agent_id);
|
|
754
754
|
CREATE INDEX IF NOT EXISTS idx_coverage_sessions_created ON coverage_sessions(created_at);
|
|
755
|
-
`,
|
|
756
|
-
WHERE NOT EXISTS (SELECT 1 FROM qe_patterns_fts_docsize d WHERE d.id = p.rowid)`):0;return{hasTable:e,hasDocsize:t,missingTriggers:s,mismatchedTriggers:r,patterns:a,indexed:T,unindexed:l}}function Ye(n){return!n.hasTable||n.missingTriggers.length>0||n.mismatchedTriggers.length>0?!0:n.hasDocsize?n.indexed!==n.patterns||n.unindexed>0:!1}function Lt(n){if(n.readonly)return!0;try{return Number(n.pragma("query_only",{simple:!0}))===1}catch{return!1}}function $e(n,e={}){let t=e.log??(c=>console.warn(c)),s=e.logPrefix??"[PatternFTS]",r={status:"healthy",createdTable:!1,recreatedTriggers:[],replacedTriggers:[],rebuilt:!1,patternsBefore:-1,indexedBefore:-1,indexedAfter:-1};try{if(!oe(n,"table","qe_patterns"))return r.status="no-patterns",r;if(Lt(n))return r.status="readonly",r;let c=We(n);if(r.patternsBefore=c.patterns,r.indexedBefore=c.indexed,!Ye(c))return r;let a=n.transaction(()=>{let T=We(n);if(!Ye(T))return null;T.hasTable||n.exec(re);for(let l of T.missingTriggers)n.exec(D[l]);for(let l of T.mismatchedTriggers)n.exec(`DROP TRIGGER IF EXISTS ${l}`),n.exec(D[l]);return n.exec("INSERT INTO qe_patterns_fts(qe_patterns_fts) VALUES('rebuild')"),{s:T,indexedAfter:w(n,"SELECT count(*) AS n FROM qe_patterns_fts_docsize")}}).immediate();if(a){let{s:T}=a;r.createdTable=!T.hasTable,r.recreatedTriggers=[...T.missingTriggers],r.replacedTriggers=[...T.mismatchedTriggers],r.patternsBefore=T.patterns,r.indexedBefore=T.indexed,r.indexedAfter=a.indexedAfter,r.rebuilt=!0}if(r.rebuilt){r.status="healed";let T=[];r.createdTable&&T.push("created qe_patterns_fts"),r.recreatedTriggers.length>0&&T.push(`recreated triggers [${r.recreatedTriggers.join(", ")}]`),r.replacedTriggers.length>0&&T.push(`replaced triggers [${r.replacedTriggers.join(", ")}]`);let l=r.indexedBefore<0?"n/a":String(r.indexedBefore);T.push(`rebuilt index (indexed ${l} -> ${r.indexedAfter}, qe_patterns ${r.patternsBefore})`),t(`${s} Healed qe_patterns FTS5 index: ${T.join("; ")}`)}return r}catch(c){r.status="failed",r.error=A(c);try{t(`${s} qe_patterns FTS5 self-heal skipped: ${r.error} (keyword search may be degraded; vector search unaffected)`)}catch{}return r}}var ht,Rt,Ve=R(()=>{"use strict";le();ie();ht=Object.keys(D);Rt=Object.freeze(Object.fromEntries(Object.entries(D).map(([n,e])=>[n,Ke(e)])))});function ae(n){if(!Number.isFinite(n))throw new RangeError("LWW register timestamp must be a finite number")}function M(n,e,t){let s=t??(e!==void 0?Date.now():0);ae(s);let r={value:e,timestamp:s,nodeId:e!==void 0?n:"",version:e!==void 0?1:0,lastUpdated:Date.now()};function c(a,T,l,u){return a!==l?a-l:T===u?0:T>u?1:-1}return{get(){return r.value},set(a,T){let l=T??Date.now();ae(l),T===void 0&&r.version>0&&r.nodeId===n&&l<=r.timestamp&&(l=r.timestamp+1),(r.version===0||c(l,n,r.timestamp,r.nodeId)>0)&&(r={value:a,timestamp:l,nodeId:n,version:r.version+1,lastUpdated:Date.now()})},merge(a){let T=a.getState();this.applyState(T)},getState(){return{value:r.value,timestamp:r.timestamp,nodeId:r.nodeId,version:r.version,lastUpdated:r.lastUpdated}},applyState(a){a.version!==0&&(ae(a.timestamp),(r.version===0||c(a.timestamp,a.nodeId,r.timestamp,r.nodeId)>0)&&(r={value:a.value,timestamp:a.timestamp,nodeId:a.nodeId,version:Math.max(r.version,a.version)+1,lastUpdated:Date.now()}))},getNodeId(){return n},getTimestamp(){return r.timestamp}}}function G(n,e){let t=M(n);return t.applyState(e),t}var ce=R(()=>{"use strict"});function O(n){let e={counts:K(),version:0,lastUpdated:Date.now()};return V(e.counts,n,0),{get(){return Object.values(e.counts).reduce((t,s)=>t+s,0)},increment(t=1){if(t<0)throw new Error("G-Counter can only increment by positive values");t!==0&&(he(e.counts,n,t),e.version++,e.lastUpdated=Date.now())},merge(t){let s=t.getState();this.applyState(s)},getState(){return{counts:Object.assign(K(),e.counts),version:e.version,lastUpdated:e.lastUpdated}},applyState(t){let s=!1;for(let[r,c]of Object.entries(t.counts)){let a=$(e.counts,r)??0;c>a&&(V(e.counts,r,c),s=!0)}s&&(e.version=Math.max(e.version,t.version)+1,e.lastUpdated=Date.now())},getNodeId(){return n},getLocalCount(){return $(e.counts,n)??0}}}function P(n,e){let t=O(n);return t.applyState(e),t}var k=R(()=>{"use strict";pt()});function q(n){let e=O(n),t=O(n),s=0,r=Date.now();return{get(){return e.get()-t.get()},increment(c=1){if(c<0)throw new Error("Use decrement() for negative values");c!==0&&(e.increment(c),s++,r=Date.now())},decrement(c=1){if(c<0)throw new Error("Use increment() for negative values");c!==0&&(t.increment(c),s++,r=Date.now())},merge(c){let a=c.getState();this.applyState(a)},getState(){return{positive:e.getState(),negative:t.getState(),version:s,lastUpdated:r}},applyState(c){let a=this.get();e.applyState(c.positive),t.applyState(c.negative);let T=this.get();a!==T&&(s=Math.max(s,c.version)+1,r=Date.now())},getNodeId(){return n}}}function B(n,e){let t=q(n);return t.applyState(e),t}var Te=R(()=>{"use strict";k()});function It(n,e){return`${n}:${Date.now()}:${e}`}function Ee(n){return typeof n=="string"?`s:${n}`:typeof n=="number"?`n:${n}`:typeof n=="boolean"?`b:${n}`:`j:${JSON.stringify(n)}`}function Ct(n){let e=n.substring(0,2),t=n.substring(2);switch(e){case"s:":return t;case"n:":return Number(t);case"b:":return t==="true";case"j:":return I(t);default:throw new Error(`Unknown serialization type: ${e}`)}}function j(n){let e=new Map,t=new Map,s=0,r=Date.now(),c=0;function a(u){let d=`${n}:`;if(!u.startsWith(d))return;let m=u.slice(d.length),p=/^(-?\d+):(\d+)$/.exec(m);if(!p)return;let g=Number(p[1]),_=Number(p[2]);Number.isSafeInteger(g)&&Number.isSafeInteger(_)&&_<Number.MAX_SAFE_INTEGER&&(c=Math.max(c,_+1))}function T(u){let d=e.get(u);if(!d||d.size===0)return!1;let m=t.get(u);if(!m||m.size===0)return!0;for(let p of d)if(!m.has(p))return!0;return!1}function l(u){let d=e.get(u);if(!d)return new Set;let m=t.get(u)||new Set,p=new Set;for(let g of d)m.has(g)||p.add(g);return p}return{has(u){let d=Ee(u);return T(d)},values(){let u=[];for(let[d]of e)T(d)&&u.push(Ct(d));return u},size(){let u=0;for(let[d]of e)T(d)&&u++;return u},add(u){let d=Ee(u),m=It(n,c++);e.has(d)||e.set(d,new Set),e.get(d).add(m),s++,r=Date.now()},remove(u){let d=Ee(u),m=e.get(d);if(!m||m.size===0)return;t.has(d)||t.set(d,new Set);let p=t.get(d);for(let g of m)p.add(g);s++,r=Date.now()},merge(u){let d=u.getState();this.applyState(d)},getState(){let u={};for(let[m,p]of e)u[m]=Array.from(p);let d={};for(let[m,p]of t)p.size>0&&(d[m]=Array.from(p));return{elements:u,tombstones:d,version:s,lastUpdated:r}},applyState(u){let d=!1;for(let[m,p]of Object.entries(u.elements)){e.has(m)||e.set(m,new Set);let g=e.get(m);for(let _ of p)a(_),g.has(_)||(g.add(_),d=!0)}for(let[m,p]of Object.entries(u.tombstones)){t.has(m)||t.set(m,new Set);let g=t.get(m);for(let _ of p)a(_),g.has(_)||(g.add(_),d=!0)}d&&(s=Math.max(s,u.version)+1,r=Date.now())},getNodeId(){return n},clear(){for(let[u,d]of e){t.has(u)||t.set(u,new Set);let m=t.get(u);for(let p of d)m.add(p)}s++,r=Date.now()}}}function H(n,e){let t=j(n);return t.applyState(e),t}var de=R(()=>{"use strict";_e()});function ue(n){let e={...Ot,...n},{nodeId:t,enableDeltaTracking:s,maxDeltaHistory:r}=e,c=new Map,a=new Map,T=new Map,l=new Map,u=0,d=[],m=new Set,p={registers:new Set,gCounters:new Set,pnCounters:new Set,sets:new Set};function g(o,i,E){let f={key:o,type:i,operation:E,timestamp:Date.now(),nodeId:t};for(let ot of m)try{ot(f)}catch(at){console.error("[CRDTStore] Error in change listener:",at)}}function _(o,i){u++,s&&p[o].add(i)}function L(){if(!s||!(p.registers.size>0||p.gCounters.size>0||p.pnCounters.size>0||p.sets.size>0))return;let i={fromVersion:d.length>0?d[d.length-1].toVersion:0,toVersion:u,timestamp:Date.now(),nodeId:t};if(p.registers.size>0){i.registers={};for(let E of p.registers){let f=c.get(E);f&&(i.registers[E]=f.getState())}p.registers.clear()}if(p.gCounters.size>0){i.gCounters={};for(let E of p.gCounters){let f=a.get(E);f&&(i.gCounters[E]=f.getState())}p.gCounters.clear()}if(p.pnCounters.size>0){i.pnCounters={};for(let E of p.pnCounters){let f=T.get(E);f&&(i.pnCounters[E]=f.getState())}p.pnCounters.clear()}if(p.sets.size>0){i.sets={};for(let E of p.sets){let f=l.get(E);f&&(i.sets[E]=f.getState())}p.sets.clear()}for(d.push(i);d.length>r;)d.shift()}let h={getRegister(o){return c.has(o)||c.set(o,M(t)),c.get(o)},setRegister(o,i){h.getRegister(o).set(i),_("registers",o),g(o,"lww-register","set")},hasRegister(o){return c.has(o)},deleteRegister(o){let i=c.delete(o);return i&&_("registers",o),i},getGCounter(o){return a.has(o)||a.set(o,O(t)),a.get(o)},incrementGCounter(o,i){h.getGCounter(o).increment(i),_("gCounters",o),g(o,"g-counter","increment")},hasGCounter(o){return a.has(o)},deleteGCounter(o){let i=a.delete(o);return i&&_("gCounters",o),i},getCounter(o){return T.has(o)||T.set(o,q(t)),T.get(o)},incrementCounter(o,i){h.getCounter(o).increment(i),_("pnCounters",o),g(o,"pn-counter","increment")},decrementCounter(o,i){h.getCounter(o).decrement(i),_("pnCounters",o),g(o,"pn-counter","decrement")},hasCounter(o){return T.has(o)},deleteCounter(o){let i=T.delete(o);return i&&_("pnCounters",o),i},getSet(o){return l.has(o)||l.set(o,j(t)),l.get(o)},addToSet(o,i){h.getSet(o).add(i),_("sets",o),g(o,"or-set","add")},removeFromSet(o,i){h.getSet(o).remove(i),_("sets",o),g(o,"or-set","remove")},hasSet(o){return l.has(o)},deleteSet(o){let i=l.delete(o);return i&&_("sets",o),i},merge(o){let i=o.getState();h.applyState(i)},getState(){L();let o={version:u,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let[i,E]of c)o.registers[i]=E.getState();for(let[i,E]of a)o.gCounters[i]=E.getState();for(let[i,E]of T)o.pnCounters[i]=E.getState();for(let[i,E]of l)o.sets[i]=E.getState();return o},applyState(o){for(let[i,E]of Object.entries(o.registers))typeof E?.timestamp!="number"||!Number.isFinite(E.timestamp)||(c.has(i)?c.get(i).applyState(E):c.set(i,G(t,E)),_("registers",i),g(i,"lww-register","merge"));for(let[i,E]of Object.entries(o.gCounters))a.has(i)?a.get(i).applyState(E):a.set(i,P(t,E)),_("gCounters",i),g(i,"g-counter","merge");for(let[i,E]of Object.entries(o.pnCounters))T.has(i)?T.get(i).applyState(E):T.set(i,B(t,E)),_("pnCounters",i),g(i,"pn-counter","merge");for(let[i,E]of Object.entries(o.sets))l.has(i)?l.get(i).applyState(E):l.set(i,H(t,E)),_("sets",i),g(i,"or-set","merge");u=Math.max(u,o.version)+1},getDelta(o){if(L(),d.length===0)return o>=u,null;if(o<d[0].fromVersion){let f=h.getState();return{fromVersion:o,toVersion:u,timestamp:Date.now(),nodeId:t,registers:f.registers,gCounters:f.gCounters,pnCounters:f.pnCounters,sets:f.sets}}let i=d.filter(f=>f.toVersion>o);if(i.length===0)return null;let E={fromVersion:o,toVersion:u,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let f of i)f.registers&&Object.assign(E.registers,f.registers),f.gCounters&&Object.assign(E.gCounters,f.gCounters),f.pnCounters&&Object.assign(E.pnCounters,f.pnCounters),f.sets&&Object.assign(E.sets,f.sets);return Object.keys(E.registers).length===0&&delete E.registers,Object.keys(E.gCounters).length===0&&delete E.gCounters,Object.keys(E.pnCounters).length===0&&delete E.pnCounters,Object.keys(E.sets).length===0&&delete E.sets,E},applyDelta(o){if(o.registers)for(let[i,E]of Object.entries(o.registers))typeof E?.timestamp!="number"||!Number.isFinite(E.timestamp)||(c.has(i)?c.get(i).applyState(E):c.set(i,G(t,E)),_("registers",i),g(i,"lww-register","merge"));if(o.gCounters)for(let[i,E]of Object.entries(o.gCounters))a.has(i)?a.get(i).applyState(E):a.set(i,P(t,E)),_("gCounters",i),g(i,"g-counter","merge");if(o.pnCounters)for(let[i,E]of Object.entries(o.pnCounters))T.has(i)?T.get(i).applyState(E):T.set(i,B(t,E)),_("pnCounters",i),g(i,"pn-counter","merge");if(o.sets)for(let[i,E]of Object.entries(o.sets))l.has(i)?l.get(i).applyState(E):l.set(i,H(t,E)),_("sets",i),g(i,"or-set","merge");u=Math.max(u,o.toVersion)+1},getVersion(){return u},getNodeId(){return t},on(o,i){if(o==="change")return m.add(i),()=>{m.delete(i)};throw new Error(`Unknown event type: ${o}`)},removeAllListeners(){m.clear()},keys(o){let i=[];return(!o||o==="lww-register")&&i.push(...Array.from(c.keys())),(!o||o==="g-counter")&&i.push(...Array.from(a.keys())),(!o||o==="pn-counter")&&i.push(...Array.from(T.keys())),(!o||o==="or-set")&&i.push(...Array.from(l.keys())),i},clear(){c.clear(),a.clear(),T.clear(),l.clear(),d.length=0,p.registers.clear(),p.gCounters.clear(),p.pnCounters.clear(),p.sets.clear(),u=0},getStats(){return{total:c.size+a.size+T.size+l.size,registers:c.size,gCounters:a.size,pnCounters:T.size,sets:l.size,version:u,nodeId:t,deltaHistorySize:d.length}}};return h}var Ot,Qe=R(()=>{"use strict";ce();k();Te();de();Ot={nodeId:"default-node",enableDeltaTracking:!0,maxDeltaHistory:100}});var Je=R(()=>{"use strict"});var Ze=R(()=>{"use strict";ce();k();Te();de();Qe();Je()});var Dt={};ct(Dt,{ALLOWED_TABLE_NAMES:()=>J,BinaryHeap:()=>fe,DEFAULT_UNIFIED_MEMORY_CONFIG:()=>rt,UnifiedHnswIndex:()=>x,UnifiedMemoryManager:()=>y,clearProjectRootCache:()=>z,createHnswIndex:()=>Ne,findProjectRoot:()=>X,getDefaultDbPath:()=>nt,getResolvedDefaultConfig:()=>st,getUnifiedMemory:()=>it,initializeUnifiedMemory:()=>At,resetUnifiedMemory:()=>vt,validateTableName:()=>b});import*as N from"fs";import*as tt from"os";import*as S from"path";function nt(){let n=X();return S.join(n,".agentic-qe","memory.db")}function st(){return{...rt,dbPath:nt()}}function it(n){return y.getInstance(n)}async function At(n){let e=it(n);return await e.initialize(),e}function vt(){y.resetInstance()}function bt(){if(et)return;et=!0;let n=()=>{try{let t=y.instance;t&&t.close()}catch(t){console.debug("[UnifiedMemory] Cleanup error:",t instanceof Error?t.message:t)}};process.on("beforeExit",n),Re(n);let e=t=>{Le(t)||(n(),process.exit(0))};process.on("SIGINT",e),process.on("SIGTERM",e)}var F,rt,y,et,yt=R(()=>{dt();_e();le();ut();Tt();ve();Z();Z();Se();Se();ie();Ve();ee();Ze();Et();_t();F=ge.create("unified-memory");rt={dbPath:".agentic-qe/memory.db",walMode:!0,mmapSize:U.MMAP_SIZE_BYTES,cacheSize:U.CACHE_SIZE_KB,busyTimeout:U.BUSY_TIMEOUT_MS,vectorDimensions:U.DEFAULT_VECTOR_DIMENSIONS};y=class n{static instance=null;static instancePromise=null;db=null;config;initialized=!1;vectorsLoaded=!1;initPromise=null;preparedStatements=new Map;vectorIndex=new x("qe-memory");crdtStore=null;proofGate=null;proofGateEnvChecked=!1;static PROOF_NS="__proofgate__";static PROOF_KEY="chain";constructor(e){let t=st();if(this.config={...t,...e},process.env.AQE_MEMORY_BACKEND==="memory"){this.config.dbPath=":memory:";return}if(this.config.dbPath!==":memory:"&&!S.isAbsolute(this.config.dbPath)){let s=X();this.config.dbPath=S.join(s,this.config.dbPath)}}static getInstance(e){return n.instance||(n.instance=new n(e)),n.instance}static async getInstanceAsync(e){return n.instance?.initialized?n.instance:(n.instancePromise||(n.instancePromise=(async()=>{let t=n.getInstance(e);return await t.initialize(),t})()),n.instancePromise)}static resetInstance(){n.instance&&(n.instance.close(),n.instance=null),n.instancePromise=null,z()}async initialize(e){if(!this.initialized)return this.initPromise||(this.initPromise=this._doInitialize(e?.signal)),this.initPromise}async _doInitialize(e){if(!this.initialized){e?.throwIfAborted();try{let t=this.config.dbPath===":memory:",s="",r=!1,c=0;if(!t){let a=process.env.AQE_PROJECT_ROOT;if(a){let T=S.resolve(this.config.dbPath),l=S.resolve(a);!T.startsWith(l)&&!T.startsWith(tt.tmpdir())&&T.includes(".agentic-qe")&&(console.error(`[UnifiedMemory] WARNING: DB path "${this.config.dbPath}" points to a production .agentic-qe/ while AQE_PROJECT_ROOT="${a}". Redirecting to test-safe path.`),this.config.dbPath=S.join(a,".agentic-qe","memory.db"))}if(s=S.dirname(this.config.dbPath),N.existsSync(s)||N.mkdirSync(s,{recursive:!0}),r=N.existsSync(this.config.dbPath),r)c=N.statSync(this.config.dbPath).size;else if(N.existsSync(s)){let T=this.findRecentBackups(s);if(T.length>0){let l=T[0];console.error(`[UnifiedMemory] CRITICAL: Database file missing but directory exists!
|
|
755
|
+
`,tt=["kv_store","vectors","rl_q_values","goap_actions","goap_goals","goap_plans","goap_plan_signatures","goap_execution_steps","concept_nodes","concept_edges","dream_cycles","dream_insights","qe_patterns","qe_pattern_embeddings","qe_pattern_usage","qe_trajectories","embeddings","execution_results","executed_steps","mincut_snapshots","mincut_history","mincut_weak_vertices","mincut_alerts","mincut_healing_actions","mincut_observations","hypergraph_nodes","hypergraph_edges","sona_patterns","witness_chain","learning_evidence_manifests","learning_evidence_segments","learning_segment_edges","learning_evidence_admissions","pattern_manifest_lineage","pattern_segment_lineage"]});function Te(n,e,t){return n.prepare("SELECT 1 FROM sqlite_master WHERE type = ? AND name = ?").get(e,t)!==void 0}function st(n){return n.replace(/\s+/g," ").trim().replace(/^CREATE TRIGGER IF NOT EXISTS /i,"CREATE TRIGGER ").replace(/ ?;$/,"").toLowerCase()}function x(n,e){return n.prepare(e).get()?.n??0}function nt(n){let e=Te(n,"table","qe_patterns_fts"),t=e&&Te(n,"table","qe_patterns_fts_docsize"),s=[],r=[],c=n.prepare("SELECT sql FROM sqlite_master WHERE type = 'trigger' AND name = ?");for(let d of Xt){let u=c.get(d);u===void 0?s.push(d):st(u.sql??"")!==Ut[d]&&r.push(d)}let a=x(n,"SELECT count(*) AS n FROM qe_patterns"),T=t?x(n,"SELECT count(*) AS n FROM qe_patterns_fts_docsize"):-1,l=t&&T===a?x(n,`SELECT count(*) AS n FROM qe_patterns p
|
|
756
|
+
WHERE NOT EXISTS (SELECT 1 FROM qe_patterns_fts_docsize d WHERE d.id = p.rowid)`):0;return{hasTable:e,hasDocsize:t,missingTriggers:s,mismatchedTriggers:r,patterns:a,indexed:T,unindexed:l}}function rt(n){return!n.hasTable||n.missingTriggers.length>0||n.mismatchedTriggers.length>0?!0:n.hasDocsize?n.indexed!==n.patterns||n.unindexed>0:!1}function wt(n){if(n.readonly)return!0;try{return Number(n.pragma("query_only",{simple:!0}))===1}catch{return!1}}function it(n,e={}){let t=e.log??(c=>console.warn(c)),s=e.logPrefix??"[PatternFTS]",r={status:"healthy",createdTable:!1,recreatedTriggers:[],replacedTriggers:[],rebuilt:!1,patternsBefore:-1,indexedBefore:-1,indexedAfter:-1};try{if(!Te(n,"table","qe_patterns"))return r.status="no-patterns",r;if(wt(n))return r.status="readonly",r;let c=nt(n);if(r.patternsBefore=c.patterns,r.indexedBefore=c.indexed,!rt(c))return r;let a=n.transaction(()=>{let T=nt(n);if(!rt(T))return null;T.hasTable||n.exec(oe);for(let l of T.missingTriggers)n.exec(y[l]);for(let l of T.mismatchedTriggers)n.exec(`DROP TRIGGER IF EXISTS ${l}`),n.exec(y[l]);return n.exec("INSERT INTO qe_patterns_fts(qe_patterns_fts) VALUES('rebuild')"),{s:T,indexedAfter:x(n,"SELECT count(*) AS n FROM qe_patterns_fts_docsize")}}).immediate();if(a){let{s:T}=a;r.createdTable=!T.hasTable,r.recreatedTriggers=[...T.missingTriggers],r.replacedTriggers=[...T.mismatchedTriggers],r.patternsBefore=T.patterns,r.indexedBefore=T.indexed,r.indexedAfter=a.indexedAfter,r.rebuilt=!0}if(r.rebuilt){r.status="healed";let T=[];r.createdTable&&T.push("created qe_patterns_fts"),r.recreatedTriggers.length>0&&T.push(`recreated triggers [${r.recreatedTriggers.join(", ")}]`),r.replacedTriggers.length>0&&T.push(`replaced triggers [${r.replacedTriggers.join(", ")}]`);let l=r.indexedBefore<0?"n/a":String(r.indexedBefore);T.push(`rebuilt index (indexed ${l} -> ${r.indexedAfter}, qe_patterns ${r.patternsBefore})`),t(`${s} Healed qe_patterns FTS5 index: ${T.join("; ")}`)}return r}catch(c){r.status="failed",r.error=A(c);try{t(`${s} qe_patterns FTS5 self-heal skipped: ${r.error} (keyword search may be degraded; vector search unaffected)`)}catch{}return r}}var Xt,Ut,ot=h(()=>{"use strict";_e();ce();Xt=Object.keys(y);Ut=Object.freeze(Object.fromEntries(Object.entries(y).map(([n,e])=>[n,st(e)])))});function Ee(n){if(!Number.isFinite(n))throw new RangeError("LWW register timestamp must be a finite number")}function M(n,e,t){let s=t??(e!==void 0?Date.now():0);Ee(s);let r={value:e,timestamp:s,nodeId:e!==void 0?n:"",version:e!==void 0?1:0,lastUpdated:Date.now()};function c(a,T,l,d){return a!==l?a-l:T===d?0:T>d?1:-1}return{get(){return r.value},set(a,T){let l=T??Date.now();Ee(l),T===void 0&&r.version>0&&r.nodeId===n&&l<=r.timestamp&&(l=r.timestamp+1),(r.version===0||c(l,n,r.timestamp,r.nodeId)>0)&&(r={value:a,timestamp:l,nodeId:n,version:r.version+1,lastUpdated:Date.now()})},merge(a){let T=a.getState();this.applyState(T)},getState(){return{value:r.value,timestamp:r.timestamp,nodeId:r.nodeId,version:r.version,lastUpdated:r.lastUpdated}},applyState(a){a.version!==0&&(Ee(a.timestamp),(r.version===0||c(a.timestamp,a.nodeId,r.timestamp,r.nodeId)>0)&&(r={value:a.value,timestamp:a.timestamp,nodeId:a.nodeId,version:Math.max(r.version,a.version)+1,lastUpdated:Date.now()}))},getNodeId(){return n},getTimestamp(){return r.timestamp}}}function G(n,e){let t=M(n);return t.applyState(e),t}var de=h(()=>{"use strict"});function O(n){let e={counts:K(),version:0,lastUpdated:Date.now()};return V(e.counts,n,0),{get(){return Object.values(e.counts).reduce((t,s)=>t+s,0)},increment(t=1){if(t<0)throw new Error("G-Counter can only increment by positive values");t!==0&&(Ae(e.counts,n,t),e.version++,e.lastUpdated=Date.now())},merge(t){let s=t.getState();this.applyState(s)},getState(){return{counts:Object.assign(K(),e.counts),version:e.version,lastUpdated:e.lastUpdated}},applyState(t){let s=!1;for(let[r,c]of Object.entries(t.counts)){let a=$(e.counts,r)??0;c>a&&(V(e.counts,r,c),s=!0)}s&&(e.version=Math.max(e.version,t.version)+1,e.lastUpdated=Date.now())},getNodeId(){return n},getLocalCount(){return $(e.counts,n)??0}}}function P(n,e){let t=O(n);return t.applyState(e),t}var k=h(()=>{"use strict";Ot()});function q(n){let e=O(n),t=O(n),s=0,r=Date.now();return{get(){return e.get()-t.get()},increment(c=1){if(c<0)throw new Error("Use decrement() for negative values");c!==0&&(e.increment(c),s++,r=Date.now())},decrement(c=1){if(c<0)throw new Error("Use increment() for negative values");c!==0&&(t.increment(c),s++,r=Date.now())},merge(c){let a=c.getState();this.applyState(a)},getState(){return{positive:e.getState(),negative:t.getState(),version:s,lastUpdated:r}},applyState(c){let a=this.get();e.applyState(c.positive),t.applyState(c.negative);let T=this.get();a!==T&&(s=Math.max(s,c.version)+1,r=Date.now())},getNodeId(){return n}}}function B(n,e){let t=q(n);return t.applyState(e),t}var ue=h(()=>{"use strict";k()});function Ft(n,e){return`${n}:${Date.now()}:${e}`}function le(n){return typeof n=="string"?`s:${n}`:typeof n=="number"?`n:${n}`:typeof n=="boolean"?`b:${n}`:`j:${JSON.stringify(n)}`}function xt(n){let e=n.substring(0,2),t=n.substring(2);switch(e){case"s:":return t;case"n:":return Number(t);case"b:":return t==="true";case"j:":return I(t);default:throw new Error(`Unknown serialization type: ${e}`)}}function j(n){let e=new Map,t=new Map,s=0,r=Date.now(),c=0;function a(d){let u=`${n}:`;if(!d.startsWith(u))return;let m=d.slice(u.length),p=/^(-?\d+):(\d+)$/.exec(m);if(!p)return;let g=Number(p[1]),_=Number(p[2]);Number.isSafeInteger(g)&&Number.isSafeInteger(_)&&_<Number.MAX_SAFE_INTEGER&&(c=Math.max(c,_+1))}function T(d){let u=e.get(d);if(!u||u.size===0)return!1;let m=t.get(d);if(!m||m.size===0)return!0;for(let p of u)if(!m.has(p))return!0;return!1}function l(d){let u=e.get(d);if(!u)return new Set;let m=t.get(d)||new Set,p=new Set;for(let g of u)m.has(g)||p.add(g);return p}return{has(d){let u=le(d);return T(u)},values(){let d=[];for(let[u]of e)T(u)&&d.push(xt(u));return d},size(){let d=0;for(let[u]of e)T(u)&&d++;return d},add(d){let u=le(d),m=Ft(n,c++);e.has(u)||e.set(u,new Set),e.get(u).add(m),s++,r=Date.now()},remove(d){let u=le(d),m=e.get(u);if(!m||m.size===0)return;t.has(u)||t.set(u,new Set);let p=t.get(u);for(let g of m)p.add(g);s++,r=Date.now()},merge(d){let u=d.getState();this.applyState(u)},getState(){let d={};for(let[m,p]of e)d[m]=Array.from(p);let u={};for(let[m,p]of t)p.size>0&&(u[m]=Array.from(p));return{elements:d,tombstones:u,version:s,lastUpdated:r}},applyState(d){let u=!1;for(let[m,p]of Object.entries(d.elements)){e.has(m)||e.set(m,new Set);let g=e.get(m);for(let _ of p)a(_),g.has(_)||(g.add(_),u=!0)}for(let[m,p]of Object.entries(d.tombstones)){t.has(m)||t.set(m,new Set);let g=t.get(m);for(let _ of p)a(_),g.has(_)||(g.add(_),u=!0)}u&&(s=Math.max(s,d.version)+1,r=Date.now())},getNodeId(){return n},clear(){for(let[d,u]of e){t.has(d)||t.set(d,new Set);let m=t.get(d);for(let p of u)m.add(p)}s++,r=Date.now()}}}function H(n,e){let t=j(n);return t.applyState(e),t}var ge=h(()=>{"use strict";Ne()});function pe(n){let e={...Mt,...n},{nodeId:t,enableDeltaTracking:s,maxDeltaHistory:r}=e,c=new Map,a=new Map,T=new Map,l=new Map,d=0,u=[],m=new Set,p={registers:new Set,gCounters:new Set,pnCounters:new Set,sets:new Set};function g(o,i,E){let f={key:o,type:i,operation:E,timestamp:Date.now(),nodeId:t};for(let _t of m)try{_t(f)}catch(mt){console.error("[CRDTStore] Error in change listener:",mt)}}function _(o,i){d++,s&&p[o].add(i)}function L(){if(!s||!(p.registers.size>0||p.gCounters.size>0||p.pnCounters.size>0||p.sets.size>0))return;let i={fromVersion:u.length>0?u[u.length-1].toVersion:0,toVersion:d,timestamp:Date.now(),nodeId:t};if(p.registers.size>0){i.registers={};for(let E of p.registers){let f=c.get(E);f&&(i.registers[E]=f.getState())}p.registers.clear()}if(p.gCounters.size>0){i.gCounters={};for(let E of p.gCounters){let f=a.get(E);f&&(i.gCounters[E]=f.getState())}p.gCounters.clear()}if(p.pnCounters.size>0){i.pnCounters={};for(let E of p.pnCounters){let f=T.get(E);f&&(i.pnCounters[E]=f.getState())}p.pnCounters.clear()}if(p.sets.size>0){i.sets={};for(let E of p.sets){let f=l.get(E);f&&(i.sets[E]=f.getState())}p.sets.clear()}for(u.push(i);u.length>r;)u.shift()}let R={getRegister(o){return c.has(o)||c.set(o,M(t)),c.get(o)},setRegister(o,i){R.getRegister(o).set(i),_("registers",o),g(o,"lww-register","set")},hasRegister(o){return c.has(o)},deleteRegister(o){let i=c.delete(o);return i&&_("registers",o),i},getGCounter(o){return a.has(o)||a.set(o,O(t)),a.get(o)},incrementGCounter(o,i){R.getGCounter(o).increment(i),_("gCounters",o),g(o,"g-counter","increment")},hasGCounter(o){return a.has(o)},deleteGCounter(o){let i=a.delete(o);return i&&_("gCounters",o),i},getCounter(o){return T.has(o)||T.set(o,q(t)),T.get(o)},incrementCounter(o,i){R.getCounter(o).increment(i),_("pnCounters",o),g(o,"pn-counter","increment")},decrementCounter(o,i){R.getCounter(o).decrement(i),_("pnCounters",o),g(o,"pn-counter","decrement")},hasCounter(o){return T.has(o)},deleteCounter(o){let i=T.delete(o);return i&&_("pnCounters",o),i},getSet(o){return l.has(o)||l.set(o,j(t)),l.get(o)},addToSet(o,i){R.getSet(o).add(i),_("sets",o),g(o,"or-set","add")},removeFromSet(o,i){R.getSet(o).remove(i),_("sets",o),g(o,"or-set","remove")},hasSet(o){return l.has(o)},deleteSet(o){let i=l.delete(o);return i&&_("sets",o),i},merge(o){let i=o.getState();R.applyState(i)},getState(){L();let o={version:d,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let[i,E]of c)o.registers[i]=E.getState();for(let[i,E]of a)o.gCounters[i]=E.getState();for(let[i,E]of T)o.pnCounters[i]=E.getState();for(let[i,E]of l)o.sets[i]=E.getState();return o},applyState(o){for(let[i,E]of Object.entries(o.registers))typeof E?.timestamp!="number"||!Number.isFinite(E.timestamp)||(c.has(i)?c.get(i).applyState(E):c.set(i,G(t,E)),_("registers",i),g(i,"lww-register","merge"));for(let[i,E]of Object.entries(o.gCounters))a.has(i)?a.get(i).applyState(E):a.set(i,P(t,E)),_("gCounters",i),g(i,"g-counter","merge");for(let[i,E]of Object.entries(o.pnCounters))T.has(i)?T.get(i).applyState(E):T.set(i,B(t,E)),_("pnCounters",i),g(i,"pn-counter","merge");for(let[i,E]of Object.entries(o.sets))l.has(i)?l.get(i).applyState(E):l.set(i,H(t,E)),_("sets",i),g(i,"or-set","merge");d=Math.max(d,o.version)+1},getDelta(o){if(L(),u.length===0)return o>=d,null;if(o<u[0].fromVersion){let f=R.getState();return{fromVersion:o,toVersion:d,timestamp:Date.now(),nodeId:t,registers:f.registers,gCounters:f.gCounters,pnCounters:f.pnCounters,sets:f.sets}}let i=u.filter(f=>f.toVersion>o);if(i.length===0)return null;let E={fromVersion:o,toVersion:d,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let f of i)f.registers&&Object.assign(E.registers,f.registers),f.gCounters&&Object.assign(E.gCounters,f.gCounters),f.pnCounters&&Object.assign(E.pnCounters,f.pnCounters),f.sets&&Object.assign(E.sets,f.sets);return Object.keys(E.registers).length===0&&delete E.registers,Object.keys(E.gCounters).length===0&&delete E.gCounters,Object.keys(E.pnCounters).length===0&&delete E.pnCounters,Object.keys(E.sets).length===0&&delete E.sets,E},applyDelta(o){if(o.registers)for(let[i,E]of Object.entries(o.registers))typeof E?.timestamp!="number"||!Number.isFinite(E.timestamp)||(c.has(i)?c.get(i).applyState(E):c.set(i,G(t,E)),_("registers",i),g(i,"lww-register","merge"));if(o.gCounters)for(let[i,E]of Object.entries(o.gCounters))a.has(i)?a.get(i).applyState(E):a.set(i,P(t,E)),_("gCounters",i),g(i,"g-counter","merge");if(o.pnCounters)for(let[i,E]of Object.entries(o.pnCounters))T.has(i)?T.get(i).applyState(E):T.set(i,B(t,E)),_("pnCounters",i),g(i,"pn-counter","merge");if(o.sets)for(let[i,E]of Object.entries(o.sets))l.has(i)?l.get(i).applyState(E):l.set(i,H(t,E)),_("sets",i),g(i,"or-set","merge");d=Math.max(d,o.toVersion)+1},getVersion(){return d},getNodeId(){return t},on(o,i){if(o==="change")return m.add(i),()=>{m.delete(i)};throw new Error(`Unknown event type: ${o}`)},removeAllListeners(){m.clear()},keys(o){let i=[];return(!o||o==="lww-register")&&i.push(...Array.from(c.keys())),(!o||o==="g-counter")&&i.push(...Array.from(a.keys())),(!o||o==="pn-counter")&&i.push(...Array.from(T.keys())),(!o||o==="or-set")&&i.push(...Array.from(l.keys())),i},clear(){c.clear(),a.clear(),T.clear(),l.clear(),u.length=0,p.registers.clear(),p.gCounters.clear(),p.pnCounters.clear(),p.sets.clear(),d=0},getStats(){return{total:c.size+a.size+T.size+l.size,registers:c.size,gCounters:a.size,pnCounters:T.size,sets:l.size,version:d,nodeId:t,deltaHistorySize:u.length}}};return R}var Mt,at=h(()=>{"use strict";de();k();ue();ge();Mt={nodeId:"default-node",enableDeltaTracking:!0,maxDeltaHistory:100}});var ct=h(()=>{"use strict"});var Tt=h(()=>{"use strict";de();k();ue();ge();at();ct()});var Bt={};ft(Bt,{ALLOWED_TABLE_NAMES:()=>te,BinaryHeap:()=>Ie,DEFAULT_UNIFIED_MEMORY_CONFIG:()=>lt,UnifiedHnswIndex:()=>F,UnifiedMemoryManager:()=>D,clearProjectRootCache:()=>W,createHnswIndex:()=>Ce,findProjectRoot:()=>X,getDefaultDbPath:()=>ut,getResolvedDefaultConfig:()=>gt,getUnifiedMemory:()=>pt,initializeUnifiedMemory:()=>Gt,resetUnifiedMemory:()=>Pt,validateTableName:()=>v,writeWhenUnlockedOn:()=>kt});import*as N from"fs";import*as dt from"os";import*as S from"path";function ut(){let n=X();return S.join(n,".agentic-qe","memory.db")}function gt(){return{...lt,dbPath:ut()}}function pt(n){return D.getInstance(n)}async function Gt(n){let e=pt(n);return await e.initialize(),e}function Pt(){D.resetInstance()}function kt(n,e){return Re(n,e)}function qt(){if(Et)return;Et=!0;let n=()=>{try{let t=D.instance;t&&t.close()}catch(t){console.debug("[UnifiedMemory] Cleanup error:",t instanceof Error?t.message:t)}};process.on("beforeExit",n),be(n);let e=t=>{ve(t)||(n(),process.exit(0))};process.on("SIGINT",e),process.on("SIGTERM",e)}var w,lt,D,Et,jt=h(()=>{ht();Ne();De();Rt();Ue();_e();Lt();Nt();Ge();ne();ne();Oe();Oe();ce();ot();re();Tt();St();At();w=me.create("unified-memory");lt={dbPath:".agentic-qe/memory.db",walMode:!0,mmapSize:U.MMAP_SIZE_BYTES,cacheSize:U.CACHE_SIZE_KB,busyTimeout:U.BUSY_TIMEOUT_MS,vectorDimensions:U.DEFAULT_VECTOR_DIMENSIONS};D=class n{static instance=null;static instancePromise=null;db=null;config;initialized=!1;vectorsLoaded=!1;initPromise=null;writeQueue=Promise.resolve();queuedWrites=0;preparedStatements=new Map;vectorIndex=new F("qe-memory");crdtStore=null;proofGate=null;proofGateEnvChecked=!1;static PROOF_NS="__proofgate__";static PROOF_KEY="chain";constructor(e){let t=gt();if(this.config={...t,...e},process.env.AQE_MEMORY_BACKEND==="memory"){this.config.dbPath=":memory:";return}if(this.config.dbPath!==":memory:"&&!S.isAbsolute(this.config.dbPath)){let s=X();this.config.dbPath=S.join(s,this.config.dbPath)}}static getInstance(e){return n.instance||(n.instance=new n(e)),n.instance}static async getInstanceAsync(e){return n.instance?.initialized?n.instance:(n.instancePromise||(n.instancePromise=(async()=>{let t=n.getInstance(e);return await t.initialize(),t})()),n.instancePromise)}static resetInstance(){n.instance&&(n.instance.close(),n.instance=null),n.instancePromise=null,W()}async initialize(e){if(!this.initialized)return this.initPromise||(this.initPromise=this._doInitialize(e?.signal)),this.initPromise}async _doInitialize(e){if(!this.initialized){e?.throwIfAborted();try{let t=this.config.dbPath===":memory:",s="",r=!1,c=0;if(!t){let a=process.env.AQE_PROJECT_ROOT;if(a){let T=S.resolve(this.config.dbPath),l=S.resolve(a);!T.startsWith(l)&&!T.startsWith(dt.tmpdir())&&T.includes(".agentic-qe")&&(console.error(`[UnifiedMemory] WARNING: DB path "${this.config.dbPath}" points to a production .agentic-qe/ while AQE_PROJECT_ROOT="${a}". Redirecting to test-safe path.`),this.config.dbPath=S.join(a,".agentic-qe","memory.db"))}if(s=S.dirname(this.config.dbPath),N.existsSync(s)||N.mkdirSync(s,{recursive:!0}),r=N.existsSync(this.config.dbPath),r)c=N.statSync(this.config.dbPath).size;else if(N.existsSync(s)){let T=this.findRecentBackups(s);if(T.length>0){let l=T[0];console.error(`[UnifiedMemory] CRITICAL: Database file missing but directory exists!
|
|
757
757
|
Expected: ${this.config.dbPath}
|
|
758
758
|
Found ${T.length} backup(s), newest: ${l.path} (${(l.size/1024/1024).toFixed(1)}MB)
|
|
759
|
-
Restoring from backup to prevent data loss...`),N.copyFileSync(l.path,this.config.dbPath);for(let
|
|
759
|
+
Restoring from backup to prevent data loss...`),N.copyFileSync(l.path,this.config.dbPath);for(let d of["-wal","-shm"]){let u=this.config.dbPath+d;N.existsSync(u)&&N.unlinkSync(u)}c=l.size}}}if(e?.throwIfAborted(),this.db=fe(this.config.dbPath,{walMode:this.config.walMode,busyTimeout:this.config.busyTimeout,autoRestore:!0}),this.db.pragma(`mmap_size = ${this.config.mmapSize}`),this.db.pragma(`cache_size = ${this.config.cacheSize}`),this.db.pragma("foreign_keys = ON"),e?.aborted){try{this.db.close()}catch{}this.db=null,e.throwIfAborted()}if(await this.runMigrations(),it(this.db,{logPrefix:"[UnifiedMemory]"}),e?.throwIfAborted(),r&&c>1e6)try{let a=this.db.prepare("SELECT COUNT(*) as cnt FROM qe_patterns").get();if(a&&a.cnt===0){let T=N.statSync(this.config.dbPath).size;T<c*.1&&console.error(`[UnifiedMemory] CRITICAL: Possible data loss detected!
|
|
760
760
|
DB was ${(c/1024/1024).toFixed(1)}MB, now ${(T/1024/1024).toFixed(1)}MB with 0 patterns.
|
|
761
761
|
This looks like the DB was replaced with an empty schema.
|
|
762
|
-
Check backups in ${s} and restore manually.`)}}catch{}this.vectorsLoaded=!1,this.initialized=!0,console.log(`[UnifiedMemory] Initialized: ${this.config.dbPath}`),this.warnIfDuplicateDatabases()}catch(t){throw this.initPromise=null,t instanceof Error&&(t.name==="AbortError"||(e?.aborted??!1))?t:new Error(`Failed to initialize UnifiedMemoryManager: ${A(t)}`)}}}findRecentBackups(e){try{let s=N.readdirSync(e).filter(c=>c.startsWith("memory")&&c.endsWith(".db")&&c!=="memory.db").map(c=>{let a=S.join(e,c),T=N.statSync(a);return{path:a,size:T.size,mtime:T.mtimeMs}}).filter(c=>c.size>1e6).sort((c,a)=>a.mtime-c.mtime),r=S.join(e,"backups");if(N.existsSync(r)){let c=N.readdirSync(r);for(let a of c)if(a.endsWith(".db")){let T=S.join(r,a),l=N.statSync(T);l.size>1e6&&s.push({path:T,size:l.size,mtime:l.mtimeMs})}s.sort((a,T)=>T.mtime-a.mtime)}return s}catch{return[]}}warnIfDuplicateDatabases(){if(this.config.dbPath!==":memory:")try{let e=X(),t=S.resolve(this.config.dbPath),r=[S.join(e,".agentic-qe","memory.db"),S.join(e,"v3",".agentic-qe","memory.db")].map(c=>S.resolve(c)).filter(c=>c!==t&&N.existsSync(c));r.length>0&&console.warn(`[UnifiedMemory] WARNING: Duplicate database(s) detected!
|
|
762
|
+
Check backups in ${s} and restore manually.`)}}catch{}this.vectorsLoaded=!1,this.initialized=!0,Se(this.db,a=>this.writeWhenUnlocked(a)),console.log(`[UnifiedMemory] Initialized: ${this.config.dbPath}`),this.warnIfDuplicateDatabases()}catch(t){throw this.initPromise=null,t instanceof Error&&(t.name==="AbortError"||(e?.aborted??!1))?t:new Error(`Failed to initialize UnifiedMemoryManager: ${A(t)}`)}}}findRecentBackups(e){try{let s=N.readdirSync(e).filter(c=>c.startsWith("memory")&&c.endsWith(".db")&&c!=="memory.db").map(c=>{let a=S.join(e,c),T=N.statSync(a);return{path:a,size:T.size,mtime:T.mtimeMs}}).filter(c=>c.size>1e6).sort((c,a)=>a.mtime-c.mtime),r=S.join(e,"backups");if(N.existsSync(r)){let c=N.readdirSync(r);for(let a of c)if(a.endsWith(".db")){let T=S.join(r,a),l=N.statSync(T);l.size>1e6&&s.push({path:T,size:l.size,mtime:l.mtimeMs})}s.sort((a,T)=>T.mtime-a.mtime)}return s}catch{return[]}}warnIfDuplicateDatabases(){if(this.config.dbPath!==":memory:")try{let e=X(),t=S.resolve(this.config.dbPath),r=[S.join(e,".agentic-qe","memory.db"),S.join(e,"v3",".agentic-qe","memory.db")].map(c=>S.resolve(c)).filter(c=>c!==t&&N.existsSync(c));r.length>0&&console.warn(`[UnifiedMemory] WARNING: Duplicate database(s) detected!
|
|
763
763
|
Canonical: ${t}
|
|
764
764
|
Duplicates: ${r.join(", ")}
|
|
765
|
-
This can cause data splits. Remove duplicates or set AQE_PROJECT_ROOT.`)}catch(e){
|
|
765
|
+
This can cause data splits. Remove duplicates or set AQE_PROJECT_ROOT.`)}catch(e){w.debug("Duplicate database check failed",{error:e instanceof Error?e.message:String(e)})}}columnExists(e,t){if(!this.db)return!1;try{let s=v(e);return this.db.prepare(`PRAGMA table_info(${s})`).all().some(c=>c.name===t)}catch(s){return w.debug("Column existence check failed",{table:e,column:t,error:s instanceof Error?s.message:String(s)}),!1}}handleV2SchemaIncompatibilities(){if(!this.db)return;let e=[{table:"goap_plans",requiredColumn:"status",columnDef:"TEXT DEFAULT 'pending'"},{table:"goap_actions",requiredColumn:"agent_type",columnDef:"TEXT DEFAULT 'unknown'"},{table:"concept_nodes",requiredColumn:"concept_type",columnDef:"TEXT DEFAULT 'general'"},{table:"concept_edges",requiredColumn:"edge_type",columnDef:"TEXT DEFAULT 'related'"},{table:"dream_insights",requiredColumn:"cycle_id",columnDef:"TEXT DEFAULT ''"},{table:"rl_q_values",requiredColumn:"algorithm",columnDef:"TEXT DEFAULT 'q-learning'"}];for(let{table:t,requiredColumn:s,columnDef:r}of e)if(this.db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name=?").get(t)&&!this.columnExists(t,s)){let a=v(t);try{this.db.exec(`ALTER TABLE ${a} ADD COLUMN ${s} ${r}`),console.log(`[UnifiedMemory] Added column ${s} to ${t} (safe migration)`)}catch(T){console.log(`[UnifiedMemory] Column ${s} on ${t}: ${T instanceof Error?T.message:String(T)}`)}}}async runMigrations(){if(!this.db)throw new Error("Database not initialized");this.db.exec(He),this.handleV2SchemaIncompatibilities();let t=this.db.prepare("SELECT version FROM schema_version WHERE id = 1").get()?.version??0;t<C&&(console.log(`[UnifiedMemory] Migrating from v${t} to v${C}`),this.db.transaction(()=>{let a=this.db.prepare("SELECT version FROM schema_version WHERE id = 1").get()?.version??0;return a>=C||(a<1&&this.db.exec(We),a<2&&this.db.exec(ze),a<3&&(this.db.exec(Ye),this.db.exec(ie),this.db.exec(Ke)),a<4&&this.db.exec(Ve),a<5&&this.db.exec(Je),a<6&&this.db.exec(z),a<7&&this.db.exec(Ze),a<8&&this.db.exec(et),a<9&&(this.db.exec(ae),this.db.exec("INSERT INTO qe_patterns_fts(qe_patterns_fts) VALUES('rebuild')")),a<10&&this.db.exec(Y),a<11&&this.migrateToV11GoapExecutionSteps(),a<12&&qe(this.db),a<13&&this.migrateToV13EmbeddingSpace(),a<14&&this.db.exec(se),this.db.prepare(`
|
|
766
766
|
INSERT OR REPLACE INTO schema_version (id, version, migrated_at)
|
|
767
767
|
VALUES (1, ?, datetime('now'))
|
|
768
|
-
`).run(C)),a}).immediate()>=C?console.log(`[UnifiedMemory] Another process completed the migration to v${C}`):console.log("[UnifiedMemory] Migration complete"))}migrateToV11GoapExecutionSteps(){let e=this.db;e.exec(
|
|
768
|
+
`).run(C)),a}).immediate()>=C?console.log(`[UnifiedMemory] Another process completed the migration to v${C}`):console.log("[UnifiedMemory] Migration complete"))}migrateToV11GoapExecutionSteps(){let e=this.db;e.exec(ie);let t=(s,r,c)=>{e.prepare(`SELECT name FROM pragma_table_info('${s}')`).all().some(T=>T.name===r)||e.exec(`ALTER TABLE ${s} ADD COLUMN ${r} ${c}`)};t("goap_execution_steps","execution_id","TEXT"),t("goap_execution_steps","retries","INTEGER DEFAULT 0"),t("goap_execution_steps","started_at","TEXT"),t("goap_execution_steps","agent_output","TEXT"),t("goap_actions","method","TEXT"),t("goap_actions","params","TEXT"),t("goap_actions","implemented","INTEGER DEFAULT 0"),e.exec("CREATE INDEX IF NOT EXISTS idx_goap_exec_steps_execution ON goap_execution_steps(execution_id)")}async loadVectorIndex(){if(this.vectorsLoaded)return;if(!this.db)throw new Error("Database not initialized");this.vectorIndex.clear();let e=this.db.prepare("SELECT id, embedding, dimensions FROM vectors").all();for(let t of e){let s=this.bufferToFloatArray(t.embedding,t.dimensions);this.vectorIndex.add(t.id,s)}this.vectorsLoaded=!0,console.log(`[UnifiedMemory] Loaded ${e.length} vectors into vector index (ruvector flat)`)}writeWhenUnlocked(e){let t=()=>Xe(this.db,e,{waitMs:Q(this.config.busyTimeout),budgetMs:this.config.busyTimeout}),s=this.queuedWrites===0?t():this.writeQueue.then(()=>new Promise(c=>setImmediate(c))).then(t);this.queuedWrites++;let r=s.then(()=>{},()=>{});return this.writeQueue=r,r.then(()=>{this.queuedWrites--}),s}async kvSet(e,t,s="default",r){this.ensureInitialized();let c=r?Date.now()+r*1e3:null,a=JSON.stringify(t);await this.writeWhenUnlocked(()=>this.db.prepare(`
|
|
769
769
|
INSERT OR REPLACE INTO kv_store (key, namespace, value, expires_at)
|
|
770
770
|
VALUES (?, ?, ?, ?)
|
|
771
|
-
`).run(e,s,a,c),this.auditWrite("kvSet",s,e,a)}async kvGet(e,t="default"){this.ensureInitialized();let s=this.db.prepare(`
|
|
771
|
+
`).run(e,s,a,c)),this.auditWrite("kvSet",s,e,a)}async kvGet(e,t="default"){this.ensureInitialized();let s=this.db.prepare(`
|
|
772
772
|
SELECT value, expires_at FROM kv_store
|
|
773
773
|
WHERE key = ? AND namespace = ?
|
|
774
|
-
`).get(e,t);if(s){if(s.expires_at&&Date.now()>s.expires_at){this.db.prepare("DELETE FROM kv_store WHERE key = ? AND namespace = ?").run(e,t)
|
|
774
|
+
`).get(e,t);if(s){if(s.expires_at&&Date.now()>s.expires_at){try{Z(this.db,Q(this.config.busyTimeout),()=>this.db.prepare("DELETE FROM kv_store WHERE key = ? AND namespace = ?").run(e,t))}catch(r){if(!J(r))throw r}return}return I(s.value)}}async kvDelete(e,t="default"){this.ensureInitialized();let s=await this.writeWhenUnlocked(()=>this.db.prepare("DELETE FROM kv_store WHERE key = ? AND namespace = ?").run(e,t));return s.changes>0&&this.auditWrite("kvDelete",t,e,""),s.changes>0}async kvExists(e,t="default"){return this.ensureInitialized(),this.db.prepare(`
|
|
775
775
|
SELECT 1 FROM kv_store
|
|
776
776
|
WHERE key = ? AND namespace = ? AND (expires_at IS NULL OR expires_at > ?)
|
|
777
777
|
`).get(e,t,Date.now())!==void 0}async kvSearch(e,t="default",s=100){this.ensureInitialized();let r=e.replace(/[!%_]/g,"!$&").replace(/\*/g,"%").replace(/\?/g,"_");return this.db.prepare(`
|
|
@@ -779,14 +779,14 @@ import{d as W,f as lt}from"./chunk-6NIGSY5L.js";import{b as I,d as _e}from"./chu
|
|
|
779
779
|
WHERE namespace = ? AND key LIKE ? ESCAPE '!'
|
|
780
780
|
AND (expires_at IS NULL OR expires_at > ?)
|
|
781
781
|
LIMIT ?
|
|
782
|
-
`).all(t,r,Date.now(),s).map(a=>a.key)}async kvCleanupExpired(){return this.ensureInitialized(),this.db.prepare("DELETE FROM kv_store WHERE expires_at IS NOT NULL AND expires_at < ?").run(Date.now()).changes}enableProofGate(){this.ensureInitialized(),this.proofGateEnvChecked=!0,!this.proofGate&&(this.proofGate=this.loadProofChain()??new
|
|
782
|
+
`).all(t,r,Date.now(),s).map(a=>a.key)}async kvCleanupExpired(){return this.ensureInitialized(),(await this.writeWhenUnlocked(()=>this.db.prepare("DELETE FROM kv_store WHERE expires_at IS NOT NULL AND expires_at < ?").run(Date.now()))).changes}enableProofGate(){this.ensureInitialized(),this.proofGateEnvChecked=!0,!this.proofGate&&(this.proofGate=this.loadProofChain()??new b)}isProofGateEnabled(){return this.proofGate!==null}verifyMemoryIntegrity(){if(!this.proofGate)throw new Error("Proof-gate not enabled \u2014 call enableProofGate() or set AQE_PROOF_GATE=1");return this.proofGate.verifyIntegrity()}getProofChainRoot(){return this.proofGate?this.proofGate.chainRoot():null}getProofChainLength(){return this.proofGate?this.proofGate.length:0}auditWrite(e,t,s,r){if(!this.proofGate){if(this.proofGateEnvChecked||(this.proofGateEnvChecked=!0,process.env.AQE_PROOF_GATE!=="1"))return;this.proofGate=this.loadProofChain()??new b}if(t!==n.PROOF_NS)try{this.proofGate.admit({op:e,ns:t,key:s,value:r}),this.persistProofChain()}catch(c){w.warn(`proof-gate audit skipped for ${t}/${s}: ${A(c)}`)}}persistProofChain(){!this.proofGate||!this.db||this.db.prepare(`
|
|
783
783
|
INSERT OR REPLACE INTO kv_store (key, namespace, value, expires_at)
|
|
784
784
|
VALUES (?, ?, ?, NULL)
|
|
785
785
|
`).run(n.PROOF_KEY,n.PROOF_NS,JSON.stringify(this.proofGate.toJSON()))}loadProofChain(){if(!this.db)return null;let e=this.db.prepare(`
|
|
786
786
|
SELECT value FROM kv_store WHERE key = ? AND namespace = ?
|
|
787
|
-
`).get(n.PROOF_KEY,n.PROOF_NS);if(!e)return null;try{return
|
|
787
|
+
`).get(n.PROOF_KEY,n.PROOF_NS);if(!e)return null;try{return b.fromJSON(JSON.parse(e.value))}catch(t){return w.warn(`proof-gate chain failed to load (starting fresh): ${A(t)}`),null}}async vectorStore(e,t,s="default",r){this.ensureInitialized();let c=this.floatArrayToBuffer(t),a=r?JSON.stringify(r):null;await this.writeWhenUnlocked(()=>this.db.prepare(`
|
|
788
788
|
INSERT OR REPLACE INTO vectors (id, namespace, embedding, dimensions, metadata, updated_at)
|
|
789
789
|
VALUES (?, ?, ?, ?, ?, datetime('now'))
|
|
790
|
-
`).run(e,s,c,t.length,a),this.vectorIndex.add(e,t)}async vectorGet(e){this.ensureInitialized();let t=this.db.prepare(`
|
|
790
|
+
`).run(e,s,c,t.length,a)),this.vectorIndex.add(e,t)}async vectorGet(e){this.ensureInitialized();let t=this.db.prepare(`
|
|
791
791
|
SELECT embedding, dimensions, metadata FROM vectors WHERE id = ?
|
|
792
|
-
`).get(e);if(t)return{embedding:this.bufferToFloatArray(t.embedding,t.dimensions),metadata:t.metadata?I(t.metadata):void 0}}async vectorDelete(e){this.ensureInitialized();let t=this.db.prepare("DELETE FROM vectors WHERE id = ?").run(e);return this.vectorIndex.remove(e),t.changes>0}async vectorSearch(e,t=10,s,r){if(this.ensureInitialized(),!Number.isInteger(t)||t<=0)return[];this.vectorsLoaded||await this.loadVectorIndex();let c=this.vectorIndex.size(),a=!!(s||r),T=Math.min(c,Math.max(a?t*2:t,1)),l=s?this.db.prepare("SELECT id, namespace, metadata FROM vectors WHERE namespace = ?").all(s):void 0,
|
|
792
|
+
`).get(e);if(t)return{embedding:this.bufferToFloatArray(t.embedding,t.dimensions),metadata:t.metadata?I(t.metadata):void 0}}async vectorDelete(e){this.ensureInitialized();let t=await this.writeWhenUnlocked(()=>this.db.prepare("DELETE FROM vectors WHERE id = ?").run(e));return this.vectorIndex.remove(e),t.changes>0}async vectorSearch(e,t=10,s,r){if(this.ensureInitialized(),!Number.isInteger(t)||t<=0)return[];this.vectorsLoaded||await this.loadVectorIndex();let c=this.vectorIndex.size(),a=!!(s||r),T=Math.min(c,Math.max(a?t*2:t,1)),l=s?this.db.prepare("SELECT id, namespace, metadata FROM vectors WHERE namespace = ?").all(s):void 0,d=l?new Map(l.map(g=>[g.id,g])):void 0,u=this.vectorIndex.search(e,T);for(;a&&u.filter(g=>(!r||g.id.startsWith(r))&&(!d||d.has(g.id))).length<t&&T<c;)T=Math.min(c,T*2),u=this.vectorIndex.search(e,T);if(u.length===0)return[];let m=d??(()=>{let g=u.map(R=>R.id),_=g.map(()=>"?").join(","),L=this.db.prepare(`SELECT id, namespace, metadata FROM vectors WHERE id IN (${_})`).all(...g);return new Map(L.map(R=>[R.id,R]))})();if(s){let g=[];for(let _ of u){let L=m.get(_.id);if(L&&L.namespace===s&&(!r||_.id.startsWith(r))&&(g.push({id:_.id,score:_.score,metadata:L.metadata?I(L.metadata):void 0}),g.length>=t))break}return g}return(r?u.filter(g=>g.id.startsWith(r)).slice(0,t):u.slice(0,t)).map(g=>{let _=m.get(g.id);return{id:g.id,score:g.score,metadata:_?.metadata?I(_.metadata):void 0}})}migrateToV13EmbeddingSpace(){let e=this.db;if(!e.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_pattern_embeddings'").get()){e.exec(Qe);return}e.prepare("PRAGMA table_info('qe_pattern_embeddings')").all().some(r=>r.name==="space_id")||e.exec("ALTER TABLE qe_pattern_embeddings ADD COLUMN space_id TEXT"),e.exec("CREATE INDEX IF NOT EXISTS idx_qe_pattern_embeddings_space ON qe_pattern_embeddings(space_id)")}getVectorSearchProvenance(){return this.vectorIndex.getProvider().isNativeBackend()?{backend:"native-hnsw",indexType:"hnsw",approximate:!0,estimatedRecall:this.vectorIndex.recall(),qualifiedMaxK:Le.EF_SEARCH}:{backend:"progressive-hnsw",indexType:"flat",approximate:!1,estimatedRecall:1}}async vectorCount(e){return this.ensureInitialized(),e?this.db.prepare("SELECT COUNT(*) as count FROM vectors WHERE namespace = ?").get(e).count:this.db.prepare("SELECT COUNT(*) as count FROM vectors").get().count}queryCount(e){this.ensureInitialized();let t=v(e);return this.db.prepare(`SELECT COUNT(*) as c FROM ${t}`).get().c}initializeCRDT(e){if(this.crdtStore){console.warn("[UnifiedMemory] CRDT store already initialized");return}this.crdtStore=pe({nodeId:e}),console.log(`[UnifiedMemory] CRDT store initialized for node: ${e}`)}getCRDTStore(){return this.crdtStore}isCRDTInitialized(){return this.crdtStore!==null}async crdtSet(e,t,s="crdt"){this.ensureInitialized(),this.crdtStore&&this.crdtStore.setRegister(e,t),await this.kvSet(e,t,s)}async crdtGet(e,t="crdt"){if(this.crdtStore){let s=this.crdtStore.getRegister(e);if(s)return s.get()}return this.kvGet(e,t)}crdtIncrement(e,t=1){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");let s=this.crdtStore.getCounter(e);s||(this.crdtStore.incrementCounter(e,0),s=this.crdtStore.getCounter(e));for(let r=0;r<t;r++)this.crdtStore.incrementCounter(e)}crdtGetCounter(e){return this.crdtStore?this.crdtStore.getCounter(e)?.get()??0:0}crdtAddToSet(e,t){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");this.crdtStore.addToSet(e,t)}crdtRemoveFromSet(e,t){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");this.crdtStore.removeFromSet(e,t)}crdtGetSet(e){if(!this.crdtStore)return new Set;let t=this.crdtStore.getSet(e);return new Set(t.values())}crdtGetState(){return this.crdtStore?this.crdtStore.getState():null}crdtGetDelta(e){return this.crdtStore?this.crdtStore.getDelta(e??0):null}crdtMerge(e){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");this.crdtStore.applyState(e)}crdtApplyDelta(e){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");this.crdtStore.applyDelta(e)}async crdtPersist(){if(!this.crdtStore)return;let e=this.crdtStore.getState();await this.kvSet("__crdt_state__",e,"crdt-internal")}async crdtRestore(){if(!this.crdtStore)return!1;let e=await this.kvGet("__crdt_state__","crdt-internal");return e?(this.crdtStore.applyState(e),!0):!1}getDatabase(){if(!this.db||!this.initialized)throw new Error("UnifiedMemoryManager not initialized");return this.db}isInitialized(){return this.initialized}getDbPath(){return this.config.dbPath}prepare(e,t){if(!this.db)throw new Error("Database not initialized");let s=this.preparedStatements.get(e);return s||(s=this.db.prepare(t),this.preparedStatements.set(e,s)),s}transaction(e){if(!this.db)throw new Error("Database not initialized");return this.db.transaction(e)()}getStats(){if(!this.db)throw new Error("Database not initialized");let e=tt.map(r=>{try{let c=this.db.prepare(`SELECT COUNT(*) as count FROM ${r}`).get();return{name:r,rowCount:c.count}}catch(c){return w.debug("Table row count query failed",{table:r,error:c instanceof Error?c.message:String(c)}),{name:r,rowCount:0}}}),t=0,s=0;try{N.existsSync(this.config.dbPath)&&(t=N.statSync(this.config.dbPath).size);let r=this.config.dbPath+"-wal";N.existsSync(r)&&(s=N.statSync(r).size)}catch(r){console.debug("[UnifiedMemory] File stat error:",r instanceof Error?r.message:r)}return{tables:e,fileSize:t,walSize:s,vectorIndexSize:this.vectorIndex.size()}}vacuum(){if(!this.db)throw new Error("Database not initialized");this.db.exec("VACUUM")}checkpoint(){if(!this.db)throw new Error("Database not initialized");this.db.pragma("wal_checkpoint(TRUNCATE)")}close(){this.db&&(this.preparedStatements.clear(),this.vectorIndex.clear(),he(this.db),this.db.close(),this.db=null,this.initialized=!1,console.log("[UnifiedMemory] Database closed"))}ensureInitialized(){if(!this.initialized||!this.db)throw new Error("UnifiedMemoryManager not initialized. Call initialize() first.")}floatArrayToBuffer(e){let t=Buffer.alloc(e.length*4);for(let s=0;s<e.length;s++)t.writeFloatLE(e[s],s*4);return t}bufferToFloatArray(e,t){let s=new Float32Array(e.buffer,e.byteOffset,t);return Array.from(s)}};Et=!1;qt()});export{J as a,Z as b,Xe as c,Wt as d,Ue as e,te as f,v as g,$t as h,ne as i,ke as j,re as k,Be as l,Dt as m,je as n,ae as o,ce as p,it as q,ot as r,ut as s,lt as t,gt as u,D as v,pt as w,Gt as x,Pt as y,kt as z,Bt as A,jt as B};
|
|
@@ -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.15.
|
|
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.15.16");process.exit(0)}
|
|
2
2
|
var l=class m{vertices=new Map;edges=new Map;adjacencyList=new Map;totalWeight=0;addVertex(e){if(this.vertices.has(e.id)){this.vertices.set(e.id,e);return}this.vertices.set(e.id,e),this.adjacencyList.set(e.id,[])}removeVertex(e){if(!this.vertices.has(e))return!1;let t=this.adjacencyList.get(e)||[];for(let r of t)this.removeEdge(e,r.neighborId);for(let[,r]of this.adjacencyList){let n=r.findIndex(i=>i.neighborId===e);n!==-1&&(this.totalWeight-=r[n].weight,r.splice(n,1))}return this.vertices.delete(e),this.adjacencyList.delete(e),!0}getVertex(e){return this.vertices.get(e)}hasVertex(e){return this.vertices.has(e)}getVertices(){return Array.from(this.vertices.values())}getVertexIds(){return Array.from(this.vertices.keys())}getVerticesByDomain(e){return this.getVertices().filter(t=>t.domain===e)}getVerticesByType(e){return this.getVertices().filter(t=>t.type===e)}addEdge(e){if(!this.vertices.has(e.source))throw new Error(`Source vertex ${e.source} does not exist`);if(!this.vertices.has(e.target))throw new Error(`Target vertex ${e.target} does not exist`);let t=this.edgeKey(e.source,e.target);if(this.edges.has(t)){let r=this.edges.get(t);this.totalWeight-=r.weight,this.removeFromAdjacency(e.source,e.target),r.bidirectional&&this.removeFromAdjacency(e.target,e.source)}this.edges.set(t,e),this.totalWeight+=e.weight,this.addToAdjacency(e.source,e.target,e.weight,e),e.bidirectional&&this.addToAdjacency(e.target,e.source,e.weight,e)}removeEdge(e,t){let r=this.edgeKey(e,t),n=this.edges.get(r);return n?(this.totalWeight-=n.weight,this.edges.delete(r),this.removeFromAdjacency(e,t),n.bidirectional&&this.removeFromAdjacency(t,e),!0):!1}getEdge(e,t){return this.edges.get(this.edgeKey(e,t))}hasEdge(e,t){return this.edges.has(this.edgeKey(e,t))}getEdges(){return Array.from(this.edges.values())}getEdgesForVertex(e){return(this.adjacencyList.get(e)||[]).map(r=>r.edge)}degree(e){return this.adjacencyList.get(e)?.length||0}weightedDegree(e){let t=this.adjacencyList.get(e);return t?t.reduce((r,n)=>r+n.weight,0):0}neighbors(e){return(this.adjacencyList.get(e)||[]).map(r=>({vertex:this.vertices.get(r.neighborId),weight:r.weight})).filter(r=>r.vertex!==void 0)}neighborIds(e){return(this.adjacencyList.get(e)||[]).map(r=>r.neighborId)}getStats(){let e=this.vertices.size,t=this.edges.size,r=0;for(let[,s]of this.adjacencyList)r+=s.length;let n=e>0?r/e:0,i=e>1?e*(e-1)/2:0,a=i>0?t/i:0,o=this.countConnectedComponents(),c=o===1&&e>0;return{vertexCount:e,edgeCount:t,totalWeight:this.totalWeight,averageDegree:n,density:a,isConnected:c,componentCount:o}}countConnectedComponents(){let e=new Set,t=0;for(let r of this.vertices.keys())e.has(r)||(this.dfs(r,e),t++);return t}dfs(e,t){t.add(e);let r=this.adjacencyList.get(e)||[];for(let n of r)t.has(n.neighborId)||this.dfs(n.neighborId,t)}isConnected(){if(this.vertices.size===0||this.vertices.size===1)return!0;let e=new Set,t=this.vertices.keys().next().value;return t===void 0?!0:(this.dfs(t,e),e.size===this.vertices.size)}getConnectedComponent(e){if(!this.vertices.has(e))return[];let t=new Set;return this.dfs(e,t),Array.from(t)}snapshot(){return{timestamp:new Date,vertices:this.getVertices(),edges:this.getEdges(),stats:this.getStats()}}clone(){let e=new m;for(let t of this.vertices.values())e.addVertex({...t});for(let t of this.edges.values())e.addEdge({...t});return e}static fromSnapshot(e){let t=new m;for(let r of e.vertices)t.addVertex(r);for(let r of e.edges)t.addEdge(r);return t}clear(){this.vertices.clear(),this.edges.clear(),this.adjacencyList.clear(),this.totalWeight=0}get vertexCount(){return this.vertices.size}get edgeCount(){return this.edges.size}isEmpty(){return this.vertices.size===0}edgeKey(e,t){return e<t?`${e}:${t}`:`${t}:${e}`}addToAdjacency(e,t,r,n){let i=this.adjacencyList.get(e);i&&(i.find(o=>o.neighborId===t)||i.push({neighborId:t,weight:r,edge:n}))}removeFromAdjacency(e,t){let r=this.adjacencyList.get(e);if(r){let n=r.findIndex(i=>i.neighborId===t);n!==-1&&r.splice(n,1)}}};function p(){return new l}var f=class{approxMinCut(e){let t=Date.now();if(e.isEmpty())return this.emptyResult(t,"weighted-degree");let r=e.getVertexIds(),n=1/0,i=null;for(let o of r){let c=e.weightedDegree(o);c<n&&(n=c,i=o)}if(i===null||r.length===1)return this.emptyResult(t,"weighted-degree");let a=e.getEdgesForVertex(i);return{value:n,sourceSide:[i],targetSide:r.filter(o=>o!==i),cutEdges:a,calculatedAt:new Date,algorithm:"weighted-degree",durationMs:Date.now()-t}}findWeakVertices(e,t){if(e.isEmpty())return[];let r=e.getVertices(),n=[],i=new Map,a=0;for(let g of r){let h=e.weightedDegree(g.id);i.set(g.id,h),a+=h}let o=a/r.length,c=0;for(let g of i.values())c+=(g-o)**2;let s=Math.sqrt(c/r.length),d=1/0;for(let g of i.values())g<d&&(d=g);let u=t??o-s;for(let g of r){let h=i.get(g.id);if(h<=u){let w=this.calculateRiskScore(h,o,s,d),y=this.determineWeakReason(g,h,o,e),v=this.generateStrengtheningActions(g,e,h);n.push({vertexId:g.id,vertex:g,weightedDegree:h,riskScore:w,reason:y,suggestions:v})}}return n.sort((g,h)=>h.riskScore-g.riskScore),n}getMinCutValue(e){if(e.isEmpty())return 0;let t=1/0;for(let r of e.getVertexIds()){let n=e.weightedDegree(r);n<t&&(t=n)}return t===1/0?0:t}isConnectivityCritical(e,t){return this.getMinCutValue(e)<t}getMinDegreeVertex(e){if(e.isEmpty())return null;let t=1/0,r=null;for(let n of e.getVertexIds()){let i=e.weightedDegree(n);i<t&&(t=i,r=n)}return r?{vertexId:r,degree:t}:null}getLocalMinCut(e,t){return e.hasVertex(t)?e.weightedDegree(t):0}findPartitioningPoints(e){if(e.isEmpty()||e.vertexCount<2)return[];let t=this.findArticulationPoints(e),r=[];for(let n of e.getVertices()){let i=this.getLocalMinCut(e,n.id);r.push({vertexId:n.id,localMinCut:i,wouldDisconnect:t.has(n.id)&&e.vertexCount>2})}return r.sort((n,i)=>n.localMinCut-i.localMinCut),r}findArticulationPoints(e){let t=new Map,r=new Map,n=new Map,i=new Set,a=0,o=e.getVertexIds();for(let s of o)t.set(s,-1),r.set(s,-1),n.set(s,null);let c=s=>{let d=0;t.set(s,a),r.set(s,a),a++;for(let u of e.neighborIds(s))t.get(u)===-1?(d++,n.set(u,s),c(u),r.set(s,Math.min(r.get(s),r.get(u))),n.get(s)===null&&d>1&&i.add(s),n.get(s)!==null&&r.get(u)>=t.get(s)&&i.add(s)):u!==n.get(s)&&r.set(s,Math.min(r.get(s),t.get(u)))};for(let s of o)t.get(s)===-1&&c(s);return i}suggestEdgeAdditions(e,t){let r=this.findWeakVertices(e),n=[],i=0,a=e.getVertices().map(o=>({vertex:o,degree:e.weightedDegree(o.id)})).sort((o,c)=>c.degree-o.degree);for(let o of r){if(i>=t)break;let c=new Set(e.neighborIds(o.vertexId));for(let{vertex:s}of a){if(s.id===o.vertexId||c.has(s.id))continue;let d={source:o.vertexId,target:s.id,weight:1,type:"coordination",bidirectional:!0};n.push(d),i+=1;break}}return n}emptyResult(e,t){return{value:0,sourceSide:[],targetSide:[],cutEdges:[],calculatedAt:new Date,algorithm:t,durationMs:Date.now()-e}}calculateRiskScore(e,t,r,n){if(r===0)return .5;let i=(t-e)/r,a=1/(1+Math.exp(-i)),o=n>0?n/e:1;return Math.min(1,a*o)}determineWeakReason(e,t,r,n){return t===0?"Isolated vertex with no connections":n.degree(e.id)===1?"Single connection point (leaf node)":t<r*.5?`Low connectivity (${(t/r*100).toFixed(0)}% of average)`:"Below average connectivity threshold"}generateStrengtheningActions(e,t,r){let n=[],i=new Set(t.neighborIds(e.id)),a=t.getStats().averageDegree,o=Math.max(a,3),c=Math.ceil(o-r),s=t.getVertices().filter(d=>d.id!==e.id&&!i.has(d.id)).sort((d,u)=>t.weightedDegree(u.id)-t.weightedDegree(d.id)).slice(0,c);for(let d of s)n.push({type:"add_edge",targetVertex:d.id,priority:"high",estimatedImprovement:1});return e.type==="agent"&&e.domain&&r<1&&n.push({type:"spawn_agent",domain:e.domain,priority:"critical",estimatedImprovement:2}),i.size>0&&i.size<3&&n.push({type:"increase_weight",weightDelta:.5,priority:"medium",estimatedImprovement:.5*i.size}),n}};function x(){return new f}export{l as a,p as b,f as c,x as d};
|
|
@@ -0,0 +1,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.15.16");process.exit(0)}
|
|
2
|
+
import{n as E,o as _}from"./chunk-M4FRQ4TE.js";import{j as g,n as S}from"./chunk-DXD6K2ZP.js";function R(i,e){return{ingest(t){i.ingest(t)},search(t,r){return i.search(t,r).map(s=>({id:s.id,score:s.score}))},delete(t){i.delete(t)},status(){let t=i.status();return{totalVectors:t.totalVectors,dimensions:e,totalSegments:t.totalSegments,fileSizeBytes:t.fileSizeBytes,epoch:t.epoch,witnessValid:t.witnessValid,witnessEntries:t.witnessEntries}},close(){i.close()},compact(){return i.compact()}}}function f(i,e){return(i.prepare("SELECT COUNT(*) as cnt FROM sqlite_master WHERE type='table' AND name=?").get(e)?.cnt??0)>0}function m(i,e,t){return i.prepare(`PRAGMA table_info(${e})`).all().some(s=>s.name===t)}var h=class{db;config;rvfStore=null;rvfAvailable=!1;constructor(e,t){this.db=e,this.config={...t,dimensions:t.dimensions??384},f(this.db,"qe_pattern_embeddings")&&!m(this.db,"qe_pattern_embeddings","space_id")&&(this.db.exec("ALTER TABLE qe_pattern_embeddings ADD COLUMN space_id TEXT"),this.db.exec("CREATE INDEX IF NOT EXISTS idx_qe_pattern_embeddings_space ON qe_pattern_embeddings(space_id)"))}activeSpaceId(){return this.config.embeddingSpaceId??E()?.spaceId}async initialize(){if(this.config.mode==="sqlite-only"){this.rvfAvailable=!1;return}try{let e=await import("./rvf-native-adapter-7YFW6S4Y.js");if(!e.isRvfNativeAvailable()){this.rvfAvailable=!1;return}if(this.activeSpaceId()||await _(),!this.activeSpaceId()){this.rvfAvailable=!1,g();return}let{isRvfLockHeldError:t,removeStaleRvfLock:r,quarantineUnusableStore:s}=await import("./rvf-store-integrity-VJDUIRTX.js"),l=()=>{try{return{store:e.openRvfStore(this.config.rvfPath),error:null}}catch(o){return{store:null,error:o}}},{store:n,error:a}=l();if(!n&&t(a)&&(!r(this.config.rvfPath)||({store:n,error:a}=l(),!n&&t(a))))throw a;if(!n)try{n=e.createRvfStore(this.config.rvfPath,this.config.dimensions)}catch(o){if({store:n,error:a}=l(),!n){if(t(a))throw a;if(!s(this.config.rvfPath,o instanceof Error?o.message:String(o),a))throw o;n=e.createRvfStore(this.config.rvfPath,this.config.dimensions)}}this.rvfStore=R(n,this.config.dimensions),S(this.config.rvfPath,this.activeSpaceId()??null,this.rvfStore.status().totalVectors),this.rvfAvailable=!0}catch(e){try{this.rvfStore?.close()}catch{}this.rvfStore=null,this.rvfAvailable=!1,console.warn(`[RVF] Dual-writer disabled for ${this.config.rvfPath}; falling back to SQLite: ${e instanceof Error?e.message:String(e)}`)}}setRvfStore(e){this.rvfStore=e,this.rvfAvailable=!0}writePattern(e,t){let r={sqliteSuccess:!1,rvfSuccess:!1};if(!m(this.db,"qe_pattern_embeddings","space_id")||!this.activeSpaceId())return{...r,divergence:"VECTOR_SPACE_UNVERIFIED"};try{this.writeSqliteEmbedding(e,t),r.sqliteSuccess=!0}catch{r.sqliteSuccess=!1}if(this.shouldWriteRvf())try{this.rvfStore.ingest([{id:e,vector:t instanceof Float32Array?Array.from(t):t}]),r.rvfSuccess=!0}catch{r.rvfSuccess=!1,r.divergence="rvf-write-failed"}return r}deletePattern(e){let t={sqliteSuccess:!1,rvfSuccess:!1};try{this.deleteSqliteEmbedding(e),t.sqliteSuccess=!0}catch{t.sqliteSuccess=!1}if(this.shouldWriteRvf())try{this.rvfStore.delete([e]),t.rvfSuccess=!0}catch{t.rvfSuccess=!1,t.divergence="rvf-delete-failed"}return t}search(e,t){if(!this.hasCompatibleEmbeddingSpace())return[];if(this.config.mode==="rvf-primary"&&this.rvfAvailable&&this.rvfStore)try{return this.rvfStore.search(e,t)}catch{}return this.searchSqlite(e,t)}getDivergenceReport(){let e={totalChecked:0,divergences:0,details:[]},t=this.getSqliteEmbeddingCount();if(e.totalChecked=t,!this.rvfAvailable||!this.rvfStore)return this.config.mode!=="sqlite-only"&&t>0&&(e.divergences=1,e.details.push({patternId:"*",issue:"count-mismatch"})),e;let s=this.rvfStore.status().totalVectors;return t!==s&&(e.divergences=1,e.details.push({patternId:"*",issue:"count-mismatch"})),e}isPromotionSafe(){return this.getDivergenceReport().divergences===0}status(){let e=this.getSqlitePatternCount(),t=this.getSqliteEmbeddingCount(),r=null;if(this.rvfAvailable&&this.rvfStore)try{r=this.rvfStore.status()}catch{r=null}return{sqlite:{patternCount:e,vectorCount:t},rvf:r,mode:this.config.mode}}close(){if(this.rvfStore){try{this.rvfStore.close()}catch{}this.rvfStore=null,this.rvfAvailable=!1}}compact(){if(!this.rvfStore||!this.rvfAvailable||!this.rvfStore.compact)return null;try{return this.rvfStore.compact()??null}catch{return null}}shouldWriteRvf(){return(this.config.mode==="dual-write"||this.config.mode==="rvf-primary")&&this.rvfAvailable&&this.rvfStore!==null}hasCompatibleEmbeddingSpace(){if(!m(this.db,"qe_pattern_embeddings","space_id"))return!1;let e=this.activeSpaceId();return e?(this.db.prepare(`
|
|
3
|
+
SELECT COUNT(*) AS incompatible
|
|
4
|
+
FROM qe_pattern_embeddings
|
|
5
|
+
WHERE space_id IS NULL OR space_id <> ?
|
|
6
|
+
`).get(e)?.incompatible??0)===0:!1}writeSqliteEmbedding(e,t){let r=Buffer.from(t instanceof Float32Array?t.buffer:new Float32Array(t).buffer),s=t.length;if(f(this.db,"qe_pattern_embeddings")){let l=this.activeSpaceId();if(m(this.db,"qe_pattern_embeddings","space_id")){if(!l)throw new Error("VECTOR_SPACE_UNVERIFIED: dual writer has no runtime provenance");this.db.prepare(`
|
|
7
|
+
INSERT INTO qe_pattern_embeddings (pattern_id, embedding, dimension, model, space_id, created_at)
|
|
8
|
+
VALUES (?, ?, ?, 'all-MiniLM-L6-v2', ?, datetime('now'))
|
|
9
|
+
ON CONFLICT(pattern_id) DO UPDATE SET
|
|
10
|
+
embedding = excluded.embedding,
|
|
11
|
+
dimension = excluded.dimension,
|
|
12
|
+
space_id = excluded.space_id,
|
|
13
|
+
created_at = datetime('now')
|
|
14
|
+
`).run(e,r,s,l);return}throw new Error("VECTOR_SPACE_UNVERIFIED: canonical space_id column is unavailable")}}deleteSqliteEmbedding(e){f(this.db,"qe_pattern_embeddings")&&this.db.prepare("DELETE FROM qe_pattern_embeddings WHERE pattern_id = ?").run(e)}getSqliteEmbeddingCount(){return f(this.db,"qe_pattern_embeddings")?this.db.prepare("SELECT COUNT(*) as cnt FROM qe_pattern_embeddings").get()?.cnt??0:0}getSqlitePatternCount(){return f(this.db,"qe_patterns")?this.db.prepare("SELECT COUNT(*) as cnt FROM qe_patterns").get()?.cnt??0:0}searchSqlite(e,t){if(!f(this.db,"qe_pattern_embeddings"))return[];let r=this.activeSpaceId();if(!m(this.db,"qe_pattern_embeddings","space_id")||!r)return[];let l=this.db.prepare("SELECT pattern_id, embedding, dimension FROM qe_pattern_embeddings WHERE space_id = ?").all(r),n=e instanceof Float32Array?Array.from(e):e,a=Math.sqrt(n.reduce((c,u)=>c+u*u,0));if(a===0)return[];let o=[];for(let c of l){let u=new Float32Array(c.embedding.buffer,c.embedding.byteOffset,c.dimension),p=Array.from(u),b=0,v=0;for(let d=0;d<p.length&&d<n.length;d++)b+=p[d]*n[d],v+=p[d]*p[d];v=Math.sqrt(v);let q=v>0?b/(a*v):0;o.push({id:c.pattern_id,score:q})}return o.sort((c,u)=>u.score-c.score),o.slice(0,t)}};function w(i,e){return new h(i,e)}export{h as a,w as b};
|
|
@@ -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.15.
|
|
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.15.16");process.exit(0)}
|
|
2
2
|
function r(e,f){if(e==null)return e;let n={...e};for(let t of f){let o=n[t];typeof o=="string"&&(n[t]=new Date(o))}return n}export{r 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.15.
|
|
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.15.16");process.exit(0)}
|
|
2
2
|
var i=["qe-pentest-validator","qe-security-auditor","qe-security-scanner","qe-security-reviewer"],s="claude-sonnet-4-6",a=`anthropic/${s.replace("4-6","4.6")}`,u=s,p=new Set(["opus","fable"]),l=/claude-(opus|fable)-(\d+)(?:[-.](\d{1,2})(?!\d))?/,o={major:4,minor:7};function E(e){let r=e.trim().toLowerCase();if(p.has(r))return!0;let n=l.exec(r);if(!n)return!1;let t=Number(n[2]),c=n[3]===void 0?0:Number(n[3]);return t>o.major||t===o.major&&c>=o.minor}function _(e,r=process.env){return r.AQE_CYBER_VERIFIED==="true"?!1:i.includes(e)}function d(e,r,n,t=process.env){return!_(e,t)||!E(r)?r:n}function f(e){switch(e){case"openrouter":return a;case"bedrock":return"anthropic.claude-sonnet-4-6-v1:0";default:return u}}export{a,u as b,E as c,_ as d,d as e,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.15.
|
|
2
|
-
import{e as l,l as c}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.16");process.exit(0)}
|
|
2
|
+
import{e as l,l as c}from"./chunk-GAHNO6JJ.js";import{a as i}from"./chunk-NVEWF4JV.js";import{a as n,e as h}from"./chunk-KNSRL6NO.js";h();var d=class extends c{config={name:"qe/tests/schedule",description:"Schedule and execute tests using phase-based pipeline with git-aware selection and flaky tracking. Runs tests in phases (unit, integration, e2e), selects affected tests from git changes, and tracks flaky tests.",domain:"test-execution",schema:this.buildSchema()};buildSchema(){return{type:"object",properties:{cwd:{type:"string",description:"Working directory for test execution (defaults to project root)"},gitRef:{type:"string",description:'Git ref to compare for affected test selection (e.g., "main", "HEAD~3")'},useGitAware:{type:"boolean",description:"Enable git-aware test selection to only run affected tests",default:!0},trackFlaky:{type:"boolean",description:"Enable flaky test tracking and quarantine",default:!0}}}}async execute(s,o){if(s.gitRef!==void 0){let a=i(s.gitRef,"gitRef");if(a)return{success:!1,error:a}}try{let{runTestPipeline:a}=await import("./test-scheduling-ISI2O4Q5.js"),u=await l(o),t=await a({cwd:s.cwd||process.cwd(),memory:u,baseRef:s.gitRef,flakyHistoryPath:s.trackFlaky!==!1?".agentic-qe/flaky-history.json":void 0,runAllTests:s.useGitAware===!1}),f=t.phaseResults.reduce((e,r)=>e+r.totalTests,0),p=t.phaseResults.reduce((e,r)=>e+r.passed,0),g=t.phaseResults.reduce((e,r)=>e+r.failed,0);return{success:!0,data:{pipelineId:o.requestId,phases:t.phaseResults.map(e=>({phaseId:e.phaseId,phaseName:e.phaseName,totalTests:e.totalTests,passed:e.passed,failed:e.failed,passRate:e.passRate,durationMs:e.durationMs})),gitAware:{enabled:!t.ranAllTests,selectedTests:t.selectedTests.length,gitRef:s.gitRef},flakyTracking:{enabled:s.trackFlaky!==!1},totalDuration:t.totalDurationMs,ranAllTests:t.ranAllTests,summary:`Executed ${t.phaseResults.length} phases, ${f} tests (${p} passed, ${g} failed) in ${t.totalDurationMs}ms`}}}catch(a){return{success:!1,error:n(a)}}}};export{d 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.15.
|
|
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.15.16");process.exit(0)}
|
|
2
2
|
var i=/[\s\x00-\x1f\x7f]/;function e(t,n="git ref"){if(typeof t!="string"||t.length===0)return`Invalid ${n}: must be a non-empty string`;if(t.length>256)return`Invalid ${n}: longer than 256 characters`;if(t.startsWith("-"))return`Invalid ${n} "${t}": must not start with "-"`;if(i.test(t))return`Invalid ${n}: must not contain whitespace or control characters`}function s(t,n="git ref"){let r=e(t,n);if(r)throw new Error(r)}export{e as a,s as b};
|