agent-messenger 2.3.0 → 2.5.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 (438) hide show
  1. package/.claude-plugin/README.md +16 -16
  2. package/.claude-plugin/marketplace.json +29 -29
  3. package/.claude-plugin/plugin.json +5 -5
  4. package/.github/workflows/release.yml +0 -12
  5. package/CONTRIBUTING.md +1 -1
  6. package/README.md +11 -8
  7. package/bun.lock +70 -110
  8. package/bunfig.toml +3 -0
  9. package/dist/package.json +11 -3
  10. package/dist/src/platforms/channeltalk/cli.d.ts.map +1 -1
  11. package/dist/src/platforms/channeltalk/cli.js +2 -1
  12. package/dist/src/platforms/channeltalk/cli.js.map +1 -1
  13. package/dist/src/platforms/channeltalk/commands/index.d.ts +1 -0
  14. package/dist/src/platforms/channeltalk/commands/index.d.ts.map +1 -1
  15. package/dist/src/platforms/channeltalk/commands/index.js +1 -0
  16. package/dist/src/platforms/channeltalk/commands/index.js.map +1 -1
  17. package/dist/src/platforms/channeltalk/commands/whoami.d.ts +22 -0
  18. package/dist/src/platforms/channeltalk/commands/whoami.d.ts.map +1 -0
  19. package/dist/src/platforms/channeltalk/commands/whoami.js +40 -0
  20. package/dist/src/platforms/channeltalk/commands/whoami.js.map +1 -0
  21. package/dist/src/platforms/channeltalkbot/cli.d.ts.map +1 -1
  22. package/dist/src/platforms/channeltalkbot/cli.js +2 -1
  23. package/dist/src/platforms/channeltalkbot/cli.js.map +1 -1
  24. package/dist/src/platforms/channeltalkbot/commands/index.d.ts +1 -0
  25. package/dist/src/platforms/channeltalkbot/commands/index.d.ts.map +1 -1
  26. package/dist/src/platforms/channeltalkbot/commands/index.js +1 -0
  27. package/dist/src/platforms/channeltalkbot/commands/index.js.map +1 -1
  28. package/dist/src/platforms/channeltalkbot/commands/whoami.d.ts +13 -0
  29. package/dist/src/platforms/channeltalkbot/commands/whoami.d.ts.map +1 -0
  30. package/dist/src/platforms/channeltalkbot/commands/whoami.js +31 -0
  31. package/dist/src/platforms/channeltalkbot/commands/whoami.js.map +1 -0
  32. package/dist/src/platforms/discord/cli.d.ts.map +1 -1
  33. package/dist/src/platforms/discord/cli.js +2 -1
  34. package/dist/src/platforms/discord/cli.js.map +1 -1
  35. package/dist/src/platforms/discord/commands/index.d.ts +1 -0
  36. package/dist/src/platforms/discord/commands/index.d.ts.map +1 -1
  37. package/dist/src/platforms/discord/commands/index.js +1 -0
  38. package/dist/src/platforms/discord/commands/index.js.map +1 -1
  39. package/dist/src/platforms/discord/commands/whoami.d.ts +6 -0
  40. package/dist/src/platforms/discord/commands/whoami.d.ts.map +1 -0
  41. package/dist/src/platforms/discord/commands/whoami.js +33 -0
  42. package/dist/src/platforms/discord/commands/whoami.js.map +1 -0
  43. package/dist/src/platforms/discordbot/cli.d.ts.map +1 -1
  44. package/dist/src/platforms/discordbot/cli.js +2 -1
  45. package/dist/src/platforms/discordbot/cli.js.map +1 -1
  46. package/dist/src/platforms/discordbot/client.js +2 -2
  47. package/dist/src/platforms/discordbot/client.js.map +1 -1
  48. package/dist/src/platforms/discordbot/commands/index.d.ts +1 -0
  49. package/dist/src/platforms/discordbot/commands/index.d.ts.map +1 -1
  50. package/dist/src/platforms/discordbot/commands/index.js +1 -0
  51. package/dist/src/platforms/discordbot/commands/index.js.map +1 -1
  52. package/dist/src/platforms/discordbot/commands/whoami.d.ts +14 -0
  53. package/dist/src/platforms/discordbot/commands/whoami.d.ts.map +1 -0
  54. package/dist/src/platforms/discordbot/commands/whoami.js +32 -0
  55. package/dist/src/platforms/discordbot/commands/whoami.js.map +1 -0
  56. package/dist/src/platforms/instagram/cli.d.ts.map +1 -1
  57. package/dist/src/platforms/instagram/cli.js +2 -1
  58. package/dist/src/platforms/instagram/cli.js.map +1 -1
  59. package/dist/src/platforms/instagram/client.d.ts +6 -0
  60. package/dist/src/platforms/instagram/client.d.ts.map +1 -1
  61. package/dist/src/platforms/instagram/client.js +12 -0
  62. package/dist/src/platforms/instagram/client.js.map +1 -1
  63. package/dist/src/platforms/instagram/commands/index.d.ts +1 -0
  64. package/dist/src/platforms/instagram/commands/index.d.ts.map +1 -1
  65. package/dist/src/platforms/instagram/commands/index.js +1 -0
  66. package/dist/src/platforms/instagram/commands/index.js.map +1 -1
  67. package/dist/src/platforms/instagram/commands/whoami.d.ts +7 -0
  68. package/dist/src/platforms/instagram/commands/whoami.d.ts.map +1 -0
  69. package/dist/src/platforms/instagram/commands/whoami.js +19 -0
  70. package/dist/src/platforms/instagram/commands/whoami.js.map +1 -0
  71. package/dist/src/platforms/kakaotalk/cli.d.ts.map +1 -1
  72. package/dist/src/platforms/kakaotalk/cli.js +2 -1
  73. package/dist/src/platforms/kakaotalk/cli.js.map +1 -1
  74. package/dist/src/platforms/kakaotalk/client.d.ts +2 -1
  75. package/dist/src/platforms/kakaotalk/client.d.ts.map +1 -1
  76. package/dist/src/platforms/kakaotalk/client.js +225 -23
  77. package/dist/src/platforms/kakaotalk/client.js.map +1 -1
  78. package/dist/src/platforms/kakaotalk/commands/index.d.ts +1 -0
  79. package/dist/src/platforms/kakaotalk/commands/index.d.ts.map +1 -1
  80. package/dist/src/platforms/kakaotalk/commands/index.js +1 -0
  81. package/dist/src/platforms/kakaotalk/commands/index.js.map +1 -1
  82. package/dist/src/platforms/kakaotalk/commands/whoami.d.ts +3 -0
  83. package/dist/src/platforms/kakaotalk/commands/whoami.d.ts.map +1 -0
  84. package/dist/src/platforms/kakaotalk/commands/whoami.js +19 -0
  85. package/dist/src/platforms/kakaotalk/commands/whoami.js.map +1 -0
  86. package/dist/src/platforms/kakaotalk/index.d.ts +2 -2
  87. package/dist/src/platforms/kakaotalk/index.d.ts.map +1 -1
  88. package/dist/src/platforms/kakaotalk/index.js +1 -1
  89. package/dist/src/platforms/kakaotalk/index.js.map +1 -1
  90. package/dist/src/platforms/kakaotalk/protocol/session.d.ts +4 -2
  91. package/dist/src/platforms/kakaotalk/protocol/session.d.ts.map +1 -1
  92. package/dist/src/platforms/kakaotalk/protocol/session.js +27 -7
  93. package/dist/src/platforms/kakaotalk/protocol/session.js.map +1 -1
  94. package/dist/src/platforms/kakaotalk/protocol/types.d.ts +17 -0
  95. package/dist/src/platforms/kakaotalk/protocol/types.d.ts.map +1 -1
  96. package/dist/src/platforms/kakaotalk/protocol/types.js.map +1 -1
  97. package/dist/src/platforms/kakaotalk/types.d.ts +28 -0
  98. package/dist/src/platforms/kakaotalk/types.d.ts.map +1 -1
  99. package/dist/src/platforms/kakaotalk/types.js +14 -0
  100. package/dist/src/platforms/kakaotalk/types.js.map +1 -1
  101. package/dist/src/platforms/line/cli.js +2 -2
  102. package/dist/src/platforms/line/cli.js.map +1 -1
  103. package/dist/src/platforms/line/client.d.ts.map +1 -1
  104. package/dist/src/platforms/line/client.js +9 -36
  105. package/dist/src/platforms/line/client.js.map +1 -1
  106. package/dist/src/platforms/line/commands/auth.d.ts.map +1 -1
  107. package/dist/src/platforms/line/commands/auth.js +9 -47
  108. package/dist/src/platforms/line/commands/auth.js.map +1 -1
  109. package/dist/src/platforms/line/commands/index.d.ts +1 -1
  110. package/dist/src/platforms/line/commands/index.d.ts.map +1 -1
  111. package/dist/src/platforms/line/commands/index.js +1 -1
  112. package/dist/src/platforms/line/commands/index.js.map +1 -1
  113. package/dist/src/platforms/line/commands/whoami.d.ts +3 -0
  114. package/dist/src/platforms/line/commands/whoami.d.ts.map +1 -0
  115. package/dist/src/platforms/line/commands/{profile.js → whoami.js} +5 -5
  116. package/dist/src/platforms/line/commands/whoami.js.map +1 -0
  117. package/dist/src/platforms/slack/cli.d.ts.map +1 -1
  118. package/dist/src/platforms/slack/cli.js +2 -1
  119. package/dist/src/platforms/slack/cli.js.map +1 -1
  120. package/dist/src/platforms/slack/commands/index.d.ts +1 -0
  121. package/dist/src/platforms/slack/commands/index.d.ts.map +1 -1
  122. package/dist/src/platforms/slack/commands/index.js +1 -0
  123. package/dist/src/platforms/slack/commands/index.js.map +1 -1
  124. package/dist/src/platforms/slack/commands/whoami.d.ts +6 -0
  125. package/dist/src/platforms/slack/commands/whoami.d.ts.map +1 -0
  126. package/dist/src/platforms/slack/commands/whoami.js +39 -0
  127. package/dist/src/platforms/slack/commands/whoami.js.map +1 -0
  128. package/dist/src/platforms/slackbot/cli.d.ts.map +1 -1
  129. package/dist/src/platforms/slackbot/cli.js +2 -1
  130. package/dist/src/platforms/slackbot/cli.js.map +1 -1
  131. package/dist/src/platforms/slackbot/commands/index.d.ts +1 -0
  132. package/dist/src/platforms/slackbot/commands/index.d.ts.map +1 -1
  133. package/dist/src/platforms/slackbot/commands/index.js +1 -0
  134. package/dist/src/platforms/slackbot/commands/index.js.map +1 -1
  135. package/dist/src/platforms/slackbot/commands/whoami.d.ts +14 -0
  136. package/dist/src/platforms/slackbot/commands/whoami.d.ts.map +1 -0
  137. package/dist/src/platforms/slackbot/commands/whoami.js +32 -0
  138. package/dist/src/platforms/slackbot/commands/whoami.js.map +1 -0
  139. package/dist/src/platforms/teams/cli.d.ts.map +1 -1
  140. package/dist/src/platforms/teams/cli.js +2 -1
  141. package/dist/src/platforms/teams/cli.js.map +1 -1
  142. package/dist/src/platforms/teams/commands/index.d.ts +1 -0
  143. package/dist/src/platforms/teams/commands/index.d.ts.map +1 -1
  144. package/dist/src/platforms/teams/commands/index.js +1 -0
  145. package/dist/src/platforms/teams/commands/index.js.map +1 -1
  146. package/dist/src/platforms/teams/commands/reaction.d.ts.map +1 -1
  147. package/dist/src/platforms/teams/commands/reaction.js +2 -0
  148. package/dist/src/platforms/teams/commands/reaction.js.map +1 -1
  149. package/dist/src/platforms/teams/commands/whoami.d.ts +6 -0
  150. package/dist/src/platforms/teams/commands/whoami.d.ts.map +1 -0
  151. package/dist/src/platforms/teams/commands/whoami.js +30 -0
  152. package/dist/src/platforms/teams/commands/whoami.js.map +1 -0
  153. package/dist/src/platforms/telegram/cli.d.ts.map +1 -1
  154. package/dist/src/platforms/telegram/cli.js +2 -1
  155. package/dist/src/platforms/telegram/cli.js.map +1 -1
  156. package/dist/src/platforms/telegram/commands/index.d.ts +1 -0
  157. package/dist/src/platforms/telegram/commands/index.d.ts.map +1 -1
  158. package/dist/src/platforms/telegram/commands/index.js +1 -0
  159. package/dist/src/platforms/telegram/commands/index.js.map +1 -1
  160. package/dist/src/platforms/telegram/commands/whoami.d.ts +7 -0
  161. package/dist/src/platforms/telegram/commands/whoami.d.ts.map +1 -0
  162. package/dist/src/platforms/telegram/commands/whoami.js +27 -0
  163. package/dist/src/platforms/telegram/commands/whoami.js.map +1 -0
  164. package/dist/src/platforms/webex/cli.d.ts.map +1 -1
  165. package/dist/src/platforms/webex/cli.js +2 -1
  166. package/dist/src/platforms/webex/cli.js.map +1 -1
  167. package/dist/src/platforms/webex/commands/index.d.ts +1 -0
  168. package/dist/src/platforms/webex/commands/index.d.ts.map +1 -1
  169. package/dist/src/platforms/webex/commands/index.js +1 -0
  170. package/dist/src/platforms/webex/commands/index.js.map +1 -1
  171. package/dist/src/platforms/webex/commands/message.js +1 -1
  172. package/dist/src/platforms/webex/commands/message.js.map +1 -1
  173. package/dist/src/platforms/webex/commands/whoami.d.ts +6 -0
  174. package/dist/src/platforms/webex/commands/whoami.d.ts.map +1 -0
  175. package/dist/src/platforms/webex/commands/whoami.js +30 -0
  176. package/dist/src/platforms/webex/commands/whoami.js.map +1 -0
  177. package/dist/src/platforms/wechatbot/cli.d.ts +5 -0
  178. package/dist/src/platforms/wechatbot/cli.d.ts.map +1 -0
  179. package/dist/src/platforms/wechatbot/cli.js +19 -0
  180. package/dist/src/platforms/wechatbot/cli.js.map +1 -0
  181. package/dist/src/platforms/wechatbot/client.d.ts +36 -0
  182. package/dist/src/platforms/wechatbot/client.d.ts.map +1 -0
  183. package/dist/src/platforms/wechatbot/client.js +208 -0
  184. package/dist/src/platforms/wechatbot/client.js.map +1 -0
  185. package/dist/src/platforms/wechatbot/commands/auth.d.ts +28 -0
  186. package/dist/src/platforms/wechatbot/commands/auth.d.ts.map +1 -0
  187. package/dist/src/platforms/wechatbot/commands/auth.js +164 -0
  188. package/dist/src/platforms/wechatbot/commands/auth.js.map +1 -0
  189. package/dist/src/platforms/wechatbot/commands/index.d.ts +6 -0
  190. package/dist/src/platforms/wechatbot/commands/index.d.ts.map +1 -0
  191. package/dist/src/platforms/wechatbot/commands/index.js +6 -0
  192. package/dist/src/platforms/wechatbot/commands/index.js.map +1 -0
  193. package/dist/src/platforms/wechatbot/commands/message.d.ts +18 -0
  194. package/dist/src/platforms/wechatbot/commands/message.d.ts.map +1 -0
  195. package/dist/src/platforms/wechatbot/commands/message.js +80 -0
  196. package/dist/src/platforms/wechatbot/commands/message.js.map +1 -0
  197. package/dist/src/platforms/wechatbot/commands/shared.d.ts +9 -0
  198. package/dist/src/platforms/wechatbot/commands/shared.d.ts.map +1 -0
  199. package/dist/src/platforms/wechatbot/commands/shared.js +13 -0
  200. package/dist/src/platforms/wechatbot/commands/shared.js.map +1 -0
  201. package/dist/src/platforms/wechatbot/commands/template.d.ts +19 -0
  202. package/dist/src/platforms/wechatbot/commands/template.d.ts.map +1 -0
  203. package/dist/src/platforms/wechatbot/commands/template.js +76 -0
  204. package/dist/src/platforms/wechatbot/commands/template.js.map +1 -0
  205. package/dist/src/platforms/wechatbot/commands/user.d.ts +20 -0
  206. package/dist/src/platforms/wechatbot/commands/user.d.ts.map +1 -0
  207. package/dist/src/platforms/wechatbot/commands/user.js +53 -0
  208. package/dist/src/platforms/wechatbot/commands/user.js.map +1 -0
  209. package/dist/src/platforms/wechatbot/commands/whoami.d.ts +12 -0
  210. package/dist/src/platforms/wechatbot/commands/whoami.d.ts.map +1 -0
  211. package/dist/src/platforms/wechatbot/commands/whoami.js +33 -0
  212. package/dist/src/platforms/wechatbot/commands/whoami.js.map +1 -0
  213. package/dist/src/platforms/wechatbot/credential-manager.d.ts +17 -0
  214. package/dist/src/platforms/wechatbot/credential-manager.d.ts.map +1 -0
  215. package/dist/src/platforms/wechatbot/credential-manager.js +121 -0
  216. package/dist/src/platforms/wechatbot/credential-manager.js.map +1 -0
  217. package/dist/src/platforms/wechatbot/index.d.ts +5 -0
  218. package/dist/src/platforms/wechatbot/index.d.ts.map +1 -0
  219. package/dist/src/platforms/wechatbot/index.js +4 -0
  220. package/dist/src/platforms/wechatbot/index.js.map +1 -0
  221. package/dist/src/platforms/wechatbot/types.d.ts +94 -0
  222. package/dist/src/platforms/wechatbot/types.d.ts.map +1 -0
  223. package/dist/src/platforms/wechatbot/types.js +54 -0
  224. package/dist/src/platforms/wechatbot/types.js.map +1 -0
  225. package/dist/src/platforms/whatsapp/cli.d.ts.map +1 -1
  226. package/dist/src/platforms/whatsapp/cli.js +2 -1
  227. package/dist/src/platforms/whatsapp/cli.js.map +1 -1
  228. package/dist/src/platforms/whatsapp/client.d.ts +9 -0
  229. package/dist/src/platforms/whatsapp/client.d.ts.map +1 -1
  230. package/dist/src/platforms/whatsapp/client.js +143 -21
  231. package/dist/src/platforms/whatsapp/client.js.map +1 -1
  232. package/dist/src/platforms/whatsapp/commands/auth.d.ts.map +1 -1
  233. package/dist/src/platforms/whatsapp/commands/auth.js +133 -60
  234. package/dist/src/platforms/whatsapp/commands/auth.js.map +1 -1
  235. package/dist/src/platforms/whatsapp/commands/index.d.ts +1 -0
  236. package/dist/src/platforms/whatsapp/commands/index.d.ts.map +1 -1
  237. package/dist/src/platforms/whatsapp/commands/index.js +1 -0
  238. package/dist/src/platforms/whatsapp/commands/index.js.map +1 -1
  239. package/dist/src/platforms/whatsapp/commands/shared.js +2 -2
  240. package/dist/src/platforms/whatsapp/commands/shared.js.map +1 -1
  241. package/dist/src/platforms/whatsapp/commands/whoami.d.ts +7 -0
  242. package/dist/src/platforms/whatsapp/commands/whoami.d.ts.map +1 -0
  243. package/dist/src/platforms/whatsapp/commands/whoami.js +19 -0
  244. package/dist/src/platforms/whatsapp/commands/whoami.js.map +1 -0
  245. package/dist/src/platforms/whatsapp/credential-manager.d.ts.map +1 -1
  246. package/dist/src/platforms/whatsapp/credential-manager.js +14 -8
  247. package/dist/src/platforms/whatsapp/credential-manager.js.map +1 -1
  248. package/dist/src/platforms/whatsapp/ensure-auth.js +2 -2
  249. package/dist/src/platforms/whatsapp/ensure-auth.js.map +1 -1
  250. package/dist/src/platforms/whatsappbot/cli.d.ts.map +1 -1
  251. package/dist/src/platforms/whatsappbot/cli.js +2 -1
  252. package/dist/src/platforms/whatsappbot/cli.js.map +1 -1
  253. package/dist/src/platforms/whatsappbot/commands/index.d.ts +1 -0
  254. package/dist/src/platforms/whatsappbot/commands/index.d.ts.map +1 -1
  255. package/dist/src/platforms/whatsappbot/commands/index.js +1 -0
  256. package/dist/src/platforms/whatsappbot/commands/index.js.map +1 -1
  257. package/dist/src/platforms/whatsappbot/commands/whoami.d.ts +17 -0
  258. package/dist/src/platforms/whatsappbot/commands/whoami.d.ts.map +1 -0
  259. package/dist/src/platforms/whatsappbot/commands/whoami.js +39 -0
  260. package/dist/src/platforms/whatsappbot/commands/whoami.js.map +1 -0
  261. package/dist/src/shared/utils/qr.d.ts +15 -0
  262. package/dist/src/shared/utils/qr.d.ts.map +1 -0
  263. package/dist/src/shared/utils/qr.js +74 -0
  264. package/dist/src/shared/utils/qr.js.map +1 -0
  265. package/dist/src/tui/adapters/whatsapp-adapter.d.ts.map +1 -1
  266. package/dist/src/tui/adapters/whatsapp-adapter.js +20 -15
  267. package/dist/src/tui/adapters/whatsapp-adapter.js.map +1 -1
  268. package/docs/content/docs/agent-skills.mdx +4 -4
  269. package/docs/content/docs/cli/channeltalk.mdx +12 -1
  270. package/docs/content/docs/cli/channeltalkbot.mdx +10 -1
  271. package/docs/content/docs/cli/discord.mdx +11 -1
  272. package/docs/content/docs/cli/discordbot.mdx +10 -1
  273. package/docs/content/docs/cli/instagram.mdx +12 -1
  274. package/docs/content/docs/cli/kakaotalk.mdx +25 -1
  275. package/docs/content/docs/cli/line.mdx +5 -5
  276. package/docs/content/docs/cli/meta.json +1 -0
  277. package/docs/content/docs/cli/slack.mdx +11 -1
  278. package/docs/content/docs/cli/slackbot.mdx +10 -1
  279. package/docs/content/docs/cli/teams.mdx +11 -1
  280. package/docs/content/docs/cli/telegram.mdx +11 -0
  281. package/docs/content/docs/cli/webex.mdx +11 -1
  282. package/docs/content/docs/cli/wechatbot.mdx +188 -0
  283. package/docs/content/docs/cli/whatsapp.mdx +37 -8
  284. package/docs/content/docs/cli/whatsappbot.mdx +10 -1
  285. package/docs/content/docs/sdk/meta.json +1 -1
  286. package/docs/content/docs/sdk/wechatbot.mdx +282 -0
  287. package/docs/content/docs/tui.mdx +1 -1
  288. package/docs/src/app/page.tsx +5 -5
  289. package/package.json +11 -3
  290. package/skills/agent-channeltalk/SKILL.md +12 -1
  291. package/skills/agent-channeltalkbot/SKILL.md +10 -1
  292. package/skills/agent-discord/SKILL.md +11 -1
  293. package/skills/agent-discordbot/SKILL.md +10 -1
  294. package/skills/agent-instagram/SKILL.md +12 -1
  295. package/skills/agent-kakaotalk/SKILL.md +30 -1
  296. package/skills/agent-kakaotalk/references/common-patterns.md +1 -1
  297. package/skills/agent-line/SKILL.md +11 -15
  298. package/skills/agent-line/references/authentication.md +13 -4
  299. package/skills/agent-slack/SKILL.md +11 -1
  300. package/skills/agent-slackbot/SKILL.md +10 -1
  301. package/skills/agent-teams/SKILL.md +11 -1
  302. package/skills/agent-telegram/SKILL.md +6 -1
  303. package/skills/agent-webex/SKILL.md +11 -1
  304. package/skills/agent-wechatbot/SKILL.md +394 -0
  305. package/skills/agent-whatsapp/SKILL.md +63 -15
  306. package/skills/agent-whatsapp/references/authentication.md +36 -6
  307. package/skills/agent-whatsappbot/SKILL.md +10 -1
  308. package/src/platforms/channeltalk/cli.ts +2 -0
  309. package/src/platforms/channeltalk/commands/index.ts +1 -0
  310. package/src/platforms/channeltalk/commands/whoami.test.ts +64 -0
  311. package/src/platforms/channeltalk/commands/whoami.ts +62 -0
  312. package/src/platforms/channeltalkbot/cli.ts +2 -0
  313. package/src/platforms/channeltalkbot/commands/index.ts +1 -0
  314. package/src/platforms/channeltalkbot/commands/whoami.test.ts +104 -0
  315. package/src/platforms/channeltalkbot/commands/whoami.ts +42 -0
  316. package/src/platforms/discord/cli.ts +2 -0
  317. package/src/platforms/discord/commands/index.ts +1 -0
  318. package/src/platforms/discord/commands/whoami.test.ts +91 -0
  319. package/src/platforms/discord/commands/whoami.ts +36 -0
  320. package/src/platforms/discord/credential-manager.test.ts +18 -1
  321. package/src/platforms/discordbot/cli.ts +2 -0
  322. package/src/platforms/discordbot/client.ts +2 -2
  323. package/src/platforms/discordbot/commands/index.ts +1 -0
  324. package/src/platforms/discordbot/commands/whoami.test.ts +96 -0
  325. package/src/platforms/discordbot/commands/whoami.ts +44 -0
  326. package/src/platforms/instagram/cli.ts +2 -1
  327. package/src/platforms/instagram/client.ts +13 -0
  328. package/src/platforms/instagram/commands/auth.test.ts +216 -0
  329. package/src/platforms/instagram/commands/chat.test.ts +123 -0
  330. package/src/platforms/instagram/commands/index.ts +1 -0
  331. package/src/platforms/instagram/commands/message.test.ts +174 -0
  332. package/src/platforms/instagram/commands/whoami.test.ts +60 -0
  333. package/src/platforms/instagram/commands/whoami.ts +21 -0
  334. package/src/platforms/kakaotalk/cli.ts +2 -1
  335. package/src/platforms/kakaotalk/client.test.ts +182 -14
  336. package/src/platforms/kakaotalk/client.ts +261 -27
  337. package/src/platforms/kakaotalk/commands/auth.test.ts +299 -0
  338. package/src/platforms/kakaotalk/commands/chat.test.ts +97 -0
  339. package/src/platforms/kakaotalk/commands/index.ts +1 -0
  340. package/src/platforms/kakaotalk/commands/message.test.ts +113 -0
  341. package/src/platforms/kakaotalk/commands/whoami.test.ts +116 -0
  342. package/src/platforms/kakaotalk/commands/whoami.ts +21 -0
  343. package/src/platforms/kakaotalk/index.test.ts +5 -0
  344. package/src/platforms/kakaotalk/index.ts +2 -0
  345. package/src/platforms/kakaotalk/protocol/session.ts +29 -7
  346. package/src/platforms/kakaotalk/protocol/types.ts +9 -0
  347. package/src/platforms/kakaotalk/types.ts +30 -0
  348. package/src/platforms/line/cli.ts +2 -2
  349. package/src/platforms/line/client.ts +14 -39
  350. package/src/platforms/line/commands/auth.test.ts +141 -0
  351. package/src/platforms/line/commands/auth.ts +37 -61
  352. package/src/platforms/line/commands/chat.test.ts +110 -0
  353. package/src/platforms/line/commands/friend.test.ts +98 -0
  354. package/src/platforms/line/commands/index.ts +1 -1
  355. package/src/platforms/line/commands/message.test.ts +119 -0
  356. package/src/platforms/line/commands/whoami.test.ts +85 -0
  357. package/src/platforms/line/commands/{profile.ts → whoami.ts} +4 -4
  358. package/src/platforms/slack/cli.ts +2 -0
  359. package/src/platforms/slack/commands/index.ts +1 -0
  360. package/src/platforms/slack/commands/whoami.test.ts +126 -0
  361. package/src/platforms/slack/commands/whoami.ts +40 -0
  362. package/src/platforms/slackbot/cli.ts +2 -1
  363. package/src/platforms/slackbot/commands/channel.test.ts +139 -0
  364. package/src/platforms/slackbot/commands/index.ts +1 -0
  365. package/src/platforms/slackbot/commands/message.test.ts +226 -0
  366. package/src/platforms/slackbot/commands/reaction.test.ts +90 -0
  367. package/src/platforms/slackbot/commands/user.test.ts +143 -0
  368. package/src/platforms/slackbot/commands/whoami.test.ts +102 -0
  369. package/src/platforms/slackbot/commands/whoami.ts +44 -0
  370. package/src/platforms/teams/cli.ts +2 -0
  371. package/src/platforms/teams/commands/index.ts +1 -0
  372. package/src/platforms/teams/commands/reaction.test.ts +45 -61
  373. package/src/platforms/teams/commands/reaction.ts +2 -0
  374. package/src/platforms/teams/commands/whoami.test.ts +83 -0
  375. package/src/platforms/teams/commands/whoami.ts +33 -0
  376. package/src/platforms/telegram/cli.ts +2 -1
  377. package/src/platforms/telegram/commands/chat.test.ts +125 -0
  378. package/src/platforms/telegram/commands/index.ts +1 -0
  379. package/src/platforms/telegram/commands/message.test.ts +92 -0
  380. package/src/platforms/telegram/commands/whoami.test.ts +75 -0
  381. package/src/platforms/telegram/commands/whoami.ts +29 -0
  382. package/src/platforms/webex/cli.ts +2 -1
  383. package/src/platforms/webex/commands/auth.test.ts +58 -46
  384. package/src/platforms/webex/commands/index.ts +1 -0
  385. package/src/platforms/webex/commands/member.test.ts +60 -57
  386. package/src/platforms/webex/commands/message.test.ts +74 -121
  387. package/src/platforms/webex/commands/message.ts +1 -1
  388. package/src/platforms/webex/commands/snapshot.test.ts +54 -45
  389. package/src/platforms/webex/commands/space.test.ts +46 -49
  390. package/src/platforms/webex/commands/whoami.test.ts +113 -0
  391. package/src/platforms/webex/commands/whoami.ts +31 -0
  392. package/src/platforms/webex/credential-manager.test.ts +0 -1
  393. package/src/platforms/wechatbot/cli.ts +25 -0
  394. package/src/platforms/wechatbot/client.test.ts +497 -0
  395. package/src/platforms/wechatbot/client.ts +268 -0
  396. package/src/platforms/wechatbot/commands/auth.test.ts +211 -0
  397. package/src/platforms/wechatbot/commands/auth.ts +203 -0
  398. package/src/platforms/wechatbot/commands/index.ts +5 -0
  399. package/src/platforms/wechatbot/commands/message.test.ts +155 -0
  400. package/src/platforms/wechatbot/commands/message.ts +104 -0
  401. package/src/platforms/wechatbot/commands/shared.ts +22 -0
  402. package/src/platforms/wechatbot/commands/template.test.ts +199 -0
  403. package/src/platforms/wechatbot/commands/template.ts +102 -0
  404. package/src/platforms/wechatbot/commands/user.test.ts +165 -0
  405. package/src/platforms/wechatbot/commands/user.ts +75 -0
  406. package/src/platforms/wechatbot/commands/whoami.test.ts +109 -0
  407. package/src/platforms/wechatbot/commands/whoami.ts +43 -0
  408. package/src/platforms/wechatbot/credential-manager.test.ts +255 -0
  409. package/src/platforms/wechatbot/credential-manager.ts +148 -0
  410. package/src/platforms/wechatbot/index.test.ts +49 -0
  411. package/src/platforms/wechatbot/index.ts +19 -0
  412. package/src/platforms/wechatbot/types.test.ts +223 -0
  413. package/src/platforms/wechatbot/types.ts +107 -0
  414. package/src/platforms/whatsapp/cli.ts +2 -1
  415. package/src/platforms/whatsapp/client.ts +180 -37
  416. package/src/platforms/whatsapp/commands/auth.test.ts +311 -0
  417. package/src/platforms/whatsapp/commands/auth.ts +194 -84
  418. package/src/platforms/whatsapp/commands/chat.test.ts +198 -0
  419. package/src/platforms/whatsapp/commands/index.ts +1 -0
  420. package/src/platforms/whatsapp/commands/message.test.ts +231 -0
  421. package/src/platforms/whatsapp/commands/shared.ts +2 -2
  422. package/src/platforms/whatsapp/commands/whoami.test.ts +59 -0
  423. package/src/platforms/whatsapp/commands/whoami.ts +21 -0
  424. package/src/platforms/whatsapp/credential-manager.test.ts +20 -0
  425. package/src/platforms/whatsapp/credential-manager.ts +17 -8
  426. package/src/platforms/whatsapp/ensure-auth.ts +2 -2
  427. package/src/platforms/whatsappbot/cli.ts +2 -1
  428. package/src/platforms/whatsappbot/commands/auth.test.ts +217 -0
  429. package/src/platforms/whatsappbot/commands/index.ts +1 -0
  430. package/src/platforms/whatsappbot/commands/message.test.ts +198 -0
  431. package/src/platforms/whatsappbot/commands/template.test.ts +112 -0
  432. package/src/platforms/whatsappbot/commands/whoami.test.ts +100 -0
  433. package/src/platforms/whatsappbot/commands/whoami.ts +57 -0
  434. package/src/shared/utils/qr.ts +92 -0
  435. package/src/tui/adapters/whatsapp-adapter.ts +19 -16
  436. package/dist/src/platforms/line/commands/profile.d.ts +0 -3
  437. package/dist/src/platforms/line/commands/profile.d.ts.map +0 -1
  438. package/dist/src/platforms/line/commands/profile.js.map +0 -1
