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,11 +1,12 @@
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);
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);
2
3
  import {
3
4
  getEnv,
4
5
  init_env_schema
5
- } from "./chunk-JCJS4ZIB.js";
6
- import "./chunk-BUUVFUPO.js";
7
- import "./chunk-X76UX47U.js";
8
- import "./chunk-NWDBD4PA.js";
6
+ } from "./chunk-AQVOAQQI.js";
7
+ import "./chunk-2BY6I4P5.js";
8
+ import "./chunk-MJ6PHMOK.js";
9
+ import "./chunk-7K2YZTLD.js";
9
10
 
10
11
  // src/components/agent-api-rate-limit.ts
11
12
  init_env_schema();
@@ -35,4 +36,4 @@ function checkRateLimit(caller) {
35
36
  export {
36
37
  checkRateLimit
37
38
  };
38
- //# sourceMappingURL=agent-api-rate-limit-OQNFMXTZ.js.map
39
+ //# sourceMappingURL=agent-api-rate-limit-7R5TX2F2.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/components/agent-api-rate-limit.ts"],
4
4
  "sourcesContent": ["import { getEnv } from \"./env-schema.js\";\n\ninterface CallerWindow {\n hourly: number[];\n daily: number[];\n}\n\nconst callers = new Map<string, CallerWindow>();\n\nexport function checkRateLimit(caller: string): { allowed: boolean; retryAfterMs?: number } {\n const { maxAgentCallPerHour, maxAgentCallPerDay } = getEnv();\n const now = Date.now();\n const hourAgo = now - 3_600_000;\n const dayAgo = now - 86_400_000;\n\n let w = callers.get(caller);\n if (!w) { w = { hourly: [], daily: [] }; callers.set(caller, w); }\n\n w.hourly = w.hourly.filter(t => t > hourAgo);\n w.daily = w.daily.filter(t => t > dayAgo);\n\n if (w.hourly.length >= maxAgentCallPerHour) {\n return { allowed: false, retryAfterMs: w.hourly[0]! - hourAgo };\n }\n if (w.daily.length >= maxAgentCallPerDay) {\n return { allowed: false, retryAfterMs: w.daily[0]! - dayAgo };\n }\n\n w.hourly.push(now);\n w.daily.push(now);\n return { allowed: true };\n}\n"],
5
- "mappings": ";;;;;;;;;;AAAA;AAOA,IAAM,UAAU,oBAAI,IAA0B;AAEvC,SAAS,eAAe,QAA6D;AAC1F,QAAM,EAAE,qBAAqB,mBAAmB,IAAI,OAAO;AAC3D,QAAM,MAAM,KAAK,IAAI;AACrB,QAAM,UAAU,MAAM;AACtB,QAAM,SAAS,MAAM;AAErB,MAAI,IAAI,QAAQ,IAAI,MAAM;AAC1B,MAAI,CAAC,GAAG;AAAE,QAAI,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,EAAE;AAAG,YAAQ,IAAI,QAAQ,CAAC;AAAA,EAAG;AAEjE,IAAE,SAAS,EAAE,OAAO,OAAO,OAAK,IAAI,OAAO;AAC3C,IAAE,QAAQ,EAAE,MAAM,OAAO,OAAK,IAAI,MAAM;AAExC,MAAI,EAAE,OAAO,UAAU,qBAAqB;AAC1C,WAAO,EAAE,SAAS,OAAO,cAAc,EAAE,OAAO,CAAC,IAAK,QAAQ;AAAA,EAChE;AACA,MAAI,EAAE,MAAM,UAAU,oBAAoB;AACxC,WAAO,EAAE,SAAS,OAAO,cAAc,EAAE,MAAM,CAAC,IAAK,OAAO;AAAA,EAC9D;AAEA,IAAE,OAAO,KAAK,GAAG;AACjB,IAAE,MAAM,KAAK,GAAG;AAChB,SAAO,EAAE,SAAS,KAAK;AACzB;",
5
+ "mappings": ";;;;;;;;;;;AAAA;AAOA,IAAM,UAAU,oBAAI,IAA0B;AAEvC,SAAS,eAAe,QAA6D;AAC1F,QAAM,EAAE,qBAAqB,mBAAmB,IAAI,OAAO;AAC3D,QAAM,MAAM,KAAK,IAAI;AACrB,QAAM,UAAU,MAAM;AACtB,QAAM,SAAS,MAAM;AAErB,MAAI,IAAI,QAAQ,IAAI,MAAM;AAC1B,MAAI,CAAC,GAAG;AAAE,QAAI,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,EAAE;AAAG,YAAQ,IAAI,QAAQ,CAAC;AAAA,EAAG;AAEjE,IAAE,SAAS,EAAE,OAAO,OAAO,OAAK,IAAI,OAAO;AAC3C,IAAE,QAAQ,EAAE,MAAM,OAAO,OAAK,IAAI,MAAM;AAExC,MAAI,EAAE,OAAO,UAAU,qBAAqB;AAC1C,WAAO,EAAE,SAAS,OAAO,cAAc,EAAE,OAAO,CAAC,IAAK,QAAQ;AAAA,EAChE;AACA,MAAI,EAAE,MAAM,UAAU,oBAAoB;AACxC,WAAO,EAAE,SAAS,OAAO,cAAc,EAAE,MAAM,CAAC,IAAK,OAAO;AAAA,EAC9D;AAEA,IAAE,OAAO,KAAK,GAAG;AACjB,IAAE,MAAM,KAAK,GAAG;AAChB,SAAO,EAAE,SAAS,KAAK;AACzB;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,19 @@
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);
3
+ import {
4
+ createAgentTransport,
5
+ createSubagentTransport
6
+ } from "./chunk-HVKJN3AG.js";
7
+ import "./chunk-WX7GHGFX.js";
8
+ import "./chunk-UDZIZB5F.js";
9
+ import "./chunk-MZWMYN4O.js";
10
+ import "./chunk-EX2SRTUE.js";
11
+ import "./chunk-AQVOAQQI.js";
12
+ import "./chunk-2BY6I4P5.js";
13
+ import "./chunk-MJ6PHMOK.js";
14
+ import "./chunk-7K2YZTLD.js";
15
+ export {
16
+ createAgentTransport,
17
+ createSubagentTransport
18
+ };
19
+ //# sourceMappingURL=agent-registry-5M77ZOMV.js.map
@@ -0,0 +1,19 @@
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);
3
+ import {
4
+ createAgentTransport,
5
+ createSubagentTransport
6
+ } from "./chunk-LD5BMLHG.js";
7
+ import "./chunk-WX7GHGFX.js";
8
+ import "./chunk-UDZIZB5F.js";
9
+ import "./chunk-MZWMYN4O.js";
10
+ import "./chunk-EX2SRTUE.js";
11
+ import "./chunk-AQVOAQQI.js";
12
+ import "./chunk-2BY6I4P5.js";
13
+ import "./chunk-MJ6PHMOK.js";
14
+ import "./chunk-7K2YZTLD.js";
15
+ export {
16
+ createAgentTransport,
17
+ createSubagentTransport
18
+ };
19
+ //# sourceMappingURL=agent-registry-VJMNIQ5W.js.map
@@ -1,5 +1,6 @@
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 "./chunk-NWDBD4PA.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);
3
+ import "./chunk-7K2YZTLD.js";
3
4
 
4
5
  // src/components/transport/anthropic-adapter.ts
