@termix-it/cryptoclaw 1.0.0

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 (1222) hide show
  1. package/CHANGELOG.md +1615 -0
  2. package/LICENSE +21 -0
  3. package/README-header.png +0 -0
  4. package/README.md +331 -0
  5. package/assets/avatar-placeholder.svg +19 -0
  6. package/assets/chrome-extension/README.md +22 -0
  7. package/assets/chrome-extension/background.js +438 -0
  8. package/assets/chrome-extension/icons/icon128.png +0 -0
  9. package/assets/chrome-extension/icons/icon16.png +0 -0
  10. package/assets/chrome-extension/icons/icon32.png +0 -0
  11. package/assets/chrome-extension/icons/icon48.png +0 -0
  12. package/assets/chrome-extension/manifest.json +25 -0
  13. package/assets/chrome-extension/options.html +196 -0
  14. package/assets/chrome-extension/options.js +59 -0
  15. package/assets/dmg-background-small.png +0 -0
  16. package/assets/dmg-background.png +0 -0
  17. package/cryptoclaw.mjs +14 -0
  18. package/dist/accounts-BPjR5SyC.js +251 -0
  19. package/dist/accounts-CIGHxE7R.js +251 -0
  20. package/dist/acp-cli-DBWmJpUJ.js +924 -0
  21. package/dist/acp-cli-DG9nygBk.js +926 -0
  22. package/dist/agent-3MZVCC-N.js +702 -0
  23. package/dist/agent-IDE9krld.js +702 -0
  24. package/dist/agent-scope-DBl1We79.js +370 -0
  25. package/dist/agent-scope-DLfFOxP6.js +370 -0
  26. package/dist/agent-scope-e_oNRhGi.js +606 -0
  27. package/dist/archive-Dy3Ezb-5.js +85 -0
  28. package/dist/archive-iT9wNsml.js +85 -0
  29. package/dist/audit-Bj_dxNaD.js +1853 -0
  30. package/dist/audit-jaTyyQX1.js +1853 -0
  31. package/dist/auth-RTEHx2eI.js +192 -0
  32. package/dist/auth-health-BlspzqyF.js +149 -0
  33. package/dist/auth-health-CCM6Z3vK.js +149 -0
  34. package/dist/auth-phxCaFNX.js +192 -0
  35. package/dist/auth-profiles-DoD7YxsD.js +2939 -0
  36. package/dist/boolean-BsqeuxE6.js +30 -0
  37. package/dist/brew-CAcErcKz.js +46 -0
  38. package/dist/brew-CqnNFIkD.js +46 -0
  39. package/dist/build-info.json +5 -0
  40. package/dist/call-D2DXG0AC.js +278 -0
  41. package/dist/call-DqxlETxE.js +278 -0
  42. package/dist/canvas-host/a2ui/.bundle.hash +1 -0
  43. package/dist/canvas-host/a2ui/a2ui.bundle.js +17765 -0
  44. package/dist/canvas-host/a2ui/index.html +307 -0
  45. package/dist/channel-options-BHpXOBuP.js +32 -0
  46. package/dist/channel-options-DUkxROTo.js +62 -0
  47. package/dist/channel-selection-BdigfMZZ.js +51 -0
  48. package/dist/channel-selection-D7jFTFec.js +51 -0
  49. package/dist/channel-summary-CobMoKN6.js +1120 -0
  50. package/dist/channel-summary-DS0kcHm2.js +1120 -0
  51. package/dist/channels-cli-D7ZNRrq7.js +1414 -0
  52. package/dist/channels-cli-DBwffwqw.js +1413 -0
  53. package/dist/channels-status-issues-C2UGSPvH.js +18 -0
  54. package/dist/channels-status-issues-Dxmd7zYk.js +18 -0
  55. package/dist/chrome-CwbWzmh4.js +1973 -0
  56. package/dist/chrome-SVqOMFxA.js +1953 -0
  57. package/dist/clack-prompter-k_egRADS.js +92 -0
  58. package/dist/clack-prompter-nSmn5cZ2.js +92 -0
  59. package/dist/cli/daemon-cli.js +2 -0
  60. package/dist/cli-C9xiWnx9.js +86 -0
  61. package/dist/cli-D6C9z94O.js +88 -0
  62. package/dist/cli-utils-B7iQwCY5.js +43 -0
  63. package/dist/cli-utils-CgOu3WAB.js +43 -0
  64. package/dist/client-BaTYzXOU.js +1617 -0
  65. package/dist/client-N6zH1neq.js +1617 -0
  66. package/dist/command-format-9IsYy-9N.js +52 -0
  67. package/dist/command-format-B0bnyrEA.js +38 -0
  68. package/dist/command-format-n_udBm8l.js +52 -0
  69. package/dist/command-options-DL1PhuUF.js +33 -0
  70. package/dist/commands-Dpeoos11.js +230 -0
  71. package/dist/completion-cli-B5nR7jt8.js +434 -0
  72. package/dist/completion-cli-CZ8zPqPs.js +773 -0
  73. package/dist/config-DSpb2aMV.js +4916 -0
  74. package/dist/config-IwiWafT3.js +5657 -0
  75. package/dist/config-dQK4rbfx.js +4916 -0
  76. package/dist/config-guard-DwIb5Y-v.js +5719 -0
  77. package/dist/configure-7M9mLC4o.js +896 -0
  78. package/dist/configure-CivCcvkA.js +896 -0
  79. package/dist/constants-C2T4hQIk.js +65 -0
  80. package/dist/constants-DBvu3LzZ.js +65 -0
  81. package/dist/control-service-BXC31sNw.js +61 -0
  82. package/dist/control-service-lVzEzp9f.js +61 -0
  83. package/dist/control-ui/apple-touch-icon.png +0 -0
  84. package/dist/control-ui/assets/index-DQ-7PWhX.js +7553 -0
  85. package/dist/control-ui/assets/index-DQ-7PWhX.js.map +1 -0
  86. package/dist/control-ui/assets/index-nlpH70Eh.css +1 -0
  87. package/dist/control-ui/favicon-32.png +0 -0
  88. package/dist/control-ui/favicon.ico +0 -0
  89. package/dist/control-ui/favicon.svg +22 -0
  90. package/dist/control-ui/index.html +17 -0
  91. package/dist/cron-cli-DS8ytfYQ.js +455 -0
  92. package/dist/cron-cli-Djb3HUdz.js +457 -0
  93. package/dist/daemon-cli-KoaJ2nJX.js +758 -0
  94. package/dist/daemon-cli-ZQIKLvAO.js +758 -0
  95. package/dist/daemon-runtime-CHWbAfKs.js +517 -0
  96. package/dist/daemon-runtime-DEjUQVjL.js +517 -0
  97. package/dist/deliver-DVRzRmNN.js +2557 -0
  98. package/dist/deliver-OfX6bSYR.js +2587 -0
  99. package/dist/deliver-sPBfRlXT.js +2587 -0
  100. package/dist/deps-BSdWD2wF.js +27 -0
  101. package/dist/deps-CZOfeWEp.js +27 -0
  102. package/dist/devices-cli-DHSpDnCS.js +207 -0
  103. package/dist/devices-cli-b9iF_uOi.js +205 -0
  104. package/dist/directory-cli-D0dTuAem.js +247 -0
  105. package/dist/directory-cli-qniSxsHo.js +245 -0
  106. package/dist/dispatcher-DA3u3CwV.js +160 -0
  107. package/dist/dns-cli-C0JUNb9O.js +201 -0
  108. package/dist/dns-cli-DwwMpMuN.js +199 -0
  109. package/dist/docs-cli-BlFHCHDz.js +161 -0
  110. package/dist/docs-cli-BpSPrY3Y.js +160 -0
  111. package/dist/doctor-Da1XgFcW.js +2584 -0
  112. package/dist/doctor-qrtookj-.js +2585 -0
  113. package/dist/entry.js +1156 -0
  114. package/dist/env-B2Cd_6IS.js +32 -0
  115. package/dist/errors--S5IAxQx.js +1952 -0
  116. package/dist/exec-CLQSz0CI.js +246 -0
  117. package/dist/exec-CW_QjkBi.js +246 -0
  118. package/dist/exec-D7I5LU33.js +1099 -0
  119. package/dist/exec-approvals-CuXem6Li.js +1043 -0
  120. package/dist/exec-approvals-P7vwSw4O.js +1043 -0
  121. package/dist/exec-approvals-cli-Csgqkksl.js +386 -0
  122. package/dist/exec-approvals-cli-Dk4yHE2L.js +388 -0
  123. package/dist/extensionAPI.js +64497 -0
  124. package/dist/format-B7OjpGnt.js +34 -0
  125. package/dist/format-Dv1wz41T.js +34 -0
  126. package/dist/gateway-cli-CJ7H2DgV.js +17352 -0
  127. package/dist/gateway-cli-CrKl-bIH.js +17352 -0
  128. package/dist/gateway-rpc--CH0NWWR.js +28 -0
  129. package/dist/gateway-rpc-BPfCU2Vi.js +28 -0
  130. package/dist/github-copilot-auth-CcPEEb3Q.js +1190 -0
  131. package/dist/github-copilot-auth-h3beCc_l.js +1190 -0
  132. package/dist/github-copilot-token-C1sArkX4.js +103 -0
  133. package/dist/github-copilot-token-DL6Pou2p.js +103 -0
  134. package/dist/github-copilot-token-hMl1wyZp.js +103 -0
  135. package/dist/gmail-setup-utils-CnVYPhaQ.js +428 -0
  136. package/dist/gmail-setup-utils-pZ9NnOvB.js +428 -0
  137. package/dist/health-format-BcsR5dtU.js +1211 -0
  138. package/dist/health-format-Pl8qK65t.js +1212 -0
  139. package/dist/help-format-BzWwbeSF.js +17 -0
  140. package/dist/help-format-CUnac_bT.js +17 -0
  141. package/dist/helpers-5yebzF4C.js +25 -0
  142. package/dist/helpers-CQI-5xS9.js +25 -0
  143. package/dist/helpers-CzQjTUbz.js +10 -0
  144. package/dist/helpers-OUt4hxkS.js +10 -0
  145. package/dist/hooks/bundled/boot-md/HOOK.md +19 -0
  146. package/dist/hooks/bundled/command-logger/HOOK.md +122 -0
  147. package/dist/hooks/bundled/session-memory/HOOK.md +109 -0
  148. package/dist/hooks/bundled/soul-evil/HOOK.md +71 -0
  149. package/dist/hooks-cli-BKHTdsn4.js +1058 -0
  150. package/dist/hooks-cli-zkLY25DX.js +1060 -0
  151. package/dist/hooks-status-BETsyuUR.js +443 -0
  152. package/dist/hooks-status-nPgxLL-x.js +443 -0
  153. package/dist/image-BFNcQzKp.js +629 -0
  154. package/dist/image-CC_YKDB-.js +1421 -0
  155. package/dist/image-DAsWVn7Q.js +629 -0
  156. package/dist/index.js +5900 -0
  157. package/dist/installs-Byb3s_8P.js +425 -0
  158. package/dist/installs-CELeuogN.js +425 -0
  159. package/dist/is-main-B6kCyqsv.js +25 -0
  160. package/dist/is-main-CBExsRNQ.js +25 -0
  161. package/dist/links-Brcj2Oc-.js +15 -0
  162. package/dist/links-cf9h8BXu.js +15 -0
  163. package/dist/loader-CU4bkeKe.js +61131 -0
  164. package/dist/logging-5MtSkLpb.js +1 -0
  165. package/dist/logging-BJRQDTME.js +15 -0
  166. package/dist/logging-CD55MXc7.js +15 -0
  167. package/dist/logging-kuFzZMsG.js +1 -0
  168. package/dist/login-qr-BCr2GKX6.js +475 -0
  169. package/dist/login-qr-BMbekoZW.js +478 -0
  170. package/dist/login-qr-HIPJAnbT.js +478 -0
  171. package/dist/logs-cli-CM7-XOcZ.js +230 -0
  172. package/dist/logs-cli-aqjT7oHu.js +228 -0
  173. package/dist/manager-C5m5qpB0.js +2871 -0
  174. package/dist/manager-CtGvmGvM.js +2872 -0
  175. package/dist/manager-DpZlm3gk.js +2870 -0
  176. package/dist/manifest-registry-BdTzIlta.js +669 -0
  177. package/dist/manifest-registry-DVQHMj0y.js +669 -0
  178. package/dist/message-channel-CfYBy4y3.js +110 -0
  179. package/dist/message-channel-CvHWS3C2.js +110 -0
  180. package/dist/model-selection-Av0fLq51.js +2940 -0
  181. package/dist/model-selection-DuI_Ue9Q.js +2691 -0
  182. package/dist/models-cli-C0JOZ5oP.js +2541 -0
  183. package/dist/models-cli-gmkzOpbq.js +2543 -0
  184. package/dist/net-D4G66Xui.js +137 -0
  185. package/dist/net-YrbuVTd2.js +137 -0
  186. package/dist/node-cli-BND9LLkM.js +1457 -0
  187. package/dist/node-cli-DNRB94ib.js +1459 -0
  188. package/dist/node-service-DTgDFo7M.js +67 -0
  189. package/dist/node-service-JEBcPQat.js +67 -0
  190. package/dist/nodes-cli-BCWlqHyR.js +1208 -0
  191. package/dist/nodes-cli-DWSo5dX7.js +1210 -0
  192. package/dist/nodes-screen-CMvShBEB.js +157 -0
  193. package/dist/nodes-screen-Cok3-EJw.js +157 -0
  194. package/dist/note-C5M2AQOP.js +73 -0
  195. package/dist/note-DEz9ZK7G.js +73 -0
  196. package/dist/onboard-channels-B75LjjVZ.js +671 -0
  197. package/dist/onboard-channels-DJz2TusQ.js +671 -0
  198. package/dist/onboard-skills-ByHkU9nx.js +3615 -0
  199. package/dist/onboard-skills-Wknr7pxR.js +3615 -0
  200. package/dist/onboarding-BejDjkx5.js +3455 -0
  201. package/dist/openclaw-root-YSGWCNem.js +84 -0
  202. package/dist/openclaw-root-_zPXSqgo.js +84 -0
  203. package/dist/pairing-cli-CFqD3IdI.js +122 -0
  204. package/dist/pairing-cli-Cn5vt4oI.js +120 -0
  205. package/dist/pairing-store-BHzy16_t.js +391 -0
  206. package/dist/pairing-store-BOhO49Bi.js +391 -0
  207. package/dist/parse-BZz5lHzQ.js +23 -0
  208. package/dist/parse-Bw0oH-rT.js +23 -0
  209. package/dist/parse-log-line-BxDgv4Uo.js +44 -0
  210. package/dist/parse-log-line-CUrpqe1w.js +44 -0
  211. package/dist/parse-timeout-D1XX_zN_.js +16 -0
  212. package/dist/parse-timeout-Du-wHHNi.js +16 -0
  213. package/dist/path-env-DQ-mM2ya.js +77 -0
  214. package/dist/path-env-eQ-HoQtS.js +77 -0
  215. package/dist/paths-C3yk0MGu.js +43 -0
  216. package/dist/paths-C90k-Dud.js +166 -0
  217. package/dist/paths-CGrNQEMk.js +201 -0
  218. package/dist/paths-D2ytuv-2.js +201 -0
  219. package/dist/paths-Dlp4VNXa.js +40 -0
  220. package/dist/paths-KUslkJRs.js +43 -0
  221. package/dist/pi-embedded-helpers-B7ARjDEK.js +1298 -0
  222. package/dist/pi-embedded-helpers-CQ9sq3Uu.js +8475 -0
  223. package/dist/pi-embedded-helpers-FPVRDeKf.js +1298 -0
  224. package/dist/pi-model-discovery-DWTTaAgY.js +20 -0
  225. package/dist/pi-model-discovery-EhM2JAQo.js +20 -0
  226. package/dist/pi-model-discovery-EwKVHlZB.js +20 -0
  227. package/dist/pi-tools.policy-Du4RZy9R.js +230 -0
  228. package/dist/plugin-auto-enable-EBxTHjFJ.js +461 -0
  229. package/dist/plugin-auto-enable-RwRwIUKC.js +461 -0
  230. package/dist/plugin-sdk/index.d.ts +8453 -0
  231. package/dist/plugin-sdk/index.js +23445 -0
  232. package/dist/plugin-sdk/pi-model-discovery-Dw3A6oXH.js +37 -0
  233. package/dist/plugins-BI-p2ba9.js +495 -0
  234. package/dist/plugins-Dk4UBZwz.js +496 -0
  235. package/dist/plugins-cli-CMg0G56J.js +441 -0
  236. package/dist/plugins-cli-CX7QeUjq.js +443 -0
  237. package/dist/ports-nXmd4Efh.js +96 -0
  238. package/dist/program-EAMJAB_2.js +191 -0
  239. package/dist/progress-D-Oc-KAH.js +133 -0
  240. package/dist/progress-DTEUicRP.js +133 -0
  241. package/dist/prompt-style-BBlJlXtd.js +9 -0
  242. package/dist/prompt-style-BntC_Eoo.js +9 -0
  243. package/dist/prompts-C2D9_VZC.js +10 -0
  244. package/dist/prompts-FbZThK8w.js +10 -0
  245. package/dist/pw-ai-D2jD_dho.js +1651 -0
  246. package/dist/pw-ai-D6JUaD41.js +1650 -0
  247. package/dist/pw-ai-ba2bHPGA.js +1649 -0
  248. package/dist/qmd-manager-B-ijyM7o.js +615 -0
  249. package/dist/qmd-manager-C_Jah5eo.js +618 -0
  250. package/dist/qmd-manager-xo4abL0u.js +618 -0
  251. package/dist/redact-1PNP01B_.js +97 -0
  252. package/dist/redact-BIMJ3ntQ.js +94 -0
  253. package/dist/redact-CVRUv382.js +97 -0
  254. package/dist/register.subclis-CJGimm3-.js +348 -0
  255. package/dist/reply-DfepuqG0.js +61133 -0
  256. package/dist/rolldown-runtime-Cbj13DAv.js +20 -0
  257. package/dist/routes-DkckwrRx.js +2410 -0
  258. package/dist/routes-Q42qtNl1.js +2410 -0
  259. package/dist/rpc-B4lvrGrD.js +95 -0
  260. package/dist/rpc-CbWcXAQK.js +95 -0
  261. package/dist/run-main-JFY3X4Xh.js +194 -0
  262. package/dist/sandbox-BGqDfFaH.js +2945 -0
  263. package/dist/sandbox-D_Tt3WRq.js +2945 -0
  264. package/dist/sandbox-cli-CaxqKiTq.js +461 -0
  265. package/dist/sandbox-cli-DA0Cbrzl.js +463 -0
  266. package/dist/security-cli-BZjA_GAD.js +508 -0
  267. package/dist/security-cli-Ct-pfF2h.js +506 -0
  268. package/dist/server-context-B9ez46MY.js +740 -0
  269. package/dist/server-context-C53lhEx_.js +740 -0
  270. package/dist/server-node-events-Cb6QOeDH.js +218 -0
  271. package/dist/server-node-events-DONmQvJg.js +216 -0
  272. package/dist/service-C0ccl5rU.js +680 -0
  273. package/dist/service-audit-AsnhO40e.js +542 -0
  274. package/dist/service-audit-BM-iyLL7.js +542 -0
  275. package/dist/service-mrQPgOXl.js +680 -0
  276. package/dist/session-cost-usage-B3HzifR9.js +692 -0
  277. package/dist/session-cost-usage-DH3c4xJA.js +692 -0
  278. package/dist/session-key-C-ig2pxJ.js +177 -0
  279. package/dist/session-key-CYpWeuht.js +177 -0
  280. package/dist/shared-CBcCIWC0.js +74 -0
  281. package/dist/shared-CtNMbLRE.js +150 -0
  282. package/dist/shared-DCh7fkR2.js +150 -0
  283. package/dist/shared-Na5zjEUc.js +74 -0
  284. package/dist/skill-scanner-AfOudYI1.js +255 -0
  285. package/dist/skill-scanner-BoGjHXUZ.js +255 -0
  286. package/dist/skills-7V483a6m.js +693 -0
  287. package/dist/skills-CsZRBUj0.js +694 -0
  288. package/dist/skills-cli-DQaq5LBX.js +290 -0
  289. package/dist/skills-cli-dVugbaAb.js +288 -0
  290. package/dist/skills-status-4_4zVBvV.js +187 -0
  291. package/dist/skills-status-cD4rfMR9.js +187 -0
  292. package/dist/sqlite-C4DljFNL.js +215 -0
  293. package/dist/sqlite-CvQzxS7q.js +197 -0
  294. package/dist/sqlite-Dnmf3LS7.js +215 -0
  295. package/dist/status-BakhDLuG.js +27 -0
  296. package/dist/status-BqtiImKF.js +21 -0
  297. package/dist/status-DHPz4Mg_.js +3364 -0
  298. package/dist/status-DSoYX3Ep.js +27 -0
  299. package/dist/status-Drziap9H.js +21 -0
  300. package/dist/subsystem-Btuh5yZj.js +834 -0
  301. package/dist/system-cli-CUQswQPX.js +83 -0
  302. package/dist/system-cli-Cz7in_Xr.js +81 -0
  303. package/dist/systemd-CFHiVC1D.js +438 -0
  304. package/dist/systemd-hints-CgQqk98i.js +19 -0
  305. package/dist/systemd-hints-DKVCFZS3.js +19 -0
  306. package/dist/systemd-kY3NnWdi.js +438 -0
  307. package/dist/systemd-linger-CFK5jDdq.js +75 -0
  308. package/dist/systemd-linger-CxBBzOjC.js +75 -0
  309. package/dist/table-DAOPkdc_.js +279 -0
  310. package/dist/table-DDQGlZSe.js +279 -0
  311. package/dist/tailnet-CZq_ZSNX.js +42 -0
  312. package/dist/tailnet-D5wOWpOX.js +42 -0
  313. package/dist/tailscale-BY0igR48.js +252 -0
  314. package/dist/tailscale-CCLcQalf.js +225 -0
  315. package/dist/tool-display-B2rS2o6B.js +795 -0
  316. package/dist/tool-display-Zbh1CRw5.js +795 -0
  317. package/dist/transcript-events-BOK6eOU8.js +17 -0
  318. package/dist/transcript-events-D2kT5WSz.js +17 -0
  319. package/dist/transcript-events-JLH5W4He.js +17 -0
  320. package/dist/tui-DFVs6pRO.js +2672 -0
  321. package/dist/tui-cli-CBKZVd1C.js +58 -0
  322. package/dist/tui-cli-DexeJOgZ.js +56 -0
  323. package/dist/tui-qPHLsB-x.js +2672 -0
  324. package/dist/update-B2q3duJD.js +317 -0
  325. package/dist/update-DNnej3C6.js +317 -0
  326. package/dist/update-cli-BPUtZjbl.js +1031 -0
  327. package/dist/update-cli-ehTYbpaU.js +1032 -0
  328. package/dist/update-runner-BfncKnU6.js +1375 -0
  329. package/dist/update-runner-DAeygRSU.js +1375 -0
  330. package/dist/usage-format-C4JfTbSp.js +36 -0
  331. package/dist/usage-format-DvowRSs-.js +36 -0
  332. package/dist/utils-7IMqr8vR.js +189 -0
  333. package/dist/utils-D7jskKIf.js +192 -0
  334. package/dist/wallet-manager-7KHKMCbT.js +264 -0
  335. package/dist/wallet-manager-CT1ykq2O.js +264 -0
  336. package/dist/webhooks-cli-C0CV-1jG.js +310 -0
  337. package/dist/webhooks-cli-DT16BygW.js +312 -0
  338. package/dist/widearea-dns-BJZTAyT3.js +127 -0
  339. package/dist/widearea-dns-Dk82I4Xa.js +127 -0
  340. package/dist/ws-6_dFpKWQ.js +13 -0
  341. package/dist/ws-D64QKPe6.js +13 -0
  342. package/dist/ws-log-BhQmGM0R.js +267 -0
  343. package/dist/ws-log-DsyLcTqD.js +267 -0
  344. package/dist/wsl-C24YfxH9.js +160 -0
  345. package/docs/.i18n/README.md +31 -0
  346. package/docs/.i18n/glossary.zh-CN.json +210 -0
  347. package/docs/.i18n/zh-CN.tm.jsonl +1329 -0
  348. package/docs/CNAME +1 -0
  349. package/docs/assets/macos-onboarding/01-macos-warning.jpeg +0 -0
  350. package/docs/assets/macos-onboarding/02-local-networks.jpeg +0 -0
  351. package/docs/assets/macos-onboarding/03-security-notice.png +0 -0
  352. package/docs/assets/macos-onboarding/04-choose-gateway.png +0 -0
  353. package/docs/assets/macos-onboarding/05-permissions.png +0 -0
  354. package/docs/assets/openclaw-logo-text-dark.png +0 -0
  355. package/docs/assets/openclaw-logo-text.png +0 -0
  356. package/docs/assets/pixel-lobster.svg +60 -0
  357. package/docs/assets/showcase/agents-ui.jpg +0 -0
  358. package/docs/assets/showcase/bambu-cli.png +0 -0
  359. package/docs/assets/showcase/codexmonitor.png +0 -0
  360. package/docs/assets/showcase/gohome-grafana.png +0 -0
  361. package/docs/assets/showcase/ios-testflight.jpg +0 -0
  362. package/docs/assets/showcase/oura-health.png +0 -0
  363. package/docs/assets/showcase/padel-cli.svg +11 -0
  364. package/docs/assets/showcase/padel-screenshot.jpg +0 -0
  365. package/docs/assets/showcase/papla-tts.jpg +0 -0
  366. package/docs/assets/showcase/pr-review-telegram.jpg +0 -0
  367. package/docs/assets/showcase/roborock-screenshot.jpg +0 -0
  368. package/docs/assets/showcase/roborock-status.svg +13 -0
  369. package/docs/assets/showcase/roof-camera-sky.jpg +0 -0
  370. package/docs/assets/showcase/snag.png +0 -0
  371. package/docs/assets/showcase/tesco-shop.jpg +0 -0
  372. package/docs/assets/showcase/wienerlinien.png +0 -0
  373. package/docs/assets/showcase/wine-cellar-skill.jpg +0 -0
  374. package/docs/assets/showcase/winix-air-purifier.jpg +0 -0
  375. package/docs/assets/showcase/xuezh-pronunciation.jpeg +0 -0
  376. package/docs/automation/auth-monitoring.md +44 -0
  377. package/docs/automation/cron-jobs.md +468 -0
  378. package/docs/automation/cron-vs-heartbeat.md +282 -0
  379. package/docs/automation/gmail-pubsub.md +256 -0
  380. package/docs/automation/poll.md +69 -0
  381. package/docs/automation/webhook.md +163 -0
  382. package/docs/bedrock.md +176 -0
  383. package/docs/brave-search.md +41 -0
  384. package/docs/broadcast-groups.md +442 -0
  385. package/docs/channels/bluebubbles.md +338 -0
  386. package/docs/channels/discord.md +476 -0
  387. package/docs/channels/feishu.md +577 -0
  388. package/docs/channels/googlechat.md +250 -0
  389. package/docs/channels/grammy.md +31 -0
  390. package/docs/channels/imessage.md +299 -0
  391. package/docs/channels/index.md +46 -0
  392. package/docs/channels/line.md +186 -0
  393. package/docs/channels/location.md +56 -0
  394. package/docs/channels/matrix.md +233 -0
  395. package/docs/channels/mattermost.md +138 -0
  396. package/docs/channels/msteams.md +768 -0
  397. package/docs/channels/nextcloud-talk.md +136 -0
  398. package/docs/channels/nostr.md +233 -0
  399. package/docs/channels/signal.md +202 -0
  400. package/docs/channels/slack.md +548 -0
  401. package/docs/channels/telegram.md +769 -0
  402. package/docs/channels/tlon.md +132 -0
  403. package/docs/channels/troubleshooting.md +29 -0
  404. package/docs/channels/twitch.md +379 -0
  405. package/docs/channels/whatsapp.md +404 -0
  406. package/docs/channels/zalo.md +189 -0
  407. package/docs/channels/zalouser.md +140 -0
  408. package/docs/cli/acp.md +170 -0
  409. package/docs/cli/agent.md +24 -0
  410. package/docs/cli/agents.md +75 -0
  411. package/docs/cli/approvals.md +50 -0
  412. package/docs/cli/browser.md +107 -0
  413. package/docs/cli/channels.md +79 -0
  414. package/docs/cli/config.md +50 -0
  415. package/docs/cli/configure.md +33 -0
  416. package/docs/cli/cron.md +42 -0
  417. package/docs/cli/dashboard.md +16 -0
  418. package/docs/cli/devices.md +70 -0
  419. package/docs/cli/directory.md +63 -0
  420. package/docs/cli/dns.md +23 -0
  421. package/docs/cli/docs.md +15 -0
  422. package/docs/cli/doctor.md +41 -0
  423. package/docs/cli/gateway.md +202 -0
  424. package/docs/cli/health.md +21 -0
  425. package/docs/cli/hooks.md +304 -0
  426. package/docs/cli/index.md +1031 -0
  427. package/docs/cli/logs.md +24 -0
  428. package/docs/cli/memory.md +45 -0
  429. package/docs/cli/message.md +239 -0
  430. package/docs/cli/models.md +79 -0
  431. package/docs/cli/node.md +112 -0
  432. package/docs/cli/nodes.md +73 -0
  433. package/docs/cli/onboard.md +43 -0
  434. package/docs/cli/pairing.md +21 -0
  435. package/docs/cli/plugins.md +62 -0
  436. package/docs/cli/reset.md +17 -0
  437. package/docs/cli/sandbox.md +152 -0
  438. package/docs/cli/security.md +26 -0
  439. package/docs/cli/sessions.md +16 -0
  440. package/docs/cli/setup.md +29 -0
  441. package/docs/cli/skills.md +26 -0
  442. package/docs/cli/status.md +26 -0
  443. package/docs/cli/system.md +60 -0
  444. package/docs/cli/tui.md +23 -0
  445. package/docs/cli/uninstall.md +17 -0
  446. package/docs/cli/update.md +98 -0
  447. package/docs/cli/voicecall.md +34 -0
  448. package/docs/cli/webhooks.md +25 -0
  449. package/docs/concepts/agent-loop.md +146 -0
  450. package/docs/concepts/agent-workspace.md +233 -0
  451. package/docs/concepts/agent.md +123 -0
  452. package/docs/concepts/architecture.md +129 -0
  453. package/docs/concepts/channel-routing.md +114 -0
  454. package/docs/concepts/compaction.md +61 -0
  455. package/docs/concepts/context.md +161 -0
  456. package/docs/concepts/features.md +53 -0
  457. package/docs/concepts/group-messages.md +84 -0
  458. package/docs/concepts/groups.md +373 -0
  459. package/docs/concepts/markdown-formatting.md +130 -0
  460. package/docs/concepts/memory.md +546 -0
  461. package/docs/concepts/messages.md +154 -0
  462. package/docs/concepts/model-failover.md +149 -0
  463. package/docs/concepts/model-providers.md +316 -0
  464. package/docs/concepts/models.md +208 -0
  465. package/docs/concepts/multi-agent.md +376 -0
  466. package/docs/concepts/oauth.md +145 -0
  467. package/docs/concepts/presence.md +102 -0
  468. package/docs/concepts/queue.md +89 -0
  469. package/docs/concepts/retry.md +69 -0
  470. package/docs/concepts/session-pruning.md +122 -0
  471. package/docs/concepts/session-tool.md +193 -0
  472. package/docs/concepts/session.md +204 -0
  473. package/docs/concepts/sessions.md +10 -0
  474. package/docs/concepts/streaming.md +135 -0
  475. package/docs/concepts/system-prompt.md +115 -0
  476. package/docs/concepts/timezone.md +91 -0
  477. package/docs/concepts/typebox.md +289 -0
  478. package/docs/concepts/typing-indicators.md +68 -0
  479. package/docs/concepts/usage-tracking.md +35 -0
  480. package/docs/date-time.md +128 -0
  481. package/docs/debug/node-issue.md +83 -0
  482. package/docs/debugging.md +162 -0
  483. package/docs/diagnostics/flags.md +91 -0
  484. package/docs/docs.json +1736 -0
  485. package/docs/environment.md +81 -0
  486. package/docs/experiments/onboarding-config-protocol.md +40 -0
  487. package/docs/experiments/plans/cron-add-hardening.md +63 -0
  488. package/docs/experiments/plans/group-policy-hardening.md +40 -0
  489. package/docs/experiments/plans/openresponses-gateway.md +123 -0
  490. package/docs/experiments/proposals/model-config.md +36 -0
  491. package/docs/experiments/research/memory.md +228 -0
  492. package/docs/gateway/authentication.md +145 -0
  493. package/docs/gateway/background-process.md +93 -0
  494. package/docs/gateway/bonjour.md +167 -0
  495. package/docs/gateway/bridge-protocol.md +89 -0
  496. package/docs/gateway/cli-backends.md +225 -0
  497. package/docs/gateway/configuration-examples.md +606 -0
  498. package/docs/gateway/configuration.md +3411 -0
  499. package/docs/gateway/discovery.md +116 -0
  500. package/docs/gateway/doctor.md +282 -0
  501. package/docs/gateway/gateway-lock.md +34 -0
  502. package/docs/gateway/health.md +35 -0
  503. package/docs/gateway/heartbeat.md +362 -0
  504. package/docs/gateway/index.md +328 -0
  505. package/docs/gateway/local-models.md +150 -0
  506. package/docs/gateway/logging.md +113 -0
  507. package/docs/gateway/multiple-gateways.md +112 -0
  508. package/docs/gateway/network-model.md +17 -0
  509. package/docs/gateway/openai-http-api.md +118 -0
  510. package/docs/gateway/openresponses-http-api.md +317 -0
  511. package/docs/gateway/pairing.md +99 -0
  512. package/docs/gateway/protocol.md +221 -0
  513. package/docs/gateway/remote-gateway-readme.md +157 -0
  514. package/docs/gateway/remote.md +129 -0
  515. package/docs/gateway/sandbox-vs-tool-policy-vs-elevated.md +128 -0
  516. package/docs/gateway/sandboxing.md +193 -0
  517. package/docs/gateway/security/formal-verification.md +164 -0
  518. package/docs/gateway/security/index.md +825 -0
  519. package/docs/gateway/tailscale.md +127 -0
  520. package/docs/gateway/tools-invoke-http-api.md +85 -0
  521. package/docs/gateway/troubleshooting.md +767 -0
  522. package/docs/help/faq.md +2829 -0
  523. package/docs/help/index.md +21 -0
  524. package/docs/help/troubleshooting.md +98 -0
  525. package/docs/hooks/soul-evil.md +69 -0
  526. package/docs/hooks.md +913 -0
  527. package/docs/images/feishu-step2-create-app.png +0 -0
  528. package/docs/images/feishu-step3-credentials.png +0 -0
  529. package/docs/images/feishu-step4-permissions.png +0 -0
  530. package/docs/images/feishu-step5-bot-capability.png +0 -0
  531. package/docs/images/feishu-step6-event-subscription.png +0 -0
  532. package/docs/images/groups-flow.svg +52 -0
  533. package/docs/images/mobile-ui-screenshot.png +0 -0
  534. package/docs/index.md +192 -0
  535. package/docs/install/ansible.md +208 -0
  536. package/docs/install/bun.md +59 -0
  537. package/docs/install/development-channels.md +75 -0
  538. package/docs/install/docker.md +567 -0
  539. package/docs/install/exe-dev.md +126 -0
  540. package/docs/install/fly.md +486 -0
  541. package/docs/install/gcp.md +503 -0
  542. package/docs/install/hetzner.md +330 -0
  543. package/docs/install/index.md +187 -0
  544. package/docs/install/installer.md +123 -0
  545. package/docs/install/macos-vm.md +281 -0
  546. package/docs/install/migrating.md +192 -0
  547. package/docs/install/nix.md +96 -0
  548. package/docs/install/node.md +78 -0
  549. package/docs/install/northflank.mdx +53 -0
  550. package/docs/install/railway.mdx +99 -0
  551. package/docs/install/render.mdx +165 -0
  552. package/docs/install/uninstall.md +128 -0
  553. package/docs/install/updating.md +228 -0
  554. package/docs/logging.md +350 -0
  555. package/docs/multi-agent-sandbox-tools.md +395 -0
  556. package/docs/network.md +54 -0
  557. package/docs/nodes/audio.md +114 -0
  558. package/docs/nodes/camera.md +156 -0
  559. package/docs/nodes/images.md +72 -0
  560. package/docs/nodes/index.md +341 -0
  561. package/docs/nodes/location-command.md +113 -0
  562. package/docs/nodes/media-understanding.md +379 -0
  563. package/docs/nodes/talk.md +90 -0
  564. package/docs/nodes/voicewake.md +65 -0
  565. package/docs/perplexity.md +80 -0
  566. package/docs/pi-dev.md +70 -0
  567. package/docs/pi.md +612 -0
  568. package/docs/platforms/android.md +148 -0
  569. package/docs/platforms/digitalocean.md +262 -0
  570. package/docs/platforms/index.md +53 -0
  571. package/docs/platforms/ios.md +107 -0
  572. package/docs/platforms/linux.md +94 -0
  573. package/docs/platforms/mac/bundled-gateway.md +73 -0
  574. package/docs/platforms/mac/canvas.md +125 -0
  575. package/docs/platforms/mac/child-process.md +69 -0
  576. package/docs/platforms/mac/dev-setup.md +102 -0
  577. package/docs/platforms/mac/health.md +34 -0
  578. package/docs/platforms/mac/icon.md +31 -0
  579. package/docs/platforms/mac/logging.md +57 -0
  580. package/docs/platforms/mac/menu-bar.md +81 -0
  581. package/docs/platforms/mac/peekaboo.md +65 -0
  582. package/docs/platforms/mac/permissions.md +44 -0
  583. package/docs/platforms/mac/release.md +85 -0
  584. package/docs/platforms/mac/remote.md +83 -0
  585. package/docs/platforms/mac/signing.md +47 -0
  586. package/docs/platforms/mac/skills.md +33 -0
  587. package/docs/platforms/mac/voice-overlay.md +60 -0
  588. package/docs/platforms/mac/voicewake.md +67 -0
  589. package/docs/platforms/mac/webchat.md +41 -0
  590. package/docs/platforms/mac/xpc.md +61 -0
  591. package/docs/platforms/macos.md +203 -0
  592. package/docs/platforms/oracle.md +303 -0
  593. package/docs/platforms/raspberry-pi.md +358 -0
  594. package/docs/platforms/windows.md +159 -0
  595. package/docs/plugin.md +664 -0
  596. package/docs/plugins/agent-tools.md +99 -0
  597. package/docs/plugins/manifest.md +71 -0
  598. package/docs/plugins/voice-call.md +284 -0
  599. package/docs/plugins/zalouser.md +81 -0
  600. package/docs/prose.md +134 -0
  601. package/docs/providers/anthropic.md +152 -0
  602. package/docs/providers/claude-max-api-proxy.md +148 -0
  603. package/docs/providers/cloudflare-ai-gateway.md +71 -0
  604. package/docs/providers/deepgram.md +93 -0
  605. package/docs/providers/github-copilot.md +72 -0
  606. package/docs/providers/glm.md +33 -0
  607. package/docs/providers/index.md +63 -0
  608. package/docs/providers/minimax.md +208 -0
  609. package/docs/providers/models.md +51 -0
  610. package/docs/providers/moonshot.md +142 -0
  611. package/docs/providers/ollama.md +277 -0
  612. package/docs/providers/openai.md +62 -0
  613. package/docs/providers/opencode.md +36 -0
  614. package/docs/providers/openrouter.md +37 -0
  615. package/docs/providers/qwen.md +53 -0
  616. package/docs/providers/synthetic.md +99 -0
  617. package/docs/providers/venice.md +267 -0
  618. package/docs/providers/vercel-ai-gateway.md +50 -0
  619. package/docs/providers/xiaomi.md +64 -0
  620. package/docs/providers/zai.md +36 -0
  621. package/docs/refactor/clawnet.md +417 -0
  622. package/docs/refactor/exec-host.md +316 -0
  623. package/docs/refactor/outbound-session-mirroring.md +85 -0
  624. package/docs/refactor/plugin-sdk.md +214 -0
  625. package/docs/refactor/strict-config.md +93 -0
  626. package/docs/reference/AGENTS.default.md +124 -0
  627. package/docs/reference/RELEASING.md +120 -0
  628. package/docs/reference/api-usage-costs.md +137 -0
  629. package/docs/reference/credits.md +27 -0
  630. package/docs/reference/device-models.md +47 -0
  631. package/docs/reference/rpc.md +43 -0
  632. package/docs/reference/session-management-compaction.md +285 -0
  633. package/docs/reference/templates/AGENTS.dev.md +83 -0
  634. package/docs/reference/templates/AGENTS.md +218 -0
  635. package/docs/reference/templates/BOOT.md +10 -0
  636. package/docs/reference/templates/BOOTSTRAP.md +61 -0
  637. package/docs/reference/templates/HEARTBEAT.md +11 -0
  638. package/docs/reference/templates/IDENTITY.dev.md +47 -0
  639. package/docs/reference/templates/IDENTITY.md +27 -0
  640. package/docs/reference/templates/SOUL.dev.md +76 -0
  641. package/docs/reference/templates/SOUL.md +42 -0
  642. package/docs/reference/templates/TOOLS.dev.md +24 -0
  643. package/docs/reference/templates/TOOLS.md +46 -0
  644. package/docs/reference/templates/USER.dev.md +18 -0
  645. package/docs/reference/templates/USER.md +22 -0
  646. package/docs/reference/test.md +50 -0
  647. package/docs/reference/transcript-hygiene.md +129 -0
  648. package/docs/reference/wizard.md +268 -0
  649. package/docs/scripts.md +28 -0
  650. package/docs/security/formal-verification.md +164 -0
  651. package/docs/start/bootstrapping.md +41 -0
  652. package/docs/start/docs-directory.md +64 -0
  653. package/docs/start/getting-started.md +120 -0
  654. package/docs/start/hubs.md +197 -0
  655. package/docs/start/lore.md +219 -0
  656. package/docs/start/onboarding.md +80 -0
  657. package/docs/start/openclaw.md +224 -0
  658. package/docs/start/pairing.md +86 -0
  659. package/docs/start/quickstart.md +22 -0
  660. package/docs/start/setup.md +162 -0
  661. package/docs/start/showcase.md +416 -0
  662. package/docs/start/wizard-cli-automation.md +141 -0
  663. package/docs/start/wizard-cli-reference.md +244 -0
  664. package/docs/start/wizard.md +108 -0
  665. package/docs/style.css +3 -0
  666. package/docs/testing.md +368 -0
  667. package/docs/token-use.md +112 -0
  668. package/docs/tools/agent-send.md +53 -0
  669. package/docs/tools/apply-patch.md +50 -0
  670. package/docs/tools/browser-linux-troubleshooting.md +139 -0
  671. package/docs/tools/browser-login.md +68 -0
  672. package/docs/tools/browser.md +576 -0
  673. package/docs/tools/chrome-extension.md +178 -0
  674. package/docs/tools/clawhub.md +257 -0
  675. package/docs/tools/creating-skills.md +54 -0
  676. package/docs/tools/elevated.md +57 -0
  677. package/docs/tools/exec-approvals.md +246 -0
  678. package/docs/tools/exec.md +179 -0
  679. package/docs/tools/firecrawl.md +61 -0
  680. package/docs/tools/index.md +512 -0
  681. package/docs/tools/llm-task.md +115 -0
  682. package/docs/tools/lobster.md +342 -0
  683. package/docs/tools/reactions.md +22 -0
  684. package/docs/tools/skills-config.md +76 -0
  685. package/docs/tools/skills.md +300 -0
  686. package/docs/tools/slash-commands.md +198 -0
  687. package/docs/tools/subagents.md +151 -0
  688. package/docs/tools/thinking.md +74 -0
  689. package/docs/tools/web.md +261 -0
  690. package/docs/tts.md +396 -0
  691. package/docs/tui.md +162 -0
  692. package/docs/vps.md +43 -0
  693. package/docs/web/control-ui.md +223 -0
  694. package/docs/web/dashboard.md +46 -0
  695. package/docs/web/index.md +116 -0
  696. package/docs/web/webchat.md +49 -0
  697. package/docs/whatsapp-openclaw-ai-zh.jpg +0 -0
  698. package/docs/whatsapp-openclaw.jpg +0 -0
  699. package/docs/zh-CN/AGENTS.md +59 -0
  700. package/docs/zh-CN/automation/auth-monitoring.md +47 -0
  701. package/docs/zh-CN/automation/cron-jobs.md +424 -0
  702. package/docs/zh-CN/automation/cron-vs-heartbeat.md +286 -0
  703. package/docs/zh-CN/automation/gmail-pubsub.md +249 -0
  704. package/docs/zh-CN/automation/poll.md +76 -0
  705. package/docs/zh-CN/automation/webhook.md +163 -0
  706. package/docs/zh-CN/bedrock.md +170 -0
  707. package/docs/zh-CN/brave-search.md +48 -0
  708. package/docs/zh-CN/broadcast-groups.md +449 -0
  709. package/docs/zh-CN/channels/bluebubbles.md +271 -0
  710. package/docs/zh-CN/channels/discord.md +468 -0
  711. package/docs/zh-CN/channels/feishu.md +629 -0
  712. package/docs/zh-CN/channels/googlechat.md +257 -0
  713. package/docs/zh-CN/channels/grammy.md +38 -0
  714. package/docs/zh-CN/channels/imessage.md +302 -0
  715. package/docs/zh-CN/channels/index.md +53 -0
  716. package/docs/zh-CN/channels/line.md +180 -0
  717. package/docs/zh-CN/channels/location.md +63 -0
  718. package/docs/zh-CN/channels/matrix.md +221 -0
  719. package/docs/zh-CN/channels/mattermost.md +144 -0
  720. package/docs/zh-CN/channels/msteams.md +775 -0
  721. package/docs/zh-CN/channels/nextcloud-talk.md +142 -0
  722. package/docs/zh-CN/channels/nostr.md +240 -0
  723. package/docs/zh-CN/channels/signal.md +209 -0
  724. package/docs/zh-CN/channels/slack.md +531 -0
  725. package/docs/zh-CN/channels/telegram.md +751 -0
  726. package/docs/zh-CN/channels/tlon.md +136 -0
  727. package/docs/zh-CN/channels/troubleshooting.md +36 -0
  728. package/docs/zh-CN/channels/twitch.md +385 -0
  729. package/docs/zh-CN/channels/whatsapp.md +411 -0
  730. package/docs/zh-CN/channels/zalo.md +196 -0
  731. package/docs/zh-CN/channels/zalouser.md +147 -0
  732. package/docs/zh-CN/cli/acp.md +173 -0
  733. package/docs/zh-CN/cli/agent.md +30 -0
  734. package/docs/zh-CN/cli/agents.md +82 -0
  735. package/docs/zh-CN/cli/approvals.md +57 -0
  736. package/docs/zh-CN/cli/browser.md +114 -0
  737. package/docs/zh-CN/cli/channels.md +86 -0
  738. package/docs/zh-CN/cli/config.md +57 -0
  739. package/docs/zh-CN/cli/configure.md +38 -0
  740. package/docs/zh-CN/cli/cron.md +43 -0
  741. package/docs/zh-CN/cli/dashboard.md +23 -0
  742. package/docs/zh-CN/cli/devices.md +74 -0
  743. package/docs/zh-CN/cli/directory.md +70 -0
  744. package/docs/zh-CN/cli/dns.md +30 -0
  745. package/docs/zh-CN/cli/docs.md +22 -0
  746. package/docs/zh-CN/cli/doctor.md +48 -0
  747. package/docs/zh-CN/cli/gateway.md +206 -0
  748. package/docs/zh-CN/cli/health.md +28 -0
  749. package/docs/zh-CN/cli/hooks.md +311 -0
  750. package/docs/zh-CN/cli/index.md +1032 -0
  751. package/docs/zh-CN/cli/logs.md +31 -0
  752. package/docs/zh-CN/cli/memory.md +52 -0
  753. package/docs/zh-CN/cli/message.md +246 -0
  754. package/docs/zh-CN/cli/models.md +85 -0
  755. package/docs/zh-CN/cli/node.md +115 -0
  756. package/docs/zh-CN/cli/nodes.md +80 -0
  757. package/docs/zh-CN/cli/onboard.md +36 -0
  758. package/docs/zh-CN/cli/pairing.md +28 -0
  759. package/docs/zh-CN/cli/plugins.md +66 -0
  760. package/docs/zh-CN/cli/reset.md +24 -0
  761. package/docs/zh-CN/cli/sandbox.md +158 -0
  762. package/docs/zh-CN/cli/security.md +33 -0
  763. package/docs/zh-CN/cli/sessions.md +23 -0
  764. package/docs/zh-CN/cli/setup.md +36 -0
  765. package/docs/zh-CN/cli/skills.md +33 -0
  766. package/docs/zh-CN/cli/status.md +33 -0
  767. package/docs/zh-CN/cli/system.md +63 -0
  768. package/docs/zh-CN/cli/tui.md +30 -0
  769. package/docs/zh-CN/cli/uninstall.md +24 -0
  770. package/docs/zh-CN/cli/update.md +101 -0
  771. package/docs/zh-CN/cli/voicecall.md +41 -0
  772. package/docs/zh-CN/cli/webhooks.md +32 -0
  773. package/docs/zh-CN/concepts/agent-loop.md +146 -0
  774. package/docs/zh-CN/concepts/agent-workspace.md +219 -0
  775. package/docs/zh-CN/concepts/agent.md +115 -0
  776. package/docs/zh-CN/concepts/architecture.md +123 -0
  777. package/docs/zh-CN/concepts/channel-routing.md +117 -0
  778. package/docs/zh-CN/concepts/compaction.md +67 -0
  779. package/docs/zh-CN/concepts/context.md +168 -0
  780. package/docs/zh-CN/concepts/features.md +59 -0
  781. package/docs/zh-CN/concepts/group-messages.md +91 -0
  782. package/docs/zh-CN/concepts/groups.md +379 -0
  783. package/docs/zh-CN/concepts/markdown-formatting.md +117 -0
  784. package/docs/zh-CN/concepts/memory.md +412 -0
  785. package/docs/zh-CN/concepts/messages.md +141 -0
  786. package/docs/zh-CN/concepts/model-failover.md +145 -0
  787. package/docs/zh-CN/concepts/model-providers.md +320 -0
  788. package/docs/zh-CN/concepts/models.md +196 -0
  789. package/docs/zh-CN/concepts/multi-agent.md +372 -0
  790. package/docs/zh-CN/concepts/oauth.md +151 -0
  791. package/docs/zh-CN/concepts/presence.md +99 -0
  792. package/docs/zh-CN/concepts/queue.md +94 -0
  793. package/docs/zh-CN/concepts/retry.md +76 -0
  794. package/docs/zh-CN/concepts/session-pruning.md +129 -0
  795. package/docs/zh-CN/concepts/session-tool.md +200 -0
  796. package/docs/zh-CN/concepts/session.md +166 -0
  797. package/docs/zh-CN/concepts/sessions.md +17 -0
  798. package/docs/zh-CN/concepts/streaming.md +133 -0
  799. package/docs/zh-CN/concepts/system-prompt.md +101 -0
  800. package/docs/zh-CN/concepts/timezone.md +96 -0
  801. package/docs/zh-CN/concepts/typebox.md +284 -0
  802. package/docs/zh-CN/concepts/typing-indicators.md +74 -0
  803. package/docs/zh-CN/concepts/usage-tracking.md +42 -0
  804. package/docs/zh-CN/date-time.md +129 -0
  805. package/docs/zh-CN/debug/node-issue.md +90 -0
  806. package/docs/zh-CN/debugging.md +160 -0
  807. package/docs/zh-CN/diagnostics/flags.md +98 -0
  808. package/docs/zh-CN/environment.md +88 -0
  809. package/docs/zh-CN/experiments/onboarding-config-protocol.md +47 -0
  810. package/docs/zh-CN/experiments/plans/cron-add-hardening.md +70 -0
  811. package/docs/zh-CN/experiments/plans/group-policy-hardening.md +45 -0
  812. package/docs/zh-CN/experiments/plans/openresponses-gateway.md +121 -0
  813. package/docs/zh-CN/experiments/proposals/model-config.md +42 -0
  814. package/docs/zh-CN/experiments/research/memory.md +235 -0
  815. package/docs/zh-CN/gateway/authentication.md +142 -0
  816. package/docs/zh-CN/gateway/background-process.md +100 -0
  817. package/docs/zh-CN/gateway/bonjour.md +174 -0
  818. package/docs/zh-CN/gateway/bridge-protocol.md +86 -0
  819. package/docs/zh-CN/gateway/cli-backends.md +213 -0
  820. package/docs/zh-CN/gateway/configuration-examples.md +587 -0
  821. package/docs/zh-CN/gateway/configuration.md +3332 -0
  822. package/docs/zh-CN/gateway/discovery.md +123 -0
  823. package/docs/zh-CN/gateway/doctor.md +238 -0
  824. package/docs/zh-CN/gateway/gateway-lock.md +41 -0
  825. package/docs/zh-CN/gateway/health.md +42 -0
  826. package/docs/zh-CN/gateway/heartbeat.md +274 -0
  827. package/docs/zh-CN/gateway/index.md +335 -0
  828. package/docs/zh-CN/gateway/local-models.md +157 -0
  829. package/docs/zh-CN/gateway/logging.md +114 -0
  830. package/docs/zh-CN/gateway/multiple-gateways.md +119 -0
  831. package/docs/zh-CN/gateway/network-model.md +23 -0
  832. package/docs/zh-CN/gateway/openai-http-api.md +125 -0
  833. package/docs/zh-CN/gateway/openresponses-http-api.md +317 -0
  834. package/docs/zh-CN/gateway/pairing.md +99 -0
  835. package/docs/zh-CN/gateway/protocol.md +220 -0
  836. package/docs/zh-CN/gateway/remote-gateway-readme.md +164 -0
  837. package/docs/zh-CN/gateway/remote.md +133 -0
  838. package/docs/zh-CN/gateway/sandbox-vs-tool-policy-vs-elevated.md +135 -0
  839. package/docs/zh-CN/gateway/sandboxing.md +188 -0
  840. package/docs/zh-CN/gateway/security/formal-verification.md +169 -0
  841. package/docs/zh-CN/gateway/security/index.md +777 -0
  842. package/docs/zh-CN/gateway/tailscale.md +124 -0
  843. package/docs/zh-CN/gateway/tools-invoke-http-api.md +92 -0
  844. package/docs/zh-CN/gateway/troubleshooting.md +771 -0
  845. package/docs/zh-CN/help/faq.md +2628 -0
  846. package/docs/zh-CN/help/index.md +28 -0
  847. package/docs/zh-CN/help/troubleshooting.md +104 -0
  848. package/docs/zh-CN/hooks/soul-evil.md +72 -0
  849. package/docs/zh-CN/hooks.md +919 -0
  850. package/docs/zh-CN/index.md +186 -0
  851. package/docs/zh-CN/install/ansible.md +215 -0
  852. package/docs/zh-CN/install/bun.md +65 -0
  853. package/docs/zh-CN/install/development-channels.md +81 -0
  854. package/docs/zh-CN/install/docker.md +532 -0
  855. package/docs/zh-CN/install/exe-dev.md +127 -0
  856. package/docs/zh-CN/install/fly.md +490 -0
  857. package/docs/zh-CN/install/gcp.md +510 -0
  858. package/docs/zh-CN/install/hetzner.md +337 -0
  859. package/docs/zh-CN/install/index.md +193 -0
  860. package/docs/zh-CN/install/installer.md +128 -0
  861. package/docs/zh-CN/install/macos-vm.md +288 -0
  862. package/docs/zh-CN/install/migrating.md +199 -0
  863. package/docs/zh-CN/install/nix.md +99 -0
  864. package/docs/zh-CN/install/node.md +85 -0
  865. package/docs/zh-CN/install/northflank.mdx +60 -0
  866. package/docs/zh-CN/install/railway.mdx +106 -0
  867. package/docs/zh-CN/install/render.mdx +169 -0
  868. package/docs/zh-CN/install/uninstall.md +135 -0
  869. package/docs/zh-CN/install/updating.md +233 -0
  870. package/docs/zh-CN/logging.md +329 -0
  871. package/docs/zh-CN/multi-agent-sandbox-tools.md +401 -0
  872. package/docs/zh-CN/network.md +59 -0
  873. package/docs/zh-CN/nodes/audio.md +120 -0
  874. package/docs/zh-CN/nodes/camera.md +162 -0
  875. package/docs/zh-CN/nodes/images.md +79 -0
  876. package/docs/zh-CN/nodes/index.md +348 -0
  877. package/docs/zh-CN/nodes/location-command.md +120 -0
  878. package/docs/zh-CN/nodes/media-understanding.md +380 -0
  879. package/docs/zh-CN/nodes/talk.md +97 -0
  880. package/docs/zh-CN/nodes/voicewake.md +72 -0
  881. package/docs/zh-CN/perplexity.md +84 -0
  882. package/docs/zh-CN/pi-dev.md +77 -0
  883. package/docs/zh-CN/pi.md +619 -0
  884. package/docs/zh-CN/platforms/android.md +155 -0
  885. package/docs/zh-CN/platforms/digitalocean.md +269 -0
  886. package/docs/zh-CN/platforms/index.md +60 -0
  887. package/docs/zh-CN/platforms/ios.md +114 -0
  888. package/docs/zh-CN/platforms/linux.md +101 -0
  889. package/docs/zh-CN/platforms/mac/bundled-gateway.md +75 -0
  890. package/docs/zh-CN/platforms/mac/canvas.md +128 -0
  891. package/docs/zh-CN/platforms/mac/child-process.md +73 -0
  892. package/docs/zh-CN/platforms/mac/dev-setup.md +109 -0
  893. package/docs/zh-CN/platforms/mac/health.md +41 -0
  894. package/docs/zh-CN/platforms/mac/icon.md +38 -0
  895. package/docs/zh-CN/platforms/mac/logging.md +64 -0
  896. package/docs/zh-CN/platforms/mac/menu-bar.md +88 -0
  897. package/docs/zh-CN/platforms/mac/peekaboo.md +62 -0
  898. package/docs/zh-CN/platforms/mac/permissions.md +46 -0
  899. package/docs/zh-CN/platforms/mac/release.md +92 -0
  900. package/docs/zh-CN/platforms/mac/remote.md +90 -0
  901. package/docs/zh-CN/platforms/mac/signing.md +54 -0
  902. package/docs/zh-CN/platforms/mac/skills.md +40 -0
  903. package/docs/zh-CN/platforms/mac/voice-overlay.md +67 -0
  904. package/docs/zh-CN/platforms/mac/voicewake.md +74 -0
  905. package/docs/zh-CN/platforms/mac/webchat.md +43 -0
  906. package/docs/zh-CN/platforms/mac/xpc.md +68 -0
  907. package/docs/zh-CN/platforms/macos.md +193 -0
  908. package/docs/zh-CN/platforms/oracle.md +310 -0
  909. package/docs/zh-CN/platforms/raspberry-pi.md +365 -0
  910. package/docs/zh-CN/platforms/windows.md +156 -0
  911. package/docs/zh-CN/plugin.md +639 -0
  912. package/docs/zh-CN/plugins/agent-tools.md +99 -0
  913. package/docs/zh-CN/plugins/manifest.md +68 -0
  914. package/docs/zh-CN/plugins/voice-call.md +250 -0
  915. package/docs/zh-CN/plugins/zalouser.md +88 -0
  916. package/docs/zh-CN/prose.md +141 -0
  917. package/docs/zh-CN/providers/anthropic.md +159 -0
  918. package/docs/zh-CN/providers/claude-max-api-proxy.md +155 -0
  919. package/docs/zh-CN/providers/deepgram.md +97 -0
  920. package/docs/zh-CN/providers/github-copilot.md +67 -0
  921. package/docs/zh-CN/providers/glm.md +39 -0
  922. package/docs/zh-CN/providers/index.md +68 -0
  923. package/docs/zh-CN/providers/minimax.md +206 -0
  924. package/docs/zh-CN/providers/models.md +55 -0
  925. package/docs/zh-CN/providers/moonshot.md +145 -0
  926. package/docs/zh-CN/providers/ollama.md +230 -0
  927. package/docs/zh-CN/providers/openai.md +68 -0
  928. package/docs/zh-CN/providers/opencode.md +41 -0
  929. package/docs/zh-CN/providers/openrouter.md +43 -0
  930. package/docs/zh-CN/providers/qwen.md +55 -0
  931. package/docs/zh-CN/providers/synthetic.md +102 -0
  932. package/docs/zh-CN/providers/venice.md +274 -0
  933. package/docs/zh-CN/providers/vercel-ai-gateway.md +57 -0
  934. package/docs/zh-CN/providers/xiaomi.md +68 -0
  935. package/docs/zh-CN/providers/zai.md +41 -0
  936. package/docs/zh-CN/refactor/clawnet.md +424 -0
  937. package/docs/zh-CN/refactor/exec-host.md +323 -0
  938. package/docs/zh-CN/refactor/outbound-session-mirroring.md +92 -0
  939. package/docs/zh-CN/refactor/plugin-sdk.md +221 -0
  940. package/docs/zh-CN/refactor/strict-config.md +100 -0
  941. package/docs/zh-CN/reference/AGENTS.default.md +131 -0
  942. package/docs/zh-CN/reference/RELEASING.md +123 -0
  943. package/docs/zh-CN/reference/api-usage-costs.md +136 -0
  944. package/docs/zh-CN/reference/credits.md +34 -0
  945. package/docs/zh-CN/reference/device-models.md +54 -0
  946. package/docs/zh-CN/reference/rpc.md +48 -0
  947. package/docs/zh-CN/reference/session-management-compaction.md +287 -0
  948. package/docs/zh-CN/reference/templates/AGENTS.dev.md +89 -0
  949. package/docs/zh-CN/reference/templates/AGENTS.md +225 -0
  950. package/docs/zh-CN/reference/templates/BOOT.md +17 -0
  951. package/docs/zh-CN/reference/templates/BOOTSTRAP.md +68 -0
  952. package/docs/zh-CN/reference/templates/HEARTBEAT.md +18 -0
  953. package/docs/zh-CN/reference/templates/IDENTITY.dev.md +54 -0
  954. package/docs/zh-CN/reference/templates/IDENTITY.md +35 -0
  955. package/docs/zh-CN/reference/templates/SOUL.dev.md +83 -0
  956. package/docs/zh-CN/reference/templates/SOUL.md +49 -0
  957. package/docs/zh-CN/reference/templates/TOOLS.dev.md +31 -0
  958. package/docs/zh-CN/reference/templates/TOOLS.md +53 -0
  959. package/docs/zh-CN/reference/templates/USER.dev.md +25 -0
  960. package/docs/zh-CN/reference/templates/USER.md +30 -0
  961. package/docs/zh-CN/reference/test.md +57 -0
  962. package/docs/zh-CN/reference/transcript-hygiene.md +109 -0
  963. package/docs/zh-CN/scripts.md +35 -0
  964. package/docs/zh-CN/security/formal-verification.md +171 -0
  965. package/docs/zh-CN/start/docs-directory.md +70 -0
  966. package/docs/zh-CN/start/getting-started.md +206 -0
  967. package/docs/zh-CN/start/hubs.md +200 -0
  968. package/docs/zh-CN/start/lore.md +226 -0
  969. package/docs/zh-CN/start/onboarding.md +105 -0
  970. package/docs/zh-CN/start/openclaw.md +248 -0
  971. package/docs/zh-CN/start/pairing.md +89 -0
  972. package/docs/zh-CN/start/quickstart.md +88 -0
  973. package/docs/zh-CN/start/setup.md +153 -0
  974. package/docs/zh-CN/start/showcase.md +423 -0
  975. package/docs/zh-CN/start/wizard.md +331 -0
  976. package/docs/zh-CN/testing.md +375 -0
  977. package/docs/zh-CN/token-use.md +119 -0
  978. package/docs/zh-CN/tools/agent-send.md +59 -0
  979. package/docs/zh-CN/tools/apply-patch.md +57 -0
  980. package/docs/zh-CN/tools/browser-linux-troubleshooting.md +144 -0
  981. package/docs/zh-CN/tools/browser-login.md +75 -0
  982. package/docs/zh-CN/tools/browser.md +553 -0
  983. package/docs/zh-CN/tools/chrome-extension.md +183 -0
  984. package/docs/zh-CN/tools/clawhub.md +209 -0
  985. package/docs/zh-CN/tools/creating-skills.md +61 -0
  986. package/docs/zh-CN/tools/elevated.md +64 -0
  987. package/docs/zh-CN/tools/exec-approvals.md +234 -0
  988. package/docs/zh-CN/tools/exec.md +169 -0
  989. package/docs/zh-CN/tools/firecrawl.md +68 -0
  990. package/docs/zh-CN/tools/index.md +515 -0
  991. package/docs/zh-CN/tools/llm-task.md +117 -0
  992. package/docs/zh-CN/tools/lobster.md +349 -0
  993. package/docs/zh-CN/tools/reactions.md +29 -0
  994. package/docs/zh-CN/tools/skills-config.md +78 -0
  995. package/docs/zh-CN/tools/skills.md +279 -0
  996. package/docs/zh-CN/tools/slash-commands.md +205 -0
  997. package/docs/zh-CN/tools/subagents.md +156 -0
  998. package/docs/zh-CN/tools/thinking.md +80 -0
  999. package/docs/zh-CN/tools/web.md +257 -0
  1000. package/docs/zh-CN/tts.md +375 -0
  1001. package/docs/zh-CN/tui.md +166 -0
  1002. package/docs/zh-CN/vps.md +47 -0
  1003. package/docs/zh-CN/web/control-ui.md +191 -0
  1004. package/docs/zh-CN/web/dashboard.md +53 -0
  1005. package/docs/zh-CN/web/index.md +118 -0
  1006. package/docs/zh-CN/web/webchat.md +56 -0
  1007. package/extensions/blockchain/cryptoclaw.plugin.json +17 -0
  1008. package/extensions/blockchain/index.ts +284 -0
  1009. package/extensions/blockchain/node_modules/.bin/cryptoclaw +21 -0
  1010. package/extensions/blockchain/node_modules/.bin/tsc +21 -0
  1011. package/extensions/blockchain/node_modules/.bin/tsserver +21 -0
  1012. package/extensions/blockchain/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  1013. package/extensions/blockchain/package.json +16 -0
  1014. package/extensions/blockchain/src/evm/chains.ts +150 -0
  1015. package/extensions/blockchain/src/evm/services/abi/erc1155.ts +128 -0
  1016. package/extensions/blockchain/src/evm/services/abi/erc20.ts +96 -0
  1017. package/extensions/blockchain/src/evm/services/abi/erc721.ts +130 -0
  1018. package/extensions/blockchain/src/evm/services/abi/erc8004-identity.ts +158 -0
  1019. package/extensions/blockchain/src/evm/services/abi/erc8004-reputation.ts +120 -0
  1020. package/extensions/blockchain/src/evm/services/abi/router-v2.ts +115 -0
  1021. package/extensions/blockchain/src/evm/services/abi/router-v3.ts +81 -0
  1022. package/extensions/blockchain/src/evm/services/agent-identity-config.test.ts +117 -0
  1023. package/extensions/blockchain/src/evm/services/agent-identity-config.ts +75 -0
  1024. package/extensions/blockchain/src/evm/services/agent-identity-store.ts +37 -0
  1025. package/extensions/blockchain/src/evm/services/agent-identity.ts +262 -0
  1026. package/extensions/blockchain/src/evm/services/balance.ts +76 -0
  1027. package/extensions/blockchain/src/evm/services/blocks.ts +25 -0
  1028. package/extensions/blockchain/src/evm/services/clients.ts +48 -0
  1029. package/extensions/blockchain/src/evm/services/contracts.ts +52 -0
  1030. package/extensions/blockchain/src/evm/services/dex-config.test.ts +145 -0
  1031. package/extensions/blockchain/src/evm/services/dex-config.ts +164 -0
  1032. package/extensions/blockchain/src/evm/services/ens.ts +27 -0
  1033. package/extensions/blockchain/src/evm/services/security.test.ts +127 -0
  1034. package/extensions/blockchain/src/evm/services/security.ts +110 -0
  1035. package/extensions/blockchain/src/evm/services/swap.test.ts +204 -0
  1036. package/extensions/blockchain/src/evm/services/swap.ts +534 -0
  1037. package/extensions/blockchain/src/evm/services/tokens.ts +118 -0
  1038. package/extensions/blockchain/src/evm/services/transactions.ts +54 -0
  1039. package/extensions/blockchain/src/evm/services/transfer.ts +174 -0
  1040. package/extensions/blockchain/src/evm/services/utils.ts +18 -0
  1041. package/extensions/blockchain/src/evm/tools/block-tools.ts +34 -0
  1042. package/extensions/blockchain/src/evm/tools/contract-tools.ts +138 -0
  1043. package/extensions/blockchain/src/evm/tools/identity-tools.ts +305 -0
  1044. package/extensions/blockchain/src/evm/tools/network-tools.ts +58 -0
  1045. package/extensions/blockchain/src/evm/tools/nft-tools.ts +103 -0
  1046. package/extensions/blockchain/src/evm/tools/security-tools.ts +38 -0
  1047. package/extensions/blockchain/src/evm/tools/swap-tools.ts +314 -0
  1048. package/extensions/blockchain/src/evm/tools/token-tools.ts +167 -0
  1049. package/extensions/blockchain/src/evm/tools/tx-tools.ts +73 -0
  1050. package/extensions/blockchain/src/evm/tools/wallet-tools.ts +196 -0
  1051. package/extensions/blockchain/src/tx-gate/confirmation.ts +55 -0
  1052. package/extensions/blockchain/src/tx-gate/spending-limits.ts +94 -0
  1053. package/extensions/blockchain/src/wallet/active-wallet.ts +27 -0
  1054. package/extensions/blockchain/src/wallet/key-guard.test.ts +156 -0
  1055. package/extensions/blockchain/src/wallet/key-guard.ts +80 -0
  1056. package/extensions/blockchain/src/wallet/keystore.ts +88 -0
  1057. package/extensions/blockchain/src/wallet/wallet-manager.test.ts +215 -0
  1058. package/extensions/blockchain/src/wallet/wallet-manager.ts +212 -0
  1059. package/extensions/copilot-proxy/README.md +24 -0
  1060. package/extensions/copilot-proxy/index.ts +149 -0
  1061. package/extensions/copilot-proxy/node_modules/.bin/cryptoclaw +21 -0
  1062. package/extensions/copilot-proxy/openclaw.plugin.json +9 -0
  1063. package/extensions/copilot-proxy/package.json +14 -0
  1064. package/extensions/diagnostics-otel/index.ts +15 -0
  1065. package/extensions/diagnostics-otel/node_modules/.bin/acorn +21 -0
  1066. package/extensions/diagnostics-otel/node_modules/.bin/cryptoclaw +21 -0
  1067. package/extensions/diagnostics-otel/openclaw.plugin.json +8 -0
  1068. package/extensions/diagnostics-otel/package.json +27 -0
  1069. package/extensions/diagnostics-otel/src/service.test.ts +227 -0
  1070. package/extensions/diagnostics-otel/src/service.ts +635 -0
  1071. package/extensions/discord/index.ts +17 -0
  1072. package/extensions/discord/node_modules/.bin/cryptoclaw +21 -0
  1073. package/extensions/discord/openclaw.plugin.json +9 -0
  1074. package/extensions/discord/package.json +14 -0
  1075. package/extensions/discord/src/channel.ts +422 -0
  1076. package/extensions/discord/src/runtime.ts +14 -0
  1077. package/extensions/imessage/index.ts +17 -0
  1078. package/extensions/imessage/node_modules/.bin/cryptoclaw +21 -0
  1079. package/extensions/imessage/openclaw.plugin.json +9 -0
  1080. package/extensions/imessage/package.json +14 -0
  1081. package/extensions/imessage/src/channel.ts +294 -0
  1082. package/extensions/imessage/src/runtime.ts +14 -0
  1083. package/extensions/memory-core/index.ts +38 -0
  1084. package/extensions/memory-core/node_modules/.bin/cryptoclaw +21 -0
  1085. package/extensions/memory-core/openclaw.plugin.json +9 -0
  1086. package/extensions/memory-core/package.json +17 -0
  1087. package/extensions/memory-lancedb/config.ts +139 -0
  1088. package/extensions/memory-lancedb/index.test.ts +295 -0
  1089. package/extensions/memory-lancedb/index.ts +608 -0
  1090. package/extensions/memory-lancedb/node_modules/.bin/arrow2csv +21 -0
  1091. package/extensions/memory-lancedb/node_modules/.bin/cryptoclaw +21 -0
  1092. package/extensions/memory-lancedb/node_modules/.bin/openai +21 -0
  1093. package/extensions/memory-lancedb/openclaw.plugin.json +60 -0
  1094. package/extensions/memory-lancedb/package.json +19 -0
  1095. package/extensions/nostr/CHANGELOG.md +80 -0
  1096. package/extensions/nostr/README.md +136 -0
  1097. package/extensions/nostr/index.ts +68 -0
  1098. package/extensions/nostr/node_modules/.bin/cryptoclaw +21 -0
  1099. package/extensions/nostr/node_modules/.bin/tsc +21 -0
  1100. package/extensions/nostr/node_modules/.bin/tsserver +21 -0
  1101. package/extensions/nostr/openclaw.plugin.json +9 -0
  1102. package/extensions/nostr/package.json +34 -0
  1103. package/extensions/nostr/src/channel.test.ts +151 -0
  1104. package/extensions/nostr/src/channel.ts +353 -0
  1105. package/extensions/nostr/src/config-schema.ts +90 -0
  1106. package/extensions/nostr/src/metrics.ts +478 -0
  1107. package/extensions/nostr/src/nostr-bus.fuzz.test.ts +533 -0
  1108. package/extensions/nostr/src/nostr-bus.integration.test.ts +448 -0
  1109. package/extensions/nostr/src/nostr-bus.test.ts +199 -0
  1110. package/extensions/nostr/src/nostr-bus.ts +715 -0
  1111. package/extensions/nostr/src/nostr-profile-http.test.ts +378 -0
  1112. package/extensions/nostr/src/nostr-profile-http.ts +519 -0
  1113. package/extensions/nostr/src/nostr-profile-import.test.ts +119 -0
  1114. package/extensions/nostr/src/nostr-profile-import.ts +262 -0
  1115. package/extensions/nostr/src/nostr-profile.fuzz.test.ts +477 -0
  1116. package/extensions/nostr/src/nostr-profile.test.ts +410 -0
  1117. package/extensions/nostr/src/nostr-profile.ts +277 -0
  1118. package/extensions/nostr/src/nostr-state-store.test.ts +131 -0
  1119. package/extensions/nostr/src/nostr-state-store.ts +226 -0
  1120. package/extensions/nostr/src/runtime.ts +14 -0
  1121. package/extensions/nostr/src/seen-tracker.ts +303 -0
  1122. package/extensions/nostr/src/types.test.ts +157 -0
  1123. package/extensions/nostr/src/types.ts +101 -0
  1124. package/extensions/nostr/test/setup.ts +5 -0
  1125. package/extensions/signal/index.ts +17 -0
  1126. package/extensions/signal/node_modules/.bin/cryptoclaw +21 -0
  1127. package/extensions/signal/openclaw.plugin.json +9 -0
  1128. package/extensions/signal/package.json +14 -0
  1129. package/extensions/signal/src/channel.ts +315 -0
  1130. package/extensions/signal/src/runtime.ts +14 -0
  1131. package/extensions/slack/index.ts +17 -0
  1132. package/extensions/slack/node_modules/.bin/cryptoclaw +21 -0
  1133. package/extensions/slack/openclaw.plugin.json +9 -0
  1134. package/extensions/slack/package.json +14 -0
  1135. package/extensions/slack/src/channel.ts +604 -0
  1136. package/extensions/slack/src/runtime.ts +14 -0
  1137. package/extensions/telegram/index.ts +17 -0
  1138. package/extensions/telegram/node_modules/.bin/cryptoclaw +21 -0
  1139. package/extensions/telegram/openclaw.plugin.json +9 -0
  1140. package/extensions/telegram/package.json +14 -0
  1141. package/extensions/telegram/src/channel.ts +482 -0
  1142. package/extensions/telegram/src/runtime.ts +14 -0
  1143. package/extensions/voice-call/CHANGELOG.md +115 -0
  1144. package/extensions/voice-call/README.md +139 -0
  1145. package/extensions/voice-call/index.ts +493 -0
  1146. package/extensions/voice-call/node_modules/.bin/cryptoclaw +21 -0
  1147. package/extensions/voice-call/openclaw.plugin.json +559 -0
  1148. package/extensions/voice-call/package.json +19 -0
  1149. package/extensions/voice-call/src/allowlist.ts +19 -0
  1150. package/extensions/voice-call/src/cli.ts +279 -0
  1151. package/extensions/voice-call/src/config.test.ts +234 -0
  1152. package/extensions/voice-call/src/config.ts +523 -0
  1153. package/extensions/voice-call/src/core-bridge.ts +159 -0
  1154. package/extensions/voice-call/src/manager/context.ts +21 -0
  1155. package/extensions/voice-call/src/manager/events.ts +188 -0
  1156. package/extensions/voice-call/src/manager/lookup.ts +35 -0
  1157. package/extensions/voice-call/src/manager/outbound.ts +275 -0
  1158. package/extensions/voice-call/src/manager/state.ts +48 -0
  1159. package/extensions/voice-call/src/manager/store.ts +91 -0
  1160. package/extensions/voice-call/src/manager/timers.ts +89 -0
  1161. package/extensions/voice-call/src/manager/twiml.ts +9 -0
  1162. package/extensions/voice-call/src/manager.test.ts +224 -0
  1163. package/extensions/voice-call/src/manager.ts +887 -0
  1164. package/extensions/voice-call/src/media-stream.test.ts +96 -0
  1165. package/extensions/voice-call/src/media-stream.ts +411 -0
  1166. package/extensions/voice-call/src/providers/base.ts +67 -0
  1167. package/extensions/voice-call/src/providers/index.ts +10 -0
  1168. package/extensions/voice-call/src/providers/mock.ts +165 -0
  1169. package/extensions/voice-call/src/providers/plivo.test.ts +27 -0
  1170. package/extensions/voice-call/src/providers/plivo.ts +515 -0
  1171. package/extensions/voice-call/src/providers/stt-openai-realtime.ts +311 -0
  1172. package/extensions/voice-call/src/providers/telnyx.ts +371 -0
  1173. package/extensions/voice-call/src/providers/tts-openai.ts +259 -0
  1174. package/extensions/voice-call/src/providers/twilio/api.ts +42 -0
  1175. package/extensions/voice-call/src/providers/twilio/webhook.ts +32 -0
  1176. package/extensions/voice-call/src/providers/twilio.test.ts +60 -0
  1177. package/extensions/voice-call/src/providers/twilio.ts +626 -0
  1178. package/extensions/voice-call/src/response-generator.ts +158 -0
  1179. package/extensions/voice-call/src/runtime.ts +212 -0
  1180. package/extensions/voice-call/src/telephony-audio.ts +90 -0
  1181. package/extensions/voice-call/src/telephony-tts.ts +104 -0
  1182. package/extensions/voice-call/src/tunnel.ts +314 -0
  1183. package/extensions/voice-call/src/types.ts +272 -0
  1184. package/extensions/voice-call/src/utils.ts +14 -0
  1185. package/extensions/voice-call/src/voice-mapping.ts +67 -0
  1186. package/extensions/voice-call/src/webhook-security.test.ts +377 -0
  1187. package/extensions/voice-call/src/webhook-security.ts +689 -0
  1188. package/extensions/voice-call/src/webhook.ts +491 -0
  1189. package/extensions/whatsapp/index.ts +17 -0
  1190. package/extensions/whatsapp/node_modules/.bin/cryptoclaw +21 -0
  1191. package/extensions/whatsapp/openclaw.plugin.json +9 -0
  1192. package/extensions/whatsapp/package.json +14 -0
  1193. package/extensions/whatsapp/src/channel.ts +508 -0
  1194. package/extensions/whatsapp/src/runtime.ts +14 -0
  1195. package/package.json +242 -0
  1196. package/skills/aave-bsc/SKILL.md +55 -0
  1197. package/skills/agent-identity/SKILL.md +48 -0
  1198. package/skills/bird/SKILL.md +224 -0
  1199. package/skills/canvas/SKILL.md +204 -0
  1200. package/skills/coding-agent/SKILL.md +285 -0
  1201. package/skills/coingecko/SKILL.md +114 -0
  1202. package/skills/contract-deployer/SKILL.md +42 -0
  1203. package/skills/debank/SKILL.md +143 -0
  1204. package/skills/defi-dashboard/SKILL.md +49 -0
  1205. package/skills/defillama/SKILL.md +117 -0
  1206. package/skills/discord/SKILL.md +578 -0
  1207. package/skills/dune/SKILL.md +178 -0
  1208. package/skills/etherscan/SKILL.md +117 -0
  1209. package/skills/four-meme/SKILL.md +80 -0
  1210. package/skills/gas-tracker/SKILL.md +43 -0
  1211. package/skills/github/SKILL.md +77 -0
  1212. package/skills/macro-calendar/SKILL.md +132 -0
  1213. package/skills/market-data/SKILL.md +44 -0
  1214. package/skills/nft-manager/SKILL.md +46 -0
  1215. package/skills/portfolio-tracker/SKILL.md +55 -0
  1216. package/skills/security-check/SKILL.md +153 -0
  1217. package/skills/tmux/SKILL.md +135 -0
  1218. package/skills/tmux/scripts/find-sessions.sh +112 -0
  1219. package/skills/tmux/scripts/wait-for-text.sh +83 -0
  1220. package/skills/token-swap/SKILL.md +71 -0
  1221. package/skills/wallet-manager/SKILL.md +65 -0
  1222. package/skills/whale-watcher/SKILL.md +43 -0
