abtars 0.1.0-alpha.2 → 0.1.0-alpha.21

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 (386) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/bundle/_registry.generated-KQODGKTQ.js +36 -0
  3. package/bundle/{_registry.generated-M4WY2MMI.js.map → _registry.generated-KQODGKTQ.js.map} +1 -1
  4. package/bundle/abtars-browser.js +8 -7
  5. package/bundle/abtars-browser.js.map +1 -1
  6. package/bundle/abtars-cli.js +646 -73
  7. package/bundle/abtars-cli.js.map +4 -4
  8. package/bundle/abtars-restart.js +7 -6
  9. package/bundle/abtars-rss.js +2 -1
  10. package/bundle/abtars-rss.js.map +1 -1
  11. package/bundle/abtars-task.js +9 -8
  12. package/bundle/abtars-task.js.map +1 -1
  13. package/bundle/abtars.js +103 -96
  14. package/bundle/abtars.js.map +2 -2
  15. package/bundle/{agent-api-rate-limit-OQNFMXTZ.js → agent-api-rate-limit-7R5TX2F2.js} +7 -6
  16. package/bundle/{agent-api-rate-limit-OQNFMXTZ.js.map → agent-api-rate-limit-7R5TX2F2.js.map} +1 -1
  17. package/bundle/agent-registry-5M77ZOMV.js +19 -0
  18. package/bundle/agent-registry-VJMNIQ5W.js +19 -0
  19. package/bundle/{anthropic-adapter-2APTH3LA.js → anthropic-adapter-IBY3NPXW.js} +4 -3
  20. package/bundle/{anthropic-adapter-2APTH3LA.js.map → anthropic-adapter-IBY3NPXW.js.map} +1 -1
  21. package/bundle/{bridge-lock-transport-4AC2G5G6.js → bridge-lock-transport-HO545SBK.js} +9 -8
  22. package/bundle/browse-delivery-64GQIUHG.js +18 -0
  23. package/bundle/browser-EXR5OQGK.js +19 -0
  24. package/bundle/capability-HIE7UGFU.js +18 -0
  25. package/bundle/{chunk-BUUVFUPO.js → chunk-2BY6I4P5.js} +5 -4
  26. package/bundle/{chunk-BUUVFUPO.js.map → chunk-2BY6I4P5.js.map} +1 -1
  27. package/bundle/{chunk-Y6XAEX2Q.js → chunk-2F6XKG7Y.js} +15 -9
  28. package/bundle/chunk-2F6XKG7Y.js.map +7 -0
  29. package/bundle/{chunk-V76TVMCM.js → chunk-3MO2MDXJ.js} +5 -4
  30. package/bundle/{chunk-V76TVMCM.js.map → chunk-3MO2MDXJ.js.map} +1 -1
  31. package/bundle/{chunk-6UCRKRWR.js → chunk-6XX4OAAM.js} +22 -21
  32. package/bundle/chunk-6XX4OAAM.js.map +7 -0
  33. package/bundle/{chunk-XREWVCUO.js → chunk-7CHLS36W.js} +16 -148
  34. package/bundle/chunk-7CHLS36W.js.map +7 -0
  35. package/bundle/{chunk-NWDBD4PA.js → chunk-7K2YZTLD.js} +3 -2
  36. package/bundle/{chunk-JCJS4ZIB.js → chunk-AQVOAQQI.js} +5 -4
  37. package/bundle/{chunk-JCJS4ZIB.js.map → chunk-AQVOAQQI.js.map} +1 -1
  38. package/bundle/chunk-AUQD2PKM.js +136 -0
  39. package/bundle/chunk-AUQD2PKM.js.map +7 -0
  40. package/bundle/{chunk-YOCTDKKL.js → chunk-BYDUMHXT.js} +4 -3
  41. package/bundle/{chunk-YOCTDKKL.js.map → chunk-BYDUMHXT.js.map} +1 -1
  42. package/bundle/{chunk-RVE2N7FA.js → chunk-CELR236Q.js} +5 -4
  43. package/bundle/{chunk-RVE2N7FA.js.map → chunk-CELR236Q.js.map} +1 -1
  44. package/bundle/{chunk-2XU2X4OI.js → chunk-CUQA2AJT.js} +3 -2
  45. package/bundle/{chunk-2XU2X4OI.js.map → chunk-CUQA2AJT.js.map} +1 -1
  46. package/bundle/chunk-DMPR5MYT.js +183 -0
  47. package/bundle/chunk-DMPR5MYT.js.map +7 -0
  48. package/bundle/{chunk-BHMZ4RCC.js → chunk-DY3R7LDW.js} +55 -54
  49. package/bundle/{chunk-BHMZ4RCC.js.map → chunk-DY3R7LDW.js.map} +1 -1
  50. package/bundle/{chunk-AR6GO6YC.js → chunk-ELRAH7VL.js} +5 -4
  51. package/bundle/{chunk-AR6GO6YC.js.map → chunk-ELRAH7VL.js.map} +1 -1
  52. package/bundle/{chunk-FMWKEPM7.js → chunk-EX2SRTUE.js} +5 -4
  53. package/bundle/{chunk-FMWKEPM7.js.map → chunk-EX2SRTUE.js.map} +1 -1
  54. package/bundle/{chunk-JW6RU47G.js → chunk-FVQGP5YO.js} +8 -7
  55. package/bundle/{chunk-JW6RU47G.js.map → chunk-FVQGP5YO.js.map} +1 -1
  56. package/bundle/{chunk-GRNENTPA.js → chunk-G6IXMYIO.js} +4 -3
  57. package/bundle/{chunk-GRNENTPA.js.map → chunk-G6IXMYIO.js.map} +1 -1
  58. package/bundle/{chunk-6NR3OHEW.js → chunk-H2RZ4NEJ.js} +6 -5
  59. package/bundle/{chunk-6NR3OHEW.js.map → chunk-H2RZ4NEJ.js.map} +1 -1
  60. package/bundle/chunk-HVKJN3AG.js +189 -0
  61. package/bundle/chunk-HVKJN3AG.js.map +7 -0
  62. package/bundle/{chunk-265TPOPC.js → chunk-HXJRZWKA.js} +3 -2
  63. package/bundle/{chunk-265TPOPC.js.map → chunk-HXJRZWKA.js.map} +1 -1
  64. package/bundle/chunk-IU3RI5E4.js +645 -0
  65. package/bundle/chunk-IU3RI5E4.js.map +7 -0
  66. package/bundle/{chunk-GST5T3WZ.js → chunk-J5YIMCLT.js} +6 -5
  67. package/bundle/{chunk-GST5T3WZ.js.map → chunk-J5YIMCLT.js.map} +1 -1
  68. package/bundle/chunk-JAJ3DUQ2.js +30 -0
  69. package/bundle/{chunk-OP7BTAWY.js.map → chunk-JAJ3DUQ2.js.map} +1 -1
  70. package/bundle/chunk-JHF25OOG.js +645 -0
  71. package/bundle/chunk-JHF25OOG.js.map +7 -0
  72. package/bundle/{chunk-MPX525QO.js → chunk-JRG4EFMP.js} +5 -4
  73. package/bundle/{chunk-MPX525QO.js.map → chunk-JRG4EFMP.js.map} +1 -1
  74. package/bundle/{chunk-VVEDVGCR.js → chunk-JU3UBWLN.js} +17 -16
  75. package/bundle/{chunk-VVEDVGCR.js.map → chunk-JU3UBWLN.js.map} +1 -1
  76. package/bundle/{chunk-QBGBT5QS.js → chunk-JX3ZZU3O.js} +5 -4
  77. package/bundle/{chunk-QBGBT5QS.js.map → chunk-JX3ZZU3O.js.map} +1 -1
  78. package/bundle/{chunk-6SETMHNN.js → chunk-K7P74UNQ.js} +8 -7
  79. package/bundle/{chunk-6SETMHNN.js.map → chunk-K7P74UNQ.js.map} +1 -1
  80. package/bundle/{chunk-AZJIODTQ.js → chunk-KED3G7HS.js} +6 -5
  81. package/bundle/{chunk-AZJIODTQ.js.map → chunk-KED3G7HS.js.map} +1 -1
  82. package/bundle/chunk-KI2ROWAH.js +3707 -0
  83. package/bundle/chunk-KI2ROWAH.js.map +7 -0
  84. package/bundle/{chunk-UHRP745J.js → chunk-L7YHV5DL.js} +6 -5
  85. package/bundle/{chunk-UHRP745J.js.map → chunk-L7YHV5DL.js.map} +1 -1
  86. package/bundle/{chunk-BSSBCSCL.js → chunk-LD5BMLHG.js} +11 -10
  87. package/bundle/{chunk-BSSBCSCL.js.map → chunk-LD5BMLHG.js.map} +1 -1
  88. package/bundle/{chunk-2UPU3OW6.js → chunk-LYEAHE5V.js} +5 -4
  89. package/bundle/{chunk-2UPU3OW6.js.map → chunk-LYEAHE5V.js.map} +1 -1
  90. package/bundle/{chunk-3B7BBE4F.js → chunk-MCGEXAG5.js} +8 -7
  91. package/bundle/{chunk-3B7BBE4F.js.map → chunk-MCGEXAG5.js.map} +1 -1
  92. package/bundle/{chunk-X76UX47U.js → chunk-MJ6PHMOK.js} +4 -3
  93. package/bundle/{chunk-X76UX47U.js.map → chunk-MJ6PHMOK.js.map} +1 -1
  94. package/bundle/{chunk-LSPKJQCI.js → chunk-MV6CJFWR.js} +3 -2
  95. package/bundle/{chunk-LSPKJQCI.js.map → chunk-MV6CJFWR.js.map} +1 -1
  96. package/bundle/chunk-MZWMYN4O.js +17 -0
  97. package/bundle/{chunk-M6VBAPNT.js.map → chunk-MZWMYN4O.js.map} +1 -1
  98. package/bundle/{chunk-HX7Y7EYP.js → chunk-NIRYBWUW.js} +4 -3
  99. package/bundle/{chunk-HX7Y7EYP.js.map → chunk-NIRYBWUW.js.map} +1 -1
  100. package/bundle/{chunk-3E545J66.js → chunk-OW64RUE5.js} +3 -2
  101. package/bundle/{chunk-3E545J66.js.map → chunk-OW64RUE5.js.map} +1 -1
  102. package/bundle/chunk-P56PLAIC.js +126 -0
  103. package/bundle/chunk-P56PLAIC.js.map +7 -0
  104. package/bundle/{chunk-TZHIDLDS.js → chunk-P6PN34XD.js} +5 -4
  105. package/bundle/{chunk-TZHIDLDS.js.map → chunk-P6PN34XD.js.map} +1 -1
  106. package/bundle/{chunk-2UENBO6M.js → chunk-PF5UQ64X.js} +9 -8
  107. package/bundle/{chunk-2UENBO6M.js.map → chunk-PF5UQ64X.js.map} +1 -1
  108. package/bundle/{chunk-6CPN4IGS.js → chunk-PQ62LZNA.js} +9 -8
  109. package/bundle/{chunk-6CPN4IGS.js.map → chunk-PQ62LZNA.js.map} +1 -1
  110. package/bundle/{chunk-UCQ2WC3B.js → chunk-PQW5QBPY.js} +15 -8
  111. package/bundle/chunk-PQW5QBPY.js.map +7 -0
  112. package/bundle/{chunk-D2DCBO6M.js → chunk-R36WIOYX.js} +3 -2
  113. package/bundle/{chunk-D2DCBO6M.js.map → chunk-R36WIOYX.js.map} +1 -1
  114. package/bundle/chunk-RB3X66KM.js +386 -0
  115. package/bundle/chunk-RB3X66KM.js.map +7 -0
  116. package/bundle/{chunk-GUQVJC3U.js → chunk-RE3F3CFW.js} +7 -6
  117. package/bundle/{chunk-GUQVJC3U.js.map → chunk-RE3F3CFW.js.map} +1 -1
  118. package/bundle/chunk-RWUINZUQ.js +19 -0
  119. package/bundle/chunk-RWUINZUQ.js.map +7 -0
  120. package/bundle/{chunk-NT3OBORC.js → chunk-S54DBUZ4.js} +10 -9
  121. package/bundle/{chunk-NT3OBORC.js.map → chunk-S54DBUZ4.js.map} +1 -1
  122. package/bundle/{chunk-CWOHNFUV.js → chunk-SY67HM2Y.js} +3 -2
  123. package/bundle/{chunk-CWOHNFUV.js.map → chunk-SY67HM2Y.js.map} +1 -1
  124. package/bundle/{chunk-BQ2L4GMG.js → chunk-TBLYGCPQ.js} +4 -3
  125. package/bundle/{chunk-BQ2L4GMG.js.map → chunk-TBLYGCPQ.js.map} +1 -1
  126. package/bundle/chunk-TCBMBX3Z.js +183 -0
  127. package/bundle/chunk-TCBMBX3Z.js.map +7 -0
  128. package/bundle/chunk-TXRWQIQQ.js +3707 -0
  129. package/bundle/chunk-TXRWQIQQ.js.map +7 -0
  130. package/bundle/chunk-U34CSHFS.js +645 -0
  131. package/bundle/chunk-U34CSHFS.js.map +7 -0
  132. package/bundle/{chunk-CEVRHKJY.js → chunk-UDZIZB5F.js} +6 -5
  133. package/bundle/{chunk-CEVRHKJY.js.map → chunk-UDZIZB5F.js.map} +1 -1
  134. package/bundle/{chunk-W6FAL35D.js → chunk-VA5WKN3Z.js} +7 -6
  135. package/bundle/{chunk-W6FAL35D.js.map → chunk-VA5WKN3Z.js.map} +1 -1
  136. package/bundle/{chunk-X6TERNVJ.js → chunk-WX7GHGFX.js} +10 -9
  137. package/bundle/{chunk-X6TERNVJ.js.map → chunk-WX7GHGFX.js.map} +1 -1
  138. package/bundle/{chunk-PNEDC45Y.js → chunk-XETTJVEU.js} +4 -3
  139. package/bundle/{chunk-PNEDC45Y.js.map → chunk-XETTJVEU.js.map} +1 -1
  140. package/bundle/{chunk-PLCY3GFH.js → chunk-XLLSPBBT.js} +5 -4
  141. package/bundle/{chunk-PLCY3GFH.js.map → chunk-XLLSPBBT.js.map} +1 -1
  142. package/bundle/{chunk-ZXPXCDA6.js → chunk-XOCP5BMO.js} +6 -5
  143. package/bundle/{chunk-ZXPXCDA6.js.map → chunk-XOCP5BMO.js.map} +1 -1
  144. package/bundle/chunk-ZEY6YZAB.js +138 -0
  145. package/bundle/chunk-ZEY6YZAB.js.map +7 -0
  146. package/bundle/{chunk-MW6WDLU7.js → chunk-ZZR3JZHR.js} +10 -9
  147. package/bundle/{chunk-MW6WDLU7.js.map → chunk-ZZR3JZHR.js.map} +1 -1
  148. package/bundle/commands-AIL4XOIZ.js +33 -0
  149. package/bundle/commands-K77NVSXZ.js +32 -0
  150. package/bundle/commands-V6RSVC4Y.js +32 -0
  151. package/bundle/completion-buffer-S3LXDZG2.js +14 -0
  152. package/bundle/config-C6VHRJQ7.js +20 -0
  153. package/bundle/{config-show-ERTATR6E.js → config-show-ZTXX27FW.js} +4 -3
  154. package/bundle/{config-show-ERTATR6E.js.map → config-show-ZTXX27FW.js.map} +1 -1
  155. package/bundle/{context-HCEGZNDC.js → context-OCS7HLJP.js} +5 -4
  156. package/bundle/{context-HCEGZNDC.js.map → context-OCS7HLJP.js.map} +1 -1
  157. package/bundle/daemon-NPKYZ3CJ.js +292 -0
  158. package/bundle/daemon-NPKYZ3CJ.js.map +7 -0
  159. package/bundle/delegation-tools-PF7RD2RW.js +28 -0
  160. package/bundle/{deploy-lib-import-32ZFKHWP.js → deploy-lib-import-ODLDL2DB.js} +5 -4
  161. package/bundle/digital-signature-PNY4TR2W.js +14 -0
  162. package/bundle/{direct-api-transport-YR7SXXNN.js → direct-api-transport-EADHM67Z.js} +21 -20
  163. package/bundle/{direct-api-transport-YR7SXXNN.js.map → direct-api-transport-EADHM67Z.js.map} +1 -1
  164. package/bundle/direct-api-transport-SLJ2Z6NX.js +861 -0
  165. package/bundle/direct-api-transport-SLJ2Z6NX.js.map +7 -0
  166. package/bundle/{discord-adapter-YYWVMPPU.js → discord-adapter-FBJOJSTW.js} +25 -24
  167. package/bundle/{discord-adapter-YYWVMPPU.js.map → discord-adapter-FBJOJSTW.js.map} +1 -1
  168. package/bundle/discord-adapter-IJISVHUE.js +585 -0
  169. package/bundle/discord-adapter-IJISVHUE.js.map +7 -0
  170. package/bundle/discord-adapter-UYOCKRDF.js +586 -0
  171. package/bundle/discord-adapter-UYOCKRDF.js.map +7 -0
  172. package/bundle/{dist-MTMKARCP.js → dist-J3T4XVKX.js} +4 -3
  173. package/bundle/{dist-MTMKARCP.js.map → dist-J3T4XVKX.js.map} +1 -1
  174. package/bundle/{dns-wakeup-27M7D2MR.js → dns-wakeup-RYOCQ6GR.js} +6 -5
  175. package/bundle/{dns-wakeup-27M7D2MR.js.map → dns-wakeup-RYOCQ6GR.js.map} +1 -1
  176. package/bundle/{doctor-QNUSDY73.js → doctor-R54GZPKL.js} +10 -9
  177. package/bundle/{doctor-QNUSDY73.js.map → doctor-R54GZPKL.js.map} +1 -1
  178. package/bundle/{ensure-invariants-NMXNS476.js → ensure-invariants-K2ZUZ6NR.js} +7 -6
  179. package/bundle/{ensure-invariants-NMXNS476.js.map → ensure-invariants-K2ZUZ6NR.js.map} +1 -1
  180. package/bundle/ensure-invariants-KUXIW73S.js +50 -0
  181. package/bundle/ensure-invariants-KUXIW73S.js.map +7 -0
  182. package/bundle/env-schema-DGD6QWPA.js +20 -0
  183. package/bundle/{esm-DDP6NCZG.js → esm-PFOJARXA.js} +5 -4
  184. package/bundle/{esm-DDP6NCZG.js.map → esm-PFOJARXA.js.map} +1 -1
  185. package/bundle/{fallback-policy-L4QV2PEJ.js → fallback-policy-SR6ED5I3.js} +4 -3
  186. package/bundle/{fallback-policy-L4QV2PEJ.js.map → fallback-policy-SR6ED5I3.js.map} +1 -1
  187. package/bundle/{health-check-SPA7NT6N.js → health-check-RJ2SUJYL.js} +4 -3
  188. package/bundle/{health-check-SPA7NT6N.js.map → health-check-RJ2SUJYL.js.map} +1 -1
  189. package/bundle/hook-system-POI5VRIX.js +18 -0
  190. package/bundle/hotskills-6ECHLXTJ.js +13 -0
  191. package/bundle/install-24XR5FO5.js +13 -0
  192. package/bundle/install-AJ7VW76P.js +13 -0
  193. package/bundle/{install-log-IAPHYKD4.js → install-log-Q6RUHKWC.js} +4 -3
  194. package/bundle/{install-log-IAPHYKD4.js.map → install-log-Q6RUHKWC.js.map} +1 -1
  195. package/bundle/{install-manifest-SPQRUNXL.js → install-manifest-MCJCAYSR.js} +9 -7
  196. package/bundle/install-manifest-MCJCAYSR.js.map +7 -0
  197. package/bundle/install-manifest-ZETY4AFS.js +104 -0
  198. package/bundle/install-manifest-ZETY4AFS.js.map +7 -0
  199. package/bundle/{install-validate-PVLZXYLQ.js → install-validate-H74LUCE2.js} +4 -3
  200. package/bundle/{install-validate-PVLZXYLQ.js.map → install-validate-H74LUCE2.js.map} +1 -1
  201. package/bundle/{irc-adapter-OI5UZSQF.js → irc-adapter-RKRUSZXB.js} +7 -6
  202. package/bundle/{irc-adapter-OI5UZSQF.js.map → irc-adapter-RKRUSZXB.js.map} +1 -1
  203. package/bundle/{irc-config-55YO6EGB.js → irc-config-6VY67UPQ.js} +8 -7
  204. package/bundle/{irc-config-55YO6EGB.js.map → irc-config-6VY67UPQ.js.map} +1 -1
  205. package/bundle/{logs-ZNYXX5PA.js → logs-EK4HYRKR.js} +4 -3
  206. package/bundle/{logs-ZNYXX5PA.js.map → logs-EK4HYRKR.js.map} +1 -1
  207. package/bundle/{media-utils-XNNDTYFI.js → media-utils-QBY5WBF3.js} +8 -7
  208. package/bundle/{media-utils-XNNDTYFI.js.map → media-utils-QBY5WBF3.js.map} +1 -1
  209. package/bundle/message-pipeline-ANSMPK5O.js +34 -0
  210. package/bundle/message-pipeline-HXZMRGXZ.js +34 -0
  211. package/bundle/message-pipeline-XUUTGPFH.js +35 -0
  212. package/bundle/meta.json +1828 -1650
  213. package/bundle/model-health-registry-7ECZFCW4.js +12 -0
  214. package/bundle/model-health-registry-LDC76RPP.js +12 -0
  215. package/bundle/notification-OJ4YE4VG.js +14 -0
  216. package/bundle/{openrouter-credits-EDY7ETAU.js → openrouter-credits-L45SYKT3.js} +7 -6
  217. package/bundle/{openrouter-credits-EDY7ETAU.js.map → openrouter-credits-L45SYKT3.js.map} +1 -1
  218. package/bundle/{passwd-RRFV4CC5.js → passwd-QSHZJ2CG.js} +4 -3
  219. package/bundle/{passwd-RRFV4CC5.js.map → passwd-QSHZJ2CG.js.map} +1 -1
  220. package/bundle/paths-ZJYIDND2.js +18 -0
  221. package/bundle/{peer-client-52XYMNI7.js → peer-client-T44VI7NB.js} +13 -12
  222. package/bundle/{peer-client-52XYMNI7.js.map → peer-client-T44VI7NB.js.map} +1 -1
  223. package/bundle/peer-config-D5A4454H.js +17 -0
  224. package/bundle/{peer-sessions-EAXTNQ36.js → peer-sessions-MY2YVXHC.js} +4 -3
  225. package/bundle/{peer-sessions-EAXTNQ36.js.map → peer-sessions-MY2YVXHC.js.map} +1 -1
  226. package/bundle/{pending-callback-RIMQZ7FJ.js → pending-callback-6KLBSHLX.js} +4 -3
  227. package/bundle/{pending-callback-RIMQZ7FJ.js.map → pending-callback-6KLBSHLX.js.map} +1 -1
  228. package/bundle/phase-transport-43NP5XBK.js +23 -0
  229. package/bundle/phase-transport-GNUZI6EW.js +23 -0
  230. package/bundle/phase-transport-Q7K6V3VZ.js +23 -0
  231. package/bundle/phase-transport-SLJXIAY5.js +23 -0
  232. package/bundle/{responses-adapter-AAQTY3K4.js → responses-adapter-DAV2JUL7.js} +4 -3
  233. package/bundle/{responses-adapter-AAQTY3K4.js.map → responses-adapter-DAV2JUL7.js.map} +1 -1
  234. package/bundle/{restore-ZE3SEPSS.js → restore-ROJF22R2.js} +5 -4
  235. package/bundle/{restore-ZE3SEPSS.js.map → restore-ROJF22R2.js.map} +1 -1
  236. package/bundle/{self-healer-utils-DMUUXC47.js → self-healer-utils-7NFH22VJ.js} +7 -6
  237. package/bundle/{self-healer-utils-DMUUXC47.js.map → self-healer-utils-7NFH22VJ.js.map} +1 -1
  238. package/bundle/skill-stats-IPVKMWN3.js +23 -0
  239. package/bundle/sleep-4NVWZHVN.js +20 -0
  240. package/bundle/soul-bundle-7EYTEKFE.js +15 -0
  241. package/bundle/soul-loader-7FN7WDHM.js +18 -0
  242. package/bundle/soul-loader-K237NP4T.js +17 -0
  243. package/bundle/soul-loader-K237NP4T.js.map +7 -0
  244. package/bundle/soul-loader-UVJ6HZM3.js +17 -0
  245. package/bundle/soul-loader-UVJ6HZM3.js.map +7 -0
  246. package/bundle/src-Z3WR7SRT.js +9 -0
  247. package/bundle/src-Z3WR7SRT.js.map +7 -0
  248. package/bundle/{sse-parser-anthropic-P7CE2MH2.js → sse-parser-anthropic-H42TTLBD.js} +7 -6
  249. package/bundle/{sse-parser-anthropic-P7CE2MH2.js.map → sse-parser-anthropic-H42TTLBD.js.map} +1 -1
  250. package/bundle/{sse-parser-responses-EQQA5FWN.js → sse-parser-responses-WG2LY2ML.js} +7 -6
  251. package/bundle/{sse-parser-responses-EQQA5FWN.js.map → sse-parser-responses-WG2LY2ML.js.map} +1 -1
  252. package/bundle/{ssrf-guard-FZCBYIVW.js → ssrf-guard-E2KBBC5E.js} +7 -6
  253. package/bundle/{ssrf-guard-FZCBYIVW.js.map → ssrf-guard-E2KBBC5E.js.map} +1 -1
  254. package/bundle/{start-FH3GRMJ4.js → start-4IWBKLWO.js} +4 -3
  255. package/bundle/{start-FH3GRMJ4.js.map → start-4IWBKLWO.js.map} +1 -1
  256. package/bundle/{stream-single-WSG4D53C.js → stream-single-RFJNUTL6.js} +4 -3
  257. package/bundle/{stream-single-WSG4D53C.js.map → stream-single-RFJNUTL6.js.map} +1 -1
  258. package/bundle/stt-CF3CPFDC.js +15 -0
  259. package/bundle/stt-CF3CPFDC.js.map +7 -0
  260. package/bundle/subagent-runtime-P7GCFBM3.js +13 -0
  261. package/bundle/subagent-runtime-P7GCFBM3.js.map +7 -0
  262. package/bundle/subagent-runtime-USNPO4WF.js +13 -0
  263. package/bundle/subagent-runtime-USNPO4WF.js.map +7 -0
  264. package/bundle/subagent-runtime-XS2ZXYOZ.js +13 -0
  265. package/bundle/subagent-runtime-XS2ZXYOZ.js.map +7 -0
  266. package/bundle/{system-message-T5R3EYYN.js → system-message-TALP6GP2.js} +6 -5
  267. package/bundle/{system-message-T5R3EYYN.js.map → system-message-TALP6GP2.js.map} +1 -1
  268. package/bundle/{system-status-KQ6KHFJ6.js → system-status-2CR5OUDY.js} +10 -9
  269. package/bundle/{system-status-KQ6KHFJ6.js.map → system-status-2CR5OUDY.js.map} +1 -1
  270. package/bundle/task-store-KIBFZL5A.js +23 -0
  271. package/bundle/task-store-KIBFZL5A.js.map +7 -0
  272. package/bundle/{telegram-adapter-2V3XUMT5.js → telegram-adapter-ISQRW7PN.js} +34 -33
  273. package/bundle/{telegram-adapter-2V3XUMT5.js.map → telegram-adapter-ISQRW7PN.js.map} +1 -1
  274. package/bundle/telegram-adapter-QCD7AG5D.js +1062 -0
  275. package/bundle/telegram-adapter-QCD7AG5D.js.map +7 -0
  276. package/bundle/telegram-adapter-Y3PVA25S.js +1061 -0
  277. package/bundle/telegram-adapter-Y3PVA25S.js.map +7 -0
  278. package/bundle/telegram-adapter-YAXSK2RT.js +1062 -0
  279. package/bundle/telegram-adapter-YAXSK2RT.js.map +7 -0
  280. package/bundle/tool-registry-DFCCGZCB.js +39 -0
  281. package/bundle/tool-registry-DFCCGZCB.js.map +7 -0
  282. package/bundle/tool-sandbox-OZMXJZLQ.js +21 -0
  283. package/bundle/tool-sandbox-OZMXJZLQ.js.map +7 -0
  284. package/bundle/{transport-config-YLXU33RO.js → transport-config-ANPS2RYT.js} +11 -10
  285. package/bundle/transport-config-ANPS2RYT.js.map +7 -0
  286. package/bundle/update-check-O5MS6B3L.js +13 -0
  287. package/bundle/update-check-O5MS6B3L.js.map +7 -0
  288. package/bundle/usage-tracker-S4Z2G2K5.js +18 -0
  289. package/bundle/usage-tracker-S4Z2G2K5.js.map +7 -0
  290. package/bundle/user-registry-GTAJIW6E.js +17 -0
  291. package/bundle/user-registry-GTAJIW6E.js.map +7 -0
  292. package/config/.env +2 -0
  293. package/config/auto-fix.json +14 -0
  294. package/config/irc.json.example +30 -0
  295. package/config/models.json.example +229 -0
  296. package/config/peers.json.example +12 -0
  297. package/config/schemas/irc.schema.json +42 -0
  298. package/config/schemas/models.schema.json +17 -0
  299. package/config/schemas/peers.schema.json +35 -0
  300. package/config/schemas/transport.schema.json +35 -0
  301. package/config/schemas/users.schema.json +22 -0
  302. package/config/transport.default.json +30 -0
  303. package/config/transport.json.example +102 -0
  304. package/config/users.json.example +11 -0
  305. package/install-manifest.json +148 -0
  306. package/package.json +4 -2
  307. package/scripts/abtars-daemon.service +1 -0
  308. package/scripts/watchdog.sh +1 -1
  309. package/bundle/_registry.generated-M4WY2MMI.js +0 -35
  310. package/bundle/agent-registry-LT4JNQH6.js +0 -18
  311. package/bundle/browse-delivery-JXBY36GK.js +0 -17
  312. package/bundle/browser-ELNDVPLC.js +0 -18
  313. package/bundle/capability-CIL3G4FI.js +0 -17
  314. package/bundle/chunk-5R2ANXQ7.js +0 -510
  315. package/bundle/chunk-5R2ANXQ7.js.map +0 -7
  316. package/bundle/chunk-6UCRKRWR.js.map +0 -7
  317. package/bundle/chunk-M6VBAPNT.js +0 -16
  318. package/bundle/chunk-OP7BTAWY.js +0 -29
  319. package/bundle/chunk-UCQ2WC3B.js.map +0 -7
  320. package/bundle/chunk-XREWVCUO.js.map +0 -7
  321. package/bundle/chunk-Y6XAEX2Q.js.map +0 -7
  322. package/bundle/commands-BHVUOU3V.js +0 -31
  323. package/bundle/completion-buffer-P253ONKF.js +0 -13
  324. package/bundle/config-RGSDAPZN.js +0 -19
  325. package/bundle/delegation-tools-GYTS2D6A.js +0 -27
  326. package/bundle/digital-signature-OFCGSHWO.js +0 -13
  327. package/bundle/env-schema-2KBHBDGN.js +0 -19
  328. package/bundle/hook-system-6Q5YTR53.js +0 -17
  329. package/bundle/hotskills-K7BM4YLB.js +0 -12
  330. package/bundle/install-6HRZVKUM.js +0 -15
  331. package/bundle/install-manifest-SPQRUNXL.js.map +0 -7
  332. package/bundle/message-pipeline-LLH5SYMO.js +0 -33
  333. package/bundle/model-health-registry-35LQNVQR.js +0 -11
  334. package/bundle/notification-Y5S5MMLV.js +0 -13
  335. package/bundle/paths-G33RZWZ7.js +0 -17
  336. package/bundle/peer-config-VK6EDLN5.js +0 -16
  337. package/bundle/phase-transport-KYERDL2O.js +0 -22
  338. package/bundle/skill-stats-LLEXEXLR.js +0 -22
  339. package/bundle/sleep-OYIUOVQD.js +0 -19
  340. package/bundle/soul-loader-54WCVNLJ.js +0 -16
  341. package/bundle/src-JL4PVO23.js +0 -8
  342. package/bundle/stt-2UH3RITX.js +0 -14
  343. package/bundle/subagent-runtime-LE2ZXH3G.js +0 -12
  344. package/bundle/task-store-K7CQDEPI.js +0 -22
  345. package/bundle/tool-registry-MU3OX4UI.js +0 -38
  346. package/bundle/tool-sandbox-VYOK4ZOA.js +0 -20
  347. package/bundle/update-QCW5LXRN.js +0 -13
  348. package/bundle/update-check-27KZSAP6.js +0 -12
  349. package/bundle/usage-tracker-OVVEVMOY.js +0 -17
  350. package/bundle/user-registry-D4SD73UV.js +0 -16
  351. /package/bundle/{agent-registry-LT4JNQH6.js.map → agent-registry-5M77ZOMV.js.map} +0 -0
  352. /package/bundle/{bridge-lock-transport-4AC2G5G6.js.map → agent-registry-VJMNIQ5W.js.map} +0 -0
  353. /package/bundle/{browse-delivery-JXBY36GK.js.map → bridge-lock-transport-HO545SBK.js.map} +0 -0
  354. /package/bundle/{browser-ELNDVPLC.js.map → browse-delivery-64GQIUHG.js.map} +0 -0
  355. /package/bundle/{capability-CIL3G4FI.js.map → browser-EXR5OQGK.js.map} +0 -0
  356. /package/bundle/{chunk-NWDBD4PA.js.map → capability-HIE7UGFU.js.map} +0 -0
  357. /package/bundle/{commands-BHVUOU3V.js.map → chunk-7K2YZTLD.js.map} +0 -0
  358. /package/bundle/{completion-buffer-P253ONKF.js.map → commands-AIL4XOIZ.js.map} +0 -0
  359. /package/bundle/{config-RGSDAPZN.js.map → commands-K77NVSXZ.js.map} +0 -0
  360. /package/bundle/{delegation-tools-GYTS2D6A.js.map → commands-V6RSVC4Y.js.map} +0 -0
  361. /package/bundle/{deploy-lib-import-32ZFKHWP.js.map → completion-buffer-S3LXDZG2.js.map} +0 -0
  362. /package/bundle/{digital-signature-OFCGSHWO.js.map → config-C6VHRJQ7.js.map} +0 -0
  363. /package/bundle/{env-schema-2KBHBDGN.js.map → delegation-tools-PF7RD2RW.js.map} +0 -0
  364. /package/bundle/{hook-system-6Q5YTR53.js.map → deploy-lib-import-ODLDL2DB.js.map} +0 -0
  365. /package/bundle/{hotskills-K7BM4YLB.js.map → digital-signature-PNY4TR2W.js.map} +0 -0
  366. /package/bundle/{install-6HRZVKUM.js.map → env-schema-DGD6QWPA.js.map} +0 -0
  367. /package/bundle/{message-pipeline-LLH5SYMO.js.map → hook-system-POI5VRIX.js.map} +0 -0
  368. /package/bundle/{model-health-registry-35LQNVQR.js.map → hotskills-6ECHLXTJ.js.map} +0 -0
  369. /package/bundle/{notification-Y5S5MMLV.js.map → install-24XR5FO5.js.map} +0 -0
  370. /package/bundle/{paths-G33RZWZ7.js.map → install-AJ7VW76P.js.map} +0 -0
  371. /package/bundle/{peer-config-VK6EDLN5.js.map → message-pipeline-ANSMPK5O.js.map} +0 -0
  372. /package/bundle/{phase-transport-KYERDL2O.js.map → message-pipeline-HXZMRGXZ.js.map} +0 -0
  373. /package/bundle/{skill-stats-LLEXEXLR.js.map → message-pipeline-XUUTGPFH.js.map} +0 -0
  374. /package/bundle/{sleep-OYIUOVQD.js.map → model-health-registry-7ECZFCW4.js.map} +0 -0
  375. /package/bundle/{soul-loader-54WCVNLJ.js.map → model-health-registry-LDC76RPP.js.map} +0 -0
  376. /package/bundle/{src-JL4PVO23.js.map → notification-OJ4YE4VG.js.map} +0 -0
  377. /package/bundle/{stt-2UH3RITX.js.map → paths-ZJYIDND2.js.map} +0 -0
  378. /package/bundle/{subagent-runtime-LE2ZXH3G.js.map → peer-config-D5A4454H.js.map} +0 -0
  379. /package/bundle/{task-store-K7CQDEPI.js.map → phase-transport-43NP5XBK.js.map} +0 -0
  380. /package/bundle/{tool-registry-MU3OX4UI.js.map → phase-transport-GNUZI6EW.js.map} +0 -0
  381. /package/bundle/{tool-sandbox-VYOK4ZOA.js.map → phase-transport-Q7K6V3VZ.js.map} +0 -0
  382. /package/bundle/{transport-config-YLXU33RO.js.map → phase-transport-SLJXIAY5.js.map} +0 -0
  383. /package/bundle/{update-QCW5LXRN.js.map → skill-stats-IPVKMWN3.js.map} +0 -0
  384. /package/bundle/{update-check-27KZSAP6.js.map → sleep-4NVWZHVN.js.map} +0 -0
  385. /package/bundle/{usage-tracker-OVVEVMOY.js.map → soul-bundle-7EYTEKFE.js.map} +0 -0
  386. /package/bundle/{user-registry-D4SD73UV.js.map → soul-loader-7FN7WDHM.js.map} +0 -0