@@ -0,0 +1,394 @@
1
+ ---
2
+ name: agent-wechatbot
3
+ description: Interact with WeChat Official Account using API credentials - send messages, manage templates, list followers
4
+ version: 2.5.0
5
+ allowed-tools: Bash(agent-wechatbot:*)
6
+ metadata:
7
+ openclaw:
8
+ requires:
9
+ bins:
10
+ - agent-wechatbot
11
+ install:
12
+ - kind: node
13
+ package: agent-messenger
14
+ bins: [agent-wechatbot]
15
+ ---
16
+
17
+ # Agent WeChatBot
18
+
19
+ A TypeScript CLI tool that enables AI agents and humans to send messages through WeChat Official Account API. Designed for customer engagement, template notifications, and CI/CD integrations using App ID + App Secret authentication.
20
+
21
+ ## Key Concepts
22
+
23
+ Before diving in, a few things about WeChat Official Account API:
24
+
25
+ - **Send-only** — The Official Account API delivers inbound messages via webhooks only. This CLI cannot list or read received messages.
26
+ - **Customer service messages** — You can send free-form text, image, and news (article) messages to users who have interacted with your account within the last 48 hours.
27
+ - **Template messages** — Pre-approved message templates can be sent at any time. Templates must be created and approved in the WeChat Official Account admin panel.
28
+ - **App ID** — Your Official Account's unique application identifier. Found in the WeChat Official Account admin panel under Development > Basic Configuration.
29
+ - **App Secret** — Your application's secret key, paired with the App ID. Found in the same location.
30
+ - **OpenID** — Each follower has a unique OpenID scoped to your Official Account. Use `user list` to retrieve follower OpenIDs.
31
+ - **IP Whitelist** — Your server IP must be added to the Official Account's IP whitelist, or API calls will fail with error `40164`.
32
+ - **Rate limits** — WeChat enforces API call frequency limits. Customer service messages are limited per account per day.
33
+
34
+ ## Quick Start
35
+
36
+ ```bash
37
+ # Set your API credentials
38
+ agent-wechatbot auth set your-app-id your-app-secret
39
+
40
+ # Verify authentication
41
+ agent-wechatbot auth status
42
+
43
+ # Send a text message (recipient must have interacted within 48h)
44
+ agent-wechatbot message send oXXXXXXXXXXXXXXX "Hello from the CLI!"
45
+
46
+ # List available templates
47
+ agent-wechatbot template list --pretty
48
+
49
+ # List followers
50
+ agent-wechatbot user list --pretty
51
+ ```
52
+
53
+ ## Authentication
54
+
55
+ ### API Credential Setup
56
+
57
+ agent-wechatbot uses App ID + App Secret pairs from the WeChat Official Account admin panel:
58
+
59
+ ```bash
60
+ # Set credentials (validates against WeChat API before saving)
61
+ agent-wechatbot auth set your-app-id your-app-secret
62
+
63
+ # Check auth status
64
+ agent-wechatbot auth status
65
+
66
+ # Clear stored credentials
67
+ agent-wechatbot auth clear
68
+ ```
69
+
70
+ ### Multi-Account Management
71
+
72
+ ```bash
73
+ # List stored accounts
74
+ agent-wechatbot auth list
75
+
76
+ # Switch active account
77
+ agent-wechatbot auth use <account-id>
78
+
79
+ # Remove a stored account
80
+ agent-wechatbot auth remove <account-id>
81
+ ```
82
+
83
+ ## Memory
84
+
85
+ The agent maintains a `~/.config/agent-messenger/MEMORY.md` file as persistent memory across sessions. This is agent-managed, the CLI does not read or write this file. Use the `Read` and `Write` tools to manage your memory file.
86
+
87
+ ### Reading Memory
88
+
89
+ At the **start of every task**, read `~/.config/agent-messenger/MEMORY.md` using the `Read` tool to load any previously discovered account IDs, template names, follower OpenIDs, and preferences.
90
+
91
+ - If the file doesn't exist yet, that's fine. Proceed without it and create it when you first have useful information to store.
92
+ - If the file can't be read (permissions, missing directory), proceed without memory. Don't error out.
93
+
94
+ ### Writing Memory
95
+
96
+ After discovering useful information, update `~/.config/agent-messenger/MEMORY.md` using the `Write` tool. Write triggers include:
97
+
98
+ - After discovering account IDs and App IDs (from `auth list`, `auth status`, etc.)
99
+ - After discovering template names and their parameters (from `template list`, etc.)
100
+ - After discovering follower OpenIDs (from `user list`, `user get`, etc.)
101
+ - After the user gives you an alias or preference ("call this the notifications account", "my main template is X")
102
+
103
+ When writing, include the **complete file content**. The `Write` tool overwrites the entire file.
104
+
105
+ ### What to Store
106
+
107
+ - Account IDs (App IDs) with names
108
+ - Template IDs with their required parameters
109
+ - Frequently used follower OpenIDs with context
110
+ - User-given aliases ("notifications account", "marketing account")
111
+ - Any user preference expressed during interaction
112
+
113
+ ### What NOT to Store
114
+
115
+ Never store App Secrets or any credentials. Never store full message content (just context). Never store personal user data.
116
+
117
+ ### Handling Stale Data
118
+
119
+ If a memorized template returns an error (template not found, account invalid), remove it from `MEMORY.md`. Don't blindly trust memorized data. Verify when something seems off. Prefer re-listing over using a memorized value that might be stale.
120
+
121
+ ### Format / Example
122
+
123
+ ```markdown
124
+ # Agent Messenger Memory
125
+
126
+ ## WeChat Accounts
127
+
128
+ - `wx1234567890` - Acme Notifications
129
+
130
+ ## Templates (Acme Notifications)
131
+
132
+ - `TM00001` - Order confirmation, params: [order_id, customer_name]
133
+ - `TM00002` - Shipping update, params: [tracking_number]
134
+
135
+ ## Frequent Recipients
136
+
137
+ - `oABCD1234` - Test user (internal QA)
138
+ - `oEFGH5678` - VIP customer
139
+
140
+ ## Aliases
141
+
142
+ - "notifications" -> `wx1234567890` (Acme Notifications)
143
+
144
+ ## Notes
145
+
146
+ - IP whitelist configured for 203.0.113.10
147
+ - Customer service messages limited to 48h interaction window
148
+ ```
149
+
150
+ > Memory lets you skip repeated `template list` calls. When you already know a template ID from a previous session, use it directly.
151
+
152
+ ## Commands
153
+
154
+ ### Auth Commands
155
+
156
+ ```bash
157
+ # Set account credentials (validates against API)
158
+ agent-wechatbot auth set <app-id> <app-secret>
159
+
160
+ # Check auth status
161
+ agent-wechatbot auth status
162
+ agent-wechatbot auth status --account <account-id>
163
+
164
+ # List stored accounts
165
+ agent-wechatbot auth list
166
+
167
+ # Switch active account
168
+ agent-wechatbot auth use <account-id>
169
+
170
+ # Remove a stored account
171
+ agent-wechatbot auth remove <account-id>
172
+
173
+ # Clear all credentials
174
+ agent-wechatbot auth clear
175
+ ```
176
+
177
+ ### Whoami Command
178
+
179
+ ```bash
180
+ # Show current authenticated bot
181
+ agent-wechatbot whoami
182
+ agent-wechatbot whoami --pretty
183
+ agent-wechatbot whoami --account <account-id>
184
+ ```
185
+
186
+ ### Message Commands
187
+
188
+ ```bash
189
+ # Send a text message (customer service, within 48h window)
190
+ agent-wechatbot message send <open-id> <text>
191
+ agent-wechatbot message send oABCD1234 "Your order has shipped!"
192
+
193
+ # Send an image message (customer service, within 48h window)
194
+ agent-wechatbot message send-image <open-id> <media-id>
195
+ agent-wechatbot message send-image oABCD1234 MEDIA_ID_HERE
196
+
197
+ # Send a news/article message (customer service, within 48h window)
198
+ agent-wechatbot message send-news <open-id> --title "Title" --description "Desc" --url "https://..." --picurl "https://..."
199
+ ```
200
+
201
+ ### Template Commands
202
+
203
+ ```bash
204
+ # List message templates
205
+ agent-wechatbot template list
206
+
207
+ # Send a template message
208
+ agent-wechatbot template send <open-id> <template-id>
209
+ agent-wechatbot template send oABCD1234 TM00001 --data '{"order_id":{"value":"ORD-9876"},"customer_name":{"value":"Alice"}}' --url "https://example.com/order/9876"
210
+
211
+ # Delete a template
212
+ agent-wechatbot template delete <template-id>
213
+ ```
214
+
215
+ ### User Commands
216
+
217
+ ```bash
218
+ # List followers (paginated)
219
+ agent-wechatbot user list
220
+ agent-wechatbot user list --next-openid oLAST_OPENID
221
+
222
+ # Get user info by OpenID
223
+ agent-wechatbot user get <open-id>
224
+ agent-wechatbot user get oABCD1234 --lang en
225
+ ```
226
+
227
+ ## Output Format
228
+
229
+ ### JSON (Default)
230
+
231
+ All commands output JSON by default for AI consumption:
232
+
233
+ ```json
234
+ {
235
+ "success": true,
236
+ "app_id": "wx1234567890",
237
+ "account_name": "wx1234567890"
238
+ }
239
+ ```
240
+
241
+ ### Pretty (Human-Readable)
242
+
243
+ Use `--pretty` flag for formatted output:
244
+
245
+ ```bash
246
+ agent-wechatbot template list --pretty
247
+ ```
248
+
249
+ ## Global Options
250
+
251
+ | Option | Description |
252
+ | ---------------- | -------------------------------------- |
253
+ | `--pretty` | Human-readable output instead of JSON |
254
+ | `--account <id>` | Use a specific account for this command |
255
+
256
+ ## Common Patterns
257
+
258
+ ### Send a customer service message within 48h window
259
+
260
+ Customer service messages can be sent to users who have interacted with your account within the last 48 hours:
261
+
262
+ ```bash
263
+ # Send a text reply
264
+ agent-wechatbot message send oABCD1234 "Thanks for reaching out! We'll look into this right away."
265
+
266
+ # Send a news article
267
+ agent-wechatbot message send-news oABCD1234 \
268
+ --title "Your Order Update" \
269
+ --description "Your order #12345 has been shipped" \
270
+ --url "https://example.com/orders/12345" \
271
+ --picurl "https://example.com/images/shipping.jpg"
272
+ ```
273
+
274
+ ### Send a template notification (anytime)
275
+
276
+ Template messages can be sent at any time, regardless of the 48h window:
277
+
278
+ ```bash
279
+ # List templates to find the right one
280
+ agent-wechatbot template list --pretty
281
+
282
+ # Send a template message with data
283
+ agent-wechatbot template send oABCD1234 TM00001 \
284
+ --data '{"order_id":{"value":"ORD-9876"},"status":{"value":"Shipped"}}' \
285
+ --url "https://example.com/orders/9876"
286
+ ```
287
+
288
+ ### List and inspect followers
289
+
290
+ ```bash
291
+ # Get first page of followers
292
+ agent-wechatbot user list --pretty
293
+
294
+ # Get next page
295
+ agent-wechatbot user list --next-openid oLAST_OPENID --pretty
296
+
297
+ # Get details for a specific follower
298
+ agent-wechatbot user get oABCD1234 --pretty
299
+ ```
300
+
301
+ ### CI/CD deployment notification
302
+
303
+ ```bash
304
+ agent-wechatbot template send oABCD1234 deployment_alert \
305
+ --data '{"version":{"value":"v2.1.0"},"environment":{"value":"production"},"status":{"value":"success"}}'
306
+ ```
307
+
308
+ ## Error Handling
309
+
310
+ All commands return consistent error format:
311
+
312
+ ```json
313
+ {
314
+ "error": "No credentials. Run \"auth set <app-id> <app-secret>\" first."
315
+ }
316
+ ```
317
+
318
+ Common errors: `No credentials`, `Account not found`, `Invalid credentials`, `WeChat API error (errcode: 40001)`, `IP not in whitelist (errcode: 40164)`, `Rate limit exceeded (errcode: 45009)`.
319
+
320
+ ## Configuration
321
+
322
+ Credentials stored in `~/.config/agent-messenger/wechatbot-credentials.json` (0600 permissions).
323
+
324
+ Config format:
325
+
326
+ ```json
327
+ {
328
+ "current": { "account_id": "wx1234567890" },
329
+ "accounts": {
330
+ "wx1234567890": {
331
+ "app_id": "wx1234567890",
332
+ "app_secret": "...",
333
+ "account_name": "wx1234567890"
334
+ }
335
+ }
336
+ }
337
+ ```
338
+
339
+ ## Limitations
340
+
341
+ - **Cannot list or read received messages** — WeChat Official Account API delivers inbound messages via webhooks only. This CLI is send-only.
342
+ - **Customer service messages require 48h window** — Free-form text, image, and news messages only work within 48 hours of the user's last interaction.
343
+ - **Template messages require pre-approval** — Templates must be created and approved in the WeChat admin panel before use.
344
+ - **IP whitelist required** — Your server's IP must be added to the Official Account's whitelist, or you'll get error `40164`.
345
+ - **Media IDs required for images** — Images must be uploaded to WeChat's media platform first. The CLI accepts media IDs, not URLs.
346
+ - **No group chat support** — Official Account API communicates with individual followers only.
347
+ - **No real-time events / WebSocket connection** — Inbound messages require a separate webhook server.
348
+ - **No message editing or deletion**
349
+ - **No voice or video calls**
350
+ - **Access tokens expire** — Tokens are valid for 7200 seconds. The CLI handles automatic refresh.
351
+
352
+ ## Troubleshooting
353
+
354
+ ### `agent-wechatbot: command not found`
355
+
356
+ **`agent-wechatbot` is NOT the npm package name.** The npm package is `agent-messenger`.
357
+
358
+ If the package is installed globally, use `agent-wechatbot` directly:
359
+
360
+ ```bash
361
+ agent-wechatbot message send oABCD1234 "Hello"
362
+ ```
363
+
364
+ If the package is NOT installed, run it directly with `npx -y`:
365
+
366
+ ```bash
367
+ npx -y agent-messenger wechatbot message send oABCD1234 "Hello"
368
+ ```
369
+
370
+ > **Note**: If the user prefers a different package runner (e.g., `bunx`, `pnpx`, `pnpm dlx`), use that instead.
371
+
372
+ **NEVER run `npx agent-wechatbot`, `bunx agent-wechatbot`, or `pnpm dlx agent-wechatbot`**. It will fail or install a wrong package since `agent-wechatbot` is not the npm package name.
373
+
374
+ ### How to get API credentials
375
+
376
+ 1. Log in to the [WeChat Official Account admin panel](https://mp.weixin.qq.com/)
377
+ 2. Navigate to **Development > Basic Configuration**
378
+ 3. Copy your **App ID** and **App Secret** (you may need to reset the secret if you don't have it saved)
379
+ 4. Add your server's IP to the **IP Whitelist**
380
+ 5. Run `agent-wechatbot auth set <app-id> <app-secret>`
381
+
382
+ ### IP whitelist errors (40164)
383
+
384
+ If you get error `40164`, your server's IP is not in the Official Account's whitelist. Add it in the admin panel under **Development > Basic Configuration > IP Whitelist**.
385
+
386
+ ### Token errors (40001, 42001)
387
+
388
+ These indicate an expired or invalid access token. The CLI handles automatic token refresh, but if you see persistent errors:
389
+ - Verify your App Secret hasn't been reset in the admin panel
390
+ - Re-run `agent-wechatbot auth set <app-id> <app-secret>` with the current credentials
391
+
392
+ ### Rate limiting (45009)
393
+
394
+ WeChat enforces API call frequency limits. If you hit error `45009`, wait before retrying. For bulk operations, add delays between requests.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-whatsapp
3
3
  description: Interact with WhatsApp - send messages, read chats, manage conversations
4
- version: 2.3.0
4
+ version: 2.5.0
5
5
  allowed-tools: Bash(agent-whatsapp:*)
6
6
  metadata:
7
7
  openclaw:
@@ -16,7 +16,7 @@ metadata:
16
16
 
17
17
  # Agent WhatsApp
18
18
 
19
- A Baileys-backed WhatsApp CLI for AI agents. Links as a companion device via pairing code, so your phone stays connected. Each command connects on demand and disconnects when done.
19
+ A Baileys-backed WhatsApp CLI for AI agents. Links as a companion device via QR code or pairing code, so your phone stays connected. Each command connects on demand and disconnects when done.
20
20
 
21
21
  Use one of these entrypoints:
22
22
  - Global install: `agent-whatsapp ...`
@@ -27,6 +27,7 @@ Use one of these entrypoints:
27
27
  Before diving in, a few things about WhatsApp's architecture:
28
28
 
29
29
  - **JID** (Jabber ID) = WhatsApp's address format. Individual: `1234567890@s.whatsapp.net`. Group: `123456789-123345@g.us`. You can pass plain phone numbers and the CLI resolves them to JIDs automatically.
30
+ - **QR code auth** = links the CLI as a companion device by scanning a QR code displayed in the terminal or browser. Open WhatsApp > Linked Devices > Link a Device and scan the code.
30
31
  - **Pairing code auth** = links the CLI as a companion device using a numeric code displayed in your terminal. Enter it in WhatsApp on your phone under Linked Devices.
31
32
  - **Connect-on-demand** = the CLI opens a WebSocket connection for each command and disconnects afterward. There's no persistent background process.
32
33
  - **Multi-account** = multiple WhatsApp accounts can be linked. Use `auth list` and `auth use` to switch between them.
@@ -34,7 +35,10 @@ Before diving in, a few things about WhatsApp's architecture:
34
35
  ## Quick Start
35
36
 
36
37
  ```bash
37
- # Link as companion device (enter the pairing code on your phone)
38
+ # Link as companion device via QR code (scan with your phone)
39
+ agent-whatsapp auth login --qr
40
+
41
+ # Or link via pairing code (enter the code on your phone)
38
42
  agent-whatsapp auth login --phone +1234567890
39
43
 
40
44
  # List chats
@@ -46,7 +50,10 @@ agent-whatsapp message send +1234567890 "Hello from agent-whatsapp"
46
50
 
47
51
  ## Authentication Flow
48
52
 
49
- WhatsApp uses pairing code authentication. The CLI registers as a companion (linked) device, so your phone session is never affected.
53
+ WhatsApp supports two authentication methods. Both register the CLI as a companion (linked) device, so your phone session is never affected.
54
+
55
+ - **QR code** (`--qr`): A QR code is displayed in the terminal and opened in the browser. Scan it with WhatsApp on your phone. No phone number needed.
56
+ - **Pairing code** (`--phone`): A numeric code is displayed. Enter it in WhatsApp on your phone under Linked Devices > Link with phone number.
50
57
 
51
58
  ### Agent Behavior (MANDATORY)
52
59
 
@@ -60,28 +67,36 @@ agent-whatsapp auth list
60
67
 
61
68
  If accounts exist, use `agent-whatsapp auth use <account-id>` and retry the original command.
62
69
 
63
- **Step 2: If no accounts, ask for phone number**
70
+ **Step 2: If no accounts, start QR login (preferred)**
71
+
72
+ ```bash
73
+ agent-whatsapp auth login --qr
74
+ # -> QR code displayed in terminal + opened in browser
75
+ # -> {"next_action":"scan_qr","qr_url":"...","message":"Scan with WhatsApp on your phone"}
76
+ ```
77
+
78
+ Tell the user to scan the QR code with WhatsApp: Settings > Linked Devices > Link a Device > scan the QR code.
64
79
 
65
- Ask the user for their WhatsApp phone number (international format, e.g. `+1234567890`). This is the ONLY thing the user needs to provide.
80
+ **Alternative: Pairing code login**
66
81
 
67
- **Step 3: Start login**
82
+ If QR scanning is not possible (e.g. headless environment), ask for the phone number and use pairing code:
68
83
 
69
84
  ```bash
70
85
  agent-whatsapp auth login --phone +1234567890
71
- # -> {"next_action":"enter_pairing_code","pairing_code":"A1B2-C3D4","message":"Enter this code in WhatsApp on your phone: Linked Devices > Link a Device."}
86
+ # -> {"pairing_code":"A1B2-C3D4","message":"Enter this code in WhatsApp > Linked Devices > Link with phone number"}
72
87
  ```
73
88
 
74
- Tell the user the pairing code and ask them to enter it on their phone: open WhatsApp > Settings > Linked Devices > Link a Device > enter the code.
89
+ Tell the user the pairing code and ask them to enter it on their phone.
75
90
 
76
- **Step 4: Wait for confirmation**
91
+ **Step 3: Wait for confirmation**
77
92
 
78
- The CLI polls until the user confirms on their phone. Once confirmed:
93
+ The CLI waits until the user confirms on their phone. Once confirmed:
79
94
 
80
95
  ```bash
81
96
  # -> {"authenticated":true,...}
82
97
  ```
83
98
 
84
- **Step 5: Retry the original command**
99
+ **Step 4: Retry the original command**
85
100
 
86
101
  After successful auth, immediately execute whatever the user originally asked for.
87
102
 
@@ -169,6 +184,9 @@ If a memorized JID returns an error, remove it from `MEMORY.md`. Don't blindly t
169
184
  ### Auth Commands
170
185
 
171
186
  ```bash
187
+ # Link as companion device via QR code (no phone number needed)
188
+ agent-whatsapp auth login --qr
189
+
172
190
  # Link as companion device via pairing code
173
191
  agent-whatsapp auth login --phone +1234567890
174
192
 
@@ -187,6 +205,17 @@ agent-whatsapp auth logout
187
205
  agent-whatsapp auth logout --account <id>
188
206
  ```
189
207
 
208
+ ### Whoami Command
209
+
210
+ ```bash
211
+ # Show current authenticated user
212
+ agent-whatsapp whoami
213
+ agent-whatsapp whoami --pretty
214
+ agent-whatsapp whoami --account <account-id>
215
+ ```
216
+
217
+ Output includes the authenticated user's identity information.
218
+
190
219
  ### Chat Commands
191
220
 
192
221
  ```bash
@@ -319,13 +348,13 @@ All commands return consistent error format:
319
348
 
320
349
  ```json
321
350
  {
322
- "error": "No WhatsApp account linked. Run: agent-whatsapp auth login --phone <number>"
351
+ "error": "No WhatsApp account linked. Run: agent-whatsapp auth login --qr"
323
352
  }
324
353
  ```
325
354
 
326
355
  Common errors:
327
356
 
328
- - `No WhatsApp account linked` - not authenticated. Run `auth login --phone <number>`.
357
+ - `No WhatsApp account linked` - not authenticated. Run `auth login --qr` or `auth login --phone <number>`.
329
358
  - `Connection timeout` - WebSocket connection to WhatsApp failed. Retry the command.
330
359
  - `Invalid JID` - malformed phone number or JID. Use international format with `+` prefix.
331
360
  - `Not a group participant` - can't send to a group you're not a member of.
@@ -361,6 +390,14 @@ pnpm dlx --package agent-messenger agent-whatsapp chat list --pretty
361
390
 
362
391
  **NEVER run `npx agent-whatsapp`, `bunx agent-whatsapp`, or `pnpm dlx agent-whatsapp`** without `--package agent-messenger`. It will fail or install a wrong package since `agent-whatsapp` is not the npm package name.
363
392
 
393
+ ### QR code not scanning
394
+
395
+ 1. Make sure WhatsApp is open on your phone
396
+ 2. Go to Settings > Linked Devices > Link a Device
397
+ 3. Point your phone camera at the QR code in the terminal or browser
398
+ 4. If the QR code expires, run `auth login --qr` again for a fresh code
399
+ 5. If QR scanning fails, try pairing code: `auth login --phone <number>`
400
+
364
401
  ### Pairing code not working
365
402
 
366
403
  1. Make sure WhatsApp is open on your phone
@@ -369,6 +406,17 @@ pnpm dlx --package agent-messenger agent-whatsapp chat list --pretty
369
406
  4. Enter the pairing code shown in the terminal
370
407
  5. If the code expires, run `auth login --phone <number>` again for a fresh code
371
408
 
409
+ ### Empty chat list after linking a new device
410
+
411
+ WhatsApp companion devices receive their chat list from the primary phone — there's no server API to fetch it directly. On a freshly linked device, `chat list` may return only group chats (or nothing at all) for individual/DM conversations.
412
+
413
+ - **Keep your phone online** with WhatsApp open during and after linking. The phone pushes history to the new device; if it's off or WhatsApp is killed, nothing arrives.
414
+ - **Wait a few minutes** and run `chat list` again. History trickles in over time and is saved locally, so subsequent runs will show more chats.
415
+ - **Groups always work** immediately — they're fetched from the server, not from history sync.
416
+ - **Sending a message** to a known phone number will make that chat appear even if it wasn't in the initial sync.
417
+
418
+ This is a WhatsApp protocol limitation, not a bug.
419
+
372
420
  ### Connection drops
373
421
 
374
422
  WhatsApp may disconnect linked devices that are inactive for extended periods. If commands start failing:
@@ -378,5 +426,5 @@ WhatsApp may disconnect linked devices that are inactive for extended periods. I
378
426
  agent-whatsapp auth status
379
427
 
380
428
  # Re-link if needed
381
- agent-whatsapp auth login --phone +1234567890
429
+ agent-whatsapp auth login --qr
382
430
  ```
@@ -2,7 +2,37 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- agent-whatsapp uses pairing code authentication via [Baileys](https://github.com/WhiskeySockets/Baileys). The CLI registers as a companion (linked) device, so your phone session is never affected. Each command connects on demand and disconnects when done.
5
+ agent-whatsapp uses [Baileys](https://github.com/WhiskeySockets/Baileys) to authenticate via QR code or pairing code. The CLI registers as a companion (linked) device, so your phone session is never affected. Each command connects on demand and disconnects when done.
6
+
7
+ ## QR Code Login
8
+
9
+ ### How It Works
10
+
11
+ 1. The CLI generates a QR code and displays it in the terminal (and opens it in the browser)
12
+ 2. You scan the QR code with WhatsApp on your phone: Settings > Linked Devices > Link a Device
13
+ 3. Session credentials are stored locally for future commands
14
+
15
+ ### Starting Login
16
+
17
+ ```bash
18
+ agent-whatsapp auth login --qr
19
+ ```
20
+
21
+ In interactive mode, a QR code is rendered in the terminal and opened in the browser. In non-interactive mode, JSON output is emitted:
22
+
23
+ ```json
24
+ {"next_action":"scan_qr","qr_url":"...","qr_html_path":"/tmp/whatsapp-qr-....html","message":"Scan with WhatsApp on your phone"}
25
+ ```
26
+
27
+ After scanning:
28
+
29
+ ```json
30
+ {"authenticated":true,"account_id":"qr-default"}
31
+ ```
32
+
33
+ ### QR Code Refresh
34
+
35
+ Baileys emits a new QR code every ~20 seconds. The terminal QR updates automatically. The browser tab is only opened once. If the QR expires after ~2 minutes, run `auth login --qr` again.
6
36
 
7
37
  ## Pairing Code Login
8
38
 
@@ -10,8 +40,8 @@ agent-whatsapp uses pairing code authentication via [Baileys](https://github.com
10
40
 
11
41
  1. You provide your phone number in international format (e.g. `+1234567890`)
12
42
  2. The CLI generates a numeric pairing code and displays it
13
- 3. You enter the code on your phone: WhatsApp > Settings > Linked Devices > Link a Device
14
- 4. The CLI polls until you confirm on your phone
43
+ 3. You enter the code on your phone: WhatsApp > Settings > Linked Devices > Link with phone number
44
+ 4. The CLI waits until you confirm on your phone
15
45
  5. Session credentials are stored locally for future commands
16
46
 
17
47
  ### Starting Login
@@ -34,7 +64,7 @@ After confirmation on your phone:
34
64
 
35
65
  ### Login Failures
36
66
 
37
- If the pairing code expires (typically after 60 seconds), run `auth login` again for a fresh code. If your phone isn't connected to the internet, the pairing will time out.
67
+ If the pairing code expires (typically after 60 seconds), run `auth login --phone <number>` again for a fresh code. If your phone isn't connected to the internet, the pairing will time out.
38
68
 
39
69
  ## Multi-Account Management
40
70
 
@@ -121,7 +151,7 @@ Output when not authenticated:
121
151
 
122
152
  ```json
123
153
  {
124
- "error": "No WhatsApp account linked. Run: agent-whatsapp auth login --phone <number>"
154
+ "error": "No WhatsApp account configured. Run \"auth login --qr\" or \"auth login --phone <phone-number>\" first."
125
155
  }
126
156
  ```
127
157
 
@@ -163,7 +193,7 @@ If commands start failing with auth errors:
163
193
  agent-whatsapp auth status
164
194
 
165
195
  # Re-link if needed
166
- agent-whatsapp auth login --phone +1234567890
196
+ agent-whatsapp auth login --qr
167
197
 
168
198
  # Verify it worked
169
199
  agent-whatsapp auth status
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent-whatsappbot
3
3
  description: Interact with WhatsApp using Cloud API credentials - send messages, manage templates
4
- version: 2.3.0
4
+ version: 2.5.0
5
5
  allowed-tools: Bash(agent-whatsappbot:*)
6
6
  metadata:
7
7
  openclaw:
@@ -169,6 +169,15 @@ agent-whatsappbot auth remove <account-id>
169
169
  agent-whatsappbot auth clear
170
170
  ```
171
171
 
172
+ ### Whoami Command
173
+
174
+ ```bash
175
+ # Show current authenticated bot
176
+ agent-whatsappbot whoami
177
+ agent-whatsappbot whoami --pretty
178
+ agent-whatsappbot whoami --account <account-id>
179
+ ```
180
+
172
181
  ### Message Commands
173
182
 
174
183
  ```bash
@@ -12,6 +12,7 @@ import {
12
12
  createManagerCommand,
13
13
  createMessageCommand,
14
14
  createSnapshotCommand,
15
+ createWhoamiCommand,
15
16
  } from './commands'
16
17
  import { ensureChannelAuth } from './ensure-auth'
17
18
 
@@ -45,6 +46,7 @@ program.addCommand(createGroupCommand())
45
46
  program.addCommand(createManagerCommand())
46
47
  program.addCommand(createBotCommand())
47
48
  program.addCommand(createSnapshotCommand())
49
+ program.addCommand(createWhoamiCommand())
48
50
 
49
51
  program.parseAsync(process.argv)
50
52
 
@@ -5,3 +5,4 @@ export { createGroupCommand, groupCommand } from './group'
5
5
  export { createManagerCommand, managerCommand } from './manager'
6
6
  export { createMessageCommand, messageCommand } from './message'
7
7
  export { createSnapshotCommand, snapshotCommand } from './snapshot'
8
+ export { createWhoamiCommand, whoamiCommand } from './whoami'