@qqbrowser/openclaw-qbot 0.10.4 → 0.10.5

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 (201) hide show
  1. package/dist/{agents-uUms0egI.js → agents-6IxtknW5.js} +1 -1
  2. package/dist/{agents.config-BkB-gDby.js → agents.config-BP_dS899.js} +1 -1
  3. package/dist/{agents.config-Brf_8LyQ.js → agents.config-CQVkG48F.js} +1 -1
  4. package/dist/{auth-choice-CCPa_U3z.js → auth-choice-Baa2-mnd.js} +1 -1
  5. package/dist/{auth-choice-hlkl-WTV.js → auth-choice-Cw_bwgkr.js} +1 -1
  6. package/dist/{banner-DEPUY9RS.js → banner-CLI1ZxLT.js} +1 -1
  7. package/dist/build-info.json +3 -3
  8. package/dist/bundled/boot-md/handler.js +1 -1
  9. package/dist/bundled/session-memory/handler.js +1 -1
  10. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  11. package/dist/{channel-options-DqUyBMZF.js → channel-options-BmkYp9PQ.js} +1 -1
  12. package/dist/{channel-options-BbvCeuF4.js → channel-options-LL0twjcr.js} +1 -1
  13. package/dist/{channel-web-B7Dzfxgr.js → channel-web-DBxLlMxt.js} +1 -1
  14. package/dist/{channel-web-DztiTFmw.js → channel-web-DCbW654e.js} +1 -1
  15. package/dist/{channels-cli-B167LkN_.js → channels-cli-BDMHUXO6.js} +1 -1
  16. package/dist/{channels-cli-DqI5sufA.js → channels-cli-BomYL9U-.js} +1 -1
  17. package/dist/{cli-5w9Cs17g.js → cli-6GYOgeyE.js} +1 -1
  18. package/dist/{cli-odx2Ou54.js → cli-DcG2OfeS.js} +1 -1
  19. package/dist/{command-registry-kuOSuxH9.js → command-registry-B-1wiWIV.js} +1 -1
  20. package/dist/{compact-DutiJiBy.js → compact-B5m4267P.js} +6 -6
  21. package/dist/{compact.runtime-Cg-ayyOY.js → compact.runtime-BIprdRVY.js} +1 -1
  22. package/dist/{compact.runtime-CPJx43fM.js → compact.runtime-Bjmb9uWf.js} +1 -1
  23. package/dist/{compact.runtime-Cr0LrigW.js → compact.runtime-CC5tXNMI.js} +1 -1
  24. package/dist/{compact.runtime-8jjZMOn5.js → compact.runtime-CbiLGd2R.js} +1 -1
  25. package/dist/{completion-cli-Dk4i8AEs.js → completion-cli-BxTvZFra.js} +1 -1
  26. package/dist/{completion-cli-Btm1nzLM.js → completion-cli-CXSmC7Nh.js} +1 -1
  27. package/dist/{config-cli-C_Ep8Cqd.js → config-cli-CutpYl0W.js} +1 -1
  28. package/dist/{config-cli-GxgWLhZj.js → config-cli-_D9OjHjN.js} +1 -1
  29. package/dist/{configure-BGXAqK0_.js → configure-B7A-Gjbn.js} +1 -1
  30. package/dist/{configure-Bf9CYm_s.js → configure-GlFIJmRr.js} +1 -1
  31. package/dist/{deps-send-whatsapp.runtime-zwmhmYbD.js → deps-send-whatsapp.runtime-0CVkFH3c.js} +1 -1
  32. package/dist/{deps-send-whatsapp.runtime-BvP4xsTU.js → deps-send-whatsapp.runtime-CF7vGOV-.js} +1 -1
  33. package/dist/{deps-send-whatsapp.runtime-B0YhL8Lo.js → deps-send-whatsapp.runtime-CZWj9whB.js} +1 -1
  34. package/dist/{deps-send-whatsapp.runtime-DM3gFV5P.js → deps-send-whatsapp.runtime-CpRUDATB.js} +1 -1
  35. package/dist/{doctor-completion-Bp4r91Mj.js → doctor-completion-C5fxcbh9.js} +1 -1
  36. package/dist/{doctor-completion-DSlo6bQA.js → doctor-completion-CjAt0IBL.js} +1 -1
  37. package/dist/entry.js +1 -1
  38. package/dist/extensionAPI.js +1 -1
  39. package/dist/{gateway-cli-xHMUWDWx.js → gateway-cli-B4--4Rdp.js} +2 -2
  40. package/dist/{gateway-cli-C_zcjGt1.js → gateway-cli-LXL-gdmD.js} +2 -2
  41. package/dist/{health-vy-C49Dw.js → health-CIBrUBhW.js} +1 -1
  42. package/dist/{health-DWAEDZ8p.js → health-dTYbHKsD.js} +1 -1
  43. package/dist/{hooks-cli-DkjR_IzY.js → hooks-cli-B8zLSVkT.js} +1 -1
  44. package/dist/{hooks-cli-B0xRT8IB.js → hooks-cli-CQiuXLiA.js} +1 -1
  45. package/dist/index.js +2 -2
  46. package/dist/llm-slug-generator.js +1 -1
  47. package/dist/{models-CYk2Mf4W.js → models-DfPjqkxA.js} +1 -1
  48. package/dist/{models-cli-DPcl8k5z.js → models-cli-Crhj5KsH.js} +1 -1
  49. package/dist/{models-cli-BS5KD1m7.js → models-cli-DIeJKv20.js} +1 -1
  50. package/dist/{npm-resolution-BRKzOuRX.js → npm-resolution-BsQW2Kgr.js} +1 -1
  51. package/dist/{npm-resolution-B4ClzLA9.js → npm-resolution-wJ9PVAU8.js} +1 -1
  52. package/dist/{onboard-DtvFX5YS.js → onboard-CkDnD6Va.js} +2 -2
  53. package/dist/{onboard-DKohpAhM.js → onboard-DbFfuUgN.js} +2 -2
  54. package/dist/{onboard-channels-CO9FE0CA.js → onboard-channels-BW1eMy7S.js} +1 -1
  55. package/dist/{onboard-channels-B1Cta60W.js → onboard-channels-C0PAtk4T.js} +1 -1
  56. package/dist/{onboarding-CSBYu9X2.js → onboarding-DVLGoQj1.js} +1 -1
  57. package/dist/{onboarding-DTE81H7h.js → onboarding-enOGIWg6.js} +1 -1
  58. package/dist/{onboarding.finalize-Bk61Ef85.js → onboarding.finalize-BDLzh4dK.js} +1 -1
  59. package/dist/{onboarding.finalize-BzZq5LCu.js → onboarding.finalize-aguVHE5H.js} +1 -1
  60. package/dist/{pi-embedded-fKs8vr_l.js → pi-embedded-Bv3QACci.js} +6 -6
  61. package/dist/{pi-embedded-CSE8iTcT.js → pi-embedded-DJGgW90C.js} +6 -6
  62. package/dist/{plugin-registry--rKSomNR.js → plugin-registry-Cb3qsabM.js} +1 -1
  63. package/dist/{plugin-registry-BLopxJhs.js → plugin-registry-DgGaQJpH.js} +1 -1
  64. package/dist/plugin-sdk/{channel-web-kLUJoIaN.js → channel-web-B69hreZ-.js} +1 -1
  65. package/dist/plugin-sdk/{channel-web-BZwnvMDD.cjs → channel-web-CGYvIoB3.cjs} +1 -1
  66. package/dist/plugin-sdk/{channel-web-BUiDMnQM.js → channel-web-Cg7FoMmy.js} +1 -1
  67. package/dist/plugin-sdk/{channel-web-Dn8Qa28U.cjs → channel-web-yRiw9cOW.cjs} +1 -1
  68. package/dist/plugin-sdk/{compact.runtime-BtnHPGWW.cjs → compact.runtime-6EUZS-nm.cjs} +1 -1
  69. package/dist/plugin-sdk/{compact.runtime-PwQ5BH89.cjs → compact.runtime-BCReDZO0.cjs} +1 -1
  70. package/dist/plugin-sdk/{compact.runtime-CcAl_7JS.cjs → compact.runtime-BV8EhsZ-.cjs} +1 -1
  71. package/dist/plugin-sdk/{compact.runtime-BDSrWIc3.js → compact.runtime-BrTHTIXo.js} +1 -1
  72. package/dist/plugin-sdk/{compact.runtime-WzRsTof6.js → compact.runtime-C-nSnIie.js} +1 -1
  73. package/dist/plugin-sdk/{compact.runtime-D6zMtomh.js → compact.runtime-C1HIq_JF.js} +1 -1
  74. package/dist/plugin-sdk/{compact.runtime-DrbWVG3U.cjs → compact.runtime-CuU_iabG.cjs} +1 -1
  75. package/dist/plugin-sdk/{compact.runtime-CB04vm0D.js → compact.runtime-D64Cnn1T.js} +1 -1
  76. package/dist/plugin-sdk/{compact.runtime-BDZgCqEH.cjs → compact.runtime-DEsDlL2e.cjs} +1 -1
  77. package/dist/plugin-sdk/{compact.runtime-D4jmyLK_.js → compact.runtime-DyyEYJhk.js} +1 -1
  78. package/dist/plugin-sdk/{compact.runtime-DiGElRVu.cjs → compact.runtime-hD-8StlH.cjs} +1 -1
  79. package/dist/plugin-sdk/{compact.runtime-DpKoN-EI.js → compact.runtime-nrAibbrs.js} +1 -1
  80. package/dist/plugin-sdk/compat.cjs +1 -1
  81. package/dist/plugin-sdk/compat.js +1 -1
  82. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-D9D9oUEf.js → deps-send-whatsapp.runtime-BHSEddX6.js} +1 -1
  83. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-DAq8oj_z.cjs → deps-send-whatsapp.runtime-BIcx-YKg.cjs} +1 -1
  84. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-Du9woGpt.js → deps-send-whatsapp.runtime-BJqrGRfn.js} +1 -1
  85. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-Bu592CgI.cjs → deps-send-whatsapp.runtime-BYitkwEt.cjs} +1 -1
  86. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-CslTgnDb.cjs → deps-send-whatsapp.runtime-BZZlnkSu.cjs} +1 -1
  87. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-Ck_Odtet.cjs → deps-send-whatsapp.runtime-C8CHSY5s.cjs} +1 -1
  88. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-C8VavsCw.cjs → deps-send-whatsapp.runtime-Cc_K5nip.cjs} +1 -1
  89. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-BIa0po8R.js → deps-send-whatsapp.runtime-CcxJ3x8i.js} +1 -1
  90. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-D8utCFrm.js → deps-send-whatsapp.runtime-CtGDGABW.js} +1 -1
  91. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-BjCkJL25.js → deps-send-whatsapp.runtime-DKBA8CwU.js} +1 -1
  92. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-D7XufA9p.js → deps-send-whatsapp.runtime-ty7jacKq.js} +1 -1
  93. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-Bc3Bslu5.cjs → deps-send-whatsapp.runtime-uvxKpBrR.cjs} +1 -1
  94. package/dist/plugin-sdk/{dispatch-B0bRcI0M.js → dispatch-3RmgaKV0.js} +6 -6
  95. package/dist/plugin-sdk/{dispatch-CXFmGh30.cjs → dispatch-BHwyFTwz.cjs} +6 -6
  96. package/dist/plugin-sdk/{dispatch-CuIxFSWG.js → dispatch-BYn5wxRI.js} +6 -6
  97. package/dist/plugin-sdk/{dispatch-DZFfZ37w.cjs → dispatch-C-qRxvLo.cjs} +6 -6
  98. package/dist/plugin-sdk/{dispatch-CXTBtHYf.cjs → dispatch-CDF-QMLO.cjs} +6 -6
  99. package/dist/plugin-sdk/{dispatch-BzOxEE_U.cjs → dispatch-DBHCub77.cjs} +6 -6
  100. package/dist/plugin-sdk/{dispatch-DgMf2rhn.cjs → dispatch-DCFiq6TV.cjs} +6 -6
  101. package/dist/plugin-sdk/{dispatch-BHQwp2mY.js → dispatch-Dbp8KQt5.js} +6 -6
  102. package/dist/plugin-sdk/{dispatch-CsZWuLFg.js → dispatch-DpHTL-Ha.js} +6 -6
  103. package/dist/plugin-sdk/{dispatch-DXQq-1ND.js → dispatch-t6yxQhjZ.js} +6 -6
  104. package/dist/plugin-sdk/index.cjs +1 -1
  105. package/dist/plugin-sdk/index.js +1 -1
  106. package/dist/plugin-sdk/irc.cjs +1 -1
  107. package/dist/plugin-sdk/irc.js +1 -1
  108. package/dist/plugin-sdk/matrix.cjs +1 -1
  109. package/dist/plugin-sdk/matrix.js +1 -1
  110. package/dist/plugin-sdk/msteams.cjs +1 -1
  111. package/dist/plugin-sdk/msteams.js +1 -1
  112. package/dist/plugin-sdk/nextcloud-talk.cjs +1 -1
  113. package/dist/plugin-sdk/nextcloud-talk.js +1 -1
  114. package/dist/plugin-sdk/{reply-9oEGfJO1.cjs → reply-DYTWptyW.cjs} +6 -6
  115. package/dist/plugin-sdk/{reply-D_sNAum5.js → reply-nXQ3Ihgd.js} +6 -6
  116. package/dist/plugin-sdk/{slash-dispatch.runtime-D6j_HvFC.cjs → slash-dispatch.runtime-BSDBCdoz.cjs} +1 -1
  117. package/dist/plugin-sdk/{slash-dispatch.runtime-C0RwCFKq.js → slash-dispatch.runtime-Boj2xPW5.js} +1 -1
  118. package/dist/plugin-sdk/{slash-dispatch.runtime-B60yTzIf.js → slash-dispatch.runtime-C57opycX.js} +1 -1
  119. package/dist/plugin-sdk/{slash-dispatch.runtime-BERy39cs.js → slash-dispatch.runtime-C9rDQo8o.js} +1 -1
  120. package/dist/plugin-sdk/{slash-dispatch.runtime-UYaTQwVq.js → slash-dispatch.runtime-CApLdZER.js} +1 -1
  121. package/dist/plugin-sdk/{slash-dispatch.runtime-ASdOu8Cm.js → slash-dispatch.runtime-CG-zjxON.js} +1 -1
  122. package/dist/plugin-sdk/{slash-dispatch.runtime-BuF14A03.js → slash-dispatch.runtime-CTecvuIx.js} +1 -1
  123. package/dist/plugin-sdk/{slash-dispatch.runtime-_BOQ7gkd.cjs → slash-dispatch.runtime-Coe_tdLy.cjs} +1 -1
  124. package/dist/plugin-sdk/{slash-dispatch.runtime-Dg9uQHNW.cjs → slash-dispatch.runtime-CrfGJt-z.cjs} +1 -1
  125. package/dist/plugin-sdk/{slash-dispatch.runtime-30IYd84w.cjs → slash-dispatch.runtime-EgX-cRVC.cjs} +1 -1
  126. package/dist/plugin-sdk/{slash-dispatch.runtime-Dq7mPZxr.cjs → slash-dispatch.runtime-KA6_FxIE.cjs} +1 -1
  127. package/dist/plugin-sdk/{slash-dispatch.runtime-34q3H9BU.cjs → slash-dispatch.runtime-XTKieQBQ.cjs} +1 -1
  128. package/dist/plugin-sdk/{subagent-registry-runtime-D0_kdCJ8.js → subagent-registry-runtime-B1Lpdh_L.js} +1 -1
  129. package/dist/plugin-sdk/{subagent-registry-runtime-BpO-8o-v.cjs → subagent-registry-runtime-BTcxp_jJ.cjs} +1 -1
  130. package/dist/plugin-sdk/{subagent-registry-runtime-DUaC-nXH.js → subagent-registry-runtime-C1W2bBCX.js} +1 -1
  131. package/dist/plugin-sdk/{subagent-registry-runtime-B4ht4jgI.js → subagent-registry-runtime-CjDQncGB.js} +1 -1
  132. package/dist/plugin-sdk/{subagent-registry-runtime-C4MYbumf.cjs → subagent-registry-runtime-CsoVFakn.cjs} +1 -1
  133. package/dist/plugin-sdk/{subagent-registry-runtime-w7CcoTLv.cjs → subagent-registry-runtime-DRUPit2H.cjs} +1 -1
  134. package/dist/plugin-sdk/{subagent-registry-runtime-_MlLeMWw.js → subagent-registry-runtime-DTlB8Q96.js} +1 -1
  135. package/dist/plugin-sdk/{subagent-registry-runtime-DfWSD7tl.js → subagent-registry-runtime-DiwikRRl.js} +1 -1
  136. package/dist/plugin-sdk/{subagent-registry-runtime-CyYJQuSQ.cjs → subagent-registry-runtime-Dj2i9GGj.cjs} +1 -1
  137. package/dist/plugin-sdk/{subagent-registry-runtime-D_dgSTbs.cjs → subagent-registry-runtime-Djshp0MC.cjs} +1 -1
  138. package/dist/plugin-sdk/{subagent-registry-runtime-UoI3lad4.js → subagent-registry-runtime-DrbVJw2f.js} +1 -1
  139. package/dist/plugin-sdk/{subagent-registry-runtime-CKNJbYW5.cjs → subagent-registry-runtime-IVYj5ywH.cjs} +1 -1
  140. package/dist/plugin-sdk/{web-BtgZE8cK.js → web-2PAf1exP.js} +1 -1
  141. package/dist/plugin-sdk/{web-B5xIoXe1.js → web-B6Ox6Cdv.js} +1 -1
  142. package/dist/plugin-sdk/{web-BEIPWO4K.cjs → web-B7WqqsC8.cjs} +1 -1
  143. package/dist/plugin-sdk/{web-GIWXJ0Ba.js → web-BkCy5IQ7.js} +1 -1
  144. package/dist/plugin-sdk/{web-BK1ARWvO.cjs → web-CJcd3JMn.cjs} +1 -1
  145. package/dist/plugin-sdk/{web-D2JuDaoV.js → web-CjilhIQD.js} +1 -1
  146. package/dist/plugin-sdk/{web-C2CF_qbv.cjs → web-CjsJxq4D.cjs} +1 -1
  147. package/dist/plugin-sdk/{web-BZPAL5HS.cjs → web-DCAcFf5b.cjs} +1 -1
  148. package/dist/plugin-sdk/{web-BiZX-XYi.cjs → web-DtH3t5Jt.cjs} +1 -1
  149. package/dist/plugin-sdk/{web-BhnzZsyl.js → web-g-WONVYn.js} +1 -1
  150. package/dist/plugin-sdk/{web-C3K1qs0u.cjs → web-iRzx1ssK.cjs} +1 -1
  151. package/dist/plugin-sdk/{web-CYwIRzDt.js → web-ikfo8GXI.js} +1 -1
  152. package/dist/plugin-sdk/whatsapp.cjs +1 -1
  153. package/dist/plugin-sdk/whatsapp.js +1 -1
  154. package/dist/{plugins-cli-fvYI7MuY.js → plugins-cli-5B5urjU7.js} +1 -1
  155. package/dist/{plugins-cli-D7y5Vl8l.js → plugins-cli-DaxkOvPH.js} +1 -1
  156. package/dist/{program-o1R0ZIeK.js → program-DJxQx1DE.js} +2 -2
  157. package/dist/{program-context-DMLIbH2F.js → program-context-DewOK4jD.js} +1 -1
  158. package/dist/{prompt-select-styled-BghrrnfB.js → prompt-select-styled-U5YlFMbC.js} +1 -1
  159. package/dist/{prompt-select-styled-MKdHaN69.js → prompt-select-styled-VagKVjlJ.js} +1 -1
  160. package/dist/{provider-auth-helpers-B24NjgT2.js → provider-auth-helpers-BEBH5krH.js} +1 -1
  161. package/dist/{provider-auth-helpers-1c048H9l.js → provider-auth-helpers-DKQwlJ25.js} +1 -1
  162. package/dist/{push-apns-BU-NR-pG.js → push-apns-CIV5yU-C.js} +1 -1
  163. package/dist/{push-apns-CrGncT7C.js → push-apns-DOhrdJ5p.js} +1 -1
  164. package/dist/{register.agent-iVmRDz9B.js → register.agent-Q_qYfTfI.js} +1 -1
  165. package/dist/{register.agent-CQHFkB8p.js → register.agent-Zd0TARQm.js} +1 -1
  166. package/dist/{register.configure-CThul7Zy.js → register.configure-A6heJkJh.js} +1 -1
  167. package/dist/{register.configure-q-iauQUk.js → register.configure-CWTGVxwN.js} +1 -1
  168. package/dist/{register.maintenance-C47agRIL.js → register.maintenance-BiqiVyJY.js} +1 -1
  169. package/dist/{register.maintenance-BRTx_TN-.js → register.maintenance-cKlEqSE7.js} +1 -1
  170. package/dist/{register.message-DsJRw5nY.js → register.message-BRfalotn.js} +1 -1
  171. package/dist/{register.message-Dxxzi9kt.js → register.message-CXPAYgVk.js} +1 -1
  172. package/dist/{register.onboard-DcNYm0dn.js → register.onboard-CiK3r6Ar.js} +1 -1
  173. package/dist/{register.onboard-BteLZ-mA.js → register.onboard-g_3bWGn7.js} +1 -1
  174. package/dist/{register.setup-C4lAwlQe.js → register.setup-BgOqtS83.js} +1 -1
  175. package/dist/{register.setup-CeW9lN5-.js → register.setup-BoiX_qRl.js} +1 -1
  176. package/dist/{register.status-health-sessions-C-JabFZz.js → register.status-health-sessions-BIo6bs1r.js} +1 -1
  177. package/dist/{register.status-health-sessions-CZOciUK3.js → register.status-health-sessions-BrcaSoAg.js} +1 -1
  178. package/dist/{register.subclis-DHFqEK6G.js → register.subclis-BmtNNMP2.js} +1 -1
  179. package/dist/{reply-DHtpIWpD.js → reply-HrabJs88.js} +6 -6
  180. package/dist/{run-main-BKA6bL5R.js → run-main-CwKNqqKj.js} +1 -1
  181. package/dist/{server-node-events-DECiuryL.js → server-node-events-D1Pr11u8.js} +1 -1
  182. package/dist/{server-node-events-DQohZYL_.js → server-node-events-DYeHOQG_.js} +1 -1
  183. package/dist/{slash-dispatch.runtime-BltGVp6a.js → slash-dispatch.runtime-5xQBRYan.js} +1 -1
  184. package/dist/{slash-dispatch.runtime-U7BSD9SC.js → slash-dispatch.runtime-BRImHx9I.js} +1 -1
  185. package/dist/{slash-dispatch.runtime-BRh6zgqn.js → slash-dispatch.runtime-Cq5dUL-m.js} +1 -1
  186. package/dist/{slash-dispatch.runtime-BQCIIXIb.js → slash-dispatch.runtime-D_A_iMTY.js} +1 -1
  187. package/dist/{status-CUDtNIry.js → status-DiHX2LOf.js} +1 -1
  188. package/dist/{status-OB55GG25.js → status-m4GFy-Px.js} +1 -1
  189. package/dist/{subagent-registry-runtime-B9Ism-1f.js → subagent-registry-runtime-BhMKhChi.js} +1 -1
  190. package/dist/{subagent-registry-runtime-D2hsQSwB.js → subagent-registry-runtime-C36kHoT7.js} +1 -1
  191. package/dist/{subagent-registry-runtime-CO4i2ZPd.js → subagent-registry-runtime-CrUvIBql.js} +1 -1
  192. package/dist/{subagent-registry-runtime-85RFObHD.js → subagent-registry-runtime-GuXOBC1H.js} +1 -1
  193. package/dist/{update-cli-CkgaoB8p.js → update-cli-CQGioR5x.js} +1 -1
  194. package/dist/{update-cli-BlZnad_S.js → update-cli-ILZhc8_8.js} +1 -1
  195. package/dist/{update-runner-DcWJQ3bh.js → update-runner-1UCWso86.js} +1 -1
  196. package/dist/{update-runner-DWHUl78B.js → update-runner-JT7_BON6.js} +1 -1
  197. package/dist/{web-HSA7Rhwn.js → web-C1e-LYaH.js} +1 -1
  198. package/dist/{web-MgNpzMvd.js → web-DWIIpcnE.js} +1 -1
  199. package/dist/{web-B6OLwGJa.js → web-DaJ1Z41U.js} +1 -1
  200. package/dist/{web-Bam5_EjB.js → web-rxfH6rmG.js} +1 -1
  201. package/package.json +1 -1
@@ -1 +1 @@
1
- import{G as e,J as t,K as n,W as r,X as i,Y as a,Z as o,p as s,q as c,r as l,rt as u}from"./subsystem-kTFXkQM5.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{c as d,i as f,l as p,o as m,s as h}from"./entry.js";import{hc as g}from"./auth-profiles-e3SmOvON.js";import"./agent-scope-BKE4M04k.js";import"./utils-7Gdj77QB.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-R4odAlsj.js";import{t as _}from"./version-q3SkUw2K.js";import"./registry-Div2nEwi.js";import"./skills-Df0CxTMH.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-CCU8jDti.js";import"./logger-C1GUBMt-.js";import"./exec-CiwCrGw3.js";import"./windows-spawn-Dw4dpTt2.js";import"./redact-bVcVj47r.js";import"./path-alias-guards-kY_ZbWs-.js";import{i as v}from"./errors-DNQO70y-.js";import"./send-Cfa08ZLE.js";import"./send-DmS34-Eb.js";import"./compact-DutiJiBy.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-D5CbqIVA.js";import"./tokens-D8eWI71q.js";import"./with-timeout-c1CzdShT.js";import"./deliver-HZ99jQzl.js";import"./diagnostic-CvLTqJbq.js";import"./send-CW3hfjkM.js";import"./pi-model-discovery-cW9be_SG.js";import"./exec-approvals-allowlist-DlYH42As.js";import"./exec-safe-bin-runtime-policy-Bu9bb9U5.js";import"./model-catalog-CI2eEH9Y.js";import"./fetch-Dj-FEHSr.js";import{_ as y}from"./audio-transcription-runner-BwviCgP5.js";import"./fetch-guard-guH8Tmju.js";import"./image-DQ_3LMNb.js";import"./tool-display-BTuQQN92.js";import"./api-key-rotation-BRm3CNd-.js";import"./proxy-fetch-ByazCl5E.js";import"./ir-CsTyrPwa.js";import"./render-DrrPmnMI.js";import"./target-errors-BRLBPboT.js";import"./commands-DOhEGWJ2.js";import"./commands-registry-CqsggloB.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-Bh1ozdi-.js";import"./sqlite-DgdOh9U-.js";import"./call-D5NJXFgu.js";import"./pi-tools.policy-CklWbQkk.js";import"./pairing-store-CmT1fSmE.js";import"./fetch-Dh-apy46.js";import"./skill-commands-qdKWuiOR.js";import"./workspace-dirs-na4G79jL.js";import"./pairing-token-YrKlxjGC.js";import"./channel-activity-CFgOyIkh.js";import"./tables-5gR6U_tC.js";import"./kill-tree-DihujQie.js";import"./runtime-web-tools-BjmhIJkd.js";import"./runtime-HwYsJOk2.js";import"./node-shell-BuPDYFhk.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-C1kkZyEb.js";import"./plugin-auto-enable-CrVJR--r.js";import"./send-DQxQrVuw.js";import"./outbound-attachment-BKku_WUf.js";import"./delivery-queue-nkPJu0fY.js";import"./send-DVv1dCwu.js";import"./system-run-command-BT2tTJg2.js";import"./fetch-EBjfhrYU.js";import"./command-secret-targets-BtkZwOzh.js";import"./connection-auth-BIApbu6I.js";import"./onboard-helpers-CvWjz0op.js";import"./prompt-style-QJckocuy.js";import"./pairing-labels-B3wRXljf.js";import"./search-manager-Co5RwgQ4.js";import"./manager-p3CCKFcv.js";import"./memory-cli-CTXmLb0V.js";import"./links-pHmQCzdF.js";import"./cli-utils-BleB1eys.js";import"./help-format-BSNXPQuE.js";import"./progress-Cy6zNuIC.js";import"./exec-approvals-BXO9Cezj.js";import{t as b}from"./path-env-emdAQejM.js";import"./note-Dzei_8z5.js";import"./issue-format-DRHlQPnX.js";import{t as x}from"./plugin-registry-BLopxJhs.js";import{t as S}from"./runtime-guard-BFK4A89C.js";import{t as C}from"./banner-DEPUY9RS.js";import"./doctor-config-flow-DX6_ggPf.js";import{n as w}from"./config-guard-C8H49WKj.js";import T from"node:process";import"node:url";const E={match:e=>e[0]===`health`,loadPlugins:e=>!i(e,`--json`),run:async e=>{let t=i(e,`--json`),n=a(e,{includeDebug:!0}),r=c(e,`--timeout`);if(r===null)return!1;let{healthCommand:o}=await import(`./health-vy-C49Dw.js`).then(e=>e.i);return await o({json:t,timeoutMs:r,verbose:n},s),!0}},D={match:e=>e[0]===`status`,loadPlugins:!0,run:async e=>{let t=i(e,`--json`),n=i(e,`--deep`),r=i(e,`--all`),o=i(e,`--usage`),l=a(e,{includeDebug:!0}),u=c(e,`--timeout`);if(u===null)return!1;let{statusCommand:d}=await import(`./status-CUDtNIry.js`).then(e=>e.t);return await d({json:t,deep:n,all:r,usage:o,timeoutMs:u,verbose:l},s),!0}},O={match:e=>e[0]===`sessions`&&!e[1],run:async e=>{let t=i(e,`--json`),r=i(e,`--all-agents`),a=n(e,`--agent`);if(a===null)return!1;let o=n(e,`--store`);if(o===null)return!1;let c=n(e,`--active`);if(c===null)return!1;let{sessionsCommand:l}=await import(`./sessions-CgJjw9U5.js`);return await l({json:t,store:o,agent:a,allAgents:r,active:c},s),!0}},k={match:e=>e[0]===`agents`&&e[1]===`list`,run:async e=>{let t=i(e,`--json`),n=i(e,`--bindings`),{agentsListCommand:r}=await import(`./agents-uUms0egI.js`);return await r({json:t,bindings:n},s),!0}},A={match:e=>e[0]===`memory`&&e[1]===`status`,run:async e=>{let t=n(e,`--agent`);if(t===null)return!1;let r=i(e,`--json`),a=i(e,`--deep`),o=i(e,`--index`),s=i(e,`--verbose`),{runMemoryStatus:c}=await import(`./memory-cli-CTXmLb0V.js`).then(e=>e.t);return await c({agent:t,json:r,deep:a,index:o,verbose:s}),!0}};function j(e,t){let n=[],r=e.slice(2);for(let e=0;e<r.length;e+=1){let i=r[e];if(!i||i===`--`)break;if(i===t){let t=r[e+1];if(!u(t))return null;n.push(t),e+=1;continue}if(i.startsWith(`${t}=`)){let e=i.slice(t.length+1).trim();if(!e)return null;n.push(e)}}return n}const M=[E,D,O,k,A,{match:e=>e[0]===`config`&&e[1]===`get`,run:async t=>{let n=e(t,{commandPath:[`config`,`get`],booleanFlags:[`--json`]});if(!n||n.length!==1)return!1;let r=n[0];if(!r)return!1;let a=i(t,`--json`),{runConfigGet:o}=await import(`./config-cli-C_Ep8Cqd.js`);return await o({path:r,json:a}),!0}},{match:e=>e[0]===`config`&&e[1]===`unset`,run:async t=>{let n=e(t,{commandPath:[`config`,`unset`]});if(!n||n.length!==1)return!1;let r=n[0];if(!r)return!1;let{runConfigUnset:i}=await import(`./config-cli-C_Ep8Cqd.js`);return await i({path:r}),!0}},{match:e=>e[0]===`models`&&e[1]===`list`,run:async e=>{let t=n(e,`--provider`);if(t===null)return!1;let r=i(e,`--all`),a=i(e,`--local`),o=i(e,`--json`),c=i(e,`--plain`),{modelsListCommand:l}=await import(`./models-CYk2Mf4W.js`);return await l({all:r,local:a,provider:t,json:o,plain:c},s),!0}},{match:e=>e[0]===`models`&&e[1]===`status`,run:async e=>{let t=n(e,`--probe-provider`);if(t===null)return!1;let r=n(e,`--probe-timeout`);if(r===null)return!1;let a=n(e,`--probe-concurrency`);if(a===null)return!1;let o=n(e,`--probe-max-tokens`);if(o===null)return!1;let c=n(e,`--agent`);if(c===null)return!1;let l=j(e,`--probe-profile`);if(l===null)return!1;let u=l.length===0?void 0:l.length===1?l[0]:l,d=i(e,`--json`),f=i(e,`--plain`),p=i(e,`--check`),m=i(e,`--probe`),{modelsStatusCommand:h}=await import(`./models-CYk2Mf4W.js`);return await h({json:d,plain:f,check:p,probe:m,probeProvider:t,probeProfile:u,probeTimeout:r,probeConcurrency:a,probeMaxTokens:o,agent:c},s),!0}}];function N(e){for(let t of M)if(t.match(e))return t;return null}async function P(e){let t=i(e.argv,`--json`);C(_,{argv:e.argv}),await w({runtime:s,commandPath:e.commandPath,...t?{suppressDoctorStdout:!0}:{}}),(typeof e.loadPlugins==`function`?e.loadPlugins(e.argv):e.loadPlugins)&&x()}async function F(e){if(f(process.env.OPENCLAW_DISABLE_ROUTE_FIRST)||o(e))return!1;let t=r(e,2);if(!t[0])return!1;let n=N(t);return n?(await P({argv:e,commandPath:t,loadPlugins:n.loadPlugins}),n.run(e)):!1}async function I(){try{let{closeAllMemorySearchManagers:e}=await import(`./search-manager-Co5RwgQ4.js`).then(e=>e.n);await e()}catch{}}function L(e){let t=e.indexOf(`--update`);if(t===-1)return e;let n=[...e];return n.splice(t,1,`update`),n}function R(e){return e.hasBuiltinPrimary?!0:e.primary?!1:o(e.argv)}function z(e){if(o(e))return!1;let[t,n]=r(e,2);return t?!(t===`status`||t===`health`||t===`sessions`||t===`config`&&(n===`get`||n===`unset`)||t===`models`&&(n===`list`||n===`status`)):!0}async function B(e=T.argv){let n=h(e),r=p(n);if(!r.ok)throw Error(r.error);r.profile&&d({profile:r.profile}),n=r.argv,g({quiet:!0}),m(),z(n)&&b(),S();try{if(await F(n))return;l();let{buildProgram:e}=await import(`./program-o1R0ZIeK.js`),r=e();y(),T.on(`uncaughtException`,e=>{console.error(`[openclaw] Uncaught exception:`,v(e)),T.exit(1)});let i=L(n),a=t(i);if(a){let{getProgramContext:e}=await import(`./program-context-CH9p6anW.js`).then(e=>e.n),t=e(r);if(t){let{registerCoreCliByName:e}=await import(`./command-registry-kuOSuxH9.js`).then(e=>e.t);await e(r,t,a,i)}let{registerSubCliByName:n}=await import(`./register.subclis-DHFqEK6G.js`).then(e=>e.a);await n(r,a)}if(!R({argv:i,primary:a,hasBuiltinPrimary:a!==null&&r.commands.some(e=>e.name()===a)})){let{registerPluginCliCommands:e}=await import(`./cli-odx2Ou54.js`),{loadValidatedConfigForPluginRegistration:t}=await import(`./register.subclis-DHFqEK6G.js`).then(e=>e.a),n=await t();n&&e(r,n)}await r.parseAsync(i)}finally{await I()}}export{B as runCli};
1
+ import{G as e,J as t,K as n,W as r,X as i,Y as a,Z as o,p as s,q as c,r as l,rt as u}from"./subsystem-kTFXkQM5.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{c as d,i as f,l as p,o as m,s as h}from"./entry.js";import{hc as g}from"./auth-profiles-e3SmOvON.js";import"./agent-scope-BKE4M04k.js";import"./utils-7Gdj77QB.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-R4odAlsj.js";import{t as _}from"./version-q3SkUw2K.js";import"./registry-Div2nEwi.js";import"./skills-Df0CxTMH.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-CCU8jDti.js";import"./logger-C1GUBMt-.js";import"./exec-CiwCrGw3.js";import"./windows-spawn-Dw4dpTt2.js";import"./redact-bVcVj47r.js";import"./path-alias-guards-kY_ZbWs-.js";import{i as v}from"./errors-DNQO70y-.js";import"./send-Cfa08ZLE.js";import"./send-DmS34-Eb.js";import"./compact-B5m4267P.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-D5CbqIVA.js";import"./tokens-D8eWI71q.js";import"./with-timeout-c1CzdShT.js";import"./deliver-HZ99jQzl.js";import"./diagnostic-CvLTqJbq.js";import"./send-CW3hfjkM.js";import"./pi-model-discovery-cW9be_SG.js";import"./exec-approvals-allowlist-DlYH42As.js";import"./exec-safe-bin-runtime-policy-Bu9bb9U5.js";import"./model-catalog-CI2eEH9Y.js";import"./fetch-Dj-FEHSr.js";import{_ as y}from"./audio-transcription-runner-BwviCgP5.js";import"./fetch-guard-guH8Tmju.js";import"./image-DQ_3LMNb.js";import"./tool-display-BTuQQN92.js";import"./api-key-rotation-BRm3CNd-.js";import"./proxy-fetch-ByazCl5E.js";import"./ir-CsTyrPwa.js";import"./render-DrrPmnMI.js";import"./target-errors-BRLBPboT.js";import"./commands-DOhEGWJ2.js";import"./commands-registry-CqsggloB.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-Bh1ozdi-.js";import"./sqlite-DgdOh9U-.js";import"./call-D5NJXFgu.js";import"./pi-tools.policy-CklWbQkk.js";import"./pairing-store-CmT1fSmE.js";import"./fetch-Dh-apy46.js";import"./skill-commands-qdKWuiOR.js";import"./workspace-dirs-na4G79jL.js";import"./pairing-token-YrKlxjGC.js";import"./channel-activity-CFgOyIkh.js";import"./tables-5gR6U_tC.js";import"./kill-tree-DihujQie.js";import"./runtime-web-tools-BjmhIJkd.js";import"./runtime-HwYsJOk2.js";import"./node-shell-BuPDYFhk.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-C1kkZyEb.js";import"./plugin-auto-enable-CrVJR--r.js";import"./send-DQxQrVuw.js";import"./outbound-attachment-BKku_WUf.js";import"./delivery-queue-nkPJu0fY.js";import"./send-DVv1dCwu.js";import"./system-run-command-BT2tTJg2.js";import"./fetch-EBjfhrYU.js";import"./command-secret-targets-BtkZwOzh.js";import"./connection-auth-BIApbu6I.js";import"./onboard-helpers-CvWjz0op.js";import"./prompt-style-QJckocuy.js";import"./pairing-labels-B3wRXljf.js";import"./search-manager-Co5RwgQ4.js";import"./manager-p3CCKFcv.js";import"./memory-cli-CTXmLb0V.js";import"./links-pHmQCzdF.js";import"./cli-utils-BleB1eys.js";import"./help-format-BSNXPQuE.js";import"./progress-Cy6zNuIC.js";import"./exec-approvals-BXO9Cezj.js";import{t as b}from"./path-env-emdAQejM.js";import"./note-Dzei_8z5.js";import"./issue-format-DRHlQPnX.js";import{t as x}from"./plugin-registry-DgGaQJpH.js";import{t as S}from"./runtime-guard-BFK4A89C.js";import{t as C}from"./banner-CLI1ZxLT.js";import"./doctor-config-flow-DX6_ggPf.js";import{n as w}from"./config-guard-C8H49WKj.js";import T from"node:process";import"node:url";const E={match:e=>e[0]===`health`,loadPlugins:e=>!i(e,`--json`),run:async e=>{let t=i(e,`--json`),n=a(e,{includeDebug:!0}),r=c(e,`--timeout`);if(r===null)return!1;let{healthCommand:o}=await import(`./health-CIBrUBhW.js`).then(e=>e.i);return await o({json:t,timeoutMs:r,verbose:n},s),!0}},D={match:e=>e[0]===`status`,loadPlugins:!0,run:async e=>{let t=i(e,`--json`),n=i(e,`--deep`),r=i(e,`--all`),o=i(e,`--usage`),l=a(e,{includeDebug:!0}),u=c(e,`--timeout`);if(u===null)return!1;let{statusCommand:d}=await import(`./status-DiHX2LOf.js`).then(e=>e.t);return await d({json:t,deep:n,all:r,usage:o,timeoutMs:u,verbose:l},s),!0}},O={match:e=>e[0]===`sessions`&&!e[1],run:async e=>{let t=i(e,`--json`),r=i(e,`--all-agents`),a=n(e,`--agent`);if(a===null)return!1;let o=n(e,`--store`);if(o===null)return!1;let c=n(e,`--active`);if(c===null)return!1;let{sessionsCommand:l}=await import(`./sessions-CgJjw9U5.js`);return await l({json:t,store:o,agent:a,allAgents:r,active:c},s),!0}},k={match:e=>e[0]===`agents`&&e[1]===`list`,run:async e=>{let t=i(e,`--json`),n=i(e,`--bindings`),{agentsListCommand:r}=await import(`./agents-6IxtknW5.js`);return await r({json:t,bindings:n},s),!0}},A={match:e=>e[0]===`memory`&&e[1]===`status`,run:async e=>{let t=n(e,`--agent`);if(t===null)return!1;let r=i(e,`--json`),a=i(e,`--deep`),o=i(e,`--index`),s=i(e,`--verbose`),{runMemoryStatus:c}=await import(`./memory-cli-CTXmLb0V.js`).then(e=>e.t);return await c({agent:t,json:r,deep:a,index:o,verbose:s}),!0}};function j(e,t){let n=[],r=e.slice(2);for(let e=0;e<r.length;e+=1){let i=r[e];if(!i||i===`--`)break;if(i===t){let t=r[e+1];if(!u(t))return null;n.push(t),e+=1;continue}if(i.startsWith(`${t}=`)){let e=i.slice(t.length+1).trim();if(!e)return null;n.push(e)}}return n}const M=[E,D,O,k,A,{match:e=>e[0]===`config`&&e[1]===`get`,run:async t=>{let n=e(t,{commandPath:[`config`,`get`],booleanFlags:[`--json`]});if(!n||n.length!==1)return!1;let r=n[0];if(!r)return!1;let a=i(t,`--json`),{runConfigGet:o}=await import(`./config-cli-CutpYl0W.js`);return await o({path:r,json:a}),!0}},{match:e=>e[0]===`config`&&e[1]===`unset`,run:async t=>{let n=e(t,{commandPath:[`config`,`unset`]});if(!n||n.length!==1)return!1;let r=n[0];if(!r)return!1;let{runConfigUnset:i}=await import(`./config-cli-CutpYl0W.js`);return await i({path:r}),!0}},{match:e=>e[0]===`models`&&e[1]===`list`,run:async e=>{let t=n(e,`--provider`);if(t===null)return!1;let r=i(e,`--all`),a=i(e,`--local`),o=i(e,`--json`),c=i(e,`--plain`),{modelsListCommand:l}=await import(`./models-DfPjqkxA.js`);return await l({all:r,local:a,provider:t,json:o,plain:c},s),!0}},{match:e=>e[0]===`models`&&e[1]===`status`,run:async e=>{let t=n(e,`--probe-provider`);if(t===null)return!1;let r=n(e,`--probe-timeout`);if(r===null)return!1;let a=n(e,`--probe-concurrency`);if(a===null)return!1;let o=n(e,`--probe-max-tokens`);if(o===null)return!1;let c=n(e,`--agent`);if(c===null)return!1;let l=j(e,`--probe-profile`);if(l===null)return!1;let u=l.length===0?void 0:l.length===1?l[0]:l,d=i(e,`--json`),f=i(e,`--plain`),p=i(e,`--check`),m=i(e,`--probe`),{modelsStatusCommand:h}=await import(`./models-DfPjqkxA.js`);return await h({json:d,plain:f,check:p,probe:m,probeProvider:t,probeProfile:u,probeTimeout:r,probeConcurrency:a,probeMaxTokens:o,agent:c},s),!0}}];function N(e){for(let t of M)if(t.match(e))return t;return null}async function P(e){let t=i(e.argv,`--json`);C(_,{argv:e.argv}),await w({runtime:s,commandPath:e.commandPath,...t?{suppressDoctorStdout:!0}:{}}),(typeof e.loadPlugins==`function`?e.loadPlugins(e.argv):e.loadPlugins)&&x()}async function F(e){if(f(process.env.OPENCLAW_DISABLE_ROUTE_FIRST)||o(e))return!1;let t=r(e,2);if(!t[0])return!1;let n=N(t);return n?(await P({argv:e,commandPath:t,loadPlugins:n.loadPlugins}),n.run(e)):!1}async function I(){try{let{closeAllMemorySearchManagers:e}=await import(`./search-manager-Co5RwgQ4.js`).then(e=>e.n);await e()}catch{}}function L(e){let t=e.indexOf(`--update`);if(t===-1)return e;let n=[...e];return n.splice(t,1,`update`),n}function R(e){return e.hasBuiltinPrimary?!0:e.primary?!1:o(e.argv)}function z(e){if(o(e))return!1;let[t,n]=r(e,2);return t?!(t===`status`||t===`health`||t===`sessions`||t===`config`&&(n===`get`||n===`unset`)||t===`models`&&(n===`list`||n===`status`)):!0}async function B(e=T.argv){let n=h(e),r=p(n);if(!r.ok)throw Error(r.error);r.profile&&d({profile:r.profile}),n=r.argv,g({quiet:!0}),m(),z(n)&&b(),S();try{if(await F(n))return;l();let{buildProgram:e}=await import(`./program-DJxQx1DE.js`),r=e();y(),T.on(`uncaughtException`,e=>{console.error(`[openclaw] Uncaught exception:`,v(e)),T.exit(1)});let i=L(n),a=t(i);if(a){let{getProgramContext:e}=await import(`./program-context-CH9p6anW.js`).then(e=>e.n),t=e(r);if(t){let{registerCoreCliByName:e}=await import(`./command-registry-B-1wiWIV.js`).then(e=>e.t);await e(r,t,a,i)}let{registerSubCliByName:n}=await import(`./register.subclis-BmtNNMP2.js`).then(e=>e.a);await n(r,a)}if(!R({argv:i,primary:a,hasBuiltinPrimary:a!==null&&r.commands.some(e=>e.name()===a)})){let{registerPluginCliCommands:e}=await import(`./cli-DcG2OfeS.js`),{loadValidatedConfigForPluginRegistration:t}=await import(`./register.subclis-BmtNNMP2.js`).then(e=>e.a),n=await t();n&&e(r,n)}await r.parseAsync(i)}finally{await I()}}export{B as runCli};
@@ -1 +1 @@
1
- import{p as e}from"./subsystem-kTFXkQM5.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{Lt as t,jo as n}from"./auth-profiles-e3SmOvON.js";import"./agent-scope-BKE4M04k.js";import{l as r,p as i}from"./session-key-C7F_iqYg.js";import"./utils-7Gdj77QB.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-R4odAlsj.js";import"./version-q3SkUw2K.js";import"./registry-Div2nEwi.js";import"./skills-Df0CxTMH.js";import"./frontmatter-C7mzDNxd.js";import{r as a}from"./plugins-CCU8jDti.js";import"./logger-C1GUBMt-.js";import"./exec-CiwCrGw3.js";import"./windows-spawn-Dw4dpTt2.js";import"./redact-bVcVj47r.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-DNQO70y-.js";import"./send-Cfa08ZLE.js";import"./send-DmS34-Eb.js";import{Cn as o,O as s,bt as c,sr as l,st as u,w as d}from"./compact-DutiJiBy.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-D5CbqIVA.js";import"./tokens-D8eWI71q.js";import"./with-timeout-c1CzdShT.js";import{t as f}from"./deliver-HZ99jQzl.js";import"./diagnostic-CvLTqJbq.js";import"./send-CW3hfjkM.js";import"./pi-model-discovery-cW9be_SG.js";import"./exec-approvals-allowlist-DlYH42As.js";import"./exec-safe-bin-runtime-policy-Bu9bb9U5.js";import"./model-catalog-CI2eEH9Y.js";import"./fetch-Dj-FEHSr.js";import"./audio-transcription-runner-BwviCgP5.js";import"./fetch-guard-guH8Tmju.js";import"./image-DQ_3LMNb.js";import"./tool-display-BTuQQN92.js";import"./api-key-rotation-BRm3CNd-.js";import"./proxy-fetch-ByazCl5E.js";import"./ir-CsTyrPwa.js";import"./render-DrrPmnMI.js";import"./target-errors-BRLBPboT.js";import"./commands-DOhEGWJ2.js";import"./commands-registry-CqsggloB.js";import"./session-cost-usage-CHtVgnE8.js";import{c as p,o as m,s as h}from"./session-utils-Bh1ozdi-.js";import"./sqlite-DgdOh9U-.js";import"./call-D5NJXFgu.js";import"./pi-tools.policy-CklWbQkk.js";import"./pairing-store-CmT1fSmE.js";import"./fetch-Dh-apy46.js";import"./skill-commands-qdKWuiOR.js";import"./workspace-dirs-na4G79jL.js";import"./pairing-token-YrKlxjGC.js";import"./channel-activity-CFgOyIkh.js";import"./tables-5gR6U_tC.js";import"./kill-tree-DihujQie.js";import"./runtime-web-tools-BjmhIJkd.js";import"./runtime-HwYsJOk2.js";import"./node-shell-BuPDYFhk.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-C1kkZyEb.js";import"./plugin-auto-enable-CrVJR--r.js";import"./send-DQxQrVuw.js";import"./outbound-attachment-BKku_WUf.js";import"./delivery-queue-nkPJu0fY.js";import"./send-DVv1dCwu.js";import"./system-run-command-BT2tTJg2.js";import"./fetch-EBjfhrYU.js";import"./command-secret-targets-BtkZwOzh.js";import"./connection-auth-BIApbu6I.js";import"./onboard-helpers-CvWjz0op.js";import"./prompt-style-QJckocuy.js";import"./pairing-labels-B3wRXljf.js";import"./search-manager-Co5RwgQ4.js";import"./manager-p3CCKFcv.js";import"./memory-cli-CTXmLb0V.js";import"./links-pHmQCzdF.js";import"./cli-utils-BleB1eys.js";import"./help-format-BSNXPQuE.js";import"./progress-Cy6zNuIC.js";import"./exec-approvals-BXO9Cezj.js";import{c as g,l as _,r as v,s as y}from"./push-apns-BU-NR-pG.js";import{randomUUID as b}from"node:crypto";const x=1500,S=new Map;function C(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function w(e){return typeof e==`number`&&Number.isFinite(e)?Math.trunc(e):null}function T(e,t){let n=C(e.eventId)??C(e.providerEventId)??C(e.transcriptId);if(n)return`event:${n}`;let r=C(e.providerCallId)??C(e.callId),i=w(e.sequence)??w(e.seq);if(r&&i!==null)return`call-seq:${r}:${i}`;let a=w(e.timestamp)??w(e.ts)??w(e.eventTimestamp);return r&&a!==null?`call-ts:${r}:${a}`:a===null?`text:${t}`:`timestamp:${a}|text:${t}`}function E(e){let t=S.get(e.sessionKey);if(t&&t.fingerprint===e.fingerprint&&e.now-t.ts<=x)return!0;if(S.set(e.sessionKey,{fingerprint:e.fingerprint,ts:e.now}),S.size>200){let t=e.now-x*2;for(let[e,n]of S)if(n.ts<t&&S.delete(e),S.size<=200)break;for(;S.size>200;){let e=S.keys().next().value;if(e===void 0)break;S.delete(e)}}return!1}function D(e){let t=e.replace(/\s+/g,` `).trim();return t?t.length<=180?t:`${t.slice(0,179)}…`:``}function O(e){let t=e.replace(/\s+/g,` `).trim();return t?t.length<=120?t:`${t.slice(0,119)}…`:``}async function k(e){let{storePath:n}=e;n&&await t(n,t=>{let n=p({cfg:e.cfg,key:e.sessionKey,store:t});h({store:t,canonicalKey:n.canonicalKey,candidates:n.storeKeys}),t[e.canonicalKey]={sessionId:e.sessionId,updatedAt:e.now,thinkingLevel:e.entry?.thinkingLevel,verboseLevel:e.entry?.verboseLevel,reasoningLevel:e.entry?.reasoningLevel,systemSent:e.entry?.systemSent,sendPolicy:e.entry?.sendPolicy,lastChannel:e.entry?.lastChannel,lastTo:e.entry?.lastTo}})}function A(e){k({cfg:e.cfg,sessionKey:e.sessionKey,storePath:e.storePath,canonicalKey:e.canonicalKey,entry:e.entry,sessionId:e.sessionId,now:e.now}).catch(t=>{e.ctx.logGateway.warn(`voice session-store update failed: `+_(t))})}function j(e){let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let n=t,r=typeof n.sessionKey==`string`?n.sessionKey.trim():``;return r.length>0?r:null}function M(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}return typeof t==`object`&&t?t:null}async function N(e){let t=c({channel:e.channel,to:e.to,cfg:e.cfg,mode:`explicit`});if(!t.ok)throw Error(String(t.error));let n=l({cfg:e.cfg,sessionKey:e.sessionKey});await f({cfg:e.cfg,channel:e.channel,to:t.to,payloads:[{text:e.text}],session:n,bestEffort:!0,deps:s(e.deps)})}const P=async(t,s,c)=>{switch(c.event){case`voice.transcript`:{let i=M(c.payloadJSON);if(!i)return;let a=typeof i.text==`string`?i.text.trim():``;if(!a||a.length>2e4)return;let o=typeof i.sessionKey==`string`?i.sessionKey.trim():``,l=n(),u=r(l.session?.mainKey),f=o.length>0?o:u,{storePath:p,entry:h,canonicalKey:g}=m(f),v=Date.now();if(E({sessionKey:g,fingerprint:T(i,a),now:v}))return;let y=h?.sessionId??b();A({ctx:t,cfg:l,sessionKey:f,storePath:p,canonicalKey:g,entry:h,sessionId:y,now:v}),t.addChatRun(y,{sessionKey:g,clientRunId:`voice-${b()}`}),d({message:a,sessionId:y,sessionKey:g,thinking:`low`,deliver:!1,messageChannel:`node`,inputProvenance:{kind:`external_user`,sourceChannel:`voice`,sourceTool:`gateway.voice.transcript`},senderIsOwner:!1},e,t.deps).catch(e=>{t.logGateway.warn(`agent failed node=${s}: ${_(e)}`)});return}case`agent.request`:{if(!c.payloadJSON)return;let r=null;try{r=JSON.parse(c.payloadJSON)}catch{return}let i=(r?.message??``).trim(),o=y(r?.attachments??void 0),l=[];if(o.length>0)try{let e=await g(i,o,{maxBytes:5e6,log:t.logGateway});i=e.message.trim(),l=e.images}catch{return}if(!i||i.length>2e4)return;let u=a(typeof r?.channel==`string`?r.channel.trim():``)??void 0,f=typeof r?.to==`string`&&r.to.trim()?r.to.trim():void 0,p=!!r?.deliver,h=!!r?.receipt,v=(typeof r?.receiptText==`string`?r.receiptText.trim():``)||`Just received your iOS share + request, working on it.`,x=(r?.sessionKey??``).trim(),S=x.length>0?x:`node-${s}`,C=n(),{storePath:w,entry:T,canonicalKey:E}=m(S),D=Date.now(),O=T?.sessionId??b();if(await k({cfg:C,sessionKey:S,storePath:w,canonicalKey:E,entry:T,sessionId:O,now:D}),p&&(!u||!f)){let e=typeof T?.lastChannel==`string`?a(T.lastChannel):void 0,t=typeof T?.lastTo==`string`?T.lastTo.trim():``;!u&&e&&(u=e),!f&&t&&(f=t)}let A=p&&!!(u&&f),j=A?u:void 0,M=A?f:void 0;p&&!A&&t.logGateway.warn(`agent delivery disabled node=${s}: missing session delivery route (channel=${u??`-`} to=${f??`-`})`),h&&j&&M?N({cfg:C,deps:t.deps,sessionKey:E,channel:j,to:M,text:v}).catch(e=>{t.logGateway.warn(`agent receipt failed node=${s}: ${_(e)}`)}):h&&t.logGateway.warn(`agent receipt skipped node=${s}: missing delivery route (channel=${j??`-`} to=${M??`-`})`),d({message:i,images:l,sessionId:O,sessionKey:E,thinking:r?.thinking??void 0,deliver:A,to:M,channel:j,timeout:typeof r?.timeoutSeconds==`number`?r.timeoutSeconds.toString():void 0,messageChannel:`node`,senderIsOwner:!1},e,t.deps).catch(e=>{t.logGateway.warn(`agent failed node=${s}: ${_(e)}`)});return}case`notifications.changed`:{let e=M(c.payloadJSON);if(!e)return;let t=C(e.change)?.toLowerCase();if(t!==`posted`&&t!==`removed`)return;let n=C(e.key);if(!n)return;let{canonicalKey:r}=m(C(e.sessionKey)??`node-${s}`),i=C(e.packageName),a=O(C(e.title)??``),l=O(C(e.text)??``),d=`Notification ${t} (node=${s} key=${n}`;if(i&&(d+=` package=${i}`),d+=`)`,t===`posted`){let e=[a,l].filter(Boolean);e.length>0&&(d+=`: ${e.join(` - `)}`)}o(d,{sessionKey:r,contextKey:`notification:${n}`})&&u({reason:`notifications-event`,sessionKey:r});return}case`chat.subscribe`:{if(!c.payloadJSON)return;let e=j(c.payloadJSON);if(!e)return;t.nodeSubscribe(s,e);return}case`chat.unsubscribe`:{if(!c.payloadJSON)return;let e=j(c.payloadJSON);if(!e)return;t.nodeUnsubscribe(s,e);return}case`exec.started`:case`exec.finished`:case`exec.denied`:{let e=M(c.payloadJSON);if(!e)return;let t=typeof e.sessionKey==`string`?e.sessionKey.trim():`node-${s}`;if(!t||n().tools?.exec?.notifyOnExit===!1||e.suppressNotifyOnExit===!0)return;let r=typeof e.runId==`string`?e.runId.trim():``,a=typeof e.command==`string`?e.command.trim():``,l=typeof e.exitCode==`number`&&Number.isFinite(e.exitCode)?e.exitCode:void 0,d=e.timedOut===!0,f=typeof e.output==`string`?e.output.trim():``,p=typeof e.reason==`string`?e.reason.trim():``,m=``;if(c.event===`exec.started`)m=`Exec started (node=${s}${r?` id=${r}`:``})`,a&&(m+=`: ${a}`);else if(c.event===`exec.finished`){let e=d?`timeout`:`code ${l??`?`}`,t=D(f);if(!(d||l!==0||t.length>0))return;m=`Exec finished (node=${s}${r?` id=${r}`:``}, ${e})`,t&&(m+=`\n${t}`)}else m=`Exec denied (node=${s}${r?` id=${r}`:``}${p?`, ${p}`:``})`,a&&(m+=`: ${a}`);o(m,{sessionKey:t,contextKey:r?`exec:${r}`:`exec`}),u(i(t,{reason:`exec-event`}));return}case`push.apns.register`:{let e=M(c.payloadJSON);if(!e)return;let n=typeof e.token==`string`?e.token:``,r=typeof e.topic==`string`?e.topic:``,i=e.environment;try{await v({nodeId:s,token:n,topic:r,environment:i})}catch(e){t.logGateway.warn(`push apns register failed node=${s}: ${_(e)}`)}return}default:return}};export{P as handleNodeEvent};
1
+ import{p as e}from"./subsystem-kTFXkQM5.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{Lt as t,jo as n}from"./auth-profiles-e3SmOvON.js";import"./agent-scope-BKE4M04k.js";import{l as r,p as i}from"./session-key-C7F_iqYg.js";import"./utils-7Gdj77QB.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-R4odAlsj.js";import"./version-q3SkUw2K.js";import"./registry-Div2nEwi.js";import"./skills-Df0CxTMH.js";import"./frontmatter-C7mzDNxd.js";import{r as a}from"./plugins-CCU8jDti.js";import"./logger-C1GUBMt-.js";import"./exec-CiwCrGw3.js";import"./windows-spawn-Dw4dpTt2.js";import"./redact-bVcVj47r.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-DNQO70y-.js";import"./send-Cfa08ZLE.js";import"./send-DmS34-Eb.js";import{Cn as o,O as s,bt as c,sr as l,st as u,w as d}from"./compact-B5m4267P.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-D5CbqIVA.js";import"./tokens-D8eWI71q.js";import"./with-timeout-c1CzdShT.js";import{t as f}from"./deliver-HZ99jQzl.js";import"./diagnostic-CvLTqJbq.js";import"./send-CW3hfjkM.js";import"./pi-model-discovery-cW9be_SG.js";import"./exec-approvals-allowlist-DlYH42As.js";import"./exec-safe-bin-runtime-policy-Bu9bb9U5.js";import"./model-catalog-CI2eEH9Y.js";import"./fetch-Dj-FEHSr.js";import"./audio-transcription-runner-BwviCgP5.js";import"./fetch-guard-guH8Tmju.js";import"./image-DQ_3LMNb.js";import"./tool-display-BTuQQN92.js";import"./api-key-rotation-BRm3CNd-.js";import"./proxy-fetch-ByazCl5E.js";import"./ir-CsTyrPwa.js";import"./render-DrrPmnMI.js";import"./target-errors-BRLBPboT.js";import"./commands-DOhEGWJ2.js";import"./commands-registry-CqsggloB.js";import"./session-cost-usage-CHtVgnE8.js";import{c as p,o as m,s as h}from"./session-utils-Bh1ozdi-.js";import"./sqlite-DgdOh9U-.js";import"./call-D5NJXFgu.js";import"./pi-tools.policy-CklWbQkk.js";import"./pairing-store-CmT1fSmE.js";import"./fetch-Dh-apy46.js";import"./skill-commands-qdKWuiOR.js";import"./workspace-dirs-na4G79jL.js";import"./pairing-token-YrKlxjGC.js";import"./channel-activity-CFgOyIkh.js";import"./tables-5gR6U_tC.js";import"./kill-tree-DihujQie.js";import"./runtime-web-tools-BjmhIJkd.js";import"./runtime-HwYsJOk2.js";import"./node-shell-BuPDYFhk.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-C1kkZyEb.js";import"./plugin-auto-enable-CrVJR--r.js";import"./send-DQxQrVuw.js";import"./outbound-attachment-BKku_WUf.js";import"./delivery-queue-nkPJu0fY.js";import"./send-DVv1dCwu.js";import"./system-run-command-BT2tTJg2.js";import"./fetch-EBjfhrYU.js";import"./command-secret-targets-BtkZwOzh.js";import"./connection-auth-BIApbu6I.js";import"./onboard-helpers-CvWjz0op.js";import"./prompt-style-QJckocuy.js";import"./pairing-labels-B3wRXljf.js";import"./search-manager-Co5RwgQ4.js";import"./manager-p3CCKFcv.js";import"./memory-cli-CTXmLb0V.js";import"./links-pHmQCzdF.js";import"./cli-utils-BleB1eys.js";import"./help-format-BSNXPQuE.js";import"./progress-Cy6zNuIC.js";import"./exec-approvals-BXO9Cezj.js";import{c as g,l as _,r as v,s as y}from"./push-apns-CIV5yU-C.js";import{randomUUID as b}from"node:crypto";const x=1500,S=new Map;function C(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function w(e){return typeof e==`number`&&Number.isFinite(e)?Math.trunc(e):null}function T(e,t){let n=C(e.eventId)??C(e.providerEventId)??C(e.transcriptId);if(n)return`event:${n}`;let r=C(e.providerCallId)??C(e.callId),i=w(e.sequence)??w(e.seq);if(r&&i!==null)return`call-seq:${r}:${i}`;let a=w(e.timestamp)??w(e.ts)??w(e.eventTimestamp);return r&&a!==null?`call-ts:${r}:${a}`:a===null?`text:${t}`:`timestamp:${a}|text:${t}`}function E(e){let t=S.get(e.sessionKey);if(t&&t.fingerprint===e.fingerprint&&e.now-t.ts<=x)return!0;if(S.set(e.sessionKey,{fingerprint:e.fingerprint,ts:e.now}),S.size>200){let t=e.now-x*2;for(let[e,n]of S)if(n.ts<t&&S.delete(e),S.size<=200)break;for(;S.size>200;){let e=S.keys().next().value;if(e===void 0)break;S.delete(e)}}return!1}function D(e){let t=e.replace(/\s+/g,` `).trim();return t?t.length<=180?t:`${t.slice(0,179)}…`:``}function O(e){let t=e.replace(/\s+/g,` `).trim();return t?t.length<=120?t:`${t.slice(0,119)}…`:``}async function k(e){let{storePath:n}=e;n&&await t(n,t=>{let n=p({cfg:e.cfg,key:e.sessionKey,store:t});h({store:t,canonicalKey:n.canonicalKey,candidates:n.storeKeys}),t[e.canonicalKey]={sessionId:e.sessionId,updatedAt:e.now,thinkingLevel:e.entry?.thinkingLevel,verboseLevel:e.entry?.verboseLevel,reasoningLevel:e.entry?.reasoningLevel,systemSent:e.entry?.systemSent,sendPolicy:e.entry?.sendPolicy,lastChannel:e.entry?.lastChannel,lastTo:e.entry?.lastTo}})}function A(e){k({cfg:e.cfg,sessionKey:e.sessionKey,storePath:e.storePath,canonicalKey:e.canonicalKey,entry:e.entry,sessionId:e.sessionId,now:e.now}).catch(t=>{e.ctx.logGateway.warn(`voice session-store update failed: `+_(t))})}function j(e){let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let n=t,r=typeof n.sessionKey==`string`?n.sessionKey.trim():``;return r.length>0?r:null}function M(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}return typeof t==`object`&&t?t:null}async function N(e){let t=c({channel:e.channel,to:e.to,cfg:e.cfg,mode:`explicit`});if(!t.ok)throw Error(String(t.error));let n=l({cfg:e.cfg,sessionKey:e.sessionKey});await f({cfg:e.cfg,channel:e.channel,to:t.to,payloads:[{text:e.text}],session:n,bestEffort:!0,deps:s(e.deps)})}const P=async(t,s,c)=>{switch(c.event){case`voice.transcript`:{let i=M(c.payloadJSON);if(!i)return;let a=typeof i.text==`string`?i.text.trim():``;if(!a||a.length>2e4)return;let o=typeof i.sessionKey==`string`?i.sessionKey.trim():``,l=n(),u=r(l.session?.mainKey),f=o.length>0?o:u,{storePath:p,entry:h,canonicalKey:g}=m(f),v=Date.now();if(E({sessionKey:g,fingerprint:T(i,a),now:v}))return;let y=h?.sessionId??b();A({ctx:t,cfg:l,sessionKey:f,storePath:p,canonicalKey:g,entry:h,sessionId:y,now:v}),t.addChatRun(y,{sessionKey:g,clientRunId:`voice-${b()}`}),d({message:a,sessionId:y,sessionKey:g,thinking:`low`,deliver:!1,messageChannel:`node`,inputProvenance:{kind:`external_user`,sourceChannel:`voice`,sourceTool:`gateway.voice.transcript`},senderIsOwner:!1},e,t.deps).catch(e=>{t.logGateway.warn(`agent failed node=${s}: ${_(e)}`)});return}case`agent.request`:{if(!c.payloadJSON)return;let r=null;try{r=JSON.parse(c.payloadJSON)}catch{return}let i=(r?.message??``).trim(),o=y(r?.attachments??void 0),l=[];if(o.length>0)try{let e=await g(i,o,{maxBytes:5e6,log:t.logGateway});i=e.message.trim(),l=e.images}catch{return}if(!i||i.length>2e4)return;let u=a(typeof r?.channel==`string`?r.channel.trim():``)??void 0,f=typeof r?.to==`string`&&r.to.trim()?r.to.trim():void 0,p=!!r?.deliver,h=!!r?.receipt,v=(typeof r?.receiptText==`string`?r.receiptText.trim():``)||`Just received your iOS share + request, working on it.`,x=(r?.sessionKey??``).trim(),S=x.length>0?x:`node-${s}`,C=n(),{storePath:w,entry:T,canonicalKey:E}=m(S),D=Date.now(),O=T?.sessionId??b();if(await k({cfg:C,sessionKey:S,storePath:w,canonicalKey:E,entry:T,sessionId:O,now:D}),p&&(!u||!f)){let e=typeof T?.lastChannel==`string`?a(T.lastChannel):void 0,t=typeof T?.lastTo==`string`?T.lastTo.trim():``;!u&&e&&(u=e),!f&&t&&(f=t)}let A=p&&!!(u&&f),j=A?u:void 0,M=A?f:void 0;p&&!A&&t.logGateway.warn(`agent delivery disabled node=${s}: missing session delivery route (channel=${u??`-`} to=${f??`-`})`),h&&j&&M?N({cfg:C,deps:t.deps,sessionKey:E,channel:j,to:M,text:v}).catch(e=>{t.logGateway.warn(`agent receipt failed node=${s}: ${_(e)}`)}):h&&t.logGateway.warn(`agent receipt skipped node=${s}: missing delivery route (channel=${j??`-`} to=${M??`-`})`),d({message:i,images:l,sessionId:O,sessionKey:E,thinking:r?.thinking??void 0,deliver:A,to:M,channel:j,timeout:typeof r?.timeoutSeconds==`number`?r.timeoutSeconds.toString():void 0,messageChannel:`node`,senderIsOwner:!1},e,t.deps).catch(e=>{t.logGateway.warn(`agent failed node=${s}: ${_(e)}`)});return}case`notifications.changed`:{let e=M(c.payloadJSON);if(!e)return;let t=C(e.change)?.toLowerCase();if(t!==`posted`&&t!==`removed`)return;let n=C(e.key);if(!n)return;let{canonicalKey:r}=m(C(e.sessionKey)??`node-${s}`),i=C(e.packageName),a=O(C(e.title)??``),l=O(C(e.text)??``),d=`Notification ${t} (node=${s} key=${n}`;if(i&&(d+=` package=${i}`),d+=`)`,t===`posted`){let e=[a,l].filter(Boolean);e.length>0&&(d+=`: ${e.join(` - `)}`)}o(d,{sessionKey:r,contextKey:`notification:${n}`})&&u({reason:`notifications-event`,sessionKey:r});return}case`chat.subscribe`:{if(!c.payloadJSON)return;let e=j(c.payloadJSON);if(!e)return;t.nodeSubscribe(s,e);return}case`chat.unsubscribe`:{if(!c.payloadJSON)return;let e=j(c.payloadJSON);if(!e)return;t.nodeUnsubscribe(s,e);return}case`exec.started`:case`exec.finished`:case`exec.denied`:{let e=M(c.payloadJSON);if(!e)return;let t=typeof e.sessionKey==`string`?e.sessionKey.trim():`node-${s}`;if(!t||n().tools?.exec?.notifyOnExit===!1||e.suppressNotifyOnExit===!0)return;let r=typeof e.runId==`string`?e.runId.trim():``,a=typeof e.command==`string`?e.command.trim():``,l=typeof e.exitCode==`number`&&Number.isFinite(e.exitCode)?e.exitCode:void 0,d=e.timedOut===!0,f=typeof e.output==`string`?e.output.trim():``,p=typeof e.reason==`string`?e.reason.trim():``,m=``;if(c.event===`exec.started`)m=`Exec started (node=${s}${r?` id=${r}`:``})`,a&&(m+=`: ${a}`);else if(c.event===`exec.finished`){let e=d?`timeout`:`code ${l??`?`}`,t=D(f);if(!(d||l!==0||t.length>0))return;m=`Exec finished (node=${s}${r?` id=${r}`:``}, ${e})`,t&&(m+=`\n${t}`)}else m=`Exec denied (node=${s}${r?` id=${r}`:``}${p?`, ${p}`:``})`,a&&(m+=`: ${a}`);o(m,{sessionKey:t,contextKey:r?`exec:${r}`:`exec`}),u(i(t,{reason:`exec-event`}));return}case`push.apns.register`:{let e=M(c.payloadJSON);if(!e)return;let n=typeof e.token==`string`?e.token:``,r=typeof e.topic==`string`?e.topic:``,i=e.environment;try{await v({nodeId:s,token:n,topic:r,environment:i})}catch(e){t.logGateway.warn(`push apns register failed node=${s}: ${_(e)}`)}return}default:return}};export{P as handleNodeEvent};
@@ -1 +1 @@
1
- import"./paths-B4IRk3wi.js";import{p as e}from"./subsystem-BQ1073Mu.js";import"./utils-D1PlBTFH.js";import{Jn as t,qs as n}from"./model-selection-B2r_LMFb.js";import{Gn as r,Kt as i,M as a,Mt as o,N as s,Ot as c,Sn as l,br as u,j as d}from"./reply-DHtpIWpD.js";import"./agent-scope-DW6ZDCxj.js";import{l as f,p}from"./session-key-D3P0tf5P.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import"./boolean-Ch3DfXPy.js";import"./env-BI_g1HfG.js";import"./env-overrides-C0vMeCeX.js";import"./registry-BwcVQtsI.js";import"./skills-CZ7zEDmo.js";import"./frontmatter-BkZkwkVO.js";import{r as m}from"./plugins-1aNlpDX7.js";import"./logger-Bgqzq_Zu.js";import"./exec-BdtFni8N.js";import"./windows-spawn-B36IG4s2.js";import"./redact-DsC5EnL7.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-y2V0aFIS.js";import"./send-DyCUb7oW.js";import"./send-C6J_nLb9.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-DsYKaMCI.js";import"./image-6t162ig6.js";import"./models-config-PU32mWpc.js";import"./tool-display-DBTvIf_I.js";import"./fetch-guard-11xgsj9-.js";import"./api-key-rotation-CayDxQxo.js";import"./local-roots-ClGHF49W.js";import"./model-catalog-CXx8LKWX.js";import"./proxy-fetch-Ci8QXzzm.js";import"./tokens-xmkeRJqo.js";import{t as h}from"./deliver-Dg2TVF1M.js";import"./commands-FDnZnqN5.js";import"./commands-registry-BEMFeaZR.js";import"./pairing-store-mQs2yMkt.js";import"./fetch-Dikjvc5M.js";import"./call-BQAAYLj3.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-kojLym9G.js";import"./send-aEwJo2mZ2.js";import"./pi-model-discovery-DMZplc-U.js";import"./exec-approvals-allowlist-Bh3Rw-aC.js";import"./exec-safe-bin-runtime-policy-BxN1_8e_.js";import"./ir-DcrzIcfF.js";import"./render-D8OWO2hT.js";import"./target-errors-B1wrjiTA.js";import"./read-only-account-inspect-DLD1Pk6l.js";import"./channel-selection-BuH6syM3.js";import"./plugin-auto-enable-DzUZAwai.js";import"./send-HOAYSr2i.js";import"./outbound-attachment-lrGTAaR-.js";import"./delivery-queue-CKbauSFq.js";import"./send-w-vabJ4U.js";import"./channel-activity-CBKv0fto.js";import"./tables-DwrGp-F-.js";import"./fetch-D4txy8qG.js";import"./skill-commands-BN3rmzgq.js";import"./workspace-dirs-BMGwwM6X.js";import"./pairing-token-BipkTRNW.js";import"./restart-Dal_HOce.js";import"./runtime-web-tools-BiMD0yHU.js";import"./command-secret-targets-CbrSGcvV.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-BCxq0f5b.js";import"./onboard-helpers-CKsetIvC.js";import"./prompt-style-DpAh867d.js";import"./pairing-labels-iZoSa-aT.js";import"./memory-cli-P0GDvKlz.js";import"./query-expansion-BNl6JMlz.js";import"./manager-DKyEk2dt.js";import"./links-jlebCPFf.js";import"./cli-utils-BY7dLMFy.js";import"./help-format-Cav62lfS.js";import"./progress-Cyn5U745.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-B1Y6pbxs.js";import"./system-run-command-B212q8f9.js";import"./runtime-Dz2qgcJk.js";import"./stagger-DmFYysrJ.js";import{c as g,l as _,r as v,s as y}from"./push-apns-CrGncT7C.js";import{randomUUID as b}from"node:crypto";const x=1500,S=new Map;function C(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function w(e){return typeof e==`number`&&Number.isFinite(e)?Math.trunc(e):null}function T(e,t){let n=C(e.eventId)??C(e.providerEventId)??C(e.transcriptId);if(n)return`event:${n}`;let r=C(e.providerCallId)??C(e.callId),i=w(e.sequence)??w(e.seq);if(r&&i!==null)return`call-seq:${r}:${i}`;let a=w(e.timestamp)??w(e.ts)??w(e.eventTimestamp);return r&&a!==null?`call-ts:${r}:${a}`:a===null?`text:${t}`:`timestamp:${a}|text:${t}`}function E(e){let t=S.get(e.sessionKey);if(t&&t.fingerprint===e.fingerprint&&e.now-t.ts<=x)return!0;if(S.set(e.sessionKey,{fingerprint:e.fingerprint,ts:e.now}),S.size>200){let t=e.now-x*2;for(let[e,n]of S)if(n.ts<t&&S.delete(e),S.size<=200)break;for(;S.size>200;){let e=S.keys().next().value;if(e===void 0)break;S.delete(e)}}return!1}function D(e){let t=e.replace(/\s+/g,` `).trim();return t?t.length<=180?t:`${t.slice(0,179)}…`:``}function O(e){let t=e.replace(/\s+/g,` `).trim();return t?t.length<=120?t:`${t.slice(0,119)}…`:``}async function k(e){let{storePath:n}=e;n&&await t(n,t=>{let n=s({cfg:e.cfg,key:e.sessionKey,store:t});a({store:t,canonicalKey:n.canonicalKey,candidates:n.storeKeys}),t[e.canonicalKey]={sessionId:e.sessionId,updatedAt:e.now,thinkingLevel:e.entry?.thinkingLevel,verboseLevel:e.entry?.verboseLevel,reasoningLevel:e.entry?.reasoningLevel,systemSent:e.entry?.systemSent,sendPolicy:e.entry?.sendPolicy,lastChannel:e.entry?.lastChannel,lastTo:e.entry?.lastTo}})}function A(e){k({cfg:e.cfg,sessionKey:e.sessionKey,storePath:e.storePath,canonicalKey:e.canonicalKey,entry:e.entry,sessionId:e.sessionId,now:e.now}).catch(t=>{e.ctx.logGateway.warn(`voice session-store update failed: `+_(t))})}function j(e){let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let n=t,r=typeof n.sessionKey==`string`?n.sessionKey.trim():``;return r.length>0?r:null}function M(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}return typeof t==`object`&&t?t:null}async function N(e){let t=r({channel:e.channel,to:e.to,cfg:e.cfg,mode:`explicit`});if(!t.ok)throw Error(String(t.error));let n=u({cfg:e.cfg,sessionKey:e.sessionKey});await h({cfg:e.cfg,channel:e.channel,to:t.to,payloads:[{text:e.text}],session:n,bestEffort:!0,deps:o(e.deps)})}const P=async(t,r,a)=>{switch(a.event){case`voice.transcript`:{let i=M(a.payloadJSON);if(!i)return;let o=typeof i.text==`string`?i.text.trim():``;if(!o||o.length>2e4)return;let s=typeof i.sessionKey==`string`?i.sessionKey.trim():``,l=n(),u=f(l.session?.mainKey),p=s.length>0?s:u,{storePath:m,entry:h,canonicalKey:g}=d(p),v=Date.now();if(E({sessionKey:g,fingerprint:T(i,o),now:v}))return;let y=h?.sessionId??b();A({ctx:t,cfg:l,sessionKey:p,storePath:m,canonicalKey:g,entry:h,sessionId:y,now:v}),t.addChatRun(y,{sessionKey:g,clientRunId:`voice-${b()}`}),c({message:o,sessionId:y,sessionKey:g,thinking:`low`,deliver:!1,messageChannel:`node`,inputProvenance:{kind:`external_user`,sourceChannel:`voice`,sourceTool:`gateway.voice.transcript`},senderIsOwner:!1},e,t.deps).catch(e=>{t.logGateway.warn(`agent failed node=${r}: ${_(e)}`)});return}case`agent.request`:{if(!a.payloadJSON)return;let i=null;try{i=JSON.parse(a.payloadJSON)}catch{return}let o=(i?.message??``).trim(),s=y(i?.attachments??void 0),l=[];if(s.length>0)try{let e=await g(o,s,{maxBytes:5e6,log:t.logGateway});o=e.message.trim(),l=e.images}catch{return}if(!o||o.length>2e4)return;let u=m(typeof i?.channel==`string`?i.channel.trim():``)??void 0,f=typeof i?.to==`string`&&i.to.trim()?i.to.trim():void 0,p=!!i?.deliver,h=!!i?.receipt,v=(typeof i?.receiptText==`string`?i.receiptText.trim():``)||`Just received your iOS share + request, working on it.`,x=(i?.sessionKey??``).trim(),S=x.length>0?x:`node-${r}`,C=n(),{storePath:w,entry:T,canonicalKey:E}=d(S),D=Date.now(),O=T?.sessionId??b();if(await k({cfg:C,sessionKey:S,storePath:w,canonicalKey:E,entry:T,sessionId:O,now:D}),p&&(!u||!f)){let e=typeof T?.lastChannel==`string`?m(T.lastChannel):void 0,t=typeof T?.lastTo==`string`?T.lastTo.trim():``;!u&&e&&(u=e),!f&&t&&(f=t)}let A=p&&!!(u&&f),j=A?u:void 0,M=A?f:void 0;p&&!A&&t.logGateway.warn(`agent delivery disabled node=${r}: missing session delivery route (channel=${u??`-`} to=${f??`-`})`),h&&j&&M?N({cfg:C,deps:t.deps,sessionKey:E,channel:j,to:M,text:v}).catch(e=>{t.logGateway.warn(`agent receipt failed node=${r}: ${_(e)}`)}):h&&t.logGateway.warn(`agent receipt skipped node=${r}: missing delivery route (channel=${j??`-`} to=${M??`-`})`),c({message:o,images:l,sessionId:O,sessionKey:E,thinking:i?.thinking??void 0,deliver:A,to:M,channel:j,timeout:typeof i?.timeoutSeconds==`number`?i.timeoutSeconds.toString():void 0,messageChannel:`node`,senderIsOwner:!1},e,t.deps).catch(e=>{t.logGateway.warn(`agent failed node=${r}: ${_(e)}`)});return}case`notifications.changed`:{let e=M(a.payloadJSON);if(!e)return;let t=C(e.change)?.toLowerCase();if(t!==`posted`&&t!==`removed`)return;let n=C(e.key);if(!n)return;let{canonicalKey:o}=d(C(e.sessionKey)??`node-${r}`),s=C(e.packageName),c=O(C(e.title)??``),u=O(C(e.text)??``),f=`Notification ${t} (node=${r} key=${n}`;if(s&&(f+=` package=${s}`),f+=`)`,t===`posted`){let e=[c,u].filter(Boolean);e.length>0&&(f+=`: ${e.join(` - `)}`)}l(f,{sessionKey:o,contextKey:`notification:${n}`})&&i({reason:`notifications-event`,sessionKey:o});return}case`chat.subscribe`:{if(!a.payloadJSON)return;let e=j(a.payloadJSON);if(!e)return;t.nodeSubscribe(r,e);return}case`chat.unsubscribe`:{if(!a.payloadJSON)return;let e=j(a.payloadJSON);if(!e)return;t.nodeUnsubscribe(r,e);return}case`exec.started`:case`exec.finished`:case`exec.denied`:{let e=M(a.payloadJSON);if(!e)return;let t=typeof e.sessionKey==`string`?e.sessionKey.trim():`node-${r}`;if(!t||n().tools?.exec?.notifyOnExit===!1||e.suppressNotifyOnExit===!0)return;let o=typeof e.runId==`string`?e.runId.trim():``,s=typeof e.command==`string`?e.command.trim():``,c=typeof e.exitCode==`number`&&Number.isFinite(e.exitCode)?e.exitCode:void 0,u=e.timedOut===!0,d=typeof e.output==`string`?e.output.trim():``,f=typeof e.reason==`string`?e.reason.trim():``,m=``;if(a.event===`exec.started`)m=`Exec started (node=${r}${o?` id=${o}`:``})`,s&&(m+=`: ${s}`);else if(a.event===`exec.finished`){let e=u?`timeout`:`code ${c??`?`}`,t=D(d);if(!(u||c!==0||t.length>0))return;m=`Exec finished (node=${r}${o?` id=${o}`:``}, ${e})`,t&&(m+=`\n${t}`)}else m=`Exec denied (node=${r}${o?` id=${o}`:``}${f?`, ${f}`:``})`,s&&(m+=`: ${s}`);l(m,{sessionKey:t,contextKey:o?`exec:${o}`:`exec`}),i(p(t,{reason:`exec-event`}));return}case`push.apns.register`:{let e=M(a.payloadJSON);if(!e)return;let n=typeof e.token==`string`?e.token:``,i=typeof e.topic==`string`?e.topic:``,o=e.environment;try{await v({nodeId:r,token:n,topic:i,environment:o})}catch(e){t.logGateway.warn(`push apns register failed node=${r}: ${_(e)}`)}return}default:return}};export{P as handleNodeEvent};
1
+ import"./paths-B4IRk3wi.js";import{p as e}from"./subsystem-BQ1073Mu.js";import"./utils-D1PlBTFH.js";import{Jn as t,qs as n}from"./model-selection-B2r_LMFb.js";import{Gn as r,Kt as i,M as a,Mt as o,N as s,Ot as c,Sn as l,br as u,j as d}from"./reply-HrabJs88.js";import"./agent-scope-DW6ZDCxj.js";import{l as f,p}from"./session-key-D3P0tf5P.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import"./boolean-Ch3DfXPy.js";import"./env-BI_g1HfG.js";import"./env-overrides-C0vMeCeX.js";import"./registry-BwcVQtsI.js";import"./skills-CZ7zEDmo.js";import"./frontmatter-BkZkwkVO.js";import{r as m}from"./plugins-1aNlpDX7.js";import"./logger-Bgqzq_Zu.js";import"./exec-BdtFni8N.js";import"./windows-spawn-B36IG4s2.js";import"./redact-DsC5EnL7.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-y2V0aFIS.js";import"./send-DyCUb7oW.js";import"./send-C6J_nLb9.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-DsYKaMCI.js";import"./image-6t162ig6.js";import"./models-config-PU32mWpc.js";import"./tool-display-DBTvIf_I.js";import"./fetch-guard-11xgsj9-.js";import"./api-key-rotation-CayDxQxo.js";import"./local-roots-ClGHF49W.js";import"./model-catalog-CXx8LKWX.js";import"./proxy-fetch-Ci8QXzzm.js";import"./tokens-xmkeRJqo.js";import{t as h}from"./deliver-Dg2TVF1M.js";import"./commands-FDnZnqN5.js";import"./commands-registry-BEMFeaZR.js";import"./pairing-store-mQs2yMkt.js";import"./fetch-Dikjvc5M.js";import"./call-BQAAYLj3.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-kojLym9G.js";import"./send-aEwJo2mZ2.js";import"./pi-model-discovery-DMZplc-U.js";import"./exec-approvals-allowlist-Bh3Rw-aC.js";import"./exec-safe-bin-runtime-policy-BxN1_8e_.js";import"./ir-DcrzIcfF.js";import"./render-D8OWO2hT.js";import"./target-errors-B1wrjiTA.js";import"./read-only-account-inspect-DLD1Pk6l.js";import"./channel-selection-BuH6syM3.js";import"./plugin-auto-enable-DzUZAwai.js";import"./send-HOAYSr2i.js";import"./outbound-attachment-lrGTAaR-.js";import"./delivery-queue-CKbauSFq.js";import"./send-w-vabJ4U.js";import"./channel-activity-CBKv0fto.js";import"./tables-DwrGp-F-.js";import"./fetch-D4txy8qG.js";import"./skill-commands-BN3rmzgq.js";import"./workspace-dirs-BMGwwM6X.js";import"./pairing-token-BipkTRNW.js";import"./restart-Dal_HOce.js";import"./runtime-web-tools-BiMD0yHU.js";import"./command-secret-targets-CbrSGcvV.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-BCxq0f5b.js";import"./onboard-helpers-CKsetIvC.js";import"./prompt-style-DpAh867d.js";import"./pairing-labels-iZoSa-aT.js";import"./memory-cli-P0GDvKlz.js";import"./query-expansion-BNl6JMlz.js";import"./manager-DKyEk2dt.js";import"./links-jlebCPFf.js";import"./cli-utils-BY7dLMFy.js";import"./help-format-Cav62lfS.js";import"./progress-Cyn5U745.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-B1Y6pbxs.js";import"./system-run-command-B212q8f9.js";import"./runtime-Dz2qgcJk.js";import"./stagger-DmFYysrJ.js";import{c as g,l as _,r as v,s as y}from"./push-apns-DOhrdJ5p.js";import{randomUUID as b}from"node:crypto";const x=1500,S=new Map;function C(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function w(e){return typeof e==`number`&&Number.isFinite(e)?Math.trunc(e):null}function T(e,t){let n=C(e.eventId)??C(e.providerEventId)??C(e.transcriptId);if(n)return`event:${n}`;let r=C(e.providerCallId)??C(e.callId),i=w(e.sequence)??w(e.seq);if(r&&i!==null)return`call-seq:${r}:${i}`;let a=w(e.timestamp)??w(e.ts)??w(e.eventTimestamp);return r&&a!==null?`call-ts:${r}:${a}`:a===null?`text:${t}`:`timestamp:${a}|text:${t}`}function E(e){let t=S.get(e.sessionKey);if(t&&t.fingerprint===e.fingerprint&&e.now-t.ts<=x)return!0;if(S.set(e.sessionKey,{fingerprint:e.fingerprint,ts:e.now}),S.size>200){let t=e.now-x*2;for(let[e,n]of S)if(n.ts<t&&S.delete(e),S.size<=200)break;for(;S.size>200;){let e=S.keys().next().value;if(e===void 0)break;S.delete(e)}}return!1}function D(e){let t=e.replace(/\s+/g,` `).trim();return t?t.length<=180?t:`${t.slice(0,179)}…`:``}function O(e){let t=e.replace(/\s+/g,` `).trim();return t?t.length<=120?t:`${t.slice(0,119)}…`:``}async function k(e){let{storePath:n}=e;n&&await t(n,t=>{let n=s({cfg:e.cfg,key:e.sessionKey,store:t});a({store:t,canonicalKey:n.canonicalKey,candidates:n.storeKeys}),t[e.canonicalKey]={sessionId:e.sessionId,updatedAt:e.now,thinkingLevel:e.entry?.thinkingLevel,verboseLevel:e.entry?.verboseLevel,reasoningLevel:e.entry?.reasoningLevel,systemSent:e.entry?.systemSent,sendPolicy:e.entry?.sendPolicy,lastChannel:e.entry?.lastChannel,lastTo:e.entry?.lastTo}})}function A(e){k({cfg:e.cfg,sessionKey:e.sessionKey,storePath:e.storePath,canonicalKey:e.canonicalKey,entry:e.entry,sessionId:e.sessionId,now:e.now}).catch(t=>{e.ctx.logGateway.warn(`voice session-store update failed: `+_(t))})}function j(e){let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let n=t,r=typeof n.sessionKey==`string`?n.sessionKey.trim():``;return r.length>0?r:null}function M(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}return typeof t==`object`&&t?t:null}async function N(e){let t=r({channel:e.channel,to:e.to,cfg:e.cfg,mode:`explicit`});if(!t.ok)throw Error(String(t.error));let n=u({cfg:e.cfg,sessionKey:e.sessionKey});await h({cfg:e.cfg,channel:e.channel,to:t.to,payloads:[{text:e.text}],session:n,bestEffort:!0,deps:o(e.deps)})}const P=async(t,r,a)=>{switch(a.event){case`voice.transcript`:{let i=M(a.payloadJSON);if(!i)return;let o=typeof i.text==`string`?i.text.trim():``;if(!o||o.length>2e4)return;let s=typeof i.sessionKey==`string`?i.sessionKey.trim():``,l=n(),u=f(l.session?.mainKey),p=s.length>0?s:u,{storePath:m,entry:h,canonicalKey:g}=d(p),v=Date.now();if(E({sessionKey:g,fingerprint:T(i,o),now:v}))return;let y=h?.sessionId??b();A({ctx:t,cfg:l,sessionKey:p,storePath:m,canonicalKey:g,entry:h,sessionId:y,now:v}),t.addChatRun(y,{sessionKey:g,clientRunId:`voice-${b()}`}),c({message:o,sessionId:y,sessionKey:g,thinking:`low`,deliver:!1,messageChannel:`node`,inputProvenance:{kind:`external_user`,sourceChannel:`voice`,sourceTool:`gateway.voice.transcript`},senderIsOwner:!1},e,t.deps).catch(e=>{t.logGateway.warn(`agent failed node=${r}: ${_(e)}`)});return}case`agent.request`:{if(!a.payloadJSON)return;let i=null;try{i=JSON.parse(a.payloadJSON)}catch{return}let o=(i?.message??``).trim(),s=y(i?.attachments??void 0),l=[];if(s.length>0)try{let e=await g(o,s,{maxBytes:5e6,log:t.logGateway});o=e.message.trim(),l=e.images}catch{return}if(!o||o.length>2e4)return;let u=m(typeof i?.channel==`string`?i.channel.trim():``)??void 0,f=typeof i?.to==`string`&&i.to.trim()?i.to.trim():void 0,p=!!i?.deliver,h=!!i?.receipt,v=(typeof i?.receiptText==`string`?i.receiptText.trim():``)||`Just received your iOS share + request, working on it.`,x=(i?.sessionKey??``).trim(),S=x.length>0?x:`node-${r}`,C=n(),{storePath:w,entry:T,canonicalKey:E}=d(S),D=Date.now(),O=T?.sessionId??b();if(await k({cfg:C,sessionKey:S,storePath:w,canonicalKey:E,entry:T,sessionId:O,now:D}),p&&(!u||!f)){let e=typeof T?.lastChannel==`string`?m(T.lastChannel):void 0,t=typeof T?.lastTo==`string`?T.lastTo.trim():``;!u&&e&&(u=e),!f&&t&&(f=t)}let A=p&&!!(u&&f),j=A?u:void 0,M=A?f:void 0;p&&!A&&t.logGateway.warn(`agent delivery disabled node=${r}: missing session delivery route (channel=${u??`-`} to=${f??`-`})`),h&&j&&M?N({cfg:C,deps:t.deps,sessionKey:E,channel:j,to:M,text:v}).catch(e=>{t.logGateway.warn(`agent receipt failed node=${r}: ${_(e)}`)}):h&&t.logGateway.warn(`agent receipt skipped node=${r}: missing delivery route (channel=${j??`-`} to=${M??`-`})`),c({message:o,images:l,sessionId:O,sessionKey:E,thinking:i?.thinking??void 0,deliver:A,to:M,channel:j,timeout:typeof i?.timeoutSeconds==`number`?i.timeoutSeconds.toString():void 0,messageChannel:`node`,senderIsOwner:!1},e,t.deps).catch(e=>{t.logGateway.warn(`agent failed node=${r}: ${_(e)}`)});return}case`notifications.changed`:{let e=M(a.payloadJSON);if(!e)return;let t=C(e.change)?.toLowerCase();if(t!==`posted`&&t!==`removed`)return;let n=C(e.key);if(!n)return;let{canonicalKey:o}=d(C(e.sessionKey)??`node-${r}`),s=C(e.packageName),c=O(C(e.title)??``),u=O(C(e.text)??``),f=`Notification ${t} (node=${r} key=${n}`;if(s&&(f+=` package=${s}`),f+=`)`,t===`posted`){let e=[c,u].filter(Boolean);e.length>0&&(f+=`: ${e.join(` - `)}`)}l(f,{sessionKey:o,contextKey:`notification:${n}`})&&i({reason:`notifications-event`,sessionKey:o});return}case`chat.subscribe`:{if(!a.payloadJSON)return;let e=j(a.payloadJSON);if(!e)return;t.nodeSubscribe(r,e);return}case`chat.unsubscribe`:{if(!a.payloadJSON)return;let e=j(a.payloadJSON);if(!e)return;t.nodeUnsubscribe(r,e);return}case`exec.started`:case`exec.finished`:case`exec.denied`:{let e=M(a.payloadJSON);if(!e)return;let t=typeof e.sessionKey==`string`?e.sessionKey.trim():`node-${r}`;if(!t||n().tools?.exec?.notifyOnExit===!1||e.suppressNotifyOnExit===!0)return;let o=typeof e.runId==`string`?e.runId.trim():``,s=typeof e.command==`string`?e.command.trim():``,c=typeof e.exitCode==`number`&&Number.isFinite(e.exitCode)?e.exitCode:void 0,u=e.timedOut===!0,d=typeof e.output==`string`?e.output.trim():``,f=typeof e.reason==`string`?e.reason.trim():``,m=``;if(a.event===`exec.started`)m=`Exec started (node=${r}${o?` id=${o}`:``})`,s&&(m+=`: ${s}`);else if(a.event===`exec.finished`){let e=u?`timeout`:`code ${c??`?`}`,t=D(d);if(!(u||c!==0||t.length>0))return;m=`Exec finished (node=${r}${o?` id=${o}`:``}, ${e})`,t&&(m+=`\n${t}`)}else m=`Exec denied (node=${r}${o?` id=${o}`:``}${f?`, ${f}`:``})`,s&&(m+=`: ${s}`);l(m,{sessionKey:t,contextKey:o?`exec:${o}`:`exec`}),i(p(t,{reason:`exec-event`}));return}case`push.apns.register`:{let e=M(a.payloadJSON);if(!e)return;let n=typeof e.token==`string`?e.token:``,i=typeof e.topic==`string`?e.topic:``,o=e.environment;try{await v({nodeId:r,token:n,topic:i,environment:o})}catch(e){t.logGateway.warn(`push apns register failed node=${r}: ${_(e)}`)}return}default:return}};export{P as handleNodeEvent};
@@ -1 +1 @@
1
- import"./paths-DBmKCtUs.js";import"./paths-CChBdtE8.js";import"./subsystem-hyY_8Y33.js";import"./workspace-Dc-i8PF7.js";import"./utils-HgCTSfjA.js";import{Gr as e}from"./model-selection-z_2ofBma.js";import"./github-copilot-token-DePP-lIf.js";import"./boolean-DypnRoRK.js";import"./proxy-env-BWBLvN-u.js";import"./frontmatter-DWwQ2Ef1.js";import"./logger-Cb-sKDne.js";import"./send-DQ8hW1Ny.js";import"./send-CgCkmVGv.js";import{E as t,N as n,i as r,l as i,r as a,y as o}from"./pi-embedded-CSE8iTcT.js";import"./tokens-BYXU3z3M.js";import"./deliver-BZcbGQOY.js";import"./diagnostic-IQ5DYtkj.js";import"./send-D7eYYLEG.js";import"./pi-model-discovery-DnHY5jfR.js";import"./image-CZ-GwwjN.js";import"./audio-transcription-runner-BaxTmW9G.js";import"./fetch-oSjgZCED.js";import"./fetch-guard-CgvEMjHW.js";import"./api-key-rotation-BUGNohXO.js";import"./proxy-fetch-BJmmcDWW.js";import{m as s,s as c}from"./ir-BxkORpyH.js";import"./render-CBsnn-2A.js";import"./target-errors-TsrjEir0.js";import"./commands-registry-l38RhNf-.js";import"./fetch-_g8lZ8K8.js";import"./skill-commands-B9T6G5xv.js";import"./channel-activity-C742K4vi.js";import"./tables-176-pfPQ.js";import"./send-vk3KPAQd2.js";import"./outbound-attachment-C3faxPvJ.js";import"./send-DYm8HM55.js";import"./fetch-BBL4TFBl.js";import"./query-expansion-CC3GwLhd.js";import"./manager-n06Q0VsW.js";export{i as createReplyPrefixOptions,r as deliverSlackSlashReplies,o as dispatchReplyWithDispatcher,n as finalizeInboundContext,a as recordInboundSessionMetaSafe,t as resolveAgentRoute,s as resolveChunkMode,e as resolveConversationLabel,c as resolveMarkdownTableMode};
1
+ import"./paths-DBmKCtUs.js";import"./paths-CChBdtE8.js";import"./subsystem-hyY_8Y33.js";import"./workspace-Dc-i8PF7.js";import"./utils-HgCTSfjA.js";import{Gr as e}from"./model-selection-z_2ofBma.js";import"./github-copilot-token-DePP-lIf.js";import"./boolean-DypnRoRK.js";import"./proxy-env-BWBLvN-u.js";import"./frontmatter-DWwQ2Ef1.js";import"./logger-Cb-sKDne.js";import"./send-DQ8hW1Ny.js";import"./send-CgCkmVGv.js";import{E as t,N as n,i as r,l as i,r as a,y as o}from"./pi-embedded-DJGgW90C.js";import"./tokens-BYXU3z3M.js";import"./deliver-BZcbGQOY.js";import"./diagnostic-IQ5DYtkj.js";import"./send-D7eYYLEG.js";import"./pi-model-discovery-DnHY5jfR.js";import"./image-CZ-GwwjN.js";import"./audio-transcription-runner-BaxTmW9G.js";import"./fetch-oSjgZCED.js";import"./fetch-guard-CgvEMjHW.js";import"./api-key-rotation-BUGNohXO.js";import"./proxy-fetch-BJmmcDWW.js";import{m as s,s as c}from"./ir-BxkORpyH.js";import"./render-CBsnn-2A.js";import"./target-errors-TsrjEir0.js";import"./commands-registry-l38RhNf-.js";import"./fetch-_g8lZ8K8.js";import"./skill-commands-B9T6G5xv.js";import"./channel-activity-C742K4vi.js";import"./tables-176-pfPQ.js";import"./send-vk3KPAQd2.js";import"./outbound-attachment-C3faxPvJ.js";import"./send-DYm8HM55.js";import"./fetch-BBL4TFBl.js";import"./query-expansion-CC3GwLhd.js";import"./manager-n06Q0VsW.js";export{i as createReplyPrefixOptions,r as deliverSlackSlashReplies,o as dispatchReplyWithDispatcher,n as finalizeInboundContext,a as recordInboundSessionMetaSafe,t as resolveAgentRoute,s as resolveChunkMode,e as resolveConversationLabel,c as resolveMarkdownTableMode};
@@ -1 +1 @@
1
- import"./paths-B4IRk3wi.js";import"./subsystem-BQ1073Mu.js";import"./utils-D1PlBTFH.js";import{ri as e}from"./model-selection-B2r_LMFb.js";import{On as t,Vn as n,_n as r,bi as i,lt as a,vt as o}from"./reply-DHtpIWpD.js";import"./agent-scope-DW6ZDCxj.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import"./boolean-Ch3DfXPy.js";import"./env-BI_g1HfG.js";import"./env-overrides-C0vMeCeX.js";import"./registry-BwcVQtsI.js";import"./skills-CZ7zEDmo.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-1aNlpDX7.js";import"./logger-Bgqzq_Zu.js";import"./exec-BdtFni8N.js";import"./windows-spawn-B36IG4s2.js";import"./redact-DsC5EnL7.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-y2V0aFIS.js";import"./send-DyCUb7oW.js";import"./send-C6J_nLb9.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-DsYKaMCI.js";import"./image-6t162ig6.js";import"./models-config-PU32mWpc.js";import"./tool-display-DBTvIf_I.js";import"./fetch-guard-11xgsj9-.js";import"./api-key-rotation-CayDxQxo.js";import"./local-roots-ClGHF49W.js";import"./model-catalog-CXx8LKWX.js";import"./proxy-fetch-Ci8QXzzm.js";import"./tokens-xmkeRJqo.js";import"./deliver-Dg2TVF1M.js";import"./commands-FDnZnqN5.js";import"./commands-registry-BEMFeaZR.js";import"./pairing-store-mQs2yMkt.js";import"./fetch-Dikjvc5M.js";import"./call-BQAAYLj3.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-kojLym9G.js";import"./send-aEwJo2mZ2.js";import"./pi-model-discovery-DMZplc-U.js";import"./exec-approvals-allowlist-Bh3Rw-aC.js";import"./exec-safe-bin-runtime-policy-BxN1_8e_.js";import{m as s,s as c}from"./ir-DcrzIcfF.js";import"./render-D8OWO2hT.js";import"./target-errors-B1wrjiTA.js";import"./read-only-account-inspect-DLD1Pk6l.js";import"./channel-selection-BuH6syM3.js";import"./plugin-auto-enable-DzUZAwai.js";import"./send-HOAYSr2i.js";import"./outbound-attachment-lrGTAaR-.js";import"./delivery-queue-CKbauSFq.js";import"./send-w-vabJ4U.js";import"./channel-activity-CBKv0fto.js";import"./tables-DwrGp-F-.js";import"./fetch-D4txy8qG.js";import"./skill-commands-BN3rmzgq.js";import"./workspace-dirs-BMGwwM6X.js";import"./pairing-token-BipkTRNW.js";import"./restart-Dal_HOce.js";import"./runtime-web-tools-BiMD0yHU.js";import"./command-secret-targets-CbrSGcvV.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-BCxq0f5b.js";import"./onboard-helpers-CKsetIvC.js";import"./prompt-style-DpAh867d.js";import"./pairing-labels-iZoSa-aT.js";import"./memory-cli-P0GDvKlz.js";import"./query-expansion-BNl6JMlz.js";import"./manager-DKyEk2dt.js";import"./links-jlebCPFf.js";import"./cli-utils-BY7dLMFy.js";import"./help-format-Cav62lfS.js";import"./progress-Cyn5U745.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-B1Y6pbxs.js";import"./system-run-command-B212q8f9.js";import"./runtime-Dz2qgcJk.js";import"./stagger-DmFYysrJ.js";export{r as createReplyPrefixOptions,o as deliverSlackSlashReplies,t as dispatchReplyWithDispatcher,i as finalizeInboundContext,a as recordInboundSessionMetaSafe,n as resolveAgentRoute,s as resolveChunkMode,e as resolveConversationLabel,c as resolveMarkdownTableMode};
1
+ import"./paths-B4IRk3wi.js";import"./subsystem-BQ1073Mu.js";import"./utils-D1PlBTFH.js";import{ri as e}from"./model-selection-B2r_LMFb.js";import{On as t,Vn as n,_n as r,bi as i,lt as a,vt as o}from"./reply-HrabJs88.js";import"./agent-scope-DW6ZDCxj.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import"./boolean-Ch3DfXPy.js";import"./env-BI_g1HfG.js";import"./env-overrides-C0vMeCeX.js";import"./registry-BwcVQtsI.js";import"./skills-CZ7zEDmo.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-1aNlpDX7.js";import"./logger-Bgqzq_Zu.js";import"./exec-BdtFni8N.js";import"./windows-spawn-B36IG4s2.js";import"./redact-DsC5EnL7.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-y2V0aFIS.js";import"./send-DyCUb7oW.js";import"./send-C6J_nLb9.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-DsYKaMCI.js";import"./image-6t162ig6.js";import"./models-config-PU32mWpc.js";import"./tool-display-DBTvIf_I.js";import"./fetch-guard-11xgsj9-.js";import"./api-key-rotation-CayDxQxo.js";import"./local-roots-ClGHF49W.js";import"./model-catalog-CXx8LKWX.js";import"./proxy-fetch-Ci8QXzzm.js";import"./tokens-xmkeRJqo.js";import"./deliver-Dg2TVF1M.js";import"./commands-FDnZnqN5.js";import"./commands-registry-BEMFeaZR.js";import"./pairing-store-mQs2yMkt.js";import"./fetch-Dikjvc5M.js";import"./call-BQAAYLj3.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-kojLym9G.js";import"./send-aEwJo2mZ2.js";import"./pi-model-discovery-DMZplc-U.js";import"./exec-approvals-allowlist-Bh3Rw-aC.js";import"./exec-safe-bin-runtime-policy-BxN1_8e_.js";import{m as s,s as c}from"./ir-DcrzIcfF.js";import"./render-D8OWO2hT.js";import"./target-errors-B1wrjiTA.js";import"./read-only-account-inspect-DLD1Pk6l.js";import"./channel-selection-BuH6syM3.js";import"./plugin-auto-enable-DzUZAwai.js";import"./send-HOAYSr2i.js";import"./outbound-attachment-lrGTAaR-.js";import"./delivery-queue-CKbauSFq.js";import"./send-w-vabJ4U.js";import"./channel-activity-CBKv0fto.js";import"./tables-DwrGp-F-.js";import"./fetch-D4txy8qG.js";import"./skill-commands-BN3rmzgq.js";import"./workspace-dirs-BMGwwM6X.js";import"./pairing-token-BipkTRNW.js";import"./restart-Dal_HOce.js";import"./runtime-web-tools-BiMD0yHU.js";import"./command-secret-targets-CbrSGcvV.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-BCxq0f5b.js";import"./onboard-helpers-CKsetIvC.js";import"./prompt-style-DpAh867d.js";import"./pairing-labels-iZoSa-aT.js";import"./memory-cli-P0GDvKlz.js";import"./query-expansion-BNl6JMlz.js";import"./manager-DKyEk2dt.js";import"./links-jlebCPFf.js";import"./cli-utils-BY7dLMFy.js";import"./help-format-Cav62lfS.js";import"./progress-Cyn5U745.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-B1Y6pbxs.js";import"./system-run-command-B212q8f9.js";import"./runtime-Dz2qgcJk.js";import"./stagger-DmFYysrJ.js";export{r as createReplyPrefixOptions,o as deliverSlackSlashReplies,t as dispatchReplyWithDispatcher,i as finalizeInboundContext,a as recordInboundSessionMetaSafe,n as resolveAgentRoute,s as resolveChunkMode,e as resolveConversationLabel,c as resolveMarkdownTableMode};
@@ -1 +1 @@
1
- import"./subsystem-kTFXkQM5.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{Gn as e}from"./auth-profiles-e3SmOvON.js";import"./agent-scope-BKE4M04k.js";import"./utils-7Gdj77QB.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-R4odAlsj.js";import"./version-q3SkUw2K.js";import"./registry-Div2nEwi.js";import"./skills-Df0CxTMH.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-CCU8jDti.js";import"./logger-C1GUBMt-.js";import"./exec-CiwCrGw3.js";import"./windows-spawn-Dw4dpTt2.js";import"./redact-bVcVj47r.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-DNQO70y-.js";import"./send-Cfa08ZLE.js";import"./send-DmS34-Eb.js";import{G as t,In as n,R as r,f as i,gt as a,m as o}from"./compact-DutiJiBy.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-D5CbqIVA.js";import"./tokens-D8eWI71q.js";import"./with-timeout-c1CzdShT.js";import"./deliver-HZ99jQzl.js";import"./diagnostic-CvLTqJbq.js";import"./send-CW3hfjkM.js";import"./pi-model-discovery-cW9be_SG.js";import"./exec-approvals-allowlist-DlYH42As.js";import"./exec-safe-bin-runtime-policy-Bu9bb9U5.js";import"./model-catalog-CI2eEH9Y.js";import"./fetch-Dj-FEHSr.js";import"./audio-transcription-runner-BwviCgP5.js";import"./fetch-guard-guH8Tmju.js";import"./image-DQ_3LMNb.js";import"./tool-display-BTuQQN92.js";import"./api-key-rotation-BRm3CNd-.js";import"./proxy-fetch-ByazCl5E.js";import{m as s,s as c}from"./ir-CsTyrPwa.js";import"./render-DrrPmnMI.js";import"./target-errors-BRLBPboT.js";import"./commands-DOhEGWJ2.js";import"./commands-registry-CqsggloB.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-Bh1ozdi-.js";import"./sqlite-DgdOh9U-.js";import"./call-D5NJXFgu.js";import"./pi-tools.policy-CklWbQkk.js";import"./pairing-store-CmT1fSmE.js";import"./fetch-Dh-apy46.js";import"./skill-commands-qdKWuiOR.js";import"./workspace-dirs-na4G79jL.js";import"./pairing-token-YrKlxjGC.js";import"./channel-activity-CFgOyIkh.js";import"./tables-5gR6U_tC.js";import"./kill-tree-DihujQie.js";import"./runtime-web-tools-BjmhIJkd.js";import"./runtime-HwYsJOk2.js";import"./node-shell-BuPDYFhk.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-C1kkZyEb.js";import"./plugin-auto-enable-CrVJR--r.js";import"./send-DQxQrVuw.js";import"./outbound-attachment-BKku_WUf.js";import"./delivery-queue-nkPJu0fY.js";import"./send-DVv1dCwu.js";import"./system-run-command-BT2tTJg2.js";import"./fetch-EBjfhrYU.js";import"./command-secret-targets-BtkZwOzh.js";import"./connection-auth-BIApbu6I.js";import"./onboard-helpers-CvWjz0op.js";import"./prompt-style-QJckocuy.js";import"./pairing-labels-B3wRXljf.js";import"./search-manager-Co5RwgQ4.js";import"./manager-p3CCKFcv.js";import"./memory-cli-CTXmLb0V.js";import"./links-pHmQCzdF.js";import"./cli-utils-BleB1eys.js";import"./help-format-BSNXPQuE.js";import"./progress-Cy6zNuIC.js";import"./exec-approvals-BXO9Cezj.js";export{r as createReplyPrefixOptions,o as deliverSlackSlashReplies,t as dispatchReplyWithDispatcher,n as finalizeInboundContext,i as recordInboundSessionMetaSafe,a as resolveAgentRoute,s as resolveChunkMode,e as resolveConversationLabel,c as resolveMarkdownTableMode};
1
+ import"./subsystem-kTFXkQM5.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{Gn as e}from"./auth-profiles-e3SmOvON.js";import"./agent-scope-BKE4M04k.js";import"./utils-7Gdj77QB.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-R4odAlsj.js";import"./version-q3SkUw2K.js";import"./registry-Div2nEwi.js";import"./skills-Df0CxTMH.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-CCU8jDti.js";import"./logger-C1GUBMt-.js";import"./exec-CiwCrGw3.js";import"./windows-spawn-Dw4dpTt2.js";import"./redact-bVcVj47r.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-DNQO70y-.js";import"./send-Cfa08ZLE.js";import"./send-DmS34-Eb.js";import{G as t,In as n,R as r,f as i,gt as a,m as o}from"./compact-B5m4267P.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-D5CbqIVA.js";import"./tokens-D8eWI71q.js";import"./with-timeout-c1CzdShT.js";import"./deliver-HZ99jQzl.js";import"./diagnostic-CvLTqJbq.js";import"./send-CW3hfjkM.js";import"./pi-model-discovery-cW9be_SG.js";import"./exec-approvals-allowlist-DlYH42As.js";import"./exec-safe-bin-runtime-policy-Bu9bb9U5.js";import"./model-catalog-CI2eEH9Y.js";import"./fetch-Dj-FEHSr.js";import"./audio-transcription-runner-BwviCgP5.js";import"./fetch-guard-guH8Tmju.js";import"./image-DQ_3LMNb.js";import"./tool-display-BTuQQN92.js";import"./api-key-rotation-BRm3CNd-.js";import"./proxy-fetch-ByazCl5E.js";import{m as s,s as c}from"./ir-CsTyrPwa.js";import"./render-DrrPmnMI.js";import"./target-errors-BRLBPboT.js";import"./commands-DOhEGWJ2.js";import"./commands-registry-CqsggloB.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-Bh1ozdi-.js";import"./sqlite-DgdOh9U-.js";import"./call-D5NJXFgu.js";import"./pi-tools.policy-CklWbQkk.js";import"./pairing-store-CmT1fSmE.js";import"./fetch-Dh-apy46.js";import"./skill-commands-qdKWuiOR.js";import"./workspace-dirs-na4G79jL.js";import"./pairing-token-YrKlxjGC.js";import"./channel-activity-CFgOyIkh.js";import"./tables-5gR6U_tC.js";import"./kill-tree-DihujQie.js";import"./runtime-web-tools-BjmhIJkd.js";import"./runtime-HwYsJOk2.js";import"./node-shell-BuPDYFhk.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-C1kkZyEb.js";import"./plugin-auto-enable-CrVJR--r.js";import"./send-DQxQrVuw.js";import"./outbound-attachment-BKku_WUf.js";import"./delivery-queue-nkPJu0fY.js";import"./send-DVv1dCwu.js";import"./system-run-command-BT2tTJg2.js";import"./fetch-EBjfhrYU.js";import"./command-secret-targets-BtkZwOzh.js";import"./connection-auth-BIApbu6I.js";import"./onboard-helpers-CvWjz0op.js";import"./prompt-style-QJckocuy.js";import"./pairing-labels-B3wRXljf.js";import"./search-manager-Co5RwgQ4.js";import"./manager-p3CCKFcv.js";import"./memory-cli-CTXmLb0V.js";import"./links-pHmQCzdF.js";import"./cli-utils-BleB1eys.js";import"./help-format-BSNXPQuE.js";import"./progress-Cy6zNuIC.js";import"./exec-approvals-BXO9Cezj.js";export{r as createReplyPrefixOptions,o as deliverSlackSlashReplies,t as dispatchReplyWithDispatcher,n as finalizeInboundContext,i as recordInboundSessionMetaSafe,a as resolveAgentRoute,s as resolveChunkMode,e as resolveConversationLabel,c as resolveMarkdownTableMode};
@@ -1 +1 @@
1
- import"./paths-CAzfAyaR.js";import"./paths-BpQOWYiT.js";import"./logger-D0y9iaZX.js";import{Gr as e}from"./model-selection-fVxVucLI.js";import{E as t,N as n,i as r,l as i,r as a,y as o}from"./pi-embedded-fKs8vr_l.js";import"./github-copilot-token-wm6mbypz.js";import"./proxy-env-CRDRLawi.js";import"./send--kmUv50W.js";import"./send-BJfr4Enl.js";import"./tokens-CqsthGyS.js";import"./deliver-CvBTa9OP.js";import"./diagnostic-DUhynW8p.js";import"./send-gpAn9pnk.js";import"./pi-model-discovery-Dz_Fa0ay.js";import"./image-C5Ue2O-K.js";import"./audio-transcription-runner-DGxzZ2_V.js";import"./fetch-KSn9iMNK.js";import"./fetch-guard-BxGdHuPZ.js";import"./api-key-rotation-sozWdoIY.js";import"./proxy-fetch-BqU71w0r.js";import{m as s,s as c}from"./ir-B11ecKHp.js";import"./render-BXEUPIHe.js";import"./target-errors-DhqzKpof.js";import"./commands-registry-nuBs6Gvq.js";import"./fetch-DHo17YmK.js";import"./skill-commands-Bu6vcx7c.js";import"./channel-activity-DptjsvT5.js";import"./tables-CYq1BOKz.js";import"./send-PNypeYEX.js";import"./outbound-attachment-GzRAYH3M.js";import"./send-DcnUL5AM2.js";import"./fetch-Dk2vEN5b.js";import"./query-expansion--XG0a9wS.js";import"./manager-C3HmyJWw.js";export{i as createReplyPrefixOptions,r as deliverSlackSlashReplies,o as dispatchReplyWithDispatcher,n as finalizeInboundContext,a as recordInboundSessionMetaSafe,t as resolveAgentRoute,s as resolveChunkMode,e as resolveConversationLabel,c as resolveMarkdownTableMode};
1
+ import"./paths-CAzfAyaR.js";import"./paths-BpQOWYiT.js";import"./logger-D0y9iaZX.js";import{Gr as e}from"./model-selection-fVxVucLI.js";import{E as t,N as n,i as r,l as i,r as a,y as o}from"./pi-embedded-Bv3QACci.js";import"./github-copilot-token-wm6mbypz.js";import"./proxy-env-CRDRLawi.js";import"./send--kmUv50W.js";import"./send-BJfr4Enl.js";import"./tokens-CqsthGyS.js";import"./deliver-CvBTa9OP.js";import"./diagnostic-DUhynW8p.js";import"./send-gpAn9pnk.js";import"./pi-model-discovery-Dz_Fa0ay.js";import"./image-C5Ue2O-K.js";import"./audio-transcription-runner-DGxzZ2_V.js";import"./fetch-KSn9iMNK.js";import"./fetch-guard-BxGdHuPZ.js";import"./api-key-rotation-sozWdoIY.js";import"./proxy-fetch-BqU71w0r.js";import{m as s,s as c}from"./ir-B11ecKHp.js";import"./render-BXEUPIHe.js";import"./target-errors-DhqzKpof.js";import"./commands-registry-nuBs6Gvq.js";import"./fetch-DHo17YmK.js";import"./skill-commands-Bu6vcx7c.js";import"./channel-activity-DptjsvT5.js";import"./tables-CYq1BOKz.js";import"./send-PNypeYEX.js";import"./outbound-attachment-GzRAYH3M.js";import"./send-DcnUL5AM2.js";import"./fetch-Dk2vEN5b.js";import"./query-expansion--XG0a9wS.js";import"./manager-C3HmyJWw.js";export{i as createReplyPrefixOptions,r as deliverSlackSlashReplies,o as dispatchReplyWithDispatcher,n as finalizeInboundContext,a as recordInboundSessionMetaSafe,t as resolveAgentRoute,s as resolveChunkMode,e as resolveConversationLabel,c as resolveMarkdownTableMode};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-CNxR59P3.js";import{A as t,k as n,y as r}from"./subsystem-kTFXkQM5.js";import{u as i}from"./paths-BjD3T_xq.js";import{Cn as a,Fo as o,Kr as s,On as c,Po as l,Qa as u,Xr as d,Yc as f,ba as p,du as m,fu as h,jo as g,jt as _,ya as v}from"./auth-profiles-e3SmOvON.js";import{t as y}from"./command-format-CLxIPuLR.js";import{d as b}from"./agent-scope-BKE4M04k.js";import{E as x}from"./session-key-C7F_iqYg.js";import{t as S}from"./openclaw-root-CnsBf6ZU.js";import{n as C,t as w}from"./version-q3SkUw2K.js";import{lt as T,n as E}from"./plugins-CCU8jDti.js";import{n as D}from"./exec-CiwCrGw3.js";import{En as O,Mt as k,_n as A,bn as j,fn as M,jt as ee,pn as N,vn as P,xn as F,yn as I}from"./compact-DutiJiBy.js";import{c as L}from"./paths-BfjJY2VL.js";import{d as te,l as ne,n as R,r as z}from"./session-utils-Bh1ozdi-.js";import{n as B,t as re}from"./call-D5NJXFgu.js";import{b as V,v as H,y as U}from"./pi-tools.policy-CklWbQkk.js";import{n as W}from"./format-relative-DkMjYy7z.js";import{a as ie}from"./skill-commands-qdKWuiOR.js";import{r as G}from"./format-duration-C8AzNqKh.js";import{o as ae,s as oe}from"./command-secret-targets-BtkZwOzh.js";import{C as se,g as ce}from"./onboard-helpers-CvWjz0op.js";import{t as K}from"./search-manager-Co5RwgQ4.js";import{n as q}from"./progress-Cy6zNuIC.js";import{t as le}from"./skills-status-Bzj-kJgo.js";import{t as ue}from"./issue-format-DRHlQPnX.js";import{t as de}from"./channels-status-issues-RPxMYADM.js";import{c as fe,n as pe}from"./service-CtJtO2Jl.js";import{t as me}from"./runtime-status-DszMjvJK.js";import{r as he,t as ge}from"./probe-auth-DseDsvEH.js";import{t as _e}from"./diagnostics-DnbLdEsy.js";import{n as J,t as ve}from"./table-BiqW4yI5.js";import{o as ye,t as be}from"./health-vy-C49Dw.js";import{a as xe,g as Se,m as Ce,n as we,t as Te}from"./channel-account-context-DuBGrKuL.js";import{t as Ee}from"./audit-Brtj4GDg.js";import{t as De}from"./node-service-BAX4XFhG.js";import{n as Y,t as Oe}from"./format-Ce7I7s-k.js";import{i as ke,n as Ae,r as je,t as Me}from"./status.update-CdMzKwdx.js";import{t as Ne}from"./text-format-DEWK6oCT.js";import{spawnSync as Pe}from"node:child_process";import Fe from"node:os";import Ie from"node:path";import Le from"node:fs";import Re from"node:fs/promises";function ze(e){if(!Array.isArray(e))return null;let t=e,n=t.find(e=>e.mode===`gateway`&&e.reason===`self`)??t.find(e=>typeof e.text==`string`&&String(e.text).startsWith(`Gateway:`))??null;return n?{host:typeof n.host==`string`?n.host:void 0,ip:typeof n.ip==`string`?n.ip:void 0,version:typeof n.version==`string`?n.version:void 0,platform:typeof n.platform==`string`?n.platform:void 0}:null}function Be(e){return e.enabled?e.available===!0?{tone:`ok`,state:`ready`}:e.available===!1?{tone:`warn`,state:`unavailable`}:{tone:`muted`,state:`unknown`}:{tone:`muted`,state:`disabled`}}function Ve(e){return e.enabled?e.available?{tone:`ok`,state:`ready`}:{tone:`warn`,state:`unavailable`}:{tone:`muted`,state:`disabled`}}function He(e){return e.enabled?{tone:`ok`,text:`cache on${typeof e.entries==`number`?` (${e.entries})`:``}`}:{tone:`muted`,text:`cache off`}}function Ue(e){return typeof e==`string`?e.trim():``}function We(){return Ue(Pe(`sw_vers`,[`-productVersion`],{encoding:`utf-8`}).stdout)||Fe.release()}function Ge(){let e=Fe.platform(),t=Fe.release(),n=Fe.arch();return{platform:e,arch:n,release:t,label:e===`darwin`?`macos ${We()} (${n})`:e===`win32`?`windows ${t} (${n})`:`${e} ${t} (${n})`}}async function Ke(e){try{return await Re.access(e),!0}catch{return!1}}async function qe(e){let t=z(e),n=Date.now(),r=await Promise.all(t.agents.map(async t=>{let r=(()=>{try{return b(e,t.id)}catch{return null}})(),i=r==null?null:await Ke(Ie.join(r,`BOOTSTRAP.md`)),a=L(e.session?.store,{agentId:t.id}),o=(()=>{try{return _(a)}catch{return{}}})(),s=Object.values(o).reduce((e,t)=>Math.max(e,t?.updatedAt??0),0),c=s>0?s:null,l=c?n-c:null,u=Object.keys(o).filter(e=>e!==`global`&&e!==`unknown`).length;return{id:t.id,name:t.name,workspaceDir:r,bootstrapPending:i,sessionsPath:a,sessionsCount:u,lastUpdatedAt:c,lastActiveAgeMs:l}})),i=r.reduce((e,t)=>e+t.sessionsCount,0),a=r.reduce((e,t)=>e+(t.bootstrapPending?1:0),0);return{defaultId:t.defaultId,agents:r,totalSessions:i,bootstrapPendingCount:a}}const X=e=>e&&typeof e==`object`?e:{};function Z(e){let t=new Map;for(let n of e){let e=n?.trim()?n.trim():`unknown`;t.set(e,(t.get(e)??0)+1)}let n=[...t.entries()].toSorted((e,t)=>t[1]-e[1]).map(([e,t])=>`${e}${t>1?`×${t}`:``}`);return{label:n.length>0?n.join(`+`):`unknown`,parts:n}}function Je(e){let t=e?.trim()||``;if(!t)return null;try{return Le.existsSync(t)}catch{return null}}function Q(e,t){let n=e.trim();if(!n)return`empty`;if(!t.showSecrets)return`sha256:${u(n,8)} · len ${n.length}`;let r=n.slice(0,4),i=n.slice(-4);return n.length<=10?`${n} · len ${n.length}`:`${r}…${i} · len ${n.length}`}function Ye(e,t,n){return e.config.inspectAccount?.(t,n)??H({channelId:e.id,cfg:t,accountId:n})}async function Xe(e){let{plugin:t,cfg:n,sourceConfig:r,accountId:i}=e,a=Ye(t,r,i),o=Ye(t,n,i),s=o,c=a,l=o??t.config.resolveAccount(n,i),u=!!(a&&U(a)&&(!V(l)||c?.configured===!0&&s?.configured===!1)),d=u?a:l,f=u?c:s,p=f?.enabled??F({plugin:t,account:d,cfg:n}),m=f?.configured??await j({plugin:t,account:d,cfg:n,readAccountConfiguredField:!0});return{accountId:i,account:d,enabled:p,configured:m,snapshot:P({plugin:t,cfg:n,accountId:i,account:d,enabled:p,configured:m})}}const Ze=e=>{let t=e.accountId||`default`;return e.name?.trim()?`${t} (${e.name.trim()})`:t},Qe=e=>{let{plugin:t,cfg:n,entry:r}=e,i=[],a=r.snapshot;a.enabled===!1&&i.push(`disabled`),a.dmPolicy&&i.push(`dm:${a.dmPolicy}`),a.tokenSource&&a.tokenSource!==`none`&&i.push(`token:${a.tokenSource}`),a.botTokenSource&&a.botTokenSource!==`none`&&i.push(`bot:${a.botTokenSource}`),a.appTokenSource&&a.appTokenSource!==`none`&&i.push(`app:${a.appTokenSource}`),a.signingSecretSource&&a.signingSecretSource!==`none`&&i.push(`signing:${a.signingSecretSource}`),U(r.account)&&i.push(`secret unavailable in this command path`),a.baseUrl&&i.push(a.baseUrl),a.port!=null&&i.push(`port:${a.port}`),a.cliPath&&i.push(`cli:${a.cliPath}`),a.dbPath&&i.push(`db:${a.dbPath}`);let o=t.config.resolveAllowFrom?.({cfg:n,accountId:a.accountId})??a.allowFrom;if(o?.length){let e=I({plugin:t,cfg:n,accountId:a.accountId,allowFrom:o}).slice(0,3);e.length>0&&i.push(`allow:${e.join(`,`)}`)}return i};function $e(e){let t=X(e),n=typeof t.linked==`boolean`?t.linked:null,r=typeof t.authAgeMs==`number`?t.authAgeMs:null,i=X(t.self);return{linked:n,authAgeMs:r,selfE164:typeof i.e164==`string`&&i.e164.trim()?i.e164.trim():null}}function et(e){let t=[];for(let n of e){let e=X(n.account),r=X(n.snapshot);for(let n of[`tokenFile`,`botTokenFile`,`appTokenFile`,`cliPath`,`dbPath`,`authDir`]){let i=e[n]??r[n];Je(i)===!1&&t.push(String(i))}}return t}function tt(e){let t=e.accounts.filter(e=>e.enabled);if(t.length===0)return{state:null,detail:null};let n=t.map(e=>X(e.account)),r=n.some(e=>`botToken`in e),i=n.some(e=>`appToken`in e),a=n.some(e=>`signingSecret`in e||`signingSecretSource`in e||`signingSecretStatus`in e),o=n.some(e=>`token`in e);if(!r&&!i&&!a&&!o)return{state:null,detail:null};let s=e=>typeof e.mode==`string`&&e.mode.trim()===`http`,c=(e,t,n)=>{let r=e[t];return typeof r==`string`&&r.trim()?!0:e[n]===`available`};if(r&&a&&t.every(e=>s(X(e.account)))){let n=t.filter(e=>U(e.account)),r=t.filter(e=>{let t=X(e.account);return c(t,`botToken`,`botTokenStatus`)&&c(t,`signingSecret`,`signingSecretStatus`)}),i=t.filter(e=>{let t=X(e.account),n=c(t,`botToken`,`botTokenStatus`),r=c(t,`signingSecret`,`signingSecretStatus`);return n&&!r||!n&&r});if(n.length>0)return{state:`warn`,detail:`configured http credentials unavailable in this command path · accounts ${n.length}`};if(i.length>0)return{state:`warn`,detail:`partial credentials (need bot+signing) · accounts ${i.length}`};if(r.length===0)return{state:`setup`,detail:`no credentials (need bot+signing)`};let a=Z(r.map(e=>e.snapshot.botTokenSource??`none`)),o=Z(r.map(e=>e.snapshot.signingSecretSource??`none`)),s=r[0]?.account?X(r[0].account):{},l=typeof s.botToken==`string`?s.botToken:``,u=typeof s.signingSecret==`string`?s.signingSecret:``,d=l.trim()?Q(l,{showSecrets:e.showSecrets}):``,f=u.trim()?Q(u,{showSecrets:e.showSecrets}):``,p=d||f?` (bot ${d||`?`}, signing ${f||`?`})`:``;return{state:`ok`,detail:`credentials ok (bot ${a.label}, signing ${o.label})${p} · accounts ${r.length}/${t.length||1}`}}if(r&&i){let n=t.filter(e=>U(e.account)),r=t.filter(e=>{let t=X(e.account),n=typeof t.botToken==`string`?t.botToken.trim():``,r=typeof t.appToken==`string`?t.appToken.trim():``;return!!n&&!!r}),i=t.filter(e=>{let t=X(e.account),n=typeof t.botToken==`string`?t.botToken.trim():``,r=typeof t.appToken==`string`?t.appToken.trim():``,i=!!n,a=!!r;return i&&!a||!i&&a});if(i.length>0)return{state:`warn`,detail:`partial tokens (need bot+app) · accounts ${i.length}`};if(n.length>0)return{state:`warn`,detail:`configured tokens unavailable in this command path · accounts ${n.length}`};if(r.length===0)return{state:`setup`,detail:`no tokens (need bot+app)`};let a=Z(r.map(e=>e.snapshot.botTokenSource??`none`)),o=Z(r.map(e=>e.snapshot.appTokenSource??`none`)),s=r[0]?.account?X(r[0].account):{},c=typeof s.botToken==`string`?s.botToken:``,l=typeof s.appToken==`string`?s.appToken:``,u=c.trim()?Q(c,{showSecrets:e.showSecrets}):``,d=l.trim()?Q(l,{showSecrets:e.showSecrets}):``,f=u||d?` (bot ${u||`?`}, app ${d||`?`})`:``;return{state:`ok`,detail:`tokens ok (bot ${a.label}, app ${o.label})${f} · accounts ${r.length}/${t.length||1}`}}if(r){let n=t.filter(e=>U(e.account)),r=t.filter(e=>{let t=X(e.account);return!!(typeof t.botToken==`string`&&t.botToken.trim())});if(n.length>0)return{state:`warn`,detail:`configured bot token unavailable in this command path · accounts ${n.length}`};if(r.length===0)return{state:`setup`,detail:`no bot token`};let i=r[0]?.account?X(r[0].account):{},a=typeof i.botToken==`string`?i.botToken:``,o=a.trim()?Q(a,{showSecrets:e.showSecrets}):``;return{state:`ok`,detail:`bot token config${o?` (${o})`:``} · accounts ${r.length}/${t.length||1}`}}let l=t.filter(e=>U(e.account)),u=t.filter(e=>{let t=X(e.account);return typeof t.token==`string`?!!t.token.trim():!1});if(l.length>0)return{state:`warn`,detail:`configured token unavailable in this command path · accounts ${l.length}`};if(u.length===0)return{state:`setup`,detail:`no token`};let d=Z(u.map(e=>e.snapshot.tokenSource)),f=u[0]?.account?X(u[0].account):{},p=typeof f.token==`string`?f.token:``,m=p.trim()?` (${Q(p,{showSecrets:e.showSecrets})})`:``;return{state:`ok`,detail:`token ${d.label}${m} · accounts ${u.length}/${t.length||1}`}}async function nt(e,t){let n=t?.showSecrets===!0,r=[],i=[];for(let a of E()){let o=a.config.listAccountIds(e),s=T({plugin:a,cfg:e,accountIds:o}),c=o.length>0?o:[s],l=[],u=t?.sourceConfig??e;for(let t of c)l.push(await Xe({plugin:a,cfg:e,sourceConfig:u,accountId:t}));let d=l.some(e=>e.enabled),f=l.filter(e=>e.enabled),p=f.filter(e=>e.configured),m=f.filter(e=>U(e.account)),h=l.find(e=>e.accountId===s)??l[0],g=$e(a.status?.buildChannelSummary?await a.status.buildChannelSummary({account:h?.account??{},cfg:e,defaultAccountId:s,snapshot:h?.snapshot??{accountId:s}}):void 0),_=et(f),v=tt({plugin:a,cfg:e,accounts:l,showSecrets:n}),y=a.status?.collectStatusIssues?a.status.collectStatusIssues(l.map(e=>e.snapshot)):[],b=a.meta.label??a.id,x=d?_.length>0||y.length>0||m.length>0?`warn`:g.linked===!1?`setup`:v.state?v.state:g.linked===!0||p.length>0?`ok`:`setup`:`off`,S=(()=>{if(!d)return h?a.config.disabledReason?.(h.account,e)??`disabled`:`disabled`;if(_.length>0)return`missing file (${_[0]})`;if(y.length>0)return y[0]?.message??`misconfigured`;if(g.linked!==null){let e=g.linked?`linked`:`not linked`,t=[];return g.linked&&g.selfE164&&t.push(g.selfE164),g.linked&&g.authAgeMs!=null&&g.authAgeMs>=0&&t.push(`auth ${W(g.authAgeMs)}`),(l.length>1||a.meta.forceAccountBinding)&&t.push(`accounts ${l.length||1}`),t.length>0?`${e} · ${t.join(` · `)}`:e}if(m.length>0)return v.detail?.includes(`unavailable`)?v.detail:`configured credentials unavailable in this command path · accounts ${m.length}`;if(v.detail)return v.detail;if(p.length>0){let e=`configured`;return l.length<=1&&!a.meta.forceAccountBinding?e:`${e} · accounts ${p.length}/${f.length||1}`}return(h&&a.config.unconfiguredReason?a.config.unconfiguredReason(h.account,e):null)??`not configured`})();r.push({id:a.id,label:b,enabled:d,state:x,detail:S}),p.length>0&&i.push({title:`${b} accounts`,columns:[`Account`,`Status`,`Notes`],rows:p.map(t=>{let n=Qe({plugin:a,cfg:e,entry:t});return{Account:Ze({accountId:t.accountId,name:t.snapshot.name}),Status:t.enabled&&!U(t.account)?`OK`:`WARN`,Notes:n.join(` · `)}})})}return{rows:r,details:i}}async function rt(e,t){let n=await Re.readFile(e,`utf8`).catch(()=>``);if(!n.trim())return[];let r=n.replace(/\r/g,``).split(`
1
+ import{t as e}from"./rolldown-runtime-CNxR59P3.js";import{A as t,k as n,y as r}from"./subsystem-kTFXkQM5.js";import{u as i}from"./paths-BjD3T_xq.js";import{Cn as a,Fo as o,Kr as s,On as c,Po as l,Qa as u,Xr as d,Yc as f,ba as p,du as m,fu as h,jo as g,jt as _,ya as v}from"./auth-profiles-e3SmOvON.js";import{t as y}from"./command-format-CLxIPuLR.js";import{d as b}from"./agent-scope-BKE4M04k.js";import{E as x}from"./session-key-C7F_iqYg.js";import{t as S}from"./openclaw-root-CnsBf6ZU.js";import{n as C,t as w}from"./version-q3SkUw2K.js";import{lt as T,n as E}from"./plugins-CCU8jDti.js";import{n as D}from"./exec-CiwCrGw3.js";import{En as O,Mt as k,_n as A,bn as j,fn as M,jt as ee,pn as N,vn as P,xn as F,yn as I}from"./compact-B5m4267P.js";import{c as L}from"./paths-BfjJY2VL.js";import{d as te,l as ne,n as R,r as z}from"./session-utils-Bh1ozdi-.js";import{n as B,t as re}from"./call-D5NJXFgu.js";import{b as V,v as H,y as U}from"./pi-tools.policy-CklWbQkk.js";import{n as W}from"./format-relative-DkMjYy7z.js";import{a as ie}from"./skill-commands-qdKWuiOR.js";import{r as G}from"./format-duration-C8AzNqKh.js";import{o as ae,s as oe}from"./command-secret-targets-BtkZwOzh.js";import{C as se,g as ce}from"./onboard-helpers-CvWjz0op.js";import{t as K}from"./search-manager-Co5RwgQ4.js";import{n as q}from"./progress-Cy6zNuIC.js";import{t as le}from"./skills-status-Bzj-kJgo.js";import{t as ue}from"./issue-format-DRHlQPnX.js";import{t as de}from"./channels-status-issues-RPxMYADM.js";import{c as fe,n as pe}from"./service-CtJtO2Jl.js";import{t as me}from"./runtime-status-DszMjvJK.js";import{r as he,t as ge}from"./probe-auth-DseDsvEH.js";import{t as _e}from"./diagnostics-DnbLdEsy.js";import{n as J,t as ve}from"./table-BiqW4yI5.js";import{o as ye,t as be}from"./health-CIBrUBhW.js";import{a as xe,g as Se,m as Ce,n as we,t as Te}from"./channel-account-context-DuBGrKuL.js";import{t as Ee}from"./audit-Brtj4GDg.js";import{t as De}from"./node-service-BAX4XFhG.js";import{n as Y,t as Oe}from"./format-Ce7I7s-k.js";import{i as ke,n as Ae,r as je,t as Me}from"./status.update-CdMzKwdx.js";import{t as Ne}from"./text-format-DEWK6oCT.js";import{spawnSync as Pe}from"node:child_process";import Fe from"node:os";import Ie from"node:path";import Le from"node:fs";import Re from"node:fs/promises";function ze(e){if(!Array.isArray(e))return null;let t=e,n=t.find(e=>e.mode===`gateway`&&e.reason===`self`)??t.find(e=>typeof e.text==`string`&&String(e.text).startsWith(`Gateway:`))??null;return n?{host:typeof n.host==`string`?n.host:void 0,ip:typeof n.ip==`string`?n.ip:void 0,version:typeof n.version==`string`?n.version:void 0,platform:typeof n.platform==`string`?n.platform:void 0}:null}function Be(e){return e.enabled?e.available===!0?{tone:`ok`,state:`ready`}:e.available===!1?{tone:`warn`,state:`unavailable`}:{tone:`muted`,state:`unknown`}:{tone:`muted`,state:`disabled`}}function Ve(e){return e.enabled?e.available?{tone:`ok`,state:`ready`}:{tone:`warn`,state:`unavailable`}:{tone:`muted`,state:`disabled`}}function He(e){return e.enabled?{tone:`ok`,text:`cache on${typeof e.entries==`number`?` (${e.entries})`:``}`}:{tone:`muted`,text:`cache off`}}function Ue(e){return typeof e==`string`?e.trim():``}function We(){return Ue(Pe(`sw_vers`,[`-productVersion`],{encoding:`utf-8`}).stdout)||Fe.release()}function Ge(){let e=Fe.platform(),t=Fe.release(),n=Fe.arch();return{platform:e,arch:n,release:t,label:e===`darwin`?`macos ${We()} (${n})`:e===`win32`?`windows ${t} (${n})`:`${e} ${t} (${n})`}}async function Ke(e){try{return await Re.access(e),!0}catch{return!1}}async function qe(e){let t=z(e),n=Date.now(),r=await Promise.all(t.agents.map(async t=>{let r=(()=>{try{return b(e,t.id)}catch{return null}})(),i=r==null?null:await Ke(Ie.join(r,`BOOTSTRAP.md`)),a=L(e.session?.store,{agentId:t.id}),o=(()=>{try{return _(a)}catch{return{}}})(),s=Object.values(o).reduce((e,t)=>Math.max(e,t?.updatedAt??0),0),c=s>0?s:null,l=c?n-c:null,u=Object.keys(o).filter(e=>e!==`global`&&e!==`unknown`).length;return{id:t.id,name:t.name,workspaceDir:r,bootstrapPending:i,sessionsPath:a,sessionsCount:u,lastUpdatedAt:c,lastActiveAgeMs:l}})),i=r.reduce((e,t)=>e+t.sessionsCount,0),a=r.reduce((e,t)=>e+(t.bootstrapPending?1:0),0);return{defaultId:t.defaultId,agents:r,totalSessions:i,bootstrapPendingCount:a}}const X=e=>e&&typeof e==`object`?e:{};function Z(e){let t=new Map;for(let n of e){let e=n?.trim()?n.trim():`unknown`;t.set(e,(t.get(e)??0)+1)}let n=[...t.entries()].toSorted((e,t)=>t[1]-e[1]).map(([e,t])=>`${e}${t>1?`×${t}`:``}`);return{label:n.length>0?n.join(`+`):`unknown`,parts:n}}function Je(e){let t=e?.trim()||``;if(!t)return null;try{return Le.existsSync(t)}catch{return null}}function Q(e,t){let n=e.trim();if(!n)return`empty`;if(!t.showSecrets)return`sha256:${u(n,8)} · len ${n.length}`;let r=n.slice(0,4),i=n.slice(-4);return n.length<=10?`${n} · len ${n.length}`:`${r}…${i} · len ${n.length}`}function Ye(e,t,n){return e.config.inspectAccount?.(t,n)??H({channelId:e.id,cfg:t,accountId:n})}async function Xe(e){let{plugin:t,cfg:n,sourceConfig:r,accountId:i}=e,a=Ye(t,r,i),o=Ye(t,n,i),s=o,c=a,l=o??t.config.resolveAccount(n,i),u=!!(a&&U(a)&&(!V(l)||c?.configured===!0&&s?.configured===!1)),d=u?a:l,f=u?c:s,p=f?.enabled??F({plugin:t,account:d,cfg:n}),m=f?.configured??await j({plugin:t,account:d,cfg:n,readAccountConfiguredField:!0});return{accountId:i,account:d,enabled:p,configured:m,snapshot:P({plugin:t,cfg:n,accountId:i,account:d,enabled:p,configured:m})}}const Ze=e=>{let t=e.accountId||`default`;return e.name?.trim()?`${t} (${e.name.trim()})`:t},Qe=e=>{let{plugin:t,cfg:n,entry:r}=e,i=[],a=r.snapshot;a.enabled===!1&&i.push(`disabled`),a.dmPolicy&&i.push(`dm:${a.dmPolicy}`),a.tokenSource&&a.tokenSource!==`none`&&i.push(`token:${a.tokenSource}`),a.botTokenSource&&a.botTokenSource!==`none`&&i.push(`bot:${a.botTokenSource}`),a.appTokenSource&&a.appTokenSource!==`none`&&i.push(`app:${a.appTokenSource}`),a.signingSecretSource&&a.signingSecretSource!==`none`&&i.push(`signing:${a.signingSecretSource}`),U(r.account)&&i.push(`secret unavailable in this command path`),a.baseUrl&&i.push(a.baseUrl),a.port!=null&&i.push(`port:${a.port}`),a.cliPath&&i.push(`cli:${a.cliPath}`),a.dbPath&&i.push(`db:${a.dbPath}`);let o=t.config.resolveAllowFrom?.({cfg:n,accountId:a.accountId})??a.allowFrom;if(o?.length){let e=I({plugin:t,cfg:n,accountId:a.accountId,allowFrom:o}).slice(0,3);e.length>0&&i.push(`allow:${e.join(`,`)}`)}return i};function $e(e){let t=X(e),n=typeof t.linked==`boolean`?t.linked:null,r=typeof t.authAgeMs==`number`?t.authAgeMs:null,i=X(t.self);return{linked:n,authAgeMs:r,selfE164:typeof i.e164==`string`&&i.e164.trim()?i.e164.trim():null}}function et(e){let t=[];for(let n of e){let e=X(n.account),r=X(n.snapshot);for(let n of[`tokenFile`,`botTokenFile`,`appTokenFile`,`cliPath`,`dbPath`,`authDir`]){let i=e[n]??r[n];Je(i)===!1&&t.push(String(i))}}return t}function tt(e){let t=e.accounts.filter(e=>e.enabled);if(t.length===0)return{state:null,detail:null};let n=t.map(e=>X(e.account)),r=n.some(e=>`botToken`in e),i=n.some(e=>`appToken`in e),a=n.some(e=>`signingSecret`in e||`signingSecretSource`in e||`signingSecretStatus`in e),o=n.some(e=>`token`in e);if(!r&&!i&&!a&&!o)return{state:null,detail:null};let s=e=>typeof e.mode==`string`&&e.mode.trim()===`http`,c=(e,t,n)=>{let r=e[t];return typeof r==`string`&&r.trim()?!0:e[n]===`available`};if(r&&a&&t.every(e=>s(X(e.account)))){let n=t.filter(e=>U(e.account)),r=t.filter(e=>{let t=X(e.account);return c(t,`botToken`,`botTokenStatus`)&&c(t,`signingSecret`,`signingSecretStatus`)}),i=t.filter(e=>{let t=X(e.account),n=c(t,`botToken`,`botTokenStatus`),r=c(t,`signingSecret`,`signingSecretStatus`);return n&&!r||!n&&r});if(n.length>0)return{state:`warn`,detail:`configured http credentials unavailable in this command path · accounts ${n.length}`};if(i.length>0)return{state:`warn`,detail:`partial credentials (need bot+signing) · accounts ${i.length}`};if(r.length===0)return{state:`setup`,detail:`no credentials (need bot+signing)`};let a=Z(r.map(e=>e.snapshot.botTokenSource??`none`)),o=Z(r.map(e=>e.snapshot.signingSecretSource??`none`)),s=r[0]?.account?X(r[0].account):{},l=typeof s.botToken==`string`?s.botToken:``,u=typeof s.signingSecret==`string`?s.signingSecret:``,d=l.trim()?Q(l,{showSecrets:e.showSecrets}):``,f=u.trim()?Q(u,{showSecrets:e.showSecrets}):``,p=d||f?` (bot ${d||`?`}, signing ${f||`?`})`:``;return{state:`ok`,detail:`credentials ok (bot ${a.label}, signing ${o.label})${p} · accounts ${r.length}/${t.length||1}`}}if(r&&i){let n=t.filter(e=>U(e.account)),r=t.filter(e=>{let t=X(e.account),n=typeof t.botToken==`string`?t.botToken.trim():``,r=typeof t.appToken==`string`?t.appToken.trim():``;return!!n&&!!r}),i=t.filter(e=>{let t=X(e.account),n=typeof t.botToken==`string`?t.botToken.trim():``,r=typeof t.appToken==`string`?t.appToken.trim():``,i=!!n,a=!!r;return i&&!a||!i&&a});if(i.length>0)return{state:`warn`,detail:`partial tokens (need bot+app) · accounts ${i.length}`};if(n.length>0)return{state:`warn`,detail:`configured tokens unavailable in this command path · accounts ${n.length}`};if(r.length===0)return{state:`setup`,detail:`no tokens (need bot+app)`};let a=Z(r.map(e=>e.snapshot.botTokenSource??`none`)),o=Z(r.map(e=>e.snapshot.appTokenSource??`none`)),s=r[0]?.account?X(r[0].account):{},c=typeof s.botToken==`string`?s.botToken:``,l=typeof s.appToken==`string`?s.appToken:``,u=c.trim()?Q(c,{showSecrets:e.showSecrets}):``,d=l.trim()?Q(l,{showSecrets:e.showSecrets}):``,f=u||d?` (bot ${u||`?`}, app ${d||`?`})`:``;return{state:`ok`,detail:`tokens ok (bot ${a.label}, app ${o.label})${f} · accounts ${r.length}/${t.length||1}`}}if(r){let n=t.filter(e=>U(e.account)),r=t.filter(e=>{let t=X(e.account);return!!(typeof t.botToken==`string`&&t.botToken.trim())});if(n.length>0)return{state:`warn`,detail:`configured bot token unavailable in this command path · accounts ${n.length}`};if(r.length===0)return{state:`setup`,detail:`no bot token`};let i=r[0]?.account?X(r[0].account):{},a=typeof i.botToken==`string`?i.botToken:``,o=a.trim()?Q(a,{showSecrets:e.showSecrets}):``;return{state:`ok`,detail:`bot token config${o?` (${o})`:``} · accounts ${r.length}/${t.length||1}`}}let l=t.filter(e=>U(e.account)),u=t.filter(e=>{let t=X(e.account);return typeof t.token==`string`?!!t.token.trim():!1});if(l.length>0)return{state:`warn`,detail:`configured token unavailable in this command path · accounts ${l.length}`};if(u.length===0)return{state:`setup`,detail:`no token`};let d=Z(u.map(e=>e.snapshot.tokenSource)),f=u[0]?.account?X(u[0].account):{},p=typeof f.token==`string`?f.token:``,m=p.trim()?` (${Q(p,{showSecrets:e.showSecrets})})`:``;return{state:`ok`,detail:`token ${d.label}${m} · accounts ${u.length}/${t.length||1}`}}async function nt(e,t){let n=t?.showSecrets===!0,r=[],i=[];for(let a of E()){let o=a.config.listAccountIds(e),s=T({plugin:a,cfg:e,accountIds:o}),c=o.length>0?o:[s],l=[],u=t?.sourceConfig??e;for(let t of c)l.push(await Xe({plugin:a,cfg:e,sourceConfig:u,accountId:t}));let d=l.some(e=>e.enabled),f=l.filter(e=>e.enabled),p=f.filter(e=>e.configured),m=f.filter(e=>U(e.account)),h=l.find(e=>e.accountId===s)??l[0],g=$e(a.status?.buildChannelSummary?await a.status.buildChannelSummary({account:h?.account??{},cfg:e,defaultAccountId:s,snapshot:h?.snapshot??{accountId:s}}):void 0),_=et(f),v=tt({plugin:a,cfg:e,accounts:l,showSecrets:n}),y=a.status?.collectStatusIssues?a.status.collectStatusIssues(l.map(e=>e.snapshot)):[],b=a.meta.label??a.id,x=d?_.length>0||y.length>0||m.length>0?`warn`:g.linked===!1?`setup`:v.state?v.state:g.linked===!0||p.length>0?`ok`:`setup`:`off`,S=(()=>{if(!d)return h?a.config.disabledReason?.(h.account,e)??`disabled`:`disabled`;if(_.length>0)return`missing file (${_[0]})`;if(y.length>0)return y[0]?.message??`misconfigured`;if(g.linked!==null){let e=g.linked?`linked`:`not linked`,t=[];return g.linked&&g.selfE164&&t.push(g.selfE164),g.linked&&g.authAgeMs!=null&&g.authAgeMs>=0&&t.push(`auth ${W(g.authAgeMs)}`),(l.length>1||a.meta.forceAccountBinding)&&t.push(`accounts ${l.length||1}`),t.length>0?`${e} · ${t.join(` · `)}`:e}if(m.length>0)return v.detail?.includes(`unavailable`)?v.detail:`configured credentials unavailable in this command path · accounts ${m.length}`;if(v.detail)return v.detail;if(p.length>0){let e=`configured`;return l.length<=1&&!a.meta.forceAccountBinding?e:`${e} · accounts ${p.length}/${f.length||1}`}return(h&&a.config.unconfiguredReason?a.config.unconfiguredReason(h.account,e):null)??`not configured`})();r.push({id:a.id,label:b,enabled:d,state:x,detail:S}),p.length>0&&i.push({title:`${b} accounts`,columns:[`Account`,`Status`,`Notes`],rows:p.map(t=>{let n=Qe({plugin:a,cfg:e,entry:t});return{Account:Ze({accountId:t.accountId,name:t.snapshot.name}),Status:t.enabled&&!U(t.account)?`OK`:`WARN`,Notes:n.join(` · `)}})})}return{rows:r,details:i}}async function rt(e,t){let n=await Re.readFile(e,`utf8`).catch(()=>``);if(!n.trim())return[];let r=n.replace(/\r/g,``).split(`
2
2
  `);return r.slice(Math.max(0,r.length-t)).map(e=>e.trimEnd()).filter(e=>e.trim().length>0)}function it(e,t){return!e||!t?0:e.split(t).length-1}function at(e,t){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,Math.max(0,t-1))}…`}function ot(e){return e.replace(/\s+runId=[^\s]+/g,``).replace(/\s+conn=[^\s]+/g,``).replace(/\s+id=[^\s]+/g,``).replace(/\s+error=Error:.*$/g,``).trim()}function st(e,t){let n=e[t]??``,r=n.indexOf(`{`);if(r<0)return null;let i=[n.slice(r)],a=it(i[0]??``,`{`)-it(i[0]??``,`}`),o=t;for(;a>0&&o+1<e.length;){o+=1;let t=e[o]??``;i.push(t),a+=it(t,`{`)-it(t,`}`)}return{json:i.join(`
3
3
  `),endIndex:o}}function ct(e,t){let n=Math.max(6,t?.maxLines??26),r=[],i=new Map,a=(e,t)=>{let n=i.get(e);if(n){n.count+=1;return}i.set(e,{count:1,index:r.length,base:t}),r.push(t)},o=e=>{let t=e.trimEnd();t&&r.push(t)},s=e.map(e=>e.trimEnd()).filter(Boolean);for(let e=0;e<s.length;e+=1){let t=s[e]??``,n=t.trimStart();if((n.startsWith(`"`)||n===`}`||n===`{`||n.startsWith(`}`)||n.startsWith(`{`))&&!n.startsWith(`[`)&&!n.startsWith(`#`))continue;let r=t.match(/^\[([^\]]+)\]\s+Token refresh failed:\s*(\d+)\s*(\{)?\s*$/);if(r){let t=r[1]??`unknown`,n=r[2]??`unknown`,i=st(s,e);if(i){e=i.endIndex;let r=(()=>{try{return JSON.parse(i.json)}catch{return null}})(),o=r?.error?.code?.trim()||null,s=r?.error?.message?.trim()||null,c=s?s.toLowerCase().includes(`signing in again`)?`re-auth required`:at(s,52):null,l=`[${t}] token refresh ${n}${o?` ${o}`:``}${c?` · ${c}`:``}`;a(`token:${t}:${n}:${o??``}:${c??``}`,l);continue}}let i=t.match(/^Embedded agent failed before reply:\s+OAuth token refresh failed for ([^:]+):/);if(i){let e=i[1]?.trim()||`unknown`;a(`embedded:${e}`,`Embedded agent: OAuth token refresh failed (${e})`);continue}if(t.startsWith(`[gws]`)&&t.includes(`errorCode=UNAVAILABLE`)&&t.includes(`OAuth token refresh failed`)){let e=ot(t);a(`gws:${e}`,e);continue}o(t)}for(let e of i.values())e.count<=1||(r[e.index]=`${e.base} ×${e.count}`);let c=[];for(let e of r)c[c.length-1]!==e&&c.push(e);if(c.length<=n)return c;let l=Math.min(6,Math.floor(n/3)),u=Math.max(1,n-l-1);return[...c.slice(0,l),`… ${c.length-l-u} lines omitted …`,...c.slice(-u)]}function lt(e){let t=new Map;for(let n of e){let e=n.channel,r=t.get(e);r?r.push(n):t.set(e,[n])}return t}async function ut(e){let{lines:t,muted:n,ok:r,warn:i,fail:a}=e,o=(e,n)=>{let o=n===`ok`?r(`✓`):n===`warn`?i(`!`):a(`✗`),s=n===`ok`?r(e):n===`warn`?i(e):a(e);t.push(`${o} ${s}`)};t.push(``),t.push(n(`Gateway connection details:`));for(let r of Y(e.connectionDetailsForReport).split(`
4
4
  `).map(e=>e.trimEnd()))t.push(` ${n(r)}`);if(t.push(``),e.snap){let r=e.snap.exists?e.snap.valid?`ok`:`warn`:`fail`;o(`Config: ${e.snap.path??`(unknown)`}`,r);let i=[...e.snap.legacyIssues??[],...e.snap.issues??[]],a=i.filter((e,t)=>i.findIndex(t=>t.path===e.path&&t.message===e.message)===t);for(let e of a.slice(0,12))t.push(` ${ue(e,`-`)}`);a.length>12&&t.push(` ${n(`… +${a.length-12} more`)}`)}else o(`Config: read failed`,`warn`);e.remoteUrlMissing&&(t.push(``),o(`Gateway remote mode misconfigured (gateway.remote.url missing)`,`warn`),t.push(` ${n(`Fix: set gateway.remote.url, or set gateway.mode=local.`)}`)),e.sentinel?.payload?(o(`Restart sentinel present`,`warn`),t.push(` ${n(`${k(e.sentinel.payload)} · ${W(Date.now()-e.sentinel.payload.ts)}`)}`)):o(`Restart sentinel: none`,`ok`);let s=e.lastErr?.trim()??``,c=s.length<8||s===`}`||s===`{`;if(s&&!c&&(t.push(``),t.push(n(`Gateway last log line:`)),t.push(` ${n(Y(s))}`)),e.portUsage){let r=e.portUsage.listeners.length===0;if(o(`Port ${e.port}`,r?`ok`:`warn`),!r)for(let r of d(e.portUsage))t.push(` ${n(r)}`)}{let r=e.tailscale.backendState??`unknown`,i=r===`Running`,a=!!e.tailscale.dnsName;o(e.tailscaleMode===`off`?`Tailscale: off · ${r}${e.tailscale.dnsName?` · ${e.tailscale.dnsName}`:``}`:`Tailscale: ${e.tailscaleMode} · ${r}${e.tailscale.dnsName?` · ${e.tailscale.dnsName}`:``}`,i&&(e.tailscaleMode===`off`||a)?`ok`:`warn`),e.tailscale.error&&t.push(` ${n(`error: ${e.tailscale.error}`)}`),e.tailscale.ips.length>0&&t.push(` ${n(`ips: ${e.tailscale.ips.slice(0,3).join(`, `)}${e.tailscale.ips.length>3?`…`:``}`)}`),e.tailscaleHttpsUrl&&t.push(` ${n(`https: ${e.tailscaleHttpsUrl}`)}`)}if(e.skillStatus){let t=e.skillStatus.skills.filter(e=>e.eligible).length,n=e.skillStatus.skills.filter(e=>e.eligible&&Object.values(e.missing).some(e=>e.length)).length;o(`Skills: ${t} eligible · ${n} missing · ${e.skillStatus.workspaceDir}`,n===0?`ok`:`warn`)}e.progress.setLabel(`Reading logs…`);let l=(()=>{try{return fe(process.env)}catch{return null}})();if(l){e.progress.setLabel(`Reading logs…`);let[r,i]=await Promise.all([rt(l.stderrPath,40).catch(()=>[]),rt(l.stdoutPath,40).catch(()=>[])]);if(r.length>0||i.length>0){t.push(``),t.push(n(`Gateway logs (tail, summarized): ${l.logDir}`)),t.push(` ${n(`# stderr: ${l.stderrPath}`)}`);for(let e of ct(r,{maxLines:22}).map(Y))t.push(` ${n(e)}`);t.push(` ${n(`# stdout: ${l.stdoutPath}`)}`);for(let e of ct(i,{maxLines:22}).map(Y))t.push(` ${n(e)}`)}}if(e.progress.tick(),e.channelsStatus){o(`Channel issues (${e.channelIssues.length||`none`})`,e.channelIssues.length===0?`ok`:`warn`);for(let n of e.channelIssues.slice(0,12)){let e=n.fix?` · fix: ${n.fix}`:``;t.push(` - ${n.channel}[${n.accountId}] ${n.kind}: ${n.message}${e}`)}e.channelIssues.length>12&&t.push(` ${n(`… +${e.channelIssues.length-12} more`)}`)}else o(`Channel issues skipped (gateway ${e.gatewayReachable?`query failed`:`unreachable`})`,`warn`);let u=(()=>{if(!e.health||typeof e.health!=`object`)return``;let t=e.health;if(!(`error`in t))return``;let n=t.error;if(!n)return``;if(typeof n==`string`)return n;try{return JSON.stringify(n,null,2)}catch{return`[unserializable error]`}})();u&&(t.push(``),t.push(n(`Gateway health:`)),t.push(` ${n(Y(u))}`)),t.push(``),t.push(n(`Pasteable debug report. Auth tokens redacted.`)),t.push(`Troubleshooting: https://docs.openclaw.ai/troubleshooting`),t.push(``)}async function dt(e){let r=n(),i=e=>r?t.heading(e):e,a=e=>r?t.success(e):e,o=e=>r?t.warn(e):e,s=e=>r?t.error(e):e,c=e=>r?t.muted(e):e,l=ve(),u=J({width:l,columns:[{key:`Item`,header:`Item`,minWidth:10},{key:`Value`,header:`Value`,flex:!0,minWidth:24}],rows:e.overviewRows}),d=e.channels.rows.map(e=>({channelId:e.id,Channel:e.label,Enabled:e.enabled?a(`ON`):c(`OFF`),State:e.state===`ok`?a(`OK`):e.state===`warn`?o(`WARN`):e.state===`off`?c(`OFF`):t.accentDim(`SETUP`),Detail:e.detail})),f=lt(e.channelIssues),p=J({width:l,columns:[{key:`Channel`,header:`Channel`,minWidth:10},{key:`Enabled`,header:`Enabled`,minWidth:7},{key:`State`,header:`State`,minWidth:8},{key:`Detail`,header:`Detail`,flex:!0,minWidth:28}],rows:d.map(e=>{let t=f.get(e.channelId)??[];if(t.length===0)return e;let n=t[0],r=` · ${o(`gateway: ${String(n.message).slice(0,90)}`)}`;return{...e,State:o(`WARN`),Detail:`${e.Detail}${r}`}})}),m=J({width:l,columns:[{key:`Agent`,header:`Agent`,minWidth:12},{key:`BootstrapFile`,header:`Bootstrap file`,minWidth:14},{key:`Sessions`,header:`Sessions`,align:`right`,minWidth:8},{key:`Active`,header:`Active`,minWidth:10},{key:`Store`,header:`Store`,flex:!0,minWidth:34}],rows:e.agentStatus.agents.map(e=>({Agent:e.name?.trim()?`${e.id} (${e.name.trim()})`:e.id,BootstrapFile:e.bootstrapPending===!0?o(`PRESENT`):e.bootstrapPending===!1?a(`ABSENT`):`unknown`,Sessions:String(e.sessionsCount),Active:e.lastActiveAgeMs==null?`unknown`:W(e.lastActiveAgeMs),Store:e.sessionsPath}))}),h=[];h.push(i(`OpenClaw status --all`)),h.push(``),h.push(i(`Overview`)),h.push(u.trimEnd()),h.push(``),h.push(i(`Channels`)),h.push(p.trimEnd());for(let t of e.channels.details)h.push(``),h.push(i(t.title)),h.push(J({width:l,columns:t.columns.map(e=>({key:e,header:e,flex:e===`Notes`,minWidth:e===`Notes`?28:10})),rows:t.rows.map(e=>({...e,...e.Status===`OK`?{Status:a(`OK`)}:e.Status===`WARN`?{Status:o(`WARN`)}:{}}))}).trimEnd());return h.push(``),h.push(i(`Agents`)),h.push(m.trimEnd()),h.push(``),h.push(i(`Diagnosis (read-only)`)),await ut({lines:h,progress:e.progress,muted:c,ok:a,warn:o,fail:s,connectionDetailsForReport:e.connectionDetailsForReport,...e.diagnosis}),h}async function ft(e,t){try{let[t,n,r]=await Promise.all([e.isLoaded({env:process.env}).catch(()=>!1),e.readRuntime(process.env).catch(()=>void 0),e.readCommand(process.env).catch(()=>null)]),i=r!=null,a=!i&&n?.status===`running`,o=i||a,s=a?`running (externally managed)`:t?e.loadedText:e.notLoadedText;return{label:e.label,installed:o,loaded:t,managedByOpenClaw:i,externallyManaged:a,loadedText:s,runtime:n}}catch{return{label:t,installed:null,loaded:!1,managedByOpenClaw:!1,externallyManaged:!1,loadedText:`unknown`,runtime:void 0}}}async function pt(e,t){await q({label:`Scanning status --all…`,total:11},async n=>{n.setLabel(`Loading config…`);let r=await l(),{resolvedConfig:a}=await oe({config:r,commandName:`status --all`,targetIds:ae(),mode:`summary`}),c=Ge(),u=await o().catch(()=>null);n.tick(),n.setLabel(`Checking Tailscale…`);let d=a.gateway?.tailscale?.mode??`off`,f=await(async()=>{try{let e=await p(D,{timeoutMs:1200}),t=typeof e.BackendState==`string`?e.BackendState:null,n=typeof e.Self==`object`&&e.Self!==null?e.Self:null,r=n&&typeof n.DNSName==`string`?n.DNSName:null;return{ok:!0,backendState:t,dnsName:r?r.replace(/\.$/,``):null,ips:n&&Array.isArray(n.TailscaleIPs)?n.TailscaleIPs.filter(e=>typeof e==`string`&&e.trim().length>0).map(e=>e.trim()):[],error:null}}catch(e){return{ok:!1,backendState:null,dnsName:null,ips:[],error:String(e)}}})(),m=d!==`off`&&f.dnsName?`https://${f.dnsName}${se(a.gateway?.controlUi?.basePath)}`:null;n.tick(),n.setLabel(`Checking for updates…`);let h=await we({root:await S({moduleUrl:import.meta.url,argv1:process.argv[1],cwd:process.cwd()}),timeoutMs:6500,fetchGit:!0,includeRegistry:!0}),g=Se({configChannel:Ce(a.update?.channel),installKind:h.installKind,gitTag:h.git?.tag??null,gitBranch:h.git?.branch??null}).label,_=xe(h);n.tick(),n.setLabel(`Probing gateway…`);let v=re({config:a}),b=a.gateway?.mode===`remote`,x=typeof a.gateway?.remote?.url==`string`?a.gateway.remote.url.trim():``,C=b&&!x,T=b?`remote`:`local`,E=ge({cfg:a,mode:`local`}),O=ge({cfg:a,mode:`remote`}),k=b&&!C?O:E,A=k.auth,j=await he({url:v.url,auth:A,timeoutMs:Math.min(5e3,t?.timeoutMs??1e4)}).catch(()=>null),M=j?.ok===!0,N=ze(j?.presence??null);n.tick(),n.setLabel(`Checking services…`);let P=async e=>{try{let t=await ft(e,e.label);return{label:t.label,installed:t.installed,managedByOpenClaw:t.managedByOpenClaw,loaded:t.loaded,loadedText:t.loadedText,runtime:t.runtime}}catch{return null}},F=await P(pe()),I=await P(De());n.tick(),n.setLabel(`Scanning agents…`);let L=await qe(a);n.tick(),n.setLabel(`Summarizing channels…`);let te=await nt(a,{showSecrets:!1,sourceConfig:r});n.tick();let ne=(()=>{if(!C)return v.message;let e=a.gateway?.bind??`loopback`;return[`Gateway mode: remote`,`Gateway target: (missing gateway.remote.url)`,`Config: ${u?.path?.trim()?u.path.trim():`(unknown config path)`}`,`Bind: ${e}`,`Local fallback (used for probes): ${v.url}`,`Fix: set gateway.remote.url, or set gateway.mode=local.`].join(`
@@ -1,4 +1,4 @@
1
- import{u as e}from"./paths-B4IRk3wi.js";import{A as t,k as n,y as r}from"./subsystem-BQ1073Mu.js";import{Br as i,Fo as a,Fr as o,Hn as s,Ml as c,Nl as l,Po as u,Xs as d,Zs as f,da as p,fu as m,h,ms as g,pu as _,qs as v,sa as y}from"./model-selection-B2r_LMFb.js";import{B as b,D as x,O as S,P as C,Tn as w,c as T,d as E,ft as D,l as O,nn as k,pt as A,s as j,u as M,z as N}from"./reply-DHtpIWpD.js";import{d as P}from"./agent-scope-DW6ZDCxj.js";import{E as F}from"./session-key-D3P0tf5P.js";import{t as I}from"./openclaw-root-D_0Q6--h.js";import{t as L}from"./command-format-BbDT1tlm.js";import{lt as R,n as ee}from"./plugins-1aNlpDX7.js";import{n as te}from"./exec-BdtFni8N.js";import{c as z}from"./paths-yLEk_25I.js";import{n as B,t as ne}from"./call-BQAAYLj3.js";import{n as V,r as H,t as U}from"./read-only-account-inspect-DLD1Pk6l.js";import{n as W}from"./format-relative-B9pSIdGe.js";import{r as re}from"./format-duration-D5AMtmHa.js";import{a as ie}from"./skill-commands-BN3rmzgq.js";import{o as G,s as ae}from"./command-secret-targets-CbrSGcvV.js";import{C as oe,g as se}from"./onboard-helpers-CKsetIvC.js";import{r as ce}from"./memory-cli-P0GDvKlz.js";import{n as K}from"./progress-Cyn5U745.js";import{t as le}from"./skills-status-CId4JgRV.js";import{t as ue}from"./issue-format-BM2kAbbw.js";import{t as de}from"./channels-status-issues-hU0uOU87.js";import{c as fe,n as pe}from"./service-BMP0stI7.js";import{t as me}from"./runtime-status-CqFBmdRd.js";import{r as he,t as q}from"./probe-auth-CegC2fDL.js";import{t as ge}from"./diagnostics-DxEtFsuc.js";import{n as J,t as _e}from"./table-CWiulZxe.js";import{o as ve,t as ye}from"./health-DWAEDZ8p.js";import{a as be,g as xe,m as Se,n as Ce,t as we}from"./channel-account-context-kX_5d8CX.js";import{t as Te}from"./audit-kkWTh8s9.js";import{t as Ee}from"./node-service-CIS6wvT6.js";import{n as Y,t as De}from"./format-Bn1bwJKX.js";import{i as Oe,n as ke,r as Ae,t as je}from"./status.update-ioEIhrgk.js";import{t as Me}from"./text-format-CvrvBBre.js";import Ne from"node:fs";import Pe from"node:os";import Fe from"node:path";import Ie from"node:fs/promises";import{spawnSync as Le}from"node:child_process";function Re(e){if(!Array.isArray(e))return null;let t=e,n=t.find(e=>e.mode===`gateway`&&e.reason===`self`)??t.find(e=>typeof e.text==`string`&&String(e.text).startsWith(`Gateway:`))??null;return n?{host:typeof n.host==`string`?n.host:void 0,ip:typeof n.ip==`string`?n.ip:void 0,version:typeof n.version==`string`?n.version:void 0,platform:typeof n.platform==`string`?n.platform:void 0}:null}function ze(e){return e.enabled?e.available===!0?{tone:`ok`,state:`ready`}:e.available===!1?{tone:`warn`,state:`unavailable`}:{tone:`muted`,state:`unknown`}:{tone:`muted`,state:`disabled`}}function Be(e){return e.enabled?e.available?{tone:`ok`,state:`ready`}:{tone:`warn`,state:`unavailable`}:{tone:`muted`,state:`disabled`}}function Ve(e){return e.enabled?{tone:`ok`,text:`cache on${typeof e.entries==`number`?` (${e.entries})`:``}`}:{tone:`muted`,text:`cache off`}}function He(e){return typeof e==`string`?e.trim():``}function Ue(){return He(Le(`sw_vers`,[`-productVersion`],{encoding:`utf-8`}).stdout)||Pe.release()}function We(){let e=Pe.platform(),t=Pe.release(),n=Pe.arch();return{platform:e,arch:n,release:t,label:e===`darwin`?`macos ${Ue()} (${n})`:e===`win32`?`windows ${t} (${n})`:`${e} ${t} (${n})`}}async function Ge(e){try{return await Ie.access(e),!0}catch{return!1}}async function Ke(e){let t=S(e),n=Date.now(),r=await Promise.all(t.agents.map(async t=>{let r=(()=>{try{return P(e,t.id)}catch{return null}})(),i=r==null?null:await Ge(Fe.join(r,`BOOTSTRAP.md`)),a=z(e.session?.store,{agentId:t.id}),o=(()=>{try{return s(a)}catch{return{}}})(),c=Object.values(o).reduce((e,t)=>Math.max(e,t?.updatedAt??0),0),l=c>0?c:null,u=l?n-l:null,d=Object.keys(o).filter(e=>e!==`global`&&e!==`unknown`).length;return{id:t.id,name:t.name,workspaceDir:r,bootstrapPending:i,sessionsPath:a,sessionsCount:d,lastUpdatedAt:l,lastActiveAgeMs:u}})),i=r.reduce((e,t)=>e+t.sessionsCount,0),a=r.reduce((e,t)=>e+(t.bootstrapPending?1:0),0);return{defaultId:t.defaultId,agents:r,totalSessions:i,bootstrapPendingCount:a}}const X=e=>e&&typeof e==`object`?e:{};function Z(e){let t=new Map;for(let n of e){let e=n?.trim()?n.trim():`unknown`;t.set(e,(t.get(e)??0)+1)}let n=[...t.entries()].toSorted((e,t)=>t[1]-e[1]).map(([e,t])=>`${e}${t>1?`×${t}`:``}`);return{label:n.length>0?n.join(`+`):`unknown`,parts:n}}function qe(e){let t=e?.trim()||``;if(!t)return null;try{return Ne.existsSync(t)}catch{return null}}function Q(e,t){let n=e.trim();if(!n)return`empty`;if(!t.showSecrets)return`sha256:${g(n,8)} · len ${n.length}`;let r=n.slice(0,4),i=n.slice(-4);return n.length<=10?`${n} · len ${n.length}`:`${r}…${i} · len ${n.length}`}function Je(e,t,n){return e.config.inspectAccount?.(t,n)??U({channelId:e.id,cfg:t,accountId:n})}async function Ye(e){let{plugin:t,cfg:n,sourceConfig:r,accountId:i}=e,a=Je(t,r,i),o=Je(t,n,i),s=o,c=a,l=o??t.config.resolveAccount(n,i),u=!!(a&&V(a)&&(!H(l)||c?.configured===!0&&s?.configured===!1)),d=u?a:l,f=u?c:s,p=f?.enabled??E({plugin:t,account:d,cfg:n}),m=f?.configured??await M({plugin:t,account:d,cfg:n,readAccountConfiguredField:!0});return{accountId:i,account:d,enabled:p,configured:m,snapshot:T({plugin:t,cfg:n,accountId:i,account:d,enabled:p,configured:m})}}const Xe=e=>{let t=e.accountId||`default`;return e.name?.trim()?`${t} (${e.name.trim()})`:t},Ze=e=>{let{plugin:t,cfg:n,entry:r}=e,i=[],a=r.snapshot;a.enabled===!1&&i.push(`disabled`),a.dmPolicy&&i.push(`dm:${a.dmPolicy}`),a.tokenSource&&a.tokenSource!==`none`&&i.push(`token:${a.tokenSource}`),a.botTokenSource&&a.botTokenSource!==`none`&&i.push(`bot:${a.botTokenSource}`),a.appTokenSource&&a.appTokenSource!==`none`&&i.push(`app:${a.appTokenSource}`),a.signingSecretSource&&a.signingSecretSource!==`none`&&i.push(`signing:${a.signingSecretSource}`),V(r.account)&&i.push(`secret unavailable in this command path`),a.baseUrl&&i.push(a.baseUrl),a.port!=null&&i.push(`port:${a.port}`),a.cliPath&&i.push(`cli:${a.cliPath}`),a.dbPath&&i.push(`db:${a.dbPath}`);let o=t.config.resolveAllowFrom?.({cfg:n,accountId:a.accountId})??a.allowFrom;if(o?.length){let e=O({plugin:t,cfg:n,accountId:a.accountId,allowFrom:o}).slice(0,3);e.length>0&&i.push(`allow:${e.join(`,`)}`)}return i};function Qe(e){let t=X(e),n=typeof t.linked==`boolean`?t.linked:null,r=typeof t.authAgeMs==`number`?t.authAgeMs:null,i=X(t.self);return{linked:n,authAgeMs:r,selfE164:typeof i.e164==`string`&&i.e164.trim()?i.e164.trim():null}}function $e(e){let t=[];for(let n of e){let e=X(n.account),r=X(n.snapshot);for(let n of[`tokenFile`,`botTokenFile`,`appTokenFile`,`cliPath`,`dbPath`,`authDir`]){let i=e[n]??r[n];qe(i)===!1&&t.push(String(i))}}return t}function et(e){let t=e.accounts.filter(e=>e.enabled);if(t.length===0)return{state:null,detail:null};let n=t.map(e=>X(e.account)),r=n.some(e=>`botToken`in e),i=n.some(e=>`appToken`in e),a=n.some(e=>`signingSecret`in e||`signingSecretSource`in e||`signingSecretStatus`in e),o=n.some(e=>`token`in e);if(!r&&!i&&!a&&!o)return{state:null,detail:null};let s=e=>typeof e.mode==`string`&&e.mode.trim()===`http`,c=(e,t,n)=>{let r=e[t];return typeof r==`string`&&r.trim()?!0:e[n]===`available`};if(r&&a&&t.every(e=>s(X(e.account)))){let n=t.filter(e=>V(e.account)),r=t.filter(e=>{let t=X(e.account);return c(t,`botToken`,`botTokenStatus`)&&c(t,`signingSecret`,`signingSecretStatus`)}),i=t.filter(e=>{let t=X(e.account),n=c(t,`botToken`,`botTokenStatus`),r=c(t,`signingSecret`,`signingSecretStatus`);return n&&!r||!n&&r});if(n.length>0)return{state:`warn`,detail:`configured http credentials unavailable in this command path · accounts ${n.length}`};if(i.length>0)return{state:`warn`,detail:`partial credentials (need bot+signing) · accounts ${i.length}`};if(r.length===0)return{state:`setup`,detail:`no credentials (need bot+signing)`};let a=Z(r.map(e=>e.snapshot.botTokenSource??`none`)),o=Z(r.map(e=>e.snapshot.signingSecretSource??`none`)),s=r[0]?.account?X(r[0].account):{},l=typeof s.botToken==`string`?s.botToken:``,u=typeof s.signingSecret==`string`?s.signingSecret:``,d=l.trim()?Q(l,{showSecrets:e.showSecrets}):``,f=u.trim()?Q(u,{showSecrets:e.showSecrets}):``,p=d||f?` (bot ${d||`?`}, signing ${f||`?`})`:``;return{state:`ok`,detail:`credentials ok (bot ${a.label}, signing ${o.label})${p} · accounts ${r.length}/${t.length||1}`}}if(r&&i){let n=t.filter(e=>V(e.account)),r=t.filter(e=>{let t=X(e.account),n=typeof t.botToken==`string`?t.botToken.trim():``,r=typeof t.appToken==`string`?t.appToken.trim():``;return!!n&&!!r}),i=t.filter(e=>{let t=X(e.account),n=typeof t.botToken==`string`?t.botToken.trim():``,r=typeof t.appToken==`string`?t.appToken.trim():``,i=!!n,a=!!r;return i&&!a||!i&&a});if(i.length>0)return{state:`warn`,detail:`partial tokens (need bot+app) · accounts ${i.length}`};if(n.length>0)return{state:`warn`,detail:`configured tokens unavailable in this command path · accounts ${n.length}`};if(r.length===0)return{state:`setup`,detail:`no tokens (need bot+app)`};let a=Z(r.map(e=>e.snapshot.botTokenSource??`none`)),o=Z(r.map(e=>e.snapshot.appTokenSource??`none`)),s=r[0]?.account?X(r[0].account):{},c=typeof s.botToken==`string`?s.botToken:``,l=typeof s.appToken==`string`?s.appToken:``,u=c.trim()?Q(c,{showSecrets:e.showSecrets}):``,d=l.trim()?Q(l,{showSecrets:e.showSecrets}):``,f=u||d?` (bot ${u||`?`}, app ${d||`?`})`:``;return{state:`ok`,detail:`tokens ok (bot ${a.label}, app ${o.label})${f} · accounts ${r.length}/${t.length||1}`}}if(r){let n=t.filter(e=>V(e.account)),r=t.filter(e=>{let t=X(e.account);return!!(typeof t.botToken==`string`&&t.botToken.trim())});if(n.length>0)return{state:`warn`,detail:`configured bot token unavailable in this command path · accounts ${n.length}`};if(r.length===0)return{state:`setup`,detail:`no bot token`};let i=r[0]?.account?X(r[0].account):{},a=typeof i.botToken==`string`?i.botToken:``,o=a.trim()?Q(a,{showSecrets:e.showSecrets}):``;return{state:`ok`,detail:`bot token config${o?` (${o})`:``} · accounts ${r.length}/${t.length||1}`}}let l=t.filter(e=>V(e.account)),u=t.filter(e=>{let t=X(e.account);return typeof t.token==`string`?!!t.token.trim():!1});if(l.length>0)return{state:`warn`,detail:`configured token unavailable in this command path · accounts ${l.length}`};if(u.length===0)return{state:`setup`,detail:`no token`};let d=Z(u.map(e=>e.snapshot.tokenSource)),f=u[0]?.account?X(u[0].account):{},p=typeof f.token==`string`?f.token:``,m=p.trim()?` (${Q(p,{showSecrets:e.showSecrets})})`:``;return{state:`ok`,detail:`token ${d.label}${m} · accounts ${u.length}/${t.length||1}`}}async function tt(e,t){let n=t?.showSecrets===!0,r=[],i=[];for(let a of ee()){let o=a.config.listAccountIds(e),s=R({plugin:a,cfg:e,accountIds:o}),c=o.length>0?o:[s],l=[],u=t?.sourceConfig??e;for(let t of c)l.push(await Ye({plugin:a,cfg:e,sourceConfig:u,accountId:t}));let d=l.some(e=>e.enabled),f=l.filter(e=>e.enabled),p=f.filter(e=>e.configured),m=f.filter(e=>V(e.account)),h=l.find(e=>e.accountId===s)??l[0],g=Qe(a.status?.buildChannelSummary?await a.status.buildChannelSummary({account:h?.account??{},cfg:e,defaultAccountId:s,snapshot:h?.snapshot??{accountId:s}}):void 0),_=$e(f),v=et({plugin:a,cfg:e,accounts:l,showSecrets:n}),y=a.status?.collectStatusIssues?a.status.collectStatusIssues(l.map(e=>e.snapshot)):[],b=a.meta.label??a.id,x=d?_.length>0||y.length>0||m.length>0?`warn`:g.linked===!1?`setup`:v.state?v.state:g.linked===!0||p.length>0?`ok`:`setup`:`off`,S=(()=>{if(!d)return h?a.config.disabledReason?.(h.account,e)??`disabled`:`disabled`;if(_.length>0)return`missing file (${_[0]})`;if(y.length>0)return y[0]?.message??`misconfigured`;if(g.linked!==null){let e=g.linked?`linked`:`not linked`,t=[];return g.linked&&g.selfE164&&t.push(g.selfE164),g.linked&&g.authAgeMs!=null&&g.authAgeMs>=0&&t.push(`auth ${W(g.authAgeMs)}`),(l.length>1||a.meta.forceAccountBinding)&&t.push(`accounts ${l.length||1}`),t.length>0?`${e} · ${t.join(` · `)}`:e}if(m.length>0)return v.detail?.includes(`unavailable`)?v.detail:`configured credentials unavailable in this command path · accounts ${m.length}`;if(v.detail)return v.detail;if(p.length>0){let e=`configured`;return l.length<=1&&!a.meta.forceAccountBinding?e:`${e} · accounts ${p.length}/${f.length||1}`}return(h&&a.config.unconfiguredReason?a.config.unconfiguredReason(h.account,e):null)??`not configured`})();r.push({id:a.id,label:b,enabled:d,state:x,detail:S}),p.length>0&&i.push({title:`${b} accounts`,columns:[`Account`,`Status`,`Notes`],rows:p.map(t=>{let n=Ze({plugin:a,cfg:e,entry:t});return{Account:Xe({accountId:t.accountId,name:t.snapshot.name}),Status:t.enabled&&!V(t.account)?`OK`:`WARN`,Notes:n.join(` · `)}})})}return{rows:r,details:i}}async function nt(e,t){let n=await Ie.readFile(e,`utf8`).catch(()=>``);if(!n.trim())return[];let r=n.replace(/\r/g,``).split(`
1
+ import{u as e}from"./paths-B4IRk3wi.js";import{A as t,k as n,y as r}from"./subsystem-BQ1073Mu.js";import{Br as i,Fo as a,Fr as o,Hn as s,Ml as c,Nl as l,Po as u,Xs as d,Zs as f,da as p,fu as m,h,ms as g,pu as _,qs as v,sa as y}from"./model-selection-B2r_LMFb.js";import{B as b,D as x,O as S,P as C,Tn as w,c as T,d as E,ft as D,l as O,nn as k,pt as A,s as j,u as M,z as N}from"./reply-HrabJs88.js";import{d as P}from"./agent-scope-DW6ZDCxj.js";import{E as F}from"./session-key-D3P0tf5P.js";import{t as I}from"./openclaw-root-D_0Q6--h.js";import{t as L}from"./command-format-BbDT1tlm.js";import{lt as R,n as ee}from"./plugins-1aNlpDX7.js";import{n as te}from"./exec-BdtFni8N.js";import{c as z}from"./paths-yLEk_25I.js";import{n as B,t as ne}from"./call-BQAAYLj3.js";import{n as V,r as H,t as U}from"./read-only-account-inspect-DLD1Pk6l.js";import{n as W}from"./format-relative-B9pSIdGe.js";import{r as re}from"./format-duration-D5AMtmHa.js";import{a as ie}from"./skill-commands-BN3rmzgq.js";import{o as G,s as ae}from"./command-secret-targets-CbrSGcvV.js";import{C as oe,g as se}from"./onboard-helpers-CKsetIvC.js";import{r as ce}from"./memory-cli-P0GDvKlz.js";import{n as K}from"./progress-Cyn5U745.js";import{t as le}from"./skills-status-CId4JgRV.js";import{t as ue}from"./issue-format-BM2kAbbw.js";import{t as de}from"./channels-status-issues-hU0uOU87.js";import{c as fe,n as pe}from"./service-BMP0stI7.js";import{t as me}from"./runtime-status-CqFBmdRd.js";import{r as he,t as q}from"./probe-auth-CegC2fDL.js";import{t as ge}from"./diagnostics-DxEtFsuc.js";import{n as J,t as _e}from"./table-CWiulZxe.js";import{o as ve,t as ye}from"./health-dTYbHKsD.js";import{a as be,g as xe,m as Se,n as Ce,t as we}from"./channel-account-context-kX_5d8CX.js";import{t as Te}from"./audit-kkWTh8s9.js";import{t as Ee}from"./node-service-CIS6wvT6.js";import{n as Y,t as De}from"./format-Bn1bwJKX.js";import{i as Oe,n as ke,r as Ae,t as je}from"./status.update-ioEIhrgk.js";import{t as Me}from"./text-format-CvrvBBre.js";import Ne from"node:fs";import Pe from"node:os";import Fe from"node:path";import Ie from"node:fs/promises";import{spawnSync as Le}from"node:child_process";function Re(e){if(!Array.isArray(e))return null;let t=e,n=t.find(e=>e.mode===`gateway`&&e.reason===`self`)??t.find(e=>typeof e.text==`string`&&String(e.text).startsWith(`Gateway:`))??null;return n?{host:typeof n.host==`string`?n.host:void 0,ip:typeof n.ip==`string`?n.ip:void 0,version:typeof n.version==`string`?n.version:void 0,platform:typeof n.platform==`string`?n.platform:void 0}:null}function ze(e){return e.enabled?e.available===!0?{tone:`ok`,state:`ready`}:e.available===!1?{tone:`warn`,state:`unavailable`}:{tone:`muted`,state:`unknown`}:{tone:`muted`,state:`disabled`}}function Be(e){return e.enabled?e.available?{tone:`ok`,state:`ready`}:{tone:`warn`,state:`unavailable`}:{tone:`muted`,state:`disabled`}}function Ve(e){return e.enabled?{tone:`ok`,text:`cache on${typeof e.entries==`number`?` (${e.entries})`:``}`}:{tone:`muted`,text:`cache off`}}function He(e){return typeof e==`string`?e.trim():``}function Ue(){return He(Le(`sw_vers`,[`-productVersion`],{encoding:`utf-8`}).stdout)||Pe.release()}function We(){let e=Pe.platform(),t=Pe.release(),n=Pe.arch();return{platform:e,arch:n,release:t,label:e===`darwin`?`macos ${Ue()} (${n})`:e===`win32`?`windows ${t} (${n})`:`${e} ${t} (${n})`}}async function Ge(e){try{return await Ie.access(e),!0}catch{return!1}}async function Ke(e){let t=S(e),n=Date.now(),r=await Promise.all(t.agents.map(async t=>{let r=(()=>{try{return P(e,t.id)}catch{return null}})(),i=r==null?null:await Ge(Fe.join(r,`BOOTSTRAP.md`)),a=z(e.session?.store,{agentId:t.id}),o=(()=>{try{return s(a)}catch{return{}}})(),c=Object.values(o).reduce((e,t)=>Math.max(e,t?.updatedAt??0),0),l=c>0?c:null,u=l?n-l:null,d=Object.keys(o).filter(e=>e!==`global`&&e!==`unknown`).length;return{id:t.id,name:t.name,workspaceDir:r,bootstrapPending:i,sessionsPath:a,sessionsCount:d,lastUpdatedAt:l,lastActiveAgeMs:u}})),i=r.reduce((e,t)=>e+t.sessionsCount,0),a=r.reduce((e,t)=>e+(t.bootstrapPending?1:0),0);return{defaultId:t.defaultId,agents:r,totalSessions:i,bootstrapPendingCount:a}}const X=e=>e&&typeof e==`object`?e:{};function Z(e){let t=new Map;for(let n of e){let e=n?.trim()?n.trim():`unknown`;t.set(e,(t.get(e)??0)+1)}let n=[...t.entries()].toSorted((e,t)=>t[1]-e[1]).map(([e,t])=>`${e}${t>1?`×${t}`:``}`);return{label:n.length>0?n.join(`+`):`unknown`,parts:n}}function qe(e){let t=e?.trim()||``;if(!t)return null;try{return Ne.existsSync(t)}catch{return null}}function Q(e,t){let n=e.trim();if(!n)return`empty`;if(!t.showSecrets)return`sha256:${g(n,8)} · len ${n.length}`;let r=n.slice(0,4),i=n.slice(-4);return n.length<=10?`${n} · len ${n.length}`:`${r}…${i} · len ${n.length}`}function Je(e,t,n){return e.config.inspectAccount?.(t,n)??U({channelId:e.id,cfg:t,accountId:n})}async function Ye(e){let{plugin:t,cfg:n,sourceConfig:r,accountId:i}=e,a=Je(t,r,i),o=Je(t,n,i),s=o,c=a,l=o??t.config.resolveAccount(n,i),u=!!(a&&V(a)&&(!H(l)||c?.configured===!0&&s?.configured===!1)),d=u?a:l,f=u?c:s,p=f?.enabled??E({plugin:t,account:d,cfg:n}),m=f?.configured??await M({plugin:t,account:d,cfg:n,readAccountConfiguredField:!0});return{accountId:i,account:d,enabled:p,configured:m,snapshot:T({plugin:t,cfg:n,accountId:i,account:d,enabled:p,configured:m})}}const Xe=e=>{let t=e.accountId||`default`;return e.name?.trim()?`${t} (${e.name.trim()})`:t},Ze=e=>{let{plugin:t,cfg:n,entry:r}=e,i=[],a=r.snapshot;a.enabled===!1&&i.push(`disabled`),a.dmPolicy&&i.push(`dm:${a.dmPolicy}`),a.tokenSource&&a.tokenSource!==`none`&&i.push(`token:${a.tokenSource}`),a.botTokenSource&&a.botTokenSource!==`none`&&i.push(`bot:${a.botTokenSource}`),a.appTokenSource&&a.appTokenSource!==`none`&&i.push(`app:${a.appTokenSource}`),a.signingSecretSource&&a.signingSecretSource!==`none`&&i.push(`signing:${a.signingSecretSource}`),V(r.account)&&i.push(`secret unavailable in this command path`),a.baseUrl&&i.push(a.baseUrl),a.port!=null&&i.push(`port:${a.port}`),a.cliPath&&i.push(`cli:${a.cliPath}`),a.dbPath&&i.push(`db:${a.dbPath}`);let o=t.config.resolveAllowFrom?.({cfg:n,accountId:a.accountId})??a.allowFrom;if(o?.length){let e=O({plugin:t,cfg:n,accountId:a.accountId,allowFrom:o}).slice(0,3);e.length>0&&i.push(`allow:${e.join(`,`)}`)}return i};function Qe(e){let t=X(e),n=typeof t.linked==`boolean`?t.linked:null,r=typeof t.authAgeMs==`number`?t.authAgeMs:null,i=X(t.self);return{linked:n,authAgeMs:r,selfE164:typeof i.e164==`string`&&i.e164.trim()?i.e164.trim():null}}function $e(e){let t=[];for(let n of e){let e=X(n.account),r=X(n.snapshot);for(let n of[`tokenFile`,`botTokenFile`,`appTokenFile`,`cliPath`,`dbPath`,`authDir`]){let i=e[n]??r[n];qe(i)===!1&&t.push(String(i))}}return t}function et(e){let t=e.accounts.filter(e=>e.enabled);if(t.length===0)return{state:null,detail:null};let n=t.map(e=>X(e.account)),r=n.some(e=>`botToken`in e),i=n.some(e=>`appToken`in e),a=n.some(e=>`signingSecret`in e||`signingSecretSource`in e||`signingSecretStatus`in e),o=n.some(e=>`token`in e);if(!r&&!i&&!a&&!o)return{state:null,detail:null};let s=e=>typeof e.mode==`string`&&e.mode.trim()===`http`,c=(e,t,n)=>{let r=e[t];return typeof r==`string`&&r.trim()?!0:e[n]===`available`};if(r&&a&&t.every(e=>s(X(e.account)))){let n=t.filter(e=>V(e.account)),r=t.filter(e=>{let t=X(e.account);return c(t,`botToken`,`botTokenStatus`)&&c(t,`signingSecret`,`signingSecretStatus`)}),i=t.filter(e=>{let t=X(e.account),n=c(t,`botToken`,`botTokenStatus`),r=c(t,`signingSecret`,`signingSecretStatus`);return n&&!r||!n&&r});if(n.length>0)return{state:`warn`,detail:`configured http credentials unavailable in this command path · accounts ${n.length}`};if(i.length>0)return{state:`warn`,detail:`partial credentials (need bot+signing) · accounts ${i.length}`};if(r.length===0)return{state:`setup`,detail:`no credentials (need bot+signing)`};let a=Z(r.map(e=>e.snapshot.botTokenSource??`none`)),o=Z(r.map(e=>e.snapshot.signingSecretSource??`none`)),s=r[0]?.account?X(r[0].account):{},l=typeof s.botToken==`string`?s.botToken:``,u=typeof s.signingSecret==`string`?s.signingSecret:``,d=l.trim()?Q(l,{showSecrets:e.showSecrets}):``,f=u.trim()?Q(u,{showSecrets:e.showSecrets}):``,p=d||f?` (bot ${d||`?`}, signing ${f||`?`})`:``;return{state:`ok`,detail:`credentials ok (bot ${a.label}, signing ${o.label})${p} · accounts ${r.length}/${t.length||1}`}}if(r&&i){let n=t.filter(e=>V(e.account)),r=t.filter(e=>{let t=X(e.account),n=typeof t.botToken==`string`?t.botToken.trim():``,r=typeof t.appToken==`string`?t.appToken.trim():``;return!!n&&!!r}),i=t.filter(e=>{let t=X(e.account),n=typeof t.botToken==`string`?t.botToken.trim():``,r=typeof t.appToken==`string`?t.appToken.trim():``,i=!!n,a=!!r;return i&&!a||!i&&a});if(i.length>0)return{state:`warn`,detail:`partial tokens (need bot+app) · accounts ${i.length}`};if(n.length>0)return{state:`warn`,detail:`configured tokens unavailable in this command path · accounts ${n.length}`};if(r.length===0)return{state:`setup`,detail:`no tokens (need bot+app)`};let a=Z(r.map(e=>e.snapshot.botTokenSource??`none`)),o=Z(r.map(e=>e.snapshot.appTokenSource??`none`)),s=r[0]?.account?X(r[0].account):{},c=typeof s.botToken==`string`?s.botToken:``,l=typeof s.appToken==`string`?s.appToken:``,u=c.trim()?Q(c,{showSecrets:e.showSecrets}):``,d=l.trim()?Q(l,{showSecrets:e.showSecrets}):``,f=u||d?` (bot ${u||`?`}, app ${d||`?`})`:``;return{state:`ok`,detail:`tokens ok (bot ${a.label}, app ${o.label})${f} · accounts ${r.length}/${t.length||1}`}}if(r){let n=t.filter(e=>V(e.account)),r=t.filter(e=>{let t=X(e.account);return!!(typeof t.botToken==`string`&&t.botToken.trim())});if(n.length>0)return{state:`warn`,detail:`configured bot token unavailable in this command path · accounts ${n.length}`};if(r.length===0)return{state:`setup`,detail:`no bot token`};let i=r[0]?.account?X(r[0].account):{},a=typeof i.botToken==`string`?i.botToken:``,o=a.trim()?Q(a,{showSecrets:e.showSecrets}):``;return{state:`ok`,detail:`bot token config${o?` (${o})`:``} · accounts ${r.length}/${t.length||1}`}}let l=t.filter(e=>V(e.account)),u=t.filter(e=>{let t=X(e.account);return typeof t.token==`string`?!!t.token.trim():!1});if(l.length>0)return{state:`warn`,detail:`configured token unavailable in this command path · accounts ${l.length}`};if(u.length===0)return{state:`setup`,detail:`no token`};let d=Z(u.map(e=>e.snapshot.tokenSource)),f=u[0]?.account?X(u[0].account):{},p=typeof f.token==`string`?f.token:``,m=p.trim()?` (${Q(p,{showSecrets:e.showSecrets})})`:``;return{state:`ok`,detail:`token ${d.label}${m} · accounts ${u.length}/${t.length||1}`}}async function tt(e,t){let n=t?.showSecrets===!0,r=[],i=[];for(let a of ee()){let o=a.config.listAccountIds(e),s=R({plugin:a,cfg:e,accountIds:o}),c=o.length>0?o:[s],l=[],u=t?.sourceConfig??e;for(let t of c)l.push(await Ye({plugin:a,cfg:e,sourceConfig:u,accountId:t}));let d=l.some(e=>e.enabled),f=l.filter(e=>e.enabled),p=f.filter(e=>e.configured),m=f.filter(e=>V(e.account)),h=l.find(e=>e.accountId===s)??l[0],g=Qe(a.status?.buildChannelSummary?await a.status.buildChannelSummary({account:h?.account??{},cfg:e,defaultAccountId:s,snapshot:h?.snapshot??{accountId:s}}):void 0),_=$e(f),v=et({plugin:a,cfg:e,accounts:l,showSecrets:n}),y=a.status?.collectStatusIssues?a.status.collectStatusIssues(l.map(e=>e.snapshot)):[],b=a.meta.label??a.id,x=d?_.length>0||y.length>0||m.length>0?`warn`:g.linked===!1?`setup`:v.state?v.state:g.linked===!0||p.length>0?`ok`:`setup`:`off`,S=(()=>{if(!d)return h?a.config.disabledReason?.(h.account,e)??`disabled`:`disabled`;if(_.length>0)return`missing file (${_[0]})`;if(y.length>0)return y[0]?.message??`misconfigured`;if(g.linked!==null){let e=g.linked?`linked`:`not linked`,t=[];return g.linked&&g.selfE164&&t.push(g.selfE164),g.linked&&g.authAgeMs!=null&&g.authAgeMs>=0&&t.push(`auth ${W(g.authAgeMs)}`),(l.length>1||a.meta.forceAccountBinding)&&t.push(`accounts ${l.length||1}`),t.length>0?`${e} · ${t.join(` · `)}`:e}if(m.length>0)return v.detail?.includes(`unavailable`)?v.detail:`configured credentials unavailable in this command path · accounts ${m.length}`;if(v.detail)return v.detail;if(p.length>0){let e=`configured`;return l.length<=1&&!a.meta.forceAccountBinding?e:`${e} · accounts ${p.length}/${f.length||1}`}return(h&&a.config.unconfiguredReason?a.config.unconfiguredReason(h.account,e):null)??`not configured`})();r.push({id:a.id,label:b,enabled:d,state:x,detail:S}),p.length>0&&i.push({title:`${b} accounts`,columns:[`Account`,`Status`,`Notes`],rows:p.map(t=>{let n=Ze({plugin:a,cfg:e,entry:t});return{Account:Xe({accountId:t.accountId,name:t.snapshot.name}),Status:t.enabled&&!V(t.account)?`OK`:`WARN`,Notes:n.join(` · `)}})})}return{rows:r,details:i}}async function nt(e,t){let n=await Ie.readFile(e,`utf8`).catch(()=>``);if(!n.trim())return[];let r=n.replace(/\r/g,``).split(`
2
2
  `);return r.slice(Math.max(0,r.length-t)).map(e=>e.trimEnd()).filter(e=>e.trim().length>0)}function rt(e,t){return!e||!t?0:e.split(t).length-1}function it(e,t){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,Math.max(0,t-1))}…`}function at(e){return e.replace(/\s+runId=[^\s]+/g,``).replace(/\s+conn=[^\s]+/g,``).replace(/\s+id=[^\s]+/g,``).replace(/\s+error=Error:.*$/g,``).trim()}function ot(e,t){let n=e[t]??``,r=n.indexOf(`{`);if(r<0)return null;let i=[n.slice(r)],a=rt(i[0]??``,`{`)-rt(i[0]??``,`}`),o=t;for(;a>0&&o+1<e.length;){o+=1;let t=e[o]??``;i.push(t),a+=rt(t,`{`)-rt(t,`}`)}return{json:i.join(`
3
3
  `),endIndex:o}}function st(e,t){let n=Math.max(6,t?.maxLines??26),r=[],i=new Map,a=(e,t)=>{let n=i.get(e);if(n){n.count+=1;return}i.set(e,{count:1,index:r.length,base:t}),r.push(t)},o=e=>{let t=e.trimEnd();t&&r.push(t)},s=e.map(e=>e.trimEnd()).filter(Boolean);for(let e=0;e<s.length;e+=1){let t=s[e]??``,n=t.trimStart();if((n.startsWith(`"`)||n===`}`||n===`{`||n.startsWith(`}`)||n.startsWith(`{`))&&!n.startsWith(`[`)&&!n.startsWith(`#`))continue;let r=t.match(/^\[([^\]]+)\]\s+Token refresh failed:\s*(\d+)\s*(\{)?\s*$/);if(r){let t=r[1]??`unknown`,n=r[2]??`unknown`,i=ot(s,e);if(i){e=i.endIndex;let r=(()=>{try{return JSON.parse(i.json)}catch{return null}})(),o=r?.error?.code?.trim()||null,s=r?.error?.message?.trim()||null,c=s?s.toLowerCase().includes(`signing in again`)?`re-auth required`:it(s,52):null,l=`[${t}] token refresh ${n}${o?` ${o}`:``}${c?` · ${c}`:``}`;a(`token:${t}:${n}:${o??``}:${c??``}`,l);continue}}let i=t.match(/^Embedded agent failed before reply:\s+OAuth token refresh failed for ([^:]+):/);if(i){let e=i[1]?.trim()||`unknown`;a(`embedded:${e}`,`Embedded agent: OAuth token refresh failed (${e})`);continue}if(t.startsWith(`[gws]`)&&t.includes(`errorCode=UNAVAILABLE`)&&t.includes(`OAuth token refresh failed`)){let e=at(t);a(`gws:${e}`,e);continue}o(t)}for(let e of i.values())e.count<=1||(r[e.index]=`${e.base} ×${e.count}`);let c=[];for(let e of r)c[c.length-1]!==e&&c.push(e);if(c.length<=n)return c;let l=Math.min(6,Math.floor(n/3)),u=Math.max(1,n-l-1);return[...c.slice(0,l),`… ${c.length-l-u} lines omitted …`,...c.slice(-u)]}function ct(e){let t=new Map;for(let n of e){let e=n.channel,r=t.get(e);r?r.push(n):t.set(e,[n])}return t}async function lt(e){let{lines:t,muted:n,ok:r,warn:i,fail:a}=e,o=(e,n)=>{let o=n===`ok`?r(`✓`):n===`warn`?i(`!`):a(`✗`),s=n===`ok`?r(e):n===`warn`?i(e):a(e);t.push(`${o} ${s}`)};t.push(``),t.push(n(`Gateway connection details:`));for(let r of Y(e.connectionDetailsForReport).split(`
4
4
  `).map(e=>e.trimEnd()))t.push(` ${n(r)}`);if(t.push(``),e.snap){let r=e.snap.exists?e.snap.valid?`ok`:`warn`:`fail`;o(`Config: ${e.snap.path??`(unknown)`}`,r);let i=[...e.snap.legacyIssues??[],...e.snap.issues??[]],a=i.filter((e,t)=>i.findIndex(t=>t.path===e.path&&t.message===e.message)===t);for(let e of a.slice(0,12))t.push(` ${ue(e,`-`)}`);a.length>12&&t.push(` ${n(`… +${a.length-12} more`)}`)}else o(`Config: read failed`,`warn`);e.remoteUrlMissing&&(t.push(``),o(`Gateway remote mode misconfigured (gateway.remote.url missing)`,`warn`),t.push(` ${n(`Fix: set gateway.remote.url, or set gateway.mode=local.`)}`)),e.sentinel?.payload?(o(`Restart sentinel present`,`warn`),t.push(` ${n(`${b(e.sentinel.payload)} · ${W(Date.now()-e.sentinel.payload.ts)}`)}`)):o(`Restart sentinel: none`,`ok`);let s=e.lastErr?.trim()??``,c=s.length<8||s===`}`||s===`{`;if(s&&!c&&(t.push(``),t.push(n(`Gateway last log line:`)),t.push(` ${n(Y(s))}`)),e.portUsage){let r=e.portUsage.listeners.length===0;if(o(`Port ${e.port}`,r?`ok`:`warn`),!r)for(let r of p(e.portUsage))t.push(` ${n(r)}`)}{let r=e.tailscale.backendState??`unknown`,i=r===`Running`,a=!!e.tailscale.dnsName;o(e.tailscaleMode===`off`?`Tailscale: off · ${r}${e.tailscale.dnsName?` · ${e.tailscale.dnsName}`:``}`:`Tailscale: ${e.tailscaleMode} · ${r}${e.tailscale.dnsName?` · ${e.tailscale.dnsName}`:``}`,i&&(e.tailscaleMode===`off`||a)?`ok`:`warn`),e.tailscale.error&&t.push(` ${n(`error: ${e.tailscale.error}`)}`),e.tailscale.ips.length>0&&t.push(` ${n(`ips: ${e.tailscale.ips.slice(0,3).join(`, `)}${e.tailscale.ips.length>3?`…`:``}`)}`),e.tailscaleHttpsUrl&&t.push(` ${n(`https: ${e.tailscaleHttpsUrl}`)}`)}if(e.skillStatus){let t=e.skillStatus.skills.filter(e=>e.eligible).length,n=e.skillStatus.skills.filter(e=>e.eligible&&Object.values(e.missing).some(e=>e.length)).length;o(`Skills: ${t} eligible · ${n} missing · ${e.skillStatus.workspaceDir}`,n===0?`ok`:`warn`)}e.progress.setLabel(`Reading logs…`);let l=(()=>{try{return fe(process.env)}catch{return null}})();if(l){e.progress.setLabel(`Reading logs…`);let[r,i]=await Promise.all([nt(l.stderrPath,40).catch(()=>[]),nt(l.stdoutPath,40).catch(()=>[])]);if(r.length>0||i.length>0){t.push(``),t.push(n(`Gateway logs (tail, summarized): ${l.logDir}`)),t.push(` ${n(`# stderr: ${l.stderrPath}`)}`);for(let e of st(r,{maxLines:22}).map(Y))t.push(` ${n(e)}`);t.push(` ${n(`# stdout: ${l.stdoutPath}`)}`);for(let e of st(i,{maxLines:22}).map(Y))t.push(` ${n(e)}`)}}if(e.progress.tick(),e.channelsStatus){o(`Channel issues (${e.channelIssues.length||`none`})`,e.channelIssues.length===0?`ok`:`warn`);for(let n of e.channelIssues.slice(0,12)){let e=n.fix?` · fix: ${n.fix}`:``;t.push(` - ${n.channel}[${n.accountId}] ${n.kind}: ${n.message}${e}`)}e.channelIssues.length>12&&t.push(` ${n(`… +${e.channelIssues.length-12} more`)}`)}else o(`Channel issues skipped (gateway ${e.gatewayReachable?`query failed`:`unreachable`})`,`warn`);let u=(()=>{if(!e.health||typeof e.health!=`object`)return``;let t=e.health;if(!(`error`in t))return``;let n=t.error;if(!n)return``;if(typeof n==`string`)return n;try{return JSON.stringify(n,null,2)}catch{return`[unserializable error]`}})();u&&(t.push(``),t.push(n(`Gateway health:`)),t.push(` ${n(Y(u))}`)),t.push(``),t.push(n(`Pasteable debug report. Auth tokens redacted.`)),t.push(`Troubleshooting: https://docs.openclaw.ai/troubleshooting`),t.push(``)}async function ut(e){let r=n(),i=e=>r?t.heading(e):e,a=e=>r?t.success(e):e,o=e=>r?t.warn(e):e,s=e=>r?t.error(e):e,c=e=>r?t.muted(e):e,l=_e(),u=J({width:l,columns:[{key:`Item`,header:`Item`,minWidth:10},{key:`Value`,header:`Value`,flex:!0,minWidth:24}],rows:e.overviewRows}),d=e.channels.rows.map(e=>({channelId:e.id,Channel:e.label,Enabled:e.enabled?a(`ON`):c(`OFF`),State:e.state===`ok`?a(`OK`):e.state===`warn`?o(`WARN`):e.state===`off`?c(`OFF`):t.accentDim(`SETUP`),Detail:e.detail})),f=ct(e.channelIssues),p=J({width:l,columns:[{key:`Channel`,header:`Channel`,minWidth:10},{key:`Enabled`,header:`Enabled`,minWidth:7},{key:`State`,header:`State`,minWidth:8},{key:`Detail`,header:`Detail`,flex:!0,minWidth:28}],rows:d.map(e=>{let t=f.get(e.channelId)??[];if(t.length===0)return e;let n=t[0],r=` · ${o(`gateway: ${String(n.message).slice(0,90)}`)}`;return{...e,State:o(`WARN`),Detail:`${e.Detail}${r}`}})}),m=J({width:l,columns:[{key:`Agent`,header:`Agent`,minWidth:12},{key:`BootstrapFile`,header:`Bootstrap file`,minWidth:14},{key:`Sessions`,header:`Sessions`,align:`right`,minWidth:8},{key:`Active`,header:`Active`,minWidth:10},{key:`Store`,header:`Store`,flex:!0,minWidth:34}],rows:e.agentStatus.agents.map(e=>({Agent:e.name?.trim()?`${e.id} (${e.name.trim()})`:e.id,BootstrapFile:e.bootstrapPending===!0?o(`PRESENT`):e.bootstrapPending===!1?a(`ABSENT`):`unknown`,Sessions:String(e.sessionsCount),Active:e.lastActiveAgeMs==null?`unknown`:W(e.lastActiveAgeMs),Store:e.sessionsPath}))}),h=[];h.push(i(`OpenClaw status --all`)),h.push(``),h.push(i(`Overview`)),h.push(u.trimEnd()),h.push(``),h.push(i(`Channels`)),h.push(p.trimEnd());for(let t of e.channels.details)h.push(``),h.push(i(t.title)),h.push(J({width:l,columns:t.columns.map(e=>({key:e,header:e,flex:e===`Notes`,minWidth:e===`Notes`?28:10})),rows:t.rows.map(e=>({...e,...e.Status===`OK`?{Status:a(`OK`)}:e.Status===`WARN`?{Status:o(`WARN`)}:{}}))}).trimEnd());return h.push(``),h.push(i(`Agents`)),h.push(m.trimEnd()),h.push(``),h.push(i(`Diagnosis (read-only)`)),await lt({lines:h,progress:e.progress,muted:c,ok:a,warn:o,fail:s,connectionDetailsForReport:e.connectionDetailsForReport,...e.diagnosis}),h}async function dt(e,t){try{let[t,n,r]=await Promise.all([e.isLoaded({env:process.env}).catch(()=>!1),e.readRuntime(process.env).catch(()=>void 0),e.readCommand(process.env).catch(()=>null)]),i=r!=null,a=!i&&n?.status===`running`,o=i||a,s=a?`running (externally managed)`:t?e.loadedText:e.notLoadedText;return{label:e.label,installed:o,loaded:t,managedByOpenClaw:i,externallyManaged:a,loadedText:s,runtime:n}}catch{return{label:t,installed:null,loaded:!1,managedByOpenClaw:!1,externallyManaged:!1,loadedText:`unknown`,runtime:void 0}}}async function ft(t,n){await K({label:`Scanning status --all…`,total:11},async r=>{r.setLabel(`Loading config…`);let i=await d(),{resolvedConfig:o}=await ae({config:i,commandName:`status --all`,targetIds:G(),mode:`summary`}),s=We(),l=await f().catch(()=>null);r.tick(),r.setLabel(`Checking Tailscale…`);let u=o.gateway?.tailscale?.mode??`off`,p=await(async()=>{try{let e=await a(te,{timeoutMs:1200}),t=typeof e.BackendState==`string`?e.BackendState:null,n=typeof e.Self==`object`&&e.Self!==null?e.Self:null,r=n&&typeof n.DNSName==`string`?n.DNSName:null;return{ok:!0,backendState:t,dnsName:r?r.replace(/\.$/,``):null,ips:n&&Array.isArray(n.TailscaleIPs)?n.TailscaleIPs.filter(e=>typeof e==`string`&&e.trim().length>0).map(e=>e.trim()):[],error:null}}catch(e){return{ok:!1,backendState:null,dnsName:null,ips:[],error:String(e)}}})(),m=u!==`off`&&p.dnsName?`https://${p.dnsName}${oe(o.gateway?.controlUi?.basePath)}`:null;r.tick(),r.setLabel(`Checking for updates…`);let h=await Ce({root:await I({moduleUrl:import.meta.url,argv1:process.argv[1],cwd:process.cwd()}),timeoutMs:6500,fetchGit:!0,includeRegistry:!0}),g=xe({configChannel:Se(o.update?.channel),installKind:h.installKind,gitTag:h.git?.tag??null,gitBranch:h.git?.branch??null}).label,_=be(h);r.tick(),r.setLabel(`Probing gateway…`);let v=ne({config:o}),b=o.gateway?.mode===`remote`,x=typeof o.gateway?.remote?.url==`string`?o.gateway.remote.url.trim():``,S=b&&!x,C=b?`remote`:`local`,w=q({cfg:o,mode:`local`}),T=q({cfg:o,mode:`remote`}),E=b&&!S?T:w,D=E.auth,O=await he({url:v.url,auth:D,timeoutMs:Math.min(5e3,n?.timeoutMs??1e4)}).catch(()=>null),k=O?.ok===!0,A=Re(O?.presence??null);r.tick(),r.setLabel(`Checking services…`);let j=async e=>{try{let t=await dt(e,e.label);return{label:t.label,installed:t.installed,managedByOpenClaw:t.managedByOpenClaw,loaded:t.loaded,loadedText:t.loadedText,runtime:t.runtime}}catch{return null}},M=await j(pe()),P=await j(Ee());r.tick(),r.setLabel(`Scanning agents…`);let F=await Ke(o);r.tick(),r.setLabel(`Summarizing channels…`);let R=await tt(o,{showSecrets:!1,sourceConfig:i});r.tick();let ee=(()=>{if(!S)return v.message;let e=o.gateway?.bind??`loopback`;return[`Gateway mode: remote`,`Gateway target: (missing gateway.remote.url)`,`Config: ${l?.path?.trim()?l.path.trim():`(unknown config path)`}`,`Bind: ${e}`,`Local fallback (used for probes): ${v.url}`,`Fix: set gateway.remote.url, or set gateway.mode=local.`].join(`
@@ -1 +1 @@
1
- import"./paths-CAzfAyaR.js";import"./paths-BpQOWYiT.js";import"./logger-D0y9iaZX.js";import"./model-selection-fVxVucLI.js";import{B as e,G as t,H as n,R as r,U as i,V as a,W as o,z as s}from"./pi-embedded-fKs8vr_l.js";import"./github-copilot-token-wm6mbypz.js";import"./proxy-env-CRDRLawi.js";import"./send--kmUv50W.js";import"./send-BJfr4Enl.js";import"./tokens-CqsthGyS.js";import"./deliver-CvBTa9OP.js";import"./diagnostic-DUhynW8p.js";import"./send-gpAn9pnk.js";import"./pi-model-discovery-Dz_Fa0ay.js";import"./image-C5Ue2O-K.js";import"./audio-transcription-runner-DGxzZ2_V.js";import"./fetch-KSn9iMNK.js";import"./fetch-guard-BxGdHuPZ.js";import"./api-key-rotation-sozWdoIY.js";import"./proxy-fetch-BqU71w0r.js";import"./ir-B11ecKHp.js";import"./render-BXEUPIHe.js";import"./target-errors-DhqzKpof.js";import"./commands-registry-nuBs6Gvq.js";import"./fetch-DHo17YmK.js";import"./skill-commands-Bu6vcx7c.js";import"./channel-activity-DptjsvT5.js";import"./tables-CYq1BOKz.js";import"./send-PNypeYEX.js";import"./outbound-attachment-GzRAYH3M.js";import"./send-DcnUL5AM2.js";import"./fetch-Dk2vEN5b.js";import"./query-expansion--XG0a9wS.js";import"./manager-C3HmyJWw.js";export{r as countActiveDescendantRuns,s as countPendingDescendantRuns,e as countPendingDescendantRunsExcludingRun,a as isSubagentSessionRunActive,n as listSubagentRunsForRequester,i as replaceSubagentRunAfterSteer,o as resolveRequesterForChildSession,t as shouldIgnorePostCompletionAnnounceForSession};
1
+ import"./paths-CAzfAyaR.js";import"./paths-BpQOWYiT.js";import"./logger-D0y9iaZX.js";import"./model-selection-fVxVucLI.js";import{B as e,G as t,H as n,R as r,U as i,V as a,W as o,z as s}from"./pi-embedded-Bv3QACci.js";import"./github-copilot-token-wm6mbypz.js";import"./proxy-env-CRDRLawi.js";import"./send--kmUv50W.js";import"./send-BJfr4Enl.js";import"./tokens-CqsthGyS.js";import"./deliver-CvBTa9OP.js";import"./diagnostic-DUhynW8p.js";import"./send-gpAn9pnk.js";import"./pi-model-discovery-Dz_Fa0ay.js";import"./image-C5Ue2O-K.js";import"./audio-transcription-runner-DGxzZ2_V.js";import"./fetch-KSn9iMNK.js";import"./fetch-guard-BxGdHuPZ.js";import"./api-key-rotation-sozWdoIY.js";import"./proxy-fetch-BqU71w0r.js";import"./ir-B11ecKHp.js";import"./render-BXEUPIHe.js";import"./target-errors-DhqzKpof.js";import"./commands-registry-nuBs6Gvq.js";import"./fetch-DHo17YmK.js";import"./skill-commands-Bu6vcx7c.js";import"./channel-activity-DptjsvT5.js";import"./tables-CYq1BOKz.js";import"./send-PNypeYEX.js";import"./outbound-attachment-GzRAYH3M.js";import"./send-DcnUL5AM2.js";import"./fetch-Dk2vEN5b.js";import"./query-expansion--XG0a9wS.js";import"./manager-C3HmyJWw.js";export{r as countActiveDescendantRuns,s as countPendingDescendantRuns,e as countPendingDescendantRunsExcludingRun,a as isSubagentSessionRunActive,n as listSubagentRunsForRequester,i as replaceSubagentRunAfterSteer,o as resolveRequesterForChildSession,t as shouldIgnorePostCompletionAnnounceForSession};
@@ -1 +1 @@
1
- import"./paths-DBmKCtUs.js";import"./paths-CChBdtE8.js";import"./subsystem-hyY_8Y33.js";import"./workspace-Dc-i8PF7.js";import"./utils-HgCTSfjA.js";import"./model-selection-z_2ofBma.js";import"./github-copilot-token-DePP-lIf.js";import"./boolean-DypnRoRK.js";import"./proxy-env-BWBLvN-u.js";import"./frontmatter-DWwQ2Ef1.js";import"./logger-Cb-sKDne.js";import"./send-DQ8hW1Ny.js";import"./send-CgCkmVGv.js";import{B as e,G as t,H as n,R as r,U as i,V as a,W as o,z as s}from"./pi-embedded-CSE8iTcT.js";import"./tokens-BYXU3z3M.js";import"./deliver-BZcbGQOY.js";import"./diagnostic-IQ5DYtkj.js";import"./send-D7eYYLEG.js";import"./pi-model-discovery-DnHY5jfR.js";import"./image-CZ-GwwjN.js";import"./audio-transcription-runner-BaxTmW9G.js";import"./fetch-oSjgZCED.js";import"./fetch-guard-CgvEMjHW.js";import"./api-key-rotation-BUGNohXO.js";import"./proxy-fetch-BJmmcDWW.js";import"./ir-BxkORpyH.js";import"./render-CBsnn-2A.js";import"./target-errors-TsrjEir0.js";import"./commands-registry-l38RhNf-.js";import"./fetch-_g8lZ8K8.js";import"./skill-commands-B9T6G5xv.js";import"./channel-activity-C742K4vi.js";import"./tables-176-pfPQ.js";import"./send-vk3KPAQd2.js";import"./outbound-attachment-C3faxPvJ.js";import"./send-DYm8HM55.js";import"./fetch-BBL4TFBl.js";import"./query-expansion-CC3GwLhd.js";import"./manager-n06Q0VsW.js";export{r as countActiveDescendantRuns,s as countPendingDescendantRuns,e as countPendingDescendantRunsExcludingRun,a as isSubagentSessionRunActive,n as listSubagentRunsForRequester,i as replaceSubagentRunAfterSteer,o as resolveRequesterForChildSession,t as shouldIgnorePostCompletionAnnounceForSession};
1
+ import"./paths-DBmKCtUs.js";import"./paths-CChBdtE8.js";import"./subsystem-hyY_8Y33.js";import"./workspace-Dc-i8PF7.js";import"./utils-HgCTSfjA.js";import"./model-selection-z_2ofBma.js";import"./github-copilot-token-DePP-lIf.js";import"./boolean-DypnRoRK.js";import"./proxy-env-BWBLvN-u.js";import"./frontmatter-DWwQ2Ef1.js";import"./logger-Cb-sKDne.js";import"./send-DQ8hW1Ny.js";import"./send-CgCkmVGv.js";import{B as e,G as t,H as n,R as r,U as i,V as a,W as o,z as s}from"./pi-embedded-DJGgW90C.js";import"./tokens-BYXU3z3M.js";import"./deliver-BZcbGQOY.js";import"./diagnostic-IQ5DYtkj.js";import"./send-D7eYYLEG.js";import"./pi-model-discovery-DnHY5jfR.js";import"./image-CZ-GwwjN.js";import"./audio-transcription-runner-BaxTmW9G.js";import"./fetch-oSjgZCED.js";import"./fetch-guard-CgvEMjHW.js";import"./api-key-rotation-BUGNohXO.js";import"./proxy-fetch-BJmmcDWW.js";import"./ir-BxkORpyH.js";import"./render-CBsnn-2A.js";import"./target-errors-TsrjEir0.js";import"./commands-registry-l38RhNf-.js";import"./fetch-_g8lZ8K8.js";import"./skill-commands-B9T6G5xv.js";import"./channel-activity-C742K4vi.js";import"./tables-176-pfPQ.js";import"./send-vk3KPAQd2.js";import"./outbound-attachment-C3faxPvJ.js";import"./send-DYm8HM55.js";import"./fetch-BBL4TFBl.js";import"./query-expansion-CC3GwLhd.js";import"./manager-n06Q0VsW.js";export{r as countActiveDescendantRuns,s as countPendingDescendantRuns,e as countPendingDescendantRunsExcludingRun,a as isSubagentSessionRunActive,n as listSubagentRunsForRequester,i as replaceSubagentRunAfterSteer,o as resolveRequesterForChildSession,t as shouldIgnorePostCompletionAnnounceForSession};
@@ -1 +1 @@
1
- import"./paths-B4IRk3wi.js";import"./subsystem-BQ1073Mu.js";import"./utils-D1PlBTFH.js";import"./model-selection-B2r_LMFb.js";import{ar as e,dr as t,fr as n,lr as r,mr as i,or as a,pr as o,sr as s}from"./reply-DHtpIWpD.js";import"./agent-scope-DW6ZDCxj.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import"./boolean-Ch3DfXPy.js";import"./env-BI_g1HfG.js";import"./env-overrides-C0vMeCeX.js";import"./registry-BwcVQtsI.js";import"./skills-CZ7zEDmo.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-1aNlpDX7.js";import"./logger-Bgqzq_Zu.js";import"./exec-BdtFni8N.js";import"./windows-spawn-B36IG4s2.js";import"./redact-DsC5EnL7.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-y2V0aFIS.js";import"./send-DyCUb7oW.js";import"./send-C6J_nLb9.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-DsYKaMCI.js";import"./image-6t162ig6.js";import"./models-config-PU32mWpc.js";import"./tool-display-DBTvIf_I.js";import"./fetch-guard-11xgsj9-.js";import"./api-key-rotation-CayDxQxo.js";import"./local-roots-ClGHF49W.js";import"./model-catalog-CXx8LKWX.js";import"./proxy-fetch-Ci8QXzzm.js";import"./tokens-xmkeRJqo.js";import"./deliver-Dg2TVF1M.js";import"./commands-FDnZnqN5.js";import"./commands-registry-BEMFeaZR.js";import"./pairing-store-mQs2yMkt.js";import"./fetch-Dikjvc5M.js";import"./call-BQAAYLj3.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-kojLym9G.js";import"./send-aEwJo2mZ2.js";import"./pi-model-discovery-DMZplc-U.js";import"./exec-approvals-allowlist-Bh3Rw-aC.js";import"./exec-safe-bin-runtime-policy-BxN1_8e_.js";import"./ir-DcrzIcfF.js";import"./render-D8OWO2hT.js";import"./target-errors-B1wrjiTA.js";import"./read-only-account-inspect-DLD1Pk6l.js";import"./channel-selection-BuH6syM3.js";import"./plugin-auto-enable-DzUZAwai.js";import"./send-HOAYSr2i.js";import"./outbound-attachment-lrGTAaR-.js";import"./delivery-queue-CKbauSFq.js";import"./send-w-vabJ4U.js";import"./channel-activity-CBKv0fto.js";import"./tables-DwrGp-F-.js";import"./fetch-D4txy8qG.js";import"./skill-commands-BN3rmzgq.js";import"./workspace-dirs-BMGwwM6X.js";import"./pairing-token-BipkTRNW.js";import"./restart-Dal_HOce.js";import"./runtime-web-tools-BiMD0yHU.js";import"./command-secret-targets-CbrSGcvV.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-BCxq0f5b.js";import"./onboard-helpers-CKsetIvC.js";import"./prompt-style-DpAh867d.js";import"./pairing-labels-iZoSa-aT.js";import"./memory-cli-P0GDvKlz.js";import"./query-expansion-BNl6JMlz.js";import"./manager-DKyEk2dt.js";import"./links-jlebCPFf.js";import"./cli-utils-BY7dLMFy.js";import"./help-format-Cav62lfS.js";import"./progress-Cyn5U745.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-B1Y6pbxs.js";import"./system-run-command-B212q8f9.js";import"./runtime-Dz2qgcJk.js";import"./stagger-DmFYysrJ.js";export{e as countActiveDescendantRuns,a as countPendingDescendantRuns,s as countPendingDescendantRunsExcludingRun,r as isSubagentSessionRunActive,t as listSubagentRunsForRequester,n as replaceSubagentRunAfterSteer,o as resolveRequesterForChildSession,i as shouldIgnorePostCompletionAnnounceForSession};
1
+ import"./paths-B4IRk3wi.js";import"./subsystem-BQ1073Mu.js";import"./utils-D1PlBTFH.js";import"./model-selection-B2r_LMFb.js";import{ar as e,dr as t,fr as n,lr as r,mr as i,or as a,pr as o,sr as s}from"./reply-HrabJs88.js";import"./agent-scope-DW6ZDCxj.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import"./boolean-Ch3DfXPy.js";import"./env-BI_g1HfG.js";import"./env-overrides-C0vMeCeX.js";import"./registry-BwcVQtsI.js";import"./skills-CZ7zEDmo.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-1aNlpDX7.js";import"./logger-Bgqzq_Zu.js";import"./exec-BdtFni8N.js";import"./windows-spawn-B36IG4s2.js";import"./redact-DsC5EnL7.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-y2V0aFIS.js";import"./send-DyCUb7oW.js";import"./send-C6J_nLb9.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-DsYKaMCI.js";import"./image-6t162ig6.js";import"./models-config-PU32mWpc.js";import"./tool-display-DBTvIf_I.js";import"./fetch-guard-11xgsj9-.js";import"./api-key-rotation-CayDxQxo.js";import"./local-roots-ClGHF49W.js";import"./model-catalog-CXx8LKWX.js";import"./proxy-fetch-Ci8QXzzm.js";import"./tokens-xmkeRJqo.js";import"./deliver-Dg2TVF1M.js";import"./commands-FDnZnqN5.js";import"./commands-registry-BEMFeaZR.js";import"./pairing-store-mQs2yMkt.js";import"./fetch-Dikjvc5M.js";import"./call-BQAAYLj3.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-kojLym9G.js";import"./send-aEwJo2mZ2.js";import"./pi-model-discovery-DMZplc-U.js";import"./exec-approvals-allowlist-Bh3Rw-aC.js";import"./exec-safe-bin-runtime-policy-BxN1_8e_.js";import"./ir-DcrzIcfF.js";import"./render-D8OWO2hT.js";import"./target-errors-B1wrjiTA.js";import"./read-only-account-inspect-DLD1Pk6l.js";import"./channel-selection-BuH6syM3.js";import"./plugin-auto-enable-DzUZAwai.js";import"./send-HOAYSr2i.js";import"./outbound-attachment-lrGTAaR-.js";import"./delivery-queue-CKbauSFq.js";import"./send-w-vabJ4U.js";import"./channel-activity-CBKv0fto.js";import"./tables-DwrGp-F-.js";import"./fetch-D4txy8qG.js";import"./skill-commands-BN3rmzgq.js";import"./workspace-dirs-BMGwwM6X.js";import"./pairing-token-BipkTRNW.js";import"./restart-Dal_HOce.js";import"./runtime-web-tools-BiMD0yHU.js";import"./command-secret-targets-CbrSGcvV.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-BCxq0f5b.js";import"./onboard-helpers-CKsetIvC.js";import"./prompt-style-DpAh867d.js";import"./pairing-labels-iZoSa-aT.js";import"./memory-cli-P0GDvKlz.js";import"./query-expansion-BNl6JMlz.js";import"./manager-DKyEk2dt.js";import"./links-jlebCPFf.js";import"./cli-utils-BY7dLMFy.js";import"./help-format-Cav62lfS.js";import"./progress-Cyn5U745.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-B1Y6pbxs.js";import"./system-run-command-B212q8f9.js";import"./runtime-Dz2qgcJk.js";import"./stagger-DmFYysrJ.js";export{e as countActiveDescendantRuns,a as countPendingDescendantRuns,s as countPendingDescendantRunsExcludingRun,r as isSubagentSessionRunActive,t as listSubagentRunsForRequester,n as replaceSubagentRunAfterSteer,o as resolveRequesterForChildSession,i as shouldIgnorePostCompletionAnnounceForSession};
@@ -1 +1 @@
1
- import"./subsystem-kTFXkQM5.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import"./auth-profiles-e3SmOvON.js";import"./agent-scope-BKE4M04k.js";import"./utils-7Gdj77QB.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-R4odAlsj.js";import"./version-q3SkUw2K.js";import"./registry-Div2nEwi.js";import"./skills-Df0CxTMH.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-CCU8jDti.js";import"./logger-C1GUBMt-.js";import"./exec-CiwCrGw3.js";import"./windows-spawn-Dw4dpTt2.js";import"./redact-bVcVj47r.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-DNQO70y-.js";import"./send-Cfa08ZLE.js";import"./send-DmS34-Eb.js";import{$n as e,Gn as t,Kn as n,Qn as r,Yn as i,Zn as a,er as o,qn as s}from"./compact-DutiJiBy.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-D5CbqIVA.js";import"./tokens-D8eWI71q.js";import"./with-timeout-c1CzdShT.js";import"./deliver-HZ99jQzl.js";import"./diagnostic-CvLTqJbq.js";import"./send-CW3hfjkM.js";import"./pi-model-discovery-cW9be_SG.js";import"./exec-approvals-allowlist-DlYH42As.js";import"./exec-safe-bin-runtime-policy-Bu9bb9U5.js";import"./model-catalog-CI2eEH9Y.js";import"./fetch-Dj-FEHSr.js";import"./audio-transcription-runner-BwviCgP5.js";import"./fetch-guard-guH8Tmju.js";import"./image-DQ_3LMNb.js";import"./tool-display-BTuQQN92.js";import"./api-key-rotation-BRm3CNd-.js";import"./proxy-fetch-ByazCl5E.js";import"./ir-CsTyrPwa.js";import"./render-DrrPmnMI.js";import"./target-errors-BRLBPboT.js";import"./commands-DOhEGWJ2.js";import"./commands-registry-CqsggloB.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-Bh1ozdi-.js";import"./sqlite-DgdOh9U-.js";import"./call-D5NJXFgu.js";import"./pi-tools.policy-CklWbQkk.js";import"./pairing-store-CmT1fSmE.js";import"./fetch-Dh-apy46.js";import"./skill-commands-qdKWuiOR.js";import"./workspace-dirs-na4G79jL.js";import"./pairing-token-YrKlxjGC.js";import"./channel-activity-CFgOyIkh.js";import"./tables-5gR6U_tC.js";import"./kill-tree-DihujQie.js";import"./runtime-web-tools-BjmhIJkd.js";import"./runtime-HwYsJOk2.js";import"./node-shell-BuPDYFhk.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-C1kkZyEb.js";import"./plugin-auto-enable-CrVJR--r.js";import"./send-DQxQrVuw.js";import"./outbound-attachment-BKku_WUf.js";import"./delivery-queue-nkPJu0fY.js";import"./send-DVv1dCwu.js";import"./system-run-command-BT2tTJg2.js";import"./fetch-EBjfhrYU.js";import"./command-secret-targets-BtkZwOzh.js";import"./connection-auth-BIApbu6I.js";import"./onboard-helpers-CvWjz0op.js";import"./prompt-style-QJckocuy.js";import"./pairing-labels-B3wRXljf.js";import"./search-manager-Co5RwgQ4.js";import"./manager-p3CCKFcv.js";import"./memory-cli-CTXmLb0V.js";import"./links-pHmQCzdF.js";import"./cli-utils-BleB1eys.js";import"./help-format-BSNXPQuE.js";import"./progress-Cy6zNuIC.js";import"./exec-approvals-BXO9Cezj.js";export{t as countActiveDescendantRuns,n as countPendingDescendantRuns,s as countPendingDescendantRunsExcludingRun,i as isSubagentSessionRunActive,a as listSubagentRunsForRequester,r as replaceSubagentRunAfterSteer,e as resolveRequesterForChildSession,o as shouldIgnorePostCompletionAnnounceForSession};
1
+ import"./subsystem-kTFXkQM5.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import"./auth-profiles-e3SmOvON.js";import"./agent-scope-BKE4M04k.js";import"./utils-7Gdj77QB.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-R4odAlsj.js";import"./version-q3SkUw2K.js";import"./registry-Div2nEwi.js";import"./skills-Df0CxTMH.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-CCU8jDti.js";import"./logger-C1GUBMt-.js";import"./exec-CiwCrGw3.js";import"./windows-spawn-Dw4dpTt2.js";import"./redact-bVcVj47r.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-DNQO70y-.js";import"./send-Cfa08ZLE.js";import"./send-DmS34-Eb.js";import{$n as e,Gn as t,Kn as n,Qn as r,Yn as i,Zn as a,er as o,qn as s}from"./compact-B5m4267P.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-D5CbqIVA.js";import"./tokens-D8eWI71q.js";import"./with-timeout-c1CzdShT.js";import"./deliver-HZ99jQzl.js";import"./diagnostic-CvLTqJbq.js";import"./send-CW3hfjkM.js";import"./pi-model-discovery-cW9be_SG.js";import"./exec-approvals-allowlist-DlYH42As.js";import"./exec-safe-bin-runtime-policy-Bu9bb9U5.js";import"./model-catalog-CI2eEH9Y.js";import"./fetch-Dj-FEHSr.js";import"./audio-transcription-runner-BwviCgP5.js";import"./fetch-guard-guH8Tmju.js";import"./image-DQ_3LMNb.js";import"./tool-display-BTuQQN92.js";import"./api-key-rotation-BRm3CNd-.js";import"./proxy-fetch-ByazCl5E.js";import"./ir-CsTyrPwa.js";import"./render-DrrPmnMI.js";import"./target-errors-BRLBPboT.js";import"./commands-DOhEGWJ2.js";import"./commands-registry-CqsggloB.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-Bh1ozdi-.js";import"./sqlite-DgdOh9U-.js";import"./call-D5NJXFgu.js";import"./pi-tools.policy-CklWbQkk.js";import"./pairing-store-CmT1fSmE.js";import"./fetch-Dh-apy46.js";import"./skill-commands-qdKWuiOR.js";import"./workspace-dirs-na4G79jL.js";import"./pairing-token-YrKlxjGC.js";import"./channel-activity-CFgOyIkh.js";import"./tables-5gR6U_tC.js";import"./kill-tree-DihujQie.js";import"./runtime-web-tools-BjmhIJkd.js";import"./runtime-HwYsJOk2.js";import"./node-shell-BuPDYFhk.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-C1kkZyEb.js";import"./plugin-auto-enable-CrVJR--r.js";import"./send-DQxQrVuw.js";import"./outbound-attachment-BKku_WUf.js";import"./delivery-queue-nkPJu0fY.js";import"./send-DVv1dCwu.js";import"./system-run-command-BT2tTJg2.js";import"./fetch-EBjfhrYU.js";import"./command-secret-targets-BtkZwOzh.js";import"./connection-auth-BIApbu6I.js";import"./onboard-helpers-CvWjz0op.js";import"./prompt-style-QJckocuy.js";import"./pairing-labels-B3wRXljf.js";import"./search-manager-Co5RwgQ4.js";import"./manager-p3CCKFcv.js";import"./memory-cli-CTXmLb0V.js";import"./links-pHmQCzdF.js";import"./cli-utils-BleB1eys.js";import"./help-format-BSNXPQuE.js";import"./progress-Cy6zNuIC.js";import"./exec-approvals-BXO9Cezj.js";export{t as countActiveDescendantRuns,n as countPendingDescendantRuns,s as countPendingDescendantRunsExcludingRun,i as isSubagentSessionRunActive,a as listSubagentRunsForRequester,r as replaceSubagentRunAfterSteer,e as resolveRequesterForChildSession,o as shouldIgnorePostCompletionAnnounceForSession};
@@ -1,4 +1,4 @@
1
- import{A as e,p as t}from"./subsystem-kTFXkQM5.js";import{g as n,n as r,u as i}from"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{Bo as a,Fo as o}from"./auth-profiles-e3SmOvON.js";import{n as s,r as c,t as l}from"./command-format-CLxIPuLR.js";import"./agent-scope-BKE4M04k.js";import{m as u}from"./utils-7Gdj77QB.js";import{t as d}from"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-R4odAlsj.js";import"./version-q3SkUw2K.js";import"./registry-Div2nEwi.js";import"./skills-Df0CxTMH.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-CCU8jDti.js";import"./logger-C1GUBMt-.js";import{t as f}from"./exec-CiwCrGw3.js";import"./windows-spawn-Dw4dpTt2.js";import"./redact-bVcVj47r.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-DNQO70y-.js";import"./send-Cfa08ZLE.js";import"./send-DmS34-Eb.js";import{Nt as p}from"./compact-DutiJiBy.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-D5CbqIVA.js";import"./tokens-D8eWI71q.js";import"./with-timeout-c1CzdShT.js";import"./deliver-HZ99jQzl.js";import"./diagnostic-CvLTqJbq.js";import"./send-CW3hfjkM.js";import"./pi-model-discovery-cW9be_SG.js";import"./exec-approvals-allowlist-DlYH42As.js";import"./exec-safe-bin-runtime-policy-Bu9bb9U5.js";import"./model-catalog-CI2eEH9Y.js";import"./fetch-Dj-FEHSr.js";import"./audio-transcription-runner-BwviCgP5.js";import"./fetch-guard-guH8Tmju.js";import"./image-DQ_3LMNb.js";import"./tool-display-BTuQQN92.js";import"./api-key-rotation-BRm3CNd-.js";import"./proxy-fetch-ByazCl5E.js";import"./ir-CsTyrPwa.js";import"./render-DrrPmnMI.js";import"./target-errors-BRLBPboT.js";import"./commands-DOhEGWJ2.js";import"./commands-registry-CqsggloB.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-Bh1ozdi-.js";import"./sqlite-DgdOh9U-.js";import"./call-D5NJXFgu.js";import"./pi-tools.policy-CklWbQkk.js";import"./pairing-store-CmT1fSmE.js";import"./fetch-Dh-apy46.js";import"./skill-commands-qdKWuiOR.js";import"./workspace-dirs-na4G79jL.js";import"./pairing-token-YrKlxjGC.js";import"./channel-activity-CFgOyIkh.js";import"./tables-5gR6U_tC.js";import{m,p as h,u as g}from"./arg-split-BOqSMBuf.js";import"./kill-tree-DihujQie.js";import{n as _}from"./cmd-argv-Bh-KpaZ0.js";import"./runtime-web-tools-BjmhIJkd.js";import"./runtime-HwYsJOk2.js";import"./node-shell-BuPDYFhk.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-C1kkZyEb.js";import"./plugin-auto-enable-CrVJR--r.js";import"./send-DQxQrVuw.js";import"./outbound-attachment-BKku_WUf.js";import"./delivery-queue-nkPJu0fY.js";import"./send-DVv1dCwu.js";import"./system-run-command-BT2tTJg2.js";import"./fetch-EBjfhrYU.js";import{r as v}from"./format-duration-C8AzNqKh.js";import"./command-secret-targets-BtkZwOzh.js";import"./connection-auth-BIApbu6I.js";import"./onboard-helpers-CvWjz0op.js";import{n as y}from"./prompt-style-QJckocuy.js";import"./pairing-labels-B3wRXljf.js";import"./search-manager-Co5RwgQ4.js";import"./manager-p3CCKFcv.js";import"./memory-cli-CTXmLb0V.js";import{t as b}from"./links-pHmQCzdF.js";import"./cli-utils-BleB1eys.js";import{t as x}from"./help-format-BSNXPQuE.js";import"./progress-Cy6zNuIC.js";import"./exec-approvals-BXO9Cezj.js";import"./skills-status-Bzj-kJgo.js";import{n as S}from"./command-options-BpOUDl2S.js";import"./note-Dzei_8z5.js";import"./install-safe-path-C2oVnQ4q.js";import"./npm-pack-install-C3zwwLzE.js";import"./skill-scanner-B8TBRXeT.js";import"./installs-8EuwGg1W.js";import{n as ee}from"./issue-format-DRHlQPnX.js";import"./channels-status-issues-RPxMYADM.js";import{r as C}from"./completion-cli-Btm1nzLM.js";import"./register.subclis-DHFqEK6G.js";import"./command-registry-kuOSuxH9.js";import"./program-context-CH9p6anW.js";import"./daemon-install-plan.shared-JQBIvXfN.js";import{r as w}from"./runtime-guard-BFK4A89C.js";import"./gateway-install-token-D5Aivh68.js";import"./systemd-2rjzkWWr.js";import{n as te}from"./service-CtJtO2Jl.js";import"./lifecycle-core-CNLarX-R.js";import"./systemd-hints-Cuo_K2we.js";import{a as T,i as E,l as D,o as O,r as k}from"./daemon-cli-D8BKkqsL.js";import"./probe-auth-DseDsvEH.js";import"./diagnostics-DnbLdEsy.js";import{n as A,t as j}from"./table-BiqW4yI5.js";import"./health-vy-C49Dw.js";import"./control-ui-assets-bS1XYZpI.js";import{d as M,g as N,h as P,i as ne,m as F,n as I,o as re,r as ie,u as ae}from"./channel-account-context-DuBGrKuL.js";import{a as L,c as R,i as oe,l as z,n as se,o as ce,r as le,s as ue,t as de}from"./update-runner-DcWJQ3bh.js";import{i as fe,n as pe,t as me}from"./status.update-CdMzKwdx.js";import"./logging-Ai_SKvpp.js";import"./oauth-tls-preflight-CN5Fg7I1.js";import{n as he,t as ge}from"./update-ClWK3wEI.js";import"./doctor-config-flow-DX6_ggPf.js";import"./systemd-linger-CFEQD-zV.js";import"./health-format-nLgxB9tv.js";import{n as _e,t as ve}from"./prompt-select-styled-BghrrnfB.js";import{r as B,t as ye}from"./doctor-completion-Bp4r91Mj.js";import{spawn as be,spawnSync as xe}from"node:child_process";import V from"node:os";import H from"node:path";import U from"node:fs/promises";import{confirm as W,isCancel as G,spinner as Se}from"@clack/prompts";function K(e){let n=e?Number.parseInt(e,10)*1e3:void 0;return n!==void 0&&(Number.isNaN(n)||n<=0)?(t.error(`--timeout must be a positive integer (seconds)`),t.exit(1),null):n}const q=`https://github.com/openclaw/openclaw.git`,Ce=8e3,we=`openclaw`,Te=new Set([we]);function Ee(e){return ue(e,[`openclaw`,we])}function De(e){let t=e.trim();if(!t)return null;let n=t.startsWith(`v`)?t.slice(1):t;return w(n)?n:null}async function Oe(e,t){return De(e)||((await ne({tag:e,timeoutMs:t})).version??null)}async function ke(e){try{return await U.stat(H.join(e,`.git`)),!0}catch{return!1}}async function Ae(e){let t=await R(e);return!!(t&&Te.has(t))}async function je(e){try{return(await U.readdir(e)).length===0}catch{return!1}}function Me(){let e=process.env.OPENCLAW_GIT_DIR?.trim();return e?H.resolve(e):Ne()}function Ne(){return n(process.env,V.homedir)}function J(){let e=H.basename(process.execPath).toLowerCase();return e===`node`||e===`node.exe`?process.execPath:`node`}async function Y(){return await d({moduleUrl:import.meta.url,argv1:process.argv[1],cwd:process.cwd()})??process.cwd()}async function X(e){let t=e.argv.join(` `);e.progress?.onStepStart?.({name:e.name,command:t,index:0,total:0});let n=Date.now(),r=await f(e.argv,{cwd:e.cwd,timeoutMs:e.timeoutMs}),i=Date.now()-n,a=p(r.stderr,Ce);return e.progress?.onStepComplete?.({name:e.name,command:t,index:0,total:0,durationMs:i,exitCode:r.code,stderrTail:a}),{name:e.name,command:t,cwd:e.cwd??process.cwd(),durationMs:i,exitCode:r.code,stdoutTail:p(r.stdout,Ce),stderrTail:a}}async function Pe(e){if(!await u(e.dir))return await X({name:`git clone`,argv:[`git`,`clone`,q,e.dir],timeoutMs:e.timeoutMs,progress:e.progress});if(!await ke(e.dir)){if(!await je(e.dir))throw Error(`OPENCLAW_GIT_DIR points at a non-git directory: ${e.dir}. Set OPENCLAW_GIT_DIR to an empty folder or an openclaw checkout.`);return await X({name:`git clone`,argv:[`git`,`clone`,q,e.dir],cwd:e.dir,timeoutMs:e.timeoutMs,progress:e.progress})}if(!await Ae(e.dir))throw Error(`OPENCLAW_GIT_DIR does not look like a core checkout: ${e.dir}.`);return null}async function Z(e){let t=Ie();if(e.installKind===`package`){let n=await oe(t,e.root,e.timeoutMs);if(n)return n}return await le(t,e.timeoutMs)??`npm`}async function Fe(n,r){let i=H.join(n,`openclaw.mjs`);if(!await u(i))return;let a=xe(J(),[i,`completion`,`--write-state`],{cwd:n,env:process.env,encoding:`utf-8`});if(a.error){r||t.log(e.warn(`Completion cache update failed: ${String(a.error)}`));return}if(a.status!==0&&!r){let n=(a.stderr??``).toString().trim(),r=n?` (${n})`:``;t.log(e.warn(`Completion cache update failed${r}.`))}}function Ie(){return async(e,t)=>{let n=await f(e,t);return{stdout:n.stdout,stderr:n.stderr,code:n.code}}}function Le(e){let t=e.sha?e.sha.slice(0,8):null,n=e.branch&&e.branch!==`HEAD`?e.branch:null,r=e.tag;return[n??(r?`detached`:`git`),r?`tag ${r}`:null,t?`@ ${t}`:null].filter(Boolean).join(` · `)}async function Re(n){let r=K(n.timeout);if(r===null)return;let i=await Y(),a=await o(),s=a.valid?F(a.config.update?.channel):null,c=await I({root:i,timeoutMs:r??3500,fetchGit:!0,includeRegistry:!0}),l=N({configChannel:s,installKind:c.installKind,gitTag:c.git?.tag??null,gitBranch:c.git?.branch??null}),u=l.label,d=c.installKind===`git`?Le({branch:c.git?.branch??null,tag:c.git?.tag??null,sha:c.git?.sha??null}):null,f=fe(c),p=pe(c).replace(/^Update:\s*/i,``);if(n.json){t.log(JSON.stringify({update:c,channel:{value:l.channel,source:l.source,label:u,config:s},availability:f},null,2));return}let m=j(),h=[{Item:`Install`,Value:c.installKind===`git`?`git (${c.root??`unknown`})`:c.installKind===`package`?c.packageManager:`unknown`},{Item:`Channel`,Value:u},...d?[{Item:`Git`,Value:d}]:[],{Item:`Update`,Value:f.available?e.warn(`available · ${p}`):p}];t.log(e.heading(`OpenClaw update status`)),t.log(``),t.log(A({width:m,columns:[{key:`Item`,header:`Item`,minWidth:10},{key:`Value`,header:`Value`,flex:!0,minWidth:24}],rows:h}).trimEnd()),t.log(``);let g=me(c);g&&t.log(e.warn(g))}const ze={"clean check":`Working directory is clean`,"upstream check":`Upstream branch exists`,"git fetch":`Fetching latest changes`,"git rebase":`Rebasing onto target commit`,"git rev-parse @{upstream}":`Resolving upstream commit`,"git rev-list":`Enumerating candidate commits`,"git clone":`Cloning git checkout`,"preflight worktree":`Preparing preflight worktree`,"preflight cleanup":`Cleaning preflight worktree`,"deps install":`Installing dependencies`,build:`Building`,"ui:build":`Building UI assets`,"ui:build (post-doctor repair)":`Restoring missing UI assets`,"ui assets verify":`Validating UI assets`,"openclaw doctor entry":`Checking doctor entrypoint`,"openclaw doctor":`Running doctor checks`,"git rev-parse HEAD (after)":`Verifying update`,"global update":`Updating via package manager`,"global update (omit optional)":`Retrying update without optional deps`,"global install":`Installing global package`};function Be(e){return ze[e.name]??e.name}function Ve(e){if(e.status!==`error`||e.mode!==`npm`)return[];let t=[...e.steps].toReversed().find(e=>e.exitCode!==0);if(!t)return[];let n=(t.stderrTail??``).toLowerCase(),r=[];return t.name.startsWith(`global update`)&&n.includes(`eacces`)&&(r.push(`Detected permission failure (EACCES). Re-run with a writable global prefix or sudo (for system-managed Node installs).`),r.push(`Example: npm config set prefix ~/.local && npm i -g openclaw@latest`)),t.name.startsWith(`global update`)&&(n.includes(`node-gyp`)||n.includes(`prebuild`))&&(r.push(`Detected native optional dependency build failure. The updater retries with --omit=optional automatically.`),r.push(`If it still fails: npm i -g openclaw@latest --omit=optional`)),r}function He(n){if(!n)return{progress:{},stop:()=>{}};let r=null;return{progress:{onStepStart:t=>{r=Se(),r.start(e.accent(Be(t)))},onStepComplete:n=>{if(!r)return;let i=Be(n),a=e.muted(`(${v(n.durationMs)})`),o=n.exitCode===0?e.success(`✓`):e.error(`✗`);if(r.stop(`${o} ${i} ${a}`),r=null,n.exitCode!==0&&n.stderrTail){let r=n.stderrTail.split(`
1
+ import{A as e,p as t}from"./subsystem-kTFXkQM5.js";import{g as n,n as r,u as i}from"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{Bo as a,Fo as o}from"./auth-profiles-e3SmOvON.js";import{n as s,r as c,t as l}from"./command-format-CLxIPuLR.js";import"./agent-scope-BKE4M04k.js";import{m as u}from"./utils-7Gdj77QB.js";import{t as d}from"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-R4odAlsj.js";import"./version-q3SkUw2K.js";import"./registry-Div2nEwi.js";import"./skills-Df0CxTMH.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-CCU8jDti.js";import"./logger-C1GUBMt-.js";import{t as f}from"./exec-CiwCrGw3.js";import"./windows-spawn-Dw4dpTt2.js";import"./redact-bVcVj47r.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-DNQO70y-.js";import"./send-Cfa08ZLE.js";import"./send-DmS34-Eb.js";import{Nt as p}from"./compact-B5m4267P.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-D5CbqIVA.js";import"./tokens-D8eWI71q.js";import"./with-timeout-c1CzdShT.js";import"./deliver-HZ99jQzl.js";import"./diagnostic-CvLTqJbq.js";import"./send-CW3hfjkM.js";import"./pi-model-discovery-cW9be_SG.js";import"./exec-approvals-allowlist-DlYH42As.js";import"./exec-safe-bin-runtime-policy-Bu9bb9U5.js";import"./model-catalog-CI2eEH9Y.js";import"./fetch-Dj-FEHSr.js";import"./audio-transcription-runner-BwviCgP5.js";import"./fetch-guard-guH8Tmju.js";import"./image-DQ_3LMNb.js";import"./tool-display-BTuQQN92.js";import"./api-key-rotation-BRm3CNd-.js";import"./proxy-fetch-ByazCl5E.js";import"./ir-CsTyrPwa.js";import"./render-DrrPmnMI.js";import"./target-errors-BRLBPboT.js";import"./commands-DOhEGWJ2.js";import"./commands-registry-CqsggloB.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-Bh1ozdi-.js";import"./sqlite-DgdOh9U-.js";import"./call-D5NJXFgu.js";import"./pi-tools.policy-CklWbQkk.js";import"./pairing-store-CmT1fSmE.js";import"./fetch-Dh-apy46.js";import"./skill-commands-qdKWuiOR.js";import"./workspace-dirs-na4G79jL.js";import"./pairing-token-YrKlxjGC.js";import"./channel-activity-CFgOyIkh.js";import"./tables-5gR6U_tC.js";import{m,p as h,u as g}from"./arg-split-BOqSMBuf.js";import"./kill-tree-DihujQie.js";import{n as _}from"./cmd-argv-Bh-KpaZ0.js";import"./runtime-web-tools-BjmhIJkd.js";import"./runtime-HwYsJOk2.js";import"./node-shell-BuPDYFhk.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-C1kkZyEb.js";import"./plugin-auto-enable-CrVJR--r.js";import"./send-DQxQrVuw.js";import"./outbound-attachment-BKku_WUf.js";import"./delivery-queue-nkPJu0fY.js";import"./send-DVv1dCwu.js";import"./system-run-command-BT2tTJg2.js";import"./fetch-EBjfhrYU.js";import{r as v}from"./format-duration-C8AzNqKh.js";import"./command-secret-targets-BtkZwOzh.js";import"./connection-auth-BIApbu6I.js";import"./onboard-helpers-CvWjz0op.js";import{n as y}from"./prompt-style-QJckocuy.js";import"./pairing-labels-B3wRXljf.js";import"./search-manager-Co5RwgQ4.js";import"./manager-p3CCKFcv.js";import"./memory-cli-CTXmLb0V.js";import{t as b}from"./links-pHmQCzdF.js";import"./cli-utils-BleB1eys.js";import{t as x}from"./help-format-BSNXPQuE.js";import"./progress-Cy6zNuIC.js";import"./exec-approvals-BXO9Cezj.js";import"./skills-status-Bzj-kJgo.js";import{n as S}from"./command-options-BpOUDl2S.js";import"./note-Dzei_8z5.js";import"./install-safe-path-C2oVnQ4q.js";import"./npm-pack-install-C3zwwLzE.js";import"./skill-scanner-B8TBRXeT.js";import"./installs-8EuwGg1W.js";import{n as ee}from"./issue-format-DRHlQPnX.js";import"./channels-status-issues-RPxMYADM.js";import{r as C}from"./completion-cli-CXSmC7Nh.js";import"./register.subclis-BmtNNMP2.js";import"./command-registry-B-1wiWIV.js";import"./program-context-CH9p6anW.js";import"./daemon-install-plan.shared-JQBIvXfN.js";import{r as w}from"./runtime-guard-BFK4A89C.js";import"./gateway-install-token-D5Aivh68.js";import"./systemd-2rjzkWWr.js";import{n as te}from"./service-CtJtO2Jl.js";import"./lifecycle-core-CNLarX-R.js";import"./systemd-hints-Cuo_K2we.js";import{a as T,i as E,l as D,o as O,r as k}from"./daemon-cli-D8BKkqsL.js";import"./probe-auth-DseDsvEH.js";import"./diagnostics-DnbLdEsy.js";import{n as A,t as j}from"./table-BiqW4yI5.js";import"./health-CIBrUBhW.js";import"./control-ui-assets-bS1XYZpI.js";import{d as M,g as N,h as P,i as ne,m as F,n as I,o as re,r as ie,u as ae}from"./channel-account-context-DuBGrKuL.js";import{a as L,c as R,i as oe,l as z,n as se,o as ce,r as le,s as ue,t as de}from"./update-runner-1UCWso86.js";import{i as fe,n as pe,t as me}from"./status.update-CdMzKwdx.js";import"./logging-Ai_SKvpp.js";import"./oauth-tls-preflight-CN5Fg7I1.js";import{n as he,t as ge}from"./update-ClWK3wEI.js";import"./doctor-config-flow-DX6_ggPf.js";import"./systemd-linger-CFEQD-zV.js";import"./health-format-nLgxB9tv.js";import{n as _e,t as ve}from"./prompt-select-styled-U5YlFMbC.js";import{r as B,t as ye}from"./doctor-completion-C5fxcbh9.js";import{spawn as be,spawnSync as xe}from"node:child_process";import V from"node:os";import H from"node:path";import U from"node:fs/promises";import{confirm as W,isCancel as G,spinner as Se}from"@clack/prompts";function K(e){let n=e?Number.parseInt(e,10)*1e3:void 0;return n!==void 0&&(Number.isNaN(n)||n<=0)?(t.error(`--timeout must be a positive integer (seconds)`),t.exit(1),null):n}const q=`https://github.com/openclaw/openclaw.git`,Ce=8e3,we=`openclaw`,Te=new Set([we]);function Ee(e){return ue(e,[`openclaw`,we])}function De(e){let t=e.trim();if(!t)return null;let n=t.startsWith(`v`)?t.slice(1):t;return w(n)?n:null}async function Oe(e,t){return De(e)||((await ne({tag:e,timeoutMs:t})).version??null)}async function ke(e){try{return await U.stat(H.join(e,`.git`)),!0}catch{return!1}}async function Ae(e){let t=await R(e);return!!(t&&Te.has(t))}async function je(e){try{return(await U.readdir(e)).length===0}catch{return!1}}function Me(){let e=process.env.OPENCLAW_GIT_DIR?.trim();return e?H.resolve(e):Ne()}function Ne(){return n(process.env,V.homedir)}function J(){let e=H.basename(process.execPath).toLowerCase();return e===`node`||e===`node.exe`?process.execPath:`node`}async function Y(){return await d({moduleUrl:import.meta.url,argv1:process.argv[1],cwd:process.cwd()})??process.cwd()}async function X(e){let t=e.argv.join(` `);e.progress?.onStepStart?.({name:e.name,command:t,index:0,total:0});let n=Date.now(),r=await f(e.argv,{cwd:e.cwd,timeoutMs:e.timeoutMs}),i=Date.now()-n,a=p(r.stderr,Ce);return e.progress?.onStepComplete?.({name:e.name,command:t,index:0,total:0,durationMs:i,exitCode:r.code,stderrTail:a}),{name:e.name,command:t,cwd:e.cwd??process.cwd(),durationMs:i,exitCode:r.code,stdoutTail:p(r.stdout,Ce),stderrTail:a}}async function Pe(e){if(!await u(e.dir))return await X({name:`git clone`,argv:[`git`,`clone`,q,e.dir],timeoutMs:e.timeoutMs,progress:e.progress});if(!await ke(e.dir)){if(!await je(e.dir))throw Error(`OPENCLAW_GIT_DIR points at a non-git directory: ${e.dir}. Set OPENCLAW_GIT_DIR to an empty folder or an openclaw checkout.`);return await X({name:`git clone`,argv:[`git`,`clone`,q,e.dir],cwd:e.dir,timeoutMs:e.timeoutMs,progress:e.progress})}if(!await Ae(e.dir))throw Error(`OPENCLAW_GIT_DIR does not look like a core checkout: ${e.dir}.`);return null}async function Z(e){let t=Ie();if(e.installKind===`package`){let n=await oe(t,e.root,e.timeoutMs);if(n)return n}return await le(t,e.timeoutMs)??`npm`}async function Fe(n,r){let i=H.join(n,`openclaw.mjs`);if(!await u(i))return;let a=xe(J(),[i,`completion`,`--write-state`],{cwd:n,env:process.env,encoding:`utf-8`});if(a.error){r||t.log(e.warn(`Completion cache update failed: ${String(a.error)}`));return}if(a.status!==0&&!r){let n=(a.stderr??``).toString().trim(),r=n?` (${n})`:``;t.log(e.warn(`Completion cache update failed${r}.`))}}function Ie(){return async(e,t)=>{let n=await f(e,t);return{stdout:n.stdout,stderr:n.stderr,code:n.code}}}function Le(e){let t=e.sha?e.sha.slice(0,8):null,n=e.branch&&e.branch!==`HEAD`?e.branch:null,r=e.tag;return[n??(r?`detached`:`git`),r?`tag ${r}`:null,t?`@ ${t}`:null].filter(Boolean).join(` · `)}async function Re(n){let r=K(n.timeout);if(r===null)return;let i=await Y(),a=await o(),s=a.valid?F(a.config.update?.channel):null,c=await I({root:i,timeoutMs:r??3500,fetchGit:!0,includeRegistry:!0}),l=N({configChannel:s,installKind:c.installKind,gitTag:c.git?.tag??null,gitBranch:c.git?.branch??null}),u=l.label,d=c.installKind===`git`?Le({branch:c.git?.branch??null,tag:c.git?.tag??null,sha:c.git?.sha??null}):null,f=fe(c),p=pe(c).replace(/^Update:\s*/i,``);if(n.json){t.log(JSON.stringify({update:c,channel:{value:l.channel,source:l.source,label:u,config:s},availability:f},null,2));return}let m=j(),h=[{Item:`Install`,Value:c.installKind===`git`?`git (${c.root??`unknown`})`:c.installKind===`package`?c.packageManager:`unknown`},{Item:`Channel`,Value:u},...d?[{Item:`Git`,Value:d}]:[],{Item:`Update`,Value:f.available?e.warn(`available · ${p}`):p}];t.log(e.heading(`OpenClaw update status`)),t.log(``),t.log(A({width:m,columns:[{key:`Item`,header:`Item`,minWidth:10},{key:`Value`,header:`Value`,flex:!0,minWidth:24}],rows:h}).trimEnd()),t.log(``);let g=me(c);g&&t.log(e.warn(g))}const ze={"clean check":`Working directory is clean`,"upstream check":`Upstream branch exists`,"git fetch":`Fetching latest changes`,"git rebase":`Rebasing onto target commit`,"git rev-parse @{upstream}":`Resolving upstream commit`,"git rev-list":`Enumerating candidate commits`,"git clone":`Cloning git checkout`,"preflight worktree":`Preparing preflight worktree`,"preflight cleanup":`Cleaning preflight worktree`,"deps install":`Installing dependencies`,build:`Building`,"ui:build":`Building UI assets`,"ui:build (post-doctor repair)":`Restoring missing UI assets`,"ui assets verify":`Validating UI assets`,"openclaw doctor entry":`Checking doctor entrypoint`,"openclaw doctor":`Running doctor checks`,"git rev-parse HEAD (after)":`Verifying update`,"global update":`Updating via package manager`,"global update (omit optional)":`Retrying update without optional deps`,"global install":`Installing global package`};function Be(e){return ze[e.name]??e.name}function Ve(e){if(e.status!==`error`||e.mode!==`npm`)return[];let t=[...e.steps].toReversed().find(e=>e.exitCode!==0);if(!t)return[];let n=(t.stderrTail??``).toLowerCase(),r=[];return t.name.startsWith(`global update`)&&n.includes(`eacces`)&&(r.push(`Detected permission failure (EACCES). Re-run with a writable global prefix or sudo (for system-managed Node installs).`),r.push(`Example: npm config set prefix ~/.local && npm i -g openclaw@latest`)),t.name.startsWith(`global update`)&&(n.includes(`node-gyp`)||n.includes(`prebuild`))&&(r.push(`Detected native optional dependency build failure. The updater retries with --omit=optional automatically.`),r.push(`If it still fails: npm i -g openclaw@latest --omit=optional`)),r}function He(n){if(!n)return{progress:{},stop:()=>{}};let r=null;return{progress:{onStepStart:t=>{r=Se(),r.start(e.accent(Be(t)))},onStepComplete:n=>{if(!r)return;let i=Be(n),a=e.muted(`(${v(n.durationMs)})`),o=n.exitCode===0?e.success(`✓`):e.error(`✗`);if(r.stop(`${o} ${i} ${a}`),r=null,n.exitCode!==0&&n.stderrTail){let r=n.stderrTail.split(`
2
2
  `).slice(-10);for(let n of r)n.trim()&&t.log(` ${e.error(n)}`)}}},stop:()=>{r&&=(r.stop(),null)}}}function Ue(t){return t===0?e.success(`✓`):t===null?e.warn(`?`):e.error(`✗`)}function We(n,r){if(r.json){t.log(JSON.stringify(n,null,2));return}let i=n.status===`ok`?e.success:n.status===`skipped`?e.warn:e.error;if(t.log(``),t.log(`${e.heading(`Update Result:`)} ${i(n.status.toUpperCase())}`),n.root&&t.log(` Root: ${e.muted(n.root)}`),n.reason&&t.log(` Reason: ${e.muted(n.reason)}`),n.before?.version||n.before?.sha){let r=n.before.version??n.before.sha?.slice(0,8)??``;t.log(` Before: ${e.muted(r)}`)}if(n.after?.version||n.after?.sha){let r=n.after.version??n.after.sha?.slice(0,8)??``;t.log(` After: ${e.muted(r)}`)}if(!r.hideSteps&&n.steps.length>0){t.log(``),t.log(e.heading(`Steps:`));for(let r of n.steps){let n=Ue(r.exitCode),i=e.muted(`(${v(r.durationMs)})`);if(t.log(` ${n} ${r.name} ${i}`),r.exitCode!==0&&r.stderrTail){let n=r.stderrTail.split(`
3
3
  `).slice(0,5);for(let r of n)r.trim()&&t.log(` ${e.error(r)}`)}}}let a=Ve(n);if(a.length>0){t.log(``),t.log(e.heading(`Recovery hints:`));for(let n of a)t.log(` - ${e.warn(n)}`)}t.log(``),t.log(`Total time: ${e.muted(v(n.durationMs))}`)}function Q(e){return e.replace(/'/g,`'\\''`)}function Ge(e){return/^[A-Za-z0-9 _\-().]+$/.test(e)}function Ke(e){let t=e.OPENCLAW_SYSTEMD_UNIT?.trim();return t?t.endsWith(`.service`)?t:`${t}.service`:`${h(e.OPENCLAW_PROFILE)}.service`}function qe(e){return e.OPENCLAW_LAUNCHD_LABEL?.trim()||g(e.OPENCLAW_PROFILE)}function Je(e){return e.OPENCLAW_WINDOWS_TASK_NAME?.trim()||m(e.OPENCLAW_PROFILE)}async function Ye(e=process.env,t=r){let n=V.tmpdir(),i=Date.now(),a=process.platform,o=``,s=``;try{if(a===`linux`){let t=Q(Ke(e));s=`openclaw-restart-${i}.sh`,o=`#!/bin/sh
4
4
  # Standalone restart script — survives parent process termination.