agent-messenger 2.4.0 → 2.6.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/plugin.json +1 -1
- package/.github/workflows/ci.yml +35 -0
- package/.github/workflows/release.yml +0 -12
- package/README.md +3 -3
- package/bun.lock +10 -2
- package/dist/package.json +3 -1
- 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/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.js +2 -2
- package/dist/src/platforms/kakaotalk/cli.js.map +1 -1
- package/dist/src/platforms/kakaotalk/client.d.ts +4 -1
- package/dist/src/platforms/kakaotalk/client.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/client.js +193 -27
- package/dist/src/platforms/kakaotalk/client.js.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/auth.js +24 -55
- package/dist/src/platforms/kakaotalk/commands/auth.js.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/index.d.ts +1 -1
- package/dist/src/platforms/kakaotalk/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/index.js +1 -1
- 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/{profile.js → whoami.js} +5 -5
- package/dist/src/platforms/kakaotalk/commands/whoami.js.map +1 -0
- package/dist/src/platforms/kakaotalk/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/credential-manager.js +1 -0
- package/dist/src/platforms/kakaotalk/credential-manager.js.map +1 -1
- package/dist/src/platforms/kakaotalk/index.d.ts +1 -1
- package/dist/src/platforms/kakaotalk/index.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/index.js.map +1 -1
- package/dist/src/platforms/kakaotalk/listener.js +2 -2
- package/dist/src/platforms/kakaotalk/listener.js.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/config.d.ts +8 -2
- package/dist/src/platforms/kakaotalk/protocol/config.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/config.js +15 -2
- package/dist/src/platforms/kakaotalk/protocol/config.js.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/session.d.ts +6 -2
- package/dist/src/platforms/kakaotalk/protocol/session.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/session.js +37 -15
- 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 +22 -0
- package/dist/src/platforms/kakaotalk/types.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/types.js +7 -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/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/line/commands/auth.js +9 -59
- 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/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.map +1 -1
- package/dist/src/platforms/wechatbot/cli.js +2 -1
- package/dist/src/platforms/wechatbot/cli.js.map +1 -1
- package/dist/src/platforms/wechatbot/commands/index.d.ts +1 -0
- package/dist/src/platforms/wechatbot/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/wechatbot/commands/index.js +1 -0
- package/dist/src/platforms/wechatbot/commands/index.js.map +1 -1
- 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/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 +8 -0
- package/dist/src/platforms/whatsapp/client.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/client.js +116 -8
- 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 +115 -45
- 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/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/kakaotalk-adapter.d.ts.map +1 -1
- package/dist/src/tui/adapters/kakaotalk-adapter.js +5 -2
- package/dist/src/tui/adapters/kakaotalk-adapter.js.map +1 -1
- 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/cli/channeltalk.mdx +11 -0
- package/docs/content/docs/cli/channeltalkbot.mdx +9 -0
- package/docs/content/docs/cli/discord.mdx +10 -0
- package/docs/content/docs/cli/discordbot.mdx +9 -0
- package/docs/content/docs/cli/instagram.mdx +11 -0
- package/docs/content/docs/cli/kakaotalk.mdx +27 -39
- package/docs/content/docs/cli/line.mdx +4 -4
- package/docs/content/docs/cli/slack.mdx +10 -0
- package/docs/content/docs/cli/slackbot.mdx +9 -0
- package/docs/content/docs/cli/teams.mdx +10 -0
- package/docs/content/docs/cli/telegram.mdx +11 -0
- package/docs/content/docs/cli/webex.mdx +10 -0
- package/docs/content/docs/cli/wechatbot.mdx +9 -0
- package/docs/content/docs/cli/whatsapp.mdx +36 -7
- package/docs/content/docs/cli/whatsappbot.mdx +9 -0
- package/e2e/config.ts +1 -1
- package/package.json +3 -1
- 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 +24 -70
- package/skills/agent-kakaotalk/references/authentication.md +4 -69
- package/skills/agent-kakaotalk/references/common-patterns.md +14 -1
- package/skills/agent-line/SKILL.md +5 -5
- 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 +10 -1
- package/skills/agent-whatsapp/SKILL.md +52 -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/discordbot/cli.ts +2 -0
- 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/chat.test.ts +1 -5
- package/src/platforms/instagram/commands/index.ts +1 -0
- package/src/platforms/instagram/commands/message.test.ts +1 -5
- 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 -2
- package/src/platforms/kakaotalk/client.test.ts +25 -14
- package/src/platforms/kakaotalk/client.ts +228 -33
- package/src/platforms/kakaotalk/commands/auth.ts +22 -73
- package/src/platforms/kakaotalk/commands/index.ts +1 -1
- package/src/platforms/kakaotalk/commands/{profile.test.ts → whoami.test.ts} +37 -5
- package/src/platforms/kakaotalk/commands/{profile.ts → whoami.ts} +4 -4
- package/src/platforms/kakaotalk/credential-manager.ts +1 -0
- package/src/platforms/kakaotalk/index.ts +1 -0
- package/src/platforms/kakaotalk/listener.test.ts +2 -2
- package/src/platforms/kakaotalk/listener.ts +2 -2
- package/src/platforms/kakaotalk/protocol/config.ts +26 -2
- package/src/platforms/kakaotalk/protocol/session.ts +42 -16
- package/src/platforms/kakaotalk/protocol/types.ts +9 -0
- package/src/platforms/kakaotalk/types.ts +16 -0
- package/src/platforms/line/cli.ts +2 -2
- package/src/platforms/line/commands/auth.ts +37 -70
- package/src/platforms/line/commands/index.ts +1 -1
- package/src/platforms/line/commands/{profile.test.ts → whoami.test.ts} +11 -11
- 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/index.ts +1 -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/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/index.ts +1 -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 +1 -5
- package/src/platforms/webex/commands/message.test.ts +1 -5
- package/src/platforms/webex/commands/message.ts +1 -1
- package/src/platforms/webex/commands/snapshot.test.ts +1 -5
- package/src/platforms/webex/commands/space.test.ts +1 -5
- 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 +2 -1
- package/src/platforms/wechatbot/commands/index.ts +1 -0
- package/src/platforms/wechatbot/commands/whoami.test.ts +109 -0
- package/src/platforms/wechatbot/commands/whoami.ts +43 -0
- package/src/platforms/whatsapp/cli.ts +2 -1
- package/src/platforms/whatsapp/client.ts +156 -24
- package/src/platforms/whatsapp/commands/auth.ts +176 -70
- package/src/platforms/whatsapp/commands/index.ts +1 -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/ensure-auth.ts +2 -2
- package/src/platforms/whatsappbot/cli.ts +2 -1
- package/src/platforms/whatsappbot/commands/index.ts +1 -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/kakaotalk-adapter.ts +5 -2
- package/src/tui/adapters/whatsapp-adapter.ts +19 -16
- package/dist/src/platforms/kakaotalk/commands/profile.d.ts +0 -3
- package/dist/src/platforms/kakaotalk/commands/profile.d.ts.map +0 -1
- package/dist/src/platforms/kakaotalk/commands/profile.js.map +0 -1
- 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,74 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import { writeFileSync, unlinkSync } from 'node:fs';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import QRCode from 'qrcode';
|
|
6
|
+
import { info } from './stderr.js';
|
|
7
|
+
export async function createQRHtmlFile(url, options) {
|
|
8
|
+
try {
|
|
9
|
+
const svgString = await QRCode.toString(url, { type: 'svg', margin: 2 });
|
|
10
|
+
const html = `<!DOCTYPE html>
|
|
11
|
+
<html><head><meta charset="utf-8"><title>${options.platform} QR Login</title>
|
|
12
|
+
<style>body{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;margin:0;font-family:-apple-system,system-ui,sans-serif;background:${options.brandColor}}
|
|
13
|
+
.card{background:#fff;border-radius:16px;padding:40px;text-align:center;box-shadow:0 4px 24px rgba(0,0,0,.15)}
|
|
14
|
+
h1{margin:0 0 8px;font-size:22px;color:#111}p{margin:0 0 24px;color:#666;font-size:14px}
|
|
15
|
+
svg{width:280px;height:280px}</style></head>
|
|
16
|
+
<body><div class="card"><h1>${options.platform} Login</h1><p>${options.scanInstruction}</p>${svgString}</div></body></html>`;
|
|
17
|
+
const htmlPath = join(tmpdir(), `${options.platform.toLowerCase()}-qr-${Date.now()}.html`);
|
|
18
|
+
writeFileSync(htmlPath, html);
|
|
19
|
+
setTimeout(() => {
|
|
20
|
+
try {
|
|
21
|
+
unlinkSync(htmlPath);
|
|
22
|
+
}
|
|
23
|
+
catch { }
|
|
24
|
+
}, 300_000).unref();
|
|
25
|
+
return htmlPath;
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export function openInBrowser(filePath) {
|
|
32
|
+
try {
|
|
33
|
+
if (process.platform === 'darwin') {
|
|
34
|
+
execSync(`open "${filePath}"`, { stdio: 'ignore' });
|
|
35
|
+
}
|
|
36
|
+
else if (process.platform === 'win32') {
|
|
37
|
+
execSync(`start "" "${filePath}"`, { stdio: 'ignore' });
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
execSync(`xdg-open "${filePath}"`, { stdio: 'ignore' });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch { }
|
|
44
|
+
}
|
|
45
|
+
export async function renderTerminalQR(data) {
|
|
46
|
+
return QRCode.toString(data, { type: 'terminal', small: true });
|
|
47
|
+
}
|
|
48
|
+
export async function displayQR(data, options) {
|
|
49
|
+
const shouldOpenBrowser = options.openBrowser ?? options.interactive;
|
|
50
|
+
const htmlPath = await createQRHtmlFile(data, options);
|
|
51
|
+
if (htmlPath && shouldOpenBrowser)
|
|
52
|
+
openInBrowser(htmlPath);
|
|
53
|
+
if (options.interactive) {
|
|
54
|
+
try {
|
|
55
|
+
const qrAscii = await renderTerminalQR(data);
|
|
56
|
+
info(`\n${options.scanInstruction}:\n`);
|
|
57
|
+
info(qrAscii);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
info(`\nOpen the QR code in the browser window, or scan this URL:\n${data}\n`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
console.log(options.formatOutput({
|
|
65
|
+
next_action: 'scan_qr',
|
|
66
|
+
qr_url: data,
|
|
67
|
+
qr_html_path: htmlPath,
|
|
68
|
+
message: htmlPath
|
|
69
|
+
? `QR code opened in browser. ${options.scanInstruction}`
|
|
70
|
+
: `QR code generated. Open qr_url to scan.`,
|
|
71
|
+
}, options.pretty));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=qr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qr.js","sourceRoot":"","sources":["../../../../src/shared/utils/qr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAQ/B,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,GAAW,EAAE,OAAyB;IAC3E,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAA;QACxE,MAAM,IAAI,GAAG;2CAC0B,OAAO,CAAC,QAAQ;+KACo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rE,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK3D,aAAa,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IAQrC,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWvD,mBAAmB,IAAI,SAAS,GAAG,IAAI;IAIvC,WAAW,IAAI,QAAQ;IAOjB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA6E7C,OAAO,CAAC,YAAY;CAMrB"}
|
|
@@ -53,7 +53,7 @@ export class KakaoTalkAdapter {
|
|
|
53
53
|
if (!creds)
|
|
54
54
|
throw new Error(`Account ${accountId} not found`);
|
|
55
55
|
const client = new KakaoTalkClient();
|
|
56
|
-
await client.login({ oauthToken: creds.oauth_token, userId: creds.user_id, deviceUuid: creds.device_uuid });
|
|
56
|
+
await client.login({ oauthToken: creds.oauth_token, userId: creds.user_id, deviceUuid: creds.device_uuid, deviceType: creds.device_type });
|
|
57
57
|
this.client = client;
|
|
58
58
|
this.currentAccount = { id: creds.account_id, name: creds.account_id };
|
|
59
59
|
}
|
|
@@ -71,7 +71,8 @@ export class KakaoTalkAdapter {
|
|
|
71
71
|
const { KakaoTokenExtractor } = await import('../../platforms/kakaotalk/token-extractor.js');
|
|
72
72
|
const existing = await this.credManager.getAccount();
|
|
73
73
|
const pendingState = await this.credManager.loadPendingLogin();
|
|
74
|
-
const
|
|
74
|
+
const existingUuid = existing?.auth_method === 'login' ? existing?.device_uuid : undefined;
|
|
75
|
+
const savedDeviceUuid = pendingState?.device_uuid ?? existingUuid ?? generateDeviceUuid();
|
|
75
76
|
let email;
|
|
76
77
|
let password;
|
|
77
78
|
io.print('Checking for cached credentials...');
|
|
@@ -123,6 +124,7 @@ export class KakaoTalkAdapter {
|
|
|
123
124
|
refresh_token: result.credentials.refresh_token,
|
|
124
125
|
device_uuid: result.credentials.device_uuid,
|
|
125
126
|
device_type: result.credentials.device_type,
|
|
127
|
+
auth_method: 'login',
|
|
126
128
|
created_at: now,
|
|
127
129
|
updated_at: now,
|
|
128
130
|
});
|
|
@@ -132,6 +134,7 @@ export class KakaoTalkAdapter {
|
|
|
132
134
|
oauthToken: result.credentials.access_token,
|
|
133
135
|
userId: result.credentials.user_id,
|
|
134
136
|
deviceUuid: result.credentials.device_uuid,
|
|
137
|
+
deviceType: result.credentials.device_type,
|
|
135
138
|
});
|
|
136
139
|
this.client = client;
|
|
137
140
|
this.currentAccount = { id: result.credentials.user_id, name: email };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kakaotalk-adapter.js","sourceRoot":"","sources":["../../../../src/tui/adapters/kakaotalk-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAA;AAIjF,MAAM,OAAO,gBAAgB;IAClB,IAAI,GAAG,WAAW,CAAA;IAEnB,MAAM,GAA2B,IAAI,CAAA;IACrC,WAAW,GAAG,IAAI,sBAAsB,EAAE,CAAA;IAC1C,cAAc,GAAqB,IAAI,CAAA;IAE/C,KAAK,CAAC,KAAK;QACT,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAA;QAClC,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAA;QACpC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,cAAc,EAAE,KAAK,EAAE,CAAA;QAEvB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAA;QAC5C,IAAI,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC;YACtE,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,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CAAA;IACvE,CAAC;IAEO,YAAY;QAClB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;QACvD,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whatsapp-adapter.d.ts","sourceRoot":"","sources":["../../../../src/tui/adapters/whatsapp-adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"whatsapp-adapter.d.ts","sourceRoot":"","sources":["../../../../src/tui/adapters/whatsapp-adapter.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAE3G,qBAAa,eAAgB,YAAW,eAAe;IACrD,QAAQ,CAAC,IAAI,cAAa;IAE1B,OAAO,CAAC,MAAM,CAA8B;IAC5C,OAAO,CAAC,WAAW,CAAkC;IACrD,OAAO,CAAC,cAAc,CAAyB;IAEzC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAatB,WAAW,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IASxC,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAYrE,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK3D,aAAa,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IAQrC,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBvD,mBAAmB,IAAI,SAAS,GAAG,IAAI;IAIvC,WAAW,IAAI,QAAQ;IAOjB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA8C7C,OAAO,CAAC,YAAY;CAMrB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { WhatsAppClient } from '../../platforms/whatsapp/client.js';
|
|
2
2
|
import { WhatsAppCredentialManager } from '../../platforms/whatsapp/credential-manager.js';
|
|
3
|
+
import { renderTerminalQR } from '../../shared/utils/qr.js';
|
|
3
4
|
export class WhatsAppAdapter {
|
|
4
5
|
name = 'WhatsApp';
|
|
5
6
|
client = null;
|
|
@@ -66,32 +67,37 @@ export class WhatsAppAdapter {
|
|
|
66
67
|
}
|
|
67
68
|
getAuthHint() {
|
|
68
69
|
return {
|
|
69
|
-
command: 'agent-whatsapp auth login',
|
|
70
|
-
description: 'Run the command below and
|
|
70
|
+
command: 'agent-whatsapp auth login --qr',
|
|
71
|
+
description: 'Run the command below and scan the QR code with WhatsApp on your phone.',
|
|
71
72
|
};
|
|
72
73
|
}
|
|
73
74
|
async authenticate(io) {
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const accountId = createAccountId(phone);
|
|
75
|
+
io.print('Generating QR code...');
|
|
76
|
+
const accountId = 'qr-default';
|
|
77
|
+
const existingPaths = this.credManager.getAccountPaths(accountId);
|
|
78
|
+
const { rm } = await import('node:fs/promises');
|
|
79
|
+
await rm(existingPaths.auth_dir, { recursive: true, force: true });
|
|
80
80
|
const paths = await this.credManager.ensureAccountPaths(accountId);
|
|
81
81
|
const client = await new WhatsAppClient().login({ authDir: paths.auth_dir });
|
|
82
82
|
let waitForAuth;
|
|
83
83
|
try {
|
|
84
|
-
const result = await client.
|
|
84
|
+
const result = await client.connectForQR(async (qr) => {
|
|
85
|
+
io.print('Scan this QR code with WhatsApp on your phone:');
|
|
86
|
+
try {
|
|
87
|
+
const rendered = await renderTerminalQR(qr);
|
|
88
|
+
io.print(rendered);
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
io.print(qr);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
85
94
|
waitForAuth = result.waitForAuth;
|
|
86
|
-
const formatted = result.code.length === 8 ? `${result.code.slice(0, 4)}-${result.code.slice(4)}` : result.code;
|
|
87
|
-
io.print(`Pairing code: ${formatted}`);
|
|
88
|
-
io.print('Enter this code in WhatsApp > Linked Devices > Link with phone number');
|
|
89
95
|
}
|
|
90
96
|
catch (err) {
|
|
91
97
|
await client.close();
|
|
92
98
|
throw err;
|
|
93
99
|
}
|
|
94
|
-
io.print('Waiting for
|
|
100
|
+
io.print('Waiting for QR code scan...');
|
|
95
101
|
try {
|
|
96
102
|
await waitForAuth();
|
|
97
103
|
}
|
|
@@ -102,13 +108,12 @@ export class WhatsAppAdapter {
|
|
|
102
108
|
const now = new Date().toISOString();
|
|
103
109
|
await this.credManager.setAccount({
|
|
104
110
|
account_id: accountId,
|
|
105
|
-
phone_number: phone,
|
|
106
111
|
created_at: now,
|
|
107
112
|
updated_at: now,
|
|
108
113
|
});
|
|
109
114
|
await this.credManager.setCurrent(accountId);
|
|
110
115
|
this.client = client;
|
|
111
|
-
this.currentAccount = { id: accountId, name:
|
|
116
|
+
this.currentAccount = { id: accountId, name: accountId };
|
|
112
117
|
}
|
|
113
118
|
ensureClient() {
|
|
114
119
|
if (!this.client) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whatsapp-adapter.js","sourceRoot":"","sources":["../../../../src/tui/adapters/whatsapp-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAA;
|
|
1
|
+
{"version":3,"file":"whatsapp-adapter.js","sourceRoot":"","sources":["../../../../src/tui/adapters/whatsapp-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAA;AACnF,OAAO,EAAE,gBAAgB,EAAE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5C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,cAAc,GAAG,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAA;IAC1D,CAAC;IAEO,YAAY;QAClB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;QACvD,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;CACF"}
|
|
@@ -97,6 +97,17 @@ agent-channeltalk auth remove <workspace-id>
|
|
|
97
97
|
|
|
98
98
|
## Commands
|
|
99
99
|
|
|
100
|
+
### Whoami Command
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Show current authenticated user
|
|
104
|
+
agent-channeltalk whoami
|
|
105
|
+
agent-channeltalk whoami --pretty
|
|
106
|
+
agent-channeltalk whoami --workspace <workspace-id>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Output includes the authenticated user's identity information.
|
|
110
|
+
|
|
100
111
|
### Message Commands
|
|
101
112
|
|
|
102
113
|
```bash
|
|
@@ -108,6 +108,15 @@ agent-channeltalkbot auth bot <name>
|
|
|
108
108
|
|
|
109
109
|
## Commands
|
|
110
110
|
|
|
111
|
+
### Whoami Command
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# Show current authenticated bot
|
|
115
|
+
agent-channeltalkbot whoami
|
|
116
|
+
agent-channeltalkbot whoami --pretty
|
|
117
|
+
agent-channeltalkbot whoami --workspace <workspace-id>
|
|
118
|
+
```
|
|
119
|
+
|
|
111
120
|
### Message Commands
|
|
112
121
|
|
|
113
122
|
```bash
|
|
@@ -69,6 +69,16 @@ agent-discord server info <server-id>
|
|
|
69
69
|
|
|
70
70
|
## Commands
|
|
71
71
|
|
|
72
|
+
### Whoami Command
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Show current authenticated user
|
|
76
|
+
agent-discord whoami
|
|
77
|
+
agent-discord whoami --pretty
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Output includes the authenticated user's identity information.
|
|
81
|
+
|
|
72
82
|
### Message Commands
|
|
73
83
|
|
|
74
84
|
```bash
|
|
@@ -124,6 +124,15 @@ export E2E_DISCORDBOT_SERVER_NAME="My Server"
|
|
|
124
124
|
|
|
125
125
|
## Commands
|
|
126
126
|
|
|
127
|
+
### Whoami Command
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Show current authenticated bot
|
|
131
|
+
agent-discordbot whoami
|
|
132
|
+
agent-discordbot whoami --pretty
|
|
133
|
+
agent-discordbot whoami --bot <bot-id>
|
|
134
|
+
```
|
|
135
|
+
|
|
127
136
|
### Server Commands
|
|
128
137
|
|
|
129
138
|
```bash
|
|
@@ -113,6 +113,17 @@ agent-instagram auth logout --account <id>
|
|
|
113
113
|
|
|
114
114
|
## Commands
|
|
115
115
|
|
|
116
|
+
### Whoami Command
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# Show current authenticated user
|
|
120
|
+
agent-instagram whoami
|
|
121
|
+
agent-instagram whoami --pretty
|
|
122
|
+
agent-instagram whoami --account <account-id>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Output includes the authenticated user's identity information.
|
|
126
|
+
|
|
116
127
|
### Chat Commands
|
|
117
128
|
|
|
118
129
|
```bash
|
|
@@ -36,9 +36,9 @@ agent-kakaotalk message list <chat-id>
|
|
|
36
36
|
|
|
37
37
|
## Authentication
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
The CLI authenticates by registering as a sub-device (tablet slot by default). Your desktop app keeps running.
|
|
40
40
|
|
|
41
|
-
###
|
|
41
|
+
### Login
|
|
42
42
|
|
|
43
43
|
Registers the CLI as a sub-device using the **tablet** slot by default. Your desktop app keeps running.
|
|
44
44
|
|
|
@@ -57,15 +57,6 @@ On first login, KakaoTalk requires device verification:
|
|
|
57
57
|
3. Enter the code on your phone when prompted
|
|
58
58
|
4. The CLI polls until you confirm — login completes automatically
|
|
59
59
|
|
|
60
|
-
### Method 2: Extract from Desktop App
|
|
61
|
-
|
|
62
|
-
Extracts OAuth tokens directly from the KakaoTalk desktop app's cache. This **kicks the desktop session** because it reuses the desktop's credentials.
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
agent-kakaotalk auth extract
|
|
66
|
-
agent-kakaotalk auth extract --debug
|
|
67
|
-
```
|
|
68
|
-
|
|
69
60
|
### Device Slots
|
|
70
61
|
|
|
71
62
|
KakaoTalk allows these simultaneous sessions:
|
|
@@ -105,7 +96,7 @@ agent-kakaotalk auth logout --account <account-id>
|
|
|
105
96
|
|
|
106
97
|
## Multi-Account
|
|
107
98
|
|
|
108
|
-
KakaoTalk supports multiple accounts. Each login
|
|
99
|
+
KakaoTalk supports multiple accounts. Each login stores credentials separately, keyed by user ID.
|
|
109
100
|
|
|
110
101
|
```bash
|
|
111
102
|
# List all stored accounts
|
|
@@ -192,6 +183,30 @@ agent-kakaotalk message list 9876543210 -n 200
|
|
|
192
183
|
agent-kakaotalk message list 9876543210 --from 123456789
|
|
193
184
|
```
|
|
194
185
|
|
|
186
|
+
### Whoami Command
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
# Show current authenticated user
|
|
190
|
+
agent-kakaotalk whoami
|
|
191
|
+
agent-kakaotalk whoami --pretty
|
|
192
|
+
agent-kakaotalk whoami --account <account-id>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Output includes:
|
|
196
|
+
|
|
197
|
+
- `user_id` — your KakaoTalk user ID
|
|
198
|
+
- `nickname` — your display name
|
|
199
|
+
- `profile_image_url` — profile image thumbnail URL
|
|
200
|
+
- `original_profile_image_url` — original profile image URL
|
|
201
|
+
- `status_message` — your status message
|
|
202
|
+
- `account_display_id` — your KakaoTalk ID (may be null if not set)
|
|
203
|
+
- `background_image_url` — background image URL
|
|
204
|
+
- `original_background_image_url` — original background image URL
|
|
205
|
+
- `fullname` — real name (may be null)
|
|
206
|
+
- `account_email` — account email (may be null)
|
|
207
|
+
- `pstn_number` — phone number (may be null)
|
|
208
|
+
- `email_verified` — whether email is verified (may be null)
|
|
209
|
+
|
|
195
210
|
## Global Options
|
|
196
211
|
|
|
197
212
|
| Option | Description |
|
|
@@ -202,13 +217,8 @@ agent-kakaotalk message list 9876543210 --from 123456789
|
|
|
202
217
|
## Storage
|
|
203
218
|
|
|
204
219
|
- Credentials stored in `~/.config/agent-messenger/kakaotalk-credentials.json` (0600 permissions)
|
|
205
|
-
- macOS extraction reads from `~/Library/Containers/com.kakao.KakaoTalkMac/Data/Library/Caches/Cache.db`
|
|
206
|
-
- Windows extraction reads from the registry and `%LocalAppData%\Kakao\login_list.dat`
|
|
207
220
|
|
|
208
221
|
## Limitations
|
|
209
|
-
|
|
210
|
-
- `auth extract` requires macOS or Windows (reads from the KakaoTalk desktop app)
|
|
211
|
-
- `auth login` works on any platform (email + password, no desktop app needed)
|
|
212
222
|
- No file upload or download
|
|
213
223
|
- No channel/chat room creation or management
|
|
214
224
|
- No friend list management
|
|
@@ -236,14 +246,6 @@ npx -y --package agent-messenger agent-kakaotalk chat list --pretty
|
|
|
236
246
|
|
|
237
247
|
**NEVER run `npx agent-kakaotalk`** without `--package agent-messenger`. It will fail or install a wrong package.
|
|
238
248
|
|
|
239
|
-
### No credentials found
|
|
240
|
-
|
|
241
|
-
If `auth extract` fails:
|
|
242
|
-
|
|
243
|
-
1. Make sure the KakaoTalk desktop app is installed and you're logged in
|
|
244
|
-
2. Run `agent-kakaotalk auth extract --debug` for detailed diagnostics
|
|
245
|
-
3. If extraction still fails, use `agent-kakaotalk auth login` instead (recommended)
|
|
246
|
-
|
|
247
249
|
### Device slot occupied
|
|
248
250
|
|
|
249
251
|
If login fails because the tablet slot is occupied:
|
|
@@ -264,20 +266,6 @@ If the passcode expires before you confirm on your phone:
|
|
|
264
266
|
2. Confirm the code on your phone within the time limit
|
|
265
267
|
3. The CLI automatically completes login after confirmation
|
|
266
268
|
|
|
267
|
-
### Cache.db not found (macOS)
|
|
268
|
-
|
|
269
|
-
The CLI looks for KakaoTalk's cache at:
|
|
270
|
-
|
|
271
|
-
```
|
|
272
|
-
~/Library/Containers/com.kakao.KakaoTalkMac/Data/Library/Caches/Cache.db
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
If this file doesn't exist:
|
|
276
|
-
|
|
277
|
-
1. Install KakaoTalk from the Mac App Store
|
|
278
|
-
2. Log in and send at least one message (to populate the cache)
|
|
279
|
-
3. Run `agent-kakaotalk auth extract` again
|
|
280
|
-
|
|
281
269
|
## AI Agent Integration
|
|
282
270
|
|
|
283
271
|
See [`skills/agent-kakaotalk/`](https://github.com/agent-messenger/agent-messenger/tree/main/skills/agent-kakaotalk) for:
|
|
@@ -126,12 +126,12 @@ agent-line auth logout <account-id>
|
|
|
126
126
|
|
|
127
127
|
## Commands
|
|
128
128
|
|
|
129
|
-
###
|
|
129
|
+
### Whoami Command
|
|
130
130
|
|
|
131
131
|
```bash
|
|
132
|
-
#
|
|
133
|
-
agent-line
|
|
134
|
-
agent-line
|
|
132
|
+
# Show current authenticated user
|
|
133
|
+
agent-line whoami
|
|
134
|
+
agent-line whoami --pretty
|
|
135
135
|
```
|
|
136
136
|
|
|
137
137
|
Output includes:
|
|
@@ -65,6 +65,16 @@ agent-slack auth logout <workspace-id>
|
|
|
65
65
|
|
|
66
66
|
## Commands
|
|
67
67
|
|
|
68
|
+
### Whoami Command
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Show current authenticated user
|
|
72
|
+
agent-slack whoami
|
|
73
|
+
agent-slack whoami --pretty
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Output includes the authenticated user's identity information.
|
|
77
|
+
|
|
68
78
|
### Message Commands
|
|
69
79
|
|
|
70
80
|
```bash
|
|
@@ -131,6 +131,15 @@ export E2E_SLACKBOT_WORKSPACE_NAME="My Workspace"
|
|
|
131
131
|
|
|
132
132
|
## Commands
|
|
133
133
|
|
|
134
|
+
### Whoami Command
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Show current authenticated bot
|
|
138
|
+
agent-slackbot whoami
|
|
139
|
+
agent-slackbot whoami --pretty
|
|
140
|
+
agent-slackbot whoami --bot <bot-id>
|
|
141
|
+
```
|
|
142
|
+
|
|
134
143
|
### Message Commands
|
|
135
144
|
|
|
136
145
|
```bash
|
|
@@ -118,6 +118,16 @@ agent-teams team remove <team-id>
|
|
|
118
118
|
|
|
119
119
|
## Commands
|
|
120
120
|
|
|
121
|
+
### Whoami Command
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Show current authenticated user
|
|
125
|
+
agent-teams whoami
|
|
126
|
+
agent-teams whoami --pretty
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Output includes the authenticated user's identity information.
|
|
130
|
+
|
|
121
131
|
### Message Commands
|
|
122
132
|
|
|
123
133
|
```bash
|
|
@@ -70,6 +70,17 @@ agent-telegram auth remove <account-id>
|
|
|
70
70
|
|
|
71
71
|
## Commands
|
|
72
72
|
|
|
73
|
+
### Whoami Command
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Show current authenticated user
|
|
77
|
+
agent-telegram whoami
|
|
78
|
+
agent-telegram whoami --pretty
|
|
79
|
+
agent-telegram whoami --account <account-id>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Output includes the authenticated user's identity information.
|
|
83
|
+
|
|
73
84
|
### Chat Commands
|
|
74
85
|
|
|
75
86
|
```bash
|
|
@@ -110,6 +110,16 @@ Both must be set together. When set, `auth login` (without `--token`) uses these
|
|
|
110
110
|
|
|
111
111
|
## Commands
|
|
112
112
|
|
|
113
|
+
### Whoami Command
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Show current authenticated user
|
|
117
|
+
agent-webex whoami
|
|
118
|
+
agent-webex whoami --pretty
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Output includes the authenticated user's identity information.
|
|
122
|
+
|
|
113
123
|
### Space Commands
|
|
114
124
|
|
|
115
125
|
Webex organizes conversations into "spaces" (group spaces and direct messages).
|
|
@@ -75,6 +75,15 @@ agent-wechatbot auth remove <account-id>
|
|
|
75
75
|
|
|
76
76
|
## Commands
|
|
77
77
|
|
|
78
|
+
### Whoami Command
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Show current authenticated bot
|
|
82
|
+
agent-wechatbot whoami
|
|
83
|
+
agent-wechatbot whoami --pretty
|
|
84
|
+
agent-wechatbot whoami --account <account-id>
|
|
85
|
+
```
|
|
86
|
+
|
|
78
87
|
### Message Commands
|
|
79
88
|
|
|
80
89
|
```bash
|