5
6
  function toAnthropicRequest(model, messages, maxTokens, tools) {
@@ -37,4 +38,4 @@ export {
37
38
  fromAnthropicResponse,
38
39
  toAnthropicRequest
39
40
  };
40
- //# sourceMappingURL=anthropic-adapter-2APTH3LA.js.map
41
+ //# sourceMappingURL=anthropic-adapter-IBY3NPXW.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/components/transport/anthropic-adapter.ts"],
4
4
  "sourcesContent": ["/**\n * anthropic-adapter.ts \u2014 Anthropic Messages API format adapter (#467).\n * Converts between our internal chat format and Anthropic's wire format.\n */\n\nexport interface AnthropicRequest {\n model: string;\n system?: string;\n messages: Array<{ role: string; content: string | unknown[] }>;\n max_tokens: number;\n}\n\nexport interface AnthropicResponse {\n content: Array<{ type: string; text?: string }>;\n usage?: { input_tokens: number; output_tokens: number };\n}\n\nexport function toAnthropicRequest(\n model: string,\n messages: Array<{ role: string; content: string | unknown[]; tool_call_id?: string }>,\n maxTokens: number,\n tools?: Array<{ type: string; function: { name: string; description: string; parameters: Record<string, unknown> } }>,\n): AnthropicRequest & { tools?: unknown[] } {\n const system = messages.find(m => m.role === \"system\")?.content;\n const filtered = messages.filter(m => m.role !== \"system\");\n\n // Convert messages: tool results use Anthropic's content block format\n const msgs: Array<{ role: string; content: string | unknown[] | Array<Record<string, unknown>> }> = [];\n for (const m of filtered) {\n if (m.role === \"tool\") {\n // Anthropic: tool results are role:\"user\" with tool_result content blocks\n const last = msgs[msgs.length - 1];\n const block = { type: \"tool_result\", tool_use_id: m.tool_call_id ?? \"\", content: m.content };\n if (last?.role === \"user\" && Array.isArray(last.content)) {\n (last.content as Array<Record<string, unknown>>).push(block);\n } else {\n msgs.push({ role: \"user\", content: [block] });\n }\n } else {\n msgs.push({ role: m.role, content: m.content });\n }\n }\n\n const anthropicTools = tools?.map(t => ({ name: t.function.name, description: t.function.description, input_schema: t.function.parameters }));\n return { model, ...(system ? { system } : {}), messages: msgs, max_tokens: maxTokens, ...(anthropicTools?.length ? { tools: anthropicTools } : {}) } as AnthropicRequest & { tools?: unknown[] };\n}\n\nexport function buildAnthropicHeaders(apiKey: string): Record<string, string> {\n return {\n \"Content-Type\": \"application/json\",\n \"x-api-key\": apiKey,\n \"anthropic-version\": \"2023-06-01\",\n };\n}\n\nexport function fromAnthropicResponse(resp: AnthropicResponse): string {\n return resp.content?.find(c => c.type === \"text\")?.text ?? \"\";\n}\n"],
5
- "mappings": ";;;;AAiBO,SAAS,mBACd,OACA,UACA,WACA,OAC0C;AAC1C,QAAM,SAAS,SAAS,KAAK,OAAK,EAAE,SAAS,QAAQ,GAAG;AACxD,QAAM,WAAW,SAAS,OAAO,OAAK,EAAE,SAAS,QAAQ;AAGzD,QAAM,OAA8F,CAAC;AACrG,aAAW,KAAK,UAAU;AACxB,QAAI,EAAE,SAAS,QAAQ;AAErB,YAAM,OAAO,KAAK,KAAK,SAAS,CAAC;AACjC,YAAM,QAAQ,EAAE,MAAM,eAAe,aAAa,EAAE,gBAAgB,IAAI,SAAS,EAAE,QAAQ;AAC3F,UAAI,MAAM,SAAS,UAAU,MAAM,QAAQ,KAAK,OAAO,GAAG;AACxD,QAAC,KAAK,QAA2C,KAAK,KAAK;AAAA,MAC7D,OAAO;AACL,aAAK,KAAK,EAAE,MAAM,QAAQ,SAAS,CAAC,KAAK,EAAE,CAAC;AAAA,MAC9C;AAAA,IACF,OAAO;AACL,WAAK,KAAK,EAAE,M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,IAChD;AAAA,EACF;AAEA,QAAM,iBAAiB,OAAO,IAAI,QAAM,EAAE,MAAM,EAAE,SAAS,MAAM,aAAa,EAAE,SAAS,aAAa,cAAc,EAAE,SAAS,WAAW,EAAE;AAC5I,SAAO,EAAE,OAAO,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC,GAAI,UAAU,MAAM,YAAY,WAAW,GAAI,gBAAgB,SAAS,EAAE,OAAO,eAAe,IAAI,CAAC,EAAG;AACrJ;AAEO,SAAS,sBAAsB,QAAwC;AAC5E,SAAO;AAAA,IACL,gBAAgB;AAAA,IAChB,aAAa;AAAA,IACb,qBAAqB;AAAA,EACvB;AACF;AAEO,SAAS,sBAAsB,MAAiC;AACrE,SAAO,KAAK,SAAS,KAAK,OAAK,EAAE,SAAS,MAAM,GAAG,QAAQ;AAC7D;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,5 @@
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);
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);
2
3
  import {
3
4
  appendRestartTimestamp,
4
5
  initBridgeLock,
@@ -14,12 +15,12 @@ import {
14
15
  writeRestartReason,
15
16
  writeRestartRequested,
16
17
  writeSleepStatus
17
- } from "./chunk-CEVRHKJY.js";
18
- import "./chunk-M6VBAPNT.js";
19
- import "./chunk-FMWKEPM7.js";
20
- import "./chunk-BUUVFUPO.js";
21
- import "./chunk-X76UX47U.js";
22
- import "./chunk-NWDBD4PA.js";
18
+ } from "./chunk-UDZIZB5F.js";
19
+ import "./chunk-MZWMYN4O.js";
20
+ import "./chunk-EX2SRTUE.js";
21
+ import "./chunk-2BY6I4P5.js";
22
+ import "./chunk-MJ6PHMOK.js";
23
+ import "./chunk-7K2YZTLD.js";
23
24
  export {
24
25
  appendRestartTimestamp,
25
26
  initBridgeLock,
@@ -36,4 +37,4 @@ export {
36
37
  writeRestartRequested,
37
38
  writeSleepStatus
38
39
  };
39
- //# sourceMappingURL=bridge-lock-transport-4AC2G5G6.js.map
40
+ //# sourceMappingURL=bridge-lock-transport-HO545SBK.js.map
@@ -0,0 +1,18 @@
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);
3
+ import {
4
+ checkBrowseTasks,
5
+ deliverBrowseResult
6
+ } from "./chunk-K7P74UNQ.js";
7
+ import "./chunk-PQ62LZNA.js";
8
+ import "./chunk-TBLYGCPQ.js";
9
+ import "./chunk-XLLSPBBT.js";
10
+ import "./chunk-EX2SRTUE.js";
11
+ import "./chunk-2BY6I4P5.js";
12
+ import "./chunk-MJ6PHMOK.js";
13
+ import "./chunk-7K2YZTLD.js";
14
+ export {
15
+ checkBrowseTasks,
16
+ deliverBrowseResult
17
+ };
18
+ //# sourceMappingURL=browse-delivery-64GQIUHG.js.map
@@ -0,0 +1,19 @@
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);
3
+ import {
4
+ register
5
+ } from "./chunk-ZZR3JZHR.js";
6
+ import "./chunk-K7P74UNQ.js";
7
+ import "./chunk-PQ62LZNA.js";
8
+ import "./chunk-TBLYGCPQ.js";
9
+ import "./chunk-XLLSPBBT.js";
10
+ import "./chunk-MCGEXAG5.js";
11
+ import "./chunk-EX2SRTUE.js";
12
+ import "./chunk-AQVOAQQI.js";
13
+ import "./chunk-2BY6I4P5.js";
14
+ import "./chunk-MJ6PHMOK.js";
15
+ import "./chunk-7K2YZTLD.js";
16
+ export {
17
+ register
18
+ };
19
+ //# sourceMappingURL=browser-EXR5OQGK.js.map
@@ -0,0 +1,18 @@
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);
3
+ import {
4
+ createCapabilityApi,
5
+ createCapabilityRegistry,
6
+ discoverCapabilities
7
+ } from "./chunk-H2RZ4NEJ.js";
8
+ import "./chunk-EX2SRTUE.js";
9
+ import "./chunk-AQVOAQQI.js";
10
+ import "./chunk-2BY6I4P5.js";
11
+ import "./chunk-MJ6PHMOK.js";
12
+ import "./chunk-7K2YZTLD.js";
13
+ export {
14
+ createCapabilityApi,
15
+ createCapabilityRegistry,
16
+ discoverCapabilities
17
+ };
18
+ //# sourceMappingURL=capability-HIE7UGFU.js.map
@@ -1,11 +1,12 @@
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);
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);
2
3
  import {
3
4
  abtarsHome,
4
5
  init_paths
5
- } from "./chunk-X76UX47U.js";
6
+ } from "./chunk-MJ6PHMOK.js";
6
7
  import {
7
8
  __esm
8
- } from "./chunk-NWDBD4PA.js";
9
+ } from "./chunk-7K2YZTLD.js";
9
10
 
10
11
  // src/components/logger.ts
11
12
  import { appendFileSync, mkdirSync } from "node:fs";
@@ -154,4 +155,4 @@ export {
154
155
  logTrace,
155
156
  init_logger
156
157
  };
