abtars 0.2.1-alpha.9 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +93 -34
  3. package/bundle/{_registry.generated-ADOYFJJ4.js → _registry.generated-KYX63MGY.js} +19 -16
  4. package/bundle/{_registry.generated-ADOYFJJ4.js.map → _registry.generated-KYX63MGY.js.map} +1 -1
  5. package/bundle/abtars-browser.js +5 -6
  6. package/bundle/abtars-browser.js.map +2 -2
  7. package/bundle/abtars-cli.js +205 -179
  8. package/bundle/abtars-cli.js.map +4 -4
  9. package/bundle/abtars-restart.js +4 -4
  10. package/bundle/abtars-rss.js +25 -81
  11. package/bundle/abtars-rss.js.map +2 -2
  12. package/bundle/abtars-task.js +4 -5
  13. package/bundle/abtars-task.js.map +2 -2
  14. package/bundle/abtars-todo.js +133 -0
  15. package/bundle/abtars-todo.js.map +7 -0
  16. package/bundle/abtars.js +305 -182
  17. package/bundle/abtars.js.map +3 -3
  18. package/bundle/action-gate-DYV2XQBP.js +191 -0
  19. package/bundle/action-gate-DYV2XQBP.js.map +7 -0
  20. package/bundle/{agent-api-rate-limit-C25WGSFF.js → agent-api-rate-limit-R2OFAQ3N.js} +4 -4
  21. package/bundle/{agent-registry-SYUFNSVB.js → agent-registry-5VL5KI6U.js} +8 -8
  22. package/bundle/agent-registry-PIS5XJHX.js +19 -0
  23. package/bundle/{bridge-lock-transport-HO545SBK.js → bridge-lock-transport-N6OGDOSE.js} +5 -5
  24. package/bundle/{browse-delivery-VTLEAVYA.js → browse-delivery-DXGMDMXA.js} +8 -7
  25. package/bundle/{browser-REIXOJ6S.js → browser-QMYGSP5W.js} +11 -10
  26. package/bundle/{capability-ILW3D5HS.js → capability-733TLH4W.js} +6 -6
  27. package/bundle/chunk-3IPMKYYH.js +672 -0
  28. package/bundle/chunk-3IPMKYYH.js.map +7 -0
  29. package/bundle/{chunk-PZE3J7ER.js → chunk-3OXQWII3.js} +2 -2
  30. package/bundle/{chunk-X5FBUA53.js → chunk-4WKWPU6U.js} +137 -30
  31. package/bundle/chunk-4WKWPU6U.js.map +7 -0
  32. package/bundle/{chunk-4KJ76TTE.js → chunk-4XW7YA3K.js} +3 -3
  33. package/bundle/{chunk-A5OJYQNU.js → chunk-5WFIAUQC.js} +49 -22
  34. package/bundle/chunk-5WFIAUQC.js.map +7 -0
  35. package/bundle/{chunk-ZVDVNSXK.js → chunk-7WFE2JI5.js} +7 -7
  36. package/bundle/{chunk-R36WIOYX.js → chunk-B52YRWR6.js} +34 -6
  37. package/bundle/chunk-B52YRWR6.js.map +7 -0
  38. package/bundle/{chunk-Q62SXS73.js → chunk-BBDKU4EH.js} +9 -9
  39. package/bundle/chunk-BBTQKKDO.js +258 -0
  40. package/bundle/chunk-BBTQKKDO.js.map +7 -0
  41. package/bundle/{chunk-EX2SRTUE.js → chunk-CYSGXNBY.js} +2 -2
  42. package/bundle/{chunk-LYEAHE5V.js → chunk-DCY7DGMT.js} +2 -2
  43. package/bundle/chunk-DGS7J4P6.js +13 -0
  44. package/bundle/chunk-DGS7J4P6.js.map +7 -0
  45. package/bundle/{chunk-LDKSCXGL.js → chunk-DHPFI7OF.js} +8 -6
  46. package/bundle/{chunk-LDKSCXGL.js.map → chunk-DHPFI7OF.js.map} +1 -1
  47. package/bundle/{chunk-G6IXMYIO.js → chunk-DO4INSXE.js} +2 -2
  48. package/bundle/{chunk-VA5WKN3Z.js → chunk-EGA6JQVV.js} +4 -4
  49. package/bundle/chunk-EKHNWFEQ.js +85 -0
  50. package/bundle/chunk-EKHNWFEQ.js.map +7 -0
  51. package/bundle/{chunk-URAQLQ2U.js → chunk-F3HMZFIL.js} +4 -4
  52. package/bundle/{chunk-OOKLEC6V.js → chunk-FY3QUO2L.js} +7 -7
  53. package/bundle/{chunk-2BY6I4P5.js → chunk-GUTRAMK3.js} +2 -2
  54. package/bundle/chunk-GXKJKYU4.js +1089 -0
  55. package/bundle/chunk-GXKJKYU4.js.map +7 -0
  56. package/bundle/{chunk-GPL57SRN.js → chunk-H7RX7UCR.js} +3 -3
  57. package/bundle/{chunk-BYDUMHXT.js → chunk-HAF2AFBW.js} +2 -2
  58. package/bundle/chunk-HAS5NEK7.js +189 -0
  59. package/bundle/chunk-HAS5NEK7.js.map +7 -0
  60. package/bundle/chunk-HB54S5OY.js +4036 -0
  61. package/bundle/chunk-HB54S5OY.js.map +7 -0
  62. package/bundle/{chunk-OZ4IZFV4.js → chunk-HJQZP5CK.js} +9 -9
  63. package/bundle/{chunk-OZ4IZFV4.js.map → chunk-HJQZP5CK.js.map} +2 -2
  64. package/bundle/{chunk-HEHD3GG5.js → chunk-ITB2K6LI.js} +6 -13
  65. package/bundle/{chunk-HEHD3GG5.js.map → chunk-ITB2K6LI.js.map} +3 -3
  66. package/bundle/{chunk-KSEIWT4T.js → chunk-JFKOPNKL.js} +10 -10
  67. package/bundle/chunk-JFKOPNKL.js.map +7 -0
  68. package/bundle/{chunk-KFENC7BM.js → chunk-L33WNMCP.js} +2 -2
  69. package/bundle/{chunk-JRG4EFMP.js → chunk-LBMETTUP.js} +3 -3
  70. package/bundle/{chunk-TYVI3ZWA.js → chunk-LJAG2URA.js} +10 -7
  71. package/bundle/chunk-LJAG2URA.js.map +7 -0
  72. package/bundle/{chunk-KWBGYWDO.js → chunk-N24ROESF.js} +15 -17
  73. package/bundle/chunk-N24ROESF.js.map +7 -0
  74. package/bundle/{chunk-P2BZSLJJ.js → chunk-N7UG4FID.js} +448 -129
  75. package/bundle/chunk-N7UG4FID.js.map +7 -0
  76. package/bundle/chunk-NIYVCGBC.js +330 -0
  77. package/bundle/chunk-NIYVCGBC.js.map +7 -0
  78. package/bundle/{chunk-TOUZC6NR.js → chunk-OKMN6J4Z.js} +3 -3
  79. package/bundle/{chunk-RV54J75Q.js → chunk-PKHYCNTT.js} +13 -12
  80. package/bundle/chunk-PKHYCNTT.js.map +7 -0
  81. package/bundle/{chunk-XZSYMCLF.js → chunk-PUDGA4RR.js} +7 -7
  82. package/bundle/{chunk-CELR236Q.js → chunk-Q7CH5DA3.js} +2 -2
  83. package/bundle/chunk-QSC6QZ44.js +183 -0
  84. package/bundle/chunk-QSC6QZ44.js.map +7 -0
  85. package/bundle/chunk-RITEGAW6.js +138 -0
  86. package/bundle/chunk-RITEGAW6.js.map +7 -0
  87. package/bundle/{chunk-UDZIZB5F.js → chunk-RTL7HO3N.js} +3 -3
  88. package/bundle/{chunk-ITG6XGBS.js → chunk-SA44ITVX.js} +10 -10
  89. package/bundle/{chunk-3MO2MDXJ.js → chunk-SA6YEFNG.js} +3 -3
  90. package/bundle/{chunk-4BUOO6WI.js → chunk-SMZQDMSZ.js} +31 -11
  91. package/bundle/chunk-SMZQDMSZ.js.map +7 -0
  92. package/bundle/{chunk-GBBTK6H2.js → chunk-SRFEIZQT.js} +4 -4
  93. package/bundle/{chunk-ELRAH7VL.js → chunk-VXUVKC66.js} +3 -3
  94. package/bundle/chunk-VY2BUO6L.js +4035 -0
  95. package/bundle/chunk-VY2BUO6L.js.map +7 -0
  96. package/bundle/chunk-W6ELWLAR.js +143 -0
  97. package/bundle/chunk-W6ELWLAR.js.map +7 -0
  98. package/bundle/{chunk-RSWUPUNA.js → chunk-WMWI3SJ7.js} +30 -6
  99. package/bundle/chunk-WMWI3SJ7.js.map +7 -0
  100. package/bundle/{chunk-MJ6PHMOK.js → chunk-WW5F2DCO.js} +11 -2
  101. package/bundle/chunk-WW5F2DCO.js.map +7 -0
  102. package/bundle/chunk-Y2XBDQP3.js +4055 -0
  103. package/bundle/chunk-Y2XBDQP3.js.map +7 -0
  104. package/bundle/chunk-YMGX6HNP.js +131 -0
  105. package/bundle/chunk-YMGX6HNP.js.map +7 -0
  106. package/bundle/chunk-YWZPKBO6.js +22 -0
  107. package/bundle/chunk-YWZPKBO6.js.map +7 -0
  108. package/bundle/chunk-ZAA7B5BN.js +22 -0
  109. package/bundle/chunk-ZAA7B5BN.js.map +7 -0
  110. package/bundle/{commands-WUGPBPHI.js → commands-IGRSOSK6.js} +15 -14
  111. package/bundle/commands-LAWVNQTO.js +34 -0
  112. package/bundle/commands-RBWY7YXB.js +34 -0
  113. package/bundle/commands-XFZNMZN6.js +34 -0
  114. package/bundle/{config-DQIGDX4W.js → config-NDEYF4AQ.js} +7 -7
  115. package/bundle/{daemon-NPKYZ3CJ.js → daemon-WOQXCKNL.js} +4 -4
  116. package/bundle/{delegation-tools-6FICZQ5G.js → delegation-tools-Z5OM3TXS.js} +5 -5
  117. package/bundle/{deploy-lib-import-SBKXDD3F.js → deploy-lib-import-6VJTYXEG.js} +2 -2
  118. package/bundle/{deps-HN6CEXA4.js → deps-65V7XXG4.js} +4 -4
  119. package/bundle/{direct-api-transport-TRV45NO6.js → direct-api-transport-OZICXTWQ.js} +43 -15
  120. package/bundle/direct-api-transport-OZICXTWQ.js.map +7 -0
  121. package/bundle/direct-api-transport-QIWA5ES2.js +889 -0
  122. package/bundle/direct-api-transport-QIWA5ES2.js.map +7 -0
  123. package/bundle/{discord-adapter-WA2MFRK3.js → discord-adapter-JFIIVG34.js} +27 -24
  124. package/bundle/discord-adapter-JFIIVG34.js.map +7 -0
  125. package/bundle/discord-adapter-U3FA5OTY.js +589 -0
  126. package/bundle/discord-adapter-U3FA5OTY.js.map +7 -0
  127. package/bundle/discord-adapter-W6L5KJ6T.js +589 -0
  128. package/bundle/discord-adapter-W6L5KJ6T.js.map +7 -0
  129. package/bundle/discord-adapter-WWM6ROTW.js +589 -0
  130. package/bundle/discord-adapter-WWM6ROTW.js.map +7 -0
  131. package/bundle/{dns-wakeup-RYOCQ6GR.js → dns-wakeup-N46RPU5E.js} +3 -3
  132. package/bundle/{doctor-R54GZPKL.js → doctor-PIPSGI3H.js} +18 -7
  133. package/bundle/{doctor-R54GZPKL.js.map → doctor-PIPSGI3H.js.map} +2 -2
  134. package/bundle/{ensure-invariants-BJIEOSJ2.js → ensure-invariants-3NOBCYWS.js} +4 -4
  135. package/bundle/{env-schema-XCPAJ6IZ.js → env-schema-T43X43BU.js} +4 -4
  136. package/bundle/{hook-system-POI5VRIX.js → hook-system-ZCVOFFRD.js} +4 -4
  137. package/bundle/hotskills-DTROJY6G.js +17 -0
  138. package/bundle/{install-SH4UVUXQ.js → install-I3CXVW52.js} +3 -3
  139. package/bundle/{install-manifest-QRWID3KZ.js → install-manifest-KBYD7SAY.js} +3 -3
  140. package/bundle/{irc-adapter-AIEP6OX6.js → irc-adapter-HXO5D4SW.js} +3 -3
  141. package/bundle/{irc-config-6VY67UPQ.js → irc-config-XN5VW2V4.js} +5 -5
  142. package/bundle/kanban-board-6Q5E5GEB.js +31 -0
  143. package/bundle/kanban-board-I52RHNHQ.js +31 -0
  144. package/bundle/{lazy-require-UFYFFX2R.js → lazy-require-R3JYCV5M.js} +4 -4
  145. package/bundle/{media-utils-MOE36VWY.js → media-utils-W7XW3SVV.js} +4 -4
  146. package/bundle/{message-pipeline-2MBT44FO.js → message-pipeline-4CTBJ6K2.js} +17 -14
  147. package/bundle/message-pipeline-4KL7OWUH.js +38 -0
  148. package/bundle/message-pipeline-GFKSHRFU.js +38 -0
  149. package/bundle/message-pipeline-TGI2WJJM.js +38 -0
  150. package/bundle/meta.json +3181 -2356
  151. package/bundle/{notification-U6F5ZBSG.js → notification-ULESRDHB.js} +7 -6
  152. package/bundle/{openrouter-credits-7XXO6QGQ.js → openrouter-credits-PLIKRY5D.js} +4 -4
  153. package/bundle/{paths-ZJYIDND2.js → paths-QQM74XYT.js} +4 -2
  154. package/bundle/{peer-client-T44VI7NB.js → peer-client-D2F5QWRV.js} +8 -8
  155. package/bundle/{peer-config-D5A4454H.js → peer-config-5SUIBJLG.js} +5 -5
  156. package/bundle/{phase-transport-FEZ4SIJJ.js → phase-transport-INFD6ELA.js} +10 -10
  157. package/bundle/phase-transport-KXFZ5BVF.js +23 -0
  158. package/bundle/{restore-MFSW3EBL.js → restore-Z6MF54HS.js} +4 -4
  159. package/bundle/{restore-MFSW3EBL.js.map → restore-Z6MF54HS.js.map} +2 -2
  160. package/bundle/{update-check-O5MS6B3L.js → rollback-5RXXLUD6.js} +5 -7
  161. package/bundle/{self-healer-utils-7NFH22VJ.js → self-healer-utils-WPKOVXJD.js} +4 -4
  162. package/bundle/{skill-stats-IPVKMWN3.js → skill-stats-NHNH47QW.js} +5 -5
  163. package/bundle/{sleep-BPWX3FCN.js → sleep-ENFZFUJJ.js} +8 -8
  164. package/bundle/sleep-ENFZFUJJ.js.map +7 -0
  165. package/bundle/{soul-bundle-BRIUDEQ2.js → soul-bundle-QTPWDJB2.js} +7 -7
  166. package/bundle/soul-bundle-QTPWDJB2.js.map +7 -0
  167. package/bundle/{soul-loader-GBXJ7EBH.js → soul-loader-LCPTN4PK.js} +8 -8
  168. package/bundle/soul-loader-LCPTN4PK.js.map +7 -0
  169. package/bundle/{sse-parser-anthropic-H42TTLBD.js → sse-parser-anthropic-PYDJM3UC.js} +4 -4
  170. package/bundle/{sse-parser-responses-WG2LY2ML.js → sse-parser-responses-FYT7A5WT.js} +4 -4
  171. package/bundle/{ssrf-guard-E2KBBC5E.js → ssrf-guard-R4P5OCTO.js} +4 -4
  172. package/bundle/{start-CBVKNEAT.js → start-4DNURGIY.js} +1 -1
  173. package/bundle/{stt-CF3CPFDC.js → stt-YN77NND6.js} +5 -5
  174. package/bundle/stt-YN77NND6.js.map +7 -0
  175. package/bundle/{subagent-runtime-4MTYUBIZ.js → subagent-runtime-5AYOXOU2.js} +5 -5
  176. package/bundle/subagent-runtime-5AYOXOU2.js.map +7 -0
  177. package/bundle/subagent-runtime-VKTX6Q2M.js +13 -0
  178. package/bundle/subagent-runtime-VKTX6Q2M.js.map +7 -0
  179. package/bundle/system-event-buffer-OEPPNUGK.js +17 -0
  180. package/bundle/system-event-buffer-OEPPNUGK.js.map +7 -0
  181. package/bundle/{system-message-TALP6GP2.js → system-message-BRU267FW.js} +3 -3
  182. package/bundle/{system-status-GLYXXDE3.js → system-status-7K2QTH3J.js} +58 -51
  183. package/bundle/system-status-7K2QTH3J.js.map +7 -0
  184. package/bundle/{hotskills-6ECHLXTJ.js → task-failure-buffer-DPM5MWZ5.js} +8 -7
  185. package/bundle/task-failure-buffer-DPM5MWZ5.js.map +7 -0
  186. package/bundle/{task-store-LC7ZMS72.js → task-store-VCBHAB43.js} +5 -5
  187. package/bundle/task-store-VCBHAB43.js.map +7 -0
  188. package/bundle/{telegram-adapter-BJJYXN7J.js → telegram-adapter-4KI4CJPG.js} +51 -33
  189. package/bundle/telegram-adapter-4KI4CJPG.js.map +7 -0
  190. package/bundle/telegram-adapter-76B4JRJJ.js +1080 -0
  191. package/bundle/telegram-adapter-76B4JRJJ.js.map +7 -0
  192. package/bundle/telegram-adapter-VZA74EMT.js +1080 -0
  193. package/bundle/telegram-adapter-VZA74EMT.js.map +7 -0
  194. package/bundle/telegram-adapter-ZO2CLU22.js +1080 -0
  195. package/bundle/telegram-adapter-ZO2CLU22.js.map +7 -0
  196. package/bundle/{tool-registry-T7XLTI2Q.js → tool-registry-CG7GIS64.js} +13 -9
  197. package/bundle/tool-registry-CG7GIS64.js.map +7 -0
  198. package/bundle/tool-registry-TGNU5AMG.js +43 -0
  199. package/bundle/tool-registry-TGNU5AMG.js.map +7 -0
  200. package/bundle/{tool-sandbox-OZMXJZLQ.js → tool-sandbox-TLAL55QP.js} +5 -5
  201. package/bundle/tool-sandbox-TLAL55QP.js.map +7 -0
  202. package/bundle/{transport-config-G5NKQXPJ.js → transport-config-JIKHB7GT.js} +8 -8
  203. package/bundle/transport-config-JIKHB7GT.js.map +7 -0
  204. package/bundle/update-check-AJMIBQGQ.js +81 -0
  205. package/bundle/update-check-AJMIBQGQ.js.map +7 -0
  206. package/bundle/{user-registry-NUVNEHJU.js → user-registry-PEFDZ5AV.js} +5 -5
  207. package/bundle/user-registry-PEFDZ5AV.js.map +7 -0
  208. package/core/skills/tools/gmail/SKILL.md +5 -14
  209. package/core/skills/tools/rss/SKILL.md +51 -0
  210. package/install-manifest.json +8 -2
  211. package/package.json +4 -2
  212. package/scripts/abtars-daemon.service +3 -0
  213. package/scripts/abtars@.service +3 -0
  214. package/scripts/build-and-deploy.sh +68 -0
  215. package/scripts/doctor.sh +38 -0
  216. package/scripts/emergency-deploy.sh +95 -0
  217. package/scripts/watchdog.sh +51 -5
  218. package/bundle/chunk-4BUOO6WI.js.map +0 -7
  219. package/bundle/chunk-A5OJYQNU.js.map +0 -7
  220. package/bundle/chunk-JX3ZZU3O.js +0 -82
  221. package/bundle/chunk-JX3ZZU3O.js.map +0 -7
  222. package/bundle/chunk-KJOCXWJ5.js +0 -131
  223. package/bundle/chunk-KJOCXWJ5.js.map +0 -7
  224. package/bundle/chunk-KSEIWT4T.js.map +0 -7
  225. package/bundle/chunk-KWBGYWDO.js.map +0 -7
  226. package/bundle/chunk-MJ6PHMOK.js.map +0 -7
  227. package/bundle/chunk-P2BZSLJJ.js.map +0 -7
  228. package/bundle/chunk-R36WIOYX.js.map +0 -7
  229. package/bundle/chunk-RE3F3CFW.js +0 -300
  230. package/bundle/chunk-RE3F3CFW.js.map +0 -7
  231. package/bundle/chunk-RSWUPUNA.js.map +0 -7
  232. package/bundle/chunk-RV54J75Q.js.map +0 -7
  233. package/bundle/chunk-TYVI3ZWA.js.map +0 -7
  234. package/bundle/chunk-X5FBUA53.js.map +0 -7
  235. package/bundle/direct-api-transport-TRV45NO6.js.map +0 -7
  236. package/bundle/discord-adapter-WA2MFRK3.js.map +0 -7
  237. package/bundle/system-status-GLYXXDE3.js.map +0 -7
  238. package/bundle/telegram-adapter-BJJYXN7J.js.map +0 -7
  239. /package/bundle/{agent-api-rate-limit-C25WGSFF.js.map → agent-api-rate-limit-R2OFAQ3N.js.map} +0 -0
  240. /package/bundle/{agent-registry-SYUFNSVB.js.map → agent-registry-5VL5KI6U.js.map} +0 -0
  241. /package/bundle/{bridge-lock-transport-HO545SBK.js.map → agent-registry-PIS5XJHX.js.map} +0 -0
  242. /package/bundle/{browse-delivery-VTLEAVYA.js.map → bridge-lock-transport-N6OGDOSE.js.map} +0 -0
  243. /package/bundle/{browser-REIXOJ6S.js.map → browse-delivery-DXGMDMXA.js.map} +0 -0
  244. /package/bundle/{capability-ILW3D5HS.js.map → browser-QMYGSP5W.js.map} +0 -0
  245. /package/bundle/{commands-WUGPBPHI.js.map → capability-733TLH4W.js.map} +0 -0
  246. /package/bundle/{chunk-PZE3J7ER.js.map → chunk-3OXQWII3.js.map} +0 -0
  247. /package/bundle/{chunk-4KJ76TTE.js.map → chunk-4XW7YA3K.js.map} +0 -0
  248. /package/bundle/{chunk-ZVDVNSXK.js.map → chunk-7WFE2JI5.js.map} +0 -0
  249. /package/bundle/{chunk-Q62SXS73.js.map → chunk-BBDKU4EH.js.map} +0 -0
  250. /package/bundle/{chunk-EX2SRTUE.js.map → chunk-CYSGXNBY.js.map} +0 -0
  251. /package/bundle/{chunk-LYEAHE5V.js.map → chunk-DCY7DGMT.js.map} +0 -0
  252. /package/bundle/{chunk-G6IXMYIO.js.map → chunk-DO4INSXE.js.map} +0 -0
  253. /package/bundle/{chunk-VA5WKN3Z.js.map → chunk-EGA6JQVV.js.map} +0 -0
  254. /package/bundle/{chunk-URAQLQ2U.js.map → chunk-F3HMZFIL.js.map} +0 -0
  255. /package/bundle/{chunk-OOKLEC6V.js.map → chunk-FY3QUO2L.js.map} +0 -0
  256. /package/bundle/{chunk-2BY6I4P5.js.map → chunk-GUTRAMK3.js.map} +0 -0
  257. /package/bundle/{chunk-GPL57SRN.js.map → chunk-H7RX7UCR.js.map} +0 -0
  258. /package/bundle/{chunk-BYDUMHXT.js.map → chunk-HAF2AFBW.js.map} +0 -0
  259. /package/bundle/{chunk-KFENC7BM.js.map → chunk-L33WNMCP.js.map} +0 -0
  260. /package/bundle/{chunk-JRG4EFMP.js.map → chunk-LBMETTUP.js.map} +0 -0
  261. /package/bundle/{chunk-TOUZC6NR.js.map → chunk-OKMN6J4Z.js.map} +0 -0
  262. /package/bundle/{chunk-XZSYMCLF.js.map → chunk-PUDGA4RR.js.map} +0 -0
  263. /package/bundle/{chunk-CELR236Q.js.map → chunk-Q7CH5DA3.js.map} +0 -0
  264. /package/bundle/{chunk-UDZIZB5F.js.map → chunk-RTL7HO3N.js.map} +0 -0
  265. /package/bundle/{chunk-ITG6XGBS.js.map → chunk-SA44ITVX.js.map} +0 -0
  266. /package/bundle/{chunk-3MO2MDXJ.js.map → chunk-SA6YEFNG.js.map} +0 -0
  267. /package/bundle/{chunk-GBBTK6H2.js.map → chunk-SRFEIZQT.js.map} +0 -0
  268. /package/bundle/{chunk-ELRAH7VL.js.map → chunk-VXUVKC66.js.map} +0 -0
  269. /package/bundle/{config-DQIGDX4W.js.map → commands-IGRSOSK6.js.map} +0 -0
  270. /package/bundle/{delegation-tools-6FICZQ5G.js.map → commands-LAWVNQTO.js.map} +0 -0
  271. /package/bundle/{deploy-lib-import-SBKXDD3F.js.map → commands-RBWY7YXB.js.map} +0 -0
  272. /package/bundle/{env-schema-XCPAJ6IZ.js.map → commands-XFZNMZN6.js.map} +0 -0
  273. /package/bundle/{hook-system-POI5VRIX.js.map → config-NDEYF4AQ.js.map} +0 -0
  274. /package/bundle/{daemon-NPKYZ3CJ.js.map → daemon-WOQXCKNL.js.map} +0 -0
  275. /package/bundle/{hotskills-6ECHLXTJ.js.map → delegation-tools-Z5OM3TXS.js.map} +0 -0
  276. /package/bundle/{install-SH4UVUXQ.js.map → deploy-lib-import-6VJTYXEG.js.map} +0 -0
  277. /package/bundle/{deps-HN6CEXA4.js.map → deps-65V7XXG4.js.map} +0 -0
  278. /package/bundle/{dns-wakeup-RYOCQ6GR.js.map → dns-wakeup-N46RPU5E.js.map} +0 -0
  279. /package/bundle/{ensure-invariants-BJIEOSJ2.js.map → ensure-invariants-3NOBCYWS.js.map} +0 -0
  280. /package/bundle/{lazy-require-UFYFFX2R.js.map → env-schema-T43X43BU.js.map} +0 -0
  281. /package/bundle/{message-pipeline-2MBT44FO.js.map → hook-system-ZCVOFFRD.js.map} +0 -0
  282. /package/bundle/{notification-U6F5ZBSG.js.map → hotskills-DTROJY6G.js.map} +0 -0
  283. /package/bundle/{paths-ZJYIDND2.js.map → install-I3CXVW52.js.map} +0 -0
  284. /package/bundle/{install-manifest-QRWID3KZ.js.map → install-manifest-KBYD7SAY.js.map} +0 -0
  285. /package/bundle/{irc-adapter-AIEP6OX6.js.map → irc-adapter-HXO5D4SW.js.map} +0 -0
  286. /package/bundle/{irc-config-6VY67UPQ.js.map → irc-config-XN5VW2V4.js.map} +0 -0
  287. /package/bundle/{peer-config-D5A4454H.js.map → kanban-board-6Q5E5GEB.js.map} +0 -0
  288. /package/bundle/{phase-transport-FEZ4SIJJ.js.map → kanban-board-I52RHNHQ.js.map} +0 -0
  289. /package/bundle/{skill-stats-IPVKMWN3.js.map → lazy-require-R3JYCV5M.js.map} +0 -0
  290. /package/bundle/{media-utils-MOE36VWY.js.map → media-utils-W7XW3SVV.js.map} +0 -0
  291. /package/bundle/{sleep-BPWX3FCN.js.map → message-pipeline-4CTBJ6K2.js.map} +0 -0
  292. /package/bundle/{soul-bundle-BRIUDEQ2.js.map → message-pipeline-4KL7OWUH.js.map} +0 -0
  293. /package/bundle/{soul-loader-GBXJ7EBH.js.map → message-pipeline-GFKSHRFU.js.map} +0 -0
  294. /package/bundle/{stt-CF3CPFDC.js.map → message-pipeline-TGI2WJJM.js.map} +0 -0
  295. /package/bundle/{subagent-runtime-4MTYUBIZ.js.map → notification-ULESRDHB.js.map} +0 -0
  296. /package/bundle/{openrouter-credits-7XXO6QGQ.js.map → openrouter-credits-PLIKRY5D.js.map} +0 -0
  297. /package/bundle/{task-store-LC7ZMS72.js.map → paths-QQM74XYT.js.map} +0 -0
  298. /package/bundle/{peer-client-T44VI7NB.js.map → peer-client-D2F5QWRV.js.map} +0 -0
  299. /package/bundle/{tool-registry-T7XLTI2Q.js.map → peer-config-5SUIBJLG.js.map} +0 -0
  300. /package/bundle/{tool-sandbox-OZMXJZLQ.js.map → phase-transport-INFD6ELA.js.map} +0 -0
  301. /package/bundle/{transport-config-G5NKQXPJ.js.map → phase-transport-KXFZ5BVF.js.map} +0 -0
  302. /package/bundle/{update-check-O5MS6B3L.js.map → rollback-5RXXLUD6.js.map} +0 -0
  303. /package/bundle/{self-healer-utils-7NFH22VJ.js.map → self-healer-utils-WPKOVXJD.js.map} +0 -0
  304. /package/bundle/{user-registry-NUVNEHJU.js.map → skill-stats-NHNH47QW.js.map} +0 -0
  305. /package/bundle/{sse-parser-anthropic-H42TTLBD.js.map → sse-parser-anthropic-PYDJM3UC.js.map} +0 -0
  306. /package/bundle/{sse-parser-responses-WG2LY2ML.js.map → sse-parser-responses-FYT7A5WT.js.map} +0 -0
  307. /package/bundle/{ssrf-guard-E2KBBC5E.js.map → ssrf-guard-R4P5OCTO.js.map} +0 -0
  308. /package/bundle/{start-CBVKNEAT.js.map → start-4DNURGIY.js.map} +0 -0
  309. /package/bundle/{system-message-TALP6GP2.js.map → system-message-BRU267FW.js.map} +0 -0
