abtars 0.3.4-alpha.7 → 0.3.4

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 (348) hide show
  1. package/bundle/{_registry.generated-WGR4WOPT.js → _registry.generated-AVR7DK2A.js} +17 -14
  2. package/bundle/{_registry.generated-WGR4WOPT.js.map → _registry.generated-AVR7DK2A.js.map} +1 -1
  3. package/bundle/{abmind-lazy-7Z44NODV.js → abmind-lazy-E3YCFKQ5.js} +15 -5
  4. package/bundle/abtars-browser.js +4 -4
  5. package/bundle/abtars-cli.js +23 -13
  6. package/bundle/abtars-cli.js.map +2 -2
  7. package/bundle/abtars-restart.js +3 -3
  8. package/bundle/abtars-task.js +3 -3
  9. package/bundle/abtars-task.js.map +2 -2
  10. package/bundle/abtars.js +610 -455
  11. package/bundle/abtars.js.map +4 -4
  12. package/bundle/{acp-raw-client-E6FM45NC.js → acp-raw-client-UCNK3OTU.js} +2 -2
  13. package/bundle/{action-gate-G2V47NHW.js → action-gate-V4FCBHFB.js} +2 -2
  14. package/bundle/{agent-api-adapter-YAHKQMMZ.js → agent-api-adapter-7HEPYSIN.js} +3 -3
  15. package/bundle/{agent-api-rate-limit-WCFXJMGY.js → agent-api-rate-limit-RZSAM3SW.js} +4 -4
  16. package/bundle/{agent-registry-GI6CLT3Z.js → agent-registry-46A2R5KP.js} +7 -7
  17. package/bundle/{bootstrap-X2QYIZIJ.js → bootstrap-MIHJJSWU.js} +2 -2
  18. package/bundle/{bridge-lock-transport-4ZH7QTJP.js → bridge-lock-transport-7RSN7OLJ.js} +4 -4
  19. package/bundle/{browser-DMARZJIN.js → browser-F6BCWJWW.js} +6 -6
  20. package/bundle/{budget-45QOBDWA.js → budget-WUM3SPKW.js} +3 -3
  21. package/bundle/{capability-JFWX3IQF.js → capability-QVRKGRFC.js} +5 -5
  22. package/bundle/{chunk-YSKCQH6E.js → chunk-2IYJ4I66.js} +2 -2
  23. package/bundle/{chunk-KTYGKPYM.js → chunk-2NLUT5S2.js} +6 -6
  24. package/bundle/chunk-3BG3AIDP.js +191 -0
  25. package/bundle/chunk-3BG3AIDP.js.map +7 -0
  26. package/bundle/{chunk-OKAQICWY.js → chunk-3GQX34S2.js} +3 -3
  27. package/bundle/{chunk-QROWBWLL.js → chunk-3XZ773BS.js} +2 -2
  28. package/bundle/{chunk-DYBW4XXL.js → chunk-467SRLLR.js} +2 -2
  29. package/bundle/{chunk-LGP6TYFI.js → chunk-4AILRHUI.js} +97 -8
  30. package/bundle/chunk-4AILRHUI.js.map +7 -0
  31. package/bundle/{chunk-GPZNXY2U.js → chunk-4S3H4OK7.js} +4 -4
  32. package/bundle/{chunk-NDCRWEEJ.js → chunk-4Y5MJQRE.js} +6 -6
  33. package/bundle/{chunk-FRKW6LWB.js → chunk-55UWKI5C.js} +3 -3
  34. package/bundle/{chunk-4UL3KINB.js → chunk-5PNJFDSW.js} +8 -8
  35. package/bundle/{chunk-LUNA6PM5.js → chunk-5RVOEFGT.js} +4 -2
  36. package/bundle/{chunk-LUNA6PM5.js.map → chunk-5RVOEFGT.js.map} +2 -2
  37. package/bundle/{chunk-OXTSWQCX.js → chunk-5Y3FJ2Y7.js} +2 -2
  38. package/bundle/{chunk-TMUYFERL.js → chunk-6B5ZFUPD.js} +2 -2
  39. package/bundle/{chunk-65VCEC32.js → chunk-6PA5JBUU.js} +2 -2
  40. package/bundle/chunk-BNXV7SZI.js +195 -0
  41. package/bundle/chunk-BNXV7SZI.js.map +7 -0
  42. package/bundle/{chunk-AFREM7FX.js → chunk-CK7YTA2F.js} +2 -2
  43. package/bundle/{chunk-NRUSRJXR.js → chunk-DZJ5QZFD.js} +2 -2
  44. package/bundle/{chunk-YRSMGJFP.js → chunk-E67KESEG.js} +2 -2
  45. package/bundle/{chunk-ZV4IWKDJ.js → chunk-E7XD5UGB.js} +3 -3
  46. package/bundle/{chunk-GXL7HJPT.js → chunk-EAX5ZZUL.js} +63 -39
  47. package/bundle/chunk-EAX5ZZUL.js.map +7 -0
  48. package/bundle/{chunk-PEDX56EL.js → chunk-EFGBM555.js} +2 -2
  49. package/bundle/{chunk-EQSG2CRM.js → chunk-FGYDIX54.js} +22 -15
  50. package/bundle/chunk-FGYDIX54.js.map +7 -0
  51. package/bundle/{chunk-XWRADSXO.js → chunk-GF6NVNA7.js} +15 -5
  52. package/bundle/chunk-GF6NVNA7.js.map +7 -0
  53. package/bundle/{chunk-SIFPBTI4.js → chunk-HGSHCQ5F.js} +113 -73
  54. package/bundle/chunk-HGSHCQ5F.js.map +7 -0
  55. package/bundle/{chunk-YRU2K3O6.js → chunk-IMIGG5EO.js} +39 -39
  56. package/bundle/chunk-IMIGG5EO.js.map +7 -0
  57. package/bundle/{chunk-W4EA4GCA.js → chunk-ITOFPJAV.js} +43 -31
  58. package/bundle/chunk-ITOFPJAV.js.map +7 -0
  59. package/bundle/{chunk-UPRZDU6T.js → chunk-IY6UKLPS.js} +3 -3
  60. package/bundle/{chunk-EUZDKV3C.js → chunk-J4RUFAPK.js} +3 -3
  61. package/bundle/{chunk-HZDLFLRP.js → chunk-J7DRPVMU.js} +35 -5
  62. package/bundle/chunk-J7DRPVMU.js.map +7 -0
  63. package/bundle/{chunk-EGL6UMAO.js → chunk-JG4BKXBN.js} +7 -1
  64. package/bundle/chunk-JG4BKXBN.js.map +7 -0
  65. package/bundle/{chunk-5B5B6EHL.js → chunk-JLWYPGWI.js} +5 -5
  66. package/bundle/{chunk-5QUTMUIK.js → chunk-JXYWDAHD.js} +12 -12
  67. package/bundle/{chunk-GRVWZO4C.js → chunk-KOSFXW2S.js} +24 -3
  68. package/bundle/{chunk-GRVWZO4C.js.map → chunk-KOSFXW2S.js.map} +1 -1
  69. package/bundle/{chunk-ONBF5DDU.js → chunk-L72RIPEC.js} +248 -182
  70. package/bundle/chunk-L72RIPEC.js.map +7 -0
  71. package/bundle/{chunk-TEFZ4JA4.js → chunk-NHPLD3C7.js} +2 -2
  72. package/bundle/{chunk-2KC5G3EA.js → chunk-OWUO5RS3.js} +5 -5
  73. package/bundle/{chunk-4MULJ5SS.js → chunk-OY4Q6AMY.js} +71 -49
  74. package/bundle/chunk-OY4Q6AMY.js.map +7 -0
  75. package/bundle/{chunk-WBTJ2E62.js → chunk-P3NODAHF.js} +2 -5
  76. package/bundle/{chunk-WBTJ2E62.js.map → chunk-P3NODAHF.js.map} +2 -2
  77. package/bundle/{chunk-BROFMHC2.js → chunk-PB5GF4FG.js} +334 -237
  78. package/bundle/chunk-PB5GF4FG.js.map +7 -0
  79. package/bundle/{chunk-WYHGNI56.js → chunk-PMD5BLFS.js} +6 -6
  80. package/bundle/{chunk-URQPDCK5.js → chunk-Q66LQMMZ.js} +3 -3
  81. package/bundle/{chunk-HKRSMUXJ.js → chunk-SC2Y5NR2.js} +71 -132
  82. package/bundle/chunk-SC2Y5NR2.js.map +7 -0
  83. package/bundle/chunk-SFL4EPCZ.js +555 -0
  84. package/bundle/chunk-SFL4EPCZ.js.map +7 -0
  85. package/bundle/{chunk-LDUOOKQY.js → chunk-SJPUNDZ3.js} +5 -5
  86. package/bundle/{chunk-LDUOOKQY.js.map → chunk-SJPUNDZ3.js.map} +1 -1
  87. package/bundle/{chunk-JQDJPUHM.js → chunk-TWB2ZGVH.js} +2 -2
  88. package/bundle/{chunk-IJT4KWXT.js → chunk-U4U47YE7.js} +2 -2
  89. package/bundle/{chunk-2FAZIA37.js → chunk-W546CU3A.js} +3 -3
  90. package/bundle/chunk-WC5O5KOE.js +211 -0
  91. package/bundle/chunk-WC5O5KOE.js.map +7 -0
  92. package/bundle/{chunk-JNIHEDKF.js → chunk-XPWYDNWL.js} +2 -2
  93. package/bundle/{chunk-GWILHZPT.js → chunk-XRTXYN66.js} +10 -7
  94. package/bundle/{chunk-GWILHZPT.js.map → chunk-XRTXYN66.js.map} +2 -2
  95. package/bundle/{chunk-EFJVUJBE.js → chunk-Y5FEFKGM.js} +6 -6
  96. package/bundle/chunk-YJZE4OK3.js +169 -0
  97. package/bundle/chunk-YJZE4OK3.js.map +7 -0
  98. package/bundle/{chunk-GVM5YU5I.js → chunk-Z4FZPB42.js} +2 -2
  99. package/bundle/{chunk-7BSQ5UQO.js → chunk-ZSIDQ66D.js} +3 -3
  100. package/bundle/{chunk-XX6BGTPO.js → chunk-ZZZCJJEO.js} +4 -4
  101. package/bundle/{commands-XYEGVUZF.js → commands-2ZW6CMLC.js} +17 -16
  102. package/bundle/{config-M3P5IOAI.js → config-YMY5YHKN.js} +6 -6
  103. package/bundle/{context-2RJHC2LE.js → context-CL2RSLII.js} +7 -5
  104. package/bundle/context-CL2RSLII.js.map +7 -0
  105. package/bundle/{daemon-TB23FFWY.js → daemon-D7SU63OY.js} +3 -3
  106. package/bundle/{delegation-tools-QKNYQGTQ.js → delegation-tools-WS7Z56KZ.js} +12 -12
  107. package/bundle/{deploy-EPDWNHJU.js → deploy-AMTVKIMU.js} +2 -2
  108. package/bundle/{deps-WVK553KF.js → deps-T63AVJKJ.js} +3 -3
  109. package/bundle/{direct-api-transport-E3LNDBJT.js → direct-api-transport-QNNY2WWP.js} +56 -33
  110. package/bundle/direct-api-transport-QNNY2WWP.js.map +7 -0
  111. package/bundle/{discord-adapter-IT3KP3VB.js → discord-adapter-ABAD56Y2.js} +21 -20
  112. package/bundle/{discord-adapter-IT3KP3VB.js.map → discord-adapter-ABAD56Y2.js.map} +1 -1
  113. package/bundle/{dns-wakeup-IDOJIXBX.js → dns-wakeup-V3LEFXPE.js} +9 -33
  114. package/bundle/dns-wakeup-V3LEFXPE.js.map +7 -0
  115. package/bundle/{doctor-probes-B54JFIW3.js → doctor-probes-O6YI6XSZ.js} +6 -2
  116. package/bundle/{env-schema-4JXQUOH4.js → env-schema-B5RB32DC.js} +3 -3
  117. package/bundle/{gossip-3C3BSNPN.js → gossip-SKRCPOBS.js} +9 -5
  118. package/bundle/{guardrails-DL7ZSWVN.js → guardrails-64GQ5Y5K.js} +4 -4
  119. package/bundle/{heartbeat-system-MVTRS4GP.js → heartbeat-system-X4MUTKJD.js} +6 -6
  120. package/bundle/{heartbeat-tier3-ABWL3P7M.js → heartbeat-tier3-2PTPWEQQ.js} +53 -76
  121. package/bundle/heartbeat-tier3-2PTPWEQQ.js.map +7 -0
  122. package/bundle/{hook-system-M3POLUIB.js → hook-system-YB635OC4.js} +3 -3
  123. package/bundle/{hotskills-FWX4QI7V.js → hotskills-Q75D2DK3.js} +5 -5
  124. package/bundle/{install-OS3CU7NF.js → install-RFKKFSGS.js} +17 -30
  125. package/bundle/install-RFKKFSGS.js.map +7 -0
  126. package/bundle/{install-manifest-5PPWMD2W.js → install-manifest-J7ICPCJN.js} +2 -2
  127. package/bundle/{irc-adapter-PTTZD32W.js → irc-adapter-TVEV4R6H.js} +3 -3
  128. package/bundle/{irc-config-CP7ZMUOX.js → irc-config-M676FOFI.js} +4 -4
  129. package/bundle/{kanban-board-M326B2XJ.js → kanban-board-DLEJUCNN.js} +9 -7
  130. package/bundle/{kanban-channel-IJ52OMNA.js → kanban-channel-XOLUHJZJ.js} +6 -6
  131. package/bundle/kanban-delivery-C4QPBNPX.js +45 -0
  132. package/bundle/kanban-delivery-C4QPBNPX.js.map +7 -0
  133. package/bundle/{lazy-require-KCRVT4SI.js → lazy-require-JKQSALXN.js} +3 -3
  134. package/bundle/{logger-OWCSNYCA.js → logger-3EGHBD4R.js} +2 -2
  135. package/bundle/{main-chat-ZNUZCTNS.js → main-chat-3H63REKK.js} +4 -4
  136. package/bundle/{master-user-HSKM4ZFN.js → master-user-MUBUP3KD.js} +5 -5
  137. package/bundle/{media-utils-3ZYOD7SK.js → media-utils-HUUIALAJ.js} +3 -3
  138. package/bundle/{message-pipeline-P5GAQU4Z.js → message-pipeline-GRDRWONR.js} +17 -16
  139. package/bundle/meta.json +3699 -3138
  140. package/bundle/{metrics-collector-L3VPEHII.js → metrics-collector-YMUGY3PI.js} +31 -2
  141. package/bundle/metrics-collector-YMUGY3PI.js.map +7 -0
  142. package/bundle/{model-health-registry-MLEIZSTV.js → model-health-registry-QADMFQFQ.js} +2 -2
  143. package/bundle/{nerve-IGSXBKZZ.js → nerve-QPAEBRKX.js} +3 -3
  144. package/bundle/{notification-BFSIEECG.js → notification-3JICGXWU.js} +6 -6
  145. package/bundle/{openrouter-credits-NTVZDRYM.js → openrouter-credits-7NEIPYJN.js} +3 -3
  146. package/bundle/{orc-tools-4CHEFWSN.js → orc-tools-UZVPONKY.js} +5 -3
  147. package/bundle/{peer-auth-QC4EF2PM.js → peer-auth-RI43DKJE.js} +24 -15
  148. package/bundle/{peer-client-RGEU5HOK.js → peer-client-UITTMWJ2.js} +34 -29
  149. package/bundle/peer-client-UITTMWJ2.js.map +7 -0
  150. package/bundle/{peer-config-TN55LFDC.js → peer-config-URM7DCW6.js} +9 -4
  151. package/bundle/{peer-transport-I6JPLFZ2.js → peer-transport-SI7I72DB.js} +12 -10
  152. package/bundle/{phase-transport-PGKU2KD4.js → phase-transport-ESWWACZI.js} +17 -17
  153. package/bundle/{reconcile-CTFCLQRN.js → reconcile-GFDQYNBD.js} +3 -3
  154. package/bundle/{reconciler-EBKH3JNU.js → reconciler-IEUJXJN2.js} +12 -12
  155. package/bundle/{restore-IFHPI7I7.js → restore-FARTGLQQ.js} +3 -3
  156. package/bundle/{rollback-ANRI3T5Z.js → rollback-GEWPZABG.js} +2 -2
  157. package/bundle/{sandbox-runtime-QROWHDCS.js → sandbox-runtime-DV6E25J6.js} +2 -2
  158. package/bundle/{self-healer-utils-IFAYOQO2.js → self-healer-utils-P4SKNNEM.js} +3 -3
  159. package/bundle/{sha-tracker-ZWBP6CIJ.js → sha-tracker-77SHLYNY.js} +3 -3
  160. package/bundle/{skill-session-BMSRQSHV.js → skill-session-5HSMXY54.js} +3 -3
  161. package/bundle/{skill-stats-JORH5DGM.js → skill-stats-MI3RSWWL.js} +4 -4
  162. package/bundle/{skill-watcher-E4MGLKLS.js → skill-watcher-5L7JE6TN.js} +4 -4
  163. package/bundle/{sleep-36XS6MHJ.js → sleep-I4JFASCY.js} +11 -8
  164. package/bundle/{soul-bundle-VWAVHCZ6.js → soul-bundle-522C3IRH.js} +9 -8
  165. package/bundle/{spin-TI3TSVVT.js → spin-VHNGNWTD.js} +11 -11
  166. package/bundle/{spin-notifications-SE2HVZI7.js → spin-notifications-7NC5XZEM.js} +5 -5
  167. package/bundle/{spin-types-BLPYAETA.js → spin-types-C5KOQOPD.js} +7 -3
  168. package/bundle/{sse-parser-anthropic-A6R4Z2TB.js → sse-parser-anthropic-MMTVWHLI.js} +3 -3
  169. package/bundle/{sse-parser-responses-HSZY3QGJ.js → sse-parser-responses-3AOFN64C.js} +3 -3
  170. package/bundle/{ssrf-guard-O6SHIK6Q.js → ssrf-guard-U2JA72TC.js} +3 -3
  171. package/bundle/{start-7QZIWO3S.js → start-H5IUFAWF.js} +4 -2
  172. package/bundle/{start-7QZIWO3S.js.map → start-H5IUFAWF.js.map} +2 -2
  173. package/bundle/{stt-LGVPXMVR.js → stt-PSOPPBV4.js} +4 -4
  174. package/bundle/{system-status-JZU5FO7B.js → system-status-4LYGOFNO.js} +38 -24
  175. package/bundle/system-status-4LYGOFNO.js.map +7 -0
  176. package/bundle/{task-store-W5BFIAIH.js → task-store-MNCW42BW.js} +4 -4
  177. package/bundle/{telegram-adapter-H6PMFPMB.js → telegram-adapter-O6KIZDY6.js} +69 -46
  178. package/bundle/telegram-adapter-O6KIZDY6.js.map +7 -0
  179. package/bundle/{tool-registry-IZX2IOBM.js → tool-registry-JJMWCQKZ.js} +26 -24
  180. package/bundle/{tool-sandbox-4UC6GAKA.js → tool-sandbox-CNL6V6IH.js} +4 -4
  181. package/bundle/{transport-config-KBF5W2DP.js → transport-config-6MB2K2XC.js} +7 -7
  182. package/bundle/tribe-GDTFYJTK.js +111 -0
  183. package/bundle/tribe-GDTFYJTK.js.map +7 -0
  184. package/bundle/{update-MESYO4LO.js → update-HGQAOC5L.js} +3 -3
  185. package/bundle/{usage-tracker-NXD364VX.js → usage-tracker-SR4BI6ZT.js} +2 -2
  186. package/bundle/{user-registry-35BW4XKM.js → user-registry-4PACZJIJ.js} +4 -4
  187. package/bundle/wire-platform-KKPWNNNQ.js +88 -0
  188. package/bundle/wire-platform-KKPWNNNQ.js.map +7 -0
  189. package/bundle/ws-peer-client-U3NNPOK7.js +370 -0
  190. package/bundle/ws-peer-client-U3NNPOK7.js.map +7 -0
  191. package/package.json +1 -1
  192. package/scripts/abtars-watchdog.service +2 -1
  193. package/scripts/abtars-watchdog.sh +1 -5
  194. package/scripts/emergency-deploy.sh +2 -2
  195. package/scripts/emergency-update.sh +88 -41
  196. package/bundle/chunk-3AAENI2K.js +0 -210
  197. package/bundle/chunk-3AAENI2K.js.map +0 -7
  198. package/bundle/chunk-4MULJ5SS.js.map +0 -7
  199. package/bundle/chunk-4S554KLW.js +0 -105
  200. package/bundle/chunk-4S554KLW.js.map +0 -7
  201. package/bundle/chunk-5GCLBUBS.js +0 -257
  202. package/bundle/chunk-5GCLBUBS.js.map +0 -7
  203. package/bundle/chunk-BROFMHC2.js.map +0 -7
  204. package/bundle/chunk-EGL6UMAO.js.map +0 -7
  205. package/bundle/chunk-EQSG2CRM.js.map +0 -7
  206. package/bundle/chunk-GXL7HJPT.js.map +0 -7
  207. package/bundle/chunk-HKRSMUXJ.js.map +0 -7
  208. package/bundle/chunk-HT2BPTZY.js +0 -241
  209. package/bundle/chunk-HT2BPTZY.js.map +0 -7
  210. package/bundle/chunk-HZDLFLRP.js.map +0 -7
  211. package/bundle/chunk-IKUZPMVA.js +0 -82
  212. package/bundle/chunk-IKUZPMVA.js.map +0 -7
  213. package/bundle/chunk-LGP6TYFI.js.map +0 -7
  214. package/bundle/chunk-ONBF5DDU.js.map +0 -7
  215. package/bundle/chunk-RWRRGE4U.js +0 -72
  216. package/bundle/chunk-RWRRGE4U.js.map +0 -7
  217. package/bundle/chunk-SIFPBTI4.js.map +0 -7
  218. package/bundle/chunk-VUIX5AGB.js +0 -65
  219. package/bundle/chunk-VUIX5AGB.js.map +0 -7
  220. package/bundle/chunk-W4EA4GCA.js.map +0 -7
  221. package/bundle/chunk-XWRADSXO.js.map +0 -7
  222. package/bundle/chunk-Y76VUJSF.js +0 -75
  223. package/bundle/chunk-Y76VUJSF.js.map +0 -7
  224. package/bundle/chunk-YRU2K3O6.js.map +0 -7
  225. package/bundle/context-2RJHC2LE.js.map +0 -7
  226. package/bundle/direct-api-transport-E3LNDBJT.js.map +0 -7
  227. package/bundle/dns-wakeup-IDOJIXBX.js.map +0 -7
  228. package/bundle/heartbeat-tier3-ABWL3P7M.js.map +0 -7
  229. package/bundle/install-OS3CU7NF.js.map +0 -7
  230. package/bundle/metrics-collector-L3VPEHII.js.map +0 -7
  231. package/bundle/peer-client-RGEU5HOK.js.map +0 -7
  232. package/bundle/peer-jwt-NCCPXJRX.js +0 -18
  233. package/bundle/public/css/dashboard.css +0 -542
  234. package/bundle/public/index.html +0 -180
  235. package/bundle/public/js/app.js +0 -437
  236. package/bundle/public/memory-universe.js +0 -384
  237. package/bundle/stream-single-RFJNUTL6.js +0 -34
  238. package/bundle/stream-single-RFJNUTL6.js.map +0 -7
  239. package/bundle/subagent-runtime-5QUVES3W.js +0 -14
  240. package/bundle/system-status-JZU5FO7B.js.map +0 -7
  241. package/bundle/telegram-adapter-H6PMFPMB.js.map +0 -7
  242. package/bundle/usage-tracker-NXD364VX.js.map +0 -7
  243. package/bundle/user-registry-35BW4XKM.js.map +0 -7
  244. package/bundle/ws-peer-client-AIXCXF7V.js +0 -173
  245. package/bundle/ws-peer-client-AIXCXF7V.js.map +0 -7
  246. /package/bundle/{abmind-lazy-7Z44NODV.js.map → abmind-lazy-E3YCFKQ5.js.map} +0 -0
  247. /package/bundle/{acp-raw-client-E6FM45NC.js.map → acp-raw-client-UCNK3OTU.js.map} +0 -0
  248. /package/bundle/{action-gate-G2V47NHW.js.map → action-gate-V4FCBHFB.js.map} +0 -0
  249. /package/bundle/{agent-api-adapter-YAHKQMMZ.js.map → agent-api-adapter-7HEPYSIN.js.map} +0 -0
  250. /package/bundle/{agent-api-rate-limit-WCFXJMGY.js.map → agent-api-rate-limit-RZSAM3SW.js.map} +0 -0
  251. /package/bundle/{agent-registry-GI6CLT3Z.js.map → agent-registry-46A2R5KP.js.map} +0 -0
  252. /package/bundle/{bootstrap-X2QYIZIJ.js.map → bootstrap-MIHJJSWU.js.map} +0 -0
  253. /package/bundle/{bridge-lock-transport-4ZH7QTJP.js.map → bridge-lock-transport-7RSN7OLJ.js.map} +0 -0
  254. /package/bundle/{browser-DMARZJIN.js.map → browser-F6BCWJWW.js.map} +0 -0
  255. /package/bundle/{budget-45QOBDWA.js.map → budget-WUM3SPKW.js.map} +0 -0
  256. /package/bundle/{capability-JFWX3IQF.js.map → capability-QVRKGRFC.js.map} +0 -0
  257. /package/bundle/{chunk-YSKCQH6E.js.map → chunk-2IYJ4I66.js.map} +0 -0
  258. /package/bundle/{chunk-KTYGKPYM.js.map → chunk-2NLUT5S2.js.map} +0 -0
  259. /package/bundle/{chunk-OKAQICWY.js.map → chunk-3GQX34S2.js.map} +0 -0
  260. /package/bundle/{chunk-QROWBWLL.js.map → chunk-3XZ773BS.js.map} +0 -0
  261. /package/bundle/{chunk-DYBW4XXL.js.map → chunk-467SRLLR.js.map} +0 -0
  262. /package/bundle/{chunk-GPZNXY2U.js.map → chunk-4S3H4OK7.js.map} +0 -0
  263. /package/bundle/{chunk-NDCRWEEJ.js.map → chunk-4Y5MJQRE.js.map} +0 -0
  264. /package/bundle/{chunk-FRKW6LWB.js.map → chunk-55UWKI5C.js.map} +0 -0
  265. /package/bundle/{chunk-4UL3KINB.js.map → chunk-5PNJFDSW.js.map} +0 -0
  266. /package/bundle/{chunk-OXTSWQCX.js.map → chunk-5Y3FJ2Y7.js.map} +0 -0
  267. /package/bundle/{chunk-TMUYFERL.js.map → chunk-6B5ZFUPD.js.map} +0 -0
  268. /package/bundle/{chunk-65VCEC32.js.map → chunk-6PA5JBUU.js.map} +0 -0
  269. /package/bundle/{chunk-AFREM7FX.js.map → chunk-CK7YTA2F.js.map} +0 -0
  270. /package/bundle/{chunk-NRUSRJXR.js.map → chunk-DZJ5QZFD.js.map} +0 -0
  271. /package/bundle/{chunk-YRSMGJFP.js.map → chunk-E67KESEG.js.map} +0 -0
  272. /package/bundle/{chunk-ZV4IWKDJ.js.map → chunk-E7XD5UGB.js.map} +0 -0
  273. /package/bundle/{chunk-PEDX56EL.js.map → chunk-EFGBM555.js.map} +0 -0
  274. /package/bundle/{chunk-UPRZDU6T.js.map → chunk-IY6UKLPS.js.map} +0 -0
  275. /package/bundle/{chunk-EUZDKV3C.js.map → chunk-J4RUFAPK.js.map} +0 -0
  276. /package/bundle/{chunk-5B5B6EHL.js.map → chunk-JLWYPGWI.js.map} +0 -0
  277. /package/bundle/{chunk-5QUTMUIK.js.map → chunk-JXYWDAHD.js.map} +0 -0
  278. /package/bundle/{chunk-TEFZ4JA4.js.map → chunk-NHPLD3C7.js.map} +0 -0
  279. /package/bundle/{chunk-2KC5G3EA.js.map → chunk-OWUO5RS3.js.map} +0 -0
  280. /package/bundle/{chunk-WYHGNI56.js.map → chunk-PMD5BLFS.js.map} +0 -0
  281. /package/bundle/{chunk-URQPDCK5.js.map → chunk-Q66LQMMZ.js.map} +0 -0
  282. /package/bundle/{chunk-JQDJPUHM.js.map → chunk-TWB2ZGVH.js.map} +0 -0
  283. /package/bundle/{chunk-IJT4KWXT.js.map → chunk-U4U47YE7.js.map} +0 -0
  284. /package/bundle/{chunk-2FAZIA37.js.map → chunk-W546CU3A.js.map} +0 -0
  285. /package/bundle/{chunk-JNIHEDKF.js.map → chunk-XPWYDNWL.js.map} +0 -0
  286. /package/bundle/{chunk-EFJVUJBE.js.map → chunk-Y5FEFKGM.js.map} +0 -0
  287. /package/bundle/{chunk-GVM5YU5I.js.map → chunk-Z4FZPB42.js.map} +0 -0
  288. /package/bundle/{chunk-7BSQ5UQO.js.map → chunk-ZSIDQ66D.js.map} +0 -0
  289. /package/bundle/{chunk-XX6BGTPO.js.map → chunk-ZZZCJJEO.js.map} +0 -0
  290. /package/bundle/{commands-XYEGVUZF.js.map → commands-2ZW6CMLC.js.map} +0 -0
  291. /package/bundle/{config-M3P5IOAI.js.map → config-YMY5YHKN.js.map} +0 -0
  292. /package/bundle/{daemon-TB23FFWY.js.map → daemon-D7SU63OY.js.map} +0 -0
  293. /package/bundle/{delegation-tools-QKNYQGTQ.js.map → delegation-tools-WS7Z56KZ.js.map} +0 -0
  294. /package/bundle/{deploy-EPDWNHJU.js.map → deploy-AMTVKIMU.js.map} +0 -0
  295. /package/bundle/{deps-WVK553KF.js.map → deps-T63AVJKJ.js.map} +0 -0
  296. /package/bundle/{doctor-probes-B54JFIW3.js.map → doctor-probes-O6YI6XSZ.js.map} +0 -0
  297. /package/bundle/{env-schema-4JXQUOH4.js.map → env-schema-B5RB32DC.js.map} +0 -0
  298. /package/bundle/{gossip-3C3BSNPN.js.map → gossip-SKRCPOBS.js.map} +0 -0
  299. /package/bundle/{guardrails-DL7ZSWVN.js.map → guardrails-64GQ5Y5K.js.map} +0 -0
  300. /package/bundle/{heartbeat-system-MVTRS4GP.js.map → heartbeat-system-X4MUTKJD.js.map} +0 -0
  301. /package/bundle/{hook-system-M3POLUIB.js.map → hook-system-YB635OC4.js.map} +0 -0
  302. /package/bundle/{hotskills-FWX4QI7V.js.map → hotskills-Q75D2DK3.js.map} +0 -0
  303. /package/bundle/{install-manifest-5PPWMD2W.js.map → install-manifest-J7ICPCJN.js.map} +0 -0
  304. /package/bundle/{irc-adapter-PTTZD32W.js.map → irc-adapter-TVEV4R6H.js.map} +0 -0
  305. /package/bundle/{irc-config-CP7ZMUOX.js.map → irc-config-M676FOFI.js.map} +0 -0
  306. /package/bundle/{kanban-board-M326B2XJ.js.map → kanban-board-DLEJUCNN.js.map} +0 -0
  307. /package/bundle/{kanban-channel-IJ52OMNA.js.map → kanban-channel-XOLUHJZJ.js.map} +0 -0
  308. /package/bundle/{lazy-require-KCRVT4SI.js.map → lazy-require-JKQSALXN.js.map} +0 -0
  309. /package/bundle/{logger-OWCSNYCA.js.map → logger-3EGHBD4R.js.map} +0 -0
  310. /package/bundle/{main-chat-ZNUZCTNS.js.map → main-chat-3H63REKK.js.map} +0 -0
  311. /package/bundle/{master-user-HSKM4ZFN.js.map → master-user-MUBUP3KD.js.map} +0 -0
  312. /package/bundle/{media-utils-3ZYOD7SK.js.map → media-utils-HUUIALAJ.js.map} +0 -0
  313. /package/bundle/{message-pipeline-P5GAQU4Z.js.map → message-pipeline-GRDRWONR.js.map} +0 -0
  314. /package/bundle/{model-health-registry-MLEIZSTV.js.map → model-health-registry-QADMFQFQ.js.map} +0 -0
  315. /package/bundle/{nerve-IGSXBKZZ.js.map → nerve-QPAEBRKX.js.map} +0 -0
  316. /package/bundle/{notification-BFSIEECG.js.map → notification-3JICGXWU.js.map} +0 -0
  317. /package/bundle/{openrouter-credits-NTVZDRYM.js.map → openrouter-credits-7NEIPYJN.js.map} +0 -0
  318. /package/bundle/{orc-tools-4CHEFWSN.js.map → orc-tools-UZVPONKY.js.map} +0 -0
  319. /package/bundle/{peer-auth-QC4EF2PM.js.map → peer-auth-RI43DKJE.js.map} +0 -0
  320. /package/bundle/{peer-config-TN55LFDC.js.map → peer-config-URM7DCW6.js.map} +0 -0
  321. /package/bundle/{peer-jwt-NCCPXJRX.js.map → peer-transport-SI7I72DB.js.map} +0 -0
  322. /package/bundle/{peer-transport-I6JPLFZ2.js.map → phase-transport-ESWWACZI.js.map} +0 -0
  323. /package/bundle/{phase-transport-PGKU2KD4.js.map → reconcile-GFDQYNBD.js.map} +0 -0
  324. /package/bundle/{reconciler-EBKH3JNU.js.map → reconciler-IEUJXJN2.js.map} +0 -0
  325. /package/bundle/{restore-IFHPI7I7.js.map → restore-FARTGLQQ.js.map} +0 -0
  326. /package/bundle/{reconcile-CTFCLQRN.js.map → rollback-GEWPZABG.js.map} +0 -0
  327. /package/bundle/{sandbox-runtime-QROWHDCS.js.map → sandbox-runtime-DV6E25J6.js.map} +0 -0
  328. /package/bundle/{self-healer-utils-IFAYOQO2.js.map → self-healer-utils-P4SKNNEM.js.map} +0 -0
  329. /package/bundle/{rollback-ANRI3T5Z.js.map → sha-tracker-77SHLYNY.js.map} +0 -0
  330. /package/bundle/{skill-session-BMSRQSHV.js.map → skill-session-5HSMXY54.js.map} +0 -0
  331. /package/bundle/{sha-tracker-ZWBP6CIJ.js.map → skill-stats-MI3RSWWL.js.map} +0 -0
  332. /package/bundle/{skill-stats-JORH5DGM.js.map → skill-watcher-5L7JE6TN.js.map} +0 -0
  333. /package/bundle/{skill-watcher-E4MGLKLS.js.map → sleep-I4JFASCY.js.map} +0 -0
  334. /package/bundle/{sleep-36XS6MHJ.js.map → soul-bundle-522C3IRH.js.map} +0 -0
  335. /package/bundle/{soul-bundle-VWAVHCZ6.js.map → spin-VHNGNWTD.js.map} +0 -0
  336. /package/bundle/{spin-notifications-SE2HVZI7.js.map → spin-notifications-7NC5XZEM.js.map} +0 -0
  337. /package/bundle/{spin-TI3TSVVT.js.map → spin-types-C5KOQOPD.js.map} +0 -0
  338. /package/bundle/{sse-parser-anthropic-A6R4Z2TB.js.map → sse-parser-anthropic-MMTVWHLI.js.map} +0 -0
  339. /package/bundle/{sse-parser-responses-HSZY3QGJ.js.map → sse-parser-responses-3AOFN64C.js.map} +0 -0
  340. /package/bundle/{ssrf-guard-O6SHIK6Q.js.map → ssrf-guard-U2JA72TC.js.map} +0 -0
  341. /package/bundle/{spin-types-BLPYAETA.js.map → stt-PSOPPBV4.js.map} +0 -0
  342. /package/bundle/{stt-LGVPXMVR.js.map → task-store-MNCW42BW.js.map} +0 -0
  343. /package/bundle/{subagent-runtime-5QUVES3W.js.map → tool-registry-JJMWCQKZ.js.map} +0 -0
  344. /package/bundle/{task-store-W5BFIAIH.js.map → tool-sandbox-CNL6V6IH.js.map} +0 -0
  345. /package/bundle/{tool-registry-IZX2IOBM.js.map → transport-config-6MB2K2XC.js.map} +0 -0
  346. /package/bundle/{tool-sandbox-4UC6GAKA.js.map → update-HGQAOC5L.js.map} +0 -0
  347. /package/bundle/{transport-config-KBF5W2DP.js.map → usage-tracker-SR4BI6ZT.js.map} +0 -0
  348. /package/bundle/{update-MESYO4LO.js.map → user-registry-4PACZJIJ.js.map} +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/boot/phase-transport.ts", "../src/components/transport/tmux-client.ts"],