157
- //# sourceMappingURL=chunk-BUUVFUPO.js.map
158
+ //# sourceMappingURL=chunk-2BY6I4P5.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/components/logger.ts"],
4
4
  "sourcesContent": ["import { appendFileSync, mkdirSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { abtarsHome } from \"../paths.js\";\n\n/** Log levels: OFF = silent, LOW = operational info, DEBUG = verbose trace, TRACE = debug + anomaly diagnostics */\nexport type LogLevel = \"off\" | \"low\" | \"debug\" | \"trace\";\n\nconst LEVEL_ORDER: Record<LogLevel, number> = { off: 0, low: 1, debug: 2, trace: 3 };\nconst LOG_DIR = join(abtarsHome(), \"logs\");\n\n/** Get today's log filename: bridge-YYYY-MM-DD.log */\nexport function getLogFile(): string {\n const d = new Date();\n const date = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, \"0\")}-${String(d.getDate()).padStart(2, \"0\")}`;\n return join(LOG_DIR, `bridge-${date}.log`);\n}\n\nlet currentLevel: LogLevel = \"low\";\nlet fileLogging = true;\n\nexport function setLogLevel(level: LogLevel): void {\n currentLevel = level;\n}\n\nfunction shouldLog(minLevel: LogLevel): boolean {\n return LEVEL_ORDER[currentLevel] >= LEVEL_ORDER[minLevel];\n}\n\nexport function isLogLevel(minLevel: LogLevel): boolean {\n return LEVEL_ORDER[currentLevel] >= LEVEL_ORDER[minLevel];\n}\n\n// \u2500\u2500 Buffered file writer \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nlet buffer: string[] = [];\nlet flushTimer: ReturnType<typeof setTimeout> | null = null;\n\nfunction writeToFile(line: string): void {\n if (!fileLogging) return;\n buffer.push(redactSecrets(line));\n if (buffer.length >= 200) flush();\n else if (!flushTimer) {\n flushTimer = setTimeout(flush, 30000);\n flushTimer.unref();\n }\n}\n\nfunction flush(): void {\n if (flushTimer) { clearTimeout(flushTimer); flushTimer = null; }\n if (buffer.length === 0) return;\n const lines = buffer;\n buffer = [];\n try {\n mkdirSync(LOG_DIR, { recursive: true });\n appendFileSync(getLogFile(), lines.join(\"\\n\") + \"\\n\");\n } catch { /* silently ignore file write errors */ }\n}\n\n/** Flush buffered logs synchronously. Called on process exit. */\nexport function flushLogs(): void { flush(); }\n\nprocess.on(\"exit\", flush);\n\n// \u2500\u2500 Credential redaction \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n//\n// INTENTIONALLY DUPLICATED across abtars and abmind \u2014 they are\n// independent products that both need this utility. If you add or\n// modify a pattern here, also update the sibling file:\n// abtars/src/components/logger.ts (SECRET_PATTERNS + redactSecrets)\n// abmind/src/redact-secrets.ts (SECRET_PATTERNS + redactSecrets)\n//\n// Do NOT create an import relationship between them. Each product stays\n// independent so the bridge can run against a different memory backend\n// and abmind can ship as a standalone npm package without pulling\n// abtars in for a utility function.\n\nconst SECRET_PATTERNS: ReadonlyArray<[RegExp, string]> = [\n [/sk-[A-Za-z0-9_-]{20,}/g, \"sk-***REDACTED***\"],\n [/sk-or-[A-Za-z0-9_-]{20,}/g, \"sk-or-***REDACTED***\"],\n [/gsk_[A-Za-z0-9]{20,}/g, \"gsk_***REDACTED***\"],\n [/ghp_[A-Za-z0-9]{36,}/g, \"ghp_***REDACTED***\"],\n [/github_pat_[A-Za-z0-9_]{20,}/g, \"github_pat_***REDACTED***\"],\n [/xox[baprs]-[A-Za-z0-9-]{10,}/g, \"xox_-***REDACTED***\"],\n [/AIza[A-Za-z0-9_-]{30,}/g, \"AIza***REDACTED***\"],\n [/AKIA[A-Z0-9]{16}/g, \"AKIA***REDACTED***\"],\n [/\\d{8,12}:[A-Za-z0-9_-]{35,}/g, \"***BOT_TOKEN***\"],\n [/Bearer [A-Za-z0-9._-]{20,}/g, \"Bearer ***REDACTED***\"],\n [/eyJ[A-Za-z0-9_-]{20,}\\.eyJ[A-Za-z0-9_-]{20,}\\.[A-Za-z0-9_-]{20,}/g, \"***JWT_REDACTED***\"],\n [/hf_[A-Za-z0-9]{20,}/g, \"hf_***REDACTED***\"],\n [/npm_[A-Za-z0-9]{20,}/g, \"npm_***REDACTED***\"],\n [/sk_live_[A-Za-z0-9]{20,}/g, \"sk_live_***REDACTED***\"],\n [/sk_test_[A-Za-z0-9]{20,}/g, \"sk_test_***REDACTED***\"],\n [/SG\\.[A-Za-z0-9_-]{20,}/g, \"SG.***REDACTED***\"],\n [/(\"(?:api[_-]?key|token|secret|password|authorization|credential)\"\\s*:\\s*\")[^\"]{8,}\"/gi, '$1***REDACTED***\"'],\n [/([A-Z_]*(?:KEY|TOKEN|SECRET|PASSWORD)=)[^\\s]{8,}/g, \"$1***REDACTED***\"],\n];\n\n/** Strip known secret patterns from a log line. */\nexport function redactSecrets(text: string): string {\n let result = text;\n for (const [pattern, replacement] of SECRET_PATTERNS) {\n result = result.replace(pattern, replacement);\n }\n return result;\n}\n\nconst isTest = process.env.NODE_ENV === \"test\" || process.env.VITEST === \"true\";\n\nfunction ts(): string {\n const d = new Date();\n const pad2 = (n: number): string => String(n).padStart(2, \"0\");\n const local = `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}T${pad2(d.getHours())}:${pad2(d.getMinutes())}:${pad2(d.getSeconds())}.${String(d.getMilliseconds()).padStart(3, \"0\")}`;\n return isTest ? `${local} TEST` : local;\n}\n\n/** Local ISO-ish timestamp for user-facing messages. */\nexport function localIso(): string {\n const d = new Date();\n const pad2 = (n: number): string => String(n).padStart(2, \"0\");\n return `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}T${pad2(d.getHours())}:${pad2(d.getMinutes())}:${pad2(d.getSeconds())}`;\n}\n\nlet logFormat: \"text\" | \"json\" = (process.env[\"LOG_FORMAT\"] as \"json\" | undefined) === \"json\" ? \"json\" : \"text\";\n\nfunction formatLine(level: string, tag: string, msg: string): string {\n if (logFormat === \"json\") {\n return JSON.stringify({ ts: ts(), level, tag, msg });\n }\n return `${ts()} ${level.toUpperCase().padEnd(5)} [${tag}] ${msg}`;\n}\n\n/** LOW: operational milestones \u2014 startup, connections, errors */\nexport function logInfo(tag: string, msg: string): void {\n if (!shouldLog(\"low\")) return;\n const line = formatLine(\"info\", tag, msg);\n console.log(`[${tag}] ${msg}`);\n writeToFile(line);\n}\n\n/** LOW: warnings */\nexport function logWarn(tag: string, msg: string): void {\n if (!shouldLog(\"low\")) return;\n const line = formatLine(\"warn\", tag, msg);\n console.warn(`[${tag}] ${msg}`);\n writeToFile(line);\n}\n\n/** LOW: errors (always shown unless OFF) */\nexport function logError(tag: string, msg: string, err?: unknown): void {\n if (!shouldLog(\"low\")) return;\n const errStr = err instanceof Error ? err.message : (typeof err === \"object\" && err !== null ? JSON.stringify(err) : String(err ?? \"\"));\n const fullMsg = errStr ? `${msg} \u2014 ${errStr}` : msg;\n const line = formatLine(\"error\", tag, fullMsg);\n if (err) console.error(`[${tag}] ${msg}`, err);\n else console.error(`[${tag}] ${msg}`);\n writeToFile(line);\n}\n\n/** DEBUG: message content, full payloads, verbose tracing */\nexport function logDebug(tag: string, msg: string): void {\n if (!shouldLog(\"debug\")) return;\n const line = formatLine(\"debug\", tag, msg);\n console.log(`[${tag}] ${msg}`);\n writeToFile(line);\n}\n\n/** TRACE: debug + anomaly diagnostics (swallowed errors, catch-block traces) */\nexport function logTrace(tag: string, msg: string): void {\n if (!shouldLog(\"trace\")) return;\n const line = formatLine(\"trace\", tag, msg);\n console.log(`[${tag}] ${msg}`);\n writeToFile(line);\n}\n"],
