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
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process'
|
|
2
|
+
import { createDecipheriv, pbkdf2Sync } from 'node:crypto'
|
|
3
|
+
import { existsSync, readFileSync } from 'node:fs'
|
|
4
|
+
|
|
5
|
+
import { DerivedKeyCache, type Platform } from '@/shared/utils/derived-key-cache'
|
|
6
|
+
import { lookupLinuxKeyringPassword } from '@/shared/utils/linux-keyring'
|
|
7
|
+
|
|
8
|
+
import { BROWSER_KEYCHAIN_VARIANTS } from './browsers'
|
|
9
|
+
import type { KeychainVariant } from './types'
|
|
10
|
+
|
|
11
|
+
export interface ChromiumDecryptorOptions {
|
|
12
|
+
platform: NodeJS.Platform
|
|
13
|
+
/** App-specific keychain entries, prepended before browser variants */
|
|
14
|
+
appKeychainVariants?: KeychainVariant[]
|
|
15
|
+
/** Optional key cache for avoiding repeated macOS Keychain prompts */
|
|
16
|
+
keyCache?: DerivedKeyCache
|
|
17
|
+
/** Platform identifier for key cache (e.g. 'slack', 'discord') */
|
|
18
|
+
keyCachePlatform?: Platform
|
|
19
|
+
/** App names to try for Linux v11 keyring lookup (e.g. ['discord', 'Discord']) */
|
|
20
|
+
linuxKeyringAppNames?: string[]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class ChromiumCookieDecryptor {
|
|
24
|
+
private platform: NodeJS.Platform
|
|
25
|
+
private keychainVariants: KeychainVariant[]
|
|
26
|
+
private keyCache: DerivedKeyCache | null
|
|
27
|
+
private keyCachePlatform: Platform | null
|
|
28
|
+
private linuxKeyringAppNames: string[]
|
|
29
|
+
private cachedKey: Buffer | null = null
|
|
30
|
+
private usedCachedKey = false
|
|
31
|
+
|
|
32
|
+
constructor(options: ChromiumDecryptorOptions) {
|
|
33
|
+
this.platform = options.platform
|
|
34
|
+
// App-specific variants come first, browser variants as fallback
|
|
35
|
+
this.keychainVariants = [...(options.appKeychainVariants ?? []), ...BROWSER_KEYCHAIN_VARIANTS]
|
|
36
|
+
this.keyCache = options.keyCache ?? null
|
|
37
|
+
this.keyCachePlatform = options.keyCachePlatform ?? null
|
|
38
|
+
this.linuxKeyringAppNames = options.linuxKeyringAppNames ?? []
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
isEncryptedValue(value: Buffer): boolean {
|
|
42
|
+
if (!value || value.length < 4) return false
|
|
43
|
+
const prefix = value.subarray(0, 3).toString('utf8')
|
|
44
|
+
return prefix === 'v10' || prefix === 'v11'
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async loadCachedKey(): Promise<void> {
|
|
48
|
+
if (this.platform !== 'darwin' || !this.keyCache || !this.keyCachePlatform) return
|
|
49
|
+
const cached = await this.keyCache.get(this.keyCachePlatform)
|
|
50
|
+
if (cached) {
|
|
51
|
+
this.cachedKey = cached
|
|
52
|
+
this.usedCachedKey = true
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async clearKeyCache(): Promise<void> {
|
|
57
|
+
if (this.keyCache && this.keyCachePlatform) {
|
|
58
|
+
await this.keyCache.clear(this.keyCachePlatform)
|
|
59
|
+
}
|
|
60
|
+
this.cachedKey = null
|
|
61
|
+
this.usedCachedKey = false
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
decryptCookie(encryptedValue: Buffer, localStatePath?: string): string | null {
|
|
65
|
+
return this.decryptCookieRaw(encryptedValue, localStatePath)?.toString('utf8') ?? null
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
decryptCookieRaw(encryptedValue: Buffer, localStatePath?: string): Buffer | null {
|
|
69
|
+
if (!this.isEncryptedValue(encryptedValue)) {
|
|
70
|
+
return encryptedValue
|
|
71
|
+
}
|
|
72
|
+
if (this.platform === 'win32') {
|
|
73
|
+
return this.decryptWindowsCookieRaw(encryptedValue, localStatePath)
|
|
74
|
+
} else if (this.platform === 'darwin') {
|
|
75
|
+
return this.decryptMacCookieRaw(encryptedValue)
|
|
76
|
+
} else if (this.platform === 'linux') {
|
|
77
|
+
return this.decryptLinuxCookieRaw(encryptedValue)
|
|
78
|
+
}
|
|
79
|
+
return null
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
decryptMacCookie(encryptedData: Buffer): string | null {
|
|
83
|
+
return this.decryptMacCookieRaw(encryptedData)?.toString('utf8') ?? null
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
decryptMacCookieRaw(encryptedData: Buffer): Buffer | null {
|
|
87
|
+
if (this.cachedKey) {
|
|
88
|
+
const decrypted = this.decryptAESCBCRaw(encryptedData, this.cachedKey)
|
|
89
|
+
if (decrypted) return decrypted
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
for (const variant of this.keychainVariants) {
|
|
93
|
+
const password = this.execKeychainLookup(variant.service, variant.account)
|
|
94
|
+
if (!password) continue
|
|
95
|
+
|
|
96
|
+
const key = pbkdf2Sync(password, 'saltysalt', 1003, 16, 'sha1')
|
|
97
|
+
const decrypted = this.decryptAESCBCRaw(encryptedData, key)
|
|
98
|
+
if (decrypted) {
|
|
99
|
+
this.cachedKey = key
|
|
100
|
+
if (this.keyCache && this.keyCachePlatform) {
|
|
101
|
+
this.keyCache.set(this.keyCachePlatform, key).catch(() => {})
|
|
102
|
+
}
|
|
103
|
+
return decrypted
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return null
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
decryptLinuxCookie(encryptedData: Buffer): string | null {
|
|
111
|
+
return this.decryptLinuxCookieRaw(encryptedData)?.toString('utf8') ?? null
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
decryptLinuxCookieRaw(encryptedData: Buffer): Buffer | null {
|
|
115
|
+
const prefix = encryptedData.subarray(0, 3).toString('utf8')
|
|
116
|
+
|
|
117
|
+
if (prefix === 'v11' && this.linuxKeyringAppNames.length > 0) {
|
|
118
|
+
for (const appName of this.linuxKeyringAppNames) {
|
|
119
|
+
try {
|
|
120
|
+
const keyringPassword = lookupLinuxKeyringPassword(appName)
|
|
121
|
+
const key = pbkdf2Sync(keyringPassword, 'saltysalt', 1, 16, 'sha1')
|
|
122
|
+
const result = this.decryptAESCBCRaw(encryptedData, key)
|
|
123
|
+
if (result) return result
|
|
124
|
+
} catch {}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const key = pbkdf2Sync('peanuts', 'saltysalt', 1, 16, 'sha1')
|
|
129
|
+
return this.decryptAESCBCRaw(encryptedData, key)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
decryptWindowsCookie(encryptedData: Buffer, localStatePath?: string): string | null {
|
|
133
|
+
return this.decryptWindowsCookieRaw(encryptedData, localStatePath)?.toString('utf8') ?? null
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
decryptWindowsCookieRaw(encryptedData: Buffer, localStatePath?: string): Buffer | null {
|
|
137
|
+
if (!localStatePath || !existsSync(localStatePath)) return null
|
|
138
|
+
try {
|
|
139
|
+
const localState = JSON.parse(readFileSync(localStatePath, 'utf8'))
|
|
140
|
+
const encryptedKey = Buffer.from(localState.os_crypt.encrypted_key, 'base64')
|
|
141
|
+
const dpapiBlobKey = encryptedKey.subarray(5)
|
|
142
|
+
const masterKey = this.decryptDPAPI(dpapiBlobKey)
|
|
143
|
+
if (!masterKey) return null
|
|
144
|
+
return this.decryptAESGCMRaw(encryptedData, masterKey)
|
|
145
|
+
} catch {
|
|
146
|
+
return null
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
decryptAESCBC(encryptedData: Buffer, key: Buffer): string | null {
|
|
151
|
+
const buf = this.decryptAESCBCRaw(encryptedData, key)
|
|
152
|
+
return buf?.toString('utf8') ?? null
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
decryptAESCBCRaw(encryptedData: Buffer, key: Buffer): Buffer | null {
|
|
156
|
+
try {
|
|
157
|
+
const ciphertext = encryptedData.subarray(3)
|
|
158
|
+
const iv = Buffer.alloc(16, 0x20)
|
|
159
|
+
const decipher = createDecipheriv('aes-128-cbc', key, iv)
|
|
160
|
+
decipher.setAutoPadding(true)
|
|
161
|
+
return Buffer.concat([decipher.update(ciphertext), decipher.final()])
|
|
162
|
+
} catch {
|
|
163
|
+
return null
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
decryptAESGCM(encryptedData: Buffer, key: Buffer): string | null {
|
|
168
|
+
const buf = this.decryptAESGCMRaw(encryptedData, key)
|
|
169
|
+
return buf?.toString('utf8') ?? null
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
decryptAESGCMRaw(encryptedData: Buffer, key: Buffer): Buffer | null {
|
|
173
|
+
try {
|
|
174
|
+
if (encryptedData.length < 3 + 12 + 16) return null
|
|
175
|
+
const iv = encryptedData.subarray(3, 15)
|
|
176
|
+
const authTag = encryptedData.subarray(-16)
|
|
177
|
+
const ciphertext = encryptedData.subarray(15, -16)
|
|
178
|
+
const decipher = createDecipheriv('aes-256-gcm', key, iv)
|
|
179
|
+
decipher.setAuthTag(authTag)
|
|
180
|
+
return Buffer.concat([decipher.update(ciphertext), decipher.final()])
|
|
181
|
+
} catch {
|
|
182
|
+
return null
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
decryptDPAPI(encrypted: Buffer): Buffer | null {
|
|
187
|
+
if (this.platform !== 'win32') return null
|
|
188
|
+
try {
|
|
189
|
+
const b64Input = encrypted.toString('base64')
|
|
190
|
+
const script = [
|
|
191
|
+
'Add-Type -AssemblyName System.Security',
|
|
192
|
+
`$d=[System.Security.Cryptography.ProtectedData]::Unprotect([Convert]::FromBase64String("${b64Input}"),$null,[System.Security.Cryptography.DataProtectionScope]::CurrentUser)`,
|
|
193
|
+
'[Convert]::ToBase64String($d)',
|
|
194
|
+
].join(';')
|
|
195
|
+
const encodedCommand = Buffer.from(script, 'utf16le').toString('base64')
|
|
196
|
+
const result = execSync(`powershell -NoProfile -NonInteractive -EncodedCommand ${encodedCommand}`, {
|
|
197
|
+
encoding: 'utf8',
|
|
198
|
+
timeout: 10000,
|
|
199
|
+
}).trim()
|
|
200
|
+
return Buffer.from(result, 'base64')
|
|
201
|
+
} catch {
|
|
202
|
+
return null
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
static stripIntegrityHash(decrypted: Buffer): Buffer {
|
|
207
|
+
if (decrypted.length <= 32) return decrypted
|
|
208
|
+
const hasNonPrintablePrefix = decrypted.subarray(0, 32).some((b) => b < 0x20 || b > 0x7e)
|
|
209
|
+
if (hasNonPrintablePrefix) {
|
|
210
|
+
return decrypted.subarray(32)
|
|
211
|
+
}
|
|
212
|
+
return decrypted
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
private execKeychainLookup(service: string, account: string): string | null {
|
|
216
|
+
try {
|
|
217
|
+
const safeService = service.replace(/"/g, '\\"')
|
|
218
|
+
const safeAccount = account.replace(/"/g, '\\"')
|
|
219
|
+
const result = execSync(`security find-generic-password -s "${safeService}" -a "${safeAccount}" -w 2>/dev/null`, {
|
|
220
|
+
encoding: 'utf8',
|
|
221
|
+
})
|
|
222
|
+
return result.trim() || null
|
|
223
|
+
} catch {
|
|
224
|
+
return null
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type { BrowserConfig, KeychainVariant } from './types'
|
|
2
|
+
export {
|
|
3
|
+
BROWSER_KEYCHAIN_VARIANTS,
|
|
4
|
+
CHROMIUM_BROWSERS,
|
|
5
|
+
discoverBrowserProfileDirs,
|
|
6
|
+
findLocalStatePath,
|
|
7
|
+
getBrowserBasePath,
|
|
8
|
+
} from './browsers'
|
|
9
|
+
export { ChromiumCookieDecryptor } from './decryptor'
|
|
10
|
+
export type { ChromiumDecryptorOptions } from './decryptor'
|
|
11
|
+
export { ChromiumCookieReader } from './cookie-reader'
|
|
@@ -3,7 +3,7 @@ import { mkdir, readFile, rm, writeFile } from 'node:fs/promises'
|
|
|
3
3
|
import { homedir } from 'node:os'
|
|
4
4
|
import { join } from 'node:path'
|
|
5
5
|
|
|
6
|
-
export type Platform = 'slack' | 'discord' | 'teams' | '
|
|
6
|
+
export type Platform = 'slack' | 'discord' | 'teams' | 'instagram' | 'channeltalk'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Caches derived encryption keys to avoid repeated macOS Keychain prompts.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { execSync } from 'node:child_process'
|
|
2
2
|
|
|
3
3
|
export function lookupLinuxKeyringPassword(appName: string): string {
|
|
4
|
-
return execSync(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
).trim()
|
|
4
|
+
return execSync(`secret-tool lookup xdg:schema chrome_libsecret_os_crypt_password_v2 application ${appName}`, {
|
|
5
|
+
timeout: 5000,
|
|
6
|
+
encoding: 'utf8',
|
|
7
|
+
}).trim()
|
|
8
8
|
}
|
|
@@ -64,7 +64,12 @@ export class KakaoTalkAdapter implements PlatformAdapter {
|
|
|
64
64
|
if (!creds) throw new Error(`Account ${accountId} not found`)
|
|
65
65
|
|
|
66
66
|
const client = new KakaoTalkClient()
|
|
67
|
-
await client.login({
|
|
67
|
+
await client.login({
|
|
68
|
+
oauthToken: creds.oauth_token,
|
|
69
|
+
userId: creds.user_id,
|
|
70
|
+
deviceUuid: creds.device_uuid,
|
|
71
|
+
deviceType: creds.device_type,
|
|
72
|
+
})
|
|
68
73
|
this.client = client
|
|
69
74
|
this.currentAccount = { id: creds.account_id, name: creds.account_id }
|
|
70
75
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TelegramCredentialManager } from '@/platforms/telegram/credential-manager'
|
|
2
1
|
import { TelegramTdlibClient } from '@/platforms/telegram/client'
|
|
2
|
+
import { TelegramCredentialManager } from '@/platforms/telegram/credential-manager'
|
|
3
3
|
|
|
4
4
|
import type { AuthHint, AuthIO, PlatformAdapter, UnifiedChannel, UnifiedMessage, Workspace } from './types'
|
|
5
5
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { exec } from 'node:child_process'
|
|
2
2
|
|
|
3
|
+
import { getWebexAppCredentials } from '@/platforms/webex/app-config'
|
|
3
4
|
import { WebexClient } from '@/platforms/webex/client'
|
|
4
5
|
import { WebexCredentialManager } from '@/platforms/webex/credential-manager'
|
|
5
|
-
import { getWebexAppCredentials } from '@/platforms/webex/app-config'
|
|
6
6
|
|
|
7
7
|
import type { AuthHint, AuthIO, PlatformAdapter, UnifiedChannel, UnifiedMessage } from './types'
|
|
8
8
|
|
package/src/tui/app.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import blessed from 'blessed'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { ChannelTalkAdapter } from './adapters/channeltalk-adapter'
|
|
4
4
|
import { DiscordAdapter } from './adapters/discord-adapter'
|
|
5
|
-
import { TeamsAdapter } from './adapters/teams-adapter'
|
|
6
|
-
import { WebexAdapter } from './adapters/webex-adapter'
|
|
7
|
-
import { TelegramAdapter } from './adapters/telegram-adapter'
|
|
8
|
-
import { WhatsAppAdapter } from './adapters/whatsapp-adapter'
|
|
9
|
-
import { LineAdapter } from './adapters/line-adapter'
|
|
10
5
|
import { InstagramAdapter } from './adapters/instagram-adapter'
|
|
11
6
|
import { KakaoTalkAdapter } from './adapters/kakaotalk-adapter'
|
|
12
|
-
import {
|
|
7
|
+
import { LineAdapter } from './adapters/line-adapter'
|
|
8
|
+
import { SlackAdapter } from './adapters/slack-adapter'
|
|
9
|
+
import { TeamsAdapter } from './adapters/teams-adapter'
|
|
10
|
+
import { TelegramAdapter } from './adapters/telegram-adapter'
|
|
13
11
|
import type { AuthIO, PlatformAdapter, UnifiedChannel, UnifiedMessage, Workspace } from './adapters/types'
|
|
12
|
+
import { WebexAdapter } from './adapters/webex-adapter'
|
|
13
|
+
import { WhatsAppAdapter } from './adapters/whatsapp-adapter'
|
|
14
|
+
import { formatTimestamp } from './utils'
|
|
14
15
|
import { ChannelPicker } from './views/channel-picker'
|
|
15
16
|
import { WorkspacePicker } from './views/workspace-picker'
|
|
16
|
-
import { formatTimestamp } from './utils'
|
|
17
17
|
|
|
18
18
|
type AppMode = 'selection' | 'read' | 'write' | 'auth'
|
|
19
19
|
type NavLevel = 'platform' | 'workspace' | 'channel'
|
|
@@ -34,18 +34,97 @@ export async function createApp(): Promise<void> {
|
|
|
34
34
|
let activePlatformIndex = -1
|
|
35
35
|
let activeChannelId: string | null = null
|
|
36
36
|
|
|
37
|
-
|
|
38
37
|
const platformStates: PlatformState[] = [
|
|
39
|
-
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
{
|
|
38
|
+
{
|
|
39
|
+
adapter: new SlackAdapter(),
|
|
40
|
+
label: 'Slack',
|
|
41
|
+
enabled: false,
|
|
42
|
+
channels: null,
|
|
43
|
+
workspaces: null,
|
|
44
|
+
listening: false,
|
|
45
|
+
lastChannelId: null,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
adapter: new DiscordAdapter(),
|
|
49
|
+
label: 'Discord',
|
|
50
|
+
enabled: false,
|
|
51
|
+
channels: null,
|
|
52
|
+
workspaces: null,
|
|
53
|
+
listening: false,
|
|
54
|
+
lastChannelId: null,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
adapter: new TeamsAdapter(),
|
|
58
|
+
label: 'Teams',
|
|
59
|
+
enabled: false,
|
|
60
|
+
channels: null,
|
|
61
|
+
workspaces: null,
|
|
62
|
+
listening: false,
|
|
63
|
+
lastChannelId: null,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
adapter: new WebexAdapter(),
|
|
67
|
+
label: 'Webex',
|
|
68
|
+
enabled: false,
|
|
69
|
+
channels: null,
|
|
70
|
+
workspaces: null,
|
|
71
|
+
listening: false,
|
|
72
|
+
lastChannelId: null,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
adapter: new TelegramAdapter(),
|
|
76
|
+
label: 'Telegram',
|
|
77
|
+
enabled: false,
|
|
78
|
+
channels: null,
|
|
79
|
+
workspaces: null,
|
|
80
|
+
listening: false,
|
|
81
|
+
lastChannelId: null,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
adapter: new WhatsAppAdapter(),
|
|
85
|
+
label: 'WhatsApp',
|
|
86
|
+
enabled: false,
|
|
87
|
+
channels: null,
|
|
88
|
+
workspaces: null,
|
|
89
|
+
listening: false,
|
|
90
|
+
lastChannelId: null,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
adapter: new LineAdapter(),
|
|
94
|
+
label: 'LINE',
|
|
95
|
+
enabled: false,
|
|
96
|
+
channels: null,
|
|
97
|
+
workspaces: null,
|
|
98
|
+
listening: false,
|
|
99
|
+
lastChannelId: null,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
adapter: new InstagramAdapter(),
|
|
103
|
+
label: 'Instagram',
|
|
104
|
+
enabled: false,
|
|
105
|
+
channels: null,
|
|
106
|
+
workspaces: null,
|
|
107
|
+
listening: false,
|
|
108
|
+
lastChannelId: null,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
adapter: new KakaoTalkAdapter(),
|
|
112
|
+
label: 'KakaoTalk',
|
|
113
|
+
enabled: false,
|
|
114
|
+
channels: null,
|
|
115
|
+
workspaces: null,
|
|
116
|
+
listening: false,
|
|
117
|
+
lastChannelId: null,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
adapter: new ChannelTalkAdapter(),
|
|
121
|
+
label: 'Channel Talk',
|
|
122
|
+
enabled: false,
|
|
123
|
+
channels: null,
|
|
124
|
+
workspaces: null,
|
|
125
|
+
listening: false,
|
|
126
|
+
lastChannelId: null,
|
|
127
|
+
},
|
|
49
128
|
]
|
|
50
129
|
|
|
51
130
|
const screen = blessed.screen({
|
|
@@ -222,9 +301,7 @@ export async function createApp(): Promise<void> {
|
|
|
222
301
|
hints.push('{gray-fg}Ctrl+C{/}: Quit')
|
|
223
302
|
statusBar.setContent(' ' + hints.join(' '))
|
|
224
303
|
} else if (mode === 'auth') {
|
|
225
|
-
statusBar.setContent(
|
|
226
|
-
' {gray-fg}Enter{/}: Submit {gray-fg}Esc{/}: Cancel {gray-fg}Ctrl+C{/}: Quit',
|
|
227
|
-
)
|
|
304
|
+
statusBar.setContent(' {gray-fg}Enter{/}: Submit {gray-fg}Esc{/}: Cancel {gray-fg}Ctrl+C{/}: Quit')
|
|
228
305
|
} else if (mode === 'read') {
|
|
229
306
|
statusBar.setContent(
|
|
230
307
|
' {gray-fg}Enter{/}: Write {gray-fg}Esc{/}: Selection {gray-fg}Ctrl+K{/}: Channel {gray-fg}Ctrl+W{/}: Workspace {gray-fg}Ctrl+C{/}: Quit',
|
|
@@ -353,9 +430,15 @@ export async function createApp(): Promise<void> {
|
|
|
353
430
|
|
|
354
431
|
if (level) {
|
|
355
432
|
switch (level) {
|
|
356
|
-
case 'platform':
|
|
357
|
-
|
|
358
|
-
|
|
433
|
+
case 'platform':
|
|
434
|
+
showPlatformLevel()
|
|
435
|
+
break
|
|
436
|
+
case 'workspace':
|
|
437
|
+
showWorkspaceLevel()
|
|
438
|
+
break
|
|
439
|
+
case 'channel':
|
|
440
|
+
showChannelLevel()
|
|
441
|
+
break
|
|
359
442
|
}
|
|
360
443
|
} else {
|
|
361
444
|
if (activePlatformIndex >= 0) {
|
|
@@ -543,23 +626,29 @@ export async function createApp(): Promise<void> {
|
|
|
543
626
|
if (mode === 'selection' || mode === 'auth' || channelPicker.isActive() || workspacePicker.isActive()) return
|
|
544
627
|
const p = activePlatform()
|
|
545
628
|
if (!p?.adapter.getWorkspaces) return
|
|
546
|
-
p.adapter
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
if (
|
|
550
|
-
|
|
551
|
-
p.
|
|
552
|
-
p.
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
629
|
+
p.adapter
|
|
630
|
+
.getWorkspaces()
|
|
631
|
+
.then((workspaces) => {
|
|
632
|
+
if (workspaces.length <= 1) return
|
|
633
|
+
workspacePicker.open(workspaces, (workspace) => {
|
|
634
|
+
if (!p.adapter.switchWorkspace) return
|
|
635
|
+
p.adapter
|
|
636
|
+
.switchWorkspace(workspace.id)
|
|
637
|
+
.then(() => {
|
|
638
|
+
p.channels = null
|
|
639
|
+
p.workspaces = null
|
|
640
|
+
renderHeader()
|
|
641
|
+
if (activeChannelId) {
|
|
642
|
+
activeChannelId = null
|
|
643
|
+
messageLog.setContent('')
|
|
644
|
+
messageLog.setLabel(' Messages ')
|
|
645
|
+
}
|
|
646
|
+
enterSelectionMode('channel')
|
|
647
|
+
})
|
|
648
|
+
.catch(() => {})
|
|
649
|
+
})
|
|
561
650
|
})
|
|
562
|
-
|
|
651
|
+
.catch(() => {})
|
|
563
652
|
})
|
|
564
653
|
|
|
565
654
|
inputBox.on('keypress', (_ch: string, key: blessed.Widgets.Events.IKeyEventArg) => {
|
|
@@ -615,26 +704,29 @@ export async function createApp(): Promise<void> {
|
|
|
615
704
|
const p = activePlatform()
|
|
616
705
|
inputBox.clearValue()
|
|
617
706
|
screen.render()
|
|
618
|
-
p?.adapter
|
|
619
|
-
|
|
707
|
+
p?.adapter
|
|
708
|
+
.sendMessage(activeChannelId, text)
|
|
709
|
+
.then(() => {
|
|
710
|
+
if (!p?.listening) {
|
|
711
|
+
appendMessage({
|
|
712
|
+
id: Date.now().toString(),
|
|
713
|
+
channelId: activeChannelId!,
|
|
714
|
+
author: 'you',
|
|
715
|
+
content: text,
|
|
716
|
+
timestamp: (Date.now() / 1000).toString(),
|
|
717
|
+
})
|
|
718
|
+
}
|
|
719
|
+
})
|
|
720
|
+
.catch((err: unknown) => {
|
|
721
|
+
const detail = err instanceof Error ? err.message : String(err)
|
|
620
722
|
appendMessage({
|
|
621
|
-
id:
|
|
723
|
+
id: 'err',
|
|
622
724
|
channelId: activeChannelId!,
|
|
623
|
-
author: '
|
|
624
|
-
content:
|
|
725
|
+
author: 'system',
|
|
726
|
+
content: `{red-fg}Send failed: ${detail}{/red-fg}`,
|
|
625
727
|
timestamp: (Date.now() / 1000).toString(),
|
|
626
728
|
})
|
|
627
|
-
}
|
|
628
|
-
}).catch((err: unknown) => {
|
|
629
|
-
const detail = err instanceof Error ? err.message : String(err)
|
|
630
|
-
appendMessage({
|
|
631
|
-
id: 'err',
|
|
632
|
-
channelId: activeChannelId!,
|
|
633
|
-
author: 'system',
|
|
634
|
-
content: `{red-fg}Send failed: ${detail}{/red-fg}`,
|
|
635
|
-
timestamp: (Date.now() / 1000).toString(),
|
|
636
729
|
})
|
|
637
|
-
})
|
|
638
730
|
}
|
|
639
731
|
return
|
|
640
732
|
}
|
|
@@ -662,9 +754,7 @@ export async function createApp(): Promise<void> {
|
|
|
662
754
|
return true
|
|
663
755
|
}
|
|
664
756
|
process.stderr.write = () => true
|
|
665
|
-
const results = await Promise.allSettled(
|
|
666
|
-
platformStates.map((p) => p.adapter.login()),
|
|
667
|
-
)
|
|
757
|
+
const results = await Promise.allSettled(platformStates.map((p) => p.adapter.login()))
|
|
668
758
|
process.stdout.write = origStdoutWrite
|
|
669
759
|
process.stderr.write = origStderrWrite
|
|
670
760
|
screen.alloc()
|