@qqbrowser/openclaw-qbot 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/dist/{agents-Cd1yL8fG.js → agents-CCGNI0th.js} +1 -1
  2. package/dist/{agents.config-CaRMmWS8.js → agents.config-B9_IT_un.js} +1 -1
  3. package/dist/{agents.config-DSCcdYtv.js → agents.config-D8Q8p7re.js} +1 -1
  4. package/dist/{auth-choice-MqcWuVyu.js → auth-choice-DacG9sC7.js} +1 -1
  5. package/dist/{auth-choice-BmI4sIGs.js → auth-choice-EAV1bi1K.js} +1 -1
  6. package/dist/{banner-CAtilyXr.js → banner-DiQjNe9B.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-CCqtIYCc.js → channel-options-DcI5T_Su.js} +1 -1
  12. package/dist/{channel-options-CKoyPq8p.js → channel-options-llKYy0-2.js} +1 -1
  13. package/dist/{channel-web-CwUfYqjg.js → channel-web-Qr8ST6tz.js} +1 -1
  14. package/dist/{channel-web-CCSMlUux.js → channel-web-TKrgB4oQ.js} +1 -1
  15. package/dist/{channels-cli-BfgVv5jH.js → channels-cli-BtyzpSQo.js} +1 -1
  16. package/dist/{channels-cli-BvGXgERj.js → channels-cli-CrdwqyiA.js} +1 -1
  17. package/dist/{cli-Bt--1dhL.js → cli-BDzG5MP5.js} +1 -1
  18. package/dist/{cli-CBg8KhmQ.js → cli-BY5POVX1.js} +1 -1
  19. package/dist/{command-registry-D_jtBegA.js → command-registry-DtMCIKRu.js} +1 -1
  20. package/dist/{compact-CYbPi7_-.js → compact-uyQDx8pN.js} +36 -36
  21. package/dist/{compact.runtime-BQu-8DFN.js → compact.runtime-BvWn8-VF.js} +1 -1
  22. package/dist/{compact.runtime-D-fOpaU3.js → compact.runtime-CbCNReBm.js} +1 -1
  23. package/dist/{compact.runtime-owWgKVDf.js → compact.runtime-DcRVnY_G.js} +1 -1
  24. package/dist/{compact.runtime-CrzmR0tV.js → compact.runtime-dgJTRf2V.js} +1 -1
  25. package/dist/{completion-cli-Bw_hBrlA.js → completion-cli-ByNU0Lbo.js} +1 -1
  26. package/dist/{completion-cli-BVbT_aR2.js → completion-cli-DHH7Zr2u.js} +1 -1
  27. package/dist/{config-cli-CwW76_j_.js → config-cli-BeVM5uz1.js} +1 -1
  28. package/dist/{config-cli-F-lkPjjz.js → config-cli-CcE1aKR3.js} +1 -1
  29. package/dist/{configure-DFlnM_zh.js → configure-CF42Va3r.js} +1 -1
  30. package/dist/{configure--c4tTVPz.js → configure-CYw7mK89.js} +1 -1
  31. package/dist/{deps-send-whatsapp.runtime-CqISN5vF.js → deps-send-whatsapp.runtime-7SqhJmWZ.js} +1 -1
  32. package/dist/{deps-send-whatsapp.runtime-C1zG74Si.js → deps-send-whatsapp.runtime-Bocaadqa.js} +1 -1
  33. package/dist/{deps-send-whatsapp.runtime-B5GMQIFv.js → deps-send-whatsapp.runtime-CjA6T7V6.js} +1 -1
  34. package/dist/{deps-send-whatsapp.runtime-CJnSJVnN.js → deps-send-whatsapp.runtime-DTyzQeR_.js} +1 -1
  35. package/dist/{doctor-completion-DI7mGC3D.js → doctor-completion-C15UB3EM.js} +1 -1
  36. package/dist/{doctor-completion-C9CPhCor.js → doctor-completion-KLuf1f33.js} +1 -1
  37. package/dist/entry.js +1 -1
  38. package/dist/extensionAPI.js +1 -1
  39. package/dist/{gateway-cli-BMmU2dsG.js → gateway-cli-CHyybU4X.js} +2 -2
  40. package/dist/{gateway-cli-Kp-caOwI.js → gateway-cli-DV3M2tJP.js} +2 -2
  41. package/dist/{health-B_-ZE5FK.js → health-2MbtCw6U.js} +1 -1
  42. package/dist/{health-CIZFVJEG.js → health-Dmtcw9K8.js} +1 -1
  43. package/dist/{hooks-cli-BoxAnC-E.js → hooks-cli-BaoD0-6l.js} +1 -1
  44. package/dist/{hooks-cli-CnCOjVv0.js → hooks-cli-DWCe4aHR.js} +1 -1
  45. package/dist/index.js +2 -2
  46. package/dist/llm-slug-generator.js +1 -1
  47. package/dist/{models-BBYqej07.js → models-DKf-4KoV.js} +1 -1
  48. package/dist/{models-cli-CMMhnlHo.js → models-cli-Bc8cIZ0A.js} +1 -1
  49. package/dist/{models-cli-CqbDyDn2.js → models-cli-Ble64nV3.js} +1 -1
  50. package/dist/{npm-resolution-CBlwQq3a.js → npm-resolution-BzXV2s2P.js} +1 -1
  51. package/dist/{npm-resolution--_-0q2ks.js → npm-resolution-CZUqHH_2.js} +1 -1
  52. package/dist/{onboard-DZG0HnuP.js → onboard-B8dVlGVk.js} +2 -2
  53. package/dist/{onboard-DlCEww7K.js → onboard-By9pkNca.js} +2 -2
  54. package/dist/{onboard-channels-BDMtq3ex.js → onboard-channels-C5lcb7dF.js} +1 -1
  55. package/dist/{onboard-channels-BO3AN_eA.js → onboard-channels-DFB6deX0.js} +1 -1
  56. package/dist/{onboarding-m-m__16h.js → onboarding-C7vbkuBI.js} +1 -1
  57. package/dist/{onboarding-CxRTJCBM.js → onboarding-DCldCoVy.js} +1 -1
  58. package/dist/{onboarding.finalize-BJxMhYUa.js → onboarding.finalize-C-b9zSIO.js} +1 -1
  59. package/dist/{onboarding.finalize-UiX3YmbI.js → onboarding.finalize-XCttW8IU.js} +1 -1
  60. package/dist/{pi-embedded-X_Svd4Wi.js → pi-embedded-CoHiJa9Q.js} +8 -8
  61. package/dist/{pi-embedded-6yGEd2xd.js → pi-embedded-DLlQ5e_w.js} +8 -8
  62. package/dist/{plugin-registry-DYwEy5eM.js → plugin-registry-C_HKxFxs.js} +1 -1
  63. package/dist/{plugin-registry-CN2aCPP7.js → plugin-registry-DBgXa8jD.js} +1 -1
  64. package/dist/plugin-sdk/{channel-web-Bg8DNyeb.js → channel-web-CMlv9Yzv.js} +1 -1
  65. package/dist/plugin-sdk/{channel-web-B795Ild9.cjs → channel-web-D1tzaMsH.cjs} +1 -1
  66. package/dist/plugin-sdk/{channel-web-D5zxPW-x.js → channel-web-DowgDxtO.js} +1 -1
  67. package/dist/plugin-sdk/{channel-web-CW42ALB5.cjs → channel-web-VsaRZCG2.cjs} +1 -1
  68. package/dist/plugin-sdk/{compact.runtime-Cr6oI5li.js → compact.runtime-B4M-VPyN.js} +1 -1
  69. package/dist/plugin-sdk/{compact.runtime-BR00C0_i.cjs → compact.runtime-BeWqnWW5.cjs} +1 -1
  70. package/dist/plugin-sdk/{compact.runtime-DOcQzBT5.cjs → compact.runtime-BnF9vU5j.cjs} +1 -1
  71. package/dist/plugin-sdk/{compact.runtime-D-3vVYGF.js → compact.runtime-C5vcsriA.js} +1 -1
  72. package/dist/plugin-sdk/{compact.runtime-BBqQuOlJ.cjs → compact.runtime-CS04yjUP.cjs} +1 -1
  73. package/dist/plugin-sdk/{compact.runtime-CGKItjCQ.js → compact.runtime-CepgZBh6.js} +1 -1
  74. package/dist/plugin-sdk/{compact.runtime-C-sPm0kL.cjs → compact.runtime-CuGn1L3D.cjs} +1 -1
  75. package/dist/plugin-sdk/{compact.runtime-CAiT8DtI.js → compact.runtime-DNocZUm6.js} +1 -1
  76. package/dist/plugin-sdk/{compact.runtime-CmQT69OD.cjs → compact.runtime-DQRsRwKH.cjs} +1 -1
  77. package/dist/plugin-sdk/{compact.runtime-BXuXwnQ_.cjs → compact.runtime-DnWYG9Ij.cjs} +1 -1
  78. package/dist/plugin-sdk/{compact.runtime-BxzvSPrQ.js → compact.runtime-W8dIsxRV.js} +1 -1
  79. package/dist/plugin-sdk/{compact.runtime-B1fslZX1.js → compact.runtime-hS2NXspw.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-WXiE5pA7.js → deps-send-whatsapp.runtime-B5Nz8XrQ.js} +1 -1
  83. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-DKoOiTZZ.cjs → deps-send-whatsapp.runtime-B5R8WAYy.cjs} +1 -1
  84. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-DlO-S_iA.js → deps-send-whatsapp.runtime-B6ua6LoP.js} +1 -1
  85. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-BUuj08qp.cjs → deps-send-whatsapp.runtime-BPMIzR5x.cjs} +1 -1
  86. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-iI9qWUzR.cjs → deps-send-whatsapp.runtime-Bpq7VeGO.cjs} +1 -1
  87. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-3kX5dnHC.js → deps-send-whatsapp.runtime-D3YUudyV.js} +1 -1
  88. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-Xn1KqyPS.js → deps-send-whatsapp.runtime-DFxWO5_f.js} +1 -1
  89. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-CE9LgvzJ.cjs → deps-send-whatsapp.runtime-DZ_pLOPK.cjs} +1 -1
  90. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-t0Z0IyDq.cjs → deps-send-whatsapp.runtime-DyoJd0Hw.cjs} +1 -1
  91. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-rOnSc6qE.js → deps-send-whatsapp.runtime-ZkaerhQ1.js} +1 -1
  92. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-QUlRFE48.cjs → deps-send-whatsapp.runtime-_wzNB18A.cjs} +1 -1
  93. package/dist/plugin-sdk/{deps-send-whatsapp.runtime-DKVfDIzU.js → deps-send-whatsapp.runtime-bBd46QxW.js} +1 -1
  94. package/dist/plugin-sdk/{dispatch-DAaOM5c1.cjs → dispatch-B8dzPpi1.cjs} +8 -8
  95. package/dist/plugin-sdk/{dispatch-DYRrW05S.js → dispatch-B9FQyNfe.js} +36 -36
  96. package/dist/plugin-sdk/{dispatch-Dl0eaYcY.cjs → dispatch-BB5AfYlI.cjs} +8 -8
  97. package/dist/plugin-sdk/{dispatch-_tJF5hSh.cjs → dispatch-BIaey_BU.cjs} +8 -8
  98. package/dist/plugin-sdk/{dispatch-B13B2T1k.js → dispatch-BY1FkQOr.js} +8 -8
  99. package/dist/plugin-sdk/{dispatch-cPg1rBWu.cjs → dispatch-Bybxc9Yl.cjs} +8 -8
  100. package/dist/plugin-sdk/{dispatch-BlOkbw2U.js → dispatch-CADw_Fi7.js} +8 -8
  101. package/dist/plugin-sdk/{dispatch-Dap2ZPC9.js → dispatch-CZqPeEcw.js} +8 -8
  102. package/dist/plugin-sdk/{dispatch-BaBcLOry.js → dispatch-DafB1x1O.js} +8 -8
  103. package/dist/plugin-sdk/{dispatch-D2Km7gvG.cjs → dispatch-DcyylSdu.cjs} +8 -8
  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-JD6VIW5N.cjs → reply-6D8nZUZ1.cjs} +8 -8
  115. package/dist/plugin-sdk/{reply-73PF8kN_.js → reply-gpVkJsEs.js} +8 -8
  116. package/dist/plugin-sdk/{slash-dispatch.runtime-DAgDLU__.js → slash-dispatch.runtime-2hUZv0o4.js} +1 -1
  117. package/dist/plugin-sdk/{slash-dispatch.runtime-BfheQLfD.js → slash-dispatch.runtime-B4sdtKqK.js} +1 -1
  118. package/dist/plugin-sdk/{slash-dispatch.runtime-CmVqJqfV.js → slash-dispatch.runtime-BCAWJ135.js} +1 -1
  119. package/dist/plugin-sdk/{slash-dispatch.runtime-wWa-kKvH.js → slash-dispatch.runtime-BJX-7mTD.js} +1 -1
  120. package/dist/plugin-sdk/{slash-dispatch.runtime-C6cMCwSp.js → slash-dispatch.runtime-BY3aBzxK.js} +1 -1
  121. package/dist/plugin-sdk/{slash-dispatch.runtime-BVXTmhZU.js → slash-dispatch.runtime-CHFbytW1.js} +1 -1
  122. package/dist/plugin-sdk/{slash-dispatch.runtime-BcO6NdxL.cjs → slash-dispatch.runtime-Cf-EuMPD.cjs} +1 -1
  123. package/dist/plugin-sdk/{slash-dispatch.runtime-CYmmyw9o.cjs → slash-dispatch.runtime-CukipBLa.cjs} +1 -1
  124. package/dist/plugin-sdk/{slash-dispatch.runtime-DNI9fZFo.cjs → slash-dispatch.runtime-D7JTU7km.cjs} +1 -1
  125. package/dist/plugin-sdk/{slash-dispatch.runtime-BQWrcjEG.cjs → slash-dispatch.runtime-DZq0olM2.cjs} +1 -1
  126. package/dist/plugin-sdk/{slash-dispatch.runtime-Cp5-cPgM.cjs → slash-dispatch.runtime-ILA0KH-p.cjs} +1 -1
  127. package/dist/plugin-sdk/{slash-dispatch.runtime-CD6AFEn3.cjs → slash-dispatch.runtime-_i2UiDTt.cjs} +1 -1
  128. package/dist/plugin-sdk/{subagent-registry-runtime-BINR9wKz.cjs → subagent-registry-runtime-7wfZ9Ydg.cjs} +1 -1
  129. package/dist/plugin-sdk/{subagent-registry-runtime-q6csFFiS.js → subagent-registry-runtime-B6Go3QMY.js} +1 -1
  130. package/dist/plugin-sdk/{subagent-registry-runtime-CPYQLLoh.cjs → subagent-registry-runtime-Bf71VzVF.cjs} +1 -1
  131. package/dist/plugin-sdk/{subagent-registry-runtime-DCd8DMgz.js → subagent-registry-runtime-CKlyWpvM.js} +1 -1
  132. package/dist/plugin-sdk/{subagent-registry-runtime-BfT45xXa.cjs → subagent-registry-runtime-CcyvhbJH.cjs} +1 -1
  133. package/dist/plugin-sdk/{subagent-registry-runtime-DYhr9YcP.js → subagent-registry-runtime-D4y3Fxlu.js} +1 -1
  134. package/dist/plugin-sdk/{subagent-registry-runtime-BBwsJL9B.cjs → subagent-registry-runtime-DFCUhuvT.cjs} +1 -1
  135. package/dist/plugin-sdk/{subagent-registry-runtime-CjnSOShL.js → subagent-registry-runtime-DWZUy1eI.js} +1 -1
  136. package/dist/plugin-sdk/{subagent-registry-runtime-B9uDb_ij.js → subagent-registry-runtime-DkCs3cQj.js} +1 -1
  137. package/dist/plugin-sdk/{subagent-registry-runtime-DB8YDuGj.js → subagent-registry-runtime-RrhCNI-u.js} +1 -1
  138. package/dist/plugin-sdk/{subagent-registry-runtime-iiOzLeYb.cjs → subagent-registry-runtime-S2yCcuWA.cjs} +1 -1
  139. package/dist/plugin-sdk/{subagent-registry-runtime-ClkQBnJu.cjs → subagent-registry-runtime-zTYi4rJR.cjs} +1 -1
  140. package/dist/plugin-sdk/{web-Bh78uOi8.cjs → web-C-_Bja5u.cjs} +1 -1
  141. package/dist/plugin-sdk/{web-C4ezqWIt.js → web-C7h16O4t.js} +1 -1
  142. package/dist/plugin-sdk/{web-B7d3p3kx.cjs → web-Cf2Ivjcn.cjs} +1 -1
  143. package/dist/plugin-sdk/{web-DFDao2So.cjs → web-CfvlhITy.cjs} +1 -1
  144. package/dist/plugin-sdk/{web-JciOW43P.js → web-DzgvdKmn.js} +1 -1
  145. package/dist/plugin-sdk/{web-Bg2LIMdb.cjs → web-RmaRbUK1.cjs} +1 -1
  146. package/dist/plugin-sdk/{web-SwpoHf2A.js → web-bHdImk0G.js} +1 -1
  147. package/dist/plugin-sdk/{web-DjbeDvyv.js → web-bT52Rp59.js} +1 -1
  148. package/dist/plugin-sdk/{web-vSFigMHz.cjs → web-pFlzmHcu.cjs} +1 -1
  149. package/dist/plugin-sdk/{web-BEuW8Yqw.js → web-rFQBs9b0.js} +1 -1
  150. package/dist/plugin-sdk/{web--8MBOleK.js → web-uQqWClDT.js} +1 -1
  151. package/dist/plugin-sdk/{web-BPQv-4Qv.cjs → web-wnw_PMil.cjs} +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-PVHBZeb8.js → plugins-cli-BjLj52hA.js} +1 -1
  155. package/dist/{plugins-cli-CnXgwZzI.js → plugins-cli-CwQOOOym.js} +1 -1
  156. package/dist/ports-BDZyt9rk.js +2 -0
  157. package/dist/ports-DmJX-iq9.js +2 -0
  158. package/dist/{program-D53eGuSf.js → program-RvezCMDs.js} +2 -2
  159. package/dist/{program-context-n-ovYq69.js → program-context-C4vPkfWW.js} +1 -1
  160. package/dist/{prompt-select-styled-DolCW-_j.js → prompt-select-styled-C-zw_5_b.js} +1 -1
  161. package/dist/{prompt-select-styled-DZnefcrY.js → prompt-select-styled-CoP6cSMX.js} +1 -1
  162. package/dist/{provider-auth-helpers-BLm2bdp5.js → provider-auth-helpers-DeCLF5oV.js} +1 -1
  163. package/dist/{provider-auth-helpers-DPz0vN_c.js → provider-auth-helpers-Rv3hdZ7j.js} +1 -1
  164. package/dist/{push-apns-BBv62ncV.js → push-apns-BfTKAzRZ.js} +1 -1
  165. package/dist/{push-apns-DIV5dBPP.js → push-apns-CeY33Rxc.js} +1 -1
  166. package/dist/{register.agent-DQdoMfmw.js → register.agent-CANRVL5k.js} +1 -1
  167. package/dist/{register.agent-DHOTtB8X.js → register.agent-He4UYNpV.js} +1 -1
  168. package/dist/{register.configure-C2N82brC.js → register.configure-CqsxTDtC.js} +1 -1
  169. package/dist/{register.configure-C6zjzaEo.js → register.configure-CwuLuKsv.js} +1 -1
  170. package/dist/{register.maintenance-CStaPxaB.js → register.maintenance-B5cnDjLy.js} +1 -1
  171. package/dist/{register.maintenance-aKBTd9Zp.js → register.maintenance-CHJQh81L.js} +1 -1
  172. package/dist/{register.message-DHDcOA8X.js → register.message-CEcXemHd.js} +1 -1
  173. package/dist/{register.message-Dh72QHKA.js → register.message-DoA6MALf.js} +1 -1
  174. package/dist/{register.onboard-DB9FWAKT.js → register.onboard-B01N1AYH.js} +1 -1
  175. package/dist/{register.onboard-Bu9gpFlA.js → register.onboard-B5iQpfVG.js} +1 -1
  176. package/dist/{register.setup-D76IRs4s.js → register.setup-BTKZzyRh.js} +1 -1
  177. package/dist/{register.setup-CeG2ETmr.js → register.setup-CPGByOtO.js} +1 -1
  178. package/dist/{register.status-health-sessions-mPGKFjIz.js → register.status-health-sessions-CPmSNp3F.js} +1 -1
  179. package/dist/{register.status-health-sessions-Dtpd1P2M.js → register.status-health-sessions-hrQLxH-w.js} +1 -1
  180. package/dist/{register.subclis-Drp2dGBe.js → register.subclis-CqVDIyhT.js} +1 -1
  181. package/dist/{reply-DwfVhea1.js → reply-mWIMy_ju.js} +8 -8
  182. package/dist/{run-main-CjwjyWA6.js → run-main-B2f6FBb0.js} +1 -1
  183. package/dist/{server-node-events-CL0pWoMa.js → server-node-events-BtKnElP0.js} +1 -1
  184. package/dist/{server-node-events-ChPQ984b.js → server-node-events-DnyBXZtB.js} +1 -1
  185. package/dist/{slash-dispatch.runtime-jR7ZpRLo.js → slash-dispatch.runtime-B8S9VVjy.js} +1 -1
  186. package/dist/{slash-dispatch.runtime-CHDiNcch.js → slash-dispatch.runtime-CS58xiJF.js} +1 -1
  187. package/dist/{slash-dispatch.runtime-DgsOlRbg.js → slash-dispatch.runtime-CZrxUnBW.js} +1 -1
  188. package/dist/{slash-dispatch.runtime-Bh87LG5X.js → slash-dispatch.runtime-Cq_OU6GL.js} +1 -1
  189. package/dist/{status-o3Gfr-6l.js → status-C3OhTrWE.js} +1 -1
  190. package/dist/{status-BSHWBrg0.js → status-tL-XCvJC.js} +1 -1
  191. package/dist/{subagent-registry-runtime-B8nEWxYm.js → subagent-registry-runtime-BvPAovsV.js} +1 -1
  192. package/dist/{subagent-registry-runtime-D5PhzS7u.js → subagent-registry-runtime-ClREKCLG.js} +1 -1
  193. package/dist/{subagent-registry-runtime-C6xoTyr_.js → subagent-registry-runtime-D2cjV86K.js} +1 -1
  194. package/dist/{subagent-registry-runtime-DU6-3b5M.js → subagent-registry-runtime-dcrGDOTV.js} +1 -1
  195. package/dist/{update-cli-DU5tRH3c.js → update-cli-CZsuMrHE.js} +1 -1
  196. package/dist/{update-cli-CL_cUjuq.js → update-cli-DAPHNGDM.js} +1 -1
  197. package/dist/{update-runner-DG-1TYYc.js → update-runner-DZkN4otc.js} +1 -1
  198. package/dist/{update-runner-DABdlxfN.js → update-runner-DhaHCCx3.js} +1 -1
  199. package/dist/{web-C0WkwHal.js → web-BPloShgg.js} +1 -1
  200. package/dist/{web-u71NbOpT.js → web-BbOH61Lx.js} +1 -1
  201. package/dist/{web-DPQjx48C.js → web-CMSYMAHG.js} +1 -1
  202. package/dist/{web-Dfi2WjvN.js → web-WBvnAfBv.js} +1 -1
  203. package/extensions/qqbrowser-skill-control/index.js +1 -1
  204. package/node_modules/@google/genai/dist/index.cjs +8 -8
  205. package/node_modules/@google/genai/dist/index.mjs +8 -8
  206. package/node_modules/@google/genai/dist/node/index.cjs +8 -8
  207. package/node_modules/@google/genai/dist/node/index.mjs +8 -8
  208. package/node_modules/@google/genai/dist/vertex_internal/index.cjs +1 -1
  209. package/node_modules/@google/genai/dist/vertex_internal/index.js +1 -1
  210. package/node_modules/@google/genai/dist/web/index.mjs +8 -8
  211. package/node_modules/@google/genai/package.json +1 -1
  212. package/package.json +1 -1
  213. package/dist/ports-BAaLOkJp.js +0 -2
  214. package/dist/ports-DDWP1p0X.js +0 -2