5
- "mappings": ";;;;;;;;;;AAAA,SAAS,gBAAgB,iBAAiB;AAC1C,SAAS,YAAY;AAUd,SAAS,aAAqB;AACnC,QAAM,IAAI,oBAAI,KAAK;AACnB,QAAM,OAAO,GAAG,EAAE,YAAY,CAAC,IAAI,OAAO,EAAE,SAAS,IAAI,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC,IAAI,OAAO,EAAE,QAAQ,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;AACpH,SAAO,KAAK,SAAS,UAAU,IAAI,MAAM;AAC3C;AAKO,SAAS,YAAY,OAAuB;AACjD,iBAAe;AACjB;AAEA,SAAS,UAAU,UAA6B;AAC9C,SAAO,YAAY,YAAY,KAAK,YAAY,QAAQ;AAC1D;AAEO,SAAS,WAAW,UAA6B;AACtD,SAAO,YAAY,YAAY,KAAK,YAAY,QAAQ;AAC1D;AAMA,SAAS,YAAY,MAAoB;AACvC,MAAI,CAAC,YAAa;AAClB,SAAO,KAAK,cAAc,IAAI,CAAC;AAC/B,MAAI,OAAO,UAAU,IAAK,OAAM;AAAA,WACvB,CAAC,YAAY;AACpB,iBAAa,WAAW,OAAO,GAAK;AACpC,eAAW,MAAM;AAAA,EACnB;AACF;AAEA,SAAS,QAAc;AAC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AM;AASzC,IAAI,eAAyB;AAC7B,IAAI,cAAc;AAelB,IAAI,SAAmB,CAAC;AACxB,IAAI,aAAmD;AA0BvD,YAAQ,GAAG,QAAQ,KAAK;AAexB,IAAM,kBAAmD;AAAA,MACvD,CAAC,0BAA0B,mBAAmB;AAAA,MAC9C,CAAC,6BAA6B,sBAAsB;AAAA,MACpD,CAAC,yBAAyB,oBAAoB;AAAA,MAC9C,CAAC,yBAAyB,oBAAoB;AAAA,MAC9C,CAAC,iCAAiC,2BAA2B;AAAA,MAC7D,CAAC,iCAAiC,qBAAqB;AAAA,MACvD,CAAC,2BAA2B,oBAAoB;AAAA,MAChD,CAAC,qBAAqB,oBAAoB;AAAA,MAC1C,CAAC,gCAAgC,iBAAiB;AAAA,MAClD,CAAC,+BAA+B,uBAAuB;AAAA,MACvD,CAAC,qEAAqE,oBAAoB;AAAA,MAC1F,CAAC,wBAAwB,mBAAmB;AAAA,MAC5C,CAAC,yBAAyB,oBAAoB;AAAA,MAC9C,CAAC,6BAA6B,wBAAwB;AAAA,MACtD,CAAC,6BAA6B,wBAAwB;AAAA,MACtD,CAAC,2BAA2B,mBAAmB;AAAA,MAC/C,CAAC,yFAAyF,mBAAmB;AAAA,MAC7G,CAAC,qDAAqD,kBAAkB;AAAA,IAC1E;AAWA,IAAM,SAA4C,QAAQ,IAAI,WAAW;AAgBzE,IAAI,YAA8B,QAAQ,IAAI,YAAY,MAA6B,SAAS,SAAS;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,33 +1,34 @@
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);
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);
2
3
  import {
3
4
  readEnvWithDefault
4
- } from "./chunk-YOCTDKKL.js";
5
+ } from "./chunk-BYDUMHXT.js";
5
6
  import {
6
7
  TRANSPORT_SCHEMA,
7
8
  init_config_validator,
8
9
  validateShape
9
- } from "./chunk-2UPU3OW6.js";
10
+ } from "./chunk-LYEAHE5V.js";
10
11
  import {
11
12
  init_log_and_swallow,
12
13
  logAndSwallow
13
- } from "./chunk-FMWKEPM7.js";
14
+ } from "./chunk-EX2SRTUE.js";
14
15
  import {
15
16
  getEnv,
16
17
  init_env_schema
17
- } from "./chunk-JCJS4ZIB.js";
18
+ } from "./chunk-AQVOAQQI.js";
18
19
  import {
19
20
  init_logger,
20
21
  logError,
21
22
  logInfo,
22
23
  logWarn
23
- } from "./chunk-BUUVFUPO.js";
24
+ } from "./chunk-2BY6I4P5.js";
24
25
  import {
25
26
  abtarsHome,
26
27
  init_paths
27
- } from "./chunk-X76UX47U.js";
28
+ } from "./chunk-MJ6PHMOK.js";
28
29
  import {
29
30
  __require
30
- } from "./chunk-NWDBD4PA.js";
31
+ } from "./chunk-7K2YZTLD.js";
31
32
 
32
33
  // src/components/transport-config.ts
33
34
  init_log_and_swallow();
