agentic-qe 3.14.6 → 3.14.8

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 (467) hide show
  1. package/.claude/helpers/.helpers-version +1 -1
  2. package/.claude/helpers/auto-memory-hook.mjs +18 -9
  3. package/.claude/helpers/helpers.manifest.json +6 -5
  4. package/.claude/helpers/hook-handler.cjs +40 -12
  5. package/.claude/helpers/memory.cjs +86 -0
  6. package/.claude/helpers/router.cjs +105 -0
  7. package/.claude/helpers/session.cjs +166 -0
  8. package/.claude/helpers/statusline.cjs +73 -621
  9. package/.claude/skills/skills-manifest.json +1 -1
  10. package/CHANGELOG.md +204 -0
  11. package/assets/skills/skills-manifest.json +1 -1
  12. package/dist/adapters/a2a/notifications/retry-queue.js +5 -0
  13. package/dist/adapters/claude-flow/pretrain-bridge.js +3 -2
  14. package/dist/agents/claim-verifier/verifiers/file-verifier.js +3 -2
  15. package/dist/cli/bundle.js +8 -8
  16. package/dist/cli/chunks/adapter-XYCOXQCC.js +2 -0
  17. package/dist/cli/chunks/{agent-booster-wasm-2YGML6OU.js → agent-booster-wasm-67OKGDGZ.js} +2 -2
  18. package/dist/cli/chunks/{agent-handler-D5SSQYNU.js → agent-handler-4HZEQ3WQ.js} +2 -2
  19. package/dist/cli/chunks/{agent-memory-branch-YHPLTITV.js → agent-memory-branch-IBHZQSRN.js} +2 -2
  20. package/dist/cli/chunks/aqe-learning-engine-DTJCROTG.js +2 -0
  21. package/dist/cli/chunks/{arena-7BGOXGXO.js → arena-EJBIGSF4.js} +2 -2
  22. package/dist/cli/chunks/{arena-MCE6EU7K.js → arena-LCLRGUIK.js} +4 -4
  23. package/dist/cli/chunks/{audit-BMWTQECB.js → audit-PY4JNDQQ.js} +3 -3
  24. package/dist/cli/chunks/base-5TQ34GMD.js +2 -0
  25. package/dist/cli/chunks/{better-sqlite3-PMUNGASU.js → better-sqlite3-2JG5K6XT.js} +2 -2
  26. package/dist/cli/chunks/{brain-handler-QPUFYX7F.js → brain-handler-3UYK55GA.js} +4 -4
  27. package/dist/cli/chunks/{branch-enumerator-WKFDGRN4.js → branch-enumerator-GOSWOX46.js} +2 -2
  28. package/dist/cli/chunks/{browser-VY5HKH5X.js → browser-DC2JV47Z.js} +2 -2
  29. package/dist/cli/chunks/browser-workflow-KWX4ESTJ.js +2 -0
  30. package/dist/cli/chunks/{chunk-FWASDOT2.js → chunk-25EEIAHS.js} +2 -2
  31. package/dist/cli/chunks/{chunk-P6OYS755.js → chunk-3576QGPP.js} +1 -1
  32. package/dist/cli/chunks/{chunk-2TMWAQQ3.js → chunk-3EKG7HFV.js} +4 -4
  33. package/dist/cli/chunks/{chunk-QZANMBIT.js → chunk-3FCHH4VP.js} +1 -1
  34. package/dist/cli/chunks/{chunk-CD542DNJ.js → chunk-3S5IIK32.js} +1 -1
  35. package/dist/cli/chunks/{chunk-5VFPCSK7.js → chunk-3X2JSW3R.js} +1 -1
  36. package/dist/cli/chunks/{chunk-D45SG6CP.js → chunk-4HXFPBAA.js} +1 -1
  37. package/dist/cli/chunks/{chunk-JVNTSNWU.js → chunk-4PY44TKH.js} +2 -2
  38. package/dist/cli/chunks/{chunk-DZ3AUAAB.js → chunk-4RNCVSVN.js} +2 -2
  39. package/dist/cli/chunks/{chunk-JBTPOIAC.js → chunk-56M4QNXU.js} +2 -2
  40. package/dist/cli/chunks/{chunk-H52HZ67P.js → chunk-5X4HDW5W.js} +2 -2
  41. package/dist/cli/chunks/{chunk-UNFFDHER.js → chunk-673XJBGW.js} +10 -32
  42. package/dist/cli/chunks/{chunk-RTFO5UQH.js → chunk-6F7MFHTY.js} +2 -2
  43. package/dist/cli/chunks/{chunk-Y3LZ35OG.js → chunk-6GJWT2OY.js} +2 -2
  44. package/dist/cli/chunks/{chunk-JXGFRBUO.js → chunk-6GNWVPMR.js} +2 -2
  45. package/dist/cli/chunks/{chunk-3EA536JF.js → chunk-6VTC3OHD.js} +2 -2
  46. package/dist/cli/chunks/{chunk-W6HXLH5G.js → chunk-775WGWLL.js} +3 -3
  47. package/dist/cli/chunks/{chunk-TVYY3OCX.js → chunk-77WL5HQW.js} +1 -1
  48. package/dist/cli/chunks/chunk-7STWD4KJ.js +3 -0
  49. package/dist/cli/chunks/{chunk-YSLL6VSL.js → chunk-7TNCEVWX.js} +2 -2
  50. package/dist/cli/chunks/{chunk-Z7WODOTH.js → chunk-7X3LMTRA.js} +2 -2
  51. package/dist/cli/chunks/{chunk-RZZCUIAI.js → chunk-A53MMSGC.js} +2 -2
  52. package/dist/cli/chunks/{chunk-QW6VMTBR.js → chunk-A5CLVZC3.js} +2 -2
  53. package/dist/cli/chunks/{chunk-IG5GNEC6.js → chunk-AEYJ4ZLA.js} +1 -1
  54. package/dist/cli/chunks/{chunk-NMAIY4PX.js → chunk-AJ5PCJQ2.js} +11 -11
  55. package/dist/cli/chunks/{chunk-WO4QMXIG.js → chunk-AJMAKUS3.js} +2 -2
  56. package/dist/cli/chunks/{chunk-2NPKIBAZ.js → chunk-AOD2ES44.js} +2 -2
  57. package/dist/cli/chunks/chunk-AR2S4DOB.js +2 -0
  58. package/dist/cli/chunks/{chunk-257E2A5M.js → chunk-AUFV2G2J.js} +5 -5
  59. package/dist/cli/chunks/{chunk-BVR7RMC5.js → chunk-B2QKBQYD.js} +1 -1
  60. package/dist/cli/chunks/{chunk-B6D2CHEH.js → chunk-BCCSV3RH.js} +1 -1
  61. package/dist/cli/chunks/{chunk-2YXGBZWV.js → chunk-BFIXUKOR.js} +1 -1
  62. package/dist/cli/chunks/chunk-BHPTHC5O.js +4 -0
  63. package/dist/cli/chunks/{chunk-AIRGNL55.js → chunk-BITFGVZ4.js} +2 -2
  64. package/dist/cli/chunks/{chunk-MBRHSU6W.js → chunk-BL6273KR.js} +10 -10
  65. package/dist/cli/chunks/{chunk-SMDN3BQZ.js → chunk-BOIUENWW.js} +1 -1
  66. package/dist/cli/chunks/{chunk-YS4FCTWF.js → chunk-BT3MI2BW.js} +1 -1
  67. package/dist/cli/chunks/{chunk-JZOS5FCX.js → chunk-BTBJ2NLH.js} +2 -2
  68. package/dist/cli/chunks/{chunk-CCK4BF76.js → chunk-BUVJIVFG.js} +1 -1
  69. package/dist/cli/chunks/{chunk-2JVWITNK.js → chunk-BZIPW2PA.js} +56 -80
  70. package/dist/cli/chunks/{chunk-BPEDWS6O.js → chunk-C647D42G.js} +2 -2
  71. package/dist/cli/chunks/{chunk-6U7LNMWZ.js → chunk-CBWM5NOO.js} +3 -3
  72. package/dist/cli/chunks/{chunk-72KXSMWI.js → chunk-CIEXUYY7.js} +1 -1
  73. package/dist/cli/chunks/{chunk-SE4WIB26.js → chunk-CLUHGBLN.js} +4 -4
  74. package/dist/cli/chunks/{chunk-JIXUMYKZ.js → chunk-CQEWL32R.js} +1 -1
  75. package/dist/cli/chunks/{chunk-CM7U6TAX.js → chunk-CXUC7YKA.js} +2 -2
  76. package/dist/cli/chunks/{chunk-7LPR6HJG.js → chunk-D2Y36V5J.js} +2 -2
  77. package/dist/cli/chunks/{chunk-BJTJLJRZ.js → chunk-DSJJHPPS.js} +4 -4
  78. package/dist/cli/chunks/{chunk-ZVWVV4EX.js → chunk-DZHXCOSK.js} +1 -1
  79. package/dist/cli/chunks/{chunk-7Z5LHRC3.js → chunk-EBV3WFIR.js} +2 -2
  80. package/dist/cli/chunks/{chunk-KNNISEDY.js → chunk-EKO5QL2B.js} +1 -1
  81. package/dist/cli/chunks/{chunk-XAS3XRYM.js → chunk-EMOZ5O5S.js} +1 -1
  82. package/dist/cli/chunks/{chunk-62N4NUJH.js → chunk-ES7TAJRJ.js} +2 -2
  83. package/dist/cli/chunks/chunk-EXQGHTPD.js +65 -0
  84. package/dist/cli/chunks/{chunk-Q7EAGKAE.js → chunk-F2WAB4WK.js} +2 -2
  85. package/dist/cli/chunks/{chunk-L4RUBPLR.js → chunk-F57FTFWS.js} +2 -2
  86. package/dist/cli/chunks/{chunk-GGRHV6D7.js → chunk-F6JJNBE5.js} +1 -1
  87. package/dist/cli/chunks/{chunk-3EZOZN25.js → chunk-FRC7AFB4.js} +2 -2
  88. package/dist/cli/chunks/{chunk-RSXXCL4A.js → chunk-G36RZF2Y.js} +1 -1
  89. package/dist/cli/chunks/{chunk-ZSPU4MOS.js → chunk-G3C7Z6FO.js} +2 -2
  90. package/dist/cli/chunks/{chunk-SNOBH4AZ.js → chunk-GA63ESNT.js} +2 -2
  91. package/dist/cli/chunks/{chunk-HNFVJP4I.js → chunk-GHMJFICO.js} +2 -2
  92. package/dist/cli/chunks/{chunk-7D3V65N5.js → chunk-GK5WLUX3.js} +1 -1
  93. package/dist/cli/chunks/{chunk-RETBYIAC.js → chunk-GQJ4QDEN.js} +6 -6
  94. package/dist/cli/chunks/chunk-GVLRE3BV.js +12 -0
  95. package/dist/cli/chunks/{chunk-MW2GGZZ5.js → chunk-H5UH234L.js} +1 -1
  96. package/dist/cli/chunks/{chunk-HM6ZSCPI.js → chunk-HBAFXWSO.js} +1 -1
  97. package/dist/cli/chunks/{chunk-DHVX5UB2.js → chunk-HE3BDBAO.js} +2 -2
  98. package/dist/cli/chunks/{chunk-YFBSPLJG.js → chunk-HHANMCD2.js} +1 -1
  99. package/dist/cli/chunks/chunk-HPVYJ6JH.js +2 -0
  100. package/dist/cli/chunks/{chunk-PX5YDCRH.js → chunk-I6NZFBT3.js} +3 -3
  101. package/dist/cli/chunks/{chunk-5J6W7SIA.js → chunk-ISBOHF6Y.js} +1 -1
  102. package/dist/cli/chunks/{chunk-UCFQALXO.js → chunk-J24AJEDE.js} +2 -2
  103. package/dist/cli/chunks/{chunk-FBMN7B46.js → chunk-J5HTQHJK.js} +2 -2
  104. package/dist/cli/chunks/{chunk-GPYVDFB3.js → chunk-JDOVO4E4.js} +205 -195
  105. package/dist/cli/chunks/chunk-JQAJUXRE.js +2 -0
  106. package/dist/cli/chunks/{chunk-RG52OKAM.js → chunk-JRK5GX56.js} +1 -1
  107. package/dist/cli/chunks/{chunk-I33ERSGB.js → chunk-JRLZ7LZ3.js} +2 -2
  108. package/dist/cli/chunks/{chunk-NQZ5AR3D.js → chunk-JTOFLDU7.js} +2 -2
  109. package/dist/cli/chunks/{chunk-NHWGMJAP.js → chunk-K6EOHGKS.js} +2 -2
  110. package/dist/cli/chunks/{chunk-5QQSIGUA.js → chunk-KKXH25IH.js} +2 -2
  111. package/dist/cli/chunks/{chunk-VGFFFKGK.js → chunk-KNSQWM2E.js} +2 -2
  112. package/dist/cli/chunks/{chunk-B6MOJC3X.js → chunk-L5T32SRF.js} +1 -1
  113. package/dist/cli/chunks/{chunk-WGM35YWL.js → chunk-LKFBW2QM.js} +2 -2
  114. package/dist/cli/chunks/{chunk-AJRUJAAK.js → chunk-LMAI74EP.js} +1 -1
  115. package/dist/cli/chunks/{chunk-C6KWXUFJ.js → chunk-LQVS5IWH.js} +2 -2
  116. package/dist/cli/chunks/{chunk-H5BS5VH7.js → chunk-LRGTPUJA.js} +2 -2
  117. package/dist/cli/chunks/{chunk-3HZS4M3O.js → chunk-LTHV4PIG.js} +2 -2
  118. package/dist/cli/chunks/{chunk-7CUQCCMD.js → chunk-M7QKCHLQ.js} +2 -2
  119. package/dist/cli/chunks/{chunk-CF2ISEOJ.js → chunk-N3ASALOL.js} +2 -2
  120. package/dist/cli/chunks/{chunk-ZCRTRYXK.js → chunk-NEXBTLN6.js} +2 -2
  121. package/dist/cli/chunks/{chunk-VMNWDJIZ.js → chunk-NJEEKYEP.js} +3 -3
  122. package/dist/cli/chunks/{chunk-ZEV3YTO7.js → chunk-NWUFTLSF.js} +2 -2
  123. package/dist/cli/chunks/{chunk-MQROI74N.js → chunk-O4QB2GFL.js} +2 -2
  124. package/dist/cli/chunks/{chunk-GDSXITFH.js → chunk-OA75C4HY.js} +2 -2
  125. package/dist/cli/chunks/{chunk-SESK3ARK.js → chunk-OVMG6EEF.js} +2 -2
  126. package/dist/cli/chunks/{chunk-MUOG6QXR.js → chunk-OX7MJFLC.js} +2 -2
  127. package/dist/cli/chunks/{chunk-ELLBS5RP.js → chunk-OZJQN7YE.js} +2 -2
  128. package/dist/cli/chunks/{chunk-D6CJIGRU.js → chunk-PFXCRRR6.js} +55 -55
  129. package/dist/cli/chunks/{chunk-ZL6SYKUK.js → chunk-PVJLQ2YZ.js} +1 -1
  130. package/dist/cli/chunks/{chunk-6LIHFV7O.js → chunk-QDRFLM77.js} +2 -2
  131. package/dist/cli/chunks/{chunk-H6ZM3PUT.js → chunk-QH7C4PTX.js} +1 -1
  132. package/dist/cli/chunks/chunk-QKM4XT2F.js +2 -0
  133. package/dist/cli/chunks/{chunk-V4DM6ELU.js → chunk-QP7EKLWU.js} +2 -2
  134. package/dist/cli/chunks/{chunk-BAMN2CHI.js → chunk-QPACHVDI.js} +1 -1
  135. package/dist/cli/chunks/{chunk-QDFTT3RF.js → chunk-QQVE65ER.js} +2 -2
  136. package/dist/cli/chunks/{chunk-LL3IGZBI.js → chunk-QYCZYJH7.js} +2 -2
  137. package/dist/cli/chunks/{chunk-DUYOVM5I.js → chunk-R6I5I724.js} +2 -2
  138. package/dist/cli/chunks/{chunk-ENGZ4D5V.js → chunk-RJJIPTVH.js} +2 -2
  139. package/dist/cli/chunks/{chunk-7NITCZWD.js → chunk-RM6OC35G.js} +1 -1
  140. package/dist/cli/chunks/{chunk-Q5XTSMWR.js → chunk-RTD4U7IW.js} +2 -2
  141. package/dist/cli/chunks/{chunk-DBDPRORT.js → chunk-SKJQKOFJ.js} +2 -2
  142. package/dist/cli/chunks/{chunk-ICTXTNQZ.js → chunk-SMBGK7XI.js} +1 -1
  143. package/dist/cli/chunks/{chunk-PI7TJS62.js → chunk-SPS472C5.js} +2 -2
  144. package/dist/cli/chunks/{chunk-IV5UZOHH.js → chunk-SUNXA2UR.js} +2 -2
  145. package/dist/cli/chunks/{chunk-IB27QACC.js → chunk-SVP3BP52.js} +2 -2
  146. package/dist/cli/chunks/{chunk-5OOMJGFN.js → chunk-T4WQPE77.js} +1 -1
  147. package/dist/cli/chunks/{chunk-66VWCR67.js → chunk-T53ZN4NO.js} +2 -2
  148. package/dist/cli/chunks/chunk-T6W2EYHC.js +2 -0
  149. package/dist/cli/chunks/{chunk-EAY2JMZG.js → chunk-T7YCNOW5.js} +2 -2
  150. package/dist/cli/chunks/{chunk-FZOBD67M.js → chunk-TCQWVVSR.js} +1 -1
  151. package/dist/cli/chunks/{chunk-SJUXE4IC.js → chunk-TGRHO4ES.js} +2 -2
  152. package/dist/cli/chunks/{chunk-6RE3X4V5.js → chunk-TP7L4EX6.js} +2 -2
  153. package/dist/cli/chunks/{chunk-6SQM2MUX.js → chunk-TT45RCLN.js} +2 -2
  154. package/dist/cli/chunks/{chunk-AVBJYI5I.js → chunk-TUZNWRYC.js} +1 -1
  155. package/dist/cli/chunks/{chunk-YHKEDEAA.js → chunk-U2QTL5T2.js} +3 -3
  156. package/dist/cli/chunks/chunk-U64QORFO.js +2 -0
  157. package/dist/cli/chunks/{chunk-BBT64TII.js → chunk-UHLZKH6B.js} +4 -4
  158. package/dist/cli/chunks/{chunk-GSF6MB64.js → chunk-UIWXKRTK.js} +2 -2
  159. package/dist/cli/chunks/{chunk-JMONHE4B.js → chunk-UNFE4RPV.js} +1 -1
  160. package/dist/cli/chunks/{chunk-DPYSUDAO.js → chunk-UQGIC5OX.js} +1 -1
  161. package/dist/cli/chunks/{chunk-IAF6T27S.js → chunk-VAXTPLO3.js} +2 -2
  162. package/dist/cli/chunks/{chunk-6SH5VZUD.js → chunk-VCSNNLWL.js} +2 -2
  163. package/dist/cli/chunks/chunk-VSPNIDQK.js +21 -0
  164. package/dist/cli/chunks/{chunk-6OS76PHI.js → chunk-VV2JVYOI.js} +2 -2
  165. package/dist/cli/chunks/{chunk-IQO7UCFR.js → chunk-VW7AXJQS.js} +2 -2
  166. package/dist/cli/chunks/{chunk-UQ32JHES.js → chunk-W7JUD4EZ.js} +2 -2
  167. package/dist/cli/chunks/chunk-WFKE7NZ5.js +12 -0
  168. package/dist/cli/chunks/{chunk-RFNPJK6N.js → chunk-WVEHKAIH.js} +3 -3
  169. package/dist/cli/chunks/{chunk-64VGZQLB.js → chunk-XAESN54Q.js} +1 -1
  170. package/dist/cli/chunks/{chunk-BMAPORJ7.js → chunk-XECZYQT5.js} +2 -2
  171. package/dist/cli/chunks/chunk-XFT4FYTC.js +2 -0
  172. package/dist/cli/chunks/{chunk-Y3UOUNHM.js → chunk-YHX74M7C.js} +2 -2
  173. package/dist/cli/chunks/chunk-YIWBJ637.js +2 -0
  174. package/dist/cli/chunks/{chunk-SDRHUMJB.js → chunk-Z5UZOYQS.js} +2 -2
  175. package/dist/cli/chunks/{chunk-7J6QC567.js → chunk-Z6G3QVZ4.js} +12 -12
  176. package/dist/cli/chunks/ci-5LIV2HW5.js +82 -0
  177. package/dist/cli/chunks/{ci-output-LDT24TS3.js → ci-output-UO5BDFU4.js} +2 -2
  178. package/dist/cli/chunks/{circuit-breaker-F5V4KITU.js → circuit-breaker-UQDPXYRD.js} +2 -2
  179. package/dist/cli/chunks/{claude-flow-setup-DT6WQQVD.js → claude-flow-setup-62QES3QX.js} +2 -2
  180. package/dist/cli/chunks/client-AJZKCP4I.js +2 -0
  181. package/dist/cli/chunks/{cline-installer-G7TJOAEX.js → cline-installer-X7VZTSZG.js} +2 -2
  182. package/dist/cli/chunks/{code-PGE6A42V.js → code-H3BF4L4H.js} +3 -3
  183. package/dist/cli/chunks/{code-index-extractor-RNITH372.js → code-index-extractor-BJGFZGGL.js} +2 -2
  184. package/dist/cli/chunks/{codex-installer-LBX77AI3.js → codex-installer-KVZWKU6S.js} +2 -2
  185. package/dist/cli/chunks/{completions-4AWLAARX.js → completions-YMILE6V7.js} +2 -2
  186. package/dist/cli/chunks/{complexity-analyzer-ZPNSS476.js → complexity-analyzer-J26N2PWG.js} +2 -2
  187. package/dist/cli/chunks/{continuedev-installer-UAPWX6OA.js → continuedev-installer-MAR42OV7.js} +2 -2
  188. package/dist/cli/chunks/{copilot-installer-BJN2YJGI.js → copilot-installer-CVOJF6OT.js} +2 -2
  189. package/dist/cli/chunks/core-handlers-MQHEMGDV.js +2 -0
  190. package/dist/cli/chunks/{cost-tracker-MHP2VJ63.js → cost-tracker-SXLWXE55.js} +2 -2
  191. package/dist/cli/chunks/{coverage-PQB4IEFG.js → coverage-D7HCHFP3.js} +3 -3
  192. package/dist/cli/chunks/cross-domain-router-3QNMZV5R.js +2 -0
  193. package/dist/cli/chunks/{cursor-installer-ZXBWYAS3.js → cursor-installer-X37VHIKW.js} +2 -2
  194. package/dist/cli/chunks/{daemon-64C7R6OJ.js → daemon-JN7SOH6F.js} +4 -4
  195. package/dist/cli/chunks/{daemon-N2BEGEFY.js → daemon-LIW47IDM.js} +4 -4
  196. package/dist/cli/chunks/{dag-attention-scheduler-SPZDAPNL.js → dag-attention-scheduler-QCHHIZBT.js} +2 -2
  197. package/dist/cli/chunks/{detect-LXJBSSZW.js → detect-WRFCWAX5.js} +2 -2
  198. package/dist/cli/chunks/{dist-node-U3TKZ2IZ.js → dist-node-6FWT4XZO.js} +2 -2
  199. package/dist/cli/chunks/{domain-handler-3DDWUVSR.js → domain-handler-SNFPNMRT.js} +2 -2
  200. package/dist/cli/chunks/{domain-plugins-JJVWI4OQ.js → domain-plugins-MXKHH62P.js} +2 -2
  201. package/dist/cli/chunks/domain-transfer-47UJNERX.js +2 -0
  202. package/dist/cli/chunks/dream-OSWAITPT.js +2 -0
  203. package/dist/cli/chunks/{embed-and-insert-pattern-JPAR7TXX.js → embed-and-insert-pattern-LZFAUNBQ.js} +2 -2
  204. package/dist/cli/chunks/{eval-SOLG23EA.js → eval-AMUXTMJB.js} +2 -2
  205. package/dist/cli/chunks/{experience-capture-middleware-T7G2VOOD.js → experience-capture-middleware-3D65TR2C.js} +4 -4
  206. package/dist/cli/chunks/{fast-paths-32N3ELI4.js → fast-paths-Y7BBMM56.js} +2 -2
  207. package/dist/cli/chunks/{feature-flags-APJDQ4N7.js → feature-flags-JMQQ7JW4.js} +2 -2
  208. package/dist/cli/chunks/{feature-flags-NAHKLDRN.js → feature-flags-VESRRQ6V.js} +2 -2
  209. package/dist/cli/chunks/{file-discovery-YKVM3MDB.js → file-discovery-JJKQQUV6.js} +2 -2
  210. package/dist/cli/chunks/{fleet-55M5CJS4.js → fleet-WIGHICJF.js} +4 -4
  211. package/dist/cli/chunks/{gnn-wrapper-UD6E6S6Z.js → gnn-wrapper-BFNPETTT.js} +2 -2
  212. package/dist/cli/chunks/{heartbeat-handler-OYVW3VSC.js → heartbeat-handler-HDXKTGUI.js} +4 -4
  213. package/dist/cli/chunks/heartbeat-scheduler-BVRVVIE2.js +2 -0
  214. package/dist/cli/chunks/hnsw-adapter-MZTHXULS.js +2 -0
  215. package/dist/cli/chunks/hnsw-index-KHEX4VDG.js +2 -0
  216. package/dist/cli/chunks/{hnsw-legacy-bridge-HBYIS3ZW.js → hnsw-legacy-bridge-6A7OTAPT.js} +2 -2
  217. package/dist/cli/chunks/{hnswlib-node-EQPM42OU.js → hnswlib-node-LKV2H47B.js} +2 -2
  218. package/dist/cli/chunks/{hooks-5ZSSJWO6.js → hooks-KDSFYQQG.js} +10 -10
  219. package/dist/cli/chunks/hybrid-backend-2B3LCLR4.js +2 -0
  220. package/dist/cli/chunks/{hypergraph-engine-XBGVQ4PD.js → hypergraph-engine-GDLPEPUC.js} +2 -2
  221. package/dist/cli/chunks/{hypergraph-handler-CAWAQ673.js → hypergraph-handler-4UMFA2EW.js} +3 -3
  222. package/dist/cli/chunks/impact-analyzer-4R4VWOGQ.js +2 -0
  223. package/dist/cli/chunks/{init-handler-PRHXSARK.js → init-handler-4GCHPQHD.js} +16 -14
  224. package/dist/cli/chunks/init-wizard-TAOPXHHD.js +2 -0
  225. package/dist/cli/chunks/kernel-6I6VZUWY.js +2 -0
  226. package/dist/cli/chunks/{kilocode-installer-F7LXBM7I.js → kilocode-installer-HJZMT2G5.js} +2 -2
  227. package/dist/cli/chunks/{kiro-installer-NM723ZRG.js → kiro-installer-WUPY67HG.js} +2 -2
  228. package/dist/cli/chunks/knowledge-graph-KFMTTUR5.js +2 -0
  229. package/dist/cli/chunks/{learning-5QYIDHH3.js → learning-AXKIS7IG.js} +4 -4
  230. package/dist/cli/chunks/{llm-router-43HKWPSX.js → llm-router-HUDPNZLJ.js} +4 -4
  231. package/dist/cli/chunks/llm-router-service-2D74XVM3.js +2 -0
  232. package/dist/cli/chunks/{load-5YDBWSCS.js → load-RM44POD7.js} +2 -2
  233. package/dist/cli/chunks/load-test-53FWOWNS.js +2 -0
  234. package/dist/cli/chunks/{mcp-UMAPMNMY.js → mcp-5JVQRBOP.js} +2 -2
  235. package/dist/cli/chunks/{memory-FWCPCQFP.js → memory-VGZ2V6PL.js} +5 -5
  236. package/dist/cli/chunks/memory-backend-KFJDDPEZ.js +2 -0
  237. package/dist/cli/chunks/memory-handlers-EI537Z32.js +2 -0
  238. package/dist/cli/chunks/{multi-model-executor-2XTBGLE4.js → multi-model-executor-WPRKCSCM.js} +2 -2
  239. package/dist/cli/chunks/{opencode-installer-GIXOJ6NS.js → opencode-installer-YAJMRCQO.js} +2 -2
  240. package/dist/cli/chunks/{orchestrator-VW6BKHLI.js → orchestrator-MUGWBUYP.js} +17 -17
  241. package/dist/cli/chunks/pattern-null-store-7DMU5CJ4.js +2 -0
  242. package/dist/cli/chunks/{pattern-usage-recorder-7CEUC3J7.js → pattern-usage-recorder-ZQJJ2YNG.js} +2 -2
  243. package/dist/cli/chunks/{pipeline-IGUQPPPO.js → pipeline-F4DXDUDC.js} +2 -2
  244. package/dist/cli/chunks/{platform-2P636I7B.js → platform-HI3A3OWF.js} +2 -2
  245. package/dist/cli/chunks/{plugin-NY6SWDPE.js → plugin-XRITPTR7.js} +2 -2
  246. package/dist/cli/chunks/{prime-radiant-advanced-wasm-2UUDTIO2.js → prime-radiant-advanced-wasm-HHNJP7CQ.js} +2 -2
  247. package/dist/cli/chunks/{project-root-IOISG5KX.js → project-root-2VN4WO2A.js} +2 -2
  248. package/dist/cli/chunks/protocol-executor-2EMTBTMG.js +2 -0
  249. package/dist/cli/chunks/{protocol-handler-ZTPCRQ5W.js → protocol-handler-ZEVHSEBG.js} +2 -2
  250. package/dist/cli/chunks/{prove-SQX5A3IG.js → prove-C4BLZWBS.js} +2 -2
  251. package/dist/cli/chunks/qe-reasoning-bank-VZHZZPHE.js +2 -0
  252. package/dist/cli/chunks/{quality-DROILKRY.js → quality-M3DTE4KK.js} +2 -2
  253. package/dist/cli/chunks/quality-gate-V6KS7ML3.js +7 -0
  254. package/dist/cli/chunks/queen-coordinator-7MYTTUHI.js +2 -0
  255. package/dist/cli/chunks/{real-embeddings-P5U3MGYC.js → real-embeddings-YWSE3IRT.js} +2 -2
  256. package/dist/cli/chunks/{ref-validation-KY73NQXD.js → ref-validation-ZWOTFA3T.js} +2 -2
  257. package/dist/cli/chunks/{roocode-installer-6JPPRB3W.js → roocode-installer-GJBIWETD.js} +2 -2
  258. package/dist/cli/chunks/router-ZD4LXAWA.js +2 -0
  259. package/dist/cli/chunks/routing-feedback-FSLMDVGD.js +2 -0
  260. package/dist/cli/chunks/{routing-handler-VTJIVFUO.js → routing-handler-CFYLGNAR.js} +2 -2
  261. package/dist/cli/chunks/{ruvector-commands-C6RPSJJO.js → ruvector-commands-EDKG456B.js} +2 -2
  262. package/dist/cli/chunks/rvf-dual-writer-LTKTDRFS.js +2 -0
  263. package/dist/cli/chunks/rvf-migration-adapter-IF24EVC5.js +2 -0
  264. package/dist/cli/chunks/{rvf-migration-coordinator-R53URRIO.js → rvf-migration-coordinator-ZMEYMAI6.js} +2 -2
  265. package/dist/cli/chunks/rvf-native-adapter-E6JNBKMZ.js +2 -0
  266. package/dist/cli/chunks/{rvf-store-integrity-MMXN5TEJ.js → rvf-store-integrity-AH6PNJP6.js} +2 -2
  267. package/dist/cli/chunks/safe-db-F6TRB5KZ.js +2 -0
  268. package/dist/cli/chunks/schedule-HBD4BYTE.js +2 -0
  269. package/dist/cli/chunks/scheduler-6FYWPMQC.js +2 -0
  270. package/dist/cli/chunks/{security-3B3R2NL4.js → security-ZU2GW3ZM.js} +3 -3
  271. package/dist/cli/chunks/{shared-rvf-adapter-VIJB7JUS.js → shared-rvf-adapter-5FOVSL3T.js} +2 -2
  272. package/dist/cli/chunks/{shared-rvf-dual-writer-UVWGDUWC.js → shared-rvf-dual-writer-IO4DC4XV.js} +2 -2
  273. package/dist/cli/chunks/sqlite-persistence-DOU72F5Z.js +2 -0
  274. package/dist/cli/chunks/{standalone-memory-M4LWAAYZ.js → standalone-memory-3UXDZ7HI.js} +2 -2
  275. package/dist/cli/chunks/{status-handler-YYFV6OZL.js → status-handler-264CHTWS.js} +2 -2
  276. package/dist/cli/chunks/{structural-health-27E6LLKB.js → structural-health-E2QPUOZE.js} +2 -2
  277. package/dist/cli/chunks/{sync-J3LJ56WN.js → sync-2ACMWM7D.js} +2 -2
  278. package/dist/cli/chunks/sync-N2L2OST4.js +2 -0
  279. package/dist/cli/chunks/{task-handler-4MCEBQZL.js → task-handler-IB5CVOTY.js} +2 -2
  280. package/dist/cli/chunks/task-handlers-QBMYNJHE.js +9 -0
  281. package/dist/cli/chunks/test-7RGLRDSP.js +33 -0
  282. package/dist/cli/chunks/{test-scheduling-ZJBFRZ3J.js → test-scheduling-RJABJT2W.js} +3 -3
  283. package/dist/cli/chunks/token-bootstrap-JVHMHB72.js +2 -0
  284. package/dist/cli/chunks/{token-usage-3X5WMTG2.js → token-usage-3ECHQVCY.js} +2 -2
  285. package/dist/cli/chunks/{transformers-MVL4C5IX.js → transformers-KJH3IJWI.js} +2 -2
  286. package/dist/cli/chunks/{tree-sitter-wasm-parser-SLW65ZFO.js → tree-sitter-wasm-parser-XN6PFI32.js} +2 -2
  287. package/dist/cli/chunks/{types-TG5P3CRS.js → types-5BAPXOLS.js} +2 -2
  288. package/dist/cli/chunks/unified-memory-GHAYAXWZ.js +2 -0
  289. package/dist/cli/chunks/unified-memory-hnsw-CCC63YXT.js +2 -0
  290. package/dist/cli/chunks/unified-persistence-HKRHI5PG.js +2 -0
  291. package/dist/cli/chunks/{upgrade-ETBHDEPY.js → upgrade-S5NFQZID.js} +2 -2
  292. package/dist/cli/chunks/{validate-C2A73LZK.js → validate-BIBWOLJD.js} +2 -2
  293. package/dist/cli/chunks/{validate-swarm-67XN42ML.js → validate-swarm-WAA3LBHH.js} +2 -2
  294. package/dist/cli/chunks/visual-security-APOXJ3Q3.js +2 -0
  295. package/dist/cli/chunks/{web-tree-sitter-USJN77P4.js → web-tree-sitter-OTBQTHAV.js} +2 -2
  296. package/dist/cli/chunks/{windsurf-installer-5GGZXGJW.js → windsurf-installer-NNQ22EW6.js} +2 -2
  297. package/dist/cli/chunks/witness-chain-7IP5IJGT.js +2 -0
  298. package/dist/cli/chunks/{witness-chain-IWS5ZHHL.js → witness-chain-E7MUBOJW.js} +2 -2
  299. package/dist/cli/chunks/witness-chain-repair-FW4QSN4C.js +2 -0
  300. package/dist/cli/chunks/{witness-chain-verifier-3GEADWPE.js → witness-chain-verifier-YMROEBVL.js} +2 -2
  301. package/dist/cli/chunks/{witness-key-manager-ZWEIK3VJ.js → witness-key-manager-4CGRNDMJ.js} +2 -2
  302. package/dist/cli/chunks/{workflow-KHMVVBBA.js → workflow-4VRSTRAN.js} +4 -4
  303. package/dist/cli/chunks/workflow-orchestrator-2HNW5ZMQ.js +2 -0
  304. package/dist/cli/chunks/wrappers-4M4UTGEU.js +2 -0
  305. package/dist/cli/commands/ci.js +18 -7
  306. package/dist/cli/commands/quality-gate.js +6 -1
  307. package/dist/cli/commands/test.js +18 -3
  308. package/dist/cli/handlers/init-handler.d.ts +2 -0
  309. package/dist/cli/handlers/init-handler.js +8 -2
  310. package/dist/cli/index.js +15 -2
  311. package/dist/cli/process-store-cleanup.d.ts +7 -0
  312. package/dist/cli/process-store-cleanup.js +27 -0
  313. package/dist/cli/utils/ci-config.d.ts +3 -3
  314. package/dist/cli/utils/ci-config.js +202 -68
  315. package/dist/coordination/handlers/test-execution-handlers.js +13 -8
  316. package/dist/coordination/index.d.ts +1 -1
  317. package/dist/coordination/queen-event-handlers.js +9 -6
  318. package/dist/coordination/result-saver.js +1 -1
  319. package/dist/coordination/services/index.d.ts +1 -1
  320. package/dist/coordination/services/task-audit-logger.d.ts +38 -13
  321. package/dist/coordination/services/task-audit-logger.js +33 -5
  322. package/dist/coordination/task-executor.d.ts +5 -0
  323. package/dist/coordination/task-executor.js +10 -5
  324. package/dist/domains/quality-assessment/quality-evidence.d.ts +3 -1
  325. package/dist/domains/quality-assessment/quality-evidence.js +7 -2
  326. package/dist/domains/test-execution/services/retry-handler.js +32 -13
  327. package/dist/domains/test-execution/services/test-executor.d.ts +3 -3
  328. package/dist/domains/test-execution/services/test-executor.js +66 -22
  329. package/dist/domains/test-generation/coordinator.js +6 -5
  330. package/dist/domains/test-generation/interfaces.d.ts +11 -1
  331. package/dist/domains/test-generation/services/behavior-example-validation.d.ts +36 -0
  332. package/dist/domains/test-generation/services/behavior-example-validation.js +89 -0
  333. package/dist/domains/test-generation/services/behavior-examples.d.ts +8 -0
  334. package/dist/domains/test-generation/services/behavior-examples.js +65 -0
  335. package/dist/domains/test-generation/services/test-generator.d.ts +1 -1
  336. package/dist/domains/test-generation/services/test-generator.js +59 -30
  337. package/dist/domains/visual-accessibility/services/axe-core-audit.d.ts +0 -15
  338. package/dist/domains/visual-accessibility/services/axe-core-audit.js +12 -10
  339. package/dist/init/browser-engine-installer.d.ts +5 -5
  340. package/dist/init/browser-engine-installer.js +28 -6
  341. package/dist/init/fleet-integration.js +3 -2
  342. package/dist/init/init-wizard-steps.js +3 -2
  343. package/dist/init/init-wizard.d.ts +2 -0
  344. package/dist/init/orchestrator.js +1 -0
  345. package/dist/init/phases/06-code-intelligence.js +6 -4
  346. package/dist/init/phases/09-assets.js +8 -18
  347. package/dist/init/phases/phase-interface.d.ts +2 -0
  348. package/dist/integrations/agentic-flow/reasoning-bank/index.d.ts +2 -5
  349. package/dist/integrations/ruvector/sona-persistence.d.ts +1 -0
  350. package/dist/integrations/ruvector/sona-persistence.js +74 -20
  351. package/dist/integrations/ruvector/sona-wrapper.d.ts +2 -0
  352. package/dist/integrations/ruvector/sona-wrapper.js +13 -0
  353. package/dist/integrations/vibium/client.d.ts +1 -0
  354. package/dist/integrations/vibium/client.js +24 -11
  355. package/dist/integrations/vibium/runtime.d.ts +14 -0
  356. package/dist/integrations/vibium/runtime.js +94 -0
  357. package/dist/kernel/memory-backend.js +5 -4
  358. package/dist/kernel/pattern-fts-self-heal.d.ts +63 -0
  359. package/dist/kernel/pattern-fts-self-heal.js +193 -0
  360. package/dist/kernel/process-lifecycle.d.ts +60 -0
  361. package/dist/kernel/process-lifecycle.js +91 -0
  362. package/dist/kernel/unified-memory-schemas.d.ts +15 -1
  363. package/dist/kernel/unified-memory-schemas.js +53 -25
  364. package/dist/kernel/unified-memory.js +34 -36
  365. package/dist/kernel/unified-persistence.js +12 -6
  366. package/dist/learning/aqe-learning-engine.js +3 -2
  367. package/dist/learning/experience-capture.d.ts +2 -1
  368. package/dist/learning/experience-capture.js +23 -8
  369. package/dist/learning/pattern-store.d.ts +1 -1
  370. package/dist/learning/pattern-store.js +27 -30
  371. package/dist/learning/qe-patterns.d.ts +6 -0
  372. package/dist/learning/qe-reasoning-bank.d.ts +1 -0
  373. package/dist/learning/qe-reasoning-bank.js +14 -4
  374. package/dist/learning/real-qe-reasoning-bank.d.ts +9 -4
  375. package/dist/learning/real-qe-reasoning-bank.js +28 -4
  376. package/dist/learning/rvf-pattern-store.js +19 -19
  377. package/dist/learning/sqlite-persistence.js +9 -24
  378. package/dist/mcp/bundle.js +545 -581
  379. package/dist/mcp/connection-pool.d.ts +2 -0
  380. package/dist/mcp/connection-pool.js +13 -2
  381. package/dist/mcp/entry.js +52 -6
  382. package/dist/mcp/handlers/domain-handler-configs.js +12 -4
  383. package/dist/mcp/handlers/memory-handlers.d.ts +1 -0
  384. package/dist/mcp/handlers/memory-handlers.js +16 -6
  385. package/dist/mcp/handlers/task-handlers.js +11 -7
  386. package/dist/mcp/protocol-server.js +47 -11
  387. package/dist/mcp/services/reasoning-bank-service.d.ts +6 -1
  388. package/dist/mcp/services/reasoning-bank-service.js +5 -1
  389. package/dist/mcp/tools/test-execution/e2e-execute.js +9 -1
  390. package/dist/mcp/tools/test-generation/generate.d.ts +6 -1
  391. package/dist/mcp/tools/test-generation/generate.js +8 -0
  392. package/dist/mcp/types.d.ts +8 -2
  393. package/dist/optimization/session-cache.js +13 -11
  394. package/dist/plugins/cache.js +10 -3
  395. package/dist/shared/embeddings/embedding-cache.js +4 -4
  396. package/dist/shared/error-utils.d.ts +15 -0
  397. package/dist/shared/error-utils.js +21 -0
  398. package/dist/shared/events/domain-events.d.ts +2 -1
  399. package/dist/shared/llm/cache.js +7 -10
  400. package/dist/shared/retry-engine.js +4 -0
  401. package/dist/shared/test-runner-process.d.ts +10 -0
  402. package/dist/shared/test-runner-process.js +210 -0
  403. package/dist/validation/quality-verdict.js +3 -2
  404. package/dist/workers/quality-daemon/priority-queue.js +4 -1
  405. package/package.json +10 -6
  406. package/dist/cli/chunks/adapter-UYOJPTOX.js +0 -2
  407. package/dist/cli/chunks/aqe-learning-engine-JR5AVQXR.js +0 -2
  408. package/dist/cli/chunks/base-DRZ2LS6X.js +0 -2
  409. package/dist/cli/chunks/browser-workflow-CJ7T3MXF.js +0 -2
  410. package/dist/cli/chunks/chunk-3NIG7S5W.js +0 -2
  411. package/dist/cli/chunks/chunk-4N23RFDU.js +0 -2
  412. package/dist/cli/chunks/chunk-AHKELLIO.js +0 -12
  413. package/dist/cli/chunks/chunk-DK4XN4CU.js +0 -2
  414. package/dist/cli/chunks/chunk-E6G2RD5H.js +0 -4
  415. package/dist/cli/chunks/chunk-MJS53PRX.js +0 -2
  416. package/dist/cli/chunks/chunk-PZPWRQ2M.js +0 -21
  417. package/dist/cli/chunks/chunk-QGA55PFM.js +0 -12
  418. package/dist/cli/chunks/chunk-SPV2VKC5.js +0 -3
  419. package/dist/cli/chunks/chunk-TCHGOB2N.js +0 -2
  420. package/dist/cli/chunks/chunk-UKA2KOXE.js +0 -2
  421. package/dist/cli/chunks/chunk-WCJBU2KI.js +0 -2
  422. package/dist/cli/chunks/chunk-Z6GGIRQQ.js +0 -65
  423. package/dist/cli/chunks/ci-W6K6G2KZ.js +0 -81
  424. package/dist/cli/chunks/client-KHWJT6FB.js +0 -2
  425. package/dist/cli/chunks/core-handlers-HING5RRG.js +0 -2
  426. package/dist/cli/chunks/cross-domain-router-PQTD6AZN.js +0 -2
  427. package/dist/cli/chunks/domain-transfer-M36KUJ2U.js +0 -2
  428. package/dist/cli/chunks/dream-WUGRSNCV.js +0 -2
  429. package/dist/cli/chunks/heartbeat-scheduler-33XX5XNQ.js +0 -2
  430. package/dist/cli/chunks/hnsw-adapter-XQPERX3H.js +0 -2
  431. package/dist/cli/chunks/hnsw-index-2GNXTWHH.js +0 -2
  432. package/dist/cli/chunks/hybrid-backend-CCF7URKI.js +0 -2
  433. package/dist/cli/chunks/impact-analyzer-HGKAZWIG.js +0 -2
  434. package/dist/cli/chunks/init-wizard-72MFBI3G.js +0 -2
  435. package/dist/cli/chunks/kernel-BRCBVMSK.js +0 -2
  436. package/dist/cli/chunks/knowledge-graph-DG44IPEI.js +0 -2
  437. package/dist/cli/chunks/llm-router-service-24KXFX32.js +0 -2
  438. package/dist/cli/chunks/load-test-N4TAYJY3.js +0 -2
  439. package/dist/cli/chunks/memory-backend-NVYFYVAU.js +0 -2
  440. package/dist/cli/chunks/memory-handlers-UTWCNCHL.js +0 -2
  441. package/dist/cli/chunks/pattern-null-store-SBPNYDBR.js +0 -2
  442. package/dist/cli/chunks/protocol-executor-IBYEII5Q.js +0 -2
  443. package/dist/cli/chunks/qe-reasoning-bank-7IETWW6W.js +0 -2
  444. package/dist/cli/chunks/quality-gate-PWKWDJY2.js +0 -7
  445. package/dist/cli/chunks/queen-coordinator-NHUK2MWJ.js +0 -2
  446. package/dist/cli/chunks/router-SRSO3IHF.js +0 -2
  447. package/dist/cli/chunks/routing-feedback-PASRE5HY.js +0 -2
  448. package/dist/cli/chunks/rvf-dual-writer-4M4J67OU.js +0 -2
  449. package/dist/cli/chunks/rvf-migration-adapter-TSXGT5LF.js +0 -2
  450. package/dist/cli/chunks/rvf-native-adapter-MOF3E7BR.js +0 -2
  451. package/dist/cli/chunks/safe-db-QJLFO33B.js +0 -2
  452. package/dist/cli/chunks/schedule-YIVXW5O2.js +0 -2
  453. package/dist/cli/chunks/scheduler-AON7DWSJ.js +0 -2
  454. package/dist/cli/chunks/sqlite-persistence-75VHKKQB.js +0 -2
  455. package/dist/cli/chunks/sync-26CEGSTC.js +0 -2
  456. package/dist/cli/chunks/task-handlers-GYBAWKE2.js +0 -9
  457. package/dist/cli/chunks/test-MPC5HRH5.js +0 -33
  458. package/dist/cli/chunks/token-bootstrap-2Y2XITBX.js +0 -2
  459. package/dist/cli/chunks/unified-memory-UCQ6AB32.js +0 -2
  460. package/dist/cli/chunks/unified-memory-hnsw-IXYUMKRR.js +0 -2
  461. package/dist/cli/chunks/unified-persistence-7E6JQ4FZ.js +0 -2
  462. package/dist/cli/chunks/vibium-NILGKHLN.js +0 -2
  463. package/dist/cli/chunks/visual-security-4VZXPEVG.js +0 -2
  464. package/dist/cli/chunks/witness-chain-JQA2VPZI.js +0 -2
  465. package/dist/cli/chunks/witness-chain-repair-4UA7IPS3.js +0 -2
  466. package/dist/cli/chunks/workflow-orchestrator-GI5NQH7C.js +0 -2
  467. package/dist/cli/chunks/wrappers-N6XIK5PT.js +0 -2
