agent-messenger 2.10.1 → 2.11.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/.env.template +4 -1
- package/README.md +77 -27
- package/bun.lock +26 -0
- package/dist/package.json +14 -1
- package/dist/src/platforms/channeltalk/commands/auth.d.ts +2 -1
- package/dist/src/platforms/channeltalk/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/commands/auth.js +5 -3
- package/dist/src/platforms/channeltalk/commands/auth.js.map +1 -1
- package/dist/src/platforms/channeltalk/token-extractor.d.ts +2 -1
- package/dist/src/platforms/channeltalk/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/token-extractor.js +22 -6
- package/dist/src/platforms/channeltalk/token-extractor.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/cli.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/cli.js +11 -1
- package/dist/src/platforms/channeltalkbot/cli.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/auth.js +1 -5
- package/dist/src/platforms/channeltalkbot/commands/auth.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/bot.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/bot.js +1 -6
- package/dist/src/platforms/channeltalkbot/commands/bot.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/chat.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/chat.js +1 -6
- package/dist/src/platforms/channeltalkbot/commands/chat.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/group.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/group.js +1 -6
- package/dist/src/platforms/channeltalkbot/commands/group.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/manager.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/manager.js +1 -6
- package/dist/src/platforms/channeltalkbot/commands/manager.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/message.js +1 -6
- package/dist/src/platforms/channeltalkbot/commands/message.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/whoami.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/whoami.js +1 -6
- package/dist/src/platforms/channeltalkbot/commands/whoami.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/credential-manager.d.ts +5 -0
- package/dist/src/platforms/channeltalkbot/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/credential-manager.js +34 -4
- package/dist/src/platforms/channeltalkbot/credential-manager.js.map +1 -1
- package/dist/src/platforms/discord/commands/auth.d.ts +1 -0
- package/dist/src/platforms/discord/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/auth.js +3 -1
- package/dist/src/platforms/discord/commands/auth.js.map +1 -1
- package/dist/src/platforms/discord/listener.d.ts +2 -0
- package/dist/src/platforms/discord/listener.d.ts.map +1 -1
- package/dist/src/platforms/discord/listener.js +51 -21
- package/dist/src/platforms/discord/listener.js.map +1 -1
- package/dist/src/platforms/discord/token-extractor.d.ts +2 -1
- package/dist/src/platforms/discord/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/discord/token-extractor.js +21 -6
- package/dist/src/platforms/discord/token-extractor.js.map +1 -1
- package/dist/src/platforms/discordbot/cli.d.ts.map +1 -1
- package/dist/src/platforms/discordbot/cli.js +12 -1
- package/dist/src/platforms/discordbot/cli.js.map +1 -1
- package/dist/src/platforms/discordbot/client.d.ts +3 -0
- package/dist/src/platforms/discordbot/client.d.ts.map +1 -1
- package/dist/src/platforms/discordbot/client.js +3 -0
- package/dist/src/platforms/discordbot/client.js.map +1 -1
- package/dist/src/platforms/discordbot/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/discordbot/commands/auth.js +1 -5
- package/dist/src/platforms/discordbot/commands/auth.js.map +1 -1
- package/dist/src/platforms/discordbot/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/discordbot/commands/message.js +1 -6
- package/dist/src/platforms/discordbot/commands/message.js.map +1 -1
- package/dist/src/platforms/discordbot/commands/server.d.ts.map +1 -1
- package/dist/src/platforms/discordbot/commands/server.js +1 -4
- package/dist/src/platforms/discordbot/commands/server.js.map +1 -1
- package/dist/src/platforms/discordbot/commands/whoami.d.ts.map +1 -1
- package/dist/src/platforms/discordbot/commands/whoami.js +1 -6
- package/dist/src/platforms/discordbot/commands/whoami.js.map +1 -1
- package/dist/src/platforms/discordbot/index.d.ts +3 -1
- package/dist/src/platforms/discordbot/index.d.ts.map +1 -1
- package/dist/src/platforms/discordbot/index.js +2 -1
- package/dist/src/platforms/discordbot/index.js.map +1 -1
- package/dist/src/platforms/discordbot/listener.d.ts +43 -0
- package/dist/src/platforms/discordbot/listener.d.ts.map +1 -0
- package/dist/src/platforms/discordbot/listener.js +292 -0
- package/dist/src/platforms/discordbot/listener.js.map +1 -0
- package/dist/src/platforms/discordbot/types.d.ts +161 -0
- package/dist/src/platforms/discordbot/types.d.ts.map +1 -1
- package/dist/src/platforms/discordbot/types.js +34 -0
- package/dist/src/platforms/discordbot/types.js.map +1 -1
- package/dist/src/platforms/instagram/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/instagram/commands/auth.js +3 -1
- package/dist/src/platforms/instagram/commands/auth.js.map +1 -1
- package/dist/src/platforms/instagram/token-extractor.d.ts +2 -1
- package/dist/src/platforms/instagram/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/instagram/token-extractor.js +11 -2
- package/dist/src/platforms/instagram/token-extractor.js.map +1 -1
- package/dist/src/platforms/slack/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/auth.js +4 -2
- package/dist/src/platforms/slack/commands/auth.js.map +1 -1
- package/dist/src/platforms/slack/token-extractor.d.ts +4 -1
- package/dist/src/platforms/slack/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/slack/token-extractor.js +64 -15
- 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 +15 -3
- package/dist/src/platforms/slackbot/cli.js.map +1 -1
- package/dist/src/platforms/slackbot/client.d.ts +22 -1
- package/dist/src/platforms/slackbot/client.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/client.js +104 -1
- package/dist/src/platforms/slackbot/client.js.map +1 -1
- package/dist/src/platforms/slackbot/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/commands/auth.js +1 -5
- package/dist/src/platforms/slackbot/commands/auth.js.map +1 -1
- package/dist/src/platforms/slackbot/commands/file.d.ts +3 -0
- package/dist/src/platforms/slackbot/commands/file.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/commands/file.js +164 -0
- package/dist/src/platforms/slackbot/commands/file.js.map +1 -0
- package/dist/src/platforms/slackbot/commands/index.d.ts +1 -0
- package/dist/src/platforms/slackbot/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/commands/index.js +1 -0
- package/dist/src/platforms/slackbot/commands/index.js.map +1 -1
- package/dist/src/platforms/slackbot/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/commands/message.js +19 -0
- package/dist/src/platforms/slackbot/commands/message.js.map +1 -1
- package/dist/src/platforms/slackbot/commands/whoami.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/commands/whoami.js +1 -6
- package/dist/src/platforms/slackbot/commands/whoami.js.map +1 -1
- package/dist/src/platforms/slackbot/credential-manager.d.ts +1 -0
- package/dist/src/platforms/slackbot/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/credential-manager.js +30 -2
- package/dist/src/platforms/slackbot/credential-manager.js.map +1 -1
- package/dist/src/platforms/slackbot/index.d.ts +4 -1
- package/dist/src/platforms/slackbot/index.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/index.js +1 -0
- package/dist/src/platforms/slackbot/index.js.map +1 -1
- package/dist/src/platforms/slackbot/listener.d.ts +44 -0
- package/dist/src/platforms/slackbot/listener.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/listener.js +313 -0
- package/dist/src/platforms/slackbot/listener.js.map +1 -0
- package/dist/src/platforms/slackbot/types.d.ts +196 -1
- package/dist/src/platforms/slackbot/types.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/types.js +4 -1
- package/dist/src/platforms/slackbot/types.js.map +1 -1
- package/dist/src/platforms/teams/commands/auth.d.ts +1 -0
- package/dist/src/platforms/teams/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/auth.js +37 -6
- package/dist/src/platforms/teams/commands/auth.js.map +1 -1
- package/dist/src/platforms/teams/ensure-auth.js +31 -9
- package/dist/src/platforms/teams/ensure-auth.js.map +1 -1
- package/dist/src/platforms/teams/token-extractor.d.ts +4 -1
- package/dist/src/platforms/teams/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/teams/token-extractor.js +80 -31
- package/dist/src/platforms/teams/token-extractor.js.map +1 -1
- package/dist/src/platforms/webex/commands/auth.d.ts +1 -0
- package/dist/src/platforms/webex/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/auth.js +3 -1
- package/dist/src/platforms/webex/commands/auth.js.map +1 -1
- package/dist/src/platforms/webex/token-extractor.d.ts +3 -1
- package/dist/src/platforms/webex/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/webex/token-extractor.js +16 -2
- package/dist/src/platforms/webex/token-extractor.js.map +1 -1
- package/dist/src/platforms/wechatbot/cli.d.ts.map +1 -1
- package/dist/src/platforms/wechatbot/cli.js +11 -1
- package/dist/src/platforms/wechatbot/cli.js.map +1 -1
- package/dist/src/platforms/wechatbot/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/wechatbot/commands/auth.js +1 -5
- package/dist/src/platforms/wechatbot/commands/auth.js.map +1 -1
- package/dist/src/platforms/wechatbot/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/wechatbot/commands/message.js +1 -6
- package/dist/src/platforms/wechatbot/commands/message.js.map +1 -1
- package/dist/src/platforms/wechatbot/commands/template.d.ts.map +1 -1
- package/dist/src/platforms/wechatbot/commands/template.js +1 -6
- package/dist/src/platforms/wechatbot/commands/template.js.map +1 -1
- package/dist/src/platforms/wechatbot/commands/user.d.ts.map +1 -1
- package/dist/src/platforms/wechatbot/commands/user.js +1 -6
- package/dist/src/platforms/wechatbot/commands/user.js.map +1 -1
- package/dist/src/platforms/wechatbot/commands/whoami.d.ts.map +1 -1
- package/dist/src/platforms/wechatbot/commands/whoami.js +1 -6
- package/dist/src/platforms/wechatbot/commands/whoami.js.map +1 -1
- package/dist/src/platforms/whatsappbot/cli.d.ts.map +1 -1
- package/dist/src/platforms/whatsappbot/cli.js +11 -1
- package/dist/src/platforms/whatsappbot/cli.js.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/auth.js +1 -5
- 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 +1 -6
- package/dist/src/platforms/whatsappbot/commands/message.js.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/template.d.ts.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/template.js +1 -6
- package/dist/src/platforms/whatsappbot/commands/template.js.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/whoami.d.ts.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/whoami.js +1 -6
- package/dist/src/platforms/whatsappbot/commands/whoami.js.map +1 -1
- package/dist/src/shared/chromium/browsers.d.ts +8 -0
- package/dist/src/shared/chromium/browsers.d.ts.map +1 -1
- package/dist/src/shared/chromium/browsers.js +58 -3
- package/dist/src/shared/chromium/browsers.js.map +1 -1
- package/dist/src/shared/chromium/cli-options.d.ts +5 -0
- package/dist/src/shared/chromium/cli-options.d.ts.map +1 -0
- package/dist/src/shared/chromium/cli-options.js +8 -0
- package/dist/src/shared/chromium/cli-options.js.map +1 -0
- package/dist/src/shared/chromium/decryptor.d.ts +6 -0
- package/dist/src/shared/chromium/decryptor.d.ts.map +1 -1
- package/dist/src/shared/chromium/decryptor.js +26 -6
- package/dist/src/shared/chromium/decryptor.js.map +1 -1
- package/dist/src/shared/chromium/index.d.ts +3 -1
- package/dist/src/shared/chromium/index.d.ts.map +1 -1
- package/dist/src/shared/chromium/index.js +2 -1
- package/dist/src/shared/chromium/index.js.map +1 -1
- package/dist/src/shared/utils/cli-output.d.ts +7 -0
- package/dist/src/shared/utils/cli-output.d.ts.map +1 -0
- package/dist/src/shared/utils/cli-output.js +7 -0
- package/dist/src/shared/utils/cli-output.js.map +1 -0
- package/dist/src/tui/app.d.ts.map +1 -1
- package/dist/src/tui/app.js +73 -20
- package/dist/src/tui/app.js.map +1 -1
- package/docs/content/docs/cli/channeltalk.mdx +4 -0
- package/docs/content/docs/cli/discord.mdx +5 -0
- package/docs/content/docs/cli/instagram.mdx +3 -0
- package/docs/content/docs/cli/slack.mdx +5 -0
- package/docs/content/docs/cli/slackbot.mdx +60 -22
- package/docs/content/docs/cli/teams.mdx +5 -0
- package/docs/content/docs/cli/webex.mdx +3 -0
- package/docs/content/docs/sdk/channeltalkbot.mdx +38 -1
- package/docs/content/docs/sdk/discordbot.mdx +501 -0
- package/docs/content/docs/sdk/meta.json +2 -0
- package/docs/content/docs/sdk/slackbot.mdx +576 -0
- package/e2e/README.md +1 -1
- package/e2e/channeltalk.e2e.test.ts +13 -13
- package/e2e/channeltalkbot.e2e.test.ts +13 -13
- package/e2e/config.ts +9 -4
- package/e2e/discord.e2e.test.ts +24 -24
- package/e2e/discordbot.e2e.test.ts +16 -16
- package/e2e/instagram.e2e.test.ts +10 -10
- package/e2e/kakaotalk.e2e.test.ts +7 -7
- package/e2e/line.e2e.test.ts +8 -8
- package/e2e/slack.e2e.test.ts +34 -34
- package/e2e/slackbot.e2e.test.ts +14 -14
- package/e2e/teams.e2e.test.ts +23 -23
- package/e2e/telegram.e2e.test.ts +8 -8
- package/e2e/webex.e2e.test.ts +14 -14
- package/e2e/whatsapp.e2e.test.ts +8 -8
- package/e2e/whatsappbot.e2e.test.ts +6 -6
- package/examples/discordbot-listen.ts +65 -0
- package/examples/slackbot-listen.ts +65 -0
- package/package.json +14 -1
- package/skills/agent-channeltalk/SKILL.md +5 -1
- package/skills/agent-channeltalk/references/authentication.md +5 -1
- package/skills/agent-channeltalkbot/SKILL.md +17 -3
- package/skills/agent-channeltalkbot/references/authentication.md +7 -5
- package/skills/agent-discord/SKILL.md +5 -1
- package/skills/agent-discord/references/authentication.md +7 -1
- package/skills/agent-discordbot/SKILL.md +13 -2
- package/skills/agent-discordbot/references/common-patterns.md +1 -1
- package/skills/agent-instagram/SKILL.md +7 -1
- package/skills/agent-instagram/references/authentication.md +6 -0
- package/skills/agent-kakaotalk/SKILL.md +1 -1
- package/skills/agent-line/SKILL.md +1 -1
- package/skills/agent-slack/SKILL.md +5 -1
- package/skills/agent-slack/references/authentication.md +7 -1
- package/skills/agent-slackbot/SKILL.md +56 -4
- package/skills/agent-slackbot/references/authentication.md +4 -0
- package/skills/agent-teams/SKILL.md +5 -1
- package/skills/agent-teams/references/authentication.md +7 -1
- package/skills/agent-telegram/SKILL.md +1 -1
- package/skills/agent-webex/SKILL.md +7 -1
- package/skills/agent-webex/references/authentication.md +6 -0
- package/skills/agent-wechatbot/SKILL.md +16 -1
- package/skills/agent-wechatbot/references/authentication.md +219 -0
- package/skills/agent-wechatbot/references/common-patterns.md +358 -0
- package/skills/agent-wechatbot/templates/account-summary.sh +122 -0
- package/skills/agent-wechatbot/templates/post-message.sh +122 -0
- package/skills/agent-wechatbot/templates/send-template.sh +152 -0
- package/skills/agent-whatsapp/SKILL.md +1 -1
- package/skills/agent-whatsappbot/SKILL.md +30 -1
- package/src/platforms/channeltalk/client.test.ts +26 -26
- package/src/platforms/channeltalk/commands/auth.test.ts +31 -19
- package/src/platforms/channeltalk/commands/auth.ts +15 -5
- package/src/platforms/channeltalk/commands/bot.test.ts +2 -2
- package/src/platforms/channeltalk/commands/chat.test.ts +3 -3
- package/src/platforms/channeltalk/commands/group.test.ts +4 -4
- package/src/platforms/channeltalk/commands/manager.test.ts +2 -2
- package/src/platforms/channeltalk/commands/message.test.ts +17 -17
- package/src/platforms/channeltalk/commands/snapshot.test.ts +7 -7
- package/src/platforms/channeltalk/commands/whoami.test.ts +3 -3
- package/src/platforms/channeltalk/credential-manager.test.ts +18 -18
- package/src/platforms/channeltalk/ensure-auth.test.ts +5 -5
- package/src/platforms/channeltalk/index.test.ts +23 -23
- package/src/platforms/channeltalk/token-extractor.test.ts +21 -21
- package/src/platforms/channeltalk/token-extractor.ts +24 -5
- package/src/platforms/channeltalk/types.test.ts +12 -12
- package/src/platforms/channeltalkbot/cli.ts +9 -0
- package/src/platforms/channeltalkbot/client.test.ts +14 -14
- package/src/platforms/channeltalkbot/commands/auth.test.ts +16 -16
- package/src/platforms/channeltalkbot/commands/auth.ts +1 -5
- package/src/platforms/channeltalkbot/commands/bot.test.ts +6 -6
- package/src/platforms/channeltalkbot/commands/bot.ts +1 -6
- package/src/platforms/channeltalkbot/commands/chat.test.ts +9 -9
- package/src/platforms/channeltalkbot/commands/chat.ts +1 -6
- package/src/platforms/channeltalkbot/commands/group.test.ts +6 -6
- package/src/platforms/channeltalkbot/commands/group.ts +1 -6
- package/src/platforms/channeltalkbot/commands/manager.test.ts +3 -3
- package/src/platforms/channeltalkbot/commands/manager.ts +1 -6
- package/src/platforms/channeltalkbot/commands/message.test.ts +10 -10
- package/src/platforms/channeltalkbot/commands/message.ts +1 -6
- package/src/platforms/channeltalkbot/commands/snapshot.test.ts +7 -7
- package/src/platforms/channeltalkbot/commands/whoami.test.ts +6 -4
- package/src/platforms/channeltalkbot/commands/whoami.ts +1 -6
- package/src/platforms/channeltalkbot/credential-manager.test.ts +123 -29
- package/src/platforms/channeltalkbot/credential-manager.ts +37 -4
- package/src/platforms/channeltalkbot/index.test.ts +15 -15
- package/src/platforms/discord/client.test.ts +28 -28
- package/src/platforms/discord/commands/auth.test.ts +7 -7
- package/src/platforms/discord/commands/auth.ts +13 -2
- package/src/platforms/discord/commands/channel.test.ts +7 -7
- package/src/platforms/discord/commands/dm.test.ts +4 -4
- package/src/platforms/discord/commands/file.test.ts +4 -4
- package/src/platforms/discord/commands/friend.test.ts +6 -6
- package/src/platforms/discord/commands/member.test.ts +5 -5
- package/src/platforms/discord/commands/mention.test.ts +5 -5
- package/src/platforms/discord/commands/message.test.ts +9 -9
- package/src/platforms/discord/commands/note.test.ts +6 -6
- package/src/platforms/discord/commands/profile.test.ts +4 -4
- package/src/platforms/discord/commands/reaction.test.ts +5 -5
- package/src/platforms/discord/commands/server.test.ts +7 -7
- package/src/platforms/discord/commands/snapshot.test.ts +6 -6
- package/src/platforms/discord/commands/thread.test.ts +6 -6
- package/src/platforms/discord/commands/user.test.ts +5 -5
- package/src/platforms/discord/commands/whoami.test.ts +6 -6
- package/src/platforms/discord/credential-manager.test.ts +16 -16
- package/src/platforms/discord/ensure-auth.test.ts +8 -8
- package/src/platforms/discord/index.test.ts +17 -17
- package/src/platforms/discord/listener.test.ts +92 -34
- package/src/platforms/discord/listener.ts +43 -19
- package/src/platforms/discord/token-extractor.test.ts +53 -53
- package/src/platforms/discord/token-extractor.ts +30 -6
- package/src/platforms/discord/types.test.ts +26 -26
- package/src/platforms/discordbot/cli.ts +10 -0
- package/src/platforms/discordbot/client.test.ts +31 -31
- package/src/platforms/discordbot/client.ts +4 -0
- package/src/platforms/discordbot/commands/auth.test.ts +18 -18
- package/src/platforms/discordbot/commands/auth.ts +1 -5
- package/src/platforms/discordbot/commands/channel.test.ts +11 -11
- package/src/platforms/discordbot/commands/file.test.ts +7 -7
- package/src/platforms/discordbot/commands/message.test.ts +25 -25
- package/src/platforms/discordbot/commands/message.ts +1 -6
- package/src/platforms/discordbot/commands/reaction.test.ts +6 -6
- package/src/platforms/discordbot/commands/server.test.ts +12 -12
- package/src/platforms/discordbot/commands/server.ts +1 -5
- package/src/platforms/discordbot/commands/snapshot.test.ts +13 -13
- package/src/platforms/discordbot/commands/thread.test.ts +10 -10
- package/src/platforms/discordbot/commands/user.test.ts +9 -9
- package/src/platforms/discordbot/commands/whoami.test.ts +4 -4
- package/src/platforms/discordbot/commands/whoami.ts +1 -6
- package/src/platforms/discordbot/credential-manager.test.ts +28 -28
- package/src/platforms/discordbot/index.test.ts +82 -0
- package/src/platforms/discordbot/index.ts +27 -9
- package/src/platforms/discordbot/listener.test.ts +1002 -0
- package/src/platforms/discordbot/listener.ts +321 -0
- package/src/platforms/discordbot/types.ts +163 -0
- package/src/platforms/instagram/client.test.ts +18 -18
- package/src/platforms/instagram/commands/auth.test.ts +11 -11
- package/src/platforms/instagram/commands/auth.ts +9 -1
- package/src/platforms/instagram/commands/chat.test.ts +6 -6
- package/src/platforms/instagram/commands/message.test.ts +11 -11
- package/src/platforms/instagram/commands/shared.test.ts +12 -12
- package/src/platforms/instagram/commands/whoami.test.ts +3 -3
- package/src/platforms/instagram/credential-manager.test.ts +21 -21
- package/src/platforms/instagram/ensure-auth.test.ts +4 -4
- package/src/platforms/instagram/index.test.ts +9 -9
- package/src/platforms/instagram/listener.test.ts +8 -8
- package/src/platforms/instagram/token-extractor.test.ts +35 -35
- package/src/platforms/instagram/token-extractor.ts +13 -1
- package/src/platforms/kakaotalk/client.test.ts +33 -33
- package/src/platforms/kakaotalk/commands/auth.test.ts +11 -11
- package/src/platforms/kakaotalk/commands/chat.test.ts +6 -6
- package/src/platforms/kakaotalk/commands/message.test.ts +7 -7
- package/src/platforms/kakaotalk/commands/whoami.test.ts +5 -5
- package/src/platforms/kakaotalk/credential-manager.test.ts +15 -15
- package/src/platforms/kakaotalk/index.test.ts +15 -15
- package/src/platforms/kakaotalk/listener.test.ts +17 -17
- package/src/platforms/line/client.test.ts +17 -17
- package/src/platforms/line/commands/auth.test.ts +8 -8
- package/src/platforms/line/commands/chat.test.ts +7 -7
- package/src/platforms/line/commands/friend.test.ts +6 -6
- package/src/platforms/line/commands/message.test.ts +7 -7
- package/src/platforms/line/commands/whoami.test.ts +6 -6
- package/src/platforms/line/credential-manager.test.ts +17 -17
- package/src/platforms/line/index.test.ts +10 -10
- package/src/platforms/line/listener.test.ts +15 -15
- package/src/platforms/line/types.test.ts +14 -14
- package/src/platforms/slack/cli.test.ts +8 -8
- package/src/platforms/slack/client.test.ts +151 -151
- package/src/platforms/slack/commands/activity.test.ts +13 -13
- package/src/platforms/slack/commands/auth.test.ts +34 -34
- package/src/platforms/slack/commands/auth.ts +11 -2
- package/src/platforms/slack/commands/bookmark.test.ts +9 -9
- package/src/platforms/slack/commands/channel.test.ts +17 -17
- package/src/platforms/slack/commands/drafts.test.ts +7 -7
- package/src/platforms/slack/commands/emoji.test.ts +3 -3
- package/src/platforms/slack/commands/file.test.ts +12 -12
- package/src/platforms/slack/commands/message.test.ts +19 -19
- package/src/platforms/slack/commands/pin.test.ts +7 -7
- package/src/platforms/slack/commands/reaction.test.ts +10 -10
- package/src/platforms/slack/commands/reminder.test.ts +9 -9
- package/src/platforms/slack/commands/saved.test.ts +7 -7
- package/src/platforms/slack/commands/sections.test.ts +5 -5
- package/src/platforms/slack/commands/snapshot.test.ts +13 -13
- package/src/platforms/slack/commands/unread.test.ts +6 -6
- package/src/platforms/slack/commands/user.test.ts +10 -10
- package/src/platforms/slack/commands/usergroup.test.ts +15 -15
- package/src/platforms/slack/commands/whoami.test.ts +6 -6
- package/src/platforms/slack/commands/workspace.test.ts +26 -26
- package/src/platforms/slack/credential-manager.test.ts +14 -14
- package/src/platforms/slack/ensure-auth.test.ts +21 -21
- package/src/platforms/slack/index.test.ts +12 -12
- package/src/platforms/slack/listener.test.ts +17 -17
- package/src/platforms/slack/token-extractor-node.test.ts +2 -2
- package/src/platforms/slack/token-extractor.test.ts +133 -37
- package/src/platforms/slack/token-extractor.ts +76 -13
- package/src/platforms/slack/types.test.ts +21 -21
- package/src/platforms/slackbot/cli.ts +13 -1
- package/src/platforms/slackbot/client.test.ts +296 -22
- package/src/platforms/slackbot/client.ts +130 -2
- package/src/platforms/slackbot/commands/auth.test.ts +14 -14
- package/src/platforms/slackbot/commands/auth.ts +1 -5
- package/src/platforms/slackbot/commands/channel.test.ts +7 -7
- package/src/platforms/slackbot/commands/file.test.ts +201 -0
- package/src/platforms/slackbot/commands/file.ts +212 -0
- package/src/platforms/slackbot/commands/index.ts +1 -0
- package/src/platforms/slackbot/commands/message.test.ts +13 -13
- package/src/platforms/slackbot/commands/message.ts +22 -0
- package/src/platforms/slackbot/commands/reaction.test.ts +6 -6
- package/src/platforms/slackbot/commands/user.test.ts +7 -7
- package/src/platforms/slackbot/commands/whoami.test.ts +4 -4
- package/src/platforms/slackbot/commands/whoami.ts +1 -6
- package/src/platforms/slackbot/credential-manager.test.ts +83 -23
- package/src/platforms/slackbot/credential-manager.ts +32 -2
- package/src/platforms/slackbot/index.test.ts +59 -0
- package/src/platforms/slackbot/index.ts +31 -7
- package/src/platforms/slackbot/listener.test.ts +1012 -0
- package/src/platforms/slackbot/listener.ts +362 -0
- package/src/platforms/slackbot/types.test.ts +7 -7
- package/src/platforms/slackbot/types.ts +224 -1
- package/src/platforms/teams/client.test.ts +30 -30
- package/src/platforms/teams/commands/auth.test.ts +9 -9
- package/src/platforms/teams/commands/auth.ts +66 -7
- package/src/platforms/teams/commands/channel.test.ts +7 -7
- package/src/platforms/teams/commands/file.test.ts +4 -4
- package/src/platforms/teams/commands/message.test.ts +5 -5
- package/src/platforms/teams/commands/reaction.test.ts +4 -4
- package/src/platforms/teams/commands/snapshot.test.ts +7 -7
- package/src/platforms/teams/commands/team.test.ts +8 -8
- package/src/platforms/teams/commands/user.test.ts +4 -4
- package/src/platforms/teams/commands/whoami.test.ts +6 -6
- package/src/platforms/teams/credential-manager.test.ts +17 -17
- package/src/platforms/teams/ensure-auth.test.ts +69 -18
- package/src/platforms/teams/ensure-auth.ts +39 -11
- package/src/platforms/teams/index.test.ts +15 -15
- package/src/platforms/teams/token-extractor.test.ts +251 -69
- package/src/platforms/teams/token-extractor.ts +94 -31
- package/src/platforms/teams/types.test.ts +26 -26
- package/src/platforms/telegram/app-config.test.ts +4 -4
- package/src/platforms/telegram/chat-utils.test.ts +12 -12
- package/src/platforms/telegram/client.test.ts +4 -4
- package/src/platforms/telegram/commands/auth.test.ts +16 -16
- package/src/platforms/telegram/commands/chat.test.ts +9 -9
- package/src/platforms/telegram/commands/message.test.ts +6 -6
- package/src/platforms/telegram/commands/shared.test.ts +3 -3
- package/src/platforms/telegram/commands/whoami.test.ts +3 -3
- package/src/platforms/telegram/credential-manager.test.ts +10 -10
- package/src/platforms/telegram/types.test.ts +6 -6
- package/src/platforms/webex/app-config.test.ts +8 -8
- package/src/platforms/webex/cli.test.ts +5 -5
- package/src/platforms/webex/client.test.ts +65 -65
- package/src/platforms/webex/commands/auth.test.ts +18 -18
- package/src/platforms/webex/commands/auth.ts +13 -2
- package/src/platforms/webex/commands/member.test.ts +5 -5
- package/src/platforms/webex/commands/message.test.ts +12 -12
- package/src/platforms/webex/commands/snapshot.test.ts +5 -5
- package/src/platforms/webex/commands/space.test.ts +10 -10
- package/src/platforms/webex/commands/whoami.test.ts +6 -6
- package/src/platforms/webex/credential-manager.test.ts +22 -22
- package/src/platforms/webex/encryption.test.ts +4 -4
- package/src/platforms/webex/ensure-auth.test.ts +5 -5
- package/src/platforms/webex/index.test.ts +5 -5
- package/src/platforms/webex/markdown-to-html.test.ts +33 -33
- package/src/platforms/webex/token-extractor.test.ts +23 -23
- package/src/platforms/webex/token-extractor.ts +25 -3
- package/src/platforms/webex/types.test.ts +27 -27
- package/src/platforms/wechatbot/cli.ts +9 -0
- package/src/platforms/wechatbot/client.test.ts +27 -27
- package/src/platforms/wechatbot/commands/auth.test.ts +15 -15
- package/src/platforms/wechatbot/commands/auth.ts +1 -5
- package/src/platforms/wechatbot/commands/message.test.ts +8 -8
- package/src/platforms/wechatbot/commands/message.ts +1 -6
- package/src/platforms/wechatbot/commands/template.test.ts +9 -9
- package/src/platforms/wechatbot/commands/template.ts +1 -6
- package/src/platforms/wechatbot/commands/user.test.ts +7 -7
- package/src/platforms/wechatbot/commands/user.ts +1 -6
- package/src/platforms/wechatbot/commands/whoami.test.ts +5 -5
- package/src/platforms/wechatbot/commands/whoami.ts +1 -6
- package/src/platforms/wechatbot/credential-manager.test.ts +18 -18
- package/src/platforms/wechatbot/index.test.ts +10 -10
- package/src/platforms/wechatbot/types.test.ts +25 -25
- package/src/platforms/whatsapp/commands/auth.test.ts +13 -13
- package/src/platforms/whatsapp/commands/chat.test.ts +8 -8
- package/src/platforms/whatsapp/commands/message.test.ts +10 -10
- package/src/platforms/whatsapp/commands/whoami.test.ts +3 -3
- package/src/platforms/whatsapp/credential-manager.test.ts +23 -23
- package/src/platforms/whatsapp/ensure-auth.test.ts +4 -4
- package/src/platforms/whatsapp/index.test.ts +8 -8
- package/src/platforms/whatsapp/types.test.ts +42 -42
- package/src/platforms/whatsappbot/cli.ts +9 -0
- package/src/platforms/whatsappbot/client.test.ts +27 -27
- package/src/platforms/whatsappbot/commands/auth.test.ts +14 -14
- package/src/platforms/whatsappbot/commands/auth.ts +1 -5
- package/src/platforms/whatsappbot/commands/message.test.ts +16 -16
- package/src/platforms/whatsappbot/commands/message.ts +1 -6
- package/src/platforms/whatsappbot/commands/template.test.ts +9 -9
- package/src/platforms/whatsappbot/commands/template.ts +1 -6
- package/src/platforms/whatsappbot/commands/whoami.test.ts +5 -5
- package/src/platforms/whatsappbot/commands/whoami.ts +1 -6
- package/src/platforms/whatsappbot/credential-manager.test.ts +18 -18
- package/src/platforms/whatsappbot/index.test.ts +7 -7
- package/src/platforms/whatsappbot/types.test.ts +18 -18
- package/src/shared/chromium/browsers.test.ts +102 -22
- package/src/shared/chromium/browsers.ts +72 -3
- package/src/shared/chromium/cli-options.test.ts +22 -0
- package/src/shared/chromium/cli-options.ts +12 -0
- package/src/shared/chromium/cookie-reader.test.ts +13 -13
- package/src/shared/chromium/decryptor.test.ts +97 -32
- package/src/shared/chromium/decryptor.ts +27 -6
- package/src/shared/chromium/index.ts +3 -0
- package/src/shared/utils/cli-output.test.ts +57 -0
- package/src/shared/utils/cli-output.ts +8 -0
- package/src/shared/utils/concurrency.test.ts +6 -6
- package/src/shared/utils/derived-key-cache.test.ts +11 -11
- package/src/tui/app.ts +129 -20
- package/src/tui/utils.test.ts +31 -31
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect,
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it } from 'bun:test'
|
|
2
2
|
import { existsSync, mkdtempSync, rmSync } from 'node:fs'
|
|
3
3
|
import { stat } from 'node:fs/promises'
|
|
4
4
|
import { tmpdir } from 'node:os'
|
|
@@ -42,14 +42,14 @@ describe('ChannelCredentialManager', () => {
|
|
|
42
42
|
delete process.env.E2E_CHANNEL_WORKSPACE_ID
|
|
43
43
|
})
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
it('returns empty config when no file exists', async () => {
|
|
46
46
|
const config = await manager.load()
|
|
47
47
|
|
|
48
48
|
expect(config.current).toBeNull()
|
|
49
49
|
expect(config.workspaces).toEqual({})
|
|
50
50
|
})
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
it('persists config to file', async () => {
|
|
53
53
|
const config = {
|
|
54
54
|
current: { workspace_id: '232986' },
|
|
55
55
|
workspaces: {
|
|
@@ -63,11 +63,11 @@ describe('ChannelCredentialManager', () => {
|
|
|
63
63
|
expect(loaded).toEqual(config)
|
|
64
64
|
})
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
it('returns null when no credentials exist', async () => {
|
|
67
67
|
expect(await manager.getCredentials()).toBeNull()
|
|
68
68
|
})
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
it('returns current workspace credentials', async () => {
|
|
71
71
|
await manager.setCredentials(WORKSPACE_A)
|
|
72
72
|
|
|
73
73
|
expect(await manager.getCredentials()).toEqual({
|
|
@@ -78,7 +78,7 @@ describe('ChannelCredentialManager', () => {
|
|
|
78
78
|
})
|
|
79
79
|
})
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
it('returns specific workspace by id', async () => {
|
|
82
82
|
await manager.setCredentials(WORKSPACE_A)
|
|
83
83
|
await manager.setCredentials(WORKSPACE_B)
|
|
84
84
|
|
|
@@ -90,13 +90,13 @@ describe('ChannelCredentialManager', () => {
|
|
|
90
90
|
})
|
|
91
91
|
})
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
it('returns null for unknown workspace id', async () => {
|
|
94
94
|
await manager.setCredentials(WORKSPACE_A)
|
|
95
95
|
|
|
96
96
|
expect(await manager.getCredentials('missing')).toBeNull()
|
|
97
97
|
})
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
it('env vars take precedence when no workspace id is specified', async () => {
|
|
100
100
|
await manager.setCredentials(WORKSPACE_A)
|
|
101
101
|
|
|
102
102
|
process.env.E2E_CHANNEL_ACCOUNT_COOKIE = 'env-account-cookie'
|
|
@@ -111,7 +111,7 @@ describe('ChannelCredentialManager', () => {
|
|
|
111
111
|
})
|
|
112
112
|
})
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
it('env vars are ignored when a workspace id is explicitly provided', async () => {
|
|
115
115
|
await manager.setCredentials(WORKSPACE_A)
|
|
116
116
|
|
|
117
117
|
process.env.E2E_CHANNEL_ACCOUNT_COOKIE = 'env-account-cookie'
|
|
@@ -126,7 +126,7 @@ describe('ChannelCredentialManager', () => {
|
|
|
126
126
|
})
|
|
127
127
|
})
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
it('stores multiple workspaces and marks the latest current', async () => {
|
|
130
130
|
await manager.setCredentials(WORKSPACE_A)
|
|
131
131
|
await manager.setCredentials(WORKSPACE_B)
|
|
132
132
|
|
|
@@ -136,7 +136,7 @@ describe('ChannelCredentialManager', () => {
|
|
|
136
136
|
expect(config.current).toEqual({ workspace_id: '232987' })
|
|
137
137
|
})
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
it('lists all workspaces with current flag', async () => {
|
|
140
140
|
await manager.setCredentials(WORKSPACE_A)
|
|
141
141
|
await manager.setCredentials(WORKSPACE_B)
|
|
142
142
|
|
|
@@ -147,7 +147,7 @@ describe('ChannelCredentialManager', () => {
|
|
|
147
147
|
expect(all.find((workspace) => workspace.workspace_id === '232987')?.is_current).toBe(true)
|
|
148
148
|
})
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
it('switches current workspace', async () => {
|
|
151
151
|
await manager.setCredentials(WORKSPACE_A)
|
|
152
152
|
await manager.setCredentials(WORKSPACE_B)
|
|
153
153
|
|
|
@@ -160,11 +160,11 @@ describe('ChannelCredentialManager', () => {
|
|
|
160
160
|
})
|
|
161
161
|
})
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
it('returns false when setting an unknown current workspace', async () => {
|
|
164
164
|
expect(await manager.setCurrent('missing')).toBe(false)
|
|
165
165
|
})
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
it('removes a workspace by id', async () => {
|
|
168
168
|
await manager.setCredentials(WORKSPACE_A)
|
|
169
169
|
await manager.setCredentials(WORKSPACE_B)
|
|
170
170
|
|
|
@@ -172,7 +172,7 @@ describe('ChannelCredentialManager', () => {
|
|
|
172
172
|
expect(await manager.listAll()).toHaveLength(1)
|
|
173
173
|
})
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
it('clears current when current workspace is removed', async () => {
|
|
176
176
|
await manager.setCredentials(WORKSPACE_A)
|
|
177
177
|
|
|
178
178
|
await manager.removeWorkspace(WORKSPACE_A.workspace_id)
|
|
@@ -181,11 +181,11 @@ describe('ChannelCredentialManager', () => {
|
|
|
181
181
|
expect(config.current).toBeNull()
|
|
182
182
|
})
|
|
183
183
|
|
|
184
|
-
|
|
184
|
+
it('returns false when removing an unknown workspace', async () => {
|
|
185
185
|
expect(await manager.removeWorkspace('missing')).toBe(false)
|
|
186
186
|
})
|
|
187
187
|
|
|
188
|
-
|
|
188
|
+
it('clears all credentials', async () => {
|
|
189
189
|
await manager.setCredentials(WORKSPACE_A)
|
|
190
190
|
await manager.setCredentials(WORKSPACE_B)
|
|
191
191
|
|
|
@@ -196,7 +196,7 @@ describe('ChannelCredentialManager', () => {
|
|
|
196
196
|
expect(config.workspaces).toEqual({})
|
|
197
197
|
})
|
|
198
198
|
|
|
199
|
-
|
|
199
|
+
it('saves file with secure permissions', async () => {
|
|
200
200
|
await manager.setCredentials(WORKSPACE_A)
|
|
201
201
|
|
|
202
202
|
const credentialsPath = join(tempDir, 'channel-credentials.json')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { afterAll, beforeEach, describe, expect, mock,
|
|
1
|
+
import { afterAll, beforeEach, describe, expect, mock, it } from 'bun:test'
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
ensureChannelAuth,
|
|
@@ -62,7 +62,7 @@ describe('ensureChannelAuth', () => {
|
|
|
62
62
|
mockListChannels.mockImplementation(() => Promise.resolve([{ id: 'ws-1', name: 'Workspace 1' }]))
|
|
63
63
|
})
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
it('extracts and saves workspaces when no credentials exist', async () => {
|
|
66
66
|
mockExtract.mockImplementation(() =>
|
|
67
67
|
Promise.resolve([
|
|
68
68
|
{
|
|
@@ -101,7 +101,7 @@ describe('ensureChannelAuth', () => {
|
|
|
101
101
|
expect(mockSetCurrent).toHaveBeenCalledWith('ws-1')
|
|
102
102
|
})
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
it('returns early when stored credentials are valid', async () => {
|
|
105
105
|
mockGetCredentials.mockImplementation(() =>
|
|
106
106
|
Promise.resolve({
|
|
107
107
|
workspace_id: 'ws-1',
|
|
@@ -118,7 +118,7 @@ describe('ensureChannelAuth', () => {
|
|
|
118
118
|
expect(mockSetCredentials).not.toHaveBeenCalled()
|
|
119
119
|
})
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
it('re-extracts when stored credentials are invalid', async () => {
|
|
122
122
|
mockGetCredentials.mockImplementation(() =>
|
|
123
123
|
Promise.resolve({
|
|
124
124
|
workspace_id: 'ws-1',
|
|
@@ -148,7 +148,7 @@ describe('ensureChannelAuth', () => {
|
|
|
148
148
|
expect(mockSetCurrent).toHaveBeenCalledWith('ws-1')
|
|
149
149
|
})
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
it('returns gracefully when extractor yields no cookies', async () => {
|
|
152
152
|
await ensureChannelAuth()
|
|
153
153
|
|
|
154
154
|
expect(mockExtract).toHaveBeenCalledTimes(1)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { expect,
|
|
1
|
+
import { expect, it } from 'bun:test'
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
BlockInlineAttrsSchema,
|
|
@@ -25,90 +25,90 @@ import {
|
|
|
25
25
|
MessageBlockSchema,
|
|
26
26
|
} from '@/platforms/channeltalk/index'
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
it('ChannelClient is exported from barrel', () => {
|
|
29
29
|
expect(typeof ChannelClient).toBe('function')
|
|
30
30
|
})
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
it('ChannelError is exported from barrel', () => {
|
|
33
33
|
expect(typeof ChannelError).toBe('function')
|
|
34
34
|
})
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
it('ChannelCredentialManager is exported from barrel', () => {
|
|
37
37
|
expect(typeof ChannelCredentialManager).toBe('function')
|
|
38
38
|
})
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
it('ChannelSchema is exported from barrel', () => {
|
|
41
41
|
expect(typeof ChannelSchema.parse).toBe('function')
|
|
42
42
|
})
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
it('ChannelAccountSchema is exported from barrel', () => {
|
|
45
45
|
expect(typeof ChannelAccountSchema.parse).toBe('function')
|
|
46
46
|
})
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
it('ChannelBotSchema is exported from barrel', () => {
|
|
49
49
|
expect(typeof ChannelBotSchema.parse).toBe('function')
|
|
50
50
|
})
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
it('ChannelConfigSchema is exported from barrel', () => {
|
|
53
53
|
expect(typeof ChannelConfigSchema.parse).toBe('function')
|
|
54
54
|
})
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
it('ChannelCredentialsSchema is exported from barrel', () => {
|
|
57
57
|
expect(typeof ChannelCredentialsSchema.parse).toBe('function')
|
|
58
58
|
})
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
it('ChannelDirectChatSchema is exported from barrel', () => {
|
|
61
61
|
expect(typeof ChannelDirectChatSchema.parse).toBe('function')
|
|
62
62
|
})
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
it('ChannelGroupSchema is exported from barrel', () => {
|
|
65
65
|
expect(typeof ChannelGroupSchema.parse).toBe('function')
|
|
66
66
|
})
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
it('ChannelManagerSchema is exported from barrel', () => {
|
|
69
69
|
expect(typeof ChannelManagerSchema.parse).toBe('function')
|
|
70
70
|
})
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
it('ChannelMessageSchema is exported from barrel', () => {
|
|
73
73
|
expect(typeof ChannelMessageSchema.parse).toBe('function')
|
|
74
74
|
})
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
it('ChannelSessionSchema is exported from barrel', () => {
|
|
77
77
|
expect(typeof ChannelSessionSchema.parse).toBe('function')
|
|
78
78
|
})
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
it('ChannelUserChatSchema is exported from barrel', () => {
|
|
81
81
|
expect(typeof ChannelUserChatSchema.parse).toBe('function')
|
|
82
82
|
})
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
it('ChannelWorkspaceEntrySchema is exported from barrel', () => {
|
|
85
85
|
expect(typeof ChannelWorkspaceEntrySchema.parse).toBe('function')
|
|
86
86
|
})
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
it('ChannelSearchHighlightSchema is exported from barrel', () => {
|
|
89
89
|
expect(typeof ChannelSearchHighlightSchema.parse).toBe('function')
|
|
90
90
|
})
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
it('ChannelSearchHitSchema is exported from barrel', () => {
|
|
93
93
|
expect(typeof ChannelSearchHitSchema.parse).toBe('function')
|
|
94
94
|
})
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
it('ChannelSearchResponseSchema is exported from barrel', () => {
|
|
97
97
|
expect(typeof ChannelSearchResponseSchema.parse).toBe('function')
|
|
98
98
|
})
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
it('ExtractedChannelTokenSchema is exported from barrel', () => {
|
|
101
101
|
expect(typeof ExtractedChannelTokenSchema.parse).toBe('function')
|
|
102
102
|
})
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
it('MessageBlockSchema is exported from barrel', () => {
|
|
105
105
|
expect(typeof MessageBlockSchema.parse).toBe('function')
|
|
106
106
|
})
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
it('BlockInlineSchema is exported from barrel', () => {
|
|
109
109
|
expect(typeof BlockInlineSchema.parse).toBe('function')
|
|
110
110
|
})
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
it('BlockInlineAttrsSchema is exported from barrel', () => {
|
|
113
113
|
expect(typeof BlockInlineAttrsSchema.parse).toBe('function')
|
|
114
114
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { afterEach, describe, expect, spyOn,
|
|
1
|
+
import { afterEach, describe, expect, spyOn, it } from 'bun:test'
|
|
2
2
|
import { createCipheriv, randomBytes } from 'node:crypto'
|
|
3
3
|
import { existsSync, mkdtempSync, mkdirSync, rmSync, writeFileSync } from 'node:fs'
|
|
4
4
|
import { tmpdir } from 'node:os'
|
|
@@ -18,19 +18,19 @@ describe('ChannelTokenExtractor', () => {
|
|
|
18
18
|
})
|
|
19
19
|
|
|
20
20
|
describe('getAppDataDir', () => {
|
|
21
|
-
|
|
21
|
+
it('returns null for unsupported platform', () => {
|
|
22
22
|
const extractor = new ChannelTokenExtractor('freebsd' as NodeJS.Platform)
|
|
23
23
|
expect(extractor.getAppDataDir()).toBeNull()
|
|
24
24
|
})
|
|
25
25
|
})
|
|
26
26
|
|
|
27
27
|
describe('getCookiesPath', () => {
|
|
28
|
-
|
|
28
|
+
it('returns null for unsupported platform', () => {
|
|
29
29
|
const extractor = new ChannelTokenExtractor('freebsd' as NodeJS.Platform)
|
|
30
30
|
expect(extractor.getCookiesPath()).toBeNull()
|
|
31
31
|
})
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
it('returns win32 path under AppData/Roaming/Channel Talk/Network', () => {
|
|
34
34
|
// given
|
|
35
35
|
const tempDir = mkdtempSync(join(tmpdir(), 'channel-win-'))
|
|
36
36
|
tempDirs.push(tempDir)
|
|
@@ -58,7 +58,7 @@ describe('ChannelTokenExtractor', () => {
|
|
|
58
58
|
})
|
|
59
59
|
|
|
60
60
|
describe('getBrowserCookiesPaths', () => {
|
|
61
|
-
|
|
61
|
+
it('returns browser cookie paths on macOS including Default profile', () => {
|
|
62
62
|
const extractor = new ChannelTokenExtractor('darwin')
|
|
63
63
|
const paths = extractor.getBrowserCookiesPaths()
|
|
64
64
|
|
|
@@ -67,7 +67,7 @@ describe('ChannelTokenExtractor', () => {
|
|
|
67
67
|
expect(paths).toContain(join(chromeBase, 'Default', 'Network', 'Cookies'))
|
|
68
68
|
})
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
it('returns browser cookie paths on Linux', () => {
|
|
71
71
|
const extractor = new ChannelTokenExtractor('linux')
|
|
72
72
|
const paths = extractor.getBrowserCookiesPaths()
|
|
73
73
|
|
|
@@ -75,7 +75,7 @@ describe('ChannelTokenExtractor', () => {
|
|
|
75
75
|
expect(paths).toContain(join(chromeBase, 'Default', 'Cookies'))
|
|
76
76
|
})
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
it('returns browser cookie paths on Windows', () => {
|
|
79
79
|
const extractor = new ChannelTokenExtractor('win32')
|
|
80
80
|
const paths = extractor.getBrowserCookiesPaths()
|
|
81
81
|
|
|
@@ -84,14 +84,14 @@ describe('ChannelTokenExtractor', () => {
|
|
|
84
84
|
expect(paths).toContain(join(chromeBase, 'Default', 'Cookies'))
|
|
85
85
|
})
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
it('returns empty array for unsupported platform', () => {
|
|
88
88
|
const extractor = new ChannelTokenExtractor('freebsd' as NodeJS.Platform)
|
|
89
89
|
expect(extractor.getBrowserCookiesPaths()).toEqual([])
|
|
90
90
|
})
|
|
91
91
|
})
|
|
92
92
|
|
|
93
93
|
describe('extract', () => {
|
|
94
|
-
|
|
94
|
+
it('returns empty array when desktop cookies path does not exist', async () => {
|
|
95
95
|
class MissingPathExtractor extends ChannelTokenExtractor {
|
|
96
96
|
override getCookiesPath(): string | null {
|
|
97
97
|
return null
|
|
@@ -103,7 +103,7 @@ describe('ChannelTokenExtractor', () => {
|
|
|
103
103
|
expect(await extractor.extract()).toEqual([])
|
|
104
104
|
})
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
it('tries desktop app before browser profiles and collects both', async () => {
|
|
107
107
|
const extractor = new ChannelTokenExtractor('darwin')
|
|
108
108
|
|
|
109
109
|
const desktopSpy = spyOn(extractor as any, 'extractFromDesktopApp').mockResolvedValue({
|
|
@@ -122,7 +122,7 @@ describe('ChannelTokenExtractor', () => {
|
|
|
122
122
|
browserSpy.mockRestore()
|
|
123
123
|
})
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
it('includes browser profiles even when desktop extraction returns null', async () => {
|
|
126
126
|
const extractor = new ChannelTokenExtractor('darwin')
|
|
127
127
|
|
|
128
128
|
const desktopSpy = spyOn(extractor as any, 'extractFromDesktopApp').mockResolvedValue(null)
|
|
@@ -143,7 +143,7 @@ describe('ChannelTokenExtractor', () => {
|
|
|
143
143
|
browserSpy.mockRestore()
|
|
144
144
|
})
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
it('extracts plaintext cookies from a real sqlite database', async () => {
|
|
147
147
|
const tempDir = mkdtempSync(join(tmpdir(), 'channel-cookie-db-'))
|
|
148
148
|
tempDirs.push(tempDir)
|
|
149
149
|
const dbPath = join(tempDir, 'Cookies')
|
|
@@ -173,7 +173,7 @@ describe('ChannelTokenExtractor', () => {
|
|
|
173
173
|
])
|
|
174
174
|
})
|
|
175
175
|
|
|
176
|
-
|
|
176
|
+
it('returns token with undefined sessionCookie when only x-account is present', async () => {
|
|
177
177
|
const tempDir = mkdtempSync(join(tmpdir(), 'channel-cookie-db-'))
|
|
178
178
|
tempDirs.push(tempDir)
|
|
179
179
|
const dbPath = join(tempDir, 'Cookies')
|
|
@@ -199,7 +199,7 @@ describe('ChannelTokenExtractor', () => {
|
|
|
199
199
|
expect(result[0]?.sessionCookie).toBeUndefined()
|
|
200
200
|
})
|
|
201
201
|
|
|
202
|
-
|
|
202
|
+
it('returns empty array when x-account is missing', async () => {
|
|
203
203
|
const tempDir = mkdtempSync(join(tmpdir(), 'channel-cookie-db-'))
|
|
204
204
|
tempDirs.push(tempDir)
|
|
205
205
|
const dbPath = join(tempDir, 'Cookies')
|
|
@@ -222,7 +222,7 @@ describe('ChannelTokenExtractor', () => {
|
|
|
222
222
|
expect(await extractor.extract()).toEqual([])
|
|
223
223
|
})
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
it('decrypts AES-256-GCM encrypted cookies using master key', async () => {
|
|
226
226
|
// given — known master key and AES-256-GCM encrypted cookie
|
|
227
227
|
const masterKey = randomBytes(32)
|
|
228
228
|
const accountValue = 'encrypted-account-jwt'
|
|
@@ -277,7 +277,7 @@ describe('ChannelTokenExtractor', () => {
|
|
|
277
277
|
expect(result[0]?.sessionCookie).toBe('encrypted-session-jwt')
|
|
278
278
|
})
|
|
279
279
|
|
|
280
|
-
|
|
280
|
+
it('deduplicates entries with the same accountCookie from desktop and browser', async () => {
|
|
281
281
|
const extractor = new ChannelTokenExtractor('darwin')
|
|
282
282
|
|
|
283
283
|
const desktopSpy = spyOn(extractor as any, 'extractFromDesktopApp').mockResolvedValue({
|
|
@@ -299,7 +299,7 @@ describe('ChannelTokenExtractor', () => {
|
|
|
299
299
|
browserSpy.mockRestore()
|
|
300
300
|
})
|
|
301
301
|
|
|
302
|
-
|
|
302
|
+
it('returns multiple distinct accounts from desktop and browser sources', async () => {
|
|
303
303
|
const extractor = new ChannelTokenExtractor('darwin')
|
|
304
304
|
|
|
305
305
|
const desktopSpy = spyOn(extractor as any, 'extractFromDesktopApp').mockResolvedValue({
|
|
@@ -322,7 +322,7 @@ describe('ChannelTokenExtractor', () => {
|
|
|
322
322
|
browserSpy.mockRestore()
|
|
323
323
|
})
|
|
324
324
|
|
|
325
|
-
|
|
325
|
+
it('returns empty array when DPAPI decryption fails', async () => {
|
|
326
326
|
// given
|
|
327
327
|
const masterKey = randomBytes(32)
|
|
328
328
|
const encryptAccount = encryptAESGCM('account-jwt', masterKey)
|
|
@@ -369,14 +369,14 @@ describe('ChannelTokenExtractor', () => {
|
|
|
369
369
|
})
|
|
370
370
|
|
|
371
371
|
describe('decryptDPAPI', () => {
|
|
372
|
-
|
|
372
|
+
it('returns null on non-win32 platform', () => {
|
|
373
373
|
const extractor = new ChannelTokenExtractor('darwin')
|
|
374
374
|
expect(extractor.decryptDPAPI(Buffer.from('test'))).toBeNull()
|
|
375
375
|
})
|
|
376
376
|
})
|
|
377
377
|
|
|
378
378
|
describe('decryptBrowserCookie', () => {
|
|
379
|
-
|
|
379
|
+
it('decrypts v10-prefixed browser cookie using macOS keychain password (AES-128-CBC)', () => {
|
|
380
380
|
// given — AES-128-CBC encrypted cookie with macOS keychain-derived key
|
|
381
381
|
const { createCipheriv, pbkdf2Sync } = require('node:crypto')
|
|
382
382
|
const password = 'test-keychain-password'
|
|
@@ -400,7 +400,7 @@ describe('ChannelTokenExtractor', () => {
|
|
|
400
400
|
execSecuritySpy.mockRestore()
|
|
401
401
|
})
|
|
402
402
|
|
|
403
|
-
|
|
403
|
+
it('decrypts v10-prefixed browser cookie using Linux peanuts key (AES-128-CBC)', () => {
|
|
404
404
|
// given — AES-128-CBC encrypted cookie with Linux Chromium peanuts key
|
|
405
405
|
const { createCipheriv, pbkdf2Sync } = require('node:crypto')
|
|
406
406
|
const key = pbkdf2Sync('peanuts', 'saltysalt', 1, 16, 'sha1')
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
discoverBrowserProfileDirs,
|
|
13
13
|
findLocalStatePath,
|
|
14
14
|
getBrowserBasePath,
|
|
15
|
+
getAgentBrowserProfileDirs,
|
|
15
16
|
} from '@/shared/chromium'
|
|
16
17
|
import type { KeychainVariant } from '@/shared/chromium'
|
|
17
18
|
|
|
@@ -29,9 +30,11 @@ export class ChannelTokenExtractor {
|
|
|
29
30
|
private platform: NodeJS.Platform
|
|
30
31
|
private decryptor: ChromiumCookieDecryptor
|
|
31
32
|
private cookieReader: ChromiumCookieReader
|
|
33
|
+
private customBrowserProfileDirs: string[]
|
|
32
34
|
|
|
33
|
-
constructor(platform?: NodeJS.Platform) {
|
|
35
|
+
constructor(platform?: NodeJS.Platform, customBrowserProfileDirs?: string[]) {
|
|
34
36
|
this.platform = platform ?? process.platform
|
|
37
|
+
this.customBrowserProfileDirs = customBrowserProfileDirs ?? []
|
|
35
38
|
this.cookieReader = new ChromiumCookieReader()
|
|
36
39
|
this.decryptor = new ChromiumCookieDecryptor({ platform: this.platform })
|
|
37
40
|
}
|
|
@@ -94,6 +97,11 @@ export class ChannelTokenExtractor {
|
|
|
94
97
|
}
|
|
95
98
|
}
|
|
96
99
|
|
|
100
|
+
for (const profileDir of getAgentBrowserProfileDirs({ customProfileDirs: this.customBrowserProfileDirs })) {
|
|
101
|
+
paths.push(join(profileDir, 'Cookies'))
|
|
102
|
+
paths.push(join(profileDir, 'Network', 'Cookies'))
|
|
103
|
+
}
|
|
104
|
+
|
|
97
105
|
return paths
|
|
98
106
|
}
|
|
99
107
|
|
|
@@ -105,16 +113,27 @@ export class ChannelTokenExtractor {
|
|
|
105
113
|
const results: ExtractedChannelToken[] = []
|
|
106
114
|
const seenAccounts = new Set<string>()
|
|
107
115
|
|
|
116
|
+
if (this.customBrowserProfileDirs.length > 0) {
|
|
117
|
+
for (const browserResult of await this.extractAllFromBrowserPaths()) {
|
|
118
|
+
if (!seenAccounts.has(browserResult.accountCookie)) {
|
|
119
|
+
seenAccounts.add(browserResult.accountCookie)
|
|
120
|
+
results.push(browserResult)
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
108
125
|
const desktopResult = await this.extractFromDesktopApp()
|
|
109
126
|
if (desktopResult && !seenAccounts.has(desktopResult.accountCookie)) {
|
|
110
127
|
seenAccounts.add(desktopResult.accountCookie)
|
|
111
128
|
results.push(desktopResult)
|
|
112
129
|
}
|
|
113
130
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
seenAccounts.
|
|
117
|
-
|
|
131
|
+
if (this.customBrowserProfileDirs.length === 0) {
|
|
132
|
+
for (const browserResult of await this.extractAllFromBrowserPaths()) {
|
|
133
|
+
if (!seenAccounts.has(browserResult.accountCookie)) {
|
|
134
|
+
seenAccounts.add(browserResult.accountCookie)
|
|
135
|
+
results.push(browserResult)
|
|
136
|
+
}
|
|
118
137
|
}
|
|
119
138
|
}
|
|
120
139
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { describe, expect,
|
|
1
|
+
import { describe, expect, it } from 'bun:test'
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
ChannelAccountSchema,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from './types'
|
|
11
11
|
|
|
12
12
|
describe('channel types', () => {
|
|
13
|
-
|
|
13
|
+
it('accepts a valid workspace entry', () => {
|
|
14
14
|
const result = ChannelWorkspaceEntrySchema.safeParse({
|
|
15
15
|
workspace_id: '232986',
|
|
16
16
|
workspace_name: 'Support',
|
|
@@ -23,7 +23,7 @@ describe('channel types', () => {
|
|
|
23
23
|
expect(result.success).toBe(true)
|
|
24
24
|
})
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
it('accepts a workspace entry without session_cookie', () => {
|
|
27
27
|
const result = ChannelWorkspaceEntrySchema.safeParse({
|
|
28
28
|
workspace_id: '232986',
|
|
29
29
|
workspace_name: 'Support',
|
|
@@ -33,7 +33,7 @@ describe('channel types', () => {
|
|
|
33
33
|
expect(result.success).toBe(true)
|
|
34
34
|
})
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
it('rejects a workspace entry missing account_cookie', () => {
|
|
37
37
|
const result = ChannelWorkspaceEntrySchema.safeParse({
|
|
38
38
|
workspace_id: '232986',
|
|
39
39
|
workspace_name: 'Support',
|
|
@@ -42,7 +42,7 @@ describe('channel types', () => {
|
|
|
42
42
|
expect(result.success).toBe(false)
|
|
43
43
|
})
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
it('accepts a valid config', () => {
|
|
46
46
|
const result = ChannelConfigSchema.safeParse({
|
|
47
47
|
current: { workspace_id: '232986' },
|
|
48
48
|
workspaces: {
|
|
@@ -58,7 +58,7 @@ describe('channel types', () => {
|
|
|
58
58
|
expect(result.success).toBe(true)
|
|
59
59
|
})
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
it('accepts a valid account', () => {
|
|
62
62
|
const result = ChannelAccountSchema.safeParse({
|
|
63
63
|
id: '493041',
|
|
64
64
|
name: 'Devxoul',
|
|
@@ -72,7 +72,7 @@ describe('channel types', () => {
|
|
|
72
72
|
expect(result.success).toBe(true)
|
|
73
73
|
})
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
it('rejects an invalid account', () => {
|
|
76
76
|
const result = ChannelAccountSchema.safeParse({
|
|
77
77
|
id: '493041',
|
|
78
78
|
name: 'Devxoul',
|
|
@@ -86,7 +86,7 @@ describe('channel types', () => {
|
|
|
86
86
|
expect(result.success).toBe(false)
|
|
87
87
|
})
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
it('accepts a valid message with blocks', () => {
|
|
90
90
|
const result = ChannelMessageSchema.safeParse({
|
|
91
91
|
id: 'msg_1',
|
|
92
92
|
channelId: '232986',
|
|
@@ -99,7 +99,7 @@ describe('channel types', () => {
|
|
|
99
99
|
expect(result.success).toBe(true)
|
|
100
100
|
})
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
it('rejects an invalid message block payload', () => {
|
|
103
103
|
const result = ChannelMessageSchema.safeParse({
|
|
104
104
|
id: 'msg_1',
|
|
105
105
|
blocks: [{ type: 'text', value: 123 }],
|
|
@@ -108,7 +108,7 @@ describe('channel types', () => {
|
|
|
108
108
|
expect(result.success).toBe(false)
|
|
109
109
|
})
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
it('accepts a valid group', () => {
|
|
112
112
|
const result = ChannelGroupSchema.safeParse({
|
|
113
113
|
id: 'group_1',
|
|
114
114
|
channelId: '232986',
|
|
@@ -120,7 +120,7 @@ describe('channel types', () => {
|
|
|
120
120
|
expect(result.success).toBe(true)
|
|
121
121
|
})
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
it('rejects an invalid group', () => {
|
|
124
124
|
const result = ChannelGroupSchema.safeParse({
|
|
125
125
|
id: 'group_1',
|
|
126
126
|
channelId: '232986',
|
|
@@ -131,7 +131,7 @@ describe('channel types', () => {
|
|
|
131
131
|
expect(result.success).toBe(false)
|
|
132
132
|
})
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
it('stores the code on ChannelError', () => {
|
|
135
135
|
const error = new ChannelError('boom', 'CHANNEL_FAILED')
|
|
136
136
|
|
|
137
137
|
expect(error).toBeInstanceOf(Error)
|
|
@@ -23,6 +23,15 @@ program
|
|
|
23
23
|
.option('--pretty', 'Pretty-print JSON output')
|
|
24
24
|
.option('--workspace <id>', 'Workspace ID to use')
|
|
25
25
|
.option('--bot <name>', 'Bot name to use for sending messages')
|
|
26
|
+
.hook('preAction', (thisCmd, actionCmd) => {
|
|
27
|
+
for (const [key, value] of Object.entries(thisCmd.opts())) {
|
|
28
|
+
if (value === undefined) continue
|
|
29
|
+
const source = actionCmd.getOptionValueSource(key)
|
|
30
|
+
if (source === undefined || source === 'default') {
|
|
31
|
+
actionCmd.setOptionValue(key, value)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
})
|
|
26
35
|
|
|
27
36
|
program.addCommand(authCommand)
|
|
28
37
|
program.addCommand(whoamiCommand)
|