4
+ "sourcesContent": ["import { logAndSwallow } from \"../components/log-and-swallow.js\";\nimport { getEnv } from \"../components/env-schema.js\";\n/**\n * phase-transport \u2014 boot phase 3: select, initialize, and wrap the agent transport.\n *\n * Also exports buildTransport/rebuildTransport for /reset to pick up transport.json changes\n * (including provider switches that can't be live-patched).\n */\n\nimport { execSync } from \"node:child_process\";\nimport { TmuxClient } from \"../components/transport/tmux-client.js\";\nimport { createAgentTransport } from \"../components/agent-registry.js\";\nimport { logDebug, logInfo, logWarn, logError, isLogLevel } from \"../components/logger.js\";\nimport { loadUsers } from \"../components/user-registry.js\";\nimport { updateCtxStart } from \"./ctx-start.js\";\nimport { abmind } from \"../utils/abmind-lazy.js\";\nimport type { BootCtx, PhaseResult } from \"./context.js\";\nimport type { IKiroTransport } from \"../components/transport/kiro-transport.js\";\n\nconst TAG = \"transport\";\n\nexport async function phaseTransport(ctx: BootCtx): Promise<PhaseResult> {\n const { memoryConfig } = ctx;\n\n await buildTransport(ctx);\n\n // Docker detection (#478)\n const { isDockerActive, isSeatbeltActive } = await import(\"../components/guardrails.js\");\n if (isDockerActive()) {\n const { dockerAvailable } = await import(\"../components/sandbox-runtime.js\");\n if (dockerAvailable()) {\n ctx.sandboxEnabled = true;\n logInfo(\"main\", \"\uD83D\uDC33 Docker mode active \u2014 W/B/C sessions will run in Docker containers\");\n } else {\n logWarn(\"main\", \"SECURITY_MODE=docker but Docker not available \u2014 falling back to seatbelt\");\n }\n }\n\n // Seatbelt detection (#906)\n if (isSeatbeltActive()) {\n const { isAvailable, mechanismName } = await import(\"../components/seatbelt/index.js\");\n if (isAvailable()) {\n ctx.seatbeltActive = true;\n logInfo(\"main\", `\uD83D\uDEE1\uFE0F Seatbelt active \u2014 bash commands sandboxed via ${mechanismName()}`);\n } else {\n logWarn(\"main\", `SECURITY_MODE=seatbelt but ${mechanismName()} not available \u2014 falling back to guardrails`);\n }\n }\n\n // Initialize context-window-start for all known users\n if (memoryConfig.memoryEnabled) {\n const reg = loadUsers();\n for (const user of reg.users) updateCtxStart(memoryConfig.memoryDir, user.userId, ctx.startedAt);\n }\n return \"ran\";\n}\n\n/**\n * Construct professor transport from current transport.json + env and attach to ctx.transport.\n * Idempotent: destroys any existing ctx.transport first.\n *\n * #367 \u2014 Validates the resolved provider BEFORE destroying the old transport.\n * If validation fails:\n * - During `/reset` (old transport exists): logs ERROR, keeps the old transport up\n * - At boot (no old transport): falls back to .env config if possible, or throws\n * - In either case: bridge stays alive in degraded mode rather than crash-looping\n */\nexport async function buildTransport(ctx: BootCtx): Promise<PhaseResult> {\n const { config } = ctx;\n\n let transport: IKiroTransport;\n\n const { resolveAgent, getEnvFallback, loadTransport, resolveHailMary, clearTransportCache, validateProviderReady } = await import(\"../components/transport-config.js\");\n const { existsSync, renameSync } = await import(\"node:fs\");\n const { join: pathJoin } = await import(\"node:path\");\n clearTransportCache(); // always re-read (picks up /models change writes)\n let tc = loadTransport();\n\n // Recovery: if transport.json missing/corrupt, try transport.old.json\n if (!tc) {\n const configDir = pathJoin(getEnv().abtarsHome, \"config\");\n const primary = pathJoin(configDir, \"transport.json\");\n const old = pathJoin(configDir, \"transport.old.json\");\n if (existsSync(old)) {\n logDebug(\"main\", \"transport.json missing/corrupt \u2014 recovering from transport.old.json\");\n renameSync(old, primary);\n clearTransportCache();\n tc = loadTransport();\n }\n }\n\n const prof = tc ? resolveAgent(\"professor\", tc) : null;\n\n const hm = resolveHailMary(tc);\n if (hm) {\n ctx.hailMary = {\n model: hm.model,\n endpoint: hm.endpoint,\n apiKey: hm.apiKeyEnv ? getEnv().getApiKey(hm.apiKeyEnv) : undefined,\n };\n logInfo(\"main\", `\uD83D\uDEA8 hailMary configured: ${hm.model} (manual /model emergency only)`);\n } else {\n ctx.hailMary = null;\n }\n\n let resolved: typeof prof = null;\n\n if (!tc) {\n // No transport.json and no .old.json \u2014 emergency mode from .env\n const fb = getEnvFallback();\n const fbValidation = validateProviderReady(fb.providerName, fb.provider, getEnv());\n if (!fbValidation.ok) {\n logError(\"main\", `No transport.json, no backup, and .env emergency model also invalid: ${fbValidation.reason}`);\n logWarn(\"main\", \"Transport unavailable \u2014 running in Tier 2 (no agent responses)\");\n ctx.transport = null;\n return \"skipped\";\n }\n logWarn(\"main\", `\u26A0\uFE0F No transport.json \u2014 emergency mode: ${fb.model} via ${fb.providerName}`);\n resolved = { model: fb.model, provider: fb.provider, providerName: fb.providerName, contextWindow: fb.contextWindow, maxOutput: fb.maxOutput, fallbacks: [] };\n // Notify user (deferred \u2014 transport not yet built)\n setTimeout(() => {\n import(\"../components/notification.js\").then(({ sendNotification }) =>\n sendNotification(ctx, `\u26A0\uFE0F transport.json missing, no backup. Running emergency model: ${fb.model}. Fix: /update deploy`))\n .catch(() => {});\n }, 10_000);\n } else {\n // transport.json valid \u2014 walk primary + fb chain\n const validation = validateProviderReady(prof!.providerName, prof!.provider, getEnv());\n if (validation.ok) {\n logDebug(\"main\", `Model init OK: ${prof!.model} via ${prof!.providerName}`);\n resolved = prof;\n } else {\n logDebug(\"main\", `Model init failed: ${prof!.model} \u2014 ${validation.reason}`);\n logWarn(\"main\", `${prof!.model}: ${validation.reason} \u2014 trying fallbacks`);\n // Walk fallback chain\n for (const fb of prof!.fallbacks) {\n const fbResolved = resolveAgent(\"_fb\", { ...tc!, agents: { ...tc!.agents, _fb: { model: fb.model, provider: fb.provider } } });\n if (!fbResolved) continue;\n const fbVal = validateProviderReady(fbResolved.providerName, fbResolved.provider, getEnv());\n if (fbVal.ok) {\n logDebug(\"main\", `Fallback init OK: ${fbResolved.model} via ${fbResolved.providerName}`);\n resolved = fbResolved;\n break;\n }\n logDebug(\"main\", `Fallback init failed: ${fbResolved.model} \u2014 ${fbVal.reason}`);\n logWarn(\"main\", `${fbResolved.model}: ${fbVal.reason} \u2014 trying next`);\n }\n }\n\n if (!resolved) {\n // ALL configured models failed \u2014 hard error (boot) or keep existing (reset)\n const tried = [prof!.model, ...prof!.fallbacks.map(f => f.model)].join(\", \");\n if (ctx.transport) {\n logError(\"main\", `All models failed init (${tried}) \u2014 keeping existing transport up`);\n return \"ran\";\n }\n logError(\"main\", `All configured models failed init (${tried}). Fix transport.json or use /emergency`);\n logWarn(\"main\", \"Transport unavailable \u2014 running in Tier 2 (no agent responses)\");\n ctx.transport = null;\n return \"skipped\";\n }\n }\n\n // #367 \u2014 if existing transport is up and new config rebuild needed, keep old on error\n // (This path is only hit via /reset rebuild, not boot)\n\n // Destroy old (if any) \u2014 now that we know the new config is valid\n if (ctx.transport) {\n try { await ctx.transport.destroy(); } catch (err) {\n logWarn(\"main\", `Old transport destroy failed: ${err instanceof Error ? err.message : String(err)}`);\n }\n ctx.transport = null;\n }\n\n if (resolved.provider.transport === \"tmux\") {\n const defaults = tc?.transportDefaults?.tmux;\n logInfo(\"main\", `\uD83D\uDDA5\uFE0F tmux transport (${resolved.providerName})`);\n transport = new TmuxClient(\n defaults?.session ?? config.transport.tmuxSession,\n defaults?.captureDelaySec ?? config.transport.tmuxCaptureDelaySec,\n defaults?.maxWaitSec ?? config.transport.tmuxMaxWaitSec,\n );\n } else if (resolved.provider.transport === \"api\") {\n const { DirectApiTransport } = await import(\"../components/transport/direct-api-transport.js\");\n const { ModelHealthRegistry } = await import(\"../components/transport/model-health-registry.js\");\n const { FallbackPolicy } = await import(\"../components/transport/fallback-policy.js\");\n const apiKey = getEnv().getApiKey(resolved.provider.apiKeyEnv ?? \"API_KEY\");\n\n const candidates: Array<{ model: string; endpoint: string; apiKey?: string; maxContext: number }> = [\n { endpoint: resolved.provider.endpoint ?? \"http://localhost:11434/v1\", apiKey, model: resolved.model, maxContext: resolved.contextWindow },\n ];\n for (const fb of resolved.fallbacks) {\n const fbResolved = tc ? resolveAgent(\"_fallback\", { ...tc, agents: { ...tc.agents, _fallback: { model: fb.model, provider: fb.provider } } }) : null;\n candidates.push({\n endpoint: fbResolved?.provider.endpoint ?? resolved.provider.endpoint!,\n apiKey: fbResolved?.provider.apiKeyEnv ? getEnv().getApiKey(fbResolved.provider.apiKeyEnv) : apiKey,\n model: fb.model,\n maxContext: fbResolved?.contextWindow ?? resolved.contextWindow,\n });\n }\n\n if (!ctx.modelHealthRegistry) {\n ctx.modelHealthRegistry = new ModelHealthRegistry(tc?.healthPolicy);\n }\n // Wire auto-demotion\n if (!ctx.modelHealthRegistry.onDemote) {\n ctx.modelHealthRegistry.onDemote = (model, _endpoint, reason) => {\n import(\"../components/transport-config.js\").then(({ demoteModel }) => demoteModel(model, reason));\n import(\"../components/notification.js\").then(({ sendNotification }) =>\n sendNotification(ctx, `\u26A0\uFE0F ${model} demoted (${reason}). Next healthy model promoted.`)).catch(err => logAndSwallow(TAG, \"sendNotification model-demote\", err));\n };\n }\n const policy = new FallbackPolicy(candidates, ctx.modelHealthRegistry);\n\n transport = new DirectApiTransport({\n endpoint: resolved.provider.endpoint ?? \"http://localhost:11434/v1\",\n apiKey,\n model: resolved.model,\n maxContext: resolved.contextWindow,\n maxOutput: resolved.maxOutput,\n maxTurns: tc?.maxTurns ?? 50,\n maxToolRounds: tc?.maxToolRounds ?? 25,\n apiFormat: resolved.provider.apiFormat,\n thinking: resolved.provider.thinking,\n }, policy);\n logInfo(\"main\", `\uD83D\uDD0C Direct API transport (${resolved.providerName}, model=${resolved.model}, ${candidates.length} candidates)`);\n } else {\n // Kill stale ACP processes from previous run (#921, #1012)\n const { readAndClearAcpPids } = await import(\"../components/transport/bridge-lock-transport.js\");\n const stalePids = readAndClearAcpPids();\n for (const pid of stalePids) {\n try { process.kill(pid, \"SIGTERM\"); } catch { /* already dead */ }\n }\n if (stalePids.length) logDebug(\"main\", `Killed ${stalePids.length} stale ACP process(es)`);\n // #1012: Defense-in-depth \u2014 kill kiro-cli acp processes whose CWD is inside ~/.abtars/\n // Safe: agent sessions (AG1-5) have CWD outside ~/.abtars/, won't be touched.\n try {\n const { abtarsHome } = await import(\"../paths.js\");\n const home = abtarsHome();\n const { readlinkSync } = await import(\"node:fs\");\n const candidates = execSync(\"ps ax -o pid,args 2>/dev/null | grep '[k]iro-cli.*acp' | awk '{print $1}' || true\", { encoding: \"utf-8\", timeout: 3000 }).trim().split(\"\\n\").filter(Boolean);\n let killed = 0;\n for (const p of candidates) {\n const pid = parseInt(p, 10);\n if (!pid || pid === process.pid) continue;\n try {\n const cwd = readlinkSync(`/proc/${pid}/cwd`);\n if (cwd.startsWith(home)) { process.kill(pid, \"SIGTERM\"); killed++; }\n } catch {} // dead, no /proc (macOS), or no permission\n }\n if (killed) logDebug(\"main\", `CWD-checked kill: ${killed} orphan(s)`);\n } catch { /* best effort */ }\n logInfo(\"main\", `\uD83D\uDD0C ACP transport (${resolved.provider.cli ?? \"kiro-cli\"}, model=${resolved.model})`);\n transport = createAgentTransport(\"professor\", {\n cliPath: resolved.provider.cli ?? config.transport.agentCliPath,\n workingDir: config.transport.workingDir,\n agentCli: resolved.provider.cli ?? \"kiro-cli\",\n model: resolved.model,\n });\n }\n\n await transport.initialize();\n\n // SOUL bundle set in phase-pipelineDeps (after memory state resolved) #998\n\n if (resolved.fallbacks.length > 0 && resolved.provider.transport !== \"api\") {\n logWarn(\"main\", `\u26A0\uFE0F Fallbacks configured for ${resolved.provider.transport} transport \u2014 only API transport supports model fallback`);\n }\n\n ctx.transport = transport;\n // Flush message queues on reinit \u2014 model lost context\n if (\"onReinit\" in transport) {\n (transport as any).onReinit = () => {\n const { spin } = require(\"../components/spin.js\") as typeof import(\"../components/spin.js\");\n for (const s of spin.listAllSessions()) {\n if (s.queue.length) {\n logWarn(\"transport\", `Reinit: flushing ${s.queue.length} queued message(s)`);\n s.queue.length = 0;\n }\n }\n };\n }\n ctx.modelName = resolved.model;\n ctx.modelProvider = resolved.providerName;\n ctx.fallbackChain = resolved.fallbacks.map((f: { model: string }) => f.model);\n\n if (ctx.modelHealthRegistry) {\n ctx.runtime.setRegistry(ctx.modelHealthRegistry);\n }\n ctx.runtime.setMainTransport(transport);\n ctx.runtime.setSessionManager(ctx.sessionManager);\n if (ctx.sandboxEnabled) ctx.runtime.setSandboxEnabled(true);\n\n // Wire async delegation tools (#570)\n if (getEnv().enableAsyncDelegation) {\n const { setDelegationDeps } = await import(\"../components/transport/delegation-tools.js\");\n setDelegationDeps(ctx.runtime);\n }\n\n logInfo(\"main\", \"\u2713 Transport ready\");\n\n // Wire ActionGate for auth-required commands\n const { join } = await import(\"node:path\");\n const { abtarsHome } = await import(\"../paths.js\");\n const { ActionGate } = await import(\"../components/action-gate.js\");\n const { setActionGate } = await import(\"../components/transport/tool-registry.js\");\n const authDir = join(abtarsHome(), \"auth\");\n ctx.actionGate = new ActionGate(authDir);\n setActionGate(ctx.actionGate);\n logDebug(\"main\", \"\uD83D\uDD12 ActionGate wired\");\n\n // #906: Wire seatbelt into tool-registry\n if (ctx.seatbeltActive) {\n const { setSeatbelt } = await import(\"../components/transport/tool-registry.js\");\n const { getPolicy } = await import(\"../components/seatbelt/index.js\");\n const home = abtarsHome();\n const policy = getPolicy(\"A\", join(home, \"workspace\"), home); // Main session policy\n setSeatbelt(true, policy);\n logDebug(\"main\", \"\uD83D\uDEE1\uFE0F Seatbelt wired to tool-registry\");\n }\n\n // #843: Wire memory to DirectApiTransport for session hydration on restart.\n // Transport-specific \u2014 only DirectApiTransport has this field.\n if (resolved.provider.transport === \"api\" && ctx.memory) {\n (transport as import(\"../components/transport/direct-api-transport.js\").DirectApiTransport).memoryBackend = ctx.memory!;\n\n // Wire context engine for automatic compaction (DirectApiTransport-specific).\n const db = ctx.memory!.getDb?.() ?? ctx.memory!.getDatabase?.();\n if (db && resolved.contextWindow >= 128000) {\n const mod = abmind();\n if (mod) {\n const { ContextEngine } = mod;\n const { createContextOrchestrator } = await import(\"../components/context/index.js\");\n const { spin } = await import(\"../components/spin.js\");\n const { recordCompaction } = await import(\"../components/metrics-collector.js\");\n const contextEngine = new ContextEngine(db);\n // Cheap compaction model: route summarization through Spin as an S-type\n // one-shot (ephemeral, terminateAfter \"call\") on the dreamy agent. Spin\n // resolves agent \u2192 model/provider/metrics; no raw LLM call, no lingering session.\n const compactionModel = (tc ? resolveAgent(\"dreamy\", tc) : null)?.model ?? null;\n const orchestrator = createContextOrchestrator(\n contextEngine,\n (systemPrompt: string, userPrompt: string) =>\n spin.dispatchBackground({ agent: \"dreamy\", prompt: `${systemPrompt}\\n\\n${userPrompt}` }),\n (_chatId: string) => {\n try { return ctx.memory?.getLastMessageTimestamp(true) ?? null; } catch (err) { logAndSwallow(TAG, \"getLastMessageTimestamp\", err); return null; }\n },\n { compactionModel, onCompactionEvent: recordCompaction },\n );\n (transport as import(\"../components/transport/direct-api-transport.js\").DirectApiTransport).contextOrchestrator = orchestrator;\n logInfo(\"main\", `\uD83D\uDCE6 Context engine wired (auto-compaction active, model: ${compactionModel ?? \"main\"})`);\n }\n }\n }\n\n if (\"onFallback\" in transport) {\n let lastNotifiedModel: string | null = null;\n (transport as unknown as { onFallback: (model: string, ctxPct: number, reason?: string) => void }).onFallback = (model, ctxPct, reason) => {\n const reasonTag = reason ? ` (${reason})` : \"\";\n const msg = `\u26A1 Fallback${reasonTag}: ${model}${ctxPct >= 0 ? ` (ctx: ~${ctxPct}%)` : \"\"}`;\n logInfo(\"main\", msg);\n // #1296: notify once per fallback episode. Do NOT bypass on debug \u2014 logInfo() above covers\n // debug logging. Re-armed by onPrimaryRestored when primary recovers.\n if (model !== lastNotifiedModel) {\n lastNotifiedModel = model;\n import(\"../components/notification.js\").then(({ sendNotification }) => sendNotification(ctx, msg)).catch(err => logAndSwallow(TAG, \"sendNotification fallback\", err));\n }\n };\n // #1296: re-arm when primary recovers so the next fallback episode notifies again\n if (\"onPrimaryRestored\" in transport) {\n (transport as unknown as { onPrimaryRestored: () => void }).onPrimaryRestored = () => {\n lastNotifiedModel = null;\n };\n }\n }\n return \"ran\";\n}\n\n/**\n * Rebuild professor transport in place (picks up transport.json changes).\n * Patches downstream references that captured the old transport (pipelineDeps, idleSave).\n */\nexport async function rebuildTransport(ctx: BootCtx): Promise<PhaseResult> {\n logInfo(\"main\", \"\uD83D\uDD04 Rebuilding transport...\");\n await buildTransport(ctx);\n if (ctx.pipelineDeps && ctx.transport) {\n (ctx.pipelineDeps as { transport: IKiroTransport }).transport = ctx.transport;\n }\n if (ctx.idleSave && ctx.transport) {\n (ctx.idleSave as unknown as { transport: IKiroTransport }).transport = ctx.transport;\n }\n logInfo(\"main\", \"\u2713 Transport rebuilt\");\n return \"ran\";\n}\n", "import { execSync } from \"node:child_process\";\nimport { writeFileSync, unlinkSync, mkdirSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { IKiroTransport } from \"./kiro-transport.js\";\nimport { logInfo, logDebug, logWarn } from \"../logger.js\";\nimport { logAndSwallow } from \"../log-and-swallow.js\";\nimport { abtarsHome } from \"../../paths.js\";\n\nconst TAG = \"tmux\";\n\n// Kiro CLI prompt pattern: \"N% >\" or \"N% !>\" where N is a number (context usage percentage)\n// The \"!\" appears in trust-all-tools mode\nconst KIRO_PROMPT_RE = /^\\d+%\\s*!?>/;\n\n// Also match common shell prompts as fallback\nconst SHELL_PROMPT_RE = /[$\u276F%#]\\s*$/;\n\n/**\n * Communicates with kiro-cli running inside a tmux session.\n * Uses `tmux send-keys` to send prompts and `tmux capture-pane`\n * to read responses.\n */\nexport class TmuxClient implements IKiroTransport {\n private readonly sessionName: string;\n private readonly captureDelaySec: number;\n private readonly maxWaitSec: number;\n private ready = false;\n\n /** Optional callback for streaming intermediate responses before final prompt. */\n onIntermediateResponse?: (text: string) => void;\n\n /** Tracks the cumulative text delivered via intermediate chunks (for tail detection). */\n private lastIntermediateDelivered = \"\";\n\n constructor(sessionName: string, captureDelaySec: number, maxWaitSec: number) {\n this.sessionName = sessionName;\n this.captureDelaySec = captureDelaySec;\n this.maxWaitSec = maxWaitSec;\n }\n\n async initialize(): Promise<void> {\n if (!this.sessionExists()) {\n throw new Error(\n `tmux session \"${this.sessionName}\" not found. ` +\n `Run: scripts/tmux-session.sh to start it.`,\n );\n }\n this.ready = true;\n logInfo(\"tmux\", `Session \"${this.sessionName}\" found`);\n }\n\n get isReady(): boolean {\n return this.ready && this.sessionExists();\n }\n\n readonly transportCommands: string[] = [];\n\n async sendPrompt(_sessionKey: string, message: string): Promise<string> {\n if (!this.isReady) {\n throw new Error(\"tmux session not available\");\n }\n\n this.lastIntermediateDelivered = \"\";\n const maxAttempts = 2;\n for (let attempt = 1; attempt <= maxAttempts; attempt++) {\n // Snapshot pane content before sending\n const before = this.capturePaneRaw();\n if (attempt === 1) {\n logDebug(\"tmux\", `Sending: \"${message.slice(0, 80)}\"`);\n } else {\n logInfo(\"tmux\", `Retry #${attempt}: resending prompt`);\n }\n\n // Send the message \u2014 use temp file for long prompts to avoid tmux command length limit\n try {\n if (message.length > 4000) {\n const tmpDir = join(abtarsHome(), \"tmp\");\n mkdirSync(tmpDir, { recursive: true });\n const tmpFile = join(tmpDir, `prompt-${Date.now()}.txt`);\n writeFileSync(tmpFile, message);\n const readCmd = `My full message is in ${tmpFile} \u2014 please read it and respond.`;\n const escaped = readCmd.replace(/'/g, \"'\\\\''\");\n this.exec(`tmux send-keys -t ${this.sessionName} '${escaped}' Enter`);\n setTimeout(() => { try { unlinkSync(tmpFile); } catch (err) { logAndSwallow(TAG, \"unlink tmpFile\", err); } }, 120_000);\n } else {\n const escaped = message.replace(/'/g, \"'\\\\''\");\n this.exec(`tmux send-keys -t ${this.sessionName} '${escaped}' Enter`);\n }\n } catch (err) {\n logWarn(\"tmux\", `send-keys failed: ${err instanceof Error ? err.message : String(err)}`);\n return \"\u26A0\uFE0F Failed to send message to Kiro session. The tmux session may be in copy mode or unresponsive. Try /reset.\";\n }\n\n // Wait for initial processing\n await sleep(this.captureDelaySec * 1000);\n\n // Poll until Kiro finishes\n const response = await this.pollForResponse(before);\n\n // Check for Kiro transient error \u2014 retry once\n if (response.startsWith(\"Kiro is having trouble\") && attempt < maxAttempts) {\n logInfo(\"tmux\", `Kiro trouble detected, will retry in 5s...`);\n await sleep(5000);\n continue;\n }\n\n logDebug(\"tmux\", `Got response (${response.length} chars)`);\n return response;\n }\n\n // Should not reach here, but just in case\n return \"\u26A0\uFE0F Kiro is having trouble responding. Try again or /reset.\";\n }\n\n async resetSession(_sessionKey: string): Promise<void> {\n if (!this.sessionExists()) return;\n this.exec(`tmux send-keys -t ${this.sessionName} C-c`);\n await sleep(1000);\n this.exec(`tmux send-keys -t ${this.sessionName} '/clear' Enter`);\n await sleep(2000);\n // Kiro asks \"Are you sure? [y/n]:\" \u2014 confirm with 'y'\n this.exec(`tmux send-keys -t ${this.sessionName} 'y' Enter`);\n await sleep(1000);\n }\n\n async restartSession(workingDir: string, kiroModel?: string): Promise<void> {\n // Kill existing tmux session and start fresh\n if (this.sessionExists()) {\n this.exec(`tmux kill-session -t ${this.sessionName}`);\n await sleep(1000);\n }\n let cmd = `kiro-cli chat --trust-all-tools`;\n if (kiroModel) cmd += ` --model ${kiroModel}`;\n this.exec(`tmux new-session -d -s ${this.sessionName} -c '${workingDir}' '${cmd}'`);\n this.exec(`tmux set-option -t ${this.sessionName} history-limit 5000`);\n await sleep(3000);\n // Enable thinking tool\n this.exec(`tmux send-keys -t ${this.sessionName} '/settings chat.enableThinking true' Enter`);\n await sleep(2000);\n this.ready = this.sessionExists();\n logInfo(\"tmux\", `Session restarted (ready=${this.ready})`);\n }\n\n async sendInterrupt(): Promise<void> {\n if (!this.sessionExists()) return;\n logInfo(\"tmux\", \"Sending Ctrl+C interrupt\");\n this.exec(`tmux send-keys -t ${this.sessionName} C-c`);\n }\n\n destroy(): void {\n this.ready = false;\n }\n\n /**\n * Poll capture-pane until Kiro's prompt reappears (N% >).\n * Delivers intermediate purple-line responses via onIntermediateResponse callback\n * so the user sees partial answers while Kiro continues with tools.\n * Only returns when the actual Kiro prompt appears or timeout.\n */\n private async pollForResponse(beforeSnapshot: string): Promise<string> {\n const startTime = Date.now();\n const maxWaitMs = this.maxWaitSec * 1000;\n let lastCapture = \"\";\n let stableCount = 0;\n let lastDeliveredAnswer = \"\";\n\n while (Date.now() - startTime < maxWaitMs) {\n const capture = this.capturePaneRaw();\n\n // Get only the NEW content (diff from before)\n const newContent = this.diffOutput(beforeSnapshot, capture);\n\n if (newContent.length === 0) {\n await sleep(2000);\n continue;\n }\n\n // Check if the last non-empty line is a Kiro prompt (N% >)\n const lines = capture.split(\"\\n\");\n const lastNonEmpty = this.getLastNonEmptyLine(lines);\n const lastClean = this.stripAnsi(lastNonEmpty);\n\n if (KIRO_PROMPT_RE.test(lastClean)) {\n const pctMatch = lastClean.match(/^(\\d+)%/);\n if (pctMatch) {\n this.lastContextPercent = parseInt(pctMatch[1]!, 10);\n logDebug(\"tmux\", `Context window: ${this.lastContextPercent}%`);\n }\n logDebug(\"tmux\", `Detected Kiro prompt: \"${lastClean}\"`);\n return this.extractResponse(newContent);\n }\n\n // Check for shell prompt as fallback\n if (SHELL_PROMPT_RE.test(lastClean) && newContent.length > 10) {\n logDebug(\"tmux\", `Detected shell prompt: \"${lastClean}\"`);\n return this.extractResponse(newContent);\n }\n\n // No prompt yet \u2014 deliver intermediate answer if we have new purple lines\n if (this.onIntermediateResponse && capture !== lastCapture) {\n const intermediateAnswer = this.extractAnswerOnly(newContent);\n if (intermediateAnswer && intermediateAnswer !== lastDeliveredAnswer) {\n const newPart = intermediateAnswer.startsWith(lastDeliveredAnswer)\n ? intermediateAnswer.slice(lastDeliveredAnswer.length).trim()\n : intermediateAnswer;\n if (newPart) {\n logDebug(\"tmux\", `Delivering intermediate chunk (${newPart.length} chars)`);\n this.onIntermediateResponse(newPart);\n lastDeliveredAnswer = intermediateAnswer;\n this.lastIntermediateDelivered = intermediateAnswer;\n }\n }\n }\n\n // Track stabilization but do NOT return on it \u2014 only N% > ends the poll\n if (capture === lastCapture) {\n stableCount++;\n } else {\n stableCount = 0;\n lastCapture = capture;\n }\n\n await sleep(2000);\n }\n\n // Timeout\n const finalCapture = this.capturePaneRaw();\n const finalNew = this.diffOutput(beforeSnapshot, finalCapture);\n if (finalNew.length > 0) {\n return this.extractResponse(finalNew) + \"\\n\\n\u23F1\uFE0F (response may be incomplete \u2014 timed out)\";\n }\n return \"\u23F1\uFE0F Kiro is still processing. Check the tmux session directly.\";\n }\n\n /**\n * Extract the meaningful response from the diff.\n * Removes the echoed user input line and Kiro's prompt lines.\n * Stores the \"answer only\" portion (lines that were \"> \" prefixed)\n * separately for TTS use.\n *\n * Kiro output format:\n * N% > <echoed user input>\n * > <response line 1>\n * > <response line 2>\n * \u25B8 Time: Ns\n * M% >\n */\n private lastAnswerOnly = \"\";\n private lastContextPercent = -1;\n\n /** Get just the Kiro answer lines (\"> \" prefixed) from the last response \u2014 for TTS. */\n get answerOnly(): string {\n return this.lastAnswerOnly;\n }\n get toolCallsSucceeded(): number { return 0; }\n\n /** Get the context window usage percentage from the last Kiro prompt (e.g. 10 for \"10% >\"). Returns -1 if unknown. */\n get contextPercent(): number {\n return this.lastContextPercent;\n }\n /** Get the cumulative text that was delivered via intermediate streaming. */\n get intermediateDeliveredText(): string {\n return this.lastIntermediateDelivered;\n }\n\n /** Extract just the purple \"> \" answer lines from raw tmux output (no side effects). */\n private extractAnswerOnly(raw: string): string {\n const PURPLE_PREFIX = /\\x1b\\[38;5;141m>\\s/;\n const lines = raw.split(\"\\n\");\n\n // Find last contiguous block of purple lines\n let blockStart = -1;\n for (let i = lines.length - 1; i >= 0; i--) {\n if (PURPLE_PREFIX.test(lines[i]!)) {\n blockStart = i;\n while (blockStart > 0 && PURPLE_PREFIX.test(lines[blockStart - 1]!)) blockStart--;\n break;\n }\n }\n if (blockStart < 0) return \"\";\n\n const answerLines: string[] = [];\n for (let i = blockStart; i < lines.length; i++) {\n const clean = this.stripAnsi(lines[i]!).trim();\n if (KIRO_PROMPT_RE.test(clean)) break;\n if (clean.startsWith(\"\u25B8 Time:\")) break;\n if (clean.startsWith(\"> \")) answerLines.push(clean.slice(2));\n else if (clean === \">\") answerLines.push(\"\");\n else if (clean === \"\") answerLines.push(\"\");\n else answerLines.push(clean);\n }\n return answerLines.join(\"\\n\").trim();\n }\n\n private extractResponse(raw: string): string {\n // ANSI color 141 (light purple) marks the \"> \" prefix on actual LLM response lines.\n // We detect these BEFORE stripping ANSI to reliably distinguish LLM output from\n // injected context (gray, color 245) and other noise.\n const PURPLE_PREFIX = /\\x1b\\[38;5;141m>\\s/;\n\n const lines = raw.split(\"\\n\");\n\n // First pass: identify lines that are genuine LLM responses (purple \"> \" prefix)\n const answerLines: string[] = [];\n let lastPurpleBlockStart = -1;\n\n for (let i = 0; i < lines.length; i++) {\n if (PURPLE_PREFIX.test(lines[i]!)) {\n if (lastPurpleBlockStart === -1) lastPurpleBlockStart = i;\n }\n }\n\n // Find the LAST contiguous block of purple \"> \" lines \u2014 that's the real answer.\n // Walk backwards to find the start of the last block.\n let blockStart = -1;\n for (let i = lines.length - 1; i >= 0; i--) {\n if (PURPLE_PREFIX.test(lines[i]!)) {\n blockStart = i;\n // Keep walking back through contiguous purple lines and continuation lines\n while (blockStart > 0) {\n const prev = lines[blockStart - 1]!;\n if (PURPLE_PREFIX.test(prev) || (!KIRO_PROMPT_RE.test(this.stripAnsi(prev).trim()) && !prev.includes(\"\u25B8 Time:\") && this.stripAnsi(prev).trim() !== \"\" && !PURPLE_PREFIX.test(prev) && blockStart === i)) {\n // Only extend back through purple lines\n if (PURPLE_PREFIX.test(prev)) {\n blockStart--;\n } else {\n break;\n }\n } else {\n break;\n }\n }\n break;\n }\n }\n\n if (blockStart >= 0) {\n // Extract from the last purple block to the end, stripping ANSI and \"> \" prefix\n for (let i = blockStart; i < lines.length; i++) {\n const line = lines[i]!;\n const clean = this.stripAnsi(line).trim();\n // Stop at Kiro prompt or Time summary\n if (KIRO_PROMPT_RE.test(clean)) break;\n if (clean.startsWith(\"\u25B8 Time:\") || clean.startsWith(\"\u25B8 Time:\")) break;\n if (clean === \"\") {\n answerLines.push(\"\");\n continue;\n }\n // Strip \"> \" prefix\n if (clean.startsWith(\"> \")) {\n answerLines.push(clean.slice(2));\n } else if (clean === \">\") {\n answerLines.push(\"\");\n } else {\n answerLines.push(clean);\n }\n }\n this.lastAnswerOnly = answerLines.join(\"\\n\").trim();\n } else {\n this.lastAnswerOnly = \"\";\n }\n\n // Full response: strip ANSI, then remove prompt lines and noise (legacy behavior)\n const cleaned = this.stripAnsi(raw);\n const allLines = cleaned.split(\"\\n\");\n const result: string[] = [];\n\n for (const line of allLines) {\n const trimmed = line.trim();\n if (result.length === 0 && trimmed === \"\") continue;\n if (KIRO_PROMPT_RE.test(trimmed)) continue;\n if (trimmed.startsWith(\"\u25B8 Time:\") || trimmed.startsWith(\"\u25B8 Time:\")) continue;\n if (/^-{4,}$/.test(trimmed)) continue;\n result.push(line);\n }\n\n const stripped = result.map((line) => {\n const trimmed = line.trimStart();\n if (trimmed.startsWith(\"> \")) return trimmed.slice(2);\n if (trimmed === \">\") return \"\";\n return line;\n });\n\n const final = stripped.join(\"\\n\").trim();\n logDebug(\"tmux\", `extractResponse: ${result.length} lines \u2192 \"${final.slice(0, 120)}\"`);\n if (this.lastAnswerOnly) {\n logDebug(\"tmux\", `answerOnly (${this.lastAnswerOnly.length} chars): \"${this.lastAnswerOnly.slice(0, 120)}\"`);\n }\n return final;\n }\n\n /** Get new content by diffing before/after snapshots. */\n private diffOutput(before: string, after: string): string {\n const beforeLines = before.split(\"\\n\");\n const afterLines = after.split(\"\\n\");\n\n // Find where the new content starts\n let commonPrefix = 0;\n while (\n commonPrefix < beforeLines.length &&\n commonPrefix < afterLines.length &&\n beforeLines[commonPrefix] === afterLines[commonPrefix]\n ) {\n commonPrefix++;\n }\n\n return afterLines.slice(commonPrefix).join(\"\\n\").trim();\n }\n\n /** Get the last non-empty line from an array. */\n private getLastNonEmptyLine(lines: string[]): string {\n for (let i = lines.length - 1; i >= 0; i--) {\n const trimmed = lines[i]!.trim();\n if (trimmed.length > 0) return trimmed;\n }\n return \"\";\n }\n\n /** Strip ANSI escape codes. */\n private stripAnsi(text: string): string {\n // eslint-disable-next-line no-control-regex\n return text.replace(/\\x1B\\[[0-9;]*[a-zA-Z]/g, \"\")\n .replace(/\\x1B\\][^\\x07]*\\x07/g, \"\"); // OSC sequences\n }\n\n private capturePaneRaw(): string {\n try {\n return this.exec(`tmux capture-pane -t ${this.sessionName} -p -e -S -2000`);\n } catch (err) {\n logAndSwallow(TAG, \"capturePaneRaw\", err);\n return \"\";\n }\n }\n\n private sessionExists(): boolean {\n try {\n this.exec(`tmux has-session -t ${this.sessionName}`);\n return true;\n } catch (err) {\n logAndSwallow(TAG, \"sessionExists check\", err);\n return false;\n }\n }\n\n private exec(command: string): string {\n return execSync(command, {\n encoding: \"utf-8\",\n timeout: 15_000,\n stdio: [\"pipe\", \"pipe\", \"pipe\"],\n }).trim();\n }\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAQA,SAAS,YAAAA,iBAAgB;;;ACLzB;AACA;AACA;AANA,SAAS,gBAAgB;AACzB,SAAS,eAAe,YAAY,iBAAiB;AACrD,SAAS,YAAY;AAMrB,IAAM,MAAM;AAIZ,IAAM,iBAAiB;AAGvB,IAAM,kBAAkB;AAOjB,IAAM,aAAN,MAA2C;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACT,QAAQ;AAAA;AAAA,EAGhB;AAAA;AAAA,EAGQ,4BAA4B;AAAA,EAEpC,YAAY,aAAqB,iBAAyB,YAAoB;AAC5E,SAAK,cAAc;AACnB,SAAK,kBAAkB;AACvB,SAAK,aAAa;AAAA,EACpB;AAAA,EAEA,MAAM,aAA4B;AAChC,QAAI,CAAC,KAAK,cAAc,GAAG;AACzB,YAAM,IAAI;AAAA,QACR,iBAA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ACA,QAAC,UAA2F,sBAAsB;AAClH,gBAAQ,QAAQ,kEAA2D,mBAAmB,MAAM,GAAG;AAAA,MACzG;AAAA,IACF;AAAA,EACF;AAEA,MAAI,gBAAgB,WAAW;AAC7B,QAAI,oBAAmC;AACvC,IAAC,UAAkG,aAAa,CAAC,OAAO,QAAQ,WAAW;AACzI,YAAM,YAAY,SAAS,KAAK,MAAM,MAAM;AAC5C,YAAM,MAAM,kBAAa,SAAS,KAAK,KAAK,GAAG,UAAU,IAAI,WAAW,MAAM,OAAO,EAAE;AACvF,cAAQ,QAAQ,GAAG;AAGnB,UAAI,UAAU,mBAAmB;AAC/B,4BAAoB;AACpB,eAAO,4BAA+B,EAAE,KAAK,CAAC,EAAE,iBAAiB,MAAM,iBAAiB,KAAK,GAAG,CAAC,EAAE,MAAM,SAAO,cAAcA,MAAK,6BAA6B,GAAG,CAAC;AAAA,MACtK;AAAA,IACF;AAEA,QAAI,uBAAuB,WAAW;AACpC,MAAC,UAA2D,oBAAoB,MAAM;AACpF,4BAAoB;AAAA,MACtB;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAMA,eAAsB,iBAAiB,KAAoC;AACzE,UAAQ,QAAQ,mCAA4B;AAC5C,QAAM,eAAe,GAAG;AACxB,MAAI,IAAI,gBAAgB,IAAI,WAAW;AACrC,IAAC,IAAI,aAA+C,YAAY,IAAI;AAAA,EACtE;AACA,MAAI,IAAI,YAAY,IAAI,WAAW;AACjC,IAAC,IAAI,SAAsD,YAAY,IAAI;AAAA,EAC7E;AACA,UAAQ,QAAQ,0BAAqB;AACrC,SAAO;AACT;",
6
+ "names": ["execSync", "TAG", "abtarsHome", "execSync", "join"]
7
+ }
@@ -2,60 +2,60 @@
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
  getDelegationTools
