agent-messenger 2.7.0 → 2.9.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 +6 -0
- package/.oxfmtrc.json +13 -1
- package/.oxlintrc.json +10 -1
- package/README.md +1 -12
- package/dist/package.json +59 -58
- package/dist/src/platforms/channeltalk/client.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/client.js +2 -2
- package/dist/src/platforms/channeltalk/client.js.map +1 -1
- package/dist/src/platforms/channeltalk/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/commands/auth.js.map +1 -1
- package/dist/src/platforms/channeltalk/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/commands/message.js.map +1 -1
- package/dist/src/platforms/channeltalk/commands/snapshot.d.ts +4 -2
- package/dist/src/platforms/channeltalk/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/commands/snapshot.js +86 -31
- package/dist/src/platforms/channeltalk/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/channeltalk/ensure-auth.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/ensure-auth.js.map +1 -1
- package/dist/src/platforms/channeltalk/token-extractor.d.ts +9 -23
- package/dist/src/platforms/channeltalk/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/token-extractor.js +109 -341
- package/dist/src/platforms/channeltalk/token-extractor.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/client.d.ts +1 -1
- package/dist/src/platforms/channeltalkbot/client.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/client.js +4 -4
- package/dist/src/platforms/channeltalkbot/client.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/auth.js +4 -1
- package/dist/src/platforms/channeltalkbot/commands/auth.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/shared.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/shared.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/snapshot.d.ts +3 -1
- package/dist/src/platforms/channeltalkbot/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/snapshot.js +110 -60
- package/dist/src/platforms/channeltalkbot/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/discord/commands/auth.js.map +1 -1
- package/dist/src/platforms/discord/commands/snapshot.d.ts +1 -0
- package/dist/src/platforms/discord/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/snapshot.js +48 -34
- package/dist/src/platforms/discord/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/discord/commands/whoami.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/whoami.js.map +1 -1
- package/dist/src/platforms/discord/token-extractor.d.ts +2 -10
- package/dist/src/platforms/discord/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/discord/token-extractor.js +38 -172
- package/dist/src/platforms/discord/token-extractor.js.map +1 -1
- package/dist/src/platforms/discordbot/client.d.ts.map +1 -1
- package/dist/src/platforms/discordbot/client.js.map +1 -1
- package/dist/src/platforms/discordbot/commands/snapshot.d.ts +2 -0
- package/dist/src/platforms/discordbot/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/discordbot/commands/snapshot.js +46 -34
- package/dist/src/platforms/discordbot/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/instagram/cli.d.ts.map +1 -1
- package/dist/src/platforms/instagram/cli.js +1 -4
- package/dist/src/platforms/instagram/cli.js.map +1 -1
- package/dist/src/platforms/instagram/client.d.ts.map +1 -1
- package/dist/src/platforms/instagram/client.js +8 -7
- package/dist/src/platforms/instagram/client.js.map +1 -1
- package/dist/src/platforms/instagram/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/instagram/commands/auth.js.map +1 -1
- package/dist/src/platforms/instagram/commands/chat.d.ts.map +1 -1
- package/dist/src/platforms/instagram/commands/chat.js.map +1 -1
- package/dist/src/platforms/instagram/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/instagram/commands/message.js.map +1 -1
- package/dist/src/platforms/instagram/commands/shared.d.ts.map +1 -1
- package/dist/src/platforms/instagram/commands/shared.js.map +1 -1
- package/dist/src/platforms/instagram/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/instagram/credential-manager.js +1 -1
- package/dist/src/platforms/instagram/credential-manager.js.map +1 -1
- package/dist/src/platforms/instagram/ensure-auth.d.ts.map +1 -1
- package/dist/src/platforms/instagram/ensure-auth.js.map +1 -1
- package/dist/src/platforms/instagram/token-extractor.d.ts +7 -19
- package/dist/src/platforms/instagram/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/instagram/token-extractor.js +44 -270
- package/dist/src/platforms/instagram/token-extractor.js.map +1 -1
- package/dist/src/platforms/instagram/types.d.ts.map +1 -1
- package/dist/src/platforms/instagram/types.js +4 -2
- package/dist/src/platforms/instagram/types.js.map +1 -1
- package/dist/src/platforms/kakaotalk/auth/kakao-login.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/auth/kakao-login.js +18 -4
- package/dist/src/platforms/kakaotalk/auth/kakao-login.js.map +1 -1
- package/dist/src/platforms/kakaotalk/client.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/client.js +3 -3
- 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 +15 -9
- package/dist/src/platforms/kakaotalk/commands/auth.js.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/shared.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/shared.js.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/connection.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/connection.js.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/crypto.js +1 -1
- package/dist/src/platforms/kakaotalk/protocol/crypto.js.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/session.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/session.js +1 -3
- package/dist/src/platforms/kakaotalk/protocol/session.js.map +1 -1
- package/dist/src/platforms/kakaotalk/token-extractor.js +5 -2
- package/dist/src/platforms/kakaotalk/token-extractor.js.map +1 -1
- package/dist/src/platforms/kakaotalk/types.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/types.js +4 -2
- package/dist/src/platforms/kakaotalk/types.js.map +1 -1
- package/dist/src/platforms/line/cli.d.ts.map +1 -1
- package/dist/src/platforms/line/cli.js +1 -4
- 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 +5 -13
- package/dist/src/platforms/line/client.js.map +1 -1
- package/dist/src/platforms/line/commands/chat.d.ts.map +1 -1
- package/dist/src/platforms/line/commands/chat.js.map +1 -1
- package/dist/src/platforms/line/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/line/commands/message.js.map +1 -1
- package/dist/src/platforms/line/listener.js +1 -1
- package/dist/src/platforms/line/listener.js.map +1 -1
- package/dist/src/platforms/slack/cli.d.ts.map +1 -1
- package/dist/src/platforms/slack/cli.js.map +1 -1
- package/dist/src/platforms/slack/client-mappers.d.ts +14 -0
- package/dist/src/platforms/slack/client-mappers.d.ts.map +1 -0
- package/dist/src/platforms/slack/client-mappers.js +245 -0
- package/dist/src/platforms/slack/client-mappers.js.map +1 -0
- package/dist/src/platforms/slack/client.d.ts +0 -1
- package/dist/src/platforms/slack/client.d.ts.map +1 -1
- package/dist/src/platforms/slack/client.js +41 -455
- package/dist/src/platforms/slack/client.js.map +1 -1
- package/dist/src/platforms/slack/commands/channel.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/channel.js.map +1 -1
- package/dist/src/platforms/slack/commands/emoji.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/emoji.js +1 -3
- package/dist/src/platforms/slack/commands/emoji.js.map +1 -1
- package/dist/src/platforms/slack/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/message.js.map +1 -1
- package/dist/src/platforms/slack/commands/reminder.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/reminder.js.map +1 -1
- package/dist/src/platforms/slack/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/snapshot.js +75 -55
- package/dist/src/platforms/slack/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/slack/commands/user.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/user.js.map +1 -1
- package/dist/src/platforms/slack/commands/usergroup.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/usergroup.js.map +1 -1
- package/dist/src/platforms/slack/commands/whoami.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/whoami.js.map +1 -1
- package/dist/src/platforms/slack/token-extractor.d.ts +2 -6
- package/dist/src/platforms/slack/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/slack/token-extractor.js +35 -229
- package/dist/src/platforms/slack/token-extractor.js.map +1 -1
- package/dist/src/platforms/slackbot/cli.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/cli.js +1 -1
- package/dist/src/platforms/slackbot/cli.js.map +1 -1
- package/dist/src/platforms/teams/client.d.ts.map +1 -1
- package/dist/src/platforms/teams/client.js +1 -1
- package/dist/src/platforms/teams/client.js.map +1 -1
- package/dist/src/platforms/teams/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/auth.js +4 -1
- package/dist/src/platforms/teams/commands/auth.js.map +1 -1
- package/dist/src/platforms/teams/commands/snapshot.d.ts +1 -0
- package/dist/src/platforms/teams/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/snapshot.js +44 -31
- package/dist/src/platforms/teams/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/teams/commands/whoami.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/whoami.js.map +1 -1
- package/dist/src/platforms/teams/token-extractor.d.ts +6 -18
- package/dist/src/platforms/teams/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/teams/token-extractor.js +71 -324
- package/dist/src/platforms/teams/token-extractor.js.map +1 -1
- package/dist/src/platforms/telegram/cli.d.ts.map +1 -1
- package/dist/src/platforms/telegram/cli.js +1 -4
- package/dist/src/platforms/telegram/cli.js.map +1 -1
- package/dist/src/platforms/telegram/client.d.ts.map +1 -1
- package/dist/src/platforms/telegram/client.js.map +1 -1
- package/dist/src/platforms/telegram/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/telegram/commands/auth.js +1 -1
- package/dist/src/platforms/telegram/commands/auth.js.map +1 -1
- package/dist/src/platforms/telegram/commands/chat.d.ts.map +1 -1
- package/dist/src/platforms/telegram/commands/chat.js.map +1 -1
- package/dist/src/platforms/telegram/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/telegram/commands/message.js.map +1 -1
- package/dist/src/platforms/telegram/commands/whoami.js +1 -1
- package/dist/src/platforms/telegram/commands/whoami.js.map +1 -1
- package/dist/src/platforms/telegram/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/telegram/credential-manager.js +6 -2
- package/dist/src/platforms/telegram/credential-manager.js.map +1 -1
- package/dist/src/platforms/telegram/my-telegram-org.js.map +1 -1
- package/dist/src/platforms/webex/cli.d.ts.map +1 -1
- package/dist/src/platforms/webex/cli.js +1 -4
- package/dist/src/platforms/webex/cli.js.map +1 -1
- package/dist/src/platforms/webex/client.d.ts.map +1 -1
- package/dist/src/platforms/webex/client.js +3 -7
- package/dist/src/platforms/webex/client.js.map +1 -1
- package/dist/src/platforms/webex/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/auth.js +1 -3
- package/dist/src/platforms/webex/commands/auth.js.map +1 -1
- package/dist/src/platforms/webex/commands/member.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/member.js +1 -3
- package/dist/src/platforms/webex/commands/member.js.map +1 -1
- package/dist/src/platforms/webex/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/message.js.map +1 -1
- package/dist/src/platforms/webex/commands/snapshot.d.ts +1 -0
- package/dist/src/platforms/webex/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/snapshot.js +14 -7
- package/dist/src/platforms/webex/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/webex/commands/space.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/space.js.map +1 -1
- package/dist/src/platforms/webex/commands/whoami.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/whoami.js.map +1 -1
- package/dist/src/platforms/webex/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/webex/credential-manager.js.map +1 -1
- package/dist/src/platforms/webex/ensure-auth.d.ts.map +1 -1
- package/dist/src/platforms/webex/ensure-auth.js +1 -3
- package/dist/src/platforms/webex/ensure-auth.js.map +1 -1
- package/dist/src/platforms/webex/index.d.ts +1 -1
- package/dist/src/platforms/webex/index.d.ts.map +1 -1
- package/dist/src/platforms/webex/index.js.map +1 -1
- package/dist/src/platforms/webex/markdown-to-html.js.map +1 -1
- package/dist/src/platforms/webex/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/webex/token-extractor.js +5 -14
- package/dist/src/platforms/webex/token-extractor.js.map +1 -1
- package/dist/src/platforms/wechatbot/client.d.ts.map +1 -1
- package/dist/src/platforms/wechatbot/client.js.map +1 -1
- package/dist/src/platforms/wechatbot/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/wechatbot/commands/message.js.map +1 -1
- package/dist/src/platforms/whatsapp/cli.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/cli.js +1 -4
- package/dist/src/platforms/whatsapp/cli.js.map +1 -1
- package/dist/src/platforms/whatsapp/commands/chat.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/commands/chat.js.map +1 -1
- package/dist/src/platforms/whatsapp/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/commands/message.js.map +1 -1
- package/dist/src/platforms/whatsapp/commands/shared.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/commands/shared.js.map +1 -1
- package/dist/src/platforms/whatsapp/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/credential-manager.js +1 -1
- package/dist/src/platforms/whatsapp/credential-manager.js.map +1 -1
- package/dist/src/platforms/whatsapp/ensure-auth.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/ensure-auth.js.map +1 -1
- package/dist/src/platforms/whatsappbot/client.d.ts.map +1 -1
- package/dist/src/platforms/whatsappbot/client.js +2 -2
- package/dist/src/platforms/whatsappbot/client.js.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/auth.js +4 -1
- package/dist/src/platforms/whatsappbot/commands/auth.js.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/message.js.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/shared.d.ts.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/shared.js.map +1 -1
- package/dist/src/shared/chromium/browsers.d.ts +7 -0
- package/dist/src/shared/chromium/browsers.d.ts.map +1 -0
- package/dist/src/shared/chromium/browsers.js +89 -0
- package/dist/src/shared/chromium/browsers.js.map +1 -0
- package/dist/src/shared/chromium/cookie-reader.d.ts +20 -0
- package/dist/src/shared/chromium/cookie-reader.d.ts.map +1 -0
- package/dist/src/shared/chromium/cookie-reader.js +99 -0
- package/dist/src/shared/chromium/cookie-reader.js.map +1 -0
- package/dist/src/shared/chromium/decryptor.d.ts +42 -0
- package/dist/src/shared/chromium/decryptor.d.ts.map +1 -0
- package/dist/src/shared/chromium/decryptor.js +205 -0
- package/dist/src/shared/chromium/decryptor.js.map +1 -0
- package/dist/src/shared/chromium/index.d.ts +6 -0
- package/dist/src/shared/chromium/index.d.ts.map +1 -0
- package/dist/src/shared/chromium/index.js +4 -0
- package/dist/src/shared/chromium/index.js.map +1 -0
- package/dist/src/shared/chromium/types.d.ts +11 -0
- package/dist/src/shared/chromium/types.d.ts.map +1 -0
- package/dist/src/shared/chromium/types.js +2 -0
- package/dist/src/shared/chromium/types.js.map +1 -0
- package/dist/src/shared/utils/derived-key-cache.d.ts +1 -1
- package/dist/src/shared/utils/derived-key-cache.d.ts.map +1 -1
- package/dist/src/shared/utils/linux-keyring.js +4 -1
- package/dist/src/shared/utils/linux-keyring.js.map +1 -1
- package/dist/src/tui/adapters/kakaotalk-adapter.d.ts.map +1 -1
- package/dist/src/tui/adapters/kakaotalk-adapter.js +6 -1
- package/dist/src/tui/adapters/kakaotalk-adapter.js.map +1 -1
- package/dist/src/tui/adapters/telegram-adapter.js +1 -1
- package/dist/src/tui/adapters/telegram-adapter.js.map +1 -1
- package/dist/src/tui/adapters/webex-adapter.js +1 -1
- package/dist/src/tui/adapters/webex-adapter.js.map +1 -1
- package/dist/src/tui/app.d.ts.map +1 -1
- package/dist/src/tui/app.js +112 -23
- package/dist/src/tui/app.js.map +1 -1
- package/dist/src/tui/utils.d.ts.map +1 -1
- package/dist/src/tui/utils.js +11 -13
- package/dist/src/tui/utils.js.map +1 -1
- package/dist/src/tui/views/channel-picker.d.ts.map +1 -1
- package/dist/src/tui/views/channel-picker.js.map +1 -1
- package/dist/src/tui/views/workspace-picker.d.ts.map +1 -1
- package/dist/src/tui/views/workspace-picker.js.map +1 -1
- package/docs/content/docs/agent-skills.mdx +0 -10
- package/docs/content/docs/cli/channeltalk.mdx +42 -30
- package/docs/content/docs/cli/channeltalkbot.mdx +23 -13
- package/docs/content/docs/cli/discord.mdx +23 -7
- package/docs/content/docs/cli/discordbot.mdx +23 -7
- package/docs/content/docs/cli/instagram.mdx +4 -4
- package/docs/content/docs/cli/kakaotalk.mdx +9 -8
- package/docs/content/docs/cli/line.mdx +14 -14
- package/docs/content/docs/cli/slack.mdx +24 -7
- package/docs/content/docs/cli/teams.mdx +24 -8
- package/docs/content/docs/cli/webex.mdx +34 -21
- package/docs/content/docs/cli/wechatbot.mdx +12 -11
- package/docs/content/docs/cli/whatsapp.mdx +5 -4
- package/docs/content/docs/cli/whatsappbot.mdx +11 -11
- package/docs/content/docs/index.mdx +7 -7
- package/docs/content/docs/meta.json +1 -9
- package/docs/content/docs/sdk/channeltalk.mdx +5 -6
- package/docs/content/docs/sdk/channeltalkbot.mdx +6 -12
- package/docs/content/docs/sdk/discord.mdx +36 -43
- package/docs/content/docs/sdk/instagram.mdx +18 -18
- package/docs/content/docs/sdk/kakaotalk.mdx +27 -18
- package/docs/content/docs/sdk/line.mdx +8 -13
- package/docs/content/docs/sdk/meta.json +14 -1
- package/docs/content/docs/sdk/slack.mdx +36 -42
- package/docs/content/docs/sdk/teams.mdx +2 -8
- package/docs/content/docs/sdk/webex.mdx +2 -12
- package/docs/content/docs/sdk/wechatbot.mdx +1 -5
- package/docs/content/docs/sdk/whatsapp.mdx +10 -19
- package/docs/content/docs/sdk/whatsappbot.mdx +2 -10
- package/docs/content/docs/tui.mdx +23 -23
- package/docs/src/app/page.tsx +353 -108
- package/e2e/channeltalkbot.e2e.test.ts +1 -5
- package/e2e/config.ts +6 -2
- package/package.json +59 -58
- package/scripts/prepublish.ts +1 -3
- package/skills/agent-channeltalk/SKILL.md +19 -9
- package/skills/agent-channeltalk/references/common-patterns.md +10 -9
- package/skills/agent-channeltalkbot/SKILL.md +19 -9
- package/skills/agent-channeltalkbot/references/common-patterns.md +10 -9
- package/skills/agent-discord/SKILL.md +18 -9
- package/skills/agent-discord/references/common-patterns.md +8 -7
- package/skills/agent-discordbot/SKILL.md +18 -9
- package/skills/agent-instagram/SKILL.md +1 -1
- package/skills/agent-kakaotalk/SKILL.md +1 -1
- package/skills/agent-line/SKILL.md +1 -1
- package/skills/agent-slack/SKILL.md +19 -10
- package/skills/agent-slack/references/common-patterns.md +4 -7
- package/skills/agent-slackbot/SKILL.md +1 -1
- package/skills/agent-teams/SKILL.md +18 -9
- package/skills/agent-teams/references/common-patterns.md +9 -7
- package/skills/agent-telegram/SKILL.md +1 -1
- package/skills/agent-webex/SKILL.md +13 -4
- package/skills/agent-webex/references/common-patterns.md +8 -2
- package/skills/agent-wechatbot/SKILL.md +1 -1
- package/skills/agent-whatsapp/SKILL.md +1 -1
- package/skills/agent-whatsappbot/SKILL.md +1 -1
- package/src/platforms/channeltalk/client.test.ts +116 -29
- package/src/platforms/channeltalk/client.ts +26 -6
- package/src/platforms/channeltalk/commands/auth.test.ts +5 -5
- package/src/platforms/channeltalk/commands/auth.ts +19 -5
- package/src/platforms/channeltalk/commands/message.test.ts +2 -6
- package/src/platforms/channeltalk/commands/message.ts +5 -1
- package/src/platforms/channeltalk/commands/snapshot.test.ts +77 -30
- package/src/platforms/channeltalk/commands/snapshot.ts +112 -34
- package/src/platforms/channeltalk/ensure-auth.test.ts +20 -17
- package/src/platforms/channeltalk/ensure-auth.ts +6 -7
- package/src/platforms/channeltalk/index.ts +0 -1
- package/src/platforms/channeltalk/token-extractor.test.ts +33 -25
- package/src/platforms/channeltalk/token-extractor.ts +120 -372
- package/src/platforms/channeltalkbot/client.test.ts +1 -3
- package/src/platforms/channeltalkbot/client.ts +39 -13
- package/src/platforms/channeltalkbot/commands/auth.test.ts +3 -1
- package/src/platforms/channeltalkbot/commands/auth.ts +4 -1
- package/src/platforms/channeltalkbot/commands/bot.test.ts +13 -5
- package/src/platforms/channeltalkbot/commands/message.test.ts +12 -6
- package/src/platforms/channeltalkbot/commands/shared.ts +6 -2
- package/src/platforms/channeltalkbot/commands/snapshot.test.ts +43 -13
- package/src/platforms/channeltalkbot/commands/snapshot.ts +131 -64
- package/src/platforms/channeltalkbot/credential-manager.test.ts +1 -1
- package/src/platforms/channeltalkbot/index.test.ts +0 -2
- package/src/platforms/channeltalkbot/index.ts +0 -1
- package/src/platforms/discord/commands/auth.test.ts +6 -4
- package/src/platforms/discord/commands/auth.ts +14 -14
- package/src/platforms/discord/commands/snapshot.test.ts +1 -1
- package/src/platforms/discord/commands/snapshot.ts +58 -42
- package/src/platforms/discord/commands/whoami.test.ts +2 -4
- package/src/platforms/discord/commands/whoami.ts +2 -0
- package/src/platforms/discord/ensure-auth.test.ts +5 -3
- package/src/platforms/discord/index.ts +0 -1
- package/src/platforms/discord/listener.test.ts +7 -1
- package/src/platforms/discord/token-extractor.test.ts +18 -12
- package/src/platforms/discord/token-extractor.ts +46 -190
- package/src/platforms/discordbot/client.ts +1 -4
- package/src/platforms/discordbot/commands/auth.test.ts +3 -1
- package/src/platforms/discordbot/commands/channel.test.ts +3 -1
- package/src/platforms/discordbot/commands/message.test.ts +3 -1
- package/src/platforms/discordbot/commands/server.test.ts +3 -1
- package/src/platforms/discordbot/commands/snapshot.test.ts +43 -19
- package/src/platforms/discordbot/commands/snapshot.ts +54 -37
- package/src/platforms/discordbot/commands/thread.test.ts +3 -1
- package/src/platforms/discordbot/commands/user.test.ts +3 -1
- package/src/platforms/instagram/cli.ts +1 -4
- package/src/platforms/instagram/client.test.ts +3 -8
- package/src/platforms/instagram/client.ts +39 -34
- package/src/platforms/instagram/commands/auth.test.ts +13 -12
- package/src/platforms/instagram/commands/auth.ts +136 -71
- package/src/platforms/instagram/commands/chat.test.ts +21 -24
- package/src/platforms/instagram/commands/chat.ts +2 -0
- package/src/platforms/instagram/commands/message.test.ts +29 -24
- package/src/platforms/instagram/commands/message.ts +3 -4
- package/src/platforms/instagram/commands/shared.ts +2 -5
- package/src/platforms/instagram/commands/whoami.test.ts +4 -6
- package/src/platforms/instagram/credential-manager.ts +2 -6
- package/src/platforms/instagram/ensure-auth.test.ts +1 -4
- package/src/platforms/instagram/ensure-auth.ts +6 -3
- package/src/platforms/instagram/listener.test.ts +7 -3
- package/src/platforms/instagram/token-extractor.test.ts +4 -16
- package/src/platforms/instagram/token-extractor.ts +55 -309
- package/src/platforms/instagram/types.test.ts +2 -6
- package/src/platforms/instagram/types.ts +4 -2
- package/src/platforms/kakaotalk/auth/kakao-login.ts +30 -8
- package/src/platforms/kakaotalk/client.test.ts +37 -25
- package/src/platforms/kakaotalk/client.ts +23 -12
- package/src/platforms/kakaotalk/commands/auth.test.ts +6 -18
- package/src/platforms/kakaotalk/commands/auth.ts +101 -47
- package/src/platforms/kakaotalk/commands/chat.test.ts +8 -11
- package/src/platforms/kakaotalk/commands/message.test.ts +15 -24
- package/src/platforms/kakaotalk/commands/shared.ts +1 -0
- package/src/platforms/kakaotalk/commands/whoami.test.ts +6 -10
- package/src/platforms/kakaotalk/credential-manager.test.ts +1 -4
- package/src/platforms/kakaotalk/index.test.ts +1 -0
- package/src/platforms/kakaotalk/index.ts +0 -2
- package/src/platforms/kakaotalk/listener.test.ts +7 -1
- package/src/platforms/kakaotalk/protocol/connection.ts +4 -1
- package/src/platforms/kakaotalk/protocol/crypto.ts +1 -1
- package/src/platforms/kakaotalk/protocol/session.ts +12 -6
- package/src/platforms/kakaotalk/token-extractor.ts +5 -5
- package/src/platforms/kakaotalk/types.ts +8 -7
- package/src/platforms/line/cli.ts +1 -4
- package/src/platforms/line/client.ts +12 -20
- package/src/platforms/line/commands/auth.test.ts +2 -1
- package/src/platforms/line/commands/chat.test.ts +2 -1
- package/src/platforms/line/commands/chat.ts +1 -4
- package/src/platforms/line/commands/friend.test.ts +2 -1
- package/src/platforms/line/commands/message.test.ts +2 -1
- package/src/platforms/line/commands/message.ts +2 -9
- package/src/platforms/line/commands/whoami.test.ts +2 -1
- package/src/platforms/line/credential-manager.test.ts +1 -2
- package/src/platforms/line/index.test.ts +1 -0
- package/src/platforms/line/listener.ts +1 -1
- package/src/platforms/line/types.test.ts +1 -0
- package/src/platforms/slack/cli.ts +3 -1
- package/src/platforms/slack/client-mappers.ts +297 -0
- package/src/platforms/slack/client.test.ts +532 -17
- package/src/platforms/slack/client.ts +69 -458
- package/src/platforms/slack/commands/channel.ts +1 -4
- package/src/platforms/slack/commands/emoji.test.ts +6 -4
- package/src/platforms/slack/commands/emoji.ts +20 -22
- package/src/platforms/slack/commands/message.ts +6 -1
- package/src/platforms/slack/commands/pin.test.ts +14 -12
- package/src/platforms/slack/commands/reminder.ts +7 -6
- package/src/platforms/slack/commands/snapshot.test.ts +63 -8
- package/src/platforms/slack/commands/snapshot.ts +98 -66
- package/src/platforms/slack/commands/user.ts +6 -1
- package/src/platforms/slack/commands/usergroup.test.ts +3 -3
- package/src/platforms/slack/commands/usergroup.ts +10 -7
- package/src/platforms/slack/commands/whoami.test.ts +1 -1
- package/src/platforms/slack/commands/whoami.ts +2 -0
- package/src/platforms/slack/index.ts +0 -2
- package/src/platforms/slack/listener.test.ts +1 -0
- package/src/platforms/slack/token-extractor.test.ts +7 -12
- package/src/platforms/slack/token-extractor.ts +47 -255
- package/src/platforms/slackbot/cli.ts +8 -1
- package/src/platforms/slackbot/commands/auth.test.ts +3 -1
- package/src/platforms/teams/client.ts +1 -1
- package/src/platforms/teams/commands/auth.test.ts +1 -1
- package/src/platforms/teams/commands/auth.ts +4 -1
- package/src/platforms/teams/commands/snapshot.test.ts +1 -1
- package/src/platforms/teams/commands/snapshot.ts +53 -38
- package/src/platforms/teams/commands/whoami.test.ts +2 -4
- package/src/platforms/teams/commands/whoami.ts +2 -0
- package/src/platforms/teams/index.ts +0 -1
- package/src/platforms/teams/token-extractor.ts +82 -350
- package/src/platforms/telegram/app-config.test.ts +1 -0
- package/src/platforms/telegram/chat-utils.test.ts +5 -1
- package/src/platforms/telegram/cli.ts +2 -4
- package/src/platforms/telegram/client.test.ts +16 -3
- package/src/platforms/telegram/client.ts +14 -4
- package/src/platforms/telegram/commands/auth.test.ts +1 -0
- package/src/platforms/telegram/commands/auth.ts +3 -4
- package/src/platforms/telegram/commands/chat.test.ts +2 -5
- package/src/platforms/telegram/commands/chat.ts +1 -0
- package/src/platforms/telegram/commands/message.test.ts +2 -5
- package/src/platforms/telegram/commands/message.ts +1 -0
- package/src/platforms/telegram/commands/shared.test.ts +1 -0
- package/src/platforms/telegram/commands/whoami.test.ts +5 -7
- package/src/platforms/telegram/commands/whoami.ts +1 -1
- package/src/platforms/telegram/credential-manager.test.ts +1 -0
- package/src/platforms/telegram/credential-manager.ts +11 -2
- package/src/platforms/telegram/my-telegram-org.ts +6 -2
- package/src/platforms/telegram/types.test.ts +1 -0
- package/src/platforms/webex/app-config.test.ts +1 -0
- package/src/platforms/webex/cli.ts +1 -4
- package/src/platforms/webex/client.test.ts +4 -12
- package/src/platforms/webex/client.ts +14 -52
- package/src/platforms/webex/commands/auth.test.ts +7 -1
- package/src/platforms/webex/commands/auth.ts +12 -15
- package/src/platforms/webex/commands/member.test.ts +1 -3
- package/src/platforms/webex/commands/member.ts +14 -19
- package/src/platforms/webex/commands/message.ts +4 -15
- package/src/platforms/webex/commands/snapshot.test.ts +42 -4
- package/src/platforms/webex/commands/snapshot.ts +19 -11
- package/src/platforms/webex/commands/space.test.ts +3 -3
- package/src/platforms/webex/commands/space.ts +2 -9
- package/src/platforms/webex/commands/whoami.test.ts +12 -5
- package/src/platforms/webex/commands/whoami.ts +2 -0
- package/src/platforms/webex/credential-manager.ts +11 -2
- package/src/platforms/webex/ensure-auth.ts +1 -3
- package/src/platforms/webex/index.ts +1 -7
- package/src/platforms/webex/markdown-to-html.test.ts +6 -18
- package/src/platforms/webex/markdown-to-html.ts +8 -8
- package/src/platforms/webex/token-extractor.ts +6 -29
- package/src/platforms/wechatbot/client.test.ts +6 -2
- package/src/platforms/wechatbot/client.ts +6 -1
- package/src/platforms/wechatbot/commands/auth.test.ts +3 -7
- package/src/platforms/wechatbot/commands/message.test.ts +1 -4
- package/src/platforms/wechatbot/commands/message.ts +5 -1
- package/src/platforms/wechatbot/commands/template.test.ts +1 -4
- package/src/platforms/wechatbot/commands/user.test.ts +2 -7
- package/src/platforms/whatsapp/cli.ts +1 -4
- package/src/platforms/whatsapp/commands/auth.test.ts +19 -22
- package/src/platforms/whatsapp/commands/chat.test.ts +21 -24
- package/src/platforms/whatsapp/commands/chat.ts +2 -0
- package/src/platforms/whatsapp/commands/message.test.ts +22 -24
- package/src/platforms/whatsapp/commands/message.ts +3 -5
- package/src/platforms/whatsapp/commands/shared.ts +2 -5
- package/src/platforms/whatsapp/commands/whoami.test.ts +2 -2
- package/src/platforms/whatsapp/credential-manager.ts +2 -6
- package/src/platforms/whatsapp/ensure-auth.test.ts +1 -4
- package/src/platforms/whatsapp/ensure-auth.ts +14 -6
- package/src/platforms/whatsapp/index.ts +0 -2
- package/src/platforms/whatsappbot/client.test.ts +13 -7
- package/src/platforms/whatsappbot/client.ts +18 -4
- package/src/platforms/whatsappbot/commands/auth.ts +4 -1
- package/src/platforms/whatsappbot/commands/message.test.ts +12 -2
- package/src/platforms/whatsappbot/commands/message.ts +16 -3
- package/src/platforms/whatsappbot/commands/shared.ts +3 -1
- package/src/platforms/whatsappbot/commands/whoami.test.ts +1 -3
- package/src/platforms/whatsappbot/index.ts +0 -2
- package/src/shared/chromium/browsers.test.ts +274 -0
- package/src/shared/chromium/browsers.ts +86 -0
- package/src/shared/chromium/cookie-reader.test.ts +274 -0
- package/src/shared/chromium/cookie-reader.ts +111 -0
- package/src/shared/chromium/decryptor.test.ts +449 -0
- package/src/shared/chromium/decryptor.ts +227 -0
- package/src/shared/chromium/index.ts +11 -0
- package/src/shared/chromium/types.ts +11 -0
- package/src/shared/utils/derived-key-cache.ts +1 -1
- package/src/shared/utils/linux-keyring.ts +4 -4
- package/src/tui/adapters/kakaotalk-adapter.ts +6 -1
- package/src/tui/adapters/telegram-adapter.ts +1 -1
- package/src/tui/adapters/webex-adapter.ts +1 -1
- package/src/tui/app.ts +149 -59
- package/src/tui/utils.test.ts +144 -145
- package/src/tui/utils.ts +27 -29
- package/src/tui/views/channel-picker.ts +1 -1
- package/src/tui/views/workspace-picker.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-teams
|
|
3
3
|
description: Interact with Microsoft Teams - send messages, read channels, manage reactions
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.9.0
|
|
5
5
|
allowed-tools: Bash(agent-teams:*)
|
|
6
6
|
metadata:
|
|
7
7
|
openclaw:
|
|
@@ -262,21 +262,30 @@ agent-teams file info <team-id> <channel-id> <file-id>
|
|
|
262
262
|
|
|
263
263
|
### Snapshot Command
|
|
264
264
|
|
|
265
|
-
Get
|
|
265
|
+
Get team overview for AI agents (brief by default):
|
|
266
266
|
|
|
267
267
|
```bash
|
|
268
|
-
#
|
|
268
|
+
# Brief snapshot (default) — fast, minimal API calls
|
|
269
269
|
agent-teams snapshot
|
|
270
270
|
|
|
271
|
-
#
|
|
272
|
-
agent-teams snapshot --
|
|
273
|
-
agent-teams snapshot --users-only
|
|
271
|
+
# Full snapshot — includes messages and members (slow, large output)
|
|
272
|
+
agent-teams snapshot --full
|
|
274
273
|
|
|
275
|
-
#
|
|
276
|
-
agent-teams snapshot --
|
|
274
|
+
# Filtered full snapshots
|
|
275
|
+
agent-teams snapshot --full --channels-only
|
|
276
|
+
agent-teams snapshot --full --users-only
|
|
277
|
+
|
|
278
|
+
# Limit messages per channel (only with --full)
|
|
279
|
+
agent-teams snapshot --full --limit 10
|
|
277
280
|
```
|
|
278
281
|
|
|
279
|
-
|
|
282
|
+
Default returns brief JSON with:
|
|
283
|
+
|
|
284
|
+
- Team metadata (id, name)
|
|
285
|
+
- Channels (id, name)
|
|
286
|
+
- Hint for next commands
|
|
287
|
+
|
|
288
|
+
With `--full`, returns comprehensive JSON with:
|
|
280
289
|
|
|
281
290
|
- Team metadata (id, name)
|
|
282
291
|
- Channels (id, name, type, description)
|
|
@@ -127,28 +127,30 @@ done
|
|
|
127
127
|
# Ensure fresh token
|
|
128
128
|
agent-teams auth extract 2>/dev/null || true
|
|
129
129
|
|
|
130
|
-
# Get
|
|
130
|
+
# Get brief snapshot (default — fast, minimal output)
|
|
131
131
|
SNAPSHOT=$(agent-teams snapshot)
|
|
132
132
|
|
|
133
133
|
# Extract key information
|
|
134
134
|
TEAM_NAME=$(echo "$SNAPSHOT" | jq -r '.team.name // "Unknown"')
|
|
135
135
|
CHANNEL_COUNT=$(echo "$SNAPSHOT" | jq -r '.channels | length')
|
|
136
|
-
MEMBER_COUNT=$(echo "$SNAPSHOT" | jq -r '.members | length')
|
|
137
136
|
|
|
138
137
|
echo "Team: $TEAM_NAME"
|
|
139
138
|
echo "Channels: $CHANNEL_COUNT"
|
|
140
|
-
echo "Members: $MEMBER_COUNT"
|
|
141
139
|
|
|
142
140
|
# List all channels
|
|
143
141
|
echo -e "\nChannels:"
|
|
144
142
|
echo "$SNAPSHOT" | jq -r '.channels[] | " #\(.name) (\(.id))"'
|
|
145
143
|
|
|
146
|
-
#
|
|
147
|
-
echo -
|
|
148
|
-
echo "$SNAPSHOT" | jq -r '.
|
|
144
|
+
# Then drill into a specific channel for recent activity
|
|
145
|
+
CHANNEL_ID=$(echo "$SNAPSHOT" | jq -r '.channels[0].id // empty')
|
|
146
|
+
TEAM_ID=$(echo "$SNAPSHOT" | jq -r '.team.id // empty')
|
|
147
|
+
if [ -n "$TEAM_ID" ] && [ -n "$CHANNEL_ID" ]; then
|
|
148
|
+
echo -e "\nRecent messages:"
|
|
149
|
+
agent-teams message list "$TEAM_ID" "$CHANNEL_ID" --limit 10
|
|
150
|
+
fi
|
|
149
151
|
```
|
|
150
152
|
|
|
151
|
-
**When to use**: Initial context gathering, status reports, team summaries.
|
|
153
|
+
**When to use**: Initial context gathering, status reports, team summaries. Start with brief snapshot, then use `message list <team-id> <channel-id>` or `member list <team-id>` for details.
|
|
152
154
|
|
|
153
155
|
## Pattern 4: Find Channel by Name
|
|
154
156
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-webex
|
|
3
3
|
description: Interact with Cisco Webex - send messages, read spaces, manage memberships
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.9.0
|
|
5
5
|
allowed-tools: Bash(agent-webex:*)
|
|
6
6
|
metadata:
|
|
7
7
|
openclaw:
|
|
@@ -247,15 +247,24 @@ agent-webex member list <space-id> --limit 100
|
|
|
247
247
|
|
|
248
248
|
### Snapshot Command
|
|
249
249
|
|
|
250
|
-
Get workspace
|
|
250
|
+
Get workspace overview for AI agents (brief by default):
|
|
251
251
|
|
|
252
252
|
```bash
|
|
253
|
+
# Brief snapshot (default) — fast, minimal output
|
|
253
254
|
agent-webex snapshot
|
|
255
|
+
|
|
256
|
+
# Full snapshot — includes type and lastActivity
|
|
257
|
+
agent-webex snapshot --full
|
|
254
258
|
```
|
|
255
259
|
|
|
256
|
-
|
|
260
|
+
Default returns brief JSON with:
|
|
261
|
+
|
|
262
|
+
- Spaces (id, title) — only spaces you're a member of
|
|
263
|
+
- Hint for next commands
|
|
264
|
+
|
|
265
|
+
With `--full`, returns:
|
|
257
266
|
|
|
258
|
-
- Spaces (id, title, type, lastActivity)
|
|
267
|
+
- Spaces (id, title, type, lastActivity)
|
|
259
268
|
|
|
260
269
|
For messages or members, use `message list <space-id>` or `member list <space-id>`.
|
|
261
270
|
|
|
@@ -336,10 +336,16 @@ SPACE_COUNT=$(echo "$SNAPSHOT" | jq -r '.spaces | length')
|
|
|
336
336
|
echo "Total spaces: $SPACE_COUNT"
|
|
337
337
|
|
|
338
338
|
# List all spaces
|
|
339
|
-
echo "$SNAPSHOT" | jq -r '.spaces[] | " \(.title) (\(.
|
|
339
|
+
echo "$SNAPSHOT" | jq -r '.spaces[] | " \(.title) (\(.id))"'
|
|
340
|
+
|
|
341
|
+
# Then drill into a specific space for details
|
|
342
|
+
SPACE_ID=$(echo "$SNAPSHOT" | jq -r '.spaces[0].id // empty')
|
|
343
|
+
if [ -n "$SPACE_ID" ]; then
|
|
344
|
+
agent-webex message list "$SPACE_ID" --limit 10
|
|
345
|
+
fi
|
|
340
346
|
```
|
|
341
347
|
|
|
342
|
-
**When to use**: Quick workspace overview to discover space IDs and titles.
|
|
348
|
+
**When to use**: Quick workspace overview to discover space IDs and titles. Start with brief snapshot, then use `message list <space-id>` or `member list <space-id>` for details.
|
|
343
349
|
|
|
344
350
|
## Pipeline Patterns
|
|
345
351
|
|
|
@@ -48,11 +48,14 @@ describe('ChannelClient', () => {
|
|
|
48
48
|
|
|
49
49
|
const getHeaders = (callIndex = 0) => fetchCalls[callIndex]?.options?.headers as Record<string, string>
|
|
50
50
|
|
|
51
|
-
const getJsonBody = (callIndex = 0) =>
|
|
51
|
+
const getJsonBody = (callIndex = 0) =>
|
|
52
|
+
JSON.parse(String(fetchCalls[callIndex]?.options?.body)) as Record<string, unknown>
|
|
52
53
|
|
|
53
54
|
test('login() requires account cookie', async () => {
|
|
54
55
|
await expect(new ChannelClient().login({ accountCookie: '' })).rejects.toThrow(ChannelError)
|
|
55
|
-
await expect(new ChannelClient().login({ accountCookie: '', sessionCookie: 'session-cookie' })).rejects.toThrow(
|
|
56
|
+
await expect(new ChannelClient().login({ accountCookie: '', sessionCookie: 'session-cookie' })).rejects.toThrow(
|
|
57
|
+
ChannelError,
|
|
58
|
+
)
|
|
56
59
|
const client = await new ChannelClient().login({ accountCookie: 'account-cookie' })
|
|
57
60
|
expect(client).toBeInstanceOf(ChannelClient)
|
|
58
61
|
const client2 = await new ChannelClient().login({ accountCookie: 'account-cookie', sessionCookie: '' })
|
|
@@ -60,7 +63,17 @@ describe('ChannelClient', () => {
|
|
|
60
63
|
})
|
|
61
64
|
|
|
62
65
|
test('successful GET request returns unwrapped JSON', async () => {
|
|
63
|
-
mockResponse({
|
|
66
|
+
mockResponse({
|
|
67
|
+
account: {
|
|
68
|
+
id: 'acc-1',
|
|
69
|
+
name: 'Desk Owner',
|
|
70
|
+
email: 'owner@example.com',
|
|
71
|
+
emailVerified: true,
|
|
72
|
+
language: 'en',
|
|
73
|
+
country: 'KR',
|
|
74
|
+
createdAt: 1,
|
|
75
|
+
},
|
|
76
|
+
})
|
|
64
77
|
|
|
65
78
|
const client = await new ChannelClient().login({ accountCookie: 'account-cookie', sessionCookie: 'session-cookie' })
|
|
66
79
|
const account = await client.getAccount()
|
|
@@ -70,7 +83,17 @@ describe('ChannelClient', () => {
|
|
|
70
83
|
})
|
|
71
84
|
|
|
72
85
|
test('cookie auth headers are set on every request', async () => {
|
|
73
|
-
mockResponse({
|
|
86
|
+
mockResponse({
|
|
87
|
+
account: {
|
|
88
|
+
id: 'acc-1',
|
|
89
|
+
name: 'Desk Owner',
|
|
90
|
+
email: 'owner@example.com',
|
|
91
|
+
emailVerified: true,
|
|
92
|
+
language: 'en',
|
|
93
|
+
country: 'KR',
|
|
94
|
+
createdAt: 1,
|
|
95
|
+
},
|
|
96
|
+
})
|
|
74
97
|
mockResponse({ channel: { id: 'ch-1', name: 'Support' } })
|
|
75
98
|
|
|
76
99
|
const client = await new ChannelClient().login({ accountCookie: 'account-cookie', sessionCookie: 'session-cookie' })
|
|
@@ -87,7 +110,17 @@ describe('ChannelClient', () => {
|
|
|
87
110
|
|
|
88
111
|
test('429 response triggers retry with Retry-After wait', async () => {
|
|
89
112
|
mockResponse({ errors: [{ message: 'Rate limited' }] }, 429, { 'Retry-After': '0.05' })
|
|
90
|
-
mockResponse({
|
|
113
|
+
mockResponse({
|
|
114
|
+
account: {
|
|
115
|
+
id: 'acc-1',
|
|
116
|
+
name: 'Desk Owner',
|
|
117
|
+
email: 'owner@example.com',
|
|
118
|
+
emailVerified: true,
|
|
119
|
+
language: 'en',
|
|
120
|
+
country: 'KR',
|
|
121
|
+
createdAt: 1,
|
|
122
|
+
},
|
|
123
|
+
})
|
|
91
124
|
|
|
92
125
|
const client = await new ChannelClient().login({ accountCookie: 'account-cookie', sessionCookie: 'session-cookie' })
|
|
93
126
|
const start = Date.now()
|
|
@@ -102,7 +135,17 @@ describe('ChannelClient', () => {
|
|
|
102
135
|
test('500 response triggers retry with exponential backoff for GET requests', async () => {
|
|
103
136
|
mockResponse({ errors: [{ message: 'Server error' }] }, 500)
|
|
104
137
|
mockResponse({ errors: [{ message: 'Server error' }] }, 500)
|
|
105
|
-
mockResponse({
|
|
138
|
+
mockResponse({
|
|
139
|
+
account: {
|
|
140
|
+
id: 'acc-1',
|
|
141
|
+
name: 'Desk Owner',
|
|
142
|
+
email: 'owner@example.com',
|
|
143
|
+
emailVerified: true,
|
|
144
|
+
language: 'en',
|
|
145
|
+
country: 'KR',
|
|
146
|
+
createdAt: 1,
|
|
147
|
+
},
|
|
148
|
+
})
|
|
106
149
|
|
|
107
150
|
const client = await new ChannelClient().login({ accountCookie: 'account-cookie', sessionCookie: 'session-cookie' })
|
|
108
151
|
const start = Date.now()
|
|
@@ -147,24 +190,26 @@ describe('ChannelClient', () => {
|
|
|
147
190
|
mockResponse(null, 204)
|
|
148
191
|
|
|
149
192
|
const client = await new ChannelClient().login({ accountCookie: 'account-cookie', sessionCookie: 'session-cookie' })
|
|
150
|
-
const result = await (
|
|
193
|
+
const result = await (
|
|
194
|
+
client as unknown as { request: <T>(method: string, path: string) => Promise<T> }
|
|
195
|
+
).request<void>('GET', '/desk/account')
|
|
151
196
|
|
|
152
197
|
expect(result).toBeUndefined()
|
|
153
198
|
})
|
|
154
199
|
|
|
155
200
|
test('wrapTextInBlocks returns a single text block and extractText joins block and plain text', () => {
|
|
156
|
-
expect(ChannelClient.wrapTextInBlocks('Hello world')).toEqual([
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
201
|
+
expect(ChannelClient.wrapTextInBlocks('Hello world')).toEqual([{ type: 'text', value: 'Hello world' }])
|
|
202
|
+
|
|
203
|
+
expect(
|
|
204
|
+
ChannelClient.extractText({
|
|
205
|
+
id: 'msg-1',
|
|
206
|
+
blocks: [
|
|
207
|
+
{ type: 'text', value: 'hello' },
|
|
208
|
+
{ type: 'text', value: 'world' },
|
|
209
|
+
],
|
|
210
|
+
plainText: 'fallback',
|
|
211
|
+
}),
|
|
212
|
+
).toBe('hello\nworld\nfallback')
|
|
168
213
|
})
|
|
169
214
|
|
|
170
215
|
test('listChannels includes query params', async () => {
|
|
@@ -220,7 +265,9 @@ describe('ChannelClient', () => {
|
|
|
220
265
|
expect(fetchCalls[1].url).toBe('https://desk-api.channel.io/desk/channels/ch-1/groups/grp-1')
|
|
221
266
|
|
|
222
267
|
const messagesUrl = new URL(fetchCalls[2].url)
|
|
223
|
-
expect(messagesUrl.origin + messagesUrl.pathname).toBe(
|
|
268
|
+
expect(messagesUrl.origin + messagesUrl.pathname).toBe(
|
|
269
|
+
'https://desk-api.channel.io/desk/channels/ch-1/groups/grp-1/messages',
|
|
270
|
+
)
|
|
224
271
|
expect(messagesUrl.searchParams.get('sortOrder')).toBe('desc')
|
|
225
272
|
expect(messagesUrl.searchParams.get('limit')).toBe('100')
|
|
226
273
|
expect(messagesUrl.searchParams.get('since')).toBe('cursor-1')
|
|
@@ -251,7 +298,9 @@ describe('ChannelClient', () => {
|
|
|
251
298
|
await client.sendDirectChatMessage('ch-1', 'dm-1', blocks, 'req-234')
|
|
252
299
|
|
|
253
300
|
expect(fetchCalls[0].url).toBe('https://desk-api.channel.io/desk/channels/ch-1/direct-chats?limit=200')
|
|
254
|
-
expect(fetchCalls[1].url).toBe(
|
|
301
|
+
expect(fetchCalls[1].url).toBe(
|
|
302
|
+
'https://desk-api.channel.io/desk/channels/ch-1/direct-chats/dm-1/messages?sortOrder=asc&limit=50',
|
|
303
|
+
)
|
|
255
304
|
expect(fetchCalls[2].url).toBe('https://desk-api.channel.io/desk/channels/ch-1/direct-chats/dm-1/messages')
|
|
256
305
|
expect(getJsonBody(2)).toEqual({ blocks, requestId: 'req-234' })
|
|
257
306
|
})
|
|
@@ -270,9 +319,13 @@ describe('ChannelClient', () => {
|
|
|
270
319
|
await client.getUserChatMessages('ch-1', 'uc-1', { sortOrder: 'desc', limit: 25 })
|
|
271
320
|
await client.sendUserChatMessage('ch-1', 'uc-1', blocks, 'req-345')
|
|
272
321
|
|
|
273
|
-
expect(fetchCalls[0].url).toBe(
|
|
322
|
+
expect(fetchCalls[0].url).toBe(
|
|
323
|
+
'https://desk-api.channel.io/desk/channels/ch-1/user-chats/assigned/me?state=opened&limit=25',
|
|
324
|
+
)
|
|
274
325
|
expect(fetchCalls[1].url).toBe('https://desk-api.channel.io/desk/channels/ch-1/user-chats/uc-1')
|
|
275
|
-
expect(fetchCalls[2].url).toBe(
|
|
326
|
+
expect(fetchCalls[2].url).toBe(
|
|
327
|
+
'https://desk-api.channel.io/desk/channels/ch-1/user-chats/uc-1/messages?sortOrder=desc&limit=25',
|
|
328
|
+
)
|
|
276
329
|
expect(fetchCalls[3].url).toBe('https://desk-api.channel.io/desk/channels/ch-1/user-chats/uc-1/messages')
|
|
277
330
|
expect(getJsonBody(3)).toEqual({ blocks, requestId: 'req-345' })
|
|
278
331
|
})
|
|
@@ -291,7 +344,9 @@ describe('ChannelClient', () => {
|
|
|
291
344
|
mockResponse({ type: 'server_error', errors: [{ message: 'Server error' }] }, 500)
|
|
292
345
|
|
|
293
346
|
const client = await new ChannelClient().login({ accountCookie: 'account-cookie', sessionCookie: 'session-cookie' })
|
|
294
|
-
await expect(
|
|
347
|
+
await expect(
|
|
348
|
+
client.sendGroupMessage('ch-1', 'grp-1', ChannelClient.wrapTextInBlocks('hello'), 'req-123'),
|
|
349
|
+
).rejects.toThrow(ChannelError)
|
|
295
350
|
expect(fetchCalls).toHaveLength(1)
|
|
296
351
|
})
|
|
297
352
|
|
|
@@ -311,11 +366,35 @@ describe('ChannelClient', () => {
|
|
|
311
366
|
})
|
|
312
367
|
|
|
313
368
|
test('rate limit headers delay the next request when remaining is zero', async () => {
|
|
314
|
-
mockResponse(
|
|
315
|
-
|
|
316
|
-
|
|
369
|
+
mockResponse(
|
|
370
|
+
{
|
|
371
|
+
account: {
|
|
372
|
+
id: 'acc-1',
|
|
373
|
+
name: 'Desk Owner',
|
|
374
|
+
email: 'owner@example.com',
|
|
375
|
+
emailVerified: true,
|
|
376
|
+
language: 'en',
|
|
377
|
+
country: 'KR',
|
|
378
|
+
createdAt: 1,
|
|
379
|
+
},
|
|
380
|
+
},
|
|
381
|
+
200,
|
|
382
|
+
{
|
|
383
|
+
'x-ratelimit-remaining': '0',
|
|
384
|
+
'x-ratelimit-reset': String(Date.now() + 50),
|
|
385
|
+
},
|
|
386
|
+
)
|
|
387
|
+
mockResponse({
|
|
388
|
+
account: {
|
|
389
|
+
id: 'acc-2',
|
|
390
|
+
name: 'Desk Owner',
|
|
391
|
+
email: 'owner@example.com',
|
|
392
|
+
emailVerified: true,
|
|
393
|
+
language: 'en',
|
|
394
|
+
country: 'KR',
|
|
395
|
+
createdAt: 2,
|
|
396
|
+
},
|
|
317
397
|
})
|
|
318
|
-
mockResponse({ account: { id: 'acc-2', name: 'Desk Owner', email: 'owner@example.com', emailVerified: true, language: 'en', country: 'KR', createdAt: 2 } })
|
|
319
398
|
|
|
320
399
|
const client = await new ChannelClient().login({ accountCookie: 'account-cookie', sessionCookie: 'session-cookie' })
|
|
321
400
|
await client.getAccount()
|
|
@@ -339,7 +418,15 @@ describe('ChannelClient', () => {
|
|
|
339
418
|
|
|
340
419
|
test('searchTeamChatMessages builds correct URL with query and limit', async () => {
|
|
341
420
|
const searchResponse = {
|
|
342
|
-
hits: [
|
|
421
|
+
hits: [
|
|
422
|
+
{
|
|
423
|
+
index: 'messages-2026-03',
|
|
424
|
+
score: 'NaN',
|
|
425
|
+
source: { id: 'msg-1' },
|
|
426
|
+
highlight: {},
|
|
427
|
+
searchAfter: [1000, 'msg-1'],
|
|
428
|
+
},
|
|
429
|
+
],
|
|
343
430
|
bots: [],
|
|
344
431
|
sessions: [],
|
|
345
432
|
groups: [],
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ChannelCredentialManager } from './credential-manager'
|
|
1
2
|
import type {
|
|
2
3
|
Channel,
|
|
3
4
|
ChannelAccount,
|
|
@@ -11,7 +12,6 @@ import type {
|
|
|
11
12
|
MessageBlock,
|
|
12
13
|
} from './types'
|
|
13
14
|
import { ChannelError } from './types'
|
|
14
|
-
import { ChannelCredentialManager } from './credential-manager'
|
|
15
15
|
|
|
16
16
|
const BASE_URL = 'https://desk-api.channel.io'
|
|
17
17
|
const MAX_RETRIES = 3
|
|
@@ -99,11 +99,21 @@ export class ChannelClient {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
async getManagerRole(channelId: string): Promise<{ permissions: unknown[] }> {
|
|
102
|
-
return this.request<{ permissions: unknown[] }>(
|
|
102
|
+
return this.request<{ permissions: unknown[] }>(
|
|
103
|
+
'GET',
|
|
104
|
+
`/desk/channels/${channelId}/managers/me/role`,
|
|
105
|
+
undefined,
|
|
106
|
+
'role',
|
|
107
|
+
)
|
|
103
108
|
}
|
|
104
109
|
|
|
105
110
|
async listGroups(channelId: string, params?: { limit?: number }): Promise<ChannelGroup[]> {
|
|
106
|
-
return this.request<ChannelGroup[]>(
|
|
111
|
+
return this.request<ChannelGroup[]>(
|
|
112
|
+
'GET',
|
|
113
|
+
this.buildPath(`/desk/channels/${channelId}/groups`, params),
|
|
114
|
+
undefined,
|
|
115
|
+
'groups',
|
|
116
|
+
)
|
|
107
117
|
}
|
|
108
118
|
|
|
109
119
|
async getGroup(channelId: string, groupId: string): Promise<ChannelGroup> {
|
|
@@ -183,7 +193,12 @@ export class ChannelClient {
|
|
|
183
193
|
}
|
|
184
194
|
|
|
185
195
|
async getUserChat(channelId: string, chatId: string): Promise<ChannelUserChat> {
|
|
186
|
-
return this.request<ChannelUserChat>(
|
|
196
|
+
return this.request<ChannelUserChat>(
|
|
197
|
+
'GET',
|
|
198
|
+
`/desk/channels/${channelId}/user-chats/${chatId}`,
|
|
199
|
+
undefined,
|
|
200
|
+
'userChat',
|
|
201
|
+
)
|
|
187
202
|
}
|
|
188
203
|
|
|
189
204
|
async getUserChatMessages(
|
|
@@ -214,7 +229,12 @@ export class ChannelClient {
|
|
|
214
229
|
}
|
|
215
230
|
|
|
216
231
|
async listBots(channelId: string, params?: { limit?: number }): Promise<ChannelBot[]> {
|
|
217
|
-
return this.request<ChannelBot[]>(
|
|
232
|
+
return this.request<ChannelBot[]>(
|
|
233
|
+
'GET',
|
|
234
|
+
this.buildPath(`/desk/channels/${channelId}/bots`, params),
|
|
235
|
+
undefined,
|
|
236
|
+
'bots',
|
|
237
|
+
)
|
|
218
238
|
}
|
|
219
239
|
|
|
220
240
|
async searchTeamChatMessages(
|
|
@@ -344,7 +364,7 @@ export class ChannelClient {
|
|
|
344
364
|
}
|
|
345
365
|
|
|
346
366
|
private async createHttpError(response: Response): Promise<ChannelError> {
|
|
347
|
-
const errorBody = await response.json().catch(() => ({})) as ChannelApiErrorResponse
|
|
367
|
+
const errorBody = (await response.json().catch(() => ({}))) as ChannelApiErrorResponse
|
|
348
368
|
const message = errorBody.errors?.[0]?.message || `HTTP ${response.status}`
|
|
349
369
|
const code = errorBody.type || `http_${response.status}`
|
|
350
370
|
return new ChannelError(message, code)
|
|
@@ -19,9 +19,7 @@ const mockListChannels = mock(() =>
|
|
|
19
19
|
{ id: 'ws-2', name: 'Workspace 2' },
|
|
20
20
|
]),
|
|
21
21
|
)
|
|
22
|
-
const mockExtract = mock(() =>
|
|
23
|
-
Promise.resolve([{ accountCookie: 'fresh-account', sessionCookie: 'fresh-session' }]),
|
|
24
|
-
)
|
|
22
|
+
const mockExtract = mock(() => Promise.resolve([{ accountCookie: 'fresh-account', sessionCookie: 'fresh-session' }]))
|
|
25
23
|
|
|
26
24
|
import {
|
|
27
25
|
clearAction,
|
|
@@ -50,7 +48,7 @@ setChannelAuthCommandDependenciesForTesting({
|
|
|
50
48
|
createCredentialManager: () => ({
|
|
51
49
|
async getCredentials(workspaceId?: string): Promise<WorkspaceEntry | null> {
|
|
52
50
|
const targetId = workspaceId ?? currentWorkspaceId
|
|
53
|
-
return targetId ? workspaceStore.get(targetId) ?? null : null
|
|
51
|
+
return targetId ? (workspaceStore.get(targetId) ?? null) : null
|
|
54
52
|
},
|
|
55
53
|
|
|
56
54
|
async setCredentials(entry: WorkspaceEntry): Promise<void> {
|
|
@@ -115,7 +113,9 @@ describe('channel auth commands', () => {
|
|
|
115
113
|
{ id: 'ws-2', name: 'Workspace 2' },
|
|
116
114
|
]),
|
|
117
115
|
)
|
|
118
|
-
mockExtract.mockImplementation(() =>
|
|
116
|
+
mockExtract.mockImplementation(() =>
|
|
117
|
+
Promise.resolve([{ accountCookie: 'fresh-account', sessionCookie: 'fresh-session' }]),
|
|
118
|
+
)
|
|
119
119
|
})
|
|
120
120
|
|
|
121
121
|
describe('extractAction', () => {
|
|
@@ -50,7 +50,10 @@ type ChannelCredentialManagerLike = Pick<
|
|
|
50
50
|
>
|
|
51
51
|
type ChannelTokenExtractorLike = Pick<ChannelTokenExtractor, 'extract'>
|
|
52
52
|
|
|
53
|
-
let createChannelClient: (
|
|
53
|
+
let createChannelClient: (
|
|
54
|
+
accountCookie: string,
|
|
55
|
+
sessionCookie?: string,
|
|
56
|
+
) => ChannelClientLike | Promise<ChannelClientLike> = async (
|
|
54
57
|
accountCookie: string,
|
|
55
58
|
sessionCookie?: string,
|
|
56
59
|
): Promise<ChannelClientLike> => new ChannelClient().login({ accountCookie, sessionCookie })
|
|
@@ -60,7 +63,10 @@ let createCredentialManager = (): ChannelCredentialManagerLike => new ChannelCre
|
|
|
60
63
|
let createTokenExtractor = (): ChannelTokenExtractorLike => new ChannelTokenExtractor()
|
|
61
64
|
|
|
62
65
|
export function setChannelAuthCommandDependenciesForTesting(dependencies: {
|
|
63
|
-
createChannelClient?: (
|
|
66
|
+
createChannelClient?: (
|
|
67
|
+
accountCookie: string,
|
|
68
|
+
sessionCookie?: string,
|
|
69
|
+
) => ChannelClientLike | Promise<ChannelClientLike>
|
|
64
70
|
createCredentialManager?: () => ChannelCredentialManagerLike
|
|
65
71
|
createTokenExtractor?: () => ChannelTokenExtractorLike
|
|
66
72
|
}): void {
|
|
@@ -154,7 +160,9 @@ export async function statusAction(options: ActionOptions = {}): Promise<StatusR
|
|
|
154
160
|
}
|
|
155
161
|
}
|
|
156
162
|
|
|
157
|
-
const storedWorkspace = (await credManager.listAll()).find(
|
|
163
|
+
const storedWorkspace = (await credManager.listAll()).find(
|
|
164
|
+
(workspace) => workspace.workspace_id === creds.workspace_id,
|
|
165
|
+
)
|
|
158
166
|
|
|
159
167
|
try {
|
|
160
168
|
const client = await createChannelClient(creds.account_cookie, creds.session_cookie ?? undefined)
|
|
@@ -205,7 +213,10 @@ export async function listAction(options: ActionOptions = {}): Promise<Workspace
|
|
|
205
213
|
}
|
|
206
214
|
}
|
|
207
215
|
|
|
208
|
-
export async function useAction(
|
|
216
|
+
export async function useAction(
|
|
217
|
+
workspaceId: string,
|
|
218
|
+
options: ActionOptions = {},
|
|
219
|
+
): Promise<SuccessResult | ErrorResult> {
|
|
209
220
|
try {
|
|
210
221
|
const credManager = options._credManager ?? createCredentialManager()
|
|
211
222
|
const found = await credManager.setCurrent(workspaceId)
|
|
@@ -223,7 +234,10 @@ export async function useAction(workspaceId: string, options: ActionOptions = {}
|
|
|
223
234
|
}
|
|
224
235
|
}
|
|
225
236
|
|
|
226
|
-
export async function removeAction(
|
|
237
|
+
export async function removeAction(
|
|
238
|
+
workspaceId: string,
|
|
239
|
+
options: ActionOptions = {},
|
|
240
|
+
): Promise<SuccessResult | ErrorResult> {
|
|
227
241
|
try {
|
|
228
242
|
const credManager = options._credManager ?? createCredentialManager()
|
|
229
243
|
const removed = await credManager.removeWorkspace(workspaceId)
|
|
@@ -309,9 +309,7 @@ describe('message commands', () => {
|
|
|
309
309
|
test('sendAction sends a group message with wrapped blocks', async () => {
|
|
310
310
|
const result = await sendAction('group', 'grp-1', 'Hello group')
|
|
311
311
|
|
|
312
|
-
expect(mockSendGroupMessage).toHaveBeenCalledWith('ws-1', 'grp-1', [
|
|
313
|
-
{ type: 'text', value: 'Hello group' },
|
|
314
|
-
])
|
|
312
|
+
expect(mockSendGroupMessage).toHaveBeenCalledWith('ws-1', 'grp-1', [{ type: 'text', value: 'Hello group' }])
|
|
315
313
|
expect(result).toMatchObject({
|
|
316
314
|
id: 'msg-group-1',
|
|
317
315
|
channel_id: 'ws-1',
|
|
@@ -324,9 +322,7 @@ describe('message commands', () => {
|
|
|
324
322
|
test('sendAction sends a user chat message with wrapped blocks', async () => {
|
|
325
323
|
const result = await sendAction('user-chat', 'chat-1', 'Hello user chat')
|
|
326
324
|
|
|
327
|
-
expect(mockSendUserChatMessage).toHaveBeenCalledWith('ws-1', 'chat-1', [
|
|
328
|
-
{ type: 'text', value: 'Hello user chat' },
|
|
329
|
-
])
|
|
325
|
+
expect(mockSendUserChatMessage).toHaveBeenCalledWith('ws-1', 'chat-1', [{ type: 'text', value: 'Hello user chat' }])
|
|
330
326
|
expect(result).toMatchObject({
|
|
331
327
|
id: 'msg-user-1',
|
|
332
328
|
channel_id: 'ws-1',
|
|
@@ -70,7 +70,11 @@ export async function sendAction(
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
export async function listAction(
|
|
73
|
+
export async function listAction(
|
|
74
|
+
chatType: ChatType,
|
|
75
|
+
chatId: string,
|
|
76
|
+
options: MessageOptions = {},
|
|
77
|
+
): Promise<MessageResult> {
|
|
74
78
|
try {
|
|
75
79
|
const client = await getClient(options)
|
|
76
80
|
const channelId = await getCurrentWorkspaceId(options)
|