agentic-qe 3.10.1 → 3.10.2

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 (325) hide show
  1. package/.claude/hooks/README.txt +17 -0
  2. package/.claude/hooks/aqe-hook.cjs +98 -0
  3. package/.claude/hooks/cross-phase-memory.yaml +296 -0
  4. package/.claude/hooks/post-task-sync.sh +113 -0
  5. package/.claude/hooks/v3-domain-workers.json +121 -0
  6. package/.claude/skills/skills-manifest.json +1 -1
  7. package/CHANGELOG.md +76 -0
  8. package/dist/cli/bundle.js +5 -5
  9. package/dist/cli/chunks/adapter-CR6J5C76.js +2 -0
  10. package/dist/cli/chunks/{agent-booster-wasm-FZLWOPSX.js → agent-booster-wasm-DHSIPFTH.js} +2 -2
  11. package/dist/cli/chunks/{agent-handler-KAGRVCKS.js → agent-handler-FPQVHGGT.js} +2 -2
  12. package/dist/cli/chunks/{agent-memory-branch-JJKFEXQW.js → agent-memory-branch-OLOF5ZHV.js} +2 -2
  13. package/dist/cli/chunks/aqe-learning-engine-2MNTHMB6.js +2 -0
  14. package/dist/cli/chunks/{audit-DN5SY4JJ.js → audit-ALRYPHGP.js} +2 -2
  15. package/dist/cli/chunks/base-AOQNGMTL.js +2 -0
  16. package/dist/cli/chunks/{hnswlib-node-YX6OOBN6.js → better-sqlite3-5BT5FO64.js} +2 -2
  17. package/dist/cli/chunks/{brain-handler-O7MP5BGY.js → brain-handler-ROZUHCOT.js} +3 -3
  18. package/dist/cli/chunks/{branch-enumerator-ZPTN5J6V.js → branch-enumerator-VK7G4NKJ.js} +2 -2
  19. package/dist/cli/chunks/{browser-PAZE2JSD.js → browser-Q2S75M2F.js} +2 -2
  20. package/dist/cli/chunks/browser-workflow-UJ4A2ZXO.js +2 -0
  21. package/dist/cli/chunks/{chunk-WDTCCPK4.js → chunk-2244IFZA.js} +1 -1
  22. package/dist/cli/chunks/{chunk-WPNZSL4S.js → chunk-22D6VBPD.js} +1 -1
  23. package/dist/cli/chunks/{chunk-2KTRRSKD.js → chunk-24LUQICS.js} +2 -2
  24. package/dist/cli/chunks/{chunk-IHDUWPFY.js → chunk-2EDWGHDA.js} +2 -2
  25. package/dist/cli/chunks/{chunk-TP77PNN6.js → chunk-2JDLQWSV.js} +2 -2
  26. package/dist/cli/chunks/{chunk-GTGONWGX.js → chunk-2OH3ALYB.js} +1 -1
  27. package/dist/cli/chunks/{chunk-WMG5F6R6.js → chunk-3RHHKYUR.js} +2 -2
  28. package/dist/cli/chunks/{chunk-6E7GI2UB.js → chunk-3Z4FHA2E.js} +1 -1
  29. package/dist/cli/chunks/{chunk-JLKHPIQF.js → chunk-4BXGVM2C.js} +1 -1
  30. package/dist/cli/chunks/{chunk-6D57DWQ6.js → chunk-4F3ZTXHP.js} +2 -2
  31. package/dist/cli/chunks/{chunk-3YOPJ7DY.js → chunk-4GTDW2XL.js} +2 -2
  32. package/dist/cli/chunks/{chunk-W2DT3CDE.js → chunk-5HB54RUS.js} +2 -2
  33. package/dist/cli/chunks/{chunk-LF7URN2X.js → chunk-5PL7WTCU.js} +2 -2
  34. package/dist/cli/chunks/{chunk-Y357YFLF.js → chunk-5PRFFHFV.js} +2 -2
  35. package/dist/cli/chunks/{chunk-GXJ4BCGC.js → chunk-5QHSLWLP.js} +2 -2
  36. package/dist/cli/chunks/{chunk-TL5F2S3Z.js → chunk-5WJ3FWL4.js} +2 -2
  37. package/dist/cli/chunks/{chunk-ZTMWJQTZ.js → chunk-6KSCXPPL.js} +2 -2
  38. package/dist/cli/chunks/{chunk-SQBB2DC6.js → chunk-6NZHEM4V.js} +1 -1
  39. package/dist/cli/chunks/{chunk-EUJHHXE6.js → chunk-6ZFHIKQG.js} +2 -2
  40. package/dist/cli/chunks/{chunk-YPOTBXPU.js → chunk-7DKYCVJI.js} +2 -2
  41. package/dist/cli/chunks/{chunk-DQIS6J77.js → chunk-7IVQ6OVR.js} +2 -2
  42. package/dist/cli/chunks/{chunk-DMIYWPQQ.js → chunk-7IZ2OPC2.js} +2 -2
  43. package/dist/cli/chunks/{chunk-VOIWDPIU.js → chunk-7QRMARM7.js} +2 -2
  44. package/dist/cli/chunks/{chunk-KEC5FBAW.js → chunk-7SJX4CFK.js} +1 -1
  45. package/dist/cli/chunks/{chunk-2S4XHK26.js → chunk-7SWD3D6Y.js} +2 -2
  46. package/dist/cli/chunks/{chunk-RRLQFFCO.js → chunk-7V5UHLNY.js} +2 -2
  47. package/dist/cli/chunks/{chunk-G3BQU3Q6.js → chunk-7Z46RDDV.js} +2 -2
  48. package/dist/cli/chunks/{chunk-TNVYKYTO.js → chunk-A5RMQG4N.js} +3 -3
  49. package/dist/cli/chunks/{chunk-PXFQSVA2.js → chunk-AH7FXNFE.js} +3 -3
  50. package/dist/cli/chunks/{chunk-K22TPWOJ.js → chunk-AIUSZC6K.js} +2 -2
  51. package/dist/cli/chunks/{chunk-IK6AJX3C.js → chunk-AOI67HA3.js} +1 -1
  52. package/dist/cli/chunks/{chunk-6VQ5MFJ6.js → chunk-AV7KYE5P.js} +7 -7
  53. package/dist/cli/chunks/{chunk-GTRXZJNX.js → chunk-AWFIEGR3.js} +2 -2
  54. package/dist/cli/chunks/{chunk-6A2NIR2E.js → chunk-BQCSCAUC.js} +2 -2
  55. package/dist/cli/chunks/{chunk-NQZYUH6S.js → chunk-C2M74HCN.js} +1 -1
  56. package/dist/cli/chunks/{chunk-5EU2VQK3.js → chunk-CIRPP7RQ.js} +2 -2
  57. package/dist/cli/chunks/{chunk-Q5VHBI4U.js → chunk-CMACGG4Z.js} +1 -1
  58. package/dist/cli/chunks/{chunk-YGRTMAWB.js → chunk-CTDLI2ON.js} +1 -1
  59. package/dist/cli/chunks/{chunk-P7T5Y735.js → chunk-CV2SBMBW.js} +2 -2
  60. package/dist/cli/chunks/{chunk-UDFLR7GR.js → chunk-DMQPO43S.js} +1 -1
  61. package/dist/cli/chunks/{chunk-XKOKMS5A.js → chunk-DRWGK3YO.js} +2 -2
  62. package/dist/cli/chunks/{chunk-EBQ6YKP2.js → chunk-DZZEHPSJ.js} +2 -2
  63. package/dist/cli/chunks/{chunk-7SQD2TTQ.js → chunk-EA7ZSN3V.js} +1 -1
  64. package/dist/cli/chunks/{chunk-KKNBYXYA.js → chunk-EQBEGDTG.js} +1 -1
  65. package/dist/cli/chunks/{chunk-2UN4DOBJ.js → chunk-ETN5563K.js} +2 -2
  66. package/dist/cli/chunks/{chunk-BECU52UY.js → chunk-EVCOCGVJ.js} +3 -3
  67. package/dist/cli/chunks/{chunk-OC3OJWLB.js → chunk-FO43SQXP.js} +2 -2
  68. package/dist/cli/chunks/{chunk-CKECJH2A.js → chunk-FO73PZVU.js} +2 -2
  69. package/dist/cli/chunks/{chunk-Y2DPXMOR.js → chunk-FPAW77XV.js} +1 -1
  70. package/dist/cli/chunks/{chunk-UDVX34ZG.js → chunk-FY3CUPNN.js} +20 -17
  71. package/dist/cli/chunks/{chunk-EIROAH6N.js → chunk-G5U6Q42D.js} +2 -2
  72. package/dist/cli/chunks/{chunk-VKRMVTWU.js → chunk-HA63NBFK.js} +9 -9
  73. package/dist/cli/chunks/{chunk-2ETDES5W.js → chunk-HHCYSAH3.js} +2 -2
  74. package/dist/cli/chunks/{chunk-57NJQV57.js → chunk-HJME6G5M.js} +1 -1
  75. package/dist/cli/chunks/{chunk-BN7ERYXI.js → chunk-HJORBNXW.js} +1 -1
  76. package/dist/cli/chunks/{chunk-5KFCH7RH.js → chunk-HO37VP4O.js} +1 -1
  77. package/dist/cli/chunks/{chunk-622MIAOR.js → chunk-I677W5BT.js} +3 -3
  78. package/dist/cli/chunks/chunk-IAZEDWRX.js +2 -0
  79. package/dist/cli/chunks/{chunk-KRXKU54J.js → chunk-IICTTDAA.js} +2 -2
  80. package/dist/cli/chunks/{chunk-BGBSYF3K.js → chunk-JF53LRBL.js} +2 -2
  81. package/dist/cli/chunks/{chunk-RPL6K623.js → chunk-KB5L5TTF.js} +3 -3
  82. package/dist/cli/chunks/{chunk-Q24OJX44.js → chunk-L7VIX22Y.js} +2 -2
  83. package/dist/cli/chunks/{chunk-TFNLXAK5.js → chunk-LQTWPSYL.js} +1 -1
  84. package/dist/cli/chunks/{chunk-ECPB7IAH.js → chunk-LZCBSFAU.js} +4 -4
  85. package/dist/cli/chunks/{chunk-G5DTENO3.js → chunk-MCOFJHSJ.js} +2 -2
  86. package/dist/cli/chunks/{chunk-XRK7FBTY.js → chunk-MCZHKXB4.js} +2 -2
  87. package/dist/cli/chunks/{chunk-H44WD7QX.js → chunk-MEY43PIQ.js} +2 -2
  88. package/dist/cli/chunks/{chunk-WL2J6ECN.js → chunk-MMIQ5DMA.js} +2 -2
  89. package/dist/cli/chunks/{chunk-PUXDXIUE.js → chunk-MNUTRAUV.js} +1 -1
  90. package/dist/cli/chunks/{chunk-KCTH5MHE.js → chunk-MNV3E5KY.js} +2 -2
  91. package/dist/cli/chunks/{chunk-EO4B5GS4.js → chunk-MYWQTCS4.js} +1 -1
  92. package/dist/cli/chunks/{chunk-32R7EA7B.js → chunk-NZO4WUSO.js} +3 -3
  93. package/dist/cli/chunks/{chunk-NOCYYXK4.js → chunk-OIEQF7PG.js} +2 -2
  94. package/dist/cli/chunks/{chunk-IPRDHKSI.js → chunk-OIRZJCZY.js} +2 -2
  95. package/dist/cli/chunks/{chunk-ELZ67OHQ.js → chunk-ON4D4TJ4.js} +2 -2
  96. package/dist/cli/chunks/chunk-OPFN5LFT.js +95 -0
  97. package/dist/cli/chunks/{chunk-4AWJ5PE4.js → chunk-ORF2UKQH.js} +1 -1
  98. package/dist/cli/chunks/{chunk-6LRCMFLV.js → chunk-OWQ6HEYI.js} +2 -2
  99. package/dist/cli/chunks/{chunk-GRG3OP34.js → chunk-OXCEUR5F.js} +2 -2
  100. package/dist/cli/chunks/{chunk-SLNGJW4G.js → chunk-PEK6NGVJ.js} +1 -1
  101. package/dist/cli/chunks/{chunk-5ZCVMR5E.js → chunk-PIZYRPMT.js} +2 -2
  102. package/dist/cli/chunks/{chunk-K4T3RDCB.js → chunk-PXTDEO65.js} +2 -2
  103. package/dist/cli/chunks/{chunk-GRYXNWPF.js → chunk-PYIHZXCI.js} +12 -12
  104. package/dist/cli/chunks/{chunk-HRDGN3OK.js → chunk-QBRHKTFT.js} +1 -1
  105. package/dist/cli/chunks/{chunk-COZDJLIL.js → chunk-QEPFXY6G.js} +1 -1
  106. package/dist/cli/chunks/{chunk-HPNEZ7YN.js → chunk-QJ2EHLJ2.js} +1 -1
  107. package/dist/cli/chunks/{chunk-GMKGLZJU.js → chunk-QQNCSEZG.js} +2 -2
  108. package/dist/cli/chunks/{chunk-CR4ERDS2.js → chunk-QSE67XJO.js} +2 -2
  109. package/dist/cli/chunks/{chunk-7CKVAYP3.js → chunk-R2O6OKT2.js} +1 -1
  110. package/dist/cli/chunks/{chunk-OVENSL64.js → chunk-RLXTBL3H.js} +8 -8
  111. package/dist/cli/chunks/{chunk-PW6MOFXG.js → chunk-RNREAOY4.js} +2 -2
  112. package/dist/cli/chunks/{chunk-YYWIA5FX.js → chunk-S3OZ7XSY.js} +1 -1
  113. package/dist/cli/chunks/{chunk-KZJXVIAW.js → chunk-S3ZO7JXS.js} +2 -2
  114. package/dist/cli/chunks/{chunk-ZEMXMDD3.js → chunk-SJH3HYNC.js} +2 -2
  115. package/dist/cli/chunks/{chunk-5OTYBWRL.js → chunk-STEGWLH5.js} +2 -2
  116. package/dist/cli/chunks/{chunk-F3OVFA6W.js → chunk-SVYTN2GT.js} +2 -2
  117. package/dist/cli/chunks/{chunk-QNW335PD.js → chunk-SW4OKUTC.js} +2 -2
  118. package/dist/cli/chunks/{chunk-WS4XVJHI.js → chunk-THRTUW4Z.js} +1 -1
  119. package/dist/cli/chunks/{chunk-NPSBMDVU.js → chunk-TJKDATEU.js} +2 -2
  120. package/dist/cli/chunks/{chunk-H22MMMYY.js → chunk-U3EUH6LX.js} +2 -2
  121. package/dist/cli/chunks/{chunk-FJSR2U65.js → chunk-UUFOHMUG.js} +2 -2
  122. package/dist/cli/chunks/{chunk-RWYW573C.js → chunk-UVU7XLJY.js} +3 -3
  123. package/dist/cli/chunks/{chunk-BF7MUYWC.js → chunk-UWXH2UQK.js} +2 -2
  124. package/dist/cli/chunks/{chunk-UU2Q6XWF.js → chunk-UYYBPWU3.js} +1 -1
  125. package/dist/cli/chunks/{chunk-AUVC3DDB.js → chunk-VSUTI4G6.js} +2 -2
  126. package/dist/cli/chunks/{chunk-25QGPRWN.js → chunk-WDMPJ2M2.js} +2 -2
  127. package/dist/cli/chunks/{chunk-MVGVD6LS.js → chunk-WNR2KAUH.js} +2 -2
  128. package/dist/cli/chunks/{chunk-NDCPEXDN.js → chunk-WSVUSIAZ.js} +2 -2
  129. package/dist/cli/chunks/{chunk-T3UXMPXX.js → chunk-WZJUMJ2S.js} +1 -1
  130. package/dist/cli/chunks/{chunk-TX7SNQKL.js → chunk-X2VAOIUY.js} +1 -1
  131. package/dist/cli/chunks/{chunk-DVOH75S4.js → chunk-XDSA7YUQ.js} +1 -1
  132. package/dist/cli/chunks/{chunk-TNGGVMPQ.js → chunk-XDU624HU.js} +1 -1
  133. package/dist/cli/chunks/{chunk-6ZRMQXVL.js → chunk-XGBAHAGC.js} +2 -2
  134. package/dist/cli/chunks/{chunk-IITKJCPK.js → chunk-XMJTTF5N.js} +2 -2
  135. package/dist/cli/chunks/{chunk-2TDWCXZ6.js → chunk-XPCNUX2U.js} +2 -2
  136. package/dist/cli/chunks/{chunk-W6ZF2CPN.js → chunk-XRJECWZE.js} +1 -1
  137. package/dist/cli/chunks/{chunk-MQYTW2IN.js → chunk-XTCUN36Z.js} +2 -2
  138. package/dist/cli/chunks/{chunk-7MSYTHZM.js → chunk-Y63MBMOV.js} +2 -2
  139. package/dist/cli/chunks/{chunk-6QFONVEE.js → chunk-YACT5WFC.js} +2 -2
  140. package/dist/cli/chunks/{chunk-PLRSKAFZ.js → chunk-YI6GNRQM.js} +2 -2
  141. package/dist/cli/chunks/chunk-YNNOY3XN.js +62 -0
  142. package/dist/cli/chunks/{chunk-XGUQYVJR.js → chunk-YWZHMXTO.js} +2 -2
  143. package/dist/cli/chunks/{chunk-OQP5OFRR.js → chunk-ZDHMZPSL.js} +1 -1
  144. package/dist/cli/chunks/{chunk-NRLT44YB.js → chunk-ZGNZJJFF.js} +1 -1
  145. package/dist/cli/chunks/{chunk-ELUERFGA.js → chunk-ZK2BH23O.js} +2 -2
  146. package/dist/cli/chunks/{chunk-AABKTWXC.js → chunk-ZQUXNG5X.js} +2 -2
  147. package/dist/cli/chunks/{chunk-WQEZKAUR.js → chunk-ZXTO4C7R.js} +2 -2
  148. package/dist/cli/chunks/{ci-EHRUN7O6.js → ci-PYCRCL7G.js} +2 -2
  149. package/dist/cli/chunks/{ci-output-EXDXVXKB.js → ci-output-EKQQFE2D.js} +2 -2
  150. package/dist/cli/chunks/{circuit-breaker-LM4QRAAL.js → circuit-breaker-RH3Q2MJO.js} +2 -2
  151. package/dist/cli/chunks/{claude-flow-setup-ZHUCZVW7.js → claude-flow-setup-DUDXB4VV.js} +2 -2
  152. package/dist/cli/chunks/client-RDPWGOSA.js +2 -0
  153. package/dist/cli/chunks/{cline-installer-WMFLQOW2.js → cline-installer-3Q4WIWUG.js} +2 -2
  154. package/dist/cli/chunks/{code-L7KRLU5E.js → code-E4Q6DGOO.js} +2 -2
  155. package/dist/cli/chunks/{code-index-extractor-FTMUYQC6.js → code-index-extractor-2PCISUOW.js} +2 -2
  156. package/dist/cli/chunks/{codex-installer-B3F6WI3Z.js → codex-installer-YNNNOLJ6.js} +2 -2
  157. package/dist/cli/chunks/{completions-3JZQRNB6.js → completions-2F7TUFBD.js} +2 -2
  158. package/dist/cli/chunks/{complexity-analyzer-LB2FFEKX.js → complexity-analyzer-2B6MHO7W.js} +2 -2
  159. package/dist/cli/chunks/{continuedev-installer-WH6IMV7R.js → continuedev-installer-ENOKRU5M.js} +2 -2
  160. package/dist/cli/chunks/{copilot-installer-NOIEOFJM.js → copilot-installer-6YD2KM5F.js} +2 -2
  161. package/dist/cli/chunks/{cost-tracker-IKX2VYSA.js → cost-tracker-FCH4QOEA.js} +2 -2
  162. package/dist/cli/chunks/{coverage-TD37CYSY.js → coverage-JTOXZE3T.js} +3 -3
  163. package/dist/cli/chunks/cross-domain-router-4K5ZVZEZ.js +2 -0
  164. package/dist/cli/chunks/{cursor-installer-4NSVGRM5.js → cursor-installer-QZFBUGLQ.js} +2 -2
  165. package/dist/cli/chunks/{daemon-LYDV7NRW.js → daemon-K4QFB5FQ.js} +3 -3
  166. package/dist/cli/chunks/{daemon-UWEBUIDT.js → daemon-M422U3ZA.js} +4 -4
  167. package/dist/cli/chunks/{dag-attention-scheduler-NECJGCHC.js → dag-attention-scheduler-BXAAW33V.js} +2 -2
  168. package/dist/cli/chunks/{detect-4XGC7ILO.js → detect-UGSWIOAD.js} +2 -2
  169. package/dist/cli/chunks/{dist-node-GGJDXRKJ.js → dist-node-FN3HX3OK.js} +2 -2
  170. package/dist/cli/chunks/{domain-handler-UOFONAUT.js → domain-handler-7PP7VYA7.js} +2 -2
  171. package/dist/cli/chunks/{domain-transfer-6JLNOYPA.js → domain-transfer-XZM44W7I.js} +2 -2
  172. package/dist/cli/chunks/dream-RPNWM7VS.js +2 -0
  173. package/dist/cli/chunks/{embed-and-insert-pattern-ZM75DQ4J.js → embed-and-insert-pattern-JZVERJ5L.js} +2 -2
  174. package/dist/cli/chunks/{eval-CYZJTHEB.js → eval-466NFF2D.js} +2 -2
  175. package/dist/cli/chunks/{experience-capture-middleware-RBOJLDUB.js → experience-capture-middleware-I7IQCC7V.js} +3 -3
  176. package/dist/cli/chunks/{fast-paths-S5BWZR3L.js → fast-paths-34OICNZA.js} +2 -2
  177. package/dist/cli/chunks/{feature-flags-6E7H3NYP.js → feature-flags-6UBIVTAD.js} +2 -2
  178. package/dist/cli/chunks/{feature-flags-DUNQPDU3.js → feature-flags-X5WBBWSO.js} +2 -2
  179. package/dist/cli/chunks/{file-discovery-PFFKDGYG.js → file-discovery-NLMDBWXX.js} +2 -2
  180. package/dist/cli/chunks/{fleet-RCDZZFXN.js → fleet-W7CYCHDI.js} +3 -3
  181. package/dist/cli/chunks/{gnn-wrapper-5AG3WDWF.js → gnn-wrapper-K4VTAG5X.js} +2 -2
  182. package/dist/cli/chunks/{heartbeat-handler-O2KAEX4Y.js → heartbeat-handler-ZGKF2Z6T.js} +4 -4
  183. package/dist/cli/chunks/heartbeat-scheduler-JBCXMMZO.js +2 -0
  184. package/dist/cli/chunks/hnsw-adapter-3SC2HZIG.js +2 -0
  185. package/dist/cli/chunks/hnsw-index-FQORAR6K.js +2 -0
  186. package/dist/cli/chunks/{hnsw-legacy-bridge-C7FG6YGW.js → hnsw-legacy-bridge-ELDRLKK5.js} +2 -2
  187. package/dist/cli/chunks/{better-sqlite3-XGPW4HK5.js → hnswlib-node-ZGSUMHDC.js} +2 -2
  188. package/dist/cli/chunks/{hooks-FUHNE2P7.js → hooks-T4CBINAV.js} +13 -13
  189. package/dist/cli/chunks/hybrid-router-6CBFDXPR.js +2 -0
  190. package/dist/cli/chunks/{hypergraph-engine-LQRYBNPV.js → hypergraph-engine-UWFW3XP5.js} +2 -2
  191. package/dist/cli/chunks/{hypergraph-handler-AFFNLZVD.js → hypergraph-handler-PK2BI46K.js} +3 -3
  192. package/dist/cli/chunks/impact-analyzer-SOEFVZWG.js +2 -0
  193. package/dist/cli/chunks/{init-handler-BQ6IDBX4.js → init-handler-HNG6KJOU.js} +6 -6
  194. package/dist/cli/chunks/init-wizard-3E4IU5M4.js +2 -0
  195. package/dist/cli/chunks/kernel-GFZP4G5J.js +2 -0
  196. package/dist/cli/chunks/{kilocode-installer-KS72HUSG.js → kilocode-installer-25V7FEJ4.js} +2 -2
  197. package/dist/cli/chunks/{kiro-installer-2ZEFLGRX.js → kiro-installer-7RMTTCQB.js} +2 -2
  198. package/dist/cli/chunks/knowledge-graph-BKRKBU26.js +2 -0
  199. package/dist/cli/chunks/{learning-GGHGJ6B6.js → learning-XQC2MG2R.js} +3 -3
  200. package/dist/cli/chunks/{llm-router-LP6K5BJF.js → llm-router-6KTTONH4.js} +4 -4
  201. package/dist/cli/chunks/llm-router-service-KE4IGZPP.js +2 -0
  202. package/dist/cli/chunks/{load-2MLKXOT2.js → load-BV64P3AL.js} +2 -2
  203. package/dist/cli/chunks/load-test-VSYJV2AO.js +2 -0
  204. package/dist/cli/chunks/{mcp-CDJBJG5H.js → mcp-U5ZN77TA.js} +2 -2
  205. package/dist/cli/chunks/{memory-4LAX7JZS.js → memory-WB5BNBK7.js} +5 -5
  206. package/dist/cli/chunks/memory-backend-B72RGHRF.js +2 -0
  207. package/dist/cli/chunks/{memory-handlers-OBAFR4WV.js → memory-handlers-NWCH7AUO.js} +2 -2
  208. package/dist/cli/chunks/{multi-model-executor-SLJV73HE.js → multi-model-executor-3X3W3UTY.js} +2 -2
  209. package/dist/cli/chunks/{opencode-installer-M76SONWV.js → opencode-installer-TTTMG7ZZ.js} +2 -2
  210. package/dist/cli/chunks/{orchestrator-TJPUDJMP.js → orchestrator-BLCGSHMZ.js} +18 -18
  211. package/dist/cli/chunks/{pipeline-2PVNFT6J.js → pipeline-DZPGMRG7.js} +2 -2
  212. package/dist/cli/chunks/{platform-KCSEDKEE.js → platform-EVMZAUNV.js} +2 -2
  213. package/dist/cli/chunks/{plugin-QX47QF5U.js → plugin-OR55K4HT.js} +2 -2
  214. package/dist/cli/chunks/{prime-radiant-advanced-wasm-L6VWL7VR.js → prime-radiant-advanced-wasm-4ODV27HD.js} +2 -2
  215. package/dist/cli/chunks/protocol-executor-V3F37FPO.js +2 -0
  216. package/dist/cli/chunks/{protocol-handler-WDNJDEUE.js → protocol-handler-ZOTI5PID.js} +2 -2
  217. package/dist/cli/chunks/{prove-3B75DA3S.js → prove-DIMBYJ7V.js} +2 -2
  218. package/dist/cli/chunks/provider-manager-2PN72TT6.js +2 -0
  219. package/dist/cli/chunks/qe-reasoning-bank-P665QNIR.js +2 -0
  220. package/dist/cli/chunks/{quality-UGASS5WM.js → quality-7MX4VL6M.js} +2 -2
  221. package/dist/cli/chunks/queen-coordinator-XD4F7BGB.js +2 -0
  222. package/dist/cli/chunks/{real-embeddings-COBP2LHS.js → real-embeddings-YPUHWRN2.js} +2 -2
  223. package/dist/cli/chunks/{roocode-installer-TOZ4VLFT.js → roocode-installer-WG5AU4QM.js} +2 -2
  224. package/dist/cli/chunks/router-4SSNWDJC.js +2 -0
  225. package/dist/cli/chunks/routing-feedback-O2JSIBW6.js +2 -0
  226. package/dist/cli/chunks/{routing-handler-5TDVSILX.js → routing-handler-LZB4MN2K.js} +2 -2
  227. package/dist/cli/chunks/{ruvector-commands-AM63KWQN.js → ruvector-commands-YE4ADBMC.js} +2 -2
  228. package/dist/cli/chunks/{rvf-dual-writer-UANIFE2M.js → rvf-dual-writer-QS5ATW4C.js} +2 -2
  229. package/dist/cli/chunks/{rvf-migration-adapter-LNPYWAPI.js → rvf-migration-adapter-YIGKSBD3.js} +2 -2
  230. package/dist/cli/chunks/{rvf-migration-coordinator-U47L63DQ.js → rvf-migration-coordinator-2NDCWP7F.js} +2 -2
  231. package/dist/cli/chunks/rvf-native-adapter-WIUHYXRB.js +2 -0
  232. package/dist/cli/chunks/safe-db-WL5Y7ZNS.js +2 -0
  233. package/dist/cli/chunks/schedule-U7QDGU5A.js +2 -0
  234. package/dist/cli/chunks/scheduler-LXKGQYXA.js +2 -0
  235. package/dist/cli/chunks/{security-KDQ2AH7G.js → security-HT4SUT24.js} +3 -3
  236. package/dist/cli/chunks/{shared-rvf-adapter-5MAGLLYJ.js → shared-rvf-adapter-4IZOJL33.js} +2 -2
  237. package/dist/cli/chunks/{shared-rvf-dual-writer-GF2OPPM5.js → shared-rvf-dual-writer-ZKFO7CBY.js} +2 -2
  238. package/dist/cli/chunks/sqlite-persistence-4KFO3SEB.js +2 -0
  239. package/dist/cli/chunks/{status-handler-XZKEL7LO.js → status-handler-AMEMKBI4.js} +2 -2
  240. package/dist/cli/chunks/{structural-health-27QKWW25.js → structural-health-RBADRLC3.js} +2 -2
  241. package/dist/cli/chunks/{sync-V3HGPEJT.js → sync-ARDDLQBS.js} +2 -2
  242. package/dist/cli/chunks/{sync-INNKS6UK.js → sync-PCB23M4K.js} +2 -2
  243. package/dist/cli/chunks/{task-handler-LDUVOM6G.js → task-handler-J26FSCH5.js} +2 -2
  244. package/dist/cli/chunks/{task-handlers-HTCPV7OO.js → task-handlers-AQRLR6BL.js} +3 -3
  245. package/dist/cli/chunks/{test-PCUVGVJL.js → test-YXWSIOSB.js} +4 -4
  246. package/dist/cli/chunks/{test-scheduling-GYVXWCAA.js → test-scheduling-XY532GI4.js} +3 -3
  247. package/dist/cli/chunks/{token-bootstrap-MJ2ANC4P.js → token-bootstrap-KL2QIQ36.js} +2 -2
  248. package/dist/cli/chunks/{token-usage-ZREHROTF.js → token-usage-2MJVE4DT.js} +2 -2
  249. package/dist/cli/chunks/{transformers-6B3FWFYL.js → transformers-QSNTOD2Z.js} +2 -2
  250. package/dist/cli/chunks/{tree-sitter-wasm-parser-JVV234MN.js → tree-sitter-wasm-parser-QJOKHOIW.js} +2 -2
  251. package/dist/cli/chunks/{types-MVZTJI2F.js → types-RNKRSYMO.js} +2 -2
  252. package/dist/cli/chunks/unified-memory-7AS4LIEF.js +2 -0
  253. package/dist/cli/chunks/unified-memory-hnsw-GREESNJX.js +2 -0
  254. package/dist/cli/chunks/unified-persistence-BPJOMZOA.js +2 -0
  255. package/dist/cli/chunks/{upgrade-MKTFEILD.js → upgrade-EKJHIFWP.js} +2 -2
  256. package/dist/cli/chunks/{validate-IABGALSW.js → validate-KS4T7LWC.js} +2 -2
  257. package/dist/cli/chunks/{validate-swarm-RHF53RF6.js → validate-swarm-SKKWRP2H.js} +2 -2
  258. package/dist/cli/chunks/{vibium-RAKW6FMF.js → vibium-FLUQO4IF.js} +2 -2
  259. package/dist/cli/chunks/visual-security-BW662FHQ.js +2 -0
  260. package/dist/cli/chunks/{web-tree-sitter-PYK7F4JZ.js → web-tree-sitter-UMC63DWD.js} +2 -2
  261. package/dist/cli/chunks/{windsurf-installer-S3U2HWZ4.js → windsurf-installer-V3FQGJIQ.js} +2 -2
  262. package/dist/cli/chunks/{witness-chain-435NKQLB.js → witness-chain-GE74TLSO.js} +2 -2
  263. package/dist/cli/chunks/witness-chain-OXVDLNVT.js +2 -0
  264. package/dist/cli/chunks/{workflow-5UHJCZ6J.js → workflow-4YZ2RPWA.js} +4 -4
  265. package/dist/cli/chunks/workflow-orchestrator-KKNR46XV.js +2 -0
  266. package/dist/cli/chunks/{wrappers-RD3NCMLK.js → wrappers-37NLMKPE.js} +2 -2
  267. package/dist/cli/commands/hooks-handlers/command-hooks.js +1 -1
  268. package/dist/cli/commands/hooks-handlers/routing-hooks.js +1 -1
  269. package/dist/cli/commands/hooks-handlers/task-hooks.js +1 -1
  270. package/dist/init/init-wizard-hooks.js +271 -271
  271. package/dist/init/phases/07-hooks.d.ts +7 -0
  272. package/dist/init/phases/07-hooks.js +132 -96
  273. package/dist/learning/agent-routing.d.ts +19 -0
  274. package/dist/learning/agent-routing.js +27 -1
  275. package/dist/learning/dream/dream-scheduler.d.ts +11 -36
  276. package/dist/learning/dream/dream-scheduler.js +44 -0
  277. package/dist/learning/experience-consolidation.d.ts +16 -0
  278. package/dist/learning/experience-consolidation.js +55 -11
  279. package/dist/learning/pattern-lifecycle.d.ts +21 -0
  280. package/dist/learning/pattern-lifecycle.js +70 -6
  281. package/dist/mcp/bundle.js +352 -349
  282. package/dist/mcp/protocol-server.js +13 -14
  283. package/dist/mcp/transport/stdio.d.ts +20 -0
  284. package/dist/mcp/transport/stdio.js +35 -2
  285. package/dist/shared/utils/rabitq.d.ts +133 -0
  286. package/dist/shared/utils/rabitq.js +201 -0
  287. package/package.json +8 -2
  288. package/dist/cli/chunks/adapter-3JS2CN7C.js +0 -2
  289. package/dist/cli/chunks/aqe-learning-engine-Q4GFNGU6.js +0 -2
  290. package/dist/cli/chunks/base-Q3MAL22Y.js +0 -2
  291. package/dist/cli/chunks/browser-workflow-JX3M2UWG.js +0 -2
  292. package/dist/cli/chunks/chunk-IJ4BUSJN.js +0 -95
  293. package/dist/cli/chunks/chunk-VPCE5CIT.js +0 -2
  294. package/dist/cli/chunks/chunk-WO7KYT3X.js +0 -62
  295. package/dist/cli/chunks/client-PA3UJIHH.js +0 -2
  296. package/dist/cli/chunks/cross-domain-router-BVJRP2ZX.js +0 -2
  297. package/dist/cli/chunks/dream-BXZUEIW2.js +0 -2
  298. package/dist/cli/chunks/heartbeat-scheduler-LEKAWFJF.js +0 -2
  299. package/dist/cli/chunks/hnsw-adapter-2TCEG5M2.js +0 -2
  300. package/dist/cli/chunks/hnsw-index-VDPUTEES.js +0 -2
  301. package/dist/cli/chunks/hybrid-router-2EMDIYIG.js +0 -2
  302. package/dist/cli/chunks/impact-analyzer-HFD6CPWC.js +0 -2
  303. package/dist/cli/chunks/init-wizard-552QIVRC.js +0 -2
  304. package/dist/cli/chunks/kernel-5DN6O6EE.js +0 -2
  305. package/dist/cli/chunks/knowledge-graph-76Y77MB6.js +0 -2
  306. package/dist/cli/chunks/llm-router-service-4O6GCEFH.js +0 -2
  307. package/dist/cli/chunks/load-test-FCI2IWRJ.js +0 -2
  308. package/dist/cli/chunks/memory-backend-MKNCBNDE.js +0 -2
  309. package/dist/cli/chunks/protocol-executor-IA7WNT23.js +0 -2
  310. package/dist/cli/chunks/provider-manager-3K5KB5A6.js +0 -2
  311. package/dist/cli/chunks/qe-reasoning-bank-V5Z3BBYY.js +0 -2
  312. package/dist/cli/chunks/queen-coordinator-QOMPA27Z.js +0 -2
  313. package/dist/cli/chunks/router-P5RZUPC4.js +0 -2
  314. package/dist/cli/chunks/routing-feedback-3PS3OZQC.js +0 -2
  315. package/dist/cli/chunks/rvf-native-adapter-TT7OJPKM.js +0 -2
  316. package/dist/cli/chunks/safe-db-PEW7VBAE.js +0 -2
  317. package/dist/cli/chunks/schedule-QHOTHBQE.js +0 -2
  318. package/dist/cli/chunks/scheduler-KXJBYTRT.js +0 -2
  319. package/dist/cli/chunks/sqlite-persistence-TPXJK34J.js +0 -2
  320. package/dist/cli/chunks/unified-memory-ROS2NKR5.js +0 -2
  321. package/dist/cli/chunks/unified-memory-hnsw-FLEUF3XO.js +0 -2
  322. package/dist/cli/chunks/unified-persistence-QC5L7UNQ.js +0 -2
  323. package/dist/cli/chunks/visual-security-NLIOUQCR.js +0 -2
  324. package/dist/cli/chunks/witness-chain-U7X6JX5J.js +0 -2
  325. package/dist/cli/chunks/workflow-orchestrator-APE6BAXH.js +0 -2
