agentic-qe 3.9.26 → 3.9.27
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 +69 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/bridge/captured-experience-bridge.d.ts +40 -0
- package/dist/bridge/captured-experience-bridge.js +232 -0
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-T3LXVVV6.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-ZOADSKRX.js → agent-booster-wasm-ITOX2PFK.js} +2 -2
- package/dist/cli/chunks/{agent-handler-SPLFCIHA.js → agent-handler-NGVDEBFM.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-R6ZVL2FT.js → agent-memory-branch-6WLQE4UP.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-NDMVUAJB.js +2 -0
- package/dist/cli/chunks/{audit-6TQQFGQN.js → audit-KTNR6LYC.js} +2 -2
- package/dist/cli/chunks/base-NQRD32GI.js +2 -0
- package/dist/cli/chunks/{hnswlib-node-TULXUZI4.js → better-sqlite3-ROUVYY3W.js} +2 -2
- package/dist/cli/chunks/{brain-handler-6BQCTD3M.js → brain-handler-ZFLB6Q37.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-JTESSKID.js → branch-enumerator-SONBYE7U.js} +2 -2
- package/dist/cli/chunks/{browser-YDZLFZNH.js → browser-D6YYID5Y.js} +2 -2
- package/dist/cli/chunks/browser-workflow-WSAEHMFE.js +2 -0
- package/dist/cli/chunks/{chunk-AOURUJFN.js → chunk-2IKQT3IF.js} +1 -1
- package/dist/cli/chunks/{chunk-4ZAOHYFA.js → chunk-2J3B4ONK.js} +2 -2
- package/dist/cli/chunks/{chunk-RXQX6JNQ.js → chunk-2MO2U3NO.js} +2 -2
- package/dist/cli/chunks/{chunk-HSQLB4GR.js → chunk-2O6XVANK.js} +2 -2
- package/dist/cli/chunks/{chunk-EYFL6QLX.js → chunk-2SEXNZIJ.js} +2 -2
- package/dist/cli/chunks/{chunk-6VRKHHYI.js → chunk-2UPD2NX5.js} +1 -1
- package/dist/cli/chunks/{chunk-ZUUNOGHI.js → chunk-2Z2DD5YW.js} +2 -2
- package/dist/cli/chunks/{chunk-YUMVG55I.js → chunk-3BTSXIJ3.js} +2 -2
- package/dist/cli/chunks/{chunk-F24XTOID.js → chunk-4AWB4BKC.js} +2 -2
- package/dist/cli/chunks/{chunk-LPDPGCDC.js → chunk-4DTF53TE.js} +2 -2
- package/dist/cli/chunks/{chunk-UJPERPQU.js → chunk-4K7KTT4Q.js} +1 -1
- package/dist/cli/chunks/{chunk-VBJ4UQ3X.js → chunk-4SLL4YG2.js} +2 -2
- package/dist/cli/chunks/{chunk-KQQPUHQD.js → chunk-4Z2KY7N3.js} +1 -1
- package/dist/cli/chunks/{chunk-TU2A5BGA.js → chunk-5DDRRXKR.js} +2 -2
- package/dist/cli/chunks/{chunk-TRIA62JA.js → chunk-5GBDMANM.js} +2 -2
- package/dist/cli/chunks/{chunk-VC2FHUOY.js → chunk-5W3XL5YW.js} +2 -2
- package/dist/cli/chunks/{chunk-EEWGVVKH.js → chunk-5WPQATT7.js} +2 -2
- package/dist/cli/chunks/{chunk-AGBIQXB4.js → chunk-6BGF3VZJ.js} +2 -2
- package/dist/cli/chunks/{chunk-7T2KT74O.js → chunk-6BIHLI3A.js} +2 -2
- package/dist/cli/chunks/{chunk-EX7UGFWX.js → chunk-6IYCOEW7.js} +2 -2
- package/dist/cli/chunks/{chunk-N2ET2TL5.js → chunk-6R2OTCWG.js} +2 -2
- package/dist/cli/chunks/{chunk-C5ZA6UBI.js → chunk-7EC2C5QP.js} +1 -1
- package/dist/cli/chunks/{chunk-GHQ6QT47.js → chunk-7QXW6HLF.js} +2 -2
- package/dist/cli/chunks/{chunk-LP7ILPFQ.js → chunk-A4QYEA22.js} +2 -2
- package/dist/cli/chunks/{chunk-4RFODPDS.js → chunk-A7D5532X.js} +2 -2
- package/dist/cli/chunks/{chunk-FDC2ANCP.js → chunk-AAYGZTW3.js} +3 -3
- package/dist/cli/chunks/{chunk-QFXOKERO.js → chunk-ADU5MOQE.js} +1 -1
- package/dist/cli/chunks/{chunk-WND3EYCS.js → chunk-BT5YOORE.js} +2 -2
- package/dist/cli/chunks/{chunk-XAA7ZBNG.js → chunk-BZNIVIZE.js} +1 -1
- package/dist/cli/chunks/{chunk-CMFRBO4N.js → chunk-C7TMWGMN.js} +3 -3
- package/dist/cli/chunks/{chunk-ARLHD5MG.js → chunk-CNWWQYZ3.js} +1 -1
- package/dist/cli/chunks/{chunk-YCZEXLKL.js → chunk-COTY53RT.js} +2 -2
- package/dist/cli/chunks/{chunk-OFAXQGU5.js → chunk-CYNQW276.js} +2 -2
- package/dist/cli/chunks/{chunk-PJPNRDEF.js → chunk-DL6L4FGW.js} +2 -2
- package/dist/cli/chunks/{chunk-MAPQ2UZ5.js → chunk-DPMCEGYQ.js} +2 -2
- package/dist/cli/chunks/{chunk-4EBC7ATS.js → chunk-DURR7FQ2.js} +9 -9
- package/dist/cli/chunks/{chunk-VHHFSVR3.js → chunk-E3K7FQKW.js} +2 -2
- package/dist/cli/chunks/{chunk-2XOIJE7J.js → chunk-ET5RCLBO.js} +2 -2
- package/dist/cli/chunks/{chunk-ONYCSOAR.js → chunk-EW2JQIYW.js} +1 -1
- package/dist/cli/chunks/{chunk-RD3CNJWR.js → chunk-F5PNA7J3.js} +2 -2
- package/dist/cli/chunks/{chunk-P6M6LNSI.js → chunk-FQZM3SVW.js} +2 -2
- package/dist/cli/chunks/{chunk-YYOKX7VH.js → chunk-FY3TF4SA.js} +2 -2
- package/dist/cli/chunks/{chunk-3K2QCWFD.js → chunk-G4KZCXZK.js} +1 -1
- package/dist/cli/chunks/{chunk-U5BMUXV2.js → chunk-GGIE7KUU.js} +2 -2
- package/dist/cli/chunks/{chunk-SYRUG2T7.js → chunk-GXHMSIBM.js} +1 -1
- package/dist/cli/chunks/{chunk-ETBVBV2M.js → chunk-HEZJOCD7.js} +2 -2
- package/dist/cli/chunks/{chunk-4I6XGKSB.js → chunk-HPB5MPJP.js} +2 -2
- package/dist/cli/chunks/{chunk-QQMGUORN.js → chunk-HV7V34DZ.js} +2 -2
- package/dist/cli/chunks/{chunk-MW4WEMLE.js → chunk-HYCRKKJN.js} +2 -2
- package/dist/cli/chunks/{chunk-RNVXTNEB.js → chunk-I3YJEVI2.js} +2 -2
- package/dist/cli/chunks/{chunk-4F6RPT7N.js → chunk-I73XKAOF.js} +3 -3
- package/dist/cli/chunks/{chunk-BBALCRJM.js → chunk-IQITE3HO.js} +1 -1
- package/dist/cli/chunks/{chunk-JWKNHSXP.js → chunk-ITGHTWHH.js} +2 -2
- package/dist/cli/chunks/{chunk-IKRLPS4M.js → chunk-IUUT6Q5I.js} +2 -2
- package/dist/cli/chunks/{chunk-G3KTLF57.js → chunk-J24PEKZ5.js} +2 -2
- package/dist/cli/chunks/{chunk-5JGFDJA6.js → chunk-J2ZH6IHM.js} +2 -2
- package/dist/cli/chunks/{chunk-SGGYSL7J.js → chunk-J6EDIEZB.js} +1 -1
- package/dist/cli/chunks/{chunk-PLB75ASZ.js → chunk-JBL5G5VJ.js} +1 -1
- package/dist/cli/chunks/{chunk-ANEIDNH7.js → chunk-JN7WVS57.js} +2 -2
- package/dist/cli/chunks/{chunk-6UFMNYQV.js → chunk-JP7AOQZZ.js} +1 -1
- package/dist/cli/chunks/{chunk-WCI2FMWZ.js → chunk-JZTMCQVH.js} +1 -1
- package/dist/cli/chunks/{chunk-TQBP3YGG.js → chunk-KFDY5AD7.js} +1 -1
- package/dist/cli/chunks/{chunk-7L3F76MS.js → chunk-LU27B4M7.js} +3 -3
- package/dist/cli/chunks/{chunk-QXQWQRZA.js → chunk-LXGVB3FK.js} +1 -1
- package/dist/cli/chunks/{chunk-AH3IPNOJ.js → chunk-MFRS4KFZ.js} +2 -2
- package/dist/cli/chunks/{chunk-G42KXBBG.js → chunk-MHPA6IWB.js} +2 -2
- package/dist/cli/chunks/{chunk-PSOF6DZA.js → chunk-MKDGVPE3.js} +129 -124
- package/dist/cli/chunks/{chunk-SDD3XQ7X.js → chunk-MSA7UH3M.js} +1 -1
- package/dist/cli/chunks/{chunk-3QPQZJUY.js → chunk-NTTW3LSE.js} +2 -2
- package/dist/cli/chunks/{chunk-6AH4SN6I.js → chunk-NWSFGZKC.js} +1 -1
- package/dist/cli/chunks/{chunk-4QUKBJAS.js → chunk-O7XW2BWN.js} +2 -2
- package/dist/cli/chunks/{chunk-4GUVB7FG.js → chunk-OA5ZH3IH.js} +2 -2
- package/dist/cli/chunks/{chunk-TLBP7EVX.js → chunk-OHT5NJXJ.js} +1 -1
- package/dist/cli/chunks/{chunk-FWPV44HL.js → chunk-PBP2TWV7.js} +2 -2
- package/dist/cli/chunks/{chunk-AUD45G7X.js → chunk-PFHUT2VE.js} +2 -2
- package/dist/cli/chunks/{chunk-XYMUYLHY.js → chunk-PGS2MYE7.js} +1 -1
- package/dist/cli/chunks/{chunk-DBSEDJ7P.js → chunk-PIR3KN5M.js} +2 -2
- package/dist/cli/chunks/{chunk-GW5T4BSO.js → chunk-PMP6QRTB.js} +4 -4
- package/dist/cli/chunks/{chunk-CBBVUZFD.js → chunk-PU7S6SEW.js} +4 -4
- package/dist/cli/chunks/{chunk-ZFLD5ATZ.js → chunk-PXFK5V2E.js} +2 -2
- package/dist/cli/chunks/{chunk-QUHNBIUZ.js → chunk-Q5GQ267O.js} +1 -1
- package/dist/cli/chunks/{chunk-PPP7KZQL.js → chunk-QM2LHV7P.js} +2 -2
- package/dist/cli/chunks/{chunk-FRUDEEZH.js → chunk-RAVTYXUD.js} +1 -1
- package/dist/cli/chunks/{chunk-N3GLRFMH.js → chunk-RDJZLKU2.js} +1 -1
- package/dist/cli/chunks/{chunk-B3KHJQ34.js → chunk-RE5OY7WL.js} +2 -2
- package/dist/cli/chunks/{chunk-XDEF6UFY.js → chunk-RM7WNXRT.js} +2 -2
- package/dist/cli/chunks/{chunk-VPPXZORB.js → chunk-RPDLRKAT.js} +1 -1
- package/dist/cli/chunks/{chunk-HKHRIPXP.js → chunk-S3QE2RBR.js} +9 -9
- package/dist/cli/chunks/{chunk-CYPOU765.js → chunk-SCS3RUTT.js} +1 -1
- package/dist/cli/chunks/{chunk-IVNZLESN.js → chunk-SL5MAYYP.js} +2 -2
- package/dist/cli/chunks/{chunk-SYQZPNHQ.js → chunk-T46HLTI3.js} +2 -2
- package/dist/cli/chunks/{chunk-BFSKBIAM.js → chunk-T5HPBBVB.js} +1 -1
- package/dist/cli/chunks/{chunk-5TTQNRAP.js → chunk-U7S7A7LB.js} +1 -1
- package/dist/cli/chunks/{chunk-EQ4IZRD5.js → chunk-UIKOUIGI.js} +2 -2
- package/dist/cli/chunks/{chunk-C77FS4ER.js → chunk-V7HMKS5S.js} +2 -2
- package/dist/cli/chunks/{chunk-EPCKRFMU.js → chunk-VNC7ANGV.js} +2 -2
- package/dist/cli/chunks/{chunk-QU7TNCUB.js → chunk-VRPZU5KM.js} +1 -1
- package/dist/cli/chunks/{chunk-A4U4DNPR.js → chunk-W5EOH4NH.js} +1 -1
- package/dist/cli/chunks/{chunk-4U57VG6R.js → chunk-WD5T5PE6.js} +2 -2
- package/dist/cli/chunks/{chunk-Y3YJMKXS.js → chunk-WGYJD6DT.js} +2 -2
- package/dist/cli/chunks/{chunk-TZ73IAF5.js → chunk-WHI7FVTH.js} +2 -2
- package/dist/cli/chunks/{chunk-2OFL5HSB.js → chunk-WLT5RGLK.js} +2 -2
- package/dist/cli/chunks/{chunk-22YZRYG4.js → chunk-WPN2NYZ3.js} +3 -3
- package/dist/cli/chunks/{chunk-MXZY5IJA.js → chunk-WVRFTL46.js} +1 -1
- package/dist/cli/chunks/{chunk-PS7YB3IV.js → chunk-X6HOSOIT.js} +3 -3
- package/dist/cli/chunks/{chunk-F77VZ4IY.js → chunk-XFDOE4QW.js} +2 -2
- package/dist/cli/chunks/{chunk-BOV44F3Z.js → chunk-XLFWSEZ4.js} +2 -2
- package/dist/cli/chunks/{chunk-XHENTAXI.js → chunk-XLY5LUNG.js} +2 -2
- package/dist/cli/chunks/{chunk-MSPY7HMF.js → chunk-XM3HKZ4U.js} +2 -2
- package/dist/cli/chunks/{chunk-CU5Q46NR.js → chunk-XS63BAQL.js} +4 -4
- package/dist/cli/chunks/{chunk-RLAXE5HU.js → chunk-YHROZCDI.js} +2 -2
- package/dist/cli/chunks/{chunk-EFAN5HUX.js → chunk-YLSLQ2DT.js} +2 -2
- package/dist/cli/chunks/{chunk-K64UL5PA.js → chunk-YYGYN4RJ.js} +2 -2
- package/dist/cli/chunks/{chunk-MTRA6I7Y.js → chunk-ZC5WKTB5.js} +1 -1
- package/dist/cli/chunks/chunk-ZGJTIDFI.js +2 -0
- package/dist/cli/chunks/{ci-EAX5WWT6.js → ci-TNCEZMBI.js} +2 -2
- package/dist/cli/chunks/{ci-output-JCWHRJ2A.js → ci-output-GXRUBE4X.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-RAEDVT33.js → circuit-breaker-UY3UVWZK.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-NJAY4WXY.js → claude-flow-setup-G4PJY2IE.js} +2 -2
- package/dist/cli/chunks/client-XZQV5LLD.js +2 -0
- package/dist/cli/chunks/{cline-installer-X3GCUEWC.js → cline-installer-VDCVZLLN.js} +2 -2
- package/dist/cli/chunks/{code-GXJ6JC6O.js → code-2COXCETT.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-TTA7HZEW.js → code-index-extractor-TBRSOYNZ.js} +2 -2
- package/dist/cli/chunks/{codex-installer-TXMSGJHK.js → codex-installer-CNUIJ7RF.js} +2 -2
- package/dist/cli/chunks/{completions-RSFIDY22.js → completions-42LTVU5S.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-C6244ZOI.js → complexity-analyzer-2ECJ3OPO.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-5WQIRQW4.js → continuedev-installer-FW2GFUG2.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-5Q64SC52.js → copilot-installer-QSV6WUBZ.js} +2 -2
- package/dist/cli/chunks/{cost-tracker-6SBRULNN.js → cost-tracker-CH3CSBR5.js} +2 -2
- package/dist/cli/chunks/{coverage-X2AG3K6E.js → coverage-XNF65ZHG.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-FTKMTQQC.js +2 -0
- package/dist/cli/chunks/{cursor-installer-VHZ5LEPG.js → cursor-installer-FP44QVKZ.js} +2 -2
- package/dist/cli/chunks/{daemon-CDQXWIV4.js → daemon-RCTFQOCN.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-33UWNTSB.js → dag-attention-scheduler-SRMUBFRY.js} +2 -2
- package/dist/cli/chunks/{detect-UDWTKRQL.js → detect-6N6E24MC.js} +2 -2
- package/dist/cli/chunks/{dist-node-CKTPNPBG.js → dist-node-T6UY6WUC.js} +2 -2
- package/dist/cli/chunks/{domain-handler-5J4AH4XR.js → domain-handler-67FVCSTC.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-P6VPN56R.js → domain-transfer-T6QVO7Q7.js} +2 -2
- package/dist/cli/chunks/dream-RB4NFA6Z.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-2YFFI7IN.js → embed-and-insert-pattern-ZGTGPFKX.js} +2 -2
- package/dist/cli/chunks/{eval-K7VFIO2T.js → eval-KBCCSN2V.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-P4RQW7JV.js → experience-capture-middleware-QH2I2HCM.js} +3 -3
- package/dist/cli/chunks/{fast-paths-T27YLQWQ.js → fast-paths-ZP3R5NWJ.js} +2 -2
- package/dist/cli/chunks/{feature-flags-YFPFETDZ.js → feature-flags-MGYWJNZ2.js} +2 -2
- package/dist/cli/chunks/{feature-flags-HHQNCU6V.js → feature-flags-TTPWNBQU.js} +2 -2
- package/dist/cli/chunks/{file-discovery-ZKNENDOJ.js → file-discovery-VUIFTAJQ.js} +2 -2
- package/dist/cli/chunks/{fleet-N5OTMFIN.js → fleet-RFCEBGRJ.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-D6L4FIWY.js → gnn-wrapper-JSEZQYAZ.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-5RDU3KKK.js → heartbeat-handler-ZRVNKBJK.js} +4 -4
- package/dist/cli/chunks/{heartbeat-scheduler-FALV24GQ.js → heartbeat-scheduler-ZQTLT3DW.js} +2 -2
- package/dist/cli/chunks/hnsw-adapter-ZKM2ITVF.js +2 -0
- package/dist/cli/chunks/hnsw-index-CFYACM4M.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-ARD7KA3G.js → hnsw-legacy-bridge-Y6MPTDAI.js} +2 -2
- package/dist/cli/chunks/{better-sqlite3-QIKWKEGD.js → hnswlib-node-X73LVNSE.js} +2 -2
- package/dist/cli/chunks/{hooks-6HA23JHQ.js → hooks-RIKFUPBG.js} +30 -30
- package/dist/cli/chunks/{hybrid-router-XUYQW7FJ.js → hybrid-router-B35QFYSN.js} +2 -2
- package/dist/cli/chunks/{hypergraph-engine-OGGXYQAO.js → hypergraph-engine-GABHICVB.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-UFV3XYVX.js → hypergraph-handler-NCMVBN4Q.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-DOLCGJKR.js +2 -0
- package/dist/cli/chunks/{init-handler-VUSXGONQ.js → init-handler-7ROPCNFB.js} +6 -6
- package/dist/cli/chunks/init-wizard-BMYBCQNH.js +2 -0
- package/dist/cli/chunks/kernel-FUWIWNAU.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-C2JMSYAU.js → kilocode-installer-JXHO4YK3.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-6LJFFEEZ.js → kiro-installer-7SUM4FLK.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-JFX7VTYG.js +2 -0
- package/dist/cli/chunks/{learning-4B624JV3.js → learning-74DAUWK5.js} +3 -3
- package/dist/cli/chunks/{llm-router-QUOLZECD.js → llm-router-LYQ3AJYV.js} +4 -4
- package/dist/cli/chunks/{load-MIQWBMGE.js → load-EKML5ERV.js} +2 -2
- package/dist/cli/chunks/load-test-5J6WURNM.js +2 -0
- package/dist/cli/chunks/{mcp-MBJWNXDM.js → mcp-XBL5K2W4.js} +2 -2
- package/dist/cli/chunks/{memory-WX3XHQZP.js → memory-FVYBB4DR.js} +5 -5
- package/dist/cli/chunks/memory-backend-SLFDDGZB.js +2 -0
- package/dist/cli/chunks/{memory-handlers-Q3XCN5SC.js → memory-handlers-LN7J33BW.js} +2 -2
- package/dist/cli/chunks/{multi-model-executor-RLY7OQOG.js → multi-model-executor-5LK2OUJ7.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-JATQNZWA.js → opencode-installer-FY7QUQ3U.js} +2 -2
- package/dist/cli/chunks/{orchestrator-7BNG32I2.js → orchestrator-UYVNXY2H.js} +5 -5
- package/dist/cli/chunks/{pipeline-ORKGL7DP.js → pipeline-ZALCCJ2O.js} +2 -2
- package/dist/cli/chunks/{platform-4SLJDRVL.js → platform-J2VZO4PZ.js} +2 -2
- package/dist/cli/chunks/{plugin-V6FRBF4W.js → plugin-2J74277Q.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-NA7AXKCA.js → prime-radiant-advanced-wasm-XUBMJ4Z5.js} +2 -2
- package/dist/cli/chunks/protocol-executor-3T2LU2YQ.js +2 -0
- package/dist/cli/chunks/{protocol-handler-RSJOZ4XL.js → protocol-handler-YGOAM45F.js} +2 -2
- package/dist/cli/chunks/{prove-2ZMKUODH.js → prove-7K3XVHHK.js} +2 -2
- package/dist/cli/chunks/{provider-manager-PSPAFCK7.js → provider-manager-S7GYXNYK.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-KPX2L7ZZ.js +2 -0
- package/dist/cli/chunks/{quality-6PZOOQSK.js → quality-7WK5BINE.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-G7ZZKP7M.js +2 -0
- package/dist/cli/chunks/{real-embeddings-BGNTSKHD.js → real-embeddings-SE7AMRSP.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-NOHRQJIP.js → roocode-installer-WAMTTOPL.js} +2 -2
- package/dist/cli/chunks/router-UNMP4QIG.js +2 -0
- package/dist/cli/chunks/routing-feedback-OG5NUKZD.js +2 -0
- package/dist/cli/chunks/{routing-handler-ZAOGNENU.js → routing-handler-PMHQRA32.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-5K3Q4N5H.js → ruvector-commands-GFL76O4H.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-NWFQC4KN.js → rvf-dual-writer-GWBC6LPL.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-MS7QGBWK.js → rvf-migration-adapter-CXIG3BWR.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-YUBSSB6Z.js → rvf-migration-coordinator-EOQMTSCT.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-EPXU4UUM.js +2 -0
- package/dist/cli/chunks/safe-db-BYZRI4XX.js +2 -0
- package/dist/cli/chunks/schedule-Z4ICJMF6.js +2 -0
- package/dist/cli/chunks/scheduler-T4IIRLST.js +2 -0
- package/dist/cli/chunks/{security-BJWJWQRB.js → security-TUU4SO7E.js} +3 -3
- package/dist/cli/chunks/shared-rvf-adapter-FDAQL677.js +2 -0
- package/dist/cli/chunks/{shared-rvf-dual-writer-LEBD3EHA.js → shared-rvf-dual-writer-REFYUOL6.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-SNTM6622.js +2 -0
- package/dist/cli/chunks/{status-handler-XANOAVIB.js → status-handler-V3FJKB72.js} +2 -2
- package/dist/cli/chunks/{structural-health-TZA7PJ2T.js → structural-health-YS2IIXLZ.js} +2 -2
- package/dist/cli/chunks/{sync-MKNYPUYP.js → sync-K5GEHWLO.js} +2 -2
- package/dist/cli/chunks/{task-handler-KXSUKNQV.js → task-handler-XPCZ2JHK.js} +2 -2
- package/dist/cli/chunks/{task-handlers-54MMRT3D.js → task-handlers-JTL52AMR.js} +3 -3
- package/dist/cli/chunks/{test-AKS5AAT7.js → test-5FJNVFGF.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-OA7UPWQ5.js → test-scheduling-JPL25DXR.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-ZIUNRF3E.js → token-bootstrap-QPFQ4UAT.js} +2 -2
- package/dist/cli/chunks/{token-usage-IJENSXPQ.js → token-usage-MVT2IZ5R.js} +2 -2
- package/dist/cli/chunks/{transformers-CACTFP7H.js → transformers-ZXK7QT3Z.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-4H4UVHAQ.js → tree-sitter-wasm-parser-VBZAQFTO.js} +2 -2
- package/dist/cli/chunks/{types-AGACOWV3.js → types-UQCZMHTU.js} +2 -2
- package/dist/cli/chunks/unified-memory-RL5XRRVQ.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-FMHZ5TCH.js +2 -0
- package/dist/cli/chunks/unified-persistence-GI5NFSWC.js +2 -0
- package/dist/cli/chunks/{upgrade-EKE25VPL.js → upgrade-TETHVGBS.js} +2 -2
- package/dist/cli/chunks/{validate-BZTYZQGP.js → validate-7YJTPQC7.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-GZANKJ7M.js → validate-swarm-QO32GODJ.js} +2 -2
- package/dist/cli/chunks/{vibium-5X7QY25W.js → vibium-HDRQBZAY.js} +2 -2
- package/dist/cli/chunks/visual-security-TARFNARP.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-KDFT6ZUY.js → web-tree-sitter-4QMH7RWP.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-QFZJISMO.js → windsurf-installer-HMBCR4V3.js} +2 -2
- package/dist/cli/chunks/{witness-chain-ESSANJ4X.js → witness-chain-2SYYDES4.js} +2 -2
- package/dist/cli/chunks/witness-chain-U36QGK2S.js +2 -0
- package/dist/cli/chunks/{workflow-EQFV2P66.js → workflow-CNFOBA7L.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-WILFC5ES.js +2 -0
- package/dist/cli/chunks/{wrappers-RKJJDJLC.js → wrappers-5KG5VXFG.js} +2 -2
- package/dist/cli/commands/hooks-handlers/hooks-shared.js +39 -6
- package/dist/kernel/kernel.d.ts +1 -0
- package/dist/kernel/kernel.js +21 -0
- package/dist/learning/pattern-promotion.d.ts +6 -0
- package/dist/learning/pattern-promotion.js +5 -0
- package/dist/learning/qe-reasoning-bank-types.d.ts +12 -3
- package/dist/learning/qe-reasoning-bank.d.ts +10 -3
- package/dist/learning/qe-reasoning-bank.js +28 -7
- package/dist/mcp/bundle.js +323 -318
- package/dist/optimization/index.d.ts +0 -2
- package/dist/optimization/index.js +0 -2
- package/dist/workers/workers/learning-consolidation.js +9 -3
- package/package.json +1 -1
- package/dist/cli/chunks/adapter-LIPKRUFH.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-XJGJ6YS7.js +0 -2
- package/dist/cli/chunks/base-22RFSMJU.js +0 -2
- package/dist/cli/chunks/browser-workflow-ST7DX7KA.js +0 -2
- package/dist/cli/chunks/chunk-RSNZQ3MN.js +0 -2
- package/dist/cli/chunks/client-6463JNJR.js +0 -2
- package/dist/cli/chunks/cross-domain-router-OYUCD42M.js +0 -2
- package/dist/cli/chunks/dream-R76KD347.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-CYWGI732.js +0 -2
- package/dist/cli/chunks/hnsw-index-UOYT3QKQ.js +0 -2
- package/dist/cli/chunks/impact-analyzer-PWV7CJUA.js +0 -2
- package/dist/cli/chunks/init-wizard-DKIFAPJJ.js +0 -2
- package/dist/cli/chunks/kernel-WQL2MUBH.js +0 -2
- package/dist/cli/chunks/knowledge-graph-U5OZDWGT.js +0 -2
- package/dist/cli/chunks/load-test-D2CQYRZQ.js +0 -2
- package/dist/cli/chunks/memory-backend-HFIGDCZE.js +0 -2
- package/dist/cli/chunks/protocol-executor-LTJIEFVG.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-ZJ56AWO2.js +0 -2
- package/dist/cli/chunks/queen-coordinator-CZA7SS4O.js +0 -2
- package/dist/cli/chunks/router-N23IDBEQ.js +0 -2
- package/dist/cli/chunks/routing-feedback-IADXJ4RV.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-MOR7NUA5.js +0 -2
- package/dist/cli/chunks/safe-db-IRAUFZTC.js +0 -2
- package/dist/cli/chunks/schedule-PKUUCNCA.js +0 -2
- package/dist/cli/chunks/scheduler-NE4NP4W5.js +0 -2
- package/dist/cli/chunks/shared-rvf-adapter-OTON2BMV.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-DXFBYN5L.js +0 -2
- package/dist/cli/chunks/unified-memory-4M3V7XL6.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-6IKIDXEW.js +0 -2
- package/dist/cli/chunks/unified-persistence-XJ4D23TB.js +0 -2
- package/dist/cli/chunks/visual-security-2X63QHFJ.js +0 -2
- package/dist/cli/chunks/witness-chain-MWIG363M.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-B3ECPAFI.js +0 -2
- package/dist/optimization/qe-workers.d.ts +0 -193
- package/dist/optimization/qe-workers.js +0 -692
|
@@ -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.9.
|
|
2
|
-
import{e as a}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.27");process.exit(0)}
|
|
2
|
+
import{e as a}from"./chunk-FQZM3SVW.js";import{b as w,d as y}from"./chunk-PIR3KN5M.js";import{a as f,c as P}from"./chunk-WHI7FVTH.js";import{randomUUID as v}from"crypto";import*as i from"fs";import*as n from"path";import*as c from"os";y();P();var k=".aqe",b="schedules.json",F="1.0.0",g=5e3,x=50,p=10*1024*1024,d=class{schedulesPath;debug;lockFile;initialized=!1;constructor(e={}){e.schedulesPath&&this.validateSchedulesPath(e.schedulesPath),this.schedulesPath=e.schedulesPath??this.getDefaultSchedulesPath(),this.lockFile=`${this.schedulesPath}.lock`,this.debug=e.debug??!1}validateSchedulesPath(e){let s=c.homedir(),t=n.resolve(e),r=n.resolve(s);if(t.startsWith(r+n.sep)||t===r)return;let l=process.cwd(),h=n.resolve(l);if(t.startsWith(h+n.sep)||t===h)return;let u=c.tmpdir(),S=n.resolve(u);if(!(t.startsWith(S+n.sep)||t===S))throw new Error(`Security: Custom schedulesPath must be within home directory (${s}), current working directory (${l}), or temp directory (${u}). Provided path: ${e}`)}getDefaultSchedulesPath(){let e=c.homedir();return n.join(e,k,b)}async initialize(){if(this.initialized)return;let e=n.dirname(this.schedulesPath);i.existsSync(e)||(i.mkdirSync(e,{recursive:!0}),this.log(`Created directory: ${e}`)),this.initialized=!0}async loadSchedules(){if(await this.initialize(),!i.existsSync(this.schedulesPath))return this.log("Schedules file does not exist, returning empty array"),[];try{let e=i.readFileSync(this.schedulesPath,"utf-8"),s=this.parseSchedulesFile(e);return this.log(`Loaded ${s.schedules.length} schedules`),s.schedules}catch(e){return await this.handleCorruptFile(e),[]}}async saveSchedule(e){await this.initialize(),await this.withFileLock(async()=>{let s=await this.loadSchedulesUnsafe(),t=s.findIndex(r=>r.id===e.id);t>=0?(s[t]=e,this.log(`Updated schedule: ${e.id}`)):(s.push(e),this.log(`Added schedule: ${e.id}`)),await this.writeSchedules(s)})}async removeSchedule(e){await this.initialize(),await this.withFileLock(async()=>{let s=await this.loadSchedulesUnsafe(),t=s.filter(r=>r.id!==e);if(t.length===s.length){this.log(`Schedule not found: ${e}`);return}await this.writeSchedules(t),this.log(`Removed schedule: ${e}`)})}async getSchedules(){return this.loadSchedules()}async getSchedule(e){return(await this.loadSchedules()).find(t=>t.id===e)}async getDueSchedules(){let e=await this.loadSchedules(),s=new Date;return e.filter(t=>t.enabled?new Date(t.nextRun)<=s:!1)}async markExecuted(e){await this.initialize(),await this.withFileLock(async()=>{let s=await this.loadSchedulesUnsafe(),t=s.find(l=>l.id===e);if(!t)throw new Error(`Schedule not found: ${e}`);let r=new Date;t.lastRun=r.toISOString(),t.nextRun=a(t.schedule,r).toISOString(),await this.writeSchedules(s),this.log(`Marked executed: ${e}, next run: ${t.nextRun}`)})}async setEnabled(e,s){await this.initialize(),await this.withFileLock(async()=>{let t=await this.loadSchedulesUnsafe(),r=t.find(l=>l.id===e);if(!r)throw new Error(`Schedule not found: ${e}`);r.enabled=s,s&&(r.nextRun=a(r.schedule,new Date).toISOString()),await this.writeSchedules(t),this.log(`Set enabled=${s}: ${e}`)})}async getEnabledSchedules(){return(await this.loadSchedules()).filter(s=>s.enabled)}async getSchedulesByWorkflow(e){return(await this.loadSchedules()).filter(t=>t.workflowId===e)}async clearAll(){await this.initialize(),await this.withFileLock(async()=>{await this.writeSchedules([]),this.log("Cleared all schedules")})}async getStats(){let e=await this.loadSchedules(),s=new Date;return{total:e.length,enabled:e.filter(t=>t.enabled).length,disabled:e.filter(t=>!t.enabled).length,due:e.filter(t=>t.enabled&&new Date(t.nextRun)<=s).length}}async loadSchedulesUnsafe(){if(!i.existsSync(this.schedulesPath))return[];try{let e=i.readFileSync(this.schedulesPath,"utf-8");return this.parseSchedulesFile(e).schedules}catch{return[]}}parseSchedulesFile(e){let s=Buffer.byteLength(e,"utf-8");if(s>p)throw new Error(`Schedules file exceeds maximum allowed size (${p/(1024*1024)}MB). File is ${(s/(1024*1024)).toFixed(2)}MB.`);let t=w(e);if(!t.schedules||!Array.isArray(t.schedules))throw new Error("Invalid schedules file: missing schedules array");for(let r of t.schedules)if(!r.id||!r.workflowId||!r.schedule)throw new Error("Invalid schedule entry: missing required fields");return t}async writeSchedules(e){let s={version:F,updatedAt:new Date().toISOString(),schedules:e},t=JSON.stringify(s,null,2);i.writeFileSync(this.schedulesPath,t,"utf-8"),this.log(`Wrote ${e.length} schedules to disk`)}async handleCorruptFile(e){let s=f(e);this.log(`Corrupt schedules file detected: ${s}`);let t=`${this.schedulesPath}.corrupt.${Date.now()}`;try{i.existsSync(this.schedulesPath)&&(i.copyFileSync(this.schedulesPath,t),this.log(`Backed up corrupt file to: ${t}`))}catch(r){this.log(`Failed to backup corrupt file: ${r}`)}try{i.existsSync(this.schedulesPath)&&(i.unlinkSync(this.schedulesPath),this.log("Removed corrupt schedules file"))}catch(r){this.log(`Failed to remove corrupt file: ${r}`)}}async withFileLock(e){await this.acquireLock();try{return await e()}finally{this.releaseLock()}}async acquireLock(){let e=Date.now();for(;i.existsSync(this.lockFile);){try{let s=i.statSync(this.lockFile);if(Date.now()-s.mtimeMs>g){i.unlinkSync(this.lockFile),this.log("Removed stale lock file");break}}catch{break}if(Date.now()-e>g)throw new Error("Timeout waiting for scheduler lock");await this.sleep(x)}try{i.writeFileSync(this.lockFile,`${process.pid}:${Date.now()}`,{flag:"wx"})}catch(s){if(s.code==="EEXIST")return this.acquireLock();throw s}}releaseLock(){try{i.existsSync(this.lockFile)&&i.unlinkSync(this.lockFile)}catch(e){console.debug("[PersistentScheduler] Lock release error:",e instanceof Error?e.message:e)}}sleep(e){return new Promise(s=>setTimeout(s,e))}log(e){this.debug&&console.log(`[PersistentScheduler] ${e}`)}};function E(o={}){return new d(o)}function m(){let o=Date.now().toString(36),e=v().slice(0,8);return`sched-${o}-${e}`}function $(o){let e=new Date;return{id:m(),workflowId:o.workflowId,pipelinePath:o.pipelinePath,schedule:o.schedule,scheduleDescription:o.scheduleDescription,nextRun:a(o.schedule,e).toISOString(),enabled:o.enabled??!0,createdAt:e.toISOString()}}export{d as a,E as b,m as c,$ 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.9.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.27");process.exit(0)}
|
|
2
2
|
var l=["ECONNREFUSED","ETIMEOUT","ENOMEM","ENOSPC"];var s={successRate:.1,failureRate:1,viabilityThreshold:.3,rehabilitationThreshold:10,maxQuarantineDurationMs:6048e5,domainOverrides:{"security-compliance":{successRate:.05,failureRate:1,viabilityThreshold:.5},"test-generation":{successRate:.15,failureRate:1,viabilityThreshold:.2},"quality-assessment":{successRate:.1,failureRate:1,viabilityThreshold:.4}}},a=class{config;_witnessChain=null;set witnessChain(e){this._witnessChain=e}constructor(e={}){this.config={...s,...e,domainOverrides:{...s.domainOverrides,...e.domainOverrides}}}computeConfidenceUpdate(e,r,i){let{successRate:u,failureRate:o}=this.getConfigForDomain(i),n=r==="success"?u:-o;if(r==="failure")try{this._witnessChain?.append("HEBBIAN_PENALTY",{previousConfidence:e,delta:n,domain:i},"asymmetric-learning")}catch{}return c(e+n,0,1)}shouldQuarantine(e,r){let{viabilityThreshold:i}=this.getConfigForDomain(r);return{shouldQuarantine:e<i,confidence:e,viabilityThreshold:i,domain:r}}classifyFailure(e){if(e.infrastructureHealthy===!1||e.durationMs!==void 0&&e.durationMs>3e4)return"infrastructure";if(e.errorMessage){let r=e.errorMessage.toUpperCase();for(let i of l)if(r.includes(i))return"infrastructure"}return e.failureCategory==="infrastructure"?"infrastructure":(e.failureCategory==="pattern","pattern")}checkRehabilitation(e,r){let i=this.config.rehabilitationThreshold;return{canRehabilitate:e>=i,consecutiveSuccesses:e,requiredSuccesses:i,domain:r}}getConfigForDomain(e){return e&&this.config.domainOverrides?.[e]?this.config.domainOverrides[e]:{successRate:this.config.successRate,failureRate:this.config.failureRate,viabilityThreshold:this.config.viabilityThreshold}}getAsymmetryRatio(e){let{successRate:r,failureRate:i}=this.getConfigForDomain(e);return r===0?1/0:i/r}};function c(t,e,r){return t<e?e:t>r?r:t}export{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.9.
|
|
2
|
-
import{a as te,b as ne}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.9.27");process.exit(0)}
|
|
2
|
+
import{a as te,b as ne}from"./chunk-KFDY5AD7.js";import{a as k}from"./chunk-WVRFTL46.js";import{b as ee}from"./chunk-LXGVB3FK.js";import{b as E,d as fe}from"./chunk-PIR3KN5M.js";import{a as b,c as T}from"./chunk-WHI7FVTH.js";var he={M:16,efConstruction:200,efSearch:100},P={enabled:!0,pretrainedPatterns:!0,hnswConfig:he,promotionThreshold:3,qualityThreshold:.7,embeddingModel:"auto"},_={mode:"hybrid",confidenceThreshold:.7,feedbackEnabled:!0,cacheEnabled:!0,cacheTTLMs:300*1e3},F={enabled:["pattern-consolidator","coverage-gap-scanner","flaky-test-detector","routing-accuracy-monitor"],intervals:{"pattern-consolidator":1800*1e3,"coverage-gap-scanner":3600*1e3,"flaky-test-detector":7200*1e3,"routing-accuracy-monitor":900*1e3},maxConcurrent:4,daemonAutoStart:!0},N={claudeCode:!0,preCommit:!1,ciIntegration:!1},$={install:!0,installV2:!0,installV3:!0,overwrite:!1},O={enabled:!0,parameters:["hnsw.efSearch","routing.confidenceThreshold","pattern.promotionThreshold","testGen.complexityLimit"],tuningIntervalMs:10080*60*1e3,evaluationPeriodMs:5e3};var L=["test-generation","test-execution","coverage-analysis","quality-assessment","defect-intelligence","requirements-validation","code-intelligence","security-compliance","contract-testing","visual-accessibility","chaos-resilience","learning-optimization","enterprise-integration"];function M(){return"3.9.27"}function Fe(i,e){return{version:M(),project:{name:i,root:e,type:"single"},learning:P,routing:_,workers:F,hooks:N,skills:$,autoTuning:O,domains:{enabled:L,disabled:[]},agents:{maxConcurrent:15,defaultTimeout:6e4}}}fe();import{readFileSync as w,existsSync as p,statSync as ye,readdirSync as ve}from"fs";import{join as u,basename as ie,extname as re,relative as V}from"path";var be=[{name:"jest",detect:i=>{let e=["jest.config.js","jest.config.ts","jest.config.mjs","jest.config.cjs"];for(let n of e)if(p(u(i,n)))return{name:"jest",version:A(i,"jest"),configFile:n,confidence:1};let t=S(i);return t?.jest?{name:"jest",version:A(i,"jest"),configFile:"package.json",confidence:.9}:t?.devDependencies?.jest||t?.dependencies?.jest?{name:"jest",version:t.devDependencies?.jest||t.dependencies?.jest,confidence:.7}:null}},{name:"vitest",detect:i=>{let e=["vitest.config.ts","vitest.config.js","vitest.config.mts","vite.config.ts"];for(let n of e)if(p(u(i,n)))return{name:"vitest",version:A(i,"vitest"),configFile:n,confidence:1};let t=S(i);return t?.devDependencies?.vitest||t?.dependencies?.vitest?{name:"vitest",version:t.devDependencies?.vitest,confidence:.8}:null}},{name:"mocha",detect:i=>{let e=[".mocharc.js",".mocharc.json",".mocharc.yaml",".mocharc.yml"];for(let n of e)if(p(u(i,n)))return{name:"mocha",version:A(i,"mocha"),configFile:n,confidence:1};let t=S(i);return t?.devDependencies?.mocha?{name:"mocha",version:t.devDependencies?.mocha,confidence:.8}:null}},{name:"pytest",detect:i=>{let e=["pytest.ini","pyproject.toml","setup.cfg"];for(let n of e){let r=u(i,n);if(p(r))try{let s=w(r,"utf-8");if(s.includes("[pytest]")||s.includes("[tool.pytest]"))return{name:"pytest",configFile:n,confidence:1}}catch(s){console.debug("[ProjectAnalyzer] Config read failed:",s instanceof Error?s.message:s)}}let t=u(i,"requirements.txt");if(p(t))try{if(w(t,"utf-8").includes("pytest"))return{name:"pytest",configFile:"requirements.txt",confidence:.8}}catch(n){console.debug("[ProjectAnalyzer] requirements.txt read failed:",n instanceof Error?n.message:n)}return null}},{name:"playwright",detect:i=>{let e=["playwright.config.ts","playwright.config.js"];for(let n of e)if(p(u(i,n)))return{name:"playwright",version:A(i,"@playwright/test"),configFile:n,confidence:1};let t=S(i);return t?.devDependencies?.["@playwright/test"]?{name:"playwright",version:t.devDependencies["@playwright/test"],confidence:.8}:null}},{name:"cypress",detect:i=>{let e=["cypress.config.ts","cypress.config.js","cypress.json"];for(let t of e)if(p(u(i,t)))return{name:"cypress",version:A(i,"cypress"),configFile:t,confidence:1};return p(u(i,"cypress"))?{name:"cypress",configFile:"cypress/",confidence:.9}:null}}],ke=[{name:"typescript",extensions:[".ts",".tsx",".mts",".cts"]},{name:"javascript",extensions:[".js",".jsx",".mjs",".cjs"]},{name:"python",extensions:[".py",".pyw"]},{name:"java",extensions:[".java"]},{name:"go",extensions:[".go"]},{name:"rust",extensions:[".rs"]},{name:"csharp",extensions:[".cs"]},{name:"ruby",extensions:[".rb"]},{name:"php",extensions:[".php"]},{name:"kotlin",extensions:[".kt",".kts"]},{name:"swift",extensions:[".swift"]}];function S(i){let e=u(i,"package.json");if(!p(e))return null;try{return E(w(e,"utf-8"))}catch{return null}}function A(i,e){let t=S(i);if(t)return t.devDependencies?.[e]||t.dependencies?.[e]}function Q(i,e,t={}){let{maxDepth:n=10,exclude:r=["node_modules",".git","dist","build","coverage",".next","__pycache__"]}=t;function s(o,a){if(a>n)return;let l;try{l=ve(o)}catch{return}for(let g of l){if(r.includes(g))continue;let c=u(o,g),x;try{x=ye(c)}catch{continue}x.isDirectory()?s(c,a+1):x.isFile()&&e(c)}}s(i,0)}var W=class{projectRoot;constructor(e){this.projectRoot=e}async analyze(){let e=Date.now(),[t,n,r,s,o]=await Promise.all([this.detectFrameworks(),this.detectLanguages(),this.detectExistingTests(),this.analyzeComplexity(),this.measureCoverage()]);return{projectName:S(this.projectRoot)?.name||ie(this.projectRoot),projectRoot:this.projectRoot,projectType:this.detectProjectType(),frameworks:t,languages:n,existingTests:r,codeComplexity:s,coverage:o,packageManager:this.detectPackageManager(),hasTypeScript:p(u(this.projectRoot,"tsconfig.json")),hasCIConfig:this.detectCIConfig(),ciProvider:this.detectCIProvider(),analysisTimestamp:new Date,analysisDurationMs:Date.now()-e}}async detectFrameworks(){let e=[];for(let t of be){let n=t.detect(this.projectRoot);n&&e.push(n)}return e.sort((t,n)=>n.confidence-t.confidence)}async detectLanguages(){let e=new Map,t=0;Q(this.projectRoot,r=>{let s=re(r).toLowerCase();if(s){for(let o of ke)if(o.extensions.includes(s)){let a=e.get(o.name)||{count:0,extensions:new Set};a.count++,a.extensions.add(s),e.set(o.name,a),t++;break}}});let n=[];for(let[r,s]of e)n.push({name:r,percentage:t>0?Math.round(s.count/t*100):0,fileCount:s.count,extensions:Array.from(s.extensions)});return n.sort((r,s)=>s.fileCount-r.fileCount)}async detectExistingTests(){let e={totalCount:0,byFramework:{},byType:{unit:0,integration:0,e2e:0,unknown:0},directories:[]},t=new Set,n=[/\.test\.[jt]sx?$/,/\.spec\.[jt]sx?$/,/_test\.[jt]sx?$/,/test_.*\.py$/,/.*_test\.py$/,/.*_test\.go$/,/.*Test\.java$/];return Q(this.projectRoot,r=>{let s=ie(r);if(n.some(a=>a.test(s))){e.totalCount++;let a=V(this.projectRoot,r).toLowerCase();a.includes("e2e")||a.includes("cypress")||a.includes("playwright")?e.byType.e2e++:a.includes("integration")||a.includes("int-test")?e.byType.integration++:a.includes("unit")||a.includes("__tests__")||a.includes("test/")?e.byType.unit++:e.byType.unknown++;let l=V(this.projectRoot,u(r,".."));t.add(l)}}),e.directories=Array.from(t).slice(0,10),e}async analyzeComplexity(){let e=[],t=[],n=0,r=0;Q(this.projectRoot,a=>{let l=re(a);if([".ts",".tsx",".js",".jsx",".py",".java",".go"].includes(l))try{let g=w(a,"utf-8"),c=this.calculateFileComplexity(g,l);t.push(...c.functionComplexities),c.maxComplexity>n&&(n=c.maxComplexity),r++,c.maxComplexity>10&&e.push(V(this.projectRoot,a))}catch(g){console.debug("[ProjectAnalyzer] Complexity analysis read failed:",g instanceof Error?g.message:g)}});let s=t.reduce((a,l)=>a+l,0),o=t.length>0?s/t.length:0;return{averageCyclomatic:Math.round(o*10)/10,maxCyclomatic:n,totalFiles:r,complexFiles:e.slice(0,20),recommendation:o<5?"simple":o<15?"medium":"complex"}}calculateFileComplexity(e,t){let n=this.stripCommentsAndStrings(e,t),r=this.calculateComplexity(n);return{functionComplexities:[r],maxComplexity:r}}removeDelimitedBlocks(e,t,n){let r="",s=0;for(;s<e.length;){let o=e.indexOf(t,s);if(o===-1){r+=e.slice(s);break}r+=e.slice(s,o);let a=e.indexOf(n,o+t.length);if(a===-1)break;s=a+n.length}return r}stripCommentsAndStrings(e,t){let n=e;return[".ts",".tsx",".js",".jsx",".java",".go"].includes(t)?(n=n.split(`
|
|
3
3
|
`).map(r=>{let s=r.indexOf("//");return s>=0?r.slice(0,s):r}).join(`
|
|
4
4
|
`),n=this.removeDelimitedBlocks(n,"/*","*/"),n=this.removeDelimitedBlocks(n,"`","`"),n=this.removeDelimitedBlocks(n,'"','"'),n=this.removeDelimitedBlocks(n,"'","'")):t===".py"&&(n=n.split(`
|
|
5
5
|
`).map(r=>{let s=r.indexOf("#");return s>=0?r.slice(0,s):r}).join(`
|
|
@@ -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.9.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.27");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,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.9.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.27");process.exit(0)}
|
|
2
2
|
var s=["qe-pentest-validator","qe-security-auditor","qe-security-scanner","qe-security-reviewer"],c="anthropic/claude-sonnet-4.6",u="claude-sonnet-4-6";function o(n){return n.includes("claude-opus-4-7")||n.includes("claude-opus-4.7")}function i(n,e=process.env){return e.AQE_CYBER_VERIFIED==="true"?!1:s.includes(n)}function a(n,e,r,t=process.env){return!i(n,t)||!o(e)?e:r}export{c as a,u as b,o as c,i as d,a 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.9.
|
|
2
|
-
import{c as t,e as o}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.9.27");process.exit(0)}
|
|
2
|
+
import{c as t,e as o}from"./chunk-CNWWQYZ3.js";var L={};o(L,{DotProductAttention:()=>d,FlashAttention:()=>u,HyperbolicAttention:()=>f,LinearAttention:()=>h,MoEAttention:()=>_,MultiHeadAttention:()=>A,RuvectorLayer:()=>a,SonaEngine:()=>b,TensorCompress:()=>c,default:()=>n,differentiableSearch:()=>l,getCompressionLevel:()=>p,hierarchicalForward:()=>s,init:()=>m,pipeline:()=>q});import{createRequire as r}from"module";var i,e,n,a,c,l,s,p,m,u,d,A,f,h,_,b,q,g=t(()=>{i=r(import.meta.url),e=i("better-sqlite3"),n=e,{RuvectorLayer:a,TensorCompress:c,differentiableSearch:l,hierarchicalForward:s,getCompressionLevel:p,init:m,FlashAttention:u,DotProductAttention:d,MultiHeadAttention:A,HyperbolicAttention:f,LinearAttention:h,MoEAttention:_,SonaEngine:b,pipeline:q}=e||{}});export{n as a,a as b,c,l as d,s as e,p as f,m as g,u as h,d as i,A as j,f as k,h as l,_ as m,b as n,q as o,L as p,g as q};
|
|
@@ -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.9.
|
|
2
|
-
import{a as S}from"./chunk-RSNZQ3MN.js";import{c as g}from"./chunk-F77VZ4IY.js";import{S as T,b as l}from"./chunk-RXQX6JNQ.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},y=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)}},v=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 y,this.plateauDetector=new v,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{p as a,h as b,V as c,y as d,v 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.9.27");process.exit(0)}
|
|
2
|
+
import{a as S}from"./chunk-ZGJTIDFI.js";import{c as g}from"./chunk-XFDOE4QW.js";import{S as T,b as l}from"./chunk-2MO2U3NO.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},y=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)}},v=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 y,this.plateauDetector=new v,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{p as a,h as b,V as c,y as d,v as e,D as f,C as g,P as h,J as i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.27");process.exit(0)}
|
|
2
2
|
var s={"test-generation":/test|spec|describe|it\(|expect|assert|mock|stub|fixture|tdd|bdd/i,"test-execution":/run|execute|parallel|retry|flaky|timeout|worker|orchestrat/i,"coverage-analysis":/coverage|branch|line|uncovered|gap|untested|percentage|sublinear/i,"quality-assessment":/quality|gate|deploy|readiness|metric|threshold|sla|score/i,"defect-intelligence":/defect|bug|predict|root.?cause|regression|failure|incident/i,"requirements-validation":/requirement|bdd|gherkin|testabil|accept|criteri|scenario/i,"code-intelligence":/semantic|knowledge|graph|ast|symbol|reference|impact|depend/i,"security-compliance":/vuln|cve|owasp|xss|sqli|injection|csrf|auth|secret|compliance|sast|dast/i,"contract-testing":/contract|pact|openapi|swagger|graphql|schema|endpoint|api/i,"visual-accessibility":/screenshot|visual|snapshot|pixel|percy|a11y|aria|wcag|screen.?reader|accessible|contrast/i,"chaos-resilience":/chaos|resilience|fault|inject|blast|recover|latency|failure|stress|load/i,"learning-optimization":/learn|pattern|optim|neural|embedding|vector|memory|adapt|train/i};function l(e){for(let[t,a]of Object.entries(s))if(a.test(e))return t;return null}function m(e){let t=[];for(let[a,n]of Object.entries(s))n.test(e)&&t.push(a);return t}function u(e){return e}function d(e){let t=Math.min(e.usageCount/100,1);return e.confidence*.3+t*.2+e.successRate*.5}var c=3;function p(e,t,a=.4){let n=e.tier==="short-term"&&e.successfulUses>=c,r=e.successRate>=.7&&e.confidence>=.6,i=t===void 0||t<a,o;return n?r?i||(o="coherence_violation"):o="low_quality":o="insufficient_usage",{meetsUsageCriteria:n,meetsQualityCriteria:r,meetsCoherenceCriteria:i,blockReason:o}}function y(e){let t=[];if(e.id||t.push("Pattern ID is required"),e.patternType||t.push("Pattern type is required"),e.qeDomain||t.push("QE domain is required"),e.name||t.push("Pattern name is required"),e.template?.content||t.push("Template content is required"),e.confidence!==void 0&&(e.confidence<0||e.confidence>1)&&t.push("Confidence must be between 0 and 1"),e.successRate!==void 0&&(e.successRate<0||e.successRate>1)&&t.push("Success rate must be between 0 and 1"),e.template?.variables){let a=new Set;for(let n of e.template.variables)a.has(n.name)&&t.push(`Duplicate variable name: ${n.name}`),a.add(n.name),e.template.content.includes(`{{${n.name}}}`)||t.push(`Variable ${n.name} not referenced in template`)}return{valid:t.length===0,errors:t}}function f(e,t){let a=e.content;for(let n of e.variables){let r=t[n.name]??n.defaultValue;if(n.required&&r===void 0)throw new Error(`Required variable ${n.name} not provided`);if(r!==void 0){let i=`{{${n.name}}}`,o=typeof r=="object"?JSON.stringify(r):String(r);a=a.split(i).join(o)}}return a}var g=Object.keys(s);export{l as a,m as b,u as c,d,c as e,p as f,y as g,f as h,g as i};
|
|
@@ -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.9.
|
|
2
|
-
import{a as V}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.9.27");process.exit(0)}
|
|
2
|
+
import{a as V}from"./chunk-PMP6QRTB.js";import{a as k,b as q,c as W,d as C}from"./chunk-W5EOH4NH.js";import{b as x,f as z,i as j}from"./chunk-RPDLRKAT.js";import{d as G}from"./chunk-6BIHLI3A.js";import{g as P}from"./chunk-HV7V34DZ.js";import{a as M}from"./chunk-ZGJTIDFI.js";import{c as E}from"./chunk-XFDOE4QW.js";import{b as T,c as S}from"./chunk-MSA7UH3M.js";import{a as f,b as L,c as F}from"./chunk-WHI7FVTH.js";import{S as Y,b as B}from"./chunk-2MO2U3NO.js";M();F();var D={enableLearning:!0,enableGuidance:!0,enableRouting:!0,embeddingDimension:384,useONNXEmbeddings:!0,maxRoutingCandidates:10,routingWeights:{similarity:.3,performance:.4,capabilities:.3},coherenceThreshold:.4};var w=[{patternType:"test-template",name:"AAA Unit Test",description:"Arrange-Act-Assert pattern for clear, maintainable unit tests",template:{type:"code",content:`describe('{{className}}', () => {
|
|
3
3
|
describe('{{methodName}}', () => {
|
|
4
4
|
it('should {{expectedBehavior}}', {{async}} () => {
|
|
5
5
|
// Arrange
|
|
@@ -278,7 +278,7 @@ On promotion:
|
|
|
278
278
|
- Move from short-term to long-term tier
|
|
279
279
|
- Boost confidence by 10%
|
|
280
280
|
- Enable for cross-domain transfer to related domains
|
|
281
|
-
- Mark as reusable for token savings optimization`,variables:[{name:"patternName",type:"string",required:!0,description:"Pattern to evaluate for promotion"}]},context:{tags:["promotion","learning","quality","pipeline"]},confidence:.6}];var
|
|
281
|
+
- Mark as reusable for token savings optimization`,variables:[{name:"patternName",type:"string",required:!0,description:"Pattern to evaluate for promotion"}]},context:{tags:["promotion","learning","quality","pipeline"]},confidence:.6}];var R={"qe-test-generator":{domains:["test-generation"],capabilities:["test-generation","tdd","bdd","unit-test","integration-test"],performanceScore:.85,languages:["typescript","javascript","python","java","csharp","go","rust","swift","kotlin","dart"]},"qe-coverage-analyzer":{domains:["coverage-analysis"],capabilities:["coverage-analysis","gap-detection","risk-scoring"],performanceScore:.92,languages:["typescript","javascript","python","java","csharp","go","rust","swift","kotlin","dart"]},"qe-coverage-specialist":{domains:["coverage-analysis"],capabilities:["sublinear-analysis","branch-coverage","mutation-testing"],performanceScore:.88,languages:["typescript","javascript"]},"qe-test-architect":{domains:["test-generation","coverage-analysis"],capabilities:["test-strategy","test-pyramid","architecture"],performanceScore:.9,languages:["typescript","javascript","python","java","csharp","go","rust","swift","kotlin","dart"]},"qe-api-contract-validator":{domains:["contract-testing"],capabilities:["contract-testing","openapi","graphql","pact"],performanceScore:.87},"qe-security-auditor":{domains:["security-compliance"],capabilities:["sast","dast","vulnerability","owasp"],performanceScore:.82},"qe-visual-tester":{domains:["visual-accessibility"],capabilities:["screenshot","visual-regression","percy","chromatic"],performanceScore:.8},"qe-a11y-ally":{domains:["visual-accessibility"],capabilities:["wcag","aria","screen-reader","contrast"],performanceScore:.85},"qe-performance-tester":{domains:["chaos-resilience"],capabilities:["load-testing","stress-testing","k6","artillery"],performanceScore:.83},"qe-flaky-investigator":{domains:["test-execution"],capabilities:["flaky-detection","test-stability","retry"],performanceScore:.78},"qe-chaos-engineer":{domains:["chaos-resilience"],capabilities:["chaos-testing","resilience","fault-injection"],performanceScore:.75}};function I(a,e,r,t,i=R,s){let o=[];for(let[n,c]of Object.entries(i)){let p=0,l=[],g=a.filter(m=>c.domains.includes(m)).length,d=g>0?g/a.length*.4:0;if(p+=d*t.similarity,d>0&&l.push(`Domain match: ${(d*100).toFixed(0)}%`),e&&e.length>0){let m=e.filter(A=>c.capabilities.some(v=>v.toLowerCase().includes(A.toLowerCase()))).length,y=m>0?m/e.length*.3:0;p+=y*t.capabilities,y>0&&l.push(`Capability match: ${(y*100).toFixed(0)}%`)}else p+=.15*t.capabilities;if(p+=c.performanceScore*.3*t.performance,l.push(`Performance score: ${(c.performanceScore*100).toFixed(0)}%`),s&&c.languages&&c.languages.length>0){let m=t.language??1,y=s.toLowerCase();if(c.languages.some(v=>v.toLowerCase()===y)){let v=.15*m;p+=v,l.push(`Language match: ${s}`)}}let h=r.get(n)||0;if(h>0){let m=Math.min(.1,h*.02);p+=m,l.push(`Pattern matches: ${h}`)}o.push({agent:n,score:p,reasoning:l})}return o.sort((n,c)=>c.score-n.score),o}var _={"test-generation":["test-execution","coverage-analysis","requirements-validation"],"test-execution":["test-generation","coverage-analysis","quality-assessment"],"coverage-analysis":["test-generation","test-execution","quality-assessment"],"quality-assessment":["test-execution","coverage-analysis","defect-intelligence"],"defect-intelligence":["quality-assessment","code-intelligence"],"requirements-validation":["test-generation","quality-assessment"],"code-intelligence":["defect-intelligence","security-compliance"],"security-compliance":["code-intelligence","quality-assessment"],"contract-testing":["test-generation","test-execution"],"visual-accessibility":["quality-assessment"],"chaos-resilience":["test-execution","quality-assessment"],"learning-optimization":["test-generation","test-execution","coverage-analysis","quality-assessment","defect-intelligence"]};function U(a,e){if(a.length===e)return a;if(a.length>e){let r=a.length/e,t=new Array(e).fill(0);for(let i=0;i<e;i++){let s=Math.floor(i*r),o=Math.floor((i+1)*r),n=0;for(let c=s;c<o;c++)n+=a[c];t[i]=n/(o-s)}return N(t)}else{let r=new Array(e).fill(0),t=(a.length-1)/(e-1);for(let i=0;i<e;i++){let s=i*t,o=Math.floor(s),n=Math.min(o+1,a.length-1),c=s-o;r[i]=a[o]*(1-c)+a[n]*c}return N(r)}}function $(a,e){let r=new Array(e).fill(0),t=a.toLowerCase().trim();for(let i=0;i<3;i++)for(let s=0;s<t.length;s++){let o=t.charCodeAt(s),n=o*(s+1)*(i+1)%e;r[n]+=Math.sin(o*(i+1))/(s+1)}return N(r)}function N(a){let e=Math.sqrt(a.reduce((r,t)=>r+t*t,0));if(e>0)for(let r=0;r<a.length;r++)a[r]/=e;return a}M();F();Y();var b=E.create("PatternPromotion");async function X(a,e){let r=z(a);if(!r.meetsUsageCriteria||!r.meetsQualityCriteria)return!1;if(e.coherenceService&&e.coherenceService.isInitialized()){let t=await e.searchPatterns("",{tier:"long-term",limit:1e3}),o=[...t.success?t.value.map(c=>c.pattern):[],a].map(c=>({id:c.id,embedding:c.embedding||[],weight:c.confidence,metadata:{name:c.name,domain:c.qeDomain}})),n=await e.coherenceService.checkCoherence(o);if(n.energy>=e.coherenceThreshold){let c={patternId:a.id,patternName:a.name,reason:"coherence_violation",energy:n.energy,existingPatternConflicts:n.contradictions?.map(p=>p.nodeIds).flat()};return e.eventBus&&await e.eventBus.publish({id:`pattern-promotion-blocked-${a.id}`,type:"pattern:promotion_blocked",timestamp:new Date,source:"learning-optimization",payload:c}),b.info("Pattern promotion blocked due to coherence violation",{name:a.name,energy:n.energy}),!1}}return!0}async function H(a,e){let r=await e.patternStore.promote(a);if(r.success){try{e.getSqliteStore().promotePattern(a)}catch(t){b.warn("SQLite pattern promotion persist failed",{error:f(t)})}if(B().useSublinearSolver)try{let t=e.getSqliteStore().getDatabase?.();if(t){let i=new Q(t),s=await e.getPattern(a);if(s){let o=await e.searchPatterns("",{domain:s.qeDomain,tier:"long-term",limit:20});if(o.success)for(let{pattern:n}of o.value)n.id!==a&&i.recordCoOccurrence(a,n.id)}}}catch(t){b.warn("Citation graph update failed (non-fatal)",{error:f(t)})}if(e.rvfDualWriter)try{let t=await e.getPattern(a);t?.embedding&&t.embedding.length>0&&e.rvfDualWriter.writePattern(a,t.embedding)}catch(t){b.warn("RVF dual-write on promote failed (non-fatal)",{patternId:a,error:f(t)})}P().then(t=>t.append("PATTERN_PROMOTE",{patternId:a},"reasoning-bank")).catch(t=>{b.warn("Witness chain PATTERN_PROMOTE failed",{error:f(t)})}),b.info("Promoted pattern to long-term",{patternId:a}),e.eventBus&&await e.eventBus.publish({id:`pattern-promoted-${a}`,type:"pattern:promoted",timestamp:new Date,source:"learning-optimization",payload:{patternId:a,newTier:"long-term"}})}else b.error("Failed to promote pattern",r.error,{patternId:a})}async function K(a){let{signal:e}=a;e?.throwIfAborted();let r=await a.patternStore.getStats(),t=0,i=0;for(let[s,o]of Object.entries(_)){e?.throwIfAborted();let n=s,c=r.byDomain[n]||0;if(c===0)continue;let p=await a.searchPatterns("",{domain:n,limit:50});if(p.success)for(let l of o){if(e?.throwIfAborted(),(r.byDomain[l]||0)>=c){i++;continue}for(let{pattern:d}of p.value){e?.throwIfAborted();let h=await a.searchPatterns(d.name,{domain:l,limit:1});if(h.success&&h.value.length>0&&h.value[0].score>.8){i++;continue}let m=Math.max(.3,(d.confidence||.5)*.8);(await a.storePattern({patternType:d.patternType,qeDomain:l,name:`${d.name} (from ${n})`,description:`${d.description} [Transferred from ${n} domain]`,template:d.template,context:{...d.context,relatedDomains:[n,l],tags:[...d.context.tags,"cross-domain-transfer",`source:${n}`]},confidence:m})).success?t++:i++}}}return b.info("Cross-domain transfer complete",{transferred:t,skipped:i}),{transferred:t,skipped:i}}var J=`
|
|
282
282
|
CREATE TABLE IF NOT EXISTS pattern_citations (
|
|
283
283
|
source_pattern_id TEXT NOT NULL,
|
|
284
284
|
target_pattern_id TEXT NOT NULL,
|
|
@@ -289,26 +289,26 @@ On promotion:
|
|
|
289
289
|
);
|
|
290
290
|
CREATE INDEX IF NOT EXISTS idx_citations_source ON pattern_citations(source_pattern_id);
|
|
291
291
|
CREATE INDEX IF NOT EXISTS idx_citations_target ON pattern_citations(target_pattern_id);
|
|
292
|
-
`,
|
|
292
|
+
`,Q=class{constructor(e){this.db=e}db;initialized=!1;ensureSchema(){this.initialized||(this.db.exec(J),this.initialized=!0)}recordCoOccurrence(e,r){this.ensureSchema();let[t,i]=e<r?[e,r]:[r,e];this.db.prepare(`
|
|
293
293
|
INSERT INTO pattern_citations (source_pattern_id, target_pattern_id, weight, relationship)
|
|
294
294
|
VALUES (?, ?, 1.0, 'co-occurrence')
|
|
295
295
|
ON CONFLICT(source_pattern_id, target_pattern_id)
|
|
296
296
|
DO UPDATE SET weight = weight + 1.0
|
|
297
|
-
`).run(t,
|
|
297
|
+
`).run(t,i)}recordDerivation(e,r){this.ensureSchema(),this.db.prepare(`
|
|
298
298
|
INSERT INTO pattern_citations (source_pattern_id, target_pattern_id, weight, relationship)
|
|
299
299
|
VALUES (?, ?, 2.0, 'derivation')
|
|
300
300
|
ON CONFLICT(source_pattern_id, target_pattern_id)
|
|
301
301
|
DO UPDATE SET weight = MAX(weight, 2.0), relationship = 'derivation'
|
|
302
|
-
`).run(e,r)}buildGraph(){this.ensureSchema();let e=this.db.prepare("SELECT source_pattern_id, target_pattern_id, weight, relationship FROM pattern_citations").all(),r=new Set;for(let
|
|
302
|
+
`).run(e,r)}buildGraph(){this.ensureSchema();let e=this.db.prepare("SELECT source_pattern_id, target_pattern_id, weight, relationship FROM pattern_citations").all(),r=new Set;for(let o of e)r.add(o.source_pattern_id),r.add(o.target_pattern_id);let t=Array.from(r),i=new Map;t.forEach((o,n)=>i.set(o,n));let s=[];for(let o of e){let n=i.get(o.source_pattern_id),c=i.get(o.target_pattern_id);s.push([n,c,o.weight]),o.relationship==="co-occurrence"&&s.push([c,n,o.weight])}return{nodes:t,edges:s}}bootstrapFromExistingData(){this.ensureSchema();let e=0,r=this.db.prepare(`
|
|
303
303
|
SELECT id, qe_domain FROM qe_patterns WHERE qe_domain IS NOT NULL ORDER BY qe_domain
|
|
304
|
-
`).all(),t=new Map;for(let
|
|
304
|
+
`).all(),t=new Map;for(let p of r){let l=t.get(p.qe_domain)??[];l.push(p.id),t.set(p.qe_domain,l)}let i=this.db.prepare(`
|
|
305
305
|
INSERT OR IGNORE INTO pattern_citations (source_pattern_id, target_pattern_id, weight, relationship)
|
|
306
306
|
VALUES (?, ?, 1.0, 'co-occurrence')
|
|
307
|
-
`),
|
|
307
|
+
`),s=this.db.transaction(p=>{for(let[l,g]of p)i.run(l,g).changes>0&&e++}),o=[];for(let[,p]of t){let l=p.slice(0,50);for(let g=0;g<l.length;g++)for(let d=g+1;d<l.length;d++){let[h,m]=l[g]<l[d]?[l[g],l[d]]:[l[d],l[g]];o.push([h,m])}}s(o);let n=this.db.prepare(`
|
|
308
308
|
SELECT source_pattern_id, target_pattern_id, relationship_type
|
|
309
309
|
FROM pattern_relationships
|
|
310
310
|
WHERE relationship_type IN ('merged', 'derived', 'superseded')
|
|
311
311
|
`).all(),c=this.db.prepare(`
|
|
312
312
|
INSERT OR IGNORE INTO pattern_citations (source_pattern_id, target_pattern_id, weight, relationship)
|
|
313
313
|
VALUES (?, ?, 2.0, 'derivation')
|
|
314
|
-
`);for(let
|
|
314
|
+
`);for(let p of n)c.run(p.source_pattern_id,p.target_pattern_id).changes>0&&e++;return e}getEdgeCount(){return this.ensureSchema(),this.db.prepare("SELECT COUNT(*) as cnt FROM pattern_citations").get().cnt}};var u=E.create("QEReasoningBank"),O=class{constructor(e,r,t={},i){this.memory=e;this.eventBus=r;this.coherenceService=i;this.config={...D,...t},t.rvfDualWriter&&(this.rvfDualWriter=t.rvfDualWriter),this.patternStore=V(e,{embeddingDimension:this.config.embeddingDimension,...t.patternStore})}memory;eventBus;coherenceService;config;patternStore;initialized=!1;sqliteStore=null;rvfDualWriter=null;getSqliteStore(){return this.sqliteStore||(this.sqliteStore=G(),this.sqliteStore.initialize().catch(e=>{u.warn("SQLitePatternStore init failed",{error:f(e)})})),this.sqliteStore}setRvfDualWriter(e){this.rvfDualWriter=e}stats={routingRequests:0,totalRoutingConfidence:0,learningOutcomes:0,successfulOutcomes:0};async initialize(e){if(this.initialized)return;let r=e?.signal;r?.throwIfAborted(),await this.patternStore.initialize(),r?.throwIfAborted();try{let t=this.getSqliteStore();await t.initialize(),this.patternStore.setSqliteStore?.(t)}catch(t){u.warn("Failed to wire SQLitePatternStore into PatternStore",{error:f(t)})}r?.throwIfAborted(),await this.loadPretrainedPatterns(r),r?.throwIfAborted(),this.initialized=!0;try{let t="reasoning-bank:cross-domain-seeded";if(!await this.memory.get(t))await this.memory.set(t,!0),await this.seedCrossDomainPatterns(r);else{let s=await this.patternStore.getStats();u.info("Cross-domain transfer already complete",{totalPatterns:s.totalPatterns})}}catch(t){if(r?.aborted)throw t;u.warn("Cross-domain seeding failed (non-fatal)",{error:t})}u.info("Initialized")}async loadPretrainedPatterns(e){e?.throwIfAborted();let r=await this.patternStore.getStats();if(r.totalPatterns>0){u.info("Found existing patterns",{totalPatterns:r.totalPatterns});let t=this.patternStore.getAdapter?.();if(t&&(t.status()?.totalVectors??0)===0)try{let s=this.getSqliteStore().getAllEmbeddings().filter(({embedding:o})=>o&&o.length>0).map(({patternId:o,embedding:n})=>({id:o,vector:n instanceof Float32Array?n:new Float32Array(n)}));if(s.length>0){let{accepted:o,rejected:n}=t.ingest(s);u.info("Backfilled RVF from SQLite",{count:s.length,accepted:o}),n>0&&u.warn("RVF backfill partially rejected",{accepted:o,rejected:n})}}catch(i){u.warn("RVF backfill failed (non-fatal)",{error:f(i)})}return}for(let t of w){e?.throwIfAborted();try{await this.storePattern(t)}catch(i){if(e?.aborted)throw i;u.warn("Failed to load pattern",{name:t.name,error:i})}}u.info("Loaded foundational patterns",{count:w.length})}async seedCrossDomainPatterns(e){return this.initialized||await this.initialize({signal:e}),K({searchPatterns:this.searchPatterns.bind(this),storePattern:this.storePattern.bind(this),patternStore:this.patternStore,signal:e})}async storePattern(e){if(this.initialized||await this.initialize(),!this.config.enableLearning)return S(new Error("Pattern learning is disabled"));if(!e.embedding){let t=await this.embed(`${e.name} ${e.description} ${e.context?.tags?.join(" ")||""}`);e={...e,embedding:t}}let r=await this.patternStore.create(e);if(r.success&&(P().then(t=>t.append("PATTERN_CREATE",{patternId:r.value.id,domain:r.value.qeDomain,confidence:r.value.confidence,name:r.value.name},"reasoning-bank")).catch(t=>{u.warn("Witness chain PATTERN_CREATE failed",{error:f(t)})}),this.rvfDualWriter&&r.value.embedding&&r.value.embedding.length>0))try{this.rvfDualWriter.writePattern(r.value.id,r.value.embedding)}catch(t){u.warn("RVF dual-write failed (non-fatal)",{patternId:r.value.id,error:f(t)})}return r}async searchPatterns(e,r){this.initialized||await this.initialize();let t=e,i=!0;return typeof e=="string"&&(e.trim()===""?(i=!1,t=""):t=await this.embed(e)),this.patternStore.search(t,{...r,useVectorSearch:i})}async getPattern(e){return this.initialized||await this.initialize(),this.patternStore.get(e)}async recordOutcome(e){if(this.initialized||await this.initialize(),!this.config.enableLearning)return T(void 0);let r=await this.patternStore.recordUsage(e.patternId,e.success);try{this.getSqliteStore().recordUsage(e.patternId,e.success,e.metrics,e.feedback)}catch(t){u.warn("SQLite pattern usage persist failed",{error:f(t)})}if(r.success){this.stats.learningOutcomes++,e.success&&this.stats.successfulOutcomes++,P().then(s=>s.append("PATTERN_UPDATE",{patternId:e.patternId,success:e.success},"reasoning-bank")).catch(s=>{u.warn("Witness chain PATTERN_UPDATE failed",{error:f(s)})});let t=await this.getPattern(e.patternId),i=this.getPromotionDeps();t&&await X(t,i)&&(await H(e.patternId,i),u.info("Pattern promoted to long-term",{name:t.name}))}return r}getPromotionDeps(){return{patternStore:this.patternStore,coherenceService:this.coherenceService,eventBus:this.eventBus,coherenceThreshold:this.config.coherenceThreshold||.4,getSqliteStore:this.getSqliteStore.bind(this),rvfDualWriter:this.rvfDualWriter,searchPatterns:this.searchPatterns.bind(this),getPattern:this.getPattern.bind(this)}}async routeTask(e){if(this.initialized||await this.initialize(),!this.config.enableRouting)return S(new Error("Task routing is disabled"));this.stats.routingRequests++;try{let r=e.domain?[e.domain]:x(e.task);r.length===0&&r.push("test-generation");let t=await this.embed(e.task),i=await this.patternStore.search(t,{limit:this.config.maxRoutingCandidates,domain:r[0],useVectorSearch:!0}),s=i.success?i.value.map(d=>d.pattern):[],o=new Map;for(let[d,h]of Object.entries(R)){let m=s.filter(y=>h.domains.includes(y.qeDomain)).length;m>0&&o.set(d,m)}let n=I(r,e.capabilities,o,this.config.routingWeights),c=n[0],p=n.slice(1,4),l=[];if(this.config.enableGuidance&&r.length>0){let d=q(r[0],{framework:e.context?.framework,language:e.context?.language,includeAntiPatterns:!0});l.push(...d.slice(0,5))}this.stats.totalRoutingConfidence+=c.score;let g={recommendedAgent:c.agent,confidence:c.score,alternatives:p.map(d=>({agent:d.agent,score:d.score})),domains:r,patterns:s,guidance:l,reasoning:c.reasoning.join("; ")};return T(g)}catch(r){return S(L(r))}}getGuidance(e,r){return k(e)}generateContext(e,r){return C(e,r||{})}checkAntiPatterns(e,r){return W(e,r)}async embed(e){if(this.config.useONNXEmbeddings)try{let{computeRealEmbedding:r}=await import("./real-embeddings-SE7AMRSP.js"),t=await r(e);return t.length!==this.config.embeddingDimension?U(t,this.config.embeddingDimension):t}catch(r){process.env.DEBUG&&u.warn("ONNX embeddings unavailable, using hash fallback",{error:f(r)})}return $(e,this.config.embeddingDimension)}async getStats(){this.initialized||await this.initialize();let e=await this.patternStore.getStats(),r={};for(let n of j)r[n]=e.byDomain[n]||0;let t=this.stats.routingRequests,i=this.stats.routingRequests>0?this.stats.totalRoutingConfidence/this.stats.routingRequests:0,s=this.stats.learningOutcomes,o=this.stats.learningOutcomes>0?this.stats.successfulOutcomes/this.stats.learningOutcomes:0;if(t===0||s===0)try{let n=this.getSqliteStore().getAggregateOutcomeStats();t===0&&n.routingRequests>0&&(t=n.routingRequests,i=n.avgRoutingConfidence),s===0&&n.learningOutcomes>0&&(s=n.learningOutcomes,o=n.learningOutcomes>0?n.successfulOutcomes/n.learningOutcomes:n.avgPatternSuccessRate)}catch{}return{totalPatterns:e.totalPatterns,byDomain:r,routingRequests:t,avgRoutingConfidence:i,learningOutcomes:s,patternSuccessRate:o,patternStoreStats:e}}async dispose(){if(await this.patternStore.dispose(),this.sqliteStore&&(this.sqliteStore.close(),this.sqliteStore=null),this.rvfDualWriter){try{this.rvfDualWriter.close()}catch{}this.rvfDualWriter=null}this.initialized=!1}};function Ge(a,e,r,t){return new O(a,e,r,t)}export{D as a,w as b,R as c,I as d,_ as e,O as f,Ge as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.27");process.exit(0)}
|
|
2
2
|
var N="ffffffff-ffff-ffff-ffff-ffffffffffff";var _="00000000-0000-0000-0000-000000000000";var y=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function k(r){return typeof r=="string"&&y.test(r)}var u=k;function q(r){if(!u(r))throw TypeError("Invalid UUID");let n;return Uint8Array.of((n=parseInt(r.slice(0,8),16))>>>24,n>>>16&255,n>>>8&255,n&255,(n=parseInt(r.slice(9,13),16))>>>8,n&255,(n=parseInt(r.slice(14,18),16))>>>8,n&255,(n=parseInt(r.slice(19,23),16))>>>8,n&255,(n=parseInt(r.slice(24,36),16))/1099511627776&255,n/4294967296&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255)}var c=q;var x=[];for(let r=0;r<256;++r)x.push((r+256).toString(16).slice(1));function l(r,n=0){return(x[r[n+0]]+x[r[n+1]]+x[r[n+2]]+x[r[n+3]]+"-"+x[r[n+4]]+x[r[n+5]]+"-"+x[r[n+6]]+x[r[n+7]]+"-"+x[r[n+8]]+x[r[n+9]]+"-"+x[r[n+10]]+x[r[n+11]]+x[r[n+12]]+x[r[n+13]]+x[r[n+14]]+x[r[n+15]]).toLowerCase()}function C(r,n=0){let f=l(r,n);if(!u(f))throw TypeError("Stringified UUID is invalid");return f}var H=C;var v=new Uint8Array(16);function m(){return crypto.getRandomValues(v)}var g={};function X(r,n,f){let e,o=r?._v6??!1;if(r){let t=Object.keys(r);t.length===1&&t[0]==="_v6"&&(r=void 0)}if(r)e=E(r.random??r.rng?.()??m(),r.msecs,r.nsecs,r.clockseq,r.node,n,f);else{let t=Date.now(),i=m();j(g,t,i),e=E(i,g.msecs,g.nsecs,o?void 0:g.clockseq,o?void 0:g.node,n,f)}return n??l(e)}function j(r,n,f){return r.msecs??=-1/0,r.nsecs??=0,n===r.msecs?(r.nsecs++,r.nsecs>=1e4&&(r.node=void 0,r.nsecs=0)):n>r.msecs?r.nsecs=0:n<r.msecs&&(r.node=void 0),r.node||(r.node=f.slice(10,16),r.node[0]|=1,r.clockseq=(f[8]<<8|f[9])&16383),r.msecs=n,r}function E(r,n,f,e,o,t,i=0){if(r.length<16)throw new Error("Random bytes length must be >= 16");if(!t)t=new Uint8Array(16),i=0;else if(i<0||i+16>t.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);n??=Date.now(),f??=0,e??=(r[8]<<8|r[9])&16383,o??=r.slice(10,16),n+=122192928e5;let d=((n&268435455)*1e4+f)%4294967296;t[i++]=d>>>24&255,t[i++]=d>>>16&255,t[i++]=d>>>8&255,t[i++]=d&255;let a=n/4294967296*1e4&268435455;t[i++]=a>>>8&255,t[i++]=a&255,t[i++]=a>>>24&15|16,t[i++]=a>>>16&255,t[i++]=e>>>8|128,t[i++]=e&255;for(let p=0;p<6;++p)t[i++]=o[p];return t}var D=X;function U(r){let n=typeof r=="string"?c(r):r,f=G(n);return typeof r=="string"?l(f):f}function G(r){return Uint8Array.of((r[6]&15)<<4|r[7]>>4&15,(r[7]&15)<<4|(r[4]&240)>>4,(r[4]&15)<<4|(r[5]&240)>>4,(r[5]&15)<<4|(r[0]&240)>>4,(r[0]&15)<<4|(r[1]&240)>>4,(r[1]&15)<<4|(r[2]&240)>>4,96|r[2]&15,r[3],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}import{createHash as K}from"node:crypto";function M(r){return Array.isArray(r)?r=Buffer.from(r):typeof r=="string"&&(r=Buffer.from(r,"utf8")),K("md5").update(r).digest()}var T=M;function O(r){r=unescape(encodeURIComponent(r));let n=new Uint8Array(r.length);for(let f=0;f<r.length;++f)n[f]=r.charCodeAt(f);return n}var w="6ba7b810-9dad-11d1-80b4-00c04fd430c8",I="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function h(r,n,f,e,o,t){let i=typeof f=="string"?O(f):f,d=typeof e=="string"?c(e):e;if(typeof e=="string"&&(e=c(e)),e?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+i.length);if(a.set(d),a.set(i,d.length),a=n(a),a[6]=a[6]&15|r,a[8]=a[8]&63|128,o){if(t??=0,t<0||t+16>o.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let p=0;p<16;++p)o[t+p]=a[p];return o}return l(a)}function S(r,n,f,e){return h(48,T,r,n,f,e)}S.DNS=w;S.URL=I;var z=S;function F(r,n,f){return!n&&!r&&crypto.randomUUID?crypto.randomUUID():J(r,n,f)}function J(r,n,f){r=r||{};let e=r.random??r.rng?.()??m();if(e.length<16)throw new Error("Random bytes length must be >= 16");if(e[6]=e[6]&15|64,e[8]=e[8]&63|128,n){if(f=f||0,f<0||f+16>n.length)throw new RangeError(`UUID byte range ${f}:${f+15} is out of buffer bounds`);for(let o=0;o<16;++o)n[f+o]=e[o];return n}return l(e)}var P=F;import{createHash as Q}from"node:crypto";function W(r){return Array.isArray(r)?r=Buffer.from(r):typeof r=="string"&&(r=Buffer.from(r,"utf8")),Q("sha1").update(r).digest()}var V=W;function R(r,n,f,e){return h(80,V,r,n,f,e)}R.DNS=w;R.URL=I;var Y=R;function Z(r,n,f){r??={},f??=0;let e=D({...r,_v6:!0},new Uint8Array(16));if(e=U(e),n){if(f<0||f+16>n.length)throw new RangeError(`UUID byte range ${f}:${f+15} is out of buffer bounds`);for(let o=0;o<16;o++)n[f+o]=e[o];return n}return l(e)}var s=Z;function $(r){let n=typeof r=="string"?c(r):r,f=b(n);return typeof r=="string"?l(f):f}function b(r){return Uint8Array.of((r[3]&15)<<4|r[4]>>4&15,(r[4]&15)<<4|(r[5]&240)>>4,(r[5]&15)<<4|r[6]&15,r[7],(r[1]&15)<<4|(r[2]&240)>>4,(r[2]&15)<<4|(r[3]&240)>>4,16|(r[0]&240)>>4,(r[0]&15)<<4|(r[1]&240)>>4,r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}var A={};function B(r,n,f){let e;if(r)e=L(r.random??r.rng?.()??m(),r.msecs,r.seq,n,f);else{let o=Date.now(),t=m();r0(A,o,t),e=L(t,A.msecs,A.seq,n,f)}return n??l(e)}function r0(r,n,f){return r.msecs??=-1/0,r.seq??=0,n>r.msecs?(r.seq=f[6]<<23|f[7]<<16|f[8]<<8|f[9],r.msecs=n):(r.seq=r.seq+1|0,r.seq===0&&r.msecs++),r}function L(r,n,f,e,o=0){if(r.length<16)throw new Error("Random bytes length must be >= 16");if(!e)e=new Uint8Array(16),o=0;else if(o<0||o+16>e.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);return n??=Date.now(),f??=r[6]*127<<24|r[7]<<16|r[8]<<8|r[9],e[o++]=n/1099511627776&255,e[o++]=n/4294967296&255,e[o++]=n/16777216&255,e[o++]=n/65536&255,e[o++]=n/256&255,e[o++]=n&255,e[o++]=112|f>>>28&15,e[o++]=f>>>20&255,e[o++]=128|f>>>14&63,e[o++]=f>>>6&255,e[o++]=f<<2&255|r[10]&3,e[o++]=r[11],e[o++]=r[12],e[o++]=r[13],e[o++]=r[14],e[o++]=r[15],e}var n0=B;function f0(r){if(!u(r))throw TypeError("Invalid UUID");return parseInt(r.slice(14,15),16)}var e0=f0;export{N as a,_ as b,u as c,c as d,H as e,D as f,U as g,z as h,P as i,Y as j,s as k,$ as l,n0 as m,e0 as n};
|
|
@@ -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.9.
|
|
2
|
-
import{a as n}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.9.27");process.exit(0)}
|
|
2
|
+
import{a as n}from"./chunk-MHPA6IWB.js";import{a as o}from"./chunk-2SEXNZIJ.js";import{a,e as c}from"./chunk-CYNQW276.js";c();var M=a.CLEANUP_INTERVAL_MS,y=".agentic-qe/memory.db";async function d(r,t=!0){let e;switch(r.type){case"memory":e=new o;break;case"sqlite":e=new n({sqlite:r.sqlite,enableFallback:!0});break;case"agentdb":e=new n({sqlite:{path:r.agentdb?.path??y},enableFallback:!0});break;case"hybrid":e=new n(r.hybrid);break;default:throw new Error(`Unknown memory backend type: ${r.type}`)}return t&&await e.initialize(),{backend:e,type:r.type,initialized:t}}async function u(r=!0){let t=process.env.AQE_MEMORY_BACKEND??"memory",e=process.env.AQE_MEMORY_PATH??".agentic-qe",i={type:t,sqlite:{path:`${e}/memory.db`,walMode:!0},agentdb:{path:`${e}/memory.db`},hybrid:{enableFallback:!0,sqlite:{path:`${e}/memory.db`}}};return d(i,r)}export{d as a,u as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{d as k,f as we}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.9.27");process.exit(0)}
|
|
2
|
+
import{d as k,f as we}from"./chunk-JN7WVS57.js";import{a as ye}from"./chunk-ZGJTIDFI.js";import{c as Q}from"./chunk-XFDOE4QW.js";import{b as C,d as Z}from"./chunk-PIR3KN5M.js";import{a as V,c as be}from"./chunk-WHI7FVTH.js";import{a as J,b as Xe}from"./chunk-HPB5MPJP.js";import{a as ee,d as b,e as te,f as ne}from"./chunk-HYCRKKJN.js";import{a as v,e as De}from"./chunk-CYNQW276.js";import{c as R,e as ve}from"./chunk-CNWWQYZ3.js";function O(i){if(!q.has(i))throw new Error(`Invalid table name: "${i}" is not in the allowlist`);return i}function ze(i){let e=i.split(".");if(e.length>2)throw new Error(`Invalid SQL identifier: "${i}" has too many parts (max: schema.table)`);for(let t of e)if(!re.test(t))throw new Error(`Invalid SQL identifier: "${i}" \u2014 part "${t}" does not match pattern ${re}`);return i}var q,re,z=R(()=>{"use strict";q=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"]);re=/^[a-z_][a-z0-9_]{0,62}$/});var D,se,oe,ie,ae,ce,Te,Ee,de,ue,le,pe,ge=R(()=>{"use strict";we();D=9,se=`
|
|
3
3
|
CREATE TABLE IF NOT EXISTS schema_version (
|
|
4
4
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
5
5
|
version INTEGER NOT NULL,
|
|
@@ -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.9.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.27");process.exit(0)}
|
|
2
2
|
import{createRequire as t}from"module";var o=t(import.meta.url),e=o("@xenova/transformers"),n=e,{RuvectorLayer:i,TensorCompress:a,differentiableSearch:s,hierarchicalForward:c,getCompressionLevel:l,init:p,FlashAttention:m,DotProductAttention:u,MultiHeadAttention:d,HyperbolicAttention:A,LinearAttention:f,MoEAttention:h,SonaEngine:_,pipeline:v}=e||{};export{n as a,i as b,a as c,s as d,c as e,l as f,p as g,m as h,u as i,d as j,A as k,f as l,h as m,_ as n,v as o};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.27");process.exit(0)}
|
|
2
2
|
var u={0:{tier:0,name:"Agent Booster",description:"Mechanical code transforms via Rust/WASM",useCases:["var-to-const conversion","add-types","remove-console statements","promise-to-async","cjs-to-esm","func-to-arrow"],typicalLatencyMs:1,relativeCost:0,exampleModels:["agent-booster-wasm","agent-booster-typescript"],requiresNetwork:!1,complexityRange:[0,10]},1:{tier:1,name:"Haiku",description:"Fast, cost-effective for simple tasks",useCases:["Simple bug fixes","Code formatting","Documentation updates","Basic refactoring","Test generation (simple)"],typicalLatencyMs:500,relativeCost:1,exampleModels:["claude-haiku-4-5-20251001","gpt-4o-mini","gemini-flash"],requiresNetwork:!0,complexityRange:[10,35]},2:{tier:2,name:"Sonnet",description:"Balanced capability for complex reasoning",useCases:["Feature implementation","Complex refactoring","Security analysis","Performance optimization","Test generation (complex)"],typicalLatencyMs:3e3,relativeCost:2,exampleModels:["claude-sonnet-4-6","gpt-4o","gemini-pro"],requiresNetwork:!0,complexityRange:[35,70]},3:{tier:3,name:"Sonnet Extended",description:"Extended context for multi-step workflows",useCases:["Multi-file refactoring","Workflow orchestration","Cross-domain coordination","Large codebase analysis"],typicalLatencyMs:7e3,relativeCost:3,exampleModels:["claude-sonnet-4-6"],requiresNetwork:!0,complexityRange:[60,85]},4:{tier:4,name:"Opus",description:"Maximum capability for critical decisions",useCases:["Architecture design","Security audits","Complex algorithm design","Critical bug analysis","System-wide refactoring"],typicalLatencyMs:5e3,relativeCost:4,exampleModels:["claude-opus-4-7","gpt-4-turbo"],requiresNetwork:!0,complexityRange:[75,100]}},d={enabled:!0,tierBudgets:{0:{tier:0,maxCostPerRequest:0,maxRequestsPerHour:1e4,maxRequestsPerDay:1e5,maxDailyCostUsd:0,enabled:!0},1:{tier:1,maxCostPerRequest:.01,maxRequestsPerHour:100,maxRequestsPerDay:1e3,maxDailyCostUsd:5,enabled:!0},2:{tier:2,maxCostPerRequest:.1,maxRequestsPerHour:50,maxRequestsPerDay:500,maxDailyCostUsd:20,enabled:!0},3:{tier:3,maxCostPerRequest:.5,maxRequestsPerHour:20,maxRequestsPerDay:100,maxDailyCostUsd:30,enabled:!0},4:{tier:4,maxCostPerRequest:2,maxRequestsPerHour:10,maxRequestsPerDay:50,maxDailyCostUsd:50,enabled:!0}},maxDailyCostUsd:100,warningThreshold:.8,onBudgetExceeded:"downgrade",onBudgetWarning:"warn",allowCriticalOverrides:!0},y={budgetConfig:d,enableAgentBooster:!0,agentBoosterThreshold:.7,enableAutoRouting:!0,complexityThresholds:{0:10,1:35,2:70,3:85,4:100},allowManualOverrides:!0,enableDecisionCache:!0,decisionCacheTtlMs:300*1e3,enableMetrics:!0,maxDecisionTimeMs:10,fallbackTier:2,tierModels:{0:"agent-booster",1:"claude-haiku-4-5-20251001",2:"claude-sonnet-4-6",3:"claude-sonnet-4-6",4:"claude-opus-4-7"}},r=class extends Error{constructor(e,t,l){super(e);this.code=t;this.cause=l;this.name="ModelRouterError"}code;cause},a=class extends r{constructor(e,t,l){super(e,"BUDGET_EXCEEDED");this.tier=t;this.usage=l;this.name="BudgetExceededError"}tier;usage},i=class extends r{constructor(o,e){super(o,"COMPLEXITY_ANALYSIS_ERROR",e),this.name="ComplexityAnalysisError"}},s=class extends r{constructor(e,t){super(e,"ROUTING_TIMEOUT");this.timeoutMs=t;this.name="RoutingTimeoutError"}timeoutMs};export{u as a,d as b,y as c,r as d,a as e,i as f,s as g};
|
|
@@ -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.9.
|
|
2
|
-
function b(i,t){return{ingest(e){i.ingest(e)},search(e,r){return i.search(e,r).map(s=>({id:s.id,score:s.score}))},delete(e){i.delete(e)},status(){let e=i.status();return{totalVectors:e.totalVectors,dimensions:t,totalSegments:e.totalSegments,fileSizeBytes:e.fileSizeBytes,epoch:e.epoch,witnessValid:e.witnessValid,witnessEntries:e.witnessEntries}},close(){i.close()}}}function c(i,t){return(i.prepare("SELECT COUNT(*) as cnt FROM sqlite_master WHERE type='table' AND name=?").get(t)?.cnt??0)>0}var d=class{db;config;rvfStore=null;rvfAvailable=!1;constructor(t,e){this.db=t,this.config={...e,dimensions:e.dimensions??384}}async initialize(){if(this.config.mode==="sqlite-only"){this.rvfAvailable=!1;return}try{let t=await import("./rvf-native-adapter-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.27");process.exit(0)}
|
|
2
|
+
function b(i,t){return{ingest(e){i.ingest(e)},search(e,r){return i.search(e,r).map(s=>({id:s.id,score:s.score}))},delete(e){i.delete(e)},status(){let e=i.status();return{totalVectors:e.totalVectors,dimensions:t,totalSegments:e.totalSegments,fileSizeBytes:e.fileSizeBytes,epoch:e.epoch,witnessValid:e.witnessValid,witnessEntries:e.witnessEntries}},close(){i.close()}}}function c(i,t){return(i.prepare("SELECT COUNT(*) as cnt FROM sqlite_master WHERE type='table' AND name=?").get(t)?.cnt??0)>0}var d=class{db;config;rvfStore=null;rvfAvailable=!1;constructor(t,e){this.db=t,this.config={...e,dimensions:e.dimensions??384}}async initialize(){if(this.config.mode==="sqlite-only"){this.rvfAvailable=!1;return}try{let t=await import("./rvf-native-adapter-EPXU4UUM.js");if(!t.isRvfNativeAvailable()){this.rvfAvailable=!1;return}let e;try{e=t.openRvfStore(this.config.rvfPath)}catch{e=t.createRvfStore(this.config.rvfPath,this.config.dimensions)}this.rvfStore=b(e,this.config.dimensions),this.rvfAvailable=!0}catch{this.rvfAvailable=!1}}setRvfStore(t){this.rvfStore=t,this.rvfAvailable=!0}writePattern(t,e){let r={sqliteSuccess:!1,rvfSuccess:!1};try{this.writeSqliteEmbedding(t,e),r.sqliteSuccess=!0}catch{r.sqliteSuccess=!1}if(this.shouldWriteRvf())try{this.rvfStore.ingest([{id:t,vector:e instanceof Float32Array?Array.from(e):e}]),r.rvfSuccess=!0}catch{r.rvfSuccess=!1,r.divergence="rvf-write-failed"}return r}deletePattern(t){let e={sqliteSuccess:!1,rvfSuccess:!1};try{this.deleteSqliteEmbedding(t),e.sqliteSuccess=!0}catch{e.sqliteSuccess=!1}if(this.shouldWriteRvf())try{this.rvfStore.delete([t]),e.rvfSuccess=!0}catch{e.rvfSuccess=!1,e.divergence="rvf-delete-failed"}return e}search(t,e){if(this.config.mode==="rvf-primary"&&this.rvfAvailable&&this.rvfStore)try{return this.rvfStore.search(t,e)}catch{}return this.searchSqlite(t,e)}getDivergenceReport(){let t={totalChecked:0,divergences:0,details:[]},e=this.getSqliteEmbeddingCount();if(t.totalChecked=e,!this.rvfAvailable||!this.rvfStore)return this.config.mode!=="sqlite-only"&&e>0&&(t.divergences=1,t.details.push({patternId:"*",issue:"count-mismatch"})),t;let s=this.rvfStore.status().totalVectors;return e!==s&&(t.divergences=1,t.details.push({patternId:"*",issue:"count-mismatch"})),t}isPromotionSafe(){return this.getDivergenceReport().divergences===0}status(){let t=this.getSqlitePatternCount(),e=this.getSqliteEmbeddingCount(),r=null;if(this.rvfAvailable&&this.rvfStore)try{r=this.rvfStore.status()}catch{r=null}return{sqlite:{patternCount:t,vectorCount:e},rvf:r,mode:this.config.mode}}close(){if(this.rvfStore){try{this.rvfStore.close()}catch{}this.rvfStore=null,this.rvfAvailable=!1}}shouldWriteRvf(){return(this.config.mode==="dual-write"||this.config.mode==="rvf-primary")&&this.rvfAvailable&&this.rvfStore!==null}writeSqliteEmbedding(t,e){let r=Buffer.from(e instanceof Float32Array?e.buffer:new Float32Array(e).buffer),s=e.length;c(this.db,"qe_pattern_embeddings")&&this.db.prepare(`
|
|
3
3
|
INSERT INTO qe_pattern_embeddings (pattern_id, embedding, dimension, model, created_at)
|
|
4
4
|
VALUES (?, ?, ?, 'all-MiniLM-L6-v2', datetime('now'))
|
|
5
5
|
ON CONFLICT(pattern_id) DO UPDATE SET
|
|
@@ -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.9.
|
|
2
|
-
import{f 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.9.27");process.exit(0)}
|
|
2
|
+
import{f as p}from"./chunk-BT5YOORE.js";import{a as f,c as R}from"./chunk-WHI7FVTH.js";R();var u=class extends p{config={name:"qe/workflows/browser-load",description:"Load, validate, and prepare browser automation workflows from inline YAML or built-in templates. Returns the resolved workflow with steps and variable bindings, ready for browser execution. Templates: login-flow, form-validation, visual-regression, oauth-flow, etc.",domain:"test-execution",schema:this.buildSchema()};buildSchema(){return{type:"object",properties:{workflowYaml:{type:"string",description:"Inline YAML workflow definition. Mutually exclusive with templateName."},templateName:{type:"string",description:"Built-in template name to load.",enum:["login-flow","oauth-flow","scraping-workflow","visual-regression","form-validation","navigation-flow","api-integration","performance-audit","accessibility-audit"]},variables:{type:"object",description:'Runtime variable overrides (e.g., { "baseUrl": "https://example.com" })'}}}}async execute(r,C){try{let{WorkflowLoader:n,WORKFLOW_TEMPLATES:g,WORKFLOW_DESCRIPTIONS:v,interpolateVariables:b}=await import("./browser-D6YYID5Y.js"),{parse:k}=await import("yaml"),d=new n,l=[...g],y=v;if(!r.workflowYaml&&!r.templateName)return{success:!0,data:{workflowName:"none",description:"No workflow specified. Use templateName or workflowYaml.",source:"none",templateUsed:null,steps:[],variables:{defined:[],provided:{}},validation:{valid:!0,errors:[],warnings:[]},availableTemplates:l,summary:`Available templates: ${l.join(", ")}`}};let e,i,t=null;r.workflowYaml?(i="inline-yaml",e=k(r.workflowYaml)):(i="template",t=r.templateName,e=await d.load(r.templateName));let a=await d.validate(e),w=(e.steps??[]).map(o=>{let s=o.config;if(r.variables){let c={};for(let[h,m]of Object.entries(s))c[h]=typeof m=="string"?b(m,r.variables):m;s=c}return{name:o.name,action:o.action,config:s,optional:o.optional??!1,assertionCount:o.assertions?.length??0}});return{success:!0,data:{workflowName:e.name||t||"custom",description:e.description||t&&y[t]||"",source:i,templateUsed:t,steps:w,variables:{defined:(e.variables??[]).map(o=>({name:o.name,type:o.type,required:o.required,hasDefault:o.default!==void 0})),provided:r.variables||{}},validation:{valid:a.valid,errors:a.errors,warnings:a.warnings},availableTemplates:l,summary:a.valid?`Workflow "${e.name}" loaded (${i}): ${w.length} steps, ${(e.variables??[]).length} variables`:`Workflow "${e.name}" has validation errors: ${a.errors.join("; ")}`}}}catch(n){return{success:!1,error:f(n)}}}};export{u as a};
|
|
@@ -1,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.9.
|
|
2
|
-
import{a as C,f as x}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.9.27");process.exit(0)}
|
|
2
|
+
import{a as C,f as x}from"./chunk-U7S7A7LB.js";import{a as h}from"./chunk-GXHMSIBM.js";var d={mechanical:["convert var to const","add types","remove console","convert to async","convert to esm","arrow function","rename variable","format code"],simple:["fix typo","update comment","fix simple bug","add documentation","format","rename","simple refactor","basic test"],moderate:["implement feature","implement","refactor","complex refactor","performance optimization","optimize","test generation","generate test","error handling","validation logic","api integration","code index","coverage analysis","quality assessment","defect prediction","predict defect","analyze coverage","analyze","assess","scan","detect"],complex:["multi-file refactor","orchestrate","coordinate","large codebase","migration","cross-domain","workflow","system design","analyze security","security scan","security analysis","vulnerability scan","chaos test","resilience test","contract validation"],critical:["architecture","security audit","critical bug","algorithm design","system-wide","vulnerability","cryptography","performance critical","hardcoded secret","cve","owasp","penetration test","exploit"]},f={architecture:/\b(architect|design|system design|overall structure|component design)\b/i,security:/\b(security|vulnerability|audit|xss|sql injection|csrf|encryption|auth|authentication|authorization)\b/i,multiStep:/\b(orchestrate|coordinate|workflow|pipeline|multi[- ]step)\b/i,crossDomain:/\b(cross[- ]domain|across (domains|modules)|integrate|coordination)\b/i},m=class{config;agentBoosterAdapter;constructor(e,t){this.config=e,this.agentBoosterAdapter=t}async collectSignals(e){let t=e.task.toLowerCase(),r=await this.checkAgentBoosterEligibility(e),o={simple:this.findKeywordMatches(t,d.simple),moderate:this.findKeywordMatches(t,d.moderate),complex:this.findKeywordMatches(t,d.complex),critical:this.findKeywordMatches(t,d.critical)},c=e.codeContext?e.codeContext.split(`
|
|
3
3
|
`).length:void 0,n=e.filePaths?e.filePaths.length:void 0,i=f.architecture.test(t),a=f.security.test(t),l=f.multiStep.test(t),g=f.crossDomain.test(t),b=this.detectCreativityRequirement(t),S=this.estimateLanguageComplexity(e.codeContext,e.filePaths),T=e.codeContext?this.estimateCyclomaticComplexity(e.codeContext):void 0;return{linesOfCode:c,fileCount:n,hasArchitectureScope:i,hasSecurityScope:a,requiresMultiStepReasoning:l,requiresCrossDomainCoordination:g,isMechanicalTransform:r.eligible,languageComplexity:S,cyclomaticComplexity:T,dependencyCount:this.countDependencies(e.codeContext),requiresCreativity:b,detectedTransformType:r.transformType,keywordMatches:o}}async checkAgentBoosterEligibility(e){if(!this.config.enableAgentBooster)return{eligible:!1,confidence:0,reason:"Agent Booster is disabled"};let t=e.task.toLowerCase(),r,o=0;for(let n of h){let i=this.getTransformKeywords(n),a=0;for(let l of i)t.includes(l.toLowerCase())&&(a=a===0?.5:a+.25);for(let l of d.mechanical)t.includes(l.toLowerCase())&&(a=Math.max(a,.6));a>o&&(o=a,r=n)}if(e.codeContext&&r&&this.agentBoosterAdapter)try{let i=(await this.agentBoosterAdapter.detectTransformOpportunities(e.codeContext)).opportunities.find(a=>a.type===r);if(i)return{eligible:i.confidence>=this.config.agentBoosterThreshold,transformType:r,confidence:i.confidence,reason:i.reason}}catch(n){console.debug("[SignalCollector] WASM analysis error:",n instanceof Error?n.message:n)}let c=o>=this.config.agentBoosterThreshold&&r!==void 0;return{eligible:c,transformType:r,confidence:Math.min(o,1),reason:c?`Detected ${r} transform pattern`:"No mechanical transform pattern detected"}}findKeywordMatches(e,t){let r=[];for(let o of t)e.includes(o.toLowerCase())&&r.push(o);return r}detectCreativityRequirement(e){return e.includes("design")||e.includes("creative")||e.includes("innovative")||e.includes("novel")}estimateLanguageComplexity(e,t){if(!e&&(!t||t.length===0))return;let r=[".ts",".tsx",".rs",".cpp",".c",".go"],o=[".js",".jsx",".py",".java"],c=[".json",".yaml",".md",".txt",".css",".html"];if(t){for(let n of t)if(r.some(i=>n.endsWith(i)))return"high";for(let n of t)if(o.some(i=>n.endsWith(i)))return"medium";for(let n of t)if(c.some(i=>n.endsWith(i)))return"low"}if(e){let n=/<[A-Z][^>]*>/.test(e),i=/\b(async|await)\b/.test(e),a=/\b(interface|type|class)\b/.test(e);return n&&a?"high":i||a?"medium":"low"}return"medium"}estimateCyclomaticComplexity(e){let t=[/\bif\b/g,/\bfor\b/g,/\bwhile\b/g,/\bcase\b/g,/\bcatch\b/g,/&&/g,/\|\|/g,/\?/g],r=1;for(let o of t){let c=e.match(o);c&&(r+=c.length)}return r}countDependencies(e){if(!e)return;let t=e.match(/\b(import|require|from)\b.*['"].*['"]/g);return t?t.length:0}getTransformKeywords(e){return{"var-to-const":["var to const","convert var","var declaration","var to let","convert var to const","change var to const"],"add-types":["add types","add type","typescript types","type annotations","type annotation","add type annotations"],"remove-console":["remove console","delete console","console.log","remove console.log","strip console"],"promise-to-async":["promise to async","async await",".then to async","convert to async","convert function to async"],"cjs-to-esm":["commonjs to esm","require to import","convert to esm","cjs to esm","module conversion"],"func-to-arrow":["arrow function","function to arrow","convert to arrow","convert function to arrow"]}[e]||[]}};function v(s,e){return new m(s,e)}var u=class{calculateCodeComplexity(e){let t=0;return t+=this.calculateLinesOfCodeContribution(e.linesOfCode),t+=this.calculateFileCountContribution(e.fileCount),t+=this.calculateCyclomaticContribution(e.cyclomaticComplexity),t+=this.calculateLanguageContribution(e.languageComplexity),Math.min(t,100)}calculateReasoningComplexity(e){let t=0;return t+=this.calculateKeywordScore(e.keywordMatches),e.requiresMultiStepReasoning&&(t+=20),e.requiresCreativity&&(t+=20),Math.min(t,100)}calculateScopeComplexity(e){let t=0;return e.hasArchitectureScope&&(t+=40),e.hasSecurityScope&&(t+=30),e.requiresCrossDomainCoordination&&(t+=20),t+=this.calculateDependencyContribution(e.dependencyCount),Math.min(t,100)}calculateOverallComplexity(e,t,r,o){if(o.isMechanicalTransform&&!o.hasSecurityScope&&!o.hasArchitectureScope&&!o.requiresMultiStepReasoning&&!o.requiresCrossDomainCoordination&&e===0&&t===0&&r===0)return 5;let c=e*.3+t*.4+r*.3,n=0;return o.hasSecurityScope&&(n=Math.max(n,50)),o.hasArchitectureScope&&(n=Math.max(n,55)),o.requiresCrossDomainCoordination&&(n=Math.max(n,35)),o.requiresMultiStepReasoning&&(n=Math.max(n,30)),o.keywordMatches.simple.length+o.keywordMatches.moderate.length+o.keywordMatches.complex.length+o.keywordMatches.critical.length===0&&!o.isMechanicalTransform&&c<15&&(n=Math.max(n,15)),Math.min(Math.max(Math.round(c),n),100)}calculateConfidence(e,t){let r=.5;return t.codeContext&&(r+=.2),t.filePaths&&t.filePaths.length>0&&(r+=.1),r+=this.calculateKeywordConfidenceBoost(e.keywordMatches),e.isMechanicalTransform&&(r+=.15),Math.min(r,1)}calculateLinesOfCodeContribution(e){return e===void 0||e<10?0:e<50?10:e<200?20:30}calculateFileCountContribution(e){return e===void 0||e===1?0:e<5?10:20}calculateCyclomaticContribution(e){return e===void 0||e<5?0:e<10?10:e<20?20:30}calculateLanguageContribution(e){return e==="low"?0:e==="medium"?10:e==="high"?20:0}calculateKeywordScore(e){let t=e.simple.length*5+e.moderate.length*15+e.complex.length*25+e.critical.length*35;return Math.min(t,60)}calculateDependencyContribution(e){return e===void 0||e<3?0:e<10?5:10}calculateKeywordConfidenceBoost(e){let t=e.simple.length+e.moderate.length+e.complex.length+e.critical.length;return t>=3?.1:t>=1?.05:0}};function M(){return new u}var p=class{getRecommendedTier(e){for(let t of[0,1,2,3,4]){let[r,o]=C[t].complexityRange;if(e>=r&&e<=o)return t}return 2}findAlternateTiers(e,t){let r=[];return t>0&&r.push(t-1),t<4&&r.push(t+1),t<3&&!r.includes(4)&&r.push(4),r}generateExplanation(e,t,r){let o=[];return o.push(`Complexity score: ${e}/100 (Tier ${t})`),r.isMechanicalTransform&&o.push(this.formatMechanicalTransformInfo(r.detectedTransformType)),o.push(...this.formatScopeExplanations(r)),o.push(...this.formatCodeMetricsExplanations(r)),o.join(". ")}formatMechanicalTransformInfo(e){return`Detected mechanical transform: ${e}`}formatScopeExplanations(e){let t=[];return e.hasArchitectureScope&&t.push("Architecture scope detected"),e.hasSecurityScope&&t.push("Security scope detected"),e.requiresMultiStepReasoning&&t.push("Multi-step reasoning required"),e.requiresCrossDomainCoordination&&t.push("Cross-domain coordination required"),t}formatCodeMetricsExplanations(e){let t=[];return e.linesOfCode!==void 0&&e.linesOfCode>100&&t.push(`Large code change: ${e.linesOfCode} lines`),e.fileCount!==void 0&&e.fileCount>3&&t.push(`Multi-file change: ${e.fileCount} files`),t}};function w(){return new p}var y=class{config;signalCollector;scoreCalculator;tierRecommender;constructor(e,t,r,o){this.config=e,this.signalCollector=t,this.scoreCalculator=r,this.tierRecommender=o}async analyze(e){try{let t=await this.signalCollector.collectSignals(e),r=this.scoreCalculator.calculateCodeComplexity(t),o=this.scoreCalculator.calculateReasoningComplexity(t),c=this.scoreCalculator.calculateScopeComplexity(t),n=this.scoreCalculator.calculateOverallComplexity(r,o,c,t),i=this.tierRecommender.getRecommendedTier(n),a=this.tierRecommender.findAlternateTiers(n,i),l=this.scoreCalculator.calculateConfidence(t,e),g=this.tierRecommender.generateExplanation(n,i,t);return{overall:n,codeComplexity:r,reasoningComplexity:o,scopeComplexity:c,confidence:l,signals:t,recommendedTier:i,alternateTiers:a,explanation:g}}catch(t){throw new x(`Failed to analyze task complexity: ${t instanceof Error?t.message:"Unknown error"}`,t instanceof Error?t:void 0)}}async checkAgentBoosterEligibility(e){return this.signalCollector.checkAgentBoosterEligibility(e)}getRecommendedTier(e){return this.tierRecommender.getRecommendedTier(e)}};function L(s,e){let t=new m(s,e),r=new u,o=new p;return new y(s,t,r,o)}function z(s,e,t,r){return new y(s,e,t,r)}export{m as a,v as b,u as c,M as d,p as e,w as f,y as g,L as h,z as i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.27");process.exit(0)}
|
|
2
2
|
var h=class{executionHistory=[];learnedDurations=new Map;runCount=0;lastPrunedCount=0;learningRate;maxHistorySize;constructor(t){this.learningRate=t?.learningRate??.3,this.maxHistorySize=t?.maxHistorySize??1e4}buildTestDAG(t){let e=new Map,n=new Map;for(let i of t){let s=this.applyLearnedDuration(i);e.set(s.id,s),n.set(s.id,[])}for(let i of t)for(let s of i.dependencies){if(!e.has(s))throw new Error(`Test '${i.id}' depends on '${s}' which does not exist in the test set`);n.get(s).push(i.id)}let o=this.computeCriticalPath(e,n),a=this.computeParallelGroups(e,n);return{nodes:e,edges:n,criticalPath:o,parallelGroups:a}}findCriticalPath(t){return t.criticalPath.map(e=>t.nodes.get(e)).filter(e=>e!==void 0)}findParallelBranches(t){return t.parallelGroups.map(e=>e.map(n=>t.nodes.get(n)).filter(n=>n!==void 0))}pruneByMinCut(t,e){let n=this.sumDurations(t.nodes);if(n<=e)return this.lastPrunedCount=0,t;let o=this.computeAttentionScores(t),a=Array.from(o.entries()).sort((r,l)=>r[1]-l[1]),i=new Set(t.criticalPath),s=new Set,c=n;for(let[r]of a){if(c<=e)break;if(i.has(r)||(t.edges.get(r)??[]).some(p=>!s.has(p)))continue;let d=t.nodes.get(r);d&&(s.add(r),c-=d.estimatedDuration)}this.lastPrunedCount=s.size;let u=Array.from(t.nodes.values()).filter(r=>!s.has(r.id));return this.buildTestDAG(u)}schedule(t){if(t.length===0)return{phases:[],totalEstimatedTime:0,criticalPathTime:0,parallelism:0};let e=this.buildTestDAG(t),o=this.findParallelBranches(e).map(u=>({tests:u,canRunInParallel:u.length>1})),a=this.computeCriticalPathDuration(e),i=this.sumDurations(e.nodes),s=o.reduce((u,r)=>r.canRunInParallel?u+Math.max(...r.tests.map(l=>l.estimatedDuration)):u+r.tests.reduce((l,d)=>l+d.estimatedDuration,0),0),c=s>0?i/s:1;return this.runCount++,{phases:o,totalEstimatedTime:s,criticalPathTime:a,parallelism:c}}getOptimizationStats(){return{totalTests:0,criticalPathLength:0,parallelGroupCount:0,prunedTests:this.lastPrunedCount,estimatedTimeSaved:0,historicalRuns:this.runCount,usingNativeBackend:!1}}recordExecution(t,e,n){this.executionHistory.push({testId:t,actualDuration:e,result:n,timestamp:Date.now()}),this.executionHistory.length>this.maxHistorySize&&(this.executionHistory=this.executionHistory.slice(-this.maxHistorySize));let o=this.learnedDurations.get(t);o!==void 0?this.learnedDurations.set(t,o*(1-this.learningRate)+e*this.learningRate):this.learnedDurations.set(t,e)}getLearnedDuration(t){return this.learnedDurations.get(t)}isNativeBackendAvailable(){return!1}computeCriticalPath(t,e){let n=this.topologicalSort(t,e);if(n.length===0)return[];let o=new Map,a=new Map;for(let r of n)o.set(r,t.get(r).estimatedDuration),a.set(r,null);for(let r of n){let l=o.get(r);for(let d of e.get(r)??[]){let p=t.get(d);if(!p)continue;let g=l+p.estimatedDuration;g>(o.get(d)??0)&&(o.set(d,g),a.set(d,r))}}let i=0,s=null;for(let[r,l]of o)l>i&&(i=l,s=r);if(!s)return[];let c=[],u=s;for(;u!==null;)c.unshift(u),u=a.get(u)??null;return c}computeCriticalPathDuration(t){return t.criticalPath.reduce((e,n)=>e+(t.nodes.get(n)?.estimatedDuration??0),0)}computeParallelGroups(t,e){let n=this.topologicalSort(t,e);if(n.length===0)return[];let o=new Map;for(let[u,r]of t)o.set(u,new Set(r.dependencies));let a=new Map;for(let u of n){let r=-1;for(let l of o.get(u)??new Set){let d=a.get(l);d!==void 0&&d>r&&(r=d)}a.set(u,r+1)}let i=new Map;for(let u of n){let r=a.get(u)??0;i.has(r)||i.set(r,[]),i.get(r).push(u)}let s=Math.max(...Array.from(i.keys()),-1),c=[];for(let u=0;u<=s;u++){let r=i.get(u);r&&r.length>0&&c.push(r)}return c}computeAttentionScores(t){let e=new Map,n=this.countTransitiveDependents(t);for(let[o,a]of t.nodes){let i=a.lastResult==="fail"?2:1,s=n.get(o)??0;e.set(o,a.priority*i*(1+s))}return e}countTransitiveDependents(t){let e=new Map,n=new Map,o=a=>{if(n.has(a))return n.get(a);let i=new Set;for(let s of t.edges.get(a)??[]){i.add(s);for(let c of o(s))i.add(c)}return n.set(a,i),i};for(let a of t.nodes.keys())e.set(a,o(a).size);return e}topologicalSort(t,e){let n=new Map;for(let i of t.keys())n.set(i,0);for(let i of e.values())for(let s of i)n.has(s)&&n.set(s,(n.get(s)??0)+1);let o=[];for(let[i,s]of n)s===0&&o.push(i);let a=[];for(;o.length>0;){let i=o.shift();a.push(i);for(let s of e.get(i)??[]){let c=(n.get(s)??0)-1;n.set(s,c),c===0&&o.push(s)}}if(a.length!==t.size)throw new Error(`Cycle detected in test DAG: sorted ${a.length} of ${t.size} nodes`);return a}applyLearnedDuration(t){let e=this.learnedDurations.get(t.id);return e!==void 0?{...t,estimatedDuration:Math.round(e)}:t}sumDurations(t){let e=0;for(let n of t.values())e+=n.estimatedDuration;return e}};function m(f){return new h(f)}export{h as a,m as b};
|
|
@@ -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.9.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.27");process.exit(0)}
|
|
2
2
|
var i={domain:"test-generation",bestPractices:["Follow Arrange-Act-Assert (AAA) pattern for clear test structure","One logical assertion per test - test one behavior at a time","Use descriptive test names: should_returnValue_when_condition","Mock external dependencies to isolate unit under test","Test edge cases and boundary conditions, not just happy paths","Keep tests deterministic - avoid time-dependent assertions","Use test data builders or factories for complex objects","Prefer integration tests for workflows, unit tests for logic","Maintain test independence - no shared mutable state between tests","Write failing test first (TDD Red) before implementation"],antiPatterns:[{name:"God Test",description:"A single test that verifies too many behaviors",reason:"Hard to diagnose failures, brittle, slow to run",alternative:"Split into focused tests, each verifying one behavior",detection:"expect.*expect.*expect.*expect.*expect"},{name:"Mystery Guest",description:"Test relies on external data files or state not visible in test",reason:"Tests are hard to understand and maintain",alternative:"Make test data explicit within the test or use fixtures"},{name:"Eager Test",description:"Test that verifies more than needed for the current behavior",reason:"Creates unnecessary coupling, breaks easily",alternative:"Only assert what is necessary for this specific test case"},{name:"Flaky Assertion",description:"Assertions that depend on timing, order, or external state",reason:"Creates unreliable test suite, erodes trust",alternative:"Use deterministic assertions, mock time/random",detection:"setTimeout|Date\\.now|Math\\.random"},{name:"Test Code Duplication",description:"Same setup or assertion code repeated across tests",reason:"Maintenance burden, inconsistency risk",alternative:"Extract to beforeEach, helpers, or fixtures"}],frameworkGuidance:{jest:["Use describe blocks to group related tests","Prefer toEqual for deep equality, toBe for primitives","Use jest.mock() at module level for consistent mocking","Use jest.spyOn for partial mocking of objects","Enable --coverage to track test coverage"],vitest:["Use vi.mock() for module mocking","Prefer vi.fn() over jest.fn() syntax","Use vitest/ui for interactive test debugging","Enable browser mode for component tests","Use inline snapshots for small expected values"],mocha:["Use beforeEach/afterEach for setup/teardown","Combine with chai for assertions","Use sinon for spies, stubs, and mocks","Set appropriate timeouts for async tests"],pytest:["Use fixtures for reusable test setup","Use parametrize for data-driven tests","Use conftest.py for shared fixtures","Use pytest.raises for exception testing","Use pytest-cov for coverage reporting"],junit:["Use @BeforeEach and @AfterEach for setup/teardown","Use @DisplayName for readable test names","Use @ParameterizedTest for data-driven tests","Use Mockito for mocking dependencies"],testng:["Use @BeforeMethod and @AfterMethod appropriately","Use @DataProvider for parameterized tests","Configure test groups for selective execution"],playwright:["Use page.locator() for resilient element selection","Use expect(locator) for auto-waiting assertions","Use page.waitForLoadState for navigation","Use test.describe for grouping tests","Use fixtures for reusable browser contexts"],cypress:["Use cy.intercept() for API mocking","Avoid conditional testing - use deterministic state","Use data-cy attributes for stable selectors","Use cy.within() for scoped queries","Prefer cy.contains() for text-based selection"],selenium:["Use explicit waits over implicit waits","Use Page Object Model for maintainability","Handle stale element references with retry logic","Clean up browser state between tests"]},languageGuidance:{typescript:["Use type assertions in tests for better IDE support","Create typed test fixtures and builders","Use satisfies operator for test data validation","Mock types with ts-mockito or typed mocking libs"],javascript:["Use JSDoc comments for test documentation","Consider TypeScript for larger test suites","Use ESLint with testing plugins"],python:["Use type hints in test functions","Use dataclasses for test data","Follow PEP 8 naming: test_should_do_something"],java:["Use AssertJ for fluent assertions","Use Lombok for test data classes","Follow naming: shouldDoSomething_whenCondition"],go:["Use table-driven tests for multiple cases","Use testify for assertions and mocking","Place tests in _test.go files"],rust:["Use #[test] attribute for test functions","Use assert!, assert_eq!, assert_ne! macros","Place unit tests in same file with #[cfg(test)]"],csharp:["Use xUnit or NUnit for testing","Use FluentAssertions for readable assertions","Use Moq for mocking interfaces"],kotlin:["Use kotest for BDD-style testing","Use MockK for Kotlin-first mocking","Use data classes for test fixtures"]},examples:[{title:"Unit Test Template (TypeScript + Vitest)",description:"Standard AAA pattern for unit tests",content:`describe('UserService', () => {
|
|
3
3
|
describe('createUser', () => {
|
|
4
4
|
it('should create user with valid data', async () => {
|
|
@@ -1,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.9.
|
|
2
|
-
import{a as w,b as A,c as O,e as D,f as z}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.9.27");process.exit(0)}
|
|
2
|
+
import{a as w,b as A,c as O,e as D,f as z}from"./chunk-JN7WVS57.js";import{b as S,d as $}from"./chunk-PIR3KN5M.js";import{a as N,c as F}from"./chunk-WHI7FVTH.js";import{i as v}from"./chunk-SCS3RUTT.js";import*as I from"node:path";z();$();var P=["function","module","test","file","class"],L=["calls","imports","tests","depends_on","covers"],b=class{ensureSchema(e){e.transaction(()=>{e.exec(w),e.exec(A),e.exec(O)})()}schemaExists(e){return D(e)}getNodeTypes(){return P}getEdgeTypes(){return L}isValidNodeType(e){return P.includes(e)}isValidEdgeType(e){return L.includes(e)}getStats(e){if(!this.schemaExists(e))return{nodeCount:0,edgeCount:0};let t=e.prepare("SELECT COUNT(*) as count FROM hypergraph_nodes").get().count,r=e.prepare("SELECT COUNT(*) as count FROM hypergraph_edges").get().count;return{nodeCount:t,edgeCount:r}}dropSchema(e){let t=e.prepare("SELECT COUNT(*) as cnt FROM hypergraph_nodes").get()?.cnt??0,r=e.prepare("SELECT COUNT(*) as cnt FROM hypergraph_edges").get()?.cnt??0;if(t>0||r>0)throw new Error(`REFUSING to drop hypergraph schema: tables contain data (${t} nodes, ${r} edges). Backup and manually drop if needed.`);e.transaction(()=>{e.exec("DROP TABLE IF EXISTS hypergraph_edges"),e.exec("DROP TABLE IF EXISTS hypergraph_nodes")})()}};function C(n){return{id:n.id,type:n.type,name:n.name,file_path:n.filePath??null,line_start:n.lineStart??null,line_end:n.lineEnd??null,complexity:n.complexity??null,coverage:n.coverage??null,metadata:n.metadata?JSON.stringify(n.metadata):null,embedding:n.embedding?U(n.embedding):null}}function T(n){return{id:n.id,type:n.type,name:n.name,filePath:n.file_path??void 0,lineStart:n.line_start??void 0,lineEnd:n.line_end??void 0,complexity:n.complexity??void 0,coverage:n.coverage??void 0,metadata:n.metadata?S(n.metadata):void 0,embedding:n.embedding?W(n.embedding):void 0,createdAt:n.created_at,updatedAt:n.updated_at}}function M(n){return{id:n.id,source_id:n.sourceId,target_id:n.targetId,type:n.type,weight:n.weight??1,properties:n.properties?JSON.stringify(n.properties):null}}function H(n){return{id:n.id,sourceId:n.source_id,targetId:n.target_id,type:n.type,weight:n.weight,properties:n.properties?S(n.properties):void 0,createdAt:n.created_at}}function x(n,e,t){return`${n}--${t}-->${e}`}function U(n){let e=Buffer.alloc(n.length*4);for(let t=0;t<n.length;t++)e.writeFloatLE(n[t],t*4);return e}function W(n){let e=[],t=n.length/4;for(let r=0;r<t;r++)e.push(n.readFloatLE(r*4));return e}F();var B={maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1},R=class{config;schemaManager;initialized=!1;constructor(e){this.config={...B,...e},this.schemaManager=new b}async initialize(){this.initialized||(this.schemaManager.ensureSchema(this.config.db),this.initialized=!0)}isInitialized(){return this.initialized}async addNode(e){this.ensureInitialized();let t=v(),r={id:t,...e},s=C(r);return this.config.db.prepare(`
|
|
3
3
|
INSERT INTO hypergraph_nodes (id, type, name, file_path, line_start, line_end, complexity, coverage, metadata, embedding)
|
|
4
4
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
5
5
|
`).run(s.id,s.type,s.name,s.file_path,s.line_start,s.line_end,s.complexity,s.coverage,s.metadata,s.embedding),t}async addEdge(e){this.ensureInitialized();let t=x(e.sourceId,e.targetId,e.type),r={id:t,...e},s=M(r);return this.config.db.prepare(`
|