@@ -1,37 +1,37 @@
1
- import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
2
- import {
3
- showHintOnce,
4
- update
5
- } from "./chunk-5R2ANXQ7.js";
1
+ #!/usr/bin/env node
2
+ import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
6
3
  import {
7
4
  install
8
- } from "./chunk-XREWVCUO.js";
5
+ } from "./chunk-7CHLS36W.js";
9
6
  import {
7
+ RETENTION,
10
8
  acquireLock,
11
9
  activate,
12
10
  emptyManifest,
11
+ hashFile,
13
12
  inspectLock,
14
13
  packagePaths,
14
+ pruneReleases,
15
15
  readCurrent,
16
16
  readManifest,
17
17
  releaseExists,
18
18
  writeManifest
19
- } from "./chunk-265TPOPC.js";
19
+ } from "./chunk-HXJRZWKA.js";
20
20
  import {
21
21
  restart
22
- } from "./chunk-ZXPXCDA6.js";
22
+ } from "./chunk-XOCP5BMO.js";
23
23
  import {
24
24
  init_log_and_swallow,
25
25
  logAndSwallow
26
- } from "./chunk-FMWKEPM7.js";
27
- import "./chunk-BUUVFUPO.js";
26
+ } from "./chunk-EX2SRTUE.js";
27
+ import "./chunk-2BY6I4P5.js";
28
28
  import {
29
29
  abtarsHome,
30
30
  init_paths
31
- } from "./chunk-X76UX47U.js";
31
+ } from "./chunk-MJ6PHMOK.js";
32
32
  import {
33
33
  __require
34
- } from "./chunk-NWDBD4PA.js";
34
+ } from "./chunk-7K2YZTLD.js";
35
35
 
