agentic-qe 3.9.32 → 3.9.34

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.
Files changed (333) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +120 -0
  3. package/assets/skills/skills-manifest.json +1 -1
  4. package/dist/cli/bundle.js +5 -5
  5. package/dist/cli/chunks/adapter-OXCJPHRI.js +2 -0
  6. package/dist/cli/chunks/{agent-booster-wasm-WKS3E6KT.js → agent-booster-wasm-UD3YB7FC.js} +2 -2
  7. package/dist/cli/chunks/{agent-handler-LYCAWE7S.js → agent-handler-BNBGQS6N.js} +2 -2
  8. package/dist/cli/chunks/{agent-memory-branch-XF7IOMRK.js → agent-memory-branch-NJHROVKY.js} +2 -2
  9. package/dist/cli/chunks/aqe-learning-engine-HDAC5FJJ.js +2 -0
  10. package/dist/cli/chunks/{audit-D2AY3HFP.js → audit-4Y7M2S2O.js} +2 -2
  11. package/dist/cli/chunks/base-JY364ZUA.js +2 -0
  12. package/dist/cli/chunks/{hnswlib-node-BWUH4OQT.js → better-sqlite3-4JUNP7IW.js} +2 -2
  13. package/dist/cli/chunks/{brain-handler-NNW4TAO2.js → brain-handler-VWRD34M6.js} +3 -3
  14. package/dist/cli/chunks/{branch-enumerator-OM5HNZKV.js → branch-enumerator-H4WLPOU3.js} +2 -2
  15. package/dist/cli/chunks/{browser-Y2FU2NV4.js → browser-Y7ZNFLEU.js} +2 -2
  16. package/dist/cli/chunks/browser-workflow-DAGIWFJE.js +2 -0
  17. package/dist/cli/chunks/{chunk-O5UGJ3OI.js → chunk-26BODPAN.js} +2 -2
  18. package/dist/cli/chunks/{chunk-OKEHGXIS.js → chunk-2C6LRXLU.js} +2 -2
  19. package/dist/cli/chunks/{chunk-WQ4MT74X.js → chunk-2MC2YH4J.js} +1 -1
  20. package/dist/cli/chunks/{chunk-M5PYPGBC.js → chunk-3K3QGBH7.js} +2 -2
  21. package/dist/cli/chunks/{chunk-5R5WOLZM.js → chunk-3OTG4IXK.js} +1 -1
  22. package/dist/cli/chunks/{chunk-PS6ISBED.js → chunk-3PRHEG4B.js} +2 -2
  23. package/dist/cli/chunks/{chunk-7PTW3M67.js → chunk-45SJSOSI.js} +2 -2
  24. package/dist/cli/chunks/{chunk-PPS6VN24.js → chunk-4AIJOXQJ.js} +1 -1
  25. package/dist/cli/chunks/{chunk-62UXGD5J.js → chunk-4FW4ZWPB.js} +5 -5
  26. package/dist/cli/chunks/{chunk-YVMJTBXB.js → chunk-4GHSIVTA.js} +3 -3
  27. package/dist/cli/chunks/{chunk-A6VI5BZU.js → chunk-4GSUSYZK.js} +4 -4
  28. package/dist/cli/chunks/{chunk-MEHNT37H.js → chunk-4JILSEZT.js} +2 -2
  29. package/dist/cli/chunks/{chunk-VKNCMGOJ.js → chunk-4K5KVC7R.js} +4 -4
  30. package/dist/cli/chunks/{chunk-HPQZSXED.js → chunk-4W2GGE4Z.js} +1 -1
  31. package/dist/cli/chunks/{chunk-EFEJLZDN.js → chunk-4YDLD5TW.js} +1 -1
  32. package/dist/cli/chunks/{chunk-PG5F2VHA.js → chunk-53Y6ZKPN.js} +2 -2
  33. package/dist/cli/chunks/{chunk-2L5GAOST.js → chunk-54HTQ3KQ.js} +2 -2
  34. package/dist/cli/chunks/{chunk-WTNM7NA4.js → chunk-5H44TVAY.js} +1 -1
  35. package/dist/cli/chunks/{chunk-3R4CMTWF.js → chunk-5Y3P6IAQ.js} +2 -2
  36. package/dist/cli/chunks/{chunk-XCUNQ3FK.js → chunk-67Y5HBMW.js} +2 -2
  37. package/dist/cli/chunks/{chunk-5XY6SULI.js → chunk-6FMMHW2R.js} +2 -2
  38. package/dist/cli/chunks/{chunk-XHQFVTFD.js → chunk-6FNPEC2I.js} +1 -1
  39. package/dist/cli/chunks/{chunk-A4UNK5SY.js → chunk-6UUNB4AW.js} +2 -2
  40. package/dist/cli/chunks/{chunk-VJL7DNUU.js → chunk-6XI7MNHH.js} +22 -16
  41. package/dist/cli/chunks/{chunk-SLH7LFVY.js → chunk-7AEFEPFH.js} +2 -2
  42. package/dist/cli/chunks/{chunk-ZIVOT3B7.js → chunk-7II46WAF.js} +2 -2
  43. package/dist/cli/chunks/chunk-7IUNZ653.js +9 -0
  44. package/dist/cli/chunks/{chunk-IGEZVFOM.js → chunk-7QTMWILQ.js} +2 -2
  45. package/dist/cli/chunks/{chunk-DFY7F4TE.js → chunk-7YM2AZXK.js} +1 -1
  46. package/dist/cli/chunks/{chunk-REW3W3ZW.js → chunk-7ZE5BXCN.js} +1 -1
  47. package/dist/cli/chunks/{chunk-FNQCWEVJ.js → chunk-A2FZAEIU.js} +2 -2
  48. package/dist/cli/chunks/{chunk-JDW6GN3A.js → chunk-AGHBG5E4.js} +2 -2
  49. package/dist/cli/chunks/{chunk-NW5FYGDE.js → chunk-AHEHD3AP.js} +2 -2
  50. package/dist/cli/chunks/{chunk-NZRJWK5H.js → chunk-AIQHS7D2.js} +9 -9
  51. package/dist/cli/chunks/{chunk-MIHQIAVK.js → chunk-ARKWPPBZ.js} +2 -2
  52. package/dist/cli/chunks/{chunk-7AISRWBS.js → chunk-AX7F6CNY.js} +2 -2
  53. package/dist/cli/chunks/{chunk-2Z2IQBIJ.js → chunk-AYLTFMTW.js} +1 -1
  54. package/dist/cli/chunks/{chunk-6EKXBWJD.js → chunk-BBULBXTO.js} +2 -2
  55. package/dist/cli/chunks/{chunk-BQML7B4W.js → chunk-BP45DZKL.js} +3 -3
  56. package/dist/cli/chunks/{chunk-PLGMPG7S.js → chunk-CKJGWNIS.js} +2 -2
  57. package/dist/cli/chunks/{chunk-Z2EDNMCQ.js → chunk-CWM5LSLQ.js} +2 -2
  58. package/dist/cli/chunks/{chunk-667I4RTC.js → chunk-DGEXLCOX.js} +1 -1
  59. package/dist/cli/chunks/{chunk-W3JB3G7C.js → chunk-DIX6AR2P.js} +2 -2
  60. package/dist/cli/chunks/{chunk-45N22VAB.js → chunk-DKA5WC6T.js} +2 -2
  61. package/dist/cli/chunks/chunk-DOKH4EJX.js +2 -0
  62. package/dist/cli/chunks/{chunk-ONNTJXU7.js → chunk-DXKZQYBK.js} +2 -2
  63. package/dist/cli/chunks/chunk-DXOFPU3A.js +2 -0
  64. package/dist/cli/chunks/{chunk-FWEYOD3S.js → chunk-E2IC6PHO.js} +2 -2
  65. package/dist/cli/chunks/{chunk-H7YKTJMY.js → chunk-EPETDHDV.js} +2 -2
  66. package/dist/cli/chunks/{chunk-G77CYF7H.js → chunk-EWVKCXV3.js} +3 -3
  67. package/dist/cli/chunks/{chunk-V6HM2BKJ.js → chunk-FAQSUNVC.js} +1 -1
  68. package/dist/cli/chunks/{chunk-JRYNHFZA.js → chunk-FCWQRUXQ.js} +1 -1
  69. package/dist/cli/chunks/{chunk-FFBF5BLQ.js → chunk-FW3EEASU.js} +1 -1
  70. package/dist/cli/chunks/{chunk-NVZHCAEB.js → chunk-GCMCU54O.js} +2 -2
  71. package/dist/cli/chunks/{chunk-OKRY4LNE.js → chunk-GW7T2ABB.js} +3 -3
  72. package/dist/cli/chunks/{chunk-KHZRNJ3A.js → chunk-GYJAPCP2.js} +1 -1
  73. package/dist/cli/chunks/{chunk-PQAYCK2U.js → chunk-HIZWO4J3.js} +2 -2
  74. package/dist/cli/chunks/{chunk-5WR42V5O.js → chunk-I74WDBHS.js} +2 -2
  75. package/dist/cli/chunks/{chunk-XB3SIYGU.js → chunk-IH5MVTLA.js} +2 -2
  76. package/dist/cli/chunks/{chunk-4VAZSCTZ.js → chunk-IPEUGCUK.js} +2 -2
  77. package/dist/cli/chunks/{chunk-6SYP7QX6.js → chunk-IPRUAUGV.js} +4 -4
  78. package/dist/cli/chunks/{chunk-I6Q6BPVH.js → chunk-IT7TOO52.js} +1 -1
  79. package/dist/cli/chunks/{chunk-ZESMMAKZ.js → chunk-IUZNVWCR.js} +2 -2
  80. package/dist/cli/chunks/{chunk-V7ZBPSVG.js → chunk-JFGKC6D4.js} +1 -1
  81. package/dist/cli/chunks/{chunk-PIXUX2NR.js → chunk-JH5HQ2HW.js} +2 -2
  82. package/dist/cli/chunks/{chunk-7IDPVSTF.js → chunk-JNLDMRUK.js} +1 -1
  83. package/dist/cli/chunks/{chunk-SRJ5N7LD.js → chunk-JNURLIOU.js} +2 -2
  84. package/dist/cli/chunks/{chunk-DBE2LIYG.js → chunk-JOOI3M6I.js} +2 -2
  85. package/dist/cli/chunks/{chunk-HR6NX6DW.js → chunk-JRCHYAB7.js} +2 -2
  86. package/dist/cli/chunks/{chunk-5DSANX6S.js → chunk-JZBBCQ7Y.js} +2 -2
  87. package/dist/cli/chunks/{chunk-3MHWBCSC.js → chunk-K5KL5MPG.js} +1 -1
  88. package/dist/cli/chunks/{chunk-G6VVOUUF.js → chunk-K7EU2KJF.js} +2 -2
  89. package/dist/cli/chunks/{chunk-PHRMWRXA.js → chunk-KN6QHR7J.js} +2 -2
  90. package/dist/cli/chunks/{chunk-S4M7U6CZ.js → chunk-L5W7KTBW.js} +2 -2
  91. package/dist/cli/chunks/{chunk-LTSNDM5N.js → chunk-LBKEWXMR.js} +2 -2
  92. package/dist/cli/chunks/{chunk-RZXAXWBD.js → chunk-LH372B74.js} +2 -2
  93. package/dist/cli/chunks/{chunk-W2VTHUDK.js → chunk-LIIG3F7K.js} +2 -2
  94. package/dist/cli/chunks/{chunk-MERMCKPG.js → chunk-LUU2O2AZ.js} +1 -1
  95. package/dist/cli/chunks/{chunk-EVSUZKD5.js → chunk-LYOAIGIT.js} +2 -2
  96. package/dist/cli/chunks/{chunk-5A6LBGRU.js → chunk-M6NSPXHR.js} +2 -2
  97. package/dist/cli/chunks/{chunk-IGQPGXP7.js → chunk-MIH7Y46H.js} +2 -2
  98. package/dist/cli/chunks/{chunk-ESNBKAT6.js → chunk-NKBLXHVM.js} +2 -2
  99. package/dist/cli/chunks/{chunk-6ZG6TBWF.js → chunk-O4DJLMRE.js} +4 -4
  100. package/dist/cli/chunks/{chunk-V5RLGPEW.js → chunk-P22YWOM2.js} +2 -2
  101. package/dist/cli/chunks/{chunk-OMOGD2NN.js → chunk-PMFV3ZFP.js} +2 -2
  102. package/dist/cli/chunks/{chunk-THYGFSTA.js → chunk-PYQ7VCH2.js} +13 -13
  103. package/dist/cli/chunks/{chunk-V7I6FTLG.js → chunk-QFBPVPYA.js} +1 -1
  104. package/dist/cli/chunks/{chunk-33PGBYTC.js → chunk-QPH72S4A.js} +2 -2
  105. package/dist/cli/chunks/{chunk-BBPOTFIY.js → chunk-QX74JLGO.js} +2 -2
  106. package/dist/cli/chunks/{chunk-YBUUAFKR.js → chunk-R7IYH6X2.js} +1 -1
  107. package/dist/cli/chunks/{chunk-6YGFAJ3X.js → chunk-RASEXZD3.js} +1 -1
  108. package/dist/cli/chunks/{chunk-YJV6TTCW.js → chunk-REVCXO2R.js} +2 -2
  109. package/dist/cli/chunks/{chunk-HHBFI3YA.js → chunk-RGQ2AOYV.js} +2 -2
  110. package/dist/cli/chunks/{chunk-O5NEZCTB.js → chunk-RJUWW4XE.js} +1 -1
  111. package/dist/cli/chunks/{chunk-MTOHV22P.js → chunk-RVG3DAU3.js} +1 -1
  112. package/dist/cli/chunks/{chunk-LI2IOJMM.js → chunk-RXQCDEDD.js} +1 -1
  113. package/dist/cli/chunks/{chunk-HGWQC7PR.js → chunk-RYFQYSVF.js} +2 -2
  114. package/dist/cli/chunks/{chunk-OPOGZAN5.js → chunk-S43X3HTH.js} +2 -2
  115. package/dist/cli/chunks/{chunk-YUSGT2CU.js → chunk-SLHE7BA3.js} +1 -1
  116. package/dist/cli/chunks/chunk-TH7BP4KG.js +2 -0
  117. package/dist/cli/chunks/{chunk-LR5VW3OS.js → chunk-TZFIBU6S.js} +2 -2
  118. package/dist/cli/chunks/{chunk-2XC4XVCI.js → chunk-UAKD7J72.js} +1 -1
  119. package/dist/cli/chunks/{chunk-UJMGNO6L.js → chunk-UCBDYSNE.js} +1 -1
  120. package/dist/cli/chunks/{chunk-4H4PEZUX.js → chunk-ULXDULD6.js} +2 -2
  121. package/dist/cli/chunks/{chunk-BGRC4676.js → chunk-UZZKBGGQ.js} +3 -3
  122. package/dist/cli/chunks/{chunk-SJETAUZA.js → chunk-VB2ZBN46.js} +1 -1
  123. package/dist/cli/chunks/{chunk-YUTSN5BK.js → chunk-VID5XDDQ.js} +2 -2
  124. package/dist/cli/chunks/{chunk-OK2TFTXP.js → chunk-VR65KHTH.js} +2 -2
  125. package/dist/cli/chunks/chunk-VSNLUVQI.js +15 -0
  126. package/dist/cli/chunks/{chunk-IJQJV7BC.js → chunk-WGEKHWCJ.js} +3 -3
  127. package/dist/cli/chunks/{chunk-BV3SGEV7.js → chunk-WGMA22FN.js} +1 -1
  128. package/dist/cli/chunks/{chunk-T5ADVYPH.js → chunk-WM6MDDHR.js} +1 -1
  129. package/dist/cli/chunks/{chunk-6R6QCGNU.js → chunk-WUDJA3B6.js} +2 -2
  130. package/dist/cli/chunks/{chunk-UUQ3SOKM.js → chunk-XK2IKEXP.js} +1 -1
  131. package/dist/cli/chunks/{chunk-TX2DBLTL.js → chunk-XLDGQJWP.js} +1 -1
  132. package/dist/cli/chunks/chunk-XM6CMEQK.js +2 -0
  133. package/dist/cli/chunks/chunk-XWD7QYS5.js +2 -0
  134. package/dist/cli/chunks/{chunk-QRTZ67BC.js → chunk-YG5HLQAB.js} +2 -2
  135. package/dist/cli/chunks/{chunk-MQQANXFS.js → chunk-YIVJD5IY.js} +2 -2
  136. package/dist/cli/chunks/{chunk-MMVSERJQ.js → chunk-Z6IQMLD7.js} +2 -2
  137. package/dist/cli/chunks/{chunk-LHDTXTS7.js → chunk-ZQZ4NYTM.js} +1 -1
  138. package/dist/cli/chunks/{chunk-BDXEL3GM.js → chunk-ZSOPY44S.js} +2 -2
  139. package/dist/cli/chunks/{chunk-RHXYZ6AZ.js → chunk-ZYF6F4MA.js} +145 -145
  140. package/dist/cli/chunks/{ci-NSF6OHB4.js → ci-SIPIBCBR.js} +2 -2
  141. package/dist/cli/chunks/{ci-output-ZPDJ42U3.js → ci-output-TDKJNSD4.js} +2 -2
  142. package/dist/cli/chunks/{circuit-breaker-Y2RUJDYG.js → circuit-breaker-4JC4THEE.js} +2 -2
  143. package/dist/cli/chunks/{claude-flow-setup-OH6G6KM2.js → claude-flow-setup-7LCBF65N.js} +2 -2
  144. package/dist/cli/chunks/client-N53TFCGN.js +2 -0
  145. package/dist/cli/chunks/{cline-installer-IHH4F27G.js → cline-installer-X3RPF536.js} +2 -2
  146. package/dist/cli/chunks/{code-SFAHWFTX.js → code-QWSERFVQ.js} +2 -2
  147. package/dist/cli/chunks/{code-index-extractor-GXECMOM2.js → code-index-extractor-B6C35JTM.js} +2 -2
  148. package/dist/cli/chunks/{codex-installer-UPMSAFCQ.js → codex-installer-A427S2HR.js} +2 -2
  149. package/dist/cli/chunks/{completions-5TX6LDHY.js → completions-77KS3LAM.js} +2 -2
  150. package/dist/cli/chunks/{complexity-analyzer-J2ZR3XZB.js → complexity-analyzer-SJUYVCGS.js} +2 -2
  151. package/dist/cli/chunks/{continuedev-installer-GWYZKB5A.js → continuedev-installer-HQMJQXFA.js} +2 -2
  152. package/dist/cli/chunks/{copilot-installer-DQZMQWI7.js → copilot-installer-JVWVXFRV.js} +2 -2
  153. package/dist/cli/chunks/{cost-tracker-V7KIGCLZ.js → cost-tracker-ATJWY2ZJ.js} +2 -2
  154. package/dist/cli/chunks/{coverage-3X6LA2GZ.js → coverage-OVUELXVF.js} +3 -3
  155. package/dist/cli/chunks/cross-domain-router-3TYSHECB.js +2 -0
  156. package/dist/cli/chunks/{cursor-installer-ENDG4JIU.js → cursor-installer-HMRQMVDC.js} +2 -2
  157. package/dist/cli/chunks/{daemon-4XVAO7GT.js → daemon-KSWTELMB.js} +3 -3
  158. package/dist/cli/chunks/{daemon-TC65CQFK.js → daemon-PJLXQV52.js} +4 -4
  159. package/dist/cli/chunks/{dag-attention-scheduler-JOSCDRZC.js → dag-attention-scheduler-U2ENVYTQ.js} +2 -2
  160. package/dist/cli/chunks/{detect-KWZX3OMK.js → detect-TMMIVPON.js} +2 -2
  161. package/dist/cli/chunks/{dist-node-R4U2PJ47.js → dist-node-ELGZENVQ.js} +2 -2
  162. package/dist/cli/chunks/{domain-handler-BMYYZO2L.js → domain-handler-XERZXZL6.js} +2 -2
  163. package/dist/cli/chunks/{domain-transfer-MSDBBDLC.js → domain-transfer-QRERMYSJ.js} +2 -2
  164. package/dist/cli/chunks/dream-EU6ZE7N7.js +2 -0
  165. package/dist/cli/chunks/{embed-and-insert-pattern-MFINPOLS.js → embed-and-insert-pattern-Q2PARYU4.js} +2 -2
  166. package/dist/cli/chunks/{eval-OER6UNUY.js → eval-A2QR6KW4.js} +2 -2
  167. package/dist/cli/chunks/{experience-capture-middleware-F5I77ECG.js → experience-capture-middleware-CQWPD3DM.js} +3 -3
  168. package/dist/cli/chunks/{fast-paths-P3KT5DUQ.js → fast-paths-IAOUZHSJ.js} +2 -2
  169. package/dist/cli/chunks/{feature-flags-DYFZSQLV.js → feature-flags-3D74EHP5.js} +2 -2
  170. package/dist/cli/chunks/{feature-flags-5EBWQ5WU.js → feature-flags-CODLAMZU.js} +2 -2
  171. package/dist/cli/chunks/{file-discovery-MOBVABSM.js → file-discovery-ZUBZH4Q6.js} +2 -2
  172. package/dist/cli/chunks/{fleet-J3R3NQNC.js → fleet-TTADPVN2.js} +3 -3
  173. package/dist/cli/chunks/{gnn-wrapper-QD76SULF.js → gnn-wrapper-ZFDW3ZAW.js} +2 -2
  174. package/dist/cli/chunks/{heartbeat-handler-AJEWTPZ4.js → heartbeat-handler-IV67NVZW.js} +4 -4
  175. package/dist/cli/chunks/heartbeat-scheduler-JN775DB4.js +2 -0
  176. package/dist/cli/chunks/hnsw-adapter-PHMYMEDW.js +2 -0
  177. package/dist/cli/chunks/hnsw-index-BS65TOXD.js +2 -0
  178. package/dist/cli/chunks/{hnsw-legacy-bridge-5VRM5N7K.js → hnsw-legacy-bridge-GMFHJ4OK.js} +2 -2
  179. package/dist/cli/chunks/{better-sqlite3-K2VWFDKT.js → hnswlib-node-3LBUPOTX.js} +2 -2
  180. package/dist/cli/chunks/{hooks-7PMVKQOE.js → hooks-DOGCENUA.js} +34 -34
  181. package/dist/cli/chunks/{hybrid-router-2K2LW45J.js → hybrid-router-LQO3U6IH.js} +2 -2
  182. package/dist/cli/chunks/{hypergraph-engine-2CQ735JO.js → hypergraph-engine-KHKAUWVL.js} +2 -2
  183. package/dist/cli/chunks/{hypergraph-handler-AQ53GVIW.js → hypergraph-handler-T6X4F24T.js} +3 -3
  184. package/dist/cli/chunks/impact-analyzer-BR25PT76.js +2 -0
  185. package/dist/cli/chunks/{init-handler-ZOVJPAWO.js → init-handler-JTXMI2GF.js} +13 -12
  186. package/dist/cli/chunks/init-wizard-42IYSTTD.js +2 -0
  187. package/dist/cli/chunks/kernel-JFSTL7NN.js +2 -0
  188. package/dist/cli/chunks/{kilocode-installer-GWQCNLKI.js → kilocode-installer-P2WDAIOD.js} +2 -2
  189. package/dist/cli/chunks/{kiro-installer-6KVES4MO.js → kiro-installer-CLTOWLVB.js} +2 -2
  190. package/dist/cli/chunks/knowledge-graph-JYRFHKO2.js +2 -0
  191. package/dist/cli/chunks/{learning-6XMNWXRT.js → learning-CNDBY3JP.js} +3 -3
  192. package/dist/cli/chunks/{llm-router-GS4AZJJC.js → llm-router-SJOZ6EIJ.js} +4 -4
  193. package/dist/cli/chunks/load-GXZWRYTU.js +2 -0
  194. package/dist/cli/chunks/load-test-K7XFH5AD.js +2 -0
  195. package/dist/cli/chunks/{mcp-6V2H7EXU.js → mcp-LLMLANLC.js} +2 -2
  196. package/dist/cli/chunks/{memory-YLGPOB2H.js → memory-MEBFXR4C.js} +5 -5
  197. package/dist/cli/chunks/memory-backend-5O4Y5PKW.js +2 -0
  198. package/dist/cli/chunks/memory-handlers-46WKVXKK.js +2 -0
  199. package/dist/cli/chunks/{multi-model-executor-SL2EKAH2.js → multi-model-executor-ZO35ZPDR.js} +2 -2
  200. package/dist/cli/chunks/{opencode-installer-ADOJVGNA.js → opencode-installer-EG2MFPDZ.js} +2 -2
  201. package/dist/cli/chunks/{orchestrator-O4IWW2VU.js → orchestrator-PXA5IT5X.js} +5 -5
  202. package/dist/cli/chunks/{pipeline-5BD5YQNQ.js → pipeline-T3XOEAKT.js} +2 -2
  203. package/dist/cli/chunks/{platform-HXSUOOJH.js → platform-CPKBJ4I6.js} +2 -2
  204. package/dist/cli/chunks/{plugin-HOLH5CUH.js → plugin-YDP2IK3D.js} +2 -2
  205. package/dist/cli/chunks/{prime-radiant-advanced-wasm-PJTL7OLS.js → prime-radiant-advanced-wasm-GDN5WBH2.js} +2 -2
  206. package/dist/cli/chunks/protocol-executor-VACEWXHI.js +2 -0
  207. package/dist/cli/chunks/{protocol-handler-K27YGLC7.js → protocol-handler-32QLWTY3.js} +2 -2
  208. package/dist/cli/chunks/{prove-MHCLHQQ6.js → prove-7JFRIBOM.js} +2 -2
  209. package/dist/cli/chunks/{provider-manager-3645PPXX.js → provider-manager-TNR7QM6Z.js} +2 -2
  210. package/dist/cli/chunks/qe-reasoning-bank-4A5MKOA5.js +2 -0
  211. package/dist/cli/chunks/{quality-NDE6EDOY.js → quality-G36Z4FD3.js} +2 -2
  212. package/dist/cli/chunks/queen-coordinator-FF3W2BLZ.js +2 -0
  213. package/dist/cli/chunks/{real-embeddings-VD3EVV3U.js → real-embeddings-RYVIB5N2.js} +2 -2
  214. package/dist/cli/chunks/{roocode-installer-63Y45UUG.js → roocode-installer-ZANTFQAH.js} +2 -2
  215. package/dist/cli/chunks/router-OTSEMLFG.js +2 -0
  216. package/dist/cli/chunks/routing-feedback-PHWP7EO3.js +2 -0
  217. package/dist/cli/chunks/{routing-handler-76XISU2E.js → routing-handler-6YNDHLBC.js} +2 -2
  218. package/dist/cli/chunks/{ruvector-commands-AEKOZZHZ.js → ruvector-commands-E42JA573.js} +2 -2
  219. package/dist/cli/chunks/{rvf-dual-writer-4DMUIZQF.js → rvf-dual-writer-SQDEXP45.js} +2 -2
  220. package/dist/cli/chunks/{rvf-migration-adapter-YUTXFOZ3.js → rvf-migration-adapter-DMI4QBRX.js} +2 -2
  221. package/dist/cli/chunks/{rvf-migration-coordinator-XJ5N2W37.js → rvf-migration-coordinator-AUEOD5MP.js} +2 -2
  222. package/dist/cli/chunks/rvf-native-adapter-E4XSLZPD.js +2 -0
  223. package/dist/cli/chunks/safe-db-ESTCAWF2.js +2 -0
  224. package/dist/cli/chunks/schedule-VJYEPFI4.js +2 -0
  225. package/dist/cli/chunks/scheduler-2SVKVACS.js +2 -0
  226. package/dist/cli/chunks/{security-6YS6GQGO.js → security-BJTKEGXZ.js} +3 -3
  227. package/dist/cli/chunks/shared-rvf-adapter-RWX6AAVO.js +2 -0
  228. package/dist/cli/chunks/{shared-rvf-dual-writer-MH2Y65HA.js → shared-rvf-dual-writer-PIZFXKKE.js} +2 -2
  229. package/dist/cli/chunks/sqlite-persistence-KGN5AIVX.js +2 -0
  230. package/dist/cli/chunks/{status-handler-57JQMPY5.js → status-handler-BSQJAFH2.js} +2 -2
  231. package/dist/cli/chunks/{structural-health-34D5VWRD.js → structural-health-ZL4KQNQX.js} +2 -2
  232. package/dist/cli/chunks/{sync-TTQ6ZB5D.js → sync-BM32HBUY.js} +2 -2
  233. package/dist/cli/chunks/{sync-HJD2US5P.js → sync-KH3IIPKB.js} +2 -2
  234. package/dist/cli/chunks/{task-handler-4RF57637.js → task-handler-SWMZVIZ5.js} +2 -2
  235. package/dist/cli/chunks/{task-handlers-BRSK7HDE.js → task-handlers-PJD6QWQP.js} +3 -3
  236. package/dist/cli/chunks/{test-GMUW2VR3.js → test-ACQ2N7AK.js} +4 -4
  237. package/dist/cli/chunks/{test-scheduling-7LF24IFV.js → test-scheduling-BCSHQHZO.js} +3 -3
  238. package/dist/cli/chunks/{token-bootstrap-VYT4RTHU.js → token-bootstrap-7DAATWOU.js} +2 -2
  239. package/dist/cli/chunks/{token-usage-NFNCPQGW.js → token-usage-AYPCJN77.js} +2 -2
  240. package/dist/cli/chunks/{transformers-GGD5GIEY.js → transformers-ZYSRJRXA.js} +2 -2
  241. package/dist/cli/chunks/tree-sitter-wasm-parser-HXHBILDS.js +2 -0
  242. package/dist/cli/chunks/{types-WJ3ZTRD5.js → types-O5ODR3WQ.js} +2 -2
  243. package/dist/cli/chunks/unified-memory-UBGLIO43.js +2 -0
  244. package/dist/cli/chunks/unified-memory-hnsw-BJMFYCFZ.js +2 -0
  245. package/dist/cli/chunks/unified-persistence-Q54OKOYY.js +2 -0
  246. package/dist/cli/chunks/{upgrade-IMBT4F6K.js → upgrade-ULP5J35D.js} +2 -2
  247. package/dist/cli/chunks/{validate-76OVF45Z.js → validate-JS6WD4S5.js} +2 -2
  248. package/dist/cli/chunks/{validate-swarm-HH2ZYWXA.js → validate-swarm-NCO5QBTJ.js} +2 -2
  249. package/dist/cli/chunks/{vibium-74WQNDBX.js → vibium-RGRUK6EW.js} +2 -2
  250. package/dist/cli/chunks/visual-security-RRVHQBRP.js +2 -0
  251. package/dist/cli/chunks/{web-tree-sitter-W6RGE4SL.js → web-tree-sitter-NGX5C2HB.js} +2 -2
  252. package/dist/cli/chunks/{windsurf-installer-7DMSFCA2.js → windsurf-installer-KRAE3JB2.js} +2 -2
  253. package/dist/cli/chunks/witness-chain-2YIUBXAF.js +2 -0
  254. package/dist/cli/chunks/{witness-chain-BLZ4ZKAD.js → witness-chain-62V6YLTM.js} +2 -2
  255. package/dist/cli/chunks/{workflow-RNSDKRZ4.js → workflow-BVMZE2FE.js} +4 -4
  256. package/dist/cli/chunks/workflow-orchestrator-VGNC5PFE.js +2 -0
  257. package/dist/cli/chunks/{wrappers-J7RXMIOY.js → wrappers-SEDAPKCG.js} +2 -2
  258. package/dist/cli/commands/hooks-handlers/hooks-shared.js +12 -21
  259. package/dist/cli/handlers/init-handler.js +47 -0
  260. package/dist/domains/learning-optimization/coordinator-helpers.js +7 -1
  261. package/dist/domains/learning-optimization/coordinator.js +5 -1
  262. package/dist/domains/learning-optimization/services/learning-coordinator.js +6 -1
  263. package/dist/domains/learning-optimization/services/metrics-optimizer.js +4 -1
  264. package/dist/domains/learning-optimization/services/production-intel.js +14 -5
  265. package/dist/domains/learning-optimization/services/transfer-specialist.js +12 -4
  266. package/dist/integrations/embeddings/base/EmbeddingGenerator.d.ts +1 -1
  267. package/dist/integrations/embeddings/base/EmbeddingGenerator.js +14 -5
  268. package/dist/integrations/ruvector/rvf-dual-writer.d.ts +22 -0
  269. package/dist/integrations/ruvector/rvf-dual-writer.js +21 -0
  270. package/dist/integrations/ruvector/rvf-native-adapter.d.ts +18 -1
  271. package/dist/integrations/ruvector/rvf-native-adapter.js +15 -1
  272. package/dist/integrations/ruvector/shared-rvf-adapter.d.ts +46 -1
  273. package/dist/integrations/ruvector/shared-rvf-adapter.js +137 -0
  274. package/dist/kernel/hybrid-backend.d.ts +14 -3
  275. package/dist/kernel/hybrid-backend.js +16 -3
  276. package/dist/kernel/unified-memory.d.ts +3 -1
  277. package/dist/kernel/unified-memory.js +28 -3
  278. package/dist/learning/dream/dream-scheduler.d.ts +18 -0
  279. package/dist/learning/dream/dream-scheduler.js +68 -0
  280. package/dist/learning/qe-reasoning-bank.js +19 -2
  281. package/dist/learning/real-embeddings.js +1 -1
  282. package/dist/learning/sqlite-persistence.d.ts +11 -0
  283. package/dist/learning/sqlite-persistence.js +30 -0
  284. package/dist/mcp/bundle.js +404 -398
  285. package/dist/shared/parsers/tree-sitter-wasm-parser.js +8 -3
  286. package/dist/shared/utils/index.d.ts +1 -0
  287. package/dist/shared/utils/index.js +1 -0
  288. package/dist/shared/utils/kv-date-rehydrate.d.ts +51 -0
  289. package/dist/shared/utils/kv-date-rehydrate.js +78 -0
  290. package/dist/workers/workers/learning-consolidation.js +7 -1
  291. package/package.json +21 -10
  292. package/dist/cli/chunks/adapter-CDQOF5TF.js +0 -2
  293. package/dist/cli/chunks/aqe-learning-engine-RZK22CJB.js +0 -2
  294. package/dist/cli/chunks/base-UGH6TVO4.js +0 -2
  295. package/dist/cli/chunks/browser-workflow-SGOL3FCJ.js +0 -2
  296. package/dist/cli/chunks/chunk-FIONYUVH.js +0 -2
  297. package/dist/cli/chunks/chunk-FV2MU6CY.js +0 -2
  298. package/dist/cli/chunks/chunk-G6AJMFWL.js +0 -15
  299. package/dist/cli/chunks/chunk-QPYNQSWD.js +0 -9
  300. package/dist/cli/chunks/chunk-VKCWWR6C.js +0 -2
  301. package/dist/cli/chunks/chunk-YVQ4PR4H.js +0 -2
  302. package/dist/cli/chunks/client-QQGRKAY7.js +0 -2
  303. package/dist/cli/chunks/cross-domain-router-3SHAGRVP.js +0 -2
  304. package/dist/cli/chunks/dream-OCZK42FM.js +0 -2
  305. package/dist/cli/chunks/heartbeat-scheduler-EAVZR6TJ.js +0 -2
  306. package/dist/cli/chunks/hnsw-adapter-BY4XB7FB.js +0 -2
  307. package/dist/cli/chunks/hnsw-index-657CZRG7.js +0 -2
  308. package/dist/cli/chunks/impact-analyzer-GI6UVAMT.js +0 -2
  309. package/dist/cli/chunks/init-wizard-HOH577MH.js +0 -2
  310. package/dist/cli/chunks/kernel-JDYBG5GE.js +0 -2
  311. package/dist/cli/chunks/knowledge-graph-RAQOWLG3.js +0 -2
  312. package/dist/cli/chunks/load-FEMEQNE6.js +0 -2
  313. package/dist/cli/chunks/load-test-3MEJ43U2.js +0 -2
  314. package/dist/cli/chunks/memory-backend-2A47ZRGO.js +0 -2
  315. package/dist/cli/chunks/memory-handlers-UBTBC7D2.js +0 -2
  316. package/dist/cli/chunks/protocol-executor-3FR7FBVM.js +0 -2
  317. package/dist/cli/chunks/qe-reasoning-bank-CHNYPYQW.js +0 -2
  318. package/dist/cli/chunks/queen-coordinator-J6ZRYTBX.js +0 -2
  319. package/dist/cli/chunks/router-23HRN2Z6.js +0 -2
  320. package/dist/cli/chunks/routing-feedback-R6A4B6ZG.js +0 -2
  321. package/dist/cli/chunks/rvf-native-adapter-QINEJZM7.js +0 -2
  322. package/dist/cli/chunks/safe-db-YXMCSKFH.js +0 -2
  323. package/dist/cli/chunks/schedule-XVFD27P5.js +0 -2
  324. package/dist/cli/chunks/scheduler-NWH2IDEU.js +0 -2
  325. package/dist/cli/chunks/shared-rvf-adapter-FTZY35WI.js +0 -2
  326. package/dist/cli/chunks/sqlite-persistence-BR6YJF5P.js +0 -2
  327. package/dist/cli/chunks/tree-sitter-wasm-parser-GKYG6NKT.js +0 -2
  328. package/dist/cli/chunks/unified-memory-AT3Z4CY7.js +0 -2
  329. package/dist/cli/chunks/unified-memory-hnsw-6FOIGINN.js +0 -2
  330. package/dist/cli/chunks/unified-persistence-TCJB7MQS.js +0 -2
  331. package/dist/cli/chunks/visual-security-IBAUX2K5.js +0 -2
  332. package/dist/cli/chunks/witness-chain-GNNF23XU.js +0 -2
  333. package/dist/cli/chunks/workflow-orchestrator-S2YONHGM.js +0 -2
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.32");process.exit(0)}
2
- import{a as g}from"./chunk-NW5FYGDE.js";import{b as p,c}from"./chunk-EFEJLZDN.js";import{a as x,b as f,c as w}from"./chunk-5WR42V5O.js";import{i as v}from"./chunk-WTNM7NA4.js";w();var l={ProtocolStarted:"coordination.ProtocolStarted",ProtocolCompleted:"coordination.ProtocolCompleted",ProtocolFailed:"coordination.ProtocolFailed",ProtocolCancelled:"coordination.ProtocolCancelled",ActionStarted:"coordination.ActionStarted",ActionCompleted:"coordination.ActionCompleted",ActionFailed:"coordination.ActionFailed"},E=class{constructor(e,t,o){this.eventBus=e;this.memory=t;this.getDomainAPI=o}eventBus;memory;getDomainAPI;protocols=new Map;executions=new Map;scheduledProtocols=new Map;schedulerRunning=!1;registerProtocol(e){this.protocols.set(e.id,e),e.schedule.type==="event"&&e.enabled&&this.setupEventTriggers(e),(e.schedule.type==="cron"||e.schedule.type==="interval")&&e.enabled&&this.scheduleProtocol(e)}unregisterProtocol(e){if(!this.protocols.get(e))return!1;let o=this.scheduledProtocols.get(e);return o?.intervalId&&clearInterval(o.intervalId),this.scheduledProtocols.delete(e),this.protocols.delete(e),!0}getProtocol(e){return this.protocols.get(e)}listProtocols(){return Array.from(this.protocols.values())}async execute(e,t){let o=this.protocols.get(e);return o?o.enabled?this.executeProtocol(o,t):c(new Error(`Protocol is disabled: ${e}`)):c(new Error(`Protocol not found: ${e}`))}async executeOnEvent(e,t){let o=this.protocols.get(e);return o?o.enabled?this.executeProtocol(o,void 0,t):c(new Error(`Protocol is disabled: ${e}`)):c(new Error(`Protocol not found: ${e}`))}getExecution(e){let t=this.executions.get(e);if(t)return this.toImmutableExecution(t.execution)}listActiveExecutions(){return Array.from(this.executions.values()).filter(e=>e.execution.status==="running"||e.execution.status==="paused").map(e=>this.toImmutableExecution(e.execution))}async cancelExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="running"&&t.execution.status!=="paused"?c(new Error(`Cannot cancel execution in status: ${t.execution.status}`)):(t.cancelled=!0,t.execution.status="cancelled",t.execution.completedAt=new Date,await this.publishEvent(l.ProtocolCancelled,{executionId:e,protocolId:t.protocol.id}),p(void 0)):c(new Error(`Execution not found: ${e}`))}async pauseExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="running"?c(new Error(`Cannot pause execution in status: ${t.execution.status}`)):(t.paused=!0,t.execution.status="paused",p(void 0)):c(new Error(`Execution not found: ${e}`))}async resumeExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="paused"?c(new Error(`Cannot resume execution in status: ${t.execution.status}`)):(t.paused=!1,t.execution.status="running",p(void 0)):c(new Error(`Execution not found: ${e}`))}startScheduler(){if(!this.schedulerRunning){this.schedulerRunning=!0;for(let e of this.protocols.values())e.enabled&&(e.schedule.type==="interval"||e.schedule.type==="cron")&&this.scheduleProtocol(e)}}stopScheduler(){this.schedulerRunning=!1;for(let e of this.scheduledProtocols.values())e.intervalId&&(clearInterval(e.intervalId),e.intervalId=void 0)}async dispose(){this.stopScheduler(),this.protocols.clear(),this.executions.clear(),this.scheduledProtocols.clear()}async executeProtocol(e,t,o){let r=v(),a=o?.correlationId??r,n={executionId:r,protocolId:e.id,status:"running",participants:[...e.participants],results:new Map,startedAt:new Date,correlationId:a,triggeredBy:o},u={execution:n,protocol:e,params:t,actionResults:new Map,cancelled:!1,paused:!1};this.executions.set(r,u),await this.publishEvent(l.ProtocolStarted,{executionId:r,protocolId:e.id,participants:e.participants},a);try{await this.executeActions(u);let i=Array.from(u.actionResults.values()).some(s=>s.status==="failed");return u.cancelled?n.status="cancelled":i?(n.status="failed",await this.publishEvent(l.ProtocolFailed,{executionId:r,protocolId:e.id,failedActions:Array.from(u.actionResults.values()).filter(s=>s.status==="failed").map(s=>s.actionId)},a)):(n.status="completed",await this.publishEvent(l.ProtocolCompleted,{executionId:r,protocolId:e.id,duration:Date.now()-n.startedAt.getTime()},a)),n.completedAt=new Date,n.results=u.actionResults,await this.storeExecutionHistory(n),p(this.toImmutableExecution(n))}catch(i){return n.status="failed",n.completedAt=new Date,await this.publishEvent(l.ProtocolFailed,{executionId:r,protocolId:e.id,error:x(i)},a),c(f(i))}}async executeActions(e){let{protocol:t,actionResults:o}=e,r=new Set(t.actions.map(n=>n.id)),a=new Set;for(;r.size>0&&!e.cancelled;){for(;e.paused&&!e.cancelled;)await this.sleep(100);if(e.cancelled)break;let n=t.actions.filter(i=>r.has(i.id)&&this.dependenciesSatisfied(i,a));if(n.length===0&&r.size>0)throw new Error(`Deadlock detected: actions ${Array.from(r).join(", ")} cannot proceed`);let u=await Promise.allSettled(n.map(i=>this.executeAction(i,e)));for(let i=0;i<n.length;i++){let s=n[i],d=u[i],m;d.status==="fulfilled"?m=d.value:m={actionId:s.id,status:"failed",error:d.reason instanceof Error?d.reason.message:String(d.reason)},o.set(s.id,m),r.delete(s.id),m.status==="completed"&&a.add(s.id)}}for(let n of r)o.set(n,{actionId:n,status:e.cancelled?"cancelled":"skipped"})}async executeAction(e,t){let o=new Date;await this.publishEvent(l.ActionStarted,{executionId:t.execution.executionId,actionId:e.id,actionName:e.name,targetDomain:e.targetDomain},t.execution.correlationId);let r=0,a=e.retry?.maxAttempts??1,n;for(;r<a;){r++;try{let i=this.getDomainAPI(e.targetDomain);if(!i)throw new Error(`Domain API not available: ${e.targetDomain}`);let s=i[e.method];if(typeof s!="function")throw new Error(`Method ${e.method} not found on domain ${e.targetDomain}`);let d={...e.params,...t.params},m=await this.executeWithTimeout(s.bind(i)(d),e.timeout??3e4),h=new Date;return await this.publishEvent(l.ActionCompleted,{executionId:t.execution.executionId,actionId:e.id,duration:h.getTime()-o.getTime()},t.execution.correlationId),{actionId:e.id,status:"completed",startedAt:o,completedAt:h,duration:h.getTime()-o.getTime(),result:m,retryAttempts:r>1?r-1:void 0}}catch(i){if(n=f(i),r<a&&e.retry){let s=e.retry.backoffMs*Math.pow(e.retry.backoffMultiplier??2,r-1);await this.sleep(s)}}}let u=new Date;return await this.publishEvent(l.ActionFailed,{executionId:t.execution.executionId,actionId:e.id,error:n?.message??"Unknown error",attempts:r},t.execution.correlationId),{actionId:e.id,status:"failed",startedAt:o,completedAt:u,duration:u.getTime()-o.getTime(),error:n?.message??"Unknown error",retryAttempts:r>1?r-1:void 0}}dependenciesSatisfied(e,t){return!e.dependsOn||e.dependsOn.length===0?!0:e.dependsOn.every(o=>t.has(o))}async executeWithTimeout(e,t){return Promise.race([e,new Promise((o,r)=>setTimeout(()=>r(new Error("Action timeout")),t))])}setupEventTriggers(e){if(e.schedule.type==="event")for(let t of e.schedule.triggerEvents)this.eventBus.subscribe(t,async o=>{await this.executeOnEvent(e.id,o)})}scheduleProtocol(e){if(e.schedule.type==="interval"){let t={protocolId:e.id,schedule:e.schedule};t.intervalId=setInterval(async()=>{this.schedulerRunning&&await this.execute(e.id)},e.schedule.intervalMs),this.scheduledProtocols.set(e.id,t)}}async storeExecutionHistory(e){let t=`protocol-execution:${e.executionId}`;await this.memory.set(t,{...e,results:Object.fromEntries(e.results)},{namespace:"coordination",ttl:864e5})}toImmutableExecution(e){return{executionId:e.executionId,protocolId:e.protocolId,status:e.status,participants:[...e.participants],results:new Map(e.results),startedAt:e.startedAt,completedAt:e.completedAt,correlationId:e.correlationId,triggeredBy:e.triggeredBy}}async publishEvent(e,t,o){let r=g(e,"learning-optimization",t,o);await this.eventBus.publish(r)}sleep(e){return new Promise(t=>setTimeout(t,e))}};function S(P,e,t){return new E(P,e,t)}export{E as a,S as b};
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.34");process.exit(0)}
2
+ import{a as g}from"./chunk-AHEHD3AP.js";import{b as p,c}from"./chunk-4YDLD5TW.js";import{a as x,b as f,c as w}from"./chunk-I74WDBHS.js";import{i as v}from"./chunk-5H44TVAY.js";w();var l={ProtocolStarted:"coordination.ProtocolStarted",ProtocolCompleted:"coordination.ProtocolCompleted",ProtocolFailed:"coordination.ProtocolFailed",ProtocolCancelled:"coordination.ProtocolCancelled",ActionStarted:"coordination.ActionStarted",ActionCompleted:"coordination.ActionCompleted",ActionFailed:"coordination.ActionFailed"},E=class{constructor(e,t,o){this.eventBus=e;this.memory=t;this.getDomainAPI=o}eventBus;memory;getDomainAPI;protocols=new Map;executions=new Map;scheduledProtocols=new Map;schedulerRunning=!1;registerProtocol(e){this.protocols.set(e.id,e),e.schedule.type==="event"&&e.enabled&&this.setupEventTriggers(e),(e.schedule.type==="cron"||e.schedule.type==="interval")&&e.enabled&&this.scheduleProtocol(e)}unregisterProtocol(e){if(!this.protocols.get(e))return!1;let o=this.scheduledProtocols.get(e);return o?.intervalId&&clearInterval(o.intervalId),this.scheduledProtocols.delete(e),this.protocols.delete(e),!0}getProtocol(e){return this.protocols.get(e)}listProtocols(){return Array.from(this.protocols.values())}async execute(e,t){let o=this.protocols.get(e);return o?o.enabled?this.executeProtocol(o,t):c(new Error(`Protocol is disabled: ${e}`)):c(new Error(`Protocol not found: ${e}`))}async executeOnEvent(e,t){let o=this.protocols.get(e);return o?o.enabled?this.executeProtocol(o,void 0,t):c(new Error(`Protocol is disabled: ${e}`)):c(new Error(`Protocol not found: ${e}`))}getExecution(e){let t=this.executions.get(e);if(t)return this.toImmutableExecution(t.execution)}listActiveExecutions(){return Array.from(this.executions.values()).filter(e=>e.execution.status==="running"||e.execution.status==="paused").map(e=>this.toImmutableExecution(e.execution))}async cancelExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="running"&&t.execution.status!=="paused"?c(new Error(`Cannot cancel execution in status: ${t.execution.status}`)):(t.cancelled=!0,t.execution.status="cancelled",t.execution.completedAt=new Date,await this.publishEvent(l.ProtocolCancelled,{executionId:e,protocolId:t.protocol.id}),p(void 0)):c(new Error(`Execution not found: ${e}`))}async pauseExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="running"?c(new Error(`Cannot pause execution in status: ${t.execution.status}`)):(t.paused=!0,t.execution.status="paused",p(void 0)):c(new Error(`Execution not found: ${e}`))}async resumeExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="paused"?c(new Error(`Cannot resume execution in status: ${t.execution.status}`)):(t.paused=!1,t.execution.status="running",p(void 0)):c(new Error(`Execution not found: ${e}`))}startScheduler(){if(!this.schedulerRunning){this.schedulerRunning=!0;for(let e of this.protocols.values())e.enabled&&(e.schedule.type==="interval"||e.schedule.type==="cron")&&this.scheduleProtocol(e)}}stopScheduler(){this.schedulerRunning=!1;for(let e of this.scheduledProtocols.values())e.intervalId&&(clearInterval(e.intervalId),e.intervalId=void 0)}async dispose(){this.stopScheduler(),this.protocols.clear(),this.executions.clear(),this.scheduledProtocols.clear()}async executeProtocol(e,t,o){let r=v(),a=o?.correlationId??r,n={executionId:r,protocolId:e.id,status:"running",participants:[...e.participants],results:new Map,startedAt:new Date,correlationId:a,triggeredBy:o},u={execution:n,protocol:e,params:t,actionResults:new Map,cancelled:!1,paused:!1};this.executions.set(r,u),await this.publishEvent(l.ProtocolStarted,{executionId:r,protocolId:e.id,participants:e.participants},a);try{await this.executeActions(u);let i=Array.from(u.actionResults.values()).some(s=>s.status==="failed");return u.cancelled?n.status="cancelled":i?(n.status="failed",await this.publishEvent(l.ProtocolFailed,{executionId:r,protocolId:e.id,failedActions:Array.from(u.actionResults.values()).filter(s=>s.status==="failed").map(s=>s.actionId)},a)):(n.status="completed",await this.publishEvent(l.ProtocolCompleted,{executionId:r,protocolId:e.id,duration:Date.now()-n.startedAt.getTime()},a)),n.completedAt=new Date,n.results=u.actionResults,await this.storeExecutionHistory(n),p(this.toImmutableExecution(n))}catch(i){return n.status="failed",n.completedAt=new Date,await this.publishEvent(l.ProtocolFailed,{executionId:r,protocolId:e.id,error:x(i)},a),c(f(i))}}async executeActions(e){let{protocol:t,actionResults:o}=e,r=new Set(t.actions.map(n=>n.id)),a=new Set;for(;r.size>0&&!e.cancelled;){for(;e.paused&&!e.cancelled;)await this.sleep(100);if(e.cancelled)break;let n=t.actions.filter(i=>r.has(i.id)&&this.dependenciesSatisfied(i,a));if(n.length===0&&r.size>0)throw new Error(`Deadlock detected: actions ${Array.from(r).join(", ")} cannot proceed`);let u=await Promise.allSettled(n.map(i=>this.executeAction(i,e)));for(let i=0;i<n.length;i++){let s=n[i],d=u[i],m;d.status==="fulfilled"?m=d.value:m={actionId:s.id,status:"failed",error:d.reason instanceof Error?d.reason.message:String(d.reason)},o.set(s.id,m),r.delete(s.id),m.status==="completed"&&a.add(s.id)}}for(let n of r)o.set(n,{actionId:n,status:e.cancelled?"cancelled":"skipped"})}async executeAction(e,t){let o=new Date;await this.publishEvent(l.ActionStarted,{executionId:t.execution.executionId,actionId:e.id,actionName:e.name,targetDomain:e.targetDomain},t.execution.correlationId);let r=0,a=e.retry?.maxAttempts??1,n;for(;r<a;){r++;try{let i=this.getDomainAPI(e.targetDomain);if(!i)throw new Error(`Domain API not available: ${e.targetDomain}`);let s=i[e.method];if(typeof s!="function")throw new Error(`Method ${e.method} not found on domain ${e.targetDomain}`);let d={...e.params,...t.params},m=await this.executeWithTimeout(s.bind(i)(d),e.timeout??3e4),h=new Date;return await this.publishEvent(l.ActionCompleted,{executionId:t.execution.executionId,actionId:e.id,duration:h.getTime()-o.getTime()},t.execution.correlationId),{actionId:e.id,status:"completed",startedAt:o,completedAt:h,duration:h.getTime()-o.getTime(),result:m,retryAttempts:r>1?r-1:void 0}}catch(i){if(n=f(i),r<a&&e.retry){let s=e.retry.backoffMs*Math.pow(e.retry.backoffMultiplier??2,r-1);await this.sleep(s)}}}let u=new Date;return await this.publishEvent(l.ActionFailed,{executionId:t.execution.executionId,actionId:e.id,error:n?.message??"Unknown error",attempts:r},t.execution.correlationId),{actionId:e.id,status:"failed",startedAt:o,completedAt:u,duration:u.getTime()-o.getTime(),error:n?.message??"Unknown error",retryAttempts:r>1?r-1:void 0}}dependenciesSatisfied(e,t){return!e.dependsOn||e.dependsOn.length===0?!0:e.dependsOn.every(o=>t.has(o))}async executeWithTimeout(e,t){return Promise.race([e,new Promise((o,r)=>setTimeout(()=>r(new Error("Action timeout")),t))])}setupEventTriggers(e){if(e.schedule.type==="event")for(let t of e.schedule.triggerEvents)this.eventBus.subscribe(t,async o=>{await this.executeOnEvent(e.id,o)})}scheduleProtocol(e){if(e.schedule.type==="interval"){let t={protocolId:e.id,schedule:e.schedule};t.intervalId=setInterval(async()=>{this.schedulerRunning&&await this.execute(e.id)},e.schedule.intervalMs),this.scheduledProtocols.set(e.id,t)}}async storeExecutionHistory(e){let t=`protocol-execution:${e.executionId}`;await this.memory.set(t,{...e,results:Object.fromEntries(e.results)},{namespace:"coordination",ttl:864e5})}toImmutableExecution(e){return{executionId:e.executionId,protocolId:e.protocolId,status:e.status,participants:[...e.participants],results:new Map(e.results),startedAt:e.startedAt,completedAt:e.completedAt,correlationId:e.correlationId,triggeredBy:e.triggeredBy}}async publishEvent(e,t,o){let r=g(e,"learning-optimization",t,o);await this.eventBus.publish(r)}sleep(e){return new Promise(t=>setTimeout(t,e))}};function S(P,e,t){return new E(P,e,t)}export{E as a,S as b};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.32");process.exit(0)}
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.34");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.32");process.exit(0)}
2
- import{c as u}from"./chunk-XHQFVTFD.js";function t(){return{...e}}function o(r){e={...e,...r}}function i(){e={...s}}function a(){return e.useBrowserMode}function E(){return e.useScreenshotCapture}function l(){return e.useVisualRegression}function c(){return e.useE2EExecution}function f(){return e.defaultHeadless}function d(){return e.useAutoRetry}function _(){return e.logPerformanceMetrics}function I(){return e.useAxeCore}function p(){let r={};process.env.VIBIUM_USE_BROWSER_MODE!==void 0&&(r.useBrowserMode=process.env.VIBIUM_USE_BROWSER_MODE==="true"),process.env.VIBIUM_USE_SCREENSHOT_CAPTURE!==void 0&&(r.useScreenshotCapture=process.env.VIBIUM_USE_SCREENSHOT_CAPTURE==="true"),process.env.VIBIUM_USE_VISUAL_REGRESSION!==void 0&&(r.useVisualRegression=process.env.VIBIUM_USE_VISUAL_REGRESSION==="true"),process.env.VIBIUM_USE_E2E_EXECUTION!==void 0&&(r.useE2EExecution=process.env.VIBIUM_USE_E2E_EXECUTION==="true"),process.env.VIBIUM_DEFAULT_HEADLESS!==void 0&&(r.defaultHeadless=process.env.VIBIUM_DEFAULT_HEADLESS==="true"),process.env.VIBIUM_USE_AUTO_RETRY!==void 0&&(r.useAutoRetry=process.env.VIBIUM_USE_AUTO_RETRY==="true"),process.env.VIBIUM_LOG_PERFORMANCE_METRICS!==void 0&&(r.logPerformanceMetrics=process.env.VIBIUM_LOG_PERFORMANCE_METRICS==="true"),process.env.VIBIUM_USE_AXE_CORE!==void 0&&(r.useAxeCore=process.env.VIBIUM_USE_AXE_CORE==="true"),o(r)}function U(){o({defaultHeadless:!0,useAutoRetry:!0,logPerformanceMetrics:!0})}function R(){o({defaultHeadless:!1,logPerformanceMetrics:!0})}function S(){o({useBrowserMode:!1,useScreenshotCapture:!1,useVisualRegression:!1,useE2EExecution:!1,useAxeCore:!1})}var s,e,n=u(()=>{s={useBrowserMode:!0,useScreenshotCapture:!0,useVisualRegression:!0,useE2EExecution:!0,defaultHeadless:!1,useAutoRetry:!0,logPerformanceMetrics:!0,useAxeCore:!0},e={...s}});export{s as a,t as b,o as c,i as d,a as e,E as f,l as g,c as h,f as i,d as j,_ as k,I as l,p as m,U as n,R as o,S as p,n as q};
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.34");process.exit(0)}
2
+ import{c as u}from"./chunk-6FNPEC2I.js";function t(){return{...e}}function o(r){e={...e,...r}}function i(){e={...s}}function a(){return e.useBrowserMode}function E(){return e.useScreenshotCapture}function l(){return e.useVisualRegression}function c(){return e.useE2EExecution}function f(){return e.defaultHeadless}function d(){return e.useAutoRetry}function _(){return e.logPerformanceMetrics}function I(){return e.useAxeCore}function p(){let r={};process.env.VIBIUM_USE_BROWSER_MODE!==void 0&&(r.useBrowserMode=process.env.VIBIUM_USE_BROWSER_MODE==="true"),process.env.VIBIUM_USE_SCREENSHOT_CAPTURE!==void 0&&(r.useScreenshotCapture=process.env.VIBIUM_USE_SCREENSHOT_CAPTURE==="true"),process.env.VIBIUM_USE_VISUAL_REGRESSION!==void 0&&(r.useVisualRegression=process.env.VIBIUM_USE_VISUAL_REGRESSION==="true"),process.env.VIBIUM_USE_E2E_EXECUTION!==void 0&&(r.useE2EExecution=process.env.VIBIUM_USE_E2E_EXECUTION==="true"),process.env.VIBIUM_DEFAULT_HEADLESS!==void 0&&(r.defaultHeadless=process.env.VIBIUM_DEFAULT_HEADLESS==="true"),process.env.VIBIUM_USE_AUTO_RETRY!==void 0&&(r.useAutoRetry=process.env.VIBIUM_USE_AUTO_RETRY==="true"),process.env.VIBIUM_LOG_PERFORMANCE_METRICS!==void 0&&(r.logPerformanceMetrics=process.env.VIBIUM_LOG_PERFORMANCE_METRICS==="true"),process.env.VIBIUM_USE_AXE_CORE!==void 0&&(r.useAxeCore=process.env.VIBIUM_USE_AXE_CORE==="true"),o(r)}function U(){o({defaultHeadless:!0,useAutoRetry:!0,logPerformanceMetrics:!0})}function R(){o({defaultHeadless:!1,logPerformanceMetrics:!0})}function S(){o({useBrowserMode:!1,useScreenshotCapture:!1,useVisualRegression:!1,useE2EExecution:!1,useAxeCore:!1})}var s,e,n=u(()=>{s={useBrowserMode:!0,useScreenshotCapture:!0,useVisualRegression:!0,useE2EExecution:!0,defaultHeadless:!1,useAutoRetry:!0,logPerformanceMetrics:!0,useAxeCore:!0},e={...s}});export{s as a,t as b,o as c,i as d,a as e,E as f,l as g,c as h,f as i,d as j,_ as k,I as l,p as m,U as n,R as o,S as p,n 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.32");process.exit(0)}
2
- import{h as s,k as o,m as c,o as m}from"./chunk-THYGFSTA.js";import{a,c as d}from"./chunk-5WR42V5O.js";import{a as r,e as l}from"./chunk-BBPOTFIY.js";d();m();l();var u={dbPath:s.dbPath,walMode:!0,mmapSize:r.MMAP_SIZE_BYTES,cacheSize:r.CACHE_SIZE_KB,busyTimeout:r.BUSY_TIMEOUT_MS},n=class e{static instance=null;static instancePromise=null;unifiedMemory=null;config;initialized=!1;initPromise=null;constructor(i){this.config={...u,...i}}static getInstance(i){return e.instance||(e.instance=new e(i)),e.instance}static async getInstanceAsync(i){return e.instance?.initialized?e.instance:(e.instancePromise||(e.instancePromise=(async()=>{let t=e.getInstance(i);return await t.initialize(),t})()),e.instancePromise)}static resetInstance(){e.instance&&(e.instance.close(),e.instance=null),e.instancePromise=null,c()}async initialize(){if(!this.initialized)return this.initPromise||(this.initPromise=this._doInitialize()),this.initPromise}async _doInitialize(){if(!this.initialized)try{let i={dbPath:this.config.dbPath,walMode:this.config.walMode,busyTimeout:this.config.busyTimeout,mmapSize:this.config.mmapSize,cacheSize:this.config.cacheSize};this.unifiedMemory=o(i),await this.unifiedMemory.initialize(),this.initialized=!0,console.log(`[UnifiedPersistence] Initialized via UnifiedMemoryManager: ${this.config.dbPath}`)}catch(i){throw this.initPromise=null,new Error(`Failed to initialize UnifiedPersistenceManager: ${a(i)}`)}}getDatabase(){if(!this.unifiedMemory||!this.initialized)throw new Error("UnifiedPersistenceManager not initialized");return this.unifiedMemory.getDatabase()}isInitialized(){return this.initialized}getDbPath(){return this.config.dbPath}prepare(i,t){if(!this.unifiedMemory)throw new Error("Database not initialized");return this.unifiedMemory.prepare(i,t)}transaction(i){if(!this.unifiedMemory)throw new Error("Database not initialized");return this.unifiedMemory.transaction(i)}getStats(){if(!this.unifiedMemory)throw new Error("Database not initialized");let i=this.unifiedMemory.getStats();return{tables:i.tables,fileSize:i.fileSize,walSize:i.walSize}}vacuum(){this.getDatabase().exec("VACUUM")}checkpoint(){this.getDatabase().pragma("wal_checkpoint(TRUNCATE)")}close(){this.initialized=!1,console.log("[UnifiedPersistence] Facade closed")}};function g(e){return n.getInstance(e)}async function U(e){let i=g(e);return await i.initialize(),i}function z(){n.resetInstance()}var f=!1;function h(){if(f)return;f=!0;let e=()=>{try{let i=n.instance;i&&i.close()}catch(i){console.debug("[UnifiedPersistence] Cleanup error:",i instanceof Error?i.message:i)}};process.on("beforeExit",e),process.on("SIGINT",()=>{e(),process.exit(0)}),process.on("SIGTERM",()=>{e(),process.exit(0)})}h();export{u as a,n as b,g as c,U as d,z as e};
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.34");process.exit(0)}
2
+ import{h as s,k as o,m as c,o as m}from"./chunk-PYQ7VCH2.js";import{a,c as d}from"./chunk-I74WDBHS.js";import{a as r,e as l}from"./chunk-QX74JLGO.js";d();m();l();var u={dbPath:s.dbPath,walMode:!0,mmapSize:r.MMAP_SIZE_BYTES,cacheSize:r.CACHE_SIZE_KB,busyTimeout:r.BUSY_TIMEOUT_MS},n=class e{static instance=null;static instancePromise=null;unifiedMemory=null;config;initialized=!1;initPromise=null;constructor(i){this.config={...u,...i}}static getInstance(i){return e.instance||(e.instance=new e(i)),e.instance}static async getInstanceAsync(i){return e.instance?.initialized?e.instance:(e.instancePromise||(e.instancePromise=(async()=>{let t=e.getInstance(i);return await t.initialize(),t})()),e.instancePromise)}static resetInstance(){e.instance&&(e.instance.close(),e.instance=null),e.instancePromise=null,c()}async initialize(){if(!this.initialized)return this.initPromise||(this.initPromise=this._doInitialize()),this.initPromise}async _doInitialize(){if(!this.initialized)try{let i={dbPath:this.config.dbPath,walMode:this.config.walMode,busyTimeout:this.config.busyTimeout,mmapSize:this.config.mmapSize,cacheSize:this.config.cacheSize};this.unifiedMemory=o(i),await this.unifiedMemory.initialize(),this.initialized=!0,console.log(`[UnifiedPersistence] Initialized via UnifiedMemoryManager: ${this.config.dbPath}`)}catch(i){throw this.initPromise=null,new Error(`Failed to initialize UnifiedPersistenceManager: ${a(i)}`)}}getDatabase(){if(!this.unifiedMemory||!this.initialized)throw new Error("UnifiedPersistenceManager not initialized");return this.unifiedMemory.getDatabase()}isInitialized(){return this.initialized}getDbPath(){return this.config.dbPath}prepare(i,t){if(!this.unifiedMemory)throw new Error("Database not initialized");return this.unifiedMemory.prepare(i,t)}transaction(i){if(!this.unifiedMemory)throw new Error("Database not initialized");return this.unifiedMemory.transaction(i)}getStats(){if(!this.unifiedMemory)throw new Error("Database not initialized");let i=this.unifiedMemory.getStats();return{tables:i.tables,fileSize:i.fileSize,walSize:i.walSize}}vacuum(){this.getDatabase().exec("VACUUM")}checkpoint(){this.getDatabase().pragma("wal_checkpoint(TRUNCATE)")}close(){this.initialized=!1,console.log("[UnifiedPersistence] Facade closed")}};function g(e){return n.getInstance(e)}async function U(e){let i=g(e);return await i.initialize(),i}function z(){n.resetInstance()}var f=!1;function h(){if(f)return;f=!0;let e=()=>{try{let i=n.instance;i&&i.close()}catch(i){console.debug("[UnifiedPersistence] Cleanup error:",i instanceof Error?i.message:i)}};process.on("beforeExit",e),process.on("SIGINT",()=>{e(),process.exit(0)}),process.on("SIGTERM",()=>{e(),process.exit(0)})}h();export{u as a,n as b,g as c,U as d,z 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.32");process.exit(0)}
2
- import{c as t,e as o}from"./chunk-XHQFVTFD.js";var g={};o(g,{DotProductAttention:()=>u,FlashAttention:()=>m,HyperbolicAttention:()=>h,LinearAttention:()=>f,MoEAttention:()=>_,MultiHeadAttention:()=>A,RuvectorLayer:()=>a,SonaEngine:()=>b,TensorCompress:()=>c,default:()=>r,differentiableSearch:()=>l,getCompressionLevel:()=>p,hierarchicalForward:()=>s,init:()=>d,pipeline:()=>L});import{createRequire as n}from"module";var i,e,r,a,c,l,s,p,d,m,u,A,h,f,_,b,L,q=t(()=>{i=n(import.meta.url),e=i("hnswlib-node"),r=e,{RuvectorLayer:a,TensorCompress:c,differentiableSearch:l,hierarchicalForward:s,getCompressionLevel:p,init:d,FlashAttention:m,DotProductAttention:u,MultiHeadAttention:A,HyperbolicAttention:h,LinearAttention:f,MoEAttention:_,SonaEngine:b,pipeline:L}=e||{}});export{r as a,a as b,c,l as d,s as e,p as f,d as g,m as h,u as i,A as j,h as k,f as l,_ as m,b as n,L as o,g as p,q};
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.34");process.exit(0)}
2
+ import{c as t,e as o}from"./chunk-6FNPEC2I.js";var g={};o(g,{DotProductAttention:()=>u,FlashAttention:()=>m,HyperbolicAttention:()=>h,LinearAttention:()=>f,MoEAttention:()=>_,MultiHeadAttention:()=>A,RuvectorLayer:()=>a,SonaEngine:()=>b,TensorCompress:()=>c,default:()=>r,differentiableSearch:()=>l,getCompressionLevel:()=>p,hierarchicalForward:()=>s,init:()=>d,pipeline:()=>L});import{createRequire as n}from"module";var i,e,r,a,c,l,s,p,d,m,u,A,h,f,_,b,L,q=t(()=>{i=n(import.meta.url),e=i("hnswlib-node"),r=e,{RuvectorLayer:a,TensorCompress:c,differentiableSearch:l,hierarchicalForward:s,getCompressionLevel:p,init:d,FlashAttention:m,DotProductAttention:u,MultiHeadAttention:A,HyperbolicAttention:h,LinearAttention:f,MoEAttention:_,SonaEngine:b,pipeline:L}=e||{}});export{r as a,a as b,c,l as d,s as e,p as f,d as g,m as h,u as i,A as j,h as k,f as l,_ as m,b as n,L as o,g as p,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.32");process.exit(0)}
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.34");process.exit(0)}
2
2
  var h=Object.create;var e=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')}),n=a=>b=>{var c=a[b];if(c)return c();throw new Error("Module not found in bundle: "+b)};var o=(a,b)=>()=>(a&&(b=a(a=0)),b);var p=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),q=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},g=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of j(b))!l.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=i(b,d))||f.enumerable});return a};var r=(a,b,c)=>(c=a!=null?h(k(a)):{},g(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a)),s=a=>g(e({},"__esModule",{value:!0}),a);export{m as a,n as b,o as c,p as d,q as e,r 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.32");process.exit(0)}
2
- import{b as d,d as L}from"./chunk-THYGFSTA.js";import{createHash as m}from"crypto";import{existsSync as g,readFileSync as R,writeFileSync as A,openSync as X,writeSync as U,closeSync as f}from"fs";var p=[`CREATE TABLE IF NOT EXISTS qe_patterns (
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.34");process.exit(0)}
2
+ import{b as d,d as L}from"./chunk-PYQ7VCH2.js";import{createHash as m}from"crypto";import{existsSync as g,readFileSync as R,writeFileSync as A,openSync as X,writeSync as U,closeSync as f}from"fs";var p=[`CREATE TABLE IF NOT EXISTS qe_patterns (
3
3
  id TEXT PRIMARY KEY, pattern_type TEXT NOT NULL, qe_domain TEXT NOT NULL,
4
4
  domain TEXT NOT NULL, name TEXT NOT NULL, description TEXT,
5
5
  confidence REAL DEFAULT 0.5, usage_count INTEGER DEFAULT 0,
@@ -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.32");process.exit(0)}
2
- import{c as N,g as O}from"./chunk-S4M7U6CZ.js";import{k as R,o as D}from"./chunk-THYGFSTA.js";import{b as g,d as C}from"./chunk-OK2TFTXP.js";import{a as _,c as A}from"./chunk-5WR42V5O.js";import{i as h}from"./chunk-WTNM7NA4.js";import{a as S,b as q}from"./chunk-4VAZSCTZ.js";q();C();A();D();function L(E,e){let n=E.prepare("SELECT confidence, usage_count, successful_uses FROM qe_patterns WHERE id = ?").get(e.patternId);if(!n)return{updated:!1};let t=e.success?1:0,r=n.usage_count+1,s=n.successful_uses+t,a=s/r,i=Math.min(1,r/100),o=n.confidence*.3+i*.2+a*.5,c=E.prepare(`
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.34");process.exit(0)}
2
+ import{c as N,g as O}from"./chunk-L5W7KTBW.js";import{k as R,o as D}from"./chunk-PYQ7VCH2.js";import{b as g,d as C}from"./chunk-VR65KHTH.js";import{a as _,c as A}from"./chunk-I74WDBHS.js";import{i as h}from"./chunk-5H44TVAY.js";import{a as S,b as q}from"./chunk-IPEUGCUK.js";q();C();A();D();function L(E,e){let n=E.prepare("SELECT confidence, usage_count, successful_uses FROM qe_patterns WHERE id = ?").get(e.patternId);if(!n)return{updated:!1};let t=e.success?1:0,r=n.usage_count+1,a=n.successful_uses+t,s=a/r,i=Math.min(1,r/100),o=n.confidence*.3+i*.2+s*.5,c=E.prepare(`
3
3
  INSERT INTO qe_pattern_usage (pattern_id, success, metrics_json, feedback)
4
4
  VALUES (?, ?, ?, ?)
5
5
  `),p=E.prepare(`
@@ -11,7 +11,7 @@ import{c as N,g as O}from"./chunk-S4M7U6CZ.js";import{k as R,o as D}from"./chunk
11
11
  last_used_at = datetime('now'),
12
12
  updated_at = datetime('now')
13
13
  WHERE id = ?
14
- `);return E.transaction(()=>{c.run(e.patternId,t,e.metrics?JSON.stringify(e.metrics):null,e.feedback??null),p.run(r,s,a,o,e.patternId)})(),{updated:!0,usageCount:r,successfulUses:s,successRate:a,qualityScore:o}}var w={dbPath:".agentic-qe/memory.db",walMode:!0,mmapSize:256*1024*1024,cacheSize:-64e3,foreignKeys:!0,useUnified:!0};function P(E,e=384){let n=new Array(e).fill(0),t=E.toLowerCase().trim();for(let s=0;s<3;s++)for(let a=0;a<t.length;a++){let i=t.charCodeAt(a),o=i*(a+1)*(s+1)%e;n[o]+=Math.sin(i*(s+1))/(a+1)}let r=Math.sqrt(n.reduce((s,a)=>s+a*a,0));if(r>0)for(let s=0;s<e;s++)n[s]/=r;return n}var b=class{db=null;config;prepared=new Map;initialized=!1;unifiedMemory=null;constructor(e={}){this.config={...w,...e}}getDatabase(){return this.db}async initialize(){if(!this.initialized)try{if(this.config.useUnified)this.unifiedMemory=R(),await this.unifiedMemory.initialize(),this.db=this.unifiedMemory.getDatabase(),console.log(`[SQLitePatternStore] Using unified storage: ${this.unifiedMemory.getDbPath()}`);else{let e=await import("path"),n=await import("fs"),t=e.dirname(this.config.dbPath);n.existsSync(t)||n.mkdirSync(t,{recursive:!0}),this.db=S(this.config.dbPath),this.db.pragma(`mmap_size = ${this.config.mmapSize}`),this.db.pragma(`cache_size = ${this.config.cacheSize}`),this.config.foreignKeys&&this.db.pragma("foreign_keys = ON"),this.createSchema(),console.log(`[SQLitePatternStore] Initialized (legacy): ${this.config.dbPath}`)}this.deduplicatePatterns(),this.prepareStatements(),this.initialized=!0}catch(e){throw new Error(`Failed to initialize SQLite: ${_(e)}`)}}createSchema(){if(!this.db)throw new Error("Database not initialized");this.db.exec(`
14
+ `);return E.transaction(()=>{c.run(e.patternId,t,e.metrics?JSON.stringify(e.metrics):null,e.feedback??null),p.run(r,a,s,o,e.patternId)})(),{updated:!0,usageCount:r,successfulUses:a,successRate:s,qualityScore:o}}var w={dbPath:".agentic-qe/memory.db",walMode:!0,mmapSize:256*1024*1024,cacheSize:-64e3,foreignKeys:!0,useUnified:!0};function P(E,e=384){let n=new Array(e).fill(0),t=E.toLowerCase().trim();for(let a=0;a<3;a++)for(let s=0;s<t.length;s++){let i=t.charCodeAt(s),o=i*(s+1)*(a+1)%e;n[o]+=Math.sin(i*(a+1))/(s+1)}let r=Math.sqrt(n.reduce((a,s)=>a+s*s,0));if(r>0)for(let a=0;a<e;a++)n[a]/=r;return n}var b=class{db=null;config;prepared=new Map;initialized=!1;unifiedMemory=null;constructor(e={}){this.config={...w,...e}}getDatabase(){return this.db}async initialize(){if(!this.initialized)try{if(this.config.useUnified)this.unifiedMemory=R(),await this.unifiedMemory.initialize(),this.db=this.unifiedMemory.getDatabase(),console.log(`[SQLitePatternStore] Using unified storage: ${this.unifiedMemory.getDbPath()}`);else{let e=await import("path"),n=await import("fs"),t=e.dirname(this.config.dbPath);n.existsSync(t)||n.mkdirSync(t,{recursive:!0}),this.db=S(this.config.dbPath),this.db.pragma(`mmap_size = ${this.config.mmapSize}`),this.db.pragma(`cache_size = ${this.config.cacheSize}`),this.config.foreignKeys&&this.db.pragma("foreign_keys = ON"),this.createSchema(),console.log(`[SQLitePatternStore] Initialized (legacy): ${this.config.dbPath}`)}this.deduplicatePatterns(),this.prepareStatements(),this.initialized=!0}catch(e){throw new Error(`Failed to initialize SQLite: ${_(e)}`)}}createSchema(){if(!this.db)throw new Error("Database not initialized");this.db.exec(`
15
15
  -- QE Patterns table
16
16
  CREATE TABLE IF NOT EXISTS qe_patterns (
17
17
  id TEXT PRIMARY KEY,
@@ -142,12 +142,12 @@ import{c as N,g as O}from"./chunk-S4M7U6CZ.js";import{k as R,o as D}from"./chunk
142
142
  SELECT COUNT(*) as cnt FROM (
143
143
  SELECT MIN(rowid) FROM qe_patterns GROUP BY name, qe_domain, pattern_type
144
144
  )
145
- `).get()?.cnt||0,s=t-r;s>t*.1?console.warn(`[SQLitePatternStore] SKIPPING dedup: would delete ${s}/${t} patterns (>${Math.round(t*.1)} safety limit). Investigate manually.`):(this.db.exec(`
145
+ `).get()?.cnt||0,a=t-r;a>t*.1?console.warn(`[SQLitePatternStore] SKIPPING dedup: would delete ${a}/${t} patterns (>${Math.round(t*.1)} safety limit). Investigate manually.`):(this.db.exec(`
146
146
  DELETE FROM qe_patterns WHERE rowid NOT IN (
147
147
  SELECT MIN(rowid) FROM qe_patterns
148
148
  GROUP BY name, qe_domain, pattern_type
149
149
  )
150
- `),console.log(`[SQLitePatternStore] Deduplicated: removed ${s} duplicates from ${t} patterns (${r} kept)`))}this.db.exec(`
150
+ `),console.log(`[SQLitePatternStore] Deduplicated: removed ${a} duplicates from ${t} patterns (${r} kept)`))}this.db.exec(`
151
151
  CREATE UNIQUE INDEX IF NOT EXISTS idx_patterns_unique_name_domain_type
152
152
  ON qe_patterns(name, qe_domain, pattern_type)
153
153
  `)}catch(e){console.debug("[SQLitePatternStore] Deduplication migration:",_(e))}}prepareStatements(){if(!this.db)throw new Error("Database not initialized");this.prepared.set("insertPattern",this.db.prepare(`
@@ -198,18 +198,24 @@ import{c as N,g as O}from"./chunk-S4M7U6CZ.js";import{k as R,o as D}from"./chunk
198
198
  SELECT * FROM qe_patterns WHERE qe_domain = ? ORDER BY quality_score DESC LIMIT ?
199
199
  `)),this.prepared.set("getAllEmbeddings",this.db.prepare(`
200
200
  SELECT pattern_id, embedding, dimension FROM qe_pattern_embeddings
201
+ `)),this.prepared.set("getRecentEmbeddings",this.db.prepare(`
202
+ SELECT e.pattern_id, e.embedding, e.dimension
203
+ FROM qe_pattern_embeddings e
204
+ LEFT JOIN qe_patterns p ON p.id = e.pattern_id
205
+ ORDER BY COALESCE(p.last_used_at, p.created_at, e.created_at) DESC
206
+ LIMIT ?
201
207
  `)),this.prepared.set("countPatterns",this.db.prepare(`
202
208
  SELECT COUNT(*) as count FROM qe_patterns
203
209
  `)),this.prepared.set("countByDomain",this.db.prepare(`
204
210
  SELECT qe_domain, COUNT(*) as count FROM qe_patterns GROUP BY qe_domain
205
- `))}storePattern(e,n){if(!this.db)throw new Error("Database not initialized");let t=e.id||h(),r=this.prepared.get("insertPattern"),s=this.prepared.get("insertEmbedding");if(!r||!s)throw new Error("Prepared statements not ready");this.db.transaction(()=>{if(r.run(t,e.patternType,e.qeDomain,e.domain,e.name,e.description||"",e.confidence,e.tier||"short-term",JSON.stringify(e.template),JSON.stringify(e.context)),n){let o=Buffer.from(new Float32Array(n).buffer);s.run(t,o,n.length,"all-MiniLM-L6-v2")}})();let i=this.db.prepare("SELECT id FROM qe_patterns WHERE name = ? AND qe_domain = ? AND pattern_type = ?").get(e.name,e.qeDomain??"",e.patternType??"");return i?i.id:t}getPattern(e){if(!this.db)throw new Error("Database not initialized");let n=this.prepared.get("getPatternWithEmbedding");if(!n)throw new Error("Prepared statement not ready");let t=n.get(e);return t?this.rowToPattern(t):null}getPatterns(e={}){if(!this.db)throw new Error("Database not initialized");let n=e.limit||1e3,t,r;return e.domain?(t=this.prepared.get("getPatternsByDomain"),r=t.all(e.domain,n)):(t=this.prepared.get("getAllPatterns"),r=t.all(n)),r.map(s=>this.rowToPattern(s))}searchFTS(e,n=20){if(!this.db)throw new Error("Database not initialized");if(!e.trim())return[];let t='"'+e.replace(/"/g,'""')+'"',r=performance.now();try{let s=this.db.prepare(`
211
+ `))}storePattern(e,n){if(!this.db)throw new Error("Database not initialized");let t=e.id||h(),r=this.prepared.get("insertPattern"),a=this.prepared.get("insertEmbedding");if(!r||!a)throw new Error("Prepared statements not ready");this.db.transaction(()=>{if(r.run(t,e.patternType,e.qeDomain,e.domain,e.name,e.description||"",e.confidence,e.tier||"short-term",JSON.stringify(e.template),JSON.stringify(e.context)),n){let o=Buffer.from(new Float32Array(n).buffer);a.run(t,o,n.length,"all-MiniLM-L6-v2")}})();let i=this.db.prepare("SELECT id FROM qe_patterns WHERE name = ? AND qe_domain = ? AND pattern_type = ?").get(e.name,e.qeDomain??"",e.patternType??"");return i?i.id:t}getPattern(e){if(!this.db)throw new Error("Database not initialized");let n=this.prepared.get("getPatternWithEmbedding");if(!n)throw new Error("Prepared statement not ready");let t=n.get(e);return t?this.rowToPattern(t):null}getPatterns(e={}){if(!this.db)throw new Error("Database not initialized");let n=e.limit||1e3,t,r;return e.domain?(t=this.prepared.get("getPatternsByDomain"),r=t.all(e.domain,n)):(t=this.prepared.get("getAllPatterns"),r=t.all(n)),r.map(a=>this.rowToPattern(a))}searchFTS(e,n=20){if(!this.db)throw new Error("Database not initialized");if(!e.trim())return[];let t='"'+e.replace(/"/g,'""')+'"',r=performance.now();try{let a=this.db.prepare(`
206
212
  SELECT p.id, rank AS fts_score
207
213
  FROM qe_patterns_fts fts
208
214
  JOIN qe_patterns p ON p.rowid = fts.rowid
209
215
  WHERE qe_patterns_fts MATCH ?
210
216
  ORDER BY rank
211
217
  LIMIT ?
212
- `).all(t,n),a=performance.now()-r;a>50&&console.warn(`[FTS5] searchFTS took ${a.toFixed(1)}ms (results=${s.length})`),this._lastFtsLatencyMs=a;let i=Math.max(...s.map(o=>Math.abs(o.fts_score)),1);return s.map(o=>({id:o.id,ftsScore:Math.abs(o.fts_score)/i}))}catch{return[]}}_lastFtsLatencyMs=0;get lastFtsLatencyMs(){return this._lastFtsLatencyMs}getGhostPatternCount(){if(!this.db)throw new Error("Database not initialized");let e=this.db.prepare("SELECT COUNT(*) as c FROM qe_patterns WHERE id NOT LIKE 'bench-%'").get().c,n=this.db.prepare(`
218
+ `).all(t,n),s=performance.now()-r;s>50&&console.warn(`[FTS5] searchFTS took ${s.toFixed(1)}ms (results=${a.length})`),this._lastFtsLatencyMs=s;let i=Math.max(...a.map(o=>Math.abs(o.fts_score)),1);return a.map(o=>({id:o.id,ftsScore:Math.abs(o.fts_score)/i}))}catch{return[]}}_lastFtsLatencyMs=0;get lastFtsLatencyMs(){return this._lastFtsLatencyMs}getGhostPatternCount(){if(!this.db)throw new Error("Database not initialized");let e=this.db.prepare("SELECT COUNT(*) as c FROM qe_patterns WHERE id NOT LIKE 'bench-%'").get().c,n=this.db.prepare(`
213
219
  SELECT COUNT(*) as c FROM qe_patterns p
214
220
  WHERE p.id NOT LIKE 'bench-%'
215
221
  AND p.id NOT IN (SELECT pattern_id FROM qe_pattern_embeddings)
@@ -218,9 +224,9 @@ import{c as N,g as O}from"./chunk-S4M7U6CZ.js";import{k as R,o as D}from"./chunk
218
224
  WHERE p.id NOT LIKE 'bench-%'
219
225
  AND p.id NOT IN (SELECT pattern_id FROM qe_pattern_embeddings)
220
226
  LIMIT 10
221
- `).all();return{total:e,withoutEmbeddings:n,sampleGhostIds:t.map(r=>r.id)}}getAllEmbeddings(){if(!this.db)throw new Error("Database not initialized");let e=this.prepared.get("getAllEmbeddings");if(!e)throw new Error("Prepared statement not ready");return e.all().map(t=>({patternId:t.pattern_id,embedding:Array.from(new Float32Array(t.embedding.buffer,t.embedding.byteOffset,t.dimension))}))}recordUsage(e,n,t,r){if(!this.db)throw new Error("Database not initialized");if(!L(this.db,{patternId:e,success:n,metrics:t,feedback:r}).updated)throw new Error(`Pattern not found: ${e}`)}deletePattern(e){if(!this.db)throw new Error("Database not initialized");this.db.transaction(()=>{this.db.prepare("DELETE FROM qe_pattern_embeddings WHERE pattern_id = ?").run(e),this.db.prepare("DELETE FROM qe_pattern_usage WHERE pattern_id = ?").run(e),this.db.prepare("DELETE FROM qe_patterns WHERE id = ?").run(e)})()}promotePattern(e){if(!this.db)throw new Error("Database not initialized");let n=this.prepared.get("promotePattern");if(!n)throw new Error("Prepared statement not ready");n.run(e)}getStats(){if(!this.db)throw new Error("Database not initialized");let e=this.prepared.get("countPatterns"),n=this.prepared.get("countByDomain");if(!e||!n)throw new Error("Prepared statements not ready");let t=e.get().count,r=n.all(),s={};for(let o of r)s[o.qe_domain]=o.count;let a=this.db.prepare(`
227
+ `).all();return{total:e,withoutEmbeddings:n,sampleGhostIds:t.map(r=>r.id)}}getAllEmbeddings(){if(!this.db)throw new Error("Database not initialized");let e=this.prepared.get("getAllEmbeddings");if(!e)throw new Error("Prepared statement not ready");return e.all().map(t=>({patternId:t.pattern_id,embedding:Array.from(new Float32Array(t.embedding.buffer,t.embedding.byteOffset,t.dimension))}))}getRecentEmbeddings(e){if(!this.db)throw new Error("Database not initialized");let n=Number.isFinite(e)&&e>0?Math.floor(e):1e3,t=this.prepared.get("getRecentEmbeddings");if(!t)throw new Error("Prepared statement not ready");return t.all(n).map(a=>({patternId:a.pattern_id,embedding:Array.from(new Float32Array(a.embedding.buffer,a.embedding.byteOffset,a.dimension))}))}recordUsage(e,n,t,r){if(!this.db)throw new Error("Database not initialized");if(!L(this.db,{patternId:e,success:n,metrics:t,feedback:r}).updated)throw new Error(`Pattern not found: ${e}`)}deletePattern(e){if(!this.db)throw new Error("Database not initialized");this.db.transaction(()=>{this.db.prepare("DELETE FROM qe_pattern_embeddings WHERE pattern_id = ?").run(e),this.db.prepare("DELETE FROM qe_pattern_usage WHERE pattern_id = ?").run(e),this.db.prepare("DELETE FROM qe_patterns WHERE id = ?").run(e)})()}promotePattern(e){if(!this.db)throw new Error("Database not initialized");let n=this.prepared.get("promotePattern");if(!n)throw new Error("Prepared statement not ready");n.run(e)}getStats(){if(!this.db)throw new Error("Database not initialized");let e=this.prepared.get("countPatterns"),n=this.prepared.get("countByDomain");if(!e||!n)throw new Error("Prepared statements not ready");let t=e.get().count,r=n.all(),a={};for(let o of r)a[o.qe_domain]=o.count;let s=this.db.prepare(`
222
228
  SELECT tier, COUNT(*) as count FROM qe_patterns GROUP BY tier
223
- `).all(),i={};for(let o of a)i[o.tier]=o.count;return{totalPatterns:t,byDomain:s,byTier:i}}getAggregateOutcomeStats(){let e={routingRequests:0,avgRoutingConfidence:0,successfulRoutings:0,learningOutcomes:0,successfulOutcomes:0,avgPatternSuccessRate:0};if(!this.db)return e;let n=a=>{try{return this.db.prepare(a).get()}catch{return}},t=n(`
229
+ `).all(),i={};for(let o of s)i[o.tier]=o.count;return{totalPatterns:t,byDomain:a,byTier:i}}getAggregateOutcomeStats(){let e={routingRequests:0,avgRoutingConfidence:0,successfulRoutings:0,learningOutcomes:0,successfulOutcomes:0,avgPatternSuccessRate:0};if(!this.db)return e;let n=s=>{try{return this.db.prepare(s).get()}catch{return}},t=n(`
224
230
  SELECT
225
231
  COUNT(*) AS total,
226
232
  COUNT(CASE WHEN quality_score >= 0 THEN 1 END) AS closed,
@@ -232,11 +238,11 @@ import{c as N,g as O}from"./chunk-S4M7U6CZ.js";import{k as R,o as D}from"./chunk
232
238
  COUNT(*) AS total,
233
239
  COALESCE(SUM(CASE WHEN success = 1 THEN 1 ELSE 0 END), 0) AS succ
234
240
  FROM qe_pattern_usage
235
- `),s=n(`
241
+ `),a=n(`
236
242
  SELECT AVG(success_rate) AS avg_sr
237
243
  FROM qe_patterns
238
244
  WHERE usage_count > 0
239
- `);return{routingRequests:t?.total??0,avgRoutingConfidence:t?.avg_q??0,successfulRoutings:t?.succ??0,learningOutcomes:r?.total??0,successfulOutcomes:r?.succ??0,avgPatternSuccessRate:s?.avg_sr??0}}hasAnyHistoricalData(){if(!this.db)return!1;try{let e=["SELECT COUNT(*) as cnt FROM qe_pattern_embeddings","SELECT COUNT(*) as cnt FROM qe_pattern_usage","SELECT COUNT(*) as cnt FROM qe_trajectories"];for(let n of e)try{let t=this.db.prepare(n).get();if(t&&t.cnt>0)return!0}catch{}return!1}catch{return!1}}rowToPattern(e){let n;return e.embedding&&(n=Array.from(new Float32Array(e.embedding.buffer,e.embedding.byteOffset,e.dimension))),{id:e.id,patternType:e.pattern_type,qeDomain:e.qe_domain,domain:e.domain,name:e.name,description:e.description,confidence:e.confidence,usageCount:e.usage_count,successRate:e.success_rate,qualityScore:e.quality_score,tier:e.tier,template:g(e.template_json||"{}"),context:g(e.context_json||"{}"),createdAt:new Date(e.created_at),lastUsedAt:e.last_used_at?new Date(e.last_used_at):new Date(e.created_at),successfulUses:e.successful_uses,embedding:n,tokensUsed:e.tokens_used,inputTokens:e.input_tokens,outputTokens:e.output_tokens,latencyMs:e.latency_ms,reusable:e.reusable===1,reuseCount:e.reuse_count||0,averageTokenSavings:e.average_token_savings||0,totalTokensSaved:e.total_tokens_saved}}updatePattern(e,n){if(!this.db)throw new Error("Database not initialized");let t=[],r=[];if(n.usageCount!==void 0&&(t.push("usage_count = ?"),r.push(n.usageCount)),n.successfulUses!==void 0&&(t.push("successful_uses = ?"),r.push(n.successfulUses)),n.successRate!==void 0&&(t.push("success_rate = ?"),r.push(n.successRate)),n.qualityScore!==void 0&&(t.push("quality_score = ?"),r.push(n.qualityScore)),n.confidence!==void 0&&(t.push("confidence = ?"),r.push(n.confidence)),n.tier!==void 0&&(t.push("tier = ?"),r.push(n.tier)),t.length===0)return;t.push("updated_at = datetime('now')"),r.push(e);let s=`UPDATE qe_patterns SET ${t.join(", ")} WHERE id = ?`;this.db.prepare(s).run(...r)}storePatternEmbedding(e,n){if(!this.db)throw new Error("Database not initialized");let t=this.prepared.get("insertEmbedding");if(!t)throw new Error("Prepared statements not ready");let r=Buffer.from(new Float32Array(n).buffer);t.run(e,r,n.length,"all-MiniLM-L6-v2")}recordPatternReuse(e,n,t,r=!1,s=0,a){if(!this.db)throw new Error("Database not initialized");try{this.db.exec(`
245
+ `);return{routingRequests:t?.total??0,avgRoutingConfidence:t?.avg_q??0,successfulRoutings:t?.succ??0,learningOutcomes:r?.total??0,successfulOutcomes:r?.succ??0,avgPatternSuccessRate:a?.avg_sr??0}}hasAnyHistoricalData(){if(!this.db)return!1;try{let e=["SELECT COUNT(*) as cnt FROM qe_pattern_embeddings","SELECT COUNT(*) as cnt FROM qe_pattern_usage","SELECT COUNT(*) as cnt FROM qe_trajectories"];for(let n of e)try{let t=this.db.prepare(n).get();if(t&&t.cnt>0)return!0}catch{}return!1}catch{return!1}}rowToPattern(e){let n;return e.embedding&&(n=Array.from(new Float32Array(e.embedding.buffer,e.embedding.byteOffset,e.dimension))),{id:e.id,patternType:e.pattern_type,qeDomain:e.qe_domain,domain:e.domain,name:e.name,description:e.description,confidence:e.confidence,usageCount:e.usage_count,successRate:e.success_rate,qualityScore:e.quality_score,tier:e.tier,template:g(e.template_json||"{}"),context:g(e.context_json||"{}"),createdAt:new Date(e.created_at),lastUsedAt:e.last_used_at?new Date(e.last_used_at):new Date(e.created_at),successfulUses:e.successful_uses,embedding:n,tokensUsed:e.tokens_used,inputTokens:e.input_tokens,outputTokens:e.output_tokens,latencyMs:e.latency_ms,reusable:e.reusable===1,reuseCount:e.reuse_count||0,averageTokenSavings:e.average_token_savings||0,totalTokensSaved:e.total_tokens_saved}}updatePattern(e,n){if(!this.db)throw new Error("Database not initialized");let t=[],r=[];if(n.usageCount!==void 0&&(t.push("usage_count = ?"),r.push(n.usageCount)),n.successfulUses!==void 0&&(t.push("successful_uses = ?"),r.push(n.successfulUses)),n.successRate!==void 0&&(t.push("success_rate = ?"),r.push(n.successRate)),n.qualityScore!==void 0&&(t.push("quality_score = ?"),r.push(n.qualityScore)),n.confidence!==void 0&&(t.push("confidence = ?"),r.push(n.confidence)),n.tier!==void 0&&(t.push("tier = ?"),r.push(n.tier)),t.length===0)return;t.push("updated_at = datetime('now')"),r.push(e);let a=`UPDATE qe_patterns SET ${t.join(", ")} WHERE id = ?`;this.db.prepare(a).run(...r)}storePatternEmbedding(e,n){if(!this.db)throw new Error("Database not initialized");let t=this.prepared.get("insertEmbedding");if(!t)throw new Error("Prepared statements not ready");let r=Buffer.from(new Float32Array(n).buffer);t.run(e,r,n.length,"all-MiniLM-L6-v2")}recordPatternReuse(e,n,t,r=!1,a=0,s){if(!this.db)throw new Error("Database not initialized");try{this.db.exec(`
240
246
  CREATE TABLE IF NOT EXISTS qe_pattern_reuse (
241
247
  id INTEGER PRIMARY KEY AUTOINCREMENT,
242
248
  pattern_id TEXT NOT NULL,
@@ -253,17 +259,17 @@ import{c as N,g as O}from"./chunk-S4M7U6CZ.js";import{k as R,o as D}from"./chunk
253
259
  INSERT INTO qe_pattern_reuse (
254
260
  pattern_id, task_description, similarity_score, was_reused, tokens_saved, routing_context_json
255
261
  ) VALUES (?, ?, ?, ?, ?, ?)
256
- `).run(e,n.slice(0,1e3),t,r?1:0,s,a?JSON.stringify(a):null)}catch(i){console.debug("[SQLitePatternStore] Failed to record pattern reuse:",_(i))}}getPatternReuseStats(e,n=7){if(!this.db)throw new Error("Database not initialized");try{if(!this.db.prepare(`
262
+ `).run(e,n.slice(0,1e3),t,r?1:0,a,s?JSON.stringify(s):null)}catch(i){console.debug("[SQLitePatternStore] Failed to record pattern reuse:",_(i))}}getPatternReuseStats(e,n=7){if(!this.db)throw new Error("Database not initialized");try{if(!this.db.prepare(`
257
263
  SELECT name FROM sqlite_master WHERE type='table' AND name='qe_pattern_reuse'
258
- `).get())return{totalSearches:0,totalReused:0,reuseRate:0,totalTokensSaved:0,avgSimilarity:0,topPatterns:[]};let r=new Date(Date.now()-n*24*60*60*1e3).toISOString(),s=e?"WHERE pattern_id = ? AND created_at >= ?":"WHERE created_at >= ?",a=e?[e,r]:[r],i=this.db.prepare(`
264
+ `).get())return{totalSearches:0,totalReused:0,reuseRate:0,totalTokensSaved:0,avgSimilarity:0,topPatterns:[]};let r=new Date(Date.now()-n*24*60*60*1e3).toISOString(),a=e?"WHERE pattern_id = ? AND created_at >= ?":"WHERE created_at >= ?",s=e?[e,r]:[r],i=this.db.prepare(`
259
265
  SELECT
260
266
  COUNT(*) as total_searches,
261
267
  SUM(CASE WHEN was_reused = 1 THEN 1 ELSE 0 END) as total_reused,
262
268
  SUM(tokens_saved) as total_tokens_saved,
263
269
  AVG(similarity_score) as avg_similarity
264
270
  FROM qe_pattern_reuse
265
- ${s}
266
- `).get(...a),o=this.db.prepare(`
271
+ ${a}
272
+ `).get(...s),o=this.db.prepare(`
267
273
  SELECT
268
274
  pattern_id,
269
275
  COUNT(*) as reuse_count,
@@ -281,4 +287,4 @@ import{c as N,g as O}from"./chunk-S4M7U6CZ.js";import{k as R,o as D}from"./chunk
281
287
  ORDER BY p.quality_score DESC
282
288
  `).all(),r=this.db.prepare(`
283
289
  SELECT COUNT(*) as c FROM qe_pattern_embeddings
284
- `).get();if(t.length===0)return console.log(`[SQLitePatternStore] Backfill: all patterns already have embeddings (${r.c} total)`),{processed:0,skipped:0,errors:0,alreadyHad:r.c,method:"transformer"};console.log(`[SQLitePatternStore] Backfill: ${t.length} patterns need embeddings (${r.c} already have)`);let s=this.prepared.get("insertEmbedding");if(!s)throw new Error("Prepared statements not ready");let a=0,i=0,o=0,c="transformer";for(let p=0;p<t.length;p+=e){let f=t.slice(p,p+e),m=[];for(let d of f){let u=[d.name,d.description,d.pattern_type,d.qe_domain].filter(Boolean).join(" ");if(!u.trim()){i++;continue}m.push({id:d.id,text:u})}if(m.length===0)continue;let l;try{l=await N(m.map(d=>d.text))}catch(d){console.warn(`[SQLitePatternStore] Transformer unavailable, falling back to hash embeddings: ${_(d)}`),c="hash-fallback",l=m.map(u=>P(u.text,n))}let y=c==="transformer"?"transformer-backfill":"hash-backfill";this.db.transaction(()=>{for(let d=0;d<m.length;d++)try{let u=l[d];if(!u||u.length!==n){o++;continue}let I=Buffer.from(new Float32Array(u).buffer);s.run(m[d].id,I,n,y),a++}catch(u){o++,o<=3&&console.warn(`[SQLitePatternStore] Backfill error for ${m[d].id}:`,_(u))}})();let T=Math.min(p+e,t.length);(T%100===0||T>=t.length)&&console.log(`[SQLitePatternStore] Backfill progress: ${T}/${t.length}`)}return console.log(`[SQLitePatternStore] Backfill complete (${c}): ${a} processed, ${i} skipped, ${o} errors`),{processed:a,skipped:i,errors:o,alreadyHad:r.c,method:c}}close(){this.db&&(this.unifiedMemory?console.log("[SQLitePatternStore] Detached from unified storage (not closing shared connection)"):(this.db.close(),console.log("[SQLitePatternStore] Database closed")),this.db=null,this.unifiedMemory=null,this.initialized=!1,this.prepared.clear())}exec(e){if(!this.db)throw new Error("Database not initialized");this.db.exec(e)}getDb(){if(!this.db)throw new Error("Database not initialized");return this.db}};function H(E={}){return new b(E)}export{L as a,w as b,P as c,b as d,H as e};
290
+ `).get();if(t.length===0)return console.log(`[SQLitePatternStore] Backfill: all patterns already have embeddings (${r.c} total)`),{processed:0,skipped:0,errors:0,alreadyHad:r.c,method:"transformer"};console.log(`[SQLitePatternStore] Backfill: ${t.length} patterns need embeddings (${r.c} already have)`);let a=this.prepared.get("insertEmbedding");if(!a)throw new Error("Prepared statements not ready");let s=0,i=0,o=0,c="transformer";for(let p=0;p<t.length;p+=e){let f=t.slice(p,p+e),m=[];for(let d of f){let u=[d.name,d.description,d.pattern_type,d.qe_domain].filter(Boolean).join(" ");if(!u.trim()){i++;continue}m.push({id:d.id,text:u})}if(m.length===0)continue;let l;try{l=await N(m.map(d=>d.text))}catch(d){console.warn(`[SQLitePatternStore] Transformer unavailable, falling back to hash embeddings: ${_(d)}`),c="hash-fallback",l=m.map(u=>P(u.text,n))}let y=c==="transformer"?"transformer-backfill":"hash-backfill";this.db.transaction(()=>{for(let d=0;d<m.length;d++)try{let u=l[d];if(!u||u.length!==n){o++;continue}let I=Buffer.from(new Float32Array(u).buffer);a.run(m[d].id,I,n,y),s++}catch(u){o++,o<=3&&console.warn(`[SQLitePatternStore] Backfill error for ${m[d].id}:`,_(u))}})();let T=Math.min(p+e,t.length);(T%100===0||T>=t.length)&&console.log(`[SQLitePatternStore] Backfill progress: ${T}/${t.length}`)}return console.log(`[SQLitePatternStore] Backfill complete (${c}): ${s} processed, ${i} skipped, ${o} errors`),{processed:s,skipped:i,errors:o,alreadyHad:r.c,method:c}}close(){this.db&&(this.unifiedMemory?console.log("[SQLitePatternStore] Detached from unified storage (not closing shared connection)"):(this.db.close(),console.log("[SQLitePatternStore] Database closed")),this.db=null,this.unifiedMemory=null,this.initialized=!1,this.prepared.clear())}exec(e){if(!this.db)throw new Error("Database not initialized");this.db.exec(e)}getDb(){if(!this.db)throw new Error("Database not initialized");return this.db}};function H(E={}){return new b(E)}export{L as a,w as b,P as c,b as d,H as e};
@@ -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.32");process.exit(0)}
2
- import{a as v}from"./chunk-YVQ4PR4H.js";import{c as l}from"./chunk-OMOGD2NN.js";import{S as R,b as g}from"./chunk-33PGBYTC.js";v();R();import{createHash as m,randomUUID as f}from"crypto";var a=l.create("witness-chain"),p=class{logLikelihoodRatio=0;upperBound;lowerBound;observations=0;constructor(t=.05,e=.05){this.upperBound=Math.log(1/t),this.lowerBound=Math.log(e)}addWeightedEvidence(t,e){return this.logLikelihoodRatio+=t?e:-e,this.observations++,this.logLikelihoodRatio>=this.upperBound?"PASS":this.logLikelihoodRatio<=this.lowerBound?"FAIL":"INCONCLUSIVE"}addEvidence(t){return this.addWeightedEvidence(t,.5)}getRatio(){return this.logLikelihoodRatio}getObservations(){return this.observations}getBounds(){return{upper:this.upperBound,lower:this.lowerBound}}reset(){this.logLikelihoodRatio=0,this.observations=0}},c="0".repeat(64),h=class{receipts=[];lastHash=c;sprtAccumulators=new Map;appendWitness(t){let e=f(),i=Date.now(),s=this.receipts.length,n=this.lastHash+JSON.stringify(t)+i,o=m("sha256").update(n).digest("hex"),u={id:e,timestamp:i,previousHash:this.lastHash,hash:o,decision:t,chainIndex:s};return this.receipts.push(u),this.lastHash=o,this.updateSPRT(t),a.debug("Witness appended",{chainIndex:s,type:t.type,decision:t.decision,hash:o.slice(0,16)+"..."}),u}verifyChain(){if(this.receipts.length===0)return{valid:!0,length:0,brokenAt:-1,message:"Chain is empty (valid)",lastHash:c};let t=c;for(let e=0;e<this.receipts.length;e++){let i=this.receipts[e];if(i.previousHash!==t)return{valid:!1,length:this.receipts.length,brokenAt:e,message:`Chain broken at index ${e}: previousHash mismatch`,lastHash:this.lastHash};let s=i.previousHash+JSON.stringify(i.decision)+i.timestamp,n=m("sha256").update(s).digest("hex");if(i.hash!==n)return{valid:!1,length:this.receipts.length,brokenAt:e,message:`Chain broken at index ${e}: hash mismatch (tamper detected)`,lastHash:this.lastHash};t=i.hash}return{valid:!0,length:this.receipts.length,brokenAt:-1,message:`Chain valid (${this.receipts.length} receipts)`,lastHash:this.lastHash}}getChain(t){return t!==void 0&&t>0?[...this.receipts.slice(-t)]:[...this.receipts]}getChainLength(){return this.receipts.length}getLastHash(){return this.lastHash}exportChain(){let t={version:"1.0.0",exportedAt:Date.now(),length:this.receipts.length,receipts:this.receipts};return JSON.stringify(t,null,2)}importChain(t){try{let e=JSON.parse(t);if(!e||e.version!=="1.0.0"||!Array.isArray(e.receipts))return a.warn("Import failed: invalid format"),!1;let i=this.receipts,s=this.lastHash;this.receipts=e.receipts,this.lastHash=e.receipts.length>0?e.receipts[e.receipts.length-1].hash:c;let n=this.verifyChain();return n.valid?(a.info("Chain imported successfully",{length:e.receipts.length}),!0):(this.receipts=i,this.lastHash=s,a.warn("Import failed: chain integrity check failed",{message:n.message}),!1)}catch(e){return a.warn("Import failed: parse error",{error:e instanceof Error?e.message:String(e)}),!1}}getSPRT(t,e,i){return this.sprtAccumulators.has(t)||this.sprtAccumulators.set(t,new p(e,i)),this.sprtAccumulators.get(t)}getReceipt(t){return this.receipts[t]}updateSPRT(t){let e=t.decision==="PASS"||t.decision==="PERMIT";this.getSPRT(t.type).addEvidence(e)}},d=class extends h{persistence;constructor(t){super(),this.persistence=t;let e=t.loadAllReceipts();if(e.length>0){let i={version:"1.0.0",exportedAt:Date.now(),length:e.length,receipts:e};this.importChain(JSON.stringify(i))?a.info("Witness chain restored from SQLite",{receipts:e.length}):a.warn("Failed to restore witness chain from SQLite \u2014 starting fresh")}}appendWitness(t){let e=super.appendWitness(t);try{this.persistence.insertReceipt(e)}catch(i){a.warn("Failed to persist witness receipt to SQLite",{chainIndex:e.chainIndex,error:i instanceof Error?i.message:String(i)})}return e}};function C(r){r.exec(`
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.34");process.exit(0)}
2
+ import{a as v}from"./chunk-DXOFPU3A.js";import{c as l}from"./chunk-PMFV3ZFP.js";import{S as R,b as g}from"./chunk-QPH72S4A.js";v();R();import{createHash as m,randomUUID as f}from"crypto";var a=l.create("witness-chain"),p=class{logLikelihoodRatio=0;upperBound;lowerBound;observations=0;constructor(t=.05,e=.05){this.upperBound=Math.log(1/t),this.lowerBound=Math.log(e)}addWeightedEvidence(t,e){return this.logLikelihoodRatio+=t?e:-e,this.observations++,this.logLikelihoodRatio>=this.upperBound?"PASS":this.logLikelihoodRatio<=this.lowerBound?"FAIL":"INCONCLUSIVE"}addEvidence(t){return this.addWeightedEvidence(t,.5)}getRatio(){return this.logLikelihoodRatio}getObservations(){return this.observations}getBounds(){return{upper:this.upperBound,lower:this.lowerBound}}reset(){this.logLikelihoodRatio=0,this.observations=0}},c="0".repeat(64),h=class{receipts=[];lastHash=c;sprtAccumulators=new Map;appendWitness(t){let e=f(),i=Date.now(),s=this.receipts.length,n=this.lastHash+JSON.stringify(t)+i,o=m("sha256").update(n).digest("hex"),u={id:e,timestamp:i,previousHash:this.lastHash,hash:o,decision:t,chainIndex:s};return this.receipts.push(u),this.lastHash=o,this.updateSPRT(t),a.debug("Witness appended",{chainIndex:s,type:t.type,decision:t.decision,hash:o.slice(0,16)+"..."}),u}verifyChain(){if(this.receipts.length===0)return{valid:!0,length:0,brokenAt:-1,message:"Chain is empty (valid)",lastHash:c};let t=c;for(let e=0;e<this.receipts.length;e++){let i=this.receipts[e];if(i.previousHash!==t)return{valid:!1,length:this.receipts.length,brokenAt:e,message:`Chain broken at index ${e}: previousHash mismatch`,lastHash:this.lastHash};let s=i.previousHash+JSON.stringify(i.decision)+i.timestamp,n=m("sha256").update(s).digest("hex");if(i.hash!==n)return{valid:!1,length:this.receipts.length,brokenAt:e,message:`Chain broken at index ${e}: hash mismatch (tamper detected)`,lastHash:this.lastHash};t=i.hash}return{valid:!0,length:this.receipts.length,brokenAt:-1,message:`Chain valid (${this.receipts.length} receipts)`,lastHash:this.lastHash}}getChain(t){return t!==void 0&&t>0?[...this.receipts.slice(-t)]:[...this.receipts]}getChainLength(){return this.receipts.length}getLastHash(){return this.lastHash}exportChain(){let t={version:"1.0.0",exportedAt:Date.now(),length:this.receipts.length,receipts:this.receipts};return JSON.stringify(t,null,2)}importChain(t){try{let e=JSON.parse(t);if(!e||e.version!=="1.0.0"||!Array.isArray(e.receipts))return a.warn("Import failed: invalid format"),!1;let i=this.receipts,s=this.lastHash;this.receipts=e.receipts,this.lastHash=e.receipts.length>0?e.receipts[e.receipts.length-1].hash:c;let n=this.verifyChain();return n.valid?(a.info("Chain imported successfully",{length:e.receipts.length}),!0):(this.receipts=i,this.lastHash=s,a.warn("Import failed: chain integrity check failed",{message:n.message}),!1)}catch(e){return a.warn("Import failed: parse error",{error:e instanceof Error?e.message:String(e)}),!1}}getSPRT(t,e,i){return this.sprtAccumulators.has(t)||this.sprtAccumulators.set(t,new p(e,i)),this.sprtAccumulators.get(t)}getReceipt(t){return this.receipts[t]}updateSPRT(t){let e=t.decision==="PASS"||t.decision==="PERMIT";this.getSPRT(t.type).addEvidence(e)}},d=class extends h{persistence;constructor(t){super(),this.persistence=t;let e=t.loadAllReceipts();if(e.length>0){let i={version:"1.0.0",exportedAt:Date.now(),length:e.length,receipts:e};this.importChain(JSON.stringify(i))?a.info("Witness chain restored from SQLite",{receipts:e.length}):a.warn("Failed to restore witness chain from SQLite \u2014 starting fresh")}}appendWitness(t){let e=super.appendWitness(t);try{this.persistence.insertReceipt(e)}catch(i){a.warn("Failed to persist witness receipt to SQLite",{chainIndex:e.chainIndex,error:i instanceof Error?i.message:String(i)})}return e}};function C(r){r.exec(`
3
3
  CREATE TABLE IF NOT EXISTS witness_chain_receipts (
4
4
  id TEXT PRIMARY KEY,
5
5
  chain_index 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.32");process.exit(0)}
2
- import{b as y,d as p}from"./chunk-LHDTXTS7.js";import{i as h}from"./chunk-WTNM7NA4.js";var f={healthyThreshold:3,warningThreshold:2,checkIntervalMs:5e3,maxHistoryEntries:100,alertsEnabled:!0,alertCooldownMs:6e4,selfHealingEnabled:!1,maxHealingActionsPerMinute:5};var g=class{calculator;config;eventBus;persistence;graph;history=[];alerts=new Map;lastAlertTime=new Map;monitoringInterval=null;isMonitoring=!1;constructor(e,t={},r,i){this.graph=e,this.config={...f,...t},this.calculator=p(),this.eventBus=r,this.persistence=i}start(){this.isMonitoring||(this.isMonitoring=!0,this.monitoringInterval=setInterval(()=>this.checkHealth(),this.config.checkIntervalMs),this.checkHealth())}stop(){this.monitoringInterval&&(clearInterval(this.monitoringInterval),this.monitoringInterval=null),this.isMonitoring=!1}updateGraph(e){this.graph=e,this.isMonitoring&&this.checkHealth()}isEmptyTopology(){return this.graph.getVerticesByType("agent").length===0}checkHealth(){let e=this.calculator.getMinCutValue(this.graph),t=this.calculator.findWeakVertices(this.graph),r=this.isEmptyTopology()?"idle":this.determineStatus(e),i=this.calculateTrend();return this.recordHistory(e),this.isEmptyTopology()||this.checkAlertConditions(e,t,r),this.persistence&&t.length>0&&this.persistence.saveWeakVertices(t).catch(n=>console.warn("[MinCutHealthMonitor] Failed to persist weak vertices:",n)),this.emitEvent("mincut.updated",e,{status:r,weakVertexCount:t.length}),{status:r,minCutValue:e,healthyThreshold:this.config.healthyThreshold,warningThreshold:this.config.warningThreshold,weakVertexCount:t.length,topWeakVertices:t.slice(0,5),trend:i,history:this.history.slice(-20),lastUpdated:new Date}}getHealth(){let e=this.calculator.getMinCutValue(this.graph),t=this.calculator.findWeakVertices(this.graph);return{status:this.isEmptyTopology()?"idle":this.determineStatus(e),minCutValue:e,healthyThreshold:this.config.healthyThreshold,warningThreshold:this.config.warningThreshold,weakVertexCount:t.length,topWeakVertices:t.slice(0,5),trend:this.calculateTrend(),history:this.history.slice(-20),lastUpdated:new Date}}getMinCutValue(){return this.calculator.getMinCutValue(this.graph)}getWeakVertices(){return this.calculator.findWeakVertices(this.graph)}isCritical(){return this.calculator.getMinCutValue(this.graph)<this.config.warningThreshold}isHealthy(){return this.calculator.getMinCutValue(this.graph)>=this.config.healthyThreshold}getActiveAlerts(){return Array.from(this.alerts.values()).filter(e=>!e.acknowledged).sort((e,t)=>{let r={critical:0,high:1,medium:2,low:3,info:4};return r[e.severity]-r[t.severity]})}getAllAlerts(){return Array.from(this.alerts.values())}acknowledgeAlert(e){let t=this.alerts.get(e);return t?(t.acknowledged=!0,!0):!1}clearAcknowledgedAlerts(){let e=[];for(let[t,r]of this.alerts)r.acknowledged&&e.push(t);for(let t of e)this.alerts.delete(t);return e.length}getHistory(){return[...this.history]}getTrend(){return this.calculateTrend()}getStats(e=6e4){let t=Date.now()-e,r=this.history.filter(n=>n.timestamp.getTime()>t);if(r.length===0){let n=this.calculator.getMinCutValue(this.graph);return{min:n,max:n,average:n,count:0}}let i=r.map(n=>n.value);return{min:Math.min(...i),max:Math.max(...i),average:i.reduce((n,a)=>n+a,0)/i.length,count:r.length}}updateConfig(e){Object.assign(this.config,e),e.checkIntervalMs&&this.isMonitoring&&(this.stop(),this.start())}getConfig(){return{...this.config}}determineStatus(e){return e>=this.config.healthyThreshold?"healthy":e>=this.config.warningThreshold?"warning":"critical"}calculateTrend(){if(this.history.length<3)return"stable";let e=this.history.slice(-5),t=e[0].value,i=e[e.length-1].value-t,a=e.reduce((o,c)=>o+c.value,0)/e.length*.1;return i>a?"improving":i<-a?"degrading":"stable"}recordHistory(e){let t={timestamp:new Date,value:e,vertexCount:this.graph.vertexCount,edgeCount:this.graph.edgeCount};for(this.history.push(t);this.history.length>this.config.maxHistoryEntries;)this.history.shift()}checkAlertConditions(e,t,r){if(!this.config.alertsEnabled)return;let i=Date.now();r==="critical"?this.maybeGenerateAlert("critical-threshold","critical",`MinCut value (${e.toFixed(2)}) is below critical threshold (${this.config.warningThreshold})`,e,this.config.warningThreshold,t):r==="warning"&&this.maybeGenerateAlert("warning-threshold","high",`MinCut value (${e.toFixed(2)}) is below healthy threshold (${this.config.healthyThreshold})`,e,this.config.healthyThreshold,t);let n=t.filter(o=>o.weightedDegree===0);n.length>0&&this.maybeGenerateAlert("isolated-vertices","high",`${n.length} isolated vertex(es) detected`,e,0,n);let a=t.filter(o=>o.riskScore>.8);a.length>0&&this.maybeGenerateAlert("critical-vertices","medium",`${a.length} critical vertex(es) with high risk score`,e,0,a)}maybeGenerateAlert(e,t,r,i,n,a){let o=Date.now(),c=this.lastAlertTime.get(e)||0;if(o-c<this.config.alertCooldownMs)return;let s={id:h(),severity:t,message:r,minCutValue:i,threshold:n,affectedVertices:a.map(l=>l.vertexId),timestamp:new Date,acknowledged:!1,remediations:a.flatMap(l=>l.suggestions).slice(0,5)};this.alerts.set(s.id,s),this.persistence&&this.persistence.saveAlert(s).catch(l=>console.warn("[MinCutHealthMonitor] Failed to persist alert:",l)),this.lastAlertTime.set(e,o),this.emitEvent("mincut.alert.generated",i,{alert:s})}emitEvent(e,t,r){if(!this.eventBus)return;let i={id:h(),type:e,source:"coordination",timestamp:new Date,correlationId:h(),payload:{minCutValue:t,...r}};this.eventBus.publish(i).catch(n=>{console.error("Failed to publish MinCut event:",n)})}};function v(m,e,t,r){return new g(m,e,t,r)}var d=null,u=null;function C(){return d||(d=y()),d}function B(){return u||(u=v(C())),u}function F(){return d!==null}function N(){return u!==null}export{f as a,v as b,C as c,B as d,F as e,N as f};
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.34");process.exit(0)}
2
+ import{b as y,d as p}from"./chunk-ZQZ4NYTM.js";import{i as h}from"./chunk-5H44TVAY.js";var f={healthyThreshold:3,warningThreshold:2,checkIntervalMs:5e3,maxHistoryEntries:100,alertsEnabled:!0,alertCooldownMs:6e4,selfHealingEnabled:!1,maxHealingActionsPerMinute:5};var g=class{calculator;config;eventBus;persistence;graph;history=[];alerts=new Map;lastAlertTime=new Map;monitoringInterval=null;isMonitoring=!1;constructor(e,t={},r,i){this.graph=e,this.config={...f,...t},this.calculator=p(),this.eventBus=r,this.persistence=i}start(){this.isMonitoring||(this.isMonitoring=!0,this.monitoringInterval=setInterval(()=>this.checkHealth(),this.config.checkIntervalMs),this.checkHealth())}stop(){this.monitoringInterval&&(clearInterval(this.monitoringInterval),this.monitoringInterval=null),this.isMonitoring=!1}updateGraph(e){this.graph=e,this.isMonitoring&&this.checkHealth()}isEmptyTopology(){return this.graph.getVerticesByType("agent").length===0}checkHealth(){let e=this.calculator.getMinCutValue(this.graph),t=this.calculator.findWeakVertices(this.graph),r=this.isEmptyTopology()?"idle":this.determineStatus(e),i=this.calculateTrend();return this.recordHistory(e),this.isEmptyTopology()||this.checkAlertConditions(e,t,r),this.persistence&&t.length>0&&this.persistence.saveWeakVertices(t).catch(n=>console.warn("[MinCutHealthMonitor] Failed to persist weak vertices:",n)),this.emitEvent("mincut.updated",e,{status:r,weakVertexCount:t.length}),{status:r,minCutValue:e,healthyThreshold:this.config.healthyThreshold,warningThreshold:this.config.warningThreshold,weakVertexCount:t.length,topWeakVertices:t.slice(0,5),trend:i,history:this.history.slice(-20),lastUpdated:new Date}}getHealth(){let e=this.calculator.getMinCutValue(this.graph),t=this.calculator.findWeakVertices(this.graph);return{status:this.isEmptyTopology()?"idle":this.determineStatus(e),minCutValue:e,healthyThreshold:this.config.healthyThreshold,warningThreshold:this.config.warningThreshold,weakVertexCount:t.length,topWeakVertices:t.slice(0,5),trend:this.calculateTrend(),history:this.history.slice(-20),lastUpdated:new Date}}getMinCutValue(){return this.calculator.getMinCutValue(this.graph)}getWeakVertices(){return this.calculator.findWeakVertices(this.graph)}isCritical(){return this.calculator.getMinCutValue(this.graph)<this.config.warningThreshold}isHealthy(){return this.calculator.getMinCutValue(this.graph)>=this.config.healthyThreshold}getActiveAlerts(){return Array.from(this.alerts.values()).filter(e=>!e.acknowledged).sort((e,t)=>{let r={critical:0,high:1,medium:2,low:3,info:4};return r[e.severity]-r[t.severity]})}getAllAlerts(){return Array.from(this.alerts.values())}acknowledgeAlert(e){let t=this.alerts.get(e);return t?(t.acknowledged=!0,!0):!1}clearAcknowledgedAlerts(){let e=[];for(let[t,r]of this.alerts)r.acknowledged&&e.push(t);for(let t of e)this.alerts.delete(t);return e.length}getHistory(){return[...this.history]}getTrend(){return this.calculateTrend()}getStats(e=6e4){let t=Date.now()-e,r=this.history.filter(n=>n.timestamp.getTime()>t);if(r.length===0){let n=this.calculator.getMinCutValue(this.graph);return{min:n,max:n,average:n,count:0}}let i=r.map(n=>n.value);return{min:Math.min(...i),max:Math.max(...i),average:i.reduce((n,a)=>n+a,0)/i.length,count:r.length}}updateConfig(e){Object.assign(this.config,e),e.checkIntervalMs&&this.isMonitoring&&(this.stop(),this.start())}getConfig(){return{...this.config}}determineStatus(e){return e>=this.config.healthyThreshold?"healthy":e>=this.config.warningThreshold?"warning":"critical"}calculateTrend(){if(this.history.length<3)return"stable";let e=this.history.slice(-5),t=e[0].value,i=e[e.length-1].value-t,a=e.reduce((o,c)=>o+c.value,0)/e.length*.1;return i>a?"improving":i<-a?"degrading":"stable"}recordHistory(e){let t={timestamp:new Date,value:e,vertexCount:this.graph.vertexCount,edgeCount:this.graph.edgeCount};for(this.history.push(t);this.history.length>this.config.maxHistoryEntries;)this.history.shift()}checkAlertConditions(e,t,r){if(!this.config.alertsEnabled)return;let i=Date.now();r==="critical"?this.maybeGenerateAlert("critical-threshold","critical",`MinCut value (${e.toFixed(2)}) is below critical threshold (${this.config.warningThreshold})`,e,this.config.warningThreshold,t):r==="warning"&&this.maybeGenerateAlert("warning-threshold","high",`MinCut value (${e.toFixed(2)}) is below healthy threshold (${this.config.healthyThreshold})`,e,this.config.healthyThreshold,t);let n=t.filter(o=>o.weightedDegree===0);n.length>0&&this.maybeGenerateAlert("isolated-vertices","high",`${n.length} isolated vertex(es) detected`,e,0,n);let a=t.filter(o=>o.riskScore>.8);a.length>0&&this.maybeGenerateAlert("critical-vertices","medium",`${a.length} critical vertex(es) with high risk score`,e,0,a)}maybeGenerateAlert(e,t,r,i,n,a){let o=Date.now(),c=this.lastAlertTime.get(e)||0;if(o-c<this.config.alertCooldownMs)return;let s={id:h(),severity:t,message:r,minCutValue:i,threshold:n,affectedVertices:a.map(l=>l.vertexId),timestamp:new Date,acknowledged:!1,remediations:a.flatMap(l=>l.suggestions).slice(0,5)};this.alerts.set(s.id,s),this.persistence&&this.persistence.saveAlert(s).catch(l=>console.warn("[MinCutHealthMonitor] Failed to persist alert:",l)),this.lastAlertTime.set(e,o),this.emitEvent("mincut.alert.generated",i,{alert:s})}emitEvent(e,t,r){if(!this.eventBus)return;let i={id:h(),type:e,source:"coordination",timestamp:new Date,correlationId:h(),payload:{minCutValue:t,...r}};this.eventBus.publish(i).catch(n=>{console.error("Failed to publish MinCut event:",n)})}};function v(m,e,t,r){return new g(m,e,t,r)}var d=null,u=null;function C(){return d||(d=y()),d}function B(){return u||(u=v(C())),u}function F(){return d!==null}function N(){return u!==null}export{f as a,v as b,C as c,B as d,F as e,N as f};
@@ -0,0 +1,9 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.34");process.exit(0)}
2
+ function b(i,t){return{ingest(e){i.ingest(e)},search(e,r){return i.search(e,r).map(n=>({id:n.id,score:n.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()},compact(){return i.compact()}}}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-E4XSLZPD.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 n=this.rvfStore.status().totalVectors;return e!==n&&(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}}compact(){if(!this.rvfStore||!this.rvfAvailable||!this.rvfStore.compact)return null;try{return this.rvfStore.compact()??null}catch{return null}}shouldWriteRvf(){return(this.config.mode==="dual-write"||this.config.mode==="rvf-primary")&&this.rvfAvailable&&this.rvfStore!==null}writeSqliteEmbedding(t,e){let r=Buffer.from(e instanceof Float32Array?e.buffer:new Float32Array(e).buffer),n=e.length;c(this.db,"qe_pattern_embeddings")&&this.db.prepare(`
3
+ INSERT INTO qe_pattern_embeddings (pattern_id, embedding, dimension, model, created_at)
4
+ VALUES (?, ?, ?, 'all-MiniLM-L6-v2', datetime('now'))
5
+ ON CONFLICT(pattern_id) DO UPDATE SET
6
+ embedding = excluded.embedding,
7
+ dimension = excluded.dimension,
8
+ created_at = datetime('now')
9
+ `).run(t,r,n)}deleteSqliteEmbedding(t){c(this.db,"qe_pattern_embeddings")&&this.db.prepare("DELETE FROM qe_pattern_embeddings WHERE pattern_id = ?").run(t)}getSqliteEmbeddingCount(){return c(this.db,"qe_pattern_embeddings")?this.db.prepare("SELECT COUNT(*) as cnt FROM qe_pattern_embeddings").get()?.cnt??0:0}getSqlitePatternCount(){return c(this.db,"qe_patterns")?this.db.prepare("SELECT COUNT(*) as cnt FROM qe_patterns").get()?.cnt??0:0}searchSqlite(t,e){if(!c(this.db,"qe_pattern_embeddings"))return[];let r=this.db.prepare("SELECT pattern_id, embedding, dimension FROM qe_pattern_embeddings").all(),n=t instanceof Float32Array?Array.from(t):t,v=Math.sqrt(n.reduce((s,o)=>s+o*o,0));if(v===0)return[];let f=[];for(let s of r){let o=new Float32Array(s.embedding.buffer,s.embedding.byteOffset,s.dimension),u=Array.from(o),m=0,l=0;for(let a=0;a<u.length&&a<n.length;a++)m+=u[a]*n[a],l+=u[a]*u[a];l=Math.sqrt(l);let h=l>0?m/(v*l):0;f.push({id:s.pattern_id,score:h})}return f.sort((s,o)=>o.score-s.score),f.slice(0,e)}};function g(i,t){return new d(i,t)}export{d as a,g 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.32");process.exit(0)}
2
- import{b as C,d as P}from"./chunk-OK2TFTXP.js";import{a as T}from"./chunk-YVQ4PR4H.js";import{c as S}from"./chunk-OMOGD2NN.js";import{a as w,c as $}from"./chunk-5WR42V5O.js";import{a as b,d as M}from"./chunk-MQQANXFS.js";$();M();import{randomUUID as D}from"crypto";var x={topology:"hierarchical",maxConcurrentSkills:10,maxConcurrentModels:3,timeout:3e5,continueOnFailure:!0,retry:{maxRetries:2,retryDelayMs:1e3}},R=class{config;learner;skillValidator=null;workers=new Map;taskQueue=[];isRunning=!1;constructor(e,t){this.config={...x,...e},this.learner=t}setSkillValidator(e){this.skillValidator=e}async validateSkillsParallel(e,t,i){let s=Date.now(),a=i?.trustTier??3,n=i?.validationLevel??"eval",c=this.determineTopology(e.length,t.length),r=this.createValidationTasks(e,t,a,n),o=await this.executeTasksParallel(r,c),l=new Map;for(let u of o){let p=l.get(u.skill)||[];p.push(u),l.set(u.skill,p)}return await this.recordOutcomesToLearner(o,a,n),l}async validateSkillCrossModel(e,t,i){return(await this.validateSkillsParallel([e],t,i)).get(e)||[]}getSummary(e){let t=[],i=new Map,s=new Map;for(let[c,r]of e){i.set(c,r);for(let o of r){t.push(o);let l=s.get(o.model)||[];l.push(o),s.set(o.model,l)}}let a=t.filter(c=>c.errors.length===0&&c.evalPassRate>=.9).length,n=t.reduce((c,r)=>c+r.durationMs,0);return{totalSkills:i.size,totalModels:s.size,successCount:a,failureCount:t.length-a,overallPassRate:t.length>0?a/t.length:0,totalDurationMs:n,avgDurationMs:t.length>0?n/t.length:0,topology:this.config.topology,bySkill:i,byModel:s,results:t}}determineTopology(e,t){if(this.config.topology){let i=e*t;return i>20&&this.config.topology==="mesh"&&console.warn(`[SwarmSkillValidator] Large workload (${i} tasks) may be more efficient with hierarchical topology`),this.config.topology}return e>5||e>t*2?"hierarchical":t>5&&e<=3?"mesh":"hierarchical"}createValidationTasks(e,t,i,s){let a=[];for(let n of e)for(let c of t)a.push({id:`${n}-${c}-${Date.now()}-${D().slice(0,8)}`,skill:n,model:c,trustTier:i,validationLevel:s,timeout:this.config.timeout,retryCount:0});return a}async executeTasksParallel(e,t){this.isRunning=!0,this.taskQueue=[...e];let i=[],s=t==="hierarchical"?this.config.maxConcurrentSkills:Math.min(this.config.maxConcurrentSkills*this.config.maxConcurrentModels,e.length),a=[];for(let n=0;n<Math.min(s,e.length);n++){let c=`worker-${n}`;this.workers.set(c,{id:c,task:null,status:"idle"}),a.push(this.runWorker(c,i))}return await Promise.all(a),this.isRunning=!1,this.workers.clear(),i}async runWorker(e,t){let i=this.workers.get(e);if(i){for(;this.taskQueue.length>0&&this.isRunning;){let s=this.taskQueue.shift();if(!s)break;i.task=s,i.status="running",i.startTime=Date.now();try{let a=await this.executeValidationTask(s);t.push(a),i.result=a,i.status="completed"}catch(a){let n=this.createErrorResult(s,a);this.config.retry&&s.retryCount<this.config.retry.maxRetries&&this.config.continueOnFailure?(s.retryCount++,this.taskQueue.push(s),await this.delay(this.config.retry.retryDelayMs)):(t.push(n),i.result=n,i.status="failed")}}i.task=null,i.status="idle"}}async executeValidationTask(e){let t=Date.now();if(!this.skillValidator)return this.createSimulatedResult(e,t);let i=new Promise((n,c)=>{setTimeout(()=>c(new Error(`Validation timeout after ${e.timeout}ms`)),e.timeout)}),s=await Promise.race([this.skillValidator(e.skill,e.model,{trustTier:e.trustTier,validationLevel:e.validationLevel,timeout:e.timeout}),i]),a=Date.now()-t;return this.outcomeToResult(s,e,a)}outcomeToResult(e,t,i){let s=e.testCaseResults.filter(c=>c.passed).length,a=e.testCaseResults.length,n=a>0?s/a:e.score;return{skill:t.skill,model:t.model,schemaValid:e.validationLevel!=="schema"||e.passed,validatorPassed:e.validationLevel!=="validator"||e.passed,evalPassRate:n,durationMs:i,errors:e.passed?[]:["Validation failed"],trustTier:t.trustTier,validationLevel:t.validationLevel,retryCount:t.retryCount,timestamp:new Date}}createSimulatedResult(e,t){let i=Date.now()-t+b()*100,s=.85+b()*.15;return{skill:e.skill,model:e.model,schemaValid:!0,validatorPassed:s>.8,evalPassRate:s,durationMs:i,errors:s>.8?[]:["Simulated validation failure"],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}createErrorResult(e,t){let i=w(t);return{skill:e.skill,model:e.model,schemaValid:!1,validatorPassed:!1,evalPassRate:0,durationMs:0,errors:[i],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}async recordOutcomesToLearner(e,t,i){for(let s of e){let a={skillName:s.skill,trustTier:s.trustTier||t,validationLevel:s.validationLevel||i,model:s.model,passed:s.errors.length===0&&s.evalPassRate>=.9,score:s.evalPassRate,testCaseResults:this.createTestCaseResults(s),timestamp:s.timestamp,runId:`swarm-${Date.now()}`,metadata:{duration:s.durationMs,retryCount:s.retryCount}};await this.learner.recordValidationOutcome(a)}}createTestCaseResults(e){return[{testId:`${e.skill}-${e.model}-aggregate`,passed:e.errors.length===0,expectedPatterns:["valid-output"],actualPatterns:e.errors.length===0?["valid-output"]:[],reasoningQuality:e.evalPassRate,executionTimeMs:e.durationMs,category:"swarm-validation",priority:"high",error:e.errors.length>0?e.errors.join("; "):void 0}]}delay(e){return new Promise(t=>setTimeout(t,e))}getConfig(){return{...this.config}}isValidationRunning(){return this.isRunning}getWorkerStatus(){return Array.from(this.workers.values())}cancel(){this.isRunning=!1,this.taskQueue=[]}};function A(y,e){return new R(y,e)}var F=["security-testing","accessibility-testing","api-testing","performance-testing","visual-regression-testing","mutation-testing","contract-testing","chaos-testing","compliance-testing","penetration-testing"],I=["claude-sonnet","claude-haiku","claude-opus"];P();import{readFileSync as L,writeFileSync as E,existsSync as N}from"fs";var O={varianceThreshold:.04,regressionThreshold:.1,minSamples:3,autoUpdateManifest:!1},k=class{constructor(e,t,i={}){this.learner=e;this.manifestPath=t;this.config={...O,...i}}learner;manifestPath;config;async aggregateResults(e){let t=`agg-${Date.now()}`,i=new Date,s=this.buildSkillResultsMap(e),a=this.calculateSummary(s,e),n=await this.detectCrossModelAnomalies(e),c=await this.detectRegressions(e,this.config.regressionThreshold),r=this.generateRecommendations(s,n,c),o={timestamp:i,runId:t,summary:a,skillResults:s,crossModelAnalysis:n,regressions:c,recommendations:r,metadata:{version:"1.0.0",environment:e[0]?.metadata?.environment,generatedBy:"ValidationResultAggregator",inputs:{runIds:e.map(l=>l.runId),models:[...new Set(e.map(l=>l.model))]}}};return this.config.autoUpdateManifest&&await this.updateManifest(o),o}buildSkillResultsMap(e){let t=new Map;for(let i of e)for(let s of i.outcomes){let a=s.skillName;t.has(a)||t.set(a,{skill:a,trustTier:s.trustTier,passRateByModel:new Map,avgPassRate:0,schemaValid:!0,validatorPassed:!0,evalPassed:!0,issues:[],executionTimeMs:0,testCount:0,passedTests:0,failedTests:0});let n=t.get(a),c=s.testCaseResults.filter(r=>r.passed).length/(s.testCaseResults.length||1);n.passRateByModel.set(i.model,c),n.testCount+=s.testCaseResults.length,n.passedTests+=s.testCaseResults.filter(r=>r.passed).length,n.failedTests+=s.testCaseResults.filter(r=>!r.passed).length,n.executionTimeMs+=s.metadata?.duration||0,s.validationLevel==="schema"&&!s.passed&&(n.schemaValid=!1),s.validationLevel==="validator"&&!s.passed&&(n.validatorPassed=!1),s.validationLevel==="eval"&&!s.passed&&(n.evalPassed=!1);for(let r of s.testCaseResults)!r.passed&&r.error&&n.issues.push({skill:a,model:i.model,severity:r.priority==="critical"?"critical":r.priority==="high"?"high":r.priority==="medium"?"medium":"low",type:this.categorizeIssueType(s.validationLevel,r.error),message:r.error,testId:r.testId})}for(let i of t.values()){let s=Array.from(i.passRateByModel.values());i.avgPassRate=s.length>0?s.reduce((a,n)=>a+n,0)/s.length:0}return t}categorizeIssueType(e,t){return t.toLowerCase().includes("timeout")?"timeout":e==="schema"?"schema_failure":e==="validator"?"validator_failure":e==="eval"?"eval_failure":"error"}calculateSummary(e,t){let i=Array.from(e.values()),s=i.filter(n=>n.avgPassRate>=.9).length,a=i.length>0?i.reduce((n,c)=>n+c.avgPassRate,0)/i.length:0;return{totalSkills:i.length,passedSkills:s,failedSkills:i.length-s,avgPassRate:a,totalDurationMs:t.reduce((n,c)=>n+c.durationMs,0),totalTests:i.reduce((n,c)=>n+c.testCount,0),passedTests:i.reduce((n,c)=>n+c.passedTests,0),failedTests:i.reduce((n,c)=>n+c.failedTests,0),modelsUsed:[...new Set(t.map(n=>n.model))]}}async detectCrossModelAnomalies(e){let t=new Map,i=new Map,s=new Map;for(let d of e){t.has(d.model)||(t.set(d.model,[]),i.set(d.model,{totalTests:0,passedTests:0,skillCount:0}));for(let g of d.outcomes){let h=g.testCaseResults.filter(m=>m.passed).length/(g.testCaseResults.length||1);t.get(d.model).push(h);let f=i.get(d.model);f.totalTests+=g.testCaseResults.length,f.passedTests+=g.testCaseResults.filter(m=>m.passed).length,f.skillCount++,s.has(g.skillName)||s.set(g.skillName,{passRates:[],models:[]}),s.get(g.skillName).passRates.push(h),s.get(g.skillName).models.push(d.model)}}let a=[];for(let d of t.values())a.push(...d);let n=a.length>0?a.reduce((d,g)=>d+g,0)/a.length:0,c=a.length>1?a.reduce((d,g)=>d+Math.pow(g-n,2),0)/a.length:0,r=Math.sqrt(c),o=[],l=new Map;for(let[d,g]of t.entries()){let h=g.reduce((v,V)=>v+V,0)/g.length,f=h-n,m=i.get(d);l.set(d,{avgPassRate:h,skillCount:m.skillCount,totalTests:m.totalTests}),Math.abs(f)>this.config.varianceThreshold*2&&o.push({model:d,type:f<0?"low_performance":"high_variance",description:`Model ${d} has ${(f*100).toFixed(1)}% difference from average`,passRate:h,avgPassRate:n,deviation:Math.abs(f)})}let u=[],p=[];for(let[d,g]of s.entries()){if(g.passRates.length<2)continue;let h=g.passRates.reduce((m,v)=>m+v,0)/g.passRates.length;g.passRates.reduce((m,v)=>m+Math.pow(v-h,2),0)/g.passRates.length<this.config.varianceThreshold?u.push(d):p.push(d)}return{variance:c,stdDeviation:r,anomalies:o,consistentSkills:u,inconsistentSkills:p,modelPerformance:l}}async detectRegressions(e,t){let i=[],s=new Set;for(let a of e)for(let n of a.outcomes){let c=`${n.skillName}-${a.model}`;if(s.has(c))continue;s.add(c);let r=await this.learner.getValidationTrends(n.skillName);if(!r)continue;let o=n.testCaseResults.filter(p=>p.passed).length/(n.testCaseResults.length||1),l=r.recentPassRate,u=l-o;u>=t&&i.push({skill:n.skillName,model:a.model,previousPassRate:l,currentPassRate:o,regressionAmount:u,trend:r.overall,possibleCauses:this.analyzePossibleCauses(n,u),severity:this.categorizeRegressionSeverity(u)})}return i.sort((a,n)=>{let c={critical:0,high:1,medium:2,low:3},r=c[a.severity]-c[n.severity];return r!==0?r:n.regressionAmount-a.regressionAmount})}analyzePossibleCauses(e,t){let i=[],s=e.testCaseResults.filter(c=>!c.passed);if(s.length>0){let c=[...new Set(s.map(r=>r.category).filter(Boolean))];c.length>0&&i.push(`Failures in categories: ${c.join(", ")}`)}let a=s.filter(c=>c.priority==="critical");a.length>0&&i.push(`${a.length} critical test(s) failing`);let n=e.testCaseResults.reduce((c,r)=>c+r.reasoningQuality,0)/(e.testCaseResults.length||1);return n<.7&&i.push(`Low reasoning quality score: ${(n*100).toFixed(1)}%`),t>.3&&i.push("Possible model behavior change or prompt drift"),i.length===0&&i.push("No specific cause identified - review test details"),i}categorizeRegressionSeverity(e){return e>=.5?"critical":e>=.3?"high":e>=.15?"medium":"low"}generateRecommendations(e,t,i){let s=[];if(t.inconsistentSkills.length>0&&s.push(`Review ${t.inconsistentSkills.length} skills with inconsistent cross-model behavior: `+t.inconsistentSkills.slice(0,3).join(", ")+(t.inconsistentSkills.length>3?` and ${t.inconsistentSkills.length-3} more`:"")),t.anomalies.some(r=>r.type==="low_performance")){let r=t.anomalies.filter(o=>o.type==="low_performance").map(o=>o.model);s.push(`Investigate low performance on model(s): ${r.join(", ")}`)}let a=i.filter(r=>r.severity==="critical");a.length>0&&s.push(`URGENT: ${a.length} critical regression(s) detected - immediate review required`);let n=Array.from(e.values()).filter(r=>r.avgPassRate<.9);if(n.length>0){let r=n.filter(l=>!l.schemaValid),o=n.filter(l=>!l.validatorPassed);r.length>0&&s.push(`Fix schema validation for: ${r.map(l=>l.skill).slice(0,3).join(", ")}`),o.length>0&&s.push(`Review validator scripts for: ${o.map(l=>l.skill).slice(0,3).join(", ")}`)}return Array.from(e.values()).reduce((r,o)=>r+o.avgPassRate,0)/e.size<.8&&s.push("Overall pass rate below 80% - consider reviewing skill definitions and test expectations"),s.length===0&&s.push("All validations passing - no immediate action required"),s}async updateManifest(e){if(!N(this.manifestPath))throw new Error(`Manifest file not found: ${this.manifestPath}`);let t=C(L(this.manifestPath,"utf-8"));for(let[s,a]of e.skillResults.entries())if(t.skills&&t.skills[s]){let n=t.skills[s];n.validation||(n.validation={}),n.validation.passRate=a.avgPassRate,n.validation.lastValidated=e.timestamp.toISOString(),n.validation.status=a.avgPassRate>=.9?"passing":"failing",n.validation.passRateByModel=Object.fromEntries(a.passRateByModel)}let i=Array.from(e.skillResults.values());t.validationStatus={passing:i.filter(s=>s.avgPassRate>=.9).length,failing:i.filter(s=>s.avgPassRate<.9).length,unknown:0,skipped:t.summary?.tier0||0},t.generatedAt=new Date().toISOString(),t.lastValidationRun={runId:e.runId,timestamp:e.timestamp.toISOString(),avgPassRate:e.summary.avgPassRate,modelsUsed:e.summary.modelsUsed},E(this.manifestPath,JSON.stringify(t,null,2))}generateMarkdownReport(e){let{summary:t,crossModelAnalysis:i,regressions:s,recommendations:a,skillResults:n}=e,c=(t.avgPassRate>=.9||t.avgPassRate>=.7,"`"),r=[];if(r.push(`# Validation Report
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.34");process.exit(0)}
2
+ import{b as C,d as P}from"./chunk-VR65KHTH.js";import{a as T}from"./chunk-DXOFPU3A.js";import{c as S}from"./chunk-PMFV3ZFP.js";import{a as w,c as $}from"./chunk-I74WDBHS.js";import{a as b,d as M}from"./chunk-YIVJD5IY.js";$();M();import{randomUUID as D}from"crypto";var x={topology:"hierarchical",maxConcurrentSkills:10,maxConcurrentModels:3,timeout:3e5,continueOnFailure:!0,retry:{maxRetries:2,retryDelayMs:1e3}},R=class{config;learner;skillValidator=null;workers=new Map;taskQueue=[];isRunning=!1;constructor(e,t){this.config={...x,...e},this.learner=t}setSkillValidator(e){this.skillValidator=e}async validateSkillsParallel(e,t,i){let s=Date.now(),a=i?.trustTier??3,n=i?.validationLevel??"eval",c=this.determineTopology(e.length,t.length),r=this.createValidationTasks(e,t,a,n),o=await this.executeTasksParallel(r,c),l=new Map;for(let u of o){let p=l.get(u.skill)||[];p.push(u),l.set(u.skill,p)}return await this.recordOutcomesToLearner(o,a,n),l}async validateSkillCrossModel(e,t,i){return(await this.validateSkillsParallel([e],t,i)).get(e)||[]}getSummary(e){let t=[],i=new Map,s=new Map;for(let[c,r]of e){i.set(c,r);for(let o of r){t.push(o);let l=s.get(o.model)||[];l.push(o),s.set(o.model,l)}}let a=t.filter(c=>c.errors.length===0&&c.evalPassRate>=.9).length,n=t.reduce((c,r)=>c+r.durationMs,0);return{totalSkills:i.size,totalModels:s.size,successCount:a,failureCount:t.length-a,overallPassRate:t.length>0?a/t.length:0,totalDurationMs:n,avgDurationMs:t.length>0?n/t.length:0,topology:this.config.topology,bySkill:i,byModel:s,results:t}}determineTopology(e,t){if(this.config.topology){let i=e*t;return i>20&&this.config.topology==="mesh"&&console.warn(`[SwarmSkillValidator] Large workload (${i} tasks) may be more efficient with hierarchical topology`),this.config.topology}return e>5||e>t*2?"hierarchical":t>5&&e<=3?"mesh":"hierarchical"}createValidationTasks(e,t,i,s){let a=[];for(let n of e)for(let c of t)a.push({id:`${n}-${c}-${Date.now()}-${D().slice(0,8)}`,skill:n,model:c,trustTier:i,validationLevel:s,timeout:this.config.timeout,retryCount:0});return a}async executeTasksParallel(e,t){this.isRunning=!0,this.taskQueue=[...e];let i=[],s=t==="hierarchical"?this.config.maxConcurrentSkills:Math.min(this.config.maxConcurrentSkills*this.config.maxConcurrentModels,e.length),a=[];for(let n=0;n<Math.min(s,e.length);n++){let c=`worker-${n}`;this.workers.set(c,{id:c,task:null,status:"idle"}),a.push(this.runWorker(c,i))}return await Promise.all(a),this.isRunning=!1,this.workers.clear(),i}async runWorker(e,t){let i=this.workers.get(e);if(i){for(;this.taskQueue.length>0&&this.isRunning;){let s=this.taskQueue.shift();if(!s)break;i.task=s,i.status="running",i.startTime=Date.now();try{let a=await this.executeValidationTask(s);t.push(a),i.result=a,i.status="completed"}catch(a){let n=this.createErrorResult(s,a);this.config.retry&&s.retryCount<this.config.retry.maxRetries&&this.config.continueOnFailure?(s.retryCount++,this.taskQueue.push(s),await this.delay(this.config.retry.retryDelayMs)):(t.push(n),i.result=n,i.status="failed")}}i.task=null,i.status="idle"}}async executeValidationTask(e){let t=Date.now();if(!this.skillValidator)return this.createSimulatedResult(e,t);let i=new Promise((n,c)=>{setTimeout(()=>c(new Error(`Validation timeout after ${e.timeout}ms`)),e.timeout)}),s=await Promise.race([this.skillValidator(e.skill,e.model,{trustTier:e.trustTier,validationLevel:e.validationLevel,timeout:e.timeout}),i]),a=Date.now()-t;return this.outcomeToResult(s,e,a)}outcomeToResult(e,t,i){let s=e.testCaseResults.filter(c=>c.passed).length,a=e.testCaseResults.length,n=a>0?s/a:e.score;return{skill:t.skill,model:t.model,schemaValid:e.validationLevel!=="schema"||e.passed,validatorPassed:e.validationLevel!=="validator"||e.passed,evalPassRate:n,durationMs:i,errors:e.passed?[]:["Validation failed"],trustTier:t.trustTier,validationLevel:t.validationLevel,retryCount:t.retryCount,timestamp:new Date}}createSimulatedResult(e,t){let i=Date.now()-t+b()*100,s=.85+b()*.15;return{skill:e.skill,model:e.model,schemaValid:!0,validatorPassed:s>.8,evalPassRate:s,durationMs:i,errors:s>.8?[]:["Simulated validation failure"],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}createErrorResult(e,t){let i=w(t);return{skill:e.skill,model:e.model,schemaValid:!1,validatorPassed:!1,evalPassRate:0,durationMs:0,errors:[i],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}async recordOutcomesToLearner(e,t,i){for(let s of e){let a={skillName:s.skill,trustTier:s.trustTier||t,validationLevel:s.validationLevel||i,model:s.model,passed:s.errors.length===0&&s.evalPassRate>=.9,score:s.evalPassRate,testCaseResults:this.createTestCaseResults(s),timestamp:s.timestamp,runId:`swarm-${Date.now()}`,metadata:{duration:s.durationMs,retryCount:s.retryCount}};await this.learner.recordValidationOutcome(a)}}createTestCaseResults(e){return[{testId:`${e.skill}-${e.model}-aggregate`,passed:e.errors.length===0,expectedPatterns:["valid-output"],actualPatterns:e.errors.length===0?["valid-output"]:[],reasoningQuality:e.evalPassRate,executionTimeMs:e.durationMs,category:"swarm-validation",priority:"high",error:e.errors.length>0?e.errors.join("; "):void 0}]}delay(e){return new Promise(t=>setTimeout(t,e))}getConfig(){return{...this.config}}isValidationRunning(){return this.isRunning}getWorkerStatus(){return Array.from(this.workers.values())}cancel(){this.isRunning=!1,this.taskQueue=[]}};function A(y,e){return new R(y,e)}var F=["security-testing","accessibility-testing","api-testing","performance-testing","visual-regression-testing","mutation-testing","contract-testing","chaos-testing","compliance-testing","penetration-testing"],I=["claude-sonnet","claude-haiku","claude-opus"];P();import{readFileSync as L,writeFileSync as E,existsSync as N}from"fs";var O={varianceThreshold:.04,regressionThreshold:.1,minSamples:3,autoUpdateManifest:!1},k=class{constructor(e,t,i={}){this.learner=e;this.manifestPath=t;this.config={...O,...i}}learner;manifestPath;config;async aggregateResults(e){let t=`agg-${Date.now()}`,i=new Date,s=this.buildSkillResultsMap(e),a=this.calculateSummary(s,e),n=await this.detectCrossModelAnomalies(e),c=await this.detectRegressions(e,this.config.regressionThreshold),r=this.generateRecommendations(s,n,c),o={timestamp:i,runId:t,summary:a,skillResults:s,crossModelAnalysis:n,regressions:c,recommendations:r,metadata:{version:"1.0.0",environment:e[0]?.metadata?.environment,generatedBy:"ValidationResultAggregator",inputs:{runIds:e.map(l=>l.runId),models:[...new Set(e.map(l=>l.model))]}}};return this.config.autoUpdateManifest&&await this.updateManifest(o),o}buildSkillResultsMap(e){let t=new Map;for(let i of e)for(let s of i.outcomes){let a=s.skillName;t.has(a)||t.set(a,{skill:a,trustTier:s.trustTier,passRateByModel:new Map,avgPassRate:0,schemaValid:!0,validatorPassed:!0,evalPassed:!0,issues:[],executionTimeMs:0,testCount:0,passedTests:0,failedTests:0});let n=t.get(a),c=s.testCaseResults.filter(r=>r.passed).length/(s.testCaseResults.length||1);n.passRateByModel.set(i.model,c),n.testCount+=s.testCaseResults.length,n.passedTests+=s.testCaseResults.filter(r=>r.passed).length,n.failedTests+=s.testCaseResults.filter(r=>!r.passed).length,n.executionTimeMs+=s.metadata?.duration||0,s.validationLevel==="schema"&&!s.passed&&(n.schemaValid=!1),s.validationLevel==="validator"&&!s.passed&&(n.validatorPassed=!1),s.validationLevel==="eval"&&!s.passed&&(n.evalPassed=!1);for(let r of s.testCaseResults)!r.passed&&r.error&&n.issues.push({skill:a,model:i.model,severity:r.priority==="critical"?"critical":r.priority==="high"?"high":r.priority==="medium"?"medium":"low",type:this.categorizeIssueType(s.validationLevel,r.error),message:r.error,testId:r.testId})}for(let i of t.values()){let s=Array.from(i.passRateByModel.values());i.avgPassRate=s.length>0?s.reduce((a,n)=>a+n,0)/s.length:0}return t}categorizeIssueType(e,t){return t.toLowerCase().includes("timeout")?"timeout":e==="schema"?"schema_failure":e==="validator"?"validator_failure":e==="eval"?"eval_failure":"error"}calculateSummary(e,t){let i=Array.from(e.values()),s=i.filter(n=>n.avgPassRate>=.9).length,a=i.length>0?i.reduce((n,c)=>n+c.avgPassRate,0)/i.length:0;return{totalSkills:i.length,passedSkills:s,failedSkills:i.length-s,avgPassRate:a,totalDurationMs:t.reduce((n,c)=>n+c.durationMs,0),totalTests:i.reduce((n,c)=>n+c.testCount,0),passedTests:i.reduce((n,c)=>n+c.passedTests,0),failedTests:i.reduce((n,c)=>n+c.failedTests,0),modelsUsed:[...new Set(t.map(n=>n.model))]}}async detectCrossModelAnomalies(e){let t=new Map,i=new Map,s=new Map;for(let d of e){t.has(d.model)||(t.set(d.model,[]),i.set(d.model,{totalTests:0,passedTests:0,skillCount:0}));for(let g of d.outcomes){let h=g.testCaseResults.filter(m=>m.passed).length/(g.testCaseResults.length||1);t.get(d.model).push(h);let f=i.get(d.model);f.totalTests+=g.testCaseResults.length,f.passedTests+=g.testCaseResults.filter(m=>m.passed).length,f.skillCount++,s.has(g.skillName)||s.set(g.skillName,{passRates:[],models:[]}),s.get(g.skillName).passRates.push(h),s.get(g.skillName).models.push(d.model)}}let a=[];for(let d of t.values())a.push(...d);let n=a.length>0?a.reduce((d,g)=>d+g,0)/a.length:0,c=a.length>1?a.reduce((d,g)=>d+Math.pow(g-n,2),0)/a.length:0,r=Math.sqrt(c),o=[],l=new Map;for(let[d,g]of t.entries()){let h=g.reduce((v,V)=>v+V,0)/g.length,f=h-n,m=i.get(d);l.set(d,{avgPassRate:h,skillCount:m.skillCount,totalTests:m.totalTests}),Math.abs(f)>this.config.varianceThreshold*2&&o.push({model:d,type:f<0?"low_performance":"high_variance",description:`Model ${d} has ${(f*100).toFixed(1)}% difference from average`,passRate:h,avgPassRate:n,deviation:Math.abs(f)})}let u=[],p=[];for(let[d,g]of s.entries()){if(g.passRates.length<2)continue;let h=g.passRates.reduce((m,v)=>m+v,0)/g.passRates.length;g.passRates.reduce((m,v)=>m+Math.pow(v-h,2),0)/g.passRates.length<this.config.varianceThreshold?u.push(d):p.push(d)}return{variance:c,stdDeviation:r,anomalies:o,consistentSkills:u,inconsistentSkills:p,modelPerformance:l}}async detectRegressions(e,t){let i=[],s=new Set;for(let a of e)for(let n of a.outcomes){let c=`${n.skillName}-${a.model}`;if(s.has(c))continue;s.add(c);let r=await this.learner.getValidationTrends(n.skillName);if(!r)continue;let o=n.testCaseResults.filter(p=>p.passed).length/(n.testCaseResults.length||1),l=r.recentPassRate,u=l-o;u>=t&&i.push({skill:n.skillName,model:a.model,previousPassRate:l,currentPassRate:o,regressionAmount:u,trend:r.overall,possibleCauses:this.analyzePossibleCauses(n,u),severity:this.categorizeRegressionSeverity(u)})}return i.sort((a,n)=>{let c={critical:0,high:1,medium:2,low:3},r=c[a.severity]-c[n.severity];return r!==0?r:n.regressionAmount-a.regressionAmount})}analyzePossibleCauses(e,t){let i=[],s=e.testCaseResults.filter(c=>!c.passed);if(s.length>0){let c=[...new Set(s.map(r=>r.category).filter(Boolean))];c.length>0&&i.push(`Failures in categories: ${c.join(", ")}`)}let a=s.filter(c=>c.priority==="critical");a.length>0&&i.push(`${a.length} critical test(s) failing`);let n=e.testCaseResults.reduce((c,r)=>c+r.reasoningQuality,0)/(e.testCaseResults.length||1);return n<.7&&i.push(`Low reasoning quality score: ${(n*100).toFixed(1)}%`),t>.3&&i.push("Possible model behavior change or prompt drift"),i.length===0&&i.push("No specific cause identified - review test details"),i}categorizeRegressionSeverity(e){return e>=.5?"critical":e>=.3?"high":e>=.15?"medium":"low"}generateRecommendations(e,t,i){let s=[];if(t.inconsistentSkills.length>0&&s.push(`Review ${t.inconsistentSkills.length} skills with inconsistent cross-model behavior: `+t.inconsistentSkills.slice(0,3).join(", ")+(t.inconsistentSkills.length>3?` and ${t.inconsistentSkills.length-3} more`:"")),t.anomalies.some(r=>r.type==="low_performance")){let r=t.anomalies.filter(o=>o.type==="low_performance").map(o=>o.model);s.push(`Investigate low performance on model(s): ${r.join(", ")}`)}let a=i.filter(r=>r.severity==="critical");a.length>0&&s.push(`URGENT: ${a.length} critical regression(s) detected - immediate review required`);let n=Array.from(e.values()).filter(r=>r.avgPassRate<.9);if(n.length>0){let r=n.filter(l=>!l.schemaValid),o=n.filter(l=>!l.validatorPassed);r.length>0&&s.push(`Fix schema validation for: ${r.map(l=>l.skill).slice(0,3).join(", ")}`),o.length>0&&s.push(`Review validator scripts for: ${o.map(l=>l.skill).slice(0,3).join(", ")}`)}return Array.from(e.values()).reduce((r,o)=>r+o.avgPassRate,0)/e.size<.8&&s.push("Overall pass rate below 80% - consider reviewing skill definitions and test expectations"),s.length===0&&s.push("All validations passing - no immediate action required"),s}async updateManifest(e){if(!N(this.manifestPath))throw new Error(`Manifest file not found: ${this.manifestPath}`);let t=C(L(this.manifestPath,"utf-8"));for(let[s,a]of e.skillResults.entries())if(t.skills&&t.skills[s]){let n=t.skills[s];n.validation||(n.validation={}),n.validation.passRate=a.avgPassRate,n.validation.lastValidated=e.timestamp.toISOString(),n.validation.status=a.avgPassRate>=.9?"passing":"failing",n.validation.passRateByModel=Object.fromEntries(a.passRateByModel)}let i=Array.from(e.skillResults.values());t.validationStatus={passing:i.filter(s=>s.avgPassRate>=.9).length,failing:i.filter(s=>s.avgPassRate<.9).length,unknown:0,skipped:t.summary?.tier0||0},t.generatedAt=new Date().toISOString(),t.lastValidationRun={runId:e.runId,timestamp:e.timestamp.toISOString(),avgPassRate:e.summary.avgPassRate,modelsUsed:e.summary.modelsUsed},E(this.manifestPath,JSON.stringify(t,null,2))}generateMarkdownReport(e){let{summary:t,crossModelAnalysis:i,regressions:s,recommendations:a,skillResults:n}=e,c=(t.avgPassRate>=.9||t.avgPassRate>=.7,"`"),r=[];if(r.push(`# Validation Report
3
3
 
4
4
  > ${c} Generated: ${e.timestamp.toISOString()}
5
5
  > Run ID: ${e.runId}
@@ -1,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.32");process.exit(0)}
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.34");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.32");process.exit(0)}
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.34");process.exit(0)}
2
2
  import{existsSync as c,readFileSync as f}from"fs";import{join as p,dirname as i}from"path";import{fileURLToPath as s}from"url";function u(o,a=10){let t=i(s(o));for(let r=0;r<a;r++){let n=p(t,"package.json");if(c(n))try{if(JSON.parse(f(n,"utf-8")).name==="agentic-qe")return t}catch{}let e=i(t);if(e===t)break;t=e}return null}export{u as a};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.32");process.exit(0)}
2
- import{a as S}from"./chunk-YVQ4PR4H.js";import{c as g}from"./chunk-OMOGD2NN.js";import{S as T,b as l}from"./chunk-33PGBYTC.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.34");process.exit(0)}
2
+ import{a as S}from"./chunk-DXOFPU3A.js";import{c as g}from"./chunk-PMFV3ZFP.js";import{S as T,b as l}from"./chunk-QPH72S4A.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.32");process.exit(0)}
2
- import{a as o,e as p}from"./chunk-BBPOTFIY.js";import{a as l,d}from"./chunk-YJV6TTCW.js";d();p();var u=class{store=new Map;vectors=new Map;cleanupInterval;async initialize(){this.cleanupInterval=setInterval(()=>this.cleanup(),o.CLEANUP_INTERVAL_MS),this.cleanupInterval.unref&&this.cleanupInterval.unref()}async dispose(){this.cleanupInterval&&clearInterval(this.cleanupInterval),this.store.clear(),this.vectors.clear()}async set(t,r,e){let s={value:r,namespace:e?.namespace??"default",createdAt:Date.now()};e?.ttl&&(s.expiresAt=Date.now()+e.ttl*o.TTL_MULTIPLIER_MS);let n=this.buildKey(t,e?.namespace);this.store.set(n,s)}async get(t,r){let e=this.buildKey(t,r?.namespace),s=this.store.get(e);if(s){if(s.expiresAt&&Date.now()>s.expiresAt){this.store.delete(e);return}return s.value}}async delete(t,r){let e=this.buildKey(t,r?.namespace);return this.store.delete(e)}async has(t,r){return await this.get(t,r)!==void 0}async search(t,r=o.DEFAULT_SEARCH_LIMIT,e){let s=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(s.replace(/\*/g,".*")),i=[],c=e?.namespace?`${e.namespace}:`:void 0;for(let a of this.store.keys())if(!(c&&!a.startsWith(c))&&n.test(a)&&(i.push(a),i.length>=r))break;return i}async vectorSearch(t,r){let e=[];for(let[s,n]of this.vectors.entries()){let i=l(t,n.embedding);e.push({key:s,score:i,metadata:n.metadata})}return e.sort((s,n)=>n.score-s.score).slice(0,r)}async storeVector(t,r,e){this.vectors.set(t,{embedding:r,metadata:e})}buildKey(t,r){return r?`${r}:${t}`:t}cleanup(){let t=Date.now();for(let[r,e]of this.store.entries())e.expiresAt&&t>e.expiresAt&&this.store.delete(r)}getStats(){return{entries:this.store.size,vectors:this.vectors.size}}async clear(t){if(t){let r=`${t}:`;for(let e of this.store.keys())e.startsWith(r)&&this.store.delete(e)}else this.store.clear()}async count(t){let r=0,e=`${t}:`;for(let s of this.store.keys())if(s.startsWith(e)){let n=this.store.get(s);n&&(!n.expiresAt||Date.now()<=n.expiresAt)&&r++}return r}async hasCodeIntelligenceIndex(){return await this.count("code-intelligence:kg")>0}};export{u as a};
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.34");process.exit(0)}
2
+ import{a as o,e as p}from"./chunk-QX74JLGO.js";import{a as l,d}from"./chunk-REVCXO2R.js";d();p();var u=class{store=new Map;vectors=new Map;cleanupInterval;async initialize(){this.cleanupInterval=setInterval(()=>this.cleanup(),o.CLEANUP_INTERVAL_MS),this.cleanupInterval.unref&&this.cleanupInterval.unref()}async dispose(){this.cleanupInterval&&clearInterval(this.cleanupInterval),this.store.clear(),this.vectors.clear()}async set(t,r,e){let s={value:r,namespace:e?.namespace??"default",createdAt:Date.now()};e?.ttl&&(s.expiresAt=Date.now()+e.ttl*o.TTL_MULTIPLIER_MS);let n=this.buildKey(t,e?.namespace);this.store.set(n,s)}async get(t,r){let e=this.buildKey(t,r?.namespace),s=this.store.get(e);if(s){if(s.expiresAt&&Date.now()>s.expiresAt){this.store.delete(e);return}return s.value}}async delete(t,r){let e=this.buildKey(t,r?.namespace);return this.store.delete(e)}async has(t,r){return await this.get(t,r)!==void 0}async search(t,r=o.DEFAULT_SEARCH_LIMIT,e){let s=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(s.replace(/\*/g,".*")),i=[],c=e?.namespace?`${e.namespace}:`:void 0;for(let a of this.store.keys())if(!(c&&!a.startsWith(c))&&n.test(a)&&(i.push(a),i.length>=r))break;return i}async vectorSearch(t,r){let e=[];for(let[s,n]of this.vectors.entries()){let i=l(t,n.embedding);e.push({key:s,score:i,metadata:n.metadata})}return e.sort((s,n)=>n.score-s.score).slice(0,r)}async storeVector(t,r,e){this.vectors.set(t,{embedding:r,metadata:e})}buildKey(t,r){return r?`${r}:${t}`:t}cleanup(){let t=Date.now();for(let[r,e]of this.store.entries())e.expiresAt&&t>e.expiresAt&&this.store.delete(r)}getStats(){return{entries:this.store.size,vectors:this.vectors.size}}async clear(t){if(t){let r=`${t}:`;for(let e of this.store.keys())e.startsWith(r)&&this.store.delete(e)}else this.store.clear()}async count(t){let r=0,e=`${t}:`;for(let s of this.store.keys())if(s.startsWith(e)){let n=this.store.get(s);n&&(!n.expiresAt||Date.now()<=n.expiresAt)&&r++}return r}async hasCodeIntelligenceIndex(){return await this.count("code-intelligence:kg")>0}};export{u as a};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.32");process.exit(0)}
2
- import{i as e}from"./chunk-WTNM7NA4.js";function g(t,n,r,a){return{id:e(),type:t,timestamp:new Date,source:n,correlationId:a,payload:r}}var i={TestGenerated:"test-generation.TestGenerated",TestSuiteCreated:"test-generation.TestSuiteCreated",PatternLearned:"test-generation.PatternLearned",GenerationFailed:"test-generation.GenerationFailed"},o={TestRunStarted:"test-execution.TestRunStarted",TestRunCompleted:"test-execution.TestRunCompleted",FlakyTestDetected:"test-execution.FlakyTestDetected",RetryTriggered:"test-execution.RetryTriggered"},s={CoverageReportCreated:"coverage-analysis.CoverageReportCreated",CoverageGapDetected:"coverage-analysis.CoverageGapDetected",RiskZoneIdentified:"coverage-analysis.RiskZoneIdentified"},d={QualityGateEvaluated:"quality-assessment.QualityGateEvaluated",DeploymentApproved:"quality-assessment.DeploymentApproved",DeploymentBlocked:"quality-assessment.DeploymentBlocked"},l={DefectPredicted:"defect-intelligence.DefectPredicted",RootCauseIdentified:"defect-intelligence.RootCauseIdentified",RegressionRiskAnalyzed:"defect-intelligence.RegressionRiskAnalyzed"},c={KnowledgeGraphUpdated:"code-intelligence.KnowledgeGraphUpdated",ImpactAnalysisCompleted:"code-intelligence.ImpactAnalysisCompleted",SemanticSearchCompleted:"code-intelligence.SemanticSearchCompleted",C4DiagramsGenerated:"code-intelligence.C4DiagramsGenerated"},m={VulnerabilityDetected:"security-compliance.VulnerabilityDetected",ComplianceValidated:"security-compliance.ComplianceValidated",SecurityAuditCompleted:"security-compliance.SecurityAuditCompleted"},p={PatternConsolidated:"learning-optimization.PatternConsolidated",TransferCompleted:"learning-optimization.TransferCompleted",OptimizationApplied:"learning-optimization.OptimizationApplied",DreamCycleCompleted:"learning-optimization.dream.completed"},y={...i,...o,...s,...d,...l,...c,...m,...p};export{g as a,i as b,o as c,s as d,d as e,l as f,c as g,m as h,p 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.34");process.exit(0)}
2
+ import{i as e}from"./chunk-5H44TVAY.js";function g(t,n,r,a){return{id:e(),type:t,timestamp:new Date,source:n,correlationId:a,payload:r}}var i={TestGenerated:"test-generation.TestGenerated",TestSuiteCreated:"test-generation.TestSuiteCreated",PatternLearned:"test-generation.PatternLearned",GenerationFailed:"test-generation.GenerationFailed"},o={TestRunStarted:"test-execution.TestRunStarted",TestRunCompleted:"test-execution.TestRunCompleted",FlakyTestDetected:"test-execution.FlakyTestDetected",RetryTriggered:"test-execution.RetryTriggered"},s={CoverageReportCreated:"coverage-analysis.CoverageReportCreated",CoverageGapDetected:"coverage-analysis.CoverageGapDetected",RiskZoneIdentified:"coverage-analysis.RiskZoneIdentified"},d={QualityGateEvaluated:"quality-assessment.QualityGateEvaluated",DeploymentApproved:"quality-assessment.DeploymentApproved",DeploymentBlocked:"quality-assessment.DeploymentBlocked"},l={DefectPredicted:"defect-intelligence.DefectPredicted",RootCauseIdentified:"defect-intelligence.RootCauseIdentified",RegressionRiskAnalyzed:"defect-intelligence.RegressionRiskAnalyzed"},c={KnowledgeGraphUpdated:"code-intelligence.KnowledgeGraphUpdated",ImpactAnalysisCompleted:"code-intelligence.ImpactAnalysisCompleted",SemanticSearchCompleted:"code-intelligence.SemanticSearchCompleted",C4DiagramsGenerated:"code-intelligence.C4DiagramsGenerated"},m={VulnerabilityDetected:"security-compliance.VulnerabilityDetected",ComplianceValidated:"security-compliance.ComplianceValidated",SecurityAuditCompleted:"security-compliance.SecurityAuditCompleted"},p={PatternConsolidated:"learning-optimization.PatternConsolidated",TransferCompleted:"learning-optimization.TransferCompleted",OptimizationApplied:"learning-optimization.OptimizationApplied",DreamCycleCompleted:"learning-optimization.dream.completed"},y={...i,...o,...s,...d,...l,...c,...m,...p};export{g as a,i as b,o as c,s as d,d as e,l as f,c as g,m as h,p as i};