agentic-qe 3.13.5 → 3.13.7
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/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +73 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-UIYF2P3E.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-XDKGG2GP.js → agent-booster-wasm-UOGKPGRU.js} +2 -2
- package/dist/cli/chunks/{agent-handler-CTPXGR5P.js → agent-handler-Q5R4WGEK.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-MG5OV7AY.js → agent-memory-branch-NHG52BFD.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-CKTFFDJ4.js +2 -0
- package/dist/cli/chunks/{arena-FAHVOHNG.js → arena-IV4MYEYB.js} +2 -2
- package/dist/cli/chunks/{arena-NYO4EUNQ.js → arena-PMAHTPQB.js} +4 -4
- package/dist/cli/chunks/{audit-6544RL5D.js → audit-PVN2O2AU.js} +3 -3
- package/dist/cli/chunks/base-I3FB7F6R.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-MTEONNCQ.js → better-sqlite3-4KVBGOT6.js} +2 -2
- package/dist/cli/chunks/{brain-handler-DPKCUQUC.js → brain-handler-GSJJVXQW.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-SU2KHC2C.js → branch-enumerator-OQU3U6FI.js} +2 -2
- package/dist/cli/chunks/{browser-ITDN72YJ.js → browser-CXOMLHII.js} +2 -2
- package/dist/cli/chunks/browser-workflow-NQ5SWXEP.js +2 -0
- package/dist/cli/chunks/{chunk-EROQSNGD.js → chunk-224MLOCT.js} +2 -2
- package/dist/cli/chunks/{chunk-JX5IY2YK.js → chunk-2LJNRAUF.js} +1 -1
- package/dist/cli/chunks/{chunk-YGMCRJSC.js → chunk-2QAJDG4E.js} +2 -2
- package/dist/cli/chunks/{chunk-W7H46LAX.js → chunk-3KVQOIOI.js} +1 -1
- package/dist/cli/chunks/{chunk-6L5V3JGJ.js → chunk-3MDGSITG.js} +1 -1
- package/dist/cli/chunks/{chunk-AKZ6PWHM.js → chunk-3SBO6CDL.js} +2 -2
- package/dist/cli/chunks/{chunk-D4P6BKGF.js → chunk-45QJQSLD.js} +3 -3
- package/dist/cli/chunks/{chunk-EXXWOOUL.js → chunk-46H7GRXK.js} +3 -3
- package/dist/cli/chunks/{chunk-74QRMQFR.js → chunk-4LGZGIQL.js} +2 -2
- package/dist/cli/chunks/{chunk-KAVYTFAS.js → chunk-4PNXUJMO.js} +2 -2
- package/dist/cli/chunks/{chunk-3XKCC7LE.js → chunk-5EFWFB3L.js} +1 -1
- package/dist/cli/chunks/{chunk-JID7JO7K.js → chunk-5FWWHLQ3.js} +2 -2
- package/dist/cli/chunks/{chunk-CD4YWKJ2.js → chunk-5LGNTDKU.js} +2 -2
- package/dist/cli/chunks/{chunk-IS3P5VBL.js → chunk-5VE4GP67.js} +2 -2
- package/dist/cli/chunks/{chunk-YG45ZONW.js → chunk-6COKVAQM.js} +2 -2
- package/dist/cli/chunks/{chunk-EPMUAKU2.js → chunk-6F5UFJIA.js} +2 -2
- package/dist/cli/chunks/{chunk-IC5JGTM4.js → chunk-6VMQH2G3.js} +1 -1
- package/dist/cli/chunks/{chunk-AX4XIG4G.js → chunk-6YUBBESI.js} +2 -2
- package/dist/cli/chunks/{chunk-54C3OHES.js → chunk-75MQX436.js} +1 -1
- package/dist/cli/chunks/{chunk-THQ5ZBWP.js → chunk-7644FEFM.js} +2 -2
- package/dist/cli/chunks/{chunk-XNGYWOAK.js → chunk-77OIG5EX.js} +2 -2
- package/dist/cli/chunks/{chunk-WZI2REDL.js → chunk-7CYA7JBH.js} +2 -2
- package/dist/cli/chunks/{chunk-VRV7CXEM.js → chunk-7F2KPWTO.js} +1 -1
- package/dist/cli/chunks/{chunk-G47WJMHM.js → chunk-7XA2YLCK.js} +1 -1
- package/dist/cli/chunks/chunk-7ZSEZOEQ.js +15 -0
- package/dist/cli/chunks/{chunk-OGUPLNRY.js → chunk-A3QP6NWO.js} +1 -1
- package/dist/cli/chunks/{chunk-6ZCAZ3TR.js → chunk-A3XAWNOW.js} +2 -2
- package/dist/cli/chunks/{chunk-ZUIPUO7Q.js → chunk-ABWZERCN.js} +1 -1
- package/dist/cli/chunks/chunk-AF7EKTC3.js +2 -0
- package/dist/cli/chunks/{chunk-LELWVGN6.js → chunk-ALN3LOMK.js} +1 -1
- package/dist/cli/chunks/{chunk-UGER2PGN.js → chunk-AUJZUMJ2.js} +4 -4
- package/dist/cli/chunks/{chunk-ND7IWTVQ.js → chunk-AXHKDE6N.js} +2 -2
- package/dist/cli/chunks/{chunk-YFD6K7AS.js → chunk-BCF6GEFU.js} +23 -23
- package/dist/cli/chunks/{chunk-6H3I36DL.js → chunk-BP63FIKW.js} +2 -2
- package/dist/cli/chunks/{chunk-YSWI3APU.js → chunk-BUHD5KMR.js} +2 -2
- package/dist/cli/chunks/{chunk-PSD2L2JB.js → chunk-BX32VXZP.js} +2 -2
- package/dist/cli/chunks/{chunk-2QI3OJAC.js → chunk-C4LN2HKE.js} +3 -3
- package/dist/cli/chunks/{chunk-K55D3PAR.js → chunk-CMDMOKGH.js} +3 -3
- package/dist/cli/chunks/{chunk-HBYVYLBN.js → chunk-COM3MXBJ.js} +2 -2
- package/dist/cli/chunks/{chunk-42KQE5H6.js → chunk-CPDTUQGT.js} +3 -3
- package/dist/cli/chunks/{chunk-YU4U3BUY.js → chunk-CT5ZBNWB.js} +1 -1
- package/dist/cli/chunks/{chunk-TU5S33SD.js → chunk-DM3S4WNW.js} +2 -2
- package/dist/cli/chunks/{chunk-GHSP4AC5.js → chunk-DNAB56KC.js} +1 -1
- package/dist/cli/chunks/{chunk-VE5STFDP.js → chunk-DPEI46VM.js} +2 -2
- package/dist/cli/chunks/{chunk-DIRFXY3J.js → chunk-DRTXG2DG.js} +2 -2
- package/dist/cli/chunks/{chunk-SQDHFTGQ.js → chunk-DXLDSACI.js} +3 -3
- package/dist/cli/chunks/{chunk-SN57SNLU.js → chunk-EPYGDRMU.js} +2 -2
- package/dist/cli/chunks/{chunk-MX35PIGJ.js → chunk-EV7S4J35.js} +2 -2
- package/dist/cli/chunks/{chunk-OF5UL3FA.js → chunk-EXIV2D3R.js} +1 -1
- package/dist/cli/chunks/{chunk-2KPGJ4LO.js → chunk-EXXAQ3ZT.js} +2 -2
- package/dist/cli/chunks/{chunk-NVZ3QROA.js → chunk-F55LPGNQ.js} +2 -2
- package/dist/cli/chunks/{chunk-OJZ5LI3O.js → chunk-FFJ4T5P7.js} +1 -1
- package/dist/cli/chunks/{chunk-CHFZHORO.js → chunk-FT3I5BNS.js} +5 -5
- package/dist/cli/chunks/{chunk-OUWZTYRZ.js → chunk-FWU55NEY.js} +2 -2
- package/dist/cli/chunks/chunk-GAYYOIRM.js +2 -0
- package/dist/cli/chunks/{chunk-ZWLFEZQC.js → chunk-GC5TDDOT.js} +1 -1
- package/dist/cli/chunks/{chunk-5YIGAWBO.js → chunk-GDCPI6GS.js} +2 -2
- package/dist/cli/chunks/{chunk-DK7MV2W3.js → chunk-GIRACYH4.js} +1 -1
- package/dist/cli/chunks/{chunk-UUFLYBUO.js → chunk-GK6U2SQ2.js} +2 -2
- package/dist/cli/chunks/{chunk-2XZWYKXQ.js → chunk-GYQEFUG7.js} +1 -1
- package/dist/cli/chunks/{chunk-7LR4VP2I.js → chunk-H6SKPDAR.js} +1 -1
- package/dist/cli/chunks/{chunk-76OWM3ZO.js → chunk-H7GTLWPW.js} +2 -2
- package/dist/cli/chunks/{chunk-AJYJFIKO.js → chunk-HA6OYSPC.js} +2 -2
- package/dist/cli/chunks/{chunk-QLD2WVWN.js → chunk-HFZYYDV5.js} +2 -2
- package/dist/cli/chunks/{chunk-HZV3J4VQ.js → chunk-HG2QGS2M.js} +2 -2
- package/dist/cli/chunks/{chunk-PKCVQ2I4.js → chunk-HPSL2WBW.js} +1 -1
- package/dist/cli/chunks/{chunk-FW6OPDA6.js → chunk-HT4NYS4F.js} +1 -1
- package/dist/cli/chunks/{chunk-EGI6SKQD.js → chunk-HYQZHUGU.js} +4 -4
- package/dist/cli/chunks/{chunk-2RZ2S6YR.js → chunk-IE3FM6U3.js} +2 -2
- package/dist/cli/chunks/chunk-IVNRCF65.js +2 -0
- package/dist/cli/chunks/{chunk-FQPYD6YE.js → chunk-J5TFIVO2.js} +1 -1
- package/dist/cli/chunks/{chunk-43BXSNKU.js → chunk-J6EK6TC2.js} +2 -2
- package/dist/cli/chunks/{chunk-WDDU4I5Z.js → chunk-JDPYQDKI.js} +1 -1
- package/dist/cli/chunks/{chunk-ZE3WS57T.js → chunk-KS2HVX52.js} +2 -2
- package/dist/cli/chunks/{chunk-DFBJPOJR.js → chunk-L4I2JS74.js} +2 -2
- package/dist/cli/chunks/{chunk-2CF3XZAS.js → chunk-L74WFBDA.js} +2 -2
- package/dist/cli/chunks/{chunk-QIHKSRUZ.js → chunk-LBMJYLGR.js} +2 -2
- package/dist/cli/chunks/{chunk-S2EUFKHL.js → chunk-LHYN6YTN.js} +2 -2
- package/dist/cli/chunks/{chunk-JTUTZUED.js → chunk-LPUWOM7Y.js} +2 -2
- package/dist/cli/chunks/{chunk-6BEMH5K5.js → chunk-LY7UPFTJ.js} +1 -1
- package/dist/cli/chunks/{chunk-LARAXKTZ.js → chunk-MBLO72OZ.js} +2 -2
- package/dist/cli/chunks/{chunk-7A4EXSMN.js → chunk-ME4KYCIL.js} +2 -2
- package/dist/cli/chunks/{chunk-YIEMVVUH.js → chunk-MPGZE4PD.js} +2 -2
- package/dist/cli/chunks/{chunk-AKYOY5KR.js → chunk-MYCMFN33.js} +2 -2
- package/dist/cli/chunks/{chunk-ZOD37GNG.js → chunk-N2PG6TYS.js} +3 -3
- package/dist/cli/chunks/{chunk-RKXN5TVS.js → chunk-NGBJH26X.js} +1 -1
- package/dist/cli/chunks/{chunk-HMNBNGNO.js → chunk-NLK5WBOS.js} +1 -1
- package/dist/cli/chunks/{chunk-PNDWHSZO.js → chunk-NQPS7FM5.js} +2 -2
- package/dist/cli/chunks/{chunk-GUO6JZMS.js → chunk-NY332ER7.js} +2 -2
- package/dist/cli/chunks/{chunk-64GTU5LR.js → chunk-OCAJJUPV.js} +2 -2
- package/dist/cli/chunks/{chunk-DVYNBMMP.js → chunk-ON57SN44.js} +2 -2
- package/dist/cli/chunks/{chunk-BAJK26EI.js → chunk-ORV3E477.js} +2 -2
- package/dist/cli/chunks/{chunk-BX5MY65W.js → chunk-P354IPGG.js} +1 -1
- package/dist/cli/chunks/{chunk-FYWTMDID.js → chunk-PTQYCACC.js} +2 -2
- package/dist/cli/chunks/{chunk-V2T7QEPV.js → chunk-Q6BYBRNA.js} +1 -1
- package/dist/cli/chunks/{chunk-Q3J5OTZ2.js → chunk-Q6LE7RY6.js} +1 -1
- package/dist/cli/chunks/{chunk-7SQXEYII.js → chunk-QDTIOZHQ.js} +2 -2
- package/dist/cli/chunks/{chunk-BI6OTPC6.js → chunk-QFHUATTI.js} +2 -2
- package/dist/cli/chunks/{chunk-KRCIC4JK.js → chunk-QGZLVH3E.js} +2 -2
- package/dist/cli/chunks/{chunk-RDHBUCKQ.js → chunk-QM2QPZOR.js} +10 -10
- package/dist/cli/chunks/{chunk-557BFPDB.js → chunk-QV7PAJHO.js} +2 -2
- package/dist/cli/chunks/{chunk-7M4X6WTF.js → chunk-QVQYDUMR.js} +2 -2
- package/dist/cli/chunks/{chunk-WLY2J6JP.js → chunk-QVXMF6DS.js} +2 -2
- package/dist/cli/chunks/{chunk-PEHSTLU7.js → chunk-RBFX56HK.js} +1 -1
- package/dist/cli/chunks/{chunk-6RV3W2UZ.js → chunk-RJ5G3IZY.js} +1 -1
- package/dist/cli/chunks/{chunk-Z5YNYVFO.js → chunk-RQ4GKJ6H.js} +1 -1
- package/dist/cli/chunks/{chunk-GITS44TM.js → chunk-RSJVIUDH.js} +2 -2
- package/dist/cli/chunks/{chunk-7PHF2JM3.js → chunk-S2SNDC2D.js} +1 -1
- package/dist/cli/chunks/{chunk-G73XY2NK.js → chunk-S3RAJZ2A.js} +2 -2
- package/dist/cli/chunks/{chunk-7BLXINIL.js → chunk-S6CNNFVF.js} +25 -25
- package/dist/cli/chunks/{chunk-L6I2Q6UQ.js → chunk-SI56H5MC.js} +1 -1
- package/dist/cli/chunks/{chunk-OQ4HOHBI.js → chunk-TMTWC6M6.js} +2 -2
- package/dist/cli/chunks/{chunk-BUN4WBPW.js → chunk-U5SAFRHE.js} +2 -2
- package/dist/cli/chunks/{chunk-NFE4RV2Q.js → chunk-ULKMV4XT.js} +2 -2
- package/dist/cli/chunks/{chunk-ELC3UEML.js → chunk-UMWO6V7E.js} +1 -1
- package/dist/cli/chunks/{chunk-R4VDRE75.js → chunk-UOFNGPDM.js} +1 -1
- package/dist/cli/chunks/{chunk-ZMA5OWIQ.js → chunk-UZRZCM2M.js} +4 -4
- package/dist/cli/chunks/{chunk-U5GGDJ44.js → chunk-VA4JFEA6.js} +2 -2
- package/dist/cli/chunks/{chunk-AAGOBPIJ.js → chunk-VHQZBUOP.js} +2 -2
- package/dist/cli/chunks/{chunk-3EWWP3AO.js → chunk-VLWOF654.js} +1 -1
- package/dist/cli/chunks/{chunk-UWM4CCK7.js → chunk-VPQP342J.js} +1 -1
- package/dist/cli/chunks/{chunk-M7456ZW5.js → chunk-VXTNM7PA.js} +1 -1
- package/dist/cli/chunks/{chunk-VNRWJ5JZ.js → chunk-W3T6WFQK.js} +2 -2
- package/dist/cli/chunks/{chunk-23AO43XW.js → chunk-X5R4M2PW.js} +1 -1
- package/dist/cli/chunks/{chunk-JOJ2UFHM.js → chunk-XI2EEMNJ.js} +2 -2
- package/dist/cli/chunks/{chunk-4Z7JP7CD.js → chunk-XNQWCGR5.js} +2 -2
- package/dist/cli/chunks/{chunk-RGBYJAKQ.js → chunk-XQWHBFR4.js} +3 -3
- package/dist/cli/chunks/{chunk-4E2NA2GY.js → chunk-XVCB7KRX.js} +2 -2
- package/dist/cli/chunks/{chunk-QHX7VLVT.js → chunk-XVZZETXQ.js} +2 -2
- package/dist/cli/chunks/{chunk-MF6OT43N.js → chunk-XZMMFR2F.js} +1 -1
- package/dist/cli/chunks/{chunk-APMLMLSL.js → chunk-XZP7AYHS.js} +1 -1
- package/dist/cli/chunks/{chunk-CPIAZGHF.js → chunk-Y2NOIPIR.js} +2 -2
- package/dist/cli/chunks/{chunk-5I5KMIFY.js → chunk-YIAAXMQN.js} +2 -2
- package/dist/cli/chunks/{chunk-L6H4MWVN.js → chunk-YJUME3OF.js} +2 -2
- package/dist/cli/chunks/{chunk-WSSFH23M.js → chunk-YSB6GH53.js} +1 -1
- package/dist/cli/chunks/{chunk-GWBV26SE.js → chunk-Z7KEY7LW.js} +2 -2
- package/dist/cli/chunks/{chunk-PDOL3FGO.js → chunk-ZIN7U72B.js} +3 -3
- package/dist/cli/chunks/{chunk-ZQ7XQLLV.js → chunk-ZRETM57V.js} +3 -3
- package/dist/cli/chunks/{chunk-XACF7ZLM.js → chunk-ZWOIE55K.js} +2 -2
- package/dist/cli/chunks/{ci-IRCNFD32.js → ci-CXCKYXKG.js} +2 -2
- package/dist/cli/chunks/{ci-output-NFOUNDJ2.js → ci-output-OOHIVRSH.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-GB7SQRD2.js → circuit-breaker-32GSBTWS.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-STFKPPVL.js → claude-flow-setup-4S5KMQV7.js} +2 -2
- package/dist/cli/chunks/client-63SX5VIZ.js +2 -0
- package/dist/cli/chunks/{cline-installer-MLKKIHIV.js → cline-installer-WPHR3JAY.js} +2 -2
- package/dist/cli/chunks/{code-ZRCJC42H.js → code-UN2SHAOD.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-VWDYYQY2.js → code-index-extractor-ML7FPQRV.js} +2 -2
- package/dist/cli/chunks/{codex-installer-I5BTWYQV.js → codex-installer-CNQM7D2K.js} +2 -2
- package/dist/cli/chunks/{completions-5JCAFTQV.js → completions-ULBMFDYW.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-6JLLAPGO.js → complexity-analyzer-DNOF6MWS.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-YBOLMUZR.js → continuedev-installer-SALVVLBA.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-GDBJZBXS.js → copilot-installer-2QQT7KAX.js} +2 -2
- package/dist/cli/chunks/core-handlers-LMFAYPU2.js +2 -0
- package/dist/cli/chunks/{cost-tracker-NEAVGEZI.js → cost-tracker-KJHJMCPN.js} +2 -2
- package/dist/cli/chunks/{coverage-DXS5XNAA.js → coverage-A4XD3KK2.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-SVZLA5ZT.js +2 -0
- package/dist/cli/chunks/{cursor-installer-3KEMFIFA.js → cursor-installer-HKSSBI5E.js} +2 -2
- package/dist/cli/chunks/{daemon-JN377KTA.js → daemon-HMRQGUXY.js} +4 -4
- package/dist/cli/chunks/{daemon-FT2J6VY4.js → daemon-PHEIMUIL.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-EJFEWFXI.js → dag-attention-scheduler-WLUSL2PN.js} +2 -2
- package/dist/cli/chunks/{detect-E5MN6N3L.js → detect-CVP3I7EK.js} +2 -2
- package/dist/cli/chunks/{dist-node-ZFSAQMFD.js → dist-node-BGMG54IM.js} +2 -2
- package/dist/cli/chunks/{domain-handler-S7VFZ2MY.js → domain-handler-BBKVSCEY.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-LGHT3FN4.js → domain-transfer-YGSL3GPA.js} +2 -2
- package/dist/cli/chunks/dream-SHNPRLRM.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-OVQS6IKK.js → embed-and-insert-pattern-QSHUNRQG.js} +2 -2
- package/dist/cli/chunks/{eval-45UWDD2R.js → eval-K3EQBGVU.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-XDRJSNPY.js → experience-capture-middleware-EVQXI6U2.js} +3 -3
- package/dist/cli/chunks/{fast-paths-VEDCJL75.js → fast-paths-RCUTEKJN.js} +2 -2
- package/dist/cli/chunks/{feature-flags-TGA3NWVL.js → feature-flags-CG4UQ3QX.js} +2 -2
- package/dist/cli/chunks/{feature-flags-NOTQVBLP.js → feature-flags-WNH7NIHC.js} +2 -2
- package/dist/cli/chunks/{file-discovery-AHMR6IGX.js → file-discovery-HEK73IOG.js} +2 -2
- package/dist/cli/chunks/{fleet-CQBUCH2S.js → fleet-DYJZVSGZ.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-SOZCIONJ.js → gnn-wrapper-562P4VXW.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-6XNV4DGM.js → heartbeat-handler-XHIRKGM2.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-U72YZ3NB.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-U2GLM5AE.js +2 -0
- package/dist/cli/chunks/hnsw-index-32LSC37N.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-UILVP37N.js → hnsw-legacy-bridge-H2PYZ2TT.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-OHJQOSAH.js → hnswlib-node-3AJM5KVO.js} +2 -2
- package/dist/cli/chunks/{hooks-QVDOGEHG.js → hooks-N7F7Z362.js} +47 -47
- package/dist/cli/chunks/hybrid-router-4IEDWMTZ.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-YMVPBXZS.js → hypergraph-engine-MVY2ADYA.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-SHUNZXUK.js → hypergraph-handler-IOS5X4ZI.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-22V4R3YH.js +2 -0
- package/dist/cli/chunks/{init-handler-JE5FYJAV.js → init-handler-UWEA63JI.js} +6 -6
- package/dist/cli/chunks/init-wizard-PPI7JDU6.js +2 -0
- package/dist/cli/chunks/kernel-PL2K5MLT.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-TVP4YOOK.js → kilocode-installer-LUH2XG4P.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-XBSGANX7.js → kiro-installer-F2ZG3FIZ.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-AOE6FEQR.js +2 -0
- package/dist/cli/chunks/learning-XBMJWGAV.js +119 -0
- package/dist/cli/chunks/{llm-router-FXXJHARR.js → llm-router-DRX7E7XI.js} +4 -4
- package/dist/cli/chunks/llm-router-service-3XZI7TE5.js +2 -0
- package/dist/cli/chunks/{load-IVF6G2SK.js → load-Y4QJSQQS.js} +2 -2
- package/dist/cli/chunks/load-test-6DIMN4MM.js +2 -0
- package/dist/cli/chunks/{mcp-VXSDVG3H.js → mcp-62XB5F5Q.js} +2 -2
- package/dist/cli/chunks/{memory-BINJV3M6.js → memory-ONR7ZN3X.js} +7 -7
- package/dist/cli/chunks/memory-backend-UAMIFHQQ.js +2 -0
- package/dist/cli/chunks/memory-handlers-4IAS3VY7.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-RJHYK6JI.js → multi-model-executor-6IUW6I3H.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-VCTF5ETL.js → opencode-installer-W47DIP2D.js} +2 -2
- package/dist/cli/chunks/{orchestrator-5SKZ2BOK.js → orchestrator-FKO5AACT.js} +5 -5
- package/dist/cli/chunks/pattern-null-store-35S3ZRS6.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-AY2DAOQO.js → pattern-usage-recorder-VEPEFTCF.js} +2 -2
- package/dist/cli/chunks/{pipeline-EMBMC75N.js → pipeline-RIITAMZ2.js} +2 -2
- package/dist/cli/chunks/{platform-GADIFXCI.js → platform-SA5TZEZD.js} +2 -2
- package/dist/cli/chunks/{plugin-Q234ZAAY.js → plugin-F4AN3WVB.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-CXXKYB2P.js → prime-radiant-advanced-wasm-Y35DFGMR.js} +2 -2
- package/dist/cli/chunks/protocol-executor-PHJMZT27.js +2 -0
- package/dist/cli/chunks/{protocol-handler-ZZRFBVNA.js → protocol-handler-UCURNXLA.js} +2 -2
- package/dist/cli/chunks/{prove-7674ATXK.js → prove-WS57IMPA.js} +2 -2
- package/dist/cli/chunks/provider-manager-TKDL73H3.js +2 -0
- package/dist/cli/chunks/qe-reasoning-bank-DHEF6CTL.js +2 -0
- package/dist/cli/chunks/{quality-QCIGVN2S.js → quality-6UEGUSJX.js} +2 -2
- package/dist/cli/chunks/{quality-gate-AKV564GE.js → quality-gate-Z4FU2NR2.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-57MCIW2B.js +2 -0
- package/dist/cli/chunks/{real-embeddings-74POUVMX.js → real-embeddings-DFB2TSY3.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-INBL5AG7.js → roocode-installer-TVENBIIA.js} +2 -2
- package/dist/cli/chunks/router-V656FUDE.js +2 -0
- package/dist/cli/chunks/routing-feedback-77GLEBXR.js +2 -0
- package/dist/cli/chunks/{routing-handler-C7HMM7RL.js → routing-handler-LZFOVMDI.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-PT6LRVCW.js → ruvector-commands-HYSHR2XO.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-PRKROTP3.js → rvf-dual-writer-ZDCAEQDN.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-ZI2XW4UX.js → rvf-migration-adapter-64U4XRDC.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-5JTGP35V.js → rvf-migration-coordinator-C3WP56PE.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-34Q74G5N.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-3B5TZTFR.js → rvf-store-integrity-HNVPA6JZ.js} +2 -2
- package/dist/cli/chunks/safe-db-Y754OIYY.js +2 -0
- package/dist/cli/chunks/schedule-GMKXLREO.js +2 -0
- package/dist/cli/chunks/scheduler-OIHBKLRQ.js +2 -0
- package/dist/cli/chunks/{security-IMIWSAHW.js → security-KIR5E67V.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-UDKJNX6I.js → shared-rvf-adapter-AEMVXITE.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-FQOBQ6S5.js → shared-rvf-dual-writer-J55TEO2S.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-QLTL46UG.js +2 -0
- package/dist/cli/chunks/{status-handler-7WON7M7F.js → status-handler-65JO3QZE.js} +2 -2
- package/dist/cli/chunks/{structural-health-JTKTO3A4.js → structural-health-Y5ZIQWSV.js} +2 -2
- package/dist/cli/chunks/{sync-6ABYTAOL.js → sync-DCMEOJAW.js} +2 -2
- package/dist/cli/chunks/{sync-UJSHBY3B.js → sync-TSFE2JJR.js} +2 -2
- package/dist/cli/chunks/{task-handler-5TZNOCCB.js → task-handler-RWGEJWEH.js} +2 -2
- package/dist/cli/chunks/{task-handlers-G7ZUGBHM.js → task-handlers-BXS6YXRM.js} +3 -3
- package/dist/cli/chunks/{test-BSJ6MVTG.js → test-3W2FHMQX.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-OSJJXIYQ.js → test-scheduling-XNH4DWBN.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-MRNFR4YI.js → token-bootstrap-MB3MJMZM.js} +2 -2
- package/dist/cli/chunks/{token-usage-YQN7ND7G.js → token-usage-YO56DQAT.js} +2 -2
- package/dist/cli/chunks/{transformers-QL3AG25C.js → transformers-VQ6LTFGM.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-BECZRRZP.js → tree-sitter-wasm-parser-XSFCTQKS.js} +2 -2
- package/dist/cli/chunks/{types-FQSNLPWS.js → types-72CNMUHH.js} +2 -2
- package/dist/cli/chunks/unified-memory-EG7MANFS.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-GBZ5WSQU.js +2 -0
- package/dist/cli/chunks/unified-persistence-NZRIIHU5.js +2 -0
- package/dist/cli/chunks/{upgrade-2ICXXV6D.js → upgrade-P6ZEWWUQ.js} +2 -2
- package/dist/cli/chunks/{validate-LPAUH2F4.js → validate-Q6HN2RTN.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-VWVE2GM7.js → validate-swarm-JAOHXMJD.js} +2 -2
- package/dist/cli/chunks/{vibium-U3LBEI4K.js → vibium-2A7PDY4D.js} +2 -2
- package/dist/cli/chunks/visual-security-IEPJVARC.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-QGZXQPXU.js → web-tree-sitter-YE53Z4LF.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-GGLQJWUI.js → windsurf-installer-RPTAPUTS.js} +2 -2
- package/dist/cli/chunks/{witness-chain-47A2AXUS.js → witness-chain-CTWDOKUD.js} +2 -2
- package/dist/cli/chunks/witness-chain-ZNAEFUIY.js +2 -0
- package/dist/cli/chunks/{witness-key-manager-FVS7UOWM.js → witness-key-manager-UC3ZLEZI.js} +2 -2
- package/dist/cli/chunks/{workflow-KIZPLTYW.js → workflow-ZETHCXEN.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-B4BRRXDJ.js +2 -0
- package/dist/cli/chunks/{wrappers-ER6XCMT6.js → wrappers-JJCXXF7Y.js} +2 -2
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +16 -27
- package/dist/cli/commands/learning.js +66 -0
- package/dist/cli/commands/memory.js +3 -0
- package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.d.ts +2 -0
- package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.js +14 -0
- package/dist/kernel/hybrid-backend.d.ts +3 -2
- package/dist/kernel/hybrid-backend.js +6 -2
- package/dist/kernel/interfaces.d.ts +12 -2
- package/dist/kernel/memory-backend.d.ts +3 -2
- package/dist/kernel/memory-backend.js +11 -1
- package/dist/kernel/native-hnsw-backend.js +8 -6
- package/dist/kernel/unified-memory.d.ts +3 -1
- package/dist/kernel/unified-memory.js +59 -9
- package/dist/learning/real-embeddings.js +1 -1
- package/dist/learning/sqlite-persistence.d.ts +3 -2
- package/dist/learning/sqlite-persistence.js +7 -8
- package/dist/mcp/bundle.js +277 -277
- package/dist/mcp/handlers/memory-handlers.d.ts +2 -0
- package/dist/mcp/handlers/memory-handlers.js +15 -7
- package/dist/mcp/types.d.ts +10 -0
- package/package.json +4 -2
- package/dist/cli/chunks/adapter-QGJAFSG5.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-ZU735SG7.js +0 -2
- package/dist/cli/chunks/base-EKTX2PRE.js +0 -2
- package/dist/cli/chunks/browser-workflow-BUPIMI3E.js +0 -2
- package/dist/cli/chunks/chunk-BKI5NFQ5.js +0 -2
- package/dist/cli/chunks/chunk-ELKWYWTD.js +0 -2
- package/dist/cli/chunks/chunk-WAELEQP5.js +0 -2
- package/dist/cli/chunks/chunk-X53GJW2E.js +0 -15
- package/dist/cli/chunks/client-M4WF22UT.js +0 -2
- package/dist/cli/chunks/core-handlers-3MNFXL44.js +0 -2
- package/dist/cli/chunks/cross-domain-router-Q5X6ZLJY.js +0 -2
- package/dist/cli/chunks/dream-5QB6JABW.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-ZRLIMPKO.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-R4VAEQ2B.js +0 -2
- package/dist/cli/chunks/hnsw-index-GTUOS6DF.js +0 -2
- package/dist/cli/chunks/hybrid-router-CYEXFWDT.js +0 -2
- package/dist/cli/chunks/impact-analyzer-HMJ7LAXR.js +0 -2
- package/dist/cli/chunks/init-wizard-OIK6S3PQ.js +0 -2
- package/dist/cli/chunks/kernel-NZCGR72Y.js +0 -2
- package/dist/cli/chunks/knowledge-graph-HA7XW46B.js +0 -2
- package/dist/cli/chunks/learning-O4ZXQVRE.js +0 -117
- package/dist/cli/chunks/llm-router-service-FVGQSXYC.js +0 -2
- package/dist/cli/chunks/load-test-IQTO35GE.js +0 -2
- package/dist/cli/chunks/memory-backend-YGSOJ7SI.js +0 -2
- package/dist/cli/chunks/memory-handlers-BJNFJZFP.js +0 -2
- package/dist/cli/chunks/pattern-null-store-4WN5O2PF.js +0 -2
- package/dist/cli/chunks/protocol-executor-EYTJXPXY.js +0 -2
- package/dist/cli/chunks/provider-manager-TM3JHYLL.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-6JLFP3HE.js +0 -2
- package/dist/cli/chunks/queen-coordinator-OKGOKGHI.js +0 -2
- package/dist/cli/chunks/router-J45OF4SP.js +0 -2
- package/dist/cli/chunks/routing-feedback-VTZFH57X.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-BDPUBFNP.js +0 -2
- package/dist/cli/chunks/safe-db-FHJBWJIB.js +0 -2
- package/dist/cli/chunks/schedule-LP7YYT4P.js +0 -2
- package/dist/cli/chunks/scheduler-BOZWGKJG.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-TDM36AHF.js +0 -2
- package/dist/cli/chunks/unified-memory-6PHUOZRH.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-WYSFH3PS.js +0 -2
- package/dist/cli/chunks/unified-persistence-QBGHDCCO.js +0 -2
- package/dist/cli/chunks/visual-security-LH7DRCDS.js +0 -2
- package/dist/cli/chunks/witness-chain-2BDZOPJ2.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-UYOPFK2T.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.13.
|
|
2
|
-
import{b as y,d as p}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.7");process.exit(0)}
|
|
2
|
+
import{b as y,d as p}from"./chunk-NGBJH26X.js";import{i as h}from"./chunk-Q6BYBRNA.js";var f={healthyThreshold:3,warningThreshold:2,checkIntervalMs:5e3,maxHistoryEntries:100,alertsEnabled:!0,alertCooldownMs:6e4,selfHealingEnabled:!1,maxHealingActionsPerMinute:5};var g=class{calculator;config;eventBus;persistence;graph;history=[];alerts=new Map;lastAlertTime=new Map;monitoringInterval=null;isMonitoring=!1;constructor(e,t={},r,i){this.graph=e,this.config={...f,...t},this.calculator=p(),this.eventBus=r,this.persistence=i}start(){this.isMonitoring||(this.isMonitoring=!0,this.monitoringInterval=setInterval(()=>this.checkHealth(),this.config.checkIntervalMs),this.checkHealth())}stop(){this.monitoringInterval&&(clearInterval(this.monitoringInterval),this.monitoringInterval=null),this.isMonitoring=!1}updateGraph(e){this.graph=e,this.isMonitoring&&this.checkHealth()}isEmptyTopology(){return this.graph.getVerticesByType("agent").length===0}checkHealth(){let e=this.calculator.getMinCutValue(this.graph),t=this.calculator.findWeakVertices(this.graph),r=this.isEmptyTopology()?"idle":this.determineStatus(e),i=this.calculateTrend();return this.recordHistory(e),this.isEmptyTopology()||this.checkAlertConditions(e,t,r),this.persistence&&t.length>0&&this.persistence.saveWeakVertices(t).catch(n=>console.warn("[MinCutHealthMonitor] Failed to persist weak vertices:",n)),this.emitEvent("mincut.updated",e,{status:r,weakVertexCount:t.length}),{status:r,minCutValue:e,healthyThreshold:this.config.healthyThreshold,warningThreshold:this.config.warningThreshold,weakVertexCount:t.length,topWeakVertices:t.slice(0,5),trend:i,history:this.history.slice(-20),lastUpdated:new Date}}getHealth(){let e=this.calculator.getMinCutValue(this.graph),t=this.calculator.findWeakVertices(this.graph);return{status:this.isEmptyTopology()?"idle":this.determineStatus(e),minCutValue:e,healthyThreshold:this.config.healthyThreshold,warningThreshold:this.config.warningThreshold,weakVertexCount:t.length,topWeakVertices:t.slice(0,5),trend:this.calculateTrend(),history:this.history.slice(-20),lastUpdated:new Date}}getMinCutValue(){return this.calculator.getMinCutValue(this.graph)}getWeakVertices(){return this.calculator.findWeakVertices(this.graph)}isCritical(){return this.calculator.getMinCutValue(this.graph)<this.config.warningThreshold}isHealthy(){return this.calculator.getMinCutValue(this.graph)>=this.config.healthyThreshold}getActiveAlerts(){return Array.from(this.alerts.values()).filter(e=>!e.acknowledged).sort((e,t)=>{let r={critical:0,high:1,medium:2,low:3,info:4};return r[e.severity]-r[t.severity]})}getAllAlerts(){return Array.from(this.alerts.values())}acknowledgeAlert(e){let t=this.alerts.get(e);return t?(t.acknowledged=!0,!0):!1}clearAcknowledgedAlerts(){let e=[];for(let[t,r]of this.alerts)r.acknowledged&&e.push(t);for(let t of e)this.alerts.delete(t);return e.length}getHistory(){return[...this.history]}getTrend(){return this.calculateTrend()}getStats(e=6e4){let t=Date.now()-e,r=this.history.filter(n=>n.timestamp.getTime()>t);if(r.length===0){let n=this.calculator.getMinCutValue(this.graph);return{min:n,max:n,average:n,count:0}}let i=r.map(n=>n.value);return{min:Math.min(...i),max:Math.max(...i),average:i.reduce((n,a)=>n+a,0)/i.length,count:r.length}}updateConfig(e){Object.assign(this.config,e),e.checkIntervalMs&&this.isMonitoring&&(this.stop(),this.start())}getConfig(){return{...this.config}}determineStatus(e){return e>=this.config.healthyThreshold?"healthy":e>=this.config.warningThreshold?"warning":"critical"}calculateTrend(){if(this.history.length<3)return"stable";let e=this.history.slice(-5),t=e[0].value,i=e[e.length-1].value-t,a=e.reduce((o,c)=>o+c.value,0)/e.length*.1;return i>a?"improving":i<-a?"degrading":"stable"}recordHistory(e){let t={timestamp:new Date,value:e,vertexCount:this.graph.vertexCount,edgeCount:this.graph.edgeCount};for(this.history.push(t);this.history.length>this.config.maxHistoryEntries;)this.history.shift()}checkAlertConditions(e,t,r){if(!this.config.alertsEnabled)return;let i=Date.now();r==="critical"?this.maybeGenerateAlert("critical-threshold","critical",`MinCut value (${e.toFixed(2)}) is below critical threshold (${this.config.warningThreshold})`,e,this.config.warningThreshold,t):r==="warning"&&this.maybeGenerateAlert("warning-threshold","high",`MinCut value (${e.toFixed(2)}) is below healthy threshold (${this.config.healthyThreshold})`,e,this.config.healthyThreshold,t);let n=t.filter(o=>o.weightedDegree===0);n.length>0&&this.maybeGenerateAlert("isolated-vertices","high",`${n.length} isolated vertex(es) detected`,e,0,n);let a=t.filter(o=>o.riskScore>.8);a.length>0&&this.maybeGenerateAlert("critical-vertices","medium",`${a.length} critical vertex(es) with high risk score`,e,0,a)}maybeGenerateAlert(e,t,r,i,n,a){let o=Date.now(),c=this.lastAlertTime.get(e)||0;if(o-c<this.config.alertCooldownMs)return;let s={id:h(),severity:t,message:r,minCutValue:i,threshold:n,affectedVertices:a.map(l=>l.vertexId),timestamp:new Date,acknowledged:!1,remediations:a.flatMap(l=>l.suggestions).slice(0,5)};this.alerts.set(s.id,s),this.persistence&&this.persistence.saveAlert(s).catch(l=>console.warn("[MinCutHealthMonitor] Failed to persist alert:",l)),this.lastAlertTime.set(e,o),this.emitEvent("mincut.alert.generated",i,{alert:s})}emitEvent(e,t,r){if(!this.eventBus)return;let i={id:h(),type:e,source:"coordination",timestamp:new Date,correlationId:h(),payload:{minCutValue:t,...r}};this.eventBus.publish(i).catch(n=>{console.error("Failed to publish MinCut event:",n)})}};function v(m,e,t,r){return new g(m,e,t,r)}var d=null,u=null;function C(){return d||(d=y()),d}function P(){return u||(u=v(C())),u}function B(){return d!==null}function F(){return u!==null}export{f as a,v as b,C as c,P as d,B as e,F as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.
|
|
2
|
-
import{c as f}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.13.7");process.exit(0)}
|
|
2
|
+
import{c as f}from"./chunk-YSB6GH53.js";import*as o from"fs";import*as n from"path";function u(){t=null}function g(c=process.cwd()){if(t)return t;if(process.env.AQE_PROJECT_ROOT)return t=process.env.AQE_PROJECT_ROOT,t;let l=c,a=n.parse(l).root,e=l,i=null,s=null,r=null;for(;e!==a;)o.existsSync(n.join(e,".agentic-qe"))&&i===null&&(i=e),o.existsSync(n.join(e,".git"))&&s===null&&(s=e),o.existsSync(n.join(e,"package.json"))&&(r=e),e=n.dirname(e);return i?t=i:s?t=s:r?t=r:t=process.cwd(),t}var t,p=f(()=>{"use strict";t=null});export{u as a,g as b,p as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.
|
|
2
|
-
import{b as k,c as p}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.7");process.exit(0)}
|
|
2
|
+
import{b as k,c as p}from"./chunk-QVQYDUMR.js";p();import{generateKeyPairSync as g,createPrivateKey as v,createPublicKey as I,sign as m,verify as D,createHash as b}from"crypto";import{existsSync as d,mkdirSync as P,writeFileSync as y,readFileSync as o,readdirSync as w}from"fs";import{join as n}from"path";var f=class{keys=new Map;activeKeyId=null;keyDir;constructor(e={}){this.keyDir=e.keyDir??null,this.keyDir&&this.loadFromDisk(),e.autoGenerate!==!1&&this.keys.size===0&&this.generateKeyPair()}generateKeyPair(){let{publicKey:e,privateKey:i}=g("ed25519"),r=e.export({type:"spki",format:"der"}),t=b("sha256").update(r).digest("hex").slice(0,16),s={keyId:t,publicKey:e,privateKey:i,createdAt:new Date().toISOString(),retired:!1};return this.keys.set(t,s),this.activeKeyId=t,this.keyDir&&(this.saveKeyPairToDisk(s),this.saveActiveKeyId()),{keyId:t,publicKey:r}}sign(e,i){let r=i??this.activeKeyId;if(!r)throw new Error("No active key available for signing");let t=this.keys.get(r);if(!t)throw new Error(`Key not found: ${r}`);return{signature:m(null,e,t.privateKey),keyId:r}}verify(e,i,r){let t=this.keys.get(r);if(!t)return!1;try{return D(null,e,t.publicKey,i)}catch{return!1}}rotateKey(){let e=this.activeKeyId;if(!e)throw new Error("No active key to rotate");let i=this.keys.get(e);i&&(i.retired=!0,this.keyDir&&this.saveKeyPairToDisk(i));let{keyId:r}=this.generateKeyPair();return{oldKeyId:e,newKeyId:r}}getActiveKeyId(){if(!this.activeKeyId)throw new Error("No active key");return this.activeKeyId}hasKey(e){return this.keys.has(e)}getKeyCount(){return this.keys.size}saveKeyPairToDisk(e){if(!this.keyDir)return;d(this.keyDir)||P(this.keyDir,{recursive:!0});let i=n(this.keyDir,e.keyId);y(`${i}.pub.pem`,e.publicKey.export({type:"spki",format:"pem"}),"utf-8"),y(`${i}.key.pem`,e.privateKey.export({type:"pkcs8",format:"pem"}),{encoding:"utf-8",mode:384}),y(`${i}.meta.json`,JSON.stringify({keyId:e.keyId,createdAt:e.createdAt,retired:e.retired}),"utf-8")}saveActiveKeyId(){!this.keyDir||!this.activeKeyId||y(n(this.keyDir,"active-key-id"),this.activeKeyId,"utf-8")}loadFromDisk(){if(!this.keyDir||!d(this.keyDir))return;let i=w(this.keyDir).filter(t=>t.endsWith(".meta.json"));for(let t of i)try{let s=JSON.parse(o(n(this.keyDir,t),"utf-8")),a=n(this.keyDir,s.keyId),l=o(`${a}.pub.pem`,"utf-8"),K=o(`${a}.key.pem`,"utf-8"),h={keyId:s.keyId,publicKey:I(l),privateKey:v(K),createdAt:s.createdAt,retired:s.retired};this.keys.set(s.keyId,h)}catch{}let r=n(this.keyDir,"active-key-id");if(d(r)){let t=o(r,"utf-8").trim();this.keys.has(t)&&(this.activeKeyId=t)}if(!this.activeKeyId){let t=[...this.keys.values()].filter(s=>!s.retired).sort((s,a)=>a.createdAt.localeCompare(s.createdAt));t.length>0&&(this.activeKeyId=t[0].keyId)}}},c=null;function F(){if(!c){let u=n(k(),".agentic-qe","witness-keys");c=new f({keyDir:u})}return c}function O(){c=null}export{f as a,F as b,O as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.
|
|
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.13.7");process.exit(0)}
|
|
2
2
|
import{writeFileSync as p,readFileSync as m}from"node:fs";import{resolve as f,dirname as c,join as d}from"node:path";import{mkdirSync as g}from"node:fs";import{fileURLToPath as h}from"node:url";function $(){try{let e=typeof __dirname<"u"?__dirname:c(h(import.meta.url));for(let t=0;t<5;t++){let n=d(e,"package.json");try{let r=JSON.parse(m(n,"utf-8"));if(r.version)return r.version}catch{}e=c(e)}}catch{}return"unknown"}var T=["-F, --format <format>","Output format (text|json|sarif|junit|markdown)","text"],x=["-o, --output <path>","Write output to file instead of stdout"];function C(e,t,n){if(t){let r=f(t);g(c(r),{recursive:!0}),p(r,e,"utf-8"),n&&console.log(n),console.log(`Output written to: ${r}`)}else console.log(e)}function R(e){return JSON.stringify(e,null,2)}var v="https://raw.githubusercontent.com/oasis-tcs/sarif-spec/main/sarif-2.1/schema/sarif-schema-2.1.0.json";function w(e){let t=i=>{switch(i.toLowerCase()){case"critical":case"high":return"error";case"medium":return"warning";case"low":case"info":return"note";default:return"warning"}},n=new Map,r=[];for(let i of e.vulnerabilities){let o=i.ruleId||`AQE/${i.type.replace(/\s+/g,"-").toLowerCase()}`;n.has(o)||n.set(o,{id:o,name:i.type,shortDescription:i.type,...i.cweId?{helpUri:`https://cwe.mitre.org/data/definitions/${i.cweId.replace("CWE-","")}.html`}:{}}),r.push({ruleId:o,level:t(i.severity),message:{text:i.message},locations:[{physicalLocation:{artifactLocation:{uri:i.file,uriBaseId:"%SRCROOT%"},region:{startLine:i.line,startColumn:1}}}],...i.cweId?{taxa:[{id:i.cweId,toolComponent:{name:"CWE"}}]}:{}})}let s={$schema:v,version:"2.1.0",runs:[{tool:{driver:{name:"agentic-qe",version:$(),informationUri:"https://github.com/proffesor-for-testing/agentic-qe",rules:Array.from(n.values()).map(i=>({id:i.id,name:i.name,shortDescription:{text:i.shortDescription},...i.helpUri?{helpUri:i.helpUri}:{},defaultConfiguration:{level:"warning"}}))}},results:r,invocations:[{executionSuccessful:!0,commandLine:`aqe security --sast --format sarif -t ${e.target}`}]}]};return JSON.stringify(s,null,2)}function a(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function I(e){let t=e.tests||[],n=e.passed+e.failed+e.skipped,r=(e.duration/1e3).toFixed(3),s=`<?xml version="1.0" encoding="UTF-8"?>
|
|
3
3
|
`;if(s+=`<testsuites tests="${n}" failures="${e.failed}" errors="0" time="${r}">
|
|
4
4
|
`,s+=` <testsuite name="aqe-test-run" tests="${n}" failures="${e.failed}" errors="0" skipped="${e.skipped}" time="${r}" id="${a(e.runId)}">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.
|
|
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.13.7");process.exit(0)}
|
|
2
2
|
var i={copilot:{id:"copilot",name:"GitHub Copilot",configPath:".vscode/mcp.json",configFormat:"json",configKey:"servers",rulesPath:".github/copilot-instructions.md",rulesFormat:"markdown",supportsAutoApprove:!1,supportsCustomModes:!1,globalConfig:!1},cursor:{id:"cursor",name:"Cursor",configPath:".cursor/mcp.json",configFormat:"json",configKey:"mcpServers",rulesPath:".cursorrules",rulesFormat:"markdown",supportsAutoApprove:!1,supportsCustomModes:!1,globalConfig:!1},cline:{id:"cline",name:"Cline",configPath:".vscode/cline_mcp_settings.json",configFormat:"json",configKey:"mcpServers",rulesPath:".vscode/cline_custom_modes.json",rulesFormat:"json",supportsAutoApprove:!0,supportsCustomModes:!0,globalConfig:!1},kilocode:{id:"kilocode",name:"Kilo Code",configPath:".kilocode/mcp.json",configFormat:"json",configKey:"mcpServers",rulesPath:".kilocode/modes.json",rulesFormat:"json",supportsAutoApprove:!0,supportsCustomModes:!0,globalConfig:!1},roocode:{id:"roocode",name:"Roo Code",configPath:".roo/mcp.json",configFormat:"json",configKey:"mcpServers",rulesPath:".roo/modes.json",rulesFormat:"json",supportsAutoApprove:!0,supportsCustomModes:!0,globalConfig:!1},codex:{id:"codex",name:"OpenAI Codex CLI",configPath:".codex/config.toml",configFormat:"toml",configKey:"mcp_servers",rulesPath:"AGENTS.md",rulesFormat:"markdown",supportsAutoApprove:!1,supportsCustomModes:!1,globalConfig:!1},windsurf:{id:"windsurf",name:"Windsurf",configPath:".windsurf/mcp_config.json",configFormat:"json",configKey:"mcpServers",rulesPath:".windsurfrules",rulesFormat:"markdown",supportsAutoApprove:!1,supportsCustomModes:!1,globalConfig:!1},continuedev:{id:"continuedev",name:"Continue.dev",configPath:".continue/config.yaml",configFormat:"yaml",configKey:"mcpServers",rulesPath:".continue/rules/aqe-qe-standards.yaml",rulesFormat:"yaml",supportsAutoApprove:!1,supportsCustomModes:!1,globalConfig:!1}},l=["fleet_init","fleet_status","fleet_health","agent_list","agent_metrics","agent_status","team_list","team_health","task_list","task_status","test_generate_enhanced","coverage_analyze_sublinear","quality_assess","defect_predict","code_index","memory_store","memory_retrieve","memory_query","memory_usage","model_route","routing_metrics","aqe_health"];function u(t){return t?{AQE_MEMORY_BACKEND:"memory",AQE_V3_MODE:"true"}:{AQE_MEMORY_PATH:".agentic-qe/memory.db",AQE_V3_MODE:"true"}}function m(t,o){let e={command:"npx",args:["-y","agentic-qe@latest","mcp"],env:u(o)};return t&&(e.disabled=!1,e.alwaysAllow=l),e}function g(t,o){let e=m(t.supportsAutoApprove,o);if(t.id==="copilot"){let r={[t.configKey]:{"agentic-qe":{type:"stdio",...e}}};return JSON.stringify(r,null,2)+`
|
|
3
3
|
`}let n={[t.configKey]:{"agentic-qe":e}};return JSON.stringify(n,null,2)+`
|
|
4
4
|
`}function f(t){return`# Agentic QE MCP Server
|
|
@@ -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.13.
|
|
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.13.7");process.exit(0)}
|
|
2
2
|
import{isIP as o}from"net";import{lookup as n}from"dns/promises";var f=[/^10\./,/^172\.(1[6-9]|2\d|3[01])\./,/^192\.168\./,/^127\./,/^0\./,/^169\.254\./,/^::1$/,/^fc00:/,/^fe80:/,/^fd[0-9a-f]{2}:/i];function t(r){return f.some(s=>s.test(r))}async function u(r){if(process.env.AQE_HOOKS_SSRF_DISABLED==="true")return{safe:!0};let s;try{s=new URL(r)}catch{return{safe:!1,reason:`Invalid URL: ${r}`}}let e=s.hostname.replace(/^\[|\]$/g,"");if(o(e))return t(e)?{safe:!1,reason:`Private IP blocked: ${e}`}:{safe:!0};try{let a=await n(e);if(t(a.address))return{safe:!1,reason:`DNS resolves to private IP: ${a.address}`}}catch(a){return{safe:!1,reason:`DNS lookup failed for ${e}: ${a.message}`}}return{safe:!0}}export{t as a,u as b};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.
|
|
2
|
-
import{a as L}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.7");process.exit(0)}
|
|
2
|
+
import{a as L}from"./chunk-VLWOF654.js";import*as w from"fs";var R={"aqe test generate":{domain:"test-generation",action:"generateTests"},"aqe test execute":{domain:"test-execution",action:"execute"},"aqe coverage analyze":{domain:"coverage-analysis",action:"analyze"},"aqe coverage gaps":{domain:"coverage-analysis",action:"detectGaps"},"aqe quality gate":{domain:"quality-assessment",action:"evaluateGate"},"aqe quality assess":{domain:"quality-assessment",action:"analyzeQuality"},"aqe security scan":{domain:"security-compliance",action:"runSASTScan"},"aqe security audit":{domain:"security-compliance",action:"runAudit"},"aqe defect predict":{domain:"defect-intelligence",action:"predictDefects"},"aqe code index":{domain:"code-intelligence",action:"index"},"aqe code impact":{domain:"code-intelligence",action:"analyzeImpact"},"aqe contract validate":{domain:"contract-testing",action:"validateContract"},"aqe chaos test":{domain:"chaos-resilience",action:"runChaosTest"},"aqe requirements validate":{domain:"requirements-validation",action:"validateRequirements"},"aqe visual test":{domain:"visual-accessibility",action:"runVisualTest"},"aqe accessibility test":{domain:"visual-accessibility",action:"runAccessibilityTest"},"aqe learn optimize":{domain:"learning-optimization",action:"optimizeAllStrategies"}},D={daily:"0 0 * * *",weekly:"0 0 * * 0",hourly:"0 * * * *",minutely:"* * * * *"},x=1e4,M=20,S=1e4,W=["__proto__","constructor","prototype"];function v(t){return!W.includes(t)}function C(t){let n=t.split(`
|
|
3
3
|
`);if(n.length>x)throw new Error(`YAML content exceeds maximum allowed lines (${x}). File has ${n.length} lines.`);for(let i=0;i<n.length;i++)if(n[i].length>S)throw new Error(`YAML line ${i+1} exceeds maximum allowed length (${S} characters).`);let a={};for(let i=0;i<n.length;i++){let e=n[i];if(e.trim()===""||e.trim().startsWith("#")||e.search(/\S/)!==0)continue;let o=e.match(/^([\w_-]+):\s*(.+)$/);if(o){let[,c,u]=o;v(c)&&(a[c]=f(u))}}let r=["tags","stages","triggers"];for(let i of r){let e=new RegExp(`^${i}:\\s*$`),s=-1;for(let l=0;l<n.length;l++){let d=n[l];if(!(d.trim()===""||d.trim().startsWith("#"))&&e.test(d.trim())){s=l;break}}if(s===-1)continue;let o=[];a[i]=o;let c=n[s].search(/\S/),u=s+1;for(;u<n.length;){let l=n[u];if(l.trim()===""||l.trim().startsWith("#")){u++;continue}let d=l.search(/\S/),p=l.trim();if(d<=c&&!p.startsWith("-"))break;if(p.startsWith("- ")){let m=p.slice(2).trim();if(!m.includes(":")){o.push(f(m)),u++;continue}let g={},k=m.match(/^([\w_-]+):\s*(.*)$/);if(k){let[,h,y]=k;g[h]=f(y)}let T=d;for(u++;u<n.length;){let h=n[u];if(h.trim()===""||h.trim().startsWith("#")){u++;continue}let y=h.search(/\S/),q=h.trim();if(y<=T)break;let _=q.match(/^([\w_-]+):\s*(.*)$/);if(_){let[,A,$]=_;if($===""){let b=E(n,u+1,y,1);g[A]=b.value,u=b.nextLine;continue}else g[A]=f($)}u++}o.push(g)}else u++}}return a}function E(t,n,a,r=0){if(r>M)throw new Error(`YAML nesting exceeds maximum allowed depth (${M}).`);let i={},e=null,s=null,o=n;for(;o<t.length;){let u=t[o];if(u.trim()===""||u.trim().startsWith("#")){o++;continue}let l=u.search(/\S/),d=u.trim();if(l<=a)break;if(d.startsWith("- ")){let m=d.slice(2).trim();s&&!Array.isArray(i[s])&&(i[s]=[]),s?i[s].push(f(m)):(e||(e=[]),e.push(f(m))),o++;continue}let p=d.match(/^([\w_-]+):\s*(.*)$/);if(p){let[,m,g]=p;if(!v(m)){o++;continue}g===""?(s=m,i[m]=[]):(i[m]=f(g),s=null)}o++}if(e&&Object.keys(i).length===0)return{value:e,nextLine:o};let c=Object.keys(i);return c.length===1&&Array.isArray(i[c[0]])?{value:i[c[0]],nextLine:o}:{value:i,nextLine:o}}function f(t){if(t==="")return"";if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);if(t==="true")return!0;if(t==="false")return!1;if(t==="null"||t==="~")return null;let n=Number(t);return!isNaN(n)&&t!==""?n:t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1).split(",").map(r=>f(r.trim())):t}function K(t){let n=[];if(!w.existsSync(t))return{success:!1,errors:[`File not found: ${t}`]};let a;try{a=w.readFileSync(t,"utf-8")}catch(r){return{success:!1,errors:[`Failed to read file: ${r}`]}}return Y(a,t)}function Y(t,n){let a=[],r;try{r=C(t)}catch(s){return{success:!1,errors:[`Invalid YAML syntax: ${s}`]}}if((!r.name||typeof r.name!="string")&&a.push('Pipeline must have a "name" field'),(!r.stages||!Array.isArray(r.stages))&&a.push('Pipeline must have a "stages" array'),a.length>0)return{success:!1,errors:a};let i={name:r.name,description:r.description,version:r.version||"1.0.0",schedule:r.schedule,stages:r.stages.map((s,o)=>{let c=s;return{name:c.name||`stage-${o}`,command:c.command,params:c.params,depends_on:c.depends_on,condition:c.condition,timeout:c.timeout,retry:c.retry,continue_on_failure:c.continue_on_failure}}),triggers:r.triggers,tags:r.tags,timeout:r.timeout};for(let s=0;s<i.stages.length;s++){let o=i.stages[s];o.command||a.push(`Stage ${s+1} (${o.name}) must have a "command" field`)}if(a.length>0)return{success:!1,pipeline:i,errors:a};let e=O(i,n);return{success:!0,pipeline:i,workflow:e,errors:[]}}function O(t,n){let a=`pipeline-${t.name.replace(/\s+/g,"-").toLowerCase()}`,r=t.stages.map((e,s)=>{let o=P(e.command),c={};if(e.params)for(let[l,d]of Object.entries(e.params))v(l)&&(c[l]=`input.${l}`);let u={id:`stage-${e.name.replace(/\s+/g,"-").toLowerCase()}`,name:e.name,domain:o.domain,action:o.action,inputMapping:Object.keys(c).length>0?c:void 0,dependsOn:e.depends_on?.map(l=>`stage-${l.replace(/\s+/g,"-").toLowerCase()}`),timeout:e.timeout?e.timeout*1e3:void 0,continueOnFailure:e.continue_on_failure};return e.condition&&(u.condition={path:e.condition.path,operator:e.condition.operator,value:e.condition.value}),e.retry&&(u.retry={maxAttempts:e.retry.max_attempts||3,backoffMs:(e.retry.backoff_seconds||1)*1e3}),u}),i=t.triggers?.map(e=>{let s={eventType:I(e),sourceDomain:e.source_domain};return e.condition&&(s.condition={path:e.condition.path,operator:e.condition.operator,value:e.condition.value}),s});return{id:a,name:t.name,description:t.description||`Pipeline from ${n||"inline YAML"}`,version:t.version||"1.0.0",steps:r,triggers:i,tags:t.tags,timeout:t.timeout?t.timeout*1e3:void 0}}function P(t){let n=t.trim().replace(/\s+/g," ").toLowerCase();for(let[a,r]of Object.entries(R))if(n.startsWith(a.toLowerCase()))return r;return n.includes("test")&&n.includes("generate")?{domain:"test-generation",action:"generateTests"}:n.includes("test")&&(n.includes("execute")||n.includes("run"))?{domain:"test-execution",action:"execute"}:n.includes("coverage")?{domain:"coverage-analysis",action:"analyze"}:n.includes("quality")||n.includes("gate")?{domain:"quality-assessment",action:"evaluateGate"}:n.includes("security")||n.includes("scan")?{domain:"security-compliance",action:"runSASTScan"}:n.includes("defect")||n.includes("predict")?{domain:"defect-intelligence",action:"predictDefects"}:{domain:"learning-optimization",action:"runLearningCycle"}}function I(t){let n=t.event.toLowerCase();return n==="push"?"code-intelligence.CodePushed":n==="pull_request"||n==="pr"?"code-intelligence.PullRequestOpened":n==="schedule"?"workflow.ScheduleTrigger":n==="quality_gate"?"quality-assessment.QualityGateEvaluated":n==="test_complete"?"test-execution.TestRunCompleted":n}function F(t){let n=[],a=[];if(t.name||n.push({path:"name",message:"Pipeline name is required",severity:"error"}),!t.stages||t.stages.length===0)n.push({path:"stages",message:"Pipeline must have at least one stage",severity:"error"});else{let r=new Set;for(let e=0;e<t.stages.length;e++){let s=t.stages[e],o=`stages[${e}]`;if(r.has(s.name)&&n.push({path:`${o}.name`,message:`Duplicate stage name: ${s.name}`,severity:"error"}),r.add(s.name),s.command?P(s.command).domain==="learning-optimization"&&!s.command.toLowerCase().includes("learn")&&a.push({path:`${o}.command`,message:`Command "${s.command}" not recognized, will default to learning-optimization domain`,severity:"warning"}):n.push({path:`${o}.command`,message:"Stage must have a command",severity:"error"}),s.depends_on)for(let c of s.depends_on)t.stages.some(u=>u.name===c)||n.push({path:`${o}.depends_on`,message:`Unknown dependency: ${c}`,severity:"error"});s.timeout!==void 0&&s.timeout<=0&&n.push({path:`${o}.timeout`,message:"Timeout must be a positive number",severity:"error"}),s.retry&&s.retry.max_attempts!==void 0&&s.retry.max_attempts<1&&n.push({path:`${o}.retry.max_attempts`,message:"max_attempts must be at least 1",severity:"error"})}let i=N(t.stages);i&&n.push({path:"stages",message:`Circular dependency detected: ${i}`,severity:"error"})}if(t.schedule&&(z(t.schedule)||n.push({path:"schedule",message:`Invalid cron expression: ${t.schedule}`,severity:"error"})),t.triggers)for(let r=0;r<t.triggers.length;r++){let i=t.triggers[r],e=`triggers[${r}]`;i.event||n.push({path:`${e}.event`,message:"Trigger must have an event type",severity:"error"}),i.source_domain&&!L.includes(i.source_domain)&&a.push({path:`${e}.source_domain`,message:`Unknown domain: ${i.source_domain}`,severity:"warning"})}return{valid:n.length===0,errors:n,warnings:a}}function N(t){let n=new Set,a=new Set,r=(i,e)=>{if(a.has(i))return[...e,i].join(" -> ");if(n.has(i))return null;n.add(i),a.add(i);let s=t.find(o=>o.name===i);if(s?.depends_on)for(let o of s.depends_on){let c=r(o,[...e,i]);if(c)return c}return a.delete(i),null};for(let i of t){let e=r(i.name,[]);if(e)return e}return null}function z(t){if(Object.keys(D).includes(t))return!0;let n=t.trim().split(/\s+/);if(n.length!==5)return!1;let a=[/^(\*|[0-5]?\d)(-[0-5]?\d)?(\/\d+)?$/,/^(\*|1?\d|2[0-3])(-\d+)?(\/\d+)?$/,/^(\*|[1-9]|[12]\d|3[01])(-\d+)?(\/\d+)?$/,/^(\*|[1-9]|1[0-2])(-\d+)?(\/\d+)?$/,/^(\*|[0-7])(-[0-7])?(\/\d+)?$/];for(let r=0;r<5;r++){let i=n[r].split(",");for(let e of i)if(!a[r].test(e)&&e!=="*")return!1}return!0}function G(t){let n={"@daily":"Daily at midnight","@weekly":"Weekly on Sunday at midnight","@hourly":"Every hour","@minutely":"Every minute"};if(n[t])return n[t];if(Object.keys(D).includes(t))return{daily:"Daily at midnight",weekly:"Weekly on Sunday at midnight",hourly:"Every hour",minutely:"Every minute"}[t]||t;let a=t.trim().split(/\s+/);if(a.length!==5)return t;let[r,i,e,s,o]=a;return r==="0"&&i==="0"&&e==="*"&&s==="*"&&o==="*"?"Daily at midnight":r==="0"&&e==="*"&&s==="*"&&o==="*"?`Daily at ${i}:00`:r!=="*"&&i!=="*"&&e==="*"&&s==="*"?`Daily at ${i}:${r.padStart(2,"0")}`:i==="*"&&r==="0"?"Every hour":r!=="*"&&i==="*"?`Every hour at minute ${r}`:t}function H(t,n=new Date){let a=t.trim().split(/\s+/);if(a.length!==5)return new Date(n.getTime()+1440*60*1e3);let[r,i]=a,e=new Date(n);return i!=="*"&&r!=="*"?(e.setHours(parseInt(i,10),parseInt(r,10),0,0),e<=n&&e.setDate(e.getDate()+1)):i!=="*"?(e.setHours(parseInt(i,10),0,0,0),e<=n&&e.setDate(e.getDate()+1)):r!=="*"?(e.setMinutes(parseInt(r,10),0,0),e<=n&&e.setHours(e.getHours()+1)):(e.setSeconds(0,0),e.setMinutes(e.getMinutes()+1)),e}export{C as a,K as b,F as c,G as d,H as e};
|
|
@@ -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.13.
|
|
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.13.7");process.exit(0)}
|
|
2
2
|
import{randomUUID as v}from"crypto";var m={"claude-opus-4-7":{input:5,output:25,provider:"claude"},"claude-sonnet-4-6":{input:3,output:15,provider:"claude"},"claude-haiku-4-5-20251001":{input:1,output:5,provider:"claude"},"claude-opus-4-5-20251101":{input:15,output:75,provider:"claude"},"claude-sonnet-4-20250514":{input:3,output:15,provider:"claude"},"claude-3-5-haiku-20241022":{input:1,output:5,provider:"claude"},"claude-3-opus-20240229":{input:15,output:75,provider:"claude"},"claude-3-sonnet-20240229":{input:3,output:15,provider:"claude"},"claude-3-haiku-20240307":{input:.25,output:1.25,provider:"claude"},"gpt-4o":{input:5,output:15,provider:"openai"},"gpt-4o-mini":{input:.15,output:.6,provider:"openai"},"gpt-4-turbo":{input:10,output:30,provider:"openai"},"gpt-4":{input:30,output:60,provider:"openai"},"gpt-3.5-turbo":{input:.5,output:1.5,provider:"openai"},llama3:{input:0,output:0,provider:"ollama"},"llama3.1":{input:0,output:0,provider:"ollama"},codellama:{input:0,output:0,provider:"ollama"},mistral:{input:0,output:0,provider:"ollama"},mixtral:{input:0,output:0,provider:"ollama"},phi3:{input:0,output:0,provider:"ollama"},qwen2:{input:0,output:0,provider:"ollama"},"anthropic/claude-3.5-sonnet":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3.5-sonnet:beta":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3-opus":{input:15,output:75,provider:"openrouter"},"anthropic/claude-3-sonnet":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3-haiku":{input:.25,output:1.25,provider:"openrouter"},"openai/gpt-4o":{input:5,output:15,provider:"openrouter"},"openai/gpt-4o-mini":{input:.15,output:.6,provider:"openrouter"},"openai/gpt-4-turbo":{input:10,output:30,provider:"openrouter"},"openai/gpt-3.5-turbo":{input:.5,output:1.5,provider:"openrouter"},"google/gemini-pro":{input:.125,output:.375,provider:"openrouter"},"google/gemini-pro-1.5":{input:3.5,output:10.5,provider:"openrouter"},"meta-llama/llama-3.1-70b-instruct":{input:.59,output:.79,provider:"openrouter"},"meta-llama/llama-3.1-8b-instruct":{input:.06,output:.06,provider:"openrouter"},"mistralai/mistral-large":{input:2,output:6,provider:"openrouter"},"mistralai/mixtral-8x7b-instruct":{input:.24,output:.24,provider:"openrouter"},"mistralai/mistral-7b-instruct":{input:.06,output:.06,provider:"openrouter"},"anthropic.claude-opus-4-5-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-opus-4-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-sonnet-4-5-v2:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-sonnet-4-v1:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-3-5-haiku-v1:0":{input:1,output:5,provider:"bedrock"},"anthropic.claude-3-opus-20240229-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-3-sonnet-20240229-v1:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-3-haiku-20240307-v1:0":{input:.25,output:1.25,provider:"bedrock"},"anthropic.claude-3-5-sonnet-20241022-v2:0":{input:3,output:15,provider:"bedrock"},"azure/gpt-4o":{input:5,output:15,provider:"azure-openai"},"azure/gpt-4o-mini":{input:.15,output:.6,provider:"azure-openai"},"azure/gpt-4-turbo":{input:10,output:30,provider:"azure-openai"},"azure/gpt-4":{input:30,output:60,provider:"azure-openai"},"azure/gpt-35-turbo":{input:.5,output:1.5,provider:"azure-openai"},"azure/text-embedding-ada-002":{input:.1,output:0,provider:"azure-openai"},"azure/text-embedding-3-small":{input:.02,output:0,provider:"azure-openai"},"azure/text-embedding-3-large":{input:.13,output:0,provider:"azure-openai"},"gemini-pro":{input:.5,output:1.5,provider:"gemini"},"gemini-1.0-pro":{input:.5,output:1.5,provider:"gemini"},"gemini-1.5-pro":{input:3.5,output:10.5,provider:"gemini"},"gemini-1.5-pro-latest":{input:3.5,output:10.5,provider:"gemini"},"gemini-1.5-flash":{input:.075,output:.3,provider:"gemini"},"gemini-1.5-flash-latest":{input:.075,output:.3,provider:"gemini"},"gemini-2.0-flash-exp":{input:.075,output:.3,provider:"gemini"},"gemini-ultra":{input:7,output:21,provider:"gemini"},"gemini-1.0-ultra":{input:7,output:21,provider:"gemini"},"text-embedding-004":{input:.025,output:0,provider:"gemini"}},d=class c{records=[];alerts=[];maxRecords;alertCheckInterval;constructor(t=1e4){this.maxRecords=t}static calculateCost(t,o){let e=m[t];if(!e)return{inputCost:0,outputCost:0,totalCost:0,currency:"USD"};let i=o.promptTokens/1e6*e.input+(o.cacheReadTokens??0)/1e6*e.input*.1+(o.cacheCreationTokens??0)/1e6*e.input*1.25,r=o.completionTokens/1e6*e.output;return{inputCost:i,outputCost:r,totalCost:i+r,currency:"USD"}}static getCostPerToken(t){let o=m[t];return o?{input:o.input/1e6,output:o.output/1e6}:{input:0,output:0}}recordUsage(t,o,e,i,r){let n=c.calculateCost(o,e),p={timestamp:new Date,provider:t,model:o,usage:e,cost:n,requestId:i,metadata:r};return this.records.push(p),this.records.length>this.maxRecords&&(this.records=this.records.slice(-this.maxRecords)),this.checkAlerts(),n}getSummary(t){let o=new Date,e=this.getPeriodStart(o,t),i=o,r=this.records.filter(a=>a.timestamp>=e&&a.timestamp<=i),n={claude:0,"claude-code":0,codex:0,openai:0,ollama:0,openrouter:0,bedrock:0,"azure-openai":0,gemini:0,cognitum:0},p={},u=0,l=0;for(let a of r)u+=a.cost.totalCost,l+=a.usage.totalTokens,n[a.provider]+=a.cost.totalCost,p[a.model]=(p[a.model]||0)+a.cost.totalCost;return{period:t,periodStart:e,periodEnd:i,totalCost:u,byProvider:n,byModel:p,totalTokens:l,totalRequests:r.length}}getCurrentCost(t){return this.getSummary(t).totalCost}getTotalTokens(t){return this.getSummary(t).totalTokens}getUsageByProvider(t,o="all"){let e=this.getPeriodStart(new Date,o),i=this.records.filter(u=>u.provider===t&&u.timestamp>=e),r={},n=0,p=0;for(let u of i)n+=u.cost.totalCost,p+=u.usage.totalTokens,r[u.model]||(r[u.model]={cost:0,tokens:0,requests:0}),r[u.model].cost+=u.cost.totalCost,r[u.model].tokens+=u.usage.totalTokens,r[u.model].requests+=1;return{totalCost:n,totalTokens:p,totalRequests:i.length,models:r}}addAlert(t,o,e){let i=`alert-${Date.now()}-${v().slice(0,12)}`;return this.alerts.push({threshold:t,period:o,onThreshold:e,active:!0}),this.alertCheckInterval||(this.alertCheckInterval=setInterval(()=>this.checkAlerts(),6e4)),i}removeAlert(t){return t>=0&&t<this.alerts.length?(this.alerts.splice(t,1),this.alerts.length===0&&this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0),!0):!1}getRecords(){return[...this.records]}importRecords(t){for(let o of t)o.timestamp=new Date(o.timestamp),this.records.push(o);this.records.length>this.maxRecords&&(this.records=this.records.slice(-this.maxRecords))}clear(){this.records=[]}getRecentRequests(t=10){return this.records.slice(-t)}estimateCost(t,o,e){return c.calculateCost(t,{promptTokens:o,completionTokens:e,totalTokens:o+e})}wouldExceedLimit(t,o,e,i,r){let n=this.getCurrentCost(r),p=this.estimateCost(t,o,e);return n+p.totalCost>i}dispose(){this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0)}getPeriodStart(t,o){let e=new Date(t);switch(o){case"minute":e.setSeconds(0,0),e.setMinutes(e.getMinutes()-1);break;case"hour":e.setMinutes(0,0,0),e.setHours(e.getHours()-1);break;case"day":e.setHours(0,0,0,0);break;case"week":e.setHours(0,0,0,0),e.setDate(e.getDate()-7);break;case"month":e.setHours(0,0,0,0),e.setDate(1);break;case"all":return new Date(0)}return e}checkAlerts(){for(let t of this.alerts){if(!t.active)continue;let o=this.getSummary(t.period);if(o.totalCost>=t.threshold){t.active=!1;try{t.onThreshold(o)}catch(e){console.error("Cost alert callback error:",e)}}}}},s;function h(){return s||(s=new d),s}function b(){s&&(s.dispose(),s=void 0)}export{m as a,d as b,h as c,b as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.
|
|
2
|
-
import{a as S}from"./chunk-ELKWYWTD.js";import{c as g}from"./chunk-4Z7JP7CD.js";import{S as T,b as l}from"./chunk-HBYVYLBN.js";S();T();import{createRequire as B}from"module";var G=B(import.meta.url),d=class{validateTransfer(e,t){return{approved:!0}}};function R(){if(l().useCoherenceGate)try{let{CoherenceGate:o}=G("./coherence-gate.js");return new o}catch{}return new d}S();var x=g.create("transfer-verification"),A={maxSourceRegression:.05,minTargetImprovement:0,maxSourceConfidenceRegression:.1},b=class{config;constructor(e={}){this.config={...A,...e}}verifyTransfer(e){let t=e.sourcePerformanceAfter.successRate-e.sourcePerformanceBefore.successRate,r=e.targetPerformanceAfter.successRate-e.targetPerformanceBefore.successRate,n=e.sourcePerformanceAfter.avgConfidence-e.sourcePerformanceBefore.avgConfidence,a=e.targetPerformanceAfter.avgConfidence-e.targetPerformanceBefore.avgConfidence,s=t>=-this.config.maxSourceRegression&&n>=-this.config.maxSourceConfidenceRegression,c=r>=this.config.minTargetImprovement,u=s&&c,m;if(!u){let i=[];s||i.push(`source domain regressed: successRate delta=${t.toFixed(4)}, confidence delta=${n.toFixed(4)}`),c||i.push(`target domain did not improve: successRate delta=${r.toFixed(4)}`),m=i.join("; ")}return u?x.debug("Transfer verification passed",{transferId:e.transferId,sourceDelta:t,targetDelta:r}):x.warn("Transfer verification failed",{transferId:e.transferId,sourceDomain:e.sourceDomain,targetDomain:e.targetDomain,sourceDelta:t,targetDelta:r,failureReason:m}),{passed:u,sourceStable:s,targetImproved:c,sourceDelta:t,targetDelta:r,sourceConfidenceDelta:n,targetConfidenceDelta:a,failureReason:m}}getConfig(){return{...this.config}}};function M(o){return new b(o)}T();var p=class{alphas=new Map;betas=new Map;sample(e){let t=this.alphas.get(e)??1,r=this.betas.get(e)??1;return this.sampleBeta(t,r)}update(e,t){t?this.alphas.set(e,(this.alphas.get(e)??1)+1):this.betas.set(e,(this.betas.get(e)??1)+1)}getMean(e){let t=this.alphas.get(e)??1,r=this.betas.get(e)??1;return t/(t+r)}getObservationCount(e){let t=this.alphas.get(e)??1,r=this.betas.get(e)??1;return t-1+(r-1)}getAlpha(e){return this.alphas.get(e)??1}getBeta(e){return this.betas.get(e)??1}sampleBeta(e,t){let r=this.sampleGamma(e),n=this.sampleGamma(t);return r+n===0?.5:r/(r+n)}sampleGamma(e){if(e<1){let n=Math.random();return this.sampleGamma(e+1)*Math.pow(n,1/e)}let t=e-1/3,r=1/Math.sqrt(9*t);for(;;){let n,a;do n=this.standardNormal(),a=1+r*n;while(a<=0);a=a*a*a;let s=Math.random();if(s<1-.0331*n*n*n*n||Math.log(s)<.5*n*n+t*(1-a+Math.log(a)))return t*a}}standardNormal(){let e=Math.random(),t=Math.random();return Math.sqrt(-2*Math.log(e||1e-10))*Math.cos(2*Math.PI*t)}};var I={threshold:5,slack:.5,resetOnAlarm:!0,warmupSamples:20},h=class{config;states=new Map;constructor(e={}){this.config={...I,...e}}update(e,t){let r=this.getOrCreateState(e);if(r.samplesSinceReset++,r.mu===null)return r.warmupSum+=t,r.warmupCount++,r.warmupCount>=this.config.warmupSamples&&(r.mu=r.warmupSum/r.warmupCount),{driftDetected:!1,cumulativeSum:0,direction:"none",samplesSinceReset:r.samplesSinceReset};r.sPlus=Math.max(0,r.sPlus+(t-r.mu-this.config.slack)),r.sMinus=Math.max(0,r.sMinus+(-t+r.mu-this.config.slack));let n=Math.max(r.sPlus,r.sMinus),a=!1,s="none";r.sPlus>this.config.threshold?(a=!0,s="positive"):r.sMinus>this.config.threshold&&(a=!0,s="negative");let c={driftDetected:a,cumulativeSum:n,direction:s,samplesSinceReset:r.samplesSinceReset};return a&&this.config.resetOnAlarm&&(r.sPlus=0,r.sMinus=0,r.samplesSinceReset=0),c}reset(e){e?this.states.delete(e):this.states.clear()}getState(e){let t=this.states.get(e);if(!t)return{driftDetected:!1,cumulativeSum:0,direction:"none",samplesSinceReset:0};let r=Math.max(t.sPlus,t.sMinus),n="none";return t.sPlus>this.config.threshold?n="positive":t.sMinus>this.config.threshold&&(n="negative"),{driftDetected:t.sPlus>this.config.threshold||t.sMinus>this.config.threshold,cumulativeSum:r,direction:n,samplesSinceReset:t.samplesSinceReset}}getOrCreateState(e){let t=this.states.get(e);return t||(t={sPlus:0,sMinus:0,samplesSinceReset:0,warmupSum:0,warmupCount:0,mu:null},this.states.set(e,t)),t}};var w=g.create("domain-transfer"),V={minTransferProbability:.3,explorationWarmup:5,verification:{},maxHistorySize:1e3,useMetaLearningEnhancements:!0},v=class{constructor(e=100){this.decayThreshold=e}decayThreshold;getDecayMultiplier(e){return e<=0?1:Math.pow(.5,e/this.decayThreshold)}applyDecay(e,t,r){return t+(e-t)*this.getDecayMultiplier(r)}},y=class{cusum;outcomes=[];windowSize;constructor(e=20){this.windowSize=e,this.cusum=new h({threshold:3,slack:.1,resetOnAlarm:!1,warmupSamples:Math.min(10,Math.floor(e/2))})}record(e){this.outcomes.push(e),this.outcomes.length>this.windowSize*2&&this.outcomes.splice(0,this.outcomes.length-this.windowSize*2);let t=this.getCurrentRate();this.cusum.update("learn",t)}isPlateaued(){return this.outcomes.length<this.windowSize?!1:!this.cusum.getState("learn").driftDetected}getCurrentRate(){if(this.outcomes.length===0)return 0;let e=this.outcomes.slice(-this.windowSize);return e.filter(Boolean).length/e.length}getOutcomeCount(){return this.outcomes.length}getCusumState(){return this.cusum.getState("learn")}},D=class{front=[];dominates(e,t){let r=e.successRate>=t.successRate&&e.speed>=t.speed&&e.confidence>=t.confidence,n=e.successRate>t.successRate||e.speed>t.speed||e.confidence>t.confidence;return r&&n}add(e){for(let t=this.front.length-1;t>=0;t--)this.dominates(e,this.front[t])&&this.front.splice(t,1);this.front.some(t=>this.dominates(t,e))||this.front.push(e)}getFront(){return[...this.front]}isNonDominated(e){return!this.front.some(t=>this.dominates(t,e))}},C=class{constructor(e=.2){this.bonusScale=e}bonusScale;triedPairs=new Set;markTried(e){this.triedPairs.add(e)}isTried(e){return this.triedPairs.has(e)}getBonus(e){return this.triedPairs.has(e)?0:this.bonusScale}apply(e,t){return Math.min(1,e+this.getBonus(t))}getTriedCount(){return this.triedPairs.size}},P=class{config;sampler;verifier;coherenceGate;transferHistory=[];affinityScores=new Map;performanceProvider=null;transferExecutor=null;nativeModule=null;decayingBeta;plateauDetector;paretoFront;curiosityBonus;constructor(e={}){this.config={...V,...e},this.sampler=new p,this.verifier=M(this.config.verification),this.coherenceGate=R(),this.decayingBeta=new v,this.plateauDetector=new y,this.paretoFront=new D,this.curiosityBonus=new C,this.tryLoadNativeModule()}evaluateTransfer(e,t){if(!this.isEnabled())return this.createRejectedCandidate(e,t);let r=this.makePairKey(e,t),n=this.sampler.sample(r),s=this.sampler.getObservationCount(r)<this.config.explorationWarmup,c=this.getAffinityScore(e,t);if(this.isMetaLearningEnabled()){let u=this.sampler.getMean(r),m=this.sampler.getAlpha(r)-1;n=this.decayingBeta.applyDecay(n,u,m),n=this.curiosityBonus.apply(n,r)}return{sourceDomain:e,targetDomain:t,sampledProbability:n,affinityScore:c,isExploration:s,pairKey:r}}executeTransfer(e){let t=`transfer-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,r=this.coherenceGate.validateTransfer({domain:e.sourceDomain},e.targetDomain);if(!r.approved)return w.info("Transfer blocked by coherence gate",{transferId:t,source:e.sourceDomain,target:e.targetDomain,reason:r.rejectionReason}),this.createBlockedResult(t,e,r);let n=this.getPerformanceSnapshot(e.sourceDomain),a=this.getPerformanceSnapshot(e.targetDomain),s=this.computeSqrtDampening(e),c=this.doTransfer(e.sourceDomain,e.targetDomain,s),u=this.getPerformanceSnapshot(e.sourceDomain),m=this.getPerformanceSnapshot(e.targetDomain),i=this.verifier.verifyTransfer({transferId:t,sourceDomain:e.sourceDomain,targetDomain:e.targetDomain,sourcePerformanceBefore:n,sourcePerformanceAfter:u,targetPerformanceBefore:a,targetPerformanceAfter:m}),f=c&&i.passed;if(this.sampler.update(e.pairKey,f),this.updateAffinityScore(e.pairKey,f),this.isMetaLearningEnabled()){this.plateauDetector.record(f),this.curiosityBonus.markTried(e.pairKey);let F=this.sampler.getMean(e.pairKey);this.paretoFront.add({pairKey:e.pairKey,successRate:F,speed:1/(1+s),confidence:this.getAffinityScore(e.sourceDomain,e.targetDomain)})}return this.addToHistory({transferId:t,sourceDomain:e.sourceDomain,targetDomain:e.targetDomain,success:f,sampledProbability:e.sampledProbability,dampeningFactor:s,sourceDelta:i.sourceDelta,targetDelta:i.targetDelta,timestamp:Date.now()}),w.info("Transfer completed",{transferId:t,source:e.sourceDomain,target:e.targetDomain,success:f,dampeningFactor:s.toFixed(4),sourceDelta:i.sourceDelta.toFixed(4),targetDelta:i.targetDelta.toFixed(4)}),{transferId:t,candidate:e,success:f,dampeningFactor:s,verification:i,coherenceResult:r,sourcePerformanceBefore:n,sourcePerformanceAfter:u,targetPerformanceBefore:a,targetPerformanceAfter:m,timestamp:Date.now()}}getAffinityScore(e,t){return this.affinityScores.get(this.makePairKey(e,t))??.5}getTransferHistory(){return[...this.transferHistory]}getExpectedSuccessRate(e,t){return this.sampler.getMean(this.makePairKey(e,t))}getObservationCount(e,t){return this.sampler.getObservationCount(this.makePairKey(e,t))}setPerformanceProvider(e){this.performanceProvider=e}setTransferExecutor(e){this.transferExecutor=e}getSampler(){return this.sampler}getCoherenceGate(){return this.coherenceGate}getDecayingBeta(){return this.decayingBeta}getPlateauDetector(){return this.plateauDetector}getParetoFront(){return this.paretoFront}getCuriosityBonus(){return this.curiosityBonus}isLearningPlateaued(){return this.plateauDetector.isPlateaued()}isEnabled(){return l().useCrossDomainTransfer===!0}isMetaLearningEnabled(){return this.config.useMetaLearningEnhancements===!0&&l().useMetaLearningEnhancements!==!1}makePairKey(e,t){return`${e}->${t}`}computeSqrtDampening(e){let t=this.sampler.getObservationCount(e.pairKey);return Math.sqrt(t/(t+this.config.explorationWarmup))}doTransfer(e,t,r){return this.transferExecutor?this.transferExecutor(e,t,r):!0}getPerformanceSnapshot(e){return this.performanceProvider?this.performanceProvider(e):{domain:e,successRate:.5,avgConfidence:.5,patternCount:0,timestamp:Date.now()}}updateAffinityScore(e,t){let r=this.affinityScores.get(e)??.5;this.affinityScores.set(e,.2*(t?1:0)+.8*r)}addToHistory(e){for(this.transferHistory.push(e);this.transferHistory.length>this.config.maxHistorySize;)this.transferHistory.shift()}createBlockedResult(e,t,r){let n={domain:"",successRate:0,avgConfidence:0,patternCount:0,timestamp:Date.now()};return{transferId:e,candidate:t,success:!1,dampeningFactor:0,verification:{passed:!1,sourceStable:!1,targetImproved:!1,sourceDelta:0,targetDelta:0,sourceConfidenceDelta:0,targetConfidenceDelta:0,failureReason:`Coherence gate rejected: ${r.rejectionReason??"unknown"}`},coherenceResult:r,sourcePerformanceBefore:{...n,domain:t.sourceDomain},sourcePerformanceAfter:{...n,domain:t.sourceDomain},targetPerformanceBefore:{...n,domain:t.targetDomain},targetPerformanceAfter:{...n,domain:t.targetDomain},timestamp:Date.now()}}createRejectedCandidate(e,t){return{sourceDomain:e,targetDomain:t,sampledProbability:0,affinityScore:0,isExploration:!1,pairKey:this.makePairKey(e,t)}}tryLoadNativeModule(){this.nativeModule=null}};function J(o){return new P(o)}export{h as a,p as b,V as c,v as d,y as e,D as f,C as g,P as h,J as i};
|
|
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.13.7");process.exit(0)}
|
|
2
|
+
import{a as S}from"./chunk-GAYYOIRM.js";import{c as g}from"./chunk-XNQWCGR5.js";import{S as T,b as l}from"./chunk-COM3MXBJ.js";S();T();import{createRequire as B}from"module";var G=B(import.meta.url),d=class{validateTransfer(e,t){return{approved:!0}}};function R(){if(l().useCoherenceGate)try{let{CoherenceGate:o}=G("./coherence-gate.js");return new o}catch{}return new d}S();var x=g.create("transfer-verification"),A={maxSourceRegression:.05,minTargetImprovement:0,maxSourceConfidenceRegression:.1},b=class{config;constructor(e={}){this.config={...A,...e}}verifyTransfer(e){let t=e.sourcePerformanceAfter.successRate-e.sourcePerformanceBefore.successRate,r=e.targetPerformanceAfter.successRate-e.targetPerformanceBefore.successRate,n=e.sourcePerformanceAfter.avgConfidence-e.sourcePerformanceBefore.avgConfidence,a=e.targetPerformanceAfter.avgConfidence-e.targetPerformanceBefore.avgConfidence,s=t>=-this.config.maxSourceRegression&&n>=-this.config.maxSourceConfidenceRegression,c=r>=this.config.minTargetImprovement,u=s&&c,m;if(!u){let i=[];s||i.push(`source domain regressed: successRate delta=${t.toFixed(4)}, confidence delta=${n.toFixed(4)}`),c||i.push(`target domain did not improve: successRate delta=${r.toFixed(4)}`),m=i.join("; ")}return u?x.debug("Transfer verification passed",{transferId:e.transferId,sourceDelta:t,targetDelta:r}):x.warn("Transfer verification failed",{transferId:e.transferId,sourceDomain:e.sourceDomain,targetDomain:e.targetDomain,sourceDelta:t,targetDelta:r,failureReason:m}),{passed:u,sourceStable:s,targetImproved:c,sourceDelta:t,targetDelta:r,sourceConfidenceDelta:n,targetConfidenceDelta:a,failureReason:m}}getConfig(){return{...this.config}}};function M(o){return new b(o)}T();var p=class{alphas=new Map;betas=new Map;sample(e){let t=this.alphas.get(e)??1,r=this.betas.get(e)??1;return this.sampleBeta(t,r)}update(e,t){t?this.alphas.set(e,(this.alphas.get(e)??1)+1):this.betas.set(e,(this.betas.get(e)??1)+1)}getMean(e){let t=this.alphas.get(e)??1,r=this.betas.get(e)??1;return t/(t+r)}getObservationCount(e){let t=this.alphas.get(e)??1,r=this.betas.get(e)??1;return t-1+(r-1)}getAlpha(e){return this.alphas.get(e)??1}getBeta(e){return this.betas.get(e)??1}sampleBeta(e,t){let r=this.sampleGamma(e),n=this.sampleGamma(t);return r+n===0?.5:r/(r+n)}sampleGamma(e){if(e<1){let n=Math.random();return this.sampleGamma(e+1)*Math.pow(n,1/e)}let t=e-1/3,r=1/Math.sqrt(9*t);for(;;){let n,a;do n=this.standardNormal(),a=1+r*n;while(a<=0);a=a*a*a;let s=Math.random();if(s<1-.0331*n*n*n*n||Math.log(s)<.5*n*n+t*(1-a+Math.log(a)))return t*a}}standardNormal(){let e=Math.random(),t=Math.random();return Math.sqrt(-2*Math.log(e||1e-10))*Math.cos(2*Math.PI*t)}};var I={threshold:5,slack:.5,resetOnAlarm:!0,warmupSamples:20},h=class{config;states=new Map;constructor(e={}){this.config={...I,...e}}update(e,t){let r=this.getOrCreateState(e);if(r.samplesSinceReset++,r.mu===null)return r.warmupSum+=t,r.warmupCount++,r.warmupCount>=this.config.warmupSamples&&(r.mu=r.warmupSum/r.warmupCount),{driftDetected:!1,cumulativeSum:0,direction:"none",samplesSinceReset:r.samplesSinceReset};r.sPlus=Math.max(0,r.sPlus+(t-r.mu-this.config.slack)),r.sMinus=Math.max(0,r.sMinus+(-t+r.mu-this.config.slack));let n=Math.max(r.sPlus,r.sMinus),a=!1,s="none";r.sPlus>this.config.threshold?(a=!0,s="positive"):r.sMinus>this.config.threshold&&(a=!0,s="negative");let c={driftDetected:a,cumulativeSum:n,direction:s,samplesSinceReset:r.samplesSinceReset};return a&&this.config.resetOnAlarm&&(r.sPlus=0,r.sMinus=0,r.samplesSinceReset=0),c}reset(e){e?this.states.delete(e):this.states.clear()}getState(e){let t=this.states.get(e);if(!t)return{driftDetected:!1,cumulativeSum:0,direction:"none",samplesSinceReset:0};let r=Math.max(t.sPlus,t.sMinus),n="none";return t.sPlus>this.config.threshold?n="positive":t.sMinus>this.config.threshold&&(n="negative"),{driftDetected:t.sPlus>this.config.threshold||t.sMinus>this.config.threshold,cumulativeSum:r,direction:n,samplesSinceReset:t.samplesSinceReset}}getOrCreateState(e){let t=this.states.get(e);return t||(t={sPlus:0,sMinus:0,samplesSinceReset:0,warmupSum:0,warmupCount:0,mu:null},this.states.set(e,t)),t}};var w=g.create("domain-transfer"),V={minTransferProbability:.3,explorationWarmup:5,verification:{},maxHistorySize:1e3,useMetaLearningEnhancements:!0},v=class{constructor(e=100){this.decayThreshold=e}decayThreshold;getDecayMultiplier(e){return e<=0?1:Math.pow(.5,e/this.decayThreshold)}applyDecay(e,t,r){return t+(e-t)*this.getDecayMultiplier(r)}},y=class{cusum;outcomes=[];windowSize;constructor(e=20){this.windowSize=e,this.cusum=new h({threshold:3,slack:.1,resetOnAlarm:!1,warmupSamples:Math.min(10,Math.floor(e/2))})}record(e){this.outcomes.push(e),this.outcomes.length>this.windowSize*2&&this.outcomes.splice(0,this.outcomes.length-this.windowSize*2);let t=this.getCurrentRate();this.cusum.update("learn",t)}isPlateaued(){return this.outcomes.length<this.windowSize?!1:!this.cusum.getState("learn").driftDetected}getCurrentRate(){if(this.outcomes.length===0)return 0;let e=this.outcomes.slice(-this.windowSize);return e.filter(Boolean).length/e.length}getOutcomeCount(){return this.outcomes.length}getCusumState(){return this.cusum.getState("learn")}},D=class{front=[];dominates(e,t){let r=e.successRate>=t.successRate&&e.speed>=t.speed&&e.confidence>=t.confidence,n=e.successRate>t.successRate||e.speed>t.speed||e.confidence>t.confidence;return r&&n}add(e){for(let t=this.front.length-1;t>=0;t--)this.dominates(e,this.front[t])&&this.front.splice(t,1);this.front.some(t=>this.dominates(t,e))||this.front.push(e)}getFront(){return[...this.front]}isNonDominated(e){return!this.front.some(t=>this.dominates(t,e))}},C=class{constructor(e=.2){this.bonusScale=e}bonusScale;triedPairs=new Set;markTried(e){this.triedPairs.add(e)}isTried(e){return this.triedPairs.has(e)}getBonus(e){return this.triedPairs.has(e)?0:this.bonusScale}apply(e,t){return Math.min(1,e+this.getBonus(t))}getTriedCount(){return this.triedPairs.size}},P=class{config;sampler;verifier;coherenceGate;transferHistory=[];affinityScores=new Map;performanceProvider=null;transferExecutor=null;nativeModule=null;decayingBeta;plateauDetector;paretoFront;curiosityBonus;constructor(e={}){this.config={...V,...e},this.sampler=new p,this.verifier=M(this.config.verification),this.coherenceGate=R(),this.decayingBeta=new v,this.plateauDetector=new y,this.paretoFront=new D,this.curiosityBonus=new C,this.tryLoadNativeModule()}evaluateTransfer(e,t){if(!this.isEnabled())return this.createRejectedCandidate(e,t);let r=this.makePairKey(e,t),n=this.sampler.sample(r),s=this.sampler.getObservationCount(r)<this.config.explorationWarmup,c=this.getAffinityScore(e,t);if(this.isMetaLearningEnabled()){let u=this.sampler.getMean(r),m=this.sampler.getAlpha(r)-1;n=this.decayingBeta.applyDecay(n,u,m),n=this.curiosityBonus.apply(n,r)}return{sourceDomain:e,targetDomain:t,sampledProbability:n,affinityScore:c,isExploration:s,pairKey:r}}executeTransfer(e){let t=`transfer-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,r=this.coherenceGate.validateTransfer({domain:e.sourceDomain},e.targetDomain);if(!r.approved)return w.info("Transfer blocked by coherence gate",{transferId:t,source:e.sourceDomain,target:e.targetDomain,reason:r.rejectionReason}),this.createBlockedResult(t,e,r);let n=this.getPerformanceSnapshot(e.sourceDomain),a=this.getPerformanceSnapshot(e.targetDomain),s=this.computeSqrtDampening(e),c=this.doTransfer(e.sourceDomain,e.targetDomain,s),u=this.getPerformanceSnapshot(e.sourceDomain),m=this.getPerformanceSnapshot(e.targetDomain),i=this.verifier.verifyTransfer({transferId:t,sourceDomain:e.sourceDomain,targetDomain:e.targetDomain,sourcePerformanceBefore:n,sourcePerformanceAfter:u,targetPerformanceBefore:a,targetPerformanceAfter:m}),f=c&&i.passed;if(this.sampler.update(e.pairKey,f),this.updateAffinityScore(e.pairKey,f),this.isMetaLearningEnabled()){this.plateauDetector.record(f),this.curiosityBonus.markTried(e.pairKey);let F=this.sampler.getMean(e.pairKey);this.paretoFront.add({pairKey:e.pairKey,successRate:F,speed:1/(1+s),confidence:this.getAffinityScore(e.sourceDomain,e.targetDomain)})}return this.addToHistory({transferId:t,sourceDomain:e.sourceDomain,targetDomain:e.targetDomain,success:f,sampledProbability:e.sampledProbability,dampeningFactor:s,sourceDelta:i.sourceDelta,targetDelta:i.targetDelta,timestamp:Date.now()}),w.info("Transfer completed",{transferId:t,source:e.sourceDomain,target:e.targetDomain,success:f,dampeningFactor:s.toFixed(4),sourceDelta:i.sourceDelta.toFixed(4),targetDelta:i.targetDelta.toFixed(4)}),{transferId:t,candidate:e,success:f,dampeningFactor:s,verification:i,coherenceResult:r,sourcePerformanceBefore:n,sourcePerformanceAfter:u,targetPerformanceBefore:a,targetPerformanceAfter:m,timestamp:Date.now()}}getAffinityScore(e,t){return this.affinityScores.get(this.makePairKey(e,t))??.5}getTransferHistory(){return[...this.transferHistory]}getExpectedSuccessRate(e,t){return this.sampler.getMean(this.makePairKey(e,t))}getObservationCount(e,t){return this.sampler.getObservationCount(this.makePairKey(e,t))}setPerformanceProvider(e){this.performanceProvider=e}setTransferExecutor(e){this.transferExecutor=e}getSampler(){return this.sampler}getCoherenceGate(){return this.coherenceGate}getDecayingBeta(){return this.decayingBeta}getPlateauDetector(){return this.plateauDetector}getParetoFront(){return this.paretoFront}getCuriosityBonus(){return this.curiosityBonus}isLearningPlateaued(){return this.plateauDetector.isPlateaued()}isEnabled(){return l().useCrossDomainTransfer===!0}isMetaLearningEnabled(){return this.config.useMetaLearningEnhancements===!0&&l().useMetaLearningEnhancements!==!1}makePairKey(e,t){return`${e}->${t}`}computeSqrtDampening(e){let t=this.sampler.getObservationCount(e.pairKey);return Math.sqrt(t/(t+this.config.explorationWarmup))}doTransfer(e,t,r){return this.transferExecutor?this.transferExecutor(e,t,r):!0}getPerformanceSnapshot(e){return this.performanceProvider?this.performanceProvider(e):{domain:e,successRate:.5,avgConfidence:.5,patternCount:0,timestamp:Date.now()}}updateAffinityScore(e,t){let r=this.affinityScores.get(e)??.5;this.affinityScores.set(e,.2*(t?1:0)+.8*r)}addToHistory(e){for(this.transferHistory.push(e);this.transferHistory.length>this.config.maxHistorySize;)this.transferHistory.shift()}createBlockedResult(e,t,r){let n={domain:"",successRate:0,avgConfidence:0,patternCount:0,timestamp:Date.now()};return{transferId:e,candidate:t,success:!1,dampeningFactor:0,verification:{passed:!1,sourceStable:!1,targetImproved:!1,sourceDelta:0,targetDelta:0,sourceConfidenceDelta:0,targetConfidenceDelta:0,failureReason:`Coherence gate rejected: ${r.rejectionReason??"unknown"}`},coherenceResult:r,sourcePerformanceBefore:{...n,domain:t.sourceDomain},sourcePerformanceAfter:{...n,domain:t.sourceDomain},targetPerformanceBefore:{...n,domain:t.targetDomain},targetPerformanceAfter:{...n,domain:t.targetDomain},timestamp:Date.now()}}createRejectedCandidate(e,t){return{sourceDomain:e,targetDomain:t,sampledProbability:0,affinityScore:0,isExploration:!1,pairKey:this.makePairKey(e,t)}}tryLoadNativeModule(){this.nativeModule=null}};function J(o){return new P(o)}export{h as a,p as b,V as c,v as d,y as e,D as f,C as g,P as h,J as i};
|
|
@@ -1,11 +1,11 @@
|
|
|
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.13.
|
|
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.13.7");process.exit(0)}
|
|
2
|
+
import{d as j,f as qe}from"./chunk-NQPS7FM5.js";import{a as B,c as ze}from"./chunk-EV7S4J35.js";import{a as Pe}from"./chunk-GAYYOIRM.js";import{c as ne}from"./chunk-XNQWCGR5.js";import{a as W,b as y,c as je}from"./chunk-QVQYDUMR.js";import{b as C,d as se}from"./chunk-FWU55NEY.js";import{a as X,c as Me}from"./chunk-A3XAWNOW.js";import{a as re,b as ke}from"./chunk-6F5UFJIA.js";import{a as oe,d as w,e as ie,f as ae}from"./chunk-U5SAFRHE.js";import{a as b,b as te,e as Ge}from"./chunk-Y2NOIPIR.js";import{c as R,e as Fe}from"./chunk-YSB6GH53.js";import{createHash as de}from"node:crypto";function We(o){let e=Buffer.alloc(8);return e.writeBigUInt64LE(BigInt(o)),e}function He(o){return typeof o=="string"?Buffer.from(o,"utf8"):o instanceof Uint8Array?Buffer.from(o):Buffer.from(H(o),"utf8")}function H(o){return o===null||typeof o!="object"?JSON.stringify(o)??"null":Array.isArray(o)?`[${o.map(H).join(",")}]`:`{${Object.keys(o).sort().map(t=>`${JSON.stringify(t)}:${H(o[t])}`).join(",")}}`}function Ee(...o){let e=de("sha256");for(let t of o)e.update(t);return e.digest()}function Te(o,e,t){return Ee(Be,o,e,We(t))}var Be,ce,A,ue=R(()=>{"use strict";Be=Buffer.from("ruvector:chain:"),ce=de("sha256").update("ruvector-proof-gate-v1").digest();A=class o{seq=0;prev=ce;chain=[];payloadHashes=[];admit(e){let t=Ee(He(e)),n=Te(this.prev,t,this.seq);this.prev=n,this.chain.push(n),this.payloadHashes.push(t);let a={sequence:this.seq,payloadHash:t.toString("hex"),chainCommitment:n.toString("hex")};return this.seq+=1,a}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=ce;for(let t=0;t<this.chain.length;t++){if(!Te(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 o;t.seq=e.seq,t.prev=Buffer.from(e.head,"hex");for(let n of e.chain)t.chain.push(Buffer.from(n,"hex"));for(let n of e.payloadHashes)t.payloadHashes.push(Buffer.from(n,"hex"));return t}}});function O(o){if(!Y.has(o))throw new Error(`Invalid table name: "${o}" is not in the allowlist`);return o}function rt(o){let e=o.split(".");if(e.length>2)throw new Error(`Invalid SQL identifier: "${o}" has too many parts (max: schema.table)`);for(let t of e)if(!pe.test(t))throw new Error(`Invalid SQL identifier: "${o}" \u2014 part "${t}" does not match pattern ${pe}`);return o}var Y,pe,$=R(()=>{"use strict";Y=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","qe_agent_co_execution"]);pe=/^[a-z_][a-z0-9_]{0,62}$/});var U,le,ge,me,_e,K,fe,Ne,Se,he,Re,Le,Ce=R(()=>{"use strict";qe();ze();U=11,le=`
|
|
3
3
|
CREATE TABLE IF NOT EXISTS schema_version (
|
|
4
4
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
5
5
|
version INTEGER NOT NULL,
|
|
6
6
|
migrated_at TEXT DEFAULT (datetime('now'))
|
|
7
7
|
);
|
|
8
|
-
`,
|
|
8
|
+
`,ge=`
|
|
9
9
|
-- Key-Value Store (v2 compatible - same schema as HybridBackend)
|
|
10
10
|
CREATE TABLE IF NOT EXISTS kv_store (
|
|
11
11
|
key TEXT NOT NULL,
|
|
@@ -17,7 +17,7 @@ import{d as z,f as ke}from"./chunk-PNDWHSZO.js";import{a as j,c as qe}from"./chu
|
|
|
17
17
|
);
|
|
18
18
|
CREATE INDEX IF NOT EXISTS idx_kv_namespace ON kv_store(namespace);
|
|
19
19
|
CREATE INDEX IF NOT EXISTS idx_kv_expires ON kv_store(expires_at) WHERE expires_at IS NOT NULL;
|
|
20
|
-
`,
|
|
20
|
+
`,me=`
|
|
21
21
|
-- Vector Embeddings (new in v3 - replaces in-memory AgentDB)
|
|
22
22
|
CREATE TABLE IF NOT EXISTS vectors (
|
|
23
23
|
id TEXT PRIMARY KEY,
|
|
@@ -30,7 +30,7 @@ import{d as z,f as ke}from"./chunk-PNDWHSZO.js";import{a as j,c as qe}from"./chu
|
|
|
30
30
|
);
|
|
31
31
|
CREATE INDEX IF NOT EXISTS idx_vectors_namespace ON vectors(namespace);
|
|
32
32
|
CREATE INDEX IF NOT EXISTS idx_vectors_dimensions ON vectors(dimensions);
|
|
33
|
-
`,
|
|
33
|
+
`,_e=`
|
|
34
34
|
-- Q-Values for RL algorithms (ADR-046)
|
|
35
35
|
CREATE TABLE IF NOT EXISTS rl_q_values (
|
|
36
36
|
id TEXT PRIMARY KEY,
|
|
@@ -51,7 +51,7 @@ import{d as z,f as ke}from"./chunk-PNDWHSZO.js";import{a as j,c as qe}from"./chu
|
|
|
51
51
|
CREATE INDEX IF NOT EXISTS idx_qvalues_state ON rl_q_values(agent_id, state_key);
|
|
52
52
|
CREATE INDEX IF NOT EXISTS idx_qvalues_domain ON rl_q_values(domain);
|
|
53
53
|
CREATE INDEX IF NOT EXISTS idx_qvalues_updated ON rl_q_values(updated_at);
|
|
54
|
-
|
|
54
|
+
`,K=`
|
|
55
55
|
-- GOAP Goals
|
|
56
56
|
CREATE TABLE IF NOT EXISTS goap_goals (
|
|
57
57
|
id TEXT PRIMARY KEY,
|
|
@@ -162,7 +162,7 @@ import{d as z,f as ke}from"./chunk-PNDWHSZO.js";import{a as j,c as qe}from"./chu
|
|
|
162
162
|
-- would fail on "no such column" since CREATE TABLE IF NOT EXISTS above
|
|
163
163
|
-- silently no-ops against them. unified-memory.ts's v11 migration creates
|
|
164
164
|
-- this index only after confirming/backfilling the column.
|
|
165
|
-
`,
|
|
165
|
+
`,fe=`
|
|
166
166
|
-- Concept Graph Nodes (Dream Engine)
|
|
167
167
|
CREATE TABLE IF NOT EXISTS concept_nodes (
|
|
168
168
|
id TEXT PRIMARY KEY,
|
|
@@ -231,7 +231,7 @@ import{d as z,f as ke}from"./chunk-PNDWHSZO.js";import{a as j,c as qe}from"./chu
|
|
|
231
231
|
CREATE INDEX IF NOT EXISTS idx_edge_weight ON concept_edges(weight DESC);
|
|
232
232
|
CREATE INDEX IF NOT EXISTS idx_insight_cycle ON dream_insights(cycle_id);
|
|
233
233
|
CREATE INDEX IF NOT EXISTS idx_dream_status ON dream_cycles(status);
|
|
234
|
-
`,
|
|
234
|
+
`,Ne=`
|
|
235
235
|
-- QE Patterns table (unified from sqlite-persistence.ts)
|
|
236
236
|
CREATE TABLE IF NOT EXISTS qe_patterns (
|
|
237
237
|
id TEXT PRIMARY KEY,
|
|
@@ -381,7 +381,7 @@ import{d as z,f as ke}from"./chunk-PNDWHSZO.js";import{a as j,c as qe}from"./chu
|
|
|
381
381
|
CREATE INDEX IF NOT EXISTS idx_execution_results_status ON execution_results(status);
|
|
382
382
|
CREATE INDEX IF NOT EXISTS idx_executed_steps_execution ON executed_steps(execution_id);
|
|
383
383
|
CREATE INDEX IF NOT EXISTS idx_executed_steps_action ON executed_steps(action_id);
|
|
384
|
-
`,
|
|
384
|
+
`,Se=`
|
|
385
385
|
-- MinCut Graph Snapshots (ADR-047)
|
|
386
386
|
CREATE TABLE IF NOT EXISTS mincut_snapshots (
|
|
387
387
|
id TEXT PRIMARY KEY,
|
|
@@ -487,7 +487,7 @@ import{d as z,f as ke}from"./chunk-PNDWHSZO.js";import{a as j,c as qe}from"./chu
|
|
|
487
487
|
CREATE INDEX IF NOT EXISTS idx_mincut_healing_type ON mincut_healing_actions(action_type);
|
|
488
488
|
CREATE INDEX IF NOT EXISTS idx_mincut_healing_success ON mincut_healing_actions(success);
|
|
489
489
|
CREATE INDEX IF NOT EXISTS idx_mincut_observations_iter ON mincut_observations(iteration);
|
|
490
|
-
`,
|
|
490
|
+
`,he=`
|
|
491
491
|
-- SONA Patterns table (ADR-046: Pattern Persistence for Neural Backbone)
|
|
492
492
|
CREATE TABLE IF NOT EXISTS sona_patterns (
|
|
493
493
|
id TEXT PRIMARY KEY,
|
|
@@ -513,7 +513,7 @@ import{d as z,f as ke}from"./chunk-PNDWHSZO.js";import{a as j,c as qe}from"./chu
|
|
|
513
513
|
CREATE INDEX IF NOT EXISTS idx_sona_patterns_domain ON sona_patterns(domain);
|
|
514
514
|
CREATE INDEX IF NOT EXISTS idx_sona_patterns_confidence ON sona_patterns(confidence DESC);
|
|
515
515
|
CREATE INDEX IF NOT EXISTS idx_sona_patterns_updated ON sona_patterns(updated_at DESC);
|
|
516
|
-
`,
|
|
516
|
+
`,Re=`
|
|
517
517
|
-- Test outcomes (ADR-023: Quality Feedback Loop)
|
|
518
518
|
CREATE TABLE IF NOT EXISTS test_outcomes (
|
|
519
519
|
id TEXT PRIMARY KEY,
|
|
@@ -596,16 +596,16 @@ import{d as z,f as ke}from"./chunk-PNDWHSZO.js";import{a as j,c as qe}from"./chu
|
|
|
596
596
|
CREATE INDEX IF NOT EXISTS idx_coverage_sessions_technique ON coverage_sessions(technique);
|
|
597
597
|
CREATE INDEX IF NOT EXISTS idx_coverage_sessions_agent ON coverage_sessions(agent_id);
|
|
598
598
|
CREATE INDEX IF NOT EXISTS idx_coverage_sessions_created ON coverage_sessions(created_at);
|
|
599
|
-
`,Re=["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"]});function U(o,e,t){let n={value:e,timestamp:t??(e!==void 0?Date.now():0),nodeId:e!==void 0?o:"",version:e!==void 0?1:0,lastUpdated:Date.now()};function a(i,d,u,T){return i!==u?i-u:d.localeCompare(T)}return{get(){return n.value},set(i,d){let u=d??Date.now();(n.timestamp===0||a(u,o,n.timestamp,n.nodeId)>0)&&(n={value:i,timestamp:u,nodeId:o,version:n.version+1,lastUpdated:Date.now()})},merge(i){let d=i.getState();this.applyState(d)},getState(){return{value:n.value,timestamp:n.timestamp,nodeId:n.nodeId,version:n.version,lastUpdated:n.lastUpdated}},applyState(i){(n.timestamp===0||a(i.timestamp,i.nodeId,n.timestamp,n.nodeId)>0)&&(n={value:i.value,timestamp:i.timestamp,nodeId:i.nodeId,version:Math.max(n.version,i.version)+1,lastUpdated:Date.now()})},getNodeId(){return o},getTimestamp(){return n.timestamp}}}function x(o,e){let t=U(o);return t.applyState(e),t}var K=h(()=>{"use strict"});function C(o){let e={counts:{},version:0,lastUpdated:Date.now()};return e.counts[o]=0,{get(){return Object.values(e.counts).reduce((t,n)=>t+n,0)},increment(t=1){if(t<0)throw new Error("G-Counter can only increment by positive values");t!==0&&(e.counts[o]=(e.counts[o]||0)+t,e.version++,e.lastUpdated=Date.now())},merge(t){let n=t.getState();this.applyState(n)},getState(){return{counts:{...e.counts},version:e.version,lastUpdated:e.lastUpdated}},applyState(t){let n=!1;for(let[a,i]of Object.entries(t.counts)){let d=e.counts[a]||0;i>d&&(e.counts[a]=i,n=!0)}n&&(e.version=Math.max(e.version,t.version)+1,e.lastUpdated=Date.now())},getNodeId(){return o},getLocalCount(){return e.counts[o]||0}}}function F(o,e){let t=C(o);return t.applyState(e),t}var M=h(()=>{"use strict"});function G(o){let e=C(o),t=C(o),n=0,a=Date.now();return{get(){return e.get()-t.get()},increment(i=1){if(i<0)throw new Error("Use decrement() for negative values");i!==0&&(e.increment(i),n++,a=Date.now())},decrement(i=1){if(i<0)throw new Error("Use increment() for negative values");i!==0&&(t.increment(i),n++,a=Date.now())},merge(i){let d=i.getState();this.applyState(d)},getState(){return{positive:e.getState(),negative:t.getState(),version:n,lastUpdated:a}},applyState(i){let d=this.get();e.applyState(i.positive),t.applyState(i.negative);let u=this.get();d!==u&&(n=Math.max(n,i.version)+1,a=Date.now())},getNodeId(){return o}}}function P(o,e){let t=G(o);return t.applyState(e),t}var V=h(()=>{"use strict";M()});function He(o,e){return`${o}:${Date.now()}:${e}`}function Q(o){return typeof o=="string"?`s:${o}`:typeof o=="number"?`n:${o}`:typeof o=="boolean"?`b:${o}`:`j:${JSON.stringify(o)}`}function Ye(o){let e=o.substring(0,2),t=o.substring(2);switch(e){case"s:":return t;case"n:":return Number(t);case"b:":return t==="true";case"j:":return L(t);default:throw new Error(`Unknown serialization type: ${e}`)}}function k(o){let e=new Map,t=new Map,n=0,a=Date.now(),i=0;function d(T){let E=e.get(T);if(!E||E.size===0)return!1;let p=t.get(T);if(!p||p.size===0)return!0;for(let g of E)if(!p.has(g))return!0;return!1}function u(T){let E=e.get(T);if(!E)return new Set;let p=t.get(T)||new Set,g=new Set;for(let l of E)p.has(l)||g.add(l);return g}return{has(T){let E=Q(T);return d(E)},values(){let T=[];for(let[E]of e)d(E)&&T.push(Ye(E));return T},size(){let T=0;for(let[E]of e)d(E)&&T++;return T},add(T){let E=Q(T),p=He(o,i++);e.has(E)||e.set(E,new Set),e.get(E).add(p),n++,a=Date.now()},remove(T){let E=Q(T),p=e.get(E);if(!p||p.size===0)return;t.has(E)||t.set(E,new Set);let g=t.get(E);for(let l of p)g.add(l);n++,a=Date.now()},merge(T){let E=T.getState();this.applyState(E)},getState(){let T={};for(let[p,g]of e)T[p]=Array.from(g);let E={};for(let[p,g]of t)g.size>0&&(E[p]=Array.from(g));return{elements:T,tombstones:E,version:n,lastUpdated:a}},applyState(T){let E=!1;for(let[p,g]of Object.entries(T.elements)){e.has(p)||e.set(p,new Set);let l=e.get(p);for(let f of g)l.has(f)||(l.add(f),E=!0)}for(let[p,g]of Object.entries(T.tombstones)){t.has(p)||t.set(p,new Set);let l=t.get(p);for(let f of g)l.has(f)||(l.add(f),E=!0)}E&&(n=Math.max(n,T.version)+1,a=Date.now())},getNodeId(){return o},clear(){for(let[T,E]of e){t.has(T)||t.set(T,new Set);let p=t.get(T);for(let g of E)p.add(g)}n++,a=Date.now()}}}function q(o,e){let t=k(o);return t.applyState(e),t}var J=h(()=>{"use strict";re()});function Z(o){let e={...$e,...o},{nodeId:t,enableDeltaTracking:n,maxDeltaHistory:a}=e,i=new Map,d=new Map,u=new Map,T=new Map,E=0,p=[],g=new Set,l={registers:new Set,gCounters:new Set,pnCounters:new Set,sets:new Set};function f(s,r,c){let _={key:s,type:r,operation:c,timestamp:Date.now(),nodeId:t};for(let we of g)try{we(_)}catch(Ue){console.error("[CRDTStore] Error in change listener:",Ue)}}function N(s,r){E++,n&&l[s].add(r)}function ee(){if(!n||!(l.registers.size>0||l.gCounters.size>0||l.pnCounters.size>0||l.sets.size>0))return;let r={fromVersion:p.length>0?p[p.length-1].toVersion:0,toVersion:E,timestamp:Date.now(),nodeId:t};if(l.registers.size>0){r.registers={};for(let c of l.registers){let _=i.get(c);_&&(r.registers[c]=_.getState())}l.registers.clear()}if(l.gCounters.size>0){r.gCounters={};for(let c of l.gCounters){let _=d.get(c);_&&(r.gCounters[c]=_.getState())}l.gCounters.clear()}if(l.pnCounters.size>0){r.pnCounters={};for(let c of l.pnCounters){let _=u.get(c);_&&(r.pnCounters[c]=_.getState())}l.pnCounters.clear()}if(l.sets.size>0){r.sets={};for(let c of l.sets){let _=T.get(c);_&&(r.sets[c]=_.getState())}l.sets.clear()}for(p.push(r);p.length>a;)p.shift()}let R={getRegister(s){return i.has(s)||i.set(s,U(t)),i.get(s)},setRegister(s,r){R.getRegister(s).set(r),N("registers",s),f(s,"lww-register","set")},hasRegister(s){return i.has(s)},deleteRegister(s){let r=i.delete(s);return r&&N("registers",s),r},getGCounter(s){return d.has(s)||d.set(s,C(t)),d.get(s)},incrementGCounter(s,r){R.getGCounter(s).increment(r),N("gCounters",s),f(s,"g-counter","increment")},hasGCounter(s){return d.has(s)},deleteGCounter(s){let r=d.delete(s);return r&&N("gCounters",s),r},getCounter(s){return u.has(s)||u.set(s,G(t)),u.get(s)},incrementCounter(s,r){R.getCounter(s).increment(r),N("pnCounters",s),f(s,"pn-counter","increment")},decrementCounter(s,r){R.getCounter(s).decrement(r),N("pnCounters",s),f(s,"pn-counter","decrement")},hasCounter(s){return u.has(s)},deleteCounter(s){let r=u.delete(s);return r&&N("pnCounters",s),r},getSet(s){return T.has(s)||T.set(s,k(t)),T.get(s)},addToSet(s,r){R.getSet(s).add(r),N("sets",s),f(s,"or-set","add")},removeFromSet(s,r){R.getSet(s).remove(r),N("sets",s),f(s,"or-set","remove")},hasSet(s){return T.has(s)},deleteSet(s){let r=T.delete(s);return r&&N("sets",s),r},merge(s){let r=s.getState();R.applyState(r)},getState(){ee();let s={version:E,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let[r,c]of i)s.registers[r]=c.getState();for(let[r,c]of d)s.gCounters[r]=c.getState();for(let[r,c]of u)s.pnCounters[r]=c.getState();for(let[r,c]of T)s.sets[r]=c.getState();return s},applyState(s){for(let[r,c]of Object.entries(s.registers))i.has(r)?i.get(r).applyState(c):i.set(r,x(t,c)),N("registers",r),f(r,"lww-register","merge");for(let[r,c]of Object.entries(s.gCounters))d.has(r)?d.get(r).applyState(c):d.set(r,F(t,c)),N("gCounters",r),f(r,"g-counter","merge");for(let[r,c]of Object.entries(s.pnCounters))u.has(r)?u.get(r).applyState(c):u.set(r,P(t,c)),N("pnCounters",r),f(r,"pn-counter","merge");for(let[r,c]of Object.entries(s.sets))T.has(r)?T.get(r).applyState(c):T.set(r,q(t,c)),N("sets",r),f(r,"or-set","merge");E=Math.max(E,s.version)+1},getDelta(s){if(ee(),p.length===0)return s>=E,null;let r=p.filter(_=>_.toVersion>s);if(r.length===0)return null;let c={fromVersion:s,toVersion:E,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let _ of r)_.registers&&Object.assign(c.registers,_.registers),_.gCounters&&Object.assign(c.gCounters,_.gCounters),_.pnCounters&&Object.assign(c.pnCounters,_.pnCounters),_.sets&&Object.assign(c.sets,_.sets);return Object.keys(c.registers).length===0&&delete c.registers,Object.keys(c.gCounters).length===0&&delete c.gCounters,Object.keys(c.pnCounters).length===0&&delete c.pnCounters,Object.keys(c.sets).length===0&&delete c.sets,c},applyDelta(s){if(s.registers)for(let[r,c]of Object.entries(s.registers))i.has(r)?i.get(r).applyState(c):i.set(r,x(t,c)),N("registers",r),f(r,"lww-register","merge");if(s.gCounters)for(let[r,c]of Object.entries(s.gCounters))d.has(r)?d.get(r).applyState(c):d.set(r,F(t,c)),N("gCounters",r),f(r,"g-counter","merge");if(s.pnCounters)for(let[r,c]of Object.entries(s.pnCounters))u.has(r)?u.get(r).applyState(c):u.set(r,P(t,c)),N("pnCounters",r),f(r,"pn-counter","merge");if(s.sets)for(let[r,c]of Object.entries(s.sets))T.has(r)?T.get(r).applyState(c):T.set(r,q(t,c)),N("sets",r),f(r,"or-set","merge");E=Math.max(E,s.toVersion)+1},getVersion(){return E},getNodeId(){return t},on(s,r){if(s==="change")return g.add(r),()=>{g.delete(r)};throw new Error(`Unknown event type: ${s}`)},removeAllListeners(){g.clear()},keys(s){let r=[];return(!s||s==="lww-register")&&r.push(...Array.from(i.keys())),(!s||s==="g-counter")&&r.push(...Array.from(d.keys())),(!s||s==="pn-counter")&&r.push(...Array.from(u.keys())),(!s||s==="or-set")&&r.push(...Array.from(T.keys())),r},clear(){i.clear(),d.clear(),u.clear(),T.clear(),p.length=0,l.registers.clear(),l.gCounters.clear(),l.pnCounters.clear(),l.sets.clear(),E=0},getStats(){return{total:i.size+d.size+u.size+T.size,registers:i.size,gCounters:d.size,pnCounters:u.size,sets:T.size,version:E,nodeId:t,deltaHistorySize:p.length}}};return R}var $e,Ce=h(()=>{"use strict";K();M();V();J();$e={nodeId:"default-node",enableDeltaTracking:!0,maxDeltaHistory:100}});var Ie=h(()=>{"use strict"});var Oe=h(()=>{"use strict";K();M();V();J();Ce();Ie()});var Je={};xe(Je,{ALLOWED_TABLE_NAMES:()=>H,BinaryHeap:()=>se,DEFAULT_UNIFIED_MEMORY_CONFIG:()=>ye,UnifiedHnswIndex:()=>X,UnifiedMemoryManager:()=>A,clearProjectRootCache:()=>B,createHnswIndex:()=>oe,findProjectRoot:()=>b,getDefaultDbPath:()=>be,getResolvedDefaultConfig:()=>De,getUnifiedMemory:()=>Xe,initializeUnifiedMemory:()=>Ke,resetUnifiedMemory:()=>Ve,validateTableName:()=>O});import*as m from"fs";import*as ve from"os";import*as S from"path";function be(){let o=b();return S.join(o,".agentic-qe","memory.db")}function De(){return{...ye,dbPath:be()}}function Xe(o){return A.getInstance(o)}async function Ke(o){let e=Xe(o);return await e.initialize(),e}function Ve(){A.resetInstance()}function Qe(){if(Ae)return;Ae=!0;let o=()=>{try{let e=A.instance;e&&e.close()}catch(e){console.debug("[UnifiedMemory] Cleanup error:",e instanceof Error?e.message:e)}};process.on("beforeExit",o),process.on("SIGINT",()=>{o(),process.exit(0)}),process.on("SIGTERM",()=>{o(),process.exit(0)})}var y,ye,A,Ae,Ze=h(()=>{Pe();re();Fe();Me();Ge();Ee();Y();Y();ie();ie();Le();Oe();ze();y=te.create("unified-memory");ye={dbPath:".agentic-qe/memory.db",walMode:!0,mmapSize:v.MMAP_SIZE_BYTES,cacheSize:v.CACHE_SIZE_KB,busyTimeout:v.BUSY_TIMEOUT_MS,vectorDimensions:v.DEFAULT_VECTOR_DIMENSIONS};A=class o{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=De();if(this.config={...t,...e},process.env.AQE_MEMORY_BACKEND==="memory"){this.config.dbPath=":memory:";return}if(!S.isAbsolute(this.config.dbPath)){let n=b();this.config.dbPath=S.join(n,this.config.dbPath)}}static getInstance(e){return o.instance||(o.instance=new o(e)),o.instance}static async getInstanceAsync(e){return o.instance?.initialized?o.instance:(o.instancePromise||(o.instancePromise=(async()=>{let t=o.getInstance(e);return await t.initialize(),t})()),o.instancePromise)}static resetInstance(){o.instance&&(o.instance.close(),o.instance=null),o.instancePromise=null,B()}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:",n="",a=!1,i=0;if(!t){let d=process.env.AQE_PROJECT_ROOT;if(d){let u=S.resolve(this.config.dbPath),T=S.resolve(d);!u.startsWith(T)&&!u.startsWith(ve.tmpdir())&&u.includes(".agentic-qe")&&(console.error(`[UnifiedMemory] WARNING: DB path "${this.config.dbPath}" points to a production .agentic-qe/ while AQE_PROJECT_ROOT="${d}". Redirecting to test-safe path.`),this.config.dbPath=S.join(d,".agentic-qe","memory.db"))}if(n=S.dirname(this.config.dbPath),m.existsSync(n)||m.mkdirSync(n,{recursive:!0}),a=m.existsSync(this.config.dbPath),a)i=m.statSync(this.config.dbPath).size;else if(m.existsSync(n)){let u=this.findRecentBackups(n);if(u.length>0){let T=u[0];console.error(`[UnifiedMemory] CRITICAL: Database file missing but directory exists!
|
|
599
|
+
`,Le=["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"]});function x(o,e,t){let n={value:e,timestamp:t??(e!==void 0?Date.now():0),nodeId:e!==void 0?o:"",version:e!==void 0?1:0,lastUpdated:Date.now()};function a(i,T,E,d){return i!==E?i-E:T.localeCompare(d)}return{get(){return n.value},set(i,T){let E=T??Date.now();(n.timestamp===0||a(E,o,n.timestamp,n.nodeId)>0)&&(n={value:i,timestamp:E,nodeId:o,version:n.version+1,lastUpdated:Date.now()})},merge(i){let T=i.getState();this.applyState(T)},getState(){return{value:n.value,timestamp:n.timestamp,nodeId:n.nodeId,version:n.version,lastUpdated:n.lastUpdated}},applyState(i){(n.timestamp===0||a(i.timestamp,i.nodeId,n.timestamp,n.nodeId)>0)&&(n={value:i.value,timestamp:i.timestamp,nodeId:i.nodeId,version:Math.max(n.version,i.version)+1,lastUpdated:Date.now()})},getNodeId(){return o},getTimestamp(){return n.timestamp}}}function F(o,e){let t=x(o);return t.applyState(e),t}var V=R(()=>{"use strict"});function I(o){let e={counts:{},version:0,lastUpdated:Date.now()};return e.counts[o]=0,{get(){return Object.values(e.counts).reduce((t,n)=>t+n,0)},increment(t=1){if(t<0)throw new Error("G-Counter can only increment by positive values");t!==0&&(e.counts[o]=(e.counts[o]||0)+t,e.version++,e.lastUpdated=Date.now())},merge(t){let n=t.getState();this.applyState(n)},getState(){return{counts:{...e.counts},version:e.version,lastUpdated:e.lastUpdated}},applyState(t){let n=!1;for(let[a,i]of Object.entries(t.counts)){let T=e.counts[a]||0;i>T&&(e.counts[a]=i,n=!0)}n&&(e.version=Math.max(e.version,t.version)+1,e.lastUpdated=Date.now())},getNodeId(){return o},getLocalCount(){return e.counts[o]||0}}}function M(o,e){let t=I(o);return t.applyState(e),t}var G=R(()=>{"use strict"});function P(o){let e=I(o),t=I(o),n=0,a=Date.now();return{get(){return e.get()-t.get()},increment(i=1){if(i<0)throw new Error("Use decrement() for negative values");i!==0&&(e.increment(i),n++,a=Date.now())},decrement(i=1){if(i<0)throw new Error("Use increment() for negative values");i!==0&&(t.increment(i),n++,a=Date.now())},merge(i){let T=i.getState();this.applyState(T)},getState(){return{positive:e.getState(),negative:t.getState(),version:n,lastUpdated:a}},applyState(i){let T=this.get();e.applyState(i.positive),t.applyState(i.negative);let E=this.get();T!==E&&(n=Math.max(n,i.version)+1,a=Date.now())},getNodeId(){return o}}}function k(o,e){let t=P(o);return t.applyState(e),t}var Q=R(()=>{"use strict";G()});function Ye(o,e){return`${o}:${Date.now()}:${e}`}function J(o){return typeof o=="string"?`s:${o}`:typeof o=="number"?`n:${o}`:typeof o=="boolean"?`b:${o}`:`j:${JSON.stringify(o)}`}function $e(o){let e=o.substring(0,2),t=o.substring(2);switch(e){case"s:":return t;case"n:":return Number(t);case"b:":return t==="true";case"j:":return C(t);default:throw new Error(`Unknown serialization type: ${e}`)}}function q(o){let e=new Map,t=new Map,n=0,a=Date.now(),i=0;function T(d){let u=e.get(d);if(!u||u.size===0)return!1;let p=t.get(d);if(!p||p.size===0)return!0;for(let _ of u)if(!p.has(_))return!0;return!1}function E(d){let u=e.get(d);if(!u)return new Set;let p=t.get(d)||new Set,_=new Set;for(let g of u)p.has(g)||_.add(g);return _}return{has(d){let u=J(d);return T(u)},values(){let d=[];for(let[u]of e)T(u)&&d.push($e(u));return d},size(){let d=0;for(let[u]of e)T(u)&&d++;return d},add(d){let u=J(d),p=Ye(o,i++);e.has(u)||e.set(u,new Set),e.get(u).add(p),n++,a=Date.now()},remove(d){let u=J(d),p=e.get(u);if(!p||p.size===0)return;t.has(u)||t.set(u,new Set);let _=t.get(u);for(let g of p)_.add(g);n++,a=Date.now()},merge(d){let u=d.getState();this.applyState(u)},getState(){let d={};for(let[p,_]of e)d[p]=Array.from(_);let u={};for(let[p,_]of t)_.size>0&&(u[p]=Array.from(_));return{elements:d,tombstones:u,version:n,lastUpdated:a}},applyState(d){let u=!1;for(let[p,_]of Object.entries(d.elements)){e.has(p)||e.set(p,new Set);let g=e.get(p);for(let l of _)g.has(l)||(g.add(l),u=!0)}for(let[p,_]of Object.entries(d.tombstones)){t.has(p)||t.set(p,new Set);let g=t.get(p);for(let l of _)g.has(l)||(g.add(l),u=!0)}u&&(n=Math.max(n,d.version)+1,a=Date.now())},getNodeId(){return o},clear(){for(let[d,u]of e){t.has(d)||t.set(d,new Set);let p=t.get(d);for(let _ of u)p.add(_)}n++,a=Date.now()}}}function z(o,e){let t=q(o);return t.applyState(e),t}var Z=R(()=>{"use strict";se()});function ee(o){let e={...Ke,...o},{nodeId:t,enableDeltaTracking:n,maxDeltaHistory:a}=e,i=new Map,T=new Map,E=new Map,d=new Map,u=0,p=[],_=new Set,g={registers:new Set,gCounters:new Set,pnCounters:new Set,sets:new Set};function l(s,r,c){let N={key:s,type:r,operation:c,timestamp:Date.now(),nodeId:t};for(let Ue of _)try{Ue(N)}catch(xe){console.error("[CRDTStore] Error in change listener:",xe)}}function m(s,r){u++,n&&g[s].add(r)}function L(){if(!n||!(g.registers.size>0||g.gCounters.size>0||g.pnCounters.size>0||g.sets.size>0))return;let r={fromVersion:p.length>0?p[p.length-1].toVersion:0,toVersion:u,timestamp:Date.now(),nodeId:t};if(g.registers.size>0){r.registers={};for(let c of g.registers){let N=i.get(c);N&&(r.registers[c]=N.getState())}g.registers.clear()}if(g.gCounters.size>0){r.gCounters={};for(let c of g.gCounters){let N=T.get(c);N&&(r.gCounters[c]=N.getState())}g.gCounters.clear()}if(g.pnCounters.size>0){r.pnCounters={};for(let c of g.pnCounters){let N=E.get(c);N&&(r.pnCounters[c]=N.getState())}g.pnCounters.clear()}if(g.sets.size>0){r.sets={};for(let c of g.sets){let N=d.get(c);N&&(r.sets[c]=N.getState())}g.sets.clear()}for(p.push(r);p.length>a;)p.shift()}let h={getRegister(s){return i.has(s)||i.set(s,x(t)),i.get(s)},setRegister(s,r){h.getRegister(s).set(r),m("registers",s),l(s,"lww-register","set")},hasRegister(s){return i.has(s)},deleteRegister(s){let r=i.delete(s);return r&&m("registers",s),r},getGCounter(s){return T.has(s)||T.set(s,I(t)),T.get(s)},incrementGCounter(s,r){h.getGCounter(s).increment(r),m("gCounters",s),l(s,"g-counter","increment")},hasGCounter(s){return T.has(s)},deleteGCounter(s){let r=T.delete(s);return r&&m("gCounters",s),r},getCounter(s){return E.has(s)||E.set(s,P(t)),E.get(s)},incrementCounter(s,r){h.getCounter(s).increment(r),m("pnCounters",s),l(s,"pn-counter","increment")},decrementCounter(s,r){h.getCounter(s).decrement(r),m("pnCounters",s),l(s,"pn-counter","decrement")},hasCounter(s){return E.has(s)},deleteCounter(s){let r=E.delete(s);return r&&m("pnCounters",s),r},getSet(s){return d.has(s)||d.set(s,q(t)),d.get(s)},addToSet(s,r){h.getSet(s).add(r),m("sets",s),l(s,"or-set","add")},removeFromSet(s,r){h.getSet(s).remove(r),m("sets",s),l(s,"or-set","remove")},hasSet(s){return d.has(s)},deleteSet(s){let r=d.delete(s);return r&&m("sets",s),r},merge(s){let r=s.getState();h.applyState(r)},getState(){L();let s={version:u,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let[r,c]of i)s.registers[r]=c.getState();for(let[r,c]of T)s.gCounters[r]=c.getState();for(let[r,c]of E)s.pnCounters[r]=c.getState();for(let[r,c]of d)s.sets[r]=c.getState();return s},applyState(s){for(let[r,c]of Object.entries(s.registers))i.has(r)?i.get(r).applyState(c):i.set(r,F(t,c)),m("registers",r),l(r,"lww-register","merge");for(let[r,c]of Object.entries(s.gCounters))T.has(r)?T.get(r).applyState(c):T.set(r,M(t,c)),m("gCounters",r),l(r,"g-counter","merge");for(let[r,c]of Object.entries(s.pnCounters))E.has(r)?E.get(r).applyState(c):E.set(r,k(t,c)),m("pnCounters",r),l(r,"pn-counter","merge");for(let[r,c]of Object.entries(s.sets))d.has(r)?d.get(r).applyState(c):d.set(r,z(t,c)),m("sets",r),l(r,"or-set","merge");u=Math.max(u,s.version)+1},getDelta(s){if(L(),p.length===0)return s>=u,null;let r=p.filter(N=>N.toVersion>s);if(r.length===0)return null;let c={fromVersion:s,toVersion:u,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let N of r)N.registers&&Object.assign(c.registers,N.registers),N.gCounters&&Object.assign(c.gCounters,N.gCounters),N.pnCounters&&Object.assign(c.pnCounters,N.pnCounters),N.sets&&Object.assign(c.sets,N.sets);return Object.keys(c.registers).length===0&&delete c.registers,Object.keys(c.gCounters).length===0&&delete c.gCounters,Object.keys(c.pnCounters).length===0&&delete c.pnCounters,Object.keys(c.sets).length===0&&delete c.sets,c},applyDelta(s){if(s.registers)for(let[r,c]of Object.entries(s.registers))i.has(r)?i.get(r).applyState(c):i.set(r,F(t,c)),m("registers",r),l(r,"lww-register","merge");if(s.gCounters)for(let[r,c]of Object.entries(s.gCounters))T.has(r)?T.get(r).applyState(c):T.set(r,M(t,c)),m("gCounters",r),l(r,"g-counter","merge");if(s.pnCounters)for(let[r,c]of Object.entries(s.pnCounters))E.has(r)?E.get(r).applyState(c):E.set(r,k(t,c)),m("pnCounters",r),l(r,"pn-counter","merge");if(s.sets)for(let[r,c]of Object.entries(s.sets))d.has(r)?d.get(r).applyState(c):d.set(r,z(t,c)),m("sets",r),l(r,"or-set","merge");u=Math.max(u,s.toVersion)+1},getVersion(){return u},getNodeId(){return t},on(s,r){if(s==="change")return _.add(r),()=>{_.delete(r)};throw new Error(`Unknown event type: ${s}`)},removeAllListeners(){_.clear()},keys(s){let r=[];return(!s||s==="lww-register")&&r.push(...Array.from(i.keys())),(!s||s==="g-counter")&&r.push(...Array.from(T.keys())),(!s||s==="pn-counter")&&r.push(...Array.from(E.keys())),(!s||s==="or-set")&&r.push(...Array.from(d.keys())),r},clear(){i.clear(),T.clear(),E.clear(),d.clear(),p.length=0,g.registers.clear(),g.gCounters.clear(),g.pnCounters.clear(),g.sets.clear(),u=0},getStats(){return{total:i.size+T.size+E.size+d.size,registers:i.size,gCounters:T.size,pnCounters:E.size,sets:d.size,version:u,nodeId:t,deltaHistorySize:p.length}}};return h}var Ke,Ie=R(()=>{"use strict";V();G();Q();Z();Ke={nodeId:"default-node",enableDeltaTracking:!0,maxDeltaHistory:100}});var Ae=R(()=>{"use strict"});var Oe=R(()=>{"use strict";V();G();Q();Z();Ie();Ae()});var Ze={};Fe(Ze,{ALLOWED_TABLE_NAMES:()=>Y,BinaryHeap:()=>oe,DEFAULT_UNIFIED_MEMORY_CONFIG:()=>De,UnifiedHnswIndex:()=>w,UnifiedMemoryManager:()=>v,clearProjectRootCache:()=>W,createHnswIndex:()=>ie,findProjectRoot:()=>y,getDefaultDbPath:()=>ye,getResolvedDefaultConfig:()=>Xe,getUnifiedMemory:()=>we,initializeUnifiedMemory:()=>Ve,resetUnifiedMemory:()=>Qe,validateTableName:()=>O});import*as f from"fs";import*as be from"os";import*as S from"path";function ye(){let o=y();return S.join(o,".agentic-qe","memory.db")}function Xe(){return{...De,dbPath:ye()}}function we(o){return v.getInstance(o)}async function Ve(o){let e=we(o);return await e.initialize(),e}function Qe(){v.resetInstance()}function Je(){if(ve)return;ve=!0;let o=()=>{try{let e=v.instance;e&&e.close()}catch(e){console.debug("[UnifiedMemory] Cleanup error:",e instanceof Error?e.message:e)}};process.on("beforeExit",o),process.on("SIGINT",()=>{o(),process.exit(0)}),process.on("SIGTERM",()=>{o(),process.exit(0)})}var D,De,v,ve,et=R(()=>{ke();se();Me();Ge();Pe();ue();$();$();ae();ae();Ce();Oe();je();D=ne.create("unified-memory");De={dbPath:".agentic-qe/memory.db",walMode:!0,mmapSize:b.MMAP_SIZE_BYTES,cacheSize:b.CACHE_SIZE_KB,busyTimeout:b.BUSY_TIMEOUT_MS,vectorDimensions:b.DEFAULT_VECTOR_DIMENSIONS};v=class o{static instance=null;static instancePromise=null;db=null;config;initialized=!1;vectorsLoaded=!1;initPromise=null;preparedStatements=new Map;vectorIndex=new w("qe-memory");crdtStore=null;proofGate=null;proofGateEnvChecked=!1;static PROOF_NS="__proofgate__";static PROOF_KEY="chain";constructor(e){let t=Xe();if(this.config={...t,...e},process.env.AQE_MEMORY_BACKEND==="memory"){this.config.dbPath=":memory:";return}if(!S.isAbsolute(this.config.dbPath)){let n=y();this.config.dbPath=S.join(n,this.config.dbPath)}}static getInstance(e){return o.instance||(o.instance=new o(e)),o.instance}static async getInstanceAsync(e){return o.instance?.initialized?o.instance:(o.instancePromise||(o.instancePromise=(async()=>{let t=o.getInstance(e);return await t.initialize(),t})()),o.instancePromise)}static resetInstance(){o.instance&&(o.instance.close(),o.instance=null),o.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:",n="",a=!1,i=0;if(!t){let T=process.env.AQE_PROJECT_ROOT;if(T){let E=S.resolve(this.config.dbPath),d=S.resolve(T);!E.startsWith(d)&&!E.startsWith(be.tmpdir())&&E.includes(".agentic-qe")&&(console.error(`[UnifiedMemory] WARNING: DB path "${this.config.dbPath}" points to a production .agentic-qe/ while AQE_PROJECT_ROOT="${T}". Redirecting to test-safe path.`),this.config.dbPath=S.join(T,".agentic-qe","memory.db"))}if(n=S.dirname(this.config.dbPath),f.existsSync(n)||f.mkdirSync(n,{recursive:!0}),a=f.existsSync(this.config.dbPath),a)i=f.statSync(this.config.dbPath).size;else if(f.existsSync(n)){let E=this.findRecentBackups(n);if(E.length>0){let d=E[0];console.error(`[UnifiedMemory] CRITICAL: Database file missing but directory exists!
|
|
600
600
|
Expected: ${this.config.dbPath}
|
|
601
|
-
Found ${
|
|
602
|
-
Restoring from backup to prevent data loss...`),
|
|
603
|
-
DB was ${(i/1024/1024).toFixed(1)}MB, now ${(
|
|
601
|
+
Found ${E.length} backup(s), newest: ${d.path} (${(d.size/1024/1024).toFixed(1)}MB)
|
|
602
|
+
Restoring from backup to prevent data loss...`),f.copyFileSync(d.path,this.config.dbPath);for(let u of["-wal","-shm"]){let p=this.config.dbPath+u;f.existsSync(p)&&f.unlinkSync(p)}i=d.size}}}if(e?.throwIfAborted(),this.db=re(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(),e?.throwIfAborted(),a&&i>1e6)try{let T=this.db.prepare("SELECT COUNT(*) as cnt FROM qe_patterns").get();if(T&&T.cnt===0){let E=f.statSync(this.config.dbPath).size;E<i*.1&&console.error(`[UnifiedMemory] CRITICAL: Possible data loss detected!
|
|
603
|
+
DB was ${(i/1024/1024).toFixed(1)}MB, now ${(E/1024/1024).toFixed(1)}MB with 0 patterns.
|
|
604
604
|
This looks like the DB was replaced with an empty schema.
|
|
605
|
-
Check backups in ${n} 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: ${
|
|
605
|
+
Check backups in ${n} 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: ${X(t)}`)}}}findRecentBackups(e){try{let n=f.readdirSync(e).filter(i=>i.startsWith("memory")&&i.endsWith(".db")&&i!=="memory.db").map(i=>{let T=S.join(e,i),E=f.statSync(T);return{path:T,size:E.size,mtime:E.mtimeMs}}).filter(i=>i.size>1e6).sort((i,T)=>T.mtime-i.mtime),a=S.join(e,"backups");if(f.existsSync(a)){let i=f.readdirSync(a);for(let T of i)if(T.endsWith(".db")){let E=S.join(a,T),d=f.statSync(E);d.size>1e6&&n.push({path:E,size:d.size,mtime:d.mtimeMs})}n.sort((T,E)=>E.mtime-T.mtime)}return n}catch{return[]}}warnIfDuplicateDatabases(){if(this.config.dbPath!==":memory:")try{let e=y(),t=S.resolve(this.config.dbPath),a=[S.join(e,".agentic-qe","memory.db"),S.join(e,"v3",".agentic-qe","memory.db")].map(i=>S.resolve(i)).filter(i=>i!==t&&f.existsSync(i));a.length>0&&console.warn(`[UnifiedMemory] WARNING: Duplicate database(s) detected!
|
|
606
606
|
Canonical: ${t}
|
|
607
607
|
Duplicates: ${a.join(", ")}
|
|
608
|
-
This can cause data splits. Remove duplicates or set AQE_PROJECT_ROOT.`)}catch(e){
|
|
608
|
+
This can cause data splits. Remove duplicates or set AQE_PROJECT_ROOT.`)}catch(e){D.debug("Duplicate database check failed",{error:e instanceof Error?e.message:String(e)})}}columnExists(e,t){if(!this.db)return!1;try{let n=O(e);return this.db.prepare(`PRAGMA table_info(${n})`).all().some(i=>i.name===t)}catch(n){return D.debug("Column existence check failed",{table:e,column:t,error:n instanceof Error?n.message:String(n)}),!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:n,columnDef:a}of e)if(this.db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name=?").get(t)&&!this.columnExists(t,n)){let T=O(t);try{this.db.exec(`ALTER TABLE ${T} ADD COLUMN ${n} ${a}`),console.log(`[UnifiedMemory] Added column ${n} to ${t} (safe migration)`)}catch(E){console.log(`[UnifiedMemory] Column ${n} on ${t}: ${E instanceof Error?E.message:String(E)}`)}}}async runMigrations(){if(!this.db)throw new Error("Database not initialized");this.db.exec(le),this.handleV2SchemaIncompatibilities();let t=this.db.prepare("SELECT version FROM schema_version WHERE id = 1").get()?.version??0;t<U&&(console.log(`[UnifiedMemory] Migrating from v${t} to v${U}`),this.db.transaction(()=>{t<1&&this.db.exec(ge),t<2&&this.db.exec(me),t<3&&(this.db.exec(_e),this.db.exec(K),this.db.exec(fe)),t<4&&this.db.exec(Ne),t<5&&this.db.exec(Se),t<6&&this.db.exec(j),t<7&&this.db.exec(he),t<8&&this.db.exec(Re),t<9&&(this.db.exec(`
|
|
609
609
|
CREATE VIRTUAL TABLE IF NOT EXISTS qe_patterns_fts USING fts5(
|
|
610
610
|
name, description, pattern_type, qe_domain,
|
|
611
611
|
content='qe_patterns',
|
|
@@ -631,16 +631,16 @@ import{d as z,f as ke}from"./chunk-PNDWHSZO.js";import{a as j,c as qe}from"./chu
|
|
|
631
631
|
`),this.db.exec(`
|
|
632
632
|
INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
|
|
633
633
|
SELECT rowid, name, description, pattern_type, qe_domain FROM qe_patterns;
|
|
634
|
-
`)),t<10&&this.db.exec(
|
|
634
|
+
`)),t<10&&this.db.exec(B),t<11&&this.migrateToV11GoapExecutionSteps(),this.db.prepare(`
|
|
635
635
|
INSERT OR REPLACE INTO schema_version (id, version, migrated_at)
|
|
636
636
|
VALUES (1, ?, datetime('now'))
|
|
637
|
-
`).run(
|
|
637
|
+
`).run(U)})(),console.log("[UnifiedMemory] Migration complete"))}migrateToV11GoapExecutionSteps(){let e=this.db;e.exec(K);let t=(n,a,i)=>{e.prepare(`SELECT name FROM pragma_table_info('${n}')`).all().some(E=>E.name===a)||e.exec(`ALTER TABLE ${n} ADD COLUMN ${a} ${i}`)};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 n=this.bufferToFloatArray(t.embedding,t.dimensions);this.vectorIndex.add(t.id,n)}this.vectorsLoaded=!0,console.log(`[UnifiedMemory] Loaded ${e.length} vectors into vector index (ruvector flat)`)}async kvSet(e,t,n="default",a){this.ensureInitialized();let i=a?Date.now()+a*1e3:null,T=JSON.stringify(t);this.db.prepare(`
|
|
638
638
|
INSERT OR REPLACE INTO kv_store (key, namespace, value, expires_at)
|
|
639
639
|
VALUES (?, ?, ?, ?)
|
|
640
|
-
`).run(e,n,
|
|
640
|
+
`).run(e,n,T,i),this.auditWrite("kvSet",n,e,T)}async kvGet(e,t="default"){this.ensureInitialized();let n=this.db.prepare(`
|
|
641
641
|
SELECT value, expires_at FROM kv_store
|
|
642
642
|
WHERE key = ? AND namespace = ?
|
|
643
|
-
`).get(e,t);if(n){if(n.expires_at&&Date.now()>n.expires_at){this.db.prepare("DELETE FROM kv_store WHERE key = ? AND namespace = ?").run(e,t);return}return
|
|
643
|
+
`).get(e,t);if(n){if(n.expires_at&&Date.now()>n.expires_at){this.db.prepare("DELETE FROM kv_store WHERE key = ? AND namespace = ?").run(e,t);return}return C(n.value)}}async kvDelete(e,t="default"){this.ensureInitialized();let n=this.db.prepare("DELETE FROM kv_store WHERE key = ? AND namespace = ?").run(e,t);return n.changes>0&&this.auditWrite("kvDelete",t,e,""),n.changes>0}async kvExists(e,t="default"){return this.ensureInitialized(),this.db.prepare(`
|
|
644
644
|
SELECT 1 FROM kv_store
|
|
645
645
|
WHERE key = ? AND namespace = ? AND (expires_at IS NULL OR expires_at > ?)
|
|
646
646
|
`).get(e,t,Date.now())!==void 0}async kvSearch(e,t="default",n=100){this.ensureInitialized();let a=e.replace(/\*/g,"%").replace(/\?/g,"_");return this.db.prepare(`
|
|
@@ -648,14 +648,14 @@ import{d as z,f as ke}from"./chunk-PNDWHSZO.js";import{a as j,c as qe}from"./chu
|
|
|
648
648
|
WHERE namespace = ? AND key LIKE ?
|
|
649
649
|
AND (expires_at IS NULL OR expires_at > ?)
|
|
650
650
|
LIMIT ?
|
|
651
|
-
`).all(t,a,Date.now(),n).map(
|
|
651
|
+
`).all(t,a,Date.now(),n).map(T=>T.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 A)}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,n,a){if(!this.proofGate){if(this.proofGateEnvChecked||(this.proofGateEnvChecked=!0,process.env.AQE_PROOF_GATE!=="1"))return;this.proofGate=this.loadProofChain()??new A}if(t!==o.PROOF_NS)try{this.proofGate.admit({op:e,ns:t,key:n,value:a}),this.persistProofChain()}catch(i){D.warn(`proof-gate audit skipped for ${t}/${n}: ${X(i)}`)}}persistProofChain(){!this.proofGate||!this.db||this.db.prepare(`
|
|
652
652
|
INSERT OR REPLACE INTO kv_store (key, namespace, value, expires_at)
|
|
653
653
|
VALUES (?, ?, ?, NULL)
|
|
654
654
|
`).run(o.PROOF_KEY,o.PROOF_NS,JSON.stringify(this.proofGate.toJSON()))}loadProofChain(){if(!this.db)return null;let e=this.db.prepare(`
|
|
655
655
|
SELECT value FROM kv_store WHERE key = ? AND namespace = ?
|
|
656
|
-
`).get(o.PROOF_KEY,o.PROOF_NS);if(!e)return null;try{return
|
|
656
|
+
`).get(o.PROOF_KEY,o.PROOF_NS);if(!e)return null;try{return A.fromJSON(JSON.parse(e.value))}catch(t){return D.warn(`proof-gate chain failed to load (starting fresh): ${X(t)}`),null}}async vectorStore(e,t,n="default",a){this.ensureInitialized();let i=this.floatArrayToBuffer(t),T=a?JSON.stringify(a):null;this.db.prepare(`
|
|
657
657
|
INSERT OR REPLACE INTO vectors (id, namespace, embedding, dimensions, metadata, updated_at)
|
|
658
658
|
VALUES (?, ?, ?, ?, ?, datetime('now'))
|
|
659
|
-
`).run(e,n,i,t.length,
|
|
659
|
+
`).run(e,n,i,t.length,T),this.vectorIndex.add(e,t)}async vectorGet(e){this.ensureInitialized();let t=this.db.prepare(`
|
|
660
660
|
SELECT embedding, dimensions, metadata FROM vectors WHERE id = ?
|
|
661
|
-
`).get(e);if(t)return{embedding:this.bufferToFloatArray(t.embedding,t.dimensions),metadata:t.metadata?
|
|
661
|
+
`).get(e);if(t)return{embedding:this.bufferToFloatArray(t.embedding,t.dimensions),metadata:t.metadata?C(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,n,a){if(this.ensureInitialized(),!Number.isInteger(t)||t<=0)return[];this.vectorsLoaded||await this.loadVectorIndex();let i=this.vectorIndex.size(),T=!!(n||a),E=Math.min(i,Math.max(T?t*2:t,1)),d=n?this.db.prepare("SELECT id, namespace, metadata FROM vectors WHERE namespace = ?").all(n):void 0,u=d?new Map(d.map(l=>[l.id,l])):void 0,p=this.vectorIndex.search(e,E);for(;T&&p.filter(l=>(!a||l.id.startsWith(a))&&(!u||u.has(l.id))).length<t&&E<i;)E=Math.min(i,E*2),p=this.vectorIndex.search(e,E);if(p.length===0)return[];let _=u??(()=>{let l=p.map(h=>h.id),m=l.map(()=>"?").join(","),L=this.db.prepare(`SELECT id, namespace, metadata FROM vectors WHERE id IN (${m})`).all(...l);return new Map(L.map(h=>[h.id,h]))})();if(n){let l=[];for(let m of p){let L=_.get(m.id);if(L&&L.namespace===n&&(!a||m.id.startsWith(a))&&(l.push({id:m.id,score:m.score,metadata:L.metadata?C(L.metadata):void 0}),l.length>=t))break}return l}return(a?p.filter(l=>l.id.startsWith(a)).slice(0,t):p.slice(0,t)).map(l=>{let m=_.get(l.id);return{id:l.id,score:l.score,metadata:m?.metadata?C(m.metadata):void 0}})}getVectorSearchProvenance(){return this.vectorIndex.getProvider().isNativeBackend()?{backend:"native-hnsw",indexType:"hnsw",approximate:!0,estimatedRecall:this.vectorIndex.recall(),qualifiedMaxK:te.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=O(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=ee({nodeId:e}),console.log(`[UnifiedMemory] CRDT store initialized for node: ${e}`)}getCRDTStore(){return this.crdtStore}isCRDTInitialized(){return this.crdtStore!==null}async crdtSet(e,t,n="crdt"){this.ensureInitialized(),this.crdtStore&&this.crdtStore.setRegister(e,t),await this.kvSet(e,t,n)}async crdtGet(e,t="crdt"){if(this.crdtStore){let n=this.crdtStore.getRegister(e);if(n)return n.get()}return this.kvGet(e,t)}crdtIncrement(e,t=1){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");let n=this.crdtStore.getCounter(e);n||(this.crdtStore.incrementCounter(e,0),n=this.crdtStore.getCounter(e));for(let a=0;a<t;a++)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 n=this.preparedStatements.get(e);return n||(n=this.db.prepare(t),this.preparedStatements.set(e,n)),n}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=Le.map(a=>{try{let i=this.db.prepare(`SELECT COUNT(*) as count FROM ${a}`).get();return{name:a,rowCount:i.count}}catch(i){return D.debug("Table row count query failed",{table:a,error:i instanceof Error?i.message:String(i)}),{name:a,rowCount:0}}}),t=0,n=0;try{f.existsSync(this.config.dbPath)&&(t=f.statSync(this.config.dbPath).size);let a=this.config.dbPath+"-wal";f.existsSync(a)&&(n=f.statSync(a).size)}catch(a){console.debug("[UnifiedMemory] File stat error:",a instanceof Error?a.message:a)}return{tables:e,fileSize:t,walSize:n,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(),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 n=0;n<e.length;n++)t.writeFloatLE(e[n],n*4);return t}bufferToFloatArray(e,t){let n=new Float32Array(e.buffer,e.byteOffset,t);return Array.from(n)}};ve=!1;Je()});export{Y as a,O as b,rt as c,$ as d,ye as e,De as f,Xe as g,v as h,we as i,Ve as j,Qe as k,Ze as l,et as m};
|
|
@@ -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.13.
|
|
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.13.7");process.exit(0)}
|
|
2
2
|
var i=class{s0;s1;s2;s3;constructor(s){this.s0=this.splitmix32(s),this.s1=this.splitmix32(this.s0),this.s2=this.splitmix32(this.s1),this.s3=this.splitmix32(this.s2)}splitmix32(s){return s=s+2654435769|0,s=Math.imul(s^s>>>16,2246822507),s=Math.imul(s^s>>>13,3266489909),(s^s>>>16)>>>0}next(){let s=this.s3,t=this.s0;return this.s3=this.s2,this.s2=this.s1,this.s1=t,t^=t<<11,t^=t>>>8,this.s0=t^s^s>>>19,this.s0>>>0}nextFloat(){return this.next()/4294967296}nextGaussian(){let s=this.nextFloat()||1e-10,t=this.nextFloat();return Math.sqrt(-2*Math.log(s))*Math.cos(2*Math.PI*t)}};export{i 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.13.
|
|
2
|
-
import{i 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.13.7");process.exit(0)}
|
|
2
|
+
import{i as c}from"./chunk-J5TFIVO2.js";import{a as p}from"./chunk-GAYYOIRM.js";import{c as m}from"./chunk-XNQWCGR5.js";import{b as g,d as E}from"./chunk-FWU55NEY.js";import{a as l,b as _}from"./chunk-6F5UFJIA.js";_();import b from"node:path";import{existsSync as h}from"node:fs";E();p();var T=m.create("metrics-tracker"),d=class{db=null;dbPath;initialized=!1;constructor(e=process.cwd()){this.dbPath=b.join(e,".agentic-qe","memory.db")}async initialize(){if(!this.initialized){if(!h(this.dbPath))throw new Error(`Database not found: ${this.dbPath}. Run "aqe init --auto" first.`);this.db=l(this.dbPath),this.ensureMetricsTable(),this.initialized=!0}}ensureMetricsTable(){this.db&&this.db.exec(`
|
|
3
3
|
CREATE TABLE IF NOT EXISTS learning_daily_snapshots (
|
|
4
4
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
5
5
|
snapshot_date TEXT NOT NULL UNIQUE,
|