@@ -0,0 +1,330 @@
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
+ init_log_and_swallow,
5
+ logAndSwallow
6
+ } from "./chunk-CYSGXNBY.js";
7
+ import {
8
+ init_logger,
9
+ logInfo,
10
+ logWarn
11
+ } from "./chunk-GUTRAMK3.js";
12
+ import {
13
+ abtarsHome,
14
+ init_paths
15
+ } from "./chunk-WW5F2DCO.js";
16
+ import {
17
+ __esm,
18
+ __export,
19
+ __require
20
+ } from "./chunk-7K2YZTLD.js";
21
+
22
+ // src/components/skill-watcher.ts
23
+ import { readdirSync, readFileSync, writeFileSync, existsSync } from "node:fs";
24
+ import { join, basename, dirname, resolve } from "node:path";
25
+ import { execFileSync } from "node:child_process";
26
+ import { homedir } from "node:os";
27
+ function parseYamlValue(raw) {
28
+ if (raw.startsWith("[") && raw.endsWith("]")) {
29
+ return raw.slice(1, -1).split(",").map((s) => s.trim().replace(/^["']|["']$/g, "")).filter(Boolean);
30
+ }
31
+ return raw;
32
+ }
33
+ function toStringArray(val) {
34
+ if (Array.isArray(val)) return val.map(String);
35
+ if (typeof val === "string") return [val];
36
+ return [];
37
+ }
38
+ var TAG, SkillWatcher;
39
+ var init_skill_watcher = __esm({
40
+ "src/components/skill-watcher.ts"() {
41
+ "use strict";
42
+ init_log_and_swallow();
43
+ init_logger();
44
+ TAG = "skill-reloader";
45
+ SkillWatcher = class {
46
+ constructor(skillsDir, catalogPath) {
47
+ this.skillsDir = skillsDir;
48
+ this.catalogPath = catalogPath;
49
+ }
50
+ /** Per-instance cache of `which <bin>` results. Avoids repeated execFileSync on heartbeat ticks (#369). */
51
+ binaryCache = /* @__PURE__ */ new Map();
52
+ /** Cached skill list from last generateCatalog() call. */
53
+ _skillCache = [];
54
+ /** Get cached skill info (populated after generateCatalog). */
55
+ get skills() {
56
+ return this._skillCache;
57
+ }
58
+ /** Generate skills_catalog.md from all skill files. Called on startup + when skills change. */
59
+ generateCatalog() {
60
+ const files = this.scanMdFiles(this.skillsDir);
61
+ const entries = [];
62
+ const skipped = [];
63
+ const cache = [];
64
+ const skillsCfg = this.loadSkillsConfig();
65
+ for (const filepath of files) {
66
+ const header = this.parseSkillHeader(filepath);
67
+ if (!header.name) continue;
68
+ if (header.primaryEnv && !process.env[header.primaryEnv]) {
69
+ const entry2 = skillsCfg.entries?.[header.name];
70
+ if (entry2?.apiKey) process.env[header.primaryEnv] = entry2.apiKey;
71
+ }
72
+ const entry = skillsCfg.entries?.[header.name];
73
+ if (entry?.env) {
74
+ for (const [k, v] of Object.entries(entry.env)) {
75
+ if (!process.env[k]) process.env[k] = v;
76
+ }
77
+ }
78
+ const group = this.getSourceDir(filepath).split("/")[0] ?? "core";
79
+ if (header.requires) {
80
+ const { eligible, missing } = this.checkEligibility(header.requires);
81
+ if (!eligible) {
82
+ skipped.push(`${header.name} (missing: ${missing.join(", ")})`);
83
+ cache.push({ name: header.name, group, skipped: missing.join(", ") });
84
+ continue;
85
+ }
86
+ }
87
+ cache.push({ name: header.name, group });
88
+ entries.push(`- [${this.getSourceDir(filepath)}] ${header.name}: ${header.description}`);
89
+ }
90
+ const guidance = [
91
+ "",
92
+ "## Skill maintenance",
93
+ "- If you solved something non-trivial (multi-step, error-prone, or likely to recur), save it as a skill with skill_create.",
94
+ "- If a skill you just used was wrong or incomplete, fix it with skill_patch before moving on.",
95
+ ""
96
+ ].join("\n");
97
+ const content = `# Skills Catalog
98
+
99
+ When a user request matches a skill below, read its SKILL.md at ~/.abtars/skills/<dir>/SKILL.md for detailed instructions before acting.
100
+
101
+ ${entries.join("\n")}
102
+ ${guidance}`;
103
+ try {
104
+ writeFileSync(this.catalogPath, content, "utf-8");
105
+ const skippedStr = skipped.length > 0 ? `, ${skipped.length} skipped \u2014 ${skipped.join(", ")}` : "";
106
+ logInfo(TAG, `Generated skills_catalog.md (${entries.length} skills${skippedStr})`);
107
+ } catch (err) {
108
+ logWarn(TAG, `Failed to write skills_catalog.md: ${err instanceof Error ? err.message : String(err)}`);
109
+ }
110
+ this._skillCache = cache;
111
+ return entries.length;
112
+ }
113
+ /** Check all requirements. Returns eligible=true only if ALL pass. */
114
+ checkEligibility(requires) {
115
+ const missing = [];
116
+ for (const bin of requires.bins ?? []) {
117
+ if (!this.binaryAvailable(bin)) missing.push(`bin:${bin}`);
118
+ }
119
+ for (const pkg of requires.npm ?? []) {
120
+ if (!this.npmAvailable(pkg)) missing.push(`npm:${pkg}`);
121
+ }
122
+ for (const key of requires.env ?? []) {
123
+ if (!process.env[key]) missing.push(`env:${key}`);
124
+ }
125
+ for (const file of requires.files ?? []) {
126
+ const resolved = resolve(file.replace(/^~/, homedir()));
127
+ if (!existsSync(resolved)) missing.push(`file:${file}`);
128
+ }
129
+ return { eligible: missing.length === 0, missing };
130
+ }
131
+ /** Check if an npm package is resolvable from the abtars node_modules. */
132
+ npmAvailable(pkg) {
133
+ try {
134
+ __require.resolve(pkg);
135
+ return true;
136
+ } catch (err) {
137
+ logAndSwallow(TAG, `require.resolve ${pkg}`, err);
138
+ return false;
139
+ }
140
+ }
141
+ /** Check if a binary is on PATH. Cached per-instance so hot-reload ticks don't respawn `which`. */
142
+ binaryAvailable(bin) {
143
+ if (!this.binaryCache.has(bin)) {
144
+ try {
145
+ execFileSync("which", [bin], { timeout: 1e3, stdio: "pipe" });
146
+ this.binaryCache.set(bin, true);
147
+ } catch (err) {
148
+ logAndSwallow(TAG, `which ${bin}`, err);
149
+ this.binaryCache.set(bin, false);
150
+ }
151
+ }
152
+ return this.binaryCache.get(bin);
153
+ }
154
+ getSourceDir(filepath) {
155
+ const rel = filepath.slice(this.skillsDir.length + 1);
156
+ const first = rel.split("/")[0] ?? "core";
157
+ if (["core", "custom", "downloaded", "self"].includes(first)) return first;
158
+ return "core";
159
+ }
160
+ scanMdFiles(dir) {
161
+ const results = [];
162
+ try {
163
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
164
+ const full = join(dir, entry.name);
165
+ if (entry.isDirectory()) results.push(...this.scanMdFiles(full));
166
+ else if (entry.name === "SKILL.md") results.push(full);
167
+ }
168
+ } catch (err) {
169
+ logAndSwallow("skill_watcher", "op", err);
170
+ }
171
+ return results;
172
+ }
173
+ /**
174
+ * Parse a skill file's header.
175
+ *
176
+ * Preferred: YAML-style frontmatter block at the top of the file:
177
+ * ---
178
+ * name: mcporter
179
+ * description: Call external MCP servers via the mcporter CLI.
180
+ * requires: mcporter
181
+ * ---
182
+ *
183
+ * Supports only single-line `key: value` pairs. No arrays, no nested
184
+ * objects, no multi-line strings, no comments. Values are trimmed.
185
+ *
186
+ * Fallback (no frontmatter): first `#` heading → name, first non-heading
187
+ * line > 10 chars → description. Preserves pre-#369 behavior for any
188
+ * skills that don't yet have frontmatter.
189
+ */
190
+ parseSkillHeader(filepath) {
191
+ try {
192
+ const content = readFileSync(filepath, "utf-8");
193
+ const fm = this.parseFrontmatter(content);
194
+ if (fm) {
195
+ return {
196
+ name: String(fm["name"] ?? "") || basename(dirname(filepath)),
197
+ description: String(fm["description"] ?? "").slice(0, 120),
198
+ ...fm["requires"] ? { requires: this.parseRequires(fm["requires"]) } : {},
199
+ ...fm["primaryEnv"] ? { primaryEnv: String(fm["primaryEnv"]) } : {}
200
+ };
201
+ }
202
+ const lines = content.split("\n").filter((l) => l.trim());
203
+ const heading = lines.find((l) => l.startsWith("#"));
204
+ const name = heading?.replace(/^#+\s*/, "").trim() ?? basename(dirname(filepath));
205
+ const desc = lines.find((l) => !l.startsWith("#") && l.trim().length > 10)?.trim() ?? "";
206
+ return { name, description: desc.slice(0, 120) };
207
+ } catch (err) {
208
+ logAndSwallow(TAG, "parseSkillMeta", err);
209
+ return { name: basename(dirname(filepath)), description: "" };
210
+ }
211
+ }
212
+ /** Load ~/.abtars/config/skills.json (per-skill secrets). */
213
+ loadSkillsConfig() {
214
+ try {
215
+ const p = join(homedir(), ".abtars", "config", "skills.json");
216
+ if (!existsSync(p)) return {};
217
+ return JSON.parse(readFileSync(p, "utf-8"));
218
+ } catch (err) {
219
+ logAndSwallow("skill_watcher", "op", err);
220
+ return {};
221
+ }
222
+ }
223
+ /** Parse requires field: string → { bins: [str] }, object → SkillRequires. */
224
+ parseRequires(raw) {
225
+ if (typeof raw === "string") return { bins: [raw] };
226
+ if (typeof raw === "object" && raw !== null) {
227
+ const obj = raw;
228
+ return {
229
+ ...obj["bins"] ? { bins: toStringArray(obj["bins"]) } : {},
230
+ ...obj["npm"] ? { npm: toStringArray(obj["npm"]) } : {},
231
+ ...obj["env"] ? { env: toStringArray(obj["env"]) } : {},
232
+ ...obj["files"] ? { files: toStringArray(obj["files"]) } : {}
233
+ };
234
+ }
235
+ return {};
236
+ }
237
+ /**
238
+ * Extract frontmatter key/value pairs. Returns null if the file doesn't
239
+ * start with a `---` fence.
240
+ *
241
+ * Supports: flat `key: value`, inline arrays `key: [a, b]`, and one level
242
+ * of nesting via indented keys under a parent.
243
+ */
244
+ parseFrontmatter(content) {
245
+ const lines = content.split("\n");
246
+ let i = 0;
247
+ while (i < lines.length && lines[i].trim() === "") i++;
248
+ if (i >= lines.length || lines[i].trim() !== "---") return null;
249
+ const start = i + 1;
250
+ let end = -1;
251
+ for (let j = start; j < lines.length; j++) {
252
+ if (lines[j].trim() === "---") {
253
+ end = j;
254
+ break;
255
+ }
256
+ }
257
+ if (end === -1) return null;
258
+ const result = {};
259
+ let currentParent = null;
260
+ let currentObj = {};
261
+ for (let j = start; j < end; j++) {
262
+ const line = lines[j];
263
+ if (line.trim() === "") continue;
264
+ const indent = line.length - line.trimStart().length;
265
+ const colonIdx = line.indexOf(":");
266
+ if (colonIdx < 1) continue;
267
+ const key = line.slice(0, colonIdx).trim().toLowerCase();
268
+ const rawValue = line.slice(colonIdx + 1).trim();
269
+ if (indent > 0 && currentParent) {
270
+ currentObj[key] = parseYamlValue(rawValue);
271
+ } else {
272
+ if (currentParent) {
273
+ result[currentParent] = currentObj;
274
+ currentParent = null;
275
+ currentObj = {};
276
+ }
277
+ if (rawValue === "" || rawValue === "|" || rawValue === ">") {
278
+ currentParent = key;
279
+ currentObj = {};
280
+ } else {
281
+ result[key] = parseYamlValue(rawValue);
282
+ }
283
+ }
284
+ }
285
+ if (currentParent) result[currentParent] = currentObj;
286
+ return result;
287
+ }
288
+ };
289
+ }
290
+ });
291
+
292
+ // src/capabilities/hotskills/index.ts
293
+ var hotskills_exports = {};
294
+ __export(hotskills_exports, {
295
+ getSkillCache: () => getSkillCache,
296
+ register: () => register
297
+ });
298
+ import { join as join2 } from "node:path";
299
+ function getSkillCache() {
300
+ return _instance?.skills ?? [];
301
+ }
302
+ function register(api) {
303
+ const skillWatcher = new SkillWatcher(
304
+ join2(abtarsHome(), "skills"),
305
+ join2(abtarsHome(), "core", "skills_catalog.md")
306
+ );
307
+ _instance = skillWatcher;
308
+ skillWatcher.generateCatalog();
309
+ api.registerCommand("skill", async (_text, ctx) => {
310
+ const count = skillWatcher.generateCatalog();
311
+ await ctx.reply(`Reloaded \u2014 ${count} skills available.`);
312
+ return true;
313
+ });
314
+ }
315
+ var _instance;
316
+ var init_hotskills = __esm({
317
+ "src/capabilities/hotskills/index.ts"() {
318
+ init_skill_watcher();
319
+ init_paths();
320
+ _instance = null;
321
+ }
322
+ });
323
+
324
+ export {
325
+ getSkillCache,
326
+ register,
327
+ hotskills_exports,
328
+ init_hotskills
329
+ };
330
+ //# sourceMappingURL=chunk-NIYVCGBC.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/components/skill-watcher.ts", "../src/capabilities/hotskills/index.ts"],
4
+ "sourcesContent": ["/**\n * SkillWatcher \u2014 generates skills_catalog.md on startup and on-demand via /skill reload.\n *\n * #369 \u2014 Parses YAML-style frontmatter to extract name/description/requires.\n * #412 \u2014 Structured requires: bins/npm/env/files.\n * Skills declare their own deps; loader checks eligibility at boot.\n */\n\nimport { logAndSwallow } from \"./log-and-swallow.js\";\nimport { readdirSync, readFileSync, writeFileSync, existsSync } from \"node:fs\";\nimport { join, basename, dirname, resolve } from \"node:path\";\nimport { execFileSync } from \"node:child_process\";\nimport { homedir } from \"node:os\";\nimport { logInfo, logWarn } from \"./logger.js\";\n\nimport type { ISkillSlot } from \"./skeleton.js\";\n\nconst TAG = \"skill-reloader\";\n\n/** Structured skill requirements (#412). */\ninterface SkillRequires {\n bins?: string[];\n npm?: string[];\n env?: string[];\n files?: string[];\n}\n\ninterface SkillHeader {\n name: string;\n description: string;\n requires?: SkillRequires;\n primaryEnv?: string;\n}\n\n/** Per-skill config from ~/.abtars/config/skills.json */\ninterface SkillsConfig {\n entries?: Record<string, { apiKey?: string; env?: Record<string, string> }>;\n}\n\nexport interface SkillInfo { name: string; group: string; skipped?: string }\n\nexport class SkillWatcher implements ISkillSlot {\n /** Per-instance cache of `which <bin>` results. Avoids repeated execFileSync on heartbeat ticks (#369). */\n private binaryCache = new Map<string, boolean>();\n /** Cached skill list from last generateCatalog() call. */\n private _skillCache: SkillInfo[] = [];\n\n constructor(private skillsDir: string, private catalogPath: string) {}\n\n /** Get cached skill info (populated after generateCatalog). */\n get skills(): readonly SkillInfo[] { return this._skillCache; }\n\n /** Generate skills_catalog.md from all skill files. Called on startup + when skills change. */\n generateCatalog(): number {\n const files = this.scanMdFiles(this.skillsDir);\n const entries: string[] = [];\n const skipped: string[] = [];\n const cache: SkillInfo[] = [];\n const skillsCfg = this.loadSkillsConfig();\n for (const filepath of files) {\n const header = this.parseSkillHeader(filepath);\n if (!header.name) continue;\n // Inject per-skill env from skills.json before eligibility check\n if (header.primaryEnv && !process.env[header.primaryEnv]) {\n const entry = skillsCfg.entries?.[header.name];\n if (entry?.apiKey) process.env[header.primaryEnv] = entry.apiKey;\n }\n const entry = skillsCfg.entries?.[header.name];\n if (entry?.env) {\n for (const [k, v] of Object.entries(entry.env)) {\n if (!process.env[k]) process.env[k] = v;\n }\n }\n const group = this.getSourceDir(filepath).split(\"/\")[0] ?? \"core\";\n if (header.requires) {\n const { eligible, missing } = this.checkEligibility(header.requires);\n if (!eligible) {\n skipped.push(`${header.name} (missing: ${missing.join(\", \")})`);\n cache.push({ name: header.name, group, skipped: missing.join(\", \") });\n continue;\n }\n }\n cache.push({ name: header.name, group });\n entries.push(`- [${this.getSourceDir(filepath)}] ${header.name}: ${header.description}`);\n }\n const guidance = [\n \"\",\n \"## Skill maintenance\",\n \"- If you solved something non-trivial (multi-step, error-prone, or likely to recur), save it as a skill with skill_create.\",\n \"- If a skill you just used was wrong or incomplete, fix it with skill_patch before moving on.\",\n \"\",\n ].join(\"\\n\");\n const content = `# Skills Catalog\\n\\nWhen a user request matches a skill below, read its SKILL.md at ~/.abtars/skills/<dir>/SKILL.md for detailed instructions before acting.\\n\\n${entries.join(\"\\n\")}\\n${guidance}`;\n try {\n writeFileSync(this.catalogPath, content, \"utf-8\");\n const skippedStr = skipped.length > 0 ? `, ${skipped.length} skipped \u2014 ${skipped.join(\", \")}` : \"\";\n logInfo(TAG, `Generated skills_catalog.md (${entries.length} skills${skippedStr})`);\n } catch (err) {\n logWarn(TAG, `Failed to write skills_catalog.md: ${err instanceof Error ? err.message : String(err)}`);\n }\n this._skillCache = cache;\n return entries.length;\n }\n\n /** Check all requirements. Returns eligible=true only if ALL pass. */\n private checkEligibility(requires: SkillRequires): { eligible: boolean; missing: string[] } {\n const missing: string[] = [];\n for (const bin of requires.bins ?? []) {\n if (!this.binaryAvailable(bin)) missing.push(`bin:${bin}`);\n }\n for (const pkg of requires.npm ?? []) {\n if (!this.npmAvailable(pkg)) missing.push(`npm:${pkg}`);\n }\n for (const key of requires.env ?? []) {\n if (!process.env[key]) missing.push(`env:${key}`);\n }\n for (const file of requires.files ?? []) {\n const resolved = resolve(file.replace(/^~/, homedir()));\n if (!existsSync(resolved)) missing.push(`file:${file}`);\n }\n return { eligible: missing.length === 0, missing };\n }\n\n /** Check if an npm package is resolvable from the abtars node_modules. */\n private npmAvailable(pkg: string): boolean {\n try {\n require.resolve(pkg);\n return true;\n } catch (err) {\n logAndSwallow(TAG, `require.resolve ${pkg}`, err);\n return false;\n }\n }\n\n /** Check if a binary is on PATH. Cached per-instance so hot-reload ticks don't respawn `which`. */\n private binaryAvailable(bin: string): boolean {\n if (!this.binaryCache.has(bin)) {\n try {\n // execFileSync (not execSync) \u2014 no shell interpolation on untrusted `requires:` values.\n execFileSync(\"which\", [bin], { timeout: 1000, stdio: \"pipe\" });\n this.binaryCache.set(bin, true);\n } catch (err) {\n logAndSwallow(TAG, `which ${bin}`, err);\n this.binaryCache.set(bin, false);\n }\n }\n return this.binaryCache.get(bin)!;\n }\n\n private getSourceDir(filepath: string): string {\n const rel = filepath.slice(this.skillsDir.length + 1);\n const first = rel.split(\"/\")[0] ?? \"core\";\n if ([\"core\", \"custom\", \"downloaded\", \"self\"].includes(first)) return first;\n return \"core\";\n }\n\n private scanMdFiles(dir: string): string[] {\n const results: string[] = [];\n try {\n for (const entry of readdirSync(dir, { withFileTypes: true })) {\n const full = join(dir, entry.name);\n if (entry.isDirectory()) results.push(...this.scanMdFiles(full));\n else if (entry.name === \"SKILL.md\") results.push(full);\n }\n } catch (err) { logAndSwallow(\"skill_watcher\", \"op\", err); }\n return results;\n }\n\n /**\n * Parse a skill file's header.\n *\n * Preferred: YAML-style frontmatter block at the top of the file:\n * ---\n * name: mcporter\n * description: Call external MCP servers via the mcporter CLI.\n * requires: mcporter\n * ---\n *\n * Supports only single-line `key: value` pairs. No arrays, no nested\n * objects, no multi-line strings, no comments. Values are trimmed.\n *\n * Fallback (no frontmatter): first `#` heading \u2192 name, first non-heading\n * line > 10 chars \u2192 description. Preserves pre-#369 behavior for any\n * skills that don't yet have frontmatter.\n */\n private parseSkillHeader(filepath: string): SkillHeader {\n try {\n const content = readFileSync(filepath, \"utf-8\");\n const fm = this.parseFrontmatter(content);\n if (fm) {\n return {\n name: String(fm[\"name\"] ?? \"\") || basename(dirname(filepath)),\n description: String(fm[\"description\"] ?? \"\").slice(0, 120),\n ...(fm[\"requires\"] ? { requires: this.parseRequires(fm[\"requires\"]) } : {}),\n ...(fm[\"primaryEnv\"] ? { primaryEnv: String(fm[\"primaryEnv\"]) } : {}),\n };\n }\n\n // Fallback for skill files without frontmatter\n const lines = content.split(\"\\n\").filter(l => l.trim());\n const heading = lines.find(l => l.startsWith(\"#\"));\n const name = heading?.replace(/^#+\\s*/, \"\").trim() ?? basename(dirname(filepath));\n const desc = lines.find(l => !l.startsWith(\"#\") && l.trim().length > 10)?.trim() ?? \"\";\n return { name, description: desc.slice(0, 120) };\n } catch (err) {\n logAndSwallow(TAG, \"parseSkillMeta\", err);\n return { name: basename(dirname(filepath)), description: \"\" };\n }\n }\n\n /** Load ~/.abtars/config/skills.json (per-skill secrets). */\n private loadSkillsConfig(): SkillsConfig {\n try {\n const p = join(homedir(), \".abtars\", \"config\", \"skills.json\");\n if (!existsSync(p)) return {};\n return JSON.parse(readFileSync(p, \"utf-8\")) as SkillsConfig;\n } catch (err) {\n logAndSwallow(\"skill_watcher\", \"op\", err);\n return {};\n }\n }\n\n /** Parse requires field: string \u2192 { bins: [str] }, object \u2192 SkillRequires. */\n private parseRequires(raw: unknown): SkillRequires {\n if (typeof raw === \"string\") return { bins: [raw] };\n if (typeof raw === \"object\" && raw !== null) {\n const obj = raw as Record<string, unknown>;\n return {\n ...(obj[\"bins\"] ? { bins: toStringArray(obj[\"bins\"]) } : {}),\n ...(obj[\"npm\"] ? { npm: toStringArray(obj[\"npm\"]) } : {}),\n ...(obj[\"env\"] ? { env: toStringArray(obj[\"env\"]) } : {}),\n ...(obj[\"files\"] ? { files: toStringArray(obj[\"files\"]) } : {}),\n };\n }\n return {};\n }\n\n /**\n * Extract frontmatter key/value pairs. Returns null if the file doesn't\n * start with a `---` fence.\n *\n * Supports: flat `key: value`, inline arrays `key: [a, b]`, and one level\n * of nesting via indented keys under a parent.\n */\n private parseFrontmatter(content: string): Record<string, unknown> | null {\n const lines = content.split(\"\\n\");\n let i = 0;\n while (i < lines.length && lines[i]!.trim() === \"\") i++;\n if (i >= lines.length || lines[i]!.trim() !== \"---\") return null;\n\n const start = i + 1;\n let end = -1;\n for (let j = start; j < lines.length; j++) {\n if (lines[j]!.trim() === \"---\") { end = j; break; }\n }\n if (end === -1) return null;\n\n const result: Record<string, unknown> = {};\n let currentParent: string | null = null;\n let currentObj: Record<string, unknown> = {};\n\n for (let j = start; j < end; j++) {\n const line = lines[j]!;\n if (line.trim() === \"\") continue;\n\n const indent = line.length - line.trimStart().length;\n const colonIdx = line.indexOf(\":\");\n if (colonIdx < 1) continue;\n\n const key = line.slice(0, colonIdx).trim().toLowerCase();\n const rawValue = line.slice(colonIdx + 1).trim();\n\n if (indent > 0 && currentParent) {\n // Nested key under parent\n currentObj[key] = parseYamlValue(rawValue);\n } else {\n // Top-level key\n if (currentParent) {\n result[currentParent] = currentObj;\n currentParent = null;\n currentObj = {};\n }\n if (rawValue === \"\" || rawValue === \"|\" || rawValue === \">\") {\n // Start of nested object\n currentParent = key;\n currentObj = {};\n } else {\n result[key] = parseYamlValue(rawValue);\n }\n }\n }\n if (currentParent) result[currentParent] = currentObj;\n\n return result;\n }\n}\n\n/** Parse a YAML value: inline array [a, b] \u2192 string[], otherwise string. */\nfunction parseYamlValue(raw: string): unknown {\n if (raw.startsWith(\"[\") && raw.endsWith(\"]\")) {\n return raw.slice(1, -1).split(\",\").map(s => s.trim().replace(/^[\"']|[\"']$/g, \"\")).filter(Boolean);\n }\n return raw;\n}\n\n/** Coerce unknown to string[]. */\nfunction toStringArray(val: unknown): string[] {\n if (Array.isArray(val)) return val.map(String);\n if (typeof val === \"string\") return [val];\n return [];\n}\n", "/**\n * Skills capability \u2014 on-demand skill catalog reload via /skill command.\n */\n\nimport { join } from \"node:path\";\nimport { SkillWatcher, type SkillInfo } from \"../../components/skill-watcher.js\";\nimport { abtarsHome } from \"../../paths.js\";\nimport type { CapabilityApi } from \"../capability.js\";\n\nlet _instance: SkillWatcher | null = null;\n\n/** Get cached skill info from the last catalog generation. */\nexport function getSkillCache(): readonly SkillInfo[] { return _instance?.skills ?? []; }\n\nexport function register(api: CapabilityApi): void {\n const skillWatcher = new SkillWatcher(\n join(abtarsHome(), \"skills\"),\n join(abtarsHome(), \"core\", \"skills_catalog.md\"),\n );\n _instance = skillWatcher;\n\n // Generate catalog on startup\n skillWatcher.generateCatalog();\n\n api.registerCommand(\"skill\", async (_text, ctx) => {\n const count = skillWatcher.generateCatalog();\n await ctx.reply(`Reloaded \u2014 ${count} skills available.`);\n return true;\n });\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;AASA,SAAS,aAAa,cAAc,eAAe,kBAAkB;AACrE,SAAS,MAAM,UAAU,SAAS,eAAe;AACjD,SAAS,oBAAoB;AAC7B,SAAS,eAAe;AA8RxB,SAAS,eAAe,KAAsB;AAC5C,MAAI,IAAI,WAAW,GAAG,KAAK,IAAI,SAAS,GAAG,GAAG;AAC5C,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,qBAAO,aAAa,IAAI;AACxB,8BAAgB;AAChB,2BAAa,CAAC;AAAA,YAChB;AACA,gBAAI,aAAa,MAAM,aAAa,OAAO,aAAa,KAAK;AAE3D,8BAAgB;AAChB,2BAAa,CAAC;AAAA,YAChB,OAAO;AACL,qBAAO,GAAG,IAAI,eAAe,QAAQ;AAAA,YACvC;AAAA,UACF;AAAA,QACF;AACA,YAAI,cAAe,QAAO,aAAa,IAAI;AAE3C,eAAO;AAAA,MACT;AAAA,IACF;AAAA;AAAA;;;ACvSA;AAAA;AAAA;AAAA;AAAA;AAIA,SAAS,QAAAC,aAAY;AAQd,SAAS,gBAAsC;AAAE,SAAO,WAAW,UAAU,CAAC;AAAG;AAEjF,SAAS,SAAS,KAA0B;AACjD,QAAM,eAAe,IAAI;AAAA,IACvBA,MAAK,WAAW,GAAG,QAAQ;AAAA,IAC3BA,MAAK,WAAW,GAAG,QAAQ,mBAAmB;AAAA,EAChD;AACA,cAAY;AAGZ,eAAa,gBAAgB;AAE7B,MAAI,gBAAgB,SAAS,OAAO,OAAO,QAAQ;AACjD,UAAM,QAAQ,aAAa,gBAAgB;AAC3C,UAAM,IAAI,MAAM,mBAAc,KAAK,oBAAoB;AACvD,WAAO;AAAA,EACT,CAAC;AACH;AA7BA,IASI;AATJ;AAAA;AAKA;AACA;AAGA,IAAI,YAAiC;AAAA;AAAA;",
6
+ "names": ["entry", "join"]
7
+ }
@@ -6,12 +6,12 @@ import {
6
6
  import {
7
7
  getEnv,
8
8
  init_env_schema
9
- } from "./chunk-PZE3J7ER.js";
9
+ } from "./chunk-3OXQWII3.js";
10
10
  import {
11
11
  init_logger,
12
12
  logInfo,
13
13
  logWarn
14
- } from "./chunk-2BY6I4P5.js";
14
+ } from "./chunk-GUTRAMK3.js";
15
15
 
16
16
  // src/components/transport/delegation-tools.ts
17
17
  init_logger();
@@ -212,4 +212,4 @@ export {
212
212
  consumePendingInstruction,
213
213
  getDelegationTools
214
214
  };
215
- //# sourceMappingURL=chunk-TOUZC6NR.js.map
215
+ //# sourceMappingURL=chunk-OKMN6J4Z.js.map
@@ -2,22 +2,22 @@
2
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
3
  import {
4
4
  writeRestartReason
5
- } from "./chunk-UDZIZB5F.js";
6
- import {
7
- init_log_and_swallow,
8
- logAndSwallow
9
- } from "./chunk-EX2SRTUE.js";
5
+ } from "./chunk-RTL7HO3N.js";
10
6
  import {
11
7
  getEnv,
12
8
  init_env_schema
13
- } from "./chunk-PZE3J7ER.js";
9
+ } from "./chunk-3OXQWII3.js";
10
+ import {
11
+ init_log_and_swallow,
12
+ logAndSwallow
13
+ } from "./chunk-CYSGXNBY.js";
14
14
  import {
15
15
  init_logger,
16
16
  logDebug,
17
17
  logError,
18
18
  logInfo,
19
19
  logWarn
20
- } from "./chunk-2BY6I4P5.js";
20
+ } from "./chunk-GUTRAMK3.js";
21
21
  import {
22
22
  __export
23
23
  } from "./chunk-7K2YZTLD.js";