@@ -0,0 +1,1414 @@
1
+ import "./pi-embedded-helpers-B7ARjDEK.js";
2
+ import { Mn as createSlackWebClient, at as formatUsageReportLines, gn as fetchChannelPermissionsDiscord, hn as parseDiscordTarget, it as loadProviderUsageSummary } from "./reply-DfepuqG0.js";
3
+ import "./paths-CGrNQEMk.js";
4
+ import { s as normalizeAccountId, t as DEFAULT_ACCOUNT_ID } from "./session-key-CYpWeuht.js";
5
+ import { E as danger, M as setVerbose, R as theme, V as getResolvedLoggerSettings, c as defaultRuntime, h as DEFAULT_CHAT_CHANNEL } from "./subsystem-Btuh5yZj.js";
6
+ import "./utils-D7jskKIf.js";
7
+ import "./exec-CW_QjkBi.js";
8
+ import { c as resolveDefaultAgentId, s as resolveAgentWorkspaceDir } from "./agent-scope-DLfFOxP6.js";
9
+ import { ut as loadAuthProfileStore } from "./model-selection-Av0fLq51.js";
10
+ import "./github-copilot-token-hMl1wyZp.js";
11
+ import { t as formatCliCommand } from "./command-format-9IsYy-9N.js";
12
+ import "./boolean-BsqeuxE6.js";
13
+ import "./env-B2Cd_6IS.js";
14
+ import { c as writeConfigFile, i as loadConfig, o as readConfigFileSnapshot } from "./config-dQK4rbfx.js";
15
+ import "./manifest-registry-DVQHMj0y.js";
16
+ import { n as listChannelPlugins, r as normalizeChannelId, t as getChannelPlugin } from "./plugins-Dk4UBZwz.js";
17
+ import "./sandbox-D_Tt3WRq.js";
18
+ import "./image-DAsWVn7Q.js";
19
+ import "./pi-model-discovery-EwKVHlZB.js";
20
+ import "./chrome-CwbWzmh4.js";
21
+ import "./skills-CsZRBUj0.js";
22
+ import "./routes-DkckwrRx.js";
23
+ import "./server-context-C53lhEx_.js";
24
+ import "./message-channel-CvHWS3C2.js";
25
+ import "./logging-kuFzZMsG.js";
26
+ import "./accounts-BPjR5SyC.js";
27
+ import "./paths-C3yk0MGu.js";
28
+ import "./redact-CVRUv382.js";
29
+ import "./tool-display-Zbh1CRw5.js";
30
+ import "./deliver-sPBfRlXT.js";
31
+ import "./dispatcher-DA3u3CwV.js";
32
+ import "./manager-CtGvmGvM.js";
33
+ import "./sqlite-C4DljFNL.js";
34
+ import { n as formatAge } from "./channel-summary-CobMoKN6.js";
35
+ import "./client-BaTYzXOU.js";
36
+ import { n as callGateway } from "./call-DqxlETxE.js";
37
+ import "./login-qr-HIPJAnbT.js";
38
+ import "./pairing-store-BHzy16_t.js";
39
+ import { t as formatDocsLink } from "./links-Brcj2Oc-.js";
40
+ import { r as runCommandWithRuntime } from "./cli-utils-CgOu3WAB.js";
41
+ import { n as withProgress } from "./progress-DTEUicRP.js";
42
+ import "./pi-tools.policy-Du4RZy9R.js";
43
+ import "./prompt-style-BBlJlXtd.js";
44
+ import "./session-cost-usage-B3HzifR9.js";
45
+ import "./control-service-BXC31sNw.js";
46
+ import { n as resolveMessageChannelSelection } from "./channel-selection-D7jFTFec.js";
47
+ import { t as resolveChannelDefaultAccountId } from "./helpers-CzQjTUbz.js";
48
+ import "./note-DEz9ZK7G.js";
49
+ import { t as createClackPrompter } from "./clack-prompter-nSmn5cZ2.js";
50
+ import { i as reloadOnboardingPluginRegistry, n as setupChannels, r as ensureOnboardingPluginInstalled } from "./onboard-channels-B75LjjVZ.js";
51
+ import { i as listChannelPluginCatalogEntries } from "./plugin-auto-enable-RwRwIUKC.js";
52
+ import "./archive-Dy3Ezb-5.js";
53
+ import "./skill-scanner-BoGjHXUZ.js";
54
+ import "./installs-CELeuogN.js";
55
+ import { t as collectChannelStatusIssues } from "./channels-status-issues-C2UGSPvH.js";
56
+ import { i as hasExplicitOptions, t as formatCliChannelOptions } from "./channel-options-DUkxROTo.js";
57
+ import { t as buildChannelAccountSnapshot } from "./status-BqtiImKF.js";
58
+ import { t as parseLogLine } from "./parse-log-line-BxDgv4Uo.js";
59
+ import fs from "node:fs/promises";
60
+
61
+ //#region src/commands/channels/add-mutators.ts
62
+ function applyAccountName(params) {
63
+ const accountId = normalizeAccountId(params.accountId);
64
+ const apply = getChannelPlugin(params.channel)?.setup?.applyAccountName;
65
+ return apply ? apply({
66
+ cfg: params.cfg,
67
+ accountId,
68
+ name: params.name
69
+ }) : params.cfg;
70
+ }
71
+ function applyChannelAccountConfig(params) {
72
+ const accountId = normalizeAccountId(params.accountId);
73
+ const apply = getChannelPlugin(params.channel)?.setup?.applyAccountConfig;
74
+ if (!apply) return params.cfg;
75
+ const input = {
76
+ name: params.name,
77
+ token: params.token,
78
+ tokenFile: params.tokenFile,
79
+ botToken: params.botToken,
80
+ appToken: params.appToken,
81
+ signalNumber: params.signalNumber,
82
+ cliPath: params.cliPath,
83
+ dbPath: params.dbPath,
84
+ service: params.service,
85
+ region: params.region,
86
+ authDir: params.authDir,
87
+ httpUrl: params.httpUrl,
88
+ httpHost: params.httpHost,
89
+ httpPort: params.httpPort,
90
+ webhookPath: params.webhookPath,
91
+ webhookUrl: params.webhookUrl,
92
+ audienceType: params.audienceType,
93
+ audience: params.audience,
94
+ useEnv: params.useEnv,
95
+ homeserver: params.homeserver,
96
+ userId: params.userId,
97
+ accessToken: params.accessToken,
98
+ password: params.password,
99
+ deviceName: params.deviceName,
100
+ initialSyncLimit: params.initialSyncLimit,
101
+ ship: params.ship,
102
+ url: params.url,
103
+ code: params.code,
104
+ groupChannels: params.groupChannels,
105
+ dmAllowlist: params.dmAllowlist,
106
+ autoDiscoverChannels: params.autoDiscoverChannels
107
+ };
108
+ return apply({
109
+ cfg: params.cfg,
110
+ accountId,
111
+ input
112
+ });
113
+ }
114
+
115
+ //#endregion
116
+ //#region src/commands/channels/shared.ts
117
+ async function requireValidConfig(runtime = defaultRuntime) {
118
+ const snapshot = await readConfigFileSnapshot();
119
+ if (snapshot.exists && !snapshot.valid) {
120
+ const issues = snapshot.issues.length > 0 ? snapshot.issues.map((issue) => `- ${issue.path}: ${issue.message}`).join("\n") : "Unknown validation issue.";
121
+ runtime.error(`Config invalid:\n${issues}`);
122
+ runtime.error(`Fix the config or run ${formatCliCommand("cryptoclaw doctor")}.`);
123
+ runtime.exit(1);
124
+ return null;
125
+ }
126
+ return snapshot.config;
127
+ }
128
+ function formatAccountLabel(params) {
129
+ const base = params.accountId || DEFAULT_ACCOUNT_ID;
130
+ if (params.name?.trim()) return `${base} (${params.name.trim()})`;
131
+ return base;
132
+ }
133
+ const channelLabel = (channel) => {
134
+ return getChannelPlugin(channel)?.meta.label ?? channel;
135
+ };
136
+ function formatChannelAccountLabel(params) {
137
+ const channelText = channelLabel(params.channel);
138
+ const accountText = formatAccountLabel({
139
+ accountId: params.accountId,
140
+ name: params.name
141
+ });
142
+ return `${params.channelStyle ? params.channelStyle(channelText) : channelText} ${params.accountStyle ? params.accountStyle(accountText) : accountText}`;
143
+ }
144
+ function shouldUseWizard(params) {
145
+ return params?.hasFlags === false;
146
+ }
147
+
148
+ //#endregion
149
+ //#region src/commands/channels/add.ts
150
+ function parseList(value) {
151
+ if (!value?.trim()) return;
152
+ const parsed = value.split(/[\n,;]+/g).map((entry) => entry.trim()).filter(Boolean);
153
+ return parsed.length > 0 ? parsed : void 0;
154
+ }
155
+ function resolveCatalogChannelEntry(raw, cfg) {
156
+ const trimmed = raw.trim().toLowerCase();
157
+ if (!trimmed) return;
158
+ return listChannelPluginCatalogEntries({ workspaceDir: cfg ? resolveAgentWorkspaceDir(cfg, resolveDefaultAgentId(cfg)) : void 0 }).find((entry) => {
159
+ if (entry.id.toLowerCase() === trimmed) return true;
160
+ return (entry.meta.aliases ?? []).some((alias) => alias.trim().toLowerCase() === trimmed);
161
+ });
162
+ }
163
+ async function channelsAddCommand(opts, runtime = defaultRuntime, params) {
164
+ const cfg = await requireValidConfig(runtime);
165
+ if (!cfg) return;
166
+ let nextConfig = cfg;
167
+ if (shouldUseWizard(params)) {
168
+ const prompter = createClackPrompter();
169
+ let selection = [];
170
+ const accountIds = {};
171
+ await prompter.intro("Channel setup");
172
+ let nextConfig = await setupChannels(cfg, runtime, prompter, {
173
+ allowDisable: false,
174
+ allowSignalInstall: true,
175
+ promptAccountIds: true,
176
+ onSelection: (value) => {
177
+ selection = value;
178
+ },
179
+ onAccountId: (channel, accountId) => {
180
+ accountIds[channel] = accountId;
181
+ }
182
+ });
183
+ if (selection.length === 0) {
184
+ await prompter.outro("No channels selected.");
185
+ return;
186
+ }
187
+ if (await prompter.confirm({
188
+ message: "Add display names for these accounts? (optional)",
189
+ initialValue: false
190
+ })) for (const channel of selection) {
191
+ const accountId = accountIds[channel] ?? DEFAULT_ACCOUNT_ID;
192
+ const plugin = getChannelPlugin(channel);
193
+ const account = plugin?.config.resolveAccount(nextConfig, accountId);
194
+ const existingName = (plugin?.config.describeAccount?.(account, nextConfig))?.name ?? account?.name;
195
+ const name = await prompter.text({
196
+ message: `${channel} account name (${accountId})`,
197
+ initialValue: existingName
198
+ });
199
+ if (name?.trim()) nextConfig = applyAccountName({
200
+ cfg: nextConfig,
201
+ channel,
202
+ accountId,
203
+ name
204
+ });
205
+ }
206
+ await writeConfigFile(nextConfig);
207
+ await prompter.outro("Channels updated.");
208
+ return;
209
+ }
210
+ const rawChannel = String(opts.channel ?? "");
211
+ let channel = normalizeChannelId(rawChannel);
212
+ let catalogEntry = channel ? void 0 : resolveCatalogChannelEntry(rawChannel, nextConfig);
213
+ if (!channel && catalogEntry) {
214
+ const prompter = createClackPrompter();
215
+ const workspaceDir = resolveAgentWorkspaceDir(nextConfig, resolveDefaultAgentId(nextConfig));
216
+ const result = await ensureOnboardingPluginInstalled({
217
+ cfg: nextConfig,
218
+ entry: catalogEntry,
219
+ prompter,
220
+ runtime,
221
+ workspaceDir
222
+ });
223
+ nextConfig = result.cfg;
224
+ if (!result.installed) return;
225
+ reloadOnboardingPluginRegistry({
226
+ cfg: nextConfig,
227
+ runtime,
228
+ workspaceDir
229
+ });
230
+ channel = normalizeChannelId(catalogEntry.id) ?? catalogEntry.id;
231
+ }
232
+ if (!channel) {
233
+ const hint = catalogEntry ? `Plugin ${catalogEntry.meta.label} could not be loaded after install.` : `Unknown channel: ${String(opts.channel ?? "")}`;
234
+ runtime.error(hint);
235
+ runtime.exit(1);
236
+ return;
237
+ }
238
+ const plugin = getChannelPlugin(channel);
239
+ if (!plugin?.setup?.applyAccountConfig) {
240
+ runtime.error(`Channel ${channel} does not support add.`);
241
+ runtime.exit(1);
242
+ return;
243
+ }
244
+ const accountId = plugin.setup.resolveAccountId?.({
245
+ cfg: nextConfig,
246
+ accountId: opts.account
247
+ }) ?? normalizeAccountId(opts.account);
248
+ const useEnv = opts.useEnv === true;
249
+ const initialSyncLimit = typeof opts.initialSyncLimit === "number" ? opts.initialSyncLimit : typeof opts.initialSyncLimit === "string" && opts.initialSyncLimit.trim() ? Number.parseInt(opts.initialSyncLimit, 10) : void 0;
250
+ const groupChannels = parseList(opts.groupChannels);
251
+ const dmAllowlist = parseList(opts.dmAllowlist);
252
+ const validationError = plugin.setup.validateInput?.({
253
+ cfg: nextConfig,
254
+ accountId,
255
+ input: {
256
+ name: opts.name,
257
+ token: opts.token,
258
+ tokenFile: opts.tokenFile,
259
+ botToken: opts.botToken,
260
+ appToken: opts.appToken,
261
+ signalNumber: opts.signalNumber,
262
+ cliPath: opts.cliPath,
263
+ dbPath: opts.dbPath,
264
+ service: opts.service,
265
+ region: opts.region,
266
+ authDir: opts.authDir,
267
+ httpUrl: opts.httpUrl,
268
+ httpHost: opts.httpHost,
269
+ httpPort: opts.httpPort,
270
+ webhookPath: opts.webhookPath,
271
+ webhookUrl: opts.webhookUrl,
272
+ audienceType: opts.audienceType,
273
+ audience: opts.audience,
274
+ homeserver: opts.homeserver,
275
+ userId: opts.userId,
276
+ accessToken: opts.accessToken,
277
+ password: opts.password,
278
+ deviceName: opts.deviceName,
279
+ initialSyncLimit,
280
+ useEnv,
281
+ ship: opts.ship,
282
+ url: opts.url,
283
+ code: opts.code,
284
+ groupChannels,
285
+ dmAllowlist,
286
+ autoDiscoverChannels: opts.autoDiscoverChannels
287
+ }
288
+ });
289
+ if (validationError) {
290
+ runtime.error(validationError);
291
+ runtime.exit(1);
292
+ return;
293
+ }
294
+ nextConfig = applyChannelAccountConfig({
295
+ cfg: nextConfig,
296
+ channel,
297
+ accountId,
298
+ name: opts.name,
299
+ token: opts.token,
300
+ tokenFile: opts.tokenFile,
301
+ botToken: opts.botToken,
302
+ appToken: opts.appToken,
303
+ signalNumber: opts.signalNumber,
304
+ cliPath: opts.cliPath,
305
+ dbPath: opts.dbPath,
306
+ service: opts.service,
307
+ region: opts.region,
308
+ authDir: opts.authDir,
309
+ httpUrl: opts.httpUrl,
310
+ httpHost: opts.httpHost,
311
+ httpPort: opts.httpPort,
312
+ webhookPath: opts.webhookPath,
313
+ webhookUrl: opts.webhookUrl,
314
+ audienceType: opts.audienceType,
315
+ audience: opts.audience,
316
+ homeserver: opts.homeserver,
317
+ userId: opts.userId,
318
+ accessToken: opts.accessToken,
319
+ password: opts.password,
320
+ deviceName: opts.deviceName,
321
+ initialSyncLimit,
322
+ useEnv,
323
+ ship: opts.ship,
324
+ url: opts.url,
325
+ code: opts.code,
326
+ groupChannels,
327
+ dmAllowlist,
328
+ autoDiscoverChannels: opts.autoDiscoverChannels
329
+ });
330
+ await writeConfigFile(nextConfig);
331
+ runtime.log(`Added ${channelLabel(channel)} account "${accountId}".`);
332
+ }
333
+
334
+ //#endregion
335
+ //#region src/slack/scopes.ts
336
+ function isRecord(value) {
337
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
338
+ }
339
+ function collectScopes(value, into) {
340
+ if (!value) return;
341
+ if (Array.isArray(value)) {
342
+ for (const entry of value) if (typeof entry === "string" && entry.trim()) into.push(entry.trim());
343
+ return;
344
+ }
345
+ if (typeof value === "string") {
346
+ const raw = value.trim();
347
+ if (!raw) return;
348
+ const parts = raw.split(/[,\s]+/).map((part) => part.trim());
349
+ for (const part of parts) if (part) into.push(part);
350
+ return;
351
+ }
352
+ if (!isRecord(value)) return;
353
+ for (const entry of Object.values(value)) if (Array.isArray(entry) || typeof entry === "string") collectScopes(entry, into);
354
+ }
355
+ function normalizeScopes(scopes) {
356
+ return Array.from(new Set(scopes.map((scope) => scope.trim()).filter(Boolean))).toSorted();
357
+ }
358
+ function extractScopes(payload) {
359
+ if (!isRecord(payload)) return [];
360
+ const scopes = [];
361
+ collectScopes(payload.scopes, scopes);
362
+ collectScopes(payload.scope, scopes);
363
+ if (isRecord(payload.info)) {
364
+ collectScopes(payload.info.scopes, scopes);
365
+ collectScopes(payload.info.scope, scopes);
366
+ collectScopes(payload.info.user_scopes, scopes);
367
+ collectScopes(payload.info.bot_scopes, scopes);
368
+ }
369
+ return normalizeScopes(scopes);
370
+ }
371
+ function readError(payload) {
372
+ if (!isRecord(payload)) return;
373
+ const error = payload.error;
374
+ return typeof error === "string" && error.trim() ? error.trim() : void 0;
375
+ }
376
+ async function callSlack(client, method) {
377
+ try {
378
+ const result = await client.apiCall(method);
379
+ return isRecord(result) ? result : null;
380
+ } catch (err) {
381
+ return {
382
+ ok: false,
383
+ error: err instanceof Error ? err.message : String(err)
384
+ };
385
+ }
386
+ }
387
+ async function fetchSlackScopes(token, timeoutMs) {
388
+ const client = createSlackWebClient(token, { timeout: timeoutMs });
389
+ const attempts = ["auth.scopes", "apps.permissions.info"];
390
+ const errors = [];
391
+ for (const method of attempts) {
392
+ const result = await callSlack(client, method);
393
+ const scopes = extractScopes(result);
394
+ if (scopes.length > 0) return {
395
+ ok: true,
396
+ scopes,
397
+ source: method
398
+ };
399
+ const error = readError(result);
400
+ if (error) errors.push(`${method}: ${error}`);
401
+ }
402
+ return {
403
+ ok: false,
404
+ error: errors.length > 0 ? errors.join(" | ") : "no scopes returned"
405
+ };
406
+ }
407
+
408
+ //#endregion
409
+ //#region src/commands/channels/capabilities.ts
410
+ const REQUIRED_DISCORD_PERMISSIONS = ["ViewChannel", "SendMessages"];
411
+ const TEAMS_GRAPH_PERMISSION_HINTS = {
412
+ "ChannelMessage.Read.All": "channel history",
413
+ "Chat.Read.All": "chat history",
414
+ "Channel.ReadBasic.All": "channel list",
415
+ "Team.ReadBasic.All": "team list",
416
+ "TeamsActivity.Read.All": "teams activity",
417
+ "Sites.Read.All": "files (SharePoint)",
418
+ "Files.Read.All": "files (OneDrive)"
419
+ };
420
+ function normalizeTimeout(raw, fallback = 1e4) {
421
+ const value = typeof raw === "string" ? Number(raw) : Number(raw);
422
+ if (!Number.isFinite(value) || value <= 0) return fallback;
423
+ return value;
424
+ }
425
+ function formatSupport(capabilities) {
426
+ if (!capabilities) return "unknown";
427
+ const bits = [];
428
+ if (capabilities.chatTypes?.length) bits.push(`chatTypes=${capabilities.chatTypes.join(",")}`);
429
+ if (capabilities.polls) bits.push("polls");
430
+ if (capabilities.reactions) bits.push("reactions");
431
+ if (capabilities.edit) bits.push("edit");
432
+ if (capabilities.unsend) bits.push("unsend");
433
+ if (capabilities.reply) bits.push("reply");
434
+ if (capabilities.effects) bits.push("effects");
435
+ if (capabilities.groupManagement) bits.push("groupManagement");
436
+ if (capabilities.threads) bits.push("threads");
437
+ if (capabilities.media) bits.push("media");
438
+ if (capabilities.nativeCommands) bits.push("nativeCommands");
439
+ if (capabilities.blockStreaming) bits.push("blockStreaming");
440
+ return bits.length ? bits.join(" ") : "none";
441
+ }
442
+ function summarizeDiscordTarget(raw) {
443
+ if (!raw) return;
444
+ const target = parseDiscordTarget(raw, { defaultKind: "channel" });
445
+ if (!target) return { raw };
446
+ if (target.kind === "channel") return {
447
+ raw,
448
+ normalized: target.normalized,
449
+ kind: "channel",
450
+ channelId: target.id
451
+ };
452
+ if (target.kind === "user") return {
453
+ raw,
454
+ normalized: target.normalized,
455
+ kind: "user"
456
+ };
457
+ return {
458
+ raw,
459
+ normalized: target.normalized
460
+ };
461
+ }
462
+ function formatDiscordIntents(intents) {
463
+ if (!intents) return "unknown";
464
+ return [
465
+ `messageContent=${intents.messageContent ?? "unknown"}`,
466
+ `guildMembers=${intents.guildMembers ?? "unknown"}`,
467
+ `presence=${intents.presence ?? "unknown"}`
468
+ ].join(" ");
469
+ }
470
+ function formatProbeLines(channelId, probe) {
471
+ const lines = [];
472
+ if (!probe || typeof probe !== "object") return lines;
473
+ const probeObj = probe;
474
+ if (channelId === "discord") {
475
+ const bot = probeObj.bot;
476
+ if (bot?.username) {
477
+ const botId = bot.id ? ` (${bot.id})` : "";
478
+ lines.push(`Bot: ${theme.accent(`@${bot.username}`)}${botId}`);
479
+ }
480
+ const app = probeObj.application;
481
+ if (app?.intents) lines.push(`Intents: ${formatDiscordIntents(app.intents)}`);
482
+ }
483
+ if (channelId === "telegram") {
484
+ const bot = probeObj.bot;
485
+ if (bot?.username) {
486
+ const botId = bot.id ? ` (${bot.id})` : "";
487
+ lines.push(`Bot: ${theme.accent(`@${bot.username}`)}${botId}`);
488
+ }
489
+ const flags = [];
490
+ const canJoinGroups = bot?.canJoinGroups;
491
+ const canReadAll = bot?.canReadAllGroupMessages;
492
+ const inlineQueries = bot?.supportsInlineQueries;
493
+ if (typeof canJoinGroups === "boolean") flags.push(`joinGroups=${canJoinGroups}`);
494
+ if (typeof canReadAll === "boolean") flags.push(`readAllGroupMessages=${canReadAll}`);
495
+ if (typeof inlineQueries === "boolean") flags.push(`inlineQueries=${inlineQueries}`);
496
+ if (flags.length > 0) lines.push(`Flags: ${flags.join(" ")}`);
497
+ const webhook = probeObj.webhook;
498
+ if (webhook?.url !== void 0) lines.push(`Webhook: ${webhook.url || "none"}`);
499
+ }
500
+ if (channelId === "slack") {
501
+ const bot = probeObj.bot;
502
+ const team = probeObj.team;
503
+ if (bot?.name) lines.push(`Bot: ${theme.accent(`@${bot.name}`)}`);
504
+ if (team?.name || team?.id) {
505
+ const id = team?.id ? ` (${team.id})` : "";
506
+ lines.push(`Team: ${team?.name ?? "unknown"}${id}`);
507
+ }
508
+ }
509
+ if (channelId === "signal") {
510
+ const version = probeObj.version;
511
+ if (version) lines.push(`Signal daemon: ${version}`);
512
+ }
513
+ if (channelId === "msteams") {
514
+ const appId = typeof probeObj.appId === "string" ? probeObj.appId.trim() : "";
515
+ if (appId) lines.push(`App: ${theme.accent(appId)}`);
516
+ const graph = probeObj.graph;
517
+ if (graph) {
518
+ const roles = Array.isArray(graph.roles) ? graph.roles.map((role) => String(role).trim()).filter(Boolean) : [];
519
+ const scopes = typeof graph.scopes === "string" ? graph.scopes.split(/\s+/).map((scope) => scope.trim()).filter(Boolean) : Array.isArray(graph.scopes) ? graph.scopes.map((scope) => String(scope).trim()).filter(Boolean) : [];
520
+ if (graph.ok === false) lines.push(`Graph: ${theme.error(graph.error ?? "failed")}`);
521
+ else if (roles.length > 0 || scopes.length > 0) {
522
+ const formatPermission = (permission) => {
523
+ const hint = TEAMS_GRAPH_PERMISSION_HINTS[permission];
524
+ return hint ? `${permission} (${hint})` : permission;
525
+ };
526
+ if (roles.length > 0) lines.push(`Graph roles: ${roles.map(formatPermission).join(", ")}`);
527
+ if (scopes.length > 0) lines.push(`Graph scopes: ${scopes.map(formatPermission).join(", ")}`);
528
+ } else if (graph.ok === true) lines.push("Graph: ok");
529
+ }
530
+ }
531
+ const ok = typeof probeObj.ok === "boolean" ? probeObj.ok : void 0;
532
+ if (ok === true && lines.length === 0) lines.push("Probe: ok");
533
+ if (ok === false) {
534
+ const error = typeof probeObj.error === "string" && probeObj.error ? ` (${probeObj.error})` : "";
535
+ lines.push(`Probe: ${theme.error(`failed${error}`)}`);
536
+ }
537
+ return lines;
538
+ }
539
+ async function buildDiscordPermissions(params) {
540
+ const target = summarizeDiscordTarget(params.target?.trim());
541
+ if (!target) return {};
542
+ if (target.kind !== "channel" || !target.channelId) return {
543
+ target,
544
+ report: { error: "Target looks like a DM user; pass channel:<id> to audit channel permissions." }
545
+ };
546
+ const token = params.account.token?.trim();
547
+ if (!token) return {
548
+ target,
549
+ report: {
550
+ channelId: target.channelId,
551
+ error: "Discord bot token missing for permission audit."
552
+ }
553
+ };
554
+ try {
555
+ const perms = await fetchChannelPermissionsDiscord(target.channelId, {
556
+ token,
557
+ accountId: params.account.accountId ?? void 0
558
+ });
559
+ const missing = REQUIRED_DISCORD_PERMISSIONS.filter((permission) => !perms.permissions.includes(permission));
560
+ return {
561
+ target,
562
+ report: {
563
+ channelId: perms.channelId,
564
+ guildId: perms.guildId,
565
+ isDm: perms.isDm,
566
+ channelType: perms.channelType,
567
+ permissions: perms.permissions,
568
+ missingRequired: missing.length ? missing : [],
569
+ raw: perms.raw
570
+ }
571
+ };
572
+ } catch (err) {
573
+ return {
574
+ target,
575
+ report: {
576
+ channelId: target.channelId,
577
+ error: err instanceof Error ? err.message : String(err)
578
+ }
579
+ };
580
+ }
581
+ }
582
+ async function resolveChannelReports(params) {
583
+ const { plugin, cfg, timeoutMs } = params;
584
+ const accountIds = params.accountOverride ? [params.accountOverride] : (() => {
585
+ const ids = plugin.config.listAccountIds(cfg);
586
+ return ids.length > 0 ? ids : [resolveChannelDefaultAccountId({
587
+ plugin,
588
+ cfg,
589
+ accountIds: ids
590
+ })];
591
+ })();
592
+ const reports = [];
593
+ const listedActions = plugin.actions?.listActions?.({ cfg }) ?? [];
594
+ const actions = Array.from(new Set([
595
+ "send",
596
+ "broadcast",
597
+ ...listedActions.map((action) => String(action))
598
+ ]));
599
+ for (const accountId of accountIds) {
600
+ const resolvedAccount = plugin.config.resolveAccount(cfg, accountId);
601
+ const configured = plugin.config.isConfigured ? await plugin.config.isConfigured(resolvedAccount, cfg) : Boolean(resolvedAccount);
602
+ const enabled = plugin.config.isEnabled ? plugin.config.isEnabled(resolvedAccount, cfg) : resolvedAccount.enabled !== false;
603
+ let probe;
604
+ if (configured && enabled && plugin.status?.probeAccount) try {
605
+ probe = await plugin.status.probeAccount({
606
+ account: resolvedAccount,
607
+ timeoutMs,
608
+ cfg
609
+ });
610
+ } catch (err) {
611
+ probe = {
612
+ ok: false,
613
+ error: err instanceof Error ? err.message : String(err)
614
+ };
615
+ }
616
+ let slackScopes;
617
+ if (plugin.id === "slack" && configured && enabled) {
618
+ const botToken = resolvedAccount.botToken?.trim();
619
+ const userToken = resolvedAccount.config?.userToken?.trim();
620
+ const scopeReports = [];
621
+ if (botToken) scopeReports.push({
622
+ tokenType: "bot",
623
+ result: await fetchSlackScopes(botToken, timeoutMs)
624
+ });
625
+ else scopeReports.push({
626
+ tokenType: "bot",
627
+ result: {
628
+ ok: false,
629
+ error: "Slack bot token missing."
630
+ }
631
+ });
632
+ if (userToken) scopeReports.push({
633
+ tokenType: "user",
634
+ result: await fetchSlackScopes(userToken, timeoutMs)
635
+ });
636
+ slackScopes = scopeReports;
637
+ }
638
+ let discordTarget;
639
+ let discordPermissions;
640
+ if (plugin.id === "discord" && params.target) {
641
+ const perms = await buildDiscordPermissions({
642
+ account: resolvedAccount,
643
+ target: params.target
644
+ });
645
+ discordTarget = perms.target;
646
+ discordPermissions = perms.report;
647
+ }
648
+ reports.push({
649
+ channel: plugin.id,
650
+ accountId,
651
+ accountName: typeof resolvedAccount.name === "string" ? resolvedAccount.name?.trim() || void 0 : void 0,
652
+ configured,
653
+ enabled,
654
+ support: plugin.capabilities,
655
+ probe,
656
+ target: discordTarget,
657
+ channelPermissions: discordPermissions,
658
+ actions,
659
+ slackScopes
660
+ });
661
+ }
662
+ return reports;
663
+ }
664
+ async function channelsCapabilitiesCommand(opts, runtime = defaultRuntime) {
665
+ const cfg = await requireValidConfig(runtime);
666
+ if (!cfg) return;
667
+ const timeoutMs = normalizeTimeout(opts.timeout, 1e4);
668
+ const rawChannel = typeof opts.channel === "string" ? opts.channel.trim().toLowerCase() : "";
669
+ const rawTarget = typeof opts.target === "string" ? opts.target.trim() : "";
670
+ if (opts.account && (!rawChannel || rawChannel === "all")) {
671
+ runtime.error(danger("--account requires a specific --channel."));
672
+ runtime.exit(1);
673
+ return;
674
+ }
675
+ if (rawTarget && rawChannel !== "discord") {
676
+ runtime.error(danger("--target requires --channel discord."));
677
+ runtime.exit(1);
678
+ return;
679
+ }
680
+ const plugins = listChannelPlugins();
681
+ const selected = !rawChannel || rawChannel === "all" ? plugins : (() => {
682
+ const plugin = getChannelPlugin(rawChannel);
683
+ if (!plugin) return null;
684
+ return [plugin];
685
+ })();
686
+ if (!selected || selected.length === 0) {
687
+ runtime.error(danger(`Unknown channel "${rawChannel}".`));
688
+ runtime.exit(1);
689
+ return;
690
+ }
691
+ const reports = [];
692
+ for (const plugin of selected) {
693
+ const accountOverride = opts.account?.trim() || void 0;
694
+ reports.push(...await resolveChannelReports({
695
+ plugin,
696
+ cfg,
697
+ timeoutMs,
698
+ accountOverride,
699
+ target: rawTarget && plugin.id === "discord" ? rawTarget : void 0
700
+ }));
701
+ }
702
+ if (opts.json) {
703
+ runtime.log(JSON.stringify({ channels: reports }, null, 2));
704
+ return;
705
+ }
706
+ const lines = [];
707
+ for (const report of reports) {
708
+ const label = formatChannelAccountLabel({
709
+ channel: report.channel,
710
+ accountId: report.accountId,
711
+ name: report.accountName,
712
+ channelStyle: theme.accent,
713
+ accountStyle: theme.heading
714
+ });
715
+ lines.push(theme.heading(label));
716
+ lines.push(`Support: ${formatSupport(report.support)}`);
717
+ if (report.actions && report.actions.length > 0) lines.push(`Actions: ${report.actions.join(", ")}`);
718
+ if (report.configured === false || report.enabled === false) {
719
+ const configuredLabel = report.configured === false ? "not configured" : "configured";
720
+ const enabledLabel = report.enabled === false ? "disabled" : "enabled";
721
+ lines.push(`Status: ${configuredLabel}, ${enabledLabel}`);
722
+ }
723
+ const probeLines = formatProbeLines(report.channel, report.probe);
724
+ if (probeLines.length > 0) lines.push(...probeLines);
725
+ else if (report.configured && report.enabled) lines.push(theme.muted("Probe: unavailable"));
726
+ if (report.channel === "slack" && report.slackScopes) for (const entry of report.slackScopes) {
727
+ const source = entry.result.source ? ` (${entry.result.source})` : "";
728
+ const label = entry.tokenType === "user" ? "User scopes" : "Bot scopes";
729
+ if (entry.result.ok && entry.result.scopes?.length) lines.push(`${label}${source}: ${entry.result.scopes.join(", ")}`);
730
+ else if (entry.result.error) lines.push(`${label}: ${theme.error(entry.result.error)}`);
731
+ }
732
+ if (report.channel === "discord" && report.channelPermissions) {
733
+ const perms = report.channelPermissions;
734
+ if (perms.error) lines.push(`Permissions: ${theme.error(perms.error)}`);
735
+ else {
736
+ const list = perms.permissions?.length ? perms.permissions.join(", ") : "none";
737
+ const label = perms.channelId ? ` (${perms.channelId})` : "";
738
+ lines.push(`Permissions${label}: ${list}`);
739
+ if (perms.missingRequired && perms.missingRequired.length > 0) lines.push(`${theme.warn("Missing required:")} ${perms.missingRequired.join(", ")}`);
740
+ else lines.push(theme.success("Missing required: none"));
741
+ }
742
+ } else if (report.channel === "discord" && rawTarget && !report.channelPermissions) lines.push(theme.muted("Permissions: skipped (no target)."));
743
+ lines.push("");
744
+ }
745
+ runtime.log(lines.join("\n").trimEnd());
746
+ }
747
+
748
+ //#endregion
749
+ //#region src/commands/channels/list.ts
750
+ const colorValue = (value) => {
751
+ if (value === "none") return theme.error(value);
752
+ if (value === "env") return theme.accent(value);
753
+ return theme.success(value);
754
+ };
755
+ function formatEnabled(value) {
756
+ return value === false ? theme.error("disabled") : theme.success("enabled");
757
+ }
758
+ function formatConfigured(value) {
759
+ return value ? theme.success("configured") : theme.warn("not configured");
760
+ }
761
+ function formatTokenSource(source) {
762
+ return `token=${colorValue(source || "none")}`;
763
+ }
764
+ function formatSource(label, source) {
765
+ return `${label}=${colorValue(source || "none")}`;
766
+ }
767
+ function formatLinked(value) {
768
+ return value ? theme.success("linked") : theme.warn("not linked");
769
+ }
770
+ function shouldShowConfigured(channel) {
771
+ return channel.meta.showConfigured !== false;
772
+ }
773
+ function formatAccountLine(params) {
774
+ const { channel, snapshot } = params;
775
+ const label = formatChannelAccountLabel({
776
+ channel: channel.id,
777
+ accountId: snapshot.accountId,
778
+ name: snapshot.name,
779
+ channelStyle: theme.accent,
780
+ accountStyle: theme.heading
781
+ });
782
+ const bits = [];
783
+ if (snapshot.linked !== void 0) bits.push(formatLinked(snapshot.linked));
784
+ if (shouldShowConfigured(channel) && typeof snapshot.configured === "boolean") bits.push(formatConfigured(snapshot.configured));
785
+ if (snapshot.tokenSource) bits.push(formatTokenSource(snapshot.tokenSource));
786
+ if (snapshot.botTokenSource) bits.push(formatSource("bot", snapshot.botTokenSource));
787
+ if (snapshot.appTokenSource) bits.push(formatSource("app", snapshot.appTokenSource));
788
+ if (snapshot.baseUrl) bits.push(`base=${theme.muted(snapshot.baseUrl)}`);
789
+ if (typeof snapshot.enabled === "boolean") bits.push(formatEnabled(snapshot.enabled));
790
+ return `- ${label}: ${bits.join(", ")}`;
791
+ }
792
+ async function loadUsageWithProgress(runtime) {
793
+ try {
794
+ return await withProgress({
795
+ label: "Fetching usage snapshot…",
796
+ indeterminate: true,
797
+ enabled: true
798
+ }, async () => await loadProviderUsageSummary());
799
+ } catch (err) {
800
+ runtime.error(String(err));
801
+ return null;
802
+ }
803
+ }
804
+ async function channelsListCommand(opts, runtime = defaultRuntime) {
805
+ const cfg = await requireValidConfig(runtime);
806
+ if (!cfg) return;
807
+ const includeUsage = opts.usage !== false;
808
+ const plugins = listChannelPlugins();
809
+ const authStore = loadAuthProfileStore();
810
+ const authProfiles = Object.entries(authStore.profiles).map(([profileId, profile]) => ({
811
+ id: profileId,
812
+ provider: profile.provider,
813
+ type: profile.type,
814
+ isExternal: false
815
+ }));
816
+ if (opts.json) {
817
+ const usage = includeUsage ? await loadProviderUsageSummary() : void 0;
818
+ const chat = {};
819
+ for (const plugin of plugins) chat[plugin.id] = plugin.config.listAccountIds(cfg);
820
+ const payload = {
821
+ chat,
822
+ auth: authProfiles,
823
+ ...usage ? { usage } : {}
824
+ };
825
+ runtime.log(JSON.stringify(payload, null, 2));
826
+ return;
827
+ }
828
+ const lines = [];
829
+ lines.push(theme.heading("Chat channels:"));
830
+ for (const plugin of plugins) {
831
+ const accounts = plugin.config.listAccountIds(cfg);
832
+ if (!accounts || accounts.length === 0) continue;
833
+ for (const accountId of accounts) {
834
+ const snapshot = await buildChannelAccountSnapshot({
835
+ plugin,
836
+ cfg,
837
+ accountId
838
+ });
839
+ lines.push(formatAccountLine({
840
+ channel: plugin,
841
+ snapshot
842
+ }));
843
+ }
844
+ }
845
+ lines.push("");
846
+ lines.push(theme.heading("Auth providers (OAuth + API keys):"));
847
+ if (authProfiles.length === 0) lines.push(theme.muted("- none"));
848
+ else for (const profile of authProfiles) {
849
+ const external = profile.isExternal ? theme.muted(" (synced)") : "";
850
+ lines.push(`- ${theme.accent(profile.id)} (${theme.success(profile.type)}${external})`);
851
+ }
852
+ runtime.log(lines.join("\n"));
853
+ if (includeUsage) {
854
+ runtime.log("");
855
+ const usage = await loadUsageWithProgress(runtime);
856
+ if (usage) {
857
+ const usageLines = formatUsageReportLines(usage);
858
+ if (usageLines.length > 0) {
859
+ usageLines[0] = theme.accent(usageLines[0]);
860
+ runtime.log(usageLines.join("\n"));
861
+ }
862
+ }
863
+ }
864
+ runtime.log("");
865
+ runtime.log(`Docs: ${formatDocsLink("/gateway/configuration", "gateway/configuration")}`);
866
+ }
867
+
868
+ //#endregion
869
+ //#region src/commands/channels/logs.ts
870
+ const DEFAULT_LIMIT = 200;
871
+ const MAX_BYTES = 1e6;
872
+ const getChannelSet = () => new Set([...listChannelPlugins().map((plugin) => plugin.id), "all"]);
873
+ function parseChannelFilter(raw) {
874
+ const trimmed = raw?.trim().toLowerCase();
875
+ if (!trimmed) return "all";
876
+ return getChannelSet().has(trimmed) ? trimmed : "all";
877
+ }
878
+ function matchesChannel(line, channel) {
879
+ if (channel === "all") return true;
880
+ const needle = `gateway/channels/${channel}`;
881
+ if (line.subsystem?.includes(needle)) return true;
882
+ if (line.module?.includes(channel)) return true;
883
+ return false;
884
+ }
885
+ async function readTailLines(file, limit) {
886
+ const stat = await fs.stat(file).catch(() => null);
887
+ if (!stat) return [];
888
+ const size = stat.size;
889
+ const start = Math.max(0, size - MAX_BYTES);
890
+ const handle = await fs.open(file, "r");
891
+ try {
892
+ const length = Math.max(0, size - start);
893
+ if (length === 0) return [];
894
+ const buffer = Buffer.alloc(length);
895
+ const readResult = await handle.read(buffer, 0, length, start);
896
+ let lines = buffer.toString("utf8", 0, readResult.bytesRead).split("\n");
897
+ if (start > 0) lines = lines.slice(1);
898
+ if (lines.length && lines[lines.length - 1] === "") lines = lines.slice(0, -1);
899
+ if (lines.length > limit) lines = lines.slice(lines.length - limit);
900
+ return lines;
901
+ } finally {
902
+ await handle.close();
903
+ }
904
+ }
905
+ async function channelsLogsCommand(opts, runtime = defaultRuntime) {
906
+ const channel = parseChannelFilter(opts.channel);
907
+ const limitRaw = typeof opts.lines === "string" ? Number(opts.lines) : opts.lines;
908
+ const limit = typeof limitRaw === "number" && Number.isFinite(limitRaw) && limitRaw > 0 ? Math.floor(limitRaw) : DEFAULT_LIMIT;
909
+ const file = getResolvedLoggerSettings().file;
910
+ const filtered = (await readTailLines(file, limit * 4)).map(parseLogLine).filter((line) => Boolean(line)).filter((line) => matchesChannel(line, channel));
911
+ const lines = filtered.slice(Math.max(0, filtered.length - limit));
912
+ if (opts.json) {
913
+ runtime.log(JSON.stringify({
914
+ file,
915
+ channel,
916
+ lines
917
+ }, null, 2));
918
+ return;
919
+ }
920
+ runtime.log(theme.info(`Log file: ${file}`));
921
+ if (channel !== "all") runtime.log(theme.info(`Channel: ${channel}`));
922
+ if (lines.length === 0) {
923
+ runtime.log(theme.muted("No matching log lines."));
924
+ return;
925
+ }
926
+ for (const line of lines) {
927
+ const ts = line.time ? `${line.time} ` : "";
928
+ const level = line.level ? `${line.level.toLowerCase()} ` : "";
929
+ runtime.log(`${ts}${level}${line.message}`.trim());
930
+ }
931
+ }
932
+
933
+ //#endregion
934
+ //#region src/commands/channels/remove.ts
935
+ function listAccountIds(cfg, channel) {
936
+ const plugin = getChannelPlugin(channel);
937
+ if (!plugin) return [];
938
+ return plugin.config.listAccountIds(cfg);
939
+ }
940
+ async function channelsRemoveCommand(opts, runtime = defaultRuntime, params) {
941
+ const cfg = await requireValidConfig(runtime);
942
+ if (!cfg) return;
943
+ const useWizard = shouldUseWizard(params);
944
+ const prompter = useWizard ? createClackPrompter() : null;
945
+ let channel = normalizeChannelId(opts.channel);
946
+ let accountId = normalizeAccountId(opts.account);
947
+ const deleteConfig = Boolean(opts.delete);
948
+ if (useWizard && prompter) {
949
+ await prompter.intro("Remove channel account");
950
+ const selectedChannel = await prompter.select({
951
+ message: "Channel",
952
+ options: listChannelPlugins().map((plugin) => ({
953
+ value: plugin.id,
954
+ label: plugin.meta.label
955
+ }))
956
+ });
957
+ channel = selectedChannel;
958
+ accountId = await (async () => {
959
+ const ids = listAccountIds(cfg, selectedChannel);
960
+ return normalizeAccountId(await prompter.select({
961
+ message: "Account",
962
+ options: ids.map((id) => ({
963
+ value: id,
964
+ label: id === DEFAULT_ACCOUNT_ID ? "default (primary)" : id
965
+ })),
966
+ initialValue: ids[0] ?? DEFAULT_ACCOUNT_ID
967
+ }));
968
+ })();
969
+ if (!await prompter.confirm({
970
+ message: `Disable ${channelLabel(selectedChannel)} account "${accountId}"? (keeps config)`,
971
+ initialValue: true
972
+ })) {
973
+ await prompter.outro("Cancelled.");
974
+ return;
975
+ }
976
+ } else {
977
+ if (!channel) {
978
+ runtime.error("Channel is required. Use --channel <name>.");
979
+ runtime.exit(1);
980
+ return;
981
+ }
982
+ if (!deleteConfig) {
983
+ if (!await createClackPrompter().confirm({
984
+ message: `Disable ${channelLabel(channel)} account "${accountId}"? (keeps config)`,
985
+ initialValue: true
986
+ })) return;
987
+ }
988
+ }
989
+ const plugin = getChannelPlugin(channel);
990
+ if (!plugin) {
991
+ runtime.error(`Unknown channel: ${channel}`);
992
+ runtime.exit(1);
993
+ return;
994
+ }
995
+ const resolvedAccountId = normalizeAccountId(accountId) ?? resolveChannelDefaultAccountId({
996
+ plugin,
997
+ cfg
998
+ });
999
+ const accountKey = resolvedAccountId || DEFAULT_ACCOUNT_ID;
1000
+ let next = { ...cfg };
1001
+ if (deleteConfig) {
1002
+ if (!plugin.config.deleteAccount) {
1003
+ runtime.error(`Channel ${channel} does not support delete.`);
1004
+ runtime.exit(1);
1005
+ return;
1006
+ }
1007
+ next = plugin.config.deleteAccount({
1008
+ cfg: next,
1009
+ accountId: resolvedAccountId
1010
+ });
1011
+ } else {
1012
+ if (!plugin.config.setAccountEnabled) {
1013
+ runtime.error(`Channel ${channel} does not support disable.`);
1014
+ runtime.exit(1);
1015
+ return;
1016
+ }
1017
+ next = plugin.config.setAccountEnabled({
1018
+ cfg: next,
1019
+ accountId: resolvedAccountId,
1020
+ enabled: false
1021
+ });
1022
+ }
1023
+ await writeConfigFile(next);
1024
+ if (useWizard && prompter) await prompter.outro(deleteConfig ? `Deleted ${channelLabel(channel)} account "${accountKey}".` : `Disabled ${channelLabel(channel)} account "${accountKey}".`);
1025
+ else runtime.log(deleteConfig ? `Deleted ${channelLabel(channel)} account "${accountKey}".` : `Disabled ${channelLabel(channel)} account "${accountKey}".`);
1026
+ }
1027
+
1028
+ //#endregion
1029
+ //#region src/commands/channels/resolve.ts
1030
+ function resolvePreferredKind(kind) {
1031
+ if (!kind || kind === "auto") return;
1032
+ if (kind === "user") return "user";
1033
+ return "group";
1034
+ }
1035
+ function detectAutoKind(input) {
1036
+ const trimmed = input.trim();
1037
+ if (!trimmed) return "group";
1038
+ if (trimmed.startsWith("@")) return "user";
1039
+ if (/^<@!?/.test(trimmed)) return "user";
1040
+ if (/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(trimmed)) return "user";
1041
+ if (/^(user|discord|slack|matrix|msteams|teams|zalo|zalouser|googlechat|google-chat|gchat):/i.test(trimmed)) return "user";
1042
+ return "group";
1043
+ }
1044
+ function formatResolveResult(result) {
1045
+ if (!result.resolved || !result.id) return `${result.input} -> unresolved`;
1046
+ const name = result.name ? ` (${result.name})` : "";
1047
+ const note = result.note ? ` [${result.note}]` : "";
1048
+ return `${result.input} -> ${result.id}${name}${note}`;
1049
+ }
1050
+ async function channelsResolveCommand(opts, runtime) {
1051
+ const cfg = loadConfig();
1052
+ const entries = (opts.entries ?? []).map((entry) => entry.trim()).filter(Boolean);
1053
+ if (entries.length === 0) throw new Error("At least one entry is required.");
1054
+ const selection = await resolveMessageChannelSelection({
1055
+ cfg,
1056
+ channel: opts.channel ?? null
1057
+ });
1058
+ const plugin = getChannelPlugin(selection.channel);
1059
+ if (!plugin?.resolver?.resolveTargets) throw new Error(`Channel ${selection.channel} does not support resolve.`);
1060
+ const preferredKind = resolvePreferredKind(opts.kind);
1061
+ let results = [];
1062
+ if (preferredKind) results = (await plugin.resolver.resolveTargets({
1063
+ cfg,
1064
+ accountId: opts.account ?? null,
1065
+ inputs: entries,
1066
+ kind: preferredKind,
1067
+ runtime
1068
+ })).map((entry) => ({
1069
+ input: entry.input,
1070
+ resolved: entry.resolved,
1071
+ id: entry.id,
1072
+ name: entry.name,
1073
+ note: entry.note
1074
+ }));
1075
+ else {
1076
+ const byKind = /* @__PURE__ */ new Map();
1077
+ for (const entry of entries) {
1078
+ const kind = detectAutoKind(entry);
1079
+ byKind.set(kind, [...byKind.get(kind) ?? [], entry]);
1080
+ }
1081
+ const resolved = [];
1082
+ for (const [kind, inputs] of byKind.entries()) {
1083
+ const batch = await plugin.resolver.resolveTargets({
1084
+ cfg,
1085
+ accountId: opts.account ?? null,
1086
+ inputs,
1087
+ kind,
1088
+ runtime
1089
+ });
1090
+ resolved.push(...batch);
1091
+ }
1092
+ const byInput = new Map(resolved.map((entry) => [entry.input, entry]));
1093
+ results = entries.map((input) => {
1094
+ const entry = byInput.get(input);
1095
+ return {
1096
+ input,
1097
+ resolved: entry?.resolved ?? false,
1098
+ id: entry?.id,
1099
+ name: entry?.name,
1100
+ note: entry?.note
1101
+ };
1102
+ });
1103
+ }
1104
+ if (opts.json) {
1105
+ runtime.log(JSON.stringify(results, null, 2));
1106
+ return;
1107
+ }
1108
+ for (const result of results) if (result.resolved && result.id) runtime.log(formatResolveResult(result));
1109
+ else runtime.error(danger(`${result.input} -> unresolved${result.error ? ` (${result.error})` : result.note ? ` (${result.note})` : ""}`));
1110
+ }
1111
+
1112
+ //#endregion
1113
+ //#region src/commands/channels/status.ts
1114
+ function formatGatewayChannelsStatusLines(payload) {
1115
+ const lines = [];
1116
+ lines.push(theme.success("Gateway reachable."));
1117
+ const accountLines = (provider, accounts) => accounts.map((account) => {
1118
+ const bits = [];
1119
+ if (typeof account.enabled === "boolean") bits.push(account.enabled ? "enabled" : "disabled");
1120
+ if (typeof account.configured === "boolean") bits.push(account.configured ? "configured" : "not configured");
1121
+ if (typeof account.linked === "boolean") bits.push(account.linked ? "linked" : "not linked");
1122
+ if (typeof account.running === "boolean") bits.push(account.running ? "running" : "stopped");
1123
+ if (typeof account.connected === "boolean") bits.push(account.connected ? "connected" : "disconnected");
1124
+ const inboundAt = typeof account.lastInboundAt === "number" && Number.isFinite(account.lastInboundAt) ? account.lastInboundAt : null;
1125
+ const outboundAt = typeof account.lastOutboundAt === "number" && Number.isFinite(account.lastOutboundAt) ? account.lastOutboundAt : null;
1126
+ if (inboundAt) bits.push(`in:${formatAge(Date.now() - inboundAt)}`);
1127
+ if (outboundAt) bits.push(`out:${formatAge(Date.now() - outboundAt)}`);
1128
+ if (typeof account.mode === "string" && account.mode.length > 0) bits.push(`mode:${account.mode}`);
1129
+ const botUsername = (() => {
1130
+ const bot = account.bot;
1131
+ const probeBot = account.probe?.bot;
1132
+ const raw = bot?.username ?? probeBot?.username ?? "";
1133
+ if (typeof raw !== "string") return "";
1134
+ const trimmed = raw.trim();
1135
+ if (!trimmed) return "";
1136
+ return trimmed.startsWith("@") ? trimmed : `@${trimmed}`;
1137
+ })();
1138
+ if (botUsername) bits.push(`bot:${botUsername}`);
1139
+ if (typeof account.dmPolicy === "string" && account.dmPolicy.length > 0) bits.push(`dm:${account.dmPolicy}`);
1140
+ if (Array.isArray(account.allowFrom) && account.allowFrom.length > 0) bits.push(`allow:${account.allowFrom.slice(0, 2).join(",")}`);
1141
+ if (typeof account.tokenSource === "string" && account.tokenSource) bits.push(`token:${account.tokenSource}`);
1142
+ if (typeof account.botTokenSource === "string" && account.botTokenSource) bits.push(`bot:${account.botTokenSource}`);
1143
+ if (typeof account.appTokenSource === "string" && account.appTokenSource) bits.push(`app:${account.appTokenSource}`);
1144
+ const messageContent = account.application?.intents?.messageContent;
1145
+ if (typeof messageContent === "string" && messageContent.length > 0 && messageContent !== "enabled") bits.push(`intents:content=${messageContent}`);
1146
+ if (account.allowUnmentionedGroups === true) bits.push("groups:unmentioned");
1147
+ if (typeof account.baseUrl === "string" && account.baseUrl) bits.push(`url:${account.baseUrl}`);
1148
+ const probe = account.probe;
1149
+ if (probe && typeof probe.ok === "boolean") bits.push(probe.ok ? "works" : "probe failed");
1150
+ const audit = account.audit;
1151
+ if (audit && typeof audit.ok === "boolean") bits.push(audit.ok ? "audit ok" : "audit failed");
1152
+ if (typeof account.lastError === "string" && account.lastError) bits.push(`error:${account.lastError}`);
1153
+ return `- ${formatChannelAccountLabel({
1154
+ channel: provider,
1155
+ accountId: typeof account.accountId === "string" ? account.accountId : "default",
1156
+ name: (typeof account.name === "string" ? account.name.trim() : "") || void 0
1157
+ })}: ${bits.join(", ")}`;
1158
+ });
1159
+ const plugins = listChannelPlugins();
1160
+ const accountsByChannel = payload.channelAccounts;
1161
+ const accountPayloads = {};
1162
+ for (const plugin of plugins) {
1163
+ const raw = accountsByChannel?.[plugin.id];
1164
+ if (Array.isArray(raw)) accountPayloads[plugin.id] = raw;
1165
+ }
1166
+ for (const plugin of plugins) {
1167
+ const accounts = accountPayloads[plugin.id];
1168
+ if (accounts && accounts.length > 0) lines.push(...accountLines(plugin.id, accounts));
1169
+ }
1170
+ lines.push("");
1171
+ const issues = collectChannelStatusIssues(payload);
1172
+ if (issues.length > 0) {
1173
+ lines.push(theme.warn("Warnings:"));
1174
+ for (const issue of issues) lines.push(`- ${issue.channel} ${issue.accountId}: ${issue.message}${issue.fix ? ` (${issue.fix})` : ""}`);
1175
+ lines.push(`- Run: ${formatCliCommand("cryptoclaw doctor")}`);
1176
+ lines.push("");
1177
+ }
1178
+ lines.push(`Tip: ${formatDocsLink("/cli#status", "status --deep")} adds gateway health probes to status output (requires a reachable gateway).`);
1179
+ return lines;
1180
+ }
1181
+ async function formatConfigChannelsStatusLines(cfg, meta) {
1182
+ const lines = [];
1183
+ lines.push(theme.warn("Gateway not reachable; showing config-only status."));
1184
+ if (meta.path) lines.push(`Config: ${meta.path}`);
1185
+ if (meta.mode) lines.push(`Mode: ${meta.mode}`);
1186
+ if (meta.path || meta.mode) lines.push("");
1187
+ const accountLines = (provider, accounts) => accounts.map((account) => {
1188
+ const bits = [];
1189
+ if (typeof account.enabled === "boolean") bits.push(account.enabled ? "enabled" : "disabled");
1190
+ if (typeof account.configured === "boolean") bits.push(account.configured ? "configured" : "not configured");
1191
+ if (typeof account.linked === "boolean") bits.push(account.linked ? "linked" : "not linked");
1192
+ if (typeof account.mode === "string" && account.mode.length > 0) bits.push(`mode:${account.mode}`);
1193
+ if (typeof account.tokenSource === "string" && account.tokenSource) bits.push(`token:${account.tokenSource}`);
1194
+ if (typeof account.botTokenSource === "string" && account.botTokenSource) bits.push(`bot:${account.botTokenSource}`);
1195
+ if (typeof account.appTokenSource === "string" && account.appTokenSource) bits.push(`app:${account.appTokenSource}`);
1196
+ if (typeof account.baseUrl === "string" && account.baseUrl) bits.push(`url:${account.baseUrl}`);
1197
+ return `- ${formatChannelAccountLabel({
1198
+ channel: provider,
1199
+ accountId: typeof account.accountId === "string" ? account.accountId : "default",
1200
+ name: (typeof account.name === "string" ? account.name.trim() : "") || void 0
1201
+ })}: ${bits.join(", ")}`;
1202
+ });
1203
+ const plugins = listChannelPlugins();
1204
+ for (const plugin of plugins) {
1205
+ const accountIds = plugin.config.listAccountIds(cfg);
1206
+ if (!accountIds.length) continue;
1207
+ const snapshots = [];
1208
+ for (const accountId of accountIds) {
1209
+ const snapshot = await buildChannelAccountSnapshot({
1210
+ plugin,
1211
+ cfg,
1212
+ accountId
1213
+ });
1214
+ snapshots.push(snapshot);
1215
+ }
1216
+ if (snapshots.length > 0) lines.push(...accountLines(plugin.id, snapshots));
1217
+ }
1218
+ lines.push("");
1219
+ lines.push(`Tip: ${formatDocsLink("/cli#status", "status --deep")} adds gateway health probes to status output (requires a reachable gateway).`);
1220
+ return lines;
1221
+ }
1222
+ async function channelsStatusCommand(opts, runtime = defaultRuntime) {
1223
+ const timeoutMs = Number(opts.timeout ?? 1e4);
1224
+ const statusLabel = opts.probe ? "Checking channel status (probe)…" : "Checking channel status…";
1225
+ if (opts.json !== true && !process.stderr.isTTY) runtime.log(statusLabel);
1226
+ try {
1227
+ const payload = await withProgress({
1228
+ label: statusLabel,
1229
+ indeterminate: true,
1230
+ enabled: opts.json !== true
1231
+ }, async () => await callGateway({
1232
+ method: "channels.status",
1233
+ params: {
1234
+ probe: Boolean(opts.probe),
1235
+ timeoutMs
1236
+ },
1237
+ timeoutMs
1238
+ }));
1239
+ if (opts.json) {
1240
+ runtime.log(JSON.stringify(payload, null, 2));
1241
+ return;
1242
+ }
1243
+ runtime.log(formatGatewayChannelsStatusLines(payload).join("\n"));
1244
+ } catch (err) {
1245
+ runtime.error(`Gateway not reachable: ${String(err)}`);
1246
+ const cfg = await requireValidConfig(runtime);
1247
+ if (!cfg) return;
1248
+ const snapshot = await readConfigFileSnapshot();
1249
+ const mode = cfg.gateway?.mode === "remote" ? "remote" : "local";
1250
+ runtime.log((await formatConfigChannelsStatusLines(cfg, {
1251
+ path: snapshot.path,
1252
+ mode
1253
+ })).join("\n"));
1254
+ }
1255
+ }
1256
+
1257
+ //#endregion
1258
+ //#region src/cli/channel-auth.ts
1259
+ async function runChannelLogin(opts, runtime = defaultRuntime) {
1260
+ const channelInput = opts.channel ?? DEFAULT_CHAT_CHANNEL;
1261
+ const channelId = normalizeChannelId(channelInput);
1262
+ if (!channelId) throw new Error(`Unsupported channel: ${channelInput}`);
1263
+ const plugin = getChannelPlugin(channelId);
1264
+ if (!plugin?.auth?.login) throw new Error(`Channel ${channelId} does not support login`);
1265
+ setVerbose(Boolean(opts.verbose));
1266
+ const cfg = loadConfig();
1267
+ const accountId = opts.account?.trim() || resolveChannelDefaultAccountId({
1268
+ plugin,
1269
+ cfg
1270
+ });
1271
+ await plugin.auth.login({
1272
+ cfg,
1273
+ accountId,
1274
+ runtime,
1275
+ verbose: Boolean(opts.verbose),
1276
+ channelInput
1277
+ });
1278
+ }
1279
+ async function runChannelLogout(opts, runtime = defaultRuntime) {
1280
+ const channelInput = opts.channel ?? DEFAULT_CHAT_CHANNEL;
1281
+ const channelId = normalizeChannelId(channelInput);
1282
+ if (!channelId) throw new Error(`Unsupported channel: ${channelInput}`);
1283
+ const plugin = getChannelPlugin(channelId);
1284
+ if (!plugin?.gateway?.logoutAccount) throw new Error(`Channel ${channelId} does not support logout`);
1285
+ const cfg = loadConfig();
1286
+ const accountId = opts.account?.trim() || resolveChannelDefaultAccountId({
1287
+ plugin,
1288
+ cfg
1289
+ });
1290
+ const account = plugin.config.resolveAccount(cfg, accountId);
1291
+ await plugin.gateway.logoutAccount({
1292
+ cfg,
1293
+ accountId,
1294
+ account,
1295
+ runtime
1296
+ });
1297
+ }
1298
+
1299
+ //#endregion
1300
+ //#region src/cli/channels-cli.ts
1301
+ const optionNamesAdd = [
1302
+ "channel",
1303
+ "account",
1304
+ "name",
1305
+ "token",
1306
+ "tokenFile",
1307
+ "botToken",
1308
+ "appToken",
1309
+ "signalNumber",
1310
+ "cliPath",
1311
+ "dbPath",
1312
+ "service",
1313
+ "region",
1314
+ "authDir",
1315
+ "httpUrl",
1316
+ "httpHost",
1317
+ "httpPort",
1318
+ "webhookPath",
1319
+ "webhookUrl",
1320
+ "audienceType",
1321
+ "audience",
1322
+ "useEnv",
1323
+ "homeserver",
1324
+ "userId",
1325
+ "accessToken",
1326
+ "password",
1327
+ "deviceName",
1328
+ "initialSyncLimit",
1329
+ "ship",
1330
+ "url",
1331
+ "code",
1332
+ "groupChannels",
1333
+ "dmAllowlist",
1334
+ "autoDiscoverChannels"
1335
+ ];
1336
+ const optionNamesRemove = [
1337
+ "channel",
1338
+ "account",
1339
+ "delete"
1340
+ ];
1341
+ function runChannelsCommand(action) {
1342
+ return runCommandWithRuntime(defaultRuntime, action);
1343
+ }
1344
+ function runChannelsCommandWithDanger(action, label) {
1345
+ return runCommandWithRuntime(defaultRuntime, action, (err) => {
1346
+ defaultRuntime.error(danger(`${label}: ${String(err)}`));
1347
+ defaultRuntime.exit(1);
1348
+ });
1349
+ }
1350
+ function registerChannelsCli(program) {
1351
+ const channelNames = formatCliChannelOptions();
1352
+ const channels = program.command("channels").description("Manage chat channel accounts").addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/cli/channels", "docs.cryptoclaw.ai/cli/channels")}\n`);
1353
+ channels.command("list").description("List configured channels + auth profiles").option("--no-usage", "Skip model provider usage/quota snapshots").option("--json", "Output JSON", false).action(async (opts) => {
1354
+ await runChannelsCommand(async () => {
1355
+ await channelsListCommand(opts, defaultRuntime);
1356
+ });
1357
+ });
1358
+ channels.command("status").description("Show gateway channel status (use status --deep for local)").option("--probe", "Probe channel credentials", false).option("--timeout <ms>", "Timeout in ms", "10000").option("--json", "Output JSON", false).action(async (opts) => {
1359
+ await runChannelsCommand(async () => {
1360
+ await channelsStatusCommand(opts, defaultRuntime);
1361
+ });
1362
+ });
1363
+ channels.command("capabilities").description("Show provider capabilities (intents/scopes + supported features)").option("--channel <name>", `Channel (${formatCliChannelOptions(["all"])})`).option("--account <id>", "Account id (only with --channel)").option("--target <dest>", "Channel target for permission audit (Discord channel:<id>)").option("--timeout <ms>", "Timeout in ms", "10000").option("--json", "Output JSON", false).action(async (opts) => {
1364
+ await runChannelsCommand(async () => {
1365
+ await channelsCapabilitiesCommand(opts, defaultRuntime);
1366
+ });
1367
+ });
1368
+ channels.command("resolve").description("Resolve channel/user names to IDs").argument("<entries...>", "Entries to resolve (names or ids)").option("--channel <name>", `Channel (${channelNames})`).option("--account <id>", "Account id (accountId)").option("--kind <kind>", "Target kind (auto|user|group)", "auto").option("--json", "Output JSON", false).action(async (entries, opts) => {
1369
+ await runChannelsCommand(async () => {
1370
+ await channelsResolveCommand({
1371
+ channel: opts.channel,
1372
+ account: opts.account,
1373
+ kind: opts.kind,
1374
+ json: Boolean(opts.json),
1375
+ entries: Array.isArray(entries) ? entries : [String(entries)]
1376
+ }, defaultRuntime);
1377
+ });
1378
+ });
1379
+ channels.command("logs").description("Show recent channel logs from the gateway log file").option("--channel <name>", `Channel (${formatCliChannelOptions(["all"])})`, "all").option("--lines <n>", "Number of lines (default: 200)", "200").option("--json", "Output JSON", false).action(async (opts) => {
1380
+ await runChannelsCommand(async () => {
1381
+ await channelsLogsCommand(opts, defaultRuntime);
1382
+ });
1383
+ });
1384
+ channels.command("add").description("Add or update a channel account").option("--channel <name>", `Channel (${channelNames})`).option("--account <id>", "Account id (default when omitted)").option("--name <name>", "Display name for this account").option("--token <token>", "Bot token (Telegram/Discord)").option("--token-file <path>", "Bot token file (Telegram)").option("--bot-token <token>", "Slack bot token (xoxb-...)").option("--app-token <token>", "Slack app token (xapp-...)").option("--signal-number <e164>", "Signal account number (E.164)").option("--cli-path <path>", "CLI path (signal-cli or imsg)").option("--db-path <path>", "iMessage database path").option("--service <service>", "iMessage service (imessage|sms|auto)").option("--region <region>", "iMessage region (for SMS)").option("--auth-dir <path>", "WhatsApp auth directory override").option("--http-url <url>", "Signal HTTP daemon base URL").option("--http-host <host>", "Signal HTTP host").option("--http-port <port>", "Signal HTTP port").option("--webhook-path <path>", "Webhook path (Google Chat/BlueBubbles)").option("--webhook-url <url>", "Google Chat webhook URL").option("--audience-type <type>", "Google Chat audience type (app-url|project-number)").option("--audience <value>", "Google Chat audience value (app URL or project number)").option("--homeserver <url>", "Matrix homeserver URL").option("--user-id <id>", "Matrix user ID").option("--access-token <token>", "Matrix access token").option("--password <password>", "Matrix password").option("--device-name <name>", "Matrix device name").option("--initial-sync-limit <n>", "Matrix initial sync limit").option("--ship <ship>", "Tlon ship name (~sampel-palnet)").option("--url <url>", "Tlon ship URL").option("--code <code>", "Tlon login code").option("--group-channels <list>", "Tlon group channels (comma-separated)").option("--dm-allowlist <list>", "Tlon DM allowlist (comma-separated ships)").option("--auto-discover-channels", "Tlon auto-discover group channels").option("--no-auto-discover-channels", "Disable Tlon auto-discovery").option("--use-env", "Use env token (default account only)", false).action(async (opts, command) => {
1385
+ await runChannelsCommand(async () => {
1386
+ await channelsAddCommand(opts, defaultRuntime, { hasFlags: hasExplicitOptions(command, optionNamesAdd) });
1387
+ });
1388
+ });
1389
+ channels.command("remove").description("Disable or delete a channel account").option("--channel <name>", `Channel (${channelNames})`).option("--account <id>", "Account id (default when omitted)").option("--delete", "Delete config entries (no prompt)", false).action(async (opts, command) => {
1390
+ await runChannelsCommand(async () => {
1391
+ await channelsRemoveCommand(opts, defaultRuntime, { hasFlags: hasExplicitOptions(command, optionNamesRemove) });
1392
+ });
1393
+ });
1394
+ channels.command("login").description("Link a channel account (if supported)").option("--channel <channel>", "Channel alias (default: whatsapp)").option("--account <id>", "Account id (accountId)").option("--verbose", "Verbose connection logs", false).action(async (opts) => {
1395
+ await runChannelsCommandWithDanger(async () => {
1396
+ await runChannelLogin({
1397
+ channel: opts.channel,
1398
+ account: opts.account,
1399
+ verbose: Boolean(opts.verbose)
1400
+ }, defaultRuntime);
1401
+ }, "Channel login failed");
1402
+ });
1403
+ channels.command("logout").description("Log out of a channel session (if supported)").option("--channel <channel>", "Channel alias (default: whatsapp)").option("--account <id>", "Account id (accountId)").action(async (opts) => {
1404
+ await runChannelsCommandWithDanger(async () => {
1405
+ await runChannelLogout({
1406
+ channel: opts.channel,
1407
+ account: opts.account
1408
+ }, defaultRuntime);
1409
+ }, "Channel logout failed");
1410
+ });
1411
+ }
1412
+
1413
+ //#endregion
1414
+ export { registerChannelsCli };