agentic-qe 3.14.6 → 3.14.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (416) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +74 -0
  3. package/assets/skills/skills-manifest.json +1 -1
  4. package/dist/cli/bundle.js +8 -8
  5. package/dist/cli/chunks/adapter-TVQKH65T.js +2 -0
  6. package/dist/cli/chunks/{agent-booster-wasm-2YGML6OU.js → agent-booster-wasm-AK2W76RG.js} +2 -2
  7. package/dist/cli/chunks/{agent-handler-D5SSQYNU.js → agent-handler-MGZCWHIY.js} +2 -2
  8. package/dist/cli/chunks/{agent-memory-branch-YHPLTITV.js → agent-memory-branch-JZ54MCSP.js} +2 -2
  9. package/dist/cli/chunks/aqe-learning-engine-ULGTVVWE.js +2 -0
  10. package/dist/cli/chunks/{arena-7BGOXGXO.js → arena-CUVH3V7H.js} +2 -2
  11. package/dist/cli/chunks/{arena-MCE6EU7K.js → arena-YSWTKBCL.js} +4 -4
  12. package/dist/cli/chunks/{audit-BMWTQECB.js → audit-LVU76QGA.js} +3 -3
  13. package/dist/cli/chunks/base-W42BURDL.js +2 -0
  14. package/dist/cli/chunks/{better-sqlite3-PMUNGASU.js → better-sqlite3-DB3LOJQU.js} +2 -2
  15. package/dist/cli/chunks/{brain-handler-QPUFYX7F.js → brain-handler-SD63KOQ6.js} +3 -3
  16. package/dist/cli/chunks/{branch-enumerator-WKFDGRN4.js → branch-enumerator-4MNOPUC7.js} +2 -2
  17. package/dist/cli/chunks/{browser-VY5HKH5X.js → browser-OLPNTWQE.js} +2 -2
  18. package/dist/cli/chunks/browser-workflow-HKGHFFFT.js +2 -0
  19. package/dist/cli/chunks/{chunk-62N4NUJH.js → chunk-23CX7JNL.js} +2 -2
  20. package/dist/cli/chunks/{chunk-MW2GGZZ5.js → chunk-25P6JA6V.js} +1 -1
  21. package/dist/cli/chunks/{chunk-RSXXCL4A.js → chunk-2G63VIJE.js} +1 -1
  22. package/dist/cli/chunks/{chunk-3NIG7S5W.js → chunk-2IMSJ7IO.js} +1 -1
  23. package/dist/cli/chunks/{chunk-I33ERSGB.js → chunk-36VKMAMN.js} +2 -2
  24. package/dist/cli/chunks/{chunk-2TMWAQQ3.js → chunk-3M7J4U74.js} +3 -3
  25. package/dist/cli/chunks/{chunk-CM7U6TAX.js → chunk-3QJU4Q4R.js} +2 -2
  26. package/dist/cli/chunks/{chunk-H5BS5VH7.js → chunk-4EKV7PHB.js} +2 -2
  27. package/dist/cli/chunks/{chunk-IG5GNEC6.js → chunk-4INST4ZL.js} +1 -1
  28. package/dist/cli/chunks/{chunk-YHKEDEAA.js → chunk-53BXTTRO.js} +3 -3
  29. package/dist/cli/chunks/{chunk-ENGZ4D5V.js → chunk-5D7ZFWDS.js} +2 -2
  30. package/dist/cli/chunks/{chunk-DZ3AUAAB.js → chunk-5FSLMYAC.js} +2 -2
  31. package/dist/cli/chunks/{chunk-FBMN7B46.js → chunk-5GFKTJ65.js} +2 -2
  32. package/dist/cli/chunks/{chunk-NMAIY4PX.js → chunk-5U6N4V5M.js} +11 -11
  33. package/dist/cli/chunks/{chunk-B6D2CHEH.js → chunk-6EGS77BB.js} +1 -1
  34. package/dist/cli/chunks/{chunk-NQZ5AR3D.js → chunk-6PJPQGF4.js} +2 -2
  35. package/dist/cli/chunks/{chunk-ICTXTNQZ.js → chunk-6RD44SCE.js} +1 -1
  36. package/dist/cli/chunks/{chunk-2NPKIBAZ.js → chunk-74IOEOMH.js} +2 -2
  37. package/dist/cli/chunks/{chunk-RTFO5UQH.js → chunk-77QZHIVX.js} +2 -2
  38. package/dist/cli/chunks/{chunk-D45SG6CP.js → chunk-7EZ2Z2CK.js} +1 -1
  39. package/dist/cli/chunks/{chunk-UNFFDHER.js → chunk-7MIOK72I.js} +10 -32
  40. package/dist/cli/chunks/{chunk-HNFVJP4I.js → chunk-7QYOTUOX.js} +2 -2
  41. package/dist/cli/chunks/{chunk-Q7EAGKAE.js → chunk-A2VUCUTT.js} +2 -2
  42. package/dist/cli/chunks/{chunk-TVYY3OCX.js → chunk-A3DK3XNZ.js} +1 -1
  43. package/dist/cli/chunks/{chunk-RETBYIAC.js → chunk-A5MA7A23.js} +4 -4
  44. package/dist/cli/chunks/{chunk-DUYOVM5I.js → chunk-AEUEMVJK.js} +2 -2
  45. package/dist/cli/chunks/{chunk-6U7LNMWZ.js → chunk-AJUBT4NP.js} +2 -2
  46. package/dist/cli/chunks/{chunk-7CUQCCMD.js → chunk-B2YGVSOP.js} +2 -2
  47. package/dist/cli/chunks/{chunk-SNOBH4AZ.js → chunk-B4I43GE2.js} +2 -2
  48. package/dist/cli/chunks/{chunk-VMNWDJIZ.js → chunk-BD7FEUN3.js} +2 -2
  49. package/dist/cli/chunks/{chunk-HM6ZSCPI.js → chunk-BE4KALTE.js} +1 -1
  50. package/dist/cli/chunks/{chunk-WGM35YWL.js → chunk-BEFTQVEW.js} +2 -2
  51. package/dist/cli/chunks/{chunk-SMDN3BQZ.js → chunk-BLG7SH4A.js} +1 -1
  52. package/dist/cli/chunks/{chunk-AJRUJAAK.js → chunk-C3FXFU2T.js} +1 -1
  53. package/dist/cli/chunks/{chunk-IQO7UCFR.js → chunk-CBONQM5D.js} +2 -2
  54. package/dist/cli/chunks/{chunk-L4RUBPLR.js → chunk-CQNMGK6Y.js} +2 -2
  55. package/dist/cli/chunks/{chunk-NHWGMJAP.js → chunk-CVOQ6ESD.js} +2 -2
  56. package/dist/cli/chunks/{chunk-P6OYS755.js → chunk-DOBKEXMJ.js} +1 -1
  57. package/dist/cli/chunks/{chunk-QZANMBIT.js → chunk-DYTQHRUS.js} +1 -1
  58. package/dist/cli/chunks/{chunk-FZOBD67M.js → chunk-EADSQN5T.js} +1 -1
  59. package/dist/cli/chunks/{chunk-DHVX5UB2.js → chunk-EGOIIUBD.js} +2 -2
  60. package/dist/cli/chunks/{chunk-6OS76PHI.js → chunk-EIGRV3J6.js} +2 -2
  61. package/dist/cli/chunks/{chunk-CD542DNJ.js → chunk-EJ6MMYLK.js} +1 -1
  62. package/dist/cli/chunks/{chunk-ELLBS5RP.js → chunk-ENK44A6Q.js} +2 -2
  63. package/dist/cli/chunks/{chunk-VGFFFKGK.js → chunk-EYXE2XKP.js} +2 -2
  64. package/dist/cli/chunks/{chunk-72KXSMWI.js → chunk-F2OPFVQH.js} +1 -1
  65. package/dist/cli/chunks/{chunk-DK4XN4CU.js → chunk-FBZC4IGB.js} +2 -2
  66. package/dist/cli/chunks/{chunk-MUOG6QXR.js → chunk-FSSR6WBE.js} +2 -2
  67. package/dist/cli/chunks/{chunk-DPYSUDAO.js → chunk-FW4DJ4FJ.js} +1 -1
  68. package/dist/cli/chunks/{chunk-ZVWVV4EX.js → chunk-FYPX5WBJ.js} +1 -1
  69. package/dist/cli/chunks/{chunk-7J6QC567.js → chunk-G367W7XR.js} +3 -3
  70. package/dist/cli/chunks/{chunk-IAF6T27S.js → chunk-GLGKQX2V.js} +2 -2
  71. package/dist/cli/chunks/{chunk-JXGFRBUO.js → chunk-GV4DYPJP.js} +2 -2
  72. package/dist/cli/chunks/{chunk-BPEDWS6O.js → chunk-GVVFTFMB.js} +2 -2
  73. package/dist/cli/chunks/{chunk-CF2ISEOJ.js → chunk-H5RQPO3X.js} +2 -2
  74. package/dist/cli/chunks/{chunk-GSF6MB64.js → chunk-HPWWYT67.js} +2 -2
  75. package/dist/cli/chunks/{chunk-RG52OKAM.js → chunk-HXXHMLJ5.js} +1 -1
  76. package/dist/cli/chunks/{chunk-SESK3ARK.js → chunk-HYFQUWNB.js} +2 -2
  77. package/dist/cli/chunks/{chunk-7D3V65N5.js → chunk-HYOPJHHW.js} +1 -1
  78. package/dist/cli/chunks/{chunk-7LPR6HJG.js → chunk-HZY42OVU.js} +2 -2
  79. package/dist/cli/chunks/{chunk-SDRHUMJB.js → chunk-IAENZ2DR.js} +2 -2
  80. package/dist/cli/chunks/{chunk-B6MOJC3X.js → chunk-IEJ7ZV3M.js} +1 -1
  81. package/dist/cli/chunks/{chunk-UCFQALXO.js → chunk-IWFFO6VT.js} +2 -2
  82. package/dist/cli/chunks/chunk-J7AQZLIH.js +21 -0
  83. package/dist/cli/chunks/{chunk-H52HZ67P.js → chunk-JHJUSSAU.js} +2 -2
  84. package/dist/cli/chunks/{chunk-2YXGBZWV.js → chunk-JOZ47MV6.js} +1 -1
  85. package/dist/cli/chunks/{chunk-EAY2JMZG.js → chunk-JZT7BU44.js} +2 -2
  86. package/dist/cli/chunks/{chunk-BVR7RMC5.js → chunk-KD2BLA5Y.js} +1 -1
  87. package/dist/cli/chunks/{chunk-BAMN2CHI.js → chunk-KUHLTVWC.js} +1 -1
  88. package/dist/cli/chunks/{chunk-5QQSIGUA.js → chunk-LU2EDWQK.js} +2 -2
  89. package/dist/cli/chunks/{chunk-D6CJIGRU.js → chunk-LXZMP3VX.js} +54 -54
  90. package/dist/cli/chunks/{chunk-GPYVDFB3.js → chunk-LY7MFGBD.js} +196 -187
  91. package/dist/cli/chunks/{chunk-W6HXLH5G.js → chunk-MM56VPNE.js} +2 -2
  92. package/dist/cli/chunks/{chunk-E6G2RD5H.js → chunk-MNQN7UZX.js} +2 -2
  93. package/dist/cli/chunks/{chunk-ZCRTRYXK.js → chunk-MQZ53OR3.js} +2 -2
  94. package/dist/cli/chunks/{chunk-3HZS4M3O.js → chunk-MT7UNBZ7.js} +2 -2
  95. package/dist/cli/chunks/{chunk-XAS3XRYM.js → chunk-MZB2UV2O.js} +1 -1
  96. package/dist/cli/chunks/{chunk-GDSXITFH.js → chunk-MZMG6CUJ.js} +2 -2
  97. package/dist/cli/chunks/{chunk-6SQM2MUX.js → chunk-N5XOXPHZ.js} +2 -2
  98. package/dist/cli/chunks/{chunk-5OOMJGFN.js → chunk-NBLDBVAW.js} +1 -1
  99. package/dist/cli/chunks/{chunk-PI7TJS62.js → chunk-ND4QTZOL.js} +2 -2
  100. package/dist/cli/chunks/{chunk-H6ZM3PUT.js → chunk-NHUGHAY6.js} +1 -1
  101. package/dist/cli/chunks/{chunk-5VFPCSK7.js → chunk-NOHWJOBS.js} +1 -1
  102. package/dist/cli/chunks/{chunk-DBDPRORT.js → chunk-O5V7RHVG.js} +2 -2
  103. package/dist/cli/chunks/{chunk-UQ32JHES.js → chunk-O6MO5KMR.js} +2 -2
  104. package/dist/cli/chunks/{chunk-WO4QMXIG.js → chunk-OAZX6WFU.js} +2 -2
  105. package/dist/cli/chunks/{chunk-GGRHV6D7.js → chunk-OEPNNLR4.js} +1 -1
  106. package/dist/cli/chunks/{chunk-AIRGNL55.js → chunk-OIDWDGLG.js} +2 -2
  107. package/dist/cli/chunks/{chunk-V4DM6ELU.js → chunk-ON2UTP2U.js} +2 -2
  108. package/dist/cli/chunks/{chunk-MBRHSU6W.js → chunk-ONR2NXXD.js} +10 -10
  109. package/dist/cli/chunks/{chunk-WCJBU2KI.js → chunk-OXHF3L2T.js} +2 -2
  110. package/dist/cli/chunks/{chunk-AVBJYI5I.js → chunk-OZGIOKEA.js} +1 -1
  111. package/dist/cli/chunks/{chunk-YFBSPLJG.js → chunk-P2UPYSDJ.js} +1 -1
  112. package/dist/cli/chunks/{chunk-C6KWXUFJ.js → chunk-P7XSPP5D.js} +2 -2
  113. package/dist/cli/chunks/{chunk-QDFTT3RF.js → chunk-PCJQCEBA.js} +2 -2
  114. package/dist/cli/chunks/chunk-PELENDDQ.js +2 -0
  115. package/dist/cli/chunks/{chunk-257E2A5M.js → chunk-PYKY22GC.js} +5 -5
  116. package/dist/cli/chunks/{chunk-LL3IGZBI.js → chunk-Q3NSU24F.js} +2 -2
  117. package/dist/cli/chunks/{chunk-Y3LZ35OG.js → chunk-Q6NTEICT.js} +2 -2
  118. package/dist/cli/chunks/chunk-QFETNCNN.js +12 -0
  119. package/dist/cli/chunks/{chunk-SE4WIB26.js → chunk-QGOWNVVG.js} +1 -1
  120. package/dist/cli/chunks/{chunk-6RE3X4V5.js → chunk-QPLSYEWJ.js} +2 -2
  121. package/dist/cli/chunks/{chunk-FWASDOT2.js → chunk-QQFQDEUE.js} +2 -2
  122. package/dist/cli/chunks/{chunk-2JVWITNK.js → chunk-QUORH2MG.js} +55 -79
  123. package/dist/cli/chunks/{chunk-5J6W7SIA.js → chunk-QVH5Y7AP.js} +1 -1
  124. package/dist/cli/chunks/{chunk-YSLL6VSL.js → chunk-RC2A4JZ5.js} +2 -2
  125. package/dist/cli/chunks/{chunk-IB27QACC.js → chunk-RDGPXENG.js} +2 -2
  126. package/dist/cli/chunks/{chunk-PX5YDCRH.js → chunk-RKI3IQKQ.js} +2 -2
  127. package/dist/cli/chunks/{chunk-BMAPORJ7.js → chunk-RKUAWQOF.js} +2 -2
  128. package/dist/cli/chunks/chunk-RLW25X66.js +2 -0
  129. package/dist/cli/chunks/{chunk-RFNPJK6N.js → chunk-ROVZSZCS.js} +3 -3
  130. package/dist/cli/chunks/{chunk-MQROI74N.js → chunk-RT6O2HW2.js} +2 -2
  131. package/dist/cli/chunks/{chunk-Y3UOUNHM.js → chunk-SM2YJ2AL.js} +2 -2
  132. package/dist/cli/chunks/{chunk-BBT64TII.js → chunk-SRPLERER.js} +3 -3
  133. package/dist/cli/chunks/{chunk-YS4FCTWF.js → chunk-T77GZF4B.js} +1 -1
  134. package/dist/cli/chunks/{chunk-IV5UZOHH.js → chunk-TFK2AYIN.js} +2 -2
  135. package/dist/cli/chunks/chunk-TW3SR4TS.js +2 -0
  136. package/dist/cli/chunks/{chunk-7Z5LHRC3.js → chunk-TXSPBLBT.js} +2 -2
  137. package/dist/cli/chunks/chunk-UA7TDVL7.js +12 -0
  138. package/dist/cli/chunks/{chunk-3EZOZN25.js → chunk-UBJG3IHT.js} +2 -2
  139. package/dist/cli/chunks/{chunk-QW6VMTBR.js → chunk-UFSVUBTR.js} +2 -2
  140. package/dist/cli/chunks/{chunk-ZEV3YTO7.js → chunk-UOI6ULCH.js} +2 -2
  141. package/dist/cli/chunks/{chunk-JZOS5FCX.js → chunk-UYUJT6QO.js} +2 -2
  142. package/dist/cli/chunks/{chunk-3EA536JF.js → chunk-V5AK56DA.js} +2 -2
  143. package/dist/cli/chunks/{chunk-UKA2KOXE.js → chunk-V6RE4YRQ.js} +2 -2
  144. package/dist/cli/chunks/{chunk-RZZCUIAI.js → chunk-VW6FRMLW.js} +2 -2
  145. package/dist/cli/chunks/chunk-VXKWNRGA.js +2 -0
  146. package/dist/cli/chunks/{chunk-6SH5VZUD.js → chunk-VYDVI6FZ.js} +2 -2
  147. package/dist/cli/chunks/{chunk-BJTJLJRZ.js → chunk-WF6UISKW.js} +3 -3
  148. package/dist/cli/chunks/{chunk-ZL6SYKUK.js → chunk-WIH522AP.js} +1 -1
  149. package/dist/cli/chunks/{chunk-JIXUMYKZ.js → chunk-WOV6XI3A.js} +1 -1
  150. package/dist/cli/chunks/{chunk-JBTPOIAC.js → chunk-X7ADKL7T.js} +2 -2
  151. package/dist/cli/chunks/{chunk-JVNTSNWU.js → chunk-XBYQ2BS4.js} +2 -2
  152. package/dist/cli/chunks/{chunk-Z7WODOTH.js → chunk-XL5KIYE3.js} +2 -2
  153. package/dist/cli/chunks/{chunk-JMONHE4B.js → chunk-XWYELBZS.js} +1 -1
  154. package/dist/cli/chunks/{chunk-SJUXE4IC.js → chunk-XYLQZWF6.js} +2 -2
  155. package/dist/cli/chunks/{chunk-KNNISEDY.js → chunk-Y6AKKQIQ.js} +1 -1
  156. package/dist/cli/chunks/{chunk-CCK4BF76.js → chunk-YMW57PEL.js} +1 -1
  157. package/dist/cli/chunks/{chunk-64VGZQLB.js → chunk-YO4ESCB4.js} +1 -1
  158. package/dist/cli/chunks/{chunk-ZSPU4MOS.js → chunk-YRHTQZU4.js} +2 -2
  159. package/dist/cli/chunks/chunk-Z4Q5PCRZ.js +65 -0
  160. package/dist/cli/chunks/{chunk-Q5XTSMWR.js → chunk-ZELWDJXT.js} +2 -2
  161. package/dist/cli/chunks/{chunk-SPV2VKC5.js → chunk-ZQZD55MN.js} +2 -2
  162. package/dist/cli/chunks/{chunk-66VWCR67.js → chunk-ZS4XVJGV.js} +2 -2
  163. package/dist/cli/chunks/{chunk-6LIHFV7O.js → chunk-ZUB5YOCM.js} +2 -2
  164. package/dist/cli/chunks/chunk-ZUOVNFXK.js +2 -0
  165. package/dist/cli/chunks/{chunk-7NITCZWD.js → chunk-ZWEKAEEV.js} +1 -1
  166. package/dist/cli/chunks/{ci-W6K6G2KZ.js → ci-J3TDK5RA.js} +8 -8
  167. package/dist/cli/chunks/{ci-output-LDT24TS3.js → ci-output-RLS32FUY.js} +2 -2
  168. package/dist/cli/chunks/{circuit-breaker-F5V4KITU.js → circuit-breaker-MRCC7WCM.js} +2 -2
  169. package/dist/cli/chunks/{claude-flow-setup-DT6WQQVD.js → claude-flow-setup-LIZCEKDF.js} +2 -2
  170. package/dist/cli/chunks/client-3BD2DI4N.js +2 -0
  171. package/dist/cli/chunks/{cline-installer-G7TJOAEX.js → cline-installer-T7H6R2RC.js} +2 -2
  172. package/dist/cli/chunks/{code-PGE6A42V.js → code-XMBLI7OF.js} +3 -3
  173. package/dist/cli/chunks/{code-index-extractor-RNITH372.js → code-index-extractor-QS7BYLEX.js} +2 -2
  174. package/dist/cli/chunks/{codex-installer-LBX77AI3.js → codex-installer-6PGT5FM6.js} +2 -2
  175. package/dist/cli/chunks/{completions-4AWLAARX.js → completions-2A3WRXY2.js} +2 -2
  176. package/dist/cli/chunks/{complexity-analyzer-ZPNSS476.js → complexity-analyzer-23HOOGJ7.js} +2 -2
  177. package/dist/cli/chunks/{continuedev-installer-UAPWX6OA.js → continuedev-installer-4FSF7B3N.js} +2 -2
  178. package/dist/cli/chunks/{copilot-installer-BJN2YJGI.js → copilot-installer-A5GRQQUU.js} +2 -2
  179. package/dist/cli/chunks/core-handlers-C3H2ZCS2.js +2 -0
  180. package/dist/cli/chunks/{cost-tracker-MHP2VJ63.js → cost-tracker-Z4STQ5VB.js} +2 -2
  181. package/dist/cli/chunks/{coverage-PQB4IEFG.js → coverage-NUPP6KZZ.js} +3 -3
  182. package/dist/cli/chunks/cross-domain-router-JCQ7SWDP.js +2 -0
  183. package/dist/cli/chunks/{cursor-installer-ZXBWYAS3.js → cursor-installer-FVJ7ROPJ.js} +2 -2
  184. package/dist/cli/chunks/{daemon-N2BEGEFY.js → daemon-7ZZA2MMN.js} +4 -4
  185. package/dist/cli/chunks/{daemon-64C7R6OJ.js → daemon-D662EX5N.js} +3 -3
  186. package/dist/cli/chunks/{dag-attention-scheduler-SPZDAPNL.js → dag-attention-scheduler-IB4TQ2KA.js} +2 -2
  187. package/dist/cli/chunks/{detect-LXJBSSZW.js → detect-LGLBZN4I.js} +2 -2
  188. package/dist/cli/chunks/{dist-node-U3TKZ2IZ.js → dist-node-Z3OL42YE.js} +2 -2
  189. package/dist/cli/chunks/{domain-handler-3DDWUVSR.js → domain-handler-L3CLNL7U.js} +2 -2
  190. package/dist/cli/chunks/{domain-plugins-JJVWI4OQ.js → domain-plugins-GQ3V5X6L.js} +2 -2
  191. package/dist/cli/chunks/{domain-transfer-M36KUJ2U.js → domain-transfer-MFCI76IY.js} +2 -2
  192. package/dist/cli/chunks/dream-FTP33IJB.js +2 -0
  193. package/dist/cli/chunks/{embed-and-insert-pattern-JPAR7TXX.js → embed-and-insert-pattern-UGD6USYH.js} +2 -2
  194. package/dist/cli/chunks/{eval-SOLG23EA.js → eval-3B7UIYGY.js} +2 -2
  195. package/dist/cli/chunks/{experience-capture-middleware-T7G2VOOD.js → experience-capture-middleware-3RQ4NYY3.js} +3 -3
  196. package/dist/cli/chunks/{fast-paths-32N3ELI4.js → fast-paths-QOSAEPYD.js} +2 -2
  197. package/dist/cli/chunks/{feature-flags-NAHKLDRN.js → feature-flags-3S5TH6P4.js} +2 -2
  198. package/dist/cli/chunks/{feature-flags-APJDQ4N7.js → feature-flags-TLF4NKOH.js} +2 -2
  199. package/dist/cli/chunks/{file-discovery-YKVM3MDB.js → file-discovery-AEVMJRNB.js} +2 -2
  200. package/dist/cli/chunks/{fleet-55M5CJS4.js → fleet-E6WTXWFL.js} +3 -3
  201. package/dist/cli/chunks/{gnn-wrapper-UD6E6S6Z.js → gnn-wrapper-MCKH3AUU.js} +2 -2
  202. package/dist/cli/chunks/{heartbeat-handler-OYVW3VSC.js → heartbeat-handler-U7XENHRR.js} +4 -4
  203. package/dist/cli/chunks/heartbeat-scheduler-HXBJVJL2.js +2 -0
  204. package/dist/cli/chunks/hnsw-adapter-TU6WG2ME.js +2 -0
  205. package/dist/cli/chunks/hnsw-index-MS5KODD7.js +2 -0
  206. package/dist/cli/chunks/{hnsw-legacy-bridge-HBYIS3ZW.js → hnsw-legacy-bridge-5GW4SAEI.js} +2 -2
  207. package/dist/cli/chunks/{hnswlib-node-EQPM42OU.js → hnswlib-node-7BLZBK5T.js} +2 -2
  208. package/dist/cli/chunks/{hooks-5ZSSJWO6.js → hooks-F3O2SB6H.js} +10 -10
  209. package/dist/cli/chunks/hybrid-backend-HT45LBHC.js +2 -0
  210. package/dist/cli/chunks/{hypergraph-engine-XBGVQ4PD.js → hypergraph-engine-PV4EKXHB.js} +2 -2
  211. package/dist/cli/chunks/{hypergraph-handler-CAWAQ673.js → hypergraph-handler-VOWO5ZTW.js} +3 -3
  212. package/dist/cli/chunks/impact-analyzer-AP4AGTG5.js +2 -0
  213. package/dist/cli/chunks/{init-handler-PRHXSARK.js → init-handler-ENJ5ONJX.js} +16 -14
  214. package/dist/cli/chunks/init-wizard-I5DFZUQL.js +2 -0
  215. package/dist/cli/chunks/kernel-MISPSPPA.js +2 -0
  216. package/dist/cli/chunks/{kilocode-installer-F7LXBM7I.js → kilocode-installer-HNNJOOPE.js} +2 -2
  217. package/dist/cli/chunks/{kiro-installer-NM723ZRG.js → kiro-installer-UZBIQ3IC.js} +2 -2
  218. package/dist/cli/chunks/knowledge-graph-L26JESGE.js +2 -0
  219. package/dist/cli/chunks/{learning-5QYIDHH3.js → learning-YMLCVFUT.js} +3 -3
  220. package/dist/cli/chunks/{llm-router-43HKWPSX.js → llm-router-YWTARCCT.js} +4 -4
  221. package/dist/cli/chunks/llm-router-service-MWGC43ZA.js +2 -0
  222. package/dist/cli/chunks/{load-5YDBWSCS.js → load-DKE3F3IP.js} +2 -2
  223. package/dist/cli/chunks/load-test-H5ISNNM5.js +2 -0
  224. package/dist/cli/chunks/{mcp-UMAPMNMY.js → mcp-5PSGIUCW.js} +2 -2
  225. package/dist/cli/chunks/{memory-FWCPCQFP.js → memory-3L3O6JMM.js} +5 -5
  226. package/dist/cli/chunks/memory-backend-HWDNOBKW.js +2 -0
  227. package/dist/cli/chunks/memory-handlers-ZFDVQZM5.js +2 -0
  228. package/dist/cli/chunks/{multi-model-executor-2XTBGLE4.js → multi-model-executor-AEEO7IA4.js} +2 -2
  229. package/dist/cli/chunks/{opencode-installer-GIXOJ6NS.js → opencode-installer-ABBO355U.js} +2 -2
  230. package/dist/cli/chunks/{orchestrator-VW6BKHLI.js → orchestrator-E36Q7MKE.js} +17 -17
  231. package/dist/cli/chunks/pattern-null-store-GQP6ICWK.js +2 -0
  232. package/dist/cli/chunks/{pattern-usage-recorder-7CEUC3J7.js → pattern-usage-recorder-H4XKSID4.js} +2 -2
  233. package/dist/cli/chunks/{pipeline-IGUQPPPO.js → pipeline-BGFEHXIN.js} +2 -2
  234. package/dist/cli/chunks/{platform-2P636I7B.js → platform-GK7ZVDJI.js} +2 -2
  235. package/dist/cli/chunks/{plugin-NY6SWDPE.js → plugin-CAH2CKI6.js} +2 -2
  236. package/dist/cli/chunks/{prime-radiant-advanced-wasm-2UUDTIO2.js → prime-radiant-advanced-wasm-M5EYRONA.js} +2 -2
  237. package/dist/cli/chunks/{project-root-IOISG5KX.js → project-root-BSNZC243.js} +2 -2
  238. package/dist/cli/chunks/protocol-executor-AD5A4DAI.js +2 -0
  239. package/dist/cli/chunks/{protocol-handler-ZTPCRQ5W.js → protocol-handler-JDSSC2SF.js} +2 -2
  240. package/dist/cli/chunks/{prove-SQX5A3IG.js → prove-ANPTOZJE.js} +2 -2
  241. package/dist/cli/chunks/qe-reasoning-bank-W3Z2PKTR.js +2 -0
  242. package/dist/cli/chunks/{quality-DROILKRY.js → quality-SXWGYRQR.js} +2 -2
  243. package/dist/cli/chunks/{quality-gate-PWKWDJY2.js → quality-gate-GYNCA4ZY.js} +3 -3
  244. package/dist/cli/chunks/queen-coordinator-HQRHLIJX.js +2 -0
  245. package/dist/cli/chunks/{real-embeddings-P5U3MGYC.js → real-embeddings-WSRYAOZM.js} +2 -2
  246. package/dist/cli/chunks/{ref-validation-KY73NQXD.js → ref-validation-AZ3LRWEK.js} +2 -2
  247. package/dist/cli/chunks/{roocode-installer-6JPPRB3W.js → roocode-installer-2QKGFIEU.js} +2 -2
  248. package/dist/cli/chunks/router-MTP5LH4H.js +2 -0
  249. package/dist/cli/chunks/routing-feedback-GWETVB4L.js +2 -0
  250. package/dist/cli/chunks/{routing-handler-VTJIVFUO.js → routing-handler-UYDC5MMD.js} +2 -2
  251. package/dist/cli/chunks/{ruvector-commands-C6RPSJJO.js → ruvector-commands-QXADPVEY.js} +2 -2
  252. package/dist/cli/chunks/rvf-dual-writer-4UE5S7WP.js +2 -0
  253. package/dist/cli/chunks/rvf-migration-adapter-PHH3HF4Q.js +2 -0
  254. package/dist/cli/chunks/{rvf-migration-coordinator-R53URRIO.js → rvf-migration-coordinator-GD4NBFKT.js} +2 -2
  255. package/dist/cli/chunks/rvf-native-adapter-KTLZBUWV.js +2 -0
  256. package/dist/cli/chunks/{rvf-store-integrity-MMXN5TEJ.js → rvf-store-integrity-7SXG66IL.js} +2 -2
  257. package/dist/cli/chunks/safe-db-FWWGAPVE.js +2 -0
  258. package/dist/cli/chunks/schedule-TPA4V4D5.js +2 -0
  259. package/dist/cli/chunks/scheduler-5ZTEPNDD.js +2 -0
  260. package/dist/cli/chunks/{security-3B3R2NL4.js → security-YKB622PK.js} +3 -3
  261. package/dist/cli/chunks/{shared-rvf-adapter-VIJB7JUS.js → shared-rvf-adapter-KMLAV7JK.js} +2 -2
  262. package/dist/cli/chunks/{shared-rvf-dual-writer-UVWGDUWC.js → shared-rvf-dual-writer-OYY27DFV.js} +2 -2
  263. package/dist/cli/chunks/sqlite-persistence-HPTT624C.js +2 -0
  264. package/dist/cli/chunks/{standalone-memory-M4LWAAYZ.js → standalone-memory-2DOABVLC.js} +2 -2
  265. package/dist/cli/chunks/{status-handler-YYFV6OZL.js → status-handler-EXRKETV7.js} +2 -2
  266. package/dist/cli/chunks/{structural-health-27E6LLKB.js → structural-health-2SKK6DU6.js} +2 -2
  267. package/dist/cli/chunks/sync-DQ2YUNI6.js +2 -0
  268. package/dist/cli/chunks/{sync-J3LJ56WN.js → sync-UW7SX7GO.js} +2 -2
  269. package/dist/cli/chunks/{task-handler-4MCEBQZL.js → task-handler-LYQ6WYUY.js} +2 -2
  270. package/dist/cli/chunks/task-handlers-DIJO232S.js +9 -0
  271. package/dist/cli/chunks/test-WRHZMUCW.js +33 -0
  272. package/dist/cli/chunks/{test-scheduling-ZJBFRZ3J.js → test-scheduling-HI23RXFK.js} +3 -3
  273. package/dist/cli/chunks/token-bootstrap-23SA6SWZ.js +2 -0
  274. package/dist/cli/chunks/{token-usage-3X5WMTG2.js → token-usage-M7RRDPXO.js} +2 -2
  275. package/dist/cli/chunks/{transformers-MVL4C5IX.js → transformers-4TC35KKS.js} +2 -2
  276. package/dist/cli/chunks/{tree-sitter-wasm-parser-SLW65ZFO.js → tree-sitter-wasm-parser-F4LTKAWD.js} +2 -2
  277. package/dist/cli/chunks/{types-TG5P3CRS.js → types-NBXV6LXQ.js} +2 -2
  278. package/dist/cli/chunks/unified-memory-OVFEPRPS.js +2 -0
  279. package/dist/cli/chunks/unified-memory-hnsw-KKRSCZHR.js +2 -0
  280. package/dist/cli/chunks/unified-persistence-7GLR4RI3.js +2 -0
  281. package/dist/cli/chunks/{upgrade-ETBHDEPY.js → upgrade-4BGOU5RM.js} +2 -2
  282. package/dist/cli/chunks/{validate-C2A73LZK.js → validate-EDWAR63H.js} +2 -2
  283. package/dist/cli/chunks/{validate-swarm-67XN42ML.js → validate-swarm-VI72CPR7.js} +2 -2
  284. package/dist/cli/chunks/visual-security-2FUM5GLI.js +2 -0
  285. package/dist/cli/chunks/{web-tree-sitter-USJN77P4.js → web-tree-sitter-Y5XBRQXF.js} +2 -2
  286. package/dist/cli/chunks/{windsurf-installer-5GGZXGJW.js → windsurf-installer-VEX23WAF.js} +2 -2
  287. package/dist/cli/chunks/{witness-chain-IWS5ZHHL.js → witness-chain-3YNL6YGY.js} +2 -2
  288. package/dist/cli/chunks/witness-chain-MH6GA5L6.js +2 -0
  289. package/dist/cli/chunks/witness-chain-repair-MJZGZRWT.js +2 -0
  290. package/dist/cli/chunks/{witness-chain-verifier-3GEADWPE.js → witness-chain-verifier-TTJYXTBE.js} +2 -2
  291. package/dist/cli/chunks/{witness-key-manager-ZWEIK3VJ.js → witness-key-manager-EM6YXYOY.js} +2 -2
  292. package/dist/cli/chunks/{workflow-KHMVVBBA.js → workflow-2RBDOM7V.js} +4 -4
  293. package/dist/cli/chunks/workflow-orchestrator-H6G65YKU.js +2 -0
  294. package/dist/cli/chunks/wrappers-5OTAVVOV.js +2 -0
  295. package/dist/cli/commands/ci.js +1 -1
  296. package/dist/cli/commands/test.js +18 -3
  297. package/dist/cli/handlers/init-handler.d.ts +2 -0
  298. package/dist/cli/handlers/init-handler.js +8 -2
  299. package/dist/cli/index.js +8 -0
  300. package/dist/coordination/handlers/test-execution-handlers.js +13 -8
  301. package/dist/coordination/index.d.ts +1 -1
  302. package/dist/coordination/queen-event-handlers.js +9 -6
  303. package/dist/coordination/result-saver.js +1 -1
  304. package/dist/coordination/services/index.d.ts +1 -1
  305. package/dist/coordination/services/task-audit-logger.d.ts +38 -13
  306. package/dist/coordination/services/task-audit-logger.js +33 -5
  307. package/dist/coordination/task-executor.d.ts +5 -0
  308. package/dist/coordination/task-executor.js +10 -5
  309. package/dist/domains/test-generation/coordinator.js +6 -5
  310. package/dist/domains/test-generation/interfaces.d.ts +11 -1
  311. package/dist/domains/test-generation/services/behavior-example-validation.d.ts +36 -0
  312. package/dist/domains/test-generation/services/behavior-example-validation.js +89 -0
  313. package/dist/domains/test-generation/services/behavior-examples.d.ts +8 -0
  314. package/dist/domains/test-generation/services/behavior-examples.js +65 -0
  315. package/dist/domains/test-generation/services/test-generator.d.ts +1 -1
  316. package/dist/domains/test-generation/services/test-generator.js +59 -30
  317. package/dist/domains/visual-accessibility/services/axe-core-audit.d.ts +0 -15
  318. package/dist/domains/visual-accessibility/services/axe-core-audit.js +12 -10
  319. package/dist/init/browser-engine-installer.d.ts +5 -5
  320. package/dist/init/browser-engine-installer.js +28 -6
  321. package/dist/init/init-wizard.d.ts +2 -0
  322. package/dist/init/orchestrator.js +1 -0
  323. package/dist/init/phases/09-assets.js +8 -18
  324. package/dist/init/phases/phase-interface.d.ts +2 -0
  325. package/dist/integrations/agentic-flow/reasoning-bank/index.d.ts +2 -5
  326. package/dist/integrations/vibium/client.d.ts +1 -0
  327. package/dist/integrations/vibium/client.js +24 -11
  328. package/dist/integrations/vibium/runtime.d.ts +14 -0
  329. package/dist/integrations/vibium/runtime.js +94 -0
  330. package/dist/kernel/pattern-fts-self-heal.d.ts +63 -0
  331. package/dist/kernel/pattern-fts-self-heal.js +193 -0
  332. package/dist/kernel/process-lifecycle.d.ts +60 -0
  333. package/dist/kernel/process-lifecycle.js +91 -0
  334. package/dist/kernel/unified-memory-schemas.d.ts +15 -1
  335. package/dist/kernel/unified-memory-schemas.js +53 -25
  336. package/dist/kernel/unified-memory.js +31 -34
  337. package/dist/kernel/unified-persistence.js +12 -6
  338. package/dist/learning/experience-capture.d.ts +2 -1
  339. package/dist/learning/experience-capture.js +23 -8
  340. package/dist/learning/pattern-store.d.ts +1 -1
  341. package/dist/learning/pattern-store.js +27 -30
  342. package/dist/learning/qe-patterns.d.ts +6 -0
  343. package/dist/learning/qe-reasoning-bank.d.ts +1 -0
  344. package/dist/learning/qe-reasoning-bank.js +14 -4
  345. package/dist/learning/real-qe-reasoning-bank.d.ts +9 -4
  346. package/dist/learning/real-qe-reasoning-bank.js +28 -4
  347. package/dist/learning/rvf-pattern-store.js +19 -19
  348. package/dist/learning/sqlite-persistence.js +9 -24
  349. package/dist/mcp/bundle.js +508 -545
  350. package/dist/mcp/entry.js +52 -6
  351. package/dist/mcp/handlers/domain-handler-configs.js +12 -4
  352. package/dist/mcp/handlers/task-handlers.js +11 -7
  353. package/dist/mcp/protocol-server.js +18 -3
  354. package/dist/mcp/services/reasoning-bank-service.d.ts +6 -1
  355. package/dist/mcp/services/reasoning-bank-service.js +5 -1
  356. package/dist/mcp/tools/test-execution/e2e-execute.js +9 -1
  357. package/dist/mcp/tools/test-generation/generate.d.ts +6 -1
  358. package/dist/mcp/tools/test-generation/generate.js +8 -0
  359. package/dist/mcp/types.d.ts +6 -2
  360. package/dist/shared/error-utils.d.ts +15 -0
  361. package/dist/shared/error-utils.js +21 -0
  362. package/dist/shared/events/domain-events.d.ts +2 -1
  363. package/package.json +10 -6
  364. package/dist/cli/chunks/adapter-UYOJPTOX.js +0 -2
  365. package/dist/cli/chunks/aqe-learning-engine-JR5AVQXR.js +0 -2
  366. package/dist/cli/chunks/base-DRZ2LS6X.js +0 -2
  367. package/dist/cli/chunks/browser-workflow-CJ7T3MXF.js +0 -2
  368. package/dist/cli/chunks/chunk-4N23RFDU.js +0 -2
  369. package/dist/cli/chunks/chunk-AHKELLIO.js +0 -12
  370. package/dist/cli/chunks/chunk-MJS53PRX.js +0 -2
  371. package/dist/cli/chunks/chunk-PZPWRQ2M.js +0 -21
  372. package/dist/cli/chunks/chunk-QGA55PFM.js +0 -12
  373. package/dist/cli/chunks/chunk-TCHGOB2N.js +0 -2
  374. package/dist/cli/chunks/chunk-Z6GGIRQQ.js +0 -65
  375. package/dist/cli/chunks/client-KHWJT6FB.js +0 -2
  376. package/dist/cli/chunks/core-handlers-HING5RRG.js +0 -2
  377. package/dist/cli/chunks/cross-domain-router-PQTD6AZN.js +0 -2
  378. package/dist/cli/chunks/dream-WUGRSNCV.js +0 -2
  379. package/dist/cli/chunks/heartbeat-scheduler-33XX5XNQ.js +0 -2
  380. package/dist/cli/chunks/hnsw-adapter-XQPERX3H.js +0 -2
  381. package/dist/cli/chunks/hnsw-index-2GNXTWHH.js +0 -2
  382. package/dist/cli/chunks/hybrid-backend-CCF7URKI.js +0 -2
  383. package/dist/cli/chunks/impact-analyzer-HGKAZWIG.js +0 -2
  384. package/dist/cli/chunks/init-wizard-72MFBI3G.js +0 -2
  385. package/dist/cli/chunks/kernel-BRCBVMSK.js +0 -2
  386. package/dist/cli/chunks/knowledge-graph-DG44IPEI.js +0 -2
  387. package/dist/cli/chunks/llm-router-service-24KXFX32.js +0 -2
  388. package/dist/cli/chunks/load-test-N4TAYJY3.js +0 -2
  389. package/dist/cli/chunks/memory-backend-NVYFYVAU.js +0 -2
  390. package/dist/cli/chunks/memory-handlers-UTWCNCHL.js +0 -2
  391. package/dist/cli/chunks/pattern-null-store-SBPNYDBR.js +0 -2
  392. package/dist/cli/chunks/protocol-executor-IBYEII5Q.js +0 -2
  393. package/dist/cli/chunks/qe-reasoning-bank-7IETWW6W.js +0 -2
  394. package/dist/cli/chunks/queen-coordinator-NHUK2MWJ.js +0 -2
  395. package/dist/cli/chunks/router-SRSO3IHF.js +0 -2
  396. package/dist/cli/chunks/routing-feedback-PASRE5HY.js +0 -2
  397. package/dist/cli/chunks/rvf-dual-writer-4M4J67OU.js +0 -2
  398. package/dist/cli/chunks/rvf-migration-adapter-TSXGT5LF.js +0 -2
  399. package/dist/cli/chunks/rvf-native-adapter-MOF3E7BR.js +0 -2
  400. package/dist/cli/chunks/safe-db-QJLFO33B.js +0 -2
  401. package/dist/cli/chunks/schedule-YIVXW5O2.js +0 -2
  402. package/dist/cli/chunks/scheduler-AON7DWSJ.js +0 -2
  403. package/dist/cli/chunks/sqlite-persistence-75VHKKQB.js +0 -2
  404. package/dist/cli/chunks/sync-26CEGSTC.js +0 -2
  405. package/dist/cli/chunks/task-handlers-GYBAWKE2.js +0 -9
  406. package/dist/cli/chunks/test-MPC5HRH5.js +0 -33
  407. package/dist/cli/chunks/token-bootstrap-2Y2XITBX.js +0 -2
  408. package/dist/cli/chunks/unified-memory-UCQ6AB32.js +0 -2
  409. package/dist/cli/chunks/unified-memory-hnsw-IXYUMKRR.js +0 -2
  410. package/dist/cli/chunks/unified-persistence-7E6JQ4FZ.js +0 -2
  411. package/dist/cli/chunks/vibium-NILGKHLN.js +0 -2
  412. package/dist/cli/chunks/visual-security-4VZXPEVG.js +0 -2
  413. package/dist/cli/chunks/witness-chain-JQA2VPZI.js +0 -2
  414. package/dist/cli/chunks/witness-chain-repair-4UA7IPS3.js +0 -2
  415. package/dist/cli/chunks/workflow-orchestrator-GI5NQH7C.js +0 -2
  416. package/dist/cli/chunks/wrappers-N6XIK5PT.js +0 -2