5
- } from "./chunk-4UL3KINB.js";
5
+ } from "./chunk-5PNJFDSW.js";
6
6
  import {
7
7
  guardrails_exports,
8
8
  init_guardrails
9
- } from "./chunk-URQPDCK5.js";
9
+ } from "./chunk-Q66LQMMZ.js";
10
10
  import {
11
11
  init_seatbelt,
12
12
  seatbelt_exports
13
13
  } from "./chunk-VOLAZHA2.js";
14
- import {
15
- getOrcTools,
16
- init_orc_tools
17
- } from "./chunk-XWRADSXO.js";
18
14
  import {
19
15
  artifactAttachTool,
20
16
  artifactPullTool,
21
17
  artifactPushTool,
22
18
  init_artifact_tools
23
- } from "./chunk-ONBF5DDU.js";
19
+ } from "./chunk-L72RIPEC.js";
24
20
  import {
25
21
  auditDeny,
26
22
  checkPath,
27
23
  checkTool
28
- } from "./chunk-WBTJ2E62.js";
24
+ } from "./chunk-P3NODAHF.js";
29
25
  import {
30
26
  abmind
31
- } from "./chunk-IKUZPMVA.js";
27
+ } from "./chunk-YJZE4OK3.js";
32
28
  import {
33
29
  bumpRead,
34
30
  setProvenance
35
- } from "./chunk-TEFZ4JA4.js";
31
+ } from "./chunk-NHPLD3C7.js";
36
32
  import {
37
33
  channelPost,
38
34
  channelRead,
39
35
  init_kanban_channel
40
- } from "./chunk-KTYGKPYM.js";
36
+ } from "./chunk-2NLUT5S2.js";
41
37
  import {
42
- getPeerTransport,
43
- init_peer_transport
44
- } from "./chunk-5GCLBUBS.js";
38
+ getOrcTools,
39
+ init_orc_tools
40
+ } from "./chunk-GF6NVNA7.js";
45
41
  import {
46
42
  getMasterUserId,
47
43
  init_master_user
48
- } from "./chunk-AFREM7FX.js";
44
+ } from "./chunk-CK7YTA2F.js";
45
+ import {
46
+ getPeerTransport,
47
+ init_peer_transport
48
+ } from "./chunk-SFL4EPCZ.js";
49
49
  import {
50
50
  init_kanban_board,
51
51
  kanbanEnqueue,
52
52
  kanbanList,
53
53
  kanbanUpdate
54
- } from "./chunk-EQSG2CRM.js";
54
+ } from "./chunk-FGYDIX54.js";
55
55
  import {
56
56
  init_log_and_swallow,
57
57
  logAndSwallow
58
- } from "./chunk-YSKCQH6E.js";
58
+ } from "./chunk-2IYJ4I66.js";
59
59
  import {
60
60
  init_logger,
61
61
  logDebug,
@@ -63,7 +63,7 @@ import {
63
63
  logTrace,
64
64
  logWarn,
65
65
  redactSecrets
66
- } from "./chunk-GWILHZPT.js";
66
+ } from "./chunk-XRTXYN66.js";
67
67
  import {
68
68
  abtarsHome,
69
69
  init_paths
@@ -413,26 +413,30 @@ var peerDelegateTool = {
413
413
  required: ["goal"]
414
414
  },
415
415
  async execute(args) {
416
+ const { isActiveCardPeerSourced } = await import("./orc-tools-UZVPONKY.js");
417
+ if (await isActiveCardPeerSourced()) {
418
+ return JSON.stringify({ error: "Relaying to other peers is not permitted for peer-originated requests. Peers communicate directly.", reason: "peer_relay_blocked" });
419
+ }
416
420
  const { goal, priority, context } = args;
417
421
  let peer = args.peer;
418
422
  const requires = args.requires ? typeof args.requires === "string" ? JSON.parse(args.requires) : args.requires : [];
419
423
  const artifacts = args.artifacts ? JSON.parse(args.artifacts) : void 0;
420
424
  if (!goal) return JSON.stringify({ error: "goal is required" });
421
425
  if (!peer && requires.length > 0) {
422
- const { findCapablePeer } = await import("./gossip-3C3BSNPN.js");
426
+ const { findCapablePeer } = await import("./gossip-SKRCPOBS.js");
423
427
  const match = findCapablePeer(requires);
424
428
  if (!match) return JSON.stringify({ error: `No alive peer with capabilities: [${requires.join(", ")}]` });
425
429
  peer = match.name;
426
430
  logDebug(TAG3, `Auto-selected peer ${peer} for requires=[${requires.join(",")}] (load=${match.load})`);
427
431
  } else if (!peer) {
428
- const { getPeerTable } = await import("./gossip-3C3BSNPN.js");
432
+ const { getPeerTable } = await import("./gossip-SKRCPOBS.js");
429
433
  const alive = getPeerTable().sort((a, b) => a.load - b.load);
430
434
  if (alive.length === 0) return JSON.stringify({ error: "No alive peers available" });
431
435
  peer = alive[0].name;
432
436
  logDebug(TAG3, `Auto-selected least-loaded peer ${peer} (load=${alive[0].load})`);
433
437
  }
434
438
  if (requires.length > 0 && args.peer) {
435
- const { getPeerTable } = await import("./gossip-3C3BSNPN.js");
439
+ const { getPeerTable } = await import("./gossip-SKRCPOBS.js");
436
440
  const entry = getPeerTable(true).find((p) => p.name.toLowerCase() === peer.toLowerCase());
437
441
  if (entry && !requires.every((r) => entry.capabilities.includes(r))) {
438
442
  const missing = requires.filter((r) => !entry.capabilities.includes(r));
@@ -450,8 +454,8 @@ var peerDelegateTool = {
450
454
  notes: JSON.stringify({ peer, remote_task_id: remoteTaskId, remote_session_id: remoteSessionId, goal, requires })
451
455
  });
452
456
  if (remoteSessionId) {
453
- const { spin } = await import("./spin-TI3TSVVT.js");
454
- const { getMasterUserId: getMasterUserId2 } = await import("./master-user-HSKM4ZFN.js");
457
+ const { spin } = await import("./spin-VHNGNWTD.js");
458
+ const { getMasterUserId: getMasterUserId2 } = await import("./master-user-MUBUP3KD.js");
455
459
  spin.createHollowSession(getMasterUserId2(), "telegram", "W", peer, remoteSessionId);
456
460
  }
457
461
  logInfo(TAG3, `Delegated to ${peer}: remote#${remoteTaskId} \u2192 local#${localCardId}`);
@@ -871,7 +875,7 @@ var memoryRecallTool = {
871
875
  try {
872
876
  const t0 = Date.now();
873
877
  const userId = context?.userId ?? getMasterUserId();
874
- const { loadUsers } = await import("./user-registry-35BW4XKM.js");
878
+ const { loadUsers } = await import("./user-registry-4PACZJIJ.js");
875
879
  const userEntry = loadUsers().byUserId.get(userId);
876
880
  const result = await memoryBackend.recall({
877
881
  translated: [args["query"] ?? ""],
@@ -880,7 +884,7 @@ var memoryRecallTool = {
880
884
  limit: parseInt(args["limit"] ?? "10", 10),
881
885
  maxClassification: userEntry?.maxClass ?? 1
882
886
  });
883
- import("./metrics-collector-L3VPEHII.js").then(({ recordLatency }) => recordLatency("recall", Date.now() - t0)).catch(() => {
887
+ import("./metrics-collector-YMUGY3PI.js").then(({ recordLatency }) => recordLatency("recall", Date.now() - t0)).catch(() => {
884
888
  });
885
889
  return JSON.stringify(result);
886
890
  } catch (err) {
@@ -1047,8 +1051,12 @@ var peerSessionTool = {
1047
1051
  required: ["peer_name", "message"]
1048
1052
  },
1049
1053
  async execute(args) {
1050
- const { callPeer } = await import("./peer-client-RGEU5HOK.js");
1051
- const { loadPeerConfig } = await import("./peer-config-TN55LFDC.js");
1054
+ const { isActiveCardPeerSourced } = await import("./orc-tools-UZVPONKY.js");
1055
+ if (await isActiveCardPeerSourced()) {
1056
+ return JSON.stringify({ error: "Relaying to other peers is not permitted for peer-originated requests. Peers communicate directly.", reason: "peer_relay_blocked" });
1057
+ }
1058
+ const { callPeer } = await import("./peer-client-UITTMWJ2.js");
1059
+ const { loadPeerConfig } = await import("./peer-config-URM7DCW6.js");
1052
1060
  const { getOrCreateSession, addTurn, isEnded, destroySession } = await import("./peer-sessions-MY2YVXHC.js");
1053
1061
  const peerName = args.peer_name?.trim();
1054
1062
  const message = args.message?.trim();
@@ -1087,15 +1095,19 @@ var peerWakeupTool = {
1087
1095
  required: ["peer_name"]
1088
1096
  },
1089
1097
  async execute(args) {
1090
- const { sendWakeup } = await import("./dns-wakeup-IDOJIXBX.js");
1091
- const { loadPeerConfig } = await import("./peer-config-TN55LFDC.js");
1098
+ const { isActiveCardPeerSourced } = await import("./orc-tools-UZVPONKY.js");
1099
+ if (await isActiveCardPeerSourced()) {
1100
+ return JSON.stringify({ error: "Relaying to other peers is not permitted for peer-originated requests. Peers communicate directly.", reason: "peer_relay_blocked" });
1101
+ }
1102
+ const { sendWakeup } = await import("./dns-wakeup-V3LEFXPE.js");
1103
+ const { loadPeerConfig } = await import("./peer-config-URM7DCW6.js");
1092
1104
  const peerName = args.peer_name?.trim();
1093
1105
  if (!peerName) return JSON.stringify({ error: "peer_name required" });
1094
1106
  const config = loadPeerConfig();
1095
1107
  const peer = config.peers[peerName];
1096
1108
  if (!peer) return JSON.stringify({ error: `Unknown peer: ${peerName}` });
1097
1109
  const udpPort = peer.udpPort ?? 5353;
1098
- sendWakeup(config.self.name, peer.host, udpPort, peer.token);
1110
+ sendWakeup(config.self.name, peer.host, udpPort);
1099
1111
  return JSON.stringify({ ok: true, message: `Wake-up sent to ${peerName}. Expect callback within seconds.` });
1100
1112
  }
1101
1113
  };
@@ -1212,4 +1224,4 @@ export {
1212
1224
  getToolSchemas,
1213
1225
  executeToolCall
1214
1226
  };
1215
- //# sourceMappingURL=chunk-W4EA4GCA.js.map
1227
+ //# sourceMappingURL=chunk-ITOFPJAV.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/components/transport/tool-registry.ts", "../src/components/transport/skill-authoring.ts", "../src/components/transport/mcp-tool.ts", "../src/components/transport/peer-delegation-tools.ts", "../src/components/transport/kanban-tool.ts", "../src/components/transport/channel-tool.ts"],
4
+ "sourcesContent": ["/**\n * Tool registry for DirectApiTransport.\n * Phase 2: native tool schemas. Phase 3: in-process memory when available.\n */\n\nimport { execFile } from \"node:child_process\";\nimport { appendFileSync, mkdirSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { homedir } from \"node:os\";\nimport type { MemoryBackend } from \"abmind\";\nimport type { InstantStoreParams } from \"../../types/index.js\";\nimport { logWarn, redactSecrets } from \"../logger.js\";\nimport { logAndSwallow } from \"../log-and-swallow.js\";\nimport { checkTool, checkPath, auditDeny, type SandboxPolicy } from \"../tool-sandbox.js\";\nimport { getMasterUserId } from \"../master-user.js\";\n\nconst TAG = \"tool_registry\";\n\n// #449: append-only audit log\nconst AUDIT_DIR = join(process.env[\"ABTARS_HOME\"] ?? join(homedir(), \".abtars\"), \"logs\");\nconst AUDIT_PATH = join(AUDIT_DIR, \"audit.jsonl\");\ntry { mkdirSync(AUDIT_DIR, { recursive: true }); } catch (err) { logAndSwallow(TAG, \"mkdirSync audit dir\", err); }\nfunction audit(entry: Record<string, unknown>): void {\n try { appendFileSync(AUDIT_PATH, JSON.stringify(entry) + \"\\n\"); } catch (err) { logAndSwallow(TAG, \"audit write\", err); }\n}\n\nexport type ToolDefinition = {\n readonly name: string;\n readonly description: string;\n readonly parameters: Record<string, unknown>;\n execute(args: Record<string, string>, context?: { userId: string; signal?: AbortSignal }): Promise<string>;\n};\n\nconst BASH_TIMEOUT_MS = 300_000;\nconst CLI_TIMEOUT_MS = 60_000;\n\n// #1266: when no in-process memory backend is wired, return this error\n// rather than silently shelling out to a CLI on PATH we don't trust.\nconst MEMORY_BACKEND_ERROR = \"memory backend not initialized \u2014 abmind failed to load or below supported floor\";\n\n/**\n * Patterns that would spawn or restart a bridge/watchdog process.\n * Blocked to prevent the LLM (especially fallback models) from accidentally\n * starting a second bridge instance, which would cause port conflicts,\n * Telegram 409 errors, and bridge.lock PID confusion.\n *\n * See post-mortem of 2026-04-22 outage: cron agent ran execute_bash that\n * spawned a rogue bridge alongside the watchdog-supervised one.\n */\nconst BLOCKED_PATTERNS: readonly RegExp[] = [\n /\\bmain\\.js\\b/, // node .../current/dist/main.js ...\n /\\babtars\\.sh\\b/, // the launcher\n /\\bwatchdog\\.sh\\b/, // the watchdog\n /\\blaunchctl\\s+(load|bootstrap|kickstart|start)\\b/, // launchd bridge start\n];\n\nexport function isBridgeSpawnCommand(cmd: string): boolean {\n return BLOCKED_PATTERNS.some(p => p.test(cmd));\n}\n\n/** Block kill/pkill/killall targeting the bridge's own PID or process patterns (#414). */\nfunction isBridgeKillCommand(cmd: string): boolean {\n const pid = process.pid;\n const ppid = process.ppid;\n // Direct kill of own PID or parent\n if (new RegExp(`\\\\bkill\\\\s+(-\\\\d+\\\\s+)?${pid}\\\\b`).test(cmd)) return true;\n if (new RegExp(`\\\\bkill\\\\s+(-\\\\d+\\\\s+)?${ppid}\\\\b`).test(cmd)) return true;\n // pkill/killall targeting bridge patterns\n if (/\\b(pkill|killall)\\b.*\\b(abtars|main\\.js|watchdog)\\b/.test(cmd)) return true;\n if (/\\bkill\\b.*\\$\\(.*pgrep.*abtars/.test(cmd)) return true;\n return false;\n}\n\nfunction runBash(cmd: string, timeout = BASH_TIMEOUT_MS, signal?: AbortSignal): Promise<string> {\n // Guardrails: command check\n const { checkCommand, classifyCommand } = require(\"../guardrails.js\") as typeof import(\"../guardrails.js\");\n const cmdBlock = checkCommand(cmd);\n if (cmdBlock) {\n logWarn(\"tool-registry\", `Guardrails blocked: ${cmd.slice(0, 200)}`);\n return Promise.resolve(JSON.stringify({ stderr: cmdBlock, exit_code: 126 }));\n }\n\n // Action gate: auth-required commands\n const tier = classifyCommand(cmd);\n if (tier === \"auth-required\" && _actionGate) {\n return _actionGate.requestAuth(\"bash-auth\", cmd).then((granted) => {\n if (!granted) {\n logWarn(\"tool-registry\", `Auth denied for: ${cmd.slice(0, 200)}`);\n return JSON.stringify({ stderr: \"Command requires authorization. Master denied or timed out.\", exit_code: 126 });\n }\n return executeBash(cmd, timeout, signal);\n });\n }\n\n if (isBridgeSpawnCommand(cmd)) {\n logWarn(\"tool-registry\", `Blocked bridge-spawn command: ${cmd.slice(0, 200)}`);\n return Promise.resolve(JSON.stringify({\n stderr: \"Command blocked: this would spawn/restart a bridge or watchdog process. The bridge is already running under launchd+watchdog supervision; use launchctl inspection commands (launchctl list, launchctl print) or signal the existing process instead.\",\n exit_code: 126,\n }));\n }\n if (isBridgeKillCommand(cmd)) {\n logWarn(\"tool-registry\", `Blocked bridge-kill command: ${cmd.slice(0, 200)}`);\n return Promise.resolve(JSON.stringify({\n stderr: \"Command blocked: this would kill the bridge process (yourself). Ask the user to send /restart for a session reset or restart the bridge manually.\",\n exit_code: 126,\n }));\n }\n return executeBash(cmd, timeout, signal);\n}\n\nlet _seatbeltActive = false;\nlet _seatbeltPolicy: import(\"../seatbelt/policy.js\").SeatbeltPolicy | null = null;\n\n/** Wire seatbelt for OS-level command sandboxing (#906). */\nexport function setSeatbelt(active: boolean, policy?: import(\"../seatbelt/policy.js\").SeatbeltPolicy): void {\n _seatbeltActive = active;\n _seatbeltPolicy = policy ?? null;\n}\n\nfunction executeBash(cmd: string, timeout: number, signal?: AbortSignal): Promise<string> {\n return new Promise((resolve) => {\n let bin = \"bash\";\n let args = [\"-c\", cmd];\n\n // #906: Wrap in OS sandbox if seatbelt active and command needs sandboxing\n if (_seatbeltActive && _seatbeltPolicy) {\n const { shouldSandbox, wrapCommand } = require(\"../seatbelt/index.js\") as typeof import(\"../seatbelt/index.js\");\n if (shouldSandbox(cmd)) {\n const wrapped = wrapCommand(cmd, _seatbeltPolicy);\n bin = wrapped.bin;\n args = wrapped.args;\n }\n }\n\n const child = execFile(bin, args, { timeout, maxBuffer: 1024 * 1024 }, (err, stdout, stderr) => {\n const result: Record<string, unknown> = {};\n if (stdout) result[\"stdout\"] = stdout.slice(0, 50_000);\n if (stderr) result[\"stderr\"] = stderr.slice(0, 10_000);\n if (err) result[\"exit_code\"] = (err as NodeJS.ErrnoException & { code?: number }).code ?? 1;\n else result[\"exit_code\"] = 0;\n resolve(JSON.stringify(result));\n });\n if (signal) {\n if (signal.aborted) { child.kill(\"SIGTERM\"); return; }\n const onAbort = (): void => {\n child.kill(\"SIGTERM\");\n // #1003: escalate to SIGKILL if child doesn't exit within 3s\n setTimeout(() => { try { child.kill(\"SIGKILL\"); } catch {} }, 3000);\n };\n signal.addEventListener(\"abort\", onAbort, { once: true });\n child.on(\"exit\", () => signal.removeEventListener(\"abort\", onAbort));\n }\n });\n}\n\nlet memoryBackend: MemoryBackend | null = null;\n\n/** Wire in-process memory backend. Call once after memory init. */\nexport function setMemoryBackend(backend: MemoryBackend | null): void {\n memoryBackend = backend;\n}\n\nlet _actionGate: import(\"../action-gate.js\").ActionGate | null = null;\n\n/** Wire action gate for auth-required commands. */\nexport function setActionGate(gate: import(\"../action-gate.js\").ActionGate | null): void {\n _actionGate = gate;\n}\n\nlet _peerActivityCb: ((msg: string) => void) | null = null;\n\n/** Wire peer activity notification callback. */\nexport function setPeerActivityCallback(cb: ((msg: string) => void) | null): void {\n _peerActivityCb = cb;\n}\n\n// --- Tool definitions ---\n\nconst bashTool: ToolDefinition = {\n name: \"execute_bash\",\n description: \"Execute a bash command. Use for file operations, git, running scripts, and any shell command. Commands that would spawn or restart a bridge/watchdog process (node main.js, abtars.sh, abtars-watchdog.sh, launchctl load/bootstrap/kickstart/start) are blocked \u2014 the bridge is already supervised.\",\n parameters: {\n type: \"object\",\n properties: { command: { type: \"string\", description: \"The bash command to execute\" } },\n required: [\"command\"],\n },\n execute: (args, context) => runBash(args[\"command\"] ?? \"\", BASH_TIMEOUT_MS, context?.signal),\n};\n\nlet _storeCount = 0;\nconst STORE_CAP = 20;\n\n/** Reset store counter (called on new subagent session). */\nexport function resetStoreCounter(): void { _storeCount = 0; }\n\nconst memoryStoreTool: ToolDefinition = {\n name: \"memory_store\",\n description: \"Store a memory. Use after learning something about the user, their preferences, decisions, or facts worth remembering.\",\n parameters: {\n type: \"object\",\n properties: {\n translated: { type: \"string\", description: \"Memory content in English\" },\n original: { type: \"string\", description: \"Memory content in original language (if not English)\" },\n type: { type: \"string\", enum: [\"fact\", \"preference\", \"decision\", \"experience\", \"skill\", \"relationship\", \"goal\"], description: \"Memory type\" },\n emotion: { type: \"integer\", description: \"Emotion score -5 to +5 (0=neutral)\" },\n confidence: { type: \"integer\", description: \"Confidence 1-5 (3=default)\" },\n classification: { type: \"integer\", description: \"0=public (general knowledge), 1=internal (default), 2=confidential (personal preferences, habits, opinions about specific users), 3=secret (credentials, API keys, tokens, passwords \u2014 store IMMEDIATELY with exact string, never paraphrase, never wait for Dreamy)\" },\n },\n required: [\"translated\", \"type\"],\n },\n async execute(args, context): Promise<string> {\n if (++_storeCount > STORE_CAP) {\n return JSON.stringify({ stored: false, error: \"Store limit reached for this session. Move to next task.\" });\n }\n if (memoryBackend) {\n try {\n const params: InstantStoreParams = {\n userId: context?.userId ?? getMasterUserId(),\n contentEn: args[\"translated\"] ?? \"\",\n contentOriginal: args[\"original\"] ?? args[\"translated\"] ?? \"\",\n memoryType: (args[\"type\"] ?? \"fact\") as InstantStoreParams[\"memoryType\"],\n emotionScore: parseInt(args[\"emotion\"] ?? \"0\", 10),\n confidence: parseInt(args[\"confidence\"] ?? \"3\", 10),\n classification: parseInt(args[\"classification\"] ?? \"1\", 10),\n };\n const result = await memoryBackend.instantStore({ ...params, createdBy: \"tool:memory_store\" });\n return JSON.stringify(result);\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n // #706: FTS5 corruption self-heal \u2014 rebuild indexes and retry once\n if (msg.includes(\"fts5\") || msg.includes(\"corruption\")) {\n try {\n memoryBackend.rebuildFtsIndexes();\n logWarn(\"tool-registry\", \"FTS corruption detected \u2014 rebuilt indexes, retrying store\");\n const params: InstantStoreParams = {\n userId: context?.userId ?? getMasterUserId(),\n contentEn: args[\"translated\"] ?? \"\",\n contentOriginal: args[\"original\"] ?? args[\"translated\"] ?? \"\",\n memoryType: (args[\"type\"] ?? \"fact\") as InstantStoreParams[\"memoryType\"],\n emotionScore: parseInt(args[\"emotion\"] ?? \"0\", 10),\n confidence: parseInt(args[\"confidence\"] ?? \"3\", 10),\n classification: parseInt(args[\"classification\"] ?? \"1\", 10),\n };\n const result = await memoryBackend.instantStore({ ...params, createdBy: \"tool:memory_store\" });\n return JSON.stringify(result);\n } catch (retryErr) { /* fall through */ }\n }\n return JSON.stringify({ error: msg });\n }\n }\n return JSON.stringify({ error: MEMORY_BACKEND_ERROR });\n },\n};\n\nconst memoryRecallTool: ToolDefinition = {\n name: \"memory_recall\",\n description: \"Search memories by keyword or semantic query. Returns relevant stored memories.\",\n parameters: {\n type: \"object\",\n properties: {\n query: { type: \"string\", description: \"Search query\" },\n limit: { type: \"integer\", description: \"Max results (default 10)\" },\n },\n required: [\"query\"],\n },\n async execute(args, context): Promise<string> {\n if (memoryBackend) {\n try {\n const t0 = Date.now();\n const userId = context?.userId ?? getMasterUserId();\n const { loadUsers } = await import(\"../user-registry.js\");\n const userEntry = loadUsers().byUserId.get(userId);\n const result = await memoryBackend.recall({\n translated: [args[\"query\"] ?? \"\"],\n original: args[\"query\"] ?? \"\",\n userId,\n limit: parseInt(args[\"limit\"] ?? \"10\", 10),\n maxClassification: userEntry?.maxClass ?? 1,\n });\n import(\"../metrics-collector.js\").then(({ recordLatency }) => recordLatency(\"recall\", Date.now() - t0)).catch(() => {});\n return JSON.stringify(result);\n } catch (err) {\n return JSON.stringify({ error: err instanceof Error ? err.message : String(err) });\n }\n }\n return JSON.stringify({ error: MEMORY_BACKEND_ERROR });\n },\n};\n\nconst memoryEditTool: ToolDefinition = {\n name: \"memory_edit\",\n description: \"Edit an existing memory by ID. Change content, type, emotion, confidence, or classification.\",\n parameters: {\n type: \"object\",\n properties: {\n memory_id: { type: \"integer\", description: \"Memory ID to edit\" },\n translated: { type: \"string\", description: \"New English content\" },\n original: { type: \"string\", description: \"New original language content\" },\n type: { type: \"string\", description: \"New memory type\" },\n emotion: { type: \"integer\", description: \"New emotion score\" },\n confidence: { type: \"integer\", description: \"New confidence\" },\n classification: { type: \"integer\", description: \"New classification\" },\n caller: { type: \"string\", enum: [\"kp\", \"dreamy\"], description: \"Who is making the edit\" },\n },\n required: [\"memory_id\"],\n },\n async execute(args): Promise<string> {\n if (memoryBackend) {\n try {\n const result = await memoryBackend.editMemory({\n memoryId: parseInt(args[\"memory_id\"] ?? \"0\", 10),\n contentEn: args[\"translated\"],\n contentOriginal: args[\"original\"],\n memoryType: args[\"type\"] as \"fact\" | \"decision\" | \"preference\" | \"event\" | undefined,\n emotionScore: args[\"emotion\"] ? parseInt(args[\"emotion\"], 10) : undefined,\n confidence: args[\"confidence\"] ? parseInt(args[\"confidence\"], 10) : undefined,\n classification: args[\"classification\"] ? parseInt(args[\"classification\"], 10) : undefined,\n caller: (args[\"caller\"] ?? \"kp\") as \"kp\" | \"dreamy\",\n });\n return JSON.stringify(result);\n } catch (err) {\n return JSON.stringify({ error: err instanceof Error ? err.message : String(err) });\n }\n }\n return JSON.stringify({ error: MEMORY_BACKEND_ERROR });\n },\n};\n\nconst webBrowseTool: ToolDefinition = {\n name: \"web_browse\",\n description: \"Browse a URL or perform a complex multi-step web task. For quick lookups use execute_bash with curl.\",\n parameters: {\n type: \"object\",\n properties: {\n task: { type: \"string\", description: \"What to do on the web\" },\n chat_id: { type: \"string\", description: \"Chat ID for result delivery\" },\n engine: { type: \"string\", enum: [\"cloakbrowser\"], description: \"Browser engine (default: cloakbrowser)\" },\n },\n required: [\"task\", \"chat_id\"],\n },\n execute: (args) => {\n let cmd = `abtars-browse --task ${JSON.stringify(args[\"task\"] ?? \"\")} --chat-id ${args[\"chat_id\"] ?? \"0\"}`;\n if (args[\"engine\"]) cmd += ` --engine ${args[\"engine\"]}`;\n return runBash(cmd, CLI_TIMEOUT_MS);\n },\n};\n\nconst todoTool: ToolDefinition = {\n name: \"todo_manage\",\n description: \"Manage TODO items. Add, complete, or list tasks.\",\n parameters: {\n type: \"object\",\n properties: {\n action: { type: \"string\", enum: [\"add\", \"done\", \"list\", \"remove\"], description: \"Action to perform\" },\n text: { type: \"string\", description: \"TODO text (for add)\" },\n id: { type: \"string\", description: \"TODO ID (for done/remove)\" },\n },\n required: [\"action\"],\n },\n execute: (args) => {\n const action = args[\"action\"] ?? \"list\";\n if (action === \"add\") return runBash(`abtars-todo add ${JSON.stringify(args[\"text\"] ?? \"\")}`, CLI_TIMEOUT_MS);\n if (action === \"done\") return runBash(`abtars-todo done ${args[\"id\"] ?? \"\"}`, CLI_TIMEOUT_MS);\n if (action === \"remove\") return runBash(`abtars-todo remove ${args[\"id\"] ?? \"\"}`, CLI_TIMEOUT_MS);\n return runBash(\"abtars-todo list\", CLI_TIMEOUT_MS);\n },\n};\n\nlet _enqueueCron: ((id: string, manual?: boolean) => string | null) | null = null;\n\n/** Inject enqueueCron from bridge for task_manage --run. */\nexport function setEnqueueCron(fn: (id: string, manual?: boolean) => string | null): void { _enqueueCron = fn; }\n\nlet _ircSend: ((channel: string, message: string) => void) | null = null;\n\n/** Inject IRC send from bridge for irc_send tool. */\nexport function setIrcSend(fn: (channel: string, message: string) => void): void { _ircSend = fn; }\n\n/** @deprecated \u2014 secret_get now reads from file, not DB. Kept for backward compat (callers may still call this). */\n\nlet _sendDocument: ((path: string, caption?: string) => Promise<number>) | null = null;\n\n/**\n * Inject sendDocument from bridge for the send_document tool.\n * Caller binds main chat id + telegram adapter; tool is a thin wrapper around that.\n */\nexport function setSendDocument(fn: ((path: string, caption?: string) => Promise<number>) | null): void { _sendDocument = fn; }\n\nconst sendDocumentTool: ToolDefinition = {\n name: \"send_document\",\n description: \"Send a file from disk to the user's Telegram chat. Use for delivering reports, daily summaries, logs, or any .md file the user asks for. Do not summarize \u2014 the raw file is sent as an attachment.\",\n parameters: {\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Absolute path to the file\" },\n caption: { type: \"string\", description: \"Optional short caption (\u22641024 chars)\" },\n },\n required: [\"path\"],\n },\n execute: async (args) => {\n const path = args[\"path\"];\n if (!path) return JSON.stringify({ error: \"path is required\" });\n if (!_sendDocument) return JSON.stringify({ error: \"Telegram not configured (sendDocument unavailable)\" });\n try {\n const messageId = await _sendDocument(path, args[\"caption\"]);\n return JSON.stringify({ ok: true, message_id: messageId });\n } catch (err) {\n return JSON.stringify({ error: err instanceof Error ? err.message : String(err) });\n }\n },\n};\n\nconst taskTool: ToolDefinition = {\n name: \"task_manage\",\n description: \"Manage scheduled/recurring tasks (cron). Add, list, remove, pause, resume, or run tasks. Use action=run to execute a task immediately via the cron queue (isolated subagent).\",\n parameters: {\n type: \"object\",\n properties: {\n action: { type: \"string\", enum: [\"add\", \"list\", \"remove\", \"pause\", \"resume\", \"run\"], description: \"Action\" },\n message: { type: \"string\", description: \"Task message/command (for add)\" },\n schedule: { type: \"string\", description: \"Cron schedule expression (for add)\" },\n type: { type: \"string\", enum: [\"reminder\", \"script\", \"agent\"], description: \"Task type (for add)\" },\n chat_id: { type: \"string\", description: \"Chat ID (for add)\" },\n id: { type: \"string\", description: \"Task ID (for remove/pause/resume/run)\" },\n },\n required: [\"action\"],\n },\n execute: (args) => {\n const action = args[\"action\"] ?? \"list\";\n if (action === \"list\") return runBash(\"abtars-task list\", CLI_TIMEOUT_MS);\n if (action === \"remove\") return runBash(`abtars-task remove ${args[\"id\"] ?? \"\"}`, CLI_TIMEOUT_MS);\n if (action === \"pause\") return runBash(`abtars-task pause ${args[\"id\"] ?? \"\"}`, CLI_TIMEOUT_MS);\n if (action === \"resume\") return runBash(`abtars-task resume ${args[\"id\"] ?? \"\"}`, CLI_TIMEOUT_MS);\n if (action === \"run\") {\n if (!_enqueueCron) return Promise.resolve(JSON.stringify({ error: \"enqueueCron not available\" }));\n const err = _enqueueCron(args[\"id\"] ?? \"\", true);\n return Promise.resolve(JSON.stringify(err ? { error: err } : { ok: true, message: `Task ${args[\"id\"]} enqueued for immediate execution` }));\n }\n let cmd = `abtars-task add --message ${JSON.stringify(args[\"message\"] ?? \"\")}`;\n if (args[\"schedule\"]) cmd += ` --schedule ${JSON.stringify(args[\"schedule\"])}`;\n if (args[\"type\"]) cmd += ` --type ${args[\"type\"]}`;\n if (args[\"chat_id\"]) cmd += ` --chat-id ${args[\"chat_id\"]}`;\n return runBash(cmd, CLI_TIMEOUT_MS);\n },\n};\n\nconst peerSessionTool: ToolDefinition = {\n name: \"peer_session\",\n description: \"Open or continue a peer-to-peer session with another agent. Messages persist across turns. Use only when the user explicitly asks to contact another agent.\",\n parameters: {\n type: \"object\",\n properties: {\n peer_name: { type: \"string\", description: \"Name of the peer (as in peers.json)\" },\n message: { type: \"string\", description: \"Your message to the peer\" },\n session_id: { type: \"string\", description: \"Session ID from previous call (omit for new conversation)\" },\n },\n required: [\"peer_name\", \"message\"],\n },\n async execute(args) {\n // #1301 \u2014 no relay: a peer-originated request must never make us call a third peer.\n const { isActiveCardPeerSourced } = await import(\"./orc-tools.js\");\n if (await isActiveCardPeerSourced()) {\n return JSON.stringify({ error: \"Relaying to other peers is not permitted for peer-originated requests. Peers communicate directly.\", reason: \"peer_relay_blocked\" });\n }\n const { callPeer } = await import(\"../peer-client.js\");\n const { loadPeerConfig } = await import(\"../peer-config.js\");\n const { getOrCreateSession, addTurn, isEnded, destroySession } = await import(\"../peer-sessions.js\");\n\n const peerName = args.peer_name?.trim();\n const message = args.message?.trim();\n if (!peerName || !message) return JSON.stringify({ error: \"peer_name and message required\" });\n\n const config = loadPeerConfig();\n if (peerName === config.self.name) return JSON.stringify({ error: \"Cannot chat with yourself\" });\n if (!config.peers[peerName]) return JSON.stringify({ error: `Unknown peer: ${peerName}` });\n\n const session = getOrCreateSession(args.session_id?.trim() || undefined, peerName);\n\n // Check turn cap before sending\n if (session.messages.length >= 20) {\n destroySession(session.id);\n return JSON.stringify({ session_id: session.id, response: \"[SESSION_END] Turn limit reached.\", ended: true, reason: \"max-turns\" });\n }\n\n addTurn(session, \"user\", message);\n\n // Build full conversation for peer (OpenAI messages format)\n const prompt = session.messages.map(m => `${m.role === \"user\" ? \"You\" : \"Peer\"}: ${m.content}`).join(\"\\n\") + \"\\n\\nRespond to the latest message.\";\n\n try {\n const response = await callPeer(peerName, prompt, config.maxHops);\n addTurn(session, \"assistant\", response);\n _peerActivityCb?.(`\uD83E\uDD16 Agents: ${config.self.name} \u2194 ${peerName} session. [turn ${session.messages.length}]`);\n\n const { ended, reason } = isEnded(session, response);\n if (ended) destroySession(session.id);\n\n return JSON.stringify({ session_id: session.id, response, ended, reason });\n } catch (err) {\n destroySession(session.id);\n return JSON.stringify({ error: `peer_session failed: ${err instanceof Error ? err.message : String(err)}`, session_id: session.id, ended: true });\n }\n },\n};\n\nconst peerWakeupTool: ToolDefinition = {\n name: \"peer_wakeup\",\n description: \"Send a wake-up signal to a peer that cannot reach us directly (firewall). The peer's bridge will call us back via A2A within seconds.\",\n parameters: {\n type: \"object\",\n properties: {\n peer_name: { type: \"string\", description: \"Name of the peer to wake up (as in peers.json)\" },\n },\n required: [\"peer_name\"],\n },\n async execute(args) {\n // #1301 \u2014 no relay: a peer-originated request must never wake/reach a third peer via us.\n const { isActiveCardPeerSourced } = await import(\"./orc-tools.js\");\n if (await isActiveCardPeerSourced()) {\n return JSON.stringify({ error: \"Relaying to other peers is not permitted for peer-originated requests. Peers communicate directly.\", reason: \"peer_relay_blocked\" });\n }\n const { sendWakeup } = await import(\"../dns-wakeup.js\");\n const { loadPeerConfig } = await import(\"../peer-config.js\");\n const peerName = args.peer_name?.trim();\n if (!peerName) return JSON.stringify({ error: \"peer_name required\" });\n const config = loadPeerConfig();\n const peer = config.peers[peerName];\n if (!peer) return JSON.stringify({ error: `Unknown peer: ${peerName}` });\n const udpPort = peer.udpPort ?? 5353;\n sendWakeup(config.self.name, peer.host, udpPort);\n return JSON.stringify({ ok: true, message: `Wake-up sent to ${peerName}. Expect callback within seconds.` });\n },\n};\n\nconst ircSendTool: ToolDefinition = {\n name: \"irc_send\",\n description: \"Send a message to an IRC channel (e.g. #bridges)\",\n parameters: {\n channel: { type: \"string\", description: \"IRC channel (e.g. #bridges)\" },\n message: { type: \"string\", description: \"Message text to send\" },\n },\n execute: async (args) => {\n if (!_ircSend) return JSON.stringify({ error: \"IRC adapter not connected\" });\n const channel = args[\"channel\"] ?? \"\";\n const message = args[\"message\"] ?? \"\";\n if (!channel || !message) return JSON.stringify({ error: \"channel and message are required\" });\n _ircSend(channel, message);\n return JSON.stringify({ ok: true, channel, sent: message.length + \" chars\" });\n },\n};\n\nconst secretGetTool: ToolDefinition = {\n name: \"secret_get\",\n description: \"Retrieve a secret from ~/.abtars/secret/. For env-var secrets (no extension), returns the value. For files (with extension like .json), returns the full decrypted content. NEVER echo the value to the user.\",\n parameters: {\n properties: {\n name: { type: \"string\", description: \"Exact filename in secret/ dir (e.g. 'OPENROUTER_API_KEY', 'x-cookies.json')\" },\n },\n required: [\"name\"],\n },\n execute: async (args) => {\n const name = args.name?.trim();\n if (!name) return JSON.stringify({ error: \"name is required\" });\n try {\n const { readSecret } = await import(\"../../components/secrets.js\");\n const value = readSecret(name);\n if (value === undefined) return JSON.stringify({ error: `secret '${name}' not found or could not be decrypted` });\n\n // For env-var type (no extension): also inject into process.env\n if (!name.includes(\".\")) {\n process.env[name] = value;\n return JSON.stringify({ ok: true, env_var: `$${name}`, hint: `Use $${name} in commands. NEVER print or echo the value.` });\n }\n return JSON.stringify({ ok: true, content: value });\n } catch (err) {\n return JSON.stringify({ error: `secret_get failed: ${err instanceof Error ? err.message : String(err)}` });\n }\n },\n};\n\nimport { skillCreateTool, skillUpdateTool, skillPatchTool, skillRemoveTool } from \"./skill-authoring.js\";\nimport { mcpTool } from \"./mcp-tool.js\";\nimport { getDelegationTools } from \"./delegation-tools.js\";\nimport { getPeerDelegationTools } from \"./peer-delegation-tools.js\";\nimport { getOrcTools } from \"./orc-tools.js\";\nimport { kanbanTool } from \"./kanban-tool.js\";\nimport { channelPostTool, channelReadTool } from \"./channel-tool.js\";\nimport { artifactPushTool, artifactPullTool, artifactAttachTool } from \"./artifact-tools.js\";\n\nconst ALL_TOOLS: ToolDefinition[] = [bashTool, memoryStoreTool, memoryRecallTool, memoryEditTool, webBrowseTool, todoTool, taskTool, sendDocumentTool, peerSessionTool, peerWakeupTool, ircSendTool, secretGetTool, skillCreateTool, skillUpdateTool, skillPatchTool, skillRemoveTool, mcpTool, kanbanTool, channelPostTool, channelReadTool, artifactAttachTool, ...getDelegationTools(), ...getPeerDelegationTools(), ...getOrcTools()];\n\n// Conditional: artifact store tools (#929)\nif (process.env[\"ARTIFACT_S3_ENDPOINT\"]) {\n ALL_TOOLS.push(artifactPushTool, artifactPullTool);\n}\n\nexport function getToolDefinitions(): ToolDefinition[] { return ALL_TOOLS; }\n\nexport function getToolSchemas(policy?: SandboxPolicy): Array<{ type: \"function\"; function: { name: string; description: string; parameters: Record<string, unknown> } }> {\n const tools = policy ? ALL_TOOLS.filter(t => checkTool(t.name, policy).allowed) : ALL_TOOLS;\n return tools.map(t => ({\n type: \"function\" as const,\n function: { name: t.name, description: t.description, parameters: t.parameters },\n }));\n}\n\nimport { bumpRead } from \"../skill-stats.js\";\n\n/** Check if a bash command result indicates a skill file was read. */\nfunction checkSkillRead(toolName: string, args: Record<string, string>): void {\n if (toolName !== \"execute_bash\") return;\n const cmd = args[\"command\"] ?? \"\";\n if (cmd.includes(\"/.abtars/skills/\") && cmd.includes(\"/SKILL.md\")) {\n const match = cmd.match(/\\/.abtars\\/skills\\/[^/]+\\/([^/]+)\\/SKILL\\.md/);\n if (match) bumpRead(match[1]!);\n }\n}\n\nexport async function executeToolCall(name: string, args: Record<string, string>, context?: { userId: string; signal?: AbortSignal; sandboxPolicy?: SandboxPolicy }): Promise<string> {\n // Sandbox enforcement\n if (context?.sandboxPolicy) {\n const toolCheck = checkTool(name, context.sandboxPolicy);\n if (!toolCheck.allowed) {\n const available = ALL_TOOLS.filter(t => checkTool(t.name, context.sandboxPolicy!).allowed).map(t => t.name);\n auditDeny(name, undefined, \"session\", toolCheck.reason!);\n return JSON.stringify({ error: `Tool '${name}' not available in this session`, available_tools: available, reason: \"peer_sandbox\" });\n }\n const filePath = args[\"path\"] ?? args[\"file_path\"];\n if (filePath) {\n const mode = name.includes(\"read\") || name === \"memory_recall\" ? \"read\" as const : \"write\" as const;\n const pathCheck = checkPath(filePath, mode, context.sandboxPolicy);\n if (!pathCheck.allowed) {\n auditDeny(name, filePath, \"session\", pathCheck.reason!);\n return JSON.stringify({ error: pathCheck.reason, reason: \"peer_sandbox\" });\n }\n }\n }\n\n const tool = ALL_TOOLS.find(t => t.name === name);\n if (!tool) return JSON.stringify({ error: `Unknown tool: ${name}` });\n const ts = Date.now();\n\n // #621: redact abmind_store args based on classification\n const storeClass = (name === \"abmind_store\" || name === \"memory_store\") ? parseInt(args.classification ?? args.class ?? \"1\", 10) : 0;\n const auditArgs = storeClass >= 2\n ? `{\"class\":${storeClass},\"[REDACTED]\":true}`\n : redactSecrets(JSON.stringify(args));\n audit({ ts, tool: name, args: auditArgs, userId: context?.userId });\n\n try {\n const result = await tool.execute(args, context);\n audit({ ts, tool: name, status: \"ok\", chars: result.length });\n checkSkillRead(name, args);\n return result;\n } catch (err) {\n audit({ ts, tool: name, status: \"error\", error: err instanceof Error ? err.message : String(err) });\n throw err;\n }\n}\n", "/**\n * skill-authoring.ts \u2014 skill lifecycle tools (#381, #613, #614).\n * Agent persists procedural knowledge as skills under ~/.abtars/skills/self/.\n */\n\nimport { existsSync, mkdirSync, writeFileSync, readFileSync, renameSync, appendFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { abmind } from \"../../utils/abmind-lazy.js\";\nimport { abtarsHome } from \"../../paths.js\";\nimport { logInfo } from \"../logger.js\";\nimport { logAndSwallow } from \"../log-and-swallow.js\";\nimport { setProvenance } from \"../skill-stats.js\";\nimport type { ToolDefinition } from \"./tool-registry.js\";\n\nconst TAG = \"skill-authoring\";\nconst NAME_RE = /^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$/;\nconst MIN_BYTES = 100;\nconst MAX_BYTES = 50_000;\nconst MAX_TAGS = 5;\n\nfunction skillsDir(): string { return join(abtarsHome(), \"skills\"); }\nfunction selfDir(): string { return join(skillsDir(), \"self\"); }\nfunction trashDir(): string { return join(skillsDir(), \".trash\"); }\nfunction auditLogPath(): string { return join(abtarsHome(), \"logs\", \"skill-authoring.log\"); }\n\nfunction audit(entry: string): void {\n const line = `[${new Date().toISOString()}] ${entry}\\n`;\n try {\n const dir = join(abtarsHome(), \"logs\");\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n appendFileSync(auditLogPath(), line);\n } catch (err) { logAndSwallow(TAG, \"audit write\", err); }\n}\n\nfunction validate(name: string, description: string, content: string): string | null {\n if (!NAME_RE.test(name)) return `Invalid name \"${name}\". Must be 3-64 chars, lowercase alphanumeric + hyphens, no leading/trailing hyphens.`;\n const desc = description.trim();\n if (desc.length < 1 || desc.length > 120) return `Description must be 1-120 chars (got ${desc.length}).`;\n const bytes = Buffer.byteLength(content, \"utf-8\");\n if (bytes < MIN_BYTES) return `Content too short (${bytes} bytes, minimum ${MIN_BYTES}). Write a useful skill, not a one-liner.`;\n if (bytes > MAX_BYTES) return `Content too large (${bytes} bytes, maximum ${MAX_BYTES}). Split into a skill + references/ files.`;\n const path = join(selfDir(), name, \"SKILL.md\");\n if (existsSync(path)) return `Skill \"${name}\" already exists. Use skill_update to modify it.`;\n const scan = abmind()?.scanForInjection(content);\n if (scan && !scan.safe) return `Content blocked by injection scanner: ${scan.flags[0]?.category ?? \"unknown\"} (score=${scan.score}). Rephrase the content.`;\n return null;\n}\n\n/** Parse YAML-like frontmatter from SKILL.md content. */\nfunction parseFrontmatter(raw: string): { meta: Record<string, unknown>; body: string } {\n const match = raw.match(/^---\\n([\\s\\S]*?)\\n---\\n\\n?([\\s\\S]*)$/);\n if (!match) return { meta: {}, body: raw };\n const meta: Record<string, unknown> = {};\n for (const line of match[1]!.split(\"\\n\")) {\n const idx = line.indexOf(\":\");\n if (idx < 0) continue;\n const key = line.slice(0, idx).trim();\n let val: unknown = line.slice(idx + 1).trim();\n // Parse array: [a, b, c]\n if (typeof val === \"string\" && val.startsWith(\"[\") && val.endsWith(\"]\")) {\n val = val.slice(1, -1).split(\",\").map(s => s.trim()).filter(Boolean);\n }\n meta[key] = val;\n }\n return { meta, body: match[2]! };\n}\n\n/** Serialize frontmatter fields back to YAML-like string. */\nfunction serializeFrontmatter(meta: Record<string, unknown>): string {\n const lines: string[] = [\"---\"];\n for (const [k, v] of Object.entries(meta)) {\n if (v === undefined || v === null) continue;\n if (Array.isArray(v) && v.length > 0) {\n lines.push(`${k}: [${v.join(\", \")}]`);\n } else if (!Array.isArray(v)) {\n lines.push(`${k}: ${v}`);\n }\n }\n lines.push(\"---\\n\\n\");\n return lines.join(\"\\n\");\n}\n\n/** Guard: skill must exist in self/ dir. Returns error string or null. */\nfunction guardSelfSkill(name: string): string | null {\n if (!NAME_RE.test(name)) return `Invalid name \"${name}\".`;\n const path = join(selfDir(), name, \"SKILL.md\");\n if (!existsSync(path)) return `Skill \"${name}\" not found in self/.`;\n return null;\n}\n\nexport const skillCreateTool: ToolDefinition = {\n name: \"skill_create\",\n description: \"Persist a new procedural skill to disk. Use when you've solved a novel task, discovered a workflow, or received a correction worth remembering as a repeatable recipe. Skills become available in future sessions via the skills_catalog.\",\n parameters: {\n type: \"object\",\n properties: {\n name: { type: \"string\", description: \"Skill identifier, kebab-case, e.g. 'fix-stale-node-modules'. 3-64 chars, [a-z0-9-]+.\" },\n description: { type: \"string\", description: \"One-line description, max 120 chars. Shown in skills_catalog.\" },\n content: { type: \"string\", description: \"Skill body in Markdown. Starts with # <Title>. No frontmatter \u2014 the tool writes it.\" },\n tags: { type: \"array\", items: { type: \"string\" }, description: \"Optional tags for categorization (max 5). E.g. ['tools', 'browser', 'debugging'].\" },\n related: { type: \"array\", items: { type: \"string\" }, description: \"Optional related skill names.\" },\n },\n required: [\"name\", \"description\", \"content\"],\n },\n async execute(args) {\n const { name, description, content, tags, related } = args as unknown as { name: string; description: string; content: string; tags?: string[]; related?: string[] };\n const error = validate(name, description, content);\n if (error) {\n audit(`skill_create name=${name} bytes=${content.length} ok=false error=\"${error}\"`);\n return JSON.stringify({ error });\n }\n\n const tagList = (tags ?? []).slice(0, MAX_TAGS).map(t => t.toLowerCase().trim()).filter(Boolean);\n const relList = (related ?? []).filter(Boolean);\n const tagsLine = tagList.length > 0 ? `tags: [${tagList.join(\", \")}]\\n` : \"\";\n const relatedLine = relList.length > 0 ? `related: [${relList.join(\", \")}]\\n` : \"\";\n const frontmatter = `---\\nname: ${name}\\ndescription: ${description.trim()}\\n${tagsLine}${relatedLine}---\\n\\n`;\n const fullContent = frontmatter + content;\n const dir = join(selfDir(), name);\n const filePath = join(dir, \"SKILL.md\");\n const tmpPath = filePath + \".tmp\";\n\n try {\n mkdirSync(dir, { recursive: true });\n writeFileSync(tmpPath, fullContent, \"utf-8\");\n renameSync(tmpPath, filePath);\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n audit(`skill_create name=${name} bytes=${content.length} ok=false error=\"write failed: ${msg}\"`);\n return JSON.stringify({ error: `Write failed: ${msg}` });\n }\n\n setProvenance(name, \"agent\");\n audit(`skill_create name=${name} tags=[${tagList.join(\",\")}] bytes=${content.length} ok=true`);\n logInfo(TAG, `Created skill: self/${name} (${content.length} bytes)`);\n return JSON.stringify({ ok: true, path: filePath, message: `Skill \"${name}\" created in self/. Available in skills_catalog after /skill reload.` });\n },\n};\n\nexport const skillUpdateTool: ToolDefinition = {\n name: \"skill_update\",\n description: \"Full rewrite of an existing skill's SKILL.md in self/. Preserves frontmatter fields (tags, related, description) when omitted by caller.\",\n parameters: {\n type: \"object\",\n properties: {\n name: { type: \"string\", description: \"Skill name (must exist in self/).\" },\n description: { type: \"string\", description: \"New description (optional \u2014 keeps existing if omitted).\" },\n content: { type: \"string\", description: \"New skill body in Markdown (no frontmatter).\" },\n tags: { type: \"array\", items: { type: \"string\" }, description: \"New tags (optional \u2014 keeps existing if omitted).\" },\n related: { type: \"array\", items: { type: \"string\" }, description: \"New related skills (optional \u2014 keeps existing if omitted).\" },\n },\n required: [\"name\", \"content\"],\n },\n async execute(args) {\n const { name, content, description, tags, related } = args as unknown as { name: string; content: string; description?: string; tags?: string[]; related?: string[] };\n const guard = guardSelfSkill(name);\n if (guard) { audit(`skill_update name=${name} ok=false error=\"${guard}\"`); return JSON.stringify({ error: guard }); }\n\n const bytes = Buffer.byteLength(content, \"utf-8\");\n if (bytes < MIN_BYTES) return JSON.stringify({ error: `Content too short (${bytes} bytes, minimum ${MIN_BYTES}).` });\n if (bytes > MAX_BYTES) return JSON.stringify({ error: `Content too large (${bytes} bytes, maximum ${MAX_BYTES}).` });\n\n const scan = abmind()?.scanForInjection(content);\n if (scan && !scan.safe) return JSON.stringify({ error: `Content blocked by injection scanner: ${scan.flags[0]?.category ?? \"unknown\"}.` });\n\n const filePath = join(selfDir(), name, \"SKILL.md\");\n const existing = readFileSync(filePath, \"utf-8\");\n const { meta } = parseFrontmatter(existing);\n\n // Merge: caller fields override, omitted fields preserved\n const merged: Record<string, unknown> = { ...meta, name };\n if (description !== undefined) merged[\"description\"] = description.trim();\n if (tags !== undefined) merged[\"tags\"] = tags.slice(0, MAX_TAGS).map(t => t.toLowerCase().trim()).filter(Boolean);\n if (related !== undefined) merged[\"related\"] = related.filter(Boolean);\n\n const fullContent = serializeFrontmatter(merged) + content;\n const tmpPath = filePath + \".tmp\";\n try {\n writeFileSync(tmpPath, fullContent, \"utf-8\");\n renameSync(tmpPath, filePath);\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n audit(`skill_update name=${name} ok=false error=\"write failed: ${msg}\"`);\n return JSON.stringify({ error: `Write failed: ${msg}` });\n }\n\n audit(`skill_update name=${name} bytes=${bytes} ok=true`);\n logInfo(TAG, `Updated skill: self/${name} (${bytes} bytes)`);\n return JSON.stringify({ ok: true, path: filePath, message: `Skill \"${name}\" updated.` });\n },\n};\n\nexport const skillPatchTool: ToolDefinition = {\n name: \"skill_patch\",\n description: \"Targeted find-and-replace within a skill's SKILL.md in self/. old_string must match exactly once.\",\n parameters: {\n type: \"object\",\n properties: {\n name: { type: \"string\", description: \"Skill name (must exist in self/).\" },\n old_string: { type: \"string\", description: \"Exact string to find (must match once).\" },\n new_string: { type: \"string\", description: \"Replacement string.\" },\n },\n required: [\"name\", \"old_string\", \"new_string\"],\n },\n async execute(args) {\n const { name, old_string, new_string } = args as unknown as { name: string; old_string: string; new_string: string };\n const guard = guardSelfSkill(name);\n if (guard) { audit(`skill_patch name=${name} ok=false error=\"${guard}\"`); return JSON.stringify({ error: guard }); }\n\n const filePath = join(selfDir(), name, \"SKILL.md\");\n const existing = readFileSync(filePath, \"utf-8\");\n\n const count = existing.split(old_string).length - 1;\n if (count === 0) return JSON.stringify({ error: `old_string not found in skill \"${name}\".` });\n if (count > 1) return JSON.stringify({ error: `old_string matches ${count} times \u2014 must match exactly once.` });\n\n const patched = existing.replace(old_string, new_string);\n const scan = abmind()?.scanForInjection(patched);\n if (scan && !scan.safe) return JSON.stringify({ error: `Patched content blocked by injection scanner: ${scan.flags[0]?.category ?? \"unknown\"}.` });\n\n const tmpPath = filePath + \".tmp\";\n try {\n writeFileSync(tmpPath, patched, \"utf-8\");\n renameSync(tmpPath, filePath);\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n audit(`skill_patch name=${name} ok=false error=\"write failed: ${msg}\"`);\n return JSON.stringify({ error: `Write failed: ${msg}` });\n }\n\n audit(`skill_patch name=${name} ok=true`);\n logInfo(TAG, `Patched skill: self/${name}`);\n return JSON.stringify({ ok: true, path: filePath, message: `Skill \"${name}\" patched.` });\n },\n};\n\nexport const skillRemoveTool: ToolDefinition = {\n name: \"skill_remove\",\n description: \"Soft-delete a skill from self/ by moving it to .trash/ (recoverable for 7 days).\",\n parameters: {\n type: \"object\",\n properties: {\n name: { type: \"string\", description: \"Skill name (must exist in self/).\" },\n },\n required: [\"name\"],\n },\n async execute(args) {\n const { name } = args as unknown as { name: string };\n const guard = guardSelfSkill(name);\n if (guard) { audit(`skill_remove name=${name} ok=false error=\"${guard}\"`); return JSON.stringify({ error: guard }); }\n\n const srcDir = join(selfDir(), name);\n const ts = Date.now();\n const destDir = join(trashDir(), `${name}-${ts}`);\n try {\n mkdirSync(trashDir(), { recursive: true });\n renameSync(srcDir, destDir);\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n audit(`skill_remove name=${name} ok=false error=\"move failed: ${msg}\"`);\n return JSON.stringify({ error: `Move failed: ${msg}` });\n }\n\n audit(`skill_remove name=${name} dest=${destDir} ok=true`);\n logInfo(TAG, `Removed skill: self/${name} \u2192 .trash/`);\n return JSON.stringify({ ok: true, message: `Skill \"${name}\" moved to .trash/. Will be pruned after 7 days.` });\n },\n};\n", "/**\n * mcp-tool.ts \u2014 Generic MCP tool (#471 v2).\n * Single tool that routes to any mcporter server/tool. Daemon starts on-demand.\n */\n\nimport { execFile } from \"node:child_process\";\nimport { promisify } from \"node:util\";\nimport { logInfo, logWarn } from \"../logger.js\";\nimport { logAndSwallow } from \"../log-and-swallow.js\";\nimport type { ToolDefinition } from \"./tool-registry.js\";\n\nconst execFileAsync = promisify(execFile);\nconst TAG = \"mcp\";\nlet daemonStarted = false;\n\nasync function ensureDaemon(): Promise<void> {\n if (daemonStarted) return;\n try {\n await execFileAsync(\"mcporter\", [\"daemon\", \"start\"], { timeout: 10_000 });\n daemonStarted = true;\n logInfo(TAG, \"mcporter daemon started (on-demand)\");\n } catch {\n logWarn(TAG, \"mcporter daemon start failed \u2014 calls may still work if already running\");\n daemonStarted = true; // don't retry every call \u2014 assume already running\n }\n}\n\nexport const mcpTool: ToolDefinition = {\n name: \"mcp\",\n description: \"Call an MCP server tool via mcporter. Available servers shown by /mcp command. Use when you need JIRA, presentations, or other MCP-connected services.\",\n parameters: {\n type: \"object\",\n properties: {\n server: { type: \"string\", description: \"Server name (e.g. 'pptx', 'atlassian')\" },\n tool: { type: \"string\", description: \"Tool name (e.g. 'jira_search', 'create_presentation')\" },\n args: { type: \"string\", description: \"Tool arguments as JSON string (e.g. '{\\\"query\\\": \\\"assignee = me\\\"}')\" },\n },\n required: [\"server\", \"tool\"],\n },\n async execute(params) {\n await ensureDaemon();\n const { server, tool, args } = params as { server: string; tool: string; args?: string };\n const cliArgs = [\"call\", `${server}.${tool}`];\n if (args) {\n try {\n const parsed = JSON.parse(args) as Record<string, string>;\n for (const [k, v] of Object.entries(parsed)) cliArgs.push(`${k}=${v}`);\n } catch (err) {\n logAndSwallow(TAG, \"JSON.parse mcp args\", err);\n cliArgs.push(args);\n }\n }\n try {\n const { stdout } = await execFileAsync(\"mcporter\", cliArgs, { timeout: 30_000, encoding: \"utf-8\" });\n return stdout;\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n return JSON.stringify({ error: `mcp call failed: ${msg}` });\n }\n },\n};\n", "/**\n * peer-delegation-tools.ts \u2014 peer_delegate, peer_check, peer_terminate (#675).\n *\n * Remote delegation tools for the Orc. Uses PeerTransport to call\n * remote peers' /v1/tasks endpoints. Results tracked in local kanban\n * with type=\"remote\" and meta JSON for peer + remote_task_id.\n */\n\nimport type { ToolDefinition } from \"./tool-registry.js\";\nimport { getPeerTransport } from \"../peer-transport/index.js\";\nimport { kanbanEnqueue } from \"../tasks/kanban-board.js\";\nimport { logInfo, logWarn, logDebug, logTrace } from \"../logger.js\";\n\nconst TAG = \"peer-delegate\";\n\nexport const peerDelegateTool: ToolDefinition = {\n name: \"peer_delegate\",\n description: \"Delegate a task to a remote peer. If peer is omitted, auto-selects the best capable peer by load. Use 'requires' to specify needed capabilities (gpu, docker, ollama, browser, xcode).\",\n parameters: {\n type: \"object\",\n properties: {\n peer: { type: \"string\", description: \"Peer name (optional \u2014 auto-selects if omitted)\" },\n goal: { type: \"string\", description: \"Task goal/instructions for the remote peer\" },\n priority: { type: \"string\", enum: [\"CRITICAL\", \"HIGH\", \"MEDIUM\", \"LOW\"], description: \"Task priority (default: MEDIUM)\" },\n context: { type: \"string\", description: \"Optional context to include\" },\n requires: { type: \"array\", items: { type: \"string\" }, description: \"Required capabilities (e.g. ['gpu', 'docker'])\" },\n artifacts: { type: \"string\", description: \"JSON array of {name, content} objects (base64-encoded files to send)\" },\n },\n required: [\"goal\"],\n },\n async execute(args: Record<string, string>): Promise<string> {\n // #1301 \u2014 no relay: a peer-originated request must never delegate onward to a third peer via us.\n const { isActiveCardPeerSourced } = await import(\"./orc-tools.js\");\n if (await isActiveCardPeerSourced()) {\n return JSON.stringify({ error: \"Relaying to other peers is not permitted for peer-originated requests. Peers communicate directly.\", reason: \"peer_relay_blocked\" });\n }\n const { goal, priority, context } = args;\n let peer = args.peer;\n const requires: string[] = args.requires ? (typeof args.requires === \"string\" ? JSON.parse(args.requires) : args.requires) : [];\n const artifacts: Array<{ name: string; content: string }> | undefined = args.artifacts ? JSON.parse(args.artifacts) : undefined;\n\n if (!goal) return JSON.stringify({ error: \"goal is required\" });\n\n // Auto-select peer if not specified\n if (!peer && requires.length > 0) {\n const { findCapablePeer } = await import(\"../peer-transport/gossip.js\");\n const match = findCapablePeer(requires);\n if (!match) return JSON.stringify({ error: `No alive peer with capabilities: [${requires.join(\", \")}]` });\n peer = match.name;\n logDebug(TAG, `Auto-selected peer ${peer} for requires=[${requires.join(\",\")}] (load=${match.load})`);\n } else if (!peer) {\n // No peer, no requires \u2014 pick least loaded\n const { getPeerTable } = await import(\"../peer-transport/gossip.js\");\n const alive = getPeerTable().sort((a, b) => a.load - b.load);\n if (alive.length === 0) return JSON.stringify({ error: \"No alive peers available\" });\n peer = alive[0]!.name;\n logDebug(TAG, `Auto-selected least-loaded peer ${peer} (load=${alive[0]!.load})`);\n }\n\n // Validate capabilities if requires specified + explicit peer\n if (requires.length > 0 && args.peer) {\n const { getPeerTable } = await import(\"../peer-transport/gossip.js\");\n const entry = getPeerTable(true).find(p => p.name.toLowerCase() === peer!.toLowerCase());\n if (entry && !requires.every(r => entry.capabilities.includes(r))) {\n const missing = requires.filter(r => !entry.capabilities.includes(r));\n return JSON.stringify({ error: `Peer ${peer} lacks capabilities: [${missing.join(\", \")}]` });\n }\n }\n\n logDebug(TAG, `peer_delegate: peer=${peer} priority=${priority ?? \"MEDIUM\"} goal=${goal.length}ch requires=[${requires.join(\",\")}]`);\n logTrace(TAG, `peer_delegate goal: ${goal.slice(0, 500)}`);\n\n try {\n const transport = getPeerTransport();\n const { taskId: remoteTaskId, remoteSessionId } = await transport.delegateTask(peer, goal, { priority, context, artifacts });\n\n const localCardId = kanbanEnqueue(`[remote:${peer}] ${goal.slice(0, 80)}`, \"peer\", undefined, {\n type: \"remote\",\n priority: priority ?? \"MEDIUM\",\n notes: JSON.stringify({ peer, remote_task_id: remoteTaskId, remote_session_id: remoteSessionId, goal, requires }),\n });\n\n // #949: Create hollow session to track remote worker locally\n if (remoteSessionId) {\n const { spin } = await import(\"../spin.js\");\n const { getMasterUserId } = await import(\"../master-user.js\");\n spin.createHollowSession(getMasterUserId(), \"telegram\", \"W\", peer, remoteSessionId);\n }\n\n logInfo(TAG, `Delegated to ${peer}: remote#${remoteTaskId} \u2192 local#${localCardId}`);\n return JSON.stringify({ ok: true, local_card_id: localCardId, remote_task_id: remoteTaskId, remote_session_id: remoteSessionId, peer, status: \"queued\" });\n } catch (err) {\n logWarn(TAG, `peer_delegate failed: ${err instanceof Error ? err.message : String(err)}`);\n return JSON.stringify({ error: `peer_delegate failed: ${err instanceof Error ? err.message : String(err)}` });\n }\n },\n};\n\nexport const peerCheckTool: ToolDefinition = {\n name: \"peer_check\",\n description: \"Check the status of a task delegated to a remote peer. Returns status and result if complete.\",\n parameters: {\n type: \"object\",\n properties: {\n peer: { type: \"string\", description: \"Peer name\" },\n task_id: { type: \"number\", description: \"Remote task ID (from peer_delegate result)\" },\n },\n required: [\"peer\", \"task_id\"],\n },\n async execute(args: Record<string, string>): Promise<string> {\n const peer = args.peer;\n const taskId = parseInt(args.task_id ?? \"\", 10);\n if (!peer || isNaN(taskId)) return JSON.stringify({ error: \"peer and task_id are required\" });\n\n try {\n const transport = getPeerTransport();\n const result = await transport.checkTask(peer, taskId);\n return JSON.stringify({ ok: true, ...result });\n } catch (err) {\n logWarn(TAG, `peer_check failed: ${err instanceof Error ? err.message : String(err)}`);\n return JSON.stringify({ error: `peer_check failed: ${err instanceof Error ? err.message : String(err)}` });\n }\n },\n};\n\nexport const peerTerminateTool: ToolDefinition = {\n name: \"peer_terminate\",\n description: \"Cancel/terminate a task running on a remote peer.\",\n parameters: {\n type: \"object\",\n properties: {\n peer: { type: \"string\", description: \"Peer name\" },\n task_id: { type: \"number\", description: \"Remote task ID to terminate\" },\n },\n required: [\"peer\", \"task_id\"],\n },\n async execute(args: Record<string, string>): Promise<string> {\n const peer = args.peer;\n const taskId = parseInt(args.task_id ?? \"\", 10);\n if (!peer || isNaN(taskId)) return JSON.stringify({ error: \"peer and task_id are required\" });\n\n try {\n const transport = getPeerTransport();\n await transport.terminateTask(peer, taskId);\n logInfo(TAG, `Terminated remote task ${taskId} on ${peer}`);\n return JSON.stringify({ ok: true, terminated: true, peer, task_id: taskId });\n } catch (err) {\n logWarn(TAG, `peer_terminate failed: ${err instanceof Error ? err.message : String(err)}`);\n return JSON.stringify({ error: `peer_terminate failed: ${err instanceof Error ? err.message : String(err)}` });\n }\n },\n};\n\nexport function getPeerDelegationTools(): ToolDefinition[] {\n return [peerDelegateTool, peerCheckTool, peerTerminateTool];\n}\n", "/**\n * kanban-tool.ts \u2014 Agent-facing tool for managing the kanban board.\n */\n\nimport type { ToolDefinition } from \"./tool-registry.js\";\nimport { kanbanEnqueue, kanbanUpdate, kanbanList, type KanbanCard } from \"../tasks/kanban-board.js\";\n\nfunction formatCard(c: KanbanCard): string {\n const icon = c.status === \"delivered\" ? \"*\" : c.status === \"done\" ? \"*\" : c.status === \"running\" ? \"~\" : c.status === \"failed\" ? \"x\" : \"+\";\n const due = c.due_at ? ` due:${c.due_at}` : \"\";\n const lbl = c.labels ? ` [${c.labels}]` : \"\";\n const deps = c.blocked_by ? ` <- #${c.blocked_by}` : \"\";\n const tokens = c.tokens_used ? ` ${c.tokens_used} tok` : \"\";\n const source = c.type === \"remote\" ? (() => { try { return ` [${JSON.parse(c.notes ?? \"{}\").peer}]`; } catch { return \" [remote]\"; } })() : \"\";\n return `${icon} #${c.id} ${c.title} (${c.priority}/${c.status})${tokens}${source}${due}${lbl}${deps}`;\n}\n\nasync function execute(args: Record<string, string>): Promise<string> {\n const action = args.action;\n\n if (action === \"create\") {\n if (!args.title) return \"[err] title required\";\n const id = kanbanEnqueue(args.title, args.source || \"agent\", undefined, {\n priority: args.priority,\n type: args.type,\n labels: args.labels,\n due_at: args.due_at,\n parent_id: args.parent_id ? parseInt(args.parent_id, 10) : undefined,\n notes: args.notes,\n blocked_by: args.blocked_by || undefined,\n });\n return `+ Card #${id} created: \"${args.title}\"${args.blocked_by ? ` (blocked_by: ${args.blocked_by})` : \"\"}`;\n }\n\n if (action === \"update\") {\n if (!args.id) return \"[err] id required\";\n const fields: Record<string, unknown> = {};\n for (const k of [\"title\", \"status\", \"priority\", \"type\", \"labels\", \"due_at\", \"notes\", \"approval\"] as const) {\n if (args[k]) fields[k] = args[k];\n }\n if (args.parent_id) fields.parent_id = parseInt(args.parent_id, 10);\n kanbanUpdate(parseInt(args.id, 10), fields as any);\n return `* Card #${args.id} updated`;\n }\n\n if (action === \"list\") {\n const cards = kanbanList(args.status || undefined);\n if (cards.length === 0) return \"Board is empty\";\n return `Kanban Board (${cards.length}):\\n` + cards.map(formatCard).join(\"\\n\");\n }\n\n return `[err] Unknown action: ${action}. Use create | update | list`;\n}\n\nexport const kanbanTool: ToolDefinition = {\n name: \"kanban_manage\",\n description: \"Create, update, or list cards on the kanban board. Use for tracking work items, user requests, and task decomposition.\",\n parameters: {\n type: \"object\",\n properties: {\n action: { type: \"string\", description: \"create | update | list\", enum: [\"create\", \"update\", \"list\"] },\n title: { type: \"string\", description: \"Card title (required for create)\" },\n id: { type: \"string\", description: \"Card ID (required for update)\" },\n source: { type: \"string\", description: \"Who created: user | agent | cron | peer\" },\n status: { type: \"string\", description: \"New status (for update): queued | running | done | failed\" },\n priority: { type: \"string\", description: \"CRITICAL | HIGH | MEDIUM | LOW\" },\n type: { type: \"string\", description: \"Card type (task, bug, feature, research, report, etc.)\" },\n labels: { type: \"string\", description: \"Comma-separated tags\" },\n due_at: { type: \"string\", description: \"ISO deadline (e.g. 2026-06-08T12:00:00)\" },\n parent_id: { type: \"string\", description: \"Parent card ID for subtasks\" },\n notes: { type: \"string\", description: \"Additional context\" },\n blocked_by: { type: \"string\", description: \"Comma-separated card IDs this card depends on, or 'children' to wait for all child cards\" },\n approval: { type: \"string\", description: \"pending | approved | rejected\" },\n },\n required: [\"action\"],\n },\n execute,\n};\n", "/**\n * channel-tool.ts \u2014 Agent-facing tools for the communication channel (#891).\n */\n\nimport type { ToolDefinition } from \"./tool-registry.js\";\nimport { channelPost, channelRead, type ChannelMessage } from \"../tasks/kanban-channel.js\";\n\nfunction formatMsg(m: ChannelMessage): string {\n const dir = m.directive ? \" \u26A1\" : \"\";\n return `[${m.from_agent}\u2192${m.to_agent}]${dir} ${m.message} (${m.created_at})`;\n}\n\nasync function executePost(args: Record<string, string>, ctx?: { userId?: string }): Promise<string> {\n const cardId = parseInt(args.card_id ?? \"\", 10);\n if (!cardId) return \"\u274C card_id required\";\n if (!args.message) return \"\u274C message required\";\n const from = args.from || ctx?.userId || \"agent\";\n const to = args.to || \"ALL\";\n const directive = args.directive === \"true\" || args.directive === \"1\";\n const msgType = args.type || \"progress\";\n const id = channelPost(cardId, from, to, args.message, directive, msgType);\n return `\u2713 Posted #${id} to card:${cardId} [${from}\u2192${to}]`;\n}\n\nasync function executeRead(args: Record<string, string>): Promise<string> {\n const cardId = parseInt(args.card_id ?? \"\", 10);\n if (!cardId) return \"\u274C card_id required\";\n const msgs = channelRead(cardId, { since: args.since, from: args.from });\n if (msgs.length === 0) return \"No messages.\";\n return msgs.map(formatMsg).join(\"\\n\");\n}\n\nexport const channelPostTool: ToolDefinition = {\n name: \"channel_post\",\n description: \"Post a message to the project discussion channel. Keep messages short (<1000 chars). For long plans, write a file and reference the path.\",\n parameters: {\n type: \"object\",\n properties: {\n card_id: { type: \"string\", description: \"Kanban card ID this message belongs to\" },\n to: { type: \"string\", description: \"Recipient: ALL (default), Worker-01, ORC, MASTER, or peer:name\" },\n message: { type: \"string\", description: \"Short message (max 1000 chars)\" },\n directive: { type: \"string\", description: \"Set to 'true' for priority directive (Orc/master only)\" },\n type: { type: \"string\", enum: [\"progress\", \"question\", \"result\", \"error\"], description: \"Message type (default: progress)\" },\n },\n required: [\"card_id\", \"message\"],\n },\n execute: executePost,\n};\n\nexport const channelReadTool: ToolDefinition = {\n name: \"channel_read\",\n description: \"Read messages from the project discussion channel.\",\n parameters: {\n type: \"object\",\n properties: {\n card_id: { type: \"string\", description: \"Kanban card ID to read messages from\" },\n since: { type: \"string\", description: \"ISO timestamp \u2014 only messages after this time\" },\n from: { type: \"string\", description: \"Filter by sender name\" },\n },\n required: [\"card_id\"],\n },\n execute: executeRead,\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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O,OAAO,CAAC;AAC5D,mBAAe,MAAM,IAAI;AACzB,WAAO;AAAA,EACT,SAAS,KAAK;AACZ,IAAAA,OAAM,EAAE,IAAI,MAAM,MAAM,QAAQ,SAAS,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,EAAE,CAAC;AAClG,UAAM;AAAA,EACR;AACF;",
6
+ "names": ["execFile", "appendFileSync", "mkdirSync", "join", "TAG", "TAG", "getMasterUserId", "TAG", "join", "mkdirSync", "audit", "appendFileSync", "execFile"]
7
+ }
@@ -2,7 +2,7 @@
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
  deploy
5
- } from "./chunk-SIFPBTI4.js";
5
+ } from "./chunk-HGSHCQ5F.js";
6
6
  import {
7
7
  printBanner
8
8
  } from "./chunk-YDY6QVWJ.js";
@@ -27,11 +27,11 @@ Usage: abtars update --dev [dir] | --alpha | --stable
27
27
  if (opts.localDir) {
28
28
  return deploy({ source: opts.source, localDir: opts.localDir, skipFreshness: opts.skipFreshness });
29
29
  }
30
- const { bootstrap } = await import("./bootstrap-X2QYIZIJ.js");
30
+ const { bootstrap } = await import("./bootstrap-MIHJJSWU.js");
31
31
  return bootstrap({ channel: opts.source });
32
32
  }
33
33
 
34
34
  export {
35
35
  update
36
36
  };
37
- //# sourceMappingURL=chunk-UPRZDU6T.js.map
37
+ //# sourceMappingURL=chunk-IY6UKLPS.js.map