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
|
@@ -7,61 +7,16 @@ import { join } from 'node:path'
|
|
|
7
7
|
|
|
8
8
|
import { ClassicLevel } from 'classic-level'
|
|
9
9
|
|
|
10
|
+
import {
|
|
11
|
+
CHROMIUM_BROWSERS,
|
|
12
|
+
ChromiumCookieDecryptor,
|
|
13
|
+
ChromiumCookieReader,
|
|
14
|
+
discoverBrowserProfileDirs,
|
|
15
|
+
getBrowserBasePath,
|
|
16
|
+
} from '@/shared/chromium'
|
|
10
17
|
import { DerivedKeyCache } from '@/shared/utils/derived-key-cache'
|
|
11
18
|
import { lookupLinuxKeyringPassword } from '@/shared/utils/linux-keyring'
|
|
12
19
|
|
|
13
|
-
interface BrowserConfig {
|
|
14
|
-
name: string
|
|
15
|
-
darwin: string
|
|
16
|
-
linux: string
|
|
17
|
-
win32: string
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const BROWSERS: BrowserConfig[] = [
|
|
21
|
-
{
|
|
22
|
-
name: 'Chrome',
|
|
23
|
-
darwin: join('Google', 'Chrome'),
|
|
24
|
-
linux: 'google-chrome',
|
|
25
|
-
win32: join('Google', 'Chrome', 'User Data'),
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: 'Chrome Canary',
|
|
29
|
-
darwin: join('Google', 'Chrome Canary'),
|
|
30
|
-
linux: 'google-chrome-unstable',
|
|
31
|
-
win32: join('Google', 'Chrome SxS', 'User Data'),
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: 'Edge',
|
|
35
|
-
darwin: 'Microsoft Edge',
|
|
36
|
-
linux: 'microsoft-edge',
|
|
37
|
-
win32: join('Microsoft', 'Edge', 'User Data'),
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: 'Arc',
|
|
41
|
-
darwin: join('Arc', 'User Data'),
|
|
42
|
-
linux: '',
|
|
43
|
-
win32: join('Arc', 'User Data'),
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: 'Brave',
|
|
47
|
-
darwin: join('BraveSoftware', 'Brave-Browser'),
|
|
48
|
-
linux: join('BraveSoftware', 'Brave-Browser'),
|
|
49
|
-
win32: join('BraveSoftware', 'Brave-Browser', 'User Data'),
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: 'Vivaldi',
|
|
53
|
-
darwin: 'Vivaldi',
|
|
54
|
-
linux: 'vivaldi',
|
|
55
|
-
win32: join('Vivaldi', 'User Data'),
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: 'Chromium',
|
|
59
|
-
darwin: 'Chromium',
|
|
60
|
-
linux: 'chromium',
|
|
61
|
-
win32: join('Chromium', 'User Data'),
|
|
62
|
-
},
|
|
63
|
-
]
|
|
64
|
-
|
|
65
20
|
const require = createRequire(import.meta.url)
|
|
66
21
|
|
|
67
22
|
export interface ExtractedWorkspace {
|
|
@@ -106,6 +61,8 @@ export class TokenExtractor {
|
|
|
106
61
|
private slackDir: string
|
|
107
62
|
private keyCache: DerivedKeyCache
|
|
108
63
|
private debugLog: ((message: string) => void) | null
|
|
64
|
+
private browserDecryptor: ChromiumCookieDecryptor
|
|
65
|
+
private browserCookieReader: ChromiumCookieReader
|
|
109
66
|
|
|
110
67
|
constructor(
|
|
111
68
|
platform?: NodeJS.Platform,
|
|
@@ -122,6 +79,8 @@ export class TokenExtractor {
|
|
|
122
79
|
this.slackDir = slackDir ?? this.getSlackDir()
|
|
123
80
|
this.keyCache = keyCache ?? new DerivedKeyCache()
|
|
124
81
|
this.debugLog = debugLog ?? null
|
|
82
|
+
this.browserDecryptor = new ChromiumCookieDecryptor({ platform: this.platform })
|
|
83
|
+
this.browserCookieReader = new ChromiumCookieReader()
|
|
125
84
|
}
|
|
126
85
|
|
|
127
86
|
private debug(message: string): void {
|
|
@@ -267,11 +226,11 @@ export class TokenExtractor {
|
|
|
267
226
|
const results: ExtractedWorkspace[] = []
|
|
268
227
|
const seenTokens = new Set<string>()
|
|
269
228
|
|
|
270
|
-
for (const browser of
|
|
271
|
-
const browserBase =
|
|
229
|
+
for (const browser of CHROMIUM_BROWSERS) {
|
|
230
|
+
const browserBase = getBrowserBasePath(browser, this.platform)
|
|
272
231
|
if (!browserBase) continue
|
|
273
232
|
|
|
274
|
-
const profileDirs =
|
|
233
|
+
const profileDirs = discoverBrowserProfileDirs(browserBase)
|
|
275
234
|
for (const profileDir of profileDirs) {
|
|
276
235
|
const leveldbDir = join(profileDir, 'Local Storage', 'leveldb')
|
|
277
236
|
if (!existsSync(leveldbDir)) continue
|
|
@@ -303,54 +262,8 @@ export class TokenExtractor {
|
|
|
303
262
|
return results
|
|
304
263
|
}
|
|
305
264
|
|
|
306
|
-
private getBrowserBasePath(browser: BrowserConfig): string | null {
|
|
307
|
-
let relative: string
|
|
308
|
-
|
|
309
|
-
switch (this.platform) {
|
|
310
|
-
case 'darwin':
|
|
311
|
-
relative = browser.darwin
|
|
312
|
-
if (!relative) return null
|
|
313
|
-
return join(homedir(), 'Library', 'Application Support', relative)
|
|
314
|
-
case 'linux':
|
|
315
|
-
relative = browser.linux
|
|
316
|
-
if (!relative) return null
|
|
317
|
-
return join(homedir(), '.config', relative)
|
|
318
|
-
case 'win32':
|
|
319
|
-
relative = browser.win32
|
|
320
|
-
if (!relative) return null
|
|
321
|
-
return join(
|
|
322
|
-
process.env.LOCALAPPDATA || join(homedir(), 'AppData', 'Local'),
|
|
323
|
-
relative,
|
|
324
|
-
)
|
|
325
|
-
default:
|
|
326
|
-
return null
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
private discoverBrowserProfileDirs(browserBase: string): string[] {
|
|
331
|
-
const dirs: string[] = []
|
|
332
|
-
|
|
333
|
-
dirs.push(join(browserBase, 'Default'))
|
|
334
|
-
|
|
335
|
-
if (!existsSync(browserBase)) return dirs
|
|
336
|
-
|
|
337
|
-
try {
|
|
338
|
-
const entries = readdirSync(browserBase, { withFileTypes: true })
|
|
339
|
-
for (const entry of entries) {
|
|
340
|
-
if (!entry.isDirectory()) continue
|
|
341
|
-
if (!/^Profile \d+$/i.test(entry.name)) continue
|
|
342
|
-
dirs.push(join(browserBase, entry.name))
|
|
343
|
-
}
|
|
344
|
-
} catch {}
|
|
345
|
-
|
|
346
|
-
return dirs
|
|
347
|
-
}
|
|
348
|
-
|
|
349
265
|
private async extractCookieFromBrowserProfile(profileDir: string, browserBase: string): Promise<string> {
|
|
350
|
-
const cookiePaths = [
|
|
351
|
-
join(profileDir, 'Cookies'),
|
|
352
|
-
join(profileDir, 'Network', 'Cookies'),
|
|
353
|
-
]
|
|
266
|
+
const cookiePaths = [join(profileDir, 'Cookies'), join(profileDir, 'Network', 'Cookies')]
|
|
354
267
|
|
|
355
268
|
for (const cookiePath of cookiePaths) {
|
|
356
269
|
if (!existsSync(cookiePath)) continue
|
|
@@ -363,166 +276,35 @@ export class TokenExtractor {
|
|
|
363
276
|
}
|
|
364
277
|
|
|
365
278
|
private async extractCookieFromBrowserSQLite(cookiesPath: string, browserBase: string): Promise<string> {
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
279
|
+
const sql = `SELECT value, encrypted_value
|
|
280
|
+
FROM cookies
|
|
281
|
+
WHERE name = 'd' AND host_key LIKE '%slack.com%'
|
|
282
|
+
ORDER BY last_access_utc DESC
|
|
283
|
+
LIMIT 1`
|
|
284
|
+
|
|
285
|
+
type CookieRow = {
|
|
286
|
+
value?: string
|
|
287
|
+
encrypted_value?: Uint8Array | Buffer
|
|
372
288
|
}
|
|
373
289
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
FROM cookies
|
|
377
|
-
WHERE name = 'd' AND host_key LIKE '%slack.com%'
|
|
378
|
-
ORDER BY last_access_utc DESC
|
|
379
|
-
LIMIT 1`
|
|
290
|
+
const row = await this.browserCookieReader.queryFirst<CookieRow>(cookiesPath, sql)
|
|
291
|
+
if (!row) return ''
|
|
380
292
|
|
|
381
|
-
|
|
382
|
-
value?: string
|
|
383
|
-
encrypted_value?: Uint8Array | Buffer
|
|
384
|
-
} | null
|
|
293
|
+
if (row.value?.startsWith('xoxd-')) return row.value
|
|
385
294
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
} else {
|
|
393
|
-
const Database = require('better-sqlite3')
|
|
394
|
-
const db = new Database(tempDbPath, { readonly: true })
|
|
395
|
-
row = db.prepare(sql).get() as CookieRow
|
|
396
|
-
db.close()
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
if (!row) return ''
|
|
400
|
-
|
|
401
|
-
if (row.value?.startsWith('xoxd-')) return row.value
|
|
402
|
-
|
|
403
|
-
if (row.encrypted_value && row.encrypted_value.length > 0) {
|
|
404
|
-
return this.decryptBrowserCookieForSlack(Buffer.from(row.encrypted_value), browserBase) ?? ''
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
return ''
|
|
408
|
-
} catch {
|
|
409
|
-
return ''
|
|
410
|
-
} finally {
|
|
411
|
-
try {
|
|
412
|
-
rmSync(tempDbPath, { force: true })
|
|
413
|
-
} catch {}
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
private decryptBrowserCookieForSlack(encrypted: Buffer, browserBase: string): string | null {
|
|
418
|
-
const str = encrypted.toString('utf8')
|
|
419
|
-
if (str.startsWith('xoxd-')) return str
|
|
420
|
-
|
|
421
|
-
const prefix = encrypted.length > 3 ? encrypted.subarray(0, 3).toString() : ''
|
|
422
|
-
|
|
423
|
-
if (prefix === 'v10') {
|
|
424
|
-
if (this.platform === 'win32') {
|
|
425
|
-
return this.decryptBrowserV10CookieWindows(encrypted, browserBase)
|
|
426
|
-
}
|
|
427
|
-
if (this.platform === 'linux') {
|
|
428
|
-
return this.decryptV10CookieLinux(encrypted)
|
|
429
|
-
}
|
|
430
|
-
return this.decryptBrowserV10CookieMac(encrypted)
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
if (prefix === 'v11') {
|
|
434
|
-
if (this.platform === 'linux') {
|
|
435
|
-
return this.decryptV11CookieLinux(encrypted)
|
|
436
|
-
}
|
|
437
|
-
if (this.platform === 'darwin') {
|
|
438
|
-
return this.decryptBrowserV10CookieMac(encrypted)
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
if (this.platform === 'win32' && encrypted.length > 0) {
|
|
443
|
-
const decrypted = this.decryptDPAPI(encrypted)
|
|
295
|
+
if (row.encrypted_value && row.encrypted_value.length > 0) {
|
|
296
|
+
const localStatePath = join(browserBase, 'Local State')
|
|
297
|
+
const decrypted = this.browserDecryptor.decryptCookie(
|
|
298
|
+
Buffer.from(row.encrypted_value),
|
|
299
|
+
existsSync(localStatePath) ? localStatePath : undefined,
|
|
300
|
+
)
|
|
444
301
|
if (decrypted) {
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
return match ? match[0] : null
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
return null
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
private decryptBrowserV10CookieMac(encrypted: Buffer): string | null {
|
|
455
|
-
const keychainVariants = [
|
|
456
|
-
{ service: 'Chrome Safe Storage', account: 'Chrome' },
|
|
457
|
-
{ service: 'Chrome Canary Safe Storage', account: 'Chrome Canary' },
|
|
458
|
-
{ service: 'Microsoft Edge Safe Storage', account: 'Microsoft Edge' },
|
|
459
|
-
{ service: 'Arc Safe Storage', account: 'Arc' },
|
|
460
|
-
{ service: 'Brave Safe Storage', account: 'Brave' },
|
|
461
|
-
{ service: 'Vivaldi Safe Storage', account: 'Vivaldi' },
|
|
462
|
-
{ service: 'Chromium Safe Storage', account: 'Chromium' },
|
|
463
|
-
]
|
|
464
|
-
|
|
465
|
-
for (const variant of keychainVariants) {
|
|
466
|
-
try {
|
|
467
|
-
const password = execSync(
|
|
468
|
-
`security find-generic-password -s "${variant.service}" -a "${variant.account}" -w 2>/dev/null`,
|
|
469
|
-
{ encoding: 'utf8' },
|
|
470
|
-
).trim()
|
|
471
|
-
|
|
472
|
-
const key = pbkdf2Sync(password, 'saltysalt', 1003, 16, 'sha1')
|
|
473
|
-
const result = this.decryptLinuxCookieWithKey(encrypted, key)
|
|
474
|
-
if (result) return result
|
|
475
|
-
} catch {}
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
return null
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
private decryptBrowserV10CookieWindows(encrypted: Buffer, browserBase: string): string | null {
|
|
482
|
-
try {
|
|
483
|
-
const masterKey = this.getBrowserWindowsMasterKey(browserBase)
|
|
484
|
-
if (!masterKey) {
|
|
485
|
-
const decrypted = this.decryptDPAPI(encrypted.subarray(3))
|
|
486
|
-
if (!decrypted) return null
|
|
487
|
-
const text = decrypted.toString('utf8')
|
|
488
|
-
const match = text.match(/xoxd-[A-Za-z0-9%]+/)
|
|
489
|
-
return match ? match[0] : null
|
|
302
|
+
const match = decrypted.match(/xoxd-[A-Za-z0-9%]+/)
|
|
303
|
+
return match ? match[0] : ''
|
|
490
304
|
}
|
|
491
|
-
|
|
492
|
-
const nonce = encrypted.subarray(3, 3 + 12)
|
|
493
|
-
const ciphertextWithTag = encrypted.subarray(3 + 12)
|
|
494
|
-
const tag = ciphertextWithTag.subarray(ciphertextWithTag.length - 16)
|
|
495
|
-
const ciphertext = ciphertextWithTag.subarray(0, ciphertextWithTag.length - 16)
|
|
496
|
-
|
|
497
|
-
const decipher = createDecipheriv('aes-256-gcm', masterKey, nonce)
|
|
498
|
-
decipher.setAuthTag(tag)
|
|
499
|
-
const decrypted = Buffer.concat([decipher.update(ciphertext), decipher.final()]).toString('utf8')
|
|
500
|
-
|
|
501
|
-
const match = decrypted.match(/xoxd-[A-Za-z0-9%]+/)
|
|
502
|
-
return match ? match[0] : null
|
|
503
|
-
} catch {
|
|
504
|
-
return null
|
|
505
305
|
}
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
private getBrowserWindowsMasterKey(browserBase: string): Buffer | null {
|
|
509
|
-
try {
|
|
510
|
-
const localStatePath = join(browserBase, 'Local State')
|
|
511
|
-
if (!existsSync(localStatePath)) return null
|
|
512
|
-
|
|
513
|
-
const localState = JSON.parse(readFileSync(localStatePath, 'utf8')) as {
|
|
514
|
-
os_crypt?: { encrypted_key?: string }
|
|
515
|
-
}
|
|
516
|
-
const encryptedKeyB64 = localState?.os_crypt?.encrypted_key
|
|
517
|
-
if (!encryptedKeyB64) return null
|
|
518
|
-
|
|
519
|
-
const encryptedKey = Buffer.from(encryptedKeyB64, 'base64')
|
|
520
|
-
if (encryptedKey.subarray(0, 5).toString() !== 'DPAPI') return null
|
|
521
306
|
|
|
522
|
-
|
|
523
|
-
} catch {
|
|
524
|
-
return null
|
|
525
|
-
}
|
|
307
|
+
return ''
|
|
526
308
|
}
|
|
527
309
|
|
|
528
310
|
private async extractTokensFromLevelDB(): Promise<TokenInfo[]> {
|
|
@@ -1157,7 +939,17 @@ export class TokenExtractor {
|
|
|
1157
939
|
}
|
|
1158
940
|
|
|
1159
941
|
private decryptV11CookieLinux(encrypted: Buffer): string | null {
|
|
1160
|
-
const appNames = [
|
|
942
|
+
const appNames = [
|
|
943
|
+
'Slack',
|
|
944
|
+
'slack',
|
|
945
|
+
'Chrome',
|
|
946
|
+
'chrome',
|
|
947
|
+
'Chromium',
|
|
948
|
+
'chromium',
|
|
949
|
+
'Microsoft Edge',
|
|
950
|
+
'Brave',
|
|
951
|
+
'Vivaldi',
|
|
952
|
+
]
|
|
1161
953
|
for (const appName of appNames) {
|
|
1162
954
|
try {
|
|
1163
955
|
const keyringPassword = this.getLinuxKeyringPassword(appName)
|
|
@@ -3,7 +3,14 @@
|
|
|
3
3
|
import { Command } from 'commander'
|
|
4
4
|
|
|
5
5
|
import pkg from '../../../package.json' with { type: 'json' }
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
authCommand,
|
|
8
|
+
channelCommand,
|
|
9
|
+
messageCommand,
|
|
10
|
+
reactionCommand,
|
|
11
|
+
userCommand,
|
|
12
|
+
whoamiCommand,
|
|
13
|
+
} from './commands/index'
|
|
7
14
|
|
|
8
15
|
const program = new Command()
|
|
9
16
|
|
|
@@ -17,7 +17,9 @@ const mockTestAuth = mock(() =>
|
|
|
17
17
|
|
|
18
18
|
mock.module('../client', () => ({
|
|
19
19
|
SlackBotClient: class MockSlackBotClient {
|
|
20
|
-
async login(_credentials?: any) {
|
|
20
|
+
async login(_credentials?: any) {
|
|
21
|
+
return this
|
|
22
|
+
}
|
|
21
23
|
testAuth = mockTestAuth
|
|
22
24
|
},
|
|
23
25
|
}))
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises'
|
|
2
2
|
import { basename } from 'node:path'
|
|
3
3
|
|
|
4
|
+
import { TeamsCredentialManager } from './credential-manager'
|
|
4
5
|
import type { TeamsChannel, TeamsFile, TeamsMessage, TeamsTeam, TeamsUser } from './types'
|
|
5
6
|
import { TeamsError } from './types'
|
|
6
|
-
import { TeamsCredentialManager } from './credential-manager'
|
|
7
7
|
|
|
8
8
|
interface RateLimitBucket {
|
|
9
9
|
remaining: number
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { afterEach, beforeEach, expect, spyOn, test } from 'bun:test'
|
|
2
2
|
|
|
3
|
-
import { getNoTeamsTokenFoundMessage } from './auth'
|
|
4
3
|
import { TeamsClient } from '../client'
|
|
5
4
|
import { TeamsCredentialManager } from '../credential-manager'
|
|
6
5
|
import { TeamsTokenExtractor } from '../token-extractor'
|
|
6
|
+
import { getNoTeamsTokenFoundMessage } from './auth'
|
|
7
7
|
|
|
8
8
|
let extractorExtractSpy: ReturnType<typeof spyOn>
|
|
9
9
|
let clientTestAuthSpy: ReturnType<typeof spyOn>
|
|
@@ -292,7 +292,10 @@ export async function statusAction(options: { pretty?: boolean }): Promise<void>
|
|
|
292
292
|
|
|
293
293
|
if (!isExpired) {
|
|
294
294
|
try {
|
|
295
|
-
const client = await new TeamsClient().login({
|
|
295
|
+
const client = await new TeamsClient().login({
|
|
296
|
+
token: account.token,
|
|
297
|
+
tokenExpiresAt: account.token_expires_at ?? undefined,
|
|
298
|
+
})
|
|
296
299
|
const authInfo = await client.testAuth()
|
|
297
300
|
displayName = authInfo.displayName
|
|
298
301
|
valid = true
|
|
@@ -8,7 +8,7 @@ test('snapshot: command is defined', () => {
|
|
|
8
8
|
})
|
|
9
9
|
|
|
10
10
|
test('snapshot: command has correct description', () => {
|
|
11
|
-
expect(snapshotCommand.description()).toContain('team
|
|
11
|
+
expect(snapshotCommand.description()).toContain('team overview')
|
|
12
12
|
})
|
|
13
13
|
|
|
14
14
|
test('snapshot: command has --channels-only option', () => {
|
|
@@ -11,6 +11,7 @@ import type { TeamsChannel } from '../types'
|
|
|
11
11
|
export async function snapshotAction(options: {
|
|
12
12
|
channelsOnly?: boolean
|
|
13
13
|
usersOnly?: boolean
|
|
14
|
+
full?: boolean
|
|
14
15
|
limit?: number
|
|
15
16
|
teamId?: string
|
|
16
17
|
pretty?: boolean
|
|
@@ -34,7 +35,6 @@ export async function snapshotAction(options: {
|
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
const client = await new TeamsClient().login({ token: cred.token, tokenExpiresAt: cred.tokenExpiresAt })
|
|
37
|
-
const messageLimit = options.limit || 20
|
|
38
38
|
|
|
39
39
|
const snapshot: Record<string, unknown> = {}
|
|
40
40
|
|
|
@@ -45,47 +45,60 @@ export async function snapshotAction(options: {
|
|
|
45
45
|
description: team.description,
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
const isFull = options.full || options.channelsOnly || options.usersOnly
|
|
49
|
+
if (isFull) {
|
|
50
|
+
const messageLimit = options.limit || 20
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
name: ch.name,
|
|
54
|
-
type: ch.type,
|
|
55
|
-
}))
|
|
52
|
+
if (!options.usersOnly) {
|
|
53
|
+
const channels = await client.listChannels(teamId)
|
|
56
54
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const messages = await client.getMessages(teamId, channel.id, messageLimit)
|
|
62
|
-
return messages.map((msg) => ({
|
|
63
|
-
...msg,
|
|
64
|
-
channel_name: channel.name,
|
|
65
|
-
}))
|
|
66
|
-
},
|
|
67
|
-
5,
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
snapshot.recent_messages = channelMessages.flat().map((msg) => ({
|
|
71
|
-
channel_id: msg.channel_id,
|
|
72
|
-
channel_name: msg.channel_name,
|
|
73
|
-
id: msg.id,
|
|
74
|
-
author: msg.author.displayName,
|
|
75
|
-
content: msg.content,
|
|
76
|
-
timestamp: msg.timestamp,
|
|
55
|
+
snapshot.channels = channels.map((ch) => ({
|
|
56
|
+
id: ch.id,
|
|
57
|
+
name: ch.name,
|
|
58
|
+
type: ch.type,
|
|
77
59
|
}))
|
|
60
|
+
|
|
61
|
+
if (!options.channelsOnly) {
|
|
62
|
+
const channelMessages = await parallelMap(
|
|
63
|
+
channels,
|
|
64
|
+
async (channel: TeamsChannel) => {
|
|
65
|
+
const messages = await client.getMessages(teamId, channel.id, messageLimit)
|
|
66
|
+
return messages.map((msg) => ({
|
|
67
|
+
...msg,
|
|
68
|
+
channel_name: channel.name,
|
|
69
|
+
}))
|
|
70
|
+
},
|
|
71
|
+
5,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
snapshot.recent_messages = channelMessages.flat().map((msg) => ({
|
|
75
|
+
channel_id: msg.channel_id,
|
|
76
|
+
channel_name: msg.channel_name,
|
|
77
|
+
id: msg.id,
|
|
78
|
+
author: msg.author.displayName,
|
|
79
|
+
content: msg.content,
|
|
80
|
+
timestamp: msg.timestamp,
|
|
81
|
+
}))
|
|
82
|
+
}
|
|
78
83
|
}
|
|
79
|
-
}
|
|
80
84
|
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
if (!options.channelsOnly) {
|
|
86
|
+
const users = await client.listUsers(teamId)
|
|
87
|
+
|
|
88
|
+
snapshot.members = users.map((u) => ({
|
|
89
|
+
id: u.id,
|
|
90
|
+
displayName: u.displayName,
|
|
91
|
+
email: u.email || null,
|
|
92
|
+
}))
|
|
93
|
+
}
|
|
94
|
+
} else {
|
|
95
|
+
if (!options.usersOnly) {
|
|
96
|
+
const channels = await client.listChannels(teamId)
|
|
97
|
+
snapshot.channels = channels.map((ch) => ({ id: ch.id, name: ch.name }))
|
|
98
|
+
}
|
|
83
99
|
|
|
84
|
-
snapshot.
|
|
85
|
-
|
|
86
|
-
displayName: u.displayName,
|
|
87
|
-
email: u.email || null,
|
|
88
|
-
}))
|
|
100
|
+
snapshot.hint =
|
|
101
|
+
"Use 'message list <channel>' for messages, 'channel info <channel>' for channel details, 'user list' for members."
|
|
89
102
|
}
|
|
90
103
|
|
|
91
104
|
console.log(formatOutput(snapshot, options.pretty))
|
|
@@ -95,16 +108,18 @@ export async function snapshotAction(options: {
|
|
|
95
108
|
}
|
|
96
109
|
|
|
97
110
|
export const snapshotCommand = new Command('snapshot')
|
|
98
|
-
.description('Get
|
|
111
|
+
.description('Get team overview for AI agents (brief by default, use --full for comprehensive data)')
|
|
112
|
+
.option('--full', 'Include messages and members (verbose)')
|
|
99
113
|
.option('--channels-only', 'Include only channels (exclude messages and members)')
|
|
100
114
|
.option('--users-only', 'Include only members (exclude channels and messages)')
|
|
101
|
-
.option('--limit <n>', 'Number of recent messages per channel (default: 20)', '20')
|
|
115
|
+
.option('--limit <n>', 'Number of recent messages per channel with --full (default: 20)', '20')
|
|
102
116
|
.option('--team-id <id>', 'Team ID (defaults to current team)')
|
|
103
117
|
.option('--pretty', 'Pretty print JSON output')
|
|
104
118
|
.action(async (options) => {
|
|
105
119
|
await snapshotAction({
|
|
106
120
|
channelsOnly: options.channelsOnly,
|
|
107
121
|
usersOnly: options.usersOnly,
|
|
122
|
+
full: options.full,
|
|
108
123
|
limit: parseInt(options.limit, 10),
|
|
109
124
|
teamId: options.teamId,
|
|
110
125
|
pretty: options.pretty,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { afterEach, beforeEach, expect, spyOn, test } from 'bun:test'
|
|
2
2
|
|
|
3
3
|
import { TeamsClient } from '@/platforms/teams/client'
|
|
4
|
-
import { TeamsCredentialManager } from '@/platforms/teams/credential-manager'
|
|
5
4
|
import { whoamiAction, whoamiCommand } from '@/platforms/teams/commands/whoami'
|
|
5
|
+
import { TeamsCredentialManager } from '@/platforms/teams/credential-manager'
|
|
6
6
|
|
|
7
7
|
let credManagerSpy: ReturnType<typeof spyOn>
|
|
8
8
|
let clientTestAuthSpy: ReturnType<typeof spyOn>
|
|
@@ -76,8 +76,6 @@ test('whoami exits with error when not authenticated', async () => {
|
|
|
76
76
|
|
|
77
77
|
await whoamiAction({})
|
|
78
78
|
|
|
79
|
-
expect(consoleLogSpy).toHaveBeenCalledWith(
|
|
80
|
-
JSON.stringify({ error: 'Not authenticated. Run "auth extract" first.' }),
|
|
81
|
-
)
|
|
79
|
+
expect(consoleLogSpy).toHaveBeenCalledWith(JSON.stringify({ error: 'Not authenticated. Run "auth extract" first.' }))
|
|
82
80
|
expect(processExitSpy).toHaveBeenCalledWith(1)
|
|
83
81
|
})
|