@@ -246,6 +247,11 @@ function cleanDemotedModels(tc, chosenModel) {
246
247
  function demoteModel(model, reason) {
247
248
  const tc = loadTransport();
248
249
  if (!tc) return;
250
+ for (const agent of Object.values(tc.agents)) {
251
+ const all = [agent, ...agent.fallbacks ?? []];
252
+ const healthy = all.filter((m) => !m.demoted);
253
+ if (healthy.length <= 1 && healthy.some((m) => m.model === model)) return;
254
+ }
249
255
  let found = false;
250
256
  for (const agent of Object.values(tc.agents)) {
251
257
  if (agent.model === model) {
@@ -405,4 +411,4 @@ export {
405
411
  validateProviderReady,
406
412
  formatValidationError
407
413
  };
408
- //# sourceMappingURL=chunk-Y6XAEX2Q.js.map
414
+ //# sourceMappingURL=chunk-2F6XKG7Y.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/components/transport-config.ts"],
4
+ "sourcesContent": ["import { logAndSwallow } from \"./log-and-swallow.js\";\nimport { getEnv } from \"./env-schema.js\";\nimport { validateShape, TRANSPORT_SCHEMA } from \"./config-validator.js\";\n/**\n * transport-config.ts \u2014 Load and validate transport.json + models.json.\n * Falls back to .env defaults if JSON is broken.\n */\n\nimport { readFileSync, writeFileSync, existsSync, statSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { abtarsHome } from \"../paths.js\";\nimport { readEnvWithDefault } from \"./env.js\";\nimport { logInfo, logWarn, logError } from \"./logger.js\";\n\nconst TAG = \"transport-config\";\n\n// \u2500\u2500 Types \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport type ModelCost = { input: number; output: number };\n\nexport type ModelEntry = {\n contextWindow: number;\n maxOutput: number;\n rank: number;\n cost: ModelCost;\n transports: string[];\n description?: string;\n addedAt?: string;\n validatedAt?: string;\n status?: \"alive\" | \"dead\" | \"untested\";\n};\n\nexport type ModelCatalog = Record<string, ModelEntry>;\n\nexport type AgentAssignment = {\n model: string;\n provider: string;\n fallbacks?: Array<{ model: string; provider: string }>;\n};\n\nexport type ProviderConfig = {\n transport: \"acp\" | \"tmux\" | \"api\";\n cli?: string;\n endpoint?: string;\n apiKeyEnv?: string;\n apiFormat?: \"chat\" | \"responses\" | \"anthropic\";\n thinking?: { style: \"effort\"; default: string } | { style: \"extended\"; default: number };\n defaults?: Record<string, { model: string; fallbacks?: string[] }>;\n fallbackChain?: string[];\n};\n\nexport type TransportDefaults = {\n tmux?: { session?: string; captureDelaySec?: number; maxWaitSec?: number };\n acp?: { permissionTimeoutMs?: number };\n};\n\nimport type { HealthPolicyConfig } from \"./transport/model-health-registry.js\";\n\nexport type TransportConfig = {\n agents: Record<string, AgentAssignment>;\n providers: Record<string, ProviderConfig>;\n transportDefaults?: TransportDefaults;\n maxTurns?: number;\n hailMary?: { model: string; provider: string };\n healthPolicy?: HealthPolicyConfig;\n};\n\nexport type ResolvedAgent = {\n model: string;\n provider: ProviderConfig;\n providerName: string;\n contextWindow: number;\n maxOutput: number;\n fallbacks: Array<{ model: string; provider: string }>;\n};\n\n// \u2500\u2500 Loaders \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nlet cachedTransport: TransportConfig | null = null;\n\nexport function configDir(): string {\n return join(abtarsHome(), \"config\");\n}\n\nexport function loadModels(): ModelCatalog {\n const p = join(configDir(), getEnv().modelsConfig);\n try {\n return JSON.parse(readFileSync(p, \"utf-8\")) as ModelCatalog;\n } catch (err) {\n logWarn(TAG, `Failed to load models.json: ${err instanceof Error ? err.message : String(err)}`);\n return {};\n }\n}\n\nexport function loadTransport(): TransportConfig | null {\n if (cachedTransport) return cachedTransport;\n const dir = configDir();\n const p = join(dir, getEnv().transportConfig);\n try {\n cachedTransport = JSON.parse(readFileSync(p, \"utf-8\")) as TransportConfig;\n validateShape(cachedTransport, TRANSPORT_SCHEMA, \"transport.json\");\n logInfo(TAG, `Loaded transport config (${Object.keys(cachedTransport.agents).length} agents, ${Object.keys(cachedTransport.providers).length} providers)`);\n const repairs = validateAndRepair(cachedTransport);\n if (repairs.length > 0) {\n for (const r of repairs) logWarn(TAG, `Auto-repaired: ${r.agent} was on ${r.oldProvider} \u2014 ${r.reason}`);\n writeTransportConfig(cachedTransport, `invariant auto-repair (${repairs.length} agents)`);\n pendingRepairs = repairs;\n }\n return cachedTransport;\n } catch (err) {\n logAndSwallow(TAG, \"loadTransport parse\", err);\n // Fallback to transport.default.json\n try {\n cachedTransport = JSON.parse(readFileSync(join(dir, \"transport.default.json\"), \"utf-8\")) as TransportConfig;\n logWarn(TAG, `transport.json missing/corrupt \u2014 loaded transport.default.json`);\n return cachedTransport;\n } catch (err) {\n logError(TAG, `No transport config available: ${err instanceof Error ? err.message : String(err)}`);\n return null;\n }\n }\n}\n\n/** Resolve hailMary from transport.json. Returns null if not configured. */\nexport function resolveHailMary(transport?: TransportConfig | null): { model: string; endpoint: string; apiKeyEnv?: string } | null {\n const tc = transport ?? loadTransport();\n if (!tc?.hailMary) return null;\n const provider = tc.providers[tc.hailMary.provider];\n if (!provider?.endpoint) return null;\n return { model: tc.hailMary.model, endpoint: provider.endpoint, apiKeyEnv: provider.apiKeyEnv };\n}\n\n/** Force re-read on next call (for tests). */\nexport function clearTransportCache(): void {\n cachedTransport = null;\n}\n\n// \u2500\u2500 Invariant validation \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport type RepairEntry = { agent: string; oldProvider: string; reason: string };\n\n/** Stashed repairs from last loadTransport() \u2014 consumed by model-health task. */\nlet pendingRepairs: RepairEntry[] = [];\nexport function consumeRepairs(): RepairEntry[] {\n const r = pendingRepairs;\n pendingRepairs = [];\n return r;\n}\n\n/**\n * Validate transport invariant: all agents must share professor's transport type.\n * For acp/tmux, provider name must also match (single child process).\n * Violations are auto-repaired (subagent reset to professor's assignment).\n */\nexport function validateAndRepair(tc: TransportConfig): RepairEntry[] {\n const profAssignment = tc.agents[\"professor\"];\n if (!profAssignment) return [];\n const profProvider = tc.providers[profAssignment.provider];\n if (!profProvider) return [];\n\n const profType = profProvider.transport;\n const repairs: RepairEntry[] = [];\n\n for (const [agent, assignment] of Object.entries(tc.agents)) {\n if (agent === \"professor\") continue;\n const provider = tc.providers[assignment.provider];\n if (!provider) continue;\n\n const agentType = provider.transport;\n let violation = false;\n\n if (agentType !== profType) {\n // Cross-transport-type violation\n violation = true;\n } else if (profType !== \"api\" && assignment.provider !== profAssignment.provider) {\n // ACP/tmux: must share exact provider (single child process)\n violation = true;\n }\n\n if (violation) {\n repairs.push({ agent, oldProvider: assignment.provider, reason: `${provider.transport} incompatible with professor (${profType}/${profAssignment.provider})` });\n tc.agents[agent] = { model: profAssignment.model, provider: profAssignment.provider };\n }\n }\n\n // Validate professor fallbacks \u2014 must also match professor's transport type\n const fallbacks = profAssignment.fallbacks;\n if (fallbacks) {\n for (let i = fallbacks.length - 1; i >= 0; i--) {\n const fb = fallbacks[i]!;\n const fbProvider = tc.providers[fb.provider];\n if (!fbProvider) continue;\n const fbType = fbProvider.transport;\n if (fbType !== profType || (profType !== \"api\" && fb.provider !== profAssignment.provider)) {\n repairs.push({ agent: `professor_fb${i + 1}`, oldProvider: fb.provider, reason: `fallback ${fbProvider.transport} incompatible with professor (${profType}/${profAssignment.provider})` });\n fallbacks.splice(i, 1);\n }\n }\n }\n\n // hailMary is exempt \u2014 manual emergency override that rebuilds transport\n\n return repairs;\n}\n\n// \u2500\u2500 Resolution \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function resolveAgent(role: string, transport?: TransportConfig | null, models?: ModelCatalog): ResolvedAgent | null {\n const tc = transport ?? loadTransport();\n if (!tc) return null;\n\n // cron inherits professor\n const effectiveRole = role === \"task\" ? \"professor\" : role;\n const assignment = tc.agents[effectiveRole];\n if (!assignment) {\n logWarn(TAG, `No agent assignment for role \"${role}\"`);\n return null;\n }\n\n const providers = tc.providers;\n // If primary is demoted AND the demoted model matches current, promote first non-demoted fallback\n let effectiveModel = assignment.model;\n let effectiveProvider = assignment.provider;\n const demotedModel = (assignment as any).demotedModel ?? assignment.model;\n if ((assignment as any).demoted && demotedModel === assignment.model) {\n const firstHealthy = (assignment.fallbacks ?? []).find((fb: any) => !fb.demoted);\n if (firstHealthy) {\n effectiveModel = firstHealthy.model;\n effectiveProvider = firstHealthy.provider;\n } else {\n logWarn(TAG, `All models demoted for role \"${role}\" \u2014 using primary anyway`);\n }\n }\n\n const resolvedProvider = providers[effectiveProvider];\n if (!resolvedProvider) {\n logWarn(TAG, `Provider \"${effectiveProvider}\" not found for role \"${role}\"`);\n return null;\n }\n\n const mc = models ?? loadModels();\n const modelEntry = mc[effectiveModel];\n if (!modelEntry && effectiveModel) {\n logWarn(TAG, `Model \"${effectiveModel}\" not in models.json \u2014 using defaults`);\n }\n\n return {\n model: effectiveModel,\n provider: resolvedProvider,\n providerName: effectiveProvider,\n contextWindow: modelEntry?.contextWindow ?? 128000,\n maxOutput: modelEntry?.maxOutput ?? 8192,\n fallbacks: (assignment.fallbacks ?? []).filter((fb: any) => !fb.demoted && fb.model !== effectiveModel),\n };\n}\n\n// \u2500\u2500 Fallback from .env \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport type EnvFallback = {\n provider: ProviderConfig;\n providerName: string;\n model: string;\n contextWindow: number;\n maxOutput: number;\n};\n\nexport function getEnvFallback(): EnvFallback {\n const providerName = readEnvWithDefault(\"DEFAULT_PROVIDER\", \"openrouter\", \"default LLM provider\");\n const transport = getEnv().defaultTransport as \"api\" | \"acp\" | \"tmux\";\n const model = readEnvWithDefault(\"DEFAULT_MODEL\", \"minimax-m2.5:cloud\", \"default LLM model\");\n\n const provider: ProviderConfig = { transport };\n if (transport === \"api\") {\n provider.endpoint = providerName === \"openrouter\"\n ? \"https://openrouter.ai/api/v1\"\n : \"http://localhost:11434/v1\";\n if (providerName === \"openrouter\") provider.apiKeyEnv = \"OPENROUTER_API_KEY\";\n }\n\n return { provider, providerName, model, contextWindow: 128000, maxOutput: 8192 };\n}\n\n// \u2500\u2500 Validation (startup) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function validateAtStartup(): void {\n const tc = loadTransport();\n if (!tc) return;\n const mc = loadModels();\n\n for (const [role, assignment] of Object.entries(tc.agents)) {\n if (!tc.providers[assignment.provider]) {\n logWarn(TAG, `Agent \"${role}\": provider \"${assignment.provider}\" not defined in providers`);\n }\n const modelEntry = mc[assignment.model];\n if (!modelEntry) {\n logWarn(TAG, `Agent \"${role}\": model \"${assignment.model}\" not in models.json`);\n } else if (!modelEntry.transports.includes(assignment.provider)) {\n logWarn(TAG, `Agent \"${role}\": model \"${assignment.model}\" not listed for provider \"${assignment.provider}\" in models.json`);\n }\n }\n}\n\n// \u2500\u2500 Write \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function writeTransportConfig(tc: TransportConfig, reason?: string): void {\n // Guard: reject empty model strings before persisting\n for (const [role, agent] of Object.entries(tc.agents)) {\n if (!agent.model?.trim()) {\n logWarn(TAG, `Refusing to write transport.json \u2014 agent \"${role}\" has empty model`);\n return;\n }\n }\n const p = join(configDir(), getEnv().transportConfig);\n // Save current as .old before overwriting (enables /model restore)\n // Only overwrite .old if it's >15min old \u2014 preserves last-known-good during rapid changes\n const oldPath = p.replace(\".json\", \".old.json\");\n try {\n const oldAge = Date.now() - statSync(oldPath).mtimeMs;\n if (oldAge > 15 * 60_000) writeFileSync(oldPath, readFileSync(p, \"utf-8\"), \"utf-8\");\n } catch { try { writeFileSync(oldPath, readFileSync(p, \"utf-8\"), \"utf-8\"); } catch (err) { logAndSwallow(TAG, \"backup transport.old.json\", err); } }\n writeFileSync(p, JSON.stringify(tc, null, 2), \"utf-8\");\n cachedTransport = tc;\n logInfo(TAG, reason ? `transport.json updated \u2014 ${reason}` : \"transport.json updated\");\n}\n\n/** Remove demoted models from config. Called on user-initiated model switch.\n * Models the user just chose are resurrected (demotion cleared). All other demoted entries are deleted. */\nexport function cleanDemotedModels(tc: TransportConfig, chosenModel?: string): void {\n for (const agent of Object.values(tc.agents)) {\n if ((agent as any).demoted) {\n if (agent.model === chosenModel) { delete (agent as any).demoted; delete (agent as any).demotedReason; delete (agent as any).demotedModel; }\n }\n if (agent.fallbacks) {\n for (const fb of agent.fallbacks) {\n if ((fb as any).demoted && fb.model === chosenModel) { delete (fb as any).demoted; delete (fb as any).demotedReason; delete (fb as any).demotedModel; }\n }\n }\n }\n}\n\n/** Mark a model as demoted in transport.json. Skipped by candidate loading. Never demotes the last available model for a role. */\nexport function demoteModel(model: string, reason: \"auth\" | \"timeout\"): void {\n const tc = loadTransport();\n if (!tc) return;\n // Guard: don't demote if it's the last non-demoted model for any role\n for (const agent of Object.values(tc.agents)) {\n const all = [agent, ...(agent.fallbacks ?? [])];\n const healthy = all.filter((m: any) => !m.demoted);\n if (healthy.length <= 1 && healthy.some((m: any) => m.model === model)) return;\n }\n let found = false;\n for (const agent of Object.values(tc.agents)) {\n if (agent.model === model) { (agent as any).demoted = new Date().toISOString(); (agent as any).demotedReason = reason; (agent as any).demotedModel = model; found = true; }\n for (const fb of agent.fallbacks ?? []) {\n if (fb.model === model) { (fb as any).demoted = new Date().toISOString(); (fb as any).demotedReason = reason; (fb as any).demotedModel = model; found = true; }\n }\n }\n if (found) writeTransportConfig(tc, `auto-demote ${model} (${reason})`);\n}\n\n/** Swap transport.json \u2194 transport.json.old (undo last switch). */\nexport function restorePrevious(): { ok: boolean; error?: string } {\n const dir = configDir();\n const activePath = join(dir, getEnv().transportConfig);\n const oldPath = activePath.replace(\".json\", \".old.json\");\n if (!existsSync(oldPath)) return { ok: false, error: \"Nothing to restore \u2014 no previous config saved.\" };\n try {\n const current = readFileSync(activePath, \"utf-8\");\n const old = readFileSync(oldPath, \"utf-8\");\n writeFileSync(activePath, old, \"utf-8\");\n writeFileSync(oldPath, current, \"utf-8\");\n cachedTransport = null;\n logInfo(TAG, \"transport.json swapped with .old (restore)\");\n return { ok: true };\n } catch (err) {\n return { ok: false, error: `Restore failed: ${err instanceof Error ? err.message : String(err)}` };\n }\n}\n\n/** Copy transport.default.json \u2192 transport.json, clear cache. Returns true if successful. */\nexport function resetToDefaults(): boolean {\n const dir = configDir();\n const defaultPath = join(dir, \"transport.default.json\");\n const activePath = join(dir, getEnv().transportConfig);\n try {\n // Backup current before overwriting\n try { writeFileSync(activePath.replace(\".json\", \".old.json\"), readFileSync(activePath, \"utf-8\"), \"utf-8\"); } catch (err) { logAndSwallow(\"transport_config\", \"op\", err); }\n const defaults = readFileSync(defaultPath, \"utf-8\");\n writeFileSync(activePath, defaults, \"utf-8\");\n cachedTransport = null;\n logInfo(TAG, \"transport.json reset to defaults (old saved as .old.json)\");\n return true;\n } catch (err) {\n logWarn(TAG, `No transport.default.json \u2014 keeping current config: ${err instanceof Error ? err.message : String(err)}`);\n return false;\n }\n}\n\n// \u2500\u2500 Provider availability \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function getAvailableProviders(tc: TransportConfig): Array<{ name: string; config: ProviderConfig }> {\n return Object.entries(tc.providers).map(([name, config]) => ({ name, config }));\n}\n\n/** Load a provider's defaults block. Missing subagents inherit professor's model. */\nexport function loadProviderDefaults(providerName: string, tc?: TransportConfig | null): Record<string, { model: string; fallbacks?: string[] }> | null {\n const config = tc ?? loadTransport();\n if (!config) return null;\n const provider = config.providers[providerName];\n if (!provider?.defaults) return null;\n const defaults = provider.defaults;\n if (!defaults[\"professor\"]) return null;\n const profModel = defaults[\"professor\"].model;\n const result: Record<string, { model: string; fallbacks?: string[] }> = { ...defaults };\n for (const role of [\"dreamy\", \"browsie\", \"coding\"]) {\n if (!result[role]) result[role] = { model: profModel };\n }\n return result;\n}\n\n// \u2500\u2500 Model helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function getModelsForProvider(providerName: string, models?: ModelCatalog): Array<{ id: string; entry: ModelEntry }> {\n const mc = models ?? loadModels();\n return Object.entries(mc)\n .filter(([, entry]) => entry.transports.includes(providerName))\n .map(([id, entry]) => ({ id, entry }))\n .sort((a, b) => a.entry.rank - b.entry.rank || a.entry.cost.input - b.entry.cost.input);\n}\n\nexport function formatRank(rank: number): string {\n const stars = Math.max(1, Math.min(5, 6 - rank));\n return \"\u2605\".repeat(stars) + \"\u2606\".repeat(5 - stars);\n}\n\nexport function formatCost(cost: ModelCost): string {\n if (cost.input === 0 && cost.output === 0) return \"free\";\n const inp = `$${cost.input}`;\n const out = cost.output != null ? `$${cost.output}` : \"$???\";\n return `${inp}/${out}`;\n}\n\n// \u2500\u2500 Provider readiness validation (#367) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport type ProviderValidationResult =\n | { ok: true }\n | { ok: false; reason: string; fix: string };\n\n/**\n * Minimal env accessor \u2014 just the slice validateProviderReady needs.\n * Matches the shape exposed by getEnv().\n */\nexport type EnvAccessor = {\n getApiKey(envName: string): string | undefined;\n};\n\n/**\n * Validate that a transport provider's prerequisites are in place BEFORE the\n * bridge attempts to switch to it (#367).\n *\n * Contract:\n * - `api` + `apiKeyEnv` declared \u2192 env var must be non-empty\n * - `api` + no `apiKeyEnv` \u2192 always ok (local ollama-style)\n * - `acp` \u2192 `provider.cli` must be runnable (`<cli> --version` within 3s)\n * - `tmux` \u2192 always ok (out of scope)\n *\n * Pure aside from the ACP `execSync` probe. execSync is imported lazily so\n * unit tests can stub it via dependency injection if needed.\n */\nexport function validateProviderReady(\n providerName: string,\n provider: ProviderConfig,\n env: EnvAccessor,\n): ProviderValidationResult {\n if (provider.transport === \"tmux\") return { ok: true };\n\n if (provider.transport === \"api\") {\n if (!provider.apiKeyEnv) return { ok: true };\n const key = env.getApiKey(provider.apiKeyEnv);\n if (!key) {\n return {\n ok: false,\n reason: `${providerName} requires API key from env var '${provider.apiKeyEnv}' but it's not set`,\n fix: `Add ${provider.apiKeyEnv}=... to .env and restart`,\n };\n }\n return { ok: true };\n }\n\n if (provider.transport === \"acp\") {\n const cli = provider.cli;\n if (!cli) {\n return {\n ok: false,\n reason: `ACP provider ${providerName} has no 'cli' field set in transport.json`,\n fix: `Add \\\"cli\\\": \\\"<path-to-cli>\\\" to provider ${providerName} in transport.json`,\n };\n }\n try {\n // Inline require so mocks work in tests and production stays synchronous.\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const { execSync } = require(\"node:child_process\") as typeof import(\"node:child_process\");\n execSync(`${cli} --version`, { timeout: 3000, stdio: \"pipe\" });\n return { ok: true };\n } catch (err) {\n const errMsg = err instanceof Error ? err.message.split(\"\\n\")[0] : String(err);\n return {\n ok: false,\n reason: `ACP provider ${providerName} CLI '${cli}' is not runnable (${errMsg})`,\n fix: `Install ${cli} or update its path in transport.json`,\n };\n }\n }\n\n // Unknown transport \u2014 fail closed with a clear message.\n return {\n ok: false,\n reason: `Unknown transport type '${(provider as ProviderConfig).transport}' for provider ${providerName}`,\n fix: `Use 'api', 'acp', or 'tmux' for provider.transport`,\n };\n}\n\n/** Format a validation failure for user-visible error messages. */\nexport function formatValidationError(providerName: string, result: ProviderValidationResult): string {\n if (result.ok) return \"\";\n return `\u274C Cannot switch to ${providerName}: ${result.reason}\\n Fix: ${result.fix}`;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAQA;AAFA,SAAS,cAAc,eAAe,YAAY,gBAAgB;AAClE,SAAS,YAAY;AAGrB;AAEA,IAAM,MAAM;AAgEZ,IAAI,kBAA0C;AAEvC,SAAS,YAAoB;AAClC,SAAO,KAAK,WAAW,GAAG,QAAQ;AACpC;AAEO,SAAS,aAA2B;AACzC,QAAM,IAAI,KAAK,UAAU,GAAG,OAAO,EAAE,YAAY;AACjD,MAAI;AACF,WAAO,KAAK,MAAM,aAAa,GAAG,OAAO,CAAC;AAAA,EAC5C,SAAS,KAAK;AACZ,YAAQ,KAAK,+BAA+B,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC,EAAE;AAC9F,WAAO,CAAC;AAAA,EACV;AACF;AAEO,SAAS,gBAAwC;AACtD,MAAI,gBAAiB,QAAO;AAC5B,QAAM,MAAM,UAAU;AACtB,QAAM,IAAI,KAAK,KAAK,OAAO,EAAE,eAAe;AAC5C,MAAI;AACF,sBAAkB,KAAK,MAAM,aAAa,GAAG,OAAO,CAAC;AACrD,kBAAc,iBAAiB,kBAAkB,gBAAgB;AACjE,YAAQ,KAAK,4BAA4B,OAAO,KAAK,gBAAgB,MAAM,EAAE,MAAM,YAAY,OAAO,KAAK,gBAAgB,SAAS,EAAE,MAAM,aAAa;AACzJ,UAAM,UAAU,kBAAkB,eAAe;AACjD,QAAI,QAAQ,SAAS,GAAG;AACtB,iBAAW,KAAK,QAAS,SAAQ,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,WAAW,WAAM,EAAE,MAAM,EAAE;AACvG,2BAAqB,iBAAiB,0BAA0B,QAAQ,MAAM,UAAU;AACxF,uBAAiB;AAAA,IACnB;AACA,WAAO;AAAA,EACT,SAAS,KAAK;AACZ,k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,SAAO,2BAAsB,YAAY,KAAK,OAAO,MAAM;AAAA,UAAa,OAAO,GAAG;AACpF;",
6
+ "names": ["err"]
7
+ }
@@ -1,13 +1,14 @@
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);
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);
2
3
  import {
3
4
  init_log_and_swallow,
4
5
  logAndSwallow
5
- } from "./chunk-FMWKEPM7.js";
6
+ } from "./chunk-EX2SRTUE.js";
6
7
  import {
7
8
  init_logger,
8
9
  logDebug,
9
10
  logInfo
10
- } from "./chunk-BUUVFUPO.js";
11
+ } from "./chunk-2BY6I4P5.js";
11
12
 