@@ -1 +1 @@
1
- 3.38.12
1
+ 3.51.1
@@ -12,12 +12,21 @@
12
12
  */
13
13
 
14
14
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
15
- import { join, dirname } from 'path';
15
+ import { join, dirname, resolve } from 'path';
16
16
  import { fileURLToPath } from 'url';
17
17
 
18
18
  const __filename = fileURLToPath(import.meta.url);
19
19
  const __dirname = dirname(__filename);
20
- const PROJECT_ROOT = join(__dirname, '../..');
20
+ // Executable modules resolve only from the helper's own install root. A
21
+ // home-level helper can serve an untrusted project, so CLAUDE_PROJECT_DIR must
22
+ // never decide which JavaScript gets imported.
23
+ const MODULE_ROOT = join(__dirname, '../..');
24
+ // Home-level helpers can serve a different project. Keep the memory writer on
25
+ // the same project root as intelligence.cjs, which reads CLAUDE_PROJECT_DIR.
26
+ // PROJECT_ROOT is for data only.
27
+ const PROJECT_ROOT = process.env.CLAUDE_PROJECT_DIR
28
+ ? resolve(process.env.CLAUDE_PROJECT_DIR)
29
+ : MODULE_ROOT;
21
30
  const DATA_DIR = join(PROJECT_ROOT, '.claude-flow', 'data');
