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
|
@@ -2,9 +2,20 @@ import { beforeEach, describe, expect, mock, test } from 'bun:test'
|
|
|
2
2
|
|
|
3
3
|
const mockGetChannel = mock(() => Promise.resolve({ id: 'ws-1', name: 'Workspace One' }))
|
|
4
4
|
const mockListManagers = mock(() =>
|
|
5
|
-
Promise.resolve([
|
|
5
|
+
Promise.resolve([
|
|
6
|
+
{
|
|
7
|
+
id: 'mgr-1',
|
|
8
|
+
channelId: 'ws-1',
|
|
9
|
+
accountId: 'acct-1',
|
|
10
|
+
name: 'Alice',
|
|
11
|
+
email: 'alice@example.com',
|
|
12
|
+
roleId: 'role-1',
|
|
13
|
+
},
|
|
14
|
+
]),
|
|
15
|
+
)
|
|
16
|
+
const mockListBots = mock(() =>
|
|
17
|
+
Promise.resolve([{ id: 'bot-1', channelId: 'ws-1', name: 'Support Bot', avatarUrl: 'https://example.com/bot.png' }]),
|
|
6
18
|
)
|
|
7
|
-
const mockListBots = mock(() => Promise.resolve([{ id: 'bot-1', channelId: 'ws-1', name: 'Support Bot', avatarUrl: 'https://example.com/bot.png' }]))
|
|
8
19
|
const mockListGroups = mock(() =>
|
|
9
20
|
Promise.resolve([
|
|
10
21
|
{ id: 'grp-1', channelId: 'ws-1', name: 'Support' },
|
|
@@ -34,9 +45,13 @@ const mockListUserChats = mock((_: string, params?: { state?: string; limit?: nu
|
|
|
34
45
|
{ id: 'chat-2', channelId: 'ws-1', state: 'opened', assigneeId: 'mgr-2', createdAt: 110, updatedAt: 210 },
|
|
35
46
|
])
|
|
36
47
|
case 'snoozed':
|
|
37
|
-
return Promise.resolve([
|
|
48
|
+
return Promise.resolve([
|
|
49
|
+
{ id: 'chat-3', channelId: 'ws-1', state: 'snoozed', assigneeId: 'mgr-1', createdAt: 120, updatedAt: 220 },
|
|
50
|
+
])
|
|
38
51
|
case 'closed':
|
|
39
|
-
return Promise.resolve([
|
|
52
|
+
return Promise.resolve([
|
|
53
|
+
{ id: 'chat-4', channelId: 'ws-1', state: 'closed', assigneeId: 'mgr-2', createdAt: 130, updatedAt: 230 },
|
|
54
|
+
])
|
|
40
55
|
default:
|
|
41
56
|
return Promise.resolve([])
|
|
42
57
|
}
|
|
@@ -66,9 +81,54 @@ describe('snapshot command', () => {
|
|
|
66
81
|
mockListUserChats.mockClear()
|
|
67
82
|
})
|
|
68
83
|
|
|
69
|
-
test('returns workspace,
|
|
84
|
+
test('brief snapshot returns workspace, groups (name only), chat counts, and hint', async () => {
|
|
70
85
|
const result = await snapshotAction()
|
|
71
86
|
|
|
87
|
+
expect(result.error).toBeUndefined()
|
|
88
|
+
expect(result.workspace).toEqual({ id: 'ws-1', name: 'Workspace One' })
|
|
89
|
+
expect(result.groups).toEqual([
|
|
90
|
+
{ id: 'grp-1', name: 'Support' },
|
|
91
|
+
{ id: 'grp-2', name: 'Sales' },
|
|
92
|
+
])
|
|
93
|
+
expect(result.user_chats).toEqual({
|
|
94
|
+
total: 4,
|
|
95
|
+
by_state: { opened: 2, snoozed: 1, closed: 1 },
|
|
96
|
+
})
|
|
97
|
+
expect(result.hint).toBeDefined()
|
|
98
|
+
expect(result.managers).toBeUndefined()
|
|
99
|
+
expect(result.bots).toBeUndefined()
|
|
100
|
+
expect(mockGetGroupMessages).not.toHaveBeenCalled()
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
test('brief groups-only returns group names without messages', async () => {
|
|
104
|
+
const result = await snapshotAction({ groupsOnly: true })
|
|
105
|
+
|
|
106
|
+
expect(result.workspace).toEqual({ id: 'ws-1', name: 'Workspace One' })
|
|
107
|
+
expect(result.groups).toHaveLength(2)
|
|
108
|
+
expect(result.groups?.[0]).toEqual({ id: 'grp-1', name: 'Support' })
|
|
109
|
+
expect(result.hint).toBeDefined()
|
|
110
|
+
expect(result.user_chats).toBeUndefined()
|
|
111
|
+
expect(mockGetGroupMessages).not.toHaveBeenCalled()
|
|
112
|
+
expect(mockListUserChats).not.toHaveBeenCalled()
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
test('brief chats-only returns counts without recent details', async () => {
|
|
116
|
+
const result = await snapshotAction({ chatsOnly: true })
|
|
117
|
+
|
|
118
|
+
expect(result.workspace).toEqual({ id: 'ws-1', name: 'Workspace One' })
|
|
119
|
+
expect(result.groups).toBeUndefined()
|
|
120
|
+
expect(result.user_chats).toEqual({
|
|
121
|
+
total: 4,
|
|
122
|
+
by_state: { opened: 2, snoozed: 1, closed: 1 },
|
|
123
|
+
})
|
|
124
|
+
expect(result.hint).toBeDefined()
|
|
125
|
+
expect(mockListGroups).not.toHaveBeenCalled()
|
|
126
|
+
expect(mockGetGroupMessages).not.toHaveBeenCalled()
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
test('full snapshot returns workspace, managers, bots, groups, and user chats', async () => {
|
|
130
|
+
const result = await snapshotAction({ full: true })
|
|
131
|
+
|
|
72
132
|
expect(result.error).toBeUndefined()
|
|
73
133
|
expect(result).toEqual({
|
|
74
134
|
workspace: { id: 'ws-1', name: 'Workspace One' },
|
|
@@ -141,19 +201,21 @@ describe('snapshot command', () => {
|
|
|
141
201
|
})
|
|
142
202
|
})
|
|
143
203
|
|
|
144
|
-
test('groups-only
|
|
145
|
-
const result = await snapshotAction({ groupsOnly: true })
|
|
204
|
+
test('full groups-only includes messages', async () => {
|
|
205
|
+
const result = await snapshotAction({ full: true, groupsOnly: true, limit: 3 })
|
|
146
206
|
|
|
147
|
-
expect(
|
|
148
|
-
expect(
|
|
149
|
-
expect(result.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
207
|
+
expect(mockGetGroupMessages).toHaveBeenCalledWith('ws-1', 'grp-1', { limit: 3, sortOrder: 'desc' })
|
|
208
|
+
expect(mockGetGroupMessages).toHaveBeenCalledWith('ws-1', 'grp-2', { limit: 3, sortOrder: 'desc' })
|
|
209
|
+
expect(result.groups?.[0].recent_messages?.[0]).toEqual({
|
|
210
|
+
id: 'grp-1-msg-1',
|
|
211
|
+
person_type: 'manager',
|
|
212
|
+
plain_text: 'Message for grp-1',
|
|
213
|
+
created_at: 1000,
|
|
214
|
+
})
|
|
153
215
|
})
|
|
154
216
|
|
|
155
|
-
test('chats-only
|
|
156
|
-
const result = await snapshotAction({ chatsOnly: true, limit: 1 })
|
|
217
|
+
test('full chats-only includes recent details', async () => {
|
|
218
|
+
const result = await snapshotAction({ full: true, chatsOnly: true, limit: 1 })
|
|
157
219
|
|
|
158
220
|
expect(result.workspace).toEqual({ id: 'ws-1', name: 'Workspace One' })
|
|
159
221
|
expect(result.groups).toBeUndefined()
|
|
@@ -174,20 +236,5 @@ describe('snapshot command', () => {
|
|
|
174
236
|
},
|
|
175
237
|
],
|
|
176
238
|
})
|
|
177
|
-
expect(mockListGroups).not.toHaveBeenCalled()
|
|
178
|
-
expect(mockGetGroupMessages).not.toHaveBeenCalled()
|
|
179
|
-
})
|
|
180
|
-
|
|
181
|
-
test('includes recent messages for each group with requested limit', async () => {
|
|
182
|
-
const result = await snapshotAction({ groupsOnly: true, limit: 3 })
|
|
183
|
-
|
|
184
|
-
expect(mockGetGroupMessages).toHaveBeenCalledWith('ws-1', 'grp-1', { limit: 3, sortOrder: 'desc' })
|
|
185
|
-
expect(mockGetGroupMessages).toHaveBeenCalledWith('ws-1', 'grp-2', { limit: 3, sortOrder: 'desc' })
|
|
186
|
-
expect(result.groups?.[0].recent_messages[0]).toEqual({
|
|
187
|
-
id: 'grp-1-msg-1',
|
|
188
|
-
person_type: 'manager',
|
|
189
|
-
plain_text: 'Message for grp-1',
|
|
190
|
-
created_at: 1000,
|
|
191
|
-
})
|
|
192
239
|
})
|
|
193
240
|
})
|
|
@@ -10,6 +10,7 @@ interface SnapshotOptions {
|
|
|
10
10
|
pretty?: boolean
|
|
11
11
|
groupsOnly?: boolean
|
|
12
12
|
chatsOnly?: boolean
|
|
13
|
+
full?: boolean
|
|
13
14
|
limit?: number | string
|
|
14
15
|
}
|
|
15
16
|
|
|
@@ -33,7 +34,7 @@ interface SnapshotResult {
|
|
|
33
34
|
groups?: Array<{
|
|
34
35
|
id: string
|
|
35
36
|
name: string
|
|
36
|
-
recent_messages
|
|
37
|
+
recent_messages?: Array<{
|
|
37
38
|
id: string
|
|
38
39
|
person_type?: string
|
|
39
40
|
plain_text?: string
|
|
@@ -43,7 +44,7 @@ interface SnapshotResult {
|
|
|
43
44
|
user_chats?: {
|
|
44
45
|
total: number
|
|
45
46
|
by_state: Record<string, number>
|
|
46
|
-
recent
|
|
47
|
+
recent?: Array<{
|
|
47
48
|
id: string
|
|
48
49
|
state?: string
|
|
49
50
|
assignee_id?: string
|
|
@@ -51,6 +52,7 @@ interface SnapshotResult {
|
|
|
51
52
|
updated_at?: number
|
|
52
53
|
}>
|
|
53
54
|
}
|
|
55
|
+
hint?: string
|
|
54
56
|
error?: string
|
|
55
57
|
}
|
|
56
58
|
|
|
@@ -58,7 +60,6 @@ export async function snapshotAction(options: SnapshotOptions = {}): Promise<Sna
|
|
|
58
60
|
try {
|
|
59
61
|
const client = await getClient(options)
|
|
60
62
|
const workspaceId = await getCurrentWorkspaceId(options)
|
|
61
|
-
const limit = parseLimit(options.limit)
|
|
62
63
|
|
|
63
64
|
const channel = await client.getChannel(workspaceId)
|
|
64
65
|
const workspace = {
|
|
@@ -66,42 +67,114 @@ export async function snapshotAction(options: SnapshotOptions = {}): Promise<Sna
|
|
|
66
67
|
name: channel.name,
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
if (options.
|
|
70
|
-
|
|
71
|
-
return { workspace, groups }
|
|
70
|
+
if (options.full) {
|
|
71
|
+
return buildFullSnapshot(client, workspaceId, workspace, options)
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
return buildBriefSnapshot(client, workspaceId, workspace, options)
|
|
75
|
+
} catch (error) {
|
|
76
|
+
return { error: (error as Error).message }
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async function buildBriefSnapshot(
|
|
81
|
+
client: Awaited<ReturnType<typeof getClient>>,
|
|
82
|
+
workspaceId: string,
|
|
83
|
+
workspace: { id: string; name: string },
|
|
84
|
+
options: SnapshotOptions,
|
|
85
|
+
): Promise<SnapshotResult> {
|
|
86
|
+
if (options.groupsOnly) {
|
|
87
|
+
const groups = await client.listGroups(workspaceId, { limit: 20 })
|
|
88
|
+
return {
|
|
89
|
+
workspace,
|
|
90
|
+
groups: groups.map((g) => ({ id: g.id, name: g.name })),
|
|
91
|
+
hint: "Use 'group messages <group>' for messages.",
|
|
77
92
|
}
|
|
93
|
+
}
|
|
78
94
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
client.
|
|
82
|
-
|
|
83
|
-
|
|
95
|
+
if (options.chatsOnly) {
|
|
96
|
+
const [openedChats, snoozedChats, closedChats] = await Promise.all([
|
|
97
|
+
client.listUserChats(workspaceId, { state: 'opened', limit: 100 }),
|
|
98
|
+
client.listUserChats(workspaceId, { state: 'snoozed', limit: 100 }),
|
|
99
|
+
client.listUserChats(workspaceId, { state: 'closed', limit: 100 }),
|
|
84
100
|
])
|
|
85
|
-
|
|
86
101
|
return {
|
|
87
102
|
workspace,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
name: bot.name,
|
|
98
|
-
avatar_url: bot.avatarUrl,
|
|
99
|
-
})),
|
|
100
|
-
groups,
|
|
101
|
-
user_chats: userChats,
|
|
103
|
+
user_chats: {
|
|
104
|
+
total: openedChats.length + snoozedChats.length + closedChats.length,
|
|
105
|
+
by_state: {
|
|
106
|
+
opened: openedChats.length,
|
|
107
|
+
snoozed: snoozedChats.length,
|
|
108
|
+
closed: closedChats.length,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
hint: "Use 'chat list --state opened' for chat details, 'chat messages <chat>' for messages.",
|
|
102
112
|
}
|
|
103
|
-
}
|
|
104
|
-
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const [groups, openedChats, snoozedChats, closedChats] = await Promise.all([
|
|
116
|
+
client.listGroups(workspaceId, { limit: 20 }),
|
|
117
|
+
client.listUserChats(workspaceId, { state: 'opened', limit: 100 }),
|
|
118
|
+
client.listUserChats(workspaceId, { state: 'snoozed', limit: 100 }),
|
|
119
|
+
client.listUserChats(workspaceId, { state: 'closed', limit: 100 }),
|
|
120
|
+
])
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
workspace,
|
|
124
|
+
groups: groups.map((g) => ({ id: g.id, name: g.name })),
|
|
125
|
+
user_chats: {
|
|
126
|
+
total: openedChats.length + snoozedChats.length + closedChats.length,
|
|
127
|
+
by_state: {
|
|
128
|
+
opened: openedChats.length,
|
|
129
|
+
snoozed: snoozedChats.length,
|
|
130
|
+
closed: closedChats.length,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
hint: "Use 'group messages <group>' for group messages, 'chat list --state opened' for chats, 'manager list' for managers.",
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
async function buildFullSnapshot(
|
|
138
|
+
client: Awaited<ReturnType<typeof getClient>>,
|
|
139
|
+
workspaceId: string,
|
|
140
|
+
workspace: { id: string; name: string },
|
|
141
|
+
options: SnapshotOptions,
|
|
142
|
+
): Promise<SnapshotResult> {
|
|
143
|
+
const limit = parseLimit(options.limit)
|
|
144
|
+
|
|
145
|
+
if (options.groupsOnly) {
|
|
146
|
+
const groups = await buildGroupsSnapshot(client, workspaceId, limit)
|
|
147
|
+
return { workspace, groups }
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (options.chatsOnly) {
|
|
151
|
+
const userChats = await buildUserChatsSnapshot(client, workspaceId, limit)
|
|
152
|
+
return { workspace, user_chats: userChats }
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const [managers, bots, groups, userChats] = await Promise.all([
|
|
156
|
+
client.listManagers(workspaceId, { limit: 50 }),
|
|
157
|
+
client.listBots(workspaceId, { limit: 50 }),
|
|
158
|
+
buildGroupsSnapshot(client, workspaceId, limit),
|
|
159
|
+
buildUserChatsSnapshot(client, workspaceId, limit),
|
|
160
|
+
])
|
|
161
|
+
|
|
162
|
+
return {
|
|
163
|
+
workspace,
|
|
164
|
+
managers: managers.map((manager) => ({
|
|
165
|
+
id: manager.id,
|
|
166
|
+
name: manager.name,
|
|
167
|
+
email: manager.email,
|
|
168
|
+
account_id: manager.accountId,
|
|
169
|
+
role_id: manager.roleId,
|
|
170
|
+
})),
|
|
171
|
+
bots: bots.map((bot) => ({
|
|
172
|
+
id: bot.id,
|
|
173
|
+
name: bot.name,
|
|
174
|
+
avatar_url: bot.avatarUrl,
|
|
175
|
+
})),
|
|
176
|
+
groups,
|
|
177
|
+
user_chats: userChats,
|
|
105
178
|
}
|
|
106
179
|
}
|
|
107
180
|
|
|
@@ -141,7 +214,11 @@ async function buildGroupsSnapshot(client: Awaited<ReturnType<typeof getClient>>
|
|
|
141
214
|
)
|
|
142
215
|
}
|
|
143
216
|
|
|
144
|
-
async function buildUserChatsSnapshot(
|
|
217
|
+
async function buildUserChatsSnapshot(
|
|
218
|
+
client: Awaited<ReturnType<typeof getClient>>,
|
|
219
|
+
workspaceId: string,
|
|
220
|
+
limit: number,
|
|
221
|
+
) {
|
|
145
222
|
const [openedChats, snoozedChats, closedChats] = await Promise.all([
|
|
146
223
|
client.listUserChats(workspaceId, { state: 'opened', limit: 100 }),
|
|
147
224
|
client.listUserChats(workspaceId, { state: 'snoozed', limit: 100 }),
|
|
@@ -174,10 +251,11 @@ function cliOutput(result: SnapshotResult, pretty?: boolean): void {
|
|
|
174
251
|
|
|
175
252
|
export function createSnapshotCommand(): Command {
|
|
176
253
|
return new Command('snapshot')
|
|
177
|
-
.description('Workspace overview for AI
|
|
254
|
+
.description('Workspace overview for AI agents (brief by default, use --full for comprehensive data)')
|
|
255
|
+
.option('--full', 'Include messages, managers, and bots (verbose)')
|
|
178
256
|
.option('--groups-only', 'List groups only, skip user chats')
|
|
179
257
|
.option('--chats-only', 'List user chats only, skip groups')
|
|
180
|
-
.option('--limit <n>', 'Messages per group and recent opened chats', '5')
|
|
258
|
+
.option('--limit <n>', 'Messages per group and recent opened chats with --full', '5')
|
|
181
259
|
.option('--workspace <id>', 'Workspace ID')
|
|
182
260
|
.option('--pretty', 'Pretty print JSON output')
|
|
183
261
|
.action(async (options: SnapshotOptions) => {
|
|
@@ -6,15 +6,14 @@ import {
|
|
|
6
6
|
setEnsureChannelAuthDependenciesForTesting,
|
|
7
7
|
} from './ensure-auth'
|
|
8
8
|
|
|
9
|
-
const mockGetCredentials = mock<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
>>(() => Promise.resolve(null))
|
|
9
|
+
const mockGetCredentials = mock<
|
|
10
|
+
() => Promise<{
|
|
11
|
+
workspace_id: string
|
|
12
|
+
workspace_name: string
|
|
13
|
+
account_cookie: string
|
|
14
|
+
session_cookie: string
|
|
15
|
+
} | null>
|
|
16
|
+
>(() => Promise.resolve(null))
|
|
18
17
|
const mockSetCredentials = mock(() => Promise.resolve())
|
|
19
18
|
const mockSetCurrent = mock(() => Promise.resolve(true))
|
|
20
19
|
const mockExtract = mock(() => Promise.resolve([]))
|
|
@@ -65,10 +64,12 @@ describe('ensureChannelAuth', () => {
|
|
|
65
64
|
|
|
66
65
|
test('extracts and saves workspaces when no credentials exist', async () => {
|
|
67
66
|
mockExtract.mockImplementation(() =>
|
|
68
|
-
Promise.resolve([
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
Promise.resolve([
|
|
68
|
+
{
|
|
69
|
+
accountCookie: 'account-cookie',
|
|
70
|
+
sessionCookie: 'session-cookie',
|
|
71
|
+
},
|
|
72
|
+
]),
|
|
72
73
|
)
|
|
73
74
|
mockListChannels.mockImplementation(() =>
|
|
74
75
|
Promise.resolve([
|
|
@@ -128,10 +129,12 @@ describe('ensureChannelAuth', () => {
|
|
|
128
129
|
)
|
|
129
130
|
mockGetAccount.mockImplementationOnce(() => Promise.reject(new Error('Unauthorized')))
|
|
130
131
|
mockExtract.mockImplementation(() =>
|
|
131
|
-
Promise.resolve([
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
Promise.resolve([
|
|
133
|
+
{
|
|
134
|
+
accountCookie: 'fresh-account',
|
|
135
|
+
sessionCookie: 'fresh-session',
|
|
136
|
+
},
|
|
137
|
+
]),
|
|
135
138
|
)
|
|
136
139
|
|
|
137
140
|
await ensureChannelAuth()
|
|
@@ -3,13 +3,13 @@ import { ChannelCredentialManager } from './credential-manager'
|
|
|
3
3
|
import { ChannelTokenExtractor } from './token-extractor'
|
|
4
4
|
|
|
5
5
|
type ChannelClientLike = Pick<ChannelClient, 'getAccount' | 'listChannels'>
|
|
6
|
-
type ChannelCredentialManagerLike = Pick<
|
|
7
|
-
ChannelCredentialManager,
|
|
8
|
-
'getCredentials' | 'setCredentials' | 'setCurrent'
|
|
9
|
-
>
|
|
6
|
+
type ChannelCredentialManagerLike = Pick<ChannelCredentialManager, 'getCredentials' | 'setCredentials' | 'setCurrent'>
|
|
10
7
|
type ChannelTokenExtractorLike = Pick<ChannelTokenExtractor, 'extract'>
|
|
11
8
|
|
|
12
|
-
let createChannelClient: (
|
|
9
|
+
let createChannelClient: (
|
|
10
|
+
accountCookie: string,
|
|
11
|
+
sessionCookie?: string,
|
|
12
|
+
) => ChannelClientLike | Promise<ChannelClientLike> = async (
|
|
13
13
|
accountCookie: string,
|
|
14
14
|
sessionCookie?: string,
|
|
15
15
|
): Promise<ChannelClientLike> => new ChannelClient().login({ accountCookie, sessionCookie })
|
|
@@ -38,8 +38,7 @@ export const setEnsureChannelAuthClientFactoryForTesting = (
|
|
|
38
38
|
factory: (accountCookie: string, sessionCookie?: string) => ChannelClientLike | Promise<ChannelClientLike>,
|
|
39
39
|
): void => setEnsureChannelAuthDependenciesForTesting({ createClient: factory })
|
|
40
40
|
|
|
41
|
-
export const resetEnsureChannelAuthClientFactoryForTesting = (): void =>
|
|
42
|
-
resetEnsureChannelAuthDependenciesForTesting()
|
|
41
|
+
export const resetEnsureChannelAuthClientFactoryForTesting = (): void => resetEnsureChannelAuthDependenciesForTesting()
|
|
43
42
|
|
|
44
43
|
export async function ensureChannelAuth(): Promise<void> {
|
|
45
44
|
try {
|
|
@@ -62,13 +62,7 @@ describe('ChannelTokenExtractor', () => {
|
|
|
62
62
|
const extractor = new ChannelTokenExtractor('darwin')
|
|
63
63
|
const paths = extractor.getBrowserCookiesPaths()
|
|
64
64
|
|
|
65
|
-
const chromeBase = join(
|
|
66
|
-
process.env.HOME || '/tmp',
|
|
67
|
-
'Library',
|
|
68
|
-
'Application Support',
|
|
69
|
-
'Google',
|
|
70
|
-
'Chrome',
|
|
71
|
-
)
|
|
65
|
+
const chromeBase = join(process.env.HOME || '/tmp', 'Library', 'Application Support', 'Google', 'Chrome')
|
|
72
66
|
expect(paths).toContain(join(chromeBase, 'Default', 'Cookies'))
|
|
73
67
|
expect(paths).toContain(join(chromeBase, 'Default', 'Network', 'Cookies'))
|
|
74
68
|
})
|
|
@@ -132,10 +126,12 @@ describe('ChannelTokenExtractor', () => {
|
|
|
132
126
|
const extractor = new ChannelTokenExtractor('darwin')
|
|
133
127
|
|
|
134
128
|
const desktopSpy = spyOn(extractor as any, 'extractFromDesktopApp').mockResolvedValue(null)
|
|
135
|
-
const browserSpy = spyOn(extractor as any, 'extractAllFromBrowserPaths').mockResolvedValue([
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
129
|
+
const browserSpy = spyOn(extractor as any, 'extractAllFromBrowserPaths').mockResolvedValue([
|
|
130
|
+
{
|
|
131
|
+
accountCookie: 'browser-account',
|
|
132
|
+
sessionCookie: undefined,
|
|
133
|
+
},
|
|
134
|
+
])
|
|
139
135
|
|
|
140
136
|
const result = await extractor.extract()
|
|
141
137
|
|
|
@@ -169,10 +165,12 @@ describe('ChannelTokenExtractor', () => {
|
|
|
169
165
|
|
|
170
166
|
const extractor = new TestExtractor(dbPath)
|
|
171
167
|
|
|
172
|
-
expect(await extractor.extract()).toEqual([
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
168
|
+
expect(await extractor.extract()).toEqual([
|
|
169
|
+
{
|
|
170
|
+
accountCookie: 'account-jwt',
|
|
171
|
+
sessionCookie: 'session-jwt',
|
|
172
|
+
},
|
|
173
|
+
])
|
|
176
174
|
})
|
|
177
175
|
|
|
178
176
|
test('returns token with undefined sessionCookie when only x-account is present', async () => {
|
|
@@ -265,7 +263,10 @@ describe('ChannelTokenExtractor', () => {
|
|
|
265
263
|
|
|
266
264
|
const localStatePath = join(tempDir, 'Local State')
|
|
267
265
|
const fakeEncryptedKey = Buffer.concat([Buffer.from('DPAPI'), randomBytes(32)])
|
|
268
|
-
writeFileSync(
|
|
266
|
+
writeFileSync(
|
|
267
|
+
localStatePath,
|
|
268
|
+
JSON.stringify({ os_crypt: { encrypted_key: fakeEncryptedKey.toString('base64') } }),
|
|
269
|
+
)
|
|
269
270
|
|
|
270
271
|
const extractor = new TestWinExtractor(dbPath, masterKey)
|
|
271
272
|
const result = await extractor.extract()
|
|
@@ -283,10 +284,12 @@ describe('ChannelTokenExtractor', () => {
|
|
|
283
284
|
accountCookie: 'same-account-cookie',
|
|
284
285
|
sessionCookie: 'desktop-session',
|
|
285
286
|
})
|
|
286
|
-
const browserSpy = spyOn(extractor as any, 'extractAllFromBrowserPaths').mockResolvedValue([
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
287
|
+
const browserSpy = spyOn(extractor as any, 'extractAllFromBrowserPaths').mockResolvedValue([
|
|
288
|
+
{
|
|
289
|
+
accountCookie: 'same-account-cookie',
|
|
290
|
+
sessionCookie: 'browser-session',
|
|
291
|
+
},
|
|
292
|
+
])
|
|
290
293
|
|
|
291
294
|
const result = await extractor.extract()
|
|
292
295
|
expect(result).toHaveLength(1)
|
|
@@ -303,10 +306,12 @@ describe('ChannelTokenExtractor', () => {
|
|
|
303
306
|
accountCookie: 'desktop-account-cookie',
|
|
304
307
|
sessionCookie: 'desktop-session',
|
|
305
308
|
})
|
|
306
|
-
const browserSpy = spyOn(extractor as any, 'extractAllFromBrowserPaths').mockResolvedValue([
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
309
|
+
const browserSpy = spyOn(extractor as any, 'extractAllFromBrowserPaths').mockResolvedValue([
|
|
310
|
+
{
|
|
311
|
+
accountCookie: 'browser-account-cookie',
|
|
312
|
+
sessionCookie: 'browser-session',
|
|
313
|
+
},
|
|
314
|
+
])
|
|
310
315
|
|
|
311
316
|
const result = await extractor.extract()
|
|
312
317
|
expect(result).toHaveLength(2)
|
|
@@ -350,7 +355,10 @@ describe('ChannelTokenExtractor', () => {
|
|
|
350
355
|
|
|
351
356
|
const localStatePath = join(tempDir, 'Local State')
|
|
352
357
|
const fakeEncryptedKey = Buffer.concat([Buffer.from('DPAPI'), randomBytes(32)])
|
|
353
|
-
writeFileSync(
|
|
358
|
+
writeFileSync(
|
|
359
|
+
localStatePath,
|
|
360
|
+
JSON.stringify({ os_crypt: { encrypted_key: fakeEncryptedKey.toString('base64') } }),
|
|
361
|
+
)
|
|
354
362
|
|
|
355
363
|
const extractor = new FailingDPAPIExtractor(dbPath)
|
|
356
364
|
const result = await extractor.extract()
|