12
13
  // src/components/stt.ts
13
14
  init_logger();
@@ -55,4 +56,4 @@ export {
55
56
  LANGUAGE_HINT_PROMPT,
56
57
  transcribeAudio
57
58
  };
58
- //# sourceMappingURL=chunk-V76TVMCM.js.map
59
+ //# sourceMappingURL=chunk-3MO2MDXJ.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/components/stt.ts"],
4
4
  "sourcesContent": ["import { logInfo, logDebug } from \"./logger.js\";\nimport { logAndSwallow } from \"./log-and-swallow.js\";\n\nconst TAG = \"stt\";\n\nexport type SttProvider = \"groq\";\n\nexport interface SttConfig {\n provider: SttProvider;\n apiKey: string;\n model?: string;\n}\n\nconst GROQ_ENDPOINT = \"https://api.groq.com/openai/v1/audio/transcriptions\";\nconst DEFAULT_MODEL = \"whisper-large-v3\";\nexport const LANGUAGE_HINT_PROMPT = process.env[\"STT_LANGUAGE_HINT\"] || \"\";\n\n/**\n * Transcribe audio using Groq's OpenAI-compatible Whisper endpoint.\n * Sends the audio as multipart/form-data.\n */\nexport async function transcribeAudio(\n audioBuffer: Buffer,\n filename: string,\n config: SttConfig,\n): Promise<{ text: string; language: string }> {\n const model = config.model || DEFAULT_MODEL;\n logInfo(\"stt\", `Transcribing ${filename} (${audioBuffer.length} bytes) via ${config.provider}/${model}`);\n\n const formData = new FormData();\n const blob = new Blob([audioBuffer], { type: \"audio/ogg\" });\n formData.append(\"file\", blob, filename);\n formData.append(\"model\", model);\n if (LANGUAGE_HINT_PROMPT) formData.append(\"prompt\", LANGUAGE_HINT_PROMPT);\n formData.append(\"response_format\", \"verbose_json\");\n\n const endpoint = GROQ_ENDPOINT;\n\n const response = await fetch(endpoint, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${config.apiKey}`,\n },\n body: formData,\n });\n\n if (!response.ok) {\n const text = await response.text().catch(err => { logAndSwallow(TAG, \"read STT error body\", err); return \"\"; });\n throw new Error(`STT failed (${response.status}): ${text}`);\n }\n\n const json = (await response.json()) as { text?: string; language?: string };\n const transcript = json.text?.trim() ?? \"\";\n const language = json.language?.trim() ?? \"\";\n\n if (!transcript) {\n logDebug(\"stt\", \"Empty transcript returned\");\n return { text: \"\", language };\n }\n\n logInfo(\"stt\", `Transcript (${transcript.length} chars, lang=${language || \"?\"}): \"${transcript.slice(0, 80)}\"`);\n return { text: transcript, language };\n}\n"],