36
36
  // src/cli/commands/doctor.ts
37
37
  import { spawn } from "node:child_process";
@@ -135,11 +135,11 @@ function removeLock(path) {
135
135
  }
136
136
  async function stop(opts) {
137
137
  const home = abtarsHome2();
138
- const manifestPath = join2(home, "manifest.json");
138
+ const manifestPath2 = join2(home, "manifest.json");
139
139
  const watchdogLock = join2(home, "watchdog.lock");
140
140
  const bridgeLock = join2(home, "bridge.lock");
141
141
  const force = opts.force ?? false;
142
- const installMode = readJsonField(manifestPath, "installMode");
142
+ const installMode = readJsonField(manifestPath2, "installMode");
143
143
  if (installMode === "supervised-daemon" && !force) {
144
144
  process.stderr.write(`Bridge runs under supervised-daemon \u2014 use supervisor stop (supervisor will respawn if you kill the process directly).
145
145
  `);
@@ -412,8 +412,45 @@ function collectDir(dir, prefix, out) {
412
412
  // src/cli/commands/onboard.ts
413
413
  init_log_and_swallow();
414
414
  import { mkdir, readFile, writeFile } from "node:fs/promises";
415
- import { dirname as dirname2, join as join5 } from "node:path";
415
+ import { dirname as dirname2, join as join6 } from "node:path";
416
416
  import { fileURLToPath } from "node:url";
417
+
418
+ // src/components/hints.ts
419
+ import { existsSync as existsSync4, readFileSync as readFileSync2, writeFileSync, renameSync as renameSync2 } from "node:fs";
420
+ import { join as join5 } from "node:path";
421
+ function manifestPath() {
422
+ const home = process.env["ABTARS_HOME"] ?? join5(process.env["HOME"] ?? "", ".abtars");
423
+ return join5(home, "manifest.json");
424
+ }
425
+ function readManifest2() {
426
+ const path = manifestPath();
427
+ if (!existsSync4(path)) return {};
428
+ try {
429
+ return JSON.parse(readFileSync2(path, "utf-8"));
430
+ } catch {
431
+ return {};
432
+ }
433
+ }
434
+ function writeManifestAtomic(data) {
435
+ const path = manifestPath();
436
+ const tmp = path + ".tmp";
437
+ writeFileSync(tmp, JSON.stringify(data, null, 2) + "\n");
438
+ renameSync2(tmp, path);
439
+ }
440
+ function showHintOnce(id, text) {
441
+ const manifest = readManifest2();
442
+ const seen = manifest["hintsSeen"] ?? {};
443
+ if (seen[id]) return;
444
+ process.stderr.write(`
445
+ \u{1F4A1} ${text}
446
+
447
+ `);
448
+ seen[id] = (/* @__PURE__ */ new Date()).toISOString();
449
+ manifest["hintsSeen"] = seen;
450
+ writeManifestAtomic(manifest);
451
+ }
452
+
453
+ // src/cli/commands/onboard.ts
417
454
  var VALID_PROVIDERS = ["openrouter", "anthropic", "openai", "ollama", "kiro", "gemini"];
418
455
  var PROVIDER_TRANSPORT_NAME = {
419
456
  openrouter: "openrouter",
@@ -447,12 +484,12 @@ var PROVIDER_API_KEY_ENV = {
447
484
  gemini: "GEMINI_API_KEY"
448
485
  };
449
486
  async function runInteractive(existing) {
450
- const { intro, outro, text, select, confirm: confirm2, isCancel, cancel } = await import("./dist-MTMKARCP.js");
487
+ const { intro, outro, text, select, confirm: confirm2, isCancel, cancel } = await import("./dist-J3T4XVKX.js");
451
488
  intro("abtars onboard \u2014 first-time setup");
452
489
  const noteEmpty = "press Enter to skip";
453
- const { packagePaths: pp, readManifest: rm } = await import("./deploy-lib-import-32ZFKHWP.js");
490
+ const { packagePaths: pp, readManifest: rm3 } = await import("./deploy-lib-import-ODLDL2DB.js");
454
491
  const mfPaths = pp("abtars");
455
- const mf = await rm(mfPaths.manifest);
492
+ const mf = await rm3(mfPaths.manifest);
456
493
  const installMode = mf?.installMode ?? "supervised";
457
494
  const userName = await text({
458
495
  message: "Your name",
@@ -832,7 +869,7 @@ function mergeEnvContent(existing, answers) {
832
869
  }
833
870
  async function onboard(opts) {
834
871
  const paths = packagePaths("abtars");
835
- const { initInstallLog, logInstall, logInstallHeader } = await import("./install-log-IAPHYKD4.js");
872
+ const { initInstallLog, logInstall, logInstallHeader } = await import("./install-log-Q6RUHKWC.js");
836
873
  initInstallLog(paths.home);
837
874
  logInstallHeader("onboard");
838
875
  const _origWrite = process.stdout.write.bind(process.stdout);
@@ -849,11 +886,11 @@ async function onboard(opts) {
849
886
  );
850
887
  return 2;
851
888
  }
852
- const envPath = join5(paths.config, ".env");
889
+ const envPath = join6(paths.config, ".env");
853
890
  const existing = await readExisting(envPath);
854
- const secretDir = join5(paths.home, "secret");
891
+ const secretDir = join6(paths.home, "secret");
855
892
  const { existsSync: secretExists } = await import("node:fs");
856
- const hasSecretToken = secretExists(join5(secretDir, "TELEGRAM_BOT_TOKEN")) || secretExists(join5(secretDir, "DISCORD_BOT_TOKEN"));
893
+ const hasSecretToken = secretExists(join6(secretDir, "TELEGRAM_BOT_TOKEN")) || secretExists(join6(secretDir, "DISCORD_BOT_TOKEN"));
857
894
  const hasUserConfig = existing !== null && (existing.telegramToken || existing.discordBotToken || hasSecretToken);
858
895
  if (hasUserConfig && !opts.force) {
859
896
  showHintOnce("onboard-reoffer", "Re-running onboard overwrites config. Use --force to confirm, or edit ~/.abtars/config/.env directly.");
@@ -887,7 +924,7 @@ async function onboard(opts) {
887
924
  process.stdout.write(`
888
925
  \u2713 Wrote ${envPath}
889
926
  `);
890
- const secretDirPath = join5(paths.home, "secret");
927
+ const secretDirPath = join6(paths.home, "secret");
891
928
  await mkdir(secretDirPath, { recursive: true });
892
929
  const secrets = [];
893
930
  if (answers.telegramToken) secrets.push(["TELEGRAM_BOT_TOKEN", answers.telegramToken]);
@@ -898,17 +935,17 @@ async function onboard(opts) {
898
935
  }
899
936
  if (answers.groqApiKey) secrets.push(["GROQ_API_KEY", answers.groqApiKey]);
900
937
  for (const [name, value] of secrets) {
901
- await writeFile(join5(secretDirPath, name), value, { mode: 384 });
938
+ await writeFile(join6(secretDirPath, name), value, { mode: 384 });
902
939
  }
903
940
  if (secrets.length > 0) process.stdout.write(`\u2713 ${secrets.length} secrets \u2192 ${secretDirPath}
904
941
  `);
905
- const { writeManifest: writeManifest2 } = await import("./deploy-lib-import-32ZFKHWP.js");
942
+ const { writeManifest: writeManifest2 } = await import("./deploy-lib-import-ODLDL2DB.js");
906
943
  const mf = await readManifest(paths.manifest);
907
944
  if (mf) await writeManifest2(paths.manifest, { ...mf, installMode: answers.installMode });
908
945
  process.stdout.write(`\u2713 install mode: ${answers.installMode}
909
946
  `);
910
947
  {
911
- const transportPath = join5(paths.config, "transport.json");
948
+ const transportPath = join6(paths.config, "transport.json");
912
949
  let tc = {};
913
950
  try {
914
951
  tc = JSON.parse(await readFile(transportPath, "utf-8"));
@@ -940,7 +977,7 @@ async function onboard(opts) {
940
977
  `);
941
978
  }
942
979
  {
943
- const usersPath = join5(paths.config, "users.json");
980
+ const usersPath = join6(paths.config, "users.json");
944
981
  const userId = answers.userName.toLowerCase().replace(/[^a-z0-9]/g, "") || "user";
945
982
  const platforms = {};
946
983
  if (answers.telegramChatId) platforms["telegram"] = parseInt(answers.telegramChatId, 10) || answers.telegramChatId;
@@ -961,11 +998,11 @@ async function onboard(opts) {
961
998
  `);
962
999
  }
963
1000
  if (answers.userName) {
964
- const abmindHome = process.env["ABMIND_HOME"] ?? join5(dirname2(paths.home), ".abmind");
965
- const profileDir = join5(abmindHome, "memory", "core");
1001
+ const abmindHome = process.env["ABMIND_HOME"] ?? join6(dirname2(paths.home), ".abmind");
1002
+ const profileDir = join6(abmindHome, "memory", "core");
966
1003
  const { existsSync: profileExists } = await import("node:fs");
967
1004
  if (profileExists(profileDir)) {
968
- const profilePath = join5(profileDir, "user_profile.md");
1005
+ const profilePath = join6(profileDir, "user_profile.md");
969
1006
  if (!profileExists(profilePath)) {
970
1007
  await writeFile(profilePath, `# User Profile
971
1008
 
@@ -993,13 +1030,13 @@ Name: ${answers.userName}
993
1030
  if (answers.telegramChatId) {
994
1031
  await seedDefaultTasks(answers.telegramChatId, paths.home);
995
1032
  }
996
- const agentsDir = join5(paths.home, "agents");
997
- const agentRulesPath = join5(agentsDir, "default.md");
1033
+ const agentsDir = join6(paths.home, "agents");
1034
+ const agentRulesPath = join6(agentsDir, "default.md");
998
1035
  const { existsSync: agentRulesExists } = await import("node:fs");
999
1036
  if (!agentRulesExists(agentRulesPath)) {
1000
1037
  await mkdir(agentsDir, { recursive: true });
1001
- const bundledPath = join5(dirname2(fileURLToPath(import.meta.url)), "agents", "default.md");
1002
- const fallbackPath = join5(dirname2(fileURLToPath(import.meta.url)), "..", "..", "agents", "default.md");
1038
+ const bundledPath = join6(dirname2(fileURLToPath(import.meta.url)), "agents", "default.md");
1039
+ const fallbackPath = join6(dirname2(fileURLToPath(import.meta.url)), "..", "..", "agents", "default.md");
1003
1040
  let content = "# Agent-to-Agent API\n\n<!-- See docs for configuration -->\n";
1004
1041
  try {
1005
1042
  content = await readFile(bundledPath, "utf-8");
@@ -1015,7 +1052,7 @@ Name: ${answers.userName}
1015
1052
  }
1016
1053
  process.stdout.write(`
1017
1054
  \u{1F4A1} To edit providers, agents, hailMary, fallback chains \u2014 edit:
1018
- ${join5(paths.config, "transport.json")}
1055
+ ${join6(paths.config, "transport.json")}
1019
1056
  Docs: https://aksika.github.io/abtars/
1020
1057
  `);
1021
1058
  if (opts.nonInteractive) {
@@ -1024,33 +1061,22 @@ Next: 'abtars update' to build, then start the bridge.
1024
1061
  `);
1025
1062
  return 0;
1026
1063
  }
1027
- const { existsSync: existsSync4 } = await import("node:fs");
1028
- const inRepo = existsSync4(join5(process.cwd(), ".git")) && existsSync4(join5(process.cwd(), "package.json"));
1029
- if (!inRepo) {
1064
+ const { existsSync: existsSync8 } = await import("node:fs");
1065
+ const hasRelease = existsSync8(join6(paths.home, "current"));
1066
+ if (!hasRelease) {
1030
1067
  process.stdout.write(`
1031
- Next: cd into the abtars repo and run 'abtars update' to build and activate.
1068
+ Next: run 'abtars update' to stage the release, then start the bridge.
1032
1069
  `);
1033
1070
  return 0;
1034
1071
  }
1035
- process.stdout.write(`
1036
- \u2500\u2500 Running 'abtars update' \u2500\u2500
1037
- `);
1038
- const { update: update2 } = await import("./update-QCW5LXRN.js");
1039
- const updRc = await update2({ source: "local", fromLocal: true, allowAbmindMismatch: false });
1040
- if (updRc !== 0) {
1041
- process.stderr.write(`
1042
- \u26A0\uFE0F 'abtars update' exited with code ${updRc}. Fix and re-run manually.
1043
- `);
1044
- return updRc;
1045
- }
1046
1072
  try {
1047
- const { spawnSync: spawnSync2 } = await import("node:child_process");
1048
- const which = spawnSync2("which", ["abmind"], { encoding: "utf-8" });
1073
+ const { spawnSync: spawnSync4 } = await import("node:child_process");
1074
+ const which = spawnSync4("which", ["abmind"], { encoding: "utf-8" });
1049
1075
  if (which.status === 0) {
1050
1076
  process.stdout.write(`
1051
1077
  \u2500\u2500 Running 'abmind install' \u2500\u2500
1052
1078
  `);
1053
- const r = spawnSync2("abmind", ["install"], { stdio: "inherit" });
1079
+ const r = spawnSync4("abmind", ["install"], { stdio: "inherit" });
1054
1080
  if (r.status !== 0) process.stdout.write(`\u26A0 abmind install exited with code ${r.status}
1055
1081
  `);
1056
1082
  } else {
@@ -1060,7 +1086,7 @@ Next: cd into the abtars repo and run 'abtars update' to build and activate.
1060
1086
  }
1061
1087
  } catch {
1062
1088
  }
1063
- const { confirm: confirm2 } = await import("./dist-MTMKARCP.js");
1089
+ const { confirm: confirm2 } = await import("./dist-J3T4XVKX.js");
1064
1090
  const startCmds = [];
1065
1091
  if (answers.installMode === "simple") {
1066
1092
  startCmds.push("abtars start");
@@ -1079,8 +1105,8 @@ Next: cd into the abtars repo and run 'abtars update' to build and activate.
1079
1105
  if (startCmds.length > 0) {
1080
1106
  for (const cmd of startCmds) process.stdout.write(` \u2192 ${cmd}
1081
1107
  `);
1082
- const run = await confirm2({ message: `Enable and start the watchdog service?`, initialValue: true });
1083
- if (run === true) {
1108
+ const run2 = await confirm2({ message: `Enable and start the watchdog service?`, initialValue: true });
1109
+ if (run2 === true) {
1084
1110
  for (const cmd of startCmds) {
1085
1111
  await new Promise((resolve) => {
1086
1112
  const child = spawn2("bash", ["-lc", cmd], { stdio: "inherit" });
@@ -1098,9 +1124,9 @@ Next: cd into the abtars repo and run 'abtars update' to build and activate.
1098
1124
  return 0;
1099
1125
  }
1100
1126
  async function seedDefaultTasks(chatId, abtarsHome4) {
1101
- const { existsSync: existsSync4 } = await import("node:fs");
1102
- const tasksJson = join5(abtarsHome4, "state", "tasks.json");
1103
- if (existsSync4(tasksJson)) {
1127
+ const { existsSync: existsSync8 } = await import("node:fs");
1128
+ const tasksJson = join6(abtarsHome4, "state", "tasks.json");
1129
+ if (existsSync8(tasksJson)) {
1104
1130
  process.stdout.write(`\u2022 tasks.json exists \u2014 skipping default-task seed
1105
1131
  `);
1106
1132
  return;
@@ -1108,12 +1134,12 @@ async function seedDefaultTasks(chatId, abtarsHome4) {
1108
1134
  const { fileURLToPath: fileURLToPath2 } = await import("node:url");
1109
1135
  const here = dirname2(fileURLToPath2(import.meta.url));
1110
1136
  const candidates = [
1111
- join5(here, "..", "..", "..", "tasks.default.json"),
1112
- join5(here, "..", "..", "tasks.default.json")
1137
+ join6(here, "..", "..", "..", "tasks.default.json"),
1138
+ join6(here, "..", "..", "tasks.default.json")
1113
1139
  ];
1114
1140
  let templatePath = null;
1115
1141
  for (const p of candidates) {
1116
- if (existsSync4(p)) {
1142
+ if (existsSync8(p)) {
1117
1143
  templatePath = p;
1118
1144
  break;
1119
1145
  }
@@ -1132,7 +1158,7 @@ async function seedDefaultTasks(chatId, abtarsHome4) {
1132
1158
  `);
1133
1159
  return;
1134
1160
  }
1135
- const { spawnSync: spawnSync2 } = await import("node:child_process");
1161
+ const { spawnSync: spawnSync4 } = await import("node:child_process");
1136
1162
  let seeded = 0;
1137
1163
  for (const entry of template) {
1138
1164
  const args = [
@@ -1151,7 +1177,7 @@ async function seedDefaultTasks(chatId, abtarsHome4) {
1151
1177
  if (entry.id) args.push("--id", entry.id);
1152
1178
  if (entry.title) args.push("--title", entry.title);
1153
1179
  if (entry.maxRunsPerDay) args.push("--max-runs-per-day", String(entry.maxRunsPerDay));
1154
- const result = spawnSync2("abtars-task", args, {
1180
+ const result = spawnSync4("abtars-task", args, {
1155
1181
  encoding: "utf-8",
1156
1182
  env: { ...process.env, ABTARS_HOME: abtarsHome4 }
1157
1183
  });
@@ -1271,17 +1297,26 @@ Run 'abtars install' to set up.
1271
1297
  ` commit: ${manifest.commit ?? "(unknown)"}`,
1272
1298
  ` branch: ${manifest.branch ?? "(unknown)"}`,
1273
1299
  ` source: ${manifest.source}`,
1300
+ ` mode: ${manifest.installMode ?? "supervised"}`,
1274
1301
  ` activated: ${manifest.activatedAt}`,
1275
1302
  ` current ->: ${current ?? "(missing)"}`,
1276
1303
  ` host: ${manifest.host}`,
1277
1304
  ` prior: ${manifest.priorReleases.length > 0 ? manifest.priorReleases.map((r) => r.version).join(", ") : "(none)"}`
1278
1305
  ];
1279
1306
  if (lock.held) {
1307
+ const alive = (() => {
1308
+ try {
1309
+ process.kill(lock.content.pid, 0);
1310
+ return true;
1311
+ } catch {
1312
+ return false;
1313
+ }
1314
+ })();
1280
1315
  lines.push(
1281
- ` lock: HELD by pid ${lock.content.pid} (${lock.content.cmd})${lock.stale ? " \u2014 STALE" : ""}`
1316
+ ` bridge: ${alive ? "\u25CF running" : "\u2717 dead"} (pid ${lock.content.pid})${lock.stale ? " \u2014 STALE" : ""}`
1282
1317
  );
1283
1318
  } else {
1284
- lines.push(` lock: not held`);
1319
+ lines.push(` bridge: \u25CB stopped`);
1285
1320
  }
1286
1321
  process.stdout.write(`${lines.join("\n")}
1287
1322
  `);
@@ -1297,6 +1332,540 @@ Re-run 'abtars update' or 'abtars rollback' to reconcile.
1297
1332
  return 0;
1298
1333
  }
1299
1334
 
1335
+ // src/cli/commands/update.ts
1336
+ init_log_and_swallow();
1337
+ import { hostname as hostname2 } from "node:os";
1338
+ import { join as join9, dirname as dirname3 } from "node:path";
1339
+ import { readFileSync as readFileSync4, existsSync as existsSync7, mkdirSync as mkdirSync2 } from "node:fs";
1340
+ import { copyFile as copyFile2, mkdir as mkdir4, chmod, readdir, readFile as readFile3, writeFile as writeFile3 } from "node:fs/promises";
1341
+
1342
+ // src/cli/update-sources/local.ts
1343
+ import { spawnSync as spawnSync2 } from "node:child_process";
1344
+ import { existsSync as existsSync5 } from "node:fs";
1345
+ import { copyFile, cp, mkdir as mkdir2, readFile as readFile2, rm, writeFile as writeFile2 } from "node:fs/promises";
1346
+ import { join as join7 } from "node:path";
1347
+ var LocalBuildError = class extends Error {
1348
+ constructor(message, hint) {
1349
+ super(hint ? `${message}
1350
+
1351
+ ${hint}` : message);
1352
+ this.hint = hint;
1353
+ this.name = "LocalBuildError";
1354
+ }
1355
+ };
1356
+ function runCmd(cmd, args, cwd) {
1357
+ const r = spawnSync2(cmd, args, { cwd, encoding: "utf-8" });
1358
+ if (r.error) throw new LocalBuildError(`${cmd} ${args.join(" ")} failed: ${r.error.message}`);
1359
+ if (r.status !== 0) {
1360
+ throw new LocalBuildError(
1361
+ `${cmd} ${args.join(" ")} exited with status ${r.status}`,
1362
+ r.stderr?.trim() || void 0
1363
+ );
1364
+ }
1365
+ return r.stdout.trim();
1366
+ }
1367
+ function tryCmd(cmd, args, cwd) {
1368
+ const r = spawnSync2(cmd, args, { cwd, encoding: "utf-8" });
1369
+ if (r.status !== 0) return null;
1370
+ return r.stdout.trim();
1371
+ }
1372
+ function checkStaleness(repoRoot, allowStale) {
1373
+ const commit = runCmd("git", ["rev-parse", "--short", "HEAD"], repoRoot);
1374
+ const branch = tryCmd("git", ["rev-parse", "--abbrev-ref", "HEAD"], repoRoot);
1375
+ if (allowStale) return { commit, branch: branch === "HEAD" ? null : branch };
1376
+ if (branch === "HEAD" || branch === null) {
1377
+ throw new LocalBuildError(
1378
+ "Working tree is in detached HEAD (no current branch).",
1379
+ "Cannot check for staleness. Pass --from-local to proceed with the current tree."
1380
+ );
1381
+ }
1382
+ runCmd("git", ["fetch", "--quiet"], repoRoot);
1383
+ const upstream = tryCmd("git", ["rev-parse", "--abbrev-ref", `${branch}@{upstream}`], repoRoot);
1384
+ if (upstream === null) {
1385
+ throw new LocalBuildError(
1386
+ `Branch '${branch}' has no upstream configured.`,
1387
+ "Cannot check for staleness. Push the branch, or pass --from-local to proceed with the current tree."
1388
+ );
1389
+ }
1390
+ const behindStr = tryCmd("git", ["rev-list", "--count", `HEAD..${upstream}`], repoRoot);
1391
+ const behind = behindStr === null ? null : Number(behindStr);
1392
+ if (behind === null || !Number.isFinite(behind)) {
1393
+ throw new LocalBuildError(
1394
+ `Could not determine how far HEAD is behind ${upstream}.`,
1395
+ "Pass --from-local to proceed anyway."
1396
+ );
1397
+ }
1398
+ if (behind > 0) {
1399
+ throw new LocalBuildError(
1400
+ `Current branch: ${branch} (${commit})
1401
+ ${upstream} is ahead by ${behind} commit${behind === 1 ? "" : "s"}.`,
1402
+ `Run 'git pull' first, or pass --from-local to build from the current tree.`
1403
+ );
1404
+ }
1405
+ return { commit, branch };
1406
+ }
1407
+ async function readPackageVersion(repoRoot) {
1408
+ const pkg = JSON.parse(await readFile2(join7(repoRoot, "package.json"), "utf-8"));
1409
+ if (typeof pkg.version !== "string") {
1410
+ throw new LocalBuildError("package.json has no version field.");
1411
+ }
1412
+ return pkg.version;
1413
+ }
1414
+ function makeLocalBuildSource(opts = {}) {
1415
+ const repoRoot = opts.repoRoot ?? process.cwd();
1416
+ const isNpmPackage = !existsSync5(join7(repoRoot, ".git"));
1417
+ return {
1418
+ name: "local",
1419
+ async prepare(ctx) {
1420
+ if (isNpmPackage) {
1421
+ const bundleDir = join7(repoRoot, "bundle");
1422
+ if (!existsSync5(bundleDir)) {
1423
+ throw new Error(`No bundle/ found at ${repoRoot}. Run from the abtars npm package or a git checkout.`);
1424
+ }
1425
+ const pkgVersion2 = await readPackageVersion(repoRoot);
1426
+ const version2 = pkgVersion2;
1427
+ const stagedPath2 = join7(ctx.releasesDir, version2);
1428
+ await rm(stagedPath2, { recursive: true, force: true });
1429
+ await mkdir2(stagedPath2, { recursive: true });
1430
+ await cp(bundleDir, join7(stagedPath2, "bundle"), { recursive: true });
1431
+ const coreDir = join7(repoRoot, "core");
1432
+ if (existsSync5(coreDir)) await cp(coreDir, join7(stagedPath2, "core"), { recursive: true });
1433
+ const scriptsSrc = join7(repoRoot, "scripts");
1434
+ if (existsSync5(scriptsSrc)) await cp(scriptsSrc, join7(stagedPath2, "scripts"), { recursive: true });
1435
+ const configSrc = join7(repoRoot, "config");
1436
+ if (existsSync5(configSrc)) await cp(configSrc, join7(stagedPath2, "config"), { recursive: true });
1437
+ const manifestSrc = join7(repoRoot, "install-manifest.json");
1438
+ if (existsSync5(manifestSrc)) await copyFile(manifestSrc, join7(stagedPath2, "install-manifest.json"));
1439
+ await writeFile2(join7(stagedPath2, "package.json"), JSON.stringify({ type: "module", name: "abtars", version: version2 }, null, 2) + "\n");
1440
+ process.stdout.write(`\u2713 staged ${version2} (from npm package)
1441
+ `);
1442
+ return { version: version2, stagedPath: stagedPath2, commit: null, branch: null, packageLockHash: null, source: "local" };
1443
+ }
1444
+ const { commit, branch } = checkStaleness(repoRoot, opts.allowStale === true || ctx.allowStale);
1445
+ const pkgVersion = await readPackageVersion(repoRoot);
1446
+ const version = `${pkgVersion}-${commit}`;
1447
+ if (opts.skipInstall !== true) {
1448
+ runCmd("npm", ["install", "--no-audit", "--no-fund"], repoRoot);
1449
+ }
1450
+ const useBundle = process.env["AGENTBRIDGE_BUILD_MODE"] !== "tsc";
1451
+ if (useBundle) {
1452
+ runCmd("npm", ["run", "bundle"], repoRoot);
1453
+ const stagedPath2 = join7(ctx.releasesDir, version);
1454
+ await rm(stagedPath2, { recursive: true, force: true });
1455
+ await mkdir2(stagedPath2, { recursive: true });
1456
+ await cp(join7(repoRoot, "bundle"), join7(stagedPath2, "bundle"), { recursive: true });
1457
+ const coreSkillsSrc = join7(repoRoot, "core", "skills");
1458
+ if (existsSync5(coreSkillsSrc)) {
1459
+ await cp(coreSkillsSrc, join7(stagedPath2, "core", "skills"), { recursive: true });
1460
+ }
1461
+ await writeFile2(join7(stagedPath2, "package.json"), JSON.stringify({ type: "module", name: "abtars", version }, null, 2) + "\n");
1462
+ await copyFile(join7(repoRoot, "install-manifest.json"), join7(stagedPath2, "install-manifest.json"));
1463
+ const packageLockHash2 = await hashFile(join7(repoRoot, "package-lock.json"));
1464
+ return { version, stagedPath: stagedPath2, commit, branch, packageLockHash: packageLockHash2, source: "local" };
1465
+ }
1466
+ runCmd("npm", ["run", "build"], repoRoot);
1467
+ const stagedPath = join7(ctx.releasesDir, version);
1468
+ await rm(stagedPath, { recursive: true, force: true });
1469
+ await mkdir2(stagedPath, { recursive: true });
1470
+ await cp(join7(repoRoot, "dist"), join7(stagedPath, "dist"), { recursive: true });
1471
+ await copyFile(join7(repoRoot, "install-manifest.json"), join7(stagedPath, "install-manifest.json"));
1472
+ await rm(ctx.nodeModulesDir, { recursive: true, force: true });
1473
+ await mkdir2(ctx.nodeModulesDir, { recursive: true });
1474
+ const rsyncResult = spawnSync2(
1475
+ "rsync",
1476
+ ["-aL", "--quiet", `${join7(repoRoot, "node_modules")}/`, `${ctx.nodeModulesDir}/`],
1477
+ { stdio: "inherit" }
1478
+ );
1479
+ if (rsyncResult.status !== 0) {
1480
+ throw new LocalBuildError(
1481
+ `rsync of node_modules failed (status ${rsyncResult.status ?? -1})`,
1482
+ `Ensure rsync is installed. Falling back to node cp would re-create symlinks.`
1483
+ );
1484
+ }
1485
+ const packageLockHash = await hashFile(join7(repoRoot, "package-lock.json"));
1486
+ return { version, stagedPath, commit, branch, packageLockHash, source: "local" };
1487
+ }
1488
+ };
1489
+ }
1490
+
1491
+ // src/cli/update-sources/npm.ts
1492
+ import { spawnSync as spawnSync3 } from "node:child_process";
1493
+ import { existsSync as existsSync6, readFileSync as readFileSync3, unlinkSync as unlinkSync4 } from "node:fs";
1494
+ import { mkdir as mkdir3, rm as rm2 } from "node:fs/promises";
1495
+ import { join as join8 } from "node:path";
1496
+ var TIMEOUT_MS = 6e4;
1497
+ function run(cmd, args, cwd) {
1498
+ const r = spawnSync3(cmd, args, { cwd, encoding: "utf-8", timeout: TIMEOUT_MS });
1499
+ if (r.error) throw new Error(`${cmd} ${args.join(" ")}: ${r.error.message}`);
1500
+ if (r.status !== 0) throw new Error(`${cmd} ${args.join(" ")} exited ${r.status}: ${r.stderr?.trim()}`);
1501
+ return r.stdout.trim();
1502
+ }
1503
+ function readLocalVersion(home) {
1504
+ try {
1505
+ const pkg = JSON.parse(readFileSync3(join8(home, "current", "package.json"), "utf-8"));
1506
+ return pkg.version ?? null;
1507
+ } catch {
1508
+ return null;
1509
+ }
1510
+ }
1511
+ function makeNpmSource(packageName) {
1512
+ return {
1513
+ name: "npm",
1514
+ async prepare(ctx) {
1515
+ const latest = run("npm", ["view", packageName, "version"], ctx.home);
1516
+ const current = readLocalVersion(ctx.home);
1517
+ if (latest === current) {
1518
+ throw new Error(`Already at latest version (${latest}). Nothing to update.`);
1519
+ }
1520
+ const stagedPath = join8(ctx.releasesDir, latest);
1521
+ await rm2(stagedPath, { recursive: true, force: true });
1522
+ await mkdir3(stagedPath, { recursive: true });
1523
+ run("npm", ["pack", `${packageName}@${latest}`, "--pack-destination", stagedPath], stagedPath);
1524
+ const tgzName = `${packageName}-${latest}.tgz`.replace("@", "").replace("/", "-");
1525
+ const tgzPath = join8(stagedPath, tgzName);
1526
+ run("tar", ["-xzf", tgzPath, "--strip-components=1"], stagedPath);
1527
+ if (existsSync6(tgzPath)) unlinkSync4(tgzPath);
1528
+ run("npm", ["install", "--omit=dev", "--no-audit", "--no-fund"], stagedPath);
1529
+ return { version: latest, stagedPath, commit: null, branch: null, packageLockHash: null, source: "npm" };
1530
+ }
1531
+ };
1532
+ }
1533
+
1534
+ // src/cli/commands/update.ts
1535
+ function readJsonField2(file, field) {
1536
+ try {
1537
+ return JSON.parse(readFileSync4(file, "utf-8"))[field];
1538
+ } catch {
1539
+ return void 0;
1540
+ }
1541
+ }
1542
+ async function update(opts) {
1543
+ if (opts.source !== "local" && opts.source !== "npm") {
1544
+ process.stderr.write(`--source ${opts.source} is not yet supported.
1545
+ Use --source local (default) or --source npm.
1546
+ `);
1547
+ return 2;
1548
+ }
1549
+ const paths = packagePaths("abtars");
1550
+ if (!existsSync7(paths.releases) && existsSync7(join9(paths.home, "current"))) {
1551
+ process.stdout.write("Migrating old layout \u2192 releases/...\n");
1552
+ mkdirSync2(paths.releases, { recursive: true });
1553
+ }
1554
+ const release = await acquireLock(paths.lock, `update --source ${opts.source}`);
1555
+ try {
1556
+ let repoRoot = opts.repoRoot ?? process.cwd();
1557
+ if (!opts.repoRoot && !existsSync7(join9(repoRoot, ".git"))) {
1558
+ const { realpathSync } = await import("node:fs");
1559
+ const scriptPath = realpathSync(process.argv[1] ?? "");
1560
+ const candidate = join9(dirname3(scriptPath), "..");
1561
+ if (existsSync7(join9(candidate, "bundle"))) repoRoot = candidate;
1562
+ }
1563
+ const source = opts.source === "npm" ? makeNpmSource("abtars") : makeLocalBuildSource({ repoRoot, allowStale: opts.fromLocal });
1564
+ if (opts.fromLocal) {
1565
+ showHintOnce("update-from-local", "Building from working copy (--from-local). To sync with remote first: git pull && abtars update");
1566
+ }
1567
+ process.stdout.write(`Building from local checkout (${process.cwd()})...
1568
+ `);
1569
+ const staged = await source.prepare({
1570
+ releasesDir: paths.releases,
1571
+ nodeModulesDir: paths.nodeModules,
1572
+ home: paths.home,
1573
+ allowStale: opts.fromLocal
1574
+ });
1575
+ process.stdout.write(`\u2713 staged ${staged.version} at ${staged.stagedPath}
1576
+ `);
1577
+ {
1578
+ const pkgPath = join9(staged.stagedPath, "package.json");
1579
+ const { readFileSync: readFileSync5, writeFileSync: writeFileSync2 } = await import("node:fs");
1580
+ try {
1581
+ const pkg = JSON.parse(readFileSync5(pkgPath, "utf-8"));
1582
+ const externals = { patchright: "^1.59.4", "rettiwt-api": "^4.1.3" };
1583
+ pkg.dependencies = { ...pkg.dependencies, ...externals };
1584
+ writeFileSync2(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
1585
+ const { execSync } = await import("node:child_process");
1586
+ execSync("npm install --omit=dev --ignore-scripts 2>/dev/null", { cwd: staged.stagedPath, timeout: 6e4 });
1587
+ process.stdout.write(`\u2713 external deps installed
1588
+ `);
1589
+ } catch (err) {
1590
+ process.stdout.write(`\u26A0 external deps install failed: ${err instanceof Error ? err.message : String(err)}
1591
+ `);
1592
+ }
1593
+ }
1594
+ {
1595
+ const { existsSync: existsSync8, unlinkSync: unlinkSync5, symlinkSync } = await import("node:fs");
1596
+ const mainLink = join9(staged.stagedPath, "main.js");
1597
+ try {
1598
+ unlinkSync5(mainLink);
1599
+ } catch (err) {
1600
+ logAndSwallow("update", "op", err);
1601
+ }
1602
+ const entry = existsSync8(join9(staged.stagedPath, "bundle", "abtars.js")) ? "bundle/abtars.js" : "dist/main.js";
1603
+ symlinkSync(entry, mainLink);
1604
+ }
1605
+ const { existsSync: ex2, lstatSync, readlinkSync: readlinkSync2, symlinkSync: sl2, mkdirSync: mk2 } = await import("node:fs");
1606
+ const oldNm = join9(paths.home, "current", "node_modules");
1607
+ const preservedLinks = [];
1608
+ if (ex2(oldNm)) {
1609
+ for (const name of ["abmind", "better-sqlite3"]) {
1610
+ const p = join9(oldNm, name);
1611
+ try {
1612
+ if (ex2(p) && lstatSync(p).isSymbolicLink()) preservedLinks.push({ name, target: readlinkSync2(p) });
1613
+ } catch {
1614
+ }
1615
+ }
1616
+ }
1617
+ await activate(paths.current, staged.version);
1618
+ process.stdout.write(`\u2713 current -> releases/${staged.version}
1619
+ `);
1620
+ if (preservedLinks.length > 0) {
1621
+ const newNm = join9(paths.home, "current", "node_modules");
1622
+ mk2(newNm, { recursive: true });
1623
+ for (const { name, target } of preservedLinks) {
1624
+ try {
1625
+ sl2(target, join9(newNm, name));
1626
+ } catch {
1627
+ }
1628
+ }
1629
+ }
1630
+ const prior = await readManifest(paths.manifest);
1631
+ const now = (/* @__PURE__ */ new Date()).toISOString();
1632
+ const newPriorReleases = prior?.version ? [
1633
+ {
1634
+ version: prior.version,
1635
+ commit: prior.commit,
1636
+ activatedAt: prior.activatedAt,
1637
+ packageLockHash: prior.packageLockHash
1638
+ },
1639
+ ...prior.priorReleases ?? []
1640
+ ].slice(0, RETENTION - 1) : prior?.priorReleases ?? [];
1641
+ await writeManifest(paths.manifest, {
1642
+ ...prior ?? emptyManifest("abtars", hostname2()),
1643
+ version: staged.version,
1644
+ commit: staged.commit,
1645
+ branch: staged.branch,
1646
+ packageLockHash: staged.packageLockHash,
1647
+ activatedAt: now,
1648
+ source: "local",
1649
+ priorReleases: newPriorReleases
1650
+ });
1651
+ process.stdout.write(`\u2713 manifest updated
1652
+ `);
1653
+ const pruned = await pruneReleases(
1654
+ paths.releases,
1655
+ [staged.version, ...newPriorReleases.map((r) => r.version)],
1656
+ staged.version,
1657
+ RETENTION
1658
+ );
1659
+ if (pruned.length > 0) {
1660
+ process.stdout.write(`\u2713 pruned ${pruned.length} old release${pruned.length === 1 ? "" : "s"}: ${pruned.join(", ")}
1661
+ `);
1662
+ }
1663
+ process.stdout.write(`
1664
+ Update complete: ${staged.version}
1665
+ `);
1666
+ const transportJson = join9(paths.home, "config", "transport.json");
1667
+ if (existsSync7(transportJson)) {
1668
+ try {
1669
+ const tc = JSON.parse(readFileSync4(transportJson, "utf-8"));
1670
+ let cleared = false;
1671
+ for (const agent of Object.values(tc.agents ?? {})) {
1672
+ if (agent.demoted) {
1673
+ delete agent.demoted;
1674
+ delete agent.demotedReason;
1675
+ delete agent.demotedModel;
1676
+ cleared = true;
1677
+ }
1678
+ for (const fb of agent.fallbacks ?? []) {
1679
+ if (fb.demoted) {
1680
+ delete fb.demoted;
1681
+ delete fb.demotedReason;
1682
+ delete fb.demotedModel;
1683
+ cleared = true;
1684
+ }
1685
+ }
1686
+ }
1687
+ if (cleared) {
1688
+ const { writeFileSync: wfs } = await import("node:fs");
1689
+ wfs(transportJson, JSON.stringify(tc, null, 2) + "\n");
1690
+ }
1691
+ } catch {
1692
+ }
1693
+ }
1694
+ const { loadManifest } = await import("./install-manifest-ZETY4AFS.js");
1695
+ const sourceRoot = staged.stagedPath;
1696
+ const installManifest = loadManifest(sourceRoot);
1697
+ const repoScripts = join9(sourceRoot, "scripts");
1698
+ const destScripts = join9(paths.home, "scripts");
1699
+ await mkdir4(destScripts, { recursive: true });
1700
+ const allScriptFiles = await readdir(repoScripts).catch(() => []);
1701
+ const matchesInclude = (name) => installManifest.scripts.include.some((pattern) => {
1702
+ const ext = pattern.replace("*", "");
1703
+ return name.endsWith(ext);
1704
+ });
1705
+ const scriptFiles = allScriptFiles.filter(matchesInclude);
1706
+ const home = process.env["HOME"] ?? "";
1707
+ let serviceChanged = false;
1708
+ const installMode = (await readManifest(paths.manifest))?.installMode ?? "supervised";
1709
+ const isExecutable = (name) => {
1710
+ const ext = installManifest.scripts.executable.replace("*", "");
1711
+ return name.endsWith(ext);
1712
+ };
1713
+ for (const name of scriptFiles) {
1714
+ await copyFile2(join9(repoScripts, name), join9(destScripts, name));
1715
+ if (isExecutable(name)) await chmod(join9(destScripts, name), 493);
1716
+ if (isExecutable(name)) {
1717
+ await copyFile2(join9(repoScripts, name), join9(paths.home, name));
1718
+ await chmod(join9(paths.home, name), 493);
1719
+ }
1720
+ const macService = installManifest.services.supervised.macos;
1721
+ if (macService && name === macService.plist && process.platform === "darwin" && home && installMode === "supervised") {
1722
+ const launchAgentsDir = join9(home, "Library", "LaunchAgents");
1723
+ await mkdir4(launchAgentsDir, { recursive: true });
1724
+ const dst = join9(launchAgentsDir, name);
1725
+ const oldContent = await readFile3(dst, "utf-8").catch(() => "");
1726
+ let templated = await readFile3(join9(repoScripts, name), "utf-8");
1727
+ for (const ph of macService.placeholders) templated = templated.replaceAll(ph, home);
1728
+ await writeFile3(dst, templated);
1729
+ if (oldContent !== templated) serviceChanged = true;
1730
+ }
1731
+ const linuxService = installManifest.services.supervised.linux;
1732
+ if (linuxService?.units.includes(name) && process.platform === "linux" && home && installMode === "supervised") {
1733
+ const systemdDir = join9(home, ".config", "systemd", "user");
1734
+ await mkdir4(systemdDir, { recursive: true });
1735
+ const dst = join9(systemdDir, name);
1736
+ const oldContent = await readFile3(dst, "utf-8").catch(() => "");
1737
+ await copyFile2(join9(repoScripts, name), dst);
1738
+ const newContent = await readFile3(dst, "utf-8").catch(() => "");
1739
+ if (oldContent !== newContent) serviceChanged = true;
1740
+ }
1741
+ }
1742
+ process.stdout.write(`\u2713 scripts refreshed (${scriptFiles.length} files)
1743
+ `);
1744
+ const { writeWrapper } = await import("./install-24XR5FO5.js");
1745
+ await mkdir4(paths.bin, { recursive: true });
1746
+ for (const name of installManifest.cliWrappers) {
1747
+ await writeWrapper(paths.bin, name, paths.current, false);
1748
+ }
1749
+ process.stdout.write(`\u2713 wrappers refreshed (${installManifest.cliWrappers.length} files)
1750
+ `);
1751
+ const { rmSync: rmSync2, cpSync, readdirSync: readdirSync3 } = await import("node:fs");
1752
+ const skillsCoreSrc = join9(staged.stagedPath, "core", "skills");
1753
+ const skillsCoreDst = join9(paths.home, "skills", "core");
1754
+ if (existsSync7(skillsCoreSrc)) {
1755
+ rmSync2(skillsCoreDst, { recursive: true, force: true });
1756
+ cpSync(skillsCoreSrc, skillsCoreDst, { recursive: true });
1757
+ const files = readdirSync3(skillsCoreDst, { recursive: true });
1758
+ const count = files.filter((f) => f.endsWith("SKILL.md")).length;
1759
+ process.stdout.write(`\u2713 skills/core synced (${count} skills)
1760
+ `);
1761
+ }
1762
+ for (const d of ["custom", "downloaded", "self"]) {
1763
+ await mkdir4(join9(paths.home, "skills", d), { recursive: true });
1764
+ }
1765
+ for (const stale of ["memory", "ops", "tools", "coding"]) {
1766
+ const p = join9(paths.home, "skills", stale);
1767
+ if (existsSync7(p)) {
1768
+ rmSync2(p, { recursive: true, force: true });
1769
+ }
1770
+ }
1771
+ const releaseConfig = join9(staged.stagedPath, "config");
1772
+ const destConfig = join9(paths.home, "config");
1773
+ if (existsSync7(releaseConfig)) {
1774
+ for (const f of readdirSync3(releaseConfig)) {
1775
+ const src = join9(releaseConfig, f);
1776
+ if (f.endsWith(".example")) {
1777
+ cpSync(src, join9(destConfig, f));
1778
+ const target = join9(destConfig, f.replace(".example", ""));
1779
+ if (!existsSync7(target)) cpSync(src, target);
1780
+ }
1781
+ }
1782
+ const defaultTransport = join9(releaseConfig, "transport.default.json");
1783
+ if (existsSync7(defaultTransport)) cpSync(defaultTransport, join9(destConfig, "transport.default.json"));
1784
+ }
1785
+ const coreSrc = join9(staged.stagedPath, "core");
1786
+ const coreDst = join9(paths.home, "core");
1787
+ if (existsSync7(coreSrc)) {
1788
+ await mkdir4(coreDst, { recursive: true });
1789
+ cpSync(coreSrc, coreDst, { recursive: true });
1790
+ }
1791
+ if (serviceChanged) {
1792
+ if (process.platform === "darwin") {
1793
+ process.stdout.write(`\u26A0\uFE0F LaunchAgent plist updated \u2014 reload with: launchctl bootout gui/$(id -u)/com.abtars.watchdog && launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.abtars.watchdog.plist
1794
+ `);
1795
+ } else {
1796
+ process.stdout.write(`\u26A0\uFE0F systemd service updated \u2014 reload with: systemctl --user daemon-reload && systemctl --user restart abtars-watchdog
1797
+ `);
1798
+ }
1799
+ }
1800
+ void hashFile;
1801
+ const { ensureInstallInvariants } = await import("./ensure-invariants-KUXIW73S.js");
1802
+ const invariantResults = await ensureInstallInvariants(process.cwd(), paths.home);
1803
+ if (invariantResults.length > 0) {
1804
+ process.stdout.write(`\u2713 invariants: ${invariantResults.join(", ")}
1805
+ `);
1806
+ }
1807
+ const doctorPath = join9(paths.home, "scripts", "doctor.sh");
1808
+ if (existsSync7(doctorPath)) {
1809
+ process.stdout.write("\n\u{1FA7A} Health check...\n");
1810
+ try {
1811
+ const { execSync } = await import("node:child_process");
1812
+ execSync(`bash "${doctorPath}" --fix`, { stdio: "inherit", timeout: 3e4 });
1813
+ } catch (err) {
1814
+ process.stderr.write(`\u26A0\uFE0F doctor --fix failed: ${err instanceof Error ? err.message : String(err)}
1815
+ `);
1816
+ }
1817
+ }
1818
+ const manifestForRestart = await readManifest(paths.manifest);
1819
+ const restartMode = manifestForRestart?.installMode;
1820
+ if (!restartMode) {
1821
+ process.stderr.write("\u274C installMode not set in manifest.json. Run 'abtars install' first.\n");
1822
+ return 1;
1823
+ }
1824
+ if (restartMode === "supervised-daemon" || restartMode === "supervised") {
1825
+ process.stdout.write("\nRestarting bridge via watchdog...\n");
1826
+ const wdLock = join9(paths.home, "watchdog.lock");
1827
+ const wdPid = readJsonField2(wdLock, "pid");
1828
+ if (wdPid && wdPid > 0) {
1829
+ try {
1830
+ process.kill(wdPid, "SIGUSR1");
1831
+ process.stdout.write(`\u267B\uFE0F USR1 sent to watchdog (PID ${wdPid}) \u2014 bridge will restart
1832
+ `);
1833
+ } catch {
1834
+ process.stdout.write(`\u26A0\uFE0F Could not signal watchdog (PID ${wdPid}). Restart manually:
1835
+ `);
1836
+ if (process.platform === "darwin") {
1837
+ process.stdout.write(` launchctl kickstart -k gui/$(id -u)/com.abtars.watchdog
1838
+ `);
1839
+ } else {
1840
+ process.stdout.write(` systemctl --user restart abtars-watchdog
1841
+ `);
1842
+ }
1843
+ }
1844
+ } else {
1845
+ process.stdout.write(`\u26A0\uFE0F Watchdog not running. Cold restart...
1846
+ `);
1847
+ const { restart: restart2 } = await import("./abtars-restart.js");
1848
+ await restart2({ cold: true }).catch((err) => {
1849
+ process.stderr.write(`\u26A0\uFE0F Restart failed: ${err instanceof Error ? err.message : String(err)}
1850
+ `);
1851
+ });
1852
+ }
1853
+ } else {
1854
+ process.stdout.write("\nRestarting bridge...\n");
1855
+ const { restart: restart2 } = await import("./abtars-restart.js");
1856
+ await restart2({ cold: true }).catch((err) => {
1857
+ process.stderr.write(`\u26A0\uFE0F Restart failed: ${err instanceof Error ? err.message : String(err)}
1858
+ `);
1859
+ });
1860
+ }
1861
+ const { printHealthSummary } = await import("./health-check-RJ2SUJYL.js");
1862
+ printHealthSummary(paths.home);
1863
+ return 0;
1864
+ } finally {
1865
+ await release();
1866
+ }
1867
+ }
1868
+
1300
1869
  // src/cli/abtars.ts
1301
1870
  process.umask(63);
1302
1871
  function parseArgs(argv) {
@@ -1327,7 +1896,7 @@ function printUsage() {
1327
1896
  `abtars \u2014 install/update CLI (#158)
1328
1897
 
1329
1898
  Usage:
1330
- abtars install [--force] [--mode=simple|supervised|supervised-daemon] [--restore <backup.zip>]
1899
+ abtars install [--force] [--mode=simple|supervised] [--restore <backup.zip>]
1331
1900
  abtars uninstall [--yes]
1332
1901
  abtars update [--source local|npm|github] [--from-local]
1333
1902
  abtars rollback [--to <version>]
@@ -1353,7 +1922,7 @@ async function main(argv) {
1353
1922
  restore: typeof flags.get("restore") === "string" ? flags.get("restore") : void 0,
1354
1923
  force: flags.get("force") === true,
1355
1924
  dryRun: flags.get("dry-run") === true,
1356
- mode: flags.get("mode") === "simple" ? "simple" : flags.get("mode") === "supervised" ? "supervised" : flags.get("mode") === "supervised-daemon" ? "supervised-daemon" : void 0
1925
+ mode: flags.get("mode") === "simple" ? "simple" : flags.get("mode") === "supervised" ? "supervised" : void 0
1357
1926
  });
1358
1927
  case "uninstall":
1359
1928
  return await uninstall({ yes: flags.get("yes") === true });
@@ -1370,7 +1939,7 @@ async function main(argv) {
1370
1939
  case "backup":
1371
1940
  return await backup(typeof flags.get("output") === "string" ? flags.get("output") : void 0);
1372
1941
  case "restore": {
1373
- const { restore } = await import("./restore-ZE3SEPSS.js");
1942
+ const { restore } = await import("./restore-ROJF22R2.js");
1374
1943
  return await restore(argv[1] ?? "");
1375
1944
  }
1376
1945
  case "doctor":
@@ -1393,19 +1962,23 @@ async function main(argv) {
1393
1962
  case "stop":
1394
1963
  return await stop({ force: flags.get("force") === true });
1395
1964
  case "start": {
1396
- const { start: startCmd } = await import("./start-FH3GRMJ4.js");
1965
+ const { start: startCmd } = await import("./start-4IWBKLWO.js");
1397
1966
  return await startCmd();
1398
1967
  }
1968
+ case "daemon": {
1969
+ const { daemon: daemonCmd } = await import("./daemon-NPKYZ3CJ.js");
1970
+ return await daemonCmd(argv.slice(1));
1971
+ }
1399
1972
  case "logs": {
1400
- const { logs } = await import("./logs-ZNYXX5PA.js");
1973
+ const { logs } = await import("./logs-EK4HYRKR.js");
1401
1974
  return await logs();
1402
1975
  }
1403
1976
  case "config": {
1404
- const { configShow } = await import("./config-show-ERTATR6E.js");
1977
+ const { configShow } = await import("./config-show-ZTXX27FW.js");
1405
1978
  return await configShow();
1406
1979
  }
1407
1980
  case "passwd": {
1408
- const { passwd } = await import("./passwd-RRFV4CC5.js");
1981
+ const { passwd } = await import("./passwd-QSHZJ2CG.js");
1409
1982
  return await passwd();
1410
1983
  }
1411
1984
  case "":