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.
- package/.claude-plugin/README.md +16 -16
- package/.claude-plugin/marketplace.json +29 -29
- package/.claude-plugin/plugin.json +5 -5
- package/.github/workflows/release.yml +0 -12
- package/CONTRIBUTING.md +1 -1
- package/README.md +11 -8
- package/bun.lock +70 -110
- package/bunfig.toml +3 -0
- package/dist/package.json +11 -3
- package/dist/src/platforms/channeltalk/cli.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/cli.js +2 -1
- package/dist/src/platforms/channeltalk/cli.js.map +1 -1
- package/dist/src/platforms/channeltalk/commands/index.d.ts +1 -0
- package/dist/src/platforms/channeltalk/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/commands/index.js +1 -0
- package/dist/src/platforms/channeltalk/commands/index.js.map +1 -1
- package/dist/src/platforms/channeltalk/commands/whoami.d.ts +22 -0
- package/dist/src/platforms/channeltalk/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/channeltalk/commands/whoami.js +40 -0
- package/dist/src/platforms/channeltalk/commands/whoami.js.map +1 -0
- package/dist/src/platforms/channeltalkbot/cli.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/cli.js +2 -1
- package/dist/src/platforms/channeltalkbot/cli.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/index.d.ts +1 -0
- package/dist/src/platforms/channeltalkbot/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/index.js +1 -0
- package/dist/src/platforms/channeltalkbot/commands/index.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/whoami.d.ts +13 -0
- package/dist/src/platforms/channeltalkbot/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/channeltalkbot/commands/whoami.js +31 -0
- package/dist/src/platforms/channeltalkbot/commands/whoami.js.map +1 -0
- package/dist/src/platforms/discord/cli.d.ts.map +1 -1
- package/dist/src/platforms/discord/cli.js +2 -1
- package/dist/src/platforms/discord/cli.js.map +1 -1
- package/dist/src/platforms/discord/commands/index.d.ts +1 -0
- package/dist/src/platforms/discord/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/index.js +1 -0
- package/dist/src/platforms/discord/commands/index.js.map +1 -1
- package/dist/src/platforms/discord/commands/whoami.d.ts +6 -0
- package/dist/src/platforms/discord/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/whoami.js +33 -0
- package/dist/src/platforms/discord/commands/whoami.js.map +1 -0
- package/dist/src/platforms/discordbot/cli.d.ts.map +1 -1
- package/dist/src/platforms/discordbot/cli.js +2 -1
- package/dist/src/platforms/discordbot/cli.js.map +1 -1
- package/dist/src/platforms/discordbot/client.js +2 -2
- package/dist/src/platforms/discordbot/client.js.map +1 -1
- package/dist/src/platforms/discordbot/commands/index.d.ts +1 -0
- package/dist/src/platforms/discordbot/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/discordbot/commands/index.js +1 -0
- package/dist/src/platforms/discordbot/commands/index.js.map +1 -1
- package/dist/src/platforms/discordbot/commands/whoami.d.ts +14 -0
- package/dist/src/platforms/discordbot/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/discordbot/commands/whoami.js +32 -0
- package/dist/src/platforms/discordbot/commands/whoami.js.map +1 -0
- package/dist/src/platforms/instagram/cli.d.ts.map +1 -1
- package/dist/src/platforms/instagram/cli.js +2 -1
- package/dist/src/platforms/instagram/cli.js.map +1 -1
- package/dist/src/platforms/instagram/client.d.ts +6 -0
- package/dist/src/platforms/instagram/client.d.ts.map +1 -1
- package/dist/src/platforms/instagram/client.js +12 -0
- package/dist/src/platforms/instagram/client.js.map +1 -1
- package/dist/src/platforms/instagram/commands/index.d.ts +1 -0
- package/dist/src/platforms/instagram/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/instagram/commands/index.js +1 -0
- package/dist/src/platforms/instagram/commands/index.js.map +1 -1
- package/dist/src/platforms/instagram/commands/whoami.d.ts +7 -0
- package/dist/src/platforms/instagram/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/instagram/commands/whoami.js +19 -0
- package/dist/src/platforms/instagram/commands/whoami.js.map +1 -0
- package/dist/src/platforms/kakaotalk/cli.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/cli.js +2 -1
- package/dist/src/platforms/kakaotalk/cli.js.map +1 -1
- package/dist/src/platforms/kakaotalk/client.d.ts +2 -1
- package/dist/src/platforms/kakaotalk/client.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/client.js +225 -23
- package/dist/src/platforms/kakaotalk/client.js.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/index.d.ts +1 -0
- package/dist/src/platforms/kakaotalk/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/index.js +1 -0
- package/dist/src/platforms/kakaotalk/commands/index.js.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/whoami.d.ts +3 -0
- package/dist/src/platforms/kakaotalk/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/commands/whoami.js +19 -0
- package/dist/src/platforms/kakaotalk/commands/whoami.js.map +1 -0
- package/dist/src/platforms/kakaotalk/index.d.ts +2 -2
- package/dist/src/platforms/kakaotalk/index.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/index.js +1 -1
- package/dist/src/platforms/kakaotalk/index.js.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/session.d.ts +4 -2
- package/dist/src/platforms/kakaotalk/protocol/session.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/session.js +27 -7
- package/dist/src/platforms/kakaotalk/protocol/session.js.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/types.d.ts +17 -0
- package/dist/src/platforms/kakaotalk/protocol/types.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/types.js.map +1 -1
- package/dist/src/platforms/kakaotalk/types.d.ts +28 -0
- package/dist/src/platforms/kakaotalk/types.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/types.js +14 -0
- package/dist/src/platforms/kakaotalk/types.js.map +1 -1
- package/dist/src/platforms/line/cli.js +2 -2
- package/dist/src/platforms/line/cli.js.map +1 -1
- package/dist/src/platforms/line/client.d.ts.map +1 -1
- package/dist/src/platforms/line/client.js +9 -36
- package/dist/src/platforms/line/client.js.map +1 -1
- package/dist/src/platforms/line/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/line/commands/auth.js +9 -47
- package/dist/src/platforms/line/commands/auth.js.map +1 -1
- package/dist/src/platforms/line/commands/index.d.ts +1 -1
- package/dist/src/platforms/line/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/line/commands/index.js +1 -1
- package/dist/src/platforms/line/commands/index.js.map +1 -1
- package/dist/src/platforms/line/commands/whoami.d.ts +3 -0
- package/dist/src/platforms/line/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/line/commands/{profile.js → whoami.js} +5 -5
- package/dist/src/platforms/line/commands/whoami.js.map +1 -0
- package/dist/src/platforms/slack/cli.d.ts.map +1 -1
- package/dist/src/platforms/slack/cli.js +2 -1
- package/dist/src/platforms/slack/cli.js.map +1 -1
- package/dist/src/platforms/slack/commands/index.d.ts +1 -0
- package/dist/src/platforms/slack/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/index.js +1 -0
- package/dist/src/platforms/slack/commands/index.js.map +1 -1
- package/dist/src/platforms/slack/commands/whoami.d.ts +6 -0
- package/dist/src/platforms/slack/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/whoami.js +39 -0
- package/dist/src/platforms/slack/commands/whoami.js.map +1 -0
- package/dist/src/platforms/slackbot/cli.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/cli.js +2 -1
- package/dist/src/platforms/slackbot/cli.js.map +1 -1
- package/dist/src/platforms/slackbot/commands/index.d.ts +1 -0
- package/dist/src/platforms/slackbot/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/commands/index.js +1 -0
- package/dist/src/platforms/slackbot/commands/index.js.map +1 -1
- package/dist/src/platforms/slackbot/commands/whoami.d.ts +14 -0
- package/dist/src/platforms/slackbot/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/commands/whoami.js +32 -0
- package/dist/src/platforms/slackbot/commands/whoami.js.map +1 -0
- package/dist/src/platforms/teams/cli.d.ts.map +1 -1
- package/dist/src/platforms/teams/cli.js +2 -1
- package/dist/src/platforms/teams/cli.js.map +1 -1
- package/dist/src/platforms/teams/commands/index.d.ts +1 -0
- package/dist/src/platforms/teams/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/index.js +1 -0
- package/dist/src/platforms/teams/commands/index.js.map +1 -1
- package/dist/src/platforms/teams/commands/reaction.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/reaction.js +2 -0
- package/dist/src/platforms/teams/commands/reaction.js.map +1 -1
- package/dist/src/platforms/teams/commands/whoami.d.ts +6 -0
- package/dist/src/platforms/teams/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/whoami.js +30 -0
- package/dist/src/platforms/teams/commands/whoami.js.map +1 -0
- package/dist/src/platforms/telegram/cli.d.ts.map +1 -1
- package/dist/src/platforms/telegram/cli.js +2 -1
- package/dist/src/platforms/telegram/cli.js.map +1 -1
- package/dist/src/platforms/telegram/commands/index.d.ts +1 -0
- package/dist/src/platforms/telegram/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/telegram/commands/index.js +1 -0
- package/dist/src/platforms/telegram/commands/index.js.map +1 -1
- package/dist/src/platforms/telegram/commands/whoami.d.ts +7 -0
- package/dist/src/platforms/telegram/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/telegram/commands/whoami.js +27 -0
- package/dist/src/platforms/telegram/commands/whoami.js.map +1 -0
- package/dist/src/platforms/webex/cli.d.ts.map +1 -1
- package/dist/src/platforms/webex/cli.js +2 -1
- package/dist/src/platforms/webex/cli.js.map +1 -1
- package/dist/src/platforms/webex/commands/index.d.ts +1 -0
- package/dist/src/platforms/webex/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/index.js +1 -0
- package/dist/src/platforms/webex/commands/index.js.map +1 -1
- package/dist/src/platforms/webex/commands/message.js +1 -1
- package/dist/src/platforms/webex/commands/message.js.map +1 -1
- package/dist/src/platforms/webex/commands/whoami.d.ts +6 -0
- package/dist/src/platforms/webex/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/webex/commands/whoami.js +30 -0
- package/dist/src/platforms/webex/commands/whoami.js.map +1 -0
- package/dist/src/platforms/wechatbot/cli.d.ts +5 -0
- package/dist/src/platforms/wechatbot/cli.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/cli.js +19 -0
- package/dist/src/platforms/wechatbot/cli.js.map +1 -0
- package/dist/src/platforms/wechatbot/client.d.ts +36 -0
- package/dist/src/platforms/wechatbot/client.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/client.js +208 -0
- package/dist/src/platforms/wechatbot/client.js.map +1 -0
- package/dist/src/platforms/wechatbot/commands/auth.d.ts +28 -0
- package/dist/src/platforms/wechatbot/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/commands/auth.js +164 -0
- package/dist/src/platforms/wechatbot/commands/auth.js.map +1 -0
- package/dist/src/platforms/wechatbot/commands/index.d.ts +6 -0
- package/dist/src/platforms/wechatbot/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/commands/index.js +6 -0
- package/dist/src/platforms/wechatbot/commands/index.js.map +1 -0
- package/dist/src/platforms/wechatbot/commands/message.d.ts +18 -0
- package/dist/src/platforms/wechatbot/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/commands/message.js +80 -0
- package/dist/src/platforms/wechatbot/commands/message.js.map +1 -0
- package/dist/src/platforms/wechatbot/commands/shared.d.ts +9 -0
- package/dist/src/platforms/wechatbot/commands/shared.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/commands/shared.js +13 -0
- package/dist/src/platforms/wechatbot/commands/shared.js.map +1 -0
- package/dist/src/platforms/wechatbot/commands/template.d.ts +19 -0
- package/dist/src/platforms/wechatbot/commands/template.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/commands/template.js +76 -0
- package/dist/src/platforms/wechatbot/commands/template.js.map +1 -0
- package/dist/src/platforms/wechatbot/commands/user.d.ts +20 -0
- package/dist/src/platforms/wechatbot/commands/user.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/commands/user.js +53 -0
- package/dist/src/platforms/wechatbot/commands/user.js.map +1 -0
- package/dist/src/platforms/wechatbot/commands/whoami.d.ts +12 -0
- package/dist/src/platforms/wechatbot/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/commands/whoami.js +33 -0
- package/dist/src/platforms/wechatbot/commands/whoami.js.map +1 -0
- package/dist/src/platforms/wechatbot/credential-manager.d.ts +17 -0
- package/dist/src/platforms/wechatbot/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/credential-manager.js +121 -0
- package/dist/src/platforms/wechatbot/credential-manager.js.map +1 -0
- package/dist/src/platforms/wechatbot/index.d.ts +5 -0
- package/dist/src/platforms/wechatbot/index.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/index.js +4 -0
- package/dist/src/platforms/wechatbot/index.js.map +1 -0
- package/dist/src/platforms/wechatbot/types.d.ts +94 -0
- package/dist/src/platforms/wechatbot/types.d.ts.map +1 -0
- package/dist/src/platforms/wechatbot/types.js +54 -0
- package/dist/src/platforms/wechatbot/types.js.map +1 -0
- package/dist/src/platforms/whatsapp/cli.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/cli.js +2 -1
- package/dist/src/platforms/whatsapp/cli.js.map +1 -1
- package/dist/src/platforms/whatsapp/client.d.ts +9 -0
- package/dist/src/platforms/whatsapp/client.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/client.js +143 -21
- package/dist/src/platforms/whatsapp/client.js.map +1 -1
- package/dist/src/platforms/whatsapp/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/commands/auth.js +133 -60
- package/dist/src/platforms/whatsapp/commands/auth.js.map +1 -1
- package/dist/src/platforms/whatsapp/commands/index.d.ts +1 -0
- package/dist/src/platforms/whatsapp/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/commands/index.js +1 -0
- package/dist/src/platforms/whatsapp/commands/index.js.map +1 -1
- package/dist/src/platforms/whatsapp/commands/shared.js +2 -2
- package/dist/src/platforms/whatsapp/commands/shared.js.map +1 -1
- package/dist/src/platforms/whatsapp/commands/whoami.d.ts +7 -0
- package/dist/src/platforms/whatsapp/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/whatsapp/commands/whoami.js +19 -0
- package/dist/src/platforms/whatsapp/commands/whoami.js.map +1 -0
- package/dist/src/platforms/whatsapp/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/credential-manager.js +14 -8
- package/dist/src/platforms/whatsapp/credential-manager.js.map +1 -1
- package/dist/src/platforms/whatsapp/ensure-auth.js +2 -2
- package/dist/src/platforms/whatsapp/ensure-auth.js.map +1 -1
- package/dist/src/platforms/whatsappbot/cli.d.ts.map +1 -1
- package/dist/src/platforms/whatsappbot/cli.js +2 -1
- package/dist/src/platforms/whatsappbot/cli.js.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/index.d.ts +1 -0
- package/dist/src/platforms/whatsappbot/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/index.js +1 -0
- package/dist/src/platforms/whatsappbot/commands/index.js.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/whoami.d.ts +17 -0
- package/dist/src/platforms/whatsappbot/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/whatsappbot/commands/whoami.js +39 -0
- package/dist/src/platforms/whatsappbot/commands/whoami.js.map +1 -0
- package/dist/src/shared/utils/qr.d.ts +15 -0
- package/dist/src/shared/utils/qr.d.ts.map +1 -0
- package/dist/src/shared/utils/qr.js +74 -0
- package/dist/src/shared/utils/qr.js.map +1 -0
- package/dist/src/tui/adapters/whatsapp-adapter.d.ts.map +1 -1
- package/dist/src/tui/adapters/whatsapp-adapter.js +20 -15
- package/dist/src/tui/adapters/whatsapp-adapter.js.map +1 -1
- package/docs/content/docs/agent-skills.mdx +4 -4
- package/docs/content/docs/cli/channeltalk.mdx +12 -1
- package/docs/content/docs/cli/channeltalkbot.mdx +10 -1
- package/docs/content/docs/cli/discord.mdx +11 -1
- package/docs/content/docs/cli/discordbot.mdx +10 -1
- package/docs/content/docs/cli/instagram.mdx +12 -1
- package/docs/content/docs/cli/kakaotalk.mdx +25 -1
- package/docs/content/docs/cli/line.mdx +5 -5
- package/docs/content/docs/cli/meta.json +1 -0
- package/docs/content/docs/cli/slack.mdx +11 -1
- package/docs/content/docs/cli/slackbot.mdx +10 -1
- package/docs/content/docs/cli/teams.mdx +11 -1
- package/docs/content/docs/cli/telegram.mdx +11 -0
- package/docs/content/docs/cli/webex.mdx +11 -1
- package/docs/content/docs/cli/wechatbot.mdx +188 -0
- package/docs/content/docs/cli/whatsapp.mdx +37 -8
- package/docs/content/docs/cli/whatsappbot.mdx +10 -1
- package/docs/content/docs/sdk/meta.json +1 -1
- package/docs/content/docs/sdk/wechatbot.mdx +282 -0
- package/docs/content/docs/tui.mdx +1 -1
- package/docs/src/app/page.tsx +5 -5
- package/package.json +11 -3
- package/skills/agent-channeltalk/SKILL.md +12 -1
- package/skills/agent-channeltalkbot/SKILL.md +10 -1
- package/skills/agent-discord/SKILL.md +11 -1
- package/skills/agent-discordbot/SKILL.md +10 -1
- package/skills/agent-instagram/SKILL.md +12 -1
- package/skills/agent-kakaotalk/SKILL.md +30 -1
- package/skills/agent-kakaotalk/references/common-patterns.md +1 -1
- package/skills/agent-line/SKILL.md +11 -15
- package/skills/agent-line/references/authentication.md +13 -4
- package/skills/agent-slack/SKILL.md +11 -1
- package/skills/agent-slackbot/SKILL.md +10 -1
- package/skills/agent-teams/SKILL.md +11 -1
- package/skills/agent-telegram/SKILL.md +6 -1
- package/skills/agent-webex/SKILL.md +11 -1
- package/skills/agent-wechatbot/SKILL.md +394 -0
- package/skills/agent-whatsapp/SKILL.md +63 -15
- package/skills/agent-whatsapp/references/authentication.md +36 -6
- package/skills/agent-whatsappbot/SKILL.md +10 -1
- package/src/platforms/channeltalk/cli.ts +2 -0
- package/src/platforms/channeltalk/commands/index.ts +1 -0
- package/src/platforms/channeltalk/commands/whoami.test.ts +64 -0
- package/src/platforms/channeltalk/commands/whoami.ts +62 -0
- package/src/platforms/channeltalkbot/cli.ts +2 -0
- package/src/platforms/channeltalkbot/commands/index.ts +1 -0
- package/src/platforms/channeltalkbot/commands/whoami.test.ts +104 -0
- package/src/platforms/channeltalkbot/commands/whoami.ts +42 -0
- package/src/platforms/discord/cli.ts +2 -0
- package/src/platforms/discord/commands/index.ts +1 -0
- package/src/platforms/discord/commands/whoami.test.ts +91 -0
- package/src/platforms/discord/commands/whoami.ts +36 -0
- package/src/platforms/discord/credential-manager.test.ts +18 -1
- package/src/platforms/discordbot/cli.ts +2 -0
- package/src/platforms/discordbot/client.ts +2 -2
- package/src/platforms/discordbot/commands/index.ts +1 -0
- package/src/platforms/discordbot/commands/whoami.test.ts +96 -0
- package/src/platforms/discordbot/commands/whoami.ts +44 -0
- package/src/platforms/instagram/cli.ts +2 -1
- package/src/platforms/instagram/client.ts +13 -0
- package/src/platforms/instagram/commands/auth.test.ts +216 -0
- package/src/platforms/instagram/commands/chat.test.ts +123 -0
- package/src/platforms/instagram/commands/index.ts +1 -0
- package/src/platforms/instagram/commands/message.test.ts +174 -0
- package/src/platforms/instagram/commands/whoami.test.ts +60 -0
- package/src/platforms/instagram/commands/whoami.ts +21 -0
- package/src/platforms/kakaotalk/cli.ts +2 -1
- package/src/platforms/kakaotalk/client.test.ts +182 -14
- package/src/platforms/kakaotalk/client.ts +261 -27
- package/src/platforms/kakaotalk/commands/auth.test.ts +299 -0
- package/src/platforms/kakaotalk/commands/chat.test.ts +97 -0
- package/src/platforms/kakaotalk/commands/index.ts +1 -0
- package/src/platforms/kakaotalk/commands/message.test.ts +113 -0
- package/src/platforms/kakaotalk/commands/whoami.test.ts +116 -0
- package/src/platforms/kakaotalk/commands/whoami.ts +21 -0
- package/src/platforms/kakaotalk/index.test.ts +5 -0
- package/src/platforms/kakaotalk/index.ts +2 -0
- package/src/platforms/kakaotalk/protocol/session.ts +29 -7
- package/src/platforms/kakaotalk/protocol/types.ts +9 -0
- package/src/platforms/kakaotalk/types.ts +30 -0
- package/src/platforms/line/cli.ts +2 -2
- package/src/platforms/line/client.ts +14 -39
- package/src/platforms/line/commands/auth.test.ts +141 -0
- package/src/platforms/line/commands/auth.ts +37 -61
- package/src/platforms/line/commands/chat.test.ts +110 -0
- package/src/platforms/line/commands/friend.test.ts +98 -0
- package/src/platforms/line/commands/index.ts +1 -1
- package/src/platforms/line/commands/message.test.ts +119 -0
- package/src/platforms/line/commands/whoami.test.ts +85 -0
- package/src/platforms/line/commands/{profile.ts → whoami.ts} +4 -4
- package/src/platforms/slack/cli.ts +2 -0
- package/src/platforms/slack/commands/index.ts +1 -0
- package/src/platforms/slack/commands/whoami.test.ts +126 -0
- package/src/platforms/slack/commands/whoami.ts +40 -0
- package/src/platforms/slackbot/cli.ts +2 -1
- package/src/platforms/slackbot/commands/channel.test.ts +139 -0
- package/src/platforms/slackbot/commands/index.ts +1 -0
- package/src/platforms/slackbot/commands/message.test.ts +226 -0
- package/src/platforms/slackbot/commands/reaction.test.ts +90 -0
- package/src/platforms/slackbot/commands/user.test.ts +143 -0
- package/src/platforms/slackbot/commands/whoami.test.ts +102 -0
- package/src/platforms/slackbot/commands/whoami.ts +44 -0
- package/src/platforms/teams/cli.ts +2 -0
- package/src/platforms/teams/commands/index.ts +1 -0
- package/src/platforms/teams/commands/reaction.test.ts +45 -61
- package/src/platforms/teams/commands/reaction.ts +2 -0
- package/src/platforms/teams/commands/whoami.test.ts +83 -0
- package/src/platforms/teams/commands/whoami.ts +33 -0
- package/src/platforms/telegram/cli.ts +2 -1
- package/src/platforms/telegram/commands/chat.test.ts +125 -0
- package/src/platforms/telegram/commands/index.ts +1 -0
- package/src/platforms/telegram/commands/message.test.ts +92 -0
- package/src/platforms/telegram/commands/whoami.test.ts +75 -0
- package/src/platforms/telegram/commands/whoami.ts +29 -0
- package/src/platforms/webex/cli.ts +2 -1
- package/src/platforms/webex/commands/auth.test.ts +58 -46
- package/src/platforms/webex/commands/index.ts +1 -0
- package/src/platforms/webex/commands/member.test.ts +60 -57
- package/src/platforms/webex/commands/message.test.ts +74 -121
- package/src/platforms/webex/commands/message.ts +1 -1
- package/src/platforms/webex/commands/snapshot.test.ts +54 -45
- package/src/platforms/webex/commands/space.test.ts +46 -49
- package/src/platforms/webex/commands/whoami.test.ts +113 -0
- package/src/platforms/webex/commands/whoami.ts +31 -0
- package/src/platforms/webex/credential-manager.test.ts +0 -1
- package/src/platforms/wechatbot/cli.ts +25 -0
- package/src/platforms/wechatbot/client.test.ts +497 -0
- package/src/platforms/wechatbot/client.ts +268 -0
- package/src/platforms/wechatbot/commands/auth.test.ts +211 -0
- package/src/platforms/wechatbot/commands/auth.ts +203 -0
- package/src/platforms/wechatbot/commands/index.ts +5 -0
- package/src/platforms/wechatbot/commands/message.test.ts +155 -0
- package/src/platforms/wechatbot/commands/message.ts +104 -0
- package/src/platforms/wechatbot/commands/shared.ts +22 -0
- package/src/platforms/wechatbot/commands/template.test.ts +199 -0
- package/src/platforms/wechatbot/commands/template.ts +102 -0
- package/src/platforms/wechatbot/commands/user.test.ts +165 -0
- package/src/platforms/wechatbot/commands/user.ts +75 -0
- package/src/platforms/wechatbot/commands/whoami.test.ts +109 -0
- package/src/platforms/wechatbot/commands/whoami.ts +43 -0
- package/src/platforms/wechatbot/credential-manager.test.ts +255 -0
- package/src/platforms/wechatbot/credential-manager.ts +148 -0
- package/src/platforms/wechatbot/index.test.ts +49 -0
- package/src/platforms/wechatbot/index.ts +19 -0
- package/src/platforms/wechatbot/types.test.ts +223 -0
- package/src/platforms/wechatbot/types.ts +107 -0
- package/src/platforms/whatsapp/cli.ts +2 -1
- package/src/platforms/whatsapp/client.ts +180 -37
- package/src/platforms/whatsapp/commands/auth.test.ts +311 -0
- package/src/platforms/whatsapp/commands/auth.ts +194 -84
- package/src/platforms/whatsapp/commands/chat.test.ts +198 -0
- package/src/platforms/whatsapp/commands/index.ts +1 -0
- package/src/platforms/whatsapp/commands/message.test.ts +231 -0
- package/src/platforms/whatsapp/commands/shared.ts +2 -2
- package/src/platforms/whatsapp/commands/whoami.test.ts +59 -0
- package/src/platforms/whatsapp/commands/whoami.ts +21 -0
- package/src/platforms/whatsapp/credential-manager.test.ts +20 -0
- package/src/platforms/whatsapp/credential-manager.ts +17 -8
- package/src/platforms/whatsapp/ensure-auth.ts +2 -2
- package/src/platforms/whatsappbot/cli.ts +2 -1
- package/src/platforms/whatsappbot/commands/auth.test.ts +217 -0
- package/src/platforms/whatsappbot/commands/index.ts +1 -0
- package/src/platforms/whatsappbot/commands/message.test.ts +198 -0
- package/src/platforms/whatsappbot/commands/template.test.ts +112 -0
- package/src/platforms/whatsappbot/commands/whoami.test.ts +100 -0
- package/src/platforms/whatsappbot/commands/whoami.ts +57 -0
- package/src/shared/utils/qr.ts +92 -0
- package/src/tui/adapters/whatsapp-adapter.ts +19 -16
- package/dist/src/platforms/line/commands/profile.d.ts +0 -3
- package/dist/src/platforms/line/commands/profile.d.ts.map +0 -1
- 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.
|
|
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
|
|
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
|
|
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,
|
|
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
|
-
|
|
80
|
+
**Alternative: Pairing code login**
|
|
66
81
|
|
|
67
|
-
|
|
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
|
-
# -> {"
|
|
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
|
|
89
|
+
Tell the user the pairing code and ask them to enter it on their phone.
|
|
75
90
|
|
|
76
|
-
**Step
|
|
91
|
+
**Step 3: Wait for confirmation**
|
|
77
92
|
|
|
78
|
-
The CLI
|
|
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
|
|
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 --
|
|
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 --
|
|
429
|
+
agent-whatsapp auth login --qr
|
|
382
430
|
```
|
|
@@ -2,7 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
agent-whatsapp uses
|
|
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
|
|
14
|
-
4. The CLI
|
|
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
|
|
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
|
|
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 --
|
|
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.
|
|
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'
|