5
- "mappings": ";;;;;;;;;;;;AAAA;AACA;AAEA,IAAM,MAAM;AAUZ,IAAM,gBAAgB;AACtB,IAAM,gBAAgB;AACf,IAAM,uBAAuB,QAAQ,IAAI,mBAAmB,KAAK;AAMxE,eAAsB,gBACpB,aACA,UACA,QAC6C;AAC7C,QAAM,QAAQ,OAAO,SAAS;AAC9B,UAAQ,OAAO,gBAAgB,QAAQ,KAAK,YAAY,MAAM,eAAe,OAAO,QAA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ath } 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);
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);
2
3
  import {
3
4
  createAgentTransport
4
- } from "./chunk-BSSBCSCL.js";
5
+ } from "./chunk-LD5BMLHG.js";
5
6
  import {
6
7
  loadUsers
7
- } from "./chunk-GST5T3WZ.js";
8
+ } from "./chunk-J5YIMCLT.js";
8
9
  import {
9
10
  init_log_and_swallow,
10
11
  logAndSwallow
11
- } from "./chunk-FMWKEPM7.js";
12
+ } from "./chunk-EX2SRTUE.js";
12
13
  import {
13
14
  getEnv,
14
15
  init_env_schema
15
- } from "./chunk-JCJS4ZIB.js";
16
+ } from "./chunk-AQVOAQQI.js";
16
17
  import {
17
18
  init_logger,
18
19
  isLogLevel,
@@ -20,11 +21,11 @@ import {
20
21
  logError,
21
22
  logInfo,
22
23
  logWarn
23
- } from "./chunk-BUUVFUPO.js";
24
+ } from "./chunk-2BY6I4P5.js";
24
25
  import {
25
26
  abtarsHome,
26
27
  init_paths
27
- } from "./chunk-X76UX47U.js";
28
+ } from "./chunk-MJ6PHMOK.js";
28
29
 