@@ -7,6 +7,7 @@
7
7
  * @module integrations/vibium/client
8
8
  */
9
9
  import { randomUUID } from 'crypto';
10
+ import { loadVibium, isVibiumReady, VIBIUM_SETUP } from './runtime.js';
10
11
  import { DEFAULT_VIBIUM_CONFIG } from './types.js';
11
12
  import { VibiumError, VibiumUnavailableError, VibiumTimeoutError, VibiumElementNotFoundError, VibiumConnectionError, VibiumNavigationError, VibiumScreenshotError, VibiumInteractionError, createVibiumError, } from './errors.js';
12
13
  import { toError } from '../../shared/error-utils.js';
@@ -24,7 +25,7 @@ async function getVibiumBrowser() {
24
25
  return vibiumBrowser;
25
26
  }
26
27
  try {
27
- const vibium = await import('vibium');
28
+ const vibium = await loadVibium();
28
29
  vibiumBrowser = vibium.browser;
29
30
  vibiumAvailable = true;
30
31
  return vibiumBrowser;
@@ -112,6 +113,7 @@ export class VibiumClientImpl {
112
113
  _available = null;
113
114
  // Real Vibium browser instance
114
115
  vibeInstance = null;
116
+ browserInstance = null;
115
117
  /**
116
118
  * Create a new Vibium client
117
119
  *
@@ -133,7 +135,7 @@ export class VibiumClientImpl {
133
135
  try {
134
136
  // Check if Vibium package is available
135
137
  const browser = await getVibiumBrowser();
136
- this._available = browser !== null;
138
+ this._available = browser !== null && isVibiumReady();
137
139
  return this._available;
138
140
  }
139
141
  catch {
@@ -157,7 +159,7 @@ export class VibiumClientImpl {
157
159
  if (isAvailable) {
158
160
  this.lastHealthCheck = {
159
161
  status: this.vibeInstance ? 'connected' : 'disconnected',
160
- version: '0.1.2', // From package.json
162
+ // Runtime availability is checked against the installed payload.
161
163
  browserType: this.config.browserType,
162
164
  features: [
163
165
  'browser-launch',
@@ -177,7 +179,7 @@ export class VibiumClientImpl {
177
179
  status: 'unavailable',
178
180
  features: ['fallback-only'],
179
181
  lastChecked,
180
- error: 'Vibium package not available - install with: npm install vibium',
182
+ error: `Vibium runtime or browser payload unavailable; run ${VIBIUM_SETUP}`,
181
183
  sessionActive: false,
182
184
  };
183
185
  }
@@ -209,13 +211,22 @@ export class VibiumClientImpl {
209
211
  const operation = async () => {
210
212
  const browser = await getVibiumBrowser();
211
213
  if (!browser) {
212
- throw new VibiumUnavailableError('Vibium package not available. Install with: npm install vibium');
214
+ throw new VibiumUnavailableError(`Vibium runtime unavailable; run ${VIBIUM_SETUP}`);
213
215
  }
214
216
  // Launch REAL browser using Vibium
215
217
  const headless = options?.headless ?? this.config.headless;
216
- this.vibeInstance = await browser.launch({
217
- headless,
218
- });
218
+ if (!isVibiumReady()) {
219
+ throw new VibiumUnavailableError(`Vibium browser payload unavailable; run ${VIBIUM_SETUP}`);
220
+ }
221
+ const instance = await browser.start({ headless });
222
+ try {
223
+ this.vibeInstance = await instance.page();
224
+ this.browserInstance = instance;
225
+ }
226
+ catch (error) {
227
+ await instance.stop();
228
+ throw error;
229
+ }
219
230
  const session = {
220
231
  id: this.generateSessionId(),
221
232
  browserType: this.config.browserType,
@@ -247,8 +258,9 @@ export class VibiumClientImpl {
247
258
  }
248
259
  const operation = async () => {
249
260
  if (this.vibeInstance) {
250
- await this.vibeInstance.quit();
261
+ await this.browserInstance?.stop();
251
262
  this.vibeInstance = null;
263
+ this.browserInstance = null;
252
264
  }
253
265
  this.currentSession = null;
254
266
  };
@@ -575,7 +587,7 @@ export class VibiumClientImpl {
575
587
  this.ensureSession();
576
588
  try {
577
589
  // Use real Vibium evaluate method
578
- const result = await this.vibeInstance.evaluate(script);
590
+ const result = await this.vibeInstance.evaluate(`(async () => { ${script} })()`);
579
591
  return { success: true, value: result };
580
592
  }
581
593
  catch (error) {
@@ -608,13 +620,14 @@ export class VibiumClientImpl {
608
620
  async dispose() {
609
621
  if (this.vibeInstance) {
610
622
  try {
611
- await this.vibeInstance.quit();
623
+ await this.browserInstance?.stop();
612
624
  }
613
625
  catch (error) {
614
626
  // Non-critical: Vibium disposal errors
615
627
  console.debug('[VibiumClient] Disposal error:', error instanceof Error ? error.message : error);
616
628
  }
617
629
  this.vibeInstance = null;
630
+ this.browserInstance = null;
618
631
  }
619
632
  this.currentSession = null;
620
633
  this._initialized = false;
@@ -0,0 +1,14 @@
1
+ export declare const VIBIUM_SETUP = "aqe init --browser-engine (or npm install vibium@^26.8.21)";
2
+ type Runtime = typeof import('vibium');
3
+ /**
4
+ * How to run npm without a shell. On Windows `npm` is an `npm.cmd` shim, which
5
+ * execFile cannot start without `shell: true` (EINVAL/ENOENT since the
6
+ * CVE-2024-27980 fix), so run the npm CLI bundled next to node.exe instead.
7
+ * Falls back to plain `npm` when that layout is absent.
8
+ */
9
+ export declare function npmInvocation(platform?: NodeJS.Platform, execPath?: string, exists?: (path: string) => boolean): [string, string[]];
10
+ export declare function loadVibium(): Promise<Runtime>;
11
+ /** Check the payload belonging to the resolved library, not a different PATH CLI. */
12
+ export declare function isVibiumReady(): boolean;
13
+ export {};
14
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1,94 @@
1
+ /** Resolve the opt-in Vibium runtime for both local and global AQE installs. */
2
+ import { createRequire } from 'node:module';
3
+ import { execFileSync } from 'node:child_process';
4
+ import { existsSync } from 'node:fs';
5
+ import { dirname, join } from 'node:path';
6
+ export const VIBIUM_SETUP = 'aqe init --browser-engine (or npm install vibium@^26.8.21)';
7
+ const requireFromHere = createRequire(import.meta.url);
8
+ /**
9
+ * How to run npm without a shell. On Windows `npm` is an `npm.cmd` shim, which
10
+ * execFile cannot start without `shell: true` (EINVAL/ENOENT since the
11
+ * CVE-2024-27980 fix), so run the npm CLI bundled next to node.exe instead.
12
+ * Falls back to plain `npm` when that layout is absent.
13
+ */
14
+ export function npmInvocation(platform = process.platform, execPath = process.execPath, exists = existsSync) {
15
+ if (platform === 'win32') {
16
+ const npmCli = join(dirname(execPath), 'node_modules', 'npm', 'bin', 'npm-cli.js');
17
+ if (exists(npmCli))
18
+ return [execPath, [npmCli]];
19
+ }
20
+ return ['npm', []];
21
+ }
22
+ /** Never install or download anything while probing availability. */
23
+ function resolveRuntime() {
24
+ try {
25
+ return requireFromHere.resolve('vibium');
26
+ }
27
+ catch {
28
+ try {
29
+ return createRequire(join(process.cwd(), 'package.json')).resolve('vibium');
30
+ }
31
+ catch { /* No project-local opt-in runtime. Try global setup below. */ }
32
+ // A global CLI installation is not on Node's normal module search path.
33
+ // npm root is read-only and honors the same npm prefix as explicit setup.
34
+ const [npmBin, npmPrefixArgs] = npmInvocation();
35
+ const root = execFileSync(npmBin, [...npmPrefixArgs, 'root', '-g'], {
36
+ encoding: 'utf8', timeout: 5000, stdio: ['ignore', 'pipe', 'pipe'],
37
+ }).trim();
38
+ return requireFromHere.resolve(join(root, 'vibium'));
39
+ }
40
+ }
41
+ /**
42
+ * Accept the modern API from the namespace itself or from its `default`
43
+ * export. CJS interop and bundler createRequire shims expose the package
44
+ * object only as `default`, so checking the namespace alone rejects a
45
+ * correctly installed runtime.
46
+ */
47
+ function selectBrowserApi(loaded) {
48
+ if (typeof loaded?.browser?.start === 'function')
49
+ return loaded;
50
+ if (typeof loaded?.default?.browser?.start === 'function')
51
+ return loaded.default;
52
+ return null;
53
+ }
54
+ export async function loadVibium() {
55
+ let loaded;
56
+ try {
57
+ loaded = await import('vibium');
58
+ }
59
+ catch (error) {
60
+ // Only a missing local package permits global resolution. A broken local
61
+ // installation must not be silently replaced by an unrelated runtime.
62
+ if (error.code !== 'ERR_MODULE_NOT_FOUND' &&
63
+ error.code !== 'MODULE_NOT_FOUND')
64
+ throw error;
65
+ let entry;
66
+ try {
67
+ entry = resolveRuntime();
68
+ }
69
+ catch (cause) {
70
+ throw new Error(`Vibium is not installed; run ${VIBIUM_SETUP}`, { cause });
71
+ }
72
+ loaded = requireFromHere(entry);
73
+ }
74
+ const runtime = selectBrowserApi(loaded);
75
+ if (!runtime) {
76
+ throw new Error('Unsupported Vibium API: the installed package exposes no browser.start() ' +
77
+ `(neither as a named nor a default export); run ${VIBIUM_SETUP}`);
78
+ }
79
+ return runtime;
80
+ }
81
+ /** Check the payload belonging to the resolved library, not a different PATH CLI. */
82
+ export function isVibiumReady() {
83
+ try {
84
+ const cli = join(dirname(resolveRuntime()), '..', 'bin', 'cli.js');
85
+ execFileSync(process.execPath, [cli, 'is-installed'], {
86
+ timeout: 5000, stdio: 'ignore',
87
+ });
88
+ return true;
89
+ }
90
+ catch {
91
+ return false;
92
+ }
93
+ }
94
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1,63 @@
1
+ /**
2
+ * qe_patterns FTS5 self-heal (runs on every open, not gated on schema version)
3
+ *
4
+ * `qe_patterns_fts` is an FTS5 *external-content* table: it stores only the
5
+ * inverted index, and the three AFTER INSERT/UPDATE/DELETE triggers on
6
+ * qe_patterns are the ONLY thing keeping it in sync. Migration v9 creates them
7
+ * once (`currentVersion < 9`), so a database whose triggers were lost later
8
+ * (older code, a `.recover`, a copy/restore, a manual drop...) never heals:
9
+ * new patterns are invisible to keyword search and deleted ones linger as
10
+ * stale entries that skew BM25. Since hybrid FTS5+vector retrieval (#780/#796)
11
+ * keyword search is part of production ranking, so drift silently degrades
12
+ * retrieval and anything that locates a pattern through FTS.
13
+ *
14
+ * This module detects that state cheaply and repairs it idempotently:
15
+ * 1. qe_patterns exists but qe_patterns_fts doesn't -> create the table
16
+ * 2. any sync trigger missing -> recreate it (shared DDL)
17
+ * 3. a sync trigger whose body differs from the shared DDL -> drop + recreate
18
+ * (CREATE TRIGGER IF NOT EXISTS never replaces a same-named trigger)
19
+ * 4. any of the above OR index rowids != content rowids -> FTS5 'rebuild'
20
+ *
21
+ * Detection is read-only (counts + one anti-join on the docsize PK); the write
22
+ * transaction (BEGIN IMMEDIATE) is taken only when a repair is needed. It never
23
+ * throws: failures are logged and the caller continues (FTS search already
24
+ * degrades to vector-only). Read-only connections are skipped entirely.
25
+ *
26
+ * The 'rebuild' command reconstructs the index from the content table and
27
+ * never modifies qe_patterns rows.
28
+ */
29
+ import type { Database as DatabaseType } from 'better-sqlite3';
30
+ /** Names of the triggers that keep qe_patterns_fts in sync. */
31
+ export declare const QE_PATTERNS_FTS_TRIGGERS: string[];
32
+ export type PatternFtsHealStatus = 'healthy' | 'healed' | 'no-patterns' | 'readonly' | 'failed';
33
+ export interface PatternFtsHealResult {
34
+ status: PatternFtsHealStatus;
35
+ /** True when qe_patterns_fts had to be created. */
36
+ createdTable: boolean;
37
+ /** Triggers that were missing and have been recreated. */
38
+ recreatedTriggers: string[];
39
+ /** Triggers whose body differed from the shared DDL and have been replaced. */
40
+ replacedTriggers: string[];
41
+ /** True when the FTS5 'rebuild' command ran. */
42
+ rebuilt: boolean;
43
+ /** qe_patterns row count observed before repair (-1 if unknown). */
44
+ patternsBefore: number;
45
+ /** Indexed document count before repair (-1 if unknown / no table). */
46
+ indexedBefore: number;
47
+ /** Indexed document count after repair (-1 if not repaired). */
48
+ indexedAfter: number;
49
+ error?: string;
50
+ }
51
+ export interface PatternFtsHealOptions {
52
+ /** Log sink for the single heal/failure line. Defaults to console.warn. */
53
+ log?: (message: string) => void;
54
+ /** Prefix for the log line, e.g. "[UnifiedMemory]". */
55
+ logPrefix?: string;
56
+ }
57
+ /**
58
+ * Ensure qe_patterns_fts exists, has its three sync triggers, and indexes
59
+ * exactly the rows of qe_patterns. Idempotent and silent when healthy; logs
60
+ * one line when it repairs something; never throws.
61
+ */
62
+ export declare function ensurePatternFtsInSync(db: DatabaseType, options?: PatternFtsHealOptions): PatternFtsHealResult;
63
+ //# sourceMappingURL=pattern-fts-self-heal.d.ts.map
@@ -0,0 +1,193 @@
1
+ /**
2
+ * qe_patterns FTS5 self-heal (runs on every open, not gated on schema version)
3
+ *
4
+ * `qe_patterns_fts` is an FTS5 *external-content* table: it stores only the
5
+ * inverted index, and the three AFTER INSERT/UPDATE/DELETE triggers on
6
+ * qe_patterns are the ONLY thing keeping it in sync. Migration v9 creates them
7
+ * once (`currentVersion < 9`), so a database whose triggers were lost later
8
+ * (older code, a `.recover`, a copy/restore, a manual drop...) never heals:
9
+ * new patterns are invisible to keyword search and deleted ones linger as
10
+ * stale entries that skew BM25. Since hybrid FTS5+vector retrieval (#780/#796)
11
+ * keyword search is part of production ranking, so drift silently degrades
12
+ * retrieval and anything that locates a pattern through FTS.
13
+ *
14
+ * This module detects that state cheaply and repairs it idempotently:
15
+ * 1. qe_patterns exists but qe_patterns_fts doesn't -> create the table
16
+ * 2. any sync trigger missing -> recreate it (shared DDL)
17
+ * 3. a sync trigger whose body differs from the shared DDL -> drop + recreate
18
+ * (CREATE TRIGGER IF NOT EXISTS never replaces a same-named trigger)
19
+ * 4. any of the above OR index rowids != content rowids -> FTS5 'rebuild'
20
+ *
21
+ * Detection is read-only (counts + one anti-join on the docsize PK); the write
22
+ * transaction (BEGIN IMMEDIATE) is taken only when a repair is needed. It never
23
+ * throws: failures are logged and the caller continues (FTS search already
24
+ * degrades to vector-only). Read-only connections are skipped entirely.
25
+ *
26
+ * The 'rebuild' command reconstructs the index from the content table and
27
+ * never modifies qe_patterns rows.
28
+ */
29
+ import { toErrorMessage } from '../shared/error-utils.js';
30
+ import { QE_PATTERNS_FTS_TABLE_DDL, QE_PATTERNS_FTS_TRIGGER_DDL, } from './unified-memory-schemas.js';
31
+ /** Names of the triggers that keep qe_patterns_fts in sync. */
32
+ export const QE_PATTERNS_FTS_TRIGGERS = Object.keys(QE_PATTERNS_FTS_TRIGGER_DDL);
33
+ function objectExists(db, type, name) {
34
+ return db.prepare('SELECT 1 FROM sqlite_master WHERE type = ? AND name = ?').get(type, name) !== undefined;
35
+ }
36
+ /**
37
+ * Canonical form of a CREATE TRIGGER statement for comparison: sqlite_master
38
+ * stores the text as written minus IF NOT EXISTS, and older code paths used
39
+ * different indentation, so collapse whitespace and drop the clause/semicolon.
40
+ */
41
+ function normalizeTriggerSql(sql) {
42
+ return sql
43
+ .replace(/\s+/g, ' ')
44
+ .trim()
45
+ .replace(/^CREATE TRIGGER IF NOT EXISTS /i, 'CREATE TRIGGER ')
46
+ .replace(/ ?;$/, '')
47
+ .toLowerCase();
48
+ }
49
+ const CANONICAL_TRIGGER_SQL = Object.freeze(Object.fromEntries(Object.entries(QE_PATTERNS_FTS_TRIGGER_DDL).map(([name, ddl]) => [name, normalizeTriggerSql(ddl)])));
50
+ function count(db, sql) {
51
+ const row = db.prepare(sql).get();
52
+ return row?.n ?? 0;
53
+ }
54
+ /**
55
+ * Read-only inspection. `qe_patterns_fts_docsize` holds exactly one row per
56
+ * indexed document (id = content rowid; columnsize defaults to on), so
57
+ * comparing it with qe_patterns detects both unindexed and stale entries
58
+ * without scanning the index itself. `SELECT count(*) FROM qe_patterns_fts`
59
+ * is NOT usable: for an external-content table it reads the content table.
60
+ */
61
+ function inspect(db) {
62
+ const hasTable = objectExists(db, 'table', 'qe_patterns_fts');
63
+ const hasDocsize = hasTable && objectExists(db, 'table', 'qe_patterns_fts_docsize');
64
+ const missingTriggers = [];
65
+ const mismatchedTriggers = [];
66
+ const triggerSql = db.prepare("SELECT sql FROM sqlite_master WHERE type = 'trigger' AND name = ?");
67
+ for (const name of QE_PATTERNS_FTS_TRIGGERS) {
68
+ const row = triggerSql.get(name);
69
+ if (row === undefined)
70
+ missingTriggers.push(name);
71
+ else if (normalizeTriggerSql(row.sql ?? '') !== CANONICAL_TRIGGER_SQL[name])
72
+ mismatchedTriggers.push(name);
73
+ }
74
+ const patterns = count(db, 'SELECT count(*) AS n FROM qe_patterns');
75
+ const indexed = hasDocsize ? count(db, 'SELECT count(*) AS n FROM qe_patterns_fts_docsize') : -1;
76
+ // Equal counts + every content rowid indexed => identical rowid sets (both
77
+ // sides are unique), so one anti-join over the docsize PK suffices.
78
+ const unindexed = hasDocsize && indexed === patterns
79
+ ? count(db, `SELECT count(*) AS n FROM qe_patterns p
80
+ WHERE NOT EXISTS (SELECT 1 FROM qe_patterns_fts_docsize d WHERE d.id = p.rowid)`)
81
+ : 0;
82
+ return { hasTable, hasDocsize, missingTriggers, mismatchedTriggers, patterns, indexed, unindexed };
83
+ }
84
+ function needsRepair(s) {
85
+ if (!s.hasTable || s.missingTriggers.length > 0 || s.mismatchedTriggers.length > 0)
86
+ return true;
87
+ // Without a docsize table (non-default FTS options) drift can't be measured
88
+ // cheaply; trust the triggers rather than rebuilding on every open.
89
+ if (!s.hasDocsize)
90
+ return false;
91
+ return s.indexed !== s.patterns || s.unindexed > 0;
92
+ }
93
+ function isReadOnly(db) {
94
+ if (db.readonly)
95
+ return true;
96
+ try {
97
+ return Number(db.pragma('query_only', { simple: true })) === 1;
98
+ }
99
+ catch {
100
+ return false;
101
+ }
102
+ }
103
+ /**
104
+ * Ensure qe_patterns_fts exists, has its three sync triggers, and indexes
105
+ * exactly the rows of qe_patterns. Idempotent and silent when healthy; logs
106
+ * one line when it repairs something; never throws.
107
+ */
108
+ export function ensurePatternFtsInSync(db, options = {}) {
109
+ const log = options.log ?? ((m) => console.warn(m));
110
+ const prefix = options.logPrefix ?? '[PatternFTS]';
111
+ const result = {
112
+ status: 'healthy',
113
+ createdTable: false,
114
+ recreatedTriggers: [],
115
+ replacedTriggers: [],
116
+ rebuilt: false,
117
+ patternsBefore: -1,
118
+ indexedBefore: -1,
119
+ indexedAfter: -1,
120
+ };
121
+ try {
122
+ if (!objectExists(db, 'table', 'qe_patterns')) {
123
+ result.status = 'no-patterns';
124
+ return result;
125
+ }
126
+ if (isReadOnly(db)) {
127
+ result.status = 'readonly';
128
+ return result;
129
+ }
130
+ const before = inspect(db);
131
+ result.patternsBefore = before.patterns;
132
+ result.indexedBefore = before.indexed;
133
+ if (!needsRepair(before))
134
+ return result;
135
+ // Re-inspect inside BEGIN IMMEDIATE so a concurrent opener that already
136
+ // healed (or is mid-write) is observed under the write lock. Results are
137
+ // only published after COMMIT succeeds: a failed commit rolls everything
138
+ // back and must not be reported as a repair.
139
+ const repaired = db.transaction(() => {
140
+ const s = inspect(db);
141
+ if (!needsRepair(s))
142
+ return null;
143
+ if (!s.hasTable)
144
+ db.exec(QE_PATTERNS_FTS_TABLE_DDL);
145
+ for (const name of s.missingTriggers)
146
+ db.exec(QE_PATTERNS_FTS_TRIGGER_DDL[name]);
147
+ for (const name of s.mismatchedTriggers) {
148
+ db.exec(`DROP TRIGGER IF EXISTS ${name}`);
149
+ db.exec(QE_PATTERNS_FTS_TRIGGER_DDL[name]);
150
+ }
151
+ // Rebuild from the content table: clears stale entries and indexes rows
152
+ // inserted/updated while triggers were absent. Never touches qe_patterns.
153
+ db.exec("INSERT INTO qe_patterns_fts(qe_patterns_fts) VALUES('rebuild')");
154
+ return { s, indexedAfter: count(db, 'SELECT count(*) AS n FROM qe_patterns_fts_docsize') };
155
+ }).immediate();
156
+ if (repaired) {
157
+ const { s } = repaired;
158
+ result.createdTable = !s.hasTable;
159
+ result.recreatedTriggers = [...s.missingTriggers];
160
+ result.replacedTriggers = [...s.mismatchedTriggers];
161
+ result.patternsBefore = s.patterns;
162
+ result.indexedBefore = s.indexed;
163
+ result.indexedAfter = repaired.indexedAfter;
164
+ result.rebuilt = true;
165
+ }
166
+ if (result.rebuilt) {
167
+ result.status = 'healed';
168
+ const parts = [];
169
+ if (result.createdTable)
170
+ parts.push('created qe_patterns_fts');
171
+ if (result.recreatedTriggers.length > 0) {
172
+ parts.push(`recreated triggers [${result.recreatedTriggers.join(', ')}]`);
173
+ }
174
+ if (result.replacedTriggers.length > 0) {
175
+ parts.push(`replaced triggers [${result.replacedTriggers.join(', ')}]`);
176
+ }
177
+ const indexedBefore = result.indexedBefore < 0 ? 'n/a' : String(result.indexedBefore);
178
+ parts.push(`rebuilt index (indexed ${indexedBefore} -> ${result.indexedAfter}, qe_patterns ${result.patternsBefore})`);
179
+ log(`${prefix} Healed qe_patterns FTS5 index: ${parts.join('; ')}`);
180
+ }
181
+ return result;
182
+ }
183
+ catch (error) {
184
+ result.status = 'failed';
185
+ result.error = toErrorMessage(error);
186
+ try {
187
+ log(`${prefix} qe_patterns FTS5 self-heal skipped: ${result.error} (keyword search may be degraded; vector search unaffected)`);
188
+ }
189
+ catch { /* logging must never break open */ }
190
+ return result;
191
+ }
192
+ }
193
+ //# sourceMappingURL=pattern-fts-self-heal.js.map
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Agentic QE v3 - Process lifecycle ownership (#801)
3
+ *
4
+ * A long-running entry point (the MCP server) owns process shutdown: before it
5
+ * exits it must drain in-flight work and release native handles. The shared
6
+ * patterns RVF adapter, for example, holds a `patterns.rvf.lock` marker that
7
+ * only its own close() removes.
8
+ *
9
+ * Module-level signal handlers elsewhere (the kernel stores, the CLI wrapper)
10
+ * used to call `process.exit(0)` synchronously. Node runs signal listeners one
11
+ * after another in the same tick, so that exit pre-empted the owner's async
12
+ * graceful shutdown and leaked the marker. Those handlers now route the
13
+ * request to the claimed owner and do not exit themselves.
14
+ *
15
+ * With no owner claimed (every non-MCP CLI command), nothing changes and
16
+ * callers keep their own exit behaviour.
17
+ *
18
+ * The owner lives on `globalThis` under a registry symbol because `aqe mcp`
19
+ * loads the MCP bundle into the CLI bundle's process. Each bundle has its own
20
+ * copy of this module, and both copies must see the same owner.
21
+ */
22
+ export interface ProcessLifecycleOwner {
23
+ /** Diagnostic name, e.g. `mcp`. */
24
+ readonly name: string;
25
+ /**
26
+ * Start the owner's graceful shutdown. Must be idempotent, must not throw,
27
+ * and must eventually exit the process (e.g. guarded by a watchdog). Before
28
+ * exiting, on every path, it must call `closeRegisteredStores()`.
29
+ */
30
+ shutdown(reason: string): void;
31
+ }
32
+ /**
33
+ * Register a synchronous, idempotent close for a process-wide store (the
34
+ * kernel's unified memory/persistence singletons). A claimed owner closes
35
+ * every registered store at the end of its shutdown, so stores are closed on
36
+ * every termination path, not only the signal ones. Returns an unregister
37
+ * function. Shared across bundle copies through the registry symbol.
38
+ */
39
+ export declare function registerStoreCloser(close: () => void): () => void;
40
+ /**
41
+ * Close every registered store, most recently registered first (a facade is
42
+ * registered after the store it wraps, so it closes first). Synchronous so it
43
+ * also works from a process 'exit' listener; never throws. Closers must be
44
+ * idempotent: this may run from both the shutdown and an exit backstop.
45
+ */
46
+ export declare function closeRegisteredStores(): void;
47
+ /** Make `owner` responsible for every graceful shutdown in this process. */
48
+ export declare function claimProcessLifecycle(owner: ProcessLifecycleOwner): void;
49
+ /** Remove the current owner (only if it is still `owner`, when given). Test seam. */
50
+ export declare function releaseProcessLifecycle(owner?: ProcessLifecycleOwner): void;
51
+ export declare function getProcessLifecycleOwner(): ProcessLifecycleOwner | undefined;
52
+ /**
53
+ * Hand a termination request to the claimed owner.
54
+ *
55
+ * Returns true when an owner accepted it: the caller must then NOT exit the
56
+ * process itself. Returns false when no owner is claimed: the caller keeps its
57
+ * own behaviour.
58
+ */
59
+ export declare function requestOwnedShutdown(reason: string): boolean;
60
+ //# sourceMappingURL=process-lifecycle.d.ts.map
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Agentic QE v3 - Process lifecycle ownership (#801)
3
+ *
4
+ * A long-running entry point (the MCP server) owns process shutdown: before it
5
+ * exits it must drain in-flight work and release native handles. The shared
6
+ * patterns RVF adapter, for example, holds a `patterns.rvf.lock` marker that
7
+ * only its own close() removes.
8
+ *
9
+ * Module-level signal handlers elsewhere (the kernel stores, the CLI wrapper)
10
+ * used to call `process.exit(0)` synchronously. Node runs signal listeners one
11
+ * after another in the same tick, so that exit pre-empted the owner's async
12
+ * graceful shutdown and leaked the marker. Those handlers now route the
13
+ * request to the claimed owner and do not exit themselves.
14
+ *
15
+ * With no owner claimed (every non-MCP CLI command), nothing changes and
16
+ * callers keep their own exit behaviour.
17
+ *
18
+ * The owner lives on `globalThis` under a registry symbol because `aqe mcp`
19
+ * loads the MCP bundle into the CLI bundle's process. Each bundle has its own
20
+ * copy of this module, and both copies must see the same owner.
21
+ */
22
+ const OWNER_KEY = Symbol.for('agentic-qe.process-lifecycle-owner');
23
+ const CLOSERS_KEY = Symbol.for('agentic-qe.process-lifecycle-store-closers');
24
+ function closers() {
25
+ const g = globalThis;
26
+ return (g[CLOSERS_KEY] ??= []);
27
+ }
28
+ /**
29
+ * Register a synchronous, idempotent close for a process-wide store (the
30
+ * kernel's unified memory/persistence singletons). A claimed owner closes
31
+ * every registered store at the end of its shutdown, so stores are closed on
32
+ * every termination path, not only the signal ones. Returns an unregister
33
+ * function. Shared across bundle copies through the registry symbol.
34
+ */
35
+ export function registerStoreCloser(close) {
36
+ closers().push(close);
37
+ return () => {
38
+ const list = closers();
39
+ const at = list.indexOf(close);
40
+ if (at >= 0)
41
+ list.splice(at, 1);
42
+ };
43
+ }
44
+ /**
45
+ * Close every registered store, most recently registered first (a facade is
46
+ * registered after the store it wraps, so it closes first). Synchronous so it
47
+ * also works from a process 'exit' listener; never throws. Closers must be
48
+ * idempotent: this may run from both the shutdown and an exit backstop.
49
+ */
50
+ export function closeRegisteredStores() {
51
+ for (const close of [...closers()].reverse()) {
52
+ try {
53
+ close();
54
+ }
55
+ catch { /* best effort: keep closing the rest */ }
56
+ }
57
+ }
58
+ /** Make `owner` responsible for every graceful shutdown in this process. */
59
+ export function claimProcessLifecycle(owner) {
60
+ globalThis[OWNER_KEY] = owner;
61
+ }
62
+ /** Remove the current owner (only if it is still `owner`, when given). Test seam. */
63
+ export function releaseProcessLifecycle(owner) {
64
+ const g = globalThis;
65
+ if (!owner || g[OWNER_KEY] === owner)
66
+ delete g[OWNER_KEY];
67
+ }
68
+ export function getProcessLifecycleOwner() {
69
+ return globalThis[OWNER_KEY];
70
+ }
71
+ /**
72
+ * Hand a termination request to the claimed owner.
73
+ *
74
+ * Returns true when an owner accepted it: the caller must then NOT exit the
75
+ * process itself. Returns false when no owner is claimed: the caller keeps its
76
+ * own behaviour.
77
+ */
78
+ export function requestOwnedShutdown(reason) {
79
+ const owner = getProcessLifecycleOwner();
80
+ if (!owner)
81
+ return false;
82
+ try {
83
+ owner.shutdown(reason);
84
+ return true;
85
+ }
86
+ catch {
87
+ // A broken owner must not leave the process running: let the caller exit.
88
+ return false;
89
+ }
90
+ }
91
+ //# sourceMappingURL=process-lifecycle.js.map