@@ -15289,7 +15289,7 @@ var TransportStateError = class extends Error {
15289
15289
  var VALID_TRANSITIONS = {
15290
15290
  idle: ["prompting", "reinitializing", "destroyed"],
15291
15291
  prompting: ["idle", "tool-active", "reinitializing", "destroyed"],
15292
- "tool-active": ["prompting", "reinitializing", "destroyed"],
15292
+ "tool-active": ["prompting", "idle", "reinitializing", "destroyed"],
15293
15293
  reinitializing: ["idle", "stalled", "destroyed"],
15294
15294
  stalled: ["idle", "destroyed"],
15295
15295
  // only manual /restart recovers
@@ -15610,7 +15610,7 @@ var AcpTransport = class {
15610
15610
  return chunks.join("") || "(no response)";
15611
15611
  } finally {
15612
15612
  const durationMs = Date.now() - this.promptStartedAt;
15613
- import("./hook-system-POI5VRIX.js").then(({ hasHooks, fire }) => {
15613
+ import("./hook-system-ZCVOFFRD.js").then(({ hasHooks, fire }) => {
15614
15614
  if (!hasHooks("AfterPrompt")) return;
15615
15615
  fire("AfterPrompt", {
15616
15616
  event: "AfterPrompt",
@@ -15701,7 +15701,7 @@ var AcpTransport = class {
15701
15701
  }
15702
15702
  async resetSession(_sessionKey) {
15703
15703
  try {
15704
- const { clearTransportCache, loadTransport, resolveAgent } = await import("./transport-config-G5NKQXPJ.js");
15704
+ const { clearTransportCache, loadTransport, resolveAgent } = await import("./transport-config-JIKHB7GT.js");
15705
15705
  clearTransportCache();
15706
15706
  const tc = loadTransport();
15707
15707
  if (tc) {
@@ -15867,8 +15867,9 @@ var AcpTransport = class {
15867
15867
  const dur = Math.round((now - this.toolMeta.startedAt) / 1e3);
15868
15868
  logWarn(this.tag, `[transport-health] Tool "${title}" hung ${dur}s \u2014 interrupting`);
15869
15869
  this._watchdogLastActionAt = now;
15870
- await this.sendInterrupt();
15871
15870
  this.toolMeta = null;
15871
+ if (this.sm.state === "tool-active") this.sm.transition("idle", "toolTimeout");
15872
+ await this.sendInterrupt();
15872
15873
  if (!this._watchdogL1Done) {
15873
15874
  await this.sendPrompt(this.lastSessionKey, `[SYSTEM] Your tool call "${title}" was interrupted after ${dur} seconds. Try a different approach.`);
15874
15875
  this._watchdogL1Done = true;
@@ -15900,4 +15901,4 @@ export {
15900
15901
  ModelNotFoundError,
15901
15902
  AcpTransport
15902
15903
  };
15903
- //# sourceMappingURL=chunk-RV54J75Q.js.map
15904
+ //# sourceMappingURL=chunk-PKHYCNTT.js.map