29
30
  // src/boot/phase-transport.ts
30
31
  init_log_and_swallow();
@@ -438,7 +439,7 @@ async function phaseTransport(ctx) {
438
439
  async function buildTransport(ctx) {
439
440
  const { config, memoryConfig } = ctx;
440
441
  let transport;
441
- const { resolveAgent, getEnvFallback, loadTransport, resolveHailMary, clearTransportCache, validateProviderReady } = await import("./transport-config-YLXU33RO.js");
442
+ const { resolveAgent, getEnvFallback, loadTransport, resolveHailMary, clearTransportCache, validateProviderReady } = await import("./transport-config-ANPS2RYT.js");
442
443
  clearTransportCache();
443
444
  const tc = loadTransport();
444
445
  const prof = tc ? resolveAgent("professor", tc) : null;
@@ -495,9 +496,9 @@ async function buildTransport(ctx) {
495
496
  defaults?.maxWaitSec ?? config.transport.tmuxMaxWaitSec
496
497
  );
497
498
  } else if (resolved.provider.transport === "api") {
498
- const { DirectApiTransport } = await import("./direct-api-transport-YR7SXXNN.js");
499
- const { ModelHealthRegistry } = await import("./model-health-registry-35LQNVQR.js");
500
- const { FallbackPolicy } = await import("./fallback-policy-L4QV2PEJ.js");
499
+ const { DirectApiTransport } = await import("./direct-api-transport-EADHM67Z.js");
500
+ const { ModelHealthRegistry } = await import("./model-health-registry-LDC76RPP.js");
501
+ const { FallbackPolicy } = await import("./fallback-policy-SR6ED5I3.js");
501
502
  const apiKey = getEnv().getApiKey(resolved.provider.apiKeyEnv ?? "API_KEY");
502
503
  const candidates = [
503
504
  { endpoint: resolved.provider.endpoint ?? "http://localhost:11434/v1", apiKey, model: resolved.model, maxContext: resolved.contextWindow }
@@ -516,8 +517,8 @@ async function buildTransport(ctx) {
516
517
  }
517
518
  if (!ctx.modelHealthRegistry.onDemote) {
518
519
  ctx.modelHealthRegistry.onDemote = (model, _endpoint, reason) => {
519
- import("./transport-config-YLXU33RO.js").then(({ demoteModel }) => demoteModel(model, reason));
520
- import("./notification-Y5S5MMLV.js").then(({ sendNotification }) => sendNotification(ctx, `\u26A0\uFE0F ${model} demoted (${reason}). Next healthy model promoted.`)).catch((err) => logAndSwallow(TAG2, "sendNotification model-demote", err));
520
+ import("./transport-config-ANPS2RYT.js").then(({ demoteModel }) => demoteModel(model, reason));
521
+ import("./notification-OJ4YE4VG.js").then(({ sendNotification }) => sendNotification(ctx, `\u26A0\uFE0F ${model} demoted (${reason}). Next healthy model promoted.`)).catch((err) => logAndSwallow(TAG2, "sendNotification model-demote", err));
521
522
  };
522
523
  }
523
524
  const policy = new FallbackPolicy(candidates, ctx.modelHealthRegistry);
@@ -548,7 +549,7 @@ async function buildTransport(ctx) {
548
549
  }
549
550
  await transport.initialize();
550
551
  if ("setSystemPrompt" in transport && typeof transport.setSystemPrompt === "function") {
551
- const { loadSoulBundle } = await import("./soul-loader-54WCVNLJ.js");
552
+ const { loadSoulBundle } = await import("./soul-loader-UVJ6HZM3.js");
552
553
  const soul = loadSoulBundle();
553
554
  if (soul) transport.setSystemPrompt(soul);
554
555
  }
@@ -565,12 +566,12 @@ async function buildTransport(ctx) {
565
566
  ctx.runtime.setMainTransport(transport);
566
567
  ctx.runtime.setSessionManager(ctx.sessionManager);
567
568
  if (getEnv().enableAsyncDelegation) {
568
- const { setDelegationDeps } = await import("./delegation-tools-GYTS2D6A.js");
569
+ const { setDelegationDeps } = await import("./delegation-tools-PF7RD2RW.js");
569
570
  setDelegationDeps(ctx.runtime, ctx.sessionManager);
570
571
  }
571
572
  logInfo("main", "\u2705 Transport ready");
572
- if (resolved.provider.transport === "api" && ctx.memory) {
573
- const { setMemoryBackend } = await import("./tool-registry-MU3OX4UI.js");
573
+ if (resolved.provider.transport === "api" && ctx.memory?.available) {
574
+ const { setMemoryBackend } = await import("./tool-registry-DFCCGZCB.js");
574
575
  const { SqliteBackend } = await import("abmind");
575
576
  const backend = new SqliteBackend(memoryConfig);
576
577
  await backend.initialize();
@@ -579,12 +580,12 @@ async function buildTransport(ctx) {
579
580
  const db = ctx.memory.getDb?.() ?? ctx.memory.getDatabase?.();
580
581
  if (db && resolved.contextWindow >= 128e3) {
581
582
  const { ContextEngine } = await import("abmind");
582
- const { createContextOrchestrator } = await import("./context-HCEGZNDC.js");
583
+ const { createContextOrchestrator } = await import("./context-OCS7HLJP.js");
583
584
  const contextEngine = new ContextEngine(db);
584
585
  const orchestrator = createContextOrchestrator(
585
586
  contextEngine,
586
587
  async (systemPrompt, userPrompt) => {
587
- const { streamSingleCompletion } = await import("./stream-single-WSG4D53C.js");
588
+ const { streamSingleCompletion } = await import("./stream-single-RFJNUTL6.js");
588
589
  return streamSingleCompletion({
589
590
  endpoint: resolved.provider.endpoint ?? "http://localhost:11434/v1",
590
591
  apiKey: getEnv().getApiKey(resolved.provider.apiKeyEnv ?? "API_KEY") ?? void 0,
@@ -615,7 +616,7 @@ async function buildTransport(ctx) {
615
616
  logInfo("main", msg);
616
617
  if (model !== lastNotifiedModel || isLogLevel("debug")) {
617
618
  lastNotifiedModel = model;
618
- import("./notification-Y5S5MMLV.js").then(({ sendNotification }) => sendNotification(ctx, msg)).catch((err) => logAndSwallow(TAG2, "sendNotification fallback", err));
619
+ import("./notification-OJ4YE4VG.js").then(({ sendNotification }) => sendNotification(ctx, msg)).catch((err) => logAndSwallow(TAG2, "sendNotification fallback", err));
619
620
  }
620
621
  };
621
622
  }
@@ -641,4 +642,4 @@ export {
641
642
  buildTransport,
642
643
  rebuildTransport
643
644
  };
644
- //# sourceMappingURL=chunk-6UCRKRWR.js.map
645
+ //# sourceMappingURL=chunk-6XX4OAAM.js.map