@@ -1,6 +1,6 @@
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.10.1");process.exit(0)}
2
- import{e as x,f as C,j as y,k as R,q as F}from"./chunk-FJSR2U65.js";import{b as I,c as k}from"./chunk-2TDWCXZ6.js";import{c as w}from"./chunk-4AWJ5PE4.js";var P,S=w(()=>{"use strict";P={enabled:!0,headless:!0,timeout:3e4,retryAttempts:3,fallbackEnabled:!0,browserType:"chromium",viewport:{width:1280,height:720},userAgent:"",devtools:!1,slowMo:0,screenshotDir:".agentic-qe/screenshots"}});function B(i){return i instanceof o}function a(i,e="Unknown Vibium error"){return B(i)?i:i instanceof Error?new o(i.message||e,"UNKNOWN_ERROR",i):new o(typeof i=="string"?i:e,"UNKNOWN_ERROR")}var o,c,f,g,l,p,m,b,A=w(()=>{"use strict";o=class i extends Error{constructor(t,r,s){super(t);this.code=r;this.cause=s;this.name="VibiumError",Error.captureStackTrace&&Error.captureStackTrace(this,i),s?.stack&&(this.stack+=`
3
- Caused by: ${s.stack}`)}code;cause},c=class extends o{constructor(e="Vibium MCP server is unavailable",t){super(e,"VIBIUM_UNAVAILABLE",t),this.name="VibiumUnavailableError"}},f=class extends o{constructor(e="Browser operation timed out",t){super(e,"VIBIUM_TIMEOUT",t),this.name="VibiumTimeoutError"}},g=class extends o{selector;constructor(e,t){super(`Element not found: ${e}`,"ELEMENT_NOT_FOUND",t),this.name="VibiumElementNotFoundError",this.selector=e}},l=class extends o{constructor(e="Failed to connect to browser",t){super(e,"CONNECTION_ERROR",t),this.name="VibiumConnectionError"}},p=class extends o{url;statusCode;constructor(e,t,r){let s=t?`Navigation failed: ${e} (HTTP ${t})`:`Navigation failed: ${e}`;super(s,"NAVIGATION_ERROR",r),this.name="VibiumNavigationError",this.url=e,this.statusCode=t}},m=class extends o{constructor(e="Failed to capture screenshot",t){super(e,"SCREENSHOT_ERROR",t),this.name="VibiumScreenshotError"}},b=class extends o{action;selector;constructor(e,t,r){super(`Failed to ${e} element: ${t}`,"INTERACTION_ERROR",r),this.name="VibiumInteractionError",this.action=e,this.selector=t}}});import{randomUUID as _}from"crypto";async function V(){if(v!==null)return v;try{return v=(await import("./vibium-RAKW6FMF.js")).browser,O=!0,v}catch(i){return console.warn("[Vibium] Failed to load vibium package:",i),O=!1,null}}async function T(i,e,t){let r;for(let s=1;s<=e;s++)try{return await i()}catch(n){if(r=I(n),s<e){let u=Math.min(100*Math.pow(2,s-1),2e3);await new Promise(d=>setTimeout(d,u))}}throw new o(`${t} failed after ${e} attempts`,"RETRY_EXHAUSTED",r)}async function h(i,e){let t=Date.now();try{let r=await i();return R()&&console.log(`[Vibium] ${e}: ${Date.now()-t}ms`),r}catch(r){throw R()&&console.log(`[Vibium] ${e} failed: ${Date.now()-t}ms`,r),r}}var v,O,E,N,M=w(()=>{S();A();k();F();v=null,O=!1;E=class{config;currentSession=null;lastHealthCheck=null;_initialized=!1;_available=null;vibeInstance=null;constructor(e={}){this.config={...P,...e}}async isAvailable(){if(!this.config.enabled)return!1;if(this._available!==null)return this._available;try{let e=await V();return this._available=e!==null,this._available}catch{return this._available=!1,!1}}async getHealth(){let e=new Date;if(!this.config.enabled)return{status:"unavailable",features:["fallback-only"],lastChecked:e,error:"Vibium is disabled by configuration",sessionActive:!1};try{await this.isAvailable()?this.lastHealthCheck={status:this.vibeInstance?"connected":"disconnected",version:"0.1.2",browserType:this.config.browserType,features:["browser-launch","navigation","element-interaction","screenshots","script-evaluation","accessibility-testing"],latencyMs:10,lastChecked:e,sessionActive:this.vibeInstance!==null}:this.lastHealthCheck={status:"unavailable",features:["fallback-only"],lastChecked:e,error:"Vibium package not available - install with: npm install vibium",sessionActive:!1}}catch(t){this.lastHealthCheck={status:"error",features:["fallback-only"],lastChecked:e,error:t instanceof Error?t.message:"Unknown error",sessionActive:!1}}return this.lastHealthCheck}async getSession(){return this.currentSession}async launch(e){if(!x())return{success:!1,error:new c("Browser mode is disabled by feature flags")};let t=async()=>{let r=await V();if(!r)throw new c("Vibium package not available. Install with: npm install vibium");let s=e?.headless??this.config.headless;this.vibeInstance=await r.launch({headless:s});let n={id:this.generateSessionId(),browserType:this.config.browserType,launchedAt:new Date,status:"connected",viewport:e?.viewport??this.config.viewport,headless:s};return this.currentSession=n,n};try{return{success:!0,value:y()?await T(()=>h(t,"browser_launch"),this.config.retryAttempts,"browser_launch"):await h(t,"browser_launch")}}catch(r){return{success:!1,error:a(r,"Failed to launch browser")}}}async quit(){if(!this.vibeInstance)return{success:!1,error:new l("No active browser session")};let e=async()=>{this.vibeInstance&&(await this.vibeInstance.quit(),this.vibeInstance=null),this.currentSession=null};try{return await h(e,"browser_quit"),{success:!0,value:void 0}}catch(t){return{success:!1,error:a(t,"Failed to quit browser")}}}async navigate(e){this.ensureSession();let t=async()=>{let r=Date.now();await this.vibeInstance.go(e.url);let s="";try{s=await this.vibeInstance.evaluate("document.title")}catch{s="Unknown"}let n={url:e.url,statusCode:200,title:s,durationMs:Date.now()-r,success:!0};return this.currentSession&&(this.currentSession.currentUrl=e.url),n};try{return{success:!0,value:y()?await T(()=>h(t,"page_navigate"),this.config.retryAttempts,"page_navigate"):await h(t,"page_navigate")}}catch(r){return{success:!1,error:new p(e.url,void 0,r instanceof Error?r:void 0)}}}async getPageInfo(){this.ensureSession();try{let e=await this.vibeInstance.evaluate("window.location.href"),t=await this.vibeInstance.evaluate("document.title");return{success:!0,value:{url:e,title:t,viewport:this.config.viewport,loadState:"loaded"}}}catch(e){return{success:!1,error:a(e,"Failed to get page info")}}}async goBack(){this.ensureSession();try{return await this.vibeInstance.evaluate("window.history.back()"),{success:!0,value:void 0}}catch(e){return{success:!1,error:a(e,"Failed to go back")}}}async goForward(){this.ensureSession();try{return await this.vibeInstance.evaluate("window.history.forward()"),{success:!0,value:void 0}}catch(e){return{success:!1,error:a(e,"Failed to go forward")}}}async reload(){this.ensureSession();try{return await this.vibeInstance.evaluate("window.location.reload()"),{success:!0,value:void 0}}catch(e){return{success:!1,error:a(e,"Failed to reload page")}}}async findElement(e){this.ensureSession();try{let t=await this.vibeInstance.find(e.selector,{timeout:e.timeout??this.config.timeout});return{success:!0,value:{selector:e.selector,tagName:t.info.tag,textContent:t.info.text,attributes:{},boundingBox:t.info.box,visible:!0,enabled:!0}}}catch(t){return{success:!1,error:new g(e.selector,t instanceof Error?t:void 0)}}}async findElements(e){this.ensureSession();try{let t=e.selector.replace(/\\/g,"\\\\").replace(/'/g,"\\'");return{success:!0,value:(await this.vibeInstance.evaluate(`
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.10.2");process.exit(0)}
2
+ import{e as x,f as C,j as y,k as R,q as F}from"./chunk-UUFOHMUG.js";import{b as I,c as k}from"./chunk-XPCNUX2U.js";import{c as w}from"./chunk-ORF2UKQH.js";var P,S=w(()=>{"use strict";P={enabled:!0,headless:!0,timeout:3e4,retryAttempts:3,fallbackEnabled:!0,browserType:"chromium",viewport:{width:1280,height:720},userAgent:"",devtools:!1,slowMo:0,screenshotDir:".agentic-qe/screenshots"}});function B(i){return i instanceof o}function a(i,e="Unknown Vibium error"){return B(i)?i:i instanceof Error?new o(i.message||e,"UNKNOWN_ERROR",i):new o(typeof i=="string"?i:e,"UNKNOWN_ERROR")}var o,c,f,g,l,p,m,b,A=w(()=>{"use strict";o=class i extends Error{constructor(t,r,s){super(t);this.code=r;this.cause=s;this.name="VibiumError",Error.captureStackTrace&&Error.captureStackTrace(this,i),s?.stack&&(this.stack+=`
3
+ Caused by: ${s.stack}`)}code;cause},c=class extends o{constructor(e="Vibium MCP server is unavailable",t){super(e,"VIBIUM_UNAVAILABLE",t),this.name="VibiumUnavailableError"}},f=class extends o{constructor(e="Browser operation timed out",t){super(e,"VIBIUM_TIMEOUT",t),this.name="VibiumTimeoutError"}},g=class extends o{selector;constructor(e,t){super(`Element not found: ${e}`,"ELEMENT_NOT_FOUND",t),this.name="VibiumElementNotFoundError",this.selector=e}},l=class extends o{constructor(e="Failed to connect to browser",t){super(e,"CONNECTION_ERROR",t),this.name="VibiumConnectionError"}},p=class extends o{url;statusCode;constructor(e,t,r){let s=t?`Navigation failed: ${e} (HTTP ${t})`:`Navigation failed: ${e}`;super(s,"NAVIGATION_ERROR",r),this.name="VibiumNavigationError",this.url=e,this.statusCode=t}},m=class extends o{constructor(e="Failed to capture screenshot",t){super(e,"SCREENSHOT_ERROR",t),this.name="VibiumScreenshotError"}},b=class extends o{action;selector;constructor(e,t,r){super(`Failed to ${e} element: ${t}`,"INTERACTION_ERROR",r),this.name="VibiumInteractionError",this.action=e,this.selector=t}}});import{randomUUID as _}from"crypto";async function V(){if(v!==null)return v;try{return v=(await import("./vibium-FLUQO4IF.js")).browser,O=!0,v}catch(i){return console.warn("[Vibium] Failed to load vibium package:",i),O=!1,null}}async function T(i,e,t){let r;for(let s=1;s<=e;s++)try{return await i()}catch(n){if(r=I(n),s<e){let u=Math.min(100*Math.pow(2,s-1),2e3);await new Promise(d=>setTimeout(d,u))}}throw new o(`${t} failed after ${e} attempts`,"RETRY_EXHAUSTED",r)}async function h(i,e){let t=Date.now();try{let r=await i();return R()&&console.log(`[Vibium] ${e}: ${Date.now()-t}ms`),r}catch(r){throw R()&&console.log(`[Vibium] ${e} failed: ${Date.now()-t}ms`,r),r}}var v,O,E,N,M=w(()=>{S();A();k();F();v=null,O=!1;E=class{config;currentSession=null;lastHealthCheck=null;_initialized=!1;_available=null;vibeInstance=null;constructor(e={}){this.config={...P,...e}}async isAvailable(){if(!this.config.enabled)return!1;if(this._available!==null)return this._available;try{let e=await V();return this._available=e!==null,this._available}catch{return this._available=!1,!1}}async getHealth(){let e=new Date;if(!this.config.enabled)return{status:"unavailable",features:["fallback-only"],lastChecked:e,error:"Vibium is disabled by configuration",sessionActive:!1};try{await this.isAvailable()?this.lastHealthCheck={status:this.vibeInstance?"connected":"disconnected",version:"0.1.2",browserType:this.config.browserType,features:["browser-launch","navigation","element-interaction","screenshots","script-evaluation","accessibility-testing"],latencyMs:10,lastChecked:e,sessionActive:this.vibeInstance!==null}:this.lastHealthCheck={status:"unavailable",features:["fallback-only"],lastChecked:e,error:"Vibium package not available - install with: npm install vibium",sessionActive:!1}}catch(t){this.lastHealthCheck={status:"error",features:["fallback-only"],lastChecked:e,error:t instanceof Error?t.message:"Unknown error",sessionActive:!1}}return this.lastHealthCheck}async getSession(){return this.currentSession}async launch(e){if(!x())return{success:!1,error:new c("Browser mode is disabled by feature flags")};let t=async()=>{let r=await V();if(!r)throw new c("Vibium package not available. Install with: npm install vibium");let s=e?.headless??this.config.headless;this.vibeInstance=await r.launch({headless:s});let n={id:this.generateSessionId(),browserType:this.config.browserType,launchedAt:new Date,status:"connected",viewport:e?.viewport??this.config.viewport,headless:s};return this.currentSession=n,n};try{return{success:!0,value:y()?await T(()=>h(t,"browser_launch"),this.config.retryAttempts,"browser_launch"):await h(t,"browser_launch")}}catch(r){return{success:!1,error:a(r,"Failed to launch browser")}}}async quit(){if(!this.vibeInstance)return{success:!1,error:new l("No active browser session")};let e=async()=>{this.vibeInstance&&(await this.vibeInstance.quit(),this.vibeInstance=null),this.currentSession=null};try{return await h(e,"browser_quit"),{success:!0,value:void 0}}catch(t){return{success:!1,error:a(t,"Failed to quit browser")}}}async navigate(e){this.ensureSession();let t=async()=>{let r=Date.now();await this.vibeInstance.go(e.url);let s="";try{s=await this.vibeInstance.evaluate("document.title")}catch{s="Unknown"}let n={url:e.url,statusCode:200,title:s,durationMs:Date.now()-r,success:!0};return this.currentSession&&(this.currentSession.currentUrl=e.url),n};try{return{success:!0,value:y()?await T(()=>h(t,"page_navigate"),this.config.retryAttempts,"page_navigate"):await h(t,"page_navigate")}}catch(r){return{success:!1,error:new p(e.url,void 0,r instanceof Error?r:void 0)}}}async getPageInfo(){this.ensureSession();try{let e=await this.vibeInstance.evaluate("window.location.href"),t=await this.vibeInstance.evaluate("document.title");return{success:!0,value:{url:e,title:t,viewport:this.config.viewport,loadState:"loaded"}}}catch(e){return{success:!1,error:a(e,"Failed to get page info")}}}async goBack(){this.ensureSession();try{return await this.vibeInstance.evaluate("window.history.back()"),{success:!0,value:void 0}}catch(e){return{success:!1,error:a(e,"Failed to go back")}}}async goForward(){this.ensureSession();try{return await this.vibeInstance.evaluate("window.history.forward()"),{success:!0,value:void 0}}catch(e){return{success:!1,error:a(e,"Failed to go forward")}}}async reload(){this.ensureSession();try{return await this.vibeInstance.evaluate("window.location.reload()"),{success:!0,value:void 0}}catch(e){return{success:!1,error:a(e,"Failed to reload page")}}}async findElement(e){this.ensureSession();try{let t=await this.vibeInstance.find(e.selector,{timeout:e.timeout??this.config.timeout});return{success:!0,value:{selector:e.selector,tagName:t.info.tag,textContent:t.info.text,attributes:{},boundingBox:t.info.box,visible:!0,enabled:!0}}}catch(t){return{success:!1,error:new g(e.selector,t instanceof Error?t:void 0)}}}async findElements(e){this.ensureSession();try{let t=e.selector.replace(/\\/g,"\\\\").replace(/'/g,"\\'");return{success:!0,value:(await this.vibeInstance.evaluate(`
4
4
  Array.from(document.querySelectorAll('${t}'))
5
5
  .map(el => ({
6
6
  tag: el.tagName.toLowerCase(),
@@ -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.10.1");process.exit(0)}
2
- import{a as N,c as ee}from"./chunk-2TDWCXZ6.js";import{b as L,d as B}from"./chunk-MVGVD6LS.js";B();ee();B();import*as x from"node:http";import*as R from"node:https";import{createHash as te}from"node:crypto";import{URL as W}from"node:url";var T={model:"Xenova/all-MiniLM-L6-v2",expectedDim:384,connectTimeoutMs:5e3,requestTimeoutMs:3e4,failureThreshold:3,failureWindowMs:6e4},ne="AQE embedder endpoint identity canary v1",re="/v1/embeddings";function X(n){if(n.startsWith("unix:"))return n;try{let e=new W(n);return e.username||e.password?(e.username="",e.password="",e.toString().replace(/\/$/,"")):n}catch{return n}}function ie(n){if(n.startsWith("unix:")){let r=n.slice(5);if(!r.startsWith("/"))throw new Error(`unix endpoint must be an absolute path: ${n}`);return{transport:"unix",socketPath:r,safeUrl:n}}let e=new W(n);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error(`unsupported embedder endpoint protocol: ${e.protocol}`);return(e.username||e.password)&&(console.warn("[EmbedderEndpointClient] endpoint URL contained userinfo; stripping. Use AQE_EMBEDDER_TOKEN env var for credentials."),e.username="",e.password=""),{transport:e.protocol==="https:"?"https":"http",host:e.hostname,port:e.port?Number(e.port):e.protocol==="https:"?443:80,protocol:e.protocol,safeUrl:e.toString().replace(/\/$/,"")}}var D=class{constructor(e,t,r=()=>{}){this.threshold=e;this.windowMs=t;this.onRecover=r}threshold;windowMs;onRecover;failures=[];trippedAt=null;recordSuccess(){this.failures=[],this.trippedAt=null}recordFailure(){let e=Date.now();this.failures=this.failures.filter(t=>e-t<this.windowMs),this.failures.push(e),this.failures.length>=this.threshold&&(this.trippedAt=e)}isOpen(){return this.trippedAt===null?!1:Date.now()-this.trippedAt>=this.windowMs?(this.failures=[],this.trippedAt=null,this.onRecover(),!1):!0}getState(){return{open:this.isOpen(),failures:this.failures.length,trippedAt:this.trippedAt}}},P=class{parsed;agent;breaker;opts;cachedIdentity=null;probeInFlight=null;constructor(e){if(this.opts={endpoint:e.endpoint,token:e.token,model:e.model??T.model,expectedDim:e.expectedDim??T.expectedDim,connectTimeoutMs:e.connectTimeoutMs??T.connectTimeoutMs,requestTimeoutMs:e.requestTimeoutMs??T.requestTimeoutMs,failureThreshold:e.failureThreshold??T.failureThreshold,failureWindowMs:e.failureWindowMs??T.failureWindowMs,tlsOptions:e.tlsOptions},this.parsed=ie(e.endpoint),this.parsed.transport==="https"){let t=e.tlsOptions??{};this.agent=new R.Agent({keepAlive:!0,ca:t.ca,cert:t.cert,key:t.key,rejectUnauthorized:t.rejectUnauthorized!==!1,servername:t.servername})}else this.agent=new x.Agent({keepAlive:!0});this.breaker=new D(this.opts.failureThreshold,this.opts.failureWindowMs,()=>{this.cachedIdentity=null})}getSafeEndpoint(){return this.parsed.safeUrl}async embed(e){if(e.length===0)return[];if(this.breaker.isOpen())throw new Error(`[EmbedderEndpointClient] circuit breaker open for ${this.parsed.safeUrl} \u2014 fast-failing`);this.cachedIdentity===null&&await this.ensureProbed();try{let t=await this.postEmbeddings(e),r=this.decodeAndNormalize(t,e.length);return this.breaker.recordSuccess(),r}catch(t){throw this.breaker.recordFailure(),t}}async probe(){return this.probeInFlight?this.probeInFlight:(this.probeInFlight=this.doProbe().finally(()=>{this.probeInFlight=null}),this.probeInFlight)}async ensureProbed(){return this.cachedIdentity?this.cachedIdentity:this.probe()}async doProbe(){let e;try{let s=await this.postEmbeddings([ne]);e=this.decodeAndNormalize(s,1)[0],this.breaker.recordSuccess()}catch(s){throw this.breaker.recordFailure(),s}if(!e||e.length!==this.opts.expectedDim)throw new Error(`[EmbedderEndpointClient] dim mismatch: expected ${this.opts.expectedDim}, got ${e?.length??0} from ${this.parsed.safeUrl}`);let t=Buffer.alloc(e.length*2);for(let s=0;s<e.length;s++){let o=Math.max(-32768,Math.min(32767,Math.round(e[s]*32767)));t.writeInt16LE(o,s*2)}let r=te("sha256").update(t).digest("hex").slice(0,16);return this.cachedIdentity={dim:e.length,fingerprint:r,endpoint:this.parsed.safeUrl},this.cachedIdentity}getCachedIdentity(){return this.cachedIdentity}getBreakerState(){return this.breaker.getState()}close(){this.agent.destroy()}decodeAndNormalize(e,t){if(!e||typeof e!="object"||!Array.isArray(e.data))throw new Error("[EmbedderEndpointClient] response missing data array");let r=e.data;if(r.length!==t)throw new Error(`[EmbedderEndpointClient] response count mismatch: expected ${t}, got ${r.length}`);let s=r.map((o,i)=>({idx:typeof o.index=="number"?o.index:i,embedding:o.embedding}));return s.sort((o,i)=>o.idx-i.idx),s.map(({embedding:o},i)=>{if(typeof o=="string")throw new Error(`[EmbedderEndpointClient] received base64 embedding at position ${i} \u2014 server ignored encoding_format=float. Configure the server to return float arrays.`);if(!Array.isArray(o))throw new Error(`[EmbedderEndpointClient] missing embedding at position ${i}`);if(o.length!==this.opts.expectedDim)throw new Error(`[EmbedderEndpointClient] dim mismatch at position ${i}: expected ${this.opts.expectedDim}, got ${o.length}`);return L(o)})}postEmbeddings(e){let t=JSON.stringify({model:this.opts.model,input:e,encoding_format:"float"});return this.request(re,t)}request(e,t){let r={"content-type":"application/json","content-length":Buffer.byteLength(t),accept:"application/json"};this.opts.token&&(r.authorization=`Bearer ${this.opts.token}`);let s={method:"POST",path:e,headers:r,agent:this.agent},o,i;this.parsed.transport==="unix"?(o={...s,socketPath:this.parsed.socketPath},i=x.request):(o={...s,host:this.parsed.host,port:this.parsed.port,protocol:this.parsed.protocol},i=this.parsed.transport==="https"?R.request:x.request);let l=this.parsed.safeUrl,c=this.opts.connectTimeoutMs,h=this.opts.requestTimeoutMs;return new Promise((S,I)=>{let E=!1,C=a=>{E||(E=!0,S(a))},y=a=>{E||(E=!0,I(a))},f=i(o,a=>{let g=[];a.on("data",u=>g.push(Buffer.from(u))),a.on("end",()=>{let u=Buffer.concat(g).toString("utf-8");if(!a.statusCode||a.statusCode<200||a.statusCode>=300){y(new Error(`[EmbedderEndpointClient] HTTP ${a.statusCode} from ${l}: ${u.slice(0,200)}`));return}try{let b=JSON.parse(u);C(b)}catch(b){y(new Error(`[EmbedderEndpointClient] invalid JSON from ${l}: ${b.message}`))}}),a.on("error",u=>y(u))});f.on("socket",a=>{a.setTimeout(c);let g=()=>{a.setTimeout(h)};a.connecting?a.once("connect",g):g(),a.on("timeout",()=>{let u=a.connecting?"connect":"request",b=a.connecting?c:h,M=new Error(`[EmbedderEndpointClient] ${u} timeout after ${b}ms`);y(M),f.destroy(M)})}),f.on("error",a=>y(a)),f.write(t),f.end()})}};import{join as H}from"node:path";import{existsSync as oe,mkdirSync as se}from"node:fs";import{createRequire as ae}from"node:module";var de=ae(import.meta.url);function le(){let n=process.env.AQE_MEMORY_PATH;return n&&n.length>0?n:H(process.cwd(),".agentic-qe","memory.db")}var j="_system",K="embedder_identity:",v=null,$=!1;function G(){if(v)return v;if($)return null;try{let n=de("better-sqlite3"),e=le(),t=H(e,"..");oe(t)||se(t,{recursive:!0});let r=new n(e);return r.pragma("journal_mode = WAL"),r.pragma("busy_timeout = 5000"),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.10.2");process.exit(0)}
2
+ import{a as N,c as ee}from"./chunk-XPCNUX2U.js";import{b as L,d as B}from"./chunk-WNR2KAUH.js";B();ee();B();import*as x from"node:http";import*as R from"node:https";import{createHash as te}from"node:crypto";import{URL as W}from"node:url";var T={model:"Xenova/all-MiniLM-L6-v2",expectedDim:384,connectTimeoutMs:5e3,requestTimeoutMs:3e4,failureThreshold:3,failureWindowMs:6e4},ne="AQE embedder endpoint identity canary v1",re="/v1/embeddings";function X(n){if(n.startsWith("unix:"))return n;try{let e=new W(n);return e.username||e.password?(e.username="",e.password="",e.toString().replace(/\/$/,"")):n}catch{return n}}function ie(n){if(n.startsWith("unix:")){let r=n.slice(5);if(!r.startsWith("/"))throw new Error(`unix endpoint must be an absolute path: ${n}`);return{transport:"unix",socketPath:r,safeUrl:n}}let e=new W(n);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error(`unsupported embedder endpoint protocol: ${e.protocol}`);return(e.username||e.password)&&(console.warn("[EmbedderEndpointClient] endpoint URL contained userinfo; stripping. Use AQE_EMBEDDER_TOKEN env var for credentials."),e.username="",e.password=""),{transport:e.protocol==="https:"?"https":"http",host:e.hostname,port:e.port?Number(e.port):e.protocol==="https:"?443:80,protocol:e.protocol,safeUrl:e.toString().replace(/\/$/,"")}}var D=class{constructor(e,t,r=()=>{}){this.threshold=e;this.windowMs=t;this.onRecover=r}threshold;windowMs;onRecover;failures=[];trippedAt=null;recordSuccess(){this.failures=[],this.trippedAt=null}recordFailure(){let e=Date.now();this.failures=this.failures.filter(t=>e-t<this.windowMs),this.failures.push(e),this.failures.length>=this.threshold&&(this.trippedAt=e)}isOpen(){return this.trippedAt===null?!1:Date.now()-this.trippedAt>=this.windowMs?(this.failures=[],this.trippedAt=null,this.onRecover(),!1):!0}getState(){return{open:this.isOpen(),failures:this.failures.length,trippedAt:this.trippedAt}}},P=class{parsed;agent;breaker;opts;cachedIdentity=null;probeInFlight=null;constructor(e){if(this.opts={endpoint:e.endpoint,token:e.token,model:e.model??T.model,expectedDim:e.expectedDim??T.expectedDim,connectTimeoutMs:e.connectTimeoutMs??T.connectTimeoutMs,requestTimeoutMs:e.requestTimeoutMs??T.requestTimeoutMs,failureThreshold:e.failureThreshold??T.failureThreshold,failureWindowMs:e.failureWindowMs??T.failureWindowMs,tlsOptions:e.tlsOptions},this.parsed=ie(e.endpoint),this.parsed.transport==="https"){let t=e.tlsOptions??{};this.agent=new R.Agent({keepAlive:!0,ca:t.ca,cert:t.cert,key:t.key,rejectUnauthorized:t.rejectUnauthorized!==!1,servername:t.servername})}else this.agent=new x.Agent({keepAlive:!0});this.breaker=new D(this.opts.failureThreshold,this.opts.failureWindowMs,()=>{this.cachedIdentity=null})}getSafeEndpoint(){return this.parsed.safeUrl}async embed(e){if(e.length===0)return[];if(this.breaker.isOpen())throw new Error(`[EmbedderEndpointClient] circuit breaker open for ${this.parsed.safeUrl} \u2014 fast-failing`);this.cachedIdentity===null&&await this.ensureProbed();try{let t=await this.postEmbeddings(e),r=this.decodeAndNormalize(t,e.length);return this.breaker.recordSuccess(),r}catch(t){throw this.breaker.recordFailure(),t}}async probe(){return this.probeInFlight?this.probeInFlight:(this.probeInFlight=this.doProbe().finally(()=>{this.probeInFlight=null}),this.probeInFlight)}async ensureProbed(){return this.cachedIdentity?this.cachedIdentity:this.probe()}async doProbe(){let e;try{let s=await this.postEmbeddings([ne]);e=this.decodeAndNormalize(s,1)[0],this.breaker.recordSuccess()}catch(s){throw this.breaker.recordFailure(),s}if(!e||e.length!==this.opts.expectedDim)throw new Error(`[EmbedderEndpointClient] dim mismatch: expected ${this.opts.expectedDim}, got ${e?.length??0} from ${this.parsed.safeUrl}`);let t=Buffer.alloc(e.length*2);for(let s=0;s<e.length;s++){let o=Math.max(-32768,Math.min(32767,Math.round(e[s]*32767)));t.writeInt16LE(o,s*2)}let r=te("sha256").update(t).digest("hex").slice(0,16);return this.cachedIdentity={dim:e.length,fingerprint:r,endpoint:this.parsed.safeUrl},this.cachedIdentity}getCachedIdentity(){return this.cachedIdentity}getBreakerState(){return this.breaker.getState()}close(){this.agent.destroy()}decodeAndNormalize(e,t){if(!e||typeof e!="object"||!Array.isArray(e.data))throw new Error("[EmbedderEndpointClient] response missing data array");let r=e.data;if(r.length!==t)throw new Error(`[EmbedderEndpointClient] response count mismatch: expected ${t}, got ${r.length}`);let s=r.map((o,i)=>({idx:typeof o.index=="number"?o.index:i,embedding:o.embedding}));return s.sort((o,i)=>o.idx-i.idx),s.map(({embedding:o},i)=>{if(typeof o=="string")throw new Error(`[EmbedderEndpointClient] received base64 embedding at position ${i} \u2014 server ignored encoding_format=float. Configure the server to return float arrays.`);if(!Array.isArray(o))throw new Error(`[EmbedderEndpointClient] missing embedding at position ${i}`);if(o.length!==this.opts.expectedDim)throw new Error(`[EmbedderEndpointClient] dim mismatch at position ${i}: expected ${this.opts.expectedDim}, got ${o.length}`);return L(o)})}postEmbeddings(e){let t=JSON.stringify({model:this.opts.model,input:e,encoding_format:"float"});return this.request(re,t)}request(e,t){let r={"content-type":"application/json","content-length":Buffer.byteLength(t),accept:"application/json"};this.opts.token&&(r.authorization=`Bearer ${this.opts.token}`);let s={method:"POST",path:e,headers:r,agent:this.agent},o,i;this.parsed.transport==="unix"?(o={...s,socketPath:this.parsed.socketPath},i=x.request):(o={...s,host:this.parsed.host,port:this.parsed.port,protocol:this.parsed.protocol},i=this.parsed.transport==="https"?R.request:x.request);let l=this.parsed.safeUrl,c=this.opts.connectTimeoutMs,h=this.opts.requestTimeoutMs;return new Promise((S,I)=>{let E=!1,C=a=>{E||(E=!0,S(a))},y=a=>{E||(E=!0,I(a))},f=i(o,a=>{let g=[];a.on("data",u=>g.push(Buffer.from(u))),a.on("end",()=>{let u=Buffer.concat(g).toString("utf-8");if(!a.statusCode||a.statusCode<200||a.statusCode>=300){y(new Error(`[EmbedderEndpointClient] HTTP ${a.statusCode} from ${l}: ${u.slice(0,200)}`));return}try{let b=JSON.parse(u);C(b)}catch(b){y(new Error(`[EmbedderEndpointClient] invalid JSON from ${l}: ${b.message}`))}}),a.on("error",u=>y(u))});f.on("socket",a=>{a.setTimeout(c);let g=()=>{a.setTimeout(h)};a.connecting?a.once("connect",g):g(),a.on("timeout",()=>{let u=a.connecting?"connect":"request",b=a.connecting?c:h,M=new Error(`[EmbedderEndpointClient] ${u} timeout after ${b}ms`);y(M),f.destroy(M)})}),f.on("error",a=>y(a)),f.write(t),f.end()})}};import{join as H}from"node:path";import{existsSync as oe,mkdirSync as se}from"node:fs";import{createRequire as ae}from"node:module";var de=ae(import.meta.url);function le(){let n=process.env.AQE_MEMORY_PATH;return n&&n.length>0?n:H(process.cwd(),".agentic-qe","memory.db")}var j="_system",K="embedder_identity:",v=null,$=!1;function G(){if(v)return v;if($)return null;try{let n=de("better-sqlite3"),e=le(),t=H(e,"..");oe(t)||se(t,{recursive:!0});let r=new n(e);return r.pragma("journal_mode = WAL"),r.pragma("busy_timeout = 5000"),r.exec(`
3
3
  CREATE TABLE IF NOT EXISTS kv_store (
4
4
  key TEXT NOT NULL,
5
5
  namespace TEXT NOT NULL,
@@ -9,4 +9,4 @@ import{a as N,c as ee}from"./chunk-2TDWCXZ6.js";import{b as L,d as B}from"./chun
9
9
  PRIMARY KEY (namespace, key)
10
10
  );
11
11
  CREATE INDEX IF NOT EXISTS idx_kv_namespace ON kv_store(namespace);
12
- `),v=r,r}catch{return $=!0,null}}function J(n){let e=G();if(!e)return null;try{let t=e.prepare("SELECT value FROM kv_store WHERE namespace = ? AND key = ?").get(j,K+n);if(!t)return null;let r=JSON.parse(t.value);return!r.fingerprint||typeof r.dim!="number"?null:{fingerprint:r.fingerprint,dim:r.dim,endpoint:r.endpoint}}catch{return null}}function Q(n){let e=G();if(!e)return;let t={fingerprint:n.fingerprint,dim:n.dim,endpoint:n.endpoint,updatedAt:Date.now()};e.prepare("INSERT OR REPLACE INTO kv_store (key, namespace, value) VALUES (?, ?, ?)").run(K+n.endpoint,j,JSON.stringify(t))}function Y(){if(v)try{v.close()}catch{}v=null,$=!1}var z=null,m=null,A=null,k=!1,O="",w=null,p=null,F={modelName:"Xenova/all-MiniLM-L6-v2",quantized:!0,enableCache:!0,maxCacheSize:1e4,endpoint:process.env.AQE_EMBEDDER_ENDPOINT,endpointToken:process.env.AQE_EMBEDDER_TOKEN},d=new Map,V=36e5;function _(n){return p?`endpoint:${p.fingerprint}:${n}`:`inproc:${n}`}function pe(n){let e=n.trim();return!!(e.startsWith("{")&&/["']metrics["']/.test(e)||e.startsWith("[")&&e.endsWith("]")&&e.length>50||(e.match(/[a-zA-Z]/g)||[]).length/Math.max(e.length,1)<.3&&e.length>20)}async function Z(n={}){if(k)throw new Error(`Transformer initialization previously failed: ${O}`);if(A)return A;let e={...F,...n};return A=(async()=>{try{if(e.endpoint){let o=X(e.endpoint);console.log(`[RealEmbeddings] Using external embedder endpoint: ${o}`),w=new P({endpoint:e.endpoint,token:e.endpointToken,model:e.modelName,expectedDim:q()}),p=await w.probe(),console.log(`[RealEmbeddings] Endpoint identity: dim=${p.dim} fingerprint=${p.fingerprint}`);try{let i=J(p.endpoint);i&&i.fingerprint!==p.fingerprint&&console.warn(`[RealEmbeddings] WARNING: endpoint identity changed since last run. Previous fingerprint=${i.fingerprint} dim=${i.dim}, current fingerprint=${p.fingerprint} dim=${p.dim}. Vectors written before this change may no longer be comparable.`),Q(p)}catch(i){console.warn(`[RealEmbeddings] Could not persist endpoint identity: ${N(i)}`)}m=ce(w);return}z=(await import("./transformers-6B3FWFYL.js")).pipeline,console.log(`[RealEmbeddings] Loading model: ${e.modelName}`);let r=performance.now();m=await z("feature-extraction",e.modelName,{quantized:e.quantized});let s=performance.now()-r;console.log(`[RealEmbeddings] Model loaded in ${s.toFixed(0)}ms`)}catch(t){throw k=!0,O=N(t),new Error(`Failed to initialize transformer model: ${O}`)}})(),A}function ce(n){return async e=>{let t=Array.isArray(e)?e:[e],r=await n.embed(t),s=r[0]?.length??q(),o=new Float32Array(t.length*s);for(let i=0;i<r.length;i++)o.set(r[i],i*s);return{data:o,dims:[t.length,s]}}}async function Ae(n,e={}){let t={...F,...e};if(pe(n))return new Array(q()).fill(0);if(m||await Z(e),!m)throw new Error("Embedding model failed to initialize");let r=_(n);if(t.enableCache){let c=d.get(r);if(c&&Date.now()-c.timestamp<V)return c.embedding}let s=performance.now(),o=await m(n,{pooling:"mean",normalize:!0}),i=Array.from(o.data),l=performance.now()-s;if(l>500&&console.warn(`[RealEmbeddings] Slow embedding computation: ${l.toFixed(1)}ms for "${n.slice(0,50)}..."`),t.enableCache){if(d.size>=t.maxCacheSize){let c=d.keys().next().value;c&&d.delete(c)}d.set(r,{embedding:i,timestamp:Date.now()})}return i}async function Ie(n,e={}){let t={...F,...e},r=[],s=[],o=new Array(n.length).fill(null);if(m||await Z(e),!m)throw new Error("Embedding model failed to initialize");if(t.enableCache)for(let i=0;i<n.length;i++){let l=d.get(_(n[i]));l&&Date.now()-l.timestamp<V?o[i]=l.embedding:(r.push(n[i]),s.push(i))}else{r.push(...n);for(let i=0;i<n.length;i++)s.push(i)}if(r.length>0){let i=performance.now(),l=32;for(let h=0;h<r.length;h+=l){let S=Math.min(h+l,r.length),I=r.slice(h,S),E=await m(I,{pooling:"mean",normalize:!0}),C=E.dims||[I.length,384],y=C[0],f=C[1];for(let a=0;a<y;a++){let g=a*f,u=Array.from(E.data.slice(g,g+f)),b=h+a,M=s[b];if(o[M]=u,t.enableCache){if(d.size>=t.maxCacheSize){let U=d.keys().next().value;U&&d.delete(U)}d.set(_(r[b]),{embedding:u,timestamp:Date.now()})}}}let c=performance.now()-i;console.log(`[RealEmbeddings] Batch computed ${r.length} embeddings in ${c.toFixed(0)}ms`)}return o.filter(i=>i!==null)}function Ce(){d.clear(),console.log("[RealEmbeddings] Cache cleared")}function Me(){return{size:d.size,hitRate:0}}function Pe(){return!k&&m!==null}function q(){return 384}function Re(){z=null,m=null,A=null,k=!1,O="",d.clear(),w&&w.close(),w=null,p=null,Y()}function Oe(){return w!==null}function ke(){return p}export{F as a,Ae as b,Ie as c,Ce as d,Me as e,Pe as f,q as g,Re as h,Oe as i,ke as j};
12
+ `),v=r,r}catch{return $=!0,null}}function J(n){let e=G();if(!e)return null;try{let t=e.prepare("SELECT value FROM kv_store WHERE namespace = ? AND key = ?").get(j,K+n);if(!t)return null;let r=JSON.parse(t.value);return!r.fingerprint||typeof r.dim!="number"?null:{fingerprint:r.fingerprint,dim:r.dim,endpoint:r.endpoint}}catch{return null}}function Q(n){let e=G();if(!e)return;let t={fingerprint:n.fingerprint,dim:n.dim,endpoint:n.endpoint,updatedAt:Date.now()};e.prepare("INSERT OR REPLACE INTO kv_store (key, namespace, value) VALUES (?, ?, ?)").run(K+n.endpoint,j,JSON.stringify(t))}function Y(){if(v)try{v.close()}catch{}v=null,$=!1}var z=null,m=null,A=null,k=!1,O="",w=null,p=null,F={modelName:"Xenova/all-MiniLM-L6-v2",quantized:!0,enableCache:!0,maxCacheSize:1e4,endpoint:process.env.AQE_EMBEDDER_ENDPOINT,endpointToken:process.env.AQE_EMBEDDER_TOKEN},d=new Map,V=36e5;function _(n){return p?`endpoint:${p.fingerprint}:${n}`:`inproc:${n}`}function pe(n){let e=n.trim();return!!(e.startsWith("{")&&/["']metrics["']/.test(e)||e.startsWith("[")&&e.endsWith("]")&&e.length>50||(e.match(/[a-zA-Z]/g)||[]).length/Math.max(e.length,1)<.3&&e.length>20)}async function Z(n={}){if(k)throw new Error(`Transformer initialization previously failed: ${O}`);if(A)return A;let e={...F,...n};return A=(async()=>{try{if(e.endpoint){let o=X(e.endpoint);console.log(`[RealEmbeddings] Using external embedder endpoint: ${o}`),w=new P({endpoint:e.endpoint,token:e.endpointToken,model:e.modelName,expectedDim:q()}),p=await w.probe(),console.log(`[RealEmbeddings] Endpoint identity: dim=${p.dim} fingerprint=${p.fingerprint}`);try{let i=J(p.endpoint);i&&i.fingerprint!==p.fingerprint&&console.warn(`[RealEmbeddings] WARNING: endpoint identity changed since last run. Previous fingerprint=${i.fingerprint} dim=${i.dim}, current fingerprint=${p.fingerprint} dim=${p.dim}. Vectors written before this change may no longer be comparable.`),Q(p)}catch(i){console.warn(`[RealEmbeddings] Could not persist endpoint identity: ${N(i)}`)}m=ce(w);return}z=(await import("./transformers-QSNTOD2Z.js")).pipeline,console.log(`[RealEmbeddings] Loading model: ${e.modelName}`);let r=performance.now();m=await z("feature-extraction",e.modelName,{quantized:e.quantized});let s=performance.now()-r;console.log(`[RealEmbeddings] Model loaded in ${s.toFixed(0)}ms`)}catch(t){throw k=!0,O=N(t),new Error(`Failed to initialize transformer model: ${O}`)}})(),A}function ce(n){return async e=>{let t=Array.isArray(e)?e:[e],r=await n.embed(t),s=r[0]?.length??q(),o=new Float32Array(t.length*s);for(let i=0;i<r.length;i++)o.set(r[i],i*s);return{data:o,dims:[t.length,s]}}}async function Ae(n,e={}){let t={...F,...e};if(pe(n))return new Array(q()).fill(0);if(m||await Z(e),!m)throw new Error("Embedding model failed to initialize");let r=_(n);if(t.enableCache){let c=d.get(r);if(c&&Date.now()-c.timestamp<V)return c.embedding}let s=performance.now(),o=await m(n,{pooling:"mean",normalize:!0}),i=Array.from(o.data),l=performance.now()-s;if(l>500&&console.warn(`[RealEmbeddings] Slow embedding computation: ${l.toFixed(1)}ms for "${n.slice(0,50)}..."`),t.enableCache){if(d.size>=t.maxCacheSize){let c=d.keys().next().value;c&&d.delete(c)}d.set(r,{embedding:i,timestamp:Date.now()})}return i}async function Ie(n,e={}){let t={...F,...e},r=[],s=[],o=new Array(n.length).fill(null);if(m||await Z(e),!m)throw new Error("Embedding model failed to initialize");if(t.enableCache)for(let i=0;i<n.length;i++){let l=d.get(_(n[i]));l&&Date.now()-l.timestamp<V?o[i]=l.embedding:(r.push(n[i]),s.push(i))}else{r.push(...n);for(let i=0;i<n.length;i++)s.push(i)}if(r.length>0){let i=performance.now(),l=32;for(let h=0;h<r.length;h+=l){let S=Math.min(h+l,r.length),I=r.slice(h,S),E=await m(I,{pooling:"mean",normalize:!0}),C=E.dims||[I.length,384],y=C[0],f=C[1];for(let a=0;a<y;a++){let g=a*f,u=Array.from(E.data.slice(g,g+f)),b=h+a,M=s[b];if(o[M]=u,t.enableCache){if(d.size>=t.maxCacheSize){let U=d.keys().next().value;U&&d.delete(U)}d.set(_(r[b]),{embedding:u,timestamp:Date.now()})}}}let c=performance.now()-i;console.log(`[RealEmbeddings] Batch computed ${r.length} embeddings in ${c.toFixed(0)}ms`)}return o.filter(i=>i!==null)}function Ce(){d.clear(),console.log("[RealEmbeddings] Cache cleared")}function Me(){return{size:d.size,hitRate:0}}function Pe(){return!k&&m!==null}function q(){return 384}function Re(){z=null,m=null,A=null,k=!1,O="",d.clear(),w&&w.close(),w=null,p=null,Y()}function Oe(){return w!==null}function ke(){return p}export{F as a,Ae as b,Ie as c,Ce as d,Me as e,Pe as f,q as g,Re as h,Oe as i,ke as j};
@@ -1,3 +1,3 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.1");process.exit(0)}
2
- import{a,b as u}from"./chunk-JLKHPIQF.js";import{f as p,o as P}from"./chunk-Q24OJX44.js";P();import*as i from"fs";import*as d from"path";var v="llm-config.json",f={claude:["ANTHROPIC_API_KEY","CLAUDE_API_KEY"],openai:["OPENAI_API_KEY"],ollama:[],openrouter:["OPENROUTER_API_KEY"],gemini:["GOOGLE_AI_API_KEY","GEMINI_API_KEY","GOOGLE_API_KEY"],"azure-openai":["AZURE_OPENAI_API_KEY"],bedrock:["AWS_ACCESS_KEY_ID"],onnx:[]},R=new Set(["claude","openai","ollama","openrouter","gemini","azure-openai","bedrock"]);function E(e){let r=e??p();return d.join(r,".agentic-qe",v)}function _(e=process.env){let r=new Set;for(let n of a){if(!R.has(n))continue;let o=f[n];if(o.length===0){r.add(n);continue}o.some(t=>(e[t]??"").trim().length>0)&&r.add(n)}return r}function g(e){let r=E(e);if(!i.existsSync(r))return{};let n=i.readFileSync(r,"utf8");if(!n.trim())return{};let o=JSON.parse(n);if(typeof o!="object"||o===null)throw new Error(`Invalid ${v}: expected object, got ${typeof o}`);return o}function C(e,r){let n=E(r),o=d.dirname(n);i.existsSync(o)||i.mkdirSync(o,{recursive:!0});let t=y(e),s=JSON.stringify(t,null,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.10.2");process.exit(0)}
2
+ import{a,b as u}from"./chunk-4BXGVM2C.js";import{f as p,o as P}from"./chunk-L7VIX22Y.js";P();import*as i from"fs";import*as d from"path";var v="llm-config.json",f={claude:["ANTHROPIC_API_KEY","CLAUDE_API_KEY"],openai:["OPENAI_API_KEY"],ollama:[],openrouter:["OPENROUTER_API_KEY"],gemini:["GOOGLE_AI_API_KEY","GEMINI_API_KEY","GOOGLE_API_KEY"],"azure-openai":["AZURE_OPENAI_API_KEY"],bedrock:["AWS_ACCESS_KEY_ID"],onnx:[]},R=new Set(["claude","openai","ollama","openrouter","gemini","azure-openai","bedrock"]);function E(e){let r=e??p();return d.join(r,".agentic-qe",v)}function _(e=process.env){let r=new Set;for(let n of a){if(!R.has(n))continue;let o=f[n];if(o.length===0){r.add(n);continue}o.some(t=>(e[t]??"").trim().length>0)&&r.add(n)}return r}function g(e){let r=E(e);if(!i.existsSync(r))return{};let n=i.readFileSync(r,"utf8");if(!n.trim())return{};let o=JSON.parse(n);if(typeof o!="object"||o===null)throw new Error(`Invalid ${v}: expected object, got ${typeof o}`);return o}function C(e,r){let n=E(r),o=d.dirname(n);i.existsSync(o)||i.mkdirSync(o,{recursive:!0});let t=y(e),s=JSON.stringify(t,null,2)+`
3
3
  `,c=n+".tmp-"+process.pid;i.writeFileSync(c,s,{encoding:"utf8",mode:384}),i.renameSync(c,n)}function y(e){if(!e.providers)return JSON.parse(JSON.stringify(e));let r=JSON.parse(JSON.stringify(e)),n=[];if(r.providers)for(let o of Object.keys(r.providers)){let t=r.providers[o];t&&"apiKey"in t&&t.apiKey&&(delete t.apiKey,n.push(o))}return n.length>0&&console.warn(`[router-config] Refused to persist apiKey for: ${n.join(", ")}. API keys belong in environment variables (e.g. ANTHROPIC_API_KEY, GEMINI_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY), NOT in .agentic-qe/llm-config.json which may be checked into source control.`),r}function l(e,r){let n={...e,...r,providers:{...e.providers??{}}};if(r.providers)for(let[o,t]of Object.entries(r.providers)){if(!t)continue;let s=o;n.providers[s]={...e.providers?.[s]??{},...t}}return n}function m(e,r=process.env){let n=_(r),o={...e,providers:{...e.providers??{}}};for(let t of n){if(f[t].length===0)continue;let c=o.providers[t]??{enabled:!1};c.enabled||(o.providers[t]={...c,enabled:!0})}return o}function A(e={}){let r=g(e.projectRoot),n=l(u,r),o=m(n,e.env);return e.override?l(o,e.override):o}function S(e={}){let r=e.env??process.env;for(let o of a){let t=f[o];if(t.length!==0&&t.some(s=>(r[s]??"").trim().length>0))return!0}let n=g(e.projectRoot);if(n.providers){for(let o of Object.values(n.providers))if(o?.enabled)return!0}return!1}export{_ as a,C as b,A as c,S as d};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.1");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.10.2");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,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.10.1");process.exit(0)}
2
- import{a as C,b as D,c as U,d as _}from"./chunk-TFNLXAK5.js";import{a as H}from"./chunk-ECPB7IAH.js";import{c as X,d as K,e as Y,f as J}from"./chunk-LF7URN2X.js";import{b as k,f as j,i as G}from"./chunk-NRLT44YB.js";import{g as w}from"./chunk-AUVC3DDB.js";import{e as $}from"./chunk-F3OVFA6W.js";import{k as B,o as de}from"./chunk-Q24OJX44.js";import{a as W}from"./chunk-VPCE5CIT.js";import{c as T}from"./chunk-BGBSYF3K.js";import{b as q,c as x}from"./chunk-Y2DPXMOR.js";import{a as f,b as L,c as V}from"./chunk-2TDWCXZ6.js";import{S as pe,b as z}from"./chunk-ELZ67OHQ.js";W();V();var I={enableLearning:!0,enableGuidance:!0,enableRouting:!0,embeddingDimension:384,useONNXEmbeddings:!0,maxRoutingCandidates:10,routingWeights:{similarity:.3,performance:.4,capabilities:.3},coherenceThreshold:.4};var A=[{patternType:"test-template",name:"AAA Unit Test",description:"Arrange-Act-Assert pattern for clear, maintainable unit tests",template:{type:"code",content:`describe('{{className}}', () => {
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.10.2");process.exit(0)}
2
+ import{a as D,b as _,c as $,d as I}from"./chunk-LQTWPSYL.js";import{a as X}from"./chunk-LZCBSFAU.js";import{c as K,d as Y,e as J,f as Z}from"./chunk-5PL7WTCU.js";import{b as C,f as G,i as U}from"./chunk-ZGNZJJFF.js";import{g as R}from"./chunk-VSUTI4G6.js";import{e as H}from"./chunk-SVYTN2GT.js";import{k as j,o as de}from"./chunk-L7VIX22Y.js";import{a as z}from"./chunk-IAZEDWRX.js";import{c as A}from"./chunk-JF53LRBL.js";import{b as k,c as T}from"./chunk-FPAW77XV.js";import{a as h,b as V,c as W}from"./chunk-XPCNUX2U.js";import{S as pe,b as B}from"./chunk-ON4D4TJ4.js";z();W();var N={enableLearning:!0,enableGuidance:!0,enableRouting:!0,embeddingDimension:384,useONNXEmbeddings:!0,maxRoutingCandidates:10,routingWeights:{similarity:.3,performance:.4,capabilities:.3},coherenceThreshold:.4};var q=[{patternType:"test-template",name:"AAA Unit Test",description:"Arrange-Act-Assert pattern for clear, maintainable unit tests",template:{type:"code",content:`describe('{{className}}', () => {
3
3
  describe('{{methodName}}', () => {
4
4
  it('should {{expectedBehavior}}', {{async}} () => {
5
5
  // Arrange
@@ -278,7 +278,7 @@ On promotion:
278
278
  - Move from short-term to long-term tier
279
279
  - Boost confidence by 10%
280
280
  - Enable for cross-domain transfer to related domains
281
- - Mark as reusable for token savings optimization`,variables:[{name:"patternName",type:"string",required:!0,description:"Pattern to evaluate for promotion"}]},context:{tags:["promotion","learning","quality","pipeline"]},confidence:.6}];import{randomInt as Z}from"crypto";var R={"qe-test-generator":{domains:["test-generation"],capabilities:["test-generation","tdd","bdd","unit-test","integration-test"],performanceScore:.85,languages:["typescript","javascript","python","java","csharp","go","rust","swift","kotlin","dart"]},"qe-coverage-analyzer":{domains:["coverage-analysis"],capabilities:["coverage-analysis","gap-detection","risk-scoring"],performanceScore:.92,languages:["typescript","javascript","python","java","csharp","go","rust","swift","kotlin","dart"]},"qe-coverage-specialist":{domains:["coverage-analysis"],capabilities:["sublinear-analysis","branch-coverage","mutation-testing"],performanceScore:.88,languages:["typescript","javascript"]},"qe-test-architect":{domains:["test-generation","coverage-analysis"],capabilities:["test-strategy","test-pyramid","architecture"],performanceScore:.9,languages:["typescript","javascript","python","java","csharp","go","rust","swift","kotlin","dart"]},"qe-api-contract-validator":{domains:["contract-testing"],capabilities:["contract-testing","openapi","graphql","pact"],performanceScore:.87},"qe-security-auditor":{domains:["security-compliance"],capabilities:["sast","dast","vulnerability","owasp"],performanceScore:.82},"qe-visual-tester":{domains:["visual-accessibility"],capabilities:["screenshot","visual-regression","percy","chromatic"],performanceScore:.8},"qe-a11y-ally":{domains:["visual-accessibility"],capabilities:["wcag","aria","screen-reader","contrast"],performanceScore:.85},"qe-performance-tester":{domains:["chaos-resilience"],capabilities:["load-testing","stress-testing","k6","artillery"],performanceScore:.83},"qe-flaky-investigator":{domains:["test-execution"],capabilities:["flaky-detection","test-stability","retry"],performanceScore:.78},"qe-chaos-engineer":{domains:["chaos-resilience"],capabilities:["chaos-testing","resilience","fault-injection"],performanceScore:.75}},me=.4,ge=20;function fe(n){return 1/(1+Math.exp(-n))}function he(n,e){if(!e||e.visits===0)return{score:n,qWeight:0,qValue:0,qVisits:0};let r=Math.min(e.visits/ge,1)*me,t=fe(e.qValue);return{score:n*(1-r)+t*r,qWeight:r,qValue:e.qValue,qVisits:e.visits}}function ee(n){let e=n.envOverride,r=e!==void 0?Number.parseFloat(e):NaN,t=Number.isFinite(r)&&r>=0&&r<=1?r:.05,i=n.topologyCritical?.2:1;return{epsilon:Math.min(Math.max(t*i,0),1),baseEpsilon:t,safetyMultiplier:i}}function te(n,e){if(e<=0||n.length<2)return;let r=Math.round(e*1e6);if(r<=0||Z(0,1e6)>=r)return;let t=Math.min(4,n.length),i=Z(1,t),o=n[i];n[i]=n[0],n[0]=o,n[0].exploration=!0,n[0].reasoning=[...n[0].reasoning,"(exploration)"]}function re(n){let e=n.toLowerCase();return/\bgenerate[- ]?test|\btest[- ]?gen|\bgenerate.+spec/.test(e)?"test-generation":/\bcoverage|\banalyze.+cover/.test(e)?"coverage-analysis":/\bquality|\bassess|\baudit/.test(e)?"quality-assessment":/\bsecurity|\bvulnerab|\bcompliance/.test(e)?"security-compliance":/\bdefect|\bbug|\bdiagnos/.test(e)?"defect-intelligence":/\brequirement|\bspec\b/.test(e)?"requirements-validation":/\brefactor|\brewrite|\boptim/.test(e)?"refactoring":/\btest|\brun.+test/.test(e)?"test-execution":"unknown"}function ne(n){return`${n.taskType}|${n.priority??"normal"}|${n.domain??"any"}`}function N(n,e,r,t,i=R,o,s){let a=[];for(let[c,u]of Object.entries(i)){let l=0,d=[],m=n.filter(h=>u.domains.includes(h)).length,y=m>0?m/n.length*.4:0;if(l+=y*t.similarity,y>0&&d.push(`Domain match: ${(y*100).toFixed(0)}%`),e&&e.length>0){let h=e.filter(v=>u.capabilities.some(P=>P.toLowerCase().includes(v.toLowerCase()))).length,p=h>0?h/e.length*.3:0;l+=p*t.capabilities,p>0&&d.push(`Capability match: ${(p*100).toFixed(0)}%`)}else l+=.15*t.capabilities;if(l+=u.performanceScore*.3*t.performance,d.push(`Performance score: ${(u.performanceScore*100).toFixed(0)}%`),o&&u.languages&&u.languages.length>0){let h=t.language??1,p=o.toLowerCase();if(u.languages.some(P=>P.toLowerCase()===p)){let P=.15*h;l+=P,d.push(`Language match: ${o}`)}}let b=r.get(c)||0;if(b>0){let h=Math.min(.1,b*.02);l+=h,d.push(`Pattern matches: ${b}`)}let S=l;if(s){let h=s(c),p=he(S,h);l=p.score,p.qWeight>0&&d.push(`Q-bonus (w=${p.qWeight.toFixed(2)}, v=${p.qVisits})`),a.push({agent:c,score:l,reasoning:d,staticScore:S,qWeight:p.qWeight,qValue:p.qValue,qVisits:p.qVisits})}else a.push({agent:c,score:l,reasoning:d,staticScore:S})}return a.sort((c,u)=>u.score-c.score),a}var Q={"test-generation":["test-execution","coverage-analysis","requirements-validation"],"test-execution":["test-generation","coverage-analysis","quality-assessment"],"coverage-analysis":["test-generation","test-execution","quality-assessment"],"quality-assessment":["test-execution","coverage-analysis","defect-intelligence"],"defect-intelligence":["quality-assessment","code-intelligence"],"requirements-validation":["test-generation","quality-assessment"],"code-intelligence":["defect-intelligence","security-compliance"],"security-compliance":["code-intelligence","quality-assessment"],"contract-testing":["test-generation","test-execution"],"visual-accessibility":["quality-assessment"],"chaos-resilience":["test-execution","quality-assessment"],"learning-optimization":["test-generation","test-execution","coverage-analysis","quality-assessment","defect-intelligence"]};function ie(){try{return!J()||!Y()||X().isEmpty()?!1:K().isCritical()}catch{return!1}}de();function ae(n,e){if(n.length===e)return n;if(n.length>e){let r=n.length/e,t=new Array(e).fill(0);for(let i=0;i<e;i++){let o=Math.floor(i*r),s=Math.floor((i+1)*r),a=0;for(let c=o;c<s;c++)a+=n[c];t[i]=a/(s-o)}return M(t)}else{let r=new Array(e).fill(0),t=(n.length-1)/(e-1);for(let i=0;i<e;i++){let o=i*t,s=Math.floor(o),a=Math.min(s+1,n.length-1),c=o-s;r[i]=n[s]*(1-c)+n[a]*c}return M(r)}}function oe(n,e){let r=new Array(e).fill(0),t=n.toLowerCase().trim();for(let i=0;i<3;i++)for(let o=0;o<t.length;o++){let s=t.charCodeAt(o),a=s*(o+1)*(i+1)%e;r[a]+=Math.sin(s*(i+1))/(o+1)}return M(r)}function M(n){let e=Math.sqrt(n.reduce((r,t)=>r+t*t,0));if(e>0)for(let r=0;r<n.length;r++)n[r]/=e;return n}W();V();pe();var E=T.create("PatternPromotion");async function se(n,e){let r=j(n);if(!r.meetsUsageCriteria||!r.meetsQualityCriteria)return!1;if(e.coherenceService&&e.coherenceService.isInitialized()){let t=await e.searchPatterns("",{tier:"long-term",limit:1e3}),s=[...t.success?t.value.map(c=>c.pattern):[],n].map(c=>({id:c.id,embedding:c.embedding||[],weight:c.confidence,metadata:{name:c.name,domain:c.qeDomain}})),a=await e.coherenceService.checkCoherence(s);if(a.energy>=e.coherenceThreshold){let c={patternId:n.id,patternName:n.name,reason:"coherence_violation",energy:a.energy,existingPatternConflicts:a.contradictions?.map(u=>u.nodeIds).flat()};return e.eventBus&&await e.eventBus.publish({id:`pattern-promotion-blocked-${n.id}`,type:"pattern:promotion_blocked",timestamp:new Date,source:"learning-optimization",payload:c}),E.info("Pattern promotion blocked due to coherence violation",{name:n.name,energy:a.energy}),!1}}return!0}async function ce(n,e){let r=await e.patternStore.promote(n);if(r.success){try{e.getSqliteStore().promotePattern(n)}catch(t){E.warn("SQLite pattern promotion persist failed",{error:f(t)})}if(z().useSublinearSolver)try{let t=e.getSqliteStore().getDatabase?.();if(t){let i=new O(t),o=await e.getPattern(n);if(o){let s=await e.searchPatterns("",{domain:o.qeDomain,tier:"long-term",limit:20});if(s.success)for(let{pattern:a}of s.value)a.id!==n&&i.recordCoOccurrence(n,a.id)}}}catch(t){E.warn("Citation graph update failed (non-fatal)",{error:f(t)})}if(e.rvfDualWriter)try{let t=await e.getPattern(n);t?.embedding&&t.embedding.length>0&&e.rvfDualWriter.writePattern(n,t.embedding)}catch(t){E.warn("RVF dual-write on promote failed (non-fatal)",{patternId:n,error:f(t)})}w().then(t=>t.append("PATTERN_PROMOTE",{patternId:n},"reasoning-bank")).catch(t=>{E.warn("Witness chain PATTERN_PROMOTE failed",{error:f(t)})}),E.info("Promoted pattern to long-term",{patternId:n}),e.eventBus&&await e.eventBus.publish({id:`pattern-promoted-${n}`,type:"pattern:promoted",timestamp:new Date,source:"learning-optimization",payload:{patternId:n,newTier:"long-term"}})}else E.error("Failed to promote pattern",r.error,{patternId:n})}async function le(n){let{signal:e}=n;e?.throwIfAborted();let r=await n.patternStore.getStats(),t=0,i=0;for(let[o,s]of Object.entries(Q)){e?.throwIfAborted();let a=o,c=r.byDomain[a]||0;if(c===0)continue;let u=await n.searchPatterns("",{domain:a,limit:50});if(u.success)for(let l of s){if(e?.throwIfAborted(),(r.byDomain[l]||0)>=c){i++;continue}for(let{pattern:m}of u.value){e?.throwIfAborted();let y=await n.searchPatterns(m.name,{domain:l,limit:1});if(y.success&&y.value.length>0&&y.value[0].score>.8){i++;continue}let b=Math.max(.3,(m.confidence||.5)*.8);(await n.storePattern({patternType:m.patternType,qeDomain:l,name:`${m.name} (from ${a})`,description:`${m.description} [Transferred from ${a} domain]`,template:m.template,context:{...m.context,relatedDomains:[a,l],tags:[...m.context.tags,"cross-domain-transfer",`source:${a}`]},confidence:b})).success?t++:i++}}}return E.info("Cross-domain transfer complete",{transferred:t,skipped:i}),{transferred:t,skipped:i}}var ye=`
281
+ - Mark as reusable for token savings optimization`,variables:[{name:"patternName",type:"string",required:!0,description:"Pattern to evaluate for promotion"}]},context:{tags:["promotion","learning","quality","pipeline"]},confidence:.6}];import{randomInt as ee}from"crypto";var x={"qe-test-generator":{domains:["test-generation"],capabilities:["test-generation","tdd","bdd","unit-test","integration-test"],performanceScore:.85,languages:["typescript","javascript","python","java","csharp","go","rust","swift","kotlin","dart"]},"qe-coverage-analyzer":{domains:["coverage-analysis"],capabilities:["coverage-analysis","gap-detection","risk-scoring"],performanceScore:.92,languages:["typescript","javascript","python","java","csharp","go","rust","swift","kotlin","dart"]},"qe-coverage-specialist":{domains:["coverage-analysis"],capabilities:["sublinear-analysis","branch-coverage","mutation-testing"],performanceScore:.88,languages:["typescript","javascript"]},"qe-test-architect":{domains:["test-generation","coverage-analysis"],capabilities:["test-strategy","test-pyramid","architecture"],performanceScore:.9,languages:["typescript","javascript","python","java","csharp","go","rust","swift","kotlin","dart"]},"qe-api-contract-validator":{domains:["contract-testing"],capabilities:["contract-testing","openapi","graphql","pact"],performanceScore:.87},"qe-security-auditor":{domains:["security-compliance"],capabilities:["sast","dast","vulnerability","owasp"],performanceScore:.82},"qe-visual-tester":{domains:["visual-accessibility"],capabilities:["screenshot","visual-regression","percy","chromatic"],performanceScore:.8},"qe-a11y-ally":{domains:["visual-accessibility"],capabilities:["wcag","aria","screen-reader","contrast"],performanceScore:.85},"qe-performance-tester":{domains:["chaos-resilience"],capabilities:["load-testing","stress-testing","k6","artillery"],performanceScore:.83},"qe-flaky-investigator":{domains:["test-execution"],capabilities:["flaky-detection","test-stability","retry"],performanceScore:.78},"qe-chaos-engineer":{domains:["chaos-resilience"],capabilities:["chaos-testing","resilience","fault-injection"],performanceScore:.75}},me=.4,ge=20,fe=3;function he(n){return 1/(1+Math.exp(-n))}function ye(n,e){if(!e||e.visits===0)return{score:n,qWeight:0,qValue:0,qVisits:0};let r=Math.min(e.visits/ge,1)*me,t=he(e.qValue);return{score:n*(1-r)+t*r,qWeight:r,qValue:e.qValue,qVisits:e.visits}}function te(n){let e=n.envOverride,r=e!==void 0?Number.parseFloat(e):NaN,t=Number.isFinite(r)&&r>=0&&r<=1?r:.05,i=n.topologyCritical?.2:1;return{epsilon:Math.min(Math.max(t*i,0),1),baseEpsilon:t,safetyMultiplier:i}}function re(n,e){if(e<=0||n.length<2)return;let r=Math.round(e*1e6);if(r<=0||ee(0,1e6)>=r)return;let t=Math.min(4,n.length),i=ee(1,t),o=n[i];n[i]=n[0],n[0]=o,n[0].exploration=!0,n[0].reasoning=[...n[0].reasoning,"(exploration)"]}function ne(n){let e=n.toLowerCase();return/\bgenerate[- ]?test|\btest[- ]?gen|\bgenerate.+spec/.test(e)?"test-generation":/\bcoverage|\banalyze.+cover/.test(e)?"coverage-analysis":/\bquality|\bassess|\baudit/.test(e)?"quality-assessment":/\bsecurity|\bvulnerab|\bcompliance/.test(e)?"security-compliance":/\bdefect|\bbug|\bdiagnos/.test(e)?"defect-intelligence":/\brequirement|\bspec\b/.test(e)?"requirements-validation":/\brefactor|\brewrite|\boptim/.test(e)?"refactoring":/\btest|\brun.+test/.test(e)?"test-execution":"unknown"}function ie(n){return`${n.taskType}|${n.priority??"normal"}|${n.domain??"any"}`}function Q(n,e,r,t,i=x,o,s){let a=[];for(let[c,u]of Object.entries(i)){let l=0,p=[],m=n.filter(d=>u.domains.includes(d)).length,y=Math.min(n.length,fe),b=m>0?Math.min(m/y,1)*.4:0;if(l+=b*t.similarity,b>0&&p.push(`Domain match: ${(b*100).toFixed(0)}%`),e&&e.length>0){let d=e.filter(w=>u.capabilities.some(P=>P.toLowerCase().includes(w.toLowerCase()))).length,g=d>0?d/e.length*.3:0;l+=g*t.capabilities,g>0&&p.push(`Capability match: ${(g*100).toFixed(0)}%`)}else l+=.15*t.capabilities;if(l+=u.performanceScore*.3*t.performance,p.push(`Performance score: ${(u.performanceScore*100).toFixed(0)}%`),o&&u.languages&&u.languages.length>0){let d=t.language??1,g=o.toLowerCase();if(u.languages.some(P=>P.toLowerCase()===g)){let P=.15*d;l+=P,p.push(`Language match: ${o}`)}}let E=r.get(c)||0;if(E>0){let d=Math.min(.1,E*.02);l+=d,p.push(`Pattern matches: ${E}`)}let S=l;if(s){let d=s(c),g=ye(S,d);l=g.score,g.qWeight>0&&p.push(`Q-bonus (w=${g.qWeight.toFixed(2)}, v=${g.qVisits})`),a.push({agent:c,score:l,reasoning:p,staticScore:S,qWeight:g.qWeight,qValue:g.qValue,qVisits:g.qVisits})}else a.push({agent:c,score:l,reasoning:p,staticScore:S})}return a.sort((c,u)=>u.score-c.score),a}var M={"test-generation":["test-execution","coverage-analysis","requirements-validation"],"test-execution":["test-generation","coverage-analysis","quality-assessment"],"coverage-analysis":["test-generation","test-execution","quality-assessment"],"quality-assessment":["test-execution","coverage-analysis","defect-intelligence"],"defect-intelligence":["quality-assessment","code-intelligence"],"requirements-validation":["test-generation","quality-assessment"],"code-intelligence":["defect-intelligence","security-compliance"],"security-compliance":["code-intelligence","quality-assessment"],"contract-testing":["test-generation","test-execution"],"visual-accessibility":["quality-assessment"],"chaos-resilience":["test-execution","quality-assessment"],"learning-optimization":["test-generation","test-execution","coverage-analysis","quality-assessment","defect-intelligence"]};function ae(){try{return!Z()||!J()||K().isEmpty()?!1:Y().isCritical()}catch{return!1}}de();function oe(n,e){if(n.length===e)return n;if(n.length>e){let r=n.length/e,t=new Array(e).fill(0);for(let i=0;i<e;i++){let o=Math.floor(i*r),s=Math.floor((i+1)*r),a=0;for(let c=o;c<s;c++)a+=n[c];t[i]=a/(s-o)}return O(t)}else{let r=new Array(e).fill(0),t=(n.length-1)/(e-1);for(let i=0;i<e;i++){let o=i*t,s=Math.floor(o),a=Math.min(s+1,n.length-1),c=o-s;r[i]=n[s]*(1-c)+n[a]*c}return O(r)}}function se(n,e){let r=new Array(e).fill(0),t=n.toLowerCase().trim();for(let i=0;i<3;i++)for(let o=0;o<t.length;o++){let s=t.charCodeAt(o),a=s*(o+1)*(i+1)%e;r[a]+=Math.sin(s*(i+1))/(o+1)}return O(r)}function O(n){let e=Math.sqrt(n.reduce((r,t)=>r+t*t,0));if(e>0)for(let r=0;r<n.length;r++)n[r]/=e;return n}z();W();pe();var v=A.create("PatternPromotion");async function ce(n,e){let r=G(n);if(!r.meetsUsageCriteria||!r.meetsQualityCriteria)return!1;if(e.coherenceService&&e.coherenceService.isInitialized()){let t=await e.searchPatterns("",{tier:"long-term",limit:1e3}),s=[...t.success?t.value.map(c=>c.pattern):[],n].map(c=>({id:c.id,embedding:c.embedding||[],weight:c.confidence,metadata:{name:c.name,domain:c.qeDomain}})),a=await e.coherenceService.checkCoherence(s);if(a.energy>=e.coherenceThreshold){let c={patternId:n.id,patternName:n.name,reason:"coherence_violation",energy:a.energy,existingPatternConflicts:a.contradictions?.map(u=>u.nodeIds).flat()};return e.eventBus&&await e.eventBus.publish({id:`pattern-promotion-blocked-${n.id}`,type:"pattern:promotion_blocked",timestamp:new Date,source:"learning-optimization",payload:c}),v.info("Pattern promotion blocked due to coherence violation",{name:n.name,energy:a.energy}),!1}}return!0}async function le(n,e){let r=await e.patternStore.promote(n);if(r.success){try{e.getSqliteStore().promotePattern(n)}catch(t){v.warn("SQLite pattern promotion persist failed",{error:h(t)})}if(B().useSublinearSolver)try{let t=e.getSqliteStore().getDatabase?.();if(t){let i=new F(t),o=await e.getPattern(n);if(o){let s=await e.searchPatterns("",{domain:o.qeDomain,tier:"long-term",limit:20});if(s.success)for(let{pattern:a}of s.value)a.id!==n&&i.recordCoOccurrence(n,a.id)}}}catch(t){v.warn("Citation graph update failed (non-fatal)",{error:h(t)})}if(e.rvfDualWriter)try{let t=await e.getPattern(n);t?.embedding&&t.embedding.length>0&&e.rvfDualWriter.writePattern(n,t.embedding)}catch(t){v.warn("RVF dual-write on promote failed (non-fatal)",{patternId:n,error:h(t)})}R().then(t=>t.append("PATTERN_PROMOTE",{patternId:n},"reasoning-bank")).catch(t=>{v.warn("Witness chain PATTERN_PROMOTE failed",{error:h(t)})}),v.info("Promoted pattern to long-term",{patternId:n}),e.eventBus&&await e.eventBus.publish({id:`pattern-promoted-${n}`,type:"pattern:promoted",timestamp:new Date,source:"learning-optimization",payload:{patternId:n,newTier:"long-term"}})}else v.error("Failed to promote pattern",r.error,{patternId:n})}async function ue(n){let{signal:e}=n;e?.throwIfAborted();let r=await n.patternStore.getStats(),t=0,i=0;for(let[o,s]of Object.entries(M)){e?.throwIfAborted();let a=o,c=r.byDomain[a]||0;if(c===0)continue;let u=await n.searchPatterns("",{domain:a,limit:50});if(u.success)for(let l of s){if(e?.throwIfAborted(),(r.byDomain[l]||0)>=c){i++;continue}for(let{pattern:m}of u.value){e?.throwIfAborted();let y=await n.searchPatterns(m.name,{domain:l,limit:1});if(y.success&&y.value.length>0&&y.value[0].score>.8){i++;continue}let b=Math.max(.3,(m.confidence||.5)*.8);(await n.storePattern({patternType:m.patternType,qeDomain:l,name:`${m.name} (from ${a})`,description:`${m.description} [Transferred from ${a} domain]`,template:m.template,context:{...m.context,relatedDomains:[a,l],tags:[...m.context.tags,"cross-domain-transfer",`source:${a}`]},confidence:b})).success?t++:i++}}}return v.info("Cross-domain transfer complete",{transferred:t,skipped:i}),{transferred:t,skipped:i}}var be=`
282
282
  CREATE TABLE IF NOT EXISTS pattern_citations (
283
283
  source_pattern_id TEXT NOT NULL,
284
284
  target_pattern_id TEXT NOT NULL,
@@ -289,7 +289,7 @@ On promotion:
289
289
  );
290
290
  CREATE INDEX IF NOT EXISTS idx_citations_source ON pattern_citations(source_pattern_id);
291
291
  CREATE INDEX IF NOT EXISTS idx_citations_target ON pattern_citations(target_pattern_id);
292
- `,O=class{constructor(e){this.db=e}db;initialized=!1;ensureSchema(){this.initialized||(this.db.exec(ye),this.initialized=!0)}recordCoOccurrence(e,r){this.ensureSchema();let[t,i]=e<r?[e,r]:[r,e];this.db.prepare(`
292
+ `,F=class{constructor(e){this.db=e}db;initialized=!1;ensureSchema(){this.initialized||(this.db.exec(be),this.initialized=!0)}recordCoOccurrence(e,r){this.ensureSchema();let[t,i]=e<r?[e,r]:[r,e];this.db.prepare(`
293
293
  INSERT INTO pattern_citations (source_pattern_id, target_pattern_id, weight, relationship)
294
294
  VALUES (?, ?, 1.0, 'co-occurrence')
295
295
  ON CONFLICT(source_pattern_id, target_pattern_id)
@@ -304,17 +304,17 @@ On promotion:
304
304
  `).all(),t=new Map;for(let u of r){let l=t.get(u.qe_domain)??[];l.push(u.id),t.set(u.qe_domain,l)}let i=this.db.prepare(`
305
305
  INSERT OR IGNORE INTO pattern_citations (source_pattern_id, target_pattern_id, weight, relationship)
306
306
  VALUES (?, ?, 1.0, 'co-occurrence')
307
- `),o=this.db.transaction(u=>{for(let[l,d]of u)i.run(l,d).changes>0&&e++}),s=[];for(let[,u]of t){let l=u.slice(0,50);for(let d=0;d<l.length;d++)for(let m=d+1;m<l.length;m++){let[y,b]=l[d]<l[m]?[l[d],l[m]]:[l[m],l[d]];s.push([y,b])}}o(s);let a=this.db.prepare(`
307
+ `),o=this.db.transaction(u=>{for(let[l,p]of u)i.run(l,p).changes>0&&e++}),s=[];for(let[,u]of t){let l=u.slice(0,50);for(let p=0;p<l.length;p++)for(let m=p+1;m<l.length;m++){let[y,b]=l[p]<l[m]?[l[p],l[m]]:[l[m],l[p]];s.push([y,b])}}o(s);let a=this.db.prepare(`
308
308
  SELECT source_pattern_id, target_pattern_id, relationship_type
309
309
  FROM pattern_relationships
310
310
  WHERE relationship_type IN ('merged', 'derived', 'superseded')
311
311
  `).all(),c=this.db.prepare(`
312
312
  INSERT OR IGNORE INTO pattern_citations (source_pattern_id, target_pattern_id, weight, relationship)
313
313
  VALUES (?, ?, 2.0, 'derivation')
314
- `);for(let u of a)c.run(u.source_pattern_id,u.target_pattern_id).changes>0&&e++;return e}getEdgeCount(){return this.ensureSchema(),this.db.prepare("SELECT COUNT(*) as cnt FROM pattern_citations").get().cnt}};var g=T.create("QEReasoningBank"),F=class{constructor(e,r,t={},i){this.memory=e;this.eventBus=r;this.coherenceService=i;this.config={...I,...t},t.rvfDualWriter&&(this.rvfDualWriter=t.rvfDualWriter),this.patternStore=H(e,{embeddingDimension:this.config.embeddingDimension,...t.patternStore})}memory;eventBus;coherenceService;config;patternStore;initialized=!1;sqliteStore=null;rvfDualWriter=null;getSqliteStore(){return this.sqliteStore||(this.sqliteStore=$(),this.sqliteStore.initialize().catch(e=>{g.warn("SQLitePatternStore init failed",{error:f(e)})})),this.sqliteStore}setRvfDualWriter(e){this.rvfDualWriter=e}stats={routingRequests:0,totalRoutingConfidence:0,learningOutcomes:0,successfulOutcomes:0};async initialize(e){if(this.initialized)return;let r=e?.signal;r?.throwIfAborted(),await this.patternStore.initialize(),r?.throwIfAborted();try{let t=this.getSqliteStore();await t.initialize(),this.patternStore.setSqliteStore?.(t)}catch(t){g.warn("Failed to wire SQLitePatternStore into PatternStore",{error:f(t)})}r?.throwIfAborted(),await this.loadPretrainedPatterns(r),r?.throwIfAborted(),this.initialized=!0;try{let t="reasoning-bank:cross-domain-seeded";if(!await this.memory.get(t))await this.memory.set(t,!0),await this.seedCrossDomainPatterns(r);else{let o=await this.patternStore.getStats();g.info("Cross-domain transfer already complete",{totalPatterns:o.totalPatterns})}}catch(t){if(r?.aborted)throw t;g.warn("Cross-domain seeding failed (non-fatal)",{error:t})}g.info("Initialized")}async loadPretrainedPatterns(e){e?.throwIfAborted();let r=await this.patternStore.getStats();if(r.totalPatterns>0){g.info("Found existing patterns",{totalPatterns:r.totalPatterns});let t=this.patternStore.getAdapter?.();if(t&&(t.status()?.totalVectors??0)===0)try{let i=(()=>{let a=process.env.AQE_RVF_BACKFILL_LIMIT,c=a?Number(a):NaN;return Number.isFinite(c)&&c>0?Math.floor(c):1e3})(),s=this.getSqliteStore().getRecentEmbeddings(i).filter(({embedding:a})=>a&&a.length>0).map(({patternId:a,embedding:c})=>({id:a,vector:c instanceof Float32Array?c:new Float32Array(c)}));if(s.length>0){let{accepted:a,rejected:c}=t.ingest(s);g.info("Backfilled RVF from SQLite",{requested:s.length,accepted:a,cap:i,truncated:s.length>=i}),c>0&&g.warn("RVF backfill partially rejected",{accepted:a,rejected:c})}}catch(i){g.warn("RVF backfill failed (non-fatal)",{error:f(i)})}return}for(let t of A){e?.throwIfAborted();try{await this.storePattern(t)}catch(i){if(e?.aborted)throw i;g.warn("Failed to load pattern",{name:t.name,error:i})}}g.info("Loaded foundational patterns",{count:A.length})}async seedCrossDomainPatterns(e){return this.initialized||await this.initialize({signal:e}),le({searchPatterns:this.searchPatterns.bind(this),storePattern:this.storePattern.bind(this),patternStore:this.patternStore,signal:e})}async storePattern(e){if(this.initialized||await this.initialize(),!this.config.enableLearning)return x(new Error("Pattern learning is disabled"));if(!e.embedding){let t=await this.embed(`${e.name} ${e.description} ${e.context?.tags?.join(" ")||""}`);e={...e,embedding:t}}let r=await this.patternStore.create(e);if(r.success&&(w().then(t=>t.append("PATTERN_CREATE",{patternId:r.value.id,domain:r.value.qeDomain,confidence:r.value.confidence,name:r.value.name},"reasoning-bank")).catch(t=>{g.warn("Witness chain PATTERN_CREATE failed",{error:f(t)})}),this.rvfDualWriter&&r.value.embedding&&r.value.embedding.length>0))try{this.rvfDualWriter.writePattern(r.value.id,r.value.embedding)}catch(t){g.warn("RVF dual-write failed (non-fatal)",{patternId:r.value.id,error:f(t)})}return r}async searchPatterns(e,r){this.initialized||await this.initialize();let t=e,i=!0;return typeof e=="string"&&(e.trim()===""?(i=!1,t=""):t=await this.embed(e)),this.patternStore.search(t,{...r,useVectorSearch:i})}async getPattern(e){return this.initialized||await this.initialize(),this.patternStore.get(e)}async recordOutcome(e){if(this.initialized||await this.initialize(),!this.config.enableLearning)return q(void 0);let r=await this.patternStore.recordUsage(e.patternId,e.success);try{this.getSqliteStore().recordUsage(e.patternId,e.success,e.metrics,e.feedback)}catch(t){g.warn("SQLite pattern usage persist failed",{error:f(t)})}if(r.success){this.stats.learningOutcomes++,e.success&&this.stats.successfulOutcomes++,w().then(o=>o.append("PATTERN_UPDATE",{patternId:e.patternId,success:e.success},"reasoning-bank")).catch(o=>{g.warn("Witness chain PATTERN_UPDATE failed",{error:f(o)})});let t=await this.getPattern(e.patternId),i=this.getPromotionDeps();t&&await se(t,i)&&(await ce(e.patternId,i),g.info("Pattern promoted to long-term",{name:t.name}))}return r}getPromotionDeps(){return{patternStore:this.patternStore,coherenceService:this.coherenceService,eventBus:this.eventBus,coherenceThreshold:this.config.coherenceThreshold||.4,getSqliteStore:this.getSqliteStore.bind(this),rvfDualWriter:this.rvfDualWriter,searchPatterns:this.searchPatterns.bind(this),getPattern:this.getPattern.bind(this)}}async routeTask(e){if(this.initialized||await this.initialize(),!this.config.enableRouting)return x(new Error("Task routing is disabled"));this.stats.routingRequests++;try{let r=e.domain?[e.domain]:k(e.task);r.length===0&&r.push("test-generation");let t=await this.embed(e.task),i=await this.patternStore.search(t,{limit:this.config.maxRoutingCandidates,domain:r[0],useVectorSearch:!0}),o=i.success?i.value.map(p=>p.pattern):[],s=new Map;for(let[p,v]of Object.entries(R)){let P=o.filter(ue=>v.domains.includes(ue.qeDomain)).length;P>0&&s.set(p,P)}let a=ne({taskType:re(e.task),priority:"normal",domain:r[0]}),c=this.buildQValueLookup(a),u=N(r,e.capabilities,s,this.config.routingWeights,R,e.context?.language,c),l=1;try{let p=ie(),v=ee({envOverride:process.env.AQE_ROUTER_EXPLORATION_RATE,topologyCritical:p});l=v.safetyMultiplier,te(u,v.epsilon)}catch{}let d=u[0],m=u.slice(1,4),y=[];if(this.config.enableGuidance&&r.length>0){let p=D(r[0],{framework:e.context?.framework,language:e.context?.language,includeAntiPatterns:!0});y.push(...p.slice(0,5))}this.stats.totalRoutingConfidence+=d.score;let b=u.reduce((p,v)=>p+(v.qWeight??0),0),S=u.length>0?b/u.length:0,h={recommendedAgent:d.agent,confidence:d.score,alternatives:m.map(p=>({agent:p.agent,score:p.score})),domains:r,patterns:o,guidance:y,reasoning:d.reasoning.join("; "),exploration:d.exploration===!0,criticality:l,qWeight:S};return q(h)}catch(r){return x(L(r))}}buildQValueLookup(e){try{let r=B();if(!r.isInitialized())return()=>{};let t=r.getDatabase();if(!t.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='rl_q_values'").get())return()=>{};let o=t.prepare(`
314
+ `);for(let u of a)c.run(u.source_pattern_id,u.target_pattern_id).changes>0&&e++;return e}getEdgeCount(){return this.ensureSchema(),this.db.prepare("SELECT COUNT(*) as cnt FROM pattern_citations").get().cnt}};var f=A.create("QEReasoningBank"),L=class{constructor(e,r,t={},i){this.memory=e;this.eventBus=r;this.coherenceService=i;this.config={...N,...t},t.rvfDualWriter&&(this.rvfDualWriter=t.rvfDualWriter),this.patternStore=X(e,{embeddingDimension:this.config.embeddingDimension,...t.patternStore})}memory;eventBus;coherenceService;config;patternStore;initialized=!1;sqliteStore=null;rvfDualWriter=null;getSqliteStore(){return this.sqliteStore||(this.sqliteStore=H(),this.sqliteStore.initialize().catch(e=>{f.warn("SQLitePatternStore init failed",{error:h(e)})})),this.sqliteStore}setRvfDualWriter(e){this.rvfDualWriter=e}stats={routingRequests:0,totalRoutingConfidence:0,learningOutcomes:0,successfulOutcomes:0};async initialize(e){if(this.initialized)return;let r=e?.signal;r?.throwIfAborted(),await this.patternStore.initialize(),r?.throwIfAborted();try{let t=this.getSqliteStore();await t.initialize(),this.patternStore.setSqliteStore?.(t)}catch(t){f.warn("Failed to wire SQLitePatternStore into PatternStore",{error:h(t)})}r?.throwIfAborted(),await this.loadPretrainedPatterns(r),r?.throwIfAborted(),this.initialized=!0;try{let t="reasoning-bank:cross-domain-seeded";if(!await this.memory.get(t))await this.memory.set(t,!0),await this.seedCrossDomainPatterns(r);else{let o=await this.patternStore.getStats();f.info("Cross-domain transfer already complete",{totalPatterns:o.totalPatterns})}}catch(t){if(r?.aborted)throw t;f.warn("Cross-domain seeding failed (non-fatal)",{error:t})}f.info("Initialized")}async loadPretrainedPatterns(e){e?.throwIfAborted();let r=await this.patternStore.getStats();if(r.totalPatterns>0){f.info("Found existing patterns",{totalPatterns:r.totalPatterns});let t=this.patternStore.getAdapter?.();if(t&&(t.status()?.totalVectors??0)===0)try{let i=(()=>{let a=process.env.AQE_RVF_BACKFILL_LIMIT,c=a?Number(a):NaN;return Number.isFinite(c)&&c>0?Math.floor(c):1e3})(),s=this.getSqliteStore().getRecentEmbeddings(i).filter(({embedding:a})=>a&&a.length>0).map(({patternId:a,embedding:c})=>({id:a,vector:c instanceof Float32Array?c:new Float32Array(c)}));if(s.length>0){let{accepted:a,rejected:c}=t.ingest(s);f.info("Backfilled RVF from SQLite",{requested:s.length,accepted:a,cap:i,truncated:s.length>=i}),c>0&&f.warn("RVF backfill partially rejected",{accepted:a,rejected:c})}}catch(i){f.warn("RVF backfill failed (non-fatal)",{error:h(i)})}return}for(let t of q){e?.throwIfAborted();try{await this.storePattern(t)}catch(i){if(e?.aborted)throw i;f.warn("Failed to load pattern",{name:t.name,error:i})}}f.info("Loaded foundational patterns",{count:q.length})}async seedCrossDomainPatterns(e){return this.initialized||await this.initialize({signal:e}),ue({searchPatterns:this.searchPatterns.bind(this),storePattern:this.storePattern.bind(this),patternStore:this.patternStore,signal:e})}async storePattern(e){if(this.initialized||await this.initialize(),!this.config.enableLearning)return T(new Error("Pattern learning is disabled"));if(!e.embedding){let t=await this.embed(`${e.name} ${e.description} ${e.context?.tags?.join(" ")||""}`);e={...e,embedding:t}}let r=await this.patternStore.create(e);if(r.success&&(R().then(t=>t.append("PATTERN_CREATE",{patternId:r.value.id,domain:r.value.qeDomain,confidence:r.value.confidence,name:r.value.name},"reasoning-bank")).catch(t=>{f.warn("Witness chain PATTERN_CREATE failed",{error:h(t)})}),this.rvfDualWriter&&r.value.embedding&&r.value.embedding.length>0))try{this.rvfDualWriter.writePattern(r.value.id,r.value.embedding)}catch(t){f.warn("RVF dual-write failed (non-fatal)",{patternId:r.value.id,error:h(t)})}return r}async searchPatterns(e,r){this.initialized||await this.initialize();let t=e,i=!0;return typeof e=="string"&&(e.trim()===""?(i=!1,t=""):t=await this.embed(e)),this.patternStore.search(t,{...r,useVectorSearch:i})}async getPattern(e){return this.initialized||await this.initialize(),this.patternStore.get(e)}async recordOutcome(e){if(this.initialized||await this.initialize(),!this.config.enableLearning)return k(void 0);let r=await this.patternStore.recordUsage(e.patternId,e.success);try{this.getSqliteStore().recordUsage(e.patternId,e.success,e.metrics,e.feedback)}catch(t){f.warn("SQLite pattern usage persist failed",{error:h(t)})}if(r.success){this.stats.learningOutcomes++,e.success&&this.stats.successfulOutcomes++,R().then(o=>o.append("PATTERN_UPDATE",{patternId:e.patternId,success:e.success},"reasoning-bank")).catch(o=>{f.warn("Witness chain PATTERN_UPDATE failed",{error:h(o)})});let t=await this.getPattern(e.patternId),i=this.getPromotionDeps();t&&await ce(t,i)&&(await le(e.patternId,i),f.info("Pattern promoted to long-term",{name:t.name}))}return r}getPromotionDeps(){return{patternStore:this.patternStore,coherenceService:this.coherenceService,eventBus:this.eventBus,coherenceThreshold:this.config.coherenceThreshold||.4,getSqliteStore:this.getSqliteStore.bind(this),rvfDualWriter:this.rvfDualWriter,searchPatterns:this.searchPatterns.bind(this),getPattern:this.getPattern.bind(this)}}async routeTask(e){if(this.initialized||await this.initialize(),!this.config.enableRouting)return T(new Error("Task routing is disabled"));this.stats.routingRequests++;try{let r=e.domain?[e.domain]:C(e.task);r.length===0&&r.push("test-generation");let t=await this.embed(e.task),i=await this.patternStore.search(t,{limit:this.config.maxRoutingCandidates,domain:r[0],useVectorSearch:!0}),o=i.success?i.value.map(d=>d.pattern):[],s=new Map;for(let[d,g]of Object.entries(x)){let w=o.filter(P=>g.domains.includes(P.qeDomain)).length;w>0&&s.set(d,w)}let a=ie({taskType:ne(e.task),priority:"normal",domain:r[0]}),c=this.buildQValueLookup(a),u=Q(r,e.capabilities,s,this.config.routingWeights,x,e.context?.language,c),l=1;try{let d=ae(),g=te({envOverride:process.env.AQE_ROUTER_EXPLORATION_RATE,topologyCritical:d});l=g.safetyMultiplier,re(u,g.epsilon)}catch{}let p=u[0],m=u.slice(1,4),y=[];if(this.config.enableGuidance&&r.length>0){let d=_(r[0],{framework:e.context?.framework,language:e.context?.language,includeAntiPatterns:!0});y.push(...d.slice(0,5))}this.stats.totalRoutingConfidence+=p.score;let b=u.reduce((d,g)=>d+(g.qWeight??0),0),E=u.length>0?b/u.length:0,S={recommendedAgent:p.agent,confidence:p.score,alternatives:m.map(d=>({agent:d.agent,score:d.score})),domains:r,patterns:o,guidance:y,reasoning:p.reasoning.join("; "),exploration:p.exploration===!0,criticality:l,qWeight:E};return k(S)}catch(r){return T(V(r))}}buildQValueLookup(e){try{let r=j();if(!r.isInitialized())return()=>{};let t=r.getDatabase();if(!t.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='rl_q_values'").get())return()=>{};let o=t.prepare(`
315
315
  SELECT q_value, visits FROM rl_q_values
316
316
  WHERE algorithm = 'q-learning'
317
317
  AND agent_id = 'aqe-hook-router'
318
318
  AND state_key = ?
319
319
  AND action_key = ?
320
- `);return s=>{try{let a=o.get(e,s);return a?{qValue:a.q_value,visits:a.visits}:void 0}catch{return}}}catch{return()=>{}}}getGuidance(e,r){return C(e)}generateContext(e,r){return _(e,r||{})}checkAntiPatterns(e,r){return U(e,r)}async embed(e){if(this.config.useONNXEmbeddings)try{let{computeRealEmbedding:r}=await import("./real-embeddings-COBP2LHS.js"),t=await r(e);return t.length!==this.config.embeddingDimension?ae(t,this.config.embeddingDimension):t}catch(r){let{isUsingEndpoint:t}=await import("./real-embeddings-COBP2LHS.js");if(t())throw r;process.env.DEBUG&&g.warn("ONNX embeddings unavailable, using hash fallback",{error:f(r)})}return oe(e,this.config.embeddingDimension)}async getStats(){this.initialized||await this.initialize();let e=await this.patternStore.getStats(),r={};for(let a of G)r[a]=e.byDomain[a]||0;let t=this.stats.routingRequests,i=this.stats.routingRequests>0?this.stats.totalRoutingConfidence/this.stats.routingRequests:0,o=this.stats.learningOutcomes,s=this.stats.learningOutcomes>0?this.stats.successfulOutcomes/this.stats.learningOutcomes:0;if(t===0||o===0)try{let a=this.getSqliteStore().getAggregateOutcomeStats();t===0&&a.routingRequests>0&&(t=a.routingRequests,i=a.avgRoutingConfidence),o===0&&a.learningOutcomes>0&&(o=a.learningOutcomes,s=a.learningOutcomes>0?a.successfulOutcomes/a.learningOutcomes:a.avgPatternSuccessRate)}catch{}return{totalPatterns:e.totalPatterns,byDomain:r,routingRequests:t,avgRoutingConfidence:i,learningOutcomes:o,patternSuccessRate:s,patternStoreStats:e}}async dispose(){if(await this.patternStore.dispose(),this.sqliteStore&&(this.sqliteStore.close(),this.sqliteStore=null),this.rvfDualWriter){try{this.rvfDualWriter.close()}catch{}this.rvfDualWriter=null}this.initialized=!1}};function gt(n,e,r,t){return new F(n,e,r,t)}export{I as a,A as b,R as c,re as d,N as e,Q as f,F as g,gt as h};
320
+ `);return s=>{try{let a=o.get(e,s);return a?{qValue:a.q_value,visits:a.visits}:void 0}catch{return}}}catch{return()=>{}}}getGuidance(e,r){return D(e)}generateContext(e,r){return I(e,r||{})}checkAntiPatterns(e,r){return $(e,r)}async embed(e){if(this.config.useONNXEmbeddings)try{let{computeRealEmbedding:r}=await import("./real-embeddings-YPUHWRN2.js"),t=await r(e);return t.length!==this.config.embeddingDimension?oe(t,this.config.embeddingDimension):t}catch(r){let{isUsingEndpoint:t}=await import("./real-embeddings-YPUHWRN2.js");if(t())throw r;process.env.DEBUG&&f.warn("ONNX embeddings unavailable, using hash fallback",{error:h(r)})}return se(e,this.config.embeddingDimension)}async getStats(){this.initialized||await this.initialize();let e=await this.patternStore.getStats(),r={};for(let a of U)r[a]=e.byDomain[a]||0;let t=this.stats.routingRequests,i=this.stats.routingRequests>0?this.stats.totalRoutingConfidence/this.stats.routingRequests:0,o=this.stats.learningOutcomes,s=this.stats.learningOutcomes>0?this.stats.successfulOutcomes/this.stats.learningOutcomes:0;if(t===0||o===0)try{let a=this.getSqliteStore().getAggregateOutcomeStats();t===0&&a.routingRequests>0&&(t=a.routingRequests,i=a.avgRoutingConfidence),o===0&&a.learningOutcomes>0&&(o=a.learningOutcomes,s=a.learningOutcomes>0?a.successfulOutcomes/a.learningOutcomes:a.avgPatternSuccessRate)}catch{}return{totalPatterns:e.totalPatterns,byDomain:r,routingRequests:t,avgRoutingConfidence:i,learningOutcomes:o,patternSuccessRate:s,patternStoreStats:e}}async dispose(){if(await this.patternStore.dispose(),this.sqliteStore&&(this.sqliteStore.close(),this.sqliteStore=null),this.rvfDualWriter){try{this.rvfDualWriter.close()}catch{}this.rvfDualWriter=null}this.initialized=!1}};function ft(n,e,r,t){return new L(n,e,r,t)}export{N as a,q as b,x as c,ne as d,Q as e,M as f,L as g,ft as h};
@@ -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.10.1");process.exit(0)}
2
- import{b as d,d as c}from"./chunk-QNW335PD.js";import{a as l,c as g}from"./chunk-2TDWCXZ6.js";g();c();import{existsSync as y,readFileSync as p}from"node:fs";import{join as o,dirname as u}from"node:path";import{fileURLToPath as m}from"node:url";var i=class extends Error{constructor(t,n,r){super(t);this.code=n;this.cause=r;this.name="PatternLoaderError"}code;cause},s=class a{static instance=null;config;patterns;isLoading=!1;constructor(e={}){this.config={basePath:e.basePath??this.getDefaultBasePath(),throwOnMissing:e.throwOnMissing??!1,validatePatterns:e.validatePatterns??!0},this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]}}static getInstance(e){return a.instance||(a.instance=new a(e)),a.instance}static resetInstance(){a.instance=null}getDefaultBasePath(){try{let e=import.meta.url,t=m(e),n=u(t),r=o(n,"..","..","..");return o(r,"assets","patterns")}catch{return o(process.cwd(),"assets","patterns")}}async loadPatterns(){if(!this.isLoading){this.isLoading=!0,this.patterns.errors=[];try{this.patterns.index=this.loadJsonFile("index.json");let[e,t,n,r]=await Promise.all([Promise.resolve(this.loadJsonFile("adr-051-booster-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-router-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-embedding-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-reasoning-patterns.json"))]);this.patterns.booster=e,this.patterns.router=t,this.patterns.embedding=n,this.patterns.reasoning=r,this.patterns.loadedAt=new Date,this.config.validatePatterns&&this.validateLoadedPatterns()}finally{this.isLoading=!1}}}loadJsonFile(e){let t=o(this.config.basePath,e);try{if(!y(t)){let r=`Pattern file not found: ${t}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"FILE_NOT_FOUND");return null}let n=p(t,"utf-8");return d(n)}catch(n){if(n instanceof i)throw n;let r=`Failed to load pattern file ${e}: ${l(n)}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"PARSE_ERROR",n instanceof Error?n:void 0);return null}}validateLoadedPatterns(){this.patterns.booster&&(Array.isArray(this.patterns.booster.patterns)||this.patterns.errors.push("Booster patterns file missing patterns array")),this.patterns.router&&(Array.isArray(this.patterns.router.patterns)||this.patterns.errors.push("Router patterns file missing patterns array")),this.patterns.embedding&&(Array.isArray(this.patterns.embedding.patterns)||this.patterns.errors.push("Embedding patterns file missing patterns array")),this.patterns.reasoning&&(Array.isArray(this.patterns.reasoning.patterns)||this.patterns.errors.push("Reasoning patterns file missing patterns array"))}async ensureLoaded(){this.patterns.loadedAt||await this.loadPatterns()}async getIndex(){return await this.ensureLoaded(),this.patterns.index}async getBoosterPatterns(){return await this.ensureLoaded(),this.patterns.booster}async getRouterPatterns(){return await this.ensureLoaded(),this.patterns.router}async getEmbeddingPatterns(){return await this.ensureLoaded(),this.patterns.embedding}async getReasoningPatterns(){return await this.ensureLoaded(),this.patterns.reasoning}async getBoosterPatternByKey(e){let t=await this.getBoosterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getRouterPatternByKey(e){let t=await this.getRouterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEmbeddingPatternByKey(e){let t=await this.getEmbeddingPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getReasoningPatternByKey(e){let t=await this.getReasoningPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEligibleBoosterTransforms(){let e=await this.getBoosterPatternByKey("booster-transform-eligibility");return e?e.eligibility_criteria.simple_transforms:[]}async getTierHierarchy(){let e=await this.getRouterPatternByKey("router-5tier-complexity");return e?e.tier_hierarchy:null}async getQualityGateThresholds(){let e=await this.getReasoningPatternByKey("reasoning-pattern-quality-gates");return e?e.gate_thresholds:null}isLoaded(){return this.patterns.loadedAt!==null}getLoadedAt(){return this.patterns.loadedAt}getErrors(){return[...this.patterns.errors]}async getStatistics(){let e=await this.getIndex();return e?e.pattern_statistics:null}async reload(){this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]},await this.loadPatterns()}async getAllPatterns(){return await this.ensureLoaded(),{...this.patterns}}};function x(){return s.getInstance()}export{x 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.10.2");process.exit(0)}
2
+ import{b as d,d as c}from"./chunk-SW4OKUTC.js";import{a as l,c as g}from"./chunk-XPCNUX2U.js";g();c();import{existsSync as y,readFileSync as p}from"node:fs";import{join as o,dirname as u}from"node:path";import{fileURLToPath as m}from"node:url";var i=class extends Error{constructor(t,n,r){super(t);this.code=n;this.cause=r;this.name="PatternLoaderError"}code;cause},s=class a{static instance=null;config;patterns;isLoading=!1;constructor(e={}){this.config={basePath:e.basePath??this.getDefaultBasePath(),throwOnMissing:e.throwOnMissing??!1,validatePatterns:e.validatePatterns??!0},this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]}}static getInstance(e){return a.instance||(a.instance=new a(e)),a.instance}static resetInstance(){a.instance=null}getDefaultBasePath(){try{let e=import.meta.url,t=m(e),n=u(t),r=o(n,"..","..","..");return o(r,"assets","patterns")}catch{return o(process.cwd(),"assets","patterns")}}async loadPatterns(){if(!this.isLoading){this.isLoading=!0,this.patterns.errors=[];try{this.patterns.index=this.loadJsonFile("index.json");let[e,t,n,r]=await Promise.all([Promise.resolve(this.loadJsonFile("adr-051-booster-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-router-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-embedding-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-reasoning-patterns.json"))]);this.patterns.booster=e,this.patterns.router=t,this.patterns.embedding=n,this.patterns.reasoning=r,this.patterns.loadedAt=new Date,this.config.validatePatterns&&this.validateLoadedPatterns()}finally{this.isLoading=!1}}}loadJsonFile(e){let t=o(this.config.basePath,e);try{if(!y(t)){let r=`Pattern file not found: ${t}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"FILE_NOT_FOUND");return null}let n=p(t,"utf-8");return d(n)}catch(n){if(n instanceof i)throw n;let r=`Failed to load pattern file ${e}: ${l(n)}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"PARSE_ERROR",n instanceof Error?n:void 0);return null}}validateLoadedPatterns(){this.patterns.booster&&(Array.isArray(this.patterns.booster.patterns)||this.patterns.errors.push("Booster patterns file missing patterns array")),this.patterns.router&&(Array.isArray(this.patterns.router.patterns)||this.patterns.errors.push("Router patterns file missing patterns array")),this.patterns.embedding&&(Array.isArray(this.patterns.embedding.patterns)||this.patterns.errors.push("Embedding patterns file missing patterns array")),this.patterns.reasoning&&(Array.isArray(this.patterns.reasoning.patterns)||this.patterns.errors.push("Reasoning patterns file missing patterns array"))}async ensureLoaded(){this.patterns.loadedAt||await this.loadPatterns()}async getIndex(){return await this.ensureLoaded(),this.patterns.index}async getBoosterPatterns(){return await this.ensureLoaded(),this.patterns.booster}async getRouterPatterns(){return await this.ensureLoaded(),this.patterns.router}async getEmbeddingPatterns(){return await this.ensureLoaded(),this.patterns.embedding}async getReasoningPatterns(){return await this.ensureLoaded(),this.patterns.reasoning}async getBoosterPatternByKey(e){let t=await this.getBoosterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getRouterPatternByKey(e){let t=await this.getRouterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEmbeddingPatternByKey(e){let t=await this.getEmbeddingPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getReasoningPatternByKey(e){let t=await this.getReasoningPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEligibleBoosterTransforms(){let e=await this.getBoosterPatternByKey("booster-transform-eligibility");return e?e.eligibility_criteria.simple_transforms:[]}async getTierHierarchy(){let e=await this.getRouterPatternByKey("router-5tier-complexity");return e?e.tier_hierarchy:null}async getQualityGateThresholds(){let e=await this.getReasoningPatternByKey("reasoning-pattern-quality-gates");return e?e.gate_thresholds:null}isLoaded(){return this.patterns.loadedAt!==null}getLoadedAt(){return this.patterns.loadedAt}getErrors(){return[...this.patterns.errors]}async getStatistics(){let e=await this.getIndex();return e?e.pattern_statistics:null}async reload(){this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]},await this.loadPatterns()}async getAllPatterns(){return await this.ensureLoaded(),{...this.patterns}}};function x(){return s.getInstance()}export{x 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.10.1");process.exit(0)}
2
- import{c as t,e as o}from"./chunk-4AWJ5PE4.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.10.2");process.exit(0)}
2
+ import{c as t,e as o}from"./chunk-ORF2UKQH.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.10.1");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.10.2");process.exit(0)}
2
2
  function c(r,e,o){let n=new Error(r);return n.name="LLMError",n.code=e,n.provider=o?.provider,n.model=o?.model,n.retryable=o?.retryable??!1,n.retryAfterMs=o?.retryAfterMs,n.cause=o?.cause,n}function p(r){return r instanceof Error&&"code"in r&&typeof r.code=="string"}var a={"claude-sonnet-4-5":{canonical:"Claude Sonnet 4.5",family:"claude",tier:"standard",providers:{anthropic:"claude-sonnet-4-5-20250929",openrouter:"anthropic/claude-sonnet-4.5",bedrock:"anthropic.claude-sonnet-4-5-v2:0"}},"claude-opus-4":{canonical:"Claude Opus 4",family:"claude",tier:"flagship",providers:{anthropic:"claude-opus-4-20250514",openrouter:"anthropic/claude-opus-4",bedrock:"anthropic.claude-opus-4-v1:0"}},"claude-opus-4-5":{canonical:"Claude Opus 4.5",family:"claude",tier:"flagship",providers:{anthropic:"claude-opus-4-5-20251101",openrouter:"anthropic/claude-opus-4.5",bedrock:"anthropic.claude-opus-4-5-v1:0"}},"claude-haiku-3-5":{canonical:"Claude Haiku 3.5",family:"claude",tier:"economy",providers:{anthropic:"claude-3-5-haiku-20241022",openrouter:"anthropic/claude-3.5-haiku",bedrock:"anthropic.claude-3-5-haiku-v1:0"}},"claude-sonnet-4":{canonical:"Claude Sonnet 4",family:"claude",tier:"standard",providers:{anthropic:"claude-sonnet-4-20250514",openrouter:"anthropic/claude-sonnet-4",bedrock:"anthropic.claude-sonnet-4-v1:0"}},"claude-opus-4-7":{canonical:"Claude Opus 4.7",family:"claude",tier:"flagship",providers:{anthropic:"claude-opus-4-7",openrouter:"anthropic/claude-opus-4.7",bedrock:"anthropic.claude-opus-4-7-v1:0"}},"claude-sonnet-4-6":{canonical:"Claude Sonnet 4.6",family:"claude",tier:"standard",providers:{anthropic:"claude-sonnet-4-6",openrouter:"anthropic/claude-sonnet-4.6",bedrock:"anthropic.claude-sonnet-4-6-v1:0"}},"claude-haiku-4-5":{canonical:"Claude Haiku 4.5",family:"claude",tier:"economy",providers:{anthropic:"claude-haiku-4-5-20251001",openrouter:"anthropic/claude-haiku-4.5",bedrock:"anthropic.claude-haiku-4-5-v1:0"}},"gpt-4o":{canonical:"GPT-4o",family:"gpt",tier:"standard",providers:{openai:"gpt-4o",azure:"gpt-4o",openrouter:"openai/gpt-4o"}},"gpt-4o-mini":{canonical:"GPT-4o Mini",family:"gpt",tier:"economy",providers:{openai:"gpt-4o-mini",azure:"gpt-4o-mini",openrouter:"openai/gpt-4o-mini"}},"gpt-4-turbo":{canonical:"GPT-4 Turbo",family:"gpt",tier:"premium",providers:{openai:"gpt-4-turbo",azure:"gpt-4-turbo",openrouter:"openai/gpt-4-turbo"}},"gpt-4":{canonical:"GPT-4",family:"gpt",tier:"premium",providers:{openai:"gpt-4",azure:"gpt-4",openrouter:"openai/gpt-4"}},o1:{canonical:"OpenAI o1",family:"gpt",tier:"flagship",providers:{openai:"o1",azure:"o1",openrouter:"openai/o1"}},"o1-mini":{canonical:"OpenAI o1 Mini",family:"gpt",tier:"standard",providers:{openai:"o1-mini",azure:"o1-mini",openrouter:"openai/o1-mini"}},"gemini-pro":{canonical:"Gemini Pro",family:"gemini",tier:"standard",providers:{gemini:"gemini-pro",openrouter:"google/gemini-pro"}},"gemini-pro-1.5":{canonical:"Gemini Pro 1.5",family:"gemini",tier:"standard",providers:{gemini:"gemini-1.5-pro",openrouter:"google/gemini-pro-1.5"}},"gemini-flash-1.5":{canonical:"Gemini Flash 1.5",family:"gemini",tier:"economy",providers:{gemini:"gemini-1.5-flash",openrouter:"google/gemini-flash-1.5"}},"gemini-ultra":{canonical:"Gemini Ultra",family:"gemini",tier:"flagship",providers:{gemini:"gemini-ultra",openrouter:"google/gemini-ultra"}},llama3:{canonical:"Llama 3",family:"llama",tier:"economy",providers:{ollama:"llama3",openrouter:"meta-llama/llama-3-8b-instruct"}},"llama3.1":{canonical:"Llama 3.1",family:"llama",tier:"economy",providers:{ollama:"llama3.1",openrouter:"meta-llama/llama-3.1-8b-instruct"}},codellama:{canonical:"CodeLlama",family:"llama",tier:"economy",providers:{ollama:"codellama",openrouter:"meta-llama/codellama-34b-instruct"}},mistral:{canonical:"Mistral",family:"mistral",tier:"economy",providers:{ollama:"mistral",openrouter:"mistralai/mistral-7b-instruct"}},mixtral:{canonical:"Mixtral",family:"mistral",tier:"standard",providers:{ollama:"mixtral",openrouter:"mistralai/mixtral-8x7b-instruct"}},phi3:{canonical:"Phi-3",family:"phi",tier:"economy",providers:{ollama:"phi3",azure:"phi-3-mini-128k-instruct"}},qwen2:{canonical:"Qwen 2",family:"qwen",tier:"economy",providers:{ollama:"qwen2",openrouter:"qwen/qwen-2-7b-instruct"}}};function l(){let r=new Map;for(let[e,o]of Object.entries(a)){r.set(e,e),r.set(e.toLowerCase(),e);for(let[n,t]of Object.entries(o.providers))t&&(r.set(t,e),r.set(t.toLowerCase(),e),r.set(`${n}/${t}`,e),r.set(`${n}/${t}`.toLowerCase(),e))}return r}var i=l();function m(r,e){let o=s(r),n=a[o];if(!n)throw new Error(`Unknown model: ${r}`);let t=n.providers[e];if(!t)throw new Error(`Model '${o}' (${n.canonical}) is not available on provider '${e}'`);return t}function s(r){let e=i.get(r);if(e||(e=i.get(r.toLowerCase()),e))return e;let o=[/^anthropic\//i,/^openai\//i,/^google\//i,/^meta-llama\//i,/^mistralai\//i,/^qwen\//i];for(let n of o){let t=r.replace(n,"");if(e=i.get(t),e||(e=i.get(t.toLowerCase()),e))return e}throw new Error(`Unknown model ID: ${r}`)}function d(r){try{let e=s(r);return a[e]}catch{return}}export{c as a,p as b,m as c,s as d,d 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.10.1");process.exit(0)}
2
- import{b as A,d as M}from"./chunk-QNW335PD.js";import{a as S,b as D}from"./chunk-KRXKU54J.js";import{S as Q,l as E}from"./chunk-ELZ67OHQ.js";import{g as C}from"./chunk-4AWJ5PE4.js";M();Q();var v=(1+Math.sqrt(5))/2,R=1/v;function k(t,e=0){if(t<0||!Number.isFinite(t))throw new Error(`Invalid dither sequence length: ${t}`);if(!Number.isFinite(e))throw new Error(`Invalid dither seed: ${e}`);let n=new Float32Array(t),r=(e*R%1+1)%1;for(let i=0;i<t;i++)n[i]=((r+(i+1)*v)%1+1)%1;return n}function I(t,e,n=0){if(!(t instanceof Float32Array))throw new Error("Input vector must be a Float32Array");if(t.length===0)return{quantized:new Int32Array(0),dequantized:new Float32Array(0),bitDepth:e,seed:n,stepSize:0,minValue:0,maxValue:0};if(e<1||e>32||!Number.isInteger(e))throw new Error(`Invalid bit depth: ${e}. Must be an integer in [1, 32].`);let r=t[0],i=t[0];for(let d=1;d<t.length;d++)t[d]<r&&(r=t[d]),t[d]>i&&(i=t[d]);let s=(1<<e)-1,a=i-r,o=a===0?1:a/s,m=k(t.length,n),l=new Int32Array(t.length),u=new Float32Array(t.length);for(let d=0;d<t.length;d++){if(a===0)l[d]=Math.round(s/2);else{let L=(t[d]-r)/o+(m[d]-.5);l[d]=Math.max(0,Math.min(s,Math.round(L)))}u[d]=l[d]*o+r}return{quantized:l,dequantized:u,bitDepth:e,seed:n,stepSize:o,minValue:r,maxValue:i}}var h=null,b=null,p=null,g=null,f=null,w=null,x=!1;try{let t=(D(),C(S));h=t.RuvectorLayer,b=t.TensorCompress,p=t.differentiableSearch,g=t.hierarchicalForward,f=t.getCompressionLevel,w=t.init,x=!0}catch{}function H(){return x}function c(){if(!x)throw new Error("@ruvector/gnn native module is not available on this platform. Install the appropriate optional dependency for your platform, or use a platform where pre-built binaries are available.")}var F=!1;function V(){if(!F){c();let t=w();return F=!0,t}return"@ruvector/gnn already initialized"}var y=class{indexes;config;nextId;gnnLayers;compressor;constructor(e={}){this.config={M:e.M||16,efConstruction:e.efConstruction||200,efSearch:e.efSearch||50,dimension:e.dimension||384,metric:e.metric||"cosine",quantization:e.quantization||"none"},this.indexes=new Map,this.nextId=new Map,this.gnnLayers=new Map,c(),this.compressor=new b,V()}initializeIndex(e){this.indexes.has(e)||(this.indexes.set(e,new Map),this.nextId.set(e,0))}addEmbedding(e,n){let r=e.namespace;this.indexes.has(r)||this.initializeIndex(r);let i=this.indexes.get(r),s=n??this.nextId.get(r);return n===void 0&&this.nextId.set(r,s+1),i.set(s,e),s}addEmbeddingsBatch(e){let n=[];for(let r of e){let i=this.addEmbedding(r.embedding,r.id);n.push(i)}return n}search(e,n={}){let r=n.namespace||e.namespace;if(!this.indexes.has(r))return[];let i=this.indexes.get(r),s=n.limit||10,a=[];for(let[u,d]of i.entries())a.push({id:u,vector:Array.from(d.vector)});if(a.length===0)return[];let o=new Float32Array(e.vector),m=a.map(u=>new Float32Array(u.vector)),l=p(o,m,Math.min(s,a.length),1);return l.indices.map((u,d)=>({id:a[u]?.id??u,distance:1-l.weights[d]}))}differentiableSearchWithWeights(e,n,r,i=1){let s=new Float32Array(e.vector),a=n.map(m=>new Float32Array(m.embedding.vector)),o=p(s,a,Math.min(r,n.length),i);return{indices:o.indices.map(m=>n[m]?.id??m),weights:o.weights}}hierarchicalForward(e,n,r){let i=r.map(l=>`${l.inputDim}-${l.hiddenDim}`).join(",");if(!this.gnnLayers.has(i)){let l=[];for(let u of r){let d=new h(u.inputDim,u.hiddenDim,u.heads,u.dropout);l.push(d)}this.gnnLayers.set(i,l[0])}let a=this.gnnLayers.get(i).toJson(),o=new Float32Array(e),m=n.map(l=>l.map(u=>new Float32Array(u)));return Array.from(g(o,m,[a]))}compressEmbedding(e,n){let r=f(n),s={none:"none",half:"half",pq8:"pq8",pq4:"pq4",binary:"binary"}[r]??"none",a=new Float32Array(e.vector),o=this.compressor.compress(a,n);return{dimension:Array.from(e.vector).length,level:s,data:o,accessFreq:n}}decompressEmbedding(e){let n=this.compressor.decompress(e.data),r={none:"none",half:"fp16",pq8:"int8",pq4:"int8",binary:"binary"};return{vector:n,dimension:e.dimension,namespace:"code",text:"",timestamp:Date.now(),quantization:r[e.level]??"none"}}getCompressionLevelForFrequency(e){return c(),f(e)}getIndexStats(e){return this.indexes.has(e)?{size:this.indexes.get(e).size,maxElements:1e4,dimension:this.config.dimension,metric:this.config.metric}:null}clearIndex(e){this.indexes.delete(e),this.nextId.delete(e)}clearAll(){this.indexes.clear(),this.nextId.clear()}resizeIndex(e){}setEfSearch(e){this.config.efSearch=e}getConfig(){return{...this.config}}isInitialized(e){return this.indexes.has(e)}getInitializedNamespaces(){return Array.from(this.indexes.keys())}getSize(e){return this.indexes.get(e)?.size??0}async saveIndex(e,n){let r=this.indexes.get(e);if(!r)throw new Error(`Namespace ${e} not initialized`);let i=Array.from(r.entries()).map(([a,o])=>({id:a,vector:Array.from(o.vector),metadata:o.metadata}));await(await import("fs/promises")).writeFile(n,JSON.stringify(i,null,2))}async loadIndex(e,n){let i=await(await import("fs/promises")).readFile(n,"utf-8"),s=A(i);this.initializeIndex(e);for(let a of s){let o={vector:a.vector,dimension:a.vector.length,namespace:e,text:"",timestamp:Date.now(),quantization:"none",metadata:a.metadata};this.addEmbedding(o,a.id)}}},q=class{static instances=new Map;static getInstance(e,n){return this.instances.has(e)||this.instances.set(e,new y(n)),this.instances.get(e)}static closeInstance(e){let n=this.instances.get(e);n&&(n.clearAll(),this.instances.delete(e))}static closeAll(){for(let e of this.instances.values())e.clearAll();this.instances.clear()}},z=class{static layers=new Map;static getLayer(e){let n=`${e.inputDim}-${e.hiddenDim}-${e.heads}-${e.dropout}`;if(!this.layers.has(n)){c();let r=new h(e.inputDim,e.hiddenDim,e.heads,e.dropout);this.layers.set(n,r)}return this.layers.get(n)}static layerFromJson(e){return c(),h.fromJson(e)}static clearCache(){this.layers.clear()}},N=class{static _compressor=null;static get compressor(){return this._compressor||(c(),this._compressor=new b),this._compressor}static compressWithLevel(e,n){let r={levelType:n,scale:1,subvectors:n==="pq8"?8:n==="pq4"?16:void 0,centroids:n==="pq8"?256:void 0,outlierThreshold:n==="pq4"?3:void 0,threshold:n==="binary"?0:void 0},i=e instanceof Float32Array?e:new Float32Array(e);return this.compressor.compressWithLevel(i,r)}static decompress(e){return this.compressor.decompress(e)}static getLevel(e){return c(),f(e)}static compressWithDither(e,n,r){let i=e instanceof Float32Array?e:new Float32Array(e),s;if(E()){let o={none:32,half:16,pq8:8,pq4:4,binary:1},m=r?.bitDepth??o[n]??8,l=r?.seed??0;s=I(i,m,l)}return{compressed:this.compressWithLevel(s?s.dequantized:e,n),ditherResult:s}}};function G(){return c(),h}function J(){return c(),b}function O(){return c(),p}function j(){return c(),g}function B(){return c(),f}function K(){return c(),w}function U(t){return t instanceof Float32Array?t:"vector"in t?t.vector instanceof Float32Array?t.vector:new Float32Array(t.vector):new Float32Array(t)}function X(t){return"vector"in t?Array.from(t.vector):Array.from(t)}function Y(t,e="code"){return{vector:t,dimension:t.length,namespace:e,text:"",timestamp:Date.now(),quantization:"none"}}function Z(t,e,n,r=1){let i=[],s=e.map(a=>a instanceof Float32Array?a:new Float32Array(a));for(let a of t){let o=a instanceof Float32Array?a:new Float32Array(a),m=p(o,s,n,r);i.push({indices:m.indices,weights:m.weights})}return i}export{H as a,V as b,y as c,q as d,z as e,N as f,G as g,J as h,O as i,j,B as k,K as l,U as m,X as n,Y as o,Z as p};
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.10.2");process.exit(0)}
2
+ import{b as A,d as M}from"./chunk-SW4OKUTC.js";import{a as S,b as D}from"./chunk-IICTTDAA.js";import{S as Q,l as E}from"./chunk-ON4D4TJ4.js";import{g as C}from"./chunk-ORF2UKQH.js";M();Q();var v=(1+Math.sqrt(5))/2,R=1/v;function k(t,e=0){if(t<0||!Number.isFinite(t))throw new Error(`Invalid dither sequence length: ${t}`);if(!Number.isFinite(e))throw new Error(`Invalid dither seed: ${e}`);let n=new Float32Array(t),r=(e*R%1+1)%1;for(let i=0;i<t;i++)n[i]=((r+(i+1)*v)%1+1)%1;return n}function I(t,e,n=0){if(!(t instanceof Float32Array))throw new Error("Input vector must be a Float32Array");if(t.length===0)return{quantized:new Int32Array(0),dequantized:new Float32Array(0),bitDepth:e,seed:n,stepSize:0,minValue:0,maxValue:0};if(e<1||e>32||!Number.isInteger(e))throw new Error(`Invalid bit depth: ${e}. Must be an integer in [1, 32].`);let r=t[0],i=t[0];for(let d=1;d<t.length;d++)t[d]<r&&(r=t[d]),t[d]>i&&(i=t[d]);let s=(1<<e)-1,a=i-r,o=a===0?1:a/s,m=k(t.length,n),l=new Int32Array(t.length),u=new Float32Array(t.length);for(let d=0;d<t.length;d++){if(a===0)l[d]=Math.round(s/2);else{let L=(t[d]-r)/o+(m[d]-.5);l[d]=Math.max(0,Math.min(s,Math.round(L)))}u[d]=l[d]*o+r}return{quantized:l,dequantized:u,bitDepth:e,seed:n,stepSize:o,minValue:r,maxValue:i}}var h=null,b=null,p=null,g=null,f=null,w=null,x=!1;try{let t=(D(),C(S));h=t.RuvectorLayer,b=t.TensorCompress,p=t.differentiableSearch,g=t.hierarchicalForward,f=t.getCompressionLevel,w=t.init,x=!0}catch{}function H(){return x}function c(){if(!x)throw new Error("@ruvector/gnn native module is not available on this platform. Install the appropriate optional dependency for your platform, or use a platform where pre-built binaries are available.")}var F=!1;function V(){if(!F){c();let t=w();return F=!0,t}return"@ruvector/gnn already initialized"}var y=class{indexes;config;nextId;gnnLayers;compressor;constructor(e={}){this.config={M:e.M||16,efConstruction:e.efConstruction||200,efSearch:e.efSearch||50,dimension:e.dimension||384,metric:e.metric||"cosine",quantization:e.quantization||"none"},this.indexes=new Map,this.nextId=new Map,this.gnnLayers=new Map,c(),this.compressor=new b,V()}initializeIndex(e){this.indexes.has(e)||(this.indexes.set(e,new Map),this.nextId.set(e,0))}addEmbedding(e,n){let r=e.namespace;this.indexes.has(r)||this.initializeIndex(r);let i=this.indexes.get(r),s=n??this.nextId.get(r);return n===void 0&&this.nextId.set(r,s+1),i.set(s,e),s}addEmbeddingsBatch(e){let n=[];for(let r of e){let i=this.addEmbedding(r.embedding,r.id);n.push(i)}return n}search(e,n={}){let r=n.namespace||e.namespace;if(!this.indexes.has(r))return[];let i=this.indexes.get(r),s=n.limit||10,a=[];for(let[u,d]of i.entries())a.push({id:u,vector:Array.from(d.vector)});if(a.length===0)return[];let o=new Float32Array(e.vector),m=a.map(u=>new Float32Array(u.vector)),l=p(o,m,Math.min(s,a.length),1);return l.indices.map((u,d)=>({id:a[u]?.id??u,distance:1-l.weights[d]}))}differentiableSearchWithWeights(e,n,r,i=1){let s=new Float32Array(e.vector),a=n.map(m=>new Float32Array(m.embedding.vector)),o=p(s,a,Math.min(r,n.length),i);return{indices:o.indices.map(m=>n[m]?.id??m),weights:o.weights}}hierarchicalForward(e,n,r){let i=r.map(l=>`${l.inputDim}-${l.hiddenDim}`).join(",");if(!this.gnnLayers.has(i)){let l=[];for(let u of r){let d=new h(u.inputDim,u.hiddenDim,u.heads,u.dropout);l.push(d)}this.gnnLayers.set(i,l[0])}let a=this.gnnLayers.get(i).toJson(),o=new Float32Array(e),m=n.map(l=>l.map(u=>new Float32Array(u)));return Array.from(g(o,m,[a]))}compressEmbedding(e,n){let r=f(n),s={none:"none",half:"half",pq8:"pq8",pq4:"pq4",binary:"binary"}[r]??"none",a=new Float32Array(e.vector),o=this.compressor.compress(a,n);return{dimension:Array.from(e.vector).length,level:s,data:o,accessFreq:n}}decompressEmbedding(e){let n=this.compressor.decompress(e.data),r={none:"none",half:"fp16",pq8:"int8",pq4:"int8",binary:"binary"};return{vector:n,dimension:e.dimension,namespace:"code",text:"",timestamp:Date.now(),quantization:r[e.level]??"none"}}getCompressionLevelForFrequency(e){return c(),f(e)}getIndexStats(e){return this.indexes.has(e)?{size:this.indexes.get(e).size,maxElements:1e4,dimension:this.config.dimension,metric:this.config.metric}:null}clearIndex(e){this.indexes.delete(e),this.nextId.delete(e)}clearAll(){this.indexes.clear(),this.nextId.clear()}resizeIndex(e){}setEfSearch(e){this.config.efSearch=e}getConfig(){return{...this.config}}isInitialized(e){return this.indexes.has(e)}getInitializedNamespaces(){return Array.from(this.indexes.keys())}getSize(e){return this.indexes.get(e)?.size??0}async saveIndex(e,n){let r=this.indexes.get(e);if(!r)throw new Error(`Namespace ${e} not initialized`);let i=Array.from(r.entries()).map(([a,o])=>({id:a,vector:Array.from(o.vector),metadata:o.metadata}));await(await import("fs/promises")).writeFile(n,JSON.stringify(i,null,2))}async loadIndex(e,n){let i=await(await import("fs/promises")).readFile(n,"utf-8"),s=A(i);this.initializeIndex(e);for(let a of s){let o={vector:a.vector,dimension:a.vector.length,namespace:e,text:"",timestamp:Date.now(),quantization:"none",metadata:a.metadata};this.addEmbedding(o,a.id)}}},q=class{static instances=new Map;static getInstance(e,n){return this.instances.has(e)||this.instances.set(e,new y(n)),this.instances.get(e)}static closeInstance(e){let n=this.instances.get(e);n&&(n.clearAll(),this.instances.delete(e))}static closeAll(){for(let e of this.instances.values())e.clearAll();this.instances.clear()}},z=class{static layers=new Map;static getLayer(e){let n=`${e.inputDim}-${e.hiddenDim}-${e.heads}-${e.dropout}`;if(!this.layers.has(n)){c();let r=new h(e.inputDim,e.hiddenDim,e.heads,e.dropout);this.layers.set(n,r)}return this.layers.get(n)}static layerFromJson(e){return c(),h.fromJson(e)}static clearCache(){this.layers.clear()}},N=class{static _compressor=null;static get compressor(){return this._compressor||(c(),this._compressor=new b),this._compressor}static compressWithLevel(e,n){let r={levelType:n,scale:1,subvectors:n==="pq8"?8:n==="pq4"?16:void 0,centroids:n==="pq8"?256:void 0,outlierThreshold:n==="pq4"?3:void 0,threshold:n==="binary"?0:void 0},i=e instanceof Float32Array?e:new Float32Array(e);return this.compressor.compressWithLevel(i,r)}static decompress(e){return this.compressor.decompress(e)}static getLevel(e){return c(),f(e)}static compressWithDither(e,n,r){let i=e instanceof Float32Array?e:new Float32Array(e),s;if(E()){let o={none:32,half:16,pq8:8,pq4:4,binary:1},m=r?.bitDepth??o[n]??8,l=r?.seed??0;s=I(i,m,l)}return{compressed:this.compressWithLevel(s?s.dequantized:e,n),ditherResult:s}}};function G(){return c(),h}function J(){return c(),b}function O(){return c(),p}function j(){return c(),g}function B(){return c(),f}function K(){return c(),w}function U(t){return t instanceof Float32Array?t:"vector"in t?t.vector instanceof Float32Array?t.vector:new Float32Array(t.vector):new Float32Array(t)}function X(t){return"vector"in t?Array.from(t.vector):Array.from(t)}function Y(t,e="code"){return{vector:t,dimension:t.length,namespace:e,text:"",timestamp:Date.now(),quantization:"none"}}function Z(t,e,n,r=1){let i=[],s=e.map(a=>a instanceof Float32Array?a:new Float32Array(a));for(let a of t){let o=a instanceof Float32Array?a:new Float32Array(a),m=p(o,s,n,r);i.push({indices:m.indices,weights:m.weights})}return i}export{H as a,V as b,y as c,q as d,z as e,N as f,G as g,J as h,O as i,j,B as k,K as l,U as m,X as n,Y as o,Z as p};
@@ -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.10.1");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.10.2");process.exit(0)}
2
2
  function M(u){let e=u|0;return()=>{e=e+1831565813|0;let n=Math.imul(e^e>>>15,1|e);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}var A=2,y=10,x=200,p=1e-8,b=class{epsilon;seed;constructor(e){if(this.epsilon=e?.epsilon??.3,this.seed=e?.seed,this.epsilon<=0||this.epsilon>=1)throw new Error("SparsifierConfig.epsilon must be in (0, 1)")}sparsify(e){if(e.nodeCount<=0||e.edges.length===0)return{nodeCount:e.nodeCount,edges:[]};let n=this.seed!==void 0?M(this.seed):Math.random,t=this.approximateEffectiveResistances(e),i=e.nodeCount,r=e.edges.length,o=Math.max(1,Math.log(i)),m=this.epsilon*this.epsilon,l=Math.min(r,Math.max(i-1,A*(i-1)*(1-this.epsilon))),s=new Float64Array(r),c=0;for(let a=0;a<r;a++){let d=e.edges[a][2];s[a]=d*t[a],c+=s[a]}if(c<=0)return{nodeCount:e.nodeCount,edges:[]};let f=[];for(let a=0;a<r;a++){let[d,C,E]=e.edges[a],g=Math.min(1,s[a]/c*l);if(n()<g){let w=E/g;f.push([d,C,w])}}return{nodeCount:e.nodeCount,edges:f}}validateSpectral(e,n){let t=Math.min(y,Math.max(1,e.nodeCount-1)),i=this.computeLaplacian(e),r=this.computeLaplacian(n),o=this.computeTopEigenvalues(i,t),m=this.computeTopEigenvalues(r,t),l=[],s=!0,c=this.epsilon;for(let f=0;f<o.length;f++){if(o[f]<1e-10)continue;let a=m[f]/o[f];l.push(a),(a<1-c||a>1+c)&&(s=!1)}return{isValid:s,eigenvalueRatios:l,originalEdgeCount:e.edges.length,sparsifiedEdgeCount:n.edges.length,compressionRatio:e.edges.length>0?n.edges.length/e.edges.length:0}}computeLaplacian(e){let n=e.nodeCount,t=Array.from({length:n},()=>new Array(n).fill(0));for(let[i,r,o]of e.edges)i<0||i>=n||r<0||r>=n||(t[i][i]+=o,t[r][r]+=o,t[i][r]-=o,t[r][i]-=o);return t}computeTopEigenvalues(e,n){let t=e.length;if(t===0)return[];let i=[],r=[],o=e.map(m=>[...m]);for(let m=0;m<Math.min(n,t);m++){let l=this.powerIteration(o,t,r);if(l===null)break;i.push(l.eigenvalue),r.push(l.eigenvector),V(o,l.eigenvalue,l.eigenvector)}return i}approximateEffectiveResistances(e){let n=e.nodeCount,t=new Float64Array(n);for(let[r,o,m]of e.edges)r>=0&&r<n&&(t[r]+=m),o>=0&&o<n&&(t[o]+=m);let i=new Array(e.edges.length);for(let r=0;r<e.edges.length;r++){let[o,m]=e.edges[r],l=t[o]||1,s=t[m]||1;i[r]=1/l+1/s}return i}powerIteration(e,n,t){let i=0;for(let s=0;s<n;s++)for(let c=0;c<n;c++)i+=e[s][c]*e[s][c];if(i<p*p)return null;let r=t.length,o=new Array(n);for(let s=0;s<n;s++)o[s]=Math.sin((s+1)*(r+1)*1.618033988749895)+.1*(s-n/2);for(let s of t)h(o,s);if(R(o)<p)return null;let l=0;for(let s=0;s<x;s++){let c=L(e,o);for(let d of t)h(c,d);let f=S(c,o),a=v(c);if(a<p)return{eigenvalue:0,eigenvector:o};for(let d=0;d<n;d++)o[d]=c[d]/a;if(Math.abs(f-l)<p){l=f;break}l=f}return{eigenvalue:Math.abs(l),eigenvector:o}}};function L(u,e){let n=u.length,t=new Array(n).fill(0);for(let i=0;i<n;i++){let r=0;for(let o=0;o<n;o++)r+=u[i][o]*e[o];t[i]=r}return t}function v(u){let e=0;for(let n=0;n<u.length;n++)e+=u[n]*u[n];return Math.sqrt(e)}function R(u){let e=v(u);if(e>0)for(let n=0;n<u.length;n++)u[n]/=e;return e}function S(u,e){let n=0;for(let t=0;t<u.length;t++)n+=u[t]*e[t];return n}function h(u,e){let n=S(u,e);for(let t=0;t<u.length;t++)u[t]-=n*e[t]}function V(u,e,n){let t=n.length;for(let i=0;i<t;i++)for(let r=0;r<t;r++)u[i][r]-=e*n[i]*n[r]}export{b 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.10.1");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.10.2");process.exit(0)}
2
2
  var h=class{executionHistory=[];learnedDurations=new Map;runCount=0;lastPrunedCount=0;learningRate;maxHistorySize;constructor(t){this.learningRate=t?.learningRate??.3,this.maxHistorySize=t?.maxHistorySize??1e4}buildTestDAG(t){let e=new Map,n=new Map;for(let i of t){let s=this.applyLearnedDuration(i);e.set(s.id,s),n.set(s.id,[])}for(let i of t)for(let s of i.dependencies){if(!e.has(s))throw new Error(`Test '${i.id}' depends on '${s}' which does not exist in the test set`);n.get(s).push(i.id)}let o=this.computeCriticalPath(e,n),a=this.computeParallelGroups(e,n);return{nodes:e,edges:n,criticalPath:o,parallelGroups:a}}findCriticalPath(t){return t.criticalPath.map(e=>t.nodes.get(e)).filter(e=>e!==void 0)}findParallelBranches(t){return t.parallelGroups.map(e=>e.map(n=>t.nodes.get(n)).filter(n=>n!==void 0))}pruneByMinCut(t,e){let n=this.sumDurations(t.nodes);if(n<=e)return this.lastPrunedCount=0,t;let o=this.computeAttentionScores(t),a=Array.from(o.entries()).sort((r,l)=>r[1]-l[1]),i=new Set(t.criticalPath),s=new Set,c=n;for(let[r]of a){if(c<=e)break;if(i.has(r)||(t.edges.get(r)??[]).some(p=>!s.has(p)))continue;let d=t.nodes.get(r);d&&(s.add(r),c-=d.estimatedDuration)}this.lastPrunedCount=s.size;let u=Array.from(t.nodes.values()).filter(r=>!s.has(r.id));return this.buildTestDAG(u)}schedule(t){if(t.length===0)return{phases:[],totalEstimatedTime:0,criticalPathTime:0,parallelism:0};let e=this.buildTestDAG(t),o=this.findParallelBranches(e).map(u=>({tests:u,canRunInParallel:u.length>1})),a=this.computeCriticalPathDuration(e),i=this.sumDurations(e.nodes),s=o.reduce((u,r)=>r.canRunInParallel?u+Math.max(...r.tests.map(l=>l.estimatedDuration)):u+r.tests.reduce((l,d)=>l+d.estimatedDuration,0),0),c=s>0?i/s:1;return this.runCount++,{phases:o,totalEstimatedTime:s,criticalPathTime:a,parallelism:c}}getOptimizationStats(){return{totalTests:0,criticalPathLength:0,parallelGroupCount:0,prunedTests:this.lastPrunedCount,estimatedTimeSaved:0,historicalRuns:this.runCount,usingNativeBackend:!1}}recordExecution(t,e,n){this.executionHistory.push({testId:t,actualDuration:e,result:n,timestamp:Date.now()}),this.executionHistory.length>this.maxHistorySize&&(this.executionHistory=this.executionHistory.slice(-this.maxHistorySize));let o=this.learnedDurations.get(t);o!==void 0?this.learnedDurations.set(t,o*(1-this.learningRate)+e*this.learningRate):this.learnedDurations.set(t,e)}getLearnedDuration(t){return this.learnedDurations.get(t)}isNativeBackendAvailable(){return!1}computeCriticalPath(t,e){let n=this.topologicalSort(t,e);if(n.length===0)return[];let o=new Map,a=new Map;for(let r of n)o.set(r,t.get(r).estimatedDuration),a.set(r,null);for(let r of n){let l=o.get(r);for(let d of e.get(r)??[]){let p=t.get(d);if(!p)continue;let g=l+p.estimatedDuration;g>(o.get(d)??0)&&(o.set(d,g),a.set(d,r))}}let i=0,s=null;for(let[r,l]of o)l>i&&(i=l,s=r);if(!s)return[];let c=[],u=s;for(;u!==null;)c.unshift(u),u=a.get(u)??null;return c}computeCriticalPathDuration(t){return t.criticalPath.reduce((e,n)=>e+(t.nodes.get(n)?.estimatedDuration??0),0)}computeParallelGroups(t,e){let n=this.topologicalSort(t,e);if(n.length===0)return[];let o=new Map;for(let[u,r]of t)o.set(u,new Set(r.dependencies));let a=new Map;for(let u of n){let r=-1;for(let l of o.get(u)??new Set){let d=a.get(l);d!==void 0&&d>r&&(r=d)}a.set(u,r+1)}let i=new Map;for(let u of n){let r=a.get(u)??0;i.has(r)||i.set(r,[]),i.get(r).push(u)}let s=Math.max(...Array.from(i.keys()),-1),c=[];for(let u=0;u<=s;u++){let r=i.get(u);r&&r.length>0&&c.push(r)}return c}computeAttentionScores(t){let e=new Map,n=this.countTransitiveDependents(t);for(let[o,a]of t.nodes){let i=a.lastResult==="fail"?2:1,s=n.get(o)??0;e.set(o,a.priority*i*(1+s))}return e}countTransitiveDependents(t){let e=new Map,n=new Map,o=a=>{if(n.has(a))return n.get(a);let i=new Set;for(let s of t.edges.get(a)??[]){i.add(s);for(let c of o(s))i.add(c)}return n.set(a,i),i};for(let a of t.nodes.keys())e.set(a,o(a).size);return e}topologicalSort(t,e){let n=new Map;for(let i of t.keys())n.set(i,0);for(let i of e.values())for(let s of i)n.has(s)&&n.set(s,(n.get(s)??0)+1);let o=[];for(let[i,s]of n)s===0&&o.push(i);let a=[];for(;o.length>0;){let i=o.shift();a.push(i);for(let s of e.get(i)??[]){let c=(n.get(s)??0)-1;n.set(s,c),c===0&&o.push(s)}}if(a.length!==t.size)throw new Error(`Cycle detected in test DAG: sorted ${a.length} of ${t.size} nodes`);return a}applyLearnedDuration(t){let e=this.learnedDurations.get(t.id);return e!==void 0?{...t,estimatedDuration:Math.round(e)}:t}sumDurations(t){let e=0;for(let n of t.values())e+=n.estimatedDuration;return e}};function m(f){return new h(f)}export{h as a,m as b};
@@ -1,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.10.1");process.exit(0)}
2
- import{c as h,e as v,g as T}from"./chunk-4AWJ5PE4.js";var y={};v(y,{DotProductAttention:()=>z,FlashAttention:()=>k,HyperbolicAttention:()=>C,LinearAttention:()=>j,MoEAttention:()=>W,MultiHeadAttention:()=>F,RuvectorLayer:()=>_,SonaEngine:()=>K,TensorCompress:()=>E,default:()=>O,differentiableSearch:()=>L,getCompressionLevel:()=>B,hierarchicalForward:()=>V,init:()=>D,pipeline:()=>q});import{createRequire as A}from"module";var I,g,O,_,E,L,V,B,D,k,z,F,C,j,W,K,q,R=h(()=>{I=A(import.meta.url),g=I("@ruvector/rvf-node"),O=g,{RuvectorLayer:_,TensorCompress:E,differentiableSearch:L,hierarchicalForward:V,getCompressionLevel:B,init:D,FlashAttention:k,DotProductAttention:z,MultiHeadAttention:F,HyperbolicAttention:C,LinearAttention:j,MoEAttention:W,SonaEngine:K,pipeline:q}=g||{}});var Z={};v(Z,{createRvfStore:()=>Q,isRvfNativeAvailable:()=>Y,openRvfStore:()=>U,openRvfStoreReadonly:()=>X});import{readFileSync as J,writeFileSync as H,copyFileSync as $,existsSync as G}from"fs";function c(){if(S)return m;S=!0;try{let i=(R(),T(y));!i.RvfDatabase&&i.default&&i.default.RvfDatabase&&(i=i.default),m=i}catch{m=null}return m}function w(i){return`${i}.idmap.json`}function N(i){let e=w(i),t=new Map,n=new Map,s=1;if(G(e))try{let r=JSON.parse(J(e,"utf-8"));s=r.nextLabel;for(let[a,p]of r.entries)t.set(a,p),n.set(p,a)}catch{}return{strToNum:t,numToStr:n,nextLabel:s}}function b(i,e,t){let n={nextLabel:t,entries:Array.from(e.entries())};H(w(i),JSON.stringify(n),"utf-8")}function Q(i,e){let t=c();if(!t)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let n=t.RvfDatabase.create(i,{dimension:e}),s=n.dimension();return new d(n,i,s,new Map,new Map,1)}function U(i){let e=c();if(!e)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let t=e.RvfDatabase.open(i),n=t.dimension(),{strToNum:s,numToStr:r,nextLabel:a}=N(i);return new d(t,i,n,s,r,a)}function X(i){let e=c();if(!e)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let t=e.RvfDatabase.openReadonly(i),n=t.dimension(),{strToNum:s,numToStr:r,nextLabel:a}=N(i);return new d(t,i,n,s,r,a)}function Y(){return c()!==null}var m,S,d,P=h(()=>{m=null,S=!1;d=class i{db;_path;_dimension;strToNum;numToStr;nextLabel;_open;constructor(e,t,n,s,r,a){this.db=e,this._path=t,this._dimension=n,this.strToNum=s,this.numToStr=r,this.nextLabel=a,this._open=!0}ingest(e){if(this.ensureOpen(),e.length===0)return{accepted:0,rejected:0};let t=this._dimension,n=new Float32Array(e.length*t),s=[],r=[];for(let o=0;o<e.length;o++){let{id:u,vector:f,metadata:x}=e[o],l=this.strToNum.get(u);l===void 0&&(l=this.nextLabel++,this.strToNum.set(u,l),this.numToStr.set(l,u)),s.push(l),r.push(x);let M=f instanceof Float32Array?f:new Float32Array(f);n.set(M.subarray(0,t),o*t)}let a;if(r.some(o=>o!==void 0)&&typeof this.db.ingestBatchWithMetadata=="function"){let o=r.map(u=>u?JSON.stringify(u):"");a=this.db.ingestBatchWithMetadata(n,s,o)}else a=this.db.ingestBatch(n,s);return this.persistIdMap(),{accepted:a.accepted,rejected:a.rejected}}search(e,t){this.ensureOpen();let n=e instanceof Float32Array?e:new Float32Array(e);return this.db.query(n,t).map(r=>{let a=this.numToStr.get(r.id);return a===void 0?null:{id:a,distance:r.distance,score:1/(1+r.distance)}}).filter(r=>r!==null)}delete(e){this.ensureOpen();let t=[];for(let s of e){let r=this.strToNum.get(s);r!==void 0&&t.push(r)}if(t.length===0)return 0;let n=this.db.delete(t);for(let s of e){let r=this.strToNum.get(s);r!==void 0&&(this.strToNum.delete(s),this.numToStr.delete(r))}return this.persistIdMap(),n.deleted}fork(e){this.ensureOpen(),$(this._path,e);let t=new Map(this.strToNum),n=new Map(this.numToStr);b(e,t,this.nextLabel);let r=c().RvfDatabase.open(e);return new i(r,e,this._dimension,t,n,this.nextLabel)}status(){this.ensureOpen();let e=this.db.status(),n=this.db.segments().filter(s=>s.segType==="witness");return{totalVectors:e.totalVectors,totalSegments:e.totalSegments,fileSizeBytes:e.fileSize,epoch:e.currentEpoch,witnessValid:n.length>0,witnessEntries:n.length,deadSpaceRatio:typeof e.deadSpaceRatio=="number"?e.deadSpaceRatio:0}}dimension(){return this._dimension}size(){return this.ensureOpen(),this.db.status().totalVectors}compact(){this.ensureOpen();try{let e=this.db.compact();return e&&typeof e=="object"?{segmentsCompacted:typeof e.segmentsCompacted=="number"?e.segmentsCompacted:0,bytesReclaimed:typeof e.bytesReclaimed=="number"?e.bytesReclaimed:0,epoch:typeof e.epoch=="number"?e.epoch:0}:{segmentsCompacted:0,bytesReclaimed:0,epoch:0}}catch{return null}}close(){this._open&&(this.db.close(),this._open=!1)}isOpen(){return this._open}path(){return this._path}embedKernel(e){return this.ensureOpen(),this.db.embedKernel(0,99,0,e,0,"")}extractKernel(){return this.ensureOpen(),this.db.extractKernel()}verifyWitness(){this.ensureOpen();let e=this.tryNative("verifyWitness");return e?{valid:e.valid??!0,totalEntries:e.totalEntries??0,errors:Array.isArray(e.errors)?e.errors:[]}:{valid:!0,totalEntries:0,errors:[]}}sign(e){this.ensureOpen();let t=this.tryNative("sign",e);return typeof t=="string"?t:null}fileId(){this.ensureOpen();let e=this.tryNative("fileId");return typeof e=="string"?e:null}parentId(){this.ensureOpen();let e=this.tryNative("parentId");return typeof e=="string"?e:null}lineageDepth(){this.ensureOpen();let e=this.tryNative("lineageDepth");return typeof e=="number"?e:0}indexStats(){let e=this.status();return{totalVectors:e.totalVectors,dimension:this._dimension,totalSegments:e.totalSegments,fileSizeBytes:e.fileSizeBytes,epoch:e.epoch,witnessValid:e.witnessValid,witnessEntries:e.witnessEntries,idMapSize:this.strToNum.size}}freeze(){this.ensureOpen();let e=this.tryNative("freeze");return typeof e=="number"?e:0}derive(e){this.ensureOpen();let t=c();if(typeof this.db.derive=="function")try{let n=this.db.derive(e),s=new Map(this.strToNum),r=new Map(this.numToStr);return b(e,s,this.nextLabel),new i(n,e,this._dimension,s,r,this.nextLabel)}catch{}return this.fork(e)}ensureOpen(){if(!this._open)throw new Error("RVF database is closed")}tryNative(e,...t){if(typeof this.db[e]!="function")return null;try{return this.db[e](...t)}catch{return null}}persistIdMap(){b(this._path,this.strToNum,this.nextLabel)}}});export{Q as a,U as b,X as c,Y as d,Z as e,P 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.10.2");process.exit(0)}
2
+ import{c as h,e as v,g as T}from"./chunk-ORF2UKQH.js";var y={};v(y,{DotProductAttention:()=>z,FlashAttention:()=>k,HyperbolicAttention:()=>C,LinearAttention:()=>j,MoEAttention:()=>W,MultiHeadAttention:()=>F,RuvectorLayer:()=>_,SonaEngine:()=>K,TensorCompress:()=>E,default:()=>O,differentiableSearch:()=>L,getCompressionLevel:()=>B,hierarchicalForward:()=>V,init:()=>D,pipeline:()=>q});import{createRequire as A}from"module";var I,g,O,_,E,L,V,B,D,k,z,F,C,j,W,K,q,R=h(()=>{I=A(import.meta.url),g=I("@ruvector/rvf-node"),O=g,{RuvectorLayer:_,TensorCompress:E,differentiableSearch:L,hierarchicalForward:V,getCompressionLevel:B,init:D,FlashAttention:k,DotProductAttention:z,MultiHeadAttention:F,HyperbolicAttention:C,LinearAttention:j,MoEAttention:W,SonaEngine:K,pipeline:q}=g||{}});var Z={};v(Z,{createRvfStore:()=>Q,isRvfNativeAvailable:()=>Y,openRvfStore:()=>U,openRvfStoreReadonly:()=>X});import{readFileSync as J,writeFileSync as H,copyFileSync as $,existsSync as G}from"fs";function c(){if(S)return m;S=!0;try{let i=(R(),T(y));!i.RvfDatabase&&i.default&&i.default.RvfDatabase&&(i=i.default),m=i}catch{m=null}return m}function w(i){return`${i}.idmap.json`}function N(i){let e=w(i),t=new Map,n=new Map,s=1;if(G(e))try{let r=JSON.parse(J(e,"utf-8"));s=r.nextLabel;for(let[a,p]of r.entries)t.set(a,p),n.set(p,a)}catch{}return{strToNum:t,numToStr:n,nextLabel:s}}function b(i,e,t){let n={nextLabel:t,entries:Array.from(e.entries())};H(w(i),JSON.stringify(n),"utf-8")}function Q(i,e){let t=c();if(!t)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let n=t.RvfDatabase.create(i,{dimension:e}),s=n.dimension();return new d(n,i,s,new Map,new Map,1)}function U(i){let e=c();if(!e)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let t=e.RvfDatabase.open(i),n=t.dimension(),{strToNum:s,numToStr:r,nextLabel:a}=N(i);return new d(t,i,n,s,r,a)}function X(i){let e=c();if(!e)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let t=e.RvfDatabase.openReadonly(i),n=t.dimension(),{strToNum:s,numToStr:r,nextLabel:a}=N(i);return new d(t,i,n,s,r,a)}function Y(){return c()!==null}var m,S,d,P=h(()=>{m=null,S=!1;d=class i{db;_path;_dimension;strToNum;numToStr;nextLabel;_open;constructor(e,t,n,s,r,a){this.db=e,this._path=t,this._dimension=n,this.strToNum=s,this.numToStr=r,this.nextLabel=a,this._open=!0}ingest(e){if(this.ensureOpen(),e.length===0)return{accepted:0,rejected:0};let t=this._dimension,n=new Float32Array(e.length*t),s=[],r=[];for(let o=0;o<e.length;o++){let{id:u,vector:f,metadata:x}=e[o],l=this.strToNum.get(u);l===void 0&&(l=this.nextLabel++,this.strToNum.set(u,l),this.numToStr.set(l,u)),s.push(l),r.push(x);let M=f instanceof Float32Array?f:new Float32Array(f);n.set(M.subarray(0,t),o*t)}let a;if(r.some(o=>o!==void 0)&&typeof this.db.ingestBatchWithMetadata=="function"){let o=r.map(u=>u?JSON.stringify(u):"");a=this.db.ingestBatchWithMetadata(n,s,o)}else a=this.db.ingestBatch(n,s);return this.persistIdMap(),{accepted:a.accepted,rejected:a.rejected}}search(e,t){this.ensureOpen();let n=e instanceof Float32Array?e:new Float32Array(e);return this.db.query(n,t).map(r=>{let a=this.numToStr.get(r.id);return a===void 0?null:{id:a,distance:r.distance,score:1/(1+r.distance)}}).filter(r=>r!==null)}delete(e){this.ensureOpen();let t=[];for(let s of e){let r=this.strToNum.get(s);r!==void 0&&t.push(r)}if(t.length===0)return 0;let n=this.db.delete(t);for(let s of e){let r=this.strToNum.get(s);r!==void 0&&(this.strToNum.delete(s),this.numToStr.delete(r))}return this.persistIdMap(),n.deleted}fork(e){this.ensureOpen(),$(this._path,e);let t=new Map(this.strToNum),n=new Map(this.numToStr);b(e,t,this.nextLabel);let r=c().RvfDatabase.open(e);return new i(r,e,this._dimension,t,n,this.nextLabel)}status(){this.ensureOpen();let e=this.db.status(),n=this.db.segments().filter(s=>s.segType==="witness");return{totalVectors:e.totalVectors,totalSegments:e.totalSegments,fileSizeBytes:e.fileSize,epoch:e.currentEpoch,witnessValid:n.length>0,witnessEntries:n.length,deadSpaceRatio:typeof e.deadSpaceRatio=="number"?e.deadSpaceRatio:0}}dimension(){return this._dimension}size(){return this.ensureOpen(),this.db.status().totalVectors}compact(){this.ensureOpen();try{let e=this.db.compact();return e&&typeof e=="object"?{segmentsCompacted:typeof e.segmentsCompacted=="number"?e.segmentsCompacted:0,bytesReclaimed:typeof e.bytesReclaimed=="number"?e.bytesReclaimed:0,epoch:typeof e.epoch=="number"?e.epoch:0}:{segmentsCompacted:0,bytesReclaimed:0,epoch:0}}catch{return null}}close(){this._open&&(this.db.close(),this._open=!1)}isOpen(){return this._open}path(){return this._path}embedKernel(e){return this.ensureOpen(),this.db.embedKernel(0,99,0,e,0,"")}extractKernel(){return this.ensureOpen(),this.db.extractKernel()}verifyWitness(){this.ensureOpen();let e=this.tryNative("verifyWitness");return e?{valid:e.valid??!0,totalEntries:e.totalEntries??0,errors:Array.isArray(e.errors)?e.errors:[]}:{valid:!0,totalEntries:0,errors:[]}}sign(e){this.ensureOpen();let t=this.tryNative("sign",e);return typeof t=="string"?t:null}fileId(){this.ensureOpen();let e=this.tryNative("fileId");return typeof e=="string"?e:null}parentId(){this.ensureOpen();let e=this.tryNative("parentId");return typeof e=="string"?e:null}lineageDepth(){this.ensureOpen();let e=this.tryNative("lineageDepth");return typeof e=="number"?e:0}indexStats(){let e=this.status();return{totalVectors:e.totalVectors,dimension:this._dimension,totalSegments:e.totalSegments,fileSizeBytes:e.fileSizeBytes,epoch:e.epoch,witnessValid:e.witnessValid,witnessEntries:e.witnessEntries,idMapSize:this.strToNum.size}}freeze(){this.ensureOpen();let e=this.tryNative("freeze");return typeof e=="number"?e:0}derive(e){this.ensureOpen();let t=c();if(typeof this.db.derive=="function")try{let n=this.db.derive(e),s=new Map(this.strToNum),r=new Map(this.numToStr);return b(e,s,this.nextLabel),new i(n,e,this._dimension,s,r,this.nextLabel)}catch{}return this.fork(e)}ensureOpen(){if(!this._open)throw new Error("RVF database is closed")}tryNative(e,...t){if(typeof this.db[e]!="function")return null;try{return this.db[e](...t)}catch{return null}}persistIdMap(){b(this._path,this.strToNum,this.nextLabel)}}});export{Q as a,U as b,X as c,Y as d,Z as e,P as f};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.1");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.10.2");process.exit(0)}
2
2
  var l=class m{vertices=new Map;edges=new Map;adjacencyList=new Map;totalWeight=0;addVertex(e){if(this.vertices.has(e.id)){this.vertices.set(e.id,e);return}this.vertices.set(e.id,e),this.adjacencyList.set(e.id,[])}removeVertex(e){if(!this.vertices.has(e))return!1;let t=this.adjacencyList.get(e)||[];for(let r of t)this.removeEdge(e,r.neighborId);for(let[,r]of this.adjacencyList){let n=r.findIndex(i=>i.neighborId===e);n!==-1&&(this.totalWeight-=r[n].weight,r.splice(n,1))}return this.vertices.delete(e),this.adjacencyList.delete(e),!0}getVertex(e){return this.vertices.get(e)}hasVertex(e){return this.vertices.has(e)}getVertices(){return Array.from(this.vertices.values())}getVertexIds(){return Array.from(this.vertices.keys())}getVerticesByDomain(e){return this.getVertices().filter(t=>t.domain===e)}getVerticesByType(e){return this.getVertices().filter(t=>t.type===e)}addEdge(e){if(!this.vertices.has(e.source))throw new Error(`Source vertex ${e.source} does not exist`);if(!this.vertices.has(e.target))throw new Error(`Target vertex ${e.target} does not exist`);let t=this.edgeKey(e.source,e.target);if(this.edges.has(t)){let r=this.edges.get(t);this.totalWeight-=r.weight,this.removeFromAdjacency(e.source,e.target),r.bidirectional&&this.removeFromAdjacency(e.target,e.source)}this.edges.set(t,e),this.totalWeight+=e.weight,this.addToAdjacency(e.source,e.target,e.weight,e),e.bidirectional&&this.addToAdjacency(e.target,e.source,e.weight,e)}removeEdge(e,t){let r=this.edgeKey(e,t),n=this.edges.get(r);return n?(this.totalWeight-=n.weight,this.edges.delete(r),this.removeFromAdjacency(e,t),n.bidirectional&&this.removeFromAdjacency(t,e),!0):!1}getEdge(e,t){return this.edges.get(this.edgeKey(e,t))}hasEdge(e,t){return this.edges.has(this.edgeKey(e,t))}getEdges(){return Array.from(this.edges.values())}getEdgesForVertex(e){return(this.adjacencyList.get(e)||[]).map(r=>r.edge)}degree(e){return this.adjacencyList.get(e)?.length||0}weightedDegree(e){let t=this.adjacencyList.get(e);return t?t.reduce((r,n)=>r+n.weight,0):0}neighbors(e){return(this.adjacencyList.get(e)||[]).map(r=>({vertex:this.vertices.get(r.neighborId),weight:r.weight})).filter(r=>r.vertex!==void 0)}neighborIds(e){return(this.adjacencyList.get(e)||[]).map(r=>r.neighborId)}getStats(){let e=this.vertices.size,t=this.edges.size,r=0;for(let[,s]of this.adjacencyList)r+=s.length;let n=e>0?r/e:0,i=e>1?e*(e-1)/2:0,a=i>0?t/i:0,o=this.countConnectedComponents(),c=o===1&&e>0;return{vertexCount:e,edgeCount:t,totalWeight:this.totalWeight,averageDegree:n,density:a,isConnected:c,componentCount:o}}countConnectedComponents(){let e=new Set,t=0;for(let r of this.vertices.keys())e.has(r)||(this.dfs(r,e),t++);return t}dfs(e,t){t.add(e);let r=this.adjacencyList.get(e)||[];for(let n of r)t.has(n.neighborId)||this.dfs(n.neighborId,t)}isConnected(){if(this.vertices.size===0||this.vertices.size===1)return!0;let e=new Set,t=this.vertices.keys().next().value;return t===void 0?!0:(this.dfs(t,e),e.size===this.vertices.size)}getConnectedComponent(e){if(!this.vertices.has(e))return[];let t=new Set;return this.dfs(e,t),Array.from(t)}snapshot(){return{timestamp:new Date,vertices:this.getVertices(),edges:this.getEdges(),stats:this.getStats()}}clone(){let e=new m;for(let t of this.vertices.values())e.addVertex({...t});for(let t of this.edges.values())e.addEdge({...t});return e}static fromSnapshot(e){let t=new m;for(let r of e.vertices)t.addVertex(r);for(let r of e.edges)t.addEdge(r);return t}clear(){this.vertices.clear(),this.edges.clear(),this.adjacencyList.clear(),this.totalWeight=0}get vertexCount(){return this.vertices.size}get edgeCount(){return this.edges.size}isEmpty(){return this.vertices.size===0}edgeKey(e,t){return e<t?`${e}:${t}`:`${t}:${e}`}addToAdjacency(e,t,r,n){let i=this.adjacencyList.get(e);i&&(i.find(o=>o.neighborId===t)||i.push({neighborId:t,weight:r,edge:n}))}removeFromAdjacency(e,t){let r=this.adjacencyList.get(e);if(r){let n=r.findIndex(i=>i.neighborId===t);n!==-1&&r.splice(n,1)}}};function p(){return new l}var f=class{approxMinCut(e){let t=Date.now();if(e.isEmpty())return this.emptyResult(t,"weighted-degree");let r=e.getVertexIds(),n=1/0,i=null;for(let o of r){let c=e.weightedDegree(o);c<n&&(n=c,i=o)}if(i===null||r.length===1)return this.emptyResult(t,"weighted-degree");let a=e.getEdgesForVertex(i);return{value:n,sourceSide:[i],targetSide:r.filter(o=>o!==i),cutEdges:a,calculatedAt:new Date,algorithm:"weighted-degree",durationMs:Date.now()-t}}findWeakVertices(e,t){if(e.isEmpty())return[];let r=e.getVertices(),n=[],i=new Map,a=0;for(let g of r){let h=e.weightedDegree(g.id);i.set(g.id,h),a+=h}let o=a/r.length,c=0;for(let g of i.values())c+=(g-o)**2;let s=Math.sqrt(c/r.length),d=1/0;for(let g of i.values())g<d&&(d=g);let u=t??o-s;for(let g of r){let h=i.get(g.id);if(h<=u){let w=this.calculateRiskScore(h,o,s,d),y=this.determineWeakReason(g,h,o,e),v=this.generateStrengtheningActions(g,e,h);n.push({vertexId:g.id,vertex:g,weightedDegree:h,riskScore:w,reason:y,suggestions:v})}}return n.sort((g,h)=>h.riskScore-g.riskScore),n}getMinCutValue(e){if(e.isEmpty())return 0;let t=1/0;for(let r of e.getVertexIds()){let n=e.weightedDegree(r);n<t&&(t=n)}return t===1/0?0:t}isConnectivityCritical(e,t){return this.getMinCutValue(e)<t}getMinDegreeVertex(e){if(e.isEmpty())return null;let t=1/0,r=null;for(let n of e.getVertexIds()){let i=e.weightedDegree(n);i<t&&(t=i,r=n)}return r?{vertexId:r,degree:t}:null}getLocalMinCut(e,t){return e.hasVertex(t)?e.weightedDegree(t):0}findPartitioningPoints(e){if(e.isEmpty()||e.vertexCount<2)return[];let t=this.findArticulationPoints(e),r=[];for(let n of e.getVertices()){let i=this.getLocalMinCut(e,n.id);r.push({vertexId:n.id,localMinCut:i,wouldDisconnect:t.has(n.id)&&e.vertexCount>2})}return r.sort((n,i)=>n.localMinCut-i.localMinCut),r}findArticulationPoints(e){let t=new Map,r=new Map,n=new Map,i=new Set,a=0,o=e.getVertexIds();for(let s of o)t.set(s,-1),r.set(s,-1),n.set(s,null);let c=s=>{let d=0;t.set(s,a),r.set(s,a),a++;for(let u of e.neighborIds(s))t.get(u)===-1?(d++,n.set(u,s),c(u),r.set(s,Math.min(r.get(s),r.get(u))),n.get(s)===null&&d>1&&i.add(s),n.get(s)!==null&&r.get(u)>=t.get(s)&&i.add(s)):u!==n.get(s)&&r.set(s,Math.min(r.get(s),t.get(u)))};for(let s of o)t.get(s)===-1&&c(s);return i}suggestEdgeAdditions(e,t){let r=this.findWeakVertices(e),n=[],i=0,a=e.getVertices().map(o=>({vertex:o,degree:e.weightedDegree(o.id)})).sort((o,c)=>c.degree-o.degree);for(let o of r){if(i>=t)break;let c=new Set(e.neighborIds(o.vertexId));for(let{vertex:s}of a){if(s.id===o.vertexId||c.has(s.id))continue;let d={source:o.vertexId,target:s.id,weight:1,type:"coordination",bidirectional:!0};n.push(d),i+=1;break}}return n}emptyResult(e,t){return{value:0,sourceSide:[],targetSide:[],cutEdges:[],calculatedAt:new Date,algorithm:t,durationMs:Date.now()-e}}calculateRiskScore(e,t,r,n){if(r===0)return .5;let i=(t-e)/r,a=1/(1+Math.exp(-i)),o=n>0?n/e:1;return Math.min(1,a*o)}determineWeakReason(e,t,r,n){return t===0?"Isolated vertex with no connections":n.degree(e.id)===1?"Single connection point (leaf node)":t<r*.5?`Low connectivity (${(t/r*100).toFixed(0)}% of average)`:"Below average connectivity threshold"}generateStrengtheningActions(e,t,r){let n=[],i=new Set(t.neighborIds(e.id)),a=t.getStats().averageDegree,o=Math.max(a,3),c=Math.ceil(o-r),s=t.getVertices().filter(d=>d.id!==e.id&&!i.has(d.id)).sort((d,u)=>t.weightedDegree(u.id)-t.weightedDegree(d.id)).slice(0,c);for(let d of s)n.push({type:"add_edge",targetVertex:d.id,priority:"high",estimatedImprovement:1});return e.type==="agent"&&e.domain&&r<1&&n.push({type:"spawn_agent",domain:e.domain,priority:"critical",estimatedImprovement:2}),i.size>0&&i.size<3&&n.push({type:"increase_weight",weightDelta:.5,priority:"medium",estimatedImprovement:.5*i.size}),n}};function x(){return new f}export{l as a,p as b,f as c,x as d};
@@ -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.10.1");process.exit(0)}
2
- import{c as t}from"./chunk-4AWJ5PE4.js";import{randomInt as o}from"node:crypto";function a(){return Math.random()}function m(n,e){return o(n,e)}function c(n,e){return n+Math.random()*(e-n)}var r=t(()=>{"use strict"});export{a,m as b,c,r as d};
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.10.2");process.exit(0)}
2
+ import{c as t}from"./chunk-ORF2UKQH.js";import{randomInt as o}from"node:crypto";function a(){return Math.random()}function m(n,e){return o(n,e)}function c(n,e){return n+Math.random()*(e-n)}var r=t(()=>{"use strict"});export{a,m as b,c,r as d};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.1");process.exit(0)}
2
- import{a as T,c as N}from"./chunk-2TDWCXZ6.js";import{b as D,c as L,d as V}from"./chunk-XKOKMS5A.js";N();V();import*as C from"fs";import*as v from"path";import*as W from"yaml";var q=5,H=4,Q=3e4,K=".claude/skills",B=5e3,J=500,$=100,Y=1e3,F=500,z=.8,X=.2,Z=.1,w=.1,ee=.1,te=.1,se=.1,re=200,ne=500,ae=300,ie=1,oe=.9,U={maxWorkers:q,batchSize:H,retryFailedTests:!0,timeout:Q,skillsDir:K,progressIntervalMs:B},S=class{async execute(e,r,t){let s=L($,J+$);return await new Promise(o=>setTimeout(o,s)),{output:this.generateMockResponse(e),tokensUsed:D(F,Y+F),durationMs:s}}generateMockResponse(e){let r=[];return e.includes("alt")&&r.push("alt","1.1.1","perceivable"),e.includes("contrast")&&r.push("contrast","1.4.3","4.5:1"),e.includes("keyboard")&&r.push("keyboard","2.1.1","operable","button"),e.includes("label")&&r.push("label","3.3.2","understandable"),e.includes("ARIA")&&r.push("ARIA","4.1.2","robust"),e.includes("focus")&&r.push("focus","2.4.7","outline"),e.includes("lang")&&r.push("lang","3.1.1","language"),e.includes("caption")&&r.push("caption","1.2.2","track"),e.includes("accessible")&&r.push("accessible","compliant"),r.length===0&&r.push("accessibility","WCAG","finding"),`Analysis complete. Found issues related to: ${r.join(", ")}.
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.10.2");process.exit(0)}
2
+ import{a as T,c as N}from"./chunk-XPCNUX2U.js";import{b as D,c as L,d as V}from"./chunk-DRWGK3YO.js";N();V();import*as C from"fs";import*as v from"path";import*as W from"yaml";var q=5,H=4,Q=3e4,K=".claude/skills",B=5e3,J=500,$=100,Y=1e3,F=500,z=.8,X=.2,Z=.1,w=.1,ee=.1,te=.1,se=.1,re=200,ne=500,ae=300,ie=1,oe=.9,U={maxWorkers:q,batchSize:H,retryFailedTests:!0,timeout:Q,skillsDir:K,progressIntervalMs:B},S=class{async execute(e,r,t){let s=L($,J+$);return await new Promise(o=>setTimeout(o,s)),{output:this.generateMockResponse(e),tokensUsed:D(F,Y+F),durationMs:s}}generateMockResponse(e){let r=[];return e.includes("alt")&&r.push("alt","1.1.1","perceivable"),e.includes("contrast")&&r.push("contrast","1.4.3","4.5:1"),e.includes("keyboard")&&r.push("keyboard","2.1.1","operable","button"),e.includes("label")&&r.push("label","3.3.2","understandable"),e.includes("ARIA")&&r.push("ARIA","4.1.2","robust"),e.includes("focus")&&r.push("focus","2.4.7","outline"),e.includes("lang")&&r.push("lang","3.1.1","language"),e.includes("caption")&&r.push("caption","1.2.2","track"),e.includes("accessible")&&r.push("accessible","compliant"),r.length===0&&r.push("accessibility","WCAG","finding"),`Analysis complete. Found issues related to: ${r.join(", ")}.
3
3
  Recommendations: Implement proper ${r[0]} attributes for better accessibility.
4
4
  Severity: ${e.includes("critical")?"critical":"serious"}`}},M=class{constructor(e,r,t){this.executor=r;this.config=t;this.id=e}executor;config;id;status="idle";tasksCompleted=0;tasksFailed=0;lastHeartbeat=Date.now();async executeBatch(e){this.status="running";let r=[];for(let t of e){this.lastHeartbeat=Date.now();try{let s=await this.executeTestCase(t);if(r.push(s),s.passed)this.tasksCompleted++;else if(this.tasksFailed++,this.config.retryFailedTests&&!s.passed){let n=await this.executeTestCase(t,!0);n.passed&&(r[r.length-1]=n,this.tasksCompleted++,this.tasksFailed--)}}catch(s){this.tasksFailed++,r.push({testId:t.testCaseId,passed:!1,expectedPatterns:t.testCase.expected_output.must_contain||[],actualPatterns:[],reasoningQuality:0,category:t.testCase.category,priority:t.testCase.priority,error:T(s)})}}return this.status="idle",r}async executeTestCase(e,r=!1){let t=Date.now(),s=this.buildPrompt(e),n=await this.executor.execute(s,e.model,{timeout:this.config.timeout}),o=this.validateResponse(n.output,e.testCase.expected_output,e.testCase.validation);return{testId:e.testCaseId,passed:o.passed,expectedPatterns:e.testCase.expected_output.must_contain||[],actualPatterns:o.foundPatterns,reasoningQuality:o.reasoningQuality,executionTimeMs:Date.now()-t,category:e.testCase.category,priority:e.testCase.priority,error:o.error}}buildPrompt(e){let{testCase:r}=e,t=r.input.context;return`Analyze the following ${t.language||"HTML"} code for accessibility issues.
5
5
  Context: ${t.description||r.description}
@@ -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.10.1");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.10.2");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.10.1");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.10.2");process.exit(0)}
2
2
  import{createRequire as t}from"module";var o=t(import.meta.url),e=o("@huggingface/transformers"),n=e,{RuvectorLayer:i,TensorCompress:a,differentiableSearch:c,hierarchicalForward:s,getCompressionLevel:l,init:p,FlashAttention:m,DotProductAttention:u,MultiHeadAttention:d,HyperbolicAttention:f,LinearAttention:A,MoEAttention:g,SonaEngine:h,pipeline:_}=e||{};export{n as a,i as b,a as c,c as d,s as e,l as f,p as g,m as h,u as i,d as j,f as k,A as l,g as m,h as n,_ as o};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.10.1");process.exit(0)}
2
- import{S as f,b as p}from"./chunk-ELZ67OHQ.js";f();var y={predictionWindowSize:10,compressionThreshold:.3,maxConcurrentStreams:8,oscillationFrequencyMs:100};function d(s){try{return JSON.stringify(s).length}catch{return 0}}function w(s,t){let e={},n=!1;for(let r of Object.keys(t))JSON.stringify(s[r])!==JSON.stringify(t[r])&&(e[r]=t[r],n=!0);for(let r of Object.keys(s))r in t||(e[r]=void 0,n=!0);return n?e:null}function v(s,t){let e={...s};for(let[n,r]of Object.entries(t))r===void 0?delete e[n]:e[n]=r;return e}var l=class{windowSize;windows=new Map;constructor(t){this.windowSize=Math.max(1,t)}predict(t){let e=this.windows.get(t);if(!e||e.length===0)return null;let n=e[e.length-1];return typeof n!="object"||n===null||Array.isArray(n)?null:{...n}}record(t,e){let n=this.windows.get(t);n||(n=[],this.windows.set(t,n)),n.push(e),n.length>this.windowSize&&n.shift()}removeStream(t){this.windows.delete(t)}},h=class{maxStreams;cycleMs;streamIds=[];currentIndex=0;constructor(t,e){this.maxStreams=Math.max(1,t),this.cycleMs=Math.max(1,e)}addStream(t){return this.streamIds.includes(t)||this.streamIds.length>=this.maxStreams?!1:(this.streamIds.push(t),!0)}removeStream(t){let e=this.streamIds.indexOf(t);return e===-1?!1:(this.streamIds.splice(e,1),this.currentIndex>=this.streamIds.length&&(this.currentIndex=0),!0)}nextStream(){if(this.streamIds.length===0)return null;let t=this.streamIds[this.currentIndex];return this.currentIndex=(this.currentIndex+1)%this.streamIds.length,t}getActiveStreams(){return[...this.streamIds]}get activeCount(){return this.streamIds.length}},g=class{config;predictor;router;lastPayloads=new Map;totalMessages=0;compressedMessages=0;totalOriginalBytes=0;totalCompressedBytes=0;constructor(t){this.config={...y,...t},this.predictor=new l(this.config.predictionWindowSize),this.router=new h(this.config.maxConcurrentStreams,this.config.oscillationFrequencyMs)}send(t,e,n,r){this.totalMessages++;let i=d(r);this.totalOriginalBytes+=i;let c=!1,o=r,a=i;if(typeof r=="object"&&r!==null&&!Array.isArray(r)){let m=this.predictor.predict(t);if(m){let u=w(m,r);u?1-d(u)/Math.max(i,1)>=this.config.compressionThreshold&&(o={__delta:!0,__changes:u},a=d(o),c=!0,this.compressedMessages++):(o={__delta:!0,__changes:{}},a=d(o),c=!0,this.compressedMessages++)}}return this.totalCompressedBytes+=a,this.predictor.record(t,r),this.lastPayloads.set(t,r),{streamId:t,senderId:e,receiverId:n,payload:o,compressed:c,originalSize:i,compressedSize:a,timestamp:Date.now()}}receive(t){if(!t.compressed||typeof t.payload!="object"||t.payload===null)return this.lastPayloads.set(t.streamId,t.payload),this.predictor.record(t.streamId,t.payload),t.payload;let e=t.payload;if(!e.__delta)return this.lastPayloads.set(t.streamId,t.payload),this.predictor.record(t.streamId,t.payload),t.payload;let n=this.predictor.predict(t.streamId),r=e.__changes??{};if(!n)return r;let i=v(n,r);return this.predictor.record(t.streamId,i),this.lastPayloads.set(t.streamId,i),i}getStats(){let t=this.totalOriginalBytes-this.totalCompressedBytes;return{totalMessages:this.totalMessages,compressedMessages:this.compressedMessages,bandwidthSavedBytes:Math.max(0,t),bandwidthReductionPercent:this.totalOriginalBytes>0?Math.max(0,t)/this.totalOriginalBytes*100:0,activeStreams:this.router.activeCount}}addStream(t){this.router.addStream(t)}removeStream(t){this.router.removeStream(t),this.predictor.removeStream(t),this.lastPayloads.delete(t)}};function M(s){return S()?new g(s):null}function S(){return p().useCognitiveRouting}export{M 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.10.2");process.exit(0)}
2
+ import{S as f,b as p}from"./chunk-ON4D4TJ4.js";f();var y={predictionWindowSize:10,compressionThreshold:.3,maxConcurrentStreams:8,oscillationFrequencyMs:100};function d(s){try{return JSON.stringify(s).length}catch{return 0}}function w(s,t){let e={},n=!1;for(let r of Object.keys(t))JSON.stringify(s[r])!==JSON.stringify(t[r])&&(e[r]=t[r],n=!0);for(let r of Object.keys(s))r in t||(e[r]=void 0,n=!0);return n?e:null}function v(s,t){let e={...s};for(let[n,r]of Object.entries(t))r===void 0?delete e[n]:e[n]=r;return e}var l=class{windowSize;windows=new Map;constructor(t){this.windowSize=Math.max(1,t)}predict(t){let e=this.windows.get(t);if(!e||e.length===0)return null;let n=e[e.length-1];return typeof n!="object"||n===null||Array.isArray(n)?null:{...n}}record(t,e){let n=this.windows.get(t);n||(n=[],this.windows.set(t,n)),n.push(e),n.length>this.windowSize&&n.shift()}removeStream(t){this.windows.delete(t)}},h=class{maxStreams;cycleMs;streamIds=[];currentIndex=0;constructor(t,e){this.maxStreams=Math.max(1,t),this.cycleMs=Math.max(1,e)}addStream(t){return this.streamIds.includes(t)||this.streamIds.length>=this.maxStreams?!1:(this.streamIds.push(t),!0)}removeStream(t){let e=this.streamIds.indexOf(t);return e===-1?!1:(this.streamIds.splice(e,1),this.currentIndex>=this.streamIds.length&&(this.currentIndex=0),!0)}nextStream(){if(this.streamIds.length===0)return null;let t=this.streamIds[this.currentIndex];return this.currentIndex=(this.currentIndex+1)%this.streamIds.length,t}getActiveStreams(){return[...this.streamIds]}get activeCount(){return this.streamIds.length}},g=class{config;predictor;router;lastPayloads=new Map;totalMessages=0;compressedMessages=0;totalOriginalBytes=0;totalCompressedBytes=0;constructor(t){this.config={...y,...t},this.predictor=new l(this.config.predictionWindowSize),this.router=new h(this.config.maxConcurrentStreams,this.config.oscillationFrequencyMs)}send(t,e,n,r){this.totalMessages++;let i=d(r);this.totalOriginalBytes+=i;let c=!1,o=r,a=i;if(typeof r=="object"&&r!==null&&!Array.isArray(r)){let m=this.predictor.predict(t);if(m){let u=w(m,r);u?1-d(u)/Math.max(i,1)>=this.config.compressionThreshold&&(o={__delta:!0,__changes:u},a=d(o),c=!0,this.compressedMessages++):(o={__delta:!0,__changes:{}},a=d(o),c=!0,this.compressedMessages++)}}return this.totalCompressedBytes+=a,this.predictor.record(t,r),this.lastPayloads.set(t,r),{streamId:t,senderId:e,receiverId:n,payload:o,compressed:c,originalSize:i,compressedSize:a,timestamp:Date.now()}}receive(t){if(!t.compressed||typeof t.payload!="object"||t.payload===null)return this.lastPayloads.set(t.streamId,t.payload),this.predictor.record(t.streamId,t.payload),t.payload;let e=t.payload;if(!e.__delta)return this.lastPayloads.set(t.streamId,t.payload),this.predictor.record(t.streamId,t.payload),t.payload;let n=this.predictor.predict(t.streamId),r=e.__changes??{};if(!n)return r;let i=v(n,r);return this.predictor.record(t.streamId,i),this.lastPayloads.set(t.streamId,i),i}getStats(){let t=this.totalOriginalBytes-this.totalCompressedBytes;return{totalMessages:this.totalMessages,compressedMessages:this.compressedMessages,bandwidthSavedBytes:Math.max(0,t),bandwidthReductionPercent:this.totalOriginalBytes>0?Math.max(0,t)/this.totalOriginalBytes*100:0,activeStreams:this.router.activeCount}}addStream(t){this.router.addStream(t)}removeStream(t){this.router.removeStream(t),this.predictor.removeStream(t),this.lastPayloads.delete(t)}};function M(s){return S()?new g(s):null}function S(){return p().useCognitiveRouting}export{M as a,S as b};