22
31
  const STORE_PATH = join(DATA_DIR, 'auto-memory-store.json');
23
32
 
@@ -37,7 +46,7 @@ const dim = (msg) => console.log(` ${DIM}${msg}${RESET}`);
37
46
  // told exactly how to fix it (on both stdout, so it shows in the Claude Code hook
38
47
  // transcript, and stderr, per the issue's requested channel).
39
48
  function warnMemoryUnavailable() {
40
- const line1 = `[AutoMemory] @claude-flow/memory not resolvable from ${PROJECT_ROOT} — self-learning imports are DISABLED.`;
49
+ const line1 = `[AutoMemory] @claude-flow/memory not resolvable from ${MODULE_ROOT} — self-learning imports are DISABLED.`;
41
50
  const line2 = ' Fix: npm i -D @claude-flow/memory (or re-run: npx ruflo@latest init, then npx ruflo@latest doctor --fix)';
42
51
  console.log(`${YELLOW}${line1}${RESET}`);
43
52
  console.log(`${YELLOW}${line2}${RESET}`);
@@ -171,7 +180,7 @@ async function loadMemoryPackage() {
171
180
  // project — so init resolves it from the CLI's own context and records the
172
181
  // absolute path here. This is the only strategy that works on that install.
173
182
  try {
174
- const sidecar = join(PROJECT_ROOT, '.claude-flow', 'memory-package.json');
183
+ const sidecar = join(MODULE_ROOT, '.claude-flow', 'memory-package.json');
175
184
  if (existsSync(sidecar)) {
176
185
  const rec = JSON.parse(readFileSync(sidecar, 'utf-8'));
177
186
  if (rec?.distPath && existsSync(rec.distPath)) {
@@ -181,7 +190,7 @@ async function loadMemoryPackage() {
181
190
  } catch { /* fall through */ }
182
191
 
183
192
  // Strategy 1: Local dev (built dist)
184
- const localDist = join(PROJECT_ROOT, 'v3/@claude-flow/memory/dist/index.js');
193
+ const localDist = join(MODULE_ROOT, 'v3/@claude-flow/memory/dist/index.js');
185
194
  if (existsSync(localDist)) {
186
195
  try {
187
196
  return await import(`file://${localDist}`);
@@ -192,7 +201,7 @@ async function loadMemoryPackage() {
192
201
  // when installed as a transitive dependency via npx ruflo / npx @claude-flow/cli@latest)
193
202
  try {
194
203
  const { createRequire } = await import('module');
195
- const require = createRequire(join(PROJECT_ROOT, 'package.json'));
204
+ const require = createRequire(join(MODULE_ROOT, 'package.json'));
196
205
  return require('@claude-flow/memory');
197
206
  } catch { /* fall through */ }
198
207
 
@@ -201,8 +210,8 @@ async function loadMemoryPackage() {
201
210
  return await import('@claude-flow/memory');
202
211
  } catch { /* fall through */ }
203
212
 
204
- // Strategy 4: Walk up from PROJECT_ROOT looking for @claude-flow/memory in any node_modules
205
- let searchDir = PROJECT_ROOT;
213
+ // Strategy 4: Walk up from MODULE_ROOT looking for @claude-flow/memory in any node_modules
214
+ let searchDir = MODULE_ROOT;
206
215
  const { parse } = await import('path');
207
216
  while (searchDir !== parse(searchDir).root) {
208
217
  const candidate = join(searchDir, 'node_modules', '@claude-flow', 'memory', 'dist', 'index.js');
@@ -374,7 +383,7 @@ async function doStatus() {
374
383
  const memPkg = await loadMemoryPackage();
375
384
  const config = readConfig();
376
385
 
377
- const sidecar = join(PROJECT_ROOT, '.claude-flow', 'memory-package.json');
386
+ const sidecar = join(MODULE_ROOT, '.claude-flow', 'memory-package.json');
378
387
  const hasSidecar = existsSync(sidecar);
379
388
 
380
389
  console.log('\n=== Auto Memory Bridge Status ===\n');
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "manifest": {
3
- "version": "3.38.12",
3
+ "version": "3.51.1",
4
4
  "files": {
5
- "auto-memory-hook.mjs": "85fe05c757421c52137c0bc8545a0896bab6b4714538c2a11d1d0835bfcc8c1c",
6
- "hook-handler.cjs": "dae295fb9ae2626b89899c19a20cc911541af82b52d2eeb9b214d618b96e9a86",
5
+ "auto-memory-hook.mjs": "c8d218526a3c34034c2a69de23f507f0eb0f70d59c16426a8edc849e6ac22529",
6
+ "hook-handler.cjs": "fbd827dfac52e48ea1a576a4484826b6570c0fa710ca4c28faad63b003ac1274",
7
7
  "intelligence.cjs": "30e42ed7ec4ca5a94ac54fdb1330d2d47ac5f3fdeeef207753574723a9e77b5c",
8
- "statusline.cjs": "0457fe53f8cd2c56458ff178392536a5868efd1a573665fa43bc01d2d95ca677"
8
+ "statusline.cjs": "4a48353b4f1566fa4379b00fd0321b6676a22b6cc91fbbd8380ac5183d619468",
9
+ "router.cjs": "16648b3c0d73b6681ac2d8d13def6a68286c57f5a11004de5b19a0fa088c833d"
9
10
  }
10
11
  },
11
- "signature": "8JINtA8uubiBqNQbsz8OL2fcc4xmKGk6gKPGoa1ib7/21nYDaYWiWrZB/4xli8AGUdmQuMS9GT6ANbpPjqAcCw==",
12
+ "signature": "D+NMHUsWriB+ZO/yQdOlrw4daC5sNvZxsDDxF7Y82SruJc7xd4icePgaDDntBVOq/znDpFZUCqqiUYX7sy0uCw==",
12
13
  "algorithm": "ed25519"
13
14
  }
@@ -232,9 +232,9 @@ function safeRequire(modulePath) {
232
232
  return null;
233
233
  }
234
234
 
235
- const router = safeRequire(path.join(helpersDir, 'router.js'));
236
- const session = safeRequire(path.join(helpersDir, 'session.js'));
237
- const memory = safeRequire(path.join(helpersDir, 'memory.js'));
235
+ const router = safeRequire(path.join(helpersDir, 'router.cjs'));
236
+ const session = safeRequire(path.join(helpersDir, 'session.cjs'));
237
+ const memory = safeRequire(path.join(helpersDir, 'memory.cjs'));
238
238
  const intelligence = safeRequire(path.join(helpersDir, 'intelligence.cjs'));
239
239
 
240
240
  // ── Intelligence timeout protection (fixes #1530, #1531) ───────────────────
@@ -286,6 +286,17 @@ async function readStdin() {
286
286
  });
287
287
  }
288
288
 
289
+ // ADR-404: the ruflo mod (plugins/ruflo-mods) runs these events in-process
290
+ // inside Claude Code and sets RUFLO_MODS_OWNS on the process, which every hook
291
+ // started after inherits. An event named there is the mod's; returning here
292
+ // keeps it from firing twice. Only side-effect events can be handed over:
293
+ // guards such as pre-bash always run, whatever the variable says.
294
+ const MOD_OWNABLE_EVENTS = new Set(['route', 'post-edit']);
295
+ function ownedByMod(cmd, env = process.env) {
296
+ if (!MOD_OWNABLE_EVENTS.has(cmd)) return false;
297
+ return String(env.RUFLO_MODS_OWNS || '').split(',').some((owned) => owned.trim() === cmd);
298
+ }
299
+
289
300
  function claimSideEffectEvent(family, stdinData, event) {
290
301
  if (/^(1|true|yes|on)$/i.test(process.env.RUFLO_DISABLE_HOOK_DEDUP || '')) return true;
291
302
  try {
@@ -312,6 +323,8 @@ function claimSideEffectEvent(family, stdinData, event) {
312
323
  }
313
324
 
314
325
  async function main() {
326
+ if (ownedByMod(command)) return;
327
+
315
328
  // Global safety timeout: hooks must NEVER hang (#1530, #1531)
316
329
  const safetyTimer = setTimeout(() => {
317
330
  process.stderr.write("[WARN] Hook handler global timeout (5s), forcing exit\n");
@@ -452,7 +465,8 @@ const handlers = {
452
465
  for (const d of dangerous) {
453
466
  if (cmd.includes(d)) {
454
467
  console.error(`[BLOCKED] Dangerous command detected: ${d}`);
455
- process.exit(1);
468
+ // Claude Code PreToolUse: exit 2 blocks execution; exit 1 is non-blocking.
469
+ process.exit(2);
456
470
  }
457
471
  }
458
472
  console.log('[OK] Command validated');
@@ -585,11 +599,25 @@ const handlers = {
585
599
  }
586
600
  }
587
601
 
588
- // Hooks must ALWAYS exit 0 — Claude Code treats non-zero as "hook error"
589
- // and skips all subsequent hooks for the event.
590
- process.exitCode = 0;
591
- main().catch((e) => {
592
- try { console.log(`[WARN] Hook handler error: ${e.message}`); } catch (_) {}
593
- }).finally(() => {
594
- process.exit(0);
595
- });
602
+ // Non-blocking hooks exit 0; pre-bash denials exit 2 to block PreToolUse.
603
+ // A denial exits immediately, before the normal completion path below.
604
+ //
605
+ // Only dispatch when run directly (node hook-handler.cjs <cmd>). When
606
+ // require()'d by a test, expose the internals instead of reading stdin and
607
+ // calling process.exit — the 2026-06-15 fix (cb1e93e8d) added this guard and
608
+ // the exports for tests/hook-handler-runwithtimeout.test.cjs; the 2026-07-04
609
+ // helper sync (a5f86ad0a) dropped both, so the test died with
610
+ // "runWithTimeout is not a function" once the Test Suite job ran again.
611
+ if (require.main === module) {
612
+ process.exitCode = 0;
613
+ main().catch((e) => {
614
+ try { console.log(`[WARN] Hook handler error: ${e.message}`); } catch (_) {}
615
+ }).finally(() => {
616
+ process.exit(0);
617
+ });
618
+ }
619
+
620
+ // Which sibling helpers loaded (all CommonJS, shipped as .cjs — #3555).
621
+ const loadedHelpers = { router: !!router, session: !!session, memory: !!memory, intelligence: !!intelligence };
622
+
623
+ module.exports = { runWithTimeout, INTELLIGENCE_TIMEOUT_MS, loadedHelpers, ownedByMod, MOD_OWNABLE_EVENTS };
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Ruflo Memory Helper
4
+ * Simple key-value memory for cross-session context
5
+ */
6
+
7
+ const fs = require('fs');
8
+ const path = require('path');
9
+
10
+ const MEMORY_DIR = path.join(process.cwd(), '.claude-flow', 'data');
11
+ const MEMORY_FILE = path.join(MEMORY_DIR, 'memory.json');
12
+
13
+ function loadMemory() {
14
+ try {
15
+ if (fs.existsSync(MEMORY_FILE)) {
16
+ return JSON.parse(fs.readFileSync(MEMORY_FILE, 'utf-8'));
17
+ }
18
+ } catch (e) {
19
+ // Ignore
20
+ }
21
+ return {};
22
+ }
23
+
24
+ function saveMemory(memory) {
25
+ fs.mkdirSync(MEMORY_DIR, { recursive: true });
26
+ fs.writeFileSync(MEMORY_FILE, JSON.stringify(memory, null, 2));
27
+ }
28
+
29
+ const commands = {
30
+ get: (key) => {
31
+ const memory = loadMemory();
32
+ const value = key ? memory[key] : memory;
33
+ console.log(JSON.stringify(value, null, 2));
34
+ return value;
35
+ },
36
+
37
+ set: (key, value) => {
38
+ if (!key) {
39
+ console.error('Key required');
40
+ return;
41
+ }
42
+ const memory = loadMemory();
43
+ memory[key] = value;
44
+ memory._updated = new Date().toISOString();
45
+ saveMemory(memory);
46
+ console.log(`Set: ${key}`);
47
+ },
48
+
49
+ delete: (key) => {
50
+ if (!key) {
51
+ console.error('Key required');
52
+ return;
53
+ }
54
+ const memory = loadMemory();
55
+ delete memory[key];
56
+ saveMemory(memory);
57
+ console.log(`Deleted: ${key}`);
58
+ },
59
+
60
+ clear: () => {
61
+ saveMemory({});
62
+ console.log('Memory cleared');
63
+ },
64
+
65
+ keys: () => {
66
+ const memory = loadMemory();
67
+ const keys = Object.keys(memory).filter(k => !k.startsWith('_'));
68
+ console.log(keys.join('\n'));
69
+ return keys;
70
+ },
71
+ };
72
+
73
+ // CLI — only when run directly, never when require()d by hook-handler.cjs
74
+ // (local patch, agentic-qe#837: it used to dispatch on the caller's argv).
75
+ if (require.main === module) {
76
+ const [,, command, key, ...valueParts] = process.argv;
77
+ const value = valueParts.join(' ');
78
+
79
+ if (command && commands[command]) {
80
+ commands[command](key, value);
81
+ } else {
82
+ console.log('Usage: memory.cjs <get|set|delete|clear|keys> [key] [value]');
83
+ }
84
+ }
85
+
86
+ module.exports = commands;
@@ -0,0 +1,105 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Claude Flow Agent Router
4
+ *
5
+ * Static keyword router that suggests an agent for a task description.
6
+ * NOTE: This is *not* a learned model. It is a heuristic table; "confidence"
7
+ * is reported as a heuristic prior, not a calibrated probability.
8
+ *
9
+ * #2257 fix: patterns are now word-boundary-anchored so short tokens like
10
+ * `cd`, `ci`, `ui`, `add`, `structure` no longer match inside unrelated
11
+ * words (`decision`, `infrastructure`, `address`, `addendum`). Default
12
+ * confidence dropped from 0.8 to 0.6 to better reflect that this is a
13
+ * static heuristic, not a learned classifier.
14
+ */
15
+
16
+ const AGENT_CAPABILITIES = {
17
+ coder: ['code-generation', 'refactoring', 'debugging', 'implementation'],
18
+ tester: ['unit-testing', 'integration-testing', 'coverage', 'test-generation'],
19
+ reviewer: ['code-review', 'security-audit', 'quality-check', 'best-practices'],
20
+ researcher: ['web-search', 'documentation', 'analysis', 'summarization'],
21
+ architect: ['system-design', 'architecture', 'patterns', 'scalability'],
22
+ 'backend-dev': ['api', 'database', 'server', 'authentication'],
23
+ 'frontend-dev': ['ui', 'react', 'css', 'components'],
24
+ devops: ['ci-cd', 'docker', 'deployment', 'infrastructure'],
25
+ };
26
+
27
+ // Each entry is an array of tokens. Tokens are alternation-friendly:
28
+ // - multi-word phrases ("unit test") match as phrases
29
+ // - single tokens are wrapped with \b … \b word boundaries at match time
30
+ const TASK_PATTERNS = [
31
+ // Code patterns
32
+ { tokens: ['implement', 'create', 'build', 'add', 'write code', 'refactor', 'debug'], agent: 'coder' },
33
+ { tokens: ['test', 'tests', 'testing', 'spec', 'specs', 'coverage', 'unit test', 'integration test'], agent: 'tester' },
34
+ { tokens: ['review', 'audit', 'check', 'validate', 'security'], agent: 'reviewer' },
35
+ { tokens: ['research', 'find', 'search', 'documentation', 'explore'], agent: 'researcher' },
36
+ { tokens: ['design', 'architect', 'architecture', 'structure', 'plan'], agent: 'architect' },
37
+
38
+ // Domain patterns
39
+ { tokens: ['api', 'endpoint', 'server', 'backend', 'database'], agent: 'backend-dev' },
40
+ { tokens: ['ui', 'frontend', 'component', 'react', 'css', 'style'], agent: 'frontend-dev' },
41
+ // 'cd' / 'ci' are kept but require word boundaries via \b — they will not
42
+ // match inside "decision" or "specific". 'cd' as a literal command in a
43
+ // task description ("set up cd pipeline") still matches.
44
+ { tokens: ['deploy', 'docker', 'ci', 'cd', 'ci/cd', 'pipeline', 'infrastructure', 'devops'], agent: 'devops' },
45
+ ];
46
+
47
+ function escapeRegex(s) {
48
+ return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
49
+ }
50
+
51
+ // Build an anchored alternation regex from a token list.
52
+ // - multi-word phrases (containing whitespace or '/') match literally
53
+ // - single tokens are wrapped with \b boundaries so 'cd' won't match "decide"
54
+ function buildPattern(tokens) {
55
+ const alternatives = tokens.map((tok) => {
56
+ const escaped = escapeRegex(tok.toLowerCase());
57
+ if (/\s|\//.test(tok)) {
58
+ // Phrase: whitespace/'/' on each side acts as a natural boundary
59
+ return escaped;
60
+ }
61
+ return `\\b${escaped}\\b`;
62
+ });
63
+ return new RegExp(`(?:${alternatives.join('|')})`, 'i');
64
+ }
65
+
66
+ const COMPILED_PATTERNS = TASK_PATTERNS.map((entry) => ({
67
+ agent: entry.agent,
68
+ tokens: entry.tokens,
69
+ regex: buildPattern(entry.tokens),
70
+ }));
71
+
72
+ function routeTask(task) {
73
+ const taskLower = String(task ?? '').toLowerCase();
74
+
75
+ for (const entry of COMPILED_PATTERNS) {
76
+ if (entry.regex.test(taskLower)) {
77
+ return {
78
+ agent: entry.agent,
79
+ // Heuristic prior, not a learned probability — see file header.
80
+ confidence: 0.6,
81
+ reason: `Matched keyword(s) from: ${entry.tokens.join('|')}`,
82
+ };
83
+ }
84
+ }
85
+
86
+ return {
87
+ agent: 'coder',
88
+ confidence: 0.3,
89
+ reason: 'Default routing - no specific keyword matched',
90
+ };
91
+ }
92
+
93
+ // CLI
94
+ if (require.main === module) {
95
+ const task = process.argv.slice(2).join(' ');
96
+ if (task) {
97
+ const result = routeTask(task);
98
+ console.log(JSON.stringify(result, null, 2));
99
+ } else {
100
+ console.log('Usage: router.cjs <task description>');
101
+ console.log('\nAvailable agents:', Object.keys(AGENT_CAPABILITIES).join(', '));
102
+ }
103
+ }
104
+
105
+ module.exports = { routeTask, AGENT_CAPABILITIES, TASK_PATTERNS, buildPattern };
@@ -0,0 +1,166 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Ruflo Session Manager
4
+ * Handles session lifecycle: start, restore, end
5
+ *
6
+ * Local patch (agentic-qe#837): current.json lives in the opened project and
7
+ * is untrusted. Its contents must never decide where this helper writes, so
8
+ * the archive name is validated, symlinks are never written through, and the
9
+ * session directory must resolve inside the project.
10
+ */
11
+
12
+ const fs = require('fs');
13
+ const path = require('path');
14
+
15
+ const SESSION_DIR = path.join(process.cwd(), '.claude-flow', 'sessions');
16
+ const SESSION_FILE = path.join(SESSION_DIR, 'current.json');
17
+ const SESSION_ID = /^session-\d+$/;
18
+
19
+ /** Read current.json; a symlink, non-file or corrupt JSON counts as no session. */
20
+ function readSession() {
21
+ let stat;
22
+ try { stat = fs.lstatSync(SESSION_FILE); } catch { return null; }
23
+ if (!stat.isFile()) return null;
24
+ try {
25
+ const session = JSON.parse(fs.readFileSync(SESSION_FILE, 'utf-8'));
26
+ return session && typeof session === 'object' ? session : null;
27
+ } catch {
28
+ return null;
29
+ }
30
+ }
31
+
32
+ /** The session directory must resolve inside the project (no symlinked escape). */
33
+ function assertSessionDirContained() {
34
+ const root = fs.realpathSync(process.cwd());
35
+ const relative = path.relative(root, fs.realpathSync(SESSION_DIR));
36
+ if (relative.startsWith('..') || path.isAbsolute(relative)) {
37
+ throw new Error('Session directory resolves outside the project');
38
+ }
39
+ }
40
+
41
+ /** Write via an exclusive temp file and rename, which replaces a symlink instead of following it. */
42
+ function writeFile(file, data) {
43
+ assertSessionDirContained();
44
+ const tmp = `${file}.${process.pid}.${Date.now()}.tmp`;
45
+ fs.writeFileSync(tmp, data, { flag: 'wx' });
46
+ fs.renameSync(tmp, file);
47
+ }
48
+
49
+ const commands = {
50
+ start: () => {
51
+ const sessionId = `session-${Date.now()}`;
52
+ const session = {
53
+ id: sessionId,
54
+ startedAt: new Date().toISOString(),
55
+ cwd: process.cwd(),
56
+ context: {},
57
+ metrics: {
58
+ edits: 0,
59
+ commands: 0,
60
+ tasks: 0,
61
+ errors: 0,
62
+ },
63
+ };
64
+
65
+ fs.mkdirSync(SESSION_DIR, { recursive: true });
66
+ writeFile(SESSION_FILE, JSON.stringify(session, null, 2));
67
+
68
+ console.log(`Session started: ${sessionId}`);
69
+ return session;
70
+ },
71
+
72
+ restore: () => {
73
+ const session = readSession();
74
+ if (!session) {
75
+ console.log('No session to restore');
76
+ return null;
77
+ }
78
+
79
+ session.restoredAt = new Date().toISOString();
80
+ writeFile(SESSION_FILE, JSON.stringify(session, null, 2));
81
+
82
+ console.log(`Session restored: ${session.id}`);
83
+ return session;
84
+ },
85
+
86
+ end: () => {
87
+ const session = readSession();
88
+ if (!session) {
89
+ console.log('No active session');
90
+ return null;
91
+ }
92
+
93
+ session.endedAt = new Date().toISOString();
94
+ session.duration = Date.now() - new Date(session.startedAt).getTime();
95
+
96
+ // Archive session under a validated name only; a crafted id cannot pick the path.
97
+ const archiveId = SESSION_ID.test(String(session.id)) ? session.id : `session-${Date.now()}`;
98
+ writeFile(path.join(SESSION_DIR, `${archiveId}.json`), JSON.stringify(session, null, 2));
99
+ fs.unlinkSync(SESSION_FILE);
100
+
101
+ console.log(`Session ended: ${archiveId}`);
102
+ console.log(`Duration: ${Math.round(session.duration / 1000 / 60)} minutes`);
103
+ console.log(`Metrics: ${JSON.stringify(session.metrics)}`);
104
+
105
+ return session;
106
+ },
107
+
108
+ status: () => {
109
+ const session = readSession();
110
+ if (!session) {
111
+ console.log('No active session');
112
+ return null;
113
+ }
114
+
115
+ const duration = Date.now() - new Date(session.startedAt).getTime();
116
+
117
+ console.log(`Session: ${session.id}`);
118
+ console.log(`Started: ${session.startedAt}`);
119
+ console.log(`Duration: ${Math.round(duration / 1000 / 60)} minutes`);
120
+ console.log(`Metrics: ${JSON.stringify(session.metrics)}`);
121
+
122
+ return session;
123
+ },
124
+
125
+ update: (key, value) => {
126
+ const session = readSession();
127
+ if (!session) {
128
+ console.log('No active session');
129
+ return null;
130
+ }
131
+
132
+ if (!session.context || typeof session.context !== 'object') session.context = {};
133
+ session.context[key] = value;
134
+ session.updatedAt = new Date().toISOString();
135
+ writeFile(SESSION_FILE, JSON.stringify(session, null, 2));
136
+
137
+ return session;
138
+ },
139
+
140
+ metric: (name) => {
141
+ const session = readSession();
142
+ if (!session) {
143
+ return null;
144
+ }
145
+
146
+ if (session.metrics && typeof session.metrics[name] === 'number') {
147
+ session.metrics[name]++;
148
+ writeFile(SESSION_FILE, JSON.stringify(session, null, 2));
149
+ }
150
+
151
+ return session;
152
+ },
153
+ };
154
+
155
+ // CLI — only when run directly, never when require()d by hook-handler.cjs.
156
+ if (require.main === module) {
157
+ const [,, command, ...args] = process.argv;
158
+
159
+ if (command && commands[command]) {
160
+ commands[command](...args);
161
+ } else {
162
+ console.log('Usage: session.cjs <start|restore|end|status|update|metric> [args]');
163
+ }
164
+ }
165
+
166
+ module.exports = commands;