@@ -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-BLbY429l.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-C8rZRS0X.js";import"./agent-scope-DAWJwFfl.js";import"./utils-CGdo13HV.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import{t as _}from"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-Bz_S4lPh.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import{i as v}from"./errors-6SQWM9dj.js";import"./send-vNcod64S.js";import"./send-CyarIb2w.js";import"./compact-CYbPi7_-.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-DZzS67GS.js";import"./tokens-DRM8vzJx.js";import"./with-timeout-c1CzdShT.js";import"./deliver-SqSusZP3.js";import"./diagnostic-D1H7_8QG.js";import"./send-Dj7NBAWg.js";import"./pi-model-discovery-BPkhPDMr.js";import"./exec-approvals-allowlist-CGjRWREs.js";import"./exec-safe-bin-runtime-policy-v44u39fl.js";import"./model-catalog-mt0IcDfR.js";import"./fetch-B4bz67_N.js";import{_ as y}from"./audio-transcription-runner-BIKj1CBU.js";import"./fetch-guard-DaZmvp-L.js";import"./image-BVbOr9yV.js";import"./tool-display-DJDtttQg.js";import"./api-key-rotation-BpEL4aeX.js";import"./proxy-fetch-gWETR3cl.js";import"./ir-DdjufzKF.js";import"./render-DrrPmnMI.js";import"./target-errors-D6wejRd6.js";import"./commands-Dy7duWlt.js";import"./commands-registry-DT6FDUev.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-Bpdyx2A2.js";import"./sqlite-CILF3z9U.js";import"./call-BWx7hNtl.js";import"./pi-tools.policy-B6q8YOfg.js";import"./pairing-store-BaaVy1zB.js";import"./fetch-Dh-apy46.js";import"./skill-commands-DCqPy_Aa.js";import"./workspace-dirs-A8Vib9_B.js";import"./pairing-token-zdbQ951y.js";import"./channel-activity-BhiLsKvM.js";import"./tables-DENKrP-W.js";import"./kill-tree-D6nPx1_o.js";import"./runtime-web-tools-BYhCkBV8.js";import"./runtime-CK7gqwEF.js";import"./node-shell-BVZylVP6.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-BPxE8JR7.js";import"./plugin-auto-enable-adba5Evb.js";import"./send-ChILboDj.js";import"./outbound-attachment-CVcDBkAD.js";import"./delivery-queue-nkPJu0fY.js";import"./send-COpehmAB.js";import"./system-run-command-DsWBVvSK.js";import"./fetch-Ce-scEU-.js";import"./command-secret-targets-BEjtBf5Z.js";import"./connection-auth-CjaeEu5D.js";import"./onboard-helpers-DOlI17Ac.js";import"./prompt-style-BThRSQJR.js";import"./pairing-labels-CZ-aX-up.js";import"./search-manager-CV2YsAym.js";import"./manager-CxZRoQkE.js";import"./memory-cli-C8fBBPgv.js";import"./links-CBnmRP9D.js";import"./cli-utils-BleB1eys.js";import"./help-format-B4aEI7V9.js";import"./progress-d1m2sqR1.js";import"./exec-approvals-BXO9Cezj.js";import{t as b}from"./path-env-emdAQejM.js";import"./note-Dp-d_utk.js";import"./issue-format-CN9PHzXY.js";import{t as x}from"./plugin-registry-DYwEy5eM.js";import{t as S}from"./runtime-guard-DX2Ie4ri.js";import{t as C}from"./banner-CAtilyXr.js";import"./doctor-config-flow-Dio3s4x6.js";import{n as w}from"./config-guard-CqUJ8uaF.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-CIZFVJEG.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-o3Gfr-6l.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-Ca6ozRCQ.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-Cd1yL8fG.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-C8fBBPgv.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-CwW76_j_.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-CwW76_j_.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-BBYqej07.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-BBYqej07.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-CV2YsAym.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-D53eGuSf.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-D_jtBegA.js`).then(e=>e.t);await e(r,t,a,i)}let{registerSubCliByName:n}=await import(`./register.subclis-Drp2dGBe.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-Bt--1dhL.js`),{loadValidatedConfigForPluginRegistration:t}=await import(`./register.subclis-Drp2dGBe.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-BLbY429l.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-C8rZRS0X.js";import"./agent-scope-DAWJwFfl.js";import"./utils-CGdo13HV.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import{t as _}from"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-Bz_S4lPh.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import{i as v}from"./errors-6SQWM9dj.js";import"./send-vNcod64S.js";import"./send-CyarIb2w.js";import"./compact-uyQDx8pN.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-DZzS67GS.js";import"./tokens-DRM8vzJx.js";import"./with-timeout-c1CzdShT.js";import"./deliver-SqSusZP3.js";import"./diagnostic-D1H7_8QG.js";import"./send-Dj7NBAWg.js";import"./pi-model-discovery-BPkhPDMr.js";import"./exec-approvals-allowlist-CGjRWREs.js";import"./exec-safe-bin-runtime-policy-v44u39fl.js";import"./model-catalog-mt0IcDfR.js";import"./fetch-B4bz67_N.js";import{_ as y}from"./audio-transcription-runner-BIKj1CBU.js";import"./fetch-guard-DaZmvp-L.js";import"./image-BVbOr9yV.js";import"./tool-display-DJDtttQg.js";import"./api-key-rotation-BpEL4aeX.js";import"./proxy-fetch-gWETR3cl.js";import"./ir-DdjufzKF.js";import"./render-DrrPmnMI.js";import"./target-errors-D6wejRd6.js";import"./commands-Dy7duWlt.js";import"./commands-registry-DT6FDUev.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-Bpdyx2A2.js";import"./sqlite-CILF3z9U.js";import"./call-BWx7hNtl.js";import"./pi-tools.policy-B6q8YOfg.js";import"./pairing-store-BaaVy1zB.js";import"./fetch-Dh-apy46.js";import"./skill-commands-DCqPy_Aa.js";import"./workspace-dirs-A8Vib9_B.js";import"./pairing-token-zdbQ951y.js";import"./channel-activity-BhiLsKvM.js";import"./tables-DENKrP-W.js";import"./kill-tree-D6nPx1_o.js";import"./runtime-web-tools-BYhCkBV8.js";import"./runtime-CK7gqwEF.js";import"./node-shell-BVZylVP6.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-BPxE8JR7.js";import"./plugin-auto-enable-adba5Evb.js";import"./send-ChILboDj.js";import"./outbound-attachment-CVcDBkAD.js";import"./delivery-queue-nkPJu0fY.js";import"./send-COpehmAB.js";import"./system-run-command-DsWBVvSK.js";import"./fetch-Ce-scEU-.js";import"./command-secret-targets-BEjtBf5Z.js";import"./connection-auth-CjaeEu5D.js";import"./onboard-helpers-DOlI17Ac.js";import"./prompt-style-BThRSQJR.js";import"./pairing-labels-CZ-aX-up.js";import"./search-manager-CV2YsAym.js";import"./manager-CxZRoQkE.js";import"./memory-cli-C8fBBPgv.js";import"./links-CBnmRP9D.js";import"./cli-utils-BleB1eys.js";import"./help-format-B4aEI7V9.js";import"./progress-d1m2sqR1.js";import"./exec-approvals-BXO9Cezj.js";import{t as b}from"./path-env-emdAQejM.js";import"./note-Dp-d_utk.js";import"./issue-format-CN9PHzXY.js";import{t as x}from"./plugin-registry-C_HKxFxs.js";import{t as S}from"./runtime-guard-DX2Ie4ri.js";import{t as C}from"./banner-DiQjNe9B.js";import"./doctor-config-flow-Dio3s4x6.js";import{n as w}from"./config-guard-CqUJ8uaF.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-Dmtcw9K8.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-C3OhTrWE.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-Ca6ozRCQ.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-CCGNI0th.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-C8fBBPgv.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-BeVM5uz1.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-BeVM5uz1.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-DKf-4KoV.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-DKf-4KoV.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-CV2YsAym.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-RvezCMDs.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-DtMCIKRu.js`).then(e=>e.t);await e(r,t,a,i)}let{registerSubCliByName:n}=await import(`./register.subclis-CqVDIyhT.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-BDzG5MP5.js`),{loadValidatedConfigForPluginRegistration:t}=await import(`./register.subclis-CqVDIyhT.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"./paths-B4IRk3wi.js";import{p as e}from"./subsystem-C5XF2Fy5.js";import"./utils-UGOV_184.js";import{Jn as t,qs as n}from"./model-selection-BLbnMb5E.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-DwfVhea1.js";import"./agent-scope-DXZc3eNT.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-D7wNuBx1.js";import"./env-overrides-DXJbFrwI.js";import"./registry-hFAtCSWG.js";import"./skills-CzUpDbU-.js";import"./frontmatter-BkZkwkVO.js";import{r as m}from"./plugins-CYLrFT4h.js";import"./logger-Bl8URnrW.js";import"./exec-DHqLtFYt.js";import"./windows-spawn-AB7ItGAE.js";import"./redact-3_CiXMY6.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-Bunti32V.js";import"./send-C7rOdjPO.js";import"./send-BwblpWbK.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-BwjMhAUa.js";import"./image-BP1cfEh1.js";import"./models-config-BlQ39qlq.js";import"./tool-display-DjuSUUbH.js";import"./fetch-guard-7BAwnP4a.js";import"./api-key-rotation-Rz2ESQSA.js";import"./local-roots-aA-4ohTq.js";import"./model-catalog-D-hkNWin.js";import"./proxy-fetch-BADsUK4d.js";import"./tokens-XGbQGn67.js";import{t as h}from"./deliver-DUNkj4hy.js";import"./commands-CGpM84iR.js";import"./commands-registry-DlvNUkXz.js";import"./pairing-store-EmfFQVcs.js";import"./fetch-Dikjvc5M.js";import"./call-JB-cGR9n.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-BEZszppF.js";import"./send-NbU9-scF2.js";import"./pi-model-discovery-DnJkNRc-.js";import"./exec-approvals-allowlist-B-Yf6RsU.js";import"./exec-safe-bin-runtime-policy-CRPHdPbF.js";import"./ir-CNTx85qV.js";import"./render-D8OWO2hT.js";import"./target-errors-CoEHv_2r.js";import"./read-only-account-inspect-B0cm8yrv.js";import"./channel-selection-si1OzWyQ.js";import"./plugin-auto-enable-CTgkkJK7.js";import"./send-DmHpf5Fz.js";import"./outbound-attachment-9-8VNvRG.js";import"./delivery-queue-CKbauSFq.js";import"./send-AQ3CJLpI.js";import"./channel-activity-Dw6F-ehJ.js";import"./tables-fl9iXahm.js";import"./fetch-Bn0mWg6a.js";import"./skill-commands-DlHVddAk.js";import"./workspace-dirs-BhF1Dzxt.js";import"./pairing-token-B8RdfK2y.js";import"./restart-BeJuoXCx.js";import"./runtime-web-tools-C4F6aaRh.js";import"./command-secret-targets-CfXtLkLF.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-smZlFWxD.js";import"./onboard-helpers-D90u4wVK.js";import"./prompt-style-CXKekIBY.js";import"./pairing-labels-PIuZfthz.js";import"./memory-cli-BouV_wyL.js";import"./query-expansion-0OxEb1Io.js";import"./manager-CI6O4QH6.js";import"./links-CySwdMcF.js";import"./cli-utils-BY7dLMFy.js";import"./help-format-BRbF_INg.js";import"./progress-LNttnI-y.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-8nRBsfID.js";import"./system-run-command-E8ymBXHh.js";import"./runtime-DYttInEE.js";import"./stagger-DmFYysrJ.js";import{c as g,l as _,r as v,s as y}from"./push-apns-BBv62ncV.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-C5XF2Fy5.js";import"./utils-UGOV_184.js";import{Jn as t,qs as n}from"./model-selection-BLbnMb5E.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-mWIMy_ju.js";import"./agent-scope-DXZc3eNT.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-D7wNuBx1.js";import"./env-overrides-DXJbFrwI.js";import"./registry-hFAtCSWG.js";import"./skills-CzUpDbU-.js";import"./frontmatter-BkZkwkVO.js";import{r as m}from"./plugins-CYLrFT4h.js";import"./logger-Bl8URnrW.js";import"./exec-DHqLtFYt.js";import"./windows-spawn-AB7ItGAE.js";import"./redact-3_CiXMY6.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-Bunti32V.js";import"./send-C7rOdjPO.js";import"./send-BwblpWbK.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-BwjMhAUa.js";import"./image-BP1cfEh1.js";import"./models-config-BlQ39qlq.js";import"./tool-display-DjuSUUbH.js";import"./fetch-guard-7BAwnP4a.js";import"./api-key-rotation-Rz2ESQSA.js";import"./local-roots-aA-4ohTq.js";import"./model-catalog-D-hkNWin.js";import"./proxy-fetch-BADsUK4d.js";import"./tokens-XGbQGn67.js";import{t as h}from"./deliver-DUNkj4hy.js";import"./commands-CGpM84iR.js";import"./commands-registry-DlvNUkXz.js";import"./pairing-store-EmfFQVcs.js";import"./fetch-Dikjvc5M.js";import"./call-JB-cGR9n.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-BEZszppF.js";import"./send-NbU9-scF2.js";import"./pi-model-discovery-DnJkNRc-.js";import"./exec-approvals-allowlist-B-Yf6RsU.js";import"./exec-safe-bin-runtime-policy-CRPHdPbF.js";import"./ir-CNTx85qV.js";import"./render-D8OWO2hT.js";import"./target-errors-CoEHv_2r.js";import"./read-only-account-inspect-B0cm8yrv.js";import"./channel-selection-si1OzWyQ.js";import"./plugin-auto-enable-CTgkkJK7.js";import"./send-DmHpf5Fz.js";import"./outbound-attachment-9-8VNvRG.js";import"./delivery-queue-CKbauSFq.js";import"./send-AQ3CJLpI.js";import"./channel-activity-Dw6F-ehJ.js";import"./tables-fl9iXahm.js";import"./fetch-Bn0mWg6a.js";import"./skill-commands-DlHVddAk.js";import"./workspace-dirs-BhF1Dzxt.js";import"./pairing-token-B8RdfK2y.js";import"./restart-BeJuoXCx.js";import"./runtime-web-tools-C4F6aaRh.js";import"./command-secret-targets-CfXtLkLF.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-smZlFWxD.js";import"./onboard-helpers-D90u4wVK.js";import"./prompt-style-CXKekIBY.js";import"./pairing-labels-PIuZfthz.js";import"./memory-cli-BouV_wyL.js";import"./query-expansion-0OxEb1Io.js";import"./manager-CI6O4QH6.js";import"./links-CySwdMcF.js";import"./cli-utils-BY7dLMFy.js";import"./help-format-BRbF_INg.js";import"./progress-LNttnI-y.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-8nRBsfID.js";import"./system-run-command-E8ymBXHh.js";import"./runtime-DYttInEE.js";import"./stagger-DmFYysrJ.js";import{c as g,l as _,r as v,s as y}from"./push-apns-BfTKAzRZ.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{p as e}from"./subsystem-BLbY429l.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{Lt as t,jo as n}from"./auth-profiles-C8rZRS0X.js";import"./agent-scope-DAWJwFfl.js";import{l as r,p as i}from"./session-key-C7F_iqYg.js";import"./utils-CGdo13HV.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-Bz_S4lPh.js";import"./frontmatter-C7mzDNxd.js";import{r as a}from"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-6SQWM9dj.js";import"./send-vNcod64S.js";import"./send-CyarIb2w.js";import{Cn as o,O as s,bt as c,sr as l,st as u,w as d}from"./compact-CYbPi7_-.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-DZzS67GS.js";import"./tokens-DRM8vzJx.js";import"./with-timeout-c1CzdShT.js";import{t as f}from"./deliver-SqSusZP3.js";import"./diagnostic-D1H7_8QG.js";import"./send-Dj7NBAWg.js";import"./pi-model-discovery-BPkhPDMr.js";import"./exec-approvals-allowlist-CGjRWREs.js";import"./exec-safe-bin-runtime-policy-v44u39fl.js";import"./model-catalog-mt0IcDfR.js";import"./fetch-B4bz67_N.js";import"./audio-transcription-runner-BIKj1CBU.js";import"./fetch-guard-DaZmvp-L.js";import"./image-BVbOr9yV.js";import"./tool-display-DJDtttQg.js";import"./api-key-rotation-BpEL4aeX.js";import"./proxy-fetch-gWETR3cl.js";import"./ir-DdjufzKF.js";import"./render-DrrPmnMI.js";import"./target-errors-D6wejRd6.js";import"./commands-Dy7duWlt.js";import"./commands-registry-DT6FDUev.js";import"./session-cost-usage-CHtVgnE8.js";import{c as p,o as m,s as h}from"./session-utils-Bpdyx2A2.js";import"./sqlite-CILF3z9U.js";import"./call-BWx7hNtl.js";import"./pi-tools.policy-B6q8YOfg.js";import"./pairing-store-BaaVy1zB.js";import"./fetch-Dh-apy46.js";import"./skill-commands-DCqPy_Aa.js";import"./workspace-dirs-A8Vib9_B.js";import"./pairing-token-zdbQ951y.js";import"./channel-activity-BhiLsKvM.js";import"./tables-DENKrP-W.js";import"./kill-tree-D6nPx1_o.js";import"./runtime-web-tools-BYhCkBV8.js";import"./runtime-CK7gqwEF.js";import"./node-shell-BVZylVP6.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-BPxE8JR7.js";import"./plugin-auto-enable-adba5Evb.js";import"./send-ChILboDj.js";import"./outbound-attachment-CVcDBkAD.js";import"./delivery-queue-nkPJu0fY.js";import"./send-COpehmAB.js";import"./system-run-command-DsWBVvSK.js";import"./fetch-Ce-scEU-.js";import"./command-secret-targets-BEjtBf5Z.js";import"./connection-auth-CjaeEu5D.js";import"./onboard-helpers-DOlI17Ac.js";import"./prompt-style-BThRSQJR.js";import"./pairing-labels-CZ-aX-up.js";import"./search-manager-CV2YsAym.js";import"./manager-CxZRoQkE.js";import"./memory-cli-C8fBBPgv.js";import"./links-CBnmRP9D.js";import"./cli-utils-BleB1eys.js";import"./help-format-B4aEI7V9.js";import"./progress-d1m2sqR1.js";import"./exec-approvals-BXO9Cezj.js";import{c as g,l as _,r as v,s as y}from"./push-apns-DIV5dBPP.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-BLbY429l.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{Lt as t,jo as n}from"./auth-profiles-C8rZRS0X.js";import"./agent-scope-DAWJwFfl.js";import{l as r,p as i}from"./session-key-C7F_iqYg.js";import"./utils-CGdo13HV.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-Bz_S4lPh.js";import"./frontmatter-C7mzDNxd.js";import{r as a}from"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-6SQWM9dj.js";import"./send-vNcod64S.js";import"./send-CyarIb2w.js";import{Cn as o,O as s,bt as c,sr as l,st as u,w as d}from"./compact-uyQDx8pN.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-DZzS67GS.js";import"./tokens-DRM8vzJx.js";import"./with-timeout-c1CzdShT.js";import{t as f}from"./deliver-SqSusZP3.js";import"./diagnostic-D1H7_8QG.js";import"./send-Dj7NBAWg.js";import"./pi-model-discovery-BPkhPDMr.js";import"./exec-approvals-allowlist-CGjRWREs.js";import"./exec-safe-bin-runtime-policy-v44u39fl.js";import"./model-catalog-mt0IcDfR.js";import"./fetch-B4bz67_N.js";import"./audio-transcription-runner-BIKj1CBU.js";import"./fetch-guard-DaZmvp-L.js";import"./image-BVbOr9yV.js";import"./tool-display-DJDtttQg.js";import"./api-key-rotation-BpEL4aeX.js";import"./proxy-fetch-gWETR3cl.js";import"./ir-DdjufzKF.js";import"./render-DrrPmnMI.js";import"./target-errors-D6wejRd6.js";import"./commands-Dy7duWlt.js";import"./commands-registry-DT6FDUev.js";import"./session-cost-usage-CHtVgnE8.js";import{c as p,o as m,s as h}from"./session-utils-Bpdyx2A2.js";import"./sqlite-CILF3z9U.js";import"./call-BWx7hNtl.js";import"./pi-tools.policy-B6q8YOfg.js";import"./pairing-store-BaaVy1zB.js";import"./fetch-Dh-apy46.js";import"./skill-commands-DCqPy_Aa.js";import"./workspace-dirs-A8Vib9_B.js";import"./pairing-token-zdbQ951y.js";import"./channel-activity-BhiLsKvM.js";import"./tables-DENKrP-W.js";import"./kill-tree-D6nPx1_o.js";import"./runtime-web-tools-BYhCkBV8.js";import"./runtime-CK7gqwEF.js";import"./node-shell-BVZylVP6.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-BPxE8JR7.js";import"./plugin-auto-enable-adba5Evb.js";import"./send-ChILboDj.js";import"./outbound-attachment-CVcDBkAD.js";import"./delivery-queue-nkPJu0fY.js";import"./send-COpehmAB.js";import"./system-run-command-DsWBVvSK.js";import"./fetch-Ce-scEU-.js";import"./command-secret-targets-BEjtBf5Z.js";import"./connection-auth-CjaeEu5D.js";import"./onboard-helpers-DOlI17Ac.js";import"./prompt-style-BThRSQJR.js";import"./pairing-labels-CZ-aX-up.js";import"./search-manager-CV2YsAym.js";import"./manager-CxZRoQkE.js";import"./memory-cli-C8fBBPgv.js";import"./links-CBnmRP9D.js";import"./cli-utils-BleB1eys.js";import"./help-format-B4aEI7V9.js";import"./progress-d1m2sqR1.js";import"./exec-approvals-BXO9Cezj.js";import{c as g,l as _,r as v,s as y}from"./push-apns-CeY33Rxc.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-piJASC5k.js";import"./paths-BpQOWYiT.js";import"./logger-DwWqfo66.js";import{Gr as e}from"./model-selection-DvekK9rZ.js";import{E as t,N as n,i as r,l as i,r as a,y as o}from"./pi-embedded-6yGEd2xd.js";import"./github-copilot-token-wm6mbypz.js";import"./proxy-env-BNhTHkd_.js";import"./send-DiHS8tKf.js";import"./send-BjrfjBn9.js";import"./tokens-B2fq-rL6.js";import"./deliver-AM3FP5rj.js";import"./diagnostic-DtuQPRbp.js";import"./send-C4Lm4nmt.js";import"./pi-model-discovery-DVKXkQTR.js";import"./image-CcsuUB1B.js";import"./audio-transcription-runner-CQ7rq0d_.js";import"./fetch-D5wrJ0AX.js";import"./fetch-guard-oWKGrwV4.js";import"./api-key-rotation-BLt5E2Cw.js";import"./proxy-fetch-DnjU1fEB.js";import{m as s,s as c}from"./ir-B7mdG27k.js";import"./render-BXEUPIHe.js";import"./target-errors-sMFXKeAY.js";import"./commands-registry-gvMK7Pw9.js";import"./fetch-DHo17YmK.js";import"./skill-commands-CPZcaV8-.js";import"./channel-activity-DmgWmSAG.js";import"./tables-D6J-isob.js";import"./send-CWVTcDAW.js";import"./outbound-attachment-Bah4dvuM.js";import"./send-swTiQAeK2.js";import"./fetch-hy0JKSsm.js";import"./query-expansion-r_iXkNzt.js";import"./manager-iFi--Fru.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-piJASC5k.js";import"./paths-BpQOWYiT.js";import"./logger-DwWqfo66.js";import{Gr as e}from"./model-selection-DvekK9rZ.js";import{E as t,N as n,i as r,l as i,r as a,y as o}from"./pi-embedded-DLlQ5e_w.js";import"./github-copilot-token-wm6mbypz.js";import"./proxy-env-BNhTHkd_.js";import"./send-DiHS8tKf.js";import"./send-BjrfjBn9.js";import"./tokens-B2fq-rL6.js";import"./deliver-AM3FP5rj.js";import"./diagnostic-DtuQPRbp.js";import"./send-C4Lm4nmt.js";import"./pi-model-discovery-DVKXkQTR.js";import"./image-CcsuUB1B.js";import"./audio-transcription-runner-CQ7rq0d_.js";import"./fetch-D5wrJ0AX.js";import"./fetch-guard-oWKGrwV4.js";import"./api-key-rotation-BLt5E2Cw.js";import"./proxy-fetch-DnjU1fEB.js";import{m as s,s as c}from"./ir-B7mdG27k.js";import"./render-BXEUPIHe.js";import"./target-errors-sMFXKeAY.js";import"./commands-registry-gvMK7Pw9.js";import"./fetch-DHo17YmK.js";import"./skill-commands-CPZcaV8-.js";import"./channel-activity-DmgWmSAG.js";import"./tables-D6J-isob.js";import"./send-CWVTcDAW.js";import"./outbound-attachment-Bah4dvuM.js";import"./send-swTiQAeK2.js";import"./fetch-hy0JKSsm.js";import"./query-expansion-r_iXkNzt.js";import"./manager-iFi--Fru.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-CrCoPIVK.js";import"./paths-CChBdtE8.js";import"./subsystem-Bc2XrjUz.js";import"./workspace-B0ZQeHXg.js";import"./utils-D3t-vPka.js";import{Gr as e}from"./model-selection-D7mdJmGK.js";import"./github-copilot-token-DePP-lIf.js";import"./boolean-DypnRoRK.js";import"./proxy-env-DcmW_urA.js";import"./frontmatter-CzpfPBFl.js";import"./logger-5W0OocJW.js";import"./send-4h1tQwX3.js";import"./send-CciNyaWL.js";import{E as t,N as n,i as r,l as i,r as a,y as o}from"./pi-embedded-X_Svd4Wi.js";import"./tokens-CL2fSjGl.js";import"./deliver-BhWhLvQO.js";import"./diagnostic-VBPCgF9l.js";import"./send--9G8eXo4.js";import"./pi-model-discovery-BonZ1N3x.js";import"./image-BBO-0uLG.js";import"./audio-transcription-runner-9H9eUZ1D.js";import"./fetch-DBat25iG.js";import"./fetch-guard-DvaNcypz.js";import"./api-key-rotation-DayEfYpa.js";import"./proxy-fetch-BZ9O8Dvj.js";import{m as s,s as c}from"./ir-BTfsA9Dd.js";import"./render-CBsnn-2A.js";import"./target-errors-Dnkqss9y.js";import"./commands-registry-C5Hg7gyk.js";import"./fetch-_g8lZ8K8.js";import"./skill-commands-CtprBvm0.js";import"./channel-activity-htoVXTET.js";import"./tables-_t5V36m9.js";import"./send-hlES-kRl2.js";import"./outbound-attachment-E89zumcH.js";import"./send-7qgAI0ap.js";import"./fetch-BJT3BrkJ.js";import"./query-expansion-BUUx_oWg.js";import"./manager-CN_rQm1L.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-CrCoPIVK.js";import"./paths-CChBdtE8.js";import"./subsystem-Bc2XrjUz.js";import"./workspace-B0ZQeHXg.js";import"./utils-D3t-vPka.js";import{Gr as e}from"./model-selection-D7mdJmGK.js";import"./github-copilot-token-DePP-lIf.js";import"./boolean-DypnRoRK.js";import"./proxy-env-DcmW_urA.js";import"./frontmatter-CzpfPBFl.js";import"./logger-5W0OocJW.js";import"./send-4h1tQwX3.js";import"./send-CciNyaWL.js";import{E as t,N as n,i as r,l as i,r as a,y as o}from"./pi-embedded-CoHiJa9Q.js";import"./tokens-CL2fSjGl.js";import"./deliver-BhWhLvQO.js";import"./diagnostic-VBPCgF9l.js";import"./send--9G8eXo4.js";import"./pi-model-discovery-BonZ1N3x.js";import"./image-BBO-0uLG.js";import"./audio-transcription-runner-9H9eUZ1D.js";import"./fetch-DBat25iG.js";import"./fetch-guard-DvaNcypz.js";import"./api-key-rotation-DayEfYpa.js";import"./proxy-fetch-BZ9O8Dvj.js";import{m as s,s as c}from"./ir-BTfsA9Dd.js";import"./render-CBsnn-2A.js";import"./target-errors-Dnkqss9y.js";import"./commands-registry-C5Hg7gyk.js";import"./fetch-_g8lZ8K8.js";import"./skill-commands-CtprBvm0.js";import"./channel-activity-htoVXTET.js";import"./tables-_t5V36m9.js";import"./send-hlES-kRl2.js";import"./outbound-attachment-E89zumcH.js";import"./send-7qgAI0ap.js";import"./fetch-BJT3BrkJ.js";import"./query-expansion-BUUx_oWg.js";import"./manager-CN_rQm1L.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-C5XF2Fy5.js";import"./utils-UGOV_184.js";import{ri as e}from"./model-selection-BLbnMb5E.js";import{On as t,Vn as n,_n as r,bi as i,lt as a,vt as o}from"./reply-DwfVhea1.js";import"./agent-scope-DXZc3eNT.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import"./boolean-Ch3DfXPy.js";import"./env-D7wNuBx1.js";import"./env-overrides-DXJbFrwI.js";import"./registry-hFAtCSWG.js";import"./skills-CzUpDbU-.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CYLrFT4h.js";import"./logger-Bl8URnrW.js";import"./exec-DHqLtFYt.js";import"./windows-spawn-AB7ItGAE.js";import"./redact-3_CiXMY6.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-Bunti32V.js";import"./send-C7rOdjPO.js";import"./send-BwblpWbK.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-BwjMhAUa.js";import"./image-BP1cfEh1.js";import"./models-config-BlQ39qlq.js";import"./tool-display-DjuSUUbH.js";import"./fetch-guard-7BAwnP4a.js";import"./api-key-rotation-Rz2ESQSA.js";import"./local-roots-aA-4ohTq.js";import"./model-catalog-D-hkNWin.js";import"./proxy-fetch-BADsUK4d.js";import"./tokens-XGbQGn67.js";import"./deliver-DUNkj4hy.js";import"./commands-CGpM84iR.js";import"./commands-registry-DlvNUkXz.js";import"./pairing-store-EmfFQVcs.js";import"./fetch-Dikjvc5M.js";import"./call-JB-cGR9n.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-BEZszppF.js";import"./send-NbU9-scF2.js";import"./pi-model-discovery-DnJkNRc-.js";import"./exec-approvals-allowlist-B-Yf6RsU.js";import"./exec-safe-bin-runtime-policy-CRPHdPbF.js";import{m as s,s as c}from"./ir-CNTx85qV.js";import"./render-D8OWO2hT.js";import"./target-errors-CoEHv_2r.js";import"./read-only-account-inspect-B0cm8yrv.js";import"./channel-selection-si1OzWyQ.js";import"./plugin-auto-enable-CTgkkJK7.js";import"./send-DmHpf5Fz.js";import"./outbound-attachment-9-8VNvRG.js";import"./delivery-queue-CKbauSFq.js";import"./send-AQ3CJLpI.js";import"./channel-activity-Dw6F-ehJ.js";import"./tables-fl9iXahm.js";import"./fetch-Bn0mWg6a.js";import"./skill-commands-DlHVddAk.js";import"./workspace-dirs-BhF1Dzxt.js";import"./pairing-token-B8RdfK2y.js";import"./restart-BeJuoXCx.js";import"./runtime-web-tools-C4F6aaRh.js";import"./command-secret-targets-CfXtLkLF.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-smZlFWxD.js";import"./onboard-helpers-D90u4wVK.js";import"./prompt-style-CXKekIBY.js";import"./pairing-labels-PIuZfthz.js";import"./memory-cli-BouV_wyL.js";import"./query-expansion-0OxEb1Io.js";import"./manager-CI6O4QH6.js";import"./links-CySwdMcF.js";import"./cli-utils-BY7dLMFy.js";import"./help-format-BRbF_INg.js";import"./progress-LNttnI-y.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-8nRBsfID.js";import"./system-run-command-E8ymBXHh.js";import"./runtime-DYttInEE.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-C5XF2Fy5.js";import"./utils-UGOV_184.js";import{ri as e}from"./model-selection-BLbnMb5E.js";import{On as t,Vn as n,_n as r,bi as i,lt as a,vt as o}from"./reply-mWIMy_ju.js";import"./agent-scope-DXZc3eNT.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import"./boolean-Ch3DfXPy.js";import"./env-D7wNuBx1.js";import"./env-overrides-DXJbFrwI.js";import"./registry-hFAtCSWG.js";import"./skills-CzUpDbU-.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CYLrFT4h.js";import"./logger-Bl8URnrW.js";import"./exec-DHqLtFYt.js";import"./windows-spawn-AB7ItGAE.js";import"./redact-3_CiXMY6.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-Bunti32V.js";import"./send-C7rOdjPO.js";import"./send-BwblpWbK.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-BwjMhAUa.js";import"./image-BP1cfEh1.js";import"./models-config-BlQ39qlq.js";import"./tool-display-DjuSUUbH.js";import"./fetch-guard-7BAwnP4a.js";import"./api-key-rotation-Rz2ESQSA.js";import"./local-roots-aA-4ohTq.js";import"./model-catalog-D-hkNWin.js";import"./proxy-fetch-BADsUK4d.js";import"./tokens-XGbQGn67.js";import"./deliver-DUNkj4hy.js";import"./commands-CGpM84iR.js";import"./commands-registry-DlvNUkXz.js";import"./pairing-store-EmfFQVcs.js";import"./fetch-Dikjvc5M.js";import"./call-JB-cGR9n.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-BEZszppF.js";import"./send-NbU9-scF2.js";import"./pi-model-discovery-DnJkNRc-.js";import"./exec-approvals-allowlist-B-Yf6RsU.js";import"./exec-safe-bin-runtime-policy-CRPHdPbF.js";import{m as s,s as c}from"./ir-CNTx85qV.js";import"./render-D8OWO2hT.js";import"./target-errors-CoEHv_2r.js";import"./read-only-account-inspect-B0cm8yrv.js";import"./channel-selection-si1OzWyQ.js";import"./plugin-auto-enable-CTgkkJK7.js";import"./send-DmHpf5Fz.js";import"./outbound-attachment-9-8VNvRG.js";import"./delivery-queue-CKbauSFq.js";import"./send-AQ3CJLpI.js";import"./channel-activity-Dw6F-ehJ.js";import"./tables-fl9iXahm.js";import"./fetch-Bn0mWg6a.js";import"./skill-commands-DlHVddAk.js";import"./workspace-dirs-BhF1Dzxt.js";import"./pairing-token-B8RdfK2y.js";import"./restart-BeJuoXCx.js";import"./runtime-web-tools-C4F6aaRh.js";import"./command-secret-targets-CfXtLkLF.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-smZlFWxD.js";import"./onboard-helpers-D90u4wVK.js";import"./prompt-style-CXKekIBY.js";import"./pairing-labels-PIuZfthz.js";import"./memory-cli-BouV_wyL.js";import"./query-expansion-0OxEb1Io.js";import"./manager-CI6O4QH6.js";import"./links-CySwdMcF.js";import"./cli-utils-BY7dLMFy.js";import"./help-format-BRbF_INg.js";import"./progress-LNttnI-y.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-8nRBsfID.js";import"./system-run-command-E8ymBXHh.js";import"./runtime-DYttInEE.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-BLbY429l.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{Gn as e}from"./auth-profiles-C8rZRS0X.js";import"./agent-scope-DAWJwFfl.js";import"./utils-CGdo13HV.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-Bz_S4lPh.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-6SQWM9dj.js";import"./send-vNcod64S.js";import"./send-CyarIb2w.js";import{G as t,In as n,R as r,f as i,gt as a,m as o}from"./compact-CYbPi7_-.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-DZzS67GS.js";import"./tokens-DRM8vzJx.js";import"./with-timeout-c1CzdShT.js";import"./deliver-SqSusZP3.js";import"./diagnostic-D1H7_8QG.js";import"./send-Dj7NBAWg.js";import"./pi-model-discovery-BPkhPDMr.js";import"./exec-approvals-allowlist-CGjRWREs.js";import"./exec-safe-bin-runtime-policy-v44u39fl.js";import"./model-catalog-mt0IcDfR.js";import"./fetch-B4bz67_N.js";import"./audio-transcription-runner-BIKj1CBU.js";import"./fetch-guard-DaZmvp-L.js";import"./image-BVbOr9yV.js";import"./tool-display-DJDtttQg.js";import"./api-key-rotation-BpEL4aeX.js";import"./proxy-fetch-gWETR3cl.js";import{m as s,s as c}from"./ir-DdjufzKF.js";import"./render-DrrPmnMI.js";import"./target-errors-D6wejRd6.js";import"./commands-Dy7duWlt.js";import"./commands-registry-DT6FDUev.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-Bpdyx2A2.js";import"./sqlite-CILF3z9U.js";import"./call-BWx7hNtl.js";import"./pi-tools.policy-B6q8YOfg.js";import"./pairing-store-BaaVy1zB.js";import"./fetch-Dh-apy46.js";import"./skill-commands-DCqPy_Aa.js";import"./workspace-dirs-A8Vib9_B.js";import"./pairing-token-zdbQ951y.js";import"./channel-activity-BhiLsKvM.js";import"./tables-DENKrP-W.js";import"./kill-tree-D6nPx1_o.js";import"./runtime-web-tools-BYhCkBV8.js";import"./runtime-CK7gqwEF.js";import"./node-shell-BVZylVP6.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-BPxE8JR7.js";import"./plugin-auto-enable-adba5Evb.js";import"./send-ChILboDj.js";import"./outbound-attachment-CVcDBkAD.js";import"./delivery-queue-nkPJu0fY.js";import"./send-COpehmAB.js";import"./system-run-command-DsWBVvSK.js";import"./fetch-Ce-scEU-.js";import"./command-secret-targets-BEjtBf5Z.js";import"./connection-auth-CjaeEu5D.js";import"./onboard-helpers-DOlI17Ac.js";import"./prompt-style-BThRSQJR.js";import"./pairing-labels-CZ-aX-up.js";import"./search-manager-CV2YsAym.js";import"./manager-CxZRoQkE.js";import"./memory-cli-C8fBBPgv.js";import"./links-CBnmRP9D.js";import"./cli-utils-BleB1eys.js";import"./help-format-B4aEI7V9.js";import"./progress-d1m2sqR1.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-BLbY429l.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{Gn as e}from"./auth-profiles-C8rZRS0X.js";import"./agent-scope-DAWJwFfl.js";import"./utils-CGdo13HV.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-Bz_S4lPh.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-6SQWM9dj.js";import"./send-vNcod64S.js";import"./send-CyarIb2w.js";import{G as t,In as n,R as r,f as i,gt as a,m as o}from"./compact-uyQDx8pN.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-DZzS67GS.js";import"./tokens-DRM8vzJx.js";import"./with-timeout-c1CzdShT.js";import"./deliver-SqSusZP3.js";import"./diagnostic-D1H7_8QG.js";import"./send-Dj7NBAWg.js";import"./pi-model-discovery-BPkhPDMr.js";import"./exec-approvals-allowlist-CGjRWREs.js";import"./exec-safe-bin-runtime-policy-v44u39fl.js";import"./model-catalog-mt0IcDfR.js";import"./fetch-B4bz67_N.js";import"./audio-transcription-runner-BIKj1CBU.js";import"./fetch-guard-DaZmvp-L.js";import"./image-BVbOr9yV.js";import"./tool-display-DJDtttQg.js";import"./api-key-rotation-BpEL4aeX.js";import"./proxy-fetch-gWETR3cl.js";import{m as s,s as c}from"./ir-DdjufzKF.js";import"./render-DrrPmnMI.js";import"./target-errors-D6wejRd6.js";import"./commands-Dy7duWlt.js";import"./commands-registry-DT6FDUev.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-Bpdyx2A2.js";import"./sqlite-CILF3z9U.js";import"./call-BWx7hNtl.js";import"./pi-tools.policy-B6q8YOfg.js";import"./pairing-store-BaaVy1zB.js";import"./fetch-Dh-apy46.js";import"./skill-commands-DCqPy_Aa.js";import"./workspace-dirs-A8Vib9_B.js";import"./pairing-token-zdbQ951y.js";import"./channel-activity-BhiLsKvM.js";import"./tables-DENKrP-W.js";import"./kill-tree-D6nPx1_o.js";import"./runtime-web-tools-BYhCkBV8.js";import"./runtime-CK7gqwEF.js";import"./node-shell-BVZylVP6.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-BPxE8JR7.js";import"./plugin-auto-enable-adba5Evb.js";import"./send-ChILboDj.js";import"./outbound-attachment-CVcDBkAD.js";import"./delivery-queue-nkPJu0fY.js";import"./send-COpehmAB.js";import"./system-run-command-DsWBVvSK.js";import"./fetch-Ce-scEU-.js";import"./command-secret-targets-BEjtBf5Z.js";import"./connection-auth-CjaeEu5D.js";import"./onboard-helpers-DOlI17Ac.js";import"./prompt-style-BThRSQJR.js";import"./pairing-labels-CZ-aX-up.js";import"./search-manager-CV2YsAym.js";import"./manager-CxZRoQkE.js";import"./memory-cli-C8fBBPgv.js";import"./links-CBnmRP9D.js";import"./cli-utils-BleB1eys.js";import"./help-format-B4aEI7V9.js";import"./progress-d1m2sqR1.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,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-BLbY429l.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-C8rZRS0X.js";import{t as y}from"./command-format-CLxIPuLR.js";import{d as b}from"./agent-scope-DAWJwFfl.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-DNlgeTTc.js";import{n as D}from"./exec-B3eleY5O.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-CYbPi7_-.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-Bpdyx2A2.js";import{n as B,t as re}from"./call-BWx7hNtl.js";import{b as V,v as H,y as U}from"./pi-tools.policy-B6q8YOfg.js";import{n as W}from"./format-relative-DkMjYy7z.js";import{a as ie}from"./skill-commands-DCqPy_Aa.js";import{r as G}from"./format-duration-C8AzNqKh.js";import{o as ae,s as oe}from"./command-secret-targets-BEjtBf5Z.js";import{C as se,g as ce}from"./onboard-helpers-DOlI17Ac.js";import{t as K}from"./search-manager-CV2YsAym.js";import{n as q}from"./progress-d1m2sqR1.js";import{t as le}from"./skills-status-DpSboPY1.js";import{t as ue}from"./issue-format-CN9PHzXY.js";import{t as de}from"./channels-status-issues-8eFrGKyf.js";import{c as fe,n as pe}from"./service-DZ9EbS15.js";import{t as me}from"./runtime-status-DszMjvJK.js";import{r as he,t as ge}from"./probe-auth-C5nWfMS9.js";import{t as _e}from"./diagnostics-Cdctg9K_.js";import{n as J,t as ve}from"./table-CR7TFMew.js";import{o as ye,t as be}from"./health-CIZFVJEG.js";import{a as xe,g as Se,m as Ce,n as we,t as Te}from"./channel-account-context-DAcarnqW.js";import{t as Ee}from"./audit-9I53EvMQ.js";import{t as De}from"./node-service-C0bl7jcZ.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-B_8Gumuc.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-BLbY429l.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-C8rZRS0X.js";import{t as y}from"./command-format-CLxIPuLR.js";import{d as b}from"./agent-scope-DAWJwFfl.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-DNlgeTTc.js";import{n as D}from"./exec-B3eleY5O.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-uyQDx8pN.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-Bpdyx2A2.js";import{n as B,t as re}from"./call-BWx7hNtl.js";import{b as V,v as H,y as U}from"./pi-tools.policy-B6q8YOfg.js";import{n as W}from"./format-relative-DkMjYy7z.js";import{a as ie}from"./skill-commands-DCqPy_Aa.js";import{r as G}from"./format-duration-C8AzNqKh.js";import{o as ae,s as oe}from"./command-secret-targets-BEjtBf5Z.js";import{C as se,g as ce}from"./onboard-helpers-DOlI17Ac.js";import{t as K}from"./search-manager-CV2YsAym.js";import{n as q}from"./progress-d1m2sqR1.js";import{t as le}from"./skills-status-DpSboPY1.js";import{t as ue}from"./issue-format-CN9PHzXY.js";import{t as de}from"./channels-status-issues-8eFrGKyf.js";import{c as fe,n as pe}from"./service-DZ9EbS15.js";import{t as me}from"./runtime-status-DszMjvJK.js";import{r as he,t as ge}from"./probe-auth-C5nWfMS9.js";import{t as _e}from"./diagnostics-Cdctg9K_.js";import{n as J,t as ve}from"./table-CR7TFMew.js";import{o as ye,t as be}from"./health-Dmtcw9K8.js";import{a as xe,g as Se,m as Ce,n as we,t as Te}from"./channel-account-context-DAcarnqW.js";import{t as Ee}from"./audit-9I53EvMQ.js";import{t as De}from"./node-service-C0bl7jcZ.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-B_8Gumuc.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-C5XF2Fy5.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-BLbnMb5E.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-DwfVhea1.js";import{d as P}from"./agent-scope-DXZc3eNT.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-CYLrFT4h.js";import{n as te}from"./exec-DHqLtFYt.js";import{c as z}from"./paths-yLEk_25I.js";import{n as B,t as ne}from"./call-JB-cGR9n.js";import{n as V,r as H,t as U}from"./read-only-account-inspect-B0cm8yrv.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-DlHVddAk.js";import{o as G,s as ae}from"./command-secret-targets-CfXtLkLF.js";import{C as oe,g as se}from"./onboard-helpers-D90u4wVK.js";import{r as ce}from"./memory-cli-BouV_wyL.js";import{n as K}from"./progress-LNttnI-y.js";import{t as le}from"./skills-status-D4Y1BJYL.js";import{t as ue}from"./issue-format-BtMzMXtZ.js";import{t as de}from"./channels-status-issues-PRgOT90w.js";import{c as fe,n as pe}from"./service-BtB9epJk.js";import{t as me}from"./runtime-status-CqFBmdRd.js";import{r as he,t as q}from"./probe-auth-x4OHS_wa.js";import{t as ge}from"./diagnostics-BgbeL9KE.js";import{n as J,t as _e}from"./table-CY440fI1.js";import{o as ve,t as ye}from"./health-B_-ZE5FK.js";import{a as be,g as xe,m as Se,n as Ce,t as we}from"./channel-account-context-BMPAMZEv.js";import{t as Te}from"./audit-BGsUfJzD.js";import{t as Ee}from"./node-service-BRfrNp8l.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-_2r0S6Re.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-C5XF2Fy5.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-BLbnMb5E.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-mWIMy_ju.js";import{d as P}from"./agent-scope-DXZc3eNT.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-CYLrFT4h.js";import{n as te}from"./exec-DHqLtFYt.js";import{c as z}from"./paths-yLEk_25I.js";import{n as B,t as ne}from"./call-JB-cGR9n.js";import{n as V,r as H,t as U}from"./read-only-account-inspect-B0cm8yrv.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-DlHVddAk.js";import{o as G,s as ae}from"./command-secret-targets-CfXtLkLF.js";import{C as oe,g as se}from"./onboard-helpers-D90u4wVK.js";import{r as ce}from"./memory-cli-BouV_wyL.js";import{n as K}from"./progress-LNttnI-y.js";import{t as le}from"./skills-status-D4Y1BJYL.js";import{t as ue}from"./issue-format-BtMzMXtZ.js";import{t as de}from"./channels-status-issues-PRgOT90w.js";import{c as fe,n as pe}from"./service-BtB9epJk.js";import{t as me}from"./runtime-status-CqFBmdRd.js";import{r as he,t as q}from"./probe-auth-x4OHS_wa.js";import{t as ge}from"./diagnostics-BgbeL9KE.js";import{n as J,t as _e}from"./table-CY440fI1.js";import{o as ve,t as ye}from"./health-2MbtCw6U.js";import{a as be,g as xe,m as Se,n as Ce,t as we}from"./channel-account-context-BMPAMZEv.js";import{t as Te}from"./audit-BGsUfJzD.js";import{t as Ee}from"./node-service-BRfrNp8l.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-_2r0S6Re.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"./subsystem-BLbY429l.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import"./auth-profiles-C8rZRS0X.js";import"./agent-scope-DAWJwFfl.js";import"./utils-CGdo13HV.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-Bz_S4lPh.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-6SQWM9dj.js";import"./send-vNcod64S.js";import"./send-CyarIb2w.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-CYbPi7_-.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-DZzS67GS.js";import"./tokens-DRM8vzJx.js";import"./with-timeout-c1CzdShT.js";import"./deliver-SqSusZP3.js";import"./diagnostic-D1H7_8QG.js";import"./send-Dj7NBAWg.js";import"./pi-model-discovery-BPkhPDMr.js";import"./exec-approvals-allowlist-CGjRWREs.js";import"./exec-safe-bin-runtime-policy-v44u39fl.js";import"./model-catalog-mt0IcDfR.js";import"./fetch-B4bz67_N.js";import"./audio-transcription-runner-BIKj1CBU.js";import"./fetch-guard-DaZmvp-L.js";import"./image-BVbOr9yV.js";import"./tool-display-DJDtttQg.js";import"./api-key-rotation-BpEL4aeX.js";import"./proxy-fetch-gWETR3cl.js";import"./ir-DdjufzKF.js";import"./render-DrrPmnMI.js";import"./target-errors-D6wejRd6.js";import"./commands-Dy7duWlt.js";import"./commands-registry-DT6FDUev.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-Bpdyx2A2.js";import"./sqlite-CILF3z9U.js";import"./call-BWx7hNtl.js";import"./pi-tools.policy-B6q8YOfg.js";import"./pairing-store-BaaVy1zB.js";import"./fetch-Dh-apy46.js";import"./skill-commands-DCqPy_Aa.js";import"./workspace-dirs-A8Vib9_B.js";import"./pairing-token-zdbQ951y.js";import"./channel-activity-BhiLsKvM.js";import"./tables-DENKrP-W.js";import"./kill-tree-D6nPx1_o.js";import"./runtime-web-tools-BYhCkBV8.js";import"./runtime-CK7gqwEF.js";import"./node-shell-BVZylVP6.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-BPxE8JR7.js";import"./plugin-auto-enable-adba5Evb.js";import"./send-ChILboDj.js";import"./outbound-attachment-CVcDBkAD.js";import"./delivery-queue-nkPJu0fY.js";import"./send-COpehmAB.js";import"./system-run-command-DsWBVvSK.js";import"./fetch-Ce-scEU-.js";import"./command-secret-targets-BEjtBf5Z.js";import"./connection-auth-CjaeEu5D.js";import"./onboard-helpers-DOlI17Ac.js";import"./prompt-style-BThRSQJR.js";import"./pairing-labels-CZ-aX-up.js";import"./search-manager-CV2YsAym.js";import"./manager-CxZRoQkE.js";import"./memory-cli-C8fBBPgv.js";import"./links-CBnmRP9D.js";import"./cli-utils-BleB1eys.js";import"./help-format-B4aEI7V9.js";import"./progress-d1m2sqR1.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-BLbY429l.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import"./auth-profiles-C8rZRS0X.js";import"./agent-scope-DAWJwFfl.js";import"./utils-CGdo13HV.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-Bz_S4lPh.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-6SQWM9dj.js";import"./send-vNcod64S.js";import"./send-CyarIb2w.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-uyQDx8pN.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-DZzS67GS.js";import"./tokens-DRM8vzJx.js";import"./with-timeout-c1CzdShT.js";import"./deliver-SqSusZP3.js";import"./diagnostic-D1H7_8QG.js";import"./send-Dj7NBAWg.js";import"./pi-model-discovery-BPkhPDMr.js";import"./exec-approvals-allowlist-CGjRWREs.js";import"./exec-safe-bin-runtime-policy-v44u39fl.js";import"./model-catalog-mt0IcDfR.js";import"./fetch-B4bz67_N.js";import"./audio-transcription-runner-BIKj1CBU.js";import"./fetch-guard-DaZmvp-L.js";import"./image-BVbOr9yV.js";import"./tool-display-DJDtttQg.js";import"./api-key-rotation-BpEL4aeX.js";import"./proxy-fetch-gWETR3cl.js";import"./ir-DdjufzKF.js";import"./render-DrrPmnMI.js";import"./target-errors-D6wejRd6.js";import"./commands-Dy7duWlt.js";import"./commands-registry-DT6FDUev.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-Bpdyx2A2.js";import"./sqlite-CILF3z9U.js";import"./call-BWx7hNtl.js";import"./pi-tools.policy-B6q8YOfg.js";import"./pairing-store-BaaVy1zB.js";import"./fetch-Dh-apy46.js";import"./skill-commands-DCqPy_Aa.js";import"./workspace-dirs-A8Vib9_B.js";import"./pairing-token-zdbQ951y.js";import"./channel-activity-BhiLsKvM.js";import"./tables-DENKrP-W.js";import"./kill-tree-D6nPx1_o.js";import"./runtime-web-tools-BYhCkBV8.js";import"./runtime-CK7gqwEF.js";import"./node-shell-BVZylVP6.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-BPxE8JR7.js";import"./plugin-auto-enable-adba5Evb.js";import"./send-ChILboDj.js";import"./outbound-attachment-CVcDBkAD.js";import"./delivery-queue-nkPJu0fY.js";import"./send-COpehmAB.js";import"./system-run-command-DsWBVvSK.js";import"./fetch-Ce-scEU-.js";import"./command-secret-targets-BEjtBf5Z.js";import"./connection-auth-CjaeEu5D.js";import"./onboard-helpers-DOlI17Ac.js";import"./prompt-style-BThRSQJR.js";import"./pairing-labels-CZ-aX-up.js";import"./search-manager-CV2YsAym.js";import"./manager-CxZRoQkE.js";import"./memory-cli-C8fBBPgv.js";import"./links-CBnmRP9D.js";import"./cli-utils-BleB1eys.js";import"./help-format-B4aEI7V9.js";import"./progress-d1m2sqR1.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 +1 @@
1
- import"./paths-CrCoPIVK.js";import"./paths-CChBdtE8.js";import"./subsystem-Bc2XrjUz.js";import"./workspace-B0ZQeHXg.js";import"./utils-D3t-vPka.js";import"./model-selection-D7mdJmGK.js";import"./github-copilot-token-DePP-lIf.js";import"./boolean-DypnRoRK.js";import"./proxy-env-DcmW_urA.js";import"./frontmatter-CzpfPBFl.js";import"./logger-5W0OocJW.js";import"./send-4h1tQwX3.js";import"./send-CciNyaWL.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-X_Svd4Wi.js";import"./tokens-CL2fSjGl.js";import"./deliver-BhWhLvQO.js";import"./diagnostic-VBPCgF9l.js";import"./send--9G8eXo4.js";import"./pi-model-discovery-BonZ1N3x.js";import"./image-BBO-0uLG.js";import"./audio-transcription-runner-9H9eUZ1D.js";import"./fetch-DBat25iG.js";import"./fetch-guard-DvaNcypz.js";import"./api-key-rotation-DayEfYpa.js";import"./proxy-fetch-BZ9O8Dvj.js";import"./ir-BTfsA9Dd.js";import"./render-CBsnn-2A.js";import"./target-errors-Dnkqss9y.js";import"./commands-registry-C5Hg7gyk.js";import"./fetch-_g8lZ8K8.js";import"./skill-commands-CtprBvm0.js";import"./channel-activity-htoVXTET.js";import"./tables-_t5V36m9.js";import"./send-hlES-kRl2.js";import"./outbound-attachment-E89zumcH.js";import"./send-7qgAI0ap.js";import"./fetch-BJT3BrkJ.js";import"./query-expansion-BUUx_oWg.js";import"./manager-CN_rQm1L.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-CrCoPIVK.js";import"./paths-CChBdtE8.js";import"./subsystem-Bc2XrjUz.js";import"./workspace-B0ZQeHXg.js";import"./utils-D3t-vPka.js";import"./model-selection-D7mdJmGK.js";import"./github-copilot-token-DePP-lIf.js";import"./boolean-DypnRoRK.js";import"./proxy-env-DcmW_urA.js";import"./frontmatter-CzpfPBFl.js";import"./logger-5W0OocJW.js";import"./send-4h1tQwX3.js";import"./send-CciNyaWL.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-CoHiJa9Q.js";import"./tokens-CL2fSjGl.js";import"./deliver-BhWhLvQO.js";import"./diagnostic-VBPCgF9l.js";import"./send--9G8eXo4.js";import"./pi-model-discovery-BonZ1N3x.js";import"./image-BBO-0uLG.js";import"./audio-transcription-runner-9H9eUZ1D.js";import"./fetch-DBat25iG.js";import"./fetch-guard-DvaNcypz.js";import"./api-key-rotation-DayEfYpa.js";import"./proxy-fetch-BZ9O8Dvj.js";import"./ir-BTfsA9Dd.js";import"./render-CBsnn-2A.js";import"./target-errors-Dnkqss9y.js";import"./commands-registry-C5Hg7gyk.js";import"./fetch-_g8lZ8K8.js";import"./skill-commands-CtprBvm0.js";import"./channel-activity-htoVXTET.js";import"./tables-_t5V36m9.js";import"./send-hlES-kRl2.js";import"./outbound-attachment-E89zumcH.js";import"./send-7qgAI0ap.js";import"./fetch-BJT3BrkJ.js";import"./query-expansion-BUUx_oWg.js";import"./manager-CN_rQm1L.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-piJASC5k.js";import"./paths-BpQOWYiT.js";import"./logger-DwWqfo66.js";import"./model-selection-DvekK9rZ.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-6yGEd2xd.js";import"./github-copilot-token-wm6mbypz.js";import"./proxy-env-BNhTHkd_.js";import"./send-DiHS8tKf.js";import"./send-BjrfjBn9.js";import"./tokens-B2fq-rL6.js";import"./deliver-AM3FP5rj.js";import"./diagnostic-DtuQPRbp.js";import"./send-C4Lm4nmt.js";import"./pi-model-discovery-DVKXkQTR.js";import"./image-CcsuUB1B.js";import"./audio-transcription-runner-CQ7rq0d_.js";import"./fetch-D5wrJ0AX.js";import"./fetch-guard-oWKGrwV4.js";import"./api-key-rotation-BLt5E2Cw.js";import"./proxy-fetch-DnjU1fEB.js";import"./ir-B7mdG27k.js";import"./render-BXEUPIHe.js";import"./target-errors-sMFXKeAY.js";import"./commands-registry-gvMK7Pw9.js";import"./fetch-DHo17YmK.js";import"./skill-commands-CPZcaV8-.js";import"./channel-activity-DmgWmSAG.js";import"./tables-D6J-isob.js";import"./send-CWVTcDAW.js";import"./outbound-attachment-Bah4dvuM.js";import"./send-swTiQAeK2.js";import"./fetch-hy0JKSsm.js";import"./query-expansion-r_iXkNzt.js";import"./manager-iFi--Fru.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-piJASC5k.js";import"./paths-BpQOWYiT.js";import"./logger-DwWqfo66.js";import"./model-selection-DvekK9rZ.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-DLlQ5e_w.js";import"./github-copilot-token-wm6mbypz.js";import"./proxy-env-BNhTHkd_.js";import"./send-DiHS8tKf.js";import"./send-BjrfjBn9.js";import"./tokens-B2fq-rL6.js";import"./deliver-AM3FP5rj.js";import"./diagnostic-DtuQPRbp.js";import"./send-C4Lm4nmt.js";import"./pi-model-discovery-DVKXkQTR.js";import"./image-CcsuUB1B.js";import"./audio-transcription-runner-CQ7rq0d_.js";import"./fetch-D5wrJ0AX.js";import"./fetch-guard-oWKGrwV4.js";import"./api-key-rotation-BLt5E2Cw.js";import"./proxy-fetch-DnjU1fEB.js";import"./ir-B7mdG27k.js";import"./render-BXEUPIHe.js";import"./target-errors-sMFXKeAY.js";import"./commands-registry-gvMK7Pw9.js";import"./fetch-DHo17YmK.js";import"./skill-commands-CPZcaV8-.js";import"./channel-activity-DmgWmSAG.js";import"./tables-D6J-isob.js";import"./send-CWVTcDAW.js";import"./outbound-attachment-Bah4dvuM.js";import"./send-swTiQAeK2.js";import"./fetch-hy0JKSsm.js";import"./query-expansion-r_iXkNzt.js";import"./manager-iFi--Fru.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-C5XF2Fy5.js";import"./utils-UGOV_184.js";import"./model-selection-BLbnMb5E.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-DwfVhea1.js";import"./agent-scope-DXZc3eNT.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import"./boolean-Ch3DfXPy.js";import"./env-D7wNuBx1.js";import"./env-overrides-DXJbFrwI.js";import"./registry-hFAtCSWG.js";import"./skills-CzUpDbU-.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CYLrFT4h.js";import"./logger-Bl8URnrW.js";import"./exec-DHqLtFYt.js";import"./windows-spawn-AB7ItGAE.js";import"./redact-3_CiXMY6.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-Bunti32V.js";import"./send-C7rOdjPO.js";import"./send-BwblpWbK.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-BwjMhAUa.js";import"./image-BP1cfEh1.js";import"./models-config-BlQ39qlq.js";import"./tool-display-DjuSUUbH.js";import"./fetch-guard-7BAwnP4a.js";import"./api-key-rotation-Rz2ESQSA.js";import"./local-roots-aA-4ohTq.js";import"./model-catalog-D-hkNWin.js";import"./proxy-fetch-BADsUK4d.js";import"./tokens-XGbQGn67.js";import"./deliver-DUNkj4hy.js";import"./commands-CGpM84iR.js";import"./commands-registry-DlvNUkXz.js";import"./pairing-store-EmfFQVcs.js";import"./fetch-Dikjvc5M.js";import"./call-JB-cGR9n.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-BEZszppF.js";import"./send-NbU9-scF2.js";import"./pi-model-discovery-DnJkNRc-.js";import"./exec-approvals-allowlist-B-Yf6RsU.js";import"./exec-safe-bin-runtime-policy-CRPHdPbF.js";import"./ir-CNTx85qV.js";import"./render-D8OWO2hT.js";import"./target-errors-CoEHv_2r.js";import"./read-only-account-inspect-B0cm8yrv.js";import"./channel-selection-si1OzWyQ.js";import"./plugin-auto-enable-CTgkkJK7.js";import"./send-DmHpf5Fz.js";import"./outbound-attachment-9-8VNvRG.js";import"./delivery-queue-CKbauSFq.js";import"./send-AQ3CJLpI.js";import"./channel-activity-Dw6F-ehJ.js";import"./tables-fl9iXahm.js";import"./fetch-Bn0mWg6a.js";import"./skill-commands-DlHVddAk.js";import"./workspace-dirs-BhF1Dzxt.js";import"./pairing-token-B8RdfK2y.js";import"./restart-BeJuoXCx.js";import"./runtime-web-tools-C4F6aaRh.js";import"./command-secret-targets-CfXtLkLF.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-smZlFWxD.js";import"./onboard-helpers-D90u4wVK.js";import"./prompt-style-CXKekIBY.js";import"./pairing-labels-PIuZfthz.js";import"./memory-cli-BouV_wyL.js";import"./query-expansion-0OxEb1Io.js";import"./manager-CI6O4QH6.js";import"./links-CySwdMcF.js";import"./cli-utils-BY7dLMFy.js";import"./help-format-BRbF_INg.js";import"./progress-LNttnI-y.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-8nRBsfID.js";import"./system-run-command-E8ymBXHh.js";import"./runtime-DYttInEE.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-C5XF2Fy5.js";import"./utils-UGOV_184.js";import"./model-selection-BLbnMb5E.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-mWIMy_ju.js";import"./agent-scope-DXZc3eNT.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import"./boolean-Ch3DfXPy.js";import"./env-D7wNuBx1.js";import"./env-overrides-DXJbFrwI.js";import"./registry-hFAtCSWG.js";import"./skills-CzUpDbU-.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CYLrFT4h.js";import"./logger-Bl8URnrW.js";import"./exec-DHqLtFYt.js";import"./windows-spawn-AB7ItGAE.js";import"./redact-3_CiXMY6.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-Bunti32V.js";import"./send-C7rOdjPO.js";import"./send-BwblpWbK.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-BwjMhAUa.js";import"./image-BP1cfEh1.js";import"./models-config-BlQ39qlq.js";import"./tool-display-DjuSUUbH.js";import"./fetch-guard-7BAwnP4a.js";import"./api-key-rotation-Rz2ESQSA.js";import"./local-roots-aA-4ohTq.js";import"./model-catalog-D-hkNWin.js";import"./proxy-fetch-BADsUK4d.js";import"./tokens-XGbQGn67.js";import"./deliver-DUNkj4hy.js";import"./commands-CGpM84iR.js";import"./commands-registry-DlvNUkXz.js";import"./pairing-store-EmfFQVcs.js";import"./fetch-Dikjvc5M.js";import"./call-JB-cGR9n.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-BEZszppF.js";import"./send-NbU9-scF2.js";import"./pi-model-discovery-DnJkNRc-.js";import"./exec-approvals-allowlist-B-Yf6RsU.js";import"./exec-safe-bin-runtime-policy-CRPHdPbF.js";import"./ir-CNTx85qV.js";import"./render-D8OWO2hT.js";import"./target-errors-CoEHv_2r.js";import"./read-only-account-inspect-B0cm8yrv.js";import"./channel-selection-si1OzWyQ.js";import"./plugin-auto-enable-CTgkkJK7.js";import"./send-DmHpf5Fz.js";import"./outbound-attachment-9-8VNvRG.js";import"./delivery-queue-CKbauSFq.js";import"./send-AQ3CJLpI.js";import"./channel-activity-Dw6F-ehJ.js";import"./tables-fl9iXahm.js";import"./fetch-Bn0mWg6a.js";import"./skill-commands-DlHVddAk.js";import"./workspace-dirs-BhF1Dzxt.js";import"./pairing-token-B8RdfK2y.js";import"./restart-BeJuoXCx.js";import"./runtime-web-tools-C4F6aaRh.js";import"./command-secret-targets-CfXtLkLF.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-smZlFWxD.js";import"./onboard-helpers-D90u4wVK.js";import"./prompt-style-CXKekIBY.js";import"./pairing-labels-PIuZfthz.js";import"./memory-cli-BouV_wyL.js";import"./query-expansion-0OxEb1Io.js";import"./manager-CI6O4QH6.js";import"./links-CySwdMcF.js";import"./cli-utils-BY7dLMFy.js";import"./help-format-BRbF_INg.js";import"./progress-LNttnI-y.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-8nRBsfID.js";import"./system-run-command-E8ymBXHh.js";import"./runtime-DYttInEE.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,4 +1,4 @@
1
- import{g as e,n as t,u as n}from"./paths-B4IRk3wi.js";import{A as r,p as i}from"./subsystem-C5XF2Fy5.js";import{h as a}from"./utils-UGOV_184.js";import{Zs as o,nc as s}from"./model-selection-BLbnMb5E.js";import{V as c}from"./reply-DwfVhea1.js";import"./agent-scope-DXZc3eNT.js";import{t as l}from"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import{n as u,r as d,t as f}from"./command-format-BbDT1tlm.js";import"./boolean-Ch3DfXPy.js";import"./env-D7wNuBx1.js";import"./env-overrides-DXJbFrwI.js";import"./registry-hFAtCSWG.js";import"./skills-CzUpDbU-.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CYLrFT4h.js";import"./logger-Bl8URnrW.js";import{t as p}from"./exec-DHqLtFYt.js";import"./windows-spawn-AB7ItGAE.js";import"./redact-3_CiXMY6.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-Bunti32V.js";import"./send-C7rOdjPO.js";import"./send-BwblpWbK.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-BwjMhAUa.js";import"./image-BP1cfEh1.js";import"./models-config-BlQ39qlq.js";import"./tool-display-DjuSUUbH.js";import"./fetch-guard-7BAwnP4a.js";import"./api-key-rotation-Rz2ESQSA.js";import"./local-roots-aA-4ohTq.js";import"./model-catalog-D-hkNWin.js";import"./proxy-fetch-BADsUK4d.js";import"./tokens-XGbQGn67.js";import"./deliver-DUNkj4hy.js";import"./commands-CGpM84iR.js";import"./commands-registry-DlvNUkXz.js";import"./pairing-store-EmfFQVcs.js";import"./fetch-Dikjvc5M.js";import"./call-JB-cGR9n.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-BEZszppF.js";import"./send-NbU9-scF2.js";import"./pi-model-discovery-DnJkNRc-.js";import"./exec-approvals-allowlist-B-Yf6RsU.js";import"./exec-safe-bin-runtime-policy-CRPHdPbF.js";import"./ir-CNTx85qV.js";import"./render-D8OWO2hT.js";import"./target-errors-CoEHv_2r.js";import"./read-only-account-inspect-B0cm8yrv.js";import"./channel-selection-si1OzWyQ.js";import"./plugin-auto-enable-CTgkkJK7.js";import"./send-DmHpf5Fz.js";import"./outbound-attachment-9-8VNvRG.js";import"./delivery-queue-CKbauSFq.js";import"./send-AQ3CJLpI.js";import"./channel-activity-Dw6F-ehJ.js";import"./tables-fl9iXahm.js";import"./fetch-Bn0mWg6a.js";import{r as m}from"./format-duration-D5AMtmHa.js";import"./skill-commands-DlHVddAk.js";import"./workspace-dirs-BhF1Dzxt.js";import"./pairing-token-B8RdfK2y.js";import"./restart-BeJuoXCx.js";import"./runtime-web-tools-C4F6aaRh.js";import"./command-secret-targets-CfXtLkLF.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-smZlFWxD.js";import"./onboard-helpers-D90u4wVK.js";import{n as h}from"./prompt-style-CXKekIBY.js";import"./pairing-labels-PIuZfthz.js";import"./memory-cli-BouV_wyL.js";import"./query-expansion-0OxEb1Io.js";import"./manager-CI6O4QH6.js";import{t as g}from"./links-CySwdMcF.js";import"./cli-utils-BY7dLMFy.js";import{t as _}from"./help-format-BRbF_INg.js";import"./progress-LNttnI-y.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-8nRBsfID.js";import"./system-run-command-E8ymBXHh.js";import"./runtime-DYttInEE.js";import"./stagger-DmFYysrJ.js";import{m as v,p as y,u as b}from"./arg-split-DE5RqDHq.js";import{n as x}from"./cmd-argv-BBT5l8AV.js";import{r as S}from"./runtime-guard-DFYBaYZS.js";import"./program-context-n-ovYq69.js";import"./skills-status-D4Y1BJYL.js";import{n as C}from"./command-options-Bq5nQxz6.js";import"./note-D4GAwgha.js";import"./install-safe-path-iesxijn2.js";import"./npm-pack-install-B23L-AtF.js";import"./skill-scanner-CUUF3Fvo.js";import"./installs-DzSskdtJ.js";import{n as ee}from"./issue-format-BtMzMXtZ.js";import"./channels-status-issues-PRgOT90w.js";import{r as w}from"./completion-cli-Bw_hBrlA.js";import"./daemon-install-plan.shared-BkwZgIAY.js";import"./gateway-install-token-Dt7hDXoR.js";import"./systemd-D7odsu4K.js";import{n as te}from"./service-BtB9epJk.js";import"./lifecycle-core-B1nrgJCw.js";import"./systemd-hints-CEQj6yrs.js";import{a as T,i as E,l as D,o as O,r as k}from"./daemon-cli-BdDHNRqp.js";import"./probe-auth-x4OHS_wa.js";import"./diagnostics-BgbeL9KE.js";import{n as A,t as j}from"./table-CY440fI1.js";import"./health-B_-ZE5FK.js";import"./control-ui-assets-BIa0GGDg.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-BMPAMZEv.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-DG-1TYYc.js";import{i as fe,n as pe,t as me}from"./status.update-_2r0S6Re.js";import"./logging-CbMVr2MA.js";import"./oauth-tls-preflight-ByNjbUR5.js";import{n as he,t as ge}from"./update-D9EwPybG.js";import"./doctor-config-flow-BVpr8-q9.js";import"./systemd-linger-C2MJD6KG.js";import"./health-format-VBr6LEpt.js";import{n as _e,t as ve}from"./prompt-select-styled-DolCW-_j.js";import{r as B,t as ye}from"./doctor-completion-C9CPhCor.js";import V from"node:os";import H from"node:path";import U from"node:fs/promises";import{spawn as be,spawnSync as xe}from"node:child_process";import{confirm as W,isCancel as G,spinner as Se}from"@clack/prompts";function K(e){let t=e?Number.parseInt(e,10)*1e3:void 0;return t!==void 0&&(Number.isNaN(t)||t<=0)?(i.error(`--timeout must be a positive integer (seconds)`),i.exit(1),null):t}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 S(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 e(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 l({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 p(e.argv,{cwd:e.cwd,timeoutMs:e.timeoutMs}),i=Date.now()-n,a=c(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:c(r.stdout,Ce),stderrTail:a}}async function Pe(e){if(!await a(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(e,t){let n=H.join(e,`openclaw.mjs`);if(!await a(n))return;let o=xe(J(),[n,`completion`,`--write-state`],{cwd:e,env:process.env,encoding:`utf-8`});if(o.error){t||i.log(r.warn(`Completion cache update failed: ${String(o.error)}`));return}if(o.status!==0&&!t){let e=(o.stderr??``).toString().trim(),t=e?` (${e})`:``;i.log(r.warn(`Completion cache update failed${t}.`))}}function Ie(){return async(e,t)=>{let n=await p(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(e){let t=K(e.timeout);if(t===null)return;let n=await Y(),a=await o(),s=a.valid?F(a.config.update?.channel):null,c=await I({root:n,timeoutMs:t??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(e.json){i.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?r.warn(`available · ${p}`):p}];i.log(r.heading(`OpenClaw update status`)),i.log(``),i.log(A({width:m,columns:[{key:`Item`,header:`Item`,minWidth:10},{key:`Value`,header:`Value`,flex:!0,minWidth:24}],rows:h}).trimEnd()),i.log(``);let g=me(c);g&&i.log(r.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(e){if(!e)return{progress:{},stop:()=>{}};let t=null;return{progress:{onStepStart:e=>{t=Se(),t.start(r.accent(Be(e)))},onStepComplete:e=>{if(!t)return;let n=Be(e),a=r.muted(`(${m(e.durationMs)})`),o=e.exitCode===0?r.success(`✓`):r.error(`✗`);if(t.stop(`${o} ${n} ${a}`),t=null,e.exitCode!==0&&e.stderrTail){let t=e.stderrTail.split(`
1
+ import{g as e,n as t,u as n}from"./paths-B4IRk3wi.js";import{A as r,p as i}from"./subsystem-C5XF2Fy5.js";import{h as a}from"./utils-UGOV_184.js";import{Zs as o,nc as s}from"./model-selection-BLbnMb5E.js";import{V as c}from"./reply-mWIMy_ju.js";import"./agent-scope-DXZc3eNT.js";import{t as l}from"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import{n as u,r as d,t as f}from"./command-format-BbDT1tlm.js";import"./boolean-Ch3DfXPy.js";import"./env-D7wNuBx1.js";import"./env-overrides-DXJbFrwI.js";import"./registry-hFAtCSWG.js";import"./skills-CzUpDbU-.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CYLrFT4h.js";import"./logger-Bl8URnrW.js";import{t as p}from"./exec-DHqLtFYt.js";import"./windows-spawn-AB7ItGAE.js";import"./redact-3_CiXMY6.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-Bunti32V.js";import"./send-C7rOdjPO.js";import"./send-BwblpWbK.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-BwjMhAUa.js";import"./image-BP1cfEh1.js";import"./models-config-BlQ39qlq.js";import"./tool-display-DjuSUUbH.js";import"./fetch-guard-7BAwnP4a.js";import"./api-key-rotation-Rz2ESQSA.js";import"./local-roots-aA-4ohTq.js";import"./model-catalog-D-hkNWin.js";import"./proxy-fetch-BADsUK4d.js";import"./tokens-XGbQGn67.js";import"./deliver-DUNkj4hy.js";import"./commands-CGpM84iR.js";import"./commands-registry-DlvNUkXz.js";import"./pairing-store-EmfFQVcs.js";import"./fetch-Dikjvc5M.js";import"./call-JB-cGR9n.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-BEZszppF.js";import"./send-NbU9-scF2.js";import"./pi-model-discovery-DnJkNRc-.js";import"./exec-approvals-allowlist-B-Yf6RsU.js";import"./exec-safe-bin-runtime-policy-CRPHdPbF.js";import"./ir-CNTx85qV.js";import"./render-D8OWO2hT.js";import"./target-errors-CoEHv_2r.js";import"./read-only-account-inspect-B0cm8yrv.js";import"./channel-selection-si1OzWyQ.js";import"./plugin-auto-enable-CTgkkJK7.js";import"./send-DmHpf5Fz.js";import"./outbound-attachment-9-8VNvRG.js";import"./delivery-queue-CKbauSFq.js";import"./send-AQ3CJLpI.js";import"./channel-activity-Dw6F-ehJ.js";import"./tables-fl9iXahm.js";import"./fetch-Bn0mWg6a.js";import{r as m}from"./format-duration-D5AMtmHa.js";import"./skill-commands-DlHVddAk.js";import"./workspace-dirs-BhF1Dzxt.js";import"./pairing-token-B8RdfK2y.js";import"./restart-BeJuoXCx.js";import"./runtime-web-tools-C4F6aaRh.js";import"./command-secret-targets-CfXtLkLF.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-smZlFWxD.js";import"./onboard-helpers-D90u4wVK.js";import{n as h}from"./prompt-style-CXKekIBY.js";import"./pairing-labels-PIuZfthz.js";import"./memory-cli-BouV_wyL.js";import"./query-expansion-0OxEb1Io.js";import"./manager-CI6O4QH6.js";import{t as g}from"./links-CySwdMcF.js";import"./cli-utils-BY7dLMFy.js";import{t as _}from"./help-format-BRbF_INg.js";import"./progress-LNttnI-y.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-8nRBsfID.js";import"./system-run-command-E8ymBXHh.js";import"./runtime-DYttInEE.js";import"./stagger-DmFYysrJ.js";import{m as v,p as y,u as b}from"./arg-split-DE5RqDHq.js";import{n as x}from"./cmd-argv-BBT5l8AV.js";import{r as S}from"./runtime-guard-DFYBaYZS.js";import"./program-context-C4vPkfWW.js";import"./skills-status-D4Y1BJYL.js";import{n as C}from"./command-options-Bq5nQxz6.js";import"./note-D4GAwgha.js";import"./install-safe-path-iesxijn2.js";import"./npm-pack-install-B23L-AtF.js";import"./skill-scanner-CUUF3Fvo.js";import"./installs-DzSskdtJ.js";import{n as ee}from"./issue-format-BtMzMXtZ.js";import"./channels-status-issues-PRgOT90w.js";import{r as w}from"./completion-cli-ByNU0Lbo.js";import"./daemon-install-plan.shared-BkwZgIAY.js";import"./gateway-install-token-Dt7hDXoR.js";import"./systemd-D7odsu4K.js";import{n as te}from"./service-BtB9epJk.js";import"./lifecycle-core-B1nrgJCw.js";import"./systemd-hints-CEQj6yrs.js";import{a as T,i as E,l as D,o as O,r as k}from"./daemon-cli-BdDHNRqp.js";import"./probe-auth-x4OHS_wa.js";import"./diagnostics-BgbeL9KE.js";import{n as A,t as j}from"./table-CY440fI1.js";import"./health-2MbtCw6U.js";import"./control-ui-assets-BIa0GGDg.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-BMPAMZEv.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-DZkN4otc.js";import{i as fe,n as pe,t as me}from"./status.update-_2r0S6Re.js";import"./logging-CbMVr2MA.js";import"./oauth-tls-preflight-ByNjbUR5.js";import{n as he,t as ge}from"./update-D9EwPybG.js";import"./doctor-config-flow-BVpr8-q9.js";import"./systemd-linger-C2MJD6KG.js";import"./health-format-VBr6LEpt.js";import{n as _e,t as ve}from"./prompt-select-styled-C-zw_5_b.js";import{r as B,t as ye}from"./doctor-completion-KLuf1f33.js";import V from"node:os";import H from"node:path";import U from"node:fs/promises";import{spawn as be,spawnSync as xe}from"node:child_process";import{confirm as W,isCancel as G,spinner as Se}from"@clack/prompts";function K(e){let t=e?Number.parseInt(e,10)*1e3:void 0;return t!==void 0&&(Number.isNaN(t)||t<=0)?(i.error(`--timeout must be a positive integer (seconds)`),i.exit(1),null):t}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 S(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 e(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 l({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 p(e.argv,{cwd:e.cwd,timeoutMs:e.timeoutMs}),i=Date.now()-n,a=c(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:c(r.stdout,Ce),stderrTail:a}}async function Pe(e){if(!await a(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(e,t){let n=H.join(e,`openclaw.mjs`);if(!await a(n))return;let o=xe(J(),[n,`completion`,`--write-state`],{cwd:e,env:process.env,encoding:`utf-8`});if(o.error){t||i.log(r.warn(`Completion cache update failed: ${String(o.error)}`));return}if(o.status!==0&&!t){let e=(o.stderr??``).toString().trim(),t=e?` (${e})`:``;i.log(r.warn(`Completion cache update failed${t}.`))}}function Ie(){return async(e,t)=>{let n=await p(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(e){let t=K(e.timeout);if(t===null)return;let n=await Y(),a=await o(),s=a.valid?F(a.config.update?.channel):null,c=await I({root:n,timeoutMs:t??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(e.json){i.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?r.warn(`available · ${p}`):p}];i.log(r.heading(`OpenClaw update status`)),i.log(``),i.log(A({width:m,columns:[{key:`Item`,header:`Item`,minWidth:10},{key:`Value`,header:`Value`,flex:!0,minWidth:24}],rows:h}).trimEnd()),i.log(``);let g=me(c);g&&i.log(r.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(e){if(!e)return{progress:{},stop:()=>{}};let t=null;return{progress:{onStepStart:e=>{t=Se(),t.start(r.accent(Be(e)))},onStepComplete:e=>{if(!t)return;let n=Be(e),a=r.muted(`(${m(e.durationMs)})`),o=e.exitCode===0?r.success(`✓`):r.error(`✗`);if(t.stop(`${o} ${n} ${a}`),t=null,e.exitCode!==0&&e.stderrTail){let t=e.stderrTail.split(`
2
2
  `).slice(-10);for(let e of t)e.trim()&&i.log(` ${r.error(e)}`)}}},stop:()=>{t&&=(t.stop(),null)}}}function Ue(e){return e===0?r.success(`✓`):e===null?r.warn(`?`):r.error(`✗`)}function We(e,t){if(t.json){i.log(JSON.stringify(e,null,2));return}let n=e.status===`ok`?r.success:e.status===`skipped`?r.warn:r.error;if(i.log(``),i.log(`${r.heading(`Update Result:`)} ${n(e.status.toUpperCase())}`),e.root&&i.log(` Root: ${r.muted(e.root)}`),e.reason&&i.log(` Reason: ${r.muted(e.reason)}`),e.before?.version||e.before?.sha){let t=e.before.version??e.before.sha?.slice(0,8)??``;i.log(` Before: ${r.muted(t)}`)}if(e.after?.version||e.after?.sha){let t=e.after.version??e.after.sha?.slice(0,8)??``;i.log(` After: ${r.muted(t)}`)}if(!t.hideSteps&&e.steps.length>0){i.log(``),i.log(r.heading(`Steps:`));for(let t of e.steps){let e=Ue(t.exitCode),n=r.muted(`(${m(t.durationMs)})`);if(i.log(` ${e} ${t.name} ${n}`),t.exitCode!==0&&t.stderrTail){let e=t.stderrTail.split(`
3
3
  `).slice(0,5);for(let t of e)t.trim()&&i.log(` ${r.error(t)}`)}}}let a=Ve(e);if(a.length>0){i.log(``),i.log(r.heading(`Recovery hints:`));for(let e of a)i.log(` - ${r.warn(e)}`)}i.log(``),i.log(`Total time: ${r.muted(m(e.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`:`${y(e.OPENCLAW_PROFILE)}.service`}function qe(e){return e.OPENCLAW_LAUNCHD_LABEL?.trim()||b(e.OPENCLAW_PROFILE)}function Je(e){return e.OPENCLAW_WINDOWS_TASK_NAME?.trim()||v(e.OPENCLAW_PROFILE)}async function Ye(e=process